Bell 32V release origin/Bell-Release Bell-32V
authorTom London <tbl@research.uucp>
Thu, 3 May 1979 04:26:55 +0000 (23:26 -0500)
committerTom London <tbl@research.uucp>
Thu, 3 May 1979 04:26:55 +0000 (23:26 -0500)
Snapshot of the completed development branch

Synthesized-from: 32v

1822 files changed:
.ref-Research-V7/ALU-USA-statement.pdf [deleted file]
.ref-Research-V7/Caldera-license.pdf [deleted file]
.ref-Research-V7/LICENSE [deleted file]
.ref-Research-V7/README.md [deleted file]
.ref-Research-V7/bin/1 [deleted file]
.ref-Research-V7/bin/calendar [deleted file]
.ref-Research-V7/bin/diff3 [deleted file]
.ref-Research-V7/bin/false [deleted file]
.ref-Research-V7/bin/lint [deleted file]
.ref-Research-V7/bin/lookbib [deleted file]
.ref-Research-V7/bin/lorder [deleted file]
.ref-Research-V7/bin/man [deleted file]
.ref-Research-V7/bin/nohup [deleted file]
.ref-Research-V7/bin/pcc [deleted file]
.ref-Research-V7/bin/plot [deleted file]
.ref-Research-V7/bin/spell [deleted file]
.ref-Research-V7/bin/struct [deleted file]
.ref-Research-V7/bin/true [deleted file]
.ref-Research-V7/dev/makefile [deleted file]
.ref-Research-V7/etc/ddate [deleted file]
.ref-Research-V7/etc/group [deleted file]
.ref-Research-V7/etc/passwd [deleted file]
.ref-Research-V7/etc/rc [deleted file]
.ref-Research-V7/etc/ttys [deleted file]
.ref-Research-V7/etc/utmp [deleted file]
.ref-Research-V7/usr/dict/papers/Ind.ic [deleted file]
.ref-Research-V7/usr/dict/papers/Rv7man [deleted file]
.ref-Research-V7/usr/dict/papers/runinv [deleted file]
.ref-Research-V7/usr/dict/spellhist [deleted file]
.ref-Research-V7/usr/dict/words [deleted file]
.ref-Research-V7/usr/doc/README [deleted file]
.ref-Research-V7/usr/doc/adb/tut [deleted file]
.ref-Research-V7/usr/doc/adb/tut1 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae.mac [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae0 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae1 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae2 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae3 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae4 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae5 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae6 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae7 [deleted file]
.ref-Research-V7/usr/doc/adv.ed/ae9 [deleted file]
.ref-Research-V7/usr/doc/assembler [deleted file]
.ref-Research-V7/usr/doc/awk [deleted file]
.ref-Research-V7/usr/doc/bc [deleted file]
.ref-Research-V7/usr/doc/beginners/u.mac [deleted file]
.ref-Research-V7/usr/doc/beginners/u0 [deleted file]
.ref-Research-V7/usr/doc/beginners/u1 [deleted file]
.ref-Research-V7/usr/doc/beginners/u2 [deleted file]
.ref-Research-V7/usr/doc/beginners/u3 [deleted file]
.ref-Research-V7/usr/doc/beginners/u4 [deleted file]
.ref-Research-V7/usr/doc/beginners/u5 [deleted file]
.ref-Research-V7/usr/doc/cacm/p.mac [deleted file]
.ref-Research-V7/usr/doc/cacm/p1 [deleted file]
.ref-Research-V7/usr/doc/cacm/p2 [deleted file]
.ref-Research-V7/usr/doc/cacm/p3 [deleted file]
.ref-Research-V7/usr/doc/cacm/p4 [deleted file]
.ref-Research-V7/usr/doc/cacm/p5 [deleted file]
.ref-Research-V7/usr/doc/cacm/p6 [deleted file]
.ref-Research-V7/usr/doc/cman [deleted file]
.ref-Research-V7/usr/doc/ctour/cdoc0 [deleted file]
.ref-Research-V7/usr/doc/ctour/cdoc1 [deleted file]
.ref-Research-V7/usr/doc/ctour/cdoc2 [deleted file]
.ref-Research-V7/usr/doc/ctour/cdoc3 [deleted file]
.ref-Research-V7/usr/doc/ctour/cdoc4 [deleted file]
.ref-Research-V7/usr/doc/dc [deleted file]
.ref-Research-V7/usr/doc/edtut/e.mac [deleted file]
.ref-Research-V7/usr/doc/edtut/e0 [deleted file]
.ref-Research-V7/usr/doc/edtut/e1 [deleted file]
.ref-Research-V7/usr/doc/edtut/e2 [deleted file]
.ref-Research-V7/usr/doc/edtut/e3 [deleted file]
.ref-Research-V7/usr/doc/edtut/e4 [deleted file]
.ref-Research-V7/usr/doc/edtut/e5 [deleted file]
.ref-Research-V7/usr/doc/edtut/e6 [deleted file]
.ref-Research-V7/usr/doc/edtut/e7 [deleted file]
.ref-Research-V7/usr/doc/eqn/e.mac [deleted file]
.ref-Research-V7/usr/doc/eqn/e0 [deleted file]
.ref-Research-V7/usr/doc/eqn/e1 [deleted file]
.ref-Research-V7/usr/doc/eqn/e2 [deleted file]
.ref-Research-V7/usr/doc/eqn/e3 [deleted file]
.ref-Research-V7/usr/doc/eqn/e4 [deleted file]
.ref-Research-V7/usr/doc/eqn/e5 [deleted file]
.ref-Research-V7/usr/doc/eqn/e6 [deleted file]
.ref-Research-V7/usr/doc/eqn/e7 [deleted file]
.ref-Research-V7/usr/doc/eqn/g.mac [deleted file]
.ref-Research-V7/usr/doc/eqn/g0 [deleted file]
.ref-Research-V7/usr/doc/eqn/g1 [deleted file]
.ref-Research-V7/usr/doc/eqn/g2 [deleted file]
.ref-Research-V7/usr/doc/eqn/g3 [deleted file]
.ref-Research-V7/usr/doc/eqn/g4 [deleted file]
.ref-Research-V7/usr/doc/eqn/g5 [deleted file]
.ref-Research-V7/usr/doc/f77 [deleted file]
.ref-Research-V7/usr/doc/implement [deleted file]
.ref-Research-V7/usr/doc/index [deleted file]
.ref-Research-V7/usr/doc/iosys [deleted file]
.ref-Research-V7/usr/doc/learn/p0 [deleted file]
.ref-Research-V7/usr/doc/learn/p2 [deleted file]
.ref-Research-V7/usr/doc/learn/p3 [deleted file]
.ref-Research-V7/usr/doc/learn/p4 [deleted file]
.ref-Research-V7/usr/doc/learn/p5 [deleted file]
.ref-Research-V7/usr/doc/learn/p6 [deleted file]
.ref-Research-V7/usr/doc/learn/p7 [deleted file]
.ref-Research-V7/usr/doc/lex [deleted file]
.ref-Research-V7/usr/doc/lint [deleted file]
.ref-Research-V7/usr/doc/m4 [deleted file]
.ref-Research-V7/usr/doc/make [deleted file]
.ref-Research-V7/usr/doc/msmacros/ms [deleted file]
.ref-Research-V7/usr/doc/msmacros/refcard [deleted file]
.ref-Research-V7/usr/doc/password [deleted file]
.ref-Research-V7/usr/doc/porttour/porttour1 [deleted file]
.ref-Research-V7/usr/doc/porttour/porttour2 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m.mac [deleted file]
.ref-Research-V7/usr/doc/ratfor/m0 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m1 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m2 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m3 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m4 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m5 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m9 [deleted file]
.ref-Research-V7/usr/doc/ratfor/m99 [deleted file]
.ref-Research-V7/usr/doc/refer/pubuse [deleted file]
.ref-Research-V7/usr/doc/refer/refer [deleted file]
.ref-Research-V7/usr/doc/regen [deleted file]
.ref-Research-V7/usr/doc/run [deleted file]
.ref-Research-V7/usr/doc/scope [deleted file]
.ref-Research-V7/usr/doc/security [deleted file]
.ref-Research-V7/usr/doc/sed [deleted file]
.ref-Research-V7/usr/doc/setup [deleted file]
.ref-Research-V7/usr/doc/shell/t.mac [deleted file]
.ref-Research-V7/usr/doc/shell/t1 [deleted file]
.ref-Research-V7/usr/doc/shell/t2 [deleted file]
.ref-Research-V7/usr/doc/shell/t3 [deleted file]
.ref-Research-V7/usr/doc/shell/t4 [deleted file]
.ref-Research-V7/usr/doc/summary/hel.mac [deleted file]
.ref-Research-V7/usr/doc/summary/hel0 [deleted file]
.ref-Research-V7/usr/doc/summary/hel1 [deleted file]
.ref-Research-V7/usr/doc/summary/hel2 [deleted file]
.ref-Research-V7/usr/doc/summary/hel3 [deleted file]
.ref-Research-V7/usr/doc/summary/hel4 [deleted file]
.ref-Research-V7/usr/doc/summary/hel5 [deleted file]
.ref-Research-V7/usr/doc/summary/hel6 [deleted file]
.ref-Research-V7/usr/doc/tbl [deleted file]
.ref-Research-V7/usr/doc/troff/add [deleted file]
.ref-Research-V7/usr/doc/troff/m.mac [deleted file]
.ref-Research-V7/usr/doc/troff/m0 [deleted file]
.ref-Research-V7/usr/doc/troff/m0a [deleted file]
.ref-Research-V7/usr/doc/troff/m1 [deleted file]
.ref-Research-V7/usr/doc/troff/m2 [deleted file]
.ref-Research-V7/usr/doc/troff/m3 [deleted file]
.ref-Research-V7/usr/doc/troff/m4 [deleted file]
.ref-Research-V7/usr/doc/troff/m5 [deleted file]
.ref-Research-V7/usr/doc/troff/table1 [deleted file]
.ref-Research-V7/usr/doc/troff/table2 [deleted file]
.ref-Research-V7/usr/doc/troff/tprint [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt.mac [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt00 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt01 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt02 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt03 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt04 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt05 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt06 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt07 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt08 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt09 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt10 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt11 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt12 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt13 [deleted file]
.ref-Research-V7/usr/doc/trofftut/tt14 [deleted file]
.ref-Research-V7/usr/doc/trofftut/ttack [deleted file]
.ref-Research-V7/usr/doc/trofftut/ttcharset [deleted file]
.ref-Research-V7/usr/doc/trofftut/ttindex [deleted file]
.ref-Research-V7/usr/doc/uprog/cwscript [deleted file]
.ref-Research-V7/usr/doc/uprog/p.mac [deleted file]
.ref-Research-V7/usr/doc/uprog/p0 [deleted file]
.ref-Research-V7/usr/doc/uprog/p1 [deleted file]
.ref-Research-V7/usr/doc/uprog/p2 [deleted file]
.ref-Research-V7/usr/doc/uprog/p3 [deleted file]
.ref-Research-V7/usr/doc/uprog/p4 [deleted file]
.ref-Research-V7/usr/doc/uprog/p5 [deleted file]
.ref-Research-V7/usr/doc/uprog/p6 [deleted file]
.ref-Research-V7/usr/doc/uprog/p8 [deleted file]
.ref-Research-V7/usr/doc/uprog/p9 [deleted file]
.ref-Research-V7/usr/doc/uucp/implement [deleted file]
.ref-Research-V7/usr/doc/uucp/network [deleted file]
.ref-Research-V7/usr/doc/yacc/ss.. [deleted file]
.ref-Research-V7/usr/doc/yacc/ss0 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss1 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss2 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss3 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss4 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss5 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss6 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss7 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss8 [deleted file]
.ref-Research-V7/usr/doc/yacc/ss9 [deleted file]
.ref-Research-V7/usr/doc/yacc/ssA [deleted file]
.ref-Research-V7/usr/doc/yacc/ssB [deleted file]
.ref-Research-V7/usr/doc/yacc/ssa [deleted file]
.ref-Research-V7/usr/doc/yacc/ssb [deleted file]
.ref-Research-V7/usr/doc/yacc/ssc [deleted file]
.ref-Research-V7/usr/doc/yacc/ssd [deleted file]
.ref-Research-V7/usr/games/ching [deleted file]
.ref-Research-V7/usr/games/ching.d/hexagrams [deleted file]
.ref-Research-V7/usr/games/ching.d/macros [deleted file]
.ref-Research-V7/usr/games/lib/fortunes [deleted file]
.ref-Research-V7/usr/games/quiz.k/africa [deleted file]
.ref-Research-V7/usr/games/quiz.k/america [deleted file]
.ref-Research-V7/usr/games/quiz.k/areas [deleted file]
.ref-Research-V7/usr/games/quiz.k/arith [deleted file]
.ref-Research-V7/usr/games/quiz.k/asia [deleted file]
.ref-Research-V7/usr/games/quiz.k/babies [deleted file]
.ref-Research-V7/usr/games/quiz.k/bard [deleted file]
.ref-Research-V7/usr/games/quiz.k/chinese [deleted file]
.ref-Research-V7/usr/games/quiz.k/collectives [deleted file]
.ref-Research-V7/usr/games/quiz.k/ed [deleted file]
.ref-Research-V7/usr/games/quiz.k/elements [deleted file]
.ref-Research-V7/usr/games/quiz.k/europe [deleted file]
.ref-Research-V7/usr/games/quiz.k/greek [deleted file]
.ref-Research-V7/usr/games/quiz.k/inca [deleted file]
.ref-Research-V7/usr/games/quiz.k/index [deleted file]
.ref-Research-V7/usr/games/quiz.k/latin [deleted file]
.ref-Research-V7/usr/games/quiz.k/locomotive [deleted file]
.ref-Research-V7/usr/games/quiz.k/midearth [deleted file]
.ref-Research-V7/usr/games/quiz.k/morse [deleted file]
.ref-Research-V7/usr/games/quiz.k/murders [deleted file]
.ref-Research-V7/usr/games/quiz.k/poetry [deleted file]
.ref-Research-V7/usr/games/quiz.k/posneg [deleted file]
.ref-Research-V7/usr/games/quiz.k/pres [deleted file]
.ref-Research-V7/usr/games/quiz.k/province [deleted file]
.ref-Research-V7/usr/games/quiz.k/seq-easy [deleted file]
.ref-Research-V7/usr/games/quiz.k/seq-hard [deleted file]
.ref-Research-V7/usr/games/quiz.k/sexes [deleted file]
.ref-Research-V7/usr/games/quiz.k/sov [deleted file]
.ref-Research-V7/usr/games/quiz.k/spell [deleted file]
.ref-Research-V7/usr/games/quiz.k/state [deleted file]
.ref-Research-V7/usr/games/quiz.k/trek [deleted file]
.ref-Research-V7/usr/games/quiz.k/ucc [deleted file]
.ref-Research-V7/usr/games/ttt.k [deleted file]
.ref-Research-V7/usr/games/words [deleted file]
.ref-Research-V7/usr/include/a.out.h [deleted file]
.ref-Research-V7/usr/include/ar.h [deleted file]
.ref-Research-V7/usr/include/assert.h [deleted file]
.ref-Research-V7/usr/include/core.h [deleted file]
.ref-Research-V7/usr/include/ctype.h [deleted file]
.ref-Research-V7/usr/include/dk.h [deleted file]
.ref-Research-V7/usr/include/dumprestor.h [deleted file]
.ref-Research-V7/usr/include/errno.h [deleted file]
.ref-Research-V7/usr/include/execargs.h [deleted file]
.ref-Research-V7/usr/include/grp.h [deleted file]
.ref-Research-V7/usr/include/ident.h [deleted file]
.ref-Research-V7/usr/include/math.h [deleted file]
.ref-Research-V7/usr/include/mp.h [deleted file]
.ref-Research-V7/usr/include/olddump.h [deleted file]
.ref-Research-V7/usr/include/pack.h [deleted file]
.ref-Research-V7/usr/include/pwd.h [deleted file]
.ref-Research-V7/usr/include/setjmp.h [deleted file]
.ref-Research-V7/usr/include/sgtty.h [deleted file]
.ref-Research-V7/usr/include/signal.h [deleted file]
.ref-Research-V7/usr/include/stdio.h [deleted file]
.ref-Research-V7/usr/include/symbol.h [deleted file]
.ref-Research-V7/usr/include/sys.s [deleted file]
.ref-Research-V7/usr/include/sys/conf.h [deleted file]
.ref-Research-V7/usr/include/sys/pk.h [deleted file]
.ref-Research-V7/usr/include/sys/times.h [deleted file]
.ref-Research-V7/usr/include/time.h [deleted file]
.ref-Research-V7/usr/include/tp_defs.h [deleted file]
.ref-Research-V7/usr/include/utmp.h [deleted file]
.ref-Research-V7/usr/include/varargs.h [deleted file]
.ref-Research-V7/usr/include/whoami.h [deleted file]
.ref-Research-V7/usr/lib/cign [deleted file]
.ref-Research-V7/usr/lib/crontab [deleted file]
.ref-Research-V7/usr/lib/eign [deleted file]
.ref-Research-V7/usr/lib/learn/Linfo [deleted file]
.ref-Research-V7/usr/lib/learn/Xinfo [deleted file]
.ref-Research-V7/usr/lib/lex/ncform [deleted file]
.ref-Research-V7/usr/lib/llib-lc [deleted file]
.ref-Research-V7/usr/lib/llib-lm [deleted file]
.ref-Research-V7/usr/lib/llib-port [deleted file]
.ref-Research-V7/usr/lib/tmac/tmac.an [deleted file]
.ref-Research-V7/usr/lib/tmac/tmac.s [deleted file]
.ref-Research-V7/usr/lib/tmac/tmac.scover [deleted file]
.ref-Research-V7/usr/lib/tmac/tmac.sdisp [deleted file]
.ref-Research-V7/usr/lib/tmac/tmac.skeep [deleted file]
.ref-Research-V7/usr/lib/tmac/tmac.srefs [deleted file]
.ref-Research-V7/usr/lib/units [deleted file]
.ref-Research-V7/usr/lib/uucp/L-devices [deleted file]
.ref-Research-V7/usr/lib/uucp/L-dialcodes [deleted file]
.ref-Research-V7/usr/lib/uucp/L.sys [deleted file]
.ref-Research-V7/usr/lib/uucp/USERFILE [deleted file]
.ref-Research-V7/usr/lib/yaccpar [deleted file]
.ref-Research-V7/usr/man/man0/intro [deleted file]
.ref-Research-V7/usr/man/man0/permindex [deleted file]
.ref-Research-V7/usr/man/man0/pref [deleted file]
.ref-Research-V7/usr/man/man0/ptxmac [deleted file]
.ref-Research-V7/usr/man/man0/title [deleted file]
.ref-Research-V7/usr/man/man0/xx [deleted file]
.ref-Research-V7/usr/man/man1/ac.1m [deleted file]
.ref-Research-V7/usr/man/man1/adb.1 [deleted file]
.ref-Research-V7/usr/man/man1/ar.1 [deleted file]
.ref-Research-V7/usr/man/man1/arcv.1m [deleted file]
.ref-Research-V7/usr/man/man1/as.1 [deleted file]
.ref-Research-V7/usr/man/man1/at.1 [deleted file]
.ref-Research-V7/usr/man/man1/awk.1 [deleted file]
.ref-Research-V7/usr/man/man1/bas.1 [deleted file]
.ref-Research-V7/usr/man/man1/basename.1 [deleted file]
.ref-Research-V7/usr/man/man1/bc.1 [deleted file]
.ref-Research-V7/usr/man/man1/cal.1 [deleted file]
.ref-Research-V7/usr/man/man1/calendar.1 [deleted file]
.ref-Research-V7/usr/man/man1/cat.1 [deleted file]
.ref-Research-V7/usr/man/man1/cb.1 [deleted file]
.ref-Research-V7/usr/man/man1/cc.1 [deleted file]
.ref-Research-V7/usr/man/man1/cd.1 [deleted file]
.ref-Research-V7/usr/man/man1/chmod.1 [deleted file]
.ref-Research-V7/usr/man/man1/chown.1 [deleted file]
.ref-Research-V7/usr/man/man1/clri.1m [deleted file]
.ref-Research-V7/usr/man/man1/cmp.1 [deleted file]
.ref-Research-V7/usr/man/man1/col.1 [deleted file]
.ref-Research-V7/usr/man/man1/comm.1 [deleted file]
.ref-Research-V7/usr/man/man1/cp.1 [deleted file]
.ref-Research-V7/usr/man/man1/crypt.1 [deleted file]
.ref-Research-V7/usr/man/man1/cu.1c [deleted file]
.ref-Research-V7/usr/man/man1/date.1 [deleted file]
.ref-Research-V7/usr/man/man1/dc.1 [deleted file]
.ref-Research-V7/usr/man/man1/dcheck.1m [deleted file]
.ref-Research-V7/usr/man/man1/dd.1 [deleted file]
.ref-Research-V7/usr/man/man1/deroff.1 [deleted file]
.ref-Research-V7/usr/man/man1/df.1m [deleted file]
.ref-Research-V7/usr/man/man1/diff.1 [deleted file]
.ref-Research-V7/usr/man/man1/diff3.1 [deleted file]
.ref-Research-V7/usr/man/man1/du.1 [deleted file]
.ref-Research-V7/usr/man/man1/dump.1m [deleted file]
.ref-Research-V7/usr/man/man1/dumpdir.1m [deleted file]
.ref-Research-V7/usr/man/man1/echo.1 [deleted file]
.ref-Research-V7/usr/man/man1/ed.1 [deleted file]
.ref-Research-V7/usr/man/man1/eqn.1 [deleted file]
.ref-Research-V7/usr/man/man1/expr.1 [deleted file]
.ref-Research-V7/usr/man/man1/f77.1 [deleted file]
.ref-Research-V7/usr/man/man1/factor.1 [deleted file]
.ref-Research-V7/usr/man/man1/file.1 [deleted file]
.ref-Research-V7/usr/man/man1/find.1 [deleted file]
.ref-Research-V7/usr/man/man1/graph.1g [deleted file]
.ref-Research-V7/usr/man/man1/grep.1 [deleted file]
.ref-Research-V7/usr/man/man1/icheck.1m [deleted file]
.ref-Research-V7/usr/man/man1/intro.1 [deleted file]
.ref-Research-V7/usr/man/man1/iostat.1m [deleted file]
.ref-Research-V7/usr/man/man1/join.1 [deleted file]
.ref-Research-V7/usr/man/man1/kill.1 [deleted file]
.ref-Research-V7/usr/man/man1/ld.1 [deleted file]
.ref-Research-V7/usr/man/man1/lex.1 [deleted file]
.ref-Research-V7/usr/man/man1/lint.1 [deleted file]
.ref-Research-V7/usr/man/man1/ln.1 [deleted file]
.ref-Research-V7/usr/man/man1/login.1 [deleted file]
.ref-Research-V7/usr/man/man1/look.1 [deleted file]
.ref-Research-V7/usr/man/man1/lookall.1 [deleted file]
.ref-Research-V7/usr/man/man1/lorder.1 [deleted file]
.ref-Research-V7/usr/man/man1/ls.1 [deleted file]
.ref-Research-V7/usr/man/man1/m4.1 [deleted file]
.ref-Research-V7/usr/man/man1/mail.1 [deleted file]
.ref-Research-V7/usr/man/man1/make.1 [deleted file]
.ref-Research-V7/usr/man/man1/man.1 [deleted file]
.ref-Research-V7/usr/man/man1/mesg.1 [deleted file]
.ref-Research-V7/usr/man/man1/mkconf.1m [deleted file]
.ref-Research-V7/usr/man/man1/mkdir.1 [deleted file]
.ref-Research-V7/usr/man/man1/mkfs.1m [deleted file]
.ref-Research-V7/usr/man/man1/mknod.1m [deleted file]
.ref-Research-V7/usr/man/man1/mount.1m [deleted file]
.ref-Research-V7/usr/man/man1/mv.1 [deleted file]
.ref-Research-V7/usr/man/man1/ncheck.1m [deleted file]
.ref-Research-V7/usr/man/man1/newgrp.1 [deleted file]
.ref-Research-V7/usr/man/man1/nice.1 [deleted file]
.ref-Research-V7/usr/man/man1/nm.1 [deleted file]
.ref-Research-V7/usr/man/man1/od.1 [deleted file]
.ref-Research-V7/usr/man/man1/passwd.1 [deleted file]
.ref-Research-V7/usr/man/man1/plot.1g [deleted file]
.ref-Research-V7/usr/man/man1/pr.1 [deleted file]
.ref-Research-V7/usr/man/man1/prep.1 [deleted file]
.ref-Research-V7/usr/man/man1/prof.1 [deleted file]
.ref-Research-V7/usr/man/man1/ps.1 [deleted file]
.ref-Research-V7/usr/man/man1/pstat.1m [deleted file]
.ref-Research-V7/usr/man/man1/ptx.1 [deleted file]
.ref-Research-V7/usr/man/man1/pubindex.1 [deleted file]
.ref-Research-V7/usr/man/man1/pwd.1 [deleted file]
.ref-Research-V7/usr/man/man1/quot.1m [deleted file]
.ref-Research-V7/usr/man/man1/ranlib.1 [deleted file]
.ref-Research-V7/usr/man/man1/ratfor.1 [deleted file]
.ref-Research-V7/usr/man/man1/refer.1 [deleted file]
.ref-Research-V7/usr/man/man1/restor.1m [deleted file]
.ref-Research-V7/usr/man/man1/rev.1 [deleted file]
.ref-Research-V7/usr/man/man1/rm.1 [deleted file]
.ref-Research-V7/usr/man/man1/roff.1 [deleted file]
.ref-Research-V7/usr/man/man1/sa.1m [deleted file]
.ref-Research-V7/usr/man/man1/sed.1 [deleted file]
.ref-Research-V7/usr/man/man1/sh.1 [deleted file]
.ref-Research-V7/usr/man/man1/size.1 [deleted file]
.ref-Research-V7/usr/man/man1/sleep.1 [deleted file]
.ref-Research-V7/usr/man/man1/sort.1 [deleted file]
.ref-Research-V7/usr/man/man1/spell.1 [deleted file]
.ref-Research-V7/usr/man/man1/spline.1g [deleted file]
.ref-Research-V7/usr/man/man1/split.1 [deleted file]
.ref-Research-V7/usr/man/man1/strip.1 [deleted file]
.ref-Research-V7/usr/man/man1/struct.1 [deleted file]
.ref-Research-V7/usr/man/man1/stty.1 [deleted file]
.ref-Research-V7/usr/man/man1/su.1 [deleted file]
.ref-Research-V7/usr/man/man1/sum.1 [deleted file]
.ref-Research-V7/usr/man/man1/sync.1m [deleted file]
.ref-Research-V7/usr/man/man1/tabs.1 [deleted file]
.ref-Research-V7/usr/man/man1/tail.1 [deleted file]
.ref-Research-V7/usr/man/man1/tar.1 [deleted file]
.ref-Research-V7/usr/man/man1/tbl.1 [deleted file]
.ref-Research-V7/usr/man/man1/tc.1 [deleted file]
.ref-Research-V7/usr/man/man1/tee.1 [deleted file]
.ref-Research-V7/usr/man/man1/test.1 [deleted file]
.ref-Research-V7/usr/man/man1/time.1 [deleted file]
.ref-Research-V7/usr/man/man1/tk.1 [deleted file]
.ref-Research-V7/usr/man/man1/touch.1 [deleted file]
.ref-Research-V7/usr/man/man1/tp.1 [deleted file]
.ref-Research-V7/usr/man/man1/tr.1 [deleted file]
.ref-Research-V7/usr/man/man1/troff.1 [deleted file]
.ref-Research-V7/usr/man/man1/true.1 [deleted file]
.ref-Research-V7/usr/man/man1/tsort.1 [deleted file]
.ref-Research-V7/usr/man/man1/tty.1 [deleted file]
.ref-Research-V7/usr/man/man1/uniq.1 [deleted file]
.ref-Research-V7/usr/man/man1/units.1 [deleted file]
.ref-Research-V7/usr/man/man1/uucp.1c [deleted file]
.ref-Research-V7/usr/man/man1/uux.1c [deleted file]
.ref-Research-V7/usr/man/man1/wait.1 [deleted file]
.ref-Research-V7/usr/man/man1/wall.1m [deleted file]
.ref-Research-V7/usr/man/man1/wc.1 [deleted file]
.ref-Research-V7/usr/man/man1/who.1 [deleted file]
.ref-Research-V7/usr/man/man1/write.1 [deleted file]
.ref-Research-V7/usr/man/man1/xsend.1 [deleted file]
.ref-Research-V7/usr/man/man1/yacc.1 [deleted file]
.ref-Research-V7/usr/man/man2/access.2 [deleted file]
.ref-Research-V7/usr/man/man2/acct.2 [deleted file]
.ref-Research-V7/usr/man/man2/alarm.2 [deleted file]
.ref-Research-V7/usr/man/man2/brk.2 [deleted file]
.ref-Research-V7/usr/man/man2/chdir.2 [deleted file]
.ref-Research-V7/usr/man/man2/chmod.2 [deleted file]
.ref-Research-V7/usr/man/man2/chown.2 [deleted file]
.ref-Research-V7/usr/man/man2/close.2 [deleted file]
.ref-Research-V7/usr/man/man2/creat.2 [deleted file]
.ref-Research-V7/usr/man/man2/dup.2 [deleted file]
.ref-Research-V7/usr/man/man2/exec.2 [deleted file]
.ref-Research-V7/usr/man/man2/exit.2 [deleted file]
.ref-Research-V7/usr/man/man2/fork.2 [deleted file]
.ref-Research-V7/usr/man/man2/getpid.2 [deleted file]
.ref-Research-V7/usr/man/man2/getuid.2 [deleted file]
.ref-Research-V7/usr/man/man2/indir.2 [deleted file]
.ref-Research-V7/usr/man/man2/intro.2 [deleted file]
.ref-Research-V7/usr/man/man2/ioctl.2 [deleted file]
.ref-Research-V7/usr/man/man2/kill.2 [deleted file]
.ref-Research-V7/usr/man/man2/link.2 [deleted file]
.ref-Research-V7/usr/man/man2/lock.2 [deleted file]
.ref-Research-V7/usr/man/man2/lseek.2 [deleted file]
.ref-Research-V7/usr/man/man2/mknod.2 [deleted file]
.ref-Research-V7/usr/man/man2/mount.2 [deleted file]
.ref-Research-V7/usr/man/man2/mpx.2 [deleted file]
.ref-Research-V7/usr/man/man2/mpxcall.2 [deleted file]
.ref-Research-V7/usr/man/man2/nice.2 [deleted file]
.ref-Research-V7/usr/man/man2/open.2 [deleted file]
.ref-Research-V7/usr/man/man2/pause.2 [deleted file]
.ref-Research-V7/usr/man/man2/phys.2 [deleted file]
.ref-Research-V7/usr/man/man2/pipe.2 [deleted file]
.ref-Research-V7/usr/man/man2/pkon.2 [deleted file]
.ref-Research-V7/usr/man/man2/profil.2 [deleted file]
.ref-Research-V7/usr/man/man2/ptrace.2 [deleted file]
.ref-Research-V7/usr/man/man2/read.2 [deleted file]
.ref-Research-V7/usr/man/man2/setuid.2 [deleted file]
.ref-Research-V7/usr/man/man2/signal.2 [deleted file]
.ref-Research-V7/usr/man/man2/stat.2 [deleted file]
.ref-Research-V7/usr/man/man2/stime.2 [deleted file]
.ref-Research-V7/usr/man/man2/sync.2 [deleted file]
.ref-Research-V7/usr/man/man2/time.2 [deleted file]
.ref-Research-V7/usr/man/man2/times.2 [deleted file]
.ref-Research-V7/usr/man/man2/umask.2 [deleted file]
.ref-Research-V7/usr/man/man2/unlink.2 [deleted file]
.ref-Research-V7/usr/man/man2/utime.2 [deleted file]
.ref-Research-V7/usr/man/man2/wait.2 [deleted file]
.ref-Research-V7/usr/man/man2/write.2 [deleted file]
.ref-Research-V7/usr/man/man3/abort.3 [deleted file]
.ref-Research-V7/usr/man/man3/abs.3 [deleted file]
.ref-Research-V7/usr/man/man3/assert.3x [deleted file]
.ref-Research-V7/usr/man/man3/atof.3 [deleted file]
.ref-Research-V7/usr/man/man3/crypt.3 [deleted file]
.ref-Research-V7/usr/man/man3/ctime.3 [deleted file]
.ref-Research-V7/usr/man/man3/ctype.3 [deleted file]
.ref-Research-V7/usr/man/man3/dbm.3x [deleted file]
.ref-Research-V7/usr/man/man3/ecvt.3 [deleted file]
.ref-Research-V7/usr/man/man3/end.3 [deleted file]
.ref-Research-V7/usr/man/man3/exp.3m [deleted file]
.ref-Research-V7/usr/man/man3/fclose.3s [deleted file]
.ref-Research-V7/usr/man/man3/ferror.3s [deleted file]
.ref-Research-V7/usr/man/man3/floor.3m [deleted file]
.ref-Research-V7/usr/man/man3/fopen.3s [deleted file]
.ref-Research-V7/usr/man/man3/fread.3s [deleted file]
.ref-Research-V7/usr/man/man3/frexp.3 [deleted file]
.ref-Research-V7/usr/man/man3/fseek.3s [deleted file]
.ref-Research-V7/usr/man/man3/getc.3s [deleted file]
.ref-Research-V7/usr/man/man3/getenv.3 [deleted file]
.ref-Research-V7/usr/man/man3/getgrent.3 [deleted file]
.ref-Research-V7/usr/man/man3/getlogin.3 [deleted file]
.ref-Research-V7/usr/man/man3/getpass.3 [deleted file]
.ref-Research-V7/usr/man/man3/getpw.3 [deleted file]
.ref-Research-V7/usr/man/man3/getpwent.3 [deleted file]
.ref-Research-V7/usr/man/man3/gets.3s [deleted file]
.ref-Research-V7/usr/man/man3/hypot.3m [deleted file]
.ref-Research-V7/usr/man/man3/intro.3 [deleted file]
.ref-Research-V7/usr/man/man3/j0.3m [deleted file]
.ref-Research-V7/usr/man/man3/l3tol.3 [deleted file]
.ref-Research-V7/usr/man/man3/malloc.3 [deleted file]
.ref-Research-V7/usr/man/man3/mktemp.3 [deleted file]
.ref-Research-V7/usr/man/man3/monitor.3 [deleted file]
.ref-Research-V7/usr/man/man3/mp.3x [deleted file]
.ref-Research-V7/usr/man/man3/nlist.3 [deleted file]
.ref-Research-V7/usr/man/man3/perror.3 [deleted file]
.ref-Research-V7/usr/man/man3/pkopen.3 [deleted file]
.ref-Research-V7/usr/man/man3/plot.3x [deleted file]
.ref-Research-V7/usr/man/man3/popen.3s [deleted file]
.ref-Research-V7/usr/man/man3/printf.3s [deleted file]
.ref-Research-V7/usr/man/man3/putc.3s [deleted file]
.ref-Research-V7/usr/man/man3/puts.3s [deleted file]
.ref-Research-V7/usr/man/man3/qsort.3 [deleted file]
.ref-Research-V7/usr/man/man3/rand.3 [deleted file]
.ref-Research-V7/usr/man/man3/scanf.3s [deleted file]
.ref-Research-V7/usr/man/man3/setbuf.3s [deleted file]
.ref-Research-V7/usr/man/man3/setjmp.3 [deleted file]
.ref-Research-V7/usr/man/man3/sin.3m [deleted file]
.ref-Research-V7/usr/man/man3/sinh.3m [deleted file]
.ref-Research-V7/usr/man/man3/sleep.3 [deleted file]
.ref-Research-V7/usr/man/man3/stdio.3s [deleted file]
.ref-Research-V7/usr/man/man3/string.3 [deleted file]
.ref-Research-V7/usr/man/man3/swab.3 [deleted file]
.ref-Research-V7/usr/man/man3/system.3 [deleted file]
.ref-Research-V7/usr/man/man3/ttyname.3 [deleted file]
.ref-Research-V7/usr/man/man3/ungetc.3s [deleted file]
.ref-Research-V7/usr/man/man4/cat.4 [deleted file]
.ref-Research-V7/usr/man/man4/dn.4 [deleted file]
.ref-Research-V7/usr/man/man4/du.4 [deleted file]
.ref-Research-V7/usr/man/man4/hp.4 [deleted file]
.ref-Research-V7/usr/man/man4/hs.4 [deleted file]
.ref-Research-V7/usr/man/man4/ht.4 [deleted file]
.ref-Research-V7/usr/man/man4/mem.4 [deleted file]
.ref-Research-V7/usr/man/man4/null.4 [deleted file]
.ref-Research-V7/usr/man/man4/pk.4 [deleted file]
.ref-Research-V7/usr/man/man4/rf.4 [deleted file]
.ref-Research-V7/usr/man/man4/rk.4 [deleted file]
.ref-Research-V7/usr/man/man4/rp.4 [deleted file]
.ref-Research-V7/usr/man/man4/tc.4 [deleted file]
.ref-Research-V7/usr/man/man4/tm.4 [deleted file]
.ref-Research-V7/usr/man/man4/tty.4 [deleted file]
.ref-Research-V7/usr/man/man4/vp.4 [deleted file]
.ref-Research-V7/usr/man/man5/a.out.5 [deleted file]
.ref-Research-V7/usr/man/man5/acct.5 [deleted file]
.ref-Research-V7/usr/man/man5/ar.5 [deleted file]
.ref-Research-V7/usr/man/man5/core.5 [deleted file]
.ref-Research-V7/usr/man/man5/dir.5 [deleted file]
.ref-Research-V7/usr/man/man5/dump.5 [deleted file]
.ref-Research-V7/usr/man/man5/environ.5 [deleted file]
.ref-Research-V7/usr/man/man5/filsys.5 [deleted file]
.ref-Research-V7/usr/man/man5/group.5 [deleted file]
.ref-Research-V7/usr/man/man5/mpxio.5 [deleted file]
.ref-Research-V7/usr/man/man5/mtab.5 [deleted file]
.ref-Research-V7/usr/man/man5/passwd.5 [deleted file]
.ref-Research-V7/usr/man/man5/plot.5 [deleted file]
.ref-Research-V7/usr/man/man5/tp.5 [deleted file]
.ref-Research-V7/usr/man/man5/ttys.5 [deleted file]
.ref-Research-V7/usr/man/man5/types.5 [deleted file]
.ref-Research-V7/usr/man/man5/utmp.5 [deleted file]
.ref-Research-V7/usr/man/man6/arithmetic.6 [deleted file]
.ref-Research-V7/usr/man/man6/backgammon.6 [deleted file]
.ref-Research-V7/usr/man/man6/banner.6 [deleted file]
.ref-Research-V7/usr/man/man6/bcd.6 [deleted file]
.ref-Research-V7/usr/man/man6/bj.6 [deleted file]
.ref-Research-V7/usr/man/man6/checkers.6 [deleted file]
.ref-Research-V7/usr/man/man6/chess.6 [deleted file]
.ref-Research-V7/usr/man/man6/ching.6 [deleted file]
.ref-Research-V7/usr/man/man6/cubic.6 [deleted file]
.ref-Research-V7/usr/man/man6/maze.6 [deleted file]
.ref-Research-V7/usr/man/man6/moo.6 [deleted file]
.ref-Research-V7/usr/man/man6/quiz.6 [deleted file]
.ref-Research-V7/usr/man/man6/reversi.6 [deleted file]
.ref-Research-V7/usr/man/man6/ttt.6 [deleted file]
.ref-Research-V7/usr/man/man6/words.6 [deleted file]
.ref-Research-V7/usr/man/man6/wump.6 [deleted file]
.ref-Research-V7/usr/man/man7/ascii.7 [deleted file]
.ref-Research-V7/usr/man/man7/eqnchar.7 [deleted file]
.ref-Research-V7/usr/man/man7/hier.7 [deleted file]
.ref-Research-V7/usr/man/man7/man.7 [deleted file]
.ref-Research-V7/usr/man/man7/ms.7 [deleted file]
.ref-Research-V7/usr/man/man7/term.7 [deleted file]
.ref-Research-V7/usr/man/man8/boot.8 [deleted file]
.ref-Research-V7/usr/man/man8/crash.8 [deleted file]
.ref-Research-V7/usr/man/man8/cron.8 [deleted file]
.ref-Research-V7/usr/man/man8/getty.8 [deleted file]
.ref-Research-V7/usr/man/man8/init.8 [deleted file]
.ref-Research-V7/usr/man/man8/lpd.8 [deleted file]
.ref-Research-V7/usr/man/man8/makekey.8 [deleted file]
.ref-Research-V7/usr/man/man8/update.8 [deleted file]
.ref-Research-V7/usr/mdec/hpuboot.s [deleted file]
.ref-Research-V7/usr/mdec/makefile [deleted file]
.ref-Research-V7/usr/mdec/rpuboot.s [deleted file]
.ref-Research-V7/usr/pub/ascii [deleted file]
.ref-Research-V7/usr/pub/eqnchar [deleted file]
.ref-Research-V7/usr/pub/greek [deleted file]
.ref-Research-V7/usr/spool/at/lasttimedone [deleted file]
.ref-Research-V7/usr/spool/dpd/empty [deleted file]
.ref-Research-V7/usr/spool/mail/dmr [deleted file]
.ref-Research-V7/usr/spool/mail/root [deleted file]
.ref-Research-V7/usr/spool/secretmail/notice [deleted file]
.ref-Research-V7/usr/src/cmd/ac.c [deleted file]
.ref-Research-V7/usr/src/cmd/accton.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/access.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/command.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/defs.h [deleted file]
.ref-Research-V7/usr/src/cmd/adb/dummy.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/expr.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/findfn.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/format.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/input.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/mac.h [deleted file]
.ref-Research-V7/usr/src/cmd/adb/machine.h [deleted file]
.ref-Research-V7/usr/src/cmd/adb/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/adb/message.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/mode.h [deleted file]
.ref-Research-V7/usr/src/cmd/adb/opset.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/output.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/pcs.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/print.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/runpcs.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/setup.c [deleted file]
.ref-Research-V7/usr/src/cmd/adb/sym.c [deleted file]
.ref-Research-V7/usr/src/cmd/ar.c [deleted file]
.ref-Research-V7/usr/src/cmd/arcv.c [deleted file]
.ref-Research-V7/usr/src/cmd/as/as11.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as12.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as13.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as14.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as15.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as16.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as17.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as18.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as19.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as21.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as22.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as23.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as24.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as25.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as26.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as27.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as28.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/as29.s [deleted file]
.ref-Research-V7/usr/src/cmd/as/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/at.c [deleted file]
.ref-Research-V7/usr/src/cmd/atrun.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/awk.def [deleted file]
.ref-Research-V7/usr/src/cmd/awk/awk.g.y [deleted file]
.ref-Research-V7/usr/src/cmd/awk/awk.lx.l [deleted file]
.ref-Research-V7/usr/src/cmd/awk/b.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/lib.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/awk/parse.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/proc.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/run.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/token.c [deleted file]
.ref-Research-V7/usr/src/cmd/awk/tokenscript [deleted file]
.ref-Research-V7/usr/src/cmd/awk/tran.c [deleted file]
.ref-Research-V7/usr/src/cmd/bas/bas.s [deleted file]
.ref-Research-V7/usr/src/cmd/bas/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/basename.c [deleted file]
.ref-Research-V7/usr/src/cmd/bc.y [deleted file]
.ref-Research-V7/usr/src/cmd/c/c0.h [deleted file]
.ref-Research-V7/usr/src/cmd/c/c00.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c01.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c02.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c03.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c04.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c05.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c1.h [deleted file]
.ref-Research-V7/usr/src/cmd/c/c10.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c11.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c12.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c13.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c2.h [deleted file]
.ref-Research-V7/usr/src/cmd/c/c20.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/c21.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/cvopt.c [deleted file]
.ref-Research-V7/usr/src/cmd/c/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/c/table.s [deleted file]
.ref-Research-V7/usr/src/cmd/cal.c [deleted file]
.ref-Research-V7/usr/src/cmd/calendar.c [deleted file]
.ref-Research-V7/usr/src/cmd/cat.c [deleted file]
.ref-Research-V7/usr/src/cmd/cb.c [deleted file]
.ref-Research-V7/usr/src/cmd/cc.c [deleted file]
.ref-Research-V7/usr/src/cmd/checkeq.c [deleted file]
.ref-Research-V7/usr/src/cmd/chgrp.c [deleted file]
.ref-Research-V7/usr/src/cmd/chmod.c [deleted file]
.ref-Research-V7/usr/src/cmd/chown.c [deleted file]
.ref-Research-V7/usr/src/cmd/clri.c [deleted file]
.ref-Research-V7/usr/src/cmd/cmake [deleted file]
.ref-Research-V7/usr/src/cmd/cmp.c [deleted file]
.ref-Research-V7/usr/src/cmd/col.c [deleted file]
.ref-Research-V7/usr/src/cmd/comm.c [deleted file]
.ref-Research-V7/usr/src/cmd/cp.c [deleted file]
.ref-Research-V7/usr/src/cmd/cpp/README [deleted file]
.ref-Research-V7/usr/src/cmd/cpp/cpp.c [deleted file]
.ref-Research-V7/usr/src/cmd/cpp/cpy.y [deleted file]
.ref-Research-V7/usr/src/cmd/cpp/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/cpp/yylex.c [deleted file]
.ref-Research-V7/usr/src/cmd/cron.c [deleted file]
.ref-Research-V7/usr/src/cmd/crypt.c [deleted file]
.ref-Research-V7/usr/src/cmd/cu.c [deleted file]
.ref-Research-V7/usr/src/cmd/date.c [deleted file]
.ref-Research-V7/usr/src/cmd/dc/dc.c [deleted file]
.ref-Research-V7/usr/src/cmd/dc/dc.h [deleted file]
.ref-Research-V7/usr/src/cmd/dc/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/dcheck.c [deleted file]
.ref-Research-V7/usr/src/cmd/dd.c [deleted file]
.ref-Research-V7/usr/src/cmd/deroff.c [deleted file]
.ref-Research-V7/usr/src/cmd/df.c [deleted file]
.ref-Research-V7/usr/src/cmd/diff.c [deleted file]
.ref-Research-V7/usr/src/cmd/diff3.c [deleted file]
.ref-Research-V7/usr/src/cmd/diffh.c [deleted file]
.ref-Research-V7/usr/src/cmd/dmesg.c [deleted file]
.ref-Research-V7/usr/src/cmd/du.c [deleted file]
.ref-Research-V7/usr/src/cmd/dump.c [deleted file]
.ref-Research-V7/usr/src/cmd/dumpdir.c [deleted file]
.ref-Research-V7/usr/src/cmd/echo.c [deleted file]
.ref-Research-V7/usr/src/cmd/ed.c [deleted file]
.ref-Research-V7/usr/src/cmd/egrep.y [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/diacrit.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/e.h [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/e.y [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/eqnbox.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/font.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/fromto.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/funny.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/glob.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/integral.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/io.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/lex.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/lookup.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/mark.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/matrix.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/move.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/over.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/paren.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/pile.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/shift.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/size.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/sqrt.c [deleted file]
.ref-Research-V7/usr/src/cmd/eqn/text.c [deleted file]
.ref-Research-V7/usr/src/cmd/expr.y [deleted file]
.ref-Research-V7/usr/src/cmd/f77/data.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/defines [deleted file]
.ref-Research-V7/usr/src/cmd/f77/defs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/dmrdefs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/drivedefs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/driver.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/equiv.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/error.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/exec.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/expr.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/fio.h [deleted file]
.ref-Research-V7/usr/src/cmd/f77/ftypes [deleted file]
.ref-Research-V7/usr/src/cmd/f77/gram.dcl [deleted file]
.ref-Research-V7/usr/src/cmd/f77/gram.exec [deleted file]
.ref-Research-V7/usr/src/cmd/f77/gram.expr [deleted file]
.ref-Research-V7/usr/src/cmd/f77/gram.head [deleted file]
.ref-Research-V7/usr/src/cmd/f77/gram.io [deleted file]
.ref-Research-V7/usr/src/cmd/f77/init.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/intr.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/io.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/lex.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/locdefs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/f77/malloc.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/misc.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/pdp11.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/pdp11defs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/pdp11x.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/proc.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/put.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/putdmr.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/putscj.c [deleted file]
.ref-Research-V7/usr/src/cmd/f77/scjdefs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/tokdefs [deleted file]
.ref-Research-V7/usr/src/cmd/f77/tokens [deleted file]
.ref-Research-V7/usr/src/cmd/factor.s [deleted file]
.ref-Research-V7/usr/src/cmd/fgrep.c [deleted file]
.ref-Research-V7/usr/src/cmd/file.c [deleted file]
.ref-Research-V7/usr/src/cmd/find.c [deleted file]
.ref-Research-V7/usr/src/cmd/getty.c [deleted file]
.ref-Research-V7/usr/src/cmd/graph.c [deleted file]
.ref-Research-V7/usr/src/cmd/grep.c [deleted file]
.ref-Research-V7/usr/src/cmd/icheck.c [deleted file]
.ref-Research-V7/usr/src/cmd/in [deleted file]
.ref-Research-V7/usr/src/cmd/init.c [deleted file]
.ref-Research-V7/usr/src/cmd/iostat.c [deleted file]
.ref-Research-V7/usr/src/cmd/join.c [deleted file]
.ref-Research-V7/usr/src/cmd/kill.c [deleted file]
.ref-Research-V7/usr/src/cmd/ld.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/README [deleted file]
.ref-Research-V7/usr/src/cmd/learn/copy.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/dounit.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/lcount.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/learn.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/list.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/lrndef [deleted file]
.ref-Research-V7/usr/src/cmd/learn/lrnref [deleted file]
.ref-Research-V7/usr/src/cmd/learn/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/learn/makpipe.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/maktee.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/mem.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/mysys.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/selsub.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/selunit.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/start.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/tee.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/whatnow.c [deleted file]
.ref-Research-V7/usr/src/cmd/learn/wrapup.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/header.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/ldefs.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/lib/allprint.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/lib/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/lib/reject.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/lib/yyless.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/lib/yywrap.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/lmain.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/lex/once.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/parser.y [deleted file]
.ref-Research-V7/usr/src/cmd/lex/sub1.c [deleted file]
.ref-Research-V7/usr/src/cmd/lex/sub2.c [deleted file]
.ref-Research-V7/usr/src/cmd/lint/READ_ME [deleted file]
.ref-Research-V7/usr/src/cmd/lint/SHELL [deleted file]
.ref-Research-V7/usr/src/cmd/lint/lint.c [deleted file]
.ref-Research-V7/usr/src/cmd/lint/lmanifest [deleted file]
.ref-Research-V7/usr/src/cmd/lint/lpass2.c [deleted file]
.ref-Research-V7/usr/src/cmd/lint/macdefs [deleted file]
.ref-Research-V7/usr/src/cmd/lint/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/ln.c [deleted file]
.ref-Research-V7/usr/src/cmd/login.c [deleted file]
.ref-Research-V7/usr/src/cmd/look.c [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/chrtab.c [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/daemon.c [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/daemon0.c [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/lpd.c [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/lpr.c [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/lpr/spool.c [deleted file]
.ref-Research-V7/usr/src/cmd/ls.c [deleted file]
.ref-Research-V7/usr/src/cmd/m4/m4.c [deleted file]
.ref-Research-V7/usr/src/cmd/m4/m4y.y [deleted file]
.ref-Research-V7/usr/src/cmd/m4/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/mail.c [deleted file]
.ref-Research-V7/usr/src/cmd/make/defs [deleted file]
.ref-Research-V7/usr/src/cmd/make/doname.c [deleted file]
.ref-Research-V7/usr/src/cmd/make/dosys.c [deleted file]
.ref-Research-V7/usr/src/cmd/make/files.c [deleted file]
.ref-Research-V7/usr/src/cmd/make/gram.y [deleted file]
.ref-Research-V7/usr/src/cmd/make/ident.c [deleted file]
.ref-Research-V7/usr/src/cmd/make/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/make/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/make/misc.c [deleted file]
.ref-Research-V7/usr/src/cmd/makeall [deleted file]
.ref-Research-V7/usr/src/cmd/makekey.c [deleted file]
.ref-Research-V7/usr/src/cmd/mesg.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/INDEX [deleted file]
.ref-Research-V7/usr/src/cmd/mip/allo.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/cgram.y [deleted file]
.ref-Research-V7/usr/src/cmd/mip/comm1.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/common [deleted file]
.ref-Research-V7/usr/src/cmd/mip/convert [deleted file]
.ref-Research-V7/usr/src/cmd/mip/fallo.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/fcomm2.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/fconvert [deleted file]
.ref-Research-V7/usr/src/cmd/mip/flocal2.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/fmatch.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/forder.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/fort.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/freader.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/ftable.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/g [deleted file]
.ref-Research-V7/usr/src/cmd/mip/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/mip/manifest [deleted file]
.ref-Research-V7/usr/src/cmd/mip/match.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/mfile1 [deleted file]
.ref-Research-V7/usr/src/cmd/mip/mfile2 [deleted file]
.ref-Research-V7/usr/src/cmd/mip/optim.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/pftn.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/reader.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/scan.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/trees.c [deleted file]
.ref-Research-V7/usr/src/cmd/mip/xdefs.c [deleted file]
.ref-Research-V7/usr/src/cmd/mkdir.c [deleted file]
.ref-Research-V7/usr/src/cmd/mkfs.c [deleted file]
.ref-Research-V7/usr/src/cmd/mknod.c [deleted file]
.ref-Research-V7/usr/src/cmd/mount.c [deleted file]
.ref-Research-V7/usr/src/cmd/mv.c [deleted file]
.ref-Research-V7/usr/src/cmd/ncheck.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/diacrit.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/e.h [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/e.y [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/eqnbox.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/font.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/fromto.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/funny.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/glob.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/integral.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/io.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/lex.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/lookup.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/mark.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/matrix.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/move.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/over.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/paren.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/pile.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/shift.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/size.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/sqrt.c [deleted file]
.ref-Research-V7/usr/src/cmd/neqn/text.c [deleted file]
.ref-Research-V7/usr/src/cmd/newgrp.c [deleted file]
.ref-Research-V7/usr/src/cmd/nice.c [deleted file]
.ref-Research-V7/usr/src/cmd/nm.c [deleted file]
.ref-Research-V7/usr/src/cmd/od.c [deleted file]
.ref-Research-V7/usr/src/cmd/osh.c [deleted file]
.ref-Research-V7/usr/src/cmd/passwd.c [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/INDEX [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/code.c [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/local.c [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/local2.c [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/mac2defs [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/macdefs [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/order.c [deleted file]
.ref-Research-V7/usr/src/cmd/pcc/table.c [deleted file]
.ref-Research-V7/usr/src/cmd/plot/chrtab.c [deleted file]
.ref-Research-V7/usr/src/cmd/plot/driver.c [deleted file]
.ref-Research-V7/usr/src/cmd/plot/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/plot/vplot.c [deleted file]
.ref-Research-V7/usr/src/cmd/pr.c [deleted file]
.ref-Research-V7/usr/src/cmd/prep.h [deleted file]
.ref-Research-V7/usr/src/cmd/prep/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/prep/prep.h [deleted file]
.ref-Research-V7/usr/src/cmd/prep/prep0.c [deleted file]
.ref-Research-V7/usr/src/cmd/prep/prep1.c [deleted file]
.ref-Research-V7/usr/src/cmd/prep/prep2.c [deleted file]
.ref-Research-V7/usr/src/cmd/primes.s [deleted file]
.ref-Research-V7/usr/src/cmd/prof.c [deleted file]
.ref-Research-V7/usr/src/cmd/ps.c [deleted file]
.ref-Research-V7/usr/src/cmd/pstat.c [deleted file]
.ref-Research-V7/usr/src/cmd/ptx.c [deleted file]
.ref-Research-V7/usr/src/cmd/pwd.c [deleted file]
.ref-Research-V7/usr/src/cmd/quot.c [deleted file]
.ref-Research-V7/usr/src/cmd/random.c [deleted file]
.ref-Research-V7/usr/src/cmd/ranlib.c [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/r.g [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/r.h [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/r0.c [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/r1.c [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/r2.c [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/rio.c [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/rlex.c [deleted file]
.ref-Research-V7/usr/src/cmd/ratfor/rlook.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/deliv1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/deliv2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/flagger.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/glue1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/glue2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/glue3.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/glue4.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/glue5.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt3.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt5.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt6.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt7.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt8.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/hunt9.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/inv1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/inv2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/inv3.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/inv5.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/inv6.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/kaiser.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/refer/mkey1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/mkey2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/mkey3.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer..c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer0.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer3.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer4.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer5.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer6.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer7.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/refer8.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/shell.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/test [deleted file]
.ref-Research-V7/usr/src/cmd/refer/thash.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/types.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/what..c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/what1.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/what2.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/what3.c [deleted file]
.ref-Research-V7/usr/src/cmd/refer/what4.c [deleted file]
.ref-Research-V7/usr/src/cmd/restor.c [deleted file]
.ref-Research-V7/usr/src/cmd/rev.c [deleted file]
.ref-Research-V7/usr/src/cmd/rm.c [deleted file]
.ref-Research-V7/usr/src/cmd/rmdir.c [deleted file]
.ref-Research-V7/usr/src/cmd/roff/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff1.s [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff2.s [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff3.s [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff4.s [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff5.s [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff7.s [deleted file]
.ref-Research-V7/usr/src/cmd/roff/roff8.s [deleted file]
.ref-Research-V7/usr/src/cmd/sa.c [deleted file]
.ref-Research-V7/usr/src/cmd/sed/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/sed/sed.h [deleted file]
.ref-Research-V7/usr/src/cmd/sed/sed0.c [deleted file]
.ref-Research-V7/usr/src/cmd/sed/sed1.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/args.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/blok.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/brkincr.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/builtin.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/cmd.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/ctype.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/ctype.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/defs.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/dup.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/error.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/expand.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/fault.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/io.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/mac.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/macro.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/sh/mode.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/msg.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/name.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/name.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/print.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/service.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/setbrk.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/stak.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/stak.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/string.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/sym.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/timeout.h [deleted file]
.ref-Research-V7/usr/src/cmd/sh/word.c [deleted file]
.ref-Research-V7/usr/src/cmd/sh/xec.c [deleted file]
.ref-Research-V7/usr/src/cmd/size.c [deleted file]
.ref-Research-V7/usr/src/cmd/sleep.c [deleted file]
.ref-Research-V7/usr/src/cmd/sort.c [deleted file]
.ref-Research-V7/usr/src/cmd/sp.c [deleted file]
.ref-Research-V7/usr/src/cmd/spell/american [deleted file]
.ref-Research-V7/usr/src/cmd/spell/british [deleted file]
.ref-Research-V7/usr/src/cmd/spell/local [deleted file]
.ref-Research-V7/usr/src/cmd/spell/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/spell/spell.c [deleted file]
.ref-Research-V7/usr/src/cmd/spell/spell.h [deleted file]
.ref-Research-V7/usr/src/cmd/spell/spellin.c [deleted file]
.ref-Research-V7/usr/src/cmd/spell/spellout.c [deleted file]
.ref-Research-V7/usr/src/cmd/spell/stop [deleted file]
.ref-Research-V7/usr/src/cmd/spline.c [deleted file]
.ref-Research-V7/usr/src/cmd/split.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/M.s [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/SYS.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/boot.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/cat.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/cc+ld-stand [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/conf.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/contents [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/cpgroup [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/hp.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/ht.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/maketape.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/mtboot.s [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/prf.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/rk.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/rkcontents [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/rktapedir [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/rp.c [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/saio.h [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/srt0.s [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/tapedir [deleted file]
.ref-Research-V7/usr/src/cmd/standalone/tm.c [deleted file]
.ref-Research-V7/usr/src/cmd/strip.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.alloc.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.args.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.def.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.extr.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.graph.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.list.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.parts.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/0.string.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.defs.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.finish.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.form.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.fort.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.hash.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.incl.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.init.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.line.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.main.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.node.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.recog.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/1.tables.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.def.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.dfs.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.dom.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.head.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.inarc.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.main.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.test.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/2.tree.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.branch.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.def.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.flow.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.loop.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.main.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.reach.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.test.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/3.then.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/4.brace.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/4.def.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/4.form.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/4.main.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/4.out.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/b.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/bdef.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/beauty.y [deleted file]
.ref-Research-V7/usr/src/cmd/struct/def.h [deleted file]
.ref-Research-V7/usr/src/cmd/struct/lextab.l [deleted file]
.ref-Research-V7/usr/src/cmd/struct/main.c [deleted file]
.ref-Research-V7/usr/src/cmd/struct/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/struct/tree.c [deleted file]
.ref-Research-V7/usr/src/cmd/stty.c [deleted file]
.ref-Research-V7/usr/src/cmd/su.c [deleted file]
.ref-Research-V7/usr/src/cmd/sum.c [deleted file]
.ref-Research-V7/usr/src/cmd/sync.c [deleted file]
.ref-Research-V7/usr/src/cmd/tabs.c [deleted file]
.ref-Research-V7/usr/src/cmd/tail.c [deleted file]
.ref-Research-V7/usr/src/cmd/tar/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/tar/tar.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t..c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t0.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t1.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t2.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t3.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t4.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t5.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t6.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t7.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t8.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/t9.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tb.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tc.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/te.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tf.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tg.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/ti.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tm.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/ts.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tt.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tu.c [deleted file]
.ref-Research-V7/usr/src/cmd/tbl/tv.c [deleted file]
.ref-Research-V7/usr/src/cmd/tc.c [deleted file]
.ref-Research-V7/usr/src/cmd/tee.c [deleted file]
.ref-Research-V7/usr/src/cmd/test.c [deleted file]
.ref-Research-V7/usr/src/cmd/time.c [deleted file]
.ref-Research-V7/usr/src/cmd/tk.c [deleted file]
.ref-Research-V7/usr/src/cmd/touch.c [deleted file]
.ref-Research-V7/usr/src/cmd/tp/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/tp/tp.h [deleted file]
.ref-Research-V7/usr/src/cmd/tp/tp0.c [deleted file]
.ref-Research-V7/usr/src/cmd/tp/tp1.c [deleted file]
.ref-Research-V7/usr/src/cmd/tp/tp2.c [deleted file]
.ref-Research-V7/usr/src/cmd/tp/tp3.c [deleted file]
.ref-Research-V7/usr/src/cmd/tr.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/README [deleted file]
.ref-Research-V7/usr/src/cmd/troff/d.h [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/chars.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftB.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftBC.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftC.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftCE.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftCI.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftCK.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftCS.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftCW.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftG.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftGI.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftGM.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftGR.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftI.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftL.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftLI.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftPA.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftPB.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftPI.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftR.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftS.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftSB.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftSI.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftSM.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftUD.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/ftXM.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/linkrc [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/mkfont.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/font/mkfont1.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/hytab.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n1.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n10.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n2.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n3.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n4.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n5.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n6.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n7.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n8.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/n9.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/ni.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/nii.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/nmake [deleted file]
.ref-Research-V7/usr/src/cmd/troff/ntab.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/s.h [deleted file]
.ref-Research-V7/usr/src/cmd/troff/suftab.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/t10.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/t6.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/tab3.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/tdef.h [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/code.300 [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab300-12.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab300.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab300s-12.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab300s.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab37.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab450-12-8.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab450-12.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab450.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tab832.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/taba1.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tablp.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/term/tabtn300.c [deleted file]
.ref-Research-V7/usr/src/cmd/troff/textscript [deleted file]
.ref-Research-V7/usr/src/cmd/troff/tmake [deleted file]
.ref-Research-V7/usr/src/cmd/troff/tw.h [deleted file]
.ref-Research-V7/usr/src/cmd/troff/v.h [deleted file]
.ref-Research-V7/usr/src/cmd/tsort.c [deleted file]
.ref-Research-V7/usr/src/cmd/tty.c [deleted file]
.ref-Research-V7/usr/src/cmd/umount.c [deleted file]
.ref-Research-V7/usr/src/cmd/uniq.c [deleted file]
.ref-Research-V7/usr/src/cmd/units.c [deleted file]
.ref-Research-V7/usr/src/cmd/update.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/anlwrk.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/chkpth.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/cico.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/cntrl.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/conn.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/cpmv.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/expfile.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/gename.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/getargs.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/getprm.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/getpwinfo.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/gio.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/gnamef.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/gnsys.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/gnxseq.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/gwd.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/imsg.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/index.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/ioctl.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/lastpart.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/logent.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/pk0.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/pk1.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/pkon.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/prefix.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/sdmail.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/shio.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/sysacct.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/systat.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/ulockf.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uuclean.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uucp.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uucp.h [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uucpdefs.h [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uulog.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uurecover.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uux.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/uuxqt.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/versys.c [deleted file]
.ref-Research-V7/usr/src/cmd/uucp/xqt.c [deleted file]
.ref-Research-V7/usr/src/cmd/vpr.c [deleted file]
.ref-Research-V7/usr/src/cmd/wall.c [deleted file]
.ref-Research-V7/usr/src/cmd/wc.c [deleted file]
.ref-Research-V7/usr/src/cmd/who.c [deleted file]
.ref-Research-V7/usr/src/cmd/write.c [deleted file]
.ref-Research-V7/usr/src/cmd/xsend/enroll.c [deleted file]
.ref-Research-V7/usr/src/cmd/xsend/lib.c [deleted file]
.ref-Research-V7/usr/src/cmd/xsend/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/xsend/xget.c [deleted file]
.ref-Research-V7/usr/src/cmd/xsend/xmail.h [deleted file]
.ref-Research-V7/usr/src/cmd/xsend/xsend.c [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/dextern [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/files [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/makefile [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/y1.c [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/y2.c [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/y3.c [deleted file]
.ref-Research-V7/usr/src/cmd/yacc/y4.c [deleted file]
.ref-Research-V7/usr/src/cmd/yes.c [deleted file]
.ref-Research-V7/usr/src/games/arithmetic.c [deleted file]
.ref-Research-V7/usr/src/games/backgammon.c [deleted file]
.ref-Research-V7/usr/src/games/chess/README [deleted file]
.ref-Research-V7/usr/src/games/chess/agen.c [deleted file]
.ref-Research-V7/usr/src/games/chess/att.s [deleted file]
.ref-Research-V7/usr/src/games/chess/bgen.s [deleted file]
.ref-Research-V7/usr/src/games/chess/bheur.c [deleted file]
.ref-Research-V7/usr/src/games/chess/bmove.s [deleted file]
.ref-Research-V7/usr/src/games/chess/book.c [deleted file]
.ref-Research-V7/usr/src/games/chess/bplay.c [deleted file]
.ref-Research-V7/usr/src/games/chess/ctrl.s [deleted file]
.ref-Research-V7/usr/src/games/chess/data.c [deleted file]
.ref-Research-V7/usr/src/games/chess/init.c [deleted file]
.ref-Research-V7/usr/src/games/chess/io.c [deleted file]
.ref-Research-V7/usr/src/games/chess/makefile [deleted file]
.ref-Research-V7/usr/src/games/chess/mater.c [deleted file]
.ref-Research-V7/usr/src/games/chess/old.h [deleted file]
.ref-Research-V7/usr/src/games/chess/pio.c [deleted file]
.ref-Research-V7/usr/src/games/chess/play.c [deleted file]
.ref-Research-V7/usr/src/games/chess/qsort.s [deleted file]
.ref-Research-V7/usr/src/games/chess/savres.c [deleted file]
.ref-Research-V7/usr/src/games/chess/setup.c [deleted file]
.ref-Research-V7/usr/src/games/chess/stat.c [deleted file]
.ref-Research-V7/usr/src/games/chess/stdin.c [deleted file]
.ref-Research-V7/usr/src/games/chess/wgen.s [deleted file]
.ref-Research-V7/usr/src/games/chess/wheur.c [deleted file]
.ref-Research-V7/usr/src/games/chess/wmove.s [deleted file]
.ref-Research-V7/usr/src/games/chess/wplay.c [deleted file]
.ref-Research-V7/usr/src/games/fish.c [deleted file]
.ref-Research-V7/usr/src/games/fortune.c [deleted file]
.ref-Research-V7/usr/src/games/hangman.c [deleted file]
.ref-Research-V7/usr/src/games/quiz.c [deleted file]
.ref-Research-V7/usr/src/games/wump.c [deleted file]
.ref-Research-V7/usr/src/libF77/Makefile [deleted file]
.ref-Research-V7/usr/src/libF77/abort_.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_abs.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_cos.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_div.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_exp.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_log.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_sin.c [deleted file]
.ref-Research-V7/usr/src/libF77/c_sqrt.c [deleted file]
.ref-Research-V7/usr/src/libF77/cabs.c [deleted file]
.ref-Research-V7/usr/src/libF77/compall [deleted file]
.ref-Research-V7/usr/src/libF77/complex [deleted file]
.ref-Research-V7/usr/src/libF77/d_abs.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_acos.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_asin.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_atan.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_atn2.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_cnjg.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_cos.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_cosh.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_dim.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_exp.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_imag.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_int.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_lg10.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_log.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_mod.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_nint.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_prod.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_sign.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_sin.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_sinh.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_sqrt.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_tan.c [deleted file]
.ref-Research-V7/usr/src/libF77/d_tanh.c [deleted file]
.ref-Research-V7/usr/src/libF77/getarg_.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_abs.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_dim.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_dnnt.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_indx.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_len.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_mod.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_nint.c [deleted file]
.ref-Research-V7/usr/src/libF77/h_sign.c [deleted file]
.ref-Research-V7/usr/src/libF77/hl_ge.c [deleted file]
.ref-Research-V7/usr/src/libF77/hl_gt.c [deleted file]
.ref-Research-V7/usr/src/libF77/hl_le.c [deleted file]
.ref-Research-V7/usr/src/libF77/hl_lt.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_abs.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_dim.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_dnnt.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_indx.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_len.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_mod.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_nint.c [deleted file]
.ref-Research-V7/usr/src/libF77/i_sign.c [deleted file]
.ref-Research-V7/usr/src/libF77/iargc_.c [deleted file]
.ref-Research-V7/usr/src/libF77/l_ge.c [deleted file]
.ref-Research-V7/usr/src/libF77/l_gt.c [deleted file]
.ref-Research-V7/usr/src/libF77/l_le.c [deleted file]
.ref-Research-V7/usr/src/libF77/l_lt.c [deleted file]
.ref-Research-V7/usr/src/libF77/main.c [deleted file]
.ref-Research-V7/usr/src/libF77/mklib [deleted file]
.ref-Research-V7/usr/src/libF77/pow_ci.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_dd.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_di.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_hh.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_ii.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_ri.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_zi.c [deleted file]
.ref-Research-V7/usr/src/libF77/pow_zz.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_abs.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_acos.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_asin.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_atan.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_atn2.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_cnjg.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_cos.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_cosh.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_dim.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_exp.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_imag.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_int.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_lg10.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_log.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_mod.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_nint.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_sign.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_sin.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_sinh.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_sqrt.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_tan.c [deleted file]
.ref-Research-V7/usr/src/libF77/r_tanh.c [deleted file]
.ref-Research-V7/usr/src/libF77/s_cat.c [deleted file]
.ref-Research-V7/usr/src/libF77/s_cmp.c [deleted file]
.ref-Research-V7/usr/src/libF77/s_copy.c [deleted file]
.ref-Research-V7/usr/src/libF77/s_paus.c [deleted file]
.ref-Research-V7/usr/src/libF77/s_rnge.c [deleted file]
.ref-Research-V7/usr/src/libF77/s_stop.c [deleted file]
.ref-Research-V7/usr/src/libF77/signal_.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_abs.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_cos.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_div.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_exp.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_log.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_sin.c [deleted file]
.ref-Research-V7/usr/src/libF77/z_sqrt.c [deleted file]
.ref-Research-V7/usr/src/libI77/backspace.c [deleted file]
.ref-Research-V7/usr/src/libI77/close.c [deleted file]
.ref-Research-V7/usr/src/libI77/compall [deleted file]
.ref-Research-V7/usr/src/libI77/dballoc.c [deleted file]
.ref-Research-V7/usr/src/libI77/dfe.c [deleted file]
.ref-Research-V7/usr/src/libI77/due.c [deleted file]
.ref-Research-V7/usr/src/libI77/endfile.c [deleted file]
.ref-Research-V7/usr/src/libI77/err.c [deleted file]
.ref-Research-V7/usr/src/libI77/fio.h [deleted file]
.ref-Research-V7/usr/src/libI77/fmt.c [deleted file]
.ref-Research-V7/usr/src/libI77/fmt.h [deleted file]
.ref-Research-V7/usr/src/libI77/fmtlib.c [deleted file]
.ref-Research-V7/usr/src/libI77/iio.c [deleted file]
.ref-Research-V7/usr/src/libI77/inquire.c [deleted file]
.ref-Research-V7/usr/src/libI77/lib.c [deleted file]
.ref-Research-V7/usr/src/libI77/lio.c [deleted file]
.ref-Research-V7/usr/src/libI77/lio.h [deleted file]
.ref-Research-V7/usr/src/libI77/lread.c [deleted file]
.ref-Research-V7/usr/src/libI77/mklib [deleted file]
.ref-Research-V7/usr/src/libI77/open.c [deleted file]
.ref-Research-V7/usr/src/libI77/rdfmt.c [deleted file]
.ref-Research-V7/usr/src/libI77/rewind.c [deleted file]
.ref-Research-V7/usr/src/libI77/rsfe.c [deleted file]
.ref-Research-V7/usr/src/libI77/sfe.c [deleted file]
.ref-Research-V7/usr/src/libI77/sue.c [deleted file]
.ref-Research-V7/usr/src/libI77/uio.c [deleted file]
.ref-Research-V7/usr/src/libI77/util.c [deleted file]
.ref-Research-V7/usr/src/libI77/wrtfmt.c [deleted file]
.ref-Research-V7/usr/src/libI77/wsfe.c [deleted file]
.ref-Research-V7/usr/src/libc/compall [deleted file]
.ref-Research-V7/usr/src/libc/crt/aldiv.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/almul.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/alrem.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/cerror.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/csv.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/ldiv.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/lmul.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/lrem.s [deleted file]
.ref-Research-V7/usr/src/libc/crt/mcount.s [deleted file]
.ref-Research-V7/usr/src/libc/csu/crt0.s [deleted file]
.ref-Research-V7/usr/src/libc/csu/fcrt0.s [deleted file]
.ref-Research-V7/usr/src/libc/csu/fmcrt0.s [deleted file]
.ref-Research-V7/usr/src/libc/csu/mcrt0.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/abort.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/abs.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/atof.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/atoi.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/atol.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/calloc.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/crypt.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/ctime.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/ctype_.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/cuexit.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/ecvt.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/errlst.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/execvp.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/fakcu.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/fakfp.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/frexp11.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/getenv.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/getlogin.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/index.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/isatty.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/l3.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/ldexp11.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/ldfps.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/malloc.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/mktemp.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/modf11.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/mon.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/mpx.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/nlist.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/perror.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/pkon.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/qsort.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/rand.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/rindex.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/setjmp.s [deleted file]
.ref-Research-V7/usr/src/libc/gen/sleep.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strcat.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strcmp.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strcpy.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strlen.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strncat.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strncmp.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/strncpy.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/stty.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/swab.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/tell.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/timezone.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/ttyname.c [deleted file]
.ref-Research-V7/usr/src/libc/gen/ttyslot.c [deleted file]
.ref-Research-V7/usr/src/libc/mklib [deleted file]
.ref-Research-V7/usr/src/libc/stdio/clrerr.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/data.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/doprnt.s [deleted file]
.ref-Research-V7/usr/src/libc/stdio/doscan.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/endopen.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fdopen.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/ffltpr.s [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fgetc.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fgets.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/filbuf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/findiop.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/flsbuf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fltpr.s [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fopen.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fprintf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fputc.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fputs.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/freopen.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/fseek.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/ftell.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/gcvt.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getchar.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getgrent.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getgrgid.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getgrnam.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getpass.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getpw.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getpwent.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getpwnam.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getpwuid.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/gets.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/getw.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/popen.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/printf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/putchar.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/puts.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/putw.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/rdwr.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/rew.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/scanf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/setbuf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/sprintf.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/strout.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/system.c [deleted file]
.ref-Research-V7/usr/src/libc/stdio/ungetc.c [deleted file]
.ref-Research-V7/usr/src/libc/sys/access.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/acct.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/alarm.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/chdir.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/chmod.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/chown.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/chroot.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/close.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/creat.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/dup.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/execl.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/execle.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/execv.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/execve.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/exit.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/fork.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/fstat.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/getgid.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/getpid.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/getuid.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/ioctl.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/kill.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/link.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/lock.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/lseek.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/mknod.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/mount.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/mpxcall.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/nice.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/open.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/pause.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/phys.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/pipe.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/profil.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/ptrace.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/read.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/sbrk.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/setgid.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/setuid.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/signal.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/stat.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/stime.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/sync.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/time.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/times.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/umask.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/umount.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/unlink.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/utime.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/wait.s [deleted file]
.ref-Research-V7/usr/src/libc/sys/write.s [deleted file]
.ref-Research-V7/usr/src/libc/v6/access.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/chown.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/execl.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/ftime.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/gtty.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/lseek.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/stat.c [deleted file]
.ref-Research-V7/usr/src/libc/v6/syscall.s [deleted file]
.ref-Research-V7/usr/src/libc/v6/time.s [deleted file]
.ref-Research-V7/usr/src/libdbm/compall [deleted file]
.ref-Research-V7/usr/src/libdbm/dbm.c [deleted file]
.ref-Research-V7/usr/src/libdbm/dbm.h [deleted file]
.ref-Research-V7/usr/src/libdbm/mklib [deleted file]
.ref-Research-V7/usr/src/libfpsim/compall [deleted file]
.ref-Research-V7/usr/src/libfpsim/fp1.s [deleted file]
.ref-Research-V7/usr/src/libfpsim/fp2.s [deleted file]
.ref-Research-V7/usr/src/libfpsim/fp3.s [deleted file]
.ref-Research-V7/usr/src/libfpsim/fpx.s [deleted file]
.ref-Research-V7/usr/src/libfpsim/mklib [deleted file]
.ref-Research-V7/usr/src/libm/asin.c [deleted file]
.ref-Research-V7/usr/src/libm/atan.c [deleted file]
.ref-Research-V7/usr/src/libm/compall [deleted file]
.ref-Research-V7/usr/src/libm/exp.c [deleted file]
.ref-Research-V7/usr/src/libm/fabs.c [deleted file]
.ref-Research-V7/usr/src/libm/floor.c [deleted file]
.ref-Research-V7/usr/src/libm/hypot.c [deleted file]
.ref-Research-V7/usr/src/libm/j0.c [deleted file]
.ref-Research-V7/usr/src/libm/j1.c [deleted file]
.ref-Research-V7/usr/src/libm/jn.c [deleted file]
.ref-Research-V7/usr/src/libm/log.c [deleted file]
.ref-Research-V7/usr/src/libm/mklib [deleted file]
.ref-Research-V7/usr/src/libm/pow.c [deleted file]
.ref-Research-V7/usr/src/libm/sin.c [deleted file]
.ref-Research-V7/usr/src/libm/sinh.c [deleted file]
.ref-Research-V7/usr/src/libm/sqrt.c [deleted file]
.ref-Research-V7/usr/src/libm/tan.c [deleted file]
.ref-Research-V7/usr/src/libm/tanh.c [deleted file]
.ref-Research-V7/usr/src/libmp/compall [deleted file]
.ref-Research-V7/usr/src/libmp/gcd.c [deleted file]
.ref-Research-V7/usr/src/libmp/madd.c [deleted file]
.ref-Research-V7/usr/src/libmp/mdiv.c [deleted file]
.ref-Research-V7/usr/src/libmp/mklib [deleted file]
.ref-Research-V7/usr/src/libmp/mout.c [deleted file]
.ref-Research-V7/usr/src/libmp/msqrt.c [deleted file]
.ref-Research-V7/usr/src/libmp/mult.c [deleted file]
.ref-Research-V7/usr/src/libmp/pow.c [deleted file]
.ref-Research-V7/usr/src/libmp/util.c [deleted file]
.ref-Research-V7/usr/src/libplot/con.h [deleted file]
.ref-Research-V7/usr/src/libplot/makefile [deleted file]
.ref-Research-V7/usr/sys/40/README [deleted file]
.ref-Research-V7/usr/sys/40/m40.s [deleted file]
.ref-Research-V7/usr/sys/40/param.h [deleted file]
.ref-Research-V7/usr/sys/conf/c.c [deleted file]
.ref-Research-V7/usr/sys/conf/hphtconf [deleted file]
.ref-Research-V7/usr/sys/conf/hptmconf [deleted file]
.ref-Research-V7/usr/sys/conf/l.s [deleted file]
.ref-Research-V7/usr/sys/conf/makefile [deleted file]
.ref-Research-V7/usr/sys/conf/mch.s [deleted file]
.ref-Research-V7/usr/sys/conf/mch0.s [deleted file]
.ref-Research-V7/usr/sys/conf/mkconf.c [deleted file]
.ref-Research-V7/usr/sys/conf/rkhtconf [deleted file]
.ref-Research-V7/usr/sys/conf/rktmconf [deleted file]
.ref-Research-V7/usr/sys/conf/rp1conf [deleted file]
.ref-Research-V7/usr/sys/conf/rphtconf [deleted file]
.ref-Research-V7/usr/sys/conf/rptmconf [deleted file]
.ref-Research-V7/usr/sys/conf/tconf [deleted file]
.ref-Research-V7/usr/sys/dev/bio.c [deleted file]
.ref-Research-V7/usr/sys/dev/cat.c [deleted file]
.ref-Research-V7/usr/sys/dev/dc.c [deleted file]
.ref-Research-V7/usr/sys/dev/dh.c [deleted file]
.ref-Research-V7/usr/sys/dev/dhdm.c [deleted file]
.ref-Research-V7/usr/sys/dev/dhfdm.c [deleted file]
.ref-Research-V7/usr/sys/dev/dkleave.c [deleted file]
.ref-Research-V7/usr/sys/dev/dn.c [deleted file]
.ref-Research-V7/usr/sys/dev/dsort.c [deleted file]
.ref-Research-V7/usr/sys/dev/du.c [deleted file]
.ref-Research-V7/usr/sys/dev/dz.c [deleted file]
.ref-Research-V7/usr/sys/dev/hp.c [deleted file]
.ref-Research-V7/usr/sys/dev/ht.c [deleted file]
.ref-Research-V7/usr/sys/dev/kl.c [deleted file]
.ref-Research-V7/usr/sys/dev/lp.c [deleted file]
.ref-Research-V7/usr/sys/dev/mem.c [deleted file]
.ref-Research-V7/usr/sys/dev/mklib [deleted file]
.ref-Research-V7/usr/sys/dev/mx1.c [deleted file]
.ref-Research-V7/usr/sys/dev/mx2.c [deleted file]
.ref-Research-V7/usr/sys/dev/partab.c [deleted file]
.ref-Research-V7/usr/sys/dev/pk0.c [deleted file]
.ref-Research-V7/usr/sys/dev/pk1.c [deleted file]
.ref-Research-V7/usr/sys/dev/pk2.c [deleted file]
.ref-Research-V7/usr/sys/dev/pk3.c [deleted file]
.ref-Research-V7/usr/sys/dev/rf.c [deleted file]
.ref-Research-V7/usr/sys/dev/rk.c [deleted file]
.ref-Research-V7/usr/sys/dev/rl.c [deleted file]
.ref-Research-V7/usr/sys/dev/rp.c [deleted file]
.ref-Research-V7/usr/sys/dev/sys.c [deleted file]
.ref-Research-V7/usr/sys/dev/tc.c [deleted file]
.ref-Research-V7/usr/sys/dev/tm.c [deleted file]
.ref-Research-V7/usr/sys/dev/tty.c [deleted file]
.ref-Research-V7/usr/sys/dev/vp.c [deleted file]
.ref-Research-V7/usr/sys/dev/vs.c [deleted file]
.ref-Research-V7/usr/sys/h/acct.h [deleted file]
.ref-Research-V7/usr/sys/h/buf.h [deleted file]
.ref-Research-V7/usr/sys/h/callo.h [deleted file]
.ref-Research-V7/usr/sys/h/conf.h [deleted file]
.ref-Research-V7/usr/sys/h/dir.h [deleted file]
.ref-Research-V7/usr/sys/h/fblk.h [deleted file]
.ref-Research-V7/usr/sys/h/file.h [deleted file]
.ref-Research-V7/usr/sys/h/filsys.h [deleted file]
.ref-Research-V7/usr/sys/h/ino.h [deleted file]
.ref-Research-V7/usr/sys/h/inode.h [deleted file]
.ref-Research-V7/usr/sys/h/map.h [deleted file]
.ref-Research-V7/usr/sys/h/mount.h [deleted file]
.ref-Research-V7/usr/sys/h/mpx.h [deleted file]
.ref-Research-V7/usr/sys/h/mx.h [deleted file]
.ref-Research-V7/usr/sys/h/pack.h [deleted file]
.ref-Research-V7/usr/sys/h/param.h [deleted file]
.ref-Research-V7/usr/sys/h/pk.h [deleted file]
.ref-Research-V7/usr/sys/h/pk.p [deleted file]
.ref-Research-V7/usr/sys/h/prim.h [deleted file]
.ref-Research-V7/usr/sys/h/proc.h [deleted file]
.ref-Research-V7/usr/sys/h/pwd.h [deleted file]
.ref-Research-V7/usr/sys/h/reg.h [deleted file]
.ref-Research-V7/usr/sys/h/seg.h [deleted file]
.ref-Research-V7/usr/sys/h/smallparam.h [deleted file]
.ref-Research-V7/usr/sys/h/stat.h [deleted file]
.ref-Research-V7/usr/sys/h/systm.h [deleted file]
.ref-Research-V7/usr/sys/h/text.h [deleted file]
.ref-Research-V7/usr/sys/h/timeb.h [deleted file]
.ref-Research-V7/usr/sys/h/tty.h [deleted file]
.ref-Research-V7/usr/sys/h/types.h [deleted file]
.ref-Research-V7/usr/sys/h/user.h [deleted file]
.ref-Research-V7/usr/sys/sys/acct.c [deleted file]
.ref-Research-V7/usr/sys/sys/alloc.c [deleted file]
.ref-Research-V7/usr/sys/sys/clock.c [deleted file]
.ref-Research-V7/usr/sys/sys/fakemx.c [deleted file]
.ref-Research-V7/usr/sys/sys/fio.c [deleted file]
.ref-Research-V7/usr/sys/sys/iget.c [deleted file]
.ref-Research-V7/usr/sys/sys/machdep.c [deleted file]
.ref-Research-V7/usr/sys/sys/main.c [deleted file]
.ref-Research-V7/usr/sys/sys/malloc.c [deleted file]
.ref-Research-V7/usr/sys/sys/mklib [deleted file]
.ref-Research-V7/usr/sys/sys/nami.c [deleted file]
.ref-Research-V7/usr/sys/sys/pipe.c [deleted file]
.ref-Research-V7/usr/sys/sys/prf.c [deleted file]
.ref-Research-V7/usr/sys/sys/prim.c [deleted file]
.ref-Research-V7/usr/sys/sys/rdwri.c [deleted file]
.ref-Research-V7/usr/sys/sys/sig.c [deleted file]
.ref-Research-V7/usr/sys/sys/slp.c [deleted file]
.ref-Research-V7/usr/sys/sys/subr.c [deleted file]
.ref-Research-V7/usr/sys/sys/sys1.c [deleted file]
.ref-Research-V7/usr/sys/sys/sys2.c [deleted file]
.ref-Research-V7/usr/sys/sys/sys3.c [deleted file]
.ref-Research-V7/usr/sys/sys/sys4.c [deleted file]
.ref-Research-V7/usr/sys/sys/sysent.c [deleted file]
.ref-Research-V7/usr/sys/sys/text.c [deleted file]
.ref-Research-V7/usr/sys/sys/trap.c [deleted file]
.ref-Research-V7/usr/sys/sys/ureg.c [deleted file]

diff --git a/.ref-Research-V7/ALU-USA-statement.pdf b/.ref-Research-V7/ALU-USA-statement.pdf
deleted file mode 100644 (file)
index 4bee71b..0000000
Binary files a/.ref-Research-V7/ALU-USA-statement.pdf and /dev/null differ
diff --git a/.ref-Research-V7/Caldera-license.pdf b/.ref-Research-V7/Caldera-license.pdf
deleted file mode 100644 (file)
index fd302b4..0000000
Binary files a/.ref-Research-V7/Caldera-license.pdf and /dev/null differ
diff --git a/.ref-Research-V7/LICENSE b/.ref-Research-V7/LICENSE
deleted file mode 100644 (file)
index d19a226..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-UNIX is a registered trademark in the United States and other countries,
-licensed exclusively through X/Open Company, Ltd.
-
-Caldera owns the copyright on these versions of UNIX (as well as others):
-1st, 2nd, 3rd, 4th, 5th, 6th & 7th Editions, PWB/UNIX, Mini UNIX, and 32V.
-See Caldera-license.pdf for their license conditions for these systems.
-
-Any portions of 1BSD, 2BSD, 2.xBSD, 3BSD and 4.xBSD which are substantially
-derived from the Caldera UNIX systems above are also copyright Caldera.
-
-Depending on where the software was developed, those portions of 1BSD, 2BSD,
-2.xBSD, 3BSD and 4.xBSD which are not substantially derived from the Caldera
-UNIX systems above are either copyright the Regents of the University of
-California, or by the authors of the software. Please read the individual
-software files to determine ownership and copyright status.
-
-All versions of Ultrix-11, and the V7M version of UNIX, are copyright Compaq.
-
-Venix versions 1 and 2 are copyright by VenturCom.
-
-Douglas Comer and Prentice-Hall own the copyright on the Xinu operating system.
-
-The AUSAM modifications to 6th Edition UNIX are copyright the University
-of New South Wales.
-
-The port of 6th Edition UNIX to the Interdata 7/32 is copyright the
-University of Wollongong, Australia.
-
-The organisation of the Unix Archive, the documents describing this archive's
-contents & organisation, and the HTML files in the directories TUHS_Html &
-PUPS_Html are copyright Warren Toomey.
-
-The code in the original PDP-7 Unix scans is copyright by Novell,
-which owns the rights to the Unix source code.
-
-Statement Regarding Research Unix Editions 8, 9, and 10
-Alcatel-Lucent USA Inc. (“ALU-USA”), on behalf of itself and Nokia
-Bell Laboratories agrees, to the extent of its ability to do so, that it
-will not assert its copyright rights with respect to any non-commercial
-copying, distribution, performance, display or creation of derivative
-works of Research Unix®1 Editions 8, 9, and 10. The foregoing does not
-(i) transfer ownership of, or relinquish any, intellectual property rights
-(including patent rights) of Nokia Corporation, ALU-USA or any of their
-affiliates, (ii) grant a license to any patent, patent application,
-or trademark of Nokia Corporation, ALU-USA. or any of their affiliates,
-(iii) grant any third-party rights or licenses, or (iv) grant any rights
-for commercial purposes. Neither ALU-USA. nor Nokia Bell Laboratories will
-furnish or provided support for Research Unix Editions 8, 9, and 10, and
-make no warranties or representations hereunder, including but not limited
-to any warranty or representation that Research Unix Editions 8, 9, and
-10 does not infringe any third party intellectual property rights or that
-Research Unix Editions 8, 9, and 10 is fit for any particular purpose.
-
-The BSD snaphshots and SCCS commits are distributed with the following license.
-
------------------------------------------
-All of the documentation and software included in the 4.4BSD and 4.4BSD-Lite
-Releases is copyrighted by The Regents of the University of California.
-
-Copyright 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
-       The Regents of the University of California.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-This product includes software developed by the University of
-California, Berkeley and its contributors.
-4. Neither the name of the University nor the names of its contributors
-   may be used to endorse or promote products derived from this software
-   without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The Institute of Electrical and Electronics Engineers and the American
-National Standards Committee X3, on Information Processing Systems have
-given us permission to reprint portions of their documentation.
-
-In the following statement, the phrase ``this text'' refers to portions
-of the system documentation.
-
-Portions of this text are reprinted and reproduced in electronic form in
-the second BSD Networking Software Release, from IEEE Std 1003.1-1988, IEEE
-Standard Portable Operating System Interface for Computer Environments
-(POSIX), copyright C 1988 by the Institute of Electrical and Electronics
-Engineers, Inc.  In the event of any discrepancy between these versions
-and the original IEEE Standard, the original IEEE Standard is the referee
-document.
-
-In the following statement, the phrase ``This material'' refers to portions
-of the system documentation.
-
-This material is reproduced with permission from American National
-Standards Committee X3, on Information Processing Systems.  Computer and
-Business Equipment Manufacturers Association (CBEMA), 311 First St., NW,
-Suite 500, Washington, DC 20001-2178.  The developmental work of
-Programming Language C was completed by the X3J11 Technical Committee.
-
-The views and conclusions contained in the software and documentation are
-those of the authors and should not be interpreted as representing official
-policies, either expressed or implied, of the Regents of the University
-of California.
------------------------------------------
-
-386BSD is distributed under the following license.
------------------------------------------
-Copyright (c) 1989, 1990, 1991, 1992 William F. Jolitz, TeleMuse
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-must display the following acknowledgement:
-This software is a component of "386BSD" developed by
-William F. Jolitz, TeleMuse.
-4. Neither the name of the developer nor the name "386BSD"
-may be used to endorse or promote products derived from this software
-without specific prior written permission.
-
-386BSD WAS DEVELOPED BY WILLIAM F. JOLITZ.
-386BSD IS INTENDED FOR RESEARCH AND EDUCATIONAL PURPOSES.
-THIS SOFTWARE SHOULD NOT BE CONSIDERED TO BE A COMMERCIAL PRODUCT.
-THE DEVELOPER URGES THAT USERS WHO REQUIRE A COMMERCIAL PRODUCT
-NOT MAKE USE OF THIS WORK.
-
-FOR USERS WHO WISH TO UNDERSTAND THE 386BSD SYSTEM DEVELOPED
-BY WILLIAM F. JOLITZ, WE RECOMMEND THE USER STUDY WRITTEN
-REFERENCES SUCH AS THE  "PORTING UNIX TO THE 386" SERIES
-(BEGINNING JANUARY 1991 "DR. DOBBS JOURNAL", USA AND BEGINNING
-JUNE 1991 "UNIX MAGAZIN", GERMANY) BY WILLIAM F. JOLITZ AND
-LYNNE GREER JOLITZ, AS WELL AS OTHER BOOKS ON UNIX AND THE
-ON-LINE 386BSD USER MANUAL BEFORE USE. A BOOK DISCUSSING THE INTERNALS
-OF 386BSD ENTITLED "386BSD FROM THE INSIDE OUT" WILL BE AVAILABLE LATE 1992.
-
-THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE DEVELOPER BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
------------------------------------------
-
-FreeBSD is distributed under the following license.
------------------------------------------
-# $FreeBSD$
-#      @(#)COPYRIGHT   8.2 (Berkeley) 3/21/94
-
-The compilation of software known as FreeBSD is distributed under the
-following terms:
-
-Copyright (c) 1992-2014 The FreeBSD Project. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The 4.4BSD and 4.4BSD-Lite software is distributed under the following
-terms:
-
-All of the documentation and software included in the 4.4BSD and 4.4BSD-Lite
-Releases is copyrighted by The Regents of the University of California.
-
-Copyright 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
-       The Regents of the University of California.  All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-This product includes software developed by the University of
-California, Berkeley and its contributors.
-4. Neither the name of the University nor the names of its contributors
-   may be used to endorse or promote products derived from this software
-   without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-The Institute of Electrical and Electronics Engineers and the American
-National Standards Committee X3, on Information Processing Systems have
-given us permission to reprint portions of their documentation.
-
-In the following statement, the phrase ``this text'' refers to portions
-of the system documentation.
-
-Portions of this text are reprinted and reproduced in electronic form in
-the second BSD Networking Software Release, from IEEE Std 1003.1-1988, IEEE
-Standard Portable Operating System Interface for Computer Environments
-(POSIX), copyright C 1988 by the Institute of Electrical and Electronics
-Engineers, Inc.  In the event of any discrepancy between these versions
-and the original IEEE Standard, the original IEEE Standard is the referee
-document.
-
-In the following statement, the phrase ``This material'' refers to portions
-of the system documentation.
-
-This material is reproduced with permission from American National
-Standards Committee X3, on Information Processing Systems.  Computer and
-Business Equipment Manufacturers Association (CBEMA), 311 First St., NW,
-Suite 500, Washington, DC 20001-2178.  The developmental work of
-Programming Language C was completed by the X3J11 Technical Committee.
-
-The views and conclusions contained in the software and documentation are
-those of the authors and should not be interpreted as representing official
-policies, either expressed or implied, of the Regents of the University
-of California.
-
-
-NOTE: The copyright of UC Berkeley's Berkeley Software Distribution ("BSD")
-source has been updated.  The copyright addendum may be found at
-ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change and is
-included below.
-
-July 22, 1999
-
-To All Licensees, Distributors of Any Version of BSD:
-
-As you know, certain of the Berkeley Software Distribution ("BSD") source
-code files require that further distributions of products containing all or
-portions of the software, acknowledge within their advertising materials
-that such products contain software developed by UC Berkeley and its
-contributors.
-
-Specifically, the provision reads:
-
-"     * 3. All advertising materials mentioning features or use of this software
-      *    must display the following acknowledgement:
-      *    This product includes software developed by the University of
-      *    California, Berkeley and its contributors."
-
-Effective immediately, licensees and distributors are no longer required to
-include the acknowledgement within advertising materials.  Accordingly, the
-foregoing paragraph of those BSD Unix files containing it is hereby deleted
-in its entirety.
-
-William Hoskins
-Director, Office of Technology Licensing
-University of California, Berkeley
------------------------------------------
diff --git a/.ref-Research-V7/README.md b/.ref-Research-V7/README.md
deleted file mode 100644 (file)
index c999371..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-# Unix History Repository
-The history and evolution of the Unix operating system is made available
-as a revision management repository, covering the period from its
-inception in 1970 as a 2.5 thousand line kernel and 26 commands,
-to 2017 as a widely-used 27 million line system. The 1.1GB repository
-contains about half a million commits and more than two thousand merges.
-The repository employs Git system for its storage and is hosted on GitHub.
-It has been created by synthesizing with custom software 24 snapshots of
-systems developed at Bell Labs, the University of California at Berkeley,
-and the 386BSD team, two legacy repositories, and the modern repository
-of the open source FreeBSD system.
-In total, about one thousand individual contributors are identified,
-the early ones through primary research.
-The data set can be used for empirical research in software engineering,
-information systems, and software archaeology.
-
-You can read more details about the contents, creation, and uses of this
-repository through [this link](http://www.dmst.aueb.gr/dds/pubs/jrnl/2016-EMPSE-unix-history/html/unix-history.html).
-
-Two repositories are associated with the project:
-* [unix-history-repo](https://github.com/dspinellis/unix-history-repo) is
-  a repository representing a
-  reconstructed version of the Unix history, based on the currently
-  available data. This repository will be often automatically regenerated from
-  scratch, so this is not a place to make contributions.
-  To ensure replicability its users are encouraged to fork it or archive it.
-* [unix-history-make](https://github.com/dspinellis/unix-history-make) is
-  a repository containing code and metadata used to build the above repository.
-  Contributions to this repository are welcomed.
-
-## Project status
-The project has achieved its major goal with the establishment of a continuous timeline from 1970 until today. The repository contains:
-
-* snapshots of PDP-7, V1, V2, V3, V4, V5, V6, and V7 Research Edition,
-* Unix/32V,
-* all available BSD releases,
-* the CSRG SCCS history,
-* two releases of 386BSD,
-* the 386BSD patchkit,
-* the FreeBSD 1.0 to 1.1.5 CVS history,
-* an import of the FreeBSD repository starting from its initial imports that led to FreeBSD 2.0, and
-* the current FreeBSD repository.
-
-The files appear to be added in the repository in chronological order according to their modification time, and large parts of the source code have been attributed to their actual authors.  Commands like `git blame` and `git log` produce the expected results.
-
-The repository contains a number of two-way merges.
-
-* 3 BSD is merged from Unix/32V and Research Edition 6
-* Various BSD releases are merged from the development branch and a time point of BSD-SCCS
-* FreeBSD 1.0 is merged from Net/2 BSD and 386BSD-0.1-patchkit
-* FreeBSD 2.0 is merged from BSD 4.4/Lite1 and FreeBSD 1.1.5
-
-Blame is apportioned appropriately.
-
-## Tags and Branches
-The following tags or branch names mark specific releases, listed in rough chronological order.
-* Epoch
-* Research-PDP7
-* Research-V1
-* Research-V2
-* Research-V3
-* Research-V4
-* Research-V5
-* Research-V6
-* BSD-1
-* BSD-2
-* Research-V7
-* Bell-32V
-* BSD-3
-* BSD-4
-* BSD-4\_1\_snap
-* BSD-4\_1c\_2
-* BSD-4\_2
-* BSD-4\_3
-* BSD-4\_3\_Reno
-* BSD-4\_3\_Net\_1
-* BSD-4\_3\_Tahoe
-* BSD-4\_3\_Net\_2
-* BSD-4\_4
-* BSD-4\_4\_Lite1
-* BSD-4\_4\_Lite2
-* BSD-SCCS-END
-* 386BSD-0.0
-* 386BSD-0.1
-* 386BSD-0.1-patchkit
-* FreeBSD-release/1.0, 1.1, 1.1.5
-* FreeBSD-release/2.0 2.0.5, 2.1.0, 2.1.5, 2.1.6, 2.1.6.1, 2.1.7, 2.2.0, 2.2.1, 2.2.2, 2.2.5, 2.2.6, 2.2.7, 2.2.8
-* FreeBSD-release/3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0
-* FreeBSD-release/4.0.0 4.1.0, 4.1.1, 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.6.1, 4.6.2, 4.7.0, 4.8.0, 4.9.0, 4.10.0, 4.11.0
-* FreeBSD-release/5.0.0 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.4.0, 5.5.0
-* FreeBSD-release/6.0.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0
-* FreeBSD-release/7.0.0, 7.1.0, 7.2.0, 7.3.0, 7.4.0
-* FreeBSD-release/8.0.0, 8.1.0, 8.2.0, 8.3.0, 8.4.0
-* FreeBSD-release/9.0.0, 9.1.0, 9.2.0
-* FreeBSD-release/10.0.0, 10.1.0, 10.2.0, 10.3.0
-* FreeBSD-release/11.0.0, 11.0.1
-
-A detailed description of the major tags is available in the
-file [releases.md](https://github.com/dspinellis/unix-history-make/blob/master/releases.md).
-
-More tags and branches are available.
-* The `-Snapshot-Development` branches denote commits that have been synthesized from a time-ordered sequence of a snapshot's files.
-* The `-VCS-Development` tags denote the point along an imported version control history branch where a particular release occurred.
-
-## Cool things you can do
-
-The easiest thing you can do is to
-watch the repository's [Gource Visualization](https://youtu.be/S7JB0mhrGCQ).
-
-If you have a broadband network connection and about 1.5GB of free disk space,
-you can download the repository and run Git commands that go back decades.
-Run
-```sh
-git clone https://github.com/dspinellis/unix-history-repo
-git checkout BSD-Release
-```
-to get a local copy of the Unix history repository.
-### View log across releases
-Running
-```sh
-git log --reverse --date-order
-```
-will give you commits such as the following
-
-```
-commit 64d7600ea5210a9125bd1a06e5d184ef7547d23d
-Author: Ken Thompson <ken@research.uucp>
-Date:   Tue Jun 20 05:00:00 1972 -0500
-
-    Research V1 development
-    Work on file u5.s
-
-    Co-Authored-By: Dennis Ritchie <dmr@research.uucp>
-    Synthesized-from: v1/sys
-[...]
-commit 4030f8318890a026e065bc8926cebefb71e9d353
-Author: Ken Thompson <ken@research.uucp>
-Date:   Thu Aug 30 19:30:25 1973 -0500
-
-    Research V3 development
-    Work on file sys/ken/slp.c
-
-    Synthesized-from: v3
-[...]
-commit c4999ec655319a01e84d9460d84df824006f9e2d
-Author: Dennis Ritchie <dmr@research.uucp>
-Date:   Thu Aug 30 19:33:01 1973 -0500
-
-    Research V3 development
-    Work on file sys/dmr/kl.c
-
-    Synthesized-from: v3
-[...]
-commit 355c543c6840fa5f37d8daf2e2eaa735ea6daa4a
-Author: Brian W. Kernighan <bwk@research.uucp>
-Date:   Tue May 13 19:43:47 1975 -0500
-
-    Research V6 development
-    Work on file usr/source/rat/r.g
-
-    Synthesized-from: v6
-[...]
-commit 0ce027f7fb2cf19b7e92d74d3f09eb02e8fea50e
-Author: S. R. Bourne <srb@research.uucp>
-Date:   Fri Jan 12 02:17:45 1979 -0500
-
-    Research V7 development
-    Work on file usr/src/cmd/sh/blok.c
-
-    Synthesized-from: v7
-[...]
-Author: Eric Schmidt <schmidt@ucbvax.Berkeley.EDU>
-Date:   Sat Jan 5 22:49:18 1980 -0800
-
-    BSD 3 development
-
-    Work on file usr/src/cmd/net/sub.c
-```
-### View changes to a specific file
-Run
-```sh
-git checkout Research-Release
-git log --follow --simplify-merges usr/src/cmd/c/c00.c
-```
-to see dates on which the C compiler was modified.
-### Annotate lines in a specific file by their version
-Run
-```
-git blame -C -C usr/sys/sys/pipe.c
-```
-to see how the Unix pipe functionality evolved over the years.
-```
-3cc1108b usr/sys/ken/pipe.c     (Ken Thompson 1974-11-26 18:13:21 -0500  53)   rf->f_flag = FREAD|FPIPE;
-3cc1108b usr/sys/ken/pipe.c     (Ken Thompson 1974-11-26 18:13:21 -0500  54)   rf->f_inode = ip;
-3cc1108b usr/sys/ken/pipe.c     (Ken Thompson 1974-11-26 18:13:21 -0500  55)   ip->i_count = 2;
-[...]
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 122)   register struct inode *ip;
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 123) 
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 124)   ip = fp->f_inode;
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 125)   c = u.u_count;
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 126) 
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 127) loop:
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 128) 
-1f183be2 usr/sys/sys/pipe.c     (Ken Thompson 1979-01-10 15:19:35 -0500 129)   /*
-9a9f6b22 usr/src/sys/sys/pipe.c (Bill Joy     1980-01-05 05:51:18 -0800 130)    * If error or all done, return.
-9a9f6b22 usr/src/sys/sys/pipe.c (Bill Joy     1980-01-05 05:51:18 -0800 131)    */
-9a9f6b22 usr/src/sys/sys/pipe.c (Bill Joy     1980-01-05 05:51:18 -0800 132) 
-9a9f6b22 usr/src/sys/sys/pipe.c (Bill Joy     1980-01-05 05:51:18 -0800 133)   if (u.u_error)
-9a9f6b22 usr/src/sys/sys/pipe.c (Bill Joy     1980-01-05 05:51:18 -0800 134)           return;
-6d632e85 usr/sys/ken/pipe.c     (Ken Thompson 1975-07-17 10:33:37 -0500 135)   plock(ip);
-6d632e85 usr/sys/ken/pipe.c     (Ken Thompson 1975-07-17 10:33:37 -0500 136)   if(c == 0) {
-6d632e85 usr/sys/ken/pipe.c     (Ken Thompson 1975-07-17 10:33:37 -0500 137)           prele(ip);
-6d632e85 usr/sys/ken/pipe.c     (Ken Thompson 1975-07-17 10:33:37 -0500 138)           u.u_count = 0;
-6d632e85 usr/sys/ken/pipe.c     (Ken Thompson 1975-07-17 10:33:37 -0500 139)           return;
-6d632e85 usr/sys/ken/pipe.c     (Ken Thompson 1975-07-17 10:33:37 -0500 140)   }
-```
-## How you can help
-You can help if you were there at the time, or if you can locate a
-source that contains information that is currently missing.
-* If your current GitHub account is not linked to your past contributions,
-  (you can search them through
-  [this page](http://www.spinellis.gr/cgi-bin/namegrep.pl)),
-  associate your past email with your current account through your
-  [GitHub account settings](https://github.com/settings/emails).
-  (Contact me for instructions on how to add email addresses to which you no
-  longer have access.)
-* Look for errors and omissions in the
-  [files that map file paths to authors](https://github.com/dspinellis/unix-history-make/blob/master/src/author-path).
-* Look for parts of the system that have not yet been attributed
-  [in these files](https://github.com/dspinellis/unix-history-make/blob/master/src/unmatched)
-  and propose suitable attributions.
-  Keep in mind that attributions for parts that were developed in one place
-  and modified elsewhere (e.g. developed at Bell Labs and modified at Berkeley)
-  should be for the person who did the modification, not the original author.
-* Look for authors whose identifier starts with ```x-``` in the
-  author id to name map files for
-  [Bell Labs](https://github.com/dspinellis/unix-history-make/blob/master/src/bell.au),
-  and
-  [Berkeley](https://github.com/dspinellis/unix-history-make/blob/master/src/berkeley.au),
-  and provide or confirm their actual login identifier.
-  (The one used is a guess.)
-* Contribute a path regular expression to contributor map file
-  (see [v7.map](https://github.com/dspinellis/unix-history-make/blob/master/src/author-path/v7)) for
-  [4.2BSD](http://www.tuhs.org/Archive/4BSD/Distributions/4.2BSD/),
-  [4.3BSD](http://www.tuhs.org/Archive/4BSD/Distributions/4.3BSD/),
-  [4.3BSD-Reno](http://www.tuhs.org/Archive/4BSD/Distributions/4.3BSD-Reno/),
-  [4.3BSD-Tahoe](http://www.tuhs.org/Archive/4BSD/Distributions/4.3BSD-Tahoe/),
-  [4.3BSD-Alpha](http://www.tuhs.org/Archive/4BSD/Distributions/4.3BSD-Alpha/), and
-  [Net2](http://www.tuhs.org/Archive/4BSD/Distributions/Net2/).
-* Import further branches, such as 2BSD, NetBSD, OpenBSD, and _Plan 9 from Bell Labs_.
-
-## Re-creating the historical repository from scratch
-The -make repository is provided to share and document the creation process, rather than as a bullet-proof way to get consistent and repeatable results.  For instance, importing the snapshots on a system that is case-insensitive (NTFS, HFS Plus with default settings) will result in a few files getting lost.
-
-### Prerequisites
-* Git
-* Perl
-* The Perl modules `VCS::SCCS` and `Git::FastExport`
-(Install with `sudo cpanm VCS::SCCS Git::FastExport`.)
-* If compiling patch under GNU/Linux and library `libbsd`
-(e.g. the `libbsd-dev` package).
-* Sudo (and authorization to use it to mount ISO images)
-
-### Repository creation
-The -repo repository can be created with the following commands.
-```sh
-make
-./import.sh
-```
-
-## Adding a single source
-If you want to add a new source without running the full import process,
-you can do the following.
-
-* Prepare the source's maps and data
-* `cd` to the repo directory
-* Checkout the repo at the point where the new source will branch out
-* Run a Perl command such as the following.
-
-```
-perl ../import-dir.pl [-v] -m Research-V7 -c ../author-path/Bell-32V \
--n ../bell.au -r Research-V7 -i ../ignore/Bell-32V \
-$ARCHIVE/32v Bell 32V -0500 | gfi
-```
-
-## Further reading
-- Diomidis Spinellis. A repository of Unix history and evolution. *Empirical Software Engineering*, 2017. doi:10.1007/s10664-016-9445-5.
-[HTML](http://www.dmst.aueb.gr/dds/pubs/jrnl/2016-EMPSE-unix-history/html/unix-history.html), [PDF](http://www.dmst.aueb.gr/dds/pubs/jrnl/2016-EMPSE-unix-history/html/unix-history.pdf)
-- Diomidis Spinellis. A repository with 44 years of Unix evolution. In *MSR '15: Proceedings of the 12th Working Conference on Mining Software Repositories*, pages 13-16. IEEE, 2015. Best Data Showcase Award. [PDF](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.pdf), [HTML](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/Spi15c.html), [poster](http://www.dmst.aueb.gr/dds/pubs/conf/2015-MSR-Unix-History/html/poster.pdf).
-- Warren Toomey, First Edition Unix: Its Creation and Restoration, in *IEEE Annals of the History of Computing*, vol. 32, no. 3, pp. 74-82, July-Sept. 2010. doi:10.1109/MAHC.2009.55. [PDF](http://www.tuhs.org/Archive/Documentation/Papers/1eUnix_creation_restoration.pdf)
-- Warren Toomey,  The Restoration of Early UNIX Artifacts, in *USENIX ATC '09: 2009 USENIX Annual Technical Conference*. 2009. [PDF](https://www.usenix.org/legacy/events/usenix09/tech/full_papers/toomey/toomey.pdf)
-- Diomidis Spinellis, Panagiotis Louridas, and Maria Kechagia. An exploratory study on the evolution of C programming in the Unix operating system. In Qing Wang and Guenther Ruhe, editors, *ESEM '15: 9th International Symposium on Empirical Software Engineering and Measurement*, pages 54–57. IEEE, October 2015. [HTML](http://www.dmst.aueb.gr/dds/pubs/conf/2015-ESEM-CodeStyle/html/SLK15.html), [PDF](http://www.dmst.aueb.gr/dds/pubs/conf/2015-ESEM-CodeStyle/html/SLK15.pdf)
-- Diomidis Spinellis, Panos Louridas, and Maria Kechagia. The evolution of C programming practices: A study of the Unix operating system 1973–2015. In Willem Visser and Laurie Williams, editors, *ICSE '16: Proceedings of the 38th International Conference on Software Engineering*, May 2016. Association for Computing Machinery. doi:10.1145/2884781.2884799. [PDF](http://www.dmst.aueb.gr/dds/pubs/conf/2016-ICSE-ProgEvol/html/SLK16.pdf), [HTML](http://www.dmst.aueb.gr/dds/pubs/conf/2016-ICSE-ProgEvol/html/SLK16.html)
-- Wikipedia: The Free Encyclopedia
-    - [History of Unix](https://en.wikipedia.org/wiki/History_of_Unix)
-    - [List of Unix systems](https://en.wikipedia.org/wiki/List_of_Unix_systems)
-    - [List of Unix commands](https://en.wikipedia.org/wiki/List_of_Unix_commands)    
-    - [List of Unix daemons](https://en.wikipedia.org/wiki/List_of_Unix_daemons)
-    - [Research Unix](https://en.wikipedia.org/wiki/Research_Unix)
-    - [Berkeley Software Distribution](http://en.wikipedia.org/wiki/BSD_Unix)
-    - [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy)
-- TUHS: The Unix Heritage Society
-    - [The Unix Tree](http://minnie.tuhs.org/cgi-bin/utree.pl)
-- Historical documents and data
-    - [PDP-7 Unix restoration project](https://github.com/DoctorWkt/pdp7-unix)
-    - [First Edition Unix printout - 1972](http://bitsavers.trailing-edge.com/pdf/bellLabs/unix/PreliminaryUnixImplementationDocument_Jun72.pdf)
-    - [Unix 32/V Report - 1978](http://cm.bell-labs.com/cm/cs/who/dmr/otherports/32vscan.pdf)
-    - [Berkeley CSRG Archive CD-ROMs](https://www.mckusick.com/csrg/index.html)
-- Studies
-    - [M. Douglas McIlroy. A Research UNIX Reader: Annotated Excerpts from the Programmer's Manual, 1971-1986](https://archive.org/details/a_research_unix_reader)
-    - [Michael S. Mahoney. Unix at the Bell Labs - People](http://www.princeton.edu/~hos/Mahoney/unixpeople.htm)
-
-## Acknowledgements
-* The following people helped with Bell Labs login identifiers.
- * Brian W. Kernighan
- * Doug McIlroy
- * Arnold D. Robbins
-* The following people helped with *BSD login identifiers.
- * Clem Cole
- * Era Eriksson
- * Mary Ann Horton
- * Warner Losh
- * Kirk McKusick
- * Jeremy C. Reed
- * Ingo Schwarze
- * Anatole Shaw
-* The BSD SCCS import code is based on work by
- * [H. Merijn Brand](http://search.cpan.org/~hmbrand/VCS-SCCS-0.20/SCCS.pm)
- * [Jonathan Gray](https://github.com/jonathangray/csrg-git-patches/)
-
-## Build identification
-* Software URL: https://github.com/dspinellis/unix-history-make
-* Software SHA: 2548f4c5a28844490f036cc103a41432b06d9e58
-* Build timestamp: 2018-11-29 15:37:02 UTC
diff --git a/.ref-Research-V7/bin/1 b/.ref-Research-V7/bin/1
deleted file mode 100755 (executable)
index ee9a6d4..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-case $# in
-
-0)
-       if random -e 1.1
-       then
-       echo one bell system - it works
-       elif random -e 1.1
-       then
-       /usr/games/fortune
-       else 1;1;1;1;1;1;1;1;1;1
-       fi
-;;
-
-*)
-       echo one $* - it works
-
-esac
diff --git a/.ref-Research-V7/bin/calendar b/.ref-Research-V7/bin/calendar
deleted file mode 100755 (executable)
index d534f02..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-PATH=/bin:/usr/bin
-tmp=/tmp/cal$$
-trap "rm $tmp; exit" 0 1 2 13 15
-/usr/lib/calendar >$tmp
-case $1 in
--)
-       sed '
-               s/\([^:]*\):.*:\(.*\):[^:]*$/y=\2 z=\1/
-       ' /etc/passwd \
-       | while read x
-       do
-               eval $x
-               if test -r $y/calendar; then
-                       egrep -f $tmp $y/calendar 2>/dev/null  | mail $z
-               fi
-       done;;
-*)
-       egrep -f $tmp calendar
-esac
diff --git a/.ref-Research-V7/bin/diff3 b/.ref-Research-V7/bin/diff3
deleted file mode 100755 (executable)
index d56219f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-e=
-case $1 in
--*)
-       e=$1
-       shift;;
-esac
-if test $# = 3 -a -f $1 -a -f $2 -a -f $3
-then
-       :
-else
-       echo usage: diff3 file1 file2 file3 1>&2
-       exit
-fi
-trap "rm -f /tmp/d3[ab]$$" 0 1 2 13 15
-diff $1 $3 >/tmp/d3a$$
-diff $2 $3 >/tmp/d3b$$
-/usr/lib/diff3 $e /tmp/d3[ab]$$ $1 $2 $3
diff --git a/.ref-Research-V7/bin/false b/.ref-Research-V7/bin/false
deleted file mode 100755 (executable)
index 379a4c9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-exit 1
diff --git a/.ref-Research-V7/bin/lint b/.ref-Research-V7/bin/lint
deleted file mode 100755 (executable)
index 4b87497..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-L=/usr/lib/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix
-LL=/usr/lib
-trap "rm -f $T; exit" 1 2 15
-for A in $*
-do
-       case $A in
-       -*n*)   P= ;;
-       -*p*)   P=port ;;
-       esac
-       case $A in
-       -l*)    (/lib/cpp $O $LL/llib$A | ${L}1 -v$X-L$A >>$T)2>&1 ;;
-       -[IDOU]*)       O="$O $A" ;;
-       -X)     LL=/usr/scj/lint L=/usr/scj/lint/lpass ;;
-       -*)     X="$X$A" ;;
-       *)      (/lib/cpp $O $A | ${L}1 $X-L$A >>$T)2>&1
-       esac
-       done
-case $P in
-       unix)   (/lib/cpp $O $LL/llib-lc | ${L}1 -v$X-L-lc >>$T)2>&1 ;;
-       port)   (/lib/cpp $O $LL/llib-port | ${L}1 -v$X-L-lc >>$T)2>&1 ;;
-       esac
-sort -u $T | ${L}2 $X
-rm -f $T
diff --git a/.ref-Research-V7/bin/lookbib b/.ref-Research-V7/bin/lookbib
deleted file mode 100755 (executable)
index 1cc2d98..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-A=
-case $1 in
-       -p)     A="$1 $2"
-               shift; shift;;
-       -*)     A=$1
-               shift;;
-esac
-case $1 in
-       -p)     A="$A $1 $2"
-               shift; shift;;
-       -*)     A="$A $1"
-               shift;;
-esac
-if test $1x = x 
-then /usr/lib/refer/mkey -s
-else echo $* | /usr/lib/refer/mkey -s
-fi | /usr/lib/refer/hunt $A /usr/dict/papers/Ind
diff --git a/.ref-Research-V7/bin/lorder b/.ref-Research-V7/bin/lorder
deleted file mode 100755 (executable)
index 7fd6003..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-trap "rm -f $$sym?ef; exit" 0 1 2 13 15
-case $# in
-0)     echo usage: lorder file ...
-       exit ;;
-1)     case $1 in
-       *.o)    set $1 $1
-       esac
-esac
-nm -g $* | sed '
-       /^$/d
-       /:$/{
-               /\.o:/!d
-               s/://
-               h
-               s/.*/& &/
-               p
-               d
-       }
-       /[TD] /{
-               s/.* //
-               G
-               s/\n/ /
-               w '$$symdef'
-               d
-       }
-       s/.* //
-       G
-       s/\n/ /
-       w '$$symref'
-       d
-'
-sort $$symdef -o $$symdef
-sort $$symref -o $$symref
-join $$symref $$symdef | sed 's/[^ ]* *//'
diff --git a/.ref-Research-V7/bin/man b/.ref-Research-V7/bin/man
deleted file mode 100755 (executable)
index 28a4218..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-cmd= sec= fil= opt= i= all=
-cmd=n sec=\?
-cd /usr/man
-for i
-do
-       case $i in
-
-       [1-8])
-               sec=$i ;;
-       -n)
-               cmd=n ;;
-       -t)
-               cmd=t ;;
-       -k)
-               cmd=k ;;
-       -e | -et | -te)
-               cmd=e ;;
-       -ek | -ke)
-               cmd=ek ;;
-       -ne | -en)
-               cmd=ne ;;
-
-       -w)
-               cmd=where ;;
-       -*)
-               opt="$opt $i" ;;
-
-       *)
-               fil=`echo man$sec/$i.*`
-               case $fil in
-               man7/eqnchar.7)
-                       all="$all /usr/pub/eqnchar $fil" ;;
-
-               *\*)
-                       echo $i not found 1>&2 ;;
-               *)
-                       all="$all $fil" ;;
-               esac
-       esac
-done
-case $all in
-       "")
-               exit ;;
-esac
-case $cmd in
-
-n)
-       nroff $opt -man $all ;;
-ne)
-       neqn $all | nroff $opt -man ;;
-t)
-       troff $opt -man $all ;;
-k)
-       troff -t $opt -man $all | tc ;;
-e)
-       eqn $all | troff $opt -man ;;
-ek)
-       eqn $all | troff -t $opt -man | tc ;;
-
-where)
-       echo $all ;;
-esac
diff --git a/.ref-Research-V7/bin/nohup b/.ref-Research-V7/bin/nohup
deleted file mode 100755 (executable)
index 6b590e9..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-trap "" 1 15
-if test -t 2>&1  ; then
-       echo "Sending output to 'nohup.out'"
-       exec nice -5 $* >>nohup.out 2>&1
-else
-       exec nice -5 $* 2>&1
-fi
diff --git a/.ref-Research-V7/bin/pcc b/.ref-Research-V7/bin/pcc
deleted file mode 100755 (executable)
index cb4e405..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-T=/tmp/$$ PATH=/bin:/usr/bin O= OTWO= S= N=yes OPT= ret=0 prof=
-L=/lib COPT=/lib/c2
-LC="$L/crt0.o" LIBS=" $L/libc.a" NAS=as LD=ld CCOMP=/usr/lib/ccom
-ECHO=echo
-trap "rm -f $T.*; exit 1" 1 2 3 15
-trap 'rm -f $T.*; exit $ret' 0
-for A
-do     case $A in
-       *.c)    B=`basename $A .c`
-               $ECHO "$B.c"
-               case "$S$OPT" in
-               -S)     if /lib/cpp $O $A $T.i &&
-                          $CCOMP $prof <$T.i $OTWO >$B.s; then
-                               : OK
-                       else
-                               ret=$?
-                       fi ;;
-               -Syes)  if /lib/cpp $O $A $T.i &&
-                          $CCOMP $prof <$T.i $OTWO >$T.s &&
-                          $COPT $T.s $B.s; then
-                               : OK
-                       else
-                               ret=$?
-                       fi ;;
-               yes)    if /lib/cpp $O $A $T.i &&
-                           $CCOMP $prof <$T.i $OTWO >$T.x &&
-                           $COPT $T.x  $T.s &&
-                           $NAS - -o $B.o $T.s ; then
-                               ll="$ll $B.o"
-                       else
-                               N=no ret=$?
-                       fi ;;
-               *)      if /lib/cpp $O $A $T.i &&
-                          $CCOMP $prof <$T.i $OTWO >$T.s &&
-                           $NAS - -o $B.o $T.s ; then
-                               ll="$ll $B.o"
-                       else
-                               N=no ret=$?
-                       fi ;;
-               esac ;;
-
-       -S)     N=no S=-S OTWO=-l ;;
-
-       -X)     CCOMP=/usr/scj/pcc/comp ;;
-
-       -O)     OPT=yes ;;
-
-       -[IDU]*)        O="$O $A" ;;
-
-       -c)     N=no ;;
-
-       -)      ECHO=: ;;
-
-       *.s)    B=`basename $A .s`
-               if echo "$B.s:" &&
-               $NAS - -o $B.o $A; then
-                       ll="$ll $B.o"
-               else
-                       N=no ret=$?
-               fi ;;
-
-       -p)     prof=-p  ;;
-
-       *)      ll="$ll $A"
-       esac
-done
-case $N in
-       no)     : ;;
-       *)      $LD $LC $ll $LIBS
-       ret=$?
-esac
diff --git a/.ref-Research-V7/bin/plot b/.ref-Research-V7/bin/plot
deleted file mode 100755 (executable)
index c7ee671..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-PATH=/bin:/usr/bin
-case $1 in
--T*)   t=$1
-       shift ;;
-*)     t=-T$TERM
-esac
-case $t in
--T450) exec t450 $*;;
--T300) exec t300 $*;;
--T300S|-T300s) exec t300s $*;;
--Tver) exec vplot $*;;
--Ttek|-T4014|-T)       exec tek $* ;;
-*)  echo plot: terminal type $t not known 1>&2; exit 1
-esac
diff --git a/.ref-Research-V7/bin/spell b/.ref-Research-V7/bin/spell
deleted file mode 100755 (executable)
index 8a8efeb..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-: B flags, D dictionary, F files, H history, S stop, V data for -v
-H=${H-/usr/dict/spellhist}
-T=/tmp/spell.$$
-V=/dev/null
-F= B=
-trap "rm -f $T*; exit" 0 1 2 13 15
-for A in $*
-do
-       case $A in
-       -v)     B="$B -v"
-               V=${T}a ;;
-       -a)     ;;
-       -b)     D=${D-/usr/dict/hlistb}
-               B="$B -b" ;;
-       *)      F="$F $A"
-       esac
-       done
-deroff -w $F |\
-  sort -u |\
-  /usr/lib/spell ${S-/usr/dict/hstop} $T |\
-  /usr/lib/spell ${D-/usr/dict/hlista} $V $B |\
-  sort -u +0f +0 - $T |\
-  tee -a $H
-who am i >>$H 2>/dev/null
-case $V in
-/dev/null)     exit
-esac
-sed '/^\./d' $V | sort -u +1f +0
diff --git a/.ref-Research-V7/bin/struct b/.ref-Research-V7/bin/struct
deleted file mode 100755 (executable)
index 69d2383..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-trap "rm -f /tmp/struct*$$" 0 1 2 3 13 15
-files=no
-for i
-do
-       case $i in
-       -*)     ;;
-       *)      files=yes
-       esac
-done
-
-case $files in
-yes)
-       /usr/lib/struct/structure $* >/tmp/struct$$
-       ;;
-no)
-       cat >/tmp/structin$$
-       /usr/lib/struct/structure /tmp/structin$$ $* >/tmp/struct$$
-esac &&
-       /usr/lib/struct/beautify</tmp/struct$$
diff --git a/.ref-Research-V7/bin/true b/.ref-Research-V7/bin/true
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/.ref-Research-V7/dev/makefile b/.ref-Research-V7/dev/makefile
deleted file mode 100644 (file)
index bb7dd82..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-rp03:
-       /etc/mknod rp0 b 1 1
-       /etc/mknod swap b 1 2
-       /etc/mknod rp3 b 1 3
-       /etc/mknod rrp0 c 11 1
-       /etc/mknod rrp3 c 11 3
-       chmod go-w rp0 swap rp3 rrp0 rrp3
-
-rp04 rp05:
-       /etc/mknod rp0 b 6 0
-       /etc/mknod swap b 6 1
-       /etc/mknod rp3 b 6 6
-       /etc/mknod rrp0 c 14 0
-       /etc/mknod rrp3 c 14 6
-       chmod go-w rp0 swap rp3 rrp0 rrp3
-
-rp06:
-       /etc/mknod rp0 b 6 0
-       /etc/mknod swap b 6 1
-       /etc/mknod rp3 b 6 7
-       /etc/mknod rrp0 c 14 0
-       /etc/mknod rrp3 c 14 7
-       chmod go-w rp0 swap rp3 rrp0 rrp3
-
-tm:
-       /etc/mknod mt0 b 3 0
-       /etc/mknod rmt0 c 12 0
-       /etc/mknod nrmt0 c 12 128
-       chmod go+w mt0 rmt0 nrmt0
-
-ht:
-       /etc/mknod mt0 b 7 64
-       /etc/mknod mt1 b 7 0
-       /etc/mknod rmt0 c 15 64
-       /etc/mknod rmt1 c 15 0
-       /etc/mknod nrmt0 c 15 192
-       /etc/mknod nrmt1 c 15 128
-       chmod go+w mt0 mt1 rmt0 rmt1 nrmt0 nrmt1
diff --git a/.ref-Research-V7/etc/ddate b/.ref-Research-V7/etc/ddate
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.ref-Research-V7/etc/group b/.ref-Research-V7/etc/group
deleted file mode 100644 (file)
index 26a29d7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-other::1:
-sys::2:bin,sys
-bin::3:sys,bin
-uucp::4:
diff --git a/.ref-Research-V7/etc/passwd b/.ref-Research-V7/etc/passwd
deleted file mode 100644 (file)
index a4acc83..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-root:VwL97VCAx1Qhs:0:1::/:
-daemon:x:1:1::/:
-sys::2:2::/usr/sys:
-bin::3:3::/bin:
-uucp::4:4::/usr/lib/uucp:/usr/lib/uucico
-dmr::7:3::/usr/dmr:
diff --git a/.ref-Research-V7/etc/rc b/.ref-Research-V7/etc/rc
deleted file mode 100644 (file)
index 8e59c75..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-PATH=/bin:/usr/bin
-echo "Restricted rights: Use, duplication, or disclosure
-is subject to restrictions stated in your contract with
-Western Electric Company, Inc." >/dev/console
-rm /etc/mtab
-cat /dev/null >/etc/utmp
-/etc/mount /dev/rp3 /usr
-rm -f /usr/spool/lpd/lock
-: /etc/accton /usr/adm/acct
-rm -f /usr/tmp/*
-rm -f /tmp/*
-/etc/update
-date >/dev/console
-/etc/cron
diff --git a/.ref-Research-V7/etc/ttys b/.ref-Research-V7/etc/ttys
deleted file mode 100644 (file)
index 49c2c80..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-14console
-00tty00
-00tty01
-00tty02
-00tty03
-00tty04
-00tty05
-00tty06
-00tty07
-00tty08
-00tty09
-00tty10
-00tty11
-00tty12
-00tty13
-00tty14
-00tty15
-00tty16
-00tty17
-00tty18
-00tty19
-00tty20
-00tty21
-00tty22
-00tty23
-00tty24
-00tty25
-00tty26
-00tty27
-00tty28
-00tty29
-00tty30
-00tty31
diff --git a/.ref-Research-V7/etc/utmp b/.ref-Research-V7/etc/utmp
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.ref-Research-V7/usr/dict/papers/Ind.ic b/.ref-Research-V7/usr/dict/papers/Ind.ic
deleted file mode 100644 (file)
index 58f1927..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-Rv7man:0,135
-Rv7man:135,279
-Rv7man:414,175
-Rv7man:589,165
-Rv7man:754,180
-Rv7man:934,151
-Rv7man:1085,124
-Rv7man:1209,115
-Rv7man:1324,142
-Rv7man:1466,179
-Rv7man:1645,161
-Rv7man:1806,209
-Rv7man:2015,110
-Rv7man:2125,141
-Rv7man:2266,174
-Rv7man:2440,139
-Rv7man:2579,103
-Rv7man:2682,50
-Rv7man:2732,127
-Rv7man:2859,797
-Rv7man:3656,66
-Rv7man:3722,158
-Rv7man:3880,125
-Rv7man:4005,95
-Rv7man:4100,171
-Rv7man:4271,107
-Rv7man:4378,156
-Rv7man:4534,150
-Rv7man:4684,172
-Rv7man:4856,175
-Rv7man:5031,191
-Rv7man:5222,87
-Rv7man:5309,126
-Rv7man:5435,181
-Rv7man:5616,177
-Rv7man:5793,86
-Rv7man:5879,194
-Rv7man:6073,949
-Rv7man:7022,111
-Rv7man:7133,92
-Rv7man:7225,222
-Rv7man:7447,338
-Rv7man:7785,196
diff --git a/.ref-Research-V7/usr/dict/papers/Rv7man b/.ref-Research-V7/usr/dict/papers/Rv7man
deleted file mode 100644 (file)
index e5da452..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-%A L. P. Deutsch
-%A B. W. Lampson
-%T An online editor
-%J Comm. Assoc. Comp. Mach.
-%V 10
-%N 12
-%D December 1967
-%P 793-799, 803
-%K qed
-
-.[
-%r 17
-%K cstr
-%R Comp. Sci. Tech. Rep. No. 17
-%I Bell Laboratories
-%C Murray Hill, New Jersey
-%A B. W. Kernighan
-%A L. L. Cherry
-%T A System for Typesetting Mathematics
-%d May 1974, revised April 1977
-%J Comm. Assoc. Comp. Mach.
-%K acm cacm
-%V 18
-%P 151-157
-%D March 1975
-.]
-
-%T U\s-2NIX\s0 Time-Sharing System: Document Preparation
-%K unix bstj
-%A B. W. Kernighan
-%A M. E. Lesk
-%A J. F. Ossanna
-%J Bell Sys. Tech. J.
-%V 57
-%N 6
-%P 2115-2135
-%D 1978
-
-%A T. A. Dolotta
-%A J. R. Mashey
-%T An Introduction to the Programmer's Workbench
-%J Proc. 2nd Int. Conf. on Software Engineering
-%D October 13-15, 1976
-%P 164-168
-
-%T U\s-2NIX\s0 Time-Sharing System: The Programmer's Workbench
-%A T. A. Dolotta
-%A R. C. Haight
-%A J. R. Mashey
-%J Bell Sys. Tech. J.
-%V 57
-%N 6
-%P 2177-2200
-%D 1978
-%K unix bstj
-
-%T U\s-2NIX\s0 Time-Sharing System: U\s-2NIX\s0 on a Microprocessor
-%K unix bstj
-%A H. Lycklama
-%J Bell Sys. Tech. J.
-%V 57
-%N 6
-%P 2087-2101
-%D 1978
-
-%T The C Programming Language
-%A B. W. Kernighan
-%A D. M. Ritchie
-%I Prentice-Hall
-%C Englewood Cliffs, New Jersey
-%D 1978
-
-%T Computer Recreations
-%A Aleph-null
-%J Software Practice and Experience
-%V 1
-%N 2
-%D April-June 1971
-%P 201-204
-
-%T U\s-2NIX\s0 Time-Sharing System: The U\s-2NIX\s0 Shell
-%A S. R. Bourne
-%K unix bstj
-%J Bell Sys. Tech. J.
-%V 57
-%N 6
-%P 1971-1990
-%D 1978
-
-%A L. P. Deutsch
-%A B. W. Lampson
-%T \*sSDS\*n 930 time-sharing system preliminary reference manual
-%R Doc. 30.10.10, Project \*sGENIE\*n
-%C Univ. Cal. at Berkeley
-%D April 1965
-
-%A R. J. Feiertag
-%A E. I. Organick
-%T The Multics input-output system
-%J Proc. Third Symposium on Operating Systems Principles
-%D October 18-20, 1971
-%P 35-41
-
-%A D. G. Bobrow
-%A J. D. Burchfiel
-%A D. L. Murphy
-%A R. S. Tomlinson
-%T \*sTENEX\*n, a Paged Time Sharing System for the \*sPDP\*n-10
-%J Comm. Assoc. Comp. Mach.
-%V 15
-%N 3
-%D March 1972
-%K tenex
-%P 135-143
-
-%A R. E. Griswold
-%A D. R. Hanson
-%T An Overview of SL5
-%J SIGPLAN Notices
-%V 12
-%N 4
-%D April 1977
-%P 40-50
-
-%A E. W. Dijkstra
-%T Cooperating Sequential Processes
-%B Programming Languages
-%E F. Genuys
-%I Academic Press
-%C New York
-%D 1968
-%P 43-112
-
-%A J. A. Hawley
-%A W. B. Meyer
-%T M\s-2UNIX\s0, A Multiprocessing Version of U\s-2NIX\s0
-%K munix unix
-%R M.S. Thesis
-%I Naval Postgraduate School
-%C Monterey, Cal.
-%D 1975
-
-%T The U\s-2NIX\s0 Time-Sharing System
-%K unix bstj
-%A D. M. Ritchie
-%A K. Thompson
-%J Bell Sys. Tech. J.
-%V 57
-%N 6
-%P 1905-1929
-%D 1978
-
-%A E. I. Organick
-%T The M\s-2ULTICS\s0 System
-%K multics
-%I M.I.T. Press
-%C Cambridge, Mass.
-%D 1972
-
-%T UNIX for Beginners
-%A B. W. Kernighan
-%D 1978
-
-%T U\s-2NIX\s0 Programmer's Man\&ual
-%A K. Thompson
-%A D. M. Ritchie
-%K unix
-%I Bell Laboratories
-%O Seventh Edition.
-%D 1978
-
-%A K. Thompson
-%T The U\s-2NIX\s0 Command Language
-%B Structured Programming\(emInfotech State of the Art Report
-%I Infotech International Ltd.
-%C Nicholson House, Maidenhead, Berkshire, England
-%D March 1975
-%P 375-384
-%K unix
-%X pwb
-Brief description of shell syntax and semantics, without much
-detail on implementation.
-Much on pipes and convenience of hooking programs together.
-Includes SERMONETTE:
-"Many familiar computing `concepts' are missing from UNIX.
-Files have no records. There are no access methods.
-There are no file types.  These concepts fill a much-needed gap.
-I sincerely hope that when future systems are designed by
-manufacturers the value of some of these ingrained notions is re-examined.
-Like the politician and his `common man', manufacturers have
-their `average user'.
-
-%A J. R. Mashey
-%T PWB/UNIX Shell Tutorial
-%D September 30, 1977
-
-%A D. F. Hartley (Ed.)
-%T The Cambridge Multiple Access System \- Users Reference Manual
-%I University Mathematical Laboratory
-%C Cambridge, England
-%D 1968
-
-%A P. A. Crisman (Ed.)
-%T The Compatible Time-Sharing System
-%I M.I.T. Press
-%K whole ctss book
-%C Cambridge, Mass.
-%D 1965
-
-%T LR Parsing
-%A A. V. Aho
-%A S. C. Johnson
-%J Comp. Surveys
-%V 6
-%N 2
-%P 99-124
-%D June 1974
-
-%T Deterministic Parsing of Ambiguous Grammars
-%A A. V. Aho
-%A S. C. Johnson
-%A J. D. Ullman
-%J Comm. Assoc. Comp. Mach.
-%K acm cacm
-%V 18
-%N 8
-%P 441-452
-%D August 1975
-
-%A A. V. Aho
-%A J. D. Ullman
-%T Principles of Compiler Design
-%I Addison-Wesley
-%C Reading, Mass.
-%D 1977
-
-.[
-%r 65
-%R Comp. Sci. Tech. Rep. No. 65
-%K CSTR
-%A S. C. Johnson
-%T Lint, a C Program Checker
-%D December 1977
-%O updated version TM 78-1273-3
-%D 1978
-.]
-
-%T A Portable Compiler: Theory and Practice
-%A S. C. Johnson
-%J Proc. 5th ACM Symp. on Principles of Programming Languages
-%P 97-104
-%D January 1978
-
-.[
-%r 39
-%K CSTR
-%R Comp. Sci. Tech. Rep. No. 39
-%I Bell Laboratories
-%C Murray Hill, New Jersey
-%A M. E. Lesk
-%T Lex \(em A Lexical Analyzer Generator
-%D October 1975
-.]
-
-.[
-%r 32
-%K CSTR
-%R Comp. Sci. Tech. Rep. No. 32
-%I Bell Laboratories
-%C Murray Hill, New Jersey
-%A S. C. Johnson
-%T Yacc \(em  Yet Another Compiler-Compiler
-%D July 1975
-.]
-
-%T U\s-2NIX\s0 Time-Sharing System: Portability of C Programs and the U\s-2NIX\s0 System
-%K unix bstj
-%A S. C. Johnson
-%A D. M. Ritchie
-%J Bell Sys. Tech. J.
-%V 57
-%N 6
-%P 2021-2048
-%D 1978
-
-%T Typing Documents on UNIX and GCOS:  The -ms Macros for Troff
-%A M. E. Lesk
-%D 1977
-
-%A K. Thompson
-%A D. M. Ritchie
-%T U\s-2NIX\s0 Programmer's Manual
-%K unix
-%I Bell Laboratories
-%O Sixth Edition
-%D May 1975
-
-%T The Network U\s-2NIX\s0 System
-%K unix
-%A G. L. Chesson
-%J Operating Systems Review
-%V 9
-%N 5
-%P 60-66
-%D 1975
-%O Also in \f2Proc. 5th Symp. on Operating Systems Principles.\f1
-
-%T Spider \(em An Experimental Data Communications System
-%Z ctr127
-%A A. G. Fraser
-%J Proc. IEEE Conf. on Communications
-%P 21F
-%O IEEE Cat. No. 74CH0859-9-CSCB.
-%D June 1974
-
-%T A Virtual Channel Network
-%A A. G. Fraser
-%J Datamation
-%P 51-56
-%D February 1975
-
-.[
-%r 41
-%K CSTR
-%R Comp. Sci. Tech. Rep. No. 41
-%I Bell Laboratories
-%C Murray Hill, New Jersey
-%A J. W. Hunt
-%A M. D. McIlroy
-%T An Algorithm for Differential File Comparison
-%D June 1976
-.]
-
-%A F. P. Brooks, Jr.
-%T The Mythical Man-Month
-%I Addison-Wesley
-%C Reading, Mass.
-%D 1975
-%X pwb
-Readable, classic reference on software engineering and
-problems of large projects, from someone with experience in them.
-Required reading for any software engineer, even if conclusions may not
-always be agreed with.
-%br
-"The second is the most dangerous system a man every designs." p.55.
-%br
-"Hence plan to throw one away; you will, anyhow." p.116.
-%br
-"Cosgrove has perceptively pointed out that the programmer delivers
-satisfaction of a user need rather than any tangible product.
-And both the actual need and the user's perception of that need
-will change as programs are built, tested, and used." p.117.
-%br
-"The total cost of maintaining a widely used program is typically 40 percent
-or more of the cost of developing it." p.121.
-%br
-"As shown above, amalgamating prose and program reduces the total
-number of characters to be stored." p.175.
-
-%T A Portable Compiler for the Language C
-%A A. Snyder
-%I Master's Thesis, M.I.T.
-%C Cambridge, Mass.
-%D 1974
-
-%T The C Language Calling Sequence
-%A M. E. Lesk
-%A S. C. Johnson
-%A D. M. Ritchie
-%D 1977
-
-%T Optimal Code Generation for Expression Trees
-%A A. V. Aho
-%A S. C. Johnson
-%D 1975
-%J J. Assoc. Comp. Mach.
-%K acm jacm
-%V 23
-%N 3
-%P 488-501
-%O Also in \f2Proc. ACM Symp. on Theory of Computing,\f1 pp. 207-217, 1975.
-
-%A R. Sethi
-%A J. D. Ullman
-%T The Generation of Optimal Code for Arithmetic Expressions
-%J J. Assoc. Comp. Mach.
-%K acm jacm
-%V 17
-%N 4
-%D October 1970
-%P 715-728
-%O Reprinted as pp. 229-247 in \fICompiler Techniques\fR, ed. B. W. Pollack, Auerbach, Princeton NJ (1972).
-%X pwb
-Optimal approach for straight-line, fixed
-number of regs.
-
-%T Code Generation for Machines with Multiregister
-Operations
-%A A. V. Aho
-%A S. C. Johnson
-%A J. D. Ullman
-%J Proc. 4th ACM Symp. on Principles of Programming Languages
-%P 21-28
-%D January 1977
-
diff --git a/.ref-Research-V7/usr/dict/papers/runinv b/.ref-Research-V7/usr/dict/papers/runinv
deleted file mode 100755 (executable)
index 68956b9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/usr/lib/refer/mkey R* | /usr/lib/refer/inv -v -h997 -n Xind
-mv Xind.ia Ind.ia
-mv Xind.ib Ind.ib
-mv Xind.ic Ind.ic
diff --git a/.ref-Research-V7/usr/dict/spellhist b/.ref-Research-V7/usr/dict/spellhist
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.ref-Research-V7/usr/dict/words b/.ref-Research-V7/usr/dict/words
deleted file mode 100644 (file)
index c2d5594..0000000
+++ /dev/null
@@ -1,24001 +0,0 @@
-10th
-1st
-2nd
-3rd
-4th
-5th
-6th
-7th
-8th
-9th
-a
-A&M
-A&P
-a's
-AAA
-AAAS
-Aaron
-AAU
-ABA
-Ababa
-aback
-abalone
-abandon
-abase
-abash
-abate
-abater
-abbas
-abbe
-abbey
-abbot
-Abbott
-abbreviate
-abc
-abdicate
-abdomen
-abdominal
-abduct
-Abe
-abed
-Abel
-Abelian
-Abelson
-Aberdeen
-Abernathy
-aberrant
-aberrate
-abet
-abetted
-abeyance
-abeyant
-abhorred
-abhorrent
-abide
-Abidjan
-Abigail
-abject
-ablate
-ablaze
-able
-ablution
-Abner
-abnormal
-Abo
-aboard
-abode
-abolish
-abolition
-abominable
-abominate
-aboriginal
-aborigine
-aborning
-abort
-abound
-about
-above
-aboveboard
-aboveground
-abovementioned
-abrade
-Abraham
-Abram
-Abramson
-abrasion
-abrasive
-abreact
-abreast
-abridge
-abridgment
-abroad
-abrogate
-abrupt
-abscess
-abscissa
-abscissae
-absence
-absent
-absentee
-absenteeism
-absentia
-absentminded
-absinthe
-absolute
-absolution
-absolve
-absorb
-absorbent
-absorption
-absorptive
-abstain
-abstention
-abstinent
-abstract
-abstractor
-abstruse
-absurd
-abuilding
-abundant
-abusable
-abuse
-abusive
-abut
-abutted
-abutting
-abysmal
-abyss
-Abyssinia
-AC
-academia
-academic
-academician
-academy
-Acadia
-acanthus
-Acapulco
-accede
-accelerate
-accelerometer
-accent
-accentual
-accentuate
-accept
-acceptant
-acceptor
-access
-accessible
-accession
-accessory
-accident
-accidental
-accipiter
-acclaim
-acclamation
-acclimate
-acclimatize
-accolade
-accommodate
-accompaniment
-accompanist
-accompany
-accomplice
-accomplish
-accord
-accordant
-accordion
-accost
-account
-accountant
-accouter
-Accra
-accredit
-accreditate
-accretion
-accrual
-accrue
-acculturate
-accumulate
-accuracy
-accurate
-accusation
-accusative
-accuse
-accustom
-ace
-acetate
-acetic
-acetone
-acetylene
-ache
-achieve
-Achilles
-aching
-achromatic
-acid
-acidic
-acidulous
-Ackerman
-Ackley
-acknowledge
-acknowledgeable
-ACM
-acme
-acolyte
-acorn
-acoustic
-acquaint
-acquaintance
-acquiesce
-acquiescent
-acquire
-acquisition
-acquisitive
-acquit
-acquittal
-acquitting
-acre
-acreage
-acrid
-acrobacy
-acrobat
-acrobatic
-acronym
-acropolis
-across
-acrylate
-acrylic
-ACS
-act
-Actaeon
-actinic
-actinide
-actinium
-actinometer
-activate
-activation
-activism
-Acton
-actor
-actress
-Acts
-actual
-actuarial
-actuate
-acuity
-acumen
-acute
-acyclic
-ad
-Ada
-adage
-adagio
-Adair
-Adam
-adamant
-Adams
-Adamson
-adapt
-adaptation
-adaptive
-add
-added
-addend
-addenda
-addendum
-addict
-Addis
-Addison
-addition
-additional
-additive
-addle
-address
-addressee
-Addressograph
-adduce
-Adelaide
-Adele
-Adelia
-Aden
-adenoma
-adept
-adequacy
-adequate
-adhere
-adherent
-adhesion
-adhesive
-adiabatic
-adieu
-adipic
-Adirondack
-adjacent
-adjectival
-adjective
-adjoin
-adjoint
-adjourn
-adjudge
-adjudicate
-adjunct
-adjust
-adjutant
-Adkins
-Adler
-administer
-administrable
-administrate
-administratrix
-admiral
-admiralty
-admiration
-admire
-admissible
-admission
-admit
-admittance
-admitted
-admitting
-admix
-admixture
-admonish
-admonition
-ado
-adobe
-adolescent
-Adolph
-Adolphus
-Adonis
-adopt
-adoption
-adoptive
-adore
-adorn
-adrenal
-adrenaline
-Adrian
-Adriatic
-Adrienne
-adrift
-adroit
-adsorb
-adsorbate
-adsorption
-adsorptive
-adulate
-adult
-adulterate
-adulterous
-adultery
-adulthood
-advance
-advantage
-advantageous
-advent
-adventitious
-adventure
-adventurous
-adverb
-adverbial
-adversary
-adverse
-advert
-advertise
-advice
-advisable
-advise
-advisee
-advisor
-advisory
-advocacy
-advocate
-Aegean
-aegis
-Aeneas
-Aeneid
-aeolian
-Aeolus
-aerate
-aerial
-Aerobacter
-aerobic
-aerodynamic
-aerogene
-aeronautic
-aerosol
-aerospace
-Aeschylus
-aesthete
-aesthetic
-afar
-affable
-affair
-affect
-affectate
-affectionate
-afferent
-affiance
-affidavit
-affiliate
-affine
-affinity
-affirm
-affirmation
-affirmative
-affix
-afflict
-affluence
-affluent
-afford
-afforest
-afforestation
-affront
-Afghan
-Afghanistan
-aficionado
-afield
-afire
-aflame
-afloat
-afoot
-aforementioned
-aforesaid
-aforethought
-afraid
-afresh
-Africa
-afro
-aft
-aftereffect
-afterglow
-afterimage
-afterlife
-aftermath
-afternoon
-afterthought
-afterward
-again
-against
-Agamemnon
-agate
-Agatha
-agave
-age
-Agee
-agenda
-agent
-agglomerate
-agglutinate
-agglutinin
-aggravate
-aggregate
-aggression
-aggressive
-aggressor
-aggrieve
-aghast
-agile
-agitate
-agleam
-Agnes
-Agnew
-agnomen
-agnostic
-ago
-agone
-agony
-agouti
-agrarian
-agree
-agreeable
-agreed
-agreeing
-Agricola
-agricultural
-agriculture
-agrimony
-ague
-Agway
-ah
-ahead
-ahem
-Ahmadabad
-ahoy
-aid
-Aida
-aide
-Aides
-Aiken
-ail
-ailanthus
-aile
-aileron
-aim
-ain't
-Ainu
-air
-airborne
-aircraft
-airdrop
-airedale
-Aires
-airfare
-airfield
-airflow
-airframe
-airlift
-airline
-airlock
-airmail
-airman
-airmass
-airmen
-airpark
-airplane
-airport
-airspeed
-airstrip
-airtight
-airway
-airy
-aisle
-Aitken
-ajar
-Ajax
-Akers
-akin
-Akron
-ala
-Alabama
-Alabamian
-alabaster
-alacrity
-alai
-Alameda
-Alamo
-alan
-alarm
-Alaska
-alb
-alba
-albacore
-Albania
-Albanian
-Albany
-albatross
-albeit
-Alberich
-Albert
-Alberta
-Alberto
-Albrecht
-Albright
-album
-albumin
-Albuquerque
-Alcestis
-alchemy
-Alcmena
-Alcoa
-alcohol
-alcoholic
-alcoholism
-Alcott
-alcove
-Aldebaran
-aldehyde
-Alden
-alder
-alderman
-aldermen
-Aldrich
-aldrin
-ale
-Alec
-Aleck
-aleph
-alert
-alewife
-Alex
-Alexander
-Alexandra
-Alexandre
-Alexandria
-Alexei
-Alexis
-alfalfa
-alfonso
-Alfred
-Alfredo
-alfresco
-alga
-algae
-algaecide
-algal
-algebra
-algebraic
-Algenib
-Alger
-Algeria
-Algerian
-Algiers
-alginate
-Algol
-Algonquin
-algorithm
-algorithmic
-Alhambra
-alia
-alias
-alibi
-Alice
-Alicia
-alien
-alienate
-alight
-align
-alike
-alimony
-aliphatic
-aliquot
-Alison
-Alistair
-alive
-alizarin
-alkali
-alkaline
-alkaloid
-alkane
-alkene
-all
-Allah
-allay
-allegate
-allege
-Allegheny
-allegiant
-allegoric
-allegory
-Allegra
-allegro
-allele
-allemand
-Allen
-Allentown
-allergic
-allergy
-alleviate
-alley
-alleyway
-alliance
-allied
-alligator
-Allis
-Allison
-alliterate
-allocable
-allocate
-allot
-allotropic
-allotted
-allotting
-allow
-allowance
-alloy
-allspice
-Allstate
-allude
-allure
-allusion
-allusive
-alluvial
-alluvium
-ally
-allyl
-Allyn
-alma
-Almaden
-almagest
-almanac
-almighty
-almond
-almost
-aloe
-aloft
-aloha
-alone
-along
-alongside
-aloof
-aloud
-alp
-alpenstock
-Alpert
-alpha
-alphabet
-alphabetic
-alphanumeric
-Alpheratz
-Alphonse
-alpine
-Alps
-already
-Alsatian
-also
-Alsop
-Altair
-altar
-alter
-alterate
-altercate
-alterman
-altern
-alternate
-althea
-although
-altimeter
-altitude
-alto
-altogether
-Alton
-altruism
-altruist
-alum
-alumina
-aluminate
-alumna
-alumnae
-alumni
-alumnus
-alundum
-Alva
-Alvarez
-alveolar
-alveoli
-alveolus
-Alvin
-alway
-alyssum
-am
-AMA
-Amadeus
-amalgam
-amalgamate
-amanita
-amanuensis
-amaranth
-Amarillo
-amass
-amateur
-amateurish
-amatory
-amaze
-Amazon
-ambassador
-amber
-ambiance
-ambidextrous
-ambient
-ambiguity
-ambiguous
-ambition
-ambitious
-ambivalent
-amble
-ambling
-ambrose
-ambrosia
-ambrosial
-ambulant
-ambulate
-ambulatory
-ambuscade
-ambush
-Amelia
-ameliorate
-amen
-amend
-amende
-Amerada
-America
-American
-Americana
-Americanism
-americium
-Ames
-amethyst
-amethystine
-Amherst
-ami
-amicable
-amid
-amide
-amidst
-amigo
-amino
-aminobenzoic
-amiss
-amity
-Amman
-Ammerman
-ammeter
-ammo
-ammonia
-ammoniac
-ammonium
-ammunition
-Amoco
-amoeba
-amoebae
-amok
-among
-amongst
-amoral
-amorphous
-amort
-Amos
-amount
-amperage
-ampere
-ampersand
-Ampex
-amphetamine
-amphibian
-amphibious
-amphibole
-amphibology
-ample
-amplifier
-amplify
-amplitude
-amply
-amputate
-amra
-Amsterdam
-Amtrak
-amulet
-amuse
-amy
-amygdaloid
-an
-ana
-Anabaptist
-Anabel
-anachronism
-anachronistic
-anaconda
-anaerobic
-anaglyph
-anagram
-Anaheim
-analeptic
-analgesic
-analogous
-analogue
-analogy
-analyses
-analysis
-analyst
-analytic
-anamorphic
-anaplasmosis
-anarch
-anarchic
-anarchy
-anastigmat
-anastigmatic
-anastomosis
-anastomotic
-anathema
-Anatole
-anatomic
-anatomy
-ancestor
-ancestral
-ancestry
-anchor
-anchorage
-anchorite
-anchoritism
-anchovy
-ancient
-ancillary
-and
-Andean
-Andersen
-Anderson
-Andes
-andesine
-andesite
-Andorra
-Andover
-Andre
-Andrea
-Andrei
-Andrew
-Andrews
-Andromache
-Andromeda
-Andy
-anecdotal
-anecdote
-anemone
-anent
-anew
-angel
-Angela
-Angeles
-angelfish
-angelic
-Angelica
-Angelina
-Angeline
-Angelo
-anger
-Angie
-angiosperm
-angle
-Angles
-Anglican
-Anglicanism
-anglicize
-angling
-Anglo
-Anglophobia
-Angola
-Angora
-angry
-angst
-angstrom
-anguish
-angular
-Angus
-anharmonic
-Anheuser
-anhydride
-anhydrite
-anhydrous
-ani
-aniline
-animadversion
-animadvert
-animal
-animate
-animism
-animosity
-anion
-anionic
-anise
-aniseikonic
-anisotropic
-anisotropy
-Anita
-Ankara
-ankle
-Ann
-Anna
-annal
-Annale
-Annalen
-Annapolis
-Anne
-anneal
-Annette
-annex
-Annie
-annihilate
-anniversary
-annotate
-announce
-annoy
-annoyance
-annual
-annuity
-annul
-annular
-annuli
-annulled
-annulling
-annulus
-annum
-annunciate
-anode
-anodic
-anomalous
-anomaly
-anomie
-anonymity
-anonymous
-anorexia
-anorthic
-anorthosite
-another
-Anselm
-Anselmo
-ANSI
-answer
-ant
-antacid
-Antaeus
-antagonism
-antagonist
-antagonistic
-antarctic
-Antarctica
-Antares
-ante
-anteater
-antebellum
-antecedent
-antedate
-antelope
-antenna
-antennae
-anterior
-anthem
-anther
-anthology
-Anthony
-anthracite
-anthracnose
-anthropogenic
-anthropology
-anthropomorphic
-anti
-antic
-anticipate
-anticipatory
-Antietam
-antigen
-Antigone
-antimony
-Antioch
-antipasto
-antipathy
-antiperspirant
-antiphonal
-antipodes
-antiquarian
-antiquary
-antiquated
-antique
-antiquity
-antisemitic
-antisemitism
-antithetic
-antler
-Antoine
-Antoinette
-Anton
-Antonio
-Antony
-antonym
-anus
-anvil
-anxiety
-anxious
-any
-anybody
-anybody'd
-anyhow
-anyone
-anyplace
-anything
-anyway
-anywhere
-aorta
-apache
-apart
-apartheid
-apathetic
-apathy
-ape
-aperiodic
-aperture
-apex
-aphasia
-aphasic
-aphelion
-aphid
-aphorism
-Aphrodite
-apices
-apiece
-aplomb
-apocalypse
-apocalyptic
-Apocrypha
-apocryphal
-apogee
-Apollo
-Apollonian
-apologetic
-apologia
-apology
-apostate
-apostle
-apostolic
-apostrophe
-apothecary
-apothegm
-apotheosis
-Appalachia
-appall
-appanage
-apparatus
-apparel
-apparent
-apparition
-appeal
-appear
-appearance
-appeasable
-appease
-appellant
-appellate
-append
-appendage
-appendices
-appendix
-appertain
-appetite
-Appian
-applaud
-applause
-apple
-Appleby
-applejack
-Appleton
-appliance
-applicable
-applicant
-applicate
-applied
-applique
-apply
-appoint
-appointe
-appointee
-apportion
-apposite
-apposition
-appraisal
-appraise
-appreciable
-appreciate
-apprehend
-apprehension
-apprehensive
-apprentice
-apprise
-approach
-approbation
-appropriable
-appropriate
-approval
-approve
-approximable
-approximant
-approximate
-apricot
-April
-apron
-apropos
-APS
-apse
-apt
-aptitude
-aqua
-aquarium
-Aquarius
-aquatic
-aqueduct
-aqueous
-Aquila
-Aquinas
-Arab
-arabesque
-Arabia
-Arabic
-Araby
-Arachne
-arachnid
-arbiter
-arbitrage
-arbitrary
-arbitrate
-arboreal
-arboretum
-arbutus
-arc
-arcade
-Arcadia
-arcana
-arcane
-arccos
-arccosine
-arch
-archae
-archaic
-archaism
-archangel
-archbishop
-archdiocese
-archenemy
-Archer
-archery
-archetype
-archetypical
-archfool
-Archibald
-Archimedes
-arching
-archipelago
-architect
-architectonic
-architectural
-architecture
-archival
-archive
-arcing
-arcsin
-arcsine
-arctan
-arctangent
-arctic
-Arcturus
-Arden
-ardency
-ardent
-arduous
-are
-area
-areaway
-areawide
-aren't
-arena
-arenaceous
-Arequipa
-Ares
-Argentina
-argillaceous
-Argive
-argo
-argon
-Argonaut
-Argonne
-argot
-argue
-argument
-argumentation
-argumentative
-Argus
-arhat
-Ariadne
-Arianism
-arid
-Aries
-arise
-arisen
-aristocracy
-aristocrat
-aristocratic
-Aristotelean
-Aristotelian
-Aristotle
-arithmetic
-Arizona
-ark
-Arkansan
-Arkansas
-Arlen
-Arlene
-Arlington
-arm
-armada
-armadillo
-Armageddon
-armament
-Armata
-armature
-armchair
-Armco
-Armenian
-armhole
-armillaria
-armistice
-armload
-armoire
-Armonk
-Armour
-armpit
-Armstrong
-army
-Arnold
-aroma
-aromatic
-arose
-around
-arousal
-arouse
-ARPA
-arpeggio
-arrack
-Arragon
-arraign
-arrange
-arrangeable
-array
-arrear
-arrest
-Arrhenius
-arrival
-arrive
-arrogant
-arrogate
-arrow
-arrowhead
-arrowroot
-arroyo
-arsenal
-arsenate
-arsenic
-arsenide
-arsine
-arson
-art
-Artemis
-artemisia
-arterial
-arteriole
-arteriolosclerosis
-arteriosclerosis
-artery
-arthritis
-Arthur
-artichoke
-article
-articulate
-articulatory
-Artie
-artifact
-artifice
-artificial
-artillery
-artisan
-artistry
-Arturo
-artwork
-arty
-Aruba
-arum
-aryl
-as
-asbestos
-ascend
-ascendant
-ascension
-ascent
-ascertain
-ascetic
-asceticism
-ascomycetes
-ascribe
-ascription
-aseptic
-ash
-ashame
-ashen
-Asher
-Asheville
-Ashland
-Ashley
-ashman
-ashmen
-Ashmolean
-ashore
-ashtray
-ashy
-Asia
-Asiatic
-aside
-Asilomar
-asinine
-ask
-askance
-askew
-asleep
-asocial
-asparagus
-aspect
-aspen
-asperity
-aspersion
-asphalt
-aspheric
-asphyxiate
-aspidistra
-aspirant
-aspirate
-aspire
-aspirin
-asplenium
-ass
-assai
-assail
-assailant
-Assam
-assassin
-assassinate
-assault
-assay
-assemblage
-assemble
-assent
-assert
-assess
-assessor
-asset
-assiduity
-assiduous
-assign
-assignation
-assignee
-assimilable
-assimilate
-assist
-assistant
-associable
-associate
-associative
-assonant
-assort
-assuage
-assume
-assumption
-assurance
-assure
-Assyria
-Assyriology
-Astarte
-astatine
-aster
-asteria
-asterisk
-asteroid
-asteroidal
-asthma
-astigmat
-astigmatic
-astigmatism
-ASTM
-astonish
-Astor
-Astoria
-astound
-astraddle
-astral
-astray
-astride
-astringent
-astronaut
-astronautic
-astronomer
-astronomic
-astronomy
-astrophysical
-astrophysics
-astute
-Asuncion
-asunder
-asylum
-asymmetry
-asymptote
-asymptotic
-asynchronous
-asynchrony
-at
-AT&T
-Atalanta
-atavism
-atavistic
-Atchison
-ate
-Athabascan
-atheism
-atheist
-Athena
-Athenian
-Athens
-athlete
-athletic
-athwart
-Atkins
-Atkinson
-Atlanta
-atlantes
-atlantic
-Atlantica
-Atlantis
-atlas
-atmosphere
-atmospheric
-atom
-atomic
-atonal
-atone
-atop
-Atreus
-atrocious
-atrocity
-atrophic
-atrophy
-Atropos
-attach
-attache
-attack
-attain
-attainder
-attempt
-attend
-attendant
-attendee
-attention
-attentive
-attenuate
-attest
-attestation
-attic
-Attica
-attire
-attitude
-attorney
-attract
-attribute
-attribution
-attributive
-attrition
-attune
-Atwater
-Atwood
-atypic
-Auberge
-Aubrey
-auburn
-auction
-auctioneer
-audacious
-audacity
-audible
-audience
-audio
-audiotape
-audiovisual
-audit
-audition
-auditor
-auditorium
-auditory
-Audrey
-Audubon
-Auerbach
-Aug
-Augean
-auger
-augment
-augmentation
-augur
-august
-Augusta
-Augustan
-Augustine
-Augustus
-auk
-aunt
-auntie
-aura
-aural
-Aurelius
-aureomycin
-auric
-Auriga
-aurora
-Auschwitz
-auspices
-auspicious
-austere
-Austin
-Australia
-Australis
-australite
-Austria
-authentic
-authenticate
-author
-authoritarian
-authoritative
-autism
-autistic
-auto
-autobiography
-autoclave
-autocollimate
-autocorrelate
-autocracy
-autocrat
-autocratic
-autograph
-automat
-automata
-automate
-automatic
-automaton
-automobile
-automotive
-autonomic
-autonomous
-autonomy
-autopsy
-autosuggestible
-autotransformer
-autumn
-autumnal
-auxiliary
-avail
-avalanche
-avarice
-avaricious
-Ave
-avenge
-Aventine
-avenue
-aver
-average
-averred
-averring
-averse
-aversion
-aversive
-avert
-avertive
-Avery
-Avesta
-aviary
-aviate
-aviatrix
-avid
-avionic
-Avis
-Aviv
-avocado
-avocate
-avocet
-Avogadro
-avoid
-avoidance
-Avon
-avow
-await
-awake
-awaken
-award
-aware
-awash
-away
-awe
-awesome
-awful
-awhile
-awkward
-awl
-awn
-awoke
-awry
-ax
-axe
-axes
-axial
-axiology
-axiom
-axiomatic
-axis
-axle
-axon
-aye
-Ayers
-Aylesbury
-azalea
-Azerbaijan
-azimuth
-azimuthal
-Aztec
-Aztecan
-azure
-b
-b's
-babbitt
-babble
-Babcock
-babe
-Babel
-baboon
-baby
-babyhood
-Babylon
-Babylonian
-babysat
-babysit
-baccarat
-Bacchus
-Bach
-bachelor
-bacilli
-bacillus
-back
-backboard
-backbone
-backdrop
-backfill
-backgammon
-background
-backhand
-backlash
-backlog
-backorder
-backpack
-backplane
-backplate
-backside
-backspace
-backstage
-backstitch
-backstop
-backtrack
-backup
-backward
-backwater
-backwood
-backyard
-bacon
-bacteria
-bacterial
-bacterium
-bad
-bade
-Baden
-badge
-badinage
-badland
-badminton
-Baffin
-baffle
-bag
-bagatelle
-baggage
-bagging
-baggy
-Baghdad
-Bagley
-bagpipe
-bah
-Bahama
-Bahrein
-bail
-Bailey
-bailiff
-Baird
-bait
-bake
-Bakelite
-Bakersfield
-bakery
-Bakhtiari
-baklava
-Baku
-balance
-Balboa
-balcony
-bald
-baldpate
-Baldwin
-baldy
-bale
-baleen
-Balfour
-Bali
-Balinese
-balk
-Balkan
-balky
-ball
-ballad
-Ballard
-ballast
-balled
-ballerina
-ballet
-balletomane
-ballfield
-balloon
-ballot
-ballroom
-ballyhoo
-balm
-balmy
-balsa
-balsam
-Baltic
-Baltimore
-Baltimorean
-balustrade
-Balzac
-bam
-Bamako
-Bamberger
-Bambi
-bamboo
-ban
-banal
-banana
-Banbury
-band
-bandage
-bandgap
-bandit
-bandpass
-bandstand
-bandstop
-bandwagon
-bandwidth
-bandy
-bane
-baneberry
-bang
-bangkok
-Bangladesh
-bangle
-Bangor
-Bangui
-banish
-banister
-banjo
-bank
-bankrupt
-bankruptcy
-Banks
-banquet
-banshee
-bantam
-banter
-Bantu
-Bantus
-baptism
-baptismal
-Baptist
-Baptiste
-baptistery
-bar
-barb
-Barbados
-Barbara
-barbarian
-barbaric
-barbarism
-barbarous
-barbecue
-barbell
-barber
-barberry
-barbital
-barbiturate
-Barbour
-barbudo
-Barcelona
-Barclay
-bard
-bare
-barefaced
-barefoot
-barfly
-bargain
-barge
-baritone
-barium
-bark
-barkeep
-barley
-Barlow
-barn
-Barnabas
-barnacle
-Barnard
-Barnes
-Barnet
-Barnett
-Barney
-Barnhard
-barnstorm
-barnyard
-barometer
-baron
-baroness
-baronet
-baronial
-barony
-baroque
-Barr
-barrack
-barracuda
-barrage
-barre
-barrel
-barren
-Barrett
-barrette
-barricade
-barrier
-Barrington
-barrow
-Barry
-Barrymore
-Barstow
-bartend
-bartender
-barter
-Barth
-Bartholomew
-Bartlett
-Bartok
-Barton
-barycentric
-basal
-base
-baseball
-baseband
-baseboard
-Basel
-baseline
-baseman
-basemen
-baseplate
-bash
-bashaw
-basic
-basidiomycetes
-basil
-basilar
-basilisk
-basin
-basis
-bask
-basket
-basketball
-basophilic
-bass
-Bassett
-bassi
-bassinet
-basso
-basswood
-bastard
-baste
-bastion
-bat
-Batavia
-batch
-Batchelder
-bate
-bateau
-Bateman
-bater
-Bates
-bath
-bathe
-bathos
-bathrobe
-bathroom
-bathtub
-Bathurst
-batik
-baton
-Bator
-batt
-battalion
-Battelle
-batten
-battery
-battle
-battlefield
-battlefront
-battleground
-batwing
-bauble
-baud
-Baudelaire
-Bauer
-Bauhaus
-Bausch
-bauxite
-Bavaria
-bawd
-bawdy
-bawl
-Baxter
-bay
-bayberry
-Bayda
-bayed
-Bayesian
-Baylor
-bayonet
-Bayonne
-bayou
-Bayport
-Bayreuth
-bazaar
-be
-beach
-beachhead
-beacon
-bead
-beadle
-beady
-beak
-beam
-bean
-bear
-bearberry
-beard
-Beardsley
-bearish
-beast
-beat
-beaten
-beater
-beatific
-beatify
-beatitude
-beatnik
-Beatrice
-beau
-Beaujolais
-Beaumont
-Beauregard
-beauteous
-beautify
-beauty
-beaux
-beaver
-bebop
-becalm
-became
-because
-Bechtel
-beck
-Becker
-becket
-Beckman
-beckon
-Becky
-become
-bed
-bedazzle
-bedbug
-bedfast
-Bedford
-bedim
-bedimmed
-bedimming
-bedlam
-bedpost
-bedraggle
-bedridden
-bedrock
-bedroom
-bedside
-bedspread
-bedspring
-bedstraw
-bedtime
-bee
-Beebe
-beebread
-beech
-Beecham
-beechwood
-beef
-beefsteak
-beefy
-beehive
-been
-beep
-beer
-beet
-Beethoven
-beetle
-befall
-befallen
-befell
-befit
-befitting
-befog
-before
-beforehand
-befoul
-befuddle
-beg
-began
-beget
-begetting
-beggar
-beggary
-begging
-begin
-beginner
-beginning
-begonia
-begotten
-begrudge
-beguile
-begun
-behalf
-behave
-behavioral
-behead
-beheld
-behind
-behold
-beige
-being
-Beirut
-bel
-Bela
-belate
-belch
-Belfast
-belfry
-Belgian
-Belgium
-Belgrade
-belie
-belief
-believe
-belittle
-bell
-Bella
-belladonna
-Bellamy
-Bellatrix
-bellboy
-belle
-bellflower
-bellhop
-bellicose
-belligerent
-Bellingham
-Bellini
-bellman
-bellmen
-bellow
-bellum
-bellwether
-belly
-bellyache
-Belmont
-Beloit
-belong
-belove
-below
-Belshazzar
-belt
-Beltsville
-belvedere
-belvidere
-belying
-BEMA
-bemadden
-beman
-bemoan
-bemuse
-Ben
-bench
-benchmark
-bend
-Bender
-Bendix
-beneath
-Benedict
-Benedictine
-benediction
-benefactor
-benefice
-beneficent
-beneficial
-beneficiary
-benefit
-Benelux
-benevolent
-Bengal
-Bengali
-benight
-benign
-Benjamin
-Bennett
-Bennington
-Benny
-Benson
-bent
-Bentham
-benthic
-Bentley
-Benton
-Benz
-Benzedrine
-benzene
-Beowulf
-beplaster
-bequeath
-bequest
-berate
-Berea
-bereave
-bereft
-Berenices
-beret
-berg
-bergamot
-Bergen
-Bergland
-Berglund
-Bergman
-Bergson
-Bergstrom
-beribbon
-beriberi
-Berkeley
-berkelium
-Berkowitz
-Berkshire
-Berlin
-Berlioz
-Berlitz
-Berman
-Bermuda
-Bern
-Bernadine
-Bernard
-Bernardino
-Bernardo
-berne
-Bernet
-Bernhard
-Bernice
-Bernie
-Berniece
-Bernini
-Bernoulli
-Bernstein
-Berra
-berry
-berserk
-Bert
-berth
-Bertha
-Bertie
-Bertram
-Bertrand
-Berwick
-beryl
-beryllium
-beseech
-beset
-beside
-besiege
-besmirch
-besotted
-bespeak
-bespectacled
-bespoke
-Bess
-Bessel
-Bessemer
-Bessie
-best
-bestial
-bestir
-bestow
-bestowal
-bestseller
-bestselling
-bestubble
-bet
-beta
-betatron
-betel
-Betelgeuse
-beth
-bethel
-Bethesda
-Bethlehem
-bethought
-betide
-betoken
-betony
-betray
-betrayal
-betrayer
-betroth
-betrothal
-Betsey
-Betsy
-Bette
-bettor
-Betty
-between
-betwixt
-bevel
-beverage
-Beverly
-bevy
-bewail
-beware
-bewhisker
-bewilder
-bewitch
-bey
-beyond
-bezel
-bhoy
-Bhutan
-bianco
-bias
-biaxial
-bib
-bibb
-Bible
-biblical
-bibliography
-bibliophile
-bicameral
-bicarbonate
-bicep
-biceps
-bichromate
-bicker
-biconcave
-biconnected
-bicycle
-bid
-biddable
-biddy
-bide
-bidiagonal
-bidirectional
-bien
-biennial
-biennium
-bifocal
-bifurcate
-big
-Bigelow
-Biggs
-bigot
-bigotry
-biharmonic
-bijouterie
-bikini
-bilateral
-bilayer
-bile
-bilge
-bilharziasis
-bilinear
-bilingual
-bilk
-bill
-billboard
-billet
-billiard
-Billie
-Billiken
-Billings
-billion
-billionth
-billow
-billy
-Biltmore
-bimetallic
-bimetallism
-Bimini
-bimodal
-bimolecular
-bimonthly
-bin
-binary
-binaural
-bind
-bindery
-bindle
-bing
-binge
-Bingham
-Binghamton
-bingle
-Bini
-binocular
-binomial
-binuclear
-biography
-biology
-Biometrika
-biometry
-biopsy
-biota
-bipartisan
-bipartite
-biplane
-bipolar
-biracial
-birch
-bird
-birdbath
-birdie
-birdlike
-birdseed
-birdwatch
-birefringent
-Birgit
-Birmingham
-birth
-birthday
-birthplace
-birthright
-biscuit
-bisect
-bishop
-bishopric
-Bismarck
-Bismark
-bismuth
-bison
-bisque
-Bissau
-bistable
-bistate
-bit
-bitch
-bite
-bitt
-bitten
-bittern
-bitternut
-bitterroot
-bittersweet
-bitumen
-bituminous
-bitwise
-bivalve
-bivariate
-bivouac
-biz
-bizarre
-Bizet
-blab
-black
-blackball
-blackberry
-blackbird
-blackboard
-blackbody
-Blackburn
-blacken
-Blackfeet
-blackjack
-blackmail
-Blackman
-blackout
-blacksmith
-Blackstone
-Blackwell
-bladder
-bladdernut
-blade
-Blaine
-Blair
-Blake
-blame
-blameworthy
-blanc
-blanch
-Blanchard
-Blanche
-bland
-blandish
-blank
-blanket
-blare
-blaspheme
-blasphemous
-blasphemy
-blast
-blat
-blatant
-blather
-Blatz
-blaze
-blazon
-bleach
-bleak
-bleary
-bleat
-bled
-bleed
-Bleeker
-blemish
-blend
-Blenheim
-bless
-blest
-blew
-blight
-blimp
-blind
-blindfold
-blink
-Blinn
-blip
-bliss
-blister
-blithe
-blitz
-blizzard
-bloat
-blob
-bloc
-Bloch
-block
-blockade
-blockage
-blockhouse
-blocky
-bloke
-Blomberg
-Blomquist
-blond
-blonde
-blood
-bloodbath
-bloodhound
-bloodroot
-bloodshed
-bloodshot
-bloodstain
-bloodstone
-bloodstream
-bloody
-bloom
-Bloomfield
-Bloomington
-bloop
-blossom
-blot
-blotch
-blouse
-blow
-blowback
-blowfish
-blown
-blowup
-blubber
-bludgeon
-blue
-blueback
-blueberry
-bluebill
-bluebird
-bluebonnet
-bluebook
-bluebush
-bluefish
-bluegill
-bluegrass
-bluejacket
-blueprint
-bluestocking
-bluet
-bluff
-bluish
-Blum
-Blumenthal
-blunder
-blunt
-blur
-blurry
-blurt
-blush
-bluster
-blustery
-blutwurst
-Blythe
-BMW
-boa
-boar
-board
-boardinghouse
-boast
-boat
-boathouse
-boatload
-boatman
-boatmen
-boatswain
-boatyard
-bob
-Bobbie
-bobbin
-bobble
-bobby
-bobcat
-bobolink
-Boca
-bock
-bocklogged
-bode
-bodhisattva
-bodice
-bodied
-Bodleian
-body
-bodybuild
-bodyguard
-Boeing
-Boeotian
-bog
-bogey
-bogeymen
-bogging
-boggle
-boggy
-Bogota
-bogus
-bogy
-Bohemia
-Bohr
-boil
-Bois
-Boise
-boisterous
-bold
-boldface
-bole
-boletus
-bolivar
-Bolivia
-bolo
-Bologna
-bolometer
-Bolshevik
-Bolshevism
-Bolshevist
-Bolshoi
-bolster
-bolt
-Bolton
-Boltzmann
-bomb
-bombard
-bombast
-bombastic
-Bombay
-bombproof
-bon
-bona
-bonanza
-Bonaparte
-Bonaventure
-bond
-bondage
-bondsman
-bondsmen
-bone
-bonfire
-bong
-bongo
-Boniface
-bonito
-Bonn
-bonnet
-Bonneville
-Bonnie
-bonus
-bony
-bonze
-boo
-booby
-boogie
-book
-bookbind
-bookcase
-bookend
-bookie
-bookish
-bookkeep
-booklet
-bookplate
-bookseller
-bookshelf
-bookshelves
-bookstore
-booky
-boolean
-boom
-boomerang
-boon
-Boone
-boor
-boorish
-boost
-boot
-Bootes
-booth
-bootleg
-bootlegger
-bootlegging
-bootstrap
-bootstrapped
-bootstrapping
-booty
-booze
-bop
-borate
-borax
-Bordeaux
-bordello
-Borden
-border
-borderland
-borderline
-bore
-Borealis
-Boreas
-boredom
-Borg
-boric
-Boris
-born
-borne
-Borneo
-boron
-borosilicate
-borough
-Borroughs
-borrow
-Bosch
-Bose
-bosom
-boson
-boss
-Boston
-Bostonian
-Boswell
-botanic
-botanist
-botany
-botch
-botfly
-both
-bothersome
-Botswana
-bottle
-bottleneck
-bottom
-bottommost
-botulin
-botulism
-Boucher
-bouffant
-bough
-bought
-boulder
-boule
-boulevard
-bounce
-bouncy
-bound
-boundary
-bounty
-bouquet
-bourbon
-bourgeois
-bourgeoisie
-bourn
-boustrophedon
-bout
-boutique
-bovine
-bow
-Bowditch
-Bowdoin
-bowel
-Bowen
-bowfin
-bowie
-bowl
-bowline
-bowman
-bowmen
-bowstring
-box
-boxcar
-boxwood
-boxy
-boy
-boyar
-Boyce
-boycott
-Boyd
-boyhood
-boyish
-Boyle
-Boylston
-BP
-brace
-bracelet
-bracken
-bracket
-brackish
-bract
-brad
-Bradbury
-Bradford
-Bradley
-Bradshaw
-Brady
-brae
-brag
-Bragg
-bragging
-Brahmaputra
-Brahms
-Brahmsian
-braid
-Braille
-brain
-Brainard
-brainstorm
-brainwash
-brainy
-brake
-brakeman
-bramble
-bran
-branch
-brand
-Brandeis
-Brandenburg
-brandish
-Brandon
-Brandt
-brandy
-brandywine
-Braniff
-brant
-brash
-Brasilia
-brass
-brassiere
-brassy
-bratwurst
-Braun
-bravado
-brave
-bravery
-bravo
-bravura
-brawl
-bray
-brazen
-brazier
-Brazil
-Brazilian
-Brazzaville
-breach
-bread
-breadboard
-breadfruit
-breadroot
-breadth
-break
-breakage
-breakaway
-breakdown
-breakfast
-breakoff
-breakpoint
-breakthrough
-breakup
-breakwater
-bream
-breast
-breastplate
-breastwork
-breath
-breathe
-breathtaking
-breathy
-breccia
-bred
-breech
-breeches
-breed
-breeze
-breezy
-Bremen
-bremsstrahlung
-Brenda
-Brendan
-Brennan
-Brenner
-Brent
-Brest
-brethren
-Breton
-Brett
-breve
-brevet
-brevity
-brew
-brewery
-Brewster
-Brian
-briar
-bribe
-bribery
-Brice
-brick
-brickbat
-bricklayer
-bricklaying
-bridal
-bride
-bridegroom
-bridesmaid
-bridge
-bridgeable
-bridgehead
-Bridgeport
-Bridget
-Bridgetown
-Bridgewater
-bridgework
-bridle
-brief
-briefcase
-brig
-brigade
-brigadier
-brigantine
-Briggs
-Brigham
-bright
-brighten
-Brighton
-brilliant
-Brillouin
-brim
-brimstone
-Brindisi
-brindle
-brine
-bring
-brink
-brinkmanship
-briny
-Brisbane
-brisk
-bristle
-Bristol
-Britain
-Britannic
-Britannica
-britches
-British
-Briton
-Brittany
-Britten
-brittle
-broach
-broad
-broadcast
-broaden
-broadloom
-broadside
-Broadway
-brocade
-broccoli
-brochure
-Brock
-brockle
-Broglie
-broil
-broke
-broken
-brokerage
-Bromfield
-bromide
-bromine
-Bromley
-bronchi
-bronchial
-bronchiolar
-bronchiole
-bronchitis
-bronchus
-bronco
-Bronx
-bronze
-bronzy
-brood
-broody
-brook
-Brooke
-Brookhaven
-Brookline
-Brooklyn
-brookside
-broom
-broomcorn
-broth
-brothel
-brother
-brotherhood
-brought
-brouhaha
-brow
-browbeaten
-brown
-Browne
-Brownell
-Brownian
-brownie
-brownish
-browse
-Bruce
-brucellosis
-Bruckner
-Bruegel
-bruise
-bruit
-Brumidi
-brunch
-brunette
-Brunhilde
-Bruno
-Brunswick
-brunt
-brush
-brushfire
-brushlike
-brushwork
-brushy
-brusque
-Brussels
-brutal
-brute
-Bryan
-Bryant
-Bryce
-Bryn
-bryophyta
-bryophyte
-bryozoa
-BSTJ
-BTL
-bub
-bubble
-Buchanan
-Bucharest
-Buchenwald
-Buchwald
-buck
-buckaroo
-buckboard
-bucket
-buckeye
-buckhorn
-buckle
-Buckley
-Bucknell
-buckshot
-buckskin
-buckthorn
-buckwheat
-bucolic
-bud
-Budapest
-Budd
-Buddha
-Buddhism
-Buddhist
-buddy
-budge
-budget
-budgetary
-Budweiser
-Buena
-Buenos
-buff
-buffalo
-buffet
-bufflehead
-buffoon
-bug
-bugaboo
-bugeyed
-bugging
-buggy
-bugle
-Buick
-build
-buildup
-built
-builtin
-Bujumbura
-bulb
-bulblet
-Bulgaria
-bulge
-bulk
-bulkhead
-bulky
-bull
-bulldog
-bulldoze
-bullet
-bulletin
-bullfinch
-bullfrog
-bullhead
-bullhide
-bullish
-bullock
-bullseye
-bullwhack
-bully
-bullyboy
-bulrush
-bulwark
-bum
-bumble
-bumblebee
-bump
-bumptious
-bun
-bunch
-Bundestag
-bundle
-bundy
-bungalow
-bungle
-bunk
-bunkmate
-bunny
-Bunsen
-bunt
-Bunyan
-buoy
-buoyant
-burbank
-Burch
-burden
-burdensome
-burdock
-bureau
-bureaucracy
-bureaucrat
-bureaucratic
-buret
-burette
-burg
-burgeon
-burgess
-burgher
-burglar
-burglarproof
-burglary
-Burgundian
-Burgundy
-burial
-buried
-Burke
-burl
-burlap
-burlesque
-burley
-Burlington
-burly
-Burma
-Burmese
-burn
-Burnett
-Burnham
-burnish
-burnout
-Burnside
-burnt
-burp
-Burr
-burro
-Burroughs
-burrow
-bursitis
-burst
-bursty
-Burt
-Burton
-Burtt
-Burundi
-bury
-bus
-busboy
-Busch
-bush
-bushel
-bushmaster
-Bushnell
-bushwhack
-bushy
-business
-businessman
-businessmen
-buss
-bust
-bustard
-bustle
-busy
-but
-butadiene
-butane
-butch
-butchery
-butene
-buteo
-butler
-butt
-butte
-butterball
-buttercup
-butterfat
-Butterfield
-butterfly
-buttermilk
-butternut
-buttery
-buttock
-button
-buttonhole
-buttress
-Buttrick
-butyl
-butyrate
-buxom
-Buxtehude
-Buxton
-buy
-buyer
-buzz
-Buzzard
-buzzer
-buzzing
-buzzword
-buzzy
-by
-bye
-Byers
-bygone
-bylaw
-byline
-bypass
-bypath
-byproduct
-Byrd
-Byrne
-byroad
-Byron
-Byronic
-bystander
-byte
-byway
-byword
-Byzantine
-Byzantium
-c
-c's
-cab
-cabal
-cabana
-cabaret
-cabbage
-cabdriver
-cabin
-cabinet
-cabinetmake
-cabinetry
-cable
-Cabot
-cacao
-cachalot
-cache
-cackle
-CACM
-cacophonist
-cacophony
-cacti
-cactus
-cadaver
-cadaverous
-caddis
-caddy
-cadent
-cadenza
-cadet
-Cadillac
-cadmium
-cadre
-Cady
-Caesar
-cafe
-cafeteria
-cage
-cagey
-Cahill
-cahoot
-caiman
-Cain
-Caine
-cairn
-Cairo
-cajole
-cake
-Cal
-Calais
-calamitous
-calamity
-calamus
-calcareous
-calcify
-calcine
-calcite
-calcium
-calculable
-calculate
-calculi
-calculus
-Calcutta
-Calder
-caldera
-Caldwell
-Caleb
-calendar
-calendrical
-calf
-calfskin
-Calgary
-Calhoun
-caliber
-calibrate
-calibre
-calico
-California
-californium
-caliper
-caliph
-caliphate
-calisthenic
-Calkins
-call
-calla
-Callaghan
-Callahan
-caller
-calligraph
-calligraphy
-calliope
-Callisto
-callous
-callus
-calm
-caloric
-calorie
-calorimeter
-Calumet
-calumniate
-calumny
-Calvary
-calve
-Calvert
-Calvin
-Calvinist
-calypso
-cam
-camaraderie
-camber
-Cambodia
-cambric
-Cambridge
-Camden
-came
-camel
-camelback
-camellia
-camelopard
-Camelot
-cameo
-camera
-cameraman
-cameramen
-Cameron
-Cameroun
-camilla
-Camille
-Camino
-camouflage
-camp
-campaign
-campanile
-Campbell
-campfire
-campground
-campion
-campsite
-campus
-can
-can't
-Canaan
-Canada
-Canadian
-canal
-canary
-Canaveral
-Canberra
-cancel
-cancellate
-cancer
-cancerous
-candela
-candelabra
-candid
-candidacy
-candidate
-Candide
-candle
-candlelight
-candlestick
-candlewick
-candy
-cane
-Canfield
-canine
-Canis
-canister
-canker
-cankerworm
-canna
-cannabis
-cannel
-cannery
-cannibal
-cannister
-cannon
-cannonball
-cannot
-canny
-canoe
-Canoga
-canon
-canonic
-canopy
-canst
-cant
-cantaloupe
-canteen
-Canterbury
-canterelle
-canticle
-cantilever
-cantle
-canto
-canton
-Cantonese
-cantor
-canvas
-canvasback
-canvass
-canyon
-cap
-capacious
-capacitance
-capacitate
-capacitive
-capacitor
-capacity
-cape
-capella
-caper
-Capetown
-capillary
-Capistrano
-capita
-capital
-capitol
-Capitoline
-capitulate
-capo
-caprice
-capricious
-Capricorn
-capstan
-capstone
-capsule
-captain
-captaincy
-caption
-captious
-captivate
-captive
-captor
-capture
-Caputo
-capybara
-car
-carabao
-Caracas
-caramel
-caravan
-caraway
-carbide
-carbine
-carbohydrate
-Carboloy
-carbon
-carbonaceous
-carbonate
-Carbondale
-Carbone
-carbonic
-carbonyl
-carborundum
-carboxy
-carboy
-carbuncle
-carcass
-carcinogen
-carcinogenic
-carcinoma
-card
-cardamom
-cardboard
-cardiac
-cardinal
-cardioid
-cardiology
-cardiovascular
-care
-careen
-career
-carefree
-caress
-caret
-caretaker
-careworn
-Carey
-Cargill
-cargo
-cargoes
-Carib
-Caribbean
-caribou
-caricature
-Carl
-Carla
-Carleton
-Carlin
-Carlisle
-Carlo
-carload
-Carlson
-Carlton
-Carlyle
-Carmela
-Carmen
-Carmichael
-carmine
-carnage
-carnal
-carnation
-carne
-Carnegie
-carney
-carnival
-carob
-carol
-Carolina
-Caroline
-Carolingian
-Carolinian
-Carolyn
-carouse
-carp
-Carpathia
-carpenter
-carpentry
-carpet
-carport
-Carr
-carrageen
-Carrara
-carrel
-carriage
-Carrie
-carrion
-Carroll
-carrot
-Carruthers
-carry
-carryover
-Carson
-cart
-carte
-cartel
-Cartesian
-Carthage
-cartilage
-cartographer
-cartographic
-cartography
-carton
-cartoon
-cartridge
-cartwheel
-Caruso
-carve
-carven
-Casanova
-casbah
-cascade
-cascara
-case
-casebook
-casein
-casework
-Casey
-cash
-cashew
-cashier
-cashmere
-casino
-cask
-casket
-Cassandra
-casserole
-cassette
-Cassiopeia
-Cassius
-cassock
-cast
-castanet
-caste
-casteth
-castigate
-Castillo
-castle
-castor
-Castro
-casual
-casualty
-cat
-cataclysmic
-Catalina
-catalogue
-catalpa
-catalysis
-catalyst
-catalytic
-catapult
-cataract
-catastrophe
-catastrophic
-catatonia
-catatonic
-catawba
-catbird
-catch
-catchup
-catchword
-catchy
-catechism
-categoric
-category
-catenate
-cater
-caterpillar
-catfish
-catharsis
-cathedra
-cathedral
-Catherine
-Catherwood
-catheter
-cathode
-cathodic
-catholic
-Catholicism
-Cathy
-cation
-cationic
-catkin
-catlike
-catnip
-Catskill
-catsup
-cattail
-cattle
-cattleman
-cattlemen
-Caucasian
-Caucasus
-Cauchy
-caucus
-caught
-cauliflower
-caulk
-causal
-causate
-cause
-caustic
-caution
-cautionary
-cautious
-cavalcade
-cavalier
-cavalry
-cave
-caveat
-caveman
-cavemen
-Cavendish
-cavern
-cavernous
-caviar
-cavil
-cavilling
-Caviness
-cavitate
-cavort
-caw
-cayenne
-Cayley
-Cayuga
-CBS
-CDC
-cease
-Cecil
-Cecilia
-Cecropia
-cedar
-cede
-cedilla
-Cedric
-ceil
-celandine
-Celanese
-Celebes
-celebrant
-celebrate
-celebrity
-celerity
-celery
-celesta
-celestial
-Celia
-cell
-cellar
-cellophane
-cellular
-cellulose
-Celsius
-Celtic
-cement
-cemetery
-Cenozoic
-censor
-censorial
-censure
-census
-cent
-centaur
-centenary
-centennial
-centerline
-centerpiece
-centigrade
-centipede
-central
-centrex
-centric
-centrifugal
-centrifugate
-centrifuge
-centrist
-centroid
-centum
-century
-Cepheus
-ceramic
-ceramium
-Cerberus
-cereal
-cerebellum
-cerebral
-cerebrate
-ceremonial
-ceremonious
-ceremony
-Ceres
-cereus
-cerise
-cerium
-CERN
-certain
-certainty
-certificate
-certified
-certify
-certiorari
-certitude
-cerulean
-Cervantes
-Cesare
-cesium
-cessation
-cession
-Cessna
-cetera
-Cetus
-Ceylon
-Cezanne
-Chablis
-Chad
-Chadwick
-chafe
-chaff
-chagrin
-chain
-chair
-chairlady
-chairman
-chairmen
-chairperson
-chairwoman
-chairwomen
-chaise
-chalcedony
-chalice
-chalk
-chalkline
-chalky
-challenge
-Chalmers
-chamber
-chamberlain
-chambermaid
-Chambers
-chameleon
-chamfer
-chamois
-chamomile
-champ
-champagne
-Champaign
-champion
-Champlain
-chance
-chancel
-chancellor
-chancery
-chancy
-chandelier
-chandler
-Chang
-change
-changeable
-changeover
-channel
-chanson
-chant
-chantey
-Chantilly
-chantry
-Chao
-chaos
-chaotic
-chap
-chaparral
-chapel
-chaperon
-chaperone
-chaplain
-chaplaincy
-Chaplin
-Chapman
-chapter
-char
-character
-characteristic
-charcoal
-chard
-charge
-chargeable
-chariot
-charisma
-charismatic
-charitable
-charity
-Charles
-Charleston
-Charley
-Charlie
-Charlotte
-Charlottesville
-charm
-Charon
-chart
-Charta
-Chartres
-chartreuse
-chartroom
-Charybdis
-chase
-chasm
-chassis
-chaste
-chastise
-chastity
-chat
-chateau
-chateaux
-Chatham
-Chattanooga
-chattel
-chatty
-Chaucer
-chauffeur
-Chauncey
-Chautauqua
-chaw
-cheap
-cheat
-cheater
-check
-checkbook
-checkerberry
-checkerboard
-checklist
-checkout
-checkpoint
-checksum
-checksummed
-checkup
-cheek
-cheekbone
-cheeky
-cheer
-cheerleader
-cheery
-cheese
-cheesecake
-cheesecloth
-cheesy
-cheetah
-chef
-chelate
-chemic
-chemise
-chemisorb
-chemisorption
-chemist
-chemistry
-chemotherapy
-Chen
-Cheney
-chenille
-cherish
-Cherokee
-cherry
-chert
-cherub
-cherubim
-Chesapeake
-Cheshire
-chess
-chest
-Chester
-Chesterton
-chestnut
-chevalier
-Chevrolet
-chevron
-chevy
-chew
-Cheyenne
-chi
-Chiang
-chianti
-chic
-Chicago
-Chicagoan
-chicanery
-Chicano
-chick
-chickadee
-chicken
-chicory
-chide
-chief
-chiefdom
-chieftain
-chiffon
-chigger
-chignon
-chilblain
-child
-childbirth
-childhood
-childish
-childlike
-children
-Chile
-chili
-chill
-chilly
-chime
-chimera
-chimeric
-Chimique
-chimney
-chimpanzee
-chin
-china
-Chinaman
-Chinamen
-Chinatown
-chinch
-chinchilla
-chine
-Chinese
-chink
-Chinook
-chinquapin
-chip
-chipboard
-chipmunk
-Chippendale
-chiropractor
-chirp
-chisel
-Chisholm
-chit
-chiton
-chivalrous
-chivalry
-chive
-chlorate
-chlordane
-chloride
-chlorine
-chloroform
-chlorophyll
-chloroplatinate
-chock
-chocolate
-Choctaw
-choice
-choir
-choirmaster
-choke
-chokeberry
-cholera
-cholesterol
-cholinesterase
-chomp
-choose
-choosy
-chop
-Chopin
-choppy
-choral
-chorale
-chord
-chordal
-chordata
-chordate
-chore
-choreograph
-choreography
-chorine
-chortle
-chorus
-chose
-chosen
-Chou
-chow
-chowder
-Chris
-Christ
-christen
-Christendom
-Christensen
-Christenson
-Christian
-Christiana
-Christianson
-Christie
-Christina
-Christine
-Christlike
-Christmas
-Christoffel
-Christopher
-Christy
-chromate
-chromatic
-chromatogram
-chromatograph
-chromatography
-chrome
-chromic
-chromium
-chromosphere
-chronic
-chronicle
-chronograph
-chronography
-chronology
-chrysanthemum
-Chrysler
-chub
-chubby
-chuck
-chuckle
-chuckwalla
-chuff
-chug
-chugging
-chum
-chummy
-chump
-Chungking
-chunk
-chunky
-church
-churchgo
-Churchill
-Churchillian
-churchman
-churchmen
-churchwoman
-churchwomen
-churchyard
-churn
-chute
-chutney
-CIA
-cicada
-Cicero
-Ciceronian
-cider
-cigar
-cigarette
-cilia
-ciliate
-cimcumvention
-cinch
-Cincinnati
-cinder
-Cinderella
-cinema
-cinematic
-Cinerama
-cinnabar
-cinnamon
-cinquefoil
-cipher
-circa
-Circe
-circle
-circlet
-circuit
-circuitous
-circuitry
-circulant
-circular
-circulate
-circulatory
-circumcircle
-circumcise
-circumcision
-circumference
-circumferential
-circumflex
-circumlocution
-circumpolar
-circumscribe
-circumscription
-circumspect
-circumsphere
-circumstance
-circumstantial
-circumvent
-circumvention
-circus
-cirmcumferential
-cistern
-citadel
-citation
-cite
-citizen
-citizenry
-citrate
-citric
-Citroen
-citron
-citrus
-city
-cityscape
-citywide
-civet
-civic
-civil
-civilian
-clad
-cladophora
-claim
-claimant
-Claire
-clairvoyant
-clam
-clamber
-clammy
-clamp
-clamshell
-clan
-clandestine
-clang
-clank
-clannish
-clap
-clapboard
-Clapeyron
-Clara
-Clare
-Claremont
-Clarence
-Clarendon
-claret
-clarify
-clarinet
-clarity
-Clark
-Clarke
-clash
-clasp
-class
-classic
-classification
-classificatory
-classify
-classmate
-classroom
-classy
-clatter
-clattery
-Claude
-Claudia
-Claudio
-Claus
-clause
-Clausen
-Clausius
-claustrophobia
-claustrophobic
-claw
-clay
-Clayton
-clean
-cleanse
-cleanup
-clear
-clearance
-clearheaded
-Clearwater
-cleat
-cleavage
-cleave
-cleft
-clement
-Clemson
-clench
-clergy
-clergyman
-clergymen
-cleric
-clerk
-Cleveland
-clever
-cliche
-click
-client
-clientele
-cliff
-cliffhang
-Clifford
-Clifton
-climactic
-climate
-climatic
-climatology
-climax
-climb
-clime
-clinch
-cling
-clinging
-clinic
-clinician
-clink
-Clint
-Clinton
-Clio
-clip
-clipboard
-clique
-Clive
-cloak
-cloakroom
-clobber
-clock
-clockwatcher
-clockwise
-clockwork
-clod
-cloddish
-clog
-clogging
-cloister
-clomp
-clone
-clonic
-close
-closet
-closeup
-closure
-clot
-cloth
-clothbound
-clothe
-clothesbrush
-clotheshorse
-clothesline
-clothesman
-clothesmen
-clothier
-Clotho
-cloture
-cloud
-cloudburst
-cloudy
-clout
-clove
-clown
-cloy
-club
-clubhouse
-clubroom
-cluck
-clue
-clump
-clumsy
-clung
-cluster
-clutch
-clutter
-Clyde
-Clytemnestra
-coach
-coachman
-coachmen
-coachwork
-coadjutor
-coagulable
-coagulate
-coal
-coalesce
-coalescent
-coalition
-coarse
-coarsen
-coast
-coastal
-coastline
-coat
-Coates
-coattail
-coauthor
-coax
-coaxial
-cobalt
-Cobb
-cobble
-cobblestone
-Cobol
-cobra
-cobweb
-coca
-cocaine
-coccidiosis
-cochineal
-cochlea
-Cochran
-Cochrane
-cock
-cockatoo
-cockcrow
-cockeye
-cockle
-cocklebur
-cockleshell
-cockpit
-cockroach
-cocksure
-cocktail
-cocky
-coco
-cocoa
-coconut
-cocoon
-cod
-coda
-Coddington
-coddle
-code
-codebreak
-codeposit
-codetermine
-codeword
-codfish
-codicil
-codify
-codpiece
-Cody
-coed
-coeditor
-coeducation
-coefficient
-coequal
-coerce
-coercible
-coercion
-coercive
-coexist
-coexistent
-coextensive
-cofactor
-coffee
-coffeecup
-coffeepot
-coffer
-Coffey
-coffin
-Coffman
-cog
-cogent
-cogitate
-cognac
-cognate
-cognition
-cognitive
-cognizable
-cognizant
-Cohen
-cohere
-coherent
-cohesion
-cohesive
-Cohn
-cohort
-cohosh
-coiffure
-coil
-coin
-coinage
-coincide
-coincident
-coincidental
-coke
-col
-cola
-colander
-colatitude
-Colby
-cold
-Cole
-Coleman
-Coleridge
-Colette
-coleus
-Colgate
-colicky
-coliform
-coliseum
-collaborate
-collage
-collagen
-collapse
-collapsible
-collar
-collarbone
-collard
-collate
-collateral
-colleague
-collect
-collectible
-collector
-college
-collegian
-collegiate
-collet
-collide
-collie
-Collier
-collimate
-collinear
-Collins
-collision
-collocation
-colloidal
-colloquia
-colloquial
-colloquium
-colloquy
-collude
-collusion
-Cologne
-Colombia
-Colombo
-colon
-colonel
-colonial
-colonist
-colonnade
-colony
-Colorado
-colorate
-coloratura
-colorimeter
-colossal
-Colosseum
-colossi
-colossus
-colt
-coltish
-coltsfoot
-Columbia
-columbine
-Columbus
-column
-columnar
-colza
-coma
-Comanche
-comatose
-comb
-combat
-combatant
-combatted
-combinate
-combinator
-combinatorial
-combinatoric
-combine
-combustible
-combustion
-come
-comeback
-comedian
-comedy
-comet
-cometary
-cometh
-comfort
-comic
-Cominform
-comma
-command
-commandant
-commandeer
-commando
-commemorate
-commend
-commendation
-commendatory
-commensurable
-commensurate
-comment
-commentary
-commentator
-commerce
-commercial
-commingle
-commiserate
-commissariat
-commissary
-commission
-commit
-committable
-committal
-committed
-committee
-committeeman
-committeemen
-committeewoman
-committeewomen
-committing
-commodious
-commodity
-commodore
-common
-commonality
-commonplace
-commonweal
-commonwealth
-commotion
-communal
-commune
-communicable
-communicant
-communicate
-communion
-communique
-commutate
-commute
-compact
-Compagnie
-companion
-companionway
-company
-comparative
-comparator
-compare
-comparison
-compartment
-compass
-compassion
-compassionate
-compatible
-compatriot
-compel
-compellable
-compelled
-compelling
-compendia
-compendium
-compensable
-compensate
-compensatory
-compete
-competent
-competition
-competitive
-competitor
-compilation
-compile
-complacent
-complain
-complainant
-complaint
-complaisant
-compleat
-complement
-complementarity
-complementary
-complementation
-complete
-completion
-complex
-complexion
-compliant
-complicate
-complicity
-compliment
-complimentary
-compline
-comply
-component
-comport
-compose
-composite
-composition
-compositor
-compost
-composure
-compote
-compound
-comprehend
-comprehensible
-comprehension
-comprehensive
-compress
-compressible
-compression
-compressive
-compressor
-comprise
-compromise
-Compton
-comptroller
-compulsion
-compulsive
-compulsory
-computation
-compute
-comrade
-con
-Conakry
-Conant
-concatenate
-concave
-conceal
-concede
-conceit
-conceive
-concentrate
-concentric
-concept
-conception
-conceptual
-concern
-concert
-concerti
-concertina
-concertmaster
-concerto
-concession
-concessionaire
-conch
-concierge
-conciliate
-conciliatory
-concise
-concision
-conclave
-conclude
-conclusion
-conclusive
-concoct
-concomitant
-concord
-concordant
-concourse
-concrete
-concretion
-concubine
-concur
-concurred
-concurrent
-concurring
-concussion
-condemn
-condemnate
-condemnatory
-condensate
-condense
-condensible
-condescend
-condescension
-condiment
-condition
-condolence
-condone
-conduce
-conducive
-conduct
-conductance
-conductor
-conduit
-cone
-coneflower
-Conestoga
-coney
-confabulate
-confect
-confectionery
-confederacy
-confederate
-confer
-conferee
-conference
-conferred
-conferring
-confess
-confession
-confessor
-confidant
-confidante
-confide
-confident
-confidential
-configuration
-configure
-confine
-confirm
-confirmation
-confirmatory
-confiscable
-confiscate
-confiscatory
-conflagrate
-conflict
-confluent
-confocal
-conform
-conformal
-conformance
-conformation
-confound
-confrere
-confront
-confrontation
-Confucian
-Confucianism
-Confucius
-confuse
-confusion
-confute
-congeal
-congener
-congenial
-congenital
-congest
-congestion
-congestive
-conglomerate
-Congo
-Congolese
-congratulate
-congratulatory
-congregate
-congress
-congressional
-congressman
-congressmen
-congresswoman
-congresswomen
-congruent
-conic
-conifer
-coniferous
-conjectural
-conjecture
-conjoin
-conjoint
-conjugal
-conjugate
-conjunct
-conjuncture
-conjure
-Conklin
-Conley
-conn
-Connally
-connect
-Connecticut
-connector
-Conner
-Connie
-connivance
-connive
-connoisseur
-Connors
-connotation
-connotative
-connote
-connubial
-conquer
-conqueror
-conquest
-conquistador
-Conrad
-Conrail
-consanguine
-consanguineous
-conscience
-conscientious
-conscionable
-conscious
-conscript
-conscription
-consecrate
-consecutive
-consensus
-consent
-consequent
-consequential
-conservation
-conservatism
-conservative
-conservator
-conservatory
-conserve
-consider
-considerate
-consign
-consignee
-consignor
-consist
-consistent
-consolation
-console
-consolidate
-consonant
-consonantal
-consort
-consortium
-conspicuous
-conspiracy
-conspirator
-conspiratorial
-conspire
-Constance
-constant
-Constantine
-Constantinople
-constellate
-consternate
-constipate
-constituent
-constitute
-constitution
-constrain
-constraint
-constrict
-constrictor
-construct
-constructible
-constructor
-construe
-consul
-consular
-consulate
-consult
-consultant
-consultation
-consultative
-consume
-consummate
-consumption
-consumptive
-contact
-contagion
-contagious
-contain
-contaminant
-contaminate
-contemplate
-contemporaneous
-contemporary
-contempt
-contemptible
-contemptuous
-contend
-content
-contention
-contentious
-contest
-contestant
-context
-contextual
-contiguity
-contiguous
-continent
-continental
-contingent
-continua
-continual
-continuant
-continuation
-continue
-continued
-continuity
-continuo
-continuous
-continuum
-contort
-contour
-contraband
-contrabass
-contraception
-contraceptive
-contract
-contractor
-contractual
-contradict
-contradictory
-contradistinct
-contradistinguish
-contralateral
-contralto
-contraption
-contrariety
-contrary
-contrast
-contravariant
-contravene
-contravention
-contretemps
-contribute
-contribution
-contributor
-contributory
-contrite
-contrition
-contrivance
-contrive
-control
-controllable
-controlled
-controller
-controlling
-controversial
-controversy
-controvertible
-contumacy
-contusion
-conundrum
-Convair
-convalesce
-convalescent
-convect
-convene
-convenient
-convent
-convention
-converge
-convergent
-conversant
-conversation
-converse
-conversion
-convert
-convertible
-convex
-convey
-conveyance
-conveyor
-convict
-convince
-convivial
-convocate
-convoke
-convolute
-convolution
-convolve
-convoy
-convulse
-convulsion
-convulsive
-Conway
-cony
-coo
-cook
-cookbook
-Cooke
-cookery
-cookie
-cooky
-cool
-coolant
-Cooley
-coolheaded
-Coolidge
-coon
-coop
-cooperate
-coordinate
-Coors
-coot
-cop
-cope
-Copeland
-Copenhagen
-Copernican
-Copernicus
-copious
-coplanar
-copolymer
-copperas
-Copperfield
-copperhead
-coppery
-copra
-coprinus
-copter
-copy
-copybook
-copyright
-copywriter
-coquette
-coquina
-coral
-coralberry
-coralline
-corbel
-Corbett
-Corcoran
-cord
-cordage
-cordial
-cordite
-cordon
-corduroy
-core
-Corey
-coriander
-Corinth
-Corinthian
-Coriolanus
-cork
-corkscrew
-cormorant
-corn
-cornbread
-cornea
-Cornelia
-Cornelius
-Cornell
-cornerstone
-cornet
-cornfield
-cornflower
-cornish
-cornmeal
-cornstarch
-cornucopia
-Cornwall
-corny
-corollary
-corona
-Coronado
-coronary
-coronate
-coroner
-coronet
-coroutine
-Corp
-corpora
-corporal
-corporate
-corporeal
-corps
-corpse
-corpsman
-corpsmen
-corpulent
-corpus
-corpuscular
-corral
-corralled
-correct
-corrector
-correlate
-correspond
-correspondent
-corridor
-corrigenda
-corrigendum
-corrigible
-corroborate
-corroboree
-corrode
-corrodible
-corrosion
-corrosive
-corrugate
-corrupt
-corruptible
-corruption
-corsage
-cortege
-cortex
-cortical
-Cortland
-corundum
-coruscate
-corvette
-Corvus
-cos
-cosec
-coset
-Cosgrove
-cosh
-cosine
-cosmetic
-cosmic
-cosmology
-cosmopolitan
-cosmos
-cosponsor
-Cossack
-cost
-Costello
-costume
-cosy
-cot
-cotangent
-cotillion
-cotman
-cotoneaster
-cotta
-cottage
-cotton
-cottonmouth
-cottonseed
-cottonwood
-cottony
-Cottrell
-cotty
-couch
-cougar
-cough
-could
-couldn't
-coulomb
-Coulter
-council
-councilman
-councilmen
-councilwoman
-councilwomen
-counsel
-counselor
-count
-countenance
-counteract
-counterargument
-counterattack
-counterbalance
-counterclockwise
-counterexample
-counterfeit
-counterflow
-counterintuitive
-counterman
-countermen
-counterpart
-counterpoint
-counterpoise
-counterproductive
-counterproposal
-countersink
-countersunk
-countervail
-countrify
-country
-countryman
-countrymen
-countryside
-countrywide
-county
-countywide
-coup
-coupe
-couple
-coupon
-courage
-courageous
-courier
-course
-court
-courteous
-courtesan
-courtesy
-courthouse
-courtier
-Courtney
-courtroom
-courtyard
-couscous
-cousin
-couturier
-covalent
-covariant
-covariate
-covary
-cove
-coven
-covenant
-cover
-coverage
-coverall
-coverlet
-covert
-covet
-covetous
-cow
-Cowan
-coward
-cowardice
-cowbell
-cowbird
-cowboy
-cowhand
-cowherd
-cowhide
-cowl
-cowlick
-cowman
-cowmen
-coworker
-cowpea
-cowpoke
-cowpony
-cowpox
-cowpunch
-cowry
-cowslip
-cox
-coxcomb
-coy
-coyote
-coypu
-cozen
-cozier
-cozy
-CPA
-crab
-crabapple
-crack
-crackle
-crackpot
-cradle
-craft
-craftsman
-craftsmen
-craftspeople
-craftsperson
-crafty
-crag
-craggy
-Craig
-cram
-Cramer
-cramp
-cranberry
-Crandall
-crane
-cranelike
-Cranford
-crania
-cranium
-crank
-crankcase
-crankshaft
-cranky
-cranny
-Cranston
-crap
-crappie
-crash
-crass
-crate
-crater
-cravat
-crave
-craven
-craw
-Crawford
-crawl
-crawlspace
-crayfish
-crayon
-craze
-crazy
-creak
-creaky
-cream
-creamery
-creamy
-crease
-create
-creating
-creature
-creche
-credent
-credential
-credenza
-credible
-credit
-creditor
-credo
-credulity
-credulous
-creed
-creedal
-creek
-creekside
-creep
-creepy
-cremate
-crematory
-Creole
-Creon
-creosote
-crepe
-crept
-crescendo
-crescent
-cress
-crest
-crestfallen
-Crestview
-Cretaceous
-Cretan
-Crete
-cretin
-cretinous
-crevice
-crew
-crewcut
-crewel
-crewman
-crewmen
-crib
-cricket
-cried
-crime
-Crimea
-criminal
-crimp
-crimson
-cringe
-crinkle
-cripple
-crises
-crisis
-crisp
-Crispin
-criss
-crisscross
-criteria
-criterion
-critic
-critique
-critter
-croak
-crochet
-crock
-crockery
-Crockett
-crocodile
-crocodilian
-crocus
-croft
-Croix
-Cromwell
-Cromwellian
-crone
-crony
-crook
-croon
-crop
-Crosby
-cross
-crossarm
-crossbar
-crossbill
-crosscut
-crosshatch
-crosslink
-crossover
-crosspoint
-crossroad
-crosstalk
-crosswalk
-crossway
-crosswise
-crotch
-crotchety
-crouch
-croupier
-crow
-crowbait
-crowberry
-crowd
-crowfoot
-Crowley
-crown
-croydon
-CRT
-crucial
-crucible
-crucifix
-crucifixion
-crucify
-crud
-cruddy
-crude
-cruel
-cruelty
-Cruickshank
-cruise
-crumb
-crumble
-crummy
-crump
-crumple
-crunch
-crupper
-crusade
-crush
-Crusoe
-crust
-crutch
-crux
-cry
-cryogenic
-cryostat
-crypt
-cryptanalysis
-cryptanalyst
-cryptanalytic
-cryptic
-cryptogram
-cryptographer
-cryptography
-crystal
-crystalline
-crystallite
-crystallographer
-crystallography
-cub
-Cuba
-cubbyhole
-cube
-cubic
-cuckoo
-cucumber
-cud
-cuddle
-cuddly
-cudgel
-cue
-cuff
-cufflink
-cuisine
-Culbertson
-culinary
-cull
-culminate
-culpa
-culpable
-culprit
-cult
-cultivable
-cultivate
-cultural
-culture
-Culver
-culvert
-Cumberland
-cumbersome
-cumin
-Cummings
-Cummins
-cumulate
-cumulus
-Cunard
-cunning
-Cunningham
-CUNY
-cup
-cupboard
-Cupid
-cupidity
-cupric
-cuprous
-cur
-curate
-curb
-curbside
-curd
-curdle
-cure
-curfew
-curia
-curie
-curio
-curiosity
-curious
-curium
-curl
-curlew
-curlicue
-Curran
-currant
-current
-curricula
-curricular
-curriculum
-curry
-curse
-cursive
-cursor
-cursory
-curt
-curtail
-curtain
-Curtis
-curtsey
-curvaceous
-curvature
-curve
-curvilinear
-Cushing
-cushion
-Cushman
-cusp
-Custer
-custodial
-custodian
-custody
-custom
-customary
-customhouse
-cut
-cutaneous
-cutback
-cute
-cutlass
-cutler
-cutlet
-cutoff
-cutout
-cutover
-cutthroat
-cuttlebone
-cuttlefish
-cutworm
-Cyanamid
-cyanate
-cyanic
-cyanide
-cybernetics
-cycad
-Cyclades
-cycle
-cyclic
-cyclist
-cyclone
-cyclopean
-Cyclops
-cyclorama
-cyclotron
-Cygnus
-cylinder
-cylindric
-cynic
-Cynthia
-cypress
-Cyprian
-Cypriot
-Cyprus
-Cyril
-Cyrus
-cyst
-cytochemistry
-cytolysis
-cytoplasm
-czar
-czarina
-Czechoslovakia
-Czerniak
-d
-d'art
-d'etat
-d'oeuvre
-d's
-dab
-dabble
-Dacca
-dachshund
-dactyl
-dactylic
-dad
-Dadaism
-Dadaist
-daddy
-Dade
-Daedalus
-daffodil
-daffy
-dagger
-Dahl
-dahlia
-Dahomey
-Dailey
-Daimler
-dainty
-dairy
-Dairylea
-dairyman
-dairymen
-dais
-daisy
-Dakar
-Dakota
-dale
-Daley
-Dallas
-dally
-Dalton
-Daly
-Dalzell
-dam
-damage
-Damascus
-damask
-dame
-damn
-damnation
-Damon
-damp
-dampen
-damsel
-Dan
-Dana
-Danbury
-dance
-dandelion
-dandy
-Dane
-dang
-danger
-dangerous
-dangle
-Daniel
-Danielson
-Danish
-dank
-Danny
-Dante
-Danube
-Danubian
-Danzig
-Daphne
-dapper
-dapple
-Dar
-dare
-Darius
-dark
-darken
-darkle
-Darlene
-darling
-darn
-Darrell
-dart
-Dartmouth
-Darwin
-Darwinian
-dash
-dashboard
-dastard
-data
-database
-date
-dateline
-dater
-Datsun
-datum
-daub
-Daugherty
-daughter
-daunt
-dauphin
-dauphine
-Dave
-davenport
-David
-Davidson
-Davies
-Davis
-Davison
-davit
-Davy
-dawn
-Dawson
-day
-daybed
-daybreak
-daydream
-daylight
-daytime
-Dayton
-Daytona
-daze
-dazzle
-DC
-De
-deacon
-deaconess
-deactivate
-dead
-deaden
-deadhead
-deadline
-deadlock
-deadwood
-deaf
-deafen
-deal
-deallocate
-dealt
-dean
-Deane
-Deanna
-dear
-Dearborn
-dearie
-dearth
-death
-deathbed
-deathward
-debacle
-debar
-debase
-debate
-debater
-debauch
-debauchery
-Debbie
-Debby
-debenture
-debilitate
-debility
-debit
-debonair
-Deborah
-Debra
-debrief
-debris
-debt
-debtor
-debug
-debugged
-debugger
-debugging
-debunk
-Debussy
-debut
-debutante
-Dec
-decade
-decadent
-decal
-decant
-decathlon
-Decatur
-decay
-Decca
-decease
-decedent
-deceit
-deceive
-decelerate
-December
-decennial
-decent
-deception
-deceptive
-decertify
-decibel
-decide
-deciduous
-decile
-decimal
-decipher
-decision
-decisional
-decisive
-deck
-Decker
-declaim
-declamation
-declamatory
-declaration
-declarative
-declarator
-declaratory
-declare
-declassify
-declination
-decline
-declivity
-decode
-decolletage
-decollimate
-decompile
-decomposable
-decompose
-decomposition
-decompress
-decompression
-decontrol
-decontrolled
-decontrolling
-deconvolution
-deconvolve
-decor
-decorate
-decorous
-decorticate
-decorum
-decouple
-decrease
-decree
-decreeing
-decrement
-decry
-decrypt
-decryption
-dedicate
-deduce
-deducible
-deduct
-deductible
-Dee
-deed
-deem
-deep
-deepen
-deer
-Deere
-deerskin
-deerstalker
-deface
-default
-defeat
-defecate
-defect
-defector
-defend
-defendant
-defensible
-defensive
-defer
-deferable
-deferent
-deferred
-deferring
-defiant
-deficient
-deficit
-define
-definite
-definition
-definitive
-deflate
-deflater
-deflect
-deflector
-defocus
-deforest
-deforestation
-deform
-deformation
-defraud
-defray
-defrost
-deft
-defunct
-defy
-degas
-degeneracy
-degenerate
-degradation
-degrade
-degrease
-degree
-degum
-dehumidify
-dehydrate
-deify
-deign
-deity
-deja
-deject
-Del
-Delaney
-Delano
-Delaware
-delay
-delectable
-delectate
-delegable
-delegate
-delete
-deleterious
-deletion
-Delhi
-Delia
-deliberate
-delicacy
-delicate
-delicatessen
-delicious
-delicti
-delight
-Delilah
-delimit
-delimitation
-delineament
-delineate
-delinquent
-deliquesce
-deliquescent
-delirious
-delirium
-deliver
-deliverance
-delivery
-dell
-Della
-Delmarva
-delouse
-Delphi
-Delphic
-delphine
-delphinium
-Delphinus
-delta
-deltoid
-delude
-deluge
-delusion
-delusive
-deluxe
-delve
-demagnify
-demagogue
-demand
-demarcate
-demark
-demean
-demented
-demerit
-demigod
-demijohn
-demiscible
-demise
-demit
-demitted
-demitting
-democracy
-democrat
-democratic
-demodulate
-demography
-demolish
-demolition
-demon
-demoniac
-demonic
-demonstrable
-demonstrate
-demote
-demountable
-Dempsey
-demultiplex
-demur
-demure
-demurred
-demurrer
-demurring
-demythologize
-den
-denature
-dendrite
-dendritic
-Deneb
-Denebola
-deniable
-denial
-denigrate
-denizen
-Denmark
-Dennis
-Denny
-denominate
-denotation
-denotative
-denote
-denouement
-denounce
-dense
-densitometer
-dent
-dental
-dentistry
-Denton
-denture
-denudation
-denude
-denumerable
-denunciate
-Denver
-deny
-deodorant
-deoxyribonucleic
-depart
-department
-departure
-depend
-dependent
-depict
-deplete
-depletion
-deplore
-deploy
-deport
-deportation
-deportee
-depose
-deposit
-depositary
-deposition
-depositor
-depository
-depot
-deprave
-deprecate
-deprecatory
-depreciable
-depreciate
-depress
-depressant
-depressed
-depressible
-depressing
-depression
-depressive
-depressor
-deprivation
-deprive
-depth
-deputation
-depute
-deputy
-derail
-derange
-derate
-derby
-Derbyshire
-dereference
-deregulate
-Derek
-derelict
-deride
-derision
-derisive
-derivate
-derive
-derogate
-derogatory
-derrick
-derriere
-dervish
-Des
-descant
-Descartes
-descend
-descendant
-descendent
-descent
-describe
-description
-descriptive
-descriptor
-desecrate
-desecrater
-desegregate
-desert
-deserve
-desiderata
-desideratum
-design
-designate
-desire
-desirous
-desist
-desk
-Desmond
-desolate
-desolater
-desorption
-despair
-desperado
-desperate
-despicable
-despise
-despite
-despoil
-despond
-despondent
-despot
-despotic
-dessert
-dessicate
-destabilize
-destinate
-destine
-destiny
-destitute
-destroy
-destruct
-destructor
-desuetude
-desultory
-desynchronize
-detach
-detail
-detain
-detect
-detector
-detent
-detente
-detention
-deter
-detergent
-deteriorate
-determinant
-determinate
-determine
-deterred
-deterrent
-deterring
-detest
-detestation
-detonable
-detonate
-detour
-detoxify
-detract
-detractor
-detriment
-Detroit
-deuce
-deus
-deuterate
-deuterium
-devastate
-develop
-deviant
-deviate
-device
-devil
-devilish
-devious
-devise
-devisee
-devoid
-devolve
-Devon
-Devonshire
-devote
-devotee
-devotion
-devour
-devout
-dew
-dewar
-dewdrop
-Dewey
-Dewitt
-dewy
-dexter
-dexterity
-dextrous
-dey
-Dhabi
-dharma
-diabase
-diabetes
-diabetic
-diabolic
-diachronic
-diacritical
-diadem
-diagnosable
-diagnose
-diagnoses
-diagnosis
-diagnostic
-diagnostician
-diagonal
-diagram
-diagrammatic
-dial
-dialect
-dialectic
-dialogue
-dialysis
-diamagnetic
-diamegnetism
-diameter
-diamond
-Diana
-Diane
-Dianne
-diaper
-diaphanous
-diaphragm
-diary
-diathermy
-diathesis
-diatom
-diatomaceous
-diatomic
-diatonic
-dibble
-dice
-dichloride
-dichondra
-dichotomy
-dick
-dickcissel
-dickens
-Dickerson
-dickey
-Dickinson
-Dickson
-dicotyledon
-dicta
-dictate
-dictatorial
-diction
-dictionary
-dictum
-did
-didactic
-diddle
-didn't
-Dido
-die
-Diebold
-died
-Diego
-diehard
-dieldrin
-dielectric
-diem
-diesel
-diet
-dietary
-dietetic
-diethylstilbestrol
-dietician
-Dietrich
-diety
-Dietz
-differ
-different
-differentiable
-differential
-differentiate
-difficult
-difficulty
-diffident
-diffract
-diffractometer
-diffuse
-diffusible
-diffusion
-diffusive
-difluoride
-dig
-digest
-digestible
-digestion
-digestive
-digging
-digit
-digital
-digitalis
-dignify
-dignitary
-dignity
-digram
-digress
-digression
-dihedral
-dilapidate
-dilatation
-dilate
-dilatory
-dilemma
-dilettante
-diligent
-dill
-Dillon
-dilogarithm
-diluent
-dilute
-dilution
-dim
-dime
-dimension
-dimethyl
-diminish
-diminution
-diminutive
-dimple
-din
-Dinah
-dine
-ding
-dinghy
-dingo
-dingy
-dinnertime
-dinnerware
-dinosaur
-dint
-diocesan
-diocese
-diode
-Dionysian
-Dionysus
-Diophantine
-diopter
-diorama
-dioxide
-dip
-diphthong
-diploma
-diplomacy
-diplomat
-diplomatic
-dipole
-Dirac
-dire
-direct
-director
-directorate
-directory
-directrices
-directrix
-dirge
-Dirichlet
-dirt
-dirty
-Dis
-disambiguate
-disastrous
-disburse
-disc
-discern
-discernible
-disciple
-disciplinary
-discipline
-discoid
-discomfit
-discordant
-discovery
-discreet
-discrepant
-discrete
-discretion
-discretionary
-discriminable
-discriminant
-discriminate
-discriminatory
-discus
-discuss
-discussant
-discussion
-disdain
-disembowel
-disgruntle
-dish
-dishevel
-dishwasher
-dishwater
-disjunct
-disk
-dismal
-dismissal
-Disney
-Disneyland
-disparage
-disparate
-dispel
-dispelled
-dispelling
-dispensable
-dispensary
-dispensate
-dispense
-dispersal
-disperse
-dispersible
-dispersion
-dispersive
-disposable
-disposal
-disputant
-dispute
-disquietude
-disquisition
-disrupt
-disruption
-disruptive
-dissemble
-disseminate
-dissension
-dissertation
-dissident
-dissipate
-dissociable
-dissociate
-dissonant
-dissuade
-distaff
-distal
-distant
-distillate
-distillery
-distinct
-distinguish
-distort
-distortion
-distraught
-distribution
-distributive
-distributor
-district
-disturb
-disturbance
-disulfide
-disyllable
-ditch
-dither
-ditto
-ditty
-diurnal
-diva
-divalent
-divan
-dive
-diverge
-divergent
-diverse
-diversify
-diversion
-diversionary
-divert
-divest
-divestiture
-divide
-dividend
-divination
-divine
-divisible
-division
-divisional
-divisive
-divisor
-divorce
-divorcee
-divulge
-Dixie
-dixieland
-Dixon
-dizzy
-Djakarta
-DNA
-Dnieper
-do
-Dobbin
-Dobbs
-doberman
-dobson
-docile
-dock
-docket
-dockside
-dockyard
-doctor
-doctoral
-doctorate
-doctrinaire
-doctrinal
-doctrine
-document
-documentary
-documentation
-DOD
-Dodd
-dodecahedra
-dodecahedral
-dodecahedron
-dodge
-Dodson
-doe
-doesn't
-doff
-dog
-dogbane
-dogberry
-Doge
-dogfish
-dogging
-doggone
-doghouse
-dogleg
-dogma
-dogmatic
-dogmatism
-dogtooth
-dogtrot
-dogwood
-Doherty
-Dolan
-dolce
-doldrum
-dole
-doll
-dollar
-dollop
-dolly
-dolomite
-dolomitic
-Dolores
-dolphin
-dolt
-doltish
-domain
-dome
-Domenico
-Domesday
-domestic
-domicile
-dominant
-dominate
-domineer
-Domingo
-Dominic
-Dominican
-Dominick
-dominion
-Dominique
-domino
-don
-don't
-Donahue
-Donald
-Donaldson
-donate
-done
-Doneck
-donkey
-Donna
-Donnelly
-Donner
-donnybrook
-donor
-Donovan
-doodle
-Dooley
-Doolittle
-doom
-doomsday
-door
-doorbell
-doorkeep
-doorkeeper
-doorknob
-doorman
-doormen
-doorstep
-doorway
-dopant
-dope
-Doppler
-Dora
-Dorado
-Dorcas
-Dorchester
-Doreen
-Doria
-Doric
-Doris
-dormant
-dormitory
-Dorothea
-Dorothy
-Dorset
-dosage
-dose
-dosimeter
-dossier
-Dostoevsky
-dot
-dote
-double
-Doubleday
-doubleheader
-doublet
-doubleton
-doubloon
-doubt
-douce
-Doug
-dough
-Dougherty
-doughnut
-Douglas
-Douglass
-dour
-douse
-dove
-dovekie
-dovetail
-Dow
-dowager
-dowel
-dowitcher
-Dowling
-down
-downbeat
-downcast
-downdraft
-Downey
-downfall
-downgrade
-downhill
-Downing
-downplay
-downpour
-downright
-Downs
-downside
-downslope
-downspout
-downstairs
-downstream
-downtown
-downtrend
-downtrodden
-downturn
-downward
-downwind
-dowry
-Doyle
-doze
-dozen
-Dr
-drab
-Draco
-draft
-draftee
-draftsman
-draftsmen
-draftsperson
-drafty
-drag
-dragging
-dragnet
-dragon
-dragonfly
-dragonhead
-dragoon
-drain
-drainage
-drake
-dram
-drama
-dramatic
-dramatist
-dramaturgy
-drank
-drape
-drapery
-drastic
-draw
-drawback
-drawbridge
-drawl
-drawn
-dread
-dreadnought
-dream
-dreamboat
-dreamlike
-dreamt
-dreamy
-dreary
-dredge
-dreg
-drench
-dress
-dressmake
-dressy
-drew
-Drexel
-Dreyfuss
-drib
-dribble
-dried
-drier
-drift
-drill
-drink
-drip
-drippy
-Driscoll
-drive
-driven
-driveway
-drizzle
-drizzly
-droll
-dromedary
-drone
-drool
-droop
-droopy
-drop
-drophead
-droplet
-dropout
-drosophila
-dross
-drought
-drove
-drown
-drowse
-drowsy
-drub
-drudge
-drudgery
-drug
-drugging
-drugstore
-druid
-drum
-drumhead
-drumlin
-Drummond
-drunk
-drunkard
-drunken
-Drury
-dry
-dryad
-Dryden
-du
-dual
-dualism
-Duane
-dub
-Dubhe
-dubious
-dubitable
-Dublin
-ducat
-duchess
-duck
-duckling
-duct
-ductile
-ductwork
-dud
-Dudley
-due
-duel
-duet
-duff
-duffel
-Duffy
-dug
-Dugan
-dugout
-duke
-dukedom
-dulcet
-dull
-dully
-dulse
-Duluth
-duly
-Duma
-dumb
-dumbbell
-dummy
-dump
-Dumpty
-dumpy
-dun
-Dunbar
-Duncan
-dunce
-dune
-Dunedin
-dung
-dungeon
-Dunham
-dunk
-Dunkirk
-Dunlap
-Dunlop
-Dunn
-duopolist
-duopoly
-dupe
-duplex
-duplicable
-duplicate
-duplicity
-DuPont
-durable
-Durango
-duration
-Durer
-duress
-Durham
-during
-Durkee
-Durkin
-Durrell
-Durward
-Dusenberg
-Dusenbury
-dusk
-dusky
-Dusseldorf
-dust
-dustbin
-dusty
-Dutch
-dutchess
-Dutchman
-Dutchmen
-dutiable
-Dutton
-duty
-dwarf
-dwarves
-dwell
-dwelt
-Dwight
-dwindle
-Dwyer
-dyad
-dyadic
-dye
-dyer
-dying
-Dyke
-Dylan
-dynamic
-dynamism
-dynamite
-dynamo
-dynast
-dynastic
-dynasty
-dyne
-dysentery
-dyspeptic
-dysplasia
-dysprosium
-dystrophy
-e
-e'er
-e's
-each
-Eagan
-eager
-eagle
-ear
-eardrum
-earl
-earmark
-earn
-earnest
-earphone
-earring
-earth
-earthen
-earthenware
-earthmen
-earthmove
-earthquake
-earthworm
-earthy
-earwig
-ease
-easel
-east
-eastbound
-eastern
-easternmost
-Eastland
-Eastman
-eastward
-Eastwood
-easy
-easygoing
-eat
-eaten
-eater
-Eaton
-eave
-eavesdrop
-ebb
-Eben
-ebony
-ebullient
-eccentric
-Eccles
-ecclesiastic
-echelon
-echinoderm
-echo
-echoes
-eclat
-eclectic
-eclipse
-ecliptic
-eclogue
-Ecole
-ecology
-Econometrica
-economic
-economist
-economy
-ecosystem
-ecstasy
-ecstatic
-Ecuador
-ecumenic
-ecumenist
-Ed
-Eddie
-eddy
-edelweiss
-edematous
-Eden
-Edgar
-edge
-Edgerton
-edgewise
-edging
-edgy
-edible
-edict
-edifice
-edify
-Edinburgh
-Edison
-edit
-Edith
-edition
-editor
-editorial
-Edmonds
-Edmondson
-Edmonton
-Edmund
-Edna
-EDT
-educable
-educate
-Edward
-Edwardian
-Edwards
-Edwin
-Edwina
-eel
-eelgrass
-EEOC
-eerie
-eerily
-efface
-effaceable
-effect
-effectual
-effectuate
-effeminate
-efferent
-effete
-efficacious
-efficacy
-efficient
-Effie
-effloresce
-efflorescent
-effluent
-effluvia
-effluvium
-effort
-effusive
-eft
-egalitarian
-Egan
-egg
-egghead
-eggplant
-eggshell
-ego
-egocentric
-egotism
-egotist
-egregious
-egress
-egret
-Egypt
-Egyptian
-eh
-Ehrlich
-eider
-eidetic
-eigenfunction
-eigenstate
-eigenvalue
-eigenvector
-eight
-eighteen
-eighteenth
-eightfold
-eighth
-eightieth
-eighty
-Eileen
-Einstein
-Einsteinian
-einsteinium
-Eire
-Eisenhower
-Eisner
-either
-ejaculate
-eject
-ejector
-eke
-Ekstrom
-Ektachrome
-el
-elaborate
-Elaine
-elan
-elapse
-elastic
-elastomer
-elate
-Elba
-elbow
-elder
-eldest
-Eldon
-Eleanor
-Eleazar
-elect
-elector
-electoral
-electorate
-Electra
-electress
-electret
-electric
-electrician
-electrify
-electro
-electrocardiogram
-electrocardiograph
-electrode
-electroencephalogram
-electroencephalograph
-electroencephalography
-electrolysis
-electrolyte
-electrolytic
-electron
-electronic
-electrophoresis
-electrophorus
-elegant
-elegiac
-elegy
-element
-elementary
-Elena
-elephant
-elephantine
-elevate
-eleven
-eleventh
-elfin
-Elgin
-Eli
-elicit
-elide
-eligible
-Elijah
-eliminate
-Elinor
-Eliot
-Elisabeth
-Elisha
-elision
-elite
-Elizabeth
-Elizabethan
-elk
-Elkhart
-ell
-Ella
-Ellen
-Elliott
-ellipse
-ellipsis
-ellipsoid
-ellipsoidal
-ellipsometer
-elliptic
-Ellis
-Ellison
-Ellsworth
-Ellwood
-elm
-Elmer
-Elmhurst
-Elmira
-Elmsford
-Eloise
-elongate
-elope
-eloquent
-else
-Elsevier
-elsewhere
-Elsie
-Elsinore
-Elton
-eluate
-elucidate
-elude
-elusive
-elute
-elution
-elves
-Ely
-Elysee
-elysian
-em
-emaciate
-emanate
-emancipate
-Emanuel
-emasculate
-embalm
-embank
-embarcadero
-embargo
-embargoes
-embark
-embarrass
-embassy
-embattle
-embed
-embedded
-embedder
-embedding
-embellish
-ember
-embezzle
-emblem
-emblematic
-embodiment
-embody
-embolden
-emboss
-embouchure
-embower
-embrace
-embraceable
-embrittle
-embroider
-embroidery
-embroil
-embryo
-embryonic
-emcee
-emendable
-emerald
-emerge
-emergent
-emeritus
-Emerson
-Emery
-emigrant
-emigrate
-Emil
-Emile
-Emilio
-Emily
-eminent
-emirate
-emissary
-emission
-emissivity
-emit
-emittance
-emitted
-emitter
-emitting
-emma
-Emmanuel
-Emmett
-emolument
-Emory
-emotion
-emotional
-empathy
-emperor
-emphases
-emphasis
-emphatic
-emphysema
-emphysematous
-empire
-empiric
-emplace
-employ
-employed
-employee
-employer
-employing
-emporium
-empower
-empress
-empty
-emulate
-emulsify
-emulsion
-en
-enable
-enamel
-encapsulate
-encephalitis
-enchantress
-enclave
-encomia
-encomium
-encroach
-encryption
-encumber
-encumbrance
-encyclopedic
-end
-endgame
-Endicott
-endogamous
-endogamy
-endogenous
-endorse
-endosperm
-endothelial
-endothermic
-endow
-endpoint
-endurance
-endure
-enemy
-energetic
-energy
-enervate
-enfant
-Enfield
-enforceable
-Eng
-Engel
-engine
-engineer
-England
-Engle
-Englewood
-English
-Englishman
-Englishmen
-enhance
-Enid
-enigma
-enigmatic
-enjoinder
-enlargeable
-enliven
-enmity
-Enoch
-enormity
-enormous
-Enos
-enough
-enquire
-enquiry
-Enrico
-enrollee
-ensconce
-ensemble
-entendre
-enter
-enterprise
-entertain
-enthalpy
-enthrall
-enthusiasm
-enthusiast
-enthusiastic
-entice
-entirety
-entity
-entomology
-entourage
-entranceway
-entrant
-entrepreneur
-entrepreneurial
-entropy
-enumerable
-enumerate
-enunciable
-enunciate
-envelop
-envelope
-envious
-environ
-envoy
-envy
-enzymatic
-enzyme
-enzymology
-Eocene
-eohippus
-eosine
-EPA
-epaulet
-ephemeral
-ephemerides
-ephemeris
-Ephesian
-Ephesus
-Ephraim
-epic
-epicure
-Epicurean
-epicycle
-epicyclic
-epidemic
-epidemiology
-epidermic
-epidermis
-epigenetic
-epigram
-epigrammatic
-epigraph
-epileptic
-epilogue
-Epiphany
-epiphyseal
-epiphysis
-episcopal
-Episcopalian
-episcopate
-episode
-episodic
-epistemology
-epistle
-epistolatory
-epitaph
-epitaxial
-epitaxy
-epithelial
-epithelium
-epithet
-epitome
-epoch
-epochal
-epoxy
-epsilon
-Epsom
-Epstein
-equable
-equal
-equanimity
-equate
-equatorial
-equestrian
-equidistant
-equilateral
-equilibrate
-equilibria
-equilibrium
-equine
-equinoctial
-equinox
-equip
-equipoise
-equipotent
-equipped
-equipping
-equitable
-equitation
-equity
-equivalent
-equivocal
-era
-eradicable
-eradicate
-erasable
-erase
-Erasmus
-Erastus
-erasure
-Erato
-Eratosthenes
-erbium
-ERDA
-ere
-erect
-erg
-ergodic
-Eric
-Erich
-Erickson
-Ericsson
-Erie
-Erlenmeyer
-Ernest
-Ernestine
-Ernie
-Ernst
-erode
-erodible
-Eros
-erosible
-erosion
-erosive
-erotic
-erotica
-err
-errancy
-errand
-errant
-errantry
-errata
-erratic
-erratum
-Errol
-erroneous
-error
-ersatz
-Erskine
-erudite
-erudition
-erupt
-eruption
-Ervin
-Erwin
-escadrille
-escalate
-escapade
-escape
-escapee
-escheat
-eschew
-escort
-escritoire
-escrow
-escutcheon
-Eskimo
-Esmark
-esophagi
-esoteric
-especial
-espionage
-esplanade
-Esposito
-espousal
-espouse
-esprit
-esquire
-essay
-Essen
-essence
-essential
-Essex
-EST
-establish
-estate
-esteem
-Estella
-ester
-Estes
-Esther
-estimable
-estimate
-estop
-estoppal
-estrange
-estuarine
-estuary
-et
-eta
-etc
-etch
-eternal
-eternity
-Ethan
-ethane
-ethanol
-Ethel
-ether
-ethereal
-ethic
-Ethiopia
-ethnic
-ethnography
-ethnology
-ethology
-ethos
-ethyl
-ethylene
-etiology
-etiquette
-Etruscan
-etude
-etymology
-eucalyptus
-Eucharist
-Euclid
-Euclidean
-eucre
-Eugene
-Eugenia
-eugenic
-Euler
-Eulerian
-eulogy
-Eumenides
-Eunice
-euphemism
-euphemist
-euphorbia
-euphoria
-euphoric
-Euphrates
-Eurasia
-eureka
-Euridyce
-Euripides
-Europa
-Europe
-European
-europium
-Eurydice
-eutectic
-Euterpe
-euthanasia
-Eva
-evacuate
-evade
-evaluable
-evaluate
-evanescent
-evangel
-evangelic
-Evans
-Evanston
-Evansville
-evaporate
-evasion
-evasive
-eve
-Evelyn
-even
-evenhanded
-evensong
-event
-eventide
-eventual
-eventuate
-Eveready
-Everett
-Everglades
-evergreen
-Everhart
-everlasting
-every
-everybody
-everyday
-everyman
-everyone
-everything
-everywhere
-evict
-evident
-evidential
-evil
-evildoer
-evince
-evocable
-evocate
-evoke
-evolution
-evolutionary
-evolve
-evzone
-ewe
-Ewing
-ex
-exacerbate
-exact
-exaggerate
-exalt
-exaltation
-exam
-examination
-examine
-example
-exasperate
-exasperater
-excavate
-exceed
-excel
-excelled
-excellent
-excelling
-excelsior
-except
-exception
-exceptional
-excerpt
-excess
-excessive
-exchange
-exchangeable
-exchequer
-excisable
-excise
-excision
-excitation
-excitatory
-excite
-exciton
-exclaim
-exclamation
-exclamatory
-exclude
-exclusion
-exclusionary
-exclusive
-excommunicate
-excoriate
-excrescent
-excresence
-excrete
-excretion
-excretory
-excruciate
-exculpate
-exculpatory
-excursion
-excursus
-excusable
-excuse
-execrable
-execrate
-execute
-execution
-executive
-executor
-executrix
-exegesis
-exegete
-exemplar
-exemplary
-exemplify
-exempt
-exemption
-exercisable
-exercise
-exert
-Exeter
-exhale
-exhaust
-exhaustible
-exhaustion
-exhaustive
-exhibit
-exhibition
-exhibitor
-exhilarate
-exhort
-exhortation
-exhumation
-exhume
-exigent
-exile
-exist
-existent
-existential
-exit
-exodus
-exogamous
-exogamy
-exogenous
-exonerate
-exorbitant
-exorcise
-exorcism
-exorcist
-exoskeleton
-exothermic
-exotic
-exotica
-expand
-expanse
-expansible
-expansion
-expansive
-expatiate
-expect
-expectant
-expectation
-expectorant
-expectorate
-expedient
-expedite
-expedition
-expeditious
-expel
-expellable
-expelled
-expelling
-expend
-expenditure
-expense
-expensive
-experience
-experiential
-experiment
-experimentation
-expert
-expertise
-expiable
-expiate
-expiration
-expire
-explain
-explanation
-explanatory
-expletive
-explicable
-explicate
-explicit
-explode
-exploit
-exploitation
-exploration
-exploratory
-explore
-explosion
-explosive
-exponent
-exponential
-exponentiate
-export
-exportation
-expose
-exposit
-exposition
-expositor
-expository
-exposure
-expound
-express
-expressible
-expression
-expressive
-expressway
-expropriate
-expulsion
-expunge
-expurgate
-exquisite
-extant
-extemporaneous
-extempore
-extend
-extendible
-extensible
-extension
-extensive
-extensor
-extent
-extenuate
-exterior
-exterminate
-external
-extinct
-extinguish
-extirpate
-extol
-extolled
-extoller
-extolling
-extort
-extra
-extracellular
-extract
-extractor
-extraditable
-extralegal
-extramarital
-extraneous
-extraordinary
-extrapolate
-extraterrestrial
-extravagant
-extravaganza
-extrema
-extremal
-extreme
-extremum
-extricable
-extricate
-extrinsic
-extroversion
-extrovert
-extrude
-extrusion
-extrusive
-exuberant
-exudation
-exude
-exult
-exultant
-exultation
-Exxon
-eye
-eyeball
-eyebright
-eyebrow
-eyed
-eyeglass
-eyelash
-eyelet
-eyelid
-eyepiece
-eyesight
-eyewitness
-Ezekiel
-Ezra
-f
-f's
-FAA
-Faber
-Fabian
-fable
-fabric
-fabricate
-fabulous
-facade
-face
-faceplate
-facet
-facetious
-facial
-facile
-facilitate
-facsimile
-fact
-factious
-facto
-factor
-factorial
-factory
-factual
-faculty
-fad
-fade
-fadeout
-faery
-Fafnir
-fag
-Fahey
-Fahrenheit
-fail
-failsafe
-failsoft
-failure
-fain
-faint
-fair
-Fairchild
-Fairfax
-Fairfield
-fairgoer
-Fairport
-fairway
-fairy
-faith
-fake
-falcon
-falconry
-fall
-fallacious
-fallacy
-fallen
-fallible
-falloff
-fallout
-fallow
-Falmouth
-false
-falsehood
-falsify
-Falstaff
-falter
-fame
-familial
-familiar
-familiarly
-familism
-family
-famine
-famous
-fan
-fanatic
-fancy
-fanfare
-fanfold
-fang
-fangled
-Fanny
-fanout
-fantasia
-fantasist
-fantastic
-fantasy
-fantod
-far
-farad
-Faraday
-Farber
-farce
-farcical
-fare
-farewell
-farfetched
-Fargo
-farina
-Farkas
-Farley
-farm
-farmhouse
-Farmington
-farmland
-Farnsworth
-faro
-Farrell
-farsighted
-farther
-farthest
-fascicle
-fasciculate
-fascinate
-fascism
-fascist
-fashion
-fast
-fasten
-fastidious
-fat
-fatal
-fate
-father
-fathom
-fatigue
-Fatima
-fatten
-fatty
-fatuous
-faucet
-Faulkner
-fault
-faulty
-faun
-fauna
-Faust
-Faustian
-Faustus
-fawn
-fay
-Fayette
-Fayetteville
-faze
-FBI
-FCC
-FDA
-Fe
-fealty
-fear
-fearsome
-feasible
-feast
-feat
-feather
-featherbed
-featherbrain
-feathertop
-featherweight
-feathery
-feature
-Feb
-febrile
-February
-fecund
-fed
-Fedders
-federal
-federate
-Fedora
-fee
-feeble
-feed
-feedback
-feel
-Feeney
-feet
-feign
-feint
-Feldman
-feldspar
-Felice
-Felicia
-felicitous
-felicity
-feline
-Felix
-fell
-fellow
-felon
-felonious
-felony
-felt
-female
-feminine
-feminism
-feminist
-femur
-fence
-fencepost
-fend
-fennel
-Fenton
-fenugreek
-Ferber
-Ferdinand
-Ferguson
-Fermat
-ferment
-fermentation
-Fermi
-fermion
-fermium
-fern
-Fernando
-fernery
-ferocious
-ferocity
-Ferrer
-ferret
-ferric
-ferris
-ferrite
-ferroelectric
-ferromagnet
-ferromagnetic
-ferromagnetism
-ferrous
-ferruginous
-ferrule
-ferry
-fertile
-fervent
-fescue
-fest
-festival
-festive
-fetal
-fetch
-fete
-fetid
-fetish
-fetter
-fettle
-fetus
-feud
-feudal
-feudatory
-fever
-feverish
-few
-fiance
-fiancee
-fiasco
-fiat
-fib
-fiberboard
-Fiberglas
-Fibonacci
-fibrin
-fibrosis
-fibrous
-fiche
-fickle
-fiction
-fictitious
-fictive
-fiddle
-fiddlestick
-fide
-fidelity
-fidget
-fiducial
-fief
-fiefdom
-field
-Fields
-fieldstone
-fieldwork
-fiend
-fiendish
-fierce
-fiery
-fiesta
-fife
-FIFO
-fifteen
-fifteenth
-fifth
-fiftieth
-fifty
-fig
-figaro
-fight
-figural
-figurate
-figure
-figurine
-filament
-filamentary
-filbert
-filch
-file
-filet
-filial
-filibuster
-filigree
-Filipino
-fill
-filled
-filler
-fillet
-fillip
-filly
-film
-filmdom
-filmmake
-filmstrip
-filmy
-filter
-filth
-filthy
-filtrate
-fin
-final
-finale
-finance
-financial
-financier
-finch
-find
-fine
-finesse
-finessed
-finessing
-finger
-fingernail
-fingerprint
-fingertip
-finial
-finicky
-finish
-finite
-fink
-Finland
-Finley
-Finn
-Finnegan
-Finnish
-finny
-fir
-fire
-firearm
-fireboat
-firebreak
-firebug
-firecracker
-firefly
-firehouse
-firelight
-fireman
-firemen
-fireplace
-firepower
-fireproof
-fireside
-Firestone
-firewall
-firewood
-firework
-firm
-firmware
-first
-firsthand
-fiscal
-Fischbein
-Fischer
-fish
-fisherman
-fishermen
-fishery
-fishmonger
-fishpond
-fishy
-Fisk
-Fiske
-fissile
-fission
-fissure
-fist
-fisticuff
-fit
-Fitch
-Fitchburg
-Fitzgerald
-Fitzpatrick
-Fitzroy
-five
-fivefold
-fix
-fixate
-fixture
-Fizeau
-fizzle
-fjord
-flabbergast
-flack
-flag
-flagellate
-flageolet
-flagging
-Flagler
-flagpole
-flagrant
-Flagstaff
-flagstone
-flail
-flair
-flak
-flake
-flaky
-flam
-flamboyant
-flame
-flamingo
-flammable
-Flanagan
-Flanders
-flange
-flank
-flannel
-flap
-flare
-flash
-flashback
-flashlight
-flashy
-flask
-flat
-flatbed
-flathead
-flatiron
-flatland
-flatten
-flattery
-flatulent
-flatus
-flatworm
-flaunt
-flautist
-flaw
-flax
-flaxen
-flaxseed
-flea
-fleabane
-fleck
-fled
-fledge
-fledgling
-flee
-fleece
-fleeing
-fleet
-Fleming
-flemish
-flesh
-fleshy
-fletch
-Fletcher
-flew
-flex
-flexible
-flexural
-flexure
-flick
-flier
-flight
-flimsy
-flinch
-fling
-flint
-flintlock
-flinty
-flip
-flipflop
-flippant
-flirt
-flirtation
-flirtatious
-flit
-Flo
-float
-floc
-flocculate
-flock
-floe
-flog
-flogging
-flood
-floodgate
-floodlight
-floodlit
-floor
-floorboard
-flop
-floppy
-flora
-floral
-Florence
-Florentine
-florican
-florid
-Florida
-Floridian
-florin
-florist
-flotation
-flotilla
-flounce
-flounder
-flour
-flourish
-floury
-flout
-flow
-flowchart
-flowerpot
-flowery
-flown
-Floyd
-flu
-flub
-fluctuate
-flue
-fluency
-fluent
-fluff
-fluffy
-fluid
-fluke
-flung
-fluoresce
-fluorescein
-fluorescent
-fluoridate
-fluoride
-fluorine
-fluorite
-fluorocarbon
-fluorspar
-flurry
-flush
-fluster
-flute
-flutter
-flux
-fly
-flycatcher
-flyer
-Flynn
-flyway
-FM
-FMC
-foal
-foam
-foamflower
-foamy
-fob
-focal
-foci
-focus
-focussed
-fodder
-foe
-fog
-fogging
-foggy
-fogy
-foible
-foil
-foist
-fold
-foldout
-Foley
-foliage
-foliate
-folio
-folk
-folklore
-folksong
-folksy
-follicle
-follicular
-follow
-followeth
-folly
-Fomalhaut
-fond
-fondle
-fondly
-font
-Fontaine
-Fontainebleau
-food
-foodstuff
-fool
-foolhardy
-foolish
-foolproof
-foot
-footage
-football
-footbridge
-Foote
-footfall
-foothill
-footman
-footmen
-footnote
-footpad
-footpath
-footprint
-footstep
-footstool
-footwear
-footwork
-fop
-foppish
-for
-forage
-foray
-forbade
-forbear
-forbearance
-Forbes
-forbid
-forbidden
-forbore
-forborne
-force
-forcible
-ford
-Fordham
-fore
-foreign
-forensic
-forest
-forestry
-forever
-forfeit
-forfeiture
-forfend
-forgave
-forge
-forgery
-forget
-forgettable
-forgive
-forgiven
-forgot
-forgotten
-fork
-forklift
-forlorn
-form
-formal
-formaldehyde
-formant
-format
-formate
-formic
-Formica
-formidable
-Formosa
-formula
-formulae
-formulaic
-formulate
-Forrest
-forsake
-forsaken
-forsook
-forswear
-Forsythe
-fort
-forte
-Fortescue
-forth
-forthcome
-forthright
-forthwith
-fortieth
-fortify
-fortin
-fortiori
-fortitude
-fortnight
-Fortran
-fortress
-fortuitous
-fortunate
-fortune
-forty
-forum
-forward
-Foss
-fossil
-fossiliferous
-foster
-fought
-foul
-foulmouth
-found
-foundation
-foundling
-foundry
-fount
-fountain
-fountainhead
-four
-fourfold
-Fourier
-foursome
-foursquare
-fourteen
-fourteenth
-fourth
-fovea
-fowl
-fox
-foxglove
-Foxhall
-foxhole
-foxhound
-foxtail
-foxy
-foyer
-FPC
-fraction
-fractionate
-fractious
-fracture
-fragile
-fragment
-fragmentary
-fragmentation
-fragrant
-frail
-frailty
-frambesia
-frame
-framework
-franc
-franca
-France
-Frances
-franchise
-Francis
-Franciscan
-Francisco
-francium
-franco
-frangipani
-frank
-Frankfort
-Frankfurt
-frankfurter
-franklin
-frantic
-Franz
-Fraser
-fraternal
-fraternity
-Frau
-fraud
-fraudulent
-fraught
-fray
-frayed
-Frazier
-frazzle
-freak
-freakish
-freckle
-Fred
-Freddie
-Freddy
-Frederic
-Frederick
-Fredericks
-Fredericksburg
-Fredericton
-Fredholm
-Fredrickson
-free
-freeboot
-freed
-Freedman
-freedmen
-freedom
-freehand
-freehold
-freeing
-freeman
-freemen
-Freeport
-freer
-freest
-freestone
-freethink
-Freetown
-freeway
-freewheel
-freeze
-freight
-French
-Frenchman
-Frenchmen
-frenetic
-frenzy
-freon
-frequent
-fresco
-frescoes
-fresh
-freshen
-freshman
-freshmen
-freshwater
-Fresnel
-Fresno
-fret
-Freud
-Freudian
-Frey
-Freya
-friable
-friar
-fricative
-Frick
-friction
-frictional
-Friday
-fried
-Friedman
-friend
-frieze
-frigate
-Frigga
-fright
-frighten
-frigid
-Frigidaire
-frill
-frilly
-fringe
-frisky
-fritillary
-fritter
-Fritz
-frivolity
-frivolous
-frizzle
-fro
-frock
-frog
-frolic
-from
-front
-frontage
-frontal
-frontier
-frontiersman
-frontiersmen
-frost
-frostbite
-frostbitten
-frosty
-froth
-frothy
-frown
-frowzy
-froze
-frozen
-Fruehauf
-frugal
-fruit
-fruition
-frustrate
-frustrater
-frustum
-fry
-Frye
-FTC
-Fuchs
-Fuchsia
-fudge
-fuel
-fugal
-fugitive
-fugue
-Fuji
-Fujitsu
-fulcrum
-fulfill
-full
-fullback
-Fullerton
-fully
-fulminate
-fulsome
-Fulton
-fum
-fumble
-fume
-fumigant
-fumigate
-fun
-function
-functionary
-functor
-fund
-fundamental
-funeral
-funereal
-fungal
-fungi
-fungible
-fungicide
-fungoid
-fungus
-funk
-funnel
-funny
-fur
-furbish
-furious
-furl
-furlong
-furlough
-Furman
-furnace
-furnish
-furniture
-furrier
-furrow
-furry
-further
-furthermore
-furthermost
-furthest
-furtive
-fury
-furze
-fuse
-fuselage
-fusible
-fusiform
-fusillade
-fusion
-fuss
-fussy
-fusty
-futile
-future
-fuzz
-fuzzy
-g
-g's
-gab
-gabardine
-gabble
-gabbro
-Gaberones
-gable
-Gabon
-Gabriel
-Gabrielle
-gad
-gadfly
-gadget
-gadgetry
-gadolinium
-gadwall
-Gaelic
-gaff
-gaffe
-gag
-gage
-gagging
-gaggle
-gagwriter
-gaiety
-Gail
-gaillardia
-gain
-Gaines
-Gainesville
-gait
-Gaithersburg
-gal
-gala
-galactic
-Galapagos
-Galatea
-Galatia
-galaxy
-Galbreath
-gale
-Galen
-galena
-Galilee
-gall
-Gallagher
-gallant
-gallantry
-gallberry
-gallery
-galley
-gallinule
-gallium
-gallivant
-gallon
-gallonage
-gallop
-Galloway
-gallows
-gallstone
-Gallup
-gallus
-Galois
-Galt
-galvanic
-galvanism
-galvanometer
-Galveston
-Galway
-gam
-Gambia
-gambit
-gamble
-gambol
-game
-gamecock
-gamin
-gamma
-gamut
-gander
-gang
-Ganges
-gangland
-gangling
-ganglion
-gangplank
-gangster
-gangway
-gannet
-Gannett
-gantlet
-gantry
-Ganymede
-GAO
-gap
-gape
-gar
-garage
-garb
-garbage
-garble
-Garcia
-garden
-gardenia
-Gardner
-Garfield
-gargantuan
-gargle
-Garibaldi
-garish
-garland
-garlic
-garner
-garnet
-Garrett
-garrison
-Garrisonian
-garrulous
-Garry
-garter
-Garth
-Garvey
-Gary
-gas
-Gascony
-gaseous
-gash
-gasify
-gasket
-gaslight
-gasoline
-gasp
-Gaspee
-gassy
-Gaston
-gastrointestinal
-gastronome
-gastronomy
-gate
-Gates
-gateway
-gather
-Gatlinburg
-gator
-gauche
-gaucherie
-gaudy
-gauge
-gaugeable
-Gauguin
-Gaul
-gauleiter
-Gaulle
-gaunt
-gauntlet
-gaur
-gauss
-Gaussian
-gauze
-gave
-gavel
-Gavin
-gavotte
-gawk
-gawky
-gay
-Gaylord
-gaze
-gazelle
-gazette
-GE
-gear
-gecko
-gedanken
-gee
-geese
-Gegenschein
-Geiger
-Geigy
-geisha
-gel
-gelable
-gelatin
-gelatine
-gelatinous
-geld
-gem
-Gemini
-gemlike
-Gemma
-gemstone
-gender
-gene
-genealogy
-genera
-general
-generate
-generic
-generosity
-generous
-Genesco
-genesis
-genetic
-Geneva
-Genevieve
-genial
-genie
-genii
-genius
-Genoa
-genotype
-genre
-gent
-genteel
-gentian
-gentile
-gentility
-gentle
-gentleman
-gentlemen
-gentry
-genuine
-genus
-geocentric
-geochemical
-geochemistry
-geochronology
-geodesic
-geodesy
-geodetic
-geoduck
-Geoffrey
-geographer
-geography
-geology
-geometer
-geometrician
-geophysical
-geophysics
-geopolitic
-George
-Georgetown
-Georgia
-Gerald
-Geraldine
-geranium
-Gerard
-Gerber
-gerbil
-Gerhard
-Gerhardt
-geriatric
-germ
-German
-germane
-Germanic
-germanium
-Germantown
-Germany
-germicidal
-germicide
-germinal
-germinate
-Gerry
-Gershwin
-Gertrude
-gerund
-gerundial
-gerundive
-gestalt
-Gestapo
-gesticulate
-gesture
-get
-getaway
-Getty
-Gettysburg
-geyser
-Ghana
-ghastly
-Ghent
-gherkin
-ghetto
-ghost
-ghostlike
-ghostly
-ghoul
-ghoulish
-Giacomo
-giant
-giantess
-gibberish
-gibbet
-gibbon
-Gibbons
-gibbous
-Gibbs
-gibby
-gibe
-giblet
-Gibraltar
-Gibson
-giddap
-giddy
-Gideon
-Gifford
-gift
-gig
-gigacycle
-gigahertz
-gigantic
-gigavolt
-gigawatt
-gigging
-giggle
-Gil
-gila
-gilbert
-Gilbertson
-Gilchrist
-gild
-Gilead
-Giles
-gill
-Gillespie
-Gillette
-Gilligan
-Gilmore
-gilt
-gimbal
-Gimbel
-gimpy
-gin
-Gina
-ginger
-gingham
-gingko
-ginkgo
-ginmill
-Ginn
-Gino
-Ginsberg
-Ginsburg
-ginseng
-Giovanni
-giraffe
-gird
-girdle
-girl
-girlie
-girlish
-girth
-gist
-Giuliano
-Giuseppe
-give
-giveaway
-given
-giveth
-glacial
-glaciate
-glacier
-glacis
-glad
-gladden
-gladdy
-glade
-gladiator
-gladiolus
-Gladstone
-Gladys
-glamor
-glamorous
-glamour
-glance
-gland
-glandular
-glare
-Glasgow
-glass
-glassine
-glassware
-glassy
-Glaswegian
-glaucoma
-glaucous
-glaze
-gleam
-glean
-Gleason
-glee
-glen
-Glenda
-Glendale
-Glenn
-glib
-Glidden
-glide
-glimmer
-glimpse
-glint
-glissade
-glisten
-glitch
-glitter
-gloat
-glob
-global
-globe
-globular
-globule
-globulin
-glom
-glomerular
-gloom
-gloomy
-Gloria
-Gloriana
-glorify
-glorious
-glory
-gloss
-glossary
-glossed
-glossolalia
-glossy
-glottal
-glottis
-Gloucester
-glove
-glow
-glue
-glued
-gluey
-gluing
-glum
-glut
-glutamic
-glutinous
-glutton
-glyceride
-glycerin
-glycerinate
-glycerine
-glycerol
-glycol
-glyph
-GM
-GMT
-gnarl
-gnash
-gnat
-gnaw
-gneiss
-gnome
-gnomon
-gnomonic
-gnostic
-GNP
-gnu
-go
-Goa
-goad
-goal
-goat
-gob
-gobble
-gobbledygook
-goblet
-god
-Goddard
-goddess
-godfather
-Godfrey
-godhead
-godkin
-godlike
-godmother
-godparent
-godsend
-godson
-Godwin
-godwit
-goer
-goes
-Goethe
-Goff
-gog
-goggle
-Gogh
-gogo
-gold
-Goldberg
-golden
-goldeneye
-goldenrod
-goldenseal
-goldfinch
-goldfish
-Goldman
-goldsmith
-Goldstein
-Goldstine
-Goldwater
-Goleta
-golf
-Goliath
-golly
-gondola
-gone
-gong
-goniometer
-Gonzales
-Gonzalez
-goober
-good
-Goode
-Goodman
-Goodrich
-goodwill
-Goodwin
-goody
-Goodyear
-goof
-goofy
-goose
-gooseberry
-GOP
-gopher
-Gordian
-Gordon
-gore
-Goren
-gorge
-gorgeous
-gorgon
-Gorham
-gorilla
-Gorky
-gorse
-Gorton
-gory
-gosh
-goshawk
-gosling
-gospel
-gossamer
-gossip
-got
-Gotham
-Gothic
-gotten
-Gottfried
-gouge
-Gould
-gourd
-gourmet
-gout
-govern
-governance
-governess
-governor
-gown
-GPO
-grab
-grace
-gracious
-grackle
-grad
-gradate
-grade
-gradient
-gradual
-graduate
-Grady
-Graff
-graft
-graham
-grail
-grain
-grainy
-grammar
-grammarian
-grammatic
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-grebe
-Grecian
-Greece
-greed
-greedy
-Greek
-green
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-GSA
-Guam
-guanidine
-guano
-guarantee
-guaranteeing
-guaranty
-guard
-guardhouse
-Guardia
-guardian
-Guatemala
-gubernatorial
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-guilty
-guinea
-guise
-guitar
-gules
-gulf
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-Gutenberg
-Guthrie
-gutsy
-guttural
-guy
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-gyrocompass
-gyroscope
-h
-h's
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-halfhearted
-halfway
-halibut
-halide
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-Hamal
-Hamburg
-hamburger
-Hamilton
-Hamiltonian
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-Hampton
-hamster
-Han
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handgun
-handhold
-handicap
-handicapped
-handicapper
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-haphazard
-happen
-happenstance
-happy
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-harden
-hardhat
-Hardin
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-hardworking
-hardy
-hare
-harelip
-harem
-hark
-Harlan
-Harlem
-Harley
-harm
-Harmon
-harmonic
-harmonious
-harmony
-harness
-Harold
-harp
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-hatchet
-hatchway
-hate
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-he'd
-he'll
-head
-headache
-headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthy
-Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-heaven
-heavenward
-heavy
-heavyweight
-Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-hello
-helm
-helmet
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-herewith
-heritable
-heritage
-Herkimer
-Herman
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-hero
-Herodotus
-heroes
-heroic
-heroin
-heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hessian
-Hester
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-highwaymen
-hijack
-hike
-hilarious
-hilarity
-Hilbert
-Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-hiss
-histochemic
-histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-hobbyhorse
-hobo
-Hoboken
-hoc
-hock
-hockey
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-hoi
-Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-holystone
-homage
-home
-homebound
-homebuild
-homecome
-homeland
-homemade
-homemake
-homeomorph
-homeomorphic
-homeopath
-homeown
-Homeric
-homesick
-homestead
-homeward
-homework
-homicidal
-homicide
-homily
-homo
-homogenate
-homogeneity
-homogeneous
-homologous
-homologue
-homology
-homomorphic
-homomorphism
-homonym
-homosexual
-homotopy
-homozygous
-Honda
-hondo
-Honduras
-hone
-honest
-honesty
-honey
-honeybee
-honeycomb
-honeydew
-honeymoon
-honeysuckle
-Honeywell
-hong
-honk
-Honolulu
-honoraria
-honorarium
-honorary
-honoree
-honorific
-Honshu
-hooch
-hood
-hoodlum
-hoof
-hoofmark
-hook
-hookup
-hookworm
-hooligan
-hoop
-hoopla
-hoosegow
-Hoosier
-hoot
-Hoover
-hooves
-hop
-hope
-Hopkins
-Hopkinsian
-hopple
-hopscotch
-Horace
-Horatio
-horde
-horehound
-horizon
-horizontal
-hormone
-horn
-hornbeam
-hornblende
-Hornblower
-hornet
-hornmouth
-horntail
-horny
-horology
-horoscope
-Horowitz
-horrendous
-horrible
-horrid
-horrify
-horror
-horse
-horseback
-horsedom
-horseflesh
-horsefly
-horsehair
-horselike
-horseman
-horsemen
-horseplay
-horsepower
-horseshoe
-horsetail
-horsewoman
-horsewomen
-horticulture
-Horton
-Horus
-hose
-hosiery
-hospice
-hospitable
-hospital
-host
-hostage
-hostelry
-hostess
-hostile
-hostler
-hot
-hotbed
-hotbox
-hotel
-hotelman
-hothead
-hothouse
-hotrod
-Houdaille
-Houdini
-hough
-Houghton
-hound
-hour
-hourglass
-house
-houseboat
-housebreak
-housebroken
-housefly
-household
-housekeep
-housewife
-housewives
-housework
-Houston
-hove
-hovel
-hover
-how
-Howard
-howdy
-Howe
-Howell
-however
-howl
-howsoever
-howsomever
-hoy
-hoyden
-hoydenish
-Hoyt
-Hrothgar
-hub
-Hubbard
-Hubbell
-hubbub
-hubby
-Huber
-Hubert
-hubris
-huck
-huckleberry
-huckster
-huddle
-Hudson
-hue
-hued
-huff
-Huffman
-hug
-huge
-hugging
-Huggins
-Hugh
-Hughes
-Hugo
-huh
-hulk
-hull
-hum
-human
-humane
-humanitarian
-humble
-Humboldt
-humerus
-humid
-humidify
-humidistat
-humiliate
-humility
-Hummel
-hummingbird
-hummock
-humorous
-hump
-humpback
-Humphrey
-humpty
-humus
-Hun
-hunch
-hundred
-hundredfold
-hundredth
-hung
-Hungarian
-Hungary
-hungry
-hunk
-hunt
-Hunter
-Huntington
-Huntley
-Huntsville
-Hurd
-hurdle
-hurl
-hurley
-Huron
-hurrah
-hurray
-hurricane
-hurry
-Hurst
-hurt
-hurtle
-hurty
-Hurwitz
-husband
-husbandman
-husbandmen
-husbandry
-hush
-husky
-hustle
-Huston
-hut
-hutch
-Hutchins
-Hutchinson
-Hutchison
-Huxley
-Huxtable
-huzzah
-hyacinth
-Hyades
-hyaline
-Hyannis
-hybrid
-Hyde
-hydra
-hydrangea
-hydrant
-hydrate
-hydraulic
-hydride
-hydro
-hydrocarbon
-hydrochemistry
-hydrochloric
-hydrochloride
-hydrodynamic
-hydroelectric
-hydrofluoric
-hydrogen
-hydrogenate
-hydrology
-hydrolysis
-hydrometer
-hydrophilic
-hydrophobia
-hydrophobic
-hydrosphere
-hydrostatic
-hydrothermal
-hydrous
-hydroxide
-hydroxy
-hydroxyl
-hydroxylate
-hyena
-hygiene
-hygrometer
-hygroscopic
-hying
-hymen
-hymn
-hymnal
-hyperbola
-hyperbolic
-hyperboloid
-hyperboloidal
-hypertensive
-hyphen
-hyphenate
-hypnosis
-hypnotic
-hypoactive
-hypocrisy
-hypocrite
-hypocritic
-hypocycloid
-hypodermic
-hypophyseal
-hypotenuse
-hypothalamic
-hypothalamus
-hypotheses
-hypothesis
-hypothetic
-hypothyroid
-hysterectomy
-hysteresis
-hysteria
-hysteric
-hysteron
-i
-I'd
-I'll
-I'm
-i's
-I've
-iambic
-Iberia
-ibex
-ibid
-ibis
-IBM
-Ibn
-Icarus
-ICC
-ice
-iceberg
-icebox
-iceland
-Icelandic
-ichneumon
-icicle
-icon
-iconoclasm
-iconoclast
-icosahedra
-icosahedral
-icosahedron
-icy
-Ida
-Idaho
-idea
-ideal
-ideate
-idempotent
-identical
-identify
-identity
-ideology
-idiocy
-idiom
-idiomatic
-idiosyncrasy
-idiosyncratic
-idiot
-idiotic
-idle
-idol
-idolatry
-idyll
-idyllic
-IEEE
-if
-iffy
-Ifni
-igloo
-igneous
-ignite
-ignition
-ignoble
-ignominious
-ignoramus
-ignorant
-ignore
-ii
-iii
-Ike
-ileum
-iliac
-Iliad
-ill
-illegal
-illegible
-illegitimacy
-illegitimate
-illicit
-illimitable
-Illinois
-illiteracy
-illiterate
-illogic
-illume
-illuminate
-illumine
-illusion
-illusionary
-illusive
-illusory
-illustrate
-illustrious
-Ilona
-Ilyushin
-image
-imagery
-imaginary
-imaginate
-imagine
-imbalance
-imbecile
-imbibe
-Imbrium
-imbroglio
-imbrue
-imbue
-imitable
-imitate
-immaculate
-immanent
-immaterial
-immature
-immeasurable
-immediacy
-immediate
-immemorial
-immense
-immerse
-immersion
-immigrant
-immigrate
-imminent
-immiscible
-immobile
-immobility
-immoderate
-immodest
-immodesty
-immoral
-immortal
-immovable
-immune
-immunization
-immunoelectrophoresis
-immutable
-imp
-impact
-impair
-impale
-impalpable
-impart
-impartation
-impartial
-impassable
-impasse
-impassion
-impassive
-impatient
-impeach
-impeccable
-impedance
-impede
-impediment
-impel
-impelled
-impeller
-impelling
-impend
-impenetrable
-imperate
-imperceivable
-imperceptible
-imperfect
-imperial
-imperil
-imperious
-imperishable
-impermeable
-impermissible
-impersonal
-impersonate
-impertinent
-imperturbable
-impervious
-impetuous
-impetus
-impiety
-impinge
-impious
-impish
-implacable
-implant
-implantation
-implausible
-implement
-implementation
-implementer
-implementor
-implicant
-implicate
-implicit
-implore
-impolite
-impolitic
-imponderable
-import
-important
-importation
-importunate
-importune
-imposable
-impose
-imposition
-impossible
-impost
-imposture
-impotent
-impound
-impoverish
-impracticable
-impractical
-imprecate
-imprecise
-impregnable
-impregnate
-impresario
-impress
-impressible
-impression
-impressive
-imprimatur
-imprint
-imprison
-improbable
-impromptu
-improper
-impropriety
-improve
-improvident
-improvisate
-improvise
-imprudent
-impudent
-impugn
-impulse
-impulsive
-impunity
-impure
-imputation
-impute
-in
-inability
-inaccessible
-inaccuracy
-inaccurate
-inaction
-inactivate
-inactive
-inadequacy
-inadequate
-inadmissible
-inadvertent
-inadvisable
-inalienable
-inalterable
-inane
-inanimate
-inappeasable
-inapplicable
-inappreciable
-inapproachable
-inappropriate
-inapt
-inaptitude
-inarticulate
-inasmuch
-inattention
-inattentive
-inaudible
-inaugural
-inaugurate
-inauspicious
-inboard
-inborn
-inbred
-inbreed
-Inc
-Inca
-incalculable
-incandescent
-incant
-incantation
-incapable
-incapacitate
-incapacity
-incarcerate
-incarnate
-incautious
-incendiary
-incense
-incentive
-inception
-inceptor
-incessant
-incest
-incestuous
-inch
-incident
-incidental
-incinerate
-incipient
-incise
-incisive
-incite
-inclement
-inclination
-incline
-inclose
-include
-inclusion
-inclusive
-incoherent
-incombustible
-income
-incommensurable
-incommensurate
-incommunicable
-incommutable
-incomparable
-incompatible
-incompetent
-incomplete
-incompletion
-incomprehensible
-incomprehension
-incompressible
-incomputable
-inconceivable
-inconclusive
-incondensable
-incongruity
-incongruous
-inconsequential
-inconsiderable
-inconsiderate
-inconsistent
-inconsolable
-inconspicuous
-inconstant
-incontestable
-incontrollable
-incontrovertible
-inconvenient
-inconvertible
-incorporable
-incorporate
-incorrect
-incorrigible
-incorruptible
-increasable
-increase
-incredible
-incredulity
-incredulous
-increment
-incriminate
-incubate
-incubi
-incubus
-inculcate
-inculpable
-incumbent
-incur
-incurred
-incurrer
-incurring
-incursion
-indebted
-indecent
-indecipherable
-indecision
-indecisive
-indecomposable
-indeed
-indefatigable
-indefensible
-indefinable
-indefinite
-indelible
-indelicate
-indemnity
-indent
-indentation
-indenture
-independent
-indescribable
-indestructible
-indeterminable
-indeterminacy
-indeterminate
-index
-India
-Indian
-Indiana
-Indianapolis
-indicant
-indicate
-indices
-indict
-Indies
-indifferent
-indigene
-indigenous
-indigent
-indigestible
-indigestion
-indignant
-indignation
-indignity
-indigo
-Indira
-indirect
-indiscernible
-indiscoverable
-indiscreet
-indiscretion
-indiscriminate
-indispensable
-indispose
-indisposition
-indisputable
-indissoluble
-indistinct
-indistinguishable
-indium
-individual
-individualism
-individuate
-indivisible
-Indochina
-indoctrinate
-indolent
-indomitable
-Indonesia
-Indonesian
-indoor
-indubitable
-induce
-inducible
-induct
-inductance
-inductee
-inductor
-indulge
-indulgent
-industrial
-industrialism
-industrious
-industry
-indwell
-indy
-ineducable
-ineffable
-ineffective
-ineffectual
-inefficacy
-inefficient
-inelastic
-inelegant
-ineligible
-ineluctable
-inept
-inequality
-inequitable
-inequity
-inequivalent
-ineradicable
-inert
-inertance
-inertia
-inertial
-inescapable
-inestimable
-inevitable
-inexact
-inexcusable
-inexhaustible
-inexorable
-inexpedient
-inexpensive
-inexperience
-inexpert
-inexpiable
-inexplainable
-inexplicable
-inexplicit
-inexpressible
-inextinguishable
-inextricable
-infallible
-infamous
-infamy
-infancy
-infant
-infantile
-infantry
-infantryman
-infantrymen
-infarct
-infatuate
-infeasible
-infect
-infectious
-infelicitous
-infelicity
-infer
-inference
-inferential
-inferior
-infernal
-inferno
-inferred
-inferring
-infertile
-infest
-infestation
-infidel
-infield
-infight
-infiltrate
-infima
-infimum
-infinite
-infinitesimal
-infinitive
-infinitude
-infinitum
-infinity
-infirm
-infirmary
-infix
-inflame
-inflammable
-inflammation
-inflammatory
-inflate
-inflater
-inflationary
-inflect
-inflexible
-inflict
-inflow
-influence
-influent
-influential
-influenza
-influx
-inform
-informal
-informant
-Informatica
-information
-informative
-infra
-infract
-infrared
-infrastructure
-infrequent
-infringe
-infuriate
-infuse
-infusible
-infusion
-ingather
-ingenious
-ingenuity
-ingenuous
-Ingersoll
-ingest
-ingestible
-ingestion
-inglorious
-ingot
-Ingram
-ingrate
-ingratiate
-ingratitude
-ingredient
-ingrown
-inhabit
-inhabitant
-inhabitation
-inhalation
-inhale
-inharmonious
-inhere
-inherent
-inherit
-inheritance
-inheritor
-inhibit
-inhibition
-inhibitor
-inhibitory
-inholding
-inhomogeneity
-inhomogeneous
-inhospitable
-inhuman
-inhumane
-inimical
-inimitable
-iniquitous
-iniquity
-initial
-initiate
-inject
-injudicious
-Injun
-injunct
-injure
-injurious
-injury
-injustice
-ink
-inkling
-inlaid
-inland
-inlay
-inlet
-Inman
-inmate
-inn
-innards
-innate
-inner
-innermost
-innocent
-innovate
-innuendo
-innumerable
-inoculate
-inoperable
-inoperative
-inopportune
-inordinate
-inorganic
-input
-inquest
-inquire
-inquiry
-inquisition
-inquisitive
-inquisitor
-inroad
-insane
-insatiable
-inscribe
-inscription
-inscrutable
-insect
-insecticide
-insecure
-inseminate
-insensible
-insensitive
-inseparable
-insert
-inset
-inshore
-inside
-insidious
-insight
-insignia
-insignificant
-insincere
-insinuate
-insipid
-insist
-insistent
-insofar
-insolent
-insoluble
-insolvable
-insolvent
-insomnia
-insomniac
-insouciant
-inspect
-inspector
-inspiration
-inspire
-instable
-install
-installation
-instalment
-instance
-instant
-instantaneous
-instead
-instep
-instigate
-instill
-instillation
-instinct
-instinctual
-institute
-institution
-instruct
-instructor
-instrument
-instrumentation
-insubordinate
-insubstantial
-insufferable
-insufficient
-insular
-insulate
-insulin
-insult
-insuperable
-insupportable
-insuppressible
-insurance
-insure
-insurgent
-insurmountable
-insurrect
-intact
-intake
-intangible
-integer
-integrable
-integral
-integrand
-integrate
-integrity
-integument
-intellect
-intellectual
-intelligent
-intelligentsia
-intelligible
-intemperance
-intemperate
-intend
-intendant
-intense
-intensify
-intensive
-intent
-intention
-inter
-intercalate
-intercept
-interception
-interceptor
-intercom
-interdict
-interest
-interfere
-interference
-interferometer
-interim
-interior
-interject
-interlude
-intermediary
-intermit
-intermittent
-intern
-internal
-internescine
-Interpol
-interpolate
-interpolatory
-interpret
-interpretation
-interpretive
-interregnum
-interrogate
-interrogatory
-interrupt
-interruptible
-interruption
-intersect
-intersperse
-interstice
-interstitial
-interval
-intervene
-intervenor
-intervention
-interviewee
-intestate
-intestine
-intimacy
-intimal
-intimate
-intimater
-intimidate
-into
-intolerable
-intolerant
-intonate
-intone
-intoxicant
-intoxicate
-intractable
-intramolecular
-intransigent
-intransitive
-intrepid
-intricacy
-intricate
-intrigue
-intrinsic
-introduce
-introduction
-introductory
-introit
-introject
-introspect
-introversion
-introvert
-intrude
-intrusion
-intrusive
-intuit
-intuitable
-intuition
-intuitive
-inundate
-inure
-invade
-invalid
-invalidate
-invaluable
-invariable
-invariant
-invasion
-invasive
-invective
-inveigh
-inveigle
-invent
-invention
-inventive
-inventor
-inventory
-Inverness
-inverse
-inversion
-invert
-invertebrate
-invertible
-invest
-investigate
-investigatory
-investor
-inveterate
-inviable
-invidious
-invigorate
-invincible
-inviolable
-inviolate
-invisible
-invitation
-invite
-invitee
-invocate
-invoice
-invoke
-involuntary
-involute
-involution
-involutorial
-involve
-invulnerable
-inward
-Io
-iodate
-iodide
-iodinate
-iodine
-ion
-ionic
-ionosphere
-ionospheric
-iota
-Iowa
-ipecac
-ipsilateral
-ipso
-IQ
-IR
-Ira
-Iran
-Iraq
-irate
-ire
-Ireland
-Irene
-iridium
-iris
-Irish
-Irishman
-Irishmen
-irk
-irksome
-Irma
-iron
-ironic
-ironside
-ironstone
-ironwood
-irony
-Iroquois
-irradiate
-irrational
-Irrawaddy
-irreclaimable
-irreconcilable
-irrecoverable
-irredeemable
-irredentism
-irredentist
-irreducible
-irrefutable
-irregular
-irrelevancy
-irrelevant
-irremediable
-irremovable
-irreparable
-irreplaceable
-irrepressible
-irreproachable
-irreproducible
-irresistible
-irresolute
-irresolution
-irresolvable
-irrespective
-irresponsible
-irretrievable
-irreverent
-irreversible
-irrevocable
-irrigate
-irritable
-irritant
-irritate
-irruption
-IRS
-Irvin
-Irvine
-Irving
-Irwin
-is
-Isaac
-Isaacson
-Isabel
-Isabella
-Isaiah
-isentropic
-Isfahan
-Ising
-isinglass
-Isis
-Islam
-Islamabad
-Islamic
-island
-isle
-isn't
-isochronal
-isochronous
-isocline
-isolate
-Isolde
-isomer
-isomorph
-isomorphic
-isopleth
-isotherm
-isothermal
-isotope
-isotopic
-isotropic
-isotropy
-Israel
-Israeli
-Israelite
-issuance
-issuant
-issue
-Istanbul
-it
-IT&T
-it'd
-it'll
-Italian
-italic
-Italy
-itch
-item
-iterate
-Ithaca
-itinerant
-itinerary
-Ito
-itself
-ITT
-iv
-Ivan
-Ivanhoe
-Iverson
-ivory
-ivy
-ix
-Izvestia
-j
-j's
-jab
-Jablonsky
-jack
-jackanapes
-jackass
-jackboot
-jackdaw
-jacket
-Jackie
-jackknife
-Jackman
-jackpot
-Jackson
-Jacksonian
-Jacksonville
-Jacky
-JACM
-Jacob
-Jacobean
-Jacobi
-Jacobian
-Jacobs
-Jacobsen
-Jacobson
-Jacobus
-Jacqueline
-Jacques
-jade
-Jaeger
-jag
-jagging
-jaguar
-jail
-Jakarta
-jake
-jalopy
-jam
-Jamaica
-jamboree
-James
-Jamestown
-Jan
-Jane
-Janeiro
-Janet
-jangle
-Janice
-janissary
-janitor
-janitorial
-Janos
-Jansenist
-January
-Janus
-Japan
-Japanese
-jar
-jargon
-Jarvin
-Jason
-jasper
-jaundice
-jaunty
-Java
-javelin
-jaw
-jawbone
-jay
-jazz
-jazzy
-jealous
-jealousy
-jean
-Jeannie
-Jed
-jeep
-Jeff
-Jefferson
-Jeffersonian
-Jeffrey
-Jehovah
-jejune
-jejunum
-jelly
-jellyfish
-Jenkins
-Jennie
-Jennifer
-Jennings
-jenny
-Jensen
-jeopard
-jeopardy
-Jeremiah
-Jeremy
-Jeres
-Jericho
-jerk
-jerky
-Jeroboam
-Jerome
-jerry
-jersey
-Jerusalem
-jess
-Jesse
-Jessica
-Jessie
-jest
-Jesuit
-Jesus
-jet
-jetliner
-jettison
-Jew
-jewel
-Jewell
-jewelry
-Jewett
-Jewish
-jibe
-jiffy
-jig
-jigging
-jiggle
-jigsaw
-Jill
-jilt
-Jim
-Jimenez
-Jimmie
-jimmy
-jingle
-jinx
-jitter
-jitterbug
-jitterbugger
-jitterbugging
-jittery
-jive
-Jo
-Joan
-Joanna
-Joanne
-Joaquin
-job
-jobholder
-jock
-jockey
-jockstrap
-jocose
-jocular
-jocund
-Joe
-Joel
-joey
-jog
-jogging
-joggle
-Johann
-Johannes
-Johannesburg
-Johansen
-Johanson
-John
-Johnny
-Johns
-Johnsen
-Johnson
-Johnston
-Johnstown
-join
-joint
-joke
-Joliet
-Jolla
-jolly
-jolt
-Jon
-Jonas
-Jonathan
-Jones
-jonquil
-Jordan
-Jorge
-Jorgensen
-Jorgenson
-Jose
-Josef
-Joseph
-Josephine
-Josephson
-Josephus
-Joshua
-Josiah
-joss
-jostle
-jot
-joule
-jounce
-journal
-journalese
-journey
-journeyman
-journeymen
-joust
-Jovanovich
-Jove
-jovial
-Jovian
-jowl
-jowly
-joy
-Joyce
-joyous
-joyride
-joystick
-Jr
-Juan
-Juanita
-jubilant
-jubilate
-Judaism
-Judas
-Judd
-Jude
-judge
-judicable
-judicatory
-judicature
-judicial
-judiciary
-judicious
-Judith
-judo
-Judson
-Judy
-jug
-jugate
-jugging
-juggle
-juice
-juicy
-juju
-jujube
-juke
-Jukes
-julep
-Jules
-Julia
-Julie
-Juliet
-Julio
-Julius
-July
-jumble
-jumbo
-jump
-jumpy
-junco
-junction
-junctor
-juncture
-June
-Juneau
-jungle
-junior
-juniper
-junk
-junkerdom
-junketeer
-junky
-Juno
-junta
-Jupiter
-Jura
-jure
-juridic
-jurisdiction
-jurisprudent
-jurisprudential
-juror
-jury
-just
-justice
-justiciable
-justify
-Justine
-Justinian
-jut
-jute
-Jutish
-juvenile
-juxtapose
-juxtaposition
-k
-k's
-Kabuki
-Kabul
-Kaddish
-Kafka
-Kafkaesque
-Kahn
-kaiser
-Kajar
-Kalamazoo
-kale
-kaleidescope
-kaleidoscope
-kalmia
-Kalmuk
-Kamchatka
-kamikaze
-Kampala
-Kane
-kangaroo
-Kankakee
-Kansas
-Kant
-kaolin
-Kaplan
-kapok
-kappa
-Karachi
-Karamazov
-karate
-Karen
-Karl
-Karol
-Karp
-karyatid
-Kaskaskia
-Kate
-Katharine
-Katherine
-Kathleen
-Kathy
-Katie
-Katmandu
-Katowice
-Katz
-Kauffman
-Kaufman
-kava
-Kay
-kayo
-kazoo
-Keaton
-Keats
-keddah
-keel
-keelson
-keen
-Keenan
-keep
-keeshond
-keg
-Keith
-Keller
-Kelley
-Kellogg
-kelly
-kelp
-Kelsey
-Kelvin
-Kemp
-ken
-Kendall
-Kennan
-Kennecott
-Kennedy
-kennel
-Kenneth
-Kenney
-keno
-Kensington
-Kent
-Kenton
-Kentucky
-Kenya
-Kenyon
-Kepler
-kept
-kerchief
-Kermit
-kern
-kernel
-kerosene
-Kerr
-kerry
-kerygma
-Kessler
-kestrel
-ketch
-ketchup
-ketone
-ketosis
-Kettering
-kettle
-Kevin
-key
-keyboard
-keyed
-Keyes
-keyhole
-Keynes
-Keynesian
-keynote
-keypunch
-keys
-keystone
-keyword
-khaki
-khan
-Khartoum
-Khmer
-Khrushchev
-kibbutzim
-kibitz
-kick
-kickback
-kickoff
-kid
-Kidde
-kiddie
-kidnap
-kidney
-Kieffer
-Kiev
-Kiewit
-Kigali
-Kikuyu
-Kilgore
-kill
-killdeer
-killjoy
-kilohm
-Kim
-Kimball
-Kimberly
-kimono
-kin
-kind
-kindergarten
-kindle
-kindred
-kinematic
-kinesic
-kinesthesis
-kinetic
-king
-kingbird
-kingdom
-kingfisher
-kinglet
-kingpin
-Kingsbury
-Kingsley
-Kingston
-kink
-kinky
-Kinney
-Kinshasha
-kiosk
-Kiowa
-Kipling
-Kirby
-Kirchner
-Kirchoff
-kirk
-Kirkland
-Kirkpatrick
-Kirov
-kiss
-kissing
-kit
-Kitakyushu
-kitchen
-kitchenette
-kite
-kitten
-kittenish
-kittle
-kitty
-kiva
-kivu
-Kiwanis
-Klan
-Klaus
-klaxon
-kleenex
-Klein
-Kline
-Klux
-klystron
-knack
-Knapp
-knapsack
-Knauer
-knead
-knee
-kneecap
-kneel
-knelt
-knew
-knick
-Knickerbocker
-knife
-knifelike
-knight
-Knightsbridge
-knit
-knives
-knob
-knobby
-knock
-knockdown
-knockout
-knoll
-knot
-Knott
-knotty
-know
-knoweth
-knowhow
-knowledge
-knowledgeable
-Knowles
-Knowlton
-known
-Knox
-Knoxville
-knuckle
-knuckleball
-Knudsen
-Knudson
-knurl
-Knutsen
-Knutson
-koala
-Koch
-Kochab
-Kodachrome
-kodak
-Kodiak
-Koenig
-Koenigsberg
-kohlrabi
-koinonia
-kola
-kolkhoz
-kombu
-Kong
-Koppers
-Koran
-Korea
-kosher
-Kowalewski
-Kowalski
-kraft
-Krakatoa
-Krakow
-Kramer
-Krause
-kraut
-Kremlin
-Kresge
-Krieger
-Krishna
-Kristin
-Kronecker
-Krueger
-Kruger
-Kruse
-krypton
-Ku
-kudo
-kudzu
-Kuhn
-kulak
-kumquat
-Kurd
-Kurt
-Kuwait
-kwashiorkor
-Kyle
-Kyoto
-l
-l'oeil
-l's
-la
-lab
-Laban
-label
-labile
-laboratory
-laborious
-labour
-Labrador
-labyrinth
-lac
-lace
-lacerate
-Lacerta
-lacewing
-Lachesis
-lack
-lackadaisic
-lackey
-lacquer
-lacrosse
-lactate
-lacuna
-lacunae
-lacustrine
-lacy
-lad
-laden
-ladle
-lady
-ladyfern
-ladylike
-Lafayette
-lag
-lager
-lagging
-lagoon
-Lagos
-Lagrange
-Lagrangian
-Laguerre
-Lahore
-laid
-Laidlaw
-lain
-lair
-laissez
-laity
-lake
-Lakehurst
-lakeside
-lam
-Lamar
-lamb
-lambda
-lambert
-lame
-lamellar
-lament
-lamentation
-laminar
-laminate
-lamp
-lampblack
-lamplight
-lampoon
-lamprey
-Lana
-Lancashire
-Lancaster
-lance
-land
-landau
-landfill
-landhold
-Landis
-landlord
-landmark
-landowner
-landscape
-landslide
-lane
-Lang
-Lange
-Langley
-Langmuir
-language
-languid
-languish
-Lanka
-lanky
-Lansing
-lantern
-lanthanide
-lanthanum
-Lao
-Laocoon
-Laos
-Laotian
-lap
-lapel
-lapelled
-lapidary
-Laplace
-lappet
-lapse
-Laramie
-larceny
-larch
-lard
-Laredo
-Lares
-large
-largemouth
-largesse
-lariat
-lark
-Larkin
-larkspur
-Larry
-Lars
-Larsen
-Larson
-larva
-larvae
-larval
-laryngeal
-larynges
-larynx
-lascar
-lascivious
-lase
-lash
-lass
-lasso
-last
-latch
-late
-latent
-later
-latera
-lateral
-Lateran
-laterite
-latest
-latex
-lath
-lathe
-Lathrop
-Latin
-Latinate
-latitude
-latitudinal
-latitudinary
-Latrobe
-latter
-lattice
-latus
-laud
-laudanum
-laudatory
-Lauderdale
-Laue
-laugh
-laughingstock
-Laughlin
-laughter
-launch
-launder
-laundry
-laura
-laureate
-laurel
-Lauren
-Laurence
-Laurent
-Laurentian
-Laurie
-Lausanne
-lava
-lavabo
-lavatory
-lavender
-lavish
-Lavoisier
-law
-lawbreak
-lawgive
-lawmake
-lawman
-lawmen
-lawn
-Lawrence
-lawrencium
-Lawson
-lawsuit
-lawyer
-lax
-laxative
-lay
-layette
-layman
-laymen
-layoff
-layout
-Layton
-layup
-Lazarus
-laze
-lazy
-lazybones
-lea
-leach
-leachate
-lead
-leaden
-leadeth
-leadsman
-leadsmen
-leaf
-leaflet
-leafy
-league
-leak
-leakage
-leaky
-lean
-Leander
-leap
-leapfrog
-leapt
-Lear
-learn
-lease
-leasehold
-leash
-least
-leather
-leatherback
-leatherneck
-leatherwork
-leathery
-leave
-leaven
-Leavenworth
-Lebanese
-Lebanon
-lebensraum
-Lebesgue
-lecher
-lechery
-lectionary
-lecture
-led
-ledge
-lee
-leech
-Leeds
-leek
-leer
-leery
-leeward
-leeway
-left
-leftmost
-leftover
-leftward
-lefty
-leg
-legacy
-legal
-legate
-legatee
-legato
-legend
-legendary
-Legendre
-legerdemain
-legging
-leggy
-leghorn
-legible
-legion
-legislate
-legislature
-legitimacy
-legitimate
-legume
-leguminous
-Lehigh
-Lehman
-Leigh
-Leighton
-Leila
-leisure
-leitmotif
-leitmotiv
-Leland
-lemma
-lemming
-lemon
-lemonade
-Lemuel
-Len
-Lena
-lend
-length
-lengthen
-lengthwise
-lengthy
-lenient
-Lenin
-Leningrad
-Leninism
-Leninist
-Lennox
-Lenny
-lens
-lent
-Lenten
-lenticular
-lentil
-Leo
-Leon
-Leona
-Leonard
-Leonardo
-Leone
-Leonid
-leonine
-leopard
-Leopold
-leper
-leprosy
-Leroy
-Lesbian
-lesion
-Leslie
-Lesotho
-less
-lessee
-lessen
-lesson
-lessor
-lest
-Lester
-let
-lethal
-lethargy
-Lethe
-Letitia
-letterhead
-letterman
-lettermen
-lettuce
-leukemia
-levee
-level
-lever
-leverage
-Levi
-Levin
-Levine
-Levis
-levitate
-Leviticus
-Levitt
-levity
-levy
-lew
-lewd
-lewis
-lexical
-lexicography
-lexicon
-Lexington
-Leyden
-liable
-liaison
-liar
-libation
-libel
-libelous
-liberal
-liberate
-Liberia
-libertarian
-libertine
-liberty
-libidinous
-libido
-librarian
-library
-librate
-librettist
-libretto
-Libreville
-Libya
-lice
-licensable
-licensee
-licensor
-licentious
-lichen
-lick
-licorice
-lid
-lie
-Liechtenstein
-lied
-lien
-lieu
-lieutenant
-life
-lifeblood
-lifeboat
-lifeguard
-lifelike
-lifelong
-lifespan
-lifestyle
-lifetime
-LIFO
-lift
-ligament
-ligand
-ligature
-Ligget
-Liggett
-light
-lighten
-lightface
-lighthearted
-lighthouse
-lightning
-lightproof
-lightweight
-lignite
-lignum
-like
-liken
-likewise
-Lila
-lilac
-Lilian
-Lillian
-Lilliputian
-Lilly
-lilt
-lily
-Lima
-limb
-limbic
-limbo
-lime
-limelight
-Limerick
-limestone
-limit
-limitate
-limousine
-limp
-limpet
-limpid
-limpkin
-Lin
-Lincoln
-Lind
-Linda
-Lindberg
-Lindbergh
-linden
-Lindholm
-Lindquist
-Lindsay
-Lindsey
-Lindstrom
-line
-lineage
-lineal
-linear
-linebacker
-lineman
-linemen
-linen
-lineup
-linger
-lingerie
-lingo
-lingua
-lingual
-linguist
-liniment
-link
-linkage
-linoleum
-Linotype
-linseed
-lint
-Linus
-lion
-Lionel
-lioness
-lip
-lipid
-Lippincott
-Lipschitz
-Lipscomb
-lipstick
-Lipton
-liquefy
-liqueur
-liquid
-liquidate
-liquidus
-liquor
-Lisa
-Lisbon
-Lise
-lisle
-lisp
-Lissajous
-list
-listen
-lit
-litany
-literacy
-literal
-literary
-literate
-literature
-lithe
-lithic
-lithium
-lithograph
-lithography
-lithology
-lithosphere
-lithospheric
-litigant
-litigate
-litigious
-litmus
-litterbug
-little
-littleneck
-Littleton
-Litton
-littoral
-liturgic
-liturgy
-live
-Livermore
-Liverpool
-livery
-livestock
-liveth
-livid
-Livingston
-livre
-Liz
-lizard
-Lizzie
-Lloyd
-lo
-load
-loaf
-loam
-loamy
-loan
-loath
-loathe
-loathsome
-loaves
-lob
-lobar
-lobby
-lobe
-loblolly
-lobo
-lobscouse
-lobster
-lobular
-lobule
-local
-locale
-locate
-loci
-lock
-Locke
-Lockhart
-Lockheed
-Lockian
-locknut
-lockout
-locksmith
-lockup
-Lockwood
-locomote
-locomotion
-locomotive
-locomotor
-locomotory
-locus
-locust
-locutor
-lodestone
-lodge
-lodgepole
-Lodowick
-Loeb
-loess
-loft
-lofty
-log
-Logan
-logarithm
-logarithmic
-loge
-loggerhead
-logging
-logic
-logistic
-logjam
-loin
-loincloth
-Loire
-Lois
-loiter
-Loki
-Lola
-loll
-lollipop
-lolly
-Lomb
-Lombard
-Lombardy
-Lome
-London
-lone
-lonesome
-long
-longevity
-Longfellow
-longhand
-longhorn
-longish
-longitude
-longitudinal
-longleg
-longstanding
-longtime
-longue
-look
-lookout
-lookup
-loom
-Loomis
-loon
-loop
-loophole
-loose
-looseleaf
-loosen
-loosestrife
-loot
-lop
-lope
-Lopez
-lopseed
-lopsided
-loquacious
-loquacity
-lord
-lore
-Lorelei
-Loren
-Lorinda
-Lorraine
-Los
-losable
-lose
-loss
-lossy
-lost
-lot
-lotion
-Lotte
-lottery
-Lottie
-lotus
-Lou
-loud
-loudspeak
-Louis
-Louisa
-Louise
-Louisiana
-Louisville
-lounge
-Lounsbury
-Lourdes
-louse
-lousy
-louver
-Louvre
-love
-lovebird
-Lovelace
-Loveland
-lovelorn
-low
-lowboy
-lowdown
-Lowe
-Lowell
-lower
-lowland
-Lowry
-loy
-loyal
-loyalty
-lozenge
-LSI
-LTV
-Lubbock
-Lubell
-lubricant
-lubricate
-lubricious
-lubricity
-Lucas
-Lucerne
-Lucia
-Lucian
-lucid
-Lucifer
-Lucille
-Lucius
-luck
-lucky
-lucrative
-lucre
-Lucretia
-Lucretius
-lucy
-ludicrous
-Ludlow
-Ludwig
-Lufthansa
-Luftwaffe
-lug
-luge
-luger
-luggage
-lugging
-Luis
-luke
-lukemia
-lukewarm
-lull
-lullaby
-lulu
-lumbar
-lumber
-lumberman
-lumbermen
-lumen
-luminance
-luminary
-luminescent
-luminosity
-luminous
-lummox
-lump
-lumpish
-Lumpur
-lumpy
-lunacy
-lunar
-lunary
-lunate
-lunatic
-lunch
-luncheon
-lunchroom
-lunchtime
-Lund
-Lundberg
-Lundquist
-lung
-lunge
-lupine
-Lura
-lurch
-lure
-lurid
-lurk
-Lusaka
-luscious
-lush
-lust
-lustrous
-lusty
-lutanist
-lute
-lutetium
-Luther
-Lutheran
-Lutz
-lux
-luxe
-Luxembourg
-luxuriant
-luxuriate
-luxurious
-luxury
-Luzon
-lycopodium
-Lydia
-lye
-lying
-Lykes
-Lyle
-Lyman
-lymph
-lymphocyte
-lymphoma
-lynch
-Lynchburg
-Lynn
-lynx
-Lyon
-Lyons
-Lyra
-lyric
-lyricism
-lysergic
-m
-m's
-ma
-Mabel
-Mac
-macabre
-macaque
-MacArthur
-Macassar
-Macbeth
-MacDonald
-mace
-Macedon
-Macedonia
-MacGregor
-Mach
-Machiavelli
-machination
-machine
-machinelike
-machinery
-machismo
-macho
-macintosh
-mack
-MacKenzie
-mackerel
-Mackey
-Mackinac
-Mackinaw
-mackintosh
-MacMillan
-Macon
-macro
-macromolecular
-macromolecule
-macrophage
-macroscopic
-macrostructure
-mad
-Madagascar
-madam
-Madame
-madcap
-madden
-Maddox
-made
-Madeira
-Madeleine
-Madeline
-madhouse
-Madison
-madman
-madmen
-Madonna
-Madras
-Madrid
-madrigal
-Madsen
-madstone
-Mae
-Maelstrom
-maestro
-magazine
-Magdalene
-magenta
-Maggie
-maggot
-maggoty
-magi
-magic
-magician
-magisterial
-magistrate
-magna
-magnanimity
-magnanimous
-magnate
-magnesia
-magnesite
-magnesium
-magnet
-magnetic
-magnetite
-magneto
-magnetron
-magnificent
-magnify
-magnitude
-magnolia
-magnum
-Magnuson
-Magog
-magpie
-Magruder
-Mahayana
-Mahayanist
-mahogany
-Mahoney
-maid
-maiden
-maidenhair
-maidservant
-Maier
-mail
-mailbox
-mailman
-mailmen
-maim
-main
-Maine
-mainland
-mainline
-mainstream
-maintain
-maintenance
-maitre
-majestic
-majesty
-major
-make
-makeshift
-makeup
-Malabar
-maladapt
-maladaptive
-maladjust
-maladroit
-malady
-Malagasy
-malaise
-malaprop
-malaria
-malarial
-Malawi
-Malay
-Malaysia
-Malcolm
-malconduct
-malcontent
-Malden
-maldistribute
-Maldive
-male
-maledict
-malevolent
-malfeasant
-malformation
-malformed
-malfunction
-Mali
-malice
-malicious
-malign
-malignant
-mall
-mallard
-malleable
-mallet
-Mallory
-mallow
-malnourished
-malnutrition
-malocclusion
-Malone
-Maloney
-malposed
-malpractice
-Malraux
-malt
-Malta
-Maltese
-Malton
-maltreat
-mambo
-mamma
-mammal
-mammalian
-mammoth
-man
-mana
-manage
-manageable
-managerial
-Managua
-Manama
-manatee
-Manchester
-mandamus
-mandarin
-mandate
-mandatory
-mandrake
-mandrel
-mandrill
-mane
-maneuver
-Manfred
-manganese
-mange
-mangel
-mangle
-Manhattan
-manhole
-manhood
-mania
-maniac
-maniacal
-manic
-manifest
-manifestation
-manifold
-manikin
-Manila
-manipulable
-manipulate
-Manitoba
-mankind
-Manley
-Mann
-manna
-mannequin
-mannerism
-manometer
-manor
-manpower
-Mans
-manse
-manservant
-Mansfield
-mansion
-manslaughter
-mantel
-mantic
-mantis
-mantissa
-mantle
-mantlepiece
-mantrap
-manual
-Manuel
-manufacture
-manumission
-manumit
-manumitted
-manure
-manuscript
-Manville
-many
-manzanita
-Mao
-Maori
-map
-maple
-mar
-marathon
-maraud
-marble
-Marc
-Marceau
-Marcel
-Marcello
-march
-Marcia
-Marco
-Marcus
-Marcy
-Mardi
-mare
-Margaret
-margarine
-Margery
-margin
-marginal
-marginalia
-Margo
-Marguerite
-maria
-Marie
-Marietta
-marigold
-marijuana
-Marilyn
-marimba
-Marin
-marina
-marinade
-marinate
-marine
-Marino
-Mario
-Marion
-marionette
-marital
-maritime
-marjoram
-Marjorie
-Marjory
-mark
-market
-marketeer
-marketplace
-marketwise
-Markham
-Markov
-Markovian
-Marks
-marksman
-marksmen
-Marlboro
-Marlborough
-Marlene
-marlin
-Marlowe
-marmalade
-marmot
-maroon
-marque
-marquee
-marquess
-Marquette
-marquis
-marriage
-marriageable
-married
-Marrietta
-Marriott
-marrow
-marrowbone
-marry
-Mars
-Marseilles
-marsh
-Marsha
-marshal
-Marshall
-marshland
-marshmallow
-mart
-marten
-martensite
-Martha
-martial
-Martian
-martin
-Martinez
-martingale
-martini
-Martinique
-Martinson
-Marty
-martyr
-martyrdom
-marvel
-marvelous
-Marvin
-Marx
-Mary
-Maryland
-mascara
-masculine
-maser
-Maseru
-mash
-mask
-mason
-Masonic
-Masonite
-masonry
-masque
-masquerade
-mass
-Massachusetts
-massacre
-massage
-masseur
-Massey
-massif
-massive
-mast
-mastermind
-masterpiece
-mastery
-mastic
-mastiff
-mastodon
-mat
-match
-matchbook
-matchmake
-mate
-Mateo
-mater
-material
-materiel
-maternal
-maternity
-math
-mathematic
-mathematician
-Mathematik
-Mathews
-Mathewson
-Mathias
-Mathieu
-Matilda
-matinal
-matinee
-matins
-Matisse
-matriarch
-matriarchal
-matrices
-matriculate
-matrimonial
-matrimony
-matrix
-matroid
-matron
-Matson
-matte
-Matthew
-Matthews
-mattock
-mattress
-Mattson
-maturate
-mature
-maudlin
-maul
-Maureen
-Maurice
-Maurine
-Mauritania
-Mauritius
-mausoleum
-mauve
-maverick
-Mavis
-maw
-mawkish
-Mawr
-Max
-maxim
-maxima
-maximal
-Maximilian
-maximum
-Maxine
-maxwell
-Maxwellian
-may
-Maya
-mayapple
-maybe
-Mayer
-Mayfair
-Mayflower
-mayhem
-Maynard
-Mayo
-mayonnaise
-mayor
-mayoral
-mayst
-Mazda
-maze
-mazurka
-MBA
-Mbabane
-McAdams
-McAllister
-McBride
-McCabe
-McCall
-McCann
-McCarthy
-McCarty
-McCauley
-McClain
-McClellan
-McClure
-McCluskey
-McConnel
-McConnell
-McCormick
-McCoy
-McCracken
-McCullough
-McDaniel
-McDermott
-McDonald
-McDonnell
-McDougall
-McDowell
-McElroy
-McFadden
-McFarland
-McGee
-McGill
-McGinnis
-McGovern
-McGowan
-McGrath
-McGraw
-McGregor
-McGuire
-McHugh
-McIntosh
-McIntyre
-McKay
-McKee
-McKenna
-McKenzie
-McKeon
-McKesson
-McKinley
-McKinney
-McKnight
-McLaughlin
-McLean
-McLeod
-McMahon
-McMillan
-McMullen
-McNally
-McNaughton
-McNeil
-McPherson
-me
-mead
-meadow
-meadowland
-meadowsweet
-meager
-meal
-mealtime
-mealy
-mean
-meander
-meant
-meantime
-meanwhile
-measle
-measure
-meat
-meaty
-Mecca
-mechanic
-mechanism
-mechanist
-mecum
-medal
-medallion
-meddle
-Medea
-media
-medial
-median
-mediate
-medic
-medicate
-Medici
-medicinal
-medicine
-medico
-mediocre
-mediocrity
-meditate
-Mediterranean
-medium
-medley
-Medusa
-meek
-meet
-meetinghouse
-Meg
-megabit
-megabyte
-megahertz
-megalomania
-megalomaniac
-megaton
-megavolt
-megawatt
-megaword
-megohm
-Meier
-Meistersinger
-Mekong
-Mel
-melamine
-melancholy
-Melanesia
-melange
-Melanie
-melanin
-melanoma
-Melbourne
-Melcher
-meld
-melee
-Melinda
-meliorate
-Melissa
-Mellon
-mellow
-melodic
-melodious
-melodrama
-melodramatic
-melody
-melon
-Melpomene
-melt
-Melville
-Melvin
-member
-membrane
-memento
-memo
-memoir
-memorabilia
-memorable
-memoranda
-memorandum
-memorial
-memory
-Memphis
-men
-menace
-menagerie
-menarche
-mend
-mendacious
-mendacity
-mendelevium
-Mendelssohn
-Menelaus
-menfolk
-menhaden
-menial
-meniscus
-Menlo
-Mennonite
-menstruate
-mensurable
-mensuration
-mental
-mention
-mentor
-menu
-Menzies
-Mephistopheles
-mercantile
-Mercator
-Mercedes
-mercenary
-mercer
-merchandise
-merchant
-mercilessly
-Merck
-mercurial
-mercuric
-mercury
-mercy
-mere
-Meredith
-meretricious
-merganser
-merge
-meridian
-meridional
-meringue
-merit
-meritorious
-Merle
-merlin
-mermaid
-Merriam
-Merrill
-Merrimack
-merriment
-Merritt
-merry
-merrymake
-Mervin
-mesa
-mescal
-mescaline
-mesenteric
-mesh
-mesmeric
-meson
-Mesozoic
-mesquite
-mess
-message
-messenger
-Messiah
-messieurs
-Messrs
-messy
-met
-metabole
-metabolic
-metabolism
-metabolite
-metal
-metallic
-metalliferous
-metallography
-metalloid
-metallurgic
-metallurgist
-metallurgy
-metalwork
-metamorphic
-metamorphism
-metamorphose
-metamorphosis
-metaphor
-metaphoric
-Metcalf
-mete
-meteor
-meteoric
-meteorite
-meteoritic
-meteorology
-meter
-methacrylate
-methane
-methanol
-method
-methodic
-Methodism
-Methodist
-methodology
-Methuen
-Methuselah
-methyl
-methylene
-meticulous
-metier
-metric
-metro
-metronome
-metropolis
-metropolitan
-mettle
-mettlesome
-Metzler
-mew
-Mexican
-Mexico
-Meyer
-Meyers
-mezzo
-mi
-Miami
-miasma
-miasmal
-mica
-mice
-Michael
-Michaelangelo
-Michelangelo
-Michelin
-Michelson
-michigan
-Mickelson
-Mickey
-Micky
-micro
-microbial
-microcosm
-microfiche
-micrography
-microjoule
-micron
-Micronesia
-microscopy
-mid
-Midas
-midband
-midday
-middle
-Middlebury
-middleman
-middlemen
-Middlesex
-Middleton
-Middletown
-middleweight
-midge
-midget
-midland
-midmorn
-midnight
-midpoint
-midrange
-midscale
-midsection
-midshipman
-midshipmen
-midspan
-midst
-midstream
-midway
-midweek
-Midwest
-Midwestern
-midwife
-midwinter
-midwives
-mien
-miff
-mig
-might
-mightn't
-mighty
-mignon
-migrant
-migrate
-migratory
-Miguel
-mike
-mila
-Milan
-milch
-mild
-mildew
-Mildred
-mile
-mileage
-Miles
-milestone
-milieu
-militant
-militarism
-militarist
-military
-militate
-militia
-militiamen
-milk
-milkweed
-milky
-mill
-Millard
-millenarian
-millenia
-millennia
-millennium
-miller
-millet
-Millie
-Millikan
-millinery
-million
-millionaire
-millionth
-millipede
-Mills
-millstone
-milord
-milt
-Milton
-Miltonic
-Milwaukee
-mimeograph
-mimesis
-mimetic
-Mimi
-mimic
-mimicked
-mimicking
-minaret
-mince
-mincemeat
-mind
-Mindanao
-mine
-minefield
-mineral
-mineralogy
-Minerva
-minestrone
-minesweeper
-mingle
-mini
-miniature
-minibike
-minicomputer
-minim
-minima
-minimal
-minimax
-minimum
-minion
-ministerial
-ministry
-mink
-Minneapolis
-Minnesota
-Minnie
-minnow
-Minoan
-minor
-Minos
-minot
-Minsky
-minstrel
-minstrelsy
-mint
-minuend
-minuet
-minus
-minuscule
-minute
-minuteman
-minutemen
-minutiae
-Miocene
-Mira
-miracle
-miraculous
-mirage
-Miranda
-mire
-Mirfak
-Miriam
-mirror
-mirth
-misanthrope
-misanthropic
-miscegenation
-miscellaneous
-miscellany
-mischievous
-miscible
-miscreant
-miser
-misery
-misnomer
-misogynist
-misogyny
-mispronunciation
-miss
-misshapen
-missile
-mission
-missionary
-Mississippi
-Mississippian
-missive
-Missoula
-Missouri
-Missy
-mist
-mistletoe
-misty
-MIT
-Mitchell
-mite
-mitigate
-mitral
-mitre
-mitt
-mitten
-mix
-mixture
-mixup
-Mizar
-mnemonic
-moan
-moat
-mob
-mobcap
-Mobil
-mobile
-mobility
-mobster
-moccasin
-mock
-mockernut
-mockery
-mockingbird
-mockup
-modal
-mode
-model
-modem
-moderate
-modern
-modest
-Modesto
-modesty
-modicum
-modify
-modish
-modular
-modulate
-module
-moduli
-modulo
-modulus
-Moe
-Moen
-Mogadiscio
-Mohammedan
-Mohawk
-Mohr
-moiety
-Moines
-moire
-Moiseyev
-moist
-moisten
-moisture
-molal
-molar
-molasses
-mold
-moldboard
-mole
-molecular
-molecule
-molehill
-molest
-Moliere
-Moline
-Moll
-Mollie
-mollify
-mollusk
-Molly
-mollycoddle
-Moloch
-molt
-molten
-Moluccas
-molybdate
-molybdenite
-molybdenum
-moment
-momenta
-momentary
-momentous
-momentum
-mommy
-Mona
-Monaco
-monad
-monadic
-monarch
-monarchic
-monarchy
-monastery
-monastic
-monaural
-Monday
-monel
-monetarism
-monetary
-money
-moneymake
-Mongolia
-mongoose
-Monica
-monies
-monitor
-monitory
-monk
-monkey
-monkeyflower
-monkish
-Monmouth
-Monoceros
-monochromatic
-monochromator
-monocotyledon
-monocular
-monogamous
-monogamy
-monolith
-monologist
-monologue
-monomer
-monomeric
-monomial
-Monongahela
-monopoly
-monotonous
-monoxide
-Monroe
-Monrovia
-Monsanto
-monsieur
-monsoon
-monster
-monstrosity
-monstrous
-Mont
-montage
-Montague
-Montana
-Montclair
-monte
-Montenegrin
-Monterey
-Monteverdi
-Montevideo
-Montgomery
-month
-Monticello
-Montmartre
-Montpelier
-Montrachet
-Montreal
-Monty
-monument
-moo
-mood
-moody
-moon
-Mooney
-moonlight
-moonlike
-moonlit
-moor
-Moore
-Moorish
-moose
-moot
-mop
-moraine
-moral
-morale
-Moran
-morass
-moratorium
-Moravia
-morbid
-more
-morel
-Moreland
-moreover
-Moresby
-Morgan
-morgen
-morgue
-Moriarty
-moribund
-Morley
-Mormon
-morn
-Moroccan
-Morocco
-moron
-morose
-morpheme
-morphemic
-morphine
-morphology
-morphophonemic
-Morrill
-morris
-Morrison
-Morrissey
-Morristown
-morrow
-Morse
-morsel
-mort
-mortal
-mortar
-mortem
-mortgage
-mortgagee
-mortgagor
-mortician
-mortify
-mortise
-Morton
-mosaic
-Moscow
-Moser
-Moses
-Moslem
-mosque
-mosquito
-moss
-mossy
-most
-mot
-motel
-motet
-moth
-mother
-motherhood
-motherland
-motif
-motion
-motivate
-motive
-motley
-motor
-motorcycle
-Motorola
-mottle
-motto
-mould
-Moulton
-mound
-mount
-mountain
-mountaineer
-mountainous
-mountainside
-mourn
-mouse
-moustache
-mousy
-mouth
-mouthpiece
-Mouton
-move
-movie
-mow
-Moyer
-Mozart
-MPH
-Mr
-Mrs
-Ms
-mu
-much
-mucilage
-muck
-mucosa
-mucus
-mud
-Mudd
-muddle
-muddlehead
-muddy
-mudguard
-mudsling
-Mueller
-muezzin
-muff
-muffin
-muffle
-mug
-mugging
-muggy
-mugho
-Muir
-Mukden
-mulatto
-mulberry
-mulch
-mulct
-mule
-mulish
-mull
-mullah
-mullein
-Mullen
-mulligan
-mulligatawny
-mullion
-multi
-multifarious
-multinomial
-multiple
-multiplet
-multiplex
-multiplexor
-multipliable
-multiplicand
-multiplication
-multiplicative
-multiplicity
-multiply
-multitude
-multitudinous
-mum
-mumble
-Mumford
-mummy
-munch
-Muncie
-mundane
-mung
-Munich
-municipal
-munificent
-munition
-Munson
-muon
-Muong
-mural
-murder
-murderous
-muriatic
-Muriel
-murk
-murky
-murmur
-Murphy
-Murray
-murre
-Muscat
-muscle
-Muscovy
-muscular
-musculature
-muse
-museum
-mush
-mushroom
-mushy
-music
-musicale
-musician
-musicology
-musk
-Muskegon
-muskellunge
-musket
-muskmelon
-muskox
-muskoxen
-muskrat
-muslim
-muslin
-mussel
-must
-mustache
-mustachio
-mustang
-mustard
-mustn't
-musty
-mutagen
-mutandis
-mutant
-mutate
-mutatis
-mute
-mutilate
-mutineer
-mutiny
-mutt
-mutter
-mutton
-mutual
-mutuel
-Muzak
-Muzo
-muzzle
-my
-Mycenae
-Mycenaean
-mycobacteria
-mycology
-myel
-myeline
-myeloid
-Myers
-mylar
-mynah
-Mynheer
-myocardial
-myocardium
-myofibril
-myopia
-myopic
-myosin
-Myra
-myriad
-Myron
-myrrh
-myrtle
-myself
-mysterious
-mystery
-mystic
-mystify
-mystique
-myth
-mythic
-mythology
-n
-n's
-NAACP
-nab
-Nabisco
-nabla
-Nadine
-nadir
-nag
-Nagasaki
-nagging
-Nagoya
-Nagy
-naiad
-nail
-Nair
-Nairobi
-naive
-naivete
-naked
-name
-nameable
-nameplate
-namesake
-Nan
-Nancy
-Nanette
-Nanking
-nanosecond
-Nantucket
-Naomi
-nap
-nape
-napkin
-Naples
-Napoleon
-Napoleonic
-Narbonne
-narcissist
-narcissus
-narcosis
-narcotic
-Narragansett
-narrate
-narrow
-nary
-NASA
-nasal
-nascent
-Nash
-Nashua
-Nashville
-Nassau
-nasturtium
-nasty
-Nat
-natal
-Natalie
-Natchez
-Nathan
-Nathaniel
-nation
-nationhood
-nationwide
-native
-NATO
-natty
-natural
-nature
-naturopath
-naughty
-nausea
-nauseate
-nauseum
-nautical
-nautilus
-Navajo
-naval
-nave
-navel
-navigable
-navigate
-navy
-nay
-Nazarene
-Nazareth
-Nazi
-Nazism
-NBC
-NBS
-NC
-NCAA
-NCR
-ND
-Ndjamena
-ne
-Neal
-Neanderthal
-neap
-Neapolitan
-near
-nearby
-nearest
-nearsighted
-neat
-neater
-neath
-Nebraska
-nebula
-nebulae
-nebular
-nebulous
-necessary
-necessitate
-necessity
-neck
-necklace
-neckline
-necktie
-necromancer
-necromancy
-necromantic
-necropsy
-necrosis
-necrotic
-nectar
-nectareous
-nectary
-Ned
-nee
-need
-needham
-needle
-needlepoint
-needn't
-needy
-Neff
-negate
-neglect
-negligee
-negligent
-negligible
-negotiable
-negotiate
-Negro
-Negroes
-Negroid
-Nehru
-Neil
-neither
-Nell
-Nellie
-Nelsen
-Nelson
-nemesis
-neoclassic
-neodymium
-neolithic
-neologism
-neon
-neonatal
-neonate
-neophyte
-neoprene
-Nepal
-nepenthe
-nephew
-Neptune
-neptunium
-nereid
-Nero
-nerve
-nervous
-Ness
-nest
-nestle
-Nestor
-net
-nether
-Netherlands
-netherworld
-nettle
-nettlesome
-network
-Neumann
-neural
-neuralgia
-neurasthenic
-neuritis
-neuroanatomic
-neuroanatomy
-neuroanotomy
-neurology
-neuromuscular
-neuron
-neuronal
-neuropathology
-neurophysiology
-neuropsychiatric
-neuroses
-neurosis
-neurotic
-neuter
-neutral
-neutrino
-neutron
-Neva
-Nevada
-neve
-nevertheless
-Nevins
-new
-Newark
-Newbold
-newborn
-Newcastle
-newcomer
-newel
-Newell
-newfound
-Newfoundland
-newlywed
-Newman
-Newport
-newsboy
-newscast
-newsletter
-newsman
-newsmen
-newspaper
-newspaperman
-newspapermen
-newsreel
-newsstand
-Newsweek
-newt
-newton
-Newtonian
-next
-Nguyen
-NH
-Niagara
-Niamey
-nib
-nibble
-Nibelung
-nibs
-Nicaragua
-nice
-nicety
-niche
-Nicholas
-Nicholls
-Nichols
-Nicholson
-nichrome
-nick
-nickel
-nickname
-Nicodemus
-Nicosia
-nicotine
-niece
-Nielsen
-Nielson
-Nietzsche
-Niger
-Nigeria
-niggardly
-nigger
-niggle
-nigh
-night
-nightcap
-nightclub
-nightdress
-nightfall
-nightgown
-nighthawk
-nightingale
-nightmare
-nightmarish
-nightshirt
-nighttime
-NIH
-nihilism
-nihilist
-Nikko
-Nikolai
-nil
-Nile
-nilpotent
-nimble
-nimbus
-NIMH
-Nina
-nine
-ninebark
-ninefold
-nineteen
-nineteenth
-ninetieth
-ninety
-Nineveh
-ninth
-Niobe
-niobium
-nip
-nipple
-Nippon
-nirvana
-nit
-nitpick
-nitrate
-nitric
-nitride
-nitrite
-nitrogen
-nitrogenous
-nitroglycerine
-nitrous
-nitty
-Nixon
-NJ
-NM
-no
-NOAA
-Noah
-nob
-Nobel
-nobelium
-noble
-nobleman
-noblemen
-noblesse
-nobody
-nobody'd
-nocturnal
-nocturne
-nod
-nodal
-node
-nodular
-nodule
-Noel
-noise
-noisemake
-noisy
-Nolan
-Noll
-nolo
-nomadic
-nomenclature
-nominal
-nominate
-nominee
-nomograph
-non
-nonce
-nonchalant
-nondescript
-none
-nonetheless
-nonogenarian
-nonsensic
-noodle
-nook
-noon
-noontime
-noose
-nor
-Nordhoff
-Nordstrom
-Noreen
-Norfolk
-norm
-Norma
-normal
-normalcy
-Norman
-Normandy
-normative
-Norris
-north
-Northampton
-northbound
-northeast
-northeastern
-northerly
-northern
-northernmost
-northland
-Northrop
-Northrup
-Northumberland
-northward
-northwest
-northwestern
-Norton
-Norwalk
-Norway
-Norwegian
-Norwich
-nose
-nosebag
-nosebleed
-nostalgia
-nostalgic
-Nostradamus
-Nostrand
-nostril
-not
-notary
-notate
-notch
-note
-notebook
-noteworthy
-nothing
-notice
-noticeable
-notify
-notion
-notoriety
-notorious
-Nottingham
-notwithstanding
-Nouakchott
-noun
-nourish
-nouveau
-Nov
-nova
-Novak
-novel
-novelty
-November
-novice
-novitiate
-novo
-Novosibirsk
-now
-nowaday
-nowhere
-nowise
-noxious
-nozzle
-NRC
-NSF
-NTIS
-nu
-nuance
-Nubia
-nubile
-nucleant
-nuclear
-nucleate
-nuclei
-nucleic
-nucleoli
-nucleolus
-nucleotide
-nucleus
-nuclide
-nude
-nudge
-nugatory
-nugget
-nuisance
-null
-nullify
-numb
-numerable
-numeral
-numerate
-numeric
-Numerische
-numerology
-numerous
-numinous
-numismatic
-numismatist
-nun
-nuptial
-nurse
-nursery
-nurture
-nut
-nutate
-nutcrack
-nuthatch
-nutmeg
-nutria
-nutrient
-nutrition
-nutritious
-nutritive
-nutshell
-nuzzle
-NY
-NYC
-nylon
-nymph
-nymphomania
-nymphomaniac
-Nyquist
-NYU
-o
-O'Brien
-o'clock
-O'Connell
-O'Connor
-O'Dell
-O'Donnell
-O'Dwyer
-o'er
-O'Hare
-O'Leary
-o's
-O'Shea
-O'Sullivan
-oaf
-oak
-oaken
-Oakland
-Oakley
-oakwood
-oar
-oases
-oasis
-oat
-oath
-oatmeal
-obduracy
-obdurate
-obedient
-obeisant
-obelisk
-Oberlin
-obese
-obey
-obfuscate
-obfuscatory
-obituary
-object
-objectify
-objectivity
-objector
-objet
-oblate
-obligate
-obligatory
-oblige
-oblique
-obliterate
-oblivion
-oblivious
-oblong
-obnoxious
-oboe
-oboist
-obscene
-obscure
-obsequious
-obsequy
-observant
-observation
-observatory
-observe
-obsess
-obsession
-obsessive
-obsidian
-obsolescent
-obsolete
-obstacle
-obstetric
-obstinacy
-obstinate
-obstruct
-obtain
-obtrude
-obtrusive
-obverse
-obviate
-obvious
-ocarina
-occasion
-occident
-occidental
-occipital
-occlude
-occlusion
-occlusive
-occult
-occultate
-occupant
-occupation
-occupy
-occur
-occurred
-occurrent
-occurring
-ocean
-Oceania
-oceanic
-oceanography
-oceanside
-ocelot
-Oct
-octagon
-octagonal
-octahedra
-octahedral
-octahedron
-octal
-octane
-octant
-octave
-Octavia
-octennial
-octet
-octile
-octillion
-October
-octogenarian
-octopus
-octoroon
-ocular
-odd
-ode
-Odessa
-Odin
-odious
-odium
-odometer
-odorous
-Odysseus
-Odyssey
-Oedipal
-Oedipus
-oersted
-of
-off
-offal
-offbeat
-Offenbach
-offend
-offensive
-offer
-offertory
-offhand
-office
-officeholder
-officemate
-official
-officialdom
-officiate
-officio
-officious
-offload
-offsaddle
-offset
-offsetting
-offshoot
-offshore
-offspring
-offstage
-oft
-often
-oftentimes
-Ogden
-ogle
-ogre
-ogress
-oh
-Ohio
-ohm
-ohmic
-ohmmeter
-oil
-oilcloth
-oilman
-oilmen
-oilseed
-oily
-oint
-OK
-Okay
-Okinawa
-Oklahoma
-Olaf
-old
-olden
-Oldenburg
-Oldsmobile
-oldster
-oldy
-oleander
-olefin
-oleomargarine
-olfactory
-Olga
-oligarchic
-oligarchy
-oligoclase
-oligopoly
-Olin
-olive
-Oliver
-Olivetti
-Olivia
-olivine
-Olsen
-Olson
-Olympia
-Olympic
-Omaha
-Oman
-ombudsman
-omega
-omelet
-omen
-omicron
-ominous
-omission
-omit
-omitted
-omitting
-omnibus
-omnipotent
-omnipresent
-omniscient
-on
-once
-oncology
-oncoming
-one
-Oneida
-onerous
-oneself
-onetime
-oneupmanship
-ongoing
-onion
-onlook
-only
-onomatopoeic
-Onondaga
-onrush
-onrushing
-onset
-onslaught
-Ontario
-onto
-ontogeny
-ontology
-onus
-onward
-onyx
-oodles
-ooze
-opacity
-opal
-opalescent
-opaque
-OPEC
-Opel
-open
-opera
-operable
-operand
-operant
-operate
-operatic
-operetta
-Ophiucus
-opiate
-opinion
-opinionate
-opium
-opossum
-Oppenheimer
-opponent
-opportune
-opposable
-oppose
-opposite
-opposition
-oppress
-oppression
-oppressive
-oppressor
-opprobrium
-opt
-opthalmic
-opthalmologic
-opthalmology
-optic
-optima
-optimal
-optimism
-optimist
-optimistic
-optimum
-option
-optoacoustic
-optoisolate
-optometrist
-optometry
-opulent
-opus
-or
-oracle
-oral
-orange
-orangeroot
-orangutan
-orate
-oratoric
-oratorio
-oratory
-orb
-orbit
-orbital
-orchard
-orchestra
-orchestral
-orchestrate
-orchid
-orchis
-ordain
-ordeal
-order
-orderly
-ordinal
-ordinance
-ordinary
-ordinate
-ordnance
-ore
-oregano
-Oregon
-Oresteia
-Orestes
-organ
-organdy
-organic
-organismic
-organometallic
-orgasm
-orgiastic
-orgy
-orient
-oriental
-orifice
-origin
-original
-originate
-Orin
-Orinoco
-oriole
-Orion
-Orkney
-Orlando
-Orleans
-ornament
-ornamentation
-ornate
-ornately
-ornery
-orographic
-orography
-Orono
-orphan
-orphanage
-Orpheus
-Orphic
-Orr
-Ortega
-orthant
-orthicon
-orthoclase
-orthodontic
-orthodontist
-orthodox
-orthodoxy
-orthogonal
-orthography
-orthonormal
-orthopedic
-orthophosphate
-orthorhombic
-Orville
-Orwell
-Orwellian
-Osaka
-Osborn
-Osborne
-Oscar
-oscillate
-oscillatory
-oscilloscope
-Osgood
-Oshkosh
-osier
-Osiris
-Oslo
-osmium
-osmosis
-osmotic
-osprey
-osseous
-ossify
-ostensible
-ostentatious
-osteology
-osteopath
-osteopathic
-osteopathy
-osteoporosis
-ostracism
-ostracod
-Ostrander
-ostrich
-Oswald
-Othello
-other
-otherwise
-otherworld
-otherworldly
-Otis
-Ott
-Ottawa
-otter
-Otto
-Ottoman
-Ouagadougou
-ouch
-ought
-oughtn't
-ounce
-our
-ourselves
-oust
-out
-outermost
-outlandish
-outlawry
-outrageous
-ouzel
-ouzo
-ova
-oval
-ovary
-ovate
-oven
-ovenbird
-over
-overhang
-overt
-overture
-Ovid
-oviform
-ow
-owe
-Owens
-owing
-owl
-owly
-own
-ox
-oxalate
-oxalic
-oxcart
-oxen
-oxeye
-Oxford
-oxidant
-oxidate
-oxide
-Oxnard
-oxygen
-oxygenate
-oyster
-Ozark
-ozone
-p
-p's
-pa
-Pablo
-Pabst
-pace
-pacemake
-pacific
-pacifism
-pacifist
-pacify
-pack
-package
-Packard
-packet
-pact
-pad
-paddle
-paddock
-paddy
-padlock
-padre
-paean
-pagan
-page
-pageant
-pageantry
-paginate
-pagoda
-paid
-pail
-pain
-Paine
-painstaking
-paint
-paintbrush
-pair
-pairwise
-Pakistan
-Pakistani
-pal
-palace
-palate
-Palatine
-palazzi
-palazzo
-pale
-Paleolithic
-Paleozoic
-Palermo
-Palestine
-palette
-palfrey
-palindrome
-palindromic
-palisade
-pall
-palladia
-Palladian
-palladium
-pallet
-palliate
-pallid
-palm
-palmate
-palmetto
-Palmolive
-Palmyra
-Palo
-Palomar
-palpable
-palsy
-Pam
-Pamela
-pampa
-pamper
-pamphlet
-pan
-panacea
-panama
-pancake
-Pancho
-pancreatic
-panda
-Pandanus
-pandemic
-pandemonium
-pander
-Pandora
-pane
-panel
-pang
-panic
-panicked
-panicky
-panicle
-panjandrum
-panoply
-panorama
-panoramic
-pansy
-pant
-pantheism
-pantheist
-pantheon
-panther
-pantomime
-pantomimic
-pantry
-panty
-Paoli
-pap
-papa
-papal
-papaw
-paper
-paperback
-paperweight
-paperwork
-papery
-papillary
-papoose
-Pappas
-pappy
-paprika
-Papua
-papyri
-papyrus
-par
-parabola
-parabolic
-paraboloid
-paraboloidal
-parachute
-parade
-paradigm
-paradigmatic
-paradise
-paradox
-paradoxic
-paraffin
-paragon
-paragraph
-Paraguay
-parakeet
-paralinguistic
-parallax
-parallel
-parallelepiped
-paralysis
-paramagnet
-paramagnetic
-parameter
-paramilitary
-paramount
-Paramus
-paranoia
-paranoiac
-paranoid
-paranormal
-parapet
-paraphernalia
-paraphrase
-parapsychology
-parasite
-parasitic
-parasol
-parasympathetic
-paratroop
-paraxial
-parboil
-parcel
-parch
-pardon
-pare
-paregoric
-parent
-parentage
-parental
-parentheses
-parenthesis
-parenthetic
-parenthood
-Pareto
-pariah
-parimutuel
-Paris
-parish
-parishioner
-Parisian
-park
-Parke
-Parkinson
-parkish
-parkland
-parklike
-Parks
-parkway
-parlance
-parlay
-parley
-parliament
-parliamentarian
-parliamentary
-parochial
-parody
-parole
-parolee
-parquet
-Parr
-Parrish
-parrot
-parrotlike
-parry
-parse
-Parsifal
-parsimonious
-parsimony
-parsley
-parsnip
-parson
-parsonage
-Parsons
-part
-partake
-Parthenon
-partial
-participant
-participate
-participle
-particle
-particular
-particulate
-partisan
-partition
-partner
-partook
-partridge
-party
-parvenu
-Pasadena
-Pascal
-paschal
-pasha
-Paso
-pass
-passage
-passageway
-Passaic
-passband
-passe
-passenger
-passer
-passerby
-passion
-passionate
-passivate
-passive
-Passover
-passport
-password
-past
-paste
-pasteboard
-pastel
-pasteup
-Pasteur
-pastiche
-pastime
-pastor
-pastoral
-pastry
-pasture
-pasty
-pat
-Patagonia
-patch
-patchwork
-patchy
-pate
-patent
-patentee
-pater
-paternal
-paternoster
-Paterson
-path
-pathetic
-pathogen
-pathogenesis
-pathogenic
-pathology
-pathos
-pathway
-patient
-patina
-patio
-patriarch
-patriarchal
-patriarchy
-Patrice
-Patricia
-patrician
-Patrick
-patrimonial
-patrimony
-patriot
-patriotic
-patristic
-patrol
-patrolled
-patrolling
-patrolman
-patrolmen
-patron
-patronage
-patroness
-Patsy
-pattern
-Patterson
-Patti
-Patton
-patty
-paucity
-Paul
-Paula
-Paulette
-Pauli
-Pauline
-Paulo
-Paulsen
-Paulson
-Paulus
-paunch
-paunchy
-pauper
-pause
-pavanne
-pave
-pavilion
-Pavlov
-paw
-pawn
-pawnshop
-Pawtucket
-pax
-pay
-paycheck
-payday
-paymaster
-Payne
-payoff
-payroll
-Paz
-PBS
-pea
-Peabody
-peace
-peaceable
-peacemake
-peacetime
-peach
-Peachtree
-peacock
-peafowl
-peak
-peaky
-peal
-Peale
-peanut
-pear
-Pearce
-pearl
-pearlstone
-Pearson
-peasant
-peasanthood
-Pease
-peat
-pebble
-pecan
-peccary
-peck
-Pecos
-pectoral
-pectoralis
-peculate
-peculiar
-pecuniary
-pedagogic
-pedagogue
-pedagogy
-pedal
-pedant
-pedantic
-pedantry
-peddle
-pedestal
-pedestrian
-pediatric
-pediatrician
-pedigree
-pediment
-Pedro
-pee
-peed
-peek
-peel
-peep
-peephole
-peepy
-peer
-peg
-Pegasus
-pegboard
-pegging
-Peggy
-pejorative
-Peking
-Pelham
-pelican
-pellagra
-pellet
-pelt
-peltry
-pelvic
-pelvis
-Pembroke
-pemmican
-pen
-penal
-penalty
-penance
-penates
-pence
-penchant
-pencil
-pend
-pendant
-pendulum
-Penelope
-penetrable
-penetrate
-penguin
-Penh
-penicillin
-peninsula
-penitent
-penitential
-penitentiary
-penman
-penmen
-Penn
-penna
-pennant
-Pennsylvania
-penny
-pennyroyal
-Penrose
-Pensacola
-pension
-pensive
-pent
-pentagon
-pentagonal
-pentane
-Pentecost
-pentecostal
-penthouse
-penultimate
-penumbra
-penurious
-penury
-peony
-people
-Peoria
-pep
-peppergrass
-peppermint
-pepperoni
-peppery
-peppy
-Pepsi
-PepsiCo
-peptide
-per
-perceive
-percent
-percentage
-percentile
-percept
-perceptible
-perception
-perceptive
-perceptual
-perch
-perchance
-perchlorate
-Percival
-percolate
-percussion
-percussive
-Percy
-perdition
-peremptory
-perennial
-Perez
-perfect
-perfectible
-perfidious
-perfidy
-perforate
-perforce
-perform
-performance
-perfume
-perfumery
-perfunctory
-perfusion
-Pergamon
-perhaps
-Periclean
-Pericles
-perihelion
-peril
-Perilla
-perilous
-perimeter
-period
-periodic
-peripatetic
-peripheral
-periphery
-periphrastic
-periscope
-perish
-peritectic
-periwinkle
-perjure
-perjury
-perk
-Perkins
-perky
-Perle
-permalloy
-permanent
-permeable
-permeate
-Permian
-permissible
-permission
-permissive
-permit
-permitted
-permitting
-permutation
-permute
-pernicious
-peroxide
-perpendicular
-perpetrate
-perpetual
-perpetuate
-perpetuity
-perplex
-perquisite
-Perry
-persecute
-persecution
-persecutory
-Perseus
-perseverance
-persevere
-Pershing
-Persia
-Persian
-persiflage
-persimmon
-persist
-persistent
-person
-persona
-personage
-personal
-personify
-personnel
-perspective
-perspicacious
-perspicous
-perspicuity
-perspicuous
-perspiration
-perspire
-persuade
-persuasion
-persuasive
-pert
-pertain
-Perth
-pertinacious
-pertinent
-perturb
-perturbate
-Peru
-perusal
-peruse
-Peruvian
-pervade
-pervasion
-pervasive
-perverse
-perversion
-pervert
-pessimal
-pessimism
-pessimist
-pessimum
-pest
-peste
-pesticide
-pestilent
-pestilential
-pestle
-pet
-petal
-Pete
-Peter
-Peters
-Petersburg
-Petersen
-Peterson
-petit
-petite
-petition
-petrel
-petri
-petrify
-petrochemical
-petroglyph
-petrol
-petroleum
-petrology
-petticoat
-petty
-petulant
-petunia
-Peugeot
-pew
-pewee
-pewter
-pfennig
-Pfizer
-phagocyte
-phalanger
-phalanx
-phalarope
-phantasy
-phantom
-pharmaceutic
-pharmacist
-pharmacology
-pharmacopoeia
-pharmacy
-phase
-PhD
-pheasant
-Phelps
-phenol
-phenolic
-phenomena
-phenomenal
-phenomenology
-phenomenon
-phenotype
-phenyl
-phi
-Phil
-Philadelphia
-philanthrope
-philanthropic
-philanthropy
-philharmonic
-Philip
-Philippine
-Philistine
-Phillips
-philodendron
-philology
-philosoph
-philosophic
-philosophy
-Phipps
-phloem
-phlox
-phobic
-phoebe
-Phoenicia
-phoenix
-phon
-phone
-phoneme
-phonemic
-phonetic
-phonic
-phonograph
-phonology
-phonon
-phony
-phosgene
-phosphate
-phosphide
-phosphine
-phosphor
-phosphoresce
-phosphorescent
-phosphoric
-phosphorus
-photo
-photogenic
-photography
-photolysis
-photolytic
-photon
-phrase
-phrasemake
-phraseology
-phthalate
-phycomycetes
-phyla
-Phyllis
-phylogeny
-physic
-physician
-Physik
-physiochemical
-physiognomy
-physiology
-physiotherapist
-physiotherapy
-physique
-phytoplankton
-pi
-pianissimo
-pianist
-piano
-piazza
-pica
-Picasso
-picayune
-Piccadilly
-piccolo
-pick
-pickaxe
-pickerel
-Pickering
-picket
-Pickett
-Pickford
-pickle
-Pickman
-pickoff
-pickup
-picky
-picnic
-picnicked
-picnicker
-picnicking
-picofarad
-picojoule
-picosecond
-pictorial
-picture
-picturesque
-piddle
-pidgin
-pie
-piece
-piecemeal
-piecewise
-Piedmont
-pier
-pierce
-Pierre
-Pierson
-pietism
-piety
-piezoelectric
-pig
-pigeon
-pigeonberry
-pigeonfoot
-pigeonhole
-pigging
-piggish
-piggy
-pigment
-pigmentation
-pigpen
-pigroot
-pigskin
-pigtail
-pike
-Pilate
-pile
-pilfer
-pilferage
-pilgrim
-pilgrimage
-pill
-pillage
-pillar
-pillory
-pillow
-Pillsbury
-pilot
-pimp
-pimple
-pin
-pinafore
-pinball
-pinch
-pincushion
-pine
-pineapple
-Pinehurst
-ping
-pinhead
-pinhole
-pinion
-pink
-pinkie
-pinkish
-pinnacle
-pinnate
-pinochle
-pinpoint
-pinscher
-Pinsky
-pint
-pintail
-pinto
-pinwheel
-pinxter
-pion
-pioneer
-pious
-pip
-pipe
-pipeline
-Piper
-pipette
-pipsissewa
-piquant
-pique
-piracy
-Piraeus
-pirate
-pirogue
-pirouette
-Piscataway
-Pisces
-piss
-pistachio
-pistol
-pistole
-piston
-pit
-pitch
-pitchblende
-pitchfork
-pitchstone
-piteous
-pitfall
-pith
-pithy
-pitiable
-pitilessly
-pitman
-Pitney
-Pitt
-Pittsburgh
-Pittsfield
-Pittston
-pituitary
-pity
-Pius
-pivot
-pivotal
-pixel
-pixy
-pizza
-pizzicato
-placate
-placater
-place
-placeable
-placebo
-placeholder
-placenta
-placental
-placid
-plagiarism
-plagiarist
-plagioclase
-plague
-plagued
-plaguey
-plaid
-plain
-Plainfield
-plaintiff
-plaintive
-plan
-planar
-Planck
-plane
-planeload
-planet
-planetaria
-planetarium
-planetary
-planetesimal
-planetoid
-plank
-plankton
-planoconcave
-planoconvex
-plant
-plantain
-plantation
-plaque
-plasm
-plasma
-plasmon
-plaster
-plastic
-plastisol
-plastron
-plat
-plate
-plateau
-platelet
-platen
-platform
-platinize
-platinum
-platitude
-platitudinous
-Plato
-platonic
-Platonism
-Platonist
-platoon
-Platte
-plausible
-play
-playa
-playback
-playboy
-playground
-playhouse
-playmate
-playoff
-playroom
-playtime
-playwright
-playwriting
-plaza
-plea
-plead
-pleasant
-please
-pleasure
-pleat
-plebeian
-plebian
-pledge
-Pleiades
-Pleistocene
-plenary
-plenipotentiary
-plenitude
-plenty
-plenum
-plethora
-pleura
-pleural
-Plexiglas
-pliable
-pliancy
-pliant
-pliers
-plight
-Pliny
-Pliocene
-plod
-plop
-plot
-plover
-plowman
-plowshare
-pluck
-plucky
-plug
-plugboard
-pluggable
-plugging
-plum
-plumage
-plumb
-plumbago
-plumbate
-plume
-plummet
-plump
-plunder
-plunge
-plunk
-plural
-plus
-plush
-plushy
-Plutarch
-Pluto
-plutonium
-ply
-Plymouth
-plyscore
-plywood
-PM
-pneumatic
-pneumonia
-Po
-poach
-pocket
-pocketbook
-Pocono
-pod
-podge
-podia
-podium
-Poe
-poem
-poesy
-poet
-poetic
-poetry
-pogo
-pogrom
-poi
-poignant
-Poincare
-poinsettia
-point
-poise
-poison
-poisonous
-Poisson
-poke
-pokerface
-pol
-Poland
-polar
-polarimeter
-Polaris
-polariscope
-polariton
-polarogram
-polarograph
-polarography
-Polaroid
-polaron
-pole
-polecat
-polemic
-police
-policeman
-policemen
-policy
-polio
-polis
-polish
-Politburo
-polite
-politic
-politician
-politicking
-politico
-polity
-Polk
-polka
-poll
-Pollard
-pollcadot
-pollen
-pollock
-polloi
-pollutant
-pollute
-pollution
-Pollux
-polo
-polonaise
-polonium
-polopony
-polygon
-polygonal
-polygynous
-polyhedra
-polyhedral
-polyhedron
-Polyhymnia
-polymer
-polymerase
-polymeric
-polymorph
-polymorphic
-polynomial
-Polyphemus
-polyphony
-polypropylene
-polytechnic
-polytope
-polytypy
-pomade
-pomegranate
-Pomona
-pomp
-pompadour
-pompano
-Pompeii
-pompey
-pompon
-pomposity
-pompous
-Ponce
-Ponchartrain
-poncho
-pond
-ponder
-ponderous
-pong
-Pontiac
-pontiff
-pontific
-pontificate
-pony
-pooch
-poodle
-pooh
-pool
-Poole
-poop
-poor
-pop
-pope
-popish
-poplar
-poplin
-poppy
-populace
-popular
-populate
-populous
-porcelain
-porch
-porcine
-porcupine
-pore
-pork
-pornographer
-pornography
-porosity
-porous
-porphyry
-porpoise
-porridge
-port
-portage
-portal
-Porte
-portend
-portent
-portentous
-porterhouse
-portfolio
-Portia
-portico
-portland
-portmanteau
-Porto
-portrait
-portraiture
-portray
-portrayal
-Portsmouth
-Portugal
-Portuguese
-portulaca
-posable
-pose
-Poseidon
-poseur
-posey
-posh
-posit
-position
-positive
-positron
-posse
-posseman
-possemen
-possess
-possession
-possessive
-possessor
-possible
-possum
-post
-postage
-postal
-postcard
-postcondition
-postdoctoral
-posterior
-posteriori
-posterity
-postfix
-postgraduate
-posthumous
-postlude
-postman
-postmark
-postmaster
-postmen
-postmortem
-postmultiply
-postoperative
-postorder
-postpone
-postprocess
-postprocessor
-postscript
-postulate
-posture
-postwar
-posy
-pot
-potable
-potash
-potassium
-potato
-potatoes
-potbelly
-potboil
-potent
-potentate
-potential
-potentiometer
-pothole
-potion
-potlatch
-Potomac
-potpourri
-pottery
-Potts
-pouch
-Poughkeepsie
-poultice
-poultry
-pounce
-pound
-pour
-pout
-poverty
-pow
-powder
-powderpuff
-powdery
-Powell
-power
-powerhouse
-Powers
-Poynting
-ppm
-practicable
-practical
-practice
-practise
-practitioner
-Prado
-pragmatic
-pragmatism
-pragmatist
-Prague
-prairie
-praise
-praiseworthy
-pram
-prance
-prank
-praseodymium
-Pratt
-Pravda
-pray
-prayer
-preach
-preachy
-preamble
-Precambrian
-precarious
-precaution
-precautionary
-precede
-precedent
-precept
-precess
-precession
-precinct
-precious
-precipice
-precipitable
-precipitate
-precipitous
-precis
-precise
-precision
-preclude
-precocious
-precocity
-precursor
-predatory
-predecessor
-predicament
-predicate
-predict
-predictor
-predilect
-predispose
-predisposition
-predominant
-predominate
-preeminent
-preempt
-preemption
-preemptive
-preemptor
-preen
-prefab
-prefabricate
-preface
-prefatory
-prefect
-prefecture
-prefer
-preference
-preferential
-preferred
-preferring
-prefix
-pregnant
-prehistoric
-prejudice
-prejudicial
-preliminary
-prelude
-premature
-premeditate
-premier
-premiere
-premise
-premium
-premonition
-premonitory
-Prentice
-preoccupy
-prep
-preparation
-preparative
-preparatory
-prepare
-preponderant
-preponderate
-preposition
-preposterous
-prerequisite
-prerogative
-presage
-Presbyterian
-presbytery
-Prescott
-prescribe
-prescript
-prescription
-prescriptive
-presence
-present
-presentation
-presentational
-preservation
-preserve
-preside
-president
-presidential
-press
-pressure
-prestidigitate
-prestige
-prestigious
-presto
-Preston
-presume
-presumed
-presuming
-presumption
-presumptive
-presumptuous
-presuppose
-presupposition
-pretend
-pretense
-pretension
-pretentious
-pretext
-Pretoria
-pretty
-prevail
-prevalent
-prevent
-prevention
-preventive
-preview
-previous
-prexy
-prey
-Priam
-price
-prick
-prickle
-pride
-priest
-Priestley
-prig
-priggish
-prim
-prima
-primacy
-primal
-primary
-primate
-prime
-primeval
-primitive
-primitivism
-primp
-primrose
-prince
-princess
-Princeton
-principal
-Principia
-principle
-print
-printmake
-printout
-prior
-priori
-priory
-Priscilla
-prism
-prismatic
-prison
-prissy
-pristine
-Pritchard
-privacy
-private
-privet
-privilege
-privy
-prize
-pro
-probabilist
-probate
-probe
-probity
-problem
-problematic
-procaine
-procedural
-procedure
-proceed
-process
-procession
-processor
-proclaim
-proclamation
-proclivity
-procrastinate
-procreate
-procrustean
-Procrustes
-Procter
-proctor
-procure
-Procyon
-prod
-prodigal
-prodigious
-prodigy
-produce
-producible
-product
-productivity
-Prof
-profane
-profess
-profession
-professional
-professor
-professorial
-proffer
-proficient
-profile
-profit
-profligate
-profound
-profundity
-profuse
-profusion
-progenitor
-progeny
-prognosis
-prognosticate
-programmable
-programmed
-programmer
-programming
-progress
-progression
-progressive
-prohibit
-prohibition
-prohibitive
-prohibitory
-project
-projectile
-projector
-Prokofieff
-prolate
-proletariat
-proliferate
-prolific
-prolix
-prologue
-prolong
-prolongate
-prolusion
-prom
-promenade
-Promethean
-Prometheus
-promethium
-prominent
-promiscuous
-promise
-promote
-promotion
-prompt
-promptitude
-promulgate
-prone
-prong
-pronoun
-pronounce
-pronounceable
-pronto
-pronunciation
-proof
-proofread
-prop
-propaganda
-propagandist
-propagate
-propane
-propel
-propellant
-propelled
-propeller
-propelling
-propensity
-proper
-property
-prophecy
-prophesy
-prophet
-prophetic
-propionate
-propitiate
-propitious
-proponent
-proportion
-proportionate
-propos
-proposal
-propose
-proposition
-proprietary
-proprietor
-propriety
-proprioception
-proprioceptive
-propulsion
-propyl
-propylene
-prorate
-prorogue
-prosaic
-proscenium
-proscribe
-proscription
-prose
-prosecute
-prosecution
-prosecutor
-Proserpine
-prosodic
-prosody
-prosopopoeia
-prospect
-prospector
-prospectus
-prosper
-prosperous
-prostate
-prosthetic
-prostitute
-prostitution
-prostrate
-protactinium
-protagonist
-protean
-protease
-protect
-protector
-protectorate
-protege
-protein
-proteolysis
-proteolytic
-protest
-protestant
-protestation
-prothonotary
-protocol
-proton
-protoplasm
-protoplasmic
-prototype
-prototypic
-Protozoa
-protozoan
-protract
-protrude
-protrusion
-protrusive
-protuberant
-proud
-Proust
-prove
-proven
-provenance
-proverb
-proverbial
-provide
-provident
-providential
-province
-provincial
-provision
-provisional
-proviso
-provocateur
-provocation
-provocative
-provoke
-provost
-prow
-prowess
-prowl
-proximal
-proximate
-proximity
-proxy
-prudent
-prudential
-prune
-prurient
-Prussia
-pry
-psalm
-psalter
-pseudo
-psi
-psych
-psyche
-psychiatric
-psychiatrist
-psychiatry
-psychic
-psycho
-psychoacoustic
-psychoanalysis
-psychoanalyst
-psychoanalytic
-psychobiology
-psychology
-psychometry
-psychopath
-psychopathic
-psychophysic
-psychophysical
-psychophysics
-psychophysiology
-psychopomp
-psychoses
-psychosis
-psychosomatic
-psychotherapeutic
-psychotherapist
-psychotherapy
-psychotic
-psyllium
-PTA
-ptarmigan
-Ptolemaic
-Ptolemy
-pub
-puberty
-pubescent
-public
-publication
-publish
-Puccini
-puck
-puckish
-pudding
-puddingstone
-puddle
-puddly
-pueblo
-puerile
-Puerto
-puff
-puffball
-puffed
-puffery
-puffin
-puffy
-pug
-Pugh
-puissant
-puke
-Pulaski
-Pulitzer
-pull
-pulley
-Pullman
-pullover
-pulmonary
-pulp
-pulpit
-pulsar
-pulsate
-pulse
-pulverable
-puma
-pumice
-pummel
-pump
-pumpkin
-pumpkinseed
-pun
-punch
-punctual
-punctuate
-puncture
-pundit
-punditry
-pungent
-Punic
-punish
-punitive
-punk
-punky
-punster
-punt
-puny
-pup
-pupal
-pupate
-pupil
-puppet
-puppeteer
-puppy
-puppyish
-Purcell
-purchasable
-purchase
-Purdue
-pure
-purgation
-purgative
-purgatory
-purge
-purify
-Purina
-Puritan
-puritanic
-purl
-purloin
-purple
-purport
-purpose
-purposive
-purr
-purse
-purslane
-pursuant
-pursue
-pursuer
-pursuit
-purvey
-purveyor
-purview
-pus
-Pusan
-Pusey
-push
-pushbutton
-pussy
-pussycat
-put
-putative
-Putnam
-putt
-putty
-puzzle
-PVC
-Pygmalion
-pygmy
-Pyhrric
-pyknotic
-Pyle
-Pyongyang
-pyracanth
-pyramid
-pyramidal
-pyre
-Pyrex
-pyridine
-pyrite
-pyroelectric
-pyrolyse
-pyrolysis
-pyrometer
-pyrophosphate
-pyrotechnic
-pyroxene
-Pythagoras
-Pythagorean
-python
-q
-q's
-Qatar
-QED
-qua
-quack
-quackery
-quad
-quadrangle
-quadrangular
-quadrant
-quadratic
-quadrature
-quadrennial
-quadric
-quadriceps
-quadrilateral
-quadrille
-quadrillion
-quadripartite
-quadrivium
-quadruple
-quadrupole
-quaff
-quagmire
-quahog
-quail
-quaint
-quake
-Quakeress
-qualified
-qualify
-qualitative
-quality
-qualm
-quandary
-quanta
-Quantico
-quantify
-quantile
-quantitative
-quantity
-quantum
-quarantine
-quark
-quarrel
-quarrelsome
-quarry
-quarryman
-quarrymen
-quart
-quarterback
-quartermaster
-quartet
-quartic
-quartile
-quartz
-quasar
-quash
-quasi
-quasicontinuous
-quasiorder
-quasiparticle
-quasiperiodic
-quasistationary
-quaternary
-quatrain
-quaver
-quay
-queasy
-Quebec
-queen
-queer
-quell
-quench
-querulous
-query
-quest
-question
-questionnaire
-quetzal
-queue
-Quezon
-quibble
-quick
-quicken
-quickie
-quicklime
-quicksand
-quicksilver
-quickstep
-quid
-quiescent
-quiet
-quietus
-quill
-quilt
-quince
-quinine
-Quinn
-quint
-quintet
-quintic
-quintillion
-quintus
-quip
-quipping
-Quirinal
-quirk
-quirky
-quirt
-quit
-quite
-Quito
-quitting
-quiver
-Quixote
-quixotic
-quiz
-quizzical
-quo
-quod
-quonset
-quorum
-quota
-quotation
-quote
-quotient
-r
-R&D
-r's
-rabat
-rabbet
-rabbi
-rabbit
-rabble
-rabid
-rabies
-Rabin
-raccoon
-race
-racetrack
-raceway
-Rachel
-Rachmaninoff
-racial
-rack
-racket
-racketeer
-rackety
-racy
-radar
-Radcliffe
-radial
-radian
-radiant
-radiate
-radical
-radices
-radii
-radio
-radioactive
-radioastronomy
-radiocarbon
-radiochemical
-radiochemistry
-radiography
-radiology
-radiometer
-radiophysics
-radiosonde
-radiosterilize
-radiotherapy
-radish
-radium
-radius
-radix
-radon
-Rae
-Rafael
-Rafferty
-raffia
-raffish
-raft
-rag
-rage
-ragging
-ragout
-ragweed
-raid
-rail
-railbird
-railhead
-raillery
-railroad
-railway
-rain
-rainbow
-raincoat
-raindrop
-rainfall
-rainstorm
-rainy
-raise
-raisin
-raj
-rajah
-rake
-rakish
-Raleigh
-rally
-Ralph
-Ralston
-ram
-Ramada
-Raman
-ramble
-ramify
-Ramo
-ramp
-rampage
-rampant
-rampart
-ramrod
-Ramsey
-ran
-ranch
-rancho
-rancid
-rancorous
-Rand
-Randall
-Randolph
-random
-randy
-rang
-range
-rangeland
-Rangoon
-rangy
-Ranier
-rank
-Rankin
-rankle
-ransack
-ransom
-rant
-Raoul
-rap
-rapacious
-rape
-Raphael
-rapid
-rapier
-rapport
-rapprochement
-rapt
-rapture
-rare
-rarefy
-Raritan
-rasa
-rascal
-rash
-Rasmussen
-rasp
-raspberry
-raster
-Rastus
-rat
-rata
-rate
-rater
-rather
-ratify
-ratio
-ratiocinate
-rationale
-rattail
-rattle
-rattlesnake
-raucous
-ravage
-rave
-ravel
-raven
-ravenous
-ravine
-ravish
-raw
-rawboned
-rawhide
-Rawlinson
-ray
-Rayleigh
-Raymond
-Raytheon
-raze
-razor
-razorback
-RCA
-re
-reach
-reactant
-reactionary
-read
-readout
-ready
-Reagan
-reagent
-real
-realisable
-realm
-realtor
-realty
-ream
-reap
-rear
-reason
-reave
-reb
-Rebecca
-rebel
-rebelled
-rebelling
-rebellion
-rebellious
-rebuke
-rebut
-rebuttal
-rebutted
-rebutting
-recalcitrant
-recant
-recappable
-recede
-receipt
-receive
-recent
-receptacle
-reception
-receptive
-receptor
-recess
-recession
-recessive
-recherche
-Recife
-recipe
-recipient
-reciprocal
-reciprocate
-reciprocity
-recital
-recitative
-reck
-reckon
-reclamation
-recline
-recluse
-recompense
-reconcile
-recondite
-reconnaissance
-record
-recoup
-recourse
-recovery
-recriminate
-recruit
-rectangle
-rectangular
-rectifier
-rectify
-rectilinear
-rectitude
-rector
-rectory
-recumbent
-recuperate
-recur
-recurred
-recurrent
-recurring
-recursion
-recursive
-recusant
-recuse
-red
-redact
-redactor
-redbird
-redbud
-redcoat
-redden
-reddish
-redeem
-redemption
-redemptive
-redhead
-Redmond
-redneck
-redound
-redpoll
-redshank
-redstart
-Redstone
-redtop
-reduce
-reducible
-reduct
-redundant
-redwood
-reed
-reedbuck
-reedy
-reef
-reek
-reel
-Reese
-reeve
-Reeves
-refection
-refectory
-refer
-referable
-referee
-refereeing
-referenda
-referendum
-referent
-referential
-referral
-referred
-referring
-refinery
-reflect
-reflectance
-reflector
-reflexive
-reforestation
-reformatory
-refract
-refractometer
-refractory
-refrain
-refrigerate
-refuge
-refugee
-refusal
-refutation
-refute
-regal
-regale
-regalia
-regard
-regatta
-regent
-regime
-regimen
-regiment
-regimentation
-Regina
-Reginald
-region
-regional
-Regis
-registrable
-registrant
-registrar
-registration
-registry
-regress
-regression
-regressive
-regret
-regrettable
-regretted
-regretting
-regular
-regulate
-regulatory
-Regulus
-regurgitate
-rehabilitate
-rehearsal
-rehearse
-Reich
-Reid
-reign
-Reilly
-reimbursable
-reimburse
-rein
-reindeer
-reinforce
-Reinhold
-reinstate
-reject
-rejoice
-rejoinder
-relate
-relax
-relaxation
-relay
-releasable
-relevant
-reliable
-reliant
-relic
-relict
-relief
-relieve
-religion
-religiosity
-religious
-relinquish
-reliquary
-relish
-reluctant
-remainder
-reman
-remand
-remark
-Rembrandt
-remediable
-remedial
-remedy
-remember
-remembrance
-Remington
-reminisce
-reminiscent
-remiss
-remission
-remit
-remittance
-remitted
-remitting
-remnant
-remonstrate
-remorse
-remote
-removal
-remunerate
-Remus
-Rena
-renaissance
-renal
-Renault
-rend
-render
-rendezvous
-rendition
-renegotiable
-renewal
-Renoir
-renounce
-renovate
-renown
-Rensselaer
-rent
-rental
-renunciate
-rep
-repairman
-repairmen
-reparation
-repartee
-repeal
-repeat
-repeater
-repel
-repelled
-repellent
-repelling
-repent
-repentant
-repertoire
-repertory
-repetition
-repetitious
-repetitive
-replaceable
-replenish
-replete
-replica
-replicate
-report
-reportorial
-repository
-reprehensible
-representative
-repression
-repressive
-reprieve
-reprimand
-reprisal
-reprise
-reproach
-reptile
-reptilian
-republic
-republican
-repudiate
-repugnant
-repulsion
-repulsive
-reputation
-repute
-request
-require
-requisite
-requisition
-requited
-reredos
-rescind
-rescue
-resemblant
-resemble
-resent
-reserpine
-reservation
-reserve
-reservoir
-reside
-resident
-residential
-residual
-residuary
-residue
-residuum
-resign
-resignation
-resilient
-resin
-resinlike
-resiny
-resist
-resistant
-resistible
-resistive
-resistor
-resolute
-resolution
-resolve
-resonant
-resonate
-resorcinol
-resort
-respect
-respiration
-respirator
-respiratory
-respire
-respite
-resplendent
-respond
-respondent
-response
-responsible
-responsive
-rest
-restaurant
-restaurateur
-restitution
-restive
-restoration
-restorative
-restrain
-restraint
-restrict
-restroom
-result
-resultant
-resume
-resuming
-resumption
-resurgent
-resurrect
-resuscitate
-ret
-retail
-retain
-retaliate
-retaliatory
-retard
-retardant
-retardation
-retch
-retention
-retentive
-reticent
-reticulate
-reticulum
-retina
-retinal
-retinue
-retire
-retiree
-retort
-retract
-retribution
-retrieval
-retrieve
-retroactive
-retrofit
-retrofitted
-retrofitting
-retrograde
-retrogress
-retrogressive
-retrorocket
-retrospect
-retrovision
-return
-Reub
-Reuben
-Reuters
-reveal
-revel
-revelation
-revelatory
-revelry
-revenge
-revenue
-rever
-reverberate
-revere
-reverend
-reverent
-reverie
-reversal
-reverse
-reversible
-reversion
-revert
-revertive
-revery
-revet
-revile
-revisable
-revisal
-revise
-revision
-revisionary
-revival
-revive
-revocable
-revoke
-revolt
-revolution
-revolutionary
-revolve
-revulsion
-revved
-revving
-reward
-Rex
-Reykjavik
-Reynolds
-rhapsodic
-rhapsody
-Rhea
-Rhenish
-rhenium
-rheology
-rheostat
-rhesus
-rhetoric
-rhetorician
-rheum
-rheumatic
-rheumatism
-Rhine
-rhinestone
-rhino
-rhinoceros
-rho
-Rhoda
-Rhode
-Rhodes
-Rhodesia
-rhodium
-rhododendron
-rhombi
-rhombic
-rhombus
-rhubarb
-rhyme
-rhythm
-rhythmic
-rib
-ribald
-ribbon
-riboflavin
-ribonucleic
-Rica
-rice
-rich
-Richard
-Richards
-Richardson
-Richfield
-Richmond
-Richter
-rick
-rickets
-Rickettsia
-rickety
-rickshaw
-Rico
-ricochet
-rid
-riddance
-ridden
-riddle
-ride
-ridge
-ridgepole
-Ridgway
-ridicule
-ridiculous
-Riemann
-riffle
-rifle
-rifleman
-riflemen
-rift
-rig
-Rigel
-rigging
-Riggs
-right
-righteous
-rightmost
-rightward
-rigid
-rigorous
-Riley
-rill
-rilly
-rim
-rime
-rimy
-Rinehart
-ring
-ringlet
-ringside
-rink
-rinse
-Rio
-Riordan
-riot
-riotous
-rip
-riparian
-ripe
-ripen
-Ripley
-ripoff
-ripple
-rise
-risen
-risible
-risk
-risky
-Ritchie
-rite
-Ritter
-ritual
-Ritz
-rival
-rivalry
-riven
-river
-riverbank
-riverfront
-riverine
-riverside
-rivet
-Riviera
-rivulet
-Riyadh
-roach
-road
-roadbed
-roadblock
-roadhouse
-roadside
-roadster
-roadway
-roam
-roar
-roast
-rob
-robbery
-robbin
-Robbins
-robe
-Robert
-Roberta
-Roberto
-Roberts
-Robertson
-robin
-Robinson
-robot
-robotics
-robust
-Rochester
-rock
-rockabye
-rockaway
-rockbound
-Rockefeller
-rocket
-Rockford
-Rockies
-Rockland
-rocklike
-Rockwell
-rocky
-rococo
-rod
-rode
-rodent
-rodeo
-Rodgers
-Rodney
-Rodriguez
-roe
-roebuck
-Roentgen
-Roger
-Rogers
-rogue
-roil
-roister
-Roland
-role
-roll
-rollback
-rollick
-Rollins
-Roman
-romance
-Romano
-romantic
-Rome
-Romeo
-romp
-Romulus
-Ron
-Ronald
-rondo
-Ronnie
-rood
-roof
-rooftop
-rooftree
-rook
-rookie
-rooky
-room
-roommate
-roomy
-Roosevelt
-Rooseveltian
-roost
-root
-rope
-Rosa
-Rosalie
-rosary
-rose
-rosebud
-rosebush
-Roseland
-rosemary
-Rosen
-Rosenberg
-Rosenblum
-Rosenthal
-Rosenzweig
-rosette
-Ross
-roster
-rostrum
-rosy
-rot
-Rotarian
-rotary
-rotate
-ROTC
-rotenone
-Roth
-rotogravure
-rotor
-rototill
-rotten
-rotund
-rotunda
-rouge
-rough
-roughcast
-roughen
-roughish
-roughneck
-roughshod
-roulette
-round
-roundabout
-roundhead
-roundhouse
-roundoff
-roundtable
-roundup
-roundworm
-rouse
-Rousseau
-roustabout
-rout
-route
-routine
-rove
-row
-rowboat
-rowdy
-Rowe
-Rowena
-Rowland
-Rowley
-Roy
-royal
-royalty
-Royce
-RPM
-RSVP
-Ruanda
-rub
-rubbery
-rubbish
-rubble
-rubdown
-Rube
-Ruben
-rubicund
-rubidium
-rubric
-ruby
-ruckus
-rudder
-ruddy
-rude
-rudiment
-rudimentary
-Rudolf
-Rudolph
-Rudy
-Rudyard
-rue
-ruffian
-ruffle
-rufous
-Rufus
-rug
-ruin
-ruinous
-rule
-rum
-Rumania
-rumble
-rumen
-Rumford
-ruminant
-rummage
-rummy
-rump
-rumple
-rumpus
-run
-runabout
-runaway
-rundown
-rune
-rung
-Runge
-runic
-runneth
-Runnymede
-runoff
-runt
-runty
-runway
-Runyon
-rupee
-rupture
-rural
-ruse
-rush
-Rushmore
-rusk
-Russ
-Russell
-russet
-Russia
-Russo
-russula
-rust
-rustic
-rustle
-rustproof
-rusty
-rut
-rutabaga
-Rutgers
-Ruth
-ruthenium
-Rutherford
-ruthless
-rutile
-Rutland
-Rutledge
-rutty
-Rwanda
-Ryan
-Rydberg
-Ryder
-rye
-s
-s's
-sa
-sabbath
-sabbatical
-Sabina
-Sabine
-sable
-sabotage
-sabra
-sac
-sachem
-sack
-sacral
-sacrament
-Sacramento
-sacred
-sacrifice
-sacrificial
-sacrilege
-sacrilegious
-sacrosanct
-sad
-sadden
-saddle
-saddlebag
-Sadie
-sadism
-sadist
-Sadler
-safari
-safe
-safeguard
-safekeeping
-safety
-saffron
-sag
-saga
-sagacious
-sagacity
-sage
-sagebrush
-sagging
-Saginaw
-sagittal
-Sagittarius
-sago
-saguaro
-Sahara
-said
-Saigon
-sail
-sailboat
-sailfish
-sailor
-saint
-sainthood
-sake
-Sal
-Salaam
-salacious
-salad
-salamander
-salami
-salaried
-salary
-sale
-Salem
-Salerno
-salesgirl
-Salesian
-saleslady
-salesman
-salesmen
-salesperson
-salient
-Salina
-saline
-Salisbury
-Salish
-saliva
-salivary
-salivate
-Salk
-Salle
-sallow
-sally
-salmon
-salmonberry
-salon
-saloon
-saloonkeep
-salsify
-salt
-saltbush
-saltwater
-salty
-salubrious
-salutary
-salutation
-salute
-Salvador
-salvage
-salvageable
-salvation
-Salvatore
-salve
-salvo
-Sam
-samarium
-samba
-same
-Sammy
-Samoa
-samovar
-sample
-Sampson
-Samson
-Samuel
-Samuelson
-San
-Sana
-sanatoria
-sanatorium
-Sanborn
-Sanchez
-Sancho
-sanctify
-sanctimonious
-sanction
-sanctity
-sanctuary
-sand
-sandal
-sandalwood
-sandbag
-sandblast
-Sandburg
-sanderling
-Sanders
-Sanderson
-sandhill
-Sandia
-sandman
-sandpaper
-sandpile
-sandpiper
-Sandra
-sandstone
-Sandusky
-sandwich
-sandy
-sane
-Sanford
-sang
-sangaree
-sanguinary
-sanguine
-sanguineous
-Sanhedrin
-sanicle
-sanitarium
-sanitary
-sanitate
-sank
-sans
-Santa
-Santayana
-Santiago
-Santo
-Sao
-sap
-sapiens
-sapient
-sapling
-saponify
-sapphire
-sappy
-sapsucker
-Sara
-Saracen
-Sarah
-Saran
-Sarasota
-Saratoga
-sarcasm
-sarcastic
-sarcoma
-sardine
-sardonic
-Sargent
-sari
-sarsaparilla
-sarsparilla
-sash
-sashay
-Saskatchewan
-sassafras
-sat
-satan
-satanic
-satellite
-satiable
-satiate
-satiety
-satin
-satire
-satiric
-satisfaction
-satisfactory
-satisfy
-saturable
-saturate
-saturater
-Saturday
-Saturn
-Saturnalia
-saturnine
-satyr
-sauce
-saucepan
-saucy
-Saud
-Saudi
-sauerkraut
-Saul
-Sault
-Saunders
-sausage
-saute
-sauterne
-savage
-savagery
-Savannah
-savant
-save
-Saviour
-Savonarola
-savoy
-Savoyard
-savvy
-saw
-sawbelly
-sawdust
-sawfish
-sawfly
-sawmill
-sawtimber
-sawtooth
-sawyer
-sax
-saxifrage
-Saxon
-Saxony
-saxophone
-say
-SC
-scab
-scabbard
-scabious
-scabrous
-scaffold
-Scala
-scalar
-scald
-scale
-scallop
-scalp
-scamp
-scan
-scandal
-scandalous
-Scandinavia
-scandium
-scant
-scanty
-scapegoat
-scapula
-scapular
-scar
-Scarborough
-scarce
-scare
-scarecrow
-scarf
-scarface
-scarify
-scarlet
-Scarsdale
-scarves
-scary
-scat
-scathe
-scatterbrain
-scattergun
-scaup
-scavenge
-scenario
-scene
-scenery
-scenic
-scent
-sceptic
-Schaefer
-Schafer
-Schantz
-schedule
-schema
-schemata
-schematic
-scheme
-Schenectady
-scherzo
-Schiller
-schism
-schist
-schizoid
-schizomycetes
-schizophrenia
-schizophrenic
-Schlesinger
-schlieren
-Schlitz
-Schloss
-Schmidt
-Schmitt
-Schnabel
-schnapps
-Schneider
-Schoenberg
-Schofield
-scholar
-scholastic
-school
-schoolbook
-schoolboy
-schoolgirl
-schoolgirlish
-schoolhouse
-schoolmarm
-schoolmaster
-schoolmate
-schoolroom
-schoolteacher
-schoolwork
-schooner
-Schottky
-Schroeder
-Schroedinger
-Schubert
-Schultz
-Schulz
-Schumacher
-Schumann
-Schuster
-Schuyler
-Schuylkill
-Schwab
-Schwartz
-Schweitzer
-sciatica
-science
-scientific
-scientist
-scimitar
-scintillate
-scion
-scissor
-sclerosis
-sclerotic
-SCM
-scoff
-scold
-scoop
-scoot
-scope
-scopic
-scops
-scorch
-score
-scoreboard
-scorecard
-scoria
-scorn
-Scorpio
-scorpion
-Scot
-scotch
-Scotia
-Scotland
-Scotsman
-Scotsmen
-Scott
-Scottish
-Scottsdale
-Scotty
-scoundrel
-scour
-scourge
-scout
-scowl
-scrabble
-scraggly
-scram
-scramble
-Scranton
-scrap
-scrapbook
-scrape
-scratch
-scratchy
-scrawl
-scrawny
-scream
-screech
-screechy
-screed
-screen
-screenplay
-screw
-screwball
-screwbean
-screwdriver
-screwworm
-scribble
-scribe
-Scribners
-scrim
-scrimmage
-Scripps
-script
-scription
-scriptural
-scripture
-scriven
-scroll
-scrooge
-scrounge
-scrub
-scrumptious
-scruple
-scrupulosity
-scrupulous
-scrutable
-scrutiny
-scuba
-scud
-scuff
-scuffle
-scull
-sculpin
-sculpt
-sculptor
-sculptural
-sculpture
-scum
-scurrilous
-scurry
-scurvy
-scuttle
-scutum
-Scylla
-scythe
-Scythia
-SD
-sea
-seaboard
-seacoast
-seafare
-seafood
-Seagram
-seagull
-seahorse
-seal
-sealant
-seam
-seaman
-seamen
-seamstress
-seamy
-Sean
-seance
-seaport
-seaquake
-sear
-search
-searchlight
-Sears
-seashore
-seaside
-season
-seasonal
-seat
-seater
-Seattle
-seaward
-seaweed
-Sebastian
-sec
-secant
-secede
-secession
-seclude
-seclusion
-second
-secondary
-secondhand
-secrecy
-secret
-secretarial
-secretariat
-secretary
-secrete
-secretion
-secretive
-sect
-sectarian
-section
-sector
-sectoral
-secular
-secure
-sedan
-sedate
-sedentary
-seder
-sedge
-sediment
-sedimentary
-sedimentation
-sedition
-seditious
-seduce
-seduction
-seductive
-sedulous
-see
-seeable
-seed
-seedbed
-seedling
-seedy
-seeing
-seek
-seem
-seen
-seep
-seepage
-seersucker
-seethe
-segment
-segmentation
-Segovia
-segregant
-segregate
-Segundo
-Seidel
-seismic
-seismograph
-seismography
-seismology
-seize
-seizure
-seldom
-select
-selectman
-selectmen
-selector
-Selectric
-Selena
-selenate
-selenite
-selenium
-self
-selfish
-Selfridge
-Selkirk
-sell
-seller
-sellout
-Selma
-seltzer
-selves
-Selwyn
-semantic
-semaphore
-semblance
-semester
-semi
-seminal
-seminar
-seminarian
-seminary
-Seminole
-Semite
-Semitic
-semper
-sen
-senate
-senatorial
-send
-Seneca
-Senegal
-senile
-senior
-senor
-Senora
-senorita
-sensate
-sense
-sensible
-sensitive
-sensor
-sensory
-sensual
-sensuous
-sent
-sentence
-sentential
-sentient
-sentiment
-sentinel
-sentry
-Seoul
-sepal
-separable
-separate
-sepia
-Sepoy
-sept
-septa
-septate
-September
-septennial
-septic
-septillion
-septuagenarian
-septum
-sepuchral
-sepulchral
-sequel
-sequent
-sequential
-sequester
-sequestration
-sequin
-sequitur
-Sequoia
-sera
-seraglio
-serape
-seraphim
-serenade
-serendipitous
-serendipity
-serene
-serge
-sergeant
-Sergei
-serial
-seriatim
-series
-serif
-serious
-sermon
-serology
-Serpens
-serpent
-serpentine
-serum
-servant
-serve
-service
-serviceable
-serviceberry
-serviceman
-servicemen
-serviette
-servile
-servitor
-servo
-servomechanism
-sesame
-session
-set
-setback
-Seth
-Seton
-setscrew
-settle
-setup
-seven
-sevenfold
-seventeen
-seventeenth
-seventh
-seventieth
-seventy
-sever
-several
-severalfold
-severalty
-severe
-Severn
-Seville
-sew
-sewage
-Seward
-sewerage
-sewn
-sex
-Sextans
-sextet
-sextillion
-sexton
-sextuple
-sextuplet
-sexual
-sexy
-Seymour
-sforzando
-shabby
-shack
-shackle
-shad
-shadbush
-shade
-shadflower
-shadow
-shadowy
-shady
-Shafer
-Shaffer
-shaft
-shag
-shagbark
-shagging
-shaggy
-shah
-shake
-shakeable
-shakedown
-shaken
-Shakespeare
-Shakespearean
-Shakespearian
-shako
-shaky
-shale
-shall
-shallot
-shallow
-shalom
-sham
-shamble
-shame
-shameface
-shampoo
-shamrock
-shan't
-Shanghai
-shank
-Shannon
-Shantung
-shanty
-shape
-Shapiro
-shard
-share
-sharecrop
-shareholder
-Shari
-shark
-Sharon
-sharp
-Sharpe
-sharpen
-sharpshoot
-Shasta
-shatter
-shatterproof
-Shattuck
-shave
-shaven
-shaw
-shawl
-Shawnee
-shay
-she
-she'd
-she'll
-Shea
-sheaf
-shear
-Shearer
-sheath
-sheathe
-sheave
-shed
-Shedir
-Sheehan
-sheen
-sheep
-sheepskin
-sheer
-sheet
-Sheffield
-sheik
-Sheila
-Shelby
-Sheldon
-shelf
-shell
-Shelley
-shelter
-Shelton
-shelve
-Shenandoah
-shenanigan
-Shepard
-shepherd
-Sheppard
-Sheraton
-sherbet
-Sheridan
-sheriff
-Sherlock
-Sherman
-Sherrill
-sherry
-Sherwin
-Sherwood
-shibboleth
-shied
-shield
-Shields
-shift
-shifty
-shill
-Shiloh
-shim
-shimmy
-shin
-shinbone
-shine
-shingle
-Shinto
-shiny
-ship
-shipboard
-shipbuild
-shiplap
-Shipley
-shipman
-shipmate
-shipmen
-shipshape
-shipwreck
-shipyard
-shire
-shirk
-Shirley
-shirt
-shirtmake
-shish
-shitepoke
-shiv
-shiver
-shivery
-shoal
-shock
-Shockley
-shod
-shoddy
-shoe
-shoehorn
-shoelace
-shoemake
-shoestring
-shoji
-shone
-shoo
-shoofly
-shook
-shoot
-shop
-shopkeep
-shopworn
-shore
-shoreline
-short
-shortage
-shortcoming
-shortcut
-shorten
-shortfall
-shorthand
-shortish
-shortsighted
-shortstop
-shot
-shotbush
-shotgun
-should
-shoulder
-shouldn't
-shout
-shove
-shovel
-show
-showboat
-showcase
-showdown
-showman
-showmen
-shown
-showpiece
-showplace
-showroom
-showy
-shrank
-shrapnel
-shred
-Shreveport
-shrew
-shrewd
-shrewish
-shriek
-shrift
-shrike
-shrill
-shrilly
-shrimp
-shrine
-shrink
-shrinkage
-shrive
-shrivel
-shroud
-shrove
-shrub
-shrubbery
-shrug
-shrugging
-shrunk
-shrunken
-Shu
-shuck
-shudder
-shuddery
-shuffle
-shuffleboard
-Shulman
-shun
-shunt
-shut
-shutdown
-shutoff
-shutout
-shuttle
-shuttlecock
-shy
-Shylock
-sial
-SIAM
-Siamese
-Sian
-sib
-Siberia
-sibilant
-Sibley
-sibling
-sibyl
-sic
-Sicilian
-Sicily
-sick
-sicken
-sickish
-sickle
-sickroom
-side
-sidearm
-sideband
-sideboard
-sidecar
-sidelight
-sideline
-sidelong
-sideman
-sidemen
-sidereal
-sidesaddle
-sideshow
-sidestep
-sidetrack
-sidewalk
-sidewall
-sideway
-sidewinder
-sidewise
-sidle
-Sidney
-siege
-Siegel
-Siegfried
-Sieglinda
-Siegmund
-Siemens
-sienna
-sierra
-siesta
-sieve
-sift
-sigh
-sight
-sightsee
-sightseeing
-sightseer
-sigma
-Sigmund
-sign
-signal
-signature
-signboard
-signet
-significant
-signify
-Signor
-Signora
-signpost
-Sikorsky
-silage
-silane
-Silas
-silent
-silhouette
-silica
-silicate
-siliceous
-silicic
-silicide
-silicon
-silicone
-silk
-silken
-silkworm
-silky
-sill
-silly
-silo
-silt
-siltation
-siltstone
-silty
-silver
-Silverman
-silversmith
-silverware
-silvery
-sima
-similar
-simile
-similitude
-simmer
-Simmons
-Simon
-Simons
-Simonson
-simper
-simple
-simplectic
-simpleminded
-simpleton
-simplex
-simplicity
-simplify
-simplistic
-simply
-Simpson
-Sims
-simulate
-simulcast
-simultaneity
-simultaneous
-sin
-Sinai
-since
-sincere
-Sinclair
-sine
-sinew
-sinewy
-sing
-singable
-Singapore
-singe
-single
-singlehanded
-singlet
-singleton
-singsong
-singular
-sinh
-sinister
-sinistral
-sink
-sinkhole
-sinter
-sinuous
-sinus
-sinusoid
-sinusoidal
-Sioux
-sip
-sir
-sire
-siren
-Sirius
-sis
-sisal
-siskin
-sister
-Sistine
-Sisyphean
-Sisyphus
-sit
-site
-situ
-situate
-situs
-siva
-six
-sixfold
-sixgun
-sixteen
-sixteenth
-sixth
-sixtieth
-sixty
-size
-sizzle
-skat
-skate
-skater
-skeet
-skeletal
-skeleton
-skeptic
-sketch
-sketchbook
-sketchpad
-sketchy
-skew
-ski
-skid
-skiddy
-skied
-skiff
-skill
-skillet
-skim
-skimp
-skimpy
-skin
-skindive
-skinny
-skip
-skipjack
-Skippy
-skirmish
-skirt
-skit
-skittle
-skulk
-skull
-skullcap
-skullduggery
-skunk
-sky
-Skye
-skyhook
-skyjack
-skylark
-skylight
-skyline
-skyrocket
-skyscrape
-skyward
-skywave
-skyway
-slab
-slack
-slacken
-sladang
-slag
-slain
-slake
-slam
-slander
-slanderous
-slang
-slant
-slap
-slapstick
-slash
-slat
-slate
-slater
-slaughter
-slaughterhouse
-Slav
-slave
-slavery
-Slavic
-slavish
-slay
-sled
-sledge
-sledgehammer
-sleek
-sleep
-sleepwalk
-sleepy
-sleet
-sleety
-sleeve
-sleigh
-sleight
-slender
-slept
-sleuth
-slew
-slice
-slick
-slid
-slide
-slight
-slim
-slime
-slimy
-sling
-slingshot
-slip
-slippage
-slippery
-slit
-slither
-sliver
-slivery
-Sloan
-Sloane
-slob
-Slocum
-sloe
-slog
-slogan
-sloganeer
-slogging
-sloop
-slop
-slope
-sloppy
-slosh
-slot
-sloth
-slouch
-slough
-sloven
-slow
-slowdown
-sludge
-slug
-slugging
-sluggish
-sluice
-slum
-slumber
-slump
-slung
-slur
-slurp
-slurry
-sly
-smack
-small
-smaller
-Smalley
-smallish
-smallpox
-smalltime
-smart
-smash
-smatter
-smear
-smell
-smelt
-smile
-smirk
-smith
-smithereens
-Smithfield
-Smithson
-Smithsonian
-smithy
-smitten
-smog
-smoke
-smokehouse
-smokescreen
-smokestack
-smoky
-smolder
-smooch
-smooth
-smoothbore
-smother
-Smucker
-smudge
-smudgy
-smug
-smuggle
-smut
-smutty
-Smyrna
-Smythe
-snack
-snafu
-snag
-snagging
-snail
-snake
-snakebird
-snakelike
-snakeroot
-snap
-snapback
-snapdragon
-snappish
-snappy
-snapshot
-snare
-snark
-snarl
-snatch
-snazzy
-sneak
-sneaky
-sneer
-sneeze
-snell
-snick
-Snider
-sniff
-sniffle
-sniffly
-snifter
-snigger
-snip
-snipe
-snippet
-snippy
-snivel
-snob
-snobbery
-snobbish
-snook
-snoop
-snoopy
-snore
-snorkel
-snort
-snotty
-snout
-snow
-snowball
-snowfall
-snowflake
-snowstorm
-snowy
-snub
-snuff
-snuffer
-snuffle
-snuffly
-snug
-snuggle
-snuggly
-snyaptic
-Snyder
-so
-soak
-soap
-soapstone
-soapsud
-soapy
-soar
-sob
-sober
-sobriety
-sobriquet
-soccer
-sociable
-social
-societal
-Societe
-society
-socioeconomic
-sociology
-sociometry
-sock
-socket
-sockeye
-Socrates
-Socratic
-sod
-soda
-sodden
-sodium
-sofa
-soffit
-Sofia
-soft
-softball
-soften
-software
-softwood
-soggy
-soignee
-soil
-soiree
-sojourn
-Sol
-solace
-solar
-sold
-solder
-soldier
-soldiery
-sole
-solecism
-solemn
-solemnity
-solenoid
-solicit
-solicitation
-solicitor
-solicitous
-solicitude
-solid
-solidarity
-solidify
-solidus
-soliloquy
-solipsism
-solitary
-solitude
-solo
-Solomon
-Solon
-solstice
-soluble
-solute
-solution
-solvate
-solve
-solvent
-soma
-somal
-Somali
-somatic
-somber
-sombre
-some
-somebody
-somebody'll
-someday
-somehow
-someone
-someone'll
-someplace
-Somers
-somersault
-Somerset
-Somerville
-something
-sometime
-somewhat
-somewhere
-sommelier
-Sommerfeld
-somnolent
-son
-sonar
-sonata
-song
-songbag
-songbook
-sonic
-sonnet
-sonny
-Sonoma
-Sonora
-sonority
-sonorous
-Sony
-soon
-soot
-sooth
-soothe
-soothsay
-soothsayer
-sop
-sophia
-Sophie
-sophism
-sophisticate
-sophistry
-Sophoclean
-Sophocles
-sophomore
-sophomoric
-soprano
-sora
-sorb
-sorcery
-sordid
-sore
-Sorensen
-Sorenson
-sorghum
-sorority
-sorption
-sorrel
-sorrow
-sorry
-sort
-sortie
-sou
-souffle
-sought
-soul
-sound
-soundproof
-soup
-sour
-sourberry
-source
-sourdough
-sourwood
-Sousa
-soutane
-south
-Southampton
-southbound
-southeast
-southeastern
-southern
-southernmost
-Southey
-southland
-southpaw
-southward
-southwest
-southwestern
-souvenir
-sovereign
-sovereignty
-soviet
-sovkhoz
-sow
-sowbelly
-sown
-soy
-soya
-soybean
-spa
-space
-spacecraft
-spacesuit
-spacious
-spade
-spaghetti
-Spain
-span
-spandrel
-spangle
-Spaniard
-spaniel
-Spanish
-spar
-spare
-sparge
-spark
-sparkle
-Sparkman
-sparky
-sparling
-sparrow
-sparse
-Sparta
-Spartan
-spasm
-spastic
-spat
-spate
-spatial
-spatlum
-spatterdock
-spatula
-Spaulding
-spavin
-spawn
-spay
-spayed
-speak
-speakeasy
-spear
-spearhead
-spearmint
-spec
-special
-specie
-species
-specific
-specify
-specimen
-specious
-speck
-speckle
-spectacle
-spectacular
-spectator
-Spector
-spectra
-spectral
-spectrogram
-spectrograph
-spectrography
-spectrometer
-spectrophotometer
-spectroscope
-spectroscopic
-spectroscopy
-spectrum
-specular
-speculate
-sped
-speech
-speed
-speedboat
-speedometer
-speedup
-speedwell
-speedy
-spell
-spellbound
-Spencer
-Spencerian
-spend
-spent
-sperm
-spermatophyte
-Sperry
-spew
-sphagnum
-sphere
-spheric
-spheroid
-spheroidal
-spherule
-sphinx
-Spica
-spice
-spicebush
-spicy
-spider
-spidery
-Spiegel
-spigot
-spike
-spikenard
-spiky
-spill
-spilt
-spin
-spinach
-spinal
-spindle
-spine
-spinnaker
-spinneret
-spinodal
-spinoff
-spinster
-spiny
-spiral
-spire
-spirit
-spiritual
-Spiro
-spit
-spite
-spitfire
-spittle
-spitz
-splash
-splashy
-splat
-splay
-splayed
-spleen
-splendid
-splenetic
-splice
-spline
-splint
-splintery
-split
-splotch
-splotchy
-splurge
-splutter
-spoil
-spoilage
-Spokane
-spoke
-spoken
-spokesman
-spokesmen
-spokesperson
-sponge
-spongy
-sponsor
-spontaneity
-spontaneous
-spoof
-spook
-spooky
-spool
-spoon
-sporadic
-spore
-sport
-sportsman
-sportsmen
-sportswear
-sportswrite
-sportswriting
-sporty
-spot
-spotlight
-spotty
-spouse
-spout
-Sprague
-sprain
-sprang
-sprawl
-spray
-spread
-spree
-sprig
-sprightly
-spring
-springboard
-springe
-Springfield
-springtail
-springtime
-springy
-sprinkle
-sprint
-sprite
-sprocket
-Sproul
-sprout
-spruce
-sprue
-sprung
-spud
-spume
-spumoni
-spun
-spunk
-spur
-spurge
-spurious
-spurn
-spurt
-sputnik
-sputter
-spy
-spyglass
-squabble
-squad
-squadron
-squalid
-squall
-squamous
-squander
-square
-squash
-squashberry
-squashy
-squat
-squatting
-squaw
-squawbush
-squawk
-squawroot
-squeak
-squeaky
-squeal
-squeamish
-squeegee
-squeeze
-squelch
-Squibb
-squid
-squill
-squint
-squire
-squirehood
-squirm
-squirmy
-squirrel
-squirt
-squishy
-Sri
-SST
-St
-St.
-stab
-stabile
-stable
-stableman
-stablemen
-staccato
-stack
-Stacy
-stadia
-stadium
-staff
-Stafford
-stag
-stage
-stagecoach
-stagnant
-stagnate
-stagy
-Stahl
-staid
-stain
-stair
-staircase
-stairway
-stairwell
-stake
-stalactite
-stale
-stalemate
-Staley
-Stalin
-stalk
-stall
-stallion
-stalwart
-stamen
-Stamford
-stamina
-staminate
-stammer
-stamp
-stampede
-Stan
-stance
-stanch
-stanchion
-stand
-standard
-standby
-standeth
-Standish
-standoff
-standpoint
-standstill
-Stanford
-Stanhope
-stank
-Stanley
-stannic
-stannous
-Stanton
-stanza
-staph
-staphylococcus
-staple
-Stapleton
-star
-starboard
-starch
-starchy
-stardom
-stare
-starfish
-stargaze
-stark
-Starkey
-starlet
-starlight
-starling
-Starr
-start
-startle
-startup
-starvation
-starve
-stash
-stasis
-state
-Staten
-stater
-stateroom
-statesman
-statesmanlike
-statesmen
-statewide
-static
-stationarity
-stationary
-stationery
-stationmaster
-statistician
-Statler
-stator
-statuary
-statue
-statuette
-stature
-status
-statute
-statutory
-Stauffer
-staunch
-Staunton
-stave
-stay
-stayed
-stead
-steadfast
-steady
-steak
-steal
-stealth
-stealthy
-steam
-steamboat
-steamy
-Stearns
-steed
-steel
-Steele
-steelmake
-steely
-Steen
-steep
-steepen
-steeple
-steeplebush
-steer
-steeve
-Stefan
-stein
-Steinberg
-Steiner
-stella
-stellar
-stem
-stench
-stencil
-stenographer
-stenography
-stenotype
-step
-stepchild
-Stephanie
-stephanotis
-Stephen
-Stephens
-Stephenson
-stepmother
-steppe
-steprelation
-stepson
-stepwise
-steradian
-stereo
-stereography
-stereoscopy
-sterile
-sterling
-stern
-sternal
-Sterno
-sternum
-steroid
-stethoscope
-Stetson
-Steuben
-Steve
-stevedore
-Steven
-Stevens
-Stevenson
-stew
-steward
-stewardess
-Stewart
-stick
-stickle
-stickleback
-stickpin
-sticktight
-sticky
-stiff
-stiffen
-stifle
-stigma
-stigmata
-stile
-stiletto
-still
-stillbirth
-stillwater
-stilt
-stimulant
-stimulate
-stimulatory
-stimuli
-stimulus
-sting
-stingy
-stink
-stinkpot
-stinky
-stint
-stipend
-stipple
-stipulate
-stir
-Stirling
-stirrup
-stitch
-stochastic
-stock
-stockade
-stockbroker
-stockholder
-Stockholm
-stockpile
-stockroom
-Stockton
-stocky
-stodgy
-stoic
-stoichiometry
-stoke
-Stokes
-stole
-stolen
-stolid
-stomach
-stomp
-stone
-stonecrop
-Stonehenge
-stonewall
-stoneware
-stony
-stood
-stooge
-stool
-stoop
-stop
-stopband
-stopcock
-stopgap
-stopover
-stoppage
-stopwatch
-storage
-store
-storehouse
-storekeep
-storeroom
-Storey
-stork
-storm
-stormbound
-stormy
-story
-storyboard
-storyteller
-stout
-stove
-stow
-stowage
-strabismic
-strabismus
-straddle
-strafe
-straggle
-straight
-straightaway
-straighten
-straightforward
-straightway
-strain
-strait
-strand
-strange
-strangle
-strangulate
-strap
-strata
-stratagem
-strategic
-strategist
-strategy
-Stratford
-stratify
-stratosphere
-stratospheric
-Stratton
-stratum
-Strauss
-straw
-strawberry
-strawflower
-stray
-streak
-stream
-streamline
-streamside
-street
-streetcar
-strength
-strengthen
-strenuous
-streptococcus
-stress
-stretch
-strewn
-striate
-stricken
-Strickland
-strict
-stricture
-stride
-strident
-strife
-strike
-strikebreak
-string
-stringent
-stringy
-strip
-stripe
-striptease
-strive
-striven
-strobe
-stroboscopic
-strode
-stroke
-stroll
-Strom
-Stromberg
-strong
-stronghold
-strongroom
-strontium
-strop
-strophe
-strove
-struck
-structural
-structure
-struggle
-strum
-strung
-strut
-strychnine
-Stuart
-stub
-stubble
-stubborn
-stubby
-stucco
-stuck
-stud
-Studebaker
-student
-studio
-studious
-study
-stuff
-stuffy
-stultify
-stumble
-stump
-stumpage
-stumpy
-stun
-stung
-stunk
-stunt
-stupefy
-stupendous
-stupid
-stupor
-Sturbridge
-sturdy
-sturgeon
-Sturm
-stutter
-Stuttgart
-Stuyvesant
-Stygian
-style
-styli
-stylish
-stylites
-stylus
-stymie
-styrene
-Styrofoam
-Styx
-suave
-sub
-subject
-subjectivity
-sublimate
-subliminal
-submersible
-submit
-submittal
-submitted
-submitting
-subpoena
-subrogation
-subservient
-subsidiary
-subsidy
-subsist
-subsistent
-substantial
-substantiate
-substantive
-substituent
-substitute
-substitution
-substitutionary
-substrate
-subsume
-subsumed
-subsuming
-subterfuge
-subterranean
-subtle
-subtlety
-subtly
-subtrahend
-suburb
-suburbia
-subversive
-subvert
-succeed
-success
-succession
-successive
-successor
-succinct
-succubus
-succumb
-such
-suck
-suckling
-suction
-sud
-Sudan
-Sudanese
-sudden
-suds
-sue
-suey
-Suez
-suffer
-suffice
-sufficient
-suffix
-suffocate
-Suffolk
-suffrage
-suffragette
-suffuse
-sugar
-suggest
-suggestible
-suggestion
-suggestive
-suicidal
-suicide
-suit
-suitcase
-suite
-suitor
-sulfa
-sulfate
-sulfide
-sulfite
-sulfonamide
-sulfur
-sulfuric
-sulfurous
-sulk
-sulky
-sullen
-Sullivan
-sully
-sulphur
-sultan
-sultry
-sum
-sumac
-Sumatra
-Sumerian
-summand
-summarily
-summary
-summate
-Summers
-summertime
-summit
-summitry
-summon
-Sumner
-sumptuous
-Sumter
-sun
-sunbeam
-sunbonnet
-sunburn
-sunburnt
-Sunday
-sunder
-sundew
-sundial
-sundown
-sundry
-sunfish
-sunflower
-sung
-sunk
-sunken
-sunlight
-sunlit
-sunny
-Sunnyvale
-sunrise
-sunset
-sunshade
-sunshine
-sunshiny
-sunspot
-suntan
-suntanned
-SUNY
-sup
-super
-superannuate
-superb
-superbly
-supercilious
-superficial
-superfluity
-superfluous
-superintendent
-superior
-superlative
-superlunary
-supernatant
-superposable
-supersede
-superstition
-superstitious
-supervene
-supervisory
-supine
-supplant
-supple
-supplementary
-supplicate
-supply
-support
-supposable
-suppose
-supposition
-suppress
-suppressible
-suppression
-suppressor
-supra
-supranational
-supremacy
-supreme
-surcease
-surcharge
-sure
-surety
-surf
-surface
-surfactant
-surfeit
-surge
-surgeon
-surgery
-surgical
-surmise
-surmount
-surname
-surpass
-surplus
-surprise
-surreal
-surrender
-surreptitious
-surrey
-surrogate
-surround
-surtax
-surtout
-surveillant
-survey
-surveyor
-survival
-survive
-survivor
-Sus
-Susan
-Susanne
-susceptible
-sushi
-Susie
-suspect
-suspend
-suspense
-suspension
-suspensor
-suspicion
-suspicious
-Sussex
-sustain
-sustenance
-Sutherland
-Sutton
-suture
-Suzanne
-suzerain
-suzerainty
-Suzuki
-svelte
-swab
-swabby
-swag
-swage
-Swahili
-swain
-swallow
-swallowtail
-swam
-swami
-swamp
-swampy
-swan
-swank
-swanky
-swanlike
-Swanson
-swap
-swarm
-swart
-Swarthmore
-Swarthout
-swarthy
-swastika
-swat
-swatch
-swath
-swathe
-sway
-Swaziland
-swear
-sweat
-sweatband
-sweater
-sweatshirt
-sweaty
-Swede
-Sweden
-Swedish
-Sweeney
-sweep
-sweepstake
-sweet
-sweeten
-sweetheart
-sweetish
-swell
-swelt
-swelter
-Swenson
-swept
-swerve
-swift
-swig
-swigging
-swim
-swimsuit
-swindle
-swine
-swing
-swingable
-swingy
-swipe
-swirl
-swirly
-swish
-swishy
-swiss
-switch
-switchblade
-switchboard
-switchgear
-switchman
-Switzer
-Switzerland
-swivel
-swizzle
-swollen
-swoop
-sword
-swordfish
-swordplay
-swordtail
-swore
-sworn
-swum
-swung
-sybarite
-Sybil
-sycamore
-sycophant
-sycophantic
-Sydney
-Sykes
-syllabic
-syllabify
-syllable
-syllogism
-syllogistic
-sylvan
-Sylvania
-Sylvester
-Sylvia
-symbiosis
-symbol
-symbolic
-symmetry
-sympathetic
-sympathy
-symphonic
-symphony
-symposia
-symposium
-symptom
-symptomatic
-synagogue
-synapse
-synapses
-synaptic
-synchronism
-synchronous
-synchrony
-synchrotron
-syncopate
-syndic
-syndicate
-syndrome
-synergism
-synergistic
-synergy
-synod
-synonym
-synonymous
-synonymy
-synopses
-synopsis
-synoptic
-syntactic
-syntax
-synthesis
-synthetic
-Syracuse
-Syria
-syringa
-syringe
-syrinx
-syrup
-syrupy
-system
-systematic
-systemic
-systemization
-systemwide
-t
-t's
-tab
-tabernacle
-table
-tableau
-tableaux
-tablecloth
-tableland
-tablespoon
-tablet
-tabloid
-taboo
-tabu
-tabula
-tabular
-tabulate
-tachinid
-tachometer
-tacit
-Tacitus
-tack
-tackle
-tacky
-Tacoma
-tact
-tactic
-tactile
-tactual
-tad
-tadpole
-taffeta
-taffy
-taft
-tag
-tagging
-Tahiti
-Tahoe
-tail
-tailgate
-tailor
-tailwind
-taint
-Taipei
-Taiwan
-take
-taken
-takeoff
-takeover
-taketh
-talc
-talcum
-tale
-talent
-talisman
-talismanic
-talk
-talkative
-talkie
-talky
-tall
-Tallahassee
-tallow
-tally
-tallyho
-Talmud
-talon
-talus
-tam
-tamale
-tamarack
-tamarind
-tambourine
-tame
-Tammany
-tamp
-Tampa
-tampon
-tan
-tanager
-Tanaka
-Tananarive
-tandem
-tang
-tangent
-tangential
-tangerine
-tangible
-tangle
-tango
-tangy
-tanh
-tank
-tannin
-tansy
-tantalum
-Tantalus
-tantamount
-tantrum
-Tanya
-Tanzania
-tao
-Taoist
-Taos
-tap
-tapa
-tape
-taper
-tapestry
-tapeworm
-tapir
-tapis
-tappa
-tappet
-tar
-tara
-tarantara
-tarantula
-Tarbell
-tardy
-target
-tariff
-tarnish
-tarpaper
-tarpaulin
-tarpon
-tarry
-Tarrytown
-tart
-tartar
-Tartary
-Tarzan
-task
-taskmaster
-Tasmania
-Tass
-tassel
-taste
-tasting
-tasty
-tat
-tate
-tater
-tattle
-tattler
-tattletale
-tattoo
-tatty
-tau
-taught
-taunt
-Taurus
-taut
-tautology
-tavern
-taverna
-tawdry
-tawny
-tax
-taxation
-taxi
-taxicab
-taxied
-taxiway
-taxonomy
-taxpayer
-taxpaying
-Taylor
-tea
-teacart
-teach
-teacup
-teahouse
-teakettle
-teakwood
-teal
-team
-teammate
-teamster
-teamwork
-teapot
-tear
-teardrop
-tease
-teasel
-teaspoon
-teat
-tech
-technetium
-technic
-technician
-technique
-technology
-tectonic
-tecum
-ted
-Teddy
-tedious
-tedium
-tee
-teeing
-teem
-teen
-teenage
-teensy
-teet
-teeth
-teethe
-teetotal
-Teflon
-Tegucigalpa
-Teheran
-Tehran
-tektite
-Tektronix
-telecommunicate
-teleconference
-Teledyne
-Telefunken
-telegram
-telegraph
-telegraphy
-telekinesis
-telemeter
-teleology
-teleost
-telepathic
-telepathy
-telephone
-telephonic
-telephony
-telephotography
-teleprinter
-teleprocessing
-teleprompter
-telescope
-telescopic
-teletype
-teletypewrite
-televise
-television
-Telex
-tell
-teller
-tellurium
-temerity
-temper
-tempera
-temperance
-temperate
-temperature
-tempest
-tempestuous
-template
-temple
-Templeton
-tempo
-temporal
-temporary
-tempt
-temptation
-temptress
-ten
-tenable
-tenacious
-tenacity
-tenant
-tend
-tendency
-tenderfoot
-tenderloin
-tendon
-tenebrous
-tenement
-tenet
-tenfold
-Tenneco
-Tennessee
-Tenney
-tennis
-Tennyson
-tenon
-tenor
-tense
-tensile
-tension
-tensional
-tensor
-tenspot
-tent
-tentacle
-tentative
-tenth
-tenuous
-tenure
-tepee
-tepid
-teratogenic
-teratology
-terbium
-tercel
-Teresa
-term
-terminable
-terminal
-terminate
-termini
-terminology
-terminus
-termite
-tern
-ternary
-Terpsichore
-terpsichorean
-Terra
-terrace
-terrain
-terramycin
-terrapin
-Terre
-terrestrial
-terrible
-terrier
-terrific
-terrify
-territorial
-territory
-terror
-terry
-terse
-tertiary
-Tess
-tessellate
-test
-testament
-testamentary
-testate
-testes
-testicle
-testicular
-testify
-testimonial
-testimony
-testy
-tetanus
-tete
-tether
-tetrachloride
-tetrafluouride
-tetragonal
-tetrahedra
-tetrahedral
-tetrahedron
-tetravalent
-Teutonic
-Texaco
-Texan
-Texas
-text
-textbook
-textile
-Textron
-textual
-textural
-texture
-Thai
-Thailand
-Thalia
-thallium
-thallophyte
-than
-thank
-thanksgiving
-that
-that'd
-that'll
-thatch
-thaw
-Thayer
-the
-Thea
-theatric
-Thebes
-thee
-theft
-their
-Thelma
-them
-thematic
-theme
-themselves
-then
-thence
-thenceforth
-theocracy
-Theodore
-Theodosian
-theologian
-theology
-theorem
-theoretic
-theoretician
-theorist
-theory
-therapeutic
-therapist
-therapy
-there
-there'd
-there'll
-thereabouts
-thereafter
-thereat
-thereby
-therefor
-therefore
-therefrom
-therein
-thereof
-thereon
-Theresa
-thereto
-theretofore
-thereunder
-thereupon
-therewith
-thermal
-thermionic
-thermistor
-thermo
-Thermofax
-thermostat
-thesaurus
-these
-theses
-Theseus
-thesis
-thespian
-theta
-Thetis
-they
-they'd
-they'll
-they're
-they've
-thiamin
-thick
-thicken
-thicket
-thickish
-thief
-thieves
-thieving
-thigh
-thimble
-Thimbu
-thin
-thine
-thing
-think
-thinnish
-thiocyanate
-thiouracil
-third
-thirst
-thirsty
-thirteen
-thirteenth
-thirtieth
-thirty
-this
-this'll
-thistle
-thistledown
-thither
-Thomas
-Thomistic
-Thompson
-Thomson
-thong
-Thor
-Thoreau
-thoriate
-thorium
-thorn
-Thornton
-thorny
-thorough
-thoroughbred
-thoroughfare
-thoroughgoing
-Thorpe
-Thorstein
-those
-thou
-though
-thought
-thousand
-thousandth
-thrash
-thread
-threadbare
-threat
-threaten
-three
-threefold
-threesome
-thresh
-threshold
-threw
-thrice
-thrift
-thrifty
-thrill
-thrips
-thrive
-throat
-throaty
-throb
-throes
-thrombosis
-throne
-throng
-throttle
-through
-throughout
-throughput
-throw
-throwback
-thrown
-thrum
-thrush
-thrust
-Thruway
-Thuban
-thud
-thug
-thuggee
-Thule
-thulium
-thumb
-thumbnail
-thump
-thunder
-thunderbird
-thunderclap
-thunderflower
-thunderous
-thunderstorm
-Thurman
-Thursday
-thus
-thwack
-thwart
-thy
-thyme
-thyratron
-thyroglobulin
-thyroid
-thyroidal
-thyronine
-thyrotoxic
-thyroxine
-ti
-Tiber
-tibet
-Tibetan
-tibia
-tic
-tick
-ticket
-tickle
-ticklish
-tid
-tidal
-tidbit
-tide
-tideland
-tidewater
-tidings
-tidy
-tie
-tied
-Tientsin
-tier
-Tiffany
-tift
-tiger
-tight
-tighten
-tigress
-Tigris
-til
-tilde
-tile
-till
-tilt
-tilth
-Tim
-timber
-timberland
-timbre
-time
-timeout
-timepiece
-timeshare
-timetable
-timeworn
-Timex
-timid
-Timon
-timothy
-tin
-Tina
-tincture
-tinder
-tine
-tinfoil
-tinge
-tingle
-tinker
-tinkle
-tinsel
-tint
-tintype
-tiny
-Tioga
-tip
-tipoff
-Tipperary
-tipple
-tippy
-tipsy
-tiptoe
-tirade
-Tirana
-tire
-tiresome
-tissue
-tit
-Titan
-titanate
-titanic
-titanium
-tithe
-titian
-titillate
-title
-titmouse
-titrate
-titular
-Titus
-TNT
-to
-toad
-toady
-toast
-tobacco
-Tobago
-toccata
-today
-today'll
-Todd
-toddle
-toe
-toenail
-toffee
-tofu
-tog
-together
-togging
-toggle
-Togo
-togs
-toil
-toilet
-toilsome
-tokamak
-token
-Tokyo
-told
-Toledo
-tolerable
-tolerant
-tolerate
-toll
-tollgate
-tollhouse
-Tolstoy
-toluene
-Tom
-tomato
-tomatoes
-tomb
-tomblike
-tombstone
-tome
-Tomlinson
-Tommie
-tommy
-tomography
-tomorrow
-Tompkins
-ton
-tonal
-tone
-tong
-tongue
-Toni
-tonic
-tonight
-tonk
-tonnage
-tonsil
-tonsillitis
-tony
-too
-toodle
-took
-tool
-toolkit
-toolmake
-toolsmith
-toot
-tooth
-toothbrush
-toothpaste
-tootle
-top
-topaz
-topcoat
-Topeka
-topgallant
-topic
-topmost
-topnotch
-topocentric
-topography
-topology
-topple
-topsoil
-Topsy
-tor
-torah
-torch
-tore
-tori
-torn
-tornado
-toroid
-toroidal
-Toronto
-torpedo
-torpid
-torpor
-torque
-torr
-Torrance
-torrent
-torrid
-torsion
-torso
-tort
-tortoise
-tortoiseshell
-tortuous
-torture
-torus
-tory
-Toshiba
-toss
-tot
-total
-totalitarian
-tote
-totem
-totemic
-touch
-touchdown
-touchstone
-touchy
-tough
-tour
-tournament
-tousle
-tout
-tow
-toward
-towboat
-towel
-tower
-towhead
-towhee
-town
-townhouse
-Townsend
-townsman
-townsmen
-toxic
-toxicology
-toxin
-toy
-Toyota
-trace
-traceable
-tracery
-trachea
-track
-trackage
-tract
-tractor
-Tracy
-trade
-trademark
-tradeoff
-tradesman
-tradesmen
-tradition
-traffic
-trafficked
-trafficking
-trag
-tragedian
-tragedy
-tragic
-tragicomic
-trail
-trailblaze
-trailside
-train
-trainee
-trainman
-trainmen
-traipse
-trait
-traitor
-traitorous
-trajectory
-tram
-trammel
-tramp
-trample
-tramway
-trance
-tranquil
-tranquillity
-transact
-transalpine
-transatlantic
-transceiver
-transcend
-transcendent
-transcendental
-transconductance
-transcontinental
-transcribe
-transcript
-transcription
-transducer
-transduction
-transect
-transept
-transfer
-transferable
-transferee
-transference
-transferor
-transferral
-transferred
-transferring
-transfix
-transform
-transformation
-transfuse
-transfusion
-transgress
-transgression
-transgressor
-transient
-transistor
-transit
-Transite
-transition
-transitive
-transitory
-translate
-transliterate
-translucent
-transmissible
-transmission
-transmit
-transmittable
-transmittal
-transmittance
-transmitted
-transmitter
-transmitting
-transmutation
-transmute
-transoceanic
-transom
-transpacific
-transparent
-transpiration
-transpire
-transplant
-transplantation
-transport
-transportation
-transposable
-transpose
-transposition
-transship
-transversal
-transverse
-transvestite
-trap
-trapezium
-trapezoid
-trapezoidal
-trash
-trashy
-Trastevere
-trauma
-traumatic
-travail
-travel
-travelogue
-traversable
-traversal
-traverse
-travertine
-travesty
-Travis
-trawl
-tray
-treacherous
-treachery
-tread
-treadle
-treadmill
-treason
-treasonous
-treasure
-treasury
-treat
-treatise
-treaty
-treble
-tree
-treelike
-treetop
-trefoil
-trek
-trellis
-tremble
-tremendous
-tremor
-tremulous
-trench
-trenchant
-trencherman
-trenchermen
-trend
-trendy
-Trenton
-trepidation
-trespass
-tress
-trestle
-Trevelyan
-triable
-triac
-triad
-trial
-triangle
-triangular
-triangulate
-Triangulum
-Trianon
-triatomic
-tribal
-tribe
-tribesman
-tribesmen
-tribulate
-tribunal
-tribune
-tributary
-tribute
-Trichinella
-trichloroacetic
-trichloroethane
-trichrome
-trick
-trickery
-trickle
-trickster
-tricky
-trident
-tridiagonal
-tried
-triennial
-trifle
-trifluouride
-trig
-trigonal
-trigonometry
-trigram
-trill
-trillion
-trilobite
-trilogy
-trim
-trimer
-trimester
-Trinidad
-trinitarian
-trinity
-trinket
-trio
-triode
-trioxide
-trip
-tripartite
-tripe
-triphenylphosphine
-triple
-triplet
-Triplett
-triplex
-triplicate
-tripod
-tripoli
-triptych
-trisodium
-Tristan
-tristate
-trisyllable
-trite
-tritium
-triton
-triumph
-triumphal
-triumphant
-triune
-trivalent
-trivia
-trivial
-trivium
-trod
-trodden
-troglodyte
-troika
-Trojan
-troll
-trolley
-trollop
-trombone
-trompe
-troop
-trophic
-trophy
-tropic
-tropopause
-troposphere
-tropospheric
-trot
-trouble
-troubleshoot
-troublesome
-trough
-trounce
-troupe
-trouser
-trout
-Troutman
-troy
-truancy
-truant
-truce
-truck
-truculent
-trudge
-Trudy
-true
-truism
-truly
-Truman
-Trumbull
-trump
-trumpery
-trumpet
-truncate
-trundle
-trunk
-truss
-trust
-trustee
-trustworthy
-truth
-TRW
-try
-trypsin
-tsar
-tsarina
-tsunami
-TTL
-TTY
-tub
-tuba
-tube
-tuberculin
-tuberculosis
-tubular
-tubule
-tuck
-Tucson
-Tudor
-Tuesday
-tuff
-tuft
-tug
-tugging
-tuition
-Tulane
-tularemia
-tulip
-tulle
-Tulsa
-tum
-tumble
-tumbrel
-tumult
-tumultuous
-tun
-tuna
-tundra
-tune
-tung
-tungstate
-tungsten
-tunic
-Tunis
-Tunisia
-tunnel
-tupelo
-turban
-turbinate
-turbine
-turbofan
-turbojet
-turbulent
-turf
-Turin
-Turing
-turk
-turkey
-Turkish
-turmoil
-turn
-turnabout
-turnaround
-turnery
-turnip
-turnkey
-turnoff
-turnout
-turnover
-turnpike
-turnstone
-turntable
-turpentine
-turpitude
-turquoise
-turret
-turtle
-turtleback
-turtleneck
-turvy
-Tuscaloosa
-Tuscan
-Tuscany
-Tuscarora
-tusk
-Tuskegee
-tussle
-tutelage
-tutor
-tutorial
-Tuttle
-tutu
-tuxedo
-TV
-TVA
-TWA
-twaddle
-twain
-tweak
-tweed
-tweedy
-tweeze
-twelfth
-twelve
-twentieth
-twenty
-twice
-twiddle
-twig
-twigging
-twilight
-twill
-twin
-twine
-twinge
-twinkle
-twirl
-twirly
-twist
-twisty
-twit
-twitch
-twitchy
-two
-twofold
-Twombly
-twosome
-TWX
-Tyburn
-tycoon
-tying
-Tyler
-Tyndall
-type
-typeface
-typescript
-typeset
-typesetter
-typesetting
-typewrite
-typewritten
-typhoid
-Typhon
-typhoon
-typhus
-typic
-typify
-typo
-typographer
-typography
-typology
-tyrannic
-tyrannicide
-tyranny
-tyrant
-tyrosine
-Tyson
-u
-u's
-ubiquitous
-ubiquity
-UCLA
-Uganda
-ugh
-ugly
-UK
-Ukrainian
-Ulan
-ulcer
-ulcerate
-Ullman
-Ulster
-ulterior
-ultimate
-ultimatum
-ultra
-Ulysses
-umber
-umbilical
-umbilici
-umbilicus
-umbra
-umbrage
-umbrella
-umpire
-UN
-unanimity
-unanimous
-unary
-unbeknownst
-unbidden
-unchristian
-uncle
-uncouth
-unction
-under
-underclassman
-underclassmen
-underling
-undulate
-UNESCO
-uniaxial
-unicorn
-unidimensional
-unidirectional
-uniform
-unify
-unilateral
-unimodal
-uninominal
-union
-uniplex
-unipolar
-uniprocessor
-unique
-Uniroyal
-unison
-unit
-unitarian
-unitary
-unite
-unity
-Univac
-univalent
-univariate
-universal
-universe
-Unix
-unkempt
-unruly
-until
-unwieldy
-up
-upbeat
-upbraid
-upbring
-upcome
-update
-updraft
-upend
-upgrade
-upheaval
-upheld
-uphill
-uphold
-upholster
-upholstery
-upkeep
-upland
-uplift
-upon
-upper
-upperclassman
-upperclassmen
-uppercut
-uppermost
-upraise
-upright
-uprise
-upriver
-uproar
-uproarious
-uproot
-upset
-upsetting
-upshot
-upside
-upsilon
-upslope
-upstair
-upstand
-upstate
-upstater
-upstream
-upsurge
-upswing
-uptake
-Upton
-uptown
-uptrend
-upturn
-upward
-upwind
-urania
-uranium
-Uranus
-uranyl
-urban
-Urbana
-urbane
-urbanite
-urchin
-urea
-uremia
-urethane
-urethra
-urge
-urgency
-urgent
-urging
-urinal
-urinary
-urine
-Uris
-urn
-Ursa
-Ursula
-Ursuline
-Uruguay
-us
-USA
-usable
-USAF
-usage
-USC
-USC&GS
-USDA
-use
-USGS
-usher
-USIA
-USN
-USPS
-USSR
-usual
-usurer
-usurious
-usurp
-usurpation
-usury
-Utah
-utensil
-uterine
-Utica
-utile
-utilitarian
-utility
-utmost
-utopia
-utopian
-utter
-utterance
-uttermost
-v
-v's
-vacant
-vacate
-vacationland
-vaccinate
-vaccine
-vacillate
-vacua
-vacuo
-vacuolate
-vacuole
-vacuous
-vacuum
-vade
-Vaduz
-vagabond
-vagary
-vagina
-vaginal
-vagrant
-vague
-Vail
-vain
-vainglorious
-vale
-valediction
-valedictorian
-valedictory
-valent
-valentine
-Valerie
-Valery
-valet
-valeur
-Valhalla
-valiant
-valid
-validate
-Valkyrie
-Valletta
-valley
-Valois
-valuate
-value
-valve
-vamp
-vampire
-van
-vanadium
-Vance
-Vancouver
-vandal
-Vandenberg
-Vanderbilt
-Vanderpoel
-vanguard
-vanilla
-vanish
-vanity
-vanquish
-vantage
-variable
-variac
-Varian
-variant
-variate
-variegate
-variety
-various
-varistor
-Varitype
-varnish
-vary
-vascular
-vase
-vassal
-vast
-vat
-Vatican
-vaudeville
-Vaudois
-Vaughan
-Vaughn
-vault
-veal
-vector
-vectorial
-Veda
-vee
-veer
-veery
-Vega
-vegetable
-vegetarian
-vegetate
-vehement
-vehicle
-vehicular
-veil
-vein
-Velasquez
-veldt
-Vella
-vellum
-velocity
-velours
-velvet
-velvety
-venal
-vend
-vendetta
-vendible
-vendor
-veneer
-venerable
-venerate
-venereal
-Venetian
-Veneto
-Venezuela
-vengeance
-vengeful
-venial
-Venice
-venison
-venom
-venomous
-venous
-vent
-ventilate
-ventricle
-venture
-venturesome
-venturi
-Venus
-Venusian
-Vera
-veracious
-veracity
-veranda
-verandah
-verb
-verbal
-verbatim
-verbena
-verbiage
-verbose
-verbosity
-verdant
-Verde
-Verdi
-verdict
-verge
-veridic
-verify
-verisimilitude
-veritable
-verity
-Verlag
-vermeil
-vermiculite
-vermilion
-vermin
-Vermont
-vermouth
-Verna
-vernacular
-vernal
-Verne
-vernier
-Vernon
-Verona
-Veronica
-versa
-Versailles
-versatile
-verse
-version
-versus
-vertebra
-vertebrae
-vertebral
-vertebrate
-vertex
-vertical
-vertices
-vertigo
-verve
-very
-vesicular
-vesper
-vessel
-vest
-vestal
-vestibule
-vestige
-vestigial
-vestry
-vet
-vetch
-veteran
-veterinarian
-veterinary
-veto
-vex
-vexation
-vexatious
-vi
-via
-viaduct
-vial
-vibrant
-vibrate
-vibrato
-viburnum
-vicar
-vicarious
-vice
-vicelike
-viceroy
-Vichy
-vicinal
-vicinity
-vicious
-vicissitude
-Vicksburg
-Vicky
-victim
-victor
-Victoria
-Victorian
-victorious
-victory
-victrola
-victual
-Vida
-video
-videotape
-vie
-Vienna
-Viennese
-Vientiane
-Viet
-Vietnam
-Vietnamese
-view
-viewpoint
-vigil
-vigilant
-vigilante
-vigilantism
-vignette
-vigorous
-vii
-viii
-Viking
-vile
-vilify
-villa
-village
-villain
-villainous
-villein
-Vincent
-vindicate
-vindictive
-vine
-vinegar
-vineyard
-Vinson
-vintage
-vintner
-vinyl
-viola
-violate
-violent
-violet
-violin
-Virgil
-virgin
-virginal
-Virginia
-Virginian
-Virgo
-virgule
-virile
-virtual
-virtue
-virtuosi
-virtuosity
-virtuoso
-virtuous
-virulent
-virus
-vis
-visa
-visage
-viscera
-visceral
-viscoelastic
-viscometer
-viscosity
-viscount
-viscous
-vise
-viselike
-Vishnu
-visible
-Visigoth
-vision
-visionary
-visit
-visitation
-visitor
-visor
-vista
-visual
-vita
-vitae
-vital
-vitamin
-vitiate
-Vito
-vitreous
-vitrify
-vitriol
-vitriolic
-vitro
-viva
-vivace
-vivacious
-vivacity
-Vivaldi
-Vivian
-vivid
-vivify
-vivo
-vixen
-viz
-Vladimir
-Vladivostok
-vocable
-vocabularian
-vocabulary
-vocal
-vocalic
-vocate
-vociferous
-Vogel
-vogue
-voice
-voiceband
-void
-volatile
-volcanic
-volcanism
-volcano
-volition
-Volkswagen
-volley
-volleyball
-Volstead
-volt
-Volta
-voltage
-voltaic
-Voltaire
-Volterra
-voltmeter
-voluble
-volume
-voluminous
-voluntary
-volunteer
-voluptuous
-Volvo
-vomit
-von
-voodoo
-voracious
-voracity
-vortex
-vortices
-vorticity
-Voss
-votary
-vote
-votive
-vouch
-vouchsafe
-Vought
-vow
-vowel
-voyage
-Vreeland
-Vulcan
-vulgar
-vulnerable
-vulpine
-vulture
-vulturelike
-vying
-w
-w's
-Waals
-Wabash
-WAC
-wack
-wacke
-wacky
-Waco
-wad
-waddle
-wade
-wadi
-Wadsworth
-wafer
-waffle
-wag
-wage
-wagging
-waggle
-Wagner
-wagoneer
-wah
-Wahl
-wail
-wainscot
-Wainwright
-waist
-waistcoat
-waistline
-wait
-Waite
-waitress
-waive
-wake
-Wakefield
-waken
-wakerobin
-wakeup
-Walcott
-Walden
-Waldo
-Waldorf
-Waldron
-wale
-Walgreen
-walk
-walkie
-walkout
-walkover
-walkway
-wall
-wallaby
-Wallace
-wallboard
-Waller
-wallet
-Wallis
-wallop
-wallow
-wallpaper
-Walls
-wally
-walnut
-Walpole
-walrus
-Walsh
-Walt
-Walter
-Walters
-Waltham
-Walton
-waltz
-wan
-wand
-wander
-wane
-Wang
-wangle
-want
-wanton
-wapato
-wapiti
-Wappinger
-war
-warble
-ward
-warden
-wardrobe
-wardroom
-ware
-warehouse
-warehouseman
-warfare
-warhead
-Waring
-warlike
-warm
-warmhearted
-warmish
-warmonger
-warmth
-warmup
-warn
-warp
-warrant
-warranty
-warren
-warrior
-Warsaw
-wart
-wartime
-warty
-Warwick
-wary
-was
-wash
-washbasin
-washboard
-washbowl
-Washburn
-Washington
-washout
-washy
-wasn't
-wasp
-waspish
-Wasserman
-wast
-wastage
-waste
-wastebasket
-wasteland
-wastewater
-wastrel
-watch
-watchband
-watchdog
-watchmake
-watchman
-watchmen
-watchword
-water
-Waterbury
-watercourse
-waterfall
-waterfront
-Watergate
-Waterhouse
-waterline
-Waterloo
-Waterman
-watermelon
-waterproof
-Waters
-watershed
-waterside
-Watertown
-waterway
-watery
-Watkins
-Watson
-watt
-wattage
-wattle
-Watts
-wave
-waveform
-wavefront
-waveguide
-wavelength
-wavenumber
-wavy
-wax
-waxen
-waxwork
-waxy
-way
-waybill
-waylaid
-waylay
-Wayne
-wayside
-wayward
-we
-we'd
-we'll
-we're
-we've
-weak
-weaken
-weal
-wealth
-wealthy
-wean
-weapon
-weaponry
-wear
-wearied
-wearisome
-weary
-weasel
-weather
-weatherbeaten
-weatherproof
-weatherstrip
-weave
-web
-Webb
-weber
-Webster
-WECo
-wed
-wedge
-wedlock
-Wednesday
-wee
-weed
-weedy
-week
-weekday
-weekend
-Weeks
-weep
-Wehr
-Wei
-Weierstrass
-weigh
-weight
-weighty
-Weinberg
-Weinstein
-weir
-weird
-Weiss
-Welch
-welcome
-weld
-Weldon
-welfare
-well
-wellbeing
-Weller
-Welles
-Wellesley
-wellington
-Wells
-welsh
-welt
-Wendell
-Wendy
-went
-wept
-were
-weren't
-Werner
-wert
-Werther
-Wesley
-Wesleyan
-west
-westbound
-Westchester
-westerly
-western
-westernmost
-Westfield
-Westinghouse
-Westminster
-Weston
-westward
-wet
-wetland
-Weyerhauser
-whack
-whale
-Whalen
-wham
-wharf
-Wharton
-wharves
-what
-what'd
-what're
-whatever
-Whatley
-whatnot
-whatsoever
-wheat
-Wheatstone
-whee
-wheedle
-wheel
-wheelbase
-wheelchair
-wheelhouse
-wheeze
-wheezy
-Whelan
-whelk
-Wheller
-whelm
-whelp
-when
-whence
-whenever
-where
-where'd
-where're
-whereabout
-whereas
-whereby
-wherefore
-wherein
-whereof
-whereon
-wheresoever
-whereupon
-wherever
-wherewith
-whet
-whether
-which
-whichever
-whiff
-whig
-while
-whim
-whimper
-whimsey
-whimsic
-whine
-whinny
-whip
-whiplash
-Whippany
-whippet
-Whipple
-whipsaw
-whir
-whirl
-whirligig
-whirlpool
-whirlwind
-whisk
-whisper
-whistle
-whistleable
-whit
-Whitaker
-Whitcomb
-white
-whiteface
-Whitehall
-whitehead
-Whitehorse
-whiten
-whitetail
-whitewash
-whither
-Whitlock
-Whitman
-Whitney
-Whittaker
-Whittier
-whittle
-whiz
-who
-who'd
-who'll
-whoa
-whoever
-whole
-wholehearted
-wholesale
-wholesome
-wholly
-whom
-whomsoever
-whoop
-whoosh
-whop
-whore
-whose
-whosoever
-whup
-why
-Wichita
-wick
-wicket
-wide
-widen
-widespread
-widgeon
-widget
-widow
-widowhood
-width
-widthwise
-wield
-wiener
-Wier
-wife
-wig
-wigging
-Wiggins
-wiggle
-wiggly
-wigmake
-wigwam
-Wilbur
-Wilcox
-wild
-wildcat
-wildcatter
-wilderness
-wildfire
-wildlife
-wile
-Wiley
-Wilfred
-wilful
-Wilhelm
-Wilhelmina
-Wilkes
-Wilkins
-Wilkinson
-will
-Willa
-Willard
-William
-Williams
-Williamsburg
-Williamson
-Willie
-Willis
-Willoughby
-willow
-willowy
-Wills
-Wilma
-Wilmington
-Wilshire
-Wilson
-Wilsonian
-wilt
-wily
-win
-wince
-winch
-Winchester
-wind
-windbag
-windbreak
-windfall
-windmill
-window
-windowpane
-windowsill
-windshield
-Windsor
-windstorm
-windup
-windward
-windy
-wine
-winemake
-winemaster
-winery
-wineskin
-Winfield
-wing
-wingback
-wingman
-wingmen
-wingspan
-wingtip
-Winifred
-wink
-winkle
-Winnetka
-Winnie
-Winnipeg
-Winnipesaukee
-winnow
-wino
-Winslow
-winsome
-Winston
-winter
-Winters
-wintertime
-Winthrop
-wintry
-winy
-wipe
-wire
-wireman
-wiremen
-wiry
-Wisconsin
-wisdom
-wise
-wiseacre
-wisecrack
-wisenheimer
-wish
-wishbone
-wishy
-wisp
-wispy
-wit
-witch
-witchcraft
-with
-withal
-withdraw
-withdrawal
-withdrawn
-withdrew
-withe
-wither
-withheld
-withhold
-within
-without
-withstand
-withstood
-withy
-witness
-Witt
-witty
-wive
-wizard
-wobble
-woe
-woebegone
-wok
-woke
-Wolcott
-wold
-wolf
-Wolfe
-Wolff
-Wolfgang
-wolfish
-wolve
-woman
-womanhood
-womb
-women
-won
-won't
-wonder
-wonderland
-wondrous
-Wong
-wont
-woo
-wood
-Woodard
-Woodbury
-woodcarver
-woodcock
-woodcut
-wooden
-woodgrain
-woodhen
-woodland
-Woodlawn
-woodlot
-woodpeck
-woodrow
-woodruff
-Woods
-woodshed
-woodside
-woodward
-woodwind
-woodwork
-woody
-woodyard
-wool
-woolen
-woolgather
-Woolworth
-Wooster
-wop
-Worcester
-word
-Wordsworth
-wordy
-wore
-work
-workbench
-workbook
-workday
-workhorse
-workload
-workman
-workmanlike
-workmen
-workout
-workpiece
-worksheet
-workshop
-workspace
-worktable
-world
-worldwide
-worm
-wormy
-worn
-worrisome
-worry
-worse
-worsen
-worship
-worst
-worth
-Worthington
-worthwhile
-worthy
-Wotan
-would
-wouldn't
-wound
-wove
-woven
-wow
-wrack
-wraith
-wrangle
-wrap
-wrapup
-wrath
-wreak
-wreath
-wreathe
-wreck
-wreckage
-wrench
-wrest
-wrestle
-wretch
-wriggle
-wright
-Wrigley
-wring
-wrinkle
-wrist
-wristband
-wristwatch
-writ
-write
-writeup
-writhe
-written
-wrong
-wrongdo
-Wronskian
-wrote
-wrought
-wry
-Wu
-Wuhan
-Wyandotte
-Wyatt
-Wyeth
-Wylie
-Wyman
-Wyner
-wynn
-Wyoming
-x
-x's
-Xavier
-xenon
-xenophobia
-xerography
-Xerox
-Xerxes
-xi
-xylem
-xylene
-xylophone
-y
-y's
-yacht
-yachtsman
-yachtsmen
-yah
-yak
-Yakima
-Yale
-Yalta
-yam
-Yamaha
-yang
-yank
-Yankee
-Yankton
-Yaounde
-yap
-yapping
-Yaqui
-yard
-yardage
-yardstick
-Yarmouth
-yarmulke
-yarn
-yarrow
-Yates
-yaw
-yawl
-yawn
-ye
-yea
-Yeager
-yeah
-year
-yearbook
-yearn
-yeast
-yeasty
-Yeats
-yell
-yellow
-yellowish
-Yellowknife
-yelp
-Yemen
-yen
-yeoman
-yeomanry
-yeshiva
-yesterday
-yesteryear
-yet
-Yiddish
-yield
-yin
-yip
-yipping
-YMCA
-yodel
-Yoder
-yoga
-yogi
-yoke
-yokel
-Yokohama
-Yokuts
-yolk
-yon
-yond
-Yonkers
-yore
-York
-Yorktown
-Yosemite
-Yost
-you
-you'd
-you'll
-you're
-you've
-young
-youngish
-youngster
-Youngstown
-your
-yourself
-yourselves
-youth
-yow
-Ypsilanti
-ytterbium
-yttrium
-Yucatan
-yucca
-Yugoslav
-Yugoslavia
-yuh
-Yuki
-Yukon
-yule
-Yves
-Yvette
-YWCA
-z
-z's
-Zachary
-zag
-zagging
-Zaire
-Zambia
-Zan
-Zanzibar
-zap
-zeal
-Zealand
-zealot
-zealous
-zebra
-Zeiss
-Zellerbach
-Zen
-zenith
-zero
-zeroes
-zeroth
-zest
-zesty
-zeta
-Zeus
-Ziegler
-zig
-zigging
-zigzag
-zilch
-Zimmerman
-zinc
-zing
-Zion
-Zionism
-zip
-zircon
-zirconium
-zloty
-zodiac
-zodiacal
-Zoe
-Zomba
-zombie
-zone
-zoo
-zoology
-zoom
-Zoroaster
-Zoroastrian
-zounds
-zucchini
-Zurich
diff --git a/.ref-Research-V7/usr/doc/README b/.ref-Research-V7/usr/doc/README
deleted file mode 100644 (file)
index 98a97e4..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-This directory contains source for most of the
-documents contained in Volume 2 of The UNIX
-Programmer's Manual, 7th Edition.
-Most use -ms to format; many also use
-refer, tbl and eqn. Precise incantations
-are engraved in ./run.
-
-The citations for those papers that use
-refer are taken from /usr/dict/papers/Rv7man.
diff --git a/.ref-Research-V7/usr/doc/adb/tut b/.ref-Research-V7/usr/doc/adb/tut
deleted file mode 100644 (file)
index 13d3ed2..0000000
+++ /dev/null
@@ -1,1292 +0,0 @@
-.de P1
-.sp .5
-.if \\n(.$>0 .ta \\$1 \\$2 \\$3 \\$4 \\$5 \\$6
-.if \\n(.$=0 .ta 1i 1.7i 2.5i
-.ft 3
-.nf
-..
-.de P2
-.sp .5
-.ft 1
-.fi
-..
-.RP
-.....TM "77-8234-11 77-1273-10" "49170-220 39199" "40952-1 39199-11"
-.ND May 5, 1977
-.TL
-A Tutorial Introduction to ADB
-.AU "MH2F-207" "3816"
-J. F. Maranzano
-.AU "MH2C-512" 7419
-S. R. Bourne
-.AI
-.MH
-.OK
-UNIX
-Debugging
-C Programming
-.AB
-.PP
-Debugging tools generally provide a wealth of information
-about the inner workings of programs.
-These tools have been available on
-.UX
-to allow users to
-examine ``core'' files 
-that result from aborted programs.
-A new debugging program, ADB, provides enhanced capabilities
-to examine "core" and other program files in a
-variety of formats, run programs with embedded breakpoints and patch files.
-.PP
-ADB is an indispensable but complex tool for debugging crashed systems and/or
-programs.
-This document provides an introduction to ADB with examples of its use.
-It explains the various formatting options, 
-techniques for debugging C programs, examples of printing
-file system information and patching.
-.AE
-.CS 12 15 27 13 0 5
-.NH
-Introduction
-.PP
-ADB is a new debugging program that is
-available on UNIX.
-It provides capabilities to look at
-``core'' files resulting from aborted programs, print output in a
-variety of formats, patch files, and run programs
-with embedded breakpoints.
-This document provides examples of
-the more useful features of ADB.
-The reader is expected to be
-familiar with the basic commands on
-.UX
-with the C
-language, and with References 1, 2 and 3.
-.NH
-A Quick Survey
-.NH 2
-Invocation
-.PP
-ADB is invoked as:
-.P1
-       adb objfile corefile
-.P2
-where
-.ul
-objfile
-is an executable UNIX file and 
-.ul
-corefile 
-is a core image file.
-Many times this will look like:
-.P1
-       adb a.out core
-.P2
-or more simply:
-.P1
-       adb
-.P2
-where the defaults are 
-.ul
-a.out
-and
-.ul
-core
-respectively.
-The filename minus (\-) means ignore this argument as in:
-.P1
-       adb \- core
-.P2
-.PP
-ADB has requests for examining locations in either file.
-The
-\fB?\fP
-request examines the contents of 
-.ul
-objfile,
-the
-\fB/\fP
-request examines the 
-.ul
-corefile.
-The general form of these requests is:
-.P1
-       address ? format
-.P2
-or
-.P1
-       address / format
-.P2
-.NH 2
-Current Address
-.PP
-ADB maintains a current address, called dot,
-similar in function to the current pointer in the UNIX editor.
-When an address is entered, the current address is set to that location,
-so that:
-.P1
-       0126?i
-.P2
-sets dot to octal 126 and prints the instruction
-at that address.
-The request:
-.P1
-       .,10/d
-.P2
-prints 10 decimal numbers starting at dot.
-Dot ends up referring to the address of the last item printed.
-When used with the \fB?\fP or \fB/\fP requests,
-the current address can be advanced by typing newline; it can be decremented
-by typing \fB^\fP.
-.PP
-Addresses are represented by
-expressions.
-Expressions are made up from decimal, octal, and hexadecimal integers,
-and symbols from the program under test.
-These may be combined with the operators +, \-, *, % (integer division), 
-& (bitwise and), | (bitwise inclusive or),  # (round up
-to the next multiple), and ~ (not).
-(All arithmetic within ADB is 32 bits.)
-When typing a symbolic address for a C program, 
-the user can type 
-.ul
-name
-or
-.ul
-_name;
-ADB will recognize both forms.
-.NH 2
-Formats
-.PP
-To print data, a user specifies a collection of letters and characters
-that describe the format of the printout.
-Formats are "remembered" in the sense that typing a request without one
-will cause the new printout to appear in the previous format.
-The following are the most commonly used format letters.
-.P1
-\fB    b       \fPone byte in octal
-\fB    c       \fPone byte as a character
-\fB    o       \fPone word in octal
-\fB    d       \fPone word in decimal
-\fB    f       \fPtwo words in floating point
-\fB    i       \fPPDP 11 instruction
-\fB    s       \fPa null terminated character string
-\fB    a       \fPthe value of dot
-\fB    u       \fPone word as unsigned integer
-\fB    n       \fPprint a newline
-\fB    r       \fPprint a blank space
-\fB    ^       \fPbackup dot
-.P2
-(Format letters are also available for "long" values,
-for example, `\fBD\fR' for long decimal, and `\fBF\fP' for double floating point.)
-For other formats see the ADB manual.
-.NH 2
-General Request Meanings
-.PP
-The general form of a request is:
-.P1
-       address,count command modifier
-.P2
-which sets `dot' to \fIaddress\fP
-and executes the command
-\fIcount\fR times.
-.PP
-The following table illustrates some general ADB command meanings:
-.P1
-       Command Meaning
-\fB        ?   \fPPrint contents from \fIa.out\fP file
-\fB        /   \fPPrint contents from \fIcore\fP file
-\fB        =   \fPPrint value of "dot"
-\fB        :   \fPBreakpoint control
-\fB        $   \fPMiscellaneous requests
-\fB        ;   \fPRequest separator
-\fB        !   \fPEscape to shell
-.P2
-.PP
-ADB catches signals, so a user cannot use a quit signal to exit from ADB.
-The request $q or $Q (or cntl-D) must be used
-to exit from ADB.
-.NH
-Debugging C Programs
-.NH 2
-Debugging A Core Image 
-.PP
-Consider the C program in Figure 1.
-The program is used to illustrate a common error made by
-C programmers.
-The object of the program is to change the
-lower case "t" to upper case in the string pointed to by
-.ul
-charp
-and then write the character string to the file indicated by
-argument 1.
-The bug shown is that the character "T"
-is stored in the pointer 
-.ul
-charp
-instead of the string pointed to by
-.ul
-charp.
-Executing the program produces a core file because of an out of bounds memory reference.
-.PP
-ADB is invoked by:
-.P1
-       adb a.out core
-.P2
-The first debugging request:
-.P1
-       $c
-.P2
-is used to give a C backtrace through the
-subroutines called.
-As shown in Figure 2
-only one function (\fImain\fR) was called and the
-arguments 
-.ul
-argc 
-and 
-.ul
-argv 
-have octal values 02 and
-0177762 respectively.
-Both of these values look
-reasonable; 02 = two arguments, 0177762 = address on stack
-of parameter vector.
-.br
-The next request:
-.P1
-       $C
-.P2
-is used to give a C backtrace plus an interpretation
-of all the local variables in each function and their
-values in octal.
-The value of the variable 
-.ul
-cc
-looks incorrect
-since
-.ul
-cc
-was declared as a character.
-.PP
-The next request:
-.P1
-       $r
-.P2
-prints out the registers including the program
-counter and an interpretation of the instruction at that
-location.
-.PP
-The request:
-.P1
-       $e
-.P2
-prints out the values of all external variables.
-.PP
-A map exists for each file
-handled by
-ADB.
-The map for the
-.ul
-a.out
-file is referenced by \fB?\fP whereas the map for 
-.ul
-core
-file is referenced by \fB/\fP.
-Furthermore, a good rule of thumb is to use \fB?\fP for
-instructions and \fB/\fP for data when looking at programs.
-To print out information about the maps type:
-.P1
-       $m
-.P2
-This produces a report of the contents of the maps.
-More about these maps later.
-.PP
-In our example, it is useful to see the
-contents of the string pointed to by
-.ul
-charp.
-This is done by:
-.P1
-       *charp/s
-.P2
-which says use 
-.ul
-charp
-as a pointer in the
-.ul
-core
-file
-and print the information as a character string.
-This printout clearly shows that the character buffer
-was incorrectly overwritten and helps identify the error.
-Printing the locations around 
-.ul
-charp
-shows that the buffer is unchanged
-but that the pointer is destroyed.
-Using ADB similarly, we could print information about the
-arguments to a function.
-The request:
-.P1
-       main.argc/d
-.P2
-prints the decimal 
-.ul
-core
-image value of the argument 
-.ul
-argc
-in the function 
-.ul
-main.
-.br
-The request:
-.P1
-       *main.argv,3/o
-.P2
-prints the octal values of the three consecutive
-cells pointed to by 
-.ul
-argv
-in the function 
-.ul
-main.
-Note that these values are the addresses of the arguments
-to main.
-Therefore: 
-.P1
-       0177770/s
-.P2
-prints the ASCII value of the first argument.
-Another way to print this value would have been
-.P1
-       *"/s
-.P2
-The " means ditto which remembers the last address
-typed, in this case \fImain.argc\fP ; the \fB*\fP instructs ADB to use the address field of the
-.ul
-core 
-file as a pointer.
-.PP
-The request:
-.P1
-       .=o
-.P2
-prints the current address (not its contents) in octal which has been set to the address of the first argument.
-The current address, dot, is used by ADB to
-"remember" its current location.
-It allows the user 
-to reference locations relative to the current
-address, for example:
-.P1
-       .\-10/d
-.P2
-.NH 2
-Multiple Functions
-.PP
-Consider the C program illustrated in
-Figure 3.
-This program calls functions 
-.ul
-f, g,
-and
-.ul
-h 
-until the stack is exhausted and a core image is produced.
-.PP
-Again you can enter the debugger via:
-.P1
-       adb
-.P2
-which assumes the names 
-.ul
-a.out
-and 
-.ul
-core
-for the executable
-file and core image file respectively.
-The request:
-.P1
-       $c
-.P2
-will fill a page of backtrace references to 
-.ul
-f, g,
-and
-.ul
-h.
-Figure 4 shows an abbreviated list (typing 
-.ul
-DEL
-will terminate the output and bring you back to ADB request level).
-.PP
-The request:
-.P1
-       ,5$C
-.P2
-prints the five most recent activations.
-.PP
-Notice that each function 
-(\fIf,g,h\fP) has a counter
-of the number of times it was called.
-.PP
-The request:
-.P1
-       fcnt/d
-.P2
-prints the decimal value of the counter for the function
-.ul
-f.
-Similarly 
-.ul
-gcnt
-and
-.ul
-hcnt
-could be printed.
-To print the value of an automatic variable,
-for example the decimal value of
-.ul 
-x
-in the last call of the function
-.ul
-h,
-type:
-.P1
-       h.x/d
-.P2
-It is currently not possible in the exported version to print stack frames other than the most recent activation of a function.
-Therefore, a user can print everything with 
-\fB$C\fR or the occurrence of a variable in the most recent call of a function.
-It is possible with the \fB$C\fR request, however, to print the stack frame
-starting at some address as \fBaddress$C.\fR
-.NH 2
-Setting Breakpoints
-.PP
-Consider the C program in Figure 5.
-This program, which changes tabs into blanks, is adapted from
-.ul
-Software Tools
-by Kernighan and Plauger, pp. 18-27.
-.PP
-We will run this program under the control of ADB (see Figure 6a) by:
-.P1
-       adb a.out \-
-.P2
-Breakpoints are set in the program as:
-.ul
-.P1
-       address:b  [request]
-.P2
-The requests:
-.P1
-       settab+4:b
-       fopen+4:b
-       getc+4:b
-       tabpos+4:b
-.P2
-set breakpoints at the start of these functions.
-C does not generate statement labels.
-Therefore it is currently not possible to plant breakpoints at locations
-other than function entry points without a knowledge of the code
-generated by the C compiler.
-The above addresses are entered as
-.ft B
-symbol+4
-.ft R
-so that they will appear in any
-C backtrace since the first instruction of each function is a call
-to the C save routine 
-(\fIcsv\fR).
-Note that some of the functions are from the C library.
-.PP
-To print the location of breakpoints one types:
-.P1
-       $b
-.P2
-The display indicates a
-.ul
-count
-field.
-A breakpoint is bypassed
-.ul
-count \-1
-times before causing a stop.
-The
-.ul
-command
-field indicates the ADB requests to be executed each time the breakpoint is encountered.
-In our example no
-.ul
-command
-fields are present.
-.PP
-By displaying the original instructions at the function
-.ul
-settab
-we see that 
-the breakpoint is set after the jsr to the C save routine.
-We can display the instructions using the ADB request:
-.P1
-       settab,5?ia
-.P2
-This request displays five instructions starting at
-.ul
-settab
-with the addresses of each location displayed.
-Another variation is:
-.P1
-       settab,5?i
-.P2
-which displays the instructions with only the starting address.
-.PP
-Notice that we accessed the addresses from the 
-.ul
-a.out 
-file with the \fB?\fP command.
-In general when asking for a printout of multiple items,
-ADB will advance the current address the number of
-bytes necessary to satisfy the request; in the above
-example five instructions were displayed and the current address was
-advanced 18 (decimal) bytes.
-.PP
-To run the program one simply types:
-.P1
-       :r
-.P2
-To delete a breakpoint, for instance the entry to the function
-.ul
-settab,
-one types:
-.P1
-       settab+4:d
-.P2
-To continue execution of the program from the breakpoint type:
-.P1
-       :c
-.PP
-Once the program has stopped (in this case at the breakpoint for
-.ul
-fopen),
-ADB requests can be used to display the contents of memory.
-For example:
-.P1
-       $C
-.P2
-to display a stack trace, or:
-.P1
-       tabs,3/8o
-.P2
-to print three lines of 8 locations each from the array called
-.ul
-tabs.
-By this time (at location
-.ul
-fopen)
-in the C program,
-.ul
-settab
-has been called and should have set a one in every eighth location of 
-.ul
-tabs.
-.NH 2
-Advanced Breakpoint Usage
-.PP
-We continue execution of the program with:
-.P1
-       :c
-.P2
-See Figure 6b.
-.ul
-Getc
-is called three times and  the contents of the variable 
-.ul
-c
-in the function
-.ul
-main
-are displayed
-each time.
-The single character on the left hand edge is the output from the C program.
-On the third occurrence of 
-.ul
-getc
-the program stops.
-We can look at the full buffer of characters by typing:
-.P1
-       ibuf+6/20c
-.P2
-When we continue the program with:
-.P1
-       :c
-.P2
-we hit our first breakpoint at
-.ul
-tabpos
-since there is a tab following the
-"This" word of the data.
-.PP
-Several breakpoints of
-.ul
-tabpos
-will occur until the program has changed the tab into equivalent blanks.
-Since we feel that
-.ul
-tabpos
-is working,
-we can remove the breakpoint at that location by:
-.P1
-       tabpos+4:d
-.P2
-If the program is continued with:
-.P1
-       :c
-.P2
-it resumes normal execution after ADB prints
-the message
-.P1
-       a.out:running
-.P2
-.PP
-The UNIX quit and interrupt signals
-act on ADB itself rather than on the program being debugged.
-If such a signal occurs then the program being debugged is stopped and control is returned to ADB.
-The signal is saved by ADB and is passed on to the test program if:
-.P1
-       :c
-.P2
-is typed.
-This can be useful when testing interrupt
-handling routines.
-The signal is not passed on to the test program if:
-.P1
-       :c  0
-.P2
-is typed.
-.PP
-Now let us reset the breakpoint at
-.ul
-settab
-and display the instructions located there when we reach the breakpoint.
-This is accomplished by:
-.P1
-       settab+4:b  settab,5?ia  \fR*
-.P2
-.FS
-* Owing to a bug in early versions of ADB (including the
-version distributed in Generic 3 UNIX) these statements
-must be written as:
-.br
-.in 1i
-\fBsettab+4:b  settab,5?ia;0\fR
-.ft B
-.br
-getc+4,3:b     main.c?C;0
-.br
-settab+4:b     settab,5?ia; ptab/o;0
-.br
-.ft R
-.in -1i
-Note that \fB;0\fR will set dot to zero and stop at the breakpoint.
-.FE
-It is also possible to execute the ADB requests for each occurrence of the breakpoint but
-only stop after the third occurrence by typing:
-.P1
-       getc+4,3:b  main.c?C  \fR*
-.P2
-This request will print the local variable 
-.ul
-c
-in the function 
-.ul
-main
-at each occurrence of the breakpoint.
-The semicolon is used to separate multiple ADB requests on a single line.
-.PP
-Warning:
-setting a breakpoint causes the value of dot to be changed;
-executing the program under ADB does not change dot.
-Therefore:
-.P1
-       settab+4:b  .,5?ia
-       fopen+4:b
-.P2
-will print the last thing dot was set to
-(in the example \fIfopen+4\fP)
-.ul
-not
-the current location (\fIsettab+4\fP)
-at which the program is executing.
-.PP
-A breakpoint can be overwritten without first deleting the old breakpoint.
-For example:
-.P1
-       settab+4:b  settab,5?ia; ptab/o  \fR*
-.P2
-could be entered after typing the above requests.
-.PP
-Now the display of breakpoints:
-.P1
-       $b
-.P2
-shows the above request for the
-.ul
-settab
-breakpoint.
-When the breakpoint at
-.ul
-settab
-is encountered the ADB requests are executed.
-Note that the location at
-.ul
-settab+4
-has been changed to plant the breakpoint;
-all the other locations match their original value.
-.PP
-Using the functions,
-.ul
-f, g
-and 
-.ul
-h
-shown in Figure 3,
-we can follow the execution of each function by planting non-stopping
-breakpoints.
-We call ADB with the executable program of Figure 3 as follows:
-.P1
-       adb ex3 \-
-.P2
-Suppose we enter the following breakpoints:
-.P1
-       h+4:b   hcnt/d;  h.hi/;  h.hr/
-       g+4:b   gcnt/d;  g.gi/;  g.gr/
-       f+4:b   fcnt/d;  f.fi/;  f.fr/
-       :r
-.P2
-Each request line indicates that the variables are printed in decimal
-(by the specification \fBd\fR).
-Since the format is not changed, the \fBd\fR can be left off all but
-the first request.
-.PP
-The output in Figure 7 illustrates two points.
-First, the ADB requests in the breakpoint line are not
-examined until the program under
-test is run.
-That means any errors in those ADB requests is not detected until run time.
-At the location of the error ADB stops running the program.
-.PP
-The second point is the way ADB handles register variables.
-ADB uses the symbol table to address variables.
-Register variables, like \fIf.fr\fR above, have pointers to uninitialized
-places on the stack.
-Therefore the message "symbol not found".
-.PP
-Another way of getting at the data in this example is to print
-the variables used in the call as:
-.P1
-       f+4:b   fcnt/d;  f.a/;  f.b/;  f.fi/
-       g+4:b   gcnt/d;  g.p/;  g.q/;  g.gi/
-       :c
-.P2
-The operator / was used instead of ?
-to read values from the \fIcore\fP file.
-The output for each function, as shown in Figure 7, has the same format.
-For the function \fIf\fP, for example, it shows the name and value of the
-.ul
-external
-variable
-.ul
-fcnt.
-It also shows the address on the stack and value of the
-variables
-.ul
-a, b
-and
-.ul
-fi.
-.PP
-Notice that the addresses on the stack will continue to decrease
-until no address space is left for program execution
-at which time (after many pages of output)
-the program under test aborts.
-A display with names would be produced by requests like the following:
-.P1
-       f+4:b   fcnt/d;  f.a/"a="d;  f.b/"b="d;  f.fi/"fi="d
-.P2
-In this format the quoted string is printed literally and the \fBd\fP
-produces a decimal display of the variables.
-The results are shown in Figure 7.
-.NH 2
-Other Breakpoint Facilities
-.LP
-.IP \(bu 4
-Arguments and change of standard input and output are passed to a program as:
-.P1
-       :r  arg1  arg2 ... <infile  >outfile
-.P2
-This request
-kills any existing program under test and
-starts the
-.ul
-a.out
-afresh.
-.IP \(bu
-The program being debugged can be single stepped
-by:
-.P1
-       :s
-.P2
-If necessary, this request will start up the program being
-debugged and stop after executing
-the first instruction.
-.IP \(bu
-ADB allows a program to be entered at a specific address
-by typing:
-.P1
-       address:r
-.P2
-.IP \(bu
-The count field can be used to skip the first \fIn\fR breakpoints as:
-.P1
-       ,n:r
-.P2
-The request:
-.P1
-       ,n:c
-.P2
-may also be used for skipping the first \fIn\fR breakpoints
-when continuing a program.
-.sp
-.IP \(bu
-A program can be continued at an address different from the breakpoint by:
-.P1
-       address:c
-.P2
-.IP \(bu
-The program being debugged runs as a separate process and can be killed by:
-.P1
-       :k
-.P2
-.LP
-.NH
-Maps
-.PP
-UNIX supports several executable file formats.  These are used to tell
-the loader how to load  the program file.  File type 407
-is the most common and is generated by a C compiler invocation such as
-\fBcc pgm.c\fP.
-A 410 file is produced by a C compiler command of the form \fBcc -n pgm.c\fP,
-whereas a 411 file is produced by \fBcc -i pgm.c\fP.
-ADB interprets these different file formats and
-provides access to the different segments through a set of maps (see Figure 8).
-To print the maps type:
-.P1
-       $m
-.P2
-.PP
-In 407 files, both text (instructions) and data are intermixed.
-This makes it impossible for ADB to differentiate data from
-instructions and some of the printed symbolic addresses look incorrect;
-for example, printing data addresses as offsets from routines.
-.PP
-In 410 files (shared text), the instructions are separated from data and
-\fB?*\fR accesses the data part of the \fIa.out\fP file.
-The \fB?* \fP request tells ADB to use the second part of the
-map in the
-.ul
-a.out
-file.
-Accessing data in the \fIcore\fP file shows
-the data after it was modified by the execution of the program.
-Notice also that the data segment may have grown during
-program execution.
-.PP
-In 411 files (separated I & D space), the
-instructions and data are also separated.
-However, in this
-case, since data is mapped through a separate set of segmentation
-registers, the base of the data segment is also relative to address zero.
-In this case since the addresses overlap it is necessary to use
-the \fB?*\fR operator to access the data space of the \fIa.out\fP file.
-In both 410 and 411 files the corresponding
-core file does not contain the program text.
-.PP
-Figure 9 shows the display of three maps
-for the same program linked as a 407, 410, 411 respectively.
-The b, e, and f fields are used by ADB to map
-addresses into file addresses.
-The "f1" field is the
-length of the header at the beginning of the file (020 bytes
-for an \fIa.out\fP file and 02000 bytes for a \fIcore\fP file).
-The "f2" field is the displacement from the beginning of the file to the data.
-For a 407 file with mixed text and data this is the
-same as the length of the header; for 410 and 411 files this
-is the length of the header plus the size of the text portion.
-.PP
-The "b" and "e" fields are the starting and ending locations
-for a segment.
-Given an address, A, the location in
-the file (either \fIa.out\fP or \fIcore\fP) is calculated as:
-.P1
-       b1\(<=A\(<=e1 =\h'-.5m'> file address = (A\-b1)+f1
-       b2\(<=A\(<=e2 =\h'-.5m'> file address = (A\-b2)+f2
-.P2
-A user can access locations by using the ADB defined variables.
-The \fB$v\fR request prints the variables initialized by ADB:
-.P1
-       b       base address of data segment
-       d       length of the data segment
-       s       length of the stack
-       t       length of the text
-       m       execution type (407,410,411)
-.P2
-.PP
-In Figure 9 those variables not present are zero.
-Use can be made of these variables by expressions such as:
-.P1
-       <b
-.P2
-in the address field.
-Similarly the value of the variable can be changed by an assignment request
-such as:
-.P1
-       02000>b
-.P2
-that sets \fBb\fP to octal 2000.
-These variables are useful to know if the file under examination
-is an executable or \fIcore\fP image file.
-.PP
-ADB reads the header of the \fIcore\fP image file to find the
-values for these variables.
-If the second file specified does not
-seem to be a \fIcore\fP file, or if it is missing then the header of
-the executable file is used instead.
-.NH
-Advanced Usage
-.PP
-It is possible with ADB to combine formatting requests
-to provide elaborate displays.
-Below are several examples.
-.NH 2
-Formatted dump
-.PP
-The line:
-.P1
-       <b,\-1/4o4^8Cn
-.P2
-prints 4 octal words followed by their ASCII interpretation
-from the data space of the core image file.
-Broken down, the various request pieces mean:
-.sp
-.in 1.7i
-.ta .7i
-.ti -.7i
-<b     The base address of the data segment.
-.sp
-.ti -.7i
-<b,\-1 Print from the base address to the end of file.
-A negative count is used here and elsewhere to loop indefinitely
-or until some error condition (like end of file) is detected.
-.sp
-.ti -1.7i
-The format \fB4o4^8Cn\fR is broken down as follows:
-.sp
-.ti -.7i
-4o     Print 4 octal locations.
-.sp
-.ti -.7i
-4^     Backup the current address 4 locations (to the original start of the field).
-.sp
-.ti -.7i
-8C     Print 8 consecutive characters using an escape convention;
-each character in the range 0 to 037 is printed as @ followed by the corresponding character in the range 0140 to 0177.
-An @ is printed as @@.
-.sp
-.ti -.7i
-n      Print a newline.
-.in -1.7i
-.fi
-.sp
-.PP
-The request:
-.P1
-       <b,<d/4o4^8Cn
-.P2
-could have been used instead to allow the printing to stop
-at the end of the data segment (<d provides the data segment size in bytes).
-.PP
-The formatting requests can be combined with ADB's ability
-to read in a script to produce a core image dump script.
-ADB is invoked as:
-.P1
-       adb a.out core < dump
-.P2
-to read in a script file,
-.ul
-dump,
-of requests.
-An example of such a script is:
-.P1
-       120$w
-       4095$s
-       $v
-       =3n
-       $m
-       =3n"C Stack Backtrace"
-       $C
-       =3n"C External Variables"
-       $e
-       =3n"Registers"
-       $r
-       0$s
-       =3n"Data Segment"
-       <b,\-1/8ona
-.P2
-.PP
-The request \fB120$w\fP sets the width of the output to
-120 characters
-(normally, the width is 80 characters).
-ADB attempts to print addresses as:
-.P1
-       symbol + offset
-.P2
-The request \fB4095$s\fP increases the maximum permissible offset
-to the nearest symbolic address from 255 (default) to 4095.
-The request \fB=\fP can be used to print literal strings.
-Thus,
-headings are provided in this
-.ul
-dump
-program
-with requests of the form:
-.P1
-       =3n"C Stack Backtrace"
-.P2
-that spaces three lines and prints the literal
-string.
-The request \fB$v\fP prints all non-zero ADB variables (see Figure 8).
-The request
-\fB0$s\fP
-sets the maximum offset for symbol matches to zero thus
-suppressing the printing of symbolic labels in favor
-of octal values.
-Note that this is only done for the printing of the data segment.
-The request:
-.P1
-       <b,\-1/8ona
-.P2
-prints a dump from the base of the data segment to the end of file
-with an octal address field and eight octal numbers per line.
-.PP
-Figure 11 shows the results of some formatting requests
-on the C program of Figure 10.
-.NH 2
-Directory Dump
-.PP
-As another illustration (Figure 12) consider a set of requests to dump
-the contents of a directory (which is made up
-of an integer \fIinumber\fP followed by a 14 character name):
-.P1
-       adb dir \-
-       =n8t"Inum"8t"Name"
-       0,\-1? u8t14cn
-.P2
-In this example, the \fBu\fP prints the \fIinumber\fP as an unsigned decimal integer,
-the \fB8t\fP means that ADB will space to the next
-multiple of 8 on the output line, and the \fB14c\fP prints the 14 character file name.
-.NH 2
-Ilist Dump
-.PP
-Similarly the contents of the \fIilist\fP of a file system, (e.g. /dev/src,
-on UNIX systems distributed by the UNIX Support Group;
-see UNIX Programmer's
-Manual Section V) could be dumped with the following set of 
-requests:
-.P1
-       adb /dev/src \-
-       02000>b
-       ?m <b
-       <b,\-1?"flags"8ton"links,uid,gid"8t3bn",size"8tbrdn"addr"8t8un"times"8t2Y2na
-.P2
-In this example the value of the base for the map was changed 
-to 02000 (by saying \fB?m<b\fR) since that is the start of an \fIilist\fP within a file system.
-An artifice (\fBbrd\fP above) was used to print the 24 bit size field
-as a byte, a space, and a decimal integer.
-The last access time and last modify time are printed with the
-\fB2Y\fR
-operator.
-Figure 12 shows portions of these requests as applied to a directory
-and file system.
-.NH 2
-Converting values
-.PP
-ADB may be used to convert values from one representation to
-another.
-For example:
-.P1
-       072 = odx
-.P2
-will print
-.P1
-       072     58      #3a
-.P2
-which is the octal, decimal and hexadecimal representations
-of 072 (octal).
-The format is remembered so that typing
-subsequent numbers will print them in the given formats.
-Character values may be converted similarly, for example:
-.P1
-       'a' = co
-.P2
-prints
-.P1
-       a       0141
-.P2
-It may also be used to evaluate expressions but be
-warned that all binary operators have
-the same precedence which is lower than that for unary operators.
-.NH
-Patching
-.PP
-Patching files with ADB is accomplished with the 
-.ul
-write,
-\fBw\fP or \fBW\fP, request (which is not like the \fIed\fP editor write command).
-This is often used in conjunction with the 
-.ul
-locate,
-\fBl\fP or \fBL\fP
-request.
-In general, the request syntax for \fBl\fP and \fBw\fP are similar as follows:
-.P1
-       ?l value
-.P2
-The request \fBl\fP is used to match on two bytes, \fBL\fP is used for
-four bytes.
-The request \fBw\fP is used to write two bytes, whereas
-\fBW\fP writes four bytes.
-The \fBvalue\fP field in either 
-.ul
-locate
-or
-.ul
-write
-requests
-is an expression.
-Therefore, decimal and octal numbers, or character strings are supported.
-.PP
-In order to modify a file, ADB must be called as:
-.P1
-       adb \-w file1 file2
-.P2
-When called with this option, 
-.ul
-file1
-and 
-.ul
-file2
-are created if necessary and opened for both reading and writing.
-.PP
-For example, consider the C program shown in Figure 10.
-We can change the word "This" to "The " in the executable file
-for this program, \fIex7\fP, by using the following requests:
-.P1
-       adb \-w ex7 \-
-       ?l 'Th'
-       ?W 'The '
-.P2
-The request \fB?l\fP starts at dot and stops at the first match of "Th"
-having set dot to the address of the location found.
-Note the use of \fB?\fP to write to the 
-.ul
-a.out
-file.
-The form \fB?*\fP would have been used for a 411 file.
-.PP
-More frequently the 
-request will be typed as:
-.P1
-       ?l 'Th'; ?s
-.P2
-and locates the first occurrence of "Th" and print the entire string.
-Execution of this ADB request will set dot to the address of the 
-"Th" characters.
-.PP
-As another example of the utility of the patching facility,
-consider a C program that has an internal logic flag.
-The flag could be set by the user through ADB and the program run.
-For example:
-.P1
-       adb a.out \-
-       :s arg1 arg2
-       flag/w 1
-       :c
-.P2
-The \fB:s\fR request is normally used to single step through a process
-or start a process in single step mode.
-In this case it starts
-.ul
-a.out
-as a subprocess
-with arguments \fBarg1\fP and \fBarg2\fP.
-If there is a subprocess running ADB writes to it rather than to the file
-so the \fBw\fP request causes \fIflag\fP to be changed in the memory of the subprocess.
-.NH
-Anomalies
-.PP
-Below is a list of some strange things that users
-should be aware of.
-.IP 1.
-Function calls and arguments are put on the stack by the C
-save routine.
-Putting breakpoints at the entry point to routines
-means that the function appears not to have been called
-when the
-breakpoint occurs.
-.IP 2.
-When printing addresses, ADB uses
-either text or data symbols from the \fIa.out\fP file.
-This sometimes causes unexpected symbol names to be printed 
-with data (e.g. \fIsavr5+022\fP).
-This does not happen if
-\fB?\fR is used for text (instructions)
-and \fB/\fP for data.
-.IP 3.
-ADB cannot handle C register variables
-in the most recently activated function.
-.LP
-.NH
-Acknowledgements
-.PP
-The authors are grateful for the thoughtful comments
-on how to organize this document
-from R. B. Brandt, E. N. Pinson and B. A. Tague.
-D. M. Ritchie made the system changes necessary to accommodate
-tracing within ADB. He also participated in discussions 
-during the writing of ADB.
-His earlier work with DB and CDB led to many of the 
-features found in ADB.
-.SG MH-8234-JFM/1273-SRB-unix
-.NH
-References
-.LP
-.IP 1.
-D. M. Ritchie and K. Thompson,
-``The UNIX Time-Sharing System,''
-CACM, July, 1974.
-.IP 2.
-B. W. Kernighan and D. M. Ritchie,
-.ul
-The C Programming Language,
-Prentice-Hall, 1978.
-.IP 3.
-K. Thompson and D. M. Ritchie,
-UNIX Programmer's Manual - 7th Edition,
-1978.
-.IP 4.
-B. W. Kernighan and P. J. Plauger,
-.ul
-Software Tools,
-Addison-Wesley, 1976.
diff --git a/.ref-Research-V7/usr/doc/adb/tut1 b/.ref-Research-V7/usr/doc/adb/tut1
deleted file mode 100644 (file)
index 8366473..0000000
+++ /dev/null
@@ -1,961 +0,0 @@
-.sp 100
-.nr PS 9
-.nr VS 11
-.      \" START OF Figures
-.de P1
-.nf
-.in +.5i
-.ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i
-.sp
-.ps 9
-.vs 11p
-..
-.de P2
-.sp
-.fi
-.ps \\n(PS
-.vs \\n(VS
-.in -.5i
-..
-.SH
-Figure 1:  C program with pointer bug
-.LP
-.P1
-struct buf {
-       int fildes;
-       int nleft;
-       char *nextp;
-       char buff[512];
-       }bb;
-struct buf *obuf;
-
-char *charp "this is a sentence.";
-
-main(argc,argv)
-int argc;
-char **argv;
-{
-       char    cc;
-
-       if(argc < 2) {
-               printf("Input file missing\\n");
-               exit(8);
-       }
-
-       if((fcreat(argv[1],obuf)) < 0){
-               printf("%s : not found\\n", argv[1]);
-               exit(8);
-       }
-       charp = \'T\';
-printf("debug 1 %s\\n",charp);
-       while(cc=  *charp++)
-               putc(cc,obuf);
-       fflush(obuf);
-}
-.P2
-.sp 100
-.SH
-Figure 2:  ADB output for C program of Figure 1
-.LP
-.P1
-.ft B
-adb a.out core
-$c
-.ft R
-~main(02,0177762)
-.ft B
-$C
-.ft R
-~main(02,0177762)
-       argc:       02
-       argv:       0177762
-       cc:         02124
-.ft B
-$r
-.ft R
-ps     0170010
-pc     0204    ~main+0152
-sp     0177740
-r5     0177752
-r4     01
-r3     0
-r2     0
-r1     0
-r0     0124
-~main+0152:    mov     _obuf,(sp)
-.ft B
-$e
-.ft R
-savr5:     0
-_obuf:     0
-_charp:            0124
-_errno:            0
-_fout:     0
-.ft B
-$m
-.ft R
-text map    \`ex1\'
-b1 = 0              e1 = 02360           f1 = 020
-b2 = 0              e2 = 02360           f2 = 020
-data map    \`core1\'
-b1 = 0              e1 = 03500           f1 = 02000
-b2 = 0175400        e2 = 0200000                 f2 = 05500
-.ft B
-*charp/s
-.ft R
-0124:          TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\1dL\ 3x\7f  \ 3N\1dh\ 4@\1dx\7f&\10_
-~
-.ft B
-charp/s
-.ft R
-_charp:                T
-_charp+02:     this is a sentence.
-_charp+026:    Input file missing
-.ft B
-main.argc/d
-.ft R
-0177756:       2
-.ft B
-*main.argv/3o
-.ft R
-0177762:       0177770 0177776 0177777
-.ft B
-0177770/s
-.ft R
-0177770:       a.out
-.ft B
-*main.argv/3o
-.ft R
-0177762:       0177770 0177776 0177777
-.ft B
-*"/s
-.ft R
-0177770:       a.out
-.ft B
- .=o
-.ft R
-               0177770
-.ft B
- .\(mi10/d
-.ft R
-0177756:       2
-.ft B
-$q
-.P2
-.sp 100
-.SH
-Figure 3:  Multiple function C program for stack trace illustration
-.LP
-.P1
-int    fcnt,gcnt,hcnt;
-h(x,y)
-{
-       int hi; register int hr;
-       hi = x+1;
-       hr = x\(miy+1;
-       hcnt++ ;
-       hj:
-       f(hr,hi);
-}
-
-g(p,q)
-{
-       int gi; register int gr;
-       gi = q\(mip;
-       gr = q\(mip+1;
-       gcnt++ ;
-       gj:
-       h(gr,gi);
-}
-
-f(a,b)
-{
-       int fi; register int fr;
-       fi = a+2*b;
-       fr = a+b;
-       fcnt++ ;
-       fj:
-       g(fr,fi);
-}
-
-main()
-{
-       f(1,1);
-}
-.P2
-.sp 100
-.SH
-Figure 4:  ADB output for C program of Figure 3
-.LP
-.P1
-.ft B
-adb
-$c
-.ft R
-~h(04452,04451)
-~g(04453,011124)
-~f(02,04451)
-~h(04450,04447)
-~g(04451,011120)
-~f(02,04447)
-~h(04446,04445)
-~g(04447,011114)
-~f(02,04445)
-~h(04444,04443)
-.ft B
-HIT DEL KEY
-.ft R
-adb
-.ft B
-,5$C
-.ft R
-~h(04452,04451)
-       x:          04452
-       y:          04451
-       hi:         ?
-~g(04453,011124)
-       p:          04453
-       q:          011124
-       gi:         04451
-       gr:         ?
-~f(02,04451)
-       a:          02
-       b:          04451
-       fi:         011124
-       fr:         04453
-~h(04450,04447)
-       x:          04450
-       y:          04447
-       hi:         04451
-       hr:         02
-~g(04451,011120)
-       p:          04451
-       q:          011120
-       gi:         04447
-       gr:         04450
-.ft B
-fcnt/d
-.ft R
-_fcnt:         1173
-.ft B
-gcnt/d
-.ft R
-_gcnt:         1173
-.ft B
-hcnt/d
-.ft R
-_hcnt:         1172
-.ft B
-h.x/d
-.ft R
-022004:                2346
-.ft B
-$q
-.P2
-.sp 100
-.SH
-Figure 5:  C program to decode tabs
-.LP
-.P1
-#define MAXLINE        80
-#define YES            1
-#define NO             0
-#define TABSP          8
-.sp .5
-char   input[] "data";
-char   ibuf[518];
-int    tabs[MAXLINE];
-.sp .5
-main()
-{
-       int col, *ptab;
-       char c;
-.sp .5
-       ptab = tabs;
-       settab(ptab);   /*Set initial tab stops */
-       col = 1;
-       if(fopen(input,ibuf) < 0) {
-               printf("%s : not found\\n",input);
-               exit(8);
-       }
-       while((c = getc(ibuf)) != \(mi1) {
-               switch(c) {
-                       case \(fm\\t\(fm:       /* TAB */
-                               while(tabpos(col) != YES) {
-                                       putchar(\(fm \(fm);     /* put BLANK */
-                                       col++ ;
-                               }
-                               break;
-                       case \(fm\\n\(fm:       /*NEWLINE */
-                               putchar(\(fm\\n\(fm);
-                               col = 1;
-                               break;
-                       default:
-                               putchar(c);
-                               col++ ;
-               }
-       }
-}
-.sp .5
-/* Tabpos return YES if col is a tab stop */
-tabpos(col)
-int col;
-{
-       if(col > MAXLINE)
-               return(YES);
-       else
-               return(tabs[col]);
-}
-.sp .5
-/* Settab - Set initial tab stops */
-settab(tabp)
-int *tabp;
-{
-       int i;
-.sp .5
-       for(i = 0; i<= MAXLINE; i++) 
-               (i%TABSP) ? (tabs[i] = NO) : (tabs[i] = YES);
-}
-.P2
-.sp 100
-.SH
-Figure 6a:  ADB output for C program of Figure 5
-.LP
-.P1
-.ft B
-adb a.out \(mi
-settab+4:b
-fopen+4:b
-getc+4:b
-tabpos+4:b
-$b
-.ft R
-breakpoints
-count  bkpt            command
-1      ~tabpos+04
-1      _getc+04
-1      _fopen+04
-1      ~settab+04
-.ft B
-settab,5?ia
-.ft R
-~settab:               jsr     r5,csv
-~settab+04:    tst     \(mi(sp)
-~settab+06:    clr     0177770(r5)
-~settab+012:   cmp     $0120,0177770(r5)
-~settab+020:   blt     ~settab+076
-~settab+022:
-.ft B
-settab,5?i
-.ft R
-~settab:               jsr     r5,csv
-               tst     \(mi(sp)
-               clr     0177770(r5)
-               cmp     $0120,0177770(r5)
-               blt     ~settab+076
-.ft B
-:r
-.ft R
-a.out: running
-breakpoint     ~settab+04:     tst     \(mi(sp)
-.ft B
-settab+4:d
-:c
-.ft R
-a.out: running
-breakpoint     _fopen+04:      mov     04(r5),nulstr+012
-.ft B
-$C
-.ft R
-_fopen(02302,02472)
-~main(01,0177770)
-       col:        01
-       c:          0
-       ptab:       03500
-.ft B
-tabs,3/8o
-.ft R
-03500:         01      0       0       0       0       0       0       0
-               01      0       0       0       0       0       0       0
-               01      0       0       0       0       0       0       0
-.P2
-.sp 100
-.SH
-Figure 6b:  ADB output for C program of Figure 5
-.LP
-.P1
-.ft B
-:c
-.ft R
-a.out: running
-breakpoint     _getc+04:       mov     04(r5),r1
-.ft B
-ibuf+6/20c
-.ft R
-__cleanu+0202:         This    is      a test  of
-.ft B
-:c
-.ft R
-a.out: running
-breakpoint     ~tabpos+04:     cmp     $0120,04(r5)
-.ft B
-tabpos+4:d
-settab+4:b  settab,5?ia
-settab+4:b  settab,5?ia;  0
-getc+4,3:b  main.c?C;  0
-settab+4:b  settab,5?ia;  ptab/o;  0
-$b
-.ft R
-breakpoints
-count  bkpt            command
-1      ~tabpos+04
-3      _getc+04        main.c?C;0
-1      _fopen+04
-1      ~settab+04      settab,5?ia;ptab?o;0
-~settab:               jsr     r5,csv
-~settab+04:    bpt
-~settab+06:    clr     0177770(r5)
-~settab+012:   cmp     $0120,0177770(r5)
-~settab+020:   blt     ~settab+076
-~settab+022:
-0177766:       0177770
-0177744:       @\`
-T0177744:      T
-h0177744:      h
-i0177744:      i
-s0177744:      s
-.P2
-.sp 100
-.SH
-Figure 7:  ADB output for C program with breakpoints
-.LP
-.in +.5i
-.nf
-.ps 8
-.vs 9
-.ft B
-adb ex3 \(mi
-h+4:b hcnt/d; h.hi/; h.hr/
-g+4:b gcnt/d; g.gi/; g.gr/
-f+4:b fcnt/d; f.fi/; f.fr/
-:r
-.ft R
-ex3: running
-_fcnt:         0
-0177732:       214
-symbol not found
-.ft B
-f+4:b fcnt/d; f.a/; f.b/; f.fi/
-g+4:b gcnt/d; g.p/; g.q/; g.gi/
-h+4:b hcnt/d; h.x/; h.y/; h.hi/
-:c
-.ft R
-ex3: running
-_fcnt:         0
-0177746:       1
-0177750:       1
-0177732:       214
-_gcnt:         0
-0177726:       2
-0177730:       3
-0177712:       214
-_hcnt:         0
-0177706:       2
-0177710:       1
-0177672:       214
-_fcnt:         1
-0177666:       2
-0177670:       3
-0177652:       214
-_gcnt:         1
-0177646:       5
-0177650:       8
-0177632:       214
-.ft B
-HIT DEL
-f+4:b fcnt/d; f.a/"a = "d; f.b/"b = "d; f.fi/"fi = "d
-g+4:b gcnt/d; g.p/"p = "d; g.q/"q = "d; g.gi/"gi = "d
-h+4:b hcnt/d; h.x/"x = "d; h.y/"h = "d; h.hi/"hi = "d
-:r
-.ft R
-ex3: running
-_fcnt:         0
-0177746:       a = 1
-0177750:       b = 1
-0177732:       fi = 214
-_gcnt:         0
-0177726:       p = 2
-0177730:       q = 3
-0177712:       gi = 214
-_hcnt:         0
-0177706:       x = 2
-0177710:       y = 1
-0177672:       hi = 214
-_fcnt:         1
-0177666:       a = 2
-0177670:       b = 3
-0177652:       fi = 214
-.ft B
-HIT DEL
-$q
-.in -.5i
-.sp 100
-.SH
-Figure 8:  ADB address maps
-.LP
-.de l1
-.tc
-.ta 1.20i +1.6i +2.5i
-..
-.de l3
-.tc
-.ta 1.6i +2.80i +.2i +1.55i
-..
-.de l2
-.tc
-.ti 1.0i
-.ta +0.5i +3.0i +1.75i
-.tc _
-..
-.de l5
-.tc 
-.ti 1.0i
-.ta +0.75i +3.0i +1.5i
-.tc _
-..
-.de l6
-.tc
-.ti 1.0i
-.ta +.8i +2.85i +0.4i +1.1i
-..
-.de l8
-.tc
-.ti 1.0i
-.ta +0.5i +3.0i +1.75i
-.tc _
-..
-.de la
-.tc
-.ta 1.20i +1.25i +1.7i
-..
-.de lc
-.tc
-.ti 1.0i
-.ta +.85i +1.6i +.35i +1.1i
-..
-.de lb
-.tc
-.ti 1.0i
-.ta +0.75i +1.75i +1.5i
-.tc _
-..
-.ul
-407 files
-.sp
-.l1
-a.out  hdr     text+data
-.l2
-|      |       |
-.l3
-       0       D
-.sp
-.l1
-core   hdr     text+data       stack
-.l5
-|      |       ......| |
-.l6
-       0       D       S       E
-.sp 2
-.ul
-410 files (shared text)
-.sp
-.l1
-a.out  hdr      text   data
-.l2
-|      |       |       |
-.l3
-       0       T       B       D
-.sp
-.la
-core   hdr     data    stack
-.lb
-|      |       ......| |
-.lc
-       B       D       S       E
-.sp 2
-.ul
-411 files (separated I and D space)
-.sp
-.l1
-a.out  hdr     text    data
-.l2
-|      |       |       |
-.l3
-       0       T       0       D
-.sp
-.la
-core   hdr     data    stack
-.lb
-|      |       ......| |
-.lc
-       0       D       S       E
-.sp 2
-The following 
-.ul 
-adb
-variables are set.
-.nf
-.ta .75i 1.5i 3.5i 4.5i 5.5i
-.sp
-                       407     410     411
-.sp
-       b       base of data    0       B       0
-       d       length of data  D       D\(miB  D
-       s       length of stack S       S       S
-       t       length of text  0       T       T
-.sp 100
-.SH
-Figure 9:  ADB output for maps
-.LP
-.nf
-.in +.5i
-.ft B
-adb map407 core407
-$m
-.ft R
-text map    \`map407\'
-b1 = 0              e1 = 0256            f1 = 020
-b2 = 0              e2 = 0256            f2 = 020
-data map    \`core407\'
-b1 = 0              e1 = 0300            f1 = 02000
-b2 = 0175400        e2 = 0200000         f2 = 02300
-.ft B
-$v
-.ft R
-variables
-d = 0300
-m = 0407
-s = 02400
-.ft B
-$q
-.sp 2
-adb map410 core410
-$m
-.ft R
-text map    \`map410\'
-b1 = 0              e1 = 0200            f1 = 020
-b2 = 020000         e2 = 020116          f2 = 0220
-data map    \`core410\'
-b1 = 020000         e1 = 020200          f1 = 02000
-b2 = 0175400        e2 = 0200000         f2 = 02200
-.ft B
-$v
-.ft R
-variables
-b = 020000
-d = 0200
-m = 0410
-s = 02400
-t = 0200
-.ft B
-$q
-.sp 2
-adb map411 core411
-$m
-.ft R
-text map    \`map411\'
-b1 = 0              e1 = 0200            f1 = 020
-b2 = 0              e2 = 0116            f2 = 0220
-data map    \`core411\'
-b1 = 0              e1 = 0200            f1 = 02000
-b2 = 0175400        e2 = 0200000         f2 = 02200
-.ft B
-$v
-.ft R
-variables
-d = 0200
-m = 0411
-s = 02400
-t = 0200
-.ft B
-$q
-.in -.5i
-.sp 100
-.SH
-Figure 10:  Simple C program for illustrating formatting and patching
-.LP
-.P1
-char   str1[]  "This is a character string";
-int    one     1;
-int    number  456;
-long   lnum    1234;
-float  fpt     1.25;
-char   str2[]  "This is the second character string";
-main()
-{
-       one = 2;
-}
-.P2
-.sp 100
-.SH
-Figure 11:  ADB output illustrating fancy formats
-.LP
-.nf
-.ps 9
-.vs 11p
-.ft B
-adb map410 core410
-<b,\(mi1/8ona
-.ft R
-020000:                0       064124  071551  064440  020163  020141  064143  071141
-.sp .5
-_str1+016:     061541  062564  020162  072163  064562  063556  0       02
-.sp .5
-_number:
-_number:       0710    0       02322   040240  0       064124  071551  064440
-.sp .5
-_str2+06:      020163  064164  020145  062563  067543  062156  061440  060550
-.sp .5
-_str2+026:     060562  072143  071145  071440  071164  067151  0147    0
-.sp .5
-savr5+02:      0       0       0       0       0       0       0       0
-.sp .5
-.ft B
-<b,20/4o4^8Cn
-.ft R
-020000:                0       064124  071551  064440  @\`@\`This i
-               020163  020141  064143  071141  s a char
-               061541  062564  020162  072163  acter st
-               064562  063556  0       02      ring@\`@\`@b@\`
-.sp .5
-_number:       0710    0       02322   040240  H@a@\`@\`R@d @@
-               0       064124  071551  064440  @\`@\`This i
-               020163  064164  020145  062563  s the se
-               067543  062156  061440  060550  cond cha
-               060562  072143  071145  071440  racter s
-               071164  067151  0147    0       tring@\`@\`@\`
-               0       0       0       0       @\`@\`@\`@\`@\`@\`@\`@\`
-               0       0       0       0       @\`@\`@\`@\`@\`@\`@\`@\`
-data address not found
-.ft B
-<b,20/4o4^8t8cna
-.ft R
-020000:                0       064124  071551  064440          This i
-_str1+06:      020163  020141  064143  071141          s a char
-_str1+016:     061541  062564  020162  072163          acter st
-_str1+026:     064562  063556  0       02              ring\ 2
-_number:
-_number:       0710    0       02322   040240          HR
-_fpt+02:       0       064124  071551  064440          This i
-_str2+06:      020163  064164  020145  062563          s the se
-_str2+016:     067543  062156  061440  060550          cond cha
-_str2+026:     060562  072143  071145  071440          racter  s
-_str2+036:     071164  067151  0147    0               tring
-savr5+02:      0       0       0       0
-savr5+012:     0       0       0       0
-data address not found
-.ft B
-<b,10/2b8t^2cn
-.ft R
-020000:                0       0
-.sp .5
-_str1:         0124    0150            Th
-               0151    0163            is
-               040     0151             i
-               0163    040             s
-               0141    040             a
-               0143    0150            ch
-               0141    0162            ar
-               0141    0143            ac
-               0164    0145            te
-.ft B
-$Q
-.sp 100
-.SH
-Figure 12:  Directory and inode dumps
-.LP
-.nf
-.ft B
-adb dir \(mi
-=nt"Inode"t"Name"
-0,\(mi1?ut14cn
-.ft R
-
-               Inode   Name
-0:             652     .
-               82      ..
-               5971    cap.c
-               5323    cap
-               0       pp
-.sp 4
-.ft B
-adb /dev/src \(mi
-.ft B
-02000>b
-?m<b
-.ft R
-new map            \`/dev/src\'
-b1 = 02000          e1 = 0100000000      f1 = 0
-b2 = 0              e2 = 0               f2 = 0
-.ft B
-$v
-.ft R
-variables
-b = 02000
-.ft B
-<b,\(mi1?"flags"8ton"links,uid,gid"8t3bn"size"8tbrdn"addr"8t8un"times"8t2Y2na
-.ft R
-02000:         flags   073145
-               links,uid,gid   0163    0164    0141
-               size    0162    10356
-               addr    28770   8236    25956   27766   25455   8236    25956   25206
-               times   1976 Feb 5 08:34:56     1975 Dec 28 10:55:15
-
-02040:         flags   024555
-               links,uid,gid   012     0163    0164
-               size    0162    25461
-               addr    8308    30050   8294    25130   15216   26890   29806   10784
-               times   1976 Aug 17 12:16:51    1976 Aug 17 12:16:51
-
-02100:         flags   05173
-               links,uid,gid   011     0162    0145
-               size    0147    29545
-               addr    25972   8306    28265   8308    25642   15216   2314    25970
-               times   1977 Apr 2 08:58:01     1977 Feb 5 10:21:44
-.\"
-.\"    Start of Summary
-.sp 100
-.TL
-ADB Summary
-.LP
-.LP
-.if t .2C
-.nr VS 9
-.nr VS 11
-.SH
-Command Summary
-.LP
-.ta .7i
-a)   formatted printing
-.sp .5
-.IP "\fB? \fIformat\fR" .7i
-print from \fIa.out\fR file according to \fIformat\fR
-.IP "\fB/ \fIformat\fR" .7i
-print from \fIcore\fR file according to \fIformat\fR
-.IP "\fB= \fIformat\fR" .7i
-print the value of \fIdot\fR
-.sp .5
-.IP "\fB?w\fR expr" .7i
-write expression into \fIa.out\fR file
-.IP "\fB/w\fR expr" .7i
-write expression into \fIcore\fR file
-.sp .5
-.IP "\fB?l\fR expr" .7i
-locate expression in \fIa.out\fR file
-.LP
-.ta .7i
-b)   breakpoint and program control
-.LP
-.ta .7i
-.nf
-.ta .7i
-\fB:b\fR       set breakpoint at \fIdot\fR
-\fB:c\fR       continue running program
-\fB:d\fR       delete breakpoint
-\fB:k\fR       kill the program being debugged
-\fB:r\fR       run \fIa.out\fR file under ADB control
-\fB:s\fR       single step
-.LP
-.ta .7i
-c)   miscellaneous printing
-.LP
-.ta .7i
-.nf
-\fB$b\fR       print current breakpoints
-\fB$c\fR       C stack trace
-\fB$e\fR       external variables
-\fB$f\fR       floating registers
-\fB$m\fR       print ADB segment maps
-\fB$q\fR       exit from ADB
-\fB$r\fR       general registers
-\fB$s\fR       set offset for symbol match
-\fB$v\fR       print ADB variables
-\fB$w\fR       set output line width
-.LP
-.ta .7i
-d)   calling the shell
-.LP
-.ta .7i
-.nf
-\fB!\fR        call \fIshell\fP to read rest of line
-.LP
-.ta .7i
-e)   assignment to variables
-.LP
-.ta .7i
-.nf
-\fB>\fIname\fR assign dot to variable or register \fIname\fR
-.sp 100
-.SH
-Format Summary
-.LP
-.ta .7i
-.nf
-\fBa   \fRthe value of dot
-\fBb   \fRone byte in octal
-\fBc   \fRone byte as a character
-\fBd   \fRone word in decimal
-\fBf   \fRtwo words in floating point
-\fBi   \fRPDP 11 instruction
-\fBo   \fRone word in octal
-\fBn   \fRprint a newline
-\fBr   \fRprint a blank space
-\fBs   \fRa null terminated character string
-\fIn\fBt       \fRmove to next \fIn\fR space tab
-\fBu   \fRone word as unsigned integer
-\fBx   \fRhexadecimal
-\fBY   \fRdate
-\fB^   \fRbackup dot
-\fB"..."\fR    print string
-.LP
-.ta .7i
-.SH
-Expression Summary
-.LP
-.ta .7i
-a) expression components
-.LP
-.ta .1.1i
-.nf
-\fBdecimal integer     \fRe.g. 256
-\fBoctal integer       \fRe.g. 0277
-\fBhexadecimal \fRe.g. #ff
-\fBsymbols     \fRe.g. flag  _main  main.argc
-\fBvariables   \fRe.g. <b
-\fBregisters   \fRe.g. <pc <r0
-\fB(expression)        \fRexpression grouping
-.LP
-.ta .7i
-b) dyadic operators
-.LP
-.ta .7i
-.nf
-\fB+\fP        add
-\fB\(mi\fP     subtract
-\fB*\fP        multiply
-\fB%\fP        integer division
-\fB&\fP        bitwise and
-\fB|\fP        bitwise or
-\fB#\fP        round up to the next multiple
-.LP
-.ta .7i
-c) monadic operators
-.LP
-.ta .7i
-.nf
-\v'.25m'\s+2\fB~\fP\s0\v'-.25m'        not
-\fB*\fR        contents of location
-\fB\(mi\fR     integer negate
-.fi
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae.mac b/.ref-Research-V7/usr/doc/adv.ed/ae.mac
deleted file mode 100644 (file)
index 910e69e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-.tr _\(em
-.de UL
-.if n .ul
-.if n \\$3\\$1\\$2
-.if t \\$3\f3\\$1\fP\\$2
-..
-.de IT
-.if t \\$3\f2\\$1\fP\\$2
-.if n .ul
-.if n \\$3\\$1\\$2
-..
-.de UI
-\f3\\$1\fI\\$2\fR\\$3
-..
-.de P1
-.if n .ls 1
-.nf
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ta .3i .6i .9i 1.2i 1.5i 1.8i
-.tr -\-
-.              use first argument as indent if present
-.if \\n(.$ .DS I \\$1
-.if !\\n(.$ .DS I 5
-..
-.de P2
-.DE
-.tr --
-.if n .ls 2
-..
-.if t .ds B \s6\|\v'.1m'\(sq\v'-.1m'\|\s0
-.if n .ds B [\b]
-.if t .ds m \(mi
-.if n .ds m -
-.if t .ds n \(no
-.if n .ds n -
-.if t .ds s \v'.41m'\s+4*\s-4\v'-.41m'
-.if n .ds s *
-.if t .ds S \(sl
-.if n .ds S /
-.if t .ds d \s+4\&.\&\s-4
-.if n .ds d \&.\&
-.if t .ds a \z@@
-.if n .ds a @
-.if t .ds . \s+2\fB.\fP\s-2
-.if n .ds . .
-.if t .ds e \z\e\h'2u'\e
-.if n .ds e \e
-.hy 14
-.      2=not last lines; 4= no -xx; 8=no xx-
-.tr *\(**
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae0 b/.ref-Research-V7/usr/doc/adv.ed/ae0
deleted file mode 100644 (file)
index 2e21e3a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-.....TM 76-1273-8 39199 39199-11
-.RP
-.TL
-Advanced Editing on UNIX
-.AU "MH 2C518" 6021
-Brian W. Kernighan
-.AI
-.MH
-.AB
-This paper is meant to help
-secretaries, typists and programmers
-to make effective use of the
-.UX
-facilities
-for preparing and editing text.
-It provides explanations and examples of
-.IP \(bu
-special characters, line addressing and global commands in the editor
-.UL ed ;
-.IP \(bu
-commands for ``cut and paste'' operations on files
-and parts of files,
-including the
-.UL mv ,
-.UL cp ,
-.UL cat
-and
-.UL rm
-commands,
-and the
-.UL r ,
-.UL w ,
-.UL m
-and
-.UL t
-commands of the editor;
-.IP \(bu
-editing scripts and
-editor-based programs like
-.UL grep
-and
-.UL sed .
-.PP
-Although the treatment is aimed
-at non-programmers,
-new
-.UC UNIX
-users
-with any background
-should find helpful hints
-on how to get their jobs done
-more easily.
-.AE
-.CS 16 0 16 0 0 3
-.if n .ls 2
-.if t .2C
-.nr PS 9
-.nr VS 11
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae1 b/.ref-Research-V7/usr/doc/adv.ed/ae1
deleted file mode 100644 (file)
index 02419e4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.NH
-INTRODUCTION
-.PP
-Although
-.UX
-provides remarkably effective tools for text editing,
-that by itself is no guarantee
-that everyone will automatically
-make the most effective use of them.
-In particular, people who are not computer specialists _
-typists, secretaries, casual users _
-often use the system less effectively than they might.
-.PP
-This document is intended as a sequel to
-.ul
-A Tutorial Introduction to the UNIX Text Editor
-[1],
-providing explanations and examples of how to edit with less effort.
-(You should also be familiar with the material in
-.ul
-UNIX For Beginners
-[2].)
-Further information on all commands discussed here can be found in
-.ul
-The UNIX Programmer's Manual
-[3].
-.PP
-Examples are based on observations
-of users
-and the difficulties they encounter.
-Topics covered include special characters in searches and substitute commands,
-line addressing, the global commands,
-and line moving and copying.
-There are also brief discussions of
-effective use
-of related tools, like those for file manipulation,
-and those based on
-.UL ed ,
-like
-.UL grep 
-and
-.UL sed .
-.PP
-A word of caution.
-There is only one way to learn to use something,
-and that is to
-.ul
-use
-it.
-Reading a description is no substitute
-for trying something.
-A paper like this one should
-give you ideas about what to try,
-but until you actually try something,
-you will not learn it.
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae2 b/.ref-Research-V7/usr/doc/adv.ed/ae2
deleted file mode 100644 (file)
index 475b281..0000000
+++ /dev/null
@@ -1,1011 +0,0 @@
-.NH
-SPECIAL CHARACTERS
-.PP
-The editor
-.UL ed
-is the primary interface to the system
-for many people, so
-it is worthwhile to know
-how to get the most out of
-.UL ed
-for the least effort.
-.PP
-The next few sections will discuss
-shortcuts
-and labor-saving devices.
-Not all of these will be instantly useful
-to any one person, of course,
-but a few will be,
-and the others should give you ideas to store
-away for future use.
-And as always,
-until you try these things,
-they will remain theoretical knowledge,
-not something you have confidence in.
-.SH
-The List command `l'
-.PP
-.UL ed
-provides two commands for printing the contents of the lines
-you're editing.
-Most people are familiar with
-.UL p ,
-in combinations like
-.P1
-1,$p
-.P2
-to print all the lines you're editing,
-or
-.P1
-s/abc/def/p
-.P2
-to change 
-`abc'
-to
-`def'
-on the current line.
-Less familiar is the
-.ul
-list
-command
-.UL l
-(the letter `\fIl\|\fR'),
-which gives slightly more information than
-.UL p .
-In particular,
-.UL l
-makes visible characters that are normally invisible,
-such as tabs and backspaces.
-If you list a line that contains some of these,
-.UL l
-will print each tab as
-.UL \z\(mi>
-and each backspace as
-.UL \z\(mi< .
-This makes it much easier to correct the sort of typing mistake
-that inserts extra spaces adjacent to tabs,
-or inserts a backspace followed by a space.
-.PP
-The
-.UL l
-command
-also `folds' long lines for printing _
-any line that exceeds 72 characters is printed on multiple lines;
-each printed line except the last is terminated by a backslash 
-.UL \*e ,
-so you can tell it was folded.
-This is useful for printing long lines on short terminals.
-.PP
-Occasionally the
-.UL l
-command will print in a line a string of numbers preceded by a backslash,
-such as \*e07 or \*e16.
-These combinations are used to make visible characters that normally don't print,
-like form feed or vertical tab or bell.
-Each such combination is a single character.
-When you see such characters, be wary _
-they may have surprising meanings when printed on some terminals.
-Often their presence means that your finger slipped while you were typing;
-you almost never want them.
-.SH
-The Substitute Command `s'
-.PP
-Most of the next few sections will be taken up with a discussion
-of the
-substitute
-command
-.UL s .
-Since this is the command for changing the contents of individual
-lines,
-it probably has the most complexity of any 
-.UL ed 
-command,
-and the most potential for effective use.
-.PP
-As the simplest place to begin,
-recall the meaning of a trailing
-.UL g
-after a substitute command.
-With
-.P1
-s/this/that/
-.P2
-and
-.P1
-s/this/that/g
-.P2
-the
-first
-one replaces the
-.ul
-first
-`this' on the line
-with `that'.
-If there is more than one `this' on the line,
-the second form
-with the trailing
-.UL g
-changes
-.ul
-all
-of them.
-.PP
-Either form of the
-.UL s
-command can be followed by
-.UL p
-or
-.UL l
-to `print' or `list' (as described in the previous section)
-the contents of the line:
-.P1
-s/this/that/p
-s/this/that/l
-s/this/that/gp
-s/this/that/gl
-.P2
-are all legal, and mean slightly different things.
-Make sure you know what the differences are.
-.PP
-Of course, any
-.UL s
-command can be preceded by one or two `line numbers'
-to specify that the substitution is to take place
-on a group of lines. 
-Thus
-.P1
-1,$s/mispell/misspell/
-.P2
-changes the 
-.ul
-first
-occurrence of
-`mispell' to `misspell' on every line of the file.
-But
-.P1
-1,$s/mispell/misspell/g
-.P2
-changes 
-.ul
-every
-occurrence in every line
-(and this is more likely to be what you wanted in this
-particular case).
-.PP
-You should also notice that if you add a
-.UL p
-or
-.UL l
-to the end of any of these substitute commands,
-only the last line that got changed will be printed,
-not all the lines.
-We will talk later about how to print all the lines
-that were modified.
-.SH
-The Undo Command `u'
-.PP
-Occasionally you will make a substitution in a line,
-only to realize too late that it was a ghastly mistake.
-The `undo' command
-.UL u
-lets you `undo' the last substitution:
-the last line that was substituted can be restored to
-its previous state by typing the command
-.P1
-u
-.P2
-.SH
-The Metacharacter `\*.'
-.PP
-As you have undoubtedly noticed
-when you use
-.UL ed ,
-certain characters have unexpected meanings
-when they occur in the left side of a substitute command,
-or in a search for a particular line.
-In the next several sections, we will talk about
-these special characters,
-which are often called `metacharacters'.
-.PP
-The first one is the period `\*.'.
-On the left side of a substitute command,
-or in a search with `/.../',
-`\*.' stands for
-.ul
-any
-single character.
-Thus the search
-.P1
-/x\*.y/
-.P2
-finds any line where `x' and `y' occur separated by
-a single character, as in
-.P1
-x+y
-x\-y
-x\*By
-x\*.y
-.P2
-and so on.
-(We will use \*B to stand for a space whenever we need to
-make it visible.)
-.PP
-Since `\*.' matches a single character,
-that gives you a way to deal with funny characters
-printed by
-.UL l .
-Suppose you have a line that, when printed with the
-.UL l
-command, appears as
-.P1
- ....   th\*e07is   ....
-.P2
-and you want to get rid of the 
-\*e07
-(which represents the bell character, by the way).
-.PP
-The most obvious solution is to try
-.P1
-s/\*e07//
-.P2
-but this will fail. (Try it.)
-The brute force solution, which most people would now take,
-is to re-type the entire line.
-This is guaranteed, and is actually quite a reasonable tactic
-if the line in question isn't too big,
-but for a very long line,
-re-typing is a bore.
-This is where the metacharacter `\*.' comes in handy.
-Since `\*e07' really represents a single character,
-if we say
-.P1
-s/th\*.is/this/
-.P2
-the job is done.
-The `\*.' matches the mysterious character between the `h' and the `i',
-.ul
-whatever it is.
-.PP
-Bear in mind that since `\*.' matches any single character,
-the command
-.P1
-s/\*./,/
-.P2
-converts the first character on a line into a `,',
-which very often is not what you intended.
-.PP
-As is true of many characters in
-.UL ed ,
-the `\*.' has several meanings, depending
-on its context.
-This line shows all three:
-.P1
-\&\*.s/\*./\*./
-.P2
-The first `\*.' is a line number,
-the number of
-the line we are editing,
-which is called `line dot'.
-(We will discuss line dot more in Section 3.)
-The second `\*.' is a metacharacter
-that matches any single character on that line.
-The third `\*.' is the only one that really is
-an honest literal period.
-On the
-.ul
-right
-side of a substitution, `\*.'
-is not special.
-If you apply this command to the line
-.P1
-Now is the time\*.
-.P2
-the result will
-be
-.P1
-\&\*.ow is the time\*.
-.P2
-which is probably not what you intended.
-.SH
-The Backslash `\*e'
-.PP
-Since a period means `any character',
-the question naturally arises of what to do
-when you really want a period.
-For example, how do you convert the line
-.P1
-Now is the time\*.
-.P2
-into
-.P1
-Now is the time?
-.P2
-The backslash `\*e' does the job.
-A backslash turns off any special meaning that the next character
-might have; in particular,
-`\*e\*.' converts the `\*.' from a `match anything'
-into a period, so
-you can use it to replace
-the period in
-.P1
-Now is the time\*.
-.P2
-like this:
-.P1
-s/\*e\*./?/
-.P2
-The pair of characters `\*e\*.' is considered by
-.UL ed
-to be a single real period.
-.PP
-The backslash can also be used when searching for lines
-that contain a special character.
-Suppose you are looking for a line that contains
-.P1
-\&\*.PP
-.P2
-The search
-.P1
-/\*.PP/
-.P2
-isn't adequate, for it will find
-a line like
-.P1
-THE APPLICATION OF ...
-.P2
-because the `\*.' matches the letter `A'.
-But if you say
-.P1
-/\*e\*.PP/
-.P2
-you will find only lines that contain `\*.PP'.
-.PP
-The backslash can also be used to turn off special meanings for
-characters other than `\*.'.
-For example, consider finding a line that contains a backslash.
-The search
-.P1
-/\*e/
-.P2
-won't work,
-because the `\*e' isn't a literal `\*e', but instead means that the second `/'
-no longer \%delimits the search.
-But by preceding a backslash with another one,
-you can search for a literal backslash.
-Thus
-.P1
-/\*e\*e/
-.P2
-does work.
-Similarly, you can search for a forward slash `/' with
-.P1
-/\*e//
-.P2
-The backslash turns off the meaning of the immediately following `/' so that
-it doesn't terminate the /.../ construction prematurely.
-.PP
-As an exercise, before reading further, find two substitute commands each of which will
-convert the line
-.P1
-\*ex\*e\*.\*ey
-.P2
-into the line
-.P1
-\*ex\*ey
-.P2
-.PP
-Here are several solutions;
-verify that each works as advertised.
-.P1
-s/\*e\*e\*e\*.//
-s/x\*.\*./x/
-s/\*.\*.y/y/
-.P2
-.PP
-A couple of miscellaneous notes about
-backslashes and special characters.
-First, you can use any character to delimit the pieces
-of an
-.UL s
-command: there is nothing sacred about slashes.
-(But you must use slashes for context searching.)
-For instance, in a line that contains a lot of slashes already, like
-.P1
-//exec //sys.fort.go // etc...
-.P2
-you could use a colon as the delimiter _
-to delete all the slashes, type
-.P1
-s:/::g
-.P2
-.PP
-Second, if # and @ are your character erase and line kill characters,
-you have to type \*e# and \*e@;
-this is true whether you're talking to
-.UL ed
-or any other program.
-.PP
-When you are adding text with
-.UL a
-or
-.UL i
-or
-.UL c ,
-backslash is not special, and you should only put in
-one backslash for each one you really want.
-.SH
-The Dollar Sign `$'
-.PP
-The next metacharacter, the `$', stands for `the end of the line'.
-As its most obvious use, suppose you have the line
-.P1
-Now is the
-.P2
-and you wish to add the word `time' to the end.
-Use the $ like this:
-.P1
-s/$/\*Btime/
-.P2
-to get
-.P1
-Now is the time
-.P2
-Notice that a space is needed before `time' in
-the substitute command,
-or you will get
-.P1
-Now is thetime
-.P2
-.PP
-As another example, replace the second comma in
-the following line with a period without altering the first:
-.P1
-Now is the time, for all good men,
-.P2
-The command needed is
-.P1
-s/,$/\*./
-.P2
-The $ sign here provides context to make specific which comma we mean.
-Without it, of course, the
-.UL s
-command would operate on the first comma to produce
-.P1
-Now is the time\*. for all good men,
-.P2
-.PP
-As another example, to convert
-.P1
-Now is the time\*.
-.P2
-into
-.P1
-Now is the time?
-.P2
-as we did earlier, we can use
-.P1
-s/\*.$/?/
-.P2
-.PP
-Like `\*.', the `$'
-has multiple meanings depending on context.
-In the line
-.P1
-$s/$/$/
-.P2
-the first `$' refers to the
-last line of the file,
-the second refers to the end of that line,
-and the third is a literal dollar sign,
-to be added to that line.
-.SH
-The Circumflex `^'
-.PP
-The circumflex (or hat or caret)
-`^' stands for the beginning of the line.
-For example, suppose you are looking for a line that begins
-with `the'.
-If you simply say 
-.P1
-/the/
-.P2
-you will in all likelihood find several lines that contain `the' in the middle before
-arriving at the one you want.
-But with
-.P1
-/^the/
-.P2
-you narrow the context, and thus arrive at the desired one
-more easily.
-.PP
-The other use of `^' is of course to enable you to insert
-something at the beginning of a line:
-.P1
-s/^/\*B/
-.P2
-places a space at the beginning of the current line.
-.PP
-Metacharacters can be combined. To search for a
-line that contains 
-.ul
-only 
-the characters
-.P1
-\&\*.PP
-.P2
-you can use the command
-.P1
-/^\*e\*.PP$/
-.P2
-.SH
-The Star `*'
-.PP
-Suppose you have a line that looks like this:
-.P1
-\fItext \fR x                y \fI text \fR
-.P2
-where 
-.ul
-text 
-stands
-for lots of text,
-and there are some indeterminate number of spaces between the
-.UL x
-and the
-.UL y .
-Suppose the job is to replace all the spaces between
-.UL x
-and
-.UL y
-by a single space.
-The line is too long to retype, and there are too many spaces
-to count.
-What now?
-.PP
-This is where the metacharacter `*'
-comes in handy.
-A character followed by a star
-stands for as many consecutive occurrences of that
-character as possible.
-To refer to all the spaces at once, say
-.P1
-s/x\*B*y/x\*By/
-.P2
-The construction
-`\*B*'
-means
-`as many spaces as possible'.
-Thus `x\*B*y' means `an x, as many spaces as possible, then a y'.
-.PP
-The star can be used with any character, not just space.
-If the original example was instead
-.P1
-\fItext \fR x--------y \fI text \fR
-.P2
-then all `\-' signs can be replaced by a single space
-with the command
-.P1
-s/x-*y/x\*By/
-.P2
-.PP
-Finally, suppose that the line was
-.P1
-\fItext \fR x\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.y \fI text \fR
-.P2
-Can you see what trap lies in wait for the unwary?
-If you blindly type
-.P1
-s/x\*.*y/x\*By/
-.P2
-what will happen?
-The answer, naturally, is that it depends.
-If there are no other x's or y's on the line,
-then everything works, but it's blind luck, not good management.
-Remember that `\*.' matches
-.ul
-any
-single character?
-Then `\*.*' matches as many single characters as possible,
-and unless you're careful, it can eat up a lot more of the line
-than you expected.
-If the line was, for example, like this:
-.P1
-\fItext  \fRx\fI  text  \fR x\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.\*.y \fI  text  \fRy\fI  text  \fR
-.P2
-then saying
-.P1
-s/x\*.*y/x\*By/
-.P2
-will take everything from the
-.ul
-first
-`x' to the
-.ul
-last
-`y',
-which, in this example, is undoubtedly more than you wanted.
-.PP
-The solution, of course, is to turn off the special meaning of
-`\*.' with
-`\*e\*.':
-.P1
-s/x\*e\*.*y/x\*By/
-.P2
-Now everything works, for `\*e\*.*' means `as many
-.ul
-periods
-as possible'.
-.PP
-There are times when the pattern `\*.*' is exactly what you want.
-For example, to change
-.P1
-Now is the time for all good men ....
-.P2
-into
-.P1
-Now is the time\*.
-.P2
-use `\*.*' to eat up everything after the `for':
-.P1
-s/\*Bfor\*.*/\*./
-.P2
-.PP
-There are a couple of additional pitfalls associated with `*' that you should be aware of.
-Most notable is the fact that `as many as possible' means
-.ul
-zero
-or more.
-The fact that zero is a legitimate possibility is
-sometimes rather surprising.
-For example, if our line contained
-.P1
-\fItext \fR xy \fI text \fR x             y \fI text \fR
-.P2
-and we said
-.P1
-s/x\*B*y/x\*By/
-.P2
-the
-.ul
-first
-`xy' matches this pattern, for it consists of an `x',
-zero spaces, and a `y'.
-The result is that the substitute acts on the first `xy',
-and does not touch the later one that actually contains some intervening spaces.
-.PP
-The way around this, if it matters, is to specify a pattern like
-.P1
-/x\*B\*B*y/
-.P2
-which says `an x, a space, then as many more spaces as possible, then a y',
-in other words, one or more spaces.
-.PP
-The other startling behavior of `*' is again related to the fact
-that zero is a legitimate number of occurrences of something
-followed by a star. The command
-.P1
-s/x*/y/g
-.P2
-when applied to the line
-.P1
-abcdef
-.P2
-produces
-.P1
-yaybycydyeyfy
-.P2
-which is almost certainly not what was intended.
-The reason for this behavior is that zero is a legal number
-of matches,
-and there are no x's at the beginning of the line
-(so that gets converted into a `y'),
-nor between the `a' and the `b'
-(so that gets converted into a `y'), nor ...
-and so on.
-Make sure you really want zero matches;
-if not, in this case write
-.P1
-s/xx*/y/g
-.P2
-`xx*' is one or more x's.
-.SH
-The Brackets `[ ]'
-.PP
-Suppose that you want to delete any numbers
-that appear
-at the beginning of all lines of a file.
-You might first think of trying a series of commands like
-.P1
-1,$s/^1*//
-1,$s/^2*//
-1,$s/^3*//
-.P2
-and so on,
-but this is clearly going to take forever if the numbers are at all long.
-Unless you want to repeat the commands over and over until
-finally all numbers are gone,
-you must get all the digits on one pass.
-This is the purpose of the brackets [ and ].
-.PP
-The construction
-.P1
-[0123456789]
-.P2
-matches any single digit _
-the whole thing is called a `character class'.
-With a character class, the job is easy.
-The pattern `[0123456789]*' matches zero or more digits (an entire number), so
-.P1
-1,$s/^[0123456789]*//
-.P2
-deletes all digits from the beginning of all lines.
-.PP
-Any characters can appear within a character class,
-and just to confuse the issue there are essentially no special characters
-inside the brackets;
-even the backslash doesn't have a special meaning.
-To search for special characters, for example, you can say
-.P1
-/[\*.\*e$^[]/
-.P2
-Within [...], the `[' is not special.
-To get a `]' into a character class,
-make it the first character.
-.PP
-It's a nuisance to have to spell out the digits,
-so you can abbreviate them as
-[0\-9];
-similarly, [a\-z] stands for the lower case letters,
-and
-[A\-Z] for upper case.
-.PP
-As a final frill on character classes, you can specify a class
-that means `none of the following characters'.
-This is done by beginning the class with a `^':
-.P1
-[^0-9]
-.P2
-stands for `any character 
-.ul
-except
-a digit'.
-Thus you might find the first line that doesn't begin with a tab or space
-by a search like
-.P1
-/^[^(space)(tab)]/
-.P2
-.PP
-Within a character class,
-the circumflex has a special meaning 
-only if it occurs at the beginning.
-Just to convince yourself, verify that
-.P1
-/^[^^]/
-.P2
-finds a line that doesn't begin with a circumflex.
-.SH
-The Ampersand `&'
-.PP
-The ampersand `&' is used primarily to save typing.
-Suppose you have the line
-.P1
-Now is the time
-.P2
-and you want to make it
-.P1
-Now is the best time
-.P2
-Of course you can always say
-.P1
-s/the/the best/
-.P2
-but it seems silly to have to repeat the `the'.
-The `&' is used to eliminate the repetition.
-On the
-.ul
-right
-side of a substitute, the ampersand means `whatever
-was just matched', so you can say
-.P1
-s/the/& best/
-.P2
-and the `&' will stand for `the'.
-Of course this isn't much of a saving if the thing
-matched is just `the', but if it is something truly long or awful,
-or if it is something like `.*'
-which matches a lot of text,
-you can save some tedious typing.
-There is also much less chance of making a typing error
-in the replacement text.
-For example, to parenthesize a line,
-regardless of its length,
-.P1
-s/\*.*/(&)/
-.P2
-.PP
-The ampersand can occur more than once on the right side:
-.P1
-s/the/& best and & worst/
-.P2
-makes
-.P1
-Now is the best and the worst time
-.P2
-and
-.P1
-s/\*.*/&? &!!/
-.P2
-converts the original line into
-.P1
-Now is the time? Now is the time!!
-.P2
-.PP
-To get a literal ampersand, naturally the backslash is used to turn off the special meaning:
-.P1
-s/ampersand/\*e&/
-.P2
-converts the word into the symbol.
-Notice that `&' is not special on the left side
-of a substitute, only on the
-.ul
-right 
-side.
-.SH
-Substituting Newlines
-.PP
-.UL ed
-provides a facility for splitting a single line into two or more shorter lines by `substituting in a newline'.
-As the simplest example, suppose a line has gotten unmanageably long
-because of editing (or merely because it was unwisely typed).
-If it looks like
-.P1
-\fItext \fR   xy  \fI text \fR
-.P2
-you can break it between the `x' and the `y' like this:
-.P1
-s/xy/x\*e
-y/
-.P2
-This is actually a single command,
-although it is typed on two lines.
-Bearing in mind that `\*e' turns off special meanings,
-it seems relatively intuitive that a `\*e' at the end of
-a line would make the newline there
-no longer special.
-.PP
-You can in fact make a single line into several lines
-with this same mechanism.
-As a large example, consider underlining the word `very'
-in a long line
-by splitting `very' onto a separate line,
-and preceding it by the
-.UL roff
-or
-.UL nroff
-formatting command `.ul'.
-.P1
-\fItext \fR a very big \fI text \fR
-.P2
-The command
-.P1
-s/\*Bvery\*B/\*e
-\&.ul\*e
-very\*e
-/
-.P2
-converts the line into four shorter lines,
-preceding the word `very' by the
-line
-`.ul',
-and eliminating the spaces around the `very',
-all at the same time.
-.PP
-When a newline is substituted
-in, dot is left pointing at the last line created.
-.PP
-.SH
-Joining Lines
-.PP
-Lines may also be joined together,
-but this is done with the
-.UL j
-command
-instead of
-.UL s .
-Given the lines
-.P1
-Now is
-\*Bthe time
-.P2
-and supposing that dot is set to the first of them,
-then the command
-.P1
-j
-.P2
-joins them together.
-No blanks are added,
-which is why we carefully showed a blank 
-at the beginning of the second line.
-.PP
-All by itself,
-a
-.UL j
-command
-joins line dot to line dot+1,
-but any contiguous set of lines can be joined.
-Just specify the starting and ending line numbers.
-For example,
-.P1
-1,$jp
-.P2
-joins all the lines into one big one
-and prints it.
-(More on line numbers in Section 3.)
-.SH
-Rearranging a Line with \*e( ... \*e)
-.PP
-(This section should be skipped on first reading.)
-Recall that `&' is a shorthand that stands for whatever
-was matched by the left side of an
-.UL s
-command.
-In much the same way you can capture separate pieces
-of what was matched;
-the only difference is that you have to specify
-on the left side just what pieces you're interested in.
-.PP
-Suppose, for instance, that 
-you have a file of lines that consist of names in the form
-.P1
-Smith, A. B.
-Jones, C.
-.P2
-and so on,
-and you want the initials to precede the name, as in
-.P1
-A. B. Smith
-C. Jones
-.P2
-It is possible to do this with a series of editing commands,
-but it is tedious and error-prone.
-(It is instructive to figure out how it is done, though.)
-.PP
-The alternative
-is to `tag' the pieces of the pattern (in this case,
-the last name, and the initials),
-and then rearrange the pieces.
-On the left side of a substitution,
-if part of the pattern is enclosed between
-\*e( and \*e),
-whatever matched that part is remembered,
-and available for use on the right side.
-On the right side,
-the symbol `\*e1' refers to whatever
-matched the first \*e(...\*e) pair,
-`\*e2' to the second \*e(...\*e),
-and so on.
-.PP
-The command
-.P1
-1,$s/^\*e([^,]*\*e),\*B*\*e(\*.*\*e)/\*e2\*B\*e1/
-.P2
-although hard to read, does the job.
-The first \*e(...\*e) matches the last name,
-which is any string up to the comma;
-this is referred to on the right side with `\*e1'.
-The second \*e(...\*e) is whatever follows
-the comma and any spaces,
-and is referred to as `\*e2'.
-.PP
-Of course, with any editing sequence this complicated,
-it's foolhardy to simply run it and hope.
-The global commands 
-.UL g
-and 
-.UL v
-discussed in section 4
-provide a way for you to print exactly those
-lines which were affected by the
-substitute command,
-and thus verify that it did what you wanted
-in all cases.
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae3 b/.ref-Research-V7/usr/doc/adv.ed/ae3
deleted file mode 100644 (file)
index a926168..0000000
+++ /dev/null
@@ -1,468 +0,0 @@
-.NH
-LINE ADDRESSING IN THE EDITOR
-.PP
-The next general area we will discuss is that of
-line addressing in
-.UL ed ,
-that is, how you specify what lines are to be
-affected by editing commands.
-We have already used constructions like 
-.P1
-1,$s/x/y/
-.P2
-to specify a change on all lines.
-And most users are long since familiar with
-using a single newline (or return) to print the next line,
-and with
-.P1
-/thing/
-.P2
-to find a line that contains `thing'.
-Less familiar, surprisingly enough, is the
-use of
-.P1
-?thing?
-.P2
-to scan
-.ul
-backwards
-for the previous occurrence of `thing'.
-This is especially handy when you realize that the thing
-you want to operate on is back up the page from
-where you are currently editing.
-.PP
-The slash and question mark are the only characters you can
-use to delimit a context search, though you can use
-essentially any character in a substitute command.
-.SH
-Address Arithmetic
-.PP
-The next step is to combine the line numbers
-like `\*.', `$', `/.../' and `?...?'
-with `+' and `\-'.
-Thus
-.P1
-$-1
-.P2
-is a command to print the next to last line of
-the current file (that is, one line before line `$').
-For example, to recall how far you got in a previous editing session,
-.P1
-$-5,$p
-.P2
-prints the last six lines.
-(Be sure you understand why it's six, not five.)
-If there aren't six, of course, you'll get an error message.
-.PP
-As another example,
-.P1
-\&\*.-3,\*.+3p
-.P2
-prints from three lines before where you are now
-(at line dot)
-to three lines after,
-thus giving you a bit of context.
-By the way, the `+' can be omitted:
-.P1
-\&\*.-3,\*.3p
-.P2
-is absolutely identical in meaning.
-.PP
-Another area in which you can save typing effort
-in specifying lines is to use `\-' and `+' as line numbers
-by themselves.
-.P1
--
-.P2
-by itself is a command to move back up one line in the file.
-In fact, you can string several minus signs together to move
-back up that many lines:
-.P1
----
-.P2
-moves up three lines, as does `\-3'.
-Thus
-.P1
--3,+3p
-.P2
-is also identical to the examples above.
-.PP
-Since `\-' is shorter than `\*.\-1',
-constructions like
-.P1
--,\*.s/bad/good/
-.P2
-are useful. This changes `bad' to `good' on the previous line and
-on the current line.
-.PP
-`+' and `\-' can be used in combination with searches using `/.../' and `?...?',
-and with `$'.
-The search
-.P1
-/thing/--
-.P2
-finds the line containing `thing', and positions you
-two lines before it.
-.SH
-Repeated Searches
-.PP
-Suppose you ask for the search
-.P1
-/horrible thing/
-.P2
-and when the line is printed you discover that it
-isn't the horrible thing that you wanted,
-so it is necessary to repeat the search again.
-You don't have to re-type the search,
-for the construction
-.P1
-//
-.P2
-is a shorthand for `the previous thing that was searched for',
-whatever it was.
-This can be repeated as many times as necessary.
-You can also go backwards:
-.P1
-??
-.P2
-searches for the same thing,
-but in the reverse direction.
-.PP
-Not only can you repeat the search, but you can
-use `//' as the left side of a substitute command,
-to mean
-`the most recent pattern'.
-.P1
-/horrible thing/
-.ft I
- .... ed prints line with `horrible thing' ...
-.ft R
-s//good/p
-.P2
-To go backwards and change a line, say
-.P1
-??s//good/
-.P2
-Of course, you can still use the `&' on the right hand side of a substitute to stand for
-whatever got matched:
-.P1
-//s//&\*B&/p
-.P2
-finds the next occurrence of whatever you searched for last,
-replaces it by two copies of itself,
-then prints the line just to verify that it worked.
-.SH
-Default Line Numbers and the Value of Dot
-.PP
-One of the most effective ways to speed up your editing
-is always to know what lines will be affected
-by a command if you don't specify the lines it is to act on,
-and on what line you will be positioned (i.e., the value of dot) when a command finishes.
-If you can edit without specifying unnecessary
-line numbers, you can save a lot of typing.
-.PP
-As the most obvious example, if you issue a search command
-like
-.P1
-/thing/
-.P2
-you are left pointing at the next line that contains `thing'.
-Then no address is required with commands like
-.UL s
-to make a substitution on that line,
-or
-.UL p
-to print it,
-or
-.UL l
-to list it,
-or
-.UL d
-to delete it,
-or
-.UL a
-to append text after it,
-or
-.UL c
-to change it,
-or
-.UL i
-to insert text before it.
-.PP
-What happens if there was no `thing'?
-Then you are left right where you were _
-dot is unchanged.
-This is also true if you were sitting
-on the only `thing' when you issued the command.
-The same rules hold for searches that use
-`?...?'; the only difference is the direction
-in which you search.
-.PP
-The delete command
-.UL d 
-leaves dot pointing
-at the line that followed the last deleted line.
-When line `$' gets deleted,
-however,
-dot points at the
-.ul
-new
-line `$'.
-.PP
-The line-changing commands
-.UL a ,
-.UL c
-and
-.UL i
-by default all affect the current line _
-if you give no line number with them,
-.UL a
-appends text after the current line,
-.UL c
-changes the current line,
-and
-.UL i
-inserts text before the current line.
-.PP
-.UL a ,
-.UL c ,
-and
-.UL i
-behave identically in one respect _
-when you stop appending, changing or inserting,
-dot points at the last line entered.
-This is exactly what you want for typing and editing on the fly.
-For example, you can say
-.P1
-.ta 1.5i
-a
- ... text ...
- ... botch ... (minor error)
-\&\*.
-s/botch/correct/       (fix botched line)
-a
- ... more text ...
-.P2
-without specifying any line number for the substitute command or for
-the second append command.
-Or you can say
-.P1 2
-.ta 1.5i
-a
- ... text ...
- ... horrible botch ...        (major error)
-\&\*.
-c      (replace entire line)
- ... fixed up line ...
-.P2
-.PP
-You should experiment to determine what happens if you add
-.ul
-no
-lines with
-.UL a ,
-.UL c
-or
-.UL i .
-.PP
-The
-.UL r
-command will read a file into the text being edited,
-either at the end if you give no address,
-or after the specified line if you do.
-In either case, dot points at the last line read in.
-Remember that you can even say
-.UL 0r
-to read a file in at the beginning of the text.
-(You can also say
-.UL 0a
-or
-.UL 1i
-to start adding text at the beginning.)
-.PP
-The
-.UL w
-command writes out the entire file.
-If you precede the command by one line number,
-that line is written,
-while if you precede it by two line numbers,
-that range of lines is written.
-The 
-.UL w
-command does
-.ul
-not
-change dot:
-the current line remains the same,
-regardless of what lines are written.
-This is true even if you say something like
-.P1
-/^\*e\*.AB/,/^\*e\*.AE/w abstract
-.P2
-which involves a context search.
-.PP
-Since the
-.UL w
-command is so easy to use,
-you should save what you are editing regularly
-as you go along
-just in case the system crashes, or in case you do something foolish,
-like clobbering what you're editing.
-.PP
-The least intuitive behavior, in a sense, is that of the
-.UL s
-command.
-The rule is simple _
-you are left sitting on the last line that got changed.
-If there were no changes, then dot is unchanged.
-.PP
-To illustrate,
-suppose that there are three lines in the buffer, and you are sitting on
-the middle one:
-.P1
-x1
-x2
-x3
-.P2
-Then the command
-.P1
-\&-,+s/x/y/p
-.P2
-prints the third line, which is the last one changed.
-But if the three lines had been
-.P1
-x1
-y2
-y3
-.P2
-and the same command had been issued while
-dot pointed
-at the second line, then the result
-would be to change and print only the first line,
-and that is where dot would be set.
-.SH
-Semicolon `;'
-.PP
-Searches with `/.../' and `?...?' start
-at the current line and move
-forward or backward respectively
-until they either find the pattern or get back to the current line.
-Sometimes this is not what is wanted.
-Suppose, for example, that the buffer contains lines like this:
-.P1
- \*.
- \*.
- \*.
- ab
- \*.
- \*.
- \*.
- bc
- \*. 
- \*.
-.P2
-Starting at line 1, one would expect that the command
-.P1
-/a/,/b/p
-.P2
-prints all the lines from the `ab' to the `bc' inclusive.
-Actually this is not what happens.
-.ul
-Both
-searches
-(for `a' and for `b')
-start from the same point, and thus they both find the line
-that contains `ab'.
-The result is to print a single line.
-Worse, if there had been a line with a `b' in it
-before the `ab' line, then the print command
-would be in error, since the second line number
-would be less than the first, and it is illegal to
-try to print lines in reverse order.
-.PP
-This is because the comma separator
-for line numbers doesn't set dot as each address is processed;
-each search starts from the same place.
-In 
-.UL ed ,
-the semicolon `;' can be used just like comma,
-with the single difference that use of a semicolon
-forces dot to be set at that point
-as the line numbers are being evaluated.
-In effect, the semicolon `moves' dot.
-Thus in our example above, the command
-.P1
-/a/;/b/p
-.P2
-prints the range of lines from `ab' to `bc',
-because after the `a' is found, dot is set to that line,
-and then `b' is searched for, starting beyond that line.
-.PP
-This property is most often useful in a very simple situation.
-Suppose you want to find the 
-.ul
-second
-occurrence of `thing'.
-You could say
-.P1
-/thing/
-//
-.P2
-but this prints the first occurrence as well as the second,
-and is a nuisance when you know very well that it is only
-the second one you're interested in.
-The solution is to say
-.P1
-/thing/;//
-.P2
-This says to find the first occurrence of `thing', set dot to that line, then find the second
-and print only that.
-.PP
-Closely related is searching for the second previous
-occurrence of something, as in
-.P1
-?something?;??
-.P2
-Printing the third or fourth or ...
-in either direction is left as an exercise.
-.PP
-Finally, bear in mind that if you want to find the first occurrence of
-something in a file, starting at an arbitrary place within the file,
-it is not sufficient to say
-.P1
-1;/thing/
-.P2
-because this fails if `thing' occurs on line 1.
-But it is possible to say
-.P1
-0;/thing/
-.P2
-(one of the few places where 0 is a legal line number),
-for this starts the search at line 1.
-.SH
-Interrupting the Editor
-.PP
-As a final note on what dot gets set to,
-you should be aware that if you hit the interrupt or delete
-or rubout or break key
-while
-.UL ed
-is doing a command, things are put back together again and your state
-is restored as much as possible to what it was before the command
-began.
-Naturally, some changes are irrevocable _
-if you are reading or writing a file or making substitutions or deleting lines, these will be stopped
-in some clean but unpredictable state in the middle
-(which is why it is not usually wise to stop them).
-Dot may or may not be changed.
-.PP
-Printing is more clear cut.
-Dot is not changed until the printing is done.
-Thus if you print until you see an interesting line,
-then hit delete, you are
-.ul
-not
-sitting on that line or even near it.
-Dot is left where it was when the
-.UL p
-command was started.
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae4 b/.ref-Research-V7/usr/doc/adv.ed/ae4
deleted file mode 100644 (file)
index 8f56c78..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-.NH
-GLOBAL COMMANDS
-.PP
-The global commands
-.UL g
-and
-.UL v
-are used to perform one or more editing commands on all lines that either
-contain
-.UL g ) (
-or don't contain
-.UL v ) (
-a specified pattern.
-.PP
-As the simplest example, the command
-.P1
-g/UNIX/p
-.P2
-prints all lines that contain the word `UNIX'.
-The pattern that goes between the slashes can be anything
-that could be used in a line search or in a substitute command;
-exactly the same rules and limitations apply.
-.PP
-As another example, then,
-.P1
-g/^\*e\*./p
-.P2
-prints all the formatting commands in a file (lines that begin with `\*.').
-.PP
-The
-.UL v
-command is identical to
-.UL g ,
-except that it operates on those line that do
-.ul
-not
-contain an occurrence of the pattern.
-(Don't look too hard for mnemonic significance to
-the letter `v'.)
-So
-.P1
-v/^\*e\*./p
-.P2
-prints all the lines that don't begin with `\*.' _
-the actual text lines.
-.PP
-The command that follows
-.UL g
-or
-.UL v
-can be anything:
-.P1
-g/^\*e\*./d
-.P2
-deletes all lines that begin with `\*.',
-and
-.P1
-g/^$/d
-.P2
-deletes all empty lines.
-.PP
-Probably the most useful command that can follow a global is the
-substitute command, for this can be used to make a change
-and print each affected line for verification.
-For example, we could change the word `Unix' to `UNIX'
-everywhere, and verify that 
-it really worked, 
-with
-.P1
-g/Unix/s//UNIX/gp
-.P2
-Notice that we used `//' in the substitute command to mean
-`the previous pattern', in this case, `Unix'.
-The 
-.UL p
-command is done on every line
-that matches the pattern,
-not just those on which a substitution took place.
-.PP
-The global command operates by making
-two passes over the file.
-On the first pass, all lines that match the pattern are marked.
-On the second pass, each marked line in turn is examined,
-dot is set to that line, and the command executed.
-This means that it is possible for the command that follows a
-.UL g
-or
-.UL v
-to use addresses, set dot, and so on, quite freely.
-.P1
-g/^\*e\*.PP/+
-.P2
-prints the line that follows each `.PP' command (the signal for
-a new paragraph in some formatting packages).
-Remember that `+' means `one line past dot'.
-And
-.P1
-g/topic/?^\*e\*.SH?1
-.P2
-searches for each line that contains `topic', scans backwards until it finds
-a line that begins `.SH' (a section heading) and prints the line
-that follows that,
-thus showing the section headings under which `topic' is mentioned.
-Finally,
-.P1
-g/^\*e\*.EQ/+,/^\*e\*.EN/-p
-.P2
-prints all the lines that lie between
-lines beginning with `.EQ' and `.EN' formatting commands.
-.PP
-The
-.UL g
-and
-.UL v
-commands can also be
-preceded by line numbers, in which case the lines searched
-are only those in the range specified.
-.SH
-Multi-line Global Commands
-.PP
-It is possible to do more than one command under the control of a
-global command, although the syntax for expressing the operation
-is not especially natural or pleasant.
-As an example,
-suppose the task is to change `x' to `y' and `a' to `b' on all lines
-that contain `thing'.
-Then
-.P1
-g/thing/s/x/y/\*e
-s/a/b/
-.P2
-is sufficient.
-The `\*e' signals the
-.UL g
-command that the set of commands continues on the next line;
-it terminates on the first line that does not end with `\*e'.
-(As a minor blemish, you can't use a substitute command
-to insert a newline within a 
-.UL g
-command.)
-.PP
-You should watch out for this problem:
-the command
-.P1
-g/x/s//y/\*e
-s/a/b/
-.P2
-does
-.ul
-not
-work as you expect.
-The remembered pattern is the last pattern that was actually
-executed,
-so sometimes it will be
-`x' (as expected), and sometimes it will be `a'
-(not expected).
-You must spell it out, like this:
-.P1
-g/x/s/x/y/\*e
-s/a/b/
-.P2
-.PP
-It is also possible to execute 
-.UL a ,
-.UL c
-and
-.UL i
-commands under a global command; as with other multi-line constructions,
-all that is needed is to add a `\*e' at the end of each line except the last.
-Thus to add a `.nf' and `.sp' command before each `.EQ' line, type
-.P1
-g/^\*e\*.EQ/i\*e
-\&\*.nf\*e
-\&\*.sp
-.P2
-There is no need for a final line containing a
-`\*.' to terminate the 
-.UL i
-command,
-unless there are further commands
-being done under the global.
-On the other hand, it does no harm to put it in either.
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae5 b/.ref-Research-V7/usr/doc/adv.ed/ae5
deleted file mode 100644 (file)
index 3b214a6..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-.NH
-CUT AND PASTE WITH UNIX COMMANDS
-.PP
-One editing area in which non-programmers
-seem not very confident
-is in what might be called
-`cut and paste' operations _
-changing the name of a file,
-making a copy of a file somewhere else,
-moving a few lines from one place to another in a file,
-inserting one file in the middle of another,
-splitting a file into pieces,
-and
-splicing two or more files together.
-.PP
-Yet most of these operations are actually quite easy,
-if you keep your wits about you
-and go cautiously.
-The next several sections talk about cut and paste.
-We will begin with the
-.UX
-commands
-for moving entire files around,
-then discuss
-.UL ed
-commands
-for operating on pieces of files.
-.SH
-Changing the Name of a File
-.PP
-You have a file named 
-`memo'
-and you want it to be called
-`paper'
-instead.
-How is it done?
-.PP
-The
-.UX
-program that renames files
-is called
-.UL mv
-(for `move');
-it `moves' the file from one name to another, like this:
-.P1
-mv  memo  paper
-.P2
-That's all there is to it:
-.UL mv
-from the old name to the new name.
-.P1
-mv  oldname  newname
-.P2
-Warning: if there is already a file around with the new name,
-its present contents will be
-silently
-clobbered
-by the information from the other file.
-The one exception is that you can't move a file
-to itself _
-.P1
-mv  x  x
-.P2
-is illegal.
-.SH
-Making a Copy of a File
-.PP
-Sometimes what you want is a copy of a file _
-an entirely fresh version.
-This might be because you want to work on a file, and
-yet save a copy in case something gets fouled up,
-or just because you're paranoid.
-.PP
-In any case, the way to do it is with the
-.UL cp
-command.
-.UL cp \& (
-stands for `copy';
-the
-.UC UNIX
-system
-is big on short command names,
-which are appreciated by heavy users,
-but sometimes a strain for novices.)
-Suppose you have a file called
-`good'
-and
-you want to save a copy before you make some
-dramatic editing changes.
-Choose a name _
-`savegood'
-might be acceptable _ then type
-.P1
-cp  good  savegood
-.P2
-This copies
-`good'
-onto
-`savegood',
-and you now have two identical copies of the file
-`good'.
-(If
-`savegood'
-previously contained something,
-it gets overwritten.)
-.PP
-Now if you decide at some time that you want to get
-back to the original state of
-`good',
-you can say
-.P1
-mv  savegood  good
-.P2
-(if you're not interested in
-`savegood'
-any more), or
-.P1
-cp  savegood  good
-.P2
-if you still want to retain a safe copy.
-.PP
-In summary, 
-.UL mv
-just renames a file;
-.UL cp
-makes a duplicate copy.
-Both of them clobber the `target' file
-if it already exists, so you had better
-be sure that's what you want to do
-.ul
-before
-you do it.
-.SH
-Removing a File
-.PP
-If you decide you are really done with a file
-forever, you can remove it
-with the
-.UL rm
-command:
-.P1
-rm  savegood
-.P2
-throws away (irrevocably) the file called
-`savegood'.
-.SH
-Putting Two or More Files Together
-.PP
-The next step is the familiar one of collecting two or more
-files into one big one.
-This will be needed, for example,
-when the author of a paper
-decides that several sections need to be combined
-into one.
-There are several ways to do it,
-of which the cleanest, once you get used to it,
-is a program called
-.UL cat .
-(Not 
-.ul
-all
-.UC UNIX 
-programs have two-letter names.)
-.UL cat
-is short for
-`concatenate', which is exactly
-what we want to do.
-.PP
-Suppose the job is to combine the files
-`file1'
-and
-`file2'
-into a single file called
-`bigfile'.
-If you say
-.P1
-cat  file
-.P2
-the contents of
-`file'
-will get printed on your terminal.
-If you say
-.P1
-cat  file1  file2
-.P2
-the contents of
-`file1'
-and then the contents of
-`file2'
-will
-.ul
-both
-be printed on your terminal,
-in that order.
-So
-.UL cat
-combines the files, all right,
-but it's not much help to print them on the terminal _
-we want them in 
-`bigfile'.
-.PP
-Fortunately, there is a way.
-You can tell
-the system
-that instead of printing on your terminal,
-you want the same information put in a file. 
-The way to do it is to add to the command line
-the character
-.UL >
-and the name of the file
-where you want the output to go.
-Then you can say
-.P1
-cat  file1  file2  >bigfile
-.P2
-and the job is done.
-(As with
-.UL cp
-and
-.UL mv ,
-you're putting something into
-`bigfile',
-and anything that was already there is destroyed.)
-.PP
-This ability to
-`capture' the output of a program
-is one of the most useful aspects of
-the 
-.UC UNIX
-system.
-Fortunately it's not limited to the
-.UL cat 
-program _
-you can use it with 
-.ul
-any
-program that prints on your terminal.
-We'll see some more uses for it in a moment.
-.PP
-Naturally, you can combine several files,
-not just two:
-.P1
-cat  file1  file2  file3  ...  >bigfile
-.P2
-collects a whole bunch.
-.PP
-Question:
-is there any difference between
-.P1
-cp  good  savegood
-.P2
-and
-.P1
-cat  good  >savegood
-.P2
-Answer: for most purposes, no.
-You might reasonably ask why there are two programs
-in that case,
-since
-.UL cat
-is obviously all you need.
-The answer is that 
-.UL cp
-will do some other things as well,
-which you can investigate for yourself
-by reading the manual.
-For now we'll stick to simple usages.
-.SH
-Adding Something to the End of a File
-.PP
-Sometimes you want to add one file to the end of another.
-We have enough building blocks now that you can do it;
-in fact before reading further it would be valuable
-if you figured out how.
-To be specific,
-how would you use
-.UL cp ,
-.UL mv
-and/or
-.UL cat
-to add the file
-`good1'
-to the end of the file
-`good'?
-.PP
-You could try
-.P1
-cat  good  good1  >temp
-mv  temp  good
-.P2
-which is probably most direct.
-You should also understand why
-.P1
-cat  good  good1  >good
-.P2
-doesn't work.
-(Don't practice with a good `good'!)
-.PP
-The easy way is to use a variant of
-.UL > ,
-called
-.UL >> .
-In fact,
-.UL >> 
-is identical to
-.UL >
-except that instead of clobbering the old file,
-it simply tacks stuff on at the end.
-Thus you could say
-.P1
-cat  good1  >>good
-.P2
-and
-`good1'
-is added to the end of
-`good'.
-(And if
-`good'
-didn't exist,
-this makes a copy of
-`good1'
-called
-`good'.)
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae6 b/.ref-Research-V7/usr/doc/adv.ed/ae6
deleted file mode 100644 (file)
index 4903747..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-.NH
-CUT AND PASTE WITH THE EDITOR
-.PP
-Now we move on to manipulating pieces of files _
-individual lines or groups of lines.
-This is another area where new users seem
-unsure of themselves.
-.SH
-Filenames
-.PP
-The first step is to ensure that you know the
-.UL ed
-commands for reading and writing files.
-Of course you can't go very far without knowing
-.UL r
-and
-.UL w .
-Equally useful, but less well known, is the `edit' command
-.UL e .
-Within
-.UL ed ,
-the command
-.P1
-e  newfile
-.P2
-says `I want to edit a new file called
-.ul
-newfile,
-without leaving the editor.'
-The
-.UL e
-command discards whatever you're currently working on
-and starts over on 
-.ul
-newfile.
-It's exactly the same as if you had quit with the
-.UL q
-command, then re-entered
-.UL ed
-with a new file name,
-except that if you have a pattern remembered, then a command
-like
-.UL //
-will still work.
-.PP
-If you enter
-.UL ed
-with the command
-.P1
-ed  file
-.P2
-.UL ed 
-remembers the name of the file,
-and any subsequent
-.UL e ,
-.UL r
-or
-.UL w
-commands that don't contain a filename
-will refer to this remembered file.
-Thus
-.P1 2
-.ta .5i .6i .7i
-ed  file1
- ... (editing) ...
-w      (writes back in file1)
-e  file2       (edit new file, without leaving editor)
- ... (editing on file2) ...
-w      (writes back on file2)
-.P2
-(and so on) does a series of edits on various files
-without ever leaving
-.UL ed
-and without typing the name of any file more than once.
-(As an aside, if you examine the sequence of commands here,
-you can see why many
-UNIX
-systems use
-.UL e
-as a synonym
-for
-.UL ed .)
-.PP
-You can find out the remembered file name at any time
-with the
-.UL f
-command;
-just type
-.UL f
-without a file name.
-You can also change the name of the remembered file name with
-.UL f ;
-a useful sequence is
-.P1
-ed  precious
-f  junk
- ... (editing) ...
-.P2
-which gets a copy of a precious file,
-then uses
-.UL f
-to guarantee that a careless 
-.UL w
-command won't clobber the original.
-.SH
-Inserting One File into Another
-.PP
-Suppose you have a file called
-`memo',
-and you want the file called
-`table'
-to be inserted just after the reference to
-Table 1.
-That is, in
-`memo'
-somewhere is a line that says
-.IP
-Table 1 shows that ...
-.LP
-and the data contained in
-`table'
-has to go there,
-probably so it will be formatted
-properly by
-.UL nroff
-or
-.UL troff .
-Now what?
-.PP
-This one is easy.
-Edit
-`memo',
-find
-`Table 1',
-and add the file
-`table'
-right there:
-.P1
-ed  memo
-/Table 1/
-.ft I
-Table 1 shows that ... [response from ed]
-.ft
-\&\*.r  table
-.P2
-The critical line is the last one.
-As we said earlier, the
-.UL r
-command reads a file;
-here you asked for it to be read in right after
-line dot.
-An
-.UL r
-command without any address
-adds lines at the end,
-so it is the same as
-.UL $r .
-.SH
-Writing out Part of a File
-.PP
-The other side of the coin is writing out part of
-the document you're editing.
-For example, maybe
-you want to split out into a separate file
-that table from the previous example,
-so it can be formatted and tested separately.
-Suppose that in the file being edited 
-we have
-.P1
-\&\*.TS
- ...[lots of stuff]
-\&\*.TE
-.P2
-which is the way a table is set up for the
-.UL tbl
-program.
-To isolate
-the table
-in a separate file called
-`table',
-first find the start of the table
-(the `.TS' line), then write out the interesting part:
-.P1
-/^\*e\*.TS/
-.ft I
-\&\*.TS  [ed prints the line it found]
-.ft R
-\&\*.,/^\*e\*.TE/w table
-.P2
-and the job is done.
-If you are confident, you can do it all at once with
-.P1
-/^\*e\*.TS/;/^\*e\*.TE/w table
-.P2
-.PP
-The point is that the
-.UL w
-command can
-write out a group of lines, instead of the whole file.
-In fact, you can write out a single line if you like;
-just give one line number instead of two.
-For example, if you have just typed a horribly complicated line
-and you know that it (or something like it) is going to be needed later,
-then save it _ don't re-type it.
-In the editor, say
-.P1
-a
-\&...lots of stuff...
-\&...horrible line...
-\&\*.
-\&\*.w  temp
-a
-\&\*.\*.\*.more stuff\*.\*.\*.
-\&\*.
-\&\*.r temp
-a
-\&\*.\*.\*.more stuff\*.\*.\*.
-\&\*.
-.P2
-This last example is worth studying, to be sure you appreciate
-what's going on.
-.SH
-Moving Lines Around
-.PP
-Suppose you want to 
-move a paragraph from its present position in a paper
-to the end.
-How would you do it?
-As a concrete example, suppose each paragraph in the paper
-begins with the formatting command
-`.PP'.
-Think about it and write down the details before reading on.
-.PP
-The brute force way
-(not necessarily bad)
-is to write the paragraph onto a temporary file,
-delete it from its current position,
-then read in the temporary file at the end.
-Assuming that you are sitting on the 
-`.PP' command that begins
-the paragraph, this is the sequence of commands:
-.P1
-\&\*.,/^\*e\*.PP/-w temp
-\&\*.,//-d
-$r temp
-.P2
-That is, from where you are now
-(`\*.')
-until one line before the next `\*.PP'
-(`/^\*e\*.PP/\-')
-write onto
-`temp'.
-Then delete the same lines.
-Finally, read
-`temp'
-at the end.
-.PP
-As we said, that's the brute force way.
-The easier way (often)
-is to use the
-.ul
-move
-command
-.UL m
-that 
-.UL ed
-provides _
-it lets you do the whole set of operations
-at one crack,
-without any temporary file.
-.PP
-The 
-.UL m
-command
-is like many other
-.UL ed
-commands in that it takes up to two line numbers in front
-that tell what lines are to be affected.
-It is also
-.ul
-followed
-by a line number that tells where the lines are to go.
-Thus
-.P1
-line1, line2 m line3
-.P2
-says to move all the lines between
-`line1'
-and
-`line2'
-after
-`line3'.
-Naturally, any of
-`line1'
-etc., can be patterns between slashes,
-$
-signs, or other ways to specify lines.
-.PP
-Suppose again that you're sitting at the first line of the
-paragraph.
-Then you can say
-.P1
-\&\*.,/^\*e\*.PP/-m$
-.P2
-That's all.
-.PP
-As another example of a frequent operation,
-you can reverse the order of two adjacent lines
-by moving the first one
-to after the second.
-Suppose that you are positioned at the first.
-Then
-.P1
-m+
-.P2
-does it.
-It says to move line dot to after one line after line dot.
-If you are positioned on the second line,
-.P1
-m--
-.P2
-does the interchange.
-.PP
-As you can see, the
-.UL m
-command is more succinct and direct than
-writing, deleting and re-reading.
-When is brute force better anyway?
-This is a matter of personal taste _
-do what you have most confidence in.
-The main difficulty with the
-.UL m
-command
-is that if you use patterns to specify both the lines
-you are moving and the target,
-you have to take care that you specify them properly,
-or you may well not move the lines you thought you did.
-The result of a botched
-.UL m
-command can be a ghastly mess.
-Doing the job a step at a time
-makes it easier for you to verify at each step
-that you accomplished what you wanted to.
-It's also a good idea to issue a 
-.UL w
-command
-before doing anything complicated;
-then if you goof, it's easy to back up
-to where you were.
-.SH
-Marks
-.PP
-.UL ed
-provides a facility for marking a line
-with a particular name so you can later reference it
-by name
-regardless of its actual line number.
-This can be handy for moving lines,
-and for keeping track of them as they move.
-The
-.ul
-mark
-command is
-.UL k ;
-the command
-.P1
-kx
-.P2
-marks the current line with the name `x'.
-If a line number precedes the
-.UL k ,
-that line is marked.
-(The mark name must be a single lower case letter.)
-Now you can refer to the marked line with the address
-.P1
-\(fmx
-.P2
-.PP
-Marks are most useful for moving things around.
-Find the first line of the block to be moved, and mark it
-with
-.ul
-\(fma.
-Then find the last line and mark it with
-.ul
-\(fmb.
-Now position yourself at the place where the stuff is to go
-and say
-.P1
-\(fma,\(fmbm\*.
-.P2
-.PP
-Bear in mind that only one line can have a particular
-mark name associated with it
-at any given time.
-.SH
-Copying Lines
-.PP
-We mentioned earlier the idea of saving a line
-that was hard to type or used often,
-so as to cut down on typing time.
-Of course this could be more than one line;
-then the saving is presumably even greater.
-.PP
-.UL ed
-provides another command,
-called
-.UL t
-(for `transfer')
-for making a copy of a group of one or more lines
-at any point.
-This is often easier than writing and reading.
-.PP
-The 
-.UL t
-command is identical to the
-.UL m
-command, except that instead of moving lines
-it simply duplicates them at the place you named.
-Thus
-.P1
-1,$t$
-.P2
-duplicates the entire contents that you are editing.
-A more common use for
-.UL t
-is for creating a series of lines that differ only slightly.
-For example, you can say
-.P1
-.ta 1i
-a
-\&..........  x  ......... (long line)
-\&\*.
-t\*.   (make a copy)
-s/x/y/ (change it a bit)
-t\*.   (make third copy)
-s/y/z/ (change it a bit)
-.P2
-and so on.
-.SH
-The Temporary Escape `!'
-.PP
-Sometimes it is convenient to be able
-to temporarily escape from the editor to do
-some other
-.UX
-command,
-perhaps one of the file copy or move commands
-discussed in section 5,
-without leaving the editor.
-The `escape' command 
-.UL !
-provides a way to do this.
-.PP
-If you say
-.P1
-!any UNIX command
-.P2
-your current editing state is suspended,
-and the
-.UX
-command you asked for is executed.
-When the command finishes,
-.UL ed
-will signal you by printing another
-.UL ! ;
-at that point you can resume editing.
-.PP
-You can really do
-.ul
-any
-.UX
-command, including another 
-.UL ed .
-(This is quite common, in fact.)
-In this case, you can even do another
-.UL ! .
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae7 b/.ref-Research-V7/usr/doc/adv.ed/ae7
deleted file mode 100644 (file)
index 7229a2a..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-.NH
-SUPPORTING TOOLS
-.PP
-There are several tools and techniques that go along with the
-editor, all of which are relatively easy once you
-know how
-.UL ed
-works,
-because they are all based on the editor.
-In this section we will give some fairly cursory examples
-of these tools,
-more to indicate their existence than to provide
-a complete tutorial.
-More information on each can be found in
-[3].
-.SH
-Grep
-.PP
-Sometimes you want to find all occurrences of some word or pattern in
-a set of files, to edit them
-or perhaps just to verify their presence or absence.
-It may be possible to edit each file separately and look
-for the pattern of interest, but if there are many files
-this can get very tedious,
-and if the files are really big,
-it may be impossible because of limits in 
-.UL ed .
-.PP
-The program
-.UL grep
-was invented to get around these limitations.
-The search patterns that we have described in the paper are often
-called `regular expressions', and
-`grep' stands for
-.P1
-g/re/p
-.P2
-That describes exactly what
-.UL grep
-does _
-it prints every line in a set of files that contains a
-particular pattern.
-Thus
-.P1
-grep  \(fmthing\(fm  file1  file2  file3  ...
-.P2
-finds `thing' wherever it occurs in any of the files
-`file1',
-`file2',
-etc.
-.UL grep
-also indicates the file in which the line was found,
-so you can later edit it if you like.
-.PP
-The pattern represented by `thing' can be any
-pattern you can use in the editor,
-since
-.UL grep
-and
-.UL ed
-use exactly the same mechanism for
-pattern searching.
-It is wisest always to enclose the pattern in the
-single quotes \(fm...\(fm if it contains any non-alphabetic
-characters, since many such characters also mean something
-special to the
-.UX
-command interpreter
-(the `shell').
-If you don't quote them, the command interpreter will
-try to interpret them before
-.UL grep
-gets a chance.
-.PP
-There is also a way to find lines that
-.ul
-don't 
-contain a pattern:
-.P1
-grep  -v  \(fmthing\(fm  file1  file2  ...
-.P2
-finds all lines that
-don't contains `thing'.
-The
-.UL \-v
-must occur in the position shown.
-Given
-.UL grep
-and
-.UL grep\ \-v ,
-it is possible to do things like selecting all lines that
-contain some combination of patterns.
-For example, to get all lines that contain `x' but not `y':
-.P1
-grep  x  file...  |  grep  -v  y
-.P2
-(The notation | is a `pipe',
-which causes the output of the first command to be used as
-input to the second command; see [2].)
-.SH
-Editing Scripts
-.PP
-If a fairly complicated set of editing operations 
-is to be done on a whole set of files,
-the easiest thing to do is to make up a `script',
-i.e., a file that contains the operations you want to perform,
-then apply this script to each file in turn.
-.PP
-For example, suppose you want to change every
-`Unix' to `UNIX' and every `Gcos' to `GCOS' in a large number of files.
-Then put into the file `script' the lines
-.P1
-g/Unix/s//UNIX/g
-g/Gcos/s//GCOS/g
-w
-q
-.P2
-Now you can say
-.P1
-ed file1 <script
-ed file2 <script
-\&...
-.P2
-This causes
-.UL ed
-to take its commands from the prepared script.
-Notice that the whole job has to be planned in advance.
-.PP
-And of course by using the
-.UX
-command interpreter, you can
-cycle through a set of files
-automatically, with varying degrees of ease.
-.SH
-Sed
-.PP
-.UL sed
-(`stream editor')
-is a version of the editor with restricted capabilities
-but which is capable of processing unlimited amounts of input.
-Basically
-.UL sed
-copies its input to its output, applying one or more
-editing commands to each line of input.
-.PP
-As an example, suppose that we want to do the `Unix' to `UNIX'
-part of the
-example given above,
-but without rewriting the files.
-Then the command
-.P1
-sed  \(fms/Unix/UNIX/g\(fm  file1  file2  ...
-.P2
-applies the command
-`s/Unix/UNIX/g'
-to all lines from `file1', `file2', etc.,
-and copies all lines to the output.
-The advantage of using
-.UL sed
-in such a case is that it can be used
-with input too large for
-.UL ed
-to handle.
-All the output can be collected in one place,
-either in a file or perhaps piped into another program.
-.PP
-If the editing transformation is so complicated
-that
-more than one editing command is needed,
-commands can be supplied from a file,
-or on the command line,
-with a slightly more complex syntax.
-To take commands from a file, for example,
-.P1
-sed  -f  cmdfile  input-files...
-.P2
-.PP
-.UL sed
-has further capabilities, including conditional testing
-and branching, which we cannot go into here.
diff --git a/.ref-Research-V7/usr/doc/adv.ed/ae9 b/.ref-Research-V7/usr/doc/adv.ed/ae9
deleted file mode 100644 (file)
index a5e9c9f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-.SH
-Acknowledgement
-.PP
-I am grateful to Ted Dolotta
-for his careful reading and valuable suggestions.
-.SH
-References
-.IP [1]
-Brian W. Kernighan,
-.ul
-A Tutorial Introduction to the UNIX Text Editor,
-Bell Laboratories internal memorandum.
-.IP [2]
-Brian W. Kernighan,
-.ul
-UNIX For Beginners,
-Bell Laboratories internal memorandum.
-.IP [3]
-Ken L. Thompson and Dennis M. Ritchie,
-.ul
-The UNIX Programmer's Manual.
-Bell Laboratories.
diff --git a/.ref-Research-V7/usr/doc/assembler b/.ref-Research-V7/usr/doc/assembler
deleted file mode 100644 (file)
index d9840ee..0000000
+++ /dev/null
@@ -1,1009 +0,0 @@
-.\"tbl ... ^ [tn]roff -ms
-.hc %
-.TL
-Assembler Reference Manual
-.AU
-Dennis M. Ritchie
-.AI
-.MH
-.SH
-0.  Introduction
-.PP
-This document describes the usage and input syntax
-of the \s8UNIX PDP\s10-11 assembler \fIas\fP.
-The details
-of the \s8PDP\s10-11 are not described.
-.PP
-The input syntax of the \s8UNIX\s10 assembler is generally
-similar to that of the \s8DEC\s10 assembler \s8PAL\s10-11\s8R\s10, although
-its internal workings and output format
-are unrelated.
-It may be useful to read the publication \s8DEC\s10-11-\s8ASDB\s10-\s8D\s10,
-which describes \s8PAL\s10-11\s8R\s10, although naturally
-one must use care in assuming that its rules apply
-to \fIas\fP.
-.PP
-\fIAs\fP is a rather ordinary assembler without
-macro capabilities.
-It produces an output file that contains
-relocation information and a complete
-symbol table;
-thus the output is acceptable to the \s8UNIX\s10 link-editor
-\fIld\fP, which
-may be used to combine the outputs of several
-assembler runs and to obtain
-object programs from libraries.
-The output format has been designed
-so that if a program contains no unresolved
-ref%er%ences to external symbols, it is executable
-without further processing.
-.SH
-1.  Usage
-.PP
-\fIas\fP is used as follows:
-.DS
-as \fR[\fB \-u \fR] [ \fB\-o \fIoutput\fR ] \fIfile\s6\d1\u\s10 .\|.\|.
-.DE
-If the optional ``\-u'' argument is
-given, all undefined symbols
-in the current assembly will be made undefined-external.
-See the \fB.globl\fR directive below.
-.PP
-The other arguments name files
-which are concatenated and assembled.
-Thus programs may be written in several
-pieces and assembled together.
-.PP
-The output of the assembler is by default placed on
-the file \fIa.out\fR in the current directory;
-the ``\-o'' flag causes the output to be placed on the named file.
-If there were no unresolved
-external ref%er%ences, and no errors detected,
-the output file is marked executable; otherwise, if it is
-produced at all, it is made non-executable.
-.SH
-2.  Lexical conventions
-.PP
-Assembler tokens include identifiers (alternatively, ``symbols'' or ``names''),
-temporary symbols,
-constants, and operators.
-.SH
-2.1  Identifiers
-.PP
-An identifier consists of a sequence of alphanumeric characters (including
-period ``\|\fB.\fR\|'', underscore ``\(ul'',
-and tilde ``~''
-as alphanumeric)
-of which the first may not
-be numeric.
-Only the first eight characters are significant.
-When a name begins with a tilde, the tilde is discarded
-and that occurrence of the identifier generates
-a unique entry in the symbol table which can match
-no other occurrence of the identifier.
-This feature is used
-by the C compiler to place names of local variables
-in the output symbol table
-without having to worry
-about 
-making them unique.
-.SH
-2.2  Temporary symbols
-.PP
-A temporary symbol consists of a digit followed by ``f\|'' or
-``b''.
-Temporary symbols are discussed fully in \(sc5.1.
-.SH
-2.3  Constants
-.PP
-An octal constant consists of a sequence of digits; ``8'' and
-``9'' are taken to have octal value 10 and 11.
-The constant
-is truncated to 16 bits and interpreted in two's complement
-notation.
-.PP
-A decimal constant consists of a sequence of digits terminated
-by a decimal point ``\fB.\fR''.  The magnitude of the constant should be
-representable in 15 bits; i.e., be less than 32,768.
-.PP
-A single-character constant consists of a single quote ``\|\(fm\|''
-followed by an \s8ASCII\s10 character not a new-line.
-Certain dual-character escape sequences
-are acceptable in place of the \s8ASCII\s10 character to represent
-new-line and other non-graphics (see \fIString state%ments\fP, \(sc5.5).
-The constant's value has the code for the
-given character in the least significant
-byte of the word and is null-padded on the left.
-.PP
-A double-character constant consists of a double
-quote ``\|"\|'' followed by a pair of \s8ASCII\s10 characters
-not including new-line.
-Certain dual-character escape sequences are acceptable
-in place of either of the \s8ASCII\s10 characters
-to represent new-line and other non-graphics
-(see \fIString state%ments\fR, \(sc5.5).
-The constant's value has the code for the first
-given character in the least significant
-byte and that for the second character in
-the most significant byte.
-.SH
-2.4  Operators
-.PP
-There are several single- and double-character
-operators; see \(sc6.
-.SH
-2.5  Blanks
-.PP
-Blank and tab characters
-may be interspersed freely between tokens, but may
-not be used within tokens (except character constants).
-A blank or tab is required to separate adjacent
-identifiers or constants not otherwise separated.
-.SH
-2.6  Comments
-.PP
-The character ``\|/\|'' introduces a comment, which extends
-through the end of the line on which it appears.
-Comments are ignored by the assembler.
-.SH
-3.  Segments
-.PP
-Assembled code and data
-fall into three segments: the text segment, the data segment, and the bss segment.
-The text segment is the one in which the assembler begins,
-and it is the one into which instructions are typically placed.
-The \s8UNIX\s10 system will, if desired,
-enforce the purity of the text segment of programs by
-trapping write operations
-into it.
-Object programs produced by the assembler must be processed
-by the link-editor \fIld\fR
-(using its ``\-n'' flag)
-if the text segment is to be write-protected.
-A single copy of the text
-segment is shared among all processes
-executing such a program.
-.PP
-The data segment is available for placing
-data or instructions which
-will be modified during execution.
-Anything which may go in the text segment may be put
-into the data segment.
-In programs with write-protected, sharable text segments,
-data segment contains the initialized but variable
-parts of a program.
-If the text segment is not pure, the data segment begins
-immediately after the
-text segment;
-if the text segment is pure, the data segment begins at the lowest
-8K byte boundary after the text segment.
-.PP
-The bss segment may not contain any explicitly initialized code
-or data.
-The length of the bss segment (like that of text or data)
-is determined by the high-water mark of the location counter
-within it.
-The bss segment is actually an extension of
-the data segment and begins immediately after it.
-At the start of execution of a program, the bss segment
-is set to 0.
-Typically the bss segment is set up
-by state%ments exemplified by
-.DS
-lab\fB: .\fR = \fB.\fR+10
-.DE
-The advantage in using the bss segment
-for storage that starts off empty is that the initialization
-information need not be stored in the output file.
-See also \fILocation counter\fP and \fIAssignment state%ments\fP
-below.
-.SH
-4.  The location counter
-.PP
-One special symbol, ``\|\fB.\fP\|'', is the location counter.
-Its value at any time is the offset
-within the appropriate segment of the start of
-the state%ment in which it appears.
-The location counter may be assigned to,
-with the restriction that the
-current segment may not change;
-furthermore,
-the value of ``\|\fB.\fP\|'' may not decrease.
-If the effect of the assignment is to increase the value of ``\|\fB.\fP\|'',
-the required number of null bytes are generated
-(but see \fISegments\fP above).
-.SH
-5.  Statements
-.PP
-A source program is composed of a sequence of
-\fIstate%ments\fP.
-Statements are separated either by new-lines
-or by semicolons.
-There are five kinds of state%ments: null state%ments,
-expression state%ments, assignment state%ments,
-string state%ments,
-and keyword state%ments.
-.PP
-Any kind of state%ment may be preceded by
-one or more labels.
-.SH
-5.1  Labels
-.PP
-There are two kinds of label:
-name labels and numeric labels.
-A name label consists of a name followed
-by a colon (\|:\|).
-The effect of a name label is to assign the current
-value and type of the location counter ``\|\fB.\fP\|''
-to the name.
-An error is indicated in pass 1 if the
-name is already defined;
-an error is indicated in pass 2 if the ``\|\fB.\fP\|''
-value assigned changes the definition
-of the label.
-.PP
-A numeric label consists of a digit \fI0\fR to \fI9\fR followed by a colon (\|:\|).
-Such a label serves to define temporary
-symbols of the form ``\fIn\fR\|b'' and ``\fIn\fR\|f\|'', where \fIn\fR is
-the digit of the label.
-As in the case of name labels, a numeric label assigns
-the current value and type of ``\|\fB.\fP\|'' to the temporary
-symbol.
-However, several numeric labels with the same
-digit may be used within the same assembly.
-Ref%er%ences of the form ``\fIn\fR\|f\|'' refer to the first
-numeric label ``\fIn\|\fR:'' \fIf\fR\|orward from the ref%er%ence;
-``\fIn\|\fRb'' symbols refer to the first ``\fIn\|\fR\|:'' label
-\fIb\|\fRackward from the ref%er%ence.
-This sort of temporary label was introduced by Knuth
-[\fIThe Art of Computer Programming, Vol I: Fundamental Algorithms\|\fR].
-Such labels tend to conserve both the symbol table
-space of the assembler and the
-inventive powers of the programmer.
-.SH
-5.2  Null state%ments
-.PP
-A null state%ment is an empty state%ment (which may, however,
-have labels).
-A null state%ment is ignored by the assembler.
-Common examples of null state%ments are empty
-lines or lines containing only a label.
-.SH
-5.3  Expression state%ments
-.PP
-An expression state%ment consists of an arithmetic
-expression not beginning with
-a keyword.
-The assembler computes its (16-bit) value
-and places it in the output stream, together with the
-appropriate relocation bits.
-.SH
-5.4  Assignment state%ments
-.PP
-An assignment state%ment consists of an identifier, an equals sign (\|=\|),
-and an expression.
-The value and type of the expression are assigned to
-the identifier.
-It is not required that the type or value be
-the same in pass 2 as in pass 1, nor is it an
-error to redefine any symbol by assignment.
-.PP
-Any external attribute of the expression is lost across
-an assignment.
-This means that it is not possible to declare a global
-symbol by assigning to it, and that it is impossible
-to define a symbol to be offset from a non-locally
-defined global symbol.
-.PP
-As mentioned,
-it is permissible to assign to the
-location counter ``\|\fB.\fP\|''.
-It is required, however, that the type of
-the expression assigned be of the same type
-as ``\|\fB.\fP\|'',
-and it is forbidden to decrease the value
-of ``\fB\|.\|\fR''.
-In practice, the most common assignment to ``\|\fB.\fP\|'' has the form
-``.\|=\|.\|+\|\fIn\fR''
-for some number \fIn;\fR this has the effect of generating
-\fIn\fR null bytes.
-.SH
-5.5  String state%ments
-.PP
-A string state%ment generates a sequence of bytes containing \s8ASCII\s10 characters.
-A string state%ment consists of a left string quote ``<''
-followed by a sequence of \s8ASCII\s10 characters not including newline,
-followed by a right string quote ``>''.
-Any of the \s8ASCII\s10 characters may
-be replaced by a two-character escape sequence to represent
-certain non-graphic characters, as follows:
-.DS C
-.TS
-l l l.
-\en    \s8NL\s10       (012)
-\es    \s8SP\s10       (040)
-\et    \s8HT\s10       (011)
-\ee    \s8EOT\s10      (004)
-\e0    \s8NUL\s10      (000)
-\er    \s8CR\s10       (015)
-\ea    \s8ACK\s10      (006)
-\ep    \s8PFX\s10      (033)
-\e\e   \e
-\e>    >
-.TE
-.DE
-The last two are included so that the escape character
-and the right string quote may be represented.
-The same escape sequences
-may also be used within single- and double-character
-constants (see \(sc2.3 above).
-.SH
-5.6  Keyword state%ments
-.PP
-Keyword state%ments are numerically the most common type,
-since most machine instructions are of this
-sort.
-A keyword state%ment begins with one of the many predefined
-keywords of the assembler;
-the syntax of the remainder depends
-on the keyword.
-All the keywords are listed below with the syntax they require.
-.SH
-6.  Expressions
-.PP
-An expression is a sequence of symbols representing a value.
-Its constituents are identifiers, constants, temporary symbols,
-operators, and brackets.
-Each expression has a type.
-.PP
-All operators in expressions are fundamentally binary in
-nature; if an operand is missing on the left, a 0
-of absolute type is assumed.
-Arithmetic
-is two's complement and has 16 bits of precision.
-All operators have equal precedence, and expressions
-are evaluated
-strictly left to right except for the effect
-of brackets.
-.SH
-6.1  Expression operators
-.PP
-The operators are:
-.IP (blank) 8
-when there is no operand between
-operands, the effect is
-exactly the same as if a ``+'' had appeared.
-.pg
-.ti 0
-.IP + 8
-addition
-.IP \- 8
-subtraction
-.IP * 8
-multiplication
-.IP \e\(sl 8
-division (note that plain ``\|/\|'' starts a comment)
-.IP 8 & 8
-bitwise \fBand\fR
-.IP \(bv 8
-bitwise \fBor\fR
-.IP \e> 8
-logical right shift
-.IP \\e< 8
-logical left shift
-.hc
-.IP % 8
-modulo
-.IP ! 8
-.hc %
-\fIa\fR\|!\|\fIb\fR is \fIa \fBor \fR(\|\fBnot \fIb\fR\|);
-i.e., the \fBor\fR of the first operand and
-the one's complement of the second; most common use is
-as a unary.
-.IP ^ 8
-result has the value of first operand and the type of the second;
-most often used to define new machine instructions
-with syntax identical to existing instructions.
-.PP
-Expressions may be grouped by use of square brackets ``\|[\|\|]\|''.
-(Round parentheses are reserved for address modes.)
-.SH
-6.2  Types
-.PP
-The assembler deals with a number of types
-of expressions.  Most types
-are attached to keywords and used to select the
-routine which treats that keyword.  The types likely
-to be met explicitly are:
-.IP undefined 8
-.br
-Upon first encounter, each symbol is undefined.
-It may become undefined if it is assigned an undefined expression.
-It is an error to attempt to assemble an undefined
-expression in pass 2; in pass 1, it is not (except that
-certain keywords require operands which are not undefined).
-.IP "undefined external" 8
-.br
-A symbol which is declared \fB.globl\fR but not defined
-in the current assembly is an undefined
-external.
-If such a symbol is declared, the link editor \fIld\fR
-must be used to load the assembler's output with
-another routine that defines the undefined ref%er%ence.
-.IP absolute 8
-An absolute symbol is defined ultimately from a constant.
-Its value is unaffected by any possible future applications
-of the link-editor to the output file.
-.IP text 8
-The value of a text symbol is measured
-with respect to the beginning of the text segment of the program.
-If the assembler output is link-edited, its text
-symbols may change in value
-since the program need
-not be the first in the link editor's output.
-Most text symbols are defined by appearing as labels.
-At the start of an assembly, the value of ``\|\fB.\fP\|'' is text 0.
-.IP data 8
-The value of a data symbol is measured
-with respect to the origin of the data segment of a program.
-Like text symbols, the value of a data symbol may change
-during a subsequent link-editor run since previously
-loaded programs may have data segments.
-After the first \fB.data\fR state%ment, the value of ``\|\fB.\fP\|''
-is data 0.
-.IP bss 8
-The value of a bss symbol is measured from
-the beginning of the bss segment of a program.
-Like text and data symbols, the value of a bss symbol
-may change during a subsequent link-editor
-run, since previously loaded programs may have bss segments.
-After the first \fB.bss\fR state%ment, the value of ``\|\fB.\fP\|'' is bss 0.
-.IP "external absolute, text, data, or bss" 8
-.br
-symbols declared \fB.globl\fR
-but defined within an assembly as absolute, text, data, or bss
-symbols may be used exactly as if they were not
-declared \fB.globl\fR; however, their value and type are available
-to the link editor so that the program may be loaded with others
-that ref%er%ence these symbols.
-.IP register 8
-.br
-The symbols
-.DS
-\fBr0\fR  .\|.\|. \fBr5
-fr0\fR  .\|.\|. \fBfr5
-sp
-pc
-.DE
-are predefined
-as register symbols.
-Either they or symbols defined from them must
-be used to refer to the six general-purpose,
-six floating-point, and
-the 2 special-purpose machine registers.
-The behavior of the floating register names
-is identical to that of the corresponding
-general register names; the former
-are provided as a mnemonic aid.
-.IP "other types" 8
-.br
-Each keyword known to the assembler has a type which
-is used to select the routine which processes
-the associated keyword state%ment.
-The behavior of such symbols
-when not used as keywords is the same as if they were absolute.
-.SH
-6.3  Type propagation in expressions
-.PP
-When operands are combined by expression operators,
-the result has a type which depends on the types
-of the operands and on the operator.
-The rules involved are complex to state but
-were intended to be sensible and predictable.
-For purposes of expression evaluation the
-important types are
-.DS
-undefined
-absolute
-text
-data
-bss
-undefined external
-other
-.DE
-The combination rules are then:
-If one of the operands
-is undefined, the result is undefined.
-If both operands are absolute, the result is absolute.
-If an absolute is combined with one of the ``other types''
-mentioned above,
-or with a register expression, the result
-has the register or other type.
-As a consequence,
-one can refer to r3 as ``r0+3''.
-If two operands of ``other type'' are combined,
-the result has the
-numerically larger type
-An ``other type'' combined with an explicitly
-discussed type other than absolute
-acts like an absolute.
-.PP
-Further rules applying to particular operators
-are:
-.IP +
-If one operand is text-, data-, or bss-segment
-relocatable, or is an undefined external,
-the result has the postulated type and the other operand
-must be absolute.
-.IP \-
-If the first operand is a relocatable
-text-, data-, or bss-segment symbol, the second operand
-may be absolute (in which case the result has the
-type of the first operand);
-or the second operand may have the same type
-as the first (in which case the result is absolute).
-If the first operand is external undefined, the second must be
-absolute.
-All other combinations are illegal.
-.IP ^
-This operator follows no other rule than
-that the result has the value
-of the first operand and the type of the second.
-.PP
-.IP others
-.br
-It is illegal to apply these operators to any but absolute
-symbols.
-.SH
-7.  Pseudo-operations
-.PP
-The keywords listed below introduce
-state%ments that generate data in unusual forms or
-influence the later operations of the assembler.
-The metanotation
-.DS
-[ stuff ] .\|.\|.
-.DE
-means that 0 or more instances of the given stuff may appear.
-Also, boldface tokens are literals, italic words
-are substitutable.
-.SH
-7.1  \fB.byte  \fIexpression  \fR[  \fB, \fIexpression \fR]  .\|.\|.
-.PP
-The \fIexpression\fRs in the comma-separated
-list are truncated to 8 bits and assembled in successive
-bytes.
-The expressions must be absolute.
-This state%ment and the string state%ment above are the only ones
-that assemble data one byte at at time.
-.SH
-7.2  \fB.even\fR
-.PP
-If the location counter ``\|\fB.\fP\|'' is odd, it is advanced by one
-so the next state%ment will be assembled
-at a word boundary.
-.SH
-7.3  \fB.if  \fIexpression\fR
-.PP
-The \fIexpression\fR must be absolute and defined in pass 1.
-If its value is nonzero, the \fB.if\fR is ignored; if zero,
-the state%ments between the \fB.if\fR and the matching \fB.endif\fR
-(below) are ignored.
-\&\fB.if\fR may be nested.
-The effect of \fB.if\fR cannot extend beyond
-the end of the input file in which it appears.
-(The state%ments are not totally ignored, in
-the following
-sense: \fB.if\fRs and \fB.endif\fRs are scanned for, and
-moreover all names
-are entered in the symbol table.
-Thus names occurring only inside
-an \fB.if\fR
-will show up as undefined if the symbol
-table is listed.)
-.SH
-7.4  \fB.endif\fR
-.PP
-This state%ment marks the end of a conditionally-assembled section of code.
-See \fB.if\fR above.
-.SH
-7.5  \fB.globl  \fIname  \fR[  \fB,\fI  name  \fR]  .\|.\|.
-.PP
-This state%ment makes the \fInames\fR external.
-If they are otherwise defined (by assignment or
-appearance as a label)
-they act within the assembly exactly as if
-the \fB.globl\fR state%ment were not given; however,
-the link editor \fIld\fR may be used
-to combine this routine with other routines that refer
-these symbols.
-.PP
-Conversely, if the given symbols are not defined
-within the current assembly, the link editor
-can combine the output of this assembly
-with that of others which define the symbols.
-As discussed in \(sc1, it is possible to force
-the assembler to make all otherwise
-undefined symbols external.
-.SH
-7.6  \fB.text\fR
-.SH
-7.7  \fB.data\fR
-.SH
-7.8  \fB.bss\fR
-.PP
-These three pseudo-operations cause the
-assembler to begin assembling into the text, data, or
-bss segment respectively.
-Assembly starts in the text segment.
-It is forbidden to assemble any
-code or data into the bss segment, but symbols may
-be defined and ``\|\fB.\fP\|'' moved about by assignment.
-.SH
-7.9  \fB.comm\fI  name  \fB,  \fIexpression\fR
-.PP
-Provided the \fIname\fR is not defined elsewhere,
-this state%ment is equivalent to
-.DS
-\&.globl  name
-name = expression ^ name
-.DE
-That is, the type of \fIname\fR
-is ``undefined external'', and its value is \fIexpression\fR.
-In fact the \fIname\fR behaves
-in the current assembly just like an
-undefined external.
-However, the link-editor \fIld\fR has been special-cased
-so that all external symbols which are not
-otherwise defined, and which have a non-zero
-value, are defined to lie in the bss
-segment, and enough space is left after the
-symbol to hold \fIexpression\fR
-bytes.
-All symbols which become defined in this way
-are located before all the explicitly defined
-bss-segment locations.
-.SH
-8.   Machine instructions
-.PP
-Because of the rather complicated instruction and addressing
-structure of the \s8PDP\s10-11, the syntax of machine instruction
-state%ments is varied.
-Although the following sections give the syntax
-in detail, the machine handbooks should
-be consulted on the semantics.
-.SH
-8.1  Sources and Destinations
-.PP
-The syntax of general source and destination
-addresses is the same.
-Each must have one of the following forms,
-where \fIreg\fR is a register symbol, and \fIexpr\fR
-is any sort of expression:
-.DS C
-.TS
-c c c
-l l l.
-syntax words   mode
-_
-\fIreg\fR      0       00+\fIreg\fB
-(\|\fIreg\fB\|)\|+     \fR0    20+\fIreg\fB
-\fB\-\|(\|\fIreg\fB\|) \fR0    40+\fIreg\fR
-\fIexpr\|\fB(\|\fIreg\fB\|)    \fR1    60+\fIreg\fB
-(\|\fIreg\fB\|)        \fR0    10+\fIreg\fB
-*\|\fIreg\fB   \fR0    10+\fIreg\fB
-\fB*\|(\|\fIreg\fB\|)\|+       \fR0    30+\fIreg\fB
-\fB*\|\-\|(\|\fIreg\fB\|)      \fR0    50+\fIreg\fB
-*\|(\|\fIreg\fB\|)     \fR1    70+\fIreg\fB
-\fB*\|\fIexpr\fB\|(\|\fIreg\fB\|)      \fR1    70+\fIreg\fB
-\fIexpr        \fR1    67
-\fB$\|\fIexpr  \fR1    27
-\fB*\|\fIexpr  \fR1    77
-\fB*\|$\|\fIexpr       \fR1    37
-.TE
-.DE
-The \fIwords\fR column gives the number of address words generated;
-the \fImode\fR column gives the octal address-mode number.
-The syntax of the address forms is
-identical to that in \s8DEC\s10 assemblers, except that ``*'' has
-been substituted for ``@''
-and ``$'' for ``#''; the \s8UNIX\s10 typing conventions make ``@'' and ``#''
-rather inconvenient.
-.PP
-Notice that mode ``*reg'' is identical to ``(reg)'';
-that ``*(reg)'' generates an index word (namely, 0);
-and that addresses consisting of an unadorned expression
-are assembled as pc-relative ref%er%ences independent
-of the type of the expression.
-To force a non-relative ref%er%ence, the form ``*$expr'' can
-be used, but notice that further indirection is impossible.
-.SH
-8.3  Simple machine instructions
-.PP
-The following instructions
-are defined as absolute symbols:
-.KS
-.DS
-.ft B
-clc
-clv
-clz
-cln
-sec
-sev
-sez
-sen
-.DE
-.KE
-They therefore require
-no special syntax.
-The \s8PDP\s10-11 hardware allows more than one of the ``clear''
-class, or alternatively more than one of the ``set'' class
-to be \fBor\fR-ed together; this may be expressed as follows:
-.DS
-clc\|\|\|\(bv\|\|clv
-.DE
-.SH
-8.4  Branch
-.PP
-The following instructions take an expression as operand.
-The expression must lie in the same segment as the ref%er%ence,
-cannot be undefined-external,
-and its value cannot differ from the current location of ``\|\fB.\fP\|''
-by more than 254 bytes:
-.KS
-.DS
-.ft B
-.ta 1.5i 2.5i
-br     blos
-bne    bvc
-beq    bvs
-bge    bhis
-blt    bec     \fR(=\fB bcc\fR)\fB
-bgt    bcc
-ble    blo
-bpl    bcs
-bmi    bes     \fR(=\fB bcs\fR)\fB
-bhi
-.DE
-.KE
-\fBbes\fR (``branch on error set'')
-and \fBbec\fR (``branch on error clear'')
-are intended to test the error bit
-returned by system calls (which
-is the c-bit).
-.SH
-8.5   Extended branch instructions
-.PP
-The following symbols are followed by an expression
-representing an address
-in the same segment as ``\|\fB.\|\fP''.
-If the target address is close enough,
-a branch-type instruction is generated;
-if the address is too far away,
-a \fBjmp\fR will be used.
-.pg
-.KS
-.DS
-.ft B
-.ta 1.5i
-jbr    jlos
-jne    jvc
-jeq    jvs
-jge    jhis
-jlt    jec
-jgt    jcc
-jle    jlo
-jpl    jcs
-jmi    jes
-jhi
-.DE
-.KE
-\fBjbr\fR turns into a plain \fBjmp\fR
-if its target is too remote;
-the others (whose names are contructed
-by replacing the ``b'' in the branch instruction's
-name by ``j''\|)
-turn into the converse branch over a \fBjmp\fR
-to the target address.
-.SH
-8.6  Single operand instructions
-.PP
-The following
-symbols are names of single-operand
-machine instructions.
-The form
-of address expected is discussed in \(sc8.1 above.
-.KS
-.DS
-.ta 1.5i
-clr    sbcb
-clrb   ror
-com    rorb
-comb   rol
-inc    rolb
-incb   asr
-dec    asrb
-decb   asl
-neg    aslb
-negb   jmp
-adc    swab
-adcb   tst
-sbc    tstb
-.DE
-.KE
-.SH
-8.7  Double operand instructions
-.PP
-The following instructions take a general source
-and destination (\(sc8.1), separated by a comma, as operands.
-.KS
-.DS
-.ft B
-.ta 1.5i
-mov
-movb
-cmp
-cmpb
-bit
-bitb
-bic
-bicb
-bis
-bisb
-add
-sub
-.DE
-.KE
-.SH
-8.8  Miscellaneous instructions
-.PP
-The following instructions have
-more specialized syntax.
-Here \fIreg\fR is
-a register name, \fIsrc\fR and \fIdst\fR a general source
-or destination
-(\(sc8.1), and \fIexpr\fR is an expression:
-.KS
-.DS
-.ta .5i 2i
-\fBjsr\fI      reg,dst
-\fBrts\fI      reg
-\fBsys\fI      expr
-\fBash \fIsrc\|,\|reg  \fR(or, \fBals\fR)\fB
-\fBashc        \fIsrc\|,\|reg  \fR(or, \fBalsc\fR)\fB
-\fBmul \fIsrc\|,\|reg  \fR(or, \fBmpy\fR)\fB
-\fBdiv \fIsrc\|,\|reg  \fR(or, \fBdvd\fR)\fR
-\fBxor \fIreg\|,\|dst\fB
-\fBsxt \fIdst\fB
-\fBmark        \fIexpr\fB
-\fBsob \fIreg\|,\|expr\fB
-.DE
-.KE
-\fBsys\fR is another name for the \fBtrap\fR instruction.
-It is used to code system calls.
-Its operand is required to be expressible in 6 bits.
-The expression in \fBmark\fR must be expressible
-in six bits, and the expression in \fBsob\fR must
-be in the same segment as ``\fB\|.\|\fR'',
-must not be external-undefined, must be less than ``\|\fB.\fR\|'',
-and must be within 510 bytes of ``\|\fB.\fR\|''.
-.SH
-8.9  Floating-point unit instructions
-.PP
-The following floating-point operations are defined,
-with syntax as indicated:
-.KS
-.DS
-.ta .5i 2i
-\fBcfcc
-\fBsetf
-\fBsetd
-\fBseti
-\fBsetl
-\fBclrf        \fIfdst
-\fBnegf        \fIfdst
-\fBabsf        \fIfdst
-\fBtstf        \fIfsrc
-\fBmovf        \fIfsrc,\|freg  \fR(= ldf\fR\|)
-\fBmovf        \fIfreg,\|fdst  \fR(= stf\fR\|)
-\fBmovif       \fIsrc,\|freg   \fR(= ldcif\fR\|)
-\fBmovfi       \fIfreg,\|dst   \fR(= stcfi\fR\|)
-\fBmovof       \fIfsrc,\|freg  \fR(= ldcdf\fR\|)
-\fBmovfo       \fIfreg,\|fdst  \fR(= stcfd\fR\|)
-\fBmovie       \fIsrc,\|freg   \fR(= ldexp\fR)
-\fBmovei       \fIfreg,\|dst   \fR(= stexp\fR)
-\fBaddf        \fIfsrc,\|freg
-\fBsubf        \fIfsrc,\|freg
-\fBmulf        \fIfsrc,\|freg
-\fBdivf        \fIfsrc,\|freg
-\fBcmpf        \fIfsrc,\|freg
-\fBmodf        \fIfsrc,\|freg
-\fBldfps       \fIsrc
-\fBstfps       \fIdst
-\fBstst        \fIdst\fR
-.DE
-.KE
-\fIfsrc\fR, \fIfdst\fR, and \fIfreg\fR mean floating-point
-source, destination, and register respectively.
-Their syntax is identical to that for
-their non-floating counterparts, but
-note that only
-floating registers 0-3 can be a \fIfreg\fR.
-.PP
-The names of several of the operations
-have been changed to bring out an analogy with
-certain fixed-point instructions.
-The only strange case is \fBmovf\fR, which turns into
-either \fBstf\fR or \fBldf\fR
-depending respectively on whether its first operand is
-or is not a register.
-Warning:  \fBldf\fR sets the floating condition codes,
-\fBstf\fR does not.
-.SH
-9.  Other symbols
-.SH
-9.1  \fB.\|.\fR
-.PP
-The symbol ``\fB\|.\|.\|\fR''
-is the
-\fIrelocation counter\fR.
-Just before each assembled word is placed in the output stream,
-the current value of this symbol is added to the word
-if the word refers to a text, data or bss segment location.
-If the output word is a pc-relative address word
-that refers to an absolute location,
-the value of ``\fB\|.\|.\|\fR'' is subtracted.
-.PP
-Thus the value of ``\fB\|.\|.\|\fR'' can be taken to mean
-the starting memory location of the program.
-The initial value of ``\|\fB.\|.\fR\|'' is 0.
-.PP
-The value of ``\|\fB.\|.\fR\|'' may be changed by assignment.
-Such a course of action is sometimes
-necessary, but the consequences
-should be carefully thought out.
-It is particularly ticklish
-to change ``\|\fB.\|.\fR\|'' midway in an assembly
-or to do so in a program which will
-be treated by the loader, which has
-its own notions of ``\|\fB.\|.\fR\|''.
-.SH
-9.2  System calls
-.PP
-System call names are not predefined.
-They may be found in the file
-.I /usr/include/sys.s
-.SH
-10.  Diagnostics
-.PP
-When
-an input file cannot be read, its name
-followed by a question mark is typed and assembly
-ceases.
-When syntactic or semantic errors occur, a single-character diagnostic is typed out
-together with the line number and the file name in which it
-occurred.  Errors in pass 1 cause cancellation of pass 2.
-The possible errors are:
-.KS
-.DS
-.ta .3i
-)       parentheses error
-]       parentheses error
->       string not terminated properly
-*       indirection (\|*\|) used illegally
-\&\fB.\fR       illegal assignment to ``\|\fB.\fR\|''
-\s8A\s10        error in address
-\s8B\s10        branch address is odd or too remote
-\s8E\s10        error in expression
-\s8F\s10        error in local (``f\|'' or ``b'') type symbol
-\s8G\s10        garbage (unknown) character
-\s8I\s10        end of file inside an \fB.if\fR
-\s8M\s10        multiply defined symbol as label
-\s8O\s10        word quantity assembled at odd address
-\s8P\s10        phase error\(em ``\|\fB.\fP\|'' different in pass 1 and 2
-\s8R\s10        relocation error
-\s8U\s10        undefined symbol
-\s8X\s10        syntax error
-.DE
-.KE
diff --git a/.ref-Research-V7/usr/doc/awk b/.ref-Research-V7/usr/doc/awk
deleted file mode 100644 (file)
index 758da7d..0000000
+++ /dev/null
@@ -1,1401 +0,0 @@
-.fp 3 G
-....TM "78-1271-12, 78-1273-6" 39199 39199-11
-.ND "September 1, 1978"
-....TR 68
-.RP
-.      \" macros here
-.tr _\(em
-.if t .tr ~\(ap
-.tr |\(or
-.tr *\(**
-.de UC
-\&\\$3\s-1\\$1\\s0\&\\$2
-..
-.de IT
-.if n .ul
-\&\\$3\f2\\$1\fP\|\\$2
-..
-.de UL
-.if n .ul
-\&\\$3\f3\\$1\fP\&\\$2
-..
-.de P1
-.DS I 3n
-.nf
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ta .3i .6i .9i 1.2i
-.if t .tr -\-'\(fm*\(**
-.if t .tr _\(ul
-.ft 3
-.lg 0
-.ss 18
-.              \"use first argument as indent if present
-..
-.de P2
-.ps \\n(PS
-.vs \\n(VSp
-.ft R
-.ss 12
-.if n .ls 2
-.tr --''``^^!!
-.if t .tr _\(em
-.fi
-.lg
-.DE
-..
-.hw semi-colon
-.hy 14
-.              \"2=not last lines; 4= no -xx; 8=no xx-
-.              \"special chars in programs
-.de WS
-.sp \\$1
-..
-.      \" end of macros
-.TL
-Awk \(em A Pattern Scanning and Processing Language
-.br
-(Second Edition)
-.AU "MH 2C-522" 4862
-Alfred V. Aho
-.AU "MH 2C-518" 6021
-Brian W. Kernighan
-.AU "MH 2C-514" 7214
-Peter J. Weinberger
-.AI
-.MH
-.AB
-.IT Awk
-is a programming language whose
-basic operation
-is to search a set of files
-for patterns, and to perform specified actions upon lines or fields of lines which
-contain instances of those patterns.
-.IT Awk
-makes certain data selection and transformation operations easy to express;
-for example, the
-.IT awk
-program
-.sp
-.ce
-.ft 3
-length > 72
-.ft
-.sp
-prints all input lines whose length exceeds 72 characters;
-the program
-.ce
-.sp
-.ft 3
-NF % 2 == 0
-.ft R
-.sp
-prints all lines with an even number of fields;
-and the program
-.ce
-.sp
-.ft 3
-{ $1 = log($1); print }
-.ft R
-.sp
-replaces the first field of each line by its logarithm.
-.PP
-.IT Awk
-patterns may include arbitrary boolean combinations of regular expressions
-and of relational operators on strings, numbers, fields, variables, and array elements.
-Actions may include the same pattern-matching constructions as in patterns,
-as well as
-arithmetic and string expressions and assignments,
-.UL if-else ,
-.UL while ,
-.UL for
-statements,
-and multiple output streams.
-.PP
-This report contains a user's guide, a discussion of the design and implementation of
-.IT awk ,
-and some timing statistics.
-....It supersedes TM-77-1271-5, dated September 8, 1977.
-.AE
-.CS 6 1 7 0 1 4
-.if n .ls 2
-.nr PS 9
-.nr VS 11
-.NH
-Introduction
-.if t .2C
-.PP
-.IT Awk
-is a programming language designed to make
-many common
-information retrieval and text manipulation tasks
-easy to state and to perform.
-.PP
-The basic operation of
-.IT awk
-is to scan a set of input lines in order,
-searching for lines which match any of a set of patterns
-which the user has specified.
-For each pattern, an action can be specified;
-this action will be performed on each line that matches the pattern.
-.PP
-Readers familiar with the
-.UX
-program
-.IT grep\|
-.[
-unix program manual
-.]
-will recognize
-the approach, although in
-.IT awk
-the patterns may be more
-general than in
-.IT grep ,
-and the actions allowed are more involved than merely
-printing the matching line.
-For example, the
-.IT awk
-program
-.P1
-{print $3, $2}
-.P2
-prints the third and second columns of a table
-in that order.
-The program
-.P1
-$2 ~ /A\||B\||C/
-.P2
-prints all input lines with an A, B, or C in the second field.
-The program
-.P1
-$1 != prev     { print; prev = $1 }
-.P2
-prints all lines in which the first field is different
-from the previous first field.
-.NH 2
-Usage
-.PP
-The command
-.P1
-awk  program  [files]
-.P2
-executes the
-.IT awk
-commands in
-the string
-.UL program
-on the set of named files,
-or on the standard input if there are no files.
-The statements can also be placed in a file
-.UL pfile ,
-and executed by the command
-.P1
-awk  -f pfile  [files]
-.P2
-.NH 2
-Program Structure
-.PP
-An
-.IT awk
-program is a sequence of statements of the form:
-.P1
-.ft I
-       pattern { action }
-       pattern { action }
-       ...
-.ft 3
-.P2
-Each line of input
-is matched against
-each of the patterns in turn.
-For each pattern that matches, the associated action
-is executed.
-When all the patterns have been tested, the next line
-is fetched and the matching starts over.
-.PP
-Either the pattern or the action may be left out,
-but not both.
-If there is no action for a pattern,
-the matching line is simply
-copied to the output.
-(Thus a line which matches several patterns can be printed several times.)
-If there is no pattern for an action,
-then the action is performed for every input line.
-A line which matches no pattern is ignored.
-.PP
-Since patterns and actions are both optional,
-actions must be enclosed in braces
-to distinguish them from patterns.
-.NH 2
-Records and Fields
-.PP
-.IT Awk
-input is divided into
-``records'' terminated by a record separator.
-The default record separator is a newline,
-so by default
-.IT awk
-processes its input a line at a time.
-The number of the current record is available in a variable
-named
-.UL NR .
-.PP
-Each input record
-is considered to be divided into ``fields.''
-Fields are normally separated by
-white space \(em blanks or tabs \(em
-but the input field separator may be changed, as described below.
-Fields are referred to as
-.UL "$1, $2,"
-and so forth,
-where
-.UL $1
-is the first field,
-and
-.UL $0
-is the whole input record itself.
-Fields may be assigned to.
-The number of fields in the current record
-is available in a variable named
-.UL NF .
-.PP
-The variables
-.UL FS
-and
-.UL RS
-refer to the input field and record separators;
-they may be changed at any time to any single character.
-The optional command-line argument
-\f3\-F\fIc\fR
-may also be used to set
-.UL FS
-to the character
-.IT c .
-.PP
-If the record separator is empty,
-an empty input line is taken as the record separator,
-and blanks, tabs and newlines are treated as field separators.
-.PP
-The variable
-.UL FILENAME
-contains the name of the current input file.
-.NH 2
-Printing
-.PP
-An action may have no pattern,
-in which case the action is executed for
-all
-lines.
-The simplest action is to print some or all of a record;
-this is accomplished by the
-.IT awk
-command
-.UL print .
-The
-.IT awk
-program
-.P1
-{ print }
-.P2
-prints each record, thus copying the input to the output intact.
-More useful is to print a field or fields from each record.
-For instance, 
-.P1
-print $2, $1
-.P2
-prints the first two fields in reverse order.
-Items separated by a comma in the print statement will be separated by the current output field separator
-when output.
-Items not separated by commas will be concatenated,
-so
-.P1
-print $1 $2
-.P2
-runs the first and second fields together.
-.PP
-The predefined variables
-.UL NF
-and
-.UL NR
-can be used;
-for example
-.P1
-{ print NR, NF, $0 }
-.P2
-prints each record preceded by the record number and the number of fields.
-.PP
-Output may be diverted to multiple files;
-the program
-.P1
-{ print $1 >"foo1"; print $2 >"foo2" }
-.P2
-writes the first field,
-.UL $1 ,
-on the file
-.UL foo1 ,
-and the second field on file
-.UL foo2 .
-The
-.UL >>
-notation can also be used:
-.P1
-print $1 >>"foo"
-.P2
-appends the output to the file
-.UL foo .
-(In each case,
-the output files are
-created if necessary.)
-The file name can be a variable or a field as well as a constant;
-for example,
-.P1
-print $1 >$2
-.P2
-uses the contents of field 2 as a file name.
-.PP
-Naturally there is a limit on the number of output files;
-currently it is 10.
-.PP
-Similarly, output can be piped into another process
-(on
-.UC UNIX
-only); for instance,
-.P1
-print | "mail bwk"
-.P2
-mails the output to
-.UL bwk .
-.PP
-The variables
-.UL OFS
-and
-.UL ORS
-may be used to change the current
-output field separator and output
-record separator.
-The output record separator is
-appended to the output of the
-.UL print
-statement.
-.PP
-.IT Awk
-also provides the
-.UL printf
-statement for output formatting:
-.P1
-printf format expr, expr, ...
-.P2
-formats the expressions in the list
-according to the specification
-in
-.UL format
-and prints them.
-For example,
-.P1
-printf "%8.2f  %10ld\en", $1, $2
-.P2
-prints 
-.UL $1
-as a floating point number 8 digits wide,
-with two after the decimal point,
-and
-.UL $2
-as a 10-digit long decimal number,
-followed by a newline.
-No output separators are produced automatically;
-you must add them yourself,
-as in this example.
-The version of
-.UL printf
-is identical to that used with C.
-.[
-C programm language prentice hall 1978
-.]
-.NH 1
-Patterns
-.PP
-A pattern in front of an action acts as a selector
-that determines whether the action is to be executed.
-A variety of expressions may be used as patterns:
-regular expressions,
-arithmetic relational expressions,
-string-valued expressions,
-and arbitrary boolean
-combinations of these.
-.NH 2
-BEGIN and END
-.PP
-The special pattern
-.UL BEGIN
-matches the beginning of the input,
-before the first record is read.
-The pattern
-.UL END
-matches the end of the input,
-after the last record has been processed.
-.UL BEGIN
-and
-.UL END
-thus provide a way to gain control before and after processing,
-for initialization and wrapup.
-.PP
-As an example, the field separator
-can be set to a colon by
-.P1
-BEGIN  { FS = ":" }
-.ft I
-\&... rest of program ...
-.ft 3
-.P2
-Or the input lines may be counted by
-.P1
-END  { print NR }
-.P2
-If
-.UL BEGIN
-is present, it must be the first pattern;
-.UL END
-must be the last if used.
-.NH 2
-Regular Expressions
-.PP
-The simplest regular expression is a literal string of characters
-enclosed in slashes,
-like
-.P1
-/smith/
-.P2
-This
-is actually a complete
-.IT awk
-program which
-will print all lines which contain any occurrence
-of the name ``smith''.
-If a line contains ``smith''
-as part of a larger word,
-it will also be printed, as in
-.P1
-blacksmithing
-.P2
-.PP
-.IT Awk
-regular expressions include the regular expression
-forms found in
-the
-.UC UNIX
-text editor
-.IT ed\|
-.[
-unix program manual
-.]
-and
-.IT grep
-(without back-referencing).
-In addition,
-.IT awk
-allows
-parentheses for grouping, | for alternatives,
-.UL +
-for ``one or more'', and
-.UL ?
-for ``zero or one'',
-all as in
-.IT lex .
-Character classes
-may be abbreviated:
-.UL [a\-zA\-Z0\-9]
-is the set of all letters and digits.
-As an example,
-the
-.IT awk
-program
-.P1
-/[Aa]ho\||[Ww]einberger\||[Kk]ernighan/
-.P2
-will print all lines which contain any of the names
-``Aho,'' ``Weinberger'' or ``Kernighan,''
-whether capitalized or not.
-.PP
-Regular expressions
-(with the extensions listed above)
-must be enclosed in slashes,
-just as in
-.IT ed
-and
-.IT sed .
-Within a regular expression,
-blanks and the regular expression
-metacharacters are significant.
-To turn of the magic meaning
-of one of the regular expression characters,
-precede it with a backslash.
-An example is the pattern
-.P1
-/\|\e/\^.\^*\e//
-.P2
-which matches any string of characters
-enclosed in slashes.
-.PP
-One can also specify that any field or variable
-matches
-a regular expression (or does not match it) with the operators
-.UL ~
-and
-.UL !~ .
-The program
-.P1
-$1 ~ /[jJ]ohn/
-.P2
-prints all lines where the first field matches ``john'' or ``John.''
-Notice that this will also match ``Johnson'', ``St. Johnsbury'', and so on.
-To restrict it to exactly
-.UL [jJ]ohn ,
-use
-.P1
-$1 ~ /^[jJ]ohn$/
-.P2
-The caret ^ refers to the beginning
-of a line or field;
-the dollar sign
-.UL $
-refers to the end.
-.NH 2
-Relational Expressions
-.PP
-An
-.IT awk
-pattern can be a relational expression
-involving the usual relational operators
-.UL < ,
-.UL <= ,
-.UL == ,
-.UL != ,
-.UL >= ,
-and
-.UL > .
-An example is
-.P1
-$2 > $1 + 100
-.P2
-which selects lines where the second field
-is at least 100 greater than the first field.
-Similarly,
-.P1
-NF % 2 == 0
-.P2
-prints lines with an even number of fields.
-.PP
-In relational tests, if neither operand is numeric,
-a string comparison is made;
-otherwise it is numeric.
-Thus,
-.P1
-$1 >= "s"
-.P2
-selects lines that begin with an
-.UL s ,
-.UL t ,
-.UL u ,
-etc.
-In the absence of any other information,
-fields are treated as strings, so
-the program
-.P1
-$1 > $2
-.P2
-will perform a string comparison.
-.NH 2
-Combinations of Patterns
-.PP
-A pattern can be any boolean combination of patterns,
-using the operators
-.UL \||\||
-(or),
-.UL &&
-(and), and
-.UL !
-(not).
-For example,
-.P1
-$1 >= "s" && $1 < "t" && $1 != "smith"
-.P2
-selects lines where the first field begins with ``s'', but is not ``smith''.
-.UL &&
-and
-.UL \||\||
-guarantee that their operands
-will be evaluated
-from left to right;
-evaluation stops as soon as the truth or falsehood
-is determined.
-.NH 2
-Pattern Ranges
-.PP
-The ``pattern'' that selects an action may also
-consist of two patterns separated by a comma, as in
-.P1
-pat1, pat2     { ... }
-.P2
-In this case, the action is performed for each line between
-an occurrence of
-.UL pat1
-and the next occurrence of
-.UL pat2
-(inclusive).
-For example,
-.P1
-/start/, /stop/
-.P2
-prints all lines between
-.UL start
-and
-.UL stop ,
-while
-.P1
-NR == 100, NR == 200 { ... }
-.P2
-does the action for lines 100 through 200
-of the input.
-.NH 1
-Actions
-.PP
-An
-.IT awk
-action is a sequence of action statements
-terminated by newlines or semicolons.
-These action statements can be used to do a variety of
-bookkeeping and string manipulating tasks.
-.NH 2
-Built-in Functions
-.PP
-.IT Awk
-provides a ``length'' function
-to compute the length of a string of characters.
-This program prints each record,
-preceded by its length:
-.P1
-{print length, $0}
-.P2
-.UL length
-by itself is a ``pseudo-variable'' which
-yields the length of the current record;
-.UL length(argument)
-is a function which yields the length of its argument,
-as in
-the equivalent
-.P1
-{print length($0), $0}
-.P2
-The argument may be any expression.
-.PP
-.IT Awk
-also
-provides the arithmetic functions
-.UL sqrt ,
-.UL log ,
-.UL exp ,
-and
-.UL int ,
-for
-square root,
-base
-.IT e
-logarithm,
-exponential,
-and integer part of their respective arguments.
-.PP
-The name of one of these built-in functions,
-without argument or parentheses,
-stands for the value of the function on the
-whole record.
-The program
-.P1
-length < 10 || length > 20
-.P2
-prints lines whose length
-is less than 10 or greater
-than 20.
-.PP
-The function
-.UL substr(s,\ m,\ n)
-produces the substring of
-.UL s
-that begins at position
-.UL m
-(origin 1)
-and is at most
-.UL n
-characters long.
-If
-.UL n
-is omitted, the substring goes to the end of
-.UL s .
-The function
-.UL index(s1,\ s2)
-returns the position where the string
-.UL s2
-occurs in
-.UL s1 ,
-or zero if it does not.
-.PP
-The function
-.UL sprintf(f,\ e1,\ e2,\ ...)
-produces the value of the expressions
-.UL e1 ,
-.UL e2 ,
-etc.,
-in the
-.UL printf
-format specified by
-.UL f .
-Thus, for example,
-.P1
-x = sprintf("%8.2f %10ld", $1, $2)
-.P2
-sets
-.UL x
-to the string produced by formatting
-the values of
-.UL $1
-and
-.UL $2 .
-.NH 2
-Variables, Expressions, and Assignments
-.PP
-.IT Awk
-variables take on numeric (floating point)
-or string values according to context.
-For example, in
-.P1
-x = 1
-.P2
-.UL x
-is clearly a number, while in
-.P1
-x = "smith"
-.P2
-it is clearly a string.
-Strings are converted to numbers and
-vice versa whenever context demands it.
-For instance,
-.P1
-x = "3" + "4"
-.P2
-assigns 7 to
-.UL x .
-Strings which cannot be interpreted
-as numbers in a numerical context
-will generally have numeric value zero,
-but it is unwise to count on this behavior.
-.PP
-By default, variables (other than built-ins) are initialized to the null string,
-which has numerical value zero;
-this eliminates the need for most
-.UL BEGIN
-sections.
-For example, the sums of the first two fields can be computed by
-.P1
-       { s1 += $1; s2 += $2 }
-END    { print s1, s2 }
-.P2
-.PP
-Arithmetic is done internally in floating point.
-The arithmetic operators are
-.UL + ,
-.UL \- ,
-.UL \(** ,
-.UL / ,
-and
-.UL %
-(mod).
-The C increment
-.UL ++
-and
-decrement
-.UL \-\-
-operators are also available,
-and so are the assignment operators
-.UL += ,
-.UL \-= ,
-.UL *= ,
-.UL /= ,
-and
-.UL %= .
-These operators may all be used in expressions.
-.NH 2
-Field Variables
-.PP
-Fields in
-.IT awk
-share essentially all of the properties of variables _
-they may be used in arithmetic or string operations,
-and may be assigned to.
-Thus one can
-replace the first field with a sequence number like this:
-.P1
-{ $1 = NR; print }
-.P2
-or
-accumulate two fields into a third, like this:
-.P1
-{ $1 = $2 + $3; print $0 }
-.P2
-or assign a string to a field:
-.P1
-{ if ($3 > 1000)
-       $3 = "too big"
-  print
-}
-.P2
-which replaces the third field by ``too big'' when it is,
-and in any case prints the record.
-.PP
-Field references may be numerical expressions,
-as in
-.P1
-{ print $i, $(i+1), $(i+n) }
-.P2
-Whether a field is deemed numeric or string depends on context;
-in ambiguous cases like
-.P1
-if ($1 == $2) ...
-.P2
-fields are treated as strings.
-.PP
-Each input line is split into fields automatically as necessary.
-It is also possible to split any variable or string
-into fields:
-.P1
-n = split(s, array, sep)
-.P2
-splits the
-the string
-.UL s
-into
-.UL array[1] ,
-\&...,
-.UL array[n] .
-The number of elements found is returned.
-If the
-.UL sep
-argument is provided, it is used as the field separator;
-otherwise
-.UL FS
-is used as the separator.
-.NH 2
-String Concatenation
-.PP
-Strings may be concatenated.
-For example
-.P1
-length($1 $2 $3)
-.P2
-returns the length of the first three fields.
-Or in a
-.UL print
-statement,
-.P1
-print $1 " is " $2
-.P2
-prints
-the two fields separated by `` is ''.
-Variables and numeric expressions may also appear in concatenations.
-.NH 2
-Arrays
-.PP
-Array elements are not declared;
-they spring into existence by being mentioned.
-Subscripts may have
-.ul
-any
-non-null
-value, including non-numeric strings.
-As an example of a conventional numeric subscript,
-the statement
-.P1
-x[NR] = $0
-.P2
-assigns the current input record to
-the
-.UL NR -th
-element of the array
-.UL x .
-In fact, it is possible in principle (though perhaps slow)
-to process the entire input in a random order with the
-.IT awk
-program
-.P1
-       { x[NR] = $0 }
-END    { \fI... program ...\fP }
-.P2
-The first action merely records each input line in
-the array
-.UL x .
-.PP
-Array elements may be named by non-numeric values,
-which gives
-.IT awk
-a capability rather like the associative memory of
-Snobol tables.
-Suppose the input contains fields with values like
-.UL apple ,
-.UL orange ,
-etc.
-Then the program
-.P1
-/apple/        { x["apple"]++ }
-/orange/       { x["orange"]++ }
-END            { print x["apple"], x["orange"] }
-.P2
-increments counts for the named array elements,
-and prints them at the end of the input.
-.NH 2
-Flow-of-Control Statements
-.PP
-.IT Awk
-provides the basic flow-of-control statements
-.UL if-else ,
-.UL while ,
-.UL for ,
-and statement grouping with braces, as in C.
-We showed the
-.UL if
-statement in section 3.3 without describing it.
-The condition in parentheses is evaluated;
-if it is true, the statement following the
-.UL if
-is done.
-The
-.UL else
-part is optional.
-.PP
-The
-.UL while
-statement is exactly like that of C.
-For example, to print all input fields one per line,
-.P1
-i = 1
-while (i <= NF) {
-       print $i
-       ++i
-}
-.P2
-.PP
-The
-.UL for
-statement is also exactly that of C:
-.P1
-for (i = 1; i <= NF; i++)
-       print $i
-.P2
-does the same job as the
-.UL while
-statement above.
-.PP
-There is an alternate form of the
-.UL for
-statement which is suited for accessing the
-elements of an associative array:
-.P1
-for (i in array)
-       \fIstatement\f3
-.P2
-does
-.ul
-statement
-with 
-.UL i
-set in turn to each element of
-.UL array .
-The elements are accessed in an apparently random order.
-Chaos will ensue if 
-.UL i
-is altered, or if any new elements are
-accessed during the loop.
-.PP
-The expression in the condition part of an
-.UL if ,
-.UL while
-or
-.UL for
-can include relational operators like
-.UL < ,
-.UL <= ,
-.UL > ,
-.UL >= ,
-.UL ==
-(``is equal to''),
-and
-.UL !=
-(``not equal to'');
-regular expression matches with the match operators
-.UL ~
-and
-.UL !~ ;
-the logical operators
-.UL \||\|| ,
-.UL && ,
-and
-.UL ! ;
-and of course parentheses for grouping.
-.PP
-The
-.UL break
-statement causes an immediate exit
-from an enclosing
-.UL while
-or
-.UL for ;
-the
-.UL continue
-statement
-causes the next iteration to begin.
-.PP
-The statement
-.UL next
-causes
-.IT awk
-to skip immediately to
-the next record and begin scanning the patterns from the top.
-The statement
-.UL exit
-causes the program to behave as if the end of the input
-had occurred.
-.PP
-Comments may be placed in
-.IT awk
-programs:
-they begin with the character
-.UL #
-and end with the end of the line,
-as in
-.P1
-print x, y     # this is a comment
-.P2
-.NH
-Design
-.PP
-The
-.UX
-system
-already provides several programs that
-operate by passing input through a
-selection mechanism.
-.IT Grep ,
-the first and simplest, merely prints all lines which
-match a single specified pattern.
-.IT Egrep
-provides more general patterns, i.e., regular expressions
-in full generality;
-.IT fgrep
-searches for a set of keywords with a particularly fast algorithm.
-.IT Sed\|
-.[
-unix programm manual
-.]
-provides most of the editing facilities of
-the editor
-.IT ed  ,
-applied to a stream of input.
-None of these programs provides
-numeric capabilities,
-logical relations,
-or variables.
-.PP
-.IT Lex\|
-.[
-lesk lexical analyzer cstr
-.]
-provides general regular expression recognition capabilities,
-and, by serving as a C program generator,
-is essentially open-ended in its capabilities.
-The use of
-.IT lex ,
-however, requires a knowledge of C programming,
-and a
-.IT lex
-program must be compiled and loaded before use,
-which discourages its use for one-shot applications.
-.PP
-.IT Awk
-is an attempt
-to fill in another part of the matrix of possibilities.
-It
-provides general regular expression capabilities
-and an implicit input/output loop.
-But it also provides convenient numeric processing,
-variables,
-more general selection,
-and control flow in the actions.
-It
-does not require compilation or a knowledge of C.
-Finally,
-.IT awk
-provides
-a convenient way to access fields within lines;
-it is unique in this respect.
-.PP
-.IT Awk
-also tries to integrate strings and numbers
-completely,
-by treating all quantities as both string and numeric,
-deciding which representation is appropriate
-as late as possible.
-In most cases the user can simply ignore the differences.
-.PP
-Most of the effort in developing
-.I awk
-went into deciding what
-.I awk
-should or should not do
-(for instance, it doesn't do string substitution)
-and what the syntax should be
-(no explicit operator for concatenation)
-rather
-than on writing or debugging the code.
-We have tried
-to make the syntax powerful
-but easy to use and well adapted
-to scanning files.
-For example,
-the absence of declarations and implicit initializations,
-while probably a bad idea for a general-purpose programming language,
-is desirable in a language
-that is meant to be used for tiny programs
-that may even be composed on the command line.
-.PP
-In practice,
-.IT awk
-usage seems to fall into two broad categories.
-One is what might be called ``report generation'' \(em
-processing an input to extract counts,
-sums, sub-totals, etc.
-This also includes the writing of trivial
-data validation programs,
-such as verifying that a field contains only numeric information
-or that certain delimiters are properly balanced.
-The combination of textual and numeric processing is invaluable here.
-.PP
-A second area of use is as a data transformer,
-converting data from the form produced by one program
-into that expected by another.
-The simplest examples merely select fields, perhaps with rearrangements.
-.NH
-Implementation
-.PP
-The actual implementation of
-.IT awk
-uses the language development tools available
-on the
-.UC UNIX
-operating system.
-The grammar is specified with
-.IT yacc ;
-.[
-yacc johnson cstr
-.]
-the lexical analysis is done by
-.IT lex ;
-the regular expression recognizers are
-deterministic finite automata
-constructed directly from the expressions.
-An
-.IT awk
-program is translated into a 
-parse tree which is then directly executed
-by a simple interpreter.
-.PP
-.IT Awk
-was designed for ease of use rather than processing speed;
-the delayed evaluation of variable types
-and the necessity to break input
-into fields makes high speed difficult to achieve in any case.
-Nonetheless,
-the program has not proven to be unworkably slow.
-.PP
-Table I below shows the execution (user + system) time
-on a PDP-11/70 of
-the
-.UC UNIX
-programs
-.IT wc ,
-.IT grep ,
-.IT egrep ,
-.IT fgrep ,
-.IT sed ,
-.IT lex ,
-and
-.IT awk
-on the following simple tasks:
-.IP "\ \ 1."
-count the number of lines.
-.IP "\ \ 2."
-print all lines containing ``doug''.
-.IP "\ \ 3."
-print all lines containing ``doug'', ``ken'' or ``dmr''.
-.IP "\ \ 4."
-print the third field of each line.
-.IP "\ \ 5."
-print the third and second fields of each line, in that order.
-.IP "\ \ 6."
-append all lines containing ``doug'', ``ken'', and ``dmr''
-to files ``jdoug'', ``jken'', and ``jdmr'', respectively.
-.IP "\ \ 7."
-print each line prefixed by ``line-number\ :\ ''.
-.IP "\ \ 8."
-sum the fourth column of a table.
-.LP
-The program
-.IT wc
-merely counts words, lines and characters in its input;
-we have already mentioned the others.
-In all cases the input was a file containing
-10,000 lines
-as created by the
-command
-.IT "ls \-l" ;
-each line has the form
-.P1
--rw-rw-rw- 1 ava 123 Oct 15 17:05 xxx
-.P2
-The total length of this input is
-452,960 characters.
-Times for
-.IT lex
-do not include compile or load.
-.PP
-As might be expected,
-.IT awk
-is not as fast as the specialized tools
-.IT wc ,
-.IT sed ,
-or the programs in the
-.IT grep
-family,
-but
-is faster than the more general tool
-.IT lex .
-In all cases, the tasks were
-about as easy to express as
-.IT awk
-programs
-as programs in these other languages;
-tasks involving fields were
-considerably easier to express as
-.IT awk
-programs.
-Some of the test programs are shown in
-.IT awk ,
-.IT sed
-and
-.IT lex .
-.[
-$LIST$
-.]
-.1C
-.TS
-center;
-c c c c c c c c c
-c c c c c c c c c
-c|n|n|n|n|n|n|n|n|.
-                               Task
-Program        1       2       3       4       5       6       7       8
-_
-\fIwc\fR       8.6
-\fIgrep\fR     11.7    13.1
-\fIegrep\fR    6.2     11.5    11.6
-\fIfgrep\fR    7.7     13.8    16.1
-\fIsed\fR      10.2    11.6    15.8    29.0    30.5    16.1
-\fIlex\fR      65.1    150.1   144.2   67.7    70.3    104.0   81.7    92.8
-\fIawk\fR      15.0    25.6    29.9    33.3    38.9    46.4    71.4    31.1
-_
-.TE
-.sp
-.ce
-\fBTable I.\fR  Execution Times of Programs. (Times are in sec.)
-.sp 2
-.2C
-.PP
-The programs for some of these jobs are shown below.
-The
-.IT lex
-programs are generally too long to show.
-.LP
-AWK:
-.LP
-.P1
-1.     END     {print NR}
-.P2
-.P1
-2.     /doug/
-.P2
-.P1
-3.     /ken|doug|dmr/
-.P2
-.P1
-4.     {print $3}
-.P2
-.P1
-5.     {print $3, $2}
-.P2
-.P1
-6.     /ken/   {print >"jken"}
-       /doug/  {print >"jdoug"}
-       /dmr/   {print >"jdmr"}
-.P2
-.P1
-7.     {print NR ": " $0}
-.P2
-.P1
-8.             {sum = sum + $4}
-       END     {print sum}
-.P2
-.LP
-SED:
-.LP
-.P1
-1.     $=
-.P2
-.P1
-2.     /doug/p
-.P2
-.P1
-3.     /doug/p
-       /doug/d
-       /ken/p
-       /ken/d
-       /dmr/p
-       /dmr/d
-.P2
-.P1
-4.     /[^ ]* [ ]*[^ ]* [ ]*\e([^ ]*\e) .*/s//\e1/p
-.P2
-.P1
-5.     /[^ ]* [ ]*\e([^ ]*\e) [ ]*\e([^ ]*\e) .*/s//\e2 \e1/p
-.P2
-.P1
-6.     /ken/w jken
-       /doug/w jdoug
-       /dmr/w jdmr
-.P2
-.LP
-LEX:
-.LP
-.P1
-1.     %{
-       int i;
-       %}
-       %%
-       \en     i++;
-       .       ;
-       %%
-       yywrap() {
-               printf("%d\en", i);
-       }
-.P2
-.P1
-2.     %%
-       ^.*doug.*$      printf("%s\en", yytext);
-       .       ;
-       \en     ;
-.P2
diff --git a/.ref-Research-V7/usr/doc/bc b/.ref-Research-V7/usr/doc/bc
deleted file mode 100644 (file)
index 58d839c..0000000
+++ /dev/null
@@ -1,1059 +0,0 @@
-.RP
-.TL
-BC \- An Arbitrary Precision Desk-Calculator Language
-.AU
-Lorinda Cherry
-.AU
-Robert Morris
-.AI
-.MH
-.AB
-BC is a language and a compiler for doing arbitrary precision arithmetic
-on the PDP-11 under the
-.UX
-time-sharing
-system.  The output of the compiler is interpreted and executed by
-a collection of routines which can input, output, and do
-arithmetic on indefinitely large integers and on scaled fixed-point
-numbers.
-.PP
-These routines are themselves based on a dynamic storage allocator.
-Overflow does not occur until all available core storage
-is exhausted.
-.PP
-The language has a complete control structure as well as immediate-mode
-operation.  Functions can be defined and saved for later execution.
-.PP
-Two five hundred-digit numbers can be multiplied to give a
-thousand digit result in about ten seconds.
-.PP
-A small collection of library functions is also available,
-including sin, cos, arctan, log, exponential, and Bessel functions of
-integer order.
-.PP
-Some of the uses of this compiler are
-.IP \-
-to do computation with large integers,
-.IP \-
-to do computation accurate to many decimal places,
-.IP \-
-conversion of numbers from one base to another base.
-.AE
-.PP
-.SH
-Introduction
-.PP
-BC is a language and a compiler for doing arbitrary precision
-arithmetic on the
-.UX
-time-sharing system [1].
-The compiler was written to make conveniently available a
-collection of routines (called DC [5]) which are capable of doing
-arithmetic on integers of arbitrary size.  The compiler
-is by no means intended to provide a complete programming
-language.
-It is a minimal language facility.
-.PP
-There is a scaling provision that permits the
-use of decimal point notation.
-Provision is made for input and output in bases other than
-decimal.  Numbers can be converted from decimal to octal by
-simply setting the output base to equal 8.
-.PP
-The actual limit on the number of digits that can
-be handled depends on the amount of storage available on the machine.
-Manipulation of numbers with many hundreds of digits
-is possible even on the smallest versions of
-.UX .
-.PP
-The syntax of BC has been deliberately selected to agree
-substantially with the C language [2].  Those who
-are familiar with C will find few surprises in this language.
-.SH
-Simple Computations with Integers
-.PP
-The simplest kind of statement is an arithmetic expression
-on a line by itself.
-For instance, if you type in the line:
-.DS
-142857 + 285714
-.DE
-the program responds immediately with the line
-.DS
-428571
-.DE
-The operators \-, *, /, %, and ^ can also be used; they
-indicate subtraction, multiplication, division, remaindering, and
-exponentiation, respectively.  Division of integers produces an
-integer result truncated toward zero.
-Division by zero produces an error
-comment.
-.PP
-Any term in an expression may be prefixed by a minus sign to
-indicate that it is to be negated (the `unary' minus sign).
-The expression
-.DS
-7+\-3
-.DE
-is interpreted to mean that \-3 is to be added to 7.
-.PP
-More complex expressions with several operators and with
-parentheses are interpreted just as in
-Fortran, with ^ having the greatest binding
-power, then * and % and /, and finally + and \-.
-Contents of parentheses are evaluated before material
-outside the parentheses.
-Exponentiations are
-performed from right to left and the other operators
-from left to right.
-The two expressions
-.DS
-a^b^c  and  a^(b^c)
-.DE
-are equivalent, as are the two expressions
-.DS
-a*b*c  and  (a*b)*c
-.DE
-BC shares with Fortran and C the undesirable convention that
-.DS
-a/b*c  is equivalent to  (a/b)*c
-.DE
-.PP
-Internal storage registers to hold numbers have single lower-case
-letter names.  The value of an expression can be assigned to
-a register in the usual way.  The statement
-.DS
-x = x + 3
-.DE
-has the effect of increasing by three the value of the contents of the
-register named x.
-When, as in this case, the outermost operator is an =, the
-assignment is performed but the result is not printed.
-Only 26 of these named storage registers are available.
-.PP
-There is a built-in square root function whose
-result is truncated to an integer (but see scaling below).
-The lines
-.DS
-x = sqrt(191)
-x
-.DE
-produce the printed result
-.DS
-13
-.DE
-.SH
-Bases
-.PP
-There are special internal quantities, called `ibase' and `obase'.
-The contents of `ibase', initially set to 10,
-determines the base used for interpreting numbers read in.
-For example, the lines
-.DS
-ibase = 8
-11
-.DE
-will produce the output line
-.DS
-9
-.DE
-and you are all set up to do octal to decimal conversions.
-Beware, however of trying to change the input base back
-to decimal by typing
-.DS
-ibase = 10
-.DE
-Because the number 10 is interpreted as octal, this statement will
-have no effect.
-For those who deal in hexadecimal notation,
-the characters A\-F are permitted in numbers
-(no matter what base is in effect)
-and are
-interpreted as digits having values 10\-15 respectively.
-The statement
-.DS
-ibase = A
-.DE
-will change you back to decimal input base no matter what the
-current input base is.
-Negative and large positive input bases are
-permitted but useless.
-No mechanism has been provided for the input of arbitrary
-numbers in bases less than 1 and greater than 16.
-.PP
-The contents of `obase', initially set to 10, are used as the base for output
-numbers.  The lines
-.DS
-obase = 16
-1000
-.DE
-will produce the output line
-.DS
-3E8
-.DE
-which is to be interpreted as a 3-digit hexadecimal number.
-Very large output bases are permitted, and they are sometimes useful.
-For example, large numbers can be output in groups of five digits
-by setting `obase' to 100000.
-Strange (i.e. 1, 0, or negative) output bases are
-handled appropriately.
-.PP
-Very large numbers are split across lines with 70 characters per line.
-Lines which are continued end with \\.
-Decimal output conversion is practically instantaneous, but output
-of very large numbers (i.e., more than 100 digits) with other bases
-is rather slow.
-Non-decimal output conversion of
-a one hundred digit number takes about
-three seconds.
-.PP
-It is best to remember that `ibase' and `obase' have no effect
-whatever on the course of internal computation or
-on the evaluation of expressions, but only affect input and
-output conversion, respectively.
-.SH
-Scaling
-.PP
-A third special internal quantity called `scale' is
-used to determine the scale of calculated
-quantities.
-Numbers may have
-up to 99 decimal digits after the decimal point.
-This fractional part is retained in further computations.
-We refer to the number of digits after the decimal point of
-a number as its scale.
-.PP
-When two scaled numbers are combined by
-means of one of the arithmetic operations, the result
-has a scale determined by the following rules.  For
-addition and subtraction, the scale of the result is the larger
-of the scales of the two operands.  In this case,
-there is never any truncation of the result.
-For multiplications, the scale of the result is never
-less than the maximum of the two scales of the operands,
-never more than the sum of the scales of the operands
-and, subject to those two restrictions,
-the scale of the result is set equal to the contents of the internal
-quantity `scale'.
-The scale of a quotient is the contents of the internal
-quantity `scale'.  The scale of a remainder is
-the sum of the scales of the quotient and the divisor.
-The result of an exponentiation is scaled as if
-the implied multiplications were performed.
-An exponent must be an integer.
-The scale of a square root is set to the maximum of the scale
-of the argument and the contents of `scale'.
-.PP
-All of the internal operations are actually carried out in terms
-of integers, with digits being discarded when necessary.
-In every case where digits are discarded, truncation and
-not rounding is performed.
-.PP
-The contents of
-`scale' must be no greater than
-99 and no less than 0.  It is initially set to 0.
-In case you need more than 99 fraction digits, you may arrange
-your own scaling.
-.PP
-The internal quantities `scale', `ibase', and `obase' can be
-used in expressions just like other variables.
-The line
-.DS
-scale = scale + 1
-.DE
-increases the value of `scale' by one, and the line
-.DS
-scale
-.DE
-causes the current value of `scale' to be printed.
-.PP
-The value of `scale' retains its meaning as a
-number of decimal digits to be retained in internal
-computation even when `ibase' or `obase' are not equal to 10.
-The internal computations (which are still conducted in decimal,
-regardless of the bases) are performed to the specified number
-of decimal digits, never hexadecimal or octal or any
-other kind of digits.
-.SH
-Functions
-.PP
-The name of a function is a single lower-case letter.
-Function names are permitted to collide with simple
-variable names.
-Twenty-six different defined functions are permitted
-in addition to the twenty-six variable names.
-The line
-.DS
-       define a(x){
-.DE
-begins the definition of a function with one argument.
-This line must be followed by one or more statements,
-which make up the body of the function, ending
-with a right brace }.
-Return of control from a function occurs when a return
-statement is executed or when the end of the function is reached.
-The return statement can take either
-of the two forms
-.DS
-return
-return(x)
-.DE
-In the first case, the value of the function is 0, and in
-the second, the value of the expression in parentheses.
-.PP
-Variables used in the function can be declared as automatic
-by a statement of the form
-.DS
-auto x,y,z
-.DE
-There can be only one `auto' statement in a function and it must
-be the first statement in the definition.
-These automatic variables are allocated space and initialized
-to zero on entry to the function and thrown away on return.  The
-values of any variables with the same names outside the function
-are not disturbed.
-Functions may be called recursively and the automatic variables
-at each level of call are protected.
-The parameters named in a function definition are treated in
-the same way as the automatic variables of that function
-with the single exception that they are given a value
-on entry to the function.
-An example of a function definition is
-.DS
-       define a(x,y){
-               auto z
-               z = x*y
-               return(z)
-       }
-.DE
-The value of this function, when called, will be the
-product of its
-two arguments.
-.PP
-A function is called by the appearance of its name
-followed by a string of arguments enclosed in
-parentheses and separated by commas.
-The result
-is unpredictable if the wrong number of arguments is used.
-.PP
-Functions with no arguments are defined and called using
-parentheses with nothing between them: b().
-.PP
-If the function
-.ft I
-a
-.ft
-above has been defined, then the line
-.DS
-a(7,3.14)
-.DE
-would cause the result 21.98 to be printed and the line
-.DS
-x = a(a(3,4),5)
-.DE
-would cause the value of x to become 60.
-.SH
-Subscripted Variables
-.PP
-A single lower-case letter variable name
-followed by an expression in brackets is called a subscripted
-variable (an array element).
-The variable name is called the array name and the expression
-in brackets is called the subscript.
-Only one-dimensional arrays are
-permitted.  The names of arrays are permitted to
-collide with the names of simple variables and function names.
-Any fractional
-part of a subscript is discarded before use.
-Subscripts must be greater than or equal to zero and 
-less than or equal to 2047.
-.PP
-Subscripted variables may be freely used in expressions, in
-function calls, and in return statements.
-.PP
-An array name may be used as an argument to a function,
-or may be declared as automatic in
-a function definition by the use of empty brackets:
-.DS
-f(a[\|])
-define f(a[\|])
-auto a[\|]
-.DE
-When an array name is so used, the whole contents of the array
-are copied for the use of the function, and thrown away on exit
-from the function.
-Array names which refer to whole arrays cannot be used
-in any other contexts.
-.SH
-Control Statements
-.PP
-The `if', the `while', and the `for' statements
-may be used to alter the flow within programs or to cause iteration.
-The range of each of them is a statement or
-a compound statement consisting of a collection of
-statements enclosed in braces.
-They are written in the following way
-.DS
-if(relation) statement
-while(relation) statement
-for(expression1; relation; expression2) statement
-.DE
-or
-.DS
-if(relation) {statements}
-while(relation) {statements}
-for(expression1; relation; expression2) {statements}
-.DE
-.PP
-A relation in one of the control statements is an expression of the form
-.DS
-x>y
-.DE
-where  two expressions are related by one of the six relational
-operators <, >, <=, >=, ==, or !=.
-The relation ==
-stands for `equal to' and != stands for `not equal to'.
-The meaning of the remaining relational operators is
-clear.
-.PP
-BEWARE of using = instead of == in a relational.  Unfortunately,
-both of them are legal, so you will not get a diagnostic
-message, but = really will not do a comparison.
-.PP
-The `if' statement causes execution of its range
-if and only if the relation is true.
-Then control passes to the next statement in sequence.
-.PP
-The `while' statement causes execution of its range
-repeatedly as long as the relation
-is true.  The relation is tested before each execution
-of its range and if the relation
-is false, control passes to the next statement beyond the range
-of the while.
-.PP
-The `for' statement begins
-by executing `expression1'.  Then the relation is tested
-and, if true, the statements in the range of the `for' are executed.
-Then `expression2' is executed.  The relation is tested, and so on.
-The typical use of the `for' statement is for a controlled iteration,
-as in the statement
-.DS
-for(i=1; i<=10; i=i+1) i
-.DE
-which will print the integers from 1 to 10.
-Here are some examples of the use of the control statements.
-.DS
-define f(n){
-auto i, x
-x=1
-for(i=1; i<=n; i=i+1) x=x*i
-return(x)
-}
-.DE
-The line
-.DS
-       f(a)
-.DE
-will print
-.ft I
-a
-.ft
-factorial if
-.ft I
-a
-.ft
-is a positive integer.
-Here is the definition of a function which will
-compute values of the binomial coefficient
-(m and n are assumed to be positive integers).
-.DS
-define b(n,m){
-auto x, j
-x=1
-for(j=1; j<=m; j=j+1) x=x*(n\-j+1)/j
-return(x)
-}
-.DE
-The following function computes values of the exponential function
-by summing the appropriate series
-without regard for possible truncation errors:
-.DS
-scale = 20
-define e(x){
-       auto a, b, c, d, n
-       a = 1
-       b = 1
-       c = 1
-       d = 0
-       n = 1
-       while(1==1){
-               a = a*x
-               b = b*n
-               c = c + a/b
-               n = n + 1
-               if(c==d) return(c)
-               d = c
-       }
-}
-.DE
-.SH
-Some Details
-.PP
-There are some language features that every user should know
-about even if he will not use them.
-.PP
-Normally statements are typed one to a line.  It is also permissible
-to type several statements on a line separated by semicolons.
-.PP
-If an assignment statement is parenthesized, it then has
-a value and it can be used anywhere that an expression can.
-For example, the line
-.DS
-(x=y+17)
-.DE
-not only makes the indicated assignment, but also prints the
-resulting value.
-.PP
-Here is an example of a use of the value of an
-assignment statement even when it is not parenthesized.
-.DS
-x = a[i=i+1]
-.DE
-causes a value to be assigned to x and also increments i
-before it is used as a subscript.
-.PP
-The following constructs work in BC in exactly the same manner
-as they do in the C language.  Consult the appendix or the
-C manuals [2] for their exact workings.
-.DS
-.ta 2i
-x=y=z  is the same as  x=(y=z)
-x =+ y x = x+y
-x =\- y        x = x\-y
-x =* y x = x*y
-x =/ y x = x/y
-x =% y x = x%y
-x =^ y x = x^y
-x++    (x=x+1)\-1
-x\-\-  (x=x\-1)+1
-++x    x = x+1
-\-\-x  x = x\-1
-.DE
-Even if you don't intend to use the constructs,
-if you type one inadvertently, something correct but unexpected
-may happen.
-.PP
-WARNING!  In some of these constructions, spaces are
-significant.
-There is a real difference between
-x=\-y and x= \-y.
-The first replaces x by x\-y and the second by \-y.
-.SH
-Three Important Things
-.PP
-1.  To exit a BC program, type `quit'.
-.PP
-2. There is a comment convention identical to that of C and
-of PL/I.  Comments begin with `/*' and end with `*/'.
-.PP
-3. There is a library of math functions which may be obtained by
-typing at command level
-.DS
-bc \-l
-.DE
-This command will load a set of library functions
-which, at the time of writing, consists of sine (named `s'),
-cosine (`c'), arctangent (`a'), natural logarithm (`l'),
-exponential (`e') and Bessel functions of integer order (`j(n,x)').  Doubtless more functions will be added
-in time.
-The library sets the scale to 20.  You can reset it to something
-else if you like.
-The design of these mathematical library routines
-is discussed elsewhere [3].
-.PP
-If you type
-.DS
-bc file ...
-.DE
-BC will read and execute the named file or files before accepting
-commands from the keyboard.  In this way, you may load your
-favorite programs and function definitions.
-.SH
-Acknowledgement
-.PP
-The compiler is written in YACC [4]; its original
-version  was written by S. C. Johnson.
-.SH
-References
-.IP [1]
-K. Thompson and D. M. Ritchie,
-.ft I
-UNIX Programmer's Manual,
-.ft
-Bell Laboratories,
-1978.
-.IP [2]
-B. W. Kernighan and
-D. M. Ritchie,
-.ft I
-The C Programming Language,
-.ft
-Prentice-Hall, 1978.
-.IP [3]
-R. Morris,
-.ft I
-A Library of Reference Standard Mathematical Subroutines,
-.ft
-Bell Laboratories internal memorandum, 1975.
-.IP [4]
-S. C. Johnson,
-.ft I
-YACC \(em Yet Another Compiler-Compiler.
-.ft
-Bell Laboratories Computing Science Technical Report #32, 1978.
-.IP [5]
-R. Morris and L. L. Cherry,
-.ft I
-DC \- An Interactive Desk Calculator.
-.ft
-.LP
-.bp
-.ft B
-.DS C
-Appendix
-.DE
-.ft
-.NH
-Notation
-.PP
-In the following pages syntactic categories are in \fIitalics\fP;
-literals are in \fBbold\fP; material in brackets [\|] is optional.
-.NH
-Tokens
-.PP
-Tokens consist of keywords, identifiers, constants, operators,
-and separators.
-Token separators may be blanks, tabs or comments.
-Newline characters or semicolons separate statements.
-.NH 2
-Comments
-.PP
-Comments are introduced by the characters /* and terminated by
-*/.
-.NH 2
-Identifiers
-.PP
-There are three kinds of identifiers \- ordinary identifiers, array identifiers
-and function identifiers.
-All three types consist of single lower-case letters.
-Array identifiers are followed by square brackets, possibly
-enclosing an expression describing a subscript.
-Arrays are singly dimensioned and may contain up to 2048
-elements.
-Indexing begins at zero so an array may be indexed from 0 to 2047.
-Subscripts are truncated to integers.
-Function identifiers are followed by parentheses, possibly enclosing arguments.
-The three types of identifiers do not conflict;
-a program can have a variable named \fBx\fP,
-an array named \fBx\fP and a function named \fBx\fP, all of which are separate and
-distinct.
-.NH 2
-Keywords
-.PP
-The following are reserved keywords:
-.ft B
-.ta .5i 1.0i
-.nf
-       ibase   if
-       obase   break
-       scale   define
-       sqrt    auto
-       length  return
-       while   quit
-       for
-.fi
-.ft
-.NH 2
-Constants
-.PP
-Constants consist of arbitrarily long numbers
-with an optional decimal point.
-The hexadecimal digits \fBA\fP\-\fBF\fP are also recognized as digits with
-values 10\-15, respectively.
-.NH 1
-Expressions
-.PP
-The value of an expression is printed unless the main
-operator is an assignment.
-Precedence is the same as the order
-of presentation here, with highest appearing first.
-Left or right associativity, where applicable, is
-discussed with each operator.
-.bp
-.NH 2
-Primitive expressions
-.NH 3
-Named expressions
-.PP
-Named expressions are
-places where values are stored.
-Simply stated,
-named expressions are legal on the left
-side of an assignment.
-The value of a named expression is the value stored in the place named.
-.NH 4
-\fIidentifiers\fR
-.PP
-Simple identifiers are named expressions.
-They have an initial value of zero.
-.NH 4
-\fIarray-name\fP\|[\|\fIexpression\fP\|]
-.PP
-Array elements are named expressions.
-They have an initial value of zero.
-.NH 4
-\fBscale\fR, \fBibase\fR and \fBobase\fR
-.PP
-The internal registers
-\fBscale\fP, \fBibase\fP and \fBobase\fP are all named expressions.
-\fBscale\fP is the number of digits after the decimal point to be
-retained in arithmetic operations.
-\fBscale\fR has an initial value of zero.
-\fBibase\fP and \fBobase\fP are the input and output number
-radix respectively.
-Both \fBibase\fR and \fBobase\fR have initial values of 10.
-.NH 3
-Function calls
-.NH 4
-\fIfunction-name\fB\|(\fR[\fIexpression\fR\|[\fB,\|\fIexpression\|\fR.\|.\|.\|]\|]\fB)
-.PP
-A function call consists of a function name followed by parentheses
-containing a comma-separated list of
-expressions, which are the function arguments.
-A whole array passed as an argument is specified by the
-array name followed by empty square brackets.
-All function arguments are passed by
-value.
-As a result, changes made to the formal parameters have
-no effect on the actual arguments.
-If the function terminates by executing a return
-statement, the value of the function is
-the value of the expression in the parentheses of the return
-statement or is zero if no expression is provided
-or if there is no return statement.
-.NH 4
-sqrt\|(\|\fIexpression\fP\|)
-.PP
-The result is the square root of the expression.
-The result is truncated in the least significant decimal place.
-The scale of the result is
-the scale of the expression or the
-value of
-.ft B
-scale,
-.ft
-whichever is larger.
-.NH 4
-length\|(\|\fIexpression\fP\|)
-.PP
-The result is the total number of significant decimal digits in the expression.
-The scale of the result is zero.
-.NH 4
-scale\|(\|\fIexpression\fP\|)
-.PP
-The result is the scale of the expression.
-The scale of the result is zero.
-.NH 3
-Constants
-.PP
-Constants are primitive expressions.
-.NH 3
-Parentheses
-.PP
-An expression surrounded by parentheses is
-a primitive expression.
-The parentheses are used to alter the
-normal precedence.
-.NH 2
-Unary operators
-.PP
-The unary operators
-bind right to left.
-.NH 3
-\-\|\fIexpression\fP
-.PP
-The result is the negative of the expression.
-.NH 3
-++\|\fInamed-expression\fP
-.PP
-The named expression is
-incremented by one.
-The result is the value of the named expression after
-incrementing.
-.NH 3
-\-\-\|\fInamed-expression\fP
-.PP
-The named expression is
-decremented by one.
-The result is the value of the named expression after
-decrementing.
-.NH 3
-\fInamed-expression\fP\|++
-.PP
-The named expression is
-incremented by one.
-The result is the value of the named expression before
-incrementing.
-.NH 3
-\fInamed-expression\fP\|\-\-
-.PP
-The named expression is
-decremented by one.
-The result is the value of the named expression before
-decrementing.
-.NH 2
-Exponentiation operator
-.PP
-The exponentiation operator binds right to left.
-.NH 3
-\fIexpression\fP ^ \fIexpression\fP
-.PP
-The result is the first
-expression raised to the power of the
-second expression.
-The second expression must be an integer.
-If \fIa\fP
-is the scale of the left expression
-and \fIb\fP is the absolute value
-of the right expression,
-then the scale of the result is:
-.PP
-min\|(\|\fIa\(mub\fP,\|max\|(\|\fBscale\fP,\|\fIa\fP\|)\|)
-.NH 2
-Multiplicative operators
-.PP
-The operators *, /, % bind left to right.
-.NH 3
-\fIexpression\fP * \fIexpression\fP
-.PP
-The result is the product
-of the two expressions.
-If \fIa\fP and \fIb\fP are the
-scales of the two expressions,
-then the scale of the result is:
-.PP
-min\|(\|\fIa+b\fP,\|max\|(\|\fBscale\fP,\|\fIa\fP,\|\fIb\fP\|)\|)
-.NH 3
-\fIexpression\fP / \fIexpression\fP
-.PP
-The result is the quotient of the two expressions.
-The scale of the result is the value of \fBscale\fR.
-.NH 3
-\fIexpression\fP % \fIexpression\fP
-.PP
-The % operator produces the remainder of the division
-of the two expressions.
-More precisely,
-\fIa\fP%\fIb\fP is \fIa\fP\-\fIa\fP/\fIb\fP*\fIb\fP.
-.PP
-The scale of the result is the sum of the scale of
-the divisor and the value of
-.ft B
-scale
-.ft
-.NH 2
-Additive operators
-.PP
-The additive operators bind left to right.
-.NH 3
-\fIexpression\fP + \fIexpression\fP
-.PP
-The result is the sum of the two expressions.
-The scale of the result is
-the maximun of the scales of the expressions.
-.NH 3
-\fIexpression\fP \- \fIexpression\fP
-.PP
-The result is the difference of the two expressions.
-The scale of the result is the
-maximum of the scales of the expressions.
-.NH 2
-assignment operators
-.PP
-The assignment operators bind right to left.
-.NH 3
-\fInamed-expression\fP = \fIexpression\fP
-.PP
-This expression results in assigning the value of the expression
-on the right
-to the named expression on the left.
-.NH 3
-\fInamed-expression\fP =+ \fIexpression\fP
-.NH 3
-\fInamed-expression\fP =\- \fIexpression\fP
-.NH 3
-\fInamed-expression\fP =* \fIexpression\fP
-.NH 3
-\fInamed-expression\fP =/ \fIexpression\fP
-.NH 3
-\fInamed-expression\fP =% \fIexpression\fP
-.NH 3
-\fInamed-expression\fP =^ \fIexpression\fP
-.PP
-The result of the above expressions is equivalent
-to ``named expression = named expression OP expression'',
-where OP is the operator after the = sign.
-.NH 1
-Relations
-.PP
-Unlike all other operators, the relational operators
-are only valid as the object of an \fBif\fP, \fBwhile\fP,
-or inside a \fBfor\fP statement.
-.NH 2
-\fIexpression\fP < \fIexpression\fP
-.NH 2
-\fIexpression\fP > \fIexpression\fP
-.NH 2
-\fIexpression\fP <= \fIexpression\fP
-.NH 2
-\fIexpression\fP >= \fIexpression\fP
-.NH 2
-\fIexpression\fP == \fIexpression\fP
-.NH 2
-\fIexpression\fP != \fIexpression\fP
-.NH 1
-Storage classes
-.PP
-There are only two storage classes in BC, global and automatic
-(local).
-Only identifiers that are to be local to a function need be 
-declared with the \fBauto\fP command.
-The arguments to a function
-are local to the function.
-All other identifiers are assumed to be global
-and available to all functions.
-All identifiers, global and local, have initial values
-of zero.
-Identifiers declared as \fBauto\fP are allocated on entry to the function 
-and released on returning from the function.
-They therefore do not retain values between function calls.
-\fBauto\fP arrays are specified by the array name followed by empty square brackets.
-.PP
-Automatic variables in BC do not work in exactly the same way
-as in either C or PL/I.  On entry to a function, the old values of
-the names that appear as parameters and as automatic
-variables are pushed onto a stack.  
-Until return is made from the function, reference to these
-names refers only to the new values.
-.NH 1
-Statements
-.PP
-Statements must be separated by semicolon or newline.
-Except where altered by control statements, execution
-is sequential.
-.NH 2
-Expression statements
-.PP
-When a statement is an expression, unless
-the main operator is an assignment, the value
-of the expression is printed, followed by a newline character.
-.NH 2
-Compound statements
-.PP
-Statements may be grouped together and used when one statement is expected
-by surrounding them with { }.
-.NH 2
-Quoted string statements
-.PP
-"any string"
-.sp .5
-This statement prints the string inside the quotes.
-.NH 2
-If statements
-.sp .5
-\fBif\|(\|\fIrelation\fB\|)\|\fIstatement\fR
-.PP
-The substatement is executed if the relation is true.
-.NH 2
-While statements
-.sp .5
-\fBwhile\|(\|\fIrelation\fB\|)\|\fIstatement\fR
-.PP
-The statement is executed while the relation
-is true.
-The test occurs before each execution of the statement.
-.NH 2
-For statements
-.sp .5
-\fBfor\|(\|\fIexpression\fB; \fIrelation\fB; \fIexpression\fB\|)\|\fIstatement\fR
-.PP
-The for statement is the same as
-.nf
-.ft I
-       first-expression
-       \fBwhile\|(\fPrelation\|\fB) {\fP
-               statement
-               last-expression
-       }
-.ft R
-.fi
-.PP
-All three expressions must be present.
-.NH 2
-Break statements
-.sp .5
-\fBbreak\fP
-.PP
-\fBbreak\fP causes termination of a \fBfor\fP or \fBwhile\fP statement.
-.NH 2
-Auto statements
-.sp .5
-\fBauto \fIidentifier\fR\|[\|\fB,\fIidentifier\fR\|]
-.PP
-The auto statement causes the values of the identifiers to be pushed down.
-The identifiers can be ordinary identifiers or array identifiers.
-Array identifiers are specified by following the array name by empty square
-brackets.
-The auto statement must be the first statement
-in a function definition.
-.NH 2
-Define statements
-.sp .5
-.nf
-\fBdefine(\|\fR[\fIparameter\|\fR[\fB\|,\|\fIparameter\|.\|.\|.\|\fR]\|]\|\fB)\|{\fI
-       statements\|\fB}\fR
-.fi
-.PP
-The define statement defines a function.
-The parameters may
-be ordinary identifiers or array names.
-Array names must be followed by empty square brackets.
-.NH 2
-Return statements
-.sp .5
-\fBreturn\fP
-.sp .5
-\fBreturn(\fI\|expression\|\fB)\fR
-.PP
-The return statement causes termination of a function,
-popping of its auto variables, and
-specifies the result of the function.
-The first form is equivalent to \fBreturn(0)\fR.
-The result of the function is the result of the expression
-in parentheses.
-.NH 2
-Quit
-.PP
-The quit statement stops execution of a BC program and returns
-control to UNIX when it is first encountered.
-Because it is not treated as an executable statement,
-it cannot be used
-in a function definition or in an 
-.ft B
-if, for,
-.ft
-or
-.ft B
-while
-.ft
-statement.
diff --git a/.ref-Research-V7/usr/doc/beginners/u.mac b/.ref-Research-V7/usr/doc/beginners/u.mac
deleted file mode 100644 (file)
index 03f6a1b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-.tr |\(bv
-.de IT
-.if n .ul
-\%\&\\$3\f2\\$1\fR\&\\$2
-..
-.de UL
-.lg 0
-.if n .ul
-\%\&\\$3\f3\\$1\fR\&\\$2
-.lg
-..
-.de UC
-\\$3\s-1\\$1\s0\\$2
-..
-.de P1
-.DS I .4i
-.nf
-.lg 0
-.if n .ls 1
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ps -\\n(dP
-.if t .vs -\\n(dP
-.nr P \\n(.s
-.nr S \\n(.s+1
-.nr s \\n(.s-1
-.nr t 5*33u    \" width in 9 point CW
-.if t .ta 1u*\\ntu 2u*\\ntu 3u*\\ntu 4u*\\ntu 5u*\\ntu 6u*\\ntu 7u*\\ntu 8u*\\ntu 9u*\\ntu 10u*\\ntu 11u*\\ntu 12u*\\ntu 13u*\\ntu 14u*\\ntu
-.ft 3
-.tr _\(ul
-.tr -\-
-.lg 0
-..
-.de P2
-.ps \\n(PS
-.vs \\n(VSp
-.nr P \\n(PS
-.nr S \\n(PS+1
-.nr s \\n(PS-1
-.ft R
-.if n .ls 2
-.fi
-.DE
-.tr --
-.tr ''
-.lg
-..
-.nr PI .2i
diff --git a/.ref-Research-V7/usr/doc/beginners/u0 b/.ref-Research-V7/usr/doc/beginners/u0
deleted file mode 100644 (file)
index a8a4d3f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-...TM 78-1273-8
-...ND October 2, 1978
-...old TM -74-1273-18, October 29, 1974
-.RP
-.TL
-UNIX For Beginners \(em
-Second Edition
-.AU
-Brian W. Kernighan
-.AI
-.MH
-.AB
-.PP
-This paper is meant to help
-new users get started on
-the
-.UX
-operating system.
-It includes:
-.IP "\ \(bu"
-basics needed for day-to-day use of the system \(em
-typing commands, correcting typing mistakes, logging in and out,
-mail, inter-terminal communication,
-the file system, printing files,
-redirecting I/O, pipes, and the shell.
-.IP "\ \(bu"
-document preparation \(em
-a brief discussion of the major formatting programs
-and macro packages,
-hints on preparing documents,
-and capsule descriptions of some supporting software.
-.IP "\ \(bu"
-.UC UNIX
-programming \(em
-using the editor, programming the shell, programming in C,
-other languages and tools.
-.IP "\ \(bu"
-An annotated
-.UC UNIX
-bibliography.
-.AE
diff --git a/.ref-Research-V7/usr/doc/beginners/u1 b/.ref-Research-V7/usr/doc/beginners/u1
deleted file mode 100644 (file)
index 3032c79..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-.nr PS 9
-.if t .nr VS 11
-.if n .ls 2
-.if t .2C
-.nr PI .25i
-.SH
-INTRODUCTION
-.PP
-From the user's point of view,
-the
-.UC UNIX
-operating system
-is easy
-to learn and use,
-and presents few of the usual impediments
-to getting the job done.
-It is hard, however, for the beginner
-to know where to start,
-and how to make the best use 
-of the facilities available.
-The purpose of this introduction
-is to help new users
-get used to the main ideas of 
-the
-.UC UNIX
-system
-and start making effective use of it quickly.
-.PP
-You should have a couple of other documents with you
-for easy reference as you read this one.
-The most important is
-.ul
-The
-.ul
-.UC UNIX
-.IT Programmer's
-.IT Manual \|;
-it's often easier to tell you to read about something
-in the manual
-than to repeat its contents here.
-The other useful document is
-.ul
-A Tutorial Introduction to the
-.ul
-.UC UNIX
-.ul
-Text Editor,
-which will tell you how to use the editor
-to get text \(em
-programs, data, documents \(em
-into the computer.
-.PP
-A word of warning:
-the
-.UC UNIX
-system
-has become quite popular,
-and there are several major variants
-in widespread use.
-Of course details also change with time.
-So although the basic structure of 
-.UC UNIX
-and how to use it is common to all versions,
-there will certainly be a few things
-which are different on your system from
-what is described here.
-We have tried to minimize the problem,
-but be aware of it.
-In cases of doubt,
-this paper describes Version 7 
-.UC UNIX .
-.PP
-This paper has five sections:
-.IP "\ \ 1."
-Getting Started:
-How to log in,
-how to type,
-what to do about mistakes in typing,
-how to log out.
-Some of this is dependent on which
-system
-you log into
-(phone numbers, for example)
-and what terminal you use,
-so this section must necessarily be supplemented
-by local information.
-.IP "\ \ 2."
-Day-to-day Use:
-Things you need every day to use
-the system
-effectively:
-generally useful commands;
-the file system.
-.IP "\ \ 3."
-Document Preparation:
-Preparing manu\%scripts is one of the most common uses
-for
-.UC UNIX
-systems.
-This section contains advice,
-but not
-extensive instructions on any
-of the formatting tools.
-.IP "\ \ 4."
-Writing Programs:
-.UC UNIX
-is an excellent system for developing programs.
-This section talks about some of the tools,
-but again is not a tutorial in any of the programming languages
-provided by the system.
-.IP "\ \ 5."
-A
-.UC UNIX
-Reading List.
-An annotated bibliography of 
-documents that new users should be aware of.
-.SH
-I.  GETTING STARTED
-.SH
-Logging In
-.PP
-You must have a 
-.UC UNIX
-login name, which you can get from
-whoever administers your system.
-You also need to know the phone number,
-unless your system uses permanently connected terminals.
-The
-.UC UNIX
-system
-is capable of dealing with a wide variety of terminals:
-Terminet 300's; Execuport, TI and similar
-portables;
-video (CRT) terminals like the HP2640, etc.;
-high-priced graphics terminals like the Tektronix 4014;
-plotting terminals like those from GSI and DASI;
-and even the venerable
-Teletype in its various forms.
-But note:
-.UC UNIX
-is strongly oriented towards devices with 
-.ul
-lower case.
-If your terminal produces only upper case (e.g., model 33 Teletype, some video and portable terminals),
-life will be so difficult that you should look for another
-terminal.
-.PP
-Be sure to set the switches appropriately on your device.
-Switches that might need to be adjusted include the speed,
-upper/lower case mode,
-full duplex, even parity, and any others
-that local wisdom advises.
-Establish a connection using whatever
-magic is needed for your terminal;
-this may involve dialing a telephone call or merely flipping a switch.
-In either case,
-.UC UNIX
-should type
-.UL login: '' ``
-at you.
-If it types garbage, you may be at the wrong speed;
-check the switches.
-If that fails,
-push the ``break'' or ``interrupt'' key a few times, slowly.
-If that fails to produce a login message, consult a guru.
-.PP
-When you get a
-.UL login:
-message,
-type your
-login name
-.ul
-in lower case.
-Follow it by a 
-.UC RETURN ;
-the system will not do anything until you type a
-.UC RETURN .
-If a password is required,
-you will be asked for it,
-and (if possible)
-printing will be turned off while you type it.
-Don't forget
-.UC RETURN .
-.PP
-The culmination of your login efforts is a
-``prompt character,''
-a single character that indicates that
-the system
-is ready to accept commands from you.
-The prompt character is usually a 
-dollar sign
-.UL $
-or a
-percent sign
-.UL % .
-(You may also get a message of the day just before the
-prompt character, or a notification that you have mail.)
-.SH
-Typing Commands
-.PP
-Once you've seen the prompt character, you can type commands,
-which are
-requests that
-the system
-do something.
-Try typing
-.P1
-date
-.P2
-followed by 
-.UC RETURN.
-You should get back something like
-.P1
-Mon Jan 16 14:17:10 EST 1978
-.P2
-Don't forget the
-.UC RETURN
-after the command,
-or nothing will happen.
-If you think you're being ignored,
-type a
-.UC RETURN ;
-something should happen.
-.UC RETURN
-won't be mentioned
-again,
-but don't forget it \(em
-it has to be there
-at the end of each line.
-.PP
-Another command you might try is
-.UL who ,
-which tells you everyone who is currently logged in:
-.P1
-who
-.P2
-gives something like
-.P1
-.ta .5i 1i
-mb     tty01   Jan 16    09:11
-ski    tty05   Jan 16    09:33
-gam    tty11   Jan 16    13:07
-.P2
-The time is when the user logged in;
-``ttyxx'' is the system's idea of what terminal
-the user is on.
-.PP
-If you make a mistake typing the command name,
-and refer to a non-existent command,
-you will be told.
-For example, if you type
-.P1
-whom
-.P2
-you will be told 
-.P1
-whom: not found
-.P2
-Of course, if you inadvertently type the name of some other command,
-it will run,
-with more or less mysterious results.
-.SH
-Strange Terminal Behavior
-.PP
-Sometimes you can get into a state
-where your terminal acts strangely.
-For example,
-each letter may be typed twice,
-or the
-.UC RETURN
-may not cause a line feed
-or a return to the left margin.
-You can often fix this by logging out and logging back in.
-Or you can read the description of the command
-.UL stty
-in section I of the manual.
-To get intelligent treatment of
-tab characters
-(which are much used in
-.UC UNIX )
-if your terminal doesn't have tabs,
-type the command
-.P1
-stty \-tabs
-.P2
-and the system will convert each tab into the right number
-of blanks for you.
-If your terminal does have computer-settable tabs,
-the command
-.UL tabs
-will set the stops correctly for you.
-.SH
-Mistakes in Typing
-.PP
-If you make a typing mistake, and see it before
-.UC RETURN
-has been typed,
-there are two ways to recover.
-The sharp-character
-.UL #
-erases the last character typed;
-in fact successive uses of
-.UL #
-erase characters back to
-the beginning of the line (but not beyond).
-So if you type badly, you can correct as you go:
-.P1
-dd#atte##e
-.P2
-is the same as
-.UL date .
-.PP
-The at-sign
-.UL @
-erases all of the characters
-typed so far
-on the current input line,
-so if the line is irretrievably fouled up, type an
-.UL @
-and start the line over.
-.PP
-What if you must enter a sharp or at-sign
-as part of the text?
-If you precede either
-.UL #
-or
-.UL @
-by a backslash
-.UL \e ,
-it loses its erase meaning.
-So to enter a sharp or at-sign in something, type
-.UL \e# 
-or
-.UL \e@ .
-The system will always echo a newline at you after your at-sign,
-even if preceded by a backslash.
-Don't worry \(em
-the at-sign has been recorded.
-.PP
-To erase a backslash,
-you have to type two sharps or two at-signs, as in
-.UL \e## .
-The backslash is used extensively in
-.UC UNIX
-to indicate that the following character is in some way special.
-.SH
-Read-ahead
-.PP
-.UC UNIX
-has full read-ahead,
-which means that you can type as fast as you want,
-whenever you want,
-even when some command is typing at you.
-If you type during output,
-your input characters will appear intermixed with the output characters,
-but they will be stored away
-and interpreted in the correct order.
-So you can type several commands one after another without
-waiting for the first to finish or even begin.
-.SH
-Stopping a Program
-.PP
-You can stop most programs by
-typing the character
-.UC DEL '' ``
-(perhaps called ``delete'' or ``rubout'' on your terminal).
-The ``interrupt'' or ``break'' key found on most terminals
-can also be used.
-In a few programs, like the text editor,
-.UC DEL
-stops whatever the program is doing but leaves you in that program.
-Hanging up the phone will stop most programs.
-.SH
-Logging Out
-.PP
-The easiest way to log out is to hang up the phone.
-You can also type
-.P1
-login
-.P2
-and let someone else use the terminal you were on.
-It is usually not sufficient just to turn off the terminal.
-Most
-.UC UNIX
-systems
-do not use a time-out mechanism, so you'll be
-there forever unless you hang up.
-.SH
-Mail
-.PP
-When you log in, you may sometimes get the message
-.P1
-You have mail.
-.P2
-.UC UNIX
-provides a postal system so you can
-communicate with
-other users of the system.
-To read your mail,
-type the command
-.P1
-mail
-.P2
-Your mail will be printed,
-one message at a time,
-most recent message first.
-After each message,
-.UL mail
-waits for you to say what to do with it.
-The two basic responses are
-.UL d ,
-which deletes the message,
-and
-.UC RETURN ,
-which does not
-(so it will still be there the next time you read your mailbox).
-Other responses are described in the manual.
-(Earlier versions of
-.UL mail
-do not process one message at a time,
-but are otherwise similar.)
-.PP
-How do you send mail to someone else?
-Suppose it is to go to ``joe'' (assuming ``joe'' is someone's login name).
-The easiest way is this:
-.P1
-mail joe
-.ft I
-now type in the text of the letter
-on as many lines as you like ...
-After the last line of the letter
-type the character ``control-d'',
-that is, hold down ``control'' and type
-a letter ``d''.
-.P2
-And that's it.
-The ``control-d'' sequence, often called ``EOF'' for end-of-file, is used throughout 
-the system
-to mark the end of input from a terminal,
-so you might as well get used to it.
-.PP
-For practice, send mail to yourself.
-(This isn't as strange as it might sound \(em
-mail to oneself is a handy reminder mechanism.)
-.PP
-There are other ways to send mail \(em
-you can send a previously prepared letter,
-and you can mail to a number of people all at once.
-For more details see
-.UL mail (1).
-(The notation
-.UL mail (1)
-means the command 
-.UL mail
-in section 1
-of the
-.ul
-.UC UNIX
-.ul
-.IT Programmer's
-.IT Manual .)
-.SH
-Writing to other users
-.PP
-At some point, 
-out of the blue will come a message
-like
-.P1
-Message from joe tty07...
-.P2
-accompanied by a startling beep.
-It means that Joe wants to talk to you,
-but unless you take explicit action you won't be able to talk back.
-To respond,
-type the command
-.P1
-write joe
-.P2
-This establishes a two-way communication path.
-Now whatever Joe types on his terminal will appear on yours
-and vice versa.
-The path is slow, rather like talking to the moon.
-(If you are in the middle of something, you have to
-get to a state where you can type a command.
-Normally, whatever program you are running has to terminate or be terminated.
-If you're editing, you can escape temporarily from the editor \(em
-read the editor tutorial.)
-.PP
-A protocol is needed to keep what you type from getting
-garbled up with what Joe types. 
-Typically it's like this:
-.P1
-.tr --
-.fi
-.ft R
-Joe types
-.UL write
-.UL smith
-and waits.
-.br
-Smith types
-.UL write
-.UL joe
-and waits.
-.br
-Joe now types his message
-(as many lines as he likes).
-When he's ready for a reply, he
-signals it by typing
-.UL (o) ,
-which
-stands for ``over''.
-.br
-Now Smith types a reply, also
-terminated by
-.UL (o) .
-.br
-This cycle repeats until
-someone gets tired; he then
-signals his intent to quit with
-.UL (oo) ,
-for ``over
-and out''.
-.br
-To terminate
-the conversation, each side must
-type a ``control-d'' character alone
-on a line. (``Delete'' also works.)
-When the other person types his ``control-d'',
-you will get the message
-.UL EOF
-on your terminal.
-.P2
-.PP
-If you write to someone who isn't logged in,
-or who doesn't want to be disturbed,
-you'll be told.
-If the target is logged in but doesn't answer
-after a decent interval,
-simply type ``control-d''.
-.SH
-On-line Manual
-.PP
-The 
-.ul
-.UC UNIX
-.ul
-Programmer's Manual
-is typically kept on-line.
-If you get stuck on something,
-and can't find an expert to assist you,
-you can print on your terminal some manual section that might help.
-This is also useful for getting the most up-to-date
-information on a command.
-To print a manual section, type
-``man command-name''.
-Thus to read up on the 
-.UL who
-command,
-type
-.P1
-man who
-.P2
-and, of course,
-.P1
-man man
-.P2
-tells all about the
-.UL man
-command.
-.SH
-Computer Aided Instruction
-.PP
-Your
-.UC UNIX
-system may have available
-a program called
-.UL learn ,
-which provides computer aided instruction on
-the file system and basic commands,
-the editor,
-document preparation,
-and even C programming.
-Try typing the command
-.P1
-learn
-.P2
-If 
-.UL learn
-exists on your system,
-it will tell you what to do from there.
diff --git a/.ref-Research-V7/usr/doc/beginners/u2 b/.ref-Research-V7/usr/doc/beginners/u2
deleted file mode 100644 (file)
index b8c202b..0000000
+++ /dev/null
@@ -1,1180 +0,0 @@
-.SH
-II.  DAY-TO-DAY USE
-.SH
-Creating Files \(em The Editor
-.PP
-If you have to type a paper or a letter or a program,
-how do you get the information stored in the machine?
-Most of these tasks are done with
-the
-.UC UNIX
-``text editor''
-.UL ed .
-Since
-.UL ed
-is thoroughly documented in 
-.UL ed (1) 
-and explained in
-.ul
-A Tutorial Introduction to the UNIX Text Editor,
-we won't spend any time here describing how to use it.
-All we want it for right now is to make some
-.ul
-files.
-(A file is just a collection of information stored in the machine,
-a simplistic but adequate definition.)
-.PP
-To create a file 
-called
-.UL junk
-with some text in it, do the following:
-.P1
-.ta .65i
-ed junk        \fR(invokes the text editor)\f3
-a      \fR(command to ``ed'', to add text)\f3
-.ft I
-now type in
-whatever text you want ...
-.ft 3
-\&.    \fR(signals the end of adding text)\f3
-.P2
-The ``\f3.\fR'' that signals the end of adding text must be
-at the beginning of a line by itself.
-Don't forget it,
-for until it is typed,
-no other
-.UL ed
-commands will be recognized \(em
-everything you type will be treated as text to be added.
-.PP
-At this point you can do various editing operations
-on the text you typed in, such as correcting spelling mistakes,
-rearranging paragraphs and the like.
-Finally, you must write the information you have typed
-into a file with the editor command
-.UL w :
-.P1
-w
-.P2
-.UL ed
-will respond with the number of characters it wrote
-into the file 
-.UL junk .
-.PP
-Until the
-.UL w
-command,
-nothing is stored permanently,
-so if you hang up and go home
-the information is lost.\(dg
-.FS
-\(dg This is not strictly true \(em
-if you hang up while editing, the data you were
-working on is saved in a file called
-.UL ed.hup ,
-which you can continue with at your next session.
-.FE
-But after
-.UL w
-the information is there permanently;
-you can re-access it any time by typing
-.P1
-ed junk
-.P2
-Type a
-.UL q
-command
-to quit the editor.
-(If you try to quit without writing,
-.UL ed
-will print a
-.UL ?
-to remind you.
-A second
-.UL q
-gets you out regardless.)
-.PP
-Now create a second file called 
-.UL temp
-in the same manner.
-You should now have two files,
-.UL junk
-and
-.UL temp .
-.SH
-What files are out there?
-.PP
-The
-.UL ls
-(for ``list'') command lists the names
-(not contents)
-of any of the files that
-.UC UNIX
-knows about.
-If you type
-.P1
-ls
-.P2
-the response will be
-.P1
-junk
-temp
-.P2
-which are indeed the two files just created.
-The names are sorted into alphabetical order automatically,
-but other variations are possible.
-For example,
-the command
-.P1
-ls -t
-.P2
-causes the files to be listed in the order in which they were last changed,
-most recent first.
-The
-.UL \-l
-option gives a ``long'' listing:
-.P1
-ls -l
-.P2
-will produce something like
-.P1
--rw-rw-rw-  1 bwk   41 Jul 22 2:56 junk
--rw-rw-rw-  1 bwk   78 Jul 22 2:57 temp
-.P2
-The date and time are of the last change to the file.
-The 41 and 78 are the number of characters
-(which should agree with the numbers you got from
-.UL ed ).
-.UL bwk
-is the owner of the file, that is, the person
-who created it.
-The
-.UL \-rw\-rw\-rw\- 
-tells who has permission to read and write the file,
-in this case everyone.
-.PP
-Options can be combined:
-.UL ls\ \-lt
-gives the same thing as
-.UL ls\ \-l ,
-but sorted into time order.
-You can also name the files you're interested in,
-and 
-.UL ls
-will list the information about them only.
-More details can be found in 
-.UL ls (1).
-.PP
-The use of optional arguments that begin with a minus sign,
-like
-.UL \-t
-and
-.UL \-lt ,
-is a common convention for
-.UC UNIX
-programs.
-In general, if a program accepts such optional arguments,
-they precede any filename arguments.
-It is also vital that you separate the various arguments with spaces:
-.UL ls\-l
-is not the same as
-.UL ls\ \ \-l .
-.SH
-Printing Files
-.PP
-Now that you've got a file of text,
-how do you print it so people can look at it?
-There are a host of programs that do that,
-probably more than are needed.
-.PP
-One simple thing is to use the editor,
-since printing is often done just before making changes anyway.
-You can say
-.P1
-ed junk
-1,$p
-.P2
-.UL ed
-will reply with the count of the characters in 
-.UL junk
-and then print all the lines in the file.
-After you learn how to use the editor,
-you can be selective about the parts you print.
-.PP
-There are times when it's not feasible to use the editor for printing.
-For example, there is a limit on how big a file
-.UL ed
-can handle
-(several thousand lines).
-Secondly, 
-it
-will only print one file at a time,
-and sometimes you want to print several, one after another.
-So here are a couple of alternatives.
-.PP
-First is
-.UL cat ,
-the simplest of all the printing programs.
-.UL cat
-simply prints on the terminal the contents of all the files
-named in a list.
-Thus
-.P1
-cat junk
-.P2
-prints one file, and
-.P1
-cat junk temp
-.P2
-prints two.
-The files are simply concatenated (hence the name
-.UL cat '') ``
-onto the terminal.
-.PP
-.UL pr
-produces formatted printouts of files.
-As with 
-.UL cat ,
-.UL pr
-prints all the files named in a list.
-The difference is that it produces 
-headings with date, time, page number and file name
-at the top of each page,
-and
-extra lines to skip over the fold in the paper.
-Thus,
-.P1
-pr junk temp
-.P2
-will print
-.UL junk
-neatly,
-then skip to the top of a new page and print
-.UL temp
-neatly.
-.PP
-.UL pr
-can also produce multi-column output:
-.P1
-pr -3 junk 
-.P2
-prints
-.UL junk
-in 3-column format.
-You can use any reasonable number in place of ``3''
-and 
-.UL pr
-will do its best.
-.UL pr
-has other capabilities as well;
-see
-.UL pr (1).
-.PP
-It should be noted that
-.UL pr
-is
-.ul
-not
-a formatting program in the sense of shuffling lines around
-and justifying margins.
-The true formatters are
-.UL nroff
-and
-.UL troff ,
-which we will get to in the section on document preparation.
-.PP
-There are also programs that print files
-on a high-speed printer.
-Look in your manual under
-.UL opr
-and
-.UL lpr .
-Which to use depends on
-what equipment is attached to your machine.
-.SH
-Shuffling Files About
-.PP
-Now that you have some files in the file system
-and some experience in printing them,
-you can try bigger things.
-For example,
-you can move a file from one place to another
-(which amounts to giving it a new name),
-like this:
-.P1
-mv junk precious
-.P2
-This means that what used to be ``junk'' is now ``precious''.
-If you do an
-.UL ls
-command now,
-you will get
-.P1
-precious
-temp
-.P2
-Beware that if you move a file to another one
-that already exists,
-the already existing contents are lost forever.
-.PP
-If you want
-to make a
-.ul
-copy
-of a file (that is, to have two versions of something),
-you can use the 
-.UL cp
-command:
-.P1
-cp precious temp1
-.P2
-makes a duplicate copy of 
-.UL precious
-in
-.UL temp1 .
-.PP
-Finally, when you get tired of creating and moving
-files,
-there is a command to remove files from the file system,
-called
-.UL rm .
-.P1
-rm temp temp1
-.P2
-will remove both of the files named.
-.PP
-You will get a warning message if one of the named files wasn't there,
-but otherwise
-.UL rm ,
-like most
-.UC UNIX
-commands,
-does its work silently.
-There is no prompting or chatter,
-and error messages are occasionally curt.
-This terseness is sometimes disconcerting
-to new\%comers,
-but experienced users find it desirable.
-.SH
-What's in a Filename
-.PP
-So far we have used filenames without ever saying what's
-a legal name,
-so it's time for a couple of rules.
-First, filenames are limited to 14 characters,
-which is enough to be descriptive.
-Second, although you can use almost any character
-in a filename,
-common sense says you should stick to ones that are visible,
-and that you should probably avoid characters that might be used
-with other meanings.
-We have already seen, for example,
-that in the
-.UL ls
-command,
-.UL ls\ \-t
-means to list in time order.
-So if you had a file whose name
-was
-.UL \-t ,
-you would have a tough time listing it by name.
-Besides the minus sign, there are other characters which
-have special meaning.
-To avoid pitfalls,
-you would do well to 
-use only letters, numbers and the period
-until you're familiar with the situation.
-.PP
-On to some more positive suggestions.
-Suppose you're typing a large document
-like a book.
-Logically this divides into many small pieces,
-like chapters and perhaps sections.
-Physically it must be divided too,
-for 
-.UL ed
-will not handle really big files.
-Thus you should type the document as a number of files.
-You might have a separate file for each chapter,
-called
-.P1
-chap1
-chap2
-.ft R
-etc...
-.P2
-Or, if each chapter were broken into several files, you might have
-.P1
-chap1.1
-chap1.2
-chap1.3
-\&...
-chap2.1
-chap2.2
-\&...
-.P2
-You can now tell at a glance where a particular file fits into the whole.
-.PP
-There are advantages to a systematic naming convention which are not obvious
-to the novice
-.UC UNIX 
-user.
-What if you wanted to print the whole book?
-You could say
-.P1
-pr chap1.1 chap1.2 chap1.3 ......
-.P2
-but you would get tired pretty fast, and would probably even make mistakes.
-Fortunately, there is a shortcut.
-You can say
-.P1
-pr chap*
-.P2
-The
-.UL *
-means ``anything at all,''
-so this translates into ``print all files
-whose names begin with 
-.UL chap '',
-listed in alphabetical order.
-.PP
-This shorthand notation
-is not a property of the
-.UL pr
-command, by the way.
-It is system-wide, a service of the program
-that interprets commands
-(the ``shell,''
-.UL sh (1)).
-Using that fact, you can see how to list the names of the files in the book:
-.P1
-ls chap*
-.P2
-produces
-.P1
-chap1.1
-chap1.2
-chap1.3
-\&...
-.P2
-The
-.UL *
-is not limited to the last position in a filename \(em
-it can be anywhere
-and can occur several times.
-Thus
-.P1
-rm *junk* *temp*
-.P2
-removes all files that contain
-.UL junk
-or
-.UL temp
-as any part of their name.
-As a special case,
-.UL *
-by itself matches every filename,
-so
-.P1
-pr *
-.P2
-prints all your files
-(alphabetical order),
-and
-.P1
-rm *
-.P2
-removes
-.ul
-all files.
-(You had better be
-.IT  very 
-sure that's what you wanted to say!)
-.PP
-The
-.UL *
-is not 
-the only pattern-matching feature available.
-Suppose you want to print only chapters 1 through 4 and 9.
-Then you can say
-.P1
-pr chap[12349]*
-.P2
-The
-.UL [...]
-means to match any of the characters inside the brackets.
-A range of consecutive letters or digits can be abbreviated,
-so you can also do this 
-with
-.P1
-pr chap[1-49]*
-.P2
-Letters can also be used within brackets:
-.UL [a\-z]
-matches any character in the range
-.UL a
-through
-.UL z .
-.PP
-The
-.UL ?
-pattern matches any single character,
-so
-.P1
-ls ?
-.P2
-lists all files which have single-character names,
-and
-.P1
-ls -l chap?.1
-.P2
-lists information about the first file of each chapter
-.UL chap1.1 \&, (
-.UL chap2.1 ,
-etc.).
-.PP
-Of these niceties,
-.UL *
-is certainly the most useful,
-and you should get used to it.
-The others are frills, but worth knowing.
-.PP
-If you should ever have to turn off the special meaning
-of
-.UL * ,
-.UL ? ,
-etc.,
-enclose the entire argument in single quotes,
-as in
-.P1
-ls \(fm?\(fm
-.P2
-We'll see some more examples of this shortly.
-.SH
-What's in a Filename, Continued
-.PP
-When you first made that file called
-.UL junk ,
-how did 
-the system
-know that there wasn't another
-.UL junk
-somewhere else,
-especially since the person in the next office is also
-reading this tutorial?
-The answer is that generally each user 
-has a private
-.IT directory ,
-which contains only the files that belong to him.
-When you log in, you are ``in'' your directory.
-Unless you take special action,
-when you create a new file,
-it is made in the directory that you are currently in;
-this is most often your own directory,
-and thus the file is unrelated to any other file of the same name
-that might exist in someone else's directory.
-.PP
-The set of all files
-is organized into a (usually big) tree,
-with your files located several branches into the tree.
-It is possible for you to ``walk'' around this tree,
-and to find any file in the system, by starting at the root
-of the tree and walking along the proper set of branches.
-Conversely, you can start where you are and walk toward the root.
-.PP
-Let's try the latter first.
-The basic tools is the command
-.UL pwd
-(``print working directory''),
-which prints the name of the directory you are currently in.
-.PP
-Although the details will vary according to the system you are on,
-if you give the
-command
-.UL pwd ,
-it will print something like
-.P1
-/usr/your\(hyname
-.P2
-This says that you are currently in the directory
-.UL your-name ,
-which is in turn in the directory
-.UL /usr ,
-which is in turn in the root directory
-called by convention just
-.UL / .
-(Even if it's not called
-.UL /usr
-on your system,
-you will get something analogous.
-Make the corresponding changes and read on.)
-.PP
-If you now type
-.P1
-ls /usr/your\(hyname
-.P2
-you should get exactly the same list of file names
-as you get from a plain
-.UL ls  :
-with no arguments,
-.UL ls
-lists the contents of the current directory;
-given the name of a directory,
-it lists the contents of that directory.
-.PP
-Next, try
-.P1
-ls /usr
-.P2
-This should print a long series of names,
-among which is your own login name
-.UL your-name .
-On many systems, 
-.UL usr
-is a directory that contains the directories
-of all the normal users of the system,
-like you.
-.PP
-The next step is to try
-.P1
-ls /
-.P2
-You should get a response something like this
-(although again the details may be different):
-.P1
-bin
-dev
-etc
-lib
-tmp
-usr
-.P2
-This is a collection of the basic directories of files
-that
-the system
-knows about;
-we are at the root of the tree.
-.PP
-Now try
-.P1
-cat /usr/your\(hyname/junk
-.P2
-(if
-.UL junk
-is still around in your directory).
-The name
-.P1
-/usr/your\(hyname/junk
-.P2
-is called the
-.UL pathname
-of the file that
-you normally think of as ``junk''.
-``Pathname'' has an obvious meaning:
-it represents the full name of the path you have to follow from the root
-through the tree of directories to get to a particular file.
-It is a universal rule in
-the
-.UC UNIX
-system
-that anywhere you can use an ordinary filename,
-you can use a pathname.
-.PP
-Here is a picture which may make this clearer:
-.P1 1
-.ft R
-.if t .vs 9p
-.if t .tr /\(sl
-.if t .tr ||
-.ce 100
-(root)
-/ | \e
-/  |  \e
-/   |   \e
-  bin    etc    usr    dev   tmp 
-/ | \e   / | \e   / | \e   / | \e   / | \e
-/  |  \e
-/   |   \e
-adam  eve   mary
-/        /   \e        \e
-             /     \e       junk
-junk temp
-.ce 0
-.br
-.tr //
-.P2
-.LP
-Notice that Mary's
-.UL junk
-is unrelated to Eve's.
-.PP
-This isn't too exciting if all the files of interest are in your own
-directory, but if you work with someone else
-or on several projects concurrently,
-it becomes handy indeed.
-For example, your friends can print your book by saying
-.P1
-pr /usr/your\(hyname/chap*
-.P2
-Similarly, you can find out what files your neighbor has
-by saying
-.P1
-ls /usr/neighbor\(hyname
-.P2
-or make your own copy of one of his files by
-.P1
-cp /usr/your\(hyneighbor/his\(hyfile yourfile
-.P2
-.PP
-If your neighbor doesn't want you poking around in his files,
-or vice versa,
-privacy can be arranged.
-Each file and directory has read-write-execute permissions for the owner,
-a group, and everyone else,
-which can be set
-to control access.
-See
-.UL ls (1)
-and
-.UL chmod (1)
-for details.
-As a matter of observed fact,
-most users most of the time find openness of more
-benefit than privacy.
-.PP
-As a final experiment with pathnames, try
-.P1
-ls /bin /usr/bin
-.P2
-Do some of the names look familiar?
-When you run a program, by typing its name after the prompt character,
-the system simply looks for a file of that name.
-It normally looks first in your directory
-(where it typically doesn't find it),
-then in
-.UL /bin
-and finally in
-.UL /usr/bin .
-There is nothing magic about commands like
-.UL cat
-or
-.UL ls ,
-except that they have been collected into a couple of places to be easy to find and administer.
-.PP
-What if you work regularly with someone else on common information
-in his directory?
-You could just log in as your friend each time you want to,
-but you can also say
-``I want to work on his files instead of my own''.
-This is done by changing the directory that you are
-currently in:
-.P1
-cd /usr/your\(hyfriend
-.P2
-(On some systems,
-.UL cd
-is spelled
-.UL chdir .)
-Now when you use a filename in something like
-.UL cat
-or
-.UL pr ,
-it refers to the file in your friend's directory.
-Changing directories doesn't affect any permissions associated
-with a file \(em
-if you couldn't access a file from your own directory,
-changing to another directory won't alter that fact.
-Of course,
-if you forget what directory you're in, type
-.P1
-pwd
-.P2
-to find out.
-.PP
-It is usually convenient to arrange your own files
-so that all the files related to one thing are in a directory separate
-from other projects.
-For example, when you write your book, you might want to keep all the text
-in a directory called
-.UL book .
-So make one with
-.P1
-mkdir book
-.P2
-then go to it with
-.P1
-cd book
-.P2
-then start typing chapters.
-The book is now found in (presumably)
-.P1
-/usr/your\(hyname/book
-.P2
-To remove the directory
-.UL book ,
-type
-.P1
-rm book/*
-rmdir book
-.P2
-The first command removes all files from the directory;
-the second
-removes the empty directory.
-.PP
-You can go up one level in the tree of files 
-by saying
-.P1
-cd ..
-.P2
-.UL .. '' ``
-is the name of the parent of whatever directory you are currently in.
-For completeness,
-.UL . '' ``
-is an alternate name
-for the directory you are in.
-.SH
-Using Files instead of the Terminal
-.PP
-Most of the commands we have seen so far produce output
-on the terminal;
-some, like the editor, also take their input from the terminal.
-It is universal in
-.UC UNIX
-systems
-that the terminal can be replaced by a file
-for either or both of input and output.
-As one example,
-.P1
-ls
-.P2
-makes a list of files on your terminal.
-But if you say
-.P1
-ls >filelist
-.P2
-a list of your files will be placed in the file
-.UL filelist
-(which
-will be created if it doesn't already exist,
-or overwritten if it does).
-The symbol
-.UL >
-means ``put the output on the following file,
-rather than on the terminal.''
-Nothing is produced on the terminal.
-As another example, you could combine
-several files into one by capturing the output of
-.UL cat
-in a file:
-.P1
-cat f1 f2 f3 >temp
-.P2
-.PP
-The symbol
-.UL >>
-operates very much like
-.UL >
-does,
-except that it means
-``add to the end of.''
-That is,
-.P1
-cat f1 f2 f3 >>temp
-.P2
-means to concatenate
-.UL f1 ,
-.UL f2 
-and
-.UL f3
-to the end of whatever is already in
-.UL temp ,
-instead of overwriting the existing contents.
-As with
-.UL > ,
-if 
-.UL temp
-doesn't exist, it will be created for you.
-.PP
-In a similar way, the symbol
-.UL <
-means to take the input
-for a program from the following file,
-instead of from the terminal.
-Thus, you could make up a script of commonly used editing commands
-and put them into a file called
-.UL script .
-Then you can run the script on a file by saying
-.P1
-ed file <script
-.P2
-As another example, you can use
-.UL ed
-to prepare a letter in file
-.UL let ,
-then send it to several people with
-.P1
-mail adam eve mary joe <let
-.P2
-.SH
-Pipes
-.PP
-One of the novel contributions of
-the
-.UC UNIX
-system
-is the idea of a
-.ul
-pipe.
-A pipe is simply a way to connect the output of one program
-to the input of another program,
-so the two run as a sequence of processes \(em
-a pipeline.
-.PP
-For example,
-.P1
-pr f g h
-.P2
-will print the files
-.UL f ,
-.UL g ,
-and
-.UL h ,
-beginning each on a new page.
-Suppose you want
-them run together instead.
-You could say
-.P1
-cat f g h >temp
-pr <temp
-rm temp
-.P2
-but this is more work than necessary.
-Clearly what we want is to take the output of
-.UL cat
-and
-connect it to the input of
-.UL pr .
-So let us use a pipe:
-.P1
-cat f g h | pr
-.P2
-The vertical bar 
-.UL |
-means to
-take the output from
-.UL cat ,
-which would normally have gone to the terminal,
-and put it into
-.UL pr
-to be neatly formatted.
-.PP
-There are many other examples of pipes.
-For example,
-.P1
-ls | pr -3
-.P2
-prints a list of your files in three columns.
-The program
-.UL wc
-counts the number of lines, words and characters in
-its input, and as we saw earlier,
-.UL who
-prints a list of currently-logged on people,
-one per line.
-Thus
-.P1
-who | wc
-.P2
-tells how many people are logged on.
-And of course
-.P1
-ls | wc
-.P2
-counts your files.
-.PP
-Any program
-that reads from the terminal
-can read from a pipe instead;
-any program that writes on the terminal can drive
-a pipe.
-You can have as many elements in a pipeline as you wish.
-.PP
-Many
-.UC UNIX
-programs are written so that they will take their input from one or more files
-if file arguments are given;
-if no arguments are given they will read from the terminal,
-and thus can be used in pipelines.
-.UL pr
-is one example:
-.P1
-pr -3 a b c
-.P2
-prints files
-.UL a ,
-.UL b
-and
-.UL c
-in order in three columns.
-But in
-.P1
-cat a b c | pr -3
-.P2
-.UL pr
-prints the information coming down the pipeline,
-still in
-three columns.
-.SH
-The Shell
-.PP
-We have already mentioned once or twice the mysterious
-``shell,''
-which is in fact
-.UL sh (1).
-The shell is the program that interprets what you type as
-commands and arguments.
-It also looks after translating
-.UL * ,
-etc.,
-into lists of filenames,
-and
-.UL < ,
-.UL > ,
-and
-.UL |
-into changes of input and output streams.
-.PP
-The shell has other capabilities too.
-For example, you can run two programs with one command line
-by separating the commands with a semicolon;
-the shell recognizes the semicolon and
-breaks the line into two commands.
-Thus
-.P1
-date; who
-.P2
-does both commands before returning with a prompt character.
-.PP
-You can also have more than one program running
-.ul
-simultaneously
-if you wish.
-For example, if you are doing something time-consuming,
-like the editor script
-of an earlier section,
-and you don't want to wait around for the results before starting something else,
-you can say
-.P1
-ed file <script &
-.P2
-The ampersand at the end of a command line
-says ``start this command running,
-then take further commands from the terminal immediately,''
-that is,
-don't wait for it to complete.
-Thus the script will begin,
-but you can do something else at the same time.
-Of course, to keep the output from interfering
-with what you're doing on the terminal,
-it would be better to say
-.P1
-ed file <script >script.out &
-.P2
-which saves the output lines in a file
-called
-.UL script.out .
-.PP
-When you initiate a command with
-.UL & ,
-the system
-replies with a number
-called the process number,
-which identifies the command in case you later want
-to stop it.
-If you do, you can say
-.P1
-kill process\(hynumber
-.P2
-If you forget the process number,
-the command
-.UL ps
-will tell you about everything you have running.
-(If you are desperate,
-.UL kill\ 0
-will kill all your processes.)
-And if you're curious about other people,
-.UL ps\ a
-will tell you about
-.ul
-all
-programs that are currently running.
-.PP
-You can say
-.P1 1
-(command\(hy1; command\(hy2; command\(hy3) &
-.P2
-to start three commands in the background,
-or you can start a background pipeline with
-.P1
-command\(hy1 | command\(hy2 &
-.P2
-.PP
-Just as you can tell the editor
-or some similar program to take its input
-from a file instead of from the terminal,
-you can tell the shell to read a file
-to get commands.
-(Why not? The shell, after all, is just a program,
-albeit a clever one.)
-For instance, suppose you want to set tabs on
-your terminal, and find out the date
-and who's on the system every time you log in.
-Then you can put the three necessary commands
-.UL tabs , (
-.UL date ,
-.UL who )
-into a file, let's call it
-.UL startup ,
-and then run it with
-.P1
-sh startup
-.P2
-This says to run the shell with the file
-.UL startup
-as input.
-The effect is as if you had typed 
-the contents of
-.UL startup
-on the terminal.
-.PP
-If this is to be a regular thing,
-you can eliminate the 
-need to type
-.UL sh :
-simply type, once only, the command
-.P1
-chmod +x startup
-.P2
-and thereafter you need only say
-.P1
-startup
-.P2
-to run the sequence of commands.
-The
-.UL chmod (1)
-command marks the file executable;
-the shell recognizes this and runs it as a sequence of commands.
-.PP
-If you want 
-.UL startup
-to run automatically every time you log in,
-create a file in your login directory called
-.UL .profile ,
-and place in it the line
-.UL startup .
-When the shell first gains control when you log in,
-it looks for the 
-.UL .profile
-file and does whatever commands it finds in it.
-We'll get back to the shell in the section
-on programming.
diff --git a/.ref-Research-V7/usr/doc/beginners/u3 b/.ref-Research-V7/usr/doc/beginners/u3
deleted file mode 100644 (file)
index f82a445..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-.sp
-.SH
-III. DOCUMENT PREPARATION
-.PP
-.UC UNIX
-systems are used extensively for document preparation.
-There are two major 
-formatting
-programs,
-that is,
-programs that produce a text with
-justified right margins, automatic page numbering and titling,
-automatic hyphenation,
-and the like.
-.UL nroff
-is designed to produce output on terminals and
-line-printers.
-.UL troff
-(pronounced ``tee-roff'')
-instead drives a phototypesetter,
-which produces very high quality output
-on photographic paper.
-This paper was formatted with
-.UL troff .
-.SH
-Formatting Packages
-.PP
-The basic idea of
-.UL nroff 
-and 
-.UL troff
-is that the text to be formatted contains within it
-``formatting commands'' that indicate in detail
-how the formatted text is to look.
-For example, there might be commands that specify how long
-lines are, whether to use single or double spacing,
-and what running titles to use on each page.
-.PP
-Because
-.UL nroff
-and
-.UL troff
-are relatively hard to learn to use effectively,
-several
-``packages'' of canned formatting requests are available
-to let you specify
-paragraphs, running titles, footnotes, multi-column output,
-and so on, with little effort
-and without having to learn
-.UL nroff
-and
-.UL troff .
-These packages take a modest effort to learn,
-but the rewards for using them are so great
-that it is time well spent.
-.PP
-In this section,
-we will provide a hasty look at the ``manuscript'' 
-package known as
-.UL \-ms .
-Formatting requests typically consist of a period and two upper-case letters,
-such as
-.UL .TL ,
-which is used to introduce a title,
-or
-.UL .PP
-to begin a new paragraph.
-.PP
-A document is typed so it looks something like this:
-.P1
-\&.TL
-title of document
-\&.AU
-author name
-\&.SH
-section heading
-\&.PP
-paragraph ...
-\&.PP
-another paragraph ...
-\&.SH
-another section heading
-\&.PP
-etc.
-.P2
-The lines that begin with a period are the formatting requests.
-For example,
-.UL .PP
-calls for starting a new paragraph.
-The precise meaning of
-.UL .PP
-depends on what output device is being used
-(typesetter or terminal, for instance),
-and on what publication the document will appear in.
-For example,
-.UL \-ms
-normally assumes that a paragraph is preceded by a space
-(one line in
-.UL nroff ,
-\(12 line in
-.UL troff ),
-and the first word is indented.
-These rules can be changed if you like,
-but they are changed by changing the interpretation
-of
-.UL .PP ,
-not by re-typing the document.
-.PP
-To actually produce a document in standard format
-using
-.UL \-ms ,
-use the command
-.P1
-troff -ms files ...
-.P2
-for the typesetter, and
-.P1
-nroff -ms files ...
-.P2
-for a terminal.
-The
-.UL \-ms
-argument tells
-.UL troff
-and
-.UL nroff
-to use the manuscript package of formatting requests.
-.PP
-There are several similar packages;
-check with a local expert to determine which ones
-are in common use on your machine.
-.SH
-Supporting Tools
-.PP
-In addition to the basic formatters,
-there is
-a host of supporting programs
-that help with document preparation.
-The list in the next few paragraphs
-is far from complete,
-so browse through the manual
-and check with people around you for other possibilities.
-.PP
-.UL eqn
-and
-.UL neqn
-let you integrate mathematics
-into the text of a document,
-in an easy-to-learn language that closely resembles the way
-you would speak it aloud.
-For example, the
-.UL eqn
-input
-.P1
-sum from i=0 to n x sub i ~=~ pi over 2
-.P2
-produces the output
-.EQ
-sum from i=0 to n x sub i ~=~ pi over 2
-.EN
-.PP
-The program
-.UL tbl
-provides an analogous service for preparing tabular material;
-it does all the computations necessary to align complicated columns
-with elements of varying widths.
-.PP
-.UL refer
-prepares bibliographic citations from a data base,
-in whatever style is defined by the formatting package.
-It looks after all the details of numbering references in sequence,
-filling in page and volume numbers,
-getting the author's initials and the journal name right,
-and so on.
-.PP
-.UL spell
-and
-.UL typo
-detect possible spelling mistakes in a document.
-.UL spell
-works by comparing the words in your document
-to a dictionary,
-printing those that are not in the dictionary.
-It knows enough about English spelling to detect plurals and the like,
-so it does a very good job.
-.UL typo
-looks for words which are ``unusual'',
-and prints those.
-Spelling mistakes tend to be more unusual,
-and thus show up early when the most unusual words
-are printed first.
-.PP
-.UL grep
-looks through a set of files for lines
-that contain a particular text pattern 
-(rather like the editor's context search does,
-but on a bunch of files).
-For example,
-.P1
-grep \(fming$\(fm chap*
-.P2
-will find all lines that end with
-the letters
-.UL ing
-in the files
-.UL chap* .
-(It is almost always a good practice to put single quotes around
-the pattern you're searching for,
-in case it contains characters like
-.UL *
-or
-.UL $
-that have a special meaning to the shell.)
-.UL grep
-is often useful for finding out in which of a set of files
-the misspelled words detected by
-.UL spell
-are actually located.
-.PP
-.UL diff
-prints a list of the differences between
-two files,
-so you can compare
-two versions of something automatically
-(which certainly beats proofreading by hand).
-.PP
-.UL wc
-counts the words, lines and characters in a set of files.
-.UL tr
-translates characters into other characters;
-for example it will convert upper to lower case and vice versa.
-This translates upper into lower:
-.P1
-tr A-Z a-z <input >output
-.P2
-.PP
-.UL sort
-sorts files in a variety of ways;
-.UL cref
-makes cross-references;
-.UL ptx
-makes a permuted index
-(keyword-in-context listing).
-.UL sed
-provides many of the editing facilities
-of
-.UL ed ,
-but can apply them to arbitrarily long inputs.
-.UL awk
-provides the ability to do both pattern matching and numeric computations,
-and to conveniently process fields within lines.
-These programs are for more advanced users,
-and they are not limited to document preparation.
-Put them on your list of things to learn about.
-.PP
-Most of these programs are either independently documented
-(like
-.UL eqn
-and
-.UL tbl ),
-or are sufficiently simple that the description in
-the
-.ul 2
-.UC UNIX
-Programmer's Manual
-is adequate explanation.
-.SH
-Hints for Preparing Documents
-.PP
-Most documents go through several versions (always more than you expected) before they
-are finally finished.
-Accordingly, you should do whatever possible to make
-the job of changing them easy.
-.PP
-First, when you do the purely mechanical operations of typing,
-type so that subsequent editing will be easy.
-Start each sentence on a new line.
-Make lines short,
-and break lines at natural places,
-such as after commas and semicolons,
-rather than randomly.
-Since most people change documents by rewriting phrases
-and adding, deleting and rearranging sentences,
-these precautions simplify any editing
-you have to do later.
-.PP
-Keep the individual files of a document down
-to modest size,
-perhaps ten to fifteen thousand characters.
-Larger files edit more slowly,
-and of course if you make a dumb mistake
-it's better to have clobbered a small file than a big one.
-Split into files at natural boundaries in the document,
-for the same reasons that you start each sentence
-on a new line.
-.PP
-The second aspect of making change easy
-is to not commit yourself to formatting details too early.
-One of the advantages of formatting packages like
-.UL \-ms
-is that they permit you to delay decisions
-to the last possible moment.
-Indeed,
-until a document is printed,
-it is not even decided whether it will be typeset
-or put on a line printer.
-.PP
-As a rule of thumb, for all but the most trivial jobs,
-you should type a document in terms of a set of requests
-like
-.UL .PP ,
-and then define them appropriately,
-either by using one of the canned packages
-(the better way)
-or by defining your own
-.UL nroff
-and
-.UL troff
-commands.
-As long as you have entered the text in some systematic way,
-it can always be cleaned up and re-formatted
-by a judicious combination of
-editing commands and request definitions.
diff --git a/.ref-Research-V7/usr/doc/beginners/u4 b/.ref-Research-V7/usr/doc/beginners/u4
deleted file mode 100644 (file)
index f71f83f..0000000
+++ /dev/null
@@ -1,285 +0,0 @@
-.SH
-IV.  PROGRAMMING
-.PP
-There will be no attempt made to teach any of
-the programming languages available
-but a few words of advice are in order.
-One of the reasons why the
-.UC UNIX
-system is a productive programming environment
-is that there is already a rich set of tools available,
-and facilities like pipes, I/O redirection,
-and the capabilities of the shell
-often make it possible to do a job
-by pasting together programs that already exist
-instead of writing from scratch.
-.SH
-The Shell
-.PP
-The pipe mechanism lets you fabricate quite complicated operations
-out of spare parts that already exist.
-For example,
-the first draft of the
-.UL  spell 
-program was (roughly)
-.P1
-.ta .6i 1.2i
-cat ...        \f2collect the files\f3
-| tr ...       \f2put each word on a new line\f3
-| tr ...       \f2delete punctuation, etc.\f3
-| sort \f2into dictionary order\f3
-| uniq \f2discard duplicates\f3
-| comm \f2print words in text\f3
-       \f2  but not in dictionary\f3
-.P2
-More pieces have been added subsequently,
-but this goes a long way
-for such a small effort.
-.PP
-The editor can be made to do things that would normally
-require special programs on other systems.
-For example, to list the first and last lines of each of a
-set of files, such as a book,
-you could laboriously type
-.P1
-ed
-e chap1.1
-1p
-$p
-e chap1.2
-1p
-$p
-.ft R
-etc.
-.P2
-But you can do the job much more easily.
-One way is to type
-.P1
-ls chap* >temp
-.P2
-to get the list of filenames into a file.
-Then edit this file to make the necessary
-series of editing commands
-(using the global commands of
-.UL ed ),
-and write it into
-.UL script .
-Now the command
-.P1
-ed <script
-.P2
-will produce
-the same output as the laborious hand typing.
-Alternately
-(and more easily),
-you can use the fact that the shell will perform loops,
-repeating a set of commands over and over again
-for a set of arguments:
-.P1
-for i in chap*
-do
-       ed $i <script
-done
-.P2
-This sets the shell variable
-.UL i
-to each file name in turn,
-then does the command.
-You can type this command at the terminal,
-or put it in a file for later execution.
-.SH
-Programming the Shell
-.PP
-An option often overlooked by newcomers
-is that the shell is itself a programming language,
-with variables,
-control flow
-.UL if-else , (
-.UL while ,
-.UL for ,
-.UL case ),
-subroutines,
-and interrupt handling.
-Since
-there are
-many building-block programs,
-you can sometimes avoid writing a new program
-merely by piecing together some of the building blocks
-with shell command files.
-.PP
-We will not go into any details here;
-examples and rules can be found in
-.ul
-An Introduction to the
-.ul
-.UC UNIX
-.IT Shell ,
-by S. R. Bourne.
-.SH
-Programming in C
-.PP
-If you are undertaking anything substantial,
-C is the only reasonable choice of programming language:
-everything in
-the
-.UC UNIX
-system
-is tuned to it.
-The
-system
-itself
-is written in C,
-as are most of the programs that run on it.
-It is also a easy language to use
-once you get started.
-C is introduced and fully described in
-.ul
-The C Programming Language
-by
-B. W. Kernighan and D. M. Ritchie
-(Prentice-Hall, 1978).
-Several sections of the manual
-describe the system interfaces, that is,
-how you do I/O
-and similar functions.
-Read
-.ul
-UNIX Programming
-for more complicated things.
-.PP
-Most input and output in C is best handled with the 
-standard I/O library,
-which provides a set of I/O functions
-that exist in compatible form on most machines
-that have C compilers.
-In general, it's wisest to confine the system interactions
-in a program to the facilities provided by this library.
-.PP
-C programs that don't depend too much on special features of 
-.UC UNIX
-(such as pipes)
-can be moved to other computers that have C compilers.
-The list of such machines grows daily;
-in addition to the original
-.UC PDP -11,
-it currently includes
-at least
-Honeywell 6000,
-IBM 370,
-Interdata 8/32,
-Data General Nova and Eclipse,
-HP 2100,
-Harris /7,
-VAX 11/780,
-SEL 86,
-and
-Zilog Z80.
-Calls to the standard I/O library will work on all of these machines.
-.PP
-There are a number of supporting programs that go with C.
-.UL lint
-checks C programs for potential portability problems,
-and detects errors such as mismatched argument types
-and uninitialized variables.
-.PP
-For larger programs
-(anything whose source is on more than one file)
-.UL make
-allows you to specify the dependencies among the source files
-and the processing steps needed to make a new version;
-it then checks the times that the pieces were last changed
-and does the minimal amount of recompiling
-to create a consistent updated version.
-.PP
-The debugger
-.UL adb
-is useful for digging through the dead bodies
-of C programs,
-but is rather hard to learn to use effectively.
-The most effective debugging tool is still
-careful thought, coupled with judiciously placed
-print statements.
-.PP
-The C compiler provides a limited instrumentation service,
-so you can find out
-where programs spend their time and what parts are worth optimizing.
-Compile the routines with the
-.UL \-p
-option;
-after the test run, use
-.UL prof
-to print an execution profile.
-The command
-.UL time
-will give you the gross run-time statistics
-of a program, but they are not super accurate or reproducible.
-.SH
-Other Languages
-.PP
-If you 
-.ul
-have
-to use Fortran,
-there are two possibilities.
-You might consider
-Ratfor,
-which gives you the decent control structures
-and free-form input that characterize C,
-yet lets you write code that
-is still portable to other environments.
-Bear in mind that
-.UC UNIX
-Fortran
-tends to produce large and relatively slow-running
-programs.
-Furthermore, supporting software like
-.UL adb ,
-.UL prof ,
-etc., are all virtually useless with Fortran programs.
-There may also be a Fortran 77 compiler on your system.
-If so,
-this is a viable alternative to 
-Ratfor,
-and has the non-trivial advantage that it is compatible with C
-and related programs.
-(The Ratfor processor
-and C tools
-can be used with Fortran 77 too.)
-.PP
-If your application requires you to translate
-a language into a set of actions or another language,
-you are in effect building a compiler,
-though probably a small one.
-In that case,
-you should be using
-the
-.UL yacc
-compiler-compiler, 
-which helps you develop a compiler quickly.
-The
-.UL lex
-lexical analyzer generator does the same job
-for the simpler languages that can be expressed as regular expressions.
-It can be used by itself,
-or as a front end to recognize inputs for a
-.UL yacc -based
-program.
-Both
-.UL yacc
-and
-.UL lex
-require some sophistication to use,
-but the initial effort of learning them
-can be repaid many times over in programs
-that are easy to change later on.
-.PP
-Most
-.UC UNIX
-systems also make available other languages,
-such as
-Algol 68, APL, Basic, Lisp, Pascal, and Snobol.
-Whether these are useful depends largely on the local environment:
-if someone cares about the language and has worked on it,
-it may be in good shape.
-If not, the odds are strong that it
-will be more trouble than it's worth.
diff --git a/.ref-Research-V7/usr/doc/beginners/u5 b/.ref-Research-V7/usr/doc/beginners/u5
deleted file mode 100644 (file)
index 77a9643..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-.SH
-V.  UNIX READING LIST
-.SH
-General:
-.LP
-K. L. Thompson and D. M. Ritchie,
-.IT The
-.ul
-.UC UNIX
-.ul
-Programmer's Manual,
-Bell Laboratories, 1978.
-Lists commands,
-system routines and interfaces, file formats,
-and some of the maintenance procedures.
-You can't live without this,
-although you will probably only need to read section 1.
-.LP
-.ul
-Documents for Use with the
-.ul
-.UC UNIX
-.ul
-Time-sharing System.
-Volume 2 of the Programmer's Manual.
-This contains more extensive descriptions
-of major commands,
-and tutorials and reference manuals.
-All of the papers listed below are in it,
-as are descriptions of most of the programs
-mentioned above.
-.LP
-D. M. Ritchie and K. L. Thompson,
-``The
-.UC UNIX
-Time-sharing System,''
-CACM, July 1974.
-An overview of the system,
-for people interested in operating systems.
-Worth reading by anyone who programs.
-Contains a remarkable number of one-sentence observations
-on how to do things right.
-.LP
-The Bell System Technical Journal
-(BSTJ)
-Special Issue on 
-.UC UNIX ,
-July/August, 1978,
-contains many papers describing recent developments,
-and some retrospective material.
-.LP
-The 2nd International Conference on Software Engineering
-(October, 1976)
-contains several 
-papers describing the use of the
-Programmer's Workbench
-.UC PWB ) (
-version of
-.UC UNIX .
-.SH
-Document Preparation:
-.LP
-B. W. Kernighan,
-``A Tutorial Introduction to the
-.UC UNIX
-Text Editor''
-and
-``Advanced Editing on
-.UC UNIX ,''
-Bell Laboratories, 1978.
-Beginners need the introduction;
-the advanced material will help you get the most
-out of the editor.
-.LP
-M. E. Lesk,
-``Typing Documents on
-.UC UNIX ,''
-Bell Laboratories, 1978.
-Describes the
-.UL \-ms
-macro package, which isolates the novice
-from the vagaries of
-.UL nroff
-and
-.UL troff ,
-and takes care of most formatting situations.
-If this specific package isn't available on your system,
-something similar probably is.
-The most likely alternative is the
-.UC PWB/UNIX
-macro package
-.UL \-mm ;
-see your local guru if you use
-.UC PWB/UNIX .
-.LP
-B. W. Kernighan and L. L. Cherry,
-``A System for Typesetting Mathematics,''
-Bell Laboratories Computing Science Tech. Rep. 17.
-.LP
-M. E. Lesk,
-``Tbl \(em A Program to Format Tables,''
-Bell Laboratories CSTR 49, 1976.
-.LP
-J. F. Ossanna, Jr.,
-``NROFF/TROFF User's Manual,''
-Bell Laboratories CSTR 54, 1976.
-.UL troff
-is the basic formatter used by
-.UL \-ms ,
-.UL eqn
-and
-.UL tbl .
-The reference manual is indispensable
-if you are going to write or maintain these
-or similar programs.
-But start with:
-.LP
-B. W. Kernighan,
-``A TROFF Tutorial,''
-Bell Laboratories, 1976.
-An attempt to unravel the intricacies of
-.UL troff .
-.SH
-Programming:
-.LP
-B. W. Kernighan and D. M. Ritchie,
-.ul
-The C Programming Language,
-Prentice-Hall, 1978.
-Contains a tutorial introduction,
-complete discussions of all language features,
-and the reference manual.
-.LP
-B. W. Kernighan and D. M. Ritchie,
-.UC UNIX \& ``
-Programming,''
-Bell Laboratories, 1978.
-Describes how to interface with the system from C programs:
-I/O calls, signals, processes.
-.LP
-S. R. Bourne,
-``An Introduction to the
-.UC UNIX
-Shell,''
-Bell Laboratories, 1978.
-An introduction and reference manual for the Version 7 shell.
-Mandatory reading if you intend to make effective use
-of the programming power
-of this shell.
-.LP
-S. C. Johnson,
-``Yacc \(em Yet Another Compiler-Compiler,''
-Bell Laboratories CSTR 32, 1978.
-.LP
-M. E. Lesk,
-``Lex \(em A Lexical Analyzer Generator,''
-Bell Laboratories CSTR 39, 1975.
-.LP
-S. C. Johnson,
-``Lint, a C Program Checker,''
-Bell Laboratories CSTR 65, 1977.
-.LP
-S. I. Feldman,
-``MAKE \(em A Program for Maintaining Computer Programs,''
-Bell Laboratories CSTR 57, 1977.
-.LP
-J. F. Maranzano and S. R. Bourne,
-``A Tutorial Introduction to ADB,''
-Bell Laboratories CSTR 62, 1977.
-An introduction to a powerful but complex debugging tool.
-.LP
-S. I. Feldman and P. J. Weinberger,
-``A Portable Fortran 77 Compiler,''
-Bell Laboratories, 1978.
-A full Fortran 77 for
-.UC UNIX
-systems.
diff --git a/.ref-Research-V7/usr/doc/cacm/p.mac b/.ref-Research-V7/usr/doc/cacm/p.mac
deleted file mode 100644 (file)
index 283a04f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.de P1
-.DS
-..
-.de P2
-.DE
-..
-.de UL
-.lg 0
-.if n .ul
-\%\&\\$3\f3\\$1\fR\&\\$2
-.lg
-..
-.de UC
-\&\\$3\s-1\\$1\\s0\&\\$2
-..
-.de IT
-.lg 0
-.if n .ul
-\%\&\\$3\f2\\$1\fR\&\\$2
-.lg
-..
-.de SP
-.sp \\$1
-..
diff --git a/.ref-Research-V7/usr/doc/cacm/p1 b/.ref-Research-V7/usr/doc/cacm/p1
deleted file mode 100644 (file)
index f381db2..0000000
+++ /dev/null
@@ -1,558 +0,0 @@
-.ds n \s+2
-.hw above-mentioned
-.ds s \s-2
-.ds m \v'-.3'.\v'.3'
-.TL
-The UNIX
-Time-Sharing System\f1\s10\v'-.2n'*\v'.2n'\s0\fP
-.AU
-D. M. Ritchie and K. Thompson
-.AB
-.FS
-* Copyright 1974,
-Association for Computing Machinery, Inc.,
-reprinted by permission.
-This is a revised version of an article
-that appeared in Communications of the \*sACM\*n,
-.IT 17 ,
-No. 7 (July 1974), pp. 365-375.
-That article was a
-revised version of a paper presented
-at the Fourth \*sACM\*n Symposium on Operating
-Systems Principles,
-\*sIBM\*n Thomas J. Watson Research Center,
-Yorktown Heights,
-New York,
-October 15-17, 1973.
-.FE
-.UX
-is a general-purpose, multi-user, interactive
-operating system for the larger Digital Equipment Corporation
-\*sPDP\*n-11 and
-the Interdata 8/32 computers.
-It offers a number of features
-seldom found even in larger operating
-systems, including
-.IP i
-A hierarchical file system incorporating
-demountable volumes,
-.IP ii
-Compatible file, device, and inter-process I/O,
-.IP iii
-The ability to initiate asynchronous processes,
-.IP iv
-System command language selectable on a per-user basis,
-.IP v
-Over 100 subsystems including a dozen languages,
-.IP vi
-High degree of portability.
-.LP
-This paper discusses the nature
-and implementation of the file system
-and of the user command interface.
-.AE
-.NH
-INTRODUCTION
-.PP
-There have been four versions of
-the
-.UX
-time-sharing system.
-.hy 12
-The earliest (circa 1969-70) ran on
-the Digital Equipment Corporation \*sPDP\*n-7 and -9 computers.
-The second version ran on the unprotected
-\*sPDP\*n-11/20 computer.
-The third incorporated multiprogramming and ran
-on the \*sPDP\*n-11/34, /40, /45, /60, and /70 computers;
-it is the one described in the previously published version
-of this paper, and is also the most widely used today.
-.hy 14
-This paper describes only the
-fourth, current
-system that runs on the \*sPDP\*n-11/70 and the
-Interdata 8/32 computers.
-In fact, the differences among the various systems is
-rather small;
-most of the revisions made to the originally published version of this
-paper,
-aside from those concerned with style,
-had to do with details of the implementation of the file system.
-.PP
-Since
-\*sPDP\*n-11
-.UX
-became operational
-in February, 1971,
-over 600 installations have been put into service.
-Most of them are engaged in applications such as
-computer science education,
-the preparation and formatting of documents
-and other textual material,
-the collection and processing of trouble data
-from various switching machines within the Bell System,
-and recording and checking telephone service
-orders.
-Our own installation is used mainly for research
-in operating systems, languages,
-computer networks,
-and other topics in computer science, and also for
-document preparation.
-.PP
-Perhaps the most important achievement of
-.UX
-is to demonstrate
-that
-a powerful operating system for interactive use
-need not be expensive either in equipment or in human
-effort:
-it
-can run on hardware costing as little as $40,000, and
-less than two man-years were spent on the main system
-software.
-We hope, however, that users find
-that the
-most important characteristics of the system
-are its simplicity, elegance, and ease of use.
-.PP
-Besides the operating system proper, some major programs
-available under
-.UX
-are
-.DS
-.nf
-C compiler
-Text editor based on \*sQED\*n
-.[
-qed lampson
-.]
-Assembler, linking loader, symbolic debugger
-Phototypesetting and equation setting programs
-.[
-cherry kernighan typesetting mathematics cacm
-.]
-.[
-kernighan lesk ossanna document preparation bstj
-%Q This issue
-.]
-.fi
-.in +3n
-.ll -5n
-.ti -3n
-Dozens of languages including
-Fortran 77, Basic, Snobol, \*sAPL\*n, Algol 68, M6, \*sTMG\*n, Pascal
-.in
-.ll
-.DE
-There is a host of maintenance, utility, recreation and novelty programs,
-all written locally.
-The
-.UX
-user community, which numbers in the thousands,
-has contributed many more programs and languages.
-It is worth noting that the system is totally self-supporting.
-All
-.UX
-software is maintained on
-the
-system;
-likewise, this paper and all other
-documents
-in this issue
-were generated and formatted by the
-.UX
-editor and text formatting
-programs.
-.SH
-II. HARDWARE AND SOFTWARE ENVIRONMENT
-.PP
-The \*sPDP\*n-11/70 on which the Research
-.UX
-system is installed is a 16-bit
-word (8-bit byte) computer with 768K bytes of core memory;
-the system kernel
-occupies 90K bytes
-about equally divided between code
-and data tables.
-This system, however, includes a very large number of
-device drivers
-and enjoys a generous allotment
-of space for I/O buffers and system tables;
-a minimal system capable of running the software
-mentioned above can
-require as little as 96K bytes
-of core altogether.
-There are even larger installations;
-see the description of the
-\*sPWB/UNIX\*n systems,
-.[
-dolotta mashey workbench software engineering
-.]
-.[
-dolotta haight mashey workbench bstj
-%Q This issue
-.]
-for example.
-There are also much smaller, though somewhat restricted,
-versions of the system.
-.[
-lycklama microprocessor bstj
-%Q This issue
-.]
-.PP
-Our own \*sPDP\*n-11 has two
-200-Mb moving-head disks
-for file system storage and swapping.
-There are 20 variable-speed
-communications interfaces
-attached to 300- and 1200-baud data sets,
-and an additional 12 communication lines
-hard-wired to 9600-baud terminals and
-satellite computers.
-There are also several 2400- and 4800-baud
-synchronous communication interfaces
-used for machine-to-machine file transfer.
-Finally, there is a variety
-of miscellaneous
-devices including
-nine-track magnetic tape,
-a line printer,
-a voice synthesizer,
-a phototypesetter,
-a digital switching network,
-and a chess machine.
-.PP
-The preponderance of
-.UX
-software is written in the
-abovementioned C language.
-.[
-c programming language kernighan ritchie prentice-hall
-.]
-Early versions of the operating system were written in assembly language,
-but during the summer of 1973, it was rewritten in C.
-The size of the new system was about one-third greater
-than that of the old.
-Since the new system not only became much easier to
-understand and to modify but also
-included
-many functional improvements,
-including multiprogramming and the ability to
-share reentrant code among several user programs,
-we consider this increase in size quite acceptable.
-.SH
-III. THE FILE SYSTEM
-.PP
-The most important role of
-the system
-is to provide
-a file system.
-From the point of view of the user, there
-are three kinds of files: ordinary disk files,
-directories, and special files.
-.SH
-3.1 Ordinary files
-.PP
-A file
-contains whatever information the user places on it,
-for example, symbolic or binary
-(object) programs.
-No particular structuring is expected by the system.
-A file of text consists simply of a string
-of characters, with lines demarcated by the newline character.
-Binary programs are sequences of words as
-they will appear in core memory when the program
-starts executing.
-A few user programs manipulate files with more
-structure;
-for example, the assembler generates, and the loader
-expects, an object file in a particular format.
-However,
-the structure of files is controlled by
-the programs that use them, not by the system.
-.SH
-3.2 Directories
-.PP
-Directories provide
-the mapping between the names of files
-and the files themselves, and thus
-induce a structure on the file system as a whole.
-Each user has a directory of his own files;
-he may also create subdirectories to contain
-groups of files conveniently treated together.
-A directory behaves exactly like an ordinary file except that it
-cannot be written on by unprivileged programs, so that the system
-controls the contents of directories.
-However, anyone with
-appropriate permission may read a directory just like any other file.
-.PP
-The system maintains several directories
-for its own use.
-One of these is the
-.UL root
-directory.
-All files in the system can be found by tracing
-a path through a chain of directories
-until the desired file is reached.
-The starting point for such searches is often the
-.UL root .
-Other system directories contain all the programs provided
-for general use; that is, all the
-.IT commands .
-As will be seen, however, it is by no means necessary
-that a program reside in one of these directories for it
-to be executed.
-.PP
-Files are named by sequences of 14 or
-fewer characters.
-When the name of a file is specified to the
-system, it may be in the form of a
-.IT path
-.IT name ,
-which
-is a sequence of directory names separated by slashes, ``/\^'',
-and ending in a file name.
-If the sequence begins with a slash, the search begins in the
-root directory.
-The name
-.UL /alpha/beta/gamma
-causes the system to search
-the root for directory
-.UL alpha ,
-then to search
-.UL alpha
-for
-.UL beta ,
-finally to find
-.UL gamma
-in
-.UL beta .
-.UL \&gamma
-may be an ordinary file, a directory, or a special
-file.
-As a limiting case, the name ``/\^'' refers to the root itself.
-.PP
-A path name not starting with ``/\^'' causes the system to begin the
-search in the user's current directory.
-Thus, the name
-.UL alpha/beta
-specifies the file named
-.UL beta
-in
-subdirectory
-.UL alpha
-of the current
-directory.
-The simplest kind of name, for example,
-.UL alpha ,
-refers to a file that itself is found in the current
-directory.
-As another limiting case, the null file name refers
-to the current directory.
-.PP
-The same non-directory file may appear in several directories under
-possibly different names.
-This feature is called
-.IT linking ;
-a directory entry for a file is sometimes called a link.
-The
-.UX
-system
-differs from other systems in which linking is permitted
-in that all links to a file have equal status.
-That is, a file does not exist within a particular directory;
-the directory entry for a file consists merely
-of its name and a pointer to the information actually
-describing the file.
-Thus a file exists independently of any
-directory entry, although in practice a file is made to
-disappear along with the last link to it.
-.PP
-Each directory always has at least two entries.
-The name
-``\|\fB.\|\fP'' in each directory refers to the directory itself.
-Thus a program
-may read the current directory under the name ``\fB\|.\|\fP'' without knowing
-its complete path name.
-The name ``\fB\|.\|.\|\fP'' by convention refers to the parent of the
-directory in which it appears, that is, to the directory in which
-it was created.
-.PP
-The directory structure is constrained to have the form
-of a rooted tree.
-Except for the special entries ``\|\fB\|.\|\fP'' and ``\fB\|.\|.\|\fP'', each directory
-must appear as an entry in exactly one other directory, which is its
-parent.
-The reason for this is to simplify the writing of programs
-that visit subtrees of the directory structure, and more
-important, to avoid the separation of portions of the hierarchy.
-If arbitrary links to directories were permitted, it would
-be quite difficult to detect when the last connection from
-the root to a directory was severed.
-.SH
-3.3 Special files
-.PP
-Special files constitute the most unusual feature of the
-.UX
-file system.
-Each supported I/O device
-is associated with at least one such file.
-Special files are read and written just like ordinary
-disk files, but requests to read or write result in activation of the associated
-device.
-An entry for each special file resides in directory
-.UL /dev ,
-although a link may be made to one of these files
-just as it may to an ordinary file.
-Thus, for example,
-to write on a magnetic tape
-one may write on the file
-.UL /dev/mt .
-Special files exist for each communication line, each disk,
-each tape drive,
-and for physical main memory.
-Of course,
-the active disks
-and the memory special file are protected from
-indiscriminate access.
-.PP
-There is a threefold advantage in treating
-I/O devices this way:
-file and device I/O
-are as similar as possible;
-file and device names have the same
-syntax and meaning, so that
-a program expecting a file name
-as a parameter can be passed a device
-name; finally,
-special files are subject to the same
-protection mechanism as regular files.
-.SH
-3.4 Removable file systems
-.PP
-Although the root of the file system is always stored on the same
-device,
-it is not necessary that the entire file system hierarchy
-reside on this device.
-There is a
-.UL mount
-system request with two arguments:
-the name of an existing ordinary file, and the name of a special
-file whose associated
-storage volume (e.g., a disk pack) should have the structure
-of an independent file system
-containing its own directory hierarchy.
-The effect of
-.UL mount
-is to cause
-references to the heretofore ordinary file
-to refer instead to the root directory
-of the file system on the removable volume.
-In effect,
-.UL mount
-replaces a leaf of the hierarchy tree (the ordinary file)
-by a whole new subtree (the hierarchy stored on the
-removable volume).
-After the
-.UL mount ,
-there is virtually no distinction
-between files on the removable volume and those in the
-permanent file system.
-In our installation, for example,
-the root directory resides
-on a small partition of one of
-our disk drives,
-while the other drive,
-which contains the user's files,
-is mounted by the system initialization
-sequence.
-A mountable file system is generated by
-writing on its corresponding special file.
-A utility program is available to create
-an empty file system,
-or one may simply copy an existing file system.
-.PP
-There is only one exception to the rule of identical
-treatment of files on different devices:
-no link may exist between one file system hierarchy and
-another.
-This restriction is enforced so as to avoid
-the elaborate bookkeeping
-that would otherwise be required to assure removal of the links
-whenever the removable volume is dismounted.
-.SH
-3.5 Protection
-.PP
-Although the access control scheme
-is quite simple, it has some unusual features.
-Each user of the system is assigned a unique
-user identification number.
-When a file is created, it is marked with
-the user \*sID\*n of its owner.
-Also given for new files
-is a set of ten protection bits.
-Nine of these specify
-independently read, write, and execute permission
-for the
-owner of the file,
-for other members of his group,
-and for all remaining users.
-.PP
-If the tenth bit is on, the system
-will temporarily change the user identification
-(hereafter, user \*sID\*n)
-of the current user to that of the creator of the file whenever
-the file is executed as a program.
-This change in user \*sID\*n is effective only
-during the execution of the program that calls for it.
-The set-user-\*sID\*n feature provides
-for privileged programs that may use files
-inaccessible to other users.
-For example, a program may keep an accounting file
-that should neither be read nor changed
-except by the program itself.
-If the set-user-\*sID\*n bit is on for the
-program, it may access the file although
-this access might be forbidden to other programs
-invoked by the given program's user.
-Since the actual user \*sID\*n
-of the invoker of any program
-is always available,
-set-user-\*sID\*n programs
-may take any measures desired to satisfy themselves
-as to their invoker's credentials.
-This mechanism is used to allow users to execute
-the carefully written
-commands
-that call privileged system entries.
-For example, there is a system entry
-invokable only by the ``super-user'' (below)
-that creates
-an empty directory.
-As indicated above, directories are expected to
-have entries for ``\fB\|.\|\fP'' and ``\fB\|.\|.\|\fP''.
-The command which creates a directory
-is owned by the super-user
-and has the set-user-\*sID\*n bit set.
-After it checks its invoker's authorization to
-create the specified directory,
-it creates it and makes the entries
-for ``\fB\|.\|\fP'' and ``\fB\|.\|.\|\fP''.
-.PP
-Because anyone may set the set-user-\*sID\*n
-bit on one of his own files,
-this mechanism is generally
-available without administrative intervention.
-For example,
-this protection scheme easily solves the \*sMOO\*n
-accounting problem posed by ``Aleph-null.''
-.[
-aleph null software practice
-.]
-.PP
-The system recognizes one particular user \*sID\*n (that of the ``super-user'') as
-exempt from the usual constraints on file access; thus (for example),
-programs may be written to dump and reload the file
-system without
-unwanted interference from the protection
-system.
diff --git a/.ref-Research-V7/usr/doc/cacm/p2 b/.ref-Research-V7/usr/doc/cacm/p2
deleted file mode 100644 (file)
index 8542899..0000000
+++ /dev/null
@@ -1,441 +0,0 @@
-.SH
-3.6 I/O calls
-.PP
-The system calls to do I/O are designed to eliminate
-the differences between the various devices and styles of
-access.
-There is no distinction between ``random''
-and ``sequential'' I/O, nor is any logical record size imposed
-by the system.
-The size of an ordinary file is determined
-by the number of bytes written on it;
-no predetermination of the size of a file is necessary
-or possible.
-.PP
-To illustrate the essentials of I/O,
-some of the basic calls are
-summarized below
-in an anonymous language that will
-indicate the required parameters without getting into the
-underlying
-complexities.
-Each call to the system may potentially result in an error
-return, which for simplicity is not represented
-in the calling sequence.
-.PP
-To read or write a file assumed to exist already, it must
-be opened by the following call:
-.P1
-filep = open\|(\|name, flag\|)
-.P2
-where
-.UL name
-indicates the name of the file.
-An arbitrary path name may be given.
-The
-.UL flag
-argument indicates whether the file is to be read, written,
-or ``updated,'' that is, read and written simultaneously.
-.PP
-The returned value
-.UL filep
-is called a
-.IT "file descriptor" .
-It is a small integer used to identify the file
-in subsequent calls to read, write,
-or otherwise manipulate the file.
-.PP
-To create a new file or completely rewrite an old one,
-there is a
-.UL create
-system call that
-creates the given file if it does not exist,
-or truncates it to zero length
-if it does exist;
-.UL create
-also opens the new file for writing
-and, like
-.UL open ,
-returns a file descriptor.
-.PP
-The file system maintains no locks visible to the user, nor is there any
-restriction on the number of users who may have a file
-open for reading or writing.
-Although it is possible for the contents of a file
-to become scrambled when two users write on it simultaneously,
-in practice difficulties do not arise.
-We take the view that locks are neither
-necessary nor sufficient, in our environment,
-to prevent interference between users of the same file.
-They are unnecessary because we are not
-faced with large, single-file data bases
-maintained by independent processes.
-They are insufficient because
-locks in the ordinary sense, whereby
-one user is prevented from writing on a file that another
-user is reading,
-cannot prevent confusion
-when, for example, both users are editing
-a file with an editor that makes
-a copy of the file being edited.
-.PP
-There are, however,
-sufficient internal interlocks to maintain
-the logical consistency of the file system
-when two users engage simultaneously in
-activities such as writing on
-the same file,
-creating files in the same directory,
-or deleting each other's open files.
-.PP
-Except as indicated below, reading and writing
-are sequential.
-This means that if a particular
-byte in the file was the last byte written (or read),
-the next I/O call implicitly refers to the
-immediately following byte.
-For each open file there is a pointer, maintained
-inside the system,
-that indicates the next byte to be read
-or written.
-If
-.IT n
-bytes are read or written, the pointer advances
-by
-.IT n
-bytes.
-.PP
-Once a file is open, the following calls
-may be used:
-.P1
-n = read\|(\|filep, buffer, count\|)
-n = write\|(\|filep, buffer, count\|)
-.P2
-Up to
-.UL count
-bytes are transmitted between the file specified
-by
-.UL filep
-and the byte array
-specified by
-.UL buffer .
-The returned value
-.UL n
-is the number of bytes actually transmitted.
-In the
-.UL write
-case,
-.UL n
-is the same as
-.UL count
-except under exceptional conditions, such as I/O errors or
-end of physical medium on special files;
-in a
-.UL read ,
-however,
-.UL n
-may without error be less than
-.UL count .
-If the read pointer is so near the end of the
-file that reading
-.UL count
-characters
-would cause reading beyond the end, only sufficient
-bytes are transmitted to reach the end of the
-file;
-also, typewriter-like terminals
-never return more than one line of input.
-When a
-.UL read
-call returns with
-.UL n
-equal
-to zero, the end of the file has been reached.
-For disk files this occurs when the read pointer
-becomes equal to the current
-size of the file.
-It is possible to generate an end-of-file
-from a terminal by use of an escape
-sequence that depends on the device used.
-.PP
-Bytes written affect only those parts of a file implied by
-the position of the write pointer and the
-count; no other part of the file
-is changed.
-If the last byte lies beyond the end of the file, the
-file is made to grow as needed.
-.PP
-To do random (direct-access) I/O
-it is only necessary to move the read or write pointer
-to the appropriate location in the file.
-.P1
-location = lseek\|(\|filep, offset, base\|)
-.P2
-The pointer
-associated with
-.UL filep
-is moved to a position
-.UL offset
-bytes from the beginning of the file, from the current position
-of the pointer, or from the end of the file,
-depending on
-.UL base.
-.UL \&offset
-may be negative.
-For some devices (e.g., paper
-tape and
-terminals) seek calls are
-ignored.
-The actual offset from the beginning of the file
-to which the pointer was moved is returned
-in
-.UL location .
-.PP
-There are several additional system entries
-having to do with I/O and with the file
-system that will not be discussed.
-For example:
-close a file,
-get the status of a file,
-change the protection mode or the owner
-of a file,
-create a directory,
-make a link to an existing file,
-delete a file.
-.SH
-IV. IMPLEMENTATION OF THE FILE SYSTEM
-.PP
-As mentioned in Section 3.2 above, a directory entry contains
-only a name for the associated file and a pointer to the
-file itself.
-This pointer is an integer called the
-.IT i-number
-(for index number)
-of the file.
-When the file is accessed,
-its i-number is used as an index into
-a system table (the
-.IT i-list \|)
-stored in a known
-part of the device on which
-the directory resides.
-The entry found thereby (the file's
-.IT i-node \|)
-contains
-the description of the file:
-.IP i
-the user and group-\*sID\*n of its owner
-.IP ii
-its protection bits
-.IP iii
-the physical disk or tape addresses for the file contents
-.IP iv
-its size
-.IP v
-time of creation, last use, and last modification
-.IP vi
-the number of links to the file, that is, the number of times it appears in a directory
-.IP vii
-a code indicating whether the file is a directory, an ordinary file, or a special file.
-.LP
-The purpose of an
-.UL open
-or
-.UL create
-system call is to turn the path name given by the user
-into an i-number
-by searching the explicitly or implicitly named directories.
-Once a file is open,
-its device, i-number, and read/write pointer are stored in a system table
-indexed by the file descriptor returned by the
-.UL open
-or
-.UL create .
-Thus, during a subsequent
-call to read or write the
-file,
-the descriptor
-may be easily related to the information necessary to access the file.
-.PP
-When a new file is created,
-an i-node is allocated for it and a directory entry is made
-that contains the name of the file and the i-node
-number.
-Making a link to an existing file involves
-creating a directory entry with the new name,
-copying the i-number from the original file entry,
-and incrementing the link-count field of the i-node.
-Removing (deleting) a file is done by
-decrementing the
-link-count of the i-node specified by its directory entry
-and erasing the directory entry.
-If the link-count drops to 0,
-any disk blocks in the file
-are freed and the i-node is de-allocated.
-.PP
-The space on all disks that
-contain a file system is divided into a number of
-512-byte
-blocks logically addressed from 0 up to a limit that
-depends on the device.
-There is space in the i-node of each file for 13 device addresses.
-For nonspecial files,
-the first 10 device addresses point at the first
-10 blocks of the file.
-If the file is larger than 10 blocks,
-the 11 device address points to an
-indirect block containing up to 128 addresses
-of additional blocks in the file.
-Still larger files use the twelfth device address
-of the i-node to point to
-a double-indirect block naming
-128 indirect blocks,
-each
-pointing to 128 blocks of the file.
-If required,
-the thirteenth device address is
-a triple-indirect block.
-Thus files may conceptually grow to
-[\|(10+128+128\u\s62\s0\d+128\u\s63\s0\d)\*m512\|] bytes.
-Once opened,
-bytes numbered below 5120 can be read with a single
-disk access;
-bytes in the range 5120 to 70,656
-require two accesses;
-bytes in the range 70,656
-to 8,459,264
-require three accesses;
-bytes from there to the
-largest file
-(1,082,201,088)
-require four accesses.
-In practice,
-a device cache mechanism
-(see below)
-proves effective in eliminating
-most of the indirect fetches.
-.PP
-The foregoing discussion applies to ordinary files.
-When an I/O request is made to a file whose i-node indicates that it
-is special,
-the last 12 device address words are immaterial,
-and the first specifies
-an internal
-.IT "device name" ,
-which is interpreted as a pair of numbers
-representing,
-respectively, a device type
-and subdevice number.
-The device type indicates which
-system routine will deal with I/O on that device;
-the subdevice number selects, for example, a disk drive
-attached to a particular controller or one of several
-similar terminal interfaces.
-.PP
-In this environment, the implementation of the
-.UL mount
-system call (Section 3.4) is quite straightforward.
-.UL \&mount
-maintains a system table whose
-argument is the i-number and device name of the
-ordinary file specified
-during the
-.UL mount ,
-and whose corresponding value is the
-device name of the indicated special file.
-This table is searched for each i-number/device pair
-that turns up while a path name is being scanned
-during an
-.UL open
-or
-.UL create ;
-if a match is found,
-the i-number is replaced by the i-number of the root
-directory
-and the device name is replaced by the table value.
-.PP
-To the user, both reading and writing of files appear to
-be synchronous and unbuffered.
-That is, immediately after
-return from a
-.UL read
-call the data are available; conversely,
-after a
-.UL write
-the user's workspace may be reused.
-In fact, the system maintains a rather complicated
-buffering mechanism that reduces greatly the number
-of I/O operations required to access a file.
-Suppose a
-.UL write
-call is made specifying transmission
-of a single byte.
-The system
-will search its buffers to see
-whether the affected disk block currently resides in main memory;
-if not, it will be read in from the device.
-Then the affected byte is replaced in the buffer and an
-entry is made in a list of blocks to be written.
-The return from the
-.UL write
-call may then take place,
-although the actual I/O may not be completed until a later time.
-Conversely, if a single byte is read, the system determines
-whether the secondary storage block in which the byte is located is already
-in one of the system's buffers; if so, the byte can be returned immediately.
-If not, the block is read into a buffer and the byte picked out.
-.PP
-The system recognizes when
-a program has
-made accesses to
-sequential blocks of a file,
-and asynchronously
-pre-reads the next block.
-This significantly reduces
-the running time of most programs
-while adding little to
-system overhead.
-.PP
-A program that reads or writes files in units of 512 bytes
-has an advantage over a program that reads or writes
-a single byte at a time, but the gain is not immense;
-it comes mainly from the avoidance of system overhead.
-If a program is used rarely or does
-no great volume of I/O, it may quite reasonably
-read and write in units as small as it wishes.
-.PP
-The notion of the i-list is an unusual feature
-of
-.UX .
-In practice, this method of organizing the file system
-has proved quite reliable and easy to deal with.
-To the system itself, one of its strengths is
-the fact that each file has a short, unambiguous name
-related in a simple way to the protection, addressing,
-and other information needed to access the file.
-It also permits a quite simple and rapid
-algorithm for checking the consistency of a file system,
-for example, verification
-that the portions of each device containing useful information
-and those free to be allocated are disjoint and together
-exhaust the space on the device.
-This algorithm is independent
-of the directory hierarchy, because it need only scan
-the linearly organized i-list.
-At the same time the notion of the i-list induces certain
-peculiarities not found in other file system organizations.
-For example, there is the question of who is to be charged
-for the space a file occupies,
-because all directory entries for a file have equal status.
-Charging the owner of a file is unfair in general,
-for one user may create a file, another may link to
-it, and the first user may delete the file.
-The first user is still the owner of the
-file, but it should be charged
-to the second user.
-The simplest reasonably fair algorithm
-seems to be to spread the charges
-equally among users who have links to a file.
-Many installations
-avoid the
-issue by not charging any fees at all.
diff --git a/.ref-Research-V7/usr/doc/cacm/p3 b/.ref-Research-V7/usr/doc/cacm/p3
deleted file mode 100644 (file)
index 649aa9a..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-.SH
-V. PROCESSES AND IMAGES
-.PP
-An
-.IT image
-is a computer execution environment.
-It includes a memory image,
-general register values,
-status of open files,
-current directory and the like.
-An image is the current state of a pseudo-computer.
-.PP
-A
-.IT process
-is the execution of an image.
-While the processor is executing on behalf of a process,
-the image must reside in main memory;
-during the execution of other processes it remains in main memory
-unless the appearance of an active, higher-priority
-process
-forces it to be swapped out to the disk.
-.PP
-The user-memory part of an image is divided into three logical segments.
-The program text segment begins at location 0 in the virtual address space.
-During execution, this segment is write-protected
-and a single copy of it is shared among
-all processes executing the same program.
-At the first hardware protection byte boundary above the program text segment in the
-virtual address space begins a non-shared, writable data segment,
-the size of which may be extended by a system call.
-Starting at the highest
-address in the virtual address space is a stack segment,
-which automatically grows downward
-as the stack pointer fluctuates.
-.SH
-5.1 Processes
-.PP
-Except while
-the system
-is bootstrapping itself into operation, a new
-process can come into existence only
-by use of the
-.UL fork
-system call:
-.P1
-processid = fork\|(\|\|)\|
-.P2
-When
-.UL fork
-is executed, the process
-splits into two independently executing processes.
-The two processes have independent
-copies of the original memory image,
-and share all open files.
-The new processes differ only in that one is considered
-the parent process:
-in the parent,
-the returned
-.UL processid
-actually identifies the child process
-and is never 0,
-while in the child,
-the returned value is always 0.
-.PP
-Because the values returned by
-.UL fork
-in the parent and child process are distinguishable,
-each process may determine whether
-it is the parent or child.
-.SH
-5.2 Pipes
-.PP
-Processes may communicate
-with related processes using the same system
-.UL read
-and
-.UL write
-calls that are used for file-system I/O.
-The call:
-.P1
-filep = pipe\|(\|\|)\|
-.P2
-returns a file descriptor
-.UL filep
-and
-creates an inter-process channel called a
-.IT pipe .
-This channel, like other open files, is passed from parent to child process in
-the image by the
-.UL fork
-call.
-A
-.UL read
-using a pipe file descriptor
-waits until another process writes using the
-file descriptor for the same pipe.
-At this point, data are passed between the images of the
-two processes.
-Neither process need know that a pipe,
-rather than an ordinary file,
-is involved.
-.PP
-Although
-inter-process communication
-via pipes is a quite valuable tool
-(see Section 6.2),
-it is not a completely general
-mechanism,
-because the pipe must be set up by a common ancestor
-of the processes involved.
-.SH
-5.3 Execution of programs
-.PP
-Another major system primitive
-is invoked by
-.P1
-execute\|(\|file, arg\*s\d1\u\*n, arg\*s\d2\u\*n, .\|.\|. , arg\*s\dn\u\*n\|)\|
-.P2
-which requests the system to read in and execute the program
-named by
-.UL file ,
-passing it string arguments
-.UL arg\v'.3'\*s1\*n\v'-.3'\| ,
-.UL arg\v'.3'\*s2\*n\v'-.3'\| ,
-.UL .\|.\|.\|\| ,
-.UL arg\v'.3'\*sn\*n\v'-.3' .
-All the code and data in the process invoking
-.UL execute
-is replaced from the
-.UL file ,
-but
-open files, current directory, and
-inter-process relationships are unaltered.
-Only if the call fails, for example
-because
-.UL file
-could not be found or because
-its execute-permission bit was not set, does a return
-take place from the
-.UL execute
-primitive;
-it resembles a ``jump'' machine instruction
-rather than a subroutine call.
-.SH
-5.4 Process synchronization
-.PP
-Another process control system call:
-.P1
-processid = wait\|(\|status\|)\|
-.P2
-causes its caller to suspend
-execution until one of its children has completed execution.
-Then
-.UL wait
-returns the
-.UL processid
-of the terminated process.
-An error return is taken if the calling process has no
-descendants.
-Certain status from the child process
-is also available.
-.SH
-5.5 Termination
-.PP
-Lastly:
-.P1
-exit\|(\|status\|)\|
-.P2
-terminates a process,
-destroys its image,
-closes its open files,
-and generally obliterates it.
-The parent is notified through
-the
-.UL wait
-primitive,
-and
-.UL status
-is made available
-to it.
-Processes may also terminate as a result of
-various illegal actions or user-generated signals
-(Section VII below).
diff --git a/.ref-Research-V7/usr/doc/cacm/p4 b/.ref-Research-V7/usr/doc/cacm/p4
deleted file mode 100644 (file)
index c67a5eb..0000000
+++ /dev/null
@@ -1,517 +0,0 @@
-.SH
-VI. THE SHELL
-.PP
-For most users,
-communication with
-the system
-is carried on with the
-aid of a program called the \&shell.
-The \&shell is a
-command-line interpreter: it reads lines typed by the user and
-interprets them as requests to execute
-other programs.
-(The \&shell is described fully elsewhere,
-.[
-bourne shell bstj
-%Q This issue
-.]
-so this section will discuss only the theory of its operation.)
-In simplest form, a command line consists of the command
-name followed by arguments to the command, all separated
-by spaces:
-.P1
-command arg\*s\d1\u\*n arg\*s\d2\u\*n .\|.\|. arg\*s\dn\u\*n
-.P2
-The \&shell splits up the command name and the arguments into
-separate strings.
-Then a file with name
-.UL command
-is sought;
-.UL command
-may be a path name including the ``/'' character to
-specify any file in the system.
-If
-.UL command
-is found, it is brought into
-memory and executed.
-The arguments
-collected by the \&shell are accessible
-to the command.
-When the command is finished, the \&shell
-resumes its own execution, and indicates its readiness
-to accept another command by typing a prompt character.
-.PP
-If file
-.UL command
-cannot be found,
-the \&shell generally prefixes a string 
-such as
-.UL /\|bin\|/
-to
-.UL command
-and
-attempts again to find the file.
-Directory
-.UL /\|bin
-contains commands
-intended to be generally used.
-(The sequence of directories to be searched
-may be changed by user request.)
-.SH
-6.1 Standard I/O
-.PP
-The discussion of I/O in Section III above seems to imply that
-every file used by a program must be opened or created by the program in
-order to get a file descriptor for the file.
-Programs executed by the \&shell, however, start off with
-three open files with file descriptors
-0, 1, and 2.
-As such a program begins execution, file 1 is open for writing,
-and is best understood as the standard output file.
-Except under circumstances indicated below, this file
-is the user's terminal.
-Thus programs that wish to write informative
-information ordinarily use file descriptor 1.
-Conversely, file 0 starts off open for reading, and programs that
-wish to read messages typed by the user
-read this file.
-.PP
-The \&shell is able to change the standard assignments of
-these file descriptors from the
-user's terminal printer and keyboard.
-If one of the
-arguments to a command is prefixed by ``>'', file descriptor
-1 will, for the duration of the command, refer to the
-file named after the ``>''.
-For example:
-.P1
-ls
-.P2
-ordinarily lists, on the typewriter, the names of the files in the current
-directory.
-The command:
-.P1
-ls >there
-.P2
-creates a file called
-.UL there
-and places the listing there.
-Thus the argument
-.UL >there
-means
-``place output on
-.UL there .''
-On the other hand:
-.P1
-ed
-.P2
-ordinarily enters the editor, which takes requests from the
-user via his keyboard.
-The command
-.P1
-ed <script
-.P2
-interprets
-.UL script
-as a file of editor commands;
-thus
-.UL <script
-means ``take input from
-.UL script .''
-.PP
-Although the file name following ``<'' or ``>'' appears
-to be an argument to the command, in fact it is interpreted
-completely by the \&shell and is not passed to the
-command at all.
-Thus no special coding to handle I/O redirection is needed within each
-command; the command need merely use the standard file
-descriptors 0 and 1 where appropriate.
-.PP
-File descriptor 2 is, like file 1,
-ordinarily associated with the terminal output stream.
-When an output-diversion request with ``>'' is specified,
-file 2 remains attached to the terminal, so that commands
-may produce diagnostic messages that
-do not silently end up in the output file.
-.SH
-6.2 Filters
-.PP
-An extension of the standard I/O notion is used
-to direct output from one command to
-the input of another.
-A sequence of commands separated by
-vertical bars causes the \&shell to
-execute all the commands simultaneously and to arrange
-that the standard output of each command
-be delivered to the standard input of
-the next command in the sequence.
-Thus in the command line:
-.P1
-ls | pr \(mi2 | opr
-.P2
-.UL ls
-lists the names of the files in the current directory;
-its output is passed to
-.UL pr ,
-which
-paginates its input with dated headings.
-(The argument ``\(mi2'' requests
-double-column output.)
-Likewise, the output from
-.UL pr
-is input to
-.UL opr ;
-this command spools its input onto a file for off-line
-printing.
-.PP
-This procedure could have been carried out
-more clumsily by:
-.P1
-ls >temp1
-pr \(mi2 <temp1 >temp2
-opr <temp2
-.P2
-followed by removal of the temporary files.
-In the absence of the ability
-to redirect output and input,
-a still clumsier method would have been to
-require the
-.UL ls
-command
-to accept user requests to paginate its output,
-to print in multi-column format, and to arrange
-that its output be delivered off-line.
-Actually it would be surprising, and in fact
-unwise for efficiency reasons,
-to expect authors of
-commands such as
-.UL ls
-to provide such a wide variety of output options.
-.PP
-A program
-such as
-.UL pr
-which copies its standard input to its standard output
-(with processing)
-is called a
-.IT filter .
-Some filters that we have found useful
-perform
-character transliteration,
-selection of lines according to a pattern,
-sorting of the input,
-and encryption and decryption.
-.SH
-6.3 Command separators; multitasking
-.PP
-Another feature provided by the \&shell is relatively straightforward.
-Commands need not be on different lines; instead they may be separated
-by semicolons:
-.P1
-ls; ed
-.P2
-will first list the contents of the current directory, then enter
-the editor.
-.PP
-A related feature is more interesting.
-If a command is followed
-by ``\f3&\f1,'' the \&shell will not wait for the command to finish before
-prompting again; instead, it is ready immediately
-to accept a new command.
-For example:
-.bd 3
-.P1
-as source >output &
-.P2
-causes
-.UL source
-to be assembled, with diagnostic
-output going to
-.UL output ;
-no matter how long the
-assembly takes, the \&shell returns immediately.
-When the \&shell does not wait for
-the completion of a command,
-the identification number of the
-process running that command is printed.
-This identification may be used to
-wait for the completion of the command or to
-terminate it.
-The ``\f3&\f1'' may be used
-several times in a line:
-.P1
-as source >output & ls >files &
-.P2
-does both the assembly and the listing in the background.
-In these examples, an output file
-other than the terminal was provided; if this had not been
-done, the outputs of the various commands would have been
-intermingled.
-.PP
-The \&shell also allows parentheses in the above operations.
-For example:
-.P1
-(\|date; ls\|) >x &
-.P2
-writes the current date and time followed by
-a list of the current directory onto the file
-.UL x .
-The \&shell also returns immediately for another request.
-.SH 1
-6.4 The \&shell as a command; command files
-.PP
-The \&shell is itself a command, and may be called recursively.
-Suppose file
-.UL tryout
-contains the lines:
-.P1
-as source
-mv a.out testprog
-testprog
-.P2
-The
-.UL mv
-command causes the file
-.UL a.out
-to be renamed
-.UL testprog.
-.UL \&a.out
-is the (binary) output of the assembler, ready to be executed.
-Thus if the three lines above were typed on the keyboard,
-.UL source
-would be assembled, the resulting program renamed
-.UL testprog ,
-and
-.UL testprog
-executed.
-When the lines are in
-.UL tryout ,
-the command:
-.P1
-sh <tryout
-.P2
-would cause the \&shell
-.UL sh
-to execute the commands
-sequentially.
-.PP
-The \&shell has further capabilities, including the
-ability to substitute parameters
-and
-to construct argument lists from a specified
-subset of the file names in a directory.
-It also provides general conditional and looping constructions.
-.SH 1
-6.5 Implementation of the \&shell
-.PP
-The outline of the operation of the \&shell can now be understood.
-Most of the time, the \&shell
-is waiting for the user to type a command.
-When the
-newline character ending the line
-is typed, the \&shell's
-.UL read
-call returns.
-The \&shell analyzes the command line, putting the
-arguments in a form appropriate for
-.UL execute .
-Then
-.UL fork
-is called.
-The child process, whose code
-of course is still that of the \&shell, attempts
-to perform an
-.UL execute
-with the appropriate arguments.
-If successful, this will bring in and start execution of the program whose name
-was given.
-Meanwhile, the other process resulting from the
-.UL fork ,
-which is the
-parent process,
-.UL wait s
-for the child process to die.
-When this happens, the \&shell knows the command is finished, so
-it types its prompt and reads the keyboard to obtain another
-command.
-.PP
-Given this framework, the implementation of background processes
-is trivial; whenever a command line contains ``\f3&\f1,''
-the \&shell merely refrains from waiting for the process
-that it created
-to execute the command.
-.PP
-Happily, all of this mechanism meshes very nicely with
-the notion of standard input and output files.
-When a process is created by the
-.UL fork
-primitive, it
-inherits not only the memory image of its parent
-but also all the files currently open in its parent,
-including those with file descriptors 0, 1, and 2.
-The \&shell, of course, uses these files to read command
-lines and to write its prompts and diagnostics, and in the ordinary case
-its children\(emthe command programs\(eminherit them automatically.
-When an argument with ``<'' or ``>'' is given, however, the
-offspring process, just before it performs
-.UL execute,
-makes the standard I/O
-file descriptor (0 or 1, respectively) refer to the named file.
-This is easy
-because, by agreement,
-the smallest unused file descriptor is assigned
-when a new file is
-.UL open ed
-(or
-.UL create d);
-it is only necessary to close file 0 (or 1)
-and open the named file.
-Because the process in which the command program runs simply terminates
-when it is through, the association between a file
-specified after ``<'' or ``>'' and file descriptor 0 or 1 is ended
-automatically when the process dies.
-Therefore
-the \&shell need not know the actual names of the files
-that are its own standard input and output, because it need
-never reopen them.
-.PP
-Filters are straightforward extensions
-of standard I/O redirection with pipes used
-instead of files.
-.PP
-In ordinary circumstances, the main loop of the \&shell never
-terminates.
-(The main loop includes the
-branch of the return from
-.UL fork
-belonging to the
-parent process; that is, the branch that does a
-.UL wait ,
-then
-reads another command line.)
-The one thing that causes the \&shell to terminate is
-discovering an end-of-file condition on its input file.
-Thus, when the \&shell is executed as a command with
-a given input file, as in:
-.P1
-sh <comfile
-.P2
-the commands in
-.UL comfile
-will be executed until
-the end of
-.UL comfile
-is reached; then the instance of the \&shell
-invoked by
-.UL sh
-will terminate.
-Because this \&shell process
-is the child of another instance of the \&shell, the
-.UL wait
-executed in the latter will return, and another
-command may then be processed.
-.SH
-6.6 Initialization
-.PP
-The instances of the \&shell to which users type
-commands are themselves children of another process.
-The last step in the initialization of
-the system
-is the creation of
-a single process and the invocation (via
-.UL execute )
-of a program called
-.UL init .
-The role of
-.UL init
-is to create one process
-for each terminal channel.
-The various subinstances of
-.UL init
-open the appropriate terminals
-for input and output
-on files 0, 1, and 2,
-waiting, if necessary, for carrier to be established on dial-up lines.
-Then a message is typed out requesting that the user log in.
-When the user types a name or other identification,
-the appropriate instance of
-.UL init
-wakes up, receives the log-in
-line, and reads a password file.
-If the user's name is found, and if
-he is able to supply the correct password,
-.UL init
-changes to the user's default current directory, sets
-the process's user \*sID\*n to that of the person logging in, and performs
-an
-.UL execute
-of the \&shell.
-At this point, the \&shell is ready to receive commands
-and the logging-in protocol is complete.
-.PP
-Meanwhile, the mainstream path of
-.UL init
-(the parent of all
-the subinstances of itself that will later become \&shells)
-does a
-.UL wait .
-If one of the child processes terminates, either
-because a \&shell found an end of file or because a user
-typed an incorrect name or password, this path of
-.UL init
-simply recreates the defunct process, which in turn reopens the appropriate
-input and output files and types another log-in message.
-Thus a user may log out simply by typing the end-of-file
-sequence to the \&shell.
-.SH
-6.7 Other programs as \&shell
-.PP
-The \&shell as described above is designed to allow users
-full access to the facilities of the system, because it will
-invoke the execution of any program
-with appropriate protection mode.
-Sometimes, however, a different interface to the system
-is desirable, and this feature is easily arranged for.
-.PP
-Recall that after a user has successfully logged in by supplying
-a name and password,
-.UL init
-ordinarily invokes the \&shell
-to interpret command lines.
-The user's entry
-in the password file may contain the name
-of a program to be invoked after log-in instead of the \&shell.
-This program is free to interpret the user's messages
-in any way it wishes.
-.PP
-For example, the password file entries
-for users of a secretarial editing system
-might
-specify that the
-editor
-.UL ed
-is to be used instead of the \&shell.
-Thus when users of the editing system log in, they are inside the editor and
-can begin work immediately; also, they can be prevented from
-invoking
-programs not intended for their use.
-In practice, it has proved desirable to allow a temporary
-escape from the editor
-to execute the formatting program and other utilities.
-.PP
-Several of the games (e.g., chess, blackjack, 3D tic-tac-toe)
-available on
-the system
-illustrate
-a much more severely restricted environment.
-For each of these, an entry exists
-in the password file specifying that the appropriate game-playing
-program is to be invoked instead of the \&shell.
-People who log in as a player
-of one of these games find themselves limited to the
-game and unable to investigate the (presumably more interesting)
-offerings of
-the
-.UX
-system
-as a whole.
diff --git a/.ref-Research-V7/usr/doc/cacm/p5 b/.ref-Research-V7/usr/doc/cacm/p5
deleted file mode 100644 (file)
index a5d4305..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-.SH
-VII. TRAPS
-.PP
-The \*sPDP\*n-11 hardware detects a number of program faults,
-such as references to non-existent memory, unimplemented instructions,
-and odd addresses used where an even address is required.
-Such faults cause the processor to trap to a system routine.
-Unless other arrangements have been made,
-an illegal action causes the system
-to terminate the process and to write its
-image
-on file
-.UL core
-in the current directory.
-A debugger can be used to determine
-the state of the program at the time of the fault.
-.PP
-Programs that are looping, that produce unwanted output, or about which
-the user has second thoughts may be halted by the use of the
-.UL interrupt
-signal, which is generated by typing the ``delete''
-character.
-Unless special action has been taken, this
-signal simply causes the program to cease execution
-without producing a
-.UL core
-file.
-There is also a
-.UL quit
-signal
-used to force an image file to be produced.
-Thus programs that loop unexpectedly may be
-halted and the remains inspected without prearrangement.
-.PP
-The hardware-generated faults
-and the interrupt and quit signals
-can, by request, be either ignored or caught by a process.
-For example,
-the \&shell ignores quits to prevent
-a quit from logging the user out.
-The editor catches interrupts and returns
-to its command level.
-This is useful for stopping long printouts
-without losing work in progress (the editor
-manipulates a copy of the file it is editing).
-In systems without floating-point hardware,
-unimplemented instructions are caught
-and floating-point instructions are
-interpreted.
-.SH
-VIII. PERSPECTIVE
-.PP
-Perhaps paradoxically,
-the success of
-the
-.UX
-system
-is largely due to the fact that it was not
-designed to meet any
-predefined objectives.
-The first version was written when one of us
-(Thompson),
-dissatisfied with the available computer facilities,
-discovered a little-used \*sPDP\*n-7
-and set out to create a more
-hospitable environment.
-This (essentially personal) effort was
-sufficiently successful
-to gain the interest of the other author
-and several colleagues,
-and later to justify the acquisition
-of the \*sPDP\*n-11/20, specifically to support
-a text editing and formatting system.
-When in turn the 11/20 was outgrown,
-the system
-had proved useful enough to persuade management to
-invest in the \*sPDP\*n-11/45,
-and later in the
-\*sPDP\*n-11/70 and Interdata 8/32 machines,
-upon which it developed to its present form.
-Our goals throughout the effort,
-when articulated at all, have always been to build
-a comfortable relationship with the machine
-and to explore ideas and inventions in operating systems
-and other software.
-We have not been faced with the need to satisfy someone
-else's requirements,
-and for this freedom we are grateful.
-.PP
-Three considerations that influenced the design of
-.UX
-are visible in retrospect.
-.PP
-First:
-because we are programmers,
-we naturally designed the system to make it easy to
-write, test, and run programs.
-The most important expression of our desire for
-programming convenience
-was that the system
-was arranged for interactive use,
-even though the original version only
-supported one user.
-We believe that a properly designed
-interactive system is much more
-productive
-and satisfying to use than a ``batch'' system.
-Moreover, such a system is rather easily
-adaptable to noninteractive use, while the converse is not true.
-.PP
-Second:
-there have always been fairly severe size constraints
-on the system and its software.
-Given the partially antagonistic desires for reasonable efficiency and
-expressive power,
-the size constraint has encouraged
-not only economy, but also a certain elegance of design.
-This may be a thinly disguised version of the ``salvation
-through suffering'' philosophy,
-but in our case it worked.
-.PP
-Third: nearly from the start, the system was able to, and did, maintain itself.
-This fact is more important than it might seem.
-If designers of a system are forced to use that system,
-they quickly become aware of its functional and superficial deficiencies
-and are strongly motivated to correct them before it is too late.
-Because all source programs were always available
-and easily modified on-line,
-we were willing to revise and rewrite the system and its software
-when new ideas were invented, discovered,
-or suggested by others.
-.PP
-The aspects of
-.UX
-discussed in this paper exhibit clearly
-at least the first two of these
-design considerations.
-The interface to the file
-system, for example, is extremely convenient from
-a programming standpoint.
-The lowest possible interface level is designed
-to eliminate distinctions
-between
-the various devices and files and between
-direct and sequential access.
-No large ``access method'' routines
-are required
-to insulate the programmer from the
-system calls;
-in fact, all user programs either call the system
-directly or
-use a small library program, less than a page long,
-that buffers a number of characters
-and reads or writes them all at once.
-.PP
-Another important aspect of programming
-convenience is that there are no ``control blocks''
-with a complicated structure partially maintained by
-and depended on by the file system or other system calls.
-Generally speaking, the contents of a program's address space
-are the property of the program, and we have tried to
-avoid placing restrictions
-on the data structures within that address space.
-.PP
-Given the requirement
-that all programs should be usable with any file or
-device as input or output,
-it is also desirable
-to push device-dependent considerations
-into the operating system itself.
-The only alternatives seem to be to load,
-with all programs,
-routines for dealing with each device,
-which is expensive in space,
-or to depend on some means of dynamically linking to
-the routine appropriate to each device when it is actually
-needed,
-which is expensive either in overhead or in hardware.
-.PP
-Likewise,
-the process-control scheme and the command interface
-have proved both convenient and efficient.
-Because the \&shell operates as an ordinary, swappable
-user program,
-it consumes no ``wired-down'' space in the system proper,
-and it may be made as powerful as desired
-at little cost.
-In particular,
-given the framework in which the \&shell executes
-as a process that spawns other processes to
-perform commands,
-the notions of I/O redirection, background processes,
-command files, and user-selectable system interfaces
-all become essentially trivial to implement.
-.SH
-Influences
-.PP
-The success of
-.UX
-lies
-not so much in new inventions
-but rather in the full exploitation of a carefully selected
-set of fertile ideas,
-and especially in showing that
-they can be keys to the implementation of a small
-yet powerful operating system.
-.PP
-The
-.UL fork
-operation, essentially as we implemented it, was
-present in the \*sGENIE\*n time-sharing system.
-.[
-lampson deutsch 930 manual 1965 system preliminary
-.]
-On a number of points we were influenced by Multics,
-which suggested the particular form of the I/O system calls
-.[
-multics input output feiertag organick
-.]
-and both the name of the \&shell and its general functions.
-The notion that the \&shell should create a process
-for each command was also suggested to us by
-the early design of Multics, although in that
-system it was later dropped for efficiency reasons.
-A similar scheme is used by \*sTENEX\*n.
-.[
-bobrow burchfiel tenex
-.]
diff --git a/.ref-Research-V7/usr/doc/cacm/p6 b/.ref-Research-V7/usr/doc/cacm/p6
deleted file mode 100644 (file)
index b7a1c63..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-.SH
-IX. STATISTICS
-.PP
-The following numbers
-are presented to suggest the scale of the Research
-.UX
-operation.
-Those of our users
-not involved in document preparation
-tend to use the system for
-program development, especially language work.
-There are few important
-``applications'' programs.
-.PP
-Overall, we have today:
-.PP
-.SP .5
-.TS
-center;
-r5 l.
-125    user population
-33     maximum simultaneous users
-1,630  directories
-28,300 files
-301,700        512-byte secondary storage blocks used
-.TE
-.SP .5
-There is a ``background'' process that
-runs at the lowest possible priority; it is used
-to soak up any idle \*sCPU\*n time.
-It has been used to produce a million-digit
-approximation to the constant \fIe\fR,
-and other semi-infinite problems.
-Not counting this background work, we average daily:
-.SP .5
-.TS
-center;
-r 5 l.
-13,500 commands
-9.6    \*sCPU\*n hours
-230    connect hours
-62     different users
-240    log-ins
-.TE
-.SP .5
-.SH
-X. ACKNOWLEDGMENTS
-.PP
-The contributors to
-.UX
-are, in the traditional but here especially apposite
-phrase, too numerous to mention.
-Certainly, collective salutes are due to our colleagues in the
-Computing Science Research Center.
-R. H. Canaday contributed much to the basic design of the
-file system.
-We are particularly appreciative
-of the inventiveness,
-thoughtful criticism,
-and constant support of
-R. Morris, M. D. McIlroy,
-and J. F. Ossanna.
-.[
-$LIST$
-.]
diff --git a/.ref-Research-V7/usr/doc/cman b/.ref-Research-V7/usr/doc/cman
deleted file mode 100644 (file)
index 7c8fbf5..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Sorry, but for copyright reasons, the source
-for the C Reference Manual is not distributed.
diff --git a/.ref-Research-V7/usr/doc/ctour/cdoc0 b/.ref-Research-V7/usr/doc/ctour/cdoc0
deleted file mode 100644 (file)
index dc0803c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.TL
-A Tour through the UNIX\(dg C Compiler
-.AU "MH 2C517 3770
-D. M. Ritchie
-.AI
-.MH
-.OK
-Languages
-Computing
-..AB
-..AE
-.CS a b c d e f
-.de II
-.I
-\\$1
-.R
-..
-.de Op
-.SH
-\\$1 \fI\\$2
-.IP
-..
-.PP
diff --git a/.ref-Research-V7/usr/doc/ctour/cdoc1 b/.ref-Research-V7/usr/doc/ctour/cdoc1
deleted file mode 100644 (file)
index 66ec733..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-.SH
-The Intermediate Language
-.PP
-.FS
-\(dgUNIX is a Trademark of Bell Laboratories.
-.FE
-Communication between the two phases of the compiler proper
-is carried out by means of a pair of intermediate files.
-These files are treated as having identical structure,
-although the second file contains only the code generated for strings.
-It is convenient to write strings out separately to reduce the
-need for multiple location counters in a later assembly
-phase.
-.PP
-The intermediate language is not machine-independent;
-its structure in a number of ways reflects
-the fact that C was originally a one-pass compiler
-chopped in two to reduce the maximum memory
-requirement.
-In fact, only the latest version
-of the compiler has a complete
-intermediate language at all.
-Until recently, the first phase of the compiler generated
-assembly code for those constructions it could deal with,
-and passed expression parse trees, in absolute binary
-form,
-to the second phase for code generation.
-Now, at least, all inter-phase information
-is passed in a describable form, and there are
-no absolute pointers involved, so the coupling between
-the phases is not so strong.
-.PP
-The areas in which the machine
-(and system) dependencies are most noticeable are
-.IP 1.
-Storage allocation for automatic variables and arguments
-has already been performed,
-and nodes for such variables refer to them by offset
-from a display pointer.
-Type conversion
-(for example, from integer to pointer)
-has already occurred using the assumption of
-byte addressing and 2-byte words.
-.IP 2.
-Data representations suitable to the PDP-11 are assumed;
-in particular, floating point constants are passed as
-four words in the machine representation.
-.PP
-As it happens, each intermediate file is represented as a sequence
-of binary numbers without any explicit demarcations.
-It consists of a sequence of
-conceptual lines, each headed by an operator, and possibly containing
-various operands.
-The operators are small numbers;
-to assist in recognizing failure in synchronization,
-the high-order byte of each operator word is always the
-octal number 376.
-Operands are
-either 16-bit binary numbers or strings of characters representing names.
-Each name is terminated by a null character.
-There is no alignment requirement for numerical
-operands and so there is no padding
-after a name string.
-.PP
-The binary representation was chosen to avoid the necessity
-of converting to and from character form
-and to minimize the size of the files.
-It would be very easy to make
-each operator-operand `line' in the file be
-a genuine, printable line, with the numbers in octal or decimal;
-this in fact was the representation originally used.
-.PP
-The operators fall naturally into two classes:
-those which represent part of an expression, and all others.
-Expressions are transmitted in a reverse-Polish notation;
-as they are being read, a tree is built which is isomorphic
-to the tree constructed in the first phase.
-Expressions are passed as a whole, with no non-expression operators
-intervening.
-The reader maintains a stack; each leaf of the expression tree (name, constant)
-is pushed on the stack;
-each unary operator replaces the top of the stack by a node whose
-operand is the old top-of-stack;
-each binary operator replaces the top pair on the stack with
-a single entry.
-When the expression is complete there is exactly one item on the
-stack.
-Following each expression
-is a special operator which passes the unique previous expression
-to the `optimizer' described below and then to the code
-generator.
-.PP
-Here is the list of operators not themselves part of expressions.
-.LP
-.Op EOF
-marks the end of an input file.
-.Op BDATA "flag data ..."
-specifies a sequence of bytes to be assembled
-as static data.
-It is followed by pairs of words; the first member
-of the pair is non-zero to indicate that the data continue;
-a zero flag is not followed by data and terminates
-the operator.
-The data bytes occupy the low-order part of a word.
-.Op WDATA "flag data ..."
-specifies a sequence of words to be assembled as
-static data; it is identical to the BDATA operator
-except that entire words, not just bytes, are passed.
-.Op PROG
-means that subsequent information is to be compiled as program text.
-.Op DATA
-means that subsequent information is to be compiled as static data.
-.Op BSS
-means that subsequent information is to be compiled as unitialized
-static data.
-.Op SYMDEF name
-means that
-the symbol
-.I
-name
-.R
-is an external name defined in the current program.
-It is produced for each external data or function definition.
-.Op CSPACE "name size"
-indicates that the name refers to a data area whose size is the
-specified number of bytes.
-It is produced for external data definitions without explicit initialization.
-.Op SSPACE size
-indicates that
-.I
-size
-.R
-bytes should be set aside for data storage.
-It is used to pad out short initializations of external data
-and to reserve space for static (internal) data.
-It will be preceded by an appropriate label.
-.Op EVEN
-is produced after each
-external data definition whose size is not
-an integral number of words.
-It is not produced after strings except when they initialize
-a character array.
-.Op NLABEL name
-is produced just before a BDATA or WDATA initializing
-external data, and serves as a label for the data.
-.Op RLABEL name
-is produced just before each function definition,
-and labels its entry point.
-.Op SNAME "name number"
-is produced at the start of each function for each static variable
-or label
-declared therein.
-Subsequent uses of the variable will be in terms of the given number.
-The code generator uses this only to produce a debugging symbol table.
-.Op ANAME "name number"
-Likewise, each automatic variable's name and stack offset
-is specified by this operator.
-Arguments count as automatics.
-.Op RNAME "name number"
-Each register variable is similarly named, with its register number.
-.Op SAVE number
-produces a register-save sequence at the start of each function,
-just after its label (RLABEL).
-.Op SETREG number
-is used to indicate the number of registers used
-for register variables.
-It actually gives the register number of the lowest
-free register; it is redundant because the RNAME operators could be
-counted instead.
-.Op PROFIL
-is produced before the save sequence for functions
-when the profile option is turned on.
-It produces code to count the number
-of times the function is called.
-.Op SWIT "deflab line label value ..."
-is produced for switches.
-When control flows into it,
-the value being switched on is in the register
-forced by RFORCE (below).
-The switch statement occurred on the indicated line
-of the source, and the label number of the default location
-is
-.I
-deflab.
-.R
-Then the operator is followed by a sequence of label-number and value pairs;
-the list is terminated by a 0 label.
-.Op LABEL number
-generates an internal label.
-It is referred to elsewhere using the given number.
-.Op BRANCH number
-indicates an unconditional transfer to the internal label number
-given.
-.Op RETRN
-produces the return sequence for a function.
-It occurs only once, at the end of each function.
-.Op EXPR line
-causes the expression just preceding to be compiled.
-The argument is the line number in the source where the
-expression occurred.
-.Op NAME "class type name"
-.Op NAME "class type number"
-indicates a name occurring in an expression.
-The first form is used when the name is external;
-the second when the name is automatic, static, or a register.
-Then the number indicates the stack offset, the label number,
-or the register number as appropriate.
-Class and type encoding is described elsewhere.
-.Op CON "type value"
-transmits an integer constant.
-This and the next two operators occur as part of expressions.
-.Op FCON "type 4-word-value"
-transmits a floating constant as
-four words in PDP-11 notation.
-.Op SFCON "type value"
-transmits a floating-point constant
-whose value is correctly represented by its high-order word
-in PDP-11 notation.
-.Op NULL
-indicates a null argument list of a function call in an expression;
-call is a binary operator whose second operand is the argument list.
-.Op CBRANCH "label cond"
-produces a conditional branch.
-It is an expression operator, and will be followed
-by an EXPR.
-The branch to the label number takes place if the expression's
-truth value is the same as that of
-.I
-cond.
-.R
-That is, if
-.I
-cond=1
-.R
-and the expression evaluates to true, the branch is taken.
-.Op binary-operator type
-There are binary operators corresponding
-to each such source-language operator;
-the type of the result of each is passed as well.
-Some perhaps-unexpected ones are:
-COMMA, which is a right-associative operator designed
-to simplify right-to-left evaluation
-of function arguments;
-prefix and postfix ++ and \-\-, whose second operand
-is the increment amount, as a CON;
-QUEST and COLON, to express the conditional
-expression as `a?(b:c)';
-and a sequence of special operators for expressing
-relations between pointers, in case pointer comparison
-is different from integer comparison
-(e.g. unsigned).
-.Op unary-operator type
-There are also numerous unary operators.
-These include ITOF, FTOI, FTOL, LTOF, ITOL, LTOI
-which convert among floating, long, and integer;
-JUMP which branches indirectly through a label expression;
-INIT, which compiles the value of a constant expression
-used as an initializer;
-RFORCE, which is used before a return sequence or
-a switch to place a value in an agreed-upon register.
diff --git a/.ref-Research-V7/usr/doc/ctour/cdoc2 b/.ref-Research-V7/usr/doc/ctour/cdoc2
deleted file mode 100644 (file)
index d5949f6..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-.SH
-Expression Optimization
-.PP
-Each expression tree, as it is read in, is subjected to
-a fairly comprehensive
-analysis.
-This is performed
-by the
-.II optim
-routine and a number of subroutines;
-the major things done are
-.IP 1.
-Modifications and simplifications
-of the tree so its value may be computed more efficiently
-and conveniently by the code generator.
-.RT
-.IP 2.
-Marking each interior node with an estimate of the number of
-registers required to evaluate it.
-This register count is needed to guide the code generation algorithm.
-.PP
-One thing that is definitely not done is
-discovery or exploitation of common subexpressions, nor is this done anywhere in the
-compiler.
-.PP
-The basic organization is simple: a depth-first scan of the tree.
-.II Optim
-does nothing for leaf nodes (except for automatics; see below),
-and calls
-.II unoptim
-to handle unary operators.
-For binary operators,
-it calls itself to process the operands,
-then treats each operator separately.
-One important case is
-commutative and associative operators, which are handled
-by
-.II acommute.
-.PP
-Here is a brief catalog of the transformations carried out by
-by
-.II optim
-itself.
-It is not intended to be complete.
-Some of the transformations are machine-dependent,
-although they may well be useful on machines other than the
-PDP-11.
-.IP 1.
-As indicated in the discussion of
-.II unoptim
-below, the optimizer can create a node type corresponding
-to the location addressed by a register plus a constant offset.
-Since this is precisely the implementation of automatic variables
-and arguments, where the register is fixed by convention,
-such variables are changed to the new form to simplify
-later processing.
-.RT
-.IP 2.
-Associative and commutative operators are processed by the
-special routine
-.II acommute.
-.RT
-.IP 3.
-After processing by
-.II acommute,
-the bitwise & operator is turned into a new
-.II andn
-operator; `a & b' becomes
-`a
-.II andn
-~b'.
-This is done because the PDP-11 provides
-no
-.II and
-operator, but only
-.II andn.
-A similar transformation takes place for
-`=&'.
-.RT
-.IP 4.
-Relationals are turned around so the
-more complicated expression is on the left.
-(So that `2 > f(x)' becomes `f(x) < 2').
-This improves code generation since
-the algorithm prefers to have the right operand
-require fewer registers than the left.
-.RT
-.IP 5.
-An expression minus a constant is turned into
-the expression plus the negative constant,
-and the
-.II acommute
-routine is called
-to take advantage of the properties of addition.
-.RT
-.IP 6.
-Operators with constant operands are evaluated.
-.RT
-.IP 7.
-Right shifts (unless by 1)
-are turned into left shifts with a negated right operand,
-since the PDP-11 lacks a general right-shift operator.
-.RT
-.IP 8.
-A number of special cases are simplified, such as division or
-multiplication by 1,
-and shifts by 0.
-.LP
-The
-.II unoptim
-routine performs the same sort of processing for unary operators.
-.IP 1.
-`*&x' and `&*x' are simplified to `x'.
-.RT
-.IP 2.
-If
-.II r
-is a register and
-.II c
-is a constant or the address of a static or external
-variable,
-the expressions `*(r+c)'
-and `*r' are turned into a special kind of name node
-which expresses
-the name itself and the offset.
-This simplifies subsequent processing
-because such constructions can appear as
-the the address of a PDP-11 instruction.
-.RT
-.IP 3.
-When the unary `&' operator is applied to
-a name node of the special kind just discussed,
-it is reworked to make the addition
-explicit again;
-this is done because the PDP-11 has no `load address' instruction.
-.RT
-.IP 4.
-Constructions
-like
-`*r++' and
-`*\-\-r'
-where
-.II r
-is a register are discovered and marked
-as being implementable using the PDP-11
-auto-increment and -decrement modes.
-.RT
-.IP 5.
-If `!' is applied to a relational,
-the `!' is discarded
-and the sense of the relational is reversed.
-.RT
-.IP 6.
-Special cases involving reflexive
-use of negation and complementation are discovered.
-.RT
-.IP 7.
-Operations applying to constants are evaluated.
-.PP
-The
-.II acommute
-routine, called for associative and commutative operators,
-discovers clusters of the same operator at the top levels
-of the current tree, and arranges them in a list:
-for `a+((b+c)+(d+f))'
-the list would be`a,b,c,d,e,f'.
-After each subtree is optimized, the list is sorted in
-decreasing difficulty of computation;
-as mentioned above,
-the code generation algorithm works best when left operands
-are the difficult ones.
-The `degree of difficulty'
-computed is actually finer than
-the mere number of registers required;
-a constant is considered simpler
-than the address of a static or external, which is simpler
-than reference to a variable.
-This makes it easy to fold all the constants
-together,
-and also to merge together the sum of a constant and the address of
-a static
-or external (since in such nodes there is space for
-an `offset' value).
-There are also special cases, like multiplication by 1 and addition of 0.
-.II
-A special routine is invoked to handle sums of products.
-.II Distrib
-is based on the fact that it is better
-to compute `c1*c2*x + c1*y' as `c1*(c2*x + y)'
-and makes the divisibility tests required to assure the
-correctness of the transformation.
-This transformation is rarely
-possible with code directly written by the user,
-but it invariably occurs as a result of the
-implementation of multi-dimensional arrays.
-.PP
-Finally,
-.II acommute
-reconstructs a tree from the list
-of expressions which result.
diff --git a/.ref-Research-V7/usr/doc/ctour/cdoc3 b/.ref-Research-V7/usr/doc/ctour/cdoc3
deleted file mode 100644 (file)
index 67adfda..0000000
+++ /dev/null
@@ -1,812 +0,0 @@
-.SH
-Code Generation
-.PP
-The grand plan for code-generation is
-independent of any particular machine;
-it depends largely on a set of tables.
-But this fact does not necessarily make it very easy
-to modify the compiler to produce code for other machines,
-both because there is a good deal of machine-dependent structure
-in the tables, and because in any event such tables are non-trivial to
-prepare.
-.PP
-The arguments to the basic code generation routine
-.II rcexpr
-are a pointer to a tree representing an expression,
-the name of a code-generation table,
-and the number of a register in which the value of the
-expression should be placed.
-.II Rcexpr
-returns the number of the register in which the value actually
-ended up;
-its caller
-may need to produce a
-.II mov
-instruction if the value really needs to be in the given register.
-There are four code generation tables.
-.PP
-.II Regtab
-is the basic one, which actually does the job described
-above: namely,
-compile code which places the value represented by the expression
-tree in a register.
-.PP
-.II Cctab
-is used when the value of the expression is not actually needed,
-but instead the value of the condition codes resulting from
-evaluation of the expression.
-This table is used, for example, to evaluate the expression after
-.II if.
-It is clearly silly to
-calculate the value (0 or 1) of the expression
-`a==b' in the context `if (a==b) ... '
-.PP
-The
-.II sptab
-table is used when the value of an expression is to be pushed on the stack,
-for example when it is an actual argument.
-For example in the function call `f(a)' it is a bad idea to
-load
-.II a
-into a register which is then pushed on the stack,
-when there is a single instruction which does the job.
-.PP
-The
-.II efftab
-table is used when an expression is to be evaluated for its side effects,
-not its value.
-This occurs mostly for expressions which are statements, which have no
-value.
-Thus the code for the statement
-`a = b'
-need produce only the approoriate
-.II mov
-instruction, and need not leave the value of
-.II b
-in a register,
-while in the expression `a + (b = c)'
-the value of `b = c' will appear in a register.
-.PP
-All of the tables besides
-.II regtab
-are rather small, and handle only a relatively few special cases.
-If one of these subsidiary tables does not contain
-an entry applicable to the given expression tree,
-.II rcexpr
-uses
-.II regtab
-to put the value of the expression into a register
-and then fixes things up;
-nothing need be done when the table
-was
-.II efftab,
-but a
-.II tst
-instruction is produced when the table called for was
-.II cctab,
-and a 
-.II mov
-instruction,
-pushing the register on the stack,
-when the table was
-.II sptab.
-.PP
-The
-.II rcexpr
-routine itself picks off some special
-cases, then calls
-.II cexpr
-to do the real work.
-.II Cexpr
-tries to find an entry applicable
-to the given tree in the given table, and returns \-1 if
-no such entry is found, letting
-.II rcexpr
-try again with a different table.
-A successful match yields a string
-containing both literal characters
-which are written out and pseudo-operations, or macros, which are expanded.
-Before studying the contents
-of these strings we will consider how table entries are matched
-against trees.
-.PP
-Recall that most non-leaf nodes in an expression tree
-contain the name of the operator,
-the type of the value represented, and pointers to the subtrees (operands).
-They also contain an estimate of the number of registers required to evaluate
-the expression, placed there by the expression-optimizer routines.
-The register counts are used to guide the code generation process,
-which is based on the Sethi-Ullman algorithm.
-.PP
-The main code generation
-tables consist of entries
-each containing an operator number and a pointer
-to a subtable for the corresponding operator.
-A subtable consists of a sequence
-of entries, each with a key describing certain properties of the
-operands of the operator involved; associated with the key is a code string.
-Once the subtable corresponding to the operator is found, the subtable
-is searched linearly until a key is found such that the properties demanded
-by the key are compatible with the operands of the tree node.
-A successful match returns the code string;
-an unsuccessful search, either for the operator in the main table
-or a compatble key in the subtable,
-returns a failure indication.
-.PP
-The tables are all contained in a file
-which must be processed to obtain an assembly language program.
-Thus they are written in a special-purpose language.
-To provided definiteness to the following discussion, here is an
-example of a subtable entry.
-.DS
-%n,aw
-       F
-       add     A2,R
-.DE
-The `%' indicates the key;
-the information following (up to a blank line) specifies the code string.
-Very briefly, this entry is in the subtable
-for `+' of
-.II regtab;
-the key specifies that the left operand is any integer, character, or pointer
-expression,
-and the right operand is any word quantity which is directly addressible
-(e.g. a variable or constant).
-The code string calls for the generation of the code
-to compile the left (first) operand into the
-current register (`F')
-and then to produce an `add' instruction which adds the
-second operand (`A2') to the register (`R').
-All of the notation will be explained below.
-.PP
-Only three features of the operands are used in deciding
-whether a match has occurred.
-They are:
-.IP 1.
-Is the type of the operand compatible with that demanded?
-.RT
-.IP 2.
-Is the `degree of difficulty' (in a sense described below) compatible?
-.RT
-.IP 3.
-The table may demand that the operand have a `*'
-(indirection operator) as its highest operator.
-.PP
-As suggested above, the key for a subtable entry
-is indicated by a `%,' and a comma-separated pair
-of specifications for the operands.
-(The second specification is ignored for unary operators).
-A specification indicates
-a type requirement by including one of the following letters.
-If no type letter is present, any integer, character,
-or pointer operand will satisfy the requirement (not float, double, or long).
-.IP b
-A byte (character) operand is required.
-.RT
-.IP w
-A word (integer or pointer) operand is required.
-.RT
-.IP f
-A float or double operand is required.
-.RT
-.IP d
-A double operand is required.
-.RT
-.IP l
-A long (32-bit integer) operand is required.
-.PP
-Before discussing the `degree of difficulty' specification,
-the algorithm has to be explained more completely.
-.II Rcexpr
-(and
-.II cexpr)
-are called with a register number in which to place their result.
-Registers 0, 1, ... are used during evaluation of expressions;
-the maximum register which can be used in this way depends on the
-number of register variables, but in any event only registers
-0 through 4 are available since r5 is used as a stack frame
-header and r6 (sp) and r7 (pc) have special
-hardware properties.
-The code generation routines assume that when called with register
-.II n
-as argument, they may use
-.II n+1,
-\&...
-(up to the first register variable)
-as temporaries.
-Consider the expression `X+Y', where both
-X and Y are expressions.
-As a first approximation, there are three ways of compiling
-code to put this expression in register
-.II n.
-.IP 1.
-If Y is an addressible cell,
-(recursively) put X into register
-.II n
-and add Y to it.
-.RT
-.IP 2.
-If Y is an expression that can be calculated in
-.II k
-registers, where
-.II k
-smaller than the number of registers available,
-compile X into register
-.II n,
-Y into register
-.II n+1,
-and add register
-.II n+1
-to
-.II n.
-.RT
-.IP 3.
-Otherwise, compile Y into register
-.II n,
-save the result in a temporary (actually, on the stack)
-compile X into register
-.II n,
-then add in the temporary.
-.PP
-The distinction between cases 2 and 3 therefore depends
-on whether the right operand can be compiled in fewer than
-.II k
-registers, where
-.II k
-is the number of free registers left after registers 0 through
-.II n
-are taken:
-0 through
-.II n\-1
-are presumed to contain already computed temporary results;
-.II n
-will, in case 2,
-contain the value of the left operand while the right
-is being evaluated.
-.PP
-These considerations should make clear
-the specification codes for the degree of difficulty,
-bearing in mind that a number of special cases are also present:
-.IP z
-is satisfied when the operand is zero, so that special code
-can be produced for expressions like `x = 0'.
-.RT
-.IP 1
-is satisfied when the operand is the constant 1, to optimize
-cases like left and right shift by 1, which can be done
-efficiently on the PDP-11.
-.RT
-.IP c
-is satisfied when the operand is a positive (16-bit)
-constant; this takes care of some special cases in long arithmetic.
-.RT
-.IP a
-is satisfied when the operand is addressible;
-this occurs not only for variables and constants, but also for
-some more complicated constructions, such as indirection through
-a simple variable, `*p++' where
-.II p
-is a register variable (because of the PDP-11's auto-increment address
-mode), and `*(p+c)' where
-.II p
-is a register and
-.II c
-is a constant.
-Precisely, the requirement is that the operand refers to a cell
-whose address can be written as a source or destination of a PDP-11
-instruction.
-.RT
-.IP e
-is satisfied by an operand whose value can be generated in a register
-using no more than
-.II k
-registers, where
-.II k
-is the number of registers left (not counting the current register).
-The `e' stands for `easy.'
-.RT
-.IP n
-is satisfied by any operand.
-The `n' stands for `anything.'
-.PP
-These degrees of difficulty are considered to lie in a linear ordering
-and any operand which satisfies an earlier-mentioned requirement
-will satisfy a later one.
-Since the subtables are searched linearly,
-if a `1' specification is included, almost certainly
-a `z' must be written first to prevent
-expressions containing the constant 0 to be compiled
-as if the 0 were 1.
-.PP
-Finally,
-a key specification may contain a `*' which
-requires the operand to have an indirection as its leading operator.
-Examples below should clarify the utility of this specification.
-.PP
-Now let us consider the contents of the code string
-associated with each subtable entry.
-Conventionally, lower-case letters in this string
-represent literal information which is copied directly
-to the output.
-Upper-case letters generally introduce specific
-macro-operations, some of which may be followed
-by modifying information.
-The code strings in the tables are written with tabs and
-new-lines used freely to suggest instructions which will be generated;
-the table-compiling program compresses tabs (using the 0200 bit of the
-next character) and throws away some of the new-lines.
-For example the macro `F' is ordinarily written on a line by itself;
-but since its expansion will end with a new-line, the new-line
-after `F' itself is dispensable.
-This is all to reduce the size of the stored tables.
-.PP
-The first set of macro-operations is concerned with
-compiling subtrees.
-Recall that this is done by the
-.II cexpr
-routine.
-In the following discussion the `current register'
-is generally the argument register to
-.II cexpr;
-that is, the place where the result is desired.
-The `next register' is numbered one
-higher
-than the current register.
-(This explanation isn't fully true
-because of complications, described below, involving
-operations which require even-odd register pairs.)
-.IP F
-causes a recursive call to
-the
-.II rcexpr
-routine to compile code which places the value of the first (left)
-operand of the operator in the current register.
-.RT
-.IP F1
-generates code which places the value of the first operand in the
-next register.
-It is incorrectly used if there might be no next register;
-that is, if the degree of difficulty of the first operand is not `easy;'
-if not, another register might not be available.
-.RT
-.IP FS
-generates code which pushes the value of the first operand on the stack,
-by calling
-.II rcexpr
-specifying
-.II sptab
-as the table.
-.LP
-Analogously,
-.IP "S, S1, SS"
-compile the second (right) operand
-into the current register, the next register, or onto the stack.
-.LP
-To deal with registers, there are
-.IP R
-which expands into the name of the current register.
-.RT
-.IP R1
-which expands into the name of the next register.
-.RT
-.IP R+
-which expands into the the name of the current register plus 1.
-It was suggested above that this is the same as the next register,
-except for complications; here is one of them.
-Long integer variables have
-32 bits and require 2 registers; in such cases the next register
-is the current register plus 2.
-The code would like to talk about both halves of the
-long quantity, so R refers to the register with the high-order part
-and R+ to the low-order part.
-.RT
-.IP R\-
-This is another complication, involving division and mod.
-These operations involve a pair of registers of which the odd-numbered
-contains the left operand.
-.II Cexpr
-arranges that the current register is odd;
-the R\- notation allows the code to refer to the next lower,
-even-numbered register.
-.LP
-To refer to addressible quantities, there are the notations:
-.IP A1
-causes generation of the address specified by the first operand.
-For this to be legal, the operand must be addressible; its 
-key must contain an `a'
-or a more restrictive specification.
-.RT
-.IP A2
-correspondingly generates the address of the second operand
-providing it has one.
-.PP
-We now have enough mechanism to show a complete, if suboptimal,
-table for the + operator on word or byte operands.
-.DS
-%n,z
-       F
-.sp 1
-%n,1
-       F
-       inc     R
-.sp 1
-%n,aw
-       F
-       add     A2,R
-.sp 1
-%n,e
-       F
-       S1
-       add     R1,R
-.sp 1
-%n,n
-       SS
-       F
-       add     (sp)+,R
-.DE
-The first two sequences handle some special cases.
-Actually it turns out that handling a right operand of 0
-is unnecessary since the expression-optimizer
-throws out adds of 0.
-Adding 1 by using the `increment' instruction is done next,
-and then the case where the right operand is addressible.
-It must be a word quantity, since the PDP-11 lacks an `add byte' instruction.
-Finally the cases where the right operand either can, or cannot,
-be done in the available registers are treated.
-.PP
-The next macro-instructions are conveniently
-introduced by noticing that the above table is suitable
-for subtraction as well as addition, since no use is made of the
-commutativity of addition.
-All that is needed is substitution of `sub' for `add'
-and `dec' for 'inc.'
-Considerable saving of space is achieved by factoring out
-several similar operations.
-.IP I
-is replaced by a string from another table indexed by the operator
-in the node being expanded.
-This secondary table actually contains two strings per operator.
-.RT
-.IP I\(fm
-is replaced by the second string in the side table
-entry for the current operator.
-.PP
-Thus, given that the entries for `+' and `\-' in the side table
-(which is called
-.II instab)
-are `add' and `inc,' `sub' and `dec'
-respectively,
-the middle of of the above addition table can be written
-.DS
-%n,1
-       F
-       I'      R
-
-%n,aw
-       F
-       I       A2,R
-.DE
-and it will be suitable for subtraction,
-and several other operators, as well.
-.PP
-Next, there is the question of character and floating-point operations.
-.IP B1
-generates the letter `b' if the first operand is a character,
-`f' if it is float or double, and nothing otherwise.
-It is used in a context like `movB1'
-which generates a `mov', `movb', or `movf'
-instruction according to the type of the operand.
-.RT
-.IP B2
-is just like B1 but applies to the second operand.
-.RT
-.IP BE
-generates `b' if either operand is a character
-and null otherwise.
-.RT
-.IP BF
-generates `f' if the type of the operator node itself is float or double,
-otherwise null.
-.PP
-For example, there is an entry in
-.II efftab
-for the `=' operator
-.DS
-%a,aw
-%ab,a
-       IBE     A2,A1
-.DE
-Note first that two key specifications
-can be applied to the same code string.
-Next, observe that when a word is assigned to a byte or to a word,
-or a word is assigned to a byte,
-a single instruction,
-a
-.II mov
-or
-.II movb
-as appropriate, does the job.
-However, when a byte is assigned to a word,
-it must pass through a register to implement the sign-extension rules:
-.DS
-%a,n
-       S
-       IB1     R,A1
-.DE
-.PP
-Next, there is the question of handling indirection properly.
-Consider the expression `X + *Y', where X and Y are expressions,
-Assuming that Y is more complicated than just a variable,
-but on the other hand qualifies as `easy' in the context,
-the expression would be compiled by placing the value of X in a register,
-that of *Y in the next register, and adding the registers.
-It is easy to see that a better job can be done
-by compiling X, then Y (into the next register),
-and producing the
-instruction symbolized by `add (R1),R'.
-This scheme avoids generating
-the instruction `mov (R1),R1'
-required actually to place the value of *Y in a register.
-A related situation occurs
-with the expression `X + *(p+6)', which
-exemplifies a construction
-frequent in structure and array references.
-The addition table shown above would produce
-.DS
-[put X in register R]
-mov    p,R1
-add    $6,R1
-mov    (R1),R1
-add    R1,R
-.DE
-when the best code is
-.DS
-[put X in R]
-mov    p,R1
-add    6(R1),R
-.DE
-As we said above, a key specification for a code table entry
-may require an operand to have an indirection as its highest operator.
-To make use of the requirement,
-the following macros are provided.
-.IP F*
-the first operand must have the form *X.
-If in particular it has the form *(Y + c), for some constant
-.II c,
-then code is produced which places the value of Y in
-the current register.
-Otherwise, code is produced which loads X into the current register.
-.RT
-.IP F1*
-resembles F* except that the next register is loaded.
-.RT
-.IP S*
-resembles F* except that the second operand is loaded.
-.RT
-.IP S1*
-resembles S* except that the next register is loaded.
-.RT
-.IP FS*
-The first operand must have the form `*X'.
-Push the value of X on the stack.
-.RT
-.IP SS*
-resembles FS* except that it applies to the second operand.
-.LP
-To capture the constant that may have been skipped over
-in the above macros, there are
-.IP #1
-The first operand must have the form *X;
-if in particular it has the form *(Y + c) for
-.II c
-a constant, then the constant is written out,
-otherwise a null string.
-.RT
-.IP #2
-is the same as #1 except that the second operand is used.
-.LP
-Now we can improve the addition table above.
-Just before the `%n,e' entry, put
-.DS
-%n,ew*
-       F
-       S1*
-       add     #2(R1),R
-.DE
-and just before the `%n,n' put
-.DS
-%n,nw*
-       SS*
-       F
-       add     *(sp)+,R
-.DE
-When using the stacking macros there is no place to use
-the constant
-as an index word, so that particular special case doesn't occur.
-.PP
-The constant mentioned above can actually be more
-general than a number.
-Any quantity acceptable to the assembler as an expression will do,
-in particular the address of a static cell, perhaps with a numeric offset.
-If
-.II x
-is an external character array,
-the expression `x[i+5] = 0' will generate
-the code
-.DS
-mov    i,r0
-clrb   x+5(r0)
-.DE
-via the table entry (in the `=' part of
-.II efftab)
-.DS
-%e*,z
-       F
-       I'B1    #1(R)
-.DE
-Some machine operations place restrictions on the registers
-used.
-The divide instruction, used to implement the divide and mod
-operations, requires the dividend to be placed in the odd member
-of an even-odd pair;
-other peculiarities
-of multiplication make it simplest to put the multiplicand
-in an odd-numbered register.
-There is no theory which optimally accounts for
-this kind of requirement.
-.II Cexpr
-handles it by checking for a multiply, divide, or mod operation;
-in these cases, its argument register number is incremented by
-one or two so that it is odd, and if the operation was divide or mod,
-so that it is a member of a free even-odd pair.
-The routine which determines the number of registers required
-estimates, conservatively, that
-at least two registers are required for a multiplication
-and three for the other peculiar operators.
-After the expression is compiled,
-the register where the result actually ended up is returned.
-(Divide and mod are actually the same operation except for the
-location of the result).
-.PP
-These operations are the ones which cause results to end up in
-unexpected places,
-and this possibility adds a further level of complexity.
-The simplest way of handling the problem is always to move the
-result to the place where the caller expected it,
-but this will produce unnecessary register moves in many
-simple cases; `a = b*c' would generate
-.DS
-mov    b,r1
-mul    c,r1
-mov    r1,r0
-mov    r0,a
-.DE
-The next thought is used the passed-back
-information as to where the result landed to change the notion of the current
-register.
-While compiling the `=' operation above, which comes from a
-table
-entry
-like
-.DS
-%a,e
-       S
-       mov     R,A1
-.DE
-it is sufficient to redefine the meaning of `R'
-after processing the `S' which does the multiply.
-This technique is in fact used; the tables are written in such a way
-that correct code is produced.
-The trouble is that the technique cannot be used in general,
-because it invalidates the count of the number of registers
-required for an expression.
-Consider just `a*b + X' where X is some expression.
-The algorithm assumes that the value of a*b,
-once computed, requires just one register.
-If there are three registers available, and X requires two registers to
-compute, then this expression will match a key specifying
-`%n,e'.
-If a*b is computed and left in register 1, then there are, contrary
-to expectations, no longer two registers available to compute X,
-but only one, and bad code will be produced.
-To guard against this possibility,
-.II cexpr
-checks the result returned by recursive calls which implement
-F, S and their relatives.
-If the result is not in the expected register, then the number of
-registers required by the other operand is checked;
-if it can be done using those registers which remain even
-after making unavailable the unexpectedly-occupied
-register, then
-the notions of the `next register' and possibly the `current
-register' are redefined.
-Otherwise a register-copy instruction is produced.
-A register-copy is also always produced
-when the current operator is one of those which have odd-even requirements.
-.PP
-Finally, there are a few loose-end macro operations
-and facts about the tables.
-The operators:
-.IP V
-is used for long operations.
-It is written with an address like a machine instruction;
-it expands into `adc' (add carry) if the operation
-is an additive operator,
-`sbc' (subtract carry) if the operation is a subtractive
-operator, and disappears, along with the rest of the line, otherwise.
-Its purpose is to allow common treatment of logical
-operations, which have no carries, and additive and subtractive
-operations, which generate carries.
-.RT
-.IP T
-generates a `tst' instruction if the first operand
-of the tree does not set the condition codes correctly.
-It is used with divide and mod operations,
-which require a sign-extended 32-bit operand.
-The code table for the operations contains an `sxt'
-(sign-extend) instruction to generate the high-order part of the
-dividend.
-.RT
-.IP H
-is analogous to the `F' and `S' macros,
-except that it calls for the generation of code for
-the current tree
-(not one of its operands)
-using
-.II regtab.
-It is used in
-.II cctab
-for all the operators which, when executed normally,
-set the condition codes properly according to the result.
-It prevents a `tst' instruction from being generated for
-constructions like `if (a+b) ...'
-since after calculation of the value of
-`a+b' a conditional branch can be written immediately.
-.PP
-All of the discussion above is in terms of operators with operands.
-Leaves of the expression tree (variables and constants), however,
-are peculiar in that they have no operands.
-In order to regularize the matching process,
-.II cexpr
-examines its operand to determine if it is a leaf;
-if so, it creates a special `load' operator whose operand
-is the leaf, and substitutes it for the argument tree;
-this allows the table entry for the created operator
-to use the `A1' notation to load the leaf into a register.
-.PP
-Purely to save space in the tables,
-pieces of subtables can be labelled and referred to later.
-It turns out, for example,
-that rather large portions of the
-the
-.II efftab
-table for the `=' and `=+' operators are identical.
-Thus `=' has an entry
-.DS
-%[move3:]
-%a,aw
-%ab,a
-       IBE     A2,A1
-.DE
-while part of the `=+' table is
-.DS
-%aw,aw
-%      [move3]
-.DE
-Labels are written as `%[ ... : ]',
-before the key specifications;
-references
-are written
-with `%  [ ... ]'
-after the key.
-Peculiarities in the implementation
-make it necessary that labels appear before references to them.
-.PP
-The example illustrates the utility
-of allowing separate keys
-to point to the same code string.
-The assignment code
-works properly if either the right operand is a word, or the left operand
-is a byte;
-but since there is no `add byte' instruction the addition code
-has to be restricted to word operands.
diff --git a/.ref-Research-V7/usr/doc/ctour/cdoc4 b/.ref-Research-V7/usr/doc/ctour/cdoc4
deleted file mode 100644 (file)
index 346ba33..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-.SH
-Delaying and reordering
-.PP
-Intertwined with the code generation routines are two other,
-interrelated processes.
-The first, implemented by a routine called
-.II delay,
-is based on the observation that
-naive code generation for the expression
-`a = b++' would produce
-.DS
-mov    b,r0
-inc    b
-mov    r0,a
-.DE
-The point is that the table for postfix ++ has to preserve
-the value of
-.II b
-before incrementing it;
-the general way to do this is to preserve its value in a register.
-A cleverer scheme would generate
-.DS
-mov    b,a
-inc    b
-.DE
-.II Delay
-is called for each expression input to
-.II rcexpr,
-and it searches for postfix ++ and \-\-
-operators.
-If one is found applied to a variable,
-the tree is patched to bypass the operator
-and compiled as it stands;
-then the increment or decrement itself is done.
-The effect is as if `a = b; b++' had been written.
-In this example, of course, the user himself could have done the same job,
-but more complicated examples are easily constructed, for example
-`switch (x++)'.
-An essential restriction is that the condition codes not
-be required.
-It would be incorrect to compile
-`if (a++) ...'
-as
-.DS
-tst    a
-inc    a
-beq    ...
-.DE
-because the `inc' destroys the required setting of the condition codes.
-.PP
-Reordering is a similar sort of optimization.
-Many cases which it detects are useful
-mainly with register variables.
-If
-.II r
-is a register variable,
-the expression `r = x+y' is best compiled
-as
-.DS
-mov    x,r
-add    y,r
-.DE
-but the codes tables would produce
-.DS
-mov    x,r0
-add    y,r0
-mov    r0,r
-.DE
-which is in fact preferred if
-.II r
-is not a register.
-(If
-.II r
-is not a register,
-the
-two sequences are the same size, but the
-second is slightly faster.)
-The scheme is to compile the expression as if it had been written
-`r = x; r =+ y'.
-The
-.II reorder
-routine
-is called with a pointer to each tree that
-.II rcexpr
-is about to compile;
-if it has the right characteristics,
-the `r = x' tree is constructed and passed recursively
-to
-.II rcexpr;
-then the original tree is modified to read `r =+ y'
-and the calling instance of
-.II rcexpr
-compiles that instead.
-Of course the whole business is itself recursive
-so that more extended forms of the same phenomenon are
-handled, like `r = x + y | z'.
-.PP
-Care does have to be taken
-to avoid `optimizing' an expression like `r = x + r'
-into `r = x; r =+ r'.
-It is required that the right operand of the expression on the right
-of the `=' be a ', distinct from the register variable.
-.PP
-The second case that
-.II reorder
-handles is expressions of the form `r = X' used as a subexpression.
-Again, the code out of the tables for
-`x = r = y'
-would be
-.DS
-mov    y,r0
-mov    r0,r
-mov    r0,x
-.DE
-whereas if
-.II r
-were a register it would be better to produce
-.DS
-mov    y,r
-mov    r,x
-.DE
-When
-.II reorder
-discovers that
-a register variable is being assigned to
-in a subexpression,
-it calls
-.II rcexpr
-recursively to
-compile the subexpression, then fiddles the tree passed
-to it so that the register variable itself appears
-as the operand instead of the whole subexpression.
-Here care has to be taken to avoid an infinite regress,
-with
-.II rcexpr
-and
-.II reorder
-calling each other forever to handle assignments to registers.
-.PP
-A third set of cases treated by
-.II reorder
-comes up when any name, not necessarily a register,
-occurs as a left operand of an assignment operator other than `='
-or as an operand of prefix `++' or `\-\-'.
-Unless condition-code tests are involved,
-when a subexpression like `(a =+ b)' is seen,
-the assignment is performed and the argument tree
-modified so that
-.II a
-is its operand;
-effectively
-`x + (y =+ z)' is compiled as `y =+ z; x + y'.
-Similarly, prefix increment and decrement are pulled out
-and performed first, then the remainder of the expression.
-.PP
-Throughout code generation,
-the expression optimizer is called whenever
-.II delay
-or
-.II reorder
-change the expression tree.
-This allows some special cases to be found that otherwise
-would not be seen.
diff --git a/.ref-Research-V7/usr/doc/dc b/.ref-Research-V7/usr/doc/dc
deleted file mode 100644 (file)
index f77522e..0000000
+++ /dev/null
@@ -1,709 +0,0 @@
-.RP
-....TM 75-1271-8 39199 39199-11
-.TL
-DC \- An Interactive Desk Calculator
-.AU "MH 2C-524" 3878
-Robert Morris
-.AU
-Lorinda Cherry
-.AI
-.MH
-.AB
-DC is an interactive desk calculator program implemented
-on the
-.UX
-time-sharing system to do arbitrary-precision
-integer arithmetic.
-It has provision for manipulating scaled fixed-point numbers and
-for input and output in bases other than decimal.
-.PP
-The size of numbers that can be manipulated is limited
-only by available core storage.
-On typical implementations of
-.UX ,
-the size of numbers that
-can be handled varies from several hundred digits on the smallest
-systems to several thousand on the largest.
-.AE
-.PP
-.SH
-.ND
-.PP
-DC is an arbitrary precision arithmetic package implemented
-on the
-.UX
-time-sharing system
-in the form of an interactive desk calculator.
-It works like a stacking calculator using reverse Polish notation.
-Ordinarily DC operates on decimal integers, but one may
-specify an input base, output base, and a number of fractional
-digits to be maintained.
-.PP
-A language called BC [1] has been developed which accepts
-programs written in the familiar style of higher-level
-programming languages and compiles output which is
-interpreted by DC.
-Some of the commands described below were designed
-for the compiler interface and are not easy for a human user
-to manipulate.
-.PP
-Numbers that are typed into DC are put on a push-down
-stack.
-DC commands work by taking the top number or two
-off the stack, performing the desired operation, and pushing the result
-on the stack.
-If an argument is given,
-input is taken from that file until its end,
-then from the standard input.
-.SH
-SYNOPTIC DESCRIPTION
-.PP
-Here we describe the DC commands that are intended
-for use by people.  The additional commands that are
-intended to be invoked by compiled output are
-described in the detailed description.
-.PP
-Any number of commands are permitted on a line.
-Blanks and new-line characters are ignored except within numbers
-and in places where a register name is expected.
-.PP
-The following constructions are recognized:
-.SH
-number
-.IP
-The value of the number is pushed onto the main stack.
-A number is an unbroken string of the digits 0-9
-and the capital letters A\-F which are treated as digits
-with values 10\-15 respectively.
-The number may be preceded by an underscore \*_ to input a
-negative number.
-Numbers may contain decimal points.
-.SH
-+  \-  *  %  ^
-.IP
-The
-top two values on the stack are added
-(\fB+\fP),
-subtracted
-(\fB\-\fP),
-multiplied (\fB*\fP),
-divided (\fB/\fP),
-remaindered (\fB%\fP),
-or exponentiated (^).
-The two entries are popped off the stack;
-the result is pushed on the stack in their place.
-The result of a division is an integer truncated toward zero.
-See the detailed description below for the treatment of
-numbers with decimal points.
-An exponent must not have any digits after the decimal point.
-.SH
-s\fIx\fP
-.IP
-The
-top of the main stack is popped and stored into
-a register named \fIx\fP, where \fIx\fP may be any character.
-If
-the
-.ft B
-s
-.ft
-is capitalized,
-.ft I
-x
-.ft
-is treated as a stack and the value is pushed onto it.
-Any character, even blank or new-line, is a valid register name.
-.SH
-l\fIx\fP
-.IP
-The
-value in register
-.ft I
-x
-.ft
-is pushed onto the stack.
-The register
-.ft I
-x
-.ft
-is not altered.
-If the
-.ft B
-l
-.ft
-is capitalized,
-register
-.ft I
-x
-.ft
-is treated as a stack and its top value is popped onto the main stack.
-.LP
-All registers start with empty value which is treated as a zero
-by the command \fBl\fP and is treated as an error by the command \fBL\fP.
-.SH
-.SH
-d
-.IP
-The
-top value on the stack is duplicated.
-.SH
-p
-.IP
-The top value on the stack is printed.
-The top value remains unchanged.
-.SH
-f
-.IP
-All values on the stack and in registers are printed.
-.SH
-x
-.IP
-treats the top element of the stack as a character string,
-removes it from the stack, and
-executes it as a string of DC commands.
-.SH
-[ ... ]
-.IP
-puts the bracketed character string onto the top of the stack.
-.SH
-q
-.IP
-exits the program.
-If executing a string, the recursion level is
-popped by two.
-If
-.ft B
-q
-.ft
-is capitalized,
-the top value on the stack is popped and the string execution level is popped
-by that value.
-.SH
-<\fIx\fP  >\fIx\fP  =\fIx\fP  !<\fIx\fP  !>\fIx\fP  !=\fIx\fP
-.IP
-The
-top two elements of the stack are popped and compared.
-Register
-.ft I
-x
-.ft
-is executed if they obey the stated
-relation.
-Exclamation point is negation.
-.SH
-v
-.IP
-replaces the top element on the stack by its square root.
-The square root of an integer is truncated to an integer.
-For the treatment of numbers with decimal points, see
-the detailed description below.
-.SH
-!
-.IP
-interprets the rest of the line as a
-.UX
-command.
-Control returns to DC when the
-.UX
-command terminates.
-.SH
-c
-.IP
-All values on the stack are popped; the stack becomes empty.
-.SH
-i
-.IP
-The top value on the stack is popped and used as the
-number radix for further input.
-If \fBi\fP is capitalized, the value of
-the input base is pushed onto the stack.
-No mechanism has been provided for the input of arbitrary
-numbers in bases less than 1 or greater than 16.
-.SH
-o
-.IP
-The top value on the stack is popped and used as the
-number radix for further output.
-If \fBo\fP is capitalized, the value of the output
-base is pushed onto the stack.
-.SH
-k
-.IP
-The top of the stack is popped, and that value is used as
-a scale factor
-that influences the number of decimal places
-that are maintained during multiplication, division, and exponentiation.
-The scale factor must be greater than or equal to zero and
-less than 100.
-If \fBk\fP is capitalized, the value of the scale factor
-is pushed onto the stack.
-.SH
-z
-.IP
-The value of the stack level is pushed onto the stack.
-.SH
-?
-.IP
-A line of input is taken from the input source (usually the console)
-and executed.
-.SH
-DETAILED DESCRIPTION
-.SH
-Internal Representation of Numbers
-.PP
-Numbers are stored internally using a dynamic storage allocator.
-Numbers are kept in the form of a string
-of digits to the base 100 stored one digit per byte
-(centennial digits).
-The string is stored with the low-order digit at the
-beginning of the string.
-For example, the representation of 157
-is 57,1.
-After any arithmetic operation on a number, care is taken
-that all digits are in the range 0\-99 and that
-the number has no leading zeros.
-The number zero is represented by the empty string.
-.PP
-Negative numbers are represented in the 100's complement
-notation, which is analogous to two's complement notation for binary
-numbers.
-The high order digit of a negative number is always \-1
-and all other digits are in the range 0\-99.
-The digit preceding the high order \-1 digit is never a 99.
-The representation of \-157 is 43,98,\-1.
-We shall call this the canonical form of a number.
-The advantage of this kind of representation of negative
-numbers is ease of addition.  When addition is performed digit
-by digit, the result is formally correct.  The result need only
-be modified, if necessary, to put it into canonical form.
-.PP
-Because the largest valid digit is 99 and the byte can
-hold numbers twice that large, addition can be carried out
-and the handling of carries done later when
-that is convenient, as it sometimes is.
-.PP
-An additional byte is stored with each number beyond
-the high order digit to indicate the number of
-assumed decimal digits after the decimal point.  The representation
-of .001 is 1,\fI3\fP
-where the scale has been italicized to emphasize the fact that it
-is not the high order digit.
-The value of this extra byte is called the
-.ft B
-scale factor
-.ft
-of the number.
-.SH
-The Allocator
-.PP
-DC uses a dynamic string storage allocator
-for all of its internal storage.
-All reading and writing of numbers internally is done through
-the allocator.
-Associated with each string in the allocator is a four-word header containing pointers
-to the beginning of the string, the end of the string,
-the next place to write, and the next place to read.
-Communication between the allocator and DC
-is done via pointers to these headers.
-.PP
-The allocator initially has one large string on a list
-of free strings.  All headers except the one pointing
-to this string are on a list of free headers.
-Requests for strings are made by size.
-The size of the string actually supplied is the next higher
-power of 2.
-When a request for a string is made, the allocator
-first checks the free list to see if there is
-a string of the desired size.
-If none is found, the allocator finds the next larger free string and splits it repeatedly until
-it has a string of the right size.
-Left-over strings are put on the free list.
-If there are no larger strings,
-the allocator tries to coalesce smaller free strings into
-larger ones.
-Since all strings are the result
-of splitting large strings,
-each string has a neighbor that is next to it in core
-and, if free, can be combined with it to make a string twice as long.
-This is an implementation of the `buddy system' of allocation
-described in [2].
-.PP
-Failing to find a string of the proper length after coalescing,
-the allocator asks the system for more space.
-The amount of space on the system is the only limitation
-on the size and number of strings in DC.
-If at any time in the process of trying to allocate a string, the allocator runs out of
-headers, it also asks the system for more space.
-.PP
-There are routines in the allocator for reading, writing, copying, rewinding,
-forward-spacing, and backspacing strings.
-All string manipulation is done using these routines.
-.PP
-The reading and writing routines
-increment the read pointer or write pointer so that
-the characters of a string are read or written in
-succession by a series of read or write calls.
-The write pointer is interpreted as the end of the
-information-containing portion of a string and a call
-to read beyond that point returns an end-of-string indication.
-An attempt to write beyond the end of a string
-causes the allocator to
-allocate a larger space and then copy
-the old string into the larger block.
-.SH
-Internal Arithmetic
-.PP
-All arithmetic operations are done on integers.
-The operands (or operand) needed for the operation are popped
-from the main stack and their scale factors stripped off.
-Zeros are added or digits removed as necessary to get
-a properly scaled result from the internal arithmetic routine.
-For example, if the scale of the operands is different and decimal
-alignment is required, as it is for
-addition, zeros are appended to the operand with the smaller
-scale.
-After performing the required arithmetic operation,
-the proper scale factor is appended to the end of the number before
-it is pushed on the stack.
-.PP
-A register called \fBscale\fP plays a part
-in the results of most arithmetic operations.
-\fBscale\fP is the bound on the number of decimal places retained in
-arithmetic computations.
-\fBscale\fP may be set to the number on the top of the stack
-truncated to an integer with the \fBk\fP command.
-\fBK\fP may be used to push the value of \fBscale\fP on the stack.
-\fBscale\fP must be greater than or equal to 0 and less than 100.
-The descriptions of the individual arithmetic operations will
-include the exact effect of \fBscale\fP on the computations.
-.SH
-Addition and Subtraction
-.PP
-The scales of the two numbers are compared and trailing
-zeros are supplied to the number with the lower scale to give both
-numbers the same scale.  The number with the smaller scale is
-multiplied by 10 if the difference of the scales is odd.
-The scale of the result is then set to the larger of the scales
-of the two operands.
-.PP
-Subtraction is performed by negating the number
-to be subtracted and proceeding as in addition.
-.PP
-Finally, the addition is performed digit by digit from the
-low order end of the number.  The carries are propagated
-in the usual way.
-The resulting number is brought into canonical form, which may
-require stripping of leading zeros, or for negative numbers
-replacing the high-order configuration 99,\-1 by the digit \-1.
-In any case, digits which are not in the range 0\-99 must
-be brought into that range, propagating any carries or borrows
-that result.
-.SH
-Multiplication
-.PP
-The scales are removed from the two operands and saved.
-The operands are both made positive.
-Then multiplication is performed in
-a digit by digit manner that exactly mimics the hand method
-of multiplying.
-The first number is multiplied by each digit of the second
-number, beginning with its low order digit.  The intermediate
-products are accumulated into a partial sum which becomes the
-final product.
-The product is put into the canonical form and its sign is
-computed from the signs of the original operands.
-.PP
-The scale of the result is set equal to the sum
-of the scales of the two operands.
-If that scale is larger than the internal register
-.ft B
-scale
-.ft
-and also larger than both of the scales of the two operands,
-then the scale of the result is set equal to the largest
-of these three last quantities.
-.SH
-Division
-.PP
-The scales are removed from the two operands.
-Zeros are appended or digits removed from the dividend to make
-the scale of the result of the integer division equal to
-the internal quantity
-\fBscale\fP.
-The signs are removed and saved.
-.PP
-Division is performed much as it would be done by hand.
-The difference of the lengths of the two numbers
-is computed.
-If the divisor is longer than the dividend,
-zero is returned.
-Otherwise the top digit of the divisor is divided into the top
-two digits of the dividend.
-The result is used as the first (high-order) digit of the
-quotient.
-It may turn out be one unit too low, but if it is, the next
-trial quotient will be larger than 99 and this will be
-adjusted at the end of the process.
-The trial digit is multiplied by the divisor and the result subtracted
-from the dividend and the process is repeated to get
-additional quotient digits until the remaining
-dividend is smaller than the divisor.
-At the end, the digits of the quotient are put into
-the canonical form, with propagation of carry as needed.
-The sign is set from the sign of the operands.
-.SH
-Remainder
-.PP
-The division routine is called and division is performed
-exactly as described.  The quantity returned is the remains of the
-dividend at the end of the divide process.
-Since division truncates toward zero, remainders have the same
-sign as the dividend.
-The scale of the remainder is set to 
-the maximum of the scale of the dividend and
-the scale of the quotient plus the scale of the divisor.
-.SH
-Square Root
-.PP
-The scale is stripped from the operand.
-Zeros are added if necessary to make the
-integer result have a scale that is the larger of
-the internal quantity
-\fBscale\fP
-and the scale of the operand.
-.PP
-The method used to compute sqrt(y) is Newton's method
-with successive approximations by the rule
-.EQ
-x sub {n+1} ~=~ half ( x sub n + y over x sub n )
-.EN
-The initial guess is found by taking the integer square root
-of the top two digits.
-.SH
-Exponentiation
-.PP
-Only exponents with zero scale factor are handled.  If the exponent is
-zero, then the result is 1.  If the exponent is negative, then
-it is made positive and the base is divided into one.  The scale
-of the base is removed.
-.PP
-The integer exponent is viewed as a binary number.
-The base is repeatedly squared and the result is
-obtained as a product of those powers of the base that
-correspond to the positions of the one-bits in the binary
-representation of the exponent.
-Enough digits of the result
-are removed to make the scale of the result the same as if the
-indicated multiplication had been performed.
-.SH
-Input Conversion and Base
-.PP
-Numbers are converted to the internal representation as they are read
-in.
-The scale stored with a number is simply the number of fractional digits input.
-Negative numbers are indicated by preceding the number with a \fB\_\fP.
-The hexadecimal digits A\-F correspond to the numbers 10\-15 regardless of input base.
-The \fBi\fP command can be used to change the base of the input numbers.
-This command pops the stack, truncates the resulting number to an integer,
-and uses it as the input base for all further input.
-The input base is initialized to 10 but may, for example be changed to
-8 or 16 to do octal or hexadecimal to decimal conversions.
-The command \fBI\fP will push the value of the input base on the stack.
-.SH
-Output Commands
-.PP
-The command \fBp\fP causes the top of the stack to be printed.
-It does not remove the top of the stack.
-All of the stack and internal registers can be output
-by typing the command \fBf\fP.
-The \fBo\fP command can be used to change the output base.
-This command uses the top of the stack, truncated to an integer as
-the base for all further output.
-The output base in initialized to 10.
-It will work correctly for any base.
-The command \fBO\fP pushes the value of the output base on the stack.
-.SH
-Output Format and Base
-.PP
-The input and output bases only affect
-the interpretation of numbers on input and output; they have no
-effect on arithmetic computations.
-Large numbers are output with 70 characters per line;
-a \\ indicates a continued line.
-All choices of input and output bases work correctly, although not all are
-useful.
-A particularly useful output base is 100000, which has the effect of
-grouping digits in fives.
-Bases of 8 and 16 can be used for decimal-octal or decimal-hexadecimal
-conversions.
-.SH
-Internal Registers
-.PP
-Numbers or strings may be stored in internal registers or loaded on the stack
-from registers with the commands \fBs\fP and \fBl\fP.
-The command \fBs\fIx\fR pops the top of the stack and
-stores the result in register \fBx\fP.
-\fIx\fP can be any character.
-\fBl\fIx\fR puts the contents of register \fBx\fP on the top of the stack.
-The \fBl\fP command has no effect on the contents of register \fIx\fP.
-The \fBs\fP command, however, is destructive.
-.SH
-Stack Commands
-.PP
-The command \fBc\fP clears the stack.
-The command \fBd\fP pushes a duplicate of the number on the top of the stack
-on the stack.
-The command \fBz\fP pushes the stack size on the stack.
-The command \fBX\fP replaces the number on the top of the stack
-with its scale factor.
-The command \fBZ\fP replaces the top of the stack
-with its length.
-.SH
-Subroutine Definitions and Calls
-.PP
-Enclosing a string in \fB[]\fP pushes the ascii string on the stack.
-The \fBq\fP command quits or in executing a string, pops the recursion levels by two.
-.SH
-Internal Registers \- Programming DC
-.PP
-The load and store
-commands together with \fB[]\fP to store strings, \fBx\fP to execute
-and the testing commands `<', `>', `=', `!<', `!>', `!=' can be used to program
-DC.
-The \fBx\fP command assumes the top of the stack is an string of DC commands
-and executes it.
-The testing commands compare the top two elements on the stack and if the relation holds, execute the register
-that follows the relation.
-For example, to print the numbers 0-9,
-.DS
-[lip1+  si  li10>a]sa
-0si  lax
-.DE
-.SH
-Push-Down Registers and Arrays
-.PP
-These commands were designed for used by a compiler, not by
-people.
-They involve push-down registers and arrays.
-In addition to the stack that commands work on, DC can be thought
-of as having individual stacks for each register.
-These registers are operated on by the commands \fBS\fP and \fBL\fP.
-\fBS\fIx\fR pushes the top value of the main stack onto the stack for
-the register \fIx\fP.
-\fBL\fIx\fR pops the stack for register \fIx\fP and puts the result on the main
-stack.
-The commands \fBs\fP and \fBl\fP also work on registers but not as push-down
-stacks.
-\fBl\fP doesn't effect the top of the
-register stack, and \fBs\fP destroys what was there before.
-.PP
-The commands to work on arrays are \fB:\fP and \fB;\fP.
-\fB:\fIx\fR pops the stack and uses this value as an index into
-the array \fIx\fP.
-The next element on the stack is stored at this index in \fIx\fP.
-An index must be greater than or equal to 0 and
-less than 2048.
-\fB;\fIx\fR is the command to load the main stack from the array \fIx\fP.
-The value on the top of the stack is the index
-into the array \fIx\fP of the value to be loaded.
-.SH
-Miscellaneous Commands
-.PP
-The command \fB!\fP interprets the rest of the line as a 
-.UX
- command and passes
-it to 
-.UX
-to execute.
-One other compiler command is \fBQ\fP.
-This command uses the top of the stack as the number of levels of recursion to skip.
-.SH
-DESIGN CHOICES
-.PP
-The real reason for the use of a dynamic storage allocator was
-that a general purpose program could be (and in fact has been)
-used for a variety of other tasks.
-The allocator has some value for input and for compiling (i.e.
-the bracket [...] commands) where it cannot be known in advance
-how long a string will be.
-The result was that at a modest
-cost in execution time, all considerations of string allocation
-and sizes of strings were removed from the remainder of the program
-and debugging was made easier.  The allocation method
-used wastes approximately 25% of available space.
-.PP
-The choice of 100 as a base for internal arithmetic
-seemingly has no compelling advantage.  Yet the base cannot
-exceed 127 because of hardware limitations and at the cost
-of 5% in space, debugging was made a great deal easier and
-decimal output was made much faster.
-.PP
-The reason for a stack-type arithmetic design was
-to permit all DC commands from addition to subroutine execution
-to be implemented in essentially the same way.  The result
-was a considerable degree of logical separation of the final
-program into modules with very little communication between
-modules.
-.PP
-The rationale for the lack of interaction between the scale and the bases
-was to provide an understandable means of proceeding after
-a change of base or scale when numbers had already been entered.
-An earlier implementation which had global notions of
-scale and base did not work out well.
-If the value of
-.ft B
-scale
-.ft
-were to be interpreted in the current
-input or output base,
-then a change of base or scale in the midst of a
-computation would cause great confusion in the interpretation
-of the results.
-The current scheme has the advantage that the value of
-the input and output bases
-are only used for input and output, respectively, and they
-are ignored in all other operations.
-The value of
-scale
-is not used for any essential purpose by any part of the program
-and it is used only to prevent the number of
-decimal places resulting from the arithmetic operations from
-growing beyond all bounds.
-.PP
-The design rationale for the choices for the scales of
-the results of arithmetic were that in no case should
-any significant digits be thrown away if, on appearances, the
-user actually wanted them.  Thus, if the user wants
-to add the numbers 1.5 and 3.517, it seemed reasonable to give
-him the result 5.017 without requiring him to unnecessarily
-specify his rather obvious requirements for precision.
-.PP
-On the other hand, multiplication and exponentiation produce
-results with many more digits than their operands and it
-seemed reasonable to give as a minimum the number of decimal
-places in the operands but not to give more than that
-number of digits
-unless the user asked for them by specifying a value for \fBscale\fP.
-Square root can be handled in just the same way as multiplication.
-The operation of division gives arbitrarily many decimal places
-and there is simply no way to guess how many places the user
-wants.
-In this case only, the user must
-specify a \fBscale\fP to get any decimal places at all.
-.PP
-The scale of remainder was chosen to make it possible
-to recreate the dividend from the quotient and remainder.
-This is easy to implement; no digits are thrown away.
-.SH
-References
-.IP [1]
-L. L. Cherry, R. Morris,
-.ft I
-BC \- An Arbitrary Precision Desk-Calculator Language.
-.ft
-.IP [2]
-K. C. Knowlton,
-.ft I
-A Fast Storage Allocator,
-.ft
-Comm. ACM \fB8\fP, pp. 623-625 (Oct. 1965).
diff --git a/.ref-Research-V7/usr/doc/edtut/e.mac b/.ref-Research-V7/usr/doc/edtut/e.mac
deleted file mode 100644 (file)
index dc845b3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-.ds . \&\s+2.\s0\&
-.de UC
-\&\\$3\s-1\\$1\s0\\$2
-..
-.de UL
-.if t \&\\$3\f3\\$1\f1\\$2
-.if n \&\\$3\f2\\$1\f1\\$2
-..
-.de IT
-\&\\$3\f2\\$1\fP\\$2
-..
-.de UI
-\f3\\$1\fI\\$2\fR\\$3
-..
-.de P1
-.if n .ls 1
-.nf
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ta .3i .6i .9i 1.2i 1.5i 1.8i
-.tr -\-
-.              use first argument as indent if present
-.if \\n(.$ .DS I \\$1
-.if !\\n(.$ .DS I 5
-.bd 1 2
-..
-.de P2
-.br
-.bd 1 2
-.DE
-.bd 1
-.tr --
-.if n .ls 2
-..
-.hy 14
-.      2=not last lines; 4= no -xx; 8=no xx-
-.tr *\(**
-.nr PI .2i
diff --git a/.ref-Research-V7/usr/doc/edtut/e0 b/.ref-Research-V7/usr/doc/edtut/e0
deleted file mode 100644 (file)
index b347ce7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-.RP
-.TL
-A Tutorial Introduction to the \s-2UNIX\s+2 Text Editor
-.AU
-Brian W. Kernighan
-.AI
-.MH
-.AB
-.PP
-Almost all text input on
-the
-.UX
-operating system
-is done with
-the text-editor
-.IT ed .
-This memorandum is a tutorial guide
-to help beginners get started
-with text editing.
-.PP
-Although it does not cover everything,
-it does discuss enough for most users'
-day-to-day needs.
-This includes
-printing, appending, changing, deleting, moving and inserting entire lines of text;
-reading and writing files;
-context searching and line addressing;
-the substitute command;
-the global commands;
-and the use of special characters for advanced editing.
-.AE
diff --git a/.ref-Research-V7/usr/doc/edtut/e1 b/.ref-Research-V7/usr/doc/edtut/e1
deleted file mode 100644 (file)
index 69a11d3..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-.nr PS 9
-.nr VS 11
-.if t .2C
-.SH
-Introduction
-.PP
-.ul
-Ed
-is a ``text editor'', that is, an interactive program
-for creating and modifying ``text'',
-using directions provided by a user at
-a terminal.
-The text is often a document
-like this one,
-or a program
-or perhaps data for a program.
-.PP
-This introduction is meant to simplify learning
-.ul
-ed.
-The recommended way to learn
-.ul
-ed
-is to read this document,
-simultaneously using
-.ul
-ed
-to follow the examples,
-then to read the description in section I of the
-.ul
-.UC UNIX
-.ul
-Programmer's Manual,
-all the while
-experimenting with
-.ul
-ed.
-(Solicitation of advice from experienced users is also useful.)
-.PP
-Do the exercises!
-They cover material not completely discussed
-in the actual text.
-An appendix summarizes the commands.
-.SH
-Disclaimer
-.PP
-This is an introduction and a tutorial.
-For this reason, no attempt is made to
-cover more than a part of the facilities that
-.ul
-ed
-offers
-(although this fraction includes the most useful and frequently used
-parts).
-When you have mastered the Tutorial,
-try
-.ul
-Advanced Editing on
-.ul
-.UC UNIX .
-Also,
-there is not enough space to explain basic
-.UC UNIX
-procedures.
-We will assume that you know how to log on to
-.UC UNIX ,
-and that you have at least a vague understanding
-of what a file is.
-For more on that, read
-.ul
-.UC UNIX
-.ul
-for Beginners.
-.PP
-You must also know what character to type as the end-of-line
-on your particular terminal.
-This character is the
-.UC RETURN
-key on most terminals.
-Throughout, we will refer to this character,
-whatever it is,
-as
-.UC RETURN .
-.SH
-Getting Started
-.PP
-We'll assume that you have logged in to
-your system
-and it has just printed the prompt character,
-usually either a
-.UL $
-or a
-.UL % .
-The
-easiest way to get
-.ul
-ed
-is to type
-.P1
-ed     (followed by a return)
-.P2
-You are now ready to go \-
-.ul
-ed
-is waiting for you to tell it what to do.
-.SH
-Creating Text \- the Append command ``a''
-.PP
-As your first problem, suppose you want to create some text
-starting from scratch.
-Perhaps you are typing the very first
-draft of a paper; clearly it will have to start
-somewhere, and undergo modifications later.
-This section will show how to get some text in, just to
-get started.
-Later we'll talk about how to change it.
-.PP
-When
-.ul
-ed
-is first started, it is rather like working
-with a blank piece of paper \- there is no text
-or information present.
-This must be supplied by the person using
-.ul
-ed;
-it is usually done
-by typing in the text, or by reading it into
-.ul
-ed
-from a
-file.
-We will start by typing in some text, and return shortly to how to
-read files.
-.PP
-First a bit of terminology.
-In
-.ul
-ed
-jargon, the text being
-worked on is said to be ``kept in a buffer.''
-Think of the
-buffer as a work space, if you like, or simply as the information
-that you are going to be editing.
-In effect the buffer is like the
-piece of paper, on which we will write things, then change some
-of them, and finally file the whole thing away for another day.
-.PP
-The user tells
-.ul
-ed
-what to do to his text
-by typing instructions called ``commands.''
-Most
-commands consist of a single letter,
-which must be typed in lower case.
-Each command is typed
-on a separate line.
-(Sometimes the command is preceded by information
-about what line or lines of text are to be affected \-
-we will discuss these shortly.)
-.ul
-Ed
-makes no response
-to most commands \- there is no prompting
-or typing of messages like ``ready''.
-(This silence is preferred
-by experienced users, but sometimes a hangup for beginners.)
-.PP
-The first command is
-.ul
-append,
-written as the letter
-.P1
-a
-.P2
-all
-by itself.
-It means ``append (or add) text lines to the buffer,
-as I type them in.''
-Appending is rather like
-writing fresh material on a piece of paper.
-.PP
-So to enter lines of text into the buffer,
-just type an
-.UL a
-followed by a
-.UC RETURN ,
-followed by the lines of text you want, like this:
-.P1
-a
-Now is the time
-for all good men
-to come to the aid of their party.
-\*.
-.P2
-.PP
-The only way to stop appending is to type a
-line that contains only a period.
-The ``\*.'' is used
-to tell
-.ul
-ed
-that you have finished appending.
-(Even experienced users forget that terminating ``\*.''
-sometimes.
-If
-.ul
-ed
-seems to be ignoring you,
-type an extra line with just ``\*.'' on it.
-You may then find you've added some garbage lines
-to your text, which you'll have to take out later.)
-.PP
-After the append command has been done, the buffer will
-contain the three lines
-.P1
-Now is the time
-for all good men
-to come to the aid of their party.
-.P2
-The
-.UL a '' ``
-and ``\*.'' aren't there, because they are
-not text.
-.PP
-To add more text to what you already have,
-just issue another
-.UL a
-command, and continue typing.
-.SH
-Error Messages \- ``?''
-.PP
-If at any time you make an error in the commands you type to
-.ul
-ed,
-it will tell you by typing
-.P1
-?
-.P2
-This is about as cryptic as it can be,
-but with practice, you can usually
-figure out how you goofed.
diff --git a/.ref-Research-V7/usr/doc/edtut/e2 b/.ref-Research-V7/usr/doc/edtut/e2
deleted file mode 100644 (file)
index 8889044..0000000
+++ /dev/null
@@ -1,427 +0,0 @@
-.SH
-Writing text out as a file \- the Write command ``w''
-.PP
-It's likely that you'll want to save your text for later use.
-To write out the contents of the buffer onto a file,
-use the
-.ul
-write
-command
-.P1
-w
-.P2
-followed by the filename you want to write on.
-This will copy the buffer's contents
-onto the specified file
-(destroying any previous information on the file).
-To save
-the text on a file named
-.UL junk ,
-for example, type
-.P1
-w junk
-.P2
-Leave a space between
-.UL w
-and the file name.
-.ul
-Ed
-will respond by printing
-the number of characters it wrote out.
-In this case,
-.ul
-ed
-would respond with
-.P1
-68
-.P2
-(Remember that blanks and the return character at the end of each
-line are included in the character count.)
-Writing a file just makes a copy of the text \- the
-buffer's contents are not disturbed, so you can go on adding
-lines to it.
-This is an important point.
-.ul
-Ed
-at all times works on a copy
-of a file, not the file itself.
-No change in the contents
-of a file takes place until you give a
-.UL w
-command.
-(Writing out the text onto a file from time to time as it is being
-created is a good idea, since if the system crashes or if you make some horrible mistake, you will lose
-all the text in the buffer but any text that was written onto
-a file is relatively safe.)
-.SH
-Leaving ed \- the Quit command ``q''
-.PP
-To terminate a session with
-.IT ed ,
-save the text you're working on
-by writing it onto a file using the
-.UL w
-command,
-and then type the command
-.P1
-q
-.P2
-which
-stands for
-.IT quit .
-The system will respond with
-the prompt character
-.UL $ "" (
-or
-.UL % ).
-At
-this point your buffer vanishes, with all its text,
-which is why you want to write it out before quitting.\(dg
-.FS
-\(dg Actually,
-.IT ed
-will print 
-.UL ?
-if you try to quit without writing.
-At that point, write if you want;
-if not, another
-.UL q
-will get you out regardless.
-.FE
-.SH
-Exercise 1:
-.PP
-Enter
-.ul
-ed
-and
-create some text using
-.P1
-a
-\&. . . text . . .
-\&\fB.\fR
-.P2
-Write it out using
-.UL w .
-Then leave
-.ul
-ed
-with the
-.UL q
-command, and print the file,
-to see that everything worked.
-(To print a file, say
-.P1
-pr filename
-.P2
-or
-.P1
-cat filename
-.P2
-in response to
-the prompt character.
-Try both.)
-.SH
-Reading text from a file \- the Edit command ``e''
-.PP
-A common way to get text into the buffer is to read it
-from a file in the file system.
-This is what you do to edit text
-that you saved with the 
-.UL w
-command in a previous session.
-The
-.ul
-edit
-command
-.UL e
-fetches the entire contents of a file into the buffer.
-So if you had saved the three lines
-``Now is the time'', etc.,
-with a
-.UL w
-command in an earlier session,
-the 
-.ul
-ed
-command
-.P1
-e junk
-.P2
-would fetch the entire contents of the file
-.UL junk
-into the buffer, and respond
-.P1
-68
-.P2
-which is the number of characters in
-.UL junk .
-.ul
-If anything was already in the buffer, it is deleted first.
-.PP
-If you use the
-.UL e
-command to read a file into the buffer,
-then you need not use a file name after a subsequent
-.UL w
-command;
-.ul
-ed
-remembers the last file name used in an
-.UL e
-command,
-and
-.UL w
-will write on this file.
-Thus a good way to operate is
-.P1
-ed
-e file
-[editing session]
-w
-q
-.P2
-This way, you can simply say
-.UL w
-from time to time,
-and be secure in the knowledge that
-if you got the file name right at the beginning,
-you are writing into the proper file each time.
-.PP
-You can find out at any time what file name
-.ul
-ed
-is remembering by typing the 
-.ul
-file
-command
-.UL f .
-In this example,
-if you typed
-.P1
-f
-.P2
-.ul
-ed
-would reply
-.P1
-junk
-.P2
-.SH
-Reading text from a file \- the Read command ``r''
-.PP
-Sometimes you want to read a file into the buffer
-without destroying anything that is already there.
-This is done by the
-.ul
-read
-command
-.UL r .
-The command
-.P1
-r junk
-.P2
-will read the file
-.UL junk
-into the buffer;
-it adds it
-to the end of whatever is already in the buffer.
-So if you do a read after
-an edit:
-.P1
-e junk
-r junk
-.P2
-the buffer will contain
-.ul
-two
-copies of the text (six lines).
-.P1
-Now is the time
-for all good men
-to come to the aid of their party.
-Now is the time
-for all good men
-to come to the aid of their party.
-.P2
-Like the
-.UL w
-and
-.UL e
-commands,
-.UL r
-prints
-the
-number of characters read in, after the reading operation is complete.
-.PP
-Generally speaking,
-.UL r
-is much less used than
-.UL e .
-.SH
-Exercise 2:
-.PP
-Experiment with the
-.UL e
-command \-
-try reading and printing various files.
-You may get an error
-.UL ?name ,
-where
-.UL name
-is the name of a file;
-this means that the file doesn't exist,
-typically because you spelled the file name wrong,
-or perhaps that you are not allowed to read or write it.
-Try alternately reading and appending to see that they work
-similarly.
-Verify that
-.P1
-ed filename
-.P2
-is exactly equivalent to
-.P1
-ed
-e filename
-.P2
-What does
-.P1
-f filename
-.P2
-do?
-.SH
-Printing the contents of the buffer \- the Print command ``p''
-.PP
-To
-.ul
-print
-or list the contents of the buffer (or parts
-of it) on the terminal, use the print command
-.P1
-p
-.P2
-The way this is done is as follows.
-Specify the lines where
-you want printing to begin and where you want it to end,
-separated by a comma, and
-followed by the letter
-.UL p .
-Thus to print the first two lines of the buffer, for
-example, (that is, lines 1 through 2) say
-.P1
-1,2p   (starting line=1, ending line=2 p)
-.P2
-.ul
-Ed
-will respond with
-.P1
-Now is the time
-for all good men
-.P2
-.PP
-Suppose you want to print
-.ul
-all
-the lines in the buffer.
-You could use
-.UL 1,3p
-as above if you knew there were exactly
-3 lines in the buffer.
-But in general, you don't
-know how many there are, so what do you use for the ending
-line number?
-.ul
-Ed
-provides a shorthand symbol for ``line number of
-last line in buffer'' \- the dollar sign
-.UL $ .
-Use it this
-way:
-.P1
-1,$p
-.P2
-This will print
-.ul
-all
-the lines in the buffer (line 1 to last line.)
-If you want to stop the printing before it is finished,
-push the
-.UC DEL
-or Delete key;
-.ul
-ed
-will type
-.P1
-?
-.P2
-and wait for the next command.
-.PP
-To print the
-.ul
-last
-line of the buffer, you could use
-.P1
-$,$p
-.P2
-but
-.ul
-ed
-lets you abbreviate this to
-.P1
-$p
-.P2
-You can print any single line by typing the line
-number followed by a
-.UL p .
-Thus
-.P1
-1p
-.P2
-produces the response
-.P1
-Now is the time
-.P2
-which is the first line of the buffer.
-.PP
-In fact,
-.ul
-ed
-lets you abbreviate even further:
-you can print any single line by typing
-.ul
-just
-the line number \- no need to type the letter
-.UL p .
-So if you say
-.P1
-$
-.P2
-.ul
-ed
-will print the last line of the buffer.
-.PP
-You can also use
-.UL $
-in combinations like
-.P1
-$\-1,$p
-.P2
-which prints the last two lines of the buffer.
-This helps when you want to see how far you got in typing.
-.SH
-Exercise 3:
-.PP
-As before, create some text using the
-.UL a
-command and
-experiment with the
-.UL p
-command.
-You will find, for example,
-that you can't print line 0 or a line beyond
-the end of the buffer, and that attempts
-to print a buffer in reverse order by saying
-.P1
-3,1p
-.P2
-don't work.
diff --git a/.ref-Research-V7/usr/doc/edtut/e3 b/.ref-Research-V7/usr/doc/edtut/e3
deleted file mode 100644 (file)
index cba7dc3..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-.SH
-The current line \- ``Dot'' or ``.''
-.PP
-Suppose your buffer still contains the six lines as above,
-that you have just typed
-.P1
-1,3p
-.P2
-and
-.ul
-ed
-has printed the three lines for you.
-Try typing just
-.P1
-p      (no line numbers)
-.P2
-This will print
-.P1
-to come to the aid of their party.
-.P2
-which is the third line of the buffer.
-In fact it is the last
-(most recent) line that you have done anything with.
-(You just printed it!)
-You can
-repeat this
-.UL p
-command without line numbers, and
-it will continue to print line 3.
-.PP
-The reason is that
-.ul
-ed
-maintains a record of the last line
-that you did anything to (in this case, line 3, which you
-just printed) so that it can be used instead of an explicit
-line number.
-This most recent line is referred to by the
-shorthand symbol
-.P1
-\&\*.  (pronounced ``dot'').
-.P2
-Dot is a line number in the same way that
-.UL $
-is; it means
-exactly ``the current line'', or loosely,
-``the line you most recently did something to.''
-You
-can use it in several ways \- one possibility
-is to say
-.P1
-\&\*.,$p
-.P2
-This will print all the lines from (including) the current
-line to the
-end of the buffer.
-In our example these are lines 3 through 6.
-.PP
-Some commands change the value of dot, while others do not.
-The
-.UL p
-command sets dot to the number of the last line printed;
-the last command will
-set both
-\*.
-and
-.UL $
-to 6.
-.PP
-Dot is most useful when used in combinations like this one:
-.P1
-\&\*.+1        (or equivalently, \*.+1p)
-.P2
-This means ``print the next line'' and is a handy way to step
-slowly through a buffer.
-You can also say
-.P1
-\&\*.\-1       (or \*.\-1p )
-.P2
-which means ``print the line
-.ul
-before
-the current line.''
-This enables you to go backwards if you wish.
-Another useful one is something like
-.P1
-\&\*.\-3,\*.\-1p
-.P2
-which prints the previous three lines.
-.PP
-Don't forget that all of these change the value of dot.
-You can find out what dot is at any time by typing
-.P1
-\&\*.=
-.P2
-.ul
-Ed
-will respond by printing the value of dot.
-.PP
-Let's summarize some things about the
-.UL p
-command
-and dot.
-Essentially
-.UL p
-can be preceded by 0, 1, or 2 line numbers.
-If there is no line number given, it prints the ``current line'',
-the line that dot refers to.
-If there is one line number given
-(with or without the letter
-.UL p ),
-it prints that line (and dot is set there); and if there
-are two line numbers, it prints all the lines in that range
-(and sets dot to the last line printed.)
-If two line numbers are specified
-the first can't be bigger than the second (see Exercise 2.)
-.PP
-Typing a single return will cause printing of the next line \-
-it's
-equivalent to
-.UL .+1p .
-Try it.
-Try typing
-a
-.UL \- ;
-you will find that
-it's equivalent to
-.UL .\-1p .
-.SH
-Deleting lines: the ``d'' command
-.PP
-Suppose you want to get rid of the three extra lines in the buffer.
-This is done by the
-.ul
-delete
-command
-.P1
-d
-.P2
-Except that
-.UL d
-deletes lines instead of printing them,
-its action is similar to that of
-.UL p .
-The lines to be deleted are specified for
-.UL d
-exactly as they are for
-.UL p :
-.P1
-\fIstarting line, ending line\fP d
-.P2
-Thus the command
-.P1
-4,$d
-.P2
-deletes lines 4 through the end.
-There are now three lines left, as you can check by using
-.P1
-1,$p
-.P2
-And notice that
-.UL $
-now is line 3!
-Dot
-is set to the next line after the last line deleted,
-unless the last line deleted is the last line in the buffer.
-In that case, dot is set to
-.UL $ .
-.SH
-Exercise 4:
-.PP
-Experiment with
-.UL a ,
-.UL e ,
-.UL r ,
-.UL w ,
-.UL p
-and
-.UL d
-until you are sure that you
-know what they do, and until you understand how dot,
-.UL $ ,
-and
-line numbers are used.
-.PP
-If you are adventurous, try using line numbers with
-.UL a ,
-.UL r
-and
-.UL w
-as well.
-You will find that
-.UL a
-will append lines
-.ul
-after
-the line number that you specify (rather than after dot); that
-.UL r
-reads
-a file in
-.ul
-after
-the line number you specify (not necessarily
-at the end of the buffer); and that
-.UL w
-will write out exactly the lines
-you specify, not necessarily the whole buffer.
-These variations are sometimes handy.
-For instance you can insert a file at the beginning of a buffer
-by saying
-.P1
-0r filename
-.P2
-and you can enter lines at the beginning of the buffer
-by saying
-.P1
-0a
-\&. . . \fItext\fP . . .
-\*.
-.P2
-Notice that
-.UL .w
-is
-.ul
-very
-different from
-.P1
-\*.
-w
-.P2
-.SH
-Modifying text: the Substitute command ``s''
-.PP
-We are now ready to try one of the most important
-of all commands \- the substitute command
-.P1
-s
-.P2
-This is the command
-that is used to change individual
-words or letters within a line or group of lines.
-It is what you use, for example, for correcting spelling
-mistakes and typing errors.
-.PP
-Suppose that by a typing error, line 1 says
-.P1
-Now is th time
-.P2
-\- the
-.IT e
-has been left off
-.IT the .
-You can use
-.UL s
-to fix this up as follows:
-.P1
-1s/th/the/
-.P2
-This says: ``in line 1, substitute for the characters
-.IT th
-the characters
-.IT the .''
-To verify
-that it works
-.IT ed "" (
-will not print
-the result automatically) say
-.P1
-p
-.P2
-and get
-.P1
-Now is the time
-.P2
-which is what you wanted.
-Notice that dot must have been set to the line
-where the substitution took place, since the
-.UL p
-command
-printed that line.
-Dot is always set this way with the
-.UL s
-command.
-.PP
-The general way to use the substitute command is
-.P1
-\fIstarting\(hyline, ending\(hyline\fP s/\fIchange this\fP/\fIto this\fP/
-.P2
-Whatever string of characters is between the first pair of
-slashes is replaced by whatever is between the second pair,
-in
-.ul
-all
-the lines between
-.ul
-starting-line
-and
-.ul
-ending-line.
-Only the first occurrence on each line is changed, however.
-If you want to change
-.ul
-every
-occurrence, see Exercise 5.
-The rules for line numbers are the same as those for
-.UL p ,
-except that dot is set to the last line changed.
-(But there is a trap for the unwary: if no substitution
-took place, dot is
-.ul
-not
-changed.
-This causes an error
-.UL ?
-as a warning.)
-.PP
-Thus you can say
-.P1
-1,$s/speling/spelling/
-.P2
-and correct the first spelling mistake
-on each line
-in the text.
-(This is useful for people who are consistent
-misspellers!)
-.PP
-If no line numbers are given, the
-.UL s
-command assumes we mean
-``make the substitution on line dot'', so it changes things only
-on the current line.
-This leads to the very common sequence
-.P1
-s/something/something else/p
-.P2
-which makes some correction on the
-current line, and then prints it, to make sure it
-worked out right.
-If it didn't,
-you can try again.
-(Notice that there is
-a
-.UL p
-on the same line as the
-.UL s
-command.
-With few exceptions,
-.UL p
-can follow any command;
-no other multi-command lines are legal.)
-.PP
-It's also legal to say
-.P1
-s/ . . . //
-.P2
-which means ``change the first
-string of characters to
-.IT nothing '', ``
-i.e.,
-remove them.
-This is useful for deleting extra words in a line or removing extra
-letters from words.
-For instance, if you had
-.P1
-Nowxx is the time
-.P2
-you can say
-.P1
-s/xx//p
-.P2
-to get
-.P1
-Now is the time
-.P2
-Notice that
-.UL //
-(two adjacent slashes) means ``no characters'', not a blank.
-There
-.ul
-is
-a difference!
-(See below for another meaning of
-.UL // .)
diff --git a/.ref-Research-V7/usr/doc/edtut/e4 b/.ref-Research-V7/usr/doc/edtut/e4
deleted file mode 100644 (file)
index 472d648..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-.SH
-Exercise 5:
-.PP
-Experiment with the substitute command.
-See what happens if you
-substitute for some word on a line with several occurrences of that word.
-For example, do this:
-.P1
-a
-the other side of the coin
-\*.
-s/the/on the/p
-.P2
-You will get
-.P1
-on the other side of the coin
-.P2
-A substitute command changes only the first occurrence of the first string.
-You can change all occurrences by adding a
-.UL g
-(for ``global'')
-to the
-.UL s
-command, like this:
-.P1
-s/ . . . / . . . /gp
-.P2
-Try other characters instead of slashes to delimit the two sets
-of characters in the
-.UL s
-command \- anything should work
-except blanks or tabs.
-.PP
-(If you get funny results using any of the characters
-.P1
-^    \*.    $    [    *    \e    &
-.P2
-read the section on ``Special Characters''.)
-.SH
-Context searching \- ``/ . . . /''
-.PP
-With the substitute command mastered, you can move on to
-another highly important idea of
-.ul
-ed
-\- context searching.
-.PP
-Suppose you have the original three line text in the buffer:
-.P1
-Now is the time
-for all good men
-to come to the aid of their party.
-.P2
-Suppose you want to find the line that contains
-.IT their
-so
-you can change it to
-.IT the .
-Now with only three lines in the buffer, it's pretty easy
-to keep track of what line the word
-.IT their
-is on.
-But if the buffer contained several hundred lines,
-and you'd been making changes, deleting and rearranging lines,
-and so on, you would no longer really know what this line
-number would be.
-Context searching is simply a method of specifying the desired line,
-regardless of what its number is,
-by specifying some context on it.
-.PP
-The way to say ``search for a line
-that contains this particular string of characters''
-is to type
-.P1
-/\fIstring of characters we want to find\fP/
-.P2
-For example,
-the
-.ul
-ed
-command
-.P1
-/their/
-.P2
-is a context search which
-is sufficient to find the desired line \-
-it will locate the next occurrence of
-the characters between slashes (``their'').
-It also sets dot to that line
-and prints the line for verification:
-.P1
-to come to the aid of their party.
-.P2
-``Next occurrence'' means that
-.ul
-ed
-starts looking for the string at line
-.UL .+1 ,
-searches to the end of the buffer,
-then continues at line 1 and searches to line dot.
-(That is, the search ``wraps around'' from
-.UL $
-to
-1.)
-It scans all the lines in the buffer until it either finds the desired line
-or gets back to dot again.
-If the given string of characters can't be found in any line,
-.ul
-ed
-types the error message
-.P1
-?
-.P2
-Otherwise it prints the line it found.
-.PP
-You can do both the search for the desired line
-.ul
-and
-a
-substitution all at once, like this:
-.P1
-/their/s/their/the/p
-.P2
-which will yield
-.P1
-to come to the aid of the party.
-.P2
-There were three parts to that last command:
-context search for the desired line, make the substitution, print the line.
-.PP
-The expression
-.UL /their/
-is a context search expression.
-In their simplest form,
-all context search expressions are like this \-
-a string of characters surrounded by slashes.
-Context searches are interchangeable with line numbers,
-so they can be used by themselves to find and print a desired line,
-or as line numbers for some other command, like
-.UL s .
-They were used both ways in the examples above.
-.PP
-Suppose the buffer contains the three familiar lines
-.P1
-Now is the time
-for all good men
-to come to the aid of their party.
-.P2
-Then the
-.ul
-ed
-line numbers
-.P1
-/Now/+1
-/good/
-/party/\-1
-.P2
-are all context search expressions, and they all refer
-to the same line (line 2).
-To make a change in line 2,
-you could say
-.P1
-/Now/+1s/good/bad/
-.P2
-or
-.P1
-/good/s/good/bad/
-.P2
-or
-.P1
-/party/\-1s/good/bad/
-.P2
-The choice is dictated only by convenience.
-You could print all three lines by, for instance
-.P1
-/Now/,/party/p
-.P2
-or
-.P1
-/Now/,/Now/+2p
-.P2
-or by any number of similar combinations.
-The first one of these might be better if you don't
-know how many lines are involved.
-(Of course, if there were only three lines in the buffer,
-you'd use
-.P1
-1,$p
-.P2
-but not if there were several hundred.)
-.PP
-The basic rule is: a context search expression is
-.ul
-the same as
-a line number, so it can be used wherever a line number is needed.
-.SH
-Exercise 6:
-.PP
-Experiment with context searching.
-Try a body of text with
-several occurrences
-of the same string of characters, and scan through it using
-the same context search.
-.PP
-Try using context searches as line numbers for the
-substitute, print and delete commands.
-(They can also be used
-with
-.UL r ,
-.UL w ,
-and
-.UL a .)
-.PP
-Try context searching using
-.UL ?text?
-instead of
-.UL /text/ .
-This scans lines in the buffer in reverse order
-rather than normal.
-This is
-sometimes useful if you go too far while looking for some
-string of characters \- it's an easy way to back up.
-.PP
-(If you get funny results with any of the characters
-.P1
-^    \*.    $    [    *    \e    &
-.P2
-read the section on ``Special Characters''.)
-.PP
-.ul
-Ed
-provides a shorthand for repeating a context search
-for the same string.
-For example,
-the
-.ul
-ed
-line number
-.P1
-/string/
-.P2
-will find the next occurrence of
-.UL string .
-It often happens that this is not the desired line,
-so the search must be repeated.
-This can be done by typing merely
-.P1
-//
-.P2
-This shorthand stands for ``the most recently used
-context search expression.''
-It can
-also be used as the first string of the substitute
-command, as in
-.P1
-/string1/s//string2/
-.P2
-which will find the next occurrence of
-.UL string1
-and replace it by
-.UL string2 .
-This can save a lot of typing.
-Similarly
-.P1
-??
-.P2
-means ``scan backwards for the same expression.''
diff --git a/.ref-Research-V7/usr/doc/edtut/e5 b/.ref-Research-V7/usr/doc/edtut/e5
deleted file mode 100644 (file)
index f7ad846..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-.SH
-Change and Insert \- ``c'' and ``i''
-.PP
-This section discusses the
-.ul
-change
-command
-.P1
-c
-.P2
-which is used to change
-or replace a group of one or more lines,
-and the
-.ul
-insert
-command
-.P1
-i
-.P2
-which is used for inserting a group of one or more lines.
-.PP
-``Change'', written as
-.P1
-c
-.P2
-is used to replace a number of lines with different lines, which
-are typed in at the terminal.
-For example,
-to change lines
-.UL .+1
-through
-.UL $
-to something else, type
-.P1
-\&.+1,$c
-\&. . . \fItype the lines of text you want here\fP . . .
-\*.
-.P2
-The lines you type between the
-.UL c
-command and
-the 
-.UL .
-will take the place of the original lines between
-start line and end line.
-This is most useful in replacing a line
-or several lines which have errors in them.
-.PP
-If only one line is specified in the
-.UL c
-command, then just
-that line is replaced.
-(You can type in as many replacement lines as you like.)
-Notice
-the use of
-.UL .
-to end the
-input \- this works just like the
-.UL .
-in the append command
-and must appear by itself on a new line.
-If no line number is given, line dot is replaced.
-The value of dot is set to the last line you typed in.
-.PP
-``Insert'' is similar to append \- for instance
-.P1
-/string/i
-\&. . . \fItype the lines to be inserted here\fP . . .
-\*.
-.P2
-will insert the given text
-.ul
-before
-the next line that contains ``string''.
-The text between
-.UL i
-and
-.UL .
-is
-.ul
-inserted before
-the specified line.
-If no line number is specified dot is used.
-Dot is set to the last line inserted.
-.SH
-Exercise 7:
-.PP
-``Change'' is rather like a combination of
-delete followed by insert.
-Experiment to verify that
-.P1
-\fIstart, end\fP d
-i
-.ul
-\&. . . text . . .
-\*.
-.P2
-is almost the same as
-.P1
-\fIstart, end\fP c
-.ul
-\&. . . text . . .
-\*.
-.P2
-These are not
-.ul
-precisely
-the same
-if line
-.UL $
-gets deleted.
-Check this out.
-What is dot?
-.PP
-Experiment with
-.UL a
-and
-.UL i ,
-to see that they are
-similar, but not the same.
-You will observe that
-.P1
-\fIline\(hynumber\fP a
-\&. . . \fItext\fP . . .
-\*.
-.P2
-appends
-.ul
-after
-the given line, while
-.P1
-\fIline\(hynumber\fP i
-\&. . . \fItext\fP . . .
-\*.
-.P2
-inserts
-.ul
-before
-it.
-Observe that if no line number is given,
-.UL i
-inserts before line dot, while 
-.UL a
-appends
-after line dot.
-.SH
-Moving text around: the ``m'' command
-.PP
-The move command 
-.UL m
-is used for cutting and pasting \-
-it lets you move a group of lines
-from one place to another in the buffer.
-Suppose you want to put the first three lines of the buffer at the end instead.
-You could do it by saying:
-.P1
-1,3w temp
-$r temp
-1,3d
-.P2
-(Do you see why?)
-but you can do it a lot easier with the 
-.UL m
-command:
-.P1
-1,3m$
-.P2
-The general case is
-.P1
-\fIstart line, end line\fP m \fIafter this line\fP
-.P2
-Notice that there is a third line to be specified \-
-the place where the moved stuff gets put.
-Of course the lines to be moved can be specified
-by context searches;
-if you had
-.P1
-First paragraph
-\&. . .
-end of first paragraph.
-Second paragraph
-\&. . .
-end of second paragraph.
-.P2
-you could reverse the two paragraphs like this:
-.P1
-/Second/,/end of second/m/First/\-1
-.P2
-Notice the
-.UL \-1 :
-the moved text goes
-.ul
-after
-the line mentioned.
-Dot gets set to the last line moved.
-.SH
-The global commands ``g'' and ``v''
-.PP
-The
-.ul
-global
-command
-.UL g
-is used to execute one or more 
-.ul
-ed
-commands on all those lines in the buffer
-that match some specified string.
-For example
-.P1
-g/peling/p
-.P2
-prints all lines that contain
-.UL peling .
-More usefully,
-.P1
-g/peling/s//pelling/gp
-.P2
-makes the substitution everywhere on the line,
-then prints each corrected line.
-Compare this to
-.P1
-1,$s/peling/pelling/gp
-.P2
-which only prints the last line substituted.
-Another subtle difference is that
-the
-.UL g
-command
-does not give a
-.UL ?
-if
-.UL peling
-is not found
-where the
-.UL s
-command will.
-.PP
-There may be several commands
-(including
-.UL a ,
-.UL c ,
-.UL i ,
-.UL r ,
-.UL w ,
-but not
-.UL g );
-in that case,
-every line except the last must end with a backslash
-.UL \e :
-.P1
-g/xxx/\*.-1s/abc/def/\\
-\&\*.+2s/ghi/jkl/\\
-\&\*.-2,\*.p
-.P2
-makes changes in the lines before and after each line
-that contains
-.UL xxx ,
-then prints all three lines.
-.PP
-The
-.UL v
-command is the same as
-.UL g ,
-except that the commands are executed on every line
-that does
-.ul
-not
-match the string following
-.UL v :
-.P1
-v/ /d
-.P2
-deletes every line that does not contain a blank.
diff --git a/.ref-Research-V7/usr/doc/edtut/e6 b/.ref-Research-V7/usr/doc/edtut/e6
deleted file mode 100644 (file)
index 5c5e83a..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-.SH
-Special Characters
-.PP
-You may have noticed that things just don't work right when you used
-some characters like
-\*.,
-.UL * ,
-.UL $ ,
-and others in
-context searches and the substitute command.
-The reason is rather complex, although the cure is simple.
-Basically,
-.ul
-ed
-treats these characters as special, with special meanings.
-For instance,
-.ul
-in a context search or the first string of the substitute command only,
-\*.
-means ``any character,'' not a period, so
-.P1
-/x\*.y/
-.P2
-means ``a line with an
-.UL x ,
-.ul
-any character,
-and a
-.UL y ,''
-.ul
-not
-just ``a line with an
-.UL x ,
-a period, and a
-.UL y .''
-A complete list of the special characters
-that can cause trouble is the following:
-.P1
-^    \*.    $    [    *    \e
-.P2
-.ul
-Warning:
-The backslash character
-.UL \e
-is special to
-.ul
-ed.
-For safety's sake, 
-avoid it where possible.
-If you have to use one of the special characters
-in a substitute command,
-you can turn off its magic meaning temporarily
-by preceding it with the backslash.
-Thus
-.P1
-s/\e\e\e\*.\e*/backslash dot star/
-.P2
-will change
-.UL \e.*
-into ``backslash dot star''.
-.PP
-Here is a hurried synopsis of the other special characters.
-First, the circumflex
-.UL ^
-signifies
-the beginning of a line.
-Thus
-.P1
-/^string/
-.P2
-finds
-.UL string
-only if it is at the beginning of a line:
-it will find
-.P1
-string
-.P2
-but not
-.P1
-the string...
-.P2
-The dollar-sign
-.UL $
-is just the opposite of the circumflex;
-it means the end of a line:
-.P1
-/string$/
-.P2
-will only find an occurrence of
-.UL string
-that is at the end of some line.
-This implies, of course,
-that
-.P1
-/^string$/
-.P2
-will find only a line that contains just
-.UL string ,
-and
-.P1
-/^\*.$/
-.P2
-finds a line containing exactly one character.
-.PP
-The character
-.UL . ,
-as we mentioned above,
-matches anything;
-.P1
-/x\*.y/
-.P2
-matches any of
-.P1
-x+y
-x-y
-x y
-x\*.y
-.P2
-This is useful in conjunction with
-.UL * ,
-which is a repetition character;
-.UL a*
-is a shorthand for ``any number of
-.UL a 's,''
-so 
-.UL .*
-matches any number of anythings.
-This is used like this:
-.P1
-s/\*.*/stuff/
-.P2
-which changes an entire line,
-or
-.P1
-s/\*.*,//
-.P2
-which deletes all characters in the line up to and
-including the last comma.
-(Since
-.UL .*
-finds the longest possible match,
-this goes up to the last comma.)
-.PP
-.UL [
-is used with
-.UL ]
-to form ``character classes'';
-for example,
-.P1
-/[0123456789]/
-.P2
-matches any single digit \-
-any one of the characters inside the braces
-will cause a match.
-This can be abbreviated to
-.UL [0\-9] .
-.PP
-Finally, the
-.UL &
-is another shorthand character \-
-it is used only on the right-hand part of a substitute command
-where it means ``whatever was matched on the left-hand side''.
-It is used to save typing.
-Suppose the current line contained
-.P1
-Now is the time
-.P2
-and you wanted to put parentheses around it.
-You could just retype the line, but
-this is tedious.
-Or you could say
-.P1
-s/^/(/
-s/$/)/
-.P2
-using your knowledge of
-.UL ^
-and
-.UL $ .
-But the easiest way uses the
-.UL & :
-.P1
-s/\*.*/(&)/
-.P2
-This says ``match the whole line, and replace it
-by itself surrounded by parentheses.''
-The
-.UL &
-can be used several times in a line;
-consider
-using
-.P1
-s/\*.*/&?  &!!/
-.P2
-to produce
-.P1
-Now is the time?  Now is the time!!
-.P2
-.PP
-You don't have to match the whole line, of course:
-if the buffer contains
-.P1
-the end of the world
-.P2
-you could type
-.P1
-/world/s//& is at hand/
-.P2
-to produce
-.P1
-the end of the world is at hand
-.P2
-Observe this expression carefully,
-for it illustrates how to take advantage of
-.ul
-ed
-to save typing.
-The string
-.UL /world/
-found the desired line;
-the shorthand
-.UL //
-found the same
-word in the line;
-and the
-.UL &
-saves you from typing it again.
-.PP
-The
-.UL &
-is a special character only within
-the replacement text of a substitute command,
-and has no special meaning elsewhere.
-You can turn off the special meaning of
-.UL &
-by preceding it with a
-.UL \e :
-.P1
-s/ampersand/\e&/
-.P2
-will convert the word ``ampersand'' into the literal symbol
-.UL &
-in the current line.
diff --git a/.ref-Research-V7/usr/doc/edtut/e7 b/.ref-Research-V7/usr/doc/edtut/e7
deleted file mode 100644 (file)
index 0273d10..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-.sp 2
-.SH
-Summary of Commands and Line Numbers
-.PP
-The general form of
-.ul
-ed
-commands is the command name,
-perhaps preceded by one or two line numbers, and,
-in the case of
-.UL e ,
-.UL r ,
-and
-.UL w ,
-followed by a file name.
-Only one command is allowed per line,
-but a
-.UL p
-command may follow any other command
-(except for
-.UL e ,
-.UL r ,
-.UL w
-and
-.UL q ).
-.LP
-.UL a :
-Append, that is, 
-add lines to the buffer (at line dot, unless
-a different line is specified). Appending continues until
-\*.
-is typed on a new line.
-Dot is set to the last line appended.
-.LP
-.UL c :
-Change the specified lines to the new text which follows.
-The new lines are terminated by a
-\*.,
-as with
-.UL a .
-If no lines are specified,
-replace line dot.
-Dot is set to last line changed.
-.LP
-.UL d :
-Delete the lines specified.
-If none are specified, delete line dot.
-Dot is set to the first undeleted line,
-unless
-.UL $
-is deleted,
-in which case dot is set to
-.UL $ .
-.LP
-.UL e :
-Edit new file.
-Any previous
-contents of the buffer are thrown away,
-so issue a
-.UL w
-beforehand.
-.LP
-.UL f :
-Print remembered filename.
-If a name follows
-.UL f
-the remembered name will be set to it.
-.LP
-.UL g :
-The command
-.P1
-g/\(hy\(hy\(hy/commands
-.P2
-will execute the commands on those lines that contain
-.UL --- ,
-which can be any context search expression.
-.LP
-.UL i :
-Insert lines before specified line (or dot)
-until a
-\*.
-is typed on a new line.
-Dot is set to last line inserted.
-.LP
-.UL m :
-Move lines specified to after the line
-named after
-.UL m .
-Dot is set to the last line moved.
-.LP
-.UL p :
-Print specified lines.
-If none specified, print
-line dot.
-A single line number is equivalent to
-.IT line-number
-.UL p .
-A single return prints
-.UL .+1 ,
-the next line.
-.LP
-.UL q :
-Quit
-.IT ed .
-Wipes out all text in buffer
-if you give it twice in a row without first giving a
-.UL w
-command.
-.LP
-.UL r :
-Read a file into buffer (at end unless specified
-elsewhere.) Dot set to last line read.
-.LP
-.UL s :
-The command
-.P1
-s/string1/string2/
-.P2
-substitutes the characters
-.UL string1
-into
-.UL string2
-in the specified lines.
-If no lines are specified, make the substitution in line dot.
-Dot is set to last line in which a
-substitution took place, which means that if no substitution took place, dot is not changed.
-.UL s
-changes only the first occurrence of
-.UL  string1 
-on a line;
-to change all of them, type a
-.UL g
-after the final slash.
-.LP
-.UL v :
-The command
-.P1
-v/\(hy\(hy\(hy/commands
-.P2
-executes
-.UL commands
-on those lines that
-.ul
-do not
-contain
-.UL --- .
-.LP
-.UL w :
-Write out buffer onto a file.
-Dot is not changed.
-.LP
-.UL .= :
-Print value of dot.
-.UL = "" (
-by itself prints the value of
-.UL $ .)
-.LP
-.UL ! :
-The line
-.P1
-!command\(hyline
-.P2
-causes
-.UL command-line
-to be executed as a
-.UC UNIX
-command.
-.LP
-.UL /-----/ :
-Context search.
-Search for next line which contains
-this string of characters.
-Print it.
-Dot is set to the line where string
-was found.
-Search starts at
-.UL .+1 ,
-wraps around from
-.UL $
-to
-1,
-and continues to dot, if necessary.
-.LP
-.UL ?-----? :
-Context search in reverse direction.
-Start search
-at
-.UL .\-1 ,
-scan to 1,
-wrap around to
-.UL $ .
diff --git a/.ref-Research-V7/usr/doc/eqn/e.mac b/.ref-Research-V7/usr/doc/eqn/e.mac
deleted file mode 100644 (file)
index cebd201..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-.tr _\(em
-.tr *\(**
-.de UC
-\&\\$3\s-1\\$1\\s0\&\\$2
-..
-.de IT
-.if n .ul
-\&\\$3\f2\\$1\fP\&\\$2
-..
-.de UL
-.if n .ul
-\&\\$3\f3\\$1\fP\&\\$2
-..
-.de BD
-.bd 3 \\$1
-..
-.de BI
-.bd I \\$1
-..
-.de P1
-.DS I 3n
-.nf
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ta .4i .8i 1.2i 1.6i 2i 2.4i 2.8i 3.2i 3.6i 4i 4.4i 4.8i 5.2i 5.6i
-.if t .tr -\(mi|\(bv'\(fm^\(no*\(**
-.tr `\(ga'\(aa
-.if t .tr _\(ul
-.              \"use first argument as indent if present
-..
-.de P2
-.if n .ls 2
-.tr --||''``^^!!
-.if t .tr _\(em
-.DE
-..
-.hw semi-colon
-.hw estab-lished
-.hy 14
-.              \"2=not last lines; 4= no -xx; 8=no xx-
-.              \"special chars in programs
-.ds . \s\\nP.\s0
-.ds , \s\\nP,\s0
-.ds ; \s\\nP\z,\v'-.3m'.\v'.3m'\s0
-.ds : \s\\nP\z.\v'-.3m'.\v'.3m'\s0
-.ds ' \s\\nQ\v'.25m'\(fm\v'-.25m'\s0
-.ds ^ \h'-.1m'\(no\h'.1m'
-.de WS
-.sp \\$1
-..
diff --git a/.ref-Research-V7/usr/doc/eqn/e0 b/.ref-Research-V7/usr/doc/eqn/e0
deleted file mode 100644 (file)
index 3708323..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.nr PS 9
-.nr VS 11
-....ND "Revised  April, 1977"
-.EQ
-delim $$
-gsize 9
-.EN
-....TR 17
-.TL
-A System for Typesetting Mathematics
-.AU
-Brian W. Kernighan and Lorinda L. Cherry
-.AI
-.MH
-.AB
-.PP
-This paper describes the design and implementation
-of a system for typesetting mathematics.
-The language has been designed to be easy to learn
-and to use
-by people
-(for example, secretaries and mathematical typists)
-who know neither mathematics nor typesetting.
-Experience indicates that the language can
-be learned in an hour or so,
-for it has few rules and fewer exceptions.
-For typical expressions,
-the size and font changes, positioning, line drawing,
-and the like necessary to print according to mathematical conventions
-are all done automatically.
-For example,
-the input
-.sp 4p
-.ce
-sum from i=0 to infinity x sub i = pi over 2
-.sp 4p
-produces
-.EQ
-sum from i=0 to infinity x sub i = pi over 2
-.EN
-.PP
-The syntax of the language is specified by a small
-context-free grammar;
-a compiler-compiler is used to make a compiler
-that translates this language into typesetting commands.
-Output may be produced on either a phototypesetter
-or on a terminal with forward and reverse half-line motions.
-The system interfaces directly with text formatting programs,
-so mixtures of text and mathematics may be handled simply.
-.LP
-.LP
-.PP
-This paper is a revision of a paper originally published in
-CACM, March, 1975.
-.AE
diff --git a/.ref-Research-V7/usr/doc/eqn/e1 b/.ref-Research-V7/usr/doc/eqn/e1
deleted file mode 100644 (file)
index 3cb7fbe..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.2C $gsize 9$
-.nr PS 9
-.nr VS 11p
-.NH
-Introduction
-.PP
-``Mathematics is known in the trade as
-.ul
-difficult,
-or
-.ul
-penalty, copy
-because it is slower, more difficult,
-and more expensive to set in type
-than any other kind of copy normally
-occurring in books and journals.''
-[1]
-.PP
-One difficulty with mathematical text
-is the multiplicity of characters,
-sizes, and fonts.
-An expression such as
-.EQ
-lim from {x-> pi /2} ( tan~x) sup{sin~2x}~=~1
-.EN
-requires an intimate mixture of roman, italic and greek letters, in three sizes,
-and a special character or two.
-(``Requires'' is perhaps the wrong word,
-but mathematics has its own typographical conventions
-which are quite different from those
-of ordinary text.)
-Typesetting such an expression by traditional methods
-is still an essentially manual operation.
-.PP
-A second difficulty is the two dimensional character
-of mathematics,
-which the superscript and limits in the preceding example
-showed in its simplest form.
-This is carried further by
-.EQ
-a sub 0 + b sub 1 over
-  {a sub 1 + b sub 2 over
-    {a sub 2 + b sub 3 over
-      {a sub 3 + ... }}}
-.EN
-.sp
-and still further by 
-.EQ
-define emx "{e sup mx}"
-define mab "{m sqrt ab}"
-define sa "{sqrt a}"
-define sb "{sqrt b}"
-int dx over {a emx - be sup -mx} ~=~
-left { lpile {
-     1 over {2 mab} ~log~ {sa emx - sb} over {sa emx + sb}
-   above
-     1 over mab ~ tanh sup -1 ( sa over sb emx ) 
-   above
-     -1 over mab ~ coth sup -1 ( sa over sb emx )
-}
-.EN
-These examples also show line-drawing, built-up characters like braces and radicals,
-and a spectrum of positioning problems.
-(Section 6 shows
-what a user has to type to produce these
-on our system.)
diff --git a/.ref-Research-V7/usr/doc/eqn/e2 b/.ref-Research-V7/usr/doc/eqn/e2
deleted file mode 100644 (file)
index 0166fec..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-.NH
-Photocomposition
-.PP
-Photocomposition techniques
-can be used to solve some of the problems of typesetting mathematics.
-A phototypesetter is a device which exposes
-a piece of photographic paper or film, placing characters
-wherever they are wanted.
-The Graphic Systems phototypesetter[2] on the
-.UC UNIX
-operating
-system[3] works by shining light through a character stencil.
-The character is made the right size by lenses,
-and the light beam directed by fiber optics
-to the desired place on a piece of photographic paper.
-The exposed paper is developed and typically used
-in some form of photo-offset reproduction.
-.PP
-On
-.UC UNIX ,
-the phototypesetter is driven by a formatting program called
-.UC TROFF
-[4].
-.UC TROFF
-was designed for setting running text.
-It also provides all of the facilities that one needs for
-doing mathematics, such as
-arbitrary horizontal and vertical motions,
-line-drawing, size changing,
-but the syntax for describing these special operations is
-difficult to learn,
-and difficult even for experienced users to type correctly.
-.PP
-For this reason we decided to use
-.UC TROFF
-as an ``assembly language,''
-by
-designing a language for describing mathematical
-expressions,
-and compiling it into
-.UC TROFF .
diff --git a/.ref-Research-V7/usr/doc/eqn/e3 b/.ref-Research-V7/usr/doc/eqn/e3
deleted file mode 100644 (file)
index 49c654a..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-.NH
-Language Design
-.PP
-The fundamental principle upon which we based our language design
-is that the language should be easy to use
-by people (for example, secretaries) who know neither mathematics nor typesetting.
-.PP
-This principle implies
-several things.
-First,
-``normal'' mathematical conventions about operator precedence,
-parentheses, and the like cannot be used,
-for to give special meaning to such characters means
-that the user has to understand what he or she
-is typing.
-Thus the language should not assume, for instance,
-that parentheses are always balanced,
-for they are not in
-the half-open interval $(a,b]$.
-Nor should it assume that
-that $sqrt{a+b}$ can be replaced by
-$(a+b) sup roman \(12$,
-or that $1/(1-x)$ is better written as $1 over 1-x$
-(or
-vice versa).
-.PP
-Second, there should be relatively few rules,
-keywords,
-special symbols and operators, and the like.
-This keeps the language easy to learn and remember. Furthermore, there should be few exceptions to
-the rules that do exist: 
-if something works in one situation,
-it should work everywhere.
-If a variable can have a subscript,
-then a subscript can have a subscript, and so on without limit.
-.PP
-Third, ``standard'' things should happen automatically.
-Someone who types ``x=y+z+1'' should get ``$x=y+z+1$''.
-Subscripts and superscripts should automatically
-be printed in an appropriately smaller size,
-with no special intervention.
-Fraction bars have to be made the right length and positioned at the
-right height.
-And so on.
-Indeed a mechanism for overriding default actions has to exist,
-but its application is the exception, not the rule.
-.PP
-We assume
-that the typist has a reasonable picture
-(a two-dimensional representation)
-of the desired final form, as might be handwritten
-by the author of a paper.
-We also assume that
-the input is typed on a computer terminal much like an ordinary typewriter.
-This implies an input alphabet
-of perhaps 100 characters,
-none of them special.
-.PP
-A secondary, but still important, goal in our design
-was that the system should be easy to implement,
-since neither of the authors had any desire to make
-a long-term project of it.
-Since our design was not firm,
-it was also necessary that the program be easy to change
-at any time.
-.PP
-To make the program easy to build and to change,
-and to guarantee regularity
-(``it should work everywhere''),
-the language is defined by a
-context-free grammar, described in Section 5.
-The compiler for the language was built using a compiler-compiler.
-.PP
-A priori,
-the grammar/compiler-compiler approach seemed the right thing to do.
-Our subsequent experience leads us to believe
-that any other course would have been folly.
-The original language was designed in a few days. 
-Construction of a working system
-sufficient to try significant examples
-required perhaps a person-month.
-Since then, we have spent a modest amount of additional time
-over several years
-tuning, adding facilities,
-and occasionally changing the language as users
-make criticisms and suggestions.
-.PP
-We also decided quite early that
-we would let
-.UC TROFF
-do our work for us whenever possible.
-.UC TROFF
-is quite a powerful program, with
-a macro facility, text and arithmetic variables, numerical computation and testing,
-and conditional branching.
-Thus we have been able to avoid writing
-a lot of mundane but tricky software.
-For example, we store no text strings,
-but simply pass them on to
-.UC TROFF .
-Thus we avoid having to write a storage management package.
-Furthermore, we have been able to isolate ourselves
-from most details of the particular device and character set
-currently in use.
-For example, we let
-.UC TROFF
-compute the widths of all strings of characters;
-we need know nothing about them.
-.PP
-A third design goal is special to our environment.
-Since our program is only useful for typesetting mathematics,
-it is necessary that it interface cleanly with the underlying typesetting language
-for the benefit of users
-who want to set intermingled mathematics and text
-(the usual case).
-The standard mode of operation
-is that when a document is typed,
-mathematical expressions are input as part of the text,
-but marked by user settable delimiters.
-The program reads this input and treats as comments
-those things which are not mathematics,
-simply passing them through untouched.
-At the same time it converts the mathematical input
-into the necessary
-.UC TROFF
-commands.
-The resulting ioutput is passed directly to
-.UC TROFF
-where the comments and the mathematical parts both become
-text and/or
-.UC TROFF
-commands.
diff --git a/.ref-Research-V7/usr/doc/eqn/e4 b/.ref-Research-V7/usr/doc/eqn/e4
deleted file mode 100644 (file)
index 85597b1..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-.NH
-The Language
-.PP
-We will not try to describe the language precisely here;
-interested readers may refer to the appendix for more details.
-Throughout this section, we will write expressions
-exactly
-as they are handed to the typesetting program (hereinafter called
-.UC ``EQN'' ),
-except that we won't show the delimiters
-that the user types to mark the beginning and end of the expression.
-The interface between
-.UC EQN
-and
-.UC TROFF
-is described at the end of this section.
-.PP
-As we said, typing x=y+z+1 should produce $x=y+z+1$,
-and indeed it does.
-Variables are made italic, operators and digits become roman,
-and normal spacings between letters and operators are altered slightly
-to give a more pleasing appearance.
-.PP
-Input is free-form.
-Spaces and new lines in the input are used by
-.UC EQN
-to separate pieces of the input;
-they are not used to create space in the output.
-Thus 
-.P1
-x    =    y
-   + z + 1
-.P2
-also gives $x=y+z+1$.
-Free-form input is easier to type initially;
-subsequent editing is also easier,
-for an expression may be typed as many short lines.
-.PP
-Extra white space can be forced into the output by several
-characters of various sizes.
-A tilde ``\|~\|'' gives a space equal
-to the normal word spacing in text;
-a circumflex gives half this much,
-and a tab charcter spaces to the next tab stop.
-.PP
-Spaces (or tildes, etc.)
-also serve to delimit pieces of the input.
-For example, to get
-.EQ
-f(t) = 2 pi int sin ( omega t )dt
-.EN
-we write
-.P1
-f(t) = 2 pi int sin ( omega t )dt
-.P2
-Here spaces are
-.ul
-necessary
-in the input
-to indicate that 
-.ul
-sin, pi, int,
-and
-.ul
-omega
-are special, and potentially worth special treatment.
-.UC EQN
-looks up each such string of characters
-in a table, and if appropriate gives it a translation.
-In this case, 
-.ul
-pi
-and
-.ul
-omega
-become their greek equivalents,
-.ul
-int
-becomes the integral sign
-(which must be moved down and enlarged so it looks ``right''),
-and
-.ul
-sin
-is made roman, following conventional mathematical practice.
-Parentheses, digits and operators are automatically made roman
-wherever found.
-.PP
-Fractions are specified with the keyword
-.ul
-over:
-.P1
-a+b over c+d+e = 1
-.P2
-produces
-.EQ
-a+b over c+d+e = 1
-.EN
-.PP
-Similarly, subscripts and superscripts are introduced by the keywords
-.ul
-sub
-and
-.ul
-sup:
-.EQ
-x sup 2 + y sup 2 = z sup 2
-.EN
-is produced by
-.P1
-x sup 2 + y sup 2 = z sup 2
-.P2
-The spaces after the 2's are necessary to mark the end of
-the superscripts;
-similarly the keyword
-.ul
-sup
-has to be marked off by spaces or
-some equivalent delimiter.
-The return to the proper baseline is automatic.
-Multiple levels of subscripts or superscripts
-are of course allowed:
-``x\|\|sup\|\|y\|\|sup\|\|z'' is
-$x sup y sup z$.
-The construct
-``something
-.ul
-sub
-something
-.ul
-sup
-something''
-is recognized as a special case,
-so 
-``x sub i sup 2''
-is
-$x sub i sup 2$ instead of ${x sub i} sup 2$.
-.PP
-More complicated expressions can now be formed with these
-primitives:
-.EQ
-{partial sup 2 f} over {partial x sup 2} =
-x sup 2 over a sup 2 + y sup 2 over b sup 2
-.EN
-is produced by
-.P1
-.ce 0
-   {partial sup 2 f} over {partial x sup 2} =
-   x sup 2 over a sup 2 + y sup 2 over b sup 2
-.P2
-Braces {} are used to group objects together;
-in this case they indicate unambiguously what goes over what
-on the left-hand side of the expression.
-The language defines the precedence of
-.ul
-sup
-to be higher than that of
-.ul
-over,
-so
-no braces are needed to get the correct association on the right side.
-Braces can always be used when in doubt
-about precedence.
-.PP
-The braces convention is an example of the power
-of using a recursive grammar
-to define the language.
-It is part of the language that if a construct can appear
-in some context,
-then 
-.ul
-any expression
-in braces
-can also occur in that context.
-.PP
-There is a
-.ul
-sqrt
-operator for making square roots of the appropriate size:
-``sqrt a+b'' produces $sqrt a+b$,
-and
-.P1
-x =  {-b +- sqrt{b sup 2 -4ac}} over 2a
-.P2
-is
-.EQ
-x={-b +- sqrt{b sup 2 -4ac}} over 2a
-.EN
-Since large radicals look poor on our typesetter,
-.ul
-sqrt
-is not useful for tall expressions.
-.PP
-Limits on summations, integrals and similar
-constructions are specified with
-the keywords
-.ul
-from
-and
-.ul
-to.
-To get
-.EQ
-sum from i=0 to inf x sub i -> 0
-.EN
-we need only type
-.P1
-sum from i=0 to inf x sub i -> 0
-.P2
-Centering and making the $SIGMA$ big enough and the limits smaller
-are all automatic.
-The
-.ul
-from
-and
-.ul
-to
-parts are both optional,
-and the central part (e.g., the $SIGMA$)
-can in fact be anything:
-.P1
-lim from {x -> pi /2} ( tan~x) = inf
-.P2
-is
-.EQ
-lim from {x -> pi /2} ( tan~x) = inf
-.EN
-Again,
-the braces indicate just what goes into the
-.ul
-from
-part.
-.PP
-There is a facility for making braces, brackets, parentheses, and vertical bars
-of the right height, using the keywords
-.ul
-left
-and 
-.ul
-right:
-.P1
-left [ x+y over 2a right ]~=~1
-.P2
-makes
-.EQ
-left [ x+y over 2a right ]~=~1
-.EN
-A
-.ul
-left
-need not have a corresponding
-.ul
-right,
-as we shall see in the next example.
-Any characters may follow
-.ul
-left
-and
-.ul
-right,
-but generally only various parentheses and bars are meaningful.
-.PP
-Big brackets, etc.,
-are often used with another facility,
-called
-.ul
-piles,
-which make vertical piles of objects.
-For example,
-to get
-.EQ
-sign (x) ~==~ left {
-   rpile {1 above 0 above -1}
-   ~~lpile {if above if above if}
-   ~~lpile {x>0 above x=0 above x<0}
-.EN
-we can type
-.P1
-sign (x) ~==~ left {
-   rpile {1 above 0 above -1}
-   ~~lpile {if above if above if}
-   ~~lpile {x>0 above x=0 above x<0}
-.P2
-The construction ``left {''
-makes a left brace big enough
-to enclose the
-``rpile {...}'',
-which is a right-justified pile of
-``above ... above ...''.
-``lpile'' makes a left-justified pile.
-There are also centered piles.
-Because of the recursive language definition,
-a
-pile
-can contain any number of elements;
-any element of a pile can of course
-contain piles.
-.PP
-Although
-.UC EQN
-makes a valiant attempt
-to use the right sizes and fonts,
-there are times when the default assumptions
-are simply not what is wanted.
-For instance the italic
-.ul
-sign
-in the previous example would conventionally
-be in roman.
-Slides and transparencies often require larger characters than normal text.
-Thus we also provide size and font
-changing commands:
-``size 12 bold {A~x~=~y}''
-will produce
-$size 12 bold{ A~x~=~y}$.
-.ul
-Size
-is followed by a number representing a character size in points.
-(One point is 1/72 inch;
-this paper is set in 9 point type.)
-.PP
-If necessary, an input string can be quoted in "...",
-which turns off grammatical significance, and any font or spacing changes that might otherwise be done on it.
-Thus we can say 
-.P1
-lim~ roman "sup" ~x sub n = 0
-.P2
-to ensure that the supremum doesn't become a superscript:
-.EQ
-lim~ roman "sup" ~x sub n = 0
-.EN
-.PP
-Diacritical marks, long a problem in traditional typesetting,
-are straightforward:
-.EQ
-x dot under + x hat + y tilde + X hat + Y dotdot = z+Z bar
-.EN
-is made by typing
-.P1
-x dot under + x hat + y tilde 
-+ X hat + Y dotdot = z+Z bar
-.P2
-.PP
-There are also facilities for globally changing default
-sizes and fonts, for example for making viewgraphs
-or for setting chemical equations.
-The language allows for matrices, and for lining up equations
-at the same horizontal position.
-.PP
-Finally, there is a definition facility,
-so a user can say
-.P1
-define name "..."
-.P2
-at any time in the document;
-henceforth, any occurrence of the token ``name''
-in an expression
-will be expanded into whatever was inside
-the double quotes in its definition.
-This lets users tailor
-the language to their own specifications,
-for it is quite possible to redefine
-keywords
-like
-.ul
-sup
-or
-.ul
-over.
-Section 6 shows an example of definitions.
-.PP
-The
-.UC EQN
-preprocessor reads intermixed text and equations,
-and passes its output to
-.UC TROFF.
-Since
-.UC TROFF
-uses lines beginning with a period as control words
-(e.g., ``.ce'' means ``center the next output line''),
-.UC EQN
-uses the sequence ``.EQ'' to mark the beginning of an equation and
-``.EN'' to mark the end.
-The ``.EQ'' and ``.EN'' are passed through to
-.UC TROFF 
-untouched,
-so they can also be used by a knowledgeable user to
-center equations, number them automatically, etc.
-By default, however,
-``.EQ'' and ``.EN'' are simply ignored by
-.UC TROFF ,
-so by default equations are printed in-line.
-.PP
-``.EQ'' and ``.EN'' can be supplemented by
-.UC TROFF
-commands as desired;
-for example, a centered display equation
-can be produced with the input:
-.P1
-.ce 0
-.in 5
- .ce
- .EQ
- x sub i = y sub i ...
- .EN
-.in 0
-.P2
-.PP
-Since it is tedious to type
-``.EQ'' and ``.EN'' around very short expressions
-(single letters, for instance),
-the user can also define two characters to serve
-as the left and right delimiters of expressions.
-These characters are recognized anywhere in subsequent text.
-For example if the left and right delimiters have both been set to ``#'',
-the input:
-.P1
-Let #x sub i#, #y# and #alpha# be positive
-.P2
-produces:
-.P1
-Let $x sub i$, $y$ and $alpha$ be positive
-.P2
-.PP
-Running a preprocessor is strikingly easy on
-.UC UNIX.
-To typeset
-text stored in file
-``f\|'',
-one issues the command:
-.P1
-eqn f | troff
-.P2
-The vertical bar connects the output
-of one process
-.UC (EQN)
-to the input of another
-.UC (TROFF) .
diff --git a/.ref-Research-V7/usr/doc/eqn/e5 b/.ref-Research-V7/usr/doc/eqn/e5
deleted file mode 100644 (file)
index 00a066b..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-.NH
-Language Theory
-.PP
-The basic structure of the language is
-not a particularly original one.
-Equations are pictured as a set of ``boxes,''
-pieced together in various ways.
-For example, something with a subscript is
-just a box followed by another box moved downward
-and shrunk
-by an appropriate amount.
-A fraction is just a box centered above another box,
-at the right altitude,
-with a line of correct length drawn between them.
-.PP
-The grammar for the language is shown below.
-For purposes of exposition, we have collapsed
-some productions. In the original grammar, there
-are about 70 productions, but many of these
-are simple ones used only to guarantee
-that some keyword is recognized early enough in the parsing process.
-Symbols in
-capital letters
-are terminal symbols; 
-lower case
-symbols are non-terminals, i.e., syntactic categories.
-The vertical bar \(bv indicates an alternative;
-the brackets [ ] indicate optional material.
-A
-.UC TEXT
-is a string of non-blank characters or
-any string inside double quotes;
-the other terminal symbols represent literal occurrences
-of the corresponding keyword.
-.P1
-.ce 0
-.ta .3i
-.ps 9
-.ne 17
-.in 1
-eqn    : box | eqn box
-.sp 5p
-box    : text
-       | { eqn }
-       | box OVER box
-       | SQRT box
-       | box SUB box | box SUP box
-       | [ L | C | R ]PILE { list }
-       | LEFT text eqn [ RIGHT text ]
-       | box [ FROM box ] [ TO box ]
-       | SIZE text box
-       | [ROMAN | BOLD | ITALIC] box
-       | box [HAT | BAR | DOT | DOTDOT | TILDE]
-       | DEFINE text text
-.sp 5p
-list   : eqn | list ABOVE eqn
-.sp 5p
-text   : TEXT
-.ps 10
-.in 0
-.P2
-.PP
-The grammar makes it obvious why there are few exceptions.
-For example, the observation that something can be replaced by a more complicated something 
-in braces is implicit in the productions:
-.P1
-.ce 0
-   eqn : box | eqn box
-   box : text | { eqn }
-.P2
-Anywhere a single character could be used,
-.ul
-any
-legal construction can be used.
-.PP
-Clearly, our grammar is highly ambiguous.
-What, for instance, do we do with the input
-.P1
-a over b over c  ?
-.P2
-Is it
-.P1
-{a over b} over c 
-.P2
-or is it
-.P1
-a over {b over c}  ?
-.P2
-.PP
-To answer questions like this, the grammar
-is supplemented with a small set of rules that describe the precedence 
-and associativity
-of operators.
-In particular, we specify (more or less arbitrarily)
-that
-.ul
-over
-associates to the left,
-so the first alternative above is the one chosen.
-On the other hand, 
-.ul
-sub
-and
-.ul
-sup
-bind to the right,
-because this is closer to standard mathematical practice.
-That is, we assume $x sup a sup b$ is $x sup {(a sup b )}$,
-not  $(x sup a ) sup b$.
-.PP
-The precedence rules resolve the ambiguity in a construction like
-.P1
-a sup 2 over b
-.P2
-We define
-.ul
-sup
-to have a higher precedence than
-.ul
-over,
-so this construction is parsed as
-$a sup 2 over b$ instead of $a sup {2 over b}$.
-.PP
-Naturally, a user can always
-force a particular parsing
-by placing braces around expressions.
-.PP
-The ambiguous grammar approach seems to be quite useful.
-The grammar we use is small enough to be easily understood,
-for it contains none of the productions that would be
-normally used for resolving ambiguity.
-Instead the supplemental information about
-precedence and associativity (also small enough to be understood)
-provides the compiler-compiler
-with the information it needs
-to make a fast, deterministic parser for
-the specific language we want.
-When the language is supplemented by the disambiguating rules,
-it is in fact
-.UC LR(1)
-and thus easy to parse[5].
-.PP
-The output code is generated as the input is scanned.
-Any time a production
-of the grammar is recognized,
-(potentially) some
-.UC TROFF
-commands are output.
-For example, when the lexical analyzer 
-reports that it has found a
-.UC TEXT
-(i.e., a string of contiguous characters),
-we have recognized the production:
-.P1
-text    : TEXT
-.P2
-The translation of this is simple.
-We generate a local name for the string,
-then hand the name and the string to
-.UC TROFF,
-and let
-.UC TROFF
-perform the storage management.
-All we save is the name of the string,
-its height, and its baseline.
-.PP
-As another example,
-the translation associated with the production
-.P1
-box    : box OVER box
-.P2
-is:
-.P1
-.ce 0
-.in 1
-.ne 14
-Width of output box =
-  slightly more than largest input width
-Height of output box =
-  slightly more than sum of input heights
-Base of output box =
-  slightly more than height of bottom input box
-String describing output box =
-  move down;
-  move right enough to center bottom box;
-  draw bottom box (i.e., copy string for bottom box);
-  move up; move left enough to center top box;
-  draw top box (i.e., copy string for top box);
-  move down and left; draw line full width;
-  return to proper base line.
-.in 0
-.P2
-Most of the other productions have 
-equally simple semantic actions.
-Picturing the output as a set of properly placed boxes
-makes the right sequence of positioning commands
-quite obvious.
-The main difficulty is in finding the right numbers to use
-for esthetically pleasing positioning.
-.PP
-With a grammar, it is usually clear how to extend the language.
-For instance, one of our users
-suggested a
-.UC TENSOR
-operator, to make constructions like
-.EQ
-~ sub size 7 m sup size 7 l
-{bold T from n to k} sub size 7 i sup size 7 j
-.EN
-Grammatically, this is easy:
-it is sufficient to add a production like
-.P1
-box    : TENSOR { list }
-.P2
-Semantically, we need only juggle the boxes to the right places.
diff --git a/.ref-Research-V7/usr/doc/eqn/e6 b/.ref-Research-V7/usr/doc/eqn/e6
deleted file mode 100644 (file)
index d52423e..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-.NH
-Experience
-.PP
-There are really three aspects of interest_how
-well
-.UC EQN
-sets mathematics,
-how well it satisfies its goal
-of being ``easy to use,''
-and how easy it was to build.
-.PP
-The first question is easily addressed.
-This entire paper
-has been set by the program.
-Readers can judge for themselves
-whether it is good enough for their purposes.
-One of our users commented that although the output
-is not as good as the best hand-set material,
-it is still
-better than average,
-and much better than
-the worst.
-In any case, who cares?
-Printed books cannot compete with the birds and flowers
-of illuminated manuscripts on esthetic grounds,
-either,
-but they have some clear economic advantages.
-.PP
-Some of the deficiencies in the output could
-be cleaned up with more work on our part.
-For example, we sometimes leave too much space between
-a roman letter and an italic one.
-If we were willing to keep track of the fonts
-involved,
-we could do this better more of the time.
-.PP
-Some other weaknesses are inherent in our output device.
-It is hard, for instance, to draw a line
-of an arbitrary length without getting
-a perceptible overstrike at one end.
-.PP
-As to ease of use,
-at the time of writing,
-the system has been used by two distinct groups.
-One user population consists of mathematicians,
-chemists, physicists, and computer scientists.
-Their typical reaction has been something like:
-.IP " (1)"
-It's easy to write, although I make the following mistakes...
-.IP " (2)"
-How do I do...?
-.IP " (3)"
-It botches the following things.... Why don't you fix them?
-.IP " (4)"
-You really need the following features...
-.sp 5p
-.PP
-The learning time is short.
-A few minutes gives the general flavor,
-and typing a page or two of a paper generally
-uncovers most of the misconceptions about how it works.
-.PP
-The second user group is much larger,
-the secretaries and mathematical typists
-who were the original target of the system.
-They tend to be enthusiastic converts.
-They find the language easy to learn
-(most are largely self-taught),
-and have little trouble producing the output they want.
-They are of course less critical of the esthetics of their output
-than users trained in mathematics.
-After a transition period, most find
-using a computer more interesting than
-a regular typewriter.
-.PP
-The main difficulty that users have seems to be remembering
-that a blank is a delimiter;
-even experienced users use blanks where they shouldn't and omit them
-when they are needed.
-A common instance is typing
-.P1
-f(x sub i)
-.P2
-which produces
-.EQ
-f(x sub i)
-.EN
-instead of
-.EQ
-f(x sub i )
-.EN
-Since the 
-.UC EQN
-language knows no mathematics, it cannot deduce that the
-right parenthesis is not part of the subscript.
-.PP
-The language is somewhat prolix, but this doesn't seem
-excessive considering how much is being done,
-and it is certainly more compact than the corresponding
-.UC TROFF
-commands.
-For example, here is the source for the continued fraction
-expression in Section 1 of this paper:
-.P1
-.ne 4
-.ce 0
-     a sub 0 + b sub 1 over
-       {a sub 1 + b sub 2 over
-         {a sub 2 + b sub 3 over
-           {a sub 3 + ... }}}
-.P2
-This is the input for the large integral of Section 1;
-notice the use of definitions:
-.P1
-.ce 0
-.ne 15
-.in 1
-define emx "{e sup mx}"
-define mab "{m sqrt ab}"
-define sa "{sqrt a}"
-define sb "{sqrt b}"
-int dx over {a emx - be sup -mx} ~=~
-left { lpile {
-     1 over {2 mab} ~log~ 
-           {sa emx - sb} over {sa emx + sb}
-   above
-     1 over mab ~ tanh sup -1 ( sa over sb emx ) 
-   above
-     -1 over mab ~ coth sup -1 ( sa over sb emx )
-}
-.in 0
-.P2
-.PP
-As to ease of construction,
-we have already
-mentioned that there are really only a few person-months
-invested.
-Much of this time has gone into two things_fine-tuning
-(what is the most esthetically pleasing space to use
-between the numerator and denominator of a fraction?),
-and changing things found deficient by our users
-(shouldn't a tilde be a delimiter?).
-.PP
-The program consists of a number of small,
-essentially unconnected modules for code generation,
-a simple lexical analyzer,
-a canned parser which we did not have to write,
-and some miscellany associated with input files
-and the macro facility.
-The program is now about 1600 lines of 
-.UC C
-[6], a high-level language reminiscent of
-.UC BCPL .
-About 20 percent of these lines are ``print'' statements,
-generating the output code.
-.PP
-The semantic routines that generate the actual 
-.UC TROFF
-commands can be changed to accommodate other formatting languages
-and devices.
-For example, in less than 24 hours,
-one of us changed the entire semantic package
-to drive 
-.UC NROFF,
-a variant of
-.UC TROFF,
-for typesetting mathematics on teletypewriter devices
-capable of reverse line motions.
-Since many potential users do not have access
-to a typesetter, but still have to type mathematics,
-this provides a way to get a typed version of the final output
-which is close enough for debugging purposes,
-and sometimes even for ultimate use.
diff --git a/.ref-Research-V7/usr/doc/eqn/e7 b/.ref-Research-V7/usr/doc/eqn/e7
deleted file mode 100644 (file)
index f4be3e8..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.NH
-Conclusions
-.PP
-We think we have shown that it is possible
-to do acceptably good typesetting of mathematics
-on a phototypesetter,
-with an input language that is easy to learn and use and
-that satisfies many users' demands.
-Such a package can be implemented in
-short order,
-given a compiler-compiler and
-a decent typesetting program underneath.
-.PP
-Defining a language, and building a compiler for it
-with a compiler-compiler
-seems like the only sensible way to do business.
-Our experience with the use of
-a grammar and a compiler-compiler has been
-uniformly favorable.
-If we had written everything into code directly,
-we would have been locked into
-our original design.
-Furthermore, we would have never been sure
-where the exceptions and special cases were.
-But because we have a grammar, we can change our minds readily and still be reasonably
-sure that if a construction works in one place
-it will work everywhere.
-.SH
-Acknowledgements
-.PP
-We are deeply indebted to
-J. F. Ossanna,
-the author of
-.UC TROFF ,
-for his willingness to modify
-.UC TROFF
-to make our task easier
-and for his continuous assistance
-during the development of our program.
-We are also grateful to
-A. V. Aho for help with language theory,
-to S. C. Johnson for aid with the compiler-compiler,
-and to our early users
-A. V. Aho, S. I. Feldman, S. C. Johnson,
-R. W. Hamming,
-and M. D. McIlroy
-for their constructive criticisms.
-.SH
-References
-.IP [1]
-.ul
-A Manual of Style,
-12th Edition.
-University of Chicago Press, 1969. p 295.
-.IP [2]
-.ul
-Model C/A/T Phototypesetter.
-Graphic Systems, Inc.,
-Hudson, N. H.
-.IP [3]
-Ritchie, D. M., and Thompson, K. L.,
-``The UNIX time-sharing system.''
-\fIComm. ACM 17,\fR 7 (July 1974), 365-375.
-.IP [4]
-Ossanna, J. F.,
-TROFF User's Manual.
-Bell Laboratories Computing Science Technical Report 54, 1977.
-.IP [5]
-Aho, A. V., and Johnson, S. C.,
-``LR Parsing.''
-\fIComp. Surv. 6,\fR 2 (June 1974), 99-124.
-.br
-.IP [6]
-B. W. Kernighan and D. M. Ritchie,
-.ul
-The C Programming Language.
-Prentice-Hall, Inc., 1978.
diff --git a/.ref-Research-V7/usr/doc/eqn/g.mac b/.ref-Research-V7/usr/doc/eqn/g.mac
deleted file mode 100644 (file)
index a895b4c..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.tr %$
-.de SC
-.NH
-\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 
-..
-.de UC
-\&\\$3\s-2\\$1\\s+2\\$2
-..
-.de P1
-.nf
-.tr -\(mi
-.tr ^.
-.tr '\(fm
-.ss 18
-.if \\n(.$ .DS I \\$1
-.if !\\n(.$ .DS
-..
-.de P2
-.DE
-.fi
-.ss 12
-.tr --
-.tr ^^
-.tr ''
-..
-.tr _\(em
diff --git a/.ref-Research-V7/usr/doc/eqn/g0 b/.ref-Research-V7/usr/doc/eqn/g0
deleted file mode 100644 (file)
index f5dc952..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-.EQ
-delim $$
-.EN
-\".ND "June 2, 1976"
-.RP
-\".TM "76-1273-4 76-1271-4" 39199 39199-11
-.TL
-Typesetting Mathematics _ User's Guide
-\&\ \ \ \ \ (Second\ Edition)
-.AU 2C-518 6021
-Brian W. Kernighan and Lorinda L. Cherry
-.AI
-.MH
-.AB
-.in
-.ll
-.PP
-This is the user's guide for a system for typesetting
-mathematics,
-using
-the phototypesetters on the
-.UX
-and
-.UC GCOS
-operating systems.
-.PP
-Mathematical expressions are described in a language
-designed to be easy to use
-by people who know neither mathematics nor typesetting.
-Enough of the language to set in-line expressions like
-$lim from {x-> pi /2} ( tan~x) sup{sin~2x}~=~1$
-or display equations like
-.in .5i
-.EQ I
-G(z)~mark =~ e sup { ln ~ G(z) }
-~=~ exp left ( 
-sum from k>=1 {S sub k z sup k} over k right )
-~=~  prod from k>=1 e sup {S sub k z sup k /k}
-.EN
-.EQ I
-lineup = left ( 1 + S sub 1 z + 
-{ S sub 1 sup 2 z sup 2 } over 2! + ... right )
-left ( 1+ { S sub 2 z sup 2 } over 2
-+ { S sub 2 sup 2 z sup 4 } over { 2 sup 2 cdot 2! }
-+ ... right ) ...
-.EN
-.EQ I
-lineup =  sum from m>=0 left (
-sum from
-pile { k sub 1 ,k sub 2 ,..., k sub m  >=0
-above
-k sub 1 +2k sub 2 + ... +mk sub m =m}
-{ S sub 1 sup {k sub 1} } over {1 sup k sub 1 k sub 1 ! } ~
-{ S sub 2 sup {k sub 2} } over {2 sup k sub 2 k sub 2 ! } ~
-...
-{ S sub m sup {k sub m} } over {m sup k sub m k sub m ! } 
-right ) z sup m
-.EN
-.in 0
-can be learned in an hour or so.
-.PP
-The language interfaces directly with
-the phototypesetting language
-.UC TROFF ,
-so mathematical expressions can be embedded in the running
-text
-of a manuscript,
-and the entire document produced in one process.
-This user's guide is an example of its output.
-.PP
-The same language
-may be used with the 
-.UC UNIX
-formatter
-.UC NROFF
-to set mathematical expressions on 
-.UC DASI
-and
-.UC GSI
-terminals
-and Model 37 teletypes.
-.AE
-.CS 11 0 11 0 0 3
diff --git a/.ref-Research-V7/usr/doc/eqn/g1 b/.ref-Research-V7/usr/doc/eqn/g1
deleted file mode 100644 (file)
index 60eb739..0000000
+++ /dev/null
@@ -1,608 +0,0 @@
-.if t .2C
-.SC Introduction
-.PP
-.UC EQN
-is a
-program for typesetting mathematics
-on the Graphics Systems phototypesetters on
-.UC UNIX
-and
-.UC GCOS .
-The 
-.UC EQN
-language was designed to be easy to use
-by people who know neither mathematics
-nor typesetting.
-Thus
-.UC EQN
-knows relatively little about mathematics.
-In particular, mathematical symbols like
-+, \(mi, \(mu, parentheses, and so on have no special meanings.
-.UC EQN
-is quite happy to set garbage (but it will look good).
-.PP
-.UC EQN
-works as a preprocessor for the typesetter formatter,
-.UC TROFF [1],
-so the normal mode of operation is to prepare
-a document with both mathematics and ordinary text
-interspersed,
-and let
-.UC EQN
-set the mathematics while
-.UC TROFF
-does the body of the text.
-.PP
-On
-.UC UNIX ,
-.UC EQN
-will also produce mathematics on
-.UC DASI 
-and
-.UC GSI
-terminals and on
-Model 37 teletypes.
-The input is identical, but you have to use the programs
-.UC NEQN 
-and
-.UC NROFF
-instead of
-.UC EQN 
-and
-.UC TROFF .
-Of course, some things won't look as good
-because terminals 
-don't provide the variety of characters, sizes and fonts
-that a typesetter does,
-but the output is usually adequate for proofreading.
-.PP
-To use 
-.UC EQN
-on
-.UC UNIX ,
-.P1
-eqn files | troff
-.P2
-.UC GCOS
-use is discussed in section 26.
-.SC Displayed Equations
-.PP
-To tell
-.UC EQN
-where a mathematical expression begins and ends,
-we mark it with lines beginning
-.UC .EQ
-and
-.UC .EN .
-Thus
-if you type the lines
-.P1
-^EQ
-x=y+z
-^EN
-.P2
-your output will look like
-.EQ
-x=y+z
-.EN
-The
-.UC .EQ
-and
-.UC .EN
-are copied through untouched;
-they
-are not otherwise processed
-by
-.UC EQN .
-This means that you have to take care
-of things like centering, numbering, and so on
-yourself.
-The most common way is to use the
-.UC TROFF
-and
-.UC NROFF
-macro package package `\(mims'
-developed by M. E. Lesk[3],
-which allows you to center, indent, left-justify and number equations.
-.PP
-With the `\(mims' package,
-equations are centered by default.
-To left-justify an equation, use
-.UC \&.EQ\ L
-instead of
-.UC .EQ .
-To indent it, use
-.UC .EQ\ I .
-Any of these can be followed by an arbitrary `equation number'
-which will be placed at the right margin.
-For example, the input
-.P1
-^EQ I (3.1a)
-x = f(y/2) + y/2
-^EN
-.P2
-produces the output
-.EQ I (3.1a)
-x = f(y/2) + y/2
-.EN
-.PP
-There is also a shorthand notation so
-in-line expressions
-like
-$pi sub i sup 2$
-can be entered without
-.UC .EQ
-and
-.UC .EN .
-We will talk about it in section 19.
-.SC Input spaces
-.PP
-Spaces and newlines within an expression are thrown away by
-.UC EQN .
-(Normal text is left absolutely alone.)
-Thus
-between
-.UC .EQ
-and
-.UC .EN ,
-.P1
-x=y+z
-.P2
-and
-.P1
-x = y + z
-.P2
-and
-.P1
-x   =   y   
-   + z
-.P2
-and so on
-all produce the same
-output
-.EQ
-x=y+z
-.EN
-You should use spaces and newlines freely to make your input equations
-readable and easy to edit.
-In particular, very long lines are a bad idea,
-since they are often hard to fix if you make a mistake.
-.SC Output spaces
-.PP
-To force extra spaces into the 
-.ul
-output,
-use a tilde ``\|~\|''
-for each space you want:
-.P1
-x~=~y~+~z
-.P2
-gives
-.EQ
-x~=~y~+~z
-.EN
-You can also use a circumflex ``^'', 
-which gives a space half the width of a tilde.
-It is mainly useful for fine-tuning.
-Tabs may also be used to position pieces
-of an expression,
-but the tab stops must be set by 
-.UC TROFF
-commands.
-.SC "Symbols, Special Names, Greek"
-.PP
-.UC EQN
-knows some mathematical symbols,
-some mathematical names, and the Greek alphabet.
-For example,
-.P1
-x=2 pi int sin ( omega t)dt
-.P2
-produces
-.EQ
-x = 2 pi int sin ( omega t)dt
-.EN
-Here the spaces in the input are
-.B
-necessary
-.R
-to tell
-.UC EQN
-that
-.ul
-int,
-.ul
-pi,
-.ul
-sin
-and
-.ul
-omega
-are separate entities that should get special treatment.
-The
-.ul
-sin,
-digit 2, and parentheses are set in roman type instead of italic;
-.ul
-pi
-and
-.ul
-omega
-are made Greek;
-and
-.ul
-int
-becomes the integral sign.
-.PP
-When in doubt, leave spaces around separate parts of the input.
-A
-.ul
-very
-common error is to type
-.ul
-f(pi)
-without leaving spaces on both sides of the
-.ul
-pi.
-As a result,
-.UC EQN
-does not recognize
-.ul
-pi
-as a special word, and it appears as
-$f(pi)$
-instead of
-$f( pi )$.
-.PP
-A complete list of
-.UC EQN
-names appears in section 23.
-Knowledgeable users can also use
-.UC TROFF
-four-character names
-for anything 
-.UC EQN
-doesn't know about,
-like
-.ul
-\\(bs
-for the Bell System sign \(bs.
-.SC "Spaces, Again"
-.PP
-The only way
-.UC EQN
-can deduce that some sequence
-of letters might be special
-is if that sequence is separated from the letters
-on either side of it.
-This can be done by surrounding a special word by ordinary spaces
-(or tabs or newlines),
-as we did in the previous section.
-.PP
-.tr ~~
-You can also make special words stand out by surrounding them
-with tildes or circumflexes:
-.P1
-x~=~2~pi~int~sin~(~omega~t~)~dt
-.P2
-is much the same as the last example,
-except that the tildes
-not only
-separate the magic words
-like
-.ul
-sin,
-.ul
-omega,
-and so on,
-but also add extra spaces,
-one space per tilde:
-.EQ
-x~=~2~pi~int~sin~(~omega~t~)~dt
-.EN
-.PP
-Special words can also be separated by braces { }
-and double quotes "...",
-which have special meanings that we will
-see soon.
-.tr ~
-.SC "Subscripts and Superscripts"
-.PP
-Subscripts and superscripts are
-obtained with the words
-.ul
-sub
-and
-.ul
-sup.
-.P1
-x sup 2 + y sub k
-.P2
-gives
-.EQ
-x sup 2 + y sub k
-.EN
-.UC EQN
-takes care of all the size changes and vertical motions
-needed to make the output look right.
-The words
-.ul
-sub
-and
-.ul
-sup
-must be surrounded by spaces;
-.ul
-x sub2
-will give you
-$x sub2$ instead of $x sub 2$.
-Furthermore, don't forget to leave a space
-(or a tilde, etc.)
-to mark the end of a subscript or superscript.
-A common error is to say
-something like
-.P1
-y = (x sup 2)+1
-.P2
-which causes
-.EQ
-y = (x sup 2)+1
-.EN
-instead of
-the intended
-.EQ
-y = (x sup 2 )+1
-.EN
-.PP
-Subscripted subscripts and superscripted superscripts
-also work:
-.P1
-x sub i sub 1
-.P2
-is
-.EQ
-x sub i sub 1
-.EN
-A subscript and superscript on the same thing
-are printed one above the other
-if the subscript comes
-.ul
-first:
-.P1
-x sub i sup 2
-.P2
-is
-.EQ
-x sub i sup 2
-.EN
-.PP
-Other than this special case,
-.ul
-sub
-and
-.ul
-sup
-group to the right, so
-.ul
-x\ sup\ y\ sub\ z
-means
-$x sup {y sub z}$, not ${x sup y} sub z$.
-.SC "Braces for Grouping"
-.PP
-Normally, the end of a subscript or superscript is marked
-simply by a blank (or tab or tilde, etc.)
-What if the subscript or superscript is something that has to be typed
-with blanks in it?
-In that case, you can use the braces
-{ and } to mark the
-beginning and end of the subscript or superscript:
-.P1
-e sup {i omega t}
-.P2
-is
-.EQ
-e sup {i omega t}
-.EN
-.sp
-Rule:  Braces can
-.ul
-always
-be used to force 
-.UC EQN
-to treat something as a unit,
-or just to make your intent perfectly clear.
-Thus:
-.P1
-x sub {i sub 1} sup 2
-.P2
-is
-.EQ
-x sub {i sub 1} sup 2
-.EN
-with braces, but
-.P1
-x sub i sub 1 sup 2
-.P2
-is
-.EQ
-x sub i sub 1 sup 2
-.EN
-which is rather different.
-.PP
-Braces can occur within braces if necessary:
-.P1
-e sup {i pi sup {rho +1}}
-.P2
-is
-.EQ
-e sup {i pi sup {rho +1}}
-.EN
-The general rule is that anywhere you could use some single
-thing like
-.ul
-x,
-you can use an arbitrarily complicated thing if you enclose
-it in braces.
-.UC EQN
-will look after all the details of positioning it and making
-it the right size.
-.PP
-In all cases, make sure you have the
-right number of braces.
-Leaving one out or adding an extra will cause 
-.UC EQN
-to complain bitterly.
-.PP
-Occasionally you will have to
-print braces.
-To do this,
-enclose them in double quotes,
-like "{".
-Quoting is discussed in more detail in section 14.
-.SC Fractions
-.PP
-To make a fraction,
-use the word
-.ul
-over:
-.P1
-a+b over 2c =1
-.P2
-gives
-.EQ
-a+b over 2c =1
-.EN
-The line is made the right length and positioned automatically.
-Braces can be used to make clear what goes over what:
-.P1
-{alpha + beta} over {sin (x)}
-.P2
-is
-.EQ
-{alpha + beta} over {sin (x)}
-.EN
-What happens when there is both an
-.ul
-over
-and a
-.ul
-sup
-in the same expression?
-In such an apparently ambiguous case,
-.UC EQN
-does the
-.ul
-sup
-before the
-.ul
-over,
-so
-.P1
-\(mib sup 2 over pi
-.P2
-is
-$-b sup 2 over pi$
-instead of
-$-b sup {2 over pi}$
-The rules
-which decide which operation is done first in cases like this
-are summarized in section 23.
-When in doubt, however,
-.ul
-use braces
-to make clear what goes with what.
-.SC "Square Roots"
-.PP
-To draw a square root, use
-.ul
-sqrt:
-.P1 2
-sqrt a+b + 1 over sqrt {ax sup 2 +bx+c}
-.P2
-is
-.EQ
-sqrt a+b + 1 over sqrt {ax sup 2 +bx+c}
-.EN
-Warning _ square roots of tall quantities look lousy,
-because a root-sign 
-big enough to cover the quantity is
-too dark and heavy:
-.P1
-sqrt {a sup 2 over b sub 2}
-.P2
-is
-.EQ
-sqrt{a sup 2 over b sub 2}
-.EN
-Big square roots are generally better written as something
-to the power \(12:
-.EQ
-(a sup 2 /b sub 2 ) sup half
-.EN
-which is
-.P1
-(a sup 2 /b sub 2 ) sup half
-.P2
-.SC "Summation, Integral, Etc."
-.PP
-Summations, integrals, and similar constructions
-are easy:
-.P1
-sum from i=0 to {i= inf} x sup i
-.P2
-produces
-.EQ
-sum from i=0 to {i= inf} x sup i
-.EN
-Notice that we used
-braces to indicate where the upper
-part
-$i= inf$
-begins and ends.
-No braces were necessary for the lower part $i=0$,
-because it contained no blanks.
-The braces will never hurt,
-and if the 
-.ul
-from
-and
-.ul
-to
-parts contain any blanks, you must use braces around them.
-.PP
-The
-.ul
-from
-and
-.ul
-to
-parts are both optional,
-but if both are used,
-they have to occur in that order.
-.PP
-Other useful characters can replace the
-.ul
-sum
-in our example:
-.P1
-int   prod   union   inter
-.P2
-become, respectively,
-.EQ
-int ~~~~~~ prod ~~~~~~ union ~~~~~~ inter
-.EN
-Since the thing before the 
-.ul
-from
-can be anything,
-even something in braces,
-.ul
-from-to
-can often be used in unexpected ways:
-.P1
-lim from {n \(mi> inf} x sub n =0
-.P2
-is
-.EQ
-lim from {n-> inf} x sub n =0
-.EN
diff --git a/.ref-Research-V7/usr/doc/eqn/g2 b/.ref-Research-V7/usr/doc/eqn/g2
deleted file mode 100644 (file)
index 4b91b4b..0000000
+++ /dev/null
@@ -1,530 +0,0 @@
-.SC "Size and Font Changes"
-.PP
-By default, equations are set in 10-point type (the same size as this guide),
-with standard mathematical conventions
-to determine what characters are in roman and what in italic.
-Although 
-.UC EQN
-makes a valiant attempt to use
-esthetically pleasing sizes and fonts,
-it is not perfect.
-To change sizes and fonts, use
-.ul
-size n
-and
-.ul
-roman, italic, 
-.ul
-bold
-and
-.ul
-fat.
-Like
-.ul
-sub
-and
-.ul
-sup,
-size
-and font changes affect only the thing that follows
-them, and revert to the normal situation
-at the end of it. Thus
-.P1
-bold x y
-.P2
-is
-.EQ
-bold x y
-.EN
-and
-.P1
-size 14 bold x = y +
-   size 14 {alpha + beta}
-.P2
-gives
-.EQ
-size 14 bold x = y +
-   size 14 {alpha + beta}
-.EN
-As always, you can use braces if you want to affect something
-more complicated than a single letter.
-For example, you can change the size of an entire equation by
-.P1
-size 12 { ... }
-.P2
-.PP
-Legal sizes which may follow 
-.ul
-size
-are
-6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36.
-You can also change the size
-.ul
-by
-a given amount;
-for example, you can say
-.ul
-size~+2
-to make the size two points bigger,
-or
-.ul
-size~\(mi3
-to make it three points smaller.
-This has the advantage that you don't have
-to know what the current size is.
-.PP
-If you are using fonts other than roman, italic and bold,
-you can say
-.ul
-font X
-where 
-.ul
-X
-is a one character
-.UC TROFF
-name or number for the font.
-Since
-.UC EQN
-is tuned for roman, italic and bold,
-other fonts may not give quite as good an appearance.
-.PP
-The
-.ul
-fat 
-operation takes the current font and widens it by overstriking:
-.ul
-fat\ grad
-is
-$fat grad$ and
-.ul
-fat {x sub i}
-is
-$fat {x sub i}$.
-.PP
-If an entire document is to be in a non-standard size
-or font, it is a severe nuisance
-to have to write out a size and font change for each
-equation.
-Accordingly, you can set a ``global'' size or font
-which thereafter affects all equations.
-At the beginning of any equation, you might say, for instance,
-.P1
-^EQ
-gsize 16
-gfont R
- ...
-^EN
-.P2
-to set the size to 16 and the font to roman thereafter.
-In place of R, you can use any of the
-.UC TROFF
-font names.
-The size after
-.ul
-gsize
-can be a relative change with + or \(mi.
-.PP
-Generally,
-.ul
-gsize
-and
-.ul
-gfont
-will appear at the beginning of a document
-but they can also appear
-thoughout a document: the global font and size
-can be changed as often as needed.
-For example, in a footnote\(dd
-.FS
-\(ddLike this one, in which we have a
-$gsize -2$few random
-expressions like $x sub i$ and $pi sup 2$.
-The sizes for these were set by the command
-.ul
-gsize~\(mi2.
-.FE $gsize +2$
-you will typically want the size of equations to match
-the size of the footnote text, which is two points smaller
-than the main text.
-Don't forget to reset the global size
-at the end of the footnote.
-.SC "Diacritical Marks"
-.PP
-To get funny marks on top of letters,
-there are several words:
-.P1
-.tr ^^
-.tr ~~
-.ta 1i
-x dot  $x dot$
-x dotdot       $x dotdot$
-x hat  $x hat$
-x tilde        $x tilde$
-x vec  $x vec$
-x dyad $x dyad$
-x bar  $x bar$
-x under        $x under$
-.P2
-The diacritical mark is placed at the right height.
-The 
-.ul
-bar
-and
-.ul
-under
-are made the right length for the entire construct,
-as in $x+y+z bar$;
-other marks are centered.
-.SC "Quoted Text"
-.PP
-Any input entirely within quotes (\|"..."\|)
-is not subject to any of the font changes and spacing
-adjustments normally done by the equation setter.
-This provides a way to do your own spacing and adjusting if needed:
-.P1
-italic "sin(x)" + sin (x)
-.P2
-is
-.EQ
-italic "sin(x)" + sin (x)
-.EN
-.PP
-Quotes are also used to get braces and other
-.UC EQN
-keywords printed:
-.P1
-"{ size alpha }"
-.P2
-is
-.EQ
-"{ size alpha }"
-.EN
-and
-.P1
-roman "{ size alpha }"
-.P2
-is
-.EQ
-roman "{ size alpha }"
-.EN
-.PP
-The construction "" is often used as a place-holder
-when grammatically
-.UC EQN
-needs something, but you don't actually want anything in your output.
-For example, to make
-$"" sup 2 roman He$,
-you can't just type
-.ul
-sup 2 roman He
-because a
-.ul
-sup
-has to be a superscript
-.ul
-on
-something.
-Thus you must say
-.P1
-"" sup 2 roman He
-.P2
-.PP
-To get a literal quote
-use ``\\"''.
-.UC TROFF 
-characters like
-.ul
-\e(bs
-can appear unquoted, but more complicated things like
-horizontal and vertical motions with
-.ul
-\eh
-and
-.ul
-\ev
-should
-always
-be quoted.
-(If you've never heard of
-.ul
-\\h
-and
-.ul
-\\v,
-ignore this section.)
-.SC "Lining Up Equations"
-.PP
-Sometimes it's necessary to line up a series of equations
-at some horizontal position, often at an equals sign.
-This is done with two operations called
-.ul
-mark
-and
-.ul
-lineup.
-.PP
-The word
-.ul
-mark
-may appear once at any place in an equation.
-It remembers the horizontal position where it appeared.
-Successive equations can contain one occurrence of the word
-.ul
-lineup.
-The place where
-.ul
-lineup
-appears is made to line up
-with the place marked by the previous
-.ul
-mark
-if at all possible.
-Thus, for example,
-you can say
-.P1
-^EQ I
-x+y mark = z
-^EN
-^EQ I
-x lineup = 1
-^EN
-.P2
-to produce
-.EQ I
-x+y mark = z
-.EN
-.EQ I
-x lineup = 1
-.EN
-For reasons too complicated to talk about,
-when you use
-.UC EQN
-and
-`\(mims',
-use either
-.UC .EQ\ I
-or
-.UC .EQ\ L .
-mark
-and
-.ul
-lineup
-don't work with centered equations.
-Also bear in mind that 
-.ul
-mark
-doesn't look ahead;
-.P1
-x mark =1
- ...
-x+y lineup =z
-.P2
-isn't going to work, because there isn't room
-for the
-.ul
-x+y
-part after the
-.ul
-mark
-remembers where the
-.ul
-x
-is.
-.SC "Big Brackets, Etc."
-.PP
-.tr ~
-To get big brackets [~],
-braces {~}, parentheses (~), and bars |~|
-around things, use the
-.ul
-left 
-and
-.ul
-right
-commands:
-.tr ~~
-.P1
-left { a over b + 1 right }
- ~=~ left ( c over d right )
- + left [ e right ]
-.P2
-is
-.EQ
-left { a over b + 1 right } ~=~ left ( c over d right ) + left [ e right ]
-.EN
-The resulting brackets are made big enough to cover whatever they enclose.
-Other characters can be used besides these,
-but the are not likely to look very good.
-One exception is the
-.ul
-floor
-and
-.ul
-ceiling 
-characters:
-.P1
-left floor x over y right floor 
-<= left ceiling a over b right ceiling
-.P2
-produces
-.EQ
-left floor x over y right floor 
-<= left ceiling a over b right ceiling
-.EN
-.PP
-Several warnings about brackets are in order.
-First, braces are typically bigger than brackets and parentheses,
-because they are made up of three, five, seven, etc., pieces,
-while brackets can be made up of two, three, etc.
-Second, big left and right parentheses often look poor,
-because the character set is poorly designed.
-.PP
-The
-.ul
-right
-part may be omitted:
-a ``left something'' need not have a
-corresponding 
-``right
-something''.
-If the
-.ul
-right
-part is omitted,
-put braces around the thing you want the left bracket
-to encompass.
-Otherwise, the resulting brackets may be too large.
-.PP
-If you want to omit the
-.ul
-left
-part, things are more complicated,
-because technically you can't have a
-.ul
-right
-without a corresponding
-.ul
-left.
-Instead you have to say
-.P1
-left "" ..... right )
-.P2
-for example.
-The
-.ul
-left ""
-means a ``left nothing''.
-This satisfies the rules without hurting your output.
-.SC "Piles"
-.PP
-There is a general facility for making vertical piles
-of things; it comes in several flavors.
-For example:
-.P1
-.tr ~~
-A ~=~ left [
-  pile { a above b above c }
-  ~~ pile { x above y above z }
-right ]
-.P2
-will make
-.EQ
-A ~=~ left [
-pile { a above b above c } ~~ pile { x above y above z }
-right ]
-.EN
-The elements of the pile (there can be as many as you want)
-are centered one above another, at the right height for
-most purposes.
-The keyword
-.ul
-above
-is used to separate the pieces;
-braces are used around the entire list.
-The elements of a pile can be as complicated as needed, even containing more piles.
-.PP
-Three other forms of pile exist:
-.ul
-lpile
-makes a pile with the elements left-justified;
-.ul
-rpile
-makes a right-justified pile;
-and
-.ul
-cpile
-makes a centered pile, just like
-.ul
-pile.
-The vertical spacing between the pieces
-is somewhat larger for
-.ul
-l-,
-.ul
-r-
-and
-.ul
-cpiles
-than it is for ordinary piles.
-.P1 2
-roman sign (x)~=~ 
-left {
-   lpile {1 above 0 above -1} 
-   ~~ lpile
-    {if~x>0 above if~x=0 above if~x<0}
-.P2
-makes
-.EQ
-roman sign (x)~=~ 
-left {
-   lpile {1 above 0 above -1} 
-   ~~ lpile
-    {if~x>0 above if~x=0 above if~x<0}
-.EN
-Notice the left brace
-without a matching right one.
-.SC Matrices
-.PP
-It is also possible to make matrices.
-For example, to make
-a neat array like
-.EQ
-matrix {
-  ccol { x sub i above y sub i }
-  ccol { x sup 2 above y sup 2 }
-}
-.EN
-you have to type
-.P1
-matrix {
-  ccol { x sub i above y sub i }
-  ccol { x sup 2 above y sup 2 }
-}
-.P2
-This produces a matrix with
-two centered columns.
-The elements of the columns are then listed just as for a pile,
-each element separated by the word
-.ul
-above.
-You can also use
-.ul
-lcol
-or
-.ul
-rcol
-to left or right adjust columns.
-Each column can be separately adjusted,
-and there can be as many columns as you like.
-.PP
-The reason for using a matrix instead of two adjacent piles, by the way,
-is that if the elements of the piles don't all have the same height,
-they won't line up properly.
-A matrix forces them to line up,
-because it looks at the entire structure before deciding what
-spacing to use.
-.PP
-A word of warning about matrices _
-.ul
-each column must have the same number of elements in it.
-The world will end if you get this wrong.
diff --git a/.ref-Research-V7/usr/doc/eqn/g3 b/.ref-Research-V7/usr/doc/eqn/g3
deleted file mode 100644 (file)
index 0f2d78d..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-.SC "Shorthand for In-line Equations"
-.PP
-In a mathematical document,
-it is necessary to follow mathematical conventions
-not just in display equations,
-but also in the body of the text,
-for example by making variable names like $x$ italic.
-Although this could be done by surrounding the appropriate parts
-with
-.UC .EQ
-and
-.UC .EN ,
-the continual repetition of
-.UC .EQ
-and
-.UC .EN
-is a nuisance.
-Furthermore, with `\(mims',
-.UC .EQ
-and
-.UC .EN
-imply a displayed equation.
-.PP
-.UC EQN
-provides a shorthand for short in-line expressions.
-You can define two characters to mark the left and right ends
-of an in-line equation, and then type expressions right in the middle of text
-lines.
-To set both the left and right characters to dollar signs, for example,
-add to the beginning of your document the three lines
-.P1
- .EQ
- delim %%
- .EN
-.P2
-Having done this, you can then say things like
-.P1
-.fi
-Let %alpha sub i% be the primary variable,
-and let %beta% be zero.
-Then we can show that %x sub 1% is %>=0%.
-.P2
-This works as
-you might expect _
-spaces, newlines, and so on are significant
-in the text, but not in the equation part itself.
-Multiple equations can occur in a single input line.
-.PP
-Enough room is left before and after a line that contains
-in-line expressions
-that something like
-$sum from i=1 to n x sub i$
-does not interfere with the lines surrounding it.
-.PP
-To turn off the delimiters,
-.P1
- .EQ
- delim off
- .EN
-.P2
-Warning: don't use braces, tildes, circumflexes, or double quotes as delimiters _
-chaos will result.
-.SC "Definitions"
-.PP
-.UC EQN
-provides a facility so you can give
-a frequently-used string of characters a name,
-and thereafter just type the name instead of the
-whole string.
-For example, if the sequence
-.P1
-x sub i sub 1 + y sub i sub 1
-.P2
-appears repeatedly throughout a paper,
-you can save re-typing it each time by defining it like this:
-.P1 2
-define  xy  'x sub i sub 1 + y sub i sub 1'
-.P2
-This makes
-.ul
-xy
-a shorthand for whatever characters occur between the single quotes
-in the definition.
-You can use any character instead of quote to mark the ends of the definition,
-so long as it doesn't appear inside the definition.
-.PP
-Now you can use
-.ul
-xy
-like this:
-.P1
-^EQ
-f(x) = xy ...
-^EN
-.P2
-and so on.
-Each occurrence of
-.ul
-xy
-will expand into what it was defined as.
-Be careful to leave spaces or their equivalent
-around the name
-when you actually use it, so
-.UC EQN
-will be able to identify it as special.
-.PP
-There are several things to watch out for.
-First, although definitions can use previous definitions,
-as in
-.P1
- .EQ
- define  xi  ' x sub i '
- define  xi1  ' xi sub 1 '
- .EN
-.P2
-.ul
-don't define something in terms of itself'
-A favorite error is to say
-.P1
-define  X  ' roman X '
-.P2
-This is a guaranteed disaster,
-since X
-.ul
-is
-now defined in terms of itself.
-If you say
-.P1
-define  X  ' roman "X" '
-.P2
-however, the quotes
-protect the second X,
-and everything works fine.
-.PP
-.UC EQN
-keywords can be redefined.
-You can make
-/ mean
-.ul
-over
-by saying
-.P1
-define  /  ' over '
-.P2
-or redefine
-.ul
-over
-as /
-with
-.P1
-define  over  ' / '
-.P2
-.PP
-If you need different things
-to print on a terminal and on the typesetter, it is sometimes worth
-defining a symbol differently in
-.UC NEQN
-and
-.UC EQN .
-This can be done with
-.ul
-ndefine
-and
-.ul
-tdefine.
-A definition made with
-.ul
-ndefine
-only takes effect if you are running
-.UC NEQN ;
-if you use
-.ul
-tdefine,
-the definition only applies for
-.UC EQN .
-Names defined with plain
-.ul
-define
-apply to both
-.UC EQN 
-and
-.UC NEQN .
-.SC "Local Motions"
-.PP
-Although
-.UC EQN
-tries to get most things at the right place on the paper,
-it isn't perfect, and occasionally you will need to tune
-the output to make it just right.
-Small extra horizontal spaces can be obtained with
-tilde and circumflex.
-You can also say
-.ul
-back n
-and
-.ul
-fwd n
-to move small amounts horizontally.
-.ul
-n
-is how far to move in 1/100's of an em (an em is about the width
-of the letter
-`m'.)
-Thus
-.ul
-back 50
-moves back about half the width of an m.
-Similarly you can move things up or down with
-.ul
-up n
-and
-.ul
-down n.
-As with 
-.ul
-sub
-or
-.ul
-sup,
-the local motions affect the next thing in the input,
-and this can be something arbitrarily complicated if it is enclosed
-in braces.
diff --git a/.ref-Research-V7/usr/doc/eqn/g4 b/.ref-Research-V7/usr/doc/eqn/g4
deleted file mode 100644 (file)
index 2a4a2c8..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-.SC "A Large Example"
-.PP
-Here is the complete source for the three display equations
-in the abstract of this guide.
-.sp
-.nf
-.ps -2
-.vs -2
- .EQ I
- G(z)~mark =~ e sup { ln ~ G(z) }
- ~=~ exp left ( 
- sum from k>=1 {S sub k z sup k} over k right )
- ~=~  prod from k>=1 e sup {S sub k z sup k /k}
- .EN
- .EQ I
- lineup = left ( 1 + S sub 1 z + 
- { S sub 1 sup 2 z sup 2 } over 2! + ... right )
- left ( 1+ { S sub 2 z sup 2 } over 2
- + { S sub 2 sup 2 z sup 4 } over { 2 sup 2 cdot 2! }
- + ... right ) ...
- .EN
- .EQ I
- lineup =  sum from m>=0 left (
- sum from
- pile { k sub 1 ,k sub 2 ,..., k sub m  >=0
- above
- k sub 1 +2k sub 2 + ... +mk sub m =m}
- { S sub 1 sup {k sub 1} } over {1 sup k sub 1 k sub 1 ! } ~
- { S sub 2 sup {k sub 2} } over {2 sup k sub 2 k sub 2 ! } ~
- ...
- { S sub m sup {k sub m} } over {m sup k sub m k sub m ! } 
- right ) z sup m
- .EN
-.sp
-.fi
-.ps +2
-.vs +2
-.SC "Keywords, Precedences, Etc."
-.PP
-If you don't use braces,
-.UC EQN
-will
-do operations in the order shown in this list.
-.P1 3
-.ft I
-dyad vec under bar tilde hat dot dotdot
-fwd  back  down  up
-fat  roman  italic  bold  size
-sub  sup  sqrt  over
-from  to
-.ft R
-.P2
-These operations group to the left:
-.P1
-.ft I
-over  sqrt  left  right
-.ft R
-.P2
-All others group to the right.
-.PP
-Digits, parentheses, brackets, punctuation marks, and these mathematical words
-are converted
-to Roman font when encountered:
-.P1
-sin  cos  tan  sinh  cosh  tanh  arc
-max  min  lim  log  ln  exp
-Re  Im  and  if  for  det
-.P2
-These character sequences are recognized and translated as shown.
-.sp
-.nf
-.tr -\(mi
-.in .5i
-.ta 1i
->=             $>=$
-<=             $<=$
-==             $==$
-!=             $!=$
-+-             $+-$
-->             $->$
-<-             $<-$
-<<             $<<$
->>             $>>$
-inf            $inf$
-partial                $partial$
-half           $half$
-prime          $prime$
-approx         $approx$
-nothing                $nothing$
-cdot           $cdot$
-times          $times$
-del            $del$
-grad           $grad$
-\&...          $...$
-,...,          $,...,$
-sum            $sum$
-.sp 3p
-int            $int$
-.sp 2p
-prod           $prod$
-union          $union$
-inter          $inter$
-.sp
-.in
-.fi
-.tr --
-.PP
-To obtain Greek letters,
-simply spell them out in whatever case you want:
-.sp
-.nf
-.in .2i
-.ta .7i 1.4i 2.1i
-DELTA  $DELTA$ iota    $iota$
-GAMMA  $GAMMA$ kappa   $kappa$
-LAMBDA $LAMBDA$        lambda  $lambda$
-OMEGA  $OMEGA$ mu      $mu$
-PHI    $PHI$   nu      $nu$
-PI     $PI$    omega   $omega$
-PSI    $PSI$   omicron $omicron$
-SIGMA  $SIGMA$ phi     $phi$
-THETA  $THETA$ pi      $pi$
-UPSILON        $UPSILON$       psi     $psi$
-XI     $XI$    rho     $rho$
-alpha  $alpha$ sigma   $sigma$
-beta   $beta$  tau     $tau$
-chi    $chi$   theta   $theta$
-delta  $delta$ upsilon $upsilon$
-epsilon        $epsilon$       xi      $xi$
-eta    $eta$   zeta    $zeta$
-gamma  $gamma$
-.sp
-.in
-.fi
-.PP
-These are all the words known to
-.UC EQN
-(except for characters with names),
-together with the section where they are discussed.
-.sp
-.nf
-.in .2i
-.ta .7i 1.4i 2.1i
-above  17, 18  lpile   17
-back   21      mark    15
-bar    13      matrix  18
-bold   12      ndefine 20
-ccol   18      over    9
-col    18      pile    17
-cpile  17      rcol    18
-define 20      right   16
-delim  19      roman   12
-dot    13      rpile   17
-dotdot 13      size    12
-down   21      sqrt    10
-dyad   13      sub     7
-fat    12      sup     7
-font   12      tdefine 20
-from   11      tilde   13
-fwd    21      to      11
-gfont  12      under   13
-gsize  12      up      21
-hat    13      vec     13
-italic 12      ~, ^    4, 6
-lcol   18      { }     8
-left   16      "..."   8, 14
-lineup 15
-.sp
-.in 0
-.fi
-.SC Troubleshooting
-.PP
-If you make a mistake in an equation,
-like leaving out a brace (very common)
-or having one too many (very common)
-or having a
-.ul
-sup
-with nothing before it (common),
-.UC EQN
-will tell you with the message
-.P1 2
-.ft I
-syntax error between lines x and y, file z
-.ft R
-.P2
-where
-.ul
-x
-and
-.ul
-y
-are approximately the lines
-between which the trouble occurred, and
-.ul
-z
-is the name
-of the file in question.
-The line numbers are approximate _ look nearby as well.
-There are also self-explanatory messages that arise if you leave out a quote
-or try to run
-.UC EQN
-on a non-existent file.
-.PP
-If you want to check a document before actually printing it
-(on
-.UC UNIX 
-only),
-.P1
-eqn  files >/dev/null
-.P2
-will
-throw away the output but print the messages.
-.PP
-If you use something like dollar signs as delimiters,
-it is easy to leave one out.
-This causes very strange troubles.
-The program
-.ul
-checkeq
-(on
-.UC GCOS ,
-use
-.ul
-\&./checkeq
-instead)
-checks for misplaced or missing dollar signs
-and similar troubles.
-.PP
-In-line equations can only be so big
-because of an internal buffer in
-.UC TROFF .
-If you get a message
-``word overflow'',
-you have exceeded this limit.
-If you print the equation as a displayed equation
-this message will usually go away.
-The message
-``line overflow''
-indicates you have exceeded an even bigger buffer.
-The only cure for this is to break the equation into two separate ones.
-.PP
-On a related topic,
-.UC EQN
-does not break equations by itself _
-you must split long equations up across multiple lines
-by yourself,
-marking each by a separate
-.UC .EQ
-\&...\&
-.UC .EN
-sequence.
-.UC EQN
-does warn about equations that are too long
-to fit on one line.
diff --git a/.ref-Research-V7/usr/doc/eqn/g5 b/.ref-Research-V7/usr/doc/eqn/g5
deleted file mode 100644 (file)
index 6da23f2..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-.SC "Use on UNIX"
-.PP
-To print a document that contains mathematics on
-the
-.UC UNIX
-typesetter,
-.P1
-eqn files | troff
-.P2
-If
-there are any 
-.UC TROFF
-options, they go after the
-.UC TROFF 
-part of the command. For example,
-.P1
-eqn files | troff -ms
-.P2
-To run the same document on the
-.UC GCOS
-typesetter, use
-.P1
-eqn files | troff -g (other options) | gcat
-.P2
-.PP
-A compatible version of
-.UC EQN
-can be used on devices like teletypes and
-.UC DASI
-and
-.UC GSI
-terminals
-which have half-line forward and reverse capabilities.
-To print
-equations on a Model 37 teletype, for example, use
-.P1
-neqn files | nroff
-.P2
-The language for equations recognized by
-.UC NEQN
-is identical to that of
-.UC EQN,
-although of course the output is more restricted.
-.PP
-To use a
-.UC GSI
-or
-.UC DASI
-terminal as the output device,
-.P1
-neqn files | nroff -T\fIx\fP
-.P2
-where
-.ul
-x
-is the terminal type you are using,
-such as
-.ul
-300
-or
-.ul
-300S.
-.PP
-.UC EQN
-and
-.UC NEQN
-can be used with the 
-.UC TBL
-program[2]
-for setting tables that contain mathematics.
-Use
-.UC TBL
-before
-.UC [N]EQN ,
-like this:
-.P1
-tbl  files  |  eqn  |  troff
-tbl  files  |  neqn  |  nroff
-.P2
-.SC "Acknowledgments"
-.PP
-We are deeply indebted to J. F. Ossanna,
-the author of
-.UC TROFF ,
-for his willingness to extend
-.UC TROFF
-to make our task easier,
-and for his
-continuous assistance during the development
-and evolution
-of
-.UC EQN .
-We are also grateful to A. V. Aho
-for advice on language design,
-to S. C. Johnson for assistance with
-the
-.UC YACC
-compiler-compiler,
-and to all the
-.UC EQN
-users
-who have made helpful suggestions and criticisms.
-.SH
-References
-.LP
-.IP [1]
-J. F. Ossanna,
-.UC NROFF/TROFF \& ``
-User's Manual'',
-Bell Laboratories Computing Science Technical Report
-#54, 1976.
-.IP [2]
-M. E. Lesk,
-``Typing Documents on
-.UC UNIX '',
-Bell Laboratories, 1976.
-.IP [3]
-M. E. Lesk,
-.UC TBL \& ``
-\(em A Program for Setting Tables'',
-Bell Laboratories Computing Science Technical Report #49,
-1976.
diff --git a/.ref-Research-V7/usr/doc/f77 b/.ref-Research-V7/usr/doc/f77
deleted file mode 100644 (file)
index 609a93f..0000000
+++ /dev/null
@@ -1,2004 +0,0 @@
-.de XX
-.ne 3
-.sp .3
-.ti -1i
-.ta 1i
-\\$1   \c
-..
-.EQ
-delim $$
-.EN
-.ND "1 August 1978"
-.RP
-.TL
-A Portable Fortran 77 Compiler
-.AU
-S. I. Feldman
-.AU
-P. J. Weinberger
-.AI
-.MH
-.AB
-.LP
-The Fortran language has just been revised.
-The new language, known as Fortran 77,
-became an official American National Standard on April 3, 1978.
-We report here on a compiler and run-time system for the new extended language.
-This is believed to be the first complete Fortran 77 system to be implemented.
-This compiler is designed to be portable,
-to be correct and complete,
-and to generate code compatible with calling sequences produced by C compilers.
-In particular, this Fortran is quite usable on
-.UX
-systems.
-In this paper, we describe the language compiled,
-interfaces between procedures,
-and file formats assumed by the I/O system.
-An appendix describes the Fortran 77 language.
-.AE
-.CS 9 10 19 0 0 8
-.NH 0
-INTRODUCTION
-.PP
-The Fortran language has just been revised.
-The new language, known as Fortran 77, became an official American National Standard [1] on April 3, 1978.
-for the language, known as Fortran 77, is about to be published.
-Fortran 77 supplants 1966 Standard Fortran [2].
-We report here on a compiler and run-time system for the new extended language.
-The compiler and computation library were written by SIF, the I/O system by PJW.
-We believe ours to be the first complete Fortran 77 system to be implemented.
-This compiler is designed to be portable to a number of different machines,
-to be correct and complete,
-and to generate code compatible with calling sequences produced
-by compilers for the C language [3].
-In particular,
-it is in use on
-.UX
-systems.
-Two families of C compilers are in use at Bell Laboratories,
-those based on D. M. Ritchie's PDP-11 compiler[4]
-and those based on S. C. Johnson's portable C compiler [5].
-This Fortran compiler can drive the second passes of either family.
-In this paper, we describe the language compiled,
-interfaces between procedures,
-and file formats assumed by the I/O system.
-We will describe implementation details in companion papers.
-.PP
-.NH 2
-Usage
-.PP
-At present, versions of the compiler run on and compile for the PDP-11,
-the VAX-11/780,
-and the Interdata 8/32
-.UX
-systems.
-The command to run the compiler is
-.DS C
-f\|77  \fIflags  file . . .\fR
-.DE
-.B f\|77
-is a general-purpose command for compiling and loading Fortran and Fortran-related files.
-EFL [6] and Ratfor [7] source files will be preprocessed before being presented to the Fortran compiler.
-C and assembler source files will be compiled by the appropriate programs.
-Object files will be loaded.
-(The
-.B f\|77
-and
-.B cc
-commands cause slightly different loading sequences to be generated,
-since Fortran programs need a few extra libraries and a different startup routine
-than do C programs.)
-The following file name suffixes are understood:
-.DS I
- .f    Fortran source file
- .e    EFL source file
- .r    Ratfor source file
- .c    C source file
- .s    Assembler source file
- .o    Object file
-.DE
-The following flags are understood:
-.in +1i
-.XX \(miS
-Generate assembler output for each source file, but do not assemble it.
-Assembler output for a source file
-.B x.f,
-.B x.e,
-.B x.r,
-or
-.B x.c
-is put on file
-\fBx.s\fR.
-.XX \(mic
-Compile but do not load.
-Output for
-.B x.f,
-.B x.e,
-.B x.r,
-.B x.c,
-or
-.B x.s
-is put on file
-.B x.o.
-.XX \(mim
-Apply the M4 macro preprocessor to each EFL or Ratfor source file before using the appropriate compiler.
-.XX \(mif
-Apply the EFL or Ratfor processor to all
-relevant files, and leave the output from
-.B x.e
-or
-.B x.r
-on
-.B x.f.
-Do not compile the resulting Fortran program.
-.XX \(mip
-Generate code to produce usage profiles.
-.XX "\(mio \fIf\fR"
-Put executable module on file
-.I f.
-(Default is
-\fBa.out\fR).
-.XX \(miw
-Suppress all warning messages.
-.XX \(miw66
-Suppress warnings about Fortran 66 features used.
-.XX \(miO
-Invoke the C object code optimizer.
-.XX \(miC
-Compile code the checks that subscripts are within array bounds.
-.XX \(mionetrip
-Compile code that performs every
-.B do
-loop at least once.
-(see Section 2.10).
-.XX \(miU
-Do not convert upper case letters to lower case.
-The default is to convert Fortran programs to lower case.
-.XX \(miu
-Make the default type of a variable
-.B undefined.
-(see Section 2.3).
-.XX \(miI2
-On machines which support short integers,
-make the default integer constants and variables short.
-(\fB\(miI4\fR is the standard value of this option).  (see Section 2.14).
-All logical quantities will be short.
-.XX \(miE
-The remaining characters in the argument are used as an EFL flag argument.
-.XX \(miR
-The remaining characters in the argument are used as a Ratfor flag argument.
-.XX \(miF
-Ratfor and and EFL source programs are pre-processed into Fortran files,
-but those files are not compiled or removed.
-.in -1i
-.LP
-Other flags,
-all library names (arguments beginning \fB\(mil\fR),
-and any names not ending with one of the understood suffixes are passed to the loader.
-.NH 2
-Documentation Conventions
-.PP
-In running text, we write Fortran keywords and other literal strings in boldface lower case.
-Examples will be presented in lightface lower case.
-Names representing a class of values will be printed in italics.
-.NH 2
-Implementation Strategy
-.PP
-The compiler and library are written entirely in C.
-The compiler  generates C compiler intermediate code.
-Since there are C compilers running on a variety of machines,
-relatively small changes will make this Fortran compiler generate code for any of them.
-Furthermore, this approach guarantees that the resulting programs are compatible with C usage.
-The runtime computational library is complete.
-The mathematical functions are computed to at least 63 bit precision.
-The runtime I/O library makes use of D. M. Ritchie's Standard C I/O package [8]
-for transferring data.
-With the few exceptions described below, only documented calls are used,
-so it should be relatively easy to modify to run on other operating
-systems.
-.NH 1
-LANGUAGE EXTENSIONS
-.PP
-Fortran 77 includes almost all of Fortran 66 as a subset.
-We describe the differences briefly in the Appendix.
-The most important additions are a character string data type,
-file-oriented input/output statements, and random access I/O.
-Also, the language has been cleaned up considerably.
-.PP
-In addition to implementing the language specified in the new Standard,
-our compiler implements a few extensions described in this section.
-Most are useful additions to the language.
-The remainder are extensions
-to make it easier to communicate with C procedures
-or to permit compilation of
-old (1966 Standard) programs.
-.NH 2
-Double Complex Data Type
-.IP
-The new type
-.B "double complex"
-is defined.
-Each datum is represented by a pair of double precision real variables.
-A double complex version of every
-.B complex
-built-in function is provided.
-The specific function names begin with \fBz\fR instead of \fBc\fR.
-.NH 2
-Internal Files
-.IP
-The Fortran 77 standard introduces ``internal files'' (memory arrays), but
-restricts their use to formatted sequential I/O statements.
-Our I/O system also permits internal files to be used
-in direct and unformatted reads and writes.
-.NH 2
-Implicit Undefined statement
-.IP
-Fortran 66 has a fixed rule that the type of a variable that does not appear in a type statement
-is
-.B integer
-if its first letter is
-\fBi, j, k, l, m\fR or \fBn\fR,
-and
-.B real
-otherwise.
-Fortran 77 has an
-.B implicit
-statement for overriding this rule.
-As an aid to good programming practice, we permit an additional type,
-.B undefined.
-The statement
-.DS
-implicit undefined(a-z)
-.DE
-turns off the automatic data typing mechanism,
-and the compiler will issue a diagnostic for each variable that is used but does
-not appear in a type statement.
-Specifying the
-.B \(miu
-compiler flag is equivalent to beginning each procedure with this statement.
-.NH 2
-Recursion
-.IP
-Procedures may call themselves, directly or through a chain of other procedures.
-.NH 2
-Automatic Storage
-.IP
-Two new keywords are recognized,
-.B static
-and
-.B automatic.
-These keywords may appear as ``types'' in type statements and in
-.B implicit
-statements.
-Local variables are static by default;
-there is exactly one copy of the datum, and its value is retained between calls.
-There is one copy of each variable declared
-.B automatic
-for each invocation of the procedure.
-Automatic variables may not appear in
-.B equivalence,
-.B data,
-or
-.B save
-statements.
-.NH 2
-Source Input Format
-.IP
-The Standard expects input to the compiler to be in 72 column format:
-except in comment lines,
-the first five characters are the statement number, the next is the continuation character,
-and the next sixty-six are the body of the line.
-(If there are fewer than seventy-two characters on a line, the compiler pads it with blanks;
-characters after the seventy-second are ignored).
-.IP
-In order to make it easier to type Fortran programs,
-our compiler also accepts input in variable length lines.
-An ampersand (``&'') in the first position of a line indicates a continuation
-line; the remaining characters form the body of the line.
-A tab character in one of the first six positions of a line signals the
-end of the statement number and continuation part of the line;
-the remaining characters form the body of the line.
-A tab elsewhere on the line is treated as another kind of blank by the
-compiler.
-.IP
-In the Standard, there are only 26 letters \(em Fortran is a one-case language.
-Consistent with ordinary
-.UX
-system usage, our compiler expects lower case input.
-By default, the compiler converts all upper case characters to lower case except those inside character constants.
-However, if the
-.B \(miU
-compiler flag is specified, upper case letters are not transformed.
-In this mode, it is possible to specify external names with upper case letters in them,
-and to have distinct variables differing only in case.
-Regardless of the setting of the flag,
-keywords will only be recognized in lower case.
-.NH 2
-Include Statement
-.IP
-The statement
-.DS
-include \(fmstuff\|\(fm
-.DE
-is replaced by the contents of the file
-.B stuff.
-\fBinclude\fRs may be nested to a reasonable depth, currently ten.
-.NH 2
-Binary Initialization Constants
-.IP
-A
-.B logical,
-.B real,
-or
-.B integer
-variable may be initialized in a
-.B data
-statement
-by a binary constant, denoted by a letter followed by a quoted string.
-If the letter is \fBb\fR, the string is binary, and only zeroes and ones are permitted.
-If the letter is \fBo\fR, the string is octal, with digits \fB0\(mi7\fR.
-If the letter is \fBz\fR or \fBx\fR, the string is hexadecimal, with digits \fB0\(mi9\fR, \fBa\(mif\fR.
-Thus, the statements
-.DS
-integer a(3)
-data a / b\(fm1010\(fm, o\(fm12\(fm, z\(fma\(fm /
-.DE
-initialize all three elements of
-.B a
-to ten.
-.NH 2
-Character Strings
-.IP
-For compatibility with C usage, the following backslash escapes are recognized:
-.DS
-\en    newline
-\et    tab
-\eb    backspace
-\ef    form feed
-\e0    null
-\e\(fm apostrophe (does not terminate a string)
-\e"    quotation mark (does not terminate a string)
-\e\e   \e
-\e\fIx\fR      \fIx\fR,  where \fIx\fR is any other character
-.DE
-Fortran 77 only has one quoting character, the apostrophe.
-Our compiler and I/O system recognize
-both the apostrophe ( \(fm ) and the double-quote ( " ).
-If a string begins with one variety of quote mark, the other may be embedded within it
-without using the repeated quote or backslash escapes.
-.IP
-Every unequivalenced scalar local character variable and every character string constant is aligned
-on an
-.B integer
-word boundary.
-Each character string constant appearing outside a
-.B data
-statement is followed by a
-null character to ease communication with C routines.
-.NH 2
-Hollerith
-.IP
-Fortran 77 does not have the old Hollerith (\fIn\|\fBh\fR)
-notation,
-though the new Standard recommends implementing the old Hollerith feature
-in order to improve compatibility with old programs.
-In our compiler, Hollerith data may be used in place of character string constants,
-and may also be used to initialize non-character variables in
-.B data
-statements.
-.NH 2
-Equivalence Statements
-.IP
-As a very special and peculiar case,
-Fortran 66 permits an element of a multiply-dimensioned array to be represented by
-a singly-subscripted reference in
-.B equivalence
-statements.
-Fortran 77 does not permit this usage, since
-subscript lower bounds may now be different from 1.
-Our compiler permits single subscripts in
-.B equivalence
-statements,
-under the interpretation that all missing subscripts are equal to 1.
-A warning message is printed for each such incomplete subscript.
-.NH 2
-One-Trip DO Loops
-.IP
-The Fortran 77 Standard requires that the range of a
-.B do
-loop not be performed
-if the initial value is already past the limit value,
-as in
-.DS
-do 10 i = 2, 1
-.DE
-The 1966 Standard stated that the effect of such a statement was undefined,
-but it was common practice that the range of a
-.B do
-loop would be performed
-at least once.
-In order to accommodate old programs, though they were in violation of the 1966 Standard,
-the
-.B \(mionetrip
-compiler flag causes non-standard loops to be generated.
-.NH 2
-Commas in Formatted Input
-.IP
-The I/O system attempts to be more lenient than the
-Standard when it seems worthwhile.
-When doing a formatted read of non-character variables,
-commas may be used as value separators in the input record,
-overriding the field lengths given in the format statement.
-Thus,
-the format
-.DS
-(i10, f20.10, i4)
-.DE
-will read the record
-.DS
-\(mi345,.05e\(mi3,12
-.DE
-correctly.
-.NH 2
-Short Integers
-.IP
-On machines that support halfword integers,
-the compiler accepts declarations of type
-.B integer\(**2.
-(Ordinary integers follow the Fortran rules about occupying the same
-space as a REAL variable; they are assumed to be of C type
-.B "long int" ;
-halfword integers are of C type
-.B "short int" .)
-An expression involving only objects of type
-.B integer\(**2
-is of that type.
-Generic functions return short or long integers depending on the actual types of their arguments.
-If a procedure is compiled using the
-.B \(miI2
-flag, all small integer constants will be
-of type
-.B integer\(**2.
-If the precision of an integer-valued intrinsic function is not determined by the generic function rules,
-one will be chosen that returns the prevailing length
-(\fBinteger\(**2\fR when the \fB\(miI2\fR command flag is in effect).
-When the
-.B \(miI2
-option is in effect, all quantities of type
-.B logical
-will be short.
-Note that these short integer and logical quantities do not obey the standard rules for storage association.
-.NH 2
-Additional Intrinsic Functions
-.IP
-This compiler supports all of the intrinsic functions specified in the Fortran 77 Standard.
-In addition, there are functions for performing bitwise Boolean operations
-(
-.B or,
-.B and,
-.B xor,
-and
-.B not)
-and for accessing the
-.UX
-command arguments
-(
-.B getarg
-and
-.B iargc
-).
-.NH 1
-VIOLATIONS OF THE STANDARD
-.PP
-We know only thre ways in which our Fortran system violates the new standard:
-.NH 2
-Double Precision Alignment
-.IP
-The Fortran standards (both 1966 and 1977)
-permit
-.B common
-or
-.B equivalence
-statements to force a double precision quantity onto an odd word boundary,
-as in the following example:
-.DS I
-real a(4)
-double precision b,c
-.sp .5
-equivalence (a(1),b), (a(4),c)
-.DE
-Some machines (e.g., Honeywell 6000, IBM 360) require that double precision quantities be on double word boundaries;
-other machines (e.g., IBM 370), run inefficiently if this alignment rule is not observed.
-It is possible to tell which equivalenced and common variables suffer from a forced odd
-alignment, but every double precision argument would have to be assumed on a bad boundary.
-To load such a quantity on some machines,
-it would be necessary to use separate operations to move the upper and lower halves
-into the halves of an aligned temporary, then to load that double precision temporary; the reverse would be
-needed to store a result.
-We have chosen to require that all double precision real and complex quantities
-fall on even word boundaries on machines with corresponding hardware requirements,
-and to issue a diagnostic if the source code demands a violation of the rule.
-.NH 2
-Dummy Procedure Arguments
-.IP
-If any argument of a procedure is of type character,
-all dummy procedure arguments of that procedure must be declared
-in an
-.B external
-statement.
-This requirement arises as a subtle corollary of the way we represent character string arguments
-and of the one-pass nature of the compiler.
-A warning is printed if a dummy procedure is not declared
-.B external.
-Code is correct if there are no
-.B character
-arguments.
-.NH 2
-T and TL Formats
-.IP
-The implementation of the
-.B t
-(absolute tab)
-and
-.B tl
-(leftward tab)
-format codes
-is defective.
-These codes allow rereading or rewriting part of the
-record which has already been processed.
-(Section 6.3.2 in the Appendix.)
-The implementation uses seeks,
-so if the unit is not one which allows seeks,
-such as a terminal,
-the program is in error.
-(People who can make a case for using
-.B tl
-should let us know.)
-A benefit of the implementation chosen is
-that there is no upper limit on the length of
-a record,
-nor is it necessary to predeclare any record
-lengths except where specifically required
-by Fortran or the operating system.
-.NH 1
-INTER-PROCEDURE INTERFACE
-.PP
-To be able to write C procedures that call or are called by Fortran procedures,
-it is necessary to know the conventions for procedure names,
-data representation,
-return values,
-and argument lists that the compiled code obeys.
-.NH 2
-Procedure Names
-.PP
-On
-.UX
-systems,
-the name of a common block or a Fortran procedure
-has an underscore appended to it by the compiler
-to distinguish it from a C procedure or external variable
-with the same user-assigned name.
-Fortran library procedure names have embedded underscores to avoid clashes
-with user-assigned subroutine names.
-.NH 2
-Data Representations
-.PP
-The following is a table of corresponding Fortran and C declarations:
-.KS
-.TS
-center;
-c c
-l l.
-Fortran        C
-.sp .5
-integer\(**2 x short int x;
-integer x      long int x;
-logical x      long int x;
-real x float x;
-double precision x     double x;
-complex x      struct { float r, i; } x;
-double complex x       struct { double dr, di; } x;
-character\(**6 x       char x[6];
-.TE
-.KE
-(By the rules of Fortran,
-.B integer,
-.B logical,
-and
-.B real
-data occupy the same amount of memory).
-.NH 2
-Return Values
-.PP
-A function of type
-.B integer,
-.B logical,
-.B real,
-or
-.B "double precision"
-declared as a C function that returns the corresponding type.
-A
-.B complex
-or
-.B "double complex"
-function is equivalent to a C routine
-with an additional
-initial argument that points to the place where the return value is to be stored.
-Thus,
-.DS
-complex function f( . . . )
-.DE
-is equivalent to
-.DS
-f_(temp, . . .)
-struct { float r, i; } \(**temp;
- . . .
-.DE
-.DE
-A character-valued function is equivalent to a C routine with
-two extra initial arguments:
-a data address and a length.
-Thus,
-.DS
-character\(**15 function g( . . . )
-.DE
-is equivalent to
-.DS
-g_(result, length, . . .)
-char result[ ];
-long int length;
- . . .
-.DE
-and could be invoked in C by
-.DS
-char chars[15];
- . . .
-g_(chars, 15L, . . . );
-.DE
-Subroutines are invoked as if they were \fBinteger\fR-valued functions
-whose value specifies which alternate return to use.
-Alternate return arguments (statement labels) are not passed to the function,
-but are used to do an indexed branch in the calling procedure.
-(If the subroutine has no entry points with alternate return arguments,
-the returned value is undefined.)
-The statement
-.DS
-call nret(\(**1, \(**2, \(**3)
-.DE
-is treated exactly as if it were the computed
-.B goto
-.DS
-goto (1, 2, 3),  nret( )
-.DE
-.NH 2
-Argument Lists
-.PP
-All Fortran arguments are passed by address.
-In addition,
-for every argument that is of type character or
-that is a dummy procedure,
-an argument giving the length of the value is passed.
-(The string lengths are
-.B "long int"
-quantities passed by value).
-The order of arguments is then:
-.DS
-Extra arguments for complex and character functions
-Address for each datum or function
-A \fBlong int\fR for each character or procedure argument
-.DE
-Thus, the call in
-.DS
-external f
-character\(**7 s
-integer b(3)
- . . .
-call sam(f, b(2), s)
-.DE
-is equivalent to that in
-.DS
-int f();
-char s[7];
-long int b[3];
- . . .
-sam_(f, &b[1], s, 0L, 7L);
-.DE
-Note that the first element of a C array always has subscript zero,
-but Fortran arrays begin at 1 by default.
-Fortran arrays are stored in column-major order, C arrays are stored in row-major order.
-.NH 1
-FILE FORMATS
-.NH 2
-Structure of Fortran Files
-.PP
-Fortran requires four kinds of external files:
-sequential formatted and unformatted,
-and direct formatted and unformatted.
-On
-.UX
-systems,
-these are all implemented as ordinary files
-which are assumed to have the proper
-internal structure.
-.PP
-Fortran I/O is based on ``records''.
-When a direct file is opened in a Fortran program,
-the record length of the records must be given,
-and this is used by the Fortran I/O system to
-make the file look as if it is made up of records
-of the given length.
-In the special case that the record length is given
-as 1,
-the files are not considered to be divided into records,
-but are treated as byte-addressable byte strings;
-that is,
-as ordinary
-.UX
-file system files.
-(A read or write request on such a file keeps consuming bytes until
-satisfied, rather than being restricted to a single record.)
-.PP
-The peculiar requirements on sequential unformatted files
-make it unlikely that they will ever be read or written by any means except Fortran I/O statements.
-Each record is preceded and followed by
-an integer containing the record's length in bytes.
-.PP
-The Fortran I/O system breaks sequential formatted files
-into records while reading by using each newline
-as a record separator.
-The result of reading off the end of a record is undefined according to the Standard.
-The I/O system is permissive and
-treats the record as being extended by blanks.
-On output,
-the I/O system will write a newline at the end of each
-record.
-It is also possible for programs to write newlines
-for themselves.
-This is an error,
-but the only effect will be that the single record
-the user thought he wrote will be treated as
-more than one record when being read or
-backspaced over.
-.NH 2
-Portability Considerations
-.PP
-The Fortran I/O system uses only the facilities of the
-standard C I/O library,
-a widely available and fairly portable package,
-with the following two nonstandard features:
-The I/O system needs to know whether a file
-can be used for direct I/O,
-and whether or not it is possible to backspace.
-Both of these facilities are implemented
-using the
-.B fseek
-routine,
-so there is a routine
-.B canseek
-which determines if
-.B fseek
-will have the desired effect.
-Also, the
-.B inquire
-statement provides the user
-with the ability to find out if two files are the
-same,
-and to get the name of an already opened file
-in a form which would enable the program to reopen
-it.
-(The
-.UX
-operating system implementation attempts to determine the full pathname.)
-Therefore there are two routines which
-depend on facilities of the operating system
-to provide these two services.
-In any case,
-the I/O system
-runs on the PDP-11, VAX-11/780, and Interdata 8/32
-.UX
-systems.
-.NH 2
-Pre-Connected Files and File Positions
-.PP
-Units 5, 6, and 0 are preconnected when the program starts.
-Unit 5 is connected to the standard input,
-unit 6 is connected to the standard output,
-and unit 0 is connected to the standard error unit.
-All are connected for sequential formatted I/O.
-.PP
-All the other units are also preconnected when execution
-begins.
-Unit
-.I n
-is connected to a file named \fBfort.\fIn\fR.
-These files need not exist,
-nor will they be created unless their units are used
-without first executing an
-.B open.
-The default connection is for sequential formatted I/O.
-.PP
-The Standard does not specify where a file which has been explicitly \fBopen\fRed
-for sequential I/O is initially positioned.
-In fact,
-the I/O system attempts to position the file at the end,
-so a
-.B write
-will append to the file and a
-.B read
-will result in an end-of-file indication.
-To position a file to its beginning,
-use a
-.B rewind
-statement.
-The preconnected units
-0, 5, and 6 are positioned as they come
-from the program's parent process.
-.SG
-.SH
-REFERENCES
-.LP
-.IP 1.
-\fISigplan Notices \fB11\fR, No.3 (1976),
-as amended in X3J3 internal documents through ``/90.1''.
-.IP 2.
-\fIUSA Standard FORTRAN, USAS X3.9-1966\fR,
-New York: United States of America Standards Institute, March 7, 1966.
-Clarified in
-\fIComm. ACM \fB12,\fR 289 (1969)
-and
-\fIComm. ACM \fB14, \fR 628 (1971).
-.IP 3.
-B. W. Kernighan and D. M. Ritchie,
-.I
-The C Programming Language,
-.R
-Englewood Cliffs: Prentice-Hall (1978).
-.IP 4.
-D. M. Ritchie, private communication.
-.IP 5.
-S. C. Johnson,
-``A Portable Compiler: Theory and Practice'',
-Proc. 5th ACM Symp. on Principles of Programming Languages
-(January 1978).
-.IP 6.
-S. I. Feldman,
-``An Informal Description of EFL'',
-internal memorandum.
-.IP 7.
-B. W. Kernighan,
-``RATFOR \(em A Preprocessor for a Rational Fortran'',
-.I
-Bell Laboratories Computing Science Technical Report #55,
-.R
-(January 1977).
-.IP 8.
-D. M. Ritchie, private communication.
-.bp
-.SH
-APPENDIX.  Differences Between Fortran 66 and Fortran 77
-.PP
-The following is a very brief description of the differences
-between the 1966 [2] and the 1977 [1] Standard languages.
-We assume that the reader is familiar with Fortran 66.
-We do not pretend to be complete, precise,
-or unbiased,
-but plan to describe what we feel are the most important aspects of the new language.
-At present the only current information on the 1977 Standard is in publications of the X3J3 Subcommittee
-of the
-American National Standards Institute.
-The following information is from the ``/92'' document.
-This draft Standard is written in English rather than a meta-language, but it is forbidding
-and legalistic.
-No tutorials or textbooks are available yet.
-.NH 0
-Features Deleted from Fortran 66
-.NH 2
-Hollerith
-.IP
-All notions of ``Hollerith''
-(\fIn\|\fBh\fR)
-as data
-have been officially removed, although our compiler, like almost all in the foreseeable future,
-will continue to support this archaism.
-.NH 2
-Extended Range
-.IP
-In Fortran 66, under a set of very restrictive and rarely-understood conditions, it is permissible
-to jump out of the range of a
-.B do
-loop, then jump back into it.
-Extended range has been removed in the Fortran 77 language.
-The restrictions are so special, and the implementation of extended range is so unreliable in many compilers,
-that this change really counts as no loss.
-.NH 1
-Program Form
-.NH 2
-Blank Lines
-.IP
-Completely blank lines are now legal comment lines.
-.NH 2
-Program and Block Data Statements
-.IP
-A main program may now begin with a statement that gives that program an external name:
-.DS
-program work
-.DE
-Block data procedures may also have names.
-.DS
-block data stuff
-.DE
-There is now a rule that only
-.I one
-unnamed
-block data procedure may appear in a program.
-(This rule is not enforced by our system.)
-The Standard does not specify the effect of the program and block data names,
-but they are clearly intended to aid conventional loaders.
-.NH 2
-ENTRY Statement
-.IP
-Multiple entry points are now legal.
-Subroutine and function subprograms may have additional entry points,
-declared by an
-.B entry
-statement with an optional argument list.
-.DS
-entry extra(a, b, c)
-.DE
-Execution begins at the first statement following the
-.B entry
-line.
-All variable declarations must precede all executable statements in the procedure.
-If the procedure begins with a
-.B subroutine
-statement,
-all entry points are subroutine names.
-If it begins with a
-.B function
-statement, each entry is a function entry point,
-with type determined by the type declared for the entry name.
-If any entry is a character-valued function,
-then all entries must be.
-In a function, an entry name of the same type as that where control entered
-must be assigned a value.
-Arguments do not retain their values between calls.
-(The ancient trick of calling one entry point with a large number of arguments
-to cause the procedure to ``remember'' the locations of those arguments,
-then invoking an entry with just a few arguments for later calculation,
-is still illegal.
-Furthermore, the trick doesn't work in our implementation,
-since arguments are not kept in static storage.)
-.NH 2
-DO Loops
-.IP
-.B do
-variables and range parameters may now be of integer, real, or double precision types.
-(The use of floating point
-.B do
-variables is very dangerous
-because of the possibility of unexpected roundoff,
-and we strongly recommend against their use).
-The action of the
-.B do
-statement is now defined for all values of the
-.B do
-parameters.
-The statement
-.DS
-do 10 i = l, u, d
-.DE
-performs
-$ max (0^,^ left floor ( u - l ) / d^ right floor )$
-iterations.
-The
-.B do
-variable has a predictable value when exiting a loop:
-the value at the time a
-.B goto
-or
-.B return
-terminates the loop;
-otherwise
-the value that failed the limit test.
-.NH 2
-Alternate Returns
-.IP
-In a
-.B subroutine
-or subroutine
-.B entry
-statement,
-some of the arguments may be noted by an asterisk, as in
-.DS
-subroutine s(a, \(**, b, \(**)
-.DE
-The meaning of the ``alternate returns'' is described in section 5.2 of the Appendix.
-.NH 1
-Declarations
-.NH 2
-CHARACTER Data Type
-.IP
-One of the biggest improvements to the language is the addition of a character-string data type.
-Local and
-common character variables must have a length denoted by a constant expression:
-.DS
-character\(**17 a, b(3,4)
-character\(**(6+3) c
-.DE
-If the length is omitted entirely, it is assumed equal to 1.
-A character string argument may have a constant length,
-or the length may be declared to be the same as that of the corresponding actual argument at run time
-by a statement like
-.DS
-character\(**(\(**) a
-.DE
-(There is an intrinsic function
-.B len
-that returns the actual length of a character string).
-Character arrays and common blocks containing character variables must be packed:
-in an array of character variables, the first character of one element must follow the last character of
-the preceding element, without holes.
-.NH 2
-IMPLICIT Statement
-.IP
-The traditional implied declaration rules still hold:
-a variable whose name begins with
-\fBi, j, k, l, m,\fR or \fBn\fR is of type
-.B integer,
-other variables are of type
-.B real,
-unless otherwise declared.
-This general rule may be overridden with an
-.B implicit
-statement:
-.DS
-implicit real(a-c,g), complex(w-z), character\(**(17) (s)
-.DE
-declares that variables whose name begins with an
-\fBa ,b, c,\fR
-or
-\fBg\fR
-are
-.B real,
-those beginning with
-\fBw, x, y,\fR
-or
-\fBz\fR
-are assumed
-.B complex,
-and so on.
-It is still poor practice to depend on implicit typing, but this statement is an industry standard.
-.NH 2
-PARAMETER Statement
-.IP
-It is now possible to give a constant a symbolic name, as in
-.DS
-parameter (x=17, y=x/3, pi=3.14159d0, s=\(fmhello\(fm)
-.DE
-The type of each parameter name is governed by the same implicit and explicit rules as for a variable.
-The right side of each equal sign must be a constant expression
-(an expression made up of constants, operators, and already defined parameters).
-.NH 2
-Array Declarations
-.IP
-Arrays may now have as many as seven dimensions.
-(Only three were permitted in 1966).
-The lower bound of each dimension may be declared
-to be other than 1 by
-using a colon.
-Furthermore, an adjustable array bound may be an integer expression involving constants,
-arguments, and variables in
-.B common.
-.DS
-real a(\(mi5:3, 7, m:n), b(n+1:2\(**n)
-.DE
-The upper bound on the last dimension of an array argument may be denoted by an asterisk
-to indicate that the upper bound is not specified:
-.DS
-integer a(5, \(**),  b(\(**), c(0:1, \(mi2:\(**)
-.DE
-.NH 2
-SAVE Statement
-.IP
-A poorly known rule of Fortran 66 is that local variables in a procedure do not necessarily retain their values between
-invocations of that procedure.
-At any instant in the execution of a program,
-if a common block is declared neither in the currently executing procedure
-nor in any of the procedures in the chain of callers,
-all of the variables in that common block also become undefined.
-(The only exceptions are variables that have been defined in a
-.B data
-statement and never changed).
-These rules permit overlay and stack implementations for the affected variables.
-Fortran 77 permits one to specify that certain variables and common blocks are to retain their
-values between invocations.
-The declaration
-.DS
-save a, /b/, c
-.DE
-leaves the values of the variables
-.B a
-and
-.B c
-and all of the contents of common block
-.B b
-unaffected by a return.
-The simple declaration
-.DS
-save
-.DE
-has this effect on all variables and common blocks in the procedure.
-A common block must be \fBsave\fRd in every procedure in which it is declared if the desired effect is to occur.
-.NH 2
-INTRINSIC Statement
-.IP
-All of the functions specified in the Standard are in a single category,
-``intrinsic functions'', rather than being divided into ``intrinsic'' and ``basic external'' functions.
-If an intrinsic function is to be passed to another procedure, it must be declared
-.B intrinsic.
-Declaring it
-.B external
-(as in Fortran 66) causes a function other than the built-in one to be passed.
-.NH 1
-Expressions
-.NH 2
-Character Constants
-.IP
-Character string constants are marked by strings surrounded by apostrophes.
-If an apostrophe is to be included in a constant, it is repeated:
-.DS
- \(fmabc\(fm
- \(fmain\(fm\(fmt\(fm
-.DE
-There are no null (zero-length) character strings in Fortran 77.
-Our compiler has two different quotation marks, `` \(fm ''' and `` " ''.
-(See Section 2.9 in the main text.)
-.NH 2
-Concatenation
-.IP
-One new operator has been added, character string concatenation, marked by a double slash
-(``//'').
-The result of a concatenation is the string containing the characters of the left operand followed by the characters of
-the right operand.
-The strings
-.DS
- \(fmab\(fm // \(fmcd\(fm
- \(fmabcd\(fm
-.DE
-are equal.
-The strings being concatenated must be of constant length in all concatenations
-that are not the right sides of assignments.
-(The only concatenation expressions in which a
-character string declared adjustable with a ``\(**(\(**)'' modifier
-or a substring denotation with nonconstant position values may appear
-are the right sides of assignments).
-.NH 2
-Character String Assignment
-.IP
-The left and right sides of a character assignment may not share storage.
-(The assumed implementation of character assignment is to copy characters from the right to the left side.)
-If the left side is longer than the right, it is padded with blanks.
-If the left side is shorter than the right, trailing characters are discarded.
-.NH 2
-Substrings
-.IP
-It is possible to extract a substring of a character variable or character array element, using the colon notation:
-.DS
-a(i,\|j) (m:n)
-.DE
-is the string of $(n-m+1)$ characters beginning at the
-$m sup th$ character of the character array element $a sub ij$.
-Results are undefined unless $m<=n$.
-Substrings may be used on the left sides of assignments and as procedure actual arguments.
-.NH 2
-Exponentiation
-.IP
-It is now permissible to raise real quantities to complex powers,
-or complex quantities to real or complex powers.
-(The principal part of the logarithm is used).
-Also, multiple exponentiation is now defined:
-.DS
-a\(**\(**b\(**\(**c = a \(**\(** (b\(**\(**c)
-.DE
-.NH 2
-Relaxation of Restrictions
-.IP
-Mixed mode expressions are now permitted.
-(For instance,
-it is permissible to combine integer and complex quantities in an expression.)
-.IP
-Constant expressions are permitted where a constant is allowed,
-except in
-.B data
-statements.
-(A constant expression is made up of explicit constants and
-\fBparameter\fRs
-and the Fortran operators,
-except for exponentiation to a floating-point power).
-An adjustable dimension may now be an integer expression involving constants,
-arguments, and variables in
-B common..
-.IP
-Subscripts may now be general integer expressions;
-the old
-$c v +- c'$
-rules have been removed.
-.B do
-loop bounds may be general integer, real, or double precision expressions.
-Computed
-.B goto
-expressions and I/O unit numbers may be general integer expressions.
-.NH 1
-Executable Statements
-.NH 2
-IF-THEN-ELSE
-.IP
-At last, the
-if-then-else
-branching structure has been added to Fortran.
-It is called a ``Block If''.
-A Block If begins with a statement of the form
-.DS
-if ( . . . ) then
-.DE
-and ends with an
-.DS
-end if
-.DE
-statement.
-Two other new statements may appear in a Block If.
-There may be several
-.DS
-else if(. . .) then
-.DE
-statements,
-followed by at most one
-.DS
-else
-.DE
-statement.
-If the logical expression in the Block If statement is true, the statements following it up to the
-next
-.B elseif,
-.B else,
-or
-.B endif
-are executed.
-Otherwise, the next
-.B elseif
-statement in the group is executed.
-If none of the
-.B elseif
-conditions are true, control passes to the statements following the
-.B else
-statement, if any.
-(The
-.B else
-must follow all \fBelseif\fRs in a Block If.
-Of course, there may be Block Ifs embedded inside of other Block If structures).
-A
-case
-construct may be rendered
-.DS
-if (s .eq. \(fmab\(fm) then
- . . .
-else if (s .eq. \(fmcd\(fm) then
- . . .
-else
- . . .
-end if
-.DE
-.NH 2
-Alternate Returns
-.IP
-Some of the arguments of a subroutine call may be statement labels preceded by an asterisk, as in
-.DS
-call joe(j, \(**10, m, \(**2)
-.DE
-A
-.B return
-statement may have an integer expression, such as
-.DS
-return k
-.DE
-If the entry point has
-$n$
-alternate return (asterisk) arguments
-and if $1<=k<=n$, the return is followed by a branch to the corresponding statement label;
-otherwise the usual return to the statement following the
-.B call
-is executed.
-.NH 1
-Input/Output
-.NH 2
-Format Variables
-.IP
-A format may be the value of a character expression (constant or otherwise),
-or be stored in a character array, as in
-.DS
-write(6, \(fm(i5)\(fm) x
-.DE
-.NH 2
-END=, ERR=, and IOSTAT= Clauses
-.IP
-A
-.B read
-or
-.B write
-statement may contain
-.B end=,
-.B err=,
-and
-.B iostat=
-clauses, as in
-.DS
-write(6, 101, err=20, iostat=a(4))
-read(5, 101, err=20, end=30, iostat=x)
-.DE
-Here 5 and 6 are the
-.I units
-on which the I/O is done,
-101 is the statement number of the associated format,
-20 and 30 are statement numbers,
-and
-.B a
-and
-.B x
-are integers.
-If an error occurs during I/O,
-control returns to the program at statement 20.
-If the end of the file is reached,
-control returns to the program at statement 30.
-In any case, the variable referred to in
-the
-.B iostat=
-clause is given a value when
-the I/O statement finishes.
-(Yes, the value is assigned to the name on the right side of the equal sign.)
-This value is zero if all went well,
-negative for end of file,
-and some positive value for errors.
-.NH 2
-Formatted I/O
-.NH 3
-Character Constants
-.IP
-Character constants in formats are copied literally to the output.
-Character constants cannot be read into.
-.DS
-write(6,\(fm(i2,\(fm\(fm isn\(fm\(fm\(fm\(fmt \(fm\(fm,i1)\(fm) 7, 4
-.DE
-produces
-.DS
- 7 isn\(fmt 4
-.DE
-Here the format is the character constant
-.DS
-(i2,\(fm isn\(fm\(fmt \(fm,i1)
-.DE
-and the character constant
-.DS
- isn\(fmt
-.DE
-is copied into the output.
-.NH 3
-Positional Editing Codes
-.IP
-.B t,
-.B tl,
-.B tr,
-and
-.B x
-codes
-control where the
-next character is in the record.
-\fBtr\fIn\fR
-or
-\fIn\fBx\fR
-specifies that the next character is
-$n$ to the right of the current position.
-\fBtl\fIn\fR
-specifies that the next character is
-$n$ to the left of the current position,
-allowing parts of the record to be reconsidered.
-\fBt\fIn\fR
-says that the next character is to be character
-number $n$ in the record.
-(See section 3.4 in the main text.)
-.NH 3
-Colon
-.IP
-A colon in the format terminates the I/O operation
-if there are no more data items in the I/O list,
-otherwise it has no effect.
-In the fragment
-.DS
-x=\(fm("hello", :, " there", i4)\(fm
-write(6, x) 12
-write(6, x)
-.DE
-the first
-.B write
-statement prints
-\fBhello there 12\fR,
-while the second only prints
-\fBhello\fR.
-.NH 3
-Optional Plus Signs
-.IP
-According to the Standard,
-each implementation has the option of putting
-plus signs in front of non-negative
-numeric output.
-The
-.B sp
-format code may be used to make the optional plus
-signs actually appear for all subsequent items
-while the format is active.
-The
-.B ss
-format code guarantees that the I/O system will not
-insert the optional plus signs,
-and the
-.B s
-format code restores the default behavior of
-the I/O system.
-(Since we never put out optional plus signs,
-.B ss
-and
-.B s
-codes have the same effect in our implementation.)
-.NH 3
-Blanks on Input
-.IP
-Blanks in numeric input fields,
-other than leading blanks
-will be ignored following a
-.B bn
-code in a format
-statement,
-and will be treated as zeros following a
-.B bz
-code in a format statement.
-The default for a unit may be changed by using
-the
-.B open
-statement.
-(Blanks are ignored by default.)
-.NH 3
-Unrepresentable Values
-.IP
-The Standard requires that if a numeric item
-cannot be represented in the form required by a format code,
-the output field must be filled with asterisks.
-(We think this should have been an option.)
-.NH 3
-Iw.m
-.IP
-There is a new integer output code,
-\fBi\fIw.m.\fR
-It is the same as
-\fBi\fIw\fR,
-except that there will be at least $m$
-digits in the output field,
-including,
-if necessary,
-leading zeros.
-The case \fBi\fR$w.0$ is special,
-in that if the value being printed is 0,
-the output field is
-entirely blank.
-\fBi\fIw\fB.1\fR
-is the same as
-\fBi\fIw\fR.
-.NH 3
-Floating Point
-.IP
-On input, exponents may start with the letter
-\fBE, D, e, \fRor \fBd.\fR
-All have the same meaning.
-On output we always use \fBe\fR.
-The
-.B e
-and
-.B d
-format codes also have identical meanings.
-A leading zero before the decimal point in
-.B e
-output
-without a scale factor is optional with the
-implementation.
-(We do not print it.)
-There is a
-\fBg\fIw.d\fR
-format code which is the same as
-\fBe\fIw.d\fR
-and
-\fBf\fIw.d\fR
-on input,
-but which chooses
-.B f
-or
-.B e
-formats for output depending.
-on the size of the number and of $d$.
-.NH 3
-``A'' Format Code
-.IP
-A codes are used for character values.
-\fBa\fIw\fR
-use a field width of $w$,
-while a plain
-.B a
-uses the length of the character item.
-.NH 2
-Standard Units
-.IP
-There are default formatted input and output units.
-The statement
-.DS
-read 10, a, b
-.DE
-reads from the standard unit using format statement 10.
-The default unit may be explicitly specified by an asterisk, as in
-.DS
-read(\(**, 10) a,b
-.DE
-Similarly, the standard output units is specified by a
-.B print
-statement or an asterisk unit:
-.DS
-print 10
-write(\(**, 10)
-.DE
-.NH 2
-List-Directed Formatting
-.IP
-List-directed I/O is a
-kind of free form input for sequential I/O.
-It is invoked by using an asterisk as the
-format identifier, as in
-.DS
-read(6, \(**) a,b,c
-.DE
-.IP
-On input,
-values are separated by strings of blanks
-and possibly a comma.
-Values,
-except for character strings,
-cannot contain blanks.
-End of record counts as a blank,
-except in character strings,
-where it is ignored.
-Complex constants are given as two real constants
-separated by a comma and enclosed in parentheses.
-A null input field,
-such as between two consecutive commas,
-means the corresponding variable in the
-I/O list is not changed.
-Values may be preceded by repetition counts,
-as in
-.DS
-4\(**(3.,2.)  2\(**, 4\(**\(fmhello\(fm
-.DE
-which stands for 4 complex constants, 2 null values,
-and 4 string constants.
-.IP
-For output, suitable formats are chosen for
-each item.
-The values of character strings are printed;
-they are not enclosed in quotes, so they cannot be read back
-using list-directed input.
-.NH 2
-Direct I/O
-.IP
-A file connected for direct access consists of
-a set of equal-sized records each of which is
-uniquely identified by a positive integer.
-The records may be written or read in any order,
-using direct access I/O statements.
-.IP
-Direct access
-.B read
-and
-.B write
-statements
-have an extra argument,
-.B rec=,
-which gives the record number to be read or written.
-.DS
-read(2, rec=13, err=20) (a(i), i=1, 203)
-.DE
-reads the thirteenth record into the array
-.B a.
-.IP
-The size of the records must be given by an
-.B open
-statement
-(see below).
-Direct access files may be connected for either formatted
-or unformatted I/O.
-.NH 2
-Internal Files
-.IP
-Internal files are character string objects,
-such as variables or substrings,
-or arrays of type character.
-In the former cases there is only a single record
-in the file,
-in the latter case each array element is a record.
-The Standard includes only sequential
-formatted I/O on internal files.
-(I/O is not a very precise term to use here,
-but internal files are dealt with using
-.B read
-and
-.B write).
-There is no list-directed I/O on internal files.
-Internal files are used by giving the name of the
-character object in place of the unit number, as in
-.DS
-character\(**80 x
-read(5,"(a)") x
-read(x,"(i3,i4)") n1,n2
-.DE
-which reads a card image into
-.B x
-and then reads
-two integers from the front of it.
-A sequential
-.B read
-or
-.B write
-always starts at the beginning
-of an internal file.
-.IP
-(We also support a compatible extension, direct I/O on internal files.
-This is like direct I/O on external files,
-except that the number of records in the file cannot be
-changed.)
-.NH 2
-OPEN, CLOSE, and INQUIRE Statements
-.IP
-These statements are used to connect and disconnect
-units and files,
-and to gather information about units and files.
-.NH 3
-OPEN
-.IP
-The
-.B open
-statement is used to connect a file with a
-unit,
-or to alter some properties of the connection.
-The following is a minimal example.
-.DS
-open(1, file=\(fmfort.junk\(fm)
-.DE
-.B open
-takes a variety of arguments with meanings described below.
-.RS
-.      \" macros here
-.de HP
-.RT
-.if !\\(IP .nr IP +1
-.sp \\n(PDu
-.ne 3v
-.in +\\n(PIu
-.ti -\\n(PIu
-\fB\\$1\fR\ \c
-..
-.de P1
-.KS
-.nf
-.in +.3i
-.ta .3i .6i .9i 1.2i 1.5i 1.8i
-.sp
-..
-.de P2
-.fi
-.in -.3i
-.sp
-.KE
-..
-.de TH
-.RT
-.sp \\n(PDu
-.ne 3v
-\fB\\$1\\$2\\$3\\$4\\$5\\$6\fR\ \c
-..
-.      \" end of macros
-.HP unit=
-a small non-negative integer which is the unit to
-which the file is to be connected.
-We allow,
-at the time of this writing,
-0 through 9.
-If this parameter is the first one in the
-.B open
-statement,
-the
-.B unit=
-can be omitted.
-.HP iostat=
-is the same as in
-.B read
-or
-.B write.
-.HP err=
-is the same as in
-.B read
-or
-.B write.
-.HP file=
-a character expression,
-which when stripped of trailing blanks,
-is the name of the file to be connected to the unit.
-The filename should not be given if the
-.B status=scratch.
-.HP status=
-one of
-.B old,
-.B new,
-.B scratch,
-or
-.B unknown.
-If this parameter is not given,
-.B unknown
-is assumed.
-If
-.B scratch
-is given,
-a temporary file will be created.
-Temporary files are destroyed at the end of execution.
-If
-.B new
-is given,
-the file will be created if it doesn't exist,
-or truncated if it does.
-The meaning of
-.B unknown
-is processor dependent;
-our system treats it as synonymous with
-.B old.
-.HP access=
-.B sequential
-or
-.B direct,
-depending on whether the file is
-to be opened for sequential or direct I/O.
-.HP form=
-.B formatted
-or
-.B unformatted.
-.HP recl=
-a positive integer specifying the record length of
-the direct access file being opened.
-We measure all record lengths in bytes.
-On
-.UX
-systems a record length of 1 has the special meaning explained
-in section 5.1 of the text.
-.HP blank=
-.B null
-or
-.B zero.
-This parameter has meaning only for formatted I/O.
-The default value is
-.B null.
-.B zero
-means that blanks,
-other than leading blanks,
-in numeric input fields are to be treated as zeros.
-.RE
-.IP
-Opening a new file on a unit which is already connected
-has the effect of first closing the old file.
-.NH 3
-CLOSE
-.IP
-.B close
-severs the connection between a unit and a file.
-The unit number must be given.
-The optional parameters are
-.B iostat=
-and
-.B err=
-with
-their usual meanings,
-and
-.B status=
-either
-.B keep
-or
-.B delete.
-Scratch files cannot be kept,
-otherwise
-.B keep
-is the default.
-.B delete
-means the file will be removed.
-A simple example is
-.DS
-close(3, err=17)
-.DE
-.NH 3
-INQUIRE
-.IP
-The
-.B inquire
-statement gives information about
-a unit
-(``inquire by unit'')
-or a file (``inquire by file'').
-Simple examples are:
-.DS
-inquire(unit=3, namexx)
-inquire(file=\(fmjunk\(fm, number=n, exist=l)
-.DE
-.RS
-.HP file=
-a character variable specifies the file the
-.B inquire
-is about.
-Trailing blanks in the file name are ignored.
-.HP unit=
-an integer variable specifies the unit the
-.B inquire
-is about.
-Exactly one of
-.B file=
-or
-.B unit=
-must be used.
-.HP "iostat=, err="
-are as before.
-.HP exist=
-a logical variable.
-The logical variable is set to
-.B ".true."
-if the file or unit
-exists and is set to
-.B ".false."
-otherwise.
-.HP opened=
-a logical variable.
-The logical variable is set to
-.B ".true."
-if the file
-is connected to a unit or if the unit is connected
-to a file,
-and it is set to
-.B ".false."
-otherwise.
-.HP number=
-an integer variable to which is assigned the
-number of the unit connected to the file,
-if any.
-.HP named=
-a logical variable to which is assigned
-.B ".true."
-if
-the file has a name,
-or
-.B ".false."
-otherwise.
-.HP name=
-a character variable to which is assigned the name
-of the file (inquire by file) or the name of the
-file connected to the unit (inquire by unit).
-The name will be the full name of the file.
-.HP access=
-a character variable to which will be assigned
-the value
-.B \(fmsequential\(fm
-if the connection is for
-sequential I/O,
-.B \(fmdirect\(fm
-if the connection is for direct I/O.
-The value becomes undefined if there is no connection.
-.HP sequential=
-a character variable to which is assigned the
-value
-.B \(fmyes\(fm
-if the file could be connected for
-sequential I/O,
-.B \(fmno\(fm
-if the file could not be connected for sequential I/O,
-and
-.B \(fmunknown\(fm
-if we can't tell.
-.HP direct=
-a character variable to which is assigned the value
-.B \(fmyes\(fm
-if the file could be connected for direct I/O,
-.B\(fmno\(fm
-if the file could not be connected for direct
-I/O,
-and
-.B \(fmunknown\(fm
-if we can't tell.
-.HP form=
-a character variable to which is assigned the value
-.B \(fmformatted\(fm
-if the file is connected for formatted I/O,
-or
-.B \(fmunformatted\(fm
-if the file is connected for unformatted
-I/O.
-.HP formatted=
-a character variable to which is assigned the value
-.B \(fmyes\(fm
-if the file could be connected for formatted I/O,
-.B \(fmno\(fm
-if the file could not be connected for formatted I/O,
-and
-.B \(fmunknown\(fm
-if we can't tell.
-.HP unformatted=
-a character variable to which is assigned the value
-.B \(fmyes\(fm
-if
-the file could be connected for unformatted I/O,
-.B \(fmno\(fm
-if the file could not be connected for unformatted I/O,
-and
-.B \(fmunknown\(fm
-if we can't tell.
-.HP recl=
-an integer variable to which is assigned the record length
-of the records in the file if the file is connected
-for direct access.
-.HP nextrec=
-an integer variable to which is assigned one more
-than the number of the the last record read from a file connected
-for direct access.
-.HP blank=
-a character variable to which is assigned the value
-.B \(fmnull\(fm
-if null blank control is in effect for the file
-connected for formatted I/O,
-.B \(fmzero\(fm
-if blanks are being converted to zeros and
-the file is connected for formatted I/O.
-.RE
-.PP
-.I "The gentle reader"
-will remember that the people who wrote the standard
-probably weren't thinking of his needs.
-Here is an example.
-The declarations are omitted.
-.DS
-open(1, file="/dev/console")
-.DE
-On a
-.UX
-system this statement opens the console for formatted sequential
-I/O.
-An
-.B inquire
-statement for either unit 1 or file "/dev/console"
-would reveal that the file exists, is connected to unit 1,
-has a name, namely "/dev/console",
-is opened for sequential I/O,
-could be connected for sequential I/O,
-could not be connected for direct I/O (can't seek),
-is connected for formatted I/O,
-could be connected for formatted I/O,
-could not be connected for unformatted I/O
-(can't seek),
-has neither a record length nor a next record number,
-and is ignoring blanks in numeric fields.
-.PP
-In the
-.UX
-system environment,
-the only way to discover what permissions you have
-for a file is to open it and try to read and write it.
-The
-.B err=
-parameter will return system error numbers.
-The
-.B inquire
-statement does not give a way of determining permissions.
diff --git a/.ref-Research-V7/usr/doc/implement b/.ref-Research-V7/usr/doc/implement
deleted file mode 100644 (file)
index e7f128e..0000000
+++ /dev/null
@@ -1,1231 +0,0 @@
-.de P1
-.DS
-..
-.de P2
-.DE
-..
-.de UL
-.lg 0
-.if n .ul
-\%\&\\$3\f3\\$1\fR\&\\$2
-.lg
-..
-.de UC
-\&\\$3\s-1\\$1\\s0\&\\$2
-..
-.de IT
-.lg 0
-.if n .ul
-\%\&\\$3\f2\\$1\fR\&\\$2
-.lg
-..
-.de SP
-.sp \\$1
-..
-.hw device
-.TL
-UNIX Implementation
-.AU "MH 2C-523" 2394
-K. Thompson
-.AI
-.MH
-.AB
-This paper describes in high-level terms the
-implementation of the resident
-.UX
-kernel.
-This discussion is broken into three parts.
-The first part describes
-how the
-.UX
-system views processes, users, and programs.
-The second part describes the I/O system.
-The last part describes the
-.UX
-file system.
-.AE
-.NH
-INTRODUCTION
-.PP
-The
-.UX
-kernel consists of about 10,000
-lines of C code and about 1,000 lines of assembly code.
-The assembly code can be further broken down into
-200 lines included for
-the sake of efficiency
-(they could have been written in C)
-and 800 lines to perform hardware
-functions not possible in C.
-.PP
-This code represents 5 to 10 percent of what has
-been lumped into the broad expression
-``the
-.UX
-operating system.''
-The kernel is the only
-.UX
-code that
-cannot be substituted by a user to his
-own liking.
-For this reason,
-the kernel should make as few real
-decisions as possible.
-This does not mean to allow the user
-a million options to do the same thing.
-Rather, it means to allow only one way to
-do one thing,
-but have that way be the least-common divisor
-of all the options that might have been provided.
-.PP
-What is or is not implemented in the kernel
-represents both a great responsibility and a great power.
-It is a soap-box platform on
-``the way things should be done.''
-Even so, if
-``the way'' is too radical,
-no one will follow it.
-Every important decision was weighed
-carefully.
-Throughout,
-simplicity has been substituted for efficiency.
-Complex algorithms are used only if
-their complexity can be localized.
-.NH
-PROCESS CONTROL
-.PP
-In the
-.UX
-system,
-a user executes programs in an
-environment called a user process.
-When a system function is required,
-the user process calls the system
-as a subroutine.
-At some point in this call,
-there is a distinct switch of environments.
-After this,
-the process is said to be a system process.
-In the normal definition of processes,
-the user and system processes are different
-phases of the same process
-(they never execute simultaneously).
-For protection,
-each system process has its own stack.
-.PP
-The user process may execute
-from a read-only text segment,
-which is shared by all processes
-executing the same code.
-There is no
-.IT functional
-benefit
-from shared-text segments.
-An
-.IT efficiency
-benefit comes from the fact
-that there is no need to swap read-only
-segments out because the original
-copy on secondary memory is still current.
-This is a great benefit to interactive
-programs that tend to be swapped while
-waiting for terminal input.
-Furthermore,
-if two processes are
-executing
-simultaneously
-from the same copy of a read-only segment,
-only one copy needs to reside in
-primary memory.
-This is a secondary effect,
-because
-simultaneous execution of a program
-is not common.
-It is ironic that this effect,
-which reduces the use of primary memory,
-only comes into play when there is
-an overabundance of primary memory,
-that is,
-when there is enough memory
-to keep waiting processes loaded.
-.PP
-All current read-only text segments in the
-system are maintained from the
-.IT "text table" .
-A text table entry holds the location of the
-text segment on secondary memory.
-If the segment is loaded,
-that table also holds the primary memory location
-and the count of the number of processes
-sharing this entry.
-When this count is reduced to zero,
-the entry is freed along with any
-primary and secondary memory holding the segment.
-When a process first executes a shared-text segment,
-a text table entry is allocated and the
-segment is loaded onto secondary memory.
-If a second process executes a text segment
-that is already allocated,
-the entry reference count is simply incremented.
-.PP
-A user process has some strictly private
-read-write data
-contained in its
-data segment.
-As far as possible,
-the system does not use the user's
-data segment to hold system data.
-In particular,
-there are no I/O buffers in the
-user address space.
-.PP
-The user data segment has two growing boundaries.
-One, increased automatically by the system
-as a result of memory faults,
-is used for a stack.
-The second boundary is only grown (or shrunk) by
-explicit requests.
-The contents of newly allocated primary memory
-is initialized to zero.
-.PP
-Also associated and swapped with
-a process is a small fixed-size
-system data segment.
-This segment contains all
-the data about the process
-that the system needs only when the
-process is active.
-Examples of the kind of data contained
-in the system data segment are:
-saved central processor registers,
-open file descriptors,
-accounting information,
-scratch data area,
-and the stack for the system phase
-of the process.
-The system data segment is not
-addressable from the user process
-and is therefore protected.
-.PP
-Last,
-there is a process table with
-one entry per process.
-This entry contains all the data
-needed by the system when the process
-is
-.IT not
-active.
-Examples are
-the process's name,
-the location of the other segments,
-and scheduling information.
-The process table entry is allocated
-when the process is created, and freed
-when the process terminates.
-This process entry is always directly
-addressable by the kernel.
-.PP
-Figure 1 shows the relationships
-between the various process control
-data.
-In a sense,
-the process table is the
-definition of all processes,
-because
-all the data associated with a process
-may be accessed
-starting from the process table entry.
-.KS
-.sp 2.44i
-.sp 2v
-.ce
-Fig. 1\(emProcess control data structure.
-.KE
-.NH 2
-Process creation and program execution
-.PP
-Processes are created by the system primitive
-.UL fork .
-The newly created process (child) is a copy of the original process (parent).
-There is no detectable sharing of primary memory between the two processes.
-(Of course,
-if the parent process was executing from a read-only
-text segment,
-the child will share the text segment.)
-Copies of all writable data segments
-are made for the child process.
-Files that were open before the
-.UL fork
-are
-truly shared after the
-.UL fork .
-The processes are informed as to their part in the
-relationship to
-allow them to select their own
-(usually non-identical)
-destiny.
-The parent may
-.UL wait
-for the termination of
-any of its children.
-.PP
-A process may
-.UL exec
-a file.
-This consists of exchanging the current text and data
-segments of the process for new text and data
-segments specified in the file.
-The old segments are lost.
-Doing an
-.UL exec
-does
-.IT not
-change processes;
-the process that did the
-.UL exec
-persists,
-but
-after the
-.UL exec
-it is executing a different program.
-Files that were open
-before the
-.UL exec
-remain open after the
-.UL exec .
-.PP
-If a program,
-say the first pass of a compiler,
-wishes to overlay itself with another program,
-say the second pass,
-then it simply
-.UL exec s
-the second program.
-This is analogous
-to a ``goto.''
-If a program wishes to regain control
-after
-.UL exec ing
-a second program,
-it should
-.UL fork
-a child process,
-have the child
-.UL exec
-the second program, and
-have the parent
-.UL wait
-for the child.
-This is analogous to a ``call.''
-Breaking up the call into a binding followed by
-a transfer is similar to the subroutine linkage in
-SL-5.
-.[
-griswold hanson sl5 overview
-.]
-.NH 2
-Swapping
-.PP
-The major data associated with a process
-(the user data segment,
-the system data segment, and
-the text segment)
-are swapped to and from secondary
-memory, as needed.
-The user data segment and the system data segment
-are kept in contiguous primary memory to reduce
-swapping latency.
-(When low-latency devices, such as bubbles,
-.UC CCD s,
-or scatter/gather devices,
-are used,
-this decision will have to be reconsidered.)
-Allocation of both primary
-and secondary memory is performed
-by the same simple first-fit algorithm.
-When a process grows,
-a new piece of primary memory is allocated.
-The contents of the old memory is copied to the new memory.
-The old memory is freed
-and the tables are updated.
-If there is not enough primary memory,
-secondary memory is allocated instead.
-The process is swapped out onto the
-secondary memory,
-ready to be swapped in with
-its new size.
-.PP
-One separate process in the kernel,
-the swapping process,
-simply swaps the other
-processes in and out of primary memory.
-It examines the
-process table looking for a process
-that is swapped out and is
-ready to run.
-It allocates primary memory for that
-process and
-reads its segments into
-primary memory, where that process competes for the
-central processor with other loaded processes.
-If no primary memory is available,
-the swapping process makes memory available
-by examining the process table for processes
-that can be swapped out.
-It selects a process to swap out,
-writes it to secondary memory,
-frees the primary memory,
-and then goes back to look for a process
-to swap in.
-.PP
-Thus there are two specific algorithms
-to the swapping process.
-Which of the possibly many processes that
-are swapped out is to be swapped in?
-This is decided by secondary storage residence
-time.
-The one with the longest time out is swapped in first.
-There is a slight penalty for larger processes.
-Which of the possibly many processes that
-are loaded is to be swapped out?
-Processes that are waiting for slow events
-(i.e., not currently running or waiting for
-disk I/O)
-are picked first,
-by age in primary memory,
-again with size penalties.
-The other processes are examined
-by the same age algorithm,
-but are not taken out unless they are
-at least of some age.
-This adds
-hysteresis to the swapping and
-prevents total thrashing.
-.PP
-These swapping algorithms are the
-most suspect in the system.
-With limited primary memory,
-these algorithms cause total swapping.
-This is not bad in itself, because
-the swapping does not impact the
-execution of the resident processes.
-However, if the swapping device must
-also be used for file storage,
-the swapping traffic severely
-impacts the file system traffic.
-It is exactly these small systems
-that tend to double usage of limited disk
-resources.
-.NH 2
-Synchronization and scheduling
-.PP
-Process synchronization is accomplished by having processes
-wait for events.
-Events are represented by arbitrary integers.
-By convention,
-events are chosen to be addresses of
-tables associated with those events.
-For example, a process that is waiting for
-any of its children to terminate will wait
-for an event that is the address of
-its own process table entry.
-When a process terminates,
-it signals the event represented by
-its parent's process table entry.
-Signaling an event on which no process
-is waiting has no effect.
-Similarly,
-signaling an event on which many processes
-are waiting will wake all of them up.
-This differs considerably from
-Dijkstra's P and V
-synchronization operations,
-.[
-dijkstra sequential processes 1968
-.]
-in that
-no memory is associated with events.
-Thus there need be no allocation of events
-prior to their use.
-Events exist simply by being used.
-.PP
-On the negative side,
-because there is no memory associated with events,
-no notion of ``how much''
-can be signaled via the event mechanism.
-For example,
-processes that want memory might
-wait on an event associated with
-memory allocation.
-When any amount of memory becomes available,
-the event would be signaled.
-All the competing processes would then wake
-up to fight over the new memory.
-(In reality,
-the swapping process is the only process
-that waits for primary memory to become available.)
-.PP
-If an event occurs
-between the time a process decides
-to wait for that event and the
-time that process enters the wait state,
-then
-the process will wait on an event that has
-already happened (and may never happen again).
-This race condition happens because there is no memory associated with
-the event to indicate that the event has occurred;
-the only action of an event is to change a set of processes
-from wait state to run state.
-This problem is relieved largely
-by the fact that process switching can
-only occur in the kernel by explicit calls
-to the event-wait mechanism.
-If the event in question is signaled by another
-process,
-then there is no problem.
-But if the event is signaled by a hardware
-interrupt,
-then special care must be taken.
-These synchronization races pose the biggest
-problem when
-.UX
-is adapted to multiple-processor configurations.
-.[
-hawley meyer multiprocessing unix
-.]
-.PP
-The event-wait code in the kernel
-is like a co-routine linkage.
-At any time,
-all but one of the processes has called event-wait.
-The remaining process is the one currently executing.
-When it calls event-wait,
-a process whose event has been signaled
-is selected and that process
-returns from its call to event-wait.
-.PP
-Which of the runable processes is to run next?
-Associated with each process is a priority.
-The priority of a system process is assigned by the code
-issuing the wait on an event.
-This is roughly equivalent to the response
-that one would expect on such an event.
-Disk events have high priority,
-teletype events are low,
-and time-of-day events are very low.
-(From observation,
-the difference in system process priorities
-has little or no performance impact.)
-All user-process priorities are lower than the
-lowest system priority.
-User-process priorities are assigned
-by an algorithm based on the
-recent ratio of the amount of compute time to real time consumed
-by the process.
-A process that has used a lot of
-compute time in the last real-time
-unit is assigned a low user priority.
-Because interactive processes are characterized
-by low ratios of compute to real time,
-interactive response is maintained without any
-special arrangements.
-.PP
-The scheduling algorithm simply picks
-the process with the highest priority,
-thus
-picking all system processes first and
-user processes second.
-The compute-to-real-time ratio is updated
-every second.
-Thus,
-all other things being equal,
-looping user processes will be
-scheduled round-robin with a
-1-second quantum.
-A high-priority process waking up will
-preempt a running, low-priority process.
-The scheduling algorithm has a very desirable
-negative feedback character.
-If a process uses its high priority
-to hog the computer,
-its priority will drop.
-At the same time, if a low-priority
-process is ignored for a long time,
-its priority will rise.
-.NH
-I/O SYSTEM
-.PP
-The I/O system
-is broken into two completely separate systems:
-the block I/O system and the character I/O system.
-In retrospect,
-the names should have been ``structured I/O''
-and ``unstructured I/O,'' respectively;
-while the term ``block I/O'' has some meaning,
-``character I/O'' is a complete misnomer.
-.PP
-Devices are characterized by a major device number,
-a minor device number, and
-a class (block or character).
-For each class,
-there is an array of entry points into the device drivers.
-The major device number is used to index the array
-when calling the code for a particular device driver.
-The minor device number is passed to the
-device driver as an argument.
-The minor number has no significance other
-than that attributed to it by the driver.
-Usually,
-the driver uses the minor number to access
-one of several identical physical devices.
-.PP
-The use of the array of entry points
-(configuration table)
-as the only connection between the
-system code and the device drivers is
-very important.
-Early versions of the system had a much
-less formal connection with the drivers,
-so that it was extremely hard to handcraft
-differently configured systems.
-Now it is possible to create new
-device drivers in an average of a few hours.
-The configuration table in most cases
-is created automatically by a program
-that reads the system's parts list.
-.NH 2
-Block I/O system
-.PP
-The model block I/O device consists
-of randomly addressed, secondary
-memory blocks of 512 bytes each.
-The blocks are uniformly addressed
-0, 1, .\|.\|. up to the size of the device.
-The block device driver has the job of
-emulating this model on a
-physical device.
-.PP
-The block I/O devices are accessed
-through a layer of buffering software.
-The system maintains a list of buffers
-(typically between 10 and 70)
-each assigned a device name and
-a device address.
-This buffer pool constitutes a data cache
-for the block devices.
-On a read request,
-the cache is searched for the desired block.
-If the block is found,
-the data are made available to the
-requester without any physical I/O.
-If the block is not in the cache,
-the least recently used block in the cache is renamed,
-the correct device driver is called to
-fill up the renamed buffer, and then the
-data are made available.
-Write requests are handled in an analogous manner.
-The correct buffer is found
-and relabeled if necessary.
-The write is performed simply by marking
-the buffer as ``dirty.''
-The physical I/O is then deferred until
-the buffer is renamed.
-.PP
-The benefits in reduction of physical I/O
-of this scheme are substantial,
-especially considering the file system implementation.
-There are,
-however,
-some drawbacks.
-The asynchronous nature of the
-algorithm makes error reporting
-and meaningful user error handling
-almost impossible.
-The cavalier approach to I/O error
-handling in the
-.UX
-system is partly due to the asynchronous
-nature of the block I/O system.
-A second problem is in the delayed writes.
-If the system stops unexpectedly,
-it is almost certain that there is a
-lot of logically complete,
-but physically incomplete,
-I/O in the buffers.
-There is a system primitive to
-flush all outstanding I/O activity
-from the buffers.
-Periodic use of this primitive helps,
-but does not solve, the problem.
-Finally,
-the associativity in the buffers
-can alter the physical I/O sequence
-from that of the logical I/O sequence.
-This means that there are times
-when data structures on disk are inconsistent,
-even though the software is careful
-to perform I/O in the correct order.
-On non-random devices,
-notably magnetic tape,
-the inversions of writes can be disastrous.
-The problem with magnetic tapes is ``cured'' by
-allowing only one outstanding write request
-per drive.
-.NH 2
-Character I/O system
-.PP
-The character I/O system consists of all
-devices that do not fall into the block I/O model.
-This includes the ``classical'' character devices
-such as communications lines, paper tape, and
-line printers.
-It also includes magnetic tape and disks when
-they are not used in a stereotyped way,
-for example, 80-byte physical records on tape
-and track-at-a-time disk copies.
-In short,
-the character I/O interface
-means ``everything other than block.''
-I/O requests from the user are sent to the
-device driver essentially unaltered.
-The implementation of these requests is, of course,
-up to the device driver.
-There are guidelines and conventions
-to help the implementation of
-certain types of device drivers.
-.NH 3
-Disk drivers
-.PP
-Disk drivers are implemented
-with a queue of transaction records.
-Each record holds a read/write flag,
-a primary memory address,
-a secondary memory address, and
-a transfer byte count.
-Swapping is accomplished by passing
-such a record to the swapping device driver.
-The block I/O interface is implemented by
-passing such records with requests to
-fill and empty system buffers.
-The character I/O interface to the disk
-drivers create a transaction record that
-points directly into the user area.
-The routine that creates this record also insures
-that the user is not swapped during this
-I/O transaction.
-Thus by implementing the general disk driver,
-it is possible to use the disk
-as a block device,
-a character device, and a swap device.
-The only really disk-specific code in normal
-disk drivers is the pre-sort of transactions to
-minimize latency for a particular device, and
-the actual issuing of the I/O request.
-.NH 3
-Character lists
-.PP
-Real character-oriented devices may
-be implemented using the common
-code to handle character lists.
-A character list is a queue of characters.
-One routine puts a character on a queue.
-Another gets a character from a queue.
-It is also possible to ask how many
-characters are currently on a queue.
-Storage for all queues in the system comes
-from a single common pool.
-Putting a character on a queue will allocate
-space from the common pool and link the
-character onto the data structure defining the queue.
-Getting a character from a queue returns
-the corresponding space to the pool.
-.PP
-A typical character-output device
-(paper tape punch, for example)
-is implemented by passing characters
-from the user onto a character queue until
-some maximum number of characters is on the queue.
-The I/O is prodded to start as
-soon as there is anything on the queue
-and, once started,
-it is sustained by hardware completion interrupts.
-Each time there is a completion interrupt,
-the driver gets the next character from the queue
-and sends it to the hardware.
-The number of characters on the queue is checked and,
-as the count falls through some intermediate level,
-an event (the queue address) is signaled.
-The process that is passing characters from
-the user to the queue can be waiting on the event, and
-refill the queue to its maximum
-when the event occurs.
-.PP
-A typical character input device
-(for example, a paper tape reader)
-is handled in a very similar manner.
-.PP
-Another class of character devices is the terminals.
-A terminal is represented by three
-character queues.
-There are two input queues (raw and canonical)
-and an output queue.
-Characters going to the output of a terminal
-are handled by common code exactly as described
-above.
-The main difference is that there is also code
-to interpret the output stream as
-.UC  ASCII
-characters and to perform some translations,
-e.g., escapes for deficient terminals.
-Another common aspect of terminals is code
-to insert real-time delay after certain control characters.
-.PP
-Input on terminals is a little different.
-Characters are collected from the terminal and
-placed on a raw input queue.
-Some device-dependent code conversion and
-escape interpretation is handled here.
-When a line is complete in the raw queue,
-an event is signaled.
-The code catching this signal then copies a
-line from the raw queue to a canonical queue
-performing the character erase and line kill editing.
-User read requests on terminals can be
-directed at either the raw or canonical queues.
-.NH 3
-Other character devices
-.PP
-Finally,
-there are devices that fit no general category.
-These devices are set up as character I/O drivers.
-An example is a driver that reads and writes
-unmapped primary memory as an I/O device.
-Some devices are too
-fast to be treated a character at time,
-but do not fit the disk I/O mold.
-Examples are fast communications lines and
-fast line printers.
-These devices either have their own buffers
-or ``borrow'' block I/O buffers for a while and
-then give them back.
-.NH
-THE FILE SYSTEM
-.PP
-In the
-.UX
-system,
-a file is a (one-dimensional) array of bytes.
-No other structure of files is implied by the
-system.
-Files are attached anywhere
-(and possibly multiply)
-onto a hierarchy of directories.
-Directories are simply files that
-users cannot write.
-For a further discussion
-of the external view of files and directories,
-see Ref.\0
-.[
-ritchie thompson unix bstj 1978
-%Q This issue
-.].
-.PP
-The
-.UX
-file system is a disk data structure
-accessed completely through
-the block I/O system.
-As stated before,
-the canonical view of a ``disk'' is
-a randomly addressable array of
-512-byte blocks.
-A file system breaks the disk into
-four self-identifying regions.
-The first block (address 0)
-is unused by the file system.
-It is left aside for booting procedures.
-The second block (address 1)
-contains the so-called ``super-block.''
-This block,
-among other things,
-contains the size of the disk and
-the boundaries of the other regions.
-Next comes the i-list,
-a list of file definitions.
-Each file definition is
-a 64-byte structure, called an i-node.
-The offset of a particular i-node
-within the i-list is called its i-number.
-The combination of device name
-(major and minor numbers) and i-number
-serves to uniquely name a particular file.
-After the i-list,
-and to the end of the disk,
-come free storage blocks that
-are available for the contents of files.
-.PP
-The free space on a disk is maintained
-by a linked list of available disk blocks.
-Every block in this chain contains a disk address
-of the next block in the chain.
-The remaining space contains the address of up to
-50 disk blocks that are also free.
-Thus with one I/O operation,
-the system obtains 50 free blocks and a
-pointer where to find more.
-The disk allocation algorithms are
-very straightforward.
-Since all allocation is in fixed-size
-blocks and there is strict accounting of
-space,
-there is no need to compact or garbage collect.
-However,
-as disk space becomes dispersed,
-latency gradually increases.
-Some installations choose to occasionally compact
-disk space to reduce latency.
-.PP
-An i-node contains 13 disk addresses.
-The first 10 of these addresses point directly at
-the first 10 blocks of a file.
-If a file is larger than 10 blocks (5,120 bytes),
-then the eleventh address points at a block
-that contains the addresses of the next 128 blocks of the file.
-If the file is still larger than this
-(70,656 bytes),
-then the twelfth block points at up to 128 blocks,
-each pointing to 128 blocks of the file.
-Files yet larger
-(8,459,264 bytes)
-use the thirteenth address for a ``triple indirect'' address.
-The algorithm ends here with the maximum file size
-of 1,082,201,087 bytes.
-.PP
-A logical directory hierarchy is added
-to this flat physical structure simply
-by adding a new type of file, the directory.
-A directory is accessed exactly as an ordinary file.
-It contains 16-byte entries consisting of
-a 14-byte name and an i-number.
-The root of the hierarchy is at a known i-number
-(\fIviz.,\fR 2).
-The file system structure allows an arbitrary, directed graph
-of directories with regular files linked in
-at arbitrary places in this graph.
-In fact,
-very early
-.UX
-systems used such a structure.
-Administration of such a structure became so
-chaotic that later systems were restricted
-to a directory tree.
-Even now,
-with regular files linked multiply
-into arbitrary places in the tree,
-accounting for space has become a problem.
-It may become necessary to restrict the entire
-structure to a tree,
-and allow a new form of linking that
-is subservient to the tree structure.
-.PP
-The file system allows
-easy creation,
-easy removal,
-easy random accessing,
-and very easy space allocation.
-With most physical addresses confined
-to a small contiguous section of disk,
-it is also easy to dump, restore, and
-check the consistency of the file system.
-Large files suffer from indirect addressing,
-but the cache prevents most of the implied physical I/O
-without adding much execution.
-The space overhead properties of this scheme are quite good.
-For example,
-on one particular file system,
-there are 25,000 files containing 130M bytes of data-file content.
-The overhead (i-node, indirect blocks, and last block breakage)
-is about 11.5M bytes.
-The directory structure to support these files
-has about 1,500 directories containing 0.6M bytes of directory content
-and about 0.5M bytes of overhead in accessing the directories.
-Added up any way,
-this comes out to less than a 10 percent overhead for actual
-stored data.
-Most systems have this much overhead in
-padded trailing blanks alone.
-.NH 2
-File system implementation
-.PP
-Because the i-node defines a file,
-the implementation of the file system centers
-around access to the i-node.
-The system maintains a table of all active
-i-nodes.
-As a new file is accessed,
-the system locates the corresponding i-node,
-allocates an i-node table entry, and reads
-the i-node into primary memory.
-As in the buffer cache,
-the table entry is considered to be the current
-version of the i-node.
-Modifications to the i-node are made to
-the table entry.
-When the last access to the i-node goes
-away,
-the table entry is copied back to the
-secondary store i-list and the table entry is freed.
-.PP
-All I/O operations on files are carried out
-with the aid of the corresponding i-node table entry.
-The accessing of a file is a straightforward
-implementation of the algorithms mentioned previously.
-The user is not aware of i-nodes and i-numbers.
-References to the file system are made in terms of
-path names of the directory tree.
-Converting a path name into an i-node table entry
-is also straightforward.
-Starting at some known i-node
-(the root or the current directory of some process),
-the next component of the path name is
-searched by reading the directory.
-This gives an i-number and an implied device
-(that of the directory).
-Thus the next i-node table entry can be accessed.
-If that was the last component of the path name,
-then this i-node is the result.
-If not,
-this i-node is the directory needed to look up
-the next component of the path name, and the
-algorithm is repeated.
-.PP
-The user process accesses the file system with
-certain primitives.
-The most common of these are
-.UL open ,
-.UL create ,
-.UL read ,
-.UL write ,
-.UL seek ,
-and
-.UL close .
-The data structures maintained are shown in Fig. 2.
-.KS
-.sp 22P
-.ce
-Fig. 2\(emFile system data structure.
-.KE
-In the system data segment associated with a user,
-there is room for some (usually between 10 and 50) open files.
-This open file table consists of pointers that can be used to access
-corresponding i-node table entries.
-Associated with each of these open files is
-a current I/O pointer.
-This is a byte offset of
-the next read/write operation on the file.
-The system treats each read/write request
-as random with an implied seek to the
-I/O pointer.
-The user usually thinks of the file as
-sequential with the I/O pointer
-automatically counting the number of bytes
-that have been read/written from the file.
-The user may,
-of course,
-perform random I/O by setting the I/O pointer
-before reads/writes.
-.PP
-With file sharing,
-it is necessary to allow related
-processes to share a common I/O pointer
-and yet have separate I/O pointers
-for independent processes
-that access the same file.
-With these two conditions,
-the I/O pointer cannot reside
-in the i-node table nor can
-it reside in the list of
-open files for the process.
-A new table
-(the open file table)
-was invented for the sole purpose
-of holding the I/O pointer.
-Processes that share the same open
-file
-(the result of
-.UL fork s)
-share a common open file table entry.
-A separate open of the same file will
-only share the i-node table entry,
-but will have distinct open file table entries.
-.PP
-The main file system primitives are implemented as follows.
-.UL \&open
-converts a file system path name into an i-node
-table entry.
-A pointer to the i-node table entry is placed in a
-newly created open file table entry.
-A pointer to the file table entry is placed in the
-system data segment for the process.
-.UL \&create
-first creates a new i-node entry,
-writes the i-number into a directory, and
-then builds the same structure as for an
-.UL open .
-.UL \&read
-and
-.UL write
-just access the i-node entry as described above.
-.UL \&seek
-simply manipulates the I/O pointer.
-No physical seeking is done.
-.UL \&close
-just frees the structures built by
-.UL open
-and
-.UL create .
-Reference counts are kept on the open file table entries and
-the i-node table entries to free these structures after
-the last reference goes away.
-.UL \&unlink
-simply decrements the count of the
-number of directories pointing at the given i-node.
-When the last reference to an i-node table entry
-goes away,
-if the i-node has no directories pointing to it,
-then the file is removed and the i-node is freed.
-This delayed removal of files prevents
-problems arising from removing active files.
-A file may be removed while still open.
-The resulting unnamed file vanishes
-when the file is closed.
-This is a method of obtaining temporary files.
-.PP
-There is a type of unnamed
-.UC  FIFO
-file called a
-.UL pipe.
-Implementation of
-.UL pipe s
-consists of implied
-.UL seek s
-before each
-.UL read
-or
-.UL write
-in order to implement
-first-in-first-out.
-There are also checks and synchronization
-to prevent the
-writer from grossly outproducing the
-reader and to prevent the reader from
-overtaking the writer.
-.NH 2
-Mounted file systems
-.PP
-The file system of a
-.UX
-system
-starts with some designated block device
-formatted as described above to contain
-a hierarchy.
-The root of this structure is the root of
-the
-.UX
-file system.
-A second formatted block device may be
-mounted
-at any leaf of
-the current hierarchy.
-This logically extends the current hierarchy.
-The implementation of
-mounting
-is trivial.
-A mount table is maintained containing
-pairs of designated leaf i-nodes and
-block devices.
-When converting a path name into an i-node,
-a check is made to see if the new i-node is a
-designated leaf.
-If it is,
-the i-node of the root
-of the block device replaces it.
-.PP
-Allocation of space for a file is taken
-from the free pool on the device on which the
-file lives.
-Thus a file system consisting of many
-mounted devices does not have a common pool of
-free secondary storage space.
-This separation of space on different
-devices is necessary to allow easy
-unmounting
-of a device.
-.NH 2
-Other system functions
-.PP
-There are some other things that the system
-does for the user\-a
-little accounting,
-a little tracing/debugging,
-and a little access protection.
-Most of these things are not very
-well developed
-because our use of the system in computing science research
-does not need them.
-There are some features that are missed in some
-applications, for example, better inter-process communication.
-.PP
-The
-.UX
-kernel is an I/O multiplexer more than
-a complete operating system.
-This is as it should be.
-Because of this outlook,
-many features are
-found in most
-other operating systems that are missing from the
-.UX
-kernel.
-For example,
-the
-.UX
-kernel does not support
-file access methods,
-file disposition,
-file formats,
-file maximum size,
-spooling,
-command language,
-logical records,
-physical records,
-assignment of logical file names,
-logical file names,
-more than one character set,
-an operator's console,
-an operator,
-log-in,
-or log-out.
-Many of these things are symptoms rather than features.
-Many of these things are implemented
-in user software
-using the kernel as a tool.
-A good example of this is the command language.
-.[
-bourne shell 1978 bstj
-%Q This issue
-.]
-Each user may have his own command language.
-Maintenance of such code is as easy as
-maintaining user code.
-The idea of implementing ``system'' code with general
-user primitives
-comes directly from
-.UC  MULTICS .
-.[
-organick multics 1972
-.]
-.LP
-.[
-$LIST$
-.]
diff --git a/.ref-Research-V7/usr/doc/index b/.ref-Research-V7/usr/doc/index
deleted file mode 100644 (file)
index b0a6de1..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-.nr n 0 +1
-.TL
-UNIX Programmer's Manual
-.br
-.sp .5
-Volume 2 \(em Supplementary Documents
-.AU
-.ft B
-.ps 11
-Seventh Edition
-.AI
-January 10, 1979
-.PP
-This volume contains documents which supplement
-the information contained in Volume 1 of 
-.ul
-The
-.ul
-.UX
-.ul
-Programmer's Manual.
-The documents here are grouped roughly into
-the areas of
-basics,
-editing,
-language tools,
-document preparation,
-and
-system maintenance.
-Further general information may be found in
-the Bell System Technical Journal
-special issue on
-.UX ,
-July-August, 1978.
-.PP
-Many of the documents cited within this volume as
-Bell Laboratories internal memoranda
-or Computing Science Technical Reports
-(CSTR) are also contained here.
-.PP
-These documents contain occasional localisms,
-typically references to other operating systems
-like
-GCOS
-and
-IBM.
-In all cases, such references may be safely ignored
-by
-UNIX
-users.
-.SH
-General Works
-.IP \n+n.
-7th Edition UNIX \(em Summary.
-.RS
-A concise summary of the facilities available on
-.UX .
-.RE
-.IP \n+n.
-The UNIX Time-Sharing System.
-D. M. Ritchie and K. Thompson.
-.RS
-The original
-.UX
-paper, reprinted from CACM.
-.RE
-.SH
-Getting Started
-.IP \n+n.
-UNIX for Beginners \(em Second Edition.
-B. W. Kernighan.
-.RS
-An introduction to the most basic use of the system.
-.RE
-.IP \n+n.
-A Tutorial Introduction to the UNIX Text Editor.
-B. W. Kernighan.
-.RS
-An easy way to get started with the editor.
-.RE
-.IP \n+n.
-Advanced Editing on UNIX.
-B. W. Kernighan.
-.RS
-The next step.
-.RE
-.IP \n+n.
-An Introduction to the UNIX Shell.
-S. R. Bourne.
-.RS
-An introduction to the capabilities of the command interpreter,
-the shell.
-.RE
-.IP \n+n.
-Learn \(em Computer Aided Instruction on UNIX.
-M. E. Lesk and B. W. Kernighan.
-.RS
-Describes a computer-aided instruction program that walks new users
-through the basics of
-files, 
-the editor,
-and
-document preparation software.
-.RE
-.SH
-Document Preparation
-.IP \n+n.
-Typing Documents on the UNIX System.
-M. E. Lesk.
-.RS
-Describes the basic use of the formatting tools.
-Also describes ``\-ms'', a standardized package of formatting requests
-that can be used to lay out most documents
-(including those in this volume).
-.RE
-.IP \n+n.
-A System for Typesetting Mathematics.
-B. W. Kernighan and L. L. Cherry.
-.RS
-Describes EQN. an easy-to-learn language for doing high-quality mathematical typesetting,
-.RE
-.IP \n+n.
-TBL \(em A Program to Format Tables.
-M. E. Lesk.
-.RS
-A program to permit easy specification of tabular material
-for typesetting.
-Again, easy to learn and use.
-.RE
-.IP \n+n.
-Some Applications of Inverted Indexes on the UNIX System.
-M. E. Lesk.
-.RS
-Describes, among other things, the program REFER
-which fills in bibliographic citations from a data base
-automatically.
-.RE
-.RE
-.IP \n+n.
-NROFF/TROFF User's Manual.
-J. F. Ossanna.
-.RS
-The basic formatting program.
-.RE
-.IP \n+n.
-A TROFF Tutorial.
-B. W. Kernighan.
-.RS
-An introduction to TROFF for those who
-really want to know such things.
-.RE
-.SH
-Programming
-.IP \n+n.
-The C Programming Language \(em Reference Manual.
-D. M. Ritchie.
-.RS
-Official statement of the syntax and semantics of C.
-Should be supplemented by
-.ul
-The C Programming Language,
-B. W. Kernighan and D. M. Ritchie,
-Prentice-Hall, 1978,
-which contains a tutorial introduction and many examples.
-.RE
-.IP \n+n.
-Lint, A C Program Checker.
-S. C. Johnson.
-.RS
-Checks C programs
-for syntax errors, type violations,
-portability problems,
-and a variety of probable errors.
-.RE
-.IP \n+n.
-Make \(em A Program for Maintaining Computer Programs.
-S. I. Feldman.
-.RS
-Indispensable tool for making sure that large programs
-are properly compiled with minimal effort.
-.RE
-.IP \n+n.
-UNIX Programming.
-B. W. Kernighan and D. M. Ritchie.
-.RS
-Describes the programming interface to the operating system
-and the standard I/O library.
-.RE
-.IP \n+n.
-A Tutorial Introduction to ADB.
-J. F. Maranzano and S. R. Bourne.
-.RS
-How to use the ADB debugger.
-.RE
-.SH
-Supporting Tools and Languages
-.IP \n+n.
-YACC: Yet Another Compiler-Compiler.
-S. C. Johnson.
-.RS
-Converts a BNF specification of a language
-and semantic actions written in C into a compiler for the language.
-.RE
-.IP \n+n.
-LEX \(em A Lexical Analyzer Generator.
-M. E. Lesk and E. Schmidt.
-.RS
-Creates a recognizer for a set of regular expressions;
-each regular expression can be followed by arbitrary C code
-which will be executed when the regular expression is found.
-.RE
-.IP \n+n.
-A Portable Fortran 77 Compiler.
-S. I. Feldman and P. J. Weinberger.
-.RS
-The first Fortran 77 compiler, and still one of the best.
-.RE
-.IP \n+n.
-Ratfor \(em A Preprocessor for a Rational Fortran.
-B. W. Kernighan.
-.RS
-Converts a Fortran with C-like control structures and cosmetics
-into real, ugly Fortran.
-.RE
-.IP \n+n.
-The M4 Macro Processor.
-B. W. Kernighan and D. M. Ritchie.
-.RS
-M4 is a macro processor useful as a front end for C, Ratfor,
-Cobol, and in its own right.
-.RE
-.IP \n+n.
-SED \(em A Non-interactive Text Editor.
-L. E. McMahon.
-.RS
-A variant of the editor for processing large
-inputs.
-.RE
-.IP \n+n.
-AWK \(em A Pattern Scanning and Processing Language.
-A. V. Aho, B. W. Kernighan and 
-.RS
-P. J. Weinberger.
-.br
-Makes it easy to specify many data transformation and selection operations.
-.RE
-.IP \n+n.
-DC \(em An Interactive Desk Calculator.
-R. H. Morris and L. L. Cherry.
-.RS
-A super HP calculator, if you don't need floating point.
-.RE
-.IP \n+n.
-BC \(em An Arbitrary Precision Desk-Calculator Language.
-L. L. Cherry and R. H. Morris.
-.RS
-A front end for DC
-that provides infix notation, control flow, and built-in functions.
-.RE
-.IP \n+n.
-UNIX Assembler Reference Manual.
-D. M. Ritchie.
-.RS
-The ultimate dead language.
-.RE
-.SH
-Implementation, Maintenance, and Miscellaneous
-.IP \n+n.
-Setting Up UNIX \(em Seventh Edition.
-C. B. Haley and D. M. Ritchie.
-.RS
-How to configure and get your system running.
-.RE
-.IP \n+n.
-Regenerating System Software.
-C. B. Haley and D. M. Ritchie.
-.RS
-What do do when you have to change things.
-.RE
-.IP \n+n.
-UNIX Implementation.
-K. Thompson.
-.RS
-How the system actually works inside.
-.RE
-.IP \n+n.
-The UNIX I/O System.
-D. M. Ritchie.
-.RS
-How the I/O system really works.
-.RE
-.IP \n+n.
-A Tour Through the UNIX C Compiler.
-D. M. Ritchie.
-.RS
-How the PDP-11 compiler works inside.
-.RE
-.IP \n+n.
-A Tour Through the Portable C Compiler.
-S. C. Johnson.
-.RS
-How the portable C compiler works inside.
-.RE
-.IP \n+n.
-A Dial-Up Network of UNIX Systems.
-D. A. Nowitz and M. E. Lesk.
-.RS
-Describes UUCP, a program for communicating files
-between UNIX systems.
-.RE
-.IP \n+n.
-UUCP Implementation Description.
-D. A. Nowitz.
-.RS
-How UUCP works, and how to administer it.
-.RE
-.IP \n+n.
-On the Security of UNIX.
-D. M. Ritchie.
-.RS
-Hints on how to break UNIX, and how to avoid doing so.
-.RE
-.IP \n+n.
-Password Security: A Case History.
-R. H. Morris and K. Thompson.
-.RS
-How the bad guys used to be able to
-break the password algorithm,
-and why they can't now,
-at least not so easily.
-.RE
diff --git a/.ref-Research-V7/usr/doc/iosys b/.ref-Research-V7/usr/doc/iosys
deleted file mode 100644 (file)
index 512d30b..0000000
+++ /dev/null
@@ -1,1044 +0,0 @@
-.TL
-The UNIX I/O System
-.AU
-Dennis M. Ritchie
-.AI
-.MH
-.PP
-This paper gives an overview of the workings of the UNIX\(dg
-.FS
-\(dgUNIX is a Trademark of Bell Laboratories.
-.FE
-I/O system.
-It was written with an eye toward providing
-guidance to writers of device driver routines,
-and is oriented more toward describing the environment
-and nature of device drivers than the implementation
-of that part of the file system which deals with
-ordinary files.
-.PP
-It is assumed that the reader has a good knowledge
-of the overall structure of the file system as discussed
-in the paper ``The UNIX Time-sharing System.''
-A more detailed discussion
-appears in
-``UNIX Implementation;''
-the current document restates parts of that one,
-but is still more detailed.
-It is most useful in
-conjunction with a copy of the system code,
-since it is basically an exegesis of that code.
-.SH
-Device Classes
-.PP
-There are two classes of device:
-.I block
-and
-.I character.
-The block interface is suitable for devices
-like disks, tapes, and DECtape
-which work, or can work, with addressible 512-byte blocks.
-Ordinary magnetic tape just barely fits in this category,
-since by use of forward
-and
-backward spacing any block can be read, even though
-blocks can be written only at the end of the tape.
-Block devices can at least potentially contain a mounted
-file system.
-The interface to block devices is very highly structured;
-the drivers for these devices share a great many routines
-as well as a pool of buffers.
-.PP
-Character-type devices have a much
-more straightforward interface, although
-more work must be done by the driver itself.
-.PP
-Devices of both types are named by a
-.I major
-and a
-.I minor
-device number.
-These numbers are generally stored as an integer
-with the minor device number
-in the low-order 8 bits and the major device number
-in the next-higher 8 bits;
-macros
-.I major
-and
-.I minor
-are available to access these numbers.
-The major device number selects which driver will deal with
-the device; the minor device number is not used
-by the rest of the system but is passed to the
-driver at appropriate times.
-Typically the minor number
-selects a subdevice attached to
-a given controller, or one of
-several similar hardware interfaces.
-.PP
-The major device numbers for block and character devices
-are used as indices in separate tables;
-they both start at 0 and therefore overlap.
-.SH
-Overview of I/O
-.PP
-The purpose of
-the
-.I open
-and
-.I creat
-system calls is to set up entries in three separate
-system tables.
-The first of these is the
-.I u_ofile
-table,
-which is stored in the system's per-process
-data area
-.I u.
-This table is indexed by
-the file descriptor returned by the
-.I open
-or
-.I creat,
-and is accessed during
-a
-.I read,
-.I write,
-or other operation on the open file.
-An entry contains only
-a pointer to the corresponding
-entry of the
-.I file
-table,
-which is a per-system data base.
-There is one entry in the
-.I file
-table for each
-instance of
-.I open
-or
-.I creat.
-This table is per-system because the same instance
-of an open file must be shared among the several processes
-which can result from
-.I forks
-after the file is opened.
-A
-.I file
-table entry contains
-flags which indicate whether the file
-was open for reading or writing or is a pipe, and
-a count which is used to decide when all processes
-using the entry have terminated or closed the file
-(so the entry can be abandoned).
-There is also a 32-bit file offset
-which is used to indicate where in the file the next read
-or write will take place.
-Finally, there is a pointer to the
-entry for the file in the
-.I inode
-table,
-which contains a copy of the file's i-node.
-.PP
-Certain open files can be designated ``multiplexed''
-files, and several other flags apply to such
-channels.
-In such a case, instead of an offset,
-there is a pointer to an associated multiplex channel table.
-Multiplex channels will not be discussed here.
-.PP
-An entry in the
-.I file
-table corresponds precisely to an instance of
-.I open
-or
-.I creat;
-if the same file is opened several times,
-it will have several
-entries in this table.
-However,
-there is at most one entry
-in the
-.I inode
-table for a given file.
-Also, a file may enter the
-.I inode
-table not only because it is open,
-but also because it is the current directory
-of some process or because it
-is a special file containing a currently-mounted
-file system.
-.PP
-An entry in the
-.I inode
-table differs somewhat from the
-corresponding i-node as stored on the disk;
-the modified and accessed times are not stored,
-and the entry is augmented
-by a flag word containing information about the entry,
-a count used to determine when it may be
-allowed to disappear,
-and the device and i-number
-whence the entry came.
-Also, the several block numbers that give addressing
-information for the file are expanded from
-the 3-byte, compressed format used on the disk to full
-.I long
-quantities.
-.PP
-During the processing of an
-.I open
-or
-.I creat
-call for a special file,
-the system always calls the device's
-.I open
-routine to allow for any special processing
-required (rewinding a tape, turning on
-the data-terminal-ready lead of a modem, etc.).
-However,
-the
-.I close
-routine is called only when the last
-process closes a file,
-that is, when the i-node table entry
-is being deallocated.
-Thus it is not feasible
-for a device to maintain, or depend on,
-a count of its users, although it is quite
-possible to
-implement an exclusive-use device which cannot
-be reopened until it has been closed.
-.PP
-When a
-.I read
-or
-.I write
-takes place,
-the user's arguments
-and the
-.I file
-table entry are used to set up the
-variables
-.I u.u_base,
-.I u.u_count,
-and
-.I u.u_offset
-which respectively contain the (user) address
-of the I/O target area, the byte-count for the transfer,
-and the current location in the file.
-If the file referred to is
-a character-type special file, the appropriate read
-or write routine is called; it is responsible
-for transferring data and updating the
-count and current location appropriately
-as discussed below.
-Otherwise, the current location is used to calculate
-a logical block number in the file.
-If the file is an ordinary file the logical block
-number must be mapped (possibly using indirect blocks)
-to a physical block number; a block-type
-special file need not be mapped.
-This mapping is performed by the
-.I bmap
-routine.
-In any event, the resulting physical block number
-is used, as discussed below, to
-read or write the appropriate device.
-.SH
-Character Device Drivers
-.PP
-The
-.I cdevsw
-table specifies the interface routines present for
-character devices.
-Each device provides five routines:
-open, close, read, write, and special-function
-(to implement the
-.I ioctl
-system call).
-Any of these may be missing.
-If a call on the routine
-should be ignored,
-(e.g.
-.I open
-on non-exclusive devices that require no setup)
-the
-.I cdevsw
-entry can be given as
-.I nulldev;
-if it should be considered an error,
-(e.g.
-.I write
-on read-only devices)
-.I nodev
-is used.
-For terminals,
-the
-.I cdevsw
-structure also contains a pointer to the
-.I tty
-structure associated with the terminal.
-.PP
-The
-.I open
-routine is called each time the file
-is opened with the full device number as argument.
-The second argument is a flag which is
-non-zero only if the device is to be written upon.
-.PP
-The
-.I close
-routine is called only when the file
-is closed for the last time,
-that is when the very last process in
-which the file is open closes it.
-This means it is not possible for the driver to
-maintain its own count of its users.
-The first argument is the device number;
-the second is a flag which is non-zero
-if the file was open for writing in the process which
-performs the final
-.I close.
-.PP
-When
-.I write
-is called, it is supplied the device
-as argument.
-The per-user variable
-.I u.u_count
-has been set to
-the number of characters indicated by the user;
-for character devices, this number may be 0
-initially.
-.I u.u_base
-is the address supplied by the user from which to start
-taking characters.
-The system may call the
-routine internally, so the
-flag
-.I u.u_segflg
-is supplied that indicates,
-if
-.I on,
-that
-.I u.u_base
-refers to the system address space instead of
-the user's.
-.PP
-The
-.I write
-routine
-should copy up to
-.I u.u_count
-characters from the user's buffer to the device,
-decrementing
-.I u.u_count
-for each character passed.
-For most drivers, which work one character at a time,
-the routine
-.I "cpass( )"
-is used to pick up characters
-from the user's buffer.
-Successive calls on it return
-the characters to be written until
-.I u.u_count
-goes to 0 or an error occurs,
-when it returns \(mi1.
-.I Cpass
-takes care of interrogating
-.I u.u_segflg
-and updating
-.I u.u_count.
-.PP
-Write routines which want to transfer
-a probably large number of characters into an internal
-buffer may also use the routine
-.I "iomove(buffer, offset, count, flag)"
-which is faster when many characters must be moved.
-.I Iomove
-transfers up to
-.I count
-characters into the
-.I buffer
-starting
-.I offset
-bytes from the start of the buffer;
-.I flag
-should be
-.I B_WRITE
-(which is 0) in the write case.
-Caution:
-the caller is responsible for making sure
-the count is not too large and is non-zero.
-As an efficiency note,
-.I iomove
-is much slower if any of
-.I "buffer+offset, count"
-or
-.I u.u_base
-is odd.
-.PP
-The device's
-.I read
-routine is called under conditions similar to
-.I write,
-except that
-.I u.u_count
-is guaranteed to be non-zero.
-To return characters to the user, the routine
-.I "passc(c)"
-is available; it takes care of housekeeping
-like
-.I cpass
-and returns \(mi1 as the last character
-specified by
-.I u.u_count
-is returned to the user;
-before that time, 0 is returned.
-.I Iomove
-is also usable as with
-.I write;
-the flag should be
-.I B_READ
-but the same cautions apply.
-.PP
-The ``special-functions'' routine
-is invoked by the
-.I stty
-and
-.I gtty
-system calls as follows:
-.I "(*p) (dev, v)"
-where
-.I p
-is a pointer to the device's routine,
-.I dev
-is the device number,
-and
-.I v
-is a vector.
-In the
-.I gtty
-case,
-the device is supposed to place up to 3 words of status information
-into the vector; this will be returned to the caller.
-In the
-.I stty
-case,
-.I v
-is 0;
-the device should take up to 3 words of
-control information from
-the array
-.I "u.u_arg[0...2]."
-.PP
-Finally, each device should have appropriate interrupt-time
-routines.
-When an interrupt occurs, it is turned into a C-compatible call
-on the devices's interrupt routine.
-The interrupt-catching mechanism makes
-the low-order four bits of the ``new PS'' word in the
-trap vector for the interrupt available
-to the interrupt handler.
-This is conventionally used by drivers
-which deal with multiple similar devices
-to encode the minor device number.
-After the interrupt has been processed,
-a return from the interrupt handler will
-return from the interrupt itself.
-.PP
-A number of subroutines are available which are useful
-to character device drivers.
-Most of these handlers, for example, need a place
-to buffer characters in the internal interface
-between their ``top half'' (read/write)
-and ``bottom half'' (interrupt) routines.
-For relatively low data-rate devices, the best mechanism
-is the character queue maintained by the
-routines
-.I getc
-and
-.I putc.
-A queue header has the structure
-.DS
-struct {
-       int     c_cc;   /* character count */
-       char    *c_cf;  /* first character */
-       char    *c_cl;  /* last character */
-} queue;
-.DE
-A character is placed on the end of a queue by
-.I "putc(c, &queue)"
-where
-.I c
-is the character and
-.I queue
-is the queue header.
-The routine returns \(mi1 if there is no space
-to put the character, 0 otherwise.
-The first character on the queue may be retrieved
-by
-.I "getc(&queue)"
-which returns either the (non-negative) character
-or \(mi1 if the queue is empty.
-.PP
-Notice that the space for characters in queues is
-shared among all devices in the system
-and in the standard system there are only some 600
-character slots available.
-Thus device handlers,
-especially write routines, must take
-care to avoid gobbling up excessive numbers of characters.
-.PP
-The other major help available
-to device handlers is the sleep-wakeup mechanism.
-The call
-.I "sleep(event, priority)"
-causes the process to wait (allowing other processes to run)
-until the
-.I event
-occurs;
-at that time, the process is marked ready-to-run
-and the call will return when there is no
-process with higher
-.I priority.
-.PP
-The call
-.I "wakeup(event)"
-indicates that the
-.I event
-has happened, that is, causes processes sleeping
-on the event to be awakened.
-The
-.I event
-is an arbitrary quantity agreed upon
-by the sleeper and the waker-up.
-By convention, it is the address of some data area used
-by the driver, which guarantees that events
-are unique.
-.PP
-Processes sleeping on an event should not assume
-that the event has really happened;
-they should check that the conditions which
-caused them to sleep no longer hold.
-.PP
-Priorities can range from 0 to 127;
-a higher numerical value indicates a less-favored
-scheduling situation.
-A distinction is made between processes sleeping
-at priority less than the parameter
-.I PZERO
-and those at numerically larger priorities.
-The former cannot
-be interrupted by signals, although it
-is conceivable that it may be swapped out.
-Thus it is a bad idea to sleep with
-priority less than PZERO on an event which might never occur.
-On the other hand, calls to
-.I sleep
-with larger priority
-may never return if the process is terminated by
-some signal in the meantime.
-Incidentally, it is a gross error to call
-.I sleep
-in a routine called at interrupt time, since the process
-which is running is almost certainly not the
-process which should go to sleep.
-Likewise, none of the variables in the user area
-``\fIu\fB.\fR''
-should be touched, let alone changed, by an interrupt routine.
-.PP
-If a device driver
-wishes to wait for some event for which it is inconvenient
-or impossible to supply a
-.I wakeup,
-(for example, a device going on-line, which does not
-generally cause an interrupt),
-the call
-.I "sleep(&lbolt, priority)
-may be given.
-.I Lbolt
-is an external cell whose address is awakened once every 4 seconds
-by the clock interrupt routine.
-.PP
-The routines
-.I "spl4( ), spl5( ), spl6( ), spl7( )"
-are available to
-set the processor priority level as indicated to avoid
-inconvenient interrupts from the device.
-.PP
-If a device needs to know about real-time intervals,
-then
-.I "timeout(func, arg, interval)
-will be useful.
-This routine arranges that after
-.I interval
-sixtieths of a second, the
-.I func
-will be called with
-.I arg
-as argument, in the style
-.I "(*func)(arg).
-Timeouts are used, for example,
-to provide real-time delays after function characters
-like new-line and tab in typewriter output,
-and to terminate an attempt to
-read the 201 Dataphone
-.I dp
-if there is no response within a specified number
-of seconds.
-Notice that the number of sixtieths of a second is limited to 32767,
-since it must appear to be positive,
-and that only a bounded number of timeouts
-can be going on at once.
-Also, the specified
-.I func
-is called at clock-interrupt time, so it should
-conform to the requirements of interrupt routines
-in general.
-.SH
-The Block-device Interface
-.PP
-Handling of block devices is mediated by a collection
-of routines that manage a set of buffers containing
-the images of blocks of data on the various devices.
-The most important purpose of these routines is to assure
-that several processes that access the same block of the same
-device in multiprogrammed fashion maintain a consistent
-view of the data in the block.
-A secondary but still important purpose is to increase
-the efficiency of the system by
-keeping in-core copies of blocks that are being
-accessed frequently.
-The main data base for this mechanism is the
-table of buffers
-.I buf.
-Each buffer header contains a pair of pointers
-.I "(b_forw, b_back)"
-which maintain a doubly-linked list
-of the buffers associated with a particular
-block device, and a
-pair of pointers
-.I "(av_forw, av_back)"
-which generally maintain a doubly-linked list of blocks
-which are ``free,'' that is,
-eligible to be reallocated for another transaction.
-Buffers that have I/O in progress
-or are busy for other purposes do not appear in this list.
-The buffer header
-also contains the device and block number to which the
-buffer refers, and a pointer to the actual storage associated with
-the buffer.
-There is a word count
-which is the negative of the number of words
-to be transferred to or from the buffer;
-there is also an error byte and a residual word
-count used to communicate information
-from an I/O routine to its caller.
-Finally, there is a flag word
-with bits indicating the status of the buffer.
-These flags will be discussed below.
-.PP
-Seven routines constitute
-the most important part of the interface with the
-rest of the system.
-Given a device and block number,
-both
-.I bread
-and
-.I getblk
-return a pointer to a buffer header for the block;
-the difference is that
-.I bread
-is guaranteed to return a buffer actually containing the
-current data for the block,
-while
-.I getblk
-returns a buffer which contains the data in the
-block only if it is already in core (whether it is
-or not is indicated by the
-.I B_DONE
-bit; see below).
-In either case the buffer, and the corresponding
-device block, is made ``busy,''
-so that other processes referring to it
-are obliged to wait until it becomes free.
-.I Getblk
-is used, for example,
-when a block is about to be totally rewritten,
-so that its previous contents are
-not useful;
-still, no other process can be allowed to refer to the block
-until the new data is placed into it.
-.PP
-The
-.I breada
-routine is used to implement read-ahead.
-it is logically similar to
-.I bread,
-but takes as an additional argument the number of
-a block (on the same device) to be read asynchronously
-after the specifically requested block is available.
-.PP
-Given a pointer to a buffer,
-the
-.I brelse
-routine
-makes the buffer again available to other processes.
-It is called, for example, after
-data has been extracted following a
-.I bread.
-There are three subtly-different write routines,
-all of which take a buffer pointer as argument,
-and all of which logically release the buffer for
-use by others and place it on the free list.
-.I Bwrite
-puts the
-buffer on the appropriate device queue,
-waits for the write to be done,
-and sets the user's error flag if required.
-.I Bawrite
-places the buffer on the device's queue, but does not wait
-for completion, so that errors cannot be reflected directly to
-the user.
-.I Bdwrite
-does not start any I/O operation at all,
-but merely marks
-the buffer so that if it happens
-to be grabbed from the free list to contain
-data from some other block, the data in it will
-first be written
-out.
-.PP
-.I Bwrite
-is used when one wants to be sure that
-I/O takes place correctly, and that
-errors are reflected to the proper user;
-it is used, for example, when updating i-nodes.
-.I Bawrite
-is useful when more overlap is desired
-(because no wait is required for I/O to finish)
-but when it is reasonably certain that the
-write is really required.
-.I Bdwrite
-is used when there is doubt that the write is
-needed at the moment.
-For example,
-.I bdwrite
-is called when the last byte of a
-.I write
-system call falls short of the end of a
-block, on the assumption that
-another
-.I write
-will be given soon which will re-use the same block.
-On the other hand,
-as the end of a block is passed,
-.I bawrite
-is called, since probably the block will
-not be accessed again soon and one might as
-well start the writing process as soon as possible.
-.PP
-In any event, notice that the routines
-.I "getblk"
-and
-.I bread
-dedicate the given block exclusively to the
-use of the caller, and make others wait,
-while one of
-.I "brelse, bwrite, bawrite,"
-or
-.I bdwrite
-must eventually be called to free the block for use by others.
-.PP
-As mentioned, each buffer header contains a flag
-word which indicates the status of the buffer.
-Since they provide
-one important channel for information between the drivers and the
-block I/O system, it is important to understand these flags.
-The following names are manifest constants which
-select the associated flag bits.
-.IP B_READ 10
-This bit is set when the buffer is handed to the device strategy routine
-(see below) to indicate a read operation.
-The symbol
-.I B_WRITE
-is defined as 0 and does not define a flag; it is provided
-as a mnemonic convenience to callers of routines like
-.I swap
-which have a separate argument
-which indicates read or write.
-.IP B_DONE 10
-This bit is set
-to 0 when a block is handed to the the device strategy
-routine and is turned on when the operation completes,
-whether normally as the result of an error.
-It is also used as part of the return argument of
-.I getblk
-to indicate if 1 that the returned
-buffer actually contains the data in the requested block.
-.IP B_ERROR 10
-This bit may be set to 1 when
-.I B_DONE
-is set to indicate that an I/O or other error occurred.
-If it is set the
-.I b_error
-byte of the buffer header may contain an error code
-if it is non-zero.
-If
-.I b_error
-is 0 the nature of the error is not specified.
-Actually no driver at present sets
-.I b_error;
-the latter is provided for a future improvement
-whereby a more detailed error-reporting
-scheme may be implemented.
-.IP B_BUSY 10
-This bit indicates that the buffer header is not on
-the free list, i.e. is
-dedicated to someone's exclusive use.
-The buffer still remains attached to the list of
-blocks associated with its device, however.
-When
-.I getblk
-(or
-.I bread,
-which calls it) searches the buffer list
-for a given device and finds the requested
-block with this bit on, it sleeps until the bit
-clears.
-.IP B_PHYS 10
-This bit is set for raw I/O transactions that
-need to allocate the Unibus map on an 11/70.
-.IP B_MAP 10
-This bit is set on buffers that have the Unibus map allocated,
-so that the
-.I iodone
-routine knows to deallocate the map.
-.IP B_WANTED 10
-This flag is used in conjunction with the
-.I B_BUSY
-bit.
-Before sleeping as described
-just above,
-.I getblk
-sets this flag.
-Conversely, when the block is freed and the busy bit
-goes down (in
-.I brelse)
-a
-.I wakeup
-is given for the block header whenever
-.I B_WANTED
-is on.
-This strategem avoids the overhead
-of having to call
-.I wakeup
-every time a buffer is freed on the chance that someone
-might want it.
-.IP B_AGE
-This bit may be set on buffers just before releasing them; if it
-is on,
-the buffer is placed at the head of the free list, rather than at the
-tail.
-It is a performance heuristic
-used when the caller judges that the same block will not soon be used again.
-.IP B_ASYNC 10
-This bit is set by
-.I bawrite
-to indicate to the appropriate device driver
-that the buffer should be released when the
-write has been finished, usually at interrupt time.
-The difference between
-.I bwrite
-and
-.I bawrite
-is that the former starts I/O, waits until it is done, and
-frees the buffer.
-The latter merely sets this bit and starts I/O.
-The bit indicates that
-.I relse
-should be called for the buffer on completion.
-.IP B_DELWRI 10
-This bit is set by
-.I bdwrite
-before releasing the buffer.
-When
-.I getblk,
-while searching for a free block,
-discovers the bit is 1 in a buffer it would otherwise grab,
-it causes the block to be written out before reusing it.
-.SH
-Block Device Drivers
-.PP
-The
-.I bdevsw
-table contains the names of the interface routines
-and that of a table for each block device.
-.PP
-Just as for character devices, block device drivers may supply
-an
-.I open
-and a
-.I close
-routine
-called respectively on each open and on the final close
-of the device.
-Instead of separate read and write routines,
-each block device driver has a
-.I strategy
-routine which is called with a pointer to a buffer
-header as argument.
-As discussed, the buffer header contains
-a read/write flag, the core address,
-the block number, a (negative) word count,
-and the major and minor device number.
-The role of the strategy routine
-is to carry out the operation as requested by the
-information in the buffer header.
-When the transaction is complete the
-.I B_DONE
-(and possibly the
-.I B_ERROR)
-bits should be set.
-Then if the
-.I B_ASYNC
-bit is set,
-.I brelse
-should be called;
-otherwise,
-.I wakeup.
-In cases where the device
-is capable, under error-free operation,
-of transferring fewer words than requested,
-the device's word-count register should be placed
-in the residual count slot of
-the buffer header;
-otherwise, the residual count should be set to 0.
-This particular mechanism is really for the benefit
-of the magtape driver;
-when reading this device
-records shorter than requested are quite normal,
-and the user should be told the actual length of the record.
-.PP
-Although the most usual argument
-to the strategy routines
-is a genuine buffer header allocated as discussed above,
-all that is actually required
-is that the argument be a pointer to a place containing the
-appropriate information.
-For example the
-.I swap
-routine, which manages movement
-of core images to and from the swapping device,
-uses the strategy routine
-for this device.
-Care has to be taken that
-no extraneous bits get turned on in the
-flag word.
-.PP
-The device's table specified by
-.I bdevsw
-has a
-byte to contain an active flag and an error count,
-a pair of links which constitute the
-head of the chain of buffers for the device
-.I "(b_forw, b_back),"
-and a first and last pointer for a device queue.
-Of these things, all are used solely by the device driver
-itself
-except for the buffer-chain pointers.
-Typically the flag encodes the state of the
-device, and is used at a minimum to
-indicate that the device is currently engaged in
-transferring information and no new command should be issued.
-The error count is useful for counting retries
-when errors occur.
-The device queue is used to remember stacked requests;
-in the simplest case it may be maintained as a first-in
-first-out list.
-Since buffers which have been handed over to
-the strategy routines are never
-on the list of free buffers,
-the pointers in the buffer which maintain the free list
-.I "(av_forw, av_back)"
-are also used to contain the pointers
-which maintain the device queues.
-.PP
-A couple of routines
-are provided which are useful to block device drivers.
-.I "iodone(bp)"
-arranges that the buffer to which
-.I bp
-points be released or awakened,
-as appropriate,
-when the
-strategy module has finished with the buffer,
-either normally or after an error.
-(In the latter case the
-.I B_ERROR
-bit has presumably been set.)
-.PP
-The routine
-.I "geterror(bp)"
-can be used to examine the error bit in a buffer header
-and arrange that any error indication found therein is
-reflected to the user.
-It may be called only in the non-interrupt
-part of a driver when I/O has completed
-.I (B_DONE
-has been set).
-.SH
-Raw Block-device I/O
-.PP
-A scheme has been set up whereby block device drivers may
-provide the ability to transfer information
-directly between the user's core image and the device
-without the use of buffers and in blocks as large as
-the caller requests.
-The method involves setting up a character-type special file
-corresponding to the raw device
-and providing
-.I read
-and
-.I write
-routines which set up what is usually a private,
-non-shared buffer header with the appropriate information
-and call the device's strategy routine.
-If desired, separate
-.I open
-and
-.I close
-routines may be provided but this is usually unnecessary.
-A special-function routine might come in handy, especially for
-magtape.
-.PP
-A great deal of work has to be done to generate the
-``appropriate information''
-to put in the argument buffer for
-the strategy module;
-the worst part is to map relocated user addresses to physical addresses.
-Most of this work is done by
-.I "physio(strat, bp, dev, rw)
-whose arguments are the name of the
-strategy routine
-.I strat,
-the buffer pointer
-.I bp,
-the device number
-.I dev,
-and a read-write flag
-.I rw
-whose value is either
-.I B_READ
-or
-.I B_WRITE.
-.I Physio
-makes sure that the user's base address and count are
-even (because most devices work in words)
-and that the core area affected is contiguous
-in physical space;
-it delays until the buffer is not busy, and makes it
-busy while the operation is in progress;
-and it sets up user error return information.
diff --git a/.ref-Research-V7/usr/doc/learn/p0 b/.ref-Research-V7/usr/doc/learn/p0
deleted file mode 100644 (file)
index 9e7dc87..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-.RP
-.TM "79-1274-xx 79-1273-yy" 39199 39199-11
-....ND June 18, 1976
-....TM "76-1274-6 76-1273-5" 39199 39199-11
-.TL
-LEARN \(em Computer-Aided Instruction on UNIX
-.br
-(Second Edition)
-.AU "MH 2C-518" 6021
-Brian W. Kernighan
-.AU "MH 2C-569" 6377
-Michael E. Lesk
-.AI
-.MH
-.OK
-CAI
-.AB
-.PP
-This paper describes the
-second version of the
-.I
-learn
-.R
-program for interpreting CAI
-scripts on
-the
-.UX 
-operating system,
-and a set of scripts that provide a computerized introduction
-to the system.
-.PP
-Six current scripts cover basic commands and file
-handling, the editor, additional file handling commands, the
-.I
-eqn
-.R
-program for mathematical
-typing,
-the ``\-ms'' package of formatting macros,
-and an introduction to the C programming language.
-These scripts now include a total of
-about 530 lessons.
-.PP
-Many users from a wide variety of backgrounds have used
-.I learn
-to acquire basic UNIX skills.
-Most usage involves the first two scripts,
-an introduction to
-.UX
-files and commands, and
-the
-.UX
-editor.
-.PP
-The second version of
-.I learn
-is about four times faster than the previous one
-in CPU utilization,
-and much faster in perceived time
-because of better overlap of computing and printing.
-It also requires less file space than the first version.
-Many of the lessons have been revised;
-new material has been added to reflect changes
-and enhancements in 
-.UX
-itself.
-Script-writing is also easier
-because of revisions to the script language.
-.AE
-.CS 11 2 13 4 0 0
diff --git a/.ref-Research-V7/usr/doc/learn/p2 b/.ref-Research-V7/usr/doc/learn/p2
deleted file mode 100644 (file)
index 4888a8c..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-.NH
-Educational Assumptions and Design.
-.PP
-First, the way to teach people how to do something
-is to have them do it.  Scripts should
-not contain long pieces of explanation; they should
-instead frequently ask the student to do some task.
-So teaching is always by example: the typical
-script fragment shows a small example of some
-technique and then asks the
-user to either repeat that example or
-produce a variation on it.
-All are intended to be easy enough that most students will get most questions
-right, reinforcing the desired behavior.
-.PP
-Most lessons fall into one of three types.
-The simplest presents a lesson and asks for a yes or no
-answer to a question.
-The student is given a chance to experiment before replying.
-The script checks for the correct reply.
-Problems of this form are sparingly used.
-.PP
-The second type asks for a word or number as an answer.
-For example a lesson on files might say
-.IP
-.I
-How many files are there in the current directory?
-Type ``answer N'', where N is the number of files.
-.R
-.LP
-The student is expected to respond (perhaps after experimenting) with
-.LP
-.I
-       answer 17
-.R
-.LP
-or whatever.
-Surprisingly often, however, the idea of a substitutable argument
-(i.e., replacing
-.I
-N
-.R
-by
-17)
-is difficult for non-programmer students,
-so the first few such lessons need real care.
-.PP
-The third type of lesson is open-ended \(em
-a task is set for the student,
-appropriate parts of the input or output are monitored,
-and the student types 
-.ul
-ready
-when the task is done.
-Figure 1 shows a sample dialog that illustrates the last of these, using two
-lessons about the
-.I cat
-(concatenate, i.e., print) command taken
-from early in the script that teaches
-file handling.
-Most
-.I learn
-lessons are of this form.
-.KF
-.TS
-box, center;
-c.
-T{
-Figure 1:  Sample dialog from basic files script
-.sp
-(Student responses
-in italics; `$' is the prompt)
-.nf
-.sp
-A file can be printed on your terminal
-by using the "cat" command.  Just say
-"cat file" where "file" is the file name.
-For example, there is a file named
-"food" in this directory.  List it
-by saying "cat food"; then type "ready".
-$ \fIcat food\fR
-  this is the file
-  named food.
-$ \fIready\fR
-
-Good.  Lesson 3.3a (1)
-
-Of course, you can print any file with "cat".
-In particular, it is common to first use
-"ls" to find the name of a file and then "cat"
-to print it.  Note the difference between
-"ls", which tells you the name of the file,
-and "cat", which tells you the contents.
-One file in the current directory is named for
-a President.  Print the file, then type "ready".
-$ \fIcat President\fR
-cat: can't open President
-$ \fIready\fR
-
-Sorry, that's not right.  Do you want to try again? \fIyes\fR
-Try the problem again.
-$ \fIls\fR
-\&.ocopy
-X1
-roosevelt
-$ \fIcat roosevelt\fR
-  this file is named roosevelt
-  and contains three lines of
-  text.
-$ \fIready\fR
-
-Good.  Lesson 3.3b (0)
-
-The "cat" command can also print several files
-at once.  In fact, it is named "cat" as an abbreviation
-for "concatenate"....
-.fi
-T}
-.TE
-.sp
-.KE
-.PP
-After each correct response the computer congratulates
-the student and indicates the lesson number that
-has just been completed, permitting the student
-to restart the script after that lesson.
-If the answer is wrong, the student
-is offered a chance to repeat the lesson.
-The ``speed'' rating of the student (explained in
-section 5) is given after the lesson number when the lesson is completed successfully; it is
-printed only for the aid of script authors checking
-out possible errors in the lessons.
-.br
-.PP
-It is assumed that there is no foolproof way
-to determine if the student truly ``understands''
-what he or she is doing;
-accordingly,
-the current
-.I
-learn
-.R
-scripts
-only measure performance, not comprehension.
-If the student can perform a given task, that is deemed to be ``learning.''
-.[
-skinner teaching 1961
-.]
-.PP
-The main point of using the computer is that what the student
-does is checked for correctness immediately.
-Unlike many CAI scripts, however, these scripts provide
-few facilities for dealing with wrong answers.
-In practice, if most of the answers are not right the script is
-a failure; the universal solution to student error is to provide
-a new, easier script.
-Anticipating possible wrong answers is an endless job, and it is really
-easier as well as better to provide a simpler script.
-.PP
-Along with this goes the assumption that
-anything can be taught to anybody if it can
-be broken into sufficiently small pieces.  Anything
-not absorbed in a single chunk is just subdivided.
-.PP
-To avoid boring the faster students,
-however,
-an effort is made in the files and editor scripts to provide
-three tracks of different difficulty.
-The fastest sequence of lessons
-is aimed at roughly the bulk and speed of a typical tutorial
-manual and should be adequate for review and for
-well-prepared students.
-The next track is intended for most users and is roughly
-twice as long.  Typically, for example, the fast track
-might present an idea and ask for a variation on the
-example shown; the normal track will first
-ask the student to repeat the example that was shown
-before attempting a variation.
-The third and slowest track, which is often
-three or four times the length of the fast track,
-is intended to be adequate for anyone.
-(The lessons of Figure 1 are from the third track.)
-The multiple tracks also mean that a student repeating a course is unlikely
-to hit the same series of lessons; this makes it profitable for a shaky
-user to back up and try again, and many students have done so.
-.PP
-The tracks are not completely distinct, however.
-Depending on the number of correct answers the student has given for the
-last few lessons, the program may switch tracks.
-The driver is actually capable of following
-an arbitrary directed graph of lesson sequences, as discussed in section 5.
-Some more structured arrangement, however, is used in all current scripts
-to aid the script writer in organizing the material into lessons.
-It is sufficiently difficult
-to write lessons
-that the three-track theory
-is not followed very closely
-except in
-the files and editor scripts.
-Accordingly,
-in some cases, the fast track is produced merely by skipping
-lessons from the slower track.
-In others, there is essentially only one track.
-.PP
-The main reason for using the
-.I
-learn
-.R
-program rather than
-simply writing the same material as a workbook
-is not the selection of tracks, but
-actual hands-on experience.
-Learning by doing
-is much more effective
-than pencil and paper exercises.
-.PP
-.I Learn
-also provides a mechanical check on performance.
-The first version in fact would not let
-the student proceed unless it
-received correct answers to the questions
-it set and it would not tell a student the right answer.
-This somewhat Draconian approach has been moderated
-in version 2.
-Lessons are sometimes badly worded or even just plain wrong;
-in such cases,
-the student has no recourse.
-But if a student is simply unable to complete one lesson,
-that should not prevent access to the rest.
-Accordingly, the current version of
-.I learn
-allows the student to skip
-a lesson that he cannot pass;
-a ``no'' answer to the ``Do you want to try again?''
-question in Figure 1 will pass to the next lesson.
-It is still true that 
-.I learn
-will not tell the student the right answer.
-.PP
-Of course, there are valid objections to the
-assumptions above.
-In particular, some students may object to
-not understanding
-what they are doing;
-and the procedure of smashing everything into small pieces may provoke
-the retort ``you can't cross a ditch in two jumps.''
-Since writing CAI scripts is considerably
-more tedious than ordinary manuals, however, it is safe
-to assume that there will always be alternatives to the
-scripts as a way of learning.
-In fact, for a reference manual of 3 or 4 pages it would
-not be surprising to have a tutorial manual of 20 pages
-and a (multi-track) script of 100 pages.  Thus the reference manual
-will exist long before the scripts.
diff --git a/.ref-Research-V7/usr/doc/learn/p3 b/.ref-Research-V7/usr/doc/learn/p3
deleted file mode 100644 (file)
index 7ee9344..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-.NH
-Scripts.
-.PP
-As mentioned above, the present scripts try
-at most
-to follow a three-track theory.  Thus little
-of the potential complexity of the possible directed graph
-is employed, since
-care must be taken in lesson construction to see
-that every necessary fact is presented in
-every possible path through the units.  In addition,
-it is desirable that every unit have alternate successors
-to deal with student errors.
-.PP
-In most existing courses, the first few lessons
-are devoted to checking prerequisites.  For example,
-before the student is allowed to proceed through the editor
-script the script verifies that the student understands files
-and is able to type.
-It is felt that the sooner lack of student preparation
-is detected, the easier it will be on the student.
-Anyone proceeding through the scripts
-should be getting mostly correct answers; otherwise, the
-system will be unsatisfactory both because the wrong
-habits are being learned and because the
-scripts make little effort to deal with wrong answers.
-Unprepared students should not be encouraged
-to continue with scripts.
-.PP
-There are some preliminary items which the student must
-know before any scripts can be tried.  In particular,
-the student must know how to connect to
-a
-.UX
-system,
-set the terminal properly,
-log in,
-and execute simple commands (e.g.,
-.ul
-learn
-itself).
-In addition, the character erase and line kill conventions
-(# and @) should be known.
-It is hard to see how this much could be taught by
-computer-aided instruction, since a student who
-does not know these basic skills will not be able
-to run the learning program.
-A brief description on paper is provided (see Appendix A), although
-assistance will be needed for the first few
-minutes.  This assistance, however, need not be highly skilled.
-.PP
-The first script in the current set deals with files.  It assumes
-the basic knowledge above and teaches the student about
-the
-.I ls ,
-.I cat ,
-.I mv ,
-.I rm ,
-.I cp
-and
-.I diff
-commands.
-.tr ~
-It also deals with the abbreviation characters *, ?, and [\ ]
-in file names.
-It does not cover pipes or I/O redirection,
-nor does it present the many options
-on the
-.ul
-ls
-command.
-.PP
-This script contains 31 lessons
-in the fast track;
-two are
-intended as prerequisite checks,
-seven are review exercises.
-There are a total of 75 lessons in all three tracks,
-and the instructional passages typed at the student
-to begin each lesson total 4,476 words.  The average
-lesson thus begins with a 60-word message.
-In general, the fast track lessons have somewhat longer
-introductions, and the slow tracks somewhat shorter ones.
-The longest message is 144 words and the shortest 14.
-.PP
-The second script trains students in the use
-of the
-.UX
-context editor
-.I ed ,
-a sophisticated editor
-using regular expressions for searching.
-.[
-ritchie thompson unix  seventh edition 1978
-%O See section \f2ed\f1 (I).
-.]
-All editor
-features except encryption, mark names and `;' in addressing
-are covered.
-The fast track contains 2 prerequisite checks,
-93 lessons, and a review lesson.
-It is supplemented by 146 additional lessons in other tracks.
-.PP
-A comparison of sizes may be of interest.  The
-.ul
-ed
-description
-in the reference manual is 2,572 words long.  The
-.ul
-ed
-tutorial
-.[
-kernighan editor tutorial 1974
-.]
-is 6,138 words long.  
-The fast track through
-the
-.ul
-ed
-script is 7,407 words of explanatory messages, and the
-total
-.ul
-ed
-script, 242 lessons, 
-has 15,615 words.
-The average
-.ul
-ed
-lesson is thus also about 60 words; the largest
-is 171 words and the smallest 10.
-The
-original
-.ul
-ed
-script represents about three man-weeks of effort.
-.PP
-The advanced file handling script deals with
-.ul
-ls
-options,
-I/O diversion, pipes, and supporting programs like
-.I pr ,
-.I wc ,
-.I tail ,
-.I spell
-and
-.I grep .
-(The basic file handling script is a prerequisite.)
-It is not as refined as the first two scripts;
-this is reflected at least partly in the fact that
-it provides much less of a full three-track sequence
-than they do.
-On the other hand,
-since it is perceived as ``advanced,''
-it is hoped that the student will have somewhat
-more sophistication
-and be better able to cope with it at a reasonably
-high level of performance.
-.PP
-A fourth script covers the
-.ul
-eqn
-language for typing mathematics.
-This script must be run on a terminal capable of printing
-mathematics, for instance the DASI 300 and similar Diablo-based
-terminals, or the nearly extinct Model 37 teletype.
-Again, this script is relatively short of tracks:
-of 76 lessons, only 17 are in the second track and 2
-in the third track.
-Most of these provide additional practice for students
-who are having trouble in the first track.
-.PP
-The
-.I \-ms
-script for formatting macros
-is a short one-track only script.
-The macro package it describes is no longer the standard,
-so this script will undoubtedly be superseded
-in the future.
-Furthermore, the linear style of a single learn script is somewhat
-inappropriate for the macros, since the macro package is composed of many
-independent features, and few users need all of them.
-It would be better to have a selection of short lesson
-sequences dealing with the features independently.
-.PP
-The script on C is in a state of transition.
-It was originally designed to follow
-a tutorial on C,
-but that document has since become obsolete.
-The current script has been partially converted
-to follow the order of presentation in
-.ul
-The C Programming Language,
-.[
-ritchie kernighan programming 1978 prentice hall
-.]
-but this job is not complete.
-The C script was never intended to teach C;
-rather it is supposed to be a series of exercises
-for which the computer provides checking and
-(upon success) a suggested solution.
-.PP
-This combination of scripts covers much of the material which any
-.UX
-user
-will need to know
-to make effective use of the system.
-With enlargement of the advanced files
-course to include more on the command interpreter, there
-will be a relatively complete introduction to
-.UX
-available via
-.ul
-learn.
-Although we make no pretense that 
-.ul
-learn
-will replace other instructional materials,
-it should provide a useful supplement to existing tutorials and reference manuals.
diff --git a/.ref-Research-V7/usr/doc/learn/p4 b/.ref-Research-V7/usr/doc/learn/p4
deleted file mode 100644 (file)
index 5b4673b..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-.NH
-Experience with Students.
-.PP
-.I
-Learn
-.R
-has been installed on
-many different 
-.UX
-systems.
-Most of the usage is on the first two scripts, so these
-are more thoroughly debugged and polished.
-As a (random) sample of user experience,
-the
-.I learn
-program has been used at Bell Labs at Indian Hill
-for 10,500 lessons in a four month period.
-About 3600 of these are in the files script,
-4100 in the editor,
-and 1400 in advanced files.
-The passing rate is about 80%,
-that is, about 4 lessons are passed for every one
-failed.
-There have been 86 distinct users of the files script,
-and 58 of the editor.
-On our system at Murray Hill, there have been nearly 2000 lessons
-over two weeks that include
-Christmas and New Year.
-Users have ranged in age from six up.
-.PP
-It is difficult to characterize typical sessions with the
-scripts;
-many instances exist of someone doing one or two lessons
-and then logging out, as do instances of someone pausing
-in a script for twenty minutes or more.
-In the earlier version of
-.I learn ,
-the average session in the files course took 32 minutes and covered
-23 lessons.
-The distribution is quite
-broad and skewed, however; the longest session was
-130 minutes and there were five sessions shorter than
-five minutes.
-The average lesson took about 80 seconds.
-These numbers are roughly typical for non-programmers;
-a
-.UX
-expert can do the scripts at approximately 30 seconds
-per lesson, most of which is the system printing.
-.PP
-At present working through a section of the middle of the files
-script took about 1.4 seconds of processor time per lesson,
-and a system expert typing quickly took 15 seconds of real time per lesson.
-A novice would probably take at least a minute.
-Thus a UNIX system could support ten students working simultaneously
-with some spare capacity.
diff --git a/.ref-Research-V7/usr/doc/learn/p5 b/.ref-Research-V7/usr/doc/learn/p5
deleted file mode 100644 (file)
index addc79e..0000000
+++ /dev/null
@@ -1,585 +0,0 @@
-.NH
-The Script Interpreter.
-.PP
-The
-.I
-learn
-.R
-program itself merely interprets scripts.  It provides
-facilities for the script writer to capture student
-responses and their effects, and simplifies the job
-of passing control to and recovering control from the student.
-This section describes the operation and
-usage of the driver program,
-and indicates what is
-required to produce a new script.
-Readers only interested in
-the existing scripts may skip this section.
-.PP
-The file structure used by
-.I learn
-is shown in Figure 2.
-There is one parent directory (named \f2lib\f1\^) containing the script data.
-Within this directory are subdirectories, one for each
-subject in which a course is available,
-one for logging (named
-.I log ),
-and one in which user sub-directories
-are created (named
-.I play ).
-The subject directory contains master copies of all lessons,
-plus any supporting material for that subject.
-In a given subdirectory,
-each lesson is a single text file.
-Lessons are usually named systematically;
-the file that contains lesson
-.I n
-is called
-.I Ln .
-.br
-.KF
-.sp
-.TS
-center, box;
-c s s s
-l l l l.
-Figure 2:  Directory structure for \fIlearn\fR
-.sp
-.nf
-lib
-.if t .sp .5
-       play
-               student1
-                       files for student1...
-               student2
-                       files for student2...
-.if t .sp .5
-       files
-               L0.1a   lessons for files course
-               L0.1b
-               ...
-.if t .sp .5
-       editor
-               ...
-.if t .sp .5
-       (other courses)
-.if t .sp .5
-       log
-.TE
-.sp
-.KE
-.PP
-When
-.I
-learn
-.R
-is executed, it makes a private directory
-for the user to work in,
-within the
-.I
-learn
-.R
-portion of the file system.
-A fresh copy of all the files used in each lesson
-(mostly data for the student to operate upon) is made each
-time a student starts a lesson,
-so the script writer may assume that everything
-is reinitialized each time a lesson is entered.
-The student directory is deleted after each session; any permanent records
-must be kept elsewhere.
-.PP
-The script writer must provide certain basic items
-in each
-lesson:
-.IP (1)
-the text of the lesson;
-.IP (2)
-the set-up commands to be executed before the user gets control;
-.IP (3)
-the data, if any, which the user is supposed to edit, transform, or otherwise
-process;
-.IP (4)
-the evaluating commands to be executed after the user
-has finished the lesson, to decide whether the answer is right;
-and
-.IP (5)
-a list of possible successor lessons.
-.LP
-.I
-Learn
-.R
-tries to minimize the work
-of bookkeeping and installation, so
-that most of the effort involved in
-script production is in planning lessons,
-writing tutorial paragraphs,
-and coding tests of student performance.
-.PP
-The basic sequence of events is
-as follows.
-First,
-.I learn
-creates the working directory.
-Then, for each lesson,
-.I learn
-reads the script for the lesson and processes
-it a line at a time.
-The lines in the script are:
-(1) commands to the script interpreter
-to print something, to create a files,
-to test something, etc.;
-(2) text to be printed or put in a file;
-(3) other lines, which are sent to
-the shell to be executed.
-One line in each lesson turns control over
-to the user;
-the user can run any 
-.UX 
-commands.
-The user mode terminates when the user
-types 
-.I yes ,
-.I no ,
-.I ready ,
-or
-.I answer .
-At this point, the user's work is tested;
-if the lesson is passed,
-a new lesson is selected, and if not
-the old one is repeated.
-.PP
-Let us illustrate this with the script
-for the second lesson of Figure 1;
-this is shown in Figure 3.
-.KF
-.sp
-.TS
-center, box;
-c.
-T{
-Figure 3:  Sample Lesson
-.sp
-.nf
-#print
-Of course, you can print any file with "cat".
-In particular, it is common to first use
-"ls" to find the name of a file and then "cat"
-to print it.  Note the difference between
-"ls", which tells you the name of the files,
-and "cat", which tells you the contents.
-One file in the current directory is named for
-a President.  Print the file, then type "ready".
-#create roosevelt
-  this file is named roosevelt
-  and contains three lines of
-  text.
-#copyout
-#user
-#uncopyout
-tail \-3 .ocopy >X1
-#cmp X1 roosevelt
-#log
-#next
-3.2b 2
-.fi
-T}
-.TE
-.sp
-.KE
-.LP
-Lines which begin with
-# are commands to the
-.I  learn 
-script interpreter.
-For example,
-.LP
-.ul
-       #print
-.LP
-causes printing of any text that follows,
-up to the next line that begins with a sharp.
-.LP
-.ul
-       #print file
-.LP
-prints the contents of
-.I file ;
-it
-is the same as
-.ul
-cat file 
-but has
-less overhead.
-Both forms of
-.I #print
-have the added property that if a lesson is failed,
-the
-.ul
-#print
-will not be executed the second time through;
-this avoids annoying the student by repeating the preamble
-to a lesson.
-.LP
-.ul
-       #create filename
-.LP
-creates a file of the specified name,
-and copies any subsequent text up to a
-# to the file.
-This is used for creating and initializing working files
-and reference data for the lessons.
-.LP
-.ul
-       #user
-.LP
-gives control to the student;
-each line he or she types is passed to the shell
-for execution.
-The
-.I #user
-mode
-is terminated when the student types one of
-.I yes ,
-.I no ,
-.I ready 
-or
-.I answer .
-At that time, the driver
-resumes interpretation of the script.
-.LP
-.ul
-       #copyin
-.br
-.ul
-       #uncopyin
-.LP
-Anything the student types between these
-commands is copied onto a file
-called
-.ul
-\&.copy.
-This lets the script writer interrogate the student's
-responses upon regaining control.
-.LP
-.ul
-       #copyout
-.br
-.ul
-       #uncopyout
-.LP
-Between these commands, any material typed at the student
-by any program
-is copied to the file
-.ul
-\&.ocopy.
-This lets the script writer interrogate the
-effect of what the student typed, 
-which true believers in the performance theory of learning
-usually
-prefer to the student's actual input.
-.LP
-.ul
-       #pipe
-.br
-.ul
-       #unpipe
-.LP
-Normally the student input and the script commands
-are fed to the
-.UX
-command interpreter (the ``shell'') one line at a time. This won't do
-if, for example, a sequence of editor commands
-is provided,
-since the input to the editor must be handed to the editor,
-not to the shell.
-Accordingly, the material between 
-.ul
-#pipe
-and
-.ul
-#unpipe
-commands
-is fed
-continuously through a pipe so that such sequences
-work.
-If
-.ul
-copyout
-is also desired
-the
-.ul
-copyout
-brackets must include
-the
-.ul
-pipe
-brackets.
-.PP
-There are several commands for setting status
-after the student has attempted the lesson.
-.LP
-.ul
-       #cmp file1 file2
-.LP
-is an in-line implementation of
-.I cmp ,
-which compares two files for identity.
-.LP
-.ul
-       #match stuff
-.LP
-The last line of the student's input
-is compared to
-.I stuff ,
-and the success or fail status is set
-according to it.
-Extraneous things like the word
-.I answer
-are stripped before the comparison is made.
-There may be several 
-.I #match
-lines;
-this provides a convenient mechanism for handling multiple
-``right'' answers.
-Any text up to a
-# on subsequent lines after a successful
-.I #match
-is printed; 
-this is illustrated in Figure 4, another sample lesson.
-.br
-.KF
-.sp
-.TS
-center, box;
-c.
-T{
-Figure 4:  Another Sample Lesson
-.sp
-.nf
-#print
-What command will move the current line
-to the end of the file?  Type 
-"answer COMMAND", where COMMAND is the command.
-#copyin
-#user
-#uncopyin
-#match m$
-#match .m$
-"m$" is easier.
-#log
-#next
-63.1d 10
-T}
-.TE
-.sp
-.KE
-.LP
-.ul
-       #bad stuff
-.LP
-This is similar to
-.I #match ,
-except that it corresponds to specific failure answers;
-this can be used to produce hints for particular wrong answers
-that have been anticipated by the script writer.
-.LP
-.ul
-       #succeed
-.br
-.ul
-       #fail
-.LP
-print a message
-upon success or failure
-(as determined by some previous mechanism).
-.PP
-When the student types
-one of the ``commands''
-.I yes ,
-.I no ,
-.I ready ,
-or
-.I answer ,
-the driver terminates the
-.I #user
-command,
-and evaluation of the student's work can begin.
-This can be done either by
-the built-in commands above, such as
-.I #match
-and
-.I #cmp ,
-or by status returned by normal
-.UX 
-commands, typically
-.I grep
-and
-.I test .
-The last command
-should return status true
-(0) if the task was done successfully and
-false (non-zero) otherwise;
-this status return tells the driver
-whether or not the student
-has successfully passed the lesson.
-.PP
-Performance can be logged:
-.LP
-.ul
-       #log file
-.LP
-writes the date, lesson, user name and speed rating, and
-a success/failure indication on
-.ul
-file.
-The command
-.LP
-.ul
-       #log
-.LP
-by itself writes the logging information
-in the logging directory
-within the
-.I learn
-hierarchy,
-and is the normal form.
-.LP
-.ul
-       #next
-.LP
-is followed by a few lines, each with a successor
-lesson name and an optional speed rating on it.
-A typical set might read
-.LP
-.nf
-       25.1a   10
-       25.2a   5
-       25.3a   2
-.fi
-.LP
-indicating that unit 25.1a is a suitable follow-on lesson
-for students with
-a speed rating of 10 units,
-25.2a for student with speed near 5,
-and 25.3a for speed near 2.
-Speed ratings are maintained for
-each session with a student; the
-rating is increased by one each tiee
-the student gets a lesson right and decreased
-by four each
-time the student gets a lesson wrong.
-Thus the driver tries to maintain a devel such
-that the users get 80% right answers.
-The maximum rating is limited to 10 afd the minimum to 0.
-The initial rating is zero unless the studeft
-specifies a differeft rating when starting
-a session.
-.PP
-If the student passes a lesson,
-a new lesson is sedected and the process repeats.
-If the student fails, a false status is returned
-and the program
-reverts to the previous lesson and tries
-another alternative.
-If it can not find another alternative, it skips forward
-a lesson.
-.I bye ,
-bye,
-which causes a graceful exit
-from the 
-.ul
-learn
-system.  Hanging up is the usual novice's way out.
-.PP
-The lessons may form an arbitrary directed graph,
-although the present program imposes a limitation on cycles in that
-it will not present a lesson twice in the
-same session.
-If the student is unable to answer one of the exercises
-correctly, the driver searches for a previous lesson
-with a set of alternatives as successors
-(following the
-.I #next
-line).
-From the previous lesson with alternatives one route was taken
-earlier; the program simply tries a different one.
-.PP
-It is perfectly possible
-to write sophisticated scripts that evaluate
-the student's speed of response, or try to estimate the
-elegance of the answer, or provide detailed
-analysis of wrong answers.
-Lesson writing is so tedious already, however, that most
-of these abilities are likely to go unused.
-.PP
-The driver program depends heavily on features
-of
-.UX
-that are not available on many other operating systems.
-These include
-the ease of manipulating files and directories,
-file redirection,
-the ability to use the command interpreter
-as just another program (even in a pipeline),
-command status testing and branching,
-the ability to catch signals like interrupts,
-and of course
-the pipeline mechanism itself.
-Although some parts of 
-.ul
-learn
-might be transferable to other systems,
-some generality will probably be lost.
-.PP
-A bit of history:
-The first version of
-.I learn
-had fewer built-in words
-in the driver program,
-and made more use of the
-facilities of
-.UX .
-For example,
-file comparison was done by creating a
-.I cmp
-process,
-rather than comparing the two files within
-.I learn .
-Lessons were not stored as text files,
-but as archives.
-There was no concept of the in-line document;
-even 
-.I #print
-had to be followed by a file name.
-Thus the initialization for each lesson
-was to extract the archive into the working directory
-(typically 4-8 files),
-then 
-.I #print
-the lesson text.
-.PP
-The combination of such things made
-.I learn
-slower.
-The new version is about 4 or 5 times faster.
-Furthermore, it appears even faster to the user
-because in a typical lesson,
-the printing of the message comes first,
-and file setup with
-.I #create
-can be overlapped with the printng,
-so that when the program
-finishes printing,
-it is really ready for the user
-to type at it.
-.PP
-It is also a great advantage to the script maintainer
-that lessons are now just ordinary text files.
-They can be edited without any difficulty,
-and  
-.UX
-text manipulation tools can be applied
-to them.
-The result has been that
-there is much less resistance
-to going in and fixing substandard lessons.
diff --git a/.ref-Research-V7/usr/doc/learn/p6 b/.ref-Research-V7/usr/doc/learn/p6
deleted file mode 100644 (file)
index 370d17a..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-.NH
-Conclusions
-.PP
-The following observations can be made about
-secretaries, typists, and
-other non-programmers who have used
-.I learn :
-.IP (a)
-A novice must have assistance with the mechanics
-of communicating with the computer to get through to
-the first lesson or two;
-once the first few lessons are passed people can proceed
-on their own.
-.IP (b)
-The terminology used in the first few lessons
-is obscure to those inexperienced with computers.
-It would help if there were a low level
-reference card for
-.UX
-to supplement the existing
-programmer oriented bulky manual and bulky reference card.
-.IP (c)
-The concept of ``substitutable argument'' is hard
-to grasp, and requires help.
-.IP (d)
-They enjoy the system for the most part.
-Motivation matters a great deal, however.
-.LP
-It takes an hour or two for a novice to get through
-the script on file handling.
-The total time for a reasonably intelligent and motivated novice to proceed from ignorance
-to a reasonable ability to create new files and manipulate old ones
-seems to be a few days, with perhaps half of each day
-spent on the machine.
-.PP
-The normal way of proceeding has been to have students in the same
-room with someone who knows
-.UX
-and the scripts.
-Thus the student is not brought to a halt by
-difficult questions.  The burden on the counselor, however,
-is much lower than that on a teacher of a course.
-Ideally, the students should be encouraged to proceed with instruction
-immediately prior to their actual use of the computer.
-They should exercise the scripts on the same computer and the same
-kind of terminal that they will later use
-for their real work, and
-their first few jobs for the computer should be
-relatively easy ones.
-Also, both training and initial work should take place on days
-when the
-.UX
-hardware and software
-are working reliably.
-Rarely is all of this possible, but the closer one comes the better
-the result.
-For example, if it is known that the hardware is shaky one day, it is better
-to attempt to reschedule training for another one.  Students are very
-frustrated by machine downtime; when nothing is happening, it takes
-some sophistication and experience to distinguish
-an infinite loop, a slow but functioning program,
-a program waiting for the user, and a broken machine.*
-.FS
-* We have even known an expert programmer to decide the computer
-was broken when he had simply left his terminal in local mode.
-Novices have great difficulties with such problems.
-.FE
-.PP
-One disadvantage
-of training with
-.I
-learn
-.R
-is that students come to depend
-completely on the CAI system, and do not try
-to read manuals or use other learning aids.
-This is unfortunate, not only because of the increased
-demands for completeness and accuracy of the
-scripts, but because the scripts do not cover all of
-the
-.UX
-system.
-New users should have manuals (appropriate for their level) and
-read them; the scripts ought to be altered
-to recommend suitable documents and urge
-students to read them.
-.PP
-There are several other difficulties which are clearly evident.
-From the student's viewpoint,
-the most serious is that
-lessons still crop up which simply can't be passed.
-Sometimes this is due to poor explanations,
-but just as often it is some error in the lesson itself
-\(em a botched setup, a missing file,
-an invalid test for correctness,
-or some system facility that doesn't work on the local
-system in the same way it did on the development system.
-It takes knowledge and a certain healthy arrogance on the part of the user to recognize
-that the fault is not his or hers,
-but the script writer's.
-Permitting the student to get on with the next lesson
-regardless does alleviate this somewhat,
-and the logging facilities make it easy
-to watch for lessons that no one
-can pass,
-but it is still a problem.
-.PP
-The biggest problem with the previous
-.I learn
-was speed (or lack thereof) \(em
-it was often excruciatingly slow
-and made a significant drain on the system.
-The current version so far does not seem
-to have that difficulty,
-although some scripts,
-notably
-.I eqn ,
-are intrinsically slow.
-.I eqn ,
-for example,
-must do a lot of work even to print its introductions,
-let alone check the student responses,
-but delay is perceptible in all scripts
-from time to time.
-.PP
-Another potential problem is that it is possible
-to break
-.ul
-learn
-inadvertently, by pushing interrupt at the wrong time,
-or by removing critical files,
-or any number of similar slips.
-The defenses against such problems
-have steadily been improved, to the point
-where most students should not notice difficulties.
-Of course, it will always be possible to break
-.I
-learn
-.R
-maliciously, but this is not likely to be a problem.
-.PP
-One area is more fundamental \(em
-some
-.UX
-commands are sufficiently global in their effect
-that
-.ul
-learn
-currently
-does not allow them to be executed at all.
-The most obvious is
-.I cd ,
-which changes to another directory.
-The prospect of a student who is learning about directories
-inadvertently moving to some random directory
-and removing files has deterred us
-from even writing lessons on
-.I cd ,
-but ultimately lessons on such topics probably should be added.
diff --git a/.ref-Research-V7/usr/doc/learn/p7 b/.ref-Research-V7/usr/doc/learn/p7
deleted file mode 100644 (file)
index 3bf87cc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.NH
-Acknowledgments
-.PP
-We are grateful to all those who have tried
-.ul
-learn,
-for we have benefited greatly from their
-suggestions and criticisms.
-In particular,
-M. E. Bittrich,
-J. L. Blue,
-S. I. Feldman,
-P. A. Fox,
-and
-M. J. McAlpin
-have provided substantial feedback.
-Conversations with E. Z. Rothkopf also provided many of the ideas in the system.
-We are also indebted to Don Jackowski
-for serving as a guinea pig for the second version,
-and to Tom Plum for his efforts to improve the C script.
-....SG \s-2MH\s0-1273/4-\s-2MEL/BWK\s0-unix
-.[
-$LIST$
-.]
diff --git a/.ref-Research-V7/usr/doc/lex b/.ref-Research-V7/usr/doc/lex
deleted file mode 100644 (file)
index 02ebb2c..0000000
+++ /dev/null
@@ -1,2310 +0,0 @@
-.hc ~
-.bd I 2
-.de TS
-.br
-.nf
-.SP 1v
-.ul 0
-..
-.de TE
-.SP 1v
-.fi
-..
-.de PT
-.if \\n%>1 'tl ''\s7LEX\s0\s9\(mi%\s0''
-.if \\n%>1 'sp
-..
-.ND July 21, 1975
-.RP
-.TM 75-1274-15 39199 39199-11
-.TL
-Lex \- A Lexical Analyzer ~Generator~
-.AU ``MH 2C-569'' 6377
-M. E. Lesk and E. Schmidt
-.AI
-.MH
-.AB
-.sp
-.bd I 2
-.nr PS 8
-.nr VS 9
-.ps 8
-.vs 9p
-Lex helps write programs whose control flow
-is directed by instances of regular
-expressions in the input stream.
-It is well suited for editor-script type transformations and
-for segmenting input in preparation for
-a parsing routine.
-.PP
-Lex source is a table of regular expressions and corresponding program fragments.
-The table is translated to a program
-which reads an input stream, copying it to an output stream
-and partitioning the input
-into strings which match the given expressions.
-As each such string is recognized the corresponding
-program fragment is executed.
-The recognition of the expressions
-is performed by a deterministic finite automaton
-generated by Lex.
-The program fragments written by the user are executed in the order in which the
-corresponding regular expressions occur in the input stream.
-.if n .if \n(tm .ig
-.PP
-The lexical analysis
-programs written with Lex accept ambiguous specifications
-and choose the longest
-match possible at each input point.
-If necessary, substantial look~ahead
-is performed on the input, but the
-input stream will be backed up to the
-end of the current partition, so that the user
-has general freedom to manipulate it.
-.PP
-Lex can generate analyzers in either C or Ratfor, a language
-which can be translated automatically to portable Fortran.
-It is available on the PDP-11 UNIX, Honeywell GCOS,
-and IBM OS systems.
-This manual, however, will only discuss generating analyzers
-in C on the UNIX system, which is the only supported
-form of Lex under UNIX Version 7.
-Lex is designed to simplify
-interfacing with Yacc, for those
-with access to this compiler-compiler system.
-..
-.nr PS 9
-.nr VS 11
-.AE
-.SH
-.ce 1
-Table of Contents
-.LP
-.ce 100
-.TS
-r 1l 2r .
-1.     Introduction.   1
-2.     Lex Source.     3
-3.     Lex Regular Expressions.        3
-4.     Lex Actions.    5
-5.     Ambiguous Source Rules. 7
-6.     Lex Source Definitions. 8
-7.     Usage.  8
-8.     Lex and Yacc.   9
-9.     Examples.       10
-10.    Left Context Sensitivity.       11
-11.    Character Set.  12
-12.    Summary of Source Format.       12
-13.    Caveats and Bugs.       13
-14.    Acknowledgments.        13
-15.    References.     13
-.TE
-.ce 0
-.2C
-.NH
-Introduction.
-.PP
-Lex is a program generator designed for
-lexical processing of character input streams.
-It accepts a high-level, problem oriented specification
-for character string matching,
-and
-produces a program in a general purpose language which recognizes
-regular expressions.
-The regular expressions are specified by the user in the
-source specifications given to Lex.
-The Lex written code recognizes these expressions
-in an input stream and partitions the input stream into
-strings matching the expressions.  At the bound~aries
-between strings
-program sections
-provided by the user are executed.
-The Lex source file associates the regular expressions and the
-program fragments.
-As each expression appears in the input to the program written by Lex,
-the corresponding fragment is executed.
-.PP
-.de MH
-Bell Laboratories, Murray Hill, NJ 07974.
-..
-The user supplies the additional code
-beyond expression matching
-needed to complete his tasks, possibly
-including code written by other generators.
-The program that recognizes the expressions is generated in the
-general purpose programming language employed for the
-user's program fragments.
-Thus, a high level expression
-language is provided to write the string expressions to be
-matched while the user's freedom to write actions
-is unimpaired.
-This avoids forcing the user who wishes to use a string manipulation
-language for input analysis to write processing programs in the same
-and often inappropriate string handling language.
-.PP
-Lex is not a complete language, but rather a generator representing
-a new language feature which can be added to
-different programming languages, called ``host languages.'' 
-Just as general purpose languages
-can produce code to run on different computer hardware,
-Lex can write code in different host languages.
-The host language is used for the output code generated by Lex
-and also for the program fragments added by the user.
-Compatible run-time libraries for the different host languages
-are also provided.
-This makes Lex adaptable to different environments and
-different users.
-Each application
-may be directed to the combination of hardware and host language appropriate
-to the task, the user's background, and the properties of local
-implementations.
-At present, the only supported host language is C,
-although Fortran (in the form of Ratfor [2] has been available
-in the past.
-Lex itself exists on UNIX, GCOS, and OS/370; but the
-code generated by Lex may be taken anywhere the appropriate
-compilers exist.
-.PP
-Lex turns the user's expressions and actions
-(called
-.ul
-source
-in this memo) into the host general-purpose language;
-the generated program is named
-.ul
-yylex.
-The
-.ul
-yylex
-program
-will recognize expressions
-in a stream
-(called
-.ul
-input
-in this memo)
-and perform the specified actions for each expression as it is detected.
-See Figure 1.
-.GS
-.TS
-center;
-l _ r
-l|c|r
-l _ r
-l _ r
-l|c|r
-l _ r
-c s s
-c s s.
-
-Source \(->    Lex     \(-> yylex
-
-.sp 2
-
-Input \(->     yylex   \(-> Output
-
-.sp
-An overview of Lex
-.sp
-Figure 1
-.TE
-.GE
-.PP
-For a trivial example, consider a program to delete
-from the input
-all blanks or tabs at the ends of lines.
-.TS
-center;
-l l.
-%%
-[ \et]+$       ;
-.TE
-is all that is required.
-The program
-contains a %% delimiter to mark the beginning of the rules, and
-one rule.
-This rule contains a regular expression
-which matches one or more
-instances of the characters blank or tab
-(written \et for visibility, in accordance with the C language convention)
-just prior to the end of a line.
-The brackets indicate the character
-class made of blank and tab; the + indicates ``one or more ...'';
-and the $ indicates ``end of line,'' as in QED.
-No action is specified,
-so the program generated by Lex (yylex) will ignore these characters.
-Everything else will be copied.
-To change any remaining
-string of blanks or tabs to a single blank,
-add another rule:
-.TS
-center;
-l l.
-%%
-[ \et]+$       ;
-[ \et]+        printf(" ");
-.TE
-The finite automaton generated for this
-source will scan for both rules at once,
-observing at
-the termination of the string of blanks or tabs
-whether or not there is a newline character, and executing
-the desired rule action.
-The first rule matches all strings of blanks or tabs
-at the end of lines, and the second
-rule all remaining strings of blanks or tabs.
-.PP
-Lex can be used alone for simple transformations, or
-for analysis and statistics gathering on a lexical level.
-Lex can also be used with a parser generator
-to perform the lexical analysis phase; it is particularly
-easy to interface Lex and Yacc [3].
-Lex programs recognize only regular expressions;
-Yacc writes parsers that accept a large class of context free grammars,
-but require a lower level analyzer to recognize input tokens.
-Thus, a combination of Lex and Yacc is often appropriate.
-When used as a preprocessor for a later parser generator,
-Lex is used to partition the input stream,
-and the parser generator assigns structure to
-the resulting pieces.
-The flow of control
-in such a case (which might be the first half of a compiler,
-for example) is shown in Figure 2.
-Additional programs,
-written by other generators
-or by hand, can
-be added easily to programs written by Lex.
-.BS 2
-.TS
-center;
-l c c c l
-l c c c l
-l c c c l
-l _ c _ l
-l|c|c|c|l
-l _ c _ l
-l c c c l
-l _ c _ l
-l|c|c|c|l
-l _ c _ l
-l c s s l
-l c s s l.
-       lexical         grammar
-       rules           rules
-       \(da            \(da
-
-       Lex             Yacc
-
-       \(da            \(da
-
-Input \(->     yylex   \(->    yyparse \(-> Parsed input
-
-.sp
-       Lex with Yacc
-.sp
-       Figure 2
-.TE
-.BE
-Yacc users
-will realize that the name
-.ul
-yylex
-is what Yacc expects its lexical analyzer to be named,
-so that the use of this name by Lex simplifies
-interfacing.
-.PP
-Lex generates a deterministic finite automaton from the regular expressions
-in the source [4].
-The automaton is interpreted, rather than compiled, in order
-to save space.
-The result is still a fast analyzer.
-In particular, the time taken by a Lex program
-to recognize and partition an input stream is
-proportional to the length of the input.
-The number of Lex rules or
-the complexity of the rules is
-not important in determining speed,
-unless rules which include
-forward context require a significant amount of re~scanning.
-What does increase with the number and complexity of rules
-is the size of the finite
-automaton, and therefore the size of the program
-generated by Lex.
-.PP
-In the program written by Lex, the user's fragments
-(representing the
-.ul
-actions
-to be performed as each regular expression
-is found)
-are gathered
-as cases of a switch.
-The automaton interpreter directs the control flow.
-Opportunity is provided for the user to insert either
-declarations or additional statements in the routine containing
-the actions, or to
-add subroutines outside this action routine.
-.PP
-Lex is not limited to source which can
-be interpreted on the basis of one character
-look~ahead.
-For example,
-if there are two rules, one looking for
-.I ab
-and another for
-.I abcdefg ,
-and the input stream is
-.I abcdefh ,
-Lex will recognize
-.I ab
-and leave
-the input pointer just before
-.I "cd. . ."
-Such backup is more costly
-than the processing of simpler languages.
-.2C
-.NH
-Lex Source.
-.PP
-The general format of Lex source is:
-.TS
-center;
-l.
-{definitions}
-%%
-{rules}
-%%
-{user subroutines}
-.TE
-where the definitions and the user subroutines
-are often omitted.
-The second
-.I %%
-is optional, but the first is required
-to mark the beginning of the rules.
-The absolute minimum Lex program is thus
-.TS
-center;
-l.
-%%
-.TE
-(no definitions, no rules) which translates into a program
-which copies the input to the output unchanged.
-.PP
-In the outline of Lex programs shown above, the
-.I
-rules
-.R
-represent the user's control
-decisions; they are a table, in which the left column
-contains
-.I
-regular expressions
-.R
-(see section 3)
-and the right column contains
-.I
-actions,
-.R
-program fragments to be executed when the expressions
-are recognized.
-Thus an individual rule might appear
-.TS
-center;
-l l.
-integer        printf("found keyword INT");
-.TE
-to look for the string
-.I integer
-in the input stream and
-print the message ``found keyword INT'' whenever it appears.
-In this example the host procedural language is C and
-the C library function
-.I
-printf
-.R
-is used to print the string.
-The end
-of the expression is indicated by the first blank or tab character.
-If the action is merely a single C expression,
-it can just be given on the right side of the line; if it is
-compound, or takes more than a line, it should be enclosed in
-braces.
-As a slightly more useful example, suppose it is desired to
-change a number of words from British to American spelling.
-Lex rules such as
-.TS
-center;
-l l.
-colour printf("color");
-mechanise      printf("mechanize");
-petrol printf("gas");
-.TE
-would be a start.  These rules are not quite enough,
-since
-the word
-.I petroleum
-would become
-.I gaseum ;
-a way of dealing
-with this will be described later.
-.2C
-.NH
-Lex Regular Expressions.
-.PP
-The definitions of regular expressions are very similar to those
-in QED [5].
-A regular
-expression specifies a set of strings to be matched.
-It contains text characters (which match the corresponding
-characters in the strings being compared)
-and operator characters (which specify
-repetitions, choices, and other features).
-The letters of the alphabet and the digits are
-always text characters; thus the regular expression
-.TS
-center;
-l l.
-integer
-.TE
-matches the string
-.ul
-integer
-wherever it appears
-and the expression
-.TS
-center;
-l.
-a57D
-.TE
-looks for the string
-.ul
-a57D.
-.PP
-.I
-Operators.
-.R
-The operator characters are
-.TS
-center;
-l.
-" \e [ ] ^ \- ? . \(** + | ( ) $ / { } % < >
-.TE
-and if they are to be used as text characters, an escape
-should be used.
-The quotation mark operator (")
-indicates that whatever is contained between a pair of quotes
-is to be taken as text characters.
-Thus
-.TS
-center;
-l.
-xyz"++"
-.TE
-matches the string
-.I xyz++
-when it appears.  Note that a part of a string may be quoted.
-It is harmless but unnecessary to quote an ordinary
-text character; the expression
-.TS
-center;
-l.
-"xyz++"
-.TE
-is the same as the one above.
-Thus by quoting every non-alphanumeric character
-being used as a text character, the user can avoid remembering
-the list above of current
-operator characters, and is safe should further extensions to Lex
-lengthen the list.
-.PP
-An operator character may also be turned into a text character
-by preceding it with \e as in
-.TS
-center;
-l.
-xyz\e+\e+
-.TE
-which
-is another, less readable, equivalent of the above expressions.
-Another use of the quoting mechanism is to get a blank into
-an expression; normally, as explained above, blanks or tabs end
-a rule.
-Any blank character not contained within [\|] (see below) must
-be quoted.
-Several normal C escapes with \e
-are recognized: \en is newline, \et is tab, and \eb is backspace.
-To enter \e itself, use \e\e.
-Since newline is illegal in an expression, \en must be used;
-it is not
-required to escape tab and backspace.
-Every character but blank, tab, newline and the list above is always
-a text character.
-.PP
-.I
-Character classes.
-.R
-Classes of characters can be specified using the operator pair [\|].
-The construction
-.I [abc]
-matches a
-single character, which may be
-.I a ,
-.I b ,
-or
-.I c .
-Within square brackets,
-most operator meanings are ignored.
-Only three characters are special:
-these are \e \(mi and ^.  The \(mi character
-indicates ranges.  For example,
-.TS
-center;
-l.
-[a\(miz0\(mi9<>_]
-.TE
-indicates the character class containing all the lower case letters,
-the digits,
-the angle brackets, and underline.
-Ranges may be given in either order.
-Using \(mi between any pair of characters which are
-not both upper case letters, both lower case letters, or both digits
-is implementation dependent and will get a warning message.
-(E.g., [0\-z] in ASCII is many more characters
-than it is in EBCDIC).
-If it is desired to include the
-character \(mi in a character class, it should be first or
-last; thus
-.TS
-center;
-l.
-[\(mi+0\(mi9]
-.TE
-matches all the digits and the two signs.
-.PP
-In character classes,
-the ^ operator must appear as the first character
-after the left bracket; it indicates that the resulting string
-is to be complemented with respect to the computer character set.
-Thus
-.TS
-center;
-l.
-[^abc]
-.TE
-matches all characters except a, b, or c, including
-all special or control characters; or
-.TS
-center;
-l.
-[^a\-zA\-Z]
-.TE
-is any character which is not a letter.
-The \e character provides the usual escapes within
-character class brackets.
-.PP
-.I
-Arbitrary character.
-.R
-To match almost any character, the operator character
-.TS
-center;
-l.
-\&.
-.TE
-is the class of all characters except newline.
-Escaping into octal is possible although non-portable:
-.TS
-center;
-l.
-[\e40\-\e176]
-.TE
-matches all printable characters in the ASCII character set, from octal
-40 (blank) to octal 176 (tilde).
-.PP
-.I
-Optional expressions.
-.R
-The operator
-.I ?
-indicates
-an optional element of an expression.
-Thus
-.TS
-center;
-l.
-ab?c
-.TE
-matches either
-.I ac
-or
-.I abc .
-.PP
-.I
-Repeated expressions.
-.R
-Repetitions of classes are indicated by the operators
-.I \(**
-and
-.I + .
-.TS
-center;
-l.
-\f2a\(**\f1
-.TE
-is any number of consecutive
-.I a
-characters, including zero; while
-.TS
-center;
-l.
-a+
-.TE
-is one or more instances of
-.I a.
-For example,
-.TS
-center;
-l.
-[a\-z]+
-.TE
-is all strings of lower case letters.
-And
-.TS
-center;
-l.
-[A\(miZa\(miz][A\(miZa\(miz0\(mi9]\(**
-.TE
-indicates all alphanumeric strings with a leading
-alphabetic character.
-This is a typical expression for recognizing identifiers in
-computer languages.
-.PP
-.I
-Alternation and Grouping.
-.R
-The operator |
-indicates alternation:
-.TS
-center;
-l.
-(ab\||\|cd)
-.TE
-matches either
-.ul
-ab
-or
-.ul
-cd.
-Note that parentheses are used for grouping, although
-they are
-not necessary on the outside level;
-.TS
-center;
-l.
-ab\||\|cd
-.TE
-would have sufficed.
-Parentheses
-can be used for more complex expressions:
-.TS
-center;
-l.
-(ab\||\|cd+)?(ef)\(**
-.TE
-matches such strings as
-.I abefef ,
-.I efefef ,
-.I cdef ,
-or
-.I cddd\| ;
-but not
-.I abc ,
-.I abcd ,
-or
-.I abcdef .
-.PP
-.I
-Context sensitivity.
-.R
-Lex will recognize a small amount of surrounding
-context.  The two simplest operators for this are
-.I ^
-and
-.I $ .
-If the first character of an expression is
-.I ^ ,
-the expression will only be matched at the beginning
-of a line (after a newline character, or at the beginning of
-the input stream).
-This can never conflict with the other meaning of
-.I ^ ,
-complementation
-of character classes, since that only applies within
-the [\|] operators.
-If the very last character is
-.I $ ,
-the expression will only be matched at the end of a line (when
-immediately followed by newline).
-The latter operator is a special case of the
-.I /
-operator character,
-which indicates trailing context.
-The expression
-.TS
-center;
-l.
-ab/cd
-.TE
-matches the string
-.I ab ,
-but only if followed by
-.ul
-cd.
-Thus
-.TS
-center;
-l.
-ab$
-.TE
-is the same as
-.TS
-center;
-l.
-ab/\en
-.TE
-Left context is handled in Lex by
-.I
-start conditions
-.R
-as explained in section 10.  If a rule is only to be executed
-when the Lex automaton interpreter is in start condition
-.I
-x,
-.R
-the rule should be prefixed by
-.TS
-center;
-l.
-<x>
-.TE
-using the angle bracket operator characters.
-If we considered ``being at the beginning of a line'' to be
-start condition
-.I ONE ,
-then the ^ operator
-would be equivalent to
-.TS
-center;
-l.
-<ONE>
-.TE
-Start conditions are explained more fully later.
-.PP
-.I
-Repetitions and Definitions.
-.R
-The operators {} specify
-either repetitions (if they enclose numbers)
-or
-definition expansion (if they enclose a name).  For example
-.TS
-center;
-l.
-{digit}
-.TE
-looks for a predefined string named
-.I digit
-and inserts it
-at that point in the expression.
-The definitions are given in the first part of the Lex
-input, before the rules.
-In contrast,
-.TS
-center;
-l.
-a{1,5}
-.TE
-looks for 1 to 5 occurrences of
-.I a .
-.PP
-Finally, initial
-.I %
-is special, being the separator
-for Lex source segments.
-.2C
-.NH
-Lex Actions.
-.PP
-When an expression written as above is matched, Lex
-executes the corresponding action.  This section describes
-some features of Lex which aid in writing actions.  Note
-that there is a default action, which
-consists of copying the input to the output.  This
-is performed on all strings not otherwise matched.  Thus
-the Lex user who wishes to absorb the entire input, without
-producing any output, must provide rules to match everything.
-When Lex is being used with Yacc, this is the normal
-situation.
-One may consider that actions are what is done instead of
-copying the input to the output; thus, in general,
-a rule which merely copies can be omitted.
-Also, a character combination
-which is omitted from the rules
-and which appears as input
-is likely to be printed on the output, thus calling
-attention to the gap in the rules.
-.PP
-One of the simplest things that can be done is to ignore
-the input.   Specifying a C null statement, \fI;\fR as an action
-causes this result.  A frequent rule is
-.TS
-center;
-l l.
-[ \et\en]      ;
-.TE
-which causes the three spacing characters (blank, tab, and newline)
-to be ignored.
-.PP
-Another easy way to avoid writing actions is the action character
-|, which indicates that the action for this rule is the action
-for the next rule.
-The previous example could also have been written
-.TS
-center;
-l l.
-" "            |
-"\et"          |
-"\en"          ;
-.TE
-with the same result, although in different style.
-The quotes around \en and \et are not required.
-.PP
-In more complex actions, the user
-will
-often want to know the actual text that matched some expression
-like
-.I [a\(miz]+ .
-Lex leaves this text in an external character
-array named
-.I
-yytext.
-.R
-Thus, to print the name found,
-a rule like
-.TS
-center;
-l l.
-[a\-z]+        printf("%s", yytext);
-.TE
-will print
-the string in
-.I
-yytext.
-.R
-The C function
-.I
-printf
-.R
-accepts a format argument and data to be printed;
-in this case, the format is ``print string'' (% indicating
-data conversion, and
-.I s
-indicating string type),
-and the data are the characters
-in
-.I
-yytext.
-.R
-So this just places
-the matched string
-on the output.
-This action
-is so common that
-it may be written as ECHO:
-.TS
-center;
-l l.
-[a\-z]+        ECHO;
-.TE
-is the same as the above.
-Since the default action is just to
-print the characters found, one might ask why
-give a rule, like this one, which merely specifies
-the default action?
-Such rules are often required
-to avoid matching some other rule
-which is not desired.  For example, if there is a rule
-which matches
-.I read
-it will normally match the instances of
-.I read
-contained in
-.I bread
-or
-.I readjust ;
-to avoid
-this,
-a rule
-of the form
-.I [a\(miz]+
-is needed.
-This is explained further below.
-.PP
-Sometimes it is more convenient to know the end of what
-has been found; hence Lex also provides a count
-.I
-yyleng
-.R
-of the number of characters matched.
-To count both the number
-of words and the number of characters in words in the input, the user might write
-.TS
-center;
-l l.
-[a\-zA\-Z]+    {words++; chars += yyleng;}
-.TE
-which accumulates in
-.ul
-chars
-the number
-of characters in the words recognized.
-The last character in the string matched can
-be accessed by
-.TS
-center;
-l.
-yytext[yyleng\-1]
-.TE
-.PP
-Occasionally, a Lex
-action may decide that a rule has not recognized the correct
-span of characters.
-Two routines are provided to aid with this situation.
-First,
-.I
-yymore()
-.R
-can be called to indicate that the next input expression recognized is to be
-tacked on to the end of this input.  Normally,
-the next input string would overwrite the current
-entry in
-.I
-yytext.
-.R
-Second,
-.I
-yyless (n)
-.R
-may be called to indicate that not all the characters matched
-by the currently successful expression are wanted right now.
-The argument
-.I
-n
-.R
-indicates the number of characters
-in
-.I
-yytext
-.R
-to be retained.
-Further characters previously matched
-are
-returned to the input.  This provides the same sort of
-look~ahead offered by the / operator,
-but in a different form.
-.PP
-.I
-Example:
-.R
-Consider a language which defines
-a string as a set of characters between quotation (") marks, and provides that
-to include a " in a string it must be preceded by a \e.  The
-regular expression which matches that is somewhat confusing,
-so that it might be preferable to write
-.TS
-center;
-l l.
-\e"[^"]\(**    {
-       if (yytext[yyleng\-1] == \(fm\e\e\(fm)
-            yymore();
-       else
-            ... normal user processing
-       }
-.TE
-which will, when faced with a string such as
-.I
-"abc\e"def\|"
-.R
-first match
-the five characters
-\fI"abc\e\|\fR;
-then
-the call to
-.I yymore()
-will
-cause the next part of the string,
-\fI"def\|\fR,
-to be tacked on the end.
-Note that the final quote terminating the string should be picked
-up in the code labeled ``normal processing''.
-.PP
-The function
-.I
-yyless()
-.R
-might be used to reprocess
-text in various circumstances.  Consider the C problem of distinguishing
-the ambiguity of ``=\(mia''.
-Suppose it is desired to treat this as ``=\(mi a''
-but print a message.  A rule might be
-.TS
-center;
-l l.
-=\(mi[a\-zA\-Z]        {
-       printf("Operator (=\(mi) ambiguous\en");
-       yyless(yyleng\-1);
-       ... action for =\(mi ...
-       }
-.TE
-which prints a message, returns the letter after the
-operator to the input stream, and treats the operator as ``=\(mi''.
-Alternatively it might be desired to treat this as ``=  \(mia''.
-To do this, just return the minus
-sign as well as the letter to the input:
-.TS
-center;
-l l.
-=\(mi[a\-zA\-Z]        {
-       printf("Operator (=\(mi) ambiguous\en");
-       yyless(yyleng\-2);
-       ... action for = ...
-       }
-.TE
-will perform the other interpretation.
-Note that the expressions for the two cases might more easily
-be written
-.TS
-center;
-l l.
-=\(mi/[A\-Za\-z]
-.TE
-in the first case and
-.TS
-center;
-l.
-=/\-[A\-Za\-z]
-.TE
-in the second;
-no backup would be required in the rule action.
-It is not necessary to recognize the whole identifier
-to observe the ambiguity.
-The
-possibility of ``=\(mi3'', however, makes
-.TS
-center;
-l.
-=\(mi/[^ \et\en]
-.TE
-a still better rule.
-.PP
-In addition to these routines, Lex also permits
-access to the I/O routines
-it uses.
-They are:
-.IP 1)
-.I
-input()
-.R
-which returns the next input character;
-.IP 2)
-.I
-output(c)
-.R
-which writes the character
-.I
-c
-.R
-on the output; and
-.IP 3)
-.I
-unput(c)
-.R
-pushes the character
-.I
-c
-.R
-back onto the input stream to be read later by
-.I
-input().
-.R
-.LP
-By default these routines are provided as macro definitions,
-but the user can override them and supply private versions.
-These routines
-define the relationship between external files and
-internal characters, and must all be retained
-or modified consistently.
-They may be redefined, to
-cause input or output to be transmitted to or from strange
-places, including other programs or internal memory;
-but the character set used must be consistent in all routines;
-a value of zero returned by
-.I
-input
-.R
-must mean end of file; and
-the relationship between
-.I
-unput
-.R
-and
-.I
-input
-.R
-must be retained
-or the Lex look~ahead will not work.
-Lex does not look ahead at all if it does not have to,
-but every rule ending in
-.ft I
-+ \(** ?
-.ft R
-or
-.ft I
-$
-.ft R
-or containing
-.ft I
-/
-.ft R
-implies look~ahead.
-Look~ahead is also necessary to match an expression that is a prefix
-of another expression.
-See below for a discussion of the character set used by Lex.
-The standard Lex library imposes
-a 100 character limit on backup.
-.PP
-Another Lex library routine that the user will sometimes want
-to redefine is
-.I
-yywrap()
-.R
-which is called whenever Lex reaches an end-of-file.
-If
-.I
-yywrap
-.R
-returns a 1, Lex continues with the normal wrapup on end of input.
-Sometimes, however, it is convenient to arrange for more
-input to arrive
-from a new source.
-In this case, the user should provide
-a
-.I
-yywrap
-.R
-which
-arranges for new input and
-returns 0.  This instructs Lex to continue processing.
-The default
-.I
-yywrap
-.R
-always returns 1.
-.PP
-This routine is also a convenient place
-to print tables, summaries, etc. at the end
-of a program.  Note that it is not
-possible to write a normal rule which recognizes
-end-of-file; the only access to this condition is
-through
-.I
-yywrap.
-.R
-In fact, unless a private version of
-.I
-input()
-.R
-is supplied
-a file containing nulls
-cannot be handled,
-since a value of 0 returned by
-.I
-input
-.R
-is taken to be end-of-file.
-.PP
-.2C
-.NH
-Ambiguous Source Rules.
-.PP
-Lex can handle ambiguous specifications.
-When more than one expression can match the
-current input, Lex chooses as follows:
-.IP 1)
-The longest match is preferred.
-.IP 2)
-Among rules which matched the same number of characters,
-the rule given first is preferred.
-.LP
-Thus, suppose the rules
-.TS
-center;
-l l.
-integer        keyword action ...;
-[a\-z]+        identifier action ...;
-.TE
-to be given in that order.  If the input is
-.I integers ,
-it is taken as an identifier, because
-.I [a\-z]+
-matches 8 characters while
-.I integer
-matches only 7.
-If the input is
-.I integer ,
-both rules match 7 characters, and
-the keyword rule is selected because it was given first.
-Anything shorter (e.g. \fIint\fR\|) will
-not match the expression
-.I integer
-and so the identifier interpretation is used.
-.PP
-The principle of preferring the longest
-match makes rules containing
-expressions like
-.I \&.\(**
-dangerous.
-For example,
-.TS
-center;
-l.
-\&\(fm.\(**\(fm
-.TE
-might seem a good way of recognizing
-a string in single quotes.
-But it is an invitation for the program to read far
-ahead, looking for a distant
-single quote.
-Presented with the input
-.TS
-center;
-l l.
-\&\(fmfirst\(fm quoted string here, \(fmsecond\(fm here
-.TE
-the above expression will match
-.TS
-center;
-l l.
-\&\(fmfirst\(fm quoted string here, \(fmsecond\(fm
-.TE
-which is probably not what was wanted.
-A better rule is of the form
-.TS
-center;
-l.
-\&\(fm[^\(fm\en]\(**\(fm
-.TE
-which, on the above input, will stop
-after
-.I \(fmfirst\(fm .
-The consequences
-of errors like this are mitigated by the fact
-that the
-.I \&.
-operator will not match newline.
-Thus expressions like
-.I \&.\(**
-stop on the
-current line.
-Don't try to defeat this with expressions like
-.I [.\en]+
-or
-equivalents;
-the Lex generated program will try to read
-the entire input file, causing
-internal buffer overflows.
-.PP
-Note that Lex is normally partitioning
-the input stream, not searching for all possible matches
-of each expression.
-This means that each character is accounted for
-once and only once.
-For example, suppose it is desired to
-count occurrences of both \fIshe\fR and \fIhe\fR in an input text.
-Some Lex rules to do this might be
-.TS
-center;
-l l.
-she    s++;
-he     h++;
-\en    |
-\&.    ;
-.TE
-where the last two rules ignore everything besides \fIhe\fR and \fIshe\fR.
-Remember that . does not include newline.
-Since \fIshe\fR includes \fIhe\fR, Lex will normally
-.I
-not
-.R
-recognize
-the instances of \fIhe\fR included in \fIshe\fR,
-since once it has passed a \fIshe\fR those characters are gone.
-.PP
-Sometimes the user would like to override this choice.  The action
-REJECT
-means ``go do the next alternative.''
-It causes whatever rule was second choice after the current
-rule to be executed.
-The position of the input pointer is adjusted accordingly.
-Suppose the user really wants to count the included instances of \fIhe\fR:
-.TS
-center;
-l l.
-she    {s++; REJECT;}
-he     {h++; REJECT;}
-\en    |
-\&.    ;
-.TE
-these rules are one way of changing the previous example
-to do just that.
-After counting each expression, it is rejected; whenever appropriate,
-the other expression will then be counted.  In this example, of course,
-the user could note that \fIshe\fR includes \fIhe\fR but not
-vice versa, and omit the REJECT action on \fIhe\fR;
-in other cases, however, it
-would not be possible a priori to tell
-which input characters
-were in both classes.
-.PP
-Consider the two rules
-.TS
-center;
-l l.
-a[bc]+ { ... ; REJECT;}
-a[cd]+ { ... ; REJECT;}
-.TE
-If the input is
-.I ab ,
-only the first rule matches,
-and on
-.I ad
-only the second matches.
-The input string
-.I accb
-matches the first rule for four characters
-and then the second rule for three characters.
-In contrast, the input
-.I accd
-agrees with
-the second rule for four characters and then the first
-rule for three.
-.PP
-In general, REJECT is useful whenever
-the purpose of Lex is not to partition the input
-stream but to detect all examples of some items
-in the input, and the instances of these items
-may overlap or include each other.
-Suppose a digram table of the input is desired;
-normally the digrams overlap, that is the word
-.I the
-is considered to contain
-both
-.I th
-and
-.I he .
-Assuming a two-dimensional array named
-.ul
-digram
-to be incremented, the appropriate
-source is
-.TS
-center;
-l l.
-%%
-[a\-z][a\-z]   {digram[yytext[0]][yytext[1]]++; REJECT;}
-.      ;
-\en    ;
-.TE
-where the REJECT is necessary to pick up
-a letter pair beginning at every character, rather than at every
-other character.
-.2C
-.NH
-Lex Source Definitions.
-.PP
-Remember the format of the Lex
-source:
-.TS
-center;
-l.
-{definitions}
-%%
-{rules}
-%%
-{user routines}
-.TE
-So far only the rules have been described.  The user needs
-additional options,
-though, to define variables for use in his program and for use
-by Lex.
-These can go either in the definitions section
-or in the rules section.
-.PP
-Remember that Lex is turning the rules into a program.
-Any source not intercepted by Lex is copied
-into the generated program.  There are three classes
-of such things.
-.IP 1)
-Any line which is not part of a Lex rule or action
-which begins with a blank or tab is copied into
-the Lex generated program.
-Such source input prior to the first %% delimiter will be external
-to any function in the code; if it appears immediately after the first
-%%,
-it appears in an appropriate place for declarations
-in the function written by Lex which contains the actions.
-This material must look like program fragments,
-and should precede the first Lex rule.
-.IP
-As a side effect of the above, lines which begin with a blank
-or tab, and which contain a comment,
-are passed through to the generated program.
-This can be used to include comments in either the Lex source or
-the generated code.  The comments should follow the host
-language convention.
-.IP 2)
-Anything included between lines containing
-only
-.I %{
-and
-.I %}
-is
-copied out as above.  The delimiters are discarded.
-This format permits entering text like preprocessor statements that
-must begin in column 1,
-or copying lines that do not look like programs.
-.IP 3)
-Anything after the third %% delimiter, regardless of formats, etc.,
-is copied out after the Lex output.
-.PP
-Definitions intended for Lex are given
-before the first %% delimiter.  Any line in this section
-not contained between %{ and %}, and begining
-in column 1, is assumed to define Lex substitution strings.
-The format of such lines is
-.TS
-center;
-l l.
-name translation
-.TE
-and it
-causes the string given as a translation to
-be associated with the name.
-The name and translation
-must be separated by at least one blank or tab, and the name must begin with a letter.
-The translation can then be called out
-by the {name} syntax in a rule.
-Using {D} for the digits and {E} for an exponent field,
-for example, might abbreviate rules to recognize numbers:
-.TS
-center;
-l l.
-D      [0\-9]
-E      [DEde][\-+]?{D}+
-%%
-{D}+   printf("integer");
-{D}+"."{D}\(**({E})?   |
-{D}\(**"."{D}+({E})?   |
-{D}+{E}                printf("real");
-.TE
-Note the first two rules for real numbers;
-both require a decimal point and contain
-an optional exponent field,
-but the first requires at least one digit before the
-decimal point and the second requires at least one
-digit after the decimal point.
-To correctly handle the problem
-posed by a Fortran expression such as
-.I 35.EQ.I ,
-which does not contain a real number, a context-sensitive
-rule such as
-.TS
-center;
-l l.
-[0\-9]+/"."EQ  printf("integer");
-.TE
-could be used in addition to the normal rule for integers.
-.PP
-The definitions
-section may also contain other commands, including the
-selection of a host language, a character set table,
-a list of start conditions, or adjustments to the default
-size of arrays within Lex itself for larger source programs.
-These possibilities
-are discussed below under ``Summary of Source Format,''
-section 12.
-.2C
-.NH
-Usage.
-.PP
-There are two steps in
-compiling a Lex source program.
-First, the Lex source must be turned into a generated program
-in the host general purpose language.
-Then this program must be compiled and loaded, usually with
-a library of Lex subroutines.
-The generated program
-is on a file named
-.I lex.yy.c .
-The I/O library is defined in terms of the C standard
-library [6].
-.PP
-The C programs generated by Lex are slightly different
-on OS/370, because the
-OS compiler is less powerful than the UNIX or GCOS compilers,
-and does less at compile time.
-C programs generated on GCOS and UNIX are the same.
-.PP
-.I
-UNIX.
-.R
-The library is accessed by the loader flag
-.I \-ll .
-So an appropriate
-set of commands is
-.KS
-.in 5
-lex source
-cc lex.yy.c \-ll
-.in 0
-.KE
-The resulting program is placed on the usual file
-.I
-a.out
-.R
-for later execution.
-To use Lex with Yacc see below.
-Although the default Lex I/O routines use the C standard library,
-the Lex automata themselves do not do so;
-if private versions of
-.I
-input,
-output
-.R
-and
-.I unput
-are given, the library can be avoided.
-.PP
-.2C
-.NH
-Lex and Yacc.
-.PP
-If you want to use Lex with Yacc, note that what Lex writes is a program
-named
-.I
-yylex(),
-.R
-the name required by Yacc for its analyzer.
-Normally, the default main program on the Lex library
-calls this routine, but if Yacc is loaded, and its main
-program is used, Yacc will call
-.I
-yylex().
-.R
-In this case each Lex rule should end with
-.TS
-center;
-l.
-return(token);
-.TE
-where the appropriate token value is returned.
-An easy way to get access
-to Yacc's names for tokens is to
-compile the Lex output file as part of
-the Yacc output file by placing the line
-.TS
-center;
-l.
-# include "lex.yy.c"
-.TE
-in the last section of Yacc input.
-Supposing the grammar to be
-named ``good'' and the lexical rules to be named ``better''
-the UNIX command sequence can just be:
-.TS
-center;
-l.
-yacc good
-lex better
-cc y.tab.c \-ly \-ll
-.TE
-The Yacc library (\-ly) should be loaded before the Lex library,
-to obtain a main program which invokes the Yacc parser.
-The generations of Lex and Yacc programs can be done in
-either order.
-.2C
-.NH
-Examples.
-.PP
-As a trivial problem, consider copying an input file while
-adding 3 to every positive number divisible by 7.
-Here is a suitable Lex source program
-.TS
-center;
-l l.
-%%
-       int k;
-[0\-9]+        {
-       k = atoi(yytext);
-       if (k%7 == 0)
-            printf("%d", k+3);
-       else
-            printf("%d",k);
-       }
-.TE
-to do just that.
-The rule [0\-9]+ recognizes strings of digits;
-.I
-atoi
-.R
-converts the digits to binary
-and stores the result in
-.ul
-k.
-The operator % (remainder) is used to check whether
-.ul
-k
-is divisible by 7; if it is,
-it is incremented by 3 as it is written out.
-It may be objected that this program will alter such
-input items as
-.I 49.63
-or
-.I X7 .
-Furthermore, it increments the absolute value
-of all negative numbers divisible by 7.
-To avoid this, just add a few more rules after the active one,
-as here:
-.TS
-center;
-l l.
-%%
-       int k;
-\-?[0\-9]+     {
-       k = atoi(yytext);
-       printf("%d", k%7 == 0 ? k+3 : k);
-       }
-\-?[0\-9.]+    ECHO;
-[A-Za-z][A-Za-z0-9]+   ECHO;
-.TE
-Numerical strings containing
-a ``.'' or preceded by a letter will be picked up by
-one of the last two rules, and not changed.
-The
-.I if\-else
-has been replaced by
-a C conditional expression to save space;
-the form
-.ul
-a?b:c
-means ``if
-.I a
-then
-.I b
-else
-.I c ''.
-.PP
-For an example of statistics gathering, here
-is a program which histograms the lengths
-of words, where a word is defined as a string of letters.
-.TS
-center;
-l l.
-       int lengs[100];
-%%
-[a\-z]+        lengs[yyleng]++;
-\&.    |
-\en    ;
-%%
-.T&
-l s.
-yywrap()
-{
-int i;
-printf("Length  No. words\en");
-for(i=0; i<100; i++)
-     if (lengs[i] > 0)
-          printf("%5d%10d\en",i,lengs[i]);
-return(1);
-}
-.TE
-This program
-accumulates the histogram, while producing no output.  At the end
-of the input it prints the table.
-The final statement
-.I
-return(1);
-.R
-indicates that Lex is to perform wrapup.  If
-.I
-yywrap
-.R
-returns zero (false)
-it implies that further input is available
-and the program is
-to continue reading and processing.
-To provide a
-.I
-yywrap
-.R
-that never
-returns true causes an infinite loop.
-.PP
-As a larger example,
-here are some parts of a program written by N. L. Schryer
-to convert double precision Fortran to single precision Fortran.
-Because Fortran does not distinguish upper and lower case letters,
-this routine begins by defining a set of classes including
-both cases of each letter:
-.TS
-center;
-l l.
-a      [aA]
-b      [bB]
-c      [cC]
-\&...
-z      [zZ]
-.TE
-An additional class recognizes white space:
-.TS
-center;
-l l.
-W      [ \et]\(**
-.TE
-The first rule changes
-``double precision'' to ``real'', or ``DOUBLE PRECISION'' to ``REAL''.
-.TS
-center;
-l.
-{d}{o}{u}{b}{l}{e}{W}{p}{r}{e}{c}{i}{s}{i}{o}{n} {
-     printf(yytext[0]==\(fmd\(fm? "real" : "REAL");
-     }
-.TE
-Care is taken throughout this program to preserve the case
-(upper or lower)
-of the original program.
-The conditional operator is used to
-select the proper form of the keyword.
-The next rule copies continuation card indications to
-avoid confusing them with constants:
-.TS
-center;
-l l.
-^"     "[^ 0]  ECHO;
-.TE
-In the regular expression, the quotes surround the
-blanks.
-It is interpreted as
-``beginning of line, then five blanks, then
-anything but blank or zero.'' 
-Note the two different meanings of
-.I ^ .
-There follow some rules to change double precision
-constants to ordinary floating constants.
-.TS
-center;
-l.
-[0\-9]+{W}{d}{W}[+\-]?{W}[0\-9]+     |
-[0\-9]+{W}"."{W}{d}{W}[+\-]?{W}[0\-9]+     |
-"."{W}[0\-9]+{W}{d}{W}[+\-]?{W}[0\-9]+     {
-     /\(** convert constants \(**/
-     for(p=yytext; \(**p != 0; p++)
-          {
-          if (\(**p == \(fmd\(fm || \(**p == \(fmD\(fm)
-               \(**p=+ \(fme\(fm\- \(fmd\(fm;
-          ECHO;
-          }
-.TE
-After the floating point constant is recognized, it is
-scanned by the
-.ul
-for
-loop
-to find the letter
-.I d
-or
-.I D .
-The program than adds
-.c
-.I \(fme\(fm\-\(fmd\(fm ,
-which converts
-it to the next letter of the alphabet.
-The modified constant, now single-precision,
-is written out again.
-There follow a series of names which must be respelled to remove
-their initial \fId\fR.
-By using the
-array
-.I
-yytext
-.R
-the same action suffices for all the names (only a sample of
-a rather long list is given here).
-.TS
-center;
-l l.
-{d}{s}{i}{n}   |
-{d}{c}{o}{s}   |
-{d}{s}{q}{r}{t}        |
-{d}{a}{t}{a}{n}        |
-\&...
-{d}{f}{l}{o}{a}{t}     printf("%s",yytext+1);
-.TE
-Another list of names must have initial \fId\fR changed to initial \fIa\fR:
-.TS
-center;
-l l.
-{d}{l}{o}{g}   |
-{d}{l}{o}{g}10 |
-{d}{m}{i}{n}1  |
-{d}{m}{a}{x}1  {
-       yytext[0] =+ \(fma\(fm \- \(fmd\(fm;
-       ECHO;
-       }
-.TE
-And one routine
-must have initial \fId\fR changed to initial \fIr\fR:
-.TS
-center;
-l l.
-{d}1{m}{a}{c}{h}       {yytext[0] =+ \(fmr\(fm  \- \(fmd\(fm;
-               ECHO;
-               }
-.TE
-To avoid such names as \fIdsinx\fR being detected as instances
-of \fIdsin\fR, some final rules pick up longer words as identifiers
-and copy some surviving characters:
-.TS
-center;
-l l.
-[A\-Za\-z][A\-Za\-z0\-9]\(**   |
-[0\-9]+        |
-\en    |
-\&.    ECHO;
-.TE
-Note that this program is not complete; it
-does not deal with the spacing problems in Fortran or
-with the use of keywords as identifiers.
-.br
-.2C
-.NH
-Left Context Sensitivity.
-.PP
-Sometimes
-it is desirable to have several sets of lexical rules
-to be applied at different times in the input.
-For example, a compiler preprocessor might distinguish
-preprocessor statements and analyze them differently
-from ordinary statements.
-This requires
-sensitivity
-to prior context, and there are several ways of handling
-such problems.
-The \fI^\fR operator, for example, is a prior context operator,
-recognizing immediately preceding left context just as \fI$\fR recognizes
-immediately following right context.
-Adjacent left context could be extended, to produce a facility similar to
-that for adjacent right context, but it is unlikely
-to be as useful, since often the relevant left context
-appeared some time earlier, such as at the beginning of a line.
-.PP
-This section describes three means of dealing
-with different environments: a simple use of flags,
-when only a few rules change from one environment to another,
-the use of
-.I
-start conditions
-.R
-on rules,
-and the possibility of making multiple lexical analyzers all run
-together.
-In each case, there are rules which recognize the need to change the
-environment in which the
-following input text is analyzed, and set some parameter
-to reflect the change.  This may be a flag explicitly tested by
-the user's action code; such a flag is the simplest way of dealing
-with the problem, since Lex is not involved at all.
-It may be more convenient,
-however,
-to have Lex remember the flags as initial conditions on the rules.
-Any rule may be associated with a start condition.  It will only
-be recognized when Lex is in
-that start condition.
-The current start condition may be changed at any time.
-Finally, if the sets of rules for the different environments
-are very dissimilar,
-clarity may be best achieved by writing several distinct lexical
-analyzers, and switching from one to another as desired.
-.PP
-Consider the following problem: copy the input to the output,
-changing the word \fImagic\fR to \fIfirst\fR on every line which began
-with the letter \fIa\fR, changing \fImagic\fR to \fIsecond\fR on every line
-which began with the letter \fIb\fR, and changing
-\fImagic\fR to \fIthird\fR on every line which began
-with the letter \fIc\fR.  All other words and all other lines
-are left unchanged.
-.PP
-These rules are so simple that the easiest way
-to do this job is with a flag:
-.TS
-center;
-l l.
-       int flag;
-%%
-^a     {flag = \(fma\(fm; ECHO;}
-^b     {flag = \(fmb\(fm; ECHO;}
-^c     {flag = \(fmc\(fm; ECHO;}
-\en    {flag =  0 ; ECHO;}
-magic  {
-       switch (flag)
-       {
-       case \(fma\(fm: printf("first"); break;
-       case \(fmb\(fm: printf("second"); break;
-\11\11     case \(fmc\(fm: printf("third"); break;
-       default: ECHO; break;
-       }
-       }
-.TE
-should be adequate.
-.PP
-To handle the same problem with start conditions, each
-start condition must be introduced to Lex in the definitions section
-with a line reading
-.TS
-center;
-l l.
-%Start name1 name2 ...
-.TE
-where the conditions may be named in any order.
-The word \fIStart\fR may be abbreviated to \fIs\fR or \fIS\fR.
-The conditions may be referenced at the
-head of a rule with the <> brackets:
-.TS
-center;
-l.
-<name1>expression
-.TE
-is a rule which is only recognized when Lex is in the
-start condition \fIname1\fR.
-To enter a start condition,
-execute the action statement
-.TS
-center;
-l.
-BEGIN name1;
-.TE
-which changes the start condition to \fIname1\fR.
-To resume the normal state,
-.TS
-center;
-l.
-BEGIN 0;
-.TE
-resets the initial condition
-of the Lex automaton interpreter.
-A rule may be active in several
-start conditions:
-.TS
-center;
-l.
-<name1,name2,name3>
-.TE
-is a legal prefix.  Any rule not beginning with the
-<> prefix operator is always active.
-.PP
-The same example as before can be written:
-.TS
-center;
-l l.
-%START AA BB CC
-%%
-^a     {ECHO; BEGIN AA;}
-^b     {ECHO; BEGIN BB;}
-^c     {ECHO; BEGIN CC;}
-\en    {ECHO; BEGIN 0;}
-<AA>magic      printf("first");
-<BB>magic      printf("second");
-<CC>magic      printf("third");
-.TE
-where the logic is exactly the same as in the previous
-method of handling the problem, but Lex does the work
-rather than the user's code.
-.2C
-.NH
-Character Set.
-.PP
-The programs generated by Lex handle
-character I/O only through the routines
-.I
-input,
-output,
-.R
-and
-.I
-unput.
-.R
-Thus the character representation
-provided in these routines
-is accepted by Lex and employed to return
-values in
-.I
-yytext.
-.R
-For internal use
-a character is represented as a small integer
-which, if the standard library is used,
-has a value equal to the integer value of the bit
-pattern representing the character on the host computer.
-Normally, the letter
-.I a
-is represented as the same form as the character constant
-.I \(fma\(fm .
-If this interpretation is changed, by providing I/O
-routines which translate the characters,
-Lex must be told about
-it, by giving a translation table.
-This table must be in the definitions section,
-and must be bracketed by lines containing  only
-``%T''.
-The table contains lines of the form
-.TS
-center;
-l.
-{integer} {character string}
-.TE
-which indicate the value associated with each character.
-Thus the next example
-.GS 2
-.TS
-center;
-l l.
-%T
- 1     Aa
- 2     Bb
-\&...
-26     Zz
-27     \en
-28     +
-29     \-
-30     0
-31     1
-\&...
-39     9
-%T
-.TE
-.sp
-.ce 1
-Sample character table.
-.GE
-maps the lower and upper case letters together into the integers 1 through 26,
-newline into 27, + and \- into 28 and 29, and the
-digits into 30 through 39.
-Note the escape for newline.
-If a table is supplied, every character that is to appear either
-in the rules or in any valid input must be included
-in the table.
-No character
-may be assigned the number 0, and no character may be
-assigned a bigger number than the size of the hardware character set.
-.2C
-.NH
-Summary of Source Format.
-.PP
-The general form of a Lex source file is:
-.TS
-center;
-l.
-{definitions}
-%%
-{rules}
-%%
-{user subroutines}
-.TE
-The definitions section contains
-a combination of
-.IP 1)
-Definitions, in the form ``name space translation''.
-.IP 2)
-Included code, in the form ``space code''.
-.IP 3)
-Included code, in the form
-.TS
-center;
-l.
-%{
-code
-%}
-.TE
-.ns
-.IP 4)
-Start conditions, given in the form
-.TS
-center;
-l.
-%S name1 name2 ...
-.TE
-.ns
-.IP 5)
-Character set tables, in the form
-.TS
-center;
-l.
-%T
-number space character-string
-\&...
-%T
-.TE
-.ns
-.IP 6)
-Changes to internal array sizes, in the form
-.TS
-center;
-l.
-%\fIx\fR\0\0\fInnn\fR
-.TE
-where \fInnn\fR is a decimal integer representing an array size
-and \fIx\fR selects the parameter as follows:
-.TS
-center;
-c c
-c l.
-Letter Parameter
-p      positions
-n      states
-e      tree nodes
-a      transitions
-k      packed character classes
-o      output array size
-.TE
-.LP
-Lines in the rules section have the form ``expression  action''
-where the action may be continued on succeeding
-lines by using braces to delimit it.
-.PP
-Regular expressions in Lex use the following
-operators:
-.br
-.TS
-center;
-l l.
-x      the character "x"
-"x"    an "x", even if x is an operator.
-\ex    an "x", even if x is an operator.
-[xy]   the character x or y.
-[x\-z] the characters x, y or z.
-[^x]   any character but x.
-\&.    any character but newline.
-^x     an x at the beginning of a line.
-<y>x   an x when Lex is in start condition y.
-x$     an x at the end of a line.
-x?     an optional x.
-x\(**  0,1,2, ... instances of x.
-x+     1,2,3, ... instances of x.
-x|y    an x or a y.
-(x)    an x.
-x/y    an x but only if followed by y.
-{xx}   the translation of xx from the definitions section.
-x{m,n} \fIm\fR through \fIn\fR occurrences of x
-.TE
-.NH
-Caveats and Bugs.
-.PP
-There are pathological expressions which
-produce exponential growth of the tables when
-converted to deterministic machines;
-fortunately, they are rare.
-.PP
-REJECT does not rescan the input; instead it remembers the results of the previous
-scan.  This means that if a rule with trailing context is found, and
-REJECT executed, the user
-must not have used
-.ul
-unput
-to change the characters forthcoming
-from the input stream.
-This is the only restriction on the user's ability to manipulate
-the not-yet-processed input.
-.PP
-.2C
-.NH
-Acknowledgments.
-.PP
-As should
-be obvious from the above, the outside of Lex
-is patterned
-on Yacc and the inside on Aho's string matching routines.
-Therefore, both S. C. Johnson and A. V. Aho
-are really originators
-of much of Lex,
-as well as debuggers of it.
-Many thanks are due to both.
-.PP
-The code of the current version of Lex was designed, written,
-and debugged by Eric Schmidt.
-.SG MH-1274-MEL-unix
-.sp 1
-.2C
-.NH
-References.
-.SP 1v
-.IP 1.
-B. W. Kernighan and D. M. Ritchie,
-.I
-The C Programming Language,
-.R
-Prentice-Hall, N. J. (1978).
-.IP 2.
-B. W. Kernighan,
-.I
-Ratfor: A Preprocessor for a Rational Fortran,
-.R
-Software \- Practice and Experience,
-\fB5\fR, pp. 395-496 (1975).
-.IP 3.
-S. C. Johnson,
-.I
-Yacc: Yet Another Compiler Compiler,
-.R
-Computing Science Technical Report No. 32,
-1975,
-.MH
-.if \n(tm (also TM 75-1273-6)
-.IP 4.
-A. V. Aho and M. J. Corasick,
-.I
-Efficient String Matching: An Aid to Bibliographic Search,
-.R
-Comm. ACM
-.B
-18,
-.R
-333-340 (1975).
-.IP 5.
-B. W. Kernighan, D. M. Ritchie and K. L. Thompson,
-.I
-QED Text Editor,
-.R
-Computing Science Technical Report No. 5,
-1972,
-.MH
-.IP 6.
-D. M. Ritchie,
-private communication.
-See also
-M. E. Lesk,
-.I
-The Portable C Library,
-.R
-Computing Science Technical Report No. 31,
-.MH
-.if \n(tm (also TM 75-1274-11)
diff --git a/.ref-Research-V7/usr/doc/lint b/.ref-Research-V7/usr/doc/lint
deleted file mode 100644 (file)
index d1f5819..0000000
+++ /dev/null
@@ -1,1063 +0,0 @@
-.RP
-.ND "July 26, 1978"
-.OK
-Program Portability
-Strong Type Checking
-.TL
-Lint, a C Program Checker
-.AU "MH 2C-559" 3968
-S. C. Johnson
-.AI
-.MH
-.AB
-.PP
-.I Lint
-is a command which examines C source programs,
-detecting
-a number of bugs and obscurities.
-It enforces the type rules of C more strictly than
-the C compilers.
-It may also be used to enforce a number of portability
-restrictions involved in moving
-programs between different machines and/or operating systems.
-Another option detects a number of wasteful, or error prone, constructions
-which nevertheless are, strictly speaking, legal.
-.PP
-.I Lint
-accepts multiple input files and library specifications, and checks them for consistency.
-.PP
-The separation of function between
-.I lint
-and the C compilers has both historical and practical
-rationale.
-The compilers turn C programs into executable files rapidly
-and efficiently.
-This is possible in part because the
-compilers do not do sophisticated
-type checking, especially between
-separately compiled programs.
-.I Lint
-takes a more global, leisurely view of the program,
-looking much more carefully at the compatibilities.
-.PP
-This document discusses the use of
-.I lint ,
-gives an overview of the implementation, and gives some hints on the
-writing of machine independent C code.
-.AE
-.CS 10 2 12 0 0 5
-.SH
-Introduction and Usage
-.PP
-Suppose there are two C
-.[
-Kernighan Ritchie Programming Prentice 1978
-.]
-source files,
-.I file1. c
-and
-.I file2.c  ,
-which are ordinarily compiled and loaded together.
-Then the command
-.DS
-lint  file1.c  file2.c
-.DE
-produces messages describing inconsistencies and inefficiencies
-in the programs.
-The program enforces the typing rules of C
-more strictly than the C compilers
-(for both historical and practical reasons)
-enforce them.
-The command
-.DS
-lint  \-p  file1.c  file2.c
-.DE
-will produce, in addition to the above messages, additional messages
-which relate to the portability of the programs to other operating
-systems and machines.
-Replacing the
-.B \-p
-by
-.B \-h
-will produce messages about various error-prone or wasteful constructions
-which, strictly speaking, are not bugs.
-Saying
-.B \-hp
-gets the whole works.
-.PP
-The next several sections describe the major messages;
-the document closes with sections
-discussing the implementation and giving suggestions
-for writing portable C.
-An appendix gives a summary of the
-.I lint
-options.
-.SH
-A Word About Philosophy
-.PP
-Many of the facts which
-.I lint
-needs may be impossible to
-discover.
-For example, whether a given function in a program ever gets called
-may depend on the input data.
-Deciding whether
-.I exit
-is ever called is equivalent to solving the famous ``halting problem,'' known to be
-recursively undecidable.
-.PP
-Thus, most of the
-.I lint
-algorithms are a compromise.
-If a function is never mentioned, it can never be called.
-If a function is mentioned,
-.I lint
-assumes it can be called; this is not necessarily so, but in practice is quite reasonable.
-.PP
-.I Lint
-tries to give information with a high degree of relevance.
-Messages of the form ``\fIxxx\fR might be a bug''
-are easy to generate, but are acceptable only in proportion
-to the fraction of real bugs they uncover.
-If this fraction of real bugs is too small, the messages lose their credibility
-and serve merely to clutter up the output,
-obscuring the more important messages.
-.PP
-Keeping these issues in mind, we now consider in more detail
-the classes of messages which
-.I lint
-produces.
-.SH
-Unused Variables and Functions
-.PP
-As sets of programs evolve and develop,
-previously used variables and arguments to
-functions may become unused;
-it is not uncommon for external variables, or even entire
-functions, to become unnecessary, and yet
-not be removed from the source.
-These ``errors of commission'' rarely cause working programs to fail, but they are a source
-of inefficiency, and make programs harder to understand
-and change.
-Moreover, information about such unused variables and functions can occasionally
-serve to discover bugs; if a function does a necessary job, and
-is never called, something is wrong!
-.PP
-.I Lint
-complains about variables and functions which are defined but not otherwise
-mentioned.
-An exception is variables which are declared through explicit
-.B extern
-statements but are never referenced; thus the statement
-.DS
-extern  float  sin(\|);
-.DE
-will evoke no comment if
-.I sin
-is never used.
-Note that this agrees with the semantics of the C compiler.
-In some cases, these unused external declarations might be of some interest; they
-can be discovered by adding the
-.B \-x
-flag to the
-.I lint
-invocation.
-.PP
-Certain styles of programming
-require many functions to be written with similar interfaces;
-frequently, some of the arguments may be unused
-in many of the calls.
-The
-.B \-v
-option is available to suppress the printing of
-complaints about unused arguments.
-When
-.B \-v
-is in effect, no messages are produced about unused
-arguments except for those
-arguments which are unused and also declared as
-register arguments; this can be considered
-an active (and preventable) waste of the register
-resources of the machine.
-.PP
-There is one case where information about unused, or
-undefined, variables is more distracting
-than helpful.
-This is when
-.I lint
-is applied to some, but not all, files out of a collection
-which are to be loaded together.
-In this case, many of the functions and variables defined
-may not be used, and, conversely,
-many functions and variables defined elsewhere may be used.
-The
-.B \-u
-flag may be used to suppress the spurious messages which might otherwise appear.
-.SH
-Set/Used Information
-.PP
-.I Lint
-attempts to detect cases where a variable is used before it is set.
-This is very difficult to do well;
-many algorithms take a good deal of time and space,
-and still produce messages about perfectly valid programs.
-.I Lint
-detects local variables (automatic and register storage classes)
-whose first use appears physically earlier in the input file than the first assignment to the variable.
-It assumes that taking the address of a variable constitutes a ``use,'' since the actual use
-may occur at any later time, in a data dependent fashion.
-.PP
-The restriction to the physical appearance of variables in the file makes the
-algorithm very simple and quick to implement,
-since the true flow of control need not be discovered.
-It does mean that
-.I lint
-can complain about some programs which are legal,
-but these programs would probably be considered bad on stylistic grounds (e.g. might
-contain at least two \fBgoto\fR's).
-Because static and external variables are initialized to 0,
-no meaningful information can be discovered about their uses.
-The algorithm deals correctly, however, with initialized automatic variables, and variables
-which are used in the expression which first sets them.
-.PP
-The set/used information also permits recognition of those local variables which are set
-and never used; these form a frequent source of inefficiencies, and may also be symptomatic of bugs.
-.SH
-Flow of Control
-.PP
-.I Lint
-attempts to detect unreachable portions of the programs which it processes.
-It will complain about unlabeled statements immediately following
-\fBgoto\fR, \fBbreak\fR, \fBcontinue\fR, or \fBreturn\fR statements.
-An attempt is made to detect loops which can never be left at the bottom, detecting the
-special cases
-\fBwhile\fR( 1 ) and \fBfor\fR(;;) as infinite loops.
-.I Lint
-also complains about loops which cannot be entered at the top;
-some valid programs may have such loops, but at best they are bad style,
-at worst bugs.
-.PP
-.I Lint
-has an important area of blindness in the flow of control algorithm:
-it has no way of detecting functions which are called and never return.
-Thus, a call to
-.I exit
-may cause unreachable code which
-.I lint
-does not detect; the most serious effects of this are in the
-determination of returned function values (see the next section).
-.PP
-One form of unreachable statement is not usually complained about by
-.I lint;
-a
-.B break
-statement that cannot be reached causes no message.
-Programs generated by
-.I yacc ,
-.[
-Johnson Yacc 1975
-.]
-and especially
-.I lex ,
-.[
-Lesk Lex
-.]
-may have literally hundreds of unreachable
-.B break
-statements.
-The
-.B \-O
-flag in the C compiler will often eliminate the resulting object code inefficiency.
-Thus, these unreached statements are of little importance,
-there is typically nothing the user can do about them, and the
-resulting messages would clutter up the
-.I lint
-output.
-If these messages are desired,
-.I lint
-can be invoked with the
-.B \-b
-option.
-.SH
-Function Values
-.PP
-Sometimes functions return values which are never used;
-sometimes programs incorrectly use function ``values''
-which have never been returned.
-.I Lint
-addresses this problem in a number of ways.
-.PP
-Locally, within a function definition,
-the appearance of both
-.DS
-return(  \fIexpr\fR  );
-.DE
-and
-.DS
-return ;
-.DE
-statements is cause for alarm;
-.I lint
-will give the message
-.DS
-function \fIname\fR contains return(e) and return
-.DE
-The most serious difficulty with this is detecting when a function return is implied
-by flow of control reaching the end of the function.
-This can be seen with a simple example:
-.DS
-.ta .5i 1i 1.5i
-\fRf ( a ) {
-       if ( a ) return ( 3 );
-       g (\|);
-       }
-.DE
-Notice that, if \fIa\fR tests false, \fIf\fR will call \fIg\fR and then return
-with no defined return value; this will trigger a complaint from
-.I lint .
-If \fIg\fR, like \fIexit\fR, never returns,
-the message will still be produced when in fact nothing is wrong.
-.PP
-In practice, some potentially serious bugs have been discovered by this feature;
-it also accounts for a substantial fraction of the ``noise'' messages produced
-by
-.I lint .
-.PP
-On a global scale,
-.I lint
-detects cases where a function returns a value, but this value is sometimes,
-or always, unused.
-When the value is always unused, it may constitute an inefficiency in the function definition.
-When the value is sometimes unused, it may represent bad style (e.g., not testing for
-error conditions).
-.PP
-The dual problem, using a function value when the function does not return one,
-is also detected.
-This is a serious problem.
-Amazingly, this bug has been observed on a couple of occasions
-in ``working'' programs; the desired function value just happened to have been computed
-in the function return register!
-.SH
-Type Checking
-.PP
-.I Lint
-enforces the type checking rules of C more strictly than the compilers do.
-The additional checking is in four major areas:
-across certain binary operators and implied assignments,
-at the structure selection operators,
-between the definition and uses of functions,
-and in the use of enumerations.
-.PP
-There are a number of operators which have an implied balancing between types of the operands.
-The assignment, conditional ( ?\|: ), and relational operators
-have this property; the argument
-of a \fBreturn\fR statement,
-and expressions used in initialization also suffer similar conversions.
-In these operations,
-\fBchar\fR, \fBshort\fR, \fBint\fR, \fBlong\fR, \fBunsigned\fR, \fBfloat\fR, and \fBdouble\fR types may be freely intermixed.
-The types of pointers must agree exactly,
-except that arrays of \fIx\fR's can, of course, be intermixed with pointers to \fIx\fR's.
-.PP
-The type checking rules also require that, in structure references, the
-left operand of the \(em> be a pointer to structure, the left operand of the \fB.\fR
-be a structure, and the right operand of these operators be a member
-of the structure implied by the left operand.
-Similar checking is done for references to unions.
-.PP
-Strict rules apply to function argument and return value
-matching.
-The types \fBfloat\fR and \fBdouble\fR may be freely matched,
-as may the types \fBchar\fR, \fBshort\fR, \fBint\fR, and \fBunsigned\fR.
-Also, pointers can be matched with the associated arrays.
-Aside from this, all actual arguments must agree in type with their declared counterparts.
-.PP
-With enumerations, checks are made that enumeration variables or members are not mixed
-with other types, or other enumerations,
-and that the only operations applied are =, initialization, ==, !=, and function arguments and return values.
-.SH
-Type Casts
-.PP
-The type cast feature in C was introduced largely as an aid
-to producing more portable programs.
-Consider the assignment
-.DS
-p = 1 ;
-.DE
-where
-.I p
-is a character pointer.
-.I Lint
-will quite rightly complain.
-Now, consider the assignment
-.DS
-p = (char \(**)1 ;
-.DE
-in which a cast has been used to
-convert the integer to a character pointer.
-The programmer obviously had a strong motivation
-for doing this, and has clearly signaled his intentions.
-It seems harsh for
-.I lint
-to continue to complain about this.
-On the other hand, if this code is moved to another
-machine, such code should be looked at carefully.
-The
-.B \-c
-flag controls the printing of comments about casts.
-When
-.B \-c
-is in effect, casts are treated as though they were assignments
-subject to complaint; otherwise, all legal casts are passed without comment,
-no matter how strange the type mixing seems to be.
-.SH
-Nonportable Character Use
-.PP
-On the PDP-11, characters are signed quantities, with a range
-from \-128 to 127.
-On most of the other C implementations, characters take on only positive
-values.
-Thus,
-.I lint
-will flag certain comparisons and assignments as being
-illegal or nonportable.
-For example, the fragment
-.DS
-char c;
-       ...
-if( (c = getchar(\|)) < 0 ) ....
-.DE
-works on the PDP-11, but
-will fail on machines where characters always take
-on positive values.
-The real solution is to declare
-.I c
-an integer, since
-.I getchar
-is actually returning
-integer values.
-In any case,
-.I lint
-will say
-``nonportable character comparison''.
-.PP
-A similar issue arises with bitfields; when assignments
-of constant values are made to bitfields, the field may
-be too small to hold the value.
-This is especially true because
-on some machines bitfields are considered as signed
-quantities.
-While it may seem unintuitive to consider
-that a two bit field declared of type
-.B int
-cannot hold the value 3, the problem disappears
-if the bitfield is declared to have type
-.B unsigned .
-.SH
-Assignments of longs to ints
-.PP
-Bugs may arise from the assignment of
-.B long
-to
-an
-.B int ,
-which loses accuracy.
-This may happen in programs
-which have been incompletely converted to use
-.B typedefs .
-When a
-.B typedef
-variable
-is changed from \fBint\fR to \fBlong\fR,
-the program can stop working because
-some intermediate results may be assigned
-to \fBints\fR, losing accuracy.
-Since there are a number of legitimate reasons for
-assigning \fBlongs\fR to \fBints\fR, the detection
-of these assignments is enabled
-by the
-.B \-a
-flag.
-.SH
-Strange Constructions
-.PP
-Several perfectly legal, but somewhat strange, constructions
-are flagged by
-.I lint;
-the messages hopefully encourage better code quality, clearer style, and
-may even point out bugs.
-The
-.B \-h
-flag is used to enable these checks.
-For example, in the statement
-.DS
-\(**p++ ;
-.DE
-the \(** does nothing; this provokes the message ``null effect'' from
-.I lint .
-The program fragment
-.DS
-unsigned x ;
-if( x < 0 ) ...
-.DE
-is clearly somewhat strange; the
-test will never succeed.
-Similarly, the test
-.DS
-if( x > 0 ) ...
-.DE
-is equivalent to
-.DS
-if( x != 0 )
-.DE
-which may not be the intended action.
-.I Lint
-will say ``degenerate unsigned comparison'' in these cases.
-If one says
-.DS
-if( 1 != 0 ) ....
-.DE
-.I lint
-will report
-``constant in conditional context'', since the comparison
-of 1 with 0 gives a constant result.
-.PP
-Another construction
-detected by
-.I lint
-involves
-operator precedence.
-Bugs which arise from misunderstandings about the precedence
-of operators can be accentuated by spacing and formatting,
-making such bugs extremely hard to find.
-For example, the statements
-.DS
-if( x&077 == 0 ) ...
-.DE
-or
-.DS
-x<\h'-.3m'<2 + 40
-.DE
-probably do not do what was intended.
-The best solution is to parenthesize such expressions,
-and
-.I lint
-encourages this by an appropriate message.
-.PP
-Finally, when the
-.B \-h
-flag is in force
-.I lint
-complains about variables which are redeclared in inner blocks
-in a way that conflicts with their use in outer blocks.
-This is legal, but is considered by many (including the author) to
-be bad style, usually unnecessary, and frequently a bug.
-.SH
-Ancient History
-.PP
-There are several forms of older syntax which are being officially
-discouraged.
-These fall into two classes, assignment operators and initialization.
-.PP
-The older forms of assignment operators (e.g., =+, =\-, . . . )
-could cause ambiguous expressions, such as
-.DS
-a  =\-1 ;
-.DE
-which could be taken as either
-.DS
-a =\-  1 ;
-.DE
-or
-.DS
-a  =  \-1 ;
-.DE
-The situation is especially perplexing if this
-kind of ambiguity arises as the result of a macro substitution.
-The newer, and preferred operators (+=, \-=, etc. )
-have no such ambiguities.
-To spur the abandonment of the older forms,
-.I lint
-complains about these old fashioned operators.
-.PP
-A similar issue arises with initialization.
-The older language allowed
-.DS
-int  x  \fR1 ;
-.DE
-to initialize
-.I x
-to 1.
-This also caused syntactic difficulties: for example,
-.DS
-int  x  ( \-1 ) ;
-.DE
-looks somewhat like the beginning of a function declaration:
-.DS
-int  x  ( y ) {  . . .
-.DE
-and the compiler must read a fair ways past
-.I x
-in order to sure what the declaration really is..
-Again, the problem is even more perplexing when the
-initializer involves a macro.
-The current syntax places an equals sign between the
-variable and the initializer:
-.DS
-int  x  =  \-1 ;
-.DE
-This is free of any possible syntactic ambiguity.
-.SH
-Pointer Alignment
-.PP
-Certain pointer assignments may be reasonable on some machines,
-and illegal on others, due entirely to
-alignment restrictions.
-For example, on the PDP-11, it is reasonable
-to assign integer pointers to double pointers, since
-double precision values may begin on any integer boundary.
-On the Honeywell 6000, double precision values must begin
-on even word boundaries;
-thus, not all such assignments make sense.
-.I Lint
-tries to detect cases where pointers are assigned to other
-pointers, and such alignment problems might arise.
-The message ``possible pointer alignment problem''
-results from this situation whenever either the
-.B \-p
-or
-.B \-h
-flags are in effect.
-.SH
-Multiple Uses and Side Effects
-.PP
-In complicated expressions, the best order in which to evaluate
-subexpressions may be highly machine dependent.
-For example, on machines (like the PDP-11) in which the stack
-runs backwards, function arguments will probably be best evaluated
-from right-to-left; on machines with a stack running forward,
-left-to-right seems most attractive.
-Function calls embedded as arguments of other functions
-may or may not be treated similarly to ordinary arguments.
-Similar issues arise with other operators which have side effects,
-such as the assignment operators and the increment and decrement operators.
-.PP
-In order that the efficiency of C on a particular machine not be
-unduly compromised, the C language leaves the order
-of evaluation of complicated expressions up to the
-local compiler, and, in fact, the various C compilers have considerable
-differences in the order in which they will evaluate complicated
-expressions.
-In particular, if any variable is changed by a side effect, and
-also used elsewhere in the same expression, the result is explicitly undefined.
-.PP
-.I Lint
-checks for the important special case where
-a simple scalar variable is affected.
-For example, the statement
-.DS
-\fIa\fR[\fIi\|\fR] = \fIb\fR[\fIi\fR++] ;
-.DE
-will draw the complaint:
-.DS
-warning: \fIi\fR evaluation order undefined
-.DE
-.SH
-Implementation
-.PP
-.I Lint
-consists of two programs and a driver.
-The first program is a version of the
-Portable C Compiler
-.[
-Johnson Ritchie BSTJ Portability Programs System
-.]
-.[
-Johnson portable compiler  1978
-.]
-which is the basis of the
-IBM 370, Honeywell 6000, and Interdata 8/32 C compilers.
-This compiler does lexical and syntax analysis on the input text,
-constructs and maintains symbol tables, and builds trees for expressions.
-Instead of writing an intermediate file which is passed to
-a code generator, as the other compilers
-do,
-.I lint
-produces an intermediate file which consists of lines of ascii text.
-Each line contains an external variable name,
-an encoding of the context in which it was seen (use, definition, declaration, etc.),
-a type specifier, and a source file name and line number.
-The information about variables local to a function or file
-is collected
-by accessing the symbol table, and examining the expression trees.
-.PP
-Comments about local problems are produced as detected.
-The information about external names is collected
-onto an intermediate file.
-After all the source files and library descriptions have
-been collected, the intermediate file is sorted
-to bring all information collected about a given external
-name together.
-The second, rather small, program then reads the lines
-from the intermediate file and compares all of the
-definitions, declarations, and uses for consistency.
-.PP
-The driver controls this
-process, and is also responsible for making the options available
-to both passes of
-.I lint .
-.SH
-Portability
-.PP
-C on the Honeywell and IBM systems is used, in part, to write system code for the host operating system.
-This means that the implementation of C tends to follow local conventions rather than
-adhere strictly to
-.UX
-system conventions.
-Despite these differences, many C programs have been successfully moved to GCOS and the various IBM
-installations with little effort.
-This section describes some of the differences between the implementations, and
-discusses the
-.I lint
-features which encourage portability.
-.PP
-Uninitialized external variables are treated differently in different
-implementations of C.
-Suppose two files both contain a declaration without initialization, such as
-.DS
-int a ;
-.DE
-outside of any function.
-The
-.UX
-loader will resolve these declarations, and cause only a single word of storage
-to be set aside for \fIa\fR.
-Under the GCOS and IBM implementations, this is not feasible (for various stupid reasons!)
-so each such declaration causes a word of storage to be set aside and called \fIa\fR.
-When loading or library editing takes place, this causes fatal conflicts which prevent
-the proper operation of the program.
-If
-.I lint
-is invoked with the \fB\-p\fR flag,
-it will detect such multiple definitions.
-.PP
-A related difficulty comes from the amount of information retained about external names during the
-loading process.
-On the
-.UX
-system, externally known names have seven significant characters, with the upper/lower
-case distinction kept.
-On the IBM systems, there are eight significant characters, but the case distinction
-is lost.
-On GCOS, there are only six characters, of a single case.
-This leads to situations where programs run on the
-.UX
-system, but encounter loader
-problems on the IBM or GCOS systems.
-.I Lint
-.B \-p
-causes all external symbols to be mapped to one case and truncated to six characters,
-providing a worst-case analysis.
-.PP
-A number of differences arise in the area of character handling: characters in the
-.UX
-system are eight bit ascii, while they are eight bit ebcdic on the IBM, and
-nine bit ascii on GCOS.
-Moreover, character strings go from high to low bit positions (``left to right'')
-on GCOS and IBM, and low to high (``right to left'') on the PDP-11.
-This means that code attempting to construct strings
-out of character constants, or attempting to use characters as indices
-into arrays, must be looked at with great suspicion.
-.I Lint
-is of little help here, except to flag multi-character character constants.
-.PP
-Of course, the word sizes are different!
-This causes less trouble than might be expected, at least when
-moving from the
-.UX
-system (16 bit words) to the IBM (32 bits) or GCOS (36 bits).
-The main problems are likely to arise in shifting or masking.
-C now supports a bit-field facility, which can be used to write much of
-this code in a reasonably portable way.
-Frequently, portability of such code can be enhanced by
-slight rearrangements in coding style.
-Many of the incompatibilities seem to have the flavor of writing
-.DS
-x &= 0177700 ;
-.DE
-to clear the low order six bits of \fIx\fR.
-This suffices on the PDP-11, but fails badly on GCOS and IBM.
-If the bit field feature cannot be used, the same effect can be obtained by
-writing
-.DS
-x &= \(ap 077 ;
-.DE
-which will work on all these machines.
-.PP
-The right shift operator is arithmetic shift on the PDP-11, and logical shift on most
-other machines.
-To obtain a logical shift on all machines, the left operand can be
-typed \fBunsigned\fR.
-Characters are considered signed integers on the PDP-11, and unsigned on the other machines.
-This persistence of the sign bit may be reasonably considered a bug in the PDP-11 hardware
-which has infiltrated itself into the C language.
-If there were a good way to discover the programs which would be affected, C could be changed;
-in any case,
-.I lint
-is no help here.
-.PP
-The above discussion may have made the problem of portability seem
-bigger than it in fact is.
-The issues involved here are rarely subtle or mysterious, at least to the
-implementor of the program, although they can involve some work to straighten out.
-The most serious bar to the portability of
-.UX
-system utilities has been the inability to mimic
-essential
-.UX
-system functions on the other systems.
-The inability to seek to a random character position in a text file, or to establish a pipe
-between processes, has involved far more rewriting
-and debugging than any of the differences in C compilers.
-On the other hand,
-.I lint
-has been very helpful
-in moving the
-.UX
-operating system and associated
-utility programs to other machines.
-.SH
-Shutting Lint Up
-.PP
-There are occasions when
-the programmer is smarter than
-.I lint .
-There may be valid reasons for ``illegal'' type casts,
-functions with a variable number of arguments, etc.
-Moreover, as specified above, the flow of control information
-produced by
-.I lint
-often has blind spots, causing occasional spurious
-messages about perfectly reasonable programs.
-Thus, some way of communicating with
-.I lint ,
-typically to shut it up, is desirable.
-.PP
-The form which this mechanism should take is not at all clear.
-New keywords would require current and old compilers to
-recognize these keywords, if only to ignore them.
-This has both philosophical and practical problems.
-New preprocessor syntax suffers from similar problems.
-.PP
-What was finally done was to cause a number of words
-to be recognized by
-.I lint
-when they were embedded in comments.
-This required minimal preprocessor changes;
-the preprocessor just had to agree to pass comments
-through to its output, instead of deleting them
-as had been previously done.
-Thus,
-.I lint
-directives are invisible to the compilers, and
-the effect on systems with the older preprocessors
-is merely that the
-.I lint
-directives don't work.
-.PP
-The first directive is concerned with flow of control information;
-if a particular place in the program cannot be reached,
-but this is not apparent to
-.I lint ,
-this can be asserted by the directive
-.DS
-/* NOTREACHED */
-.DE
-at the appropriate spot in the program.
-Similarly, if it is desired to turn off
-strict type checking for
-the next expression, the directive
-.DS
-/* NOSTRICT */
-.DE
-can be used; the situation reverts to the
-previous default after the next expression.
-The
-.B \-v
-flag can be turned on for one function by the directive
-.DS
-/* ARGSUSED */
-.DE
-Complaints about variable number of arguments in calls to a function
-can be turned off by the directive
-.DS
-/* VARARGS */
-.DE
-preceding the function definition.
-In some cases, it is desirable to check the
-first several arguments, and leave the later arguments unchecked.
-This can be done by following the VARARGS keyword immediately
-with a digit giving the number of arguments which should be checked; thus,
-.DS
-/* VARARGS2 */
-.DE
-will cause the first two arguments to be checked, the others unchecked.
-Finally, the directive
-.DS
-/* LINTLIBRARY */
-.DE
-at the head of a file identifies this file as
-a library declaration file; this topic is worth a
-section by itself.
-.SH
-Library Declaration Files
-.PP
-.I Lint
-accepts certain library directives, such as
-.DS
-\-ly
-.DE
-and tests the source files for compatibility with these libraries.
-This is done by accessing library description files whose
-names are constructed from the library directives.
-These files all begin with the directive
-.DS
-/* LINTLIBRARY */
-.DE
-which is followed by a series of dummy function
-definitions.
-The critical parts of these definitions
-are the declaration of the function return type,
-whether the dummy function returns a value, and
-the number and types of arguments to the function.
-The VARARGS and ARGSUSED directives can
-be used to specify features of the library functions.
-.PP
-.I Lint
-library files are processed almost exactly like ordinary
-source files.
-The only difference is that functions which are defined on a library file,
-but are not used on a source file, draw no complaints.
-.I Lint
-does not simulate a full library search algorithm,
-and complains if the source files contain a redefinition of
-a library routine (this is a feature!).
-.PP
-By default,
-.I lint
-checks the programs it is given against a standard library
-file, which contains descriptions of the programs which
-are normally loaded when
-a C program
-is run.
-When the
-.B -p
-flag is in effect, another file is checked containing
-descriptions of the standard I/O library routines
-which are expected to be portable across various machines.
-The
-.B -n
-flag can be used to suppress all library checking.
-.SH
-Bugs, etc.
-.PP
-.I Lint
-was a difficult program to write, partially
-because it is closely connected with matters of programming style,
-and partially because users usually don't notice bugs which cause
-.I lint
-to miss errors which it should have caught.
-(By contrast, if
-.I lint
-incorrectly complains about something that is correct, the
-programmer reports that immediately!)
-.PP
-A number of areas remain to be further developed.
-The checking of structures and arrays is rather inadequate;
-size
-incompatibilities go unchecked,
-and no attempt is made to match up structure and union
-declarations across files.
-Some stricter checking of the use of the
-.B typedef
-is clearly desirable, but what checking is appropriate, and how
-to carry it out, is still to be determined.
-.PP
-.I Lint
-shares the preprocessor with the C compiler.
-At some point it may be appropriate for a
-special version of the preprocessor to be constructed
-which checks for things such as unused macro definitions,
-macro arguments which have side effects which are
-not expanded at all, or are expanded more than once, etc.
-.PP
-The central problem with
-.I lint
-is the packaging of the information which it collects.
-There are many options which
-serve only to turn off, or slightly modify,
-certain features.
-There are pressures to add even more of these options.
-.PP
-In conclusion, it appears that the general notion of having two
-programs is a good one.
-The compiler concentrates on quickly and accurately turning the
-program text into bits which can be run;
-.I lint
-concentrates on issues
-of portability, style, and efficiency.
-.I Lint
-can afford to be wrong, since incorrectness and over-conservatism
-are merely annoying, not fatal.
-The compiler can be fast since it knows that
-.I lint
-will cover its flanks.
-Finally, the programmer can
-concentrate at one stage
-of the programming process solely on the algorithms,
-data structures, and correctness of the
-program, and then later retrofit,
-with the aid of
-.I lint ,
-the desirable properties of universality and portability.
-.SG MH-1273-SCJ-unix
-.bp
-.[
-$LIST$
-.]
-.bp
-.SH
-Appendix:   Current Lint Options
-.PP
-The command currently has the form
-.DS
-lint\fR [\fB\-\fRoptions ] files... library-descriptors...
-.DE
-The options are
-.IP \fBh\fR
-Perform heuristic checks
-.IP \fBp\fR
-Perform portability checks
-.IP \fBv\fR
-Don't report unused arguments
-.IP \fBu\fR
-Don't report unused or undefined externals
-.IP \fBb\fR
-Report unreachable
-.B break
-statements.
-.IP \fBx\fR
-Report unused external declarations
-.IP \fBa\fR
-Report assignments of
-.B long
-to
-.B int
-or shorter.
-.IP \fBc\fR
-Complain about questionable casts
-.IP \fBn\fR
-No library checking is done
-.IP \fBs\fR
-Same as
-.B h
-(for historical reasons)
diff --git a/.ref-Research-V7/usr/doc/m4 b/.ref-Research-V7/usr/doc/m4
deleted file mode 100644 (file)
index 673dcca..0000000
+++ /dev/null
@@ -1,929 +0,0 @@
-.if n .ls 2
-.tr _\(em
-.tr *\(**
-.de UC
-\&\\$3\s-1\\$1\\s0\&\\$2
-..
-.de IT
-.if n .ul
-\&\\$3\f2\\$1\fP\&\\$2
-..
-.de UL
-.if n .ul
-\&\\$3\f3\\$1\fP\&\\$2
-..
-.de P1
-.DS I 3n
-.if n .ls 2
-.nf
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ta .4i .8i 1.2i 1.6i 2i 2.4i 2.8i 3.2i 3.6i 4i 4.4i 4.8i 5.2i 5.6i
-.if t .tr -\(mi|\(bv'\(fm^\(no*\(**
-.tr `\(ga'\(aa
-.if t .tr _\(ul
-.ft 3
-.lg 0
-..
-.de P2
-.ps \\n(PS
-.vs \\n(VSp
-.ft R
-.if n .ls 2
-.tr --||''^^!!
-.if t .tr _\(em
-.fi
-.lg
-.DE
-.if t .tr _\(em
-..
-.hw semi-colon
-.hw estab-lished
-.hy 14
-.              \"2=not last lines; 4= no -xx; 8=no xx-
-.              \"special chars in programs
-.      \" start of text
-.RP
-.....TR 59
-.....TM 77-1273-6 39199 39199-11
-.ND "July 1, 1977"
-.TL
-The M4 Macro Processor
-.AU "MH 2C-518" 6021
-Brian W. Kernighan
-.AU "MH 2C-517" 3770
-Dennis M. Ritchie
-.AI
-.MH
-.AB
-.PP
-M4 is a macro processor available on
-.UX
-and
-.UC GCOS .
-Its primary use has been as a
-front end for Ratfor for those
-cases where parameterless macros 
-are not adequately powerful.
-It has also been used for languages as disparate as C and Cobol.
-M4 is particularly suited for functional languages like Fortran, PL/I and C
-since macros are specified in a functional notation.
-.PP
-M4 provides features seldom found even in much larger
-macro processors, 
-including
-.IP "  \(bu"
-arguments
-.IP "  \(bu"
-condition testing
-.IP "  \(bu"
-arithmetic capabilities
-.IP "  \(bu"
-string and substring functions
-.IP "  \(bu"
-file manipulation
-.LP
-.PP
-This paper is a user's manual for M4.
-.AE
-.CS 6 0 6 0 0 1
-.if t .2C
-.SH
-Introduction
-.PP
-A macro processor is a useful way to enhance a programming language,
-to make it more palatable
-or more readable,
-or to tailor it to a particular application.
-The
-.UL #define
-statement in C
-and the analogous
-.UL define
-in Ratfor
-are examples of the basic facility provided by
-any macro processor _
-replacement of text by other text.
-.PP
-The M4 macro processor is an extension of a macro processor called M3
-which was written by D. M. Ritchie
-for the AP-3 minicomputer;
-M3 was in turn based on a macro processor implemented for [1].
-Readers unfamiliar with the basic ideas of macro processing
-may wish to read some of the discussion there.
-.PP
-M4 is a suitable front end for Ratfor and C,
-and has also been used successfully with Cobol.
-Besides the straightforward replacement of one string of text by another,
-it provides
-macros with arguments,
-conditional macro expansion,
-arithmetic,
-file manipulation,
-and some specialized string processing functions.
-.PP
-The basic operation of M4
-is to copy its input to its output.
-As the input is read, however, each alphanumeric ``token''
-(that is, string of letters and digits) is checked.
-If it is the name of a macro,
-then the name of the macro is replaced by its defining text,
-and the resulting string is pushed back onto the
-input to be rescanned.
-Macros may be called with arguments, in which case the arguments are collected
-and substituted into the right places in the defining text
-before it is rescanned.
-.PP
-M4 provides a collection of about twenty built-in
-macros
-which perform various useful operations;
-in addition, the user can define new macros.
-Built-ins and user-defined macros work exactly the same way, except that
-some of the built-in macros have side effects
-on the state of the process.
-.SH
-Usage
-.PP
-On
-.UC UNIX ,
-use
-.P1
-m4 [files]
-.P2
-Each argument file is processed in order;
-if there are no arguments, or if an argument
-is `\-',
-the standard input is read at that point.
-The processed text is written on the standard output,
-which may be captured for subsequent processing with
-.P1
-m4 [files] >outputfile
-.P2
-On
-.UC GCOS ,
-usage is identical, but the program is called
-.UL \&./m4 .
-.SH
-Defining Macros
-.PP
-The primary built-in function of M4
-is
-.UL define ,
-which is used to define new macros.
-The input
-.P1
-define(name, stuff)
-.P2
-causes the string
-.UL name
-to be defined as
-.UL stuff .
-All subsequent occurrences of
-.UL name
-will be replaced by
-.UL stuff .
-.UL name
-must be alphanumeric and must begin with a letter
-(the underscore \(ul counts as a letter).
-.UL stuff
-is any text that contains balanced parentheses;
-it may stretch over multiple lines.
-.PP
-Thus, as a typical example,
-.P1
-define(N, 100)
- ...
-if (i > N)
-.P2
-defines
-.UL N
-to be 100, and uses this ``symbolic constant'' in a later
-.UL if
-statement.
-.PP
-The left parenthesis must immediately follow the word
-.UL define ,
-to signal that
-.UL define
-has arguments.
-If a macro or built-in name is not followed immediately by `(',
-it is assumed to have no arguments.
-This is the situation for
-.UL N
-above;
-it is actually a macro with no arguments,
-and thus when it is used there need be no (...) following it.
-.PP
-You should also notice that a macro name is only recognized as such
-if it appears surrounded by non-alphanumerics.
-For example, in
-.P1
-define(N, 100)
- ...
-if (NNN > 100)
-.P2
-the variable 
-.UL NNN
-is absolutely unrelated to the defined macro
-.UL N ,
-even though it contains a lot of
-.UL N 's.
-.PP
-Things may be defined in terms of other things.
-For example,
-.P1
-define(N, 100)
-define(M, N)
-.P2
-defines both M and N to be 100.
-.PP
-What happens if
-.UL N
-is redefined?
-Or, to say it another way, is
-.UL M 
-defined as
-.UL N
-or as 100?
-In M4,
-the latter is true _
-.UL M
-is 100, so even if
-.UL N 
-subsequently changes,
-.UL M
-does not.
-.PP
-This behavior arises because
-M4 expands macro names into their defining text as soon as it possibly can.
-Here, that means that when the string
-.UL N
-is seen as the arguments of
-.UL define
-are being collected, it is immediately replaced by 100;
-it's just as if you had said
-.P1
-define(M, 100)
-.P2
-in the first place.
-.PP
-If this isn't what you really want, there are two ways out of it.
-The first, which is specific to this situation,
-is to interchange the order of the definitions:
-.P1
-define(M, N)
-define(N, 100)
-.P2
-Now
-.UL M
-is defined to be the string
-.UL N ,
-so when you ask for 
-.UL M
-later, you'll always get the value of
-.UL N 
-at that time
-(because the
-.UL M
-will be replaced by
-.UL N
-which will be replaced by 100).
-.SH
-Quoting
-.PP
-The more general solution is to delay the expansion of
-the arguments of
-.UL define 
-by
-.ul
-quoting
-them.
-Any text surrounded by the single quotes \(ga and \(aa
-is not expanded immediately, but has the quotes stripped off.
-If you say
-.P1
-define(N, 100)
-define(M, `N')
-.P2
-the quotes around the
-.UL N
-are stripped off as the argument is being collected,
-but they have served their purpose, and 
-.UL M
-is defined as
-the string
-.UL N ,
-not 100.
-The general rule is that M4 always strips off
-one level of single quotes whenever it evaluates
-something.
-This is true even outside of
-macros.
-If you want the word
-.UL define
-to appear in the output,
-you have to quote it in the input,
-as in
-.P1
-       `define' = 1;
-.P2
-.PP
-As another instance of the same thing, which is a bit more surprising,
-consider redefining
-.UL N :
-.P1
-define(N, 100)
- ...
-define(N, 200)
-.P2
-Perhaps regrettably, the
-.UL N
-in the second definition is
-evaluated as soon as it's seen;
-that is, it is
-replaced by
-100, so it's as if you had written
-.P1
-define(100, 200)
-.P2
-This statement is ignored by M4, since you can only define things that look
-like names, but it obviously doesn't have the effect you wanted.
-To really redefine 
-.UL N ,
-you must delay the evaluation by quoting:
-.P1
-define(N, 100)
- ...
-define(`N', 200)
-.P2
-In M4,
-it is often wise to quote the first argument of a macro.
-.PP
-If \` and \' are not convenient for some reason,
-the quote characters can be changed with the built-in
-.UL changequote :
-.P1
-changequote([, ])
-.P2
-makes the new quote characters the left and right brackets.
-You can restore the original characters with just
-.P1
-changequote
-.P2
-.PP
-There are two additional built-ins related to
-.UL define .
-.UL undefine
-removes the definition of some macro or built-in:
-.P1
-undefine(`N')
-.P2
-removes the definition of
-.UL N .
-(Why are the quotes absolutely necessary?)
-Built-ins can be removed with 
-.UL undefine ,
-as in
-.P1
-undefine(`define')
-.P2
-but once you remove one, you can never get it back.
-.PP
-The built-in 
-.UL ifdef
-provides a way to determine if a macro is currently defined.
-In particular, M4 has pre-defined the names
-.UL unix
-and
-.UL gcos
-on the corresponding systems, so you can
-tell which one you're using:
-.P1
-ifdef(`unix', `define(wordsize,16)' )
-ifdef(`gcos', `define(wordsize,36)' )
-.P2
-makes a definition appropriate for the particular machine.
-Don't forget the quotes!
-.PP
-.UL ifdef
-actually permits three arguments;
-if the name is undefined, the value of
-.UL ifdef
-is then the third argument, as in
-.P1
-ifdef(`unix', on UNIX, not on UNIX)
-.P2
-.SH
-Arguments
-.PP
-So far we have discussed the simplest form of macro processing _
-replacing one string by another (fixed) string.
-User-defined macros may also have arguments, so different invocations
-can have different results.
-Within the replacement text for a macro
-(the second argument of its
-.UL define )
-any occurrence of
-.UL $n
-will be replaced by the 
-.UL n th
-argument when the macro
-is actually used.
-Thus, the macro
-.UL bump ,
-defined as
-.P1
-define(bump, $1 = $1 + 1)
-.P2
-generates code to increment its argument by 1:
-.P1
-bump(x)
-.P2
-is
-.P1
-x = x + 1
-.P2
-.PP
-A macro can have as many arguments as you want,
-but only the first nine are accessible,
-through
-.UL $1
-to
-.UL $9 .
-(The macro name itself is
-.UL $0 ,
-although that is less commonly used.)
-Arguments that are not supplied are replaced by null strings,
-so
-we can define a macro
-.UL cat
-which simply concatenates its arguments, like this:
-.P1
-define(cat, $1$2$3$4$5$6$7$8$9)
-.P2
-Thus
-.P1
-cat(x, y, z)
-.P2
-is equivalent to
-.P1
-xyz
-.P2
-.UL $4
-through
-.UL $9
-are null, since no corresponding arguments were provided.
-.PP
-.PP
-Leading unquoted blanks, tabs, or newlines that occur during argument collection
-are discarded.
-All other white space is retained.
-Thus
-.P1
-define(a,   b   c)
-.P2
-defines
-.UL a
-to be
-.UL b\ \ \ c .
-.PP
-Arguments are separated by commas, but parentheses are counted properly,
-so a comma ``protected'' by parentheses does not terminate an argument.
-That is, in
-.P1
-define(a, (b,c))
-.P2
-there are only two arguments;
-the second is literally
-.UL (b,c) .
-And of course a bare comma or parenthesis can be inserted by quoting it.
-.SH
-Arithmetic Built-ins
-.PP
-M4 provides two built-in functions for doing arithmetic
-on integers (only).
-The simplest is
-.UL incr ,
-which increments its numeric argument by 1.
-Thus to handle the common programming situation
-where you want a variable to be defined as ``one more than N'',
-write
-.P1
-define(N, 100)
-define(N1, `incr(N)')
-.P2
-Then
-.UL N1
-is defined as one more than the current value of
-.UL N .
-.PP
-The more general mechanism for arithmetic is a built-in
-called
-.UL eval ,
-which is capable of arbitrary arithmetic on integers.
-It provides the operators
-(in decreasing order of precedence)
-.DS
-unary + and \(mi
-** or ^        (exponentiation)
-*  /  % (modulus)
-+  \(mi
-==  !=  <  <=  >  >=
-!              (not)
-& or &&        (logical and)
-\(or or \(or\(or               (logical or)
-.DE
-Parentheses may be used to group operations where needed.
-All the operands of
-an expression given to
-.UL eval
-must ultimately be numeric.
-The numeric value of a true relation
-(like 1>0)
-is 1, and false is 0.
-The precision in
-.UL eval
-is
-32 bits on
-.UC UNIX
-and 36 bits on
-.UC GCOS .
-.PP
-As a simple example, suppose we want 
-.UL M
-to be 
-.UL 2**N+1 .
-Then
-.P1
-define(N, 3)   
-define(M, `eval(2**N+1)')
-.P2
-As a matter of principle, it is advisable
-to quote the defining text for a macro
-unless it is very simple indeed
-(say just a number);
-it usually gives the result you want,
-and is a good habit to get into.
-.SH
-File Manipulation
-.PP
-You can include a new file in the input at any time by
-the built-in function
-.UL include :
-.P1
-include(filename)
-.P2
-inserts the contents of
-.UL filename
-in place of the
-.UL include
-command.
-The contents of the file is often a set of definitions.
-The value
-of
-.UL include
-(that is, its replacement text)
-is the contents of the file;
-this can be captured in definitions, etc.
-.PP
-It is a fatal error if the file named in
-.UL include
-cannot be accessed.
-To get some control over this situation, the alternate form
-.UL sinclude
-can be used;
-.UL sinclude 
-(``silent include'')
-says nothing and continues if it can't access the file.
-.PP
-It is also possible to divert the output of M4 to temporary files during processing,
-and output the collected material upon command.
-M4 maintains nine of these diversions, numbered 1 through 9.
-If you say
-.P1
-divert(n)
-.P2
-all subsequent output is put onto the end of a temporary file
-referred to as
-.UL n .
-Diverting to this file is stopped by another 
-.UL divert 
-command;
-in particular,
-.UL divert
-or
-.UL divert(0)
-resumes the normal output process.
-.PP
-Diverted text is normally output all at once
-at the end of processing,
-with the diversions output in numeric order.
-It is possible, however, to bring back diversions
-at any time,
-that is, to append them to the current diversion.
-.P1
-undivert
-.P2
-brings back all diversions in numeric order, and
-.UL undivert
-with arguments brings back the selected diversions
-in the order given.
-The act of undiverting discards the diverted stuff,
-as does diverting into a diversion 
-whose number is not between 0 and 9 inclusive.
-.PP
-The value of
-.UL undivert
-is
-.ul
-not
-the diverted stuff.
-Furthermore, the diverted material is
-.ul
-not
-rescanned for macros.
-.PP
-The built-in
-.UL divnum
-returns the number of the currently active diversion.
-This is zero during normal processing.
-.SH
-System Command
-.PP
-You can run any program in the local operating system
-with the
-.UL syscmd
-built-in.
-For example,
-.P1
-syscmd(date)
-.P2
-on
-.UC UNIX
-runs the
-.UL date
-command.
-Normally
-.UL syscmd
-would be used to create a file
-for a subsequent
-.UL include .
-.PP
-To facilitate making unique file names, the built-in
-.UL maketemp
-is provided, with specifications identical to the system function
-.ul
-mktemp:
-a string of XXXXX in the argument is replaced
-by the process id of the current process.
-.SH
-Conditionals
-.PP
-There is a built-in called
-.UL ifelse
-which enables you to perform arbitrary conditional testing.
-In the simplest form,
-.P1
-ifelse(a, b, c, d)
-.P2
-compares the two strings
-.UL a
-and
-.UL b .
-If these are identical, 
-.UL ifelse
-returns
-the string
-.UL c ;
-otherwise it returns
-.UL d .
-Thus we might define a macro called
-.UL compare
-which compares two strings and returns ``yes'' or ``no''
-if they are the same or different.
-.P1
-define(compare, `ifelse($1, $2, yes, no)')
-.P2
-Note the quotes,
-which prevent too-early evaluation of
-.UL ifelse .
-.PP
-If the fourth argument is missing, it is treated as empty.
-.PP
-.UL ifelse
-can actually have any number of arguments,
-and thus provides a limited form of multi-way decision capability.
-In the input
-.P1
-ifelse(a, b, c, d, e, f, g)
-.P2
-if the string
-.UL a
-matches the string
-.UL b ,
-the result is
-.UL c .
-Otherwise, if
-.UL d
-is the same as
-.UL e ,
-the result is
-.UL f .
-Otherwise the result is
-.UL g .
-If the final argument
-is omitted, the result is null,
-so
-.P1
-ifelse(a, b, c)
-.P2
-is
-.UL c
-if 
-.UL a
-matches
-.UL b ,
-and null otherwise.
-.SH
-String Manipulation
-.PP
-The built-in
-.UL len
-returns the length of the string that makes up its argument.
-Thus
-.P1
-len(abcdef)
-.P2
-is 6, and
-.UL len((a,b))
-is 5.
-.PP
-The built-in
-.UL substr
-can be used to produce substrings of strings.
-.UL substr(s,\ i,\ n)
-returns the substring of
-.UL s
-that starts at the
-.UL i th
-position
-(origin zero),
-and is
-.UL n
-characters long.
-If 
-.UL n
-is omitted, the rest of the string is returned,
-so
-.P1
-substr(`now is the time', 1)
-.P2
-is
-.P1
-ow is the time
-.P2
-If 
-.UL i
-or
-.UL n
-are out of range, various sensible things happen.
-.PP
-.UL index(s1,\ s2)
-returns the index (position) in
-.UL s1
-where the string
-.UL s2
-occurs, or \-1
-if it doesn't occur.
-As with
-.UL substr ,
-the origin for strings is 0.
-.PP
-The built-in
-.UL translit
-performs character transliteration.
-.P1
-translit(s, f, t)
-.P2
-modifies
-.UL s
-by replacing any character found in
-.UL f
-by the corresponding character of
-.UL t .
-That is,
-.P1
-translit(s, aeiou, 12345)
-.P2
-replaces the vowels by the corresponding digits.
-If
-.UL t
-is shorter than
-.UL f ,
-characters which don't have an entry in
-.UL t
-are deleted; as a limiting case,
-if
-.UL t
-is not present at all,
-characters from 
-.UL f
-are deleted from 
-.UL s .
-So
-.P1
-translit(s, aeiou)
-.P2
-deletes vowels from 
-.UL s .
-.PP
-There is also a built-in called
-.UL dnl
-which deletes all characters that follow it up to
-and including the next newline;
-it is useful mainly for throwing away 
-empty lines that otherwise tend to clutter up M4 output.
-For example, if you say
-.P1
-define(N, 100)
-define(M, 200)
-define(L, 300)
-.P2
-the newline at the end of each line is not part of the definition,
-so it is copied into the output, where it may not be wanted.
-If you add
-.UL dnl
-to each of these lines, the newlines will disappear.
-.PP
-Another way to achieve this, due to J. E. Weythman,
-is
-.P1
-divert(-1)
-       define(...)
-       ...
-divert
-.P2
-.SH
-Printing
-.PP
-The built-in
-.UL errprint
-writes its arguments out on the standard error file.
-Thus you can say
-.P1
-errprint(`fatal error')
-.P2
-.PP
-.UL dumpdef
-is a debugging aid which
-dumps the current definitions of defined terms.
-If there are no arguments, you get everything;
-otherwise you get the ones you name as arguments.
-Don't forget to quote the names!
-.SH
-Summary of Built-ins
-.PP
-Each entry is preceded by the
-page number where it is described.
-.DS
-.tr '\'`\`
-.ta .25i
-3      changequote(L, R)
-1      define(name, replacement)
-4      divert(number)
-4      divnum
-5      dnl
-5      dumpdef(`name', `name', ...)
-5      errprint(s, s, ...)
-4      eval(numeric expression)
-3      ifdef(`name', this if true, this if false)
-5      ifelse(a, b, c, d)
-4      include(file)
-3      incr(number)
-5      index(s1, s2)
-5      len(string)
-4      maketemp(...XXXXX...)
-4      sinclude(file)
-5      substr(string, position, number)
-4      syscmd(s)
-5      translit(str, from, to)
-3      undefine(`name')
-4      undivert(number,number,...)
-.DE
-.SH
-Acknowledgements
-.PP
-We are indebted to Rick Becker, John Chambers,
-Doug McIlroy,
-and especially Jim Weythman,
-whose pioneering use of M4 has led to several valuable improvements.
-We are also deeply grateful to Weythman for several substantial contributions
-to the code.
-.SG
-.SH
-References
-.LP
-.IP [1]
-B. W. Kernighan and P. J. Plauger,
-.ul
-Software Tools,
-Addison-Wesley, Inc., 1976.
diff --git a/.ref-Research-V7/usr/doc/make b/.ref-Research-V7/usr/doc/make
deleted file mode 100644 (file)
index 3c87758..0000000
+++ /dev/null
@@ -1,791 +0,0 @@
-.....TR 57
-.ND August 15, 1978
-.RP
-.de IT
-.if n .ul
-\&\\$3\f2\\$1\fR\^\&\\$2
-..
-.TL
-Make \(em A Program for Maintaining Computer Programs
-.AU
-S. I. Feldman
-.AI
-.MH
-.AB
-.PP
-In a programming project, it is easy to lose track of which files need
-to be reprocessed or recompiled after a change is made in some part of the source.
-.I Make
-provides a simple mechanism for maintaining up-to-date versions of programs that result
-from many operations on a number of files.
-It is possible to tell
-.I Make
-the sequence of commands that create certain files,
-and the list of files that require other files to be current before the operations can be done.
-Whenever a change is made in any part of the program,
-the
-.I Make
-command will create the proper files simply, correctly,
-and with a minimum amount of effort.
-.PP
-The basic operation of
-.I Make
-is to find the name of a needed target in the description, ensure that all of the files on which it depends exist and
-are up to date, and then create the target if it has not been modified since its generators were.
-The description file really defines the graph of dependencies;
-.I Make
-does a depth-first search of this graph
-to determine what work is really necessary.
-.PP
-.I Make
-also provides a simple macro substitution facility
-and the ability to encapsulate commands in a single file
-for convenient administration.
-.AE
-.SH
-Introduction
-.PP
-It is common practice to divide large programs into smaller, more manageable pieces.
-The pieces may require quite different treatments:
-some may need to be run through a macro processor, some may need to be processed by
-a sophisticated program generator (e.g., Yacc[1] or Lex[2]).
-The outputs of these generators may then have to be compiled with special options and with
-certain definitions and declarations.
-The code resulting from these transformations may then need to be loaded together with
-certain libraries under the control of special options.
-Related maintenance activities involve running complicated test scripts
-and installing validated modules.
-Unfortunately, it is very easy for a programmer to forget which files depend on which others,
-which files have been modified recently, and the exact sequence of operations
-needed to make or exercise a new version of the program.
-After a long editing session, one may easily lose track of which files have been changed
-and which object modules are still valid,
-since a change to a declaration can obsolete a dozen other files.
-Forgetting to compile a routine that has been changed or that uses changed declarations will result in
-a program that will not work, and a bug that can be very hard to track down.
-On the other hand, recompiling everything in sight just to be safe is very wasteful.
-.PP
-The program described in this report mechanizes many of the activities of program development
-and maintenance.
-If the information on inter-file dependences and command sequences is stored in a file, the simple command
-.DS
-make
-.DE
-is frequently sufficient to update the interesting files,
-regardless of the number that have been edited since the last ``make''.
-In most cases, the description file is easy to write and changes infrequently.
-It is usually easier to type the
-.IT make
-command than to issue even one of the needed operations, so the typical cycle of program development operations becomes
-.DS
-think \(em edit \(em \fImake\fR \(em test  . . .
-.DE
-.PP
-.IT Make
-is most useful for medium-sized programming projects;
-it does not solve the problems of maintaining multiple source versions
-or of describing huge programs.
-.IT Make
-was designed for use on Unix, but a version runs on GCOS.
-.SH
-Basic Features
-.PP
-The basic operation of
-.IT make
-is to update a target file by ensuring
-that all of the files on which it depends exist and are up to date,
-then creating the target if it has not been modified since its dependents were.
-.IT Make
-does a depth-first search of the graph of dependences.
-The operation of the command depends on the ability to find the date and time
-that a file was last modified.
-.PP
-To illustrate, let us consider a simple example:
-A program named
-.IT prog
-is made by compiling and loading three C-language files
-.IT x.c ,
-.IT y.c ,
-and
-.IT z.c
-with the
-.IT lS
-library.
-By convention, the output of the C compilations will be found in files named
-.IT x.o ,
-.IT y.o ,
-and
-.IT z.o .
-Assume that the files
-.IT x.c
-and
-.IT y.c
-share some declarations in a file named
-.IT defs ,
-but that
-.IT z.c
-does not.
-That is,
-.IT x.c
-and
-.IT y.c
-have the line
-.DS
-#include "defs"
-.DE
-The following text describes the relationships and operations:
-.DS
-prog :  x.o  y.o  z.o
-       cc  x.o  y.o  z.o   \-lS  \-o  prog
-.sp .5
-x.o  y.o :   defs
-.DE
-If this information were stored in a file named
-.IT makefile ,
-the command
-.DS
-make
-.DE
-would perform the operations needed to recreate
-.IT prog
-after any changes had been made to any of the four source files
-.IT x.c ,
-.IT y.c ,
-.IT z.c ,
-or
-.IT defs .
-.PP
-.IT Make
-operates using three sources of information:
-a user-supplied description file (as above),
-file names and ``last-modified'' times from the file system,
-and built-in rules to bridge some of the gaps.
-In our example, the first line says that
-.IT prog
-depends on three ``\fI.o\fR'' files.
-Once these object files are current, the second line describes how to load them to create
-.IT prog .
-The third line says that
-.IT x.o
-and
-.IT y.o
-depend on the file
-.IT defs .
-From the file system,
-.IT make
-discovers that there are three ``\fI.c\fR'' files corresponding to the needed ``\fI.o\fR'' files,
-and uses built-in information on how to generate an object from a source file
-(\fIi.e.,\fR issue a ``cc\ \-c'' command).
-.PP
-The following long-winded description file is equivalent to the one above, but
-takes no advantage of
-.IT make 's
-innate knowledge:
-.DS
-prog :  x.o  y.o  z.o
-       cc  x.o  y.o  z.o  \-lS  \-o  prog
-.sp .3
-x.o :  x.c  defs
-       cc  \-c  x.c
-y.o :  y.c  defs
-       cc  \-c  y.c
-z.o :  z.c
-       cc  \-c  z.c
-.DE
-.PP
-If none of the source or object files had changed since the last time
-.IT prog
-was made, all of the files would be current, and
-the command
-.DS
-make
-.DE
-would just announce this fact and stop.
-If, however, the
-.IT defs
-file had been edited,
-.IT x.c
-and
-.IT y.c
-(but not
-.IT z.c )
-would be recompiled, and then
-.IT prog
-would be created from the new ``\fI.o\fR'' files.
-If only the file
-.IT y.c
-had changed, only it would be recompiled, but it would still be necessary to reload
-.IT prog .
-.PP
-If no target name is given on the
-.IT make
-command line, the first target mentioned in the description is created;
-otherwise the specified targets are made.
-The command
-.DS
-make x.o
-.DE
-would recompile
-.IT x.o
-if
-.IT x.c
-or
-.IT defs
-had changed.
-.PP
-If the file exists after the commands are executed,
-its time of last modification is used in further decisions;
-otherwise the current time is used.
-It is often quite useful to include rules with mnemonic names and commands that do not
-actually produce a file with that name.
-These entries can take advantage of
-.IT make 's
-ability to generate files and substitute macros.
-Thus, an entry
-``save''
-might be included to copy a certain set of files, or an entry
-``cleanup''
-might be used to throw away unneeded intermediate files.
-In other cases one may maintain a zero-length file purely to keep track
-of the time at which certain actions were performed.
-This technique is useful for maintaining remote archives and listings.
-.PP
-.IT Make
-has a simple macro mechanism for substituting in dependency lines and command strings.
-Macros are defined by command arguments or description file lines with embedded equal signs.
-A macro is invoked by preceding the name by a dollar sign;
-macro names longer than one character must be parenthesized.
-The name of the macro is either the single character after the dollar sign or a name inside parentheses.
-The following are valid macro invocations:
-.DS
-$(CFLAGS)
-$2
-$(xy)
-$Z
-$(Z)
-.DE
-The last two invocations are identical.
-$$ is a dollar sign.
-All of these macros are assigned values during input, as shown below.
-Four special macros change values during the execution of the command:
-$\(**, $@, $?, and $<.
-They will be discussed later.
-The following fragment shows the use:
-.DS
-OBJECTS = x.o y.o z.o
-LIBES = \-lS
-prog: $(OBJECTS)
-       cc $(OBJECTS)  $(LIBES)  \-o prog
-  . . .
-.DE
-The command
-.DS
-make
-.DE
-loads the three object files with the
-.IT lS
-library.  The command
-.DS
-make  "LIBES= \-ll \-lS"
-.DE
-loads them with both the Lex (``\-ll'') and the Standard (``\-lS'') libraries,
-since macro definitions on the command line override definitions in the description.
-(It is necessary to quote arguments with embedded blanks in
-.UX
-commands.)
-.PP
-The following sections detail the form of description files and the command line,
-and discuss options and built-in rules in more detail.
-.SH
-Description Files and Substitutions
-.PP
-A description file contains three types of information:
-macro definitions,
-dependency information,
-and executable commands.
-There is also a comment convention:
-all characters after a sharp (#) are ignored, as is the sharp itself.
-Blank lines and lines beginning with a sharp are totally ignored.
-If a non-comment line is too long, it can be continued using a backslash.
-If the last character of a line is a backslash, the backslash, newline,
-and following blanks and tabs are replaced by a single blank.
-.PP
-A macro definition is a line containing an equal sign not preceded by a colon or a tab.
-The name (string of letters and digits) to the left of the equal sign
-(trailing blanks and tabs are stripped) is assigned the string of characters following the equal sign
-(leading blanks and tabs are stripped.)
-The following are valid macro definitions:
-.DS
-2 = xyz
-abc = \-ll \-ly \-lS
-LIBES =
-.DE
-The last definition assigns LIBES the null string.
-A macro that is never explicitly defined has the null string as value.
-Macro definitions may also appear on the
-.IT make
-command line (see below).
-.PP
-Other lines give information about target files.
-The general form of an entry is:
-.DS
-target1 [target2 . . .] :[:] [dependent1 . . .] [; commands] [# . . .]
-[\fI(tab)\fR commands] [# . . .]
- . . .
-.DE
-Items inside brackets may be omitted.
-Targets and dependents are strings of letters, digits, periods, and slashes.
-(Shell metacharacters ``\(**'' and ``?'' are expanded.)
-A command is any string of characters not including a sharp (except in quotes)
-or newline.
-Commands may appear either after a semicolon on a dependency line
-or on lines beginning with a tab immediately following a dependency line.
-.PP
-A dependency line may have either a single or a double colon.
-A target name may appear on more than one dependency line, but all of those lines must be of the
-same (single or double colon) type.
-.IP 1.
-For the usual single-colon case,
-at most one of these dependency lines may have a command sequence associated with it.
-If the target is out of date with any of the dependents on any of the lines,
-and a command sequence is specified (even a null one following a semicolon or tab),
-it is executed; otherwise a default creation rule may be invoked.
-.IP 2.
-In the double-colon case, a command sequence may be associated with each dependency line;
-if the target is out of date with any of the files on a particular line, the associated
-commands are executed.
-A built-in rule may also be executed.
-This detailed form is of particular value in updating archive-type files.
-.PP
-If a target must be created, the sequence of commands is executed.
-Normally, each command line is printed and then
-passed to a separate invocation of the Shell after substituting for macros.
-(The printing is suppressed in silent mode or if the command line begins with an @ sign).
-.IT Make
-normally stops if any command signals an error by returning a non-zero error code.
-(Errors are ignored if the ``\-i'' flags has been specified on the
-.IT make
-command line,
-if the fake target name ``.IGNORE'' appears in the description file,
-or if the command string in the description file begins with a hyphen.
-Some
-.UX
-commands return meaningless status).
-Because each command line is passed to a separate invocation of the Shell,
-care must be taken with certain commands (e.g., \fIcd\fR and Shell control commands) that have meaning only
-within a single Shell process;
-the results are forgotten before the next line is executed.
-.PP
-Before issuing any command, certain macros are set.
-$@ is set to the name of the file to be ``made''.
-$? is set to the string of names that were found to be younger than the target.
-If the command was generated by an implicit rule (see below),
-$< is the name of the related file that caused the action, and
-$\(** is the prefix shared by the current and the dependent file names.
-.PP
-If a file must be made but there are no explicit commands or relevant
-built-in rules,
-the commands associated with the name ``.DEFAULT'' are used.
-If there is no such name,
-.IT make
-prints a message and stops.
-.SH
-Command Usage
-.PP
-The
-.IT make
-command takes four kinds of arguments:
-macro definitions, flags, description file names, and target file names.
-.DS
-make [ flags ]  [ macro definitions ]  [ targets ]
-.DE
-The following summary of the operation of the command explains how these arguments are interpreted.
-.PP
-First, all macro definition arguments (arguments with embedded equal signs) are analyzed
-and the assignments made.
-Command-line macros override corresponding definitions found in the description files.
-.PP
-Next, the flag arguments are examined.
-The permissible flags are
-.IP \-i
-Ignore error codes returned by invoked commands.
-This mode is entered if the fake target name ``.IGNORE'' appears in the description file.
-.IP \-s
-Silent mode.  Do not print command lines before executing.
-This mode is also entered if the fake target name ``.SILENT'' appears in the description file.
-.IP \-r
-Do not use the built-in rules.
-.IP \-n
-No execute mode.  Print commands, but do not execute them.
-Even lines beginning with an ``@'' sign are printed.
-.IP \-t
-Touch the target files (causing them to be up to date) rather than issue the usual commands.
-.IP \-q
-Question.
-The
-.IT make
-command returns a zero or non-zero status code depending on whether the target file
-is or is not up to date.
-.IP \-p
-Print out the complete set of macro definitions and target descriptions
-.IP \-d
-Debug mode.  Print out detailed information on files and times examined.
-.IP \-f
-Description file name.  The next argument is assumed to be the name of a description file.
-A file name of ``\-'' denotes the standard input.
-If there are no ``\-f\|'' arguments, the file named
-.IT makefile
-or
-.IT Makefile
-in the current directory is read.
-The contents of the description files override the built-in rules if they are present).
-.PP
-Finally, the remaining arguments are assumed to be the names of targets to be made;
-they are done in left to right order.
-If there are no such arguments, the first name in the description files that does not
-begin with a period is ``made''.
-.SH
-Implicit Rules
-.PP
-The
-.ul
-make
-program uses a table of interesting suffixes and a set
-of transformation rules to supply default dependency
-information and implied commands.
-(The Appendix describes these tables and means of overriding
-them.)
-The default suffix list is:
-.KS
-.sp
-.nf
-.ta 0.5i 1.5i
-       \fI.o\fR        Object file
-       \fI.c\fR        C source file
-       \fI.e\fR        Efl source file
-       \fI.r\fR        Ratfor source file
-       \fI.f\fR        Fortran source file
-       \fI.s\fR        Assembler source file
-       \fI.y\fR        Yacc-C source grammar
-       \fI.yr\fR       Yacc-Ratfor source grammar
-       \fI.ye\fR       Yacc-Efl source grammar
-       \fI.l\fR        Lex source grammar
-.fi
-.sp
-.KE
-The following diagram summarizes the default transformation paths.
-If there are two paths connecting a pair of suffixes, the longer
-one is used only if the intermediate file exists or is
-named in the description.
-.KS
-.sp
-.ft I
-.ta 2i
-       .o
-.sp 2
-.ta 0.75i 1.25i 1.6i 2.1i
-       .c      .r      .e      .f  .s  .y  .yr  .ye  .l  .d
-.sp 2
-.ta 0.6i 1.25i 1.6i
-       .y .l   .yr     .ye
-.ft R
-.sp
-.KE
-.PP
-If the file
-.ul
-x.o
-were needed and there were an
-.ul
-x.c
-in the description or directory, it would be compiled.
-If there were also an
-.IT x.l ,
-that grammar would be run through Lex before compiling the result.
-However, if there were no
-.ul
-x.c
-but there were an
-.IT x.l ,
-.IT make
-would discard the intermediate C-language file and use the
-direct link in the graph above.
-.PP
-It is possible to change the names of some of the compilers used in the
-default, or the flag arguments with which they are invoked by knowing
-the macro names used.
-The compiler names are the macros AS, CC, RC, EC, YACC, YACCR, YACCE, and LEX.
-The command
-.DS
-make CC=newcc
-.DE
-will cause the ``newcc'' command to be used instead of the
-usual C compiler.
-The macros CFLAGS, RFLAGS, EFLAGS, YFLAGS, and LFLAGS may be set to
-cause these commands to be issued with optional flags.
-Thus,
-.DS
-make "CFLAGS=\|\(miO"
-.DE
-causes the optimizing C compiler to be used.
-.SH
-Example
-.PP
-As an example of the use of
-.ul
-make,
-we will present the description file used to maintain
-the
-.ul
-make
-command itself.
-The code for
-.ul
-make
-is spread over a number of C source files and a Yacc grammar.
-The description file contains:
-.DS
-# Description file for the Make command
-.sp .3
-P = und \-3 | opr \-r2       # send to GCOS to be printed
-FILES = Makefile version.c defs main.c doname.c misc.c files.c dosys.c\
-       gram.y lex.c gcos.c
-OBJECTS = version.o main.o doname.o misc.o files.o dosys.o gram.o
-LIBES= \-lS
-LINT = lint \-p
-CFLAGS = \-O
-.sp .3
-make:  $(OBJECTS)
-       cc $(CFLAGS) $(OBJECTS) $(LIBES) \-o make
-       size make
-.sp .3
-$(OBJECTS):  defs
-gram.o: lex.c
-.sp .3
-cleanup:
-       -rm *.o gram.c
-       -du
-.sp .3
-install:
-       @size make /usr/bin/make
-       cp make /usr/bin/make ; rm make
-.sp .3
-print:  $(FILES)       # print recently changed files
-       pr $? | $P
-       touch print
-.sp .3
-test:
-       make \-dp | grep \-v TIME >1zap
-       /usr/bin/make \-dp | grep \-v TIME >2zap
-       diff 1zap 2zap
-       rm 1zap 2zap
-.sp .3
-lint :  dosys.c doname.c files.c main.c misc.c version.c gram.c
-       $(LINT) dosys.c doname.c files.c main.c misc.c version.c gram.c
-       rm gram.c
-.sp .3
-arch:
-       ar uv /sys/source/s2/make.a $(FILES)
-.DE
-.IT Make
-usually prints out each command before issuing it.
-The following output results from typing the simple command
-.DS
-make
-.DE
-in a directory containing only the source and description file:
-.DS
- cc  \-c version.c
- cc  \-c main.c
- cc  \-c doname.c
- cc  \-c misc.c
- cc  \-c files.c
- cc  \-c dosys.c
- yacc  gram.y
- mv y.tab.c gram.c
- cc  \-c gram.c
- cc  version.o main.o doname.o misc.o files.o dosys.o gram.o \-lS \-o make
- 13188+3348+3044 = 19580b = 046174b
-.DE
-Although none of the source files or grammars were mentioned
-by name in the description file,
-.IT make
-found them using its suffix rules and issued the needed commands.
-The string of digits results from the ``size make''
-command; the printing of the command line itself was
-suppressed by an @ sign.
-The @ sign on the
-.IT size
-command in the description file suppressed the printing of the command,
-so only the sizes are written.
-.PP
-The last few entries in the description file are useful maintenance sequences.
-The ``print'' entry prints only the files that have been changed since the last
-``make print'' command.
-A zero-length file
-.IT print
-is maintained to keep track of the time of the printing;
-the $? macro in the command line then picks up only the names of the files
-changed since
-.IT print
-was touched.
-The printed output can be sent to a different printer or to a file by changing the definition of the
-.IT P
-macro:
-.DS
-make print "P = opr \-sp"
-       \fIor\fR
-make print "P=  cat >zap"
-.DE
-.SH
-Suggestions and Warnings
-.PP
-The most common difficulties arise from
-.IT make 's
-specific meaning of dependency.
-If file
-.IT x.c
-has a ``#include "defs"''
-line, then the object file
-.IT x.o
-depends on
-.IT defs ;
-the source file
-.IT x.c
-does not.
-(If
-.IT defs
-is changed, it is not necessary to do anything
-to the file
-.IT x.c ,
-while it is necessary to recreate
-.IT x.o .)
-.PP
-To discover what
-.IT make
-would do, the ``\-n'' option is very useful.
-The command
-.DS
-make \-n
-.DE
-orders
-.IT make
-to print out the commands it would issue without actually taking the time to execute them.
-If a change to a file is absolutely certain to be benign
-(e.g., adding a new definition to an include file),
-the ``\-t'' (touch) option
-can save a lot of time:
-instead of issuing a large number of superfluous recompilations,
-.IT make
-updates the modification times on the affected file.
-Thus, the command
-.DS
-make \-ts
-.DE
-(``touch silently'') causes the relevant files to appear up to date.
-Obvious care is necessary, since this mode of operation subverts
-the intention of
-.IT make
-and destroys all memory of the previous relationships.
-.PP
-The debugging flag (``\-d'') causes
-.IT make
-to print out a very detailed description of what it is doing, including the
-file times.  The output is verbose, and recommended only as a last resort.
-.SH
-Acknowledgments
-.PP
-I would like to thank S. C. Johnson for suggesting this approach
-to program maintenance control.
-I would like to thank S. C. Johnson and H. Gajewska for being
-the prime guinea pigs during development of
-.IT make .
-.SH
-References
-.IP 1.
-S. C. Johnson,
-``Yacc \(em Yet Another Compiler-Compiler'',
-Bell Laboratories
-Computing Science Technical Report #32,
-July 1978.
-.IP 2.
-M. E. Lesk,
-``Lex \(em A Lexical Analyzer Generator'',
-Computing Science Technical Report #39,
-October 1975.
-.bp
-.SH
-Appendix.  Suffixes and Transformation Rules
-.PP
-The
-.ul
-make
-program itself does not know what file name suffixes are interesting
-or how to transform a file with one suffix into a file with another
-suffix.
-This information is stored in an internal table that has the form of a description file.
-If the ``\-r'' flag is used, this table is not used.
-.PP
-The list of suffixes is actually the dependency list for the name
-``.SUFFIXES'';
-.ul
-make
-looks for a file with any of the suffixes on the list.
-If such a file exists, and if there is a transformation
-rule for that combination,
-.ul
-make
-acts as described earlier.
-The transformation rule names are the concatenation of the
-two suffixes.
-The name of the rule to transform a ``\fI.r\fR'' file to a ``\fI.o\fR'' file
-is thus ``\fI.r.o\fR''.
-If the rule is present and no explicit command sequence
-has been given in the user's description files, the command
-sequence for the rule ``.r.o'' is used.
-If a command is generated by using one of these suffixing rules,
-the macro $\(** is given the value of the stem
-(everything but the suffix) of the name of the file to be made,
-and the macro $< is the name of the dependent that caused the action.
-.PP
-The order of the suffix list is significant, since it is scanned from
-left to right, and the first name that is formed that has both a file
-and a rule associated with it is used.
-If new names are to be appended, the user can just add an entry for
-``.SUFFIXES'' in his own description file; the dependents will be added to the usual list.
-A ``.SUFFIXES'' line without any dependents deletes the current list.
-(It is necessary to clear the current list if the order of names is to be changed).
-.PP
-The following is an excerpt from the default rules file:
-.DS
-.ta .5i 1i
- .SUFFIXES : .o .c .e .r .f .y .yr .ye .l .s
- YACC=yacc
- YACCR=yacc \-r
- YACCE=yacc \-e
- YFLAGS=
- LEX=lex
- LFLAGS=
- CC=cc
- AS=as \-
- CFLAGS=
- RC=ec
- RFLAGS=
- EC=ec
- EFLAGS=
- FFLAGS=
- .c.o :
-       $(CC) $(CFLAGS) \-c $<
- .e.o .r.o .f.o :
-       $(EC) $(RFLAGS) $(EFLAGS) $(FFLAGS) \-c $<
- .s.o :
-       $(AS) \-o $@ $<
- .y.o :
-       $(YACC) $(YFLAGS) $<
-       $(CC) $(CFLAGS) \-c y.tab.c
-       rm y.tab.c
-       mv y.tab.o $@
- .y.c :
-       $(YACC) $(YFLAGS) $<
-       mv y.tab.c $@
-.DE
diff --git a/.ref-Research-V7/usr/doc/msmacros/ms b/.ref-Research-V7/usr/doc/msmacros/ms
deleted file mode 100644 (file)
index 4b86721..0000000
+++ /dev/null
@@ -1,922 +0,0 @@
-.RP
-....TM 76-1274-16 39199 39199-11
-....ND October 8, 1976
-.nr CW 2.85i
-.nr GW .3i
-.TL
-Typing Documents on the UNIX System:
-.br
-\!.br
-Using the \-ms Macros with Troff and Nroff
-.AU "MH 2C-572" 6377
-M. E. Lesk
-.AI
-.MH
-.OK
-Text Formatting
-Phototypesetting
-.AB
-This document describes a set of easy-to-use macros
-for preparing documents on the UNIX system.
-Documents may be produced on either the
-phototypesetter or a on a computer terminal,
-without changing the input.
-.PP
-The macros provide facilities for paragraphs, sections (optionally
-with automatic numbering), page titles, footnotes,
-equations,
-tables, two-column format, and
-cover pages for papers.
-.PP
-This memo includes, as an appendix,
-the text of the ``Guide to Preparing
-Documents with \-ms''
-which contains additional examples
-of features of \-ms.
-.PP
-This manual is a revision of, and replaces,
-``Typing Documents on UNIX,''
-dated November 22, 1974.
-.AE
-.CS 6 6 12 1 0 8
-.bd I 3
-.PP
-.I
-Introduction.
-.R
-This memorandum describes a package of commands to produce
-papers
-using the
-.bd I
-.I
-troff
-.R
-and
-.I nroff
-formatting programs on the
-.SM
-UNIX
-.NL
-system.
-As with other
-.I roff -derived
-programs,
-text is prepared interspersed with formatting commands.
-However, this package,
-which itself is written in
-.I troff
-commands,
-provides higher-level commands
-than those provided with the basic
-.I troff
-program.
-The commands available in this package are listed in
-Appendix A.
-.bd I 3
-.PP
-.I
-Text.
-.R
-Type normally, except that instead of indenting for paragraphs,
-place a line reading ``.PP'' before each paragraph.
-This will produce indenting and extra space.
-.LP
-Alternatively, the command .LP that was used here will produce
-a left-aligned (block) paragraph.
-The paragraph spacing can be changed: see below under ``Registers.''
-.PP
-.I
-Beginning.
-.R
-For a document with a paper-type cover sheet, the input should start as follows:
-.DS L
-       [optional overall format .RP \- see below]
-       .TL
-       Title of document (one or more lines)
-       .AU
-       Author(s) (may also be several lines)
-       .AI
-       Author's institution(s)
-       .AB
-       Abstract; to be placed on the cover sheet of a paper.
-       Line length is 5/6 of normal; use .ll here to change.
-       .AE  (abstract end)
-       text ... (begins with .PP, which see)
-.DE
-To omit some of the standard headings
-(e.g. no abstract, or no author's institution) just
-omit the corresponding fields and command lines.
-The word
-.SM
-ABSTRACT
-.NL
-can be suppressed by writing ``.AB no'' for ``.AB''.
-Several interspersed .AU and .AI lines can be used for multiple authors.
-The headings are not compulsory: beginning
-with a .PP command is perfectly OK and will just
-start printing an ordinary paragraph.
-.I Warning:
-You can't just begin a document with a line of text.
-Some \-ms command must
-precede any text input.  When in doubt, use .LP
-to get proper initialization, although any of
-the commands .PP, .LP, .TL, .SH, .NH is good enough.
-Figure 1 shows the legal arrangement of commands at the
-start of a document.
-.PP
-.I
-Cover Sheets and First Pages.
-.R
-The first line
-of a document signals the general format of the first page.
-In particular, if it is ".RP" a cover sheet with title and
-abstract is prepared.
-The default format
-is useful for scanning drafts.
-.PP
-In general \-ms is arranged so that only one form
-of a document need be stored, containing all
-information;  the first command gives the format,
-and unnecessary items for that format are ignored.
-.PP
-Warning: don't put extraneous material
-between the .TL and .AE commands.  Processing
-of the titling items is
-special, and other data placed in them may not behave
-as you expect.
-Don't forget that some \-ms command must precede any input text.
-.PP
-.I
-Page headings.
-.R
-The \-ms macros, by default, will print a page heading containing
-a page number (if greater than 1).
-A default page footer is provided only in
-.I nroff ,
-where the date is used.
-The user can make minor adjustments to the page headings/footings
-by redefining the
-strings
-LH, CH, and RH
-which are the left, center and right portions of the page headings,
-respectively; and the
-strings
-LF, CF, and RF,
-which are the left, center and right portions of the page footer.
-For more complex formats, the user can redefine
-the macros PT and BT, which are invoked respectively at the top
-and bottom of each page.
-The margins (taken from registers HM and FM for the top and bottom
-margin respectively) are normally 1 inch; the page header/footer are
-in the middle of that space.
-The user who redefines these macros should be careful
-not to change parameters such as point size or font
-without resetting them to default values.
-.PP
-.2C
-.I
-Multi-column formats.
-.R
-If you place the command ``.2C'' in your document, the document will
-be printed in double column format beginning
-at that point.  This feature is not too useful in computer
-terminal output, but is often desirable on the typesetter.
-The command ``.1C'' will go
-back to one-column format and also skip to a new page.
-The ``.2C'' command is actually a special case of the command
-.DS L
-       .MC [column width [gutter width]]
-.DE
-which makes multiple columns with the specified column
-and gutter width; as many columns as will fit across the page
-are used.
-Thus triple, quadruple, ... column pages can be printed.
-Whenever the number of columns is changed (except going from
-full width to some larger number of columns)
-a new page is started.
-.PP
-.I
-Headings.
-.R
-To produce a special heading, there are two commands.
-If you type
-.DS L
-       .NH
-       type section heading here
-       may be several lines
-.DE
-you will get automatically numbered section headings (1, 2, 3, ...),
-in boldface.
-For example,
-.DS L
-    .NH
-    Care and Feeding of Department Heads
-.DE
-produces
-.NH
-Care and Feeding of Department Heads
-.PP
-Alternatively,
-.DS L
-       .SH
-       Care and Feeding of Directors
-.DE
-will print the heading with no number added:
-.SH
-Care and Feeding of Directors
-.PP
-Every section heading, of either type, should be followed
-by a paragraph beginning with .PP or .LP, indicating
-the end of the heading.
-Headings may contain more than one line
-of text.
-.PP
-The .NH command also supports more complex numbering schemes.
-If a numerical argument is given, it is taken to be a
-``level'' number and an appropriate sub-section
-number is generated.
-Larger level numbers indicate deeper
-sub-sections, as in this example:
-.DS L
-       .NH
-       Erie-Lackawanna
-       .NH 2
-       Morris and Essex Division
-       .NH 3
-       Gladstone Branch
-       .NH 3
-       Montclair Branch
-       .NH 2
-       Boonton Line
-.DE
-generates:
-.NH
-Erie-Lackawanna
-.NH 2
-Morris and Essex Division
-.NH 3
-Gladstone Branch
-.NH 3
-Montclair Branch
-.NH 2
-Boonton Line
-.PP
-An explicit ``.NH 0'' will reset the numbering of level 1
-to one, as here:
-.DS L
-       .NH 0
-       Penn Central
-.DE
-.ft 3
-.if n .ul 1
-.sp 1
-1.  Penn Central
-.PP
-.I
-Indented paragraphs.
-.R
-(Paragraphs with hanging numbers, e.g. references.)
-The sequence
-.DS L
-       .IP [1]
-       Text for first paragraph, typed
-       normally for as long as you would
-       like on as many lines as needed.
-       .IP [2]
-       Text for second paragraph, ...
-.DE
-produces
-.IP [1]
-Text for first paragraph, typed normally for as long
-as you would like on as many lines as
-needed.
-.IP [2]
-Text for second paragraph, ...
-.LP
-A series of indented paragraphs may be followed by an ordinary paragraph
-beginning with .PP or .LP,
-depending on whether you wish indenting or not.
-The command .LP was used here.
-.PP
-More sophisticated uses of .IP are also possible.
-If the label is omitted, for example, a plain block indent
-is produced.
-.DS L
-       .IP
-       This material will
-       just be turned into a
-       block indent suitable for quotations or
-       such matter.
-       .LP
-.DE
-will produce
-.IP
-This material
-will just be turned
-into a block indent
-suitable for
-quotations or such matter.
-.LP
-If a non-standard amount of indenting is required,
-it may be specified after the label (in character positions)
-and will remain in effect until the next .PP or .LP.
-Thus, the general form of the .IP command
-contains two additional fields: the label and the indenting
-length.  For example,
-.DS L
-       .IP first: 9
-       Notice the longer label, requiring larger
-       indenting for these paragraphs.
-       .IP second:
-       And so forth.
-       .LP
-.DE
-produces this:
-.IP first: 9
-Notice the longer label, requiring larger
-indenting for these paragraphs.
-.IP second:
-And so forth.
-.LP
-It is also possible to produce multiple nested indents;
-the command .RS indicates that the next .IP starts from the
-current indentation level.
-Each .RE will eat up one level of indenting
-so you should balance .RS and .RE commands.
-The .RS command should be thought of as ``move right'' and
-the .RE command as ``move left''.
-As an example
-.DS L
-       .IP 1.
-       Bell Laboratories
-       .RS
-       .IP 1.1
-       Murray Hill
-       .IP 1.2
-       Holmdel
-       .IP 1.3
-       Whippany
-       .RS
-       .IP 1.3.1
-       Madison
-       .RE
-       .IP 1.4
-       Chester
-       .RE
-       .LP
-.DE
-will result in
-.IP 1.
-Bell Laboratories
-.RS
-.IP 1.1
-Murray Hill
-.IP 1.2
-Holmdel
-.IP 1.3
-Whippany
-.RS
-.IP 1.3.1
-Madison
-.RE
-.IP 1.4
-Chester
-.RE
-.LP
-All of these variations on .LP leave the right
-margin untouched.  Sometimes, for purposes
-such as setting off a quotation, a paragraph indented
-on both right and left is required.
-.QP
-A single paragraph
-like this is obtained
-by preceding it with .QP.
-More complicated material (several paragraphs) should be
-bracketed with .QS and .QE.
-.LP
-.I
-Emphasis.
-.R
-To get
-italics
-(on the typesetter) or underlining (on the terminal)
-say
-.DS L
-       .I
-       as much text as you want
-       can be typed here
-       .R
-.DE
-.bd I
-.br
-as was done for
-.I
-these three words.
-.R
-The .R command restores the normal (usually Roman) font.
-If only one word is to be italicized, it
-may be just given on the line with the .I command,
-.br
-.bd I 3
-.DS
-       .I word
-.DE
-and in this case no .R is needed to restore
-the previous font.
-.B
-Boldface
-.R
-can be produced by
-.DS L
-       .B
-       Text to be set in boldface
-       goes here
-       .R
-.DE
-and also will be underlined on the terminal or line printer.
-As with .I, a single word can be placed in boldface
-by placing it on the same line as the .B command.
-.PP
-A few size changes
-can be specified similarly with
-the commands .LG (make larger), .SM (make smaller), and .NL
-(return to normal size).
-The size change
-is two points; the commands may be repeated for
-.SM
-increased
-.SM
-effect
-.NL
-(here one .NL canceled two .SM commands).
-.PP
-If actual
-.UL underlining
-as opposed to italicizing is required on the typesetter,
-the command
-.DS
-       .UL word
-.DE
-will underline a word.  There is no way to underline
-multiple words on the typesetter.
-.PP
-.I
-Footnotes.
-.R
-Material placed between lines with the commands .FS
-(footnote) and .FE (footnote end) will
-be collected, remembered, and finally placed
-at the bottom of the current page*.
-By default, footnotes are 11/12th the
-length of normal text,
-but this can be changed using the FL register (see below).
-.FS
-* Like this.
-.FE
-.PP
-.I
-Displays and Tables.
-.R
-To prepare displays of lines, such as tables, in which
-the lines should not be re-arranged,
-enclose them in the commands .DS and .DE
-.DS L
-       .DS
-       table lines, like the
-       examples here, are placed
-       between .DS and .DE
-       .DE
-.DE
-By default, lines between .DS and .DE are indented and left-adjusted.
-You can also center lines, or retain the left margin.
-Lines bracketed by .DS C and .DE commands are
-centered (and not re-arranged); lines bracketed
-by .DS L and .DE are left-adjusted, not indented, and
-not re-arranged.
-A plain .DS is equivalent
-to .DS I, which indents and left-adjusts.  Thus,
-.DS C
-these lines were preceded
-by .DS C and followed by
-a .DE command;
-.DE
-whereas
-.DS L
-these lines were preceded
-by .DS L and followed by
-a .DE command.
-.DE
-Note that .DS C centers each line; there is a variant .DS B
-that makes the display into a left-adjusted block of text, and
-then centers that entire block.
-Normally a display is kept together, on one page.
-If you wish to have a long display which
-may be split across page
-boundaries,
-use .CD, .LD, or .ID in place of
-the commands .DS C, .DS L, or .DS I respectively.
-An extra argument to the .DS I or .DS command is taken
-as an amount to indent.
-Note: it is tempting to assume that .DS R will right adjust
-lines, but it doesn't work.
-.PP
-.I
-Boxing words or lines.
-.R
-To draw rectangular boxes around words the command
-.DS L
-       .BX word
-.DE
-will print
-.BX word
-as shown.
-The boxes will not be neat on a terminal, and this
-should not be used as a substitute for italics.
-.B1
-Longer pieces of text may be boxed
-by enclosing them with .B1 and .B2:
-.DS L
-       .B1
-       text...
-       .B2
-.DE
-as has been done here.
-.B2
-.PP
-.I
-Keeping blocks together.
-.R
-If you wish to keep a table or other block of lines
-together on a page, there are ``keep - release'' commands.
-If a block of lines preceded by .KS and followed by .KE does
-not fit on the remainder of the current page, it will begin
-on a new page.
-Lines bracketed by .DS and .DE commands are automatically
-kept together this way.
-There is also a ``keep floating'' command: if the
-block to be kept together is preceded by .KF instead of .KS
-and does not fit
-on the current page, it will be moved down through the text
-until the top of the next page.  Thus, no large blank space
-will be introduced in the document.  
-.PP
-.I
-Nroff/Troff commands.
-.R
-Among the useful commands from the basic formatting programs
-are the following.  They all work with both typesetter and
-computer terminal output:
-.DS L
-       .bp - begin new page.
-       .br - ``break'', stop running text
-                 from line to line.
-       .sp n - insert n blank lines.
-       .na - don't adjust right margins.
-.DE
-.PP
-.I
-Date.
-.R
-By default, documents produced on computer terminals have the
-date at the bottom of each page; documents produced on
-the typesetter don't.
-To force the date, say ``.DA''.  To force no date, say ``.ND''.
-To lie about the date, say ``.DA July 4, 1776''
-which puts the specified date at the bottom of each page.
-The command
-.DS L
-       .ND May 8, 1945
-.DE
-in ".RP" format
-places the specified date on the cover sheet and nowhere else.
-Place this line before the title.
-.PP
-.I
-Signature line.
-.R
-You can obtain a signature line by placing
-the command .SG in the document.
-The authors' names will
-be output in place of the .SG line.
-An argument to .SG
-is used
-as a typing identification line, and
-placed after the signatures.
-The .SG command is ignored
-in released paper format.
-.PP
-.I
-Registers.
-.R
-Certain of the registers used by \-ms can
-be altered to change default
-settings.
-They should be changed with .nr commands,
-as with
-.DS
-       .nr PS 9
-.DE
-.bd I
-to make the default point size 9 point.
-If the effect is needed immediately, the
-normal
-.I
-troff
-.R
-command should be used
-in addition to changing the number register.
-.br
-.ps 9
-.vs 10p
-.TS
-c0 c c c
-c c c c
-a l l l.
-Register       Defines Takes   Default
-               effect
-PS     point size      next para.      10
-VS     line spacing    next para.      12 pts
-LL     line length     next para.      6\(fm\(fm
-LT     title length    next para.      6\(fm\(fm
-PD     para. spacing   next para.      0.3 VS
-PI     para. indent    next para.      5 ens
-FL     footnote length next FS 11/12 LL
-CW     column width    next 2C 7/15 LL
-GW     intercolumn gap next 2C 1/15 LL
-PO     page offset     next page       26/27\(fm\(fm
-HM     top margin      next page       1\(fm\(fm
-FM     bottom margin   next page       1\(fm\(fm
-.TE
-.ps \n(PS
-.vs \n(VS
-You may also alter
-the strings
-LH, CH, and RH which are the left, center, and right headings
-respectively; and similarly LF, CF, and RF which are strings in the
-page footer.
-The page number on
-.I
-output
-.R
-is taken from register PN, to permit
-changing its output style.
-For more complicated headers and footers
-the macros PT and BT can be redefined, as
-explained earlier.
-.bd I 3
-.PP
-.I
-Accents.
-.R
-To simplify typing certain foreign words,
-strings representing common accent marks are defined.
-They precede the letter over which the mark
-is to appear.
-Here are the strings:
-.TS
-center;
-c c6 c c.
-Input  Output  Input   Output
-\e*\(fme       \*'e    \e*~a   \*~a
-\e*\(gae       \*`e    \e*Ce   \h'0.15m'\v'-0.6m'\s6\zv\s0\v'0.6m'\h'-0.15m'e
-\e*:u  \*:u    \e*,c   \*,c
-\e*^e  \o'^e'
-.TE
-.PP
-.I
-Use.
-.R
-After your document is prepared and stored on a file,
-you can print it on a terminal with the command*
-.bd I
-.FS
-* If .2C was used, pipe the
-.I nroff
-output
-through
-.I col;
-make the first line of the input
-``.pi /usr/bin/col.''
-.br
-.FE
-.DS L
-.I
-   nroff \-ms file
-.R
-.DE
-and you can print it on the typesetter with the
-command
-.DS L
-.I
-   troff \-ms file
-.R
-.DE
-(many options are possible).
-In each case, if your document is stored in several files,
-just list all the filenames
-where we have used ``file''.
-If equations or tables are used,
-.I
-eqn
-.R
-and/or
-.I
-tbl
-.R
-must be invoked as preprocessors.
-.br
-.bd I 3
-.PP
-.I
-References and further study.
-.R
-If you have to do Greek or mathematics, see
-.I eqn
-[1]
-for equation setting.
-To aid
-.I eqn
-users,
-.I \-ms
-provides definitions of .EQ and .EN
-which normally center the equation and set it off slightly.
-An argument on .EQ is taken to be an equation
-number and placed in the right margin near the equation.
-In addition, there are three special arguments to EQ:
-the letters C, I, and L indicate centered (default),
-indented, and left adjusted equations, respectively. 
-If there is both a format argument
-and an equation number,
-give the format argument first, as in
-.bd I
-.DS
-       .EQ L (1.3a)
-.DE
-for a left-adjusted equation numbered (1.3a).
-.PP
-Similarly,
-the macros .TS and .TE
-are defined
-to separate tables (see [2]) from text with a little space.
-A very long table with a heading may be broken
-across pages by beginning it with .TS H
-instead of .TS,
-and placing the line .TH in the table data
-after the heading.  If the table
-has no heading repeated from page to page,
-just use the ordinary .TS and .TE macros.
-.PP
-To learn more about
-.I troff
-see
-[3] for a general introduction, and [4]
-for the full details (experts only).
-Information on related UNIX commands
-is in [5].
-For jobs that do not seem well-adapted
-to \-ms, consider other macro packages.
-It is often far easier to write a specific macro packages
-for such tasks as imitating particular journals than
-to try to adapt \-ms.
-.PP
-.bd I 3
-.I
-Acknowledgment.
-.R
-Many thanks are due to Brian Kernighan for
-his help in the design and implementation of this package,
-and for his assistance in preparing this manual.
-.bd I
-.SH
-.ce
-References
-.PP
-.IP [1]
-B. W. Kernighan and L. L. Cherry,
-.I
-Typesetting Mathematics \(em Users Guide (2nd edition),
-.R
-Bell Laboratories Computing Science Report no. 17.
-.IP [2]
-M. E. Lesk,
-.I
-Tbl \(em A Program to Format Tables,
-.R
-Bell Laboratories Computing Science Report no. 45.
-.IP [3]
-B. W. Kernighan,
-.I
-A Troff Tutorial,
-.R
-Bell Laboratories, 1976.
-.IP [4]
-J. F. Ossanna,
-.I
-Nroff\|/Troff Reference Manual,
-.R
-Bell Laboratories Computing Science Report no. 51.
-.IP [5]
-K. Thompson and D. M. Ritchie,
-.I
-UNIX Programmer's Manual,
-.R
-Bell Laboratories, 1978.
-.1C
-.SH
-.ce
-Appendix A
-.ce
-List of Commands
-.ft R
-.TS
-expand;
-l2 l5 l2 l.
-1C     Return to single column format. LG      Increase type size.
-2C     Start double column format.     LP      Left aligned block paragraph.
-AB     Begin abstract. 
-AE     End abstract.   
-AI     Specify author's institution.   
-AU     Specify author. ND      Change or cancel date.
-B      Begin boldface. NH      Specify numbered heading.
-DA     Provide the date on each page.  NL      Return to normal type size.
-DE     End display.    PP      Begin paragraph.
-DS     Start display (also CD, LD, ID).        
-EN     End equation.   R       Return to regular font (usually Roman).
-EQ     Begin equation. RE      End one level of relative indenting.
-FE     End footnote.   RP      Use released paper format.
-FS     Begin footnote. RS      Relative indent increased one level.
-               SG      Insert signature line.
-I      Begin italics.  SH      Specify section heading.
-               SM      Change to smaller type size.
-IP     Begin indented paragraph.       TL      Specify title.
-KE     Release keep.   
-KF     Begin floating keep.    UL      Underline one word.
-KS     Start keep.     
-.TE
-.sp
-.ce
-.ft B
-Register Names
-.ft R
-.PP
-The following register names are used by \-ms internally.
-Independent use of these names in one's own macros may
-produce incorrect output.
-Note that no lower case letters are used in any \-ms internal name.
-.TS
- expand;
-c s s  s s s  s s s  s s
-l l l  l l l  l l l  l l.
-Number registers used in \-ms
-:      DW      GW      HM      IQ      LL      NA      OJ      PO      T.      TV
-#T     EF      H1      HT      IR      LT      NC      PD      PQ      TB      VS
-.T     FC      H2      IF      IT      MF      ND      PE      PS      TC      WF
-1T     FL      H3      IK      KI      MM      NF      PF      PX      TD      YE
-AV     FM      H4      IM      L1      MN      NS      PI      RO      TN      YY
-CW     FP      H5      IP      LE      MO      OI      PN      ST      TQ      ZN
-.TE
-.sp
-.TS
-expand;
-c s s  s s s  s s s  s s
-l l l  l l l  l l l  l l.
-String registers used in \-ms
-\(fm   A5      CB      DW      EZ      I       KF      MR      R1      RT      TL
-\(ga   AB      CC      DY      FA      I1      KQ      ND      R2      S0      TM
-^      AE      CD      E1      FE      I2      KS      NH      R3      S1      TQ
-~      AI      CF      E2      FJ      I3      LB      NL      R4      S2      TS
-:      AU      CH      E3      FK      I4      LD      NP      R5      SG      TT
-,      B       CM      E4      FN      I5      LG      OD      RC      SH      UL
-1C     BG      CS      E5      FO      ID      LP      OK      RE      SM      WB
-2C     BT      CT      EE      FQ      IE      ME      PP      RF      SN      WH
-A1     C       D       EL      FS      IM      MF      PT      RH      SY      WT
-A2     C1      DA      EM      FV      IP      MH      PY      RP      TA      XD
-A3     C2      DE      EN      FY      IZ      MN      QF      RQ      TE      XF
-A4     CA      DS      EQ      HO      KE      MO      R       RS      TH      XK
-.TE
-.ne 4i
-.br
-.ne 5i
-.ta 1i 2i 3i 4i
-.vs .6i
-.nf
-.in 1i
-.ll 4.2i
-.ce
-Order of Commands in Input
-
-       RP
-TL
-AU
-AI
-       AB
-       AE
-
-               NH, SH
-                       PP, LP
-                       text ...
-.br
-.ce
-Figure 1
-.fi
-.in 0
diff --git a/.ref-Research-V7/usr/doc/msmacros/refcard b/.ref-Research-V7/usr/doc/msmacros/refcard
deleted file mode 100644 (file)
index efae7cb..0000000
+++ /dev/null
@@ -1,1253 +0,0 @@
-.fp 3 H
-.po .5i
-.de I
-.ft 2
-..
-.de R
-.ft 1
-..
-.de B
-.bd R 2
-\\$1
-.bd R
-..
-.de hh
-.br
-.vs 10p
-.ps 12
-.bd 1 3
-.ce
-\\$1
-.ps 9
-.br
-.bd 1
-.sp
-..
-.de NP
-'po 0
-.ps 9
-.ta .25i 3.75i 7.25i 7.7i
-\(rn\t|\t|\t|\t\(rn
-'po
-'sp .2i
-.mk z
-..
-.de FT
-.po 0
-.ps 9
-.ta .25i 3.75i 7.25i
-       |       |       |
-.po .5i
-..
-.wh -8p FT
-.de b1
-.br
-.tm left col bottom at \\n(nl
-.po +3.5i
-.sp |\\nzu
-.ph
-..
-.de b2
-.br
-.tm right col bottom at \\n(nl
-.po -3.5i
-.bp
-.ph
-..
-.de ph
-.nr x +1
-.tl ''\\nx''
-.sp .2i
-..
-.nr x 1
-.wh 0 NP
-.ll 3i
-.lt 3i
-.nr LL 3i
-.nr IQ 4
-.nr IR 4
-.de IP
-.RT
-.if \\n(IP=0 .nr IP +1
-.if \\n(.$ .LB "\\$1"
-.if !\\n(.$ .LB
-..
-.de RT
-.if \\n(IP .in -\\n(IQn
-.if \\n(IP .nr IP -1
-..
-.de LP
-.RT
-.ti 0
-.ne 3
-.if \\n(.$ .LB \\$1
-..
-.de LB
-.in +\\n(IQn
-.ta \\n(IQn
-.if \\n(.$ .ti -\\n(IQn
-.if \\n(.$ \\$1\t\c
-..
-.de RS
-.in +\\n(IRn
-..
-.      \"RE - retreat to the left
-.de RE
-.br
-.in -\\n(IRn
-..
-.br
-.rs
-.sp 1i
-.ps 14
-.vs 16p
-.ce 3
-A Guide to Preparing
-Documents with \-ms
-.sp 2
-.ps 10
-.vs 12p
-.ft I
-.ce
-M. E. Lesk
-.ft R
-.lt \n(.lu
-.sp .5
-.tl 'Bell Laboratories''August 1978'
-.sp .5
-.tl xx\l'\n(.lu'xx
-.sp 1
-.bd I 2
-.vs 11p
-.fi
-This guide gives some simple examples of
-document preparation on Bell Labs computers,
-emphasizing the use of the \fI\-ms\fR macro
-package.
-It enormously abbreviates
-information in
-.IP 1.
-.I
-Typing Documents on UNIX and GCOS,
-.R
-by M. E. Lesk;
-.IP 2.
-.I
-Typesetting Mathematics \- User's Guide,
-.R
-by B. W. Kernighan and L. L. Cherry; and
-.IP 3.
-.I
-Tbl \- A Program to Format Tables,
-.R
-by M. E. Lesk.
-.LP
-These memos are all included in the
-.I
-UNIX Programmer's Manual, Volume 2.
-.R
-The new user should also have
-.I
-A Tutorial Introduction to the UNIX Text Editor,
-.R
-by B. W. Kernighan.
-.sp .5
-For more detailed information, read
-.I
-Advanced Editing on UNIX
-.R
-and
-.I
-A Troff Tutorial,
-.R
-by B. W. Kernighan,
-and (for experts)
-.I
-Nroff\^/Troff Reference Manual
-.R
-by J. F. Ossanna.
-Information on related commands is
-found (for UNIX users) in
-.I
-UNIX for Beginners
-.R
-by B. W. Kernighan
-and the
-.I
-UNIX Programmer's Manual
-.R
-by K. Thompson and D. M. Ritchie.
-.br
-.vs 12p
-.sp 1.5
-.ce
-.ps +2
-Contents
-.nf
-.ps
-.sp .5
-.in .2i
-.bd I
-.ta 2.4i
-.cs I 25
-A TM \fI\ 1\fR 2
-A released paper \fI\ 1\fR 3
-An internal memo, and headings \fI\ 1\fR 4
-Lists, displays, and footnotes \fI\ 1\fR 5
-Indents, keeps, and double column \fI\ 1\fR 6
-Equations and registers \fI\ 1\fR 7
-Tables and usage \fI\ 1\fR 8
-.in 0
-.cs I
-.sp 1
-.fi
-.EQ
-delim $$
-.EN
-Throughout the examples, input is shown in
-.ft 3
-.br
-.ti +2n
-this Helvetica sans serif font
-.ft R
-.br
-while the resulting output is shown in
-.ti +2n
-this Times Roman font.
-.nf
-.sp  2
-.ce
-UNIX Document no. 1111
-.ps 9
-.vs 10p
-.EQ
-gsize 9
-.EN
-.b1
-.hh "Commands for a TM"
-.nf
-.ft 3
-\&.TM 1978-5b3 99999 99999-11
-\&.ND April 1, 1976
-\&.TL
-\&The Role of the Allen Wrench in Modern
-\&Electronics
-\&.AU "MH 2G-111" 2345
-\&J. Q. Pencilpusher
-\&.AU "MH 1K-222" 5432
-\&X. Y. Hardwired
-\&.AI
-\&.MH
-\&.OK
-\&Tools
-\&Design
-\&.AB
-\&This abstract should be short enough to
-\&fit on a single page cover sheet.
-\&It must attract the reader into sending for
-\&the complete memorandum.
-\&.AE
-\&.CS 10 2 12 5 6 7
-\&.NH
-\&Introduction.
-\&.PP
-\&Now the first paragraph of actual text ...
-\&...
-\&Last line of text.
-\&.SG MH-1234-JQP/XYH-unix
-\&.NH
-\&References ...
-.ft
-.sp
-.fi
-Commands not needed in a particular
-format are ignored.
-.sp 
-.ps 8
-.vs 9p
-.mk a
-.sp .20i
-.ll 3i
-.nf
-\h'2n'\s16\(bs\s7 $fat roman size 7  "Bell Laboratories"$        \s8Cover Sheet for TM
-.sp
-\s6\l'3i'
-.fi
-.ps 7
-.ft 2
-.sp 1p
-This information is for employees of Bell Laboratories.  (GEI 13.9-3)\p
-.ft 1
-.nf
-.vs 4p
-\s6\l'3i'
-.vs 9p
-.sp
-.ll 3.0i
-.ps 7
-.ta .25i 2.25i 2.45i
-.mk
-Title- \s8
-.rt
-.in .25i
-.hy 0
-.bd 1 2
-The Role of the Allen Wrench
-in Modern Electronics
-.hy 14
-.br
-.bd 1
-.rt
-.ll \\n(LLu
-.in 2.1i
-\s7Date- \s8
-.rt
-.in 2.35i
-.bd 1 2
-.ps 8
-April 1, 1976
-.sp
-.bd 1
-.ti 2.1i
-.mk
-\s7TM- \s8
-.br
-.rt
-.bd 1 2
-1978-5b3
-.rt
-.in 0
-.bd 1
-.sp
-.mk
-\s7Other Keywords- \kQ 
-.rt
-.in \nQu
-.bd 1 2
-.ps 8
-Tools
-Design
-.rm OK
-.rm OD
-.in 0
-.bd 1
-.if t .sp .35i
-.ps 7
-.ta 1.05i 1.7i 2.0i
-Author Location        Ext.    Charging Case- \s8$fat roman size 8 99999$
-.nf
-.mk
-.bd 1 2
-.ps 8
-J. Q. Pencilpusher     MH 2G-111       2345
-.rt
-.br
-.bd 1
-                       \s7Filing Case- \s8$fat roman size 8 "99999a"$
-.br
-.bd 1 2
-X. Y. Hardwired        MH 1K-222       5432
-.sp .2i
-.bd 1
-.br
-.ll 3i
-.ce
-.ft I
-ABSTRACT
-.ft 1
-.sp
-.fi
-.ps 8
-.ll 2.5i
-.in +.25i
-.ti +2
-This abstract should be short enough to fit
-on a single page cover sheet.
-It must attract the reader into sending for the
-complete memorandum.
-.in
-.ll
-.sp .4i
-.nf
-\l'3i'
-.ta .9i 1.8i 2.7i
-.sp 5p
-Pages Text   10        Other   2       Total   12
-.if t .sp 8p
-.if n .sp 
-.if t No. Figures    5 No. Tables   6  No. Refs.   7   \b'|||||\ \ '
-\l'3i'
-.ps 6
-.if n .sp
-.lt 3i
-.tl 'E-1932-U (6-73)''SEE REVERSE SIDE FOR DISTRIBUTION LIST'
-.sp .20i
-.de eb
-.sp -1
-.nf
-\h'-1m'\L'|\\nau-1'\l'\\n(.lu+2m\(ul'\L'-|\\nau+1'\l'|0u-1m\(ul'
-.fi
-..
-.eb
-.b2
-.hh "A Released Paper with Mathematics"
-.ft 3
-.nf
-.EQ
-delim off
-.EN
-\&.EQ
-\&delim $$
-\&.EN
-\&.RP
-.sp
-.ft 1
-\&... (as for a TM)
-.sp
-.ft 3
-\&.CS 10 2 12 5 6 7
-\&.NH
-\&Introduction
-\&.PP
-\&The solution to the torque handle equation
-\&.EQ (1)
-\&sum from 0 to inf F ( x sub i ) = G ( x )
-\&.EN
-\&is found with the transformation $ x = rho over
-\&theta $ where $ rho = G prime (x) $ and $theta$
-\&is derived ...
-.ft 1
-.sp 2
-.mk a
-.ll 3i
-.ps 9
-.bd 1 2
-.sp .4i
-.ce 2
-.vs 11p
-The Role of the Allen Wrench
-in Modern Electronics
-.sp .7
-.ce 3
-.ft 2
-.bd 1
-.ps 8
-.vs 9p
-J. Q. Pencilpusher
-.sp .7
-X. Y. Hardwired
-.sp .7
-.ce 2
-.ft 1
-Bell Laboratories
-Murray Hill, New Jersey 07974
-.sp 2
-.ce
-.ft 2
-ABSTRACT
-.ft 1
-.sp .7
-.in +.25i
-.ll 2.75i
-.fi
-.ad
-.ti +2n
-This abstract should be short enough to fit
-on a single page cover sheet.
-It must attract the reader into sending for the
-complete memorandum.
-.sp 5v
-.in
-.ll
-April 1, 1976
-.sp .2i
-.eb
-.ll 3i
-.sp .5v
-.sp 3.5p
-.mk a
-.lt 3i
-.ps 9
-.sp .25i
-.bd 1 2
-.ce 2
-.vs 11p
-The Role of the Allen Wrench
-in Modern Electronics
-.sp
-.ce 3
-.bd 1
-.ft 2
-.ps 8
-.vs 9p
-J. Q. Pencilpusher
-.sp
-X. Y. Hardwired
-.sp
-.ce 2
-.ft 1
-Bell Laboratories
-Murray Hill, New Jersey 07974
-.sp 3
-.ce
-.de SH
-.bd 1 2
-.sp
-.ce 0
-.in 0
-..
-.de PP
-.sp .3
-.ft 1
-.bd 1
-.ti +2n
-..
-.SH
-1. Introduction
-.PP
-The solution to the torque handle equation
-.br
-.di xx
-.EQ
-delim $$
-gsize 8
-sum from 0 to inf F ( x sub i ) = G ( x )
-.EN
-.br
-.di
-.tl ''\*(10'(1)'
-is found with the transformation
-$ x = rho over theta $ where $ rho = G prime ( x )$
-and $theta$ is derived from well-known principles.
-......PP
-......ft 2
-.....The Ascent of the Riffelberg,
-......ft 1
-.....by Mark Twain.
-.....I sat silent some time, then turned to Harris and said:
-.....``My mind is made up.''
-.....Something in my tone struck him; and when he glanced
-.....at my eye and read what was written there, his face paled
-.....perceptibly.  He hesitated a moment, then said:
-.....``Speak.''
-.....I answered, with perfect calmness:
-......ft 2
-.....``I will ascend the Riffelberg.''
-......ft 1
-.....If I had shot my poor friend he could not have fallen from
-.....his chair more suddenly.  If I had been his father he
-.....could not have pleaded harder to get me to give up my
-.....purpose.  But I turned a deaf ear to all he said.  When he
-.....perceived at last that nothing could alter my determination,
-.....he ceased to urge, and for a while the deep\p
-.sp .5v
-.sp 3.5p
-.eb
-.b1
-.hh "An Internal Memorandum"
-.ft 3
-.nf
-\&.IM
-\&.ND January 24, 1956
-\&.TL
-\&The 1956 Consent Decree
-\&.AU
-\&Able, Baker &
-\&Charley, Attys.
-\&.PP
-Plaintiff, United States of America, having filed
-its complaint herein on January 14, 1949; the
-defendants having appeared and filed their
-answer to such complaint denying the
-substantive allegations thereof; and the parties,
-by their attorneys, ...
-.ft
-.sp
-.ft 1
-.mk a
-.br
-.sp .20i
-.ta 2.1i
-.ll 3i
-.ps 18
-.br
-       \(bs
-.vs .20i
-.ps 7
-.br
-.bd 1 2
-.nf
-       Bell Laboratories
-.fi
-.na
-.bd 1
-.ps 7
-.vs 8p
-.sp .12i
-.mk
-.fi
-.ll
-.ll 2.0i
-Subject:
-.ps 8
-.hy 0
-.br
-.bd 1 2
-.sp -1
-\h'\w'\s7Subject: \s0'u'The 1956 Consent Decree
-.hy 14
-.br
-.bd 1
-.rt
-.ll 3.25i
-.in 2.10i
-.ps 7
-.mk
-.ti -6n
-date:
-.br
-.bd 1 2
-.rt
-.ps 8
-January 24, 1956
-.sp
-.bd 1
-.ps 7
-.mk
-.ti -6n
-from:
-.ps 8
-.nf
-.br
-.bd 1 2
-.rt
-Able, Baker &
-Charley, Attys.
-.br
-.bd 1
-.sp
-.sp
-.ll 3i
-.ad
-.fi
-.in 0
-.de SH
-.sp .5
-.bd 1 2
-..
-.de PP
-.sp .3
-.bd 1
-.ti +2n
-..
-.PP
-Plaintiff, United States of America, having filed its complaint
-herein on January 14, 1949; the defendants having appeared and
-filed their answer to such complaint denying the substantive
-allegations thereof; and the parties, by their attorneys, having
-severally consented to the entry of this Final Judgment without
-trial or adjudication of any issues of fact or law herein and without
-this Final Judgment constituting any evidence or admission by any
-party in respect of any such issues;
-.PP
-Now, therefore before any testimony has been taken herein, and
-without trial or adjudication of any issue of fact or law herein,
-and upon the consent of all parties hereto, it is hereby
-.PP
-Ordered, adjudged and decreed as follows:
-.SH
-I.
-[Sherman Act]
-.PP
-This Court has jurisdiction of the subject matter herein and of all
-the parties hereto.
-The complaint states a claim upon which relief may be granted
-against each of the defendants under Sections 1, 2 and 3 of the
-Act of Congress of July 2, 1890, entitled ``An act to protect
-trade and commerce against unlawful restraints and monopolies,''
-commonly known as the Sherman Act, as amended.
-.SH
-II.
-[Definitions]
-.PP
-For the purposes of this Final Judgment:
-.PP
-(a)  ``Western'' shall mean the defendant Western Electric
-Company, Incorporated.
-.sp .25i
-.eb
-.sp
-.ft 1
-.bd 1
-
-.ps 9
-.vs 10p
-Other formats possible (specify before \f3.TL\f1) are:
-\&\f3.MR\f1 (``memo for record''), \f3.MF\f1
-(``memo for file''),
-\&\f3.EG\f1 (``engineer's notes'') and \f3.TR\f1
-(Computing Science Tech. Report).
-.sp 2
-.hh "Headings"
-.sp .5
-.nf
-.ft 3
-.ta 2i
-\&.NH  .SH
-Introduction.  Appendix I
-\&.PP  .PP
-text text text text text text
-.ft 1
-.bd 1 2
-.sp
-.br
-1.  Introduction       Appendix I
-.br
-.sp .3v
-.bd 1
-\0\0text text text     \0\0text text text
-.br
-.b2
-.hh "A Simple List"
-.ft 3
-.nf
-\&.IP 1.
-\&J. Pencilpusher and X. Hardwired,
-\&.I
-\&A New Kind of Set Screw,
-\&.R
-\&Proc. IEEE
-\&.B 75
-\&(1976), 23-255.
-\&.IP 2.
-\&H. Nails and R. Irons,
-\&.I
-\&Fasteners for Printed Circuit Boards,
-\&.R
-\&Proc. ASME
-\&.B 23
-\&(1974), 23-24.
-\&.LP  \fP(terminates list)
-.sp 1.5
-.EQ
-delim $$
-gsize 9
-.EN
-.fi
-.IP 1.
-J. Pencilpusher and X. Hardwired,
-.I
-A New Kind of Set Screw,
-.R
-Proc. IEEE
-$fat 75$
-(1976), 23-255.
-.IP 2.
-H. Nails and R. Irons,
-.I
-Fasteners for Printed Circuit Boards,
-.R
-Proc. ASME
-$fat 23$
-(1974), 23-24.
-.LP
-.sp 2
-.EQ
-delim off
-.EN
-.hh "Displays"
-.nf
-.ft 3
-\&text text text text text text 
-\&.DS
-\&and now
-\&for something
-\&completely different
-\&.DE
-\&text text text text text text 
-.ft
-.sp 1
-.fi
-hoboken harrison newark roseville avenue grove street
-east orange brick church orange highland avenue
-mountain station south orange maplewood millburn short hills
-summit new providence
-.in .4i
-.sp .5
-.nf
-and now
-for something
-completely different
-.sp .5
-.in
-.fi
-murray hill berkeley heights
-gillette stirling millington lyons basking ridge
-bernardsville far hills peapack gladstone
-.sp .5
-Options: \f3.DS L\f1: left-adjust;
-\&\f3.DS C\f1: line-by-line center; \f3.DS B\f1: make block, then center.
-.sp  2
-.hh "Footnotes"
-.nf
-.ft 3
-\&Among the most important occupants
-\&of the workbench are the long-nosed pliers.
-\&Without these basic tools*
-\&.FS
-\&* As first shown by Tiger & Leopard
-\&(1975).
-\&.FE
-\&few assemblies could be completed.  They may
-\&lack the popular appeal of the sledgehammer
-.ft
-.sp 1.5
-.fi
-Among the most important occupants
-of the workbench are the long-nosed
-pliers.
-Without these basic tools*
-few assemblies could be completed.
-They may lack the
-popular appeal of the sledgehammer
-.br
-\l'1i'
-.ps -1
-.br
-* As first shown by Tiger & Leopard (1975).
-.ps
-.br
-.nf
-.b1
-.hh "Multiple Indents"
-.ft 3
-\&This is ordinary text to point out
-\&the margins of the page.
-\&.IP 1.
-\&First level item
-\&.RS
-\&.IP a)
-\&Second level.
-\&.IP b)
-\&Continued here with another second
-\&level item, but somewhat longer.
-\&.RE
-\&.IP 2.
-\&Return to previous value of the
-\&indenting at this point.
-\&.IP 3.
-\&Another
-\&line.
-.ft
-.sp 1.5v
-.fi
-This is ordinary text to point out
-the margins of the page.
-.IP 1.
-First level item
-.RS
-.IP a)
-Second level.
-.IP b)
-Continued here with another second level
-item, but somewhat longer.
-.RE
-.IP 2.
-Return to previous value of the
-indenting at this point.
-.IP 3.
-Another
-line.
-.LP
-.sp 2
-.hh "Keeps"
-.fi
-Lines bracketed by the following commands are kept together,
-and will appear entirely on one page:
-.TS
-center;
-Lf3 5 L8 Lf3 5 L.
-\&.KS  not moved       .KF     may float
-\&.KE  through text    .KE     in text
-.TE
-.nf
-.sp 2
-.hh "Double Column"
-.nf
-.hy 0
-.ft 3
-\&.TL
-The Declaration of Independence
-\&.2C
-.na
-.fi
-\&.PP
-.br
-When in the course of human events, it becomes
-necessary for one people to dissolve the political bonds 
-which have connected them with another, and to assume 
-among the powers of the earth the separate and equal station
-to which the laws of Nature and of Nature's God entitle them,
-a decent respect to the opinions of
-.ft
-.de xy
-.if \\n(xy=0 'rt
-.if \\n(xy=0 'po +1.58i
-.nr xy +1
-..
-.wh 10.45i xy
-.br
-.ad
-.hy 1 
-.sp 1.5
-.ce
-The Declaration of Independence
-.sp .5
-.ll 1.42i
-.mk
-.fi
-.ti +2n
-When in the course of human events, it becomes
-necessary for one people to dissolve the political bonds which have
-connected them with another, and to assume among the 
-powers of the earth the separate and equal station to which
-the laws of Nature and of Nature's God entitle them, a decent
-respect to the opinions of mankind requires that they should
-declare the causes which impel them to the separation.
-.ti +2n
-We hold these truths to be self-evident, that all men
-are created equal, that they are endowed by their creator
-with certain unalienable rights, that among these are life, liberty,
-and the pursuit of happiness.  That to secure these rights,
-governments are instituted among men,\p
-.br
-.po -1.58i
-.ll 3i
-.lt 3i
-.rm xy
-.b2
-.hh "Equations"
-.nf
-.de EQ  \"equation, breakout and display
-.nr EF \\n(.u
-.rm EE
-.nr LE 1       \" 1 is center
-.ds EL \\$1
-.if "\\$1"L" .ds EL \\$2
-.if "\\$1"L" .nr LE 0
-.if "\\$1"C" .ds EL \\$2
-.if "\\$1"I" .nr LE 0
-.if "\\$1"I" .ds EE \\h'5n'
-.if "\\$1"I" .if !"\\$3"" .ds EE \\h'\\$3n'
-.if "\\$1"I" .ds EL \\$2
-.nf
-.di EZ
-..
-.de EN  \" end of a displayed equation
-.di
-.rm EZ
-.lt \\n(.lu
-.pc
-.if \\n(dn>0 .if \\n(LE>0 .tl \(ts\(ts\\*(10\(ts\\*(EL\(ts
-.if \\n(dn>0 .if \\n(LE=0 .tl '\\*(EE\\*(10''\\*(EL'
-.pc %
-.lt \\n(LLu
-.if \\n(EF>0 .fi
-.rm EL
-.rm 10
-.nr PE \\n(.d
-..
-.ft 3
-A displayed equation is marked
-with an equation number at the right margin
-by adding an argument to the EQ line:
-\&.EQ (1.3)
-x sup 2 over a sup 2 ~=~ sqrt {p z sup 2 +qz+r}
-\&.EN
-.ft
-.sp
-.fi
-A displayed equation is marked with an equation number
-at the right margin by adding an argument to the EQ line:
-.sp .4
-.EQ (1.3)
-x sup 2 over a  sup 2
-~=~ sqrt { p z sup 2 + q z + r }
-.EN
-.sp 
-.nf
-.ft 3
-\&.EQ  I (2.2a)
-bold V bar sub nu~=~left [ pile {a above b above
-c } right ] + left [ matrix { col { A(11) above .
-above . } col { . above . above .} col {. above .
-above A(33) }} right ] cdot left [ pile { alpha
-above beta above  gamma } right ]
-.nf
-\&.EN
-.ft
-.sp
-.EQ I (2.2a)
-fat {roman  V}  bar sub nu~=~left [ pile {a above b above c}
-right ] + left [ matrix { col { A(11) above .
-above . } col { . above . above .} col {. above .
-above A(33) }} right ] cdot left [ pile { alpha
-above beta above  gamma } right ]
-.EN
-.sp
-.ft 3
-\&.EQ  L
-F hat ( chi ) ~ mark = ~ | del V | sup 2
-\&.EN
-\&.EQ  L
-.fi
-.na
-lineup =~ {left ( {partial V} over {partial x} right ) } sup 2
-+ { left ( {partial V} over {partial y} right ) } sup 2
-~~~~~~ lambda -> inf
-.nf
-\&.EN
-.ft
-.ta .25i
-.sp
-.EQ L
-F hat ( chi ) ~ mark = ~ | del V | sup 2
-.EN
-.sp 1
-.EQ L
-delim off
-lineup =~ {left ( {partial V} over {partial x} right ) } sup 2
-+ { left ( {partial V} over {partial y} right ) } sup 2
-~~~~~~ lambda -> inf
-.EN
-.rm EQ
-.rm EN
-.fi
-.sp
-.ft 3
-$ a dot $,  $ b dotdot$,  $ xi tilde times
-y vec$:
-.EQ
-delim $$
-.EN
-.ft R
-.br
-.sp
-$ a dot $,  $ b dotdot$,  $ xi tilde times
-y vec$.
-.EQ
-delim off
-.EN
-\h'.3i'(with delim $$ on, see panel 3).
-.sp .5
-See also the equations in the second table, panel 8.
-.nf
-.br
-.bd I
-.sp 2
-.ft R
-.hh "Some Registers You Can Change"
-.nf
-.mk
-Line length
-       .nr LL 7i
-.sp .4
-Title length
-       .nr LT 7i
-.sp .4
-Point size
-       .nr PS 9
-.sp .4
-Vertical spacing
-       .nr VS 11
-.sp .4
-Column width
-       .nr CW 3i
-.sp .4
-Intercolumn spacing
-       .nr GW .5i
-.sp .4
-Margins \- head and foot
-       .nr HM .75i
-       .nr FM .75i
-.sp .4
-Paragraph indent
-       .nr PI 2n
-.rt
-.po +1.6i
-Paragraph spacing
-       .nr PD 0
-.sp .4
-Page offset
-       .nr PO 0.5i
-.sp .4
-Page heading
-       .ds CH Appendix 
-           (center)
-       .ds RH 7-25-76
-           (right)
-       .ds LH Private
-           (left)
-.sp .4
-Page footer
-       .ds CF Draft
-       .ds LF
-       .ds RF  \u similar \d
-.sp .4
-Page numbers
-       .nr % 3
-.po -1.6i
-.b1
-.hh Tables
-.nf
-.ds T \|\h'.35n'\v'-.1n'\s6\zT\s0\v'.1n'\h'-.35n'\(ci\|
-.ft 3
-.EQ
-delim off
-.EN
-\&.TS\h'.5i'\fR(\f3\*T\f1 indicates a tab)\f3
-\&allbox;
-.nr x \n(nl
-\&c s s
-\&c c c
-\&n n n.
-\&AT&T Common Stock
-\&Year\*TPrice\*TDividend
-\&1971\*T41-54\*T$2.60
-\&2\*T41-54\*T2.70
-\&3\*T46-55\*T2.87
-\&4\*T40-53\*T3.24
-\&5\*T45-52\*T3.40
-\&6\*T51-59\*T.95*
-\&.TE
-\&* (first quarter only)
-.ft 1
-.nr y \n(nl
-.sp |\nxu
-.di qq
-.TS
-allbox;
-c s s
-c c c
-n1 n1 n1.
-AT&T Common Stock
-Year   Price   Dividend
-1971   41-54   $2.60
-2      41-54   2.70
-3      46-55   2.87
-4      40-53   3.24
-5      45-52   3.40
-6      51-59   .95*
-.TE
-* (first quarter only)
-.br
-.di
-.in 3i-\n(TWu
-.nf
-.qq
-.in 0
-.if \ny>\n(nl .sp |\nyu
-.sp .5
-.ft 1
-.fi
-.ad
-The meanings of the key-letters describing
-the alignment of each entry are:
-.br
-.nf
-.TS
-center;
-cf3 l6 cf3 l.
-c      center  n       numerical
-r      right-adjust    a       subcolumn
-l      left-adjust     s       spanned
-.TE
-.fi
-The global table options are
-.ft 3
-.bd I 2
-.hy 0
-center, expand, box, doublebox, allbox,
-tab (\f2x\fP\|)
-.ft 1
-and
-.ft 3
-linesize (\f2n\fP\|).
-.br
-.hy 1
-.ft 1
-.bd I
-.sp 1
-.nf
-.ta .1i
-.ft 3
-\&.TS\h'.5i'\fR(with delim $$ on, see panel 3)\fP
-\&doublebox, center;
-\&c c
-\&l l.
-\&Name\*TDefinition
-\&.sp
-\&Gamma\*T$GAMMA (z) = int sub 0 sup inf \e
-        t sup {z-1} e sup -t dt$
-\&Sine\*T$sin (x) = 1 over 2i ( e sup ix - e sup -ix )$
-\&Error\*T$ roman erf (z) = 2 over sqrt pi \e
-       int sub 0 sup z e sup {-t sup 2} dt$
-\&Bessel\*T$ J sub 0 (z) = 1 over pi \e
-       int sub 0 sup pi cos ( z sin theta ) d theta $
-\&Zeta\*T$ zeta (s) = \e
-       sum from k=1 to inf k sup -s ~~( Re~s > 1)$
-\&.TE
-.ft
-.sp
-.EQ
-delim $$
-.EN
-.vs +2p
-.TS
-doublebox, center;
-c c
-l l.
-Name   Definition
-.sp
-Gamma  $GAMMA (z) = int sub 0 sup inf  t sup {z-1} e sup -t dt$
-Sine   $sin (x) = 1 over 2i ( e sup ix - e sup -ix )$
-Error  $ roman erf (z) = 2 over sqrt pi int sub 0 sup z e sup {-t sup 2} dt$
-Bessel $ J sub 0 (z) = 1 over pi int sub 0 sup pi cos ( z sin theta ) d theta $
-Zeta   $ zeta (s) = sum from k=1 to inf k sup -s ~~( Re~s > 1)$
-.TE
-.vs -2p
-.br
-.bd I 2
-.sp 1
-.hh "Usage"
-.ps 9
-.vs 10p
-.ds & \\s-1&\\s0
-.TS
-l.
-\h'.25i'Documents with just text:
-troff -ms files 
-\h'.25i'With equations only:
-eqn files | troff -ms 
-\h'.25i'With tables only:
-tbl files | troff -ms 
-\h'.25i'With both tables and equations:
-tbl files\||\|eqn\||\|troff -ms
-_
-.TE
-.ft R
-.fi
-.sp .5
-The above generates \s-2STARE\s0 output on
-\s-2GCOS\s0: replace
-.ft 3
-\-st
-.ft R
-with
-.ft 3
-\-ph
-.ft R
-for typesetter output.
-.ft 1
-.bd I
-.b2
diff --git a/.ref-Research-V7/usr/doc/password b/.ref-Research-V7/usr/doc/password
deleted file mode 100644 (file)
index 27124b8..0000000
+++ /dev/null
@@ -1,558 +0,0 @@
-.\" tbl mm ^ eqn ^ troff -ms
-.EQ
-delim $$
-.EN
-.RP
-....TM 78-1271-5 39199 39199-11
-.ND April 3, 1978
-.TL
-Password Security:
-A Case History
-.OK
-Encryption
-Computing
-.AU "MH 2C-524" 3878
-Robert Morris
-.AU "MH 2C-523" 2394
-Ken Thompson
-.AI
-.MH
-.AB
-This paper describes the history of the design of the
-password security scheme on a remotely accessed time-sharing
-system.
-The present design was the result of countering
-observed attempts to penetrate the system.
-The result is a compromise between extreme security and
-ease of use.
-.AE
-.CS 6 0 6 0 0 4
-.SH
-INTRODUCTION
-.PP
-Password security on the
-.UX
-time-sharing system [1] is provided by a
-collection of programs
-whose elaborate and strange design is the outgrowth of
-many years of experience with earlier versions.
-To help develop a secure system, we have had a continuing
-competition to devise new ways to
-attack the security of the system (the bad guy) and, at the same time, to
-devise new techniques to resist the new attacks (the good guy).
-This competition has been in the same vein as the
-competition of long standing between manufacturers of armor
-plate and those of armor-piercing shells.
-For this reason, the description that follows will
-trace the history of the password system rather than simply
-presenting the program in its current state.
-In this way, the reasons for the design will be made clearer,
-as the design cannot be understood without also
-understanding the potential attacks.
-.PP
-An underlying goal has been to provide password security
-at minimal inconvenience to the users of the system.
-For example, those who want to run a completely open
-system without passwords, or to have passwords only at the
-option of the individual users, are able to do so, while
-those who require all of their users to have passwords
-gain a high degree of security
-against penetration of the system by unauthorized
-users.
-.PP
-The password system must be able not only to prevent
-any access to the system by unauthorized users
-(i.e. prevent them from logging in at all),
-but it must also
-prevent users who are already logged in from doing
-things that they are not authorized to do.
-The so called ``super-user'' password, for example, is especially
-critical because the super-user has all sorts of
-permissions and has essentially unlimited access to
-all system resources.
-.PP
-Password security is of course only one component of
-overall system security, but it is an essential component.
-Experience has shown that attempts to penetrate
-remote-access systems have been astonishingly
-sophisticated.
-.PP
-Remote-access systems are peculiarly vulnerable to
-penetration by outsiders as there are threats at the
-remote terminal, along the communications link, as well
-as at the computer itself.
-Although the security of a password encryption algorithm
-is an interesting intellectual and mathematical problem,
-it is only one tiny facet of a very large problem.
-In practice, physical security of the computer, communications
-security of the communications link, and physical control
-of the computer itself loom as far more important issues.
-Perhaps most important of all is control over the actions
-of ex-employees, since they are not under any direct control
-and they may have intimate
-knowledge about the system, its resources, and
-methods of access.
-Good system security involves realistic
-evaluation of the risks not only of deliberate
-attacks but also of casual unauthorized access
-and accidental disclosure.
-.SH
-PROLOGUE
-.PP
-The UNIX system was first implemented with a password file that contained
-the actual passwords of all the users, and for that reason
-the password file had to
-be heavily protected against being either read or written.
-Although historically, this had been the technique used
-for remote-access systems,
-it was completely unsatisfactory for several reasons.
-.PP
-The technique is excessively vulnerable to lapses in
-security.
-Temporary loss of protection can occur when
-the password file is being edited or otherwise modified.
-There is no way to prevent the making of copies by
-privileged users.
-Experience with several earlier remote-access systems
-showed that such lapses occur with frightening frequency.
-Perhaps the most memorable such occasion occurred
-in the early 60's when
-a system administrator on the CTSS system at MIT
-was editing the
-password file and another system administrator was editing
-the daily message that is printed on everyone's terminal
-on login.
-Due to a software design error, the temporary editor files
-of the two users were interchanged and thus, for a time, the password
-file was printed on every terminal when it was logged in.
-.PP
-Once such a lapse in security has been discovered, everyone's
-password must be changed, usually simultaneously, at a considerable
-administrative cost.
-This is not a great matter, but
-far more serious is the high probability of such lapses
-going unnoticed by the system administrators.
-.PP
-Security against unauthorized disclosure of the passwords was,
-in the last analysis, impossible with this system because,
-for example, if the
-contents of the file system are put on to magnetic tape for
-backup, as they must be, then anyone who has physical
-access to the tape
-can read anything on it with no restriction.
-.PP
-Many programs must get information of various kinds
-about the users of the system, and these programs in general
-should have no special permission to read the password file.
-The information which should have been in the password file actually was
-distributed (or replicated) into a number of files, all of
-which had to be updated whenever a user was added to or
-dropped from the system.
-.SH
-THE FIRST SCHEME
-.PP
-The obvious solution is to arrange that the passwords not
-appear in the system at all, and it is not difficult to decide
-that this can be done by encrypting each user's password,
-putting only the encrypted form in the password file, and
-throwing away his original password (the one that
-he typed in).
-When the user later tries to log in to the system, the password
-that he types is encrypted and compared with the encrypted
-version in the password file.
-If the two match, his login attempt is accepted.
-Such a scheme was first described
-in [3, p.91ff.].
-It also seemed advisable to devise
-a system in which neither the password file nor the
-password program itself needed to be
-protected against being read by anyone.
-.PP
-All that was needed to implement these ideas
-was to find a means of encryption that was very difficult
-to invert, even when the encryption program
-is available.
-Most of the standard encryption methods used (in the past)
-for encryption of messages are rather easy to invert.
-A convenient and rather good encryption program happened
-to exist on the system at the time; it simulated the
-M-209 cipher machine [4]
-used by the U.S. Army during World War II.
-It turned out that the M-209 program was usable, but with
-a given key, the ciphers produced by this program are
-trivial to invert.
-It is a much more difficult matter to find out the key
-given the cleartext input and the enciphered output of the program.
-Therefore,
-the password was used not as the text to be encrypted but as the
-key, and a constant was encrypted using this key.
-The encrypted result was entered into the password file.
-.SH
-ATTACKS ON THE FIRST APPROACH
-.PP
-Suppose that the bad guy has available
-the text of the password encryption program and
-the complete password file.
-Suppose also that he has substantial computing
-capacity at his disposal.
-.PP
-One obvious approach to penetrating the password
-mechanism is to attempt to find a general method of inverting
-the encryption algorithm.
-Very possibly this can be done, but few
-successful results
-have come to light, despite substantial efforts extending
-over a period of more than five years.
-The results have not proved to be very useful
-in penetrating systems.
-.PP
-Another approach to penetration is simply to keep trying
-potential
-passwords until one succeeds; this is a general cryptanalytic
-approach called
-.I
-key search.
-.R
-Human beings being what they are, there is a strong tendency
-for people to choose relatively short and simple passwords that
-they can remember.
-Given free choice, most people will choose their passwords
-from a restricted character set (e.g. all lower-case letters),
-and will often choose words or names.
-This human habit makes the key search job a great deal easier.
-.PP
-The critical factor involved in key search is the amount of
-time needed to encrypt a potential password and to check the result
-against an entry in the password file.
-The running time to encrypt one trial password and check
-the result turned out to be approximately 1.25 milliseconds on
-a PDP-11/70 when the encryption algorithm was recoded for
-maximum speed.
-It is takes essentially no more time to test the encrypted
-trial password against all the passwords in
-an entire password file, or for that matter, against
-any collection of encrypted passwords, perhaps collected
-from many installations.
-.PP
-If we want to check all passwords of length
-.I
-n
-.R
-that consist entirely of lower-case letters, the number
-of such passwords is $26 sup n$.
-If we suppose that the password consists of
-printable characters only, then the number of possible passwords
-is somewhat less than $95 sup n$.
-(The standard system ``character erase'' and ``line kill''
-characters are, for example, not prime
-candidates.)
-We can immediately estimate the running time of a program that
-will test every password of a given length with all of its
-characters chosen from some set of characters.
-The following table gives estimates of the running time
-required on a PDP-11/70
-to test all possible character strings of length $n$
-chosen from various sets of characters: namely, all lower-case
-letters, all lower-case letters plus digits,
-all alphanumeric characters, all 95 printable
-ASCII characters, and finally all 128 ASCII characters.
-.TS
-cccccc
-cccccc
-nnnnnn.
-       26 lower-case   36 lower-case letters   62 alphanumeric 95 printable    all 128 ASCII
-n      letters and digits      characters      characters      characters
-.sp .5
-1      30 msec.        40 msec.        80 msec.        120 msec.       160 msec.
-2      800 msec.       2 sec.  5 sec.  11 sec. 20 sec.
-3      22 sec. 58 sec. 5 min.  17 min. 43 min.
-4      10 min. 35 min. 5 hrs.  28 hrs. 93 hrs.
-5      4 hrs.  21 hrs. 318 hrs.
-6      107 hrs.
-.TE
-.LP
-One has to conclude that it is no great matter for someone with
-access to a PDP-11 to test all lower-case alphabetic strings up
-to length five
-and, given access to the machine for, say, several weekends, to test
-all such strings up to six characters in length.
-By using such a program against a collection of actual encrypted
-passwords, a substantial fraction of all the passwords will be
-found.
-.PP
-Another profitable approach for the bad guy is to use the word
-list from a dictionary or to use a list of names.
-For example, a large commercial dictionary contains typicallly about
-250,000 words; these words can be checked in about five minutes.
-Again, a noticeable fraction of any collection of passwords
-will be found.
-Improvements and extensions will be (and have been) found by
-a determined bad guy.
-Some ``good'' things to try are:
-.IP -
-The dictionary with the words spelled backwards.
-.IP -
-A list of first names (best obtained from some mailing list).
-Last names, street names, and city names also work well.
-.IP -
-The above with initial upper-case letters.
-.IP -
-All valid license plate numbers in your state.
-(This takes about five hours in New Jersey.)
-.IP -
-Room numbers, social security numbers, telephone numbers, and
-the like.
-.PP
-The authors have conducted experiments to try to determine
-typical users' habits in the choice of passwords when no
-constraint is put on their choice.
-The results were disappointing, except to the bad guy.
-In a collection of 3,289 passwords
-gathered from many users over a long period of time;
-.IP
-15 were a single ASCII character;
-.IP
-72 were strings of two ASCII characters;
-.IP
-464 were strings of three ASCII characters;
-.IP
-477 were string of four alphamerics;
-.IP
-706 were five letters, all upper-case or all lower-case;
-.IP
-605 were six letters, all lower-case.
-.LP
-An additional 492 passwords appeared in various available
-dictionaries, name lists, and the like.
-A total of 2,831, or 86% of this sample of passwords fell into one of
-these classes.
-.PP
-There was, of course, considerable overlap between the
-dictionary results and the character string searches.
-The dictionary search alone, which required only five
-minutes to run, produced about one third of the passwords.
-.PP
-Users could be urged (or forced) to use either longer passwords
-or passwords chosen from a larger character set, or the system
-could itself choose passwords for the users.
-.SH
-AN ANECDOTE
-.PP
-An entertaining and instructive example is
-the attempt made at one installation to force users to use less predictable
-passwords.
-The users did not choose their own passwords; the system supplied
-them.
-The supplied passwords were eight characters long and 
-were taken from the character set consisting of
-lower-case letters and digits.
-They were generated by a pseudo-random number generator
-with only $2 sup 15$ starting values.
-The time required to search (again on a PDP-11/70) through
-all character strings of length 8 from a 36-character
-alphabet is 112 years.
-.PP
-Unfortunately, only $2 sup 15$ of them need be looked at,
-because that is the number of possible outputs of the random
-number generator.
-The bad guy did, in fact, generate and test each of these strings
-and found every one of the system-generated passwords using
-a total of only about one minute of machine time.
-.SH
-IMPROVEMENTS TO THE FIRST APPROACH
-.NH
-Slower Encryption
-.PP
-Obviously, the first algorithm used was far too fast.
-The announcement of the DES encryption algorithm [2]
-by the National Bureau of Standards
-was timely and fortunate.
-The DES is, by design, hard to invert, but equally valuable
-is the fact that it is extremely slow when implemented in
-software.
-The DES was implemented and used in the following way:
-The first eight characters of the user's password are
-used as a key for the DES; then the algorithm
-is used to encrypt a constant.
-Although this constant is zero at the moment, it is easily
-accessible and can be made installation-dependent.
-Then the DES algorithm is iterated 25 times and the
-resulting 64 bits are repacked to become a string of
-11 printable characters.
-.NH
-Less Predictable Passwords
-.PP
-The password entry program was modified so as to urge
-the user to use more obscure passwords.
-If the user enters an alphabetic password (all upper-case or
-all lower-case) shorter than six characters, or a
-password from a larger character set shorter than five
-characters, then the program asks him to enter a
-longer password.
-This further reduces the efficacy of key search.
-.PP
-These improvements make it exceedingly difficult to find
-any individual password.
-The user is warned of the risks and if he cooperates,
-he is very safe indeed.
-On the other hand, he is not prevented from using
-his spouse's name if he wants to.
-.NH
-Salted Passwords
-.PP
-The key search technique is still
-likely to turn up a few passwords when it is used
-on a large collection of passwords, and it seemed wise to make this
-task as difficult as possible.
-To this end, when a password is first entered, the password program
-obtains a 12-bit random number (by reading the real-time clock)
-and appends this to the password typed in by the user.
-The concatenated string is encrypted and both the
-12-bit random quantity (called the $salt$) and the 64-bit
-result of the encryption are entered into the password
-file.
-.PP
-When the user later logs in to the system, the 12-bit
-quantity is extracted from the password file and appended
-to the typed password.
-The encrypted result is required, as before, to be the same as the
-remaining 64 bits in the password file.
-This modification does not increase the task of finding
-any individual
-password,
-starting from scratch,
-but now the work of testing a given character string
-against a large collection of encrypted passwords has
-been multiplied by 4096 ($2 sup 12$).
-The reason for this is that there are 4096 encrypted
-versions of each password and one of them has been picked more
-or less at random by the system.
-.PP
-With this modification,
-it is likely that the bad guy can spend days of computer
-time trying to find a password on a system with hundreds
-of passwords, and find none at all.
-More important is the fact that it becomes impractical
-to prepare an encrypted dictionary in advance.
-Such an encrypted dictionary could be used to crack
-new passwords in milliseconds when they appear.
-.PP
-There is a (not inadvertent) side effect of this
-modification.
-It becomes nearly impossible to find out whether a
-person with passwords on two or more systems has used
-the same password on all of them,
-unless you already know that.
-.NH
-The Threat of the DES Chip
-.PP
-Chips to perform the DES encryption are already commercially
-available and they are very fast.
-The use of such a chip speeds up the process of password
-hunting by three orders of magnitude.
-To avert this possibility, one of the internal tables
-of the DES algorithm
-(in particular, the so-called E-table)
-is changed in a way that depends on the 12-bit random
-number.
-The E-table is inseparably wired into the DES chip,
-so that the commercial chip cannot be used.
-Obviously, the bad guy could have his own chip designed and
-built, but the cost would be unthinkable.
-.NH
-A Subtle Point
-.PP
-To login successfully on the UNIX system, it is necessary
-after dialing in to type a valid user name, and then the
-correct password for that user name.
-It is poor design to write the login command in such a way that it
-tells an interloper when he has typed in a invalid user name.
-The response to an invalid name should be identical to
-that for a valid name.
-.PP
-When the slow encryption algorithm was first implemented,
-the encryption was done only if the user name was valid,
-because otherwise there was no encrypted password to
-compare with the supplied password.
-The result was that the response was delayed
-by about one-half second if the name was valid, but was
-immediate if invalid.
-The bad guy could find out
-whether a particular user name was valid.
-The routine was modified to do the encryption in either
-case.
-.SH
-CONCLUSIONS
-.PP
-On the issue of password security, UNIX is probably
-better than most systems.
-The use of encrypted passwords appears reasonably
-secure in the absence of serious attention of experts
-in the field.
-.PP
-It is also worth some effort to conceal even the encrypted
-passwords.
-Some UNIX systems have instituted what is called an
-``external security code'' that must be typed when
-dialing into the system, but before logging in.
-If this code is changed periodically, then someone
-with an old password will likely be prevented from
-using it.
-.PP
-Whenever any security procedure is instituted that attempts
-to deny access to unauthorized persons, it is wise to
-keep a record of both successful and unsuccessful attempts
-to get at the secured resource.
-Just as an out-of-hours visitor to a computer center normally
-must not only identify himself, but a record is usually also kept of
-his entry.
-Just so, it is a wise precaution to make and keep a record
-of all attempts to log into a remote-access time-sharing
-system, and certainly all unsuccessful attempts.
-.PP
-Bad guys fall on a spectrum whose one end is someone with
-ordinary access to a system and whose goal is to find
-out a particular password (usually that of the super-user)
-and, at the other end, someone who wishes to collect as
-much password information as possible from as many systems
-as possible.
-Most of the work reported here serves to frustrate the latter type;
-our experience indicates that the former type of bad guy never
-was very successful.
-.PP
-We recognize that a time-sharing system must operate in a
-hostile environment.
-We did not attempt to hide the security aspects of the operating
-system, thereby playing the customary make-believe game in
-which weaknesses of the system are not discussed no matter
-how apparent.
-Rather we advertised the password algorithm and invited attack
-in the belief that this approach would minimize future trouble.
-The approach has been successful.
-.SG MH-1271-RM/KT
-.SH
-References
-.IP [1]
-Ritchie, D.M. and Thompson, K.
-The UNIX Time-Sharing System.
-.I
-Comm. ACM
-.B
-17
-.R
-(July 1974),
-pp. 365-375.
-.IP [2]
-.I
-Proposed Federal Information Processing Data Encryption Standard.
-.R
-Federal Register (40FR12134), March 17, 1975
-.IP [3]
-Wilkes, M. V.
-.I
-Time-Sharing Computer Systems.
-.R
-American Elsevier,
-New York, (1968).
-.IP [4]
-U. S. Patent Number 2,089,603.
diff --git a/.ref-Research-V7/usr/doc/porttour/porttour1 b/.ref-Research-V7/usr/doc/porttour/porttour1
deleted file mode 100644 (file)
index 7e64e92..0000000
+++ /dev/null
@@ -1,1500 +0,0 @@
-.TL
-A Tour Through the Portable C Compiler
-.AU
-S. C. Johnson
-.AI
-.MH
-.SH
-Introduction
-.PP
-A C compiler has been implemented that has proved to be quite portable,
-serving as the basis for C compilers on roughly a dozen machines, including
-the Honeywell 6000, IBM 370, and Interdata 8/32.
-The compiler is highly compatible with the C language standard.
-.[
-Kernighan Ritchie Prentice 1978
-.]
-.PP
-Among the goals of this compiler are portability, high reliability,
-and the use of state-of-the-art techniques and tools wherever practical.
-Although the efficiency of the compiling process is not
-a primary goal, the compiler is efficient enough, and produces
-good enough code, to serve as a production compiler.
-.PP
-The language implemented is highly compatible with the current PDP-11 version of C.
-Moreover, roughly 75% of the compiler, including
-nearly all the syntactic and semantic routines, is machine independent.
-The compiler also serves as the major portion of the program
-.I lint ,
-described elsewhere.
-.[
-Johnson Lint Program Checker
-.]
-.PP
-A number of earlier attempts to make portable compilers are worth noting.
-While on CO-OP assignment to Bell Labs in 1973, Alan Snyder wrote a portable C
-compiler which was the basis of his Master's Thesis at M.I.T.
-.[
-Snyder Portable C Compiler
-.]
-This compiler was very slow and complicated, and contained a number of rather
-serious implementation difficulties;
-nevertheless, a number of Snyder's ideas appear in this work.
-.PP
-Most earlier portable compilers, including Snyder's, have proceeded by
-defining an intermediate language, perhaps based
-on three-address code or code for a stack machine,
-and writing a machine independent program to
-translate from the source code to this
-intermediate code.
-The intermediate code is then read by a second pass, and interpreted or compiled.
-This approach is elegant, and has a number of advantages, especially if the
-target machine is far removed from the host.
-It suffers from some disadvantages as well.
-Some constructions, like initialization and subroutine prologs,
-are difficult or expensive to express in a
-machine independent way that still allows them
-to be easily adapted to the target assemblers.
-Most of these approaches require a symbol table to be constructed
-in the second (machine dependent) pass, and/or
-require powerful target assemblers.
-Also, many conversion operators may be generated
-that have no effect on a given machine,
-but may be needed on others (for example, pointer to pointer
-conversions usually do nothing in C, but must be generated because
-there are some machines where they are significant).
-.PP
-For these reasons, the first pass of the portable compiler
-is not entirely machine independent.
-It contains some machine dependent features, such as initialization, subroutine
-prolog and epilog, certain storage allocation functions,
-code for the
-.I switch
-statement, and code to throw out unneeded conversion operators.
-.PP
-As a crude measure of the degree of
-portability actually achieved,
-the Interdata 8/32 C compiler has
-roughly 600 machine dependent lines of source out of 4600 in Pass 1, and 1000
-out of 3400 in Pass 2.
-In total, 1600 out of 8000, or 20%,
-of the total source is machine dependent
-(12% in Pass 1, 30% in Pass 2).
-These percentages can be expected to rise slightly as the
-compiler is tuned.
-The percentage of machine-dependent code for the IBM is 22%, for
-the Honeywell 25%.
-If the assembler format and structure were the same for all
-these machines, perhaps another 5-10% of the code
-would become machine independent.
-.PP
-These figures are sufficiently misleading as to be almost
-meaningless.
-A large fraction of the machine dependent code can be converted
-in a straightforward, almost mechanical way.
-On the other hand, a certain amount of the code requres hard
-intellectual effort to convert, since the algorithms
-embodied in this part of the code are typically complicated
-and machine dependent.
-.PP
-To summarize, however, if you need a C compiler written for a machine with
-a reasonable architecture, the compiler is already three quarters finished!
-.SH
-Overview
-.PP
-This paper discusses the structure and organization of the portable compiler.
-The intent is to give the big picture, rather than discussing the details of a particular machine
-implementation.
-After a brief overview and a discussion of the source file structure,
-the paper describes the major data structures, and then delves more
-closely into the two passes.
-Some of the theoretical work on which the compiler is based, and
-its application to the compiler, is discussed elsewhere.
-.[
-johnson portable theory practice
-.]
-One of the major design issues in any C compiler, the design of
-the calling sequence and stack frame, is the subject of a separate
-memorandum.
-.[
-johnson lesk ritchie calling sequence
-.]
-.PP
-The compiler consists of two passes,
-.I pass1
-and
-.I pass2 ,
-that together turn C source code into assembler code for the target
-machine.
-The two passes are preceded by a preprocessor, that
-handles the
-.B "#define"
-and
-.B "#include"
-statements, and related features (e.g.,
-.B #ifdef ,
-etc.).
-It is a nearly machine independent program, and will
-not be further discussed here.
-.PP
-The output of the preprocessor is a text file that is read as the standard
-input of the first pass.
-This
-produces as standard output another text file that becomes the standard
-input of the second pass.
-The second pass produces, as standard output, the desired assembler language source code.
-The preprocessor and the two passes
-all write error messages on the standard error file.
-Thus the compiler itself makes few demands on the I/O
-library support, aiding in the bootstrapping process.
-.PP
-Although the compiler is divided into two passes,
-this represents historical accident more than deep necessity.
-In fact, the compiler can optionally be loaded
-so that both passes operate in the same program.
-This ``one pass'' operation eliminates the overhead of
-reading and writing the intermediate file, so the compiler
-operates about 30% faster in this mode.
-It also occupies about 30% more space than the larger
-of the two component passes.
-.PP
-Because the compiler is fundamentally structured as two
-passes, even when loaded as one, this document primarily
-describes the two pass version.
-.PP
-The first pass does the lexical analysis, parsing, and
-symbol table maintenance.
-It also constructs parse trees for expressions,
-and keeps track of the types of the nodes in these trees.
-Additional code is devoted to initialization.
-Machine dependent portions of the first pass serve to
-generate subroutine prologs and epilogs,
-code for switches, and code for branches, label definitions,
-alignment operations,
-changes of location counter, etc.
-.PP
-The intermediate file is a text file organized into lines.
-Lines beginning with a right parenthesis are copied by the second
-pass directly to its output file, with the
-parenthesis stripped off.
-Thus, when the first pass produces assembly code, such as subroutine prologs,
-etc., each line is prefaced with a right parenthesis;
-the second pass passes these lines to through to the assembler.
-.PP
-The major job done by the second pass is generation of code
-for expressions.
-The expression parse trees produced in the first pass are
-written onto the
-intermediate file in Polish Prefix form:
-first, there is a line beginning with a period, followed by the source
-file line number and name on which the expression appeared (for debugging purposes).
-The successive lines represent the nodes of the parse tree,
-one node per line.
-Each line contains the node number, type, and
-any values (e.g., values of constants)
-that may appear in the node.
-Lines representing nodes with descendants are immediately
-followed by the left subtree of descendants, then the
-right.
-Since the number of descendants of any node is completely
-determined by the node number, there is no need to mark the end
-of the tree.
-.PP
-There are only two other line types in the intermediate file.
-Lines beginning with a left square bracket (`[') represent the beginning of
-blocks (delimited by { ... } in the C source);
-lines beginning with right square brackets (`]') represent the end of blocks.
-The remainder of these lines tell how much
-stack space, and how many register variables,
-are currently in use.
-.PP
-Thus, the second pass reads the intermediate files, copies the `)' lines,
-makes note of the information in the `[' and `]' lines,
-and devotes most of its effort to the
-`.' lines and their associated expression trees, turning them
-turns into assembly code to evaluate the expressions.
-.PP
-In the one pass version of the compiler, the expression
-trees that are built by the first pass have
-been declared to have room for the second pass
-information as well.
-Instead of writing the trees onto an intermediate file,
-each tree is transformed in place into an acceptable
-form for the code generator.
-The code generator then writes the result of compiling
-this tree onto the standard output.
-Instead of `[' and `]' lines in the intermediate file, the information is passed
-directly to the second pass routines.
-Assembly code produced by the first pass is simply written out,
-without the need for ')' at the head of each line.
-.SH
-The Source Files
-.PP
-The compiler source consists of 22 source files.
-Two files,
-.I manifest
-and
-.I macdefs ,
-are header files included with all other files.
-.I Manifest
-has declarations for the node numbers, types, storage classes,
-and other global data definitions.
-.I Macdefs
-has machine-dependent definitions, such as the size and alignment of the
-various data representations.
-Two machine independent header files,
-.I mfile1
-and
-.I mfile2 ,
-contain the data structure and manifest definitions
-for the first and second passes, respectively.
-In the second pass, a machine dependent header file,
-.I mac2defs ,
-contains declarations of register names, etc.
-.PP
-There is a file,
-.I common ,
-containing (machine independent) routines used in both passes.
-These include routines for allocating and freeing trees, walking over trees,
-printing debugging information, and printing error messages.
-There are two dummy files,
-.I comm1.c
-and
-.I comm2.c ,
-that simply include
-.I common
-within the scope of the appropriate pass1 or pass2 header files.
-When the compiler is loaded as a single pass,
-.I common
-only needs to be included once:
-.I comm2.c
-is not needed.
-.PP
-Entire sections of this document are devoted to the detailed structure of the
-passes.
-For the moment, we just give a brief description of the files.
-The first pass
-is obtained by compiling and loading
-.I scan.c ,
-.I cgram.c ,
-.I xdefs.c ,
-.I pftn.c ,
-.I trees.c ,
-.I optim.c ,
-.I local.c ,
-.I code.c ,
-and
-.I comm1.c .
-.I Scan.c
-is the lexical analyzer, which is used by
-.I cgram.c ,
-the result of applying
-.I Yacc
-.[
-Johnson Yacc Compiler cstr
-.]
-to the input grammar
-.I cgram.y .
-.I Xdefs.c
-is a short file of external definitions.
-.I Pftn.c
-maintains the symbol table, and does initialization.
-.I Trees.c
-builds the expression trees, and computes the node types.
-.I Optim.c
-does some machine independent optimizations on the expression trees.
-.I Comm1.c
-includes
-.I common ,
-that contains service routines common to the two passes of the compiler.
-All the above files are machine independent.
-The files
-.I local.c
-and
-.I code.c
-contain machine dependent code for generating subroutine
-prologs, switch code, and the like.
-.PP
-The second pass
-is produced by compiling and loading
-.I reader.c ,
-.I allo.c ,
-.I match.c ,
-.I comm1.c ,
-.I order.c ,
-.I local.c ,
-and
-.I table.c .
-.I Reader.c
-reads the intermediate file, and controls the major logic of the
-code generation.
-.I Allo.c
-keeps track of busy and free registers.
-.I Match.c
-controls the matching
-of code templates to subtrees of the expression tree to be compiled.
-.I Comm2.c
-includes the file
-.I common ,
-as in the first pass.
-The above files are machine independent.
-.I Order.c
-controls the machine dependent details of the code generation strategy.
-.I Local2.c
-has many small machine dependent routines,
-and tables of opcodes, register types, etc.
-.I Table.c
-has the code template tables,
-which are also clearly machine dependent.
-.SH
-Data Structure Considerations.
-.PP
-This section discusses the node numbers, type words, and expression trees, used
-throughout both passes of the compiler.
-.PP
-The file
-.I manifest
-defines those symbols used throughout both passes.
-The intent is to use the same symbol name (e.g., MINUS)
-for the given operator throughout the lexical analysis, parsing, tree building,
-and code generation phases;
-this requires some synchronization with the
-.I Yacc
-input file,
-.I cgram.y ,
-as well.
-.PP
-A token
-like MINUS may be seen in the lexical analyzer before it is known
-whether it is a unary or binary operator;
-clearly, it is necessary to know this by the time the parse tree
-is constructed.
-Thus, an operator (really a macro) called
-UNARY is provided, so that MINUS
-and UNARY MINUS are both distinct node numbers.
-Similarly, many binary operators exist in an assignment form (for example, \-=),
-and the operator ASG may be applied to such node names to generate new ones, e.g. ASG MINUS.
-.PP
-It is frequently desirable to know if a node represents a leaf (no descendants), a unary operator (one
-descendant) or a binary operator (two descendants).
-The macro
-.I optype(o)
-returns one of the manifest constants LTYPE, UTYPE, or BITYPE, respectively, depending
-on the node number
-.I o .
-Similarly,
-.I asgop(o)
-returns true if
-.I o
-is an assignment operator number (=, +=, etc. ), and
-.I logop(o)
-returns true if
-.I o
-is a relational or logical (&&, \(or\(or, or !) operator.
-.PP
-C has a rich typing structure, with a potentially infinite number of types.
-To begin with, there are the basic types: CHAR, SHORT, INT, LONG, the unsigned versions
-known as
-UCHAR, USHORT, UNSIGNED, ULONG, and FLOAT, DOUBLE,
-and finally
-STRTY (a structure), UNIONTY, and ENUMTY.
-Then, there are three operators that can be applied to types to make others:
-if
-.I t
-is a type, we may potentially have types
-.I "pointer to t" ,
-.I "function returning t" ,
-and
-.I "array of t's"
-generated from
-.I t .
-Thus, an arbitrary type in C consists of a basic type, and zero or more of these operators.
-.PP
-In the compiler, a type is represented by an unsigned integer; the rightmost four bits hold the basic
-type, and the remaining bits are divided into two-bit fields, containing
-0 (no operator), or one of the three operators
-described above.
-The modifiers are read right to left in the word, starting with the two-bit
-field adjacent to the basic type, until a field with 0 in it is reached.
-The macros PTR, FTN, and ARY represent the
-.I "pointer to" ,
-.I "function returning" ,
-and
-.I "array of"
-operators.
-The macro values are shifted so that they align with the first two-bit
-field; thus PTR+INT
-represents the type for an integer pointer, and
-.DS
-ARY + (PTR<<2) + (FTN<<4) + DOUBLE
-.DE
-represents the type of an array of pointers to functions returning doubles.
-.PP
-The type words are ordinarily manipulated by macros.
-If
-.I t
-is a type word,
-.I BTYPE(t)
-gives the basic type.
-.I ISPTR(t) ,
-.I ISARY(t) ,
-and
-.I ISFTN(t)
-ask if an object of this type is a pointer, array, or a function,
-respectively.
-.I MODTYPE(t,b)
-sets the basic type of
-.I t
-to
-.I b .
-.I DECREF(t)
-gives the type resulting from removing the first operator from
-.I t .
-Thus, if
-.I t
-is a pointer to
-.I t' ,
-a function returning
-.I t' ,
-or an array of
-.I t' ,
-then
-.I DECREF(t)
-would equal
-.I t' .
-.I INCREF(t)
-gives the type representing a pointer to
-.I t .
-Finally, there are operators for dealing with the unsigned types.
-.I ISUNSIGNED(t)
-returns true if
-.I t
-is one of the four basic unsigned types;
-in this case,
-.I DEUNSIGN(t)
-gives the associated `signed' type.
-Similarly,
-.I UNSIGNABLE(t)
-returns true if
-.I t
-is one of the four basic types that could become unsigned, and
-.I ENUNSIGN(t)
-returns the unsigned analogue of
-.I t
-in this case.
-.PP
-The other important global data structure is that of expression trees.
-The actual shapes of the nodes are given in
-.I mfile1
-and
-.I mfile2 .
-They are not the same in the two passes; the first pass nodes contain
-dimension and size information, while the second pass
-nodes contain register allocation information.
-Nevertheless, all nodes contain fields called
-.I op ,
-containing the node number,
-and
-.I type ,
-containing the type word.
-A function called
-.I talloc()
-returns a pointer to a new tree node.
-To free a node, its
-.I op
-field need merely be set to FREE.
-The other fields in the node will remain intact at least until the next allocation.
-.PP
-Nodes representing binary operators contain fields,
-.I left
-and
-.I right ,
-that contain pointers to the left and right descendants.
-Unary operator nodes have the
-.I left
-field, and a value field called
-.I rval .
-Leaf nodes, with no descendants, have two value fields:
-.I lval
-and
-.I rval .
-.PP
-At appropriate times, the function
-.I tcheck()
-can be called, to check that there are no busy nodes remaining.
-This is used as a compiler consistency check.
-The function
-.I tcopy(p)
-takes a pointer
-.I p
-that points to an expression tree, and returns a pointer
-to a disjoint copy of the tree.
-The function
-.I walkf(p,f)
-performs a postorder walk of the tree pointed to by
-.I p ,
-and applies the function
-.I f
-to each node.
-The function
-.I fwalk(p,f,d)
-does a preorder walk of the tree pointed to by
-.I p .
-At each node, it calls a function
-.I f ,
-passing to it the node pointer, a value passed down
-from its ancestor, and two pointers to values to be passed
-down to the left and right descendants (if any).
-The value
-.I d
-is the value passed down to the root.
-.a
-.I Fwalk
-is used for a number of tree labeling and debugging activities.
-.PP
-The other major data structure, the symbol table, exists only in pass one,
-and will be discussed later.
-.SH
-Pass One
-.PP
-The first pass does lexical analysis, parsing, symbol table maintenance,
-tree building, optimization, and a number of machine dependent things.
-This pass is largely machine independent, and the machine independent
-sections can be pretty successfully ignored.
-Thus, they will be only sketched here.
-.SH
-Lexical Analysis
-.PP
-The lexical analyzer is a conceptually simple routine that reads the input
-and returns the tokens of the C language as it encounters them:
-names, constants, operators, and keywords.
-The conceptual simplicity of this job is confounded a bit by several
-other simple jobs that unfortunately must go on simultaneously.
-These include
-.IP \(bu
-Keeping track of the current filename and line number, and occasionally
-setting this information as the result of preprocessor control lines.
-.IP \(bu
-Skipping comments.
-.IP \(bu
-Properly dealing with octal, decimal, hex, floating
-point, and character constants, as well as character strings.
-.PP
-To achieve speed, the program maintains several tables
-that are indexed into by character value, to tell
-the lexical analyzer what to do next.
-To achieve portability, these tables must be initialized
-each time the compiler is run, in order that the
-table entries reflect the local character set values.
-.SH
-Parsing
-.PP
-As mentioned above, the parser is generated by Yacc from the grammar on file
-.I cgram.y.
-The grammar is relatively readable, but contains some unusual features
-that are worth comment.
-.PP
-Perhaps the strangest feature of the grammar is the treatment of
-declarations.
-The problem is to keep track of the basic type
-and the storage class while interpreting the various
-stars, brackets, and parentheses that may surround a given name.
-The entire declaration mechanism must be recursive,
-since declarations may appear within declarations of
-structures and unions, or even within a
-.B sizeof
-construction
-inside a dimension in another declaration!
-.PP
-There are some difficulties in using a bottom-up parser,
-such as produced by Yacc, to handle constructions where a lot
-of left context information must be kept around.
-The problem is that the original PDP-11 compiler is top-down in
-implementation, and some of the semantics of C reflect this.
-In a top-down parser, the input rules are restricted
-somewhat, but one can naturally associate temporary
-storage with a rule at a very early stage in the recognition
-of that rule.
-In a bottom-up parser, there is more freedom in the
-specification of rules, but it is more difficult to know what
-rule is being matched until the entire rule is seen.
-The parser described by
-.I cgram.c
-makes effective use of
-the bottom-up parsing mechanism in some places (notably the treatment
-of expressions), but struggles against the
-restrictions in others.
-The usual result is that it is necessary to run a stack of values
-``on the side'', independent of the Yacc value stack,
-in order to be able to store and access information
-deep within inner constructions, where the relationship of the
-rules being recognized to the total picture is not yet clear.
-.PP
-In the case of declarations, the attribute information
-(type, etc.) for a declaration is carefully
-kept immediately to the left of the declarator
-(that part of the declaration involving the name).
-In this way, when it is time to declare the name, the
-name and the type information can be quickly brought together.
-The ``$0'' mechanism of Yacc is used to accomplish this.
-The result is not pretty, but it works.
-The storage class information changes more slowly,
-so it is kept in an external variable, and stacked if
-necessary.
-Some of the grammar could be considerably cleaned up by using
-some more recent features of Yacc, notably actions within
-rules and the ability to return multiple values for actions.
-.PP
-A stack is also used to keep track of the current location
-to be branched to when a
-.B break
-or
-.B continue
-statement is processed.
-.PP
-This use of external stacks dates from the time when Yacc did not permit
-values to be structures.
-Some, or most, of this use of external stacks
-could be eliminated by redoing the grammar to use the mechanisms now provided.
-There are some areas, however, particularly the processing of structure, union,
-and enum declarations, function
-prologs, and switch statement processing, when having
-all the affected data together in an array speeds later
-processing; in this case, use of external storage seems essential.
-.PP
-The
-.I cgram.y
-file also contains some small functions used as
-utility functions in the parser.
-These include routines for saving case values and labels in processing switches,
-and stacking and popping 
-values on the external stack described above.
-.SH
-Storage Classes
-.PP
-C has a finite, but fairly extensive, number of storage classes
-available.
-One of the compiler design decisions was to
-process the storage class information totally in the first pass;
-by the second pass, this information must have
-been totally dealt with.
-This means that all of the storage allocation must take place in the first
-pass, so that references to automatics and
-parameters can be turned into references to cells lying a certain
-number of bytes offset from certain machine registers.
-Much of this transformation is machine dependent, and strongly
-depends on the storage class.
-.PP
-The classes include EXTERN (for externally declared, but not defined variables),
-EXTDEF (for external definitions), and similar distinctions for
-USTATIC and STATIC, UFORTRAN and FORTRAN (for fortran functions) and
-ULABEL and LABEL.
-The storage classes REGISTER and AUTO are obvious, as
-are STNAME, UNAME, and ENAME (for structure, union, and enumeration
-tags), and the associated MOS, MOU, and MOE (for the members).
-TYPEDEF is treated as a storage class as well.
-There are two special storage classes: PARAM and SNULL.
-SNULL is used to distinguish the case where no explicit
-storage class has been given; before an entry is made
-in the symbol table the true storage class is discovered.
-Similarly, PARAM is used for the temporary entry in the symbol
-table made before the declaration of function parameters is completed.
-.PP
-The most complexity in the storage class process comes from
-bit fields.
-A separate storage class is kept for each width bit field;
-a
-.I k
-bit bit field has storage class
-.I k
-plus FIELD.
-This enables the size to be quickly recovered from the storage class.
-.SH
-Symbol Table Maintenance.
-.PP
-The symbol table routines do far more than simply enter
-names into the symbol table;
-considerable semantic processing and checking is done as well.
-For example, if a new declaration comes in, it must be checked
-to see if there is a previous declaration of the same symbol.
-If there is, there are many cases.
-The declarations may agree and be compatible (for example,
-an extern declaration can appear twice) in which case the
-new declaration is ignored.
-The new declaration may add information (such as an explicit array
-dimension) to an already present declaration.
-The new declaration may be different, but still correct (for example,
-an extern declaration of something may be entered,
-and then later the definition may be seen).
-The new declaration may be incompatible, but appear in an inner block;
-in this case, the old declaration is carefully hidden away, and
-the new one comes into force until the block is left.
-Finally, the declarations may be incompatible, and an error
-message must be produced.
-.PP
-A number of other factors make for additional complexity.
-The type declared by the user is not always the type
-entered into the symbol table (for example, if an formal parameter to a function
-is declared to be an array, C requires that this be changed into
-a pointer before entry in the symbol table).
-Moreover, there are various kinds of illegal types that
-may be declared which are difficult to
-check for syntactically (for example,
-a function returning an array).
-Finally, there is a strange feature in C that requires
-structure tag names and member names for structures and unions
-to be taken from a different logical symbol table than ordinary identifiers.
-Keeping track of which kind of name is involved is a bit of struggle
-(consider typedef names used within structure declarations, for example).
-.PP
-The symbol table handling routines have been rewritten a number of times to
-extend features, improve performance, and fix bugs.
-They address the above problems with reasonable effectiveness
-but a singular lack of grace.
-.PP
-When a name is read in the input, it is hashed, and the
-routine
-.I lookup
-is called, together with a flag which tells which symbol table
-should be searched (actually, both symbol tables are stored in one, and a flag
-is used to distinguish individual entries).
-If the name is found,
-.I lookup
-returns the index to the entry found; otherwise, it makes
-a new entry, marks it UNDEF (undefined), and returns the
-index of the new entry.
-This index is stored in the
-.I rval
-field of a NAME node.
-.PP
-When a declaration is being parsed, this NAME node is
-made part of a tree with UNARY MUL nodes for each *,
-LB nodes for each array descriptor (the right descendant
-has the dimension), and UNARY CALL nodes for each function
-descriptor.
-This tree is passed to the routine
-.I tymerge ,
-along with the attribute type of the whole declaration;
-this routine collapses the tree to a single node, by calling
-.I tyreduce ,
-and then modifies the type to reflect the overall
-type of the declaration.
-.PP
-Dimension and size information is stored in a table called
-.I dimtab .
-To properly describe a type in C, one needs not just the
-type information but also size information (for structures and
-enums) and dimension information (for arrays).
-Sizes and offsets are dealt with in the compiler by
-giving the associated indices into
-.I dimtab .
-.I Tymerge
-and
-.I tyreduce
-call
-.I dstash
-to put the discovered dimensions away into the
-.I dimtab
-array.
-.I Tymerge
-returns a pointer to a single node that contains
-the symbol table index in its
-.I rval
-field, and the size and dimension indices in
-fields
-.I csiz
-and
-.I cdim ,
-respectively.
-This information is properly considered part of the type in the first pass,
-and is carried around at all times.
-.PP
-To enter an element into the symbol table, the routine
-.I defid
-is called; it is handed a storage class, and a pointer
-to the node produced by
-.I tymerge .
-.I Defid
-calls
-.I fixtype ,
-which adjusts and checks the given type depending on the storage
-class, and converts null types appropriately.
-It then calls
-.I fixclass ,
-which does a similar job for the storage class;
-it is here, for example, that
-register declarations are either allowed or changed
-to auto.
-.PP
-The new declaration is now compared against an older one,
-if present, and several pages of validity checks performed.
-If the definitions are compatible, with possibly some added information,
-the processing is straightforward.
-If the definitions differ, the block levels of the
-current and the old declaration are compared.
-The current block level is kept in
-.I blevel ,
-an external variable; the old declaration level is kept in the symbol table.
-Block level 0 is for external declarations, 1 is for arguments to functions,
-and 2 and above are blocks within a function.
-If the current block level is the same as the old declaration, an error
-results.
-If the current block level is higher, the new declaration overrides the old.
-This is done by marking the old symbol table entry ``hidden'', and making
-a new entry, marked ``hiding''.
-.I Lookup
-will skip over hidden entries.
-When a block is left, the symbol table is searched,
-and any entries defined in that block are destroyed; if
-they hid other entries, the old entries are ``unhidden''.
-.PP
-This nice block structure is warped a bit because labels
-do not follow the block structure rules (one can do a
-.B goto
-into
-a block, for example);
-default definitions of functions in inner blocks also persist clear out to the outermost scope.
-This implies that cleaning up the symbol table after block exit is more
-subtle than it might first seem.
-.PP
-For successful new definitions,
-.I defid
-also initializes a ``general purpose'' field,
-.I offset ,
-in the symbol table.
-It contains the stack offset for automatics and parameters, the register number
-for register variables, the bit offset into the structure for
-structure members, and
-the internal label number for static variables and labels.
-The offset field is set by
-.I falloc
-for bit fields, and
-.I dclstruct
-for structures and unions.
-.PP
-The symbol table entry itself thus contains
-the name, type word, size and dimension offsets,
-offset value, and declaration block level.
-It also has a field of flags, describing what symbol table the
-name is in, and whether the entry is hidden, or hides another.
-Finally, a field gives the line number of the last use,
-or of the definition, of the name.
-This is used mainly for diagnostics, but is useful to
-.I lint
-as well.
-.PP
-In some special cases, there is more than the above amount of information kept
-for the use of the compiler.
-This is especially true with structures; for use in initialization,
-structure declarations must have access to a list of the members of the
-structure.
-This list is also kept in
-.I dimtab .
-Because a structure can be mentioned long before the
-members are known, it is necessary to have another
-level of indirection in the table.
-The two words following the
-.I csiz
-entry in
-.I dimtab
-are used to hold the alignment of the structure, and
-the index in dimtab of the list of members.
-This list contains the symbol table indices for the structure members, terminated by a
-\-1.
-.SH
-Tree Building
-.PP
-The portable compiler transforms expressions
-into expression trees.
-As the parser recognizes each rule making up an
-expression,
-it calls
-.I buildtree
-which is given an operator number, and pointers to the
-left and right descendants.
-.I Buildtree
-first examines the left and right descendants,
-and, if they are both constants, and the operator
-is appropriate, simply does the constant
-computation at compile time, and returns
-the result as a constant.
-Otherwise,
-.I buildtree
-allocates a node for the head of the tree,
-attaches the descendants to it, and ensures that
-conversion operators are generated if needed, and that
-the type of the new node is consistent with the types
-of the operands.
-There is also a considerable amount of semantic complexity here;
-many combinations of types are illegal, and the portable
-compiler makes a strong effort to check
-the legality of expression types completely.
-This is done both for
-.I lint
-purposes, and to prevent such semantic errors
-from being passed through to the code generator.
-.PP
-The heart of
-.I buildtree
-is a large table, accessed by the routine
-.I opact .
-This routine maps the types of the left and right
-operands into a rather smaller set of descriptors, and then
-accesses a table (actually encoded in a switch statement) which
-for each operator and pair of types causes
-an action to be returned.
-The actions are logical or's of a number of
-separate actions, which may be
-carried out by
-.I buildtree .
-These component actions may include
-checking the left side to ensure that it
-is an lvalue (can be stored into),
-applying a type conversion to the left or right operand,
-setting the type of the new node to
-the type of the left or right operand, calling various
-routines to balance the types of the left and right operands,
-and suppressing the ordinary conversion
-of arrays and function operands to pointers.
-An important operation is OTHER, which causes
-some special code to be invoked
-in
-.I buildtree ,
-to handle issues which are unique to a particular operator.
-Examples of this are
-structure and union reference
-(actually handled by
-the routine
-.I stref ),
-the building of NAME, ICON, STRING and FCON (floating point constant) nodes,
-unary * and &, structure assignment, and calls.
-In the case of unary * and &,
-.I buildtree
-will cancel a * applied to a tree, the top node of which
-is &, and conversely.
-.PP
-Another special operation is
-PUN; this
-causes the compiler to check for type mismatches,
-such as intermixing pointers and integers.
-.PP
-The treatment of conversion operators is still a rather
-strange area of the compiler (and of C!).
-The recent introduction of type casts has only confounded this
-situation.
-Most of the conversion operators are generated by
-calls to
-.I tymatch
-and
-.I ptmatch ,
-both of which are given a tree, and asked to make the
-operands agree in type.
-.I Ptmatch
-treats the case where one of the operands is a pointer;
-.I tymatch
-treats all other cases.
-Where these routines have decided on the
-proper type for an operand, they call
-.I makety ,
-which is handed a tree, and a type word, dimension offset, and size offset.
-If necessary, it inserts a conversion operation to make the
-types correct.
-Conversion operations are never inserted on the left side of
-assignment operators, however.
-There are two conversion operators used;
-PCONV, if the conversion is to a non-basic type (usually a pointer),
-and
-SCONV, if the conversion is to a basic type (scalar).
-.PP
-To allow for maximum flexibility, every node produced by
-.I buildtree
-is given to a machine dependent routine,
-.I clocal ,
-immediately after it is produced.
-This is to allow more or less immediate rewriting of those
-nodes which must be adapted for the local machine.
-The conversion operations are given to
-.I clocal
-as well; on most machines, many of these
-conversions do nothing, and should be thrown away
-(being careful to retain the type).
-If this operation is done too early,
-however,
-later calls to
-.I buildtree
-may get confused about correct type of the
-subtrees;
-thus
-.I clocal
-is given the conversion ops only after the entire tree is built.
-This topic will be dealt with in more detail later.
-.SH
-Initialization
-.PP
-Initialization is one of the messier areas in the portable compiler.
-The only consolation is that most of the mess takes place
-in the machine independent part, where it
-is may be safely ignored by the implementor of the
-compiler for a particular machine.
-.PP
-The basic problem is that the semantics of initialization
-really calls for a co-routine structure; one collection
-of programs reading constants from the input stream, while another,
-independent set of programs places these constants into the
-appropriate spots in memory.
-The dramatic differences in the local assemblers also
-come to the fore here.
-The parsing problems are dealt with by keeping a rather
-extensive stack containing the current
-state of the initialization; the assembler
-problems are dealt with by having a fair number of machine dependent routines.
-.PP
-The stack contains the symbol table number,
-type, dimension index, and size index for the current identifier
-being initialized.
-Another entry has the offset, in bits, of the beginning
-of the current identifier.
-Another entry keeps track of how many elements have been seen,
-if the current identifier is an array.
-Still another entry keeps track of the current
-member of a structure being initialized.
-Finally, there is an entry containing flags
-which keep track of the current state of the initialization process
-(e.g., tell if a } has been seen for the current identifier.)
-.PP
-When an initialization begins, the routine
-.I beginit
-is called; it handles the alignment restrictions, if
-any, and calls
-.I instk
-to create the stack entry.
-This is done by first making an entry on the top of the stack for the item
-being initialized.
-If the top entry is an array, another entry is made on the stack
-for the first element.
-If the top entry is a structure, another entry is made on the
-stack for the first member of the structure.
-This continues until the top element of the stack is a scalar.
-.I Instk
-then returns, and the parser begins collecting initializers.
-.PP
-When a constant is obtained, the routine
-.I doinit
-is called; it examines the stack, and does whatever
-is necessary to assign the current constant to the
-scalar on the top of the stack.
-.I gotscal
-is then called, which rearranges the stack so that the
-next scalar to be initialized gets placed on top of the stack.
-This process continues until the end of the initializers;
-.I endinit
-cleans up.
-If a { or } is encountered in the
-string of initializers, it is handled by calling
-.I ilbrace
-or
-.I irbrace ,
-respectively.
-.PP
-A central issue is the treatment of the ``holes'' that
-arise as a result of alignment restrictions or explicit
-requests for holes in bit fields.
-There is a global variable,
-.I inoff ,
-which contains the current offset in the initialization
-(all offsets in the first pass of the compiler are in bits).
-.I Doinit
-figures out from the top entry on the stack the expected
-bit offset of the next identifier; it calls the
-machine dependent
-routine
-.I inforce
-which, in a machine dependent way, forces
-the assembler to
-set aside space if need be so that the
-next scalar seen will go into the appropriate
-bit offset position.
-The scalar itself is passed to one of the machine dependent
-routines
-.I fincode 
-(for floating point initialization),
-.I incode
-(for fields, and other initializations less than an int in
-size),
-and
-.I cinit
-(for all other initializations).
-The size is passed to all these routines, and it is up to
-the machine dependent routines to ensure that the
-initializer occupies exactly the right size.
-.PP
-Character strings represent a bit of an exception.
-If a character string is seen as the initializer for
-a pointer, the characters making up the string must
-be put out under a different location counter.
-When the lexical analyzer sees the quote at the head
-of a character string, it returns the token STRING,
-but does not do anything with the contents.
-The parser calls
-.I getstr ,
-which sets up the appropriate location counters
-and flags, and calls
-.I lxstr
-to read and process the contents of the string.
-.PP
-If the string is being used to initialize a character array,
-.I lxstr
-calls
-.I putbyte ,
-which in effect simulates
-.I doinit
-for each character read.
-If the string is used to initialize a character pointer,
-.I lxstr
-calls a machine dependent routine,
-.I bycode ,
-which stashes away each character.
-The pointer to this string is then returned,
-and processed normally by
-.I doinit .
-.PP
-The null at the end of the string is treated as if it
-were read explicitly by
-.I lxstr .
-.SH
-Statements
-.PP
-The first pass addresses four main areas; declarations, expressions, initialization, and statements.
-The statement processing is relatively simple; most of it is carried out in the
-parser directly.
-Most of the logic is concerned with allocating
-label numbers, defining the labels, and branching appropriately.
-An external symbol,
-.I reached ,
-is 1 if a statement can be reached, 0 otherwise; this is
-used to do a bit of simple flow analysis as the program is being parsed,
-and also to avoid generating the subroutine return sequence if the subroutine
-cannot ``fall through'' the last statement.
-.PP
-Conditional branches are handled by generating an expression
-node, CBRANCH,
-whose left descendant is the conditional expression and the
-right descendant is an ICON node containing the internal label
-number to be branched to.
-For efficiency, the semantics are that
-the label is gone to if the condition is
-.I false .
-.PP
-The switch statement is 
-compiled by collecting the case entries, and an indication as to whether
-there is a default case;
-an internal label number is generated for each of these,
-and remembered in a big array.
-The expression comprising the value to be switched on is
-compiled when the switch keyword is encountered,
-but the expression tree is headed by
-a special node, FORCE, which tells the code generator to
-put the expression value into a special distinguished
-register (this same mechanism is used for processing the
-return statement).
-When the end of the switch block is reached, the array
-containing the case values is sorted, and checked for
-duplicate entries (an error); if all is
-correct, the machine dependent routine
-.I genswitch
-is called, with this array of labels and values in increasing order.
-.I Genswitch
-can assume that the value to be tested is already in the
-register which is the usual integer return value register.
-.SH
-Optimization
-.PP
-There is a machine independent file,
-.I optim.c ,
-which contains a relatively short optimization routine,
-.I optim .
-Actually the word optimization is something of a misnomer;
-the results are not optimum, only improved, and the
-routine is in fact not optional; it must
-be called for proper operation of the compiler.
-.PP
-.I Optim
-is called after an expression tree is built, but
-before the code generator is called.
-The essential part of its job is to call
-.I clocal
-on the conversion operators.
-On most machines, the treatment of
-& is also essential:
-by this time in the processing, the only node which
-is a legal descendant of & is NAME.
-(Possible descendants of * have been eliminated by
-.I buildtree.)
-The address of a static name is, almost by definition, a
-constant, and can be represented by an ICON node on most machines
-(provided that the loader has enough power).
-Unfortunately, this is not universally true; on some machine, such as the IBM 370,
-the issue of addressability rears its ugly head;
-thus, before turning a NAME node into an ICON node,
-the machine dependent function
-.I andable
-is called.
-.PP
-The optimization attempts of
-.I optim
-are currently quite limited.
-It is primarily concerned with improving the behavior of
-the compiler with operations one of whose arguments is a constant.
-In the simplest case, the constant is placed on the right if the
-operation is commutative.
-The compiler also makes a limited search for expressions
-such as
-.DS
-.I "( x + a ) + b"
-.DE
-where
-.I a
-and
-.I b
-are constants, and attempts to combine
-.I a
-and
-.I b
-at compile time.
-A number of special cases are also examined;
-additions of 0 and multiplications by 1 are removed,
-although the correct processing of these cases to get
-the type of the resulting tree correct is
-decidedly nontrivial.
-In some cases, the addition or multiplication must be replaced by
-a conversion op to keep the types from becoming
-fouled up.
-Finally, in cases where a relational operation is being done,
-and one operand is a constant, the operands are permuted, and the operator altered, if necessary,
-to put the constant on the right.
-Finally, multiplications by a power of 2 are changed to shifts.
-.PP
-There are dozens of similar optimizations that can be, and should be,
-done.
-It seems likely that this routine will be expanded in the relatively near future.
-.SH
-Machine Dependent Stuff
-.PP
-A number of the first pass machine dependent routines have been discussed above.
-In general, the routines are short, and easy to adapt from
-machine to machine.
-The two exceptions to this general rule are
-.I clocal
-and
-the function prolog and epilog generation routines,
-.I bfcode
-and
-.I efcode .
-.PP
-.I Clocal
-has the job of rewriting, if appropriate and desirable,
-the nodes constructed by
-.I buildtree .
-There are two major areas where this
-is important;
-NAME nodes and conversion operations.
-In the case of NAME nodes,
-.I clocal
-must rewrite the NAME node to reflect the
-actual physical location of the name in the machine.
-In effect, the NAME node must be examined, the symbol table
-entry found (through the
-.I rval
-field of the node),
-and, based on the storage class of the node,
-the tree must be rewritten.
-Automatic variables and parameters are typically
-rewritten by treating the reference to the variable as
-a structure reference, off the register which
-holds the stack or argument pointer;
-the
-.I stref
-routine is set up to be called in this way, and to
-build the appropriate tree.
-In the most general case, the tree consists
-of a unary * node, whose descendant is
-a + node, with the stack or argument register as left operand,
-and a constant offset as right operand.
-In the case of LABEL and internal static nodes, the
-.I rval
-field is rewritten to be the negative of the internal
-label number; a negative
-.I rval 
-field is taken to be an internal label number.
-Finally, a name of class REGISTER must be converted into a REG node,
-and the
-.I rval
-field replaced by the register number.
-In fact, this part of the
-.I clocal
-routine is nearly machine independent; only for machines
-with addressability problems (IBM 370 again!) does it
-have to be noticeably different,
-.a
-.PP
-The conversion operator treatment is rather tricky.
-It is necessary to handle the application of conversion operators
-to constants in
-.I clocal ,
-in order that all constant expressions can have their values known
-at compile time.
-In extreme cases, this may mean that some simulation of the
-arithmetic of the target machine might have to be done in a
-cross-compiler.
-In the most common case,
-conversions from pointer to pointer do nothing.
-For some machines, however, conversion from byte pointer to short or long
-pointer might require a shift or rotate operation, which would
-have to be generated here.
-.PP
-The extension of the portable compiler to machines where the size of a pointer
-depends on its type would be straightforward, but has not yet been done.
-.PP
-The other major machine dependent issue involves the subroutine prolog and epilog
-generation.
-The hard part here is the design of the stack frame
-and calling sequence; this design issue is discussed elsewhere.
-.[
-Johnson Lesk Ritchie calling sequence
-.]
-The routine
-.I bfcode
-is called with the number of arguments
-the function is defined with, and
-an array containing the symbol table indices of the
-declared parameters.
-.I Bfcode
-must generate the code to establish the new stack frame,
-save the return address and previous stack pointer
-value on the stack, and save whatever
-registers are to be used for register variables.
-The stack size and the number of register variables is not
-known when
-.I bfcode
-is called, so these numbers must be
-referred to by assembler constants, which are
-defined when they are known (usually in the second pass,
-after all register variables, automatics, and temporaries have been seen).
-The final job is to find those parameters which may have been declared
-register, and generate the code to initialize
-the register with the value passed on the stack.
-Once again, for most machines, the general logic of
-.I bfcode
-remains the same, but the contents of the
-.I printf
-calls in it will change from machine to machine.
-.I efcode
-is rather simpler, having just to generate the default
-return at the end of a function.
-This may be nontrivial in the case of a function returning a structure or union, however.
-.PP
-There seems to be no really good place to discuss structures and unions, but
-this is as good a place as any.
-The C language now supports structure assignment,
-and the passing of structures as arguments to functions,
-and the receiving of structures back from functions.
-This was added rather late to C, and thus to the portable compiler.
-Consequently, it fits in less well than the older features.
-Moreover, most of the burden of making these features work is
-placed on the machine dependent code.
-.PP
-There are both conceptual and practical problems.
-Conceptually, the compiler is structured around
-the idea that to compute something, you put it into
-a register and work on it.
-This notion causes a bit of trouble on some machines (e.g., machines with 3-address opcodes), but
-matches many machines quite well.
-Unfortunately, this notion breaks down with structures.
-The closest that one can come is to keep the addresses of the
-structures in registers.
-The actual code sequences used to move structures vary from the
-trivial (a multiple byte move) to the horrible (a
-function call), and are very machine dependent.
-.PP
-The practical problem is more painful.
-When a function returning a structure is called, this function
-has to have some place to put the structure value.
-If it places it on the stack, it has difficulty popping its stack frame.
-If it places the value in a static temporary, the routine fails to be
-reentrant.
-The most logically consistent way of implementing this is for the
-caller to pass in a pointer to a spot where the called function
-should put the value before returning.
-This is relatively straightforward, although a bit tedious, to implement,
-but means that the caller must have properly declared
-the function type, even if the value is never used.
-On some machines, such as the Interdata 8/32, the return value
-simply overlays the argument region (which on the 8/32 is part
-of the caller's stack frame).
-The caller takes care of leaving enough room if the returned value is larger
-than the arguments.
-This also assumes that the caller know and declares the
-function properly.
-.PP
-The PDP-11 and the VAX have stack hardware which is used in function calls and returns;
-this makes it very inconvenient to
-use either of the above mechanisms.
-In these machines, a static area within the called functionis allocated, and
-the function return value is copied into it on return; the function
-returns the address of that region.
-This is simple to implement, but is non-reentrant.
-However, the function can now be called as a subroutine
-without being properly declared, without the disaster which would otherwise ensue.
-No matter what choice is taken, the convention is that the function
-actually returns the address of the return structure value.
-.PP
-In building expression trees, the portable compiler takes a bit for granted about
-structures.
-It assumes that functions returning structures
-actually return a pointer to the structure, and it assumes that
-a reference to a structure is actually a reference to its address.
-The structure assignment operator is rebuilt so that the left
-operand is the structure being assigned to, but the
-right operand is the address of the structure being assigned;
-this makes it easier to deal with
-.DS
-.I "a = b = c"
-.DE
-and similar constructions.
-.PP
-There are four special tree nodes associated with these
-operations:
-STASG (structure assignment), STARG (structure argument
-to a function call), and STCALL and UNARY STCALL
-(calls of a function with nonzero and zero arguments, respectively).
-These four nodes are unique in that the size and alignment information, which can be determined by
-the type for all other objects in C, 
-must be known to carry out these operations; special
-fields are set aside in these nodes to contain
-this information, and special
-intermediate code is used to transmit this information.
-.SH
-First Pass Summary
-.PP
-There are may other issues which have been ignored here,
-partly to justify the title ``tour'', and partially
-because they have seemed to cause little trouble.
-There are some debugging flags
-which may be turned on, by giving the compiler's first pass
-the argument
-.DS
-\-X[flags]
-.DE
-Some of the more interesting flags are
-\-Xd for the defining and freeing of symbols,
-\-Xi for initialization comments, and
-\-Xb for various comments about the building of trees.
-In many cases, repeating the flag more than once gives more information;
-thus,
-\-Xddd gives more information than \-Xd.
-In the two pass version of the compiler, the
-flags should not be set when the output is sent to the second
-pass, since the debugging output and the intermediate code both go onto the standard
-output.
-.PP
-We turn now to consideration of the second pass.
diff --git a/.ref-Research-V7/usr/doc/porttour/porttour2 b/.ref-Research-V7/usr/doc/porttour/porttour2
deleted file mode 100644 (file)
index 1c3fd25..0000000
+++ /dev/null
@@ -1,1255 +0,0 @@
-.SH
-Pass Two
-.PP
-Code generation is far less well understood than
-parsing or lexical analysis, and for this reason
-the second pass is far harder to discuss in a file by file manner.
-A great deal of the difficulty is in understanding the issues
-and the strategies employed to meet them.
-Any particular function is likely to be reasonably straightforward.
-.PP
-Thus, this part of the paper will concentrate a good deal on the broader
-aspects of strategy in the code generator,
-and will not get too intimate with the details.
-.SH
-Overview.
-.PP
-It is difficult to organize a code generator to be flexible enough to
-generate code for a large number of machines,
-and still be efficient for any one of them.
-Flexibility is also important when it comes time to tune
-the code generator to improve the output code quality.
-On the other hand, too much flexibility can lead to semantically
-incorrect code, and potentially a combinatorial explosion in the
-number of cases to be considered in the compiler.
-.PP
-One goal of the code generator is to have a high degree of correctness.
-It is very desirable to have the compiler detect its own inability to
-generate correct code, rather than to produce incorrect code.
-This goal is achieved by having a simple model of the job
-to be done (e.g., an expression tree)
-and a simple model of the machine state
-(e.g., which registers are free).
-The act of generating an instruction performs a transformation
-on the tree and the machine state;
-hopefully, the tree eventually gets
-reduced to a single node.
-If each of these instruction/transformation pairs is correct,
-and if the machine state model really represents the actual machine,
-and if the transformations reduce the input tree to the desired single node, then the
-output code will be correct.
-.PP
-For most real machines, there is no definitive theory of code generation that
-encompasses all the C operators.
-Thus the selection of which instruction/transformations to generate, and in what
-order, will have a heuristic flavor.
-If, for some expression tree, no transformation applies, or, more
-seriously, if the heuristics select a sequence of instruction/transformations
-that do not in fact reduce the tree, the compiler
-will report its inability to generate code, and abort.
-.PP
-A major part of the code generator is concerned with the model and the transformations,
-\(em most of this is machine independent, or depends only on simple tables.
-The flexibility comes from the heuristics that guide the transformations
-of the trees, the selection of subgoals, and the ordering of the computation.
-.SH
-The Machine Model
-.PP
-The machine is assumed to have a number of registers, of at most two different
-types:
-.I A
-and
-.I B .
-Within each register class, there may be scratch (temporary) registers and dedicated registers
-(e.g., register variables, the stack pointer, etc.).
-Requests to allocate and free registers involve only the temporary registers.
-.PP
-Each of the registers in the machine is given a name and a number
-in the
-.I mac2defs
-file; the numbers are used as indices into various tables
-that describe the registers, so they should be kept small.
-One such table is the
-.I rstatus
-table on file
-.I local2.c .
-This table is indexed by register number, and
-contains expressions made up from manifest constants describing the register types:
-SAREG for dedicated AREG's, SAREG\(orSTAREG for scratch AREGS's,
-and SBREG and SBREG\(orSTBREG similarly for BREG's.
-There are macros that access this information:
-.I isbreg(r)
-returns true if register number
-.I r
-is a BREG, and
-.I istreg(r)
-returns true if register number
-.I r
-is a temporary AREG or BREG.
-Another table,
-.I rnames ,
-contains the register names; this is used when
-putting out assembler code and diagnostics.
-.PP
-The usage of registers is kept track of by an array called
-.I busy .
-.I Busy[r]
-is the number of uses of register
-.I r
-in the current tree being processed.
-The allocation and freeing of registers will be discussed later as part of the code generation
-algorithm.
-.SH
-General Organization
-.PP
-As mentioned above, the second pass reads lines from
-the intermediate file, copying through to the output unchanged
-any lines that begin with a `)', and making note of the
-information about stack usage and register allocation contained on
-lines beginning with `]' and `['.
-The expression trees, whose beginning is indicated by a line beginning with `.',
-are read and rebuilt into trees.
-If the compiler is loaded as one pass, the expression trees are
-immediately available to the code generator.
-.PP
-The actual code generation is done by a hierarchy of routines.
-The routine
-.I delay
-is first given the tree; it attempts to delay some postfix
-++ and \-\- computations that might reasonably be done after the
-smoke clears.
-It also attempts to handle comma (,) operators by computing the
-left side expression first, and then rewriting the tree
-to eliminate the operator.
-.I Delay
-calls
-.I codgen
-to control the actual code generation process.
-.I Codgen
-takes as arguments a pointer to the expression tree,
-and a second argument that, for socio-historical reasons, is called a
-.I cookie .
-The cookie describes a set of goals that would be acceptable
-for the code generation: these are assigned to individual bits,
-so they may be logically or'ed together to form a large number of possible goals.
-Among the possible goals are FOREFF (compute for side effects only;
-don't worry about the value), INTEMP (compute and store value into a temporary location
-in memory), INAREG (compute into an A register), INTAREG (compute into a scratch
-A register), INBREG and INTBREG similarly, FORCC (compute for condition codes),
-and FORARG (compute it as a function argument; e.g., stack it if appropriate).
-.PP
-.I Codgen
-first canonicalizes the tree by calling
-.I canon .
-This routine looks for certain transformations that might now be
-applicable to the tree.
-One, which is very common and very powerful, is to
-fold together an indirection operator (UNARY MUL)
-and a register (REG); in most machines, this combination is
-addressable directly, and so is similar to a NAME in its
-behavior.
-The UNARY MUL and REG are folded together to make
-another node type called OREG.
-In fact, in many machines it is possible to directly address not just the
-cell pointed to by a register, but also cells differing by a constant
-offset from the cell pointed to by the register.
-.I Canon
-also looks for such cases, calling the
-machine dependent routine 
-.I notoff
-to decide if the offset is acceptable (for example, in the IBM 370 the offset
-must be between 0 and 4095 bytes).
-Another optimization is to replace bit field operations
-by shifts and masks if the operation involves extracting the field.
-Finally, a machine dependent routine,
-.I sucomp ,
-is called that computes the Sethi-Ullman numbers
-for the tree (see below).
-.PP
-After the tree is canonicalized,
-.I codgen
-calls the routine
-.I store
-whose job is to select a subtree of the tree to be computed
-and (usually) stored before beginning the
-computation of the full tree.
-.I Store
-must return a tree that can be computed without need
-for any temporary storage locations.
-In effect, the only store operations generated while processing the subtree must be as a response
-to explicit assignment operators in the tree.
-This division of the job marks one of the more significant, and successful,
-departures from most other compilers.
-It means that the code generator can operate
-under the assumption that there are enough
-registers to do its job, without worrying about
-temporary storage.
-If a store into a temporary appears in the output, it is always
-as a direct result of logic in the
-.I store
-routine; this makes debugging easier.
-.PP
-One consequence of this organization is that
-code is not generated by a treewalk.
-There are theoretical results that support this decision.
-.[
-Aho Johnson Optimal Code Trees jacm
-.]
-It may be desirable to compute several subtrees and store
-them before tackling the whole tree;
-if a subtree is to be stored, this is known before the code
-generation for the subtree is begun, and the subtree is computed
-when all scratch registers are available.
-.PP
-The
-.I store
-routine decides what subtrees, if any, should be
-stored by making use of numbers,
-called
-.I "Sethi-Ullman numbers" ,
-that give, for each subtree of an expression tree,
-the minimum number of scratch registers required to
-compile the subtree, without any stores into temporaries.
-.[
-Sethi Ullman jacm 1970
-.]
-These numbers are computed by the machine-dependent
-routine
-.I sucomp ,
-called by
-.I canon .
-The basic notion is that, knowing the Sethi-Ullman numbers for
-the descendants of a node, and knowing the operator of the
-node and some information about the machine, the
-Sethi-Ullman number of the node itself can be computed.
-If the Sethi-Ullman number for a tree exceeds the number of scratch
-registers available, some subtree must be stored.
-Unfortunately, the theory behind the Sethi-Ullman numbers
-applies only to uselessly simple machines and operators.
-For the rich set of C operators, and for machines with
-asymmetric registers, register pairs, different kinds of registers,
-and exceptional forms of addressing,
-the theory cannot be applied directly.
-The basic idea of estimation is a good one, however,
-and well worth applying; the application, especially
-when the compiler comes to be tuned for high code
-quality, goes beyond the park of theory into the
-swamp of heuristics.
-This topic will be taken up again later, when more of the compiler
-structure has been described.
-.PP
-After examining the Sethi-Ullman numbers,
-.I store
-selects a subtree, if any, to be stored, and returns the subtree and the associated cookie in
-the external variables
-.I stotree
-and
-.I stocook .
-If a subtree has been selected, or if
-the whole tree is ready to be processed, the
-routine
-.I order
-is called, with a tree and cookie.
-.I Order
-generates code for trees that
-do not require temporary locations.
-.I Order
-may make recursive calls on itself, and,
-in some cases, on
-.I codgen ;
-for example, when processing the operators &&, \(or\(or, and comma (`,'), that have
-a left to right evaluation, it is
-incorrect for
-.I store
-examine the right operand for subtrees to be stored.
-In these cases,
-.I order
-will call
-.I codgen
-recursively when it is permissible to work on the right operand.
-A similar issue arises with the ? : operator.
-.PP
-The
-.I order
-routine works by matching the current tree with
-a set of code templates.
-If a template is discovered that will
-match the current tree and cookie, the associated assembly language
-statement or statements are generated.
-The tree is then rewritten,
-as specified by the template, to represent the effect of the output instruction(s).
-If no template match is found, first an attempt is made to find a match with a
-different cookie; for example, in order to compute
-an expression with cookie INTEMP (store into a temporary storage location),
-it is usually necessary to compute the expression into a scratch register
-first.
-If all attempts to match the tree fail, the heuristic part of
-the algorithm becomes dominant.
-Control is typically given to one of a number of machine-dependent routines
-that may in turn recursively call
-.I order
-to achieve a subgoal of the computation (for example, one of the
-arguments may be computed into a temporary register).
-After this subgoal has been achieved, the process begins again with the
-modified tree.
-If the machine-dependent heuristics are unable to reduce the tree further,
-a number of default rewriting rules may be considered appropriate.
-For example, if the left operand of a + is a scratch
-register, the + can be replaced by a += operator;
-the tree may then match a template.
-.PP
-To close this introduction, we will discuss the steps in compiling
-code for the expression
-.DS
-\fIa\fR += \fIb\fR
-.DE
-where
-.I a
-and
-.I b
-are static variables.
-.PP
-To begin with, the whole expression tree is examined with cookie FOREFF, and
-no match is found.  Search with other cookies is equally fruitless, so an
-attempt at rewriting is made.
-Suppose we are dealing with the Interdata 8/32 for the moment.
-It is recognized that the left hand and right hand sides of the += operator
-are addressable, and in particular the left hand side has no
-side effects, so it is permissible to rewrite this as
-.DS
-\fIa\fR = \fIa\fR + \fIb\fR
-.DE
-and this is done.
-No match is found on this tree either, so a machine dependent rewrite is done; it is recognized
-that the left hand side of the assignment is addressable, but the right hand side is not
-in a register, so
-.I order
-is called recursively, being asked to put the right
-hand side of the assignment into a register.
-This invocation of
-.I order
-searches the tree for a match, and fails.
-The machine dependent rule for +
-notices that the right hand operand is addressable;
-it decides to put the left operand into a scratch register.
-Another recursive call to
-.I order
-is made, with the tree
-consisting solely of the leaf
-.I a ,
-and the cookie asking that the value be placed into a scratch register.
-This now matches a template, and a load instruction is emitted.
-The node consisting of
-.I a
-is rewritten in place to represent the register into which
-.I a
-is loaded,
-and this third call to
-.I order
-returns.
-The second call to
-.I order
-now finds that it has the tree
-.DS
-\fBreg\fR + \fIb\fR
-.DE
-to consider.
-Once again, there is no match, but the default rewriting rule rewrites
-the + as a += operator, since the left operand is a scratch register.
-When this is done, there is a match: in fact,
-.DS
-\fBreg\fR += \fIb\fR
-.DE
-simply describes the effect of the add instruction
-on a typical machine.
-After the add is emitted, the tree is rewritten
-to consist merely of the register node, since the result of the add
-is now in the register.
-This agrees with the cookie passed to the second invocation of
-.I order ,
-so this invocation
-terminates, returning to the first level.
-The original tree has now
-become
-.DS
-\fIa\fR = \fBreg\fR
-.DE
-which matches a template for the store instruction.
-The store is output, and the tree rewritten to become
-just a single register node.
-At this point, since the top level call to
-.I order
-was
-interested only in side effects, the call to
-.I order
-returns, and the code generation is completed;
-we have generated a load, add, and store, as might have been expected.
-.PP
-The effect of machine architecture on this is considerable.
-For example, on the Honeywell 6000, the machine dependent heuristics recognize that there is an ``add to storage''
-instruction, so the strategy is quite different;
-.I b
-is loaded in to
-a register, and then an add to storage instruction generated
-to add this register in to
-.I a .
-The transformations, involving as they do the semantics of C,
-are largely machine independent.
-The decisions as to when to use them, however, are
-almost totally machine dependent.
-.PP
-Having given a broad outline of
-the code generation process, we shall next consider the
-heart of it: the templates.
-This leads naturally into discussions of template matching and register allocation,
-and finally a discussion of the machine dependent interfaces and strategies.
-.SH
-The Templates
-.PP
-The templates describe the effect of the target machine instructions
-on the model of computation around which the compiler is organized.
-In effect, each template has five logical sections, and represents an assertion
-of the form:
-.IP
-.B If
-we have a subtree of a given shape (1), and we have a goal (cookie) or goals to
-achieve (2), and we have sufficient free resources (3),
-.B then
-we may emit an instruction or instructions (4), and
-rewrite the subtree in a particular manner (5),
-and the rewritten tree will achieve the desired goals.
-.PP
-These five sections will be discussed in more
-detail later.  First, we give an example of a
-template:
-.DS
-.ta 1i 2i 3i 4i 5i
-ASG PLUS,      INAREG,
-       SAREG,  TINT,
-       SNAME,  TINT,
-               0,      RLEFT,
-               "       add     AL,AR\en",
-.DE
-The top line specifies the operator (+=) and the cookie (compute the
-value of the subtree into an AREG).
-The second and third lines specify the left and right descendants,
-respectively,
-of the += operator.
-The left descendant must be a REG node, representing an
-A register, and have integer type, while the right side must be a NAME node,
-and also have integer type.
-The fourth line contains the resource requirements (no scratch registers
-or temporaries needed), and the rewriting rule (replace the subtree by the left descendant).
-Finally, the quoted string on the last line represents the output to the assembler:
-lower case letters, tabs, spaces, etc. are copied
-.I verbatim .
-to the output; upper case letters trigger various macro-like expansions.
-Thus,
-.B AL
-would expand into the \fBA\fRddress form of the \fBL\fReft operand \(em
-presumably the register number.
-Similarly,
-.B AR
-would expand into the name of the right operand.
-The
-.I add
-instruction of the last section might well be
-emitted by this template.
-.PP
-In principle, it would be possible to make separate templates
-for all legal combinations of operators, cookies, types, and shapes.
-In practice, the number of combinations is very large.
-Thus, a considerable amount of mechanism is present to
-permit a large number of subtrees to be matched
-by a single template.
-Most of the shape and type specifiers are individual bits, and can
-be logically
-or'ed
-together.
-There are a number of special descriptors for matching classes of
-operators.
-The cookies can also be combined.
-As an example of the kind of template
-that really arises in practice, the
-actual template for the Interdata 8/32
-that subsumes the above example is:
-.DS
-.ta 1i 2i 3i 4i 5i
-ASG OPSIMP,    INAREG\(orFORCC,
-       SAREG,  TINT\(orTUNSIGNED\(orTPOINT,
-       SAREG\(orSNAME\(orSOREG\(orSCON,        TINT\(orTUNSIGNED\(orTPOINT,
-               0,      RLEFT\(orRESCC,
-               "       OI      AL,AR\en",
-.DE
-Here, OPSIMP represents the operators
-+, \-, \(or, &, and ^.
-The
-.B OI
-macro in the output string expands into the
-appropriate \fBI\fRnteger \fBO\fRpcode for the operator.
-The left and right sides can be integers, unsigned, or pointer types.
-The right side can be, in addition to a name, a register,
-a memory location whose address is given by a register and displacement (OREG),
-or a constant.
-Finally, these instructions set the condition codes,
-and so can be used in condition contexts:
-the cookie and rewriting rules reflect this.
-.SH
-The Template Matching Algorithm.
-.PP
-The heart of the second pass is the template matching
-algorithm, in the routine
-.I match .
-.I Match
-is called with a tree and a cookie; it attempts to match
-the given tree against some template that will transform it
-according to one of the goals given in the cookie.
-If a match is successful, the transformation is
-applied;
-.I expand
-is called to generate the assembly code, and then
-.I reclaim
-rewrites the tree, and reclaims the resources, such
-as registers, that might have become free as a result
-of the generated code.
-.PP
-This part of the compiler is among the most time critical.
-There is a spectrum of implementation techniques available
-for doing this matching.
-The most naive algorithm simply looks at the templates one by one.
-This can be considerably improved upon by restricting the search
-for an acceptable template.
-It would be possible to do better than this if the templates were given
-to a separate program that ate them and generated a template
-matching subroutine.
-This would make maintenance of the compiler much more
-complicated, however, so this has not been done.
-.PP
-The matching algorithm is actually carried out by restricting
-the range in the table that must be searched for each opcode.
-This introduces a number of complications, however, and needs a
-bit of sympathetic help by the person constructing the
-compiler in order to obtain best results.
-The exact tuning of this algorithm continues; it
-is best to consult the code and comments in
-.I match
-for the latest version.
-.PP
-In order to match a template to a tree,
-it is necessary to match not only the cookie and the
-op of the root, but also the types and shapes of the
-left and right descendants (if any) of the tree.
-A convention is established here that is carried out throughout
-the second pass of the compiler.
-If a node represents a unary operator, the single descendant
-is always the ``left'' descendant.
-If a node represents a unary operator or a leaf node (no descendants)
-the ``right'' descendant is taken by convention to be the node itself.
-This enables templates to easily match leaves and conversion operators, for example,
-without any additional mechanism in the matching program.
-.PP
-The type matching is straightforward; it is possible to specify any combination
-of basic types, general pointers, and pointers to one or more of
-the basic types.
-The shape matching is somewhat more complicated, but still pretty simple.
-Templates have a collection of possible operand shapes
-on which the opcode might match.
-In the simplest case, an
-.I add
-operation might be able to add to either a register variable
-or a scratch register, and might be able (with appropriate
-help from the assembler) to add an integer constant (ICON), a static
-memory cell (NAME), or a stack location (OREG).
-.PP
-It is usually attractive to specify a number of such shapes,
-and distinguish between them when the assembler output is produced.
-It is possible to describe the union of many elementary
-shapes such as ICON, NAME, OREG,
-AREG or BREG
-(both scratch and register forms), etc.
-To handle at least the simple forms of indirection, one can also
-match some more complicated forms of trees; STARNM and STARREG
-can match more complicated trees headed by an indirection operator,
-and SFLD can match certain trees headed by a FLD operator: these
-patterns call machine dependent routines that match the
-patterns of interest on a given machine.
-The shape SWADD may be used to recognize NAME or OREG
-nodes that lie on word boundaries: this may be of some importance
-on word\-addressed machines.
-Finally, there are some special shapes: these may not
-be used in conjunction with the other shapes, but may be
-defined and extended in machine dependent ways.
-The special shapes SZERO, SONE, and SMONE are predefined and match
-constants 0, 1, and \-1, respectively; others are easy to add
-and match by using the machine dependent routine
-.I special .
-.PP
-When a template has been found that matches the root of the tree,
-the cookie, and the shapes and types of the descendants,
-there is still one bar to a total match: the template may
-call for some resources (for example, a scratch register).
-The routine
-.I allo
-is called, and it attempts to allocate the resources.
-If it cannot, the match fails; no resources are
-allocated.
-If successful, the allocated resources are given numbers
-1, 2, etc. for later reference when the assembly code is
-generated.
-The routines
-.I expand
-and
-.I reclaim
-are then called.
-The
-.I match
-routine then returns a special value, MDONE.
-If no match was found, the value MNOPE is returned;
-this is a signal to the caller to try more cookie
-values, or attempt a rewriting rule.
-.I Match
-is also used to select rewriting rules, although
-the way of doing this is pretty straightforward.
-A special cookie, FORREW, is used to ask
-.I match
-to search for a rewriting rule.
-The rewriting rules are keyed to various opcodes; most
-are carried out in
-.I order .
-Since the question of when to rewrite is one of the key issues in
-code generation, it will be taken up again later.
-.SH
-Register Allocation.
-.PP
-The register allocation routines, and the allocation strategy,
-play a central role in the correctness of the code generation algorithm.
-If there are bugs in the Sethi-Ullman computation that cause the
-number of needed registers to be underestimated,
-the compiler may run out of scratch registers;
-it is essential that the allocator keep track of those registers that
-are free and busy, in order to detect such conditions.
-.PP
-Allocation of registers takes place as the result of a template
-match; the routine
-.I allo
-is called with a word describing the number of A registers,
-B registers, and temporary locations needed.
-The allocation of temporary locations on the stack is relatively
-straightforward, and will not be further covered; the
-bookkeeping is a bit tricky, but conceptually trivial, and requests
-for temporary space on the stack will never fail.
-.PP
-Register allocation is less straightforward.
-The two major complications are
-.I pairing
-and
-.I sharing .
-In many machines, some operations (such as multiplication
-and division), and/or some types (such as longs or double precision)
-require even/odd pairs of registers.
-Operations of the first type are exceptionally difficult to
-deal with in the compiler; in fact, their theoretical
-properties are rather bad as well.
-.[
-Aho Johnson Ullman Multiregister
-.]
-The second issue is dealt with rather more successfully;
-a machine dependent function called
-.I szty(t)
-is called that returns 1 or 2, depending on the
-number of A registers required to hold an object of type
-.I t .
-If
-.I szty
-returns 2, an even/odd pair of A registers is allocated
-for each request.
-.PP
-The other issue, sharing, is more subtle, but
-important for good code quality.
-When registers are allocated, it
-is possible to reuse registers that hold address
-information, and use them to contain the values
-computed or accessed.
-For example, on the IBM 360, if register 2 has
-a pointer to an integer in it, we may load the
-integer into register 2 itself by saying:
-.DS
-L      2,0(2)
-.DE
-If register 2 had a byte pointer, however, the sequence for
-loading a character involves clearing the target
-register first, and then inserting the desired character:
-.DS
-SR     3,3
-IC     3,0(2)
-.DE
-In the first case, if register 3 were used as the target,
-it would lead to a larger number of registers
-used for the expression than were required; the compiler would
-generate inefficient code.
-On the other hand, if register 2 were used as the target in the second
-case, the code would simply be wrong.
-In the first case, register 2 can be 
-.I shared
-while in the second, it cannot.
-.PP
-In the specification of the register needs in the templates,
-it is possible to indicate whether required scratch registers
-may be shared with possible registers on the left or the right of the input tree.
-In order that a register be shared, it must be scratch, and it must
-be used only once, on the appropriate side of the tree being compiled.
-.PP
-The
-.I allo
-routine thus has a bit more to do than meets the eye;
-it calls
-.I freereg
-to obtain a free register for each A and B register request.
-.I Freereg
-makes multiple calls on the routine
-.I usable
-to decide if a given register can be used to satisfy
-a given need.
-.I Usable
-calls
-.I shareit
-if the register is busy, but might be shared.
-Finally,
-.I shareit
-calls
-.I ushare
-to decide if the desired register is actually in the appropriate
-subtree, and can be shared.
-.PP
-Just to add additional complexity, on some machines (such as the IBM 370) it
-is possible to have ``double indexing'' forms of
-addressing; these are represented by OREGS's
-with the base and index registers encoded into the register field.
-While the register allocation and deallocation
-.I "per se"
-is not made more difficult by this phenomenon, the code itself
-is somewhat more complex.
-.PP
-Having allocated the registers and expanded the assembly language,
-it is time to reclaim the resources; the routine
-.I reclaim
-does this.
-Many operations produce more than one result.
-For example, many arithmetic operations may produce
-a value in a register, and also set the condition
-codes.
-Assignment operations may leave results both in a register and in memory.
-.I Reclaim
-is passed three parameters; the tree and cookie
-that were matched, and the rewriting field of the template.
-The rewriting field allows the specification of possible results;
-the tree is rewritten to reflect the results of the operation.
-If the tree was computed for side effects only (FOREFF),
-the tree is freed, and all resources in it reclaimed.
-If the tree was computed for condition codes, the resources
-are also freed, and the tree replaced by a special
-node type, FORCC.
-Otherwise, the value may be found in the left
-argument of the root, the right argument of the root,
-or one of the temporary resources allocated.
-In these cases, first the resources of the tree,
-and the newly allocated resources,
-are
-freed; then the resources needed by the result
-are made busy again.
-The final result must always match the shape of the input cookie;
-otherwise, the compiler error
-``cannot reclaim''
-is generated.
-There are some machine dependent ways of
-preferring results in registers or memory when
-there are multiple results matching multiple goals in the cookie.
-.SH
-The Machine Dependent Interface
-.PP
-The files
-.I order.c ,
-.I local2.c ,
-and
-.I table.c ,
-as well as the header file
-.I mac2defs ,
-represent the machine dependent portion of the second pass.
-The machine dependent portion can be roughly divided into
-two: the easy portion and the hard portion.
-The easy portion
-tells the compiler the names of the registers, and arranges that
-the compiler generate the proper assembler formats, opcode names, location counters, etc.
-The hard portion involves the Sethi\-Ullman computation, the
-rewriting rules, and, to some extent, the templates.
-It is hard because there are no real algorithms that apply;
-most of this portion is based on heuristics.
-This section discusses the easy portion; the next several
-sections will discuss the hard portion.
-.PP
-If the compiler is adapted from a compiler for a machine
-of similar architecture, the easy part is indeed easy.
-In
-.I mac2defs ,
-the register numbers are defined, as well as various parameters for
-the stack frame, and various macros that describe the machine architecture.
-If double indexing is to be permitted, for example, the symbol
-R2REGS is defined.
-Also, a number of macros that are involved in function call processing,
-especially for unusual function call mechanisms, are defined here.
-.PP
-In
-.I local2.c ,
-a large number of simple functions are defined.
-These do things such as write out opcodes, register names,
-and address forms for the assembler.
-Part of the function call code is defined here; that is nontrivial
-to design, but typically rather straightforward to implement.
-Among the easy routines in
-.I order.c
-are routines for generating a created label,
-defining a label, and generating the arguments
-of a function call.
-.PP
-These routines tend to have a local effect, and depend on a fairly straightforward way
-on the target assembler and the design decisions already made about
-the compiler.
-Thus they will not be further treated here.
-.SH
-The Rewriting Rules
-.PP
-When a tree fails to match any template, it becomes
-a candidate for rewriting.
-Before the tree is rewritten,
-the machine dependent routine
-.I nextcook
-is called with the tree and the cookie; it suggests
-another cookie that might be a better candidate for the
-matching of the tree.
-If all else fails, the templates are searched with the cookie
-FORREW, to look for a rewriting rule.
-The rewriting rules are of two kinds;
-for most of the common operators, there are
-machine dependent rewriting rules that may be applied;
-these are handled by machine dependent functions
-that are called and given the tree to be computed.
-These routines may recursively call
-.I order
-or
-.I codgen
-to cause certain subgoals to be achieved;
-if they actually call for some alteration of the tree,
-they return 1, and the
-code generation algorithm recanonicalizes and tries again.
-If these routines choose not to deal with the tree, the
-default rewriting rules are applied.
-.PP
-The assignment ops, when rewritten, call the routine
-.I setasg .
-This is assumed to rewrite the tree at least to the point where there are
-no side effects in the left hand side.
-If there is still no template match,
-a default rewriting is done that causes
-an expression such as
-.DS
-.I "a += b"
-.DE
-to be rewritten as
-.DS
-.I "a = a + b"
-.DE
-This is a useful default for certain mixtures of strange types
-(for example, when
-.I a
-is a bit field and
-.I b
-an character) that
-otherwise might need separate table entries.
-.PP
-Simple assignment, structure assignment, and all forms of calls
-are handled completely by the machine dependent routines.
-For historical reasons, the routines generating the calls return
-1 on failure, 0 on success, unlike the other routines.
-.PP
-The machine dependent routine
-.I setbin
-handles binary operators; it too must do most of the job.
-In particular, when it returns 0, it must do so with
-the left hand side in a temporary register.
-The default rewriting rule in this case is to convert the
-binary operator into the associated assignment operator;
-since the left hand side is assumed to be a temporary register,
-this preserves the semantics and often allows a considerable
-saving in the template table.
-.PP
-The increment and decrement operators may be dealt with with
-the machine dependent routine
-.I setincr .
-If this routine chooses not to deal with the tree, the rewriting rule replaces
-.DS
-.I "x ++"
-.DE
-by
-.DS
-.I "( (x += 1) \- 1)"
-.DE
-which preserves the semantics.
-Once again, this is not too attractive for the most common
-cases, but can generate close to optimal code when the
-type of x is unusual.
-.PP
-Finally, the indirection (UNARY MUL) operator is also handled
-in a special way.
-The machine dependent routine
-.I offstar
-is extremely important for the efficient generation of code.
-.I Offstar
-is called with a tree that is the direct descendant of a UNARY MUL node;
-its job is to transform this tree so that the combination of
-UNARY MUL with the transformed tree becomes addressable.
-On most machines,
-.I offstar
-can simply compute the tree into an A or B register,
-depending on the architecture, and then
-.I canon
-will make the resulting tree into an OREG.
-On many machines,
-.I offstar
-can profitably choose to do less work than computing
-its entire argument into a register.
-For example, if the target machine supports OREGS
-with a constant offset from a register, and
-.I offstar
-is called
-with a tree of the form
-.DS
-.I "expr + const"
-.DE
-where
-.I const
-is a constant, then
-.I offstar
-need only compute
-.I expr
-into the appropriate form of register.
-On machines that support double indexing,
-.I offstar
-may have even more choice as to how to proceed.
-The proper tuning of
-.I offstar ,
-which is not typically too difficult, should be one of the
-first tries at optimization attempted by the
-compiler writer.
-.SH
-The Sethi-Ullman Computation
-.PP
-The heart of the heuristics is the computation of the Sethi-Ullman numbers.
-This computation is closely linked with the rewriting rules and the
-templates.
-As mentioned before, the Sethi-Ullman numbers are expected to
-estimate the number of scratch registers needed to compute
-the subtrees without using any stores.
-However, the original theory does not apply to real machines.
-For one thing, the theory assumes that all registers
-are interchangeable.
-Real machines have general purpose, floating point, and index registers,
-register pairs, etc.
-The theory also does not account for side effects;
-this rules out various forms of pathology that arise
-from assignment and assignment ops.
-Condition codes are also undreamed of.
-Finally, the influence of types, conversions, and the
-various addressability restrictions and extensions of real
-machines are also ignored.
-.PP
-Nevertheless, for a ``useless'' theory,
-the basic insight of Sethi and Ullman is amazingly
-useful in a real compiler.
-The notion that one should attempt to estimate the
-resource needs of trees before starting the
-code generation provides a natural means of splitting the
-code generation problem, and provides a bit of redundancy
-and self checking in the compiler.
-Moreover, if writing the
-Sethi-Ullman routines is hard, describing, writing, and debugging the
-alternative (routines that attempt to free up registers by stores into
-temporaries ``on the fly'') is even worse.
-Nevertheless, it should be clearly understood that these routines exist in a realm
-where there is no ``right'' way to write them;
-it is an art, the realm of heuristics, and, consequently, a major
-source of bugs in the compiler.
-Often, the early, crude versions of these routines give little trouble;
-only after
-the compiler is actually working
-and the
-code quality is being improved do serious problem have to be faced.
-Having a simple, regular machine architecture is worth quite
-a lot at this time.
-.PP
-The major problems arise from asymmetries in the registers: register pairs,
-having different kinds of registers, and the related problem of
-needing more than one register (frequently a pair) to store certain
-data
-types (such as longs or doubles).
-There appears to be no general way of treating this problem;
-solutions have to be fudged for each machine where the problem arises.
-On the Honeywell 66, for example, there are only two general purpose registers,
-so a need for a pair is the same as the need for two registers.
-On the IBM 370, the register pair (0,1) is used to do multiplications and divisions;
-registers 0 and 1 are not generally considered part of the scratch registers, and so
-do not require allocation explicitly.
-On the Interdata 8/32, after much consideration, the
-decision was made not to try to deal with the register pair issue;
-operations such as multiplication and division that required pairs
-were simply assumed to take all of the scratch registers.
-Several weeks of effort had failed to produce
-an algorithm that seemed to have much chance of running successfully
-without inordinate debugging effort.
-The difficulty of this issue should not be minimized; it represents one of the
-main intellectual efforts in porting the compiler.
-Nevertheless, this problem has been fudged with a degree of
-success on nearly a dozen machines, so the compiler writer should
-not abandon hope.
-.PP
-The Sethi-Ullman computations interact with the
-rest of the compiler in a number of rather subtle ways.
-As already discussed, the
-.I store
-routine uses the Sethi-Ullman numbers to decide which subtrees are too difficult
-to compute in registers, and must be stored.
-There are also subtle interactions between the
-rewriting routines and the Sethi-Ullman numbers.
-Suppose we have a tree such as
-.DS
-.I "A \- B"
-.DE
-where
-.I A
-and
-.I B
-are expressions; suppose further that
-.I B
-takes two registers, and
-.I A
-one.
-It is possible to compute the full expression in two registers by
-first computing
-.I B ,
-and then, using the scratch register
-used by
-.I B ,
-but not containing the answer, compute
-.I A .
-The subtraction can then be done, computing the expression.
-(Note that this assumes a number of things, not the least of which
-are register-to-register subtraction operators and symmetric
-registers.)
-If the machine dependent routine
-.I setbin ,
-however, is not prepared to recognize this case
-and compute the more difficult side of the expression
-first, the
-Sethi-Ullman number must be set to three.
-Thus, the
-Sethi-Ullman number for a tree should represent the code that
-the machine dependent routines are actually willing to generate.
-.PP
-The interaction can go the other way.
-If we take an expression such as
-.DS
-.I "* ( p + i )"
-.DE
-where
-.I p
-is a pointer and
-.I i
-an integer,
-this can probably be done in one register on most machines.
-Thus, its Sethi-Ullman number would probably be set to one.
-If double indexing is possible in the machine, a possible way
-of computing the expression is to load both
-.I p
-and
-.I i
-into registers, and then use double indexing.
-This would use two scratch registers; in such a case,
-it is possible that the scratch registers might be unobtainable,
-or might make some other part of the computation run out of
-registers.
-The usual solution is to cause
-.I offstar
-to ignore opportunities for double indexing that would tie up more scratch
-registers than the Sethi-Ullman number had reserved.
-.PP
-In summary, the Sethi-Ullman computation represents much of the craftsmanship and artistry in any application
-of the portable compiler.
-It is also a frequent source of bugs.
-Algorithms are available that will produce nearly optimal code
-for specialized machines, but unfortunately most existing machines
-are far removed from these ideals.
-The best way of proceeding in practice is to start with a compiler
-for a similar machine to the target, and proceed very
-carefully.
-.SH
-Register Allocation
-.PP
-After the Sethi-Ullman numbers are computed,
-.I order
-calls a routine,
-.I rallo ,
-that does register allocation, if appropriate.
-This routine does relatively little, in general;
-this is especially true if the target machine
-is fairly regular.
-There are a few cases where it is assumed that
-the result of a computation takes place in a particular register;
-switch and function return are the two major places.
-The expression tree has a field,
-.I rall ,
-that may be filled with a register number; this is taken
-to be a preferred register, and the first temporary
-register allocated by a template match will be this preferred one, if
-it is free.
-If not, no particular action is taken; this is just a heuristic.
-If no register preference is present, the field contains NOPREF.
-In some cases, the result must be placed in
-a given register, no matter what.
-The register number is placed in
-.I rall ,
-and the mask MUSTDO is logically or'ed in with it.
-In this case, if the subtree is requested in a register, and comes
-back in a register other than the demanded one, it is moved
-by calling the routine
-.I rmove .
-If the target register for this move is busy, it is a compiler
-error.
-.PP
-Note that this mechanism is the only one that will ever cause a register-to-register
-move between scratch registers (unless such a move is buried in the depths of
-some template).
-This simplifies debugging.
-In some cases, there is a rather strange interaction between
-the register allocation and the Sethi-Ullman number;
-if there is an operator or situation requiring a
-particular register, the allocator and the Sethi-Ullman
-computation must conspire to ensure that the target
-register is not being used by some intermediate result of some far-removed computation.
-This is most easily done by making the special operation take
-all of the free registers, preventing any other partially-computed
-results from cluttering up the works.
-.SH
-Compiler Bugs
-.PP
-The portable compiler has an excellent record of generating correct code.
-The requirement for reasonable cooperation between the register allocation,
-Sethi-Ullman computation, rewriting rules, and templates builds quite a bit
-of redundancy into the compiling process.
-The effect of this is that, in a surprisingly short time, the compiler will
-start generating correct code for those
-programs that it can compile.
-The hard part of the job then becomes finding and
-eliminating those situations where the compiler refuses to
-compile a program because it knows it cannot do it right.
-For example, a template may simply be missing; this may either
-give a compiler error of the form ``no match for op ...'' , or cause
-the compiler to go into an infinite loop applying various rewriting rules.
-The compiler has a variable,
-.I nrecur ,
-that is set to 0 at the beginning of an expressions, and
-incremented at key spots in the
-compilation process; if this parameter gets too large, the
-compiler decides that it is in a loop, and aborts.
-Loops are also characteristic of botches in the machine-dependent rewriting rules.
-Bad Sethi-Ullman computations usually cause the scratch registers
-to run out; this often means
-that the Sethi-Ullman number was underestimated, so
-.I store
-did not store something it should have; alternatively,
-it can mean that the rewriting rules were not smart enough to
-find the sequence that
-.I sucomp
-assumed would be used.
-.PP
-The best approach when a compiler error is detected involves several stages.
-First, try to get a small example program that steps on the bug.
-Second, turn on various debugging flags in the code generator, and follow the
-tree through the process of being matched and rewritten.
-Some flags of interest are
-\-e, which prints the expression tree,
-\-r, which gives information about the allocation of registers,
-\-a, which gives information about the performance of
-.I rallo ,
-and \-o, which gives information about the behavior of
-.I order .
-This technique should allow most bugs to be found relatively quickly.
-.PP
-Unfortunately, finding the bug is usually not enough; it must also
-be fixed!
-The difficulty arises because a fix to the particular bug of interest tends
-to break other code that already works.
-Regression tests, tests that compare the performance of
-a new compiler against the performance of an older one, are very
-valuable in preventing major catastrophes.
-.SH
-Summary and Conclusion
-.PP
-The portable compiler has been a useful tool for providing C
-capability on a large number of diverse machines,
-and for testing a number of theoretical
-constructs in a practical setting.
-It has many blemishes, both in style and functionality.
-It has been applied to many more machines than first
-anticipated, of a much wider range than originally dreamed of.
-Its use has also spread much faster than expected, leaving parts of
-the compiler still somewhat raw in shape.
-.PP
-On the theoretical side, there is some hope that the
-skeleton of the
-.I sucomp
-routine could be generated for many machines directly from the
-templates; this would give a considerable boost
-to the portability and correctness of the compiler,
-but might affect tunability and code quality.
-There is also room for more optimization, both within
-.I optim
-and in the form of a portable ``peephole'' optimizer.
-.PP
-On the practical, development side,
-the compiler could probably be sped up and made smaller
-without doing too much violence to its basic structure.
-Parts of the compiler deserve to be rewritten;
-the initialization code, register allocation, and
-parser are prime candidates.
-It might be that doing some or all of the parsing
-with a recursive descent parser might
-save enough space and time to be worthwhile;
-it would certainly ease the problem of moving the
-compiler to an environment where
-.I Yacc
-is not already present.
-.PP
-Finally, I would like to thank the many people who have
-sympathetically, and even enthusiastically, helped me grapple
-with what has been a frustrating program to write, test, and install.
-D. M. Ritchie and E. N. Pinson provided needed early
-encouragement and philosophical guidance;
-M. E. Lesk,
-R. Muha, T. G. Peterson,
-G. Riddle, L. Rosler,
-R. W. Mitze,
-B. R. Rowland,
-S. I. Feldman,
-and
-T. B. London
-have all contributed ideas, gripes, and all, at one time or another,
-climbed ``into the pits'' with me to help debug.
-Without their help this effort would have not been possible;
-with it, it was often kind of fun.
-.sp 100
-.LP
-.[
-$LIST$
-.]
-.LP
-.sp 100
-.LP
diff --git a/.ref-Research-V7/usr/doc/ratfor/m.mac b/.ref-Research-V7/usr/doc/ratfor/m.mac
deleted file mode 100644 (file)
index 6165c28..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.tr ~
-.tr _\(em
-.ND
-.if n .ls 2
-.de UL
-.if t \&\\$3\f3\\$1\fP\\$2\&
-.if n \&\\$3\f2\\$1\fP\\$2\&
-..
-.de IT
-.if n .ul
-\\$3\f2\\$1\fP\\$2
-..
-.de UI
-\f3\\$1\fI\\$2\fR\\$3
-..
-.de P1
-.if \\n(.$ .DS I \\$1
-.if !\\n(.$ .DS I 5
-.if n .ls 1
-.nf
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ta .4i .8i 1.2i 1.6i 2i 2.4i 2.8i 3.2i 3.6i 4i
-.if t .tr -\(mi|\(bv'\(fm^\(no
-.if t .tr _\(ru
-.lg 0
-.              use first argument as indent if present
-..
-.de P2
-.ft R
-.if n .ls 2
-.tr --||''^^!!_\(em
-.lg
-.DE
-..
-.hw semi-colon
-.if t .ds m \(mi
-.if n .ds m -
-.if t .ds n \(no
-.if n .ds n -
-.if t .ds S \(sl
-.if n .ds S /
-.if t .ds d \s+4\&.\&\s-4
-.if n .ds d \&.\&
-.if t .ds a \z@@
-.if n .ds a @
-.hy 14
-.      2=not last lines; 4= no -xx; 8=no xx-
-.ds m \(mi
-.tr *\(**
-.de WS
-.sp
-..
-.de UC
-\&\\$3\s-2\\$1\s0\\$2\&
-..
diff --git a/.ref-Research-V7/usr/doc/ratfor/m0 b/.ref-Research-V7/usr/doc/ratfor/m0
deleted file mode 100644 (file)
index 25001c2..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-.....ND "January 1, 1977"
-.RP
-....TR 55
-.....TM 76-1273-10 39199 39199-11
-.TL
-RATFOR \(em A Preprocessor for a Rational Fortran
-.AU "MH 2C-518" 6021
-Brian W. Kernighan
-.AI
-.MH
-.OK
-structured programming, control flow, programming
-.AB
-.ps 9
-.nr PS 9
-.vs 11
-.nr VS 11
-.in 0
-.ll
-.PP
-Although Fortran is not a pleasant
-language to use,
-it does have the advantages of universality
-and (usually) relative efficiency.
-The
-Ratfor 
-language attempts to conceal
-the main deficiencies of Fortran
-while retaining its desirable qualities,
-by providing
-decent control flow statements:
-.IP "\ \ \ \(bu"
-statement grouping
-.IP "\ \ \ \(bu"
-.UL if-else
-and
-.UL switch
-for decision-making
-.IP "\ \ \ \(bu"
-.UL while ,
-.UL for ,
-.UL do ,
-and
-.UL repeat-until
-for looping
-.IP "\ \ \ \(bu"
-.UL break
-and
-.UL next
-for controlling loop exits
-.LP
-and some ``syntactic sugar'':
-.IP "\ \ \ \(bu"
-free form input (multiple statements/line, automatic continuation)
-.IP "\ \ \ \(bu"
-unobtrusive comment convention
-.IP "\ \ \ \(bu"
-translation of >, >=, etc., into .GT., .GE., etc.
-.IP "\ \ \ \(bu"
-.UL return (expression)
-statement for functions
-.IP "\ \ \ \(bu"
-.UL define
-statement for symbolic parameters
-.IP "\ \ \ \(bu"
-.UL include
-statement for including source files
-.LP
-Ratfor
-is implemented as a
-preprocessor which translates this language
-into Fortran.
-.PP
-Once the control flow and cosmetic deficiencies of Fortran
-are hidden,
-the resulting language is remarkably pleasant to use.
-Ratfor 
-programs are
-markedly easier to write, and to read,
-and thus easier to debug, maintain and modify
-than their Fortran equivalents.
-.PP
-It is readily possible to write 
-Ratfor 
-programs which are portable to other env ironments.
-Ratfor
-is written in itself
-in this way,
-so it is also portable;
-versions of 
-Ratfor 
-are now running on at least two dozen different types of computers
-at over five hundred locations.
-.PP
-This paper discusses design criteria
-for a Fortran preprocessor,
-the 
-Ratfor
-language
-and its implementation,
-and user experience.
-.AE
-.FS
-This paper is a revised and expanded version of oe published in
-.ul
-Software\(emPractice and Experience,
-October 1975.
-The Ratfor described here is the one in use on
-.UC UNIX
-and
-.UC GCOS
-at Bell Laboratories, Murray Hill, N. J.
-.FE
-.CS 12 1 13 0 0 10
diff --git a/.ref-Research-V7/usr/doc/ratfor/m1 b/.ref-Research-V7/usr/doc/ratfor/m1
deleted file mode 100644 (file)
index ecd8a42..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-.nr PS 9
-.nr VS 11
-.if t .2C
-.if n .ls 2
-.NH
-INTRODUCTION
-.PP
-Most programmers will agree that Fortran is
-an unpleasant language to program in,
-yet there are many occasions when they are forced to use it.
-For example, Fortran is often the only language
-thoroughly supported on the local computer.
-Indeed, it is the closest thing to a universal programming language
-currently available:
-with care it is possible to write large, truly portable
-Fortran programs[1].
-Finally, Fortran is often the most ``efficient'' language
-available, particularly for programs requiring much computation.
-.PP
-But Fortran 
-.ul
-is
-unpleasant.
-Perhaps the worst deficiency is in
-the control flow
-statements
-_ conditional branches and loops _
-which express the logic of the program.
-The conditional statements in Fortran are primitive.
-The Arithmetic 
-.UC IF
-forces the user into at least two statement numbers and
-two (implied) 
-.UC GOTO 's;
-it leads to unintelligible code, and is eschewed by good programmers.
-The Logical
-.UC IF
-is better, in that the test part can be stated clearly,
-but hopelessly restrictive because the statement
-that follows the
-.UC IF
-can only be one Fortran statement
-(with some
-.ul
-further
-restrictions!).
-And of course there can be no
-.UC ELSE
-part to a Fortran
-.UC IF :
-there is no way to specify an alternative action if the
-.UC IF
-is not satisfied.
-.PP
-The Fortran
-.UC DO
-restricts the user to going forward in an arithmetic progression.
-It is fine for ``1 to N in steps of 1 (or 2 or ...)'',
-but there is no direct way to go backwards,
-or even (in ANSI Fortran[2]) to go from 1 to
-.if n N-1.
-.if t N\(mi1.
-And of course the
-.UC DO
-is useless if one's problem doesn't map into an arithmetic progression.
-.PP
-The result of these failings is that Fortran programs
-must be written with numerous labels and branches.
-The resulting code is
-particularly difficult to read and understand,
-and thus hard to debug and modify.
-.PP
-When one is faced with an unpleasant language,
-a useful technique is to define
-a new language that overcomes the deficiencies,
-and to translate it into the unpleasant one
-with a preprocessor.
-This is the approach taken with 
-Ratfor.
-(The preprocessor idea is of course not new,
-and preprocessors for Fortran are especially popular
-today.
-A recent listing [3] of preprocessors 
-shows more than 50, of which at least half a dozen are widely available.)
diff --git a/.ref-Research-V7/usr/doc/ratfor/m2 b/.ref-Research-V7/usr/doc/ratfor/m2
deleted file mode 100644 (file)
index 8b43e13..0000000
+++ /dev/null
@@ -1,1376 +0,0 @@
-.NH
-LANGUAGE DESCRIPTION
-.SH
-Design
-.PP
-Ratfor
-attempts to retain the merits of Fortran
-(universality, portability, efficiency)
-while hiding the worst Fortran inadequacies.
-The language
-.ul
-is
-Fortran except for two aspects.
-First,
-since control flow is central to any program,
-regardless of the specific application,
-the primary task of
-Ratfor
-is to conceal this part of Fortran from the user,
-by providing decent control flow structures.
-These structures are sufficient and comfortable
-for structured programming in the narrow sense of programming without
-.UC GOTO 's.
-Second, since the preprocessor must examine an entire program
-to translate the control structure,
-it is possible at the same time to clean up many of the
-``cosmetic'' deficiencies of Fortran,
-and thus provide a language which is easier
-and more pleasant to read and write.
-.PP
-Beyond these two aspects _ control flow and cosmetics _
-Ratfor
-does nothing about the host of other weaknesses of Fortran.
-Although it would be straightforward to extend 
-it
-to provide
-character strings,
-for example,
-they are not needed by everyone,
-and of course
-the preprocessor would be harder to implement.
-Throughout, the design principle which has determined
-what should be in
-Ratfor
-and what should not has
-been
-.ul
-Ratfor
-.ul
-doesn't know any Fortran.
-Any language feature which would require that
-Ratfor
-really understand Fortran has been omitted.
-We will return to this point in the section
-on implementation.
-.PP
-Even within the confines of control flow and cosmetics,
-we have attempted to be selective
-in what features to provide.
-The intent has been to provide a small set of the most useful
-constructs,
-rather than to throw in everything that has ever been thought useful
-by someone.
-.PP
-The rest of this section contains an informal description
-of the
-Ratfor
-language.
-The control flow aspects will be
-quite familiar to readers used to languages like
-Algol, PL/I, Pascal, etc.,
-and the cosmetic changes are equally straightforward.
-We shall concentrate on 
-showing what the language looks like.
-.SH
-Statement Grouping
-.PP
-Fortran provides no way to group statements together,
-short of making them into a subroutine.
-The standard construction
-``if a condition is true,
-do this group of things,''
-for example,
-.P1
-if (x > 100)
-       { call error("x>100"); err = 1; return }
-.P2
-cannot be written directly in Fortran.
-Instead
-a programmer is forced to translate this relatively
-clear thought into murky Fortran,
-by stating the negative condition
-and branching around the group of statements:
-.P1
-       if (x .le. 100) goto 10
-               call error(5hx>100)
-               err = 1
-               return
-10     ...
-.P2
-When the program doesn't work,
-or when it must be modified,
-this must be translated back into
-a clearer form before one can be sure what it does.
-.PP
-Ratfor
-eliminates this error-prone and confusing back-and-forth translation;
-the first form 
-.ul
-is
-the way the computation is written in 
-Ratfor.
-A group of statements can be treated as a unit
-by enclosing them in the braces { and }.
-This is true throughout the language:
-wherever a single 
-Ratfor
-statement can be used,
-there can be several enclosed in braces.
-(Braces seem clearer and less obtrusive than
-.UL begin
-and
-.UL end 
-or
-.UL do
-and
-.UL end ,
-and of course 
-.UL do
-and
-.UL end
-already have Fortran meanings.)
-.PP
-Cosmetics
-contribute to the readability of code,
-and thus to its understandability.
-The character ``>'' is clearer than
-.UC ``.GT.'' ,
-so
-Ratfor
-translates it appropriately,
-along with several other similar shorthands.
-Although many Fortran compilers permit character strings in quotes
-(like
-.UL """x>100""" ),
-quotes are
-not allowed in 
-.UC ANSI
-Fortran,
-so 
-Ratfor
-converts it into the right number of
-.UL H 's:
-computers count better than people do.
-.PP
-Ratfor
-is a free-form language:
-statements may appear anywhere on a line,
-and several may appear on one line
-if they are separated by semicolons.
-The example above could also be written as
-.P1
-if (x > 100) {
-       call error("x>100")
-       err = 1
-       return
-}
-.P2
-In this case, no semicolon is needed at the end of each line because
-Ratfor
-assumes there is one statement per line
-unless told otherwise.
-.PP
-Of course,
-if the statement that follows the
-.UL if
-is a single statement
-(Ratfor
-or otherwise),
-no braces are needed:
-.P1
-if (y <= 0.0 & z <= 0.0)
-       write(6, 20) y, z
-.P2
-No continuation need be indicated 
-because the statement is clearly not finished on the first line.
-In general
-Ratfor
-continues lines when it seems obvious that they are not yet done.
-(The continuation convention is discussed in detail later.)
-.PP
-Although a free-form language permits wide latitude in formatting styles,
-it is wise to pick one that is readable, then stick to it.
-In particular, proper indentation is vital,
-to make the logical structure of the program obvious to the reader.
-.sp
-.SH
-The ``else'' Clause
-.PP
-Ratfor
-provides an
-.UL "else"
-statement to handle the construction
-``if a condition is true,
-do 
-this
-thing,
-.ul
-otherwise
-do that thing.''
-.P1
-if (a <= b)
-       { sw = 0; write(6, 1) a, b }
-else
-       { sw = 1; write(6, 1) b, a }
-.P2
-This writes out the smaller of
-.UL a
-and
-.UL b ,
-then the larger, and sets
-.UL sw
-appropriately.
-.PP
-The Fortran equivalent of this code is circuitous indeed:
-.P1
-       if (a .gt. b) goto 10
-               sw = 0
-               write(6, 1) a, b
-               goto 20
-10     sw = 1
-       write(6, 1) b, a
-20     ...
-.P2
-This is a mechanical translation;
-shorter forms exist, 
-as they do for many similar situations.
-But all translations suffer from the same problem:
-since they are translations,
-they are less clear and understandable than code
-that is not a translation.
-To understand the Fortran version,
-one must scan the entire program to make
-sure that no other statement branches
-to statements 10 or 20
-before one knows that indeed this is an 
-.UL if-else
-construction.
-With the
-Ratfor
-version,
-there is no question about how one gets to the parts of the statement.
-The
-.UL if-else
-is a single unit,
-which can be read, understood, and ignored if not relevant.
-The program says what it means.
-.PP
-As before, if the statement following an
-.UL if
-or an
-.UL else
-is a single statement, no braces are needed:
-.P1
-if (a <= b)
-       sw = 0
-else
-       sw = 1
-.P2
-.PP
-The syntax of the
-.UL if
-statement is
-.P1
-if (\fIlegal Fortran condition\fP)
-       \fIRatfor statement\fP
-else
-       \fIRatfor statement\fP
-.P2
-where the 
-.UL else
-part is optional.
-The
-.ul
-legal Fortran condition
-is
-anything that can legally go into a Fortran Logical
-.UC IF .
-Ratfor
-does not check this clause,
-since it does not know enough Fortran
-to know what is permitted.
-The
-.ul
-Ratfor
-.ul
-statement
-is any Ratfor or Fortran statement, or any collection of them
-in braces.
-.SH
-Nested if's
-.PP
-Since the statement that follows an
-.UL if
-or 
-an
-.UL else
-can be any Ratfor statement, this leads immediately
-to the possibility of another
-.UL if
-or
-.UL else .
-As a useful example, consider this problem:
-the variable
-.UL f
-is to be set to
-\-1 if
-.UL x
-is less than zero,
-to
-+1
-if
-.UL x
-is greater than 100,
-and to 0 otherwise.
-Then in Ratfor, we write
-.P1
-if (x < 0)
-       f = -1
-else if (x > 100)
-       f = +1
-else
-       f = 0
-.P2
-Here the statement after the first
-.UL else
-is another
-.UL if-else .
-Logically it is just a single statement,
-although it is rather complicated.
-.PP
-This code says what it means.
-Any version written in straight Fortran
-will necessarily be indirect
-because Fortran does not let you say what you mean.
-And as always, clever shortcuts may turn out
-to be too clever to understand a year from now.
-.PP
-Following an
-.UL else
-with an
-.UL if
-is one way to write a multi-way branch in Ratfor.
-In general the structure
-.P1
-if (...)
-       - - -
-else if (...)
-       - - -
-else if (...)
-       - - -
- ...
-else
-       - - -
-.P2
-provides a way to specify the choice of exactly one of several alternatives.
-(Ratfor also provides a
-.UL switch
-statement which does the same job
-in certain special cases;
-in more general situations, we have to make do
-with spare parts.)
-The tests are laid out in sequence, and each one
-is followed by the code associated with it.
-Read down the list
-of decisions until one is found that is satisfied.
-The code associated with this condition is executed,
-and then the entire structure is finished.
-The trailing
-.UL else
-part handles the ``default'' case,
-where none of the other conditions apply.
-If there is no default action, this final
-.UL else
-part
-is omitted:
-.P1
-if (x < 0)
-       x = 0
-else if (x > 100)
-       x = 100
-.P2
-.SH
-if-else ambiguity
-.PP
-There is one thing to notice about complicated structures
-involving nested
-.UL if 's
-and
-.UL else 's.
-Consider
-.P1
-if (x > 0)
-       if (y > 0)
-               write(6, 1) x, y
-       else
-               write(6, 2) y
-.P2
-There are two
-.UL if 's
-and
-only one
-.UL else .
-Which
-.UL if
-does the
-.UL else
-go with?
-.PP
-This is a genuine ambiguity in Ratfor, as it is in many other programming
-languages.
-The ambiguity is resolved in Ratfor
-(as elsewhere) by saying that in such cases the
-.UL else
-goes with the closest previous
-.UL else 'ed un-
-.UL if .
-Thus in this case, the
-.UL else
-goes with the inner
-.UL if ,
-as we have indicated by the indentation.
-.PP
-It is a wise practice to resolve such cases by explicit braces,
-just to make your intent clear.
-In the case above, we would write
-.P1
-if (x > 0) {
-       if (y > 0)
-               write(6, 1) x, y
-       else
-               write(6, 2) y
-}
-.P2
-which does not change the meaning, but leaves
-no doubt in the reader's mind.
-If we want the other association, we
-.ul
-must
-write
-.P1
-if (x > 0) {
-       if (y > 0)
-               write(6, 1) x, y
-}
-else
-       write(6, 2) y
-.P2
-.SH
-The ``switch'' Statement
-.PP
-The
-.UL switch
-statement
-provides a clean way to express multi-way branches
-which branch on the value of some integer-valued expression.
-The syntax is
-.P1
-\f3switch (\fIexpression\|\f3) {
-
-       case \fIexpr1\f3 :
-               \f2statements\f3
-       case \fIexpr2, expr3\f3 :
-               \f2statements\f3
-       ...
-       default:
-               \f2statements\f3
-}
-.P2
-.PP
-Each
-.UL case
-is followed by a
-list of comma-separated integer expressions.
-The
-.ul
-expression
-inside
-.UL switch
-is compared against the case expressions
-.ul
-expr1,
-.ul
-expr2, 
-and so on in turn
-until one matches,
-at which time the statements following that
-.UL case
-are executed.
-If no cases match
-.ul
-expression,
-and there is a
-.UL default 
-section,
-the statements with it are done;
-if there is no
-.UL default,
-nothing is done.
-In all situations,
-as soon as some block of statements is executed,
-the entire
-.UL switch
-is exited immediately.
-(Readers familiar with C[4] should beware that this
-behavior is not the same as the C
-.UL switch .)
-.SH
-The ``do'' Statement
-.PP
-The
-.UL do
-statement in
-Ratfor
-is quite similar to the
-.UC DO
-statement in Fortran,
-except that it uses no statement number.
-The statement number, after all, serves only to mark the end
-of the
-.UC DO ,
-and this can be done just as easily with braces.
-Thus
-.P1
-       do i = 1, n {
-               x(i) = 0.0
-               y(i) = 0.0
-               z(i) = 0.0
-       }
-.P2
-is the same as
-.P1
-       do 10 i = 1, n
-               x(i) = 0.0
-               y(i) = 0.0
-               z(i) = 0.0
-10     continue
-.P2
-The syntax is:
-.P1
-do \fIlegal\(hyFortran\(hyDO\(hytext\fP
-       \fIRatfor statement\fP
-.P2
-The part that follows 
-the keyword
-.UL do
-has to be something that can legally go into a Fortran
-.UC DO
-statement.
-Thus if a local version of Fortran allows
-.UC DO
-limits to be expressions
-(which is not currently permitted in
-.UC ANSI
-Fortran),
-they can be used in a
-Ratfor
-.UL do.
-.PP
-The
-.ul
-Ratfor statement
-part will often be enclosed in braces, but
-as with the
-.UL if ,
-a single statement need not have braces around it.
-This code sets an array to zero:
-.P1
-do i = 1, n
-       x(i) = 0.0
-.P2
-Slightly more complicated,
-.P1
-do i = 1, n
-       do j = 1, n
-               m(i, j) = 0
-.P2
-sets the entire array
-.UL m
-to zero, and
-.P1
-do i = 1, n
-       do j = 1, n
-               if (i < j)
-                       m(i, j) = -1
-               else if (i == j)
-                       m(i, j) = 0
-               else
-                       m(i, j) = +1
-.P2
-sets the upper triangle of
-.UL m
-to \-1, the diagonal to zero, and the lower triangle to +1.
-(The operator == is ``equals'', that is, ``.EQ.''.)
-In each case, the statement that follows the
-.UL do
-is logically a
-.ul
-single
-statement, even though complicated,
-and thus needs no braces.
-.sp
-.SH
-``break'' and ``next''
-.PP
-Ratfor
-provides a statement for leaving a loop early,
-and one for beginning the next iteration.
-.UL "break"
-causes an immediate exit from the
-.UL do ;
-in effect it is a branch to the statement
-.ul
-after
-the
-.UL do .
-.UL next
-is a branch to the bottom of the loop,
-so it causes the next iteration to be done.
-For example, this code skips over negative values in an array:
-.P1
-do i = 1, n {
-       if (x(i) < 0.0)
-               next
-       \fIprocess positive element\fP
-}
-.P2
-.UL break
-and
-.UL next
-also work in the other Ratfor looping constructions
-that we will talk about in the next few sections.
-.PP
-.UL break
-and
-.UL next
-can be followed by an integer to indicate breaking or iterating
-that level of enclosing loop; thus
-.P1
-break 2
-.P2
-exits from two levels of enclosing loops,
-and
-.UL break\ 1
-is equivalent to
-.UL break .
-.UL next\ 2
-iterates the second enclosing loop.
-(Realistically, 
-multi-level
-.UL break 's
-and
-.UL next 's
-are
-not likely to be much used
-because they lead to code that is hard to understand
-and somewhat risky to change.)
-.sp
-.SH
-The ``while'' Statement
-.PP
-One of the problems with the Fortran
-.UC DO
-statement
-is that it generally insists upon being done once,
-regardless of its limits.
-If a loop begins
-.P1
-DO I = 2, 1
-.P2
-this will typically be done once with
-.UL I
-set to 2,
-even though common sense would suggest that perhaps it shouldn't be.
-Of course a
-Ratfor
-.UL do
-can easily be preceded by a test
-.P1
-if (j <= k)
-       do i = j, k  {
-               _ _ _
-       }
-.P2
-but this has to be a conscious act,
-and is often overlooked by programmers.
-.PP
-A more serious problem with the
-.UC DO
-statement
-is that it encourages that a program be written
-in terms of an arithmetic progression
-with small positive steps,
-even though that may not be the best way to write it.
-If code has to be contorted to fit the requirements
-imposed by the Fortran
-.UC DO ,
-it is that much harder to write and understand.
-.PP
-To overcome these difficulties,
-Ratfor
-provides a
-.UL while
-statement,
-which is simply a loop:
-``while some condition is true,
-repeat this group of statements''.
-It has
-no preconceptions about why one is looping.
-For example, this routine to compute sin(x)
-by the Maclaurin series
-combines two termination criteria.
-.P1 1
-.ta .3i .6i .9i 1.2i 1.5i 1.8i
-real function sin(x, e)
-       # returns sin(x) to accuracy e, by
-       # sin(x) = x - x**3/3! + x**5/5! - ...
-
-       sin = x
-       term = x
-
-       i = 3
-       while (abs(term)>e & i<100) {
-               term = -term * x**2 / float(i*(i-1))
-               sin = sin + term
-               i = i + 2
-       }
-
-       return
-       end
-.P2
-.PP
-Notice that
-if the routine is entered with
-.UL term
-already smaller than
-.UL e ,
-the 
-loop will be done
-.ul
-zero times,
-that is, no attempt will be made to compute
-.UL x**3
-and thus a potential underflow is avoided.
-Since the test is made at the top of a
-.UL while
-loop
-instead of the bottom,
-a special case disappears _
-the code works at one of its boundaries.
-(The test
-.UL i<100
-is the other boundary _
-making sure the routine stops after
-some maximum number of iterations.)
-.PP
-As an aside, a sharp character ``#'' in a line
-marks the beginning of a comment;
-the rest of the line is comment.
-Comments and code can co-exist on the same line _
-one can make marginal remarks,
-which is not possible with Fortran's ``C in column 1'' convention.
-Blank lines are also permitted anywhere
-(they are not in Fortran);
-they should be used to emphasize the natural divisions
-of a program.
-.PP
-The syntax of the 
-.UL while
-statement is
-.P1
-while (\fIlegal Fortran condition\fP)
-       \fIRatfor statement\fP
-.P2
-As with the
-.UL if ,
-.ul
-legal Fortran condition
-is something that can go into
-a Fortran Logical
-.UC IF ,
-and
-.ul
-Ratfor statement
-is a single statement,
-which may be multiple statements in braces.
-.PP
-The
-.UL while
-encourages a style of coding not normally
-practiced by Fortran programmers.
-For example, suppose
-.UL nextch
-is a function which returns the next input character
-both as a function value and in its argument.
-Then a loop to find the first non-blank character is just
-.P1
-while (nextch(ich) == iblank)
-       ;
-.P2
-A semicolon by itself is a null statement,
-which is necessary here to mark the end of the
-.UL while ;
-if it were not present, the
-.UL while
-would control the next statement.
-When the loop is broken, 
-.UL ich
-contains the first non-blank.
-Of course the same code can be written in Fortran as
-.P1 1
-100    if (nextch(ich) .eq. iblank) goto 100
-.P2
-but many Fortran programmers (and a few compilers) believe this line is illegal.
-The language at one's disposal
-strongly influences how one thinks about a problem.
-.sp
-.SH
-The ``for'' Statement
-.PP
-The
-.UL for
-statement
-is another Ratfor loop, which
-attempts to carry the separation of
-loop-body from reason-for-looping
-a step further
-than the
-.UL while.
-A
-.UL for
-statement allows explicit initialization
-and increment steps as part of the statement.
-For example, 
-a
-.UC DO
-loop is just
-.P1
-for (i = 1; i <= n; i = i + 1) ...
-.P2
-This is equivalent to
-.P1
-i = 1
-while (i <= n) {
-       ...
-       i = i + 1
-}
-.P2
-The initialization and increment of
-.UL i
-have been moved into the
-.UL for
-statement,
-making it easier to see at a glance
-what controls the loop.
-.PP
-The
-.UL for
-and
-.UL while
-versions have the advantage that they will be done zero times
-if
-.UL n
-is less than 1; this is not true of the
-.UL do .
-.PP
-The loop of the sine routine in the previous section
-can be re-written
-with a
-.UL for
-as
-.P1 3
-for (i=3; abs(term) > e & i < 100; i=i+2) {
-       term = -term * x**2 / float(i*(i-1))
-       sin = sin + term
-}
-.P2
-.PP
-The syntax of the
-.UL for
-statement is
-.P1
-for ( \fIinit\fP ; \fIcondition\fP ; \fIincrement\fP )
-       \fIRatfor statement\fP
-.P2
-.ul
-init
-is any single Fortran statement, which gets done once
-before the loop begins.
-.ul
-increment
-is any single Fortran statement,
-which gets done at the end of each pass through the loop,
-before the test.
-.ul
-condition
-is again anything that is legal in a logical 
-.UC IF.
-Any of 
-.ul
-init,
-.ul
-condition,
-and
-.ul
-increment
-may be omitted,
-although the semicolons
-.ul
-must
-always be present.
-A non-existent
-.ul
-condition
-is treated as always true,
-so
-.UL "for(;;)"
-is an indefinite repeat.
-(But see the
-.UL repeat-until
-in the next section.)
-.PP
-The
-.UL for
-statement is particularly
-useful for
-backward loops, chaining along lists,
-loops that might be done zero times,
-and similar things which are hard to express with a 
-.UC DO
-statement,
-and obscure to write out 
-with
-.UC IF 's
-and
-.UC GOTO 's.
-For example,
-here is a
-backwards
-.UC DO
-loop
-to find the last non-blank character on a card:
-.P1
-for (i = 80; i > 0; i = i - 1)
-       if (card(i) != blank)
-               break
-.P2
-(``!='' is the same as 
-.UC ``.NE.'' ).
-The code scans the columns from 80 through to 1.
-If a non-blank is found, the loop
-is immediately broken.
-.UL break \& (
-and
-.UL next
-work in
-.UL for 's
-and
-.UL while  's
-just as in 
-.UL do 's).
-If 
-.UL i
-reaches zero,
-the card is all blank.
-.PP
-This code is rather nasty to write with a regular Fortran
-.UC DO ,
-since the loop must go forward,
-and we must explicitly set up proper conditions
-when we fall out of the loop.
-(Forgetting this is a common error.)
-Thus:
-.P1 1
-.ta .3i .6i .9i 1.2i 1.5i 1.8i
-       DO 10 J = 1, 80
-               I = 81 - J
-               IF (CARD(I) .NE. BLANK) GO TO 11
-10     CONTINUE
-       I = 0
-11     ...
-.P2
-The version that uses the
-.UL for
-handles the termination condition properly for free;
-.UL i
-.ul
-is
-zero when we fall out of the
-.UL for
-loop.
-.PP
-The increment
-in a
-.UL for
-need not be an arithmetic progression;
-the following program walks along a list
-(stored in an integer array
-.UL ptr )
-until a zero pointer is found,
-adding up elements from a parallel array of values:
-.P1
-sum = 0.0
-for (i = first; i > 0; i = ptr(i))
-       sum = sum + value(i)
-.P2
-Notice that the code works correctly if the list is empty.
-Again, placing the test at the top of a loop
-instead of the bottom eliminates a potential boundary error.
-.SH
-The ``repeat-until'' statement
-.PP
-In spite of the dire warnings,
-there are times when one really needs a loop that tests at the bottom
-after one pass through.
-This service is provided by the
-.UL repeat-until :
-.P1
-repeat
-       \fIRatfor statement\fP
-until (\fIlegal Fortran condition\fP)
-.P2
-The
-.ul
-Ratfor statement
-part is done once,
-then the condition is evaluated.
-If it is true, the loop is exited;
-if it is false, another pass is made.
-.PP
-The
-.UL until
-part is optional, so a bare
-.UL repeat
-is the cleanest way to specify an infinite loop.
-Of course such a loop must ultimately be broken by some
-transfer of control such as
-.UL stop ,
-.UL return ,
-or
-.UL break ,
-or an implicit stop such as running out of input with
-a
-.UC READ
-statement.
-.PP
-As a matter of observed fact[8], the
-.UL repeat-until
-statement is
-.ul
-much
-less used than the other looping constructions;
-in particular, it is typically outnumbered ten to one by
-.UL for
-and
-.UL while .
-Be cautious about using it, for loops that test only at the
-bottom often don't handle null cases well.
-.SH
-More on break and next
-.PP
-.UL break
-exits immediately from 
-.UL do ,
-.UL while ,
-.UL for ,
-and
-.UL repeat-until .
-.UL next
-goes to the test part of
-.UL do ,
-.UL while
-and
-.UL repeat-until ,
-and to the increment step of a
-.UL for .
-.SH
-``return'' Statement
-.PP
-The standard Fortran mechanism for returning a value from a function uses the name of the function as a variable which can be assigned to;
-the last value stored in it 
-is the function value upon return.
-For example, here is a routine
-.UL equal
-which returns 1 if two arrays are identical,
-and zero if they differ.
-The array ends are marked by the special value \-1.
-.P1 1
-.ta .3i .6i .9i 1.2i 1.5i 1.8i
-# equal _ compare str1 to str2;
-#      return 1 if equal, 0 if not
-       integer function equal(str1, str2)
-       integer str1(100), str2(100)
-       integer i
-
-       for (i = 1; str1(i) == str2(i); i = i + 1)
-               if (str1(i) == -1) {
-                       equal = 1
-                       return
-               }
-       equal = 0
-       return
-       end
-.P2
-.PP
-In many languages (e.g., PL/I)
-one instead says
-.P1
-return (\fIexpression\fP)
-.P2
-to return a value from a function.
-Since this is often clearer, Ratfor provides such a
-.UL return
-statement _
-in a function
-.UL F ,
-.UL return (expression)
-is equivalent to
-.P1
-{ F = expression; return }
-.P2
-For example, here is
-.UL equal
-again:
-.P1 1
-.ta .3i .6i .9i 1.2i 1.5i 1.8i
-# equal _ compare str1 to str2;
-#      return 1 if equal, 0 if not
-       integer function equal(str1, str2)
-       integer str1(100), str2(100)
-       integer i
-
-       for (i = 1; str1(i) == str2(i); i = i + 1)
-               if (str1(i) == -1)
-                       return(1)
-       return(0)
-       end
-.P2
-If there is no parenthesized expression after
-.UL return ,
-a normal
-.UC RETURN 
-is made.
-(Another version of
-.UL equal
-is presented shortly.)
-.sp
-.SH
-Cosmetics
-.PP
-As we said above,
-the visual appearance of a language
-has a substantial effect
-on how easy it is to read and understand
-programs.
-Accordingly, Ratfor provides a number of cosmetic facilities
-which may be used to make programs more readable.
-.SH
-Free-form Input
-.PP
-Statements can be placed anywhere on a line;
-long statements are continued automatically,
-as are long conditions in
-.UL if ,
-.UL while ,
-.UL for ,
-and
-.UL until .
-Blank lines are ignored.
-Multiple statements may appear on one line,
-if they are separated by semicolons.
-No semicolon is needed at the end of a line,
-if
-Ratfor
-can make some reasonable guess about whether the statement
-ends there.
-Lines ending with any of the characters
-.P1
-=    +    -    *    ,    |    &    (    \(ru
-.P2
-are assumed to be continued on the next line.
-Underscores are discarded wherever they occur;
-all others remain as part of the statement.
-.PP
-Any statement that begins with an all-numeric field is
-assumed to be a Fortran label,
-and placed in columns 1-5 upon output.
-Thus
-.P1
-write(6, 100); 100 format("hello")
-.P2
-is converted into
-.P1
-       write(6, 100)
-100    format(5hhello)
-.P2
-.SH
-Translation Services
-.PP
-Text enclosed in matching single or double quotes
-is converted to
-.UL nH...
-but is otherwise unaltered
-(except for formatting _ it may get split across card boundaries
-during the reformatting process).
-Within quoted strings, the backslash `\e' serves as an escape character:
-the next character is taken literally.
-This provides a way to get quotes (and of course the backslash itself) into
-quoted strings:
-.P1
-"\e\e\e\(fm"
-.P2
-is a string containing a backslash and an apostrophe.
-(This is
-.ul
-not
-the standard convention of doubled quotes,
-but it is easier to use and more general.)
-.PP
-Any line that begins with the character `%'
-is left absolutely unaltered  
-except for stripping off the `%'
-and moving the line one position to the left.
-This is useful for inserting control cards,
-and other things that should not be transmogrified
-(like an existing Fortran program).
-Use `%' only for ordinary statements,
-not for the condition parts of
-.UL if ,
-.UL while ,
-etc., or the output may come out in an unexpected place.
-.PP
-The following character translations are made, 
-except within single or double quotes
-or on a line beginning with a `%'.
-.P1
-.ta .5i 1.5i 2i
-==     .eq.    !=      .ne.
->      .gt.    >=      .ge.
-<      .lt.    <=      .le.
-&      .and.   |       .or.
-!      .not.   ^       .not.
-.P2
-In addition, the following translations are provided
-for input devices with restricted character sets.
-.P1
-.ta .5i 1.5i 2i
-[      {       ]       }
-$(     {       $)      }
-.P2
-.SH
-``define'' Statement
-.PP
-Any string of alphanumeric characters can be defined as a name;
-thereafter, whenever that name occurs in the input
-(delimited by non-alphanumerics)
-it is replaced by the rest of the definition line.
-(Comments and trailing white spaces are stripped off).
-A defined name can be arbitrarily long,
-and must begin with a letter.
-.PP
-.UL define
-is typically used to create symbolic parameters:
-.P1
-define ROWS    100
-define COLS    50
-.if t .sp 5p
-dimension a(ROWS), b(ROWS, COLS)
-.if t .sp 5p
-       if (i > ROWS  \(or  j > COLS) ...
-.P2
-Alternately, definitions may be written as
-.P1
-define(ROWS, 100)
-.P2
-In this case, the defining text is everything after the comma up to the balancing
-right parenthesis;
-this allows multi-line definitions.
-.PP
-It is generally a wise practice to use symbolic parameters
-for most constants, to help make clear the function of what
-would otherwise be mysterious numbers.
-As an example, here is the routine
-.UL equal 
-again, this time with symbolic constants.
-.P1 3
-.ta .3i .6i .9i 1.2i 1.5i 1.8i
-define YES             1
-define NO              0
-define EOS             -1
-define ARB             100
-
-# equal _ compare str1 to str2;
-#      return YES if equal, NO if not
-       integer function equal(str1, str2)
-       integer str1(ARB), str2(ARB)
-       integer i
-
-       for (i = 1; str1(i) == str2(i); i = i + 1)
-               if (str1(i) == EOS)
-                       return(YES)
-       return(NO)
-       end
-.P2
-.SH
-``include'' Statement
-.PP
-The statement
-.P1
-       include file
-.P2
-inserts the file
-found on input stream
-.ul
-file
-into the
-Ratfor
-input in place of the
-.UL include
-statement.
-The standard usage is to place 
-.UC COMMON
-blocks on a file,
-and
-.UL include
-that file whenever a copy is needed:
-.P1
-subroutine x
-       include commonblocks
-       ...
-       end
-
-suroutine y
-       include commonblocks
-       ...
-       end
-.P2
-This ensures that all copies of the 
-.UC COMMON
-blocks are identical
-.SH
-Pitfalls, Botches, Blemishes and other Failings
-.PP
-Ratfor catches certain syntax errors, such as missing braces,
-.UL else
-clauses without an
-.UL if ,
-and most errors involving missing parentheses in statements.
-Beyond that, since Ratfor knows no Fortran, 
-any errors you make will be reported by the Fortran compiler,
-so you will from time to time have to relate a Fortran diagnostic back
-to the Ratfor source.
-.PP
-Keywords are reserved _
-using
-.UL if ,
-.UL else ,
-etc., as variable names will typically wreak havoc.
-Don't leave spaces in keywords.
-Don't use the Arithmetic
-.UC IF .
-.PP
-The Fortran
-.UL nH
-convention is not recognized anywhere by Ratfor;
-use quotes instead.
diff --git a/.ref-Research-V7/usr/doc/ratfor/m3 b/.ref-Research-V7/usr/doc/ratfor/m3
deleted file mode 100644 (file)
index 817a897..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-.NH
-IMPLEMENTATION
-.PP
-Ratfor
-was originally written in
-C[4]
-on the
-.UC UNIX
-operating system[5].
-The language is specified by a context free grammar
-and the compiler constructed using
-the
-.UC YACC
-compiler-compiler[6].
-.PP
-The
-Ratfor
-grammar is simple and straightforward, being essentially
-.P1
-prog   : stat 
-       | prog   stat
-stat   : \f3if\fP (...) stat 
-       | \f3if\fP (...) stat \f3else\fP stat
-       | \f3while\fP (...) stat
-       | \f3for\fP (...; ...; ...) stat
-       | \f3do\fP ... stat
-       | \f3repeat\fP stat
-       | \f3repeat\fP stat \f3until\fP (...)
-       | \f3switch\fP (...) { \f3case\fP ...: prog ...
-                       \f3default\fP: prog }
-       | \f3return\fP
-       | \f3break\fP
-       | \f3next\fP
-       | digits   stat
-       | { prog }
-       | anything unrecognizable
-.P2
-The observation
-that
-Ratfor
-knows no Fortran
-follows directly from the rule that says a statement is
-``anything unrecognizable''.
-In fact most of Fortran falls into this category,
-since any statement that does not begin with one of the keywords
-is by definition ``unrecognizable.''
-.PP
-Code generation is also simple.
-If the first thing on a source line is
-not a keyword
-(like
-.UL if ,
-.UL else ,
-etc.)
-the entire statement is simply copied to the output
-with appropriate character translation and formatting.
-(Leading digits are treated as a label.)
-Keywords cause only slightly more complicated actions.
-For example, when
-.UL if
-is recognized, two consecutive labels L and L+1
-are generated and the value of L is stacked.
-The condition is then isolated, and the code
-.P1
-if (.not. (condition)) goto L
-.P2
-is output.
-The 
-.ul
-statement
-part of the
-.UL if
-is then translated.
-When the end of the 
-statement is encountered
-(which may be some distance away and include nested \f3if\fP's, of course),
-the code
-.P1
-L      continue
-.P2
-is generated, unless there is an
-.UL else
-clause, in which case
-the code is
-.P1
-       goto L+1
-L      continue
-.P2
-In this latter case,
-the code
-.P1
-L+1    continue
-.P2
-is produced after the
-.ul
-statement
-part of the
-.UL else.
-Code generation for the various loops is equally simple.
-.PP
-One might argue that more care should be taken
-in code generation.
-For example,
-if there is no trailing
-.UL else ,
-.P1
-       if (i > 0) x = a
-.P2
-should be left alone, not converted into
-.P1
-       if (.not. (i .gt. 0)) goto 100
-       x = a
-100    continue
-.P2
-But what are optimizing compilers for, if not to improve code?
-It is a rare program indeed where this kind of ``inefficiency''
-will make even a measurable difference.
-In the few cases where it is important,
-the offending lines can be protected by `%'.
-.PP
-The use of a compiler-compiler is definitely the preferred method
-of software development.
-The language is well-defined,
-with few syntactic irregularities.
-Implementation is quite simple;
-the original construction took under a week.
-The language
-is sufficiently simple, however, that an
-.ul
-ad hoc
-recognizer can be readily constructed to do the same job
-if no compiler-compiler is available.
-.PP
-The C version of 
-Ratfor
-is used on
-.UC UNIX
-and on the Honeywell
-.UC GCOS
-systems.
-C compilers are not as widely available as Fortran, however,
-so there is also a
-Ratfor
-written in itself
-and originally bootstrapped with the C version.
-The
-Ratfor
-version
-was written so as to translate into the portable subset
-of Fortran described in [1],
-so it is portable,
-having been run essentially without change
-on at least twelve distinct machines.
-(The main restrictions of the portable subset are:
-only one character per machine word;
-subscripts in the 
-form
-.ul
-c*v\(+-c;
-avoiding expressions in places like
-.UC DO
-loops;
-consistency in subroutine argument usage,
-and in 
-.UC COMMON
-declarations.
-Ratfor
-itself will not gratuitously generate non-standard Fortran.)
-.PP
-The
-Ratfor
-version is about 1500 lines of
-Ratfor
-(compared to about 1000 lines of C);
-this compiles into 2500 lines of Fortran.
-This expansion ratio is somewhat higher than average,
-since the compiled code contains unnecessary occurrences
-of
-.UC COMMON
-declarations.
-The execution time of the
-Ratfor
-version is dominated by
-two routines that read and write cards.
-Clearly these routines could be replaced
-by machine coded local versions;
-unless this is done, the efficiency of other parts of the translation process
-is largely irrelevant.
diff --git a/.ref-Research-V7/usr/doc/ratfor/m4 b/.ref-Research-V7/usr/doc/ratfor/m4
deleted file mode 100644 (file)
index efada18..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-.NH
-EXPERIENCE
-.SH
-Good Things
-.PP
-``It's
-so much better than Fortran''
-is the most common response of users
-when asked how well
-Ratfor
-meets their needs.
-Although cynics might consider this to be vacuous,
-it does seem to be true that 
-decent control flow and cosmetics converts Fortran
-from a bad language into quite a reasonable one,
-assuming that Fortran data structures are adequate
-for the task at hand.
-.PP
-Although there are no quantitative results,
-users feel that coding in
-Ratfor
-is at least twice as fast as in Fortran.
-More important, debugging and subsequent revision
-are much faster than in Fortran.
-Partly this is simply because the code can be
-.ul
-read.
-The looping statements
-which test at the top instead of the bottom
-seem to eliminate or at least
-reduce the occurrence of a wide class of
-boundary errors.
-And of course it is easy to do structured programming in 
-Ratfor;
-this self-discipline also contributes
-markedly to reliability.
-.PP
-One interesting and encouraging fact is that
-programs written in
-Ratfor
-tend to be as readable as programs
-written in more modern languages
-like Pascal.
-Once one is freed from the shackles of Fortran's
-clerical detail and rigid input format,
-it is easy to write code that is readable, even esthetically pleasing.
-For example,
-here is a
-Ratfor
-implementation of the linear table search discussed by
-Knuth [7]:
-.P1
-A(m+1) = x
-for (i = 1; A(i) != x; i = i + 1)
-       ;
-if (i > m) {
-       m = i
-       B(i) = 1
-}
-else
-       B(i) = B(i) + 1
-.P2
-A large corpus (5400 lines) of Ratfor, including a subset of
-the Ratfor preprocessor itself,
-can be found in
-[8].
-.SH
-Bad Things
-.PP
-The biggest single problem is that many Fortran syntax errors
-are not detected by
-Ratfor
-but by the local Fortran compiler.
-The compiler then prints a message
-in terms of the generated Fortran,
-and in a few cases this may be difficult
-to relate back to the offending
-Ratfor
-line,
-especially if the implementation conceals the generated Fortran.
-This problem could be dealt with
-by tagging each generated line with some indication
-of the source line that created it,
-but this is inherently implementation-dependent,
-so no action has yet been taken.
-Error message interpretation
-is actually not so arduous as might be thought.
-Since Ratfor generates no variables,
-only a simple pattern of
-.UC IF 's
-and
-.UC GOTO 's,
-data-related errors like missing
-.UC DIMENSION
-statements
-are easy to find in the Fortran.
-Furthermore, there has been a steady improvement
-in Ratfor's ability to catch trivial syntactic
-errors like unbalanced parentheses and quotes.
-.PP
-There are a number of implementation weaknesses
-that are a nuisance, especially to new users.
-For example,
-keywords are reserved.
-This rarely makes any difference, except for those hardy souls
-who want to use an Arithmetic 
-.UC IF .
-A few standard Fortran
-constructions are not accepted by 
-Ratfor,
-and this is perceived as a problem by users with a large corpus
-of existing Fortran programs.
-Protecting every line with a `%' is not really a
-complete solution, although it serves as a stop-gap.
-The best long-term solution is provided by the program
-Struct [9],
-which converts arbitrary Fortran programs into Ratfor.
-.PP
-Users who export programs often complain that the generated Fortran is
-``unreadable'' because it is not 
-tastefully formatted and contains extraneous
-.UC CONTINUE
-statements.
-To some extent this can be ameliorated
-(Ratfor now has an option to copy Ratfor comments into
-the generated Fortran),
-but it has always seemed that effort is better spent
-on the input language than on the output esthetics.
-.PP
-One final problem is partly attributable to success _
-since Ratfor is relatively easy to modify,
-there are now several dialects of Ratfor.
-Fortunately, so far most of the differences are in character set,
-or in invisible aspects like code generation.
diff --git a/.ref-Research-V7/usr/doc/ratfor/m5 b/.ref-Research-V7/usr/doc/ratfor/m5
deleted file mode 100644 (file)
index 0b79021..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.NH
-CONCLUSIONS
-.PP
-Ratfor
-demonstrates that with modest effort
-it is possible to convert Fortran
-from a bad language into quite a good one.
-A preprocessor 
-is clearly a useful way to extend or ameliorate
-the facilities of a base language.
-.PP
-When designing a language,
-it is important to concentrate on
-the essential requirement of providing
-the user with the best language possible
-for a given effort.
-One must avoid throwing in
-``features'' _
-things which the user may trivially construct within the existing
-framework.
-.PP
-One must also avoid getting sidetracked on irrelevancies.
-For instance it seems pointless for
-Ratfor
-to prepare a neatly formatted
-listing of either its input or its output.
-The user is presumably capable of the self-discipline required
-to prepare neat input
-that reflects his thoughts.
-It is much more important that the language provide free-form input
-so he
-.ul
-can
-format it neatly.
-No one should read the output anyway
-except in the most dire circumstances.
-.SH
-Acknowledgements
-.PP
-C. A. R. Hoare
-once said that
-``One thing [the language designer] should not do
-is to include untried ideas of his own.''
-Ratfor
-follows this precept very closely _
-everything in it has been stolen from someone else.
-Most of the control flow structures
-are taken directly from the language C[4]
-developed by Dennis Ritchie;
-the comment and continuation
-conventions are adapted from Altran[10].
-.PP
-I am grateful to Stuart Feldman,
-whose patient simulation of an innocent user
-during the early days of Ratfor
-led to several design improvements
-and the eradication of bugs.
-He also translated the C parse-tables
-and
-.UC YACC 
-parser
-into Fortran for the
-first
-Ratfor
-version of
-Ratfor.
diff --git a/.ref-Research-V7/usr/doc/ratfor/m9 b/.ref-Research-V7/usr/doc/ratfor/m9
deleted file mode 100644 (file)
index 1dbad0c..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-.SH
-References
-.IP [1]
-B. G. Ryder,
-``The PFORT Verifier,''
-.ul
-Software_Practice & Experience,
-October 1974.
-.IP [2]
-American National Standard Fortran.
-American National Standards Institute,
-New York, 1966.
-.IP [3]
-.ul
-For-word: Fortran Development Newsletter,
-August 1975.
-.IP [4]
-B. W. Kernighan and D. M. Ritchie,
-.ul
-The C Programming Language,
-Prentice-Hall, Inc., 1978.
-.IP [5]
-D. M. Ritchie and K. L. Thompson,
-``The UNIX Time-sharing System.''
-\fICACM\fP, July 1974.
-.IP [6]
-S. C. Johnson,
-``YACC _ Yet Another Compiler-Compiler.''
-Bell Laboratories Computing Science Technical Report #32,
-1978.
-.IP [7]
-D. E. Knuth,
-``Structured Programming with goto Statements.''
-\fIComputing Surveys\fP, December 1974.
-.IP [8]
-B. W. Kernighan and P. J. Plauger,
-.ul
-Software Tools,
-Addison-Wesley, 1976.
-.IP [9]
-B. S. Baker,
-``Struct _ A Program which Structures Fortran'',
-Bell Laboratories internal memorandum, December 1975.
-.IP [10]
-A. D. Hall,
-``The Altran System for Rational Function Manipulation _
-A Survey.''
-\fICACM\fP, August 1971.
diff --git a/.ref-Research-V7/usr/doc/ratfor/m99 b/.ref-Research-V7/usr/doc/ratfor/m99
deleted file mode 100644 (file)
index d13bfa7..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-.bp
-.if t .1C
-.SH
-Appendix: Usage on
-.UC UNIX 
-and
-.UC GCOS .
-.PP
-Beware _
-local customs vary.
-Check with a native before going into the jungle.
-.SH
-UNIX
-.PP
-The program
-.UL ratfor
-is the basic translator; it takes either a list
-of file names or the standard input and writes
-Fortran on the standard output.
-Options include
-.UL \-6x ,
-which uses
-.UL x
-as a continuation character in column 6
-.UC UNIX "" (
-uses 
-.UL & 
-in column 1),
-and
-.UL \-C ,
-which causes Ratfor comments to be copied into
-the generated Fortran.
-.PP
-The program
-.UL rc
-provides an interface to the
-.UL ratfor
-command which is much the same as
-.UL cc .
-Thus
-.P1
-rc [options] files
-.P2
-compiles the files specified by
-.UL files .
-Files with names ending in
-.UL \&.r
-are Ratfor source; other files are assumed to
-be for the loader.
-The flags
-.UL \-C 
-and
-.UL \-6x
-described above are recognized, as are
-.P1
--c     compile only; don't load
--f     save intermediate Fortran .f files
--r     Ratfor only; implies -c and -f
--2     use big Fortran compiler (for large programs)
--U     flag undeclared variables (not universally available)
-.P2
-Other flags are passed on to the loader.
-.SH
-GCOS
-.PP
-The program
-.UL \&./ratfor
-is the bare translator, and is identical to the
-.UC UNIX
-version, except that the continuation convention
-is 
-.UL &
-in column 6.
-Thus
-.P1
-\&./ratfor  files  >output
-.P2
-translates the Ratfor source on
-.UL files 
-and
-collects the generated Fortran on file
-`output'
-for subsequent processing.
-.PP
-.UL \&./rc
-provides much the same services as
-.UL rc 
-(within the limitations of
-.UC GCOS ),
-regrettably with a somewhat different syntax.
-Options recognized by
-.UL ./rc
-include
-.P1
-.ta 1.2i
-name   Ratfor source or library, depending on type
-h=/name        make TSS H* file (runnable version); run as /name
-r=/name        update and use random library
-a=     compile as ascii (default is bcd)
-C=     copy comments into Fortran
-f=name Fortran source file
-g=name gmap source file
-.P2
-Other options are as specified for the
-.UL \&./cc
-command described in [4].
-.SH
-TSO, TSS, and other systems
-.PP
-Ratfor exists on
-various other systems;
-check with the author for specifics.
diff --git a/.ref-Research-V7/usr/doc/refer/pubuse b/.ref-Research-V7/usr/doc/refer/pubuse
deleted file mode 100644 (file)
index d07abee..0000000
+++ /dev/null
@@ -1,675 +0,0 @@
-..... use tbl and troff \-ms
-.if \nP=0 .IM
-.TL
-Updating Publication Lists
-.AU
-M. E. Lesk
-.NH
-Introduction.
-.PP
-.\".if \nP>0 .pn 14
-This note describes several commands to update the
-publication lists.
-The data base consisting of these lists is kept in
-a set of files in
-the directory
-.I /usr/dict/papers
-on the Version 7
-.UX
-system.
-The reason for having special commands to update these files is
-that they are indexed, and the only reasonable way to find the
-items to be updated is to use the index.
-However, altering the files
-destroys the usefulness of the index,
-and makes further editing difficult.
-So the recommended procedure is to
-.IP (1)
-Prepare additions, deletions, and changes in separate files.
-.IP (2)
-Update the data base and reindex.
-.LP
-Whenever you make changes, etc. it is necessary to run
-the ``add & index'' step before logging off; otherwise the
-changes do not take effect.
-The next section shows the format of the files
-in the data base.
-After that, the procedures for
-preparing additions, preparing changes, preparing deletions,
-and updating the public data base are given.
-.NH
-Publication Format.
-.PP
-The format of a data base entry is given completely in ``Some Applications
-of Inverted Indexes on UNIX'' by M. E. Lesk,
-the first part of this report,
-.if \nP=0 (also TM 77-1274-17)
-and is summarized here via a few examples.
-In each example, first the output format for an item is shown,
-and then the corresponding data base entry.
-.LP
-.DS
-.ti 0
-Journal article:
-.fi
-.ll 5i
-A. V. Aho, D. J. Hirschberg, and J. D. Ullman, ``Bounds
-on the Complexity of the Maximal Common Subsequence Problem,''
-.I
-J. Assoc. Comp. Mach.,
-.R
-vol. 23, no. 1, pp. 1-12 (Jan. 1976).
-.nf
-.ll
-.sp
-%T Bounds on the Complexity of the Maximal Common
-Subsequence Problem
-%A A. V. Aho
-%A D. S. Hirschberg
-%A J. D. Ullman
-%J J. Assoc. Comp. Mach.
-%V 23
-%N 1
-%P 1-12
-%D Jan. 1976
-.if \nP=0 %M TM 75-1271-7
-.if \nP>0 %M Memo abcd...
-.DE
-.DS
-.ti 0
-Conference proceedings:
-.fi
-.ll 5i
-B. Prabhala and R. Sethi, ``Efficient Computation of Expressions with Common
-Subexpressions,''
-.I
-Proc. 5th ACM Symp. on Principles of Programming Languages,
-.R
-pp. 222-230, Tucson, Ariz. (January 1978).
-.nf
-.ll
-.sp
-%A B. Prabhala
-%A R. Sethi
-%T Efficient Computation of Expressions with
-Common Subexpressions
-%J Proc. 5th ACM Symp. on Principles
-of Programming Languages
-%C Tucson, Ariz.
-%D January 1978
-%P 222-230
-.DE
-.DS
-.ti 0
-Book:
-.fi
-.ll 5i
-B. W. Kernighan and P. J. Plauger,
-.I
-Software Tools,
-.R
-Addison-Wesley, Reading, Mass. (1976).
-.nf
-.ll
-.sp
-%T Software Tools
-%A B. W. Kernighan
-%A P. J. Plauger
-%I Addison-Wesley
-%C Reading, Mass.
-%D 1976
-.DE
-.DS
-.ti 0
-Article within book:
-.fi
-.ll 5i
-J. W. de Bakker, ``Semantics of Programming Languages,''
-pp. 173-227 in
-.I
-Advances in Information Systems Science, Vol. 2,
-.R
-ed. J. T. Tou, Plenum Press, New York, N. Y. (1969).
-.nf
-.ll
-.sp
-%A J. W. de Bakker
-%T Semantics of programming languages
-%E J. T. Tou
-%B Advances in Information Systems Science, Vol. 2
-%I Plenum Press
-%C New York, N. Y.
-%D 1969
-%P 173-227
-.DE
-.DS
-.ti 0
-Technical Report:
-.fi
-.ll 5i
-F. E. Allen, ``Bibliography on Program Optimization,''
-Report RC-5767, IBM T. J. Watson Research Center,
-Yorktown Heights, N. Y. (1975).
-.nf
-.ll
-.sp
-%A F. E. Allen
-%D 1975
-%T Bibliography on Program Optimization
-%R Report RC-5767
-%I IBM T. J. Watson Research Center
-%C Yorktown Heights, N. Y.
-.DE
-.DS
-.di xx
-.ti 0
-Technical Memorandum:
-.fi
-.ll 5i
-A. V. Aho, B. W. Kernighan and P. J. Weinberg,
-``AWK \- Pattern Scanning and Processing Language'',
-TM 77-1271-5, TM 77-1273-12, TM 77-3444-1 (1977).
-.nf
-.ll
-.sp
-%T AWK \- Pattern Scanning and Processing Language
-%A A. V. Aho
-%A B. W. Kernighan
-%A P. J. Weinberger
-%M TM 77-1271-5, TM 77-1273-12, TM 77-3444-1
-%D 1977
-.di
-.if \nP=0 .xx
-.rm xx
-.DE
-.LP
-Other forms of publication can be entered similarly.
-Note that conference
-proceedings are entered as if journals,
-with the conference name on a
-.I %J
-line.
-This is also sometimes appropriate for obscure publications
-such as series of lecture notes.
-When something is both a report and an article, or
-both a memorandum and an article, enter all necessary information
-for both; see the first article above, for example.
-Extra information (such as ``In preparation'' or ``Japanese translation'')
-should be placed on a line beginning
-.I %O .
-The most common use of %O lines now is for ``Also in ...'' to give
-an additional reference to a secondary appearance of the same paper.
-.PP
-Some of the possible fields of a citation are:
-.TS
-c c 5 c c
-a l   a l .
-Letter Meaning Letter  Meaning
-A      Author  K       Extra keys
-B      Book including item     N       Issue number
-C      City of publication     O       Other
-D      Date    P       Page numbers
-E      Editor of book  R       Report number
-I      Publisher (issuer)      T       Title of item
-J      Journal name    V       Volume number
-.TE
-Note that
-.I %B
-is used to indicate the title
-of a book containing the article being entered;
-when an item is an entire book, the title should
-be entered with a
-.I %T
-as usual.
-.PP
-Normally, the order of items does not matter.  The only exception is
-that if there are multiple authors (%A lines) the order of authors
-should be that on the paper.
-If a line is too long, it may be continued on to the next line;
-any line not beginning with % or . (dot) is assumed to be
-a continuation of the previous line.
-Again, see the first article above for an example of a long title.
-Except for authors, do not repeat any items; if two %J lines are
-given, for example, the first is ignored.
-Multiple items on the same file should be separated by blank lines.
-.PP
-Note that in formatted printouts of the file, the
-exact appearance of the items is determined by
-a set of macros and the formatting programs.
-Do not try to adjust fonts, punctuation, etc. by editing
-the data base; it is wasted effort.  In case someone has
-a real need for a differently-formatted output, a new set
-of macros can easily be generated to provide alternative
-appearances of the citations.
-.NH
-Updating and Re-indexing.
-.PP
-This section describes the commands that are used to manipulate
-and change the data base.
-It explains the procedures for (a) finding references in the data base,
-(b) adding new references, (c) changing existing references, and (d)
-deleting references.
-Remember that all changes, additions, and deletions are done by preparing
-separate files and then running an `update and reindex' step.
-.PP
-.I
-Checking what's there now.
-.R
-Often you will want to know what is currently in the data base.
-There is a special command
-.I lookbib
-to look for things and print them
-out.
-It searches for articles based on words in the title, or the author's name,
-or the date.
-For example, you could find the first paper above with
-.DS
-lookbib aho ullman maximal subsequence 1976
-.DE
-or
-.DS
-lookbib aho ullman hirschberg
-.DE
-.LP
-If you don't give enough words, several items will be found;
-if you spell some wrong, nothing will be found.
-There are around 4300 papers in the public file; you should
-always use this command to check when you are not sure
-whether a certain paper is there or not.
-.PP
-.I
-Additions.
-.R
-To add new papers, just type in, on one or more files, the citations
-for the new papers.
-Remember to check first if the papers are already in the data base.
-For example, if a paper has a previous memo version, this should
-be treated as a change to an existing entry, rather than
-a new entry.
-If several new papers are being typed on the same file, be
-sure that there is a blank line between each two papers.
-.PP
-.I
-Changes.
-.R
-To change an item, it should be extracted onto a file.
-This is done with the command
-.DS
-pub.chg key1 key2 key3 ...
-.DE
-where the items key1, key2, key3, etc. are
-a set of keys that will find the paper,
-as in the
-.I lookbib
-command.
-That is, if
-.DS
-lookbib johnson yacc cstr
-.DE
-will find a item (to, in this case, Computing Science Technical Report
-No. 32, ``YACC: Yet Another Compiler-Compiler,''
-by S. C. Johnson)
-then
-.DS
-pub.chg johnson yacc cstr
-.DE
-will permit you to edit the item.
-The
-.I pub.chg
-command
-extracts the item onto a file named ``bibxxx'' where ``xxx''
-is a 3-digit number, e.g. ``bib234''.
-The command will print the file name it has chosen.
-If the set of keys finds more than one paper (or no papers) an
-error message is printed and no file is written.
-Each reference to be changed must be extracted with a separate
-.I pub.chg
-command, and each will be placed on a separate file.
-You should then edit the ``bibxxx'' file as desired to change the item,
-using the UNIX editor.
-Do not delete or change the first line of the file, however, which begins
-.I %#
-and is a special code line to tell the update program
-which item is being altered.
-You may delete or change other lines, or add lines, as you wish.
-The changes are not actually made in the public data
-base until you run the update command
-.I pub.run
-(see below).
-Thus, if after extracting an item and modifying it, you decide
-that you'd rather leave things as they were, delete the
-``bibxxx'' file, and your change request will disappear.
-.PP
-.I
-Deletions.
-.R
-To delete an entry from the data base,
-type the command
-.DS
-pub.del key1 key2 key3 ...
-.DE
-where the items key1, key2, etc. are a set
-of keys that will find the paper, as with the
-.I lookbib
-command.
-That is, if
-.DS
-lookbib aho hirschberg ullman
-.DE
-will find a paper,
-.DS
-pub.del aho hirschberg ullman
-.DE
-deletes it.
-Upper and lower case are equivalent in keys;
-the command
-.DS
-pub.del Aho Hirschberg Ullman
-.DE
-is an equivalent
-.I pub.del
-command.
-The
-.I pub.del
-command will print the entry being deleted.
-It also gives the name of a ``bibxxx'' file on which the deletion
-command is stored.
-The actual deletion is not done until the changes, additions, etc.
-are processed, as with the
-.I pub.chg
-command.
-If, after seeing the item to be deleted, you change your
-mind about throwing it away, delete the ``bibxxx'' file
-and the delete request disappears.
-Again, if the list of keys does not uniquely identify one paper,
-an error message is given.
-.PP
-Remember that the default versions of the commands described here
-edit a public data base.
-Do not delete
-items unless you are sure deletion is proper; usually this
-means that there are duplicate entries for the same paper.
-Otherwise, view requests for deletion with skepticism; even
-if one person has no need for a particular item in the data base,
-someone else may want it there.
-.PP
-If an item is correct, but should not appear in the ``List of Publications''
-as normally produced, add the line
-.DS
-%K DNL
-.DE
-to the item.
-This preserves the item intact, but implies ``Do Not List'' to the
-to the commands that print publication lists.
-The DNL line is normally used for some technical reports,
-minor memoranda, or other
-low-grade publications.
-.PP
-.I
-Update and reindex.
-.R
-When you have completed a session of changes, you should
-type the command
-.DS
-pub.run file1 file2 ...
-.DE
-where the names ``file1'', ... are the new files of additions you
-have prepared.
-You need not list the ``bibxxx'' files representing changes and
-deletions; they are processed automatically.
-All of the new items are edited into the standard
-public data base, and then a new index is made.  This process
-takes about one minute of processor time.
-The index is not made by re-analyzing and re-sorting the
-entire data base; the new or changed items are indexed
-in the usual way and then merged with the previous data files.
-A complete re-index would be much slower for small changes.
-.PP
-Normally, you should execute
-.I pub.run
-just before you logoff after performing
-some edit requests.
-However, if you don't, the various change request files remain
-in your directory
-until you finally do execute
-.I pub.run.
-When the changes are processed, the ``bibxxx'' files are deleted.
-It is not desirable to wait too long before processing changes,
-however, to avoid conflicts with someone else who wishes to change
-the same file.
-If executing
-.I pub.run
-produces the message ``File bibxxx too old''
-it means that someone else has been editing the same file
-between the time you prepared your changes, and the time you typed
-.I pub.run.
-You must delete such old change files and
-re-enter them.
-.PP
-Note that although
-.I pub.run
-discards the ``bibxxx'' files after
-processing them, your files of additions are left around
-even after
-.I pub.run
-is finished.
-If they were typed in only for purposes of
-updating the data base, you may delete them
-after they have been processed by
-.I pub.run.
-.PP
-.I
-Example.
-.R
-Suppose, for example, that you wish to
-.IP (1)
-Add to the data base the memos ``The Dilogarithm Function of a Real Argument''
-by R. Morris, and
-``UNIX Software Distribution by Communication Link,''
-by M. E. Lesk and A. S. Cohen;
-.IP (2)
-Delete from the data base the item
-``Cheap Typesetters'', by M. E. Lesk,
-SIGLASH Newsletter, 1973;
-and
-.IP (3)
-Change ``J. Assoc. Comp. Mach.'' to ``Jour. ACM'' in the citation
-for Aho, Hirschberg, and Ullman shown above.
-.LP
-The procedure would be as follows.
-First, you would make a file
-containing the additions,
-here called ``new.1'', in the normal way using the UNIX editor.
-In the script shown below, the computer prompts are
-.if n underlined.
-.if t in italics.
-.DS
-.if n _\b$ ed new.1
-.if t \f2$\f1 ed new.1
-.if n _\b?
-.if t \f2?\f1
-a
-%T The Dilogarithm Function of a Real Argument
-%A Robert Morris
-.if \nP=0 %M TM 78-1271-1
-.if \nP>0 %M abcd
-%D 1978
-
-%T UNIX Software Distribution by Communication Link
-%A M. E. Lesk
-%A A. S. Cohen
-.if \nP=0 %M TM 78-1274-1, 78-8234-1
-.if \nP>0 %M abcd
-%D 1978
-.
-w new.1
-.if n _\b1_\b9_\b9
-.if t \f2199\f1
-q
-.DE
-Next you would specify the deletion, which would be done with the
-.I pub.del
-command:
-.DS
-.if n _\b$ pub.del lesk cheap typesetters siglash
-.if t \f2$\f1 pub.del lesk cheap typesetters siglash
-.ti 0
-to which the computer responds:
-
-.if n W\b_i\b_l\b_l\b_ d\b_e\b_l\b_e\b_t\b_e\b_:\b_  (\b_f\b_i\b_l\b_e\b_ b\b_i\b_b\b_1\b_7\b_6\b_)\b_
-.if t \f2Will delete:  (file bib176)\f1
-
-.if n %\b_T\b_ C\b_h\b_e\b_a\b_p\b_ T\b_y\b_p\b_e\b_s\b_e\b_t\b_t\b_e\b_r\b_s\b_
-.if t \f2%T Cheap Typesetters\f1
-.if n %\b_A\b_ M\b_.\b_ E\b_.\b_ L\b_e\b_s\b_k\b_
-.if t \f2%A M. E. Lesk\f1
-.if n %\b_J\b_ A\b_C\b_M\b_ S\b_I\b_G\b_L\b_A\b_S\b_H\b_ N\b_e\b_w\b_s\b_l\b_e\b_t\b_t\b_e\b_r\b_
-.if t \f2%J ACM SIGLASH Newsletter\f1
-.if n %\b_V\b_ 6\b_
-.if t \f2%V 6\f1
-.if n %\b_N\b_ 4\b_
-.if t \f2%N 4\f1
-.if n %\b_P\b_ 1\b_4\b_-\b_1\b_6\b_
-.if t \f2%P 14-16\f1
-.if n %\b_D\b_ O\b_c\b_t\b_o\b_b\b_e\b_r\b_ 1\b_9\b_7\b_3\b_
-.if t \f2%D October 1973\f1
-.DE
-And then you would extract the Aho, Hirschberg and Ullman paper.
-The dialogue involved is shown below.
-First run
-.I pub.chg
-to extract the paper; it responds by printing
-the citation and informing you that it was placed on file \f2bib123\f1.
-That file is then edited.
-.DS
-.if n _\b$ pub.chg aho hirschberg ullman
-.if t \f2$\f1 pub.chg aho hirschberg ullman
-.if n _\bE_\bx_\bt_\br_\ba_\bc_\bt_\bi_\bn_\bg _\ba_\bs _\bf_\bi_\bl_\be _\bb_\bi_\bb_\b1_\b2_\b3
-.if t \f2Extracting as file bib123\f1
-.if n _\b%_\bT _\bB_\bo_\bu_\bn_\bd_\bs _\bo_\bn _\bt_\bh_\be _\bC_\bo_\bm_\bp_\bl_\be_\bx_\bi_\bt_\by _\bo_\bf _\bt_\bh_\be _\bM_\ba_\bx_\bi_\bm_\ba_\bl
-.if t \f2%T Bounds on the Complexity of the Maximal\f1
-.if n _\bC_\bo_\bm_\bm_\bo_\bn _\bS_\bu_\bb_\bs_\be_\bq_\bu_\be_\bn_\bc_\be _\bP_\br_\bo_\bb_\bl_\be_\bm
-.if t \f2Common Subsequence Problem\f1
-.if n _\b%_\bA _\bA_\b. _\bV_\b. _\bA_\bh_\bo
-.if t \f2%A A. V. Aho\f1
-.if n _\b%_\bA _\bD_\b. _\bS_\b. _\bH_\bi_\br_\bs_\bc_\bh_\bb_\be_\br_\bg
-.if t \f2%A D. S. Hirschberg\f1
-.if n _\b%_\bA _\bJ_\b. _\bD_\b. _\bU_\bl_\bl_\bm_\ba_\bn
-.if t \f2%A J. D. Ullman\f1
-.if n _\b%_\bJ _\bJ_\b. _\bA_\bs_\bs_\bo_\bc_\b. _\bC_\bo_\bm_\bp_\b. _\bM_\ba_\bc_\bh_\b.
-.if t \f2%J J. Assoc. Comp. Mach.\f1
-.if n _\b%_\bV _\b2_\b3
-.if t \f2%V 23\f1
-.if n _\b%_\bN _\b1
-.if t \f2%N 1\f1
-.if n _\b%_\bP _\b1_\b-_\b1_\b2
-.if t \f2%P 1-12\f1
-.if \nP=0 .if n _\b%_\bM _\bT_\bM _\b7_\b5_\b-_\b1_\b2_\b7_\b1_\b-_\b7
-.if \nP>0 .if n %\b_M\b_ M\b_e\b_m\b_o\b_ n\b_u\b_m\b_b\b_e\b_r\b_
-.if \nP=0 .if t \f2%M TM 75-1271-7\f1
-.if \nP>0 .if t \f2%M abcd\f1
-.if n _\b%_\bD _\bJ_\ba_\bn_\b. _\b1_\b9_\b7_\b6
-.if t \f2%D Jan. 1976\f1
-
-.if n _\b$ ed bib123
-.if t \f2$\f1 ed bib123
-.if n _\b3_\b1_\b2
-.if t \f2312\f1
-/Assoc/s/ J/ Jour/p
-.if n _\b%_\bJ _\bJ_\bo_\bu_\br_\b. _\bA_\bs_\bs_\bo_\bc_\b. _\bC_\bo_\bm_\bp_\b. _\bM_\ba_\bc_\bh_\b.
-.if t \f2%J Jour. Assoc. Comp. Mach.\f1
-s/Assoc.*/ACM/p
-.if n _\b%_\bJ _\bJ_\bo_\bu_\br_\b. _\bA_\bC_\bM
-.if t \f2%J Jour. ACM\f1
-1,$p
-.if n _\b%_\b# _\b/_\bu_\bs_\br_\b/_\bd_\bi_\bc_\bt_\b/_\bp_\ba_\bp_\be_\br_\bs_\b/_\bp_\b7_\b6 _\b2_\b3_\b3 _\b2_\b4_\b5 _\bc_\bh_\ba_\bn_\bg_\be
-.if t \f2%# /usr/dict/papers/p76 233 245 change\f1
-.if n _\b%_\bT _\bB_\bo_\bu_\bn_\bd_\bs _\bo_\bn _\bt_\bh_\be _\bC_\bo_\bm_\bp_\bl_\be_\bx_\bi_\bt_\by _\bo_\bf _\bt_\bh_\be _\bM_\ba_\bx_\bi_\bm_\ba_\bl
-.if t \f2%T Bounds on the Complexity of the Maximal\f1
-.if n _\bC_\bo_\bm_\bm_\bo_\bn _\bS_\bu_\bb_\bs_\be_\bq_\bu_\be_\bn_\bc_\be _\bP_\br_\bo_\bb_\bl_\be_\bm
-.if t \f2Common Subsequence Problem\f1
-.if n _\b%_\bA _\bA_\b. _\bV_\b. _\bA_\bh_\bo
-.if t \f2%A A. V. Aho\f1
-.if n _\b%_\bA _\bD_\b. _\bS_\b. _\bH_\bi_\br_\bs_\bc_\bh_\bb_\be_\br_\bg
-.if t \f2%A D. S. Hirschberg\f1
-.if n _\b%_\bA _\bJ_\b. _\bD_\b. _\bU_\bl_\bl_\bm_\ba_\bn
-.if t \f2%A J. D. Ullman\f1
-.if n _\b%_\bJ _\bJ_\bo_\bu_\br_\b. _\bA_\bC_\bM
-.if t \f2%J Jour. ACM\f1
-.if n _\b%_\bV _\b2_\b3
-.if t \f2%V 23\f1
-.if n _\b%_\bN _\b1
-.if t \f2%N 1\f1
-.if n _\b%_\bP _\b1_\b-_\b1_\b2
-.if t \f2%P 1-12\f1
-.if \nP=0 .if n _\b%_\bM _\bT_\bM _\b7_\b5_\b-_\b1_\b2_\b7_\b1_\b-_\b7
-.if \nP>0 .if n _\b%_\bM _\bM_\be_\bm_\bo _\bn_\bu_\bm_\bb_\be_\br
-.if \nP=0 .if t \f2%M TM 75-1271-7\f1
-.if \nP>0 .if t \f2%M abcd\f1
-.if n _\b%_\bD _\bJ_\ba_\bn_\b. _\b1_\b9_\b7_\b6
-.if t \f2%D Jan. 1976\f1
-
-w
-.if n _\b2_\b9_\b2
-.if t \f2292\f1
-q
-.if n _\b$
-.if t \f2$\f1
-.DE
-Finally, execute
-.I pub.run ,
-making sure to remember that you
-have prepared a new file ``new.1'':
-.DS
-\f2$\f1 pub.run new.1
-.DE
-Currently, this takes about 1 minute of 11/70 processor time.
-.NH
-Printing a Publication List
-.PP
-There are two commands for printing a publication list,
-depending on whether you want to print one person's list,
-or the list of many people.
-To print a list for one person, use the
-.I pub.indiv
-command:
-.DS
-pub.indiv M Lesk
-.DE
-This runs off the list for M. Lesk and puts it in file ``output''.
-Note that no `.' is given after the initial.
-In case of ambiguity two initials can be used.
-Similarly, to get the list for group of people, say
-.DS
-pub.org xxx
-.DE
-which prints all the publications of the members of organization
-.I xxx ,
-taking the names for the list in the file
-.I /usr/dict/papers/centlist/xxx .
-This command should normally be run in the background; it takes
-perhaps 15 minutes.
-Two options are available with these commands:
-.DS
-pub.indiv \-p M Lesk
-.DE
-prints only the papers, leaving out unpublished notes, patents, etc.
-Also
-.DS
-pub.indiv \-t M Lesk | gcat
-.DE
-prints a typeset copy, instead of a computer printer copy.
-In this case it has been directed to an alternate typesetter with the
-`gcat' command.
-These options may be used together, and may be used with the
-.I pub.org
-command as well.
-For example, to print
-only the papers for all of organization zzz and typeset them,
-you could type
-.DS
-pub.center \-t \-p zzz | gcat &
-.DE
-These publication lists are printed double column with a citation style
-taken from a set of publication list macros; the macros, of course, can be
-changed easily to adjust the format of the lists.
diff --git a/.ref-Research-V7/usr/doc/refer/refer b/.ref-Research-V7/usr/doc/refer/refer
deleted file mode 100644 (file)
index 6d9cc8c..0000000
+++ /dev/null
@@ -1,1609 +0,0 @@
-.... refer | tbl | nroff -ms
-.de UC
-\\s-2\\$1\\s0\\$2
-..
-.ds . \&\s+2.\s0
-.if t .ds -- \(em
-.if n .ds -- --
-.TR 69
-.TM 77-1274-17 39199 39199-11
-.ND October 27, 1977
-.ND June 21, 1978
-.TL
-Some Applications of Inverted Indexes on the UNIX System
-.AU "MH 2C-572" 6377
-M. E. Lesk
-.AI
-.MH
-.AB
-.LP
-.ft B
-I. Some Applications of Inverted Indexes \- Overview
-.ft R
-.PP
-This memorandum describes a set of programs which
-make inverted indexes to
-UNIX*
-text files, and their
-application to
-retrieving and formatting citations for documents prepared using
-.I troff.
-.PP
-These indexing and searching programs make keyword
-indexes to volumes of material too large for linear searching.
-Searches for combinations of single words can be performed quickly.
-The programs are divided into
-two phases.  The first makes an index from the original
-data; the second searches the index and retrieves
-items.
-Both of these phases are further divided into two parts
-to separate the data-dependent and algorithm dependent
-code.
-.PP
-The major current application of these programs is
-the
-.I troff
-preprocessor
-.I refer.
-A list of 4300 references is maintained on line,
-containing primarily papers written and cited by
-local authors.
-Whenever one of these references is required
-in a paper, a few words from the title or author list
-will retrieve it, and the user need not bother to re-enter
-the exact citation.
-Alternatively, authors can use their own lists of papers.
-.PP
-This memorandum is of interest to
-those who are interested in facilities for searching large
-but relatively unchanging text files on
-the
-UNIX
-system,
-and those who are interested in handling bibliographic
-citations with
-UNIX
-.I troff.
-.LP
-.ft B
-II. Updating Publication Lists
-.PP
-This section is a brief note describing the
-auxiliary programs for managing the updating
-processing.
-It is written to aid clerical users in
-maintaining lists of references.
-Primarily, the programs described permit a large
-amount of individual control over the content
-of publication lists while retaining the
-usefulness of the files to other users.
-.LP
-.ft B
-III. Manual Pages
-.PP
-This section contains the pages from the
-UNIX programmer's manual
-for the
-.I lookall,
-.I pubindex,
-and
-.I refer
-commands.
-It is useful for reference.
-.sp
-\l'3i'
-.br
-* UNIX is a Trademark of Bell Laboratories.
-.AE
-.CS 10 4 14 0 0 4
-.NH
-Introduction.
-.PP
-The
-.UX
-system
-has many utilities
-(e.g. \fIgrep, awk, lex, egrep, fgrep, ...\fR)
-to search through files of text,
-but most of them are based on a linear scan through the
-entire file, using some deterministic automaton.
-.ev 1
-.ps 8
-.vs 10p
-.ev
-This memorandum discusses a program which uses inverted
-indexes
-.[
-%A D. Knuth
-%T The Art of Computer Programming: Vol. 3, Sorting and Searching
-%I Addison-Wesley
-%C Reading, Mass.
-%D 1977
-%O See section 6.5.
-.]
-and can thus be used on much larger data bases.
-.PP
-As with any indexing system, of course, there are some disadvantages;
-once an index is made, the files that have been indexed can not be changed
-without remaking the index.
-Thus applications are restricted
-to those making many searches
-of relatively stable data.
-Furthermore, these programs depend on hashing, and can only
-search for exact matches of whole keywords.
-It is not possible to look for
-arithmetic or logical expressions (e.g. ``date greater than 1970'') or
-for regular expression searching such as that in
-.I lex.
-.[
-lex lesk cstr
-.]
-.PP
-Currently there are two uses of this software,
-the
-.I refer
-preprocessor to format references,
-and the
-.I lookall
-command to search through all text files on
-the
-.UX
-system.
-.PP
-The remaining sections of this memorandum discuss
-the searching programs and their uses.
-Section 2 explains the operation of the searching algorithm and describes
-the data collected for use with the
-.I lookall
-command.
-The more important application,
-.I refer
-has a user's description in section 3.
-Section 4 goes into more detail on
-reference files
-for the benefit of those who
-wish to add references to data bases or
-write new
-.I troff
-macros for use with
-.I refer.
-The options to make
-.I refer
-collect identical citations, or otherwise relocate and adjust references,
-are described in section 5.
-The
-.UX
-manual sections for
-.I "refer, lookall,"
-and associated commands are attached as appendices.
-.NH
-Searching.
-.PP
-The indexing and searching process is divided into two phases,
-each made of two parts.
-These are
-shown below.
-.IP A.
-Construct the index.
-.RS
-.IP (1)
-Find keys \*(-- turn the input files into a sequence of tags and keys,
-where each tag identifies a distinct item in the input
-and the keys for each such item are the strings under which it is
-to be indexed.
-.IP (2)
-Hash and sort \*(--
-prepare a set of inverted indexes from which, given a set of keys,
-the appropriate item tags can be found quickly.
-.RE
-.IP B.
-Retrieve an item in response to a query.
-.RS
-.IP (3)
-Search \*(--
-Given some keys, look through the files prepared by the hashing
-and sorting facility and derive the appropriate tags.
-.IP (4)
-Deliver \*(--
-Given the tags, find the original items.  This completes the
-searching process.
-.RE
-.LP
-The first phase, making the index, is presumably done relatively infrequently.
-It should, of course, be done whenever the data being
-indexed change.
-In contrast, the second phase, retrieving items,
-is presumably done often, and must be rapid.
-.PP
-An effort is made to separate code which depends on the data
-being handled from code which depends on the searching procedure.
-The search algorithm is involved only in steps
-(2) and (3), while knowledge of the actual data files is
-needed only by steps (1) and (4).
-Thus it is easy to adapt to different data files or different
-search algorithms.
-.PP
-To start with, it is necessary to have some way of selecting
-or generating keys from input files.
-For dealing with files that are basically English, we have
-a key-making program which automatically selects words
-and passes them to the hashing and sorting program (step 2).
-The format used has one line for each input item,
-arranged
-as follows:
-.DS
-name:start,length (tab) key1 key2 key3 ...
-.DE
-where
-.I name
-is the file name,
-.I start
-is the starting byte number,
-and
-.I length
-is the number of bytes in the entry.
-.PP
-These lines are the only input used to make the
-index.
-The first field (the file name, byte position, and byte count)
-is the tag of the item
-and can be used to retrieve it quickly.
-Normally, an item is either a whole file or a section of a file
-delimited by blank lines.
-After the tab, the second field contains the keys.
-The keys, if selected by the automatic program, are
-any alphanumeric strings which
-are not among the 100 most frequent words in English
-and which are not entirely numeric (except for four-digit
-numbers beginning 19, which are accepted as dates).
-Keys are truncated to six characters and converted to lower case.
-Some selection is needed if the original items are very large.
-We normally just take the first
-.I n
-keys, with
-.I n
-less than 100 or so; this replaces any attempt at intelligent selection.
-One file in our system is
-a complete English dictionary; it would presumably be retrieved for all queries.
-.PP
-To generate an inverted index to the list of record tags and keys,
-the keys
-are hashed
-and sorted to produce an index.
-What is wanted, ideally, is a series of lists showing the tags associated
-with each key.
-To condense this,
-what is actually produced is a list showing the tags associated
-with each hash code, and thus with some set of keys.
-To speed up access and further save space,
-a set of three or possibly four files is produced.
-These files are:
-.KS
-.bd 2 2
-.TS
-center;
-c c
-lI l.
-File   Contents
-entry  Pointers to posting file
-       for each hash code
-posting        Lists of tag pointers for
-       each hash code
-tag    Tags for each item
-key    Keys for each item
-       (optional)
-.TE
-.bd 2
-.KE
-The posting file comprises the real data: it contains a sequence of lists
-of items posted under each hash code.  To speed up searching,
-the entry file is an array of pointers into the posting file, one per potential
-hash code.
-Furthermore, the items in the lists in the posting file are not referred to by their
-complete tag, but just by an address in the tag file, which
-gives the complete tags.
-The key file is optional and contains a copy of the keys
-used in the indexing.
-.PP
-The searching process starts with a query, containing several keys.
-The goal is to obtain all items which were indexed under these keys.
-The query keys are hashed, and the pointers in the entry file used
-to access the lists in the posting file.  These lists
-are addresses in the tag file of documents posted under the
-hash codes derived from the query.
-The common items from all lists are determined;
-this must include the items indexed by every key, but may also
-contain some items which are false drops, since items referenced by
-the correct hash codes need not actually have contained the correct keys.
-Normally, if there are several keys in the query, there are not
-likely to be many false drops in the final combined list even though
-each hash code is somewhat ambiguous.
-The actual tags are then obtained from the tag file, and to guard against
-the possibility that an item has false-dropped on some hash code
-in the query, the original items are normally obtained from the delivery
-program (4) and the query keys checked against them
-by string comparison.
-.PP
-Usually, therefore, the check for bad drops is made against the original file.
-However, if the key derivation procedure is complex, it may be preferable
-to check against the keys fed to program (2).
-In this case the optional key file which contains the
-keys associated with each item is generated, and the item tag is supplemented
-by a string
-.DS
-;start,length
-.DE
-which indicates the starting byte number in the key file and the length of
-the string of keys for each item.
-This file is not usually necessary with the present
-key-selection program, since the keys
-always appear in the original document.
-.PP
-There is also an option
-(\f3-C\f2n\|\f1)
-for coordination level searching.
-This retrieves items which match all but
-.I n
-of the query keys.
-The items are retrieved in the order of the number
-of keys that they match.
-Of course,
-.I n
-must be less than the number of query keys (nothing is
-retrieved unless it matches at least one key).
-.PP
-As an example, consider one set of 4377 references, comprising
-660,000 bytes.
-This included 51,000 keys, of which 5,900 were distinct
-keys.
-The hash table is kept full to save space (at the expense of time);
-995 of 997 possible hash codes were used.
-The total set of index files (no key file) included 171,000 bytes,
-about 26% of the original file size.
-It took 8 minutes of processor time to
-hash, sort, and write the index.
-To search for a single query with the resulting index took 1.9 seconds
-of processor time,
-while to find the same paper
-with a sequential linear search
-using
-.I grep
-(reading all of the tags and keys)
-took 12.3 seconds of processor time.
-.PP
-We have also used this software to index all of the English stored on our
-.UX
-system.
-This is the index searched by the
-.I lookall
-command.
-On a typical day there were
-29,000 files in our user file system, containing about 152,000,000
-bytes.
-Of these
-5,300 files, containing 32,000,000 bytes (about 21%)
-were English text.
-The total number of `words' (determined mechanically)
-was 5,100,000.
-Of these 227,000 were selected as keys;
-19,000 were distinct, hashing to 4,900 (of 5,000 possible) different hash codes.
-The
-resulting inverted file indexes used 845,000 bytes, or about
-2.6% of the size of the original files.
-The particularly small indexes are caused by the
-fact that keys are taken from only the first 50 non-common words of
-some very long input files.
-.PP
-Even this large \f2lookall\f1 index can be searched quickly.
-For example, to find this document
-by looking for the keys
-``lesk inverted indexes''
-required
-1.7 seconds of processor time
-and system time.
-By comparison, just to search the 800,000 byte dictionary (smaller than even
-the inverted indexes, let alone the 32,000,000 bytes of text files) with
-.I grep
-takes 29 seconds of processor time.
-The
-.I lookall
-program is thus useful when looking for a document which you believe
-is stored on-line, but do not know where.  For example, many memos
-from the Computing Science Research Center are in its
-.UX
-file system, but
-it is often
-difficult to guess where a particular memo might be (it might have several
-authors, each with many directories, and have been worked on by
-a secretary with yet more directories).
-Instructions for the use of the
-.I lookall
-command are given in the manual section, shown
-in the appendix to this memorandum.
-.PP
-The only indexes maintained routinely are those of publication lists and
-all English files.
-To make other indexes, the programs for making keys, sorting them,
-searching the indexes, and delivering answers must be used.
-Since they are usually invoked as parts of higher-level commands,
-they are not in the default command
-directory, but are available to any user in the directory
-.I /usr/lib/refer .
-Three programs are of interest:
-.I mkey ,
-which isolates keys from input files;
-.I inv ,
-which makes an index from a set of keys;
-and
-.I hunt ,
-which searches the index and delivers the items.
-Note that the two parts of the retrieval phase are combined into
-one program, to avoid the excessive system work and delay which
-would result from running these as separate processes.
-.PP
-These three commands have a large number of options to adapt to different
-kinds of input.
-The user not interested in the detailed description that now follows may
-skip to section 3, which describes the
-.I refer
-program, a packaged-up version of these tools specifically
-oriented towards formatting references.
-.PP
-.B
-Make Keys.
-.R
-The program
-.I mkey
-is the key-making program corresponding to step (1) in phase A.
-Normally, it reads its input from the file names given as arguments,
-and if there are no arguments it reads from the standard input.
-It assumes that blank lines in the input delimit
-separate items, for each of which a different line of
-keys should be generated.
-The lines of keys are written on the standard output.
-Keys are any alphanumeric string in the input not
-among the most frequent words in English and not entirely numeric
-(except that all-numeric strings are acceptable if they
-are between 1900 and 1999).
-In the output, keys are translated to lower case, and truncated
-to six characters in length; any associated punctuation is removed.
-The following flag arguments are recognized by
-.I mkey:
-.TS
-center;
-lB lw(4i).
-\-c \f2name    T{
-Name of file of common words;
-default is
-.I /usr/lib/eign.
-T}
-\-f \f2name    T{
-Read a list of files from
-.I name
-and take each as an input argument.
-T}
-\-i \f2chars   T{
-Ignore all lines which begin with `%' followed by any character
-in
-.I chars .
-T}
-\-k\f2n        T{
-Use at most
-.I n
-keys per input item.
-T}
-\-l\f2n        T{
-Ignore items shorter than
-.I n
-letters long.
-T}
-\-n\f2m        T{
-Ignore as a key any word in the first
-.I m
-words of the list of common English words.
-The default is 100.
-T}
-\-s    T{
-Remove the labels
-.I (file:start,length)
-from the output; just give the keys.
-Used when searching rather than indexing.
-T}
-\-w    T{
-Each whole file is a separate item;
-blank lines in files are irrelevant.
-T}
-.TE
-.PP
-The normal arguments for indexing references are
-the defaults, which are
-.I "\-c /usr/lib/eign" ,
-.I \-n100 ,
-and
-.I \-l3 .
-For searching, the
-.I \-s
-option is also needed.
-When the big
-.I lookall
-index of all English files is run,
-the options are
-.I \-w ,
-.I \-k50 ,
-and
-.I "\-f (filelist)" .
-When running on textual input,
-the
-.I mkey
-program processes about 1000 English words per processor second.
-Unless the
-.I \-k
-option is used (and the input files are long enough for
-it to take effect)
-the output of
-.I mkey 
-is comparable in size to its input.
-.PP
-.B
-Hash and invert.
-.R
-The
-.I inv
-program computes the hash codes and writes
-the inverted files.
-It reads the output of
-.I mkey
-and writes the set of files described earlier
-in this section.
-It expects one argument, which is used as the base name for
-the three (or four) files to be written.
-Assuming an argument of
-.I Index
-(the default)
-the entry file is named
-.I Index.ia ,
-the posting file
-.I Index.ib ,
-the tag file
-.I Index.ic ,
-and the key file (if present)
-.I Index.id .
-The
-.I inv
-program recognizes the following options:
-.TS
-center;
-lB lw(4i).
-\-a    T{
-Append the new keys to a previous set of inverted files,
-making new files if there is no old set using the same base name.
-T}
-\-d    T{
-Write the optional key file.
-This is needed when you can not check for false drops by looking
-for the keys in the original inputs, i.e. when the key derivation
-procedure is complicated and
-the output keys are not words from the input files.
-T}
-\-h\f2n        T{
-The hash table size is
-.I n
-(default 997);
-.I n
-should be prime.
-Making \f2n\f1 bigger saves search time and spends disk space.
-T}
-\-i[u] \f2name T{
-Take input from file
-.I name ,
-instead of the standard input;
-if
-.B u
-is present
-.I name
-is unlinked when the sort is started.
-Using this option permits the sort scratch space
-to overlap the disk space used for input keys.
-T}
-\-n    T{
-Make a completely new set of inverted files, ignoring
-previous files.
-T}
-\-p    T{
-Pipe into the sort program, rather than writing a temporary
-input file.
-This saves disk space and spends processor time.
-T}
-\-v    T{
-Verbose mode; print a summary of the number of keys which
-finished indexing.
-T}
-.TE
-.PP
-About half the time used in
-.I inv
-is in the contained sort.
-Assuming the sort is roughly linear, however,
-a guess at the total timing for
-.I inv
-is 250 keys per second.
-The space used is usually of more importance:
-the entry file uses four bytes per possible hash (note
-the
-.B \-h
-option),
-and the tag file around 15-20 bytes per item indexed.
-Roughly, the posting file contains one item for each key instance
-and one item for each possible hash code; the items are two bytes
-long if the tag file is less than 65336 bytes long, and the
-items are four bytes wide if the tag file is greater than
-65536 bytes long.
-To minimize storage, the hash tables should be
-over-full;
-for most of the files indexed in this way, there is no
-other real choice, since the
-.I entry
-file must fit in memory.
-.PP
-.B
-Searching and Retrieving.
-.R
-The
-.I hunt
-program retrieves items from an index.
-It combines, as mentioned above, the two parts of phase (B):
-search and delivery.
-The reason why it is efficient to combine delivery and search
-is partly to avoid starting unnecessary processes, and partly
-because the delivery operation must be a part of the search
-operation in any case.
-Because of the hashing, the search part takes place in two stages:
-first items are retrieved which have the right hash codes associated with them,
-and then the actual items are inspected to determine false drops, i.e.
-to determine if anything with the right hash codes doesn't really have the right
-keys.
-Since the original item is retrieved to check on false drops,
-it is efficient to present it immediately, rather than only
-giving the tag as output and later retrieving the
-item again.
-If there were a separate key file, this argument would not apply,
-but separate key files are not common.
-.PP
-Input to
-.I hunt
-is taken from the standard input,
-one query per line.
-Each query should be in
-.I "mkey \-s"
-output format;
-all lower case, no punctuation.
-The
-.I hunt
-program takes one argument which specifies the base name of the index
-files to be searched.
-Only one set of index files can be searched at a time,
-although many text files may be indexed as a group, of course.
-If one of the text files has been changed since the index, that file
-is searched with
-.I fgrep;
-this may occasionally slow down the searching, and care should be taken to
-avoid having many out of date files.
-The following option arguments are recognized by
-.I hunt:
-.TS
-center;
-lB lw(4i).
-\-a    T{
-Give all output; ignore checking for false drops.
-T}
-\-C\f2n        T{
-Coordination level
-.I n;
-retrieve items with not more than
-.I n
-terms of the input missing;
-default
-.I C0 ,
-implying that each search term must be in the output items.
-T}
-\-F[yn\f2d\f3\|]       T{
-``\-Fy'' gives the text of all the items found;
-``\-Fn'' suppresses them.
-``\-F\f2d\|\f1'' where \f2d\f1\| is an integer
-gives the text of the first \f2d\f1 items.
-The default is
-.I \-Fy.
-T}
-\-g    T{
-Do not use
-.I fgrep
-to search files changed since the index was made;
-print an error comment instead.
-T}
-\-i \f2string  T{
-Take
-.I string
-as input, instead of reading the standard input.
-T}
-\-l \f2n       T{
-The maximum length of internal lists of candidate
-items is
-.I n;
-default 1000.
-T}
-\-o \f2string  T{
-Put text output (``\-Fy'') in
-.I string;
-of use
-.I only
-when
-invoked from another program.
-T}
-\-p    T{
-Print hash code frequencies; mostly
-for use in optimizing hash table sizes.
-T}
-\-T[yn\f2d\|\f3]       T{
-``\-Ty'' gives the tags of the items found;
-``\-Tn'' suppresses them.
-``\-T\f2d\f1\|'' where \f2d\f1\| is an integer
-gives the first \f2d\f1 tags.
-The default is
-.I \-Tn .
-T}
-\-t \f2string  T{
-Put tag output (``\-Ty'') in
-.I string;
-of use
-.I only
-when invoked from another program.
-T}
-.TE
-.PP
-The timing of
-.I hunt
-is complex.
-Normally the hash table is overfull, so that there will
-be many false drops on any single term;
-but a multi-term query will have few false drops on
-all terms.
-Thus if a query is underspecified (one search term)
-many potential items will be examined and discarded as false
-drops, wasting time.
-If the query is overspecified (a dozen search terms)
-many keys will be examined only to verify that
-the single item under consideration has that key posted.
-The variation of search time with number of keys is
-shown in the table below.
-Queries of varying length were constructed to retrieve
-a particular document from the file of references.
-In the sequence to the left, search terms were chosen so as
-to select the desired paper as quickly as possible.
-In the sequence on the right, terms were chosen inefficiently,
-so that the query did not uniquely select the desired document
-until four keys had been used.
-The same document was the target in each case,
-and the final set of eight keys are also identical; the differences
-at five, six and seven keys are produced by measurement error, not
-by the slightly different key lists.
-.TS
-center;
-c   s   s   s5  | c   s   s   s
-cp8 cp8 cp8 cp8 | cp8 cp8 cp8 cp8
-cp8 cp8 cp8 cp8 | cp8 cp8 cp8 cp8
-n   n   n   n   | n   n   n   n  .
-Efficient Keys Inefficient Keys
-No. keys       Total drops     Retrieved       Search time     No. keys        Total drops     Retrieved       Search time
-       (incl. false)   Documents       (seconds)               (incl. false)   Documents       (seconds)
-1      15      3       1.27    1       68      55      5.96
-2      1       1       0.11    2       29      29      2.72
-3      1       1       0.14    3       8       8       0.95
-4      1       1       0.17    4       1       1       0.18
-5      1       1       0.19    5       1       1       0.21
-6      1       1       0.23    6       1       1       0.22
-7      1       1       0.27    7       1       1       0.26
-8      1       1       0.29    8       1       1       0.29
-.TE
-As would be expected, the optimal search is achieved
-when the query just specifies the answer; however,
-overspecification is quite cheap.
-Roughly, the time required by
-.I hunt
-can be approximated as
-30 milliseconds per search key plus 75 milliseconds
-per dropped document (whether it is a false drop or
-a real answer).
-In general, overspecification can be recommended;
-it protects the user against additions to the data base
-which turn previously uniquely-answered queries
-into ambiguous queries.
-.PP
-The careful reader will have noted an enormous discrepancy between these times
-and the earlier quoted time of around 1.9 seconds for a search.  The times
-here are purely for the search and retrieval: they are measured by
-running many searches through a single invocation of the
-.I hunt
-program alone.
-Usually, the UNIX command processor (the shell) must start both
-the
-.I mkey
-and
-.I hunt
-processes for each query, and arrange for the output of
-.I mkey
-to be fed to
-the
-.I hunt
-program.
-This adds a fixed overhead of about 1.7 seconds
-of processor time
-to any single search.
-Furthermore, remember that all these times are processor times:
-on a typical morning on our \s-2PDP\s0 11/70 system, with about one dozen
-people logged on,
-to obtain 1 second of processor time for the search program
-took between 2 and 12 seconds of real time, with a median of
-3.9 seconds and a mean of 4.8 seconds.
-Thus, although the work involved in a single search may be only
-200 milliseconds, after you add the 1.7 seconds of startup processor
-time
-and then assume a 4:1 elapsed/processor time
-ratio, it will be 8 seconds before any response is printed.
-.NH
-Selecting and Formatting References for T\s-2ROFF\s0
-.PP
-The major application of the retrieval software
-is
-.I refer,
-which is a
-.I troff
-preprocessor
-like
-.I eqn .
-.[
-kernighan cherry acm 1975
-.]
-It scans its input looking for items of the form
-.DS
-\*.[
-imprecise citation
-\*.\^]
-.DE
-where an imprecise citation is merely a string
-of words found in the relevant bibliographic citation.
-This is translated into a properly formatted reference.
-If the imprecise citation does not correctly identify
-a single paper
-(either
-selecting no papers or too many) a message is given.
-The data base of citations searched may be tailored to each
-system, and individual users may specify their own
-citation
-files.
-On our system, the default data base is accumulated from
-the publication lists of the members of our organization, plus
-about half a dozen personal bibliographies that were collected.
-The present total is about 4300 citations, but this increases steadily.
-Even now,
-the data base covers a large fraction of local citations.
-.PP
-For example, the reference for the
-.I eqn
-paper above was specified as
-.DS
-\&\*.\*.\*.
-\&preprocessor like
-\&.I eqn.
-\&.[
-\&kernighan cherry acm 1975
-\&.]
-\&It scans its input looking for items
-\&\*.\*.\*.
-.DE
-This paper was itself printed using
-.I refer.
-The above input text was processed by
-.I refer
-as well as
-.I tbl
-and
-.I troff
-by the command
-.DS
-.ft I
-refer memo-file | tbl | troff \-ms
-.ft R
-.DE
-and the reference was automatically translated into a correct
-citation to the ACM paper on mathematical typesetting.
-.PP
-The procedure to use to place a reference in a paper
-using
-.I refer
-is as follows.
-First, use the
-.I lookbib
-command to check that the paper is in the data base
-and to find out what keys are necessary to retrieve it.
-This is done by typing
-.I lookbib
-and then typing some potential queries until
-a suitable query is found.
-For example, had one started to find
-the
-.I eqn
-paper shown above by presenting the query
-.DS
-       $ lookbib
-       kernighan cherry
-       (EOT)
-.DE
-.I lookbib
-would have found several items; experimentation would quickly
-have shown that the query given above is adequate.
-Overspecifying the query is of course harmless; it is even desirable,
-since it decreases the risk that a document added to the publication
-data base in the future will be retrieved in addition to the
-intended document.
-The extra time taken by even a grossly overspecified query is
-quite small.
-A particularly careful reader may have noticed that ``acm'' does not
-appear in the printed citation;
-we have supplemented some of the data base items with
-extra keywords, such as common abbreviations for journals
-or other sources, to aid in searching.
-.PP
-If the reference is in the data base, the query
-that retrieved it can be inserted in the text,
-between
-.B \*.[
-and 
-.B \*.\^]
-brackets.
-If it is not in the data base, it can be typed
-into a private file of references, using the format
-discussed in the next section, and then
-the
-.B \-p
-option
-used to search this private file.
-Such a command might read
-(if the private references are called
-.I myfile )
-.DS
-.ft 2
-refer \-p myfile document | tbl | eqn | troff \-ms \*. \*. \*.
-.ft 1
-.DE
-where
-.I tbl
-and/or
-.I eqn
-could be omitted if not needed.
-The use
-of the
-.I \-ms
-macros
-.[
-lesk typing documents unix gcos
-.]
-or some other macro package, however,
-is essential.
-.I Refer
-only generates the data for the references; exact formatting
-is done by some macro package, and if none is supplied the
-references will not be printed.
-.PP
-By default,
-the references are numbered sequentially,
-and
-the
-.I \-ms
-macros format references as footnotes at the bottom of the page.
-This memorandum is an example of that style.
-Other possibilities are discussed in section 5 below.
-.NH
-Reference Files.
-.PP
-A reference file is a set of bibliographic references usable with
-.I refer.
-It can be indexed using the software described in section 2
-for fast searching.
-What
-.I refer
-does is to read the input document stream,
-looking for imprecise citation references.
-It then searches through reference files to find
-the full citations, and inserts them into the
-document.
-The format of the full citation is arranged to make it
-convenient for a macro package, such as the
-.I \-ms
-macros, to format the reference
-for printing.
-Since
-the format of the final reference is determined
-by the desired style of output,
-which is determined by the macros used,
-.I refer
-avoids forcing any kind of reference appearance.
-All it does is define a set of string registers which
-contain the basic information about the reference;
-and provide a macro call which is expanded by the macro
-package to format the reference.
-It is the responsibility of the final macro package
-to see that the reference is actually printed; if no
-macros are used, and the output of
-.I refer
-fed untranslated to
-.I troff,
-nothing at all will be printed.
-.PP
-The strings defined by
-.I refer
-are taken directly from the files of references, which
-are in the following format.
-The references should be separated
-by blank lines.
-Each reference is a sequence of lines beginning with
-.B %
-and followed
-by a key-letter.
-The remainder of that line, and successive lines until the next line beginning
-with
-.B % ,
-contain the information specified by the key-letter.
-In general,
-.I refer
-does not interpret the information, but merely presents
-it to the macro package for final formatting.
-A user with a separate macro package, for example,
-can add new key-letters or use the existing ones for other purposes
-without bothering
-.I refer.
-.PP
-The meaning of the key-letters given below, in particular,
-is that assigned by the
-.I \-ms
-macros.
-Not all information, obviously, is used with each citation.
-For example, if a document is both an internal memorandum and a journal article,
-the macros ignore the memorandum version and cite only the journal article.
-Some kinds of information are not used at all in printing the reference;
-if a user does not like finding references by specifying title
-or author keywords, and prefers to add specific keywords to the
-citation, a field is available which is searched but not
-printed (\f3K\f1).
-.PP
-The key letters currently recognized by
-.I refer
-and
-.I \-ms,
-with the kind of information implied, are:
-.KS
-.TS
-center;
-c c6 c c
-c l c l.
-Key    Information specified   Key     Information specified
-A      Author's name   N       Issue number
-B      Title of book containing item   O       Other information
-C      City of publication     P       Page(s) of article
-D      Date    R       Technical report reference
-E      Editor of book containing item  T       Title
-G      Government (NTIS) ordering number       V       Volume number
-I      Issuer (publisher)
-J      Journal name
-K      Keys (for searching)    X       or
-L      Label   Y       or
-M      Memorandum label        Z       Information not used by \f2refer\f1
-.TE
-.KE
-For example, a sample reference could be
-typed as:
-.DS
-%T Bounds on the Complexity of the Maximal
-Common Subsequence Problem
-%Z ctr127
-%A A. V. Aho
-%A D. S. Hirschberg
-%A J. D. Ullman
-%J J. ACM
-%V 23
-%N 1
-%P 1-12
-.\"%M TM 75-1271-7
-%M abcd-78
-%D Jan. 1976
-.DE
-Order is irrelevant, except that authors are shown in the order
-given.  The output of
-.I refer
-is a stream of string definitions, one
-for each of the fields of each reference, as
-shown below.
-.DS
-\*.]-
-\*.ds [A authors' names \*.\*.\*.
-\*.ds [T title \*.\*.\*.
-\*.ds [J journal \*.\*.\*.
-\*.\*.\*.
-\*.]\|[ type-number
-.DE
-The
-.I refer
-program, in general, does not concern itself with the significance
-of the strings.
-The different fields are treated identically by
-.I refer ,
-except that the
-X, Y and Z fields are ignored (see the
-.B \-i
-option of
-.I mkey\^ )
-in indexing and searching.
-All
-.I refer
-does is select the appropriate citation, based on the keys.
-The macro package must arrange the strings so as to produce an appropriately
-formatted citation.
-In this process, it uses the convention that the `T' field is the title,
-the `J' field the journal, and so forth.
-.PP
-The
-.I refer
-program does arrange the citation to simplify the macro package's
-job, however.
-The special macro
-.B \&\*.]\-
-precedes the string definitions
-and the special macro
-.B \*.]\|[
-follows.
-These are changed from the input
-.B \*.[
-and 
-.B \*.\^]
-so that running the same file through
-.I refer
-again is harmless.
-The 
-.B \*.]\-
-macro can be used by the macro package to
-initialize.
-The 
-.B \*.]\|[
-macro, which should be used
-to print the reference, is given an
-argument
-.I type-number
-to indicate the kind of reference, as follows:
-.KS
-.TS
-center;
-c c
-n l.
-Value  Kind of reference
-1      Journal article
-2      Book
-3      Article within book
-4      Technical report
-5      Bell Labs technical memorandum
-0      Other
-.TE
-.KE
-The type is determined by the presence or absence of particular fields
-in the citation (a journal article must have a `J' field, a book must have
-an `I' field, and so forth).
-To a small extent, this violates
-the above rule that
-.I refer
-does not concern itself with the contents of the citation;
-however, the classification of the citation in
-.I troff
-macros would require a relatively expensive and obscure
-program.
-Any macro writer may, of course, preserve consistency by ignoring
-the argument to the
-.B \*.]\|[
-macro.
-.PP
-The reference is flagged in the text
-with the sequence
-.DS
-\e*\|([\*.number\e*\|(\*.\^]
-.DE
-where
-.I number
-is the footnote number.
-The strings
-.B [\*.
-and 
-.B \*.\^]
-should be used by the macro package
-to format the reference flag in the text.
-These strings can be replaced for a particular
-footnote, as described in section 5.
-The footnote number (or other signal) is available
-to the reference macro
-.B \*.]\|[
-as the
-string register
-.B [F .
-To simplify dealing with a text reference that occurs
-at the end of a sentence,
-.I refer
-treats a reference which follows a period in a special way.
-The period is removed, and the reference is preceded by
-a call for the string
-.B <.
-and followed by a call for the string
-.B >.
-For example, if a reference follows ``end.'' it will appear
-as
-.DS
-end\e*(<\*.\e*([\*.number\e*(\*.]\e*(>\*.
-.DE
-where
-.I number
-is the footnote number.
-The macro package should turn either the string
-.B >.
-or
-.B <.
-into a period and delete the other one.
-This permits the output to have either the form
-``end[31].'' or ``end.\s-3\u31\d\s0'' as the
-macro package wishes.
-Note that in one case the period precedes the number and in the
-other it follows the number.
-.PP
-In some cases users wish to suspend the searching, and merely
-use the reference macro formatting.
-That is, the user doesn't want to provide a search key
-between
-.B \*.[
-and 
-.B \*.\^]
-brackets, but merely
-the reference lines for the appropriate document.
-Alternatively, the user
-can wish
-to add a few fields to those in the reference
-as in the standard file, or
-override some fields.
-Altering or replacing fields, or supplying whole references, is easily done
-by inserting lines beginning
-with
-.B % ;
-any such line is taken as
-direct input to the reference
-processor rather than keys to be searched.
-Thus
-.DS
-\*.[
-key1 key2 key3 \*.\*.\*.
-%Q New format item
-%R Override report name
-\*.\^]
-.DE
-makes the indicates changes to the result of searching for
-the keys.
-All of the search keys must be given before the first
-\f3%\f1 line.
-.PP
-If no search keys are provided, an entire citation can
-be provided in-line in the text.
-For example, if the
-.I eqn
-paper citation were to be inserted in
-this way, rather than by searching for it in the data base,
-the input would read
-.DS
-\&\*.\*.\*.
-\&preprocessor like
-\&.I eqn.
-\&.[
-\&%A B. W. Kernighan
-\&%A L. L. Cherry
-\&%T A System for Typesetting Mathematics
-\&%J Comm. ACM
-\&%V 18
-\&%N 3
-\&%P 151-157
-\&%D March 1975
-\&.]
-\&It scans its input looking for items
-\&\*.\*.\*.
-.DE
-This would produce a citation of the same appearance as that
-resulting from the file search.
-.PP
-As shown, fields are normally turned into
-.I troff
-strings.
-Sometimes users would rather have them defined as macros,
-so that other
-.I troff
-commands can be placed into the data.
-When this is necessary, simply double the control character
-.B %
-in the data.
-Thus the input
-.DS
-\&.[
-%V 23
-%%M
-Bell Laboratories,
-Murray Hill, N.J. 07974
-\&.]
-.DE
-is processed by
-.I refer
-into
-.DS
-\&.ds [V 23
-\&.de [M
-Bell Laboratories,
-Murray Hill, N.J. 07974
-\&..
-.DE
-The information after
-.B %%M
-is defined as a macro to be invoked by
-.B .[M
-while the information after
-.B %V
-is turned into a string to be invoked by
-.B \e\(**([V .
-At present
-.I \-ms
-expects all information as strings.
-.NH
-Collecting References and other Refer Options
-.PP
-Normally, the combination of
-.I refer
-and
-.I \-ms
-formats output as 
-.I troff
-footnotes which are consecutively numbered and placed
-at the bottom of the page.  However,
-options exist to
-place the references at the end; to arrange references alphabetically
-by senior author; and to indicate references by strings in the text of the form
-[Name1975a]
-rather than by number.
-Whenever references are not placed at the bottom of a page
-identical references are coalesced.
-.PP
-For example, the
-.B \-e
-option to
-.I refer
-specifies that references are to be collected; in this case
-they are output whenever the sequence
-.DS
-\*.[
-$LIST$
-\*.\^]
-.DE
-is encountered.
-Thus, to place references at the end of a paper, the user would run
-.I refer
-with the
-.I \-e
-option and place the above $LIST$ commands after the last
-line of the text.
-.I Refer
-will then move all the references to that point.
-To aid in formatting the collected references,
-.I refer
-writes the references preceded by the line
-.DS
-.B .]<
-.DE
-and
-followed by the line
-.DS
-.B .]>
-.DE
-to invoke special macros before and after the references.
-.PP
-Another possible option to
-.I refer
-is the
-.B \-s
-option to specify
-sorting of references.  The default,
-of course, is to list references in the order presented.
-The
-.B \-s
-option implies the
-.B \-e
-option, and thus requires
-a
-.DS
-\*.[
-$LIST$
-\*.\^]
-.DE
-entry to call out the reference list.
-The
-.B \-s
-option may be followed by a string of letters, numbers, and `+' signs indicating how
-the references are to be sorted.
-The sort is done using the fields whose key-letters are
-in the string as sorting keys; the numbers indicate how many
-of the fields are to be considered, with `+'
-taken as a large number.
-Thus the default is
-.B \-sAD
-meaning ``Sort on senior author, then date.''  To
-sort on all authors and then title, specify
-.B \-sA+T .
-And to sort on two authors and then the journal,
-write
-.B \-sA2J .
-.PP
-Other options to
-.I refer
-change the signal or label inserted in the text for each reference.
-Normally these are just sequential numbers,
-and their exact placement (within brackets, as superscripts, etc.) is determined
-by the macro package.
-The
-.B \-l
-option replaces reference numbers by
-strings composed of the senior author's last name, the date,
-and a disambiguating letter.
-If a number follows the
-.B l
-as in
-.B \-l3
-only that many letters of the last name are used
-in the label string.
-To abbreviate the date as well the form
-\f3-l\f2m,n\f1
-shortens the last name to the
-first
-.I m
-letters and the date to the
-last
-.I n
-digits.
-For example, the option
-.B \-l3,2
-would refer to the
-.I eqn
-paper (reference 3) by the signal
-.I Ker75a ,
-since it is the first cited reference by Kernighan in 1975.
-.PP
-A user wishing to specify particular labels for
-a private bibliography may use the
-.B \-k
-option.
-Specifying
-\f3\-k\f2x\f1
-causes the field \f2x\f1 to be used as a label.
-The default is \f3L\f1.
-If this field ends in \f3\-\f1, that character
-is replaced by a sequence letter; otherwise the field
-is used exactly as given.
-.PP
-If none of the
-.I refer -produced
-signals are desired,
-the
-.B \-b
-option entirely suppresses automatic text signals.
-.PP
-If the user wishes to override the
-.I \-ms
-treatment of the reference signal (which is normally to
-enclose the number in brackets in
-.I nroff
-and make it a superscript in
-.I troff\\| )
-this can be done easily.
-If the lines
-.B \&.[
-or
-.B \&.]
-contain anything following these characters,
-the remainders of these lines are used to surround
-the reference signal, instead of the default.
-Thus, for example, to say ``See reference (2).''
-and avoid
-``See reference.\s-3\u2\d\s+3'' the
-input might appear
-.DS
-\&See reference
-\&\*.[ (
-imprecise citation ...
-\&\*.\^])\*.
-.DE
-Note that blanks are significant in this construction.
-If a permanent change is desired in the style of reference
-signals, however, it is probably easier to redefine the strings
-.B \&[.
-and
-.B \&.]
-(which are used to bracket each signal)
-than to change each citation.
-.PP
-Although normally
-.I refer
-limits itself to retrieving the data for the reference,
-and leaves to a macro package the job of arranging that
-data as required by the local format, there are two
-special options for rearrangements that can not be
-done by macro packages.
-The
-.B \-c
-option puts fields into all upper case
-(C\s-2APS\s+2-S\s-2MALL\s+2 C\s-2APS\s+2
-in
-.I troff
-output).
-The key-letters indicated what information is to be translated
-to upper case follow the
-.B c ,
-so that
-.B \-cAJ
-means that authors' names and journals are to be in caps.
-The
-.B \-a
-option writes the names of authors last name first, that is
-.I "A. D. Hall, Jr."
-is written as
-.I "Hall, A. D. Jr" .
-The citation form of
-the
-.I "Journal of the ACM" ,
-for example, would require
-both
-.B \-cA
-and
-.B \-a
-options.
-This produces authors' names in the style
-.I
-K\s-2ERNIGHAN\s0, B. W. \s-2AND\s0 C\s-2HERRY\s0, L. L.\&
-.R
-for the previous example.
-The
-.B \-a
-option may be followed by a number to indicate how many
-author names should be reversed;
-.B \-a1
-(without any
-.B \-c
-option)
-would produce
-.I
-Kernighan, B. W. and L. L. Cherry,
-.R
-for example.
-.PP
-Finally, there is also the previously-mentioned
-.B \-p
-option to let the user specify
-a private file of references to be searched before the public files.
-Note that
-.I refer
-does not insist on a previously made index for these files.
-If a file is named which contains reference
-data but is not indexed, it will be searched
-(more slowly)
-by
-.I refer
-using
-.I fgrep.
-In this way
-it is easy for users to keep small files of
-new references, which can later be added to the
-public data bases.
-.SG MH-1274-MEL-\s8UNIX\s0
diff --git a/.ref-Research-V7/usr/doc/regen b/.ref-Research-V7/usr/doc/regen
deleted file mode 100644 (file)
index 452542a..0000000
+++ /dev/null
@@ -1,547 +0,0 @@
-.TL
-Regenerating System Software
-.AU
-Charles B. Haley
-.AU
-Dennis. M. Ritchie
-.MH
-.SH
-Introduction
-.PP
-This document discusses how to
-assemble or compile various parts of the
-.UX
-system software.
-This may be necessary because
-a command or library is accidentally
-deleted or otherwise
-destroyed;
-also, it may be desirable to install a modified
-version of some command or library routine.
-A few commands depend
-to some degree on the current configuration
-of the system;
-thus in any new system modifications to some commands
-are advisable.
-Most of the likely modifications
-relate to the standard disk devices contained
-in the system.
-For example, the df(1) (`disk free')
-command has built into it the names of
-the standardly present disk storage drives
-(e.g. `/dev/rf0', `/dev/rp0').
-Df(1) takes an argument to indicate which
-disk to examine, but it is convenient
-if its default argument is adjusted to
-reflect the ordinarily present devices.
-The companion document `Setting up UNIX'
-discusses which commands are likely to require
-changes.
-.SH
-Where Commands and Subroutines Live
-.PP
-The
-source files for commands and subroutines reside
-in several subdirectories
-of the directory /usr/src.
-These subdirectories, and a general
-description of their contents, are
-.IP cmd 12
-Source files for commands.
-.IP libc/stdio 12
-Source files making up the `standard i/o package'.
-.IP libc/sys 12
-Source files for the C system call interfaces.
-.IP libc/gen 12
-Source files for most of the remaining routines described
-in section 3 of the manual.
-.IP libc/crt 12
-Source files making up the C runtime support package, as
-in call save-return and long arithmetic.
-.IP libc/csu 12
-Source for the C startup routines.
-.IP games 12
-Source for (some of) the games.
-No great care has been taken to try to make it obvious how
-to compile these; treat it as a game.
-.IP libF77 12
-Source for the Fortran 77 runtime library, exclusive of IO.
-.IP libI77 12
-Source for the Fortran 77 IO runtime routines.
-.IP libdbm 12
-Source for the `data-base manager' package
-.I dbm
-(3).
-.IP libfpsim 12
-Source for the floating-point simulator routine.
-.IP libm 12
-Source for the mathematical library.
-.IP libplot 12
-Source for plotting routines.
-.SH
-Commands
-.PP
-The regeneration of most commands
-is straightforward.
-The `cmd' directory will contain either a source file
-for the command or a subdirectory containing the set
-of files that make up the command.
-If it is a single file the command
-.DS
-cd /usr/src/cmd
-cmake cmd_name
-.DE
-suffices. (Cmd_name is the name of the command you
-are playing with.)
-The result of the cmake command will be an executable version.
-If you type
-.DS
-cmake \-cp cmd_name
-.DE
-the result
-will be copied to /bin
-(or perhaps /etc or other places if appropriate).
-.PP
-If the source files are in a subdirectory there will be a `makefile'
-(see make(1)) to control the regeneration.
-After changing to the proper directory (cd(1)) you type one of the following:
-.IP "make all" 12
-The program is compiled and loaded; the executable is
-left in the current directory.
-.IP "make cp" 12
-The program is compiled and loaded, and the executable is
-installed.
-Everything is cleaned up afterwards;
-for example .o files are deleted.
-.IP "make cmp" 12
-The program is compiled and loaded, and the executable is compared
-against the one in /bin.
-.PP
-Some of the makefiles have other options. Print (cat(1)) the ones you
-are interested in to find out.
-.SH
-The Assembler
-.PP
-The assembler consists of two executable files:
-/bin/as and /lib/as2.
-The first is the 0-th pass:
-it reads the source program, converts it to
-an intermediate form in a temporary file `/tmp/atm0?',
-and estimates the final locations
-of symbols.
-It also makes two or three other temporary
-files which contain the ordinary symbol table,
-a table of temporary symbols (like 1:)
-and possibly an overflow intermediate file.
-The program /lib/as2
-acts as an ordinary multiple pass assembler
-with input taken from the files produced by /bin/as.
-.PP
-The source files for /bin/as
-are named `/usr/src/cmd/as/as1?.s'
-(there are 9 of them);
-/lib/as2 is produced
-from the source files
-`/usr/src/cmd/as/as2?.s';
-they likewise are 9 in number.
-Considerable care should be exercised
-in replacing either component of the
-assembler.
-Remember that if the assembler is lost,
-the only recourse is to replace it from some backup storage;
-a broken assembler cannot assemble itself.
-.SH
-The C Compiler
-.PP
-The C compiler consists of
-seven routines:
-`/bin/cc',
-which calls the phases of the compiler proper,
-the compiler control line expander `/lib/cpp',
-the assembler (`as'), and the loader (`ld').
-The phases of the C compiler are
-`/lib/c0', which is the first phase of the compiler;
-`/lib/c1', which is the second phase of the compiler;
-and `/lib/c2', which is the optional
-third phase optimizer.
-The loss of the C compiler is as serious
-as that of the assembler.
-.PP
-The source for /bin/cc
-resides in `/usr/src/cmd/cc.c'.
-Its loss alone (or that of c2) is not fatal.
-If needed,
-prog.c can be compiled by
-.DS
-/lib/cpp prog.c >temp0
-/lib/c0 temp0 temp1 temp2
-/lib/c1 temp1 temp2 temp3
-as \- temp3
-ld \-n /lib/crt0.o a.out \-lc
-.DE
-.PP
-The source for the compiler proper is in the
-directory /usr/src/cmd/c.
-The first phase (/lib/c0)
-is generated from the files c00.c, ..., c05.c,
-which must be compiled by the C compiler.
-There is also c0.h, a header file
-.I included
-by the C programs of the first phase.
-To make a new /lib/c0 use
-.DS
-make c0
-.DE
-Before installing the new c0, it is prudent to save the old one someplace.
-.PP
-The second phase of C (/lib/c1)
-is generated from the source files c10.c, ..., c13.c,
-the include-file c1.h, and a set
-of object-code tables combined into table.o.
-To generate a new second phase use
-.DS
-make c1
-.DE
-It is likewise prudent to save c1 before
-installing a new version.
-In fact in general it is wise to save the
-object files for the C compiler so that
-if disaster strikes C can be reconstituted
-without a working version of the compiler.
-.PP
-In a similar manner,
-the third phase of the C compiler
-(/lib/c2)
-is made up from the files
-c20.c and c21.c together with c2.h.
-Its loss is not critical since it is completely optional.
-.PP
-The set of tables mentioned above
-is generated from the file
-table.s.
-This `.s' file is not in fact assembler source;
-it must be converted by use of the 
-.I cvopt
-program, whose source and object are
-located in the C directory.
-Normally this is taken care of by make(1). You
-might want to look at the makefile to see what it does.
-.SH
-UNIX
-.PP
-The source and object programs for UNIX are kept in
-four subdirectories of
-.I /usr/sys.
-In the subdirectory 
-.I h
-there are several files ending in `.h';
-these are header files which are
-picked up (via `#include ...')
-as required by each system module.
-The subdirectory
-.I dev
-consists mostly of the device drivers
-together with a few other things.
-The subdirectory
-.I sys
-is the rest of the system.
-There are files of the form LIBx in the directories
-sys and dev. These are archives (ar(1)) which contain the
-object versions of the routines in the directory.
-.PP
-Subdirectory
-.I conf
-contains the files which control
-device configuration of the system.
-.I L.s
-specifies the
-contents of the interrupt vectors;
-.I c.c
-contains the tables which relate device numbers
-to handler routines.
-A third file,
-.I mch.s ,
-contains all the
-machine-language code in the system.
-A fourth file,
-.I mch0.s ,
-is generated by mkconf(1) and contains
-flags indicating what sort of tape drive is available
-for taking crash dumps.
-.PP
-There are two ways to recreate the system. Use
-.DS
-cd /usr/sys/conf
-make unix
-.DE
-if the libraries /usr/sys/dev/LIB2 and /usr/sys/sys/LIB1,
-and also c.o and l.o,
-are correct.
-Use
-.DS
-cd /usr/sys/conf
-make all
-.DE
-to recompile everything
-and recreate the libraries from scratch.
-This is needed, for example, when a header included
-in several source files is changed.
-See `Setting Up UNIX' for other information about configuration
-and such.
-.PP
-When the make is
-done, the new system is present in the
-current directory as `unix'.
-It should be tested before destroying the currently
-running `/unix', this is best done by doing something like
-.DS
-mv /unix /ounix
-mv unix /unix
-.DE
-If the new system doesn't work, you can still boot `ounix'
-and come up (see boot(8)).
-When you have satisfied yourself that the new system works,
-remove /ounix.
-.PP
-To install a new device driver,
-compile it and
-put it into its library.
-The best way to put it into
-the library is to use the command
-.DS
-ar uv LIB2 x.o
-.DE
-where x is the routine you just compiled.
-(All the device drivers distributed with
-the system are already in the library.)
-.PP
-Next, the device's interrupt vector must be entered in l.s.
-This is probably already done by the routine mkconf(1), but if the
-device is esoteric or nonstandard you will have to massage
-l.s by hand.
-This involves placing a pointer to a callout routine
-and the device's priority level in the vector.
-Use some other device (like the console) as a guide.
-Notice that the entries in l.s must be in order
-as the assembler does not permit moving the
-location counter `.' backwards.
-The assembler also does not permit assignation of
-an absolute number to `.', which is the
-reason for the `. = ZERO+100' subterfuge.
-If a constant smaller than 16(10) is added to the
-priority level,
-this number will be available as the first argument of the interrupt routine.
-This stratagem is used when
-several similar devices share the same interrupt routine
-(as in dl11's).
-.PP
-If you have to massage l.s, be sure to add the code
-to actually transfer to the interrupt routine. Again use
-the console as a guide. The apparent strangeness of this code
-is due to running the kernel in separate I&D space.
-The
-.I call
-routine
-saves registers as required and prepares a C-style
-call on the actual interrupt routine
-named after the `jmp' instruction.
-When the routine returns,
-.I call
-restores the registers and performs an
-rti instruction.
-As an aside, note that
-external names in C programs have an
-underscore (`_') prepended to them.
-.PP
-The second step which must be performed to add a 
-device unknown to mkconf is
-to add it to the configuration table
-/usr/sys/conf/c.c.
-This file contains two subtables,
-one for block-type devices, and one for character-type devices.
-Block devices include disks, DECtape, and magtape.
-All other devices are character devices.
-A line in each of these tables gives all the information
-the system needs to know about the device handler;
-the ordinal position of the line in the table implies
-its major device number, starting at 0.
-.PP
-There are four subentries per line in the block device table,
-which give its open routine, close routine, strategy routine, and
-device table.
-The open and close routines may be nonexistent,
-in which case the name `nulldev' is given;
-this routine merely returns.
-The strategy routine is called to do any I/O,
-and the device table contains status information for the device.
-.PP
-For character devices, each line in the table
-specifies a routine for open,
-close, read, and write, and one which sets and returns
-device-specific status (used, for example, for stty and gtty
-on typewriters).
-If there is no open or close routine, `nulldev' may
-be given; if there is no read, write, or status
-routine, `nodev' may be given.
-Nodev sets an error flag and returns.
-.PP
-The final step which must
-be taken to install a device is to make a special file for it.
-This is done by mknod(1), to which you must specify the
-device class (block or character),
-major device number (relative line in the configuration table)
-and minor device number
-(which is made available to the driver at appropriate times).
-.PP
-The documents
-`Setting up Unix' and
-`The Unix IO system'
-may aid in comprehending these steps.
-.SH
-The Library libc.a
-.PP
-The library /lib/libc.a is where most of the subroutines
-described in sections 2 and 3 of the manual are kept.
-This library
-can be remade using the following commands:
-.DS
-cd /usr/src/libc
-sh compall
-sh mklib
-mv libc.a /lib/libc.a
-.DE
-If single routines need to be recompiled and replaced, use
-.DS
-cc \-c \-O x.c
-ar vr /lib/libc.a x.o
-rm x.o
-.DE
-The above can also be used to put new items into the library.
-See ar(1), lorder(1), and tsort(1).
-.PP
-The routines in /usr/src/cmd/libc/csu (C start up) are not in
-libc.a. These are separately assembled and put into
-/lib. The commands to do this are
-.DS
-cd /usr/src/libc/csu
-as \- x.s
-mv a.out /lib/x
-.DE
-where x is the routine you want.
-.SH
-Other Libraries
-.PP
-Likewise,
-the directories containing the source for the other libraries
-have files compall (that recompiles everything)
-and mklib (that recreates the library).
-.SH
-System Tuning
-.PP
-There are several tunable parameters in the system. These set
-the size of various tables and limits. They are found in the
-file /usr/sys/h/param.h as manifests (`#define's).
-Their values are rather generous in the system as distributed.
-Our typical maximum number of users is about 20, but there are
-many daemon processes.
-.PP
-When any parameter is changed, it is prudent to recompile
-the entire system, as discussed above.
-A brief discussion of each follows:
-.IP NBUF 12
-This sets the size of the disk buffer cache. Each buffer is 512 bytes.
-This number should be around 25 plus NMOUNT,
-or as big as can be if the above number of
-buffers cause the system to not fit in memory.
-.IP NFILE 12
-This sets the maximum number of open files. An entry is made in
-this table every time a file is `opened' (see open(2), creat(2)).
-Processes share these table entries across forks (fork(2)). This number
-should be about the same size as NINODE below. (It can be a bit smaller.)
-.IP NMOUNT 12
-This indicates the maximum number of mounted file systems. Make it
-big enough that you don't run out at inconvenient times.
-.IP MAXMEM 12
-This sets an administrative limit on the amount of memory
-a process may have.
-It is set automatically if the amount of physical memory is small,
-and thus should not need to be changed.
-.IP MAXUPRC 12
-This sets the maximum number of processes that any one user can
-be running at any one time. This should be set just large enough
-that people can get work done but not so large that a user can
-hog all the processes available (usually by accident!).
-.IP NPROC 12
-This sets the maximum number of processes that can be
-active.
-It depends on the demand pattern of the typical user;
-we seem to need about 8 times the number
-of terminals.
-.DE
-.IP NINODE 12
-This sets the size of the inode table. There is one entry in the inode
-table for every open device, current working directory,
-sticky text segment,
-open file, and mounted device.
-Note that if two users have a file open there is still only one entry
-in the inode table. A reasonable rule of thumb for the size of
-this table is
-.DS
-NPROC + NMOUNT + (number of terminals)
-.DE
-.IP SSIZE 12
-The initial size of a process stack. This may be made bigger
-if commonly run processes have large data areas on the stack.
-.IP SINCR 12
-The size of the stack growth increment.
-.IP NOFILE 12
-This sets the maximum number of files that any one process can have
-open.
-20 is plenty.
-.IP CANBSIZ 12
-This is the size of the typewriter canonicalization buffer. It is
-in this buffer that erase and kill processing is done. Thus this
-is the maximum size of an input typewriter line. 256 is usually
-plenty.
-.IP CMAPSIZ 12
-The number of fragments that memory can be broken into. This should
-be big enough that it never runs out.
-The theoretical maximum is twice the number of processes,
-but this is a vast overestimate in practice.
-50 seems enough.
-.IP SMAPSIZ 12
-Same as CMAPSIZ except for secondary (swap) memory.
-.IP NCALL 12
-This is the size of the callout table. Callouts are entered in this
-table when some sort of internal system timing must be done, as in
-carriage return delays for terminals. The number must be big enough
-to handle all such requests.
-.IP NTEXT 12
-The maximum number of simultaneously executing pure programs. This
-should be big enough so as to not run out of space under heavy load.
-A reasonable rule of thumb is about
-.DS
-(number of terminals) + (number of sticky programs)
-.DE
-.IP NCLIST 12
-The number of clist segments. A clist segment is 6 characters.
-NCLIST should be big enough so that the list doesn't become exhausted
-when the machine is busy. The characters that have arrived from a terminal
-and are waiting to be given to a process live here. Thus enough space
-should be left so that every terminal can have at least one average
-line pending (about 30 or 40 characters).
-.IP TIMEZONE 12
-The number of minutes westward from Greenwich. See `Setting Up UNIX'.
-.IP DSTFLAG 12
-See `Setting Up UNIX' section on time conversion.
-.IP MSGBUFS 12
-The maximum number of characters of system error messages saved. This
-is used as a circular buffer.
-.IP NCARGS 12
-The maximum number of characters in an exec(2) arglist. This
-number controls how many arguments can be passed
-into a process.
-5120 is practically infinite.
-.IP HZ 12
-Set to the frequency of the system clock (e.g., 50 for
-a 50 Hz. clock).
diff --git a/.ref-Research-V7/usr/doc/run b/.ref-Research-V7/usr/doc/run
deleted file mode 100644 (file)
index 790a3db..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-pkg=-ms
-name=$1
-fmtr=nroff
-shift
-
-case $name in
-
-index)
-       $fmtr $pkg $* /usr/doc/index
-       ;;
-as*)
-       tbl /usr/doc/assembler | $fmtr $pkg $*
-       ;;
-ed*)
-       $fmtr $pkg $* /usr/doc/edtut/e*
-       ;;
-adv.ed)
-       $fmtr $pkg $* /usr/doc/adv.ed/ae*
-       ;;
-trofftut)
-       $fmtr $pkg $* /usr/doc/trofftut/tt*
-       ;;
-make)
-       $fmtr $pkg $* /usr/doc/make
-       ;;
-sum*|hel*)
-       eqn /usr/doc/summary/hel* | $fmtr $pkg $*
-       ;;
-cacm)
-       refer -e /usr/doc/cacm/p* | tbl | $fmtr $pkg $*
-       ;;
-impl*)
-       refer -e /usr/doc/implement | $fmtr $pkg $*
-       ;;
-bc)
-       $fmtr $pkg $* /usr/doc/bc
-       ;;
-dc)
-       eqn /usr/doc/dc | $fmtr $pkg $*
-       ;;
-eqn)
-       eqn /usr/doc/eqn/e* | $fmtr $pkg $*
-       ;;
-eqnguide)
-       eqn /usr/doc/eqn/g* | $fmtr $pkg $*
-       ;;
-troff)
-       /usr/doc/troff/tprint $*
-       ;;
-ctour)
-       $fmtr $pkg $* /usr/doc/ctour/cdoc*
-       ;;
-shell)
-       refer -e /usr/doc/shell/t* | $fmtr -$pkg $*
-       ;;
-sed)
-       $fmtr $pkg $* /usr/doc/sed
-       ;;
-f77)
-       tbl /usr/doc/f77 | eqn | $fmtr $pkg $*
-       ;;
-begin*)
-       eqn -s9 /usr/doc/beginners/u* | $fmtr $pkg $*
-       ;;
-uprog)
-       sed -f /usr/doc/cwscript /usr/doc/p? | $fmtr $pkg $* /usr/doc/p.mac -
-       ;;
-yacc)
-       refer -e /usr/doc/yacc/ss* | $fmtr $pkg $*
-       ;;
-lint)
-       refer -e /usr/doc/lint | $fmtr $pkg $*
-       ;;
-ratfor)
-       $fmtr $pkg $* /usr/doc/ratfor/m*
-       ;;
-m4)
-       $fmtr $pkg $* /usr/doc/m4 
-       ;;
-refer)
-       refer /usr/doc/refer/refer | tbl | $fmtr $pkg $*
-       ;;
-pub*)
-       tbl /usr/doc/refer/pubuse | $fmtr -rP1 $pkg $*
-       ;;
-lex)
-       tbl /usr/doc/lex | $fmtr -mcp $*
-       ;;
-tbl)
-       tbl /usr/doc/tbl | eqn | $fmtr $pkg $*
-       ;;
-ms*)
-       tbl /usr/doc/msmacros/ms | $fmtr $pkg $*
-       tbl /usr/doc/msmacros/refcard | eqn | $fmtr $*
-       ;;
-awk)
-       refer -e /usr/doc/awk | tbl | $fmtr $pkg $*
-       ;;
-adb)
-       $fmtr $pkg $* /usr/doc/adb/tut*
-       ;;
-password)
-       tbl /usr/doc/password | eqn | $fmtr $pkg $*
-       ;;
-secur*)
-       $fmtr $pkg $* /usr/doc/security
-       ;;
-uucp)
-       $fmtr $pkg $* /usr/doc/uucp/network
-       ;;
-uucpimp*)
-       $fmtr $pkg $* /usr/doc/uucp/implement
-       ;;
-iosys)
-       $fmtr $pkg $* /usr/doc/iosys 
-       ;;
-port|p*tour)
-       refer -e /usr/doc/porttour/p* | $fmtr $pkg $*
-       ;;
-setup)
-       $fmtr $pkg $* /usr/doc/setup
-       ;;
-regen)
-       $fmtr $pkg $* /usr/doc/regen
-       ;;
-learn)
-       refer -e /usr/doc/learn/p? | tbl | $fmtr $pkg $*
-       ;;
-*)
-       echo 'what is' $name 1>&2
-       ;;
-
-esac
diff --git a/.ref-Research-V7/usr/doc/scope b/.ref-Research-V7/usr/doc/scope
deleted file mode 100755 (executable)
index 5b9839f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-./run $1 -t | tc
diff --git a/.ref-Research-V7/usr/doc/security b/.ref-Research-V7/usr/doc/security
deleted file mode 100644 (file)
index c1ae396..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-.ND June 10, 1977
-.TL
-On the Security of UNIX
-.AU
-Dennis M. Ritchie
-.AI
-.MH
-.PP
-Recently there has been much interest in the security
-aspects of operating systems and software.
-At issue is the ability
-to prevent undesired
-disclosure of information, destruction of information,
-and harm to the functioning of the system.
-This paper discusses the degree of security which can be provided
-under the
-.UX
-system and offers a number of hints
-on how to improve security.
-.PP
-The first fact to face is that
-.UX
-was not developed with
-security, in any realistic sense, in mind;
-this fact alone guarantees a vast number of holes.
-(Actually the same statement can be made with respect
-to most systems.)
-The area of security in which
-.UX
-is theoretically weakest is
-in protecting against crashing or at least crippling
-the operation of the system.
-The problem here is not mainly in uncritical
-acceptance of bad parameters to system calls\(em
-there may be bugs in this area, but none are known\(em
-but rather in lack of checks for excessive
-consumption of resources.
-Most notably, there is no limit on the amount of disk
-storage used, either in total space allocated or in
-the number of files or directories.
-Here is a particularly ghastly shell sequence guaranteed
-to stop the system:
-.DS
-while : ; do
-       mkdir x
-       cd x
-done
-.DE
-Either a panic will occur because all the i-nodes
-on the device are used up, or all the disk blocks will
-be consumed, thus preventing anyone from writing files
-on the device.
-.PP
-In this version of the system,
-users are prevented from creating more than
-a set number of processes simultaneously,
-so unless users are in collusion it is unlikely that any one
-can stop the system altogether.
-However, creation of 20 or so CPU or disk-bound jobs
-leaves few resources available for others.
-Also, if many large jobs are run simultaneously,
-swap space may run out, causing a panic.
-.PP
-It should be evident that excessive consumption of disk
-space, files, swap space, and processes can easily occur
-accidentally in malfunctioning programs
-as well as at command level.
-In fact
-.UX
-is essentially defenseless against this kind of
-abuse,
-nor is there any easy fix.
-The best that can be said is that it is generally
-fairly
-easy to detect what has happened when disaster
-strikes,
-to identify the user responsible,
-and take appropriate action.
-In practice,
-we have found that difficulties
-in this area are rather rare,
-but we have not been faced with malicious users,
-and enjoy a fairly generous supply of
-resources which have served to cushion us against
-accidental overconsumption.
-.PP
-The picture is considerably brighter
-in the area of protection of information
-from unauthorized perusal and destruction.
-Here the degree of security seems (almost)
-adequate theoretically, and the problems lie
-more in the necessity for care in the actual use of
-the system.
-.PP
-Each
-.UX
-file has associated with it
-eleven bits of protection information
-together with a user identification number and a user-group
-identification number
-(UID and GID).
-Nine of the protection bits
-are used to specify independently
-permission to read, to write, and to execute the file
-to the user himself, to members of the user's
-group, and to all other users.
-Each process generated
-by or for a user has associated with
-it an effective UID and a real UID, and an effective and real GID.
-When an attempt is made
-to access the file for reading, writing, or execution,
-the user process's effective UID is compared
-against the file's UID; if a match is obtained,
-access is granted provided the read, write, or execute
-bit respectively for the user himself is
-present.
-If the UID for the file and for the process fail to match,
-but the GID's do match, the group bits are used; if the GID's
-do not match, the bits for other users are tested.
-The last two bits of each file's protection information,
-called the set-UID and set-GID bits,
-are used only when the
-file is executed as a program.
-If, in this case, the set-UID bit is on for the file,
-the effective UID for the process is changed to the UID
-associated with the file; the change persists
-until the process terminates or until the UID
-changed again by another execution of a set-UID file.
-Similarly the effective group ID of a process is changed
-to the GID associated with a file
-when that file is executed and has the set-GID bit set.
-The real UID and GID of a process do not change
-when any file is executed,
-but only as the result of a privileged system
-call.
-.PP
-The basic notion of the set-UID and set-GID
-bits is that one may write a program which is executable
-by others and which maintains files accessible to others only
-by that program.
-The classical example is the game-playing program which
-maintains records of the scores of its players.
-The program itself has to read and write the score file,
-but
-no one but the game's sponsor can be allowed
-unrestricted access to the file lest they manipulate
-the game to their own advantage.
-The solution is to
-turn on the set-UID bit of the
-game
-program.
-When, and only when, it is invoked
-by players of the game, it may update the score file
-but ordinary programs executed by others cannot
-access the score.
-.PP
-There are a number of special cases involved
-in determining access permissions.
-Since executing a directory as a program is a meaningless
-operation, the execute-permission
-bit, for directories, is taken instead to mean
-permission to search the directory for a given file
-during the scanning of a path name;
-thus if a directory has execute permission but no read
-permission for a given user, he may access files
-with known names in the directory,
-but may not read (list) the entire contents of the
-directory.
-Write permission on a directory is interpreted to
-mean that the user may create and delete
-files in that directory;
-it is impossible
-for any user to write directly into any directory.
-.PP
-Another, and from the point of view of security, much
-more serious special case is that there is a ``super user''
-who is able to read any file and write any non-directory.
-The super-user is also able to change the protection
-mode and the owner UID and GID of any file
-and to invoke privileged system calls.
-It must be recognized that the mere notion of
-a super-user is a theoretical, and usually
-practical, blemish on any protection scheme.
-.PP
-The first necessity for a secure system
-is of course arranging that all files and directories
-have the proper protection modes.
-Traditionally,
-.UX
-software has been exceedingly
-permissive in this regard;
-essentially all commands create files
-readable and writable by everyone.
-In the current version,
-this policy may be easily adjusted to suit the needs of
-the installation or the individual user.
-Associated with each process and its descendants
-is a mask, which is in effect
-.I and\fR\|-ed
-with the mode of every file and directory created by
-that process.
-In this way, users can arrange that, by default,
-all their files are no more accessible than they wish.
-The standard mask, set by
-.I login,
-allows all permissions to the user himself and to his group,
-but disallows writing by others.
-.PP
-To maintain both data privacy and
-data integrity,
-it is necessary, and largely sufficient,
-to make one's files inaccessible to others.
-The lack of sufficiency could follow
-from the existence of set-UID programs
-created by the user
-and the possibility of total
-breach of system security
-in one of the ways discussed below
-(or one of the ways not discussed below).
-For greater protection,
-an encryption scheme is available.
-Since the editor is able to create encrypted
-documents, and the
-.I crypt
-command can be used to pipe such documents into
-the other text-processing programs,
-the length of time during which cleartext versions
-need be available is strictly limited.
-The encryption scheme used is not one of the strongest
-known, but it is judged adequate, in the sense that
-cryptanalysis
-is likely to require considerably more effort than more direct
-methods of reading the encrypted files.
-For example, a user who stores data that he regards as truly secret
-should be aware that he is implicitly trusting the system
-administrator not to install a version of the crypt command
-that stores every typed password in a file.
-.PP
-Needless to say, the system administrators
-must be at least as careful as their most
-demanding user to place the correct
-protection mode on the files under their
-control.
-In particular,
-it is necessary that special files be protected
-from writing, and probably reading, by ordinary
-users when
-they store sensitive files belonging to other
-users.
-It is easy to write programs that examine and change
-files by accessing the device
-on which the files live.
-.PP
-On the issue of password security,
-.UX
-is probably better than most systems.
-Passwords are stored in an encrypted form
-which, in the absence of serious attention
-from specialists in the field,
-appears reasonably secure,
-provided its limitations are understood.
-In the current version, it is based on a slightly
-defective version of the Federal DES;
-it is purposely defective so that
-easily-available hardware is useless for attempts at exhaustive
-key-search.
-Since both the encryption algorithm and the encrypted passwords
-are available,
-exhaustive enumeration of potential passwords
-is still feasible up to a point.
-We have observed that users choose passwords that are easy to guess:
-they are short, or from a limited alphabet, or
-in a dictionary.
-Passwords should be
-at least six characters long and randomly chosen from an alphabet
-which includes digits and special characters.
-.PP
-Of course there also exist
-feasible non-cryptanalytic
-ways of finding out passwords.
-For example: write a program which types out ``login:\|''
-on the typewriter and copies whatever is typed
-to a file of your own.
-Then invoke the command and go away until the victim arrives.
-.PP
-The set-UID (set-GID)
-notion must be used carefully if any security is to be maintained.
-The first thing to keep in mind is that
-a writable set-UID file can have another program copied onto it.
-For example, if the super-user
-.I (su)
-command is writable,
-anyone can copy the shell
-onto it and get a password-free version
-of
-.I su.
-A more subtle problem
-can come from
-set-UID programs which are not sufficiently
-careful of what is fed into them.
-To take an obsolete example,
-the previous version of the
-.I mail
-command was set-UID and owned by the super-user.
-This version sent mail to the recipient's own directory.
-The notion was that one should be able to send
-mail to anyone even if they want to protect
-their directories from writing.
-The trouble was that
-.I mail
-was rather dumb:
-anyone could mail someone else's private file to himself.
-Much more serious
-is the following scenario:
-make a file with a line like one in the password file
-which allows one to log in as the super-user.
-Then make a link named ``.mail'' to the password file
-in some writable
-directory on the same device as the password file (say /tmp).
-Finally mail the bogus login line to /tmp/.mail;
-You can then login as the super-user,
-clean up the incriminating evidence,
-and have your will.
-.PP
-The fact that users can mount their own disks and tapes
-as file systems
-can be another way of gaining super-user status.
-Once a disk pack is mounted, the system believes
-what is on it.
-Thus one can take a blank disk pack,
-put on it anything desired,
-and mount it.
-There are obvious and unfortunate consequences.
-For example:
-a mounted disk with garbage on it will crash the
-system;
-one of the files on the mounted disk can easily be
-a password-free version of
-.I su;
-other files can be unprotected entries for special files.
-The only easy fix for this problem is to
-forbid the use of
-.I mount
-to unprivileged users.
-A partial solution, not so restrictive,
-would be to have the
-.I mount
-command examine the special file for bad data,
-set-UID programs owned by others, and accessible
-special files,
-and balk at unprivileged invokers.
diff --git a/.ref-Research-V7/usr/doc/sed b/.ref-Research-V7/usr/doc/sed
deleted file mode 100644 (file)
index e0333b3..0000000
+++ /dev/null
@@ -1,1259 +0,0 @@
-.hw de-limit
-.hw de-limit-ing
-.RP
-....TM 78-1270-1 39199 39199-11
-.ND August 15, 1978
-.TL
-SED \(em A Non-interactive Text Editor
-.AU "MH 2C-555" 3302
-Lee E. McMahon
-.AI
-.MH
-.OK
-Context search
-Editing
-.AB
-.ul
-Sed
-is a non-interactive context editor
-that runs on the
-.UX
-operating system.
-.ul
-Sed
-is
-designed to be especially useful in
-three cases:
-.in +1i
-.LP
-.ti -.5i
-1)
-To edit files too large for comfortable
-interactive editing;
-.ti -.5i
-2)
-To edit any size file when the sequence
-of editing commands is too complicated to be comfortably
-typed in interactive mode.
-.ti -.5i
-3)
-To perform multiple `global' editing functions
-efficiently in one pass through the input.
-.in -1i
-.LP
-This memorandum constitutes a manual for users of
-.ul
-sed.
-.AE
-.CS 10 0 10 0 0 1
-.SH
-Introduction
-.LP
-.ul
-Sed
-is a non-interactive context editor designed to be especially useful in
-three cases:
-.in +1i
-.LP
-.ti -.5i
-1)
-To edit files too large for comfortable
-interactive editing;
-.ti -.5i
-2)
-To edit any size file when the sequence
-of editing commands is too complicated to be comfortably
-typed in interactive mode;
-.ti -.5i
-3)
-To perform multiple `global' editing functions
-efficiently in one pass through the input.
-.in -1i
-.LP
-Since only a few lines of the input reside in core
-at one time, and no temporary files are used,
-the effective size of file that can be edited is limited only
-by the requirement that the input and output fit simultaneously
-into available secondary storage.
-.LP
-Complicated editing scripts can be created separately and given
-to 
-.ul
-sed
-as a command file.
-For complex edits, this saves considerable typing, and its
-attendant errors.
-.ul
-Sed
-running from a command file is much more efficient than any interactive
-editor known to the author, even if that editor
-can be driven by a pre-written script.
-.LP
-The principal loss of functions compared to an interactive editor
-are lack of relative addressing (because of the line-at-a-time
-operation), and lack of immediate verification that a command has
-done what was intended.
-.LP
-.ul
-Sed
-is a lineal descendant of the UNIX editor,
-.ul
-ed.
-Because of the differences between interactive and non-interactive
-operation, considerable changes have been made between
-.ul
-ed
-and
-.ul
-sed;
-even confirmed users of
-.ul
-ed
-will frequently be surprised (and probably chagrined),
-if they rashly use 
-.ul
-sed
-without reading Sections 2 and 3 of this document.
-The most striking family resemblance between the two
-editors is in the class of patterns (`regular expressions') they
-recognize;
-the code for matching patterns is copied almost
-verbatim from the code for
-.ul
-ed,
-and the description of regular expressions in Section 2
-is copied almost verbatim from the UNIX Programmer's
-Manual[1]. (Both code and description were written by Dennis
-M. Ritchie.)
-.LP
-.SH
-1. Overall Operation
-.LP
-.ul
-Sed
-by default copies the standard input to the standard output,
-perhaps performing one or more editing commands on each
-line before writing it to the output.
-This behavior may be modified by flags on the command line;
-see Section 1.1 below.
-.LP
-The general format of an editing command is:
-.LP
-.in +1i
-[address1,address2][function][arguments]
-.LP
-.in -1i
-One or both addresses may be omitted; the format of addresses is
-given in Section 2.
-Any number of blanks or tabs may separate the addresses
-from the function.
-The function must be present; the available commands are discussed
-in Section 3.
-The arguments may be required or optional, according to which function
-is given; again, they are discussed in Section 3 under each individual
-function.
-.LP
-Tab characters and spaces at the beginning of lines are ignored.
-.LP
-.SH
-1.1. Command-line Flags
-.LP
-Three flags are recognized on the command line:
-.in +1i
-.ti -.5i
-.B
--n:
-.R
-tells
-.ul
-sed
-not to copy all lines, but only those specified by
-.ul
-p
-functions or
-.ul
-p
-flags after 
-.ul
-s
-functions (see Section 3.3);
-.ti -.5i
-.B
--e:
-.R
-tells
-.ul
-sed
-to take the next argument as an editing command;
-.ti -.5i
-.B
--f:
-.R
-tells
-.ul
-sed
-to take the next argument as a file name;
-the file should contain editing commands, one to a line.
-.in -1i
-.SH
-1.2. Order of Application of Editing Commands
-.LP
-Before any editing is done (in fact, before any input file is
-even opened), all the editing commands are compiled into
-a form which will be moderately efficient during
-the execution phase (when the commands are actually applied to
-lines of the input file).
-The commands are compiled in the order in which they are
-encountered; this is generally the order in which they will
-be attempted at execution time.
-The commands are applied one at a time; the input to each command
-is the output of all preceding commands.
-.LP
-The default linear order of application of editing commands can
-be changed by the flow-of-control commands,
-.ul
-t
-and
-.ul
-b
-(see Section 3).
-Even when the order of application is changed
-by these commands, it is still true that the input line to any
-command is the output of any previously applied command.
-.SH
-1.3.  Pattern-space
-.LP
-The range of pattern matches is called the pattern space.
-Ordinarily, the pattern space is one line of the input text,
-but more than one line can be read into the pattern space
-by using the
-.ul
-N
-command (Section 3.6.).
-.LP
-.SH
-1.4. Examples
-.LP
-Examples are scattered throughout the text.
-Except where otherwise noted,
-the examples all assume the following input text:
-.LP
-.in +.5i
-.nf
-In Xanadu did Kubla Khan
-A stately pleasure dome decree:
-Where Alph, the sacred river, ran
-Through caverns measureless to man
-Down to a sunless sea.
-.in -.5i
-.fi
-.LP
-(In no case is the output of the 
-.ul
-sed
-commands to be considered an improvement
-on Coleridge.)
-.LP
-.SH
-Example:
-.LP
-The command
-.in +.5i
-.LP
-2q
-.in -.5i
-.LP
-will quit after copying the first two lines of the input.
-The output will be:
-.LP
-.in +.5i
-.nf
-In Xanadu did Kubla Khan
-A stately pleasure dome decree:
-.in -.5i
-.fi
-.LP
-.SH
-2. ADDRESSES: Selecting lines for editing
-.LP
-Lines in the input file(s) to which editing commands are
-to be applied can be selected by addresses.
-Addresses may be either line numbers or context addresses.
-.LP
-The application of a group of commands can be controlled by
-one address (or address-pair) by grouping
-the commands with curly braces (`{ }')(Sec. 3.6.).
-.SH
-2.1. Line-number Addresses
-.LP
-A line number is a decimal integer.
-As each line is read from the input, a line-number counter
-is incremented;
-a line-number address matches (selects) the input
-line which causes the internal counter to equal the
-address line-number.
-The counter runs cumulatively through multiple input files;
-it is not reset when a new input file is opened.
-.LP
-As a special case, the character
-$
-matches the last line of the last input file.
-.SH
-2.2. Context Addresses
-.LP
-A context address is a pattern (`regular expression') enclosed in slashes (`/').
-The regular expressions recognized by
-.ul
-sed
-are constructed as follows:
-.in +1i
-.LP
-.ti -.5i
-1)
-An ordinary character (not one of those discussed below)
-is a regular expression, and matches that character.
-.LP
-.ti -.5i
-2)
-A circumflex `^' at the beginning of a regular expression
-matches the null character at the beginning of a line.
-.ti -.5i
-3)
-A dollar-sign `$' at the end of a regular expression
-matches the null character at the end of a line.
-.ti -.5i
-4)
-The characters `\en' match an imbedded newline character,
-but not the newline at the end of the pattern space.
-.ti -.5i
-5)
-A period `.' matches any character except the terminal newline
-of the pattern space.
-.ti -.5i
-6)
-A regular expression followed by an asterisk `*' matches any
-number (including 0) of adjacent occurrences of the regular
-expression it follows.
-.ti -.5i
-7)
-A string of characters in square brackets `[ ]' matches any character
-in the string, and no others.
-If, however, the first character of the string is circumflex `^',
-the regular expression matches any character
-.ul
-except
-the characters in the string and the terminal newline of the pattern space.
-.ti -.5i
-8)
-A concatenation of regular expressions is a regular expression
-which matches the concatenation of strings matched by the
-components of the regular expression.
-.ti -.5i
-9)
-A regular expression between the sequences `\e(' and `\e)' is
-identical in effect to the unadorned regular expression, but has
-side-effects which are described under the
-.ul
-s
-command below and specification 10) immediately below.
-.ti -.5i
-10)
-The expression
-.ul
-`\|\ed'
-means the same string of characters matched
-by an expression enclosed in `\e(' and `\e)'
-earlier in the same pattern.
-Here
-.ul
-d
-is a single digit;
-the string specified is that beginning with the
-\fId\|\fRth
-occurrence of `\e(' counting from the left.
-For example, the expression
-`^\e(.*\e)\e1' matches a line beginning with
-two repeated occurrences of the same string.
-.ti -.5i
-11)
-The null regular expression standing alone (e.g., `//') is
-equivalent to the  last regular expression compiled.
-.in -1i
-.LP
-To use one of the special characters (^ $ . * [ ] \e /) as a literal
-(to match an occurrence of itself in the input), precede the
-special character by a backslash `\e'.
-.LP
-For a context address to `match' the input requires that
-the whole pattern within the address match some
-portion of the pattern space.
-.SH
-2.3. Number of Addresses
-.LP
-The commands in the next section can have 0, 1, or 2 addresses.
-Under each command the maximum number of allowed addresses is
-given.
-For a command to have more addresses than the maximum allowed
-is considered an error.
-.LP
-If a command has no addresses, it is applied to every line
-in the input.
-.LP
-If a command has one address, it is applied to all
-lines which match that address.
-.LP
-If a command has two addresses, it is applied to the first
-line which matches the first address, and to all subsequent lines
-until (and including) the first subsequent line which matches
-the second address.
-Then an attempt is made on subsequent lines to again match the first
-address, and the process is repeated.
-.LP
-Two addresses are separated by a comma.
-.SH
-Examples:
-.LP
-.nf
-.in +.5i
-.ta 1i 2i
-/an/   matches lines 1, 3, 4 in our sample text
-/an.*an/       matches line 1
-/^an/  matches no lines
-/./    matches all lines
-/\e./  matches line 5
-/r*an/ matches lines 1,3, 4 (number = zero!)
-/\e(an\e).*\e1/        matches line 1
-.fi
-.in 0
-.LP
-.SH
-3. FUNCTIONS
-.LP
-All functions are named by a single character.
-In the following summary, the maximum number of allowable addresses
-is given enclosed in parentheses, then the single character
-function name, possible arguments enclosed in angles (< >),
-an expanded English translation of the single-character name,
-and finally a description of what each function does.
-The angles around the arguments are
-.ul
-not
-part of the argument, and should not be typed
-in actual editing commands.
-.SH
-3.1. Whole-line Oriented Functions
-.LP
-.in +1i
-.ti -.5i
-(2)d -- delete lines
-.if t .sp .5
-The
-.ul
-d
-function deletes from the file (does not write to the output)
-all those lines matched by its address(es).
-.if t .sp .5
-It also has the side effect that no further commands are attempted
-on the corpse of a deleted line;
-as soon as the
-.ul
-d
-function is executed, a new line is read from the input, and
-the list of editing commands is re-started from the beginning
-on the new line.
-.ti -.5i
-.if t .sp .5
-(2)n -- next line
-.if t .sp .5
-The
-.ul
-n
-function reads the next line from the input, replacing
-the current line.
-The current line is written to the output if it should
-be.
-The list of editing commands is continued 
-following the 
-.ul
-n
-command.
-.if t .sp .5
-.nf
-.in -.5i
-(1)a\e
-<text> -- append lines
-.in +.5i
-.fi
-.if t .sp .5
-The
-.ul
-a
-function causes the argument <text> to be written to the
-output after the line matched by its address.
-The
-.ul
-a
-command is inherently multi-line;
-.ul
-a
-must appear at the end of a line, and <text> may contain
-any number of lines.
-To preserve the one-command-to-a-line fiction,
-the interior newlines must be hidden by a
-backslash character (`\e') immediately preceding the
-newline.
-The <text> argument is terminated by the first unhidden
-newline (the first one not immediately preceded
-by backslash).
-.if t .sp .5
-Once an
-.ul
-a
-function is successfully executed, <text> will be
-written to the output regardless of what later commands do to
-the line which triggered it.
-The triggering line may be 
-deleted entirely; <text> will still be written to the output.
-.if t .sp .5
-The <text> is not scanned for address matches, and no editing
-commands are attempted on it.
-It does not cause any change in the line-number counter.
-.if t .sp .5
-.nf
-.in -.5i
-(1)i\e
-<text> -- insert lines
-.in +.5i
-.fi
-.if t .sp .5
-The
-.ul
-i
-function  behaves identically to the
-.ul
-a
-function, except that <text> is written to the output
-.ul
-before
-the matched line.
-All other comments about the
-.ul
-a
-function apply to the
-.ul
-i
-function as well.
-.if t .sp .5
-.nf
-.in -.5i
-(2)c\e
-<text> -- change lines
-.in +.5i
-.fi
-.if t .sp .5
-The
-.ul
-c
-function deletes the lines selected by its address(es),
-and replaces them with the lines in <text>.
-Like
-.ul
-a
-and
-.ul
-i,
-.ul
-c
-must be followed by a newline hidden by a backslash;
-and interior new lines in <text> must be hidden by
-backslashes.
-.if t .sp .5
-The
-.ul
-c
-command may have two addresses, and therefore select a range
-of lines.
-If it does, all the lines in the range are deleted, but only
-one copy of <text> is written to the output,
-.ul
-not
-one copy per line deleted.
-As with
-.ul
-a
-and
-.ul
-i,
-<text> is not scanned for address matches, and no
-editing commands are attempted on it.
-It does not change the  line-number counter.
-.if t .sp .5
-After a line has been deleted by a
-.ul
-c
-function, no further commands are attempted on the corpse.
-.if t .sp .5
-If text is appended after a line by
-.ul
-a
-or
-.ul
-r
-functions, and the line is subsequently changed, the text
-inserted by the
-.ul
-c
-function will be placed
-.ul
-before
-the text of the
-.ul
-a
-or
-.ul
-r
-functions.
-(The
-.ul
-r
-function is described in Section 3.4.)
-.if t .sp .5
-.in -1i
-.ul
-Note:
-Within the text put in the output by these functions,
-leading blanks and tabs will disappear, as always in 
-.ul
-sed
-commands.
-To get leading blanks and tabs into the output, precede the first
-desired blank or tab by a backslash; the backslash will not
-appear in the output.
-.SH
-Example:
-.LP
-The list of editing commands:
-.LP
-.in +.5i
-.nf
-n
-a\e
-XXXX
-d
-.in -.5i
-.fi
-.LP
-applied to our standard input, produces:
-.LP
-.in +.5i
-.nf
-In Xanadu did Kubhla Khan
-XXXX
-Where Alph, the sacred river, ran
-XXXX
-Down to a sunless sea.
-.in -.5i
-.fi
-.LP
-In this particular case,
-the same effect would be produced by either
-of the two following command lists:
-.LP
-.in +.5i
-.nf
-n              n
-i\e            c\e
-XXXX   XXXX
-d
-.in -.5i
-.fi
-.LP
-.in 0
-.SH
-3.2. Substitute Function
-.LP
-One very important function changes parts of lines selected by
-a context search within the line.
-.if t .sp .5
-.in +1i
-.ti -.5i
-(2)s<pattern><replacement><flags> -- substitute
-.if t .sp .5
-The
-.ul
-s
-function replaces
-.ul
-part
-of a line (selected by <pattern>) with <replacement>.
-It can best be read:
-.if t .sp .5
-.ti +1i
-Substitute for <pattern>, <replacement>
-.if t .sp .5
-The <pattern> argument contains a pattern,
-exactly like the patterns in addresses (see 2.2 above).
-The only difference between <pattern> and a context address is
-that the context address must be delimited by slash (`/') characters;
-<pattern> may be delimited by any character other than space or
-newline.
-.if t .sp .5
-By default, only the first string matched by <pattern> is replaced,
-but see the
-.ul
-g
-flag below.
-.if t .sp .5
-The
-<replacement> argument begins immediately after the
-second delimiting character of <pattern>, and must be followed
-immediately by another instance of the delimiting character.
-(Thus there are exactly 
-.ul
-three
-instances of the delimiting character.)
-.if t .sp .5
-The <replacement> is not a pattern,
-and the characters which are special in patterns
-do not have special meaning in <replacement>.
-Instead, other characters are special:
-.if t .sp .5
-.in +1i
-.ti -.5i
-&      is replaced by the string matched by <pattern>
-.if t .sp .5
-.ti -.5i
-.ul
-\ed
-(where
-.ul
-d
-is a single digit) is replaced by the \fId\fRth substring
-matched by parts of <pattern> enclosed in `\e(' and `\e)'.
-If nested substrings occur in <pattern>, the \fId\fRth
-is determined by counting opening delimiters (`\e(').
-.if t .sp .5
-As in patterns, special characters may be made
-literal by preceding them with backslash (`\e').
-.if t .sp .5
-.in -1i
-The <flags> argument may contain the following flags:
-.if t .sp .5
-.in +1i
-.ti -.5i
-g -- substitute <replacement> for all (non-overlapping)
-instances of <pattern> in the line.
-After a successful substitution, the scan for the next
-instance of <pattern> begins just after the end of the
-inserted characters; characters put into the line from
-<replacement> are not rescanned.
-.if t .sp .5
-.ti -.5i
-p -- print the line if a successful replacement was done.
-The
-.ul
-p
-flag causes the line to be written to the output if and only
-if a substitution was actually made by the
-.ul
-s
-function.
-Notice that if several
-.ul
-s
-functions, each followed by a
-.ul
-p
-flag, successfully substitute in the same input line,
-multiple copies of the line will be written to the
-output: one for each successful substitution.
-.if t .sp .5
-.ti -.5i
-w <filename> -- write the line to a file if a successful
-replacement was done.
-The
-.ul
-w
-flag causes lines which are actually substituted by the
-.ul
-s
-function to be written to a file named by <filename>.
-If <filename> exists before
-.ul
-sed
-is run, it is overwritten;
-if not, it is created.
-.if t .sp .5
-A single space must separate
-.ul
-w
-and <filename>.
-.if t .sp .5
-The possibilities of multiple, somewhat different copies of
-one input line being written are the same as for 
-.ul
-p.
-.if t .sp .5
-A maximum of 10 different file names may be mentioned after
-.ul
-w
-flags and
-.ul
-w
-functions (see below), combined.
-.in 0
-.SH
-Examples:
-.LP
-The following command, applied to our standard input,
-.LP
-.in +.5i
-s/to/by/w changes
-.in -.5i
-.LP
-produces, on the standard output:
-.LP
-.in +.5i
-.nf
-In Xanadu did Kubhla Khan
-A stately pleasure dome decree:
-Where Alph, the sacred river, ran
-Through caverns measureless by man
-Down by a sunless sea.
-.fi
-.in -.5i
-.LP
-and, on the file `changes':
-.LP
-.in +.5i
-.nf
-Through caverns measureless by man
-Down by a sunless sea.
-.fi
-.in -.5i
-.LP
-If the nocopy option is in effect, the command:
-.LP
-.in +.5i
-.nf
-s/[.,;?:]/*P&*/gp
-.fi
-.in -.5i
-.LP
-produces:
-.LP
-.in +.5i
-.nf
-A stately pleasure dome decree*P:*
-Where Alph*P,* the sacred river*P,* ran
-Down to a sunless sea*P.*
-.LP
-.in -.5i
-.fi
-Finally, to illustrate the effect of the
-.ul
-g
-flag,
-the command:
-.LP
-.in +.5i
-.nf
-/X/s/an/AN/p
-.in -.5i
-.fi
-.LP
-produces (assuming nocopy mode):
-.in +.5i
-.LP
-.nf
-In XANadu did Kubhla Khan
-.fi
-.in -.5i
-.LP
-and the command:
-.LP
-.in +.5i
-.nf
-/X/s/an/AN/gp
-.in -.5i
-.fi
-.LP
-produces:
-.LP
-.in +.5i
-.nf
-In XANadu did Kubhla KhAN
-.in -.5i
-.fi
-.LP
-.in 0
-.SH
-3.3. Input-output Functions
-.LP
-.in +1i
-.ti -.5i
-(2)p -- print
-.if t .sp .5
-The print function writes the addressed lines to the standard output file.
-They are written at the time the
-.ul
-p
-function is encountered, regardless of what succeeding
-editing commands may do to the lines.
-.if t .sp .5
-.ti -.5i
-(2)w <filename> -- write on <filename>
-.if t .sp .5
-The write function writes the addressed lines to the file named
-by <filename>.
-If the file previously existed, it is overwritten; if not, it is created.
-The lines are written exactly as they exist when the write function
-is encountered for each line, regardless of what subsequent
-editing commands may do to them.
-.if t .sp .5
-Exactly one space must separate the
-.ul
-w
-and <filename>.
-.if t .sp .5
-A maximum of ten different files may be mentioned in write
-functions and
-.ul
-w
-flags after
-.ul
-s
-functions, combined.
-.if t .sp .5
-.ti -.5i
-(1)r <filename> -- read the contents of a file
-.if t .sp .5
-The read function reads the contents of <filename>, and appends
-them after the line matched by the address.
-The file is read and appended regardless of what subsequent
-editing commands do to the line which matched its address.
-If
-.ul
-r
-and
-.ul
-a
-functions are executed on the same line,
-the text from the 
-.ul
-a
-functions and the
-.ul
-r
-functions is written to the output in the order that
-the functions are executed.
-.if t .sp .5
-Exactly one space must separate the
-.ul
-r
-and <filename>.
-If a file mentioned by a
-.ul
-r
-function cannot be opened, it is considered a null file,
-not an error, and no diagnostic is given.
-.if t .sp .5
-.in -1i
-NOTE:
-Since there is a limit to the number of files that can be opened
-simultaneously, care should be taken that no more than ten
-files be mentioned in
-.ul
-w
-functions or flags; that number is reduced by one if any
-.ul
-r
-functions are present.
-(Only one read file is open at one time.)
-.in 0
-.SH
-Examples
-.LP
-Assume that the file `note1'
-has the following contents:
-.LP
-.in +1i
-Note:  Kubla Khan (more properly Kublai Khan; 1216-1294)
-was the grandson and most eminent successor of Genghiz
-(Chingiz) Khan, and founder of the Mongol dynasty in China.
-.LP
-.in 0
-Then the following command:
-.LP
-.nf
-.in +.5i
-/Kubla/r note1
-.in -.5i
-.fi
-.LP
-produces:
-.LP
-.nf
-.in +.5i
-In Xanadu did Kubla Khan
-.in +.5i
-.fi
-Note:  Kubla Khan (more properly Kublai Khan; 1216-1294)
-was the grandson and most eminent successor of Genghiz
-(Chingiz) Khan, and founder of the Mongol dynasty in China.
-.in -.5i
-.nf
-A stately pleasure dome decree:
-Where Alph, the sacred river, ran
-Through caverns measureless to man
-Down to a sunless sea.
-.in -.5i
-.fi
-.LP
-.in 0
-.SH
-3.4.
-Multiple Input-line Functions
-.LP
-Three functions, all spelled with capital letters, deal
-specially with pattern spaces containing imbedded newlines;
-they are intended principally to provide pattern matches across
-lines in the input.
-.if t .sp .5
-.in +1i
-.ti -.5i
-(2)N -- Next line
-.if t .sp .5
-The next input line is appended to the current line in the
-pattern space; the two input lines are separated by an imbedded
-newline.
-Pattern matches may extend across the imbedded newline(s).
-.if t .sp .5
-.ti -.5i
-(2)D -- Delete first part of the pattern space
-.if t .sp .5
-Delete up to and including the first newline character
-in the current pattern space.
-If the pattern space becomes empty (the only newline
-was the terminal newline),
-read another line from the input.
-In any case, begin the list of editing commands again
-from its beginning.
-.if t .sp .5
-.ti -.5i
-(2)P -- Print first part of the pattern space
-.if t .sp .5
-Print up to and including the first newline in the pattern space.
-.if t .sp .5
-.in 0
-The 
-.ul
-P
-and
-.ul
-D
-functions are equivalent to their lower-case counterparts
-if there are no imbedded newlines in the pattern space.
-.in 0
-.SH
-3.5.  Hold and Get Functions
-.LP
-Four functions save and retrieve part of the input for possible later
-use.
-.if t .sp .5
-.in 1i
-.ti -.5i
-(2)h -- hold pattern space
-.if t .sp .5
-The
-.ul
-h
-functions copies the contents of the pattern space
-into a hold area (destroying the previous contents of the
-hold area).
-.if t .sp .5
-.ti -.5i
-(2)H -- Hold pattern space
-.if t .sp .5
-The
-.ul
-H
-function appends the contents of the pattern space
-to the contents of the hold area; the former and new contents
-are separated by a newline.
-.if t .sp .5
-.ti -.5i
-(2)g -- get contents of hold area
-.if t .sp .5
-The
-.ul
-g
-function copies the contents of the hold area into
-the pattern space (destroying the previous contents of the
-pattern space).
-.if t .sp .5
-.ti -.5i
-(2)G -- Get contents of hold area
-.if t .sp .5
-The
-.ul
-G
-function appends the contents of the hold area to the
-contents of the pattern space; the former and new contents are separated by
-a newline.
-.if t .sp .5
-.ti -.5i
-(2)x -- exchange
-.if t .sp .5
-The exchange command interchanges the contents
-of the pattern space and the hold area.
-.in 0
-.SH
-Example
-.LP
-The commands
-.nf
-.if t .sp .5
-       1h
-       1s/ did.*//
-       1x
-       G
-       s/\en/  :/
-.if t .sp .5
-.fi
-applied to our standard example, produce:
-.nf
-.if t .sp .5
-       In Xanadu did Kubla Khan  :In Xanadu
-       A stately pleasure dome decree:  :In Xanadu
-       Where Alph, the sacred river, ran  :In Xanadu
-       Through caverns measureless to man  :In Xanadu
-       Down to a sunless sea.  :In Xanadu
-.if t .sp .5
-.fi
-.SH
-3.6.  Flow-of-Control Functions
-.LP
-These functions do no editing on the input
-lines, but control the application of functions
-to the lines selected by the address part.
-.if t .sp .5
-.in +1i
-.ti -.5i
-(2)! -- Don't
-.if t .sp .5
-The
-.ul
-Don't
-command causes the next command
-(written on the same line), to be applied to all and only those input lines
-.ul
-not
-selected by the adress part.
-.if t .sp .5
-.ti -.5i
-(2){ -- Grouping
-.if t .sp .5
-The grouping command `{' causes the
-next set of commands to be applied
-(or not applied) as a block to the
-input lines selected by the addresses
-of the grouping command.
-The first of the commands under control of the grouping
-may appear on the same line as the
-`{' or on the next line.
-.LP
-The group of commands is terminated by a
-matching `}' standing on a line by itself.
-.LP
-Groups can be nested.
-.ti -.5i
-.if t .sp .5
-(0):<label> -- place a label
-.if t .sp .5
-The label function marks a place in the list
-of editing commands which may be referred to by
-.ul
-b
-and
-.ul
-t
-functions.
-The <label> may be any sequence of eight or fewer characters;
-if two different colon functions have identical labels,
-a compile time diagnostic will be generated, and
-no execution attempted.
-.if t .sp .5
-.ti -.5i
-(2)b<label> -- branch to label
-.if t .sp .5
-The branch function causes  the sequence of editing commands being
-applied to the current input line to be restarted immediately
-after the place where a colon function with the same <label>
-was encountered.
-If no colon function with the same label can be found after
-all the editing commands have been compiled, a compile time diagnostic
-is produced, and no execution is attempted.
-.if t .sp .5
-A
-.ul
-b
-function with no <label> is taken to be a branch to the end of the
-list of editing commands;
-whatever should be done with the current input line is done, and
-another input line is read; the list of editing commands is restarted from the
-beginning on the new line.
-.if t .sp .5
-.ti -.5i
-(2)t<label> -- test substitutions
-.if t .sp .5
-The
-.ul
-t
-function tests whether 
-.ul
-any
-successful substitutions have been made on the current input
-line;
-if so, it branches to <label>;
-if not, it does nothing.
-The flag which indicates that a successful substitution has
-been executed is reset by:
-.if t .sp .5
-.in +1i
-1) reading a new input line, or
-.br
-2) executing a
-.ul
-t
-function.
-.if t .sp .5
-.in 0
-.SH
-3.7. Miscellaneous Functions
-.LP
-.in +1i
-.ti -.5i
-(1)= -- equals
-.if t .sp .5
-The = function writes to the standard output the line number of the
-line matched by its address.
-.if t .sp .5
-.ti -.5i
-(1)q -- quit
-.if t .sp .5
-The
-.ul
-q
-function causes the current line to be written to the
-output (if it should be), any appended or read text to be written, and
-execution to be terminated.
-.in 0
-.SH
-.SH
-Reference
-.IP [1]
-Ken Thompson and Dennis M. Ritchie,
-.ul
-The UNIX Programmer's Manual.
-Bell Laboratories, 1978.
diff --git a/.ref-Research-V7/usr/doc/setup b/.ref-Research-V7/usr/doc/setup
deleted file mode 100644 (file)
index 107b8ec..0000000
+++ /dev/null
@@ -1,787 +0,0 @@
-.TL
-Setting Up
-Unix
-\- Seventh Edition
-.AU
-Charles B. Haley
-Dennis M. Ritchie
-.AI
-.MH
-.PP
-The distribution tape can be used only on a DEC PDP11/45
-or PDP11/70 with RP03, RP04, RP05, RP06 disks and with
-a TU10, TU16, or TE16 tape drive.
-It consists of some preliminary bootstrapping programs followed by
-two file system images;
-if needed, after the initial construction of the file systems
-individual files can be extracted. (See restor(1))
-.PP
-If you are set up to do it,
-it might be a good idea immediately to make a copy of the
-tape to guard against disaster.
-The tape is 9-track 800 BPI and contains some 512-byte records
-followed by many 10240-byte records.
-There are interspersed tapemarks.
-.PP
-The system as distributed contains binary images
-of the system and all the user level programs, along with source
-and manual sections for them\(emabout
-2100 files altogether.
-The binary images,
-along with other
-things needed to flesh out the file system enough so UNIX will run,
-are to be put on one file system called the `root file system'.
-The file system size required is about 5000 blocks.
-The file second system has all of the source and documentation.
-Altogether it amounts to more than 18,000 512-byte blocks.
-.SH
-Making a Disk From Tape
-.PP
-Perform the following bootstrap procedure to obtain
-a disk with a root file system on it.
-.IP 1.
-Mount the magtape on drive 0 at load point.
-.IP 2.
-Mount a formatted disk pack on drive 0.
-.IP 3.
-Key in and execute at 100000
-.RT
-.DS
-  TU10                   TU16/TE16
-012700                 Use the DEC ROM or other
-172526                 means to load block 1
-010040                 (i.e. second block) at 800 BPI
-012740                 into location 0 and transfer
-060003                 to 0.
-000777
-.DE
-.IP
-The tape should move and the CPU loop.
-(The TU10 code is
-.I
-not
-.R
-the DEC bulk ROM for tape;
-it reads block 0, not block 1.)
-.IP 4.
-If you used the above TU10 code, halt and restart the
-CPU at 0, otherwise continue to the next step.
-.IP 5.
-The console should type
-.DS
-.I
-Boot
-:
-.R
-.DE
-Copy the magtape to disk by the following procedure.
-The machine's printouts are shown in italic,
-explanatory comments are within ( ).
-Terminate each line you type by carriage return or line-feed.
-There are two classes of tape drives:
-the name `tm' is used for the TU10, and `ht' is used for
-the TU16 or TE16.
-There are also two classes of disks:
-`rp' is used for the RP03, and `hp' is used for the
-RP04/5/6.
-.PP
-If you should make a mistake while typing, the character '#'
-erases the last character typed up to the beginning of the line,
-and the character '@' erases the entire line typed.
-Some consoles cannot print lower case letters, adjust the
-instructions accordingly.
-.DS
-(bring in the program mkfs)
-\fI:\|\fRtm(0,3)               (use `ht(0,3)' for the TU16/TE16)
-\fIfile system size:\fR 5000
-\fIfile system:\fR rp(0,0)             (use `hp(0,0)' for RP04/5/6)
-.I
-isize = XX
-m/n = XX
-.R
-(after a while)
-.I
-exit called
-Boot
-:
-.R
-.DE
-This step makes an empty file system.
-.IP 6.
-The next thing to do is to restore the data
-onto the new empty file system. To do this you respond to
-the `\fI:\fR' printed in the last step with
-.DS
-(bring in the program restor)
-\fI:\|\fRtm(0,4)               (`ht(0,4)' for TU16/TE16)
-\fItape?\fR tm(0,5)    (use `ht(0,5)' for TU16/TE16)
-\fIdisk?\fR rp(0,0)            (use `hp(0,0)' for RP04/5/6)
-\fILast chance before scribbling on disk.\fR (you type return)
-(the tape moves, perhaps 5-10 minutes pass)
-\fIend of tape\fR
-.I
-Boot
-:
-.R
-.DE
-You now have a UNIX root file system.
-.SH
-Booting UNIX
-.PP
-You probably have
-the bootstrap running, left over from the last step above;
-if not,
-repeat the boot process (step 3) again.
-Then use one of the following:
-.DS
-\fI:\|\fRrp(0,0)rptmunix               (for RP03 and TU10)
-\fI:\|\fRrp(0,0)rphtunix               (for RP03 and TU16/TE16)
-\fI:\|\fRhp(0,0)hptmunix               (for RP04/5/6 and TU10)
-\fI:\|\fRhp(0,0)hphtunix               (for RP04/5/6 and TU16/TE16)
-.DE
-The machine should type the following:
-.DS
-.I
-mem = xxx
-#
-.R
-.DE
-The
-.I
-mem
-.R
-message gives the memory available to user programs
-in bytes.
-.PP
-UNIX is now running,
-and the `UNIX Programmer's manual' applies;
-references below of the form X(Y) mean the subsection named
-X in section Y of the manual.
-The `#' is the prompt from the Shell,
-and indicates you are the super-user.
-The user name of the super-user is `root'
-if you should find yourself in multi-user mode and
-need to log in;
-the password is also `root'.
-.PP
-To simplify your life later, rename the appropriate version
-of the system as specified above plain `unix.'
-For example, use mv (1) as follows if you have an RP04/5/6 and
-a TU16 tape:
-.DS
-mv hphtunix unix
-.DE
-In the future, when you reboot,
-you can type just
-.DS
-hp(0,0)unix
-.DE
-to the `:' prompt.
-(Choose appropriately among `hp', `rp', `ht', `tm'
-according to your configuration).
-.PP
-You now need to make some special file entries
-in the dev directory. These specify what sort of disk you
-are running on, what sort of tape drive you have,
-and where the file systems are. 
-For simplicity, this recipe creates fixed device names.
-These names will be used below, and some of them are built into
-various programs, so they are most convenient.
-However, the names do not always represent the actual major and
-minor device in the manner suggested in section 4 of the
-Programmer's Manual.
-For example, `rp3' will be used for the name of the file system
-on which the user file system is put, even though it might be on an RP06
-and is not logical device 3.
-Also, this sequence will put the user file system on the same
-disk drive as the root, which is not the best place
-if you have more than one drive.
-Thus the prescription below should be taken only as one example
-of where to put things.
-See also the section on `Disk layout' below.
-.PP
-In any event, change to the dev directory (cd(1)) and, if you like,
-examine and perhaps change the makefile there (make (1)).
-.DS
-cd /dev
-cat makefile
-.DE
-Then, use one of
-.DS
-make rp03
-make rp04
-make rp05
-make rp06
-.DE
-depending on which disk you have.
-Then, use one of
-.DS
-make tm
-make ht
-.DE
-depending on which tape you have.
-The file `rp0' refers to the root file system;
-`swap' to the swap-space file system; `rp3' to the
-user file system.
-The devices `rrp0' and `rrp3' are the `raw' versions
-of the disks.
-Also, `mt0' is tape drive 0, at 800 BPI;
-`rmt0' is the raw tape, on which large records can be read
-and written;
-`nrmt0' is raw tape with the quirk that it does not rewind
-on close, which is a subterfuge that permits
-multifile tapes to be handled.
-.PP
-The next thing to do is to extract the rest of the data from
-the tape.
-Comments are enclosed in ( ); don't type these.
-The number in the first command is the
-size of the file system;
-it differs between RP03, RP04/5, and RP06.
-.DS
-/etc/mkfs /dev/rp3 74000       (153406 if on RP04/5, 322278 on RP06)
-(The above command takes about 2-3 minutes on an RP03)
-dd if=/dev/nrmt0 of=/dev/null bs=20b files=6   (skip 6 files on the tape)
-restor rf /dev/rmt0 /dev/rp3   (restore the file system)
-(Reply with a `return' (CR) to the `Last chance' message)
-(The restor takes about 20-30 minutes)
-.DE
-All of the data on the tape has been extracted.
-.PP
-You may at this point mount the source
-file system (mount(1)). To do this type the following:
-.DS
-/etc/mount /dev/rp3 /usr
-.DE
-The source and manual
-pages are now available in subdirectories of /usr.
-.PP
-The above mount command is only needed if you
-intend to play around with source on a single
-user system, which you are going to do next.
-The file system is mounted automatically when multi-user
-mode is entered, by a command in the file
-/etc/rc. (See `Disk Layout' below).
-.PP
-Before anything further is done the bootstrap
-block on the disk (block 0) should be filled in.
-This is done using the command
-.DS
-dd if=/usr/mdec/rpuboot of=/dev/rp0 count=1
-.DE
-if you have the RP03, or
-.DS
-dd if=/usr/mdec/hpuboot of=/dev/rp0 count=1
-.DE
-if you have an RP04/5/6.
-Now the DEC disk bootstraps are usable.
-See Boot Procedures(8) for further information.
-.PP
-Before UNIX is turned up completely,
-a few configuration dependent exercises must be
-performed.
-At this point,
-it would be wise to read all of the manuals
-(especially `Regenerating System Software')
-and to augment this reading with hand to hand
-combat.
-.SH
-Reconfiguration
-.PP
-The UNIX system running is configured to run
-with the given disk
-and tape, a console, and no other device.
-This is certainly not the correct
-configuration.
-You will have to correct the configuration table to reflect
-the true state of your machine.
-.PP
-It is wise at this point to know how to recompile the system.
-Print (cat(1))
-the file /usr/sys/conf/makefile.
-This file is input to the program `make(1)' which
-if invoked with `make all' will recompile all of
-the system source and
-install it in the correct libraries.
-.PP
-The program mkconf(1) prepares files that
-describe a given configuration (See mkconf(1)).
-In the /usr/sys/conf directory,
-the four files
-\fIxy\fRconf
-were input to mkconf to produce the four versions of the system
-\fIxy\fRunix.
-Pick the appropriate one, and edit it to add lines describing your own configuration.
-(Remember the console typewriter is automatically included;
-don't count it in the kl specification.)
-Then run mkconf;
-it will generate the files l.s
-(trap vectors) c.c (configuration table),
-and mch0.s.
-Take a careful look at
-l.s to make sure that all the devices that you
-have are assembled in the correct interrupt vectors.
-If your configuration is non-standard, you will
-have to modify l.s to fit your configuration.
-.PP
-There are certain magic numbers and
-configuration parameters imbedded in various
-device drivers that you may want to change.
-The device addresses of each device
-are defined in each driver.
-In case you have any non-standard device
-addresses,
-just change the address and recompile.
-(The device drivers are in the directory
-/usr/sys/dev.)
-.PP
-The DC11 driver is set to run 4 lines.
-This can be changed in dc.c.
-.PP
-The DH11 driver is set to handle 3 DH11's with
-a full complement of 48 lines.
-If you have less, or more, 
-you may want to edit dh.c.
-.PP
-The DN11 driver will handle 4 DN's.
-Edit dn.c.
-.PP
-The DU11 driver can only handle a single DU.
-This cannot be easily changed.
-.PP
-The KL/DL driver is set up to run
-a single DL11-A, -B, or -C (the console)
-and no DL11-E's.
-To change this, edit
-kl.c to have NKL11 reflect the total number of
-DL11-ABC's and
-NDL11 to reflect the number of DL11-E's.
-So far as the driver is concerned,
-the difference between the devices is
-their address.
-.PP
-All of the disk and tape drivers
-(rf.c, rk.c, rp.c, tm.c, tc.c,
-hp.c, ht.c)
-are set up to run 8 drives and should not
-need to be changed.
-The big disk drivers (rp.c and hp.c)
-have partition tables in them which you
-may want to experiment with.
-.PP
-After all the corrections
-have been made,
-use `make(1)' to recompile the system (or
-recompile individually if you wish: use the makefile
-as a guide).
-If you compiled individually, say `make unix' in the
-directory /usr/sys/conf.
-The final object file (unix) should be
-moved to the root, and then booted to try it out.
-It is best to name it /nunix so as not to destroy
-the working system until you're sure it does work.
-See Boot Procedures(8) for a discussion
-of booting.
-Note:  before taking the system down,
-always (!!) perform
-a sync(1)
-to force delayed output to the disk.
-.SH
-Special Files
-.PP
-Next you must put in special files for the new devices in
-the directory /dev using mknod(1).
-Print the configuration file
-c.c created above.
-This is the major
-device switch of each device class (block and character).
-There is one line for each device configured in your system
-and a null line for place holding for those devices
-not configured.
-The essential block special files were installed above;
-for any new devices,
-the major device number is selected by counting the
-line number (from zero)
-of the device's entry in the block configuration table.
-Thus the first entry in the table bdevsw would be
-major device zero.
-This number is also printed in the table along the right margin.
-.PP
-The minor device is the drive number,
-unit number or partition as described
-under each device in section 4 of the manual.
-For tapes where the unit is dial selectable,
-a special file may be made for each possible
-selection.
-You can also add entries for other disk drives.
-.PP
-In reality, device names are arbitrary. It is usually
-convenient to have a system for deriving names, but it doesn't
-have to be the one presented above.
-.PP
-Some further notes on minor device numbers.
-The hp driver uses the 0100 bit of the minor device number to
-indicate whether or not to interleave a file system across
-more than one physical device. See hp(4) for more detail.
-The tm and ht drivers use the 0200 bit to indicate whether
-or not to rewind the tape when it is closed. The
-0100 bit indicates the density of the tape on TU16 drives.
-By convention, tape special files with the 0200 bit on have an `n'
-prepended to their name, as in /dev/nmt0 or /dev/nrmt1.
-Again, see tm(4) or ht(4).
-.PP
-The naming of character devices is similar to block devices.
-Here the names are even more arbitrary except that
-devices meant to be used
-for teletype access should (to avoid confusion, no other reason) be named
-/dev/ttyX, where X is some string (as in `00' or `library').
-The files console, mem, kmem, and null are
-already correctly configured.
-.PP
-The disk and magtape drivers provide a `raw' interface
-to the device which provides direct transmission
-between the user's core and the device and allows
-reading or writing large records.
-The raw device counts as a character device,
-and should have the name of the corresponding
-standard block special file with `r' prepended.
-(The `n' for no rewind tapes violates this rule.)
-Thus the raw magtape
-files would be called /dev/rmtX.
-These special files should be made.
-.PP
-When all the special files have been created,
-care should be taken to change
-the access modes (chmod(1))
-on these files to appropriate values (probably 600 or 644).
-.SH
-Floating Point
-.PP
-UNIX only supports (and really expects to have) the FP11-B/C
-floating point unit.
-For machines without this hardware,
-there is a user subroutine
-available that will catch illegal instruction
-traps and interpret floating point operations.
-(See fptrap(3).)
-To install this subroutine in the library, change to /usr/src/libfpsim
-and execute the shell files
-.DS
-       compall
-       mklib
-.DE
-The system as delivered does not have this code included
-in any command,
-although the operating system adapts automatically to the
-presence or absence of the FP11.
-.PP
-Next, a floating-point version of
-the C compiler in /usr/src/cmd/c
-should be compiled using the commands:
-.DS
-cd /usr/src/cmd/c
-make fc1
-mv fc1 /lib/fc1
-.DE
-This allows programs with floating point constants
-to be compiled.
-To compile floating point programs use the `\-f'
-flag to cc(1). This flag ensures that the floating
-point interpreter is loaded with the program and that
-the floating point version of `cc' is used.
-.SH
-Time Conversion
-.PP
-If your machine is not in the Eastern time zone,
-you must edit (ed(1)) the file
-/usr/sys/h/param.h
-to reflect your local time.
-The manifest `TIMEZONE' should be changed
-to reflect the time difference between local time and GMT in minutes.
-For EST, this is 5*60; for PST it would be 8*60.
-Finally, there is a `DSTFLAG'
-manifest;
-when it is 1 it causes the
-time to shift to Daylight Savings automatically
-between the last Sundays in April and October
-(or other algorithms in 1974 and 1975).
-Normally this will not have to be reset.
-When the needed changes are done, recompile and load the
-system using
-make(1)
-and install it.
-(As a general rule, when a system header file is changed,
-the entire system should be recompiled.
-As it happens, the only uses of these flags are in
-/usr/sys/sys/sys4.c, so if this is all that was changed it
-alone needs to be recompiled.)
-.PP
-You may also want to look at timezone(3)
-(/usr/src/libc/gen/timezone.c) to see
-if the name of your timezone is in its internal table.
-If needed, edit the changes in.
-After timezone.c has been edited
-it should be compiled and installed in
-its library.
-(See /usr/src/libc/(mklib and compall))
-Then you should
-(at your leisure)
-recompile and reinstall
-all programs that use it (such as date(1)).
-.SH
-Disk Layout
-.PP
-If
-there are to be more file systems mounted than just the root
-and /usr,
-use mkfs(1) to create any new file system and
-put its mounting in the file /etc/rc (see init(8) and mount(1)).
-(You might look at /etc/rc anyway to
-see what has been provided for you.)
-.PP
-There are two considerations in deciding how to adjust the arrangement
-of things on your disks:
-the most important is making sure there is adequate space
-for what is required;
-secondarily, throughput should be maximized.
-Swap space is a critical parameter.
-The system
-as distributed has 8778 (hpunix) or 2000 (rpunix) blocks 
-for swap space.
-This should be large enough so running out of swap space never
-occurs.
-You may want to change these if local wisdom indicates otherwise.
-.PP
-The system as distributed has all of the binaries in /bin.
-Most of
-them should be moved to /usr/bin, leaving only the ones required for
-system maintenance (such as icheck, dcheck, cc, ed, restor, etc.) and the most
-heavily used in /bin.
-This will speed things up a bit if you have only one disk, and also free
-up space on the root file system for temporary files. (See below).
-.PP
-Many common system programs (C, the editor, the assembler etc.)
-create intermediate files in the /tmp directory,
-so the file system where this is stored also should be made
-large enough to accommodate
-most high-water marks.
-If you leave the root file system as distributed
-(except as discussed above) there
-should be no problem.
-All the programs that create files in /tmp take
-care to delete them, but most are not immune to
-events like being hung up upon, and can leave dregs.
-The directory should be examined every so often and the old
-files deleted.
-.PP
-Exhaustion of user-file space is certain to occur
-now and then;
-the only mechanisms for controlling this phenomenon
-are occasional use of du(1), df(1), quot(1), threatening
-messages of the day, and personal letters.
-.PP
-The efficiency with which UNIX is able to use the CPU
-is largely dictated by the configuration of disk controllers.
-For general time-sharing applications,
-the best strategy is to try to split user files,
-the root directory (including the /tmp directory)
-and the swap area among three controllers.
-.PP
-Once you have decided how to make best use
-of your hardware, the question is how to initialize it.
-If you have the equipment,
-the best way to move a file system
-is to dump it (dump(1)) to magtape,
-use mkfs(1) to create the new file system,
-and restore (restor(1)) the tape.
-If for some reason you don't want to use magtape,
-dump accepts an argument telling where to put the dump;
-you might use another disk.
-Sometimes a file system has to be increased in logical size
-without copying.
-The super-block of the device has a word
-giving the highest address which can be allocated.
-For relatively small increases, this word can be patched
-using the debugger (adb(1))
-and the free list reconstructed using icheck(1).
-The size should not be increased very greatly
-by this technique, however,
-since although the allocatable space will increase
-the maximum number of files will not (that is, the i-list
-size can't be changed).
-Read and understand the description given in file system(5)
-before playing around in this way.
-You may want to
-see section rp(4) for some suggestions
-on how to lay out the information on RP disks.
-.PP
-If you have to merge a file system into another, existing one,
-the best bet is to
-use tar(1).
-If you must shrink a file system, the best bet is to dump
-the original and restor it onto the new filesystem.
-However, this might not work if the i-list on the smaller filesystem
-is smaller than the maximum allocated inode on the larger.
-If this is the case, reconstruct the filesystem from scratch
-on another filesystem (perhaps using tar(1)) and then dump it.
-If you
-are playing with the root file system and only have one drive
-the procedure is more complicated. What you do is the following:
-.IP 1.
-GET A SECOND PACK!!!!
-.IP 2.
-Dump the current root filesystem (or the reconstructed one) using dump(1).
-.IP 3.
-Bring the system down and mount the new pack.
-.IP 4.
-Retrieve the WECo distribution tape and perform steps 1 through
-5 at the beginning of this document,
-substituting the desired file system size instead of 5000
-when asked for `file system size'.
-.IP 5.
-Perform step 6 above up to the point where the `tape'
-question is asked. At this point mount the tape
-you made just a few minutes ago. Continue with step 6 above substituting
-a 0 (zero) for the 5.
-.SH
-New Users
-.PP
-Install new users by editing the password file
-/etc/passwd (passwd(5)).
-This procedure should be done once multi-user mode is entered
-(see init(8)).
-You'll have to make a current directory for each new user
-and change its owner to the
-newly installed name.
-Login as each user to make sure the password
-file is correctly edited.
-For example:
-.DS
-ed /etc/passwd
-$a
-joe::10:1::/usr/joe:
-.li
-.
-w
-q
-mkdir /usr/joe
-chown joe /usr/joe
-login joe
-ls \-la
-login root
-.DE
-This will make a new login entry for joe,
-who should be encouraged to use passwd(1)
-to give himself a password.
-His default current directory is
-/usr/joe
-which has been created.
-The delivered password file
-has the user
-.I
-bin
-.R
-in it to be used as a prototype.
-.SH
-Multiple Users
-.PP
-If UNIX is to support simultaneous
-access from more than just the console terminal,
-the file /etc/ttys (ttys(5)) has to be edited.
-To add a new terminal be sure the device is configured
-and the special file exists, then set
-the first character of the appropriate line of /etc/ttys to 1
-(or add a new line).
-Note that init.c will have to be recompiled if there are to be
-more than 100 terminals.
-Also note that if the special file is inaccessible when init tries to create a process
-for it, the system will thrash trying and retrying to open it.
-.SH
-File System Health
-.PP
-Periodically (say every day or so) and always after a crash,
-you should check all the file systems for consistency
-(icheck, dcheck(1)).
-It is quite important to execute sync (8)
-before rebooting or taking the machine down.
-This is done automatically every 30 seconds by the update
-program (8) when a multiple-user system is running,
-but you should do it anyway to make sure.
-.PP
-Dumping of the file system should be done regularly,
-since once the system is going it is very easy to
-become complacent.
-Complete and incremental dumps are easily done with
-dump(1).
-Dumping of files by name is best done by
-tar(1) but the number of files is somewhat limited.
-Finally if there are enough drives entire
-disks can be copied using cp(1), or preferably with
-dd(1) using the raw special files and an appropriate
-block size.
-.SH
-Converting Sixth Edition Filesystems
-.PP
-The best way to convert file systems from 6th
-edition (V6) to 7th edition (V7) format
-is to use tar(1). However, a special version of tar must
-be prepared
-to run on V6.
-The following steps will do this:
-.IP 1.
-change directories to /usr/src/cmd/tar
-.IP 2.
-At the shell prompt respond
-.DS
-make v6tar
-.DE
-This will leave an executable binary named `v6tar'.
-.IP 3.
-Mount a scratch tape.
-.IP 4.
-Use tp(1) to put `v6tar' on the scratch
-tape.
-.IP 5.
-Bring down V7 and bring up V6.
-.IP 6.
-Use tp (on V6) to read in `v6tar'. Put it in
-/bin or /usr/bin (or perhaps some other preferred location).
-.IP 7.
-Use v6tar to make tapes of all that you wish to convert.
-You may want to read the manual section on tar(1) to
-see whether you want to use blocking or not.
-Try to avoid using full pathnames when making the tapes. This
-will simplify moving the hierarchy to some other place on 
-V7 if desired. For example
-.DS
-chdir /usr/ken
-v6tar c .
-.DE
-is preferable to
-.DS
-v6tar c /usr/ken
-.DE
-.IP 8.
-After all of the desired tapes are made, bring
-down V6 and reboot V7. Use
-tar(1) to read in the tapes just made.
-.SH
-Odds and Ends
-.PP
-The programs
-dump,
-icheck, quot, dcheck, ncheck, and df
-(source in /usr/source/cmd)
-should be changed to
-reflect your default mounted file system devices.
-Print the first few lines of these
-programs and the changes will be obvious.
-Tar should be changed to reflect your desired
-default tape drive.
-.sp 3
-.in 4i
-Good Luck
-.sp 1
-Charles B. Haley
-.br
-Dennis M. Ritchie
diff --git a/.ref-Research-V7/usr/doc/shell/t.mac b/.ref-Research-V7/usr/doc/shell/t.mac
deleted file mode 100644 (file)
index 93fe4c4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-.ds ZZ \fB.\|.\|.\fP
-.ds ST \v'.3m'\s+2*\s0\v'-.3m'
-.ds DO \h'\w'do 'u'
-.ds Ca \h'\w'case 'u'
-.ds WH \h'\w'while 'u'
-.ds VT \|\fB\(or\fP\|
-.ds TH \h'\w'then 'u'
-.ds DC \*(DO\*(CA
-.ds AP >\h'-.2m'>
-.ds HE <\h'-.2m'<
-..     \" macros for algol 68c reference manual
-.ds DA 1977 November 1
-.ds md \v'.25m'
-.ds mu \v'-.25m'
-.ds U \*(mu\s-3
-.ds V \s0\*(md
-.ds L \*(md\s-3
-.ds M \s0\*(mu
-.ds S \s-1
-.ds T \s0
-..     \" small 1
-.ds O \*S1\*T
-.ds h \|
-.ds s \|\|
-..     \" ellipsis
-.ds e .\|.\|.
-..     \" subscripts
-.ds 1 \*(md\s-41\s0\*(mu
-.ds 2 \*(md\s-42\s0\*(mu
diff --git a/.ref-Research-V7/usr/doc/shell/t1 b/.ref-Research-V7/usr/doc/shell/t1
deleted file mode 100644 (file)
index 4f735c8..0000000
+++ /dev/null
@@ -1,438 +0,0 @@
-.RP
-.TL 
-An Introduction to the UNIX Shell
-.AU
-S. R. Bourne
-.AI
-.MH
-.AB
-.LP
-The
-.ul
-shell
-is a command programming language that provides an interface
-to the
-.UX
-operating system.
-Its features include
-control-flow primitives, parameter passing, variables and
-string substitution.
-Constructs such as
-.ul
-while, if then else, case
-and
-.ul
-for
-are available.
-Two-way communication is possible between the
-.ul
-shell
-and commands.
-String-valued parameters, typically file names or flags, may be
-passed to a command.
-A return code is set by commands that may be used to determine control-flow,
-and the standard output from a command may be used
-as shell input.
-.LP
-The
-.ul
-shell
-can modify the environment
-in which commands run.
-Input and output can be redirected
-to files, and processes that communicate through `pipes'
-can be invoked.
-Commands are found by
-searching directories
-in the file system in a
-sequence that can be defined by the user.
-Commands can be read either from the terminal or from a file,
-which allows command procedures to be
-stored for later use.
-.AE
-.ds ST \v'.3m'\s+2*\s0\v'-.3m'
-.SH
-1.0\ Introduction
-.LP
-The shell is both a command language
-and a programming language
-that provides an interface to the UNIX
-operating system.
-This memorandum describes, with
-examples, the UNIX shell.
-The first section covers most of the
-everyday requirements
-of terminal users.
-Some familiarity with UNIX
-is an advantage when reading this section;
-see, for example,
-"UNIX for beginners".
-.[
-unix beginn kernigh 1978
-.]
-Section 2 describes those features
-of the shell primarily intended
-for use within shell procedures.
-These include the control-flow
-primitives and string-valued variables
-provided by the shell.
-A knowledge of a programming language
-would be a help when reading this section.
-The last section describes the more
-advanced features of the shell.
-References of the form "see \fIpipe\fP (2)"
-are to a section of the UNIX manual.
-.[
-seventh 1978 ritchie thompson
-.]
-.SH
-1.1\ Simple\ commands
-.LP
-Simple commands consist of one or more words
-separated by blanks.
-The first word is the name of the command
-to be executed; any remaining words
-are passed as arguments to the command.
-For example,
-.DS
-       who
-.DE
-is a command that prints the names
-of users logged in.
-The command
-.DS
-       ls \(mil
-.DE
-prints a list of files in the current
-directory.
-The argument \fI\(mil\fP tells \fIls\fP
-to print status information, size and
-the creation date for each file.
-.SH
-1.2\ Background\ commands
-.LP
-To execute a command the shell normally
-creates a new \fIprocess\fP
-and waits for it to finish.
-A command may be run without waiting
-for it to finish.
-For example,
-.DS
-       cc pgm.c &
-.DE
-calls the C compiler to compile
-the file \fIpgm.c\|.\fP
-The trailing \fB&\fP is an operator that instructs the shell
-not to wait for the command to finish.
-To help keep track of such a process
-the shell reports its process
-number following its creation.
-A list of currently active processes may be obtained
-using the \fIps\fP command.
-.SH
-1.3\ Input\ output\ redirection
-.LP
-Most commands produce output on the standard output
-that is initially connected to the terminal.
-This output may be sent to a file
-by writing, for example,
-.DS
-       ls \(mil >file
-.DE
-The notation \fI>file\fP
-is interpreted by the shell and is not passed
-as an argument to \fIls.\fP
-If \fIfile\fP does not exist then the
-shell creates it;
-otherwise the original contents of
-\fIfile\fP are replaced with the output
-from \fIls.\fP
-Output may be appended to a file
-using the notation
-.DS
-       ls \(mil \*(APfile
-.DE
-In this case \fIfile\fP is also created if it does not already
-exist.
-.LP
-The standard input of a command may be taken
-from a file instead of the terminal by
-writing, for example,
-.DS
-       wc <file
-.DE
-The command \fIwc\fP reads its standard input
-(in this case redirected from \fIfile\fP)
-and prints the number of characters, words and
-lines found.
-If only the number of lines is required
-then
-.DS
-       wc \(mil <file
-.DE
-could be used.
-.SH
-1.4\ Pipelines\ and\ filters
-.LP
-The standard output of one command may be
-connected to the standard input of another
-by writing
-the `pipe' operator,
-indicated by \*(VT,
-as in,
-.DS
-       ls \(mil \*(VT wc
-.DE
-Two commands connected in this way constitute
-a \fIpipeline\fP and
-the overall effect is the same as
-.DS
-       ls \(mil >file; wc <file
-.DE
-except that no \fIfile\fP is used.
-Instead the two processes are connected
-by a pipe (see \fIpipe\fP (2)) and are
-run in parallel.
-Pipes are unidirectional and
-synchronization is achieved by
-halting \fIwc\fP when there is
-nothing to read and halting \fIls\fP
-when the pipe is full.
-.LP
-A \fIfilter\fP is a command
-that reads its standard input,
-transforms it in some way,
-and prints the result as output.
-One such filter, \fIgrep,\fP
-selects from its input those lines
-that contain some specified string.
-For example,
-.DS
-       ls \*(VT grep old
-.DE
-prints those lines, if any, of the output
-from \fIls\fP that contain
-the string \fIold.\fP
-Another useful filter is \fIsort\fP.
-For example,
-.DS
-       who \*(VT sort
-.DE
-will print an alphabetically sorted list
-of logged in users.
-.LP
-A pipeline may consist of more than two commands,
-for example,
-.DS
-       ls \*(VT grep old \*(VT wc \(mil
-.DE
-prints the number of file names
-in the current directory containing
-the string \fIold.\fP
-.SH
-1.5\ File\ name\ generation
-.LP
-Many commands accept arguments
-which are file names.
-For example,
-.DS
-       ls \(mil main.c
-.DE
-prints information relating to the file \fImain.c\fP\|.
-.LP
-The shell provides a mechanism
-for generating a list of file names
-that match a pattern.
-For example,
-.DS
-       ls \(mil \*(ST.c
-.DE
-generates, as arguments to \fIls,\fP
-all file names in the current directory that end in \fI.c\|.\fP
-The character \*(ST is a pattern that will match any string
-including the null string.
-In general \fIpatterns\fP are specified
-as follows.
-.RS
-.IP \fB\*(ST\fR 8
-Matches any string of characters
-including the null string.
-.IP \fB?\fR 8
-Matches any single character.
-.IP \fB[\*(ZZ]\fR 8
-Matches any one of the characters
-enclosed.
-A pair of characters separated by a minus will
-match any character lexically between
-the pair.
-.RE
-.LP
-For example,
-.DS
-       [a\(miz]\*(ST
-.DE
-matches all names in the current directory
-beginning with
-one of the letters \fIa\fP through \fIz.\fP
-.DS
-       /usr/fred/test/?
-.DE
-matches all names in the directory
-\fB/usr/fred/test\fP that consist of a single character.
-If no file name is found that matches
-the pattern then the pattern is passed,
-unchanged, as an argument.
-.LP
-This mechanism is useful both to save typing
-and to select names according to some pattern.
-It may also be used to find files.
-For example,
-.DS
-       echo /usr/fred/\*(ST/core
-.DE
-finds and prints the names of all \fIcore\fP files in sub-directories
-of \fB/usr/fred\|.\fP
-(\fIecho\fP is a standard UNIX command that prints
-its arguments, separated by blanks.)
-This last feature can be expensive,
-requiring a scan of all
-sub-directories of \fB/usr/fred\|.\fP
-.LP
-There is one exception to the general
-rules given for patterns.
-The character `\fB.\fP'
-at the start of a file name must be explicitly
-matched.
-.DS
-       echo \*(ST
-.DE
-will therefore echo all file names in the current
-directory not beginning
-with `\fB.\fP'\|.
-.DS
-       echo \fB.\fP\*(ST
-.DE
-will echo all those file names that begin with `\fB.\fP'\|.
-This avoids inadvertent matching
-of the names `\fB.\fP' and `\fB..\fP'
-which mean `the current directory'
-and `the parent directory'
-respectively.
-(Notice that \fIls\fP suppresses
-information for the files `\fB.\fP' and `\fB..\fP'\|.)
-.SH
-1.6\ Quoting
-.LP
-Characters that have a special meaning
-to the shell, such as \fB< > \*(ST ? \*(VT &\|,\fR
-are called metacharacters.
-A complete list of metacharacters is given
-in appendix B.
-Any character preceded by a \fB\\\fR is \fIquoted\fP
-and loses its special meaning, if any.
-The \fB\\\fP is elided so that
-.DS
-       echo \\\\?
-.DE
-will echo a single \fB?\|,\fP
-and
-.DS
-       echo \\\\\\\\
-.DE
-will echo a single \fB\\\|.\fR
-To allow long strings to be continued over
-more than one line
-the sequence \fB\\newline\fP
-is ignored.
-.LP
-\fB\\\fP is convenient for quoting
-single characters.
-When more than one character needs
-quoting the above mechanism is clumsy and
-error prone.
-A string of characters may be quoted
-by enclosing the string between single quotes.
-For example,
-.DS
-       echo xx\'\*(ST\*(ST\*(ST\*(ST\'xx
-.DE
-will echo
-.DS
-       xx\*(ST\*(ST\*(ST\*(STxx
-.DE
-The quoted string may not contain
-a single quote
-but may contain newlines, which are preserved.
-This quoting mechanism is the most
-simple and is recommended
-for casual use.
-.LP
-A third quoting mechanism using double quotes
-is also available
-that prevents interpretation of some but not all
-metacharacters.
-Discussion of the
-details is deferred
-to section 3.4\|.
-.SH
-1.7\ Prompting
-.LP
-When the shell is used from a terminal it will
-issue a prompt before reading a command.
-By default this prompt is `\fB$\ \fR'\|.
-It may be changed by saying,
-for example,
-.DS
-       \s-1PS1\s0=yesdear
-.DE
-that sets the prompt to be the string \fIyesdear\|.\fP
-If a newline is typed and further input is needed
-then the shell will issue the prompt `\fB>\ \fR'\|.
-Sometimes this can be caused by mistyping
-a quote mark.
-If it is unexpected then an interrupt (\s-1DEL\s0)
-will return the shell to read another command.
-This prompt may be changed by saying, for example,
-.DS
-       \s-1PS2\s0=more
-.DE
-.SH
-1.8\ The\ shell\ and\ login
-.LP
-Following \fIlogin\fP (1)
-the shell is called to read and execute
-commands typed at the terminal.
-If the user's login directory
-contains the file \fB.profile\fP
-then it is assumed to contain commands
-and is read by the shell before reading
-any commands from the terminal.
-.SH
-1.9\ Summary
-.sp
-.RS
-.IP \(bu
-\fBls\fP
-.br
-Print the names of files in the current directory.
-.IP \(bu
-\fBls >file\fP
-.br
-Put the output from \fIls\fP into \fIfile.\fP
-.IP \(bu
-\fBls \*(VT wc \(mil\fR
-.br
-Print the number of files in the current directory.
-.IP \(bu
-\fBls \*(VT grep old\fR
-.br
-Print those file names containing the string \fIold.\fP
-.IP \(bu
-\fBls \*(VT grep old \*(VT wc \(mil\fR
-.br
-Print the number of files whose name contains the string \fIold.\fP
-.IP \(bu
-\fBcc pgm.c &\fR
-.br
-Run \fIcc\fP in the background.
-.RE
diff --git a/.ref-Research-V7/usr/doc/shell/t2 b/.ref-Research-V7/usr/doc/shell/t2
deleted file mode 100644 (file)
index c7e581f..0000000
+++ /dev/null
@@ -1,829 +0,0 @@
-.bp
-.SH
-2.0\ Shell\ procedures
-.LP
-The shell may be used to read and execute commands
-contained in a file.
-For example,
-.DS
-       sh file [ args \*(ZZ ]
-.DE
-calls the shell to read commands from \fIfile.\fP
-Such a file is called a \fIcommand procedure\fP
-or \fIshell procedure.\fP
-Arguments may be supplied with the call
-and are referred to in \fIfile\fP
-using the positional parameters
-\fB$1, $2, \*(ZZ\|.\fR
-For example, if the file \fIwg\fP contains
-.DS
-       who \*(VT grep $1
-.DE
-then
-.DS
-       sh wg fred
-.DE
-is equivalent to
-.DS
-       who \*(VT grep fred
-.DE
-.LP
-UNIX files have three independent attributes,
-\fIread,\fP \fIwrite\fP and \fIexecute.\fP
-The UNIX command \fIchmod\fP (1) may be used
-to make a file executable.
-For example,
-.DS
-       chmod +x wg
-.DE
-will ensure that the file \fIwg\fP has execute status.
-Following this, the command
-.DS
-       wg fred
-.DE
-is equivalent to
-.DS
-       sh wg fred
-.DE
-This allows shell procedures and programs
-to be used interchangeably.
-In either case a new process is created to
-run the command.
-.LP
-As well as providing names for the positional
-parameters,
-the number of positional parameters in the call
-is available as \fB$#\|.\fP
-The name of the file being executed
-is available as \fB$0\|.\fP
-.LP
-A special shell parameter \fB$\*(ST\fP
-is used to substitute for all positional parameters
-except \fB$0\|.\fP
-A typical use of this is to provide
-some default arguments,
-as in,
-.DS
-       nroff \(miT450 \(mims $\*(ST
-.DE
-which simply prepends some arguments
-to those already given.
-.SH
-2.1\ Control\ flow\ -\ for
-.LP
-A frequent use of shell procedures is to loop
-through the arguments (\fB$1, $2, \*(ZZ\fR)
-executing commands once for each argument.
-An example of such a procedure is
-\fItel\fP that searches the file
-\fB/usr/lib/telnos\fR
-that contains lines of the form
-.DS
-       \*(ZZ
-       fred mh0123
-       bert mh0789
-       \*(ZZ
-.DE
-The text of \fItel\fP is
-.DS
-       for i
-       do grep $i /usr/lib/telnos; done
-.DE
-The command
-.DS
-       tel fred
-.DE
-prints those lines in \fB/usr/lib/telnos\fR
-that contain the string \fIfred\|.\fP
-.DS
-       tel fred bert
-.DE
-prints those lines containing \fIfred\fP
-followed by those for \fIbert.\fP
-.LP
-The \fBfor\fP loop notation is recognized by the shell
-and has the general form
-.DS
-       \fBfor\fR \fIname\fR \fBin\fR \fIw1 w2 \*(ZZ\fR
-       \fBdo\fR \fIcommand-list\fR
-       \fBdone\fR
-.DE
-A \fIcommand-list\fP is a sequence of one or more
-simple commands separated or terminated by a newline or semicolon.
-Furthermore, reserved words
-like \fBdo\fP and \fBdone\fP are only
-recognized following a newline or
-semicolon.
-\fIname\fP is a shell variable that is set
-to the words \fIw1 w2 \*(ZZ\fR in turn each time the \fIcommand-list\fP
-following \fBdo\fP
-is executed.
-If \fBin\fR \fIw1 w2 \*(ZZ\fR
-is omitted then the loop
-is executed once for each positional parameter;
-that is, \fBin\fR \fI$\*(ST\fR is assumed.
-.LP
-Another example of the use of the \fBfor\fP
-loop is the \fIcreate\fP command
-whose text is
-.DS
-       for i do >$i; done
-.DE
-The command
-.DS
-       create alpha beta
-.DE
-ensures that two empty files
-\fIalpha\fP and \fIbeta\fP exist
-and are empty.
-The notation \fI>file\fP may be used on its
-own to create or clear the contents of a file.
-Notice also that a semicolon (or newline) is required before \fBdone.\fP
-.SH
-2.2\ Control\ flow\ -\ case
-.LP
-A multiple way branch is provided for by the
-\fBcase\fP notation.
-For example,
-.DS
-       case $# in
-       \*(Ca1) cat \*(AP$1 ;;
-       \*(Ca2) cat \*(AP$2 <$1 ;;
-       \*(Ca\*(ST)     echo \\'usage: append [ from ] to\\' ;;
-       esac
-.DE
-is an \fIappend\fP command.
-When called
-with one argument as
-.DS
-       append file
-.DE
-\fB$#\fP is the string \fI1\fP and
-the standard input is copied onto the
-end of \fIfile\fP
-using the \fIcat\fP command.
-.DS
-       append file1 file2
-.DE
-appends the contents of \fIfile1\fP
-onto \fIfile2.\fP
-If the number of arguments supplied to
-\fIappend\fP is other than 1 or 2
-then a message is printed indicating
-proper usage.
-.LP
-The general form of the \fBcase\fP command
-is
-.DS
-       \fBcase \fIword \fBin
-       \*(Ca\fIpattern\|\fB)\ \fIcommand-list\fB\|;;
-       \*(Ca\*(ZZ
-       \fBesac\fR
-.DE
-The shell attempts to match
-\fIword\fR with each \fIpattern,\fR
-in the order in which the patterns
-appear.
-If a match is found the
-associated \fIcommand-list\fP is
-executed and execution
-of the \fBcase\fP is complete.
-Since \*(ST is the pattern that matches any
-string it can be used for the default case.
-.LP
-A word of caution:
-no check is made to ensure that only
-one pattern matches
-the case argument.
-The first match found defines the set of commands
-to be executed.
-In the example below the commands following
-the second \*(ST will never be executed.
-.DS
-       case $# in
-       \*(Ca\*(ST) \*(ZZ ;;
-       \*(Ca\*(ST) \*(ZZ ;;
-       esac
-.DE
-.LP
-Another example of the use of the \fBcase\fP
-construction is to distinguish
-between different forms
-of an argument.
-The following example is a fragment of a \fIcc\fP command.
-.DS
-       for i
-       do case $i in
-       \*(DC\(mi[ocs]) \*(ZZ ;;
-       \*(DC\(mi\*(ST) echo \\'unknown flag $i\\' ;;
-       \*(DC\*(ST.c)   /lib/c0 $i \*(ZZ ;;
-       \*(DC\*(ST)     echo \\'unexpected argument $i\\' ;;
-       \*(DOesac
-       done
-.DE
-.LP
-To allow the same commands to be associated
-with more than one pattern
-the \fBcase\fP command provides
-for alternative patterns
-separated by a \*(VT\|.
-For example,
-.DS
-       case $i in
-       \*(Ca\(mix\*(VT\(miy)   \*(ZZ
-       esac
-.DE
-is equivalent to
-.DS
-       case $i in
-       \*(Ca\(mi[xy])  \*(ZZ
-       esac
-.DE
-.LP
-The usual quoting conventions apply
-so that
-.DS
-       case $i in
-       \*(Ca\\\\?)     \*(ZZ
-.DE
-will match the character \fB?\|.\fP
-.SH
-2.3\ Here\ documents
-.LP
-The shell procedure \fItel\fP
-in section 2.1 uses the file \fB/usr/lib/telnos\fR
-to supply the data
-for \fIgrep.\fP
-An alternative is to include this
-data
-within the shell procedure as a \fIhere\fP document, as in,
-.DS
-       for i
-       do grep $i \*(HE!
-       \*(DO\*(ZZ
-       \*(DOfred mh0123
-       \*(DObert mh0789
-       \*(DO\*(ZZ
-       !
-       done
-.DE
-In this example
-the shell takes the lines between \fB\*(HE!\fR and \fB!\fR
-as the standard input for \fIgrep.\fP
-The string \fB!\fR is arbitrary, the document
-being terminated by a line that consists
-of the string following \*(HE\|.
-.LP
-Parameters are substituted in the document
-before it is made available to \fIgrep\fP
-as illustrated by the following procedure
-called \fIedg\|.\fP
-.DS
-       ed $3 \*(HE%
-       g/$1/s//$2/g
-       w
-       %
-.DE
-The call
-.DS
-       edg string1 string2 file
-.DE
-is then equivalent to the command
-.DS
-       ed file \*(HE%
-       g/string1/s//string2/g
-       w
-       %
-.DE
-and changes all occurrences of \fIstring1\fP
-in \fIfile\fP to \fIstring2\|.\fP
-Substitution can be prevented using \\
-to quote the special character \fB$\fP
-as in
-.DS
-       ed $3 \*(HE+
-       1,\\\\$s/$1/$2/g
-       w
-       +
-.DE
-(This version of \fIedg\fP is equivalent to
-the first except that \fIed\fP will print
-a \fB?\fR if there are no occurrences of
-the string \fB$1\|.\fP)
-Substitution within a \fIhere\fP document
-may be prevented entirely by quoting
-the terminating string,
-for example,
-.DS
-       grep $i \*(HE\\\\#
-       \*(ZZ
-       #
-.DE
-The document is presented
-without modification to \fIgrep.\fP
-If parameter substitution is not required
-in a \fIhere\fP document this latter form
-is more efficient.
-.SH
-2.4\ Shell\ variables
-.LP
-The shell
-provides string-valued variables.
-Variable names begin with a letter
-and consist of letters, digits and
-underscores.
-Variables may be given values by writing, for example,
-.DS
-       user=fred\ box=m000\ acct=mh0000
-.DE
-which assigns values to the variables
-\fBuser, box\fP and \fBacct.\fP
-A variable may be set to the null string
-by saying, for example,
-.DS
-       null=
-.DE
-The value of a variable is substituted
-by preceding its name with \fB$\|;\fP
-for example,
-.DS
-       echo $user
-.DE
-will echo \fIfred.\fP
-.LP
-Variables may be used interactively
-to provide abbreviations for frequently
-used strings.
-For example,
-.DS
-       b=/usr/fred/bin
-       mv pgm $b
-.DE
-will move the file \fIpgm\fP
-from the current directory to the directory \fB/usr/fred/bin\|.\fR
-A more general notation is available for parameter
-(or variable)
-substitution, as in,
-.DS
-       echo ${user}
-.DE
-which is equivalent to
-.DS
-       echo $user
-.DE
-and is used when the parameter name is
-followed by a letter or digit.
-For example,
-.DS
-       tmp=/tmp/ps
-       ps a >${tmp}a
-.DE
-will direct the output of \fIps\fR
-to the file \fB/tmp/psa,\fR
-whereas,
-.DS
-       ps a >$tmpa
-.DE
-would cause the value of the variable \fBtmpa\fP
-to be substituted.
-.LP
-Except for \fB$?\fP the following
-are set initially by the shell.
-\fB$?\fP is set after executing each command.
-.RS
-.IP \fB$?\fP 8
-The exit status (return code)
-of the last command executed
-as a decimal string.
-Most commands return a zero exit status
-if they complete successfully,
-otherwise a non-zero exit status is returned.
-Testing the value of return codes is dealt with
-later under \fBif\fP and \fBwhile\fP commands.
-.IP \fB$#\fP 8
-The number of positional parameters
-(in decimal).
-Used, for example, in the \fIappend\fP command
-to check the number of parameters.
-.IP \fB$$\fP 8
-The process number of this shell (in decimal).
-Since process numbers are unique among
-all existing processes, this string is
-frequently used to generate
-unique
-temporary file names.
-For example,
-.DS
-       ps a >/tmp/ps$$
-       \*(ZZ
-       rm /tmp/ps$$
-.DE
-.IP \fB$\|!\fP 8
-The process number of the last process
-run in the background (in decimal).
-.IP \fB$\(mi\fP 8
-The current shell flags, such as
-\fB\(mix\fR and \fB\(miv\|.\fR
-.RE
-.LP
-Some variables have a special meaning to the
-shell and should be avoided for general
-use.
-.RS
-.IP \fB$\s-1MAIL\s0\fP 8
-When used interactively
-the shell looks at the file
-specified by this variable
-before it issues a prompt.
-If the specified file has been modified
-since it
-was last looked at the shell
-prints the message
-\fIyou have mail\fP before prompting
-for the next command.
-This variable is typically set
-in the file \fB.profile,\fP
-in the user's login directory.
-For example,
-.DS
-       \s-1MAIL\s0=/usr/mail/fred
-.DE
-.IP \fB$\s-1HOME\s0\fP 8
-The default argument
-for the \fIcd\fP command.
-The current directory is used to resolve
-file name references that do not begin with
-a \fB/\|,\fR
-and is changed using the \fIcd\fP command.
-For example,
-.DS
-       cd /usr/fred/bin
-.DE
-makes the current directory \fB/usr/fred/bin\|.\fR
-.DS
-       cat wn
-.DE
-will print on the terminal the file \fIwn\fP
-in this directory.
-The command
-\fIcd\fP with no argument
-is equivalent to
-.DS
-       cd $\s-1HOME\s0
-.DE
-This variable is also typically set in the
-the user's login profile.
-.IP \fB$\s-1PATH\s0\fP 8
-A list of directories that contain commands (the \fIsearch path\fR\|).
-Each time a command is executed by the shell
-a list of directories is searched
-for an executable file.
-.ne 5
-If \fB$\s-1PATH\s0\fP is not set
-then the current directory,
-\fB/bin\fP, and \fB/usr/bin\fP are searched by default.
-.ne 5
-Otherwise \fB$\s-1PATH\s0\fP consists of directory
-names separated by \fB:\|.\fP
-For example,
-.DS
-       \s-1PATH\s0=\fB:\fP/usr/fred/bin\fB:\fP/bin\fB:\fP/usr/bin
-.DE
-specifies that the current directory
-(the null string before the first \fB:\fP\|),
-\fB/usr/fred/bin, /bin \fRand\fP /usr/bin\fR
-are to be searched in that order.
-In this way individual users
-can have their own `private' commands
-that are accessible independently
-of the current directory.
-If the command name contains a \fB/\fR then this directory search
-is not used; a single attempt
-is made to execute the command.
-.IP \fB$\s-1PS1\s0\fP 8
-The primary shell prompt string, by default, `\fB$\ \fR'.
-.IP \fB$\s-1PS2\s0\fP 8
-The shell prompt when further input is needed,
-by default, `\fB>\ \fR'.
-.IP \fB$\s-1IFS\s0\fP 8
-The set of characters used by \fIblank
-interpretation\fR (see section 3.4).
-.RE
-.SH
-2.5\ The\ test\ command
-.LP
-The \fItest\fP command, although not part of the shell,
-is intended for use by shell programs.
-For example,
-.DS
-       test \(mif file
-.DE
-returns zero exit status if \fIfile\fP
-exists and non-zero exit status otherwise.
-In general \fItest\fP evaluates a predicate
-and returns the result as its exit status.
-Some of the more frequently used \fItest\fP
-arguments are given here, see \fItest\fP (1)
-for a complete specification.
-.DS
-       test s          true if the argument \fIs\fP is not the null string
-       test \(mif file true if \fIfile\fP exists
-       test \(mir file true if \fIfile\fP is readable
-       test \(miw file true if \fIfile\fP is writable
-       test \(mid file true if \fIfile\fP is a directory
-.DE
-.SH
-2.6\ Control\ flow\ -\ while
-.LP
-The actions of
-the \fBfor\fP loop and the \fBcase\fP
-branch are determined by data available to the shell.
-A \fBwhile\fP or \fBuntil\fP loop
-and an \fBif then else\fP branch
-are also provided whose
-actions are determined by the exit status
-returned by commands.
-A \fBwhile\fP loop has the general form
-.DS
-       \fBwhile\fP \fIcommand-list\*1\fP
-       \fBdo\fP \fIcommand-list\*2\fP
-       \fBdone\fP
-.DE
-.LP
-The value tested by the \fBwhile\fP command
-is the exit status of the last simple command
-following \fBwhile.\fP
-Each time round the loop
-\fIcommand-list\*1\fP is executed;
-if a zero exit status is returned then
-\fIcommand-list\*2\fP
-is executed;
-otherwise, the loop terminates.
-For example,
-.DS
-       while test $1
-       do \*(ZZ
-       \*(DOshift
-       done
-.DE
-is equivalent to
-.DS
-       for i
-       do \*(ZZ
-       done
-.DE
-\fIshift\fP is a shell command that
-renames the positional parameters
-\fB$2, $3, \*(ZZ\fR as \fB$1, $2, \*(ZZ\fR
-and loses \fB$1\|.\fP
-.LP
-Another kind of use for the \fBwhile/until\fP
-loop is to wait until some
-external event occurs and then run
-some commands.
-In an \fBuntil\fP loop
-the termination condition is reversed.
-For example,
-.DS
-       until test \(mif file
-       do sleep 300; done
-       \fIcommands\fP
-.DE
-will loop until \fIfile\fP exists.
-Each time round the loop it waits for
-5 minutes before trying again.
-(Presumably another process
-will eventually create the file.)
-.SH
-2.7\ Control\ flow\ -\ if
-.LP
-Also available is a
-general conditional branch
-of the form,
-.DS
-       \fBif\fP \fIcommand-list
-       \fBthen \fIcommand-list
-       \fBelse \fIcommand-list
-       \fBfi\fR
-.DE
-that tests the value returned by the last simple command
-following \fBif.\fP
-.LP
-The \fBif\fP command may be used
-in conjunction with the \fItest\fP command
-to test for the existence of a file as in
-.DS
-       if test \(mif file
-       then    \fIprocess file\fP
-       else    \fIdo something else\fP
-       fi
-.DE
-.LP
-An example of the use of \fBif, case\fP
-and \fBfor\fP constructions is given in
-section 2.10\|.
-.LP
-A multiple test \fBif\fP command
-of the form
-.DS
-       if \*(ZZ
-       then    \*(ZZ
-       else    if \*(ZZ
-               then    \*(ZZ
-               else    if \*(ZZ
-                       \*(ZZ
-                       fi
-               fi
-       fi
-.DE
-may be written using an extension of the \fBif\fP
-notation as,
-.DS
-       if \*(ZZ
-       then    \*(ZZ
-       elif    \*(ZZ
-       then    \*(ZZ
-       elif    \*(ZZ
-       \*(ZZ
-       fi
-.DE
-.LP
-The following example is the \fItouch\fP command
-which changes the `last modified' time for a list
-of files.
-The command may be used in conjunction
-with \fImake\fP (1) to force recompilation of a list
-of files.
-.DS
-       flag=
-       for i
-       do case $i in
-       \*(DC\(mic)     flag=N ;;
-       \*(DC\*(ST)     if test \(mif $i
-       \*(DC   then    ln $i junk$$; rm junk$$
-       \*(DC   elif test $flag
-       \*(DC   then    echo file \\\\\'$i\\\\\' does not exist
-       \*(DC   else    >$i
-       \*(DC   fi
-       \*(DO esac
-       done
-.DE
-The \fB\(mic\fP flag is used in this command to
-force subsequent files to be created if they do not already exist.
-Otherwise, if the file does not exist, an error message is printed.
-The shell variable \fIflag\fP
-is set to some non-null string if the \fB\(mic\fP
-argument is encountered.
-The commands
-.DS
-       ln \*(ZZ; rm \*(ZZ
-.DE
-make a link to the file and then remove it
-thus causing the last modified date to be updated.
-.LP
-The sequence
-.DS
-       if command1
-       then    command2
-       fi
-.DE
-may be written
-.DS
-       command1 && command2
-.DE
-Conversely,
-.DS
-       command1 \*(VT\*(VT command2
-.DE
-executes \fIcommand2\fP only if \fIcommand1\fP
-fails.
-In each case the value returned
-is that of the last simple command executed.
-.SH
-2.8\ Command\ grouping
-.LP
-Commands may be grouped in two ways,
-.DS
-       \fB{\fI command-list\fB ; }\fR
-.DE
-and
-.DS
-       \fB(\fI command-list\fB )\fR
-.DE
-.LP
-In the first \fIcommand-list\fP is simply executed.
-The second form executes \fIcommand-list\fP
-as a separate process.
-For example,
-.DS
-       (cd x; rm junk )
-.DE
-executes \fIrm junk\fP in the directory
-\fBx\fP without changing the current
-directory of the invoking shell.
-.LP
-The commands
-.DS
-       cd x; rm junk
-.DE
-have the same effect but leave the invoking
-shell in the directory \fBx.\fP
-.SH
-2.9\ Debugging\ shell\ procedures
-.LP
-The shell provides two tracing mechanisms
-to help when debugging shell procedures.
-The first is invoked within the procedure
-as
-.DS
-       set \(miv
-.DE
-(\fBv\fP for verbose) and causes lines of the
-procedure to be printed as they are read.
-It is useful to help isolate syntax errors.
-It may be invoked without modifying the procedure
-by saying
-.DS
-       sh \(miv proc \*(ZZ
-.DE
-where \fIproc\fP is the name of the shell procedure.
-This flag may be used in conjunction
-with the \fB\(min\fP flag which prevents
-execution of subsequent commands.
-(Note that saying \fIset \(min\fP at a terminal
-will render the terminal useless
-until an end-of-file is typed.)
-.LP
-The command
-.DS
-       set \(mix
-.DE
-will produce an execution
-trace.
-Following parameter substitution
-each command is printed as it is executed.
-(Try these at the terminal to see
-what effect they have.)
-Both flags may be turned off by saying
-.DS
-       set \(mi
-.DE
-and the current setting of the shell flags is available as \fB$\(mi\|.\fR
-.SH
-2.10\ The\ man\ command
-.LP
-The following is the \fIman\fP command
-which is used to print sections of the UNIX manual.
-It is called, for example, as
-.DS
-               man sh
-               man \(mit ed
-               man 2 fork
-.DE
-In the first the manual section for \fIsh\fP
-is printed.
-Since no section is specified, section 1 is used.
-The second example will typeset (\fB\(mit\fP option)
-the manual section for \fIed.\fP
-The last prints the \fIfork\fP manual page
-from section 2.
-.sp 2
-.DS
-       cd /usr/man
-
-       : \'colon is the comment command\'
-       : \'default is nroff ($N), section 1 ($s)\'
-       N=n\ s=1
-
-       for i
-       do case $i in
-.sp .5
-       \*(DC[1\(mi9]\*(ST)     s=$i ;;
-.sp .5
-       \*(DC\(mit)     N=t ;;
-.sp .5
-       \*(DC\(min)     N=n ;;
-.sp .5
-       \*(DC\(mi\*(ST) echo unknown flag \\\\\'$i\\\\\' ;;
-.sp .5
-       \*(DC\*(ST)     if test \(mif man$s/$i.$s
-       \*(DC   then    ${N}roff man0/${N}aa man$s/$i.$s
-       \*(DC   else    : \'look through all manual sections\'
-       \*(DC           found=no
-       \*(DC           for j in 1 2 3 4 5 6 7 8 9
-       \*(DC           do if test \(mif man$j/$i.$j
-       \*(DC           \*(DOthen man $j $i
-       \*(DC           \*(DO\*(THfound=yes
-       \*(DC           \*(DOfi
-       \*(DC           done
-       \*(DC           case $found in
-       \*(DC           \*(Cano) echo \\'$i: manual page not found\\'
-       \*(DC           esac
-       \*(DC   fi
-       \*(DOesac
-       done
-.DE
-.ce
-.ft B
-Figure 1. A version of the man command
-.ft R
diff --git a/.ref-Research-V7/usr/doc/shell/t3 b/.ref-Research-V7/usr/doc/shell/t3
deleted file mode 100644 (file)
index 6e7b0ee..0000000
+++ /dev/null
@@ -1,817 +0,0 @@
-.bp
-.SH
-3.0\ Keyword\ parameters
-.LP
-Shell variables may be given values
-by assignment
-or when a shell procedure is invoked.
-An argument to a shell procedure of the form
-\fIname=value\fP
-that precedes the command name
-causes \fIvalue\fP
-to be assigned to \fIname\fP
-before execution of the procedure begins.
-The value of \fIname\fP in the invoking
-shell is not affected.
-For example,
-.DS
-       user=fred\ command
-.DE
-will execute \fIcommand\fP with
-\fBuser\fP set to \fIfred\fP.
-The \fB\(mik\fR flag causes arguments of the form
-\fIname=value\fP to be interpreted in this way
-anywhere in the argument list.
-Such \fInames\fP are sometimes
-called keyword parameters.
-If any arguments remain they
-are available as positional
-parameters \fB$1, $2, \*(ZZ\|.\fP
-.LP
-The \fIset\fP command
-may also be used to set positional parameters
-from within a procedure.
-For example,
-.DS
-       set\ \(mi\ \*(ST
-.DE
-will set \fB$1\fP to the first file name
-in the current directory, \fB$2\fP to the next,
-and so on.
-Note that the first argument, \(mi, ensures correct treatment
-when the first file name begins with a \(mi\|.
-.LP
-.SH
-3.1\ Parameter\ transmission
-.LP
-When a shell procedure is invoked both positional
-and keyword parameters may be supplied with the call.
-Keyword parameters are also made available implicitly
-to a shell procedure
-by specifying in advance that such parameters
-are to be exported.
-For example,
-.DS
-       export\ user\ box
-.DE
-marks the variables \fBuser\fP and \fBbox\fP
-for export.
-When a shell procedure is invoked
-copies are made of all exportable variables
-for use within the invoked procedure.
-Modification of such variables
-within the procedure does not
-affect the values in the invoking shell.
-It is generally true of
-a shell procedure
-that it
-may not modify the state
-of its caller without explicit
-request on the part of the caller.
-(Shared file descriptors are an
-exception to this rule.)
-.LP
-Names whose value is intended to remain
-constant may be declared \fIreadonly\|.\fP
-The form of this command is the same as that of the \fIexport\fP
-command,
-.DS
-       readonly name \*(ZZ
-.DE
-Subsequent attempts to set readonly variables
-are illegal.
-.SH
-3.2\ Parameter\ substitution
-.LP
-If a shell parameter is not set
-then the null string is substituted for it.
-For example, if the variable \fBd\fP
-is not set
-.DS
-       echo $d
-.DE
-or
-.DS
-       echo ${d}
-.DE
-will echo nothing.
-A default string may be given
-as in
-.DS
-       echo ${d\(mi\fB.\fR}
-.DE
-which will echo
-the value of the variable \fBd\fP
-if it is set and `\fB.\fP' otherwise.
-The default string is evaluated using the usual
-quoting conventions so that
-.DS
-       echo ${d\(mi\'\*(ST\'}
-.DE
-will echo \fB\*(ST\fP if the variable \fBd\fP
-is not set.
-Similarly
-.DS
-       echo ${d\(mi$1}
-.DE
-will echo the value of \fBd\fP if it is set
-and the value (if any) of \fB$1\fP otherwise.
-A variable may be assigned a default value
-using
-the notation
-.DS
-       echo ${d=\fB.\fR}
-.DE
-which substitutes the same string as
-.DS
-       echo ${d\(mi\fB.\fR}
-.DE
-and if \fBd\fP were not previously set
-then it will be set to the string `\fB.\fP'\|.
-(The notation ${\*(ZZ=\*(ZZ}
-is not available for positional parameters.)
-.LP
-If there is no sensible default then
-the notation
-.DS
-       echo ${d?message}
-.DE
-will echo the value of the variable \fBd\fP if it has
-one, otherwise \fImessage\fP is printed by the shell and
-execution of the shell procedure is abandoned.
-If \fImessage\fP is absent then a standard message
-is printed.
-A shell procedure that requires some parameters
-to be set might start as follows.
-.DS
-       :\ ${user?}\ ${acct?}\ ${bin?}
-       \*(ZZ
-.DE
-Colon (\fB:\fP) is a command
-that is
-built in to the shell and does nothing
-once its arguments have been evaluated.
-If any of the variables \fBuser, acct\fP
-or \fBbin\fP are not set then the shell
-will abandon execution of the procedure.
-.SH
-3.3\ Command\ substitution
-.LP
-The standard output from a command can be
-substituted in a similar way to parameters.
-The command \fIpwd\fP prints on its standard
-output the name of the current directory.
-For example, if the current directory is
-\fB/usr/fred/bin\fR
-then the command
-.DS
-       d=\`pwd\`
-.DE
-is equivalent to
-.DS
-       d=/usr/fred/bin
-.DE
-.LP
-The entire string between grave accents (\`\*(ZZ\`)
-is taken as the command
-to be executed
-and is replaced with the output from
-the command.
-The command is written using the usual
-quoting conventions
-except that a \fB\`\fR must be escaped using
-a \fB\\\|.\fR
-For example,
-.DS
-       ls \`echo "$1"\`
-.DE
-is equivalent to
-.DS
-       ls $1
-.DE
-Command substitution occurs in all contexts
-where parameter substitution occurs (including \fIhere\fP documents) and the
-treatment of the resulting text is the same
-in both cases.
-This mechanism allows string
-processing commands to be used within
-shell procedures.
-An example of such a command is \fIbasename\fP
-which removes a specified suffix from a string.
-For example,
-.DS
-       basename main\fB.\fPc \fB.\fPc
-.DE
-will print the string \fImain\|.\fP
-Its use is illustrated by the following
-fragment from a \fIcc\fP command.
-.DS
-       case $A in
-       \*(Ca\*(ZZ
-       \*(Ca\*(ST\fB.\fPc)     B=\`basename $A \fB.\fPc\`
-       \*(Ca\*(ZZ
-       esac
-.DE
-that sets \fBB\fP to the part of \fB$A\fP
-with the suffix \fB.c\fP stripped.
-.LP
-Here are some composite examples.
-.RS
-.IP \(bu
-.ft B
-for i in \`ls \(mit\`; do \*(ZZ
-.ft R
-.br
-The variable \fBi\fP is set
-to the names of files in time order,
-most recent first.
-.IP \(bu
-.ft B
-set \`date\`; echo $6 $2 $3, $4
-.ft R
-.br
-will print, e.g.,
-.ft I
-1977 Nov 1, 23:59:59
-.ft R
-.RE
-.SH
-3.4\ Evaluation\ and\ quoting
-.LP
-The shell is a macro processor that
-provides parameter substitution, command substitution and file
-name generation for the arguments to commands.
-This section discusses the order in which
-these evaluations occur and the
-effects of the various quoting mechanisms.
-.LP
-Commands are parsed initially according to the grammar
-given in appendix A.
-Before a command is executed
-the following
-substitutions occur.
-.RS
-.IP \(bu
-parameter substitution, e.g. \fB$user\fP
-.IP \(bu
-command substitution, e.g. \fB\`pwd\`\fP
-.RS
-.LP
-Only one evaluation occurs so that if, for example, the value of the variable
-\fBX\fP
-is the string \fI$y\fP
-then
-.DS
-       echo $X
-.DE
-will echo \fI$y\|.\fP
-.RE
-.IP \(bu
-blank interpretation
-.RS
-.LP
-Following the above substitutions
-the resulting characters
-are broken into non-blank words (\fIblank interpretation\fP).
-For this purpose `blanks' are the characters of the string
-\fB$\s-1IFS\s0\fP.
-By default, this string consists of blank, tab and newline.
-The null string
-is not regarded as a word unless it is quoted.
-For example,
-.DS
-       echo \'\'
-.DE
-will pass on the null string as the first argument to \fIecho\fP,
-whereas
-.DS
-       echo $null
-.DE
-will call \fIecho\fR with no arguments
-if the variable \fBnull\fP is not set
-or set to the null string.
-.RE
-.IP \(bu
-file name generation
-.RS
-.LP
-Each word
-is then scanned for the file pattern characters
-\fB\*(ST, ?\fR and \fB[\*(ZZ]\fR
-and an alphabetical list of file names
-is generated to replace the word.
-Each such file name is a separate argument.
-.RE
-.RE
-.LP
-The evaluations just described also occur
-in the list of words associated with a \fBfor\fP
-loop.
-Only substitution occurs
-in the \fIword\fP used
-for a \fBcase\fP branch.
-.LP
-As well as the quoting mechanisms described
-earlier using \fB\\\fR and \fB\'\*(ZZ\'\fR
-a third quoting mechanism is provided using double quotes.
-Within double quotes parameter and command substitution
-occurs but file name generation and the interpretation
-of blanks does not.
-The following characters
-have a special meaning within double quotes
-and may be quoted using \fB\\\|.\fP
-.DS
-       \fB$    \fPparameter substitution
-       \fB\`\fP        command substitution
-       \fB"\fP ends the quoted string
-       \fB\e\fP        quotes the special characters \fB$ \` " \e\fP
-.DE
-For example,
-.DS
-       echo "$x"
-.DE
-will pass the value of the variable \fBx\fP as a
-single argument to \fIecho.\fP
-Similarly,
-.DS
-       echo "$\*(ST"
-.DE
-will pass the positional parameters as a single
-argument and is equivalent to
-.DS
-       echo "$1 $2 \*(ZZ"
-.DE
-The notation \fB$@\fP
-is the same as \fB$\*(ST\fR
-except when it is quoted.
-.DS
-       echo "$@"
-.DE
-will pass the positional parameters, unevaluated, to \fIecho\fR
-and is equivalent to
-.DS
-       echo "$1" "$2" \*(ZZ
-.DE
-.LP
-The following table gives, for each quoting mechanism,
-the shell metacharacters that are evaluated.
-.DS
-.ce
-.ft I
-metacharacter
-.ft
-.in 1.5i
-       \e      $       *       \`      "       \'
-\'     n       n       n       n       n       t
-\`     y       n       n       t       n       n
-"      y       y       n       y       t       n
-
-       t       terminator
-       y       interpreted
-       n       not interpreted
-
-.in
-.ft B
-.ce
-Figure 2. Quoting mechanisms
-.ft
-.DE
-.LP
-In cases where more than one evaluation of a string
-is required the built-in command \fIeval\fP
-may be used.
-For example,
-if the variable \fBX\fP has the value
-\fI$y\fP, and if \fBy\fP has the value \fIpqr\fP
-then
-.DS
-       eval echo $X
-.DE
-will echo the string \fIpqr\|.\fP
-.LP
-In general the \fIeval\fP command
-evaluates its arguments (as do all commands)
-and treats the result as input to the shell.
-The input is read and the resulting command(s)
-executed.
-For example,
-.DS
-       wg=\\'eval who\*(VTgrep\\'
-       $wg fred
-.DE
-is equivalent to
-.DS
-       who\*(VTgrep fred
-.DE
-In this example,
-\fIeval\fP is required
-since there is no interpretation
-of metacharacters, such as \fB\*(VT\|,\fP following
-substitution.
-.SH
-3.5\ Error\ handling
-.LP
-The treatment of errors detected by
-the shell depends on the type of error
-and on whether the shell is being
-used interactively.
-An interactive shell is one whose
-input and output are connected
-to a terminal (as determined by
-\fIgtty\fP (2)).
-A shell invoked with the \fB\(mii\fP
-flag is also interactive.
-.LP
-Execution of a command (see also 3.7) may fail
-for any of the following reasons.
-.IP \(bu
-Input output redirection may fail.
-For example, if a file does not exist
-or cannot be created.
-.IP \(bu
-The command itself does not exist
-or cannot be executed.
-.IP \(bu
-The command terminates abnormally,
-for example, with a "bus error"
-or "memory fault".
-See Figure 2 below for a complete list
-of UNIX signals.
-.IP \(bu
-The command terminates normally
-but returns a non-zero exit status.
-.LP
-In all of these cases the shell
-will go on to execute the next command.
-Except for the last case an error
-message will be printed by the shell.
-All remaining errors cause the shell
-to exit from a command procedure.
-An interactive shell will return
-to read another command from the terminal.
-Such errors include the following.
-.IP \(bu
-Syntax errors.
-e.g., if \*(ZZ then \*(ZZ done
-.IP \(bu
-A signal such as interrupt.
-The shell waits for the current
-command, if any, to finish execution and
-then either exits or returns to the terminal.
-.IP \(bu
-Failure of any of the built-in commands
-such as \fIcd.\fP
-.LP
-The shell flag \fB\(mie\fP
-causes the shell to terminate
-if any error is detected.
-.DS
-1      hangup
-2      interrupt
-3*     quit
-4*     illegal instruction
-5*     trace trap
-6*     IOT instruction
-7*     EMT instruction
-8*     floating point exception
-9      kill (cannot be caught or ignored)
-10*    bus error
-11*    segmentation violation
-12*    bad argument to system call
-13     write on a pipe with no one to read it
-14     alarm clock
-15     software termination (from \fIkill\fP (1))
-
-.DE
-.ft B
-.ce
-Figure 3. UNIX signals
-.ft
-
-Those signals marked with an asterisk
-produce a core dump
-if not caught.
-However,
-the shell itself ignores quit which is the only
-external signal that can cause a dump.
-The signals in this list of potential interest
-to shell programs are 1, 2, 3, 14 and 15.
-.SH
-3.6\ Fault\ handling
-.LP
-Shell procedures normally terminate
-when an interrupt is received from the
-terminal.
-The \fItrap\fP command is used
-if some cleaning up is required, such
-as removing temporary files.
-For example,
-.DS
-       trap\ \'rm\ /tmp/ps$$; exit\'\ 2
-.DE
-sets a trap for signal 2 (terminal
-interrupt), and if this signal is received
-will execute the commands
-.DS
-       rm /tmp/ps$$; exit
-.DE
-\fIexit\fP is
-another built-in command
-that terminates execution of a shell procedure.
-The \fIexit\fP is required; otherwise,
-after the trap has been taken,
-the shell will resume executing
-the procedure
-at the place where it was interrupted.
-.LP
-UNIX signals can be handled in one of three ways.
-They can be ignored, in which case
-the signal is never sent to the process.
-They can be caught, in which case the process
-must decide what action to take when the
-signal is received.
-Lastly, they can be left to cause
-termination of the process without
-it having to take any further action.
-If a signal is being ignored
-on entry to the shell procedure, for example,
-by invoking it in the background (see 3.7) then \fItrap\fP
-commands (and the signal) are ignored.
-.LP
-The use of \fItrap\fP is illustrated
-by this modified version of the \fItouch\fP
-command (Figure 4).
-The cleanup action is to remove the file \fBjunk$$\fR\|.
-.DS
-       flag=
-       trap\ \'rm\ \(mif\ junk$$;\ exit\'\ 1 2 3 15
-       for i
-       do\ case\ $i\ in
-       \*(DC\(mic)     flag=N ;;
-       \*(DC\*(ST)     if\ test\ \(mif\ $i
-       \*(DC   then    ln\ $i\ junk$$;\ rm\ junk$$
-       \*(DC   elif\ test\ $flag
-       \*(DC   then    echo\ file\ \\\\\'$i\\\\\'\ does\ not\ exist
-       \*(DC   else    >$i
-       \*(DC   fi
-       \*(DOesac
-       done
-.DE
-.sp
-.ft B
-.ce
-Figure 4. The touch command
-.ft
-.sp
-The \fItrap\fP command
-appears before the creation
-of the temporary file;
-otherwise it would be
-possible for the process
-to die without removing
-the file.
-.LP
-Since there is no signal 0 in UNIX
-it is used by the shell to indicate the
-commands to be executed on exit from the
-shell procedure.
-.LP
-A procedure may, itself, elect to
-ignore signals by specifying the null
-string as the argument to trap.
-The following fragment is taken from the
-\fInohup\fP command.
-.DS
-       trap \'\' 1 2 3 15
-.DE
-which causes \fIhangup, interrupt, quit \fRand\fI kill\fR
-to be ignored both by the
-procedure and by invoked commands.
-.LP
-Traps may be reset by saying
-.DS
-       trap 2 3
-.DE
-which resets the traps for signals 2 and 3 to their default values.
-A list of the current values of traps may be obtained
-by writing
-.DS
-       trap
-.DE
-.LP
-The procedure \fIscan\fP (Figure 5) is an example
-of the use of \fItrap\fP where there is no exit
-in the trap command.
-\fIscan\fP takes each directory
-in the current directory, prompts
-with its name, and then executes
-commands typed at the terminal
-until an end of file or an interrupt is received.
-Interrupts are ignored while executing
-the requested commands but cause
-termination when \fIscan\fP is
-waiting for input.
-.DS
-       d=\`pwd\`
-       for\ i\ in\ \*(ST
-       do\ if\ test\ \(mid\ $d/$i
-       \*(DOthen\ cd\ $d/$i
-       \*(DO\*(THwhile\ echo\ "$i:"
-       \*(DO\*(TH\*(WHtrap\ exit\ 2
-       \*(DO\*(TH\*(WHread\ x
-       \*(DO\*(THdo\ trap\ :\ 2;\ eval\ $x;\ done
-       \*(DOfi
-       done
-.DE
-.sp
-.ft B
-.ce
-Figure 5. The scan command
-.ft
-.sp
-\fIread x\fR is a built-in command that reads one line from the
-standard input
-and places the result in the variable \fBx\|.\fP
-It returns a non-zero exit status if either
-an end-of-file is read or an interrupt
-is received.
-.SH
-3.7\ Command\ execution
-.LP
-To run a command (other than a built-in) the shell first creates
-a new process using the system call \fIfork.\fP
-The execution environment for the command
-includes input, output and the states of signals, and
-is established in the child process
-before the command is executed.
-The built-in command \fIexec\fP
-is used in the rare cases when no fork
-is required
-and simply replaces the shell with a new command.
-For example, a simple version of the \fInohup\fP
-command looks like
-.DS
-       trap \\'\\' 1 2 3 15
-       exec $\*(ST
-.DE
-The \fItrap\fP turns off the signals specified
-so that they are ignored by subsequently created commands
-and \fIexec\fP replaces the shell by the command
-specified.
-.LP
-Most forms of input output redirection have already been
-described.
-In the following \fIword\fP is only subject
-to parameter and command substitution.
-No file name generation or blank interpretation
-takes place so that, for example,
-.DS
-               echo \*(ZZ >\*(ST.c
-.DE
-will write its output into a file whose name is \fB\*(ST.c\|.\fP
-Input output specifications are evaluated left to right
-as they appear in the command.
-.IP >\ \fIword\fP 12
-The standard output (file descriptor 1)
-is sent to the file \fIword\fP which is
-created if it does not already exist.
-.IP \*(AP\ \fIword\fP 12
-The standard output is sent to file \fIword.\fP
-If the file exists then output is appended
-(by seeking to the end);
-otherwise the file is created.
-.IP <\ \fIword\fP 12
-The standard input (file descriptor 0)
-is taken from the file \fIword.\fP
-.IP \*(HE\ \fIword\fP 12
-The standard input is taken from the lines
-of shell input that follow up to but not
-including a line consisting only of \fIword.\fP
-If \fIword\fP is quoted then no interpretation
-of the document occurs.
-If \fIword\fP is not quoted
-then parameter and command substitution
-occur and \fB\\\fP is used to quote
-the characters \fB\\\fP \fB$\fP \fB\`\fP and the first character
-of \fIword.\fP
-In the latter case \fB\\newline\fP is ignored (c.f. quoted strings).
-.IP >&\ \fIdigit\fP 12
-The file descriptor \fIdigit\fP is duplicated using the system
-call \fIdup\fP (2)
-and the result is used as the standard output.
-.IP <&\ \fIdigit\fP 12
-The standard input is duplicated from file descriptor \fIdigit.\fP
-.IP <&\(mi 12
-The standard input is closed.
-.IP >&\(mi 12
-The standard output is closed.
-.LP
-Any of the above may be preceded by a digit in which
-case the file descriptor created is that specified by the digit
-instead of the default 0 or 1.
-For example,
-.DS
-       \*(ZZ 2>file
-.DE
-runs a command with message output (file descriptor 2)
-directed to \fIfile.\fP
-.DS
-       \*(ZZ 2>&1
-.DE
-runs a command with its standard output and message output
-merged.
-(Strictly speaking file descriptor 2 is created
-by duplicating file descriptor 1 but the effect is usually to
-merge the two streams.)
-.LP
-The environment for a command run in the background such as
-.DS
-       list \*(ST.c \*(VT lpr &
-.DE
-is modified in two ways.
-Firstly, the default standard input
-for such a command is the empty file \fB/dev/null\|.\fR
-This prevents two processes (the shell and the command),
-which are running in parallel, from trying to
-read the same input.
-Chaos would ensue
-if this were not the case.
-For example,
-.DS
-       ed file &
-.DE
-would allow both the editor and the shell
-to read from the same input at the same time.
-.LP
-The other modification to the environment of a background
-command is to turn off the QUIT and INTERRUPT signals
-so that they are ignored by the command.
-This allows these signals to be used
-at the terminal without causing background
-commands to terminate.
-For this reason the UNIX convention
-for a signal is that if it is set to 1
-(ignored) then it is never changed
-even for a short time.
-Note that the shell command \fItrap\fP
-has no effect for an ignored signal.
-.SH
-3.8\ Invoking\ the\ shell
-.LP
-The following flags are interpreted by the shell
-when it is invoked.
-If the first character of argument zero is a minus,
-then commands are read from the file \fB.profile\|.\fP
-.IP \fB\(mic\fP\ \fIstring\fP
-.br
-If the \fB\(mic\fP flag is present then
-commands are read from \fIstring\|.\fP
-.IP \fB\(mis\fP
-If the \fB\(mis\fP flag is present or if no
-arguments remain
-then commands are read from the standard input.
-Shell output is written to
-file descriptor 2.
-.IP \fB\(mii\fP
-If the \fB\(mii\fP flag is present or
-if the shell input and output are attached to a terminal (as told by \fIgtty\fP)
-then this shell is \fIinteractive.\fP
-In this case TERMINATE is ignored (so that \fBkill 0\fP
-does not kill an interactive shell) and INTERRUPT is caught and ignored
-(so that \fBwait\fP is interruptable).
-In all cases QUIT is ignored by the shell.
-.SH
-Acknowledgements
-.LP
-The design of the shell is
-based in part on the original UNIX shell
-.[
-unix command language thompson
-.]
-and the PWB/UNIX shell,
-.[
-pwb shell mashey unix
-.]
-some
-features having been taken from both.
-Similarities also exist with the
-command interpreters
-of the Cambridge Multiple Access System
-.[
-cambridge multiple access system hartley
-.]
-and of CTSS.
-.[
-ctss
-.]
-.LP
-I would like to thank Dennis Ritchie
-and John Mashey for many
-discussions during the design of the shell.
-I am also grateful to the members of the Computing Science Research Center
-and to Joe Maranzano for their
-comments on drafts of this document.
-.SH
-.[
-$LIST$
-.]
diff --git a/.ref-Research-V7/usr/doc/shell/t4 b/.ref-Research-V7/usr/doc/shell/t4
deleted file mode 100644 (file)
index 380c867..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-.bp
-.SH
-Appendix\ A\ -\ Grammar
-.LP
-.DS
-\fIitem:               word
-               input-output
-               name = value
-.sp 0.8
-simple-command: item
-               simple-command item
-.sp 0.8
-command:       simple-command
-               \fB( \fIcommand-list \fB)
-               \fB{ \fIcommand-list \fB}
-               \fBfor \fIname \fBdo \fIcommand-list \fBdone
-               \fBfor \fIname \fBin \fIword \*(ZZ \fBdo \fIcommand-list \fBdone
-               \fBwhile \fIcommand-list \fBdo \fIcommand-list \fBdone
-               \fBuntil \fIcommand-list \fBdo \fIcommand-list \fBdone
-               \fBcase \fIword \fBin \fIcase-part \*(ZZ \fBesac
-               \fBif \fIcommand-list \fBthen \fIcommand-list \fIelse-part \fBfi
-.sp 0.8
-\fIpipeline:           command
-               pipeline \fB\*(VT\fI command
-.sp 0.8
-andor:         pipeline
-               andor \fB&&\fI pipeline
-               andor \fB\*(VT\*(VT\fI pipeline
-.sp 0.8
-command-list:  andor
-               command-list \fB;\fI
-               command-list \fB&\fI
-               command-list \fB;\fI andor
-               command-list \fB&\fI andor
-.sp 0.8
-input-output:  \fB> \fIfile
-               \fB< \fIfile
-               \fB\*(AP \fIword
-               \fB\*(HE \fIword
-.sp 0.8
-file:          word
-               \fB&\fI digit
-               \fB&\fI \(mi
-.sp 0.8
-case-part:     pattern\fB ) \fIcommand-list\fB ;;
-.sp 0.8
-\fIpattern:            word
-               pattern \fB\*(VT\fI word
-.sp 0.8
-\fIelse-part:  \fBelif \fIcommand-list\fB then\fI command-list else-part\fP
-               \fBelse \fIcommand-list\fI
-               empty
-.sp 0.8
-empty:
-.sp 0.8
-word:          \fRa sequence of non-blank characters\fI
-.sp 0.8
-name:          \fRa sequence of letters, digits or underscores starting with a letter\fI
-.sp 0.8
-digit:         \fB0 1 2 3 4 5 6 7 8 9\fP
-.DE
-.LP
-.bp
-.SH
-Appendix\ B\ -\ Meta-characters\ and\ Reserved\ Words
-.LP
-a) syntactic
-.RS
-.IP \fB\*(VT\fR 6
-pipe symbol
-.IP \fB&&\fR 6
-`andf' symbol
-.IP \fB\*(VT\*(VT\fR 6
-`orf' symbol
-.IP \fB;\fP 6
-command separator
-.IP \fB;;\fP 6
-case delimiter
-.IP \fB&\fP 6
-background commands
-.IP \fB(\ )\fP 6
-command grouping
-.IP \fB<\fP 6
-input redirection
-.IP \fB\*(HE\fP 6
-input from a here document
-.IP \fB>\fP 6
-output creation
-.IP \fB\*(AP\fP 6
-output append
-.sp 2
-.RE
-.LP
-b) patterns
-.RS
-.IP \fB\*(ST\fP 6
-match any character(s) including none
-.IP \fB?\fP 6
-match any single character
-.IP \fB[...]\fP 6
-match any of the enclosed characters
-.sp 2
-.RE
-.LP
-c) substitution
-.RS
-.IP \fB${...}\fP 6
-substitute shell variable
-.IP \fB\`...\`\fP 6
-substitute command output
-.sp 2
-.RE
-.LP
-d) quoting
-.RS
-.IP \fB\e\fP 6
-quote the next character
-.IP \fB\'...\'\fP 6
-quote the enclosed characters except for \'
-.IP \fB"\&..."\fR 6
-quote the enclosed characters except
-for \fB$ \` \e "\fP
-.sp 2
-.RE
-.LP
-e) reserved words
-.DS
-.ft B
-if then else elif fi
-case in esac
-for while until do done
-{  }
-.ft
-.DE
diff --git a/.ref-Research-V7/usr/doc/summary/hel.mac b/.ref-Research-V7/usr/doc/summary/hel.mac
deleted file mode 100644 (file)
index 4748c2e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-.hy 9
-.de op
-.nr PD 0
-.IP \h'1i'\(ci 1i+2
-.nr PD .5v
-..
-.de sh
-.IP "\(sq\ \\$1" 1i
-..
-.de OP
-.op \\$1 \\$2 \\$3
-..
-.de UC
-\&\\$3\\s-1\\$1\\s0\\$2\&
-..
diff --git a/.ref-Research-V7/usr/doc/summary/hel0 b/.ref-Research-V7/usr/doc/summary/hel0
deleted file mode 100644 (file)
index eee74d9..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-.TL
-7th Edition UNIX \(em Summary
-.AU
-September 6, 1978
-.AI
-.MH
-.SH
-A.  What's new: highlights of the 7th edition UNIX\(dg System
-.FS
-\(dg
-.UC UNIX
-is a Trademark of Bell Laboratories.
-.FE
-.LP
-.B "Aimed at larger systems."
-Devices are addressable to 2\u\s-231\s+2\d
-bytes, files to 2\u\s-230\s+2\d bytes.
-128K memory (separate instruction and data space) is needed for some utilities.
-.LP
-.B "Portability."
-Code of the operating system and most utilities has
-been extensively revised to minimize its
-dependence on particular hardware.
-.LP
-.B "Fortran 77."
-F77 compiler for the new standard language
-is compatible with C at the object level.
-A Fortran structurer, STRUCT, converts old, ugly Fortran into RATFOR,
-a structured dialect usable with F77.
-.LP
-.B "Shell."
-Completely new SH program supports string variables,
-trap handling, structured programming, user profiles,
-settable search path,
-multilevel file name generation, etc.
-.LP
-.B "Document preparation."
-TROFF phototypesetter utility is standard.
-NROFF (for terminals) is now highly compatible
-with TROFF.
-MS macro package provides canned commands for
-many common formatting and layout situations.
-TBL provides an easy to learn language for preparing
-complicated tabular material.
-REFER fills in bibliographic citations
-from a data base.
-.LP
-.B "UNIX-to-UNIX file copy."
-UUCP performs spooled
-file transfers between any two machines.
-.LP
-.B "Data processing."
-SED stream editor does multiple editing functions
-in parallel on a data stream of indefinite length.
-AWK report generator does free-field pattern selection
-and arithmetic operations.
-.LP
-.B "Program development."
-MAKE
-controls re-creation of complicated software,
-arranging for minimal recompilation.
-.LP
-.B "Debugging."
-ADB does postmortem and breakpoint debugging,
-handles separate instruction and data spaces,
-floating point, etc.
-.LP
-.B "C language."
-The language now supports
-definable data types, generalized initialization,
-block structure, long integers,
-unions,
-explicit type conversions.
-The LINT verifier does strong type checking
-and detection of probable errors and portability problems
-even across separately compiled functions.
-.LP
-.B "Lexical analyzer generator."
-LEX converts specification of regular expressions
-and semantic actions into a recognizing subroutine.
-Analogous to YACC.
-.LP
-.B "Graphics."
-Simple graph-drawing utility, graphic subroutines, and
-generalized plotting filters adapted to various devices
-are now standard.
-.LP
-.B "Standard input-output package."
-Highly efficient buffered stream I/O is
-integrated with formatted input and output.
-.LP
-.B "Other."
-The operating system and utilities have been enhanced
-and freed of restrictions in many
-other ways too numerous to relate.
-.sp 100
diff --git a/.ref-Research-V7/usr/doc/summary/hel1 b/.ref-Research-V7/usr/doc/summary/hel1
deleted file mode 100644 (file)
index 18cb3b3..0000000
+++ /dev/null
@@ -1,785 +0,0 @@
-.SH
-B.  Hardware
-.PP
-The
-7th edition
-.UC UNIX
-operating system
-runs on
-a DEC PDP-11/45 or 11/70*
-.FS
-*PDP is a Trademark of Digital Equipment Corporation.
-.FE
-with at least the following equipment:
-.IP
-128K to 2M words of managed memory; parity not used.
-.IP
-disk: RP03, RP04, RP06, RK05 (more than 1 RK05) or equivalent.
-.IP
-console typewriter.
-.IP
-clock: KW11-L or KW11-P.
-.LP
-The following equipment is strongly recommended:
-.IP
-communications controller such as DL11 or DH11.
-.IP
-full duplex 96-character ASCII terminals.
-.IP
-9-track tape or extra disk for system backup.
-.LP
-The system is normally distributed on 9-track tape.
-The minimum memory and disk space specified is enough to run
-and maintain
-.UC UNIX .
-More will be needed to keep all source on line, or to handle
-a large number of users,
-big data bases, diversified complements of devices, or large
-programs.
-The resident code
-occupies 12-20K words depending
-on configuration;
-system data occupies 10-28K words.
-.PP
-There is no commitment to provide 7th edition
-.UC UNIX
-on PDP-11/34, 11/40 and 11/60 hardware.
-.SH
-C.  Software
-.PP
-Most of the programs available as
-.UC UNIX
-commands are listed.
-Source code and printed manuals are 
-distributed for all of the listed software
-except games.
-Almost all of the code is written in C.
-Commands are self-contained and do not require extra setup
-information,
-unless specifically noted as ``interactive.''
-Interactive programs can be made to run from a prepared script
-simply by redirecting input.
-Most programs intended for interactive use
-(e.g., the editor) 
-allow for an escape to
-command level (the Shell).
-Most file processing commands
-can also go from standard input to standard output
-(``filters'').
-The piping facility of the Shell may be used
-to connect such filters directly to the input or output
-of other programs.
-.NH
-Basic Software
-.PP
-This
-includes the time-sharing operating
-system with utilities, a machine language assembler and a 
-compiler for the programming language C\(emenough
-software to
-write and run new applications
-and to maintain or modify
-.UC UNIX
-itself.
-.NH 2
-Operating System
-.sh UNIX
-The basic resident code
-on which everything else depends.
-Supports the system calls, and maintains the file system.
-A general description of
-.UC UNIX
-design
-philosophy and system facilities appeared in
-the Communications of the ACM, July, 1974.
-A more extensive survey is in the Bell System Technical Journal
-for July-August 1978.
-Capabilities include:
-.op
-Reentrant code for user processes.
-.op
-Separate instruction and data spaces.
-.op
-``Group'' access permissions for cooperative projects,
-with overlapping memberships.
-.op
-Alarm-clock timeouts.
-.op
-Timer-interrupt sampling and interprocess monitoring
-for debugging and measurement.
-.OP
-Multiplexed I/O for machine-to-machine communication.
-.sh DEVICES
-All I/O is logically synchronous.
-I/O devices are simply files in the file system.
-Normally, invisible buffering makes all physical
-record structure and device characteristics transparent and exploits the
-hardware's ability to do overlapped I/O.
-Unbuffered physical record
-I/O is available for unusual applications.
-Drivers for these devices are
-available; others can be easily written:
-.op
-Asynchronous interfaces: DH11, DL11.
-Support for most common ASCII terminals.
-.op
-Synchronous interface: DP11.
-.op
-Automatic calling unit interface: DN11.
-.op
-Line printer: LP11.
-.op
-Magnetic tape: TU10 and TU16.
-.op
-DECtape: TC11.
-.op
-Fixed head disk: RS11, RS03 and RS04.
-.op
-Pack type disk: RP03, RP04, RP06;
-minimum-latency seek scheduling.
-.op
-Cartridge-type disk: RK05, one or more physical devices per
-logical device.
-.op
-Null device.
-.op
-Physical memory of PDP-11, or mapped memory in resident system.
-.op
-Phototypesetter: Graphic Systems System/1 through DR11C.
-.sh BOOT
-Procedures to get
-.UC UNIX
-started.
-.sh MKCONF
-Tailor device-dependent system code to hardware configuration.
-As distributed,
-.UC UNIX
-can 
-be brought up directly on any acceptable CPU
-with any acceptable disk, any sufficient amount of core,
-and either clock.
-Other changes, such as optimal
-assignment of directories to devices, inclusion of floating
-point simulator, or installation of device names in file system,
-can then be made at leisure.
-.NH 2
-User Access Control
-.LP
-.sh LOGIN
-Sign on as a new user.
-.op
-Verify password and establish user's 
-individual and group (project) identity.
-.op
-Adapt to characteristics of terminal.
-.op
-Establish working directory.
-.op
-Announce presence of mail (from MAIL).
-.op
-Publish message of the day.
-.op
-Execute user-specified profile.
-.op
-Start command interpreter or other initial program.
-.sh PASSWD
-Change a password.
-.op
-User can change his own password.
-.op
-Passwords are kept encrypted for security.
-.sh NEWGRP
-Change working group (project).
-Protects against unauthorized changes to projects.
-.NH 2
-Terminal Handling
-.LP
-.sh TABS
-Set tab stops appropriately for specified terminal type.
-.sh STTY
-Set up options for optimal control of a terminal.
-In so far as they are deducible from the input, these
-options are set automatically by LOGIN.
-.op
-Half vs. full duplex.
-.op
-Carriage return+line feed vs. newline.
-.op
-Interpretation of tabs.
-.op
-Parity.
-.op
-Mapping of upper case to lower.
-.op
-Raw vs. edited input.
-.op
-Delays for tabs, newlines and carriage returns.
-.NH 2
-File Manipulation
-.LP
-.sh CAT
-Concatenate one or more files onto standard output.
-Particularly used for unadorned printing, for
-inserting data into a pipeline,
-and for buffering output that comes in dribs and drabs.
-Works on any file regardless of contents.
-.sh CP
-Copy one file to another,
-or a set of files to a directory.
-Works on any file regardless of contents.
-.sh PR
-Print files with title, date, and page number on every page.
-.op
-Multicolumn output.
-.op
-Parallel column merge of several files.
-.sh LPR
-Off-line print.
-Spools arbitrary files to the line printer.
-.sh CMP
-Compare two files and report if different.
-.sh TAIL
-Print last
-.I n
-lines of input
-.op
-May print last
-.I n
-characters, or from
-.I n
-lines or characters to end.
-.sh SPLIT
-Split a large file into more manageable pieces.
-Occasionally necessary for editing (ED).
-.sh DD
-Physical file format translator,
-for exchanging data with foreign
-systems, especially IBM 370's.
-.sh SUM
-Sum the words of a file.
-.NH 2
-Manipulation of Directories and File Names
-.LP
-.sh RM
-Remove a file.
-Only the name goes away if any other names are linked to the file.
-.OP
-Step through a directory deleting files interactively.
-.OP
-Delete entire directory hierarchies.
-.sh LN
-``Link'' another name (alias) to an existing file.
-.sh MV
-Move a file or files.
-Used for renaming files.
-.sh CHMOD
-Change permissions on one or more files.
-Executable by files' owner.
-.sh CHOWN
-Change owner of one or more files.
-.sh CHGRP
-Change group (project) to which a file belongs.
-.sh MKDIR
-Make a new directory.
-.sh RMDIR
-Remove a directory.
-.sh CD
-Change working directory.
-.sh FIND
-Prowl the directory
-hierarchy finding
-every file that meets
-specified criteria.
-.op
-Criteria include:
-.in +2
-.nf
-name matches a given pattern,
-creation date in given range,
-date of last use in given range,
-given permissions,
-given owner,
-given special file characteristics,
-boolean combinations of above.
-.in -2
-.fi
-.op
-Any directory may be considered to be the root.
-.op
-Perform specified command on each file found.
-.NH 2
-Running of Programs
-.LP
-.sh SH
-The Shell, or command language interpreter.
-.op
-Supply arguments to and run any executable program.
-.op
-Redirect standard input, standard output, and standard error files.
-.op
-Pipes:
-simultaneous execution with output of one process connected
-to the input of another.
-.OP
-Compose compound commands using:
-.in+2
-if ... then ... else,
-.br
-case switches,
-.br
-while loops,
-.br
-for loops over lists,
-.br
-break, continue and exit,
-.br
-parentheses for grouping.
-.in -2
-.op
-Initiate background processes.
-.op
-Perform Shell programs, i.e., command scripts with
-substitutable arguments.
-.op
-Construct argument lists from all file names
-satisfying specified patterns.
-.OP
-Take special action on traps and interrupts.
-.OP
-User-settable search path for finding commands.
-.OP
-Executes user-settable profile upon login.
-.OP
-Optionally announces presence of mail as it arrives.
-.op
-Provides variables and parameters with default setting.
-.sh TEST
-Tests for use in Shell conditionals.
-.op
-String comparison.
-.op
-File nature and accessibility.
-.op
-Boolean combinations of the above.
-.sh EXPR
-String computations for calculating command arguments.
-.OP
-Integer arithmetic
-.OP
-Pattern matching
-.sh WAIT
-Wait for termination of asynchronously running processes.
-.sh READ
-Read a line from terminal,
-for interactive Shell procedure.
-.sh ECHO
-Print remainder of command line.
-Useful for diagnostics or prompts in Shell programs,
-or for inserting data into a pipeline.
-.sh SLEEP
-Suspend execution for a specified time.
-.sh NOHUP
-Run a command immune to hanging up the terminal.
-.sh NICE
-Run a command in low (or high) priority.
-.sh KILL
-Terminate named processes.
-.sh CRON
-Schedule regular actions at specified times.
-.op
-Actions are arbitrary programs.
-.op
-Times are
-conjunctions of month, day of month, day of week, hour
-and minute.
-Ranges are specifiable for each.
-.sh AT
-Schedule a one-shot action for an arbitrary time.
-.sh TEE
-Pass data between processes and divert a copy into one or more files.
-.NH 2
-Status Inquiries
-.LP
-.sh LS
-List the names of one, several, or all files in one or more directories.
-.op
-Alphabetic or temporal sorting, up or down.
-.op
-Optional information:
-size,
-owner,
-group,
-date last modified,
-date last accessed,
-permissions,
-i-node number.
-.sh FILE
-Try to determine 
-what kind of information is in a file by consulting
-the file system index and by reading the file itself.
-.sh DATE
-Print today's date and time.
-Has considerable knowledge
-of calendric and horological peculiarities.
-.op
-May set
-.UC UNIX 's
-idea of date and time.
-.sh DF
-Report amount of free space on file system devices.
-.sh DU
-Print a summary of total space occupied by all files in a hierarchy.
-.sh QUOT
-Print summary of file space usage by user id.
-.sh WHO
-Tell who's on the system.
-.op
-List of presently logged in users,
-ports and times on.
-.op
-Optional history of all logins and logouts.
-.sh PS
-Report on active processes.
-.op
-List your own or everybody's processes.
-.op
-Tell what commands are being executed.
-.op
-Optional status information:
-state and scheduling info,
-priority,
-attached terminal,
-what it's waiting for,
-size.
-.sh IOSTAT
-Print statistics about system I/O activity.
-.sh TTY
-Print name of your terminal.
-.sh PWD
-Print name of your working directory.
-.NH 2
-Backup and Maintenance
-.LP
-.sh MOUNT
-Attach a device containing
-a file system to
-the tree of directories.
-Protects against nonsense arrangements.
-.sh UMOUNT
-Remove the file system contained on a device
-from the tree of directories.
-Protects against removing a busy device.
-.sh MKFS
-Make a new file system on a device.
-.sh MKNOD
-Make an i-node (file system entry) for a special file.
-Special files are
-physical devices,
-virtual devices, physical memory, etc.
-.sh TP
-.sh TAR
-Manage file archives on magnetic tape or DECtape.
-TAR is newer.
-.op
-Collect files into an archive.
-.op
-Update DECtape archive by date.
-.op
-Replace or delete DECtape files.
-.op
-Print table of contents.
-.op
-Retrieve from archive.
-.sh DUMP
-Dump the file system
-stored on a specified device, selectively by date, or indiscriminately.
-.sh RESTOR
-Restore a dumped file system,
-or selectively retrieve parts thereof.
-.sh SU
-Temporarily become the super user with all the rights and privileges
-thereof.
-Requires a password.
-.sh DCHECK
-.sh ICHECK
-.sh NCHECK
-Check consistency of file system.
-.op
-Print gross statistics:
-number of files,
-number of directories,
-number of special files,
-space used,
-space free.
-.op
-Report duplicate use of space.
-.op
-Retrieve lost space.
-.op
-Report inaccessible files.
-.op
-Check consistency of directories.
-.op
-List names of all files.
-.sh CLRI
-Peremptorily expunge a file and its space from a file system.
-Used to repair damaged file systems.
-.sh SYNC
-Force all outstanding I/O on the system to completion.
-Used to shut down gracefully.
-.NH 2
-Accounting
-.LP
-The timing information on which the reports are based can be
-manually cleared or shut off completely.
-.sh AC
-Publish cumulative connect time report.
-.op
-Connect time by user or by day.
-.op
-For all users or for selected users.
-.sh SA
-Publish Shell accounting
-report.
-Gives usage information on each command executed.
-.op
-Number of times used.
-.op
-Total system time, user time and elapsed time.
-.op
-Optional averages and percentages.
-.op
-Sorting on various fields.
-.NH 2
-Communication
-.LP
-.sh MAIL
-Mail a message to one or more users.
-Also used to read and dispose of incoming mail.
-The presence of mail is announced by LOGIN
-and optionally by SH.
-.op
-Each message can be disposed of individually.
-.op
-Messages can be saved in files or forwarded.
-.sh CALENDAR
-Automatic reminder service for events of today and tomorrow.
-.sh WRITE
-Establish direct terminal communication with another user.
-.sh WALL
-Write to all users.
-.sh MESG
-Inhibit receipt of messages from WRITE and WALL.
-.sh CU
-Call up another time-sharing system.
-.OP
-Transparent interface to remote machine.
-.OP
-File transmission.
-.OP
-Take remote input from local file or put remote output
-into local file.
-.OP
-Remote system need not be
-.UC UNIX .
-.sh UUCP
-.UC UNIX
-to
-.UC UNIX
-copy.
-.OP
-Automatic queuing until line becomes available
-and remote machine is up.
-.OP
-Copy between two remote machines.
-.op
-Differences, mail, etc., between two machines.
-.NH 2
-Basic Program Development Tools
-.LP
-Some of these utilities are used as integral parts of
-the higher level languages described in section 2.
-.sh AR
-Maintain archives and libraries.
-Combines several files into one for housekeeping efficiency.
-.op
-Create new archive.
-.op
-Update archive by date.
-.op
-Replace or delete files.
-.op
-Print table of contents.
-.op
-Retrieve from archive.
-.sh AS
-Assembler.
-Similar to PAL-11, but different in detail.
-.op
-Creates object program consisting of
-.in+2
-.nf
-code, possibly read-only,
-initialized data or read-write code,
-uninitialized data.
-.in -2
-.fi
-.op
-Relocatable object code is directly executable without
-further transformation.
-.op
-Object code normally includes a symbol table.
-.op
-Multiple source files.
-.op
-Local labels.
-.op
-Conditional assembly.
-.op
-``Conditional jump'' instructions become
-branches or branches plus jumps depending on distance.
-.sh Library
-The basic run-time library.
-These routines are used freely by all software.
-.op
-Buffered character-by-character I/O.
-.op
-Formatted input and output conversion (SCANF and PRINTF)
-for standard input and output, files, in-memory conversion.
-.op
-Storage allocator.
-.op
-Time conversions.
-.op
-Number conversions.
-.op
-Password encryption.
-.op
-Quicksort.
-.op
-Random number generator.
-.op
-Mathematical function library, including
-trigonometric functions and inverses,
-exponential, logarithm, square root,
-bessel functions.
-.sh ADB
-Interactive debugger.
-.op
-Postmortem dumping.
-.OP
-Examination of arbitrary files, with no limit on size.
-.op
-Interactive breakpoint debugging with the debugger as a separate
-process.
-.OP
-Symbolic reference to local and global variables.
-.op
-Stack trace for C programs.
-.OP
-Output formats:
-.in+2
-.nf
-1-, 2-, or 4-byte integers in octal, decimal, or hex
-.br
-single and double floating point
-.br
-character and string
-.br
-disassembled machine instructions
-.br
-.fi
-.in-2
-.op
-Patching.
-.OP
-Searching for integer, character, or floating patterns.
-.OP
-Handles separated instruction and data space.
-.sh OD
-Dump any file.
-Output options include any combination of
-octal or decimal by words,
-octal by bytes,
-ASCII,
-opcodes,
-hexadecimal.
-.op
-Range of dumping is controllable.
-.sh LD
-Link edit.
-Combine relocatable object files.
-Insert required routines from specified libraries.
-.op
-Resulting code may be sharable.
-.op
-Resulting code may have separate instruction and data spaces.
-.sh LORDER
-Places object file names in proper order for loading,
-so that files depending on others come after them.
-.sh NM
-Print the namelist (symbol table) of an object program.
-Provides control over the style and order of
-names that are printed.
-.sh SIZE
-Report the core requirements
-of one or more object files.
-.sh STRIP
-Remove the relocation and symbol table information from
-an object file to save space.
-.sh TIME
-Run a command and report timing information on it.
-.sh PROF
-Construct a profile of time spent per routine
-from statistics gathered by time-sampling the
-execution of a program.
-Uses floating point.
-.op
-Subroutine call frequency and average times for C programs.
-.sh MAKE
-Controls creation of large programs.
-Uses a control file specifying source file dependencies
-to make new version;
-uses time last changed to deduce minimum amount of work necessary.
-.op
-Knows about CC, YACC, LEX, etc.
-.NH 2
-UNIX Programmer's Manual
-.LP
-.sh Manual
-Machine-readable version of the
-.UC UNIX
-Programmer's Manual.
-.op
-System overview.
-.op
-All commands.
-.op
-All system calls.
-.op
-All subroutines in C and assembler libraries.
-.op
-All devices and other special files.
-.op
-Formats of file system and kinds
-of files known to system software.
-.op
-Boot and maintenance procedures.
-.sh MAN
-Print specified manual section on your terminal.
-.NH 2
-Computer-Aided Instruction
-.LP
-.sh LEARN
-A program for interpreting CAI scripts, plus scripts
-for learning about 
-.UC UNIX
-by using it.
-.op
-Scripts for basic files and commands,
-editor,
-advanced files and commands,
-.UC EQN ,
-.UC MS
-macros,
-C programming language.
diff --git a/.ref-Research-V7/usr/doc/summary/hel2 b/.ref-Research-V7/usr/doc/summary/hel2
deleted file mode 100644 (file)
index 63c1077..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-.NH
-Languages
-.NH 2
-The C Language
-.LP
-.sh CC
-Compile and/or link edit programs in the C
-language.
-The 
-.UC UNIX
-operating system, most of the
-subsystems and C itself are written in C.
-For a full description of C, read
-.ul
-The C Programming Language,
-Brian W. Kernighan and Dennis M. Ritchie,
-Prentice-Hall, 1978.
-.op
-General purpose language
-designed for structured programming.
-.op
-Data types include
-character,
-integer,
-float,
-double,
-pointers to all types,
-functions returning above types,
-arrays of all types,
-structures and unions of all types.
-.op
-Operations intended to give machine-independent control
-of full machine facility, including to-memory
-operations and
-pointer arithmetic.
-.op
-Macro preprocessor for parameterized code and inclusion of
-standard files.
-.op
-All procedures recursive, with parameters by value.
-.op
-Machine-independent pointer manipulation.
-.op
-Object code uses full
-addressing capability of the PDP-11.
-.op
-Runtime library gives access to all system facilities.
-.OP
-Definable data types.
-.OP
-Block structure
-.sh  LINT
-Verifier for C programs.
-Reports questionable or nonportable usage such as:
-.nf
-.in +2
-Mismatched data declarations and procedure interfaces.
-.br
-Nonportable type conversions.
-.br
-Unused variables, unreachable code, no-effect operations.
-.br
-Mistyped pointers.
-.br
-Obsolete syntax.
-.in -2
-.OP
-Full cross-module checking of separately compiled programs.
-.sh CB
-A beautifier for C programs.
-Does proper indentation and placement of braces.
-.NH 2
-Fortran
-.LP
-.sh  F77
-A full compiler for 
-ANSI Standard Fortran 77.
-.OP
-Compatible with C and supporting tools at object level.
-.OP
-Optional source compatibility with Fortran 66.
-.OP
-Free format source.
-.op
-Optional subscript-range checking, detection of uninitialized variables.
-.OP
-All widths of arithmetic:
-2- and 4-byte integer; 4- and 8-byte real; 8- and 16-byte
-complex.
-.sh RATFOR
-Ratfor adds rational
-control structure \o'a\(ga' la C to Fortran.
-.op
-Compound statements.
-.op
-If-else, do, for, while,
-repeat-until, break, next
-statements.
-.op
-Symbolic constants.
-.op
-File insertion.
-.op
-Free format source
-.op
-Translation of relationals like >, >=.
-.op
-Produces genuine Fortran to carry away.
-.op
-May be used with F77.
-.sh STRUCT
-Converts ordinary ugly Fortran into structured Fortran (i.e., Ratfor),
-using statement grouping, if-else, while, for, repeat-until.
-.NH 2
-Other Algorithmic Languages
-.LP
-.sh BAS
-An interactive interpreter, similar in style to BASIC.
-Interpret unnumbered statements immediately,
-numbered statements upon `run'.
-.op
-Statements include:
-.in+2
-.nf
-comment,
-dump,
-for...next,
-goto,
-if...else...fi,
-list,
-print,
-prompt,
-return,
-run,
-save.
-.fi
-.in 0
-.op
-All calculations double precision.
-.op
-Recursive function defining and calling.
-.op
-Builtin functions include log, exp, sin, cos, atn, int,
-sqr, abs, rnd.
-.op
-Escape to ED for complex program editing.
-.sh DC
-Interactive programmable desk calculator.
-Has named storage locations as well
-as conventional stack for holding integers or programs.
-.op
-Unlimited precision decimal arithmetic.
-.op
-Appropriate treatment of decimal fractions.
-.op
-Arbitrary input and output radices, in particular
-binary, octal, decimal and hexadecimal.
-.op
-Reverse Polish operators:
-.in+2
-.nf
-+ \- * /
-remainder, power, square root,
-load, store, duplicate, clear,
-print, enter program text, execute.
-.in-2
-.fi
-.sh BC
-A C-like interactive interface to the desk calculator DC.
-.op
-All the capabilities of DC with a high-level syntax.
-.op
-Arrays and recursive functions.
-.op
-Immediate evaluation of expressions and evaluation of
-functions upon call.
-.op
-Arbitrary precision elementary functions:
-exp, sin, cos, atan.
-.op
-Go-to-less programming.
-.NH 2
-Macroprocessing
-.LP
-.nr c 0 1
-.sh  M4
-A general purpose macroprocessor.
-.OP
-Stream-oriented, recognizes macros anywhere in text.
-.OP
-Syntax fits with functional syntax of most higher-level
-languages.
-.OP
-Can evaluate integer arithmetic expressions.
-.NH 2
-Compiler-compilers
-.LP
-.sh YACC
-An LR(1)-based compiler writing system.
-During execution of resulting
-parsers, arbitrary C functions may be
-called to do code generation or semantic actions.
-.op
-BNF syntax specifications.
-.op
-Precedence relations.
-.op
-Accepts formally ambiguous grammars
-with non-BNF resolution rules.
-.sh  LEX
-Generator of lexical analyzers.
-Arbitrary C functions may be called
-upon isolation of each lexical token.
-.OP
-Full regular expression,
-plus left and right context dependence.
-.OP
-Resulting lexical analysers interface cleanly
-with YACC parsers.
diff --git a/.ref-Research-V7/usr/doc/summary/hel3 b/.ref-Research-V7/usr/doc/summary/hel3
deleted file mode 100644 (file)
index a8db663..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-.NH
-Text Processing
-.NH 2
-Document Preparation
-.LP
-.sh ED
-Interactive context editor.
-Random access to all lines of a file.
-.op
-Find lines by number or pattern.
-Patterns may include:
-specified characters,
-don't care characters,
-choices among characters,
-repetitions of these constructs,
-beginning of line,
-end of line.
-.op
-Add, delete, change, copy, move or join lines.
-.op
-Permute or split contents of a line.
-.op
-Replace one or all instances of a pattern within a line.
-.op
-Combine or split files.
-.op
-Escape to Shell (command language) during editing.
-.ne3
-.op
-Do any of above operations on
-every pattern-selected line in a given range.
-.OP
-Optional encryption for extra security.
-.sh PTX
-Make a permuted (key word in context) index.
-.sh SPELL
-Look for spelling errors by comparing each word in a
-document against a word list.
-.OP
-25,000-word list includes proper names.
-.OP
-Handles common prefixes and suffixes.
-.OP
-Collects words to help tailor local spelling lists.
-.sh LOOK
-Search for words in dictionary that begin with specified prefix.
-.sh TYPO
-Look for spelling errors by a statistical technique;
-not limited to English.
-.sh CRYPT
-Encrypt and decrypt files for security.
-.NH 2
-Document Formatting
-.LP
-.sh ROFF
-A typesetting program for terminals.
-Easy for nontechnical people to learn, and good
-for simple documents.
-Input consists of data lines intermixed with control lines,
-such as
-.ta  8n
-.ti 10
-.li
-.sp 2  insert two lines of space
-.ti10
-.li
-.ce    center the next line
-.br
-ROFF is deemed to be obsolete;
-it is intended only for casual use.
-.op
-Justification of either or both margins.
-.op
-Automatic hyphenation.
-.op
-Generalized running heads and feet, with even-odd page
-capability, numbering, etc.
-.op
-Definable macros for frequently used
-control sequences (no substitutable arguments).
-.op
-All 4 margins and page size dynamically adjustable.
-.op
-Hanging indents and one-line indents.
-.op
-Absolute and relative parameter settings.
-.op
-Optional legal-style numbering of output lines.
-.op
-Multiple file capability.
-.OP
-Not usable as a filter.
-.sh TROFF
-.sh NROFF
-Advanced typesetting.
-TROFF drives a Graphic Systems phototypesetter;
-NROFF drives ascii terminals of all types.
-This summary was typeset using TROFF.
-TROFF and NROFF style is similar to ROFF, but they are capable of much more elaborate
-feats of formatting,
-when appropriately programmed.
-TROFF and NROFF accept the same input language.
-.op
-All ROFF capabilities available or definable.
-.op
-Completely definable page format keyed to dynamically planted
-``interrupts'' at specified lines.
-.op
-Maintains several separately definable typesetting environments (e.g., one for
-body text, one for footnotes, and one for unusually elaborate
-headings).
-.op
-Arbitrary number of output pools can be combined at will.
-.op
-Macros with substitutable arguments, and macros invocable
-in mid-line.
-.op
-Computation and printing of numerical quantities.
-.op
-Conditional execution of macros.
-.op
-Tabular layout facility.
-.op
-Positions expressible in inches, centimeters, ems, points,
-machine units
-or arithmetic combinations thereof.
-.op
-Access to character-width computation for unusually difficult
-layout problems.
-.op
-Overstrikes, built-up brackets, horizontal and vertical line drawing.
-.op
-Dynamic relative or absolute positioning and size selection,
-globally or at the character level.
-.op
-Can exploit the characteristics of the terminal being used,
-for approximating special characters, reverse motions,
-proportional spacing, etc.
-.LP
-The Graphic Systems typesetter has a
-vocabulary of several 102-character fonts (4 simultaneously)
-in 15 sizes.
-TROFF provides
-terminal output for rough sampling of the product.
-.LP
-NROFF will produce multicolumn output on terminals capable of reverse line feed,
-or through the postprocessor COL.
-.LP
-High programming skill is required to exploit the formatting
-capabilities of TROFF and NROFF, although unskilled personnel can easily be trained
-to enter documents according to canned formats
-such as those provided by MS, below.
-TROFF and EQN are essentially identical to NROFF and NEQN
-so it is usually possible to define interchangeable 
-formats to produce
-approximate proof copy on terminals
-before actual typesetting.
-The preprocessors MS, TBL, and REFER are fully compatible
-with TROFF and NROFF.
-.sh MS
-A standardized manuscript layout package
-for use with NROFF/TROFF.
-This document was formatted with MS.
-.op
-Page numbers and draft dates.
-.op
-Automatically numbered subheads.
-.op
-Footnotes.
-.op
-Single or double column.
-.op
-Paragraphing, display and indentation.
-.op
-Numbered equations.
-.sh EQN
-A mathematical typesetting preprocessor for TROFF.
-Translates easily readable formulas, either in-line or displayed, into 
-detailed typesetting instructions.
-Formulas are written in a style like this:
-.DS
-sigma sup 2 ~=~ 1 over N sum from i=1 to N ( x sub i \- x bar ) sup 2
-.DE
-which produces:
-.EQ
-sigma sup 2 ~=~ 1 over N sum from i=1 to N ( x sub i - x bar ) sup 2
-.EN
-.op
-Automatic calculation of size changes for subscripts, sub-subscripts,
-etc.
-.op
-Full vocabulary of Greek letters and special symbols, such as `gamma', `GAMMA', `integral'.
-.op
-Automatic calculation of large bracket sizes.
-.op
-Vertical ``piling'' of formulae for matrices, conditional
-alternatives, etc.
-.op
-Integrals, sums, etc., with arbitrarily complex limits.
-.op
-Diacriticals: dots, double dots, hats, bars, etc.
-.op
-Easily learned by nonprogrammers and mathematical typists.
-.sh NEQN
-A version of EQN for NROFF;
-accepts the same input language.
-Prepares formulas for display on
-any terminal that NROFF knows about,
-for example, those based on Diablo printing mechanism.
-.op
-Same facilities as EQN within graphical capability of
-terminal.
-.sh TBL
-A preprocessor for NROFF/TROFF
-that translates simple descriptions of table layouts
-and contents into detailed typesetting instructions.
-.op
-Computes column widths.
-.op
-Handles left- and right-justified columns,
-centered columns and decimal-point
-alignment.
-.op
-Places column titles.
-.op
-Table entries can be text,
-which is adjusted to fit.
-.op
-Can box all or parts of table.
-.sh REFER
-Fills in bibliographic citations in a document
-from a data base (not supplied).
-.op
-References may be printed in any style,
-as they occur or collected at the end.
-.op
-May be numbered sequentially, by name of author, etc.
-.sh TC
-Simulate Graphic Systems typesetter on Tektronix 4014 scope.
-Useful for checking TROFF page layout before typesetting.
-.sh GREEK
-Fancy printing on Diablo-mechanism terminals
-like DASI-300 and DASI-450,
-and on Tektronix 4014.
-.op
-Gives half-line forward and reverse motions.
-.op
-Approximates Greek letters and other special characters
-by overstriking.
-.sh COL
-Canonicalize files with reverse line feeds
-for one-pass printing.
-.sh DEROFF
-Remove all TROFF commands from input.
-.sh CHECKEQ
-Check document for possible errors in EQN usage.
diff --git a/.ref-Research-V7/usr/doc/summary/hel4 b/.ref-Research-V7/usr/doc/summary/hel4
deleted file mode 100644 (file)
index e25dca7..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-.NH
-Information Handling
-.LP
-.sh SORT
-Sort or merge ASCII files line-by-line.
-No limit on input size.
-.op
-Sort up or down.
-.op
-Sort lexicographically or on numeric key.
-.op
-Multiple keys located by delimiters or by character position.
-.op
-May sort upper case together with lower into dictionary order.
-.OP
-Optionally suppress duplicate data.
-.sh TSORT
-Topological sort \(em converts a partial order into a total order.
-.sh UNIQ
-Collapse successive duplicate lines
-in a file into one line.
-.op
-Publish lines that were originally unique,
-duplicated, or both.
-.op
-May give redundancy count for each line.
-.sh TR
-Do one-to-one character translation according to
-an arbitrary code.
-.op
-May coalesce selected repeated characters.
-.op
-May delete selected characters.
-.sh DIFF
-Report line changes, additions and deletions necessary to bring two files
-into agreement.
-.op
-May produce an editor script to convert one file into another.
-.op
-A variant compares two new versions against one old one.
-.sh COMM
-Identify common lines in two sorted files.
-Output in up to 3 columns shows lines present in first file only,
-present in both, and/or present in second only.
-.sh JOIN
-Combine two files by joining records that have identical keys.
-.sh GREP
-Print all lines in a file that satisfy
-a pattern as used in the editor ED.
-.op
-May print all lines that fail to match.
-.op
-May print count of hits.
-.op
-May print first hit in each file.
-.sh LOOK
-Binary search in sorted file for lines
-with specified prefix.
-.sh WC
-Count the lines, ``words'' (blank-separated strings) and characters in a file.
-.sh SED
-Stream-oriented version of ED.
-Can perform a sequence of editing operations on
-each line of an
-input stream of unbounded length.
-.op
-Lines may be selected by address or range of addresses.
-.op
-Control flow and conditional testing.
-.op
-Multiple output streams.
-.op
-Multi-line capability.
-.sh AWK
-Pattern scanning and processing language.
-Searches input for patterns, and
-performs actions on each line of input that satisfies
-the pattern.
-.op
-Patterns include regular expressions,
-arithmetic and lexicographic conditions,
-boolean combinations and ranges of these.
-.op
-Data treated as string or numeric as appropriate.
-.op
-Can break input into fields;
-fields are variables.
-.op
-Variables and arrays (with non-numeric subscripts).
-.op
-Full set of arithmetic operators and control flow.
-.op
-Multiple output streams to files and pipes.
-.op
-Output can be formatted as desired.
-.op
-Multi-line capabilities.
diff --git a/.ref-Research-V7/usr/doc/summary/hel5 b/.ref-Research-V7/usr/doc/summary/hel5
deleted file mode 100644 (file)
index 1a014c0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.NH
-Graphics
-.LP
-The programs in this section are predominantly intended for use
-with Tektronix 4014 storage scopes.
-.sh GRAPH
-Prepares a graph of a set of input numbers.
-.op
-Input scaled to fit standard plotting area.
-.op
-Abscissae may be supplied automatically.
-.op
-Graph may be labeled.
-.op
-Control over grid style, line style, graph orientation, etc.
-.sh SPLINE
-Provides a smooth curve through a set of points
-intended for GRAPH.
-.sh PLOT
-A set of filters for printing graphs produced by GRAPH
-and other programs
-on various terminals.
-Filters provided for
-4014, DASI terminals, Versatec printer/plotter.
diff --git a/.ref-Research-V7/usr/doc/summary/hel6 b/.ref-Research-V7/usr/doc/summary/hel6
deleted file mode 100644 (file)
index 2470352..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-.NH
-Novelties, Games, and Things That Didn't Fit Anywhere Else
-.LP
-.sh BACKGAMMON
-.br
-A player of modest accomplishment.
-.sh CHESS
-Plays good class D chess.
-.sh CHECKERS
-Ditto, for checkers.
-.sh BCD
-Converts ascii to card-image form.
-.sh PPT
-Converts ascii to paper tape form.
-.sh BJ
-A blackjack dealer.
-.sh CUBIC
-An accomplished player of 4\(mu4\(mu4 tic-tac-toe.
-.sh MAZE
-Constructs random mazes for you to solve.
-.sh MOO
-A fascinating number-guessing game.
-.sh CAL
-Print a calendar of specified month and year.
-.sh BANNER
-Print output in huge letters.
-.sh CHING
-The
-.ul
-I Ching.
-Place your own interpretation on the output.
-.sh FORTUNE
-Presents a random fortune cookie on each invocation.
-Limited jar of cookies included.
-.sh UNITS
-Convert amounts between different scales of measurement.
-Knows hundreds of units.
-For example, how many km/sec is a parsec/megayear?
-.sh TTT
-A tic-tac-toe program that learns.
-It never makes the same mistake twice.
-.sh ARITHMETIC
-.br
-Speed and accuracy test for number facts.
-.sh FACTOR
-Factor large integers.
-.sh QUIZ
-Test your knowledge of Shakespeare, Presidents, capitals, etc.
-.sh WUMP
-Hunt the wumpus, thrilling search in a dangerous cave.
-.sh REVERSI
-A two person board game,
-isomorphic to
-Othello\(rg.
-.sh HANGMAN
-Word-guessing game.
-Uses the dictionary supplied with SPELL.
-.sh FISH
-Children's card-guessing game.
diff --git a/.ref-Research-V7/usr/doc/tbl b/.ref-Research-V7/usr/doc/tbl
deleted file mode 100644 (file)
index 3dce488..0000000
+++ /dev/null
@@ -1,1902 +0,0 @@
-.if \nM=0 .RP
-.TM 76-1274-5 39199 39199-11
-.if \n(tm>0 .ND June 11, 1976*
-.TL
-Tbl \(em A Program to Format Tables
-.AU "MH 2C-569" 6377
-M. E. Lesk
-.AI
-.MH
-.if \n(tm>0 .FS
-.if \n(tm>0 * This printing revised through August 5, 1977
-.if \n(tm>0 .FE
-.AB
-.I
-Tbl
-.R
-is a document formatting preprocessor for
-.I
-troff
-.R
-or
-.I
-nroff
-.R
-which makes
-even
-fairly complex tables easy to specify and enter.
-It is available on
-the
-.SM
-PDP-11 UNIX*
-.NL
-system
-.FS
-* UNIX is a Trademark/Service Mark of the Bell System
-.FE
-and on Honeywell 6000
-.SM
-GCOS.
-.NL
-Tables are made up of columns which may be independently centered, right-adjusted,
-left-adjusted, or aligned by decimal points.
-Headings may be placed over single columns or groups of columns.
-A table entry may contain equations, or may consist of several rows of text.
-Horizontal or vertical lines may be drawn as desired
-in the table,
-and any table or element may be enclosed in a box.
-For example:
-.in 0
-.ll
-.sp .5
-.TS
-center, box;
-c  s  s  s
-c  s  s  s
-c |c |c |c
-c |c |c |c
-l |n |n |n.
-1970 Federal Budget Transfers
-\s-2(in billions of dollars)\s0
-=
-State  Taxes   Money   Net
-\^     collected       spent   \^
-_
-New York       22.91   21.35   \-1.56
-New Jersey     8.33    6.96    \-1.37
-Connecticut    4.12    3.10    \-1.02
-Maine  0.74    0.67    \-0.07
-California     22.29   22.42   +0.13
-New Mexico     0.70    1.49    +0.79
-Georgia        3.30    4.28    +0.98
-Mississippi    1.15    2.32    +1.17
-Texas  9.33    11.13   +1.80
-.TE
-.AE
-.OK
-Phototypesetting
-Documentation
-.CS  16 0 16 0 12 6
-.tr # 
-.de e1
-.nr \\$1 \\$2
-..
-.de e2
-.if !\\n(\\$1=\\n% .tm Error in example \\$1: referred to page \\n(\\$1, is on page \\n%
-.rr \\$1
-..
-.di qq
-.EQ
-delim $$
-.EN
-.di
-.rm qq
-.SH
-Introduction.
-.PP
-.I
-Tbl
-.R
-turns a simple description
-of a table into a
-.I
-troff
-.R
-or
-.I
-nroff
-.R
-[1]
-program (list of commands) that prints the table.
-.I
-Tbl
-.R
-may be used on the
-\s-2PDP-\s011 \s-2UNIX\s0
-.NL
-[2] system and on the Honeywell 6000
-.SM
-GCOS
-.NL
-system.
-It
-attempts to isolate a portion of a job that it can
-successfully
-handle and leave the remainder for other programs.
-Thus
-.I
-tbl
-.R
-may be used with the equation formatting
-program
-.I
-eqn
-.R
-[3]
-or various
-layout macro packages
-[4,5,6],
-but does not duplicate their functions.
-.PP
-This memorandum is divided into two parts.
-First we give the rules for preparing
-.I
-tbl
-.R
-input; then some examples are shown.
-The description of rules is precise but technical, and
-the beginning user may prefer to read the examples first,
-as they show some common table arrangements.
-A section explaining how to invoke
-.I
-tbl
-.R
-precedes the examples.
-To avoid repetition, henceforth read
-.I
-troff
-.R
-as
-.I
-``troff
-.R
-or
-.I
-nroff.''
-.R
-.ds . \^\s14.\s0
-.PP
-The input to
-.I
-tbl
-.R
-is text for a document, with tables preceded by a ``\*.TS''
-(table start)
-command and followed by a ``\*.TE''
-(table end) command.
-.I
-Tbl
-.R
-processes the tables, generating
-.I
-troff
-.R
-formatting commands,
-and leaves the remainder of the text unchanged.
-The ``\*.TS'' and ``\*.TE''
-lines are copied, too, so that
-.I
-troff
-.R
-page layout macros
-(such as the memo formatting macros [4]\|) can use these lines
-to delimit and place tables as they see fit.
-In particular, any arguments on the ``\*.TS'' or ``\*.TE''
-lines
-are copied but otherwise ignored, and may be used by document layout
-macro commands.
-.PP
-The format of the input is as follows:
-.DS
-\&text
-\&\*.TS
-\&\fItable\fR
-\&\*.TE
-\&text
-\&\*.TS
-\&\fItable\fR
-\&\*.TE
-\&text
-\&\&\*. \*. \*.
-.DE
-where the format of each table is as follows:
-.DS
-\&\*.TS
-\fIoptions \fB;\fR
-\fIformat \*.
-data
-\&\fR\*.TE
-.DE
-Each table is independent, and must contain formatting
-information
-followed by the data to be entered in the table.
-The formatting information, which describes the
-individual columns and rows of the table, may be preceded
-by a few options that affect the entire table.
-A detailed description of tables is given in the next section.
-.sp .5
-.SH
-Input commands.
-.PP
-As indicated above, a table contains, first, global options,
-then a format section describing the layout of the table
-entries, and then the data to be printed.  The format and data
-are always required, but not the options.
-The various parts of the table are entered as follows:
-.sp .5v
-.IP 1)
-O\s-2PTIONS.\s0
-There may be a single line of options
-affecting the whole table.
-If present, this line must follow the \*.TS line immediately
-and must contain a list of option names
-separated by spaces, tabs, or commas, and must be terminated by a semicolon.
-The allowable options are:
-.RS
-.IP \fB##center\fR 13
-\(em center the table (default is left-adjust);
-.IP \fB##expand\fR
-\(em make the table as wide as the current line length;
-.IP \fB##box\fR
-\(em enclose the table in a box;
-.IP \fB##allbox\fR
-\(em enclose each item in the table in a box;
-.IP \fB##doublebox\fR
-\(em enclose the table in two boxes;
-.IP \fB##tab#\fR(\fIx\fR\^)
-\(em use \fIx\fR instead of tab to separate data items.
-.IP \fB##linesize#(\fIn\fR\^)
-\(em set lines or rules (e.g. from \fBbox\fR\^) in \fIn\fR point type;
-.IP \fB##delim#(\fIxy\fR\^)
-\(em recognize \fIx\fR and \fIy\fR as the \fIeqn\fR delimiters.
-.RE
-.LP
-.ns
-.IP
-The
-.I
-tbl
-.R
-program
-tries to keep boxed tables on one page by issuing
-appropriate ``need'' (\fI\*.ne\fR\|) commands.
-These requests are calculated from the number of lines in the tables,
-and if there are spacing commands embedded in the input, these requests may be inaccurate;
-use normal
-.I
-troff
-.R
-procedures, such as keep-release macros, in that case.
-The user who must have a multi-page boxed table
-should use macros designed for this purpose,
-as explained below under `Usage.'
-.sp .5v
-.IP 2) 5
-F\s-2ORMAT\s0.
-The format section of the table specifies the layout
-of the columns.
-Each line in this section corresponds to one line
-of the table (except that the last line corresponds to all following
-lines up to the next \*.T&, if any \(em see below),
-and each line contains a key-letter for each column
-of the table.
-It is good practice to separate the key letters for each
-column by spaces or tabs.
-Each key-letter is one of the following:
-.RS
-.cs B 25
-.IP "##\fBL\fR#or#\fBl\fR" 10
-to indicate a left-adjusted column entry;
-.IP "##\fBR\fR#or#\fBr\fR
-to indicate a right-adjusted column entry;
-.IP "##\fBC\fR#or#\fBc\fR
-to indicate a centered column entry;
-.IP "##\fBN\fR#or#\fBn\fR
-to indicate a numerical column entry, to be aligned with other
-numerical entries so that the units digits of numbers line up;
-.IP "##\fBA\fR#or#\fBa\fR
-to indicate an alphabetic subcolumn;
-all corresponding entries are aligned on the left, and positioned
-so that the widest is centered within the column (see
-example on page 12);
-.IP "##\fBS\fR#or#\fBs\fR
-to indicate a spanned heading, i.e. to indicate that the
-entry from the previous column continues across this
-column
-(not allowed for the first column, obviously); or
-.IP ##\fB\s+4\v'6p'^\v'-6p'\s0\fR
-to indicate a vertically spanned heading, i.e. to indicate that
-the entry from the previous row continues down through this row.
-(Not allowed for the first row of the table, obviously).
-.cs B
-.RE
-.LP
-.ns
-.IP
-When numerical alignment is specified, a location for the decimal
-point is sought.  The rightmost dot (\*.)
-adjacent to a digit is used as a decimal point; if there is no
-dot adjoining a digit, the rightmost digit is used as a units digit;
-if no alignment is indicated, the item is centered in the column.
-However, the special non-printing character string \e& may be used
-to override unconditionally dots
-and digits, or to align alphabetic data;
-this string lines up where a dot normally would,
-and then disappears from the final output.
-In the example below, the items shown at the left will be
-aligned (in a numerical column) as shown on the right:
-.KS
-.TS
-center;
-l6 n.
-13     13
-4\*.2  4\&\*.2
-26\*.4\*.12    26\*.4\&\*.12
-abc    abc
-abc\e& abc\&
-43\e&3\*.22    43\&3\*.22
-749\*.12       749\&\*.12
-.TE
-.KE
-.IP
-\fBNote:\fR
-If numerical data are used in the same column with wider
-.B L
-or
-.B r
-type table entries, the widest \fInumber\fR is centered relative
-to the wider
-.B L
-or
-.B r
-items (\fBL\fR is used instead of \fBl\fR for readability;
-they have the same meaning as key-letters).
-Alignment within the numerical items is preserved.
-This is similar to the behavior of
-.B a
-type data, as explained above.
-However,
-alphabetic subcolumns (requested by the
-.B
-a
-.R
-key-letter)
-are always slightly indented relative to
-.B
-L
-.R
-items;
-if necessary, the column width is increased to force this.
-This is not true for \fBn\fR type entries.
-.IP
-.bd I 3
-.ft I
-Warning:
-.ft 1
-.bd I
-the \fBn\fR and \fBa\fR items should not be used in
-the same column.
-.IP
-For readability, the key-letters describing each column should
-be separated by spaces.
-The end of the format section is indicated by a period.
-The layout of the key-letters in the format section resembles
-the layout of the actual data in the table.
-Thus a simple format might appear as:
-.br
-.ne 3
-.in +2
-.nf
-c  s  s
-l  n  n \*.
-.fi
-.in -2
-which specifies a table of three columns. The first line
-of the table contains a heading centered across all three
-columns; each remaining line contains a left-adjusted item
-in the first column followed by two columns of numerical
-data.
-A sample table in this format might be:
-.br
-.ne 6v
-.br
-.in +4
-.TS
-c s s
-l n n.
-Overall title
-Item-a 34.22   9.1
-Item-b 12.65   .02
-Items: c,d,e   23      5.8
-Total  69.87   14.92
-.TE
-.in -4
-There are some additional features of the key-letter system:
-.RS
-.IP "\fI##Horizontal lines#\fR"
-\(em A key-letter may be replaced by `\(ul'
-(underscore) to indicate
-a horizontal line in place of the corresponding column entry,
-or by `=' to indicate a double horizontal line.
-If an adjacent column contains a horizontal line, or if
-there are vertical lines adjoining this column,
-this horizontal line is extended to meet the nearby lines.
-If any data entry is provided for this column, it is ignored and
-a warning message is printed.
-.QQ do the D(x) and M(x) to draw a line of 'x' characters.
-.QQ D will draw divided lines, M merged lines. thus - is simplh M(\(ru)
-.IP "\fI##Vertical lines#\fR"
-\(em A vertical bar may be placed between column key-letters.  This will
-cause a vertical line between the corresponding columns of the table.
-A vertical bar to the left of the first key-letter
-or to the right of the last one produces a line at the
-edge of the table.
-If two vertical bars appear between key-letters, a double vertical
-line is drawn.
-.IP "\fI##Space between columns#\fR"
-\(em A number may follow the key-letter.  This indicates the amount of separation
-between this column and the next column.
-The number normally specifies the separation in
-.I
-ens
-.R
-(one
-en
-.ne 3
-is about the width of the letter `n').* 
-.FS
-* More precisely, an en is a number of points (1 point = 1/72 inch)
-equal to half the current type size.
-.FE
-If the ``expand'' option is used, then these numbers are multiplied
-by a constant such that the table is as wide as the current line length.
-The default column separation number is 3.
-If the separation is changed the worst case (largest space requested) governs.
-.IP "\fI##Vertical spanning#\fR"
-\(em Normally, vertically spanned items extending over several
-rows of the table are centered in their vertical range.
-If a key-letter is followed by
-.B
-t
-.R
-or
-.B T ,
-any corresponding vertically spanned item
-will begin at the top line of its range.
-.IP "\fI##Font changes#\fR"
-\(em A key-letter may be followed by a string containing a font
-name or number
-preceded by the letter
-.B f
-or
-.B F .
-This indicates that the corresponding column should be in a different
-font from the default font (usually Roman).
-All font names are one or two letters; a one-letter font
-name should be separated from whatever follows by a space or tab.
-The single letters
-\f3B\f1, \f3b\f1, \f3I\f1,
-and
-\f3i\f1
-are shorter synonyms for
-.B f\^B
-and
-.B f\^I .
-Font change commands given with the table entries
-override these specifications.
-.IP "\fI##Point size changes#\fR"
-\(em A key-letter may be followed by the letter
-.B p
-or
-.B P
-and a number to indicate the point size of the corresponding table entries.
-The number may be a signed digit, in which case it is taken as
-an increment or decrement
-from the current point size.
-If both a point size and a column separation value are given,
-one or more blanks must separate them.
-.IP "\fI##Vertical spacing changes#\fR"
-\(em A key-letter may be followed by the letter
-.B v
-or
-.B V
-and a number to indicate the vertical line spacing to be used
-within a multi-line corresponding table entry.
-The number may be a signed digit, in which case it is taken as an increment
-or decrement from the current vertical spacing.
-A column separation value must be separated by blanks or some other
-specification from a vertical spacing request.
-This request has no effect unless the corresponding table entry
-is a text block (see below).
-.IP "\fI##Column width indication#\fR"
-\(em A key-letter may be followed by the letter
-.B w
-or
-.B W
-and a width value in parentheses.
-This width is used as a minimum column width.
-If the largest element in the column is not as wide as the width value
-given after the \fBw\fR, the largest element is assumed to be that wide.
-If the largest element in the column is wider than the specified value,
-its width is used.
-The width is also used as a default line
-length for included text blocks.
-Normal
-.I
-troff
-.R
-units can be used to scale the width value; if none are used,
-the default is
-ens.
-If the width specification is a unitless integer
-the parentheses may be omitted.
-If the width value is changed in a column, the \fIlast\fR one given controls.
-.IP "\fI##Equal width columns#\fR"
-\(em A key-letter may be followed by the letter
-.B e
-or
-.B E
-to indicate equal width columns.
-All columns whose
-key-letters are followed by \fBe\fR or \fBE\fR are made the same width.
-This permits the user to get a group of regularly spaced
-columns.
-.IP "##\fBNote:\fR#"
-The order of the above features is immaterial; they need not be separated
-by spaces, except as indicated above to avoid ambiguities involving
-point size and font changes.  Thus
-a numerical column entry in italic font and 12 point type with a minimum
-width of 2.5 inches and separated by 6 ens from the next column could
-be specified as
-.in +5
-np12w(2\*.5i)f\|I  6
-.in -5
-.IP "\fI##Alternative notation#\fR"
-\(em Instead of listing the format of successive lines of a table
-on consecutive lines of the format section,
-successive line formats may be given on the same line, separated
-by commas, so that the format for the example
-above might have been written:
-.in +5
-c s s, l n n \*.
-.in -5
-.IP "\fI##Default#\fR"
-\(em Column descriptors missing from the end
-of a format line are assumed to be \fBL\fR.
-The longest line in the format section, however,
-defines the number of columns
-in the table;
-extra columns in the data are ignored silently.
-.QQ put in the diagnostics.
-.RE
-.sp .5v
-.IP 3)
-D\s-2ATA\s0.
-The data for the table are typed after the format.
-Normally, each table line is typed as one line of data.
-Very long input lines can be broken: any line whose last character is
-\e is combined with the following line (and the \e vanishes).
-The data for different columns (the table entries) are separated by tabs,
-or by whatever character has been specified in the option
-.I tabs
-option.
-There are a few special cases:
-.RS
-.IP "\fI##Troff commands within tables\fR#"
-\(em An input line
-beginning with a `\*.' followed by anything
-but a number is assumed to be a command to
-.I
-troff
-.R
-and is passed through unchanged, retaining its position in the table.
-So, for example, space within a table may be produced by ``\*.sp''
-commands
-in the data.
-.IP "\fI##Full width horizontal lines\fR#"
-\(em An input
-.I line
-containing only the character $fat "\(ul" $ (underscore)
-or \fB=\fR (equal sign) is taken to be a single or double
-line, respectively, extending the
-full width
-of the
-.I table.
-.IP "\fI##Single column horizontal lines\fR#"
-\(em An input table
-.I entry
-containing only the character $fat "\(ul" $ or \fB=\fR
-is taken to be a single or double line extending
-the full width of the
-.I column.
-Such lines are extended to meet horizontal or vertical
-lines adjoining this column.
-To obtain these characters explicitly in a column, either
-precede them by \e& or
-follow them by a space before the usual tab or newline.
-.IP "\fI##Short horizontal lines\fR#"
-\(em An input table
-.I entry
-containing only the string $fat "\e\(ul"$
-is taken to be a single line as wide as the contents of
-the column.  It is not extended to meet
-adjoining lines.
-.IP "\fI##Repeated characters\fR#"
-\(em An input table
-.I entry
-containing only a string of the form $fat "\e"$\f3R\f2x\f1
-where
-.I x
-is any character is replaced by repetitions of the character
-.I x
-as wide as the data in the column.
-The sequence of
-.I x 's
-is not extended to meet adjoining columns.
-.IP "\fI##Vertically spanned items\fR#"
-\(em An input table entry containing only the
-character string
-.ft B
-\e\s+2\v'2p'^\v'-2p'\s0
-.ft R
-indicates that the table entry immediately
-above spans downward over this row.  It is equivalent
-to a table format key-letter of `^'.
-.IP "\fI##Text blocks\fR#"
-\(em In order to include a block of text as a table entry,
-precede it by $fat roman "T{" $ and follow
-it by $fat roman "T}" $.
-Thus the sequence
-.in +2
-.nf
-  \*. \*. \*. $fat roman "T{"$
-.I
-  block of
-  text
-.R
-  $fat roman "T}"$ \*. \*. \*.
-.in -2
-.fi
-is the way to enter, as a single entry in the table, something
-that cannot conveniently be typed as a simple string between
-tabs.
-Note that the $fat roman "T}" $ end delimiter must begin a line;
-additional columns of data may follow after a tab on the same line.
-See the example on page 10 for an illustration of included text blocks
-.e1 aa 10
-in a table.
-If more than twenty or thirty text blocks are used in a table,
-various limits in the
-.I
-troff
-.R
-program are likely to be exceeded,
-producing diagnostics such as `too many string/macro names' or `too many
-number registers.'
-.IP
-Text blocks are pulled out from the table, processed separately by
-.I
-troff,
-.R
-and replaced in the table as a solid block.  If no line length
-is specified in the
-.I
-block of text
-.R
-itself, or in the table format,
-the default is to use
-$ L times C / (N+1) $
-where
-.I
-L
-.R
-is the current line length,
-.I
-C
-.R
-is the number of table columns spanned by the text,
-and
-.I
-N
-.R
-is the total number of columns in the table.
-The other parameters (point size, font, etc.) used in setting the
-.I
-block of text
-.R
-are those in effect at the beginning of the table (including
-the effect of the ``\*.TS'' macro)
-and any table format specifications of size, spacing and font,
-using the \fBp\fR, \fBv\fR and \fBf\fR modifiers to the column key-letters.
-Commands within the text block itself are also recognized, of course.
-However,
-.I troff
-commands within the table data but not within the text block
-do not affect that block.
-.br
-.di RR
-.     this is going down a rathole
-.EQ
-delim off
-.EN
-.di
-.rm RR
-.IP "##\fBWarnings:\fR#"
-\(em Although any number of lines may be present in a table,
-only the first 200 lines are used in calculating
-the widths of the various columns.  A multi-page table,
-of course, may be arranged as several single-page tables
-if this proves to be a problem.
-Other difficulties with formatting may arise because,
-in the calculation of column widths all table entries
-are assumed to be in the font and size being used when
-the ``\*.TS'' command was encountered, except for font and size changes
-indicated (a) in the table format section and (b)
-within the table data (as in the entry
-\es+3\efIdata\efP\es0\|).
-Therefore, although arbitrary
-.I
-troff
-.R
-requests may be sprinkled in a table, care must be taken
-to avoid confusing the width calculations;
-use requests such as `\*.ps' with care.
-.tr ##
-.sp .5v
-.RE
-.IP 4)
-A\s-2DDITIONAL COMMAND LINES\s0.
-If the format of a table must be changed after
-many similar lines, as with sub-headings or summarizations, the ``\*.T&''
-(table continue)
-command can be used
-to change column parameters.
-The outline of such a table input is:
-.DS
-.ft R
-\&\*.TS
-.ft I
-\&options \fB;\fP
-\&format \*.
-\&data
-\&\*. \*. \*.
-.ft R
-\&\*.T&
-.ft I
-\&format \*.
-\&data
-.ft R
-\&\*.T&
-.ft I
-\&format \*.
-\&data
-.ft R
-\&\*.TE
-.DE
-as in the examples on pages 10 and 12.
-.e1 ab 10
-.e1 ac 12
-Using this procedure, each table line can be close to its corresponding format line.
-.bd I 3
-.br
-.sp 3p
-.ft I
-Warning:
-.ft R
-.bd I
-it is not possible to change the number of columns, the space
-between columns, the global options such as \fIbox,\fR
-or the selection of columns to be made equal width.
-.SH
-Usage.
-.PP
-On
-\s-2UNIX\s0,
-.I
-tbl
-.R
-can be run on a simple table with the command
-.DS
-tbl input-file | troff
-.DE
-but
-for more complicated use, where there are several input files,
-and they contain equations and \fIms\fR memorandum layout commands as well
-as tables, the normal command would be
-.DS
-tbl file-1 file-2 \*. \*. \*. | eqn | troff \-ms
-.DE
-and, of course, the usual options may be used on the
-.I
-troff
-.R
-and
-.I
-eqn
-.R
-commands.  The usage for
-.I
-nroff
-.R
-is similar
-to that for
-.I
-troff,
-.R
-but only
-\s-2TELETYPE\s+2\(rg Model 37 and
-Diablo-mechanism (\s-2DASI\s0 or \s-2GSI\s0)
-terminals can print boxed tables directly.
-.PP
-For the convenience of users employing line printers without
-adequate driving tables or post-filters, there is a special
-.I \-TX
-command line option to
-.I tbl
-which produces output that does not have fractional line
-motions in it.
-The only other command line options recognized by
-.I tbl
-are
-.I \-ms
-and
-.I \-mm
-which are turned into
-commands to fetch the corresponding macro files;
-usually it is more convenient to place these arguments
-on the
-.I troff
-part of the command line,
-but they are accepted by
-.I tbl
-as well.
-.PP
-Note that when
-.I
-eqn
-.R
-and
-.I
-tbl
-.R
-are used together on the same file
-.I
-tbl
-.R
-should be used first.
-If there are no equations within tables,
-either order works, but it is usually faster
-to run
-.I
-tbl
-.R
-first, since
-.I
-eqn
-.R
-normally produces a larger expansion of the input
-than
-.I
-tbl.
-.R
-However, if there are equations within tables
-(using the
-.I
-delim
-.R
-mechanism in
-.I
-eqn\fR),
-.I
-tbl
-.R
-must be first or the output will be scrambled.
-Users must also beware of using equations in
-\fBn\fR-style columns; this is nearly always wrong,
-since
-.I
-tbl
-.R
-attempts to split numerical format items into two parts and this
-is not possible with equations.
-The user can defend against this by giving the
-.I delim(xx)
-table option;
-this prevents splitting of numerical columns within the delimiters.
-For example, if the
-.I eqn
-delimiters
-are
-.I $$ ,
-giving
-.I delim($$)
-a numerical column such as
-``1245 $+- 16$''
-will be divided after 1245, not after 16.
-.PP
-.I
-Tbl
-.R
-limits tables to twenty columns; however,
-use of more than 16 numerical columns may fail because of
-limits in
-.I
-troff,
-.R
-producing the `too many number registers' message.
-\fITroff\fR number registers used by
-.I
-tbl
-.R
-must be avoided by the user within tables;
-these include two-digit names from 31 to 99,
-and names of the forms
-#\fIx\fR, \fIx\fR+, \fIx\fR\ |, \v'3p'^\v'-3p'\fIx\fR, and \fIx\fR\(mi,
-where
-\fIx\fR is any lower case letter.
-The names
-##, #\(mi, and #^ are also used in certain circumstances.
-To conserve number register names, the
-\fBn\fR
-and
-\fBa\fR
-formats share a register;
-hence the restriction above that they may not be used in the same column.
-.PP
-For aid in writing layout macros,
-.I
-tbl
-.R
-defines a number register TW which is
-the table width; it is defined by the time that the ``\*.TE'' macro
-is invoked and may be used in the expansion of that macro.
-More importantly, to assist in laying out multi-page boxed tables
-the macro T# is defined to produce the bottom lines and side lines of a boxed
-table, and then invoked at its end.  By use of this macro
-in the page footer a multi-page table can be boxed.
-In particular, the
-.I
-ms
-.R
-macros can be used to print a multi-page boxed table with a repeated heading
-by giving the
-argument H to the ``\*.TS'' macro.
-If the table start macro is written
-.br
-       \&\*.TS H
-.br
-a line of the form
-.br
-       \&\*.TH
-.br
-must be given in the table after any table heading (or at the start if none).
-Material up to the ``\*.TH'' is placed at the top of each page of table;
-the remaining lines in the table are placed on several pages as required.
-Note that this is
-.I
-not
-.R
-a feature of
-.I
-tbl,
-.R
-but of the \fIms\fR layout macros.
-.SH
-Examples.
-.PP
-Here are some examples illustrating features of
-.I
-tbl.
-.R
-.ds T \|\h'.4n'\v'-.2n'\s6\zT\s0\s10\v'.2n'\h'-.4n'\(ci\|\s0
-The symbol \*T in the input represents a tab character.
-.de IN
-.po \\n(POu
-.sp |\\n(.hu
-.sp
-.ne \\$1
-.mk
-.B
-Input:
-.R
-.sp .5
-.nf
-.in +3n
-..
-.de OU
-.br
-.in -3n
-.rt
-.po +3i
-.B
-Output:
-.R
-.sp .5
-..
-.rm TS
-.rm TE
-.nf
-.IN 2.5i
-\&\*.TS
-\&box;
-\&c c c
-\&l l l\*.
-\&Language\*TAuthors\*TRuns on
-\&
-\&Fortran\*TMany\*TAlmost anything
-\&PL/1\*TIBM\*T360/370
-\&C\*TBTL\*T11/45,H6000,370
-\&BLISS\*TCarnegie-Mellon\*TPDP-10,11
-\&IDS\*THoneywell\*TH6000
-\&Pascal\*TStanford\*T370
-\&\*.TE
-.OU
-.TS
-box;
-c c c
-l l l.
-Language       Authors Runs on
-
-Fortran        Many    Almost anything
-PL/1   IBM     360/370
-C      BTL     11/45,H6000,370
-BLISS  Carnegie-Mellon PDP-10,11
-IDS    Honeywell       H6000
-Pascal Stanford        370
-.TE
-.IN 2.8i
-\&\*.TS
-\&allbox;
-\&c s s
-\&c c c
-\&n n n\*.
-\&AT&T Common Stock
-\&Year\*TPrice\*TDividend
-\&1971\*T41-54\*T$2\*.60
-\&2\*T41-54\*T2\*.70
-\&3\*T46-55\*T2\*.87
-\&4\*T40-53\*T3\*.24
-\&5\*T45-52\*T3\*.40
-\&6\*T51-59\*T\*.95*
-\&\*.TE
-\&* (first quarter only)
-.OU
-.TS
-allbox;
-c s s
-c c c
-n n n.
-AT&T Common Stock
-Year   Price   Dividend
-1971   41-54   $2.60
-2      41-54   2.70
-3      46-55   2.87
-4      40-53   3.24
-5      45-52   3.40
-6      51-59   .95*
-.TE
-* (first quarter only)
-.IN 4i
-\&\*.TS
-\&box;
-\&c s s
-\&c | c | c
-\&l | l | n\*.
-\&Major New York Bridges
-\&=
-\&Bridge\*TDesigner\*TLength
-\&\(ul
-\&Brooklyn\*TJ\*. A\*. Roebling\*T1595
-\&Manhattan\*TG\*. Lindenthal\*T1470
-\&Williamsburg\*TL\*. L\*. Buck\*T1600
-\&\(ul
-\&Queensborough\*TPalmer &\*T1182
-\&\*T  Hornbostel
-\&\(ul
-\&\*T\*T1380
-\&Triborough\*TO\*. H\*. Ammann\*T\(ul
-\&\*T\*T383
-\&\(ul
-\&Bronx Whitestone\*TO\*. H\*. Ammann\*T2300
-\&Throgs Neck\*TO\*. H\*. Ammann\*T1800
-\&\(ul
-\&George Washington\*TO\*. H\*. Ammann\*T3500
-\&\*.TE
-.OU
-.TS
-box;
-c s s
-c | c | c
-l | l | n.
-Major New York Bridges
-=
-Bridge Designer        Length
-_
-Brooklyn       J. A. Roebling  1595
-Manhattan      G. Lindenthal   1470
-Williamsburg   L. L. Buck      1600
-_
-Queensborough  Palmer &        1182
-         Hornbostel
-_
-               1380
-Triborough     O. H. Ammann    _
-               383
-_
-Bronx Whitestone       O. H. Ammann    2300
-Throgs Neck    O. H. Ammann    1800
-_
-George Washington      O. H. Ammann    3500
-.TE
-.IN 3.0i
-\&\*.TS
-\&c c
-\&np-2 | n | \*.
-\&\*TStack
-\&\*T\(ul
-\&1\*T46
-\&\*T\(ul
-\&2\*T23
-\&\*T\(ul
-\&3\*T15
-\&\*T\(ul
-\&4\*T6\*.5
-\&\*T\(ul
-\&5\*T2\*.1
-\&\*T\(ul
-\&\*.TE
-.OU
-.TS
-c c
-np-2 | n |.
-       Stack
-       _
-1      46
-       _
-2      23
-       _
-3      15
-       _
-4      6.5
-       _
-5      2.1
-       _
-.TE
-.IN 2.5i
-\&\*.TS
-\&box;
-\&L L L
-\&L L \(ul
-\&L L | LB
-\&L L \(ul
-\&L L L\*.
-\&january\*Tfebruary\*Tmarch
-\&april\*Tmay
-\&june\*Tjuly\*TMonths
-\&august\*Tseptember
-\&october\*Tnovember\*Tdecember
-\&\*.TE
-.OU
-.TS
-box;
-L L L
-L L _
-L L | LB
-L L _
-L L L.
-january        february        march
-april  may
-june   july    Months
-august september
-october        november        december
-.TE
-.IN 5.0i
-.e2 ab
-\&\*.TS
-\&box;
-\&cfB s s s\*.
-\&Composition of Foods
-\&\(ul
-\&\*.T&
-\&c  | c s s
-\&c  | c s s
-\&c   | c  | c  | c\*.
-\&Food\*TPercent by Weight
-\&\e^\*T\(ul
-\&\e^\*TProtein\*TFat\*TCarbo-
-\&\e^\*T\e^\*T\e^\*Thydrate
-\&\(ul
-\&\*.T&
-\&l  | n  | n  | n\*.
-\&Apples\*T\*.4\*T\*.5\*T13\*.0
-\&Halibut\*T18\*.4\*T5\*.2\*T\*. \*. \*.
-\&Lima beans\*T7\*.5\*T\*.8\*T22\*.0
-\&Milk\*T3\*.3\*T4\*.0\*T5\*.0
-\&Mushrooms\*T3\*.5\*T\*.4\*T6\*.0
-\&Rye bread\*T9\*.0\*T\*.6\*T52\*.7
-\&\*.TE
-.OU
-.TS
-box;
-cfB s s s.
-Composition of Foods
-_
-.T&
-c  |c s s
-c  |c s s
-c   |c  |c  |c.
-Food   Percent by Weight
-\^     _
-\^     Protein Fat     Carbo-
-\^     \^      \^      hydrate
-_
-.T&
-l  |n  |n  |n.
-Apples .4      .5      13.0
-Halibut        18.4    5.2     ...
-Lima beans     7.5     .8      22.0
-Milk   3.3     4.0     5.0
-Mushrooms      3.5     .4      6.0
-Rye bread      9.0     .6      52.7
-.TE
-.IN 3.7i
-.e2 aa
-\&\*.TS
-\&allbox;
-\&cfI  s   s
-\&c    cw(1i)   cw(1i)
-\&lp9 lp9 lp9\*.
-\&New York Area Rocks
-\&Era\*TFormation\*TAge (years)
-\&Precambrian\*TReading Prong\*T>1 billion
-\&Paleozoic\*TManhattan Prong\*T400 million
-\&Mesozoic\*TT{
-\&\*.na
-\&Newark Basin, incl\*.
-\&Stockton, Lockatong, and Brunswick
-\&formations; also Watchungs
-\&and Palisades\*.
-\&T}\*T200 million
-\&Cenozoic\*TCoastal Plain\*TT{
-\&On Long Island 30,000 years;
-\&Cretaceous sediments redeposited
-\&by recent glaciation\*.
-\&\*.ad
-\&T}
-\&\*.TE
-.OU
-.fi
-.TS
-allbox;
-cfI s   s
-c   cw(1i)   cw(1i)
-lp9 lp9 lp9.
-New York Area Rocks
-Era    Formation       Age (years)
-Precambrian    Reading Prong   >1 billion
-Paleozoic      Manhattan Prong 400 million
-Mesozoic       T{
-.na
-Newark Basin, incl.
-Stockton, Lockatong, and Brunswick
-formations; also Watchungs
-and Palisades.
-T}     200 million
-Cenozoic       Coastal Plain   T{
-On Long Island 30,000 years;
-Cretaceous sediments redeposited
-by recent glaciation.
-.ad
-T}
-.TE
-.IN 2i
-\&\*.EQ
-\&delim $$
-\&\*.EN
-.sp
-\&\*. \*. \*.
-.sp
-\&\*.TS
-\&doublebox;
-\&c c
-\&l l\*.
-\&Name\*TDefinition
-\&\*.sp
-\&\*.vs +2p
-\&Gamma\*T$GAMMA (z) = int sub 0 sup inf  t sup {z-1} e sup -t dt$
-\&Sine\*T$sin (x) = 1 over 2i ( e sup ix - e sup -ix )$
-\&Error\*T$ roman erf (z) = 2 over sqrt pi int sub 0 sup z e sup {-t sup 2} dt$
-\&Bessel\*T$ J sub 0 (z) = 1 over pi int sub 0 sup pi cos ( z sin theta ) d theta $
-\&Zeta\*T$ zeta (s) = sum from k=1 to inf k sup -s ~~( Re~s > 1)$
-\&\*.vs -2p
-\&\*.TE
-.di qq
-.EQ
-delim $$
-.EN
-.di
-.rm qq
-.rs
-.OU
-.TS
-doublebox;
-c c
-l l.
-Name   Definition
-.sp
-.vs +2p
-Gamma  $GAMMA (z) = int sub 0 sup inf  t sup {z-1} e sup -t dt$
-Sine   $sin (x) = 1 over 2i ( e sup ix - e sup -ix )$
-Error  $ roman erf (z) = 2 over sqrt pi int sub 0 sup z e sup {-t sup 2} dt$
-Bessel $ J sub 0 (z) = 1 over pi int sub 0 sup pi cos ( z sin theta ) d theta $
-Zeta   $ zeta (s) = sum from k=1 to inf k sup -s ~~( Re~s > 1)$
-.vs -2p
-.TE
-.ds : \|:\|
-.IN 2i
-\&\*.TS
-\&box, tab(\*:);
-\&cb s s s s
-\&cp-2 s s s s
-\&c |\|| c | c | c | c
-\&c |\|| c | c | c | c
-\&r2 |\|| n2 | n2 | n2 | n\*.
-\&Readability of Text
-\&Line Width and Leading for 10-Point Type
-\&=
-\&Line\*:Set\*:1-Point\*:2-Point\*:4-Point
-\&Width\*:Solid\*:Leading\*:Leading\*:Leading
-\&_
-\&9 Pica\*:\e-9\*.3\*:\e-6\*.0\*:\e-5\*.3\*:\e-7\*.1
-\&14 Pica\*:\e-4\*.5\*:\e-0\*.6\*:\e-0\*.3\*:\e-1\*.7
-\&19 Pica\*:\e-5\*.0\*:\e-5\*.1\*: 0\*.0\*:\e-2\*.0
-\&31 Pica\*:\e-3\*.7\*:\e-3\*.8\*:\e-2\*.4\*:\e-3\*.6
-\&43 Pica\*:\e-9\*.1\*:\e-9\*.0\*:\e-5\*.9\*:\e-8\*.8
-\&\*.TE
-.OU
-.TS
-box, tab(:);
-cb s s s s
-cp-2 s s s s
-c ||c |c |c |c
-c ||c |c |c |c
-r2 ||n2 |n2 |n2 |n.
-Readability of Text
-Line Width and Leading for 10-Point Type
-=
-Line:Set:1-Point:2-Point:4-Point
-Width:Solid:Leading:Leading:Leading
-_
-9 Pica:\-9.3:\-6.0:\-5.3:\-7.1
-14 Pica:\-4.5:\-0.6:\-0.3:\-1.7
-19 Pica:\-5.0:\-5.1: 0.0:\-2.0
-31 Pica:\-3.7:\-3.8:\-2.4:\-3.6
-43 Pica:\-9.1:\-9.0:\-5.9:\-8.8
-.TE
-.IN 7i
-.e2 ac
-\&\*.TS
-\&c s
-\&cip-2 s
-\&l n
-\&a n\*.
-\&Some London Transport Statistics
-\&(Year 1964)
-\&Railway route miles\*T244
-\&Tube\*T66
-\&Sub-surface\*T22
-\&Surface\*T156
-\&\*.sp \*.5
-\&\*.T&
-\&l r
-\&a r\*.
-\&Passenger traffic \e- railway
-\&Journeys\*T674 million
-\&Average length\*T4\*.55 miles
-\&Passenger miles\*T3,066 million
-\&\*.T&
-\&l r
-\&a r\*.
-\&Passenger traffic \e- road
-\&Journeys\*T2,252 million
-\&Average length\*T2\*.26 miles
-\&Passenger miles\*T5,094 million
-\&\*.T&
-\&l n
-\&a n\*.
-\&\*.sp \*.5
-\&Vehicles\*T12,521
-\&Railway motor cars\*T2,905
-\&Railway trailer cars\*T1,269
-\&Total railway\*T4,174
-\&Omnibuses\*T8,347
-\&\*.T&
-\&l n
-\&a n\*.
-\&\*.sp \*.5
-\&Staff\*T73,739
-\&Administrative, etc\*.\*T5,582
-\&Civil engineering\*T5,134
-\&Electrical eng\*.\*T1,714
-\&Mech\*. eng\*. \e- railway\*T4,310
-\&Mech\*. eng\*. \e- road\*T9,152
-\&Railway operations\*T8,930
-\&Road operations\*T35,946
-\&Other\*T2,971
-\&\*.TE
-.OU
-.TS
-c s
-cip-2 s
-l n
-a n.
-Some London Transport Statistics
-(Year 1964)
-Railway route miles    244
-Tube   66
-Sub-surface    22
-Surface        156
-.sp .5
-.T&
-l r
-a r.
-Passenger traffic \(mi railway
-Journeys       674 million
-Average length 4.55 miles
-Passenger miles        3,066 million
-.T&
-l r
-a r.
-Passenger traffic \(mi road
-Journeys       2,252 million
-Average length 2.26 miles
-Passenger miles        5,094 million
-.T&
-l n
-a n.
-.sp .5
-Vehicles       12,521
-Railway motor cars     2,905
-Railway trailer cars   1,269
-Total railway  4,174
-Omnibuses      8,347
-.T&
-l n
-a n.
-.sp .5
-Staff  73,739
-Administrative, etc.   5,582
-Civil engineering      5,134
-Electrical eng.        1,714
-Mech. eng. \(mi railway        4,310
-Mech. eng. \(mi road   9,152
-Railway operations     8,930
-Road operations        35,946
-Other  2,971
-.TE
-.po \n(POu
-.sp |\n(.hu
-.de IN
-.sp
-.ne 1i
-.B
-Input:
-.R
-.sp .5
-.in +3n
-.nf
-..
-.de OU
-.sp
-.in -3n
-.ne 1i
-.B
-Output:
-.R
-.sp .5
-..
-.ns
-.EQ
-delim off
-.EN
-.IN
-\&\*.ps 8
-\&\*.vs 10p
-\&\*.TS
-center box;
-\&c s s
-\&ci s s
-\&c c c
-\&lB l n\*.
-\&New Jersey Representatives
-\&(Democrats)
-\&\*.sp \*.5
-\&Name\*TOffice address\*TPhone
-\&\*.sp \*.5
-\&James J\*. Florio\*T23 S\*. White Horse Pike, Somerdale 08083\*T609-627-8222
-\&William J\*. Hughes\*T2920 Atlantic Ave\*., Atlantic City 08401\*T609-345-4844
-\&James J\*. Howard\*T801 Bangs Ave\*., Asbury Park 07712\*T201-774-1600
-\&Frank Thompson, Jr\*.\*T10 Rutgers Pl\*., Trenton 08618\*T609-599-1619
-\&Andrew Maguire\*T115 W\*. Passaic St\*., Rochelle Park 07662\*T201-843-0240
-\&Robert A\*. Roe\*TU\*.S\*.P\*.O\*., 194 Ward St\*., Paterson 07510\*T201-523-5152
-\&Henry Helstoski\*T666 Paterson Ave\*., East Rutherford 07073\*T201-939-9090
-\&Peter W\*. Rodino, Jr\*.\*TSuite 1435A, 970 Broad St\*., Newark 07102\*T201-645-3213
-\&Joseph G\*. Minish\*T308 Main St\*., Orange 07050\*T201-645-6363
-\&Helen S\*. Meyner\*T32 Bridge St\*., Lambertville 08530\*T609-397-1830
-\&Dominick V\*. Daniels\*T895 Bergen Ave\*., Jersey City 07306\*T201-659-7700
-\&Edward J\*. Patten\*TNatl\*. Bank Bldg\*., Perth Amboy 08861\*T201-826-4610
-\&\*.sp \*.5
-\&\*.T&
-\&ci s s
-\&lB l n\*.
-\&(Republicans)
-\&\*.sp \*.5v
-\&Millicent Fenwick\*T41 N\*. Bridge St\*., Somerville 08876\*T201-722-8200
-\&Edwin B\*. Forsythe\*T301 Mill St\*., Moorestown 08057\*T609-235-6622
-\&Matthew J\*. Rinaldo\*T1961 Morris Ave\*., Union 07083\*T201-687-4235
-\&\*.TE
-\&\*.ps 10
-\&\*.vs 12p
-.ne 3.2i
-.OU
-.ps 8
-.vs 10p
-.TS
-center box;
-c s s
-ci s s
-c c c
-lB l n.
-New Jersey Representatives
-(Democrats)
-.sp .5
-Name   Office address  Phone
-.sp .5
-James J. Florio        23 S. White Horse Pike, Somerdale 08083 609-627-8222
-William J. Hughes      2920 Atlantic Ave., Atlantic City 08401 609-345-4844
-James J. Howard        801 Bangs Ave., Asbury Park 07712       201-774-1600
-Frank Thompson, Jr.    10 Rutgers Pl., Trenton 08618   609-599-1619
-Andrew Maguire 115 W. Passaic St., Rochelle Park 07662 201-843-0240
-Robert A. Roe  U.S.P.O., 194 Ward St., Paterson 07510  201-523-5152
-Henry Helstoski        666 Paterson Ave., East Rutherford 07073        201-939-9090
-Peter W. Rodino, Jr.   Suite 1435A, 970 Broad St., Newark 07102        201-645-3213
-Joseph G. Minish       308 Main St., Orange 07050      201-645-6363
-Helen S. Meyner        32 Bridge St., Lambertville 08530       609-397-1830
-Dominick V. Daniels    895 Bergen Ave., Jersey City 07306      201-659-7700
-Edward J. Patten       Natl. Bank Bldg., Perth Amboy 08861     201-826-4610
-.sp .5
-.T&
-ci s s
-lB l n.
-(Republicans)
-.sp .5v
-Millicent Fenwick      41 N. Bridge St., Somerville 08876      201-722-8200
-Edwin B. Forsythe      301 Mill St., Moorestown 08057  609-235-6622
-Matthew J. Rinaldo     1961 Morris Ave., Union 07083   201-687-4235
-.TE
-.ps 10
-.vs 12p
-.sp
-.fi
-This is a paragraph of normal text placed here only to indicate where
-the left and right margins are.  In this way the reader can judge
-the appearance of centered tables or expanded tables, and observe
-how such tables are formatted.
-.IN
-\&\*.TS
-\&expand;
-\&c s s s
-\&c c c c
-\&l l n n\*.
-\&Bell Labs Locations
-\&Name\*TAddress\*TArea Code\*TPhone
-\&Holmdel\*THolmdel, N\*. J\*. 07733\*T201\*T949-3000
-\&Murray Hill\*TMurray Hill, N\*. J\*. 07974\*T201\*T582-6377
-\&Whippany\*TWhippany, N\*. J\*. 07981\*T201\*T386-3000
-\&Indian Hill\*TNaperville, Illinois 60540\*T312\*T690-2000
-\&\*.TE
-.ne 1.3i
-.OU
-.TS
-expand;
-c s s s
-c c c c
-l l n n.
-Bell Labs Locations
-Name   Address Area Code       Phone
-Holmdel        Holmdel, N. J. 07733    201     949-3000
-Murray Hill    Murray Hill, N. J. 07974        201     582-6377
-Whippany       Whippany, N. J. 07981   201     386-3000
-Indian Hill    Naperville, Illinois 60540      312     690-2000
-.TE
-.br
-.ps 8
-.vs 9p
-.ne 5i
-.IN
-\&\*.TS
-\&box;
-\&cb   s   s   s
-\&c | c | c   s
-\&ltiw(1i) | ltw(2i) | lp8 | lw(1\*.6i)p8\*.
-\&Some Interesting Places
-\&_
-\&Name\*TDescription\*TPractical Information
-\&_
-\&T{
-\&American Museum of Natural History
-\&T}\*TT{
-\&The collections fill 11\*.5 acres (Michelin) or 25 acres (MTA)
-\&of exhibition halls on four floors\*.  There is a full-sized replica
-\&of a blue whale and the world's largest star sapphire (stolen in 1964)\*.
-\&T}\*THours\*T10-5, ex\*. Sun 11-5, Wed\*. to 9
-\&\e^\*T\e^\*TLocation\*TT{
-\&Central Park West & 79th St\*.
-\&T}
-\&\e^\*T\e^\*TAdmission\*TDonation: $1\*.00 asked
-\&\e^\*T\e^\*TSubway\*TAA to 81st St\*.
-\&\e^\*T\e^\*TTelephone\*T212-873-4225
-\&_
-\&Bronx Zoo\*TT{
-\&About a mile long and \*.6 mile wide, this is the largest zoo in America\*.
-\&A lion eats 18 pounds
-\&of meat a day while a sea lion eats 15 pounds of fish\*.
-\&T}\*THours\*TT{
-\&10-4:30 winter, to 5:00 summer
-\&T}
-\&\e^\*T\e^\*TLocation\*TT{
-\&185th St\*. & Southern Blvd, the Bronx\*.
-\&T}
-\&\e^\*T\e^\*TAdmission\*T$1\*.00, but Tu,We,Th free
-\&\e^\*T\e^\*TSubway\*T2, 5 to East Tremont Ave\*.
-\&\e^\*T\e^\*TTelephone\*T212-933-1759
-\&_
-\&Brooklyn Museum\*TT{
-\&Five floors of galleries contain American and ancient art\*.
-\&There are American period rooms and architectural ornaments saved
-\&from wreckers, such as a classical figure from Pennsylvania Station\*.
-\&T}\*THours\*TWed-Sat, 10-5, Sun 12-5
-\&\e^\*T\e^\*TLocation\*TT{
-\&Eastern Parkway & Washington Ave\*., Brooklyn\*.
-\&T}
-\&\e^\*T\e^\*TAdmission\*TFree
-\&\e^\*T\e^\*TSubway\*T2,3 to Eastern Parkway\*.
-\&\e^\*T\e^\*TTelephone\*T212-638-5000
-\&_
-\&T{
-\&New-York Historical Society
-\&T}\*TT{
-\&All the original paintings for Audubon's
-\&\*.I
-\&Birds of America
-\&\*.R
-\&are here, as are exhibits of American decorative arts, New York history,
-\&Hudson River school paintings, carriages, and glass paperweights\*.
-\&T}\*THours\*TT{
-\&Tues-Fri & Sun, 1-5; Sat 10-5
-\&T}
-\&\e^\*T\e^\*TLocation\*TT{
-\&Central Park West & 77th St\*.
-\&T}
-\&\e^\*T\e^\*TAdmission\*TFree
-\&\e^\*T\e^\*TSubway\*TAA to 81st St\*.
-\&\e^\*T\e^\*TTelephone\*T212-873-3400
-\&\*.TE
-.br
-.ps \n(PS
-.vs \n(VSp
-.OU
-.fi
-.rr 10 11 12 13 14 15 16 17 18 19 20 21 22 98 99
-.rr 60 61 62 63 64 65 66 67 68 69 70
-.rr 43 44 45 46 47 48 49 50 51 52 53
-.rr 83 84 85 86 87 88 89 90 91 92 93
-.rr #a
-.rr #b
-.rr #c
-.rr #d
-.rr #e
-.rr YY
-.rr OJ
-.rr P
-.rr AV CW GW DW FL KN SJ A1 A2 A3 I1 I2 I3
-.in 0
-.hy 1
-.TS
-box;
-cb   s   s   s
-c | c | c   s
-ltiw(1i) | ltw(2i) | lp8| lw(1.6i)p8.
-Some Interesting Places
-_
-Name   Description     Practical Information
-_
-T{
-American Museum of Natural History
-T}     T{
-The collections fill 11.5 acres (Michelin) or 25 acres (MTA)
-of exhibition halls on four floors.  There is a full-sized replica
-of a blue whale and the world's largest star sapphire (stolen in 1964).
-T}     Hours   10-5, ex. Sun 11-5, Wed. to 9
-\^     \^      Location        T{
-Central Park West & 79th St.
-T}
-\^     \^      Admission       Donation: $1.00 asked
-\^     \^      Subway  AA to 81st St.
-\^     \^      Telephone       212-873-4225
-_
-Bronx Zoo      T{
-About a mile long and .6 mile wide, this is the largest zoo in America.
-A lion eats 18 pounds
-of meat a day while a sea lion eats 15 pounds of fish.
-T}     Hours   T{
-10-4:30 winter, to 5:00 summer
-T}
-\^     \^      Location        T{
-185th St. & Southern Blvd, the Bronx.
-T}
-\^     \^      Admission       $1.00, but Tu,We,Th free
-\^     \^      Subway  2, 5 to East Tremont Ave.
-\^     \^      Telephone       212-933-1759
-_
-Brooklyn Museum        T{
-Five floors of galleries contain American and ancient art.
-There are American period rooms and architectural ornaments saved
-from wreckers, such as a classical figure from Pennsylvania Station.
-T}     Hours   Wed-Sat, 10-5, Sun 12-5
-\^     \^      Location        T{
-Eastern Parkway & Washington Ave., Brooklyn.
-T}
-\^     \^      Admission       Free
-\^     \^      Subway  2,3 to Eastern Parkway.
-\^     \^      Telephone       212-638-5000
-_
-T{
-New-York Historical Society
-T}     T{
-All the original paintings for Audubon's
-.I
-Birds of America
-.R
-are here, as are exhibits of American decorative arts, New York history,
-Hudson River school paintings, carriages, and glass paperweights.
-T}     Hours   T{
-Tues-Fri & Sun, 1-5; Sat 10-5
-T}
-\^     \^      Location        T{
-Central Park West & 77th St.
-T}
-\^     \^      Admission       Free
-\^     \^      Subway  AA to 81st St.
-\^     \^      Telephone       212-873-3400
-.TE
-.rr 40
-.rr 41
-.rr 42
-.rr 43
-.rr 80
-.rr 81
-.rr 82
-.rr 83
-.rr 60
-.rr 61
-.rr 62
-.rr 63
-.rr #a
-.rr #b
-.rr #c
-.rr #d
-.rr #e
-.rr ##
-.ne 2i
-.fi
-.LP
-.SH
-Acknowledgments.
-.PP
-Many thanks are due to J. C. Blinn, who has done a large amount
-of testing and assisted with the design of the program.
-He has also written many of the more intelligible sentences
-in this document and helped edit all of it.
-All phototypesetting programs on \s-2UNIX\s0 are dependent on the work
-of the late J. F. Ossanna, whose assistance with this program in particular
-had been most helpful.
-This program is patterned on a table formatter originally
-written by J. F. Gimpel.
-The assistance of
-T. A. Dolotta, B. W. Kernighan, and J. N. Sturman
-is gratefully acknowledged.
-.SG MH-1274-MEL-troff
-.ne 2i
-.SH
-References.
-.IP [1]
-J. F. Ossanna,
-.I
-N\s-2ROFF\s0/T\s-2ROFF\s0 User's Manual,
-.R
-Computing Science Technical Report No. 54,
-Bell Laboratories, 1976.
-.IP [2]
-K. Thompson and D. M. Ritchie,
-``The U\s-2NIX\s0 Time-Sharing System,''
-\fIComm. ACM. \fB17\fR, pp. 365\(mi75 (1974).
-.IP [3]
-B. W. Kernighan and L. L. Cherry,
-``A System for Typesetting Mathematics,''
-\fIComm. ACM. \fB18\fR, pp. 151\(mi57 (1975).
-.IP [4]
-M. E. Lesk,
-.I
-Typing Documents on U\s-2NIX\s0,
-.R
-UNIX Programmer's Manual, Volume 2.
-.IP [5]
-M. E. Lesk and B. W. Kernighan,
-.I
-Computer Typesetting of Technical Journals on U\s-2NIX\s0,
-.R
-\f2Proc. AFIPS NCC\f1, vol. 46, pp. 879-888 (1977).
-.IP [6]
-J. R. Mashey and D. W. Smith,
-``Documentation Tools and Techniques,''
-.I
-Proc. 2nd Int. Conf. on Software Engineering,
-.R
-pp. 177-181 (October, 1976).
-.sp 3
-.SH
-.ce
-List of Tbl Command Characters and Words
-.LP
-.EQ
-delim $$
-gfont roman
-.EN
-.TS
-center;
-cI cI cI
-aB lf1 nf1 .
-Command        Meaning Section
-a A    Alphabetic subcolumn    2
-allbox Draw box around all items       1
-b B    Boldface item   2
-box    Draw box around table   1
-c C    Centered column 2
-center Center table in page    1
-doublebox      Doubled box around table        1
-e E    Equal width columns     2
-expand Make table full line width      1
-f F    Font change     2
-i I    Italic item     2
-l L    Left adjusted column    2
-n N    Numerical column        2
-\fInnn\fR      Column separation       2
-p P    Point size change       2
-r R    Right adjusted column   2
-s S    Spanned item    2
-t T    Vertical spanning at top        2
-tab \fR(\fIx\|\fR)     Change data separator character 1
-$fat roman "T{" ~~ fat roman "T}"$     Text block      3
-v V    Vertical spacing change 2
-w W    Minimum width value     2
-\&\s+4.\s0\fIxx\fR     Included \fItroff\fR command    3
-\(bv   Vertical line   2
-\(bv\|\(bv     Double vertical line    2
-\&\s+4\v'4p'^\v'-4p'\s0        Vertical span   2
-\e\&\s+4\v'4p'^\v'-4p'\s0      Vertical span   3
-\&=    Double horizontal line  2,3
-\&$fat "_"$    Horizontal line 2,3
-\&$fat "\e_"$  Short horizontal line   3
-\&$fat "\e"$\f3R\f2x   Repeat character        3
-.TE
diff --git a/.ref-Research-V7/usr/doc/troff/add b/.ref-Research-V7/usr/doc/troff/add
deleted file mode 100644 (file)
index 2222950..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-.nr i 1i
-.de H
-'sp |.5i-1
-.tl 'May 15, 1977'''
-'sp |1i
-..
-.de F
-'bp
-..
-.wh 0 H
-.wh -1i F
-.de pp
-.ft R
-.sp
-.ti 0
-..
-.de h
-.sp
-.ti0
-\fB\\$1\fP
-.br
-..
-.ce
-.ftB
-Summary of Changes to N/TROFF Since October 1976 Manual
-.ft
-.ta \niu
-.in \niu
-.h Options
-.pp
--h     (Nroff only) Output tabs used during horizontal spacing
-to speed output as well as reduce output byte count.
-Device tab settings assumed to be every
-8 nominal character widths.
-The default settings of input (logical) tabs is also
-initialized to every 8 nominal character widths.
-.pp
--z     Efficiently suppresses formatted output.
-Only message output will occur (from "tm"s and diagnostics).
-.h "Old Requests"
-.pp
-\&.ad\ c       The adjustment type indicator "c" may now also be a number
-previously obtained from the ".j" register (see below).
-.pp
-\&.so\ name    The contents of file "name" will be interpolated
-at the point the "so" is encountered.
-Previously, the interpolation was done upon return to the file-reading input level.
-.h "New Request"
-.pp
-\&.ab\ text    \
-Prints "text" on the message output and terminates
-without further processing.
-If "text" is missing, "User Abort." is printed.
-Does not cause a break.
-The output buffer is flushed.
-.pp
-\&.fz F N      \
-forces f\b_ont "F" to be in siz\b_e N.
-N may have the form N, +N, or -N.
-For example,
-     .fz 3 -2
-.br
-will cause an implicit \es-2 every time font 3 is entered,
-and a corresponding \es+2 when it is left.
-Special font characters occurring during the
-reign of font F will have the same size modification.
-If special characters are to be treated differently,
-     .fz S F N
-.br
-may be used to specify the size treatment of special
-characters during font F.
-For example,
-     .fz 3 -3
-     .fz S 3 -0
-.br
-will cause automatic reduction of font 3 by 3 points
-while the special characters would not be affected.
-Any ``.fp'' request specifying a font on some position
-must precede ``.fz'' requests relating to that position.
-.h "New Predefined Number Registers."
-.pp
-\&.k   Read-only. Contains the horizontal size
-of the text portion (without indent) of the current
-partially collected output line, if any, in
-the current environment.
-.pp
-\&.j   Read-only. A number representing the current adjustment mode and type.
-Can be saved and later given to the "ad" request to restore a previous mode.
-.pp
-\&.P   Read-only.
-1 if the current page is being printed,
-and zero otherwise.
-.pp
-\&.L   Read-only.
-Contains the current line-spacing parameter ("ls").
-.pp
-\&c.   General register access to the input line-number
-in the current input file.
-Contains the same value as the read-only ".c" register.
diff --git a/.ref-Research-V7/usr/doc/troff/m.mac b/.ref-Research-V7/usr/doc/troff/m.mac
deleted file mode 100644 (file)
index 5bc3917..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-.if \n(mo=1 .ds mo January
-.if \n(mo=2 .ds mo February
-.if \n(mo=3 .ds mo March
-.if \n(mo=4 .ds mo April
-.if \n(mo=5 .ds mo May
-.if \n(mo=6 .ds mo June
-.if \n(mo=7 .ds mo July
-.if \n(mo=8 .ds mo August
-.if \n(mo=9 .ds mo September
-.if \n(mo=10 .ds mo October
-.if \n(mo=11 .ds mo November
-.if \n(mo=12 .ds mo December
-.if \n(dw=1 .ds dw Sunday
-.if \n(dw=2 .ds dw Monday
-.if \n(dw=3 .ds dw Tuesday
-.if \n(dw=4 .ds dw Wednesday
-.if \n(dw=5 .ds dw Thursday
-.if \n(dw=6 .ds dw Friday
-.if \n(dw=7 .ds dw Saturday
-.\"
-.bd S B 3
-.ds NR "\s-1NROFF\s+1
-.ds TR "\s-1TROFF\s+1
-.ds Nr "N\s-2ROFF\s+2
-.ds Tr "T\s-2ROFF\s+2
-.nr PS 10
-.hy14
-.ds u \v'-0.3m'\s-2
-.ds d \s0\v'0.3m'
-.nr a .8i
-.nr b 1.6i
-.nr c 2.4i
-.nr d 2.9i
-.nr e 0.25i
-.nr p 0 1
-.nr s 0 1
-.af p 1
-.af s 1
-.nr m -1i
-.nr x 0 1
-.nr y 0+\nmu
-.ev1
-.ps \n(PS-2
-.vs \n(PS
-.ll6.5i
-'in 0
-.ev
-.tr &.
-.de xx
-.sp 0.4
-..
-.de ht
-.tl `\*(Nr/\*(Tr User's Manual```
-.tl 'October 11, 1976'''\".tl 'Version \n(mo/\n(dy/\n(yr'''
-..
-.de hd
-.tl '\(rn'''
-.if \\n%>1 \{'sp |.33i
-.ht
-.ps \\n(S2
-.ps \\n(S1
-.ft
-'sp |1i\}
-.nr x 0 1
-.nr y 0+\\nmu
-.ch fo \\nmu
-.if \\n(dn .fz
-.ns
-.mx
-.nr cl 0 1
-.mk
-..
-.de fz
-.fn
-.nf
-.fy
-.fi
-.ef
-..
-.de fx
-.if \\nx .di fy
-..
-.de fo
-.cx
-.nr dn 0
-.if \\nx .xf
-.nr x 0 \"disable fx
-.ie \\n(2C&(\\n+(cl<2) \{\
-.po +3.4i
-.rt
-.nr y 0+\\nmu
-.ch fo \\nmu
-.if \\n(dn .fz
-.ns \}
-.el \{\
-.po 26i/27u
-.nr S1 \\n(.s
-.ps
-.nr S2 \\n(.s
-.ps 10
-'bp \}
-..
-.de 2C
-.br
-.mk
-.nr 2C 1
-.ll 3.1i
-.ev 1
-.ll 3.1i
-.ev
-..
-.de 1C
-.br
-.nr 2C 0
-.ll 6.5i
-.ev1
-.ll 6.5i
-.ev
-..
-.de co
-.de cx
-.br
-\fI(Continued next page.)\fP
-.br
-.rm cx
-\\..
-..
-.de pp
-'ps \\n(PS
-.ftR
-'tl ''- % -''
-'bp
-..
-.wh 0 hd
-.wh 12i fo
-.wh \nmu fx
-.ch fo \nmu
-.de fn
-.da FN
-.ev1
-.if \\n+x=1 .fs
-.fi
-.ti0
-..
-.de xf
-.ev1
-.nf
-.FN
-.rm FN
-.di
-.ev
-..
-.de fs
-.ti0
-\l'1i'
-.br
-..
-.de ef
-.br
-.ev
-.di
-.nr y -\\n(dn
-.if \\nx=1 .nr y -2p
-.ch fo \\nyu
-.if \\n(nl+\\n(.v-\\n(.p-\\ny .ch fo \\n(nlu+\\n(.vu
-..
-.wh -.6i pp
-.de h1
-.xx
-.ne 5
-.nf
-.ta \\nau \\nbu \\ncu \\ndu +\\neu
-.ft I
-.bd I 3
-Request        Initial If No
-Form   Value\\$2       Argument        Notes\\$1       Explanation
-.bd I
-.ft R
-.ft
-.fi
-.in \\ndu
-..
-.de bt
-.ftR
-.xx
-.ne 1.1
-.ti0
-..
-.de b1
-.br
-.ti0
-..
-.de pg
-.ft R
-.fi
-.in0
-.xx
-.ne 1.1
-..
-.de sc
-.pg
-\fI\\*H\\np.\\n+s.\|\\c
-.ftR
-.ul
-..
-.de mh
-.nr s 0
-.in0
-.xx
-.ne 2.5
-.ft B
-\\*H\\n+p.
-..
-.de x1
-.xx
-.in.5i
-.nf
-..
-.de x2
-.xx
-.in0
-.fi
-..
-.de EM
-.br
-\&\c
-'bp
-.pl2i
-..
-.em EM
-.de TS
-.sp
-..
-.de TE
-.sp
-.ce 0
-.ft R
-.ps \n(PS
-.ta \\nau \\nbu \\ncu \\ndu +\\neu
-..
diff --git a/.ref-Research-V7/usr/doc/troff/m0 b/.ref-Research-V7/usr/doc/troff/m0
deleted file mode 100644 (file)
index 4b40fe9..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-.br
-.rs
-.sp |1.50i
-.ce1000
-.ps12
-.ftB
-\*(Nr\(sl\*(Tr User's Manual
-.sp .2i
-.ftI
-.ps10
-Joseph F. Ossanna
-.ftR
-.sp
-Bell Laboratories
-Murray Hill, New Jersey 07974
-.ce0
-.sp2
-.ps \n(PS
-.fi
-.ftB
-Introduction
-.pg
-\*(NR and \*(TR are text processors under
-the \s-1PDP\s+1-11 \s-1UNIX\s+1 Time-Sharing System\*u1\*d
-that format text for typewriter-like terminals and
-for a \%Graphic Systems phototypesetter, respectively.
-They accept lines of text interspersed with lines of
-format control information and
-format the text into a printable, paginated document
-having a user-designed style.
-\*(NR and \*(TR offer
-unusual freedom in document styling,
-including:
-arbitrary style headers and footers;
-arbitrary style footnotes;
-multiple automatic sequence numbering for paragraphs, sections, etc;
-multiple column output;
-dynamic font and point-size control;
-arbitrary horizontal and vertical local motions at any point;
-and
-a family of automatic overstriking, bracket construction, and
-line drawing functions.
-.pg
-\*(NR and \*(TR are highly compatible with each other and it is almost always
-possible to prepare input acceptable to both.
-Conditional input is provided that enables
-the user to embed input expressly destined for either program.
-\*(NR can prepare output directly for a variety of terminal types and
-is capable of utilizing the full resolution of each terminal.
-.pg
-.ftB
-Usage
-.pg
-The general form of invoking \*(NR (or \*(TR) at \s-1UNIX\s+1 command level is
-.x1
-\fBnroff  \fIoptions  files\fR\
-\h'|2i'(or  \fBtroff  \fIoptions  files\fR)
-.x2
-where \fIoptions\fR represents any of a number of option arguments
-and \fIfiles\fR represents the list of files containing the document
-to be formatted.
-An argument consisting of a single minus (\fB\-\fR) is taken to be
-a file name corresponding to the standard input.
-If no file names are given input is taken from the standard input.
-The options, which may appear in any order so long as they appear
-before the files, are:
-.sp
-.ta .2i 1.0i
-.ftI
-.bd I 3
-       Option  Effect
-.br
-.bd I
-.ftR
-.ta .3i 1.0i
-.in 1.0i
-.ll-.3i
-.bt
-       \fB\-o\fIlist\fR        \
-Print only pages whose page numbers appear in \fIlist\fR,
-which consists of comma-separated numbers and number ranges.
-A number range has the form \fIN\-M\fR
-and means pages \fIN\fR through \fIM;\fR
-a initial \fI\-N\fR means
-from the beginning to page \fIN;\fR and a final \fIN\-\fR means
-from \fIN\fR to the end.
-.bt
-       \fB\-n\fIN\fR   Number first generated page \fIN\fR.
-.bt
-       \fB\-s\fIN\fR   Stop every \fIN\fR pages.
-\*(NR will halt prior to every \fIN\fR pages (default \fIN\fR=1)
-to allow paper loading or
-changing, and will resume upon receipt of a newline.
-\*(TR will stop the phototypesetter every \fIN\fR pages,
-produce a trailer to allow changing cassettes,
-and will resume after the phototypesetter \s-1START\s+1 button is pressed.
-.bt
-       \fB\-m\fIname\fR        Prepends the macro file
-\fB\(slusr\(sllib\(sltmac.\fIname\fR
-to the input \fIfiles\fR.
-.bt
-       \fB\-r\fIaN\fR  Register \fIa\fR (one-character) is set to \fIN\fR.
-.bt
-       \fB\-i\fP       Read standard input after the input files are exhausted.
-.bt
-       \fB\-q\fR       \
-Invoke the simultaneous input-output mode of the \fBrd\fR request.
-.sp
-.ne 3
-.ftI
-.bd I 3
-               \*(NR Only
-.br
-.bd I
-.ft
-.bt
-       \fB\-T\fIname\fR        Specifies
-the name of the output terminal type.
-Currently defined names are \fB37\fR for the (default) Model 37 Teletype\(rg,
-\fBtn300\fR for the GE TermiNet\ 300 (or any terminal without half-line
-capabilities),
-\fB300S\fR for the \s-1DASI\s+1-300S,
-\fB300\fR for the \s-1DASI\s+1-300,
-and
-\fB450\fR for the \s-1DASI\s+1-450 (Diablo Hyterm).
-.bt
-       \fB\-e\fR       \
-Produce equally-spaced words in adjusted
-lines, using full terminal resolution.
-.sp
-.ne 3
-.ftI
-.bd I 3
-               \*(TR Only
-.br
-.bd I
-.ft
-.bt
-       \fB\-t\fP       Direct output to the standard output instead
-of the phototypesetter.
-.bt
-       \fB\-f\fP       Refrain from feeding out paper and stopping
-phototypesetter at the end of the run.
-.bt
-       \fB\-w\fP       Wait until phototypesetter is available, if
-currently busy.
-.bt
-       \fB\-b\fR       \*(TR will report whether the phototypesetter
-is busy or available.
-No text processing is done.
-.bt
-       \fB\-a\fP       Send a printable \s-1(ASCII)\s+1 approximation
-of the results to the standard output.
-.bt
-       \fB\-p\fIN\fR   Print all characters in point size \fIN\fR
-while retaining all prescribed spacings and motions,
-to reduce phototypesetter elasped time.
-.bt
-       \fB\-g\fR       Prepare output for the Murray Hill
-Computation Center phototypesetter and direct it to the standard output.
-.ll
-.in0
-.xx
-.pg
-Each option is invoked as a separate argument;
-for example,
-.x1
-\fBnroff  \-o\fI4,8\-10  \fB\-T\fI300S  \fB\-m\fIabc  file1  file2\fR
-.x2
-requests formatting of pages 4, 8, 9, and 10 of a document contained in the files
-named \fIfile1\fR and \fIfile2\fR,
-specifies the output terminal as a \s-1DASI\s+1-300S,
-and invokes the macro package \fIabc\fR.
-.pg
-Various pre- and post-processors are available for use with \*(NR and \*(TR.
-These include the equation preprocessors \s-1NEQN\s+1 and \s-1EQN\s+1\*u2\*d
-(for \*(NR and \*(TR respectively),
-and the table-construction preprocessor \s-1TBL\s+1\*u3\*d.
-A reverse-line postprocessor \s-1COL\s+1\*u4\*d
-is available for multiple-column \*(NR output on terminals without reverse-line ability;
-\s-1COL\s+1 expects the Model 37 Teletype
-escape sequences that \*(NR produces by default.
-\s-1TK\s+1\*u4\*d
-is a 37 Teletype simulator postprocessor for printing \*(NR output on a Tektronix 4014.
-\s-1TCAT\s+1\*u4\*d
-is phototypesetter-simulator postprocessor
-for \*(TR that produces an approximation of phototypesetter output
-on a Tektronix 4014.
-For example, in
-.x1
-\fBtbl  \fIfiles  \fB|  eqn  |  troff  \-t \fIoptions  \fB|  tcat\fR
-.x2
-the first \|\fB|\fR\| indicates the piping of \s-1TBL\s+1's output to \s-1EQN\s+1's input;
-the second the piping of \s-1EQN\s+1's output to \*(TR's input;
-and the third indicates the piping of \*(TR's output to \s-1TCAT\s+1.
-\s-1GCAT\s+1\*u4\*d can be used to send \*(TR (\fB\-g\fR) output to
-the Murray Hill Computation Center.
-.br
-.pg
-The remainder of this manual consists of:
-a Summary and Index;
-a Reference Manual keyed to the index;
-and
-a set of Tutorial Examples.
-Another tutorial is [5].
-.sp.4i
-.ta 4i
-       Joseph F. Ossanna
-.sp.4
-.ps -1
-.vs -1p
-.pg
-.ftB
-References
-.pg
-.ta .3i
-.in .3i
-.ti0
-[1]    K. Thompson, D. M. Ritchie,
-.ul
-UNIX Programmer's Manual,
-Sixth Edition (May 1975).
-.sp.4
-.ti0
-[2]    B. W. Kernighan, L. L. Cherry,
-.ul
-Typesetting Mathematics \(em User's Guide (Second Edition),
-Bell Laboratories internal memorandum.
-.sp.4
-.ti0
-[3]    M. E. Lesk,
-.ul
-Tbl \(em A Program to Format Tables,
-Bell Laboratories internal memorandum.
-.sp.4
-.ti0
-[4]    Internal on-line documentation, on \s-1UNIX\s+1.
-.sp.4
-.ti0
-[5]    B. W. Kernighan, \fIA TROFF Tutorial\fR,
-Bell Laboratories internal memorandum.
-.in0
-.ps
-.vs
diff --git a/.ref-Research-V7/usr/doc/troff/m0a b/.ref-Research-V7/usr/doc/troff/m0a
deleted file mode 100644 (file)
index af91886..0000000
+++ /dev/null
@@ -1,549 +0,0 @@
-.pn3
-.br
-.tr |
-.ce
-.ftB
-SUMMARY AND INDEX
-.ftR
-.de mx
-.ev2
-.nf
-.h1
-.in
-.sp
-.fi
-.ev
-.ns
-..
-.xx
-.h1 \s-1#\s+1 *
-.fn
-.sp.3
-*Values separated by "\fB;\fR" are for \*(NR and \*(TR respectively.
-.sp.2
-\s-1#\s+1Notes are explained at the end of this Summary and Index
-.ef
-.mh
-General Explanation
-.mh
-Font and Character Size Control
-.bt
-\fB&ps\fI\|\(+-N\fR    10\|point       previous        E       Point size; also \fB\es\fI\(+-N\fR.\(dg
-.b1
-\fB&ss\fI|N\fR 12\(sl36\|em    ignored E       Space-character size
-set to \fIN\fR\(sl36\|em.\(dg
-.b1
-\fB&cs\fI\|F\|N\|M\fR  off     -       P       Constant character
-space (width)
-mode (font \fIF\^\fR\^).\(dg
-.b1
-\fB&bd\fI|F|N\fR       off     -       P       Embolden font \fIF\fR by \fIN\fR\(mi1 units.\(dg
-.b1
-\fB&bd|S|\fIF|N\fR     off     -       P       Embolden Special Font when current font is \fIF\fR.\(dg
-.fn
-.sp.2
-\(dgNo effect in \*(NR.
-.ef
-.b1
-\fB&ft\fI|F\fR Roman   previous        E       Change to font
-\fIF\fR|= \fIx\fR, \fIxx\fR, or 1-4.
-Also \fB\ef\fIx\fR,\|\fB\ef(\fIxx\fR,\|\fB\ef\fIN\fR.
-.b1
-\fB&fp\fI|N|F\fR       R,I,B,S ignored -       Font named \fIF\fR mounted on physical position 1\(<=\fIN\fR\(<=4.
-.mh
-Page Control
-.bt
-\fB&pl\fI\|\(+-N\fR    11\|in  11\|in  \fBv\fR Page length.
-.b1
-\fB&bp|\fI\(+-N\fR     \fIN\(eq\fR1    -       B\(dd,\fBv\fR   \
-Eject current page; next page number \fIN\fR.
-.fn
-.sp.2
-\(ddThe use of "\ \fB\'\fR\ " as control character (instead of "\fB.\fR")
-suppresses the break function.
-.ef
-.b1
-\fB&pn\fI|\(+-N        N\(eq\fR1       ignored -       Next page number \fIN\fR.
-.b1
-\fB&po\fI|\(+-N\fR     0;|26\(sl27\|in previous        \fBv\fR Page offset.
-.b1
-\fB&ne\fI|N\fR -       \fIN\(eq\fR1\fIV\fR     D,\fBv\fR       Need \fIN\fR vertical space (\fIV\fR = vertical spacing).
-.b1
-\fB&mk|\fIR\fR none    internal        D       Mark current vertical place in register \fIR\fR.
-.b1
-\fB&rt\fI|\(+-N\fR     none    internal        D,\fBv\fR       Return \fI(upward only)\fR to marked vertical place.
-.mh
-Text Filling, Adjusting, and Centering
-.bt
-\fB&br\fR      -       -       B       Break.
-.b1
-.lg0
-\fB&fi\fR      \(fill  -       B,E     Fill output lines.
-.lg
-.b1
-\fB&nf\fR      fill    -       B,E     No filling or adjusting of output lines.
-.b1
-\fB&ad\fI|c\fR adj,both        adjust  E       Adjust output lines with mode \fIc\fR.
-.b1
-\fB&na\fR      adjust  -       E       No output line adjusting.
-.b1
-\fB&ce\fI|N\fR off     \fIN\(eq\fR1    B,E     Center following \fIN\fR input text lines.
-.mh
-Vertical Spacing
-.bt
-\fB&vs\fI|N\fR 1\(sl6in;12pts  previous        E,\fBp\fR       Vertical base line spacing (\fIV\fR\^).
-.b1
-\fB&ls\fI|N    N\(eq\fR1       previous        E       Output \fIN\(mi\fR1 \fIV\^\fRs after each text output line.
-.b1
-\fB&sp\fI|N\fR -       \fIN\(eq\fR1\fIV\fR     B,\fBv\fR       Space \
-vertical distance \fIN\fR \fIin either direction\fR.
-.b1
-\fB&sv\fI|N\fR -       \fIN\(eq\fR1\fIV\fR     \fBv\fR Save vertical distance \fIN\fR.
-.b1
-\fB&os\fR      -       -       -       Output saved vertical distance.
-.b1
-\fB&ns\fR      space   -       D       Turn no-space mode on.
-.b1
-\fB&rs\fR      -       -       D       Restore spacing; turn no-space mode off.
-.mh
-Line Length and Indenting
-.bt
-\fB&ll\fI|\(+-N\fR     6.5\|in previous        E,\fBm\fR       Line length.
-.b1
-\fB&in\fI|\(+-N\fR     \fIN\(eq\fR\^0  previous        B,E,\fBm\fR     Indent.
-.b1
-\fB&ti\fI|\(+-N\fR     -       ignored B,E,\fBm\fR     Temporary indent.
-.mh
-Macros, Strings, Diversion, and Position Traps
-.bt
-\fB&de\fI|xx|yy\fR     -       \fI.yy=\fB..\fR -       Define or redefine macro \fIxx;\fR end at call of \fIyy\fR.
-.b1
-\fB&am\fI|xx|yy\fR     -       \fI.yy=\fB..\fR -       Append to a macro.
-.b1
-\fB&ds\fI|xx|string\fR -       ignored -       Define a string \fIxx\fR containing \fIstring\fR.
-.b1
-\fB&as\fI|xx|string\fR -       ignored -       Append \fIstring\fR to string \fIxx\fR.
-.b1
-\fB&rm\fI|xx\fR        -       ignored -       Remove request, macro, or string.
-.b1
-\fB&rn\fI|xx|yy\fR     -       ignored -       Rename request, macro, or string \fIxx\fR to \fIyy\fR.
-.b1
-\fB&di\fI|xx\fR        -       end     D       Divert output to macro \fIxx\fR.
-.b1
-\fB&da\fI|xx\fR        -       end     D       Divert and append to \fIxx\fR.
-.b1
-\fB&wh\fI|N|xx\fR      -       -       \fBv\fR Set location trap; negative is w.r.t. page bottom.
-.b1
-\fB&ch\fI|xx|N\fR      -       -       \fBv\fR Change trap location.
-.b1
-\fB&dt\fI|N|xx\fR      -       off     D,\fBv\fR       Set a diversion trap.
-.b1
-\fB&it\fI|N|xx\fR      -       off     E       Set an input-line count trap.
-.b1
-\fB&em\fI|xx\fR        none    none    -       End macro is \fIxx\fI.
-.mh
-Number Registers
-.bt
-\fB&nr\fI|R|\(+-N|M\fR -       \fBu\fR Define and set number register \fIR\fR; auto-increment by \fIM\fR.
-.b1
-\fB&af\fI|R|c\fR       arabic  -       -       Assign format to register \fIR\fR (\fIc=\fB1\fR, \fBi\fR, \fBI\fR, \fBa\fR, \fBA\fR).
-.b1
-\fB&rr\fI|R\fR -       -       -       Remove register \fIR\fR.
-.mh
-Tabs, Leaders, and Fields
-.bt
-\fB&ta\fI|Nt|...\fR    0.8;|0.5in      none    E,\fBm\fR       Tab settings; \fIleft\fR type, unless \fIt=\fBR\fR(right), \fBC\fR(centered).
-.b1
-\fB&tc\fI|c\fR none    none    E       Tab repetition character.
-.b1
-\fB&lc\fI|c\fR \fB.\fR none    E       Leader repetition character.
-.b1
-\fB&fc\fI|a|b\fR       off     off     -       Set field delimiter \fIa\fR and pad character \fIb\fR.
-.mh
-Input and Output Conventions and Character Translations
-.bt
-\fB&ec\fI|c\fR \e      \e      -       Set escape character.
-.b1
-\fB&eo\fR      on      -       -       Turn off escape character mechanism.
-.b1
-\fB&lg\fI|N\fR -;\|on  on      -       Ligature mode
-on if \fIN\fR>0.
-.b1
-\fB&ul\fI|N\fR off     \fIN\(eq\fR1    E       Underline (italicize in \*(TR) \fIN\fR input lines.
-.b1
-\fB&cu\fI|N\fR off     \fIN\(eq\fR1    E       Continuous underline in \*(NR; like \fBul\fR in \*(TR.
-.b1
-\fB&uf\fI|F\fR Italic  Italic  -       Underline font set to \fIF\fR (to be switched to by \fBul\fR).
-.b1
-\fB&cc\fI|c\fR \fB.    .\fR    E       Set control character to \fIc\fR.
-.b1
-\fB&c2\fI|c\fR \fB\'   \'\fR   E       Set nobreak control character to \fIc\fR.
-.b1
-\fB&tr\fI|abcd....\fR  none    -       O       Translate \fIa\fR to \fIb\fR, etc. on output.
-.mh
-Local Horizontal and Vertical Motions, and the Width Function
-.mh
-Overstrike, Bracket, Line-drawing, and Zero-width Functions
-.mh
-Hyphenation.
-.bt
-\fB&nh\fR      hyphenate       -       E       No hyphenation.
-.b1
-\fB&hy\fI|N\fR hyphenate       hyphenate       E       Hyphenate; \fIN =\fR mode.
-.b1
-\fB&hc\fI|c\fR \fB\e%  \e%\fR  E       Hyphenation indicator character \fIc\fR.
-.b1
-\fB&hw\fI|word1|...\fR ignored -       Exception words.
-.mh
-Three Part Titles.
-.bt
-\fB&tl\fI|\'left\|\'center\|\'right\|\'\fR     -       -       Three part title.
-.b1
-\fB&pc\fI|c\fR \fB%\fR off     -       Page number character.
-.b1
-\fB&lt\fI|\(+-N\fR     6.5\|in previous        E,\fBm\fR       Length of title.
-.mh
-Output Line Numbering.
-.bt
-\fB&nm\fI|\(+-N|M|S|I\fR       off     E       Number mode on or off, set parameters.
-.b1
-\fB&nn\fI|N\fR -       \fIN\(eq\fR1    E       Do not number next \fIN\fR lines.
-.mh
-Conditional Acceptance of Input
-.bt
-\fB&if\fI|c|anything\fR                -       -       If condition \fIc\fR true, accept \fIanything\fR as input,
-.b1
-                               for multi-line use \fI\e{anything\|\e}\fR.
-.b1
-\fB&if|!\fIc|anything\fR       -       -       If condition \fIc\fR false, accept \fIanything\fR.
-.b1
-\fB&if\fI|N|anything\fR        -       \fBu\fR If expression \fIN\fR > 0, accept \fIanything\fR.
-.b1
-\fB&if|!\fIN|anything\fR       -       \fBu\fR If expression \fIN\fR \(<= 0, accept \fIanything\fR.
-.b1
-\fB&if\fI|\|\'string1\|\'string2\|\'|anything\fR       -       If \fIstring1\fR identical to \fIstring2\fR,
-accept \fIanything\fR.
-.b1
-\fB&if|!\fI\|\'string1\|\'string2\|\'|anything\fR      -       If \fIstring1\fR not identical to \fIstring2\fR,
-accept \fIanything\fR.
-.b1
-\fB&ie\fI|c|anything\fR        -       \fBu\fR If portion of if-else; all above forms (like \fBif\fR).
-.b1
-\fB&el\fI|anything\fR          -       -       Else portion of if-else.
-.mh
-Environment Switching.
-.bt
-\fB&ev\fI|N\fR \fIN\(eq\fR0    previous        -       Environment switched (\fIpush down\fR).
-.mh
-Insertions from the Standard Input
-.bt
-\fB&rd\fI|prompt\fR\fR -       \fIprompt=\s-1\fRBEL\s+1        -       Read insertion.
-.b1
-\fB&ex\fR      -       -       -       \
-Exit from \*(NR\(sl\*(TR.
-.mh
-Input\(slOutput File Switching
-.bt
-\fB&so\fI|filename\fR          -       -       Switch source file \fI(push down)\fR.
-.b1
-\fB&nx\fI|filename\fR          end-of-file     -       Next file.
-.b1
-\fB&pi\fI|program\fR           -       -       Pipe output to \fIprogram\fR (\*(NR only).
-.mh
-Miscellaneous
-.bt
-\fB&mc\fI|c|N\fR       -       off     E,\fBm\fR       Set margin character \fIc\fR and separation \fIN\fR.
-.b1
-\fB&tm\fI|string\fR    -       newline -       Print \fIstring\fR on terminal \
-(\s-1UNIX\s+1 standard message output).
-.b1
-\fB&ig\fI|yy\fR        -       \fI.yy=\fB..\fR -       Ignore till call of \fIyy\fR.
-.b1
-\fB&pm\fI|t\fR -       all     -       Print macro names and sizes;
-.b1
-                               if \fIt\fR present, print only total of sizes.
-.b1
-.lg0
-\fB&fl\fR      -       -       B       Flush output buffer.
-.lg
-.mh
-Output and Error Messages
-.xx
-.nf
-.rm mx
-.ftR
-\l'\n(.lu'
-.ftB
-.xx
-.ta .3iC .6i
-       Notes-
-.xx
-.ftR
-       B       Request normally causes a break.
-       D       Mode or relevant parameters associated with current diversion level.
-       E       Relevant parameters are a part of the current environment.
-       O       Must stay in effect until logical output.
-       P       Mode must be still or again in effect at the time of physical output.
-       \fBv\fR,\fBp\fR,\fBm\fR,\fBu\fR Default scale indicator; if not specified, scale indicators are \fIignored\fR.
-.br
-.nr zz 11
-.de cl
-.ie \\n+(cl<\n(zz \{\
-.      po +\\n(.lu/\n(zzu
-.      rt\}
-.el \{.po 26i/27u\}
-..
-.nr cl 0 1
-.di zz
-.ta .3iR
-.nf
-.ps 8
-.vs 10
-ad     4
-af     8
-am     7
-as     7
-bd     2
-bp     3
-br     4
-c2     10
-cc     10
-ce     4
-ch     7
-cs     2
-cu     10
-da     7
-de     7
-di     7
-ds     7
-dt     7
-ec     10
-el     16
-em     7
-eo     10
-ev     17
-ex     18
-fc     9
-fi     4
-fl     20
-fp     2
-ft     2
-hc     13
-hw     13
-hy     13
-ie     16
-if     16
-ig     20
-in     6
-it     7
-lc     9
-lg     10
-li     10
-ll     6
-ls     5
-lt     14
-mc     20
-mk     3
-na     4
-ne     3
-nf     4
-nh     13
-nm     15
-nn     15
-nr     8
-ns     5
-nx     19
-os     5
-pc     14
-pi     19
-pl     3
-pm     20
-pn     3
-po     3
-ps     2
-rd     18
-rm     7
-rn     7
-rr     8
-rs     5
-rt     3
-so     19
-sp     5
-ss     2
-sv     5
-ta     9
-tc     9
-ti     6
-tl     14
-tm     20
-tr     10
-uf     10
-ul     10
-vs     5
-wh     7
-.di
-.nr aa \n(dn/\n(zz
-.ne \\n(aau+10p
-.sp
-.ftB
-Alphabetical Request and Section Number Cross Reference
-.ft
-.sp.3
-.wh \n(nlu+\n(aau cl
-.nr qq \n(nlu+\n(aau
-.ps
-.vs
-.mk
-.zz
-.rt
-.sp \n(.tu
-.ch cl 12i
-.sp
-.bp
-.nf
-.ftB
-Escape Sequences for Characters, Indicators, and Functions
-.ftR
-.xx
-.TS
-c2l
-c2l2l
-n2l2l.
-.ftI
-.bd I 3
-Section        Escape
-Reference      Sequence        Meaning
-.ftR
-.bd I
-.xx
-10.1   \fB\e\e\fR      \e (to prevent or delay the interpretation of \e\|)
-10.1   \fB\ee\fR       Printable version of the \fIcurrent\fR escape character.
-2.1    \fB\e\'\fR      \' (acute accent); equivalent to \fB\e(aa\fR
-2.1    \fB\e\`\fR      \` (grave accent); equivalent to \fB\e(ga\fR
-2.1    \fB\e\-\fR      \- Minus sign in the \fIcurrent\fR font
-7      \fB\e\^.\fR     Period (dot) (see \fBde\fR)
-11.1   \fB\e\fR(space) Unpaddable space-size space character
-11.1   \fB\e0\fR       Digit width space
-.tr ||
-11.1   \fB\e\||\fR     1\(sl6\|em narrow space character (zero width in \*(NR)
-.tr |
-11.1   \fB\e^\fR       1\(sl12\|em half-narrow space character (zero width in \*(NR)
-.tr &&
-4.1    \fB\e&\fR       Non-printing, zero width character
-.tr &.
-10.6   \fB\e!\fR       Transparent line indicator
-10.7   \fB\e"\fR       Beginning of comment
-7.3    \fB\e$\fIN\fR   Interpolate argument 1\(<=\fIN\fR\(<=9
-13     \fB\e%\fR       Default optional hyphenation character
-2.1    \fB\e(\fIxx\fR  Character named \fIxx\fR
-7.1    \fB\e\(**\fIx\fR,|\fB\e\(**(\fIxx\fR    Interpolate string \fIx\fR or \fIxx\fR
-9.1    \fB\ea\fR       Non-interpreted leader character
-12.3   \fB\eb\fI\'abc...\|\'\fR        Bracket building function
-4.2    \fB\ec\fR       Interrupt text processing
-11.1   \fB\ed\fR       Forward (down) 1\(sl2\|em vertical motion (1\(sl2 line in \*(NR)
-2.2    \fB\ef\fIx\fR,\fB\ef(\fIxx\fR,\fB\ef\fIN\fR     Change to font named \fIx\fR or \fIxx\fR, or position \fIN\fR
-11.1   \fB\eh\fI\'N|\'\fR      Local horizontal motion; move right \fIN\fR \fI(negative left)\fR
-11.3   \fB\ek\fIx\fR   Mark horizontal \fIinput\fR place in register \fIx\fR
-12.4   \fB\el\fI\|\'Nc\|\'\fR  Horizontal line drawing function (optionally with \fIc\fR\|)
-12.4   \fB\eL\fI\'Nc\|\'\fR    Vertical line drawing function (optionally with \fIc\fR\|)
-8      \fB\en\fIx\fR,\fB\en(\fIxx\fR   Interpolate number register \fIx\fR or \fIxx\fR
-12.1   \fB\eo\fI\'abc...\|\'\fR        Overstrike characters \fIa, b, c, ...\fR
-4.1    \fB\ep\fR       Break and spread output line
-11.1   \fB\er\fR       Reverse 1\|em vertical motion (reverse line in \*(NR)
-2.3    \fB\es\fIN\fR,\|\fB\es\fI\(+-N\fR       Point-size change function
-9.1    \fB\et\fR       Non-interpreted horizontal tab
-11.1   \fB\eu\fR       Reverse (up) 1\(sl2\|em vertical motion (1\(sl2 line in \*(NR)
-11.1   \fB\ev\fI\'N\|\|\'\fR   Local vertical motion; move down \fIN\fR \fI(negative up)\fR
-11.2   \fB\ew\fI\'string\|\'\fR        Interpolate width of \fIstring\fR
-5.2    \fB\ex\fI\'N\|\|\'\fR   Extra line-space function \fI(negative before, positive after)\fR
-12.2   \fB\ez\fIc\fR   Print \fIc\fR with zero width (without spacing)
-16     \fB\e{\fR       Begin conditional input
-16     \fB\e}\fR       End conditional input
-10.7   \fB\e\fR(newline)       Concealed (ignored) newline
--      \fB\e\fIX\fR    \fIX\fR, any character \fInot\fR listed above
-.TE
-.fi
-.sp
-The escape sequences
-\fB\e\e\fR,
-\fB\e\^.\fR,
-\fB\e"\fR,
-\fB\e$\fR,
-\fB\e\(**\fR,
-\fB\ea\fR,
-\fB\en\fR,
-\fB\et\fR,
-and
-\fB\e\fR(newline) are interpreted in \fIcopy mode\fR (\(sc7.2).
-.bp
-.ftB
-.nf
-Predefined General Number Registers
-.ft
-.TS
-c2l
-c2l2l
-n2l2l.
-.ftI
-.bd I 3
-Section        Register
-Reference      Name    Description
-.ftR
-.bd I
-.xx
-3      \fB%\fR Current page number.
-11.2   \fBct\fR        Character type (set by \fIwidth\fR function).
-7.4    \fBdl\fR        Width (maximum) of last completed diversion.
-7.4    \fBdn\fR        Height (vertical size) of last completed diversion.
--      \fBdw\fR        Current day of the week (1-7).
--      \fBdy\fR        Current day of the month (1-31).
-11.3   \fBhp\fR        Current horizontal place on \fIinput\fR line.
-15     \fBln\fR        Output line number.
--      \fBmo\fR        Current month (1-12).
-4.1    \fBnl\fR        Vertical position of last printed text base-line.
-11.2   \fBsb\fR        Depth of string below base line (generated by \fIwidth\fR function).
-11.2   \fBst\fR        Height of string above base line (generated by \fIwidth\fR function).
--      \fByr\fR        Last two digits of current year.
-.TE
-.sp
-.ftB
-Predefined Read-Only Number Registers
-.ftR
-.TS
-c2l
-c2l2l
-n2l2l.
-.ftI
-.bd I 3
-Section        Register
-Reference      Name    Description
-.ftR
-.bd I
-.xx
-7.3    \fB&$\fR        Number of arguments available at the current macro level.
--      \fB&A\fR        Set to 1 in \*(TR, if \fB\-a\fR option used; always 1 in \*(NR.
-11.1   \fB&H\fR        Available horizontal resolution in basic units.
--      \fB&T\fR        Set to 1 in \*(NR, if \fB\-T\fR option used; always 0 in \*(TR.
-11.1   \fB&V\fR        Available vertical resolution in basic units.
-5.2    \fB&a\fR        Post-line extra line-space most recently utilized \
-using \fB\ex\fI\'N\|\'\fR.
--      \fB&c\fR        Number of \fIlines\fR read from current input file.
-7.4    \fB&d\fR        Current vertical place in current diversion; equal to \fBnl\fR, if no diversion.
-2.2    \fB&f\fR        Current font as physical quadrant (1-4).
-4      \fB&h\fR        Text base-line high-water mark on current page or diversion.
-6      \fB&i\fR        Current indent.
-6      \fB&l\fR        Current line length.
-4      \fB&n\fR        Length of text portion on previous output line.
-3      \fB&o\fR        Current page offset.
-3      \fB&p\fR        Current page length.
-2.3    \fB&s\fR        Current point size.
-7.5    \fB&t\fR        Distance to the next trap.
-4.1    \fB&u\fR        Equal to 1 in fill mode and 0 in nofill mode.
-5.1    \fB&v\fR        Current vertical line spacing.
-11.2   \fB&w\fR        Width of previous character.
--      \fB&x\fR        Reserved version-dependent register.
--      \fB&y\fR        Reserved version-dependent register.
-7.4    \fB&z\fR        Name of current diversion.
-.TE
-.in0
-.fi
diff --git a/.ref-Research-V7/usr/doc/troff/m1 b/.ref-Research-V7/usr/doc/troff/m1
deleted file mode 100644 (file)
index 38634d7..0000000
+++ /dev/null
@@ -1,692 +0,0 @@
-.pn8
-.tr |
-.tr ~|
-.rm mx
-.br
-.ce
-.ftB
-.ps+2
-.rs
-.sp1.0i
-REFERENCE MANUAL
-.ftR
-.ps-2
-.sp
-.mh
-General Explanation
-.sc
-Form of input.
-Input consists of \fItext lines\fR, which are destined to be printed,
-interspersed with \fIcontrol lines\fR,
-which set parameters or otherwise control subsequent processing.
-Control lines begin with a \fIcontrol character\fR\(em\
-normally \fB.\fR (period) or \fB\'\fR (acute accent)\(em\
-followed by a one or two character name that specifies
-a basic \fIrequest\fR or the substitution of
-a user-defined \fImacro\fR in place of the control line.
-The control character \fB\'\fR suppresses the \fIbreak\fR function\(em\
-the forced output of a partially filled line\(em\
-caused by certain requests.
-The control character may be separated from the request/macro name by
-white space (spaces and/or tabs) for esthetic reasons.
-Names must be followed by either
-space or newline.
-Control lines with unrecognized names are ignored.
-.pg
-Various special functions may be introduced anywhere in the input by
-means of an \fIescape\fR character, normally \fB\e\fR.
-For example, the function
-\fB\en\fIR\fR
-causes the interpolation of the contents of the
-\fInumber register R\fR
-in place of the function;
-here \fIR\fR is either a single character name
-as in \fB\en\fIx\fR,
-or left-parenthesis-introduced, two-character name as in \fB\en(\fIxx\fR.
-.sc
-Formatter and device resolution.
-\*(TR internally uses 432 units\(slinch, corresponding to
-the Graphic Systems phototypesetter
-which has a horizontal resolution of
-1\(sl432 inch and a vertical resolution
-of 1\(sl144 inch.
-\*(NR internally uses 240 units\(slinch,
-corresponding to the least common multiple of the
-horizontal and vertical resolutions of various
-typewriter-like output devices.
-\*(TR rounds horizontal\(slvertical numerical parameter input to the actual
-horizontal\(slvertical resolution of the Graphic Systems typesetter.
-\*(NR similarly rounds numerical input to the actual resolution
-of the output device indicated by the \fB\(miT\fR option
-(default Model 37 Teletype).
-.sc
-Numerical parameter input.
-Both \*(NR and \*(TR
-accept numerical input with the appended scale
-indicators
-shown in the following table,
-where
-\fIS\fR is the current type size in points,
-\fIV\fR is the current vertical line spacing in
-basic units,
-and
-\fIC\fR is a \fInominal character width\fR in basic units.
-.TS
-center box;
-c|c|ls
-c|c|ll
-c|l|l|l.
-Scale          Number of basic units
-Indicator      Meaning \*(TR   \*(NR
-_
-\fBi\fR        Inch    432     240
-\fBc\fR        Centimeter      432\(mu50\(sl127        240\(mu50\(sl127
-\fBP\fR        Pica = 1\(sl6 inch      72      240\(sl6
-\fBm\fR        Em = \fIS\fR points     6\(mu\fIS\fR    \fIC\fR
-\fBn\fR        En = Em\(sl2    3\(mu\fIS\fR    \fIC, same as Em\fR
-\fBp\fR        Point = 1\(sl72 inch    6       240\(sl72
-\fBu\fR        Basic unit      1       1
-\fBv\fR        Vertical line space     \fIV\fR \fIV\fR
-none   Default, see below
-.TE
-In \*(NR, \fIboth\fR the em and the en are taken to be equal to the \fIC\fR,
-which is output-device dependent;
-common values are 1\(sl10 and 1\(sl12 inch.
-Actual character widths in \*(NR need not be all the same and constructed characters
-such as \(mi> (\(->) are often extra wide.
-The default scaling is ems for the horizontally-oriented requests
-and functions
-\fBll\fR,
-\fBin\fR,
-\fBti\fR,
-\fBta\fR,
-\fBlt\fR,
-\fBpo\fR,
-\fBmc\fR,
-\fB\eh\fR,
-and
-\fB\el\fR;
-\fIV\^\fRs
-for the vertically-oriented requests and functions
-\fBpl\fR,
-\fBwh\fR,
-\fBch\fR,
-\fBdt\fR,
-\fBsp\fR,
-\fBsv\fR,
-\fBne\fR,
-\fBrt\fR,
-\fB\ev\fR,
-\fB\ex\fR,
-and
-\fB\eL\fR;
-\fBp\fR for the \fBvs\fR request;
-and \fBu\fR for the requests
-\fBnr\fR,
-\fBif\fR,
-and
-\fBie\fR.
-\fIAll\fR other requests ignore any scale indicators.
-When a number register containing an already appropriately scaled number
-is interpolated to provide numerical input,
-the unit scale indicator
-\fBu\fR may need to be appended to prevent
-an additional inappropriate default scaling.
-The number, \fIN\fR, may be specified in decimal-fraction form
-but the parameter finally stored is rounded to an integer number of basic units.
-.pg
-The \fIabsolute position\fR indicator \fB~\fR may be prepended
-to a number \fIN\fR
-to generate the distance to the vertical or horizontal place \fIN\fR.
-For vertically-oriented requests and functions, \fB~\|\fIN\fR
-becomes the distance in basic units from the current vertical place on the page or in a \fIdiversion\fR (\(sc7.4)
-to the the vertical place \fIN\fR.
-For \fIall\fR other requests and functions,
-\fB~\|\fIN\fR
-becomes the distance from
-the current horizontal place on the \fIinput\fR line to the horizontal place \fIN\fR.
-For example,
-.x1
-\&\fB.sp  ~\|3.2c\fR
-.x2
-will space \fIin the required direction\fR to 3.2\|centimeters from the top of the page.
-.sc
-.tr &&
-Numerical expressions.
-Wherever numerical input is expected an expression involving parentheses,
-the arithmetic operators \fB\(pl\fR, \fB\(mi\fR, \fB\(sl\fR, \fB\(**\fR, \fB%\fR (mod),
-and the logical operators
-\fB<\fR,
-\fB>\fR,
-\fB<\(eq\fR,
-\fB>\(eq\fR,
-\fB\(eq\fR (or \fB\(eq\(eq\fR),
-\fB&\fR\ (and),
-\fB:\fR\ (or)
-may be used.
-Except where controlled by parentheses, evaluation of expressions is left-to-right;
-there is no operator precedence.
-In the case of certain requests, an initial \fB\(pl\fR or \fB\(mi\fR is stripped
-and interpreted as an increment or decrement indicator respectively.
-In the presence of default scaling, the desired scale indicator must be
-attached to \fIevery\fR number in an expression
-for which the desired and default scaling differ.
-For example,
-if the number register \fBx\fR contains 2
-and the current point size is 10,
-then
-.br
-.tr &.
-.x1
-.ftB
-\&.ll  (4.25i\(pl\enxP\(pl3)\(sl2u
-.ftR
-.x2
-will set the line length to 1\(sl2 the sum of 4.25 inches \(pl 2 picas \(pl 30 points.
-.sc
-Notation.
-Numerical parameters are indicated in this manual in two ways.
-\(+-\fIN\fR means that the argument may take the forms \fIN\fR, \(pl\fIN\fR, or \(mi\fIN\fR and
-that the corresponding effect is to set the affected parameter
-to \fIN\fR, to increment it by \fIN\fR, or to decrement it by \fIN\fR respectively.
-Plain \fIN\fR means that an initial algebraic sign is \fInot\fR
-an increment indicator,
-but merely the sign of \fIN\fR.
-Generally, unreasonable numerical input is either ignored
-or truncated to a reasonable value.
-For example,
-most requests expect to set parameters to non-negative
-values;
-exceptions are
-\fBsp\fR,
-\fBwh\fR,
-\fBch\fR,
-\fBnr\fR,
-and
-\fBif\fR.
-The requests
-\fBps\fR,
-\fBft\fR,
-\fBpo\fR,
-\fBvs\fR,
-\fBls\fR,
-\fBll\fR,
-\fBin\fR,
-and
-\fBlt\fR
-restore the \fIprevious\fR parameter value in the \fIabsence\fR
-of an argument.
-.pg
-Single character arguments are indicated by single lower case letters
-and
-one/two character arguments are indicated by a pair of lower case letters.
-Character string arguments are indicated by multi-character mnemonics.
-.mh
-Font and Character Size Control
-.sc
-Character set.
-The \*(TR character set consists of the Graphics Systems Commercial|II
-character set plus a Special Mathematical Font character
-set\(emeach having 102 characters.
-These character sets are shown in the attached Table|I.
-All \s-1ASCII\s+1 characters are included,
-with some on the Special Font.
-With three exceptions, the \s-1ASCII\s+1 characters are input as themselves,
-and non-\s-1ASCII\s+1 characters are input in the form \fB\e(\fIxx\fR where
-\fIxx\fR is a two-character name given in the attached Table|II.
-The three \s-1ASCII\s+1 exceptions are mapped as follows:
-.TS
-center box;
-cs|cs
-cc|cc
-cl|cl.
-\s-1ASCII\s+1 Input    Printed by \*(TR
-Character      Name    Character       Name
-_
-\'     acute accent    '       close quote
-\`     grave accent    `       open quote
-\(mi   minus   -       hyphen
-.TE
-.tr ~~
-The characters
-\fB\'\fR,
-\fB\`\fR,
-and
-\fB\-\fR
-may be input
-by \fB\e\'\fR, \fB\e\`\fR, and \fB\e\-\fR respectively or by their names (Table II).
-The \s-1ASCII\s+1 characters \fB@\fR, \fB#\fR, \fB"\fR, \fB\(aa\fR, \fB\(ga\fR, \fB<\fR, \fB>\fR, \fB\e\fR, \fB{\fR, \fB}\fR, \fB~\fR, \fB^\fR, and \fB\(ul\fR exist
-only on the Special Font and are printed as a 1-em space if that Font
-is not mounted.
-.pg
-.tr ~|
-\*(NR understands the entire \*(TR character set,
-but can in general print only \s-1ASCII\s+1
-characters,
-additional characters as may be available on
-the output device,
-such characters as may be able to be constructed
-by overstriking or other combination,
-and those that can reasonably be mapped
-into other printable characters.
-The exact behavior is determined by a driving
-table prepared for each device.
-The characters
-\fB\'\fR,
-\fB\`\fR,
-and
-\fB\(ul\fR
-print
-as themselves.
-.sc
-Fonts.
-The default mounted fonts are
-Times Roman (\fBR\fR),
-Times Italic (\fBI\fR),
-Times Bold (\fBB\fR),
-and the Special Mathematical Font (\fBS\fR)
-on physical typesetter positions 1, 2, 3, and 4 respectively.
-These fonts are used in this document.
-The \fIcurrent\fR font, initially Roman, may be changed
-(among the mounted fonts)
-by use of the \fBft\fR request,
-or by imbedding at any desired point
-either \fB\ef\fIx\fR, \fB\ef(\fIxx\fR, or \fB\ef\fIN\fR
-where
-\fIx\fR and \fIxx\fR are the name of a mounted font
-and \fIN\fR is a numerical font position.
-It is \fInot\fR necessary to change to the Special font;
-characters on that font are automatically handled.
-A request for a named but not-mounted font is \fIignored\fR.
-\*(TR can be informed that any particular font is mounted
-by use of the \fBfp\fR request.
-The list of known fonts is installation dependent.
-In the subsequent discussion of font-related requests,
-\fIF\fR represents either a one\(sltwo-character
-font name or the numerical font position, 1-4.
-The current font is available (as numerical position) in the read-only number register \fB.f\fR.
-.pg
-\*(NR understands font control
-and normally underlines Italic characters (see \(sc10.5).
-.sc
-Character size.
-Character point sizes available on the Graphic Systems typesetter are
-6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, and 36.
-This is a range of 1\(sl12 inch to 1\(sl2 inch.
-The \fBps\fR request is used to change or restore the point size.
-Alternatively the point size may be changed between any two characters
-by imbedding a \fB\es\fIN\fR
-at the desired point
-to set the size to \fIN\fR,
-or a \fB\es\fI\(+-N\fR (1\(<=\fIN\fR\(<=9)
-to increment\(sldecrement the size by \fIN\fR;
-\fB\es0\fR restores the \fIprevious\fR size.
-Requested point size values that are between two valid
-sizes yield the larger of the two.
-The current size is available in the \fB.s\fR register.
-\*(NR ignores type size control.
-.h1 *
-.fn
-.xx
-*Notes are explained at the end of the Summary and Index above.
-.ef
-.bt
-\fB&ps\fI|\(+-N\fR     10\|point       previous        E       Point size
-set to \(+-\fIN\fR.
-Alternatively imbed \fB\es\fIN\fR or \fB\es\fI\(+-N\fR.
-Any positive size value may be requested;
-if invalid, the next larger valid size will result, with a
-maximum of 36.
-A paired sequence
-\(pl\fIN\fR,\|\(mi\fIN\fR
-will work because the previous requested value is also remembered.
-Ignored in \*(NR.
-.bt
-\fB&ss\fI|N\fR 12\(sl36\|em    ignored E       Space-character size
-is set to \fIN\fR\(sl36\|ems.
-This size is the minimum word spacing in adjusted text.
-Ignored in \*(NR.
-.bt
-\fB&cs\|\fIF\|N\|M\fR  off     -       P       Constant character space
-(width) mode is
-set on for font \fIF\fR (if mounted); the width of every character will be
-taken to be \fIN\fR\(sl36 ems.
-If \fIM\fR is absent,
-the em is that of the character's point size;
-if \fIM\fR is given,
-the em is \fIM\fR-points.
-All affected characters
-are centered in this space, including those with an actual width
-larger than this space.
-Special Font characters occurring while the current font
-is \fIF\fR are also so treated.
-If \fIN\fR is absent, the mode is turned off.
-The mode must be still or again in effect when the characters are physically printed.
-Ignored in \*(NR.
-.bt
-\fB&bd\fI|F|N\fR       off     -       P       The characters in font \fIF\fR will be artificially
-emboldened by printing each one twice, separated by \fIN\fR\^\(mi1 basic units.
-A reasonable value for \fIN\fR is 3 when the character size is in the vicinity
-of 10 points.
-If \fIN\fR is missing the embolden mode is turned off.
-The column heads above were printed with \fB.bd|I|3\fR.
-The mode must be still or again in effect when the characters are physically printed.
-Ignored in \*(NR.
-.bt
-\fB&bd|S|\fIF|N\fR     off     -       P       The characters in the Special Font
-will be emboldened whenever the current font is \fIF\fR.
-This manual was printed with \fB.bd\|S\|B\|3\fR.
-The mode must be still or again in effect when the characters are physically printed.
-.bt
-\fB&ft|\fIF\fR Roman   previous        E       Font changed to
-\fIF\fR.
-Alternatively, imbed \fB\ef\fIF\fR.
-The font name \fBP\fR is reserved to mean the previous font.
-.bt
-\fB&fp|\fIN|F\fR       R,I,B,S ignored -       Font position.
-This is a statement
-that a font named \fIF\fR is mounted on position \fIN\fR (1-4).
-It is a fatal error if \fIF\fR is not known.
-The phototypesetter has four fonts physically mounted.
-Each font consists of a film strip which can be mounted on a numbered
-quadrant of a wheel.
-The default mounting sequence assumed by \*(TR is
-R, I, B, and S on positions 1, 2, 3 and 4.
-.mh
-Page control
-.pg
-Top and bottom margins are \fInot\fR automatically provided;
-it is conventional to define two \fImacros\fR and to set \fItraps\fR
-for them at vertical positions 0 (top) and \fI\(miN\fR (\fIN\fR from the bottom).
-See \(sc7 and Tutorial Examples \(scT2.
-A pseudo-page transition onto the \fIfirst\fR page occurs
-either when the first \fIbreak\fR occurs or
-when the first \fInon-diverted\fR text processing occurs.
-Arrangements
-for a trap to occur at the top of the first page
-must be completed before this transition.
-In the following, references to the \fIcurrent diversion\fR (\(sc7.4)
-mean that the mechanism being described works during both
-ordinary and diverted output (the former considered as the top diversion level).
-.pg
-The useable page width on the Graphic Systems phototypesetter
-is about 7.54|inches,
-beginning about 1\(sl27|inch from the left edge of the
-8|inch wide, continuous roll paper.
-The physical limitations on \*(NR output
-are output-device dependent.
-.h1
-.bt
-\fB&pl\fI|\(+-N\fR     11\|in  11\|in  \fBv\fR Page length set to \fI\(+-N\fR.
-The internal limitation is about 75|inches in \*(TR and
-about 136|inches in \*(NR.
-The current page length is available in the \fB.p\fR register.
-.bt
-\fB&bp\fI|\(+-N\fR     \fIN\(eq\fR1    -       B*,\fBv\fR      Begin page.
-.fn
-.xx
-*The use of "\ \fB\'\fR\ " as control character (instead of "\fB.\fR")
-suppresses the break function.
-.ef
-The current page is ejected and a new page is begun.
-If \fI\(+-N\fR is given, the new page number will be \fI\(+-N\fR.
-Also see request \fBns\fR.
-.bt
-\fB&pn\fI|\(+-N\fR     \fIN\fR\(eq1    ignored -       Page number.
-The next page (when it occurs) will have the page number \fI\(+-N\fR.
-A \fBpn\fR must occur before the initial pseudo-page transition
-to effect the page number of the first page.
-The current page number is in the \fB%\fR register.
-.bt
-\fB&po\fI|\(+-N\fR     0;|26\(sl27\|in\(dg     previous        \fBv\fR Page offset.
-.fn
-.xx
-\(dgValues separated by ";" are for \*(NR and \*(TR respectively.
-.ef
-The current \fIleft margin\fR is set to \fI\(+-N\fR.
-The \*(TR initial value provides about 1|inch of paper margin
-including the physical typesetter margin of 1\(sl27|inch.
-In \*(TR the maximum (line-length)+(page-offset) is about 7.54 inches.
-See \(sc6.
-The current page offset is available in the \fB.o\fR register.
-.bt
-\fB&ne\fI|N\fR -       \fIN\(eq\fR1\|\fIV\fR   D,\fBv\fR       Need \fIN\fR vertical space.
-If the distance, \fID\fR, to the next trap position (see \(sc7.5) is less than \fIN\fR,
-a forward vertical space of size \fID\fR occurs,
-which will spring the trap.
-If there are no remaining
-traps on the page,
-\fID\fR is the distance to the bottom of the page.
-If \fID\|<\|V\fR, another line could still be output
-and spring the trap.
-In a diversion, \fID\fR is the distance to the \fIdiversion trap\fR, if any,
-or is very large.
-.bt
-\fB&mk\fI|R\fR none    internal        D       Mark the \fIcurrent\fR vertical place
-in an internal register (both associated with the current diversion level),
-or in register \fIR\fR, if given.
-See \fBrt\fR request.
-.bt
-\fB&rt\fI|\(+-N\fR     none    internal        D,\fBv\fR       Return \fIupward only\fR to a marked vertical place
-in the current diversion.
-If \fI\(+-N\fR (w.r.t. current place) is given,
-the place is \fI\(+-N\fR from the top of the page or diversion
-or, if \fIN\fR is absent, to a
-place marked by a previous \fBmk\fR.
-Note that the \fBsp\fR request (\(sc5.3) may be used
-in all cases instead of \fBrt\fR
-by spacing to the absolute place stored in a explicit register;
-e.|g. using the sequence \fB.mk|\fIR\fR ... \fB.sp|~\|\en\fIR\fBu\fR.
-.mh
-Text Filling, Adjusting, and Centering
-.sc
-Filling and adjusting.
-Normally,
-words are collected from input text lines
-and assembled into a output text line
-until some word doesn't fit.
-An attempt is then made
-the hyphenate the word in effort to assemble a part
-of it into the output line.
-The spaces between the words on the output line
-are then increased to spread out the line
-to the current \fIline length\fR
-minus any current \fIindent\fR.
-A \fIword\fR is any string of characters delimited by
-the \fIspace\fR character or the beginning/end of the input line.
-Any adjacent pair of words that must be kept together
-(neither split across output lines nor spread apart
-in the adjustment process)
-can be tied together by separating them with the
-\fIunpaddable space\fR character
-"\fB\e\ \ \fR" (backslash-space).
-The adjusted word spacings are uniform in \*(TR
-and the minimum interword spacing can be controlled
-with the \fBss\fR request (\(sc2).
-In \*(NR, they are normally nonuniform because of
-quantization to character-size spaces;
-however,
-the command line option \fB\-e\fR causes uniform
-spacing with full output device resolution.
-Filling, adjustment, and hyphenation (\(sc13) can all be
-prevented or controlled.
-The \fItext length\fR on the last line output is available in the \fB.n\fR register,
-and text base-line position on the page for this line is in the \fBnl\fR register.
-The text base-line high-water mark (lowest place) on the current page is in
-the \fB.h\fR register.
-.pg
-An input text line ending with \fB.\fR\^, \fB?\fR, or \fB!\fR is taken
-to be the end of a \fIsentence\fR, and an additional space character is
-automatically provided during filling.
-Multiple inter-word space characters found in the input are retained,
-except for trailing spaces;
-initial spaces also cause a \fIbreak\fR.
-.pg
-When filling is in effect, a \fB\ep\fR may be imbedded or attached to a word to
-cause a \fIbreak\fR at the \fIend\fR of the word and have the resulting output
-line \fIspread out\fR to fill the current line length.
-.pg
-.tr &&
-A text input line that happens to begin
-with a control character can
-be made to not look like a control line
-by prefacing it with
-the non-printing, zero-width filler character \fB\e&\fR.
-Still another way is to specify output translation of some
-convenient character into the control character
-using \fBtr\fR (\(sc10.5).
-.tr &.
-.sc
-Interrupted text.
-The copying of a input line in \fInofill\f (non-fill) mode can be \fIinterrupted\fR
-by terminating
-the partial line with a \fB\ec\fR.
-The \fInext\fR encountered input text line will be considered to be a continuation
-of the same line of input text.
-Similarly,
-a word within \fIfilled\fR text may be interrupted by terminating the
-word (and line) with \fB\ec\fR;
-the next encountered text will be taken as a continuation of the
-interrupted word.
-If the intervening control lines cause a break,
-any partial line will be forced out along with any partial word.
-.h1
-.bt
-\fB&br\fR      -       -       B       Break.
-The filling of the line currently
-being collected is stopped and
-the line is output without adjustment.
-Text lines beginning with space characters
-and empty text lines (blank lines) also cause a break.
-.bt
-.lg0
-\fB&fi\fR      \(fill|on       -       B,E     Fill subsequent output lines.
-.lg
-The register \fB.u\fR is 1 in fill mode and 0 in nofill mode.
-.bt
-\fB&nf\fR      fill|on -       B,E     Nofill.
-Subsequent output lines are \fIneither\fR filled \fInor\fR adjusted.
-Input text lines are copied directly to output lines
-\fIwithout regard\fR for the current line length.
-.bt
-\fB&ad\fI|c\fR adj,both        adjust  E       \
-Line adjustment is begun.
-If fill mode is not on, adjustment will be deferred until
-fill mode is back on.
-If the type indicator \fIc\fR is present,
-the adjustment type is changed as shown in the following table.
-.TS
-center box;
-c|c
-c|l.
-Indicator      Adjust Type
-_
-\fBl\fR        adjust left margin only
-\fBr\fR        adjust right margin only
-\fBc\fR        center
-\fBb\fR or \fBn\fR     adjust both margins
-absent unchanged
-.TE
-.bt
-\fB&na\fR      adjust  -       E       Noadjust.
-Adjustment is turned off;
-the right margin will be ragged.
-The adjustment type for \fBad\fR is not changed.
-Output line filling still occurs if fill mode is on.
-.bt
-\fB&ce\fI|N\fR off     \fIN\fR\(eq1    B,E     Center the next \fIN\fR input text lines
-within the current (line-length minus indent).
-If \fIN\fR\(eq\^0, any residual count is cleared.
-A break occurs after each of the \fIN\fR input lines.
-If the input line is too long,
-it will be left adjusted.
-.mh
-Vertical Spacing
-.sc
-Base-line spacing.
-The vertical spacing \fI(V)\fR between the base-lines of successive
-output lines can be set
-using the \fBvs\fR request
-with a resolution of 1\(sl144\|inch\|\(eq\|1\(sl2|point
-in \*(TR,
-and to the output device resolution in \*(NR.
-\fIV\fR must be large enough to accommodate the character sizes
-on the affected output lines.
-For the common type sizes (9-12 points),
-usual typesetting practice is to set \fIV\fR to 2\ points greater than the
-point size;
-\*(TR default is 10-point type on a 12-point spacing
-(as in this document).
-The current \fIV\fR is available in the \fB.v\fR register.
-Multiple-\fIV\|\fR line separation (e.\|g. double spacing) may be requested
-with \fBls\fR.
-.sc
-Extra line-space.
-If a word contains a vertically tall construct requiring
-the output line containing it to have extra vertical space
-before and\(slor after it,
-the \fIextra-line-space\fR function \fB\ex\fI\'N\|\|\'\fR
-can be imbedded in or attached to that word.
-In this and other functions having a pair of delimiters around
-their parameter (here \fB\'\fR\|),
-the delimiter choice is arbitrary,
-except that it can't look like the continuation of a number expression for \fIN\fR.
-If \fIN\fR is negative,
-the output line containing the word will
-be preceded by \fIN\fR extra vertical space;
-if \fIN\fR is positive,
-the output line containing the word
-will be followed by \fIN\fR extra vertical space.
-If successive requests for extra space apply to the same line,
-the maximum values are used.
-The most recently utilized post-line extra line-space is available in the \fB.a\fR register.
-.sc
-Blocks of vertical space.
-A block of vertical space is ordinarily requested using \fBsp\fR,
-which honors the \fIno-space\fR mode and which does
-not space \fIpast\fR a trap.
-A contiguous block of vertical space may be reserved using \fBsv\fR.
-.h1
-.bt
-\fB&vs\fI\|N\fR        1\(sl6in;12pts  previous        E,\fBp\fR       Set vertical base-line spacing size \fIV\fR.
-Transient \fIextra\fR vertical space available with \fB\ex\fI\'N\|\|\'\fR (see above).
-.bt
-\fB&ls\fI\|N\fR        \fIN\(eq\^\fR1  previous        E       \fILine\fR spacing
-set to \fI\(+-N\fR.
-\fIN\(mi\fR1 \fIV\fR\^s \fI(blank lines)\fR are
-appended to each output text line.
-Appended blank lines are omitted, if the text or previous appended blank line reached a trap position.
-.bt
-\fB&sp\fI|N\fR -       \fIN\fR\(eq1\fIV\fR     B,\fBv\fR       Space vertically in \fIeither\fR direction.
-If \fIN\fR is negative, the motion is \fIbackward\fR (upward)
-and is limited to the distance to the top of the page.
-Forward (downward) motion is truncated to the distance to the
-nearest trap.
-If the no-space mode is on,
-no spacing occurs (see \fBns\fR, and \fBrs\fR below).
-.bt
-\fB&sv\fI|N\fR -       \fIN\(eq\fR1\fIV\fR     \fBv\fR Save a contiguous vertical block of size \fIN\fR.
-If the distance to the next trap is greater
-than \fIN\fR, \fIN\fR vertical space is output.
-No-space mode has \fIno\fR effect.
-If this distance is less than \fIN\fR,
-no vertical space is immediately output,
-but \fIN\fR is remembered for later output (see \fBos\fR).
-Subsequent \fBsv\fR requests will overwrite any still remembered \fIN\fR.
-.bt
-\fB&os\fR      -       -       -       Output saved vertical space.
-No-space mode has \fIno\fR effect.
-Used to finally output a block of vertical space requested
-by an earlier \fBsv\fR request.
-.bt
-\fB&ns\fR      space   -       D       No-space mode turned on.
-When on, the no-space mode inhibits \fBsp\fR requests and
-\fBbp\fR requests \fIwithout\fR a next page number.
-The no-space mode is turned off when a line of
-output occurs, or with \fBrs\fR.
-.bt
-\fB&rs\fR      space   -       D       Restore spacing.
-The no-space mode is turned off.
-.bt
-Blank|text|line.       -       B       Causes a break and
-output of a blank line exactly like \fBsp|1\fR.
diff --git a/.ref-Research-V7/usr/doc/troff/m2 b/.ref-Research-V7/usr/doc/troff/m2
deleted file mode 100644 (file)
index 009f265..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-.tr |
-.rm mx
-.br
-.mh
-Line Length and Indenting
-.pg
-The maximum line length for fill mode may be set with \fBll\fR.
-The indent may be set with \fBin\fR;
-an indent applicable to \fIonly\fR the \fInext\fR output line may be set with \fBti\fR.
-The line length includes indent space but \fInot\fR
-page offset space.
-The line-length minus the indent is the basis for centering with \fBce\fR.
-The effect of \fBll\fR, \fBin\fR, or \fBti\fR
-is delayed, if a partially collected line exists,
-until after that line is output.
-In fill mode the length of text on an output line is less than or equal to
-the line length minus the indent.
-The current line length and indent are available in registers \fB.l\fR and \fB.i\fR respectively.
-The length of \fIthree-part titles\fR produced by \fBtl\fR
-(see \(sc14) is \fIindependently\fR set by \fBlt\fR.
-.h1
-.bt
-\fB&ll\fI|\(+-N\fR     6.5\|in previous        E,\fBm\fR       Line length is set to \(+-\fIN\fR.
-In \*(TR the maximum (line-length)+(page-offset) is about 7.54 inches.
-.bt
-\fB&in\fI|\(+-N\fR     \fIN\(eq\^\fR0  previous        B,E,\fBm\fR     Indent is set to \fI\(+-N\fR.
-The indent is prepended to each output line.
-.bt
-\fB&ti\fI|\(+-N\fR     -       ignored B,E,\fBm\fR     Temporary indent.
-The \fInext\fR output text line will be indented a distance \fI\(+-N\fR
-with respect to the current indent.
-The resulting total indent may not be negative.
-The current indent is not changed.
-.mh
-Macros, Strings, Diversion, and Position Traps
-.sc
-Macros and strings.
-A \fImacro\fR is a named set of arbitrary \fIlines\fR that may be invoked by name or
-with a \fItrap\fR.
-A \fIstring\fR is a named string of \fIcharacters\fR,
-\fInot\fR including a newline character,
-that may be interpolated by name at any point.
-Request, macro, and string names share the \fIsame\fR name list.
-Macro and string names
-may be one or two characters long and may usurp previously defined
-request, macro, or string names.
-Any of these entities may be renamed with \fBrn\fR
-or removed with \fBrm\fR.
-Macros are created by \fBde\fR and \fBdi\fR, and appended to by \fBam\fR and \fBda\fR;
-\fBdi\fR and \fBda\fR cause normal output to be stored in a macro.
-Strings are created by \fBds\fR and appended to by \fBas\fR.
-A macro is invoked in the same way as a request;
-a control line beginning \fB.\fIxx\fR will interpolate the contents of macro \fIxx\fR.
-The remainder of the line may contain up to nine \fIarguments\fR.
-The strings \fIx\fR and \fIxx\fR are interpolated at any desired point with
-\fB\e\(**\fIx\fR and \fB\e\(**(\fIxx\fR respectively.
-String references and macro invocations may be nested.
-.sc
-Copy mode input interpretation.
-During the definition and extension
-of strings and macros (not by diversion)
-the input is read in \fIcopy mode\fR.
-The input is copied without interpretation
-\fIexcept\fR that:
-.x1
-.ds + \v'-.1m'\s-4\(bu\s+4\v'+.1m'
-\*+ The contents of number registers indicated by \fB\en\fR are interpolated.
-\*+ Strings indicated by \fB\e\(**\fR are interpolated.
-\*+ Arguments indicated by \fB\e$\fR are interpolated.
-\*+ Concealed newlines indicated by \fB\e\fR(newline) are eliminated.
-\*+ Comments indicated by \fB\e"\fR are eliminated.
-\*+ \fB\et\fR and \fB\ea\fR are interpreted as \s-1ASCII\s+1 horizontal tab and \s-1SOH\s+1 respectively (\(sc9).
-\*+ \fB\e\e\fR is interpreted as \fB\e\fR.
-\*+ \fB\e.\fR is interpreted as "\fB.\fR".
-.x2
-These interpretations can be suppressed by
-prepending
-a \fB\e\fR.
-For example, since \fB\e\e\fR maps into a \fB\e\fR, \fB\e\en\fR will copy as \fB\en\fR which
-will be interpreted as a number register indicator when the
-macro or string is reread.
-.sc
-Arguments.
-When a macro is invoked by name, the remainder of the line is
-taken to contain up to nine arguments.
-The argument separator is the space character, and arguments
-may be surrounded by double-quotes to permit imbedded space characters.
-Pairs of double-quotes may be imbedded in double-quoted arguments to
-represent a single double-quote.
-If the desired arguments won't fit on a line,
-a concealed newline may be used to continue on the next line.
-.pg
-When a macro is invoked the \fIinput level\fR is \fIpushed down\fR and
-any arguments available at the previous level become unavailable
-until the macro is completely read and the previous level is restored.
-A macro's own arguments can be interpolated at \fIany\fR point
-within the macro with \fB\e$\fIN\fR, which interpolates the \fIN\fR\^th
-argument
-(1\(<=\fIN\fR\^\(<=9).
-If an invoked argument doesn't exist,
-a null string results.
-For example, the macro \fIxx\fR may be defined by
-.x1
-.ftB
-.ta .75i
-&de xx \e"begin definition
-Today is \e\e$1 the \e\e$2.
-&.     \e"end definition
-.ftR
-.x2
-and called by
-.x1
-.ftB
-&xx Monday 14th
-.ftR
-.x2
-to produce the text
-.x1
-.ftB
-Today is Monday the 14th.
-.ftR
-.x2
-Note that the \fB\e$\fR
-was concealed in the definition with a prepended \fB\e\fR.
-The number of currently available
-arguments is in the \fB.$\fR register.
-.pg
-No arguments are available at the top (non-macro) level
-in this implementation.
-Because string referencing is implemented
-as a input-level push down,
-no arguments are available from \fIwithin\fR a string.
-No arguments are available within a trap-invoked macro.
-.pg
-Arguments are copied in \fIcopy mode\fR onto a stack
-where they are available for reference.
-The mechanism does not allow an argument to contain
-a direct reference to a \fIlong\fR string
-(interpolated at copy time) and it is advisable to
-conceal string references (with an extra \fB\e\fR\|)
-to delay interpolation until argument reference time.
-.sc
-Diversions.
-Processed output may be diverted into a macro for purposes
-such as footnote processing (see Tutorial \(scT5)
-or determining the horizontal and vertical size of some text for
-conditional changing of pages or columns.
-A single diversion trap may be set at a specified vertical position.
-The number registers \fBdn\fR and \fBdl\fR respectively contain the
-vertical and horizontal size of the most
-recently ended diversion.
-Processed text that is diverted into a macro
-retains the vertical size of each of its lines when reread
-in \fInofill\fR mode
-regardless of the current \fIV\fR.
-Constant-spaced (\fBcs\fR) or emboldened (\fBbd\fR) text that is diverted
-can be reread correctly only if these modes are again or still in effect
-at reread time.
-One way to do this is to imbed in the diversion the appropriate
-\fBcs\fR or \fBbd\fR requests with the \fItransparent\fR
-mechanism described in \(sc10.6.
-.pg
-Diversions may be nested
-and certain parameters and registers
-are associated
-with the current diversion level
-(the top non-diversion level may be thought of as the
-0th diversion level).
-These are the diversion trap and associated macro,
-no-space mode,
-the internally-saved marked place (see \fBmk\fR and \fBrt\fR),
-the current vertical place (\fB.d\fR register),
-the current high-water text base-line (\fB.h\fR register),
-and the current diversion name (\fB.z\fR register).
-.sc
-Traps.
-Three types of trap mechanisms are available\(empage traps, a diversion trap, and
-an input-line-count trap.
-Macro-invocation traps may be planted using \fBwh\fR at any page position including the top.
-This trap position may be changed using \fBch\fR.
-Trap positions at or below the bottom of the page
-have no effect unless or until
-moved to within the page or rendered effective by an increase in page length.
-Two traps may be planted at the \fIsame\fR position only by first planting them at different
-positions and then moving one of the traps;
-the first planted trap will conceal the second unless and until the first one is moved
-(see Tutorial Examples \(scT5).
-If the first one is moved back, it again conceals the second trap.
-The macro associated with a page trap is automatically
-invoked when a line of text is output whose vertical size \fIreaches\fR
-or \fIsweeps past\fR the trap position.
-Reaching the bottom of a page springs the top-of-page trap, if any,
-provided there is a next page.
-The distance to the next trap position is available in the \fB.t\fR register;
-if there are no traps between the current position and the bottom of the page,
-the distance returned is the distance to the page bottom.
-.pg
-A macro-invocation trap effective in the current diversion may be planted using \fBdt\fR.
-The \fB.t\fR register works in a diversion; if there is no subsequent trap a \fIlarge\fR
-distance is returned.
-For a description of input-line-count traps, see \fBit\fR below.
-.h1
-.bt
-\fB&de\fI|xx|yy\fR     -       \fI.yy=\fB..\fR -       Define or redefine the macro \fIxx\fR.
-The contents of the macro begin on the next input line.
-Input lines are copied in \fIcopy mode\fR until the definition is terminated by a
-line beginning with \fB.\fIyy\fR,
-whereupon the macro \fIyy\fR is called.
-In the absence of \fIyy\fR, the definition
-is terminated by a
-line beginning with "\fB..\fR".
-A macro may contain \fBde\fR requests
-provided the terminating macros differ
-or the contained definition terminator is concealed.
-\&"\fB..\fR" can be concealed as
-\fB\e\e..\fR which will copy as \fB\e..\fR and be reread as "\fB..\fR".
-.bt
-\fB&am\fI|xx|yy\fR     -       \fI.yy=\fB..\fR -       Append to macro (append version of \fBde\fR).
-.bt
-\fB&ds\fI|xx|string\fR -       ignored -       Define a string
-\fIxx\fR containing \fIstring\fR.
-Any initial double-quote in \fIstring\fR is stripped off to permit
-initial blanks.
-.bt
-\fB&as\fI|xx|string\fR -       ignored -       Append
-\fIstring\fR to string \fIxx\fR
-(append version of \fBds\fR).
-.bt
-\fB&rm\fI|xx\fR        -       ignored -       Remove
-request, macro, or string.
-The name \fIxx\fR is removed from the name list and
-any related storage space is freed.
-Subsequent references will have no effect.
-.bt
-\fB&rn\fI|xx|yy\fR     -       ignored -       Rename request, macro, or string
-\fIxx\fR to \fIyy\fR.
-If \fIyy\fR exists, it is first removed.
-.bt
-\fB&di|\fIxx\fR        -       end     D       Divert output to macro \fIxx\fR.
-Normal text processing occurs during diversion
-except that page offsetting is not done.
-The diversion ends when the request \fBdi\fR or \fBda\fR is encountered without an argument;
-extraneous
-requests of this type should not appear when nested diversions are being used.
-.bt
-\fB&da|\fIxx\fR        -       end     D       Divert, appending to \fIxx\fR
-(append version of \fBdi\fR).
-.bt
-\fB&wh\fI|N|xx\fR      -       -       \fBv\fR Install
-a trap to invoke \fIxx\fR at page position \fIN;\fR
-a \fInegative N\fR will be interpreted with respect to the
-page \fIbottom\fR.
-Any macro previously planted at \fIN\fR is replaced by \fIxx\fR.
-A zero \fIN\fR refers to the \fItop\fR of a page.
-In the absence of \fIxx\fR, the first found trap at \fIN\fR, if any, is removed.
-.bt
-\fB&ch\fI|xx|N\fR      -       -       \fBv\fR Change
-the trap position for macro \fIxx\fR to be \fIN\fR.
-In the absence of \fIN\fR, the trap, if any, is removed.
-.bt
-\fB&dt\fI|N|xx\fR      -       off     D,\fBv\fR       Install a diversion trap
-at position \fIN\fR in the \fIcurrent\fR diversion to invoke
-macro \fIxx\fR.
-Another \fBdt\fR will redefine the diversion trap.
-If no arguments are given, the diversion trap is removed.
-.bt
-\fB&it\fI|N|xx\fR      -       off     E       Set an input-line-count trap
-to invoke the macro \fIxx\fR after \fIN\fR lines of \fItext\fR input
-have been read
-(control or request lines don't count).
-The text may be in-line text or
-text interpolated by inline or trap-invoked macros.
-.bt
-\fB&em\fI|xx\fR        none    none    -       The
-macro \fIxx\fR will be invoked
-when all input has ended.
-The effect is the same as if the contents of \fIxx\fR had been at the end
-of the last file processed.
-.mh
-Number Registers
-.pg
-A variety of parameters are available to the user as
-predefined, named \fInumber registers\fR (see Summary and Index, page 7).
-In addition, the user may define his own named registers.
-Register names are one or two characters long and \fIdo not\fR conflict
-with request, macro, or string names.
-Except for certain predefined read-only registers,
-a number register can be read, written, automatically
-incremented or decremented, and interpolated
-into the input in a variety of formats.
-One common use of user-defined registers is to
-automatically number sections, paragraphs, lines, etc.
-A number register may be used any time numerical input is expected or desired
-and may be used in numerical \fIexpressions\fR (\(sc1.4).
-.pg
-Number registers are created and modified using \fBnr\fR, which
-specifies the name, numerical value, and the auto-increment size.
-Registers are also modified, if accessed
-with an auto-incrementing sequence.
-If the registers \fIx\fR and \fIxx\fR both contain
-\fIN\fR and have the auto-increment size \fIM\fR,
-the following access sequences have the effect shown:
-.TS
-center box;
-c2|c2|c
-c2|c2|c2
-l2|c2|c2
-l2|c2|c2
-l2|l2|c2.
-       Effect on       Value
-Sequence       Register        Interpolated
-_
-\fB\en\fIx\fR  none    \fIN\fR
-\fB\en(\fIxx\fR        none    \fIN\fR
-\fB\en+\fIx\fR \fIx\fR incremented by \fIM\fR  \fIN+M\fR
-\fB\en\-\fIx\fR        \fIx\fR decremented by \fIM\fR  \fIN\-M\fR
-\fB\en+(\fIxx\fR       \fIxx\fR incremented by \fIM\fR \fIN+M\fR
-\fB\en\-(\fIxx\fR      \fIxx\fR decremented by \fIM\fR \fIN\-M\fR
-.TE
-When interpolated, a number register is converted to
-decimal (default),
-decimal with leading zeros,
-lower-case Roman,
-upper-case Roman,
-lower-case sequential alphabetic,
-or
-upper-case sequential alphabetic
-according to the format specified by \fBaf\fR.
-.h1
-.bt
-\fB&nr\fI|R|\(+-N|M\fR -       \fBu\fR \
-The number register \fIR\fR is assigned the value \fI\(+-N\fR
-with respect to the previous value, if any.
-The increment for auto-incrementing is set to \fIM\fR.
-.bt
-\fB&af\fI|R|c\fR       arabic  -       -       Assign format \fIc\fR to register \fIR\fR.
-The available formats are:
-.TS
-center box;
-c2|c
-c2|c
-c2|l.
-       Numbering
-Format Sequence
-_
-\fB1\fR        0,1,2,3,4,5,...
-\fB001\fR      000,001,002,003,004,005,...
-\fBi\fR        0,i,ii,iii,iv,v,...
-\fBI\fR        0,I,II,III,IV,V,...
-\fBa\fR        0,a,b,c,...,z,aa,ab,...,zz,aaa,...
-\fBA\fR        0,A,B,C,...,Z,AA,AB,...,ZZ,AAA,...
-.TE
-An arabic format having \fIN\fR digits
-specifies a field width of \fIN\fR digits (example 2 above).
-The read-only registers and the \fIwidth\fR function (\(sc11.2)
-are always arabic.
-.bt
-\fB&rr\fI|R\fR -       ignored -       Remove register \fIR\fR.
-If many registers are being created dynamically, it
-may become necessary to remove no longer used registers
-to recapture internal storage space for newer registers.
diff --git a/.ref-Research-V7/usr/doc/troff/m3 b/.ref-Research-V7/usr/doc/troff/m3
deleted file mode 100644 (file)
index 746faa2..0000000
+++ /dev/null
@@ -1,482 +0,0 @@
-.tr |
-.rm mx
-.mh
-Tabs, Leaders, and Fields
-.sc
-Tabs and leaders.
-The \s-1ASCII\s+1 horizontal tab character and the \s-1ASCII\s+1
-\s-1SOH\s+1 (hereafter known as the \fIleader\fR character)
-can both be used to generate either horizontal motion or
-a string of repeated characters.
-The length of the generated entity is governed
-by internal \fItab stops\fR specifiable
-with \fBta\fR.
-The default difference is that tabs generate motion and leaders generate
-a string of periods;
-\fBtc\fR and \fBlc\fR
-offer the choice of repeated character or motion.
-There are three types of internal tab stops\(em\
-\fIleft\fR adjusting, \fIright\fR adjusting,
-and \fIcentering\fR.
-In the following table:
-\fID\fR is the distance from the current position on the \fIinput\fR line
-(where a tab or leader was found)
-to the next tab stop;
-\fInext-string\fR consists
-of the input characters following the tab (or leader) up to the next tab (or leader) or end of line;
-and
-\fIW\fR is the width of \fInext-string\fR.
-.TS
-center box;
-c2|c2|c
-c2|c2|c
-c2|c2|l.
-Tab    Length of motion or     Location of
-type   repeated characters     \fInext-string\fR
-_
-Left   \fID\fR Following \fID\fR
-Right  \fID\-W\fR      Right adjusted within \fID\fR
-Centered       \fID\-W\(sl\fR2 Centered on right end of \fID\fR
-.TE
-The length of generated motion is allowed to be negative, but
-that of a repeated character string cannot be.
-Repeated character strings contain an integer number of characters, and
-any residual distance is prepended as motion.
-Tabs or leaders found after the last tab stop are ignored, but may be used
-as \fInext-string\fR terminators.
-.pg
-Tabs and leaders are not interpreted in \fIcopy mode\fR.
-\fB\et\fR and \fB\ea\fR always generate a non-interpreted
-tab and leader respectively, and
-are equivalent to actual tabs and leaders in \fIcopy mode\fR.
-.sc
-Fields.
-A \fIfield\fR is contained between
-a \fIpair\fR of \fIfield delimiter\fR characters,
-and consists of sub-strings
-separated by \fIpadding\fR indicator characters.
-The field length is the distance on the
-\fIinput\fR line from the position where the field begins to the next tab stop.
-The difference between the total length of all the sub-strings
-and the field length is incorporated as horizontal
-padding space that is divided among the indicated
-padding places.
-The incorporated padding is allowed to be negative.
-For example,
-if the field delimiter is \fB#\fR and the padding indicator is \fB^\fR,
-\fB#^\fIxxx\fB^\fIright\|\fB#\fR
-specifies a right-adjusted string with the string \fIxxx\fR centered
-in the remaining space.
-.h1
-.bt
-\fB&ta\fI|Nt|...\fR    0.8;|0.5in      none    E,\fBm\fR       \
-Set tab stops and types.
-\fIt=\fBR\fR, right adjusting;
-\fIt=\fBC\fR, centering;
-\fIt\fR absent, left adjusting.
-\*(TR tab stops are preset every 0.5in.;
-\*(NR every 0.8in.
-The stop values are separated by spaces, and
-a value preceded by \fB+\fR
-is treated as an increment to the previous stop value.
-.bt
-\fB&tc\fI|c\fR none    none    E       \
-The tab repetition character becomes \fIc\fR,
-or is removed specifying motion.
-.bt
-\fB&lc\fI|c\fR \fB.\fR none    E       \
-The leader repetition character becomes \fIc\fR,
-or is removed specifying motion.
-.bt
-\fB&fc\fI|a|b\fR       off     off     -       \
-The field delimiter is set to \fIa\fR;
-the padding indicator is set to the \fIspace\fR character or to
-\fIb\fR, if given.
-In the absence of arguments the field mechanism is turned off.
-.mh
-Input and Output Conventions and Character Translations
-.sc
-Input character translations.
-Ways of inputting the graphic character set were
-discussed in \(sc2.1.
-The \s-1ASCII\s+1 control characters horizontal tab (\(sc9.1),
-\s-1SOH\s+1 (\(sc9.1), and backspace (\(sc10.3) are discussed elsewhere.
-The newline delimits input lines.
-In addition,
-\s-1STX\s+1, \s-1ETX\s+1, \s-1ENQ\s+1, \s-1ACK\s+1, and \s-1BEL\s+1
-are accepted,
-and may be used as delimiters or translated into a graphic with \fBtr\fR (\(sc10.5).
-\fIAll\fR others are ignored.
-.pg
-The \fIescape\fR character \fB\e\fR
-introduces \fIescape sequences\fR\(em\
-causes the following character to mean
-another character, or to indicate
-some function.
-A complete list of such sequences is given in the Summary and Index on page 6.
-\fB\e\fR
-should not be confused with the \s-1ASCII\s+1 control character \s-1ESC\s+1 of the
-same name.
-The escape character \fB\e\fR can be input with the sequence \fB\e\e\fR.
-The escape character can be changed with \fBec\fR,
-and all that has been said about the default \fB\e\fR becomes true
-for the new escape character.
-\fB\ee\fR can be used to print whatever the current escape character is.
-If necessary or convenient, the escape mechanism may be turned off with \fBeo\fR,
-and restored with \fBec\fR.
-.h1
-.bt
-\fB&ec\fI|c\fR \fB\e\fR        \fB\e\fR        -       \
-Set escape character to \fB\e\fR, or to \fIc\fR, if given.
-.bt
-\fB&eo\fR      on      -       -       Turn escape mechanism off.
-.sc
-Ligatures.
-.lg0
-Five ligatures are available
-in the current \*(TR character set \(em
-\fB\(fi\fR, \fB\(fl\fR, \fB\(ff\fR, \fB\(Fi\fR, and \fB\(Fl\fR.
-They may be input (even in \*(NR) by
-\fB\e(fi\fR, \fB\e(fl\fR, \fB\e(ff\fR, \fB\e(Fi\fR, and \fB\e(Fl\fR respectively.
-.lg
-The ligature mode is normally on in \*(TR, and \fIautomatically\fR invokes 
-ligatures during input.
-.h1
-.bt
-\fB&lg\fI|N\fR off;|on on      -       Ligature mode
-is turned on if \fIN\fR is absent or non-zero,
-and turned off if \fIN\(eq\^\fR0.
-If \fIN\fR\(eq\^2, only the two-character ligatures are automatically invoked.
-Ligature mode is inhibited for
-request, macro, string, register, or file names,
-and in \fIcopy mode\fR.
-No effect in \*(NR.
-.sc
-Backspacing, underlining, overstriking, etc.
-Unless in \fIcopy mode\fR, the \s-1ASCII\s+1 backspace character is replaced
-by a backward horizontal motion having the width of the
-space character.
-Underlining as a form of line-drawing is discussed in \(sc12.4.
-A generalized overstriking function is described in \(sc12.1.
-.pg
-\*(NR automatically underlines
-characters in the \fIunderline\fR font,
-specifiable with \fBuf\fR,
-normally that on font position 2 (normally Times Italic, see \(sc2.2).
-In addition to \fBft\fR and \fB\ef\fIF\fR,
-the underline font may be selected by \fBul\fR and \fBcu\fR.
-Underlining is restricted to an output-device-dependent
-subset of \fIreasonable\fR characters.
-.h1
-.bt
-\fB&ul\fI|N\fR off     \fIN\(eq\fR1    E       \
-Underline in \*(NR (italicize in \*(TR) the next \fIN\fR
-input text lines.
-Actually, switch to \fIunderline\fR font, saving the
-current font for later restoration;
-\fIother\fR font changes within the span of a \fBul\fR
-will take effect,
-but the restoration will undo the last change.
-Output generated by \fBtl\fR (\(sc14) \fIis\fR affected by the
-font change, but does \fInot\fR decrement \fIN\fR.
-If \fIN\fR\^>\^1, there is the risk that
-a trap interpolated macro may provide text
-lines within the span;
-environment switching can prevent this.
-.bt
-\fB&cu\fI|N\fR off     \fIN\(eq\fR1    E       \
-A variant of \fBul\fR that causes \fIevery\fR character to be underlined in \*(NR.
-Identical to \fBul\fR in \*(TR.
-.bt
-\fB&uf\fI|F\fR Italic  Italic  -       \
-Underline font set to \fIF\fR.
-In \*(NR,
-\fIF\fR may \fInot\fR be on position 1 (initially Times Roman).
-.sc
-Control characters.
-Both the control character \fB.\fR and the \fIno-break\fR
-control character \fB\'\fR may be changed, if desired.
-Such a change must be compatible with the design
-of any macros used in the span of the change,
-and
-particularly of any trap-invoked macros.
-.h1
-.bt
-\fB&cc\fI|c\fR \fB.\fR \fB.\fR E       \
-The basic control character is set to \fIc\fR,
-or reset to "\fB.\fR".
-.bt
-\fB&c2\fI|c\fR \fB\'   \'\fR   E       The \fInobreak\fR control character is set
-to \fIc\fR, or reset to "\fB\'\fR".
-.sc
-Output translation.
-One character can be made a stand-in for another character using \fBtr\fR.
-All text processing (e. g. character comparisons) takes place
-with the input (stand-in) character which appears to have the width of the final
-character.
-The graphic translation occurs at the moment of output
-(including diversion).
-.h1
-.bt
-\fB&tr\fI|abcd....\fR  none    -       O       Translate \
-\fIa\fR into \fIb\fR, \fIc\fR into \fId\fR, etc.
-If an odd number of characters is given,
-the last one will be mapped into the space character.
-To be consistent, a particular translation
-must stay in effect from \fIinput\fR to \fIoutput\fR time.
-.sc
-Transparent throughput.
-An input line beginning with a \fB\e!\fR is read in \fIcopy mode\fR and \fItransparently\fR output
-(without the initial \fB\e!\fR);
-the text processor is otherwise unaware of the line's presence.
-This mechanism may be used to pass control information to a post-processor
-or to imbed control lines in a macro created by a diversion.
-.sc
-Comments and concealed newlines.
-An uncomfortably long input line that must stay
-one line (e. g. a string definition, or nofilled text)
-can be split into many physical lines by ending all but
-the last one with the escape \fB\e\fR.
-The sequence \fB\e\fR(newline) is \fIalways\fR ignored\(em\
-except in a comment.
-Comments may be imbedded at the \fIend\fR of any line by
-prefacing them with \fB\e"\fR.
-The newline at the end of a comment cannot be concealed.
-A line beginning with \fB\e"\fR will appear as a blank line and
-behave like \fB.sp|1\fR;
-a comment can be on a line by itself by beginning the line with \fB.\e"\fR.
-.mh
-Local Horizontal and Vertical Motions, and the Width Function
-.sc
-Local Motions.
-The functions \fB\ev\'\fIN\fB\|\'\fR and
-\fB\eh\'\fIN\fB\|\'\fR
-can be used for \fIlocal\fR vertical and horizontal motion respectively.
-The distance \fIN\fR may be negative; the \fIpositive\fR directions
-are \fIrightward\fR and \fIdownward\fR.
-A \fIlocal\fR motion is one contained \fIwithin\fR a line.
-To avoid unexpected vertical dislocations, it is necessary that
-the \fInet\fR vertical local motion within a word in filled text
-and otherwise within a line balance to zero.
-The above and certain other escape sequences providing local motion are
-summarized in the following table.
-.tr ||
-.ds X \0\0\0
-.TS
-center box;
-c2|cs2||c2|cs2
-c1|c2c2||c2|c2c2.
-Vertical       Effect in       Horizontal      Effect in
-Local Motion   \*(TR   \*(NR   Local Motion    \*(TR   \*(NR
-_
-.sp.4
-.TC
-l2|ls2||l2|ls2.
-\fB\*X\ev\'\fIN\|\^\fB\'\fR    Move distance \fIN\fR   \
-\fB\*X\eh\'\fIN\|\^\fB\'\fR    Move distance \fIN\fR
-.TC
-_2|_2_2||l2|ls2.
-x      x       x       \fB\*X\e\fR(space)      Unpaddable space-size space
-.TC
-l2|l2|l2||l2|ls2.
-\fB\*X\eu\fR   \(12 em up      \(12 line up    \fB\*X\e0\fR    Digit-size space
-.TC
-l2|l2|l2||_2|_2_2.
-\fB\*X\ed\fR   \(12 em down    \(12 line down  x       x       x
-.TC
-l2|l2|l2||l2|l2|l2.
-\fB\*X\er\fR   1 em up 1 line up       \fB\*X\e\||\fR  1\(sl6 em space ignored
-                       \fB\*X\e^\fR    1\(sl12 em space        ignored
-.sp.4
-.TE
-.rm X
-.tr |
-As an example,
-\fBE\s-2\v'-.4m'2\v'.4m'\s+2\fR
-could be generated by the sequence
-\fBE\es\-2\ev\'\-0.4m\'2\ev\'0.4m\'\es+2\fR;
-it should be noted in this example that
-the 0.4|em vertical motions are at the smaller size.
-.sc
-Width Function.
-The \fIwidth\fR function \fB\ew\'\fIstring\fB\|\'\fR
-generates the numerical width of \fIstring\fR (in basic units).
-Size and font changes may be safely imbedded in \fIstring\fR,
-and will not affect the current environment.
-For example,
-\&\fB.ti|\-\\w\'1.|\'u\fR could be used to
-temporarily indent leftward a distance equal to the
-size of the string "\fB1.|\fR".
-.pg
-The width function also sets three number registers.
-The registers \fBst\fR and \fBsb\fR are set respectively to the highest and
-lowest extent of \fIstring\fR relative to the baseline;
-then, for example,
-the total \fIheight\fR of the string is \fB\en(stu\-\en(sbu\fR.
-In \*(TR the number register \fBct\fR is set to a value
-between 0|and|3:
-0 means that all of the characters in \fIstring\fR were short lower
-case characters without descenders (like \fBe\fR);
-1 means that at least one character has a descender (like \fBy\fR);
-2 means that at least one character is tall (like \fBH\fR);
-and 3 means that both tall characters and characters with
-descenders are present.
-.sc
-Mark horizontal place.
-The escape sequence \fB\ek\fIx\fR will cause the \fIcurrent\fR horizontal
-position in the \fIinput line\fR to be stored in register \fIx\fR.
-As an example,
-the construction \fB\ekx\fIword\|\fB\eh\'\|~\|\enxu+2u\'\fIword\fB\fR
-will embolden \fIword\fR by backing up to almost its beginning and overprinting it,
-resulting in \kz\fIword\fR\h'|\nzu+2u'\fIword\fR.
-.mh
-Overstrike, Bracket, Line-drawing, and Zero-width Functions
-.sc
-Overstriking.
-Automatically centered overstriking of up to nine characters
-is provided by the \fIoverstrike\fR function
-\fB\eo\'\fIstring\fB\|\'\fR.
-The characters in \fIstring\fR overprinted with centers aligned; the total width
-is that of the widest character.
-\fIstring\fR should \fInot\fR contain local vertical motion.
-As examples,
-\fB\eo\'e\e\'\'\fR produces \fB\o'e\''\fR, and
-\fB\eo\'\e(mo\e(sl\'\fR produces \fB\o'\(mo\(sl'\fR.
-.sc
-Zero-width characters.
-The function \fB\ez\fIc\fR will output \fIc\fR without spacing over
-it, and can be used to produce left-aligned overstruck
-combinations.
-As examples,
-\fB\ez\e(ci\e(pl\fR will produce \fB\z\(ci\(pl\fR, and
-\fB\e(br\ez\e(rn\e(ul\e(br\fR will produce the smallest possible
-constructed box \fB\(br\z\(rn\(ul\(br\fR\|.
-.sc
-Large Brackets.
-The Special Mathematical Font contains a number of bracket construction pieces
-(\|\|\(lt\|\|\(lb\|\|\(rt\|\|\(rb\|\|\(lk\|\|\(rk\|\|\(bv\|\|\(lf\|\|\(rf\|\|\(lc\|\|\(rc\|\|)
-that can be combined into various bracket styles.
-The function \fB\eb\'\fIstring\fB\|\'\fR may be used to pile
-up vertically the characters in \fIstring\fR
-(the first character on top and the last at the bottom);
-the characters are vertically separated by 1|em and the total
-pile is centered 1\(sl2\|em above the current baseline
-(\(12 line in \*(NR).
-For example,
-\fB\eb\'\|\e(lc\e(lf\|\'E\e\|~\|\eb\'\|\e(rc\e(rf\|\'\|\ex\'\|\-0.5m\'\|\ex\'0.5m\'\|\fR
-produces
-\x'-.5m'\x'.5m'\fB\b'\(lc\(lf'E\|\b'\(rc\(rf'\fR.
-.sc
-Line drawing.
-.tr &&
-The function \fB\e\|l\|\'\fINc\fB\|\'\fR will draw a string of repeated \fIc\fR\|'s towards the right for a distance \fIN\fR.
-(\|\fB\el\fR is \fB\e\fR(lower case L).
-If \fIc\fR looks like a continuation of
-an expression for \fIN\fR, it may insulated from \fIN\fR with a \fB\e&\fR.
-If \fIc\fR is not specified, the \fB\(ru\fR (baseline rule) is used
-(underline character in \*(NR).
-If \fIN\fR is negative, a backward horizontal motion
-of size \fIN\fR is made \fIbefore\fR drawing the string.
-Any space resulting from \fIN\fR\|\(sl(size of \fIc\fR) having a remainder is put at the beginning (left end)
-of the string.
-In the case of characters
-that are designed to be connected such as
-baseline-rule\ \fB\(ru\fR\|,
-underrule\ \fB\(ul\fR\|,
-and
-root-en\ \fB\(rn\fR\|,
-the remainder space is covered by over-lapping.
-If \fIN\fR is \fIless\fR than the width of \fIc\fR,
-a single \fIc\fR is centered on a distance \fIN\fR.
-As an example, a macro to underscore a string can be written
-.br
-.tr &.
-.x1
-.ftB
-.ne 2.1
-&de us
-\e\e$1\e\|l\|\'\|~\|0\e(ul\'
-&&
-.ftR
-.x2
-.ne2.1
-.de xu
-\\$1\l'|0\(ul'
-..
-or one to draw a box around a string
-.x1
-.ftB
-&de bx
-\e(br\e\|~\|\e\e$1\e\|~\|\e(br\e\|l\|\'\|~\|0\e(rn\'\e\|l\|\'\|~\|0\e(ul\'
-&&
-.ftR
-.x2
-.de bx
-\(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
-..
-such that
-.x1
-.ftB
-&ul "underlined words"
-.ftR
-.x2
-and
-.x1
-.ftB
-&bx "words in a box"
-.ftR
-.x2
-yield
-.xu "underlined words"
-and
-.bx "words in a box"
-\h'-\w'.'u'.
-.pg
-The function \fB\eL\'\|\fINc\fB\|\'\fR will draw a vertical line consisting
-of the (optional) character \fIc\fR stacked vertically apart 1\|em
-(1 line in \*(NR),
-with the first two characters overlapped,
-if necessary, to form a continuous line.
-The default character is the \fIbox rule\fR |\(br| (\fB\|\e(br\fR);
-the other suitable character is the \fIbold vertical\fR \|\(bv\| (\fB\|\e(bv\fR).
-The line is begun without any initial motion relative to the
-current base line.
-A positive \fIN\fR specifies a line drawn downward and
-a negative \fIN\fR specifies a line drawn upward.
-After the line is drawn \fIno\fR compensating
-motions are made;
-the instantaneous baseline is at the \fIend\fR of the line.
-.pg
-.de eb
-.sp -1
-.nf
-\h'-.5n'\L'|\\nzu-1'\l'\\n(.lu+1n\(ul'\L'-|\\nzu+1'\l'|0u-.5n\(ul'
-.fi
-..
-.ne 2i
-.mk z
-The horizontal and vertical line drawing functions may be used
-in combination to produce large boxes.
-The zero-width \fIbox-rule\fR and the \(12-em wide \fIunderrule\fR
-were \fIdesigned\fR to form corners when using 1-em vertical
-spacings.
-For example the macro
-.x1
-.ftB
-\&.de eb
-\&.sp \-1      \e"compensate for next automatic base-line spacing
-\&.nf  \e"avoid possibly overflowing word buffer
-.tr ||
-\&\eh\'\-.5n\'\eL\'\||\|\e\enau\-1\'\el\'\e\en(.lu+1n\e(ul\'\eL\'\-\||\|\e\enau+1\'\el\'\||\|0u\-.5n\e(ul\'    \e"draw box
-.tr |
-.lg0
-\&.fi
-.lg
-\&..
-.ftR
-.x2
-will draw a box around some text whose beginning vertical place was
-saved in number register \fIa\fR
-(e. g. using \fB.mk|a\fR)
-as done for this paragraph.
-.eb
diff --git a/.ref-Research-V7/usr/doc/troff/m4 b/.ref-Research-V7/usr/doc/troff/m4
deleted file mode 100644 (file)
index bc04441..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-.tr |
-.mh
-Hyphenation.
-.pg
-The automatic hyphenation may be switched off and on.
-When switched on with \fBhy\fR,
-several variants may be set.
-A \fIhyphenation indicator\fR character may be imbedded in a word to
-specify desired hyphenation points,
-or may be prepended to suppress hyphenation.
-In addition,
-the user may specify a small exception word list.
-.pg
-Only words that consist of a central alphabetic string
-surrounded by (usually null) non-alphabetic strings
-are considered candidates for automatic hyphenation.
-Words that were input containing hyphens
-(minus),
-em-dashes (\fB\e(em\fR),
-or hyphenation indicator characters\
-\(emsuch as mother-in-law\(em\
-are \fIalways\fR subject to splitting after those characters,
-whether or not automatic hyphenation is on or off.
-.h1
-.bt
-\fB&nh\fR      hyphenate       -       E       \
-Automatic hyphenation is turned off.
-.bt
-\fB&hy\fIN\fR  on,\fIN=\fR1    on,\fIN=\fR1    E       \
-Automatic hyphenation is turned on
-for \fIN\fR\|\(>=1, or off for \fIN=\fR\|0.
-If \fIN=\fR\|2, \fIlast\fR lines (ones that will cause a trap)
-are not hyphenated.
-For \fIN=\fR\|4 and 8, the last and first two characters
-respectively of a word are not split off.
-These values are additive;
-i.|e. \fIN=\fR\|14 will invoke all three restrictions.
-.bt
-\fB&hc\fI|c\fR \fB\e%  \e%\fR  E       Hyphenation indicator character is set
-to \fIc\fR or to the default \fB\e%\fR.
-The indicator does not appear in the output.
-.bt
-\fB&hw\fI|word1|...\fR ignored -       Specify hyphenation points in words
-with imbedded minus signs.
-Versions of a word with terminal \fIs\fR are implied;
-i.|e. \fIdig\-it\fR implies \fIdig\-its\fR.
-This list is examined initially \fIand\fR after
-each suffix stripping.
-The space available is small\(emabout 128 characters.
-.mh
-Three Part Titles.
-.pg
-The titling function \fBtl\fR provides for automatic placement
-of three fields at the left, center, and right of a line
-with a title-length
-specifiable with \fBlt\fR.
-\fBtl\fR may be used anywhere, and is independent of the
-normal text collecting process.
-A common use is in header and footer macros.
-.h1
-.bt
-\fB&tl\fI|\'left\|\'center\|\'right\|\'\fR     -       -       \
-The strings \fIleft\fR, \fIcenter\fR, and \fIright\fR are
-respectively left-adjusted, centered, and right-adjusted
-in the current title-length.
-Any of the strings may be empty,
-and overlapping is permitted.
-If the page-number character (initially \fB%\fR) is found within any of the fields it is replaced
-by the current page number having the format assigned to register \fB%\fR.
-Any character may be used as the string delimiter.
-.bt
-\fB&pc\fI|c\fR \fB%\fR off     -       The page number character is set to \fIc\fR,
-or removed.
-The page-number register remains \fB%\fR.
-.bt
-\fB&lt\fI|\(+-N\fR     6.5\|in previous        E,\fBm\fR       Length of title set to \fI\(+-N\fR.
-The line-length and the title-length are \fIindependent\fR.
-Indents do not apply to titles; page-offsets do.
-.mh
-Output Line Numbering.
-.pg
-.ll -\w'0000'u
-.nm 1 3
-Automatic sequence numbering of output lines may be
-requested with \fBnm\fR.
-When in effect,
-a three-digit, arabic number plus a digit-space
-is prepended to output text lines.
-The text lines are thus offset by four digit-spaces,
-and otherwise retain their line length;
-a reduction in line length may be desired to keep the right margin
-aligned with an earlier margin.
-Blank lines, other vertical spaces, and lines generated by \fBtl\fR
-are \fInot\fR numbered.
-Numbering can be temporarily suspended with \fBnn\fR,
-or with an \fB.nm\fR followed by a later \fB.nm|+0\fR.
-In addition,
-a line number indent \fII\fR, and the number-text separation \fIS\fR
-may be specified in digit-spaces.
-Further, it can be specified that only those line numbers that are
-multiples of some number \fIM\fR are to be printed (the others will appear
-as blank number fields).
-.br
-.nm
-.ll
-.h1
-.bt
-\fB&nm\fI|\(+-N|M|S|I\fR       off     E       \
-Line number mode.
-If \fI\(+-N\fR is given,
-line numbering is turned on,
-and the next output line numbered is numbered \fI\(+-N\fR.
-Default values are \fIM=\fR\|1, \fIS=\fR\|1, and \fII=\fR\|0.
-Parameters corresponding to missing arguments are unaffected;
-a non-numeric argument is considered missing.
-In the absence of all arguments, numbering is turned off;
-the next line number is preserved for possible further use
-in number register \fBln\fR.
-.bt
-\fB&nn\fI|N\fR -       \fIN=\fR1       E       The next \fIN\fR text output lines are not
-numbered.
-.pg
-.ll -\w'0000'u
-.nm +0
-As an example, the paragraph portions of this section
-are numbered with \fIM=\fR\|3:
-\&\fB.nm|1|3\fR was placed at the beginning;
-\&\fB.nm\fR was placed at the end of the first paragraph;
-and \fB.nm|+0\fR was placed in front of this paragraph;
-and \fB.nm\fR finally placed at the end.
-Line lengths were also changed (by \fB\ew\'0000\'u\fR) to keep the right side aligned.
-Another example is
-\&\fB.nm|+5|5|x|3\fR which turns on numbering with the line number of the next
-line to be 5 greater than the last numbered line,
-with \fIM=\fR\|5, with spacing \fIS\fR untouched, and with the indent \fII\fR set to 3.
-.br
-.ll
-.nm
-.mh
-Conditional Acceptance of Input
-.pg
-In the following,
-\fIc\fR is a one-character, built-in \fIcondition\fR name,
-\fB!\fR signifies \fInot\fR,
-\fIN\fR is a numerical expression,
-\fIstring1\fR and \fIstring2\fR are strings delimited by any non-blank, non-numeric character \fInot\fR in the strings,
-and
-\fIanything\fR represents what is conditionally accepted.
-.h1
-.bt
-\fB&if\fI|c|anything\fR                -       -       If condition \fIc\fR true, accept \fIanything\fR as input;
-in multi-line case use \fI\e{anything\|\e}\fR.
-.bt
-\fB&if|!\fIc|anything\fR       -       -       If condition \fIc\fR false, accept \fIanything\fR.
-.bt
-\fB&if\fI|N|anything\fR        -       \fBu\fR If expression \fIN\fR > 0, accept \fIanything\fR.
-.bt
-\fB&if|!\fIN|anything\fR       -       \fBu\fR If expression \fIN\fR \(<= 0, accept \fIanything\fR.
-.bt
-\fB&if\fI|\|\'string1\|\'string2\|\'|anything\fR       -       If \fIstring1\fR identical to \fIstring2\fR,
-accept \fIanything\fR.
-.bt
-\fB&if|!\fI\|\'string1\|\'string2\|\'|anything\fR      -       If \fIstring1\fR not identical to \fIstring2\fR,
-accept \fIanything\fR.
-.bt
-\fB&ie\fI|c|anything\fR        -       \fBu\fR If portion of if-else; all above forms (like \fBif\fR).
-.bt
-\fB&el\fI|anything\fR          -       -       Else portion of if-else.
-.pg
-The built-in condition names are:
-.TS
-center box;
-c2|c2
-c2|c2
-c2|l2.
-Condition
-Name   True If
-_
-\fBo\fR        Current page number is odd
-\fBe\fR        Current page number is even
-\fBt\fR        Formatter is \*(TR
-\fBn\fR        Formatter is \*(NR
-.TE
-If the condition \fIc\fR is \fItrue\fR, or if the number \fIN\fR is greater than zero,
-or if the strings compare identically (including motions and character size and font),
-\fIanything\fR is accepted as input.
-If a \fB!\fR precedes the condition, number, or string comparison,
-the sense of the acceptance is reversed.
-.pg
-Any spaces between the condition and the beginning of \fIanything\fR are skipped over.
-The \fIanything\fR can be either a single input line (text, macro, or whatever)
-or a number of input lines.
-In the multi-line case,
-the first line must begin with a left delimiter \fB\e{\fR and
-the last line must end with a right delimiter \fB\e}\fR.
-.pg
-The request \fBie\fR (if-else) is identical to \fBif\fR
-except that the acceptance state is remembered.
-A subsequent and matching \fBel\fR (else) request then uses the reverse sense of that state.
-\fBie\fR|-|\fBel\fR pairs may be nested.
-.pg
-Some examples are:
-.x1
-.ftB
-.ne 1
-&if e .tl \'\|Even Page %\'\'\'
-.ftR
-.x2
-which outputs a title if the page number is even; and
-.x1
-.ftB
-.ne 3.1
-&ie \en%>1 \e{\e
-\&\'sp 0.5i
-&tl \'\|Page %\'\'\'
-\&\'sp ~\|1.2i|\e}
-&el .sp ~\|2.5i
-.ftR
-.x2
-which treats page 1 differently from other pages.
-.mh
-Environment Switching.
-.pg
-A number of the parameters that
-control the text processing are gathered together into an
-\fIenvironment\fR, which can be switched by the user.
-The environment parameters are those associated
-with requests noting E in their \fINotes\fR column;
-in addition, partially collected lines and words are in the environment.
-Everything else is global; examples are page-oriented parameters,
-diversion-oriented parameters, number registers, and macro and string definitions.
-All environments are initialized with default parameter values.
-.h1
-.bt
-\fB&ev\fI|N\fR \fIN\(eq\fR0    previous        -       Environment switched to
-environment 0\(<=\fIN\fR\(<=2.
-Switching is done in push-down fashion so that
-restoring a previous environment \fImust\fR be done with \fB.ev\fR
-rather than specific reference.
-.mh
-Insertions from the Standard Input
-.pg
-The input can be temporarily switched to the system \fIstandard input\fR
-with \fBrd\fR,
-which will switch back when \fItwo\fR newlines
-in a row are found (the \fIextra\fR blank line is not used).
-This mechanism is intended for insertions in form-letter-like documentation.
-On \s-1UNIX\s+1, the \fIstandard input\fR can be the user's keyboard,
-a \fIpipe\fR, or a \fIfile\fR.
-.h1
-.bt
-\fB&rd\fI|prompt\fR    -       \fIprompt=\fR\s-1BEL\s+1        -       \
-Read insertion from the standard input until two newlines in a row are found.
-If the standard input is the user's keyboard, \fIprompt\fR (or a \s-1BEL\s+1)
-is written onto the user's terminal.
-\fBrd\fR behaves like a macro,
-and arguments may be placed after \fIprompt\fR.
-.bt
-\fB&ex\fR      -       -       -       Exit from \*(NR\(sl\*(TR.
-Text processing is terminated exactly as if all input had ended.
-.pg
-If insertions are to be
-taken from the terminal keyboard \fIwhile\fR output is being printed
-on the terminal, the command line option \fB\-q\fR will turn off the echoing
-of keyboard input and prompt only with \s-1BEL\s+1.
-The regular input and insertion input \fIcannot\fR
-simultaneously come from the standard input.
-.pg
-As an example,
-multiple copies of a form letter may be prepared by entering the insertions
-for all the copies in one file to be used as the standard input,
-and causing the file containing the letter to reinvoke itself using \fBnx\fR (\(sc19);
-the process would ultimately be ended by an \fBex\fR in the insertion file.
-.mh
-Input\(slOutput File Switching
-.h1
-.bt
-\fB&so\fI|filename\fR          -       -       Switch source file.
-The top input (file reading) level is switched to \fIfilename\fR.
-The effect of an \fBso\fR encountered in a macro
-is not felt until the input level returns to the file level.
-When the new file ends,
-input is again taken from the original file.
-\fBso\fR's may be nested.
-.bt
-\fB&nx\fI|filename\fR          end-of-file     -       Next file is \fIfilename\fR.
-The current file is considered ended, and the input is immediately switched
-to \fIfilename\fR.
-.bt
-\fB&pi\fI|program\fR           -       -       Pipe output to \fIprogram\fR (\*(NR only).
-This request must occur \fIbefore\fR any printing occurs.
-No arguments are transmitted to \fIprogram\fR.
-.mh
-Miscellaneous
-.pg
-.h1
-.bt
-.mc \s12\(br\s0
-\fB&mc\fI|c|N\fR       -       off     E,\fBm\fR       \
-Specifies that a \fImargin\fR character \fIc\fR appear a distance
-\fIN\fR to the right of the right margin
-after each non-empty text line (except those produced by \fBtl\fR).
-If the output line is too-long (as can happen in nofill mode)
-the character will be appended to the line.
-If \fIN\fR is not given, the previous \fIN\fR is used; the initial \fIN\fR is
-0.2|inches in \*(NR and 1\|em in \*(TR.
-The margin character used with this paragraph was a 12-point box-rule.
-.br
-.mc
-.bt
-\fB&tm\fI|string\fR    -       newline -       \
-After skipping initial blanks, \fIstring\fR (rest of the line) is read in \fIcopy mode\fR
-and written on the user's terminal.
-.bt
-\fB&ig\fI|yy\fR        -       \fI.yy=\fB..\fR -       Ignore \
-input lines.
-\fBig\fR behaves exactly like \fBde\fR (\(sc7) except that the
-input is discarded.
-The input is read in \fIcopy mode\fR, and any auto-incremented
-registers will be affected.
-.bt
-\fB&pm\fI|t\fR -       all     -       \
-Print macros.
-The names and sizes of all of the defined macros and strings are printed
-on the user's terminal;
-if \fIt\fR is given, only the total of the sizes is printed.
-The sizes is given in \fIblocks\fR
-of 128 characters.
-.bt
-.lg0
-\fB&fl\fR      -       -       B       \c
-.lg
-Flush output buffer.
-Used in interactive debugging to force output.
-.mh
-Output and Error Messages.
-.pg
-The output from \fBtm\fR, \fBpm\fR, and the prompt from \fBrd\fR,
-as well as various \fIerror\fR messages are written onto
-\s-1UNIX\s+1's \fIstandard message\fR output.
-The latter is different from the \fIstandard output\fR,
-where \*(NR formatted output goes.
-By default, both are written onto the user's terminal,
-but they can be independently redirected.
-.pg
-Various \fIerror\fR conditions may occur during
-the operation of \*(NR and \*(TR.
-Certain less serious errors having only local impact do not
-cause processing to terminate.
-Two examples are \fIword overflow\fR, caused by a word that is too large
-to fit into the word buffer (in fill mode), and
-\fIline overflow\fR, caused by an output line that grew too large
-to fit in the line buffer;
-in both cases, a message is printed, the offending excess
-is discarded,
-and the affected word or line is marked at the point of truncation
-with a \(** in \*(NR and a \(lh in \*(TR.
-The philosophy is to continue processing, if possible,
-on the grounds that output useful for debugging may be produced.
-If a serious error occurs, processing terminates,
-and an appropriate message is printed.
-Examples are the inability to create, read, or write files,
-and the exceeding of certain internal limits that
-make future output unlikely to be useful.
-.pg
-.bp
diff --git a/.ref-Research-V7/usr/doc/troff/m5 b/.ref-Research-V7/usr/doc/troff/m5
deleted file mode 100644 (file)
index 1b1957d..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-.pn 27
-.ds H T
-.tr |
-.tr ~|
-.de x1
-.xx
-.ftB
-.in .2i
-.nf
-.ne 2.1
-.ta 1i
-..
-.de x2
-.fi
-.in0
-.ftR
-.xx
-..
-.br
-.ce
-.ftB
-.rs
-.sp 0.5i
-TUTORIAL EXAMPLES
-.ftR
-.sp2
-.nr p 0
-.2C
-.ns
-.mh
-.mk
-Introduction
-.pg
-Although \*(NR and \*(TR
-have by design a syntax reminiscent
-of earlier text processors*
-.fn
-.xx
-*For example:
-P.|A.|Crisman, Ed.,
-.ul
-The Compatible Time-Sharing System,
-MIT Press, 1965, Section|AH9.01
-(Description of RUNOFF program on MIT's CTSS system).
-.ef
-with the intent of easing their use,
-it is almost always necessary to
-prepare at least a small set of macro definitions
-to describe most documents.
-Such common formatting needs
-as page margins and footnotes
-are deliberately not built into \*(NR and \*(TR.
-Instead,
-the macro and string definition, number register, diversion,
-environment switching, page-position trap, and conditional input mechanisms
-provide the basis for user-defined implementations.
-.pg
-The examples to be discussed are intended to be useful and somewhat realistic,
-but won't necessarily cover all relevant contingencies.
-Explicit numerical parameters are used
-in the examples
-to make them easier to read and to
-illustrate typical values.
-In many cases, number registers would really be used
-to reduce the number of places where numerical
-information is kept,
-and to concentrate conditional parameter initialization
-like that which depends on whether \*(TR or \*(NR is being used.
-.mh
-Page Margins
-.pg
-As discussed in \(sc3,
-\fIheader\fR and \fIfooter\fR macros are usually defined
-to describe the top and bottom page margin areas respectively.
-A trap is planted at page position 0 for the header, and at
-\fI\-N\fR (\fIN\fR from the page bottom) for the footer.
-The simplest such definitions might be
-.x1
-&de hd \e"define header
-\'sp 1i
-&&     \e"end definition
-&de fo \e"define footer
-\'bp
-&&     \e"end definition
-&wh 0 hd
-&wh \-1i fo
-.x2
-which provide blank 1|inch top and bottom margins.
-The header will occur on the \fIfirst\fR page,
-only if the definition and trap exist prior to
-the initial pseudo-page transition (\(sc3).
-In fill mode, the output line that springs the footer trap
-was typically forced out because some part or whole word didn't fit on it.
-If anything in the footer and header that follows causes a \fIbreak\fR,
-that word or part word will be forced out.
-In this and other examples,
-requests like \fBbp\fR and \fBsp\fR that normally cause breaks are invoked using
-the \fIno-break\fR control character \fB\'\fR
-to avoid this.
-When the header\(slfooter design contains material
-requiring independent text processing, the
-environment may be switched, avoiding
-most interaction with the running text.
-.pg
-A more realistic example would be
-.x1
-&de hd \e"header
-&if t .tl \'\|\e(rn\'\'\e(rn\'  \e"troff cut mark
-&if \e\en%>1 \e{\e
-\'sp ~\|0.5i\-1        \e"tl base at 0.5i
-&tl \'\'\- % \-\'\'    \e"centered page number
-&ps    \e"restore size
-&ft    \e"restore font
-&vs  \e}       \e"restore vs
-\'sp ~\|1.0i   \e"space to 1.0i
-&ns    \e"turn on no-space mode
-&&
-&de fo \e"footer
-&ps 10 \e"set footer\(slheader size
-&ft R  \e"set font
-&vs 12p        \e"set base-line spacing
-&if \e\en%=1 \e{\e
-\'sp ~\|\e\en(.pu\-0.5i\-1  \e"tl base 0.5i up
-&tl \'\'\- % \-\'\' \e}  \e"first page number
-\'bp
-&&
-&wh 0 hd
-&wh \-1i fo
-.x2
-which sets the size, font, and base-line spacing for the
-header\(slfooter material, and ultimately restores them.
-The material in this case is a page number at the bottom of the
-first page and at the top of the remaining pages.
-If \*(TR is used, a \fIcut mark\fR is drawn in the form
-of \fIroot-en\fR's at each margin.
-The \fBsp\fR's refer to absolute positions to avoid
-dependence on the base-line spacing.
-Another reason for this in the footer
-is that the footer is invoked by printing a line whose
-vertical spacing swept past the trap position by possibly
-as much as the base-line spacing.
-The \fIno-space\fR mode is turned on at the end of \fBhd\fR
-to render ineffective
-accidental occurrences of \fBsp\fR at the top of the running text.
-.pg
-The above method of restoring size, font, etc. presupposes
-that such requests (that set \fIprevious\fR value) are \fInot\fR
-used in the running text.
-A better scheme is save and restore both the current \fIand\fR
-previous values as shown for size in the following:
-.x1
-&de fo
-&nr s1 \e\en(.s        \e"current size
-&ps
-&nr s2 \e\en(.s        \e"previous size
-&  --- \e"rest of footer
-&&
-&de hd
-&  --- \e"header stuff
-&ps \e\en(s2   \e"restore previous size
-&ps \e\en(s1   \e"restore current size
-&&
-.x2
-Page numbers may be printed in the bottom margin
-by a separate macro triggered during the footer's
-page ejection:
-.x1
-&de bn \e"bottom number
-&tl \'\'\- % \-\'\'    \e"centered page number
-&&
-&wh \-0.5i\-1v bn       \e"tl base 0.5i up
-.x2
-.mh
-Paragraphs and Headings
-.pg
-The housekeeping
-associated with starting a new paragraph should be collected
-in a paragraph macro
-that, for example,
-does the desired preparagraph spacing,
-forces the correct font, size, base-line spacing, and indent,
-checks that enough space remains for \fImore than one\fR line,
-and
-requests a temporary indent.
-.x1
-&de pg \e"paragraph
-&br    \e"break
-&ft R  \e"force font,
-&ps 10 \e"size,
-&vs 12p        \e"spacing,
-&in 0  \e"and indent
-&sp 0.4        \e"prespace
-&ne 1+\e\en(.Vu        \e"want more than 1 line
-&ti 0.2i       \e"temp indent
-&&
-.x2
-The first break in \fBpg\fR
-will force out any previous partial lines,
-and must occur before the \fBvs\fR.
-The forcing of font, etc. is
-partly a defense against prior error and
-partly to permit
-things like section heading macros to
-set parameters only once.
-The prespacing parameter is suitable for \*(TR;
-a larger space, at least as big as the output device vertical resolution, would be
-more suitable in \*(NR.
-The choice of remaining space to test for in the \fBne\fR
-is the smallest amount greater than one line
-(the \fB.V\fR is the available vertical resolution).
-.pg
-A macro to automatically number section headings
-might look like:
-.x1
-&de sc \e"section
-&  --- \e"force font, etc.
-&sp 0.4        \e"prespace
-&ne 2.4+\e\en(.Vu \e"want 2.4+ lines
-.lg 0
-&fi
-.lg
-\e\en+S.
-&&
-&nr S 0 1      \e"init S
-.x2
-The usage is \fB.sc\fR,
-followed by the section heading text,
-followed by \fB.pg\fR.
-The \fBne\fR test value includes one line of heading,
-0.4 line in the following \fBpg\fR, and
-one line of the paragraph text.
-A word consisting of the next section number and a period is
-produced to begin the heading line.
-The format of the number may be set by \fBaf\fR (\(sc8).
-.pg
-Another common form is the labeled, indented paragraph,
-where the label protrudes left into the indent space.
-.x1
-&de lp \e"labeled paragraph
-&pg
-&in 0.5i       \e"paragraph indent
-&ta 0.2i 0.5i  \e"label, paragraph
-&ti 0
-\et\e\e$1\et\ec        \e"flow into paragraph
-&&
-.x2
-The intended usage is "\fB.lp\fR \fIlabel\fR\|";
-\fIlabel\fR will begin at 0.2\|inch, and
-cannot exceed a length of 0.3\|inch without intruding into
-the paragraph.
-The label could be right adjusted against 0.4\|inch by
-setting the tabs instead with \fB.ta|0.4iR|0.5i\fR.
-The last line of \fBlp\fR ends with \fB\ec\fR so that
-it will become a part of the first line of the text
-that follows.
-.mh
-Multiple Column Output
-.pg
-The production of multiple column pages requires
-the footer macro to decide whether it was
-invoked by other than the last column,
-so that it will begin a new column rather than
-produce the bottom margin.
-The header can initialize a column register that
-the footer will increment and test.
-The following is arranged for two columns, but
-is easily modified for more.
-.x1
-&de hd \e"header
-&  ---
-&nr cl 0 1     \e"init column count
-&mk    \e"mark top of text
-&&
-&de fo \e"footer
-&ie \e\en+(cl<2 \e{\e
-&po +3.4i      \e"next column; 3.1+0.3
-&rt    \e"back to mark
-&ns \e}        \e"no-space mode
-&el \e{\e
-&po \e\enMu    \e"restore left margin
-&  ---
-\'bp \e}
-&&
-&ll 3.1i       \e"column width
-&nr M \e\en(.o \e"save left margin
-.x2
-Typically a portion of the top of the first page
-contains full width text;
-the request for the narrower line length,
-as well as another \fB.mk\fR would
-be made where the two column output was to begin.
-.mh
-Footnote Processing
-.pg
-The footnote mechanism to be described is used by
-imbedding the footnotes in the input text at the
-point of reference,
-demarcated by an initial \fB.fn\fR and a terminal \fB.ef\fR:
-.x1
-&fn
-\fIFootnote text and control lines...\fP
-&ef
-.x2
-In the following,
-footnotes are processed in a separate environment and diverted
-for later printing in the space immediately prior to the bottom
-margin.
-There is provision for the case where the last collected
-footnote doesn't completely fit in the available space.
-.x1
-&de hd \e"header
-&  ---
-&nr x 0 1      \e"init footnote count
-&nr y 0\-\e\enb        \e"current footer place
-&ch fo \-\e\enbu       \e"reset footer trap
-&if \e\en(dn .fz       \e"leftover footnote
-&&
-&de fo \e"footer
-&nr dn 0       \e"zero last diversion size
-&if \e\enx \e{\e
-&ev 1  \e"expand footnotes in ev1
-&nf    \e"retain vertical size
-&FN    \e"footnotes
-&rm FN \e"delete it
-&if "\e\en(.z"fy" .di   \e"end overflow diversion
-&nr x 0        \e"disable fx
-&ev  \e}       \e"pop environment
-&  ---
-\'bp
-&&
-&de fx \e"process footnote overflow
-&if \e\enx .di fy      \e"divert overflow
-&&
-&de fn \e"start footnote
-&da FN \e"divert (append) footnote
-&ev 1  \e"in environment 1
-&if \e\en+x=1 .fs       \e"if first, include separator
-.lg0
-&fi    \e"fill mode
-.lg
-&&
-&de ef \e"end footnote
-&br    \e"finish output
-&nr z \e\en(.v \e"save spacing
-&ev    \e"pop ev
-&di    \e"end diversion
-&nr y \-\e\en(dn       \e"new footer position,
-&if \e\enx=1 .nr y \-(\e\en(.v\-\e\enz) \e
-       \e"uncertainty correction
-&ch fo \e\enyu \e"y is negative
-&if (\|\e\en(nl+1v)>(\|\e\en(.p+\e\eny) \e
-&ch fo \e\en(nlu+1v     \e"it didn't fit
-&&
-&de fs \e"separator
-\el\'\|1i\'    \e"1 inch rule
-&br
-&&
-&de fz \e"get leftover footnote
-&fn
-&nf    \e"retain vertical size
-&fy    \e"where fx put it
-&ef
-&&
-&nr b 1.0i     \e"bottom margin size
-&wh 0 hd       \e"header trap
-&wh 12i fo     \e"footer trap, temp position
-&wh \-\e\enbu fx       \e"fx at footer position
-&ch fo \-\e\enbu       \e"conceal fx with fo
-.x2
-The header \fBhd\fR initializes a footnote count register \fBx\fR,
-and sets both the current footer trap position register \fBy\fR and
-the footer trap itself to a nominal position specified in
-register \fBb\fR.
-In addition, if the register \fBdn\fR indicates a leftover footnote,
-\fBfz\fR is invoked to reprocess it.
-The footnote start macro \fBfn\fR begins a diversion (append) in environment 1,
-and increments the count \fBx\fR; if the count is one, the footnote separator \fBfs\fR
-is interpolated.
-The separator is kept in a separate macro to permit user redefinition.
-The footnote end macro \fBef\fR restores
-the previous environment and ends the diversion after saving the spacing size in register \fBz\fR.
-\fBy\fR is then decremented by the size of the footnote, available in \fBdn\fR;
-then on the first footnote, \fBy\fR is further decremented by the difference
-in vertical base-line spacings of the two environments, to
-prevent the late triggering the footer trap from causing the last
-line of the combined footnotes to overflow.
-The footer trap is then set to the lower (on the page) of \fBy\fR or the current page position (\fBnl\fR)
-plus one line, to allow for printing the reference line.
-If indicated by \fBx\fR, the footer \fBfo\fR rereads the footnotes from \fBFN\fR in nofill mode
-in environment 1,
-and deletes \fBFN\fR.
-If the footnotes were too large to fit, the macro \fBfx\fR will be trap-invoked to redivert
-the overflow into \fBfy\fR,
-and the register \fBdn\fR will later indicate to the header whether \fBfy\fR is empty.
-Both \fBfo\fR and \fBfx\fR are planted in the nominal footer trap position in an order
-that causes \fBfx\fR to be concealed unless the \fBfo\fR trap is moved.
-The footer then terminates the overflow diversion, if necessary, and
-zeros \fBx\fR to disable \fBfx\fR,
-because the uncertainty correction
-together with a not-too-late triggering of the footer can result
-in the footnote rereading finishing before reaching the \fBfx\fR trap.
-.pg
-A good exercise for the student is to combine the multiple-column and footnote mechanisms.
-.mh
-The Last Page
-.pg
-After the last input file has ended, \*(NR and \*(TR
-invoke the \fIend macro\fR (\(sc7), if any,
-and when it finishes, eject the remainder of the page.
-During the eject, any traps encountered are processed normally.
-At the \fIend\fR of this last page, processing terminates
-\fIunless\fR a partial line, word, or partial word remains.
-If it is desired that another page be started, the end-macro
-.x1
-&de en \e"end-macro
-\ec
-\'bp
-&&
-&em en
-.x2
-will deposit a null partial word,
-and effect another last page.
diff --git a/.ref-Research-V7/usr/doc/troff/table1 b/.ref-Research-V7/usr/doc/troff/table1
deleted file mode 100644 (file)
index c1bd5c3..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-.pn 31
-.rm mx
-.br
-.tr &&
-.tr ||
-.tr ~~
-.de aa
-.nf
-abcdefghijklmnopqrstuvwxyz
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-1234567890
-.ss9
-! $ % & ( ) ` ' * + \- . , / : ; = ? [ ] |
-.fi
-\(bu \(sq \(em \(hy \(ru \(14 \(12 \(34 \(fi \(fl \(ff
-\(Fi \(Fl
-\(de \(dg \(fm
-\(ct \(rg \(co
-.ss12
-..
-.de bb
-.ss9
-.fi
-.ll5i
-" \' \e ^ \_ \` ~ \(sl < > { } # @ \(pl \(mi \(eq \(**
-.br
-\(*a \(*b \(*g \(*d \(*e \(*z \(*y \(*h \(*i \(*k \(*l \(*m
-\(*n \(*c \(*o \(*p \(*r \(*s \(ts \(*t \(*u \(*f \(*x \(*q \(*w
-.br
-\(*G \(*D \(*H \(*L \(*C \(*P \(*S \(*U \(*F \(*Q \(*W
-.br
-\(sr \(rn \(>= \(<= \(== \(ap \(~= \(!=
-\(-> \(<- \(ua \(da \(mu
-\(di \(+- \(cu \(ca \(sb \(sp \(ib \(ip \(if \(pd
-.br
-\(sc \(gr \(no \(is \(pt \(es \(mo
-\(dd \(rh \(lh \(bs \(or \(ci
-\(lt \(lb \(rt \(rb \(lk \(rk \(bv \(lf \(rf \(lc \(rc
-\(br
-.br
-.ss12
-.nf
-..
-.nf
-.ps12
-.vs 14p
-.ft B
-.ce
-.sp 3
-Table I
-.sp
-.ce
-Font Style Examples
-.sp .5i
-.ftR
-.ps 10
-.fi
-.vs 12p
-.na
-The following fonts are printed in 12-point, with a vertical spacing of 14-point,
-and with
-non-alphanumeric characters separated by \(14\|em space.
-The Special Mathematical Font was specially prepared for Bell Laboratories
-by Graphic Systems, Inc. of Hudson, New Hampshire.
-The Times Roman, Italic, and Bold are
-among the many standard fonts available from that company.
-.sp.5i
-.ps12
-.vs14p
-.ftR
-Times Roman
-.sp.5
-.aa
-.sp
-.ftI
-Times Italic
-.sp.5
-.aa
-.sp
-.ftB
-Times Bold
-.sp.5
-.aa
-.sp
-.ftR
-Special Mathematical Font
-.sp.5
-.fi
-.ll 5i
-.bb
diff --git a/.ref-Research-V7/usr/doc/troff/table2 b/.ref-Research-V7/usr/doc/troff/table2
deleted file mode 100644 (file)
index b1e89fc..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-.pn32
-.sp 100
-.br
-.de mx
-.nf
-.ftI
-.ta .25iC .5i +.45i 3.25iC +.25i +.45i
-               Input   Character               Input   Character
-       Char    Name    Name    Char    Name    Name
-.ftR
-.sp.2
-.nr cl 0
-.mk
-..
-.br
-.tr ~~
-.nf
-.ps12
-.vs 14p
-.ft B
-.ce
-Table II
-.sp
-.ce2
-Input Naming Conventions for \', \`,and  \-
-and for Non-ASCII Special Characters
-.sp .5i
-.ftR
-.ps10
-.vs12p
-.ftB
-.bd I 3
-Non-\s-1ASCII\s+1 characters and \fIminus\fP on the standard fonts.
-.sp
-.ftR
-.de cl
-.ie \\n+(cl<2 \{.po +3.0i
-.rt \}
-.el .sc
-..
-.de sc
-.po 26i/27u
-.nr cl 0
-..
-.nr cl 0 1
-.de qq
-       \&'     \'      close quote
-       `       \`      open quote
-       \(em    \e(em   3\(sl4 Em dash
-       -       \-      hyphen or
-       \(hy    \e(hy   hyphen
-       \-      \e\-    current font minus
-       \(bu    \e(bu   bullet
-       \(sq    \e(sq   square
-       \(ru    \e(ru   rule
-       \(14    \e(14   1\(sl4
-       \(12    \e(12   1\(sl2
-       \(34    \e(34   3\(sl4
-       \(fi    \e(fi   fi
-       \(fl    \e(fl   fl
-       \(ff    \e(ff   ff
-       \(Fi    \e(Fi   ffi
-       \(Fl    \e(Fl   ffl
-       \(de    \e(de   degree
-       \(dg    \e(dg   dagger
-       \(fm    \e(fm   foot mark
-       \(ct    \e(ct   cent sign
-       \(rg    \e(rg   registered
-       \(co    \e(co   copyright
-..
-.di zz
-.lg0
-.qq
-.di
-.lg
-.mx
-.nr aa \n(dn/2
-.ne \n(aau+1
-.nr bb \n(nl+\n(aa
-.wh \n(bbu cl
-.qq
-.sp |\n(bbu
-.ch cl 12i
-.fi
-.sp2
-.ftB
-.bd I
-Non-\s-1ASCII\s+1 characters and \', \`, \_\|, \(pl, \(mi, \(eq, and \(** on the special font.
-.sp.4
-.ftR
-.fi
-.ps10
-The ASCII characters @, #, ", \', \`, <, >, \\, {, }, ~, ^, and \(ul exist
-\fIonly\fR on the special font and are printed as a 1-em space if that font
-is not mounted.
-The following characters exist only on the special font except
-for the upper case Greek letter names followed by \(dg which are mapped into
-upper case English letters in
-whatever font is mounted on font position one (default Times Roman).
-The special math plus, minus, and equals are provided to
-insulate the appearance of equations from the choice of standard fonts.
-.bd I 3
-.nf
-.ps10
-.sp
-.de sc
-.po 26i/27u
-.nr cl 0
-'bp
-..
-.ch cl \nmu-\n(.vu-1u
-.mx
-.lg 0
-       \(pl    \e(pl   math plus
-       \(mi    \e(mi   math minus
-       \(eq    \e(eq   math equals
-       \(**    \e(**   math star
-       \(sc    \e(sc   section
-       \(aa    \\(aa   acute accent
-       \(ga    \\(ga   grave accent
-       \(ul    \\(ul   underrule
-       \(sl    \\(sl   slash (matching backslash)
-       \(*a    \\(*a   alpha
-       \(*b    \\(*b   beta
-       \(*g    \\(*g   gamma
-       \(*d    \\(*d   delta
-       \(*e    \\(*e   epsilon
-       \(*z    \\(*z   zeta
-       \(*y    \\(*y   eta
-       \(*h    \\(*h   theta
-       \(*i    \\(*i   iota
-       \(*k    \\(*k   kappa
-       \(*l    \\(*l   lambda
-       \(*m    \\(*m   mu
-       \(*n    \\(*n   nu
-       \(*c    \\(*c   xi
-       \(*o    \\(*o   omicron
-       \(*p    \\(*p   pi
-       \(*r    \\(*r   rho
-       \(*s    \\(*s   sigma
-       \(ts    \\(ts   terminal sigma
-       \(*t    \\(*t   tau
-       \(*u    \\(*u   upsilon
-       \(*f    \\(*f   phi
-       \(*x    \\(*x   chi
-       \(*q    \\(*q   psi
-       \(*w    \\(*w   omega
-       \(*A    \\(*A   Alpha\(dg
-       \(*B    \\(*B   Beta\(dg
-       \(*G    \\(*G   Gamma
-       \(*D    \\(*D   Delta
-       \(*E    \\(*E   Epsilon\(dg
-       \(*Z    \\(*Z   Zeta\(dg
-       \(*Y    \\(*Y   Eta\(dg
-       \(*H    \\(*H   Theta
-       \(*I    \\(*I   Iota\(dg
-       \(*K    \\(*K   Kappa\(dg
-       \(*L    \\(*L   Lambda
-       \(*M    \\(*M   Mu\(dg
-       \(*N    \\(*N   Nu\(dg
-       \(*C    \\(*C   Xi
-       \(*O    \\(*O   Omicron\(dg
-       \(*P    \\(*P   Pi
-       \(*R    \\(*R   Rho\(dg
-       \(*S    \\(*S   Sigma
-       \(*T    \\(*T   Tau\(dg
-       \(*U    \\(*U   Upsilon
-       \(*F    \\(*F   Phi
-       \(*X    \\(*X   Chi\(dg
-       \(*Q    \\(*Q   Psi
-       \(*W    \\(*W   Omega
-       \(sr    \\(sr   square root
-       \(rn    \\(rn   root en extender
-       \(>=    \\(>=   >=
-       \(<=    \\(<=   <=
-       \(==    \\(==   identically equal
-       \(~=    \\(~=   approx =
-       \(ap    \\(ap   approximates
-       \(!=    \\(!=   not equal
-       \(->    \\(\(mi>        right arrow
-       \(<-    \\(<\(mi        left arrow
-       \(ua    \\(ua   up arrow
-       \(da    \\(da   down arrow
-       \(mu    \\(mu   multiply
-       \(di    \\(di   divide
-       \(+-    \\(+\(mi        plus-minus
-       \(cu    \\(cu   cup (union)
-       \(ca    \\(ca   cap (intersection)
-       \(sb    \\(sb   subset of
-       \(sp    \\(sp   superset of
-       \(ib    \\(ib   improper subset
-       \(ip    \\(ip   improper superset
-       \(if    \\(if   infinity
-       \(pd    \\(pd   partial derivative
-       \(gr    \\(gr   gradient
-       \(no    \\(no   not
-       \(is    \\(is   integral sign
-       \(pt    \\(pt   proportional to
-       \(es    \\(es   empty set
-       \(mo    \\(mo   member of
-       \(br    \\(br   box vertical rule
-       \(dd    \\(dd   double dagger
-       \(rh    \\(rh   right hand
-       \(lh    \\(lh   left hand
-       \(bs    \\(bs   Bell System logo
-       \(or    \\(or   or
-       \(ci    \\(ci   circle
-       \(lt    \\(lt   left top of big curly bracket
-       \(lb    \\(lb   left bottom
-       \(rt    \\(rt   right top
-       \(rb    \\(rb   right bot
-       \(lk    \\(lk   left center of big curly bracket
-       \(rk    \\(rk   right center of big curly bracket
-       \(bv    \\(bv   bold vertical
-       \(lf    \\(lf   left floor (left bottom of big
-                       square bracket)
-       \(rf    \\(rf   right floor (right bottom)
-       \(lc    \\(lc   left ceiling (left top)
-       \(rc    \\(rc   right ceiling (right top)
diff --git a/.ref-Research-V7/usr/doc/troff/tprint b/.ref-Research-V7/usr/doc/troff/tprint
deleted file mode 100755 (executable)
index 59494a5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-troff   $* m.mac m0
-tbl m0a | troff   $* m.mac -
-tbl m[1234] | troff   $* m.mac -
-troff   $* m.mac m5
-troff   $* m.mac table1
-troff   $* m.mac table2
-troff  $* m.mac add
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt.mac b/.ref-Research-V7/usr/doc/trofftut/tt.mac
deleted file mode 100644 (file)
index 01afefb..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-.tr _\(em
-.tr *\(**
-.de UL
-.if n .ul
-.if n \\$3\\$1\\$2
-.if t \\$3\f3\\$1\fP\\$2
-..
-.de UC
-\\$3\s-1\\$1\s+1\\$2
-..
-.de C
-.if n .ul
-.if n \\$3\\$1\\$2
-.if t \\$3\f3\\$1\fP\\$2
-..
-.de IT
-.if t \\$3\f2\\$1\fP\\$2
-.if n .ul
-.if n \\$3\\$1\\$2
-..
-.de UI
-\f3\\$1\fI\\$2\fR\\$3
-..
-.de P1
-.if n .ls 1
-.nf
-.              use first argument as indent if present
-.if \\n(.$ .DS I \\$1
-.if !\\n(.$ .DS I 5
-.ta .75i 1.5i 2.25i 3i 3.75i
-.tr '\'
-..
-.de P2
-.tr ''
-.DE
-.if n .ls 2
-.lg
-..
-.if t .ds m \(mi
-.if n .ds m -
-.if t .ds n \(no
-.if n .ds n -
-.if t .ds s \v'.41m'\s+4*\s-4\v'-.41m'
-.if n .ds s *
-.if t .ds S \(sl
-.if n .ds S /
-.if t .ds d \s+4\&.\&\s-4
-.if n .ds d \&.\&
-.if t .ds a \z@@
-.if n .ds a @
-.hy 14
-.      2=not last lines; 4= no -xx; 8=no xx-
-.de WS
-.sp \\$1
-..
-.   ACCENTS  say \*'e or \*`e to get e acute or e grave
-.ds ' \h'\w'e'u*4/10'\z\(aa\h'-\w'e'u*4/10'
-.ds e \o"e\'"
-.ds ` \h'\w'e'u*4/10'\z\(ga\h'-\w'e'u*4/10'
-.   UMLAUT  \*:u, etc.
-.ds : \v'-0.6m'\h'(1u-(\\n(.fu%2u))*0.13m+0.06m'\z.\h'0.2m'\z.\h'-((1u-(\\n(.fu%2u))*0.13m+0.26m)'\v'0.6m'
-.  TILDE and CIRCUMFLEX
-.ds ^ \\k:\h'-\\n(.fu+1u/2u*2u+\\n(.fu-1u*0.13m+0.06m'\z^\h'|\\n:u'
-.ds ~ \\k:\h'-\\n(.fu+1u/2u*2u+\\n(.fu-1u*0.13m+0.06m'\z~\h'|\\n:u'
-.de BD
-\&\\$3\f1\\$1\h\(ts-\w\(ts\\$1\(tsu+1u\(ts\\$1\fP\\$2\&
-..
-.hw semi-colon
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt00 b/.ref-Research-V7/usr/doc/trofftut/tt00
deleted file mode 100644 (file)
index 93bf61b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.RP
-.....TM 76-1273-7 39199 39199-11
-.TL
-A TROFF Tutorial
-.AU "MH 2C-518" 6021
-Brian W. Kernighan
-.AI
-.MH
-.OK
-Typesetting
-Text formatting
-NROFF
-.AB
-.PP
-.UL troff
-is a text-formatting program for driving the Graphic Systems
-phototypesetter on the
-.UX
-and
-.UC GCOS
-operating systems.
-This device is capable of producing high quality
-text;
-this paper is an example of
-.UL troff
-output.
-.PP
-The phototypesetter itself normally runs with four fonts,
-containing roman, italic and bold letters 
-(as on this page),
-a full greek alphabet, and a substantial number of
-special characters and mathematical symbols.
-Characters can be printed in a range of sizes,
-and placed anywhere on the page.
-.PP
-.UL troff
-allows the user full control over fonts,
-sizes, and character positions,
-as well as the usual features of a formatter _
-right-margin justification, automatic hyphenation,
-page titling and numbering, and so on.
-It also provides macros, arithmetic variables and operations,
-and conditional testing, for complicated formatting tasks.
-.PP
-This document is an introduction to the most basic use of
-.UL troff .
-It presents just enough information to enable the user
-to do simple formatting
-tasks like making viewgraphs,
-and to make incremental changes to existing packages
-of
-.UL troff
-commands.
-In most respects, the 
-.UC UNIX
-formatter
-.UL nroff
-is identical to
-.UL troff ,
-so this document also serves as a tutorial on
-.UL nroff .
-.AE
-.CS 13 1 14 0 0 5
-.if t .2C
-.nr PS 9
-.nr VS 11
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt01 b/.ref-Research-V7/usr/doc/trofftut/tt01
deleted file mode 100644 (file)
index 62adb23..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-.NH
-Introduction
-.tr ^.
-.PP
-.UL troff
-[1]
-is a text-formatting program,
-written by J. F. Ossanna,
-for producing
-high-quality printed output from the phototypesetter
-on the
-.UC UNIX
-and
-.UC GCOS
-operating systems.
-This document is an example of
-.UL troff
-output.
-.PP
-The single most important rule
-of using
-.UL troff
-is
-not to use it directly, but through some intermediary.
-In many ways,
-.UL troff
-resembles an assembly language _
-a remarkably powerful and flexible one _
-but nonetheless such that many operations must be specified
-at a level of detail and in a form that is too hard 
-for most people to use effectively.
-.PP
-For two special applications, there are programs that provide
-an interface to
-.UL troff
-for the majority of users.
-.UL eqn 
-[2]
-provides an easy to learn language for typesetting mathematics;
-the 
-.UL eqn
-user
-need know no 
-.UL troff
-whatsoever
-to typeset mathematics.
-.UL tbl
-[3]
-provides the same convenience for producing tables of arbitrary
-complexity.
-.PP
-For producing straight text (which may well contain mathematics or tables), there are a number of `macro packages'
-that define formatting rules and operations for specific styles
-of documents,
-and reduce the amount of
-direct contact with 
-.UL troff .
-In particular, the `\-ms'
-[4]
-and PWB/MM [5]
-packages
-for Bell Labs internal memoranda and external papers
-provide most of the facilities needed
-for a wide range of document preparation.
-(This memo was prepared with `\-ms'.)
-There are also packages for viewgraphs,
-for simulating the older
-.UL roff
-formatters on
-.UC UNIX
-and
-.UC GCOS ,
-and for other special applications.
-Typically you will find these packages easier to use
-than
-.UL troff
-once you get beyond the most trivial operations;
-you should always consider them first.
-.PP
-In the few cases where existing packages don't do the whole job,
-the solution is
-.ul
-not
-to write an entirely new set of
-.UL troff
-instructions from scratch, but to make small changes
-to adapt packages that already exist.
-.WS
-.PP
-In accordance with this philosophy of letting someone else
-do the work,
-the part of
-.UL troff
-described here is only a small part of the whole,
-although it tries to concentrate on the more useful parts.
-In any case, there is no attempt to be complete.
-Rather, the emphasis is on showing how to do simple things,
-and how to make incremental changes to what already exists.
-The contents of the remaining sections are:
-.sp
-.nf
-.in .1i
-.ta .3i
-\02.   Point sizes and line spacing
-\03.   Fonts and special characters
-\04.   Indents and line length
-\05.   Tabs
-\06.   Local motions: Drawing lines and characters
-\07.   Strings
-\08.   Introduction to macros
-\09.   Titles, pages and numbering
-10.    Number registers and arithmetic
-11.    Macros with arguments
-12.    Conditionals
-13.    Environments
-14.    Diversions
-       Appendix: Typesetter character set
-.sp
-.in 0
-.fi
-The
-.UL troff
-described here is the C-language version running on
-.UC UNIX
-at
-Murray Hill,
-as documented in [1].
-.WS
-.PP
-To use
-.UL troff
-you have to prepare not only the actual text you want printed,
-but some information that tells
-.ul
-how
-you want it printed.
-(Readers who use
-.UL roff
-will find the approach familiar.)
-For
-.UL troff
-the text
-and
-the formatting information are often intertwined quite intimately.
-Most commands to
-.UL troff
-are placed on a line separate from the text itself,
-beginning with a period (one command per line).
-For example,
-.P1
-Some text.
-^ps 14
-Some more text.
-.P2
-will change the `point size',
-that is,
-the size of the letters being printed,
-to `14 point' (one point is 1/72 inch) like this:
-.P1
-.fi
-Some text.
-.ps 14
-Some more text.
-.ps 10
-.P2
-.PP
-Occasionally, though,
-something special occurs in the middle of a line _
-to produce
-.P1
-Area = \(*p\fIr\fR\|\s8\u2\d\s0
-.P2
-you have to type
-.P1
-Area = \e(*p\efIr\efR\e\^|\^\es8\eu2\ed\es0
-.P2
-(which we will explain shortly).
-The backslash character
-.BD  \e 
-is used 
-to introduce
-.UL troff
-commands and special characters within a line of text.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt02 b/.ref-Research-V7/usr/doc/trofftut/tt02
deleted file mode 100644 (file)
index fba7d22..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-.NH
-Point Sizes; Line Spacing
-.PP
-As mentioned above,
-the command
-.BD .ps
-sets the point size.
-One point is 1/72 inch,
-so 6-point characters are at most 1/12 inch high,
-and 36-point characters are \(12 inch.
-There are 15 point sizes, listed below.
-.P1 1
-.ps 6
-6 point: Pack my box with five dozen liquor jugs.
-.ps 7
-.vs 8p
-7 point: Pack my box with five dozen liquor jugs.
-.vs 9p
-.ps 8
-8 point: Pack my box with five dozen liquor jugs.
-.vs 10p
-.ps 9
-9 point: Pack my box with five dozen liquor jugs.
-.vs 11p
-.ps 10
-10 point: Pack my box with five dozen liquor
-.vs 12p
-.ps 11
-11 point: Pack my box with five dozen 
-.vs 14p
-.ps 12
-12 point: Pack my box with five dozen
-.vs 16p
-.ps 14
-14 point: Pack my box with five
-.vs 24p
-\s1616 point\s18 18 point\s20 20 point
-.vs 40p
-\s2222\s24 24\s28 28\s36 36
-.ps 10
-.vs 12p
-.P2
-.PP
-If the number after
-.BD .ps 
-is not one of these
-legal sizes,
-it is rounded up to the next valid value,
-with a maximum of 36.
-If no number follows
-.BD .ps ,
-.UL troff
-reverts to the previous size, whatever it was.
-.UL troff
-begins with point size 10,
-which is usually fine.
-This document is in 9 point.
-.PP
-The point size can also be changed in the middle of a line
-or even a word
-with the in-line command
-.BD \es .
-To produce
-.P1
-\s8UNIX\s10 runs on a \s8PDP-\s1011/45
-.P2
-type
-.P1
-\es8UNIX\es10 runs on a \es8PDP-\es1011/45
-.P2
-As above,
-.BD \es 
-should be followed by a legal point size,
-except that
-.BD \es0 
-causes the size to revert to
-its previous value.
-Notice that
-.BD \es1011
-can be understood correctly as `size 10, followed by an 11', if the size is legal,
-but not otherwise.
-Be cautious with similar constructions.
-.PP
-Relative size changes are also legal and useful:
-.P1
-\es\-2UNIX\es+2
-.P2
-temporarily decreases the size, whatever it is, by two points, then
-restores it.
-Relative size changes have the advantage that the size difference
-is independent of the starting size of the document.
-The amount of the relative change is restricted
-to a single digit.
-.WS
-.PP
-The other parameter that determines what the type looks like
-is the spacing between lines,
-which is set independently of the point size.
-Vertical spacing is measured from the bottom of one line to
-the bottom of the next.
-The command to control vertical spacing is
-.BD .vs .
-For running text, it is usually best to set the vertical spacing
-about 20% bigger than the character size.
-For example, so far in this document, we have used
-``9 on 11'', that is,
-.P1
-^ps 9
-^vs 11p
-.P2
-If we changed to
-.P1
-^ps 9
-^vs 9p
-.P2
-.vs 9p
-.ne 3
-the running text would look like this.
-After a few lines, you will agree it looks a little cramped.
-The right vertical spacing is partly a matter of taste, depending on how
-much text you want to squeeze into a given space,
-and partly a matter of traditional printing style.
-By default,
-.UL troff
-uses 10 on 12.
-.PP
-.vs 14p
-.ps 12
-Point size and vertical spacing make a substantial difference in the amount of text
-per square inch.
-This is 12 on 14.
-.ne 2
-.PP
-.ne 2
-.ps 6
-.vs 7p
-Point size and vertical spacing make a substantial difference in the amount of text
-per square inch.
-For example,
-10 on 12 uses about twice as much space as 7 on 8.
-This is 6 on 7, which is even smaller.
-It packs a lot more words per line,
-but you can go blind trying to read it.
-.PP
-When used without arguments,
-.BD .ps
-and
-.BD .vs
-revert to the previous size and vertical spacing
-respectively.
-.WS
-.PP
-The command
-.BD .sp
-is used to get extra vertical space.
-Unadorned, 
-it gives you one extra blank line (one
-.BD .vs ,
-whatever that has been set to).
-Typically, that's more or less than you want,
-so
-.BD .sp
-can be followed by
-information about how much space you want _
-.P1
-^sp 2i
-.P2
-means `two inches of vertical space'.
-.P1
-^sp 2p
-.P2
-means `two points of vertical space';
-and
-.P1
-^sp 2
-.P2
-means `two vertical spaces' _ two of whatever
-.BD .vs
-is set to
-(this can also be made explicit with
-.BD .sp\ 2v );
-.UL troff
-also understands decimal fractions in most places,
-so
-.P1
-^sp 1.5i
-.P2
-is a space of 1.5 inches.
-These same scale factors can be used after
-.BD .vs
-to define line spacing, and in fact after most commands
-that deal with physical dimensions.
-.PP
-It should be noted that all size numbers are converted internally
-to `machine units', which are 1/432 inch
-(1/6 point).
-For most purposes, this is enough resolution
-that you don't have to worry about the accuracy of the representation.
-The situation is not quite so good vertically,
-where resolution is 1/144 inch
-(1/2 point).
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt03 b/.ref-Research-V7/usr/doc/trofftut/tt03
deleted file mode 100644 (file)
index e1c637a..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-.NH
-Fonts and Special Characters
-.PP
-.UL troff
-and the typesetter allow four different fonts at any one time.
-Normally three fonts (Times roman, italic and bold) and one collection of special characters
-are permanently
-mounted.
-.P1 2
-.ft R
-abcdefghijklmnopqrstuvwxyz 0123456789
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-.ft I
-abcdefghijklmnopqrstuvwxyz 0123456789
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-.ft B
-abcdefghijklmnopqrstuvwxyz 0123456789
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-.ft R
-.P2
-The
-greek, mathematical symbols and miscellany
-of the special font are
-listed in Appendix A.
-.PP
-.UL troff
-prints in roman unless told otherwise.
-To switch into bold, use
-the
-.BD .ft
-command
-.P1
-^ft B
-.P2
-and for italics,
-.P1
-^ft I
-.P2
-To return to roman, use
-.BD .ft\ R ;
-to return to the previous font,
-whatever it was,
-use either
-.BD .ft\ P
-or just
-.BD .ft  .
-The `underline' command
-.P1
-^ul
-.P2
-causes the next input line to print in italics.
-.BD .ul
-can be followed by a count to
-indicate that more than one line is to be italicized.
-.PP
-Fonts can also be changed within a line or word
-with the in-line command
-.BD \ef :
-.P1
-\fBbold\fIface\fR text
-.P2
-is produced by
-.P1
-\efBbold\efIface\efR text
-.P2
-If you want to do this so the previous font, whatever it was,
-is left undisturbed, insert extra
-.BD \efP
-commands, like this:
-.P1
-\efBbold\efP\efIface\efP\efR text\efP
-.P2
-Because only the immediately previous font is remembered,
-you have to restore the previous font after each change
-or you can lose it.
-The same is true of 
-.BD .ps
-and
-.BD .vs
-when used without an argument.
-.PP
-There are other fonts available besides the standard set,
-although you can still use only four at any given time.
-The command
-.BD .fp
-tells
-.UL troff
-what fonts are physically mounted on the typesetter:
-.P1
-^fp 3 H
-.P2
-says that the Helvetica font is mounted on position 3.
-(For a complete list of fonts and what they look like,
-see the 
-.UL troff 
-manual.)
-Appropriate
-.BD .fp
-commands should appear at the beginning of your document
-if you do not use the standard fonts.
-.PP
-It is possible to make a document relatively independent
-of the actual fonts used to print it
-by using font numbers instead of names;
-for example,
-.BD \ef3
-and
-.BD .ft~3
-mean `whatever font is mounted at position 3',
-and thus work for any setting.
-Normal settings are roman font on 1, italic on 2,
-bold on 3,
-and special on 4.
-.PP
-There is also a way to get `synthetic' bold fonts
-by overstriking letters with a slight offset.
-Look at the
-.BD .bd
-command in [1].
-.WS
-.PP
-Special characters have four-character names beginning with
-.BD \e( ,
-and they may be inserted anywhere.
-For example,
-.P1
-\(14 + \(12 = \(34
-.P2
-is produced by
-.P1
-\e(14 + \e(12 = \e(34
-.P2
-In particular,
-greek letters are all of the form
-.BD  \e(*\- ,
-where
-.BD \-
-is an upper or lower case roman letter
-reminiscent of the greek.
-Thus
-to get
-.P1
-\(*S(\(*a\(mu\(*b) \(-> \(if
-.P2
-in bare
-.UL troff
-we have to type
-.P1
-\e(*S(\e(*a\e(mu\e(*b) \e(\(mi> \e(if
-.P2
-That line is unscrambled as follows:
-.P1
-.ta 1i 2i 3i
-\e(*S  \(*S
-(      (
-\e(*a  \(*a
-\e(mu  \(mu
-\e(*b  \(*b
-)      )
-\e(\(mi>       \(->
-\e(if  \(if
-.P2
-A complete list of these special names occurs in Appendix A.
-.PP
-In
-.UL eqn 
-[2]
-the same effect can be achieved with the input
-.P1
-SIGMA ( alpha times beta ) \-> inf
-.P2
-which is less concise, but clearer to the uninitiated.
-.PP
-Notice that
-each
-four-character name is a single character
-as far as
-.UL troff
-is concerned _
-the
-`translate' command
-.P1
-^tr \e(mi\e(em
-.P2
-is perfectly clear, meaning
-.P1
-^tr \(mi\(em
-.P2
-that is, to translate \(mi into \(em.
-.PP
-Some characters are automatically translated into others:
-grave  \(ga  and acute  \(aa  accents (apostrophes) become open and close single quotes
-`~';
-the combination of ``...'' is generally preferable to the double quotes "...".
-Similarly a typed minus sign becomes a hyphen -.
-To print an explicit \- sign, use
-.BD \e- .
-To get a backslash printed, use
-.BD \ee .
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt04 b/.ref-Research-V7/usr/doc/trofftut/tt04
deleted file mode 100644 (file)
index 9a451eb..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-.NH
-Indents and Line Lengths
-.PP
-.UL troff
-starts with a line length of 6.5 inches,
-too wide for 8\(12\(mu11 paper.
-To reset the line length,
-use
-the
-.BD .ll
-command, as in
-.P1
-^ll 6i
-.P2
-As with
-.BD .sp ,
-the actual length can be specified in several ways;
-inches are probably the most intuitive.
-.PP
-The maximum line length provided by the typesetter is 7.5 inches, by the way.
-To use the full width, you will have to reset the default physical left margin (``page offset''),
-which is normally slightly less than one inch from the left edge
-of the paper.
-This is done by the
-.BD .po
-command.
-.P1
-^po 0
-.P2
-sets the offset as far to the left as it will go.
-.WS
-.PP
-The indent command
-.BD .in
-causes the left margin to be indented
-by some specified amount from the page offset.
-If we use
-.BD .in
-to move the left margin in,
-and
-.BD .ll
-to move the right margin to the left,
-we can
-make offset blocks of text:
-.P1
-^in 0.3i
-^ll \(mi0.3i
-text to be set into a block
-^ll +0.3i
-^in \(mi0.3i
-.P2
-will create a block that looks like this:
-.P1
-.fi
-.ll -0.3i
-Pater noster qui est in caelis sanctificetur nomen tuum;
-adveniat regnum tuum; fiat voluntas tua, sicut in caelo,
-et in terra. ...
-Amen.
-.ll +0.3i
-.P2
-Notice the use of `+' and `\(mi'
-to specify the amount of change.
-These change the previous setting by the specified amount,
-rather than just overriding it.
-The distinction is quite important:
-.BD .ll\ +1i
-makes lines one inch longer;
-.BD .ll\ 1i
-makes them one inch
-.ul
-long.
-.PP
-With 
-.BD .in ,
-.BD .ll
-and
-.BD .po ,
-the previous value is used if no argument is specified.
-.PP
-To indent a single line, use the `temporary indent'
-command
-.BD .ti .
-For example, all paragraphs in this memo
-effectively begin with the command
-.P1
-^ti 3
-.P2
-Three of what?
-The default unit for
-.BD .ti ,
-as for most horizontally oriented commands
-.BD .ll , (
-.BD .in ,
-.BD .po ),
-is ems;
-an em is roughly the width of the letter `m'
-in the current point size.
-(Precisely, a em in size
-.ul
-p
-is
-.ul
-p
-points.)
-Although inches are usually clearer than ems to people who don't set type
-for a living,
-ems have a place:
-they are a measure of size that is proportional to the current point size.
-If you want to make text that keeps its proportions
-regardless of point size,
-you should use ems for all dimensions.
-Ems can be specified as scale factors directly,
-as in
-.BD .ti\ 2.5m .
-.PP
-Lines can also be indented negatively
-if the indent is already positive:
-.P1
-^ti \(mi0.3i
-.P2
-causes the next line to be moved back three tenths of an inch.
-Thus to make a decorative initial capital,
-we indent the whole paragraph, then move the letter `P' back with
-a
-.BD .ti
-command:
-.P1
-.ll -0.3i
-.fi
-.in +.3i
-.ti -0.3i
-\s36\v'2'P\v'-2'\s0ater noster qui est in caelis sanctificetur
-nomen tuum;
-adveniat regnum tuum;
-'in -.3i
-fiat voluntas tua,
-sicut in caelo, et in terra. ...
-Amen.
-.ll +0.3i
-.P2
-Of course, there is also some trickery to make the `P'
-bigger (just a `\es36P\es0'),
-and to move it
-down from its normal position
-(see the section on local motions).
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt05 b/.ref-Research-V7/usr/doc/trofftut/tt05
deleted file mode 100644 (file)
index d75e35f..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-.NH
-Tabs
-.PP
-Tabs
-(the \s8ASCII\s0 `horizontal tab' character)
-can be used to produce output in columns,
-or to set the horizontal position of output.
-Typically
-tabs are used only in unfilled text.
-Tab stops are set by default every half inch from the
-current indent,
-but
-can be changed by the
-.BD .ta
-command.
-To set stops every inch, for example,
-.P1
-^ta 1i 2i 3i 4i 5i 6i
-.P2
-.PP
-Unfortunately the stops are left-justified only
-(as on a typewriter),
-so lining up columns of right-justified numbers can be painful.
-If you have many numbers,
-or if you need more complicated table layout,
-.ul
-don't
-use
-.UL troff 
-directly;
-use the
-.UL tbl
-program described in [3].
-.PP
-For a handful of numeric columns, you can do it this way:
-Precede every number by enough blanks to make it line up
-when typed.
-.P1
-^nf
-^ta 1i 2i 3i
-\0\01\0\fItab\fR\0\0\02\0\fItab\fR\0\0\03
-\040\0\fItab\fR\0\050\0\fItab\fR\0\060
-700\0\fItab\fR\0800\0\fItab\fR\0900
-^fi
-.P2
-Then change each leading blank into the string
-.BD \e0 .
-This is a character that does not print, but that has
-the same width as a digit.
-When printed, this will produce
-.P1
-.ta 1i 2i 3i
-\0\01  \0\02   \0\03
-\040   \050    \060
-700    800     900
-.P2
-.PP
-It is also possible to fill up tabbed-over space with
-some character other than blanks by setting the `tab replacement character'
-with the
-.BD .tc
-command:
-.P1
-^ta 1.5i 2.5i
-^tc \e(ru      (\e(ru is "\(ru")
-Name \fItab\fR Age \fItab\fR 
-.P2
-produces
-.P1 3
-.ta 1.5i 2.5i
-.tc \(ru
-Name    Age    
-.tc
-.P2
-To reset the tab replacement character to a blank, use
-.BD .tc
-with no argument.
-(Lines can also be drawn with the
-.BD \el
-command, described in Section 6.)
-.PP
-.UL troff
-also provides a very general mechanism called `fields'
-for setting up complicated columns.
-(This is used by
-.UL tbl ).
-We will not go into it in this paper.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt06 b/.ref-Research-V7/usr/doc/trofftut/tt06
deleted file mode 100644 (file)
index 0d74606..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-.NH
-Local Motions: Drawing lines and characters
-.PP
-Remember `Area = \(*pr\u2\d' and the big `P'
-in the Paternoster.
-How are they done?
-.UL troff
-provides a host of commands for placing characters of any size
-at any place.
-You can use them to draw special characters 
-or to tune your output for a particular appearance.
-Most of these commands are straightforward, but messy to read
-and tough to type correctly.
-.PP
-If you won't use 
-.UL eqn ,
-subscripts and superscripts are most easily done with
-the half-line local motions
-.BD \eu
-and
-.BD \ed .
-To go back up the page half a point-size, insert a
-.BD \eu
-at the desired place;
-to go down, insert a
-.BD \ed .
-.BD \eu \& (
-and
-.BD \ed
-should always
-be used in pairs, as explained below.)
-Thus
-.P1
-Area = \e(*pr\eu2\ed
-.P2
-produces
-.P1
-Area = \(*pr\u2\d
-.P2
-To make the `2' smaller, bracket it with
-.BD \es\-2...\es0 .
-Since
-.BD \eu
-and
-.BD \ed
-refer to the current point size,
-be sure to put them either both inside or both outside
-the size changes,
-or you will get an unbalanced vertical motion.
-.PP
-Sometimes the space given by
-.BD \eu
-and
-.BD \ed
-isn't the right amount.
-The 
-.BD \ev
-command can be used to request an arbitrary amount of vertical motion.
-The in-line command
-.P1
-\ev'(amount)'
-.P2
-causes motion up or down the page by the amount specified in
-`(amount)'.
-For example, to move the `P' down, we used
-.P1 2
-.ta 1i
-^in +0.6i      (move paragraph in)
-^ll \-0.3i     (shorten lines)
-^ti \-0.3i     (move P back)
-\ev'2'\es36P\es0\ev'\-2'ater noster qui est
-in caelis ...
-.P2
-A minus sign causes upward motion, while
-no sign or a plus sign means down the page.
-Thus
-.BD \ev\(fm\-2\(fm
-causes an upward vertical motion 
-of two line spaces.
-.PP
-There are many other ways to specify the amount of motion _
-.P1
-\ev'0.1i'
-\ev'3p'
-\ev'\-0.5m'
-.P2
-and so on are all legal.
-Notice that the scale specifier
-.BD i
-or
-.BD p
-or
-.BD m
-goes inside the quotes.
-Any character can be used in place of the quotes;
-this is also true of all other
-.UL troff
-commands described in this section.
-.PP
-Since
-.UL troff
-does not take within-the-line vertical motions into account
-when figuring out where it is on the page,
-output lines can have unexpected positions
-if the left and right ends aren't at the same
-vertical position.
-Thus
-.BD \ev ,
-like
-.BD \eu
-and
-.BD \ed ,
-should always balance upward vertical motion in a line with
-the same amount in the downward direction.
-.PP
-Arbitrary horizontal motions are also available _
-.BD \eh
-is quite analogous to
-.BD \ev ,
-except that the default scale factor is ems instead of line spaces.
-As an example,
-.P1
-\eh'\-0.1i'
-.P2
-causes a backwards motion of a tenth of an inch.
-As a practical matter, consider printing the mathematical symbol
-`>>'.
-The default spacing is too wide, so
-.UL eqn
-replaces this by
-.P1
->\eh'\-0.3m'>
-.P2
-to produce >\h'-.3m'>.
-.PP
-Frequently
-.BD \eh
-is used with the `width function'
-.BD \ew
-to generate motions equal to the width
-of some character string.
-The construction
-.P1
-\ew'thing'
-.P2
-is a number equal to the width of `thing' in machine units
-(1/432 inch).
-All
-.UL troff
-computations are ultimately done in these units.
-To move horizontally the width of an `x',
-we can say
-.P1
-\eh'\ew'x'u'
-.P2
-As we mentioned above,
-the default scale factor for
-all horizontal dimensions is
-.BD m ,
-ems, so here we must have the
-.BD u
-for machine units,
-or the motion produced will be far too large.
-.UL troff
-is quite happy with the nested quotes, by the way,
-so long as you don't leave any out.
-.PP
-As a live example of this kind of construction,
-all of the command names in the text, like
-.BD .sp ,
-were done by overstriking with a slight offset.
-The commands for
-.BD .sp
-are
-.P1
-^sp\eh'\-\ew'.sp'u'\eh'1u'.sp
-.P2
-That is, put out `.sp', move left by the width of `.sp',
-move right 1 unit, and print
-`.sp' again.
-(Of course there is a way to avoid typing that much input
-for each command name, which we will discuss in Section 11.)
-.WS
-.PP
-There are also several special-purpose
-.UL troff
-commands for local motion.
-We have already seen
-.BD \e0 ,
-which is an unpaddable white space
-of the same width as a digit.
-`Unpaddable' means that it will never be widened
-or split across a line by line justification and filling.
-There is also
-.BD \e (blank),
-.tr ^^
-which is an unpaddable character the width of a space,
-.BD \e| ,
-which is half that width,
-.BD \e^ ,
-which is one quarter of the width of a space,
-and
-.BD \e& ,
-which has zero width.
-.tr ^.
-(This last one is useful, for example, in entering
-a text line which would otherwise begin with a `.'.)
-.PP
-The command
-.BD \eo ,
-used like
-.P1
-\eo'set of characters'
-.P2
-causes (up to 9)
-characters to be overstruck,
-centered on the widest.
-This is nice for accents, as in
-.P1 2
-syst\eo"e\e(ga"me t\eo"e\e(aa"l\eo"e\e(aa"phonique
-.P2
-which makes
-.P1
-syst\o"e\(ga"me t\o"e\(aa"l\o"e\(aa"phonique
-.P2
-The accents are
-.BD \e(ga
-and
-.BD \e(aa ,
-or
-.BD \e\` 
-and
-.BD \e\' ;
-remember that each is just one character to
-.UL troff .
-.PP
-You can make your own overstrikes with another special convention,
-.BD \ez ,
-the zero-motion command.
-.BD \ezx
-suppresses the normal horizontal motion
-after printing the single character
-.BD x ,
-so another character can be laid on top of it.
-Although sizes can be changed within
-.BD \eo ,
-it centers the characters on the widest,
-and
-there can be no horizontal or vertical motions,
-so
-.BD \ez
-may be the only way to get what you want:
-.P1
-.sp 2
-\s8\z\(sq\s14\z\(sq\s22\z\(sq\s36\(sq
-.P2
-is produced by
-.P1
-^sp 2
-\es8\ez\e(sq\es14\ez\e(sq\es22\ez\e(sq\es36\e(sq
-.P2
-The
-.BD .sp
-is needed to leave room for the result.
-.PP
-As another example, an extra-heavy semicolon
-that looks like
-.P1
-\s+6\z,\v'-0.25m'.\v'0.25m'\s0  instead of  ;  or  \s+6;\s0
-.P2
-can be constructed with a big comma and a big period above it:
-.P1
-\es+6\ez,\ev'\(mi0.25m'.\ev'0.25m'\es0 
-.P2
-`0.25m' is an empirical constant.
-.PP
-A more ornate overstrike is given by the bracketing function
-.BD \eb ,
-which piles up characters vertically,
-centered on the current baseline.
-Thus we can get big brackets,
-constructing them with piled-up smaller pieces:
-.P1
-.sp
-.ne 3
-\b'\(lt\(lk\(lb' \b'\(lc\(lf' x \b'\(rc\(rf' \b'\(rt\(rk\(rb'
-.sp
-.P2
-by typing in only this:
-.P1 0
-\&^sp
-\eb\(fm\e(lt\e(lk\e(lb\(fm \eb\(fm\e(lc\e(lf\(fm x \eb\(fm\e(rc\e(rf\(fm \eb\(fm\e(rt\e(rk\e(rb\(fm
-.P2
-.PP
-.UL troff
-also provides a convenient facility for drawing horizontal and vertical
-lines of arbitrary length with arbitrary characters.
-.BD \el\(fm1i\(fm
-draws a line one inch long, like this:
-\l'1i'\|.
-The length can be followed by
-the character to use if the \(ru isn't appropriate;
-.BD \el\(fm0.5i.\(fm
-draws a half-inch line of dots: \l'.5i.'.
-The construction
-.BD \eL
-is entirely analogous,
-except that it draws a vertical line instead of horizontal.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt07 b/.ref-Research-V7/usr/doc/trofftut/tt07
deleted file mode 100644 (file)
index 7059f68..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-.NH
-Strings
-.PP
-Obviously if a paper contains a large number of occurrences
-of an acute accent over a letter `e',
-typing
-.BD \eo"e\e\'"
-for each \*e
-would be a great nuisance.
-.PP
-Fortunately,
-.UL troff
-provides a way in which you can store an arbitrary
-collection of text in a `string',
-and thereafter use the string name as a shorthand
-for its contents.
-Strings are one of several
-.UL troff
-mechanisms whose judicious use
-lets you type a document
-with less effort and organize
-it
-so that extensive format changes
-can be made with few editing changes.
-.PP
-A reference to a string is replaced by whatever
-text
-the string was defined as.
-Strings are defined with the command
-.BD .ds .
-The line
-.P1
-\&^ds e \eo"e\e'"
-.P2
-defines the string
-.BD e
-to have the value
-.BD \eo"e\e\'"
-.PP
-String names may be either one or two characters long,
-and are referred to by
-.BD \e*x
-for one character names or
-.BD \e*(xy
-for two character names.
-Thus to get
-t\*el\*ephone,
-given the definition of the string
-.BD e
-as above,
-we can say
-t\e*el\e*ephone.
-.PP
-If a string must begin with blanks, define it as
-.P1
-\&.ds xx "      text
-.P2
-The double quote signals the beginning of the definition.
-There is no trailing quote;
-the end of the line terminates the string.
-.PP
-A string may actually be several lines long;
-if
-.UL troff
-encounters a 
-.BD \e
-at the end of
-.ul
-any
-line, it is thrown away and the next line
-added to the current one.
-So you can make a long string simply by ending each line
-but the last with a backslash:
-.P1
-\&^ds xx this \e
-is a very \e
-long string
-.P2
-.PP
-Strings may be defined in terms of other strings, or even in terms of themselves;
-we will discuss some of these possibilities later.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt08 b/.ref-Research-V7/usr/doc/trofftut/tt08
deleted file mode 100644 (file)
index 28b081e..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-.NH
-Introduction to Macros
-.PP
-Before we can go much further in
-.UL troff ,
-we need to learn a bit about the
-macro
-facility.
-In its simplest form, a macro is just a shorthand notation
-quite similar to a string.
-Suppose we want every paragraph to start
-in exactly the same way _
-with a space and a temporary indent of two ems:
-.P1
-^sp
-^ti +2m
-.P2
-Then to save typing, we would like to collapse these into
-one shorthand line,
-a
-.UL troff
-`command' like
-.P1
-^PP
-.P2
-that would be treated by
-.UL troff
-exactly as
-.P1
-^sp
-^ti +2m
-.P2
-.BD .PP
-is called a
-.ul
-macro.
-The way we tell
-.UL troff
-what
-.BD .PP
-means is to
-.ul
-define
-it with the
-.BD .de
-command:
-.P1
-^de PP
-^sp
-^ti +2m
-^^
-.P2
-The first line names the macro
-(we used
-.BD .PP ' `
-for `paragraph',
-and upper case so it wouldn't conflict with
-any name that
-.UL troff
-might
-already know about).
-The last line
-.BD ..
-marks the end of the definition.
-In between is the text,
-which is simply inserted whenever
-.UL troff
-sees the `command'
-or macro call
-.P1
-^PP
-.P2
-A macro
-can contain any mixture of text and formatting commands.
-.PP
-The definition of
-.BD .PP
-has to precede its first use;
-undefined macros are simply ignored.
-Names are restricted to one or two characters.
-.PP
-Using macros for commonly occurring sequences of commands
-is critically important.
-Not only does it save typing,
-but it makes later changes much easier.
-Suppose we decide that the paragraph indent is too small,
-the vertical space is much too big,
-and roman font should be forced.
-Instead of changing the whole document,
-we need only change the definition of
-.BD .PP
-to
-something like
-.P1
-^de PP \e" paragraph macro
-^sp 2p
-^ti +3m
-^ft R
-^^
-.P2
-and the change takes
-effect everywhere we used
-.BD .PP .
-.PP
-.BD \e"
-is a
-.UL troff
-command that causes the rest of the line to be ignored.
-We use it here to add comments to the macro
-definition
-(a wise idea once definitions get complicated).
-.PP
-As another example of macros,
-consider these two which start and end a block of offset,
-unfilled text, like most of the examples in this paper:
-.P1
-^de BS \e" start indented block
-^sp
-^nf
-^in +0.3i
-^^
-^de BE \e" end indented block
-^sp
-^fi
-^in \(mi0.3i
-^^
-.P2
-Now we can surround text like
-.P1
-Copy to
-John Doe
-Richard Roberts
-Stanley Smith
-.P2
-by the commands
-.BD .BS
-and
-.BD .BE ,
-and it will come out as it did above.
-Notice that we indented by
-.BD .in\ +0.3i
-instead of
-.BD .in\ 0.3i .
-This way we can nest our uses of
-.BD .BS
-and
-.BD BE
-to get blocks within blocks.
-.PP
-If later on we decide that the indent
-should be 0.5i, then it is only necessary to
-change the definitions of
-.BD .BS
-and
-.BD .BE ,
-not the whole paper.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt09 b/.ref-Research-V7/usr/doc/trofftut/tt09
deleted file mode 100644 (file)
index 83952ef..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-.NH
-Titles, Pages and Numbering
-.PP
-This is an area where things get tougher,
-because nothing is done for you automatically.
-Of necessity, some of this section is a cookbook,
-to be copied literally until you get some experience.
-.PP
-Suppose you want a title at the top of each page,
-saying just
-.sp 3p
-.lt 2.8i
-.tl '~~~~left top'center top'right top~~~~'
-.lt
-.sp 3p
-In
-.UL roff ,
-one can say
-.P1 2
-^he 'left top'center top'right top'
-^fo 'left bottom'center bottom'right bottom'
-.P2
-to get headers and footers automatically on every page.
-Alas, this doesn't work in
-.UL troff ,
-a serious hardship for the novice.
-Instead you have to do a lot of specification.
-.PP
-You have to say what the actual title is (easy);
-when to print it (easy enough);
-and what to do at and around the title line (harder).
-Taking these in reverse order,
-first we define a macro
-.BD .NP
-(for `new page') to process
-titles and the like at the end of one page
-and the beginning of the next:
-.P1
-^de NP
-\(fmbp
-\(fmsp 0.5i
-\&.tl 'left top'center top'right top'
-\(fmsp 0.3i
-^^
-.P2
-To make sure we're at the top of a page,
-we issue a `begin page' command
-.BD \(fmbp ,
-which causes a skip to top-of-page
-(we'll explain the
-.BD \(fm
-shortly).
-Then we space down half an inch,
-print the title
-(the use of
-.BD .tl
-should be self explanatory; later we will discuss parameterizing the titles),
-space another 0.3 inches,
-and we're done.
-.PP
-To ask for
-.BD .NP
-at the bottom of each page,
-we have to say something like
-`when the text is within an inch
-of the bottom of the page,
-start the processing
-for a new page.'
-This is done with a `when' command
-.BD .wh :
-.P1
-^wh  \-1i  NP
-.P2
-(No `.' is used before NP;
-this is simply the name of a macro, not a macro call.)
-The minus sign means
-`measure up from the bottom of the page',
-so
-`\-1i' means `one inch from the bottom'.
-.PP
-The
-.BD .wh
-command appears in the input outside the definition of
-.BD .NP ;
-typically the input would be
-.P1
-^de NP
-^^^
-^^
-^wh \-1i NP
-.P2
-.PP
-Now what happens?
-As text is actually being output,
-.UL troff 
-keeps track of its vertical position on the page,
-and after a line is printed within one inch from the bottom,
-the
-.BD .NP
-macro is activated.
-(In the jargon, the
-.BD .wh
-command sets a
-.ul
-trap
-at the specified place,
-which is `sprung' when that point is passed.)
-.BD .NP
-causes a skip to the top of the next page
-(that's what the
-.BD \(fmbp
-was for),
-then prints the title with the appropriate margins.
-.PP
-Why
-.BD \(fmbp
-and
-.BD \(fmsp 
-instead of
-.BD .bp
-and
-.BD .sp ?
-The answer is that
-.BD .sp
-and
-.BD .bp ,
-like several other commands,
-cause a
-.ul
-break
-to take place.
-That is, all the input text collected but not yet printed
-is flushed out as soon as possible,
-and the next input line is guaranteed to start
-a new line of output.
-If we had used
-.BD .sp
-or
-.BD .bp
-in the
-.BD .NP
-macro,
-this would cause a break in the middle
-of the current output line when a new page is started.
-The effect would be to print the left-over part of that line
-at the top of the page, followed by the next input line on a new output line.
-This is
-.ul
-not
-what we want.
-Using
-.BD \(fm
-instead of
-.BD . 
-for a command
-tells
-.UL troff 
-that
-no break is to take place _
-the output line
-currently being filled
-should
-.ul
-not
-be forced out before the space or new page.
-.PP
-The list of commands that cause a break 
-is short and natural:
-.P1
-^bp   ^br   ^ce   ^fi   ^nf   ^sp   ^in   ^ti
-.P2
-All others cause
-.ul
-no
-break,
-regardless of whether you use a
-.BD .
-or a 
-.BD \(fm .
-If you really need a break, add a
-.BD .br 
-command at the appropriate place.
-.PP
-One other thing to beware of _
-if you're changing fonts or point sizes a lot,
-you may find that
-if you cross a page boundary
-in an unexpected font or size,
-your titles come out in that size and font
-instead of what you intended.
-Furthermore, the length of a title is independent of the current line length,
-so titles will come out at the default length of 6.5 inches
-unless you change it,
-which is done with the
-.BD .lt
-command.
-.PP
-There are several ways to fix the problems of point sizes
-and fonts in titles.
-For the simplest applications, we can change
-.BD .NP 
-to set the proper size and font for the title,
-then restore the previous values, like this:
-.P1 2
-.ta .8i
-^de NP
-\(fmbp
-\(fmsp 0.5i
-^ft R  \e" set title font to roman
-^ps 10 \e" and size to 10 point
-^lt 6i \e" and length to 6 inches
-^tl 'left'center'right'
-^ps    \e" revert to previous size
-^ft P  \e" and to previous font
-\(fmsp 0.3i
-^^
-.P2
-.PP
-This version of
-.BD .NP
-does
-.ul
-not
-work if the fields in the
-.BD .tl
-command contain size or font changes.
-To cope with that
-requires
-.UL troff 's
-`environment' mechanism,
-which we will discuss in Section 13.
-.PP
-To get a footer at the bottom of a page,
-you can modify
-.BD .NP
-so it does
-some processing before
-the
-.BD \(fmbp
-command,
-or split the job into a footer macro invoked
-at the bottom margin and a header macro invoked
-at the top of the page.
-These variations are left as exercises.
-.WS
-.PP
-Output page numbers are computed automatically
-as each page is produced (starting at 1),
-but no numbers are printed unless you ask for them explicitly.
-To get page numbers printed,
-include the character
-.BD %
-in the
-.BD .tl
-line at
-the position where you want the number to appear.
-For example
-.P1
-^tl ''- % -''
-.P2
-centers the page number inside hyphens, as on this page.
-You can set the page number at any time
-with either
-.BD .bp\ n ,
-which immediately starts a new page numbered
-.BD n ,
-or with
-.BD .pn\ n ,
-which sets the page number for the next page
-but doesn't cause a skip to the new page.
-Again,
-.BD .bp\ +n
-sets the page number to
-.BD n
-more than its current value;
-.BD .bp
-means
-.BD .bp\ +1 .
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt10 b/.ref-Research-V7/usr/doc/trofftut/tt10
deleted file mode 100644 (file)
index 8b7b781..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-.NH
-Number Registers and Arithmetic
-.PP
-.UL troff
-has a facility for doing arithmetic,
-and for defining and using variables with numeric values,
-called
-.ul
-number registers.
-Number registers, like strings and macros, can be useful in setting up a document
-so it is easy to change later.
-And of course they serve for any sort of arithmetic computation.
-.PP
-Like strings, number registers have one or two character names.
-They are set by the
-.BD .nr
-command,
-and are referenced anywhere by
-.BD \enx
-(one character name) or
-.BD \en(xy
-(two character name).
-.PP
-There are quite a few pre-defined number registers maintained by
-.UL troff ,
-among them
-.BD %
-for the current page number;
-.BD nl
-for the current vertical position on the page;
-.BD dy ,
-.BD mo
-and
-.BD yr
-for the current day, month and year; and
-.BD .s
-and
-.BD .f
-for the current size and font.
-(The font is a number from 1 to 4.)
-Any of these can be used in computations like any other register,
-but some, like
-.BD .s
-and
-.BD .f ,
-cannot be changed with
-.BD .nr .
-.PP
-As an example of the use of number registers,
-in the
-.BD \-ms
-macro package [4],
-most significant parameters are defined in terms of the values
-of a handful of number registers.
-These include the point size for text, the vertical spacing,
-and the line and title lengths.
-To set the point size and vertical spacing for the following paragraphs, for example, a user may say
-.P1
-^nr PS 9
-^nr VS 11
-.P2
-The paragraph macro
-.BD .PP
-is defined (roughly) as follows:
-.P1
-.ta  1i
-^de PP
-^ps \e\en(PS   \e" reset size
-^vs \e\en(VSp  \e" spacing
-^ft R  \e" font
-^sp 0.5v       \e" half a line
-^ti +3m
-^^
-.P2
-This sets the font to Roman and the point size and line spacing
-to whatever values are stored in the number registers
-.BD PS
-and
-.BD VS .
-.PP
-Why are there two backslashes?
-This is the eternal problem of how to quote a quote.
-When
-.UL troff
-originally reads the macro definition,
-it peels off one backslash
-to see what's coming next.
-To ensure that another is left in the definition when the 
-macro is
-.ul
-used,
-we have to put in two backslashes in the definition.
-If only one backslash is used, 
-point size and vertical spacing will be frozen at the time the macro
-is defined, not when it is used.
-.PP
-Protecting by an extra layer of backslashes
-is only needed for
-.BD \en ,
-.BD \e* ,
-.BD \e$
-(which we haven't come to yet),
-and
-.BD \e
-itself.
-Things like
-.BD \es ,
-.BD \ef ,
-.BD \eh ,
-.BD \ev ,
-and so on do not need an extra backslash,
-since they are converted by
-.UL troff
-to an internal code immediately upon being seen.
-.WS
-.PP
-Arithmetic expressions can appear anywhere that
-a number is expected.
-As a trivial example,
-.P1
-^nr PS \e\en(PS\-2
-.P2
-decrements PS by 2.
-Expressions can use the arithmetic operators +, \-, *, /, % (mod),
-the relational operators >, >=, <, <=, =, and != (not equal),
-and parentheses.
-.PP
-Although the arithmetic we have done so far
-has been straightforward,
-more complicated things are somewhat tricky.
-First,
-number registers hold only integers.
-.UL troff
-arithmetic uses truncating integer division, just like Fortran.
-Second, in the absence of parentheses,
-evaluation is done left-to-right
-without any operator precedence
-(including relational operators).
-Thus
-.P1
-7*\-4+3/13
-.P2
-becomes `\-1'.
-Number registers can occur anywhere in an expression,
-and so can scale indicators like
-.BD p ,
-.BD i ,
-.BD m ,
-and so on (but no spaces).
-Although integer division causes truncation,
-each number and its scale indicator is converted
-to machine units (1/432 inch) before any arithmetic is done,
-so
-1i/2u
-evaluates to
-0.5i
-correctly.
-.PP
-The scale indicator
-.BD u
-often has to appear
-when you wouldn't expect it _
-in particular, when arithmetic is being done
-in a context that implies horizontal or vertical dimensions.
-For example,
-.P1
-^ll 7/2i
-.P2
-would seem obvious enough _
-3\(12 inches.
-Sorry.
-Remember that the default units for horizontal parameters like
-.BD .ll
-are ems.
-That's really `7 ems / 2 inches',
-and when translated into machine units, it becomes zero.
-How about
-.P1
-^ll 7i/2
-.P2
-Sorry, still no good _
-the `2' is `2 ems', so `7i/2' is small,
-although not zero.
-You
-.ul
-must
-use
-.P1
-^ll 7i/2u
-.P2
-So again, a safe rule is to
-attach a scale indicator to every number,
-even constants.
-.PP
-For arithmetic done within a
-.BD .nr
-command,
-there is no implication of horizontal or vertical dimension,
-so the default units are `units',
-and 7i/2 and 7i/2u
-mean the same thing.
-Thus
-.P1
-^nr ll 7i/2
-^ll \e\en(llu
-.P2
-does just what you want,
-so long as you
-don't forget the
-.BD u
-on the
-.BD .ll
-command.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt11 b/.ref-Research-V7/usr/doc/trofftut/tt11
deleted file mode 100644 (file)
index c33abba..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-.NH
-Macros with arguments
-.PP
-The next step is to define macros that can change from one
-use to the next
-according to parameters supplied as arguments.
-To make this work, we need two things:
-first, when we define the macro, we have to indicate that some
-parts of it will be provided as arguments when the macro is called.
-Then when the macro is 
-called
-we have to provide actual arguments
-to be plugged into the definition.
-.PP
-Let us illustrate by defining a macro
-.BD .SM
-that will print its argument two points
-smaller than the surrounding text.
-That is, the macro call
-.P1
-^SM TROFF
-.P2
-will produce
-.UC TROFF .
-.PP
-The definition of
-.BD .SM
-is
-.P1
-^de SM
-\es\-2\e\e$1\es+2
-^^
-.P2
-Within a macro definition,
-the symbol
-.BD \e\e$n
-refers to the
-.BD n th
-argument
-that the macro was called with.
-Thus
-.BD \e\e$1
-is the string to be placed in a smaller point
-size when
-.BD .SM
-is called.
-.PP
-As a slightly more complicated version, the following definition of
-.BD .SM
-permits optional second and third arguments
-that will be printed in the normal size:
-.P1
-^de SM
-\e\e$3\es\-2\e\e$1\es+2\e\e$2
-^^
-.P2
-Arguments not provided when the macro is called are treated
-as empty,
-so
-.P1
-^SM  TROFF  ),
-.P2
-produces
-.UC TROFF ),
-while
-.P1
-^SM  TROFF  ).  (
-.P2
-produces
-.UC TROFF ). (
-It is convenient to reverse 
-the order of arguments because trailing punctuation
-is much more common than leading.
-.PP
-By the way, the number of arguments that a macro was called with
-is available in number register
-.BD .$ .
-.PP
-The following macro
-.BD ^BD
-is the one used to make the
-`bold roman' we have been using for
-.UL troff
-command names in text.
-It combines horizontal motions, width computations,
-and argument rearrangement.
-.P1 2
-\&.de BD
-\e&\e\e$3\ef1\e\e$1\eh'\-\ew'\e\e$1'u+1u'\e\e$1\efP\e\e$2
-\&..
-.P2
-The
-.BD \eh
-and
-.BD \ew
-commands need no extra backslash, as we discussed above.
-The
-.BD \e&
-is there in case the argument begins with a period.
-.WS
-.PP
-Two backslashes are needed with the
-.BD \e\e$n
-commands, though,
-to protect one of them when the macro is
-being defined.
-Perhaps a second example will make this clearer.
-Consider a macro called
-.BD .SH
-which
-produces section headings rather like those in this paper,
-with the sections numbered automatically,
-and the title in bold in a smaller size.
-The use is
-.P1
-^SH  "Section title ..."
-.P2
-(If the argument to a macro is to contain blanks,
-then it must be
-.ul
-surrounded
-by double quotes,
-unlike a string, where only one leading quote is permitted.)
-.PP
-Here is the definition of the
-.BD .SH
-macro:
-.P1
-.ta .75i 1.15i
-^nr SH 0       \e" initialize section number
-^de SH
-^sp 0.3i
-^ft B
-^nr SH \e\en(SH+1      \e" increment number
-^ps \e\en(PS\-1        \e" decrease PS
-\e\en(SH.  \e\e$1      \e" number. title
-^ps \e\en(PS           \e" restore PS
-^sp 0.3i
-^ft R
-^^
-.P2
-The section number is kept in number register SH, which is incremented each
-time just before it is used.
-(A number register may have the same name as a macro
-without conflict but a string may not.)
-.PP
-We used
-.BD \e\en(SH
-instead of
-.BD \en(SH
-and
-.BD \e\en(PS
-instead of
-.BD \en(PS .
-If we had used
-.BD \en(SH ,
-we would get the value of the register at the time the macro was
-.ul
-defined,
-not at the time it was
-.ul
-used.
-If that's what you want, fine,
-but not here.
-Similarly,
-by using
-.BD \e\en(PS ,
-we get the point size at the time the macro is called.
-.WS
-.PP
-As an example that does not involve numbers,
-recall our
-.BD .NP
-macro which had a
-.P1
-^tl 'left'center'right'
-.P2
-We could make these into parameters by using instead
-.P1
-^tl '\e\e*(LT'\e\e*(CT'\e\e*(RT'
-.P2
-so the title comes from three strings called LT, CT and RT.
-If these are empty, then the title will be a blank line.
-Normally CT would be set with something like
-.P1
-\&^ds  CT  - % -
-.P2
-to give just the page number between hyphens (as on the top of this page),
-but a user could supply private definitions for
-any of the strings.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt12 b/.ref-Research-V7/usr/doc/trofftut/tt12
deleted file mode 100644 (file)
index 551e270..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-.NH
-Conditionals
-.PP
-Suppose we want the
-.BD .SH
-macro to leave two extra inches of space just before section 1,
-but nowhere else.
-The cleanest way to do that is to test inside the
-.BD .SH
-macro
-whether
-the section number is 1,
-and add some space if it is.
-The
-.BD .if
-command provides the conditional test
-that we can add
-just before the heading line is output:
-.P1 4
-^if \e\en(SH=1 ^sp 2i  \e" first section only
-.P2
-.PP
-The condition after the
-.BD .if
-can be any arithmetic or logical expression.
-If the condition is logically true, or arithmetically greater than zero,
-the rest of the line is treated as if
-it were text _
-here a command.
-If the condition is false, or zero or negative,
-the rest of the line is skipped.
-.PP
-It is possible to do more than one command if a condition is true.
-Suppose several operations are to be done before section 1.
-One possibility is to define a macro 
-.BD .S1
-and invoke it
-if we are about to do section 1
-(as determined by an
-.BD .if ).
-.P1
-^de S1
----  processing for section 1 ---
-^^
-^de SH
-^^^
-^if \e\en(SH=1 ^S1
-^^^
-^^
-.P2
-.PP
-An alternate way is to use the
-extended form of the
-.BD .if ,
-like this:
-.P1
-^if \e\en(SH=1 \e{--- processing
-for section 1 ----\e}
-.P2
-The braces
-.BD \e{
-and
-.BD \e}
-must occur in the positions shown
-or you will get unexpected extra lines in your output.
-.UL troff
-also provides
-an `if-else' construction,
-which we will not go into here.
-.PP
-A condition can be negated by preceding it with
-.BD ! ;
-we get the same effect as above (but less clearly) by using
-.P1
-^if !\e\en(SH>1 ^S1
-.P2
-.PP
-There are a handful of 
-other conditions that can be tested with
-.BD .if .
-For example, is the current page even or odd?
-.P1
-^if e ^tl ''even page title''
-^if o ^tl ''odd page title''
-.P2
-gives facing pages different titles
-when used inside an appropriate new page macro.
-.PP
-Two other conditions
-are
-.BD t
-and
-.BD n ,
-which tell you whether the formatter is
-.UL troff
-or
-.UL nroff . 
-.P1
-^if t troff stuff ...
-^if n nroff stuff ...
-.P2
-.PP
-Finally, string comparisons may be made in an
-.BD .if :
-.P1
-^if  'string1'string2'  stuff
-.P2
-does `stuff' if
-.ul
-string1
-is the same as
-.ul
-string2.
-The character separating the strings can be anything
-reasonable that is
-not contained in either string.
-The strings themselves can reference strings with
-.BD \e* ,
-arguments with 
-.BD \e$ ,
-and so on.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt13 b/.ref-Research-V7/usr/doc/trofftut/tt13
deleted file mode 100644 (file)
index 3222fed..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-.NH
-Environments
-.PP
-As we mentioned, there is a potential problem
-when going across a page boundary:
-parameters like size and font
-for a page title may well be different from those
-in effect in the text when the page boundary occurs.
-.UL troff
-provides a very general way to deal with this and
-similar situations.
-There are three `environments',
-each of which has independently settable versions of
-many of the parameters associated with processing,
-including size, font, line and title lengths,
-fill/nofill mode, tab stops, and even partially collected lines.
-Thus the titling problem may be readily solved by processing the main text
-in one environment and titles in a separate one
-with its own suitable parameters.
-.PP
-The command
-.BD .ev\ n
-shifts to environment
-.BD n ;
-.BD n
-must be 0, 1 or 2.
-The command
-.BD .ev
-with no argument returns to the
-previous environment.
-Environment names are maintained in a stack, so calls
-for different environments may be nested and unwound consistently.
-.PP
-Suppose we say that the main text is processed in environment 0,
-which is where 
-.UL troff
-begins by default.
-Then we can modify the new page macro
-.BD .NP
-to process titles in environment 1 like this:
-.P1 2
-^de NP
-^ev 1  \e" shift to new environment
-^lt 6i \e" set parameters here
-^ft R
-^ps 10
-\&... any other processing ...
-^ev    \e" return to previous environment
-^^
-.P2
-It is also possible to initialize the parameters for an environment
-outside the
-.BD .NP
-macro,
-but the version shown keeps all the processing in one place
-and is thus easier to understand and change.
diff --git a/.ref-Research-V7/usr/doc/trofftut/tt14 b/.ref-Research-V7/usr/doc/trofftut/tt14
deleted file mode 100644 (file)
index 8dac5bb..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-.NH
-Diversions
-.PP
-There are numerous occasions in page layout when it is necessary to store some text
-for a period of time without actually printing it.
-Footnotes are the most obvious example:
-the text of the footnote usually appears in the input well before the place
-on the page where it is to be printed is reached.
-In fact,
-the place where it is output normally depends on how big it is,
-which implies that there must be a way
-to process the footnote at least
-enough to decide its size
-without printing it.
-.PP
-.UL troff
-provides a mechanism called a diversion
-for doing this processing.
-Any part of the output may be diverted into a macro instead
-of being printed,
-and then at some convenient time the macro may be put back into
-the input.
-.PP
-The command
-.BD .di\ xy
-begins a diversion _ all subsequent output is collected into the macro
-.BD xy
-until the command
-.BD .di
-with no arguments is encountered.
-This terminates the diversion.
-The processed text is available at any time thereafter, simply
-by giving the command
-.P1
-^xy
-.P2
-The vertical size of the last finished diversion is contained in
-the built-in number register
-.BD dn .
-.PP
-As a simple example,
-suppose we want to implement a `keep-release'
-operation,
-so that text between the commands
-.BD .KS 
-and
-.BD .KE
-will not be split across a page boundary
-(as for a figure or table).
-Clearly, when a
-.BD .KS
-is encountered, we have to begin diverting
-the output so we can find out how big it is.
-Then when a
-.BD .KE
-is seen, we decide
-whether the diverted text will fit on the current page,
-and print it either there if it fits, or at the top of the next page if it doesn't.
-So:
-.P1 2
-.ta .6i
-^de KS \e" start keep
-^br    \e" start fresh line
-^ev 1  \e" collect in new environment
-^fi    \e" make it filled text
-^di XX \e" collect in XX
-^^
-.P2
-.P1 2
-.ta .6i
-^de KE \e" end keep
-^br    \e" get last partial line
-^di    \e" end diversion
-^if \e\en(dn>=\e\en(.t .bp   \e" bp if doesn't fit
-^nf    \e" bring it back in no-fill
-^XX    \e" text
-^ev    \e" return to normal environment
-^^
-.P2
-Recall that number register
-.BD nl
-is the current position
-on the output page.
-Since output was being diverted, this remains
-at its value when the diversion started.
-.BD dn
-is the amount of text in the diversion;
-.BD .t
-(another built-in register)
-is the distance to the next trap,
-which we assume is at the bottom margin of the page.
-If the diversion is large enough to go past the trap,
-the
-.BD .if
-is satisfied, and
-a
-.BD .bp
-is issued.
-In either case, the diverted output is then brought back with
-.BD .XX .
-It is essential to bring it back in no-fill mode so
-.UL troff
-will do no further processing on it.
-.PP
-This is not the most general keep-release,
-nor is it robust in the face of all conceivable inputs,
-but it would require more space than we have here to write it
-in full generality.
-This section is not intended
-to teach everything about diversions,
-but to sketch out enough that you can read
-existing macro packages with some comprehension.
diff --git a/.ref-Research-V7/usr/doc/trofftut/ttack b/.ref-Research-V7/usr/doc/trofftut/ttack
deleted file mode 100644 (file)
index 35962b9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-.SH
-Acknowledgements
-.PP
-I am deeply indebted to J. F. Ossanna,
-the author of
-.UL troff ,
-for his repeated patient explanations
-of
-fine points,
-and for his continuing willingness to
-adapt
-.UL troff
-to make other uses easier.
-I am also grateful to Jim Blinn, Ted Dolotta,
-Doug McIlroy, Mike Lesk and Joel Sturman
-for helpful comments on this paper.
-.SH
-References
-.LP
-.IP [1]
-J. F. Ossanna,
-.ul
-.UC NROFF/TROFF
-User's Manual,
-Bell Laboratories
-Computing Science Technical Report 54, 1976.
-.IP [2]
-B. W. Kernighan,
-.ul
-A System for Typesetting Mathematics _ User's Guide
-.ul
-(Second Edition),
-Bell Laboratories
-Computing Science Technical Report 17, 1977.
-.IP [3]
-M. E. Lesk,
-.ul
-TBL _ A Program to Format Tables,
-Bell Laboratories
-Computing Science Technical Report 49, 1976.
-.IP [4]
-M. E. Lesk,
-.ul
-Typing Documents on UNIX,
-Bell Laboratories, 1978.
-.IP [5]
-J. R. Mashey and D. W. Smith,
-.ul
-PWB/MM _
-.ul
-Programmer's Workbench Memorandum Macros,
-Bell Laboratories internal memorandum.
diff --git a/.ref-Research-V7/usr/doc/trofftut/ttcharset b/.ref-Research-V7/usr/doc/trofftut/ttcharset
deleted file mode 100644 (file)
index e3ffd40..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-.bp
-.tr __
-.nr VS 12
-.vs 12p
-.1C
-.SH
-Appendix A: Phototypesetter Character Set
-.LP
-These characters exist in roman, italic, and bold.
-To get the one on the left, type the
-four-character name on the right.
-.sp
-.ta .2i .8i 1i 1.6i 1.8i 2.4i 2.6i 3.2i 3.4i 4.0i 4.2i 4.8i 5i 5.6i 5.8i
-.nf
-.in 0.5i
-\(ff   \\(ff   \(fi    \\(fi   \(fl    \\(fl   \(Fi    \\(Fi   \(Fl    \\(Fl
-\(ru   \\(ru   \(em    \\(em   \(14    \\(14   \(12    \\(12   \(34    \\(34
-\(co   \\(co   \(de    \\(de   \(dg    \\(dg   \(fm    \\(fm   \(ct    \\(ct   
-\(rg   \\(rg   \(bu    \\(bu   \(sq    \\(sq   \(hy    \\(hy
-                               (In bold, \e(sq is \fB\(sq\fP.)
-.sp
-.in 0
-.tr ~~
-.ps 9
-.fi
-The following are special-font characters:
-.sp
-.in 0.5i
-.tr ~~
-.nf
-.ta .3i 1i 1.3i 2i 2.3i 3i 3.3i
-\(pl   \\(pl   \(mi    \\(mi   \(mu    \\(mu   \(di    \\(di   
-\(eq   \\(eq   \(==    \\(==   \(>=    \\(>=   \(<=    \\(<=   
-\(!=   \\(!=   \(+-    \\(+-   \(no    \\(no   \(sl    \\(sl   
-\(ap   \\(ap   \(~=    \\(~=   \(pt    \\(pt   \(gr    \\(gr   
-\(->   \\(->   \(<-    \\(<-   \(ua    \\(ua   \(da    \\(da   
-\(is   \\(is   \(pd    \\(pd   \(if    \\(if   \(sr    \\(sr   
-\(sb   \\(sb   \(sp    \\(sp   \(cu    \\(cu   \(ca    \\(ca   
-\(ib   \\(ib   \(ip    \\(ip   \(mo    \\(mo   \(es    \\(es   
-\(aa   \\(aa   \(ga    \\(ga   \(ci    \\(ci   \(bs    \\(bs   
-\(sc   \\(sc   \(dd    \\(dd   \(lh    \\(lh   \(rh    \\(rh   
-\(lt   \\(lt   \(rt    \\(rt   \(lc    \\(lc   \(rc    \\(rc   
-\(lb   \\(lb   \(rb    \\(rb   \(lf    \\(lf   \(rf    \\(rf   
-\(lk   \\(lk   \(rk    \\(rk   \(bv    \\(bv   \(ts    \\(ts   
-\(br   \\(br   \(or    \\(or   \(ul    \\(ul   \(rn    \\(rn   
-\(**   \\(**
-.sp
-.in0
-.ps 9
-.fi
-These
-four
-characters also have two-character names. 
-The \' is the apostrophe on terminals;
-the \` is the other quote mark.
-.sp
-.in .5i
-\'     \e\(aa  \`      \e\(ga  \(mi    \e\(mi  \_      \e\_
-.sp
-.in 0
-These
-characters exist only on the special font,
-but they do not have four-character names:
-.sp
-.in .5i
-.nf
-.tr ^^
-"      {      }      <      >      ~      ^      \e      #      @
-.sp
-.in 0
-.fi
-For greek, precede the roman letter by
-.BD \e(*
-to get the corresponding greek;
-for example, 
-.BD \e(*a
-is
-\(*a.
-.sp
-.in 0.5i
-.nf
-.cs R 36
-abgdezyhiklmncoprstufxqw
-\(*a\(*b\(*g\(*d\(*e\(*z\(*y\(*h\(*i\(*k\(*l\(*m\(*n\(*c\(*o\(*p\(*r\(*s\(*t\(*u\(*f\(*x\(*q\(*w
-.sp
-ABGDEZYHIKLMNCOPRSTUFXQW
-\(*A\(*B\(*G\(*D\(*E\(*Z\(*Y\(*H\(*I\(*K\(*L\(*M\(*N\(*C\(*O\(*P\(*R\(*S\(*T\(*U\(*F\(*X\(*Q\(*W
-.ps 9
-.cs R
-.in 0
-.fi
diff --git a/.ref-Research-V7/usr/doc/trofftut/ttindex b/.ref-Research-V7/usr/doc/trofftut/ttindex
deleted file mode 100644 (file)
index d61d669..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-.bp
-.2C
-.SH
-Index
-.LP
-.ps 8
-.vs 9p
-! (negating conditionals)~17
-#$ (macro argument)~16
-#*x, #(xy (invoke string macro)~14
-#b (bracketing function)~13
-#d (subscript)~11
-#f (font change)~5
-#h (horizontal motion)~12
-#nx, #n(xy (number register)~15
-#o (overstrike)~13
-#s (size change)~3
-#u (superscript)~11
-#v (vertical motion)~11
-#w (width function)~12
-#z (zero motion)~13
-\(fmcommand instead of ^command~9
-% (page number register)~10,15
-^^ (end of macro definition)~7
-^bp~9,10
-^br (break)~9
-^ce (center)~2
-^ds (define string macro)~7,14
-^fi (fill)~2
-^ft (change font)~5
-^if (conditional test)~16
-^in (indent)~6
-^lg (set ligatures~5
-^ll (line length)~6
-^nf (nofill)~2
-^nr (set number register)~14
-^pn (page number)~10
-^ps (change point size)~1,3
-^sp (space)~4
-^ss (set space size)~10
-^ta (set tab stops)~11
-^tc (set tab character)~10
-^tl (title)~9
-^tr (translate characters)~2,6
-^ul (italicize)~6
-^vs (vertical spacing)~3
-^wh (when conditional)~9,17
-accents~6,13
-apostrophes~6
-arithmetic~15
-backslash~1,3,5,14,16
-begin page (^bp)~9
-block macros (B1,B2)~8
-bold font (.ft B)~5
-boustrophedon~12
-bracketing function (##b)~13
-break (^br)~9
-break-causing commmands~9
-centering (^ce)~2
-changing fonts (^ft, #f)~5
-changing macros~15
-character set~4,5,19
-character translation (^tr)~2,6
-columnated output~10
-commands~1
-commands that cause break~9
-conditionals (^if)~16
-constant proportion~7
-default break list~9
-define macro (^de)~7
-define string macro (^ds)~14
-drawing lines~11
-em~7,11
-end of macro (^^)~7
-even page test (e)~17
-fill (^fi)~2
-fonts (^ft)~4,19
-Greek (#(*-)~5,19
-hanging indent (^ti)~12
-hints~20
-horizontal motion (#h)~12
-hp (horizontal position register)~15
-hyphen~6
-i scale indicator~4
-indent (^in)~6
-index~21
-italic font (.ft I)~4
-italicize (^ul)~6
-legal point sizes~3
-ligatures (ff,fi,fl; ^lg)~5
-line length (^ll)~6
-line spacing (^vs)~3
-local motions (#u,#d,#v,#h,#w,#o,#z,#b)~11 ff
-m scale indicator~7
-machine units~4,12
-macro arguments~15
-macros~7
-macros that change~15
-multiple backslashes~14
-negating conditionals (!)~17
-new page macro (NP)~8
-nl (current vertical position register)~15
-nofill (^nf)~2
-NROFF test (n)~17
-nested quotes~12
-number registers (^nr,#n)~14
-numbered paragraphs~12
-odd page test (o)~17
-order of evaluation~14
-overstrike (#o)~13
-p scale indicator~3
-page number register (%)~10
-page numbers (^pn, ^bp)~10
-paragraph macro (PG)~7
-Paternoster~6
-point size (^ps)~1,3
-previous font (#fP, ^ft P)~5
-previous point size (#s0,^ps)~3
-quotes~6
-relative change (\(+-)~6
-ROFF~1
-ROFF header and footer~8
-Roman font (.ft R)~4
-scale indicator i~4
-scale indicator m~7
-scale indicator p~3
-scale indicator u~12
-scale indicators in arithmetic~15
-section heading macro (SC)~15
-set space size (^ss)~10
-size _ see point size
-space (^sp)~4
-space between lines (^vs)~3
-special characters (#(xx)~5,19
-string macros (^ds,#*)~14
-subscripts (#d)~11
-superscripts (#u)~11
-tab character (^tc)~11
-tabs (^ta)~10
-temporary indent (^ti)~7
-titles (^tl)~8
-translate (^tr)~2,6,12
-TROFF examples~19
-TROFF test (t)~17
-truncating division~15
-type faces _ see fonts
-u scale indicator~12
-underline (^ul)~6
-valid point sizes~3
-vertical motion (#v)~11
-vertical position on page~9
-vertical spacing (^vs)~3
-when (^wh)~9,17
-width function (#w)~12
-width of digits~10
-zero motion (#z)~13
diff --git a/.ref-Research-V7/usr/doc/uprog/cwscript b/.ref-Research-V7/usr/doc/uprog/cwscript
deleted file mode 100644 (file)
index a72e4ca..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/^\.if/b
-/^\.ix/b
-/^\.tm/b
-s/\\\\/\\e\\e/g
-s/\\\([n"'bt0]\)/\\e\1/g
-s/^\.SS/.P1/
-s/^\.ES/.P2/
-s/\^/\\(14/g
-s/~/\\v'.25m'\\s\\nS&\\s\\nP\\v'-.25m'/g
-s/\\|/ZZZ/g
-s/|/\\v'.05m'\\s\\nS&\\s\\nP\\v'-.05m'/g
-s/ZZZ/\\|/g
-s/_/\\(em/g
-s/</\\(fi/g
-s/>/\\(fl/g
-/^\.P1/,/^\.P2/{
-       s/{/\\(Fl/g
-       s/}/\\(Fi/g
-       s/"/\\(34/g
-       s/[?!]/\\s\\ns&\\s\\nP/g
-       s:/:\\s\\ns/\\s\\nP:g
-}
-/^\.UL/{
-       s/{/\\(Fl/g
-       s/}/\\(Fi/g
-       s/"/\\(34/g
-       s/[?!]/\\s\\ns&\\s\\nP/g
-       s:/:\\s\\ns/\\s\\nP:g
-}
-s/#/\\(de/g
-s/\\\*/XXX/g
-s/\*/\\v'-.1m'\\s\\ns&\\s\\nP\\v'.1m'/g
-s/XXX/\\*/g
-s/\\e/\\s\\ns\\(rg\\s\\nP/g
diff --git a/.ref-Research-V7/usr/doc/uprog/p.mac b/.ref-Research-V7/usr/doc/uprog/p.mac
deleted file mode 100644 (file)
index e0a07d8..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-.fp 3 CW
-.fz 3 -1
-.fz S 3 -0
-.bd S 3 3      \" embolden special font in context of 3
-.if t .nr PI .25i      \" paragraph indent
-.nr PS 10      \" text point size
-.nr VS 12      \" text vertical (inter-line) spacing
-.nr dP 1       \" delta point size for program
-.ps \n(PS
-.vs \n(VS
-.if n .nr NH 1 \" space after NH or SH heading
-.if t .nr NH .5v
-.if n .ls 2
-.de UC
-\&\\$3\s-1\\$1\\s0\&\\$2
-..
-.de IT
-.if n .ul
-\&\\$3\f2\\$1\fR\^\&\\$2
-..
-.de UL
-.lg 0
-.if n .ul
-\%\&\\$3\f3\\$1\fR\&\\$2
-.lg
-..
-.cs 3 25 \\n(PS-1      \" constant space
-.nr P \\n(PS   \" current point size
-.nr S \\n(PS+1 \" 1 points bigger
-.nr s \\n(PS-1 \" 1 points smaller
-.de P1
-.DS I .5i
-.nf
-.lg 0
-.if n .ls 1
-.if n .ta 5 10 15 20 25 30 35 40 45 50 55 60
-.if t .ps -\\n(dP
-.if t .vs -\\n(dP
-.nr P \\n(.s
-.nr S \\n(.s+1
-.nr s \\n(.s-1
-.nr t 5*33u    \" width in 9 point CW
-.if t .ta 1u*\\ntu 2u*\\ntu 3u*\\ntu 4u*\\ntu 5u*\\ntu 6u*\\ntu 7u*\\ntu 8u*\\ntu 9u*\\ntu 10u*\\ntu 11u*\\ntu 12u*\\ntu 13u*\\ntu 14u*\\ntu
-.ft 3
-.cs 3 25 \\nP-1
-.lg 0
-..
-.de P2
-.ps \\n(PS
-.vs \\n(VSp
-.nr P \\n(PS
-.nr S \\n(PS+1
-.nr s \\n(PS-1
-.ft R
-.if n .ls 2
-.fi
-.DE
-.lg
-.cs 3 25 \\n(PS-1
-..
-.hy 14 \"2=not last lines; 4= no -xx; 8=no xx-
-.am SH
-.ft 1
-.bd 1 3
-..
-.am NH
-.ft 1
-.bd 1 3
-..
-.am TL
-.ft 1
-.bd 1 3
-..
diff --git a/.ref-Research-V7/usr/doc/uprog/p0 b/.ref-Research-V7/usr/doc/uprog/p0
deleted file mode 100644 (file)
index 24e75c0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-.if n .ls 1
-...TM 78-1273-9 39199 39199-11
-...ND October 2, 1978
-...old TM 75-1273-11 October 22, 1975
-.RP
-.TL
-UNIX Programming \(em Second Edition
-.AU "MH 2C-518" 6021
-Brian W. Kernighan
-.AU "MH 2C-517" 3770
-Dennis M. Ritchie
-.AI
-.MH
-.AB
-.PP
-This paper is an introduction to programming on
-the
-.UX
-system.
-The emphasis is on how to write programs that interface
-to the operating system,
-either directly or through the standard I/O library.
-The topics discussed include
-.IP "  \(bu"
-handling command arguments
-.IP "  \(bu"
-rudimentary I/O; the standard input and output
-.IP "  \(bu"
-the standard I/O library; file system access
-.IP "  \(bu"
-low-level I/O: open, read, write, close, seek
-.IP "  \(bu"
-processes: exec, fork, pipes
-.IP "  \(bu"
-signals \(em interrupts, etc.
-.PP
-There is also an appendix which describes
-the standard I/O library in detail.
-.AE
-.CS 17 0 17 0 0 4
diff --git a/.ref-Research-V7/usr/doc/uprog/p1 b/.ref-Research-V7/usr/doc/uprog/p1
deleted file mode 100644 (file)
index 2c1614b..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-.if n .ls 2
-.if t .tr |\(or
-.NH
-INTRODUCTION
-.PP
-This paper describes how to write
-programs 
-that interface with the
-.UC UNIX
-operating system in a non-trivial way.
-This includes programs that use files by name,
-that use pipes,
-that invoke other commands as they run,
-or that attempt to catch interrupts and other signals
-during execution.
-.PP
-The document collects material which is scattered
-throughout several sections of
-.I
-The
-.UC UNIX
-Programmer's Manual
-.R
-[1]
-for Version 7
-.UC UNIX .
-There is no attempt to be complete;
-only generally useful material is dealt with.
-It is assumed that you will be programming in C,
-so you must be able to read the language
-roughly up to the level of
-.I
-The C Programming Language
-.R
-[2].
-Some of the material in sections 2 through 4
-is based on
-topics covered more carefully there.
-You should also be familiar with
-.UC UNIX
-itself
-at least
-to the level of
-.I
-.UC UNIX
-for Beginners
-.R
-[3].
diff --git a/.ref-Research-V7/usr/doc/uprog/p2 b/.ref-Research-V7/usr/doc/uprog/p2
deleted file mode 100644 (file)
index 6b20c15..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-.NH
-BASICS
-.NH 2
-Program Arguments
-.PP
-When a C program is run as a command,
-the arguments on the command line are made available
-to the
-function
-.UL main
-as an argument count
-.UL argc
-and an array
-.UL argv
-of
-pointers to
-character strings
-that contain
-the arguments.
-By convention,
-.UL argv[0]
-is the command name itself,
-so
-.UL argc
-is always greater than 0.
-.PP
-The following program illustrates the mechanism:
-it simply echoes its arguments
-back to the terminal.
-(This is essentially the
-.UL echo
-command.)
-.P1
-main(argc, argv)       /* echo arguments */
-int argc;
-char *argv[];
-{
-       int i;
-
-       for (i = 1; i < argc; i++)
-               printf("%s%c", argv[i], (i<argc-1) ? ' ' : '\n');
-}
-.P2
-.UL argv
-is a pointer to an array
-whose individual elements are pointers to arrays of characters;
-each is terminated by
-.UL \e0 ,
-so they can be treated as strings.
-The program starts by printing 
-.UL argv[1]
-and loops until it has printed them all.
-.PP
-The argument count and the arguments
-are parameters to
-.UL main .
-If you want to keep them around so other
-routines can get at them, you must
-copy them to external variables.
-.NH 2
-The ``Standard Input'' and ``Standard Output''
-.PP
-The simplest input mechanism is to read the ``standard input,''
-which is generally the user's terminal.
-The function
-.UL getchar
-returns the next input character each time it is called.
-A file may be substituted for the terminal by
-using the
-.UL <
-convention: 
-if
-.UL prog
-uses 
-.UL getchar ,
-then
-the command line
-.P1
-prog <file
-.P2
-causes
-.UL prog
-to read
-.UL file
-instead of the terminal.
-.UL prog
-itself need know nothing about where its input
-is coming from.
-This is also true if the input comes from another program via
-the 
-.U 
-pipe mechanism:
-.P1
-otherprog | prog
-.P2
-provides the standard input for
-.UL prog
-from the standard output of
-.UL otherprog.
-.PP
-.UL getchar
-returns the value
-.UL EOF
-when it encounters the end of file
-(or an error)
-on whatever you are reading.
-The value of
-.UL EOF
-is normally defined to be
-.UL -1 ,
-but it is unwise to take any advantage
-of that knowledge.
-As will become clear shortly,
-this value is automatically defined for you when
-you compile a program,
-and need not be of any concern.
-.PP
-Similarly,
-.UL putchar(c)
-puts the character
-.UL c
-on the ``standard output,''
-which is also by default the terminal.
-The output can be captured on a file
-by using
-.UL > :
-if
-.UL prog
-uses
-.UL putchar ,
-.P1
-prog >outfile
-.P2
-writes the standard output on
-.UL outfile 
-instead of the terminal.
-.UL outfile
-is created if it doesn't exist;
-if it already exists, its previous contents are overwritten.
-And a pipe can be used:
-.P1
-prog | otherprog
-.P2
-puts the standard output of
-.UL prog
-into the standard input of
-.UL otherprog.
-.PP
-The function
-.UL printf ,
-which formats output in various ways,
-uses
-the same mechanism as
-.UL putchar
-does,
-so calls to
-.UL printf
-and
-.UL putchar
-may be intermixed in any order;
-the output will appear in the order of the calls.
-.PP
-Similarly, the function
-.UL scanf
-provides for formatted input conversion;
-it will read the standard input and break it
-up into strings, numbers, etc.,
-as desired.
-.UL scanf
-uses the same mechanism as
-.UL getchar ,
-so calls to them may also be intermixed.
-.PP
-Many programs
-read only one input and write one output;
-for such programs I/O
-with
-.UL getchar ,
-.UL putchar ,
-.UL scanf ,
-and
-.UL printf
-may be entirely adequate,
-and it is almost always enough to get started.
-This is particularly true if
-the
-.UC UNIX
-pipe facility is used to connect the output of
-one program to the input of the next.
-For example, the following program
-strips out all ascii control characters
-from its input
-(except for newline and tab).
-.P1
-#include <stdio.h>
-
-main() /* ccstrip: strip non-graphic characters */
-{
-       int c;
-       while ((c = getchar()) != EOF)
-               if ((c >= ' ' && c < 0177) || c == '\t' || c == '\n')
-                       putchar(c);
-       exit(0);
-}
-.P2
-The line
-.P1
-#include <stdio.h>
-.P2
-should appear at the beginning of each source file.
-It causes the C compiler to read a file
-.IT /usr/include/stdio.h ) (
-of
-standard routines and symbols
-that includes the definition of
-.UL EOF .
-.PP
-If it is necessary to treat multiple files,
-you can use
-.UL cat
-to collect the files for you:
-.P1
-cat file1 file2 ... | ccstrip >output
-.P2
-and thus avoid learning how to access files from a program.
-By the way,
-the call to
-.UL exit
-at the end is not necessary to make the program work
-properly,
-but it assures that any caller
-of the program will see a normal termination status
-(conventionally 0)
-from the program when it completes.
-Section 6 discusses status returns in more detail.
diff --git a/.ref-Research-V7/usr/doc/uprog/p3 b/.ref-Research-V7/usr/doc/uprog/p3
deleted file mode 100644 (file)
index bafd9f0..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-.NH
-THE STANDARD I/O LIBRARY
-.PP
-The ``Standard I/O Library''
-is a collection of routines
-intended to provide
-efficient
-and portable
-I/O services
-for most C programs.
-The standard I/O library is available on each system that supports C,
-so programs that confine
-their system interactions
-to its facilities
-can be transported from one system to another essentially without change.
-.PP
-In this section, we will discuss the basics of the standard I/O library.
-The appendix contains a more complete description of its capabilities.
-.NH 2
-File Access
-.PP
-The programs written so far have all
-read the standard input and written the standard output,
-which we have assumed are magically pre-defined.
-The next step
-is to write a program that accesses
-a file that is
-.ul
-not
-already connected to the program.
-One simple example is
-.IT wc ,
-which counts the lines, words and characters
-in a set of files.
-For instance, the command
-.P1
-wc x.c y.c
-.P2
-prints the number of lines, words and characters
-in
-.UL x.c
-and
-.UL y.c
-and the totals.
-.PP
-The question is how to arrange for the named files
-to be read \(em
-that is, how to connect the file system names 
-to the I/O statements which actually read the data.
-.PP
-The rules are simple.
-Before it can be read or written
-a file has to be
-.ul
-opened
-by the standard library function
-.UL fopen .
-.UL fopen
-takes an external name
-(like
-.UL x.c
-or
-.UL y.c ),
-does some housekeeping and negotiation with the operating system,
-and returns an internal name
-which must be used in subsequent
-reads or writes of the file.
-.PP
-This internal name is actually a pointer,
-called a
-.IT file
-.IT pointer ,
-to a structure
-which contains information about the file,
-such as the location of a buffer,
-the current character position in the buffer,
-whether the file is being read or written,
-and the like.
-Users don't need to know the details,
-because part of the standard I/O definitions
-obtained by including
-.UL stdio.h
-is a structure definition called
-.UL FILE .
-The only declaration needed for a file pointer
-is exemplified by
-.P1
-FILE   *fp, *fopen();
-.P2
-This says that
-.UL fp
-is a pointer to a
-.UL FILE ,
-and
-.UL fopen
-returns a pointer to
-a
-.UL FILE .
-.UL FILE \& (
-is a type name, like
-.UL int ,
-not a structure tag.
-.PP
-The actual call to
-.UL fopen
-in a program
-is
-.P1
-fp = fopen(name, mode);
-.P2
-The first argument of
-.UL fopen
-is the
-name
-of the file,
-as a character string.
-The second argument is the
-mode,
-also as a character string,
-which indicates how you intend to
-use the file.
-The only allowable modes are
-read
-.UL \&"r" ), (
-write
-.UL \&"w" ), (
-or append
-.UL \&"a" ). (
-.PP
-If a file that you open for writing or appending does not exist,
-it is created
-(if possible).
-Opening an existing file for writing causes the old contents
-to be discarded.
-Trying to read a file that does not exist
-is an error,
-and there may be other causes of error
-as well
-(like trying to read a file
-when you don't have permission).
-If there is any error,
-.UL fopen
-will return the null pointer
-value
-.UL NULL 
-(which is defined as zero in
-.UL stdio.h ).
-.PP
-The next thing needed is a way to read or write the file
-once it is open.
-There are several possibilities,
-of which
-.UL getc
-and
-.UL putc
-are the simplest.
-.UL getc
-returns the next character from a file;
-it needs the file pointer to tell it what file.
-Thus
-.P1
-c = getc(fp)
-.P2
-places in 
-.UL c
-the next character from the file referred to by
-.UL fp ;
-it returns
-.UL EOF
-when it reaches end of file.
-.UL putc
-is the inverse of
-.UL getc :
-.P1
-putc(c, fp)
-.P2
-puts the character
-.UL c
-on the file
-.UL fp 
-and returns
-.UL c .
-.UL getc
-and
-.UL putc
-return
-.UL EOF
-on error.
-.PP
-When a program is started, three files are opened automatically,
-and file pointers are provided for them.
-These files are the standard input,
-the standard output,
-and the standard error output;
-the corresponding file pointers are
-called
-.UL stdin ,
-.UL stdout ,
-and
-.UL stderr .
-Normally these are all connected to the terminal,
-but
-may be redirected to files or pipes as described in
-Section 2.2.
-.UL stdin ,
-.UL stdout
-and
-.UL stderr
-are pre-defined in the I/O library
-as the standard input, output and error files;
-they may be used anywhere an object of type
-.UL FILE\ *
-can be.
-They are 
-constants, however,
-.ul
-not
-variables,
-so don't try to assign to them.
-.PP
-With some of the preliminaries out of the way,
-we can now write
-.IT wc .
-The basic design 
-is one that has been found
-convenient for many programs:
-if there are command-line arguments, they are processed in order.
-If there are no arguments, the standard input
-is processed.
-This way the program can be used stand-alone
-or as part of a larger process.
-.P1
-#include <stdio.h>
-
-main(argc, argv)       /* wc: count lines, words, chars */
-int argc;
-char *argv[];
-{
-       int c, i, inword;
-       FILE *fp, *fopen();
-       long linect, wordct, charct;
-       long tlinect = 0, twordct = 0, tcharct = 0;
-
-       i = 1;
-       fp = stdin;
-       do {
-               if (argc > 1 && (fp=fopen(argv[i], "r")) == NULL) {
-                       fprintf(stderr, "wc: can't open %s\n", argv[i]);
-                       continue;
-               }
-               linect = wordct = charct = inword = 0;
-               while ((c = getc(fp)) != EOF) {
-                       charct++;
-                       if (c == '\n')
-                               linect++;
-                       if (c == ' ' || c == '\t' || c == '\n')
-                               inword = 0;
-                       else if (inword == 0) {
-                               inword = 1;
-                               wordct++;
-                       }
-               }
-               printf("%7ld %7ld %7ld", linect, wordct, charct);
-               printf(argc > 1 ? " %s\n" : "\n", argv[i]);
-               fclose(fp);
-               tlinect += linect;
-               twordct += wordct;
-               tcharct += charct;
-       } while (++i < argc);
-       if (argc > 2)
-               printf("%7ld %7ld %7ld total\n", tlinect, twordct, tcharct);
-       exit(0);
-}
-.P2
-The function
-.UL fprintf
-is identical to
-.UL printf ,
-save that the first argument is a file pointer
-that specifies the file to be
-written.
-.PP
-The function
-.UL fclose
-is the inverse of
-.UL fopen ;
-it breaks the connection between the file pointer and the external name
-that was established by
-.UL fopen ,
-freeing the
-file pointer for another file.
-Since there is a limit on the number
-of files
-that a program may have open simultaneously,
-it's a good idea to free things when they are no longer needed.
-There is also another reason to call
-.UL fclose 
-on an output file
-\(em it flushes the buffer
-in which
-.UL putc
-is collecting output.
-.UL fclose \& (
-is called automatically for each open file
-when a program terminates normally.)
-.NH 2
-Error Handling \(em Stderr and Exit
-.PP
-.UL stderr
-is assigned to a program in the same way that
-.UL stdin
-and
-.UL stdout
-are.
-Output written on 
-.UL stderr
-appears on the user's terminal
-even if the standard output is redirected.
-.IT wc
-writes its diagnostics on
-.UL stderr
-instead of
-.UL stdout
-so that if one of the files can't
-be accessed for some reason,
-the message
-finds its way to the user's terminal instead of disappearing
-down a pipeline
-or into an output file.
-.PP
-The program actually signals errors in another way,
-using the function
-.UL exit 
-to terminate program execution.
-The argument of
-.UL exit
-is available to whatever process
-called it (see Section 6),
-so the success or failure
-of the program can be tested by another program
-that uses this one as a sub-process.
-By convention, a return value of 0
-signals that all is well;
-non-zero values signal abnormal situations.
-.PP
-.UL exit
-itself
-calls
-.UL fclose
-for each open output file,
-to flush out any buffered output,
-then calls
-a routine named
-.UL _exit .
-The function
-.UL _exit
-causes immediate termination without any buffer flushing;
-it may be called directly if desired.
-.NH 2
-Miscellaneous I/O Functions
-.PP
-The standard I/O library provides several other I/O functions
-besides those we have illustrated above.
-.PP
-Normally output with
-.UL putc ,
-etc., is buffered (except to
-.UL stderr );
-to force it out immediately, use
-.UL fflush(fp) .
-.PP
-.UL fscanf
-is identical to
-.UL scanf ,
-except that its first argument is a file pointer
-(as with
-.UL fprintf )
-that specifies the file from which the input comes;
-it returns
-.UL EOF
-at end of file.
-.PP
-The functions
-.UL sscanf
-and
-.UL sprintf
-are identical to
-.UL fscanf
-and
-.UL fprintf ,
-except that the first argument names a character string
-instead of a file pointer.
-The conversion is done from the string
-for 
-.UL sscanf 
-and into it for
-.UL sprintf .
-.PP
-.UL fgets(buf,\ size,\ fp)
-copies the next line from
-.UL fp ,
-up to and including a newline,
-into 
-.UL buf ;
-at most
-.UL size-1
-characters are copied;
-it returns
-.UL NULL
-at end of file.
-.UL fputs(buf,\ fp)
-writes the string in
-.UL buf
-onto file
-.UL fp .
-.PP
-The function
-.UL ungetc(c,\ fp)
-``pushes back'' the character
-.UL c
-onto the input stream
-.UL fp ;
-a subsequent call to
-.UL getc ,
-.UL fscanf ,
-etc.,
-will encounter 
-.UL c .
-Only one character of pushback per file is permitted.
diff --git a/.ref-Research-V7/usr/doc/uprog/p4 b/.ref-Research-V7/usr/doc/uprog/p4
deleted file mode 100644 (file)
index 63e6ecd..0000000
+++ /dev/null
@@ -1,560 +0,0 @@
-.NH
-LOW-LEVEL I/O
-.PP
-This section describes the 
-bottom level of I/O on the
-.UC UNIX
-system.
-The lowest level of I/O in
-.UC UNIX
-provides no buffering or any other services;
-it is in fact a direct entry into the operating system.
-You are entirely on your own,
-but on the other hand,
-you have the most control over what happens.
-And since the calls and usage are quite simple,
-this isn't as bad as it sounds.
-.NH 2
-File Descriptors
-.PP
-In the
-.UC UNIX
-operating system,
-all input and output is done
-by reading or writing files,
-because all peripheral devices, even the user's terminal,
-are files in the file system.
-This means that a single, homogeneous interface
-handles all communication between a program and peripheral devices.
-.PP
-In the most general case,
-before reading or writing a file,
-it is necessary to inform the system
-of your intent to do so,
-a process called
-``opening'' the file.
-If you are going to write on a file,
-it may also be necessary to create it.
-The system checks your right to do so
-(Does the file exist?
-Do you have permission to access it?),
-and if all is well,
-returns a small positive integer
-called a
-.ul
-file descriptor.
-Whenever I/O is to be done on the file,
-the file descriptor is used instead of the name to identify the file.
-(This is roughly analogous to the use of
-.UC READ(5,...)
-and
-.UC WRITE(6,...)
-in Fortran.)
-All
-information about an open file is maintained by the system;
-the user program refers to the file
-only
-by the file descriptor.
-.PP
-The file pointers discussed in section 3
-are similar in spirit to file descriptors,
-but file descriptors are more fundamental.
-A file pointer is a pointer to a structure that contains,
-among other things, the file descriptor for the file in question.
-.PP
-Since input and output involving the user's terminal
-are so common,
-special arrangements exist to make this convenient.
-When the command interpreter (the
-``shell'')
-runs a program,
-it opens
-three files, with file descriptors 0, 1, and 2,
-called the standard input,
-the standard output, and the standard error output.
-All of these are normally connected to the terminal,
-so if a program reads file descriptor 0
-and writes file descriptors 1 and 2,
-it can do terminal I/O
-without worrying about opening the files.
-.PP
-If I/O is redirected 
-to and from files with
-.UL < 
-and
-.UL > ,
-as in
-.P1
-prog <infile >outfile
-.P2
-the shell changes the default assignments for file descriptors
-0 and 1
-from the terminal to the named files.
-Similar observations hold if the input or output is associated with a pipe.
-Normally file descriptor 2 remains attached to the terminal,
-so error messages can go there.
-In all cases,
-the file assignments are changed by the shell,
-not by the program.
-The program does not need to know where its input
-comes from nor where its output goes,
-so long as it uses file 0 for input and 1 and 2 for output.
-.NH 2
-Read and Write
-.PP
-All input and output is done by
-two functions called
-.UL read
-and
-.UL write .
-For both, the first argument is a file descriptor.
-The second argument is a buffer in your program where the data is to
-come from or go to.
-The third argument is the number of bytes to be transferred.
-The calls are
-.P1
-n_read = read(fd, buf, n);
-
-n_written = write(fd, buf, n);
-.P2
-Each call returns a byte count
-which is the number of bytes actually transferred.
-On reading,
-the number of bytes returned may be less than
-the number asked for,
-because fewer than
-.UL n
-bytes remained to be read.
-(When the file is a terminal,
-.UL read
-normally reads only up to the next newline,
-which is generally less than what was requested.)
-A return value of zero bytes implies end of file,
-and
-.UL -1
-indicates an error of some sort.
-For writing, the returned value is the number of bytes
-actually written;
-it is generally an error if this isn't equal
-to the number supposed to be written.
-.PP
-The number of bytes to be read or written is quite arbitrary.
-The two most common values are 
-1,
-which means one character at a time
-(``unbuffered''),
-and
-512,
-which corresponds to a physical blocksize on many peripheral devices.
-This latter size will be most efficient,
-but even character at a time I/O
-is not inordinately expensive.
-.PP
-Putting these facts together,
-we can write a simple program to copy
-its input to its output.
-This program will copy anything to anything,
-since the input and output can be redirected to any file or device.
-.P1
-#define        BUFSIZE 512     /* best size for PDP-11 UNIX */
-
-main() /* copy input to output */
-{
-       char    buf[BUFSIZE];
-       int     n;
-
-       while ((n = read(0, buf, BUFSIZE)) > 0)
-               write(1, buf, n);
-       exit(0);
-}
-.P2
-If the file size is not a multiple of
-.UL BUFSIZE ,
-some 
-.UL read
-will return a smaller number of bytes
-to be written by
-.UL write ;
-the next call to 
-.UL read
-after that
-will return zero.
-.PP
-It is instructive to see how
-.UL read
-and
-.UL write
-can be used to construct
-higher level routines like
-.UL getchar ,
-.UL putchar ,
-etc.
-For example,
-here is a version of
-.UL getchar
-which does unbuffered input.
-.P1
-#define        CMASK   0377    /* for making char's > 0 */
-
-getchar()      /* unbuffered single character input */
-{
-       char c;
-
-       return((read(0, &c, 1) > 0) ? c & CMASK : EOF);
-}
-.P2
-.UL c
-.ul
-must
-be declared
-.UL char ,
-because
-.UL read
-accepts a character pointer.
-The character being returned must be masked with
-.UL 0377
-to ensure that it is positive;
-otherwise sign extension may make it negative.
-(The constant
-.UL 0377
-is appropriate for the
-.UC PDP -11
-but not necessarily for other machines.)
-.PP
-The second version of
-.UL getchar
-does input in big chunks,
-and hands out the characters one at a time.
-.P1
-#define        CMASK   0377    /* for making char's > 0 */
-#define        BUFSIZE 512
-
-getchar()      /* buffered version */
-{
-       static char     buf[BUFSIZE];
-       static char     *bufp = buf;
-       static int      n = 0;
-
-       if (n == 0) {   /* buffer is empty */
-               n = read(0, buf, BUFSIZE);
-               bufp = buf;
-       }
-       return((--n >= 0) ? *bufp++ & CMASK : EOF);
-}
-.P2
-.NH 2
-Open, Creat, Close, Unlink
-.PP
-Other than the default
-standard input, output and error files,
-you must explicitly open files in order to
-read or write them.
-There are two system entry points for this,
-.UL open
-and
-.UL creat 
-[sic].
-.PP
-.UL open
-is rather like the
-.UL  fopen
-discussed in the previous section,
-except that instead of returning a file pointer,
-it returns a file descriptor,
-which is just an
-.UL int .
-.P1
-int fd;
-
-fd = open(name, rwmode);
-.P2
-As with
-.UL fopen ,
-the
-.UL name
-argument
-is a character string corresponding to the external file name.
-The access mode argument
-is different, however:
-.UL rwmode
-is 0 for read, 1 for write, and 2 for read and write access.
-.UL open
-returns
-.UL -1
-if any error occurs;
-otherwise it returns a valid file descriptor.
-.PP
-It is an error to 
-try to
-.UL open
-a file that does not exist.
-The entry point
-.UL creat
-is provided to create new files,
-or to re-write old ones.
-.P1
-fd = creat(name, pmode);
-.P2
-returns a file descriptor
-if it was able to create the file
-called
-.UL name ,
-and
-.UL -1
-if not.
-If the file
-already exists,
-.UL creat
-will truncate it to zero length;
-it is not an error to
-.UL creat
-a file that already exists.
-.PP
-If the file is brand new,
-.UL creat
-creates it with the
-.ul
-protection mode 
-specified by
-the
-.UL pmode
-argument.
-In the
-.UC UNIX
-file system,
-there are nine bits of protection information
-associated with a file,
-controlling read, write and execute permission for
-the owner of the file,
-for the owner's group,
-and for all others.
-Thus a three-digit octal number
-is most convenient for specifying the permissions.
-For example,
-0755
-specifies read, write and execute permission for the owner,
-and read and execute permission for the group and everyone else.
-.PP
-To illustrate,
-here is a simplified version of
-the
-.UC UNIX
-utility
-.IT cp ,
-a program which copies one file to another.
-(The main simplification is that our version
-copies only one file,
-and does not permit the second argument
-to be a directory.)
-.P1
-#define NULL 0
-#define BUFSIZE 512
-#define PMODE 0644 /* RW for owner, R for group, others */
-
-main(argc, argv)       /* cp: copy f1 to f2 */
-int argc;
-char *argv[];
-{
-       int     f1, f2, n;
-       char    buf[BUFSIZE];
-
-       if (argc != 3)
-               error("Usage: cp from to", NULL);
-       if ((f1 = open(argv[1], 0)) == -1)
-               error("cp: can't open %s", argv[1]);
-       if ((f2 = creat(argv[2], PMODE)) == -1)
-               error("cp: can't create %s", argv[2]);
-
-       while ((n = read(f1, buf, BUFSIZE)) > 0)
-               if (write(f2, buf, n) != n)
-                       error("cp: write error", NULL);
-       exit(0);
-}
-.P2
-.P1
-error(s1, s2)  /* print error message and die */
-char *s1, *s2;
-{
-       printf(s1, s2);
-       printf("\n");
-       exit(1);
-}
-.P2
-.PP
-As we said earlier,
-there is a limit (typically 15-25)
-on the number of files which a program
-may have open simultaneously.
-Accordingly, any program which intends to process
-many files must be prepared to re-use
-file descriptors.
-The routine
-.UL close
-breaks the connection between a file descriptor
-and an open file,
-and frees the
-file descriptor for use with some other file.
-Termination of a program
-via
-.UL exit
-or return from the main program closes all open files.
-.PP
-The function
-.UL unlink(filename)
-removes the file
-.UL filename
-from the file system.
-.NH 2
-Random Access \(em Seek and Lseek
-.PP
-File I/O is normally sequential:
-each
-.UL read
-or
-.UL write
-takes place at a position in the file
-right after the previous one.
-When necessary, however,
-a file can be read or written in any arbitrary order.
-The
-system call
-.UL lseek
-provides a way to move around in
-a file without actually reading
-or writing:
-.P1
-lseek(fd, offset, origin);
-.P2
-forces the current position in the file
-whose descriptor is
-.UL fd
-to move to position
-.UL offset ,
-which is taken relative to the location
-specified by
-.UL origin .
-Subsequent reading or writing will begin at that position.
-.UL offset
-is
-a
-.UL long ;
-.UL fd
-and
-.UL origin
-are
-.UL int 's.
-.UL origin
-can be 0, 1, or 2 to specify that 
-.UL offset
-is to be
-measured from
-the beginning, from the current position, or from the
-end of the file respectively.
-For example,
-to append to a file,
-seek to the end before writing:
-.P1
-lseek(fd, 0L, 2);
-.P2
-To get back to the beginning (``rewind''),
-.P1
-lseek(fd, 0L, 0);
-.P2
-Notice the
-.UL 0L
-argument;
-it could also be written as
-.UL (long)\ 0 .
-.PP
-With 
-.UL lseek ,
-it is possible to treat files more or less like large arrays,
-at the price of slower access.
-For example, the following simple function reads any number of bytes
-from any arbitrary place in a file.
-.P1
-get(fd, pos, buf, n) /* read n bytes from position pos */
-int fd, n;
-long pos;
-char *buf;
-{
-       lseek(fd, pos, 0);      /* get to pos */
-       return(read(fd, buf, n));
-}
-.P2
-.PP
-In pre-version 7
-.UC UNIX ,
-the basic entry point to the I/O system
-is called
-.UL seek .
-.UL seek
-is identical to
-.UL lseek ,
-except that its
-.UL  offset 
-argument is an
-.UL int
-rather than  a
-.UL long .
-Accordingly,
-since
-.UC PDP -11
-integers have only 16 bits,
-the
-.UL offset
-specified
-for
-.UL seek
-is limited to 65,535;
-for this reason,
-.UL origin
-values of 3, 4, 5 cause
-.UL seek
-to multiply the given offset by 512
-(the number of bytes in one physical block)
-and then interpret
-.UL origin
-as if it were 0, 1, or 2 respectively.
-Thus to get to an arbitrary place in a large file
-requires two seeks, first one which selects
-the block, then one which
-has
-.UL origin
-equal to 1 and moves to the desired byte within the block.
-.NH 2
-Error Processing
-.PP
-The routines discussed in this section,
-and in fact all the routines which are direct entries into the system
-can incur errors.
-Usually they indicate an error by returning a value of \-1.
-Sometimes it is nice to know what sort of error occurred;
-for this purpose all these routines, when appropriate,
-leave an error number in the external cell
-.UL errno .
-The meanings of the various error numbers are
-listed
-in the introduction to Section II
-of the
-.I
-.UC UNIX
-Programmer's Manual,
-.R
-so your program can, for example, determine if
-an attempt to open a file failed because it did not exist
-or because the user lacked permission to read it.
-Perhaps more commonly,
-you may want to print out the
-reason for failure.
-The routine
-.UL perror
-will print a message associated with the value
-of
-.UL errno ;
-more generally,
-.UL sys\_errno
-is an array of character strings which can be indexed
-by
-.UL errno
-and printed by your program.
diff --git a/.ref-Research-V7/usr/doc/uprog/p5 b/.ref-Research-V7/usr/doc/uprog/p5
deleted file mode 100644 (file)
index 1a9dc34..0000000
+++ /dev/null
@@ -1,537 +0,0 @@
-.NH
-PROCESSES
-.PP
-It is often easier to use a program written
-by someone else than to invent one's own.
-This section describes how to
-execute a program from within another.
-.NH 2
-The ``System'' Function
-.PP
-The easiest way to execute a program from another
-is to use
-the standard library routine
-.UL system .
-.UL system
-takes one argument, a command string exactly as typed
-at the terminal
-(except for the newline at the end)
-and executes it.
-For instance, to time-stamp the output of a program,
-.P1
-main()
-{
-       system("date");
-       /* rest of processing */
-}
-.P2
-If the command string has to be built from pieces,
-the in-memory formatting capabilities of
-.UL sprintf
-may be useful.
-.PP
-Remember than
-.UL getc
-and
-.UL putc
-normally buffer their input;
-terminal I/O will not be properly synchronized unless
-this buffering is defeated.
-For output, use 
-.UL fflush ;
-for input, see
-.UL setbuf 
-in the appendix.
-.NH 2
-Low-Level Process Creation \(em Execl and Execv
-.PP
-If you're not using the standard library,
-or if you need finer control over what
-happens,
-you will have to construct calls to other programs
-using the more primitive routines that the standard
-library's
-.UL system
-routine is based on.
-.PP
-The most basic operation is to execute another program
-.ul
-without
-.IT returning ,
-by using the routine
-.UL execl  .
-To print the date as the last action of a running program,
-use
-.P1
-execl("/bin/date", "date", NULL);
-.P2
-The first argument to
-.UL execl
-is the
-.ul
-file name
-of the command; you have to know where it is found
-in the file system.
-The second argument is conventionally
-the program name
-(that is, the last component of the file name),
-but this is seldom used except as a place-holder.
-If the command takes arguments, they are strung out after
-this;
-the end of the list is marked by a 
-.UL NULL
-argument.
-.PP
-The
-.UL execl
-call
-overlays the existing program with
-the new one,
-runs that, then exits.
-There is
-.ul
-no
-return to the original program.
-.PP
-More realistically,
-a program might fall into two or more phases
-that communicate only through temporary files.
-Here it is natural to make the second pass
-simply an
-.UL execl
-call from the first.
-.PP
-The one exception to the rule that the original program never gets control
-back occurs when there is an error, for example if the file can't be found
-or is not executable.
-If you don't know where
-.UL date
-is located, say
-.P1
-execl("/bin/date", "date", NULL);
-execl("/usr/bin/date", "date", NULL);
-fprintf(stderr, "Someone stole 'date'\n");
-.P2
-.PP
-A variant of
-.UL execl
-called
-.UL execv
-is useful when you don't know in advance how many arguments there are going to be.
-The call is
-.P1
-execv(filename, argp);
-.P2
-where
-.UL argp
-is an array of pointers to the arguments;
-the last pointer in the array must be 
-.UL NULL
-so
-.UL execv
-can tell where the list ends.
-As with
-.UL execl ,
-.UL filename
-is the file in which the program is found, and
-.UL argp[0]
-is the name of the program.
-(This arrangement is identical to the
-.UL argv
-array for program arguments.)
-.PP
-Neither of these routines provides the niceties of normal command execution.
-There is no automatic search of multiple directories \(em
-you have to know precisely where the command is located.
-Nor do you get the expansion of metacharacters like
-.UL < ,
-.UL > ,
-.UL * ,
-.UL ? ,
-and
-.UL []
-in the argument list.
-If you want these, use
-.UL execl
-to invoke the shell
-.UL sh ,
-which then does all the work.
-Construct a string
-.UL commandline
-that contains the complete command as it would have been typed
-at the terminal, then say
-.P1
-execl("/bin/sh", "sh", "-c", commandline, NULL);
-.P2
-The shell is assumed to be at a fixed place,
-.UL /bin/sh .
-Its argument
-.UL -c
-says to treat the next argument
-as a whole command line, so it does just what you want.
-The only problem is in constructing the right information
-in
-.UL commandline .
-.NH 2
-Control of Processes \(em Fork and Wait
-.PP
-So far what we've talked about isn't really all that useful by itself.
-Now we will show how to regain control after running
-a program with
-.UL execl
-or
-.UL execv .
-Since these routines simply overlay the new program on the old one,
-to save the old one requires that it first be split into
-two copies;
-one of these can be overlaid, while the other waits for the new,
-overlaying program to finish.
-The splitting is done by a routine called
-.UL fork :
-.P1
-proc_id = fork();
-.P2
-splits the program into two copies, both of which continue to run.
-The only difference between the two is the value of
-.UL proc_id ,
-the ``process id.''
-In one of these processes (the ``child''),
-.UL proc_id
-is zero.
-In the other
-(the ``parent''),
-.UL proc_id
-is non-zero; it is the process number of the child.
-Thus the basic way to call, and return from,
-another program is
-.P1
-if (fork() == 0)
-       execl("/bin/sh", "sh", "-c", cmd, NULL);        /* in child */
-.P2
-And in fact, except for handling errors, this is sufficient.
-The
-.UL fork
-makes two copies of the program.
-In the child, the value returned by
-.UL fork
-is zero, so it calls
-.UL execl
-which does the
-.UL command
-and then dies.
-In the parent,
-.UL fork
-returns non-zero
-so it skips the
-.UL execl.
-(If there is any error,
-.UL fork
-returns
-.UL -1 ).
-.PP
-More often, the parent wants to wait for the child to terminate
-before continuing itself.
-This can be done with
-the function
-.UL wait :
-.P1
-int status;
-
-if (fork() == 0)
-       execl(...);
-wait(&status);
-.P2
-This still doesn't handle any abnormal conditions, such as a failure
-of the
-.UL execl
-or
-.UL fork ,
-or the possibility that there might be more than one child running simultaneously.
-(The
-.UL wait
-returns the
-process id
-of the terminated child, if you want to check it against the value
-returned by
-.UL fork .)
-Finally, this fragment doesn't deal with any
-funny behavior on the part of the child
-(which is reported in
-.UL status ).
-Still, these three lines
-are the heart of the standard library's
-.UL system
-routine,
-which we'll show in a moment.
-.PP
-The
-.UL  status 
-returned by
-.UL wait
-encodes in its low-order eight bits
-the system's idea of the child's termination status;
-it is 0 for normal termination and non-zero to indicate
-various kinds of problems.
-The next higher eight bits are taken from the argument
-of the call to
-.UL exit
-which caused a normal termination of the child process.
-It is good coding practice
-for all programs to return meaningful
-status.
-.PP
-When a program is called by the shell,
-the three file descriptors
-0, 1, and 2 are set up pointing at the right files,
-and all other possible file descriptors
-are available for use.
-When this program calls another one,
-correct etiquette suggests making sure the same conditions
-hold.
-Neither
-.UL fork
-nor the
-.UL exec
-calls affects open files in any way.
-If the parent is buffering output
-that must come out before output from the child,
-the parent must flush its buffers
-before the
-.UL execl .
-Conversely,
-if a caller buffers an input stream,
-the called program will lose any information
-that has been read by the caller.
-.NH 2
-Pipes
-.PP
-A
-.ul
-pipe
-is an I/O channel intended for use
-between two cooperating processes:
-one process writes into the pipe,
-while the other reads.
-The system looks after buffering the data and synchronizing
-the two processes.
-Most pipes are created by the shell,
-as in
-.P1
-ls | pr
-.P2
-which connects the standard output of
-.UL ls
-to the standard input of
-.UL pr .
-Sometimes, however, it is most convenient
-for a process to set up its own plumbing;
-in this section, we will illustrate how
-the pipe connection is established and used.
-.PP
-The system call
-.UL pipe
-creates a pipe.
-Since a pipe is used for both reading and writing,
-two file descriptors are returned;
-the actual usage is like this:
-.P1
-int    fd[2];
-
-stat = pipe(fd);
-if (stat == -1)
-       /* there was an error ... */
-.P2
-.UL fd
-is an array of two file descriptors, where
-.UL fd[0]
-is the read side of the pipe and
-.UL fd[1] 
-is for writing.
-These may be used in
-.UL read ,
-.UL write
-and
-.UL close
-calls just like any other file descriptors.
-.PP
-If a process reads a pipe which is empty,
-it will wait until data arrives;
-if a process writes into a pipe which
-is too full, it will wait until the pipe empties somewhat.
-If the write side of the pipe is closed,
-a subsequent
-.UL  read 
-will encounter end of file.
-.PP
-To illustrate the use of pipes in a realistic setting,
-let us write a function called
-.UL popen(cmd,\ mode) ,
-which creates a process
-.UL cmd
-(just as
-.UL system 
-does),
-and returns a file descriptor that will either
-read or write that process, according to 
-.UL mode .
-That is,
-the call
-.P1
-fout = popen("pr", WRITE);
-.P2
-creates a process that executes
-the
-.UL pr
-command;
-subsequent
-.UL write
-calls using the file descriptor
-.UL fout
-will send their data to that process
-through the pipe.
-.PP
-.UL popen
-first creates the
-the pipe with a
-.UL pipe
-system call;
-it then
-.UL fork s
-to create two copies of itself.
-The child decides whether it is supposed to read or write,
-closes the other side of the pipe,
-then calls the shell (via
-.UL execl )
-to run the desired process.
-The parent likewise closes the end of the pipe it does not use.
-These closes are necessary to make end-of-file tests work properly.
-For example, if a child that intends to read
-fails to close the write end of the pipe, it will never
-see the end of the pipe file, just because there is one writer
-potentially active.
-.P1
-#include <stdio.h>
-
-#define        READ    0
-#define        WRITE   1
-#define        tst(a, b)       (mode == READ ? (b) : (a))
-static int     popen_pid;
-
-popen(cmd, mode)
-char   *cmd;
-int    mode;
-{
-       int p[2];
-
-       if (pipe(p) < 0)
-               return(NULL);
-       if ((popen_pid = fork()) == 0) {
-               close(tst(p[WRITE], p[READ]));
-               close(tst(0, 1));
-               dup(tst(p[READ], p[WRITE]));
-               close(tst(p[READ], p[WRITE]));
-               execl("/bin/sh", "sh", "-c", cmd, 0);
-               _exit(1);       /* disaster has occurred if we get here */
-       }
-       if (popen_pid == -1)
-               return(NULL);
-       close(tst(p[READ], p[WRITE]));
-       return(tst(p[WRITE], p[READ]));
-}
-.P2
-The sequence of
-.UL close s
-in the child
-is a bit tricky.
-Suppose
-that the task is to create a child process that will read data from the parent.
-Then the first
-.UL close
-closes the write side of the pipe,
-leaving the read side open.
-The lines
-.P1
-close(tst(0, 1));
-dup(tst(p[READ], p[WRITE]));
-.P2
-are the conventional way to associate the pipe descriptor
-with the standard input of the child.
-The 
-.UL close
-closes file descriptor 0,
-that is, the standard input.
-.UL dup
-is a system call that
-returns a duplicate of an already open file descriptor.
-File descriptors are assigned in increasing order
-and the first available one is returned,
-so
-the effect of the
-.UL dup
-is to copy the file descriptor for the pipe (read side)
-to file descriptor 0;
-thus the read side of the pipe becomes the standard input.
-(Yes, this is a bit tricky, but it's a standard idiom.)
-Finally, the old read side of the pipe is closed.
-.PP
-A similar sequence of operations takes place
-when the child process is supposed to write
-from the parent instead of reading.
-You may find it a useful exercise to step through that case.
-.PP
-The job is not quite done,
-for we still need a function
-.UL pclose
-to close the pipe created by
-.UL popen .
-The main reason for using a separate function rather than
-.UL close
-is that it is desirable to wait for the termination of the child process.
-First, the return value from
-.UL pclose
-indicates whether the process succeeded.
-Equally important when a process creates several children
-is that only a bounded number of unwaited-for children
-can exist, even if some of them have terminated;
-performing the
-.UL wait
-lays the child to rest.
-Thus:
-.P1
-#include <signal.h>
-
-pclose(fd)     /* close pipe fd */
-int fd;
-{
-       register r, (*hstat)(), (*istat)(), (*qstat)();
-       int      status;
-       extern int popen_pid;
-
-       close(fd);
-       istat = signal(SIGINT, SIG_IGN);
-       qstat = signal(SIGQUIT, SIG_IGN);
-       hstat = signal(SIGHUP, SIG_IGN);
-       while ((r = wait(&status)) != popen_pid && r != -1);
-       if (r == -1)
-               status = -1;
-       signal(SIGINT, istat);
-       signal(SIGQUIT, qstat);
-       signal(SIGHUP, hstat);
-       return(status);
-}
-.P2
-The calls to
-.UL signal
-make sure that no interrupts, etc.,
-interfere with the waiting process;
-this is the topic of the next section.
-.PP
-The routine as written has the limitation that only one pipe may
-be open at once, because of the single shared variable
-.UL popen_pid ;
-it really should be an array indexed by file descriptor.
-A
-.UL popen
-function, with slightly different arguments and return value is available
-as part of the standard I/O library discussed below.
-As currently written, it shares the same limitation.
diff --git a/.ref-Research-V7/usr/doc/uprog/p6 b/.ref-Research-V7/usr/doc/uprog/p6
deleted file mode 100644 (file)
index 504b76c..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-.NH
-SIGNALS \(em INTERRUPTS AND ALL THAT
-.PP
-This section is concerned with how to
-deal gracefully with signals from
-the outside world (like interrupts), and with program faults.
-Since there's nothing very useful that
-can be done from within C about program
-faults, which arise mainly from illegal memory references
-or from execution of peculiar instructions,
-we'll discuss only the outside-world signals:
-.IT interrupt ,
-which is sent when the
-.UC DEL
-character is typed;
-.IT quit ,
-generated by the
-.UC FS
-character;
-.IT hangup ,
-caused by hanging up the phone;
-and
-.IT terminate ,
-generated by the
-.IT kill
-command.
-When one of these events occurs,
-the signal is sent to
-.IT  all 
-processes which were started
-from the corresponding terminal;
-unless other arrangements have been made,
-the signal
-terminates the process.
-In the
-.IT quit
-case, a core image file is written for debugging
-purposes.
-.PP
-The routine which alters the default action
-is
-called
-.UL signal .
-It has two arguments: the first specifies the signal, and the second
-specifies how to treat it.
-The first argument is just a number code, but the second is the
-address is either a function, or a somewhat strange code
-that requests that the signal either be ignored, or that it be
-given the default action.
-The include file
-.UL signal.h
-gives names for the various arguments, and should always be included
-when signals are used.
-Thus
-.P1
-#include <signal.h>
- ...
-signal(SIGINT, SIG_IGN);
-.P2
-causes interrupts to be ignored, while
-.P1
-signal(SIGINT, SIG_DFL);
-.P2
-restores the default action of process termination.
-In all cases,
-.UL signal
-returns the previous value of the signal.
-The second argument to
-.UL signal
-may instead be the name of a function
-(which has to be declared explicitly if
-the compiler hasn't seen it already).
-In this case, the named routine will be called
-when the signal occurs.
-Most commonly this facility is used
-to allow the program to clean up
-unfinished business before terminating, for example to
-delete a temporary file:
-.P1
-#include <signal.h>
-
-main()
-{
-       int onintr();
-
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, onintr);
-
-       /* Process ... */
-
-       exit(0);
-}
-
-onintr()
-{
-       unlink(tempfile);
-       exit(1);
-}
-.P2
-.PP
-Why the test and the double call to
-.UL signal ?
-Recall that signals like interrupt are sent to
-.ul
-all
-processes started from a particular terminal.
-Accordingly, when a program is to be run
-non-interactively
-(started by
-.UL & ),
-the shell turns off interrupts for it
-so it won't be stopped by interrupts intended for foreground processes.
-If this program began by announcing that all interrupts were to be sent
-to the
-.UL onintr
-routine regardless,
-that would undo the shell's effort to protect it
-when run in the background.
-.PP
-The solution, shown above, is to test the state of interrupt handling,
-and to continue to ignore interrupts if they are already being ignored.
-The code as written
-depends on the fact that
-.UL signal
-returns the previous state of a particular signal.
-If signals were already being ignored, the process should continue to ignore them;
-otherwise, they should be caught.
-.PP
-A more sophisticated program may wish to intercept
-an interrupt and interpret it as a request
-to stop what it is doing
-and return to its own command-processing loop.
-Think of a text editor:
-interrupting a long printout should not cause it
-to terminate and lose the work
-already done.
-The outline of the code for this case is probably best written like this:
-.P1
-#include <signal.h>
-#include <setjmp.h>
-jmp_buf        sjbuf;
-
-main()
-{
-       int (*istat)(), onintr();
-
-       istat = signal(SIGINT, SIG_IGN);        /* save original status */
-       setjmp(sjbuf);  /* save current stack position */
-       if (istat != SIG_IGN)
-               signal(SIGINT, onintr);
-
-       /* main processing loop */
-}
-.P2
-.P1
-onintr()
-{
-       printf("\nInterrupt\n");
-       longjmp(sjbuf); /* return to saved state */
-}
-.P2
-The include file
-.UL setjmp.h
-declares the type
-.UL jmp_buf
-an object in which the state
-can be saved.
-.UL sjbuf
-is such an object; it is an array of some sort.
-The
-.UL setjmp
-routine then saves
-the state of things.
-When an interrupt occurs,
-a call is forced to the
-.UL onintr
-routine,
-which can print a message, set flags, or whatever.
-.UL longjmp
-takes as argument an object stored into by
-.UL setjmp ,
-and restores control
-to the location after the call to
-.UL setjmp ,
-so control (and the stack level) will pop back
-to the place in the main routine where
-the signal is set up and the main loop entered.
-Notice, by the way, that
-the signal
-gets set again after an interrupt occurs.
-This is necessary; most signals are automatically
-reset to their default action when they occur.
-.PP
-Some programs that want to detect signals simply can't be stopped
-at an arbitrary point,
-for example in the middle of updating a linked list.
-If the routine called on occurrence of a signal
-sets a flag and then
-returns instead of calling
-.UL exit
-or
-.UL longjmp ,
-execution will continue
-at the exact point it was interrupted.
-The interrupt flag can then be tested later.
-.PP
-There is one difficulty associated with this
-approach.
-Suppose the program is reading the
-terminal when the interrupt is sent.
-The specified routine is duly called; it sets its flag
-and returns.
-If it were really true, as we said
-above, that ``execution resumes at the exact point it was interrupted,''
-the program would continue reading the terminal
-until the user typed another line.
-This behavior might well be confusing, since the user
-might not know that the program is reading;
-he presumably would prefer to have the signal take effect instantly.
-The method chosen to resolve this difficulty
-is to terminate the terminal read when execution
-resumes after the signal, returning an error code
-which indicates what happened.
-.PP
-Thus programs which catch and resume
-execution after signals should be prepared for ``errors''
-which are caused by interrupted
-system calls.
-(The ones to watch out for are reads from a terminal,
-.UL wait ,
-and
-.UL pause .)
-A program
-whose
-.UL onintr
-program just sets
-.UL intflag ,
-resets the interrupt signal, and returns,
-should usually include code like the following when it reads
-the standard input:
-.P1
-if (getchar() == EOF)
-       if (intflag)
-               /* EOF caused by interrupt */
-       else
-               /* true end-of-file */
-.P2
-.PP
-A final subtlety to keep in mind becomes important
-when signal-catching is combined with execution of other programs.
-Suppose a program catches interrupts, and also includes
-a method (like ``!'' in the editor)
-whereby other programs can be executed.
-Then the code should look something like this:
-.P1
-if (fork() == 0)
-       execl(...);
-signal(SIGINT, SIG_IGN);       /* ignore interrupts */
-wait(&status); /* until the child is done */
-signal(SIGINT, onintr);        /* restore interrupts */
-.P2
-Why is this?
-Again, it's not obvious but not really difficult.
-Suppose the program you call catches its own interrupts.
-If you interrupt the subprogram,
-it will get the signal and return to its
-main loop, and probably read your terminal.
-But the calling program will also pop out of
-its wait for the subprogram and read your terminal.
-Having two processes reading
-your terminal is very unfortunate,
-since the system figuratively flips a coin to decide
-who should get each line of input.
-A simple way out is to have the parent program
-ignore interrupts until the child is done.
-This reasoning is reflected in the standard I/O library function
-.UL system :
-.P1
-#include <signal.h>
-
-system(s)      /* run command string s */
-char *s;
-{
-       int status, pid, w;
-       register int (*istat)(), (*qstat)();
-
-       if ((pid = fork()) == 0) {
-               execl("/bin/sh", "sh", "-c", s, 0);
-               _exit(127);
-       }
-       istat = signal(SIGINT, SIG_IGN);
-       qstat = signal(SIGQUIT, SIG_IGN);
-       while ((w = wait(&status)) != pid && w != -1)
-               ;
-       if (w == -1)
-               status = -1;
-       signal(SIGINT, istat);
-       signal(SIGQUIT, qstat);
-       return(status);
-}
-.P2
-.PP
-As an aside on declarations,
-the function
-.UL signal
-obviously has a rather strange second argument.
-It is in fact a pointer to a function delivering an integer,
-and this is also the type of the signal routine itself.
-The two values
-.UL SIG_IGN
-and
-.UL SIG_DFL
-have the right type, but are chosen so they coincide with
-no possible actual functions.
-For the enthusiast, here is how they are defined for the PDP-11;
-the definitions should be sufficiently ugly
-and nonportable to encourage use of the include file.
-.P1
-#define        SIG_DFL (int (*)())0
-#define        SIG_IGN (int (*)())1
-.P2
diff --git a/.ref-Research-V7/usr/doc/uprog/p8 b/.ref-Research-V7/usr/doc/uprog/p8
deleted file mode 100644 (file)
index 7f85c10..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-.SH
-References
-.LP
-.IP [1]
-K. L. Thompson and D. M. Ritchie,
-.ul
-The
-.ul
-.UC UNIX
-.ul
-Programmer's Manual,
-Bell Laboratories, 1978.
-.IP [2]
-B. W. Kernighan and D. M. Ritchie,
-.ul
-The C Programming Language,
-Prentice-Hall, Inc., 1978.
-.IP [3]
-B. W. Kernighan,
-.UC UNIX \& ``
-for Beginners \(em Second Edition.''
-Bell Laboratories, 1978.
diff --git a/.ref-Research-V7/usr/doc/uprog/p9 b/.ref-Research-V7/usr/doc/uprog/p9
deleted file mode 100644 (file)
index 9a3ca20..0000000
+++ /dev/null
@@ -1,640 +0,0 @@
-.sp 100
-.TL
-.ft R
-Appendix \(em The Standard I/O Library
-.AU
-D. M. Ritchie
-.AI
-.MH
-.PP
-The standard I/O library
-was designed with the following goals in mind.
-.IP 1.
-It must be as efficient as possible, both in time and in space,
-so that there will be no hesitation in using it
-no matter how critical the application.
-.IP 2.
-It must be simple to use, and also free of the magic
-numbers and mysterious calls
-whose use mars the understandability and portability
-of many programs using older packages.
-.IP 3.
-The interface provided should be applicable on all machines,
-whether or not the programs which implement it are directly portable
-to other systems,
-or to machines other than the PDP-11 running a version of
-.UC UNIX .
-.SH
-1.  General Usage
-.PP
-Each program using the library must have the line
-.P1
-               #include <stdio.h>
-.P2
-which defines certain macros and variables.
-The routines are in the normal C library,
-so no special library argument is needed for loading.
-All names in the include file intended only for internal use begin
-with an underscore
-.UL _
-to reduce the possibility
-of collision with a user name.
-The names intended to be visible outside the package are
-.IP \f3stdin\f1 10
-The name of the standard input file
-.IP \f3stdout\f1 10
-The name of the standard output file
-.IP \f3stderr\f1 10
-The name of the standard error file
-.IP \f3EOF\f1 10
-is actually \-1, and is the value returned by
-the read routines on end-of-file or error.
-.IP \f3NULL\f1 10
-is a notation for the null pointer, returned by
-pointer-valued functions
-to indicate an error
-.IP \f3FILE\f1 10
-expands to
-.UL struct
-.UL _iob
-and is a useful
-shorthand when declaring pointers
-to streams.
-.IP \f3BUFSIZ\f1 10
-is a number (viz. 512)
-of the size suitable for an I/O buffer supplied by the user.
-See
-.UL setbuf ,
-below.
-.IP \f3getc,\ getchar,\ putc,\ putchar,\ feof,\ ferror,\ f\&ileno\f1 10
-.br
-are defined as macros.
-Their actions are described below;
-they are mentioned here
-to point out that it is not possible to
-redeclare them
-and that they are not actually functions;
-thus, for example, they may not have breakpoints set on them.
-.PP
-The routines in this package
-offer the convenience of automatic buffer allocation
-and output flushing where appropriate.
-The names
-.UL stdin ,
-.UL stdout ,
-and
-.UL stderr
-are in effect constants and may not be assigned to.
-.SH
-2.  Calls
-.nr PD .4v
-.LP
-.UL FILE\ *fopen(filename,\ type)\ char\ *filename,\ *type;
-.nr PD 0
-.IP
-.br
-opens the file and, if needed, allocates a buffer for it.
-.UL filename
-is a character string specifying the name.
-.UL type
-is a character string (not a single character).
-It may be
-.UL \&"r" ,
-.UL \&"w" ,
-or
-.UL \&"a"
-to indicate
-intent to read, write, or append.
-The value returned is a file pointer.
-If it is
-.UL  NULL
-the attempt to open failed.
-.ne 3
-.nr PD .4v
-.LP
-.UL FILE\ *freopen(filename,\ type,\ ioptr)\ char\ *filename,\ *type;\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-The stream named by
-.UL ioptr
-is closed, if necessary, and then reopened
-as if by
-.UL fopen .
-If the attempt to open fails,
-.UL  NULL
-is returned,
-otherwise
-.UL ioptr ,
-which will now refer to the new file.
-Often the reopened stream is
-.UL stdin
-or
-.UL stdout .
-.nr PD .4v
-.LP
-.UL int\ getc(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-returns the next character from the stream named by
-.UL ioptr ,
-which is a pointer to a file such as returned by
-.UL fopen ,
-or the name
-.UL stdin .
-The integer
-.UL  EOF
-is returned on end-of-file or when
-an error occurs.
-The null character
-.UL \e0
-is a legal character.
-.nr PD .4v
-.LP
-.UL int\ fgetc(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-acts like
-.UL getc
-but is a genuine function,
-not a macro,
-so it can be pointed to, passed as an argument, etc.
-.nr PD .4v
-.LP
-.UL putc(c,\ ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-.UL putc
-writes the character
-.UL c
-on the output stream named by
-.UL ioptr ,
-which is a value returned from
-.UL fopen
-or perhaps
-.UL stdout
-or
-.UL stderr .
-The character is returned as value,
-but
-.UL  EOF
-is returned on error.
-.nr PD .4v
-.LP
-.UL fputc(c,\ ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-acts like
-.UL putc
-but is a genuine
-function, not a macro.
-.nr PD .4v
-.LP
-.UL fclose(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-The file corresponding to
-.UL ioptr
-is closed after any buffers are emptied.
-A buffer allocated by the I/O system is freed.
-.UL fclose
-is automatic on normal termination of the program.
-.nr PD .4v
-.LP
-.UL fflush(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-Any buffered information on the (output) stream named by
-.UL ioptr
-is written out.
-Output files are normally buffered
-if and only if they are not directed to the terminal;
-however,
-.UL stderr
-always starts off unbuffered and remains so unless
-.UL setbuf
-is used, or unless it is reopened.
-.nr PD .4v
-.LP
-.UL exit(errcode);
-.nr PD 0
-.IP
-.br
-terminates the process and returns its argument as status
-to the parent.
-This is a special version of the routine
-which calls
-.UL fflush
-for each output file.
-To terminate without flushing,
-use
-.UL _exit .
-.nr PD .4v
-.LP
-.UL feof(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-returns non-zero when end-of-file
-has occurred on the specified input stream.
-.nr PD .4v
-.LP
-.UL ferror(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-returns non-zero when an error has occurred while reading
-or writing the named stream.
-The error indication lasts until the file has been closed.
-.nr PD .4v
-.LP
-.UL getchar();
-.nr PD 0
-.IP
-.br
-is identical to
-.UL getc(stdin) .
-.nr PD .4v
-.LP
-.UL putchar(c);
-.nr PD 0
-.IP
-.br
-is identical to
-.UL putc(c,\ stdout) .
-.nr PD .4v
-.nr PD .4v
-.ne 2
-.LP
-.UL char\ *fgets(s,\ n,\ ioptr)\ char\ *s;\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-reads up to
-.UL n-1
-characters from the stream
-.UL ioptr
-into the character pointer
-.UL s .
-The read terminates with a newline character.
-The newline character is placed in the buffer
-followed by a null character.
-.UL fgets
-returns the first argument,
-or
-.UL  NULL
-if error or end-of-file occurred.
-.nr PD .4v
-.nr PD .4v
-.LP
-.UL fputs(s,\ ioptr)\ char\ *s;\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-writes the null-terminated string (character array)
-.UL s
-on the stream
-.UL ioptr .
-No newline is appended.
-No value is returned.
-.nr PD .4v
-.LP
-.UL ungetc(c,\ ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-The argument character
-.UL c
-is pushed back on the input stream named by
-.UL ioptr .
-Only one character may be pushed back.
-.ne 5
-.nr PD .4v
-.LP
-.UL printf(format,\ a1,\ ...)\ char\ *format;
-.br
-.UL fprintf(ioptr,\ format,\ a1,\ ...)\ FILE\ *ioptr;\ char\ *format;
-.br
-.UL sprintf(s,\ format,\ a1,\ ...)char\ *s,\ *format;
-.br
-.nr PD 0
-.IP
-.UL printf
-writes on the standard output.
-.UL fprintf
-writes on the named output stream.
-.UL sprintf
-puts characters in the character array (string)
-named by
-.UL s .
-The specifications are as described in section
-.UL printf (3)
-of the
-.ul
-.UC UNIX
-.ul
-Programmer's Manual.
-.nr PD .4v
-.LP
-.UL scanf(format,\ a1,\ ...)\ char\ *format;
-.br
-.UL fscanf(ioptr,\ format,\ a1,\ ...)\ FILE\ *ioptr;\ char\ *format;
-.br
-.UL sscanf(s,\ format,\ a1,\ ...)\ char\ *s,\ *format;
-.nr PD 0
-.IP
-.br
-.UL scanf
-reads from the standard input.
-.UL fscanf
-reads from the named input stream.
-.UL sscanf
-reads from the character string
-supplied as
-.UL s .
-.UL scanf
-reads characters, interprets
-them according to a format, and stores the results in its arguments.
-Each routine expects as arguments
-a control string
-.UL format ,
-and a set of arguments,
-.I
-each of which must be a pointer,
-.R
-indicating where the converted input should be stored.
-.if t .sp .4v
-.UL scanf
-returns as its value the number of successfully matched and assigned input
-items.
-This can be used to decide how many input items were found.
-On end of file,
-.UL EOF
-is returned; note that this is different
-from 0, which means that the next input character does not
-match what was called for in the control string.
-.RE
-.nr PD .4v
-.LP
-.UL fread(ptr,\ sizeof(*ptr),\ nitems,\ ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-reads
-.UL nitems
-of data beginning at
-.UL ptr
-from file
-.UL ioptr .
-No advance notification
-that binary I/O is being done is required;
-when, for portability reasons,
-it becomes required, it will be done
-by adding an additional character to the mode-string on the
-.UL fopen
-call.
-.nr PD .4v
-.LP
-.UL fwrite(ptr,\ sizeof(*ptr),\ nitems,\ ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-Like
-.UL fread ,
-but in the other direction.
-.nr PD .4v
-.LP
-.UL rewind(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-rewinds the stream
-named by
-.UL ioptr .
-It is not very useful except on input,
-since a rewound output file is still open only for output.
-.nr PD .4v
-.LP
-.UL system(string)\ char\ *string;
-.nr PD 0
-.IP
-.br
-The
-.UL string
-is executed by the shell as if typed at the terminal.
-.nr PD .4v
-.LP
-.UL getw(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-returns the next word from the input stream named by
-.UL ioptr .
-.UL EOF
-is returned on end-of-file or error,
-but since this a perfectly good
-integer
-.UL feof
-and
-.UL ferror
-should be used.
-A ``word'' is 16 bits on the
-.UC PDP-11.
-.nr PD .4v
-.LP
-.UL putw(w,\ ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-writes the integer
-.UL w
-on the named output stream.
-.nr PD .4v
-.LP
-.UL setbuf(ioptr,\ buf)\ FILE\ *ioptr;\ char\ *buf;
-.nr PD 0
-.IP
-.br
-.UL setbuf
-may be used after a stream has been opened
-but before I/O has started.
-If
-.UL buf
-is
-.UL NULL ,
-the stream will be unbuffered.
-Otherwise the buffer supplied will be used.
-It must be a character array of sufficient size:
-.P1
-char   buf[BUFSIZ];
-.P2
-.nr PD .4v
-.LP
-.UL fileno(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-returns the integer file descriptor associated with the file.
-.nr PD .4v
-.LP
-.UL fseek(ioptr,\ offset,\ ptrname)\ FILE\ *ioptr;\ long\ offset;
-.nr PD 0
-.IP
-.br
-The location of the next byte in the stream
-named by
-.UL ioptr
-is adjusted.
-.UL offset
-is a long integer.
-If
-.UL ptrname
-is 0, the offset is measured from the beginning of the file;
-if
-.UL ptrname
-is 1, the offset is measured from the current read or
-write pointer;
-if
-.UL ptrname
-is 2, the offset is measured from the end of the file.
-The routine accounts properly for any buffering.
-(When this routine is used on
-.UC UNIX \& non-
-systems,
-the offset must be a value returned from
-.UL ftell
-and the ptrname must be 0).
-.ne 3
-.nr PD .4v
-.LP
-.UL long\ ftell(ioptr)\ FILE\ *ioptr;
-.nr PD 0
-.IP
-.br
-The byte offset, measured from the beginning of the file,
-associated with the named stream is returned.
-Any buffering is properly accounted for.
-(On
-.UC UNIX \& non-
-systems the value of this call is useful only
-for handing to
-.UL fseek ,
-so as to position the file to the same place it was when
-.UL ftell
-was called.)
-.nr PD .4v
-.LP
-.UL getpw(uid,\ buf)\ char\ *buf;
-.nr PD 0
-.IP
-.br
-The password file is searched for the given integer user ID.
-If an appropriate line is found, it is copied into
-the character array
-.UL buf ,
-and 0 is returned.
-If no line is found corresponding to the user ID
-then 1 is returned.
-.nr PD .4v
-.LP
-.UL char\ *malloc(num);
-.nr PD 0
-.IP
-.br
-allocates
-.UL num
-bytes.
-The pointer returned is sufficiently well aligned to be usable for any purpose.
-.UL NULL
-is returned if no space is available.
-.nr PD .4v
-.LP
-.UL char\ *calloc(num,\ size);
-.nr PD 0
-.IP
-.br
-allocates space for
-.UL num
-items each of size
-.UL size .
-The space is guaranteed to be set to 0 and the pointer is
-sufficiently well aligned to be usable for any purpose.
-.UL NULL
-is returned if no space is available .
-.nr PD .4v
-.LP
-.UL cfree(ptr)\ char\ *ptr;
-.nr PD 0
-.IP
-.br
-Space is returned to the pool used by
-.UL calloc .
-Disorder can be expected if the pointer was not obtained
-from
-.UL calloc .
-.nr PD .4v
-.LP
-The following are macros whose definitions may be obtained by including
-.UL <ctype.h> .
-.nr PD .4v
-.LP
-.UL isalpha(c)
-returns non-zero if the argument is alphabetic.
-.nr PD .4v
-.LP
-.UL isupper(c)
-returns non-zero if the argument is upper-case alphabetic.
-.nr PD .4v
-.LP
-.UL islower(c)
-returns non-zero if the argument is lower-case alphabetic.
-.nr PD .4v
-.LP
-.UL isdigit(c)
-returns non-zero if the argument is a digit.
-.nr PD .4v
-.LP
-.UL isspace(c)
-returns non-zero if the argument is a spacing character:
-tab, newline, carriage return, vertical tab,
-form feed, space.
-.nr PD .4v
-.LP
-.UL ispunct(c)
-returns non-zero if the argument is
-any punctuation character, i.e., not a space, letter,
-digit or control character.
-.nr PD .4v
-.LP
-.UL isalnum(c)
-returns non-zero if the argument is a letter or a digit.
-.nr PD .4v
-.LP
-.UL isprint(c)
-returns non-zero if the argument is printable \(em
-a letter, digit, or punctuation character.
-.nr PD .4v
-.LP
-.UL iscntrl(c)
-returns non-zero if the argument is a control character.
-.nr PD .4v
-.LP
-.UL isascii(c)
-returns non-zero if the argument is an ascii character, i.e., less than octal 0200.
-.nr PD .4v
-.LP
-.UL toupper(c)
-returns the upper-case character corresponding to the lower-case
-letter
-.UL c.
-.nr PD .4v
-.LP
-.UL tolower(c)
-returns the lower-case character corresponding to the upper-case
-letter
-.UL c .
diff --git a/.ref-Research-V7/usr/doc/uucp/implement b/.ref-Research-V7/usr/doc/uucp/implement
deleted file mode 100644 (file)
index 10ea3e5..0000000
+++ /dev/null
@@ -1,1786 +0,0 @@
-.RP
-.TM 78-1273-5 39199 39199-11
-.ND October 31, 1978
-.if \n(TN>0 .FS
-.if \n(TN>0 * On internship from Department 9444.
-.if \n(TN>0 .FE
-.TL
-Uucp Implementation Description
-.AU "MH 2C-572" 3126
-.ie \n(TN>0 D. A. Nowitz\s-2\u*\d\s+2
-.el D. A. Nowitz
-.AB
-.PP
-Uucp is a series of programs designed to permit communication
-between
-UNIX
-systems using either dial-up or hardwired communication
-lines.
-This document gives a detailed implementation
-description of the current (second)
-implementation of uucp.
-.PP
-This document is
-for use by an administrator/installer of the system.
-It is not meant as a user's guide.
-.AE
-.CS 12 5 15
-.SH
-Introduction
-.LP
-Uucp is a series of programs designed to permit communication between
-.UX
-systems using either dial-up or
-hardwired communication lines.
-It is used for file transfers and remote command execution.
-The first version of the system was designed and implemented
-by M. E. Lesk.\s-2\u1\d\s+2
-.FS
-1 M. E. Lesk and A. S. Cohen,
-.UX
-Software Distribution by Communication Link,
-.ie \n(TN>0 TM-77-1274-3, TM-77-8234-5.
-.el private communication.
-.FE
-This paper describes the current (second) implementation
-of the system.
-.LP
-Uucp is a batch type operation.
-Files are created in a spool directory for processing
-by the uucp demons.
-There are three types of files used for the execution
-of work.
-.I Data\ files
-contain data for transfer to remote systems.
-.I Work\ files
-contain directions for file transfers between systems.
-.I Execution\ files
-are directions for
-.UX
-command executions which
-involve the resources of one or more systems.
-.LP
-The uucp system consists of four primary and two
-secondary programs.
-The primary programs are:
-.RS
-.IP uucp 10
-This program creates work and gathers data files in the spool directory
-for the transmission of files.
-.IP uux
-This program creates work files, execute files and gathers data files for the remote execution of
-.UX
-commands.
-.IP uucico
-This program executes the work files for data transmission.
-.IP uuxqt
-This program executes the execution files for
-.UX
-command execution.
-.RE
-.ne 10
-.LP
-The secondary programs are:
-.RS
-.IP uulog 10
-This program updates the log file with new entries
-and reports on the status of uucp requests.
-.IP uuclean
-This program removes old files from the spool directory.
-.LP
-.RE
-The remainder of this paper will describe the operation
-of each program, the installation of the system,
-the security aspects of the system,
-the files required for execution,
-and the administration of the system.
-.NH
-Uucp - UNIX to UNIX File Copy
-.LP
-The
-.I uucp
-command is the user's primary interface with the system.
-The
-.I uucp
-command was designed to look like
-.I cp
-to the user.
-The syntax is
-.IP
-.I uucp\ \ 
-.B [
-option
-.B ]
-\ ...\ \ source\ ...\ \ destination
-.LP
-where the source and destination
-may contain the prefix
-.I system-name!
-which indicates the system on which the file
-or files reside
-or where they will be copied.
-.LP
-The options interpreted by
-.I uucp
-are:
-.RS
-.IP \-d 10
-Make directories when necessary for copying the file.
-.IP \-c
-Don't copy source files to the spool directory,
-but use the specified source when the actual
-transfer takes place.
-.IP \-g\fIletter\fR
-Put
-.I letter
-in as the grade in the name of the work file.
-(This can be used to change the order of work for a particular
-machine.)
-.IP \-m
-Send mail on completion of the work.
-.LP
-The following options are used primarily for debugging:
-.IP \-r 10
-Queue the job but do not start
-.I uucico
-program.
-.IP \-s\fIdir\fR
-Use directory
-.I dir
-for the spool directory.
-.IP \-x\fInum\fR
-.I Num
-is the level of debugging output desired.
-.RE
-.LP
-The destination may be a directory name,
-in which case the file name is taken from the last part of the
-source's name.
-The source
-name may contain special shell characters
-such as ``\fI?*[]\fR''.
-If a source argument has a
-.I system-name!
-prefix for a remote system,
-the file name expansion will be done on the remote system.
-.LP
-The command
-.IP "" 12
-uucp\ \ *.c\ \ usg!/usr/dan
-.LP
-will set up the transfer of all files whose names end with ``.c''
-to the ``/usr/dan'' directory on the``usg'' machine.
-.LP
-The source and/or destination names may also contain a
-.I ~user
-prefix.
-This translates to the login directory on
-the specified system.
-For names with partial path-names,
-the current directory is prepended to the file name.
-File names with
-.I ../
-are not permitted.
-.LP
-The command
-.IP "" 12
-uucp\ \ usg!~dan/*.h\ \ ~dan
-.LP
-will set up the transfer of files whose names end with ``.h''
-in dan's login
-directory on system ``usg'' to dan's local
-login directory.
-.LP
-For each source file,
-the program will check the source and destination
-file-names
-and the system-part of each to
-classify the work into one of five types:
-.RS
-.IP [1]
-Copy source to destination on local system.
-.IP [2]
-Receive files from other systems.
-.IP [3]
-Send files to a remote systems.
-.IP [4]
-Send files from remote systems
-to another remote system.
-.IP [5]
-Receive files from remote systems when the source
-contains special shell characters as
-mentioned above.
-.RE
-.LP
-After the work has been set up in the spool directory,
-the
-.I uucico
-program is started to try to contact the other
-machine to execute the work (unless the \-r option
-was specified).
-.SH
-Type 1
-.LP
-A
-.I cp
-command is used to do the work.
-The
-.I \-d
-and the
-.I \-m
-options are not honored in this case.
-.SH
-Type 2
-.LP
-A one line
-.I "work file"
-is created for each file requested and put in the spool directory
-with the following fields, each separated by a blank.
-(All
-.I "work files"
-and
-.I "execute files"
-use a blank as the field separator.)
-.RS
-.IP [1]
-R
-.IP [2]
-The full path-name of the source or a ~user/path-name.
-The
-.I ~user
-part will be expanded on the remote system.
-.IP [3]
-The full path-name of the destination file.
-If the
-.I ~user
-notation is used, it will be immediately
-expanded to be the login directory for the user.
-.IP [4]
-The user's login name.
-.IP [5]
-A ``\-'' followed by an option list.
-(Only the \-m and \-d options will appear in this list.)
-.RE
-.KS
-.SH
-Type 3
-.LP
-For each source file, a
-.I "work file"
-is created and the source file is copied into a
-.I "data file"
-in the spool directory.
-(A ``\-c'' option on the
-.I uucp
-command will prevent the
-.I "data file"
-from being made.)
-In this case, the file will be transmitted from
-the indicated source.)
-The fields of each entry are given below.
-.RS
-.IP [1]
-S
-.IP [2]
-The full-path name of the source file.
-.IP [3]
-The full-path name of the destination or
-~user/file-name.
-.IP [4]
-The user's login name.
-.IP [5]
-A ``\-'' followed by an option list.
-.IP [6]
-The name of the
-.I "data file"
-in the spool directory.
-.IP [7]
-The file mode bits of the source file
-in octal print format
-(e.g. 0666).
-.RE
-.KE
-.SH
-Type 4 and Type 5
-.LP
-.I Uucp
-generates a
-.I uucp
-command and sends it to the remote machine;
-the remote
-.I uucico
-executes the
-.I uucp
-command.
-.NH
-Uux - UNIX To UNIX Execution
-.LP
-The
-.I uux
-command is used to set up the execution of a
-.UX
-command
-where the execution machine and/or some of the
-files are remote.
-The syntax of the uux command is
-.IP
-.I uux\ \ 
-.B [
-\-
-.B "] ["
-option
-.B ]
-\ ...\ \ command-string
-.LP
-where the command-string is made up of one or more arguments.
-All special shell characters such as ``<>|^'' must be quoted
-either by quoting the entire command-string
-or quoting the character as a separate argument.
-Within the command-string, the command and file names may
-contain a
-.I system-name!
-prefix.
-All arguments which do not contain a ``!'' will not
-be treated as files.
-(They will not be copied to the execution machine.)
-The ``\-'' is used to indicate that the standard input
-for
-.I command-string
-should be inherited from the standard input
-of the
-.I uux
-command.
-The options, essentially for debugging, are:
-.RS
-.IP \-r 10
-Don't start
-.I uucico
-or
-.I uuxqt
-after queuing the job;
-.IP \-x\fInum\fR
-Num is the level of debugging output desired.
-.RE
-.LP
-The command
-.IP "" 12
-pr\ \ abc\ \ |\ \ uux\ \ \-\ \ usg!lpr
-.LP
-will set up the output of ``pr abc''
-as standard input to an lpr command
-to be executed on system ``usg''.
-.LP
-.I Uux
-generates an
-.I "execute file"
-which contains the
-names of the files required
-for execution (including standard input),
-the user's login name, the destination
-of the standard output, and the command to be executed.
-This file is either put in the spool directory
-for local execution or sent to the remote system using
-a generated send command (type 3 above).
-.LP
-For required files which are not on the execution machine,
-.I uux
-will generate receive command files (type 2 above).
-These command-files will be put on the execution machine and
-executed by the
-.I uucico
-program.
-(This will work only if the local system has permission
-to put files in the remote spool directory as controlled
-by the remote
-.I USERFILE .
-)
-.LP
-The
-.I "execute file"
-will be processed
-by the
-.I uuxqt
-program on the execution machine.
-It is made up of several lines,
-each of which contains an identification character
-and one or more arguments.
-The order of the lines in the file is not relevant
-and some of the lines may not be present.
-Each line is described below.
-.RS
-.SH
-User Line
-.IP
-U\ \ user\ \ system
-.LP
-where the
-.I user
-and
-.I system
-are the requester's login name and system.
-.SH
-Required File Line
-.IP
-F file-name real-name
-.LP
-where the
-.I file-name
-is the generated name of a file for the execute machine
-and
-.I real-name
-is the last part of the actual file name (contains no
-path information).
-Zero or more of these lines may be present in the
-.I "execute file" .
-The
-.I uuxqt
-program will check for the existence of all required
-files before the command is executed.
-.SH
-Standard Input Line
-.IP
-I\ \ file-name
-.LP
-The standard input is either specified by a ``<'' in the
-command-string or inherited from the standard input of the
-.I uux
-command if the ``\-'' option is used.
-If a standard input is not specified,
-``/dev/null'' is used.
-.SH
-Standard Output Line
-.IP
-O\ \ file-name\ \ system-name
-.LP
-The standard output is specified by a ``>'' within the
-command-string.
-If a standard output is not specified,
-``/dev/null'' is used.
-(Note \- the use of ``>>'' is not implemented.)
-.SH
-Command Line
-.IP
-C\ \ command\ \ 
-.B [
-arguments
-.B ]
-\ ...
-.LP
-The arguments are those specified in the command-string.
-The standard input and standard output will not appear on this
-line.
-All
-.I "required files"
-will be moved to the execution directory (a subdirectory
-of the spool directory)
-and the
-.UX
-command is executed using the Shell specified in the
-.I uucp.h
-header file.
-In addition, a shell ``PATH'' statement is prepended
-to the command line as specified in the
-.I uuxqt
-program.
-.LP
-After execution, the standard output is copied or set up to be
-sent to the proper place.
-.RE
-.NH
-Uucico - Copy In, Copy Out
-.LP
-The
-.I uucico
-program will perform the following major functions:
-.RS
-.IP -\ \  3
-Scan the spool directory for work.
-.IP -\ \  
-Place a call to a remote system.
-.IP -\ \ 
-Negotiate a line protocol to be used.
-.IP -\ \ 
-Execute all requests from both systems.
-.IP -\ \ 
-Log work requests and work completions.
-.RE
-.LP
-.I Uucico
-may be started in several ways;
-.RS
-.IP a) 5
-by a system daemon,
-.IP b)
-by one of the
-.I
-uucp, uux, uuxqt
-.R
-or
-.I uucico
-programs,
-.IP c)
-directly by the user (this is usually for testing),
-.IP d)
-by a remote system.
-(The uucico program should be specified as the ``shell''
-field in the ``/etc/passwd'' file for the ``uucp'' logins.)
-.RE
-.LP
-When started by method a, b or c, the program is considered to
-be in
-.I MASTER
-mode.
-In this mode, a connection will be made to a remote system.
-If started by a remote system (method d),
-the program is considered to be in
-.I SLAVE
-mode.
-.LP
-The
-.I MASTER
-mode will operate in one of two ways.
-If no system name is specified
-(\-s option not specified)
-the program will scan the spool directory for
-systems to call.
-If a system name is specified, that system will be called,
-and work will only be done for that system.
-.LP
-The
-.I uucico
-program is generally started by another program.
-There are several options used for execution:
-.RS
-.IP \-r1 10
-Start the program in
-.I MASTER
-mode.
-This is used when
-.I uucico
-is started by a program or ``cron'' shell.
-.IP \-s\fIsys\fR
-Do work only for system
-.I sys.
-If
-.I \-s
-is specified,
-a call to the specified system
-will be made even if there is no work for system
-.I sys
-in the spool directory.
-This is useful for polling systems which do not have
-the hardware to initiate a connection.
-.LP
-The following options are used primarily for debugging:
-.IP \-d\fIdir\fR
-Use directory
-.I dir
-for the spool directory.
-.IP \-x\fInum\fR
-.I Num
-is the level of debugging output desired.
-.RE
-.LP
-The next part of this section will describe the major steps within
-the
-.I uucico
-program.
-.SH
-Scan For Work
-.LP
-The names of the work related files in the spool directory have format
-.IP
-type . system-name grade number
-.LP
-where:
-.IP
-.I Type
-is an upper case letter,
-(
-.I C
--\ copy command file,
-.I D
--\ data file,
-.I X
--\ execute file);
-.IP
-.I System-name
-is the remote system;
-.IP
-.I Grade
-is a character;
-.IP
-.I Number
-is a four digit, padded sequence number.
-.LP
-The file
-.IP "" 12
-C.res45n0031
-.LP
-would be a
-.I "work file"
-for a file transfer between the local
-machine and the ``res45'' machine.
-.LP
-The scan for work is done by looking through the
-spool directory for
-.I "work files"
-(files with prefix ``C.'').
-A list is made of all systems to be called.
-.I Uucico
-will then call each system and process all
-.I "work files" .
-.SH
-Call Remote System
-.LP
-The call is made using information from several
-files which reside in the uucp program directory.
-At the start of the call process, a lock is
-set to forbid multiple conversations 
-between the same two systems.
-.LP
-The system name is found in the
-.I L.sys
-file.
-The information contained for each system is;
-.RS
-.IP [1]
-system name,
-.IP [2]
-times to call the system
-(days-of-week and times-of-day),
-.IP [3]
-device or device type to be used for call,
-.IP [4]
-line speed,
-.IP [5]
-phone number if field [3] is
-.I ACU
-or the device name (same as field [3])
-if not
-.I ACU,
-.IP [6]
-login information (multiple fields),
-.RE
-.LP
-The time field is checked against the present time to see
-if the call should be made.
-.LP
-The
-.I
-phone number
-.R
-may contain abbreviations (e.g. mh, py, boston) which get translated into dial
-sequences using the
-.I L-dialcodes
-file.
-.LP
-The
-.I L-devices
-file is scanned using fields [3] and [4] from the
-.I L.sys
-file to find an available device for the call.
-The program will try all devices which satisfy
-[3] and [4] until the call is made, or no more
-devices can be tried.
-If a device is successfully opened, a lock file
-is created so that another copy of
-.I uucico
-will not try to use it.
-If the call is complete, the
-.I
-login information
-.R
-(field [6] of
-.I L.sys )
-is used to login.
-.LP
-The conversation between the two
-.I uucico
-programs begins with a handshake started by the called,
-.I SLAVE ,
-system.
-The
-.I SLAVE
-sends a message to let the
-.I MASTER
-know it is ready to receive the system
-identification and conversation sequence number.
-The response from the
-.I MASTER
-is
-verified by the
-.I SLAVE
-and if acceptable, protocol selection begins.
-The
-.I SLAVE
-can also reply with a ``call-back required''
-message in which case, the current conversation
-is terminated.
-.SH
-Line Protocol Selection
-.LP
-The remote system sends a message
-.IP "" 12
-P\fIproto-list\fR
-.LP
-where proto-list is a string of characters, each
-representing a line protocol.
-.LP
-The calling program checks the proto-list
-for a letter corresponding to an available line
-protocol and returns a
-.I use-protocol
-message.
-The
-.I use-protocol
-message is
-.IP "" 12
-U\fIcode\fR
-.LP
-where code is either a one character
-protocol letter or
-.I N
-which means there is no common protocol.
-.SH
-Work Processing
-.LP
-The initial roles (
-.I MASTER
-or
-.I SLAVE
-) for the work processing are
-the mode in which each program starts.
-(The 
-.I MASTER
-has been specified by the ``\-r1'' uucico option.)
-The
-.I MASTER
-program does a work search similar to the
-one used in the ``Scan For Work'' section.
-.LP
-There are five messages used during the
-work processing, each specified by the first
-character of the message.
-They are;
-.IP "" 12
-.RS
-.IP S 3
-send a file,
-.IP R
-receive a file,
-.IP C
-copy complete,
-.IP X
-execute a
-.I uucp
-command,
-.IP H
-hangup.
-.RE
-.LP
-The
-.I MASTER
-will send
-.I R ,
-.I S
-or
-.I X
-messages until all work from the spool directory is
-complete, at which point an
-.I H
-message will be sent.
-The
-.I SLAVE
-will reply with
-\fISY\fR, \fISN\fR, \fIRY\fR, \fIRN\fR, \fIHY\fR, \fIHN\fR,
-\fIXY\fR, \fIXN\fr,
-corresponding to
-.I yes
-or
-.I no
-for each request.
-.LP
-The send and receive replies are
-based on permission to access the
-requested file/directory using the
-.I USERFILE
-and read/write permissions of the file/directory.
-After each file is copied into the spool directory
-of the receiving system,
-a copy-complete message is sent by the receiver of the file.
-The message
-.I CY
-will be sent if the
-file has successfully been moved from the
-temporary spool file to the actual destination.
-Otherwise, a
-.I CN
-message is sent.
-(In the case of
-.I CN ,
-the transferred file will be in the spool
-directory with a name beginning with ``TM'.)
-The requests and results are logged on both systems.
-.LP
-The hangup response is determined by the
-.I SLAVE
-program by a work scan of the spool directory.
-If work for the remote system exists in the
-.I SLAVE's
-spool directory, an
-.I HN
-message is sent and the programs switch roles.
-If no work exists, an
-.I HY
-response is sent.
-.SH
-Conversation Termination
-.LP
-When a
-.I HY
-message is received by the
-.I MASTER
-it is echoed back to the
-.I SLAVE
-and the protocols are turned off.
-Each program sends a final ``OO'' message to the
-other.
-The original
-.I SLAVE
-program will clean up and terminate.
-The
-.I MASTER
-will proceed to call other systems
-and process work as long as possible
-or terminate if a
-.I \-s
-option was specified.
-.LP
-.NH
-Uuxqt - Uucp Command Execution
-.LP
-The
-.I uuxqt
-program is used to execute
-.I
-execute files
-.R
-generated by
-.I uux.
-The
-.I uuxqt
-program may be started by either the
-.I uucico
-or
-.I uux
-programs.
-The program scans the spool directory for
-.I
-execute files
-.R
-(prefix ``X.'').
-Each one is checked to see if all the required files are available and
-if so, the command line or send line is executed.
-.LP
-The
-.I
-execute file
-.R
-is described in the ``Uux''
-section above.
-.SH
-Command Execution
-.LP
-The execution is accomplished by executing a
-.I
-sh \-c
-.R
-of the command line after appropriate
-standard input and standard output have been opened.
-If a standard output is specified, the program
-will create a send command or copy the output
-file as appropriate.
-.NH
-Uulog - Uucp Log Inquiry
-.LP
-The
-.I uucp
-programs create individual
-log files for each program invocation.
-Periodically,
-.I uulog
-may be executed to prepend these files to the
-system logfile.
-This method of logging was chosen to minimize file
-locking of the logfile during program execution.
-.LP
-The
-.I uulog
-program merges the individual
-log files and outputs specified log entries.
-The output request is specified by the use of the
-following options:
-.RS
-.IP \-s\fIsys\fR 9
-Print entries where
-.I sys
-is the remote system name;
-.IP \-u\fIuser\fR
-Print entries for user
-.I user.
-.RE
-.LP
-The intersection of lines satisfying the two options is output.
-A null
-.I sys
-or
-.I user
-means all system names or users respectively.
-.NH
-Uuclean - Uucp Spool Directory Cleanup
-.LP
-This program is typically started by the daemon, once a day.
-Its function is to remove files from the spool directory which
-are more than 3 days old.
-These are usually files for work which can not be completed.
-.LP
-.LP
-The options available are:
-.RS
-.IP \-d\fIdir\fR 10
-The directory to be scanned is
-.I dir .
-.IP \-m
-Send mail to the owner of each file being removed.
-(Note that most files put into the spool directory
-will be owned by the owner of the
-uucp programs since the setuid bit will be set on these
-programs.
-The mail will therefore most often go to the owner
-of the uucp programs.)
-.IP \-n\fIhours\fR
-Change the aging time from 72 hours to
-.I hours
-hours.
-.IP \-p\fIpre\fR
-Examine files with prefix
-.I pre
-for deletion.
-(Up to 10 file prefixes may be specified.)
-.IP \-x\fInum\fR
-This is the level of debugging output desired.
-.RE
-.NH
-Security
-.LP
-.LG
-\fB
-The uucp system, left unrestricted,
-will let any outside user execute any commands
-and copy in/out any file which is readable/writable
-by the uucp login user.
-It is up to the individual sites to be aware of this and
-apply the protections that they feel are necessary.
-\fR
-.NL
-.LP
-There are several security features available aside from the
-normal file mode protections.
-These must be set up by the installer of the
-.I uucp
-system.
-.IP - 3
-The login for uucp does not get a standard shell.
-Instead, the
-.I uucico
-program is started.
-Therefore, the only work that can be done is through
-.I uucico .
-.IP -
-A path check is done on file names that are to be sent
-or received.
-The
-.I USERFILE
-supplies the information for these checks.
-The
-.I USERFILE
-can also be set up to require call-back
-for certain login-ids.
-(See the ``Files required for execution'' section
-for the file description.)
-.IP -
-A conversation sequence count can be set up so
-that the called system
-can be more confident that the caller
-is who he says he is.
-.IP -
-The
-.I uuxqt
-program comes with a list of commands that it
-will execute.
-A ``PATH'' shell statement is prepended to the command
-line as specifed in the
-.I uuxqt
-program.
-The installer may modify the list or remove the
-restrictions as desired.
-.IP -
-The
-.I L.sys
-file should be owned by uucp and have mode 0400
-to protect the phone numbers and login information
-for remote sites.
-(Programs uucp, uucico, uux, uuxqt should be also
-owned by uucp and have the setuid bit set.)
-.NH
-Uucp Installation
-.LP
-There are several source modifications that may be required
-before the system programs are compiled.
-These relate to the directories used during compilation,
-the directories used during execution,
-and the local
-.I
-uucp system-name.
-.R
-.LP
-The four directories are:
-.RS
-.IP lib 12
-(/usr/src/cmd/uucp)
-This directory contains the source files for generating the
-.I uucp
-system.
-.IP program
-(/usr/lib/uucp)
-This is the directory used for the executable system programs and
-the system files.
-.IP spool
-(/usr/spool/uucp)
-This is the spool directory used during
-.I uucp
-execution.
-.IP xqtdir
-(/usr/spool/uucp/.XQTDIR)
-This directory is used during execution of
-.I "execute files" .
-.RE
-.LP
-The names given in parentheses above are the default values
-for the directories.
-The italicized named
-.I
-lib, program, xqtdir,
-.R
-and
-.I spool
-will be used in the following text to represent the
-appropriate directory names.
-.LP
-There are two files which may require modification,
-the
-.I makefile
-file and the
-.I uucp.h
-file.
-The following paragraphs describe the modifications.
-The modes of
-.I spool
-and
-.I xqtdir
-should be made ``0777''.
-.SH
-Uucp.h modification
-.LP
-Change the
-.I program
-and the
-.I spool
-names from the default values to the directory
-names to be used on the local system using
-global edit commands.
-.LP
-Change the
-.I define
-value for
-.I MYNAME
-to be the local
-.I uucp
-system-name.
-.SH
-makefile modification
-.LP
-There are several
-.I make
-variable definitions which may need modification.
-.RS
-.IP INSDIR 10
-This is the
-.I program
-directory
-(e.g. INSDIR=/usr/lib/uucp).
-This parameter is used if ``make cp'' is
-used after the programs are compiled.
-.IP IOCTL
-This is required to be set if an appropriate
-.I ioctl
-interface subroutine does not exist in the standard
-``C'' library;
-the statement
-``IOCTL=ioctl.o'' is required in this case.
-.IP PKON
-The statement ``PKON=pkon.o'' is required if the
-packet driver is not in the kernel.
-.RE
-.SH
-Compile the system
-The command
-.IP "" 12
-make
-.LP
-will compile the entire system.
-The command
-.IP "" 12
-make cp
-.LP
-will copy the commands to the
-to the appropriate directories.
-.LP
-The programs
-.I uucp ,
-.I uux ,
-and
-.I uulog
-should be put in ``/usr/bin''.
-The programs
-.I uuxqt ,
-.I uucico ,
-and
-.I uuclean
-should be put in the
-.I program
-directory.
-.SH
-Files required for execution
-.LP
-There are four files which are required for execution,
-all of which should reside in the
-.I program
-directory.
-The field separator for all files is a space unless otherwise
-specified.
-.SH
-L-devices
-.LP
-This file contains entries for the call-unit devices and
-hardwired connections which are to be used by
-.I uucp.
-The special device files are assumed to be in the
-.I /dev
-directory.
-The format for each entry is
-.IP "" 12
-line\ \ call-unit\ \ speed
-.LP
-where;
-.RS
-.IP line 12
-is the device for the line (e.g. cul0),
-.IP call-unit
-is the automatic call unit associated with
-.I line
-(e.g. cua0),
-(Hardwired lines have a number ``0'' in this field.),
-.IP speed
-is the line speed.
-.RE
-.LP
-The line
-.IP "" 12
-cul0\ \ cua0\ \ 300
-.LP
-would be set up for a system which
-had device cul0 wired to a call-unit
-cua0 for use at 300 baud.
-.SH
-L-dialcodes
-.LP
-This file contains entries with location abbreviations used
-in the
-.I L.sys
-file (e.g. py, mh, boston).
-The entry format is
-.IP "" 12
-abb\ \ dial-seq
-.LP
-where;
-.RS
-.IP abb 12
-is the abbreviation,
-.IP dial-seq
-is the dial sequence to call that location.
-.RE
-.LP
-The line
-.IP "" 12
-py\ \ 165\-
-.LP
-would be set up so that entry py7777 would
-send 165\-7777 to the dial-unit.
-.SH
-LOGIN/SYSTEM NAMES
-.LP
-It is assumed that the
-.I "login name"
-used by a remote computer to call into a local computer
-is not the same as the login name of a normal user
-of that local machine.
-However, several remote computers may employ the same
-login name.
-.LP
-Each computer is given a unique
-.I "system name"
-which is transmitted at the start of each call.
-This name identifies the calling machine to the called machine.
-.SH
-USERFILE
-.LP
-This file contains user accessibility information.
-It specifies four types of constraint;
-.RS
-.IP [1]
-which files can be accessed by a normal user of the local machine,
-.IP [2]
-which files can be accessed from a remote computer,
-.IP [3]
-which login name is used by a particular remote computer,
-.IP [4]
-whether a remote computer should be called back in order to confirm
-its identity.
-.RE
-.LP
-Each line in the file has the following format
-.IP "" 6
-login,sys\ \ 
-.B [
-c
-.B ]
-\ \ path-name\ \ 
-.B [
-path-name
-.B ]
-\ ...
-.LP
-where;
-.RS
-.IP login 12
-is the login name for a user or the remote computer,
-.IP  sys
-is the system name for a remote computer,
-.IP c
-is the optional
-.I
-call-back required
-.R
-flag,
-.IP path-name
-is a path-name prefix that is acceptable for
-.I user.
-.LP
-.RE
-.LP
-The constraints are implemented as follows.
-.RS
-.IP [1]
-When the program is obeying a command stored on the local machine,
-.I MASTER
-mode,
-the path-names allowed are those given for the first line in the
-.I USERFILE
-that has a login name that matches the login name of the user
-who entered the command.
-If no such line is found, the first line with a
-.I null
-login name is used.
-.IP [2]
-When the program is responding to a command from a remote machine,
-.I SLAVE
-mode, the path-names allowed are those given for the first line
-in the file that has the system name that matches the system name
-of the remote machine.
-If no such line is found, the first one with a
-.I null
-system name is used.
-.IP [3]
-When a remote computer logs in, the login name that
-it uses must appear in the
-.I USERFILE .
-There may be several lines with the same login name but one of them must
-either have the name of the remote system or must contain a
-.I null
-system name.
-.IP [4]
-If the line matched in ([3]) contains a ``c'',
-the remote machine is called back before any transactions take place.
-.RE
-.LP
-The line
-.IP "" 12
-u,m  /usr/xyz
-.LP
-allows machine
-.I m
-to login with name
-.I u
-and request the transfer of files whose names start with
-``/usr/xyz''.
-.LP
-The line
-.IP "" 12
-dan,  /usr/dan
-.LP
-allows the ordinary user
-.I dan
-to issue commands for files whose name starts with
-``/usr/dan''.
-.LP
-The lines
-.IP "" 12
-u,m /usr/xyz  /usr/spool
-.br
-u,  /usr/spool
-.LP
-allows any remote machine to login with name
-.I u ,
-but if its system name is not
-.I m ,
-it can only ask to transfer files whose names start with
-``/usr/spool''.
-.LP
-The lines
-.IP "" 12
-root,  /
-.br
-,   /usr
-.LP
-allows any user to transfer files beginning with ``/usr''
-but the user with login
-.I root
-can transfer any file.
-.SH
-L.sys
-.LP
-Each entry in this file represents one system
-which can be called by the local uucp programs.
-The fields are described below.
-.RS
-.SH
-system name
-.LP
-The name of the remote system.
-.SH
-time
-.LP
-This is a string which indicates the days-of-week
-and times-of-day when the system should
-be called
-(e.g. MoTuTh0800\-1730).
-.LP
-The day portion may be a list containing
-some of
-.IP
-.I
-Su Mo Tu We Th Fr Sa
-.R
-.LP
-or it may be
-.I Wk
-for any week-day or
-.I Any
-for any day.
-.LP
-The time should be a range of times (e.g. 0800\-1230).
-If no time portion is specified, any time
-of day is assumed to be ok for the call.
-.SH
-device
-.LP
-This is either
-.I ACU
-or the hardwired device to be used for the call.
-For the hardwired case, the last part of the
-special file name is used (e.g. tty0).
-.SH
-speed
-.LP
-This is the line speed for the call (e.g. 300).
-.SH
-phone
-.LP
-The phone number is made up of an optional
-alphabetic abbreviation and a numeric part.
-The abbreviation is one which appears in the
-.I L-dialcodes
-file (e.g. mh5900, boston995\-9980).
-.LP
-For the hardwired devices, this field contains
-the same string as used for the
-.I device
-field.
-.SH
-login
-.LP
-The login information is given as a series of
-fields and subfields in the format
-.IP
-expect\ \ send\ 
-.B [
-expect\ \ send
-.B ]
-\ ...
-.LP
-where;
-.I expect
-is the string expected to be read and
-.I send
-is the string to be sent when the
-.I expect
-string is received.
-.LP
-The expect field may be made up of subfields
-of the form
-.IP
-expect\fB[\fR\-send\-expect\fB]\fR...
-.LP
-where the
-.I send
-is sent if the prior
-.I expect
-is not successfully read
-and the
-.I expect
-following the
-.I send
-is the next expected string.
-.LP
-There are two special names available to be sent
-during the login sequence.
-The string
-.I EOT
-will send an EOT character and the string
-.I BREAK
-will try to send a BREAK character.
-(The
-.I BREAK
-character is simulated using line speed changes
-and null characters and may not work on all
-devices and/or systems.)
-.RE
-.LP
-A typical entry in the L.sys file would be
-.IP "" 6
-sys Any ACU 300  mh7654 login uucp ssword: word
-.LP
-The expect algorithm looks at the last part of the
-string as illustrated in the password field.
-.RE
-.NH
-Administration
-.LP
-This section indicates some events and files which must be
-administered for the
-.I uucp
-system.
-Some administration can be accomplished by 
-.I "shell files"
-which can be initiated by
-.I crontab
-entries.
-Others will require manual intervention.
-Some sample 
-.I "shell files"
-are given toward the end of this section.
-.SH
-SQFILE \- sequence check file
-.LP
-This file is set up in the
-.I program
-directory and contains an entry for each remote
-system with which you agree to perform conversation
-sequence checks.
-The initial entry is just the system name of
-the remote system.
-The first conversation will add two items to the line,
-the conversation count, and the date/time of the most
-resent conversation.
-These items will be updated with each conversation.
-If a sequence check fails, the entry will have to
-be adjusted.
-.SH
-TM \- temporary data files
-.LP
-These files are created in the
-.I spool
-directory while files are being copied
-from a remote machine.
-Their names have the form
-.IP "" 12
-\fBTM\fR.pid.ddd
-.LP
-where
-.I pid
-is a process-id and
-.I ddd
-is a sequential three digit number starting at zero
-for each invocation of
-.I uucico
-and incremented for each file received.
-
-After the entire remote file is received, the
-.I TM
-file is moved/copied to the requested destination.
-If processing is abnormally terminated or the
-move/copy fails, the file will remain in the
-spool directory.
-.LP
-The leftover files should be periodically removed;
-the
-.I uuclean
-program is useful in this regard.
-The command
-.IP "" 12
-uuclean\ \ \-pTM
-.LP
-will remove all
-.I TM
-files older than three days.
-.SH
-LOG \- log entry files
-.LP
-During execution of programs, individual
-.I LOG
-files are created in the
-.I spool
-directory with information about
-queued requests, calls to remote systems,
-execution of
-.I uux
-commands and file copy results.
-These files should be combined into the
-.I LOGFILE
-by using the
-.I uulog
-program.
-This program will put the new
-.I LOG
-files at the beginning of the existing
-.I LOGFILE.
-The command
-.IP "" 12
-uulog
-.LP
-will accomplish the merge.
-Options are available to print some or all the
-log entries after the files are merged.
-The
-.I LOGFILE
-should be removed periodically
-since it is copied each time new LOG
-entries are put into the file.
-.LP
-The
-.I LOG
-files are created initially with mode 0222.
-If the program which creates the file terminates normally,
-it changes the
-mode to 0666.
-Aborted runs may leave the files with mode
-0222 and the
-.I uulog
-program will not read or remove them.
-To remove them, either use
-.I rm ,
-.I uuclean ,
-or change the mode to 0666 and let
-.I uulog
-merge them with the
-.I LOGFILE .
-.SH
-STST \- system status files
-.LP
-These files are created in the spool directory by the
-.I uucico
-program.
-They contain information of failures such as login, dialup or
-sequence check and will contain a
-.I TALKING
-status when to machines are conversing.
-The form of the file name is
-.IP
-\fBSTST\fR.sys
-.LP
-where
-.I sys
-is the remote system name.
-.LP
-For ordinary failures (dialup, login), the file will prevent
-repeated tries for about one hour.
-For sequence check failures, the file must be removed before
-any future attempts to converse with that remote system.
-.LP
-If the file is left due to an aborted run, it may contain a
-.I TALKING
-status.
-In this case, the file must be removed before a conversation
-is attempted.
-.SH
-LCK \- lock files
-.LP
-Lock files are created for each device in use (e.g. automatic calling
-unit) and each system conversing.
-This prevents duplicate conversations and multiple attempts to use the
-same devices.
-The form of the lock file name is
-.IP "" 12
-\fBLCK..\fRstr
-.LP
-where
-.I str
-is either a device or system name.
-The files may be left in the spool directory if runs abort.
-They will be ignored (reused) after a time of about 24 hours.
-When runs abort and calls are desired before the time limit,
-the lock files should be removed.
-.SH
-Shell Files
-.LP
-The
-.I uucp
-program will spool work and attempt to start the
-.I uucico
-program, but the starting of
-.I uucico
-will sometimes fail.
-(No devices available, login failures etc.).
-Therefore, the
-.I uucico
-program should be periodically started.
-The command to start
-.I uucico
-can be put in a ``shell'' file with a command to merge
-.I LOG
-files and started by a crontab entry on an hourly basis.
-The file could contain the commands
-.IP
-.I program /uulog
-.br
-.I program /uucico
-\ \ \-r1
-.LP
-Note that the ``\-r1'' option is required to start the
-.I uucico
-program in
-.I MASTER
-mode.
-.LP
-Another shell file may be set up on a daily basis to remove
-.I TM ,
-.I ST
-and
-.I LCK
-files
-and
-.I C.
-or
-.I D.
-files for work which can not be accomplished for
-reasons like bad phone number, login changes etc.
-A shell file containing commands like
-.IP
-.I program /uuclean
-\ \ \-pTM \-pC. \-pD.
-.br
-.I program /uuclean
-\ \ \-pST \-pLCK \-n12
-.LP
-can be used.
-Note the ``\-n12'' option causes the
-.I ST
-and
-.I LCK
-files older than 12 hours to be deleted.
-The absence of the ``\-n'' option will use a three day time
-limit.
-.LP
-A daily or weekly shell should also be created
-to remove or save old
-.I LOGFILE s.
-A shell like
-.IP
-cp
-.I spool /LOGFILE
-\ \ 
-.I spool /o.LOGFILE
-.br
-rm
-.I spool /LOGFILE
-.LP
-can be used.
-.SH
-Login Entry
-.LP
-One or more logins should be set up for
-.I uucp .
-Each of the ``/etc/passwd'' entries should
-have the
-``\fIprogram\fR/uucico''
-as the shell to be executed.
-The login directory is not used, but if the system
-has a special directory for use by the users for
-sending or receiving file, it should as the
-login entry.
-The various logins are used in conjunction with the
-.I USERFILE
-to restrict file access.
-Specifying the
-.I shell
-argument limits the login to the use of uucp
-(
-.I uucico )
-only.
-.SH
-File Modes
-.LP
-It is suggested that the owner and file modes of various
-programs and files be set as follows.
-.LP
-The programs
-.I uucp ,
-.I uux ,
-.I uucico
-and
-.I uuxqt
-should be owned by the
-.I uucp
-login with the ``setuid'' bit set and only execute
-permissions (e.g. mode 04111).
-This will prevent outsiders from modifying the programs
-to get at a standard
-.I shell
-for the
-.I uucp
-logins.
-.LP
-The
-.I L.sys ,
-.I SQFILE
-and the
-.I USERFILE
-which are put in the
-.I program
-directory should be owned by
-the
-.I uucp
-login and set with mode 0400.
-.SG MH-1273-DAN-unix
diff --git a/.ref-Research-V7/usr/doc/uucp/network b/.ref-Research-V7/usr/doc/uucp/network
deleted file mode 100644 (file)
index e2a923a..0000000
+++ /dev/null
@@ -1,728 +0,0 @@
-.RP
-.if n .ls 2
-.ds RH Nowitz
-.ND "August 18, 1978"
-.TL
-A Dial-Up Network of
-UNIX\s6\uTM\d\s0
-Systems
-.AU
-D. A. Nowitz
-.AU
-M. E. Lesk
-.AI
-.MH
-.AB
-.if n .ls 2
-A network of over eighty
-.UX
-computer systems has been established using the
-telephone system as its primary communication medium.
-The network was designed to meet the growing demands for
-software distribution and exchange.
-Some advantages of our design are:
-.IP -
-The startup cost is low.
-A system needs only a dial-up port,
-but systems with automatic calling units have much more
-flexibility.
-.IP -
-No operating system changes are required to install or use the system.
-.IP -
-The communication is basically over dial-up lines,
-however, hardwired communication lines can be used
-to increase speed.
-.IP -
-The command for sending/receiving files is simple to use.
-.sp
-Keywords: networks, communications, software distribution, software maintenance
-.AE
-.NH 
-Purpose
-.PP
-The widespread use of the
-.UX
-system
-.[
-ritchie thompson bstj 1978
-.]
-within Bell Laboratories
-has produced problems of software distribution and maintenance.
-A conventional mechanism was set up to distribute the operating
-system and associated programs from a central site to the
-various users.
-However this mechanism alone does not meet all software
-distribution needs.
-Remote sites generate much software and must transmit it to
-other sites.
-Some
-.UX
-systems
-are themselves central sites for redistribution
-of a particular specialized utility,
-such as the Switching Control Center System.
-Other sites have particular, often long-distance needs for
-software exchange; switching research,
-for example, is carried on in
-New Jersey, Illinois, Ohio, and Colorado.
-In addition, general purpose utility programs are written at
-all
-.UX
-system sites.
-The
-.UX
-system is modified
-and enhanced by many people in many places and
-it would be very constricting to deliver new software in a one-way
-stream without any alternative
-for the user sites to respond with changes of their own.
-.PP
-Straightforward software distribution is only part of the problem.
-A large project may exceed the capacity of a single computer and
-several machines may be used by the one group of people.
-It then becomes necessary
-for them to pass messages, data and other information back an forth
-between computers.
-.PP
-Several groups with similar problems, both inside and outside of
-Bell Laboratories, have constructed networks built of
-hardwired connections only.
-.[
-dolotta mashey 1978 bstj
-.]
-.[
-network unix system chesson
-.]
-Our network, however, uses both dial-up and hardwired
-connections so that service can be provided to as many sites as possible.
-.NH
-Design Goals
-.PP
-Although some of our machines are connected directly, others
-can only communicate over low-speed dial-up lines.
-Since the dial-up lines are often unavailable
-and file transfers may take considerable time,
-we spool all work and transmit in the background.
-We also had to adapt to a community of systems which are independently
-operated and resistant to suggestions that they should all
-buy particular hardware or install particular operating system
-modifications.
-Therefore, we make minimal demands on the local sites
-in the network.
-Our implementation requires no operating system changes;
-in fact, the transfer programs look like any other user
-entering the system through the normal dial-up login ports,
-and obeying all local protection rules.
-.PP
-We distinguish ``active'' and ``passive'' systems
-on the network.
-Active systems have an automatic calling unit
-or a hardwired line to another system,
-and can initiate a connection.
-Passive systems do not have the hardware
-to initiate a connection.
-However, an
-active system can be assigned the job of calling passive
-systems and executing work found there;
-this makes a passive system the functional equivalent of
-an active system, except for an additional delay while it waits to be polled.
-Also, people frequently log into active systems and
-request copying from one passive system to another.
-This requires two telephone calls, but even so, it is faster
-than mailing tapes.
-.PP
-Where convenient, we use hardwired communication lines.
-These permit much faster transmission and multiplexing
-of
-the communications link.
-Dial-up connections are made at either 300 or 1200 baud;
-hardwired connections are asynchronous up to 9600 baud 
-and might run even faster on special-purpose communications
-hardware.
-.[
-fraser spider 1974 ieee
-.]
-.[
-fraser channel network datamation 1975
-.]
-Thus, systems typically join our network first as
-passive systems and when
-they find the service more important, they acquire
-automatic calling units and become active
-systems; eventually, they may install high-speed
-links to particular machines with which they
-handle a great deal of traffic.
-At no point, however, must users change their
-programs or procedures.
-.PP
-The basic operation of the network is very simple.
-Each participating system has a spool directory,
-in which work to be done (files to be moved, or commands to be executed
-remotely) is stored.
-A standard program,
-.I uucico ,
-performs all transfers.
-This program starts by identifying a particular communication channel
-to a remote system with which it will hold a conversation.
-.I Uucico
-then selects a device and establishes the connection,
-logs onto the remote machine
-and starts the
-.I uucico
-program on the remote machine.
-Once two of these programs are connected, they first agree on a line protocol,
-and then start exchanging work.
-Each program in turn, beginning with the calling (active system) program,
-transmits everything it needs, and then asks the other what it wants done.
-Eventually neither has any more work, and both exit.
-.PP
-In this way, all services are available from all sites; passive sites,
-however, must wait until called.
-A variety of protocols may be used; this conforms to the real,
-non-standard world.
-As long as the caller and called programs have a protocol in common,
-they can communicate.
-Furthermore, each caller knows the hours when each destination system
-should be called.
-If a destination is unavailable, the data intended for it
-remain in the spool directory until the destination machine can be reached.
-.PP
-The implementation of this
-Bell Laboratories network
-between independent sites, all of which
-store proprietary programs and data,
-illustratives the pervasive need for security
-and administrative controls over file access.
-Each site, in configuring its programs and system files,
-limits and monitors transmission.
-In order to access a file a user needs access permission
-for the machine that contains the file and access permission
-for the file itself.
-This is achieved by first requiring the user to use his password
-to log into his local machine and then his local
-machine logs into the remote machine whose files are to be accessed.
-In addition, records are kept identifying all files
-that are moved into and out of the local system,
-and how the requestor of such accesses identified
-himself.
-Some sites may arrange
-to permit users only
-to call up
-and request work to be done;
-the calling users are then called back
-before the work is actually done.
-It is then possible to verify
-that the request is legitimate from the standpoint of the
-target system, as well as the originating system.
-Furthermore, because of the call-back,
-no site can masquerade as another
-even if it knows all the necessary passwords.
-.PP
-Each machine can optionally maintain a sequence count for
-conversations with other machines and require a verification of the
-count at the start of each conversation.
-Thus, even if call back is not in use, a successful masquerade requires
-the calling party to present the correct sequence number.
-A would-be impersonator must not just steal the correct phone number,
-user name, and password, but also the sequence count, and must call in
-sufficiently promptly to precede the next legitimate request from either side.
-Even a successful masquerade will be detected on the next correct
-conversation.
-.NH
-Processing
-.PP
-The user has two commands which set up communications,
-.I uucp
-to set up file copying,
-and
-.I uux
-to set up command execution where some of the required
-resources (system and/or files)
-are not on the local machine.
-Each of these commands will put work and data files
-into the spool directory for execution by
-.I uucp
-daemons.
-Figure 1 shows the major blocks of the file transfer process.
-.SH
-File Copy
-.PP
-The
-.I uucico
-program is used to perform all communications between
-the two systems.
-It performs the following functions:
-.RS
-.IP - 3
-Scan the spool directory for work.
-.IP -
-Place a call to a remote system.
-.IP -\ \ 
-Negotiate a line protocol to be used.
-.IP -\ \ 
-Start program
-.I uucico
-on the remote system.
-.IP -\ \ 
-Execute all requests from both systems.
-.IP -\ \ 
-Log work requests and work completions.
-.RE
-.LP
-.I Uucico
-may be started in several ways;
-.RS
-.IP a) 5
-by a system daemon,
-.IP b)
-by one of the
-.I uucp
-or
-.I uux
-programs,
-.IP c)
-by a remote system.
-.RE
-.SH
-Scan For Work
-.PP
-The file names in the spool directory are constructed to allow the
-daemon programs
-.I "(uucico, uuxqt)"
-to determine the files they should look at,
-the remote machines they should call
-and the order in which the files for a particular
-remote machine should be processed.
-.SH
-Call Remote System
-.PP
-The call is made using information from several
-files which reside in the uucp program directory.
-At the start of the call process, a lock is
-set on the system being called so that another
-call will not be attempted at the same time.
-.PP
-The system name is found in a
-``systems''
-file.
-The information contained for each system is:
-.IP
-.RS
-.IP [1]
-system name,
-.IP [2]
-times to call the system
-(days-of-week and times-of-day),
-.IP [3]
-device or device type to be used for call,
-.IP [4]
-line speed,
-.IP [5]
-phone number,
-.IP [6]
-login information (multiple fields).
-.RE
-.PP
-The time field is checked against the present time to see
-if the call should be made.
-The
-.I
-phone number
-.R
-may contain abbreviations (e.g. ``nyc'', ``boston'') which get translated into dial
-sequences using a
-``dial-codes'' file.
-This permits the same ``phone number'' to be stored at every site, despite
-local variations in telephone services and dialing conventions.
-.PP
-A ``devices''
-file is scanned using fields [3] and [4] from the
-``systems''
-file to find an available device for the connection.
-The program will try all devices which satisfy
-[3] and [4] until a connection is made, or no more
-devices can be tried.
-If a non-multiplexable device is successfully opened, a lock file
-is created so that another copy of
-.I uucico
-will not try to use it.
-If the connection is complete, the
-.I
-login information
-.R
-is used to log into the remote system.
-Then
-a command is sent to the remote system
-to start the
-.I uucico
-program.
-The conversation between the two
-.I uucico
-programs begins with a handshake started by the called,
-.I SLAVE ,
-system.
-The
-.I SLAVE
-sends a message to let the
-.I MASTER
-know it is ready to receive the system
-identification and conversation sequence number.
-The response from the
-.I MASTER
-is
-verified by the
-.I SLAVE
-and if acceptable, protocol selection begins.
-.SH
-Line Protocol Selection
-.PP
-The remote system sends a message
-.IP "" 12
-P\fIproto-list\fR
-.LP
-where
-.I proto-list
-is a string of characters, each
-representing a line protocol.
-The calling program checks the proto-list
-for a letter corresponding to an available line
-protocol and returns a
-.I use-protocol
-message.
-The
-.I use-protocol
-message is
-.IP "" 12
-U\fIcode\fR
-.LP
-where code is either a one character
-protocol letter or a
-.I N
-which means there is no common protocol.
-.PP
-Greg Chesson designed and implemented the standard
-line protocol used by the uucp transmission program.
-Other protocols may be added by individual installations.
-.SH
-Work Processing
-.PP
-During processing, one program is the
-.I MASTER
-and the other is
-.I SLAVE .
-Initially, the calling program is the
-.I MASTER.
-These roles may switch one or more times during
-the conversation.
-.PP
-There are four messages used during the
-work processing, each specified by the first
-character of the message.
-They are
-.KS
-.TS
-center;
-c l.
-S      send a file,
-R      receive a file,
-C      copy complete,
-H      hangup.
-.TE
-.KE
-.LP
-The
-.I MASTER
-will send
-.I R
-or
-.I S
-messages until all work from the spool directory is
-complete, at which point an
-.I H
-message will be sent.
-The
-.I SLAVE
-will reply with
-\fISY\fR, \fISN\fR, \fIRY\fR, \fIRN\fR, \fIHY\fR, \fIHN\fR,
-corresponding to
-.I yes
-or
-.I no
-for each request.
-.PP
-The send and receive replies are
-based on permission to access the
-requested file/directory.
-After each file is copied into the spool directory
-of the receiving system,
-a copy-complete message is sent by the receiver of the file.
-The message
-.I CY
-will be sent if the
-.UX
-.I cp
-command, used to copy from the spool directory, is successful.
-Otherwise, a
-.I CN
-message is sent.
-The requests and results are logged on both systems,
-and, if requested, mail is sent to the user reporting completion
-(or the user can request status information from the log program at any time).
-.PP
-The hangup response is determined by the
-.I SLAVE
-program by a work scan of the spool directory.
-If work for the remote system exists in the
-.I SLAVE's
-spool directory, a
-.I HN
-message is sent and the programs switch roles.
-If no work exists, an
-.I HY
-response is sent.
-.PP
-A sample conversation is shown in Figure 2.
-.SH
-Conversation Termination
-.PP
-When a
-.I HY
-message is received by the
-.I MASTER
-it is echoed back to the
-.I SLAVE
-and the protocols are turned off.
-Each program sends a final "OO" message to the
-other.
-.NH
-Present Uses
-.PP
-One application of this software is remote mail.
-Normally, a
-.UX
-system user
-writes ``mail dan'' to send mail to
-user ``dan''.
-By writing ``mail usg!dan''
-the mail is sent to user 
-``dan''
-on system ``usg''.
-.PP
-The primary uses of our network to date have been in software maintenance.
-Relatively few of the bytes passed between systems are intended for
-people to read.
-Instead, new programs (or new versions of programs)
-are sent to users, and potential bugs are returned to authors.
-Aaron Cohen has implemented a
-``stockroom'' which allows remote users to call in and request software.
-He keeps a ``stock list'' of available programs, and new bug
-fixes and utilities are added regularly.
-In this way, users can always obtain the latest version of anything
-without bothering the authors of the programs.
-Although the stock list is maintained on a particular system,
-the items in the stockroom may be warehoused in many places;
-typically each program is distributed from the home site of
-its author.
-Where necessary, uucp does remote-to-remote copies.
-.PP
-We also routinely retrieve test cases from other systems
-to determine whether errors on remote systems are caused
-by local misconfigurations or old versions of software,
-or whether they are bugs that must be fixed at the home site.
-This helps identify errors rapidly.
-For one set of test programs maintained by us,
-over 70% of the bugs reported from remote sites
-were due to old software, and were fixed
-merely by distributing the current version.
-.PP
-Another application of the network for software maintenance
-is to compare files on two different machines.
-A very useful utility on one machine has been
-Doug McIlroy's ``diff'' program
-which compares two text files and indicates the differences,
-line by line, between them.
-.[
-hunt mcilroy file
-.]
-Only lines which are
-not identical are printed.
-Similarly,
-the program ``uudiff''
-compares files (or directories) on two machines.
-One of these directories may be on a passive system.
-The
-``uudiff'' program
-is set up to work similarly to the inter-system mail, but it is slightly
-more complicated.
-.PP
-To avoid moving large numbers of usually identical
-files,  
-.I uudiff
-computes file checksums
-on each side, and only moves files that are different
-for detailed comparison.
-For large files, this process can be iterated; checksums can be computed
-for each line, and only those lines that are different
-actually moved.
-.PP
-The ``uux'' command has
-been useful for providing remote output.
-There are some machines which do not have hard-copy
-devices, but which are connected over 9600 baud
-communication lines to machines with printers.
-The
-.I uux
-command allows the formatting of the
-printout on the local machine and printing on the
-remote machine using standard
-.UX
-command programs.
-.br
-.NH
-Performance
-.PP
-Throughput, of course, is primarily dependent on transmission speed.
-The table below shows the real throughput of characters
-on communication links of different speeds.
-These numbers represent actual data transferred;
-they do not include bytes used by the line protocol for
-data validation such as checksums and messages.
-At the higher speeds, contention for the processors on both
-ends prevents the network from driving the line full speed.
-The range of speeds represents the difference between light and
-heavy loads on the two systems.
-If desired, operating system modifications can
-be installed
-that permit full use of even very fast links.
-.KS
-.TS
-center;
-c c
-n n.
-Nominal speed  Characters/sec.
-300 baud       27
-1200 baud      100-110
-9600 baud      200-850
-.TE
-.KE
-In addition to the transfer time, there is some overhead
-for making the connection and logging in ranging from
-15 seconds to 1 minute.
-Even at 300 baud, however, a typical 5,000 byte source program
-can be transferred in
-four minutes instead of the 2 days that might be required
-to mail a tape.
-.PP
-Traffic between systems is variable.  Between two
-closely related systems,
-we observed
-20 files moved and 5 remote commands executed in a typical day.
-A more normal traffic out of a single system would be around
-a dozen files per day.
-.PP
-The total number of sites at present
-in the main network is
-82, which includes most of the Bell Laboratories
-full-size machines
-which run the
-.UX
-operating system.
-Geographically, the machines range from Andover, Massachusetts to
-Denver, Colorado.
-.PP
-Uucp has also
-been used to set up another network
-which connects a group of
-systems in operational sites with the home site.
-The two networks touch at one
-Bell Labs computer.
-.NH
-Further Goals
-.PP
-Eventually, we would like to develop a full system of remote software
-maintenance.
-Conventional maintenance (a support group which mails tapes)
-has many well-known disadvantages.
-.[
-brooks mythical man month 1975
-.]
-There are distribution errors and delays, resulting in old software
-running at remote sites and old bugs continually reappearing.
-These difficulties are aggravated when
-there are 100 different small systems, instead of a few large ones.
-.PP
-The availability of file transfer on a network of compatible operating
-systems
-makes it possible just to send programs directly to the end user who wants them.
-This avoids the bottleneck of negotiation and packaging in the central support
-group.
-The ``stockroom'' serves this function for new utilities
-and fixes to old utilities.
-However, it is still likely that distributions will not be sent
-and installed as often as needed.
-Users are justifiably suspicious of the ``latest version'' that has just
-arrived; all too often it features the ``latest bug.''
-What is needed is to address both problems simultaneously:
-.IP 1.
-Send distributions whenever programs change.
-.IP 2.
-Have sufficient quality control so that users will install them.
-.LP
-To do this, we recommend systematic regression testing both on the
-distributing and receiving systems.
-Acceptance testing on the receiving systems can be automated and
-permits the local system to ensure that its essential work can continue
-despite the constant installation of changes sent from elsewhere.
-The work of writing the test sequences should be recovered in lower
-counseling and distribution costs.
-.PP
-Some slow-speed network services are also being implemented.
-We now have inter-system ``mail'' and ``diff,''
-plus the many implied commands represented by ``uux.''
-However, we still need inter-system ``write'' (real-time inter-user
-communication) and ``who'' (list of people logged in
-on different systems).
-A slow-speed network of this sort may be very useful
-for speeding up counseling and education, even
-if not fast enough for the distributed data base
-applications that attract many users to networks.
-Effective use of remote execution over slow-speed lines, however,
-must await the general installation of multiplexable channels so
-that long file transfers do not lock out short inquiries.
-.NH
-Lessons
-.PP
-The following is a summary of the lessons we learned in
-building these programs.
-.IP 1.
-By starting your network in a way that requires no hardware or major operating system
-changes, you can get going quickly.
-.IP 2.
-Support will follow use.
-Since the network existed and was being used, system maintainers
-were easily persuaded to help keep it operating, including purchasing
-additional hardware to speed traffic.
-.IP 3.
-Make the network commands look like local commands.
-Our users have a resistance to learning anything new:
-all the inter-system commands look very similar to
-standard
-.UX
-system
-commands so that little training cost
-is involved.
-.IP 4.
-An initial error was not coordinating enough
-with existing communications projects: thus, the first
-version of this network was restricted to dial-up, since
-it did not support the various hardware links between systems.
-This has been fixed in the current system.
-.SH
-Acknowledgements
-.PP
-We thank G. L. Chesson for his design and implementation
-of the packet driver and protocol, and A. S. Cohen, J. Lions,
-and P. F. Long for their suggestions and assistance.
-.[
-$LIST$
-.]
diff --git a/.ref-Research-V7/usr/doc/yacc/ss.. b/.ref-Research-V7/usr/doc/yacc/ss..
deleted file mode 100644 (file)
index 1b4c307..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-.RP
-.ND "July 31, 1978"
-.TL
-Yacc:
-Yet Another Compiler-Compiler
-.AU "MH 2C-559" 3968
-Stephen C. Johnson
-.AI
-.MH
-.AB
-.PP
-Computer program input generally has some structure;
-in fact, every computer program that does input can be thought of as defining
-an ``input language'' which it accepts.
-An input language may be as complex as a programming language, or as simple as
-a sequence of numbers.
-Unfortunately, usual input facilities
-are limited, difficult to use,
-and often are lax about checking their inputs for validity.
-.PP
-Yacc provides a general tool for describing
-the input to a computer program.
-The Yacc user specifies the structures
-of his input, together with code to be invoked as
-each such structure is recognized.
-Yacc turns such a specification into a subroutine that
-handles the input process;
-frequently, it is convenient and appropriate to have most
-of the flow of control in the user's application
-handled by this subroutine.
-.PP
-The input subroutine produced by Yacc calls a user-supplied routine to
-return the next basic input item.
-Thus, the user can specify his input in terms of individual input characters, or
-in terms of higher level constructs such as names and numbers.
-The user-supplied routine may also handle idiomatic features such as
-comment and continuation conventions, which typically defy easy grammatical specification.
-.PP
-Yacc is written in portable C.
-The class of specifications accepted is a very general one: LALR(1)
-grammars with disambiguating rules.
-.PP
-In addition to compilers for C, APL, Pascal, RATFOR, etc., Yacc
-has also been used for less conventional languages,
-including a phototypesetter language, several desk calculator languages, a document retrieval system,
-and a Fortran debugging system.
-.AE
-.OK
-Computer Languages
-Compilers
-Formal Language Theory
-.CS 23 11 34 0 0 8
diff --git a/.ref-Research-V7/usr/doc/yacc/ss0 b/.ref-Research-V7/usr/doc/yacc/ss0
deleted file mode 100644 (file)
index 19b4c28..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-.SH
-0: Introduction
-.PP
-Yacc provides a general tool for imposing structure on the input to a computer program.
-The Yacc user prepares a
-specification of the input process; this includes rules
-describing the input structure, code to be invoked when these
-rules are recognized, and a low-level routine to do the
-basic input.
-Yacc then generates a function to control the input process.
-This function, called a
-.I parser ,
-calls the user-supplied low-level input routine
-(the
-.I "lexical analyzer" )
-to pick up the basic items
-(called
-.I tokens )
-from the input stream.
-These tokens are organized according to the input structure rules,
-called
-.I "grammar rules" \|;
-when one of these rules has been recognized,
-then user code supplied for this rule, an
-.I action ,
-is invoked; actions have the ability to return values and
-make use of the values of other actions.
-.PP
-Yacc is written in a portable dialect of C
-.[
-Ritchie Kernighan Language Prentice
-.]
-and the actions, and output subroutine, are in C as well.
-Moreover, many of the syntactic conventions of Yacc follow C.
-.PP
-The heart of the input specification is a collection of grammar rules.
-Each rule describes an allowable structure and gives it a name.
-For example, one grammar rule might be
-.DS
-date  :  month\_name  day  \',\'  year   ;
-.DE
-Here,
-.I date ,
-.I month\_name ,
-.I day ,
-and
-.I year
-represent structures of interest in the input process;
-presumably,
-.I month\_name ,
-.I day ,
-and
-.I year
-are defined elsewhere.
-The comma ``,'' is enclosed in single quotes; this implies that the
-comma is to appear literally in the input.
-The colon and semicolon merely serve as punctuation in the rule, and have
-no significance in controlling the input.
-Thus, with proper definitions, the input
-.DS
-July  4, 1776
-.DE
-might be matched by the above rule.
-.PP
-An important part of the input process is carried out by the
-lexical analyzer.
-This user routine reads the input stream, recognizing the lower level structures,
-and communicates these tokens
-to the parser.
-For historical reasons, a structure recognized by the lexical analyzer is called a
-.I "terminal symbol" ,
-while the structure recognized by the parser is called a
-.I "nonterminal symbol" .
-To avoid confusion, terminal symbols will usually be referred to as
-.I tokens .
-.PP
-There is considerable leeway in deciding whether to recognize structures using the lexical
-analyzer or grammar rules.
-For example, the rules
-.DS
-month\_name  :  \'J\' \'a\' \'n\'   ;
-month\_name  :  \'F\' \'e\' \'b\'   ;
-
-         . . .
-
-month\_name  :  \'D\' \'e\' \'c\'   ;
-.DE
-might be used in the above example.
-The lexical analyzer would only need to recognize individual letters, and
-.I month\_name
-would be a nonterminal symbol.
-Such low-level rules tend to waste time and space, and may
-complicate the specification beyond Yacc's ability to deal with it.
-Usually, the lexical analyzer would
-recognize the month names,
-and return an indication that a
-.I month\_name
-was seen; in this case,
-.I month\_name
-would be a token.
-.PP
-Literal characters such as ``,'' must also be passed through the lexical
-analyzer, and are also considered tokens.
-.PP
-Specification files are very flexible.
-It is realively easy to add to the above example the rule
-.DS
-date  :  month \'/\' day \'/\' year   ;
-.DE
-allowing
-.DS
-7 / 4 / 1776
-.DE
-as a synonym for
-.DS
-July 4, 1776
-.DE
-In most cases, this new rule could be ``slipped in'' to a working system with minimal effort,
-and little danger of disrupting existing input.
-.PP
-The input being read may not conform to the
-specifications.
-These input errors are detected as early as is theoretically possible with a
-left-to-right scan;
-thus, not only is the chance of reading and computing with bad
-input data substantially reduced, but the bad data can usually be quickly found.
-Error handling,
-provided as part of the input specifications,
-permits the reentry of bad data,
-or the continuation of the input process after skipping over the bad data.
-.PP
-In some cases, Yacc fails to produce a parser when given a set of
-specifications.
-For example, the specifications may be self contradictory, or they may
-require a more powerful recognition mechanism than that available to Yacc.
-The former cases represent design errors;
-the latter cases
-can often be corrected
-by making
-the lexical analyzer
-more powerful, or by rewriting some of the grammar rules.
-While Yacc cannot handle all possible specifications, its power
-compares favorably with similar systems;
-moreover, the
-constructions which are difficult for Yacc to handle are
-also frequently difficult for human beings to handle.
-Some users have reported that the discipline of formulating valid
-Yacc specifications for their input revealed errors of
-conception or design early in the program development.
-.PP
-The theory underlying Yacc has been described elsewhere.
-.[
-Aho Johnson Surveys LR Parsing
-.]
-.[
-Aho Johnson Ullman Ambiguous Grammars
-.]
-.[
-Aho Ullman Principles Compiler Design
-.]
-Yacc has been extensively used in numerous practical applications,
-including
-.I lint ,
-.[
-Johnson Lint
-.]
-the Portable C Compiler,
-.[
-Johnson Portable Compiler Theory
-.]
-and a system for typesetting mathematics.
-.[
-Kernighan Cherry typesetting system CACM
-.]
-.PP
-The next several sections describe the
-basic process of preparing a Yacc specification;
-Section 1 describes the preparation of grammar rules,
-Section 2 the preparation of the user supplied actions associated with these rules,
-and Section 3 the preparation of lexical analyzers.
-Section 4 describes the operation of the parser.
-Section 5 discusses various reasons why Yacc may be unable to produce a
-parser from a specification, and what to do about it.
-Section 6 describes a simple mechanism for
-handling operator precedences in arithmetic expressions.
-Section 7 discusses error detection and recovery.
-Section 8 discusses the operating environment and special features
-of the parsers Yacc produces.
-Section 9 gives some suggestions which should improve the
-style and efficiency of the specifications.
-Section 10 discusses some advanced topics, and Section 11 gives
-acknowledgements.
-Appendix A has a brief example, and Appendix B gives a
-summary of the Yacc input syntax.
-Appendix C gives an example using some of the more advanced
-features of Yacc, and, finally,
-Appendix D describes mechanisms and syntax
-no longer actively supported, but
-provided for historical continuity with older versions of Yacc.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss1 b/.ref-Research-V7/usr/doc/yacc/ss1
deleted file mode 100644 (file)
index 596a4e6..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-.tr *\(**
-.tr |\(or
-.SH
-1: Basic Specifications
-.PP
-Names refer to either tokens or nonterminal symbols.
-Yacc requires
-token names to be declared as such.
-In addition, for reasons discussed in Section 3, it is often desirable
-to include the lexical analyzer as part of the specification file;
-it may be useful to include other programs as well.
-Thus, every specification file consists of three sections:
-the
-.I declarations ,
-.I "(grammar) rules" ,
-and
-.I programs .
-The sections are separated by double percent ``%%'' marks.
-(The percent ``%'' is generally used in Yacc specifications as an escape character.)
-.PP
-In other words, a full specification file looks like
-.DS
-declarations
-%%
-rules
-%%
-programs
-.DE
-.PP
-The declaration section may be empty.
-Moreover, if the programs section is omitted, the second %% mark may be omitted also;
-thus, the smallest legal Yacc specification is
-.DS
-%%
-rules
-.DE
-.PP
-Blanks, tabs, and newlines are ignored except
-that they may not appear in names or multi-character reserved symbols.
-Comments may appear wherever a name is legal; they are enclosed
-in /* . . . */, as in C and PL/I.
-.PP
-The rules section is made up of one or more grammar rules.
-A grammar rule has the form:
-.DS
-A  :  BODY  ;
-.DE
-A represents a nonterminal name, and BODY represents a sequence of zero or more names and literals.
-The colon and the semicolon are Yacc punctuation.
-.PP
-Names may be of arbitrary length, and may be made up of letters, dot ``.'', underscore ``\_'', and
-non-initial digits.
-Upper and lower case letters are distinct.
-The names used in the body of a grammar rule may represent tokens or nonterminal symbols.
-.PP
-A literal consists of a character enclosed in single quotes ``\'''.
-As in C, the backslash ``\e'' is an escape character within literals, and all the C escapes
-are recognized.
-Thus
-.DS
-\'\en\'        newline
-\'\er\'        return
-\'\e\'\'       single quote ``\'''
-\'\e\e\'       backslash ``\e''
-\'\et\'        tab
-\'\eb\'        backspace
-\'\ef\'        form feed
-\'\exxx\'      ``xxx'' in octal
-.DE
-For a number of technical reasons, the
-\s-2NUL\s0
-character (\'\e0\' or 0) should never
-be used in grammar rules.
-.PP
-If there are several grammar rules with the same left hand side, the vertical bar ``|''
-can be used to avoid rewriting the left hand side.
-In addition,
-the semicolon at the end of a rule can be dropped before a vertical bar.
-Thus the grammar rules
-.DS
-A      :       B  C  D   ;
-A      :       E  F   ;
-A      :       G   ;
-.DE
-can be given to Yacc as
-.DS
-A      :       B  C  D
-       |       E  F
-       |       G
-       ;
-.DE
-It is not necessary that all grammar rules with the same left side appear together in the grammar rules section,
-although it makes the input much more readable, and easier to change.
-.PP
-If a nonterminal symbol matches the empty string, this can be indicated in the obvious way:
-.DS
-empty :   ;
-.DE
-.PP
-Names representing tokens must be declared; this is most simply done by writing
-.DS
-%token   name1  name2 . . .
-.DE
-in the declarations section.
-(See Sections 3 , 5, and 6 for much more discussion).
-Every name not defined in the declarations section is assumed to represent a nonterminal symbol.
-Every nonterminal symbol must appear on the left side of at least one rule.
-.PP
-Of all the nonterminal symbols, one, called the
-.I "start symbol" ,
-has particular importance.
-The parser is designed to recognize the start symbol; thus,
-this symbol represents the largest,
-most general structure described by the grammar rules.
-By default,
-the start symbol is taken to be the left hand side of the first
-grammar rule in the rules section.
-It is possible, and in fact desirable, to declare the start
-symbol explicitly in the declarations section using the %start keyword:
-.DS
-%start   symbol
-.DE
-.PP
-The end of the input to the parser is signaled by a special token, called the
-.I endmarker .
-If the tokens up to, but not including, the endmarker form a structure
-which matches the start symbol, the parser function returns to its caller
-after the endmarker is seen; it
-.I accepts
-the input.
-If the endmarker is seen in any other context, it is an error.
-.PP
-It is the job of the user-supplied lexical analyzer
-to return the endmarker when appropriate; see section 3, below.
-Usually the endmarker represents some reasonably obvious 
-I/O status, such as ``end-of-file'' or ``end-of-record''.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss2 b/.ref-Research-V7/usr/doc/yacc/ss2
deleted file mode 100644 (file)
index 6500602..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-.SH
-2: Actions
-.PP
-With each grammar rule, the user may associate actions to be performed each time
-the rule is recognized in the input process.
-These actions may return values, and may obtain the values returned by previous
-actions.
-Moreover, the lexical analyzer can return values
-for tokens, if desired.
-.PP
-An action is an arbitrary C statement, and as such can do
-input and output, call subprograms, and alter
-external vectors and variables.
-An action is specified by
-one or more statements, enclosed in curly braces ``{'' and ``}''.
-For example,
-.DS
-A      :       \'(\'  B  \')\'
-                       {       hello( 1, "abc" );  }
-.DE
-and
-.DS
-XXX    :       YYY  ZZZ
-                       {       printf("a message\en");
-                               flag = 25;   }
-.DE
-are grammar rules with actions.
-.PP
-To facilitate easy communication between the actions and the parser, the action statements are altered
-slightly.
-The symbol ``dollar sign'' ``$'' is used as a signal to Yacc in this context.
-.PP
-To return a value, the action normally sets the
-pseudo-variable ``$$'' to some value.
-For example, an action that does nothing but return the value 1 is
-.DS
-       {  $$ = 1;  }
-.DE
-.PP
-To obtain the values returned by previous actions and the lexical analyzer, the
-action may use the pseudo-variables $1, $2, . . .,
-which refer to the values returned by the
-components of the right side of a rule, reading from left to right.
-Thus, if the rule is
-.DS
-A      :       B  C  D   ;
-.DE
-for example, then $2 has the value returned by C, and $3 the value returned by D.
-.PP
-As a more concrete example, consider the rule
-.DS
-expr   :       \'(\'  expr  \')\'   ;
-.DE
-The value returned by this rule is usually the value of the
-.I expr
-in parentheses.
-This can be indicated by
-.DS
-expr   :        \'(\'  expr  \')\'             {  $$ = $2 ;  }
-.DE
-.PP
-By default, the value of a rule is the value of the first element in it ($1).
-Thus, grammar rules of the form
-.DS
-A      :       B    ;
-.DE
-frequently need not have an explicit action.
-.PP
-In the examples above, all the actions came at the end of their rules.
-Sometimes, it is desirable to get control before a rule is fully parsed.
-Yacc permits an action to be written in the middle of a rule as well
-as at the end.
-This rule is assumed to return a value, accessible
-through the usual \$ mechanism by the actions to
-the right of it.
-In turn, it may access the values
-returned by the symbols to its left.
-Thus, in the rule
-.DS
-A      :       B
-                       {  $$ = 1;  }
-               C
-                       {   x = $2;   y = $3;  }
-       ;
-.DE
-the effect is to set
-.I x
-to 1, and
-.I y
-to the value returned by C.
-.PP
-Actions that do not terminate a rule are actually
-handled by Yacc by manufacturing a new nonterminal
-symbol name, and a new rule matching this
-name to the empty string.
-The interior action is the action triggered off by recognizing
-this added rule.
-Yacc actually treats the above example as if
-it had been written:
-.DS
-$ACT   :       /* empty */
-                       {  $$ = 1;  }
-       ;
-
-A      :       B  $ACT  C
-                       {   x = $2;   y = $3;  }
-       ;
-.DE
-.PP
-In many applications, output is not done directly by the actions;
-rather, a data structure, such as a parse tree, is constructed in memory,
-and transformations are applied to it before output is generated.
-Parse trees are particularly easy to
-construct, given routines to build and maintain the tree
-structure desired.
-For example, suppose there is a C function
-.I node ,
-written so that the call
-.DS
-node( L, n1, n2 )
-.DE
-creates a node with label L, and descendants n1 and n2, and returns the index of
-the newly created node.
-Then parse tree can be built by supplying actions such as:
-.DS
-expr   :       expr  \'+\'  expr  
-                       {  $$ = node( \'+\', $1, $3 );  }
-.DE
-in the specification.
-.PP
-The user may define other variables to be used by the actions.
-Declarations and definitions can appear in
-the declarations section,
-enclosed in the marks ``%{'' and ``%}''.
-These declarations and definitions have global scope, 
-so they are known to the action statements and the lexical analyzer.
-For example,
-.DS
-%{   int variable = 0;   %}
-.DE
-could be placed in the declarations section,
-making
-.I variable
-accessible to all of the actions.
-The Yacc parser uses only names beginning in ``yy'';
-the user should avoid such names.
-.PP
-In these examples, all the values are integers: a discussion of
-values of other types will be found in Section 10.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss3 b/.ref-Research-V7/usr/doc/yacc/ss3
deleted file mode 100644 (file)
index 527bdef..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-.SH
-3: Lexical Analysis
-.PP
-The user must supply a lexical analyzer to read the input stream and communicate tokens
-(with values, if desired) to the parser.
-The lexical analyzer is an integer-valued function called
-.I yylex .
-The function returns an integer, the
-.I "token number" ,
-representing the kind of token read.
-If there is a value associated with that token, it should be assigned
-to the external variable
-.I yylval .
-.PP
-The parser and the lexical analyzer must agree on these token numbers in order for
-communication between them to take place.
-The numbers may be chosen by Yacc, or chosen by the user.
-In either case, the ``# define'' mechanism of C is used to allow the lexical analyzer
-to return these numbers symbolically.
-For example, suppose that the token name DIGIT has been defined in the declarations section of the
-Yacc specification file.
-The relevant portion of the lexical analyzer might look like:
-.DS
-yylex(){
-       extern int yylval;
-       int c;
-       . . .
-       c = getchar();
-       . . .
-       switch( c ) {
-               . . .
-       case \'0\':
-       case \'1\':
-         . . .
-       case \'9\':
-               yylval = c\-\'0\';
-               return( DIGIT );
-               . . .
-               }
-       . . .
-.DE
-.PP
-The intent is to return a token number of DIGIT, and a value equal to the numerical value of the
-digit.
-Provided that the lexical analyzer code is placed in the programs section of the specification file,
-the identifier DIGIT will be defined as the token number associated
-with the token DIGIT.
-.PP
-This mechanism leads to clear,
-easily modified lexical analyzers; the only pitfall is the need
-to avoid using any token names in the grammar that are reserved
-or significant in C or the parser; for example, the use of
-token names
-.I if
-or
-.I while
-will almost certainly cause severe
-difficulties when the lexical analyzer is compiled.
-The token name
-.I error
-is reserved for error handling, and should not be used naively
-(see Section 7).
-.PP
-As mentioned above, the token numbers may be chosen by Yacc or by the user.
-In the default situation, the numbers are chosen by Yacc.
-The default token number for a literal
-character is the numerical value of the character in the local character set.
-Other names are assigned token numbers
-starting at 257.
-.PP
-To assign a token number to a token (including literals),
-the first appearance of the token name or literal
-.I
-in the declarations section
-.R
-can be immediately followed by
-a nonnegative integer.
-This integer is taken to be the token number of the name or literal.
-Names and literals not defined by this mechanism retain their default definition.
-It is important that all token numbers be distinct.
-.PP
-For historical reasons, the endmarker must have token
-number 0 or negative.
-This token number cannot be redefined by the user; thus, all
-lexical analyzers should be prepared to return 0 or negative as a token number
-upon reaching the end of their input.
-.PP
-A very useful tool for constructing lexical analyzers is
-the
-.I Lex
-program developed by Mike Lesk.
-.[
-Lesk Lex
-.]
-These lexical analyzers are designed to work in close
-harmony with Yacc parsers.
-The specifications for these lexical analyzers
-use regular expressions instead of grammar rules.
-Lex can be easily used to produce quite complicated lexical analyzers,
-but there remain some languages (such as FORTRAN) which do not
-fit any theoretical framework, and whose lexical analyzers
-must be crafted by hand.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss4 b/.ref-Research-V7/usr/doc/yacc/ss4
deleted file mode 100644 (file)
index 7cac9b2..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-.SH
-4: How the Parser Works
-.PP
-Yacc turns the specification file into a C program, which
-parses the input according to the specification given.
-The algorithm used to go from the
-specification to the parser is complex, and will not be discussed
-here (see
-the references for more information).
-The parser itself, however, is relatively simple,
-and understanding how it works, while
-not strictly necessary, will nevertheless make
-treatment of error recovery and ambiguities much more
-comprehensible.
-.PP
-The parser produced by Yacc consists
-of a finite state machine with a stack.
-The parser is also capable of reading and remembering the next
-input token (called the
-.I lookahead
-token).
-The
-.I "current state"
-is always the one on the top of the stack.
-The states of the finite state machine are given
-small integer labels; initially, the machine is in state 0,
-the stack contains only state 0, and no lookahead token has been read.
-.PP
-The machine has only four actions available to it, called
-.I shift ,
-.I reduce ,
-.I accept ,
-and
-.I error .
-A move of the parser is done as follows:
-.IP 1.
-Based on its current state, the parser decides
-whether it needs a lookahead token to decide
-what action should be done; if it needs one, and does
-not have one, it calls
-.I yylex
-to obtain the next token.
-.IP 2.
-Using the current state, and the lookahead token
-if needed, the parser decides on its next action, and
-carries it out.
-This may result in states being pushed onto the stack, or popped off of
-the stack, and in the lookahead token being processed
-or left alone.
-.PP
-The
-.I shift
-action is the most common action the parser takes.
-Whenever a shift action is taken, there is always
-a lookahead token.
-For example, in state 56 there may be
-an action:
-.DS
-       IF      shift 34
-.DE
-which says, in state 56, if the lookahead token is IF,
-the current state (56) is pushed down on the stack,
-and state 34 becomes the current state (on the
-top of the stack).
-The lookahead token is cleared.
-.PP
-The
-.I reduce
-action keeps the stack from growing without
-bounds.
-Reduce actions are appropriate when the parser has seen
-the right hand side of a grammar rule,
-and is prepared to announce that it has seen
-an instance of the rule, replacing the right hand side
-by the left hand side.
-It may be necessary to consult the lookahead token
-to decide whether to reduce, but
-usually it is not; in fact, the default
-action (represented by a ``.'') is often a reduce action.
-.PP
-Reduce actions are associated with individual grammar rules.
-Grammar rules are also given small integer
-numbers, leading to some confusion.
-The action
-.DS
-       \fB.\fR reduce 18
-.DE
-refers to
-.I "grammar rule"
-18, while the action
-.DS
-       IF      shift 34
-.DE
-refers to
-.I state
-34.
-.PP
-Suppose the rule being reduced is
-.DS
-A      \fB:\fR x  y  z    ;
-.DE
-The reduce action depends on the
-left hand symbol (A in this case), and the number of
-symbols on the right hand side (three in this case).
-To reduce, first pop off the top three states
-from the stack
-(In general, the number of states popped equals the number of symbols on the
-right side of the rule).
-In effect, these states were the ones
-put on the stack while recognizing
-.I x ,
-.I y ,
-and
-.I z ,
-and no longer serve any useful purpose.
-After popping these states, a state is uncovered
-which was the state the parser was in before beginning to
-process the rule.
-Using this uncovered state, and the symbol
-on the left side of the rule, perform what is in
-effect a shift of A.
-A new state is obtained, pushed onto the stack, and parsing continues.
-There are significant differences between the processing of
-the left hand symbol and an ordinary shift of a token,
-however, so this action is called a
-.I goto
-action.
-In particular, the lookahead token is cleared by a shift, and
-is not affected by a goto.
-In any case, the uncovered state contains an entry such as:
-.DS
-       A       goto 20
-.DE
-causing state 20 to be pushed
-onto the stack, and become the current state.
-.PP
-In effect, the reduce action ``turns back the clock'' in the parse,
-popping the states off the stack to go back to the
-state where the right hand side of the rule was first seen.
-The parser then behaves as if it had seen the left side at that time.
-If the right hand side of the rule is empty,
-no states are popped off of the stack: the uncovered state
-is in fact the current state.
-.PP
-The reduce action is also important in the treatment of user-supplied
-actions and values.
-When a rule is reduced, the code supplied with the rule is executed
-before the stack is adjusted.
-In addition to the stack holding the states, another stack,
-running in parallel with it, holds the values returned
-from the lexical analyzer and the actions.
-When a shift takes place, the external variable
-.I yylval
-is copied onto the value stack.
-After the return from the user code, the reduction is carried out.
-When the
-.I goto
-action is done, the external variable
-.I yyval
-is copied onto the value stack.
-The pseudo-variables $1, $2, etc., refer to the value stack.
-.PP
-The other two parser actions are conceptually much simpler.
-The
-.I accept
-action indicates that the entire input has been seen and
-that it matches the specification.
-This action appears only when the lookahead token is 
-the endmarker, and indicates that the parser has successfully
-done its job.
-The
-.I error
-action, on the other hand, represents a place where the parser
-can no longer continue parsing according to the specification.
-The input tokens it has seen, together with the lookahead token,
-cannot be followed by anything that would result
-in a legal input.
-The parser reports an error, and attempts to recover the situation and
-resume parsing: the error recovery (as opposed to the detection of error)
-will be covered in Section 7.
-.PP
-It is time for an example!
-Consider the specification
-.DS
-%token  DING  DONG  DELL
-%%
-rhyme  :       sound  place
-       ;
-sound  :       DING  DONG
-       ;
-place  :       DELL
-       ;
-.DE
-.PP
-When Yacc is invoked with the
-.B \-v
-option, a file called
-.I y.output
-is produced, with a human-readable description of the parser.
-The
-.I y.output
-file corresponding to the above grammar (with some statistics
-stripped off the end) is:
-.DS
-state 0
-       $accept  :  \_rhyme  $end 
-
-       DING  shift 3
-       .  error
-
-       rhyme  goto 1
-       sound  goto 2
-
-state 1
-       $accept  :   rhyme\_$end 
-
-       $end  accept
-       .  error
-
-state 2
-       rhyme  :   sound\_place 
-
-       DELL  shift 5
-       .  error
-
-       place   goto 4
-
-state 3
-       sound   :   DING\_DONG 
-
-       DONG  shift 6
-       .  error
-
-state 4
-       rhyme  :   sound  place\_    (1)
-
-       .   reduce  1
-
-state 5
-       place  :   DELL\_    (3)
-
-       .   reduce  3
-
-state 6
-       sound   :   DING  DONG\_    (2)
-
-       .   reduce  2
-.DE
-Notice that, in addition to the actions for each state, there is a
-description of the parsing rules being processed in each
-state.  The \_ character is used to indicate
-what has been seen, and what is yet to come, in each rule.
-Suppose the input is
-.DS
-DING  DONG  DELL
-.DE
-It is instructive to follow the steps of the parser while
-processing this input.
-.PP
-Initially, the current state is state 0.
-The parser needs to refer to the input in order to decide
-between the actions available in state 0, so
-the first token,
-.I DING ,
-is read, becoming the lookahead token.
-The action in state 0 on
-.I DING
-is
-is ``shift 3'', so state 3 is pushed onto the stack,
-and the lookahead token is cleared.
-State 3 becomes the current state.
-The next token,
-.I DONG ,
-is read, becoming the lookahead token.
-The action in state 3 on the token
-.I DONG
-is ``shift 6'',
-so state 6 is pushed onto the stack, and the lookahead is cleared.
-The stack now contains 0, 3, and 6.
-In state 6, without even consulting the lookahead,
-the parser reduces by rule 2.
-.DS
-       sound  :   DING  DONG
-.DE
-This rule has two symbols on the right hand side, so
-two states, 6 and 3, are popped off of the stack, uncovering state 0.
-Consulting the description of state 0, looking for a goto on 
-.I sound ,
-.DS
-       sound   goto 2
-.DE
-is obtained; thus state 2 is pushed onto the stack,
-becoming the current state.
-.PP
-In state 2, the next token,
-.I DELL ,
-must be read.
-The action is ``shift 5'', so state 5 is pushed onto the stack, which now has
-0, 2, and 5 on it, and the lookahead token is cleared.
-In state 5, the only action is to reduce by rule 3.
-This has one symbol on the right hand side, so one state, 5,
-is popped off, and state 2 is uncovered.
-The goto in state 2 on
-.I place ,
-the left side of rule 3,
-is state 4.
-Now, the stack contains 0, 2, and 4.
-In state 4, the only action is to reduce by rule 1.
-There are two symbols on the right, so the top two states are popped off,
-uncovering state 0 again.
-In state 0, there is a goto on
-.I rhyme
-causing the parser to enter state 1.
-In state 1, the input is read; the endmarker is obtained,
-indicated by ``$end'' in the
-.I y.output
-file.
-The action in state 1 when the endmarker is seen is to accept,
-successfully ending the parse.
-.PP
-The reader is urged to consider how the parser works
-when confronted with such incorrect strings as
-.I "DING DONG DONG" ,
-.I "DING DONG" ,
-.I "DING DONG DELL DELL" ,
-etc.
-A few minutes spend with this and other simple examples will
-probably be repaid when problems arise in more complicated contexts.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss5 b/.ref-Research-V7/usr/doc/yacc/ss5
deleted file mode 100644 (file)
index d2ec50b..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-.SH
-5: Ambiguity and Conflicts
-.PP
-A set of grammar rules is
-.I ambiguous
-if there is some input string that can be structured in two or more different ways.
-For example, the grammar rule
-.DS
-expr   :       expr  \'\-\'  expr
-.DE
-is a natural way of expressing the fact that one way of forming an arithmetic expression
-is to put two other expressions together with a minus sign between them.
-Unfortunately, this grammar rule does not
-completely specify the way that all complex inputs
-should be structured.
-For example, if the input is
-.DS
-expr  \-  expr  \-  expr
-.DE
-the rule allows this input to be structured as either
-.DS
-(  expr  \-  expr  )  \-  expr
-.DE
-or as
-.DS
-expr  \-  (  expr  \-  expr  )
-.DE
-(The first is called
-.I "left association" ,
-the second
-.I "right association" ).
-.PP
-Yacc detects such ambiguities when it is attempting to build the parser.
-It is instructive to consider the problem that confronts the parser when it is
-given an input such as
-.DS
-expr  \-  expr  \-  expr
-.DE
-When the parser has read the second expr, the input that it has seen:
-.DS
-expr  \-  expr
-.DE
-matches the right side of the grammar rule above.
-The parser could
-.I reduce
-the input by applying this rule;
-after applying the rule;
-the input is reduced to
-.I expr (the
-left side of the rule).
-The parser would then read the final part of the input:
-.DS
-\-  expr
-.DE
-and again reduce.
-The effect of this is to take the left associative interpretation.
-.PP
-Alternatively, when the parser has seen
-.DS
-expr  \-  expr
-.DE
-it could defer the immediate application of the rule, and continue reading
-the input until it had seen
-.DS
-expr  \-  expr  \-  expr
-.DE
-It could then apply the rule to the rightmost three symbols, reducing them to
-.I expr
-and leaving
-.DS
-expr  \-  expr
-.DE
-Now the rule can be reduced once more; the effect is to
-take the right associative interpretation.
-Thus, having read
-.DS
-expr  \-  expr
-.DE
-the parser can do two legal things, a shift or a reduction, and has no way of
-deciding between them.
-This is called a
-.I "shift / reduce conflict" .
-It may also happen that the parser has a choice of two legal reductions;
-this is called a
-.I "reduce / reduce conflict" .
-Note that there are never any ``Shift/shift'' conflicts.
-.PP
-When there are shift/reduce or reduce/reduce conflicts, Yacc still produces a parser.
-It does this by selecting one of the valid steps wherever it has a choice.
-A rule describing which choice to make in a given situation is called
-a
-.I "disambiguating rule" .
-.PP
-Yacc invokes two disambiguating rules by default:
-.IP 1.
-In a shift/reduce conflict, the default is to do the shift.
-.IP 2.
-In a reduce/reduce conflict, the default is to reduce by the
-.I earlier
-grammar rule (in the input sequence).
-.PP
-Rule 1 implies that reductions are deferred whenever there is a choice,
-in favor of shifts.
-Rule 2 gives the user rather crude control over the behavior of the parser
-in this situation, but reduce/reduce conflicts should be avoided whenever possible.
-.PP
-Conflicts may arise because of mistakes in input or logic, or because the grammar rules, while consistent,
-require a more complex parser than Yacc can construct.
-The use of actions within rules can also cause conflicts, if the action must
-be done before the parser can be sure which rule is being recognized.
-In these cases, the application of disambiguating rules is inappropriate,
-and leads to an incorrect parser.
-For this reason, Yacc
-always reports the number of shift/reduce and reduce/reduce conflicts resolved by Rule 1 and Rule 2.
-.PP
-In general, whenever it is possible to apply disambiguating rules to produce a correct parser, it is also
-possible to rewrite the grammar rules so that the same inputs are read but there are no
-conflicts.
-For this reason, most previous parser generators
-have considered conflicts to be fatal errors.
-Our experience has suggested that this rewriting is somewhat unnatural,
-and produces slower parsers; thus, Yacc will produce parsers even in the presence of conflicts.
-.PP
-As an example of the power of disambiguating rules, consider a fragment from a programming
-language involving an ``if-then-else'' construction:
-.DS
-stat   :       IF  \'(\'  cond  \')\'  stat
-       |       IF  \'(\'  cond  \')\'  stat  ELSE  stat
-       ;
-.DE
-In these rules,
-.I IF
-and
-.I ELSE
-are tokens,
-.I cond
-is a nonterminal symbol describing
-conditional (logical) expressions, and
-.I stat
-is a nonterminal symbol describing statements.
-The first rule will be called the
-.ul
-simple-if
-rule, and the
-second the
-.ul
-if-else
-rule.
-.PP
-These two rules form an ambiguous construction, since input of the form
-.DS
-IF  (  C1  )  IF  (  C2  )  S1  ELSE  S2
-.DE
-can be structured according to these rules in two ways:
-.DS
-IF  (  C1  )  {
-       IF  (  C2  )  S1
-       }
-ELSE  S2
-.DE
-or
-.DS
-IF  (  C1  )  {
-       IF  (  C2  )  S1
-       ELSE  S2
-       }
-.DE
-The second interpretation is the one given in most programming languages
-having this construct.
-Each
-.I ELSE
-is associated with the last preceding
-``un-\fIELSE'\fRd''
-.I IF .
-In this example, consider the situation where the parser has seen
-.DS
-IF  (  C1  )  IF  (  C2  )  S1
-.DE
-and is looking at the
-.I ELSE .
-It can immediately
-reduce
-by the simple-if rule to get
-.DS
-IF  (  C1  )  stat
-.DE
-and then read the remaining input,
-.DS
-ELSE  S2
-.DE
-and reduce
-.DS
-IF  (  C1  )  stat  ELSE  S2
-.DE
-by the if-else rule.
-This leads to the first of the above groupings of the input.
-.PP
-On the other hand, the
-.I ELSE
-may be shifted,
-.I S2
-read, and then the right hand portion of
-.DS
-IF  (  C1  )  IF  (  C2  )  S1  ELSE  S2
-.DE
-can be reduced by the if-else rule to get
-.DS
-IF  (  C1  )  stat
-.DE
-which can be reduced by the simple-if rule.
-This leads to the second of the above groupings of the input, which
-is usually desired.
-.PP
-Once again the parser can do two valid things \- there is a shift/reduce conflict.
-The application of disambiguating rule 1 tells the parser to shift in this case,
-which leads to the desired grouping.
-.PP
-This shift/reduce conflict arises only when there is a particular current input symbol,
-.I ELSE ,
-and particular inputs already seen, such as
-.DS
-IF  (  C1  )  IF  (  C2  )  S1
-.DE
-In general, there may be many conflicts, and each one
-will be associated with an input symbol and
-a set of previously read inputs.
-The previously read inputs are characterized by the
-state
-of the parser.
-.PP
-The conflict messages of Yacc are best understood
-by examining the verbose (\fB\-v\fR) option output file.
-For example, the output corresponding to the above
-conflict state might be:
-.DS L
-23: shift/reduce conflict (shift 45, reduce 18) on ELSE
-
-state 23
-
-         stat  :  IF  (  cond  )  stat\_         (18)
-         stat  :  IF  (  cond  )  stat\_ELSE  stat
-
-        ELSE     shift 45
-        .        reduce 18
-
-.DE
-The first line describes the conflict, giving the state and the input symbol.
-The ordinary state description follows, giving
-the grammar rules active in the state, and the parser actions.
-Recall that the underline marks the
-portion of the grammar rules which has been seen.
-Thus in the example, in state 23 the parser has seen input corresponding
-to
-.DS
-IF  (  cond  )  stat
-.DE
-and the two grammar rules shown are active at this time.
-The parser can do two possible things.
-If the input symbol is
-.I ELSE ,
-it is possible to shift into state
-45.
-State 45 will have, as part of its description, the line
-.DS
-stat  :  IF  (  cond  )  stat  ELSE\_stat
-.DE
-since the
-.I ELSE
-will have been shifted in this state.
-Back in state 23, the alternative action, described by ``\fB.\fR'',
-is to be done if the input symbol is not mentioned explicitly in the above actions; thus,
-in this case, if the input symbol is not
-.I ELSE ,
-the parser reduces by grammar rule 18:
-.DS
-stat  :  IF  \'(\'  cond  \')\'  stat
-.DE
-Once again, notice that the numbers following ``shift'' commands refer to other states,
-while the numbers following ``reduce'' commands refer to grammar
-rule numbers.
-In the
-.I y.output
-file, the rule numbers are printed after those rules which can be reduced.
-In most one states, there will be at most reduce action possible in the
-state, and this will be the default command.
-The user who encounters unexpected shift/reduce conflicts will probably want to
-look at the verbose output to decide whether the default actions are appropriate.
-In really tough cases, the user might need to know more about
-the behavior and construction of the parser than can be covered here.
-In this case, one of the theoretical references
-.[
-Aho Johnson Surveys Parsing
-.]
-.[
-Aho Johnson Ullman Deterministic Ambiguous
-.]
-.[
-Aho Ullman Principles Design
-.]
-might be consulted; the services of a local guru might also be appropriate.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss6 b/.ref-Research-V7/usr/doc/yacc/ss6
deleted file mode 100644 (file)
index c01ac16..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-.SH
-6: Precedence
-.PP
-There is one common situation
-where the rules given above for resolving conflicts are not sufficient;
-this is in the parsing of arithmetic expressions.
-Most of the commonly used constructions for arithmetic expressions can be naturally
-described by the notion of
-.I precedence
-levels for operators, together with information about left
-or right associativity.
-It turns out that ambiguous grammars with appropriate disambiguating rules
-can be used to create parsers that are faster and easier to
-write than parsers constructed from unambiguous grammars.
-The basic notion is to write grammar rules
-of the form
-.DS
-expr  :  expr  OP  expr
-.DE
-and
-.DS
-expr  :  UNARY  expr
-.DE
-for all binary and unary operators desired.
-This creates a very ambiguous grammar, with many parsing conflicts.
-As disambiguating rules, the user specifies the precedence, or binding
-strength, of all the operators, and the associativity
-of the binary operators.
-This information is sufficient to allow Yacc to resolve the parsing conflicts
-in accordance with these rules, and construct a parser that realizes the desired
-precedences and associativities.
-.PP
-The precedences and associativities are attached to tokens in the declarations section.
-This is done by a series of lines beginning with a Yacc keyword: %left, %right,
-or %nonassoc, followed by a list of tokens.
-All of the tokens on the same line are assumed to have the same precedence level
-and associativity; the lines are listed in
-order of increasing precedence or binding strength.
-Thus,
-.DS
-%left  \'+\'  \'\-\'
-%left  \'*\'  \'/\'
-.DE
-describes the precedence and associativity of the four arithmetic operators.
-Plus and minus are left associative, and have lower precedence than
-star and slash, which are also left associative.
-The keyword %right is used to describe right associative operators,
-and the keyword %nonassoc is used to describe operators, like
-the operator .LT. in Fortran, that may not associate with themselves; thus,
-.DS
-A  .LT.  B  .LT.  C
-.DE
-is illegal in Fortran, and such an operator would be described with the keyword
-%nonassoc in Yacc.
-As an example of the behavior of these declarations, the description
-.DS
-%right  \'=\'
-%left  \'+\'  \'\-\'
-%left  \'*\'  \'/\'
-
-%%
-
-expr   :       expr  \'=\'  expr
-       |       expr  \'+\'  expr
-       |       expr  \'\-\'  expr
-       |       expr  \'*\'  expr
-       |       expr  \'/\'  expr
-       |       NAME
-       ;
-.DE
-might be used to structure the input
-.DS
-a  =  b  =  c*d  \-  e  \-  f*g
-.DE
-as follows:
-.DS
-a = ( b = ( ((c*d)\-e) \- (f*g) ) )
-.DE
-When this mechanism is used,
-unary operators must, in general, be given a precedence.
-Sometimes a unary operator and a binary operator
-have the same symbolic representation, but different precedences.
-An example is unary and binary \'\-\'; unary minus may be given the same
-strength as multiplication, or even higher, while binary minus has a lower strength than
-multiplication.
-The keyword, %prec, changes the precedence level associated with a particular grammar rule.
-%prec appears immediately after the body of the grammar rule, before the action or closing semicolon,
-and is followed by a token name or literal.
-It
-causes the precedence of the grammar rule to become that of the following token name or literal.
-For example, to make unary minus have the same precedence as multiplication the rules might resemble:
-.DS
-%left  \'+\'  \'\-\'
-%left  \'*\'  \'/\'
-
-%%
-
-expr   :       expr  \'+\'  expr
-       |       expr  \'\-\'  expr
-       |       expr  \'*\'  expr
-       |       expr  \'/\'  expr
-       |       \'\-\'  expr      %prec  \'*\'
-       |       NAME
-       ;
-.DE
-.PP
-A token declared
-by %left, %right, and %nonassoc need not be, but may be, declared by %token as well.
-.PP
-The precedences and associativities are used by Yacc to
-resolve parsing conflicts; they give rise to disambiguating rules.
-Formally, the rules work as follows:
-.IP 1.
-The precedences and associativities are recorded for those tokens and literals
-that have them.
-.IP 2.
-A precedence and associativity is associated with each grammar rule; it is the precedence
-and associativity of the last token or literal in the body of the rule.
-If the %prec construction is used, it overrides this default.
-Some grammar rules may have no precedence and associativity associated with them.
-.IP 3.
-When there is a reduce/reduce conflict, or there is a shift/reduce conflict
-and either the input symbol or the grammar rule has no precedence and associativity,
-then the two disambiguating rules given at the beginning of the section are used,
-and the conflicts are reported.
-.IP 4.
-If there is a shift/reduce conflict, and both the grammar rule and the input character
-have precedence and associativity associated with them, then the conflict is resolved
-in favor of the action (shift or reduce) associated with the higher precedence.
-If the precedences are the same, then the associativity is used; left
-associative implies reduce, right associative implies shift, and nonassociating
-implies error.
-.PP
-Conflicts resolved by precedence are not counted in the number of shift/reduce and reduce/reduce
-conflicts reported by Yacc.
-This means that mistakes in the specification of precedences may
-disguise errors in the input grammar; it is a good idea to be sparing
-with precedences, and use them in an essentially ``cookbook'' fashion,
-until some experience has been gained.
-The
-.I y.output
-file
-is very useful in deciding whether the parser is actually doing
-what was intended.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss7 b/.ref-Research-V7/usr/doc/yacc/ss7
deleted file mode 100644 (file)
index 90df1b0..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-.SH
-7: Error Handling
-.PP
-Error handling is an extremely difficult area, and many of the problems are semantic ones.
-When an error is found, for example, it may be necessary to reclaim parse tree storage,
-delete or alter symbol table entries, and, typically, set switches to avoid generating any further output.
-.PP
-It is seldom acceptable to stop all processing when an error is found; it is more useful to continue
-scanning the input to find further syntax errors.
-This leads to the problem of getting the parser ``restarted'' after an error.
-A general class of algorithms to do this involves discarding a number of tokens
-from the input string, and attempting to adjust the parser so that input can continue.
-.PP
-To allow the user some control over this process,
-Yacc provides a simple, but reasonably general, feature.
-The token name ``error'' is reserved for error handling.
-This name can be used in grammar rules;
-in effect, it suggests places where errors are expected, and recovery might take place.
-The parser pops its stack until it enters a state where the token ``error'' is legal.
-It then behaves as if the token ``error'' were the current lookahead token,
-and performs the action encountered.
-The lookahead token is then reset to the token that caused the error.
-If no special error rules have been specified, the processing halts when an error is detected.
-.PP
-In order to prevent a cascade of error messages, the parser, after
-detecting an error, remains in error state until three tokens have been successfully
-read and shifted.
-If an error is detected when the parser is already in error state,
-no message is given, and the input token is quietly deleted.
-.PP
-As an example, a rule of the form
-.DS
-stat   :       error
-.DE
-would, in effect, mean that on a syntax error the parser would attempt to skip over the statement
-in which the error was seen.
-More precisely, the parser will
-scan ahead, looking for three tokens that might legally follow
-a statement, and start processing at the first of these; if
-the beginnings of statements are not sufficiently distinctive, it may make a
-false start in the middle of a statement, and end up reporting a
-second error where there is in fact no error.
-.PP
-Actions may be used with these special error rules.
-These actions might attempt to reinitialize tables, reclaim symbol table space, etc.
-.PP
-Error rules such as the above are very general, but difficult to control.
-Somewhat easier are rules such as
-.DS
-stat   :       error  \';\'
-.DE
-Here, when there is an error, the parser attempts to skip over the statement, but
-will do so by skipping to the next \';\'.
-All tokens after the error and before the next \';\' cannot be shifted, and are discarded.
-When the \';\' is seen, this rule will be reduced, and any ``cleanup''
-action associated with it performed.
-.PP
-Another form of error rule arises in interactive applications, where
-it may be desirable to permit a line to be reentered after an error.
-A possible error rule might be
-.DS
-input  :       error  \'\en\'  {  printf( "Reenter last line: " );  }  input
-                       {       $$  =  $4;  }
-.DE
-There is one potential difficulty with this approach;
-the parser must correctly process three input tokens before it
-admits that it has correctly resynchronized after the error.
-If the reentered line contains an error
-in the first two tokens, the parser deletes the offending tokens,
-and gives no message; this is clearly unacceptable.
-For this reason, there is a mechanism that
-can be used to force the parser
-to believe that an error has been fully recovered from.
-The statement
-.DS
-yyerrok ;
-.DE
-in an action
-resets the parser to its normal mode.
-The last example is better written
-.DS
-input  :       error  \'\en\'
-                       {       yyerrok;
-                               printf( "Reenter last line: " );   }
-               input
-                       {       $$  =  $4;  }
-       ;
-.DE
-.PP
-As mentioned above, the token seen immediately
-after the ``error'' symbol is the input token at which the
-error was discovered.
-Sometimes, this is inappropriate; for example, an
-error recovery action might
-take upon itself the job of finding the correct place to resume input.
-In this case,
-the previous lookahead token must be cleared.
-The statement
-.DS
-yyclearin ;
-.DE
-in an action will have this effect.
-For example, suppose the action after error
-were to call some sophisticated resynchronization routine,
-supplied by the user, that attempted to advance the input to the
-beginning of the next valid statement.
-After this routine was called, the next token returned by yylex would presumably
-be the first token in a legal statement;
-the old, illegal token must be discarded, and the error state reset.
-This could be done by a rule like
-.DS
-stat   :       error 
-                       {       resynch();
-                               yyerrok ;
-                               yyclearin ;   }
-       ;
-.DE
-.PP
-These mechanisms are admittedly crude, but do allow for a simple, fairly effective recovery of the parser
-from many errors;
-moreover, the user can get control to deal with
-the error actions required by other portions of the program.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss8 b/.ref-Research-V7/usr/doc/yacc/ss8
deleted file mode 100644 (file)
index f6b54e8..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-.SH
-8: The Yacc Environment
-.PP
-When the user inputs a specification
-to Yacc, the output is a file of C programs, called
-.I y.tab.c
-on most
-systems
-(due to local file system conventions, the names may differ from
-installation to installation).
-The function produced by Yacc is called
-.I yyparse \|;
-it is an integer valued function.
-When it is called, it in turn repeatedly calls
-.I yylex ,
-the lexical analyzer
-supplied by the user (see Section 3)
-to obtain input tokens.
-Eventually, either an error is detected, in which case
-(if no error recovery is possible)
-.I yyparse
-returns the value 1,
-or the lexical analyzer returns the endmarker token
-and the parser accepts.
-In this case,
-.I yyparse
-returns the value 0.
-.PP
-The user must provide a certain amount of environment for this
-parser in order to obtain a working program.
-For example, as with every C program, a program called
-.I main
-must be defined, that eventually calls
-.I yyparse .
-In addition, a routine called
-.I yyerror
-prints a message
-when a syntax error is detected.
-.PP
-These two routines must be supplied in one form or another by the
-user.
-To ease the initial effort of using Yacc, a library has been
-provided with default versions of
-.I main
-and
-.I yyerror .
-The name of this library is system dependent;
-on many systems the library is accessed by a
-.B \-ly
-argument to the loader.
-To show the triviality of these default programs, the source is
-given below:
-.DS
-main(){
-       return( yyparse() );
-       }
-.DE
-and
-.DS
-# include <stdio.h>
-
-yyerror(s) char *s; {
-       fprintf( stderr, "%s\en", s );
-       }
-.DE
-The argument to
-.I yyerror
-is a string containing an error message, usually
-the string ``syntax error''.
-The average application will want to do better than this.
-Ordinarily, the program should keep track of the input line number, and print it
-along with the message when a syntax error is detected.
-The external integer variable
-.I yychar
-contains the lookahead token number at the time the error was detected;
-this may be of some interest in giving better diagnostics.
-Since the
-.I main
-program is probably supplied by the user (to read arguments, etc.)
-the Yacc library is useful only in small
-projects, or in the earliest stages of larger ones.
-.PP
-The external integer variable
-.I yydebug
-is normally set to 0.
-If it is set to a nonzero value, the parser will output a
-verbose description of its actions, including
-a discussion of which input symbols have been read, and
-what the parser actions are.
-Depending on the operating environment,
-it may be possible to set this variable by using a debugging system.
diff --git a/.ref-Research-V7/usr/doc/yacc/ss9 b/.ref-Research-V7/usr/doc/yacc/ss9
deleted file mode 100644 (file)
index 99eea8d..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-.SH
-9: Hints for Preparing Specifications
-.PP
-This section contains miscellaneous hints on preparing efficient, easy to change,
-and clear specifications.
-The individual subsections are more or less
-independent.
-.SH
-Input Style
-.PP
-It is difficult to
-provide rules with substantial actions
-and still have a readable specification file.
-The following style hints owe much to Brian Kernighan.
-.IP a.
-Use all capital letters for token names, all lower case letters for
-nonterminal names.
-This rule comes under the heading of ``knowing who to blame when
-things go wrong.''
-.IP b.
-Put grammar rules and actions on separate lines.
-This allows either to be changed without
-an automatic need to change the other.
-.IP c.
-Put all rules with the same left hand side together.
-Put the left hand side in only once, and let all
-following rules begin with a vertical bar.
-.IP d.
-Put a semicolon only after the last rule with a given left hand side,
-and put the semicolon on a separate line.
-This allows new rules to be easily added.
-.IP e.
-Indent rule bodies by two tab stops, and action bodies by three
-tab stops.
-.PP
-The example in Appendix A is written following this style, as are
-the examples in the text of this paper (where space permits).
-The user must make up his own mind about these stylistic questions;
-the central problem, however, is to make the rules visible through
-the morass of action code.
-.SH
-Left Recursion
-.PP
-The algorithm used by the Yacc parser encourages so called ``left recursive''
-grammar rules: rules of the form
-.DS
-name   :       name  rest_of_rule  ;
-.DE
-These rules frequently arise when
-writing specifications of sequences and lists:
-.DS
-list   :       item
-       |       list  \',\'  item
-       ;
-.DE
-and
-.DS
-seq    :       item
-       |       seq  item
-       ;
-.DE
-In each of these cases, the first rule
-will be reduced for the first item only, and the second rule
-will be reduced for the second and all succeeding items.
-.PP
-With right recursive rules, such as
-.DS
-seq    :       item
-       |       item  seq
-       ;
-.DE
-the parser would be a bit bigger, and the items would be seen, and reduced,
-from right to left.
-More seriously, an internal stack in the parser
-would be in danger of overflowing if a very long sequence were read.
-Thus, the user should use left recursion wherever reasonable.
-.PP
-It is worth considering whether a sequence with zero
-elements has any meaning, and if so, consider writing
-the sequence specification with an empty rule:
-.DS
-seq    :       /* empty */
-       |       seq  item
-       ;
-.DE
-Once again, the first rule would always be reduced exactly once, before the
-first item was read,
-and then the second rule would be reduced once for each item read.
-Permitting empty sequences
-often leads to increased generality.
-However, conflicts might arise if Yacc is asked to decide
-which empty sequence it has seen, when it hasn't seen enough to
-know!
-.SH
-Lexical Tie-ins
-.PP
-Some lexical decisions depend on context.
-For example, the lexical analyzer might want to
-delete blanks normally, but not within quoted strings.
-Or names might be entered into a symbol table in declarations,
-but not in expressions.
-.PP
-One way of handling this situation is
-to create a global flag that is
-examined by the lexical analyzer, and set by actions.
-For example, suppose a program
-consists of 0 or more declarations, followed by 0 or more statements.
-Consider:
-.DS
-%{
-       int dflag;
-%}
-  ...  other declarations ...
-
-%%
-
-prog   :       decls  stats
-       ;
-
-decls  :       /* empty */
-                       {       dflag = 1;  }
-       |       decls  declaration
-       ;
-
-stats  :       /* empty */
-                       {       dflag = 0;  }
-       |       stats  statement
-       ;
-
-    ...  other rules ...
-.DE
-The flag
-.I dflag
-is now 0 when reading statements, and 1 when reading declarations,
-.ul
-except for the first token in the first statement.
-This token must be seen by the parser before it can tell that
-the declaration section has ended and the statements have
-begun.
-In many cases, this single token exception does not
-affect the lexical scan.
-.PP
-This kind of ``backdoor'' approach can be elaborated
-to a noxious degree.
-Nevertheless, it represents a way of doing some things
-that are difficult, if not impossible, to
-do otherwise.
-.SH
-Reserved Words
-.PP
-Some programming languages
-permit the user to
-use words like ``if'', which are normally reserved,
-as label or variable names, provided that such use does not
-conflict with the legal use of these names in the programming language.
-This is extremely hard to do in the framework of Yacc;
-it is difficult to pass information to the lexical analyzer
-telling it ``this instance of `if' is a keyword, and that instance is a variable''.
-The user can make a stab at it, using the
-mechanism described in the last subsection,
-but it is difficult.
-.PP
-A number of ways of making this easier are under advisement.
-Until then, it is better that the keywords be
-.I reserved \|;
-that is, be forbidden for use as variable names.
-There are powerful stylistic reasons for preferring this, anyway.
diff --git a/.ref-Research-V7/usr/doc/yacc/ssA b/.ref-Research-V7/usr/doc/yacc/ssA
deleted file mode 100644 (file)
index 564e801..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-.SH
-10: Advanced Topics
-.PP
-This section discusses a number of advanced features
-of Yacc.
-.SH
-Simulating Error and Accept in Actions
-.PP
-The parsing actions of error and accept can be simulated
-in an action by use of macros YYACCEPT and YYERROR.
-YYACCEPT causes
-.I yyparse
-to return the value 0;
-YYERROR causes
-the parser to behave as if the current input symbol
-had been a syntax error;
-.I yyerror
-is called, and error recovery takes place.
-These mechanisms can be used to simulate parsers
-with multiple endmarkers or context-sensitive syntax checking.
-.SH
-Accessing Values in Enclosing Rules.
-.PP
-An action may refer to values
-returned by actions to the left of the current rule.
-The mechanism is simply the same as with ordinary actions,
-a dollar sign followed by a digit, but in this case the
-digit may be 0 or negative.
-Consider
-.DS
-sent   :       adj  noun  verb  adj  noun
-                       {  \fIlook at the sentence\fR . . .  }
-       ;
-
-adj    :       THE             {       $$ = THE;  }
-       |       YOUNG   {       $$ = YOUNG;  }
-       . . .
-       ;
-
-noun   :       DOG
-                       {       $$ = DOG;  }
-       |       CRONE
-                       {       if( $0 == YOUNG ){
-                                       printf( "what?\en" );
-                                       }
-                               $$ = CRONE;
-                               }
-       ;
-       . . .
-.DE
-In the action following the word CRONE, a check is made that the
-preceding token shifted was not YOUNG.
-Obviously, this is only possible when a great deal is known about
-what might precede the symbol
-.I noun
-in the input.
-There is also a distinctly unstructured flavor about this.
-Nevertheless, at times this mechanism will save a great
-deal of trouble, especially when a few combinations are to
-be excluded from an otherwise regular structure.
-.SH
-Support for Arbitrary Value Types
-.PP
-By default, the values returned by actions and the lexical analyzer are integers.
-Yacc can also support
-values of other types, including structures.
-In addition, Yacc keeps track of the types, and inserts
-appropriate union member names so that the resulting parser will
-be strictly type checked.
-The Yacc value stack (see Section 4)
-is declared to be a
-.I union
-of the various types of values desired.
-The user declares the union, and associates union member names
-to each token and nonterminal symbol having a value.
-When the value is referenced through a $$ or $n construction,
-Yacc will automatically insert the appropriate union name, so that
-no unwanted conversions will take place.
-In addition, type checking commands such as
-.I Lint\|
-.[
-Johnson Lint Checker 1273
-.]
-will be far more silent.
-.PP
-There are three mechanisms used to provide for this typing.
-First, there is a way of defining the union; this must be
-done by the user since other programs, notably the lexical analyzer,
-must know about the union member names.
-Second, there is a way of associating a union member name with tokens
-and nonterminals.
-Finally, there is a mechanism for describing the type of those
-few values where Yacc can not easily determine the type.
-.PP
-To declare the union, the user includes in the declaration section:
-.DS
-%union  {
-       body of union ...
-       }
-.DE
-This declares the Yacc value stack,
-and the external variables
-.I yylval
-and
-.I yyval ,
-to have type equal to this union.
-If Yacc was invoked with the
-.B \-d
-option, the union declaration
-is copied onto the
-.I y.tab.h
-file.
-Alternatively,
-the union may be declared in a header file, and a typedef
-used to define the variable YYSTYPE to represent
-this union.
-Thus, the header file might also have said:
-.DS
-typedef union {
-       body of union ...
-       } YYSTYPE;
-.DE
-The header file must be included in the declarations
-section, by use of %{ and %}.
-.PP
-Once YYSTYPE is defined,
-the union member names must be associated
-with the various terminal and nonterminal names.
-The construction
-.DS
-< name >
-.DE
-is used to indicate a union member name.
-If this follows
-one of the
-keywords %token,
-%left, %right, and %nonassoc,
-the union member name is associated with the tokens listed.
-Thus, saying
-.DS
-%left  <optype>  \'+\'  \'\-\'
-.DE
-will cause any reference to values returned by these two tokens to be
-tagged with
-the union member name
-.I optype .
-Another keyword, %type, is
-used similarly to associate
-union member names with nonterminals.
-Thus, one might say
-.DS
-%type  <nodetype>  expr  stat
-.DE
-.PP
-There remain a couple of cases where these mechanisms are insufficient.
-If there is an action within a rule, the value returned
-by this action has no
-.I "a priori"
-type.
-Similarly, reference to left context values (such as $0 \- see the
-previous subsection ) leaves Yacc with no easy way of knowing the type.
-In this case, a type can be imposed on the reference by inserting
-a union member name, between < and >, immediately after
-the first $.
-An example of this usage is
-.DS
-rule   :       aaa  {  $<intval>$  =  3;  } bbb
-                       {       fun( $<intval>2, $<other>0 );  }
-       ;
-.DE
-This syntax has little to recommend it, but the situation arises rarely.
-.PP
-A sample specification is given in Appendix C.
-The facilities in this subsection are not triggered until they are used:
-in particular, the use of %type will turn on these mechanisms.
-When they are used, there is a fairly strict level of checking.
-For example, use of $n or $$ to refer to something with no defined type
-is diagnosed.
-If these facilities are not triggered, the Yacc value stack is used to
-hold
-.I int' s,
-as was true historically.
diff --git a/.ref-Research-V7/usr/doc/yacc/ssB b/.ref-Research-V7/usr/doc/yacc/ssB
deleted file mode 100644 (file)
index 2352a84..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.SH
-11: Acknowledgements
-.PP
-Yacc owes much to a
-most stimulating collection of users, who have goaded
-me beyond my inclination, and frequently beyond my
-ability, in their endless search for ``one more feature''.
-Their irritating unwillingness to learn how to
-do things my way has usually led to my doing things their way;
-most of the time, they have been right.
-B. W. Kernighan, P. J. Plauger, S. I. Feldman, C. Imagna,
-M. E. Lesk,
-and A. Snyder will recognize some of their ideas in the current version
-of Yacc.
-C. B. Haley contributed to the error recovery algorithm.
-D. M. Ritchie, B. W. Kernighan, and M. O. Harris helped translate this document into English.
-Al Aho also deserves special credit for bringing
-the mountain to Mohammed, and other favors.
-.SG "MH-1273-SCJ-unix"
-.bp
-.[
-$LIST$
-.]
-.bp
diff --git a/.ref-Research-V7/usr/doc/yacc/ssa b/.ref-Research-V7/usr/doc/yacc/ssa
deleted file mode 100644 (file)
index 2ad7a8e..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-.SH
-Appendix A:  A Simple Example
-.PP
-This example gives the complete Yacc specification for a small desk calculator;
-the desk calculator has 26 registers, labeled ``a'' through ``z'', and accepts
-arithmetic expressions made up of the operators +, \-, *, /,
-% (mod operator), & (bitwise and), | (bitwise or), and assignment.
-If an expression at the top level is an assignment, the value is not
-printed; otherwise it is.
-As in C, an integer that begins with 0 (zero) is assumed to be octal;
-otherwise, it is assumed to be decimal.
-.PP
-As an example of a Yacc specification, the desk calculator
-does a reasonable job of showing how precedences and ambiguities
-are used, and demonstrating simple error recovery.
-The major oversimplifications are that the
-lexical analysis phase is much simpler than for most applications, and the
-output is produced immediately, line by line.
-Note the way that decimal and octal integers are read in by the grammar rules;
-This job is probably better done by the lexical analyzer.
-.sp
-.nf
-.ta .5i 1i 1.5i 2i 2.5i
-
-%{
-#  include  <stdio.h>
-#  include  <ctype.h>
-
-int  regs[26];
-int  base;
-
-%}
-
-%start  list
-
-%token  DIGIT  LETTER
-
-%left  \'|\'
-%left  \'&\'
-%left  \'+\'  \'\-\'
-%left  \'*\'  \'/\'  \'%\'
-%left  UMINUS      /*  supplies  precedence  for  unary  minus  */
-
-%%      /*  beginning  of  rules  section  */
-
-list   :       /*  empty  */
-       |       list  stat  \'\en\'
-       |       list  error  \'\en\'
-                       {       yyerrok;  }
-       ;
-
-stat   :       expr
-                       {       printf( "%d\en", $1 );  }
-       |       LETTER  \'=\'  expr
-                       {       regs[$1]  =  $3;  }
-       ;
-
-expr   :       \'(\'  expr  \')\'
-                       {       $$  =  $2;  }
-       |       expr  \'+\'  expr
-                       {       $$  =  $1  +  $3;  }
-       |       expr  \'\-\'  expr
-                       {       $$  =  $1  \-  $3;  }
-       |       expr  \'*\'  expr
-                       {       $$  =  $1  *  $3;  }
-       |       expr  \'/\'  expr
-                       {       $$  =  $1  /  $3;  }
-       |       expr  \'%\'  expr
-                       {       $$  =  $1  %  $3;  }
-       |       expr  \'&\'  expr
-                       {       $$  =  $1  &  $3;  }
-       |       expr  \'|\'  expr
-                       {       $$  =  $1  |  $3;  }
-       |       \'\-\'  expr        %prec  UMINUS
-                       {       $$  =  \-  $2;  }
-       |       LETTER
-                       {       $$  =  regs[$1];  }
-       |       number          
-       ;
-
-number :       DIGIT
-                       {       $$ = $1;    base  =  ($1==0)  ?  8  :  10;  }
-       |       number  DIGIT
-                       {       $$  =  base * $1  +  $2;  }
-       ;
-
-%%      /*  start  of  programs  */
-
-yylex() {              /*  lexical  analysis  routine  */
-              /*  returns  LETTER  for  a  lower  case  letter,  yylval = 0  through  25  */
-              /*  return  DIGIT  for  a  digit,  yylval = 0  through  9  */
-              /*  all  other  characters  are  returned  immediately  */
-
-       int  c;
-
-       while(  (c=getchar())  ==  \' \'  )  {  /*  skip  blanks  */  }
-
-       /*  c  is  now  nonblank  */
-
-       if(  islower(  c  )  )  {       
-               yylval  =  c  \-  \'a\';
-               return  (  LETTER  );
-               }
-       if(  isdigit(  c  )  )  {       
-               yylval  =  c  \-  \'0\';
-               return(  DIGIT  );
-               }
-       return(  c  );
-       }
-.fi
-.bp
diff --git a/.ref-Research-V7/usr/doc/yacc/ssb b/.ref-Research-V7/usr/doc/yacc/ssb
deleted file mode 100644 (file)
index 8d7cfc6..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-.SH
-Appendix B: Yacc Input Syntax
-.PP
-This Appendix has a description of the Yacc input syntax, as a Yacc specification.
-Context dependencies, etc., are not considered.
-Ironically, the Yacc input specification language
-is most naturally specified as an LR(2) grammar; the sticky
-part comes when an identifier is seen in a rule, immediately
-following an action.
-If this identifier is followed by a colon, it is the start of the
-next rule; otherwise
-it is a continuation of the current rule, which just happens to have
-an action embedded in it.
-As implemented, the lexical analyzer looks
-ahead after seeing an identifier, and
-decide whether the next token (skipping blanks, newlines, comments, etc.)
-is a colon.
-If so, it returns the token C_IDENTIFIER.
-Otherwise, it returns IDENTIFIER.
-Literals (quoted strings) are also returned as IDENTIFIERS,
-but never as part of C_IDENTIFIERs.
-.sp
-.nf
-.ta .6i 1.2i 1.8i 2.4i 3i 3.6i
-
-            /*  grammar  for  the  input  to  Yacc  */
-
-       /*  basic  entities  */
-%token IDENTIFIER      /*   includes  identifiers   and  literals  */
-%token C_IDENTIFIER    /*    identifier  (but  not  literal)  followed  by  colon    */
-%token NUMBER          /*    [0-9]+    */
-
-       /*  reserved  words:    %type  =>  TYPE,  %left  =>  LEFT,  etc.  */
-
-%token LEFT  RIGHT  NONASSOC  TOKEN  PREC  TYPE  START  UNION
-
-%token MARK    /*  the  %%  mark  */
-%token LCURL   /*  the  %{  mark  */
-%token RCURL   /*  the  %}  mark  */
-
-       /*  ascii  character  literals  stand  for  themselves  */
-
-%start spec
-
-%%
-
-spec   :       defs  MARK  rules  tail
-       ;
-
-tail   :       MARK    {    \fIIn  this  action,  eat  up  the  rest  of  the  file\fR    }
-       |       /*  empty:  the  second  MARK  is  optional  */
-       ;
-
-defs   :       /*  empty  */
-       |       defs  def
-       ;
-
-def    :       START  IDENTIFIER
-       |       UNION  {  \fICopy union  definition  to  output\fR  }
-       |       LCURL  {  \fICopy  C  code  to  output  file\fR   }  RCURL
-       |       ndefs  rword  tag  nlist
-       ;
-
-rword  :       TOKEN
-       |       LEFT
-       |       RIGHT
-       |       NONASSOC
-       |       TYPE
-       ;
-
-tag    :       /*  empty:  union  tag  is  optional  */
-       |       \'<\'  IDENTIFIER  \'>\'
-       ;
-
-nlist  :       nmno
-       |       nlist  nmno
-       |       nlist  \',\'  nmno
-       ;
-
-nmno   :       IDENTIFIER              /*  NOTE:  literal  illegal  with  %type  */
-       |       IDENTIFIER  NUMBER      /*  NOTE:  illegal  with  %type  */
-       ;
-
-       /*  rules  section  */
-
-rules  :       C_IDENTIFIER  rbody  prec
-       |       rules  rule
-       ;
-
-rule   :       C_IDENTIFIER  rbody  prec
-       |       '|'  rbody  prec
-       ;
-
-rbody  :       /*  empty  */
-       |       rbody  IDENTIFIER
-       |       rbody  act
-       ;
-
-act    :       \'{\'  {  \fICopy  action,  translate  $$,  etc.\fR  }  \'}\'
-       ;
-
-prec   :       /*  empty  */
-       |       PREC  IDENTIFIER
-       |       PREC  IDENTIFIER  act
-       |       prec  \';\'
-       ;
-.fi
-.bp
diff --git a/.ref-Research-V7/usr/doc/yacc/ssc b/.ref-Research-V7/usr/doc/yacc/ssc
deleted file mode 100644 (file)
index 1f4d036..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-.SH
-Appendix C: An Advanced Example
-.PP
-This Appendix gives an example of a grammar using some
-of the advanced features discussed in Section 10.
-The desk calculator example in Appendix A is
-modified to provide a desk calculator that
-does floating point interval arithmetic.
-The calculator understands floating point
-constants, the arithmetic operations +, \-, *, /,
-unary \-, and = (assignment), and has 26 floating
-point variables, ``a'' through ``z''.
-Moreover, it also understands
-.I intervals ,
-written
-.DS
-       ( x , y )
-.DE
-where
-.I x
-is less than or equal to
-.I y .
-There are 26 interval valued variables ``A'' through ``Z''
-that may also be used.
-The usage is similar to that in Appendix A; assignments
-return no value, and print nothing, while expressions print
-the (floating or interval) value.
-.PP
-This example explores a number of interesting features
-of Yacc and C.
-Intervals are represented by a structure, consisting of the
-left and right endpoint values, stored as
-.I double 's.
-This structure is given a type name, INTERVAL, by using
-.I typedef .
-The Yacc value stack can also contain floating point scalars, and
-integers (used to index into the arrays holding the variable values).
-Notice that this entire strategy depends strongly on being able to
-assign structures and unions in C.
-In fact, many of the actions call functions that return structures
-as well.
-.PP
-It is also worth noting the use of YYERROR to handle error conditions:
-division by an interval containing 0, and an interval presented in
-the wrong order.
-In effect, the error recovery mechanism of Yacc is used to throw away the
-rest of the offending line.
-.PP
-In addition to the mixing of types on the value stack,
-this grammar also demonstrates an interesting use of syntax to
-keep track of the type (e.g. scalar or interval) of intermediate
-expressions.
-Note that a scalar can be automatically promoted to an interval if
-the context demands an interval value.
-This causes a large number of conflicts when the grammar is run through
-Yacc: 18 Shift/Reduce and 26 Reduce/Reduce.
-The problem can be seen by looking at the two input lines:
-.DS
-       2.5 + ( 3.5 \- 4. )
-.DE
-and
-.DS
-       2.5 + ( 3.5 , 4. )
-.DE
-Notice that the 2.5 is to be used in an interval valued expression
-in the second example, but this fact is not known until
-the ``,'' is read; by this time, 2.5 is finished, and the parser cannot go back
-and change its mind.
-More generally, it might be necessary to look ahead an arbitrary number of
-tokens to decide whether to convert a scalar to an interval.
-This problem is evaded by having two rules for each binary interval
-valued operator: one when the left operand is a scalar, and one when
-the left operand is an interval.
-In the second case, the right operand must be an interval,
-so the conversion will be applied automatically.
-Despite this evasion, there are still many cases where the
-conversion may be applied or not, leading to the above
-conflicts.
-They are resolved by listing the rules that yield scalars first
-in the specification file; in this way, the conflicts will
-be resolved in the direction of keeping scalar
-valued expressions scalar valued until they are forced to become
-intervals.
-.PP
-This way of handling multiple types is very instructive, but not very general.
-If there were many kinds of expression types, instead of just two,
-the number of rules needed would increase dramatically, and the conflicts
-even more dramatically.
-Thus, while this example is instructive, it is better practice in a
-more normal programming language environment to
-keep the type information as part of the value, and not as part
-of the grammar.
-.PP
-Finally, a word about the lexical analysis.
-The only unusual feature is the treatment of floating point constants.
-The C library routine
-.I atof
-is used to do the actual conversion from a character string
-to a double precision value.
-If the lexical analyzer detects an error,
-it responds by returning a token that
-is illegal in the grammar, provoking a syntax error
-in the parser, and thence error recovery.
-.DS L
-
-%{
-
-#  include  <stdio.h>
-#  include  <ctype.h>
-
-typedef  struct  interval  {
-       double  lo,  hi;
-       }  INTERVAL;
-
-INTERVAL  vmul(),  vdiv();
-
-double  atof();
-
-double  dreg[ 26 ];
-INTERVAL  vreg[ 26 ];
-
-%}
-
-%start    lines
-
-%union    {
-       int  ival;
-       double  dval;
-       INTERVAL  vval;
-       }
-
-%token  <ival>  DREG  VREG     /*  indices  into  dreg,  vreg  arrays  */
-
-%token  <dval>  CONST          /*  floating  point  constant  */
-
-%type  <dval>  dexp            /*  expression  */
-
-%type  <vval>  vexp            /*  interval  expression  */
-
-       /*  precedence  information  about  the  operators  */
-
-%left  \'+\'  \'\-\'
-%left  \'*\'  \'/\'
-%left  UMINUS        /*  precedence  for  unary  minus  */
-
-%%
-
-lines  :       /*  empty  */
-       |       lines  line
-       ;
-
-line   :       dexp  \'\en\'
-                       {       printf(  "%15.8f\en",  $1  );  }
-       |       vexp  \'\en\'
-                       {       printf(  "(%15.8f  ,  %15.8f  )\en",  $1.lo,  $1.hi  );  }
-       |       DREG  \'=\'  dexp  \'\en\'
-                       {       dreg[$1]  =  $3;  }
-       |       VREG  \'=\'  vexp  \'\en\'
-                       {       vreg[$1]  =  $3;  }
-       |       error  \'\en\'
-                       {       yyerrok;  }
-       ;
-
-dexp   :       CONST
-       |       DREG
-                       {       $$  =  dreg[$1];  }
-       |       dexp  \'+\'  dexp
-                       {       $$  =  $1  +  $3;  }
-       |       dexp  \'\-\'  dexp
-                       {       $$  =  $1  \-  $3;  }
-       |       dexp  \'*\'  dexp
-                       {       $$  =  $1  *  $3;  }
-       |       dexp  \'/\'  dexp
-                       {       $$  =  $1  /  $3;  }
-       |       \'\-\'  dexp    %prec  UMINUS
-                       {       $$  =  \- $2;  }
-       |       \'(\'  dexp  \')\'
-                       {       $$  =  $2;  }
-       ;
-
-vexp   :       dexp
-                       {       $$.hi  =  $$.lo  =  $1;  }
-       |       \'(\'  dexp  \',\'  dexp  \')\'
-                       {
-                       $$.lo  =  $2;
-                       $$.hi  =  $4;
-                       if(  $$.lo  >  $$.hi  ){
-                               printf(  "interval  out  of  order\en"  );
-                               YYERROR;
-                               }
-                       }
-       |       VREG
-                       {       $$  =  vreg[$1];    }
-       |       vexp  \'+\'  vexp
-                       {       $$.hi  =  $1.hi  +  $3.hi;
-                               $$.lo  =  $1.lo  +  $3.lo;    }
-       |       dexp  \'+\'  vexp
-                       {       $$.hi  =  $1  +  $3.hi;
-                               $$.lo  =  $1  +  $3.lo;    }
-       |       vexp  \'\-\'  vexp
-                       {       $$.hi  =  $1.hi  \-  $3.lo;
-                               $$.lo  =  $1.lo  \-  $3.hi;    }
-       |       dexp  \'\-\'  vexp
-                       {       $$.hi  =  $1  \-  $3.lo;
-                               $$.lo  =  $1  \-  $3.hi;    }
-       |       vexp  \'*\'  vexp
-                       {       $$  =  vmul(  $1.lo,  $1.hi,  $3  );  }
-       |       dexp  \'*\'  vexp
-                       {       $$  =  vmul(  $1,  $1,  $3  );  }
-       |       vexp  \'/\'  vexp
-                       {       if(  dcheck(  $3  )  )  YYERROR;
-                               $$  =  vdiv(  $1.lo,  $1.hi,  $3  );  }
-       |       dexp  \'/\'  vexp
-                       {       if(  dcheck(  $3  )  )  YYERROR;
-                               $$  =  vdiv(  $1,  $1,  $3  );  }
-       |       \'\-\'  vexp    %prec  UMINUS
-                       {       $$.hi  =  \-$2.lo;    $$.lo  =  \-$2.hi;    }
-       |       \'(\'  vexp  \')\'
-                       {       $$  =  $2;  }
-       ;
-
-%%
-
-#  define  BSZ  50        /*  buffer  size  for  floating  point  numbers  */
-
-       /*  lexical  analysis  */
-
-yylex(){
-       register  c;
-
-       while(  (c=getchar())  ==  \' \'  ){  /*  skip  over  blanks  */  }
-
-       if(  isupper(  c  )  ){
-               yylval.ival  =  c  \-  \'A\';
-               return(  VREG  );
-               }
-       if(  islower(  c  )  ){
-               yylval.ival  =  c  \-  \'a\';
-               return(  DREG  );
-               }
-
-       if(  isdigit(  c  )  ||  c==\'.\'  ){
-               /*  gobble  up  digits,  points,  exponents  */
-
-               char  buf[BSZ+1],  *cp  =  buf;
-               int  dot  =  0,  exp  =  0;
-
-               for(  ;  (cp\-buf)<BSZ  ;  ++cp,c=getchar()  ){
-
-                       *cp  =  c;
-                       if(  isdigit(  c  )  )  continue;
-                       if(  c  ==  \'.\'  ){
-                               if(  dot++  ||  exp  )  return(  \'.\'  );    /*  will  cause  syntax  error  */
-                               continue;
-                               }
-
-                       if(  c  ==  \'e\'  ){
-                               if(  exp++  )  return(  \'e\'  );    /*  will  cause  syntax  error  */
-                               continue;
-                               }
-
-                       /*  end  of  number  */
-                       break;
-                       }
-               *cp  =  \'\e0\';
-               if(  (cp\-buf)  >=  BSZ  )  printf(  "constant  too  long:  truncated\en"  );
-               else  ungetc(  c,  stdin  );    /*  push  back  last  char  read  */
-               yylval.dval  =  atof(  buf  );
-               return(  CONST  );
-               }
-       return(  c  );
-       }
-
-INTERVAL  hilo(  a,  b,  c,  d  )  double  a,  b,  c,  d;  {
-       /*  returns  the  smallest  interval  containing  a,  b,  c,  and  d  */
-       /*  used  by  *,  /  routines  */
-       INTERVAL  v;
-
-       if(  a>b  )  {  v.hi  =  a;    v.lo  =  b;  }
-       else  {  v.hi  =  b;    v.lo  =  a;  }
-
-       if(  c>d  )  {
-               if(  c>v.hi  )  v.hi  =  c;
-               if(  d<v.lo  )  v.lo  =  d;
-               }
-       else  {
-               if(  d>v.hi  )  v.hi  =  d;
-               if(  c<v.lo  )  v.lo  =  c;
-               }
-       return(  v  );
-       }
-
-INTERVAL  vmul(  a,  b,  v  )  double  a,  b;    INTERVAL  v;  {
-       return(  hilo(  a*v.hi,  a*v.lo,  b*v.hi,  b*v.lo  )  );
-       }
-
-dcheck(  v  )  INTERVAL  v;  {
-       if(  v.hi  >=  0.  &&  v.lo  <=  0.  ){
-               printf(  "divisor  interval  contains  0.\en"  );
-               return(  1  );
-               }
-       return(  0  );
-       }
-
-INTERVAL  vdiv(  a,  b,  v  )  double  a,  b;    INTERVAL  v;  {
-       return(  hilo(  a/v.hi,  a/v.lo,  b/v.hi,  b/v.lo  )  );
-       }
-.DE
-.bp
diff --git a/.ref-Research-V7/usr/doc/yacc/ssd b/.ref-Research-V7/usr/doc/yacc/ssd
deleted file mode 100644 (file)
index ef51f13..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.SH
-Appendix D: Old Features Supported but not Encouraged
-.PP
-This Appendix mentions synonyms and features which are supported for historical
-continuity, but, for various reasons, are not encouraged.
-.IP 1.
-Literals may also be delimited by double quotes ``"''.
-.IP 2.
-Literals may be more than one character long.
-If all the characters are alphabetic, numeric, or \_, the type number of the literal is defined,
-just as if the literal did not have the quotes around it.
-Otherwise, it is difficult to find the value for such literals.
-.IP
-The use of multi-character literals is likely to mislead those unfamiliar with
-Yacc, since it suggests that Yacc is doing a job which must be actually done by the lexical analyzer.
-.IP 3.
-Most places where % is legal, backslash ``\e'' may be used.
-In particular, \e\e is the same as %%, \eleft the same as %left, etc.
-.IP 4.
-There are a number of other synonyms:
-.DS
-%< is the same as %left
-%> is the same as %right
-%binary and %2 are the same as %nonassoc
-%0 and %term are the same as %token
-%= is the same as %prec
-.DE
-.IP 5.
-Actions may also have the form
-.DS
-={ . . . }
-.DE
-and the curly braces can be dropped if the action is a
-single C statement.
-.IP 6.
-C code between %{ and %} used to be permitted at the
-head of the rules section, as well as in the
-declaration section.
diff --git a/.ref-Research-V7/usr/games/ching b/.ref-Research-V7/usr/games/ching
deleted file mode 100755 (executable)
index 8a27012..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-cd /usr/games/ching.d
-case $1 in
-       [6-9]*) set H=$1;shift;;
-esac
-if     test $H
-then   phx $H | nroff $* macros -
-else   cno | phx | nroff $* macros -
-fi
diff --git a/.ref-Research-V7/usr/games/ching.d/hexagrams b/.ref-Research-V7/usr/games/ching.d/hexagrams
deleted file mode 100644 (file)
index a41ea49..0000000
+++ /dev/null
@@ -1,2275 +0,0 @@
-.H 1 "Ch\'ien" "The Creative"
-.X 1 1
-.J
-The Creative works sublime success,
-Furthering through perseverance.
-.I
-The movement of heaven is full of power.
-Thus the superior man makes himself strong and untiring.
-.L 1 9
-Hidden dragon. Do not act.
-.L 2 9
-Dragon appearing in the field.
-It furthers one to see the great man.
-.L 3 9
-All day long the superior man is creatively active.
-At nightfall his mind is beset with cares.
-Danger. No blame.
-.L 4 9
-Wavering flight over the depths.
-No blame.
-.L 5 9 G
-Flying dragon in the heavens.
-It furthers one to see the great man.
-.L 6 9
-Arrogant dragon will have cause to repent.
-.LA 9
-There appears a flight of dragons without heads.
-Good fortune.
-.H 2 "K\'un" "The Receptive"
-.X 8 8
-.J
-The Receptive brings about sublime success,
-Furthering through the perseverance of a mare.
-If the superior man undertakes something and tries to lead,
-He goes astray;
-But if he follows, he finds guidance.
-It is favorable to find friends in the west and south,
-To forego friends in the east and north.
-Quiet perseverance brings good fortune.
-.I
-The earth's condition is receptive devotion.
-Thus the superior man who has breadth of character
-Carries the outer world.
-.L 1 6
-When there is hoarfrost underfoot,
-Solid ice is not far off.
-.L 2 6 G
-Straight, square, great.
-Without purpose,
-Yet nothing remains unfurthered.
-.L 3 6
-Hidden lines.
-One is able to remain persevering.
-If by chance you are in the service of a king,
-Seek not works, but bring to completion.
-.L 4 6
-A tied-up sack. No blame, no praise.
-.L 5 6
-A yellow lower garment brings supreme good fortune.
-.L 6 6
-Dragons fight in the meadow.
-Their blood is black and yellow.
-.LA 6
-Lasting perseverance furthers.
-.H 3 "Chun" "Difficulty at the Beginning"
-.X 6 7
-.J
-Difficulty at the Beginning works supreme success,
-Furthering through perseverance.
-Nothing should be undertaken.
-It furthers one to appoint helpers.
-.I
-Clouds and thunder:
-The image of Difficulty at the Beginning.
-Thus the superior man
-Brings order out of confusion.
-.L 1 9 G
-Hesitation and hindrance.
-It furthers one to remain persevering.
-It furthers one to appoint helpers.
-.L 2 6
-Difficulties pile up.
-Horse and wagon part.
-He is not a robber;
-He wants to woo when the time comes.
-The maiden is chaste,
-She does not pledge herself.
-Ten years\(emthen she pledges herself.
-.L 3 6
-Whoever hunts deer without the forester
-Only loses his way in the forest.
-The superior man understands the signs of the time
-And prefers to desist.
-To go on brings humiliation.
-.L 4 6
-Horse and wagon part.
-Strive for union.
-To go on brings good fortune.
-Everything acts to further.
-.L 5 9 G
-Difficulties in blessing.
-A little perseverance brings good fortune.
-Great perseverance brings misfortune.
-.L 6 6
-Horse and wagon part.
-Bloody tears flow.
-.H 4 "M\o'^e'ng" "Youthful Folly"
-.X 4 6
-.J
-Youthful Folly has success.
-It is not I who seek the young fool;
-The young fool seeks me.
-At the first oracle I inform him.
-If he asks two or three times, it is importunity.
-If he importunes, I give him no information.
-Perseverance furthers.
-.I
-A spring wells up at the foot of the mountain:
-The image of Youth.
-Thus the superior man fosters his character
-By thoroughness in all that he does.
-.L 1 6
-To make a fool develop
-It furthers one to apply discipline.
-The fetters should be removed.
-To go on in this way brings humiliation.
-.L 2 9 G
-To bear with fools in kindliness brings good fortune.
-To know how to take women
-Brings good fortune.
-The son is capable of taking charge of the household.
-.L 3 6
-Take not a maiden who, when she sees a man of bronze,
-Loses possession of herself.
-Nothing furthers.
-.L 4 6
-Entangled folly brings humiliation.
-.L 5 6 G
-Childlike folly brings good fortune.
-.L 6 9
-In punishing folly
-It does not further one
-To commit transgressions.
-The only thing that furthers
-Is to prevent transgressions.
-.H 5 "Hsu" "Waiting (Nourishment)"
-.X 6 1
-.J
-Waiting. If you are sincere,
-You have light and success.
-Perseverance brings good fortune.
-It furthers one to cross the great water.
-.I
-Clouds rise up to heaven:
-The image of Waiting.
-Thus the superior man eats and drinks,
-Is joyous and of good cheer.
-.L 1 9
-Waiting in the meadow.
-It furthers one to abide in what endures.
-No blame.
-.L 2 9
-Waiting on the sand.
-There is some gossip.
-The end brings good fortune.
-.L 2 9
-Waiting in the mud
-Brings about the arrival of the enemy.
-.L 4 6
-Waiting in blood.
-Get out of the pit.
-.L 5 9 G
-Waiting at meat and drink.
-Perseverance brings good fortune.
-.L 6 6
-One falls into the pit.
-Three uninvited guests arrive.
-Honor them, and in the end there will be good fortune.
-.H 6 "Sung" "Conflict"
-.X 1 6
-.J
-Conflict. You are sincere
-And are being obstructed.
-A cautious halt halfway brings good fortune.
-Going through to the end brings misfortune.
-It furthers one to see the great man.
-It does not further one to cross the great water.
-.I
-Heaven and water go their opposite ways:
-The image of Conflict.
-Thus in all his transactions the superior man
-Carefully considers the beginning.
-.L 1 6
-If one does not perpetuate the affair,
-There is little gossip.
-In the end, good fortune comes.
-.L 2 9
-One cannot engage in conflict;
-One returns home, gives way.
-The people of his town,
-Three hundred households,
-Remain free of guilt.
-.L 3 6
-To nourish oneself on ancient virtue induces perseverance.
-Danger. In the end, good fortune comes.
-If by chance you are in the service of a king,
-Seek not works.
-.L 4 9
-One cannot engage in conflict.
-One turns back and submits to fate,
-Changes one's attitude,
-And finds peace in perseverance.
-Good fortune.
-.L 5 9 G
-To contend before him
-Brings good fortune.
-.L 6 9
-Even if by chance a leather belt is bestowed on one,
-By the end of morning
-It will have been snatched away three times.
-.H 7 "Shih" "The Army"
-.X 8 6
-.J
-The Army. The army needs perseverance
-And a strong man.
-Good fortune without blame.
-.I
-In the middle of the earth is water:
-The image of The Army.
-Thus the superior man increases his masses
-By generosity toward the people.
-.L 1 6
-An army must set forth in proper order.
-If the order is not good, misfortune threatens.
-.L 2 9 G
-In the midst of the army.
-Good fortune. No blame.
-The king bestows a triple decoration.
-.L 3 6
-Perchance the army carries corpses in the wagon.
-Misfortune.
-.L 4 6
-The army retreats. No blame.
-.L 5 6 G
-There is game in the field.
-It furthers one to catch it.
-Without blame.
-Let the eldest lead the army.
-The younger transports corpses;
-Then perseverance brings misfortune.
-.L 6 6
-The great prince issues commands,
-Founds states, vests families with fiefs.
-Inferior people should not be employed.
-.H 8 "Pi" "Holding Together [Union]"
-.X 6 8
-.J
-Holding Together brings good fortune.
-Inquire of the oracle once again
-Whether you possess sublimity, constancy, and perseverance;
-Then there is no blame.
-Those who are uncertain gradually join.
-Whoever comes too late
-Meets with misfortune.
-.I
-On the earth is water:
-The image of Holding Together.
-Thus the kings of antiquity
-Bestowed the different states as fiefs
-And cultivated friendly relations
-With the feudal lords.
-.L 1 6
-Hold to him in truth and loyalty;
-This is without blame.
-Truth, like a full earthen bowl:
-Thus in the end
-Good fortune comes from without.
-.L 2 6
-Hold to him inwardly.
-Perseverance brings good fortune.
-.L 3 6
-You hold together with the wrong people.
-.L 4 6
-Hold to him outwardly also.
-Perseverance brings good fortune.
-.L 5 9 G
-Manifestation of holding together.
-In the hunt the king uses beaters on three sides only
-And foregoes game that runs off in front.
-The citizens need no warning.
-Good fortune.
-.L 6 6
-He finds no head for holding together.
-Misfortune.
-.H 9 "Hsiao Ch\'u" "The Taming Power of the Small"
-.X 2 1
-.J
-The Taming Power of the Small
-Has success.
-Dense clouds, no rain from our western region.
-.I
-The wind drives across heaven:
-The image of The Taming Power of the Small.
-Thus the superior man
-Refines the outward aspect of his nature.
-.L 1 9
-Return to the way.
-How could there be blame in this?
-Good fortune.
-.L 2 9
-He allows himself to be drawn into returning.
-Good fortune.
-.L 3 9
-The spokes burst out of the wagon wheel.
-Man and wife roll their eyes.
-.L 4 6 C
-If you are sincere, blood vanishes and fear gives way.
-No blame.
-.L 5 9 G
-If you are sincere and loyally attached,
-You are rich in your neighbor.
-.L 6 9
-The rain comes, there is rest.
-This is due to the lasting affect of character.
-Perseverance brings the woman into danger.
-The moon is nearly full.
-If the superior man persists,
-Misfortune comes.
-.H 10 "Lu" "Treading [Conduct]"
-.X 1 5
-.J
-Treading. Treading upon the tail of the tiger.
-It does not bite the man. Success.
-.I
-Heaven above, the lake below:
-The image of Treading.
-Thus the superior man discriminates between high and low,
-And thereby fortifies the thinking of the people.
-.L 1 9
-Simple conduct. Progress without blame.
-.L 2 9
-Treading a smooth, level course.
-The perseverance of a dark man
-Brings good fortune.
-.L 3 6 C
-A one-eyed man is able to see,
-A lame man is able to tread.
-He treads on the tail of the tiger.
-The tiger bites the man.
-Misfortune.
-Thus does a warrior act on behalf of his great prince.
-.L 4 9
-He treads on the tail of the tiger.
-Caution and circumspection
-Lead ultimately to good fortune.
-.L 5 9 G
-Resolute conduct.
-Perseverance with awareness of danger.
-.L 6 9
-Look to your conduct and weigh the favorable signs.
-When everything is fulfilled, supreme good fortune comes.
-.H 11 "T\'ai" "Peace"
-.X 8 1
-.J
-Peace. The small departs,
-The great approaches.
-Good fortune. Success.
-.I
-Heaven and earth unite: the image of Peace.
-Thus the ruler
-Divides and completes the course of heaven and earth;
-He furthers and regulates the gifts of heaven and earth,
-And so aids the people.
-.L 1 9
-When ribbon grass is pulled up, the sod comes with it.
-Each according to his kind.
-Undertakings bring good fortune.
-.L 2 9 G
-Bearing with the uncultured in gentleness,
-Fording the river with resolution,
-Not neglecting what is distant,
-Not regarding one's companions:
-Thus one may manage to walk in the middle.
-.L 3 9
-No plain not followed by a slope.
-No going not followed by a return.
-He who remains persevering in danger
-Is without blame.
-Do not complain about this truth;
-Enjoy the good fortune you still possess.
-.L 4 6
-He flutters down, not boasting of his wealth,
-Together with his neighbor,
-Guileless and sincere.
-.L 5 6 G
-The sovereign I
-Gives his daughter in marriage.
-This brings blessing
-And supreme good fortune.
-.L 6 6
-The wall falls back into the moat.
-Use no army now.
-Make your commands known within your own town.
-Perseverance brings humiliation.
-.H 12 "P\'i" "Standstill [Stagnation]"
-.X 1 8
-.J
-Standstill. Evil people do not further
-The perseverance of the superior man.
-The great departs; the small approaches.
-.I
-Heaven and earth do not unite:
-The image of Standstill.
-Thus the superior man falls back upon his inner worth
-In order to escape the difficulties.
-He does not permit himself to be honored with revenue.
-.L 1 6
-When the ribbon grass is pulled up, the sod comes with it.
-Each according to his kind.
-Perseverance brings good fortune and success.
-.L 2 6 C
-They bear and endure;
-This means good fortune for inferior people.
-The standstill serves to help the great man attain success.
-.L 3 6
-They bear shame.
-.L 4 9
-He who acts at the command of the highest
-Remains without blame.
-Those of like mind partake of the blessing.
-.L 5 9 G
-Standstill is giving way.
-Good fortune for the great man.
-"What if it should fail, what if it should fail?"
-In this way, he ties it to a cluster of mulberry shoots.
-.L 6 9
-The standstill comes to an end.
-First standstill, then good fortune.
-.H 13 "T\'ung J\o'^e'n" "Fellowship with Men"
-.X 1 3
-.J
-Fellowship with Men in the open.
-Success.
-It furthers one to cross the great water.
-The perseverance of the superior man furthers.
-.I
-Heaven together with fire:
-The image of Fellowship with Men.
-Thus the superior man organizes the clans
-And makes distinctions between things.
-.L 1 9
-Fellowship with men at the gate.
-No blame.
-.L 2 6 G
-Fellowship with men in the clan.
-Humiliation.
-.L 3 9
-He hides weapons in the thicket;
-He climbs the high hill in front of it.
-For three years he does not rise up.
-.L 4 9
-He climbs up on his wall; he cannot attack.
-Good fortune.
-.L 5 9 G
-Men bound in fellowship first weep and lament,
-But afterward the laugh.
-After great struggles they succeed in meeting.
-.L 6 9
-Fellowship with men in the meadow.
-No remorse.
-.H 14 "Ta Yu" "Possession in Great Measure"
-.X 3 1
-.J
-Possession in Great Measure.
-Supreme success.
-.I
-Fire in heaven above:
-The image of Possession in Great Measure.
-Thus the superior man curbs evil and furthers good,
-And thereby obeys the benevolent will of heaven.
-.L 1 9
-No relationship with what is harmful;
-There is no blame in this.
-If one remains conscious of difficulty,
-One remains without blame.
-.L 2 9
-A big wagon for loading.
-One may undertake something.
-No blame.
-.L 3 9
-A prince offers it to the Son of Heaven.
-A petty man cannot do this.
-.L 4 9
-He makes a difference
-Between himself and his neighbor.
-No blame.
-.L 5 6 G
-He whose truth is accessible, yet dignified,
-Has good fortune.
-.L 5 9
-He is blessed by heaven.
-Good fortune.
-Nothing that does not further.
-.H 15 "Ch\'ien" "Modesty"
-.X 8 4
-.J
-Modesty creates success.
-The superior man carries things through.
-.I
-Within the earth, a mountain:
-The image of Modesty.
-Thus the superior man reduces that which is too much,
-And augments that which is too little.
-He weighs things and makes them equal.
-.L 1 6
-A superior man modest about his modesty
-May cross the great water.
-Good fortune.
-.L 2 6
-Modesty that comes to expression.
-Perseverance brings good fortune.
-.L 3 9 G
-A superior man of modesty and merit
-Carries things to conclusion.
-Good fortune.
-.L 4 6
-Nothing that would not further modesty
-In movement.
-.L 5 6
-No boasting of wealth before one's neighbor.
-It is favorable to attack with force.
-Nothing that would not further.
-.L 6 6
-Modesty that comes to expression.
-It is favorable to set armies marching
-To chastise one's own city and one's country.
-.H 16 "Yu" "Enthusiasm"
-.X 7 8
-.J
-Enthusiasm. It furthers one to install helpers
-And to set armies marching.
-.I
-Thunder comes resounding out of the earth:
-The image of Enthusiasm.
-Thus the ancient kings made music
-In order to honor merit,
-And offered it with splendor
-To the Supreme Deity,
-Inviting their ancestors to be present.
-.L 1 6
-Enthusiasm that expresses itself
-Brings misfortune.
-.L 2 6
-Firm as a rock. Not a whole day.
-Perseverance brings good fortune.
-.L 3 6
-Enthusiasm that looks upward creates remorse.
-Hesitation brings remorse.
-.L 4 9 G
-The source of enthusiasm.
-He achieves great things.
-Doubt not.
-You gather friends around you
-As a hair clasp gathers the hair.
-.L 5 6
-Persistently ill, and still does not die.
-.L 6 6
-Deluded enthusiasm.
-But if after completion one changes,
-There is no blame.
-.H 17 "Sui" "Following"
-.X 5 7
-.J
-Following has supreme success.
-Perseverance furthers. No blame.
-.I
-Thunder in the middle of the lake:
-The image of Following.
-Thus the superior man at nightfall
-Goes indoors for rest and recuperation.
-.L 1 9 G
-The standard is changing.
-Perseverance brings good fortune.
-To go out of the door in company
-Produces deeds.
-.L 2 6
-If one clings to the little boy,
-One loses the strong man.
-.L 3 6
-If one clings to the strong man,
-One loses the little boy.
-Through following one finds what one seeks.
-It furthers one to remain persevering.
-.L 4 9
-Following creates success.
-Perseverance brings misfortune.
-To go one's own way with sincerity brings clarity.
-How could there be blame in this?
-.L 5 9 G
-Sincere in the good. Good fortune.
-.L 6 6
-He meets with firm allegiance
-And is still further bound.
-The king introduces him
-To the Western Mountain.
-.H 18 "Ku" "Work on What Has Been Spoiled [Decay]"
-.X 4 2
-.J
-Work on What Has Been Spoiled
-Has supreme success.
-It furthers one to cross the great water.
-Before the starting point, three days.
-After the starting point, three days.
-.I
-The wind blows low on the mountain:
-The image of Decay.
-Thus the superior man stirs up the people
-And strengthens their spirit.
-.L 1 6
-Setting right what has been spoiled by the father.
-If there is a son,
-No blame rests upon the departed father.
-Danger. In the end good fortune.
-.L 2 9
-Setting right what has been spoiled by the mother.
-One must not be too persevering.
-.L 3 9
-Setting right what has been spoiled by the father.
-There will be little remorse. No great blame.
-.L 4 6
-Tolerating what has been spoiled by the father.
-In continuing one sees humiliation.
-.L 5 6 G
-Setting right what has been spoiled by the father.
-One meets with praise.
-.L 6 9
-He does not serve kings and princes,
-Sets himself higher goals.
-.H 19 "Lin" "Approach"
-.X 8 5
-.J
-Approach has supreme success.
-Perseverance furthers.
-When the eight month comes,
-There will be misfortune.
-.I
-The earth above the lake:
-The image of Approach.
-Thus the superior man is inexhaustible
-In his will to teach,
-And without limits
-In his tolerance and protection of the people.
-.L 1 9 G
-Joint approach.
-Perseverance brings good fortune.
-.L 2 9 G
-Joint approach.
-Good fortune.
-Everything furthers.
-.L 3 6
-Comfortable approach.
-Nothing that would not further.
-If one is induced to grieve over it,
-One becomes free of blame.
-.L 4 6
-Complete approach.
-No blame.
-.L 5 6
-Wise approach.
-This is right for a great prince.
-Good fortune.
-.L 6 6
-Greathearted approach.
-Good fortune. No blame.
-.H 20 "Kuan" "Contemplation (View)"
-.X 2 8
-.J
-Contemplation. The ablution has been made,
-But not yet the offering.
-Full of trust they look up to him.
-.I
-The wind blows over the earth:
-The image of Contemplation.
-Thus the kings of old visited the regions of the world,
-Contemplated the people,
-And gave them instruction.
-.L 1 6
-Boylike contemplation.
-For an inferior man, no blame.
-For a superior man, humiliation.
-.L 2 6
-Contemplation through the crack of the door.
-Furthering for the perseverance of a woman.
-.L 3 6
-Contemplation of my life
-Decides the choice
-Between advance and retreat.
-.L 4 6
-Contemplation of the light of the kingdom.
-It furthers one to exert influence as the guest of a king.
-.L 5 9 G
-Contemplation of my life.
-The superior man is without blame.
-.L 6 9 G
-Contemplation of his life.
-The superior man is without blame.
-.H 21 "Shih Ho" "Biting Through"
-.X 3 7
-.J
-Biting Through has success.
-It is favorable to let justice be administered.
-.I
-Thunder and lightning:
-The image of Biting Through.
-Thus the kings of former times made firm the laws
-Through clearly defined penalties.
-.L 1 9
-His feet are fastened in the stocks,
-So that his toes disappear.
-No blame.
-.L 2 6
-Bites through tender meat,
-So that his nose disappears.
-No blame.
-.L 3 6
-Bites on old dried meat
-And strikes on something poisonous.
-Slight humiliation. No blame.
-.L 4 9
-Bites on dried gristly meat.
-Receives metal arrows.
-It furthers one to be mindful of difficulties
-And to be persevering.
-Good fortune.
-.L 5 6 G
-Bites on dried lean meat.
-Receives yellow gold.
-Perseveringly aware of danger.
-No blame.
-.L 6 9
-His neck is fastened in the wooden cangue,
-So that his ears disappear.
-Misfortune.
-.H 22 "Pi" "Grace"
-.X 4 3
-.J
-Grace has success.
-In small matters
-It is favorable to undertake something.
-.I
-Fire at the foot of the mountain:
-The image of Grace.
-Thus does the superior man proceed
-When clearing up current affairs.
-But he dare not decide controversial issues in this way.
-.L 1 9
-He lends grace to his toes, leaves the carriage, and walks.
-.L 2 6 G
-Lends grace to the beard on his chin.
-.L 3 9
-Graceful and moist.
-Constant perseverance brings good fortune.
-.L 4 6
-Grace or simplicity?
-A white horse comes as if on wings.
-He is not a robber,
-He will woo at the right time.
-.L 5 6
-Grace in the hills and gardens.
-The roll of silk is meager and small.
-Humiliation, but in the end good fortune.
-.L 6 9 G
-Simple grace. No blame.
-.H 23 "Po" "Splitting Apart"
-.X 4 8
-.J
-Splitting Apart. It does not further one
-To go anywhere.
-.I
-The mountain rests upon the earth:
-The image of Splitting Apart.
-Thus those above can insure their position
-Only by giving generously to those below.
-.L 1 6
-The leg of the bed is split.
-Those who persevere are destroyed.
-Misfortune.
-.L 2 6
-The bed is split at the edge.
-Those who persevere are destroyed.
-Misfortune.
-.L 3 6
-He splits with them. No blame.
-.L 4 6
-The bed is split up to the skin.
-Misfortune.
-.L 5 6
-A shoal of fishes. Favor comes through the court ladies.
-Everything acts to further.
-.L 6 9 G
-There is a large fruit still uneaten.
-The superior man receives a carriage.
-The house of the inferior man is split apart.
-.H 24 "Fu" "Return (The Turning Point)"
-.X 8 7
-.J
-Return. Success.
-Going out and coming in without error.
-Friends come without blame.
-To and Fro goes the way.
-On the seventh day comes return.
-It furthers one to have somewhere to go.
-.I
-Thunder within the earth:
-The image of The Turning Point.
-Thus the kings of antiquity closed the passes
-At the time of solstice.
-Merchants and strangers did not go about,
-And the ruler
-Did not travel through the provinces.
-.L 1 9 G
-Return from a short distance.
-No need for remorse.
-Great good fortune.
-.L 2 6
-Quiet return. Good fortune.
-.L 3 6
-Repeated return. Danger. No blame.
-.L 4 6
-Walking in the midst of others,
-One returns alone.
-.L 5 6
-Noblehearted return.
-No remorse.
-.L 6 6
-Missing the return. Misfortune.
-Misfortune from within and without.
-If armies are set marching in this way,
-One will in the end suffer a great defeat,
-Disastrous for the ruler of the country.
-For ten years
-It will not be possible to attack again.
-.H 25 "Wu Wang" "Innocence (The Unexpected)"
-.X 1 7
-.J
-Innocence. Supreme success.
-Perseverance furthers.
-If someone is not as he should be,
-He has misfortune,
-And it does not further him
-To undertake something.
-.I
-Under heaven thunder rolls:
-All things attain the natural state of innocence.
-Thus the kings of old,
-Rich in virtue, and in harmony with the time,
-Fostered and nourished all beings.
-.L 1 9 G
-Innocent behavior brings good fortune.
-.L 2 6
-If one does not count on the harvest while plowing,
-Nor on the use of the ground while clearing it,
-It furthers one to undertake something.
-.L 3 6
-Undeserved misfortune.
-The cow that was tethered by someone
-Is the wanderer's gain, the citizen's loss.
-.L 4 9
-He who can be persevering
-Remains without blame.
-.L 5 9 G
-Use no medicine in an illness
-Incurred through no fault of your own.
-It will pass of itself.
-.L 6 9
-Innocent action brings misfortune.
-Nothing furthers.
-.H 26 "Ta Ch\'u" "The Taming Power of the Great"
-.X 4 1
-.J
-The Taming Power of the Great.
-Perseverance furthers.
-Not eating at home brings good fortune.
-It furthers one to cross the great water.
-.I
-Heaven within the mountain:
-The image of The Taming Power of the Small.
-Thus the superior man aquaints himself with many sayings of antiquity
-And many deeds of the past,
-In order to strengthen his character thereby.
-.L 1 9
-Danger is at hand. It furthers one to desist.
-.L 2 9
-The axletrees are taken from the wagon.
-.L 3 9
-A good horse that follows others.
-Awareness of danger,
-With perseverance, furthers.
-Practice chariot driving and armed defense daily.
-It furthers one to have somewhere to go.
-.L 4 6
-The headboard of a young bull.
-Great good fortune.
-.L 5 6 G
-The tusk of a gelded boar.
-Good fortune.
-.L 6 9 G
-One attains the way of heaven. Success.
-.H 27 "I" "The Corners of the Mouth (Providing Nourishment)"
-.X 4 7
-.J
-The Corners of the Mouth.
-Perseverance brings good fortune.
-Pay heed to the providing of nourishment.
-And to what a man seeks
-To fill his own mouth with.
-.I
-At the foot of the mountain, thunder:
-The image of Providing Nourishment.
-Thus the superior man is careful of his words
-And temperate in eating and drinking.
-.L 1 9
-You let your magic tortoise go,
-And look at me with the corners of your mouth drooping.
-Misfortune.
-.L 2 6
-Turning to the summit for nourishment,
-Deviating from the path
-To seek nourishment from the hill.
-Continuing to do this brings misfortune.
-.L 3 6
-Turning away from nourishment.
-Perseverance brings misfortune.
-Do not act thus for ten years.
-Nothing serves to further.
-.L 4 6
-Turning to the summit
-For provision of nourishment
-Brings good fortune.
-Spying about with sharp eyes
-Like a tiger with insatiable craving.
-No blame.
-.L 5 6 G
-Turning away from the path.
-To remain persevering brings good fortune.
-One should not cross the great water.
-.L 6 9 G
-The source of nourishment.
-Awareness of danger brings good fortune.
-It furthers one to cross the great water.
-.H 28 "Ta Kuo" "Preponderance of the Great"
-.X 5 2
-.J
-Preponderance of the Great.
-The ridgepole sags to the breaking point.
-It furthers one to have somewhere to go.
-Success.
-.I
-The lake rises above the trees:
-The image of Preponderance of the Great.
-Thus the superior man, when he stands alone,
-Is unconcerned,
-And if he has to renounce the world,
-He is undaunted.
-.L 1 6
-To spread white rushes underneath.
-No blame.
-.L 2 9 G
-A dry poplar sprouts at the root.
-An older man takes a young wife.
-Everything furthers.
-.L 3 9
-The ridgepole sags to the breaking point.
-Misfortune.
-.L 4 9 G
-The ridgepole is braced. Good fortune.
-If there are ulterior motives, it is humiliating.
-.L 5 9
-A withered poplar puts forth flowers.
-An older woman takes a husband.
-No blame. No praise.
-.L 6 6
-One must go through the water.
-It goes over one's head.
-Misfortune. No blame.
-.H 29 "K\'an" "The Abysmal (Water)"
-.X 6 6
-.J
-The Abysmal repeated.
-If you are sincere, you have success in your heart,
-And whatever you do succeeds.
-.I
-Water flows on uninterruptedly and reaches it goal:
-The image of the Abysmal repeated.
-Thus the superior man walks in lasting virtue
-And carries on the business of teaching.
-.L 1 6
-Repetition of the Abysmal.
-In the abyss one falls into a pit.
-Misfortune.
-.L 2 9 G
-The abyss is dangerous.
-One should strive to attain small things only.
-.L 3 6
-Forward and backward, abyss on abyss.
-In danger like this, pause at first and wait,
-Otherwise you will fall into a pit in the abyss.
-Do not act in this way.
-.L 4 6
-A jug of wine, a bowl of rice with it;
-Earthen vessels
-Simply handed in through the window.
-There is certainly no blame in this.
-.L 5 9 G
-The abyss is not filled to overflowing,
-It is filled only to the rim.
-No blame.
-.L 6 6
-Bound with cords and ropes,
-Shut in between thorn-hedged prison walls:
-For three years one does not find the way.
-Misfortune.
-.H 30 "Li" "The Clinging, Fire"
-.X 3 3
-.J
-The Clinging. Perseverance furthers.
-It brings success.
-Care of the cow brings good fortune.
-.I
-That which is bright rises twice:
-The image of Fire.
-Thus the great man, by perpetuating this brightness,
-Illumines the four quarters of the world.
-.L 1 9
-The footprints run crisscross.
-If one is seriously intent, no blame.
-.L 2 6 G
-Yellow light. Supreme good fortune.
-.L 3 9
-In the light of the setting sun,
-Men either beat the pot and sing
-Or loudly bewail the approach of old age.
-Misfortune.
-.L 4 9
-Its coming is sudden;
-It flames up, dies down, is thrown away.
-.L 5 6 G
-Tears in floods, sighing and lamenting.
-Good fortune.
-.L 6 9
-The king uses him to march forth and chastise.
-Then it is best to kill the leaders
-And take captive the followers. No blame.
-.H 31 "Hsien" "Influence (Wooing)"
-.X 5 4
-.J
-Influence. Success.
-Perseverance furthers.
-To take a maiden to wife brings good fortune.
-.I
-A lake on the mountain:
-The image of Influence.
-Thus the superior man encourages people to approach him
-By his readiness to receive them.
-.L 1 6
-The influence shows itself in the big toe.
-.L 2 6
-The influence shows itself in the calves of the legs.
-Misfortune.
-Tarrying brings good fortune.
-.L 3 9
-The influence shows itself in the thighs.
-Holds to that which follows it.
-To continue is humiliating.
-.L 4 9 G
-Perseverance brings good fortune.
-Remorse disappears.
-If a man is agitated in mind,
-And his thoughts go hither and thither,
-Only those friends
-On whom he fixes his conscious thoughts
-Will follow.
-.L 5 9 G
-The influence shows itself in the back of the neck.
-No remorse.
-.L 6 6
-The influence shows itself in the jaws, cheeks and tongue.
-.H 32 "H\o'^e'ng" "Duration"
-.X 7 2
-.J
-Duration. Success. No blame.
-Perseverance furthers.
-It furthers one to have somewhere to go.
-.I
-Thunder and wind: the image of Duration.
-Thus the superior man stands firm
-And does not change his direction.
-.L 1 6
-Seeking duration too hastily brings misfortune persistently.
-Nothing that would further.
-.L 2 9 G
-Remorse disappears.
-.L 3 9
-He who does not give duration to his character
-Meets with disgrace.
-Persistent humiliation.
-.L 4 9
-No game in the field.
-.L 5 6
-Giving duration to one's character through perseverance.
-This is good fortune for a woman, misfortune for a man.
-.L 6 6
-Restlessness as an enduring condition brings misfortune.
-.H 33 "Tun" "Retreat"
-.X 1 4
-.J
-Retreat. Success.
-In what is small, perseverance furthers.
-.I
-Mountain under heaven: the image of Retreat.
-Thus the superior man keeps the inferior man at a distance,
-Not angrily but with reserve.
-.L 1 6 C
-At the tail in retreat. This is dangerous.
-One must not wish to undertake anything.
-.L 2 6
-He holds him fast with yellow oxhide.
-No one can tear him loose.
-.L 3 9
-A halted retreat
-Is nerve-wracking and dangerous.
-To retain people as men- and maidservants
-Brings good fortune.
-.L 4 9
-Voluntary retreat brings good fortune to the superior man
-And downfall to the inferior man.
-.L 5 9 G
-Friendly retreat. Perseverance brings good fortune.
-.L 6 9
-Cheerful retreat. Everything serves to further.
-.H 34 "Ta Chuang" "The Power of the Great"
-.X 7 1
-.J
-The Power of the Great. Perseverance furthers.
-.I
-Thunder in heaven above:
-The image of The Power of the Great.
-Thus the superior man does not tread upon paths
-That do not accord with established order.
-.L 1 9
-Power in the toes.
-Continuing brings misfortune.
-This is certainly true.
-.L 2 9
-Perseverance brings good fortune.
-.L 3 9
-The inferior man works through power.
-The superior man does not act thus.
-To continue is dangerous.
-A goat butts against a hedge
-And gets its horns entangled.
-.L 4 9 G
-Perseverance brings good fortune.
-Remorse disappears.
-The hedge opens; there is no entanglement.
-Power depends upon the axle of a big cart.
-.L 5 6
-Loses the goat with ease.
-No remorse.
-.L 6 6
-A goat butts against a hedge.
-It cannot go backward, it cannot go forward.
-Nothing serves to further.
-If one notes the difficulty, this brings good fortune.
-.H 35 "Chin" "Progress"
-.X 3 8
-.J
-Progress. The powerful prince
-Is honored with horses in large numbers.
-In a single day he is granted audience three times.
-.I
-The sun rises over the earth:
-The image of Progress.
-Thus the superior man himself
-Brightens his bright virtue
-.L 1 6
-Progressing, but turning back.
-Perseverance brings good fortune.
-If one meets with no confidence, one should remain calm.
-No mistake.
-.L 2 6
-Progressing, but in sorrow.
-Perseverance brings good fortune.
-Then one obtains happiness from one's ancestress.
-.L 3 6
-All are in accord. Remorse disappears.
-.L 4 9
-Progress like a hamster.
-Perseverance brings danger.
-.L 5 6 G
-Remorse disappears.
-Take not gain and loss to heart.
-Undertakings bring good fortune.
-Everything serves to further.
-.L 6 9
-Making progress with the horns is permissible
-Only for the purpose of punishing one's own city.
-To be conscious of danger brings good fortune.
-No blame.
-Perseverance brings humiliation.
-.H 36 "Ming I" "Darkening of the Light"
-.X 8 3
-.J
-Darkening of the Light. In adversity
-It furthers one to be persevering.
-.I
-The light has sunk into the earth:
-The image of Darkening of the Light.
-Thus does the superior man live with the great mass:
-He veils his light, yet still shines.
-.L 1 9
-Darkening of the light during flight.
-He lowers his wings.
-The superior man does not eat for three days
-On his wanderings.
-But he has somewhere to go.
-The host has occasion to gossip about him.
-.L 2 6 G
-Darkening of the light injures him in the left thigh.
-He gives aid with the strength of a horse.
-Good fortune.
-.L 3 9
-Darkening of the light during the hunt in the south.
-Their great leader is captured.
-One must not expect perseverance too soon.
-.L 4 6
-He penetrates the left side of the belly.
-One gets at the very heart of the darkening of the light,
-And leaves gate and courtyard.
-.L 5 6 G
-Darkening of the light as with Prince Chi.
-Perseverance furthers.
-.L 6 6 C
-Not light but darkness.
-First he climbed up to heaven,
-Then he plunged into the depths of the earth.
-.H 37 "Chia J\o'^e'n" "The Family [The Clan]"
-.X 2 3
-.J
-The Family. The perseverance of the woman furthers.
-.I
-Wind comes forth from fire:
-The image of The Family.
-Thus the superior man has substance in his words
-And duration in his way of life.
-.L 1 9
-Firm seclusion within the family.
-Remorse disappears.
-.L 2 6 G
-She should not follow her whims.
-She must attend within to the food.
-Perseverance brings good fortune.
-.L 3 9
-When tempers flare up in the family,
-Too great severity brings remorse.
-Good fortune nonetheless.
-When woman and child dally and laugh,
-It leads in the end to humiliation.
-.L 4 6
-She is the treasure of the house.
-Great good fortune.
-.L 5 9 G
-As a king he approaches his family.
-Fear not.
-Good fortune.
-.L 6 9
-His work commands respect.
-In the end good fortune comes.
-.H 38 "K\'uei" "Opposition"
-.X 3 5
-.J
-Opposition. In small matters, good fortune.
-.I
-Above fire; below, the lake:
-The image of Opposition.
-Thus amid all fellowship
-The superior man retains his individuality.
-.L 1 9
-Remorse disappears.
-If you lose your horse, do not run after it;
-It will come back of its own accord.
-When you see evil people,
-Guard yourself against mistakes.
-.L 2 9 G
-One meets his lord in a narrow street.
-No blame.
-.L 3 6
-One sees the wagon dragged back,
-The oxen halted,
-A man's hair and nose cut off.
-Not a good beginning, but a good end.
-.L 4 9
-Isolated through opposition,
-One meets a like-minded man
-With whom one can associate in good faith.
-Despite the danger, no blame.
-.L 5 6 G
-Remorse disappears.
-The companion bites his way through the wrappings.
-If one goes to him,
-How could it be a mistake?
-.L 6 9
-Isolated through opposition,
-One sees one's companion as a pig covered with dirt,
-As a wagon full of devils.
-First one draws a bow against him,
-Then one lays the bow aside.
-He is not a robber; he will woo at the right time.
-As one goes, rain falls; then good fortune comes.
-.H 39 "Chien" "Obstruction"
-.X 6 4
-.J
-Obstruction. The southwest furthers.
-The northeast does not further.
-It furthers one to see the great man.
-Perseverance brings good fortune.
-.I
-Water on the mountain:
-The image of Obstruction.
-Thus the superior man turns his attention to himself
-And molds his character.
-.L 1 6
-Going leads to obstructions,
-Coming meets with praise.
-.L 2 6
-The king's servant is beset by obstruction upon obstruction,
-But it is not his own fault.
-.L 3 9
-Going leads to obstructions;
-Hence he comes back.
-.L 4 6
-Going leads to obstructions,
-Coming leads to union.
-.L 5 9 G
-In the midst of the greatest obstructions,
-Friends come.
-.L 6 6
-Going leads to obstructions,
-Coming leads to great good fortune.
-It furthers one to see the great man.
-.H 40 "Hsieh" "Deliverance"
-.X 7 6
-.J
-Deliverance. The southwest furthers.
-If there is no longer anything where one has to go,
-Return brings good fortune.
-If there is still something where one has to go,
-Hastening brings good fortune.
-.I
-Thunder and rain set in:
-The image of Deliverance.
-Thus the superior man pardons mistakes
-And forgives misdeeds.
-.L 1 6
-Without blame.
-.L 2 9 G
-One kills three foxes in the field
-And receives a yellow arrow.
-Perseverance brings good fortune.
-.L 3 6
-If a man carries a burden on his back
-And nontheless rides in a carriage,
-He thereby encourages robbers to draw near.
-Perseverance leads to humiliation.
-.L 4 9
-Deliver yourself from your great toe.
-Then the companion comes,
-And him you can trust.
-.L 6 5 G
-If only the superior man can deliver himself,
-It brings good fortune.
-Thus he proves to inferior men that he is in earnest.
-.L 6 6
-The prince shoots at a hawk on a high wall.
-He kills it. Everything serves to further.
-.H 41 "Sun" "Decrease"
-.X 4 5
-.J
-Decrease combined with sincerity
-Brings about supreme good fortune
-Without blame.
-One may be persevering in this.
-It furthers one to undertake something.
-How is this to be carried out?
-One may use two small bowls for the sacrifice.
-.I
-At the foot of the mountain, the lake:
-The image of Decrease.
-Thus the superior man controls his anger
-And restrains his instincts.
-.L 1 9
-Going quickly when one's tasks are finished
-Is without blame.
-But one must reflect on how much one may decrease others.
-.L 2 9
-Perseverance furthers.
-To undertake something brings misfortune.
-Without decreasing oneself,
-One is able to bring increase to others.
-.L 3 6 C
-When three people journey together,
-Their number decreases by one.
-When one man journeys alone,
-He finds a companion.
-.L 4 6
-If a man decreases his faults,
-It makes the other hasten to come and rejoice.
-No blame.
-.L 5 6 G
-Someone does indeed increase him.
-Ten pairs of tortoises cannot oppose it.
-Supreme good fortune.
-.L 6 9 C
-If one is increased without depriving others,
-there is no blame.
-Perseverance brings good fortune.
-It furthers one to undertake something.
-One obtains servants
-But no longer has a separate home.
-.H 42 "I" "Increase"
-.X 2 7
-.J
-Increase. It furthers one
-To undertake something.
-It furthers one to cross the great water.
-.I
-Wind and thunder: the image of Increase.
-Thus the superior man:
-If he sees good, he imitates it;
-If he has faults, he rids himself of them.
-.L 1 9 C
-It furthers one to accomplish great deeds.
-Supreme good fortune. No blame.
-.L 2 6 G
-Someone does indeed increase him;
-Ten pairs of tortoises cannot oppose it.
-Constant perseverance brings good fortune.
-The king presents him before God.
-Good fortune.
-.L 3 6
-One is enriched through unfortunate events.
-No blame, if you are sincere
-And walk in the middle,
-And report with a seal to the prince.
-.L 4 6 C
-If you walk in the middle
-And report to the prince,
-He will follow.
-It furthers one to be used
-In the removal of the capital.
-.L 5 9 G
-If in truth you have a kind heart, ask not.
-Supreme good fortune.
-Truly, kindness will be recognized as your virtue.
-.L 6 9
-He brings increase to no one.
-Indeed, someone even strikes him.
-He does not keep his heart constantly steady.
-Misfortune.
-.H 43 "Kuai" "Break-through (Resoluteness)"
-.X 5 1
-.J
-Break-through. One must resolutely make the matter known
-At the court of the king.
-It must be announced truthfully. Danger.
-It is necessary to notify one's own city.
-It does not further to resort to arms.
-It furthers one to undertake something.
-.I
-The lake has risen up to heaven:
-The image of Break-through.
-Thus the superior man
-Dispenses riches downward
-And refrains from resting on his virtue.
-.L 1 9
-Mighty in the forward-striding toes.
-When one goes and is not equal to the task,
-One makes a mistake.
-.L 2 9
-A cry of alarm. Arms at evening and at night.
-Fear nothing.
-.L 3 9
-To be powerful in the cheekbones
-Brings misfortune.
-The superior man is firmly resolved.
-He walks alone and is caught in the rain.
-He is bespattered,
-And people murmur against him.
-No blame.
-.L 4 9
-There is no skin on his thighs,
-And walking comes hard.
-If a man were to let himself be led like a sheep,
-Remorse would disappear.
-But if these words are heard
-They will not be believed.
-.L 5 9 G
-In dealing with weeds,
-Firm resolution is necessary.
-Walking in the middle
-Remains free of blame.
-.L 6 6 C
-No cry.
-In the end misfortune comes.
-.H 44 "Kou" "Coming to Meet"
-.X 1 2
-.J
-Coming to Meet. The maiden is powerful.
-One should not marry such a maiden.
-.I
-Under heaven, wind:
-The image of Coming to Meet.
-Thus does the prince act when disseminating his commands
-And proclaiming them to the four quarters of heaven.
-.L 1 6 C
-It must be checked with a brake of bronze.
-Perseverance brings good fortune.
-If one lets it take its course, one experiences misfortune.
-Even a lean pig has it in him to rage around.
-.L 2 9 G
-There is a fish in the tank. No blame.
-Does not further guests.
-.L 3 9
-There is no skin on his thighs,
-And walking comes hard.
-If one is mindful of the danger,
-No great mistake is made.
-.L 4 9
-No fish in the tank.
-This leads to misfortune.
-.L 5 9 G
-A melon covered with willow leaves.
-Hidden lines.
-Then it drops down to one from heaven.
-.L 6 9
-He comes to meet with his horns.
-Humiliation. No blame.
-.H 45 "Ts\'ui" "Gathering Together [Massing]"
-.X 5 8
-.J
-Gathering Together. Success.
-The king approaches his temple.
-It furthers one to see the great man.
-This brings success. Perseverance furthers.
-To bring great offerings creates good fortune.
-It furthers one to undertake something.
-.I
-Over the earth, the lake:
-The image of Gathering Together.
-Thus the superior man renews his weapons
-In order to meet the unforseen.
-.L 1 6
-If you are sincere, but not to the end,
-There will sometimes be confusion, sometimes gathering together.
-If you call out,
-Then after one grasp of the hand you can laugh again.
-Regret not. Going is without blame.
-.L 2 6
-Letting oneself be drawn
-Brings good fortune and remains blameless.
-If one is sincere,
-It furthers one to bring even a small offering.
-.L 3 6
-Gathering together amid sighs.
-Nothing that would not further.
-Going is without blame.
-Slight humiliation.
-.L 4 9 G
-Great good fortune. No blame.
-.L 5 9 G
-If in gathering together one has position,
-This brings no blame.
-If there are some who are not yet sincere in the work,
-Sublime and enduring perseverance is needed.
-Then remorse disappears.
-.L 6 6
-Lamenting and sighing, floods of tears.
-No blame.
-.H 46 "Sh\o'^e'ng" "Pushing Upward"
-.X 8 2
-.J
-Pushing upward has supreme success.
-One must see the great man.
-Fear not.
-Departure toward the south
-Brings good fortune.
-.I
-Within the earth, wood grows:
-The image of Pushing Upward.
-Thus the superior man of devoted character
-Heaps up small things
-In order to achieve something high and great.
-.L 1 6 C
-Pushing upward that meets with confidence
-Brings great good fortune.
-.L 2 9
-If one is sincere,
-It furthers one to bring even a small offering.
-No blame.
-.L 3 9
-One pushes upward into an empty city.
-.L 4 6
-The king offers him Mount Ch'i.
-Good fortune. No blame.
-.L 5 6 G
-Perseverance brings good fortune.
-One pushes upward by steps.
-.L 6 6
-Pushing upward in darkness.
-It furthers one
-to be unremittingly persevering.
-.H 47 "K\'un" "Oppression (Exhaustion)"
-.X 5 6
-.J
-Oppression. Success. Perseverance.
-The great man brings about good fortune.
-No blame.
-When one has something to say,
-It is not believed.
-.I
-There is no water in the lake:
-The image of Exhaustion.
-Thus the superior man stakes his life
-On following his will.
-.L 1 6
-One sits oppressed under a bare tree
-And strays into a gloomy valley.
-For three years one sees nothing.
-.L 2 9 G
-One is oppressed while at meat and drink.
-The man with the scarlet knee bands is just coming.
-It furthers one to offer sacrifice.
-To set forth brings misfortune.
-No blame.
-.L 3 6
-A man permits himself to be oppressed by stone,
-And leans on thorns and thistles.
-He enters his house and does not see his wife.
-Misfortune.
-.L 4 9
-He comes very quietly, oppressed in a golden carriage.
-Humiliation, but the end is reached.
-.L 5 9 G
-His nose and feet are cut off.
-Oppression at the hands of the man with the purple knee bands.
-Joy comes softly.
-It furthers one to make offerings and libations.
-.L 6 6
-He is oppressed by creeping vines.
-He moves uncertainly and says, "Movement brings remorse."
-If one feels remorse over this and makes a start,
-Good fortune comes.
-.H 48 "Ching" "The Well"
-.X 6 2
-.J
-The Well. The town may be changed,
-But the well cannot be changed.
-It neither decreases nor increases.
-They come and go and draw from the well.
-If one gets down almost to the water
-And the rope does not go all the way,
-Or the jug breaks, it brings misfortune.
-.I
-Water over wood: the image of The Well.
-Thus the superior man encourages the people at their work,
-And exhorts them to help one another.
-.L 1 6
-One does not drink the mud of the well.
-No animals come to an old well.
-.L 2 9
-At the well hole one shoots fishes.
-The jug is broken and leaks.
-.L 3 9
-The well is cleaned, but no one drinks from it.
-This is my heart's sorrow,
-For one might draw from it.
-If the king were clear-minded,
-Good fortune might be enjoyed in common.
-.L 4 6
-The well is being lined. No blame.
-.L 5 9 G
-In the well there is a clear, cold spring
-From which one can drink.
-.L 6 6
-One draws from the well
-Without hindrance.
-It is dependable.
-Supreme good fortune.
-.H 49 "Ko" "Revolution (Molting)"
-.X 5 3
-.J
-Revolution. On your own day
-You are believed.
-Supreme success.
-Furthering through perseverance.
-Remorse disappears.
-.I
-Fire in the lake: the image of Revolution.
-Thus the superior man
-Sets the calendar in order.
-.L 1 9
-Wrapped in the hide of a yellow cow.
-.L 2 6
-When one's own day comes, one may create revolution.
-Starting brings good fortune. No blame.
-.L 3 9
-Starting brings misfortune.
-Perseverance brings danger.
-When the talk of revolution has gone the rounds three times,
-One may commit himself,
-And men will believe him.
-.L 4 9
-Remorse disappears. Men believe him.
-Changing the form of government brings good fortune.
-.L 5 9
-The great man changes like a tiger.
-Even before he questions the oracle
-He is believed.
-.L 6 6
-The superior man changes like a panther.
-The inferior man molts in the face.
-Starting brings misfortune.
-To remain persevering brings good fortune.
-And makes the seasons clear.
-.H 50 "Ting" "The Caldron"
-.X 3 2
-.J
-The Caldron. Supreme good fortune.
-Success.
-.I
-Fire over wood:
-The image of The Caldron.
-Thus the superior man consolidates his fate
-By making his position correct.
-.L 1 6
-A \fIting\fR with legs upturned.
-Furthers removal of stagnating stuff.
-One takes a concubine for the sake of her son.
-No blame.
-.L 2 9
-There is food in the \fIting\fR.
-My comrades are envious,
-But they cannot harm me.
-Good fortune.
-.L 3 9
-The handle of the \fIting\fR is altered.
-One is impeded in his way of life.
-The fat of the pheasant is not eaten.
-Once rain falls, remorse is spent.
-Good fortune comes in the end.
-.L 4 9
-The legs of the \fIting\fR are broken.
-The prince's meal is spilled
-And his person is soiled.
-Misfortune.
-.L 5 6 G
-The \fIting\fR has yellow handles, golden carrying rings.
-Perseverance furthers.
-.L 6 9 G
-The \fIting\fR has rings of jade.
-Great good fortune.
-Nothing that would not act to further.
-.H 51 "Ch\o'^e'n" "The Arousing (Shock, Thunder)"
-.X 7 7
-.J
-Shock brings success.
-Shock comes\(emoh, oh!
-Laughing words\(emha, ha!
-The shock terrifies for a hundred miles,
-And he does not let fall the sacrificial spoon and chalice.
-.I
-Thunder repeated: the image of Shock.
-Thus in fear and trembling
-The superior man sets his life in order
-And examines himself.
-.L 1 9 G
-Shock comes\(emoh, oh!
-Then follow laughing words\(emha, ha!
-Good fortune.
-.L 2 6
-Shock comes bringing danger.
-A hundred thousand times
-You lose your treasures
-And must climb the nine hills.
-Do not go in pursuit of them.
-After seven days you will get them back.
-.L 3 6
-Shock comes and makes one distraught.
-If shock spurs to action
-One remains free of misfortune.
-.L 4 9
-Shock is mired.
-.L 5 6
-Shock goes hither and thither.
-Danger.
-However, nothing at all is lost.
-Yet there are things to be done.
-.L 6 6
-Shock brings ruin and terrified gazing around.
-Going ahead brings misfortune.
-If is has not yet touched one's own body
-But has reached one's neighbor first,
-There is no blame.
-One's comrades have something to talk about.
-.H 52 "K\o'^e'n" "Keeping Still, Mountain"
-.X 4 4
-.J
-Keeping Still. Keeping his back still
-So that he no longer feels his body.
-He goes into the courtyard
-And does not see his people.
-No blame.
-.I
-Mountains standing close together:
-The image of Keeping Still.
-Thus the superior man
-Does not permit his thoughts
-To go beyond his situation.
-.L 1 6
-Keeping his toes still.
-No blame.
-Continued perseverance furthers.
-.L 2 6
-Keeping his calves still.
-He cannot rescue him whom he follows.
-His heart is not glad.
-.L 3 9
-Keeping his hips still.
-Making his sacrum stiff.
-Dangerous. The heart suffocates.
-.L 4 6
-Keeping his trunk still.
-No blame.
-.L 5 6
-Keeping his jaws still.
-The words have order.
-Remorse disappears.
-.L 6 9 G
-Noblehearted keeping still.
-Good fortune.
-.H 53 "Chien" "Development (Gradual Progress)"
-.X 2 4
-.J
-Development. The maiden
-Is given in marriage.
-Good fortune.
-Perseverance furthers.
-.I
-On the mountain, a tree:
-The image of Development.
-Thus the superior man abides in dignity and virtue,
-In order to improve the mores.
-.L 1 6
-The wild goose gradually draws near the shore.
-The young son is in danger.
-There is talk. No blame.
-.L 2 6 G
-The wild goose gradually draws near the cliff.
-Eating and drinking in peace and concord.
-Good fortune.
-.L 3 9
-The wild goose gradually draws near the plateau.
-The man goes forth and does not return.
-The woman carries a child but does not bring it forth.
-Misfortune.
-It furthers one to fight off robbers.
-.L 4 6
-The wild goose gradually draws near the tree.
-Perhaps it will find a flat branch. No blame.
-.L 5 9 G
-The wild goose gradually draws near the summit.
-For three years the woman has no child.
-In the end nothing can hinder her.
-Good fortune.
-.L 6 9
-The wild goose gradually draws near the cloud heights.
-Its feathers can be used for the sacred dance.
-Good fortune.
-.H 54 "Kuei Mei" "The Marrying Maiden"
-.X 7 5
-.J
-The Marrying Maiden.
-Undertakings bring misfortune.
-Nothing that would further.
-.I
-Thunder over the lake:
-The image of The Marrying Maiden.
-Thus the superior man
-Understands the transitory
-In the light of the eternity of the end.
-.L 1 9
-The marrying maiden as a concubine.
-A lame man who is able to tread.
-Undertakings bring good fortune.
-.L 2 9
-A one-eyed man who is able to see.
-The perseverance of a solitary man furthers.
-.L 3 6 C
-The marrying maiden as a slave.
-She marries as a concubine.
-.L 4 9
-The marrying maiden draws out the allotted time.
-A late marriage comes in due course.
-.L 5 6 G
-The sovereign I gave his daughter in marriage.
-The embroidered garments of the princess
-Were not as gorgeous
-As those of the servingmaid.
-The moon that is nearly full
-Brings good fortune.
-.L 6 6 C
-The woman holds the basket, but there are no fruits in it.
-The man stabs the sheep, but no blood flows.
-Nothing that acts to further.
-.H 55 "F\o'^e'ng" "Abundance [Fullness]"
-.X 7 3
-.J
-Abundance has success.
-The king attains abundance.
-Be not sad.
-Be like the sun at midday.
-.I
-Both thunder and lightning come:
-The image of Abundance.
-Thus the superior man decides lawsuits
-And carries out punishments.
-.L 1 9
-When a man meets his destined ruler,
-They can be together ten days,
-And it is not a mistake.
-Going meets with recognition.
-.L 2 6
-The curtain is of such fullness
-That the polestars can be seen at noon.
-Through going one meets with mistrust and hate.
-If one rouses him through truth,
-Good fortune comes.
-.L 3 9
-The underbrush is of such abundance
-That the small stars can be seen at noon.
-He breaks his right arm. No blame.
-.L 4 9
-The curtain is of such fullness
-That the polestars can be seen at noon.
-He meets his ruler, who is of like kind.
-Good fortune.
-.L 5 6 G
-Lines are coming,
-Blessing and fame draw near.
-Good fortune.
-.L 6 6
-His house is in a state of abundance.
-He screens off his family.
-He peers through the gate
-And no longer perceives anyone.
-For three years he sees nothing.
-Misfortune.
-.H 56 "Lu" "The Wanderer"
-.X 3 4
-.J
-The Wanderer. Success through smallness.
-Perseverance brings good fortune
-To the wanderer.
-.I
-Fire on the mountain:
-The image of The Wanderer.
-Thus the superior man
-Is clear-minded and cautious
-In imposing penalties,
-And protracts no lawsuits.
-.L 1 6
-If the wanderer busies himself with trivial things,
-He draws down misfortune upon himself.
-.L 2 6
-The wanderer comes to and inn.
-He has his property with him.
-He wins the steadfastness of a young servant.
-.L 3 9
-The wanderer's inn burns down.
-He loses the steadfastness of his young servant.
-Danger.
-.L 4 9
-The wanderer rests in a shelter.
-He obtains his property and an ax.
-My heart is not glad.
-.L 5 6 G
-He shoots a pheasant.
-It drops with the first arrow.
-In the end this brings both praise and office.
-.L 6 9
-The bird's nest burns up.
-The wanderer laughs at first,
-Then must needs lament and weep.
-Through carelessness he loses his cow.
-Misfortune.
-.H 57 "Sun" "The Gentle (The Penetrating, Wind)"
-.X 2 2
-.J
-The Gentle. Success through what is small.
-It furthers one to have somewhere to go.
-It furthers one to see the great man.
-.I
-Winds following one upon the other:
-The image of the Gently Penetrating.
-Thus the superior man
-Spreads his commands abroad
-And carries out his undertakings.
-.L 1 6 C
-In advancing and in retreating,
-The perseverance of a warrior furthers.
-.L 2 9
-Penetration under the bed.
-Priests and magicians are used in great number.
-Good fortune. No blame.
-.L 3 9
-Repeated penetration. Humiliation.
-.L 4 6 C
-Remorse vanishes.
-During the hunt
-Three kinds of game are caught.
-.L 5 9 G
-Perseverance brings good fortune.
-Remorse vanishes.
-Nothing that does not further.
-No beginning, but an end.
-Before the change, three days.
-After the change, three days.
-Good fortune.
-.L 6 9
-Penetration under the bed.
-He loses his property and his ax
-Perseverance brings misfortune.
-.H 58 "Tui" "The Joyous, Lake"
-.X 5 5
-.J
-The Joyous. Success.
-Perseverance is favorable.
-.I
-Lakes resting on one another:
-The image of the Joyous.
-Thus the superior man joins with his friends
-For discussion and practice.
-.L 1 9
-Contented joyousness. Good fortune.
-.L 2 9 G
-Sincere joyousness. Good fortune.
-Remorse disappears.
-.L 3 6 C
-Coming joyousness. Misfortune.
-.L 4 9
-Joyousness that is weighed is not at peace.
-After ridding himself of mistakes a man has joy.
-.L 5 9 G
-Sincerity toward disintegrating influences is dangerous.
-.L 6 6 C
-Seductive joyousness.
-.H 59 "Huan" "Dispersion [Dissolution]"
-.X 2 6
-.J
-Dispersion. Success.
-The king approaches his temple.
-It furthers one to cross the great water.
-Perseverance furthers.
-.I
-The wind drives over the water:
-The image of Dispersion.
-Thus the kings of old sacrificed to the Lord
-And built temples.
-.L 1 6
-He brings help with the strength of a horse.
-Good fortune.
-.L 2 9 C
-At the dissolution
-He hurries to that which supports him.
-Remorse disappears.
-.L 3 6
-He dissolves his self. No remorse.
-.L 4 6 C
-He dissolves his bond with his group.
-Supreme good fortune.
-Dispersion leads in turn to accumulation.
-This is something that ordinary men do not think of.
-.L 5 9 G
-His loud cries are as dissolving as sweat.
-Dissolution! A king abides without blame.
-.L 6 9
-He dissolves his blood.
-Departing, keeping at a distance, going out,
-Is without blame.
-.H 60 "Chieh" "Limitation"
-.X 6 5
-.J
-Limitation. Success.
-Galling limitation must not be persevered in.
-.I
-Water over Lake: the image of Limitation.
-Thus the superior man
-Creates numbers and measure,
-And examines the nature of virtue and correct conduct.
-.L 1 9
-Not going out of the door and the courtyard
-Is without blame.
-.L 2 9
-Not going out of the gate and the courtyard
-Brings misfortune.
-.L 3 6
-He who knows no limitation
-Will have cause to lament.
-No blame.
-.L 4 6
-Contented limitation. Success.
-.L 5 9 G
-Sweet limitation brings good fortune.
-Going brings esteem.
-.L 6 6
-Galling limitation.
-Perseverance brings misfortune.
-Remorse disappears.
-.H 61 "Chung Fu" "Inner Truth"
-.X 2 5
-.J
-Inner Truth. Pigs and fishes.
-Good fortune.
-It furthers one to cross the great water.
-Perseverance furthers.
-.I
-Wind over lake: the image of Inner Truth.
-Thus the superior man discusses criminal cases
-In order to delay executions.
-.L 1 9
-Being prepared brings good fortune.
-If there are secret designs, it is disquieting.
-.L 2 9
-A crane is calling in the shade.
-Its young answers it.
-I have a good goblet.
-I will share it with you.
-.L 3 6 C
-He finds a comrade.
-Now he beats the drum, now he stops.
-Now he sobs, now he sings.
-.L 4 6 C
-The moon nearly at the full.
-The team horse goes astray.
-No blame.
-.L 5 9 G
-He possesses truth, which links together.
-No blame.
-.L 6 9
-Cockcrow penetrating to heaven.
-Perseverance brings misfortune.
-.H 62 "Hsiao Kuo" "Preponderance of the Small"
-.X 7 4
-.J
-Preponderance of the Small. Success.
-Perseverance furthers.
-Small things may be done; great things should not be done.
-The flying bird brings the message:
-It is not well to strive upward,
-It is well to remain below.
-Great good fortune.
-.I
-Thunder on the mountain:
-The image of Preponderance of the Small.
-Thus in his conduct the superior man gives preponderance to reverence.
-In bereavement he gives preponderance to grief.
-In his expenditures he gives preponderance to thrift.
-.L 1 6
-The bird meets with misfortune through flying.
-.L 2 6 G
-She passes by her ancestor
-And meets her ancestress.
-He does not reach his prince
-And meets the official.
-No blame.
-.L 3 9
-If one is not extremely careful,
-Somebody may come up from behind and strike him.
-Misfortune.
-.L 4 9
-No blame. He meets him without passing by.
-Going brings danger. One must be on guard.
-Do not act. Be constantly persevering.
-.L 5 6 G
-Dense clouds,
-No rain from our western territory.
-The prince shoots and hits him who is in the cave.
-.L 6 6
-He passes him by, not meeting him.
-The flying bird leaves him.
-Misfortune.
-This means bad luck and injury.
-.H 63 "Chi Chi" "After Completion"
-.X 6 3
-.J
-After Completion. Success in small matters.
-Perseverance furthers.
-At the beginning good fortune,
-At the end disorder.
-.I
-Water over fire: the image of the condition
-In After Completion.
-Thus the superior man
-Takes thoughts of misfortune
-And arms himself against it in advance.
-.L 1 9
-He brakes his wheels.
-He gets his tail in the water.
-No blame.
-.L 2 6 G
-The woman loses the curtain of her carriage.
-Do not run after it;
-On the seventh day you will get it.
-.L 3 9
-The Illustrious Ancestor
-Disciplines the Devil's Country.
-After three years he conquers it.
-Inferior people must not be employed.
-.L 4 6
-The finest clothes turn to rags.
-Be careful all day long.
-.L 5 9
-The neighbor in the east who slaughters an ox
-Does not attain as much real happiness
-As the neighbor in the west
-With his small offering.
-.L 6 6
-He gets his head in the water. Danger.
-.H 64 "Wei Chi" "Before Completion"
-.X 3 6
-.J
-Before Completion. Success.
-But if the little fox, after nearly completing the crossing,
-Gets his tail in the water,
-There is nothing that would further.
-.I
-Fire over water:
-The image of the condition before transition.
-Thus the superior man is careful
-In the differentiation of things,
-So that each finds its place.
-.L 1 6
-He gets his tail in the water.
-Humiliating.
-.L 2 9
-He brakes his wheels.
-Perseverance brings good fortune.
-.L 3 6
-Before completion, attack brings misfortune.
-It furthers one to cross the great water.
-.L 4 9
-Perseverance brings good fortune.
-Remorse disappears.
-Shock, thus to discipline the Devil's Country.
-For three years, great realms are awarded.
-.L 5 6 G
-Perseverance brings good fortune.
-No remorse.
-The light of the superior man is true.
-Good fortune.
-.L 6 9
-There is drinking of wine
-In genuine confidence. No blame.
-But if one wets his head,
-He loses it, in truth.
diff --git a/.ref-Research-V7/usr/games/ching.d/macros b/.ref-Research-V7/usr/games/ching.d/macros
deleted file mode 100644 (file)
index 8a5f177..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-.ds N6 Six
-.ds N9 Nine
-.ds L1 at the beginning
-.ds L2 in the second place
-.ds L3 in the third place
-.ds L4 in the fourth place
-.ds L5 in the fifth place
-.ds L6 at the top
-.ds GR ()
-.ds CR []
-.ds BL \(em\(em\ \(em\(em
-.ds SL \(em\(em\(em\(em\(em
-.ds T1 Ch\'ien\ The Creative, Heaven
-.ds T2 Sun\ \ \ \ The Gentle, Wind
-.ds T3 Li\ \ \ \ \ The Clinging, Flame
-.ds T4 K\o'^e'n\ \ \ \ Keeping Still, Mountain
-.ds T5 Tui\ \ \ \ The Joyous, Lake
-.ds T6 K\'an\ \ \ The Abysmal, Water
-.ds T7 Ch\o'^e'n\ \ \ The Arousing, Thunder
-.ds T8 K\'un\ \ \ The Receptive, Earth
-.de H
-.ds LH The Lines
-.in 0
-.ta 0.5i 1.0i 1.5i 2.0i
-.na
-.nf
-.sp 2
-\\$1.  \\$2 / \\$3
-..
-.de X
-.sp
-.XX \\$1 "above" "\\*(T\\$1"
-.XX \\$2 "below" "\\*(T\\$2"
-..
-.de XX
-.ie \\$1>4     \\*(BL
-.el    \\*(SL
-.ie (\\$1-1%4)>1       \\*(BL\\c
-.el    \\*(SL\\c
-       \\$2    \\$3
-.ie \\$1%2     \\*(SL
-.el    \\*(BL
-..
-.de J
-.in 0
-.sp
-The Judgement
-.na
-.nf
-.in 0.5i
-.sp
-..
-.de I
-.in 0
-.sp
-The Image
-.na
-.nf
-.sp
-.in 0.5i
-..
-.de LX
-.in 0.5i
-.ti -0.5i
-.if '\\$3'G' \\{\\
-\\*(GR \\$1 \\$2 means:\\}
-.if '\\$3'C' \\{\\
-\\*(CR \\$1 \\$2 means:\\}
-.if '\\$3'' \\{\\
-       \\$1 \\$2 means:\\}
-..
-.de L
-.if !'\\*(LH'' \\{\\
-.in 0
-.sp
-\\*(LH
-.rm LH
-.in 0.5i\\}
-.sp
-.LX "\\*(N\\$2" "\\*(L\\$1" \\$3
-.na
-.nf
-..
-.de LA
-.sp
-.if '\\$1'6' .LX "When all the lines are" "sixes, it"
-.if '\\$1'9' .LX "When all the lines are" "nines, it"
-.na
-.nf
-..
-.po 0.5i
diff --git a/.ref-Research-V7/usr/games/lib/fortunes b/.ref-Research-V7/usr/games/lib/fortunes
deleted file mode 100644 (file)
index d3930a6..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-Some men are discovered; others are found out.
-Words must be weighed, not counted.
-By failing to prepare, you are preparing to fail.
-He who spends a storm beneath a tree, takes life with a grain of TNT.
-You attempt things that you do not even plan because of your extreme stupidity.
-Take care of the luxuries and the necessities will take care of themselves.
-Words are the voice of the heart.
-Your mind understands what you have been taught; your heart, what is true.
-A king's castle is his home.
-He who has a shady past knows that nice guys finish last.
-The universe is laughing behind your back.
-The best prophet of the future is the past.
-It is a poor judge who cannot award a prize.
-Even the boldest zebra fears the hungry lion.
-Money will say more in one moment than the most eloquent lover can in years.
-Money may buy friendship but money can not buy love.
-Might as well be frank, monsieur. It would take a miracle to get you out of Casablanca.
-Creditors have much better memories than debtors.
-Many pages make a thick book.
-Every purchase has its price.
-Do not underestimate the power of the Force.
-You will step on the night soil of many countries.
-Mind your own business, Spock. I'm sick of your halfbreed interference.
-He who invents adages for others to peruse takes along rowboat when going on cruise.
-Of all forms of caution, caution in love is the most fatal.
-If you suspect a man, don't employ him.
-The Tree of Learning bears the noblest fruit, but noble fruit tastes bad.
-Stop searching forever. Happiness is unattainable.
-A man who fishes for marlin in ponds will put his money in Etruscan bonds.
-A good memory does not equal pale ink.
-How sharper than a hound's tooth it is to have a thankless serpent.
-You dialed 5483
-It's later than you think.
-Mistakes are oft the stepping stones to failure.
-It's not reality that's important, but how you perceive things.
-Promptness is its own reward, if one lives by the clock instead of the sword.
-Like winter snow on summer lawn, time past is time gone.
-Far duller than a serpent's tooth it is to spend a quiet youth.
-Let not the sands of time get in your lunch.
-The attacker must vanquish; the defender need only survive.
-Standing on head makes smile of frown, but rest of face also upside down.
-Deprive a mirror of its silver and even the Czar won't see his face.
-Man's horizons are bounded by his vision.
-To criticize the incompetent is easy; it is more difficult to criticize the competent.
-He who has imagination without learning has wings but no feet.
-Men seldom show dimples to girls who have pimples.
-Troglodytism does not necessarily imply a low cultural level.
-You cannot kill time without injuring eternity.
-As goatherd learns his trade by goat, so writer learns his trade by wrote.
-One man tells a falsehood, a hundred repeat it as true.
-Crazee Edeee,  his prices are INSANE!!!
-It is better to wear out than to rust out.
-When the wind is great, bow before it; when the wind is heavy, yield to it.
-The wise shepherd never trusts his flock to a smiling wolf.
-It is the wise bird who builds his nest in a tree.
-How you look depends on where you go.
-A plucked goose doesn't lay golden eggs.
-A man who turns green has eschewed protein.
-Put not your trust in money, but put your money in trust.
-Even a hawk is an eagle among crows.
-Even the smallest candle burns brighter in the dark.
-People who take cat naps don't usually sleep in a cat's cradle.
-A truly wise man never plays leapfrog with a Unicorn.
-Do not clog intellect's sluices with bits of knowledge of questionable uses.
-Let him who takes the Plunge remember to return it by Tuesday.
-Try to divide your time evenly to keep others happy.
-You have mail.
-His heart was yours from the first moment that you met.
-Sin has many tools, but a lie is the handle which fits them all.
-Let a fool hold his tongue and he will pass for a sage.
-With clothes the new are best, with friends the old are best.
-He is truly wise who gains wisdom from another's mishap.
-Beware of a dark-haired man with a loud tie.
-Today is the last day of your life so far.
-Flee at once, all is discovered.
-Man who falls in vat of molten optical glass makes spectacle of self.
-Go directly to jail.  Do not pass Go, do not collect $200.
-For a good time, call 8367-3100.
-Those who can, do; those who can't, simulate.
-Those who can, do; those who can't, write.  Those who can't write work for the Bell Labs Record.
-God does not play dice.
-This fortune is inoperative.  Please try another.
-Laugh, and the world ignores you.  Crying doesn't help either.
-No amount of genius can overcome a preoccupation with detail.
-You will feel hungry again in another hour.
-You now have Asian Flu.
-God made the integers; all else is the work of Man.
-Disk crisis, please clean up!
-You auto buy now.
-Many are called, few are chosen.  Fewer still get to do the choosing.
-Try the Moo Shu Pork.  It is especially good today.
-Many are cold, but few are frozen.
-The early worm gets the bird.
-He who hesitates is sometimes saved.
-Time is nature's way of making sure that everything doesn't happen at once.
-The future isn't what it used to be. (It never was.)
-Can't open /usr/lib/fortunes.
-If God had wanted you to go around nude, He would have given you bigger hands.
-It is better to have loved and lost than just to have lost.
-A journey of a thousand miles begins with a cash advance from Sam.
-Disk crunch - please clean up.
-Center meeting at 4pm in 2C-543
-I will never lie to you.
-Spock: We suffered 23 casualties in that attack, Captain.
-Your computer account is overdrawn.  Please reauthorize.
-1 bulls, 3 cows
-It's hard to get ivory in Africa, but in Alabama the Tuscaloosa.
-Waste not, get your budget cut next year.
-Old MacDonald had an agricultural real estate tax abatement.
-Snow Day - stay home.
-Save gas, don't eat beans.
-All that glitters has a high refractive index.
-Ignore previous fortune.
-When in doubt, lead trump.
-23. ...  r-q1
-unix soit qui mal y pense
-Even a cabbage may look at a king.
-Honi soit la vache qui rit.
-No directory
-Don't eat yellow snow.
-One Bell System - it works.
-One Bell System - it sometimes works.
-* UNIX is a Trademark of Bell Laboratories.
-chess tonight
-External Security:
-Peters hungry, time to eat lunch.
-MOUNT TAPE U1439 ON B3, NO RING
-A foolish consistency is the hobgoblin of little minds.
-IOT trap -- core dumped
-IOT trap -- mos dumped
-/usr/news/gotcha
-Rotten wood can not be carved - Confucius (Analects, Book 5, Ch. 9)
-System going down at 1:45 this afternoon for disk crashing.
-: is not an identifier
-Quantity is no substitute for quality, but its the only one we've got.
-Those who can do, those who can't, write.
-The more things change, the more they'll never be the same again.
-New crypt. See /usr/news/crypt.
-You might have mail.
-You can't go home again, unless you set $HOME
-You are in a maze of twisty little passages, all alike.
diff --git a/.ref-Research-V7/usr/games/quiz.k/africa b/.ref-Research-V7/usr/games/quiz.k/africa
deleted file mode 100644 (file)
index 0f8722e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-Algeria:Alg[iers|er]
-Botswana:Gaberones
-Burundi:Bujumbura
-Cameroun:Yaound['\be|e\b'|e]
-Central Africa{n Rep{ublic}}:Bangui
-Chad:Ndjamena
-Congo:Brazzaville
-Dahomey:Porto Novo
-Ethiopia:Addis Ababa
-Gabon:Libreville
-Ghana:Accra
-Guinea-Bissau:Bissau
-Guinea:Conakry
-Ivory Coast:Abidjan
-Kenya:Nairobi
-Lesotho:Maseru
-Liberia:Monrovia
-Libya:Tripoli|Al Bayda{'}
-Malagasy{ Rep{ublic}}|Madagascar:Tananarive
-Malawi:Zomba
-Mali:Bamako
-Mauritania:Nouakchott
-Morocco:Rabat
-Mo[z|,\bc|c\b,|c]ambique:Louren[,\bc|c\b,|c]o Marques
-Namibia:Windhoek
-Niger:Niamey
-Nigeria:Lagos
-Rhodesia:Salisbury
-Rwanda:Kigali
-Senegal:Dakar
-Sierra Leone:Freetown
-Somali{ Rep{ublic}}:Mogadis[cio|hu]
-Sudan:Khartoum
-Swaziland:Mbabane
-Tanzania:Dar es Salaam
-Togo:Lom['\be|e\b'|e]
-Tunisia:Tunis
-Uganda:Kampala
-United Arab Rep{ublic}|Egypt:Cairo
-Upper Volta:Ouagadougou
-Zambia:Lusaka
-Za["\bi|i\b"|i]re:Kinshasa
-{Rep{ublic} of }South Africa:Pretoria
-{The }Gambia:Bathurst
diff --git a/.ref-Research-V7/usr/games/quiz.k/america b/.ref-Research-V7/usr/games/quiz.k/america
deleted file mode 100644 (file)
index 7f8fee1..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Argentina:Buenos Aires
-Bahamas:Nassau
-Barbados:Bridgetown
-Bolivia:La Paz|Sucre
-Bra[z|s]il:Brasilia
-Canada:Ottawa
-Chile:Santiago
-Colombia:Bogot['\ba|a\b'|a]
-Costa Rica:San Jose
-Cuba:Ha[v|b]ana
-Dominican Republic:Santo Domingo
-Ecuador:Quito
-El Salvador:San Salvador
-Guatemala:Guatemala
-Guyana:Georgetown
-Haiti:Port au Prince
-Honduras:Tegucigalpa
-Jamaica:Kingston
-Mexico:Mexico
-Nicaragua:Managua
-Panama:Panama
-Paraguay:Asunci['\bo|o\b'|o]n
-Peru:Lima
-Trinidad[ and Tobago|]:Port of Spain
-United States|US{A}:Washington
-Uruguay:Montevideo
-Venezuela:Caracas
diff --git a/.ref-Research-V7/usr/games/quiz.k/areas b/.ref-Research-V7/usr/games/quiz.k/areas
deleted file mode 100644 (file)
index 25a241b..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-201:northern new jersey|NJ:newark
-202:washington d c|DC:
-203:connecticut|CT:
-204:manitoba:
-205:alabama|AL:
-206:western washington state|WA:seattle
-207:maine|ME:
-208:idaho|ID:
-209:central california|CA:fresno
-212:new york city, new york|NY:
-213:los angeles, california|CA:
-214:northeastern texas|TX:dallas
-215:southeastern pennsylvania|PA:philadelphia
-216:northeastern ohio|OH:akron
-217:central illinois|IL:springfield
-218:northern minnesota|MN:duluth
-219:northern indiana|IN:south bend
-301:maryland|MD:
-302:delaware|DE:
-303:colorado|CO:
-304:west virginia|WV:
-305:southeastern florida|FL:miami
-306:saskatchewan:
-307:wyoming|WY:
-308:western nebraska|NE:omaha
-309:northwestern illinois|IL:peoria
-312:chicago, illinois|IL:
-313:eastern michigan|MI:detroit
-314:southeastern missouri|MO:jefferson city
-315:northern central new york|NY:syracuse
-316:southern kansas|KS:wichita
-317:central indiana|IN:indianapolis
-318:western louisiana|LA:shreveport
-319:eastern iowa|IA:cedar rapids
-401:rhode island|RI:
-402:eastern nebraska|NE:north platte
-403:alberta:
-404:northern georgia|GA:atlanta
-405:western oklahoma|OK:oklahoma city
-406:montana|MT:
-408:central coastal california|CA:san jose
-412:western pennsylvania|PA:pittsburgh
-413:western massachusetts|MA:springfield
-414:southeastern wisconsin|WI:milwaukee
-415:san francisco, california|CA:
-416:southern central ontario:toronto
-417:southwestern missouri|MO:springfield
-418:northeastern quebec:quebec
-419:northwestern ohio|OH:toledo
-501:arkansas|AR:
-502:western kentucky|KY:louisville
-503:oregon|OR:
-504:eastern louisiana|LA:new orleans
-505:new mexico|NM:
-506:new brunswick:
-507:southern minnesota|MN:rochester
-509:eastern washington state|WA:spokane
-512:southern texas|TX:austin
-513:southwestern ohio|OH:dayton
-514:southwestern quebec:montreal
-515:central iowa|IA:des moines
-516:long island, new york|NY:
-517:central michigan|MI:lansing
-518:northeastern new york|NY:albany
-519:southwestern ontario:windsor
-601:mississippi|MS:
-602:arizona|AZ:
-603:new hampshire|NH:
-604:british columbia:
-605:south dakota|SD:
-606:eastern kentucky|KY:ashland
-607:southern central new york|NY:ithaca, binghamton
-608:southwestern wisconsin|WI:madison
-609:southern new jersey|NJ:trenton
-612:central minnesota|MN:minneapolis
-613:southeastern ontario:ottawa
-614:southeastern ohio|OH:columbus
-615:eastern tennessee|TN:nashville
-616:western michigan|MI:grand rapids
-617:eastern massachusetts|MA:boston
-618:southern illinois|IL:centralia
-701:north dakota|ND:
-702:nevada|NV:
-703:western virginia|VA:arlington
-704:western north carolina:charlotte
-705:northeastern ontario:sault ste. marie
-707:northwestern california|CA:santa rosa
-709:newfoundland:
-712:western iowa|IA:council bluffs
-713:southeastern texas|TX:houston
-714:southern california|CA:san diego
-715:northern wisconsin|WI:superior
-716:northern western new york|NY:buffalo, rochester
-717:eastern pennsylvania|PA:wilkes-barre, scranton
-801:utah|UT:
-802:vermont|VT:
-803:south carolina|SC:
-804:eastern virginia|VA:richmond
-805:southern central coastal california|CA:bakersfield
-806:panhandle texas|TX:amarillo
-807:western ontario:fort william
-808:hawaii|HI:
-809:bermuda, puerto rico, virgin islands, caribbean:
-812:southern indiana|IN:evansville
-813:southwestern florida|FL:st. petersburg
-814:central pennsylvania|PA:erie
-815:northeastern illinois|IL:rockford
-816:northern missouri|MO:kansas city
-817:northern central texas|TX:fort worth
-819:northwestern quebec:trois rivieres
-901:western tennessee|TN:memphis
-902:nova scotia, prince edward island:
-903:western mexico:mexicali
-904:northern florida|FL:jacksonville
-905:eastern mexico:mexico city
-906:upper michigan|MI:escanaba
-907:alaska|AK:
-912:southern georgia|GA:savannah
-913:northern kansas|KS:topeka
-914:southern new york|NY:westchester county
-915:western texas|TX:el paso
-916:northeastern california|CA:sacramento
-918:eastern oklahoma|OK:tulsa
-919:eastern north carolina|NC:raleigh
diff --git a/.ref-Research-V7/usr/games/quiz.k/arith b/.ref-Research-V7/usr/games/quiz.k/arith
deleted file mode 100644 (file)
index 64babb5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-63 - ... = 55:8
-147 - 3 = ...:144
-614 - 9 ...:605
-465 - 7 = ...:458
-563 - ... = 560:3
-33 - 14 = ...:19
-42 - ... = 37:5
-264 - 3 = ...:261
-763 - 8 = ...:755
-375 - 6 = ...:369
-736 - ... = 728:8
-62 - 34 = ...:28
-75 - 8 = ...:67
-244 - ... = 230:14
-478 - 19 = ...:459
-78 - ... = 75:3
-679 - 5 = ...:674
-564 - 7 = ...:557
-761 - 5 = ...:756
-718 - ... = 716:2
-56 - 18 = ...:38
-65 - ... = 48:17
-748 - 5 = ...:743
-856 - 8 = ...:848
-763 - 5 = ...:758
-445 - ... = 436:9
-94 - 55 = ...:39
-42 - 9 = ...:33
-483 - ... = 455:28
-742 - ... = 714:28
-84 - ... = 75:9
-569 - 7 = ...:562
-856 - 7 = ...:849
-324 - 6 = ...:318
-437 - ... = 432:5
-84 - 56 = ...:28
-81 - ... = 65:16
-326 - 4 = ...:322
-643 - 7 = ...:636
-546 - 9 = ...:537
-842 - ... = 835:7
-53 - 39 = ...:14
-63 - 48 = ...:15
-57 - 38 = ...:19
-52 - 26 = ...:26
diff --git a/.ref-Research-V7/usr/games/quiz.k/asia b/.ref-Research-V7/usr/games/quiz.k/asia
deleted file mode 100644 (file)
index b246b5f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-Afghanistan:Kabul
-Australia:Canberra
-Bahrein:Manama
-Bangladesh:Dacca
-Bhutan:Thimbu
-Burma:Rangoon
-China:Peking
-Cyprus:Nicosia
-India:New Delhi
-Indonesia:Djakarta
-Iran:Tehran
-Iraq:Baghdad
-Israel:Jerusalem
-Japan:Tokyo
-Jordan:Amman
-Khmer|Cambodia:P{h}nom Penh
-Kuwait:Al-kuwait
-Laos:Vientiane
-Lebanon:Beirut
-Malaysia:Kuala Lumpur
-Maldive Islands:Male
-Mongolia:Ulan Bator
-Nepal:Katmandu
-North Korea:P{'}yongyang
-North Yemen:San{'}a
-Oman:Muscat
-Pakistan:Islamabad
-Papua[-| ]New Guinea:Port Moresby
-Phillipines:Quezon City
-Qatar:Doha
-Saudi Arabia:Riyadh|J{ei}ddah
-Singapore:Singapore
-South Korea:Seoul
-South Yemen:Aden
-Sri Lanka:Colombo
-Syria:Damascus
-Taiwan:Taipei
-Thailand:Bangkok
-Turkey:Ankara
-United Arab Emirates:Abu Dhabi
-Vietnam:Hanoi
diff --git a/.ref-Research-V7/usr/games/quiz.k/babies b/.ref-Research-V7/usr/games/quiz.k/babies
deleted file mode 100644 (file)
index 5305c0c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-cub:lion|tiger|bear
-kitten:cat|fox|skunk|rabbit|bobcat|panther
-gosling:goose
-colt|foal:horse|donkey|zebra
-puppy:dog
-pup:seal|fox|beaver
-duckling:duck
-fawn:deer
-piglet|shoat:pig
-lamb:sheep
-kid:goat|antelope
-chick:chicken
-tadpole|polliwog:frog|toad
-joey:kangaroo
-calf:cow|whale|moose|elephant|buffalo|giraffe
-caterpillar:butterfly|moth
-elver:eel
-eaglet:eagle
-owlet:owl
-fingerling|fry:fish
-nestling:bird
diff --git a/.ref-Research-V7/usr/games/quiz.k/bard b/.ref-Research-V7/usr/games/quiz.k/bard
deleted file mode 100644 (file)
index 56c76ed..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-The quality of mercy is not strain['|e]d:\
-It droppeth as the gentle rain from heaven:\
-{The }Merchant{ of Venice{ IV-i}}:\
-Portia
-Friends{,} Romans{,} Countrymen:\
-lend me your ears{;}:\
-{Julius }Caesar{ III-ii}:\
-{Mark }Antony
-Neither a borrower nor a lender be:\
-For loan oft loses both itself and friend{.}:\
-Hamlet{ I-iii}:\
-Polonius
-To be{,} or not to be{\:}:\
-that is the question{\:}:\
-Hamlet{ III-i}:\
-Hamlet
-Alas{,} poor Yorick{!}:\
-I knew him{,} Horatio{;}:\
-Hamlet{ V-i}:\
-Hamlet
-Double{,} double toil and trouble{;}:\
-Fire burn and cauldron bubble{.}:\
-Macbeth{ IV-i}:\
-Witch{es}
-By the pricking of my thumbs{,}:\
-Something wicked this way comes{.}:\
-Macbeth{ IV-i}:\
-{Second |2nd }Witch
-Out, damned spot! out, I say!:\
-:\
-Macbeth{ V-i}:\
-Lady Macbeth
-Unbidden guests:\
-Are often welcomest when they are gone{.}:\
-{King }Henry VI{,} Part I{ I-ii}:\
-
-She is a woman{,} therefore may be woo'd{;}:\
-She is a woman{,} therefore may be [won|screw'd]{.}:\
-Titus Andronicus{ II-i}:\
-Demetrius
-Such duty as the subject owes the prince{,}:\
-Even such a woman oweth to her husband{.}:\
-{The }Taming of the Shrew{ V-ii}:\
-Kate
-Who is Silvia{?} what is she{,}:\
-That all our swains commend her{?}:\
-{The }Two Gentlemen of Verona{ IV-ii}:\
-Thurio
-Tu-whit{,} tu-who[ - | |--]a merry note{,}:\
-While greasy Joan doth keel the pot{.}:\
-Love's Labo{u}r Lost{ V-ii}:\
-Winter
-My only love sprung from my only hate{!}:\
-Too early seen unknown{,} and known too late{!}:\
-Romeo{ and Juliet{ I-v}}:\
-Juliet
-But{,} soft{!} what light through yonder window breaks{?}:\
-It is the east{,} and Juliet is the sun{!}:\
-Romeo{ and Juliet{ II-ii}}:\
-Romeo
-What's in a name{?} That which we call a rose:\
-By any other name would smell as sweet{.}:\
-Romeo{ and Juliet{ II-ii}}:\
-Juliet
-Good night{,} good night{!} parting is such sweet sorrow{,}:\
-That I shall say good night till it be morrow{.}:\
-Romeo{ and Juliet{ II-ii}}:\
-Juliet
-A plague o['|n] both your houses{!}:\
-They have made worms' meat of me{.}:\
-Romeo{ and Juliet{ III-i}}:\
-Mercutio
-This royal throne of kings{,} this scepter['|e]d isle{,}:\
-This earth of majesty{,} this seat of Mars{,}:\
-{King }Richard II{ II-i}:\
-John of Gaunt
-Not all the water in a rough rude sea:\
-Can wash the balm from an anointed king{.}:\
-{King }Richard II{ III-ii}:\
-{King }Richard II
-I'll put a girdle round the earth:\
-In forty minutes{.}:\
-{A }Midsummer[-| ]Night's Dream{ II-i}:\
-Puck
-I can call spirits from the vasty deep{.}:\
-Why{,} so can I{,} or so can any man{;}:\
-{King }Henry IV{,} Part I{ II-iv}:\
-
-There are more things in heaven and earth{,} Horatio{,}:\
-Than are dream[t|ed] of in your philosophy{.}:\
-Hamlet{ I-v}:\
-Hamlet
-The time is out of joint{;} O cursed spite{,}:\
-That ever I was born to set it right{!}:\
-Hamlet{ I-v}:\
-Hamlet
-Once more unto the breach{,} dear friends{,} once more{;}:\
-Or close the wall up with our English dead{.}:\
-{King }Henry V{ III-i}:\
-{King }Henry V
-Was ever woman in this humour woo['|e]d{?}:\
-Was ever woman in this humour [won|screw'd]{?}:\
-{King }Richard III{ I-ii}:\
-{King }Richard III
-Now is the winter of our discontent:\
-Made glorious summer by this sun of York:\
-{King }Richard III{ I-i}:\
-{King }Richard III
-There['s| is] a divinity that shapes our ends{,}:\
-Rough[-| ]hew them how we will{.}:\
-Hamlet{ V-ii}:\
-Hamlet
-There is a tide in the affairs of men:\
-Which{,} taken at the flood{,} leads on to fortune{;}:\
-{Julius }Caesar{ IV-iii}:\
-Brutus
-Never{,} never{,} never{,} never{,} never{.}:\
-Pray you undo this button{.}{ Thank you{,} sir{.}}:\
-{King }Lear{ V-iii}:\
-{King }Lear
-I grow{,} I prosper{\:}:\
-Now{,} gods{,} stand up for bastards{!}:\
-{King }Lear{ I-ii}:\
-Edmund
-The better part of valour is discretion{;}:\
-in the which better part I have saved my life{.}:\
-{King }Henry IV{,} Part I{ V-iv}:\
-Falstaff
-Asses are made to bear{,} and so are you{.}:\
-Women are made to bear{,} and so are you{.}:\
-{The }Taming of the Shrew{ II-i}:\
-
-Full fathom five thy father lies{;}:\
-Of his bones are coral made{;}:\
-{The }Tempest{ I-ii}:\
-Ariel
-She lov['|e]d me for the dangers I had pass['|e]d{;}:\
-And I lov['|e]d her that she did pity them{.}:\
-Othello{ I-iii}:\
-Othello
-Uneasy lies the head that wears a crown{.}:\
-Many good morrows to your Majesty{!}:\
-{King }Henry IV{,} Part II{ III-i}:\
-
-Mislike me not for my complexion{,}:\
-The shadow['|e]d livery of the burnish['|e]d sun{.}:\
-{The }Merchant{ of Venice{ II-i}}:\
-Morocco
-Cowards die many times before their deaths{;}:\
-The valiant never taste of death but once{.}:\
-{Julius }Caesar{ II-ii}:\
-Caesar
-O{h}{!|,} Pardon me{,} thou bleeding piece of earth{,}:\
-That I am meek and gentle with these butchers{.}:\
-{Julius }Caesar{ III-i}:\
-{Mark }Antony
-The play's the thing:\
-Wherein I'll catch the conscience of the king{.}:\
-Hamlet{ II-ii}:\
-Hamlet
-How sharper than a serpent's tooth it is:\
-to have a thankless child{.}:\
-{King }Lear{ I-iv}:\
-{King }Lear
-Had I but served my God with half the zeal I served my king:\
-He would not in [mine|my] old age have left me naked to [mine|my] enemies{.}:\
-{King }Henry VIII{ IV-ii}:\
-{Cardinal }Wolsey
-It seems she hangs upon the cheek of night:\
-Like a rich jewel in an Ethiop's ear{.}:\
-Romeo{ and Juliet{ I-v}}:\
-Romeo
-Where the bee sucks{,} there suck I{;}:\
-In a cowslip's bell I lie{.}:\
-{The }Tempest{ V-i}:\
-Ariel
-O brave new world{,}:\
-That has such people [in't|in it]{!}:\
-{The }Tempest{ V-i}:\
-Miranda
-Why{,} then the world's mine oyster{,}:\
-Which I with sword will open{.}:\
-{The }Merry Wives of Windsor{ II-ii}:\
-Falstaff
-A goodly apple rotten at the heart{\:}:\
-O{h}{,} what a goodly outside falsehood hath{!|.}:\
-{The }Merchant{ of Venice{ I-iii}}:\
-Antonio
-I never kill['|e]d a mouse{,} nor hurt a fly{;}:\
-I trod upon a worm against my will{,}:\
-Pericles{ IV-i}:\
-Marina
-Golden lads and girls all must{,}:\
-Like chimney sweepers{,} come to dust{.}:\
-Cymbeline{ IV-ii}:\
-Guiderius
-You blocks, you stones, you worse than senseless things!:\
-O you hard hearts{,} you cruel men of Rome{.}:\
-{Julius }Caesar{ I-i}:\
-Marullus
-A horse{!|,} a horse{!|,} my kingdom for a horse{!}:\
-:\
-{King }Richard III{ V-iv}:\
-{King }Richard III
-My salad days,:\
-When I was green in judg{e}ment, cold in blood{,}:\
-Antony [and|&] Cleopatra{ I-v}:\
-Cleopatra
-Age cannot wither her, nor custom stale:\
-Her infinite variety{.}:\
-Antony [and|&] Cleopatra{ II-iii}:\
-Enobarbus
-Give me some music\: music, moody food:\
-Of us that trade in love{.}:\
-Antony [and|&] Cleopatra{II-v}:\
-Cleopatra
-'Tis better playing with a lion's whelp,:\
-Than with an old one dying{.}:\
-Antony [and|&] Cleopatra:\
-Enobarbus
-The barge she sat in, like a burnished throne,:\
-Burned on the water{.} The poop was burnished gold{;|.}:\
-Antony [and|&] Cleopatra:\
-Enobarbus
-Done like a Frenchman - turn and turn again!:\
-:\
-{King }Henry VI{,} Part I{ III-iii}:\
-{Joan }Pucelle|{Saint |St{.} }Joan{ of Arc}
diff --git a/.ref-Research-V7/usr/games/quiz.k/chinese b/.ref-Research-V7/usr/games/quiz.k/chinese
deleted file mode 100644 (file)
index 66d9472..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-rabbit:dragon
-dragon:snake
-snake:horse
-horse:sheep
-sheep:monkey
-monkey:rooster
-rooster:dog
-dog:boar
-boar:rat
-rat:ox
-ox:tiger
-tiger:rabbit
diff --git a/.ref-Research-V7/usr/games/quiz.k/collectives b/.ref-Research-V7/usr/games/quiz.k/collectives
deleted file mode 100644 (file)
index f12aad4..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-ants:colony|hill
-apes:shrewdness
-asses:pace|bunch
-badgers:cete
-bass:shoal
-bears:sloth
-bees:swarm
-birds:dissimulation
-brats:passel
-candidates:slate
-caterpillars:army
-cats:clowder
-cattle:drove|herd
-chickens:peep|flock
-crows:murder
-curs:cowardice
-dogs:pack
-doves:dule
-ducks:[pad|ba]dling
-earthquakes:swarm
-eggs:clutch
-elephants:herd
-elk:gang
-ferrets:business
-finches:charm
-firemen:brigade
-fish:school
-foxes:skulk
-geese in flight:skein
-geese on water:gaggle
-goats:trip
-hawks:cast
-hens:brood
-herons:siege
-horses:haras|team
-hounds:kennel
-jellyfish:smack
-kangaroos|monkeys:troop
-kittens:kindle
-lapwings:deceit
-larks:exaltation|bevy
-leopards:leap
-lions:pride
-locusts:plague
-magpies:tidings
-maidens|quail:bevy
-martens:richness
-men:band
-moles:labor
-monkeys|kangaroos:troop
-mountains:range
-mules:barren|baren
-nightingales:watch
-operating companies:at&t|bell system
-owls:parliament
-partridges|grouse:covey
-peacocks:ostentation
-pheasants:bouquet
-plovers:congregation
-ponies:string
-prisoners:gang
-pups:litter
-quail|maidens:bevy
-rabbits:nest
-ravens:unkindness
-rhinoceroses:crash
-roebucks:bevy
-rooks:building
-seals:pod
-sheep:flock
-ships:fleet
-snipe:walk|wisp
-sparrows:host
-squirrels:dray
-starlings:murmuration
-stars:constellation
-storks:mustering
-swallows:flight
-teal:spring
-toads:knot
-turkeys:rafter
-turtledoves:pitying
-whales:gam|pod
-witches:coven
-wolves:route
-woodcocks:fall
-woodpeckers:descent
-{wild }swine:sounder
diff --git a/.ref-Research-V7/usr/games/quiz.k/ed b/.ref-Research-V7/usr/games/quiz.k/ed
deleted file mode 100644 (file)
index 6ac8e89..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-prepare to add text at beginning of file:0a|1i
-find name of file being edited:f
-print last 3 lines of file:$-[2|-],$p
-print previous line:[-|^]{p}|{.}-{1}{p}
-print whole file:1,$p|g/[^|$]/p
-delete this line and next:.{,|;}[{.}+{1}|.1]d
-prepare to replace text from here to just before next "PP":\
-.{,|;}/[PP|{^}\\.PP]/-{1}c
-find next "1.2":/1\\.2/{p}
-find next 2-or-more digit number:\
-/\[[0|1]-9\]\[0-9\]/{p}
-move rest of this paragraph (separated by "PP") to end of previous one:\
-[.,|{.}+{1},|.1,]/[PP|{^}\\.PP]/-{1}m[??|?{^}{\\.}PP?]-{1}
-print every "Oxygen" or "oxygen":[g|1,$g]/\[[Oo|oO]\]xygen/[p|.p]
-change each "BTL" in file to "Bell Laboratories" and check:\
-[g|1,$g]/BTL/[s|.s]/[/|BTL/]Bell Laboratories/gp
-combine every even-numbered line with the next odd-numbered line:\
-2,${-{1}}g/[^|$]/[j|.,{.}+{1}j|.,.1j]
-print next "SH" and following line:\
-/SH/;[{.}+{1}|.1]p|/SH/,[//|/SH/][{.}+{1}|.1]p
-print from next "TS" to following "TE":/TS/;/TE/p
-reverse order of lines in whole file:[g|1,$g]/^/[m|.m]0
-replace each string of x's in current line by one x:\
-[s|.s]/[x|\[x\]][x|\[x\]]*/x/g{p}{  (not s/x*/x/g)}
-change first "hte" in current line to "the" and check:[s|.s]/hte/the/p
-combine previous line and this one:\
-[-,|^,|{.}-{1},].j
-go to line after third "PP" ahead:\
-/[PP|{^}\\.PP]/;[//|/[PP|{^}\\.PP]/];[//|/[PP|{^}\\.PP]/]\
-[{+}1|+]|;[{.}+{1}|.1]{  (not ...p)}
-exchange current line with previous line:\
-[[-|^]m|{.}-{1}m].|{.}m[[--|^^]|{.}-2]
-move everything from here through "stop." to end of file:\
-.,/stop\\./m$
-current line has 2 fields separated by 1 blank; exchange them:\
-[s|.s]/[\\|^\\]([.|\[^ \]]*\\) \\([.|\[^ \]]*\\)[/|$/]\\2 \\1/{p}
-insert a "0" after last "0" on current line:\
-[s|.s]/[.*0/&0|^.*0/&0|0\\(\[^0\]*\\)$/[0&|00\1]|0\[^0\]*$/0&\
-|\[^0\]*$/0&]/{p}
-replace "a*b" by "a**b":s/[a\\*b|a[*]b]/a**b/{p}|\
-s/\\*/**/p
-attach the word "extra" to the end of the current line:\
-[s|.s]/$/{ }extra/{p}
-replace "ATT" in current line by "AT&T":\
-[s|.s]/ATT/AT\\&T/{g}{p}
-double the length of the current line by repetition:\
-[s|.s]/[.*|.|^.*$]/&&/{p}
-look for another line containing what you just looked for://
-find the previous line that contains a capital letter:?\[A-Z\]?{p}
-delete the next line that contains only capital letters:\
-/^\[A-Z\]*$/d|/^\[A-Z\]\[A-Z\]*$/d
-place a copy of current line at the end of the file:\
-t$|.{,.}t$
-find how many lines there are:=|$=
-find the number of the current line:.=
-delete the first 3 lines of the file:1,3d
-delete every line that doesn't begin with "A":\
-[v|1,$v]/^A/d{  (not g/^\[^A\]/d)}
-delete every empty line from here through next "LP":\
-.,/[LP|{{^}\\.}LP]/g/^$/d
-print the line after each "AU":\
-[g|1,$g]/[AU|{^}\\.AU]/[{.}+{1}|.1]{p}
-delete everything after "proud" from current line:\
-[s|.s]/proud.*/proud/{p}
-delete part of current line from "alpha" through "omega":\
-[s|.s]/alpha.*omega//{p}
-save everything up through current line in file "prefix":1,.w prefix
-prepare to add text at end of file:$a
-append the contents of file "suffix" to this file:$r suffix
-go back 10 lines:{.}-10{p}|----------
-change every "01" in current line to "1":[s|.s]/01/1/g{p}
-go to next line that contains a double capital letter:\
-/\\(\[A-Z\]\\)\\1/{p}
-place parens () around current line:\
-[s|.s]/[.*|^.*$]/(&)/{p}
-the current line is too long for your terminal; print it to fit:\
-l|.l
-put the work you've done back in the original file:w
-append the whole file to the file "unfinished":\
-[W|1,$W] unfinished
-insert "\\&" at beginning of current line:\
-[s|.s]/^/\\\\\\&/{p}
-list your current directory:!ls
-stop work on current file and shift to file "other":e other
diff --git a/.ref-Research-V7/usr/games/quiz.k/elements b/.ref-Research-V7/usr/games/quiz.k/elements
deleted file mode 100644 (file)
index aba620a..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-H:1:1.008:Hydrogen
-He:2:4.003:Helium
-Li:3:6.94:Lithium
-Be:4:9.013:Beryllium
-B:5:10.82:Boron
-C:6:12.011:Carbon
-N:7:14.008:Nitrogen
-O:8:16.0:Oxygen
-F:9:19.0:Fluorine
-Ne:10:20.183:Neon
-Na:11:22.991:Sodium
-Mg:12:24.32:Magnesium
-Al:13:26.98:Aluminum
-Si:14:28.09:Silicon
-P:15:30.975:Phosphorus
-S:16:32.066:Sulphur
-Cl:17:35.457:Chlorine
-Ar:18:39.944:Argon
-K:19:39.1:Potassium
-Ca:20:40.08:Calcium
-Sc:21:44.96:Scandium
-Ti:22:47.9:Titanium
-V:23:50.95:Vanadium
-Cr:24:52.01:Chromium
-Mn:25:54.94:Manganese
-Fe:26:55.85:Iron
-Co:27:58.94:Cobalt
-Ni:28:58.71:Nickel
-Cu:29:63.54:Copper
-Zn:30:65.38:Zinc
-Ga:31:69.72:Gallium
-Ge:32:72.6:Germanium
-As:33:74.91:Arsenic
-Se:34:78.96:Selenium
-Br:35:79.916:Bromine
-Kr:36:83.8:Krypton
-Rb:37:85.48:Rubidium
-Sr:38:87.63:Strontium
-Y:39:88.92:Yttrium
-Zr:40:91.22:Zirconium
-Nb:41:92.91:Niobium
-Mo:42:95.95:Molybdenum
-Tc:43:(99):Technetium
-Ru:44:101.1:Ruthenium
-Rh:45:102.91:Rhodium
-Pd:46:106.4:Palladium
-Ag:47:107.88:Silver
-Cd:48:112.41:Cadmium
-In:49:114.82:Indium
-Sn:50:118.7:Tin
-Sb:51:121.76:Antimony
-Te:52:127.61:Tellurium
-I:53:126.91:Iodine
-Xe:54:131.3:Xenon
-Cs:55:132.91:Cesium
-Ba:56:137.36:Barium
-La:57:138.92:Lanthanum
-Ce:58:140.13:Cerium
-Pr:59:140.92:Praseodymium
-Nd:60:144.27:Neodymium
-Pm:61:(145):Promethium
-Sm:62:150.35:Samarium
-Eu:63:152.0:Europium
-Gd:64:157.26:Gadolinium
-Tb:65:158.93:Terbium
-Dy:66:162.51:Dysprosium
-Ho:67:164.94:Holmium
-Er:68:167.27:Erbium
-Tm:69:168.94:Thulium
-Yb:70:173.04:Ytterbium
-Lu:71:174.99:Lutetium
-Hf:72:178.5:Hafnium
-Ta:73:180.95:Tantalum
-W:74:183.86:Tungsten
-Re:75:186.22:Rhenium
-Os:76:190.2:Osmium
-Ir:77:192.2:Iridium
-Pt:78:195.09:Platinum
-Au:79:197.0:Gold
-Hg:80:200.61:Mercury
-Tl:81:204.39:Thallium
-Pb:82:207.21:Lead
-Bi:83:209.0:Bismuth
-Po:84:(210):Polonium
-At:85:(210):Astatine
-Rn:86:(222):Radon
-Fr:87:(223):Francium
-Ra:88:(226):Radium
-Ac:89:(227):Actinium
-Th:90:232.05:Thorium
-Pa:91:(231):Protactinium
-U:92:238.07:Uranium
-Np:93:(237):Neptunium
-Pu:94:(242):Plutonium
-Am:95:(243):Americium
-Cm:96:(248):Curium
-Bk:97:(247):Berkelium
-Cf:98:(249):Californium
-Es:99:(254):Einsteinium
-Fm:100:(253):Fermium
-Md:101:(256):Mendelevium
-No:102:(253):Nobelium
-Lw:103:(259):Lawrencium
diff --git a/.ref-Research-V7/usr/games/quiz.k/europe b/.ref-Research-V7/usr/games/quiz.k/europe
deleted file mode 100644 (file)
index f7ef781..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-Albania:Tirana|Tirane\b"
-Andorra:Andorra la V[ell|iej]a
-Austria:Vienna|Wien
-Belgium:Brussel[s|]|Bruxelles
-Bulgaria:Sofi[a|ya]
-Czechoslovakia:Prague|Praha
-Denmark:Copenhagen|K[o|o\b/]benhavn
-East Germany:Berlin
-United Kingdom|England|Great Britain|UK:London
-Finland:Helsinki
-France:Paris
-Greece:Athens
-Hungary:Budapest
-Iceland:Reykjavik
-Ireland|Eire:Dublin
-Italy:Rom[e|a]
-Liechtenstein:Vaduz
-Luxembourg:Luxembourg
-Malta:Valletta
-Monaco:Monte Carlo
-Netherlands|Holland:The Hague|'sGravenhage|den Haag|Amsterdam
-Norway:Oslo
-Poland:Wars[aw|zawa]
-Portugal:Lisbo[n|a]
-R[u|o]mania:Bucharest|Bucuresti
-San Marino:San Marino
-Spain:Madrid
-Sweden:Stockholm
-Switzerland:Bern{e}
-Turkey:Ankara
-USSR|Russia:Mos[cow|kva]
-[West |]Germany:Bonn
-Yugoslavia:Belgrade|Beograd
diff --git a/.ref-Research-V7/usr/games/quiz.k/greek b/.ref-Research-V7/usr/games/quiz.k/greek
deleted file mode 100644 (file)
index 4833e83..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-$luw$:{I} [loose|destroy]
-$eluon$:{I} [loosed|destroyed|was loosing|was destroying]
-$elusa$:{I} [loosed|destroyed]
-$leluka$:{I} have [loosed|destroyed]
-$lusw$:{I} will [loose|destroy]
-$luswn$:[loosing|destroying]
-$lusas$:{having} [loosed|destroyed]
diff --git a/.ref-Research-V7/usr/games/quiz.k/inca b/.ref-Research-V7/usr/games/quiz.k/inca
deleted file mode 100644 (file)
index 02fd39f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-manco capac:sinchi roca
-sinchi roca:lloque yupanqui
-lloque yupanqui:mayta capac
-mayta capac:capac yupanqui
-capac yupanqui:inca roca
-inca roca:yahuar huacac
-yahuar huacac:viracocha
-viracocha:pachacuti
-pachacuti:tupa inca yupanqui
-tupa inca yupanqui:huayna capac
-huayna capac:huascar
-huascar:atahuallpa
diff --git a/.ref-Research-V7/usr/games/quiz.k/index b/.ref-Research-V7/usr/games/quiz.k/index
deleted file mode 100644 (file)
index 28dd7fa..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/usr/games/quiz.k/state:state:cap{ital}:abbr{ev{iation}}:flower
-/usr/games/quiz.k/america:America{n}:cap{ital}
-/usr/games/quiz.k/europe:Europe{an}:cap{ital}
-/usr/games/quiz.k/africa:Africa{n}:cap{ital}
-/usr/games/quiz.k/pres:pres{ident}:term:succ{essor}
-/usr/games/quiz.k/sov:sov{ereign}:cen{t{ury}}:succ{essor}
-/usr/games/quiz.k/seq-easy:easy{-}{seq{uence}}:next:name
-/usr/games/quiz.k/seq-hard:hard{-}{seq{uence}}:next:name
-/usr/games/quiz.k/posneg:pos{itive}:neg{ative}
-/usr/games/quiz.k/bard:Shakespeare{{-}line{s}}|line{s}:next:work:char{acter}
-/usr/games/quiz.k/murders:victim:killer
-/usr/games/quiz.k/collectives:ind{ividuals}:coll{ective}
-/usr/games/quiz.k/trek:star:trek
-/usr/games/quiz.k/babies:baby:adult
-/usr/games/quiz.k/poetry:poem{-}line:next:poem:author
-/usr/games/quiz.k/midearth:M[iddle{-}Earth|E]:cap{ital}
-/usr/games/quiz.k/inca:inca:succ{essor}
-/usr/games/quiz.k/morse:clear|alpha{bet{ic}}:morse
-/usr/games/quiz.k/sexes:male:female
-/usr/games/quiz.k/greek:greek:english
-/usr/rhm/german:english:german
-/usr/games/quiz.k/latin:latin:english
-/usr/games/quiz.k/locomotive:locomotive:name
-/usr/games/quiz.k/ucc:section:ucc
-/usr/games/quiz.k/chinese:year:next
-/usr/games/quiz.k/elements:symbol:number:weight:element
-/usr/games/quiz.k/province:province:cap{ital}
-/usr/games/quiz.k/asia:Asia{n}:cap{ital}
-/usr/games/quiz.k/arith:arith{metic}:ans{wer}
-/usr/games/quiz.k/areas:area{-code}:state{-region}:city
-/usr/games/quiz.k/ed:function:ed-command
diff --git a/.ref-Research-V7/usr/games/quiz.k/latin b/.ref-Research-V7/usr/games/quiz.k/latin
deleted file mode 100644 (file)
index 0b03bd3..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-condo:{I }found
-condidi:{I }founded
-laedo:{I }[injure|thwart]
-impello:{I }[drive|force]
-impulit:{he }[drove|forced]
-sino:{I }permit
-sinat:{he }permit{s}
-dolor:pain|grief
-invideo:{I }[envy|hate]
-invisus:[hated|envied]
-immitis:cruel|harsh
-arceo:{I }[keep away|hinder|prevent]
-ratis:ship
-antrum:cave
-freno:rein{ in}|curb|check
-celsus:lofty
-spelunca:cave{rn}
-foedus (n.):agreement|treaty|truce
-foedera:agreements|treaties
-laxus:loose|free
-habena:rein{s}
-mulceo:soothe|calm
-fluctus (n.):wave{s}
-exigo:finish|spend
-exegit:{he }[finished|spent]
-opto (v.):desire|wish
-optat:{he }[desire{s}|wish{es}]
-capesso:seize|carry out
-concilio (v.):secure|gain
-converto:reverse
-procella:blast|gust
-polus:sky|heaven
-mico:flash|gleam
-extemplo:immediately
-frigus (n.):cold|chill
-ingemo:groan
-os (n.):mouth
-effundo:pour{ out}
-corripio:snatch|catch
-harena:sand
-excutio:shake{ off}
-nare:{to }swim
-rima:crack|fissure
-fatisco:gape{ open}
-disjicio:scatter|disperse
-dolus (n.):deceit
-luo:wash{ away}|atone{ for}
-cito (adv.):quickly|soon
-tumidus:swollen
-fugo:put to flight|drive out
-adnitor:strive
-seditio:riot|uprising
-fax:fire{-}brand
-volo (v.):fly
-arrigo:prick up
-cunctus:whole|entire
-flecto:turn|guide
-sinus:bay|fold|curve|gulf
-scindo:split|divide
-rupes:crag|cliff
-geminus:twin
-minatur:{he }threaten{s}
-coruscus:flashing|waving
-horreo:bristle
-nemus:grove
-nemora:groves
-umbra:shade|shadow
-intus:within
-dulcis:sweet|fresh
-sedile:seat|bench
-fessus:weary|tired
-uncus:hooked|curved
-morsus:bite
-artus:joint|limb
-silex:flint
-scintilla:spark
-folium:leaf
-aridus:dry
-corrumpo:spoil|ruin
-corrupit:{he }[spoil{ed}|ruin{ed}]
-frux:grain
-torreo:parch
-celsus:high|lofty
-cervus:stag
-erro:wander
-armentum:herd
-pasco:feed|nourish
-pascor:graze
-arcus:bow
-turba:crowd
-sterno:strew
-humus:ground|earth
-vinum:wine
-maereo:mourn|sorrow
-ignarus:unknowing|ignorant|inexperienced
-rabies:rage|fury
-penitus:within
-sono (v.):sound|roar
-maestus:sad|gloomy
-forsan:perhaps
-olim:someday|sometime
-memini:{I }remember
-varius:different
-discrimen:crisis|danger
-quiesco:become quiet
-refert:{he }[say{s}|tell{s}]
-vultus:face|countenance
-cor:heart
-corda:hearts
-dolor:pain|grief
-daps:feast
-dapes:feasts
-viscus:flesh
-seco:cut
-tremo:quiver
-pinguis:fat|rich
-mensa:table
-sermo:talk|discourse
-dubius:doubtful|wavering
-pius:dutiful|devoted|loyal
-gemo:lament|moan|bemoan
-crudelis:cruel|bitter
-lumen:light|eye
-lumina:lights|eyes
-tristis:sad
-lacrima:tear
-niteo:shine|glisten
-fulmen:thunderbolt|lightning
-fulmina:thunderbolts
-funus:death|disaster
-funera:deaths|disasters
-orbis terrarum:world
-ductor:leader
-dicio (n.):power
-fons:spring|source
-fontes:springs|sources
-arvum:land
-infandus:unspeakable
-rideo:laugh
-osculum:lip
-libo:sip|touch|kiss
-nata:daughter
-haereo:{I }[stick to|adhere]
-promitto:primise
-sublimis:high|uplifted|up high
-quando:since|when|because
-arcanum:{a }secret
-ferox:fierce|savage
-contundo:crush
-albus:white
-donec:until
-sacerdos:priest{ess}
-lupus:wolf
-nutrix:nurse
-nutrices:nurses
-fulvus:tawny|yellow
-meta:limit|boundary
diff --git a/.ref-Research-V7/usr/games/quiz.k/locomotive b/.ref-Research-V7/usr/games/quiz.k/locomotive
deleted file mode 100644 (file)
index a29cc01..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-4-4-0:American
-4-6-0:Mogul
-4-4-2:Atlantic
-4-6-2:Pacific
-2-8-0:Consolidation
-2-8-2:Mikado
-4-8-2:Mountain
-2-8-4:Berkshire
-4-6-4:Hudson
-4-8-4:Northern
-2-10-2:Decapod
diff --git a/.ref-Research-V7/usr/games/quiz.k/midearth b/.ref-Research-V7/usr/games/quiz.k/midearth
deleted file mode 100644 (file)
index 17e21c0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Shire:Michel Delving|Hobbiton
-Mordor:Minas Morgul
-Gondor:Minas Tirith
-Umbar:{City of the }Corsairs
-Rhovanion:Esgaroth{ upon the Long Lake}
-Rohan:Edoras
-Lothl['\bo|o|o\b']rien:Caras Galadon
-Breeland:Bree
-Arnor:Ann['\bu|u\b'|u]minas
-Arthedain:Fornost{ Erain}|Norbury of the Kings
diff --git a/.ref-Research-V7/usr/games/quiz.k/morse b/.ref-Research-V7/usr/games/quiz.k/morse
deleted file mode 100644 (file)
index 4086374..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-A:.-
-B:-...
-C:-.-.
-D:-..
-E:.
-F:..-.
-G:--.
-H:....
-I:..
-J:.---
-K:-.-
-L:.-..
-M:--
-N:-.
-O:---
-P:.--.
-Q:--.-
-R:.-.
-S:...
-T:-
-U:..-
-V:...-
-W:.--
-X:-..-
-Y:-.--
-Z:--..
diff --git a/.ref-Research-V7/usr/games/quiz.k/murders b/.ref-Research-V7/usr/games/quiz.k/murders
deleted file mode 100644 (file)
index 30cf324..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Cock Robin:{the }sparrow
-sleep|Duncan:Macbeth
-{the }cat:curiosity|care
-{John {F{.} }}Kennedy|JFK:{Lee Harvey }Oswald|{the }FBI|{the }CIA
-{Lee Harvey }Oswald:{Jack }Ruby|{the }FBI|{the }CIA
-{Martin Luther }King:{James {Earl }}Ray|{the }FBI|{the }CIA
-[Bobby |Robert {F{.} }]Kennedy|RFK:{Sirhan }Sirhan|{the }FBI|{the }CIA
-Christ:{the }Romans|{Pontius }Pilate|{the }CIA
-{Sharon }Tate:{Charles }Manson
-Charles Lindbergh Jr{.}:{Bruno }Hauptman{n}
-{Mr{.} }{{and }Mrs{.} }Borden|{her }parents:Lizzie{ Borden}
-{Prof{essor} }{James }Moriarty:{Sherlock }Holmes
-Achilles:Paris
-Abel:Cain
-{the }nurses:{Richard }Speck
-{J{.} |Julius }Caesar:Brutus{ et al.}
-Pompeii:Vesuvius
-{Abraham |Abe }Lincoln:{John {Wilkes }}Booth
-{Yukio }Mishima:{Yukio }Mishima
-{Alexander }Hamilton:{Aaron }Burr
-Cleopatra:{the |an }asp
-[Ann Boleyn|Catharine Howard]:Henry{ VIII}
-vaudeville:{the }movies|film
-{the }movies|film:TV|television
-{the }VA patients:{the }nurses
diff --git a/.ref-Research-V7/usr/games/quiz.k/poetry b/.ref-Research-V7/usr/games/quiz.k/poetry
deleted file mode 100644 (file)
index f4c07d6..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-Come live with me and be my love:\
-And we will all the pleasures prove:\
-{The }Passionate Shepherd{ to his Love}:\
-{Christopher }Marlowe
-Shall I compare thee to a summer's day{?}:\
-Thou art more lovely and more temperate:\
-Sonnet 18:\
-{William }Shakespeare
-Fine knacks for ladies, cheap, choice, brave, and new!:\
-Good pennyworths{! }but money cannot move:\
-Fine Knacks{ for Ladies}:\
-{John }Dowland
-My mind to me a kingdom is:\
-Such perfect joy therein I find:\
-My Mind to Me a Kingdom Is:\
-{Sir }{Edward }Dyer
-Underneath this stone doth lie:\
-As much beauty as could die:\
-Epitaph on Elizabeth{,} {L. H.}:\
-{Ben }Jonson
-Death be not proud, though some have called thee:\
-Mighty and dreadful{,} for thou art not so:\
-{Holy }Sonnet{s}{ 10}:\
-{John }Donne
-Gather ye rose-buds while ye may:\
-Old Time is still a-flying:\
-To the Virgins{,} {To Make Much of Time}:\
-{Robert }Herrick
-Why so pale and wan, fond lover?:\
-Prithee{,} why so pale{?}:\
-Song:\
-{Sir }{John }Suckling
-Stone walls do not a prison make:\
-Nor iron bars a cage:\
-To Althea{,} From Prison:\
-{Richard }Lovelace
-I could not love thee (Dear) so much,:\
-Lov['|e]d I not hono{u}r more:\
-To Lucasta{, Going to the Wars}:\
-{Richard }Lovelace
-I saw Eternity the other night:\
-Like a great ring of pure and endless light:\
-{The }World:\
-{Henry }Vaughan
-Come and trip it as you go,:\
-On the light fantastic toe:\
-L'Allegro:\
-{John }Milton
-When I consider how my light is spent:\
-Ere half my days in this dark world and wide:\
-On His Blindness|When I Consider:\
-{John }Milton
-The grave's a fine and private place{,}:\
-But none{,} I think{,} do there embrace{.}:\
-To His Coy Mistress:\
-{Andrew }Marvel
-Great wits are sure to madness near allied:\
-And thin partitions do their bounds divide:\
-Absalom and Achitophel|Absalom:\
-{John }Dryden
-A little learning is a dangerous thing{;}:\
-Drink deep{,} or taste not the Pierian spring{.}:\
-{An }Essay on Criticism|{On }Criticism:\
-{Alexander }Pope
-The curfew tolls the knell of parting day{,}:\
-The lowing herd wind slowly o'er the lea:\
-Elegy{ Written in a Country Church{-| }Yard:\
-{Thomas }Gray
-The best laid schemes o' mice an' men gang aft a-gley{,}:\
-An{'|d} lea{'|v}e us nought but grief an{'|d} pain for promised joy{.}:\
-To a Mouse:\
-{Robert }Burns
-Tiger! tiger! burning bright!:\
-In the forests of the night:\
-{The }Tiger:\
-{William }Blake
-My heart leaps up when I behold:\
-A rainbow in the sky:\
-My Heart Leaps Up:\
-{William }Wordsworth
-The world is too much with us; late and soon{,}:\
-Getting and spending{,} we lay waste our powers:\
-{The }World is Too Much With Us|Sonnet:\
-{William }Wordsworth
-A sadder and a wiser man{,}:\
-He rose the morrow morn:\
-{The }{Rime of }{The }Ancient Mariner:\
-{Samuel }{Taylor }Coleridge
-In Xanadu did Kubla Khan:\
-A stately pleasure{-| }dome decree:\
-Kubla Khan:\
-{Samuel }{Taylor }Coleridge
-She walks in beauty, like the night:\
-Of cloudless climes and starry skies:\
-She Walks in Beauty:\
-{George Gordon, }{Lord }Byron
-I want a hero- an uncommon want{,}:\
-When every year and month sends forth a new one:\
-Don Juan{ Canto I}:\
-{George Gordon, }{Lord }Byron
-A thing of beauty is a joy forever.:\
-Its loveliness increases{;|.} {it will never/Pass into nothingness}:\
-Endymion{ Book I}:\
-{John }Keats
-Matched with an aged wife, I mete and dole:\
-Unequal laws unto a savage race:\
-Ulysses:\
-{Alfred{,} }{Lord }Tennyson
-He will hold thee, when his passion shall have spent its novel force{,}:\
-Something better than his dog{,} a little dearer than his horse:\
-Locksley Hall:\
-{Alfred{,} }{Lord }Tennyson
-'Tis better to have loved and lost:\
-Than never to have loved at all:\
-{In }Memoriam{ A. H. H.}:\
-{Alfred{,} }{Lord }Tennyson
-Kind hearts are more than coronets,:\
-And simple faith than Norman blood{.}:\
-Lady Clara Vere de Vere:\
-{Alfred{,} }{Lord }Tennyson
-Oh, to be in England:\
-Now that April's there:\
-Home{-| }Thoughts{,} From Abroad:\
-{Robert }Browning
-Ah, but a man's reach should exceed his grasp{,}:\
-Or what's a heaven for{?}:\
-Andrea Del Sarto:\
-{Robert }Browning
-How do I love thee? Let me count the ways.:\
-I love thee to the depth and breadth and height:\
-Sonnet{s} {From the Portuguese}{ 43}:\
-{Elizabeth }{Barrett }Browning
-A Book of Verses underneath the Bough{,}:\
-A Jug of Wine, a Loaf of Bread{-|,| }and Thou:\
-{The }Rubaiyat{ of Omar Khayyam}{ 12}:\
-{Edward }Fitzgerald
-The Moving Finger writes; and, having writ,:\
-Moves on{\:|,|.} nor all your Piety nor Wit:\
-{The }Rubaiyat{ of Omar Khayyam}{ 71}:\
-{Edward }Fitzgerald
-Ah Love! could you and I with Him conspire:\
-To grasp this sorry Scheme of Things entire:\
-{The }Rubaiyat{ of Omar Khayyam}{ 99}:\
-{Edward }Fitzgerald
-Remember me when I am gone away,:\
-Gone far away into the silent land:\
-Remember:\
-{Christina }Rossetti
-Home is the sailor, home from the sea,:\
-And the hunter home from the hill:\
-Requiem:\
-{Robert }{Louis }Stevenson
-I fled Him, down the nights and down the days;:\
-I fled Him, down the arches of the years:\
-{The }Hound of Heaven:\
-{Francis }Thompson
-So 'ere's to you, Fuzzy-Wuzzy, at your 'ome in the Soudan;:\
-You're a {pore|poor} benighted {'|h}eathen but a first class fightin{'|g} man:\
-Fuzzy{-| }Wuzzy:\
-{Rudyard }Kipling
-Morns abed and daylight slumber:\
-Were not meant for man alive:\
-Reveille:\
-{A{.}{ }E{.}{ }}Houseman
-I will arise and go now, and go to Innisfree,:\
-And a small cabin build there{,} of clay and wattles made:\
-{The }{Lake Isle of }Innisfree:\
-{William }{Butler }Yeats
-I must go down to the seas again, to the lonely sea and the sky,:\
-And all I ask is a tall ship and a star to steer her by:\
-Sea{-| }Fever:\
-{John }Masefield
-April is the cruelest month, breeding:\
-Lilacs out of the dead land:\
-{The }Waste{ }Land:\
-{T{.}{ }S{.}{ }}Eliot
-Now as I was young and easy under the apple boughs:\
-About the little house and happy as the grass was green:\
-Fern Hill:\
-{Dylan }Thomas
-Of Man's first disobedience, and the fruit:\
-Of that forbidden tree{,} whose mortal taste:\
-Paradise Lost:\
-{John }Milton
diff --git a/.ref-Research-V7/usr/games/quiz.k/posneg b/.ref-Research-V7/usr/games/quiz.k/posneg
deleted file mode 100644 (file)
index 03fde40..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-large|big:small
-on:off
-standing up:sitting down
-inside:outside
-high:low
-old:new|young
-hot:cold
-out:in
-heavy|dark:light
-daytime:night[time| time]
-stop|come:go
-top:bottom
-floor:ceiling
-near:far
-run:walk
-empty|hungry:full
-backwards:f[or|ront]wards
-big|large:little|small
-fat|thick:thin|skinny
-bright|light:dark|dull
-right:wrong|left
-give:take|receive|get
-buy:sell
-shiny|bright:dull
-dawn:dusk
-fall down|go to bed:[get|stand|rise] up
-asleep:awake
-up:down
-open[\ 1|ed|]:close[d|]
-smile:frown|cry
-happy|glad:sad
-hard:soft|easy
-boy|woman|lady:girl|man
-fast:slow
-wet:dry
-covered|hid[den|]:uncovered|open
-good:bad
-always|sometimes|now:never|sometimes
-beautiful|pretty:ugly
-rough:smooth
-hairy:bald||smooth
-above:below
-yin:yang
-sweet:sour
-if:unless
-from|fro:to
-with[\ 1|in|]:without|against
-after:before
-together:apart
-plus:minus
diff --git a/.ref-Research-V7/usr/games/quiz.k/pres b/.ref-Research-V7/usr/games/quiz.k/pres
deleted file mode 100644 (file)
index 49da275..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-{G{eorge} }Washington:1789-{17}97:{J{ohn} }Adams
-{J{ohn} }Adams:1797-1801:{T{homas} }Jefferson
-{T{homas} }Jefferson:1801-{{18}0}9:{J{ames} }Madison
-{J{ames} }Madison:1809-{18}17:{J{ames} }Monroe
-{J{ames} }Monroe:1817-1825:{J{ohn} }{Q{uincy} }Adams
-{J{ohn} }{Q{uincy} }Adams:1825-{{18}2}9:{A{ndrew} }Jackson
-{A{ndrew} }Jackson:1829-{18}37:{M{artin} }Van Buren
-{M{artin} }Van Buren:1837-{18}41:{W{illiam|m} }{H{enry} }Harrison
-{W{illiam|m} }{H{enry} }Harrison:1841:{J{ohn} }Tyler
-{J{ohn} }Tyler:1841-{{18}4}5:{J{ames} }{K{nox} }Polk
-{J{ames} }{K{nox} }Polk:1845-{{18}4}9:{Z{achary} }Taylor
-{Z{achary} }Taylor:1849-{18}50:{M{illard} }Fillmore
-{M{illard} }Fillmore:1850-{{18}5}3:{F{ranklin} }Pierce
-{F{ranklin} }Pierce:1853-{{18}5}7:{J{ames} }Buchanan
-{J{ames} }Buchanan:1857-{18}61:{A{braham|be} }Lincoln
-{A{braham|be} }Lincoln:1861-{{18}6}5:{A{ndrew} }Johnson
-{A{ndrew} }Johnson:1865-{{18}6}9:{U{lysses} }{S{impson} }Grant
-{U{lysses} }{S{impson} }Grant:1869-{18}77:{R{utherford} }{B{irchard} }Hayes
-{R{utherford} }{B{irchard} }Hayes:1877-{18}81:{J{ames} }{A{bram} }Garfield
-{J{ames} }{A{bram} }Garfield:1881:{C{hester} }{A{lan} }Arthur
-{C{hester} }{A{lan} }Arthur:1881-{{18}8}5:{G{rover} }Cleveland{ (1st term)}
-{G{rover} }Cleveland{ (1st term)}:1885-{{18}8}9:{B{enjamin} }Harrison
-{B{enjamin} }Harrison:1889-{18}93:{G{rover} }Cleveland{ (2nd term)}
-{G{rover} }Cleveland{ (2nd term)}:1893-{18}97:{W{illiam|m} }McKinley
-{W{illiam|m} }McKinley:1897-1901:{T{heodore|eddy} }Roosevelt|TR
-{T{heodore|eddy} }Roosevelt|TR:1901-{{19}0}9:{W{illiam|m} }{H{oward} }Taft
-{W{illiam|m} }{H{oward} }Taft:1909-{19}13:{W{oodrow} }Wilson
-{W{oodrow} }Wilson:1913-{19}21:{W{arren} }{G{amaliel} }Harding
-{W{arren} }{G{amaliel} }Harding:1921-{{19}2}3:{C{alvin} }Coolidge
-{C{alvin} }Coolidge:1923-{{19}2}9:{H{erbert} }Hoover
-{H{erbert} }Hoover:1929-{19}33:{F{ranklin} }{D{elano} }Roosevelt|FDR
-{F{ranklin} }{D{elano} }Roosevelt|FDR:1933-{19}45:{H{arry} }{S }Truman
-{H{arry} }{S }Truman:1945-{19}53:{D{wight} }{D{avid} }Eisenhower
-{D{wight} }{D{avid} }Eisenhower:1953-{19}61:{J{ohn} }{F{itzgerald} }Kennedy|JFK
-{J{ohn} }{F{itzgerald} }Kennedy|JFK:1961-{{19}6}3:{L{yndon} }{B{aines} }Johnson|LBJ
-{L{yndon} }{B{aines} }Johnson|LBJ:1963-{{19}6}9:{R{ichard} }{M{ilhouse} }Nixon
-{R{ichard} }{M{ilhouse} }Nixon:1969-{19}74:{G{erald} }{R{obert} }Ford
-{G{erald} }{R{obert} }Ford:1974-:
diff --git a/.ref-Research-V7/usr/games/quiz.k/province b/.ref-Research-V7/usr/games/quiz.k/province
deleted file mode 100644 (file)
index 63e044c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Newfoundland{ and Labrador}:[St.|Saint] John's
-New Brunswick:Fredericton
-Prince Edward Island:Charlottetown
-Nova Scotia:Halifax
-Quebec:Quebec
-Ontario:Toronto
-Manitoba:Winnipeg
-Saskatchewan:Regina
-Alberta:Edmonton
-British Columbia:Victoria
-Yukon Territory:Whitehorse
-Northwest Territories:Yellowknife
-Canada:Ottawa
diff --git a/.ref-Research-V7/usr/games/quiz.k/seq-easy b/.ref-Research-V7/usr/games/quiz.k/seq-easy
deleted file mode 100644 (file)
index e88cefa..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-1,2,3,4,5,6:7{(integers)}:integers|[natural|counting] numbers
-1,2,3,5,8,13:21{(Fibonacci)}:Fibonacci{ seq{ence}| numbers}
-1,2,4,8,16,32:64{(powers of 2)}:powers of 2|2[**|^]n
-1,2,6,24,120,720:5040{(factorials)}:factorials|n!
-1,3,5,7,9,11:13{(odd nos.)}:odd [integ|numb]ers
-1,3,6,10,15,21:28{(triangular)}:triangular{ numbers}|C(n,2)
-1,3,9,27,81:243{(powers of 3)}:powers of 3|3[**|^]n
-1,4,9,16,25:36{(squares)}:squares|n[**|^]2
-1,4,16,64:256{(powers of 4)}:powers of 4|4[**|^]n
-1,5,25,125:625{(powers of 5)}:powers of 5|5[**|^]n
-1,8,27,64,125:216{(cubes)}:cubes|n[**|^]3
-2,3,5,7,11,13:17{(primes)}:prime[ number]s
-2,4,6,8,10,12:14{(even nos.)}:even [integ|numb]ers|multiples of 2|2n
-3,6,9,12,15:18{(3n)}:multiples of 3|3n
diff --git a/.ref-Research-V7/usr/games/quiz.k/seq-hard b/.ref-Research-V7/usr/games/quiz.k/seq-hard
deleted file mode 100644 (file)
index 9d9373f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-1,1,2,1,2,2,3,1,2,2,3,2,3,3,4:1{(1's in binary nos)}:number of 1's in binary numbers
-1,1,2,2,4,2,6,4,6,4,10:4{(phi(n))}:Euler's [totient|phi]{ function}|phi(n)
-1,2,2,4,2,4,2,4,6,2:6{(diff of primes)}:diff{erences} [between|of] primes
-1,2,4,11,34:156{(unlabeled graphs)}:{unlabeled }graphs
-1,2,5,14,42,132:429{(Catalan)}:Catalan{ numbers}
-1,2,5,16,61:272{(Euler)}:Euler{ numbers}
-1,3,12,60,360:2520{(n!/2)}:Even permutations|n!/2
-1,3,16,125,1296,16807:262144{(n**(n-2))}:{labeled }trees|n[**|^](n-2)
-1,4,10,20,35,56:84{(C(n,3))}:Tetrahedral{ numbers}|C(n,3)
-1,4,11,20,31,44,61:100{(n**2 base 8)}:[Squares|n[**|^]2} base 8|octal squares
-1,4,16,256:65536{(2**2**n)}:{labeled }boolean functions|2[**|^]2[**|^]n
-1,6,28:496{(perfect nos)}:perfect{ numbers}
-2,7,1,8,2,8:1{(e)}:{digits of }e
-3,1,4,1,5,9:2{(pi)}:{digits of }pi
-3,7,31,127:8191{(Mersenne primes)}:Mersenne{ primes}
diff --git a/.ref-Research-V7/usr/games/quiz.k/sexes b/.ref-Research-V7/usr/games/quiz.k/sexes
deleted file mode 100644 (file)
index 78c583a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Y|y:X|x
-abbot:abbess
-alumnus:alumna
-ambassador:ambassadress
-boar:sow
-buck:doe
-bull:cow
-cob:pen
-colt:filly
-curator:curatrix
-dog:bitch|vixen
-duke:duchess
-drake:duck
-effeminate|womanish:mannish
-gander:goose
-gentleman:lady|gentlewoman
-jack:jenny
-lad:lass
-manly:womanly
-marquis:marchioness[|e]|marquise
-monk:nun
-[O|o]edipus complex:[E|e]lectra[| complex]
-prince:princess
-ram:ewe
-rooster|cock:hen
-stallion:mare
diff --git a/.ref-Research-V7/usr/games/quiz.k/sov b/.ref-Research-V7/usr/games/quiz.k/sov
deleted file mode 100644 (file)
index c02d417..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-W[illia|]m [I|1|the Conqueror]:11:W[illia|]m [II|2|Rufus|the Red]
-W[illia|]m [II|2|Rufus|the Red]:11:Hen[ry|] [I|1]
-Hen[ry|] [I|1]:12:Stephen
-Stephen:12:Hen[ry|] [II|2]
-Hen[ry|] [II|2]:12:Rich[ard|] [I|1]
-Rich[ard|] [I|1]:12:John
-John:13|12-13:Hen[ry|] [III|3]
-Hen[ry|] [III|3]:13:Ed[w[ard|]|] [I|1]
-Ed[w[ard|]|] [I|1]:13-14|13|14:Ed[w[ard|]|] [II|2]
-Ed[w[ard|]|] [II|2]:14:Ed[w[ard|]|] [III|3]
-Ed[w[ard|]|] [III|3]:14:Rich[ard|] [II|2]
-Rich[ard|] [II|2]:14:Hen[ry|] [IV|4] Part 1
-Hen[ry|] [IV|4] Part 1:15|14-15:Hen[ry|] [IV|4] Part 2
-Hen[ry|] [IV|4] Part 2:15|14-15:Hen[ry|] [V|5]
-Hen[ry|] [V|5]:15:Hen[ry|] [VI|6]
-Hen[ry|] [VI|6]:15:Ed[w[ard|]|] [IV|4]
-Ed[w[ard|]|] [IV|4]:15:Ed[w[ard|]|] [V|5]
-Ed[w[ard|]|] [V|5]:15:Rich[ard|] [III|3]
-Rich[ard|] [III|3]:15:Hen[ry|] [VII|7]
-Hen[ry|] [VII|7]:15-16|15|16:Hen[ry|] [VIII|8]
-Hen[ry|] [VIII|8]:16:Ed[w[ard|]|] [VI|6]
-Ed[w[ard|]|] [VI|6]:16:Mary
-Mary:16:Eliz[abeth|][ [I|1]|]
-Elizabeth[ [I|1]|]:16-17|16:Ja[me|]s [I|1]
-Ja[me|]s [I|1]:17:Cha[rle|]s [I|1]
-Cha[rle|]s [I|1]:17:[Oliver |]Cromwell
-[Oliver |]Cromwell:17:Rich[ard|] Cromwell
-Rich[ard|] Cromwell:17:Ch[arle|]s [II|2]
-Cha[rle|]s [II|2]:17:Ja[me|]s [II|2]
-Ja[me|]s [II|2]:17:W[illia|]m and Mary
-W[illia|]m and Mary:17-18|17:Anne
-Anne:18:Geo[rge|] [I|1]
-Geo[rge|] [I|1]:18:Geo[rge|] [II|2]
-Geo[rge|] [II|2]:18:Geo[rge|] [III|3]
-Geo[rge|] [III|3]:18-19|18|19:Geo[rge|] [IV|4]
-Geo[rge|] [IV|4]:19:W[illia|]m [IV|4]
-W[illia|]m [IV|4]:19:Victoria
-Victoria:19:Ed[w[ard|]|] [VII|7]
-Ed[w[ard|]|] [VII|7]:19-20|19|20:Geo[rge|] [V|5]
-Geo[rge|] [V|5]:20:Ed[w[ard|]|] [VIII|8]
-Ed[w[ard|]|] [VIII|8]:20:Geo[rge|] [VI|6]
-Geo[rge|] [VI|6]:20:Eliz[abeth|] [II|2]
diff --git a/.ref-Research-V7/usr/games/quiz.k/spell b/.ref-Research-V7/usr/games/quiz.k/spell
deleted file mode 100644 (file)
index 75ce1e8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-The son went behind a cloud.:sun
-Did you see the monky at the zoo?:monkey
diff --git a/.ref-Research-V7/usr/games/quiz.k/state b/.ref-Research-V7/usr/games/quiz.k/state
deleted file mode 100644 (file)
index 247228d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-Alabama|Ala|AL:Montgomery:AL:camellia
-Alaska|AK:Juneau:AK:forget{-| }me{-| }not
-Arizona|Ariz|AZ:Phoenix:AZ:{saguaro }cactus{ blossom}
-Arkansas|Ark|AR:Little Rock:AR:apple{ blossom}
-Cal{if{ornia}}|CA:Sacramento:CA:{golden }poppy
-Col{o{rado}}|CO:Denver:CO:{Rocky Mountain }columbine
-Conn{ecticut}|CT:Hartford:CT:{mountain }laurel
-Del{aware}|DE:Dover:DE:peach{ blossom}
-Fl{orid}a|FL:Tallahassee:FL:orange{ blossom}
-Georgia|Ga:Atlanta:GA:{Cherokee }rose
-Hawaii|HI:Honolulu:HI:hibiscus
-Idaho|Ida|ID:Boise:ID:syringa
-Ill{inois}|IL:Springfield:IL:violet
-Ind{iana}|IN:Indianapolis:IN:peony
-Iowa|Ia:Des Moines:IA:{wild }rose
-Kans{as}|Kan|KS:Topeka:KS:sun{ }flower
-Kentucky|Ky:Frankfort:KY:goldenrod
-Louisiana|La:Baton Rouge:LA:magnolia
-Maine|Me:Augusta:ME:{white }pine{ }cone{ and}{ tassel}
-Maryland|Md:Annapolis:MD:blackeyed susan
-Mass{achusetts}|MA:Boston:MA:{trailing }arbutus
-Mich{igan}|MI:Lansing:MI:apple{ blossom}
-Minn{esota}|MN:Saint Paul|St Paul:MN:{showy }lady{-|'s | }slipper
-Miss{issippi}|MS:Jackson:MS:magnolia
-Missouri|Mo:Jefferson City:MO:hawthorn
-Mont{ana}|MT:Helena:MT:bitterroot
-Nebraska|Neb|NE|NB:Lincoln:NE|NB:goldenrod
-Nevada|Nev|NV:Carson City:NV:sagebrush
-New Hampshire|NH:Concord:NH:{purple }lilac
-New Jersey|NJ:Trenton:NJ:violet
-New Mexico|NM:Santa Fe:NM:yucca
-New York|NY:Albany:NY:rose
-N{orth} Carolina|NC:Raleigh:NC:{flowering }dogwood
-N{orth} Dakota|ND:Bismarck:ND:{wild }{prairie }rose
-Ohio|OH|O:Columbus:OH:{scarlet }carnation
-Oklahoma|Okla|OK:Oklahoma City:OK:mistletoe
-Oregon|Ore|OR:Salem:OR:{Oregon }grape
-Pennsylvania|Pa:Harrisburg:PA:{mountain }laurel
-Rhode Island|RI:Providence:RI:violet
-S{outh} Carolina|SC:Columbia:SC:{yellow }jasmine
-S{outh} Dakota|SD:Pierre:SD:{American }pasque{{f| f}lower}
-Tenn{essee}|TN:Nashville:TN:iris
-Texas|Tex|TX:Austin:TX:blue{-| }bonnet
-Utah|UT:Salt Lake City:UT:{sego }lily
-Vermont|Vt:Montpelier:VT:{red }clover
-Virginia|Va:Richmond:VA:{flowering }dogwood
-Wash{ington}|WA:Olympia:WA:{western }rhododendron
-W{est} Virginia|W{ }Va|WV:Charleston:WV:rhododendron
-Wisconsin|Wis|WI:Madison:WI:violet
-Wyo{ming}|WY:Cheyenne:WY:Indian paint brush
diff --git a/.ref-Research-V7/usr/games/quiz.k/trek b/.ref-Research-V7/usr/games/quiz.k/trek
deleted file mode 100644 (file)
index f800fe9..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-captain's name:{James |Jim }{T. }Kirk|{james |jim}{t. }kirk
-first officers name:Spock|spock|Mr. Spock|mr. spock
-name of ship:{the }{u.s.s. }enterprise|Enterprise
-name of the "good guys":{the }Federation|federation|{the }federation
-name of the "bad guys":{the }klingons|{the }romulans
-nickname of chief engineer:scotty|Scotty
-nickname of chief medical officer:bones|Bones
-machine use for transportation to surface of nearby planet:transporter|shuttlecraft
-main engines of ship:warp engines|warp
-number of crew:400|four hundred
-hand-held weapon:phaser
-type of torpedoes used on the ship:photon torpedoes|photon
-name of electronic protective device on ship:shields|shield
-name of device that makes a ship invisible:cloaking device|cloak|cloaking
-type of voice that the on-board computer has:female|feminine|woman's
-where first officer comes from:vulcan|Vulcan
-rare, but very powerful enemies:romulans|Romulans
-reaction that main engines operate on:matter-antimatter{ reaction}|matter/antimatter{ reaction}
-slow engines used in emergencies:impulse engines|impulse
diff --git a/.ref-Research-V7/usr/games/quiz.k/ucc b/.ref-Research-V7/usr/games/quiz.k/ucc
deleted file mode 100644 (file)
index d852b95..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-1-103:supplementary general principles of law applicable
-1-106:remedies to be liberally administered
-1-201:general definitions
-1-203:obligation of good faith
-1-205:course of dealing and usage of trade
-1-206:statue of frauds for kinds of personal property not otherwise covered
-2-103:definitions-sales
-2-201:statute of frauds
-2-208:course of performance or practical consideration
-2-302:unconscionable contract or clause
-2-310:open time for payment or running of credit
-2-319:FOB and FAS terms
-2-320:CIF and C&F terms
-2-323:form of bill of lading required in overseas shipment
-2-401:passing of title; reservation for security
-2-402:rights of seller's creditors against sold goods
-2-403:powr to transfer; good faith purchase of goods; entrusting
-2-501:insurable interest in goods; manner of identification of goods
-2-502:buyer's right to goods on seller's insolvency
-2-503:manner of seller's tender of delivery
-2-506:rights of financing agency
-2-507:effect of seller's tender; delivery on condition
-2-508:cure by seller of improper tender or delivery; replacement
-2-509:risk of loss in the absence ogf breach
-2-510:effect of breach on risk of loss
-2-513:buyer's right to inspection of goods
-2-601:buyer's rights on improper delivery
-2-602:manner and effect of rightful rejection
-2-603:merchant buyer's duties as to rightfully rejected goods
-2-605:waiver of buyer's objections by failure to particularize
-2-606:what constitutes acceptance of goods
-2-607:effect of acceptance; notice of breach
-2-608:revocation of acceptance in whole or in part
-2-609:right to adequate assurance of performance
-2-610:anticipatory repudiation
-2-611:retraction of anticipatory repudiation
-2-612:installment contract; breach
-2-702:seller's remedies on discovery o buyer's insolvency
-2-703:seller's remedies in general
-2-705:seller's stoppage of delivery in transit or otherwise
-2-706:seller's resale including contract for resale
-2-708:seller's damages for non-acceptance or repudiation
-2-709:action for the price
-2-711:buyer's remedies in general; buyer's security interest in rejected goods
-2-712:cover; buyer's procurement of substitute goods
-2-713:buyer's damages for on-delivery or repudiation
-2-714:buyer's damages for breach in regard to accepted goods
-2-715:buyer's incidental and consequential damages
-2-716:buyer's right to specific performance or replevin
-3-102:definitions-commercial paper
-3-104:form of negotiable instruments; draft; check; certificate of deposit; note
-3-110:payable to order
-3-111:payable to bearer
-3-201:transfer: right to indorsement
-3-202:negotiation
-3-204:special indorsement; blank indorsement
-3-301:rights of a holder
-3-302:holder in due course
-3-305:rights of a holder in due course
-3-306:rights of one not holder in due course
-3-401:signature
-3-404:unauthorized signature
-3-405:impostors; signature in name of payee
-3-406:negligence contributing to alteration or unauthorized signature
-3-407:alteration
-3-410:definition and operation of acceptance
-3-411:certification of a check
-3-413:contract of maker, drawer and acceptor
-3-414:contract of indorser; order of liability
-3-417:warranties on presentment and transfer
-3-418:finality of payment or acceptance
-3-419:conversion of instrument; innocent representative
-3-501:when presentment, notice of dishonor, and protest necessary or permissible
-3-502:unexcused delay; discharge
-3-503:time or presentment
-3-507:dishonor; holder's right of recourse; term allowing representment
-3-508:notice of dishonor
-3-511:waived or excused presentment, protest or notice of dishonor or delay therein
-3-601:discharge of parties
-3-802:effect of instrument on obligation for which it is given
-3-804:lost,destroyed or stolen instruments
-4-104:definitions-bank deposits and collections
-4-105:banks-depositary, intermediary, collecting, payor, presenting, remitting
-4-207:warranties of customer and collecting bank on transfer or presentment of items
-4-208:security interest of collecting bank in items, accompanying documents and proceeds
-4-209:when bank gives value for purposes of holder in due course
-4-211:media of remittance; provision and final settlement in remittance cases
-4-213:final payment of item by payor bank
-4-401:when bank may charge customer's account
-4-406:customer's duty to discover and report unauthorized signature or alteration
-4-402:bank liability to customer for wrongful dishonor
-4-407:payor bank's right to subrogation on improper payment
-5-111:warranties on transfer and presentment (letters of credit)
-5-114:issuer's duty and privilege to honor; right to reimbursement
-5-115:remedy for improper dishonor or anticipatory repudiaion (letters of credit)
-7-104:negotiable and non-negotiable warehouse receipt, bill of lading, other title
-7-204:duty of care; contractual limitation of warehouseperson's liability
-7-301:liability for non-receipt or misdescription
-7-403:obligation of warehouseperson or carrier to deliver; excuse
-7-404:no liability for good faith delivery pursuant to receipt or bill
-7-501:form of negotiation and requirements of due negotiation
-7-502:rights acquired by due negotiation
-7-503:document of title to goods defeated in certain cases
-7-504:rights acquired in absence of due negotiation; effect of diversion
-7-507:warranties on negotiation or transfer of receipt or bill
-7-508:warranties of collecting bank as to documents
-9-105:definitions-secured transactions
-9-107:definitions "purchase money security interest"
-9-109:classification of goods; consumer goods; equipment; farm products; inventory
-9-113:security interests arising under article on sales
-9-203:attachment and enforceability of security interest; proceeds; formal requisites
-9-206:agreement not to asserr defenses against assignee; modification of sales warranties
-9-301:persons who take priority over unperfected security interests
-9-302:when filing is required to perfect security interest
-9-303:when security interest is perfected
-9-304:perfection of security interest in instruments, documents
-9-305:when possession by secured party perfects security interest without filing
-9-306:proceeds; secured party's rights on disposition of collateral
-9-307:protection of buyers of goods
-9-310:periority of certain liens arising by opration of law (mechanic's liens)
-9-311:alienability of debtor's rights; judicial process
-9-312:priorities among conflicting security interests in the same collateral
-9-405:assignment of security interest
-9-501:default; procedure when security agreement  covers real and personal property
-9-503:secured party's right to take possession after default
-9-504:secured party's right to dispose of collateral after default
-9-505:compulsory disposition of collateral; acceptance of collateral as discharge of obligation
diff --git a/.ref-Research-V7/usr/games/ttt.k b/.ref-Research-V7/usr/games/ttt.k
deleted file mode 100644 (file)
index e63ad08..0000000
+++ /dev/null
@@ -1 +0,0 @@
-áH2.H?ÏHb=\8a<x<r<VH\1dCØ6Æ6b+À6L,q@\7f?\96-êHÅBt+%/\bI\e0?GYE\80@30\ 6I!0Z+\ 4#}B3HÉH;@¨>°+GG+H/Cz@\9fB\9b?4HÇHV@Â<       F÷EÍ;p<ñE$H÷GßG:GÝGTE²D|DdD\89.D@\17C\15C«EA@]?[?\9d<8C·D¬>\81DQGkEö<ÉDAHöHc?jHrBwB>C-B\9cEØ;ãAn6\v?\e6&6fENELEbDi?aE\11F\87?\81?ñG¸>0<W?\99<;.\85B\88A\95AÎG3?èE£EmEM=\88IÜ><0\ 4<[Ev/\190)H>@Õ?@Ië>\8e?à+ã>âEÒHQ?ÐHK?ÎB
\ No newline at end of file
diff --git a/.ref-Research-V7/usr/games/words b/.ref-Research-V7/usr/games/words
deleted file mode 100755 (executable)
index f16e46c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-egrep '^[-'$1']*$' /usr/dict/words ^ sed -n "`/usr/games/words1 $1`"
diff --git a/.ref-Research-V7/usr/include/a.out.h b/.ref-Research-V7/usr/include/a.out.h
deleted file mode 100644 (file)
index 75e2ba9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-struct exec {  /* a.out header */
-       int             a_magic;        /* magic number */
-       unsigned        a_text;         /* size of text segment */
-       unsigned        a_data;         /* size of initialized data */
-       unsigned        a_bss;          /* size of unitialized data */
-       unsigned        a_syms;         /* size of symbol table */
-       unsigned        a_entry;        /* entry point */
-       unsigned        a_unused;       /* not used */
-       unsigned        a_flag;         /* relocation info stripped */
-};
-
-#define        A_MAGIC1        0407            /* normal */
-#define        A_MAGIC2        0410            /* read-only text */
-#define        A_MAGIC3        0411            /* separated I&D */
-#define        A_MAGIC4        0405            /* overlay */
-
-struct nlist { /* symbol table entry */
-       char            n_name[8];      /* symbol name */
-       int             n_type;         /* type flag */
-       unsigned        n_value;        /* value */
-};
-
-               /* values for type flag */
-#define        N_UNDF  0       /* undefined */
-#define        N_ABS   01      /* absolute */
-#define        N_TEXT  02      /* text symbol */
-#define        N_DATA  03      /* data symbol */
-#define        N_BSS   04      /* bss symbol */
-#define        N_TYPE  037
-#define        N_REG   024     /* register name */
-#define        N_FN    037     /* file name symbol */
-#define        N_EXT   040     /* external bit, or'ed in */
-#define        FORMAT  "%06o"  /* to print a value */
diff --git a/.ref-Research-V7/usr/include/ar.h b/.ref-Research-V7/usr/include/ar.h
deleted file mode 100644 (file)
index 8870807..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#define        ARMAG   0177545
-struct ar_hdr {
-       char    ar_name[14];
-       long    ar_date;
-       char    ar_uid;
-       char    ar_gid;
-       int     ar_mode;
-       long    ar_size;
-};
diff --git a/.ref-Research-V7/usr/include/assert.h b/.ref-Research-V7/usr/include/assert.h
deleted file mode 100644 (file)
index 6c51adc..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# ifndef NDEBUG
-# define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
-# define assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file %s, line %d\n", __FILE__, __LINE__);exit(1);}}
-# else
-# define _assert(ex) ;
-# define assert(ex) ;
-# endif
diff --git a/.ref-Research-V7/usr/include/core.h b/.ref-Research-V7/usr/include/core.h
deleted file mode 100644 (file)
index 69155c7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/* machine dependent stuff for core files */
-#define TXTRNDSIZ 8192L
-#define stacktop(siz) (0x10000L)
-#define stackbas(siz) (0x10000L-siz)
diff --git a/.ref-Research-V7/usr/include/ctype.h b/.ref-Research-V7/usr/include/ctype.h
deleted file mode 100644 (file)
index 9e81727..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#define        _U      01
-#define        _L      02
-#define        _N      04
-#define        _S      010
-#define _P     020
-#define _C     040
-#define        _X      0100
-
-extern char    _ctype_[];      /* in /usr/src/libc/gen/ctype_.h */
-
-#define        isalpha(c)      ((_ctype_+1)[c]&(_U|_L))
-#define        isupper(c)      ((_ctype_+1)[c]&_U)
-#define        islower(c)      ((_ctype_+1)[c]&_L)
-#define        isdigit(c)      ((_ctype_+1)[c]&_N)
-#define        isxdigit(c)     ((_ctype_+1)[c]&(_N|_X))
-#define        isspace(c)      ((_ctype_+1)[c]&_S)
-#define ispunct(c)     ((_ctype_+1)[c]&_P)
-#define isalnum(c)     ((_ctype_+1)[c]&(_U|_L|_N))
-#define isprint(c)     ((_ctype_+1)[c]&(_P|_U|_L|_N))
-#define iscntrl(c)     ((_ctype_+1)[c]&_C)
-#define isascii(c)     ((unsigned)(c)<=0177)
-#define toupper(c)     ((c)-'a'+'A')
-#define tolower(c)     ((c)-'A'+'a')
-#define toascii(c)     ((c)&0177)
diff --git a/.ref-Research-V7/usr/include/dk.h b/.ref-Research-V7/usr/include/dk.h
deleted file mode 100644 (file)
index 9cbe4ff..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * switch commands
- */
-#define        RAM_ON  0226
-#define        ROM_ON  0322
-#define        R_CNTL  0264
-#define        W_CNTL  0170
-
-
-/*
- * library routine declarations
- */
-extern long cmread();
-extern long ocmread();
-
-
-/*
- * call setup struct
- */
-
-struct dialout {
-       char    srv;
-       char    area;
-       char    sw;
-       char    mch;
-       char    chan;
-       char    other;
-       short   check;
-};
-
-struct indial {
-       char    i_lchan;
-       char    i_rhost;
-       char    i_rchan;
-       char    i_srv;
-       char    i_area;
-       char    i_sw;
-       char    i_mch;
-       char    i_chan;
-       char    i_other;
-       short   i_check;
-};
-#define        D_SH    1
-#define        D_FS    2
-#define        D_LSTNR 3
-
-
-struct ring {
-       char    r_lchan;
-       char    r_srv;
-};
diff --git a/.ref-Research-V7/usr/include/dumprestor.h b/.ref-Research-V7/usr/include/dumprestor.h
deleted file mode 100644 (file)
index 83c1dfc..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#define NTREC          20
-#define MLEN           16
-#define MSIZ           4096
-
-#define TS_TAPE        1
-#define TS_INODE       2
-#define TS_BITS        3
-#define TS_ADDR        4
-#define TS_END         5
-#define TS_CLRI        6
-#define MAGIC          (int)60011
-#define CHECKSUM       (int)84446
-struct spcl
-{
-       int     c_type;
-       time_t  c_date;
-       time_t  c_ddate;
-       int     c_volume;
-       daddr_t c_tapea;
-       ino_t   c_inumber;
-       int     c_magic;
-       int     c_checksum;
-       struct  dinode  c_dinode;
-       int     c_count;
-       char    c_addr[BSIZE];
-} spcl;
-
-struct idates
-{
-       char    id_name[16];
-       char    id_incno;
-       time_t  id_ddate;
-};
diff --git a/.ref-Research-V7/usr/include/errno.h b/.ref-Research-V7/usr/include/errno.h
deleted file mode 100644 (file)
index 3ff9fde..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Error codes
- */
-
-#define        EPERM   1
-#define        ENOENT  2
-#define        ESRCH   3
-#define        EINTR   4
-#define        EIO     5
-#define        ENXIO   6
-#define        E2BIG   7
-#define        ENOEXEC 8
-#define        EBADF   9
-#define        ECHILD  10
-#define        EAGAIN  11
-#define        ENOMEM  12
-#define        EACCES  13
-#define        EFAULT  14
-#define        ENOTBLK 15
-#define        EBUSY   16
-#define        EEXIST  17
-#define        EXDEV   18
-#define        ENODEV  19
-#define        ENOTDIR 20
-#define        EISDIR  21
-#define        EINVAL  22
-#define        ENFILE  23
-#define        EMFILE  24
-#define        ENOTTY  25
-#define        ETXTBSY 26
-#define        EFBIG   27
-#define        ENOSPC  28
-#define        ESPIPE  29
-#define        EROFS   30
-#define        EMLINK  31
-#define        EPIPE   32
-
-/* math software */
-#define        EDOM    33
-#define        ERANGE  34
diff --git a/.ref-Research-V7/usr/include/execargs.h b/.ref-Research-V7/usr/include/execargs.h
deleted file mode 100644 (file)
index 17511bf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-char **execargs = (char**)(-2);
diff --git a/.ref-Research-V7/usr/include/grp.h b/.ref-Research-V7/usr/include/grp.h
deleted file mode 100644 (file)
index 59ad28c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-struct group { /* see getgrent(3) */
-       char    *gr_name;
-       char    *gr_passwd;
-       int     gr_gid;
-       char    **gr_mem;
-};
diff --git a/.ref-Research-V7/usr/include/ident.h b/.ref-Research-V7/usr/include/ident.h
deleted file mode 100644 (file)
index 05cf4aa..0000000
+++ /dev/null
@@ -1 +0,0 @@
-char myname[] = "research 11/70";
diff --git a/.ref-Research-V7/usr/include/math.h b/.ref-Research-V7/usr/include/math.h
deleted file mode 100644 (file)
index 7c96b33..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-extern double fabs(), floor(), ceil(), fmod(), ldexp();
-extern double sqrt(), hypot(), atof();
-extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();
-extern double exp(), log(), log10(), pow();
-extern double sinh(), cosh(), tanh();
-extern double gamma();
-extern double j0(), j1(), jn(), y0(), y1(), yn();
-
-#define HUGE   1.701411733192644270e38
-#define LOGHUGE 39
diff --git a/.ref-Research-V7/usr/include/mp.h b/.ref-Research-V7/usr/include/mp.h
deleted file mode 100644 (file)
index e1703e9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#define MINT struct mint
-MINT
-{      int len;
-       short *val;
-};
-#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}}
-#ifndef DBG
-#define shfree(u) free((char *)u)
-#else
-#include "stdio.h"
-#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);}
-extern int dbg;
-#endif
-struct half
-{      short high;
-       short low;
-};
-extern MINT *itom();
-extern short *xalloc();
-
-#ifdef lint
-extern xv_oid;
-#define VOID xv_oid =
-#else
-#define VOID
-#endif
diff --git a/.ref-Research-V7/usr/include/olddump.h b/.ref-Research-V7/usr/include/olddump.h
deleted file mode 100644 (file)
index 7ebb959..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#define MAXSIZE        500             /* max size in blocks of dumped files */
-#define NILIST 100             /* max files extracted at once */
-#define BFACT  20              /* tape blocking factor */
-
-int tden 1600;                 /* tape density */
-int tlen 2200;                 /* tape length (feet) */
-
-char *dump_cmd[] = {           /* default args for dump */
-       "dump",
-       "i",
-       "/dev/rp0",
-       0
-};
-
-char *rest_cmd[] = {           /* defaults for restor */
-       "restor",
-       "t",
-       0
-};
-
-char   *tape   "/dev/rmt1";
-char   dfile[] "/dev/dtab";
-char   tfile[] "/tmp/dtmp";
-char   name[100];
-
-#define NDTAB  10
-struct {
-       char    dt_name[16];
-       time_t  dt_date;
-} dtab[NDTAB];
-
-struct thdr {
-       ino_t   isize;
-       ino_t   maxi;
-       daddr_t fsize;
-       time_t  cdate;
-       time_t  ddate;
-       long    tsize;
-       int     nflg;
-};
-
-struct fhdr {
-       short   xmagic;
-       ino_t   xino;
-       short   xmode;
-       short   xnlink;
-       short   xuid;
-       short   xgid;
-       daddr_t xaddr;
-       off_t   xsize;
-       time_t  xatime;
-       time_t  xmtime;
-       time_t  xctime;
-};
-#define        FMAGIC  012345
-#define        SMAGIC  031415
-
-#define DAPTB  127     /* (BSIZE-2*sizeof(short))/sizeof(daddr_t)) */
-
-FILE   *tmpf;
-
-long
-getsize()
-{
-       register c;
-       long j;
-
-       c = getc(tmpf);
-       if(c == EOF)
-               return((long)-1);
-       if(c <= 253)
-               return((long)c);
-       if(c == 255)
-               return((long)-1);
-       j = 0;
-       for(c=0;c<3;c++)
-               j = (j<<8) + (getc(tmpf)&0377);
-       return(j);
-}
-
-putsize(s)
-long   s;
-{
-       if(s <= 253) {
-               putc((char)s, tmpf);
-               return;
-       }
-       putc(254, tmpf);
-       putc((char)(s>>16), tmpf);
-       putc((char)(s>>8), tmpf);
-       putc((char)s, tmpf);
-}
diff --git a/.ref-Research-V7/usr/include/pack.h b/.ref-Research-V7/usr/include/pack.h
deleted file mode 100644 (file)
index 9b67aac..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-struct header {
-       char    sync;
-       char    ksize;
-       unsigned short  sum;
-       char    cntl;
-       char    ccntl;
-};
-#define        HDRSIZ  6
-
-struct pack {
-       short   p_state;        /* line state */
-       short   p_bits;         /* mask for getepack */
-       short   p_rsize;        /* input packet size */
-       short   p_xsize;        /* output packet size */
-       struct  header p_ihbuf; /* input header */
-       struct  header p_ohbuf; /* output header */
-       char    *p_rptr;
-       char    p_mode;
-       char    **p_ipool;
-       char    p_xcount;       /* # active output buffers */
-       char    p_rcount;
-       char    p_nout,p_tout;
-       char    p_lpsize;       /* log(psize/32) */
-       char    p_timer;
-       char    p_obusy;
-       char    p_srxmit;
-       char    p_rwindow;      /* window size */
-       char    p_swindow;
-       char    p_msg;          /* control msg */
-       char    p_rmsg;         /* repeated control msg */
-       char    p_ps,p_pr;      /* last packet sent, recv'd */
-       char    p_rpr;
-       char    p_nxtps;        /* next output seq number */
-       char    p_imap;         /* bit map of input buffers */
-       char    p_pscopy;       /* newest output packet */
-       char    *p_ob[8];       /* output buffers */
-       char    *p_ib[8];       /* input buffers */
-       char    p_os[8];        /* output buffer status */
-       char    p_is[8];        /* input buffer status */
-       short   p_osum[8];      /* output checksums */
-       short   p_isum[8];      /* input checksums */
-       DSYSTEM;
-};
-#define        CHECK   0125252
-#define        SYN     020
-#define        MOD8    7
-#define        ISCNTL(a)       ((a & 0300)==0)
-#define        MIN(a,b)        ((a<b)? a:b)
-
-char   next[8];
-char   mask[8];
-int    npbits;
-int    pkactive;
-
-/*
- * driver state
- */
-#define        DEAD    0
-#define        INITa   1
-#define        INITb   2
-#define        INITab  3
-#define        LIVE    010
-#define        RXMIT   020
-#define        RREJ    040
-#define PDEBUG 0200
-#define        DRAINO  0400
-#define        WAITO   01000
-#define        DOWN    02000
-#define        RCLOSE  04000
-#define        BADFRAME 020000
-
-/*
- * io buffer states
- */
-#define        B_NULL  0
-#define        B_READY 1
-#define        B_SENT  2
-#define        B_RESID 010
-#define        B_COPY  020
-#define        B_MARK  040
-#define        B_SHORT 0100
-
-/*
- * control messages
- */
-#define        CLOSE   1
-#define        RJ      2
-#define        SRJ     3
-#define        RR      4
-#define        INITC   5
-#define        INITB   6
-#define        INITA   7
-
-#define        M_RJ    4
-#define        M_SRJ   010
-#define        M_RR    020
-#define        M_INITC 040
-#define        M_CLOSE 2
-#define        M_INITA 0200
-#define        M_INITB 0100
-
-
-
-#define        PKOPRI  31
-#define        PKIPRI  30
-
-#define        NPLINES 8
-
-/*
- * packet ioctl buf
- */
-struct piocb {
-       unsigned t;
-       short   psize;
-       short   mode;
-       short   state;
-       char    window;
-};
-
-int pkdebug;
-int pksizes[];
diff --git a/.ref-Research-V7/usr/include/pwd.h b/.ref-Research-V7/usr/include/pwd.h
deleted file mode 100644 (file)
index 1fa1b38..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-struct passwd { /* see getpwent(3) */
-       char    *pw_name;
-       char    *pw_passwd;
-       int     pw_uid;
-       int     pw_gid;
-       int     pw_quota;
-       char    *pw_comment;
-       char    *pw_gecos;
-       char    *pw_dir;
-       char    *pw_shell;
-};
diff --git a/.ref-Research-V7/usr/include/setjmp.h b/.ref-Research-V7/usr/include/setjmp.h
deleted file mode 100644 (file)
index ed7896d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-typedef int jmp_buf[3];
diff --git a/.ref-Research-V7/usr/include/sgtty.h b/.ref-Research-V7/usr/include/sgtty.h
deleted file mode 100644 (file)
index be6b89f..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Structure for stty and gtty system calls.
- */
-
-struct sgttyb {
-       char    sg_ispeed;              /* input speed */
-       char    sg_ospeed;              /* output speed */
-       char    sg_erase;               /* erase character */
-       char    sg_kill;                /* kill character */
-       int     sg_flags;               /* mode flags */
-};
-
-/*
- * List of special characters
- */
-struct tchars {
-       char    t_intrc;        /* interrupt */
-       char    t_quitc;        /* quit */
-       char    t_startc;       /* start output */
-       char    t_stopc;        /* stop output */
-       char    t_eofc;         /* end-of-file */
-       char    t_brkc;         /* input delimiter (like nl) */
-};
-
-/*
- * Modes
- */
-#define        TANDEM  01
-#define        CBREAK  02
-#define        LCASE   04
-#define        ECHO    010
-#define        CRMOD   020
-#define        RAW     040
-#define        ODDP    0100
-#define        EVENP   0200
-#define ANYP   0300
-#define        NLDELAY 001400
-#define        TBDELAY 006000
-#define        XTABS   06000
-#define        CRDELAY 030000
-#define        VTDELAY 040000
-#define BSDELAY 0100000
-#define ALLDELAY 0177400
-
-/*
- * Delay algorithms
- */
-#define        CR0     0
-#define        CR1     010000
-#define        CR2     020000
-#define        CR3     030000
-#define        NL0     0
-#define        NL1     000400
-#define        NL2     001000
-#define        NL3     001400
-#define        TAB0    0
-#define        TAB1    002000
-#define        TAB2    004000
-#define        FF0     0
-#define        FF1     040000
-#define        BS0     0
-#define        BS1     0100000
-
-/*
- * Speeds
- */
-#define B0     0
-#define B50    1
-#define B75    2
-#define B110   3
-#define B134   4
-#define B150   5
-#define B200   6
-#define B300   7
-#define B600   8
-#define B1200  9
-#define        B1800   10
-#define B2400  11
-#define B4800  12
-#define B9600  13
-#define EXTA   14
-#define EXTB   15
-
-/*
- * tty ioctl commands
- */
-#define        TIOCGETD        (('t'<<8)|0)
-#define        TIOCSETD        (('t'<<8)|1)
-#define        TIOCHPCL        (('t'<<8)|2)
-#define        TIOCMODG        (('t'<<8)|3)
-#define        TIOCMODS        (('t'<<8)|4)
-#define        TIOCGETP        (('t'<<8)|8)
-#define        TIOCSETP        (('t'<<8)|9)
-#define        TIOCSETN        (('t'<<8)|10)
-#define        TIOCEXCL        (('t'<<8)|13)
-#define        TIOCNXCL        (('t'<<8)|14)
-#define        TIOHMODE        (('t'<<8)|15)
-#define        TIOCTSTP        (('t'<<8)|16)
-#define        TIOCSETC        (('t'<<8)|17)
-#define        TIOCGETC        (('t'<<8)|18)
-#define        DIOCLSTN        (('d'<<8)|1)
-#define        DIOCNTRL        (('d'<<8)|2)
-#define        DIOCMPX         (('d'<<8)|3)
-#define        DIOCNMPX        (('d'<<8)|4)
-#define        DIOCSCALL       (('d'<<8)|5)
-#define        DIOCRCALL       (('d'<<8)|6)
-#define        DIOCPGRP        (('d'<<8)|7)
-#define        DIOCGETP        (('d'<<8)|8)
-#define        DIOCSETP        (('d'<<8)|9)
-#define        DIOCLOSE        (('d'<<8)|10)
-#define        DIOCTIME        (('d'<<8)|11)
-#define        DIOCRESET       (('d'<<8)|12)
-#define        FIOCLEX         (('f'<<8)|1)
-#define        FIONCLEX        (('f'<<8)|2)
-#define        MXLSTN          (('x'<<8)|1)
-#define        MXNBLK          (('x'<<8)|2)
diff --git a/.ref-Research-V7/usr/include/signal.h b/.ref-Research-V7/usr/include/signal.h
deleted file mode 100644 (file)
index 86b47d5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#define NSIG 17
-
-#define        SIGHUP  1       /* hangup */
-#define        SIGINT  2       /* interrupt */
-#define        SIGQUIT 3       /* quit */
-#define        SIGILL  4       /* illegal instruction (not reset when caught) */
-#define        SIGTRAP 5       /* trace trap (not reset when caught) */
-#define        SIGIOT  6       /* IOT instruction */
-#define        SIGEMT  7       /* EMT instruction */
-#define        SIGFPE  8       /* floating point exception */
-#define        SIGKILL 9       /* kill (cannot be caught or ignored) */
-#define        SIGBUS  10      /* bus error */
-#define        SIGSEGV 11      /* segmentation violation */
-#define        SIGSYS  12      /* bad argument to system call */
-#define        SIGPIPE 13      /* write on a pipe with no one to read it */
-#define        SIGALRM 14      /* alarm clock */
-#define        SIGTERM 15      /* software termination signal from kill */
-
-int    (*signal())();
-#define        SIG_DFL (int (*)())0
-#define        SIG_IGN (int (*)())1
diff --git a/.ref-Research-V7/usr/include/stdio.h b/.ref-Research-V7/usr/include/stdio.h
deleted file mode 100644 (file)
index 1764add..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#define        BUFSIZ  512
-#define        _NFILE  20
-# ifndef FILE
-extern struct  _iobuf {
-       char    *_ptr;
-       int     _cnt;
-       char    *_base;
-       char    _flag;
-       char    _file;
-} _iob[_NFILE];
-# endif
-
-#define        _IOREAD 01
-#define        _IOWRT  02
-#define        _IONBF  04
-#define        _IOMYBUF        010
-#define        _IOEOF  020
-#define        _IOERR  040
-#define        _IOSTRG 0100
-#define        _IORW   0200
-
-#define        NULL    0
-#define        FILE    struct _iobuf
-#define        EOF     (-1)
-
-#define        stdin   (&_iob[0])
-#define        stdout  (&_iob[1])
-#define        stderr  (&_iob[2])
-#define        getc(p)         (--(p)->_cnt>=0? *(p)->_ptr++&0377:_filbuf(p))
-#define        getchar()       getc(stdin)
-#define putc(x,p) (--(p)->_cnt>=0? ((int)(*(p)->_ptr++=(unsigned)(x))):_flsbuf((unsigned)(x),p))
-#define        putchar(x)      putc(x,stdout)
-#define        feof(p)         (((p)->_flag&_IOEOF)!=0)
-#define        ferror(p)       (((p)->_flag&_IOERR)!=0)
-#define        fileno(p)       p->_file
-
-FILE   *fopen();
-FILE   *freopen();
-FILE   *fdopen();
-long   ftell();
-char   *fgets();
diff --git a/.ref-Research-V7/usr/include/symbol.h b/.ref-Research-V7/usr/include/symbol.h
deleted file mode 100644 (file)
index 466c238..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Structure of a symbol table entry
- */
-
-struct symbol {
-       char    sy_name[8];
-       char    sy_type;
-       int     sy_value;
-};
diff --git a/.ref-Research-V7/usr/include/sys.s b/.ref-Research-V7/usr/include/sys.s
deleted file mode 100644 (file)
index 0986e3c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-indir  = 0.
-exit   = 1.
-fork   = 2.
-read   = 3.
-write  = 4.
-open   = 5.
-close  = 6.
-wait   = 7.
-creat  = 8.
-link   = 9.
-unlink = 10.
-exec   = 11.
-chdir  = 12.
-time   = 13.
-mknod  = 14.
-chmod  = 15.
-chown  = 16.
-break  = 17.
-stat   = 18.
-lseek  = 19.
-getpid = 20.
-mount  = 21.
-umount = 22.
-setuid = 23.
-getuid = 24.
-stime  = 25.
-ptrace = 26.
-alarm  = 27.
-fstat  = 28.
-pause  = 29.
-utime  = 30.
-smdate = 30.
-stty   = 31.
-gtty   = 32.
-access = 33.
-nice   = 34.
-sleep  = 35.
-sync   = 36.
-kill   = 37.
-csw    = 38.
-setpgrp        = 39.
-dup    = 41.
-pipe   = 42.
-times  = 43.
-profil = 44.
-setgid = 46.
-getgid = 47.
-signal = 48.
-acct   = 51.
-phys   = 52.
-lock   = 53.
-ioctl  = 54.
-reboot = 55.
-mpx    = 56.
-setinf = 59.
-umask  = 60.
-getinf = 60.
diff --git a/.ref-Research-V7/usr/include/sys/conf.h b/.ref-Research-V7/usr/include/sys/conf.h
deleted file mode 100644 (file)
index 8957651..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Declaration of block device
- * switch. Each entry (row) is
- * the only link between the
- * main unix code and the driver.
- * The initialization of the
- * device switches is in the
- * file conf.c.
- */
-extern struct bdevsw
-{
-       int     (*d_open)();
-       int     (*d_close)();
-       int     (*d_strategy)();
-       struct buf *d_tab;
-} bdevsw[];
-
-/*
- * Character device switch.
- */
-extern struct cdevsw
-{
-       int     (*d_open)();
-       int     (*d_close)();
-       int     (*d_read)();
-       char    *(*d_write)();
-       int     (*d_ioctl)();
-       int     (*d_stop)();
-       struct tty *d_ttys;
-} cdevsw[];
-
-/*
- * tty line control switch.
- */
-extern struct linesw
-{
-       int     (*l_open)();
-       int     (*l_close)();
-       int     (*l_read)();
-       int     (*l_write)();
-       int     (*l_ioctl)();
-       int     (*l_rint)();
-       int     (*l_rend)();
-       int     (*l_meta)();
-       int     (*l_start)();
-       int     (*l_modem)();
-} linesw[];
diff --git a/.ref-Research-V7/usr/include/sys/pk.h b/.ref-Research-V7/usr/include/sys/pk.h
deleted file mode 100644 (file)
index 0119699..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-struct header {
-       char    sync;
-       char    ksize;
-       unsigned short sum;
-       char    cntl;
-       char    ccntl;
-};
-#define        HDRSIZ  6
-
-struct pack {
-       short   p_state;        /* line state */
-       short   p_bits;         /* mask for getepack */
-       short   p_rsize;        /* input packet size */
-       short   p_xsize;        /* output packet size */
-       struct  header p_ihbuf; /* input header */
-       struct  header p_ohbuf; /* output header */
-       char    *p_rptr;
-       char    p_mode;
-       char    **p_ipool;
-       char    p_xcount;       /* # active output buffers */
-       char    p_rcount;
-       char    p_nout,p_tout;
-       char    p_lpsize;       /* log(psize/32) */
-       char    p_timer;
-       char    p_obusy;
-       char    p_srxmit;
-       char    p_rwindow;      /* window size */
-       char    p_swindow;
-       char    p_msg;          /* control msg */
-       char    p_rmsg;         /* repeated control msg */
-       char    p_ps,p_pr;      /* last packet sent, recv'd */
-       char    p_rpr;
-       char    p_nxtps;        /* next output seq number */
-       char    p_imap;         /* bit map of input buffers */
-       char    p_pscopy;       /* newest output packet */
-       char    *p_ob[8];       /* output buffers */
-       char    *p_ib[8];       /* input buffers */
-       char    p_os[8];        /* output buffer status */
-       char    p_is[8];        /* input buffer status */
-       short   p_osum[8];      /* output checksums */
-       short   p_isum[8];      /* input checksums */
-       DSYSTEM;
-};
-#define        CHECK   0125252
-#define        SYN     020
-#define        MOD8    7
-#define        ISCNTL(a)       ((a & 0300)==0)
-#define        MIN(a,b)        ((a<b)? a:b)
-
-char   next[8];
-char   mask[8];
-int    npbits;
-int    pkactive;
-
-/*
- * driver state
- */
-#define        DEAD    0
-#define        INITa   1
-#define        INITb   2
-#define        INITab  3
-#define        LIVE    010
-#define        RXMIT   020
-#define        RREJ    040
-#define PDEBUG 0200
-#define        DRAINO  0400
-#define        WAITO   01000
-#define        DOWN    02000
-#define        RCLOSE  04000
-#define        BADFRAME 020000
-
-/*
- * io buffer states
- */
-#define        B_NULL  0
-#define        B_READY 1
-#define        B_SENT  2
-#define        B_RESID 010
-#define        B_COPY  020
-#define        B_MARK  040
-#define        B_SHORT 0100
-
-/*
- * control messages
- */
-#define        CLOSE   1
-#define        RJ      2
-#define        SRJ     3
-#define        RR      4
-#define        INITC   5
-#define        INITB   6
-#define        INITA   7
-
-#define        M_RJ    4
-#define        M_SRJ   010
-#define        M_RR    020
-#define        M_INITC 040
-#define        M_CLOSE 2
-#define        M_INITA 0200
-#define        M_INITB 0100
-
-
-
-#define        PKOPRI  31
-#define        PKIPRI  30
-
-#define        NPLINES 8
-
-/*
- * packet ioctl buf
- */
-struct piocb {
-       unsigned t;
-       short   psize;
-       short   mode;
-       short   state;
-       char    window;
-};
-
-int pkdebug;
-int pksizes[];
diff --git a/.ref-Research-V7/usr/include/sys/times.h b/.ref-Research-V7/usr/include/sys/times.h
deleted file mode 100644 (file)
index 6e74dee..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Structure returned by times()
- */
-struct tms {
-       time_t  tms_utime;              /* user time */
-       time_t  tms_stime;              /* system time */
-       time_t  tms_cutime;             /* user time, children */
-       time_t  tms_cstime;             /* system time, children */
-};
diff --git a/.ref-Research-V7/usr/include/time.h b/.ref-Research-V7/usr/include/time.h
deleted file mode 100644 (file)
index 7eeb1e1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-struct tm { /* see ctime(3) */
-       int     tm_sec;
-       int     tm_min;
-       int     tm_hour;
-       int     tm_mday;
-       int     tm_mon;
-       int     tm_year;
-       int     tm_wday;
-       int     tm_yday;
-       int     tm_isdst;
-};
diff --git a/.ref-Research-V7/usr/include/tp_defs.h b/.ref-Research-V7/usr/include/tp_defs.h
deleted file mode 100644 (file)
index 79b0121..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-char   mt[]    = "/dev/mt0";
-char   tc[]    = "/dev/tapx";
-int    flags   = flu;
-char   mheader[] = "/usr/mdec/mboot";
-char   theader[] = "/usr/mdec/tboot";
diff --git a/.ref-Research-V7/usr/include/utmp.h b/.ref-Research-V7/usr/include/utmp.h
deleted file mode 100644 (file)
index aa28f72..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-struct utmp {
-       char    ut_line[8];             /* tty name */
-       char    ut_name[8];             /* user id */
-       long    ut_time;                /* time on */
-};
diff --git a/.ref-Research-V7/usr/include/varargs.h b/.ref-Research-V7/usr/include/varargs.h
deleted file mode 100644 (file)
index da1d099..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-typedef char *va_list;
-# define va_dcl int va_alist;
-# define va_start(list) list = (char *) &va_alist
-# define va_end(list)
-# define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
diff --git a/.ref-Research-V7/usr/include/whoami.h b/.ref-Research-V7/usr/include/whoami.h
deleted file mode 100644 (file)
index e357f61..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#define        sysname "where I am"
diff --git a/.ref-Research-V7/usr/lib/cign b/.ref-Research-V7/usr/lib/cign
deleted file mode 100644 (file)
index b866a05..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-auto   4
-break  5
-case   5
-char   4
-continue       5
-default        5
-do     5
-double 4
-else   5
-extern 2
-float  4
-for    5
-goto   5
-if     5
-int    4
-long   4
-register       4
-return 5
-static 4
-struct 3
-switch 5
-while  5
diff --git a/.ref-Research-V7/usr/lib/crontab b/.ref-Research-V7/usr/lib/crontab
deleted file mode 100644 (file)
index 1332037..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-0,10,20,30,40,50 * *   *       *       /etc/dmesg - >>/usr/adm/messages
-0,5,10,15,20,25,30,35,40,45,50,55      *       *       *       *       /usr/lib/atrun
-20     1       *       *       *       /usr/bin/calendar -
diff --git a/.ref-Research-V7/usr/lib/eign b/.ref-Research-V7/usr/lib/eign
deleted file mode 100644 (file)
index 1b1aecb..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-a
-about
-above
-across
-act
-action
-after
-again
-against
-ago
-air
-all
-almost
-along
-already
-also
-although
-always
-american
-among
-an
-and
-another
-any
-anything
-are
-area
-areas
-around
-as
-asked
-at
-available
-away
-back
-be
-became
-because
-become
-been
-before
-began
-behind
-being
-best
-better
-between
-big
-board
-body
-both
-boy
-brought
-business
-but
-by
-called
-came
-can
-cannot
-car
-case
-certain
-change
-children
-church
-city
-close
-college
-come
-community
-company
-could
-country
-course
-court
-day
-days
-death
-development
-did
-didn't
-different
-do
-does
-don't
-done
-door
-down
-during
-each
-early
-economic
-either
-end
-enough
-even
-ever
-every
-example
-experience
-eyes
-face
-fact
-family
-far
-federal
-feet
-felt
-few
-field
-find
-first
-five
-for
-force
-form
-found
-four
-free
-from
-gave
-general
-get
-give
-given
-go
-god
-going
-good
-got
-government
-great
-group
-had
-half
-hand
-hands
-has
-have
-having
-he
-head
-heard
-held
-help
-her
-here
-high
-him
-himself
-his
-history
-home
-house
-how
-however
-human
-i
-i'm
-if
-important
-in
-individual
-information
-interest
-into
-is
-it
-it's
-its
-itself
-job
-john
-just
-keep
-kind
-knew
-know
-known
-large
-last
-later
-law
-least
-left
-less
-let
-life
-light
-like
-line
-little
-local
-long
-look
-looked
-love
-made
-major
-make
-making
-man
-many
-matter
-may
-me
-means
-members
-men
-might
-mind
-miss
-moment
-money
-more
-most
-mr
-mrs
-much
-must
-my
-name
-national
-need
-never
-new
-next
-night
-no
-not
-nothing
-now
-number
-of
-off
-office
-often
-old
-on
-once
-one
-only
-open
-or
-order
-other
-others
-our
-out
-over
-own
-part
-past
-people
-per
-perhaps
-period
-place
-point
-political
-position
-possible
-power
-present
-president
-probably
-problem
-problems
-program
-public
-put
-question
-quite
-rather
-real
-really
-reason
-result
-right
-room
-said
-same
-saw
-say
-school
-second
-see
-seemed
-seems
-seen
-sense
-service
-set
-several
-shall
-she
-should
-show
-side
-since
-small
-so
-social
-society
-some
-something
-south
-special
-state
-states
-still
-street
-study
-such
-sure
-system
-take
-taken
-tell
-than
-that
-the
-their
-them
-themselves
-then
-there
-these
-they
-thing
-things
-think
-this
-those
-though
-thought
-three
-through
-thus
-time
-times
-to
-today
-together
-told
-too
-took
-toward
-true
-turn
-turned
-two
-under
-united
-until
-up
-upon
-us
-use
-used
-very
-want
-war
-was
-water
-way
-we
-week
-well
-went
-were
-west
-what
-when
-where
-whether
-which
-while
-white
-who
-whole
-whose
-why
-will
-with
-within
-without
-word
-words
-work
-world
-would
-year
-years
-yet
-york
-you
-young
-your
diff --git a/.ref-Research-V7/usr/lib/learn/Linfo b/.ref-Research-V7/usr/lib/learn/Linfo
deleted file mode 100644 (file)
index b27813c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-  files
-  editor
-  morefiles
-  macros
-  eqn
-  C
diff --git a/.ref-Research-V7/usr/lib/learn/Xinfo b/.ref-Research-V7/usr/lib/learn/Xinfo
deleted file mode 100644 (file)
index 6896a34..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-files - basic file handling commands
-editor - text editor; must know about files first.
-morefiles - more on file manipulations and other useful stuff
-macros - "-ms" macros for BTL memos & papers;  must know editor
-eqn - typing mathematics;  must know editor
-C - writing programs in the C language;  must know editor
-
-This is probably the proper order, but after you
-have the "files" course and know the basics of "editor",
-try anything you like.
-
-You can always leave learn by typing "bye" (and a RETURN).
-You can stop it from typing by pushing interrupt
-(or break or rubout or delete, depending on your terminal).
-
-If it won't accept your answer, and you know\b\b\b\b____ you're
-right, answer "no" when it asks whether you
-want to try again, and it will go on to the next lesson.
-Please report troubles to your local guru, or
-to Brian Kernighan, MH 6021, 2C-518.
diff --git a/.ref-Research-V7/usr/lib/lex/ncform b/.ref-Research-V7/usr/lib/lex/ncform
deleted file mode 100644 (file)
index 8ca51b4..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-int yylineno =1;
-# define YYU(x) x
-# define NLSTATE yyprevious=YYNEWLINE
-char yytext[YYLMAX];
-struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
-char yysbuf[YYLMAX];
-char *yysptr = yysbuf;
-int *yyfnd;
-extern struct yysvf *yyestate;
-int yyprevious = YYNEWLINE;
-yylook(){
-       register struct yysvf *yystate, **lsp;
-       register struct yywork *yyt;
-       struct yysvf *yyz;
-       int yych;
-       struct yywork *yyr;
-# ifdef LEXDEBUG
-       int debug;
-# endif
-       char *yylastch;
-       /* start off machines */
-# ifdef LEXDEBUG
-       debug = 0;
-# endif
-       if (!yymorfg)
-               yylastch = yytext;
-       else {
-               yymorfg=0;
-               yylastch = yytext+yyleng;
-               }
-       for(;;){
-               lsp = yylstate;
-               yyestate = yystate = yybgin;
-               if (yyprevious==YYNEWLINE) yystate++;
-               for (;;){
-# ifdef LEXDEBUG
-                       if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
-# endif
-                       yyt = yystate->yystoff;
-                       if(yyt == yycrank){             /* may not be any transitions */
-                               yyz = yystate->yyother;
-                               if(yyz == 0)break;
-                               if(yyz->yystoff == yycrank)break;
-                               }
-                       *yylastch++ = yych = input();
-               tryagain:
-# ifdef LEXDEBUG
-                       if(debug){
-                               fprintf(yyout,"char ");
-                               allprint(yych);
-                               putchar('\n');
-                               }
-# endif
-                       yyr = yyt;
-                       if ( (int)yyt > (int)yycrank){
-                               yyt = yyr + yych;
-                               if (yyt <= yytop && yyt->verify+yysvec == yystate){
-                                       if(yyt->advance+yysvec == YYLERR)       /* error transitions */
-                                               {unput(*--yylastch);break;}
-                                       *lsp++ = yystate = yyt->advance+yysvec;
-                                       goto contin;
-                                       }
-                               }
-# ifdef YYOPTIM
-                       else if((int)yyt < (int)yycrank) {              /* r < yycrank */
-                               yyt = yyr = yycrank+(yycrank-yyt);
-# ifdef LEXDEBUG
-                               if(debug)fprintf(yyout,"compressed state\n");
-# endif
-                               yyt = yyt + yych;
-                               if(yyt <= yytop && yyt->verify+yysvec == yystate){
-                                       if(yyt->advance+yysvec == YYLERR)       /* error transitions */
-                                               {unput(*--yylastch);break;}
-                                       *lsp++ = yystate = yyt->advance+yysvec;
-                                       goto contin;
-                                       }
-                               yyt = yyr + YYU(yymatch[yych]);
-# ifdef LEXDEBUG
-                               if(debug){
-                                       fprintf(yyout,"try fall back character ");
-                                       allprint(YYU(yymatch[yych]));
-                                       putchar('\n');
-                                       }
-# endif
-                               if(yyt <= yytop && yyt->verify+yysvec == yystate){
-                                       if(yyt->advance+yysvec == YYLERR)       /* error transition */
-                                               {unput(*--yylastch);break;}
-                                       *lsp++ = yystate = yyt->advance+yysvec;
-                                       goto contin;
-                                       }
-                               }
-                       if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
-# ifdef LEXDEBUG
-                               if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
-# endif
-                               goto tryagain;
-                               }
-# endif
-                       else
-                               {unput(*--yylastch);break;}
-               contin:
-# ifdef LEXDEBUG
-                       if(debug){
-                               fprintf(yyout,"state %d char ",yystate-yysvec-1);
-                               allprint(yych);
-                               putchar('\n');
-                               }
-# endif
-                       ;
-                       }
-# ifdef LEXDEBUG
-               if(debug){
-                       fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
-                       allprint(yych);
-                       putchar('\n');
-                       }
-# endif
-               while (lsp-- > yylstate){
-                       *yylastch-- = 0;
-                       if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
-                               yyolsp = lsp;
-                               if(yyextra[*yyfnd]){            /* must backup */
-                                       while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
-                                               lsp--;
-                                               unput(*yylastch--);
-                                               }
-                                       }
-                               yyprevious = YYU(*yylastch);
-                               yylsp = lsp;
-                               yyleng = yylastch-yytext+1;
-                               yytext[yyleng] = 0;
-# ifdef LEXDEBUG
-                               if(debug){
-                                       fprintf(yyout,"\nmatch ");
-                                       sprint(yytext);
-                                       fprintf(yyout," action %d\n",*yyfnd);
-                                       }
-# endif
-                               return(*yyfnd++);
-                               }
-                       unput(*yylastch);
-                       }
-               if (yytext[0] == 0  /* && feof(yyin) */)
-                       {
-                       yysptr=yysbuf;
-                       return(0);
-                       }
-               yyprevious = yytext[0] = input();
-               if (yyprevious>0)
-                       output(yyprevious);
-               yylastch=yytext;
-# ifdef LEXDEBUG
-               if(debug)putchar('\n');
-# endif
-               }
-       }
-yyback(p, m)
-       int *p;
-{
-if (p==0) return(0);
-while (*p)
-       {
-       if (*p++ == m)
-               return(1);
-       }
-return(0);
-}
-       /* the following are only used in the lex library */
-yyinput(){
-       return(input());
-       }
-yyoutput(c)
-  int c; {
-       output(c);
-       }
-yyunput(c)
-   int c; {
-       unput(c);
-       }
diff --git a/.ref-Research-V7/usr/lib/llib-lc b/.ref-Research-V7/usr/lib/llib-lc
deleted file mode 100644 (file)
index 2e136c3..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-       /* LINTLIBRARY */
-#include <stdio.h>
-#include <sgtty.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-int    errno;
-int    alarm(s) unsigned s; { return(s); }
-char   *brk(a) char *a; { return(a); }
-int    chdir(s) char *s; { return(0); }
-int    chmod(s, m) char *s; { return(0); }
-int    chown(s, u, g) char *s; { return(0); }
-int    close(f) { return(0); }
-int    creat(s, m) char *s; { return(0); }
-int    dup(f) { return(f); }
-       /* VARARGS */
-       execl(f, a) char *f, *a; {;}
-       execv(s, v) char *s, *v[]; {;}
-       exit(s) {;}
-int    fork() { return(0); }
-int    fstat(f, b) struct stat *b; { return(0); }
-int    getgid() { return(1); }
-int    getegid() { return(1); }
-int    getpid() { return(1); }
-int    getuid() { return(1); }
-int    geteuid() { return(1); }
-int    gtty(f, b) struct sgttyb *b; { return(0); }
-int    kill(p, s) { return(0); }
-int    link(a, b) char *a, *b; { return(0); }
-long   lseek(f, o, d) long o; { return(0); }
-int    mknod(n, m, a) char *n; { return(0); }
-char   *mktemp(p) char *p; { return(p);}
-int    mount(s, n, f) char *s, *n; { return(0); }
-int    nice(p) { return(0); }
-int    open(f, m) char *f; { return(0); }
-       pause() {;}
-int    pipe(f) int f[2]; { return(0); }
-       profil(b, s, o, i) char *b; {;}
-int    ptrace(r, p, a, d) { return(0); }
-int    read(f, b, l) char *b; { return(l); }
-char   *sbrk(i) { return((char *)0); }
-int    seek(f, o, p) { return(0); }
-int    setgid(g) { return(0); }
-int    setuid(u) { return(0); }
-int    (*signal(c, f))() int (*f)(); { return(f); }
-int    stat(s, b) char *s; struct stat *b; { return(0); }
-char   *strcat(a, b) char *a, *b; { ; }
-int    strcmp(a, b) char *a, *b; { return(1); }
-char   *strcpy(a, b) char *a, *b; { ; }
-int    strlen(s) char *s; { return(1); }
-int    stty(f, b) struct sgttyb *b; { return(0); }
-long   tell(f) { return((long)0); }
-int    system(s) char *s; { return(0); }
-time_t time(t) time_t *t; { return( 0 );}
-int    unlink(s) char *s; { return(0); }
-int    wait(s) int *s; { return(1); }
-int    write(f, b, l) char *b; { return(l); }
-char   *calloc(n,s) unsigned n, s; { static char c[1]; return(c); }
-char   *malloc(n) unsigned n; {static char c; return(&c);}
-char   *realloc(p, n) char *p; unsigned n; { static char c; return(&c);}
-       free(p) char *p; {;}
-       fclose(f) FILE *f; {return(0);}
-       fflush(f) FILE *f; {return(0);}
-char   *fgets( s, l, f ) char *s; FILE *f; { return(s); }
-FILE   *fopen(s,m) char *s, *m; { return(stdin); }
-FILE   *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); }
-FILE   *fdopen(fd, m) char *m; { return(stdin);}
-       /* VARARGS */
-       fprintf( f, s ) FILE *f; char *s; {;}
-       fputs(s,f) char *s; FILE *f; {;}
-       fread( p, s, n, f ) char *p; FILE *f; {return(1);}
-       /* VARARGS */
-       fscanf( f, s ) FILE *f; char *s; {return(1);}
-int    fwrite( p, s, n, f ) char *p; FILE *f; {return(0);}
-       intss(){return(1); }
-       /* VARARGS */
-       printf( s ) char *s; {;}
-       rewind(f) FILE *f; {;}
-       /* VARARGS */
-       scanf( f ) char *f; {return(1); }
-       setbuf( f, b ) FILE *f; char *b; {;}
-       /* VARARGS */
-char   *sprintf( s, f ) char *s, *f; { return(s);}
-       /* VARARGS */
-       sscanf( s, f ) char *s, *f; { return(1); }
-       ungetc( c, f ) FILE *f; {  return(c); }
-char   *ctime(c) time_t *c;{ return(""); }
-struct tm *localtime(c) time_t *c; { return localtime(c); }
-struct tm *gmtime(c) time_t *c; { return gmtime(c); }
-char   *asctime(t) struct tm *t; { return(""); }
-       abort() {}
-int    abs(i) int i; { return(i); }
-double atof(s) char *s; { return(1.); }
-char   *crypt(k,s) char *k, *s; { return(""); }
-       setkey(k) char *k; {}
-       encrypt(s, i) char *s; {}
-char   *ecvt(v, n, d, s) double v; int *d, *s; { return(""); }
-char   *fcvt(v, n, d, s) double v; int *d, *s; { return(""); }
-char   *gcvt(v, n, b) double v; char *b; { return(""); }
-       monitor(l, h, b, s, n) int (*l)(), (*h)(); short *b; {}
-       perror(s) char *s; {}
-#include <setjmp.h>
-       setjmp(e) jmp_buf e; { return(0); }
-       sleep(i) unsigned i; {}
-struct _iobuf _iob[_NFILE];
-char   _ctype_[];
diff --git a/.ref-Research-V7/usr/lib/llib-lm b/.ref-Research-V7/usr/lib/llib-lm
deleted file mode 100644 (file)
index 3f78314..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*LINTLIBRARY*/
-#include <math.h>
-double acos(x)double x;{return x;}
-double asin(x)double x;{return x;}
-double atan(x)double x;{return x;}
-double atan2(x,y)double x,y;{return x;}
-double ceil(x)double x;{return x;}
-double cos(x)double x;{return x;}
-double cosh(x)double x;{return x;}
-double erf(x)double x;{return x;}
-double erfc(x)double x;{return x;}
-double exp(x)double x;{return x;}
-double fabs(x)double x;{return x;}
-double floor(x)double x;{return x;}
-double fmod(x,y)double x,y;{return x;}
-double gamma(x)double x;{return x;}
-double hypot(x,y)double x,y;{return x;}
-double j0(x)double x;{return x;}
-double j1(x)double x;{return x;}
-double jn(n,x)int n;double x;{return x;}
-double log(x)double x;{return x;}
-double log10(x)double x;{return x;}
-double pow(x,y)double x,y;{return x;}
-double sin(x)double x;{return x;}
-double sinh(x)double x;{return x;}
-double sqrt(x)double x;{return x;}
-double tan(x)double x;{return x;}
-double tanh(x)double x;{return x;}
-double y0(x)double x;{return x;}
-double y1(x)double x;{return x;}
-double yn(n,x)int n;double x;{return x;}
diff --git a/.ref-Research-V7/usr/lib/llib-port b/.ref-Research-V7/usr/lib/llib-port
deleted file mode 100644 (file)
index c4773af..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-       /* LINTLIBRARY */
-#include <stdio.h>
-       exit(s) {;}
-long   lseek(f, o, d) long o; { return(0); }
-char   *mktemp(p) char *p; { return(p);}
-int    (*signal(c, f))() int (*f)(); { return(f); }
-char   *strcat(a, b) char *a, *b; { ; }
-int    strcmp(a, b) char *a, *b; { return(1); }
-char   *strcpy(a, b) char *a, *b; { ; }
-int    strlen(s) char *s; { return(1); }
-long   tell(f) { return((long)0); }
-long   time(t) long *t; { return(0);}
-char   *calloc(n,s) unsigned n, s; { static char c[1]; return(c); }
-char   *malloc(n) unsigned n; {static char c; return(&c);}
-char   *realloc(p, n) char *p; unsigned n; { static char c; return(&c);}
-       free(p) char *p; {;}
-       fclose(f) FILE *f; {return(0);}
-       fflush(f) FILE *f; {return(0);}
-char   *fgets( s, l, f ) char *s; FILE *f; { return(s); }
-FILE   *fopen(s,m) char *s, *m; { return(stdin); }
-FILE   *freopen(s, m, f) char *s, *m; FILE *f; { return(stdin); }
-FILE   *fdopen(fd, m) char *m; { return(stdin);}
-       /* VARARGS */
-       fprintf( f, s ) FILE *f; char *s; {;}
-       fputs(s,f) char *s; FILE *f; {;}
-       fread( p, s, n, f ) char *p; FILE *f; {return(1);}
-       /* VARARGS */
-       fscanf( f, s ) FILE *f; char *s; {return(1);}
-int    fwrite( p, s, n, f ) char *p; FILE *f; {return(0);}
-       intss(){return(1); }
-       /* VARARGS */
-       printf( s ) char *s; {;}
-       rewind(f) FILE *f; {;}
-       /* VARARGS */
-       scanf( f ) char *f; {return(1); }
-       setbuf( f, b ) FILE *f; char *b; {;}
-       /* VARARGS */
-char   *sprintf( s, f ) char *s, *f; { return(s);}
-       /* VARARGS */
-       sscanf( s, f ) char *s, *f; { return(1); }
-       ungetc( c, f ) FILE *f; {  return(c); }
-       wdleng(){return(0); }
-struct _iobuf _iob[_NFILE];
-char   _ctype_[129];
diff --git a/.ref-Research-V7/usr/lib/tmac/tmac.an b/.ref-Research-V7/usr/lib/tmac/tmac.an
deleted file mode 100644 (file)
index cbe2af2..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-'      # month name
-.if "\nd"0" .nr m \n(mo-1
-.if "\nm"0" .ds ]m January
-.if "\nm"1" .ds ]m February
-.if "\nm"2" .ds ]m March
-.if "\nm"3" .ds ]m April
-.if "\nm"4" .ds ]m May
-.if "\nm"5" .ds ]m June
-.if "\nm"6" .ds ]m July
-.if "\nm"7" .ds ]m August
-.if "\nm"8" .ds ]m September
-.if "\nm"9" .ds ]m October
-.if "\nm"10" .ds ]m November
-.if "\nm"11" .ds ]m December
-'      # set the date
-.if n \{.nr m \nm+1
-.       ie \nd .ds ]W Modified \nm/\nd/\ny
-.       el .ds ]W Printed \n(mo/\n(dy/\n(yr\}
-.if t \{.ie \nd .ds ]W \*(]m \nd, 19\ny
-.       el .ds ]W \*(]m \n(dy, 19\n(yr\}
-.if t .ds ]W 7th Edition
-'      # reset the basic page layout
-.de }E
-.}f
-.in \\n()Ru+\\n(INu
-.ll \\n(LLu
-..
-'      # default tabs
-.de DT
-'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
-..
-'      # set type font and size
-.de }f
-.ps 10
-.ft 1
-..
-'      # handle the head of the page
-.de }H
-.ev 1
-.}C
-'sp .5i
-.ft 1
-.ps 10
-.tl @\\*(]H@\\*(]D@\\*(]H@
-'sp .5i
-.ev
-.ns
-..
-'      # handle the foot of the page
-.de }F
-.ev 1
-.ft 1
-.ps 10
-'sp .5i
-.tl @\\*(]W@\\*(]L@%@
-'bp
-.ev
-..
-'      # the cut mark
-.if n .ig
-.de }C
-.po .1i
-.tl '-'
-.po
-..
-'      # the final cut mark
-.de }M
-.}N
-.wh -1p }C
-.ll \\n(LLu
-..
-'      # no runout unless there was a .TH
-.de }K
-.}N
-.pl 1
-.ll \\n(LLu
-..
-.em }K
-'      # set title and heading
-.de TH
-.PD
-.if n .nr IN .5i
-.if t .nr IN .5i
-.nr LL \\n(.l
-.ds ]H \\$1\|(\|\\$2\|)
-.ds ]D UNIX Programmer's Manual
-.ds ]L \\$3
-.wh 0 }H
-.if t .wh -1i }F
-.if n .wh -1.167i }F
-.em }M
-.if \\n(nl .bp 1
-.}E
-.DT
-.nr )I .5i
-.nr )R 0
-.if n .na
-..
-'      # section heading
-.de SH
-.}X 0
-.nr )E 2
-\&\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6
-..
-'      # sub section heading
-.de SS
-.}X \\n()Ru+\\n(INu
-\&\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6
-.br
-..
-'      # subroutine for section heading
-.de }X
-.}E
-.ti \\$1
-.sp \\n()Pu
-.ne 2
-.nr )R 0
-.fi
-.it 1 }N
-.SM
-.B
-..
-'      # end of SH (cf }X above and }N below)
-.de }2
-.nr )E 0
-.}E
-.nr )I .5i
-.ns
-..
-'      # italic
-.de I
-.ft 2
-.it 1 }N
-.if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
-..
-'      # bold
-.de B
-.ft 3
-.it 1 }N
-.if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
-..
-'      # small
-.de SM
-.ps 9
-.it 1 }N
-.if !"\\$1"" \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6
-..
-'      # combinations of Roman, italic, bold
-.de RI
-.}S 1 2 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
-..
-.de RB
-.}S 1 3 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
-..
-.de IR
-.}S 2 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
-..
-.de IB
-.}S 2 3 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
-..
-.de BR
-.}S 3 1 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
-..
-.de BI
-.}S 3 2 \& "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6"
-..
-'      # make special case of shift out of italic
-.de }S
-.ds ]F
-.if "\\$1"2" .if !"\\$5"" .ds ]F\^
-.ie !"\\$4"" .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
-.el \\$3
-.}f
-..
-'      # paragraph
-.de LP
-.PP
-..
-.de PP
-.sp \\n()Pu
-.ne 2
-.}E
-.nr )I .5i
-.ns
-..
-'      # paragraph distance
-.de PD
-.if t .nr )P .4v
-.if n .nr )P 1v
-.if !"\\$1"" .nr )P \\$1v
-..
-'      # hanging indent
-.de HP
-.sp \\n()Pu
-.ne 2
-.if !"\\$1"" .nr )I \\$1n
-.ll \\n(LLu
-.in \\n()Ru+\\n(INu+\\n()Iu
-.ti \\n()Ru+\\n(INu
-.}f
-..
-'      # indented paragraph
-.de IP
-.TP \\$2
-\&\\$1
-..
-'      # hanging label
-.de TP
-.if !"\\$1"" .nr )I \\$1n
-.sp \\n()Pu
-.in \\n()Ru
-.nr )E 1
-.ns
-.it 1 }N
-.di ]B
-..
-'      # end of TP (cf }N below)
-.de }1
-.ds ]X \&\\*(]B\\
-.nr )E 0
-.if !"\\$1"" .nr )I \\$1n
-.}f
-.ll \\n(LLu
-.in \\n()Ru+\\n(INu+\\n()Iu
-.ti \\n(INu
-.ie !\\n()Iu+\\n()Ru-\w@\\*(]X@u-3p \{\\*(]X
-.br\}
-.el \\*(]X\h@|\\n()Iu+\\n()Ru@\c
-.}f
-..
-'      # handle end of 1-line features
-.de }N
-.if \\n()E .br
-.di
-.if "\\n()E"0" .}f
-.if "\\n()E"1" .}1
-.if "\\n()E"2" .}2
-.nr )E 0
-..
-'      # increase relative indent
-.de RS
-.nr ]\\n+()p \\n()I
-.nr )\\n()p \\n()R
-.ie !"\\$1"" .nr )R +\\$1n
-.el .nr )R +\\n()I
-.nr )I .5i
-.}E
-..
-'      # decrease relative indent
-.de RE
-.if !"\\$1"" \{.ie "\\$1"0" .nr )p 1 1
-.              el .nr )p \\$1 1\}
-.ds ]i \\*(]I\\n()p
-.ds ]r \\*(]R\\n()p
-.nr )I \\*(]i
-.nr )R \\*(]r
-.if \\n()p .nr )p -1
-.}E
-..
-.nr )p 0 1
-.ds ]I \\\\n(]
-.ds ]R \\\\n()
-.bd S 3 3
-.if t .ds R \(rg
-.if n .ds R (Reg.)
-.ds S \s10
-.hy 14
diff --git a/.ref-Research-V7/usr/lib/tmac/tmac.s b/.ref-Research-V7/usr/lib/tmac/tmac.s
deleted file mode 100644 (file)
index 3b5d0e2..0000000
+++ /dev/null
@@ -1,1360 +0,0 @@
-.nr TN 0
-.\"    RT -  reset everything to normal state
-.de RT
-.if !\\n(1T .BG
-.if !\\n(IK .if !\\n(IF .if !\\n(IX .if !\\n(BE .di
-.ce 0
-.ul 0
-.if \\n(QP \{\
-.      ll +\\n(QIu
-.      in -\\n(QIu
-.      nr QP -1\}
-.if \\n(NX<=1 .if \\n(AJ=0 .ll \\n(LLu
-.if \\n(IF=0 \{\
-.      ps \\n(PS
-.      if \\n(VS>=40 .vs \\n(VSu
-.      if \\n(VS<=39 .vs \\n(VSp\}
-.if \\n(IP .in -\\n(I\\n(IRu
-.if \\n(IP=0 .nr I0 \\n(PIu
-.if \\n(IP .nr IP -1
-.ft 1
-.bd 1
-.ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n
-.fi
-..
-.      \"IZ - initialization
-.de IZ
-.if \\n(FM=0 .nr FM 1i
-.nr YY -\\n(FMu
-.nr XX 0 1
-.nr IP 0
-.nr PI 5n
-.nr QI 5n
-.nr I0 \\n(PIu
-.nr PS 10
-.nr VS 12
-.if !\\n(PD .if n .nr PD 1v
-.if !\\n(PD .if t .nr PD 0.3v
-.nr ML 3v
-.ps \\n(PS
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-.nr IR 0
-.nr TB 0
-.nr SJ \\n(.j
-.nr LL 6i
-.ll \\n(LLu
-.nr LT \\n(.l
-.lt \\n(LTu
-.ev 1
-.nr FL \\n(LLu*11u/12u
-.ll \\n(FLu
-.ps 8
-.vs 10p
-.ev
-.if \a\\*(CH\a\a .ds CH "\(hy \\\\n(PN \(hy
-.if n .ds CF "\\*(DY
-.wh 0 NP
-.wh -\\n(FMu FO
-.ch FO 16i
-.wh -\\n(FMu FX
-.ch FO -\\n(FMu
-.wh -\\n(FMu/2u BT
-..
-.de TM
-.if \\n(IM=0 .if \\n(MN=0 .pn 0
-.so /usr/lib/tmac/tmac.scover
-.if \\n(IM=0 .if \\n(MN=0 .rm IM
-.if \\n(IM=0 .if \\n(MN=0 .rm MF
-.if \\n(IM=0 .if \\n(MN=0 .rm MR
-.if \\n(.T=0 .pi /usr/bin/col
-.nr ST 1
-.ds QF MEMORANDUM FOR FILE
-.br
-.ds MN \\$1
-.if !"\\$1"" .nr MM 1
-.if !"\\$2"" .nr MC 1
-.if !"\\$3"" .nr MG 1
-.nr TN 1
-.if \\n(.$-1 .ds CA \\$2
-.if \\n(.$-2 .ds CC \\$3
-.rm RP
-.rm S0
-.rm S2
-.rm AX
-..
-.              \" IM - internal memorandum
-.de IM
-.nr IM 1
-.TM "\\$1" "\\$2" "\\$3"
-.rm QF
-.RA
-.rm RA
-.rm RP
-.rm MF
-.rm MR
-..
-.              \" MF - memorandum for file.
-.de MF
-.nr MN 1
-.TM "\\$1" "\\$2" "\\$3"
-.rm MR
-.rm IM
-.RA
-.rm RA
-.rm RP
-.rm TM
-..
-.              \" MR - memo for record
-.de MR
-.nr MN 2
-.TM "\\$1" "\\$2" "\\$3"
-.ds QF MEMORANDUM FOR RECORD
-.rm MF
-.RA
-.rm RA
-.rm RP
-.rm IM
-.rm TM
-..
-.de EG
-.nr MN 3
-.TM "\\$1" "\\$2" "\\$3"
-.ds QF ENGINEER'S NOTES
-.rm MF
-.rm RP
-.rm IM
-.RA
-.rm RA
-.rm TM
-..
-.      \" LT - letter
-.de LT
-.LP
-.rs
-.sp 6
-.ll 80n
-.ti 48
-\\*(DY
-.ll
-.br
-.sp 3
-..
-.de OK
-.br
-.di
-.di OD
-..
-.de RP
-.nr ST 2
-.pn 0
-.rm SG
-.rm CS
-.rm TM
-.rm QF
-.rm IM
-.rm MR
-.rm MF
-.rm EG
-.br
-..
-.de TR \" Comp. Sci. Tech Rept series.
-.nr ST 3
-.pn 0
-.ds MN \\$1
-.rm SG
-.rm CS
-.rm TM
-.rm QF
-.rm IM
-.rm MR
-.rm MF
-.rm EG
-.br
-..
-.      \"TL - title and initialization
-.de TL
-.br
-.nr TV 1
-.if \\n(IM>0 .rm CS
-.if \\n(MN>0 .rm CS
-.ME
-.rm ME
-.di WT
-.nr SJ \\n(.j
-.na
-.fi
-.ll 5.0i
-.if n .if \\n(TN .ll 30
-.if t .if \\n(TN .ll 3.5i
-.ft 3
-.ps 10
-.if !\\n(TN .ps 12
-.if !\\n(TN .rm CS
-.hy 0
-..
-.de TX
-.rs
-.sp .5i
-.ce 1000
-.if n .ul 1000
-.ps 12
-.ft 3
-.vs 15p
-.ne 4
-.hy 0
-.WT
-.hy 14
-.ce 0
-.ul 0
-..
-.      \"      AU - author(s)
-.de AU
-.nr AV 1
-.ad \\n(SJ
-.br
-.di
-.br
-.nf
-.nr NA +1
-.ds R\\n(NA \\$1
-.ds E\\n(NA \\$2
-.di A\\n(NA
-.ll \\n(LLu
-.if \\n(TN=0 .if t .ft 2
-.if \\n(TN=0 .if n .ft 1
-.if \\n(TN>0 .ft 3
-.if \\n(TN .if n .ll 16
-.if \\n(TN .if t .ll 1.4i
-.ps 10
-..
-.de AX
-.ft 1
-.rs
-.ce 1000
-.if n .ul 0
-.ps 10
-.vs 12p
-.if n .sp 2
-.if t .sp
-.A1
-.if n .sp 
-.if t .sp 0.5
-.ns
-.I1
-.if \\n(NA-1 .if n .sp 2
-.if \\n(NA-1 .if t .sp
-.A2
-.if \\n(NA-1 .if n .sp
-.if \\n(NA-1 .if t .sp 0.5
-.ns
-.I2
-.if \\n(NA-2 .if t .sp
-.if \\n(NA-2 .if n .sp 2
-.A3
-.if \\n(NA-2 .if t .sp 0.5
-.if \\n(NA-2 .if n .sp
-.ns
-.I3
-.if \\n(NA-3 .if t .sp
-.if \\n(NA-3 .if n .sp 2
-.A4
-.if \\n(NA-3 .if t .sp 0.5
-.if \\n(NA-3 .if n .sp
-.ns
-.I4
-.if \\n(NA-4 .if t .sp
-.if \\n(NA-4 .if n .sp 2
-.A5
-.if \\n(NA-4 .if n .sp
-.if \\n(NA-4 .if t .sp 0.5
-.ns
-.I5
-.if \\n(NA-5 .if t .sp
-.if \\n(NA-5 .if n .sp 2
-.A6
-.if \\n(NA-5 .if n .sp
-.if \\n(NA-5 .if t .sp 0.5
-.ns
-.I6
-.if \\n(NA-6 .if t .sp
-.if \\n(NA-6 .if n .sp 2
-.A7
-.if \\n(NA-6 .if n .sp
-.if \\n(NA-6 .if t .sp 0.5
-.ns
-.I7
-.if \\n(NA-7 .if t .sp
-.if \\n(NA-7 .if n .sp 2
-.A8
-.if \\n(NA-7 .if n .sp
-.if \\n(NA-7 .if t .sp 0.5
-.ns
-.I8
-.if \\n(NA-8 .if t .sp
-.if \\n(NA-8 .if n .sp 2
-.A9
-.if \\n(NA-8 .if n .sp
-.if \\n(NA-8 .if t .sp 0.5
-.ns
-.I9
-..
-.      \"AI - authors institution
-.de AI
-.br
-.ft 1
-.di
-.di I\\n(NA
-.nf
-..
-.      \"AB - begin an abstract
-.de AB
-.br
-.di
-.ul 0
-.ce 0
-.nr 1T 1
-.nr IK 1
-.nr KI 1
-.di WB
-.rs
-.nr AJ 1
-.ce 1
-.ft 2
-.if n .ul
-.ll \\n(LLu
-.if \\n(.$=0 ABSTRACT
-.if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no"  \\$1
-.if \\n(.$=0 .sp
-.if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no" .sp
-.hy 14
-.ul 0
-.ce 0
-.fi
-.ft 1
-.nr OJ \\n(.i
-.in +\\n(.lu/12u
-.ll -\\n(.lu/12u
-.br
-.ps \\n(PS
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-.ti +\\n(PIu
-..
-.      \"AE - end of an abstract
-.de AE
-.br
-.di
-.ll \\n(LLu
-.ps \\n(PS
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-.nr 1T 0
-.nr IK 0
-.in \\n(OJu
-.nr AJ 0
-.di
-.ce 0
-.if \\n(ST=2 .SY
-.if \\n(ST<3 .rm SY
-..
-.      \"S2 - release paper style
-.      \"SY - cover sheet of released paper
-.de SY
-.ll \\n(LLu
-.ns
-.if \\n(TV .TX
-.if \\n(AV .AX
-.rs
-.ce 0
-.nf
-.sp 3
-.ls 1
-.pn 2
-.WB
-.ls 
-.sp 3v
-\\*(DY
-.sp |9i
-.if \\n(FP>0 .FA
-.FG
-.if \\n(GA=1 .nr GA 2
-.fi
-..
-.      \"S2 - first text page, released paper format
-.de S2
-.ce 0
-.br
-.SY
-.rm SY
-.bp 1
-.if \\n(TV .TX
-.if \\n(AV .AX
-.rs
-.ce 0
-.ft 1
-.ad \\n(SJ
-..
-.      \"S0- mike lesk conserve paper style
-.de S0
-.ce 0
-.br
-.ll \\n(LLu
-.if \\n(TV+\\n(AV>0 .ns
-.if \\n(TV .TX
-.if \\n(AV .AX
-.if \\n(TV+\\n(AV>0 .rs
-.ce 0
-.if \\n(TV>0 .sp 2
-.ls 1
-.if \\n(FP>0 \{\
-.      FJ
-.      nf
-.      FG
-.      fi
-.      FK
-.      nr FP 0\}
-.nf
-.WB
-.ls
-.fi
-.ad \\n(SJ
-..
-.      \"S3 - CSTR style
-.de S3
-.rs
-.sp |2.25i
-.ce 1000
-.I1
-.if \\n(NA>1 .sp .5
-.if \\n(NA>1 .I2
-.if \\n(NA>2 .sp .5
-.if \\n(NA>2 .I3
-.if \\n(NA>3 .sp .5
-.if \\n(NA>3 .I4
-.if \\n(NA>4 .sp .5
-.if \\n(NA>4 .I5
-.if \\n(NA>5 .sp .5
-.if \\n(NA>5 .I6
-.if \\n(NA>6 .sp .5
-.if \\n(NA>6 .I7
-.if \\n(NA>7 .sp .5
-.if \\n(NA>7 .I8
-.if \\n(NA>8 .sp .5
-.if \\n(NA>8 .I9
-.sp |4i
-.      \"check how long title is: can space extra .25 inch if short
-.di EZ
-.WT
-.di
-.if \\n(dn<1.5v .if \\n(NA=1 .sp .25i
-.ft 1
-Computing Science Technical Report No. \\*(MN
-.sp
-.if t .ft 3
-.if n .ul 100
-.ps 12
-.vs 15p
-.hy 0
-.WT
-.hy 14
-.ft 1
-.if n .ul 0
-.ps 10
-.vs 12p
-.sp
-.ft 1
-.A1
-.A2
-.A3
-.A4
-.A5
-.A6
-.A7
-.A8
-.A9
-.ce 0
-.sp |8.5i
-.ce 0
-\\*(DY
-.bp 0
-.ft 1
-.S2
-..
-.      \"SG - signature
-.de SG
-.br
-.KS
-.in +2u*\\n(.lu/3u
-.sp 2
-.A1
-.if \\n(NA-1 .sp 2
-.A2
-.if \\n(NA-2 .sp 2
-.A3
-.if \\n(NA-3 .sp 2
-.A4
-.if \\n(NA-4 .sp 2
-.A5
-.if \\n(NA>5 .sp 2
-.A6
-.if \\n(NA>6 .sp 2
-.A7
-.if \\n(NA>7 .sp 2
-.A8
-.if \\n(NA>8 .sp 2
-.A9
-.in
-.nf
-.sp -1
-.if \\n(.$>=1 \\$1
-.if \\n(.$>=2 \\$2
-.if \\n(.$>=3 \\$3
-.if \\n(.$>=4 \\$4
-.if \\n(.$>=5 \\$5
-.if \\n(.$>=6 \\$6
-.if \\n(.$>=7 \\$7
-.if \\n(.$>=8 \\$8
-.if \\n(.$>=9 \\$9
-.fi
-.br
-.KE
-..
-.      \"Tables.  TS - table start, TE - table end
-.de TS
-.br
-.if !\\n(1T .RT
-.ul 0
-.ti \\n(.iu
-.if t .sp 0.5
-.if n .sp
-.if \a\\$1\aH\a .TQ
-.nr IX 1
-..
-.de TQ
-.di TT
-.nr IT 1
-..
-.de TH
-.if \\n(.d>0.5v .nr T. 0
-.if \\n(.d>0.5v .T# 0
-.di
-.nr TQ \\n(.i
-.nr HT 1
-.in 0
-.mk #a
-.mk #b
-.mk #c
-.mk #d
-.mk #e
-.mk #f
-.TT
-.in \\n(TQu
-.mk #T
-..
-.de TE
-.nr IX 0
-.if \\n(IT>0 .if \\n(HT=0 .di
-.if \\n(IT>0 .if \\n(HT=0 .nr EF \\n(.u
-.if \\n(IT>0 .if \\n(HT=0 .nf
-.if \\n(IT>0 .if \\n(HT=0 .TT
-.if \\n(IT>0 .if \\n(HT=0 .if \\n(EF>0 .fi
-.nr IT 0
-.nr HT 0
-.if n .sp 1
-.if t .sp 0.5
-.rm a+ b+ c+ d+ e+ f+ g+ h+ i+ j+ k+ l+ n+ m+
-.rr 32 33 34 35 36 37 38 40 79 80 81 82
-.rr a| b| c| d| e| f| g| h| i| j| k| l| m|
-.rr a- b- c- d- e- f- g- h- i- j- k- l- m-
-..
-.so /usr/lib/tmac/tmac.sdisp
-.de KS
-.so /usr/lib/tmac/tmac.skeep
-.]K
-.rn ]J KF
-.rn ]K KS
-..
-.de KF
-.so /usr/lib/tmac/tmac.skeep
-.]J
-.rn ]K KS
-.rn ]J KF
-..
-.de EQ  \"equation, breakout and display
-.nr EF \\n(.u
-.rm EE
-.nr LE 1       \" 1 is center
-.ds EL \\$1
-.if "\\$1"L" .ds EL \\$2
-.if "\\$1"L" .nr LE 0
-.if "\\$1"C" .ds EL \\$2
-.if "\\$1"I" .nr LE 0
-.if "\\$1"I" .ds EE \\h'|10n'
-.if "\\$1"I" .if !"\\$3"" .ds EE \\h'\\$3'
-.if "\\$1"I" .ds EL \\$2
-.if \\n(YE>0 .nf
-.di EZ
-..
-.de EN  \" end of a displayed equation
-.br
-.di
-.rm EZ
-.nr ZN \\n(dn
-.if \\n(ZN>0 .if \\n(YE=0 .LP
-.if \\n(ZN=0 .if !"\\*(EL"" .nr ZN 1
-.if "\\n(.z"" .if \\n(ZN>0 .if !\\n(nl=\\n(PE .if t .sp .5
-.if "\\n(.z"" .if \\n(ZN>0 .if !\\n(nl=\\n(PE .if n .sp 1
-.if !"\\n(.z"" .if \\n(ZN>0 .if !\\n(.d=\\n(PE .if t .sp .5
-.if !"\\n(.z"" .if \\n(ZN>0 .if !\\n(.d=\\n(PE .if n .sp 1
-'pc
-.if \\n(BD>0 .nr LE 0 \" can't mean centering in this case.
-.if \\n(MK>0 .if \\n(LE=1 .ds EE \\h'|10n'
-.if \\n(MK>0 .nr LE 0 \" don't center if mark/lineup
-'lt \\n(.lu
-.if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE>0 .tl \(ts\(ts\\*(10\(ts\\*(EL\(ts
-.if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD=0 .tl \(ts\\*(EE\\*(10\(ts\(ts\\*(EL\(ts
-.if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w\(ts\\*(10\(ts .nr BD \\w\(ts\\*(10\(ts
-.if \\n(EP=0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 \!\\*(10\\t\\*(EL
-.if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE>0 .tl \(ts\\*(EL\(ts\\*(10\(ts\(ts
-.if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD=0 .tl \(ts\\*(EL\\*(EE\\*(10\(ts\(ts\(ts
-.if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 .if \\n(BD<\\w\(ts\\*(10\(ts .nr BD \\w\(ts\\*(10\(ts
-.if \\n(EP>0 .if \\n(ZN>0 .if \\n(LE=0 .if \\n(BD>0 \!\\h'-\\\\n(.iu'\\*(EL\\h'|0'\\*(10
-.\".di EZ \" GCOS patch
-.\"\\*(10 \" GCOS patch
-.\".br \" GCOS patch
-.\".di \" GCOS patch
-.\".rm EZ \" GCOS patch
-'lt \\n(LLu
-'pc %
-.if \\n(YE>0 .if \\n(EF>0 .fi
-.rm EL 10 11 12 13 14 15 16 17 18 19 20 21 22 23
-.rr 10 11 12 13 14 15 16 17 18 19 20 21 22 23
-.if \\n(ZN>0 .if t .sp .5
-.if \\n(ZN>0 .if n .sp
-.if "\\n(.z"" .nr PE \\n(nl
-.if !"\\n(.z"" .nr PE \\n(.d
-..
-.de ME
-.nr SJ \\n(.j
-.if \\n(LL>0 .nr LT \\n(LL
-.nr YE 1
-.if \\n(PO=0 .nr PO \\n(.o
-..
-.      \"EM end up macro - process left over keep-release
-.de EM
-.br
-.if \\n(TB=0 .if t .wh -1p CM
-.if \\n(TB \&\c
-.if \\n(TB 'bp
-.if \\n(TB .NP
-.if \\n(TB .ch CM 160
-..
-.      \"NP new page
-.de NP
-.if \\n(FM+\\n(HM>=\\n(.p .tm Margins bigger than page length.
-.if \\n(FM+\\n(HM>=\\n(.p .ab
-.if \\n(FM+\\n(HM>=\\n(.p .ex
-.nr PX \\n(.s
-.nr PF \\n(.f
-.if t .CM
-.if \\n(HM=0 .nr HM 1i
-'sp \\n(HMu/2u
-.lt \\n(LTu
-.ps \\n(PS
-.ft 1
-.if \\n(PO>0 .po \\n(POu
-.PT
-.ps \\n(PX
-.ft \\n(PF
-'sp |\\n(HMu
-.nr XX 0 1
-.nr YY 0-\\n(FMu
-.ch FO 16i
-.ch FX 17i
-.ch FO -\\n(FMu
-.ch FX \\n(.pu-\\n(FMu
-.if \\n(MF .FV
-.nr MF 0
-.mk
-.os
-.ev 1
-.if \\n(TD=0 .if \\n(TC<5  .XK
-.nr TC 0
-.ns
-.ev
-.nr TQ \\n(.i
-.nr TK \\n(.u
-.if \\n(IT>0 \{\
-.      in 0
-.      nf
-.      TT
-.      in \\n(TQu
-.      if \\n(TK .fi\
-\}
-.mk #T
-.if t .if \\n(.o+\\n(LL>7.75i .tm Offset + line length exceeds 7.75 inches, too wide
-..
-.de XK
-.nr TD 1
-.nf
-.ls 1
-.in 0
-.rn KJ KL
-.KL
-.rm KL
-.if "\\n(.z"KJ" .di
-.nr TB 0
-.if "\\n(.z"KJ" .nr TB 1
-.br
-.in
-.ls
-.fi
-.nr TD 0
-..
-.de KD
-.nr KM 0
-.if "\\n(.z"KJ" .nr KM 1 \" KM is 1 if in a rediversion of keeps
-.if \\n(KM>0 \!.KD \\$1
-.if \\n(KM=0 .if \\n(.t<\\$1 .di KJ
-..
-.de PT
-.lt \\n(LLu
-.pc %
-.nr PN \\n%
-.if \\n%-1 .tl '\\*(LH'\\*(CH'\\*(RH'
-.lt \\n(.lu
-..
-.      \"FO - footer of page
-.de FO
-.rn FO FZ
-.if \\n(K1>0 .tm This memo has a multi-page cover sheet.  You are
-.if \\n(K1>0 .tm rebuked in the name of the Committee on Technical Memoranda.
-.if \\n(IT>0 .nr T. 1
-.if \\n(IT>0 .if \\n(FC=0  .T# 1
-.if \\n(IT>0 .br
-.nr FC +1
-.if \\n(NX<2 .nr WF 0
-.nr dn 0
-.if \\n(FC<=1 .if \\n(XX .XF
-.rn FZ FO
-.nr MF 0
-.if \\n(dn  .nr MF 1
-.if !\\n(WF .nr YY 0-\\n(FMu
-.if !\\n(WF .ch FO \\n(YYu
-.if !\\n(dn .nr WF 0
-.if \\n(FC<=1 .if \\n(XX=0  .if \\n(NX>1 .RC
-.if \\n(FC<=1 .if \\n(XX=0  .if \\n(NX<1 'bp
-.nr FC -1
-.if \\n(ML>0 .ne \\n(MLu
-..
-.      \"2C - begin double column
-.de 2C
-.MC \" default MC is double column
-..
-.de MC \" multiple columns- arg is line length
-.nr L1 \\n(LL*7/15
-.if \\n(.$>0 .nr L1 \\$1n
-.nr GW 0-1
-.if \\n(.$>1 .nr GW \\$1n
-.nr NQ \\n(LL/\\n(L1
-.if \\n(NQ<1 .nr NQ 1
-.if \\n(NQ>2 .if (\\n(LL%\\n(L1)=0 .nr NQ -1
-.if \\n(1T=0 \{\
-.      BG
-.      if n .sp 4
-.      if t .sp 2\}
-.if \\n(NX=0 .nr NX 1
-.if !\\n(NX=\\n(NQ \{\
-.      RT
-.      if \\n(NX>1 .bp
-.      mk
-.      nr NC 1
-.      po \\n(POu\}
-.if \\n(NQ>1 .hy 12
-.nr NX \\n(NQ
-.nr CW \\n(L1
-.ll \\n(CWu
-.nr FL \\n(CWu*11u/12u
-.if \\n(NX>1 .nr GW (\\n(LL-(\\n(NX*\\n(CW))/(\\n(NX-1)
-.nr RO \\n(CW+\\n(GW
-.ns
-..
-.de RC
-.if \\n(NC>=\\n(NX .C2
-.if \\n(NC<\\n(NX .C1
-.nr NC \\n(ND
-..
-.de C1
-.rt
-.po +\\n(ROu
-.nr ND \\n(NC+1
-.nr XX 0 1
-.if \\n(MF .FV
-.ch FX \\n(.pu-\\n(FMu
-.ev 1
-.if \\n(TB .XK
-.nr TC 0
-.ev
-.nr TQ \\n(.i
-.if \\n(IT>0 .in 0
-.if \\n(IT>0 .TT
-.if \\n(IT>0 .in \\n(TQu
-.mk #T
-.ns
-..
-.ch FO \\n(YYu
-.de C2
-.po \\n(POu
-'bp
-.nr ND 1
-..
-.      \"1C - return to single column format
-.de 1C
-.MC \\n(LLu
-.hy 14
-..
-.      \".de R3
-.      \".pl 102
-.      \".nr LT \\n(.l
-.      \"..
-.de MH
-Bell Laboratories
-Murray Hill, New Jersey 07974
-..
-.de PY
-Bell Laboratories
-Piscataway, New Jersey 08854
-..
-.de BT
-.nr PX \\n(.s
-.nr PF \\n(.f
-.ft 1
-.ps \\n(PS
-'lt \\n(LTu
-.po \\n(POu
-.if \\n%>0 .tl '\\*(LF'\\*(CF'\\*(RF'
-.ft \\n(PF
-.ps \\n(PX
-..
-.      \"PP - paragraph
-.de PP
-.RT
-.ne 1.1
-.if \\n(1T .sp \\n(PDu
-.ti +\\n(PIu
-..
-.      \"SH - (unnumbered) section heading
-.de SH
-.ti \\n(.iu
-.RT
-.if \\n(1T .sp 1
-.if !\\n(1T .BG
-.RT
-.ne 4
-.ft 3
-.if n .ul 1000
-..
-.      \"NH - numbered heading
-.de NH
-.RT
-.if \\n(1T .sp 1
-.if !\\n(1T .BG
-.RT
-.ne 4
-.ft 3
-.if n .ul 1000
-.nr NS \\$1
-.if !\\n(.$ .nr NS 1
-.if !\\n(NS .nr NS 1
-.nr H\\n(NS +1
-.if !\\n(NS-4 .nr H5 0
-.if !\\n(NS-3 .nr H4 0
-.if !\\n(NS-2 .nr H3 0
-.if !\\n(NS-1 .nr H2 0
-.if !\\$1 .if \\n(.$ .nr H1 1
-.ds SN \\n(H1.
-.ti \\n(.iu
-.if \\n(NS-1 .as SN \\n(H2.
-.if \\n(NS-2 .as SN \\n(H3.
-.if \\n(NS-3 .as SN \\n(H4.
-.if \\n(NS-4 .as SN \\n(H5.
-\\*(SN
-..
-.      \"BG - begin, execute at first PP
-.de BG
-.br
-.ME
-.rm ME
-.di
-.ce 0
-.nr KI 0
-.hy 14
-.nr 1T 1
-.S\\n(ST
-.rm S0
-.rm S1
-.rm S2
-.rm S3
-.rm OD
-.rm OK
-.rm TX
-.rm AX
-.rm WT
-.rm CS
-.rm TM
-.rm IM
-.rm MF
-.rm MR
-.rm RP
-.rm I1
-.rm I2
-.rm I3
-.rm I4
-.rm I5
-.rm CB
-.rm E1
-.rm E2
-.de TL
-.ft 3
-.sp
-.if n .ul 100
-.ce 100
-.LG
-\\..
-.de AU
-.ft 2
-.if n .ul 0
-.ce 100
-.sp
-.NL
-\\..
-.de AI
-.ft 1
-.ce 100
-.if n .ul 0
-.if n .sp
-.if t .sp .5
-.NL
-\\..
-.RA
-.rm RA
-.rn FJ FS
-.rn FK FE
-.nf
-.ev 1
-.ps \\n(PS-2
-.vs \\n(.s+2p
-.ev
-.if \\n(KG=0 .nr FP 0 
-.if \\n(GA>1 .if \\n(KG=0 .nr GA 0 \" next UNIX must be flagged.
-.nr KG 0 
-.if \\n(FP>0 .FS
-.if \\n(FP>0 .FG
-.if \\n(FP>0 .FE
-.br
-.if \\n(TV>0 .if n .sp 2
-.if \\n(TV>0 .if t .sp 1
-.fi
-.ll \\n(LLu
-..
-.de RA \"redefine abstract macros
-.de AB
-.br
-.if !\\n(1T .BG
-.ce 1
-.sp 1
-.if \\n(.$=0 ABSTRACT
-.if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no"  \\$1
-.if \\n(.$=0 .sp
-.if \\n(.$>0 .if !"\\$1"-" .if !"\\$1"no" .sp
-.sp 1
-.nr AJ 1
-.in +\\n(.lu/12u
-.ll -\\n(.lu/12u
-.RT
-\\..
-.de AE
-.nr AJ 0
-.br
-.in 0
-.ll \\n(LLu
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-\\..
-..
-.      \"IP - indented paragraph
-.de IP
-.RT
-.if !\\n(IP .nr IP +1
-.sp \\n(PDu
-.ne 3v
-.if \\n(.$-1 .nr I\\n(IR \\$2n
-.in +\\n(I\\n(IRu
-.nr TY \\n(TZ-\\n(.i
-.ta \\n(I\\n(IRu \\n(TYuR
-.if \\n(.$>0 \{\
-.ti -\\n(I\\n(IRu
-\&\\$1\t\c\}
-..
-.      \"LP - left aligned (block) paragraph
-.de LP
-.ti \\n(.iu
-.RT
-.if \\n(1T .sp \\n(PDu
-.ne 1.1
-..
-.de QP
-.ti \\n(.iu
-.RT
-.if \\n(1T .sp \\n(PDu
-.ne 1.1
-.nr QP 1
-.in +\\n(QIu
-.ll -\\n(QIu
-.ti \\n(.iu
-..
-.      \"IE - synonym for .LP
-.de IE
-.LP
-..
-.      \"LB - label paragraph
-.de LB
-.in +\\n(I\\n(IRu
-.ta \\n(I\\n(IRu
-.if \\n(.$ .ti -\\n(I\\n(IRu
-.if \\n(.$ \&\\$1\t\c
-..
-.de XP
-.RT
-.if !\\n(IP .nr IP +1
-.sp \\n(PDu
-.ne 3
-.if \\n(.$=3 .nr I\\n(IR \\$3n
-.if \\n(.$=4 .nr I\\n(IR \\$4n
-.nr J\\n(IR \\n(IRu/2u
-.if \\n(.$=4 .nr J\\n(IR \\$3n
-.in +\\n(I\\n(IRu
-.ta \\n(J\\n(IRu \\n(I\\n(IRu
-.ti -\\n(I\\n(IRu
-\0\\$1\t\\$2\t\c
-..
-.      \"RS - prepare for double indenting
-.de RS
-.nr IS \\n(IP
-.RT
-.nr IP \\n(IS
-.if \\n(IP>0 .in +\\n(I\\n(IRu
-.nr IR +1
-.nr I\\n(IR \\n(PIu
-.in +\\n(I\\n(IRu
-.nr TY \\n(TZ-\\n(.i
-.ta \\n(TYuR
-..
-.      \"RE - retreat to the left
-.de RE
-.nr IS \\n(IP
-.RT
-.nr IP \\n(IS
-.if \\n(IR>0 .nr IR -1
-.if \\n(IP<=0 .in -\\n(I\\n(IRu
-..
-.de TC
-.nr TZ \\n(.lu
-.if \\n(.$ .nr TZ \\$1n
-.ta \\n(TZuR
-..
-.de TD
-.LP
-.nr TZ 0
-..
-.      \"CM - cut mark
-.de CM
-.po 0
-.lt 7.6i
-.ft 1
-.ps 10
-.vs 4p
-.tl '--''--'
-.po
-.vs
-.lt
-.ps
-.ft
-..
-.      \"B - bold font
-.de B
-.nr PQ \\n(.f
-.if t .ft 3
-.if "\\$1"" .if n .ul 1000
-.if !"\\$1"" .if n .ul 1
-.if t .if !"\\$1"" \&\\$1\\f\\n(PQ\\$2
-.if n .if \\n(.$=1 \&\\$1
-.if n .if \\n(.$>1 \&\\$1\\c
-.if n .if \\n(.$>1 \\&\\$2
-..
-.      \"R - Roman font
-.de R
-.if n .ul 0
-.ft 1
-..
-.      \"I - italic font
-.de I
-.nr PQ \\n(.f
-.if t .ft 2
-.if "\\$1"" .if n .ul 1000
-.if !"\\$1"" .if n .ul 1
-.if t .if !"\\$1"" \&\\$1\|\\f\\n(PQ\\$2
-.if n .if \\n(.$=1 \&\\$1
-.if n .if \\n(.$>1 \&\\$1\\c
-.if n .if \\n(.$>1 \\&\\$2
-..
-.      \"TA - tabs set in ens or chars
-.de TA
-.ta \\$1n \\$2n \\$3n \\$4n \\$5n \\$6n \\$7n \\$8n \\$9n
-..
-.      \"SM - make smaller size
-.de SM
-.if \\n(.$>0 \&\\$3\s-2\\$1\s0\\$2
-.if \\n(.$=0 .ps -2
-..
-.      \"LG - make larger size
-.de LG
-.ps +2
-..
-.      \"NL - return to normal size
-.de NL
-.ps \\n(PS
-..
-.      \"DA - force date; ND - no date or new date.
-.de DA
-.if \\n(.$ .ds DY \\$1 \\$2 \\$3 \\$4
-.ds CF \\*(DY
-..
-.de ND
-.ds DY \\$1 \\$2 \\$3 \\$4
-.rm CF
-..
-.if \n(mo-0 .ds MO January
-.if \n(mo-1 .ds MO February
-.if \n(mo-2 .ds MO March
-.if \n(mo-3 .ds MO April
-.if \n(mo-4 .ds MO May
-.if \n(mo-5 .ds MO June
-.if \n(mo-6 .ds MO July
-.if \n(mo-7 .ds MO August
-.if \n(mo-8 .ds MO September
-.if \n(mo-9 .ds MO October
-.if \n(mo-10 .ds MO November
-.if \n(mo-11 .ds MO December
-.if \n(dw-0 .ds DW Sunday
-.if \n(dw-1 .ds DW Monday
-.if \n(dw-2 .ds DW Tuesday
-.if \n(dw-3 .ds DW Wednesday
-.if \n(dw-4 .ds DW Thursday
-.if \n(dw-5 .ds DW Friday
-.if \n(dw-6 .ds DW Saturday
-.ds DY \*(MO \n(dy, 19\n(yr
-.IZ
-.rm IZ
-.rm MO
-.de FN
-.FS
-..
-.      \"FS - begin footnote
-.de FJ
-'ce 0
-.di
-.ev1
-.ll \\n(FLu
-.da FF
-.br
-.if \\n(IF>0 .tm Footnote within footnote-illegal.
-.nr IF 1
-.if !\\n+(XX-1 .FA
-..
-.      \"FE - footnote end
-.de FK
-.br
-.in 0
-.nr IF 0
-.di
-.ev
-.if !\\n(XX-1 .nr dn +\\n(.v
-.nr YY -\\n(dn
-.if \\n(NX=0 .nr WF 1
-.if \\n(dl>\\n(CW .nr WF 1
-.if (\\n(nl+\\n(.v)<=(\\n(.p+\\n(YY) .ch FO \\n(YYu
-.if (\\n(nl+\\n(.v)>(\\n(.p+\\n(YY) .if \\n(nl>(\\n(HM+1.5v) .ch FO \\n(nlu+\\n(.vu
-.if (\\n(nl+\\n(.v)>(\\n(.p+\\n(YY) .if \\n(nl+\\n(FM+1v>\\n(.p .ch FX \\n(.pu-\\n(FMu+2v
-.if (\\n(nl+\\n(.v)>(\\n(.p+\\n(YY) .if \\n(nl<=(\\n(HM+1.5v) .ch FO \\n(HMu+(4u*\\n(.vu)
-..
-.\"    First page footer.
-.de FS
-.ev1
-.br
-.ll \\n(FLu
-.da FG
-..
-.de FE
-.br
-.di
-.nr FP \\n(dn
-.if \\n(1T=0 .nr KG 1 \"not in abstract repeat next page.
-.if "\\n(.z"OD" .nr KG 0 \" if in OK, don't repeat.
-.ev
-..
-.de FA
-.if n __________________________
-.if t \l'1i'
-.br
-..
-.de FV
-.FS
-.nf
-.ls 1
-.FY
-.ls
-.fi
-.FE
-..
-.de FX
-.if \\n(XX>0 .di FY
-.if \\n(XX>0 .ns
-..
-.de XF
-.if \\n(nlu+1v>(\\n(.pu-\\n(FMu) .ch FX \\n(nlu+1.9v
-.ev1
-.nf
-.ls 1
-.FF
-.rm FF
-.nr XX 0 1
-.br
-.ls
-.di
-.fi
-.ev
-..
-.de FL
-.ev1
-.nr FL \\$1n
-.ll \\$1
-.ev
-..
-.de HO
-Bell Laboratories
-Holmdel, New Jersey 07733
-..
-.de WH
-Bell Laboratories
-Whippany, New Jersey 07981
-..
-.de IH
-Bell Laboratories
-Naperville, Illinois 60540
-..
-.de UL \" underline argument, don't italicize
-.if t \\$1\l'|0\(ul'\\$2
-.if n .I \\$1 \\$2
-..
-.em EM
-. \"  ACCENTS  say \*'e or \*`e to get e acute or e grave
-.ds ' \h'\w'e'u*4/10'\z\(aa\h'-\w'e'u*4/10'
-.ds ` \h'\w'e'u*4/10'\z\(ga\h'-\w'e'u*4/10'
-. \"  UMLAUT  \*:u, etc.
-.ds : \v'-0.6m'\h'(1u-(\\n(.fu%2u))*0.13m+0.06m'\z.\h'0.2m'\z.\h'-((1u-(\\n(.fu%2u))*0.13m+0.26m)'\v'0.6m'
-. \" TILDE and CIRCUMFLEX
-.ds ^ \\k:\h'-\\n(.fu+1u/2u*2u+\\n(.fu-1u*0.13m+0.06m'\z^\h'|\\n:u'
-.ds ~ \\k:\h'-\\n(.fu+1u/2u*2u+\\n(.fu-1u*0.13m+0.06m'\z~\h'|\\n:u'
-.      \" czech v symbol
-.ds C \\k:\\h'+\\w'e'u/4u'\\v'-0.6m'\\s6v\\s0\\v'0.6m'\\h'|\\n:u'
-.ds v \\k:\\h'+\\w'e'u/4u'\\v'-0.6m'\\s6v\\s0\\v'0.6m'\\h'|\\n:u'
-.              \" cedilla
-.ds , \\k:\\h'\\w'c'u*0.4u'\\z,\\h'|\\n:u'
-.so /usr/lib/tmac/tmac.srefs
-.if n .ds [. [
-.if t .ds [. \s-2\v'-.4m'\f1
-.if n .ds .] ]
-.if t .ds .] \v'.4m'\s+2\fP
-.if n .ds [o ""
-.if n .ds [c ""
-.if t .ds [o ``
-.if t .ds [c ''
-.de UX
-.ie \\n(GA>0 \\$2\s-2UNIX\s0\\$1
-.el \{\
-.if n \\$2UNIX\\$1*
-.if t \\$2\s-2UNIX\\s0\\$1\\f1\(dg\\fP
-.FS
-.if n *UNIX
-.if t \(dgUNIX
-.ie \\$3=1 is a Footnote of Bell Laboratories.
-.el is a Trademark of Bell Laboratories.
-.FE
-.nr GA 1\}
-..
-.de US
-the
-.UX
-operating system
-..
-.de QS
-.br
-.LP
-.in +\\n(QIu
-.ll -\\n(QIu
-..
-.de QE
-.br
-.ll +\\n(QIu
-.in -\\n(QIu
-.LP
-..
-.de B1 \" begin boxed stuff
-.br
-.di BB
-.nr BC 0
-.if "\\$1"C" .nr BC 1
-.nr BE 1
-..
-.de B2 \" end boxed stuff
-.br
-.nr BI 1n
-.if \\n(.$>0 .nr BI \\$1n
-.di
-.nr BE 0
-.nr BW \\n(dl
-.nr BH \\n(dn
-.ne \\n(BHu+\\n(.Vu
-.nr BQ \\n(.j
-.nf
-.ti 0
-.if \\n(BC>0 .in +(\\n(.lu-\\n(BWu)/2u
-.in +\\n(BIu
-.BB
-.in -\\n(BIu
-.nr BW +2*\\n(BI
-.sp -1
-\l'\\n(BWu\(ul'\L'-\\n(BHu'\l'|0\(ul'\h'|0'\L'\\n(BHu'
-.if \\n(BC>0 .in -(\\n(.lu-\\n(BWu)/2u
-.if \\n(BQ .fi
-.br
-..
-.de AT
-.nf
-.sp
-.ne 2
-Attached:
-..
-.de CT
-.nf
-.sp
-.ne 2
-.ie \\n(.$ Copy to \\$1:
-.el Copy to:
-..
-.de BX
-.if t \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
-.if n \(br\\kA\|\\$1\|\\kB\(br\v'-1v'\h'|\\nBu'\l'|\\nAu'\v'1v'\l'|\\nAu'
-..
diff --git a/.ref-Research-V7/usr/lib/tmac/tmac.scover b/.ref-Research-V7/usr/lib/tmac/tmac.scover
deleted file mode 100644 (file)
index bc15e02..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-.      \"OK - "other keywords" for cover sheet.
-.de OK
-.br
-.di
-.di OD
-.nf
-.ft 3
-..
-.      \"CS - spew out cover sheet
-.de CS
-.br
-.if \\n(AJ>0 .tm Abstract not finished, AE assumed.
-.if \\n(AJ>0 .AE
-.di
-.if t .po 0.5i
-.ft 2
-.nr IB \\n(.b
-.ft P
-.nr K1 1
-.if t .sp |.4i
-.if t .lg
-.ll 7.0i
-.vs 12p
-.nf
-.if t \h'7n'\s24\(bs\s12\f3  Bell Laboratories        \s16\f1Cover Sheet for Technical Memorandum
-.if n Bell Laboratories        Cover Sheet for Technical Memorandum
-.if t .sp .5v
-.if n .sp
-.if t \s6\l'7i'
-.fi
-.ps 9
-.ft 2
-.if t .sp 2p
-.if \\n(.$<=6 The information contained herein is for the use of employees of Bell Laboratories and is not for publication.  (See GEI 13.9-3)\p
-.if \\n(.$>6 Warning: studying this document may cause drowsiness.  Do not read before driving or operating machinery.  (See GEI 13.9-3)\p
-.ft 1
-.nf
-.if \\n(IB>0 .bd 2 \\n(IB
-.if t \s6\l'7i'
-.if t .sp .5v
-.if n .sp
-.if t .ll 4.0i
-.if n .ll 30
-.if t .po 1.0i
-.ps 9
-.if t .ta 0.5i 4.5i 4.9i
-.if n .ta 9 39 46
-.mk
-Title- \f3\s10
-.rt
-.if t .in 0.5i
-.if n .in 10
-.hy 0
-.WT
-.hy 14
-.br
-.rt
-.ll \\n(LLu
-.if t .in 4.5i
-.if n .in 40
-.nf
-\s9\f1Date- \s10\f3
-.rt
-.if t .in 4.9i
-.if n .in 47
-\\*(DY
-.sp
-.if t .ti 4.5i
-.if n .ti 40
-.mk
-\s9\f1TM- \f3\s10
-.br
-.rt
-.CZ \\*(MN
-.in 0
-.sp |\\n(.hu+1v
-.mk
-\s9\f1Other Keywords- \f3
-.rt
-.if t .in 1.1i
-.if n .in 20
-.OD
-.in 0
-.if t .sp .7i
-.if n .sp 3
-.ps 9
-.if t .ta 1.8i 3.3i 4.3i
-.if n .ta 19 34 44
-.ft 1
-.mk
-.fi
-.ll 6.7i
-.in 4.6i
-.ti 0
-.nr SJ \\n(.j
-.na
-Author Location        Extension       Charging Case- \s10\f3\\*(CA
-.ps 10
-.ti 4.3i
-\f1\s9Filing Case- \s10\f3\\*(CC
-.nf
-.in 0
-.ad \\n(SJ
-.rt
-.sp 1
-.CB 1
-.if \\n(NA-1 .CB 2
-.if \\n(NA-2 .CB 3
-.if \\n(NA-3 .CB 4
-.if \\n(NA-4 .CB 5
-.if \\n(NA-5 .CB 6
-.if \\n(NA-6 .CB 7
-.if \\n(NA-7 .CB 8
-.if \\n(NA-8 .CB 9
-.ft 1
-.rm OK OD R1 E1 R2 E2 R3 E3 R4 E4 AB AE
-.ds K1 \\$1
-.ds K2 \\$2
-.ds K3 \\$3
-.ds K4 \\$4
-.ds K5 \\$5
-.ds K6 \\$6
-.wh 9.8i CG
-.ch FO 16i
-.if t .sp .4i
-.if n .sp 2
-.ls 1
-.pn 2
-.WB
-.rm WB
-.ls
-.br
-.if 9.7i-\\n(nlu-\\n(FPu-1v>0 .sp 9.7i-\\n(nlu-\\n(FPu-1v
-.if \\n(FP>0 .FA
-.FG
-.nr K1 0
-.if \\n(GA=1 .nr GA 2
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-.bp 1
-.rm CG
-.if t .po \\n(POu
-..
-.      \" CG - write bottom box on cover sheet
-.de CG
-.if t .po 0.5i
-.vs 12p
-.ch FO 12i
-.ch FX 12i
-.if t .ll 7i
-.br
-.if t \l'7i'
-.if t .ta 1.4i 2.8i 4.2i
-.if n .ta 14 29 44
-.if t .sp 8p
-.if n .sp
-Pages Text   \\*(K1    Other   \\*(K2  Total   \\*(K3
-.if t .sp 8p
-.if n .sp 
-.if t .po .5i
-.if t No. Figures   \\*(K4     No. Tables   \\*(K5     No. Refs.   \\*(K6      \b'|||||\ \ '
-.if n No. Figures   \\*(K4     No. Tables   \\*(K5     No. Refs.   \\*(K6
-.br
-.if t .po .5i
-.if t \l'7i'
-.ps 7
-.br
-.if n .sp
-.rm K1
-.rm K2
-.rm K3
-.rm K4
-.rm K5
-.rm K6
-.if t .po .5i
-.if t .tl 'E-1932-U (6-73)'SEE REVERSE SIDE FOR DISTRIBUTION LIST''
-.if n .tl 'E-1932-U (6-73)  SEE REVERSE SIDE FOR DISTRIBUTION LIST'''
-.if t .po 0.5i
-.ll \\n(LLu
-.ps 10
-.ch CG 12i
-.if \\n(K1>0 .bp
-..
-.      \"CB - help with cover sheet
-.de CB
-.br
-.mk
-.A\\$1
-.rt
-\&     \\*(R\\$1       \\*(E\\$1
-.br
-..
-.de CZ
-.br
-.if !"\\$1"" \\$1
-.br
-.if !"\\$2"" \\$2
-.br
-.if !"\\$3"" \\$3
-.br
-.if !"\\$4"" \\$4
-.br
-.if !"\\$5"" \\$5
-.br
-.if !"\\$6"" \\$6
-.br
-.if !"\\$7"" \\$7
-.br
-.if !"\\$8"" \\$8
-.br
-.if !"\\$9"" \\$9
-..
-.      \"S1 - tm style 
-.de S1
-.br
-.if t .ta 4.75i
-.if n .ta 46
-.ll 80
-.ps 36
-.br
-.if t .vs .35i
-.if t \t\(bs
-.br
-.if n .sp 24p
-.ps 12
-.br
-.ft 3
-\tBell Laboratories
-.ft 1
-.nr SJ \\n(.j
-.na
-.br
-.ps 8
-.vs 12p
-.sp 2v
-.mk
-.ll
-.ll 4.0i
-Subject:
-.ft 3
-.br
-.rt
-.if n .in +9
-.if t .in +\w'Subject: 'u
-.ps
-.nf
-.hy 0
-.WT
-.hy 14
-.ft 1
-.fi
-.in 0
-.if \\n(MC>0 \\s8Case- \\*(CA\\s10
-.if \\n(MG>0 --\s8 File- \\*(CC\\s10
-.br
-.rt
-.if n .ll 70
-.if t .ll 6.5i
-.if t .in 5.10i
-.if n .in 52
-.ps 8
-.ti -6n
-.ta 6n
-date:\t\\s\\n(PS\\f3\\*(DY
-.sp
-.ft 1
-.ps 8
-.mk
-.ti -6n
-from:
-.ps
-.br
-.rt
-.nf
-.ft 3
-.A1
-.if \\n(NA>1 .A2
-.if \\n(NA>2 .A3
-.if \\n(NA>3 .A4
-.if \\n(NA>4 .A5
-.if \\n(NA>5 .A6
-.if \\n(NA>6 .A7
-.if \\n(NA>7 .A8
-.if \\n(NA>8 .A9
-.ft 1
-.sp
-.mk
-.ps 8
-.ti -6n
-.ft 1
-.if \\n(IM=0 .if \\n(MM .if "\\*(MQ"" \{\
-.if \\n(MN=0 .ds MQ TM:
-.if \\n(MN=1 .ds MQ MF:
-.if \\n(MN=2 .ds MQ MR:
-.if \\n(MN=3 .ds MQ EN:\}
-\\*(MQ
-.br
-.ti \\n(.iu
-.rt
-.ps
-.ft 3
-.hy 0
-.ll 20i
-.if t .ll 7.75i-\\n(.ou
-.fi
-.na
-.if \\n(MM .CZ \\*(MN
-.hy 14
-.nf
-.ft 1
-.ll \\n(LLu
-.in
-.sp |\\n(.hu
-.if \\n(IM=0 .sp
-.ad \\n(SJ
-.ce
-.ft 2
-.if \\n(IM=0 \\*(QF
-.ft 1
-.ce 0
-.if \\n(IM=0 .sp
-.fi
-..
diff --git a/.ref-Research-V7/usr/lib/tmac/tmac.sdisp b/.ref-Research-V7/usr/lib/tmac/tmac.sdisp
deleted file mode 100644 (file)
index 644f872..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-.      \"DS - display.  If .DS C, center; L, left-adjust; I, indent.
-.de DS
-.KS
-.nf
-.\\$1D \\$2 \\$1
-.ft 1
-.ps \\n(PS
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-..
-.de D
-.ID \\$1
-..
-.de CD
-.XD
-.ce 1000
-..
-.de ID
-.XD
-.if t .in +0.5i
-.if n .in +8
-.if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in \\n(OIu
-.if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in +\\$1n
-..
-.de LD
-.XD
-..
-.de XD
-.nf
-.nr OI \\n(.i
-.if t .sp 0.5
-.if n .sp 1
-..
-.de BD \" block display: save everything, then center it.
-.XD
-.nr BD 1
-.nf
-.in \\n(OIu
-.di DD
-..
-.      \"DE - display end
-.de DE
-.ce 0
-.if \\n(BD>0 .DF
-.nr BD 0
-.in \\n(OIu
-.KE
-.if t .sp 0.5
-.if n .sp 1
-.fi
-..
-.de DF \" finish a block display to be recentered.
-.di
-.if \\n(dl>\\n(BD .nr BD \\n(dl
-.if \\n(BD<\\n(.l .in (\\n(.lu-\\n(BDu)/2u
-.nr EI \\n(.l-\\n(.i
-.ta \\n(EIuR
-.DD
-.in \\n(OIu
-..
diff --git a/.ref-Research-V7/usr/lib/tmac/tmac.skeep b/.ref-Research-V7/usr/lib/tmac/tmac.skeep
deleted file mode 100644 (file)
index 9e7a373..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-.      \"KS keep - for keep release features. As in IFM
-.de ]K
-.nr KN \\n(.u
-.if \\n(IK=0 .if \\n(IF=0 .KQ
-.nr IK +1
-..
-.      \"KQ - real keep processor
-.de KQ
-.br
-.nr KI \\n(.i
-.ev 2
-.br
-.in \\n(KIu
-.ps \\n(PS
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-.ll \\n(LLu
-.lt \\n(LTu
-.if \\n(NX>1 .ll \\n(CWu
-.if \\n(NX>1 .lt \\n(CWu
-.di KK
-.nr TB 0
-..
-.      \"KF - floating keep
-.de ]J
-.nr KN \\n(.u
-.if !\\n(IK .FQ
-.nr IK +1
-..
-.      \"FQ real floating keep processor
-.de FQ
-.nr KI \\n(.i
-.ev 2
-.br
-.in \\n(KIu
-.ps \\n(PS
-.if \\n(VS>40 .vs \\n(VSu
-.if \\n(VS<=39 .vs \\n(VSp
-.ll \\n(LLu
-.lt \\n(LTu
-.if \\n(NX>1 .ll \\n(CWu
-.if \\n(NX>1 .lt \\n(CWu
-.di KK
-.nr TB 1
-..
-.      \"KE release - everything between keep and release is together
-.de KE
-.if \\n(IK .if !\\n(IK-1 .if \\n(IF=0 .RQ
-.if \\n(IK .nr IK -1
-..
-.      \"RQ real release
-.de RQ
-.br
-.di
-.nr NF 0
-.if \\n(dn-\\n(.t .nr NF 1
-.if \\n(TC .nr NF 1
-.if \\n(NF .if !\\n(TB .sp 200
-.if !\\n(NF .if \\n(TB .nr TB 0
-.nf
-.rs
-.nr TC 5
-.in 0
-.ls 1
-.if \\n(TB=0 .ev
-.if \\n(TB=0 .br
-.if \\n(TB=0 .ev 2
-.if \\n(TB=0 .KK
-.ls
-.ce 0
-.if \\n(TB=0 .rm KK
-.if \\n(TB .da KJ
-.if \\n(TB \!.KD \\n(dn
-.if \\n(TB .KK
-.if \\n(TB .di
-.nr TC \\n(TB
-.if \\n(KN .fi
-.in
-.ev
-..
diff --git a/.ref-Research-V7/usr/lib/tmac/tmac.srefs b/.ref-Research-V7/usr/lib/tmac/tmac.srefs
deleted file mode 100644 (file)
index 2357590..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-.\" REFER macros .... citations
-.de []
-.][ \\$1
-..
-.de ][
-.if \\$1>5 .tm Bad arg to []
-.[\\$1
-..
-.if n .ds [. [
-.if t .ds [. \s-2\v'-.4m'\f1
-.if n .ds .] ]
-.if t .ds .] \v'.4m'\s+2\fP
-.if n .ds [o ""
-.if n .ds [c ""
-.if t .ds [o ``
-.if t .ds [c ''
-.\" the next lines deal with the problem of .[1] or [1].
-.\" refer will write "linexxx\*(<.[1]\*(>.
-.\" and either "<." or ">." should produce the .;
-.\" similarly for ,
-.if n .ds >. .
-.if t .ds <. .
-.if n .ds >, ,
-.if t .ds <, ,
-.de [5 \" tm style
-.FS
-.IP "\\*([F.\0"
-\\*([A, \\f2\\*([T\\f1,
-.ie \\n(TN \\*([M.
-.el Bell Laboratories internal memorandum (\\*([D).
-.RT
-.FE
-..
-.de [0 \" other
-.FS
-.nr [: 0
-.if !"\\*([F"" .IP "\\*([F.\0"
-.if !"\\*([A"" \{.nr [: 1
-\\*([A\c\}
-.if !"\\*([T"" \{.if \\n([:>0 ,
-.nr [: 1
-\\f2\\*([T\\f1\c\}
-.if !"\\*([O""\{.if \\n([:>0 ,
-.nr [: 1
-.if \\n([O>0 .nr [: 0
-\\*([O\c
-.if \\n([O>0 \& \c\}
-.ie !"\\*([D"" \{.if \\n([:>0 ,
-.nr [: 1
-\\*([D\c\}
-.if \\n([:>0 \&.
-.RT
-.FE
-..
-.de [1 \" journal article
-.FS
-.if !"\\*([F"" .IP "\\*([F.\0"
-.if !"\\*([A"" \\*([A,
-.if !"\\*([T"" \\*([o\\*([T,\\*([c
-\\f2\\*([J\\f1\c
-.if !"\\*([V"" .if n \& Vol.\&\c
-.if !"\\*([V"" \& \\f3\\*([V\\f1\c
-.if !"\\*([N"" (\\*([N)\c
-.if !"\\*([P"" \{\
-.ie \\n([P>0 , pp.\c
-.el , p.\c
-\\*([P\c\}
-.if !"\\*([I"" .if "\\*([R"" , \\*([I\c
-.if !"\\*([O"" .if \\n([O=0 , \\*([O\c
-.if !"\\*([D"" \& (\\*([D)\c
-\&.
-.if !"\\*([O"" .if \\n([O>0  \\*([O
-.RT
-.FE
-..
-.de [2 \" book
-.FS
-.if !"\\*([F"" .IP "\\*([F.\0"
-.if !"\\*([A"" \\*([A,
-.if !"\\*([T"" \\f2\\*([T,\\f1
-\\*([I\c
-.if !"\\*([C"" , \\*([C\c
-.if !"\\*([D"" \& (\\*([D)\c
-\&.
-.if !"\\*([G"" Gov't. ordering no. \\*([G.
-.if !"\\*([O"" \\*([O
-.RT
-.FE
-..
-.de [4 \" report
-.FS
-.if !"\\*([F"" .IP "\\*([F.\0"
-\\*([A, \\*([o\\*([T,\\*([c
-\\*([R\c
-.if !"\\*([G"" \& (\\*([G)\c
-.if !"\\*([I"" ,  \\*([I\c
-.if !"\\*([C"" ,  \\*([C\c
-.if !"\\*[D"" \& (\\*[D)\c
-\&.
-.if !"\\*([O"" \\*([O
-.RT
-.FE
-..
-.de [3 \" article in book
-.FS
-.if !"\\*([F"" .IP "\\*([F.\0"
-.if !"\\*([A"" \\*([A,
-.if !"\\*([T"" \\*([o\\*([T,\\*([c
-.if !"\\*([P"" pp. \\*([P
-in \\f2\\*([B\\f1\c
-.if !"\\*([E"" , ed. \\*([E\c
-.if !"\\*([I"" , \\*([I\c
-.if !"\\*([C"" , \\*([C\c
-.if !"\\*([D"" \& (\\*([D)\c
-\&.
-.if !"\\*([O"" \\*([O
-.RT
-.FE
-..
-.de ]<
-.[<
-..
-.de [<
-.SH
-References
-.LP
-.rm FS FE
-..
-.de [>
-.]>
-..
-.de ]>
-.sp
-..
-.de ]-
-.[-
-..
-.de [-
-.rm [V [P [A [T
-.rm [N [C [B [O
-.rm [R [I [E [D
-..
-.de ]]
-this is never
-executed
-and just
-uses up an end-of-file
-bug.
-..
diff --git a/.ref-Research-V7/usr/lib/units b/.ref-Research-V7/usr/lib/units
deleted file mode 100644 (file)
index b589ed2..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/ dimensions
-m                      *a*
-kg                     *b*
-sec                    *c*
-coul                   *d*
-candela                        *e*
-dollar                 *f*
-radian                 *g*
-bit                    *h*
-erlang                 *i*
-degC                   *j*
-
-/ constants
-
-fuzz                   1
-pi                     3.14159265358979323846
-c                      2.997925+8 m/sec fuzz
-g                      9.80665 m/sec2
-au                     1.49597871+11 m fuzz
-mole                   6.022169+23 fuzz
-e                      1.6021917-19 coul fuzz
-energy                 c2
-force                  g
-mercury                        1.33322+5 kg/m2-sec2
-hg                     mercury
-
-/ dimensionless
-
-degree                 1|180 pi-radian
-circle                 2 pi-radian
-turn                   2 pi-radian
-grade                  .9 degree
-arcdeg                 1 degree
-arcmin                 1|60 arcdeg
-ccs                    1|36 erlang
-arcsec                 1|60 arcmin
-
-steradian              radian2
-sphere                 4 pi-steradian
-sr                     steradian
-
-/ Time
-
-second                 sec
-s                      sec
-minute                 60 sec
-min                    minute
-hour                   60 min
-hr                     hour
-day                    24 hr
-da                     day
-week                   7 day
-year                   365.24219879 day fuzz
-yr                     year
-month                  1|12 year
-ms                     millisec
-us                     microsec
-
-/ Mass
-
-gram                   millikg
-gm                     gram
-mg                     milligram
-metricton              kilokg
-
-/ Avoirdupois
-
-lb                     .45359237 kg
-lbf                    lb g
-pound                  lb
-ounce                  1|16 lb
-oz                     ounce
-dram                   1|16 oz
-dr                     dram
-grain                  1|7000 lb
-gr                     grain
-shortton               2000 lb
-ton                    shortton
-longton                        2240 lb
-
-/ Apothecary
-
-scruple                        20 grain
-apdram                 60 grain
-apounce                        480 grain
-appound                        5760 grain
-
-/ Length
-
-meter                  m
-cm                     centimeter
-mm                     millimeter
-km                     kilometer
-nm                     nanometer
-micron                 micrometer
-angstrom               decinanometer
-
-inch                   2.54 cm
-in                     inch
-foot                   12 in
-feet                   foot
-ft                     foot
-yard                   3 ft
-yd                     yard
-rod                    5.5 yd
-rd                     rod
-mile                   5280 ft
-mi                     mile
-
-british                        1200|3937 m/ft
-nmile                  1852m
-
-acre                   4840 yd2
-
-cc                     cm3
-liter                  kilocc
-ml                     milliliter
-
-/ US Liquid
-
-gallon                 231 in3
-imperial               1.20095
-gal                    gallon
-quart                  1|4 gal
-qt                     quart
-pint                   1|2 qt
-pt                     pint
-
-floz                   1|16 pt
-fldr                   1|8 floz
-
-/ US Dry
-
-dry                    268.8025 in3/gallon fuzz
-peck                   8 dry-quart
-pk                     peck
-bushel                 4 peck
-bu                     bushel
-
-/ British
-
-brgallon               277.420 in3 fuzz
-brquart                        1|4 brgallon
-brpint                 1|2 brquart
-brfloz                 1|20 brpint
-brpeck                 554.84 in3 fuzz
-brbushel               4 brpeck
-
-/ Energy Work
-
-newton                 kg-m/sec2
-nt                     newton
-joule                  nt-m
-cal                    4.1868 joule
-
-/ Electrical
-
-coulomb                        coul
-ampere                 coul/sec
-amp                    ampere
-watt                   joule/sec
-volt                   watt/amp
-ohm                    volt/amp
-mho                    /ohm
-farad                  coul/volt
-henry                  sec2/farad
-weber                  volt-sec
-
-/ Light
-
-cd                     candela
-lumen                  cd sr
-lux                    cd sr/m2
-
-/ Money
-/ epoch Nov 10, 1978 wall st j
-
-$                      dollar
-argentinapeso          .0011 $
-australiadollar                1.1560 $
-austriaschilling       .0726 $
-belgiumfranc           .0333 $
-brazilcruzeiro         .0512 $
-britainpound           1.9705 $
-brpound                        britainpound
-canadadollar           .8525 $
-colombiapeso           .0279 $
-denmarkkrone           .1927 $
-equadorsucre           .0404 $
-finlandmarkka          .2524 $
-francefranc            .2336 $
-greecedrachma          .0284 $
-hongkongdollar         .2096 $
-indiarupee             .1275 $
-indonesiarupiah                .00245 $
-iranrial               .0144 $
-iraqdinar              3.44 $
-israelpound            .0540 $
-italylira              .001198 $
-japanyen               .005332 $
-lebanonpound           .3340 $
-malaysiadollar         .4595 $
-mexicopeso             .04394 $
-netherlandsguilder     .4924 $
-newzealanddollar       1.0660 $
-norwaykrone            .1996 $
-pakistanrupee          .1020 $
-perusol                        .0067 $
-phillippinespeso       .1365 $
-portugalescudo         .0218 $
-saudiarabiariyal       .3029 $
-singaporedollar                .4615 $
-southafricarand                1.1522 $
-southkoreawon          .0021 $
-spainpeseta            .01415 $
-swedenkrona            .2305 $
-switzerlandfranc       .6171 $
-thailandbhat           .050 $
-uruguaypeso            .1546 $
-usdollar               $
-venezuelabolivar       .2331 $
-germanymark            .5306 $
-
-mark                   germanymark
-bolivar                        venezuelabolivar
-peseta                 spainpeseta
-rand                   southafricarand
-escudo                 portugalescudo
-sol                    perusol
-guilder                        netherlandsguilder
-peso                   mexicopeso
-yen                    japanyen
-lira                   italylira
-dinar                  iraqdinar
-rial                   iranrial
-rupee                  indiarupee
-drachma                        greecedrachma
-franc                  francefranc
-markka                 finlandmarkka
-sucre                  equadorsucre
-poundsterling          britainpound
-cruzeiro               brazilcruzeiro
-
-/ PDP-11
-
-baud                   bit/sec
-byte                   8 bit
-word                   2 byte
-block                  512 byte
-K                      1024 word
-tc                     578 block
-rktrack                        12 block
-rkcylinder             2 rktrack
-rk                     203 rkcylinder
-rptrack                        10 block
-rpcylinder             20 rptracks
-rp                     406 rpcylinder
-rftrack                        8 block
-rfshoe                 8 rftrack
-rfdisk                 16 rfshoe
-rf                     2 rfdisk
-
-/ Trivia
-
-%                      1|100
-admiraltyknot          6080 ft/hr
-apostilb               cd/pi-m2
-are                    1+2 m2
-arpentcan              27.52 mi
-arpentlin              191.835 ft
-astronomicalunit       au
-atmosphere             1.01325+5 nt/m2
-atm                    atmosphere
-atomicmassunit         1.66044-27 kg fuzz
-amu                    atomicmassunit
-bag                    94 lb
-bakersdozen            13
-bar                    1+5 nt/m2
-barie                  1-1 nt/m2
-barleycorn             1|3 in
-barn                   1-28 m2
-barrel                 42 gal
-barye                  1-1 nt/m2
-bev                    1+9 e-volt
-biot                   10 amp
-blondel                        cd/pi-m2
-boardfoot              144 in3
-bolt                   40 yd
-bottommeasure          1|40 in
-britishthermalunit     1.05506+3 joule fuzz
-btu                    britishthermalunit
-refrigeration          12000 btu/ton-hour
-buck                   dollar
-cable                  720 ft
-caliber                        1-2 in
-calorie                        cal
-carat                  205 mg
-cent                   centidollar
-cental                 100 lb
-centesimalminute       1-2 grade
-centesimalsecond       1-4 grade
-century                        100 year
-cfs                    ft3/sec
-chain                  66 ft
-circularinch           1|4 pi-in2
-circularmil            1-6|4 pi-in2
-clusec                 1-8 mm-hg m3/s
-coomb                  4 bu
-cord                   128 ft3
-cordfoot               cord
-crith                  9.06-2 gm
-cubit                  18 in
-cup                    1|2 pt
-curie                  3.7+10 /sec
-dalton                 amu
-decade                 10 yr
-dipotre                        /m
-displacementton                35 ft3
-doppelzentner          100 kg
-dozen                  12
-drop                   .03 cm3
-dyne                   cm-gm/sec2
-electronvolt           e-volt
-ell                    45 in
-engineerschain         100 ft
-engineerslink          100|100 ft
-equivalentfootcandle   lumen/pi-ft2
-equivalentlux  lumen/pi-m2
-equivalentphot         cd/pi-cm2
-erg                    cm2-gm/sec2
-ev                     e-volt
-faraday                        9.652+4 coul
-fathom                 6 ft
-fermi                  1-15 m
-fifth                  4|5 qt
-fin                    5 dollar
-finger                 7|8 in
-firkin                 9 gal
-footcandle             lumen/ft2
-footlambert            cd/pi-ft2
-fortnight              14 da
-franklin               3.33564-10 coul
-frigorie               kilocal
-furlong                        220 yd
-galileo                        1-2 m/sec2
-gamma                  1-9 weber/m2
-gauss                  1-4 weber/m2
-geodeticfoot           british-ft
-geographicalmile       1852 m
-gilbert                        7.95775-1 amp
-gill                   1|4 pt
-gross                  144
-gunterschain           22 yd
-hand                   4 in
-hectare                        1+4 m2
-hefnercandle           .92 cd
-hertz                  /sec
-hogshead               2 barrel
-hd                     hogshead
-homestead              1|4 mi2
-horsepower             550 ft-lb-g/sec
-hp                     horsepower
-hyl                    gm force sec2/m
-hz                     /sec
-imaginarycubicfoot     1.4 ft3
-jeroboam               4|5 gal
-karat                  1|24
-kcal                   kilocal
-kcalorie               kilocal
-kev                    1+3 e-volt
-key                    kg
-khz                    1+3 /sec
-kilderkin              18 gal
-knot                   nmile/hr
-lambert                        cd/pi-cm2
-langley                        cal/cm2
-last                   80 bu
-league                 3 mi
-lightyear              c-yr
-line                   1|12 in
-link                   66|100 ft
-longhundredweight      112 lb
-longquarter            28 lb
-lusec                  1-6 mm-hg m3/s
-mach                   331.46 m/sec
-magnum                 2 qt
-marineleague           3 nmile
-maxwell                        1-8 weber
-metriccarat            200 mg
-mev                    1+6 e-volt
-mgd                    megagal/day
-mh                     millihenry
-mhz                    1+6 /sec
-mil                    1-2 in
-millenium              1000 year
-minersinch             1.5 ft3/min
-minim                  1|60 fldr
-mo                     month
-mpg                    mile/gal
-mph                    mile/hr
-nail                   1|16 yd
-nauticalmile           nmile
-nit                    cd/m2
-noggin                 1|8 qt
-nox                    1-3 lux
-ns                     nanosec
-oersted                        2.5+2 pi-amp/m
-oe                     oersted
-pace                   36 in
-palm                   3 in
-parasang               3.5 mi
-parsec                 au-radian/arcsec
-pascal                 nt/m2
-pc                     parsec
-pennyweight            1|20 oz
-percent                        %
-perch                  rd
-pf                     picofarad
-phot                   lumen/cm2
-pica                   1|6 in
-pieze                  1+3 nt/m2
-pipe                   4 barrel
-point                  1|72 in
-poise                  gm/cm-sec
-pole                   rd
-poundal                        ft-lb/sec2
-pdl                    poundal
-proof                  1|200
-psi                    lb-g/in2
-quarter                        9 in
-quartersection         1|4 mi2
-quintal                        100 kg
-quire                  25
-rad                    100 erg/gm
-ream                   500
-registerton            100 ft3
-rehoboam               156 floz
-rhe                    10 m2/nt-sec
-rontgen                        2.58-4 curie/kg
-rood                   1.21+3 yd
-rope                   20 ft
-rutherford             1+6 /sec
-rydberg                        1.36054+1 ev
-sabin                  1 ft2
-sack                   3 bu
-seam                   8 bu
-section                        mi2
-shippington            40 ft3
-shorthundredweight     100 lb
-shortquarter           25 lb
-siemens                        /ohm
-sigma                  microsec
-skein                  120 yd
-skot                   1-3 apostilb
-slug                   lb-g-sec2/ft
-span                   9 in
-spat                   4 pi sr
-spindle                        14400 yd
-square                 100 ft2
-stere                  m3
-sthene                 1+3 nt
-stilb                  cd/cm2
-stoke                  1-4 m2/sec
-stone                  14 lb
-strike                 2 bu
-surveyfoot             british-ft
-surveyorschain         66 ft
-surveyorslink          66|100 ft
-tablespoon             4 fldr
-teaspoon               4|3 fldr
-tesla                  weber/m2
-therm                  1+5 btu
-thermie                        1+6 cal
-timberfoot             ft3
-tnt                    4.6+6 m2/sec2
-tonne                  1+6 gm
-torr                   mm hg
-township               36 mi2
-tun                    8 barrel
-water                  .22491|2.54 kg/m2-sec2
-wey                    40 bu
-weymass                        252 lb
-Xunit                  1.00202-13m
-k                      1.38047-16 erg/degC
diff --git a/.ref-Research-V7/usr/lib/uucp/L-devices b/.ref-Research-V7/usr/lib/uucp/L-devices
deleted file mode 100644 (file)
index 455e9b6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tty0 dn1 300 
diff --git a/.ref-Research-V7/usr/lib/uucp/L-dialcodes b/.ref-Research-V7/usr/lib/uucp/L-dialcodes
deleted file mode 100644 (file)
index 1f45f5e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-inwats 800
diff --git a/.ref-Research-V7/usr/lib/uucp/L.sys b/.ref-Research-V7/usr/lib/uucp/L.sys
deleted file mode 100644 (file)
index e8975cc..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-Format of these lines is:       sysname time to call : device needed : speed
-res70 Any ACU 300 mh0000        login nuucp assword: fatchance
diff --git a/.ref-Research-V7/usr/lib/uucp/USERFILE b/.ref-Research-V7/usr/lib/uucp/USERFILE
deleted file mode 100644 (file)
index a495a5c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-, /
diff --git a/.ref-Research-V7/usr/lib/yaccpar b/.ref-Research-V7/usr/lib/yaccpar
deleted file mode 100644 (file)
index 25e5c7a..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#
-# define YYFLAG -1000
-# define YYERROR goto yyerrlab
-# define YYACCEPT return(0)
-# define YYABORT return(1)
-
-/*     parser for yacc output  */
-
-int yydebug = 0; /* 1 for debugging */
-YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
-int yychar = -1; /* current input token number */
-int yynerrs = 0;  /* number of errors */
-short yyerrflag = 0;  /* error recovery flag */
-
-yyparse() {
-
-       short yys[YYMAXDEPTH];
-       short yyj, yym;
-       register YYSTYPE *yypvt;
-       register short yystate, *yyps, yyn;
-       register YYSTYPE *yypv;
-       register short *yyxi;
-
-       yystate = 0;
-       yychar = -1;
-       yynerrs = 0;
-       yyerrflag = 0;
-       yyps= &yys[-1];
-       yypv= &yyv[-1];
-
- yystack:    /* put a state and value onto the stack */
-
-       if( yydebug  ) printf( "state %d, char 0%o\n", yystate, yychar );
-               if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
-               *yyps = yystate;
-               ++yypv;
-               *yypv = yyval;
-
- yynewstate:
-
-       yyn = yypact[yystate];
-
-       if( yyn<= YYFLAG ) goto yydefault; /* simple state */
-
-       if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
-       if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
-
-       if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
-               yychar = -1;
-               yyval = yylval;
-               yystate = yyn;
-               if( yyerrflag > 0 ) --yyerrflag;
-               goto yystack;
-               }
-
- yydefault:
-       /* default state action */
-
-       if( (yyn=yydef[yystate]) == -2 ) {
-               if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
-               /* look through exception table */
-
-               for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
-
-               while( *(yyxi+=2) >= 0 ){
-                       if( *yyxi == yychar ) break;
-                       }
-               if( (yyn = yyxi[1]) < 0 ) return(0);   /* accept */
-               }
-
-       if( yyn == 0 ){ /* error */
-               /* error ... attempt to resume parsing */
-
-               switch( yyerrflag ){
-
-               case 0:   /* brand new error */
-
-                       yyerror( "syntax error" );
-               yyerrlab:
-                       ++yynerrs;
-
-               case 1:
-               case 2: /* incompletely recovered error ... try again */
-
-                       yyerrflag = 3;
-
-                       /* find a state where "error" is a legal shift action */
-
-                       while ( yyps >= yys ) {
-                          yyn = yypact[*yyps] + YYERRCODE;
-                          if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
-                             yystate = yyact[yyn];  /* simulate a shift of "error" */
-                             goto yystack;
-                             }
-                          yyn = yypact[*yyps];
-
-                          /* the current yyps has no shift onn "error", pop stack */
-
-                          if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
-                          --yyps;
-                          --yypv;
-                          }
-
-                       /* there is no state on the stack with an error shift ... abort */
-
-       yyabort:
-                       return(1);
-
-
-               case 3:  /* no shift yet; clobber input char */
-
-                       if( yydebug ) printf( "error recovery discards char %d\n", yychar );
-
-                       if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
-                       yychar = -1;
-                       goto yynewstate;   /* try again in the same state */
-
-                       }
-
-               }
-
-       /* reduction by production yyn */
-
-               if( yydebug ) printf("reduce %d\n",yyn);
-               yyps -= yyr2[yyn];
-               yypvt = yypv;
-               yypv -= yyr2[yyn];
-               yyval = yypv[1];
-               yym=yyn;
-                       /* consult goto table to find next state */
-               yyn = yyr1[yyn];
-               yyj = yypgo[yyn] + *yyps + 1;
-               if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
-               switch(yym){
-                       $A
-               }
-               goto yystack;  /* stack new state and value */
-
-       }
diff --git a/.ref-Research-V7/usr/man/man0/intro b/.ref-Research-V7/usr/man/man0/intro
deleted file mode 100644 (file)
index e0b286e..0000000
+++ /dev/null
@@ -1,885 +0,0 @@
-.de IR
-\fI\\$1\^\fR\\$2
-..
-.de RI
-\fR\\$1\fI\\$2\^\fR\\$3
-..
-.TL
-INTRODUCTION TO VOLUME 1
-.af PN i
-.pn 3
-.LP
-This volume gives descriptions of the publicly available
-features of the
-.UX
-system.
-It does not attempt to provide perspective or tutorial
-information upon the
-.UX
-operating system,
-its facilities, or its implementation.
-Various documents on those topics are contained in
-Volume 2.
-In particular,
-for an overview see `The
-.UX
-Time-Sharing System'
-by Ritchie and Thompson; for a tutorial see
-`\s8UNIX\s10 for Beginners' by Kernighan.
-.LP
-Within the area it surveys, this volume attempts
-to be timely, complete and concise.
-Where the latter two objectives conflict,
-the obvious is often left unsaid in favor of brevity.
-It is intended that each program be described
-as it is, not as it should be.
-Inevitably, this means that
-various sections will soon be out of date.
-.LP
-The volume is divided into
-eight sections:
-.DS
-1.     Commands
-2.     System calls
-3.     Subroutines
-4.     Special files
-5.     File formats and conventions
-6.     Games
-7.     Macro packages and language conventions
-8.     Maintenance
-.DE
-Commands are programs intended to be invoked directly by
-the user, in contradistinction to subroutines, which are
-intended to be called by the user's programs.
-Commands generally reside in directory
-.I /bin
-(for
-.IR bin \|ary
-programs).
-Some programs also reside in
-.I
-/\|usr/\|bin,
-.R
-to save space in
-.I  /bin.
-These directories are searched automatically by the command interpreter.
-.LP
-System calls are entries into the
-.UX
-supervisor.
-Every system call has one or more C language interfaces
-described in section 2.
-The underlying assembly language interface, coded with opcode
-.I sys,
-a synonym for
-.I trap,
-is given as well.
-.LP
-An assortment
-of subroutines is available;
-they are described in section 3.
-The primary libraries in which they are kept are described in
-.IR intro (3).
-The functions are described in terms of C, but most will
-work with Fortran as well.
-.LP
-The special files section 4 discusses the characteristics of
-each system `file' that actually refers to an I/O device.
-The names in this
-section refer to the DEC device names for the
-hardware,
-instead of the names of
-the special files themselves.
-.LP
-The file formats and conventions section 5 documents the structure of particular
-kinds of files; for example, the form of the output of the loader and
-assembler is given.  Excluded are files used by only one command,
-for example the assembler's intermediate files.
-.LP
-Games have been relegated to section 6 to keep them from contaminating
-the more staid information of section 1.
-.LP
-Section 7 is a miscellaneous collection of information necessary to
-writing in various specialized languages:
-character codes, 
-macro packages for typesetting,
-etc.
-.LP
-The maintenance 
-section 8 discusses procedures not intended
-for use by the ordinary user.
-These procedures often involve use of commands
-of section 1, where an attempt has been made to
-single out peculiarly maintenance-flavored commands
-by marking them 1M.
-.LP
-Each section consists of a number of independent
-entries of a page or so each.
-The name of the entry is in the upper corners of its pages,
-together with the section number, and sometimes a
-letter characteristic of a subcategory, e.g. graphics is 1G,
-and the math library is 3M.
-Entries within each section are
-alphabetized.
-The page numbers of each entry start at 1;
-it is infeasible to number consecutively the pages of 
-a document like this that is republished in many variant forms.
-.LP
-All entries are based on a common format,
-not all of whose subsections will always appear.
-.RS
-.LP
-The
-.I name
-subsection lists the exact names of the commands and subroutines
-covered under the entry and gives
-a very short description of their purpose.
-.LP
-The
-.IR synopsis ""
-summarizes the use of the
-program being described.
-A few conventions are used, particularly in the
-Commands subsection:
-.LP
-.RS
-.B Boldface
-words are considered literals, and
-are typed just as they appear.
-.LP
-Square brackets [ ] around an argument
-indicate that the argument is optional.
-When an argument is given as `name', it always
-refers to a file name.
-.LP
-Ellipses `.\|.\|.' are used to show that the previous argument-prototype
-may be repeated.
-.LP
-A final convention is used by the commands themselves.
-An argument beginning with a minus sign `\-'
-is often taken to mean some sort of option-specifying argument
-even if it appears in a position where a file name
-could appear.  Therefore, it is unwise to have files
-whose names begin with `\-'.
-.LP
-.RE
-The
-.IR description ""
-subsection discusses in detail the subject at hand.
-.LP
-The
-.IR files ""
-subsection gives the names of files which are
-built into the program.
-.LP
-A
-.I
-see also
-.R
-subsection gives pointers to related information.
-.LP
-A
-.I  diagnostics
-subsection discusses
-the diagnostic indications which may be produced.
-Messages which are intended to be self-explanatory
-are not listed.
-.LP
-The
-.IR bugs ""
-subsection gives
-known bugs and sometimes deficiencies.
-Occasionally also the suggested fix is
-described.
-.LP
-In section 2 an
-.I assembler
-subsection carries the assembly language system interface.
-.LP
-.RE
-At the beginning of the volume is a table of contents,
-organized by section and alphabetically within each section.
-There is also a permuted index derived from the table of contents.
-Within each index entry, the title
-of the writeup to which
-it refers is followed by the appropriate section number in parentheses.
-This fact is important because there is considerable
-name duplication among the sections,
-arising principally from commands which
-exist only to exercise a particular system call.
-.SH
-HOW TO GET STARTED
-.LP
-This section sketches the basic information
-you need to get started on \*(UX:
-how to log in and log out,
-how to communicate through your terminal,
-and how to run a program.
-See `\c
-.UX
-for Beginners'
-in Volume 2 for a more complete introduction
-to the system.
-.LP
-.I
-Logging in.\ \ 
-.R
-You must call
-.UX
-from an appropriate terminal.
-.UX
-terminals are typified by the TTY 43,
-the GE Terminet 300, the DASI 300S and 450, and most
-video terminals such as
-the Datamedia 5120 or HP 2640.
-You must also have a valid user name,
-which may be obtained, together with the telephone number, from the system administrators.
-The same telephone number
-serves terminals operating at all the standard speeds.
-After a data connection is established,
-the login procedure depends on what kind of terminal
-you are using.
-.I
-.I
-.R
-.R
-.LP
-.I
-300-baud terminals:\ \ 
-.R
-Such terminals include the GE Terminet 300 and most display terminals
-run with popular modems.
-These terminals generally have a speed
-switch which should be set at `300' (or `30' for
-30 characters per second)
-and a half/full duplex switch which should be set at
-full-duplex.
-(This switch will often have to be changed
-since many other systems require half-duplex).
-When a connection is established, the system
-types `login:'; you type your
-user name, followed by the `return' key.
-If you have a password, the system asks for it
-and turns off the printer on the terminal
-so the password will not appear.
-After you have logged in,
-the `return', `new line', or `linefeed' keys
-will give exactly the same results.
-.LP
-.I
-1200- and 150-baud terminals:\ \ 
-.R
-If there is a half/full duplex switch, set it at full-duplex.
-When you have established a data connection,
-the system types out a few garbage characters
-(the `login:' message at the wrong speed).
-Depress the `break' (or `interrupt')
-key; this is a speed-independent signal
-to
-.UX
-that a different speed terminal
-is in use.
-The system then will type `login:,' this time at another
-speed.
-Continue depressing the break key
-until `login:' appears in clear, then
-respond with your user name.
-From the TTY 37 terminal, and any other which has the `newline'
-function (combined carriage return and linefeed), terminate each line you type with the
-`new line' key,
-otherwise use the `return' key.
-.LP
-.I
-Hard-wired terminals.\ \ 
-.R
-Hard-wired terminals usually begin at the right
-speed, up to 9600 baud; otherwise the preceding instructions
-apply.
-.LP
-For all these terminals, it is important
-that you type your name in lower-case if possible; if you type
-upper-case letters,
-.UX
-will assume that your terminal cannot generate lower-case
-letters and will translate all subsequent upper-case
-letters to lower case.
-.LP
-The evidence that you have successfully
-logged in is that the Shell program
-will type a `$' to you.
-(The Shell is described below under
-`How to run a program.')
-.LP
-For more information, consult
-.IR stty (1),
-which tells how to adjust terminal behavior,
-.IR getty (8),
-which discusses the login sequence in more
-detail, and
-.IR tty(4),
-which discusses terminal I/O.
-.LP
-.I
-Logging out.\ \ 
-.R
-There are three ways to log out:
-.IP
-You can simply hang up the phone.
-.IP
-You can log out by typing an end-of-file indication
-(EOT character, control-d) to the Shell.
-The Shell will terminate and the `login: ' message
-will appear again.
-.IP
-You can also log in directly as another user
-by giving a
-.IR login (1)
-command.
-.LP
-.I
-How to communicate through your terminal.\ \ 
-.R
-When you type characters, a gnome deep in the system
-gathers your characters and saves them in a secret
-place.
-The
-characters will not be given to a program
-until you type a return (or newline), as described above
-in
-.I
-Logging in.
-.R
-.LP
-.UX
-terminal I/O is full-duplex.
-It has full read-ahead, which means that you can
-type at any time,
-even while a program is
-typing at you.
-Of course, if you type during output, the printed output will
-have the input characters interspersed.
-However, whatever you type will be saved
-up and interpreted in correct sequence.
-There is a limit to the amount of read-ahead,
-but it is generous and not likely to be exceeded unless
-the system is in trouble.
-When the read-ahead limit is exceeded, the system
-throws away all the saved characters.
-.LP
-The character `@' in typed input
-kills all the preceding characters in the line, so
-typing mistakes
-can be repaired on a single line.
-Also, the character `#' erases the last character typed.
-Successive uses of `#' erase characters back to, but
-not beyond, the beginning of the line.
-`@' and `#' can be transmitted to a program
-by preceding them with `\\'.
-(So, to erase `\\', you need two `#'s).
-These conventions can be changed by the
-.IR stty (1)
-command.
-.LP
-The `break' or `interrupt' key causes an
-.I
-interrupt signal,
-.R
-as does the
-The \s8ASCII\s10 `delete' (or `rubout') character,
-which is not passed to programs.
-This signal
-generally causes whatever program
-you are running to terminate.
-It is typically used to stop a long printout that
-you don't want.
-However, programs can arrange either to ignore
-this signal altogether,
-or to be notified when it happens (instead
-of being terminated).
-The editor, for example, catches interrupts and
-stops what it is doing,
-instead of terminating, so that an interrupt can
-be used to halt an editor printout without
-losing the file being edited.
-.LP
-The
-.IR quit ""
-signal is generated
-by typing the \s8ASCII\s10 FS character.
-(FS appears many places on different terminals, most commonly
-as control-\e or control-\^|\^.)
-It not only causes a running program to terminate
-but also generates a file with the core image
-of the terminated process.
-Quit is useful
-for debugging.
-.LP
-Besides adapting to the speed of the terminal,
-.UX
-tries to be intelligent about whether
-you have a terminal with the newline function
-or whether it must be simulated with carriage-return
-and line-feed.
-In the latter case, all input carriage returns
-are turned to newline characters (the standard
-line delimiter)
-and both a carriage return and a line feed
-are echoed to the terminal.
-If you get into the wrong mode, the
-.IR stty (1)
-command will rescue you.
-.LP
-Tab characters are used freely in
-.UX
-source programs.
-If your terminal does not have the tab function,
-you can arrange to have them turned into spaces
-during output, and echoed as spaces
-during input.
-The system assumes
-that tabs are set every eight columns.
-Again, the
-.IR stty (1)
-command will set or reset this mode.
-Also, the command
-.IR tabs (1)
-will set the tab stops automatically on many terminals.
-.LP
-.I
-How to run a program; the Shell.\ \ 
-.R
-When you have successfully logged in, a program
-called the Shell is listening to your terminal.
-The Shell reads typed-in lines, splits them up
-into a command name and arguments, and executes the command.
-A command is simply an executable program.
-The Shell looks first in your current directory
-(see below)
-for a program with the given name,
-and if none is there, then in a system directory.
-There is nothing special about system-provided
-commands except that they are kept in a directory
-where the Shell can find them.
-.LP
-The command name is always the first word on an input line;
-it and its arguments are separated from one another by
-spaces.
-.LP
-When a program terminates, the Shell will ordinarily regain control and type 
-a `$' at you to indicate that it is ready for another command.
-.LP
-The Shell has many other capabilities, which are described in detail in section
-.IR sh (1).
-.LP
-.I
-The current directory.\ \ 
-.R
-.UX
-has a file system arranged in a hierarchy of directories.
-When the system administrator gave you a user name,
-he also created a directory for you (ordinarily
-with the same name as your user name).
-When you log in, any file
-name you type is by default
-in this directory.
-Since you are the owner of this directory, you have
-full permission to read, write, alter, or destroy
-its contents.
-Permissions to have your will with other directories
-and files will have been granted or denied to you
-by their owners.
-As a matter of observed fact, few
-.UX
-users
-protect their files from destruction,
-let alone perusal, by other users.
-.LP
-To change the
-current directory (but not the set of permissions you
-were endowed with at login) use
-.IR cd (1).
-.LP
-.I
-Path names.\ \ 
-.R
-To refer to files not in the current directory, you must
-use a path name.
-Full path names begin with `/', the name of the root directory of the
-whole file system.
-After the slash comes the name of each directory containing the next
-sub-directory (followed by a `/') until finally the
-file name is reached.
-For example,
-.I
-/\^usr/\^lem/\^filex
-.R
-refers to the file
-.I
-filex
-.R
-in the directory
-.I
-lem; lem
-.R
-is itself a subdirectory of
-.I
-usr; usr
-.R
-springs directly from the root directory.
-.LP
-If your current directory has subdirectories,
-the path names of files therein begin with
-the name of the subdirectory with no prefixed `/'.
-.LP
-A path name may be used anywhere a file name is
-required.
-.LP
-Important commands which modify the contents of files
-are
-.IR cp (1),
-.IR mv (1),
-and
-.IR rm (1),
-which respectively copy, move (i.e. rename) and remove files.
-To find out the status of files or directories, use 
-.IR ls (1).
-See
-.IR mkdir (1)
-for making directories and
-.I
-rmdir
-.R
-(in
-.IR rm (1))
-for destroying them.
-.LP
-For a fuller discussion of the file system, see
-`The
-.UX
-Time-Sharing System,'
-by Ken Thompson and Dennis Ritchie.
-It may also be useful to glance through
-section 2 of this manual, which discusses
-system calls, even if you don't intend
-to deal with the system at that level.
-.LP
-.I
-Writing a program.\ \ 
-.R
-To enter the text of a source program into a
-.UX
-file, use
-the editor
-.IR ed (1).
-The three principal languages in
-.UX
-are
-provided by the C compiler
-.IR cc (1),
-the Fortran compiler
-.IR f77 (1),
-and the assembler
-.IR as (1).
-After the program text has been entered through 
-the editor
-and written on a file, you can give the file
-to the appropriate language processor as an argument.
-The output of the language processor
-will be left on a file in the current directory named `a.out'.
-(If the output is precious, use
-.I mv
-to move it to a less
-exposed name soon.)\ 
-If you wrote in assembly language, you will probably
-need to load the program with library subroutines; see
-.IR ld (1).
-The other two language processors call
-the loader automatically.
-.LP
-When you have finally gone through this entire process
-without provoking any diagnostics, the resulting program
-can be run by giving its name to the Shell
-in response to the `$' prompt.
-.LP
-Your programs can receive arguments from the command line
-just as system programs do,
-see
-.IR exec (2).
-.LP
-.I
-Text processing.\ \ 
-.R
-Almost all text is entered through the editor
-.IR ed (1).
-The commands most often used to write text on a terminal are:
-.I
-cat, pr, roff
-.R
-and
-.I nroff,
-all in section 1.
-.LP
-The
-.I cat
-command simply dumps \s8ASCII\s10 text
-on the terminal, with no processing at all.
-The
-.IR pr ""
-command paginates the text, supplies headings,
-and has a facility for multi-column output.
-.I
-Nroff
-.R
-is an elaborate text formatting program.
-Used naked, it requires careful forethought, but for
-ordinary documents it has been tamed;
-see
-.IR ms (7).
-.I Roff
-is a simpler text formatting
-program, and requires somewhat less forethought.
-.I
-.LP
-.I Troff
-prepares documents for a
-Graphics Systems phototypesetter;
-it is very similar to 
-.I nroff,
-and often works from exactly the same
-source text.
-It was used to produce this manual.
-.LP
-.I
-Status inquiries.\ \ 
-.R
-Various commands exist to provide you with useful
-information.
-.IR Who (1)
-prints a list of users presently logged in.
-.IR Date (1)
-prints the current time and date.
-.IR Ls (1)
-will list the files in your directory or give
-summary information about particular files.
-.LP
-.I
-Surprises.\ \ 
-.R
-Certain commands provide inter-user communication.
-Even if you do not plan to use them, it would be
-well to learn something about them, because someone else may
-aim them at you.
-.LP
-To communicate with another user currently logged in,
-.IR write (1)
-is used;
-.IR mail (1)
-will leave a message whose presence will be announced
-to another user when he next logs in.
-The write-ups in the manual also suggest how to respond to
-the two commands if you are a target.
-.LP
-When you log in, a message-of-the-day may greet you
-before the first `$'.
-.SH
-CONVERTING FROM THE 6TH EDITION
-.LP
-There follows a catalogue of significant, mostly incompatible,
-changes that will affect old users converting to the 7th edition.
-No attempt is made to list all new facilities, or even all
-minor, but easily spotted changes,
-just the bare essentials without which it will be
-almost impossible to do anything.
-.LP
-.I
-Addressing files.\ \ 
-.R
-Byte addresses in files are now long (32-bit) integers.
-Accordingly
-.I seek
-has been replaced by
-.IR lseek (2).
-Every program that contains a 
-.I seek
-must be modified.
-.I Stat
-and
-.IR fstat (2)
-have been affected similarly, since file lengths are now
-32- rather than 24-bit quantities.
-.LP
-.I
-Assembly language.\ \ 
-.R
-System entry points are no longer built in symbols.
-Their values must be obtained from
-.I /usr/include/sys.s,
-see
-.IR intro (2).
-All system calls modify r0.
-This means that sequences like
-.DS
-mov    file,r0
-sys    lseek,0,0,2
-sys    write,buf,n
-.DE
-will no longer work.
-(In fact, 
-.I lseek
-now modifies r1 as well, so be doubly cautious.)
-.LP
-The
-.IR sleep (2)
-entry point is gone; see the more general facility,
-.IR alarm,
-plus
-.I pause.
-.LP
-Few library functions have assembly language entry points any more.
-You will have to simulate the C calling sequence.
-.LP
-.I
-Stty and gtty.\ \ 
-.R
-These system calls have been extensively altered,
-see
-.IR ioctl (2)
-and
-.IR tty (4).
-.LP
-.I
-Archive files.\ \ 
-.R
-The format of files produced by
-.IR ar (1)
-has been altered.
-To convert to the new style, use
-.IR arcv (1).
-.LP
-.I 
-C language, lint.\ \ 
-.R
-The official syntax for initialization
-requires an equal sign = before an initializer,
-and brackets { } around compound initial values;
-arrays and structures are now initialized honestly.
-Two-address operators, such as =+ and =-, are now written
-+= and -= to avoid ambiguities, although the old
-style is still accepted.
-You will also certainly want to learn about
-.DS
-long integers
-type definitions
-casts (for type conversion)
-unions (for more honest storage sharing)
-#include <filename> (which searches in standard places)
-.DE
-.LP
-The program
-.IR lint (1)
-checks for obsolete syntax and
-does strong type checking of C programs, singly
-or in groups that are expected to be loaded together.
-It is indispensable for conversion work.
-.LP
-.I Fortran.\ \ 
-The old 
-.I fc
-is replaced by
-.I f77,
-a true compiler for Fortran 77,
-compatible with C.
-There are substantial changes in the language;
-see `A Portable Fortran 77 Compiler' in Volume 2.
-.LP
-.I
-Stream editor.\ \ 
-.R
-The program
-.IR sed (1)
-is adapted to massive, repetitive
-editing jobs of the sort encountered in converting to
-the new system.
-It is well worth learning.
-.LP
-.I
-Standard I/O.\ \ 
-.R
-The old 
-.I
-fopen, getc, putc
-.R
-complex and the old
-.I \-lp
-package are both dead,
-and even
-.I getchar
-has changed.
-All have been replaced by the clean, highly efficient,
-.IR stdio (3)
-package.
-The first things to know are that
-.IR getchar (3)
-returns the integer EOF (\-1), which is not a possible byte value,
-on end of file, that 518-byte buffers are out, and that there
-is a defined FILE data type.
-.LP
-.I Make.\ \ 
-The program
-.IR make (1)
-handles the recompilation and loading of
-software in an orderly way from
-a `makefile' recipe given for each piece of software.
-It remakes only as much as the modification dates of the input files
-show is necessary.
-The makefiles will guide you in building your new system.
-.LP
-.I
-Shell, chdir.\ \ 
-.R
-F. L. Bauer once said Algol 68 is the Everest that
-must be climbed by every computer scientist because
-it is there.
-So it is with the shell for
-.UX
-users.
-Everything beyond simple command invocation from a terminal is
-different.
-Even
-.I chdir
-is now spelled
-.I cd.
-You will want to study
-.IR sh (1)
-long and hard.
-.LP
-.I Debugging.\ \ 
-.IR Adb (1)
-is a far more capable replacement for the debugger
-.I db.
-The first-time user should be especially careful about
-distinguishing / and ? in
-.I adb
-commands, and watching to make sure that the
-.I x
-whose value he asked for is the real
-.I x,
-and not just some absolute location equal to the stack offset
-of some automatic
-.I x.
-You can always use the `true' name,
-.I _x,
-to pin down a C external variable.
-.LP
-.I Dsw.
-This little-known, but indispensable facility has been
-taken over by
-.I
-rm \-ri.
-.LP
-.I
-Boot procedures.\ \ 
-.R
-Needless to say, these are all different.
-See section 8 of this volume, and
-`Setting up \s8UNIX\s10' in Volume 2.
diff --git a/.ref-Research-V7/usr/man/man0/permindex b/.ref-Research-V7/usr/man/man0/permindex
deleted file mode 100644 (file)
index 6afb5c3..0000000
+++ /dev/null
@@ -1,1160 +0,0 @@
-.xx "" "" "abort \- generate IOT fault" "" abort(3)
-.xx "" "" "abs \- integer absolute value" "" abs(3)
-.xx "" "fabs, floor, ceil \-" "absolute value, floor, ceiling functions" "" floor(3)
-.xx "" "" "ac \- login accounting" "" ac(1)
-.xx "" "" "access \- determine accessibility of file" "" access(2)
-.xx "" "phys \- allow a process to" "access physical addresses" "" phys(2)
-.xx "" "access \- determine" "accessibility of file" "" access(2)
-.xx "" "ac \- login" "accounting" "" ac(1)
-.xx "" "sa, accton \- system" "accounting" "" sa(1)
-.xx "" "acct \- execution" "accounting file" "" acct(5)
-.xx "" "acct \- turn" "accounting on or off" "" acct(2)
-.xx "" "sa," "accton \- system accounting" "" sa(1)
-.xx "" "sin, cos, tan, asin," "acos, atan, atan2 \- trigonometric functions" "" sin(3)
-.xx "" "dn \- DN-11" "ACU interface" "" dn(4)
-.xx "" "" "adb \- debugger" "" adb(1)
-.xx "" "phys \- allow a process to access physical" "addresses" "" phys(2)
-.xx "" "basename \- strip filename" "affixes" "" basename(1)
-.xx "" "plot: openpl et" "al. \- graphics interface" "" plot(3)
-.xx "" "" "alarm \- schedule signal after specified time" "" alarm(2)
-.xx "" "brk, sbrk, break \- change core" "allocation" "" brk(2)
-.xx "" "malloc, free, realloc, calloc \- main memory" "allocator" "" malloc(3)
-.xx "" "lex \- generator of lexical" "analysis programs" "" lex(1)
-.xx "" "bcd, ppt \- convert to" "antique media" "" bcd(6)
-.xx "" "" "a.out \- assembler and link editor output" "" a.out(5)
-.xx "" "" "ar \- archive and library maintainer" "" ar(1)
-.xx "" "" "ar \- archive (library) file format" "" ar(5)
-.xx "" "bc \-" "arbitrary-precision arithmetic language" "" bc(1)
-.xx "" "tp \- manipulate tape" "archive" "" tp(1)
-.xx "" "ar \-" "archive and library maintainer" "" ar(1)
-.xx "" "ar \-" "archive (library) file format" "" ar(5)
-.xx "" "tar \- tape" "archiver" "" tar(1)
-.xx "" "arcv \- convert" "archives to new format" "" arcv(1)
-.xx "" "echo \- echo" "arguments" "" echo(1)
-.xx "" "expr \- evaluate" "arguments as an expression" "" expr(1)
-.xx "" "pow, gcd, rpow \- multiple precision integer" "arithmetic" "/msub, mult, mdiv, min, mout," mp(3)
-.xx "" "" "arithmetic \- provide drill in number facts" "" arithmetic(6)
-.xx "" "bc \- arbitrary-precision" "arithmetic language" "" bc(1)
-.xx "" "" "as \- assembler" "" as(1)
-.xx "" "asctime, timezone \- convert date and time to" "ASCII" "ctime, localtime, gmtime," ctime(3)
-.xx "" "" "ascii \- map of ASCII character set" "" ascii(7)
-.xx "" "atof, atoi, atol \- convert" "ASCII to numbers" "" atof(3)
-.xx "ASCII" "ctime, localtime, gmtime," "asctime, timezone \- convert date and time to" "" ctime(3)
-.xx "functions" "sin, cos, tan," "asin, acos, atan, atan2 \- trigonometric" "" sin(3)
-.xx "" "as \-" "assembler" "" as(1)
-.xx "" "a.out \-" "assembler and link editor output" "" a.out(5)
-.xx "" "" "assert \- program verification" "" assert(3)
-.xx "" "setbuf \-" "assign buffering to a stream" "" setbuf(3)
-.xx "" "" "at \- execute commands at a later time" "" at(1)
-.xx "" "sin, cos, tan, asin, acos," "atan, atan2 \- trigonometric functions" "" sin(3)
-.xx "" "" "atof, atoi, atol \- convert ASCII to numbers" "" atof(3)
-.xx "" "wait \-" "await completion of process" "" wait(1)
-.xx "language" "" "awk \- pattern scanning and processing" "" awk(1)
-.xx "" "" "backgammon \- the game" "" backgammon(6)
-.xx "" "" "banner \- make long posters" "" banner(6)
-.xx "" "" "bas \- basic" "" bas(1)
-.xx "" "store, delete, firstkey, nextkey \- data" "base subroutines" "dbminit, fetch," dbm(3)
-.xx "" "" "basename \- strip filename affixes" "" basename(1)
-.xx "" "bas \-" "basic" "" bas(1)
-.xx "" "" "bc \- arbitrary-precision arithmetic language" "" bc(1)
-.xx "" "" "bcd, ppt \- convert to antique media" "" bcd(6)
-.xx "" "cb \- C program" "beautifier" "" cb(1)
-.xx "" "j0, j1, jn, y0, y1, yn \-" "bessel functions" "" j0(3)
-.xx "" "fread, fwrite \- buffered" "binary input/output" "" fread(3)
-.xx "" "" "bj \- the game of black jack" "" bj(6)
-.xx "" "sync \- update the super" "block" "" sync(1)
-.xx "" "sync \- update super-" "block" "" sync(2)
-.xx "" "update \- periodically update the super" "block" "" update(8)
-.xx "" "sum \- sum and count" "blocks in a file" "" sum(1)
-.xx "" "ching, fortune \- the" "book of changes and other cookies" "" ching(6)
-.xx "" "" "boot \- startup procedures" "" boot(8)
-.xx "" "brk, sbrk," "break \- change core allocation" "" brk(2)
-.xx "export, login,/" "sh, for, case, if, while," "break, continue, cd, eval, exec, exit," "" sh(1)
-.xx "" "" "brk, sbrk, break \- change core allocation" "" brk(2)
-.xx "" "fread, fwrite \-" "buffered binary input/output" "" fread(3)
-.xx "" "stdio \- standard" "buffered input/output package" "" stdio(3)
-.xx "" "setbuf \- assign" "buffering to a stream" "" setbuf(3)
-.xx "" "mknod \-" "build special file" "" mknod(1)
-.xx "" "l3tol, ltol3 \- convert between 3-" "byte integers and long integers" "" l3tol(3)
-.xx "" "swab \- swap" "bytes" "" swab(3)
-.xx "" "cc, pcc \-" "C compiler" "" cc(1)
-.xx "" "cb \-" "C program beautifier" "" cb(1)
-.xx "" "lint \- a" "C program verifier" "" lint(1)
-.xx "" "hypot," "cabs \- euclidean distance" "" hypot(3)
-.xx "" "" "cal \- print calendar" "" cal(1)
-.xx "" "dc \- desk" "calculator" "" dc(1)
-.xx "" "cal \- print" "calendar" "" cal(1)
-.xx "" "" "calendar \- reminder service" "" calendar(1)
-.xx "" "indir \- indirect system" "call" "" indir(2)
-.xx "" "cu \-" "call UNIX" "" cu(1)
-.xx "" "malloc, free, realloc," "calloc \- main memory allocator" "" malloc(3)
-.xx "" "intro, errno \- introduction to system" "calls and error numbers" "" intro(2)
-.xx "exec, exit, export, login, newgrp,/" "sh, for," "case, if, while, break, continue, cd, eval," "" sh(1)
-.xx "" "" "cat \- catenate and print" "" cat(1)
-.xx "" "" "cat \- phototypesetter interface" "" cat(4)
-.xx "" "signal \-" "catch or ignore signals" "" signal(2)
-.xx "" "cat \-" "catenate and print" "" cat(1)
-.xx "" "" "cb \- C program beautifier" "" cb(1)
-.xx "" "" "cc, pcc \- C compiler" "" cc(1)
-.xx "" "" "cd \- change working directory" "" cd(1)
-.xx "" "sh, for, case, if, while, break, continue," "cd, eval, exec, exit, export, login, newgrp,/" "" sh(1)
-.xx "functions" "fabs, floor," "ceil \- absolute value, floor, ceiling" "" floor(3)
-.xx "" "brk, sbrk, break \-" "change core allocation" "" brk(2)
-.xx "" "chdir \-" "change default directory" "" chdir(2)
-.xx "" "passwd \-" "change login password" "" passwd(1)
-.xx "" "chmod \-" "change mode" "" chmod(1)
-.xx "" "chmod \-" "change mode of file" "" chmod(2)
-.xx "" "chown \-" "change owner and group of a file" "" chown(2)
-.xx "" "chown, chgrp \-" "change owner or group" "" chown(1)
-.xx "" "cd \-" "change working directory" "" cd(1)
-.xx "" "ching, fortune \- the book of" "changes and other cookies" "" ching(6)
-.xx "" "pipe \- create an interprocess" "channel" "" pipe(2)
-.xx "" "ungetc \- push" "character back into input stream" "" ungetc(3)
-.xx "" "ispunct, isprint, iscntrl, isascii \-" "character classification" "/isalnum, isspace," ctype(3)
-.xx "" "eqnchar \- special" "character definitions for eqn" "" eqnchar(7)
-.xx "" "getc, getchar, fgetc, getw \- get" "character or word from stream" "" getc(3)
-.xx "" "putc, putchar, fputc, putw \- put" "character or word on a stream" "" putc(3)
-.xx "" "ascii \- map of ASCII" "character set" "" ascii(7)
-.xx "" "tr \- translate" "characters" "" tr(1)
-.xx "" "" "chdir \- change default directory" "" chdir(2)
-.xx "" "dcheck \- file system directory consistency" "check" "" dcheck(1)
-.xx "" "icheck \- file system storage consistency" "check" "" icheck(1)
-.xx "" "eqn, neqn," "checkeq \- typeset mathematics" "" eqn(1)
-.xx "" "" "checkers \- game" "" checkers(6)
-.xx "" "chess \- the game of" "chess" "" chess(6)
-.xx "" "chown," "chgrp \- change owner or group" "" chown(1)
-.xx "other cookies" "" "ching, fortune \- the book of changes and" "" ching(6)
-.xx "" "" "chmod \- change mode" "" chmod(1)
-.xx "" "" "chmod \- change mode of file" "" chmod(2)
-.xx "" "" "chown \- change owner and group of a file" "" chown(2)
-.xx "" "" "chown, chgrp \- change owner or group" "" chown(1)
-.xx "" "isprint, iscntrl, isascii \- character" "classification" "/isalnum, isspace, ispunct," ctype(3)
-.xx "" "clri \-" "clear i-node" "" clri(1)
-.xx "" "feof, ferror," "clearerr, fileno \- stream status inquiries" "" ferror(3)
-.xx "" "cron \-" "clock daemon" "" cron(8)
-.xx "" "" "close \- close a file" "" close(2)
-.xx "" "fclose, fflush \-" "close or flush a stream" "" fclose(3)
-.xx "" "" "clri \- clear i-node" "" clri(1)
-.xx "" "" "cmp \- compare two files" "" cmp(1)
-.xx "" "" "col \- filter reverse line feeds" "" col(1)
-.xx "sorted files" "" "comm \- select or reject lines common to two" "" comm(1)
-.xx "" "system \- issue a shell" "command" "" system(3)
-.xx "" "test \- condition" "command" "" test(1)
-.xx "" "time \- time a" "command" "" time(1)
-.xx "" "nice, nohup \- run a" "command at low priority" "" nice(1)
-.xx "" "uux \- unix to unix" "command execution" "" uux(1)
-.xx "" "set, shift, times, trap, umask, wait \-" "command language" "/newgrp, read, readonly," sh(1)
-.xx "" "intro \- introduction to" "commands" "" intro(1)
-.xx "" "at \- execute" "commands at a later time" "" at(1)
-.xx "" "comm \- select or reject lines" "common to two sorted files" "" comm(1)
-.xx "" "diff \- differential file" "comparator" "" diff(1)
-.xx "" "cmp \-" "compare two files" "" cmp(1)
-.xx "" "diff3 \- 3-way differential file" "comparison" "" diff3(1)
-.xx "" "cc, pcc \- C" "compiler" "" cc(1)
-.xx "" "f77 \- Fortran 77" "compiler" "" f77(1)
-.xx "" "yacc \- yet another compiler-" "compiler" "" yacc(1)
-.xx "" "wait \- await" "completion of process" "" wait(1)
-.xx "" "test \-" "condition command" "" test(1)
-.xx "" "mkconf \- generate" "configuration tables" "" mkconf(1)
-.xx "" "dcheck \- file system directory" "consistency check" "" dcheck(1)
-.xx "" "icheck \- file system storage" "consistency check" "" icheck(1)
-.xx "" "mkfs \-" "construct a file system" "" mkfs(1)
-.xx "" "deroff \- remove nroff, troff, tbl and eqn" "constructs" "" deroff(1)
-.xx "" "ls \- list" "contents of directory" "" ls(1)
-.xx "login,/" "sh, for, case, if, while, break," "continue, cd, eval, exec, exit, export," "" sh(1)
-.xx "" "ioctl, stty, gtty \-" "control device" "" ioctl(2)
-.xx "" "init, rc \- process" "control initialization" "" init(8)
-.xx "" "terminals\-" "conventional names" "" term(7)
-.xx "" "ecvt, fcvt, gcvt \- output" "conversion" "" ecvt(3)
-.xx "" "printf, fprintf, sprintf \- formatted output" "conversion" "" printf(3)
-.xx "" "scanf, fscanf, sscanf \- formatted input" "conversion" "" scanf(3)
-.xx "" "units \-" "conversion program" "" units(1)
-.xx "" "dd \-" "convert and copy a file" "" dd(1)
-.xx "" "arcv \-" "convert archives to new format" "" arcv(1)
-.xx "" "atof, atoi, atol \-" "convert ASCII to numbers" "" atof(3)
-.xx "integers" "l3tol, ltol3 \-" "convert between 3-byte integers and long" "" l3tol(3)
-.xx "" "localtime, gmtime, asctime, timezone \-" "convert date and time to ASCII" "ctime," ctime(3)
-.xx "" "bcd, ppt \-" "convert to antique media" "" bcd(6)
-.xx "" "fortune \- the book of changes and other" "cookies" "ching," ching(6)
-.xx "" "cp \-" "copy" "" cp(1)
-.xx "" "uucp, uulog \- unix to unix" "copy" "" uucp(1)
-.xx "" "dd \- convert and" "copy a file" "" dd(1)
-.xx "" "" "core \- format of core image file" "" core(5)
-.xx "" "brk, sbrk, break \- change" "core allocation" "" brk(2)
-.xx "" "core \- format of" "core image file" "" core(5)
-.xx "" "mem, kmem \-" "core memory" "" mem(4)
-.xx "trigonometric functions" "sin," "cos, tan, asin, acos, atan, atan2 \-" "" sin(3)
-.xx "" "sinh," "cosh, tanh \- hyperbolic functions" "" sinh(3)
-.xx "" "wc \- word" "count" "" wc(1)
-.xx "" "sum \- sum and" "count blocks in a file" "" sum(1)
-.xx "" "" "cp \- copy" "" cp(1)
-.xx "" "" "crash \- what to do when the system crashes" "" crash(8)
-.xx "" "" "creat \- create a new file" "" creat(2)
-.xx "" "pipe \-" "create an interprocess channel" "" pipe(2)
-.xx "" "umask \- set file" "creation mode mask" "" umask(2)
-.xx "" "" "cron \- clock daemon" "" cron(8)
-.xx "" "" "crypt \- encode/decode" "" crypt(1)
-.xx "" "" "crypt, setkey, encrypt \- DES encryption" "" crypt(3)
-.xx "\- convert date and time to ASCII" "" "ctime, localtime, gmtime, asctime, timezone" "" ctime(3)
-.xx "" "" "cu \- call UNIX" "" cu(1)
-.xx "" "ttt," "cubic \- tic-tac-toe" "" ttt(6)
-.xx "" "spline \- interpolate smooth" "curve" "" spline(1)
-.xx "" "cron \- clock" "daemon" "" cron(8)
-.xx "" "prof \- display profile" "data" "" prof(1)
-.xx "" "ttys \- terminal initialization" "data" "" ttys(5)
-.xx "" "fetch, store, delete, firstkey, nextkey \-" "data base subroutines" "dbminit," dbm(3)
-.xx "" "null \-" "data sink" "" null(4)
-.xx "" "types \- primitive system" "data types" "" types(5)
-.xx "" "join \- relational" "database operator" "" join(1)
-.xx "" "du, dp \- DU-11 201" "data-phone interface" "" du(4)
-.xx "" "date \- print and set the" "date" "" date(1)
-.xx "" "time, ftime \- get" "date and time" "" time(2)
-.xx "" "gmtime, asctime, timezone \- convert" "date and time to ASCII" "ctime, localtime," ctime(3)
-.xx "" "touch \- update" "date last modified of a file" "" touch(1)
-.xx "nextkey \- data base subroutines" "" "dbminit, fetch, store, delete, firstkey," "" dbm(3)
-.xx "" "" "dc \- desk calculator" "" dc(1)
-.xx "check" "" "dcheck \- file system directory consistency" "" dcheck(1)
-.xx "" "" "dd \- convert and copy a file" "" dd(1)
-.xx "" "dump," "ddate \- incremental dump format" "" dump(5)
-.xx "" "adb \-" "debugger" "" adb(1)
-.xx "" "tp \-" "DEC/mag tape formats" "" tp(5)
-.xx "" "crypt \- encode/" "decode" "" crypt(1)
-.xx "" "tc \- TC-11/TU56" "DECtape" "" tc(4)
-.xx "" "chdir \- change" "default directory" "" chdir(2)
-.xx "" "eqnchar \- special character" "definitions for eqn" "" eqnchar(7)
-.xx "subroutines" "dbminit, fetch, store," "delete, firstkey, nextkey \- data base" "" dbm(3)
-.xx "" "tail \-" "deliver the last part of a file" "" tail(1)
-.xx "" "mesg \- permit or" "deny messages" "" mesg(1)
-.xx "constructs" "" "deroff \- remove nroff, troff, tbl and eqn" "" deroff(1)
-.xx "" "crypt, setkey, encrypt \-" "DES encryption" "" crypt(3)
-.xx "" "dup, dup2 \- duplicate an open file" "descriptor" "" dup(2)
-.xx "" "dc \-" "desk calculator" "" dc(1)
-.xx "" "access \-" "determine accessibility of file" "" access(2)
-.xx "" "file \-" "determine file type" "" file(1)
-.xx "" "ioctl, stty, gtty \- control" "device" "" ioctl(2)
-.xx "" "" "df \- disk free" "" df(1)
-.xx "" "" "diff \- differential file comparator" "" diff(1)
-.xx "" "" "diff3 \- 3-way differential file comparison" "" diff3(1)
-.xx "" "diff \-" "differential file comparator" "" diff(1)
-.xx "" "diff3 \- 3-way" "differential file comparison" "" diff3(1)
-.xx "" "" "dir \- format of directories" "" dir(5)
-.xx "" "mv \- move or rename files and" "directories" "" mv(1)
-.xx "" "cd \- change working" "directory" "" cd(1)
-.xx "" "chdir \- change default" "directory" "" chdir(2)
-.xx "" "ls \- list contents of" "directory" "" ls(1)
-.xx "" "mkdir \- make a" "directory" "" mkdir(1)
-.xx "" "dcheck \- file system" "directory consistency check" "" dcheck(1)
-.xx "" "unlink \- remove" "directory entry" "" unlink(2)
-.xx "" "pwd \- working" "directory name" "" pwd(1)
-.xx "" "mknod \- make a" "directory or a special file" "" mknod(2)
-.xx "" "hp \- RH-11/RP04, RP05, RP06 moving-head" "disk" "" hp(4)
-.xx "" "rk \- RK-11/RK03 or RK05" "disk" "" rk(4)
-.xx "" "rp \- RP-11/RP03 moving-head" "disk" "" rp(4)
-.xx "" "hs \- RH11/RS03-RS04 fixed-head" "disk file" "" hs(4)
-.xx "" "rf \- RF11/RS11 fixed-head" "disk file" "" rf(4)
-.xx "" "df \-" "disk free" "" df(1)
-.xx "" "du \- summarize" "disk usage" "" du(1)
-.xx "" "mount, umount \- mount and" "dismount file system" "" mount(1)
-.xx "" "prof \-" "display profile data" "" prof(1)
-.xx "" "hypot, cabs \- euclidean" "distance" "" hypot(3)
-.xx "" "" "dn \- DN-11 ACU interface" "" dn(4)
-.xx "" "\- find and insert literature references in" "documents" "refer, lookbib" refer(1)
-.xx "" "du," "dp \- DU-11 201 data-phone interface" "" du(4)
-.xx "" "reversi \- a game of" "dramatic reversals" "" reversi(6)
-.xx "" "graph \-" "draw a graph" "" graph(1)
-.xx "" "arithmetic \- provide" "drill in number facts" "" arithmetic(6)
-.xx "" "pk \- packet" "driver" "" pk(4)
-.xx "" "pkclose, pkread, pkwrite, pkfail \- packet" "driver simulator" "pkopen," pkopen(3)
-.xx "" "" "du \- summarize disk usage" "" du(1)
-.xx "" "" "du, dp \- DU-11 201 data-phone interface" "" du(4)
-.xx "" "dump \- incremental file system" "dump" "" dump(1)
-.xx "" "od \- octal" "dump" "" od(1)
-.xx "" "" "dump \- incremental file system dump" "" dump(1)
-.xx "" "" "dump, ddate \- incremental dump format" "" dump(5)
-.xx "" "dumpdir \- print the names of files on a" "dump tape" "" dumpdir(1)
-.xx "descriptor" "" "dup, dup2 \- duplicate an open file" "" dup(2)
-.xx "" "" "echo \- echo arguments" "" echo(1)
-.xx "" "" "ecvt, fcvt, gcvt \- output conversion" "" ecvt(3)
-.xx "" "" "ed \- text editor" "" ed(1)
-.xx "" "end, etext," "edata \- last locations in program" "" end(3)
-.xx "" "ed \- text" "editor" "" ed(1)
-.xx "" "sed \- stream" "editor" "" sed(1)
-.xx "" "a.out \- assembler and link" "editor output" "" a.out(5)
-.xx "" "grep," "egrep, fgrep \- search a file for a pattern" "" grep(1)
-.xx "" "crypt \-" "encode/decode" "" crypt(1)
-.xx "" "crypt, setkey," "encrypt \- DES encryption" "" crypt(3)
-.xx "" "makekey \- generate" "encryption key" "" makekey(8)
-.xx "program" "" "end, etext, edata \- last locations in" "" end(3)
-.xx "" "getgrent, getgrgid, getgrnam, setgrent," "endgrent \- get group file entry" "" getgrent(3)
-.xx "" "getpwent, getpwuid, getpwnam, setpwent," "endpwent \- get password file entry" "" getpwent(3)
-.xx "" "xsend, xget," "enroll \- secret mail" "" xsend(1)
-.xx "" "nlist \- get" "entries from name list" "" nlist(3)
-.xx "" "setgrent, endgrent \- get group file" "entry" "getgrent, getgrgid, getgrnam," getgrent(3)
-.xx "" "setpwent, endpwent \- get password file" "entry" "getpwent, getpwuid, getpwnam," getpwent(3)
-.xx "" "unlink \- remove directory" "entry" "" unlink(2)
-.xx "" "execle, execve, execlp, execvp, exec, exece," "environ \- execute a file" "execl, execv," exec(2)
-.xx "" "" "environ \- user environment" "" environ(5)
-.xx "" "getenv \- value for" "environment name" "" getenv(3)
-.xx "" "eqnchar \- special character definitions for" "eqn" "" eqnchar(7)
-.xx "" "deroff \- remove nroff, troff, tbl and" "eqn constructs" "" deroff(1)
-.xx "" "" "eqn, neqn, checkeq \- typeset mathematics" "" eqn(1)
-.xx "eqn" "" "eqnchar \- special character definitions for" "" eqnchar(7)
-.xx "error numbers" "intro," "errno \- introduction to system calls and" "" intro(2)
-.xx "" "perror, sys_errlist, sys_nerr \- system" "error messages" "" perror(3)
-.xx "" "errno \- introduction to system calls and" "error numbers" "intro," intro(2)
-.xx "" "spell, spellin, spellout \- find spelling" "errors" "" spell(1)
-.xx "" "pkon, pkoff \-" "establish packet protocol" "" pkon(2)
-.xx "" "end," "etext, edata \- last locations in program" "" end(3)
-.xx "" "hypot, cabs \-" "euclidean distance" "" hypot(3)
-.xx "" "for, case, if, while, break, continue, cd," "eval, exec, exit, export, login, newgrp,/" "sh," sh(1)
-.xx "" "expr \-" "evaluate arguments as an expression" "" expr(1)
-.xx "" "execl, execv, execle, execve, execlp, execvp," "exec, exece, environ \- execute a file" "" exec(2)
-.xx "" "/case, if, while, break, continue, cd, eval," "exec, exit, export, login, newgrp, read,/" "" sh(1)
-.xx "" "execv, execle, execve, execlp, execvp, exec," "exece, environ \- execute a file" "execl," exec(2)
-.xx "" "at \-" "execute commands at a later time" "" at(1)
-.xx "" "uux \- unix to unix command" "execution" "" uux(1)
-.xx "" "acct \-" "execution accounting file" "" acct(5)
-.xx "" "sleep \- suspend" "execution for an interval" "" sleep(1)
-.xx "" "sleep \- suspend" "execution for interval" "" sleep(3)
-.xx "" "monitor \- prepare" "execution profile" "" monitor(3)
-.xx "" "profil \-" "execution time profile" "" profil(2)
-.xx "exece, environ \- execute a file" "execl," "execv, execle, execve, execlp, execvp, exec," "" exec(2)
-.xx "" "" "exit \- terminate process" "" exit(2)
-.xx "" "/if, while, break, continue, cd, eval, exec," "exit, export, login, newgrp, read, readonly,/" "" sh(1)
-.xx "logarithm, power, square root" "" "exp, log, log10, pow, sqrt \- exponential," "" exp(3)
-.xx "" "frexp, ldexp, modf \- split into mantissa and" "exponent" "" frexp(3)
-.xx "" "exp, log, log10, pow, sqrt \-" "exponential, logarithm, power, square root" "" exp(3)
-.xx "" "/while, break, continue, cd, eval, exec, exit," "export, login, newgrp, read, readonly, set,/" "" sh(1)
-.xx "" "" "expr \- evaluate arguments as an expression" "" expr(1)
-.xx "" "" "f77 \- Fortran 77 compiler" "" f77(1)
-.xx "ceiling functions" "" "fabs, floor, ceil \- absolute value, floor," "" floor(3)
-.xx "" "factor, primes \-" "factor a number, generate large primes" "" factor(1)
-.xx "" "true," "false \- provide truth values" "" true(1)
-.xx "" "abort \- generate IOT" "fault" "" abort(3)
-.xx "" "" "fclose, fflush \- close or flush a stream" "" fclose(3)
-.xx "" "ecvt," "fcvt, gcvt \- output conversion" "" ecvt(3)
-.xx "" "fopen, freopen," "fdopen \- open a stream" "" fopen(3)
-.xx "status inquiries" "" "feof, ferror, clearerr, fileno \- stream" "" ferror(3)
-.xx "data base subroutines" "dbminit," "fetch, store, delete, firstkey, nextkey \-" "" dbm(3)
-.xx "" "fclose," "fflush \- close or flush a stream" "" fclose(3)
-.xx "stream" "getc, getchar," "fgetc, getw \- get character or word from" "" getc(3)
-.xx "" "gets," "fgets \- get a string from a stream" "" gets(3)
-.xx "" "grep, egrep," "fgrep \- search a file for a pattern" "" grep(1)
-.xx "" "access \- determine accessibility of" "file" "" access(2)
-.xx "" "acct \- execution accounting" "file" "" acct(5)
-.xx "" "chmod \- change mode of" "file" "" chmod(2)
-.xx "" "chown \- change owner and group of a" "file" "" chown(2)
-.xx "" "close \- close a" "file" "" close(2)
-.xx "" "core \- format of core image" "file" "" core(5)
-.xx "" "creat \- create a new" "file" "" creat(2)
-.xx "" "dd \- convert and copy a" "file" "" dd(1)
-.xx "" "execvp, exec, exece, environ \- execute a" "file" "execl, execv, execle, execve, execlp," exec(2)
-.xx "" "group \- group" "file" "" group(5)
-.xx "" "hs \- RH11/RS03-RS04 fixed-head disk" "file" "" hs(4)
-.xx "" "link \- link to a" "file" "" link(2)
-.xx "" "mknod \- build special" "file" "" mknod(1)
-.xx "" "mknod \- make a directory or a special" "file" "" mknod(2)
-.xx "" "passwd \- password" "file" "" passwd(5)
-.xx "" "pr \- print" "file" "" pr(1)
-.xx "" "read \- read from" "file" "" read(2)
-.xx "" "rev \- reverse lines of a" "file" "" rev(1)
-.xx "" "rf \- RF11/RS11 fixed-head disk" "file" "" rf(4)
-.xx "" "size \- size of an object" "file" "" size(1)
-.xx "" "sum \- sum and count blocks in a" "file" "" sum(1)
-.xx "" "tail \- deliver the last part of a" "file" "" tail(1)
-.xx "" "touch \- update date last modified of a" "file" "" touch(1)
-.xx "" "uniq \- report repeated lines in a" "file" "" uniq(1)
-.xx "" "write \- write on a" "file" "" write(2)
-.xx "" "" "file \- determine file type" "" file(1)
-.xx "" "diff \- differential" "file comparator" "" diff(1)
-.xx "" "diff3 \- 3-way differential" "file comparison" "" diff3(1)
-.xx "" "umask \- set" "file creation mode mask" "" umask(2)
-.xx "" "dup, dup2 \- duplicate an open" "file descriptor" "" dup(2)
-.xx "" "getgrnam, setgrent, endgrent \- get group" "file entry" "getgrent, getgrgid," getgrent(3)
-.xx "" "getpwnam, setpwent, endpwent \- get password" "file entry" "getpwent, getpwuid," getpwent(3)
-.xx "" "grep, egrep, fgrep \- search a" "file for a pattern" "" grep(1)
-.xx "" "ar \- archive (library)" "file format" "" ar(5)
-.xx "" "split \- split a" "file into pieces" "" split(1)
-.xx "" "mktemp \- make a unique" "file name" "" mktemp(3)
-.xx "" "stat, fstat \- get" "file status" "" stat(2)
-.xx "" "mkfs \- construct a" "file system" "" mkfs(1)
-.xx "" "mount, umount \- mount and dismount" "file system" "" mount(1)
-.xx "" "mount, umount \- mount or remove" "file system" "" mount(2)
-.xx "" "dcheck \-" "file system directory consistency check" "" dcheck(1)
-.xx "" "dump \- incremental" "file system dump" "" dump(1)
-.xx "" "hier \-" "file system hierarchy" "" hier(7)
-.xx "" "quot \- summarize" "file system ownership" "" quot(1)
-.xx "" "restor \- incremental" "file system restore" "" restor(1)
-.xx "" "icheck \-" "file system storage consistency check" "" icheck(1)
-.xx "" "mtab \- mounted" "file system table" "" mtab(5)
-.xx "" "filsys, flblk, ino \- format of" "file system volume" "" filsys(5)
-.xx "" "utime \- set" "file times" "" utime(2)
-.xx "" "file \- determine" "file type" "" file(1)
-.xx "" "basename \- strip" "filename affixes" "" basename(1)
-.xx "" "feof, ferror, clearerr," "fileno \- stream status inquiries" "" ferror(3)
-.xx "" "cmp \- compare two" "files" "" cmp(1)
-.xx "" "select or reject lines common to two sorted" "files" "comm \-" comm(1)
-.xx "" "find \- find" "files" "" find(1)
-.xx "" "rm, rmdir \- remove (unlink)" "files" "" rm(1)
-.xx "" "sort \- sort or merge" "files" "" sort(1)
-.xx "" "mv \- move or rename" "files and directories" "" mv(1)
-.xx "" "dumpdir \- print the names of" "files on a dump tape" "" dumpdir(1)
-.xx "volume" "" "filsys, flblk, ino \- format of file system" "" filsys(5)
-.xx "" "col \-" "filter reverse line feeds" "" col(1)
-.xx "" "plot \- graphics" "filters" "" plot(1)
-.xx "" "" "find \- find files" "" find(1)
-.xx "documents" "refer, lookbib \-" "find and insert literature references in" "" refer(1)
-.xx "" "find \-" "find files" "" find(1)
-.xx "" "look \-" "find lines in a sorted list" "" look(1)
-.xx "" "ttyname, isatty, ttyslot \-" "find name of a terminal" "" ttyname(3)
-.xx "" "lorder \-" "find ordering relation for an object library" "" lorder(1)
-.xx "" "spell, spellin, spellout \-" "find spelling errors" "" spell(1)
-.xx "" "dbminit, fetch, store, delete," "firstkey, nextkey \- data base subroutines" "" dbm(3)
-.xx "" "hs \- RH11/RS03-RS04" "fixed-head disk file" "" hs(4)
-.xx "" "rf \- RF11/RS11" "fixed-head disk file" "" rf(4)
-.xx "" "filsys," "flblk, ino \- format of file system volume" "" filsys(5)
-.xx "functions" "fabs," "floor, ceil \- absolute value, floor, ceiling" "" floor(3)
-.xx "" "fclose, fflush \- close or" "flush a stream" "" fclose(3)
-.xx "" "" "fopen, freopen, fdopen \- open a stream" "" fopen(3)
-.xx "" "" "fork \- spawn new process" "" fork(2)
-.xx "" "ar \- archive (library) file" "format" "" ar(5)
-.xx "" "arcv \- convert archives to new" "format" "" arcv(1)
-.xx "" "dump, ddate \- incremental dump" "format" "" dump(5)
-.xx "" "core \-" "format of core image file" "" core(5)
-.xx "" "dir \-" "format of directories" "" dir(5)
-.xx "" "filsys, flblk, ino \-" "format of file system volume" "" filsys(5)
-.xx "" "tbl \-" "format tables for nroff or troff" "" tbl(1)
-.xx "" "roff \-" "format text" "" roff(1)
-.xx "" "tp \- DEC/mag tape" "formats" "" tp(5)
-.xx "" "scanf, fscanf, sscanf \-" "formatted input conversion" "" scanf(3)
-.xx "" "printf, fprintf, sprintf \-" "formatted output conversion" "" printf(3)
-.xx "" "troff, nroff \- text" "formatting and typesetting" "" troff(1)
-.xx "" "ms \- macros for" "formatting manuscripts" "" ms(7)
-.xx "" "f77 \-" "Fortran 77 compiler" "" f77(1)
-.xx "" "ratfor \- rational" "Fortran dialect" "" ratfor(1)
-.xx "" "struct \- structure" "Fortran programs" "" struct(1)
-.xx "cookies" "ching," "fortune \- the book of changes and other" "" ching(6)
-.xx "conversion" "printf," "fprintf, sprintf \- formatted output" "" printf(3)
-.xx "stream" "putc, putchar," "fputc, putw \- put character or word on a" "" putc(3)
-.xx "" "puts," "fputs \- put a string on a stream" "" puts(3)
-.xx "" "" "fread, fwrite \- buffered binary input/output" "" fread(3)
-.xx "" "df \- disk" "free" "" df(1)
-.xx "allocator" "malloc," "free, realloc, calloc \- main memory" "" malloc(3)
-.xx "" "fopen," "freopen, fdopen \- open a stream" "" fopen(3)
-.xx "exponent" "" "frexp, ldexp, modf \- split into mantissa and" "" frexp(3)
-.xx "" "scanf," "fscanf, sscanf \- formatted input conversion" "" scanf(3)
-.xx "" "" "fseek, ftell, rewind \- reposition a stream" "" fseek(3)
-.xx "" "stat," "fstat \- get file status" "" stat(2)
-.xx "" "fseek," "ftell, rewind \- reposition a stream" "" fseek(3)
-.xx "" "time," "ftime \- get date and time" "" time(2)
-.xx "" "floor, ceil \- absolute value, floor, ceiling" "functions" "fabs," floor(3)
-.xx "" "intro \- introduction to library" "functions" "" intro(3)
-.xx "" "j0, j1, jn, y0, y1, yn \- bessel" "functions" "" j0(3)
-.xx "" "tan, asin, acos, atan, atan2 \- trigonometric" "functions" "sin, cos," sin(3)
-.xx "" "sinh, cosh, tanh \- hyperbolic" "functions" "" sinh(3)
-.xx "" "fread," "fwrite \- buffered binary input/output" "" fread(3)
-.xx "" "backgammon \- the" "game" "" backgammon(6)
-.xx "" "checkers \-" "game" "" checkers(6)
-.xx "" "moo \- guessing" "game" "" moo(6)
-.xx "" "bj \- the" "game of black jack" "" bj(6)
-.xx "" "chess \- the" "game of chess" "" chess(6)
-.xx "" "reversi \- a" "game of dramatic reversals" "" reversi(6)
-.xx "" "wump \- the" "game of hunt-the-wumpus" "" wump(6)
-.xx "" "hangman, words \- word" "games" "" words(6)
-.xx "" "itom, madd, msub, mult, mdiv, min, mout, pow," "gcd, rpow \- multiple precision integer/" "" mp(3)
-.xx "" "ecvt, fcvt," "gcvt \- output conversion" "" ecvt(3)
-.xx "" "maze \-" "generate a maze problem" "" maze(6)
-.xx "" "mkconf \-" "generate configuration tables" "" mkconf(1)
-.xx "" "makekey \-" "generate encryption key" "" makekey(8)
-.xx "" "abort \-" "generate IOT fault" "" abort(3)
-.xx "" "factor, primes \- factor a number," "generate large primes" "" factor(1)
-.xx "" "ncheck \-" "generate names from i-numbers" "" ncheck(1)
-.xx "" "rand, srand \- random number" "generator" "" rand(3)
-.xx "" "lex \-" "generator of lexical analysis programs" "" lex(1)
-.xx "or word from stream" "" "getc, getchar, fgetc, getw \- get character" "" getc(3)
-.xx "" "getuid, getgid, geteuid," "getegid \- get user and group identity" "" getuid(2)
-.xx "" "" "getenv \- value for environment name" "" getenv(3)
-.xx "identity" "getuid, getgid," "geteuid, getegid \- get user and group" "" getuid(2)
-.xx "endgrent \- get group file entry" "" "getgrent, getgrgid, getgrnam, setgrent," "" getgrent(3)
-.xx "" "" "getlogin \- get login name" "" getlogin(3)
-.xx "" "" "getpass \- read a password" "" getpass(3)
-.xx "" "" "getpid \- get process identification" "" getpid(2)
-.xx "" "" "getpw \- get name from UID" "" getpw(3)
-.xx "endpwent \- get password file entry" "" "getpwent, getpwuid, getpwnam, setpwent," "" getpwent(3)
-.xx "" "" "gets, fgets \- get a string from a stream" "" gets(3)
-.xx "" "" "getty \- set typewriter mode" "" getty(8)
-.xx "and group identity" "" "getuid, getgid, geteuid, getegid \- get user" "" getuid(2)
-.xx "" "getc, getchar, fgetc," "getw \- get character or word from stream" "" getc(3)
-.xx "time to ASCII" "ctime, localtime," "gmtime, asctime, timezone \- convert date and" "" ctime(3)
-.xx "" "setjmp, longjmp \- non-local" "goto" "" setjmp(3)
-.xx "" "graph \- draw a" "graph" "" graph(1)
-.xx "" "plot \-" "graphics filters" "" plot(1)
-.xx "" "plot: openpl et al. \-" "graphics interface" "" plot(3)
-.xx "" "plot \-" "graphics interface" "" plot(5)
-.xx "pattern" "" "grep, egrep, fgrep \- search a file for a" "" grep(1)
-.xx "" "chown, chgrp \- change owner or" "group" "" chown(1)
-.xx "" "newgrp \- log in to a new" "group" "" newgrp(1)
-.xx "" "" "group \- group file" "" group(5)
-.xx "" "getgrgid, getgrnam, setgrent, endgrent \- get" "group file entry" "getgrent," getgrent(3)
-.xx "" "setuid, setgid \- set user and" "group ID" "" setuid(2)
-.xx "" "getgid, geteuid, getegid \- get user and" "group identity" "getuid," getuid(2)
-.xx "" "chown \- change owner and" "group of a file" "" chown(2)
-.xx "" "make \- maintain program" "groups" "" make(1)
-.xx "" "ioctl, stty," "gtty \- control device" "" ioctl(2)
-.xx "" "moo \-" "guessing game" "" moo(6)
-.xx "" "" "hangman, words \- word games" "" words(6)
-.xx "" "" "hier \- file system hierarchy" "" hier(7)
-.xx "" "" "hp \- RH-11/RP04, RP05, RP06 moving-head disk" "" hp(4)
-.xx "" "" "hs \- RH11/RS03-RS04 fixed-head disk file" "" hs(4)
-.xx "" "" "ht \- RH-11/TU-16 magtape interface" "" ht(4)
-.xx "" "wump \- the game of" "hunt-the-wumpus" "" wump(6)
-.xx "" "sinh, cosh, tanh \-" "hyperbolic functions" "" sinh(3)
-.xx "" "" "hypot, cabs \- euclidean distance" "" hypot(3)
-.xx "check" "" "icheck \- file system storage consistency" "" icheck(1)
-.xx "" "setuid, setgid \- set user and group" "ID" "" setuid(2)
-.xx "" "su \- substitute user" "id temporarily" "" su(1)
-.xx "" "getpid \- get process" "identification" "" getpid(2)
-.xx "" "geteuid, getegid \- get user and group" "identity" "getuid, getgid," getuid(2)
-.xx "exit, export, login, newgrp,/" "sh, for, case," "if, while, break, continue, cd, eval, exec," "" sh(1)
-.xx "" "signal \- catch or" "ignore signals" "" signal(2)
-.xx "" "core \- format of core" "image file" "" core(5)
-.xx "" "dump, ddate \-" "incremental dump format" "" dump(5)
-.xx "" "dump \-" "incremental file system dump" "" dump(1)
-.xx "" "restor \-" "incremental file system restore" "" restor(1)
-.xx "" "ptx \- permuted" "index" "" ptx(1)
-.xx "" "strcmp, strncmp, strcpy, strncpy, strlen," "index, rindex \- string operations" "/strncat," string(3)
-.xx "" "" "indir \- indirect system call" "" indir(2)
-.xx "" "" "init, rc \- process control initialization" "" init(8)
-.xx "" "ttys \- terminal" "initialization data" "" ttys(5)
-.xx "" "popen, pclose \-" "initiate I/O to/from a process" "" popen(3)
-.xx "" "filsys, flblk," "ino \- format of file system volume" "" filsys(5)
-.xx "" "clri \- clear" "i-node" "" clri(1)
-.xx "" "scanf, fscanf, sscanf \- formatted" "input conversion" "" scanf(3)
-.xx "" "ungetc \- push character back into" "input stream" "" ungetc(3)
-.xx "" "fread, fwrite \- buffered binary" "input/output" "" fread(3)
-.xx "" "stdio \- standard buffered" "input/output package" "" stdio(3)
-.xx "" "ferror, clearerr, fileno \- stream status" "inquiries" "feof," ferror(3)
-.xx "" "refer, lookbib \- find and" "insert literature references in documents" "" refer(1)
-.xx "" "cat \- phototypesetter" "interface" "" cat(4)
-.xx "" "dn \- DN-11 ACU" "interface" "" dn(4)
-.xx "" "du, dp \- DU-11 201 data-phone" "interface" "" du(4)
-.xx "" "ht \- RH-11/TU-16 magtape" "interface" "" ht(4)
-.xx "" "plot: openpl et al. \- graphics" "interface" "" plot(3)
-.xx "" "plot \- graphics" "interface" "" plot(5)
-.xx "" "tm \- TM-11/TU-10 magtape" "interface" "" tm(4)
-.xx "" "tty \- general terminal" "interface" "" tty(4)
-.xx "" "spline \-" "interpolate smooth curve" "" spline(1)
-.xx "" "pipe \- create an" "interprocess channel" "" pipe(2)
-.xx "" "intro \-" "introduction to commands" "" intro(1)
-.xx "" "intro \-" "introduction to library functions" "" intro(3)
-.xx "numbers" "intro, errno \-" "introduction to system calls and error" "" intro(2)
-.xx "" "ncheck \- generate names from" "i-numbers" "" ncheck(1)
-.xx "" "iostat \- report" "I/O statistics" "" iostat(1)
-.xx "" "popen, pclose \- initiate" "I/O to/from a process" "" popen(3)
-.xx "" "" "ioctl, stty, gtty \- control device" "" ioctl(2)
-.xx "" "" "iostat \- report I/O statistics" "" iostat(1)
-.xx "" "abort \- generate" "IOT fault" "" abort(3)
-.xx "isascii/" "isalpha, isupper, islower, isdigit," "isalnum, isspace, ispunct, isprint, iscntrl," "" ctype(3)
-.xx "" "ttyname," "isatty, ttyslot \- find name of a terminal" "" ttyname(3)
-.xx "" "/isdigit, isalnum, isspace, ispunct, isprint," "iscntrl, isascii \- character classification" "" ctype(3)
-.xx "" "system \-" "issue a shell command" "" system(3)
-.xx "ispunct, isprint, iscntrl, isascii/" "isalpha," "isupper, islower, isdigit, isalnum, isspace," "" ctype(3)
-.xx "gcd, rpow \- multiple precision integer/" "" "itom, madd, msub, mult, mdiv, min, mout, pow," "" mp(3)
-.xx "" "" "j0, j1, jn, y0, y1, yn \- bessel functions" "" j0(3)
-.xx "" "bj \- the game of black" "jack" "" bj(6)
-.xx "" "j0, j1," "jn, y0, y1, yn \- bessel functions" "" j0(3)
-.xx "" "" "join \- relational database operator" "" join(1)
-.xx "" "makekey \- generate encryption" "key" "" makekey(8)
-.xx "" "" "kill \- send signal to a process" "" kill(2)
-.xx "prejudice" "" "kill \- terminate a process with extreme" "" kill(1)
-.xx "" "mem," "kmem \- core memory" "" mem(4)
-.xx "integers and long integers" "" "l3tol, ltol3 \- convert between 3-byte" "" l3tol(3)
-.xx "" "awk \- pattern scanning and processing" "language" "" awk(1)
-.xx "" "bc \- arbitrary-precision arithmetic" "language" "" bc(1)
-.xx "" "shift, times, trap, umask, wait \- command" "language" "/login, newgrp, read, readonly, set," sh(1)
-.xx "" "" "ld \- loader" "" ld(1)
-.xx "exponent" "frexp," "ldexp, modf \- split into mantissa and" "" frexp(3)
-.xx "" "" "lex \- generator of lexical analysis programs" "" lex(1)
-.xx "" "\- find ordering relation for an object" "library" "lorder" lorder(1)
-.xx "" "ar \- archive (" "library) file format" "" ar(5)
-.xx "" "intro \- introduction to" "library functions" "" intro(3)
-.xx "" "ar \- archive and" "library maintainer" "" ar(1)
-.xx "" "col \- filter reverse" "line feeds" "" col(1)
-.xx "" "comm \- select or reject" "lines common to two sorted files" "" comm(1)
-.xx "" "uniq \- report repeated" "lines in a file" "" uniq(1)
-.xx "" "look \- find" "lines in a sorted list" "" look(1)
-.xx "" "rev \- reverse" "lines of a file" "" rev(1)
-.xx "" "ln \- make a" "link" "" ln(1)
-.xx "" "" "link \- link to a file" "" link(2)
-.xx "" "a.out \- assembler and" "link editor output" "" a.out(5)
-.xx "" "link \-" "link to a file" "" link(2)
-.xx "" "" "lint \- a C program verifier" "" lint(1)
-.xx "" "look \- find lines in a sorted" "list" "" look(1)
-.xx "" "nlist \- get entries from name" "list" "" nlist(3)
-.xx "" "nm \- print name" "list" "" nm(1)
-.xx "" "ls \-" "list contents of directory" "" ls(1)
-.xx "" "refer, lookbib \- find and insert" "literature references in documents" "" refer(1)
-.xx "" "" "ln \- make a link" "" ln(1)
-.xx "" "ld \-" "loader" "" ld(1)
-.xx "convert date and time to ASCII" "ctime," "localtime, gmtime, asctime, timezone \-" "" ctime(3)
-.xx "" "end, etext, edata \- last" "locations in program" "" end(3)
-.xx "" "" "lock \- lock a process in primary memory" "" lock(2)
-.xx "" "newgrp \-" "log in to a new group" "" newgrp(1)
-.xx "logarithm, power, square root" "exp," "log, log10, pow, sqrt \- exponential," "" exp(3)
-.xx "" "" "login \- sign on" "" login(1)
-.xx "" "ac \-" "login accounting" "" ac(1)
-.xx "" "getlogin \- get" "login name" "" getlogin(3)
-.xx "" "/continue, cd, eval, exec, exit, export," "login, newgrp, read, readonly, set, shift,/" "" sh(1)
-.xx "" "passwd \- change" "login password" "" passwd(1)
-.xx "" "utmp, wtmp \-" "login records" "" utmp(5)
-.xx "" "setjmp," "longjmp \- non-local goto" "" setjmp(3)
-.xx "" "" "look \- find lines in a sorted list" "" look(1)
-.xx "references in documents" "refer," "lookbib \- find and insert literature" "" refer(1)
-.xx "object library" "" "lorder \- find ordering relation for an" "" lorder(1)
-.xx "" "" "ls \- list contents of directory" "" ls(1)
-.xx "" "" "lseek, tell \- move read/write pointer" "" lseek(2)
-.xx "long integers" "l3tol," "ltol3 \- convert between 3-byte integers and" "" l3tol(3)
-.xx "" "" "m4 \- macro processor" "" m4(1)
-.xx "" "ms \-" "macros for formatting manuscripts" "" ms(7)
-.xx "" "man \-" "macros to typeset manual" "" man(7)
-.xx "rpow \- multiple precision integer/" "itom," "madd, msub, mult, mdiv, min, mout, pow, gcd," "" mp(3)
-.xx "" "tp \- DEC/" "mag tape formats" "" tp(5)
-.xx "" "ht \- RH-11/TU-16" "magtape interface" "" ht(4)
-.xx "" "tm \- TM-11/TU-10" "magtape interface" "" tm(4)
-.xx "" "xsend, xget, enroll \- secret" "mail" "" xsend(1)
-.xx "" "" "mail \- send or receive mail among users" "" mail(1)
-.xx "" "malloc, free, realloc, calloc \-" "main memory allocator" "" malloc(3)
-.xx "" "make \-" "maintain program groups" "" make(1)
-.xx "" "ar \- archive and library" "maintainer" "" ar(1)
-.xx "" "" "make \- maintain program groups" "" make(1)
-.xx "" "mkdir \-" "make a directory" "" mkdir(1)
-.xx "" "mknod \-" "make a directory or a special file" "" mknod(2)
-.xx "" "ln \-" "make a link" "" ln(1)
-.xx "" "mktemp \-" "make a unique file name" "" mktemp(3)
-.xx "" "banner \-" "make long posters" "" banner(6)
-.xx "" "" "makekey \- generate encryption key" "" makekey(8)
-.xx "allocator" "" "malloc, free, realloc, calloc \- main memory" "" malloc(3)
-.xx "" "" "man \- macros to typeset manual" "" man(7)
-.xx "" "" "man \- print sections of this manual" "" man(1)
-.xx "" "tp \-" "manipulate tape archive" "" tp(1)
-.xx "" "frexp, ldexp, modf \- split into" "mantissa and exponent" "" frexp(3)
-.xx "" "man \- print sections of this" "manual" "" man(1)
-.xx "" "man \- macros to typeset" "manual" "" man(7)
-.xx "" "ms \- macros for formatting" "manuscripts" "" ms(7)
-.xx "" "umask \- set file creation mode" "mask" "" umask(2)
-.xx "" "eqn, neqn, checkeq \- typeset" "mathematics" "" eqn(1)
-.xx "" "" "maze \- generate a maze problem" "" maze(6)
-.xx "precision integer/" "itom, madd, msub, mult," "mdiv, min, mout, pow, gcd, rpow \- multiple" "" mp(3)
-.xx "" "bcd, ppt \- convert to antique" "media" "" bcd(6)
-.xx "" "" "mem, kmem \- core memory" "" mem(4)
-.xx "" "lock \- lock a process in primary" "memory" "" lock(2)
-.xx "" "mem, kmem \- core" "memory" "" mem(4)
-.xx "" "malloc, free, realloc, calloc \- main" "memory allocator" "" malloc(3)
-.xx "" "sort \- sort or" "merge files" "" sort(1)
-.xx "" "" "mesg \- permit or deny messages" "" mesg(1)
-.xx "" "perror, sys_errlist, sys_nerr \- system error" "messages" "" perror(3)
-.xx "precision/" "itom, madd, msub, mult, mdiv," "min, mout, pow, gcd, rpow \- multiple" "" mp(3)
-.xx "" "" "mkconf \- generate configuration tables" "" mkconf(1)
-.xx "" "" "mkdir \- make a directory" "" mkdir(1)
-.xx "" "" "mkfs \- construct a file system" "" mkfs(1)
-.xx "" "" "mknod \- build special file" "" mknod(1)
-.xx "" "" "mknod \- make a directory or a special file" "" mknod(2)
-.xx "" "" "mktemp \- make a unique file name" "" mktemp(3)
-.xx "" "chmod \- change" "mode" "" chmod(1)
-.xx "" "getty \- set typewriter" "mode" "" getty(8)
-.xx "" "umask \- set file creation" "mode mask" "" umask(2)
-.xx "" "chmod \- change" "mode of file" "" chmod(2)
-.xx "" "frexp, ldexp," "modf \- split into mantissa and exponent" "" frexp(3)
-.xx "" "touch \- update date last" "modified of a file" "" touch(1)
-.xx "" "" "monitor \- prepare execution profile" "" monitor(3)
-.xx "" "" "moo \- guessing game" "" moo(6)
-.xx "" "mount, umount \-" "mount and dismount file system" "" mount(1)
-.xx "" "mount, umount \-" "mount or remove file system" "" mount(2)
-.xx "system" "" "mount, umount \- mount and dismount file" "" mount(1)
-.xx "" "" "mount, umount \- mount or remove file system" "" mount(2)
-.xx "" "mtab \-" "mounted file system table" "" mtab(5)
-.xx "integer/" "itom, madd, msub, mult, mdiv, min," "mout, pow, gcd, rpow \- multiple precision" "" mp(3)
-.xx "" "mv \-" "move or rename files and directories" "" mv(1)
-.xx "" "lseek, tell \-" "move read/write pointer" "" lseek(2)
-.xx "" "hp \- RH-11/RP04, RP05, RP06" "moving-head disk" "" hp(4)
-.xx "" "rp \- RP-11/RP03" "moving-head disk" "" rp(4)
-.xx "" "" "ms \- macros for formatting manuscripts" "" ms(7)
-.xx "\- multiple precision integer/" "itom, madd," "msub, mult, mdiv, min, mout, pow, gcd, rpow" "" mp(3)
-.xx "" "" "mtab \- mounted file system table" "" mtab(5)
-.xx "multiple precision integer/" "itom, madd, msub," "mult, mdiv, min, mout, pow, gcd, rpow \-" "" mp(3)
-.xx "" "" "mv \- move or rename files and directories" "" mv(1)
-.xx "" "getenv \- value for environment" "name" "" getenv(3)
-.xx "" "getlogin \- get login" "name" "" getlogin(3)
-.xx "" "mktemp \- make a unique file" "name" "" mktemp(3)
-.xx "" "pwd \- working directory" "name" "" pwd(1)
-.xx "" "tty \- get terminal" "name" "" tty(1)
-.xx "" "getpw \- get" "name from UID" "" getpw(3)
-.xx "" "nlist \- get entries from" "name list" "" nlist(3)
-.xx "" "nm \- print" "name list" "" nm(1)
-.xx "" "ttyname, isatty, ttyslot \- find" "name of a terminal" "" ttyname(3)
-.xx "" "terminals\- conventional" "names" "" term(7)
-.xx "" "ncheck \- generate" "names from i-numbers" "" ncheck(1)
-.xx "" "dumpdir \- print the" "names of files on a dump tape" "" dumpdir(1)
-.xx "" "" "ncheck \- generate names from i-numbers" "" ncheck(1)
-.xx "" "eqn," "neqn, checkeq \- typeset mathematics" "" eqn(1)
-.xx "" "creat \- create a" "new file" "" creat(2)
-.xx "" "arcv \- convert archives to" "new format" "" arcv(1)
-.xx "" "newgrp \- log in to a" "new group" "" newgrp(1)
-.xx "" "fork \- spawn" "new process" "" fork(2)
-.xx "" "" "newgrp \- log in to a new group" "" newgrp(1)
-.xx "trap,/" "/cd, eval, exec, exit, export, login," "newgrp, read, readonly, set, shift, times," "" sh(1)
-.xx "" "dbminit, fetch, store, delete, firstkey," "nextkey \- data base subroutines" "" dbm(3)
-.xx "" "" "nice \- set program priority" "" nice(2)
-.xx "" "" "nice, nohup \- run a command at low priority" "" nice(1)
-.xx "" "" "nlist \- get entries from name list" "" nlist(3)
-.xx "" "" "nm \- print name list" "" nm(1)
-.xx "" "clri \- clear i-" "node" "" clri(1)
-.xx "" "nice," "nohup \- run a command at low priority" "" nice(1)
-.xx "" "setjmp, longjmp \-" "non-local goto" "" setjmp(3)
-.xx "" "troff," "nroff \- text formatting and typesetting" "" troff(1)
-.xx "" "tbl \- format tables for" "nroff or troff" "" tbl(1)
-.xx "" "deroff \- remove" "nroff, troff, tbl and eqn constructs" "" deroff(1)
-.xx "" "" "null \- data sink" "" null(4)
-.xx "" "arithmetic \- provide drill in" "number facts" "" arithmetic(6)
-.xx "" "factor, primes \- factor a" "number, generate large primes" "" factor(1)
-.xx "" "rand, srand \- random" "number generator" "" rand(3)
-.xx "" "atof, atoi, atol \- convert ASCII to" "numbers" "" atof(3)
-.xx "" "\- introduction to system calls and error" "numbers" "intro, errno" intro(2)
-.xx "" "ncheck \- generate names from i-" "numbers" "" ncheck(1)
-.xx "" "size \- size of an" "object file" "" size(1)
-.xx "" "lorder \- find ordering relation for an" "object library" "" lorder(1)
-.xx "" "od \-" "octal dump" "" od(1)
-.xx "" "" "open \- open for reading or writing" "" open(2)
-.xx "" "fopen, freopen, fdopen \-" "open a stream" "" fopen(3)
-.xx "" "dup, dup2 \- duplicate an" "open file descriptor" "" dup(2)
-.xx "" "open \-" "open for reading or writing" "" open(2)
-.xx "" "plot:" "openpl et al. \- graphics interface" "" plot(3)
-.xx "" "strncpy, strlen, index, rindex \- string" "operations" "/strncat, strcmp, strncmp, strcpy," string(3)
-.xx "" "join \- relational database" "operator" "" join(1)
-.xx "" "stty \- set terminal" "options" "" stty(1)
-.xx "" "lorder \- find" "ordering relation for an object library" "" lorder(1)
-.xx "" "a.out \- assembler and link editor" "output" "" a.out(5)
-.xx "" "fread, fwrite \- buffered binary input/" "output" "" fread(3)
-.xx "" "ecvt, fcvt, gcvt \-" "output conversion" "" ecvt(3)
-.xx "" "printf, fprintf, sprintf \- formatted" "output conversion" "" printf(3)
-.xx "" "stdio \- standard buffered input/" "output package" "" stdio(3)
-.xx "" "chown \- change" "owner and group of a file" "" chown(2)
-.xx "" "chown, chgrp \- change" "owner or group" "" chown(1)
-.xx "" "quot \- summarize file system" "ownership" "" quot(1)
-.xx "" "pk \-" "packet driver" "" pk(4)
-.xx "" "pkopen, pkclose, pkread, pkwrite, pkfail \-" "packet driver simulator" "" pkopen(3)
-.xx "" "pkon, pkoff \- establish" "packet protocol" "" pkon(2)
-.xx "" "tk \-" "paginator for the Tektronix 4014" "" tk(1)
-.xx "" "" "passwd \- change login password" "" passwd(1)
-.xx "" "" "passwd \- password file" "" passwd(5)
-.xx "" "getpass \- read a" "password" "" getpass(3)
-.xx "" "passwd \- change login" "password" "" passwd(1)
-.xx "" "passwd \-" "password file" "" passwd(5)
-.xx "" "getpwuid, getpwnam, setpwent, endpwent \- get" "password file entry" "getpwent," getpwent(3)
-.xx "" "grep, egrep, fgrep \- search a file for a" "pattern" "" grep(1)
-.xx "" "awk \-" "pattern scanning and processing language" "" awk(1)
-.xx "" "" "pause \- stop until signal" "" pause(2)
-.xx "" "cc," "pcc \- C compiler" "" cc(1)
-.xx "" "popen," "pclose \- initiate I/O to/from a process" "" popen(3)
-.xx "" "mesg \-" "permit or deny messages" "" mesg(1)
-.xx "" "ptx \-" "permuted index" "" ptx(1)
-.xx "messages" "" "perror, sys_errlist, sys_nerr \- system error" "" perror(3)
-.xx "" "du, dp \- DU-11 201 data-" "phone interface" "" du(4)
-.xx "" "cat \-" "phototypesetter interface" "" cat(4)
-.xx "" "tc \-" "photypesetter simulator" "" tc(1)
-.xx "addresses" "" "phys \- allow a process to access physical" "" phys(2)
-.xx "" "" "pipe \- create an interprocess channel" "" pipe(2)
-.xx "" "tee \-" "pipe fitting" "" tee(1)
-.xx "" "" "pk \- packet driver" "" pk(4)
-.xx "driver simulator" "pkopen," "pkclose, pkread, pkwrite, pkfail \- packet" "" pkopen(3)
-.xx "" "pkon," "pkoff \- establish packet protocol" "" pkon(2)
-.xx "packet driver simulator" "" "pkopen, pkclose, pkread, pkwrite, pkfail \-" "" pkopen(3)
-.xx "" "" "plot \- graphics filters" "" plot(1)
-.xx "" "" "plot \- graphics interface" "" plot(5)
-.xx "" "" "plot: openpl et al. \- graphics interface" "" plot(3)
-.xx "" "vp \- Versatec printer-" "plotter" "" vp(4)
-.xx "" "lseek, tell \- move read/write" "pointer" "" lseek(2)
-.xx "process" "" "popen, pclose \- initiate I/O to/from a" "" popen(3)
-.xx "" "banner \- make long" "posters" "" banner(6)
-.xx "" "itom, madd, msub, mult, mdiv, min, mout," "pow, gcd, rpow \- multiple precision integer/" "" mp(3)
-.xx "square root" "exp, log, log10," "pow, sqrt \- exponential, logarithm, power," "" exp(3)
-.xx "" "bcd," "ppt \- convert to antique media" "" bcd(6)
-.xx "" "" "pr \- print file" "" pr(1)
-.xx "" "bc \- arbitrary-" "precision arithmetic language" "" bc(1)
-.xx "" "mdiv, min, mout, pow, gcd, rpow \- multiple" "precision integer arithmetic" "/msub, mult," mp(3)
-.xx "" "monitor \-" "prepare execution profile" "" monitor(3)
-.xx "" "lock \- lock a process in" "primary memory" "" lock(2)
-.xx "" "primes \- factor a number, generate large" "primes" "factor," factor(1)
-.xx "" "types \-" "primitive system data types" "" types(5)
-.xx "" "cat \- catenate and" "print" "" cat(1)
-.xx "" "date \-" "print and set the date" "" date(1)
-.xx "" "cal \-" "print calendar" "" cal(1)
-.xx "" "pr \-" "print file" "" pr(1)
-.xx "" "nm \-" "print name list" "" nm(1)
-.xx "" "man \-" "print sections of this manual" "" man(1)
-.xx "" "pstat \-" "print system facts" "" pstat(1)
-.xx "" "dumpdir \-" "print the names of files on a dump tape" "" dumpdir(1)
-.xx "" "vp \- Versatec" "printer-plotter" "" vp(4)
-.xx "conversion" "" "printf, fprintf, sprintf \- formatted output" "" printf(3)
-.xx "" "nice, nohup \- run a command at low" "priority" "" nice(1)
-.xx "" "nice \- set program" "priority" "" nice(2)
-.xx "" "boot \- startup" "procedures" "" boot(8)
-.xx "" "exit \- terminate" "process" "" exit(2)
-.xx "" "fork \- spawn new" "process" "" fork(2)
-.xx "" "kill \- send signal to a" "process" "" kill(2)
-.xx "" "popen, pclose \- initiate I/O to/from a" "process" "" popen(3)
-.xx "" "wait \- await completion of" "process" "" wait(1)
-.xx "" "init, rc \-" "process control initialization" "" init(8)
-.xx "" "getpid \- get" "process identification" "" getpid(2)
-.xx "" "lock \- lock a" "process in primary memory" "" lock(2)
-.xx "" "ps \-" "process status" "" ps(1)
-.xx "" "times \- get" "process times" "" times(2)
-.xx "" "phys \- allow a" "process to access physical addresses" "" phys(2)
-.xx "" "wait \- wait for" "process to terminate" "" wait(2)
-.xx "" "ptrace \-" "process trace" "" ptrace(2)
-.xx "" "kill \- terminate a" "process with extreme prejudice" "" kill(1)
-.xx "" "awk \- pattern scanning and" "processing language" "" awk(1)
-.xx "" "m4 \- macro" "processor" "" m4(1)
-.xx "" "" "prof \- display profile data" "" prof(1)
-.xx "" "" "profil \- execution time profile" "" profil(2)
-.xx "" "monitor \- prepare execution" "profile" "" monitor(3)
-.xx "" "profil \- execution time" "profile" "" profil(2)
-.xx "" "prof \- display" "profile data" "" prof(1)
-.xx "" "end, etext, edata \- last locations in" "program" "" end(3)
-.xx "" "units \- conversion" "program" "" units(1)
-.xx "" "cb \- C" "program beautifier" "" cb(1)
-.xx "" "make \- maintain" "program groups" "" make(1)
-.xx "" "nice \- set" "program priority" "" nice(2)
-.xx "" "assert \-" "program verification" "" assert(3)
-.xx "" "lint \- a C" "program verifier" "" lint(1)
-.xx "" "lex \- generator of lexical analysis" "programs" "" lex(1)
-.xx "" "struct \- structure Fortran" "programs" "" struct(1)
-.xx "" "pkon, pkoff \- establish packet" "protocol" "" pkon(2)
-.xx "" "arithmetic \-" "provide drill in number facts" "" arithmetic(6)
-.xx "" "true, false \-" "provide truth values" "" true(1)
-.xx "" "" "ps \- process status" "" ps(1)
-.xx "" "" "pstat \- print system facts" "" pstat(1)
-.xx "" "" "ptrace \- process trace" "" ptrace(2)
-.xx "" "" "ptx \- permuted index" "" ptx(1)
-.xx "" "ungetc \-" "push character back into input stream" "" ungetc(3)
-.xx "" "puts, fputs \-" "put a string on a stream" "" puts(3)
-.xx "" "putc, putchar, fputc, putw \-" "put character or word on a stream" "" putc(3)
-.xx "" "" "puts, fputs \- put a string on a stream" "" puts(3)
-.xx "" "putc, putchar, fputc," "putw \- put character or word on a stream" "" putc(3)
-.xx "" "" "pwd \- working directory name" "" pwd(1)
-.xx "" "" "qsort \- quicker sort" "" qsort(3)
-.xx "" "" "quiz \- test your knowledge" "" quiz(6)
-.xx "" "" "quot \- summarize file system ownership" "" quot(1)
-.xx "" "" "rand, srand \- random number generator" "" rand(3)
-.xx "" "" "ratfor \- rational Fortran dialect" "" ratfor(1)
-.xx "" "init," "rc \- process control initialization" "" init(8)
-.xx "" "" "read \- read from file" "" read(2)
-.xx "" "getpass \-" "read a password" "" getpass(3)
-.xx "" "read \-" "read from file" "" read(2)
-.xx "" "/cd, eval, exec, exit, export, login, newgrp," "read, readonly, set, shift, times, trap,/" "" sh(1)
-.xx "" "open \- open for" "reading or writing" "" open(2)
-.xx "" "/exec, exit, export, login, newgrp, read," "readonly, set, shift, times, trap, umask,/" "" sh(1)
-.xx "" "lseek, tell \- move" "read/write pointer" "" lseek(2)
-.xx "" "malloc, free," "realloc, calloc \- main memory allocator" "" malloc(3)
-.xx "" "mail \- send or" "receive mail among users" "" mail(1)
-.xx "" "utmp, wtmp \- login" "records" "" utmp(5)
-.xx "references in documents" "" "refer, lookbib \- find and insert literature" "" refer(1)
-.xx "" "comm \- select or" "reject lines common to two sorted files" "" comm(1)
-.xx "" "lorder \- find ordering" "relation for an object library" "" lorder(1)
-.xx "" "join \-" "relational database operator" "" join(1)
-.xx "" "strip \- remove symbols and" "relocation bits" "" strip(1)
-.xx "" "calendar \-" "reminder service" "" calendar(1)
-.xx "" "unlink \-" "remove directory entry" "" unlink(2)
-.xx "" "mount, umount \- mount or" "remove file system" "" mount(2)
-.xx "" "deroff \-" "remove nroff, troff, tbl and eqn constructs" "" deroff(1)
-.xx "" "strip \-" "remove symbols and relocation bits" "" strip(1)
-.xx "" "rm, rmdir \-" "remove (unlink) files" "" rm(1)
-.xx "" "mv \- move or" "rename files and directories" "" mv(1)
-.xx "" "uniq \- report" "repeated lines in a file" "" uniq(1)
-.xx "" "iostat \-" "report I/O statistics" "" iostat(1)
-.xx "" "uniq \-" "report repeated lines in a file" "" uniq(1)
-.xx "" "fseek, ftell, rewind \-" "reposition a stream" "" fseek(3)
-.xx "" "" "restor \- incremental file system restore" "" restor(1)
-.xx "" "" "rev \- reverse lines of a file" "" rev(1)
-.xx "" "reversi \- a game of dramatic" "reversals" "" reversi(6)
-.xx "" "col \- filter" "reverse line feeds" "" col(1)
-.xx "" "rev \-" "reverse lines of a file" "" rev(1)
-.xx "" "" "reversi \- a game of dramatic reversals" "" reversi(6)
-.xx "" "fseek, ftell," "rewind \- reposition a stream" "" fseek(3)
-.xx "" "" "rf \- RF11/RS11 fixed-head disk file" "" rf(4)
-.xx "" "hp \-" "RH-11/RP04, RP05, RP06 moving-head disk" "" hp(4)
-.xx "" "hs \-" "RH11/RS03-RS04 fixed-head disk file" "" hs(4)
-.xx "" "ht \-" "RH-11/TU-16 magtape interface" "" ht(4)
-.xx "" "strncmp, strcpy, strncpy, strlen, index," "rindex \- string operations" "/strncat, strcmp," string(3)
-.xx "" "" "rk \- RK-11/RK03 or RK05 disk" "" rk(4)
-.xx "" "" "rm, rmdir \- remove (unlink) files" "" rm(1)
-.xx "" "" "roff \- format text" "" roff(1)
-.xx "" "sqrt \- exponential, logarithm, power, square" "root" "exp, log, log10, pow," exp(3)
-.xx "" "" "rp \- RP-11/RP03 moving-head disk" "" rp(4)
-.xx "" "hp \- RH-11/" "RP04, RP05, RP06 moving-head disk" "" hp(4)
-.xx "" "rp \-" "RP-11/RP03 moving-head disk" "" rp(4)
-.xx "" "/madd, msub, mult, mdiv, min, mout, pow, gcd," "rpow \- multiple precision integer arithmetic" "" mp(3)
-.xx "" "hs \- RH11/" "RS03-RS04 fixed-head disk file" "" hs(4)
-.xx "" "rf \- RF11/" "RS11 fixed-head disk file" "" rf(4)
-.xx "" "nice, nohup \-" "run a command at low priority" "" nice(1)
-.xx "" "" "sa, accton \- system accounting" "" sa(1)
-.xx "" "brk," "sbrk, break \- change core allocation" "" brk(2)
-.xx "conversion" "" "scanf, fscanf, sscanf \- formatted input" "" scanf(3)
-.xx "" "awk \- pattern" "scanning and processing language" "" awk(1)
-.xx "" "alarm \-" "schedule signal after specified time" "" alarm(2)
-.xx "" "grep, egrep, fgrep \-" "search a file for a pattern" "" grep(1)
-.xx "" "xsend, xget, enroll \-" "secret mail" "" xsend(1)
-.xx "" "man \- print" "sections of this manual" "" man(1)
-.xx "" "" "sed \- stream editor" "" sed(1)
-.xx "files" "comm \-" "select or reject lines common to two sorted" "" comm(1)
-.xx "" "mail \-" "send or receive mail among users" "" mail(1)
-.xx "" "kill \-" "send signal to a process" "" kill(2)
-.xx "" "ascii \- map of ASCII character" "set" "" ascii(7)
-.xx "" "umask \-" "set file creation mode mask" "" umask(2)
-.xx "" "utime \-" "set file times" "" utime(2)
-.xx "" "nice \-" "set program priority" "" nice(2)
-.xx "" "/exit, export, login, newgrp, read, readonly," "set, shift, times, trap, umask, wait \-/" "" sh(1)
-.xx "" "stty \-" "set terminal options" "" stty(1)
-.xx "" "tabs \-" "set terminal tabs" "" tabs(1)
-.xx "" "date \- print and" "set the date" "" date(1)
-.xx "" "stime \-" "set time" "" stime(2)
-.xx "" "getty \-" "set typewriter mode" "" getty(8)
-.xx "" "setuid, setgid \-" "set user and group ID" "" setuid(2)
-.xx "" "" "setbuf \- assign buffering to a stream" "" setbuf(3)
-.xx "" "setuid," "setgid \- set user and group ID" "" setuid(2)
-.xx "" "getgrent, getgrgid, getgrnam," "setgrent, endgrent \- get group file entry" "" getgrent(3)
-.xx "" "" "setjmp, longjmp \- non-local goto" "" setjmp(3)
-.xx "" "crypt," "setkey, encrypt \- DES encryption" "" crypt(3)
-.xx "" "getpwent, getpwuid, getpwnam," "setpwent, endpwent \- get password file entry" "" getpwent(3)
-.xx "" "" "setuid, setgid \- set user and group ID" "" setuid(2)
-.xx "cd, eval, exec, exit, export, login, newgrp,/" "" "sh, for, case, if, while, break, continue," "" sh(1)
-.xx "" "system \- issue a" "shell command" "" system(3)
-.xx "" "/export, login, newgrp, read, readonly, set," "shift, times, trap, umask, wait \- command/" "" sh(1)
-.xx "" "login \-" "sign on" "" login(1)
-.xx "" "pause \- stop until" "signal" "" pause(2)
-.xx "" "" "signal \- catch or ignore signals" "" signal(2)
-.xx "" "alarm \- schedule" "signal after specified time" "" alarm(2)
-.xx "" "kill \- send" "signal to a process" "" kill(2)
-.xx "" "signal \- catch or ignore" "signals" "" signal(2)
-.xx "" "pkread, pkwrite, pkfail \- packet driver" "simulator" "pkopen, pkclose," pkopen(3)
-.xx "" "tc \- photypesetter" "simulator" "" tc(1)
-.xx "trigonometric functions" "" "sin, cos, tan, asin, acos, atan, atan2 \-" "" sin(3)
-.xx "" "" "sinh, cosh, tanh \- hyperbolic functions" "" sinh(3)
-.xx "" "null \- data" "sink" "" null(4)
-.xx "" "" "size \- size of an object file" "" size(1)
-.xx "" "" "sleep \- suspend execution for an interval" "" sleep(1)
-.xx "" "" "sleep \- suspend execution for interval" "" sleep(3)
-.xx "" "spline \- interpolate" "smooth curve" "" spline(1)
-.xx "" "qsort \- quicker" "sort" "" qsort(3)
-.xx "" "tsort \- topological" "sort" "" tsort(1)
-.xx "" "" "sort \- sort or merge files" "" sort(1)
-.xx "" "comm \- select or reject lines common to two" "sorted files" "" comm(1)
-.xx "" "look \- find lines in a" "sorted list" "" look(1)
-.xx "" "fork \-" "spawn new process" "" fork(2)
-.xx "" "alarm \- schedule signal after" "specified time" "" alarm(2)
-.xx "errors" "" "spell, spellin, spellout \- find spelling" "" spell(1)
-.xx "" "" "spline \- interpolate smooth curve" "" spline(1)
-.xx "" "" "split \- split a file into pieces" "" split(1)
-.xx "" "frexp, ldexp, modf \-" "split into mantissa and exponent" "" frexp(3)
-.xx "" "printf, fprintf," "sprintf \- formatted output conversion" "" printf(3)
-.xx "root" "exp, log, log10, pow," "sqrt \- exponential, logarithm, power, square" "" exp(3)
-.xx "" "rand," "srand \- random number generator" "" rand(3)
-.xx "" "scanf, fscanf," "sscanf \- formatted input conversion" "" scanf(3)
-.xx "" "stdio \-" "standard buffered input/output package" "" stdio(3)
-.xx "" "boot \-" "startup procedures" "" boot(8)
-.xx "" "" "stat, fstat \- get file status" "" stat(2)
-.xx "" "iostat \- report I/O" "statistics" "" iostat(1)
-.xx "" "ps \- process" "status" "" ps(1)
-.xx "" "stat, fstat \- get file" "status" "" stat(2)
-.xx "" "feof, ferror, clearerr, fileno \- stream" "status inquiries" "" ferror(3)
-.xx "package" "" "stdio \- standard buffered input/output" "" stdio(3)
-.xx "" "" "stime \- set time" "" stime(2)
-.xx "" "pause \-" "stop until signal" "" pause(2)
-.xx "" "icheck \- file system" "storage consistency check" "" icheck(1)
-.xx "subroutines" "dbminit, fetch," "store, delete, firstkey, nextkey \- data base" "" dbm(3)
-.xx "strncpy, strlen, index, rindex \- string/" "" "strcat, strncat, strcmp, strncmp, strcpy," "" string(3)
-.xx "" "fclose, fflush \- close or flush a" "stream" "" fclose(3)
-.xx "" "fopen, freopen, fdopen \- open a" "stream" "" fopen(3)
-.xx "" "fseek, ftell, rewind \- reposition a" "stream" "" fseek(3)
-.xx "" "fgetc, getw \- get character or word from" "stream" "getc, getchar," getc(3)
-.xx "" "gets, fgets \- get a string from a" "stream" "" gets(3)
-.xx "" "fputc, putw \- put character or word on a" "stream" "putc, putchar," putc(3)
-.xx "" "puts, fputs \- put a string on a" "stream" "" puts(3)
-.xx "" "setbuf \- assign buffering to a" "stream" "" setbuf(3)
-.xx "" "ungetc \- push character back into input" "stream" "" ungetc(3)
-.xx "" "sed \-" "stream editor" "" sed(1)
-.xx "" "feof, ferror, clearerr, fileno \-" "stream status inquiries" "" ferror(3)
-.xx "" "gets, fgets \- get a" "string from a stream" "" gets(3)
-.xx "" "puts, fputs \- put a" "string on a stream" "" puts(3)
-.xx "" "strcpy, strncpy, strlen, index, rindex \-" "string operations" "/strncat, strcmp, strncmp," string(3)
-.xx "" "" "strip \- remove symbols and relocation bits" "" strip(1)
-.xx "" "basename \-" "strip filename affixes" "" basename(1)
-.xx "" "/strncat, strcmp, strncmp, strcpy, strncpy," "strlen, index, rindex \- string operations" "" string(3)
-.xx "" "" "struct \- structure Fortran programs" "" struct(1)
-.xx "" "" "stty \- set terminal options" "" stty(1)
-.xx "" "ioctl," "stty, gtty \- control device" "" ioctl(2)
-.xx "" "" "su \- substitute user id temporarily" "" su(1)
-.xx "" "store, delete, firstkey, nextkey \- data base" "subroutines" "dbminit, fetch," dbm(3)
-.xx "" "su \-" "substitute user id temporarily" "" su(1)
-.xx "" "" "sum \- sum and count blocks in a file" "" sum(1)
-.xx "" "du \-" "summarize disk usage" "" du(1)
-.xx "" "quot \-" "summarize file system ownership" "" quot(1)
-.xx "" "sync \- update the" "super block" "" sync(1)
-.xx "" "update \- periodically update the" "super block" "" update(8)
-.xx "" "sync \- update" "super-block" "" sync(2)
-.xx "" "sleep \-" "suspend execution for an interval" "" sleep(1)
-.xx "" "sleep \-" "suspend execution for interval" "" sleep(3)
-.xx "" "" "swab \- swap bytes" "" swab(3)
-.xx "" "strip \- remove" "symbols and relocation bits" "" strip(1)
-.xx "" "" "sync \- update super-block" "" sync(2)
-.xx "" "" "sync \- update the super block" "" sync(1)
-.xx "messages" "perror," "sys_errlist, sys_nerr \- system error" "" perror(3)
-.xx "" "mtab \- mounted file system" "table" "" mtab(5)
-.xx "" "mkconf \- generate configuration" "tables" "" mkconf(1)
-.xx "" "tbl \- format" "tables for nroff or troff" "" tbl(1)
-.xx "" "tabs \- set terminal" "tabs" "" tabs(1)
-.xx "" "" "tail \- deliver the last part of a file" "" tail(1)
-.xx "functions" "sin, cos," "tan, asin, acos, atan, atan2 \- trigonometric" "" sin(3)
-.xx "" "sinh, cosh," "tanh \- hyperbolic functions" "" sinh(3)
-.xx "" "dumpdir \- print the names of files on a dump" "tape" "" dumpdir(1)
-.xx "" "tp \- manipulate" "tape archive" "" tp(1)
-.xx "" "tar \-" "tape archiver" "" tar(1)
-.xx "" "tp \- DEC/mag" "tape formats" "" tp(5)
-.xx "" "" "tar \- tape archiver" "" tar(1)
-.xx "" "" "tbl \- format tables for nroff or troff" "" tbl(1)
-.xx "" "deroff \- remove nroff, troff," "tbl and eqn constructs" "" deroff(1)
-.xx "" "" "tc \- photypesetter simulator" "" tc(1)
-.xx "" "" "tc \- TC-11/TU56 DECtape" "" tc(4)
-.xx "" "" "tee \- pipe fitting" "" tee(1)
-.xx "" "tk \- paginator for the" "Tektronix 4014" "" tk(1)
-.xx "" "lseek," "tell \- move read/write pointer" "" lseek(2)
-.xx "" "su \- substitute user id" "temporarily" "" su(1)
-.xx "" "ttyname, isatty, ttyslot \- find name of a" "terminal" "" ttyname(3)
-.xx "" "ttys \-" "terminal initialization data" "" ttys(5)
-.xx "" "tty \- general" "terminal interface" "" tty(4)
-.xx "" "tty \- get" "terminal name" "" tty(1)
-.xx "" "stty \- set" "terminal options" "" stty(1)
-.xx "" "tabs \- set" "terminal tabs" "" tabs(1)
-.xx "" "" "terminals\- conventional names" "" term(7)
-.xx "" "wait \- wait for process to" "terminate" "" wait(2)
-.xx "" "kill \-" "terminate a process with extreme prejudice" "" kill(1)
-.xx "" "exit \-" "terminate process" "" exit(2)
-.xx "" "" "test \- condition command" "" test(1)
-.xx "" "quiz \-" "test your knowledge" "" quiz(6)
-.xx "" "roff \- format" "text" "" roff(1)
-.xx "" "ed \-" "text editor" "" ed(1)
-.xx "" "troff, nroff \-" "text formatting and typesetting" "" troff(1)
-.xx "" "ttt, cubic \-" "tic-tac-toe" "" ttt(6)
-.xx "" "alarm \- schedule signal after specified" "time" "" alarm(2)
-.xx "" "at \- execute commands at a later" "time" "" at(1)
-.xx "" "stime \- set" "time" "" stime(2)
-.xx "" "time, ftime \- get date and" "time" "" time(2)
-.xx "" "" "time \- time a command" "" time(1)
-.xx "" "" "time, ftime \- get date and time" "" time(2)
-.xx "" "profil \- execution" "time profile" "" profil(2)
-.xx "" "gmtime, asctime, timezone \- convert date and" "time to ASCII" "ctime, localtime," ctime(3)
-.xx "" "times \- get process" "times" "" times(2)
-.xx "" "utime \- set file" "times" "" utime(2)
-.xx "" "" "times \- get process times" "" times(2)
-.xx "" "/login, newgrp, read, readonly, set, shift," "times, trap, umask, wait \- command language" "" sh(1)
-.xx "" "ctime, localtime, gmtime, asctime," "timezone \- convert date and time to ASCII" "" ctime(3)
-.xx "" "" "tk \- paginator for the Tektronix 4014" "" tk(1)
-.xx "" "" "tm \- TM-11/TU-10 magtape interface" "" tm(4)
-.xx "" "tsort \-" "topological sort" "" tsort(1)
-.xx "" "" "touch \- update date last modified of a file" "" touch(1)
-.xx "" "" "tp \- DEC/mag tape formats" "" tp(5)
-.xx "" "" "tp \- manipulate tape archive" "" tp(1)
-.xx "" "" "tr \- translate characters" "" tr(1)
-.xx "" "ptrace \- process" "trace" "" ptrace(2)
-.xx "" "tr \-" "translate characters" "" tr(1)
-.xx "" "newgrp, read, readonly, set, shift, times," "trap, umask, wait \- command language" "/login," sh(1)
-.xx "" "sin, cos, tan, asin, acos, atan, atan2 \-" "trigonometric functions" "" sin(3)
-.xx "" "tbl \- format tables for nroff or" "troff" "" tbl(1)
-.xx "typesetting" "" "troff, nroff \- text formatting and" "" troff(1)
-.xx "" "deroff \- remove nroff," "troff, tbl and eqn constructs" "" deroff(1)
-.xx "" "" "true, false \- provide truth values" "" true(1)
-.xx "" "" "tsort \- topological sort" "" tsort(1)
-.xx "" "" "ttt, cubic \- tic-tac-toe" "" ttt(6)
-.xx "" "" "tty \- general terminal interface" "" tty(4)
-.xx "" "" "tty \- get terminal name" "" tty(1)
-.xx "terminal" "" "ttyname, isatty, ttyslot \- find name of a" "" ttyname(3)
-.xx "" "" "ttys \- terminal initialization data" "" ttys(5)
-.xx "" "ttyname, isatty," "ttyslot \- find name of a terminal" "" ttyname(3)
-.xx "" "tm \- TM-11/" "TU-10 magtape interface" "" tm(4)
-.xx "" "ht \- RH-11/" "TU-16 magtape interface" "" ht(4)
-.xx "" "tc \- TC-11/" "TU56 DECtape" "" tc(4)
-.xx "" "file \- determine file" "type" "" file(1)
-.xx "" "types \- primitive system data" "types" "" types(5)
-.xx "" "man \- macros to" "typeset manual" "" man(7)
-.xx "" "eqn, neqn, checkeq \-" "typeset mathematics" "" eqn(1)
-.xx "" "troff, nroff \- text formatting and" "typesetting" "" troff(1)
-.xx "" "getty \- set" "typewriter mode" "" getty(8)
-.xx "" "getpw \- get name from" "UID" "" getpw(3)
-.xx "" "" "umask \- set file creation mode mask" "" umask(2)
-.xx "" "read, readonly, set, shift, times, trap," "umask, wait \- command language" "/newgrp," sh(1)
-.xx "" "mount," "umount \- mount and dismount file system" "" mount(1)
-.xx "" "mount," "umount \- mount or remove file system" "" mount(2)
-.xx "stream" "" "ungetc \- push character back into input" "" ungetc(3)
-.xx "" "" "uniq \- report repeated lines in a file" "" uniq(1)
-.xx "" "mktemp \- make a" "unique file name" "" mktemp(3)
-.xx "" "" "units \- conversion program" "" units(1)
-.xx "" "cu \- call" "UNIX" "" cu(1)
-.xx "" "uux \- unix to" "unix command execution" "" uux(1)
-.xx "" "uucp, uulog \- unix to" "unix copy" "" uucp(1)
-.xx "" "uux \-" "unix to unix command execution" "" uux(1)
-.xx "" "uucp, uulog \-" "unix to unix copy" "" uucp(1)
-.xx "" "" "unlink \- remove directory entry" "" unlink(2)
-.xx "" "rm, rmdir \- remove (" "unlink) files" "" rm(1)
-.xx "" "" "update \- periodically update the super block" "" update(8)
-.xx "" "touch \-" "update date last modified of a file" "" touch(1)
-.xx "" "sync \-" "update super-block" "" sync(2)
-.xx "" "sync \-" "update the super block" "" sync(1)
-.xx "" "update \- periodically" "update the super block" "" update(8)
-.xx "" "du \- summarize disk" "usage" "" du(1)
-.xx "" "write \- write to another" "user" "" write(1)
-.xx "" "setuid, setgid \- set" "user and group ID" "" setuid(2)
-.xx "" "getuid, getgid, geteuid, getegid \- get" "user and group identity" "" getuid(2)
-.xx "" "environ \-" "user environment" "" environ(5)
-.xx "" "su \- substitute" "user id temporarily" "" su(1)
-.xx "" "mail \- send or receive mail among" "users" "" mail(1)
-.xx "" "wall \- write to all" "users" "" wall(1)
-.xx "" "" "utime \- set file times" "" utime(2)
-.xx "" "" "utmp, wtmp \- login records" "" utmp(5)
-.xx "" "" "uucp, uulog \- unix to unix copy" "" uucp(1)
-.xx "" "" "uux \- unix to unix command execution" "" uux(1)
-.xx "" "abs \- integer absolute" "value" "" abs(3)
-.xx "" "fabs, floor, ceil \- absolute" "value, floor, ceiling functions" "" floor(3)
-.xx "" "getenv \-" "value for environment name" "" getenv(3)
-.xx "" "true, false \- provide truth" "values" "" true(1)
-.xx "" "assert \- program" "verification" "" assert(3)
-.xx "" "lint \- a C program" "verifier" "" lint(1)
-.xx "" "vp \-" "Versatec printer-plotter" "" vp(4)
-.xx "" "filsys, flblk, ino \- format of file system" "volume" "" filsys(5)
-.xx "" "" "vp \- Versatec printer-plotter" "" vp(4)
-.xx "" "" "wait \- await completion of process" "" wait(1)
-.xx "" "readonly, set, shift, times, trap, umask," "wait \- command language" "/newgrp, read," sh(1)
-.xx "" "" "wait \- wait for process to terminate" "" wait(2)
-.xx "" "" "wall \- write to all users" "" wall(1)
-.xx "" "" "wc \- word count" "" wc(1)
-.xx "" "crash \-" "what to do when the system crashes" "" crash(8)
-.xx "export, login, newgrp,/" "sh, for, case, if," "while, break, continue, cd, eval, exec, exit," "" sh(1)
-.xx "" "" "who \- who is on the system" "" who(1)
-.xx "" "wc \-" "word count" "" wc(1)
-.xx "" "getchar, fgetc, getw \- get character or" "word from stream" "getc," getc(3)
-.xx "" "hangman, words \-" "word games" "" words(6)
-.xx "" "putchar, fputc, putw \- put character or" "word on a stream" "putc," putc(3)
-.xx "" "hangman," "words \- word games" "" words(6)
-.xx "" "cd \- change" "working directory" "" cd(1)
-.xx "" "pwd \-" "working directory name" "" pwd(1)
-.xx "" "" "write \- write on a file" "" write(2)
-.xx "" "" "write \- write to another user" "" write(1)
-.xx "" "write \-" "write on a file" "" write(2)
-.xx "" "lseek, tell \- move read/" "write pointer" "" lseek(2)
-.xx "" "wall \-" "write to all users" "" wall(1)
-.xx "" "write \-" "write to another user" "" write(1)
-.xx "" "open \- open for reading or" "writing" "" open(2)
-.xx "" "utmp," "wtmp \- login records" "" utmp(5)
-.xx "" "" "wump \- the game of hunt-the-wumpus" "" wump(6)
-.xx "" "xsend," "xget, enroll \- secret mail" "" xsend(1)
-.xx "" "j0, j1, jn," "y0, y1, yn \- bessel functions" "" j0(3)
-.xx "" "" "yacc \- yet another compiler-compiler" "" yacc(1)
diff --git a/.ref-Research-V7/usr/man/man0/pref b/.ref-Research-V7/usr/man/man0/pref
deleted file mode 100644 (file)
index 090cafe..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-.TL
-PREFACE
-.LP
-Although this Seventh Edition no longer bears their byline,
-Ken Thompson and Dennis Ritchie remain the fathers
-and preceptors of the
-.UX
-time-sharing system.
-Many of the improvements here described bear their mark.
-Among many, many other people who have contributed to
-the further flowering of
-\s-2UNIX\s0,
-we wish especially to
-acknowledge the contributions of
-A. V. Aho,
-S. R. Bourne,
-L. L. Cherry,
-G. L. Chesson,
-S. I. Feldman,
-C. B. Haley,
-R. C. Haight,
-S. C. Johnson,
-M. E. Lesk,
-T. L. Lyon,
-L. E. McMahon,
-R. Morris,
-R. Muha,
-D. A. Nowitz,
-L. Wehr,
-and
-P. J. Weinberger.
-We appreciate also 
-the effective advice and criticism of
-T. A. Dolotta,
-A. G. Fraser,
-J. F. Maranzano,
-and
-J. R. Mashey;
-and we remember the important work of
-the late Joseph F. Ossanna.
-.sp 2
-.in 4i
-B. W. Kernighan
-.br
-M. D. McIlroy
-.in 0
diff --git a/.ref-Research-V7/usr/man/man0/ptxmac b/.ref-Research-V7/usr/man/man0/ptxmac
deleted file mode 100644 (file)
index 4d4d929..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-.de xx
-.if !""\\$1" \\$1\fI\a\fR\\$2\t\\$3\fI\a\fR\t\\$5
-.if !""\\$4" \t\\$2\t\\$3\fI\a\fR\\$4\t\\$5
-.if ""\\$1\\$4" \t\\$2\t\\$3\fI\a\fR\t\\$5
-..
-.cs I 30
-.TL
-PERMUTED INDEX
-.LP
-.SM
-.nr VS 9
-.vs \n(VSp
-.nf
-.ta 2.7iR 2.85iL 5.65iR 6.5iR
-.af PN i
-.pn 9
diff --git a/.ref-Research-V7/usr/man/man0/title b/.ref-Research-V7/usr/man/man0/title
deleted file mode 100644 (file)
index 6ec0ce6..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-.de pg
-.ps8
---
-.ps16
-.fp 3 G
-.sp 3.0i
-.ti .25i
-UNIX\s-4\fG\v'-6p'TM\v'6p'\fP\s0 TIME-SHARING SYSTEM:
-.sp |4.0i
-.ps 18
-.ce
-UNIX PROGRAMMER'S MANUAL
-.ps12
-.sp |4.5i
-.ft I
-.ce
-Seventh Edition, Volume \\$1
-.sp |5.0i
-.ce
-January, 1979
-.ps 10
-.sp |9.5i-1
-.ft R
-.ce
-Bell Telephone Laboratories, Incorporated
-.ce
-Murray Hill, New Jersey
-..
-.pg 1
-.bp
-.pg 2A
-.bp
-.pg 2B
diff --git a/.ref-Research-V7/usr/man/man0/xx b/.ref-Research-V7/usr/man/man0/xx
deleted file mode 100644 (file)
index 228de3d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.TH NAME SECTION local
-.SH NAME
-.SH SYNOPSIS
-.SH DESCRIPTION
-.SH FILES
-.SH SEE ALSO
-.SH DIAGNOSTICS
-.SH BUGS
diff --git a/.ref-Research-V7/usr/man/man1/ac.1m b/.ref-Research-V7/usr/man/man1/ac.1m
deleted file mode 100644 (file)
index 73bf29a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-.TH AC 1M 
-.SH NAME
-ac \- login accounting
-.SH SYNOPSIS
-.B ac
-[
-.B \-w
-wtmp ] [
-.B \-p
-] [
-.B \-d
-] [ people ] ...
-.SH DESCRIPTION
-.I Ac
-produces a printout giving
-connect time
-for each user who has logged in
-during the life of the current
-.I wtmp
-file.
-A total is also produced.
-.B \-w
-is used to specify an alternate
-.IR wtmp ""
-file.
-.B \-p
-prints individual totals; without this option,
-only totals are printed.
-.B \-d
-causes a printout for each midnight to midnight
-period.
-Any
-.I people
-will limit the
-printout to only the specified login names.
-If no
-.IR wtmp ""
-file is given,
-.I /usr/adm/wtmp
-is used.
-.PP
-The accounting file
-.I /usr/adm/wtmp
-is maintained by
-.I init
-and
-.I login.
-Neither of these programs creates the file,
-so if it does not exist
-no connect-time accounting is done.
-To start accounting, it should be created with length 0.
-On the other hand if the file is left undisturbed it will
-grow without bound, so periodically any information
-desired should be collected and the file truncated.
-.SH FILES
-/usr/adm/wtmp
-.SH "SEE ALSO"
-init(8), login(1), utmp(5).
diff --git a/.ref-Research-V7/usr/man/man1/adb.1 b/.ref-Research-V7/usr/man/man1/adb.1
deleted file mode 100644 (file)
index 6e032c3..0000000
+++ /dev/null
@@ -1,895 +0,0 @@
-.ds TW \v'.25m'\s+2~\s-2\v'-.25m'
-.ds ST \v'.25m'*\v'-.25m'
-.ds IM \v'.1m'=\v'-.1m'\s-2\h'-.1m'>\h'.1m'\s+2
-.ds LE \(<=
-.ds LT \s-2<\s+2
-.ds GT \s-2>\s+2
-.TH ADB 1 
-.SH NAME
-adb \- debugger
-.SH SYNOPSIS
-.B adb
-[\fB\-w\fR] [ objfil [ corfil ] ]
-.SH DESCRIPTION
-.I Adb
-is a general purpose debugging program.
-It may be used to examine files and to provide
-a controlled environment for the execution
-of UNIX programs.
-.PP
-.I Objfil
-is normally an executable program file, preferably
-containing a symbol table;
-if not then the
-symbolic features of
-.I  adb
-cannot be used although the file can still
-be examined.
-The default for
-.I objfil
-is
-.B  a.out.
-.I Corfil
-is assumed to be a core image file produced after
-executing
-.IR objfil ;
-the default for
-.I corfil
-is
-.B  core.
-.PP
-Requests to
-.I  adb
-are read from the standard input and
-responses are to the standard output.
-If the
-.B  \-w
-flag is present then both
-.I  objfil
-and
-.I corfil
-are
-created if necessary and
-opened for reading and writing
-so that files can be modified using
-.IR adb .
-.I Adb
-ignores QUIT; INTERRUPT
-causes return to the next
-.I adb
-command.
-.PP
-In general requests to
-.I  adb
-are of the form
-.PP
-.if n .ti 16
-.if t .ti 1.6i
-[\|\fIaddress\fR\|]  [\|,
-.IR count \|]
-[\|\fIcommand\fR\|] [\|;\|]
-.PP
-If
-.I address
-is present then
-.I  dot
-is set to
-.IR address .
-Initially
-.I dot
-is set to 0.
-For most commands
-.I count
-specifies how many times
-the command will be executed.
-The default
-.I count
-is 1.
-.I Address
-and
-.I count
-are expressions.
-.PP
-The interpretation of an address depends
-on the context it is used in.
-If a subprocess is being debugged then
-addresses are interpreted
-in the usual way in the address space of the subprocess.
-For further details of address mapping see
-.SM ADDRESSES.
-.SH EXPRESSIONS
-.TP 7.2n
-.B .
-The value of
-.IR dot .
-.TP 7.2n
-+
-The value of
-.I dot
-incremented by the current increment.
-.TP 7.2n
-^
-The value of
-.I dot
-decremented by the current increment.
-.TP 7.2n
-"
-The last
-.I address
-typed.
-.TP 7.2n
-.I integer
-An octal number if
-.I integer
-begins with a 0;
-a hexadecimal number if preceded by
-.BR # ;
-otherwise a decimal number.
-.TP 7.2n
-.IB integer . fraction
-A 32 bit floating point number.
-.TP 7.2n
-.I \'cccc\|\'
-The ASCII value of up to 4 characters.
-\\ may be used to escape a \'.
-.TP 7.2n
-.I \*(LT name
-The value of
-.IR name ,
-which is either a variable name or a register name.
-.I Adb
-maintains a number of variables
-(see
-.SM VARIABLES\*S)
-named by single letters or digits.
-If
-.I name
-is a register name then
-the value of the register is obtained from
-the system header in
-.IR corfil .
-The register names are
-.BR "r0 ... r5 sp pc ps" "."
-.TP 7.2n
-.I symbol
-A
-.I symbol
-is a sequence
-of upper or lower case letters, underscores or
-digits, not starting with a digit.
-.BR \\ " may be used to escape other characters."
-The value of the
-.I symbol
-is taken from the symbol table
-in
-.IR objfil .
-An initial \_ or \*(TW will be prepended to
-.I symbol
-if needed.
-.TP
-.I _ symbol
-In C, the `true name' of an external symbol begins with _.
-It may be necessary to utter this name to disinguish it
-from internal or hidden variables of a program.
-.TP 7.2n
-.IB routine . name
-The address of the variable
-.I name
-in the specified
-C routine.
-Both
-.I routine
-and
-.I name
-are
-.IR symbols .
-If
-.I name
-is omitted the value is the address of the
-most recently activated C stack frame
-corresponding to
-.IR routine .
-.TP 7.2n
-.RI ( exp \|)
-The value of the expression
-.IR exp .
-.LP
-.SM
-.B  "Monadic\ operators"
-.TP 7.2n
-.RI \*(ST exp
-The contents of the location addressed
-by
-.I exp
-in
-.IR corfil .
-.TP 7.2n
-.RI @ exp
-The contents of the location addressed by
-.I exp
-in
-.IR objfil .
-.TP 7.2n
-.RI \- exp
-Integer negation.
-.TP 7.2n
-.RI \*(TW exp
-Bitwise complement.
-.LP
-.B  "Dyadic\ operators"
-are left associative
-and are less binding than monadic operators.
-.TP 7.2n
-.IR e1 + e2
-Integer addition.
-.TP 7.2n
-.IR e1 \- e2
-Integer subtraction.
-.TP 7.2n
-.IR e1 \*(ST e2
-Integer multiplication.
-.TP 7.2n
-.IR e1 % e2
-Integer division.
-.TP 7.2n
-.IR e1 & e2
-Bitwise conjunction.
-.TP 7.2n
-.IR e1 \(bv e2
-Bitwise disjunction.
-.TP 7.2n
-.IR e1 # e2
-.I E1
-rounded up to the next multiple of
-.IR e2 .
-.DT
-.SH COMMANDS
-Most commands consist of a verb followed by a modifier or list
-of modifiers.
-The following verbs are available.
-(The commands `?' and `/' may be followed by `\*(ST';
-see
-.SM ADDRESSES
-for further details.)
-.TP .5i
-.RI ? f
-Locations starting at
-.I address
-in
-.I  objfil
-are printed according to the format
-.IR f .
-.TP
-.RI / f
-Locations starting at
-.I address
-in
-.I  corfil
-are printed according to the format
-.IR f .
-.TP
-.RI  = f
-The value of
-.I address
-itself is printed in the
-styles indicated by the format
-.IR f .
-(For
-.B i 
-format `?' is printed for the parts of the instruction that reference
-subsequent words.)
-.PP
-A
-.I format
-consists of one or more characters that specify a style
-of printing.
-Each format character may be preceded by a decimal integer
-that is a repeat count for the format character.
-While stepping through a format
-.I dot
-is incremented temporarily
-by the amount given for each format letter.
-If no format is given then the last format is used.
-The format letters available are as follows.
-.ta 2.5n .5i
-.RS
-.TP
-.BR o "        2"
-Print 2 bytes in octal.
-All octal numbers output by
-.I adb
-are preceded by 0.
-.br
-.ns
-.TP
-.BR O "        4"
-Print 4 bytes in octal.
-.br
-.ns
-.TP
-.BR q "        2"
-Print in signed octal.
-.br
-.ns
-.TP
-.BR Q "        4"
-Print long signed octal.
-.br
-.ns
-.TP
-.BR d "        2"
-Print in decimal.
-.br
-.ns
-.TP
-.BR D "        4"
-Print long decimal.
-.br
-.ns
-.TP
-.BR x "        2"
-Print 2 bytes in hexadecimal.
-.br
-.ns
-.TP
-.BR X "        4"
-Print 4 bytes in hexadecimal.
-.br
-.ns
-.TP
-.BR u "        2"
-Print as an unsigned decimal number.
-.br
-.ns
-.TP
-.BR U "        4"
-Print long unsigned decimal.
-.br
-.ns
-.TP
-.BR f "        4"
-Print the 32 bit value
-as a floating point number.
-.br
-.ns
-.TP
-.BR F "        8"
-Print double floating point.
-.br
-.ns
-.TP
-.BR b "        1"
-Print the addressed byte in octal.
-.br
-.ns
-.TP
-.BR c "        1"
-Print the addressed character.
-.br
-.ns
-.TP
-.BR C "        1"
-Print the addressed character using
-the following escape convention.
-Character values 000 to 040 are printed as @ followed by the corresponding
-character in the range 0100 to 0140.
-The character @ is printed as @@.
-.br
-.ns
-.TP
-.BI s "        n"
-Print the addressed characters until a zero character
-is reached.
-.br
-.ns
-.TP
-.BI S "        n"
-Print a string using 
-the @ escape convention.
-.I n
-is the length of the string including its zero terminator.
-.br
-.ns
-.TP
-.BR Y "        4"
-Print 4 bytes in date format (see
-.IR ctime (3)).
-.br
-.ns
-.TP
-.BR i "        n"
-Print as PDP11 instructions.
-.I n
-is the number of bytes occupied by the instruction.
-This style of printing causes variables 1 and 2 to be set
-to the offset parts of the source and destination respectively.
-.br
-.ns
-.TP
-.BR a "        0"
-Print the value of
-.I dot
-in symbolic form.
-Symbols are checked to ensure that they have an appropriate
-type as indicated below.
-.LP
-       /       local or global data symbol
-.br
-       ?       local or global text symbol
-.br
-       =       local or global absolute symbol
-.TP
-.BR p "        2"
-Print the addressed value in symbolic form using
-the same rules for symbol lookup as
-.BR a .
-.br
-.ns
-.TP
-.BR t "        0"
-When preceded by an integer tabs to the next
-appropriate tab stop.
-For example,
-.B 8t 
-moves to the next 8-space tab stop.
-.br
-.ns
-.TP
-.BR r "        0"
-Print a space.
-.br
-.ns
-.TP
-.BR n "        0"
-Print a newline.
-.br
-.ns
-.tr '"
-.TP
-.BR '...' " 0"
-Print the enclosed string.
-.br
-.tr ''
-.br
-.ns
-.TP
-.B ^
-.I Dot
-is decremented by the current increment.
-Nothing is printed.
-.br
-.ns
-.TP
-+
-.I Dot
-is incremented by 1.
-Nothing is printed.
-.br
-.ns
-.TP
-\-
-.I Dot
-is decremented by 1.
-Nothing is printed.
-.RE
-.TP
-newline
-If the previous command temporarily incremented
-.IR dot ,
-make the increment permanent.
-Repeat the previous command with a
-.I count
-of 1.
-.TP
-.RB [ ?/ ] l "\fI value mask\fR"
-Words starting at
-.I  dot
-are masked with
-.I mask
-and compared with
-.I value
-until
-a match is found.
-If
-.B L
-is used then the match is for 4 bytes at a time instead of 2.
-If no match is found then
-.I dot
-is unchanged; otherwise
-.I dot
-is set to the matched location.
-If
-.I mask
-is omitted then \-1 is used.
-.TP
-.RB [ ?/ ] w "\fI value ...\fR"
-Write the 2-byte
-.I value
-into the addressed
-location.
-If the command is
-.BR W ,
-write 4 bytes.
-Odd addresses are not allowed when writing to the subprocess
-address space.
-.TP
-[\fB?/\fR]\fBm\fI b1 e1 f1\fR[\fB?/\fR]
-.br
-New values for
-.RI ( b1,\ e1,\ f1 )
-are recorded.
-If less than three expressions are given then
-the remaining map parameters are left unchanged.
-If the `?' or `/' is followed by `\*(ST' then
-the second segment (\fIb2\fR\|,\|\fIe2\fR\|,\|\fIf2\fR)
-of the mapping is changed.
-If the list is terminated by `?' or `/' then the file
-(\fIobjfil\fR or
-.I corfil
-respectively) is used
-for subsequent requests.
-(So that, for example, `/m?' will cause `/' to refer to
-.IR objfil .)
-.TP
-.BI \*(GT name
-.I Dot
-is assigned to the variable or register named.
-.TP
-.B !
-A shell is called to read the
-rest of the line following `!'.
-.TP
-.RI $ modifier
-Miscellaneous commands.
-The available 
-.I modifiers 
-are:
-.RS
-.TP
-.BI < f
-Read commands from the file
-.I f
-and return.
-.br
-.ns
-.TP
-.BI > f
-Send output to the file
-.I  f,
-which is created if it does not exist.
-.br
-.ns
-.TP
-.B r
-Print the general registers and
-the instruction addressed by
-.BR pc .
-.I Dot
-is set to \fBpc\fR.
-.br
-.ns
-.TP
-.B f
-Print the floating registers in
-single or double length.
-If the floating point status of
-.B ps
-is set to double (0200 bit)
-then double length is used anyway.
-.br
-.ns
-.TP
-.B b
-Print all breakpoints
-and their associated counts and commands.
-.br
-.ns
-.TP
-.B a
-ALGOL 68 stack backtrace.
-If
-.I address
-is given then it is taken to be the
-address of the current frame (instead of
-.BR r4 ).
-If
-.I count
-is given then only the first
-.I count
-frames are printed.
-.br
-.ns
-.TP
-.B c
-C stack backtrace.
-If
-.I address
-is given then it is taken as the
-address of the current frame (instead of
-.BR r5 ).
-If
-.B C 
-is used then the names and (16 bit) values of all automatic
-and static variables are printed for each active function.
-If
-.I count
-is given then only the first
-.I count
-frames are printed.
-.br
-.ns
-.TP
-.B e
-The names and values of
-external variables are printed.
-.br
-.ns
-.TP
-.B w
-Set the page width for output to
-.I address
-(default 80).
-.br
-.ns
-.TP
-.B s
-Set the limit for symbol matches to
-.I address
-(default 255).
-.br
-.ns
-.TP
-.B o
-All integers input are regarded as octal.
-.br
-.ns
-.TP
-.B d
-Reset integer input as described in
-.SM EXPRESSIONS.
-.br
-.ns
-.TP
-.B q
-Exit from
-.IR adb .
-.br
-.ns
-.TP
-.B v
-Print all non zero variables in octal.
-.br
-.ns
-.TP
-.B m
-Print the address map.
-.RE
-.TP
-.BI : modifier
-Manage a subprocess.
-Available modifiers are:
-.RS
-.TP
-.BI b c
-Set breakpoint at
-.IR address .
-The breakpoint is executed
-.IR count \-1
-times before
-causing a stop.
-Each time the breakpoint is encountered
-the command
-.I c
-is executed.
-If this command sets
-.I dot
-to zero
-then the breakpoint causes a stop.
-.TP
-.B d
-Delete breakpoint at
-.IR address .
-.TP
-.B r
-Run
-.I objfil
-as a subprocess.
-If
-.I address
-is given explicitly then the
-program is entered at this point; otherwise
-the program is entered at its standard entry point.
-.I count
-specifies how many breakpoints are to be
-ignored before stopping.
-Arguments to the subprocess may be supplied on the
-same line as the command.
-An argument starting with < or > causes the standard
-input or output to be established for the command.
-All signals are turned on on entry to the subprocess.
-.TP
-.BI c s
-The subprocess is continued
-with signal
-.I s
-c
-.I s,
-see
-.IR signal (2).
-If
-.I address
-is given then the subprocess
-is continued at this address.
-If no signal is specified then the signal
-that caused the subprocess to stop is sent.
-Breakpoint skipping is the same
-as for
-.BR r .
-.TP
-.BI s s
-As for
-.B c 
-except that
-the subprocess is single stepped
-.I count
-times.
-If there is no current subprocess then
-.I objfil
-is run
-as a subprocess as for
-.BR r .
-In this case no signal can be sent; the remainder of the line
-is treated as arguments to the subprocess.
-.TP
-.B k
-The current subprocess, if any, is terminated.
-.RE
-.SH VARIABLES
-.I Adb
-provides a number of variables.
-Named variables are set initially by
-.I  adb
-but are not used subsequently.
-Numbered variables are reserved for communication
-as follows.
-.TP
-0
-The last value printed.
-.br
-.ns
-.TP
-1
-The last offset part of an instruction source.
-.br
-.ns
-.TP
-2
-The previous value of variable 1.
-.PP
-On entry the following are set
-from the system header in the
-.IR corfil .
-If
-.I corfil
-does not appear to be a
-.B core 
-file then
-these values are set from
-.IR objfil .
-.TP
-b
-The base address of the data segment.
-.br
-.ns
-.TP
-d
-The data segment size.
-.br
-.ns
-.TP
-e
-The entry point.
-.br
-.ns
-.TP
-m
-The `magic' number (0405, 0407, 0410 or 0411).
-.br
-.ns
-.TP
-s
-The stack segment size.
-.br
-.ns
-.TP
-t
-The text segment size.
-.SH ADDRESSES
-The address in a file associated with
-a written address is determined by a mapping
-associated with that file.
-Each mapping is represented by two triples
-.RI ( "b1, e1, f1" )
-and
-.RI ( "b2, e2, f2" )
-and the
-.I file address
-corresponding to a written
-.I address
-is calculated as follows.
-.PP
-.if t .ti 1.5i
-.if n .ti 8
-.IR b1 \*(LE address < e1
-\*(IM
-.IR "file address" = address + f1\-b1,
-otherwise,
-.PP
-.if t .ti 1.5i
-.if n .ti 8
-.IR b2 \*(LE address < e2
-\*(IM
-.IR "file address" = address + f2\-b2,
-.PP
-otherwise, the requested
-.I address
-is not legal.
-In some cases (e.g. for programs with separated I and D
-space) the two segments for a file may overlap.
-If a
-.B ? 
-or
-.B / 
-is followed by an
-.B \*(ST 
-then only the second
-triple is used.
-.PP
-The initial setting of both mappings is suitable for
-normal
-.B a.out 
-and
-.B core 
-files.
-If either file is not of the kind expected then, for that file,
-.I b1
-is set to 0,
-.I e1
-is set to
-the maximum file size
-and
-.I f1
-is set to 0; in this way the whole
-file can be examined with no address translation.
-.PP
-So that
-.I adb
-may be used on large files
-all appropriate values are kept as signed 32 bit integers.
-.SH FILES
-/dev/mem
-.br
-/dev/swap
-.br
-a.out
-.br
-core
-.SH SEE\ ALSO
-ptrace(2),
-a.out(5),
-core(5)
-.SH DIAGNOSTICS
-`Adb' when there is no current command or format.
-Comments about inaccessible files, syntax errors,
-abnormal termination of commands, etc.
-Exit status is 0, unless last command failed or
-returned nonzero status.
-.SH BUGS
-A breakpoint set at the entry point is not effective
-on initial entry to the program.
-.br
-When single stepping, system calls do not count as an
-executed instruction.
-.br
-Local variables whose names are the same as an external
-variable may foul up the accessing of the external.
diff --git a/.ref-Research-V7/usr/man/man1/ar.1 b/.ref-Research-V7/usr/man/man1/ar.1
deleted file mode 100644 (file)
index fd1426f..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-.TH AR 1 
-.SH NAME
-ar \- archive and library maintainer
-.SH SYNOPSIS
-.B ar
-key [ posname ] afile name ...
-.SH DESCRIPTION
-.I Ar
-maintains groups of files
-combined into a single archive file.
-Its main use
-is to create and update library files as used by the loader.
-It can be used, though, for any similar purpose.
-.PP
-.I Key
-is one character from the set
-.B drqtpmx,
-optionally concatenated with
-one or more of
-.B vuaibcl.
-.I Afile
-is the archive file.
-The
-.I names
-are constituent files in the archive file.
-The meanings of the
-.I key
-characters are:
-.TP
-.B d
-Delete the named files from the archive file.
-.TP
-.B r
-Replace the named files in the archive file.
-If the optional character
-.B u
-is used with
-.B r,
-then only those files with
-modified dates later than
-the archive files are replaced.
-If an optional positioning character from the set
-.B abi
-is used, then the
-.I posname
-argument must be present
-and specifies that new files are to be placed
-after
-.RB ( a )
-or before
-.RB ( b
-or
-.BR i )
-.IR posname .
-Otherwise
-new files are placed at the end.
-.TP
-.B q
-Quickly append the named files to the end of the archive file.
-Optional positioning characters are invalid.
-The command does not check whether the added members
-are already in the archive.
-Useful only to avoid quadratic behavior when creating a large
-archive piece-by-piece.
-.TP
-.B t
-Print a table of contents of the archive file.
-If no names are given, all files in the archive are tabled.
-If names are given, only those files are tabled.
-.TP
-.B p
-Print the named files in the archive.
-.TP
-.B m
-Move the named files to the end of the archive.
-If a positioning character is present,
-then the
-.I posname
-argument must be present and,
-as in
-.B r,
-specifies where the files are to be moved.
-.TP
-.B x
-Extract the named files.
-If no names are given, all files in the archive are
-extracted.
-In neither case does
-.B x
-alter the archive file.
-.TP
-.B v
-Verbose.
-Under the verbose option,
-.I ar
-gives a file-by-file
-description of the making of a
-new archive file from the old archive and the constituent files.
-When used with
-.B t,
-it gives a long listing of all information about the files.
-When used with
-.BR p ,
-it precedes each file with a name.
-.TP
-.B c
-Create.
-Normally
-.I ar
-will create
-.I afile
-when it needs to.
-The create option suppresses the
-normal message that is produced when
-.I afile
-is created.
-.TP
-.B l
-Local.
-Normally
-.I ar
-places its temporary files in the directory /tmp.
-This option causes them to be placed in the local directory.
-.SH FILES
-/tmp/v*        temporaries
-.SH "SEE ALSO"
-ld(1), ar(5),
-lorder(1)
-.SH BUGS
-If the same file is mentioned twice in an argument list,
-it may be put in the archive twice.
diff --git a/.ref-Research-V7/usr/man/man1/arcv.1m b/.ref-Research-V7/usr/man/man1/arcv.1m
deleted file mode 100644 (file)
index 095cdb3..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-.TH ARCV 1M
-.SH NAME
-arcv \- convert archives to new format
-.SH SYNOPSIS
-.B arcv
-file ...
-.SH DESCRIPTION
-.I Arcv
-converts archive files
-(see
-.IR ar (1),
-.IR ar (5))
-from 6th edition to 7th edition format.
-The conversion is done in place, and the command
-refuses to alter a file not in old archive format.
-.PP
-Old archives are marked with a magic number of 0177555 at the start;
-new archives have 0177545.
-.SH FILES
-/tmp/v*, temporary copy
-.SH SEE ALSO
-ar(1), ar(5)
diff --git a/.ref-Research-V7/usr/man/man1/as.1 b/.ref-Research-V7/usr/man/man1/as.1
deleted file mode 100644 (file)
index 33e68dd..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-.TH AS 1  PDP11
-.SH NAME
-as \- assembler
-.SH SYNOPSIS
-.B as
-[
-.B \-
-] [
-.B \-o
-objfile
-] file ...
-.SH DESCRIPTION
-.I As
-assembles the concatenation of the named files.
-If the optional first argument
-.B \-
-is used,
-all undefined symbols in the assembly
-are treated as global.
-.PP
-The output of the assembly is left on the file
-.I objfile;
-if that is omitted,
-.B a.out
-is used.
-It is executable if no errors occurred
-during the assembly,
-and if there were no unresolved external references.
-.SH FILES
-/lib/as2       pass 2 of the assembler
-.br
-/tmp/atm[1-3]? temporary
-.br
-a.out          object
-.SH "SEE ALSO"
-ld(1),
-nm(1),
-adb(1),
-a.out(5)
-.br
-.I "UNIX Assembler Manual"
-by D. M. Ritchie
-.SH DIAGNOSTICS
-When
-an input file cannot be read, its name
-followed by a question mark is typed and assembly
-ceases.
-When syntactic or semantic errors occur, a single-character diagnostic is typed out
-together with the line number and the file name in which it
-occurred.
-Errors in pass 1 cause cancellation of pass 2.
-The possible errors are:
-.PP
-.ta 3
-)      Parentheses error
-.br
-]      Parentheses error
-.br
-<      String not terminated properly
-.br
-*      Indirection used illegally
-.br
-.li
-\fB.\fR        Illegal assignment to `\fB.\fR'
-.br
-a      Error in address
-.br
-b      Branch instruction is odd or too remote
-.br
-e      Error in expression
-.br
-f      Error in local (`f' or `b') type symbol
-.br
-g      Garbage (unknown) character
-.br
-i      End of file inside an if
-.br
-m      Multiply defined symbol as label
-.br
-o      Word quantity assembled at odd address
-.br
-p      `\fB.\fR' different in pass 1 and 2
-.br
-r      Relocation error
-.br
-u      Undefined symbol
-.br
-x      Syntax error
-.br
-.SH BUGS
-Syntax errors can cause incorrect line numbers
-in following diagnostics.
diff --git a/.ref-Research-V7/usr/man/man1/at.1 b/.ref-Research-V7/usr/man/man1/at.1
deleted file mode 100644 (file)
index 229068a..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-.TH AT 1 
-.SH NAME
-at \- execute commands at a later time
-.SH SYNOPSIS
-.B at
-time
-[
-day
-]
-[
-file
-]
-.SH DESCRIPTION
-.I At
-squirrels away a copy of the named
-.I file
-(standard input default)
-to be used as input to
-.IR sh (1)
-at a specified later time.
-A
-.IR cd (1)
-command to the current directory is inserted
-at the beginning,
-followed by assignments to all environment variables.
-When the script is run, it uses the user and group ID
-of the creator of the copy file.
-.PP
-The
-.I time
-is 1 to 4 digits, with an optional following
-`A', `P', `N' or `M' for
-AM, PM, noon or midnight.
-One and two digit numbers are taken to be hours, three and four digits
-to be hours and minutes.
-If no letters follow the digits, a 24 hour clock time is understood.
-.PP
-The optional
-.I day
-is either
-(1) a month name followed by a day number,
-or
-(2) a day of the week; if the word `week' follows
-invocation is moved seven days further off.
-Names of months and days may be recognizably truncated.
-Examples of legitimate commands are
-.IP
-at 8am jan 24
-.br
-at 1530 fr week
-.PP
-.I At
-programs are executed by periodic execution
-of the command
-.I /usr/lib/atrun
-from
-.IR cron (8).
-The granularity of
-.I at
-depends upon how often
-.I atrun
-is executed.
-.PP
-Standard output or error output is lost unless redirected.
-.SH FILES
-/usr/spool/at/yy.ddd.hhhh.uu
-.br
-activity to be performed at hour
-.I hhhh
-of year day
-.I ddd
-of year
-.IR yy .
-.I uu
-is a unique number.
-.br
-/usr/spool/at/lasttimedone contains
-.I hhhh
-for last hour of activity.
-.br
-/usr/spool/at/past directory of activities now in progress
-.br
-/usr/lib/atrun program that executes activities that
-are due
-.br
-pwd(1)
-.SH "SEE ALSO"
-calendar(1),
-cron(8)
-.SH DIAGNOSTICS
-Complains about various syntax errors and times out of range.
-.SH BUGS
-Due to the granularity of the execution of
-.I /usr/lib/atrun,
-there may be bugs in scheduling things almost
-exactly 24 hours into the future.
diff --git a/.ref-Research-V7/usr/man/man1/awk.1 b/.ref-Research-V7/usr/man/man1/awk.1
deleted file mode 100644 (file)
index f40daf2..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-.TH AWK 1 
-.SH NAME
-awk \- pattern scanning and processing language
-.SH SYNOPSIS
-.B awk
-[
-.BI \-F c
-]
-[ prog ] [ file ] ...
-.SH DESCRIPTION
-.I Awk
-scans each input
-.I file
-for lines that match any of a set of patterns specified in
-.IR prog .
-With each pattern in
-.I prog
-there can be an associated action that will be performed
-when a line of a
-.I file
-matches the pattern.
-The set of patterns may appear literally as
-.I prog,
-or in a file
-specified as
-.B \-f
-.IR file .
-.PP
-Files are read in order;
-if there are no files, the standard input is read.
-The file name `\-'
-means the standard input.
-Each line is matched against the
-pattern portion of every pattern-action statement;
-the associated action is performed for each matched pattern.
-.PP
-An input line is made up of fields separated by white space.
-(This default can be changed by using FS,
-.IR "vide infra" ".)"
-The fields are denoted $1, $2, ... ;
-$0 refers to the entire line.
-.PP
-.PP
-A pattern-action statement has the form
-.PP
-       pattern { action }
-.PP
-A missing { action } means print the line;
-a missing pattern always matches.
-.PP
-An action is a sequence of statements.
-A statement can be one of the following:
-.PP
-.nf
-       if ( conditional ) statement [ else statement ]
-       while ( conditional ) statement
-       for ( expression ; conditional ; expression ) statement
-       break
-       continue
-       { [ statement ] ... }
-       variable = expression
-       print [ expression-list ] [ >expression ]
-       printf format [ , expression-list ] [ >expression ]
-       next    # skip remaining patterns on this input line 
-       exit    # skip the rest of the input
-.fi
-.PP
-Statements are terminated by
-semicolons, newlines or right braces.
-An empty expression-list stands for the whole line.
-Expressions take on string or numeric values as appropriate,
-and are built using the operators
-+, \-, *, /, %,  and concatenation (indicated by a blank).
-The C operators ++, \-\-, +=, \-=, *=, /=, and %=
-are also available in expressions.
-Variables may be scalars, array elements
-(denoted
-x[i])
-or fields.
-Variables are initialized to the null string.
-Array subscripts may be any string,
-not necessarily numeric;
-this allows for a form of associative memory.
-String constants are quoted "...".
-.PP
-The 
-.I print
-statement prints its arguments on the standard output
-(or on a file if 
-.I >file
-is present), separated by the current output field separator,
-and terminated by the output record separator.
-The
-.I printf
-statement formats its expression list according to the format
-(see
-.IR printf (3)).
-.PP
-The built-in function
-.I length
-returns the length of its argument
-taken as a string,
-or of the whole line if no argument.
-There are also built-in functions
-.I exp,
-.I log,
-.I sqrt,
-and
-.IR int .
-The last truncates its argument to an integer.
-.IR substr(s,\ m,\ n)
-returns the 
-.IR n -character
-substring of
-.I s
-that begins at position
-.IR m .
-The function
-.IR sprintf(fmt,\ expr,\ expr,\ ...)
-formats the expressions
-according to the
-.IR printf (3)
-format given by
-.I fmt
-and returns the resulting string.
-.PP
-Patterns are arbitrary Boolean combinations
-(!, \(or\(or, &&, and parentheses) of 
-regular expressions and
-relational expressions.
-Regular expressions must be surrounded
-by slashes and are as in
-.IR egrep .
-Isolated regular expressions
-in a pattern apply to the entire line.
-Regular expressions may also occur in
-relational expressions.
-.PP
-A pattern may consist of two patterns separated by a comma;
-in this case, the action is performed for all lines
-between an occurrence of the first pattern
-and the next occurrence of the second.
-.PP
-.nf
-A relational expression is one of the following:
-.PP
-.nf
-       expression matchop regular-expression
-       expression relop expression
-.PP
-.fi
-where a relop is any of the six relational operators in C,
-and a matchop is either ~ (for contains)
-or !~ (for does not contain).
-A conditional is an arithmetic expression,
-a relational expression,
-or a Boolean combination
-of these.
-.PP
-The special patterns
-BEGIN
-and
-END
-may be used to capture control before the first input line is read
-and after the last.
-BEGIN must be the first pattern, END the last.
-.PP
-A single character
-.I c
-may be used to separate the fields by starting
-the program with
-.PP
-       BEGIN { FS = "c" }
-.PP
-or by using the
-.BI \-F c
-option.
-.PP
-Other variable names with special meanings
-include NF, the number of fields in the current record;
-NR, the ordinal number of the current record;
-FILENAME, the name of the current input file;
-OFS, the output field separator (default blank);
-ORS, the output record separator (default newline);
-and
-OFMT, the output format for numbers (default "%.6g").
-.PP
-.SH EXAMPLES
-.PP
-Print lines longer than 72 characters:
-.PP
-.nf
-       length > 72
-.fi
-.PP
-Print first two fields in opposite order:
-.PP
-.nf
-       { print $2, $1 }
-.fi
-.PP
-Add up first column, print sum and average:
-.PP
-.nf
-               { s += $1 }
-       END     { print "sum is", s, " average is", s/NR }
-.fi
-.PP
-Print fields in reverse order:
-.PP
-.nf
-       { for (i = NF; i > 0; \-\-i) print $i }
-.fi
-.PP
-Print all lines between start/stop pairs:
-.PP
-.nf
-       /start/, /stop/
-.fi
-.PP
-Print all lines whose first field is different from previous one:
-.PP
-.nf
-       $1 != prev { print; prev = $1 }
-.fi
-.SH SEE ALSO
-.PP
-lex(1), sed(1)
-.br
-A. V. Aho, B. W. Kernighan, P. J. Weinberger,
-.I
-Awk \- a pattern scanning and processing language
-.SH BUGS
-There are no explicit conversions between numbers and strings.
-To force an expression to be treated as a number add 0 to it;
-to force it to be treated as a string concatenate ""
-to it.
diff --git a/.ref-Research-V7/usr/man/man1/bas.1 b/.ref-Research-V7/usr/man/man1/bas.1
deleted file mode 100644 (file)
index b397990..0000000
+++ /dev/null
@@ -1,374 +0,0 @@
-.TH BAS 1 
-.SH NAME
-bas \- basic
-.SH SYNOPSIS
-.B bas
-[ file ]
-.SH DESCRIPTION
-.I Bas
-is a dialect of Basic.
-If a file argument is provided,
-the file is used for input before the terminal
-is read.
-.I Bas
-accepts lines of the form:
-.PP
-   statement
-   integer statement
-.PP
-Integer numbered statements
-(known as internal statements)
-are stored for later execution.
-They are stored in sorted ascending order.
-Non-numbered statements are immediately executed.
-The result of an immediate expression statement
-(that does not have `=' as its highest operator) is printed.
-Interrupts suspend computation.
-.PP
-Statements have the following syntax:
-.HP 5
-expression
-.br
-The expression is executed for its side
-effects (assignment or function call)
-or for printing as described above.
-.HP 5
-.B comment
-.li
-...
-.br
-This statement is ignored.
-It is used to interject commentary in a program.
-.HP 5
-.B done
-.br
-Return to system level.
-.HP 5
-.B dump
-.br
-The name and current value of every
-variable is printed.
-.HP 5
-.B edit
-.br
-The UNIX editor,
-.I ed,
-is invoked with the
-.I file
-argument.
-After the editor exits,
-this file is recompiled.
-.HP 5
-.B for
-name
-.B =
-expression expression statement
-.br
-.br
-.ns
-.HP 5
-.B for
-name
-.B =
-expression expression
-.br
-.li
-...
-.br
-.ns
-.HP 5
-.B next
-.br
-The
-.I for
-statement
-repetitively executes a
-statement (first form)
-or a group of statements (second form)
-under control of a named variable.
-The variable takes on the value of
-the first expression,
-then is incremented by one on each loop,
-not to exceed the value of
-the second expression.
-.HP 5
-.B goto
-expression
-.br
-The expression is evaluated, truncated to an integer
-and execution goes to the corresponding integer numbered statment.
-If executed from immediate mode,
-the internal statements are compiled first.
-.HP 5
-.B if
-expression statement
-.br
-.br
-.ns
-.HP 5
-.B if
-expression
-.br
-.li
-...
-.br
-.ns
-.HP 5
-[
-.B else
-.br
-.li
-... ]
-.br
-.ns
-.HP 5
-.B fi
-.br
-The statement (first form)
-or group of statements (second form)
-is executed if the expression evaluates
-to non-zero.
-In the second form,
-an optional
-.B else
-allows for a group of statements to be
-executed when the first group is not.
-.HP 5
-.B list
-[expression [expression]]
-.br
-.br list
-is used to print out the stored internal statements.
-If no arguments are given, all internal statements are printed.
-If one argument is given, only that
-internal statement is listed.
-If two arguments are given, all internal statements
-inclusively between the arguments are printed.
-.HP 5
-.B print
-list
-.br
-The list of expressions and strings are concatenated and
-printed.
-(A string is delimited by " characters.)
-.HP 5
-.B prompt
-list
-.br
-.I Prompt 
-is the same as
-.I print
-except that no newline character is
-printed.
-.HP 5
-.B return
-[expression]
-.br
-The expression is evaluated and the result is passed
-back as the value of a function call.
-If no expression is given, zero is returned.
-.HP 5
-.B run
-.br
-The internal statements are compiled.
-The symbol table is re-initialized.
-The random number generator is reset.
-Control is passed to the lowest numbered internal
-statement.
-.HP 5
-.B save
-[expression [expression]]
-.br
-.I Save
-is like
-.I list
-except that the output
-is written on the
-.I file
-argument.
-If no argument is given on the command,
-.B b.out
-is used.
-.PP
-Expressions have the following syntax:
-.HP 5
-name
-.br
-A name is used to specify a variable.
-Names are composed of a letter
-followed by letters and digits.
-The first four characters of a name are significant.
-.HP 5
-number
-.br
-A number is used to represent a constant value.
-A number is written in Fortran style,
-and contains digits, an optional decimal point,
-and possibly a scale factor consisting
-of an
-.B e
-followed by a possibly signed exponent.
-.HP 5
-.B (
-expression
-.B )
-.br
-Parentheses are used to alter normal order of evaluation.
-.HP 5
-_ expression
-.br
-The result is the negation of the expression.
-.HP 5
-expression operator expression
-.br
-Common functions of two arguments are abbreviated
-by the two arguments separated by an operator denoting the function.
-A complete list of operators is given below.
-.HP 5
-expression
-.B (
-[expression [
-.B ,
-expression] ... ]
-.B )
-.br
-Functions of an arbitrary number of arguments
-can be called by an expression followed by the arguments
-in parentheses separated by commas.
-The expression evaluates to the
-line number of the entry of the function in the
-internally stored statements.
-This causes the internal statements to be compiled.
-If the expression evaluates negative,
-a builtin function is called.
-The list of builtin functions appears below.
-.HP 5
-name
-.B [
-expression
-[
-.B ,
-expression
-] ...
-.B ]
-.br
-Each expression is truncated to an integer
-and used as a specifier for the name.
-The result is syntactically identical to a name.
-.B a[1,2]
-is the same as
-.B a[1][2].
-The truncated expressions are restricted to 
-values between 0 and 32767.
-.PP
-The following is the list of operators:
-.TP
-=
-=
-is the assignment operator.
-The left operand must be a name or an array element.
-The result is the right operand.
-Assignment binds right to left,
-.TP
-&  |
-&
-(logical and)
-has result zero if either of its arguments are zero.
-It has result one if both its arguments are non-zero.
-|
-(logical or)
-has result zero if both of its arguments are zero.
-It has result one if either of its arguments are non-zero.
-.TP
-<  <=  >  >=  ==  <>
-The relational operators
-(< less than, <= less than or equal,
-> greater than,
->= greater than or equal,
-== equal to,
-<> not equal to)
-return one if their arguments are in the specified
-relation.
-They return zero otherwise.
-Relational operators at the same level extend as follows:
-a>b>c is the same as a>b&b>c.
-.TP
-+ \-
-Add and subtract.
-.TP
-* /
-Multiply and divide.
-.TP
-^
-Exponentiation.
-.PP
-The following is a list of builtin functions:
-.TP 7
-.B arg(i)
-is the value of the
-.IR i " -th"
-actual parameter on the current level
-of function call.
-.TP 7
-.B exp(x)
-is the exponential function of
-.IR x .
-.TP 7
-.B log(x)
-is the natural logarithm of
-.IR x .
-.TP 7
-.B sqr(x)
-is the square root of
-.IR x .
-.TP 7
-.B sin(x)
-is the sine of
-.IR x ""
-(radians).
-.TP 7
-.B cos(x)
-is the cosine of
-.IR x ""
-(radians).
-.TP 7
-.B atn(x)
-is the arctangent of
-.IR x .
-Its value
-is between \-\(*p/2 and \(*p/2.
-.TP 7
-.B "rnd( )"
-is a uniformly distributed random
-number between zero and one.
-.TP 7
-.B "expr( )"
-is the only form of program input.
-A line is read from the input and
-evaluated as an expression.
-The resultant value is returned.
-.TP 7
-.B abs(x)
-is the absolute value of
-.IR x .
-.TP 7
-.B int(x)
-returns
-.I x
-truncated (towards 0) to an integer.
-.SH FILES
-/tmp/btm?      temporary
-.br
-b.out          save file
-.br
-/bin/ed        for
-.B edit
-.SH DIAGNOSTICS
-Syntax
-errors cause the incorrect line to be typed
-with an underscore where the parse failed.
-All other diagnostics are self explanatory.
-.SH BUGS
-Has been known to give core images.
-.br
-Catches interrupts even when they are turned off.
diff --git a/.ref-Research-V7/usr/man/man1/basename.1 b/.ref-Research-V7/usr/man/man1/basename.1
deleted file mode 100644 (file)
index 661f3c9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-.TH BASENAME 1 
-.SH NAME
-basename \- strip filename affixes
-.SH SYNOPSIS
-.B basename
-string [ suffix ]
-.SH DESCRIPTION
-.I Basename
-deletes any prefix ending in `/' and the
-.I suffix,
-if present in
-.I string,
-from
-.I string,
-and prints the result on the standard output.
-It is normally used inside substitution marks \`\ \`
-in shell procedures.
-.PP
-This shell procedure invoked with the argument
-.I /usr/src/cmd/cat.c
-compiles the named file and moves the output to
-.I cat
-in the current directory:
-.IP "" 15n
-cc $1
-.br
-mv a.out \`basename $1 .c\`
-.SH "SEE ALSO"
-sh(1)
diff --git a/.ref-Research-V7/usr/man/man1/bc.1 b/.ref-Research-V7/usr/man/man1/bc.1
deleted file mode 100644 (file)
index b2c24dd..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-.TH BC 1 
-.SH NAME
-bc \- arbitrary-precision arithmetic language
-.SH SYNOPSIS
-.B bc
-[
-.B \-c
-] [
-.B \-l
-] [ file ... ]
-.SH DESCRIPTION
-.I Bc
-is an interactive processor for a language which resembles
-C but provides unlimited precision arithmetic.
-It takes input from any files given, then reads
-the standard input.
-The
-.B \-l
-argument stands for the name
-of an arbitrary precision math library.
-The syntax for 
-.I bc
-programs is as follows;
-L means letter a-z,
-E means expression, S means statement.
-.HP 6
-Comments
-.br
-are enclosed in /* and */.
-.HP 6
-Names
-.br
-simple variables: L
-.br
-array elements: L [ E ]
-.br
-The words `ibase', `obase', and `scale'
-.HP 6
-Other operands
-.br
-arbitrarily long numbers with optional sign and decimal point.
-.br
-( E )
-.br
-sqrt ( E )
-.br
-length ( E )   number of significant decimal digits
-.br
-scale ( E )    number of digits right of decimal point
-.br
-L ( E , ... , E )
-.HP 6
-Operators
-.br
-+  \-  *  /  %  ^
-(% is remainder; ^ is power)
-.br
-++   \-\-         (prefix and postfix; apply to names)
-.br
-==  <=  >=  !=  <  >
-.br
-=  =+  =\-  =*  =/  =%  =^
-.br
-.HP 6
-Statements
-.br
-E
-.br
-{ S ; ... ; S }
-.br
-if ( E ) S
-.br
-while ( E ) S
-.br
-for ( E ; E ; E ) S
-.br
-null statement
-.br
-break
-.br
-quit
-.HP 6
-Function definitions
-.br
-define L ( L ,..., L ) {
-.br
-       auto L, ... , L
-.br
-       S; ... S
-.br
-       return ( E )
-.br
-}
-.HP 6
-Functions in 
-.B \-l
-math library
-.br
-s(x)   sine
-.br
-c(x)   cosine
-.br
-e(x)   exponential
-.br
-l(x)   log
-.br
-a(x)   arctangent
-.br
-j(n,x) Bessel function
-.PP
-.DT
-All function arguments are passed by value.
-.PP
-The value of a statement that is an expression is printed
-unless the main operator is an assignment.
-Either semicolons or newlines may separate statements.
-Assignment to
-.I scale
-influences the number of digits to be retained on arithmetic
-operations in the manner of
-.IR dc (1).
-Assignments to
-.I ibase
-or
-.I obase
-set the input and output number radix respectively.
-.PP
-The same letter may be used as an array, a function,
-and a simple variable simultaneously.
-All variables are global to the program.
-`Auto' variables are pushed down during function calls.
-When using arrays as function arguments
-or defining them as automatic variables
-empty square brackets must follow the array name.
-.PP
-For example
-.PP
-.nf
-scale = 20
-define e(x){
-       auto a, b, c, i, s
-       a = 1
-       b = 1
-       s = 1
-       for(i=1; 1==1; i++){
-               a = a*x
-               b = b*i
-               c = a/b
-               if(c == 0) return(s)
-               s = s+c
-       }
-}
-.PP
-.fi
-defines a function to compute an approximate value of
-the exponential function and
-.PP
-.nf
-       for(i=1; i<=10; i++) e(i)
-.fi
-.PP
-prints approximate values of the exponential function of
-the first ten integers.
-.PP
-.I Bc
-is actually a preprocessor for
-.IR dc (1),
-which it invokes automatically, unless the
-.B \-c
-(compile only)
-option is present.
-In this case the
-.I dc
-input is sent to the standard output instead.
-.SH FILES
-.ta \w'/usr/lib/lib.b 'u
-/usr/lib/lib.b mathematical library
-.br
-dc(1)  desk calculator proper
-.SH "SEE ALSO"
-dc(1)
-.br
-L. L. Cherry and R. Morris,
-.I
-BC \- An arbitrary precision desk-calculator language
-.SH BUGS
-No &&, \(or\|\(or, or ! operators.
-.br
-.I For
-statement must have all three E's.
-.br
-.I \11\11Quit
-is interpreted when read, not when executed.
diff --git a/.ref-Research-V7/usr/man/man1/cal.1 b/.ref-Research-V7/usr/man/man1/cal.1
deleted file mode 100644 (file)
index d34b849..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-.TH CAL 1 
-.SH NAME
-cal \- print calendar
-.SH SYNOPSIS
-.B cal
-[ month ] year
-.SH DESCRIPTION
-.I Cal
-prints a calendar for the specified year.
-If a month is also specified, a calendar
-just for that month is printed.
-.I Year
-can be between 1
-and 9999.
-The
-.I month
-is a number between 1 and 12.
-The calendar
-produced is that for England and her colonies.
-.PP
-Try September 1752.
-.SH BUGS
-The year is always considered to start in January even though this
-is historically naive.
-.br
-Beware that `cal 78' refers to the early Christian era,
-not the 20th century.
diff --git a/.ref-Research-V7/usr/man/man1/calendar.1 b/.ref-Research-V7/usr/man/man1/calendar.1
deleted file mode 100644 (file)
index 79444b1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-.TH CALENDAR 1 
-.SH NAME
-calendar \- reminder service
-.SH SYNOPSIS
-.B calendar
-[ \- ]
-.SH DESCRIPTION
-.I Calendar 
-consults the file `calendar' in the current directory
-and prints out lines that contain today's or
-tomorrow's date anywhere in the line.
-Most reasonable month-day dates such as `Dec. 7,'
-`december 7,' `12/7,' etc., are recognized, but not
-`7 December' or `7/12'.
-On weekends `tomorrow' extends through Monday.
-.PP
-When 
-an argument is present,
-.I calendar
-does its job for every user
-who has a file `calendar' in his login directory
-and sends him any positive results by
-.IR mail (1).
-Normally this is done daily in the wee hours under control of
-.IR cron (8).
-.SH FILES
-calendar
-.br
-/usr/lib/calendar to figure out today's and tomorrow's dates
-.br
-/etc/passwd
-.br
-/tmp/cal*
-.br
-egrep, sed, mail subprocesses
-.SH "SEE ALSO"
-at(1), cron(8), mail(1)
-.SH BUGS
-Your calendar must be public information for you
-to get reminder service.
-.br
-.I Calendar's
-extended idea of `tomorrow' doesn't account for
-holidays.
diff --git a/.ref-Research-V7/usr/man/man1/cat.1 b/.ref-Research-V7/usr/man/man1/cat.1
deleted file mode 100644 (file)
index ebeac0d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH CAT 1
-.SH NAME
-cat \- catenate and print
-.SH SYNOPSIS
-.B cat
-[
-.B \-u
-] file ...
-.SH DESCRIPTION
-.I Cat
-reads each
-.I file
-in sequence and writes it on the standard output.
-Thus
-.IP
-cat file
-.LP
-prints the file and
-.IP
-cat file1 file2 >file3
-.LP
-concatenates the first two files and places the result
-on the third.
-.PP
-If no
-.I file
-is given, or if the argument `\-' is encountered,
-.I cat 
-reads from the standard input.
-Output is buffered in 512-byte blocks unless the
-standard output is a terminal or the
-.B \-u
-option is present.
-.SH SEE ALSO
-pr(1), cp(1)
-.SH BUGS
-Beware of `cat a b >a' and `cat a b >b', which
-destroy input files before reading them.
diff --git a/.ref-Research-V7/usr/man/man1/cb.1 b/.ref-Research-V7/usr/man/man1/cb.1
deleted file mode 100644 (file)
index cf68591..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-.TH CB 1
-.SH NAME
-cb \- C program beautifier
-.SH SYNOPSIS
-.B cb
-.SH DESCRIPTION
-.I Cb
-places a copy of the C program from the standard input
-on the standard output with spacing and indentation
-that displays the structure of the program.
-.SH BUGS
diff --git a/.ref-Research-V7/usr/man/man1/cc.1 b/.ref-Research-V7/usr/man/man1/cc.1
deleted file mode 100644 (file)
index bd63e70..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-.TH CC 1  PDP11
-.SH NAME
-cc, pcc \- C compiler
-.SH SYNOPSIS
-.B cc
-[ option ] ... file ...
-.PP
-.B pcc
-[ option ] ... file ...
-.SH DESCRIPTION
-.I Cc
-is the UNIX C compiler.
-It accepts several types of arguments:
-.PP
-Arguments whose names end with `.c' are taken to be
-C source programs; they are compiled, and
-each object program is left on the file
-whose name is that of the source with `.o' substituted
-for `.c'.
-The `.o' file is normally deleted, however, if a single
-C program is compiled and loaded all at one go.
-.PP
-In the same way,
-arguments whose names end with `.s' are taken to be assembly source programs
-and are assembled, producing a `.o' file.
-.PP
-The following options are interpreted by
-.IR cc .
-See
-.IR ld (1)
-for load-time options.
-.TP 8
-.B \-c
-Suppress the loading phase of the compilation, and force
-an object file to be produced even if only one program is compiled.
-.TP
-.B \-p
-Arrange for the compiler to produce code
-which counts the number of times each routine is called;
-also, if loading takes place, replace the standard startup
-routine by one which automatically calls
-.IR monitor (3)
-at the start and arranges to write out a
-.I mon.out
-file at normal termination of execution of the object program.
-An execution profile can then be generated by
-use of
-.IR  prof (1).
-.TP
-.B \-f
-In systems without hardware floating-point,
-use a version of the C compiler which handles floating-point
-constants and
-loads the object program with the floating-point interpreter.
-Do not use if the hardware is present.
-.TP
-.SM
-.B \-O
-Invoke an
-object-code optimizer.
-.TP
-.SM
-.B \-S
-Compile the named C programs, and leave the
-assembler-language output on corresponding files suffixed `.s'.
-.TP
-.SM
-.B \-P
-Run only the macro preprocessor and place the result for
-each `.c' file in a corresponding `.i' file
-and has no `#' lines in it.
-.TP
-.SM
-.B \-E
-Run only the macro preprocessor
-and send the result to the
-standard output.
-The output is intended for compiler debugging; it 
-is unacceptable as input to
-.IR cc .
-.TP
-.BI \-o " output"
-Name the final output file
-.IR output .
-If this option is used the file `a.out' will be left undisturbed.
-.TP
-.BI \-D name=def
-.br
-.ns
-.TP
-.SM
-.BI \-D \*Sname
-Define the
-.I name
-to the preprocessor,
-as if by
-`#define'.
-If no definition is given, the name is defined as 1.
-.TP
-.SM
-.BI \-U \*Sname
-Remove any initial definition of
-.IR name .
-.TP
-.SM
-.BI \-I \*Sdir
-`#include' files
-whose names do not begin with `/' are always
-sought first in the directory 
-of the
-.I file
-argument,
-then in directories named in 
-.B \-I
-options,
-then in directories on a standard list.
-.TP
-.SM
-.BI \-B \*Sstring
-Find substitute compiler passes in the files named
-.I string
-with the suffixes cpp, c0, c1 and c2.
-If 
-.I string 
-is empty, use a standard backup version.
-.TP
-.BR \-t [ p012 ]
-Find only the designated compiler passes in the
-files whose names are constructed by a
-.B \-B
-option.
-In the absence of a
-.B \-B 
-option, the
-.I string
-is taken to be `/usr/c/'.
-.PP
-Other arguments
-are taken
-to be either loader option arguments, or C-compatible
-object programs, typically produced by an earlier
-.I cc
-run,
-or perhaps libraries of C-compatible routines.
-These programs, together with the results of any
-compilations specified, are loaded (in the order
-given) to produce an executable program with name
-.B a.out.
-.PP
-The major purpose of the `portable C compiler',
-.I pcc,
-is to serve as a model
-on which to base other compilers.
-.I Pcc
-does not support options
-.BR \-f ,
-.BR \-E ,
-.BR \-B ,
-and
-.BR \-t .
-It provides, in addition to the language of
-.I cc,
-unsigned char type data and initialized bit fields.
-.SH FILES
-.ta \w'/usr/c/oc[102]  'u
-file.c input file
-.br
-file.o object file
-.br
-a.out  loaded output
-.br
-/tmp/ctm?      temporaries for
-.I cc
-.br
-/lib/cpp       preprocessor
-.br
-/lib/c[01]     compiler for
-.I cc
-.br
-/usr/c/oc[012] backup compiler for
-.I cc
-.br
-/usr/c/ocpp    backup preprocessor
-.br
-/lib/fc[01]    floating-point compiler
-.br
-/lib/c2        optional optimizer
-.br
-/lib/crt0.o    runtime startoff
-.br
-/lib/mcrt0.o   startoff for profiling
-.br
-/lib/fcrt0.o   startoff for floating-point interpretation
-.br
-/lib/libc.a    standard library, see
-.IR intro (3)
-.br
-/usr/include   standard directory for `#include' files
-.br
-/tmp/pc*       temporaries for
-.I pcc
-.br
-/usr/lib/ccom  compiler for
-.I pcc
-.SH "SEE ALSO"
-B. W. Kernighan and D. M. Ritchie,
-.I The C Programming Language,
-Prentice-Hall,
-1978
-.br
-D. M. Ritchie,
-.I
-C Reference Manual
-.br
-monitor(3), prof(1), adb(1), ld(1)
-.SH DIAGNOSTICS
-The diagnostics produced by C itself are intended to be
-self-explanatory.
-Occasional messages may be produced by the assembler
-or loader.
-Of these, the most mystifying are from the assembler,
-.IR as (1),
-in particular `m', which means
-a multiply-defined external symbol (function
-or data).
-.SH BUGS
-.I Pcc
-is little tried on the PDP11; specialized
-code generated for that machine has not been
-well shaken down.
-The
-.B \-O
-optimizer was designed to work with
-.IR cc ;
-its use with
-.I pcc
-is suspect.
diff --git a/.ref-Research-V7/usr/man/man1/cd.1 b/.ref-Research-V7/usr/man/man1/cd.1
deleted file mode 100644 (file)
index 9160ce7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-.TH CD 1 
-.SH NAME
-cd \- change working directory
-.SH SYNOPSIS
-.B cd
-directory
-.SH DESCRIPTION
-.I Directory
-becomes the new working directory.
-The process must have execute (search)
-permission in
-.IR directory .
-.PP
-Because a new process is created to execute each command,
-.I cd
-would be ineffective if it were written as a
-normal command.  It is therefore recognized and executed
-by the Shell.
-.SH "SEE ALSO"
-sh(1), pwd(1), chdir(2)
diff --git a/.ref-Research-V7/usr/man/man1/chmod.1 b/.ref-Research-V7/usr/man/man1/chmod.1
deleted file mode 100644 (file)
index dc61d36..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-.TH CHMOD 1 
-.SH NAME
-chmod \- change mode
-.SH SYNOPSIS
-.B chmod
-mode file ...
-.SH DESCRIPTION
-The mode of
-each named file
-is changed
-according to
-.I mode,
-which may be absolute or symbolic.
-An absolute
-.I mode
-is an octal
-number constructed
-from the OR of the
-following modes:
-.TP 10
-4000
-set user ID on execution
-.br
-.br
-.ns
-.TP 10
-2000
-set group ID on execution
-.br
-.br
-.ns
-.TP 10
-1000
-sticky bit, see
-.IR  chmod (2)
-.br
-.br
-.ns
-.TP 10
-0400
-read by owner
-.br
-.br
-.ns
-.TP 10
-0200
-write by owner
-.br
-.br
-.ns
-.TP 10
-0100
-execute (search in directory) by owner
-.br
-.br
-.ns
-.TP 10
-0070
-read, write, execute (search) by group
-.br
-.br
-.ns
-.TP 10
-0007
-read, write, execute (search) by others
-.PP
-A symbolic
-.I mode
-has the form:
-.IP
-.RI [ who ]
-.I op permission
-.RI [ "op permission" "] ..."
-.PP
-The
-.I who
-part is a combination
-of the letters 
-.B u
-(for user's permissions),
-.B g
-(group)
-and
-.B o
-(other).
-The letter
-.B a
-stands for
-.B ugo.
-If
-.I who
-is omitted,
-the default is
-.I a
-but the setting of
-the file creation mask
-(see umask(2))
-is taken into account.
-.PP
-.I Op
-can be
-.B +
-to add
-.I permission
-to the file's mode,
-.B \-
-to take away
-.I permission
-and
-.B =
-to assign
-.I permission
-absolutely
-(all other bits will
-be reset).
-.PP
-.I Permission
-is any combination of the letters
-.B r
-(read),
-.B w
-(write),
-.B x
-(execute),
-.B s
-(set owner or group id)
-and
-.B t
-(save text \- sticky).
-Letters
-.BR u,
-.B g
-or
-.B o
-indicate that
-.I permission
-is to be taken
-from the current
-mode.
-Omitting
-.I permission
-is only useful
-with
-.B =
-to take away
-all permissions.
-.PP
-The first example denies write permission to others,
-the second makes a file executable:
-.IP
-chmod o\-w file
-.br
-chmod +x file
-.PP
-Multiple symbolic modes separated by commas may be given.
-Operations are performed
-in the order specified.
-The letter
-.B s
-is only useful
-with
-.B u
-or
-.B g.
-.PP
-Only the owner of a file (or the super-user) may change its mode.
-.SH "SEE ALSO"
-ls(1),
-chmod(2),
-chown (1),
-stat(2),
-umask(2)
diff --git a/.ref-Research-V7/usr/man/man1/chown.1 b/.ref-Research-V7/usr/man/man1/chown.1
deleted file mode 100644 (file)
index 7be9fe5..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH CHOWN 1 
-.SH NAME
-chown, chgrp \- change owner or group
-.SH SYNOPSIS
-.B chown
-owner file ...
-.PP
-.B chgrp
-group file ...
-.SH DESCRIPTION
-.I Chown
-changes the owner of the
-.I files
-to
-.IR owner .
-The owner may be either a decimal UID or
-a login name found in the password file.
-.PP
-.I Chgrp
-changes the group-ID of the
-.I files
-to
-.IR group .
-The group may be either a decimal GID or
-a group name found in the group-ID file.
-.PP
-Only the super-user can change owner or group,
-in order to simplify as yet unimplemented accounting procedures.
-.SH FILES
-/etc/passwd
-.br
-/etc/group
-.SH "SEE ALSO"
-chown(2),
-passwd(5), group(5)
diff --git a/.ref-Research-V7/usr/man/man1/clri.1m b/.ref-Research-V7/usr/man/man1/clri.1m
deleted file mode 100644 (file)
index 5754b92..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-.TH CLRI 1M 
-.SH NAME
-clri \- clear i-node
-.SH SYNOPSIS
-.B clri
-filesystem i-number ...
-.SH DESCRIPTION
-.I Clri
-writes zeros on the i-nodes
-with the decimal
-.I i-numbers
-on the
-.I filesystem.
-After
-.I clri,
-any blocks
-in the affected file
-will show up as `missing' in an
-.IR icheck (1)
-of the
-.I filesystem.
-.PP
-Read and write permission is required on the specified
-file system device.
-The i-node becomes allocatable.
-.PP
-The primary purpose of this routine
-is to remove a file which
-for some reason appears in no
-directory.
-If it is used to zap an i-node
-which does appear in a directory, care should be taken to track down
-the entry and remove it.
-Otherwise, when the i-node is reallocated to some new file,
-the old entry will still point to that file.
-At that point removing the old entry will destroy the new file.
-The new entry will again point to an unallocated i-node,
-so the whole cycle is likely to be repeated again and again.
-.SH "SEE ALSO"
-icheck(1)
-.SH BUGS
-If the file is open,
-.I clri
-is likely to be ineffective.
diff --git a/.ref-Research-V7/usr/man/man1/cmp.1 b/.ref-Research-V7/usr/man/man1/cmp.1
deleted file mode 100644 (file)
index 415bbc8..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH CMP 1 
-.SH NAME
-cmp \- compare two files
-.SH SYNOPSIS
-.B cmp
-[
-.B \-l
-] [
-.B \-s
-]
-file1 file2
-.SH DESCRIPTION
-The two files are
-compared.
-(If
-.I file1
-is `\-',
-the standard input is used.)
-Under default options,
-.I cmp
-makes no comment if the files are the same;
-if they differ, it announces the byte and line number
-at which the difference occurred.
-If one file is an initial subsequence
-of the other, that fact is noted.
-.PP
-Options:
-.TP 6
-.B  \-l
-Print the byte number (decimal) and the
-differing bytes (octal) for each difference.
-.TP 6
-.B  \-s
-Print nothing for differing files;
-return codes only.
-.dt
-.SH "SEE ALSO"
-diff(1), comm(1)
-.SH DIAGNOSTICS
-Exit code 0 is returned for identical
-files, 1 for different files, and 2 for an
-inaccessible or missing argument.
diff --git a/.ref-Research-V7/usr/man/man1/col.1 b/.ref-Research-V7/usr/man/man1/col.1
deleted file mode 100644 (file)
index 79efc38..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-.TH COL 1
-.SH NAME
-col \- filter reverse line feeds
-.SH SYNOPSIS
-.B col [\|\-bfx\|]
-.SH DESCRIPTION
-.I Col
-reads the standard input and writes the standard output.
-It performs the line overlays implied by reverse line
-feeds (ESC-7 in ASCII)
-and by forward and reverse half line feeds (ESC-9 and ESC-8).
-.I Col
-is particularly useful for filtering multicolumn
-output made with the `.rt' command of
-.I nroff
-and output resulting from use of the
-.IR tbl (1)
-preprocessor.
-.PP
-Although
-.I col
-accepts half line motions in its input, it normally does not
-emit them on output.
-Instead, text that would appear between lines is moved to the next lower
-full line boundary.
-This treatment can be suppressed by the
-.B \-f
-(fine) option; in this case
-the output from
-.I col
-may contain forward half line feeds (ESC-9), but will still never contain
-either kind of reverse line motion.
-.PP
-If the
-.B \-b
-option is given,
-.I col
-assumes that the output device in use is not capable of backspacing.
-In this case, if several characters are to appear in the same place,
-only the last one read will be taken.
-.PP
-The control characters SO (ASCII code 017),
-and SI (016) are assumed
-to start and end text in an alternate character set.
-The character set (primary or alternate) associated with each printing
-character read is remembered; on output, SO and SI characters are generated
-where necessary to maintain the correct treatment of each character.
-.PP
-.I Col
-normally converts white space to tabs to shorten printing time.
-If the
-.B \-x
-option is given, this conversion is suppressed.
-.PP
-All control characters are removed from the input except space,
-backspace,
-tab, return, newline, ESC (033) followed by one of 789, SI, SO, and VT
-(013).
-This last character is an alternate form of full reverse line feed, for
-compatibility with some other hardware conventions.
-All other non-printing characters are ignored.
-.SH "SEE ALSO"
-troff(1), tbl(1), greek(1)
-.SH BUGS
-Can't back up more than 128 lines.
-.br
-No more than 800 characters, including backspaces, on a line.
diff --git a/.ref-Research-V7/usr/man/man1/comm.1 b/.ref-Research-V7/usr/man/man1/comm.1
deleted file mode 100644 (file)
index f7cba5f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-.TH COMM 1 
-.SH NAME
-comm \- select or reject lines common to two sorted files
-.SH SYNOPSIS
-.B comm
-[
-.B \-
-[
-.B 123
-]
-] file1 file2
-.SH DESCRIPTION
-.I Comm
-reads
-.I file1
-and
-.I file2,
-which should be ordered in ASCII collating sequence,
-and produces a three column output: lines only in
-.I file1;
-lines only in
-.I file2;
-and lines in both files.
-The filename `\-' means the standard input.
-.PP
-Flags 1, 2, or 3 suppress printing of the corresponding
-column.
-Thus
-.B comm
-.B \-12
-prints only the lines common to the two files;
-.B comm
-.B \-23
-prints only lines in the first file but not in the second;
-.B comm
-.B \-123
-is a no-op.
-.PP
-.SH "SEE ALSO"
-cmp(1), diff(1), uniq(1)
diff --git a/.ref-Research-V7/usr/man/man1/cp.1 b/.ref-Research-V7/usr/man/man1/cp.1
deleted file mode 100644 (file)
index 605e486..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-.TH CP 1 
-.SH  NAME
-cp \- copy
-.SH SYNOPSIS
-.B cp
-file1 file2
-.PP
-.B cp
-file ... directory
-.SH DESCRIPTION
-.I File1
-is copied onto
-.IR file2 .
-The mode and owner of  
-.I file2
-are preserved if it already
-existed; the mode of the source file
-is used otherwise.
-.PP
-In the second form, one or more
-.I files
-are copied into the
-.I directory
-with their original file-names.
-.PP
-.I Cp
-refuses to copy a file onto itself.
-.SH "SEE ALSO"
-cat(1), pr(1), mv(1)
diff --git a/.ref-Research-V7/usr/man/man1/crypt.1 b/.ref-Research-V7/usr/man/man1/crypt.1
deleted file mode 100644 (file)
index b041371..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-.TH CRYPT 1 
-.SH NAME
-crypt \- encode/decode
-.SH SYNOPSIS
-.B crypt
-[ password ]
-.SH DESCRIPTION
-.I Crypt
-reads from the standard input and writes
-on the standard output.
-The
-.I password
-is a key that selects a particular transformation.
-If no
-.I password 
-is given,
-.I crypt
-demands a key from the terminal and turns
-off printing while the key is being typed in.
-.I Crypt
-encrypts and decrypts with the same key:
-.PP
-       crypt key <clear >cypher
-.br
-       crypt key <cypher | pr
-.PP
-will print the clear.
-.PP
-Files encrypted by
-.I crypt
-are compatible with those treated by the editor
-.I ed
-in encryption mode.
-.PP
-The security of encrypted files depends on three factors:
-the fundamental method must be hard to solve;
-direct search of the key space must be infeasible;
-`sneak paths' by which keys or cleartext can become
-visible must be minimized.
-.PP
-.I Crypt
-implements a one-rotor machine designed along the lines
-of the German Enigma, but with a 256-element rotor.
-Methods of attack on such machines are known, but not widely;
-moreover the amount of work required is likely to be large.
-.PP
-The transformation of a key into the internal
-settings of the machine is deliberately designed to
-be expensive, i.e. to take a substantial fraction of
-a second to compute.
-However,
-if keys are restricted to (say)
-three lower-case letters,
-then encrypted files can be read by expending only
-a substantial fraction of
-five minutes of machine time.
-.PP
-Since the key is an argument to the
-.I crypt
-command,
-it is potentially visible to users executing
-.IR ps (1)
-or a derivative.
-To minimize this possibility,
-.I crypt
-takes care to destroy any record of the key
-immediately upon entry.
-No doubt the choice of keys and key security
-are the most vulnerable aspect of
-.I crypt.
-.SH FILES
-/dev/tty for typed key
-.SH "SEE ALSO"
-ed(1),
-makekey(8)
-.SH BUGS
-There is no warranty of merchantability nor any warranty
-of fitness for a particular purpose nor any other warranty,
-either express or implied, as to the accuracy of the
-enclosed materials or as to their suitability for any
-particular purpose.  Accordingly, Bell Telephone
-Laboratories assumes no responsibility for their use by the
-recipient.   Further, Bell Laboratories assumes no obligation
-to furnish any assistance of any kind whatsoever, or to
-furnish any additional information or documentation.
diff --git a/.ref-Research-V7/usr/man/man1/cu.1c b/.ref-Research-V7/usr/man/man1/cu.1c
deleted file mode 100644 (file)
index f417898..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-.TH CU 1C 
-.SH NAME
-cu \- call UNIX
-.SH SYNOPSIS
-.B cu
-telno
-[
-.BR \-t ""
-]
-[
-.BR \-s ""
-speed ]
-[
-.BR \-a ""
-acu ]
-[
-.BR \-l ""
-line ]
-.SH DESCRIPTION
-.I Cu
-calls up another UNIX system,
-a terminal,
-or possibly a non-UNIX system.
-It manages an interactive conversation with possible
-transfers of text files.
-.I Telno
-is the telephone number,
-with minus signs at appropriate places for delays.
-The
-.BR \-t ""
-flag is used to dial out to a terminal.
-.I Speed
-gives the transmission speed (110, 134, 150, 300, 1200);
-300 is the default value.
-.PP
-The
-.BR \-a ""
-and
-.BR \-l ""
-values may be used to
-specify pathnames
-for the ACU and communications line devices.
-They can be used to override the following
-built-in choices:
-.PP
-.BR \-a " /dev/cua0"
-.BR \-l " /dev/cul0"
-.PP
-After making the connection,
-.I cu
-runs as two processes:
-the
-.I send
-process reads the standard input and
-passes most of it to the remote system;
-the
-.I receive
-process reads from the remote system and passes
-most data to the standard output.
-Lines beginning with `~' have special meanings.
-.PP
-The
-.I send
-process interprets the following:
-.TP 18
-~\|\fB.\|
-terminate the conversation.
-.br
-.ns
-.TP 18
-~EOT
-terminate the conversation
-.TP 18
-~<file
-send the contents of
-.I file
-to the remote system,
-as though typed at the terminal.
-.TP 18
-~!
-invoke an interactive shell on the local system.
-.TP 18
-~!cmd ...
-run the command on the local system
-(via
-.BR "sh \-c" ")."
-.TP 18
-~$cmd ...
-run the command locally and send its output
-to the remote system.
-.TP 18
-~%take from [to]
-copy file `from' (on the remote system)
-to file `to' on the local system.
-If `to' is omitted,
-the `from' name is used both places.
-.TP 18
-~%put from [to]
-copy file `from' (on local system)
-to file `to' on remote system.
-If `to' is omitted, the `from' name is used both places.
-.TP 18
-~~\fB\|.\|.\|.\fR
-send
-the line `~\|.\|.\|.'.
-.PP
-The
-.I receive
-process handles output diversions of the following form:
-.PP
-\&~>[>][:]file
-.br
-zero or more lines to be written to file
-.br
-\&~>
-.PP
-In any case, output is diverted (or appended, if `>>' used) to the file.
-If `:' is used,
-the diversion is
-.I silent,
-i.e., it is written only to the file.
-If `:' is omitted,
-output is written both to the file and to the standard output.
-The trailing `~>' terminates the diversion.
-.PP
-The use of
-.B  ~%put
-requires
-.I stty
-and
-.I cat
-on the remote side.
-It also requires that the
-current erase and kill characters on the remote
-system be identical to the current ones on the local system.
-Backslashes are inserted at appropriate places.
-.PP
-The use of
-.B  ~%take
-requires the existence of
-.I echo
-and
-.I tee
-on the remote system.
-Also,
-.B "stty tabs"
-mode is required on the remote system if
-tabs are to be copied without expansion.
-.SH FILES
-/dev/cua0
-.br
-/dev/cul0
-.br
-/dev/null
-.SH "SEE ALSO"
-dn(4), tty(4)
-.SH DIAGNOSTICS
-Exit code is
-zero for normal exit,
-nonzero (various values) otherwise.
-.SH BUGS
-The syntax is unique.
diff --git a/.ref-Research-V7/usr/man/man1/date.1 b/.ref-Research-V7/usr/man/man1/date.1
deleted file mode 100644 (file)
index e9ea7fc..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH DATE 1 
-.SH NAME
-date \- print and set the date
-.SH SYNOPSIS
-.B date
-.RB "[ yymmddhhmm [ " . "ss ] ]"
-.SH DESCRIPTION
-If no argument is given, the current date and time are printed.
-If an argument is given, the current date is set.
-.I yy
-is the last two digits of the year;
-the first
-.I mm
-is the month number;
-.I dd
-is the day number in the month;
-.I hh
-is the hour number (24 hour system);
-the second
-.I mm
-is the minute number;
-.BI . ss
-is optional and is the seconds.
-For example:
-.IP
-date 10080045
-.PP
-sets the date to Oct 8, 12:45 AM.
-The year, month and day may be omitted, the current
-values being the defaults.
-The system operates in GMT.
-.I Date
-takes care of the conversion to and from
-local standard and daylight time.
-.SH FILES
-/usr/adm/wtmp to record time-setting
-.SH SEE ALSO
-utmp(5)
-.SH DIAGNOSTICS
-`No permission' if
-you aren't the super-user and you try to change the date;
-`bad conversion' if the date set is syntactically incorrect.
diff --git a/.ref-Research-V7/usr/man/man1/dc.1 b/.ref-Research-V7/usr/man/man1/dc.1
deleted file mode 100644 (file)
index 4b53d72..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-.TH DC 1 
-.SH NAME
-dc \- desk calculator
-.SH SYNOPSIS
-.B dc
-[ file ]
-.SH DESCRIPTION
-.I Dc
-is an arbitrary precision arithmetic package.
-Ordinarily it operates on decimal integers,
-but one may specify an input base, output base,
-and a number of fractional digits to be maintained.
-The overall structure of
-.I dc
-is
-a stacking (reverse Polish) calculator.
-If an argument is given,
-input is taken from that file until its end,
-then from the standard input.
-The following constructions are recognized:
-.HP 6
-number
-.br
-The value of the number is pushed on the stack.
-A number is an unbroken string of the digits 0-9.
-It may be preceded by an underscore _ to input a
-negative number.
-Numbers may contain decimal points.
-.HP 6
-+  \- /  *  %  ^
-.br
-The
-top two values on the stack are added
-(+),
-subtracted
-(\-),
-multiplied (*),
-divided (/),
-remaindered (%),
-or exponentiated (^).
-The two entries are popped off the stack;
-the result is pushed on the stack in their place.
-Any fractional part of an exponent is ignored.
-.TP
-.BI s x
-The
-top of the stack is popped and stored into
-a register named
-.I x,
-where
-.I x
-may be any character.
-If
-the
-.B s
-is capitalized,
-.I x
-is treated as a stack and the value is pushed on it.
-.TP
-.BI l x
-The
-value in register
-.I x
-is pushed on the stack.
-The register
-.I x
-is not altered.
-All registers start with zero value.
-If the
-.B l
-is capitalized,
-register
-.I x
-is treated as a stack and its top value is popped onto the main stack.
-.TP
-.B  d
-The
-top value on the stack is duplicated.
-.TP
-.B  p
-The top value on the stack is printed.
-The top value remains unchanged.
-.B P
-interprets the top of the stack as an ascii string,
-removes it, and prints it.
-.TP
-.B  f
-All values on the stack and in registers are printed.
-.TP
-.B  q
-exits the program.
-If executing a string, the recursion level is
-popped by two.
-If
-.B q
-is capitalized,
-the top value on the stack is popped and the string execution level is popped
-by that value.
-.TP
-.B  x
-treats the top element of the stack as a character string
-and executes it as a string of dc commands.
-.TP
-.B  X
-replaces the number on the top of the stack with its scale factor.
-.TP
-.B  "[ ... ]"
-puts the bracketed ascii string onto the top of the stack.
-.HP 6
-.I  "<x  >x  =x"
-.br
-The
-top two elements of the stack are popped and compared.
-Register
-.I x
-is executed if they obey the stated
-relation.
-.TP
-.B  v
-replaces the top element on the stack by its square root.
-Any existing fractional part of the argument is taken
-into account, but otherwise the scale factor is ignored.
-.TP
-.B  !
-interprets the rest of the line as a UNIX command.
-.TP
-.B  c
-All values on the stack are popped.
-.TP
-.B  i
-The top value on the stack is popped and used as the
-number radix for further input.
-.B I
-pushes the input base on the top of the stack.
-.TP
-.B  o
-The top value on the stack is popped and used as the
-number radix for further output.
-.TP
-.SM
-.B O
-pushes the output base on the top of the stack.
-.TP
-.B  k
-the top of the stack is popped, and that value is used as
-a non-negative scale factor:
-the appropriate number of places
-are printed on output,
-and maintained during multiplication, division, and exponentiation.
-The interaction of scale factor,
-input base, and output base will be reasonable if all are changed
-together.
-.TP
-.B  z
-The stack level is pushed onto the stack.
-.TP
-.SM
-.B  Z
-replaces the number on the top of the stack with its length.
-.TP
-.B  ?
-A line of input is taken from the input source (usually the terminal)
-and executed.
-.TP
-.B "; :"
-are used by 
-.I bc
-for array operations.
-.PP
-An example which prints the first ten values of n! is
-.nf
-.PP
-.in +3
-[la1+dsa*pla10>y]sy
-.br
-0sa1
-.br
-lyx
-.fi
-.SH "SEE ALSO"
-bc(1),
-which is a preprocessor for
-.I dc
-providing infix notation and a C-like syntax
-which implements functions and reasonable control
-structures for programs.
-.SH DIAGNOSTICS
-`x is unimplemented' where x is an octal number.
-.br
-`stack empty' for not enough elements on the stack to do what was asked.
-.br
-`Out of space' when the free list is exhausted (too many digits).
-.br
-`Out of headers' for too many numbers being kept around.
-.br
-`Out of pushdown' for too many items on the stack.
-.br
-`Nesting Depth' for too many levels of nested execution.
diff --git a/.ref-Research-V7/usr/man/man1/dcheck.1m b/.ref-Research-V7/usr/man/man1/dcheck.1m
deleted file mode 100644 (file)
index 99493c5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.TH DCHECK 1M 
-.SH NAME
-dcheck \- file system directory consistency check
-.SH SYNOPSIS
-.B dcheck
-[
-.B \-i
-numbers ]
-[ filesystem ]
-.SH DESCRIPTION
-.I Dcheck
-reads the directories in a file system
-and compares
-the link-count in each i-node with the number of directory
-entries by which it is referenced.
-If the file system is not specified,
-a set of default file systems
-is checked.
-.PP
-The
-.B \-i
-flag
-is followed by a list of i-numbers;
-when one of those i-numbers turns up
-in a directory,
-the number, the i-number of the directory,
-and the name of the entry are reported.
-.PP
-The program is fastest if the
-raw version of the special file is used,
-since the i-list is read in large chunks.
-.SH FILES
-Default file systems vary with installation.
-.SH "SEE ALSO"
-icheck(1), filsys(5), clri(1), ncheck(1)
-.SH DIAGNOSTICS
-When a file turns up for which the link-count and the number
-of directory entries disagree,
-the relevant facts are reported.
-Allocated files which have 0 link-count and no entries are also
-listed.
-The only dangerous situation
-occurs when there are more entries than links;
-if entries are removed,
-so the link-count drops to 0,
-the remaining entries point to thin air.
-They should be removed.
-When there are more links than entries, or there is
-an allocated file with neither links nor entries,
-some disk space may be lost but the situation will not degenerate.
-.SH BUGS
-Since
-.I dcheck
-is inherently two-pass in nature, extraneous diagnostics
-may be produced if applied to active file systems.
diff --git a/.ref-Research-V7/usr/man/man1/dd.1 b/.ref-Research-V7/usr/man/man1/dd.1
deleted file mode 100644 (file)
index 56aaab3..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-.TH DD 1 
-.SH NAME
-dd \- convert and copy a file
-.SH SYNOPSIS
-.B dd
-[option=value] ...
-.SH DESCRIPTION
-.I Dd
-copies the specified input file
-to the specified output with
-possible conversions.
-The standard input and output are used by default.
-The input and output block size may be
-specified to take advantage of raw physical I/O.
-.PP
-.br
-.ns
-.TP 15
-.I option
-.I values
-.br
-.ns
-.TP 
-if=
-input file name; standard input is default
-.br
-.ns
-.TP 
-of=
-output file name; standard output is default
-.br
-.ns
-.TP 
-.RI ibs= n
-input block size
-.I n
-bytes (default 512)
-.br
-.ns
-.TP 
-.RI obs= n
-output block size (default 512)
-.br
-.ns
-.TP 
-.RI bs= n
-set both input and output block size,
-superseding
-.I ibs
-and
-.I obs;
-also, if no conversion is specified,
-it is particularly efficient since no copy need be done
-.br
-.ns
-.TP 
-.RI cbs= n
-conversion buffer size
-.br
-.ns
-.TP 
-.RI skip= n
-skip
-.IR n ""
-input records before starting copy
-.br
-.ns
-.TP
-.RI files= n
-copy
-.I n
-files from (tape) input
-.br
-.ns
-.TP 
-.RI seek= n
-seek
-.I n
-records from beginning of output file before copying
-.br
-.ns
-.TP 
-count=\fIn\fR
-copy only
-.IR n ""
-input records
-.br
-.ns
-.TP 
-conv=ascii
-.ds h \h'\w'conv='u'
-convert EBCDIC to ASCII
-.br
-.ns
-.IP \*hebcdic
-convert ASCII to EBCDIC
-.br
-.ns
-.IP \*hibm
-slightly different map of ASCII to EBCDIC
-.br
-.ns
-.IP \*hlcase
-map alphabetics to lower case
-.br
-.ns
-.IP \*hucase
-map alphabetics to upper case
-.br
-.ns
-.IP \*hswab
-swap every pair of bytes
-.br
-.ns
-.IP \*hnoerror
-do not stop processing on an error
-.br
-.ns
-.IP \*hsync
-pad every input record to
-.I  ibs
-.br
-.ns
-.IP "\*h... , ..."
-several comma-separated conversions
-.PP
-.fi
-Where sizes are specified,
-a number of bytes is expected.
-A number may end with
-.B "k, b"
-or
-.B w
-to specify multiplication by
-1024, 512, or 2 respectively;
-a pair of numbers may be separated by
-.B x
-to indicate a product.
-.PP
-.I Cbs
-is used only if
-.I ascii
-or
-.I ebcdic
-conversion is specified.
-In the former case
-.I cbs
-characters are placed into the conversion buffer, converted to
-ASCII, and trailing blanks trimmed and new-line added
-before sending the line to the output.
-In the latter case ASCII characters are read into the
-conversion buffer, converted to EBCDIC, and blanks added
-to make up an
-output record of size
-.IR cbs .
-.PP
-After completion,
-.I dd
-reports the number of whole and partial input and output
-blocks.
-.PP
-For example, to read an EBCDIC tape blocked ten 80-byte
-EBCDIC card images per record into the ASCII file
-.IR x :
-.IP ""
-dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase
-.PP
-Note the use of raw magtape.
-.I Dd
-is especially suited to I/O on the raw
-physical devices because it allows reading
-and writing in arbitrary record sizes.
-.PP
-To skip over a file before copying from magnetic tape do
-.IP""
-(dd of=/dev/null; dd of=x) </dev/rmt0
-.SH "SEE ALSO"
-cp(1), tr(1)
-.SH DIAGNOSTICS
-f+p records in(out): numbers of full and partial records read(written)
-.SH BUGS
-The ASCII/EBCDIC conversion tables are
-taken
-from the 256 character standard in
-the CACM Nov, 1968.
-The `ibm' conversion, while less blessed as a standard,
-corresponds better to certain IBM print train conventions.
-There is no universal solution.
-.PP
-Newlines are inserted only on conversion to ASCII;
-padding is done only on conversion to EBCDIC.
-These should be separate options.
diff --git a/.ref-Research-V7/usr/man/man1/deroff.1 b/.ref-Research-V7/usr/man/man1/deroff.1
deleted file mode 100644 (file)
index d1ba1bb..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-.TH DEROFF 1 
-.SH NAME
-deroff \- remove nroff, troff, tbl and eqn constructs
-.SH SYNOPSIS
-.B deroff
-[
-.B \-w
-]
-file ...
-.SH DESCRIPTION
-.I Deroff
-reads each file in sequence
-and removes all
-.I nroff
-and
-.I troff
-command lines, backslash constructions, macro definitions,
-.I eqn
-constructs
-(between `.EQ' and `.EN' lines or between 
-delimiters),
-and table descriptions
-and writes the remainder on the standard output.
-.I Deroff
-follows chains of included files
-(`.so' and `.nx' commands);
-if a file has already been included, a `.so' is ignored and a `.nx' terminates execution.
-If no input file is given,
-.I deroff
-reads from the standard input file.
-.PP
-If the
-.B \-w
-flag is given, the output is a word list, one `word' (string of letters, digits, and apostrophes,
-beginning with a letter; apostrophes are removed) per line, and all other characters ignored.
-Otherwise, the output follows the original, with the deletions mentioned above.
-.SH "SEE ALSO"
-troff(1), eqn(1), tbl(1)
-.SH BUGS
-.I Deroff
-is not a complete
-.I troff
-interpreter,
-so it can be confused by subtle constructs.
-Most errors result in too much rather than too little output.
diff --git a/.ref-Research-V7/usr/man/man1/df.1m b/.ref-Research-V7/usr/man/man1/df.1m
deleted file mode 100644 (file)
index d55545f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-.TH DF 1M 
-.SH NAME
-df \- disk free
-.SH SYNOPSIS
-.B df
-[ filesystem ] ...
-.SH DESCRIPTION
-.I Df
-prints out the number of free blocks
-available on the
-.I filesystems.
-If no file system is specified,
-the free space on all of
-the normally mounted file systems
-is printed.
-.SH FILES
-Default file systems vary with installation.
-.SH "SEE ALSO"
-icheck(1)
diff --git a/.ref-Research-V7/usr/man/man1/diff.1 b/.ref-Research-V7/usr/man/man1/diff.1
deleted file mode 100644 (file)
index b71adb4..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-.TH DIFF 1 
-.SH NAME
-diff \- differential file comparator
-.SH SYNOPSIS
-.B diff
-[
-.B \-efbh
-] file1 file2
-.SH DESCRIPTION
-.I Diff
-tells what lines must be changed in two files to bring them
-into agreement.
-If
-.I file1
-.RI ( file2 )
-is `\-', the standard input is used.
-If
-.I file1
-.RI ( file2 )
-is a directory, then a file in that directory
-whose file-name is the same as the file-name of 
-.I file2
-.RI ( file1 )
-is used.
-The normal output contains lines of these forms:
-.IP "" 5
-.I n1
-a
-.I n3,n4
-.br
-.I n1,n2
-d
-.I n3
-.br
-.I n1,n2
-c
-.I n3,n4
-.PP
-These lines resemble
-.I ed
-commands to convert
-.I file1
-into
-.IR file2 .
-The numbers after the letters pertain to
-.IR file2 .
-In fact, by exchanging `a' for `d' and reading backward
-one may ascertain equally how to convert 
-.I file2
-into
-.IR file1 .
-As in 
-.I ed,
-identical pairs where
-.I n1
-=
-.I n2
-or
-.I n3
-=
-.I n4
-are abbreviated as a single number.
-.PP
-Following each of these lines come all the lines that are
-affected in the first file flagged by `<', 
-then all the lines that are affected in the second file
-flagged by `>'.
-.PP
-The
-.B \-b
-option causes
-trailing blanks (spaces and tabs) to be ignored
-and other strings of blanks to compare equal.
-.PP
-The
-.B \-e
-option produces a script of
-.I "a, c"
-and 
-.I d
-commands for the editor
-.I ed,
-which will recreate
-.I file2
-from
-.IR file1 .
-The
-.B \-f
-option produces a similar script,
-not useful with
-.I ed,
-in the opposite order.
-In connection with
-.BR \-e ,
-the following shell program may help maintain
-multiple versions of a file.
-Only an ancestral file ($1) and a chain of 
-version-to-version
-.I ed
-scripts ($2,$3,...) made by
-.I diff
-need be on hand.
-A `latest version' appears on
-the standard output.
-.IP "" 5
-(shift; cat $*; echo \'1,$p\') \(bv ed \- $1
-.PP
-Except in rare circumstances,
-.I diff
-finds a smallest sufficient set of file
-differences.
-.PP
-Option
-.B \-h
-does a fast, half-hearted job.
-It works only when changed stretches are short
-and well separated,
-but does work on files of unlimited length.
-Options 
-.B \-e
-and
-.B \-f
-are unavailable with
-.BR \-h .
-.SH FILES
-/tmp/d?????
-.br
-/usr/lib/diffh for 
-.B \-h
-.SH "SEE ALSO"
-cmp(1), comm(1), ed(1)
-.SH DIAGNOSTICS
-Exit status is 0 for no differences, 1 for some, 2 for trouble.
-.SH BUGS
-Editing scripts produced under the
-.BR \-e " or"
-.BR \-f " option are naive about"
-creating lines consisting of a single `\fB.\fR'.
diff --git a/.ref-Research-V7/usr/man/man1/diff3.1 b/.ref-Research-V7/usr/man/man1/diff3.1
deleted file mode 100644 (file)
index 9403a3c..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-.TH DIFF3 1 
-.SH NAME
-diff3 \- 3-way differential file comparison
-.SH SYNOPSIS
-.B diff3
-[
-.B \-ex3
-]
-file1 file2 file3
-.SH DESCRIPTION
-.I Diff3
-compares three versions of a file,
-and publishes disagreeing ranges of text
-flagged with these codes:
-.TP 16
-====
-all three files differ
-.TP 16
-====1
-.IR file1 " is different"
-.TP 16
-====2
-.IR file2 " is different"
-.TP 16
-====3
-.IR file3 " is different"
-.PP
-The type of change suffered in converting a given range
-of a given file to some other is
-indicated in one of these ways:
-.TP 16
-.IB f " : " n1 " a"
-Text is to be appended after line number
-.I n1
-in file
-.I f,
-where
-.I f
-= 1, 2, or 3.
-.TP 16
-.IB f " : " n1 " , " n2 " c"
-Text is to be
-changed in the range line
-.I n1
-to line
-.IR n2 .
-If 
-.I n1
-=
-.I n2,
-the range may be abbreviated to
-.IR n1 .
-.PP
-The original contents of the range follows immediately
-after a
-.B c
-indication.
-When the contents of two
-files are identical, the contents of the lower-numbered
-file is suppressed.
-.PP
-Under the
-.B \-e
-option,
-.I diff3
-publishes a script for the editor
-.I ed
-that will incorporate into
-.I file1
-all changes between
-.I file2
-and
-.I file3,
-.IR i.e .
-the changes that normally would be flagged ==== and ====3.
-Option
-.B \-x
-(\fB\-3\fR)
-produces a script to incorporate
-only changes flagged ==== (====3).
-The following command will apply the resulting script to
-`file1'.
-.PP
-.ti 16n
-(cat script; echo \'1,$p\') \(bv ed \- file1
-.SH FILES
-/tmp/d3?????
-.br
-/usr/lib/diff3
-.SH "SEE ALSO"
-diff(1)
-.SH BUGS
-Text lines that consist of a single `.' will
-defeat
-.B \-e.
-.br
-Files longer than 64K bytes won't work.
diff --git a/.ref-Research-V7/usr/man/man1/du.1 b/.ref-Research-V7/usr/man/man1/du.1
deleted file mode 100644 (file)
index 59ed53e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-.TH DU 1 
-.SH NAME
-du  \-  summarize disk usage
-.SH SYNOPSIS
-.B du
-[
-.B \-s
-] [
-.B \-a
-] [ name ... ]
-.SH DESCRIPTION
-.I Du
-gives the number of blocks contained in all files
-and (recursively) directories within each specified directory or
-file
-.IR name .
-If
-.I name
-is missing,
-`\fB.\fR'
-is used.
-.PP
-The optional argument
-.B \-s
-causes only the grand total to
-be given.
-The optional argument
-.B \-a
-causes an entry to be generated
-for each file.
-Absence of either causes an entry to be generated for
-each directory only.
-.PP
-A file which has two links to it is only counted once.
-.SH BUGS
-Non-directories
-given as arguments (not under
-.B \-a
-option) are not listed.
-.br
-If there are too many distinct linked files,
-.I du
-counts the excess files multiply.
diff --git a/.ref-Research-V7/usr/man/man1/dump.1m b/.ref-Research-V7/usr/man/man1/dump.1m
deleted file mode 100644 (file)
index 3706b65..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-.TH DUMP 1M 
-.SH NAME
-dump \- incremental file system dump
-.SH SYNOPSIS
-.B dump
-[ key [ argument ... ] filesystem ]
-.SH DESCRIPTION
-.I Dump
-copies to magnetic tape all files
-changed after a certain date
-in the
-.I filesystem.
-The
-.I key
-specifies the date and other options about the dump.
-.I Key
-consists of characters from
-the set
-.B 0123456789fusd.
-.TP 5
-.B  f
-Place the dump on the next 
-.I argument 
-file
-instead of the tape.
-.TP 5
-.B  u
-If the dump completes successfully,
-write the date of the beginning of the dump on
-file `/etc/ddate'.
-This file records a separate date for
-each filesystem and each dump level.
-.TP 5
-.B  0\-9
-This number is the `dump level'.
-All files modified since the last date stored
-in the file `/etc/ddate' for
-the same filesystem at lesser levels
-will be dumped.
-If no date is determined by the level,
-the beginning of time is assumed;
-thus the option
-.B 0
-causes the entire filesystem to be dumped.
-.TP 5
-.B  s
-The size of the dump tape is specified in feet.
-The number of feet is taken from the next
-.I argument.
-When the specified size is reached,
-the dump will wait for reels to be changed.
-The default size is 2300 feet.
-.TP 5
-.B d
-The density of the tape, expressed in BPI,
-is taken from the next
-.I argument.
-This is used in calculating the amount of tape
-used per write. The default is 1600.
-.PP
-.DT
-If no arguments are given,
-the
-.I key
-is assumed to be
-.B 9u
-and a default file system is dumped
-to the default tape.
-.PP
-Now a short suggestion on how
-perform dumps.
-Start with a full level 0 dump
-.PP
-       dump 0u
-.PP
-Next,
-periodic level 9 dumps should be made on an
-exponential progression of tapes.
-(Sometimes called Tower of Hanoi \- 1 2 1 3 1 2 1 4 ...
-tape 1 used every other time,
-tape 2 used every fourth,
-tape 3 used every eighth, etc.)
-.PP
-       dump 9u
-.PP
-When the level 9 incremental approaches a full
-tape (about 78000 blocks at 1600 BPI blocked 20),
-a level 1 dump should be made.
-.PP
-       dump 1u
-.PP
-After this,
-the exponential series should progress as uninterrupted.
-These level 9 dumps are based on the level 1 dump which
-is based on the level 0 full dump.
-This progression of levels of dump can be carried
-as far as desired.
-.SH FILES
-default filesystem and tape vary with installation.
-.br
-/etc/ddate: record dump dates of filesystem/level.
-.SH "SEE ALSO"
-restor(1), dump(5), dumpdir(1)
-.SH DIAGNOSTICS
-If the dump requires more than one tape,
-it will ask you to change tapes.
-Reply with a new-line when this has been done.
-.SH BUGS
-Sizes are based on 1600 BPI blocked tape.
-The raw magtape device has to be used to
-approach these densities.
-Read errors on the filesystem are ignored.
-Write errors on the magtape are usually fatal.
diff --git a/.ref-Research-V7/usr/man/man1/dumpdir.1m b/.ref-Research-V7/usr/man/man1/dumpdir.1m
deleted file mode 100644 (file)
index 6b169d1..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH DUMPDIR 1M 
-.SH NAME
-dumpdir \- print the names of files on a dump tape
-.SH SYNOPSIS
-.I dumpdir
-[
-.B f
-filename ]
-.SH DESCRIPTION
-.I Dumpdir
-is used to read magtapes dumped with the
-.I dump
-command and list the names and inode numbers
-of all the files and directories on the tape.
-.PP
-The
-.B f
-option causes
-.I filename
-as the name of the tape instead
-of the default.
-.SH FILES
-default tape unit varies with installation
-.br
-rst*
-.SH "SEE ALSO"
-dump(1), restor(1)
-.SH DIAGNOSTICS
-If the dump extends over more than one tape,
-it may ask you to change tapes.
-Reply with a new-line when the next tape has been mounted.
-.SH BUGS
-There is redundant information on the tape
-that could be used in case of tape reading problems.
-Unfortunately,
-.I dumpdir
-doesn't use it.
diff --git a/.ref-Research-V7/usr/man/man1/echo.1 b/.ref-Research-V7/usr/man/man1/echo.1
deleted file mode 100644 (file)
index 16b2ead..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.TH ECHO 1 
-.SH NAME
-echo \- echo arguments 
-.SH SYNOPSIS
-.B echo
-[
-.B \-n
-]
-[ arg ] ...
-.SH DESCRIPTION
-.I Echo
-writes its arguments separated by blanks and terminated by
-a newline on the standard output.
-If the flag
-.B \-n
-is used,
-no newline is added to the output.
-.PP
-.I Echo
-is useful for producing diagnostics in
-shell programs and for writing constant data on pipes.
-To send diagnostics to the standard error file, do
-`echo ... 1>&2'.
diff --git a/.ref-Research-V7/usr/man/man1/ed.1 b/.ref-Research-V7/usr/man/man1/ed.1
deleted file mode 100644 (file)
index 1fbedc4..0000000
+++ /dev/null
@@ -1,652 +0,0 @@
-.TH ED 1 
-.if t .ds q \(aa
-.if n .ds q '
-.SH NAME
-ed \- text editor
-.SH SYNOPSIS
-.B ed
-[
-.B \-
-] [
-.B \-x
-] [ name ]
-.SH DESCRIPTION
-.I Ed
-is the standard text editor.
-.PP
-If a
-.I name
-argument is given,
-.I ed
-simulates an
-.I e
-command (see below)\| on the named file; that is to say,
-the file is read into
-.I ed's
-buffer so that it can be edited.
-If 
-.B \-x
-is present, an
-.I x
-command is simulated first to handle an encrypted file.
-The optional
-.B \-
-suppresses the printing
-of character counts by
-.I e,
-.I r,
-and
-.I w
-commands.
-.PP
-.I Ed
-operates on a copy of any file it is editing; changes made
-in the copy have no effect on the file until a
-.IR w ""
-(write)\|
-command is given.
-The copy of the text being edited resides
-in a temporary file called the 
-.IR buffer .
-.PP
-Commands to
-.I ed
-have a simple and regular structure: zero or
-more
-.I addresses
-followed by a single character
-.I command,
-possibly
-followed by parameters to the command.
-These addresses specify one or more lines in the buffer.
-Missing addresses are supplied by default.
-.PP
-In general, only one command may appear on a line.
-Certain commands allow the 
-addition of text to the buffer.
-While
-.I ed
-is accepting text, it is said
-to be in
-.I  "input mode."
-In this mode, no commands are recognized;
-all input is merely collected.
-Input mode is left by typing a period `\fB.\fR' alone at the
-beginning of a line.
-.PP
-.I Ed
-supports a limited form of
-.I "regular expression"
-notation.
-A regular expression specifies
-a set of strings of characters.
-A member of this set of strings is said to be
-.I matched
-by the regular expression.
-In the following specification for regular expressions
-the word `character' means any character but newline.
-.IP 1.
-Any character except a special character
-matches itself.
-Special characters are
-the regular expression delimiter plus
-.RB \e\|[\| .
-and sometimes ^\|*\|$.
-.IP 2.
-A
-.B .
-matches any character.
-.IP 3.
-A \e followed by any character except a digit or (\|) matches that character.
-.IP 4.
-A nonempty string
-.I s
-bracketed
-.RI [ \|s\| ]
-(or
-.RI [^ s\| ])
-matches any character in (or not in)
-.I s.
-In 
-.I s,
-\e has no special meaning, and ] may only appear as
-the first letter.
-A substring 
-.I a\-b,
-with
-.I a
-and
-.I b
-in ascending ASCII order, stands for the inclusive
-range of ASCII characters.
-.IP 5.
-A regular expression of form 1-4 followed by * matches a sequence of
-0 or more matches of the regular expression.
-.IP 6.
-A regular expression,
-.I x,
-of form 1-8, bracketed
-.RI \e( \|x\| \e)
-matches what
-.I x
-matches.
-.IP 7.
-A \e followed by a digit 
-.I n
-matches a copy of the string that the
-bracketed regular expression beginning with the
-.IR n th
-\e( matched.
-.IP 8.
-A regular expression of form 1-8,
-.I x,
-followed by a regular expression of form 1-7,
-.I y
-matches a match for
-.I x
-followed by a match for
-.I y,
-with the
-.I x
-match being as long as possible while still permitting a
-.I y
-match.
-.IP 9.
-A regular expression of form 1-8 preceded by ^
-(or followed by $), is constrained to matches that
-begin at the left (or end at the right) end of a line.
-.IP 10.
-A regular expression of form 1-9 picks out the
-longest among the leftmost matches in a line.
-.IP 11.
-An empty regular expression stands for a copy of the
-last regular expression encountered.
-.PP
-Regular expressions are used in addresses to specify
-lines and in one command
-(see
-.I s
-below)\|
-to specify a portion of a line which is to be replaced.
-If it is desired to use one of
-the regular expression metacharacters as an ordinary
-character, that character may be preceded by `\e'.
-This also applies to the character bounding the regular
-expression (often `/')\| and to `\e' itself.
-.PP
-To understand addressing in
-.I ed
-it is necessary to know that at any time there is a
-.I  "current line."
-Generally speaking, the current line is
-the last line affected by a command; however,
-the exact effect on the current line
-is discussed under the description of
-the command.
-Addresses are constructed as follows.
-.TP
-1.
-The character `\fB.\fR' addresses the current line.
-.TP
-2.
-The character `$' addresses the last line of the buffer.
-.TP
-3.
-A decimal number
-.I n
-addresses the
-.IR n -th
-line of the buffer.
-.TP
-4.
-`\(fm\fIx\fR' addresses the line marked with the name
-.IR x ,
-which must be a lower-case letter.
-Lines are marked with the
-.I k
-command described below.
-.TP
-5.
-A regular expression enclosed in slashes `/' addresses
-the line found by searching forward from the current line
-and stopping at the first line containing a
-string that matches the regular expression.
-If necessary the search wraps around to the beginning of the
-buffer.
-.TP
-6.
-A regular expression enclosed in queries `?' addresses
-the line found by searching backward from the current line
-and stopping at the first line containing
-a string that matches the regular expression.
-If necessary
-the search wraps around to the end of the buffer.
-.TP
-7.
-An address followed by a plus sign `+'
-or a minus sign `\-' followed by a decimal number specifies that address plus
-(resp. minus)\| the indicated number of lines.
-The plus sign may be omitted.
-.TP
-8.
-If an address begins with `+' or `\-'
-the addition or subtraction is taken with respect to the current line;
-e.g. `\-5' is understood to mean `\fB.\fR\-5'.
-.TP
-9.
-If an address ends with `+' or `\-',
-then 1 is added (resp. subtracted).
-As a consequence of this rule and rule 8,
-the address `\-' refers to the line before the current line.
-Moreover,
-trailing
-`+' and `\-' characters
-have cumulative effect, so `\-\-' refers to the current
-line less 2.
-.TP
-10.
-To maintain compatibility with earlier versions of the editor,
-the character `^' in addresses is 
-equivalent to `\-'.
-.PP
-Commands may require zero, one, or two addresses.
-Commands which require no addresses regard the presence
-of an address as an error.
-Commands which accept one or two addresses
-assume default addresses when insufficient are given.
-If more addresses are given than such a command requires,
-the last one or two (depending on what is accepted)\| are used.
-.PP
-Addresses are separated from each other typically by a comma
-`\fB,\fR'.
-They may also be separated by a semicolon
-`\fB;\fR'.
-In this case the current line `\fB.\fR' is set to
-the previous address before the next address is interpreted.
-This feature can be used to determine the starting
-line for forward and backward searches (`/', `?')\|.
-The second address of any two-address sequence
-must correspond to a line following the line corresponding to the first address.
-.PP
-In the following list of
-.I ed
-commands, the default addresses
-are shown in parentheses.
-The parentheses are not part of
-the address, but are used to show that the given addresses are
-the default.
-.PP
-As mentioned, it is generally illegal for more than one
-command to appear on a line.
-However, most commands may be suffixed by `p'
-or by `l', in which case
-the current line is either
-printed or listed respectively
-in the way discussed below.
-.TP 5
-.RB (\| .\| )\|a
-.br
-.ns
-.TP 5
-<text>
-.br
-.ns
-.TP 5
-.B .
-.br
-The append command reads the given text
-and appends it after the addressed line.
-`\fB.\fR' is left
-on the last line input, if there
-were any, otherwise at the addressed line.
-Address `0' is legal for this command; text is placed
-at the beginning of the buffer.
-.TP 5
-.RB (\| .\| ,\  .\| )\|c
-.br
-.ns
-.TP 5
-<text>
-.br
-.ns
-.TP 5
-.B .
-.br
-The change
-command deletes the addressed lines, then accepts input
-text which replaces these lines.
-`\fB.\fR' is left at the last line input; if there were none,
-it is left at the line preceding the deleted lines.
-.TP 5
-.RB (\| .\| ,\  .\| )\|d
-The delete command deletes the addressed lines from the buffer.
-The line originally after the last line deleted becomes the current line;
-if the lines deleted were originally at the end,
-the new last line becomes the current line.
-.TP 5
-e filename
-The edit
-command causes the entire contents of the buffer to be deleted,
-and then the named file to be read in.
-`\fB.\fR' is set to the last line of the buffer.
-The number of characters read is typed.
-`filename' is remembered for possible use as a default file name
-in a subsequent
-.I r
-or
-.I w
-command.
-If `filename' is missing, the remembered name is used.
-.TP 5
-E filename
-This command is the same as
-.I e,
-except that no diagnostic results when no
-.I w
-has been given since the last buffer alteration.
-.TP 5
-f filename
-The filename command prints the currently remembered file name.
-If `filename' is given,
-the currently remembered file name is changed to `filename'.
-.TP 5
-(1,$)\|g/regular expression/command list
-In the global
-command, the first step is to mark every line which matches
-the given regular expression.
-Then for every such line, the
-given command list is executed with `\fB.\fR' initially set to that line.
-A single command or the first of multiple commands
-appears on the same line with the global command.
-All lines of a multi-line list except the last line must be ended with `\e'.
-.I A,
-.I i,
-and
-.I c
-commands and associated input are permitted;
-the `\fB.\fR' terminating input mode may be omitted if it would be on the
-last line of the command list.
-The commands
-.I g
-and
-.I v
-are not permitted in the command list.
-.TP 5
-.RB (\| .\| )\|i
-.ns
-.TP 5
-<text>
-.br
-.ns
-.TP 5
-.B .
-.br
-This command inserts the given text before the addressed line.
-`\fB.\fR' is left at the last line input, or, if there were none,
-at the line before the addressed line.
-This command differs from the
-.I a
-command only in the placement of the
-text.
-.TP 5
-.RB (\| .\| ,\  . +1)\|j
-This command joins the addressed lines into a single line;
-intermediate newlines simply disappear.
-`\fB.\fR' is left at the resulting line.
-.TP 5
-( \fB. \fR)\|k\fIx\fR
-The mark command marks the addressed line with
-name
-.I x,
-which must be a lower-case letter.
-The address form `\(fm\fIx\fR' then addresses this line.
-.ne 2.5
-.TP 5
-.RB (\| .\| ,\  .\| )\|l
-The list command
-prints the addressed lines in an unambiguous way:
-non-graphic characters are
-printed in two-digit octal,
-and long lines are folded.
-The
-.I l
-command may be placed on the same line after any non-i/o
-command.
-.TP 5
-.RB (\| .\| ,\  .\| )\|m\fIa
-The move command repositions the addressed lines after the line
-addressed by
-.IR a .
-The last of the moved lines becomes the current line.
-.TP 5
-.RB (\| .\| ,\  .\| )\|p
-The print command prints the addressed lines.
-`\fB.\fR'
-is left at the last line printed.
-The
-.I p
-command
-may
-be placed on the same line after any non-i/o command.
-.TP
-.RB (\| .\| ,\  .\| )\|P
-This command is a synonym for
-.I p.
-.TP 5
-q
-The quit command causes
-.I ed
-to exit.
-No automatic write
-of a file is done.
-.TP 5
-Q
-This command is the same as
-.I q,
-except that no diagnostic results when no
-.I w
-has been given since the last buffer alteration.
-.TP 5
-($)\|r filename
-The read command
-reads in the given file after the addressed line.
-If no file name is given,
-the remembered file name, if any, is used
-(see
-.I e
-and
-.I f
-commands)\|.
-The file name is remembered if there was no
-remembered file name already.
-Address `0' is legal for
-.I r
-and causes the
-file to be read at the beginning of the buffer.
-If the read is successful, the number of characters
-read is typed.
-`\fB.\fR' is left at the last line read in from the file.
-.TP 5
-(\| \fB.\fR\|, \fB.\fR\|)\|s/regular expression/replacement/       or,
-.br
-.ns
-.TP 5
-(\| \fB.\fR\|, \fB.\fR\|)\|s/regular expression/replacement/g
-The substitute command searches each addressed
-line for an occurrence of the specified regular expression.
-On each line in which a match is found,
-all matched strings are replaced by the replacement specified,
-if the global replacement indicator `g' appears after the command.
-If the global indicator does not appear, only the first occurrence
-of the matched string is replaced.
-It is an error for the substitution to fail on all addressed lines.
-Any character other than space or new-line
-may be used instead of `/' to delimit the regular expression
-and the replacement.
-`\fB.\fR' is left at the last line substituted.
-.IP
-An ampersand `&' appearing in the replacement
-is replaced by the string matching the regular expression.
-The special meaning of `&' in this context may be
-suppressed by preceding it by `\e'.
-The characters
-.I `\|\en'
-where
-.I n
-is a digit,
-are replaced by the text matched by the
-.IR n -th
-regular subexpression
-enclosed between `\e(' and `\e)'.
-When
-nested, parenthesized subexpressions
-are present,
-.I n
-is determined by counting occurrences of `\e(' starting from the left.
-.IP
-Lines may be split by substituting new-line characters into them.
-The new-line in the
-replacement string
-must be escaped by preceding it by `\e'.
-.TP 5
-.RB (\| .\| ,\  .\| )\|t\|\fIa
-This command acts just like the
-.I m
-command, except that a copy of the addressed lines is placed
-after address
-.I a
-(which may be 0).
-`\fB.\fR' is left on the last line of the copy.
-.TP 5
-.RB (\| .\| ,\  .\| )\|u
-The undo command restores the preceding contents
-of the current line, which must be the last line
-in which a substitution was made.
-.TP 5
-(1, $)\|v/regular expression/command list
-This command is the same as the global command
-.I g
-except that the command list is executed
-.I g
-with `\fB.\fR' initially set to every line
-.I except
-those
-matching the regular expression.
-.TP 5
-(1, $)\|w filename
-.br
-The write command writes the addressed lines onto
-the given file.
-If the file does not exist,
-it is created mode 666 (readable and writable by everyone)\|.
-The file name is remembered if there was no 
-remembered file name already.
-If no file name is given,
-the remembered file name, if any, is used
-(see
-.I e
-and
-.I f
-commands)\|.
-`\fB.\fR' is unchanged.
-If the command is successful, the number of characters written is
-printed.
-.TP
-(1,$)W filename
-This command is the same as
-.I w,
-except that the addressed lines are appended to the file.
-.TP 5
-x
-A key string is demanded from the standard input.
-Later
-.I r, e
-and
-.I w
-commands will encrypt and decrypt the text 
-with this key by the algorithm of 
-.IR crypt (1).
-An explicitly empty key turns off encryption.
-.TP 5
-($)\|=
-The line number of the addressed line is typed.
-`\fB.\fR' is unchanged by this command.
-.TP 5
-!<shell command>
-The remainder of the line after the `!' is sent
-to
-.IR sh (1)
-to be interpreted as a command.
-.RB ` . '
-is unchanged.
-.TP 5
-.RB (\| . +1)\|<newline>
-An address alone on a line causes the addressed line to be printed.
-A blank line alone is equivalent to `.+1p'; it is useful
-for stepping through text.
-.PP
-If an interrupt signal (ASCII DEL)\| is sent,
-.I ed
-prints a `?' and returns to its command level.
-.PP
-Some size limitations:
-512 characters per line,
-256 characters per global command list,
-64 characters per file name,
-and 128K characters in the temporary file.
-The limit on the number of lines depends on the amount of core:
-each line takes 1 word.
-.PP
-When reading a file,
-.I ed
-discards ASCII NUL characters
-and all characters after the last newline.
-It refuses to read files containing non-ASCII characters.
-.SH FILES
-/tmp/e*
-.br
-ed.hup: work is saved here if terminal hangs up
-.SH "SEE ALSO"
-B. W. Kernighan,
-.I
-A Tutorial Introduction to the ED Text Editor
-.br
-B. W. Kernighan,
-.I Advanced editing on UNIX
-.br
-sed(1), crypt(1)
-.SH DIAGNOSTICS
-`?name' for inaccessible file;
-`?' for
-errors in commands;
-`?TMP' for temporary file overflow.
-.PP
-To protect against throwing away valuable work,
-a
-.I q
-or
-.I e
-command is considered to be in error, unless a
-.I w
-has occurred since the last buffer change.
-A second
-.I q
-or
-.I e
-will be obeyed regardless.
-.SH BUGS
-The 
-.I l
-command mishandles DEL.
-.br
-A
-.I !
-command cannot be subject to a
-.I g
-command.
-.br
-Because 0 is an illegal address for a
-.I w
-command, it is not possible to
-create an empty file with
-.I ed.
diff --git a/.ref-Research-V7/usr/man/man1/eqn.1 b/.ref-Research-V7/usr/man/man1/eqn.1
deleted file mode 100644 (file)
index 6248445..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-.EQ
-delim $$
-.EN
-.TH EQN 1 2/22/74
-.SH NAME
-eqn, neqn, checkeq  \-  typeset mathematics
-.SH SYNOPSIS
-.B eqn
-[
-.BR \-d xy
-] [
-.BR \-p n
-] [
-.BR \-s n
-] [
-.BR \-f n
-] 
-[ file ] ...
-.br
-.B checkeq
-[ file ] ...
-.SH DESCRIPTION
-.I Eqn
-is a
-troff(1)
-preprocessor
-for typesetting mathematics
-on a Graphic Systems phototypesetter,
-.I neqn
-on terminals.
-Usage is almost always
-.PP
-       eqn file ... | troff
-.br
-       neqn file ... | nroff
-.PP
-If no files are specified, 
-these programs
-reads from the standard input.
-A line beginning with `.EQ' marks the start of an equation;
-the end of an equation
-is marked by a line beginning with `.EN'.
-Neither of these lines is altered,
-so they may be defined in macro packages
-to get
-centering, numbering, etc.
-It is also possible to set two characters as `delimiters';
-subsequent text between delimiters is also treated as
-.ul
-eqn
-input.
-Delimiters may be set to characters
-.I x
-and
-.I y
-with the command-line argument
-.BI \-d xy
-or (more commonly) with
-`delim
-.IR xy '
-between .EQ and .EN.
-The left and right delimiters may be identical.
-Delimiters are turned off by `delim off'.
-All text that is neither between delimiters nor between .EQ and .EN
-is passed through untouched.
-.PP
-The program
-.I checkeq
-reports missing or unbalanced delimiters and .EQ/.EN pairs.
-.PP
-Tokens within
-.I eqn
-are separated by
-spaces, tabs, newlines, braces, double quotes,
-tildes or circumflexes.
-Braces {} are used for grouping;
-generally speaking,
-anywhere a single character like
-.I x
-could appear, a complicated construction
-enclosed in braces may be used instead.
-Tilde ~ represents a full space in the output,
-circumflex ^ half as much.
-.PP
-.vs 13p
-Subscripts and superscripts are produced with the keywords
-.B sub
-and
-.B sup.
-Thus
-.I "x sub i" 
-makes
-$x sub i$, 
-.I "a sub i sup 2"
-produces
-$a sub i sup 2$,
-and
-.I "e sup {x sup 2 + y sup 2}"
-gives
-$e sup {x sup 2 + y sup 2}$.
-.PP
-Fractions are made with
-.BR over :
-.I "a over b"
-yields $a over b$.
-.PP
-.B sqrt
-makes square roots:
-.I "1 over sqrt {ax sup 2 +bx+c}"
-results in
-$1 over sqrt {ax sup 2 +bx+c}$ .
-.PP
-The keywords
-.B from
-and
-.B to
-introduce lower and upper
-limits on arbitrary things:
-$lim from {n-> inf} sum from 0 to n x sub i$
-is made with
-.I "lim from {n\-> inf } sum from 0 to n x sub i."
-.PP
-Left and right brackets, braces, etc., of the right height are made with
-.B left
-and
-.B right:
-.I "left [ x sup 2 + y sup 2 over alpha right ] ~=~1"
-produces
-$left [ x sup 2 + y sup 2 over alpha right ] ~=~1$.
-The
-.B right
-clause is optional.
-Legal characters after 
-.B left
-and
-.B right
-are braces, brackets, bars,
-.B c
-and
-.B f
-for ceiling and floor,
-and "" for nothing at all (useful for a right-side-only bracket).
-.PP
-Vertical piles of things are made with 
-.BR pile ,
-.BR lpile ,
-.BR cpile ,
-and
-.BR rpile :
-.I "pile {a above b above c}"
-produces
-$pile {a above b above c}$.
-There can be an arbitrary number of elements in a pile.
-.B lpile
-left-justifies,
-.B pile
-and
-.B cpile
-center, with different vertical spacing,
-and 
-.B rpile
-right justifies.
-.PP
-Matrices are made with
-.BR matrix :
-.I "matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }"
-produces
-$matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }$.
-In addition, there is
-.B rcol
-for a right-justified column.
-.PP
-.vs 12p
-Diacritical marks are made with
-.BR dot ,
-.BR dotdot ,
-.BR hat ,
-.BR tilde ,
-.BR bar ,
-.BR vec ,
-.BR dyad ,
-and
-.BR under :
-.I "x dot = f(t) bar"
-is
-$x dot = f(t) bar$,
-.I "y dotdot bar ~=~ n under"
-is
-$y dotdot bar ~=~ n under$,
-and
-.I "x vec ~=~ y dyad"
-is
-$x vec ~=~ y dyad$.
-.PP
-Sizes and font can be changed with
-.B size
-.I n
-or
-.B size
-.BI \(+- n,
-.BR roman ,
-.BR italic ,
-.BR bold ,
-and
-.BR font
-.I n.
-Size and fonts can be changed globally in a document by
-.B gsize
-.I n
-and
-.B gfont
-.IR n ,
-or by the command-line arguments
-.BI \-s n
-and
-.BI \-f n.
-.PP
-Normally subscripts and superscripts are reduced by
-3 point sizes from the previous size;
-this may be changed by the command-line argument
-.BI \-p n.
-.PP
-Successive display arguments can be lined up.
-Place
-.B mark
-before the desired lineup point in the first equation;
-place
-.B lineup
-at the place that is to line up vertically in subsequent equations.
-.PP
-Shorthands may be defined
-or existing keywords redefined with
-.BI define :
-.I "define thing % replacement %"
-defines a new token called
-.I thing
-which will be replaced by
-.I replacement
-whenever it appears thereafter.
-The 
-.I %
-may be any character that does not occur in
-.I replacement.
-.PP
-Keywords like 
-.I sum
-.EQ
-( sum )
-.EN
-.I int
-.EQ
-( int )
-.EN
-.I inf
-.EQ
-( inf )
-.EN
-and shorthands like
->=
-.EQ
-(>=)
-.EN
-\->
-.EQ
-(->),
-.EN
-and
-!=
-.EQ
-( != )
-.EN
-are recognized.
-Greek letters are spelled out in the desired case, as in
-.I alpha
-or
-.I GAMMA.
-Mathematical words like sin, cos, log are made Roman automatically.
-.IR Troff (1)
-four-character escapes like \e(bs (\(bs)
-can be used anywhere.
-Strings enclosed in double quotes "..."
-are passed through untouched;
-this permits keywords to be entered as text,
-and can be used to communicate
-with 
-.I troff
-when all else fails.
-.SH "SEE ALSO"
-.PP
-troff(1), tbl(1), ms(7), eqnchar(7)
-.br
-B. W. Kernighan and L. L. Cherry,
-.ul
-Typesetting Mathematics\(emUser's Guide
-.br
-J. F. Ossanna,
-.ul
-NROFF/TROFF User's Manual
-.SH BUGS
-.PP
-To embolden digits, parens, etc.,
-it is necessary to quote them,
-as in `bold "12.3"'.
diff --git a/.ref-Research-V7/usr/man/man1/expr.1 b/.ref-Research-V7/usr/man/man1/expr.1
deleted file mode 100644 (file)
index dd63e6a..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-.TH EXPR 1 
-.SH NAME
-expr \- evaluate arguments as an expression
-.SH SYNOPSIS
-.B expr
-arg
-.B .\|.\|.
-.SH DESCRIPTION
-The arguments are taken as an expression.
-After evaluation, the result is written on the standard output.
-Each token of the expression is a separate argument.
-.PP
-The operators and keywords are listed below.
-The list is in order of increasing precedence,
-with equal precedence operators grouped.
-.TP
-.I expr | expr
-yields the first
-.I expr
-if it is neither null nor `0', otherwise
-yields the second
-.I expr.
-.TP
-.I expr & expr
-yields the first
-.I expr
-if neither
-.I expr
-is null or `0', otherwise yields `0'.
-.TP
-.I expr relop expr
-where
-.I relop is one of
-< <= = != >= >,
-yields `1' if the indicated comparison is true, `0' if false.
-The comparison is numeric if both
-.I expr
-are integers, otherwise lexicographic.
-.TP
-.IR expr " + " expr
-.br
-.IR expr " - " expr
-.br
-addition or subtraction of the arguments.
-.TP
-.IR expr " * " expr
-.br
-.IR expr " / " expr
-.br
-.IR expr " % " expr
-.br
-multiplication, division, or remainder of the arguments.
-.TP
-.IR expr " : " expr
-The matching operator compares the string first argument
-with the regular expression second argument;
-regular expression syntax is the same as that of
-.IR ed (1).
-The
-\fB\\(\|.\|.\|.\|\\)\fP
-pattern symbols can be used to select a portion of the
-first argument.
-Otherwise,
-the matching operator yields the number of characters matched
-(`0' on failure).
-.TP
-.RI ( " expr " )
-parentheses for grouping.
-.PP
-Examples:
-.PP
-To add 1 to the Shell variable
-.IR a :
-.IP
-a=\`expr $a + 1\`
-.PP
-To find the filename part (least significant part)
-of the pathname stored in variable
-.I a,
-which may or may not contain `/':
-.IP
-expr $a : \'.*/\e(\^.*\e)\' \'\^|\' $a
-.LP
-Note the quoted Shell metacharacters.
-.SH "SEE ALSO"
-ed(1), sh(1), test(1)
-.SH DIAGNOSTICS
-.I Expr
-returns the following exit codes:
-.PP
-       0       if the expression is neither null nor `0',
-.br
-       1       if the expression
-is null or `0',
-.br
-       2       for invalid expressions.
diff --git a/.ref-Research-V7/usr/man/man1/f77.1 b/.ref-Research-V7/usr/man/man1/f77.1
deleted file mode 100644 (file)
index 2b86249..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-.TH F77 1
-.SH NAME
-f77 \- Fortran 77 compiler
-.SH SYNOPSIS
-.B f77
-[ option ] ... file ...
-.SH DESCRIPTION
-.I F77
-is the UNIX Fortran 77 compiler.
-It accepts several types of arguments:
-.PP
-Arguments whose names end with `.f' are taken to be
-Fortran 77 source programs;
-they are compiled, and
-each object program is left on the file in the current directory
-whose name is that of the source with `.o' substituted
-for '.f'.
-.PP
-Arguments whose names end with `.r' or `.e' are taken to be Ratfor or EFL
-source programs, respectively; these are first transformed by the
-appropriate preprocessor, then compiled by f77.
-.PP
-In the same way,
-arguments whose names end with `.c' or `.s' are taken to be C or assembly source programs
-and are compiled or assembled, producing a `.o' file.
-.PP
-The following options have the same meaning as in
-.IR cc (1).
-See
-.IR ld (1)
-for load-time options.
-.TP
-.B \-c
-Suppress loading and produce `.o' files for each source 
-file.
-.TP
-.B \-p
-Prepare object files for profiling, see
-.IR  prof (1).
-.TP
-.SM
-.B \-O
-Invoke an
-object-code optimizer.
-.TP
-.SM
-.B \-S
-Compile the named programs, and leave the
-assembler-language output on corresponding files suffixed `.s'.
-(No `.o' is created.).
-.TP
-.B \-f
-Use a floating point interpreter (for PDP11's that lack
-11/70-style floating point).
-.TP
-.BR \-o " output"
-Name the final output file
-.I output
-instead of `a.out'.
-.PP
-The following options are peculiar to
-.IR f77 .
-.TP
-.SM
-.BR \-onetrip
-Compile DO loops that are performed at least once if reached.
-(Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.)
-.TP
-.BR \-u
-Make the default type of a variable `undefined' rather than using the default Fortran rules.
-.TP
-.BR \-C
-Compile code to check that subscripts are within declared array bounds.
-.TP
-.BR \-w
-Suppress all warning messages.
-If the option is `\-w66', only Fortran 66 compatibility warnings are suppressed.
-.TP
-.BR \-F
-Apply EFL and Ratfor preprocessor to relevant files, put the result in the file
-with the suffix changed to `.f', but do not compile.
-.TP
-.BR \-m
-Apply the M4 preprocessor to each `.r' or `.e' file before transforming
-it with the Ratfor or EFL preprocessor.
-.TP
-.TP
-.BI \-E x
-Use the string
-.I x
-as an EFL option in processing `.e' files.
-.TP
-.BI \-R x
-Use the string 
-.I x
-as a Ratfor option in processing `.r' files.
-.PP
-Other arguments
-are taken
-to be either loader option arguments, or F77-compatible
-object programs, typically produced by an earlier
-run,
-or perhaps libraries of F77-compatible routines.
-These programs, together with the results of any
-compilations specified, are loaded (in the order
-given) to produce an executable program with name
-`a.out'.
-.SH FILES
-.nf
-.ta \w'/usr/lib/f77rt0.o 'u
-file.[fresc]   input file
-file.o object file
-a.out  loaded output
-./fort[pid].?  temporary
-/usr/lib/f77pass1      compiler
-/lib/c1        pass 2
-/lib/c2        optional optimizer
-/usr/lib/libF77.a      intrinsic function library
-/usr/lib/libI77.a      Fortran I/O library
-/lib/libc.a    C library, see section 3
-.fi
-.SH "SEE ALSO"
-S. I. Feldman,
-P. J. Weinberger,
-.I
-A Portable Fortran 77 Compiler
-.br
-prof(1), cc(1), ld(1)
-.SH DIAGNOSTICS
-The diagnostics produced by
-.I f77
-itself are intended to be
-self-explanatory.
-Occasional messages may be produced by the loader.
-.SH BUGS
-The Fortran 66 subset of the language has been
-exercised extensively;
-the newer features have not.
diff --git a/.ref-Research-V7/usr/man/man1/factor.1 b/.ref-Research-V7/usr/man/man1/factor.1
deleted file mode 100644 (file)
index 44d579c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-.TH FACTOR 1 
-.SH NAME
-factor, primes \- factor a number, generate large primes
-.SH SYNOPSIS
-.B factor
-[ number ]
-.PP
-.B primes
-.SH DESCRIPTION
-When
-.I factor
-is invoked without an argument, it waits for a number to be typed in.
-If you type in a positive
-number less than 2\u\s756\s0\d (about
-.if n 7.2e16)
-.if t 7.2\(mu10\u\s716\s0\d\|)
-it will factor the number and print its prime factors; each one is printed
-the proper number of times.
-Then it waits for another number.
-It exits if it encounters a zero or any non-numeric character.
-.PP
-If
-.I factor
-is invoked with an argument, it factors the number
-as above and then exits.
-.PP
-Maximum time to factor is proportional to
-.if n sqrt(n)
-.if t \(sr\o'\fIn\fR\(rn'
-and occurs when
-.I n
-is prime
-or the square of a prime.
-It takes 1 minute to factor a prime
-near
-10\u\s714\s0\d
-on a PDP11.
-.PP
-When
-.I primes
-is invoked, it waits for a number to be typed in.
-If you type in a positive
-number less than 2\u\s756\s0\d
-it will print all primes greater than or
-equal to this number.
-.SH DIAGNOSTICS
-`Ouch.' for input out of range or for garbage input.
diff --git a/.ref-Research-V7/usr/man/man1/file.1 b/.ref-Research-V7/usr/man/man1/file.1
deleted file mode 100644 (file)
index 7c7786c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.TH FILE 1 
-.SH NAME
-file \- determine file type
-.SH SYNOPSIS
-.B file
-file ...
-.SH DESCRIPTION
-.I File
-performs a series of tests on each argument
-in an attempt to classify it.
-If an argument appears to be ascii,
-.I file
-examines the first 512 bytes
-and tries to guess its language.
-.SH BUGS
-It often makes mistakes.
-In particular it often suggests that
-command files are C programs.
diff --git a/.ref-Research-V7/usr/man/man1/find.1 b/.ref-Research-V7/usr/man/man1/find.1
deleted file mode 100644 (file)
index bad926d..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-.TH FIND 1 
-.SH NAME
-find \- find files
-.SH SYNOPSIS
-.B find
-pathname-list  expression
-.SH DESCRIPTION
-.I Find
-recursively descends
-the directory hierarchy for
-each pathname in the
-.I pathname-list
-(i.e., one or more pathnames)
-seeking files that match a boolean
-.I expression
-written in the primaries given below.
-In the descriptions, the argument
-.I n
-is used as a decimal integer
-where
-.I +n
-means more than
-.I n,
-.I \-n
-means less than
-.I n
-and
-.I n
-means exactly
-.IR n .
-.TP 10n
-.BR \-name " filename"
-True if the
-.I filename
-argument matches the current file name.
-Normal
-Shell
-argument syntax may be used if escaped (watch out for
-`[', `?' and `*').
-.TP
-.BR \-perm " onum"
-True if the file permission flags
-exactly
-match the
-octal number
-.I onum
-(see
-.IR  chmod (1)).
-If
-.I onum
-is prefixed by a minus sign,
-more flag bits (017777, see
-.IR   stat (2))
-become significant and
-the flags are compared:
-.IR (flags&onum)==onum .
-.TP
-.BR \-type " c"
-True if the type of the file
-is
-.I c,
-where
-.I c
-is
-.B "b, c, d"
-or
-.B f
-for
-block special file, character special file,
-directory or plain file.
-.TP
-.BR \-links " n"
-True if the file has
-.I n
-links.
-.TP
-.BR \-user " uname"
-True if the file belongs to the user
-.I uname
-(login name or numeric user ID).
-.TP
-.BR \-group " gname"
-True if the file belongs to group
-.I gname
-(group name or numeric group ID).
-.TP
-.BR \-size " n"
-True if the file is
-.I n
-blocks long (512 bytes per block).
-.TP
-.BR \-inum " n"
-True if the file has inode number
-.I n.
-.TP
-.BR \-atime " n"
-True if the file has been accessed in
-.I n
-days.
-.TP
-.BR \-mtime " n"
-True if the file has been modified in
-.I n
-days.
-.TP
-.BR \-exec " command"
-True if the executed command returns
-a zero value as exit status.
-The end of the command must be punctuated by an escaped
-semicolon.
-A command argument `{}' is replaced by the
-current pathname.
-.TP
-.BR \-ok " command"
-Like
-.B \-exec
-except that the generated command is written on
-the standard output, then the standard input is read
-and the command executed only upon response
-.BR y .
-.TP
-.B  \-print
-Always true;
-causes the current pathname to be printed.
-.TP
-.BR \-newer " file"
-True if
-the current file has been modified more recently than the argument
-.I file.
-.PP
-The primaries may be combined using the following operators
-(in order of decreasing precedence):
-.TP 4
-1)
-A parenthesized group of primaries and operators
-(parentheses are special to the Shell and must be escaped).
-.TP 4
-2)
-The negation of a primary
-(`!' is the unary
-.I not
-operator).
-.TP 4
-3)
-Concatenation of primaries
-(the
-.I and
-operation
-is implied by the juxtaposition of two primaries).
-.TP 4
-4)
-Alternation of primaries
-.RB "(`" \-o "' is the"
-.I or
-operator).
-.SH EXAMPLE
-To remove all files named
-`a.out' or `*.o' that have not been accessed for a week:
-.IP "" .2i
-find / \\( \-name a.out \-o \-name '*.o' \\)
-\-atime +7 \-exec rm {} \\;
-.SH FILES
-/etc/passwd
-.br
-/etc/group
-.SH "SEE ALSO"
-sh(1), test(1), filsys(5)
-.SH BUGS
-The syntax is painful.
diff --git a/.ref-Research-V7/usr/man/man1/graph.1g b/.ref-Research-V7/usr/man/man1/graph.1g
deleted file mode 100644 (file)
index 27c7dc0..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-.TH GRAPH 1G 
-.SH NAME
-graph \- draw a graph
-.SH SYNOPSIS
-.B graph
-[ option ] ...
-.SH DESCRIPTION
-.I Graph
-with no options takes pairs of numbers from the
-standard input as abscissas and
-ordinates of a graph.
-Successive points are connected by straight lines.
-The graph is encoded on the standard output
-for display by the
-.IR  plot (1)
-filters.
-.PP
-If the coordinates of a point are followed by
-a nonnumeric string, that string is printed as a
-label beginning on the point.
-Labels may be surrounded with quotes "...", in
-which case they may be empty or contain blanks
-and numbers;
-labels never contain newlines.
-.PP
-The following options are recognized,
-each as a separate argument.
-.TP
-.B  \-a
-Supply abscissas automatically (they are missing from
-the input); spacing is given by the next
-argument (default 1).
-A second optional argument is the starting point for
-automatic abscissas (default 0 or lower limit given by
-.BR \-x ).
-.TP
-.B  \-b
-Break (disconnect) the graph after each label in the input.
-.TP
-.B  \-c
-Character string given by next argument
-is default label for each point.
-.TP
-.B  \-g
-Next argument is grid style,
-0 no grid, 1 frame with ticks, 2 full grid (default).
-.TP
-.B  \-l
-Next argument is label for graph.
-.TP
-.B  \-m
-Next argument is mode (style)
-of connecting lines:
-0 disconnected, 1 connected (default).
-Some devices give distinguishable line styles
-for other small integers.
-.TP
-.B  \-s
-Save screen, don't erase before plotting.
-.TP
-\fB\-x\fR [ \fBl\fR ]
-If
-.B l
-is present, x axis is logarithmic.
-Next 1 (or 2) arguments are lower (and upper)
-.IR x ""
-limits.
-Third argument, if present, is grid spacing on 
-.I x
-axis.
-Normally these quantities are determined automatically.
-.TP
-\fB\-y\fR [ \fBl\fR ]
-Similarly for
-.IR y .
-.TP
-.B  \-h
-Next argument is fraction of space for height.
-.TP
-.B  \-w
-Similarly for width.
-.TP
-.B  \-r
-Next argument is fraction of space to move right before plotting.
-.TP
-.B  \-u
-Similarly to move up before plotting.
-.TP
-.B  \-t
-Transpose horizontal and vertical axes.
-(Option
-.B \-x
-now applies to the vertical axis.)
-.PP
-A legend indicating grid range is produced
-with a grid unless the
-.B \-s
-option is present.
-.PP
-If a specified lower limit exceeds the upper limit,
-the axis
-is reversed.
-.SH "SEE ALSO"
-spline(1), plot(1)
-.SH BUGS
-.I Graph
-stores all points internally and drops those for which
-there isn't room.
-.br
-Segments that run out of bounds are dropped, not windowed.
-.br
-Logarithmic axes may not be reversed.
diff --git a/.ref-Research-V7/usr/man/man1/grep.1 b/.ref-Research-V7/usr/man/man1/grep.1
deleted file mode 100644 (file)
index 18780de..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-.TH GREP 1 
-.SH NAME
-grep, egrep, fgrep \- search a file for a pattern
-.SH SYNOPSIS
-.B grep
-[ option ] ...
-expression [ file ] ...
-.LP
-.B egrep 
-[ option ] ...
-[ expression ]
-[ file ] ...
-.PP
-.B fgrep
-[ option ] ...
-[ strings ]
-[ file ]
-.SH DESCRIPTION
-Commands of the
-.I grep
-family search the input
-.I files
-(standard input default)
-for lines matching
-a pattern.
-Normally, each line found
-is copied to the standard output;
-unless the
-.B \-h
-flag is used,
-the file name is shown if there is more than one input file.
-.PP
-.I Grep
-patterns are limited regular expressions in the style of
-.IR ed (1);
-it uses a compact nondeterministic algorithm.
-.I Egrep
-patterns are full regular expressions;
-it uses a fast deterministic algorithm that
-sometimes needs exponential space.
-.I Fgrep
-patterns are fixed strings; it is fast and compact.
-.PP
-The following options are recognized.
-.TP
-.B \-v
-All lines but those matching
-are printed.
-.TP
-.B \-c
-Only a count of matching lines is printed.
-.TP
-.B \-l
-The names of files with matching lines are listed (once)
-separated by newlines.
-.TP
-.B \-n
-Each line is preceded by
-its line number in the file.
-.TP
-.B \-b
-Each line is preceded by the block number
-on which it was found.
-This is sometimes useful in locating
-disk block numbers by context.
-.TP
-.B \-s
-No output is produced, only status.
-.TP
-.B \-h
-Do not print filename headers with output lines.
-.TP
-.B \-y
-Lower case letters in the pattern will also match
-upper case letters in the input
-.RI ( grep
-only).
-.TP
-.BI \-e " expression"
-Same as a simple
-.I expression 
-argument,
-but useful when the
-.I expression
-begins with a \-.
-.TP
-.BI \-f " file"
-The regular expression
-.RI ( egrep )
-or string list
-.RI ( fgrep ) 
-is taken from the
-.I file.
-.TP
-.B \-x
-(Exact) only lines matched in their entirety are printed
-.RI ( fgrep
-only).
-.PP
-Care should be taken when
-using the characters
-$ * [ ^ | ? \' " ( ) and \e in the
-.I expression
-as they are
-also meaningful to the Shell.
-It is safest to enclose the
-entire
-.I expression
-argument in single quotes \' \'.
-.PP
-.I Fgrep
-searches for lines that contain one of the (newline-separated)
-.I strings.
-.PP
-.I Egrep
-accepts extended regular expressions.
-In the following description `character' excludes
-newline:
-.IP
-A \e followed by a single character
-matches that character.
-.IP
-The character ^
-($) matches the beginning (end) of a line.
-.IP
-A 
-.B .
-matches any character.
-.IP
-A single character not otherwise endowed with special
-meaning matches that character.
-.IP
-A string enclosed in brackets [\|]
-matches any single character from the string.
-Ranges of ASCII character codes may be abbreviated
-as in `a\-z0\-9'.
-A ]
-may occur only as the first character of the string.
-A literal \- must be placed where it can't be
-mistaken as a range indicator.
-.IP
-A regular expression followed by * (+, ?) matches a sequence
-of 0 or more (1 or more, 0 or 1)
-matches of the regular expression.
-.IP
-Two regular expressions concatenated
-match a match of the first followed by a match of 
-the second.
-.IP
-Two regular expressions separated by | or newline
-match either a match for the first or a match for the
-second.
-.IP
-A regular expression enclosed in parentheses
-matches a match for the regular expression.
-.LP
-The order of precedence of operators
-at the same parenthesis level
-is [\|] then
-*+? then concatenation then | and newline.
-.SH "SEE ALSO"
-ed(1),
-sed(1),
-sh(1)
-.SH DIAGNOSTICS
-Exit status is 0 if any matches are found,
-1 if none, 2 for syntax errors or inaccessible files.
-.SH BUGS
-Ideally there should be only one
-.I grep,
-but we don't know a single algorithm that spans a wide enough
-range of space-time tradeoffs.
-.PP
-Lines
-are limited to 256 characters;
-longer lines are truncated.
diff --git a/.ref-Research-V7/usr/man/man1/icheck.1m b/.ref-Research-V7/usr/man/man1/icheck.1m
deleted file mode 100644 (file)
index 70fd421..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-.TH ICHECK 1M 
-.SH NAME
-icheck \- file system storage consistency check
-.SH SYNOPSIS
-.B icheck
-[
-.B \-s
-]  [
-.B \-b
-numbers ]
-[ filesystem ]
-.SH DESCRIPTION
-.I Icheck
-examines a file system,
-builds a bit map of used blocks,
-and compares this bit map against
-the free list maintained on the file system.
-If the file system is not specified,
-a set of default file systems
-is checked.
-The normal output of
-.I icheck
-includes a report of
-.IP ""
-The total number of files and the numbers of
-regular, directory, block special and character special files.
-.IP ""
-The total number of blocks in use and the numbers of 
-single-, double-, and triple-indirect blocks and directory blocks.
-.IP ""
-The number of free blocks.
-.IP ""
-The number of blocks missing; i.e. not in any file
-nor in the free list.
-.PP
-The
-.B \-s
-option causes
-.I icheck
-to ignore the actual free list and reconstruct a new one
-by rewriting the super-block of the file system.
-The file system should be dismounted while this is done;
-if this is not possible (for example if
-the root file system has to be salvaged)
-care should be taken that the system is quiescent and that
-it is rebooted immediately afterwards so that the old, bad in-core
-copy of the super-block will not continue to be used.
-Notice also that
-the words in the super-block
-which indicate the size of the free list and of the
-i-list are believed.
-If the super-block has been curdled
-these words will have to be patched.
-The
-.B \-s
-option
-causes the normal output reports to be suppressed.
-.PP
-Following the
-.B \-b
-option is a list of block numbers;
-whenever any of the named blocks turns up in a file,
-a diagnostic is produced.
-.PP
-.I Icheck
-is faster if the raw version of the special file is used,
-since it reads the i-list many blocks at a time.
-.SH FILES
-Default file systems vary with installation.
-.SH "SEE ALSO"
-dcheck(1), ncheck(1),
-filsys(5), clri(1)
-.SH DIAGNOSTICS
-For duplicate blocks
-and bad blocks (which lie outside the file system)
-.I icheck
-announces the difficulty, the i-number, and the kind of block involved.
-If a read error is encountered,
-the block number of the bad block is printed and
-.I icheck
-considers it to contain 0.
-`Bad freeblock' means that
-a block number outside the available space was encountered in the free list.
-`\fIn\fR dups in free'
-means that
-.IR n ""
-blocks were found in the free list which
-duplicate blocks either in some file or in the earlier part of the free list.
-.SH BUGS
-Since
-.I icheck
-is inherently two-pass in nature, extraneous diagnostics
-may be produced if applied to active file systems.
-.br
-It believes even preposterous super-blocks and
-consequently can get core images.
diff --git a/.ref-Research-V7/usr/man/man1/intro.1 b/.ref-Research-V7/usr/man/man1/intro.1
deleted file mode 100644 (file)
index b45787a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-.TH INTRO 1 
-.SH NAME
-intro \- introduction to commands
-.SH DESCRIPTION
-This section describes publicly accessible commands
-in alphabetic order.
-Certain distinctions of purpose are made in the headings:
-.TP
-(1)
-Commands of general utility.
-.TP
-(1C)
-Commands for communication with other systems.
-.TP
-(1G)
-Commands used primarily for graphics and computer-aided design.
-.TP
-(1M)
-Commands used primarily for system maintenance.
-.PP
-The word `local' at the foot of a page means that the
-command is not intended for general distribution.
-.SH SEE ALSO
-.SH DIAGNOSTICS
-Section (6) for computer games.
-.PP
-.I How to get started,
-in the Introduction.
-.SH DIAGNOSTICS
-Upon termination each command returns two bytes of status,
-one supplied by the system giving the cause for
-termination, and (in the case of `normal' termination)
-one supplied by the program,
-see
-.I wait
-and
-.IR exit (2).
-The former byte is 0 for normal termination, the latter
-is customarily 0 for successful execution, nonzero
-to indicate troubles such as erroneous parameters, bad or inaccessible data,
-or other inability to cope with the task at hand.
-It is called variously `exit code', `exit status' or
-`return code', and is described only where special
-conventions are involved.
diff --git a/.ref-Research-V7/usr/man/man1/iostat.1m b/.ref-Research-V7/usr/man/man1/iostat.1m
deleted file mode 100644 (file)
index dbba3ba..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-.TH IOSTAT 1M 
-.SH NAME
-iostat \- report I/O statistics
-.SH SYNOPSIS
-.B iostat
-[ option ] ...
-[ interval [ count ] ]
-.SH DESCRIPTION
-.I Iostat
-delves into the system and reports certain statistics kept about
-input-output activity.
-Information is kept about up to three different disks
-(RF, RK, RP) and about typewriters.
-For each disk, IO completions and number of words transferred
-are counted; for typewriters collectively, the number
-of input and output characters are counted.
-Also, each sixtieth of a second,
-the state of each disk is examined
-and a tally is made if the disk is active.
-The tally goes into
-one of four categories, depending on whether the system is
-executing in user mode, in `nice' (background)
-user mode, in system mode, or idle.
-From all these numbers and from the known transfer rates
-of the devices it is possible to determine
-information such as the degree of IO overlap
-and average seek times for each device.
-.PP
-The optional
-.I interval
-argument causes
-.I iostat
-to report once each
-.I interval
-seconds.
-The first report is for  all time since a reboot and each
-subsequent report is for the last interval only.
-.PP
-The optional
-.I count
-argument restricts the number of reports.
-.PP
-With no option argument
-.I iostat
-reports for each disk the number of transfers per minute,
-the milliseconds
-per average seek,
-and the milliseconds per data transfer exclusive of seek time.
-It also gives the percentage of time the system has
-spend in each of the four categories mentioned above.
-.PP
-The following options are available:
-.TP
-.B \-t
-Report the number of characters of terminal IO per second as well.
-.TP
-.B \-i
-Report the percentage of time spend in each
-of the four categories mentioned above,
-the percentage of time each disk was active (seeking or transferring),
-the percentage of time any disk was active,
-and the percentage of time spent in `IO wait:'
-idle, but with a disk active.
-.TP
-.B \-s
-Report the raw timing information: 32 numbers indicating
-the percentage of time spent in each of the possible
-configurations of 4 system states and 8 IO states
-(3 disks each active or not).
-.TP
-.B \-b
-Report on the usage of IO buffers.
-.SH FILES
-/dev/mem, /unix
diff --git a/.ref-Research-V7/usr/man/man1/join.1 b/.ref-Research-V7/usr/man/man1/join.1
deleted file mode 100644 (file)
index fe45af8..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-.TH JOIN 1 
-.SH NAME
-join \- relational database operator
-.SH SYNOPSIS
-.B join
-[
-options
-]
-file1 file2
-.SH DESCRIPTION
-.I Join
-forms, on the standard output,
-a join
-of the two relations specified by the lines of
-.I file1
-and
-.IR file2 .
-If
-.I file1
-is `\-', the standard input is used.
-.PP
-.I File1
-and 
-.I file2
-must be sorted in increasing ASCII collating
-sequence on the fields
-on which they are to be joined,
-normally the first in each line.
-.PP
-There is one line in the output 
-for each pair of lines in 
-.I file1 
-and 
-.I file2
-that have identical join fields.
-The output line normally consists of the common field,
-then the rest of the line from 
-.IR file1 ,
-then the rest of the line from
-.IR file2 .
-.PP
-Fields are normally separated by blank, tab or newline.
-In this case, multiple separators count as one, and
-leading separators are discarded.
-.PP
-These options are recognized:
-.TP
-.BI \-a n
-In addition to the normal output,
-produce a line for each unpairable line in file
-.IR n ,
-where
-.I n
-is 1 or 2.
-.TP
-.BI \-e \ s
-Replace empty output fields by string
-.IR s .
-.TP
-.BI \-j n\ m
-Join on the
-.IR m th
-field of file
-.IR n .
-If
-.I n
-is missing, use the
-.IR m th
-field in each file.
-.TP
-.BI \-o \ list
-Each output line comprises the fields specifed in
-.IR list ,
-each element of which has the form
-.IR n . m ,
-where
-.I n
-is a file number and
-.I m
-is a field number.
-.PP
-.TP
-.BI \-t c
-Use character
-.I c
-as a separator (tab character).
-Every appearance of
-.I c
-in a line is significant.
-.SH "SEE ALSO"
-sort(1), comm(1), awk(1)
-.SH BUGS
-With default field separation,
-the collating sequence is that of
-.IR sort\ \-b ;
-with
-.BR \-t ,
-the sequence is that of a plain sort.
-.PP
-The conventions of
-.I join, sort, comm, uniq, look
-and
-.IR awk (1)
-are wildly incongruous.
diff --git a/.ref-Research-V7/usr/man/man1/kill.1 b/.ref-Research-V7/usr/man/man1/kill.1
deleted file mode 100644 (file)
index 9eef9b1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH KILL 1 
-.SH NAME
-kill \- terminate a process with extreme prejudice
-.SH SYNOPSIS
-.B kill
-[
-.BR \- signo
-]
-processid ...
-.SH DESCRIPTION
-.I Kill
-sends signal 15 (terminate) to the specified processes.
-If a signal number preceded by `\-' is given
-as first argument, that signal is sent instead of
-terminate
-(see
-.IR  signal (2)).
-This will kill processes that do not catch the signal;
-in particular `kill \-9 ...' is a sure kill.
-.PP
-By convention, if process number 0 is specified, all members
-in the process group (i.e. processes resulting from 
-the current login) are signaled.
-.PP
-The killed processes must belong
-to the current user unless
-he is the super-user.
-To shut the system down and bring it up single user
-the super-user may
-use `kill \-1 1'; see
-.IR init (8).
-.PP
-The process number of an asynchronous process
-started with `&' is reported by the shell.
-Process numbers can also be found by using
-.IR ps (1).
-.SH "SEE ALSO"
-ps(1), kill(2), signal(2)
diff --git a/.ref-Research-V7/usr/man/man1/ld.1 b/.ref-Research-V7/usr/man/man1/ld.1
deleted file mode 100644 (file)
index 5adcae3..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-.TH LD 1 
-.SH NAME
-ld \- loader
-.SH SYNOPSIS
-.B ld
-[ option ] file ...
-.SH DESCRIPTION
-.I Ld
-combines several
-object programs into one, resolves external
-references, and searches libraries.
-In the simplest case several object
-.I files
-are given, and
-.I ld
-combines them, producing
-an object module which can be either executed or
-become the input for a further
-.I ld
-run.
-(In the latter case, the
-.B \-r
-option must be given
-to preserve the relocation bits.)
-The output of
-.I ld
-is left on
-.BR a.out .
-This file is made executable
-only if no errors occurred during the load.
-.PP
-The argument routines are concatenated in the order
-specified.  The entry point of the output is the
-beginning of the first routine.
-.PP
-If any argument is a library, it is searched exactly once
-at the point it is encountered in the argument list.
-Only those routines defining an unresolved external
-reference are loaded.
-If a routine from a library
-references another routine in the library,
-and the library has not been processed by
-.IR ranlib (1),
-the referenced routine must appear after the
-referencing routine in the library.
-Thus the order of programs within libraries
-may be important.
-If the first member of a library is named
-`__.SYMDEF',
-then it is understood to be a dictionary for the
-library
-such
-as produced by
-.IR ranlib ;
-the dictionary is searched
-iteratively to satisfy as many references as possible.
-.PP
-The symbols `\_etext', `\_edata' and `\_end'
-(`etext', `edata' and `end' in C)
-are reserved, and if referred to,
-are set to the first location above the program,
-the first location above initialized data,
-and the first location above all data respectively.
-It is erroneous to define these symbols.
-.PP
-.I Ld
-understands several options.
-Except for
-.BR \-l ,
-they should appear before the file names.
-.TP 
-.B  \-s
-`Strip' the output, that is, remove the symbol table
-and relocation bits to save space (but impair the
-usefulness of the debugger).
-This information can also be removed by
-.IR  strip (1).
-.TP 
-.B  \-u
-Take the following argument as a symbol and enter
-it as undefined in the symbol table.  This is useful
-for loading wholly from a library, since initially the symbol
-table is empty and an unresolved reference is needed
-to force the loading of the first routine.
-.TP 
-.BI \-l x
-This
-option is an abbreviation for the library name
-.RI `/lib/lib x .a',
-where
-.I x
-is a string.
-If that does not exist,
-.I ld
-tries
-.RI `/usr/lib/lib x .a'.
-A library is searched when its name is encountered,
-so the placement of a
-.B  \-l
-is significant.
-.TP 
-.B  \-x
-Do not preserve local
-(non-.globl) symbols in the output symbol table; only enter
-external symbols.
-This option saves some space in the output file.
-.TP 
-.B  \-X
-Save local symbols
-except for those whose names begin with `L'.
-This option is used by
-.IR cc (1)
-to discard internally generated labels while
-retaining symbols local to routines.
-.TP 
-.B  \-r
-Generate relocation bits in the output file
-so that it can be the subject of another
-.I ld
-run.
-This flag also prevents final definitions from being
-given to common symbols,
-and suppresses the `undefined symbol' diagnostics.
-.TP 
-.B  \-d
-Force definition of common storage
-even if the
-.B \-r
-flag is present.
-.TP 
-.B  \-n
-Arrange that
-when the output file is executed,
-the text portion will be read-only and shared
-among all users executing the file.
-This involves moving the data areas up to the first
-possible 4K word boundary following the
-end of the text.
-.TP 
-.B  \-i
-When the output file is executed, the program
-text and data areas will live in separate address spaces.
-The only difference between this option
-and
-.B \-n
-is that here the data starts at location 0.
-.TP 
-.B  \-o
-The
-.I name
-argument after
-.B \-o
-is used as the name of the
-.I ld
-output file, instead of
-.BR a.out .
-.TP
-.B \-e
-The following argument is taken to be the
-name of the entry point of the loaded
-program; location 0 is the default.
-.TP
-.B \-O
-This is an overlay file, only the text segment
-will be replaced by
-.IR exec (2).
-Shared data must have the same layout as in
-the program overlaid.
-.TP
-.B \-D
-The next argument is a decimal number that sets
-the size of the data segment.
-.SH FILES
-.ta \w'/usr/lib/lib*.a\ \ 'u
-/lib/lib*.a    libraries
-.br
-/usr/lib/lib*.a        more libraries
-.br
-a.out  output file
-.SH "SEE ALSO"
-as(1), ar(1), cc(1), ranlib(1)
-.SH BUGS
diff --git a/.ref-Research-V7/usr/man/man1/lex.1 b/.ref-Research-V7/usr/man/man1/lex.1
deleted file mode 100644 (file)
index f1f06be..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH LEX 1 
-.SH NAME
-lex \- generator of lexical analysis programs
-.SH SYNOPSIS
-.B lex
-[
-.B \-tvfn
-] [ file ] ...
-.SH DESCRIPTION
-.I Lex
-generates programs to be used in simple lexical analyis of text.
-The input
-.I files
-(standard input default)
-contain regular expressions
-to be searched for, and actions written in C to be executed when
-expressions are found.
-.PP
-A C source program, `lex.yy.c' is generated, to be compiled thus:
-.IP
-cc lex.yy.c \-ll
-.LP
-This program, when run, copies unrecognized portions of
-the input to the output,
-and executes the associated
-C action for each regular expression that is recognized.
-.PP
-The following 
-.I lex
-program converts upper case to lower,
-removes blanks at the end of lines,
-and replaces multiple blanks by single blanks.
-.IP ""
-.nf
-.ta \w'[A\-Z] 'u
-%%
-[A\-Z] putchar(yytext[0]+\'a\'\-\'A\');
-[ ]+$
-[ ]+   putchar(\' \');
-.fi
-.PP
-The options have the following meanings.
-.TP
-.B \-t
-Place the result on the standard output instead of in file
-`lex.yy.c'.
-.TP
-.B \-v
-Print a one-line summary of statistics of the generated analyzer.
-.TP
-.B \-n
-Opposite of
-.BR \-v ;
-.B \-n
-is default.
-.TP
-.B \-f
-`Faster' compilation: don't bother to pack
-the resulting tables; limited to small programs.
-.SH "SEE ALSO"
-yacc(1)
-.br
-M. E. Lesk and E. Schmidt,
-.I LEX \- Lexical Analyzer Generator
diff --git a/.ref-Research-V7/usr/man/man1/lint.1 b/.ref-Research-V7/usr/man/man1/lint.1
deleted file mode 100644 (file)
index bb76388..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-.TH LINT 1 
-.SH NAME
-lint \- a C program verifier
-.SH SYNOPSIS
-.B lint
-[
-.B \-abchnpuvx
-]
-file ...
-.SH DESCRIPTION
-.I Lint
-attempts to detect features of the C program
-.I files
-which are
-likely to be bugs, or non-portable, or wasteful.
-It also checks the type usage of the program more strictly
-than the compilers.
-Among the things which are currently found are
-unreachable statements,
-loops not entered at the top,
-automatic variables declared and not used,
-and logical expressions whose value is constant.
-Moreover, the usage of functions is checked to find
-functions which return values in some places and not in others,
-functions called with varying numbers of arguments,
-and functions whose values are not used.
-.PP
-By default, it is assumed that all the
-.I files
-are to be loaded together; they are checked for
-mutual compatibility.
-Function definitions for certain libraries are available to
-.IR lint ;
-these libraries are referred to by a
-conventional name,
-such as `-lm', in the style of
-.IR ld (1).
-.PP
-Any number of the options in the following list
-may be used.
-The
-.SM
-.BR \-D "\*S,"
-.SM
-.BR \-U "\*S,"
-and
-.SM
-.B \-I
-options of
-.IR cc (1)
-are also recognized as separate arguments.
-.TP
-.B p
-Attempt to check portability to the
-.I IBM
-and
-.I GCOS
-dialects of C.
-.TP
-.B h
-Apply a number of heuristic tests to attempt to
-intuit bugs, improve style, and reduce waste.
-.TP
-.B b
-Report
-.I break
-statements that cannot be reached.
-(This is not the default because, unfortunately,
-most
-.I lex
-and many
-.I yacc
-outputs produce dozens of such comments.)
-.TP
-.B v
-Suppress complaints about unused arguments in functions.
-.TP
-.B x
-Report variables referred to by extern declarations,
-but never used.
-.TP
-.B a
-Report assignments of long values to int variables.
-.TP
-.B c
-Complain about casts which have questionable portability.
-.TP
-.B u
-Do not complain about functions and variables used and not
-defined, or defined and not used (this is suitable for running
-.I lint
-on a subset of files out of a larger program).
-.TP
-.B n
-Do not check compatibility against the standard library.
-.PP
-.IR Exit (2)
-and other functions which do not return
-are not understood; this causes various lies.
-.PP
-Certain conventional comments in the C source
-will change the behavior of
-.IR lint :
-.TP
-/*NOTREACHED*/
-at appropriate points
-stops comments about unreachable code.
-.TP
-.RI /*VARARGS n */
-suppresses
-the usual checking for variable numbers of arguments
-in the following function declaration.
-The data types of the first
-.I n
-arguments are checked;
-a missing
-.I n
-is taken to be 0.
-.TP
-/*NOSTRICT*/
-shuts off strict type checking in the next expression.
-.TP
-/*ARGSUSED*/
-turns on the
-.B \-v
-option for the next function.
-.TP
-/*LINTLIBRARY*/
-at the beginning of a file shuts off complaints about
-unused functions in this file.
-.SH FILES
-/usr/lib/lint[12] programs
-.br
-/usr/lib/llib-lc declarations for standard functions
-.br
-/usr/lib/llib-port declarations for portable functions
-.SH SEE ALSO
-cc(1)
-.br
-S. C. Johnson,
-.I Lint, a C Program Checker
diff --git a/.ref-Research-V7/usr/man/man1/ln.1 b/.ref-Research-V7/usr/man/man1/ln.1
deleted file mode 100644 (file)
index 4cf4c1a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-.TH LN 1 
-.SH NAME
-ln  \-  make a link
-.SH SYNOPSIS
-.B ln
-name1 [ name2 ]
-.SH DESCRIPTION
-A link is a directory entry referring
-to a file; the same file (together with
-its size, all its protection
-information, etc.)
-may have several links to it.
-There is no way to distinguish a link to a file
-from its original directory entry;
-any changes in the
-file are effective
-independently of the name by which the file is known.
-.PP
-.I Ln
-creates a link to an existing file
-.IR name1 .
-If
-.I name2
-is given, the link has that name;
-otherwise it is placed in the current directory
-and its name is the last component
-of
-.IR name1 .
-.PP
-It is forbidden to link to a directory
-or to link across file systems.
-.SH "SEE ALSO"
-rm(1)
diff --git a/.ref-Research-V7/usr/man/man1/login.1 b/.ref-Research-V7/usr/man/man1/login.1
deleted file mode 100644 (file)
index a1d8dd9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-.TH LOGIN 1 
-.SH NAME
-login  \-  sign on
-.SH SYNOPSIS
-.B login
-[ username ]
-.SH DESCRIPTION
-The
-.I login
-command
-is used when a user initially
-signs on, or it may be used at any time to change
-from one user to another.
-The latter case is the one summarized above and
-described here.
-See `How to Get Started' for how to dial up initially.
-.PP
-If
-.I login
-is invoked without an argument,
-it asks for a user name, and, if
-appropriate, a password.
-Echoing is turned off (if possible) during the typing of the password,
-so it will not appear on the written record of the
-session.
-.PP
-After a successful login,
-accounting files are updated and
-the user is informed of the
-existence of
-.I .mail
-and message-of-the-day files.
-.I Login
-initializes the user and group IDs and the working directory,
-then executes a command interpreter (usually
-.IR  sh (1))
-according to specifications found in a password file.
-Argument 0 of the command interpreter is `\-sh.
-.PP
-Login is recognized by
-.IR sh (1)
-and executed directly (without forking).
-.SH FILES
-.ta \w'/usr/adm/wtmp\ \ 'u
-/etc/utmp      accounting
-.br
-/usr/adm/wtmp  accounting
-.br
-/usr/mail/*    mail
-.br
-/etc/motd      message-of-the-day
-.br
-/etc/passwd    password file
-.SH "SEE ALSO"
-init(8), newgrp(1), getty(8), mail(1), passwd(1), passwd(5)
-.SH DIAGNOSTICS
-`Login incorrect,'
-if the name or the password is bad.
-.br
-`No Shell', `cannot open password file', `no directory':
-consult a programming counselor.
diff --git a/.ref-Research-V7/usr/man/man1/look.1 b/.ref-Research-V7/usr/man/man1/look.1
deleted file mode 100644 (file)
index e8a3f9a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-.TH LOOK 1 
-.SH NAME
-look \- find lines in a sorted list
-.SH SYNOPSIS
-.B look
-[
-.B \-df
-]
-string
-[ file ]
-.SH DESCRIPTION
-.I Look
-consults a sorted
-.I file
-and prints all lines that begin with
-.IR string .
-It uses binary search.
-.PP
-The options 
-.B d
-and
-.B f
-affect comparisons as in
-.IR  sort (1):
-.TP 4
-.B  d
-`Dictionary' order:
-only letters, digits,
-tabs and blanks participate in comparisons.
-.TP 4
-.B  f
-Fold.
-Upper case letters compare equal to lower case.
-.PP
-If no
-.I file
-is specified,
-.I /usr/dict/words
-is assumed with collating sequence
-.B \-df.
-.SH FILES
-/usr/dict/words
-.SH "SEE ALSO"
-sort(1), grep(1)
diff --git a/.ref-Research-V7/usr/man/man1/lookall.1 b/.ref-Research-V7/usr/man/man1/lookall.1
deleted file mode 100644 (file)
index 7a35e60..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-.TH LOOKALL 1
-.SH NAME
-lookall \- look through all text files on UNIX
-.SH SYNOPSIS
-.B lookall
-[
-.BI \-C n
-]
-.SH DESCRIPTION
-.I Lookall
-accepts keywords from the standard input, performs
-a search similar to that of
-.IR  refer (1),
-and writes the result on the standard output.
-.I Lookall
-consults, however, an index to all the text files on
-the system rather than just bibliographies.
-Only the first 50
-words of each file (roughly) were used to
-make the indexes.
-Blank lines are taken as delimiters between queries.
-.PP
-The
-.BI -C n
-option
-specifies a coordination level search: up to
-.IR n
-keywords may be missing
-from the answers, and the answers are listed
-with those containing the most keywords first.
-.PP
-The command sequence in
-.I /usr/dict/lookall/makindex
-regenerates the index.
-.SH FILES
-The directory
-.I /usr/dict/lookall
-contains the index files.
-.SH DIAGNOSTICS
-`Warning: index precedes file ...'
-means that a file has been changed since the index was made
-and it may be retrieved (or not retrieved) erroneously.
-.SH BUGS
-Coordination level searching doesn't work as described: only
-those acceptable items with the smallest number of
-missing keywords are retreived.
diff --git a/.ref-Research-V7/usr/man/man1/lorder.1 b/.ref-Research-V7/usr/man/man1/lorder.1
deleted file mode 100644 (file)
index 55fa2cc..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH LORDER 1 
-.SH NAME
-lorder \- find ordering relation for an object library
-.SH SYNOPSIS
-.B lorder
-file ...
-.SH DESCRIPTION
-The input
-is one or more object or library archive (see
-.IR ar (1))
-.I files.
-The standard output
-is a list of pairs of object file names,
-meaning that the first file of the pair refers to
-external identifiers defined in the second.
-The output may be processed by
-.IR  tsort (1)
-to find an ordering of
-a library suitable for one-pass access by
-.IR  ld (1).
-.PP
-This brash one-liner intends to build a new library
-from existing `.o' files.
-.IP
-ar cr library \`\|lorder *.o | tsort\`
-.SH FILES
-*symref, *symdef
-.br
-nm(1), sed(1), sort(1), join(1)
-.SH "SEE ALSO"
-tsort(1),
-ld(1),
-ar(1)
-.SH BUGS
-The names of object files, in and out of libraries, must end with `.o';
-nonsense results otherwise.
diff --git a/.ref-Research-V7/usr/man/man1/ls.1 b/.ref-Research-V7/usr/man/man1/ls.1
deleted file mode 100644 (file)
index 8dfe64e..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-.TH LS 1 
-.SH NAME
-ls  \-  list contents of directory
-.SH SYNOPSIS
-.B ls
-[
-.B \-ltasdrucifg
-] name ...
-.SH DESCRIPTION
-For each directory argument,
-.I ls
-lists the contents of the directory;
-for each file argument,
-.I ls
-repeats its name and any other information requested.
-The output is sorted alphabetically by default.
-When no argument is given, the current directory is listed.
-When several arguments are given,
-the arguments are first sorted appropriately,
-but file arguments appear
-before directories and their contents.
-There are several options:
-.TP
-.B  \-l
-List in long format, giving mode, number of links, owner,
-size in bytes, and time of last modification
-for each file.
-(See below.)
-If the file is a special file the size field will instead contain
-the major and minor device numbers.
-.TP
-.B  \-t
-Sort by time modified (latest first) instead of
-by name, as is normal.
-.TP
-.B  \-a
-List all entries; usually
-.RB ` . '
-and
-.RB ` .. '
-are suppressed.
-.TP
-.B  \-s
-Give size in blocks,
-including indirect blocks, for each entry.
-.TP
-.B  \-d
-If argument is a directory, list only its name, not
-its contents (mostly used with
-.B \-l
-to get status
-on directory).
-.TP
-.B  \-r
-Reverse the order of sort to get reverse alphabetic
-or oldest first as appropriate.
-.TP
-.B  \-u
-Use time of last access instead of last
-modification for sorting
-.RB ( \-t )
-or printing
-.RB ( \-l ).
-.TP
-.B \-c
-Use time of last modification to inode (mode, etc.)
-instead of last modification to file for sorting
-.RB ( \-t )
-or printing
-.RB ( \-l ).
-.TP
-.B  \-i
-Print i-number in first column
-of the report for each file listed.
-.TP
-.B  \-f
-Force each argument to be interpreted as a directory
-and list the name found in each slot.
-This option turns off
-.B "\-l, \-t, \-s,"
-and
-.B \-r,
-and
-turns on
-.B \-a;
-the order is the order in which entries
-appear in the directory.
-.TP
-.B  \-g
-Give group ID instead of owner ID in long listing.
-.PP
-The mode printed under the
-.B \-l
-option contains 11 characters
-which are interpreted
-as follows:
-the first character is
-.TP 3
-.B  d
-if the entry is a directory;
-.br
-.ns
-.TP 3
-.B  b
-if the entry is a block-type special file;
-.br
-.ns
-.TP 3
-.B  c
-if the entry is a character-type special file;
-.br
-.ns
-.TP 3
-.B  \-
-if the entry is a plain file.
-.PP
-The next 9 characters are interpreted
-as three sets of three bits each.
-The first set refers to owner permissions;
-the next to permissions to others in the same user-group;
-and the last to all others.
-Within each set the three characters indicate
-permission respectively to read, to write, or to
-execute the file as a program.
-For a directory, `execute' permission is interpreted
-to mean permission to search the directory
-for a specified file.
-The permissions are indicated as follows:
-.TP 3
-.B  r
-if the file is readable;
-.br
-.ns
-.TP 3
-.B  w
-if the file is writable;
-.br
-.ns
-.TP 3
-.B  x
-if the file is executable;
-.br
-.ns
-.TP 3
-.B  \-
-if the indicated permission is not granted.
-.PP
-The group-execute permission character is given
-as
-.B s
-if the file has set-group-ID mode;
-likewise the user-execute permission character is given
-as
-.B s
-if the file has set-user-ID mode.
-.PP
-The last character of the mode (normally `x' or `\-') is 
-.B t
-if the 1000 bit of the mode is on.
-See
-.IR  chmod (1)
-for the meaning of this mode.
-.PP
-When the sizes of the files in a directory
-are listed, a total count of blocks,
-including indirect blocks is printed.
-.SH FILES
-/etc/passwd to get user ID's for
-`ls \-l'.
-.br
-/etc/group to get group ID's for
-`ls \-g'.
diff --git a/.ref-Research-V7/usr/man/man1/m4.1 b/.ref-Research-V7/usr/man/man1/m4.1
deleted file mode 100644 (file)
index 1431333..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-.TH M4 1 
-.SH NAME
-m4 \- macro processor
-.SH SYNOPSIS
-.B m4
-[ files ]
-.SH DESCRIPTION
-.I M4
-is a macro processor
-intended as a front end for Ratfor, C, and other languages.
-Each of the argument files is processed in order;
-if there are no arguments, or if an argument is `\-',
-the standard input is read.
-The processed text is written on the standard output.
-.PP
-Macro calls
-have the form
-.PP
-       name(arg1,arg2, . . . , argn)
-.br
-.PP
-The `(' must immediately follow the name of the macro.
-If a defined macro name is not followed by a `(',
-it is deemed to have no arguments.
-Leading unquoted blanks, tabs, and newlines are ignored while collecting arguments.
-Potential macro names consist of alphabetic letters,
-digits, and underscore `\_', where the first character is not a digit.
-.PP
-Left and right single quotes (\`\|\') are used to quote strings.
-The value of a quoted string is the string stripped of the quotes.
-.PP
-When a macro name is recognized,
-its arguments are collected by searching for a matching right
-parenthesis.
-Macro evaluation proceeds normally during the collection of the arguments,
-and any commas or right parentheses
-which happen to turn up within the value of a nested
-call are as effective as those in the original input text.
-After argument collection,
-the value of the macro is pushed back onto the input stream
-and rescanned.
-.PP
-.I M4
-makes available the following built-in macros.
-They may be redefined, but once this is done the original meaning is lost.
-Their values are null unless otherwise stated.
-.TP 10
-define
-The second argument is installed as the value of the macro
-whose name is the first argument.
-Each occurrence of $\fIn\fR in the replacement text,
-where
-.I n
-is a digit,
-is replaced by the
-.IR n -th
-argument.
-Argument 0 is the name of the macro;
-missing arguments are replaced by the null string.
-.TP
-undefine
-removes the definition of the macro named in its argument.
-.TP
-ifdef
-If the first argument is defined, the value is the second argument, otherwise the third.
-If there is no third argument, the value is null.
-The word
-.I unix
-is predefined on UNIX versions of
-.IR m4 .
-.TP
-changequote
-Change quote characters to the first and second arguments.
-.I Changequote
-without arguments restores the original values
-(i.e., \`\|\').
-.TP
-divert
-.I M4
-maintains 10 output streams,
-numbered 0-9.
-The final output is the concatenation of the streams
-in numerical order;
-initially stream 0 is the current stream.
-The
-.I divert
-macro changes the current output stream to its (digit-string)
-argument.
-Output diverted to a stream other than 0 through 9
-is discarded.
-.TP
-undivert
-causes immediate output of text from diversions named as
-arguments, or all diversions if no argument.
-Text may be undiverted into another diversion.
-Undiverting discards the diverted text.
-.TP
-divnum
-returns the value of the current output stream.
-.TP
-dnl
-reads and discards characters up to and including the next newline.
-.TP
-ifelse
-has three or more arguments.
-If the first argument is the same string as the second,
-then the value is the third argument.
-If not, and if there are more than four arguments, the process is repeated with arguments 4, 5, 6 and 7.
-Otherwise, the value is either the fourth string, or, if it is not present,
-null.
-.TP
-incr
-returns the value of its argument incremented by 1.
-The value of the argument is calculated
-by interpreting an initial digit-string as a decimal number.
-.TP
-eval
-evaluates its argument as an arithmetic expression, using 32-bit arithmetic.
-Operators include +, \-, \(**, /, %, ^ (exponentiation); relationals; parentheses.
-.TP
-len
-returns the number of characters in its argument.
-.TP
-index
-returns the position in its first argument where the second argument begins (zero origin),
-or \-1 if the second argument does not occur.
-.TP
-substr
-returns a substring of its first argument.
-The second argument is a zero origin
-number selecting the first character;
-the third argument indicates the length of the substring.
-A missing third argument is taken to be large enough to extend to
-the end of the first string.
-.TP
-translit
-transliterates the characters in its first argument
-from the set given by the second argument to the set given by the third.
-No abbreviations are permitted.
-.TP
-include
-returns the contents of the file named in the argument.
-.TP
-sinclude
-is identical to
-.I include,
-except that it
-says nothing if the file is inaccessible.
-.TP
-syscmd
-executes the UNIX command given in the first argument.
-No value is returned.
-.TP
-maketemp
-fills in a string of XXXXX in its argument with the current process id.
-.TP
-errprint
-prints its argument
-on the diagnostic output file.
-.TP
-dumpdef
-prints current names and definitions,
-for the named items, or for all if no arguments are given.
-.dt
-.SH "SEE ALSO"
-B. W. Kernighan and D. M. Ritchie,
-.I The M4 Macro Processor
diff --git a/.ref-Research-V7/usr/man/man1/mail.1 b/.ref-Research-V7/usr/man/man1/mail.1
deleted file mode 100644 (file)
index b3bcca8..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-.TH MAIL 1 
-.SH NAME
-mail  \-  send or receive mail among users
-.SH SYNOPSIS
-.B mail
-person ...
-.br
-.B mail
-[
-.B \-r
-] [
-.B \-q
-] [
-.B \-p
-] [
-.B \-f
-file
-]
-.LP
-.SH DESCRIPTION
-.I Mail
-with no argument
-prints
-a user's mail,
-message-by-message,
-in last-in, first-out order;
-the optional argument
-.B \-r
-causes first-in, first-out order.
-If the
-.B \-p
-flag is given, the mail is printed with no questions asked;
-otherwise,
-for each message,
-.I mail
-reads a line from the standard input
-to direct disposition of the message.
-.TP
-newline
-Go on to next message.
-.TP
-d
-Delete message and go on to the next.
-.TP
-p
-Print message again.
-.TP
-\-
-Go back to previous message.
-.TP
-.RI "s [" " file " "] ..."
-Save the message in the named
-.I files
-(`mbox' default).
-.TP
-.RI "w [" " file " "] ..."
-Save the message, without a header, in the named
-.I files
-(`mbox' default).
-.TP
-.RI "m [" " person " "] ..."
-Mail the message to the named
-.I persons
-(yourself is default).
-.TP
-EOT (control-D)
-Put unexamined mail back in the mailbox and stop.
-.TP
-q
-Same as EOT.
-.TP
-x
-Exit, without changing the mailbox file.
-.TP
-!command
-Escape to the Shell to do command.
-.TP
-?
-Print a command summary.
-.PP
-An interrupt stops the printing of the current letter.
-The optional argument
-.B \(miq
-causes
-.I mail
-to exit after interrupts
-without changing the mailbox.
-.PP
-When
-.I persons
-are named,
-.I mail
-takes the standard input up to an end-of-file
-(or a line with just `.')
-and adds it to each
-.I person's
-`mail' file.
-The message is preceded by the sender's name and a postmark.
-Lines that look like postmarks are
-prepended with `>'.
-A
-.I person
-is usually a user name recognized by
-.IR  login (1).
-To denote a recipient on a remote system, prefix 
-.I person
-by the system name and exclamation mark (see
-.IR uucp (1)).
-.PP
-The
-.B \-f
-option causes the named file, e.g. `mbox',
-to be printed as if it were the mail file.
-.PP
-Each user owns his own mailbox, which is by default generally
-readable but not writable.
-The command does not delete an empty mailbox nor change its mode,
-so a user may make it unreadable if desired.
-.PP
-When a user logs in he is informed of the presence
-of mail.
-.SH FILES
-/usr/spool/mail/*      mailboxes
-.br
-/etc/passwd    to identify sender and locate persons
-.br
-mbox           saved mail
-.br
-/tmp/ma*       temp file
-.br
-dead.letter    unmailable text
-.br
-uux(1)
-.SH "SEE ALSO"
-xsend(1), write(1), uucp(1)
-.SH BUGS
-There is a locking mechanism intended to prevent
-two senders from accessing the same mailbox, but it
-is not perfect and races
-are possible.
diff --git a/.ref-Research-V7/usr/man/man1/make.1 b/.ref-Research-V7/usr/man/man1/make.1
deleted file mode 100644 (file)
index ab8ab35..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-.TH MAKE 1 
-.SH NAME
-make \- maintain program groups
-.SH SYNOPSIS
-.B make
-[
-.B \-f
-makefile ] [ option ] ...
-file ...
-.SH DESCRIPTION
-.I Make
-executes commands in
-.I makefile
-to update
-one or more target
-.IR names .
-.I Name
-is typically a program.
-If no
-.B \-f
-option is present, `makefile' and `Makefile' are
-tried in order.
-If
-.I makefile
-is `\-', the standard input is taken.
-More than one
-.B \-f
-option may appear
-.PP
-.I Make
-updates a target if it depends on prerequisite files
-that have been modified since the target was last modified,
-or if the target does not exist.
-.PP
-.I Makefile
-contains a sequence of entries that specify dependencies.
-The first line of an entry is a
-blank-separated list of targets, then a colon,
-then a list of prerequisite files.
-Text following a semicolon, and all following lines
-that begin with a tab, are shell commands
-to be executed to update the target.
-.PP
-Sharp and newline surround comments.
-.PP
-The following makefile says that `pgm' depends on two
-files `a.o' and `b.o', and that they in turn depend on
-`.c' files and a common file `incl'.
-.RS 
-.HP
-.PD 0
-.nf
-pgm: a.o b.o
-cc a.o b.o \-lm \-o pgm
-.HP
-a.o: incl a.c
-cc \-c a.c
-.HP
-b.o: incl b.c
-cc \-c b.c
-.fi
-.RE
-.PD
-.PP
-.I Makefile
-entries of the form
-.PP
-.IP
-string1 = string2
-.PP
-are macro definitions.
-Subsequent appearances of 
-.I $(string1)
-are replaced by
-.IR string2 .
-If
-.I string1
-is a single character, the parentheses are optional.
-.PP
-.I Make 
-infers prerequisites for files for which
-.I makefile
-gives no construction commands.
-For example, a
-`.c' file may be inferred as prerequisite for a `.o' file
-and be compiled to produce the `.o' file.
-Thus the preceding example can be done more briefly:
-.RS
-.HP
-.PD 0
-.nf
-pgm: a.o b.o
-cc a.o b.o \-lm \-o pgm
-.HP
-a.o b.o: incl
-.fi
-.RE
-.PD
-.PP
-Prerequisites are inferred according to selected suffixes
-listed as the `prerequisites' for the special name `.SUFFIXES';
-multiple lists accumulate;
-an empty list clears what came before.
-Order is significant; the first possible name for which both
-a file and a rule as described in the next paragraph exist
-is inferred.
-The default list is
-.IP
-\&.SUFFIXES: .out .o .c .e .r .f .y .l .s
-.PP
-The rule to create a file with suffix
-.I s2
-that depends on a similarly named file with suffix
-.I s1
-is specified as an entry
-for the `target'
-.IR s1s2 .
-In such an entry, the special macro $* stands for
-the target name with suffix deleted, $@ for the full target name,
-$< for the complete list of prerequisites,
-and
-$? for the list of prerequisites that are out of date.
-For example, a rule for making
-optimized `.o' files from `.c' files is
-.IP
-\&.c.o: ; cc \-c \-O \-o $@ $*.c
-.PP
-Certain macros are used by the default inference rules
-to communicate optional arguments to
-any resulting compilations.
-In particular, `CFLAGS' is used for
-.I cc
-and 
-.IR f77 (1)
-options, `LFLAGS' and `YFLAGS' for 
-.I lex
-and
-.IR yacc (1)
-options.
-.PP
-Command lines are executed one at a time, each by its
-own shell.
-A line is printed when it is executed unless
-the special target `.SILENT'
-is in 
-.I makefile,
-or the first character of the command is `@'.
-.PP
-Commands returning nonzero status (see
-.IR intro (1))
-cause
-.I make
-to terminate unless
-the special target `.IGNORE' is in
-.I makefile
-or the command begins with
-<tab><hyphen>.
-.PP
-Interrupt and quit cause the target to be deleted
-unless the target depends on the special name `.PRECIOUS'.
-.PP
-Other options:
-.TP
-.B \-i
-Equivalent to the special entry `.IGNORE:'.
-.TP
-.B \-k
-When a command returns nonzero status,
-abandon work on the current entry, but
-continue on branches that do not depend on the current entry.
-.TP
-.B \-n
-Trace and print, but do not execute the commands
-needed to update the targets.
-.TP
-.B \-t
-Touch, i.e. update the modified date of targets, without
-executing any commands.
-.TP
-.B \-r
-Equivalent to an initial special entry `.SUFFIXES:'
-with no list.
-.TP 
-.B \-s
-Equivalent to the special entry
-`.SILENT:'.
-.SH FILES
-makefile, Makefile
-.br
-.SH "SEE ALSO"
-sh(1), touch(1)
-.br
-S. I. Feldman
-.I
-Make \- A Program for Maintaining Computer Programs
-.SH BUGS
-Some commands return nonzero status inappropriately.
-Use
-.B \-i
-to overcome the difficulty.
-.br
-Commands that are directly executed by the shell,
-notably
-.IR  cd (1),
-are ineffectual across newlines in
-.I make.
diff --git a/.ref-Research-V7/usr/man/man1/man.1 b/.ref-Research-V7/usr/man/man1/man.1
deleted file mode 100644 (file)
index cadea03..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-.TH MAN 1
-.SH NAME
-man \- print sections of this manual
-.SH SYNOPSIS
-.B man
-[ option ... ] [ chapter ] title ...
-.SH DESCRIPTION
-.I Man
-locates and prints the section of this manual named
-.I title
-in the specified
-.IR chapter .
-(In this context, the word `page' is often used as a synonym for `section'.)\ 
-The
-.I title
-is entered in lower case.
-The
-.I chapter
-number does not need a letter suffix.
-If no
-.I chapter
-is specified, the whole manual is searched for
-.I title
-and all occurrences of it are printed.
-.PP
-.I Options
-and their meanings are:
-.TP 
-.B \-t
-Phototypeset the section using
-.IR troff (1).
-.TP
-.B \-n
-Print the section on the standard output using
-.IR nroff (1).
-.TP
-.B \-k
-Display the output on a Tektronix 4014 terminal using
-.IR troff (1)
-and
-.IR tc (1).
-.TP
-.B \-e
-Appended or prefixed to any of the above
-causes the manual section to be preprocessed by
-.I neqn
-or
-.IR eqn (1);
-.B \-e
-alone means
-.BR \-te .
-.TP
-.B \-w
-Print the path names of the manual sections,
-but do not print the sections themselves.
-.TP
-(default)
-Copy an already formatted manual section to the terminal,
-or, if none is available, act as
-.BR \-n .
-It may be necessary to use a filter to adapt the output to
-the
-particular terminal's characteristics.
-.PP
-Further
-.I options,
-e.g. to specify the kind of terminal you have,
-are passed on to
-.IR troff (1)
-or
-.IR nroff .
-.I Options
-and
-.I chapter
-may be changed before each
-.IR title .
-.PP
-For example:
-.IP
-man man
-.PP
-would reproduce this section,
-as well as any other sections named
-.I man
-that may exist in other chapters of the manual, e.g. 
-.IR man (7).
-.SH FILES
-/usr/man/man?/\(**
-.br
-/usr/man/cat?/\(**
-.SH "SEE ALSO"
-nroff(1),
-eqn(1),
-tc(1),
-man(7)
-.SH BUGS
-The manual is supposed to be reproducible either on
-a phototypesetter or on a terminal.
-However, on a terminal some information is necessarily lost.
diff --git a/.ref-Research-V7/usr/man/man1/mesg.1 b/.ref-Research-V7/usr/man/man1/mesg.1
deleted file mode 100644 (file)
index fa81cb3..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH MESG 1 
-.SH NAME
-mesg  \-  permit or deny messages
-.SH SYNOPSIS
-.B mesg
-[
-.B n
-] [
-.B y
-]
-.SH DESCRIPTION
-.I Mesg
-with argument
-.B n
-forbids messages via
-.IR  write (1)
-by revoking non-user
-write permission on the user's terminal.
-.I Mesg
-with argument
-.B y
-reinstates permission.
-All by itself,
-.I mesg
-reports the current state without changing it.
-.SH FILES
-/dev/tty*
-.br
-/dev
-.SH "SEE ALSO"
-write(1)
-.SH DIAGNOSTICS
-Exit status is 0 if messages are receivable,
-1 if not, 2 on error.
diff --git a/.ref-Research-V7/usr/man/man1/mkconf.1m b/.ref-Research-V7/usr/man/man1/mkconf.1m
deleted file mode 100644 (file)
index 73b332f..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-.TH MKCONF 1M
-.SH NAME
-mkconf \- generate configuration tables
-.SH SYNOPSIS
-mkconf
-.SH DESCRIPTION
-.I Mkconf
-examines a machine configuration table on its
-standard input.
-Its output is a pair of files
-.I l.s
-and
-.I c.c.
-The first is an assembler program that represents the interrupt vectors
-located in low memory addresses;
-the second contains initialized
-block and character device switch tables.
-.PP
-Input to
-.I mkconf
-is a sequence of lines.
-The following describe devices on the machine:
-.PP
-.RS 5
-.nf
-.DS
-pc     (PC11)
-lp     (LP11)
-rf     (RS11)
-hs     (RS03/RS04)
-tc     (TU56)
-rk     (RK03/RK05)
-tm     (TU10)
-rp     (RP03)
-hp     (RP04/5/6)
-ht     (TU16)
-dc*    (DC11)
-kl*    (KL11/DL11-ABC)
-dl*    (DL11-E)
-dp*    (DP11)
-dn*    (DN11)
-dh*    (DH11)
-dhdm*  (DM11-BB)
-du*    (DU11)
-.RE
-.fi
-.PP
-The devices marked with * may be preceded by a number telling
-how many are to be included.
-The console typewrite is automatically included;
-don't count it as part of the KL or DL specification.
-Count DN's in units of 4 (1 system unit).
-.PP
-The following lines are also accepted.
-.TP 5
-.BI "root " "dev minor"
-The specified block device (e.g.
-.BR hp )
-is used for the root.
-.I minor
-is a decimal number giving the minor device.
-This line must appear exactly once.
-.TP 5
-.BI "swap " "dev minor"
-The specified block device is used for swapping.
-If not given the root is used.
-.TP 5
-.BI "pipe " "dev minor"
-The specified block device
-is used to store pipes.
-If not given the root is used.
-.TP 5
-.BI "swplo " number
-.TP 5
-.BI "nswap " number
-Sets the origin (block number) and size of the area used for
-swapping.
-By default, the not very useful numbers
-4000 and 872.
-.TP 5
-.B pack
-Include the packet driver.
-By default it is left out.
-.TP 5
-.B mpx
-Include the multiplexor driver.
-By default it is left out.
-.SH FILES
-l.s, c.c       output files
-.SH SEE ALSO
-`Setting up Unix', in Volume 2.
-.SH BUGS
-The set of devices it knows about, the set of drivers included,
-and the set of devices on the machine
-are mutually incomparable.
-Some handwork is certain to be necessary.
-Because of floating vectors that may have been missed,
-It is mandatory to check the
-.I l.s
-file to make sure it corresponds with reality.
diff --git a/.ref-Research-V7/usr/man/man1/mkdir.1 b/.ref-Research-V7/usr/man/man1/mkdir.1
deleted file mode 100644 (file)
index 73b8684..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-.TH MKDIR 1 
-.SH NAME
-mkdir  \-  make a directory
-.SH SYNOPSIS
-.B mkdir
-dirname ...
-.SH DESCRIPTION
-.I Mkdir
-creates specified directories
-in mode 777.
-Standard entries,
-.RB ` . ',
-for the directory itself,
-and 
-.BR ` .. '
-for its parent, are made automatically.
-.PP
-.I Mkdir
-requires write permission in the parent directory.
-.SH "SEE ALSO"
-rm(1)
-.SH DIAGNOSTICS
-.I Mkdir
-returns exit code 0 if all directories were successfully made.
-Otherwise it prints a diagnostic and returns nonzero.
diff --git a/.ref-Research-V7/usr/man/man1/mkfs.1m b/.ref-Research-V7/usr/man/man1/mkfs.1m
deleted file mode 100644 (file)
index 513ea16..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-.TH MKFS 1M 
-.SH NAME
-mkfs \- construct a file system
-.SH SYNOPSIS
-.B /etc/mkfs
-special
-proto
-.SH DESCRIPTION
-.I Mkfs
-constructs a file system
-by writing on the special file
-.I special
-according to the directions
-found in
-the prototype file
-.I proto.
-The prototype file
-contains tokens separated by spaces or
-new lines.
-The first token is the name of a file
-to be copied onto block zero as
-the bootstrap program,
-see
-.IR bproc (8).
-The second token is a number specifying the
-size of the created file system.
-Typically it will be the number of blocks on the device,
-perhaps diminished
-by space for swapping.
-The next token is the number of i-nodes
-in the i-list.
-The next set of tokens comprise the specification
-for the root file.
-File specifications consist of tokens
-giving the mode,
-the user-id,
-the group id,
-and the initial contents of the file.
-The syntax of the contents field
-depends on the mode.
-.PP
-The mode token for a file is a 6 character string.
-The first character
-specifies the type of the file.
-(The characters
-.B \-bcd
-specify regular, block special,
-character special and directory files
-respectively.)
-The second character of the type
-is either
-.B u
-or
-.B \-
-to specify set-user-id mode or not.
-The third is
-.B g
-or
-.B \-
-for the set-group-id mode.
-The rest of the mode
-is a three digit octal number giving the
-owner, group, and other read, write, execute
-permissions, see
-.IR chmod (1).
-.PP
-Two decimal number
-tokens come after the mode; they specify the
-user and group ID's of the owner of the file.
-.PP
-If the file is a regular file,
-the next token is a pathname
-whence the contents and size are copied.
-.PP
-If the file is a block or character special file,
-two decimal number tokens
-follow which give the major and minor device numbers.
-.PP
-If the file is a directory,
-.I mkfs
-makes the entries
-.BR . ""
-and
-.B  ..
-and then
-reads a list of names and
-(recursively)
-file specifications for the entries
-in the directory.
-The scan is terminated with the
-token
-.BR $ .
-.PP
-If the prototype file cannot be opened and
-its name consists of a string of digits,
-.I mkfs
-builds a file system with a single
-empty directory on it.
-The size of the file system is the value
-of
-.I proto
-interpreted as a decimal number.
-The number of i-nodes is calculated
-as a function of the filsystem size.
-The boot program is left uninitialized.
-.PP
-A sample prototype specification follows:
-.PP
-.nf
-.in +5
-/usr/mdec/uboot
-4872 55
-d\-\-777 3 1
-usr    d\-\-777 3 1
-       sh      \-\-\-755 3 1 /bin/sh
-       ken     d\-\-755 6 1
-               $
-       b0      b\-\-644 3 1 0 0
-       c0      c\-\-644 3 1 0 0
-       $
-$
-.in -5
-.fi
-.SH "SEE ALSO"
-filsys(5),
-dir(5),
-bproc(8)
-.SH BUGS
-There should be some way to specify links.
diff --git a/.ref-Research-V7/usr/man/man1/mknod.1m b/.ref-Research-V7/usr/man/man1/mknod.1m
deleted file mode 100644 (file)
index 36ca9db..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH MKNOD 1M 
-.SH NAME
-mknod \- build special file
-.SH SYNOPSIS
-.B /etc/mknod
-name
-[
-.B c
-] [
-.B b
-]
-major
-minor
-.SH DESCRIPTION
-.I Mknod
-makes a special file.
-The first argument is the
-.I name
-of the entry.
-The second is
-.B b
-if the special file is block-type (disks, tape) or
-.B c
-if it is character-type (other devices).
-The last two arguments are
-numbers specifying the
-.I major
-device type
-and the
-.I minor
-device (e.g. unit, drive, or line number).
-.PP
-The assignment of major device numbers is specific to each system.
-They have to be dug out of the
-system source file
-.I conf.c.
-.SH "SEE ALSO"
-mknod(2)
diff --git a/.ref-Research-V7/usr/man/man1/mount.1m b/.ref-Research-V7/usr/man/man1/mount.1m
deleted file mode 100644 (file)
index 388acac..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-.TH MOUNT 1M 
-.SH NAME
-mount, umount \- mount and dismount file system
-.SH SYNOPSIS
-.B /etc/mount
-[ special name [
-.B \-r
-] ]
-.PP
-.B /etc/umount
-special
-.SH DESCRIPTION
-.I Mount
-announces to the system that a removable file system
-is present on the device
-.I special.
-The file
-.I name
-must exist already; it
-must be a directory (unless the root of the
-mounted file system is not a directory).
-It becomes the name of the newly mounted root.
-The optional last argument indicates that the file system
-is to be mounted read-only.
-.PP
-.I Umount
-announces to the system that the removable file system previously
-mounted on device
-.I special
-is to be removed.
-.PP
-These commands
-maintain a table of mounted devices.
-If invoked without an argument,
-.I mount
-prints the table.
-.PP
-Physically write-protected and magnetic tape file
-systems must be mounted read-only
-or errors will occur when access times are updated,
-whether or not any explicit write is attempted.
-.SH FILES
-/etc/mtab: mount table
-.SH "SEE ALSO"
-mount(2),
-mtab(5)
-.SH BUGS
-Mounting file systems full of garbage will crash the system.
-.br
-Mounting a root directory on a non-directory
-makes some apparently good pathnames invalid.
diff --git a/.ref-Research-V7/usr/man/man1/mv.1 b/.ref-Research-V7/usr/man/man1/mv.1
deleted file mode 100644 (file)
index 318df89..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-.TH MV 1 
-.SH NAME
-mv  \-  move or rename files and directories
-.SH SYNOPSIS
-.B mv
-file1 file2
-.PP
-.B mv
-file ... directory
-.SH DESCRIPTION
-.I Mv
-moves (changes the name of)
-.I file1
-to
-.IR file2 .
-.PP
-If
-.I file2
-already exists,
-it is removed before
-.I file1
-is moved.
-If
-.I file2
-has a mode which forbids writing,
-.I mv
-prints the mode (see
-.IR chmod (2))
-and
-reads the standard input to obtain a line;
-if the line begins with
-.B y,
-the move takes place;
-if not,
-.I mv
-exits.
-.PP
-In the second form,
-one or more
-.I files
-are moved to the
-.I directory
-with their original
-file-names.
-.PP
-.I Mv
-refuses to move a file onto itself.
-.SH "SEE ALSO"
-cp(1), chmod(2)
-.SH BUGS
-If
-.I file1
-and
-.I file2
-lie on different file systems,
-.I mv
-must copy the file and delete the original.
-In this case the owner name becomes
-that of the copying process and any
-linking relationship with other files
-is lost.
-.PP
-.I Mv
-should take
-.B \-f
-flag, like
-.I rm,
-to suppress the question
-if the target exists and is not writable.
diff --git a/.ref-Research-V7/usr/man/man1/ncheck.1m b/.ref-Research-V7/usr/man/man1/ncheck.1m
deleted file mode 100644 (file)
index 7a91b5c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-.TH NCHECK 1M 
-.SH NAME
-ncheck  \-  generate names from i-numbers
-.SH SYNOPSIS
-.B ncheck
-[
-.B \-i
-numbers ]  [
-.B \-a
-] [
-.B \-s
-]  [ filesystem ]
-.SH DESCRIPTION
-.I Ncheck
-with no argument
-generates a pathname vs. i-number
-list of all files
-on a set of default file systems.
-Names of directory files are followed by `/\fB.\fR'.
-The
-.B \-i
-option reduces the report to only those files whose i-numbers follow.
-The
-.B \-a
-option
-allows printing of the names
-.RB ` . '
-and
-.RB ` .. ',
-which are ordinarily suppressed.
-suppressed.
-The
-.B \-s
-option reduces the report to special files
-and files with set-user-ID mode;
-it is intended to discover concealed violations
-of security policy.
-.PP
-A file system may be specified.
-.PP
-The report is in no useful
-order, and probably should be sorted.
-.SH "SEE ALSO"
-dcheck(1), icheck(1), sort(1)
-.SH DIAGNOSTICS
-When the filesystem structure is improper,
-`??' denotes the `parent' of
-a parentless file and
-a pathname beginning with `...' denotes a loop.
diff --git a/.ref-Research-V7/usr/man/man1/newgrp.1 b/.ref-Research-V7/usr/man/man1/newgrp.1
deleted file mode 100644 (file)
index 6109b41..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-.TH NEWGRP 1 
-.SH NAME
-newgrp \- log in to a new group
-.SH SYNOPSIS
-.B newgrp
-group
-.SH DESCRIPTION
-.I Newgrp
-changes the group identification of its caller,
-analogously to
-.IR  login (1).
-The same person remains logged in,
-and the current directory is unchanged,
-but calculations of access permissions to files are
-performed with respect to the
-new group ID.
-.PP
-A password is demanded if the group has
-a password and the user himself does not.
-.PP
-When most users log in, they
-are members of the group named `other.'
-.I Newgrp
-is known to the shell, which executes it directly without a fork.
-.SH FILES
-/etc/group, /etc/passwd
-.SH "SEE ALSO"
-login(1), group(5)
diff --git a/.ref-Research-V7/usr/man/man1/nice.1 b/.ref-Research-V7/usr/man/man1/nice.1
deleted file mode 100644 (file)
index 0fe1abd..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-.TH NICE 1 
-.SH NAME
-nice, nohup \- run a command at low priority
-.SH SYNOPSIS
-.B nice
-[
-.BI \- number
-]
-command [ arguments ]
-.PP
-.B nohup
-command [ arguments ]
-.SH DESCRIPTION
-.I Nice
-executes
-.I command
-with low scheduling priority.
-If the
-.I number
-argument is present, the priority is incremented (higher
-numbers mean lower priorities) by that amount up to a limit of 20.
-The default
-.I number
-is 10.
-.PP
-The super-user may run commands with
-priority higher than normal
-by using a negative priority,
-e.g. `\-\-10'.
-.PP
-.I Nohup
-executes
-.I command
-immune to hangup and terminate signals from the controlling terminal.
-The priority is incremented by 5.
-.I Nohup
-should be invoked from the shell with `&' in order to 
-prevent it from responding to interrupts by or
-stealing the input from
-the next person who logs in on the same terminal.
-.SH FILES
-nohup.out standard output and standard error file under
-.I nohup
-.SH "SEE ALSO"
-nice(2)
-.SH DIAGNOSTICS
-.I Nice
-returns the exit status of the subject command.
diff --git a/.ref-Research-V7/usr/man/man1/nm.1 b/.ref-Research-V7/usr/man/man1/nm.1
deleted file mode 100644 (file)
index 8a012b2..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-.TH NM 1 
-.SH NAME
-nm  \-  print name list
-.SH SYNOPSIS
-.B nm
-[
-.B \-gnopru
-]
-[ file ... ]
-.SH DESCRIPTION
-.I Nm
-prints the name list (symbol table) of each object
-.I file
-in the argument list.
-If an argument
-is an archive, a listing for each object
-file in the archive will be produced.
-If no
-.I file
-is given, the symbols in
-`a.out'
-are listed.
-.PP
-Each symbol name is preceded by its value (blanks if undefined)
-and one of the letters
-.SM
-.B U
-(undefined),
-.SM
-.B A
-(absolute),
-.SM
-.B  T
-(text segment symbol),
-.SM
-.B D
-(data segment symbol),
-.SM
-.B B
-(bss segment symbol),
-or
-.SM
-.B C
-(common symbol).
-If the symbol is local (non-external) the type letter is in
-lower case.
-The output is sorted alphabetically.
-.PP
-Options are:
-.TP
-.B  \-g
-Print only global (external) symbols.
-.TP
-.B \-n
-Sort numerically rather than alphabetically.
-.TP
-.B  \-o
-Prepend file or archive element name to each
-output line rather than only once.
-.TP
-.B  \-p
-Don't sort; print in symbol-table order.
-.TP
-.B  \-r
-Sort in reverse order.
-.TP
-.B  \-u
-Print only undefined symbols.
-.sh FILES
-.SH SEE ALSO
-ar(1), ar(5), a.out(5)
diff --git a/.ref-Research-V7/usr/man/man1/od.1 b/.ref-Research-V7/usr/man/man1/od.1
deleted file mode 100644 (file)
index 31338c7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH OD 1 
-.SH NAME
-od  \-  octal dump
-.SH SYNOPSIS
-.B od
-[
-.B \-bcdox
-] [ file ] [ [
-.B +
-]offset[
-.BR ". " "]["
-\fBb\fR ] ]
-.SH DESCRIPTION
-.I Od
-dumps
-.I file
-in
-one or more formats
-as
-selected by the first argument.
-If the first argument is missing,
-.B \-o
-is default.
-The meanings of the format argument characters
-are:
-.TP 3
-.B  b
-Interpret bytes in octal.
-.TP 3
-.B  c
-Interpret bytes in ASCII.
-Certain non-graphic characters appear as C escapes:
-null=\e0,
-backspace=\eb,
-formfeed=\ef,
-newline=\en,
-return=\er,
-tab=\et;
-others appear as 3-digit octal numbers.
-.TP 3
-.B  d
-Interpret words in decimal.
-.TP 3
-.B  o
-Interpret words in octal.
-.TP 3
-.B  x
-Interpret words in hex.
-.PP
-The
-.I file
-argument specifies which file is to be dumped.
-If no file argument is specified,
-the standard input is used.
-.PP
-The offset argument specifies the offset
-in the file where dumping is to commence.
-This argument is normally interpreted
-as octal bytes.
-If `\fB.\fR' is appended, the offset is interpreted in
-decimal.
-If `\fBb\fR' is appended, the offset is interpreted in
-blocks of 512 bytes.
-If the file argument is omitted,
-the offset argument must be preceded 
-.RB ` + '.
-.PP
-Dumping continues until end-of-file.
-.SH "SEE ALSO"
-adb(1)
diff --git a/.ref-Research-V7/usr/man/man1/passwd.1 b/.ref-Research-V7/usr/man/man1/passwd.1
deleted file mode 100644 (file)
index af5a1c6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH PASSWD 1 
-.SH NAME
-passwd \- change login password
-.SH SYNOPSIS
-.B passwd
-[ name ]
-.SH DESCRIPTION
-This command changes (or installs) a password
-associated with the user
-.IR name
-(your own name by default).
-.PP
-The program prompts for the old password and then for the new one.
-The caller must supply both.
-The new password must be typed twice, to forestall mistakes.
-.PP
-New passwords must be at least four characters long if they use
-a sufficiently rich alphabet and at least six characters long
-if monocase.
-These rules are relaxed if you are insistent enough.
-.PP
-Only the owner of the name or the super-user may change a password;
-the owner must prove he knows the old password.
-.SH FILES
-/etc/passwd
-.SH "SEE ALSO"
-login(1), passwd(5), crypt(3)
-.br
-Robert Morris and Ken Thompson,
-.I Password Security: A Case History
diff --git a/.ref-Research-V7/usr/man/man1/plot.1g b/.ref-Research-V7/usr/man/man1/plot.1g
deleted file mode 100644 (file)
index 77d53c6..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-.TH PLOT 1G 
-.SH NAME
-plot \- graphics filters
-.SH SYNOPSIS
-.B plot
-[
-.BR \-T terminal
-[ raster ] ]
-.SH DESCRIPTION
-These commands read plotting instructions (see
-.IR  plot (5))
-from the standard input,
-and in general
-produce plotting instructions suitable for
-a particular
-.I terminal
-on the standard output.
-.PP
-If no
-.I terminal
-type is specified, the environment parameter $TERM
-(see
-.IR environ (5))
-is used.
-Known
-.I terminals
-are:
-.TP
-4014
-Tektronix 4014 storage scope.
-.TP
-450
-DASI Hyterm 450 terminal (Diablo mechanism).
-.TP
-300
-DASI 300 or GSI terminal (Diablo mechanism).
-.TP
-300S
-DASI 300S terminal (Diablo mechanism).
-.TP
-ver
-Versatec D1200A printer-plotter.
-This version of
-.I plot
-places a scan-converted
-image in `/usr/tmp/raster' and sends the
-result directly to the plotter device rather than to
-the standard output.
-The optional argument causes a previously
-scan-converted file
-.I raster
-to be sent to the plotter.
-.SH FILES
-/usr/bin/tek
-.br
-/usr/bin/t450
-.br
-/usr/bin/t300
-.br
-/usr/bin/t300s
-.br
-/usr/bin/vplot
-.br
-/usr/tmp/raster 
-.SH "SEE ALSO"
-plot(3), plot(5)
-.SH BUGS
-There is no lockout protection
-for /usr/tmp/raster.
diff --git a/.ref-Research-V7/usr/man/man1/pr.1 b/.ref-Research-V7/usr/man/man1/pr.1
deleted file mode 100644 (file)
index a4fe1a3..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-.TH PR 1 
-.SH NAME
-pr  \-  print file
-.SH SYNOPSIS
-.B pr
-[ option ] ...
-[ file ] ...
-.SH DESCRIPTION
-.I Pr
-produces a printed listing of one or more
-.I files.
-The output is separated into pages headed by a date,
-the name of the file or a specified header, and the page number.
-If there are no file arguments,
-.I pr
-prints its standard input.
-.PP
-Options apply to all following files but may be reset
-between files:
-.TP
-.BI \- n
-Produce
-.IR n -column
-output.
-.TP
-.BI + n
-Begin printing with page
-.I  n.
-.TP
-.B  \-h
-Take the next argument as a page header.
-.TP
-.BI \-w n
-For purposes of multi-column output,
-take the width of the page to be
-.I n
-characters instead of the default 72.
-.TP
-.BI \-l n
-Take the length of the page to be
-.I n
-lines instead of the default 66.
-.TP
-.B  \-t
-Do not print the 5-line header or the
-5-line trailer normally supplied for each page.
-.TP
-.BI \-s c
-Separate columns by the single character
-.I c
-instead of by the appropriate amount of white space.
-A missing
-.I c
-is taken to be a tab.
-.TP
-.B  \-m
-Print all
-.I files
-simultaneously,
-each in one column,
-.PP
-Inter-terminal messages via
-.IR write (1)
-are
-forbidden during a
-.IR pr .
-.SH FILES
-/dev/tty?
-to suspend messages.
-.SH "SEE ALSO"
-cat(1)
-.SH DIAGNOSTICS
-There are no diagnostics when
-.I pr
-is printing on a terminal.
diff --git a/.ref-Research-V7/usr/man/man1/prep.1 b/.ref-Research-V7/usr/man/man1/prep.1
deleted file mode 100644 (file)
index 3e8190e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-.TH PREP 1 
-.SH NAME
-prep \- prepare text for statistical processing
-.SH SYNOPSIS
-.B prep
-[
-.B \-dio
-]
-file ...
-.SH DESCRIPTION
-.I Prep
-reads each
-.I file
-in sequence
-and writes it on the standard output,
-one `word' to a line.
-A word is a string of alphabetic characters
-and imbedded apostrophes,
-delimited by space or punctuation.
-Hyphented words are broken apart;
-hyphens at the end of lines are removed and the
-hyphenated parts are joined.
-Strings of digits are discarded.
-.PP
-The following option letters may appear in any order:
-.TP
-.B \-d
-Print the word number (in the input
-stream) with each word.
-.TP
-.B \-i
-Take the next
-.I file
-as an `ignore' file.
-These words will not appear in the output.
-(They will be counted, for purposes of the
-.B \-d
-count.)
-.TP
-.B \-o
-Take the next 
-.I file
-as an `only' file.
-Only these words will appear in the output.
-(All other words will also be counted for
-the 
-.B \-d
-count.)
-.TP
-.B \-p
-Include punctuation marks (single nonalphanumeric characters)
-as separate output lines.
-The punctuation marks are not counted for the
-.B \-d
-count.
-.PP
-Ignore and only files contain words, one per line.
-.SH SEE ALSO
-deroff(1)
diff --git a/.ref-Research-V7/usr/man/man1/prof.1 b/.ref-Research-V7/usr/man/man1/prof.1
deleted file mode 100644 (file)
index 53b3b9a..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-.TH PROF 1 
-.SH NAME
-prof \- display profile data
-.SH SYNOPSIS
-.B prof
-[
-.B \-v
-] [
-.B \-a
-] [
-.B \-l
-] [
-.BI \- "low\fR [ \fB\-\fIhigh\fR ]"
-] [ file ]
-.SH DESCRIPTION
-.I Prof
-interprets the file
-.I mon.out
-produced by the
-.I monitor
-subroutine.
-Under default modes,
-the symbol table in the
-named object file
-.I (a.out
-default)
-is read and correlated with the
-.I mon.out
-profile file.
-For each external symbol, the percentage
-of time spent executing between that symbol
-and the next
-is printed (in decreasing order),
-together with the number of times that routine was called
-and the number of milliseconds per call.
-.PP
-If the
-.B \-a
-option is used,
-all symbols are reported rather than
-just external symbols.
-If the
-.B \-l
-option
-is used,
-the output is listed by
-symbol value rather than
-decreasing percentage.
-.PP
-If the
-.B \-v
-option is used,
-all printing is suppressed
-and a graphic version of the profile
-is produced
-on the standard output for display by the
-.IR  plot (1)
-filters.
-The numbers
-.I low
-and 
-.I high,
-by default 0 and 100, cause a selected
-percentage of the profile to be plotted
-with accordingly higher resolution.
-.PP
-In order for the number of calls to a routine to be tallied,
-the
-.B \-p
-option of
-.I cc
-must have been given when the file containing the
-routine was compiled.
-This option also arranges for the
-.I mon.out
-file to be produced automatically.
-.SH FILES
-.ta \w'mon.out  'u
-mon.out        for profile
-.br
-a.out          for namelist
-.SH "SEE ALSO"
-monitor(3), profil(2), cc(1), plot(1)
-.SH BUGS
-Beware of quantization errors.
diff --git a/.ref-Research-V7/usr/man/man1/ps.1 b/.ref-Research-V7/usr/man/man1/ps.1
deleted file mode 100644 (file)
index 88aa2d9..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-.TH PS 1  PDP11
-.SH NAME
-ps \- process status
-.SH SYNOPSIS
-.B ps
-[
-.B aklx
-]
-[ namelist ]
-.SH DESCRIPTION
-.I Ps
-prints certain indicia about active
-processes.
-The
-.B a
-option asks for information about all processes with terminals (ordinarily
-only one's own processes are displayed);
-.B x
-asks even about processes with no terminal;
-.B l
-asks for a long listing.
-The short listing contains the process ID, tty letter,
-the cumulative execution time of the process and an
-approximation to the command line.
-.PP
-The long listing is columnar and contains
-.TP
-F
-Flags associated with the process.
-01: in core;
-02: system process;
-04: locked in core (e.g. for physical I/O);
-10: being swapped;
-20: being traced by another process.
-.TP
-S
-The state of the process.
-0: nonexistent;
-S: sleeping;
-W: waiting;
-R: running;
-I: intermediate;
-Z: terminated;
-T: stopped.
-.TP
-UID
-The user ID of the process owner.
-.TP
-PID
-The process ID of the process; as in certain cults it is possible to kill a process
-if you know its true name.
-.TP
-PPID
-The process ID of the parent process.
-.TP
-CPU
-Processor utilization for scheduling.
-.TP
-PRI
-The priority of the
-process; high numbers mean low priority.
-.TP
-NICE
-Used in priority computation.
-.TP
-ADDR
-The core address of the process if resident,
-otherwise the disk address.
-.TP
-SZ
-The size in blocks of the core image of the process.
-.TP
-WCHAN
-The event for which the process is waiting or sleeping;
-if blank, the process is running.
-.TP
-TTY
-The controlling tty for the process.
-.TP
-TIME
-The cumulative execution time for the process.
-.TP TIME
-The command and its arguments.
-.DT
-.PP
-A process that has exited and has a parent, but has not
-yet been waited for by the parent is marked <defunct>.
-.I Ps
-makes an educated guess as to the file name
-and arguments given when the process was created
-by examining core memory or the swap area.
-The method is inherently somewhat unreliable and in any event
-a process is entitled to destroy this information,
-so the names cannot be counted on too much.
-.PP
-If the
-.B k
-option is specified,
-the file
-.I /usr/sys/core
-is used in place of
-.IR /dev/mem .
-This is used for
-postmortem system debugging.
-If a second argument is given,
-it is taken to be the file containing the system's namelist.
-.SH FILES
-.ta \w'/usr/sys/core 'u
-/unix          system namelist
-.br
-/dev/mem       core memory
-.br
-/usr/sys/core  alternate core file
-.br
-/dev           searched to find swap device and tty names
-.SH "SEE ALSO"
-kill(1)
-.SH BUGS
-Things can change while
-.I ps
-is running; the picture it gives is only a close
-approximation to reality.
-.br
-Some data printed for defunct processes is irrelevant
diff --git a/.ref-Research-V7/usr/man/man1/pstat.1m b/.ref-Research-V7/usr/man/man1/pstat.1m
deleted file mode 100644 (file)
index 87222de..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-.TH PSTAT 1M
-.SH NAME
-pstat \- print system facts
-.SH SYNOPSIS
-.B pstat
-[
-.B \-aixptuf
-] [ suboptions ]
-[ file ]
-.SH DESCRIPTION
-.I Pstat
-interprets the contents of certain system tables.
-If
-.I file
-is given, the tables are sought there, otherwise
-in
-.I /dev/mem.
-The required namelist is taken from
-.I /unix.
-Options are
-.TP \w'WCHAN\ 'u
-.B \-a
-Under
-.BR \-p ,
-describe all process slots rather than just active ones.
-.TP
-.B \-i
-Print the inode table with the these headings:
-.IP LOC
-The core location of this table entry.
-.PD 0
-.IP FLAGS
-Miscellaneous state variables encoded thus:
-.RS
-.IP L
-locked
-.IP U
-update time
-.IR filsys (5))
-must be corrected
-.IP A
-access time must be corrected
-.IP M
-file system is mounted here
-.IP W
-wanted by another process (L flag is on)
-.IP T
-contains a text file
-.IP C
-changed time must be corrected
-.RE
-.IP CNT
-Number of open file table entries for this inode.
-.IP DEV
-Major and minor device number of file system in which
-this inode resides.
-.IP INO
-I-number within the device.
-.IP MODE
-Mode bits, see
-.IR chmod (2).
-.IP NLK
-Number of links to this inode.
-.IP UID
-User ID of owner.
-.IP SIZ/DEV
-Number of bytes in an ordinary file, or
-major and minor device of special file.
-.PD
-.TP
-.B \-x
-Print the text table with these headings:
-.IP LOC
-The core location of this table entry.
-.PD 0
-.IP FLAGS
-Miscellaneous state variables encoded thus:
-.RS
-.IP T
-.IR ptrace (2)
-in effect
-.IP W
-text not yet written on swap device
-.IP L
-loading in progress
-.IP K
-locked
-.IP w
-wanted (L flag is on)
-.RE
-.PD
-.IP DADDR
-Disk address in swap, measured in multiples of 512 bytes.
-.IP CADDR
-Core address, measured in multiples of 64 bytes.
-.IP SIZE
-Size of text segment, measured in multiples of 64 bytes.
-.IP IPTR
-Core location of corresponding inode.
-.IP CNT
-Number of processes using this text segment.
-.IP CCNT
-Number of processes in core using this text segment.
-.PD
-.TP
-.B \-p
-Print process table for active processes with these headings:
-.IP LOC
-The core location of this table entry.
-.PD 0
-.IP S
-Run state encoded thus:
-.RS
-.IP 0
-no process
-.IP 1
-waiting for some event
-.IP 3
-runnable
-.IP 4
-being created
-.IP 5
-being terminated
-.IP 6
-stopped under trace
-.RE
-.IP F
-Miscellaneous state variables, or-ed together:
-.RS
-.IP 01
-loaded
-.IP 02
-the scheduler process
-.IP 04
-locked
-.IP 010
-swapped out
-.IP 020
-traced
-.IP 040
-used in tracing
-.IP 0100
-locked in by
-.IR lock (2).
-.RE
-.IP PRI
-Scheduling priority, see
-.IR nice (2).
-.IP SIGNAL
-Signals received (signals 1-16 coded in bits 0-15),
-.IP UID
-Real user ID.
-.IP TIM
-Time resident in seconds; times over 127 coded as 127.
-.IP CPU
-Weighted integral of CPU time, for scheduler.
-.IP NI
-Nice level,
-see
-.IR nice (2).
-.IP PGRP
-Process number of root of process group
-(the opener of the controlling terminal).
-.IP PID
-The process ID number.
-.IP PPID
-The process ID of parent process.
-.IP ADDR
-If in core, the physical address of the `u-area' of
-the process measured in multiples of 64 bytes.
-If swapped out, the position in the swap area
-measured in multiples of 512 bytes.
-.IP SIZE
-Size of process image in multiples of 64 bytes.
-.IP WCHAN
-Wait channel number of a waiting process.
-.IP LINK
-Link pointer in list of runnable processes.
-.IP TEXTP
-If text is pure, pointer to location of text table entry.
-.IP CLKT
-Countdown for
-.IR alarm (2)
-measured in seconds.
-.PD
-.TP
-.B \-t
-Print table for terminals (only DH11 and DL11 handled)
-with these headings:
-.IP RAW
-Number of characters in raw input queue.
-.PD 0
-.IP CAN
-Number of characters in canonicalized input queue.
-.IP OUT
-Number of characters in putput queue.
-.IP MODE
-See
-.IR tty (4).
-.IP ADDR
-Physical device address.
-.IP DEL
-Number of delimiters (newlines) in canonicalized input queue.
-.IP COL
-Calculated column position of terminal.
-.IP STATE
-Miscellaneous state variables encoded thus:
-.RS
-.IP W
-waiting for open to complete
-.IP O
-open
-.IP S
-has special (output) start routine
-.IP C
-carrier is on
-.IP B
-busy doing output
-.IP A
-process is awaiting output
-.IP X
-open for exclusive use
-.IP H
-hangup on close
-.RE
-.IP PGRP
-Process group for which this is controlling terminal.
-.PD
-.TP
-.B \-u
-print information about a user process;
-the next argument is its address as given
-by
-.IR ps (1).
-The process must be in main memory, or the file used can
-be a core image and the address 0.
-.TP
-.B \-f
-Print the open file table with these headings:
-.IP LOC
-The core location of this table entry.
-.PD 0
-.IP FLG
-Miscellaneous state variables encoded thus:
-.RS
-.IP R
-open for reading
-.IP W
-open for writing
-.IP P
-pipe
-.RE
-.IP CNT
-Number of processes that know this open file.
-.IP INO
-The location of the inode table entry for this file.
-.IP OFFS
-The file offset, see
-.IR lseek (2).
-.PD
-.PP
-.SH FILES
-.ta \w'/dev/mem  'u
-/unix  namelist
-.br
-/dev/mem       default source of tables
-.SH SEE ALSO
-ps(1), stat(2), filsys(5)
-.br
-K. Thompson,
-.I UNIX Implementation
diff --git a/.ref-Research-V7/usr/man/man1/ptx.1 b/.ref-Research-V7/usr/man/man1/ptx.1
deleted file mode 100644 (file)
index ccd2e87..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-.TH PTX 1
-.SH NAME
-ptx \- permuted index
-.SH SYNOPSIS
-.B ptx
-[ option ] ...
-[ input [ output ] ]
-.SH DESCRIPTION
-.I Ptx
-generates a permuted index to file
-.I input
-on file
-.I output
-(standard input and output default).
-It has three phases: the first does the permutation, generating
-one line for each keyword in an input line.
-The keyword is rotated to the front.
-The permuted file is then
-sorted.
-Finally, the sorted lines are rotated so the keyword
-comes at the middle of the page.
-.I Ptx
-produces output in the form:
-.br
-.IP
-\&.xx "tail" "before keyword" "keyword and after" "head"
-.LP
-where .xx may be an
-.I nroff
-or
-.IR troff (1)
-macro
-for user-defined formatting.
-The
-.I before keyword
-and
-.I keyword and after
-fields incorporate as much of the line as will fit
-around the keyword when it is printed at the middle of the page.
-.I Tail
-and
-.I head,
-at least one of which is an empty string "",
-are wrapped-around pieces small enough to fit
-in the unused space at the opposite end of the line.
-When original text must be discarded, `/' marks the spot.
-.PP
-The following options can be applied:
-.TP
-.BR \-f
-Fold upper and lower case letters for sorting.
-.TP 
-.BR \-t
-Prepare the output for the phototypesetter;
-the default line length is 100 characters.
-.TP 
-.BI \-w " n"
-Use the next argument,
-.I n,
-as the width of the output line.
-The default line length is 72 characters.
-.TP
-.BI \-g " n"
-Use the next argument,
-.I n,
-as the number of characters to allow for each gap
-among the four parts of the line as finally printed.
-The default gap is 3 characters.
-.TP 
-.BR \-o " only"
-Use as keywords only the words given in the \fIonly\fR file.
-.TP 
-.BR \-i " ignore"
-Do not use as keywords any words given in the
-.I
-ignore
-file.
-If the \fB-\fIi\fR and \fB-\fIo\fR options are missing, use /usr/lib/eign
-as the 
-.I
-ignore
-file.
-.TP 
-.BR \-b " break"
-Use the characters in the 
-.I
-break
-file to separate words.
-In any case, tab, newline, and space characters are always used as break characters.
-.TP
-.BR \-r
-Take any leading nonblank characters of each input line to
-be a reference identifier (as to a page or chapter)
-separate from the text of the line.
-Attach that identifier as a 5th field on each output line.
-.PP
-The index for this manual was generated using
-.I ptx.
-.SH FILES
-/bin/sort
-.br
-/usr/lib/eign
-.SH BUGS
-Line length counts do not account for overstriking or
-proportional spacing.
-.br
diff --git a/.ref-Research-V7/usr/man/man1/pubindex.1 b/.ref-Research-V7/usr/man/man1/pubindex.1
deleted file mode 100644 (file)
index 8aae75b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-.TH PUBINDEX 1 local
-.SH NAME
-pubindex \- make inverted bibliographic index
-.SH SYNOPSIS
-.B pubindex
-[ file ] ...
-.SH DESCRIPTION
-.I Pubindex
-makes a hashed inverted index to
-the named
-.I files
-for use by
-.IR refer (1).
-The
-.I files
-contain bibliographic references separated by blank lines.
-A bibliographic reference is a set of lines
-that contain bibliographic information fields.
-Each field starts on a line beginning with a `%', followed
-by a key-letter, followed by a blank, and followed by the
-contents of the field, which continues until the next line
-starting with `%'.
-The most common key-letters and the corresponding fields are:
-.IP
-.nf
-A      Author name
-B      Title of book containing article referenced
-C      City
-D      Date
-d      Alternate date
-E      Editor of book containing article referenced
-G      Government (CFSTI) order number
-I      Issuer (publisher)
-J      Journal
-K      Other keywords to use in locating reference
-M      Technical memorandum number
-N      Issue number within volume
-O      Other commentary to be printed at end of reference
-P      Page numbers
-R      Report number
-r      Alternate report number
-T      Title of article, book, etc.
-V      Volume number
-X      Commentary unused by \fIpubindex\fR
-.fi
-.PP
-Except for `A', each field should only be given once.
-Only relevant fields should be supplied.
-An example is:
-.IP
-.nf
-%T 5-by-5 Palindromic Word Squares
-%A M. D. McIlroy
-%J Word Ways
-%V 9
-%P 199-202
-%D 1976
-.fi
-.SH FILES
-.I "x.ia, x.ib, x.ic"
-where 
-.I x
-is the first argument.
-.SH SEE ALSO
-refer(1)
diff --git a/.ref-Research-V7/usr/man/man1/pwd.1 b/.ref-Research-V7/usr/man/man1/pwd.1
deleted file mode 100644 (file)
index 4962aac..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.TH PWD 1 
-.SH NAME
-pwd \- working directory name
-.SH SYNOPSIS
-.B pwd
-.SH DESCRIPTION
-.I Pwd
-prints the pathname of the working (current) directory.
-.SH "SEE ALSO"
-cd(1)
diff --git a/.ref-Research-V7/usr/man/man1/quot.1m b/.ref-Research-V7/usr/man/man1/quot.1m
deleted file mode 100644 (file)
index 8cda5ca..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH QUOT 1M 
-.SH NAME
-quot \- summarize file system ownership
-.SH SYNOPSIS
-.B quot
-[ option ] ...
-[ filesystem ]
-.SH DESCRIPTION
-.I Quot
-prints the number of blocks in the named
-.I filesystem
-currently owned by each user.
-If no 
-.I filesystem
-is named, a default name is assumed.
-The following options are available:
-.TP
-.B \-n
-Cause the pipeline
-.B "ncheck filesystem | sort +0n | quot \-n filesystem
-to produce a list of all files and their owners.
-.TP
-.B \-c
-Print three columns giving file size in blocks, number of
-files of that size, and cumulative total of blocks
-in that size or smaller file.
-.TP
-.B \-f
-Print count of number of files as well as space owned by each user.
-.SH FILES
-Default file system varies with system.
-.br
-/etc/passwd to get user names
-.SH "SEE ALSO"
-ls(1), du(1)
-.SH BUGS
-Holes in files are counted as if they actually occupied space.
diff --git a/.ref-Research-V7/usr/man/man1/ranlib.1 b/.ref-Research-V7/usr/man/man1/ranlib.1
deleted file mode 100644 (file)
index 60bed02..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH RANLIB 1
-.SH NAME
-ranlib \- convert archives to random libraries
-.SH SYNOPSIS
-.B ranlib
-archive ...
-.SH DESCRIPTION
-.I Ranlib
-converts each
-.I archive
-to a form which can be loaded
-more rapidly by the loader,
-by adding a table of contents named
-.B __.SYMDEF
-to the beginning of the archive.
-It uses
-.IR ar (1)
-to reconstruct the archive,
-so that sufficient temporary file space must
-be available in the file system containing the
-current directory.
-.SH SEE ALSO
-ld(1), ar(1)
-.SH BUGS
-Because generation of a library by
-.I ar
-and randomization by
-.I ranlib
-are separate,
-phase errors are possible.
-The loader
-.I ld
-warns when the modification date of
-a library is more recent than
-the creation of its dictionary;
-but this means you get the warning even if you
-only copy the library.
diff --git a/.ref-Research-V7/usr/man/man1/ratfor.1 b/.ref-Research-V7/usr/man/man1/ratfor.1
deleted file mode 100644 (file)
index 7dab36e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-.TH RATFOR 1
-.SH NAME
-ratfor \- rational Fortran dialect
-.SH SYNOPSIS
-.B ratfor
-[ option ... ]
-[ filename ... ]
-.SH DESCRIPTION
-.I Ratfor
-converts a rational dialect of Fortran into ordinary irrational Fortran.
-.I Ratfor
-provides control flow constructs essentially identical to those in C:
-.TP
-statement grouping:
-.nf
-{ statement; statement; statement }
-.TP
-decision-making:
-if (condition) statement [ else statement ]
-.br
-switch (integer value) {
-       case integer:   statement
-       ...
-       [ default: ]    statement
-}
-.TP
-loops:
-while (condition) statement
-for (expression; condition; expression) statement
-do limits statement
-repeat statement [ until (condition) ]
-break [n]
-next [n]
-.LP
-and some syntactic sugar to make programs easier to read and write:
-.TP
-free form input:
-multiple statements/line; automatic continuation
-.TP
-comments:
-# this is a comment
-.TP
-translation of relationals:
->, >=, etc., become .GT., .GE., etc.
-.TP
-return (expression)
-returns expression to caller from function
-.TP
-define:
-define name replacement
-.TP
-include:
-include filename
-.PP
-.fi
-The option
-.B \-h
-causes quoted strings to be turned into
-27H constructs.
-.B \-C
-copies comments to the output, and attempts
-to format it neatly.
-Normally, continuation lines are marked with a &
-in column 1;
-the option
-.B \-6x
-makes the continuation character
-.B x
-and places it in column 6.
-.PP
-.I Ratfor
-is best used with
-.IR f77 (1).
-.SH "SEE ALSO"
-f77(1)
-.br
-B. W. Kernighan and P. J. Plauger,
-.IR "Software Tools" ,
-Addison-Wesley, 1976.
diff --git a/.ref-Research-V7/usr/man/man1/refer.1 b/.ref-Research-V7/usr/man/man1/refer.1
deleted file mode 100644 (file)
index 37fa2ad..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-.TH REFER 1
-.SH NAME
-refer, lookbib \- find and insert literature references in documents
-.SH SYNOPSIS
-.B refer
-[ option ] ...
-.PP
-.B lookbib
-[ file ] ...
-.SH DESCRIPTION
-.I Lookbib
-accepts keywords from the standard input 
-and searches a bibliographic data base for references
-that contain those keywords anywhere in title, author,
-journal name, etc.
-Matching references are printed on the standard output.
-Blank lines are taken as delimiters between queries.
-.PP
-.I Refer
-is a preprocessor for
-.I nroff
-or
-.IR troff (1)
-that finds and formats references.
-The input files (standard input default) are copied to the standard output,
-except for lines between .[ and .]
-command lines, which are assumed to contain keywords as for
-.I lookbib,
-and are replaced by information from the bibliographic data base.
-The user may avoid the search, override fields from it, or
-add new fields.
-The reference data, from whatever source, are assigned to a set of
-.I troff
-strings.
-Macro packages such as
-.IR ms (7)
-print the finished reference text from these strings.
-A flag is placed in the text at the point of reference;
-by default the references are indicated by numbers.
-.br
-.sp
-The following options are available:
-.TP 6
-.BI \-a r
-Reverse the first
-.I r
-author names (Jones, J. A. instead of J. A. Jones).
-If
-.I r
-is omitted all author names are reversed.
-.ns
-.TP
-.B \-b
-Bare mode: do not put any flags in text (neither numbers nor labels).
-.ns
-.TP
-.BI \-c string
-Capitalize (with C\s-2APS\s0 S\s-2MALL\s+2 C\s-2APS\s0)
-the fields whose key-letters are in
-.IR string .
-.ns
-.TP
-.B \-e
-Instead of leaving the references where encountered,
-accumulate them
-until a sequence of the form
-.nf
-               .[
-               $LIST$
-               .]
-.fi
-is encountered, and then write out all references
-collected so far.  Collapse references to the same source.
-.ns
-.TP
-.BI \-k x
-Instead of numbering references, use labels as specified in
-a
-reference data line
-beginning
-.I %x;
-by default 
-.I x
-is
-.B L.
-.ns
-.TP
-.BI \-l m , n
-Instead of numbering references, use labels made from
-the senior author's last name and the year of publication.
-Only the first
-.I m
-letters of the last name
-and the last
-.I n
-digits of the date are used.
-If either
-.I m
-or
-.BI , n
-is omitted the entire name or date respectively is used.
-.ns
-.TP
-.B \-p
-Take the next argument as a file of
-references to be searched.
-The default file is searched last.
-.ns
-.TP
-.B \-n
-Do not search the default file.
-.ns
-.TP
-.BI \-s keys
-Sort references by fields whose key-letters are in
-the
-.I keys
-string;
-permute
-reference numbers in text accordingly.
-Implies
-.BR \-e .
-The key-letters in
-.I keys
-may be followed by a number to indicate how many such fields
-are used, with
-.B +
-taken as a very large number.
-The default is
-.B AD
-which sorts on the senior author and then date; to sort, for example,
-on all authors and then title use
-.BR -sA+T .
-.PP
-To use your own references, put them in the format
-described in
-.IR pubindex (1)
-They can be searched
-more rapidly by running
-.IR pubindex (1)
-on them before using
-.I refer;
-failure to index results in a linear search.
-.PP
-When
-.I refer
-is used with
-.I eqn,
-.I neqn
-or
-.I tbl,
-.I refer
-should be first, to minimize the volume
-of data passed through
-pipes.
-.SH FILES
-.I /usr/dict/papers
-directory of default publication lists and indexes
-.br
-.I /usr/lib/refer
-directory of programs
-.SH SEE ALSO
-.br
diff --git a/.ref-Research-V7/usr/man/man1/restor.1m b/.ref-Research-V7/usr/man/man1/restor.1m
deleted file mode 100644 (file)
index fe67f71..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-.TH RESTOR 1M 
-.SH NAME
-restor \- incremental file system restore
-.SH SYNOPSIS
-.I restor
-key [ argument ... ]
-.SH DESCRIPTION
-.I Restor
-is used to read magtapes dumped with the
-.I dump
-command.
-The
-.I key
-specifies what is to be done.
-.I Key
-is one of the characters
-.B rRxt
-optionally combined with
-.BR f .
-.TP
-.B  f
-Use the first
-.I argument
-as the name of the tape instead
-of the default.
-.TP
-.B  r or R
-The tape
-is read and loaded into the file system
-specified in
-.I argument.
-This should not be done lightly (see below).
-If the key is
-.B R
-.I restor
-asks which tape of a multi volume set to start on.
-This allows restor to be interrupted and then
-restarted (an
-.I icheck \-s must be done before restart).
-.TP
-.B  x
-Each file on the
-tape named by an 
-.I argument
-is extracted.
-The file name has all `mount' prefixes removed;
-for example, /usr/bin/lpr is named /bin/lpr on the tape.
-The file extracted is placed in a file with a numeric name
-supplied by
-.I restor
-(actually the inode number).
-In order to keep the amount of tape read to a minimum,
-the following procedure is recommended:
-.sp
-Mount volume 1 of the set of dump tapes.
-.sp
-Type the
-.I restor
-command.
-.sp
-.I Restor
-will announce whether or not it found the files,
-give the number it will name the file, and rewind the tape.
-.sp
-It then
-asks you to `mount the desired tape volume'.
-Type the number of the volume you choose.
-On a
-multivolume dump the recommended procedure is to mount the
-last through the first volume in that order.
-.I Restor
-checks to see if any of the files requested are on the
-mounted tape (or a later tape, thus the reverse order) and doesn't
-read through the tape if no files are.
-If you are working with a single volume dump or the number of files
-being restored is large, respond to the query with `1' and
-.I restor
-will read the tapes in sequential order.
-.sp
-If you have a hierarchy to restore you can use dumpdir(1)
-to produce the list of names and a shell script to move
-the resulting files to their homes.
-.TP
-.B t
-Print the date the tape was written and the date
-the filesystem was dumped from.
-.PP
-The
-.B r
-option should only be used to restore
-a complete dump tape onto a clear file system
-or to restore an incremental dump tape onto this.
-Thus
-.PP
-       /etc/mkfs /dev/rp0 40600
-.br
-       restor r /dev/rp0
-.PP
-is a typical sequence to restore a complete dump.
-Another
-.I restor
-can be done to get an incremental dump
-in on top of this.
-.PP
-A
-.I dump
-followed by a
-.I mkfs
-and a
-.I restor
-is used to
-change the size of a file system.
-.SH FILES
-default tape unit varies with installation
-.br
-rst*
-.SH "SEE ALSO"
-dump(1), mkfs(1), dumpdir(1)
-.SH DIAGNOSTICS
-There are various diagnostics
-involved with reading the tape and writing the disk.
-There are also diagnostics if the i-list or the free list
-of the file system is not large enough to hold the dump.
-.PP
-If the dump extends over more than one tape,
-it may ask you to change tapes.
-Reply with a new-line when the next tape has been mounted.
-.SH BUGS
-There is redundant information on the tape
-that could be used in case of tape reading problems.
-Unfortunately,
-.I restor
-doesn't use it.
diff --git a/.ref-Research-V7/usr/man/man1/rev.1 b/.ref-Research-V7/usr/man/man1/rev.1
deleted file mode 100644 (file)
index fdde69c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-.TH REV 1 
-.SH NAME
-rev \- reverse lines of a file
-.SH SYNOPSIS
-.B rev
-[ file ] ...
-.SH DESCRIPTION
-.I Rev
-copies the named files to the standard output,
-reversing the order of characters in every line.
-If no file is specified, the standard input is copied.
diff --git a/.ref-Research-V7/usr/man/man1/rm.1 b/.ref-Research-V7/usr/man/man1/rm.1
deleted file mode 100644 (file)
index 1c3c46c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH RM 1 
-.SH NAME
-rm, rmdir  \- remove (unlink) files
-.SH SYNOPSIS
-.B rm
-[
-.B \-fri
-] file ...
-.PP
-.B rmdir
-dir ...
-.PP
-.SH DESCRIPTION
-.I Rm
-removes the entries for one or more
-files
-from a directory.
-If an entry was the last link to the file, the file
-is destroyed.
-Removal of a file requires write permission in its directory,
-but neither read nor write permission on the file itself.
-.PP
-If a file has no write permission
-and the standard input is a terminal,
-its permissions are printed and a line is read from
-the standard input.
-If that line begins with `y' the file is deleted,
-otherwise the file remains.
-No questions are asked
-when the
-.B \-f
-(force) option is given.
-.PP
-If a designated file is a directory,
-an error comment is printed unless the optional
-argument
-.B \-r
-has been used.
-In that case,
-.I rm
-recursively deletes the
-entire contents of the specified directory,
-and the directory itself.
-.PP
-If the
-.B \-i
-(interactive) option is in effect,
-.I rm
-asks whether to delete each file,
-and, under
-.BR \-r ,
-whether to examine each directory.
-.PP
-.I Rmdir
-removes entries for the named directories,
-which must be empty.
-.SH "SEE ALSO"
-unlink(2)
-.SH DIAGNOSTICS
-Generally self-explanatory.
-It is forbidden to remove the file `..' merely to avoid the
-antisocial consequences of inadvertently doing something like
-`rm \-r .*'.
diff --git a/.ref-Research-V7/usr/man/man1/roff.1 b/.ref-Research-V7/usr/man/man1/roff.1
deleted file mode 100644 (file)
index a2eda76..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-.TH ROFF 1 
-.SH NAME
-roff  \-  format text
-.SH SYNOPSIS
-.B roff
-[ \fB+\fIn\fR ] [ \fB\-\fIn\fR ] [
-.B \-s
-] [
-.B \-h
-] file ...
-.PP
-.B nroff \-mr
-[ option ] ... file ...
-.br
-.B troff \-mr
-[ option ] ... file ...
-.SH DESCRIPTION
-.I Roff
-formats text according to control lines embedded
-in the text in the given files.
-Encountering a nonexistent file terminates printing.
-Incoming inter-terminal messages are turned off during printing.
-The optional flag arguments mean:
-.br
-.ns
-.TP 5
-.BI + n
-Start printing at the first page with number
-.IR n .
-.br
-.ns
-.TP 5
-.BI \- n
-Stop printing at the first page numbered higher
-than
-.IR n .
-.br
-.ns
-.TP 5
-.B  \-s
-Stop before each page (including the first)
-to allow paper manipulation;
-resume on receipt of an interrupt signal.
-.br
-.ns
-.TP 5
-.B  \-h
-Insert tabs in the output stream to replace
-spaces whenever appropriate.
-.PP
-.DT
-Input consists of intermixed
-.I "text lines,"
-which contain information to be formatted, and
-.I "request lines,"
-which contain instructions about how to format
-it.
-Request lines begin with a distinguished
-.I "control character,"
-normally a period.
-.PP
-Output lines may be
-.I filled
-as nearly as possible with words without regard to
-input lineation.
-Line
-.I breaks
-may be caused at specified places by
-certain commands, or by the appearance of an
-empty input line or an input line beginning with a space.
-.PP
-The capabilities of
-.I roff
-are specified in the attached Request Summary.
-Numerical values are denoted there by n or +n,
-titles by t, and single characters by c.
-Numbers denoted +n may be signed + or \-,
-in which case they signify relative changes to
-a quantity, otherwise they signify
-an absolute resetting.
-Missing n fields are ordinarily taken to be 1,
-missing t fields to be empty, and c fields to shut off
-the appropriate special interpretation.
-.PP
-Running titles usually appear at top and bottom of every
-page.
-They are set by requests like
-.PP
-.in +10
-.if t \&.he \(fmpart1\(fmpart2\(fmpart3\(fm
-.if n \&.he 'part1'part2'part3'
-.in -10
-.PP
-Part1 is left justified, part2 is centered,
-and part3 is right justified on the page.
-Any % sign in a title is replaced by the current
-page number.
-Any nonblank may serve as a quote.
-.PP
-ASCII tab characters are replaced in the input by a
-.I "replacement character,"
-normally a space,
-according to the
-column settings given by a .ta command.
-(See .tr for how to convert this character on output.)
-.PP
-Automatic hyphenation of filled output is done
-under control of .hy.
-When a word contains a designated
-.I "hyphenation character,"
-that character disappears from the output and
-hyphens can be introduced into
-the word at the marked places only.
-.PP
-The
-.B \-mr
-option of
-.I nroff
-or 
-.IR troff (1)
-simulates
-.I roff
-to the greatest extent possible.
-.SH FILES
-/usr/lib/suftab        suffix hyphenation tables
-.br
-/tmp/rtm?      temporary
-.br
-.SH BUGS
-.I Roff
-is the simplest of the text formatting
-programs, and is utterly frozen.
-.bp
-.tc |
-.tr |
-.in 0
-.ce
-REQUEST SUMMARY
-.PP
-.ul
-.ta \w'.tr cdef.. 'u +\w'Break 'u +\w'Initial 'u
-.di x
-                       \ka
-.br
-.di
-.in \nau
-.ti 0
-Request        Break   Initial Meaning
-.na
-.ti 0
-.li
-.ad    yes     yes     Begin adjusting right margins.
-.ti 0
-.li
-.ar    no      arabic  Arabic page numbers.
-.ti 0
-.li
-.br    yes     \-      Causes a line break \*- the filling of
-the current line is stopped.
-.ti 0
-.li
-.bl|n  yes     \-      Insert of n blank lines, on new page if necessary.
-.ti 0
-.li
-.bp|+n yes     n=1     Begin new page and number it n; no n means `+1'.
-.ti 0
-.li
-.cc|c  no      c=.     Control character becomes `c'.
-.ti 0
-.li
-.ce|n  yes     \-      Center the next n input lines,
-without filling.
-.ti 0
-.li
-.de|xx no      \-      Define parameterless macro 
-to be invoked by request `.xx'
-(definition ends on line beginning `\fB..\fR').
-.ti 0
-.li
-.ds    yes     no      Double space; same as `.ls 2'.
-.ti 0
-.li
-.ef|t  no      t=\*a\*a\*a\*a  Even foot title becomes t.
-.ti 0
-.li
-.eh|t  no      t=\*a\*a\*a\*a  Even head title becomes t.
-.ti 0
-.li
-.fi    yes     yes     Begin filling output lines.
-.ti 0
-.li
-.fo    no      t=\*a\*a\*a\*a  All foot titles are t.
-.ti 0
-.li
-.hc|c  no      none    Hyphenation character becomes `c'.
-.ti 0
-.li
-.he|t  no      t=\*a\*a\*a\*a  All head titles are t.
-.ti 0
-.li
-.hx    no      \-      Title lines are suppressed.
-.ti 0
-.li
-.hy|n  no      n=1     Hyphenation is done, if n=1;
-and is not done, if n=0.
-.ti 0
-.li
-.ig    no      \-      Ignore input lines through
-a line beginning with `\fB..\fR'.
-.ti 0
-.li
-.in|+n yes     \-      Indent n spaces from left margin.
-.ti 0
-.li
-.ix +n no      \-      Same as `.in' but without break.
-.ti 0
-.li
-.li|n  no      \-      Literal, treat next n lines as text.
-.ti 0
-.li
-.ll|+n no      n=65    Line length including indent is n characters.
-.ti 0
-.li
-.ls|+n yes     n=1     Line spacing set to n lines per output line.
-.ti 0
-.li
-.m1|n  no      n=2     Put n blank lines between the top
-of page and head title.
-.ti 0
-.li
-.m2|n  no      n=2     n blank lines put between head title
-and beginning of text on page.
-.ti 0
-.li
-.m3|n  no      n=1     n blank lines put between end of
-text and foot title.
-.ti 0
-.li
-.m4|n  no      n=3     n blank lines put between the foot title
-and the bottom of page.
-.ti 0
-.li
-.na    yes     no      Stop adjusting the right margin.
-.ti 0
-.li
-.ne|n  no      \-      Begin new page, if n output lines
-cannot fit on present page.
-.ti 0
-.li
-.nn|+n no      \-      The next n output lines are not numbered.
-.ti 0
-.li
-.n1    no      no      Add 5 to page offset;
-number lines in margin from 1 on each page.
-.ti 0
-.li
-.n2|n  no      no      Add 5 to page offset;
-number lines from n;
-stop if n=0.
-.ti 0
-.li
-.ni|+n no      n=0     Line numbers are indented n.
-.ti 0
-.li
-.nf    yes     no      Stop filling output lines.
-.ti 0
-.li
-.nx|file       \-      Switch input to `file'.
-.ti 0
-.li
-.of|t  no      t=\*a\*a\*a\*a  Odd foot title becomes t.
-.ti 0
-.li
-.oh|t  no      t=\*a\*a\*a\*a  Odd head title becomes t.
-.ti 0
-.li
-.pa|+n yes     n=1     Same as `.bp'.
-.ti 0
-.li
-.pl|+n no      n=66    Total paper length taken to be n lines.
-.ti 0
-.li
-.po|+n no      n=0     Page offset.
-All lines are preceded by n spaces.
-.ti 0
-.li
-.ro    no      arabic  Roman page numbers.
-.ti 0
-.li
-.sk|n  no      \-      Produce n blank pages starting next page.
-.ti 0
-.li
-.sp|n  yes     \-      Insert block of n blank lines,
-except at top of page.
-.ti 0
-.li
-.ss    yes     yes     Single space output lines,
-equivalent to `.ls 1'.
-.ti 0
-.li
-.ta|n|n..              \-      Pseudotab settings.
-Initial tab settings are columns 9 17 25 ...
-.ti 0
-.li
-.tc|c  no      space   Tab replacement character becomes `c'.
-.ti 0
-.li
-.ti|+n yes     \-      Temporarily indent next output
-line n spaces.
-.ti0
-.li
-.tr|cdef..     no      \-      Translate c into d, e into f, etc.
-.ti0
-.li
-.ul|n  no      \-      Underline the letters and numbers
-in the next n input lines.
-.br
-.tr ||
diff --git a/.ref-Research-V7/usr/man/man1/sa.1m b/.ref-Research-V7/usr/man/man1/sa.1m
deleted file mode 100644 (file)
index 33bc88f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-.TH SA 1M 
-.SH NAME
-sa, accton \- system accounting
-.SH SYNOPSIS
-.B sa
-[
-.B \-abcjlnrstuv
-] [ file ]
-.PP
-.B /etc/accton 
-[ file ]
-.SH DESCRIPTION
-With an argument naming an existing
-.I file,
-.I accton
-causes system accounting information for
-every process executed to be placed at the end of the file.
-If no arguemnt is given, accounting is turned off.
-.PP
-.I Sa
-reports on, cleans up, and generally maintains
-accounting files.
-.PP
-.I Sa
-is able to condense
-the information in
-.I /usr/adm/acct
-into a summary file
-.I /usr/adm/savacct
-which contains a count of the
-number of times each command was called and the time resources
-consumed.
-This condensation is desirable because on a large system
-.I acct
-can grow by 100 blocks per day.
-The summary file is read before the accounting file,
-so the reports include all available information.
-.PP
-If a file name is given as the last argument,
-that file will be treated
-as the accounting file;
-.I sha
-is the default.
-There are zillions of options:
-.PP
-.TP
-a
-Place all command names containing unprintable characters
-and those used only once under the name `***other.'
-.TP
-b
-Sort output by sum of user and system time divided by number of
-calls.
-Default sort is by sum of user and system times.
-.TP
-c
-Besides total user, system, and real time for each command print percentage
-of total time over all commands.
-.TP
-j
-Instead of total minutes time for each category,
-give seconds per call.
-.TP
-l
-Separate system and user time; normally they are combined.
-.TP
-m
-Print number of processes and number of CPU minutes for each user.
-.TP
-n
-Sort by number of calls.
-.TP
-r
-Reverse order of sort.
-.TP
-s
-Merge accounting file into summary file
-.I /usr/adm/savacct
-when done.
-.TP
-t
-For each command report ratio of real time to the sum of user and
-system times.
-.TP
-u
-Superseding all other flags,
-print for each command in the accounting file the
-user ID and command name.
-.TP
-v
-If the next character is a digit
-.I n,
-then type the name of
-each command used
-.I n
-times or fewer.
-Await a reply from the typewriter;
-if it begins with `y', add the command to
-the category `**junk**.'
-This is used to strip out garbage.
-.dt
-.SH FILES
-/usr/adm/acct  raw accounting
-.br
-/usr/adm/savacct       summary
-.br
-/usr/adm/usracct       per-user summary
-.SH "SEE ALSO"
-ac(1), acct(2)
diff --git a/.ref-Research-V7/usr/man/man1/sed.1 b/.ref-Research-V7/usr/man/man1/sed.1
deleted file mode 100644 (file)
index 673893e..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-.TH SED 1 
-.SH NAME
-sed \- stream editor
-.SH SYNOPSIS
-.B sed
-[
-.B \-n
-]
-[
-.B \-e
-script ] [
-.B \-f
-sfile ] [ file ] ...
-.SH DESCRIPTION
-.I Sed
-copies the named
-.I files
-(standard input default) to the standard output,
-edited according to a script of commands.
-The
-.B \-f
-option causes the script to be taken from file
-.IR sfile ;
-these options accumulate.
-If there is just one
-.B \-e
-option and no
-.BR \-f 's,
-the flag
-.B \-e
-may be omitted.
-The
-.B \-n
-option suppresses the default output.
-.PP
-A script consists of editing commands, one per line,
-of the following form:
-.IP
-[address [, address] ] function [arguments]
-.PP
-In normal operation
-.I sed
-cyclically copies a line of input into a
-.I pattern space
-(unless there is something left after
-a `D' command),
-applies in sequence
-all commands whose
-.I addresses
-select that pattern space,
-and at the end of the script copies the pattern space
-to the standard output (except under
-.BR \-n )
-and deletes the pattern space.
-.PP
-An
-.I address
-is either a decimal number that counts
-input lines cumulatively across files, a `$' that
-addresses the last line of input, or a context address,
-`/regular expression/', in the style of
-.IR ed (1)
-modified thus:
-.IP
-The escape sequence `\en' matches a
-newline embedded in the pattern space.
-.PP
-A command line with no addresses selects every pattern space.
-.PP
-A command line with
-one address selects each pattern space that matches the address.
-.PP
-A command line with
-two addresses selects the inclusive range from the first
-pattern space that matches the first address through
-the next pattern space that matches 
-the second.
-(If the second address is a number less than or equal
-to the line number first selected, only one
-line is selected.)
-Thereafter the process is repeated, looking again for the
-first address.
-.PP
-Editing commands can be applied only to non-selected pattern
-spaces by use of the negation function `!' (below).
-.PP
-In the following list of functions the 
-maximum number of permissible addresses
-for each function is indicated in parentheses.
-.PP
-An argument denoted
-.I text
-consists of one or more lines,
-all but the last of which end with `\e' to hide the
-newline.
-Backslashes in text are treated like backslashes
-in the replacement string of an `s' command,
-and may be used to protect initial blanks and tabs
-against the stripping that is done on
-every script line.
-.PP
-An argument denoted
-.I rfile
-or
-.I wfile
-must terminate the command
-line and must be preceded by exactly one blank.
-Each
-.I wfile
-is created before processing begins.
-There can be at most 10 distinct
-.I wfile
-arguments.
-.TP
-(1)\|a\e
-.br
-.ns
-.TP
-.I text
-.br
-Append.
-Place
-.I text
-on the output before
-reading the next input line.
-.TP
-.RI (2)\|b " label"
-Branch to the `:' command bearing the
-.IR label .
-If
-.I label
-is empty, branch to the end of the script.
-.TP
-(2)\|c\e
-.br
-.ns
-.TP
-.I text
-.br
-Change.
-Delete the pattern space.
-With 0 or 1 address or at the end of a 2-address range, place
-.I text
-on the output.
-Start the next cycle.
-.TP
-(2)\|d
-Delete the pattern space.
-Start the next cycle.
-.TP
-(2)\|D
-Delete the initial segment of the 
-pattern space through the first newline.
-Start the next cycle.
-.TP
-(2)\|g
-Replace the contents of the pattern space
-by the contents of the hold space.
-.TP
-(2)\|G
-Append the contents of the hold space to the pattern space.
-.TP
-(2)\|h
-Replace the contents of the hold space by the contents of the pattern space.
-.TP
-(2)\|H
-Append the contents of the pattern space to the hold space.
-.TP
-(1)\|i\e
-.br
-.ns
-.TP
-.I text
-Insert.
-Place
-.I text
-on the standard output.
-.TP
-(2)\|l
-List the pattern space on the standard output in an
-unambiguous form.
-Non-printing characters are spelled in two digit ascii,
-and long lines are folded.
-.TP
-(2)\|n
-Copy the pattern space to the standard output.
-Replace the pattern space with the next line of input.
-.TP
-(2)\|N
-Append the next line of input to the pattern space
-with an embedded newline.
-(The current line number changes.)
-.TP
-(2)\|p
-Print.
-Copy the pattern space to the standard output.
-.TP
-(2)\|P
-Copy the initial segment of the pattern space through
-the first newline to the standard output.
-.TP
-(1)\|q
-Quit.
-Branch to the end of the script.
-Do not start a new cycle.
-.TP
-.RI (2)\|r " rfile"
-Read the contents of
-.IR rfile .
-Place them on the output before reading
-the next input line.
-.TP
-.RI (2)\|s /regular\ expression/replacement/flags
-Substitute the
-.I replacement
-string for instances of the
-.I regular expression
-in the pattern space.
-Any character may be used instead of `/'.
-For a fuller description see
-.IR ed (1).
-.I Flags
-is zero or more of
-.RS
-.TP
-g
-Global.
-Substitute for all nonoverlapping instances of the
-.I regular expression
-rather than just the
-first one.
-.TP
-p
-Print the pattern space if a replacement was made.
-.TP
-.RI w " wfile"
-Write.
-Append the pattern space to
-.I wfile
-if a replacement
-was made.
-.RE
-.TP
-.RI (2)\|t " label"
-Test.
-Branch to the `:' command bearing the
-.I label
-if any
-substitutions have been made since the most recent
-reading of an input line or execution of a `t'.
-If 
-.I label
-is empty, branch to the end of the script.
-.TP
-.RI (2)\|w " wfile"
-Write.
-Append the pattern space to
-.IR wfile .
-.TP
-.RI (2)\|x
-Exchange the contents of the pattern and hold spaces.
-.TP
-.RI (2)\|y /string1/string2/
-Transform.
-Replace all occurrences of characters in
-.I string1
-with the corresponding character in
-.I string2.
-The lengths of
-.I
-string1
-and
-.I string2
-must be equal.
-.TP
-.RI (2)! " function"
-Don't.
-Apply the
-.I function
-(or group, if
-.I function
-is `{') only to lines
-.I not
-selected by the address(es).
-.TP
-.RI (0)\|: " label"
-This command does nothing; it bears a
-.I label
-for `b' and `t' commands to branch to.
-.TP
-(1)\|=
-Place the current line number on the standard output as a line.
-.TP
-(2)\|{
-Execute the following commands through a matching `}'
-only when the pattern space is selected.
-.TP
-(0)\|
-An empty command is ignored.
-.SH SEE ALSO
-ed(1), grep(1), awk(1)
diff --git a/.ref-Research-V7/usr/man/man1/sh.1 b/.ref-Research-V7/usr/man/man1/sh.1
deleted file mode 100644 (file)
index 50f8648..0000000
+++ /dev/null
@@ -1,991 +0,0 @@
-.ds OK [\|
-.ds CK \|]
-.ds LT \s-2<\s0
-.ds GT \s-2>\s0
-.ds LE \s-2<\s0
-.ds ST *
-.TH SH 1
-.SH NAME
-sh,
-for,
-case,
-if,
-while,
-.BR : ,
-.BR . ,
-break,
-continue,
-cd,
-eval,
-exec,
-exit,
-export,
-login,
-newgrp,
-read,
-readonly,
-set,
-shift,
-times,
-trap,
-umask,
-wait
-\- command language
-.SH SYNOPSIS
-.B sh
-[
-.B \-ceiknrstuvx
-] [ arg ] ...
-.SH DESCRIPTION
-.I Sh
-is a command programming language
-that executes commands read from a terminal
-or a file.
-See
-.B invocation
-for the meaning of arguments to the shell.
-.PP
-.B Commands.
-.br
-A
-.I simple-command
-is a sequence of non blank
-.I words
-separated by blanks (a blank is a
-.B tab
-or a
-.BR space ).
-The first word specifies the name of the command to
-be executed.
-Except as specified below
-the remaining words are passed as arguments
-to the invoked command.
-The command name is passed as argument 0
-(see
-.IR exec (2)).
-The
-.I value
-of a simple-command is its exit status
-if it terminates normally or 200+\fIstatus\fP if
-it terminates abnormally (see
-.IR signal (2)
-for a list of
-status values).
-.LP
-A
-.I pipeline
-is a sequence of one or more
-.I commands
-separated by
-.B \(or.
-The standard output of each command but the last
-is connected by a
-.IR pipe (2)
-to the standard input of the next command.
-Each command is run as a separate process;
-the shell waits for the last command to terminate.
-.LP
-A
-.I list
-is a sequence of one or more
-.I pipelines
-separated by
-.BR ; ,
-.BR & ,
-.B &&
-or
-.B \(or\|\(or
-and optionally terminated by
-.B ;
-or
-.BR & .
-.B ;
-and
-.B &
-have equal precedence
-which is lower than that of
-.B &&
-and
-.BR \(or\|\(or ,
-.B &&
-and
-.B \(or\|\(or
-also have equal precedence.
-A semicolon causes sequential execution; an ampersand causes
-the preceding
-.I pipeline
-to be executed without waiting for it to finish.
-The symbol
-.B &&
-.RB ( \(or\|\(or )
-causes the
-.I list
-following to be executed only if the preceding
-.I pipeline
-returns a zero (non zero) value.
-Newlines may appear in a
-.I list,
-instead of semicolons,
-to delimit commands.
-.LP
-A
-.I command
-is either a simple-command
-or one of the following.
-The value returned by a command is that of the
-last simple-command executed in the command.
-.TP
-\fBfor \fIname\fR \*(OK\fBin \fIword\fR ...\*(CK \fBdo \fIlist \fBdone\fR
-Each time a
-.B for
-command is executed
-.I name
-is set to the next word in the
-.B for
-word list
-If
-.BI in \ word
-\&...
-is omitted then
-.B
-in "$@"
-is assumed.
-Execution ends when there are no more words in the list.
-.TP
-\fBcase \fIword \fBin\fR \*(OK\fIpattern \fR\*(OK \fB\(or \fIpattern \fR\*(CK ... \fB) \fIlist \fB;;\fR\*(CK ... \fBesac\fR
-A
-.B case
-command executes the
-.I list
-associated with the first
-pattern that matches
-.I word.
-The form of the patterns is
-the same as that used for
-file name generation.
-.TP
-\fBif \fIlist \fBthen \fIlist\fR \*(OK\fBelif \fIlist \fBthen \fIlist\fR\*(CK ... \*(OK\fBelse \fIlist\fR\*(CK \fBfi\fR
-The
-.I list
-following
-.B if
-is executed and if it returns zero the
-.I list
-following
-.B then
-is executed.
-Otherwise, the
-.I list
-following
-.B elif
-is executed and if its value is zero
-the
-.I list
-following
-.B then
-is executed.
-Failing that the
-.B else
-.I list
-is executed.
-.TP
-\fBwhile \fIlist\fR \*(OK\fBdo \fIlist\fR\*(CK \fBdone\fR
-A
-.B while
-command repeatedly executes the
-.B while
-.I list
-and if its value is zero executes the
-.B do
-.I list;
-otherwise the loop terminates.
-The value returned by a
-.B while
-command is that
-of the last executed command in the
-.B do
-.I list.
-.B until
-may be used in place of
-.B while
-to negate
-the loop termination test.
-.TP
-.BI ( " list " )
-Execute
-.I list
-in a subshell.
-.TP
-.BI { " list " }
-.I list
-is simply executed.
-.LP
-The following words
-are only recognized as the first word of a command
-and when not quoted.
-.IP
-.B
-if then else elif fi case in esac for while until do done { }
-.PP
-.B Command substitution.
-.br
-The standard output from a command enclosed in
-a pair of grave accents
-.RB ( \`\|\` )
-may be used as part or all
-of a word;
-trailing newlines are removed.
-.PP
-.B Parameter substitution.
-.br
-The character
-.B $
-is used to introduce substitutable
-parameters.
-Positional parameters may be assigned values by
-.BR set .
-Variables may be set by writing
-.IP
-.IB name = value
-[
-.IB name = value
-] ...
-.TP
-$\fB\|{\fIparameter\fB\|}\fR
-A
-.I parameter
-is a sequence of letters, digits or underscores (a
-.IR name ),
-a digit,
-or any of the characters
-.B
-* @ # ? \- $ !\|.
-The value, if any, of the parameter is substituted.
-The braces are required only when
-.I parameter
-is followed by a letter, digit, or underscore
-that is not to be interpreted as part of its name.
-If
-.I parameter
-is a digit then it is a positional parameter.
-If
-.I parameter
-is
-.BR * " or" " @"
-then all the positional
-parameters, starting with
-.SM
-.BR $1 ,
-are substituted
-separated by spaces.
-.SM
-.B $0
-is set from argument zero when the shell
-is invoked.
-.TP
-$\fB\|{\fIparameter\|\-word\|\fB}\fR
-If
-.I parameter
-is set then substitute its value;
-otherwise substitute
-.I word.
-.TP
-$\fB\|{\fIparameter\|\(eq\|word\|\fB}\fR
-If
-.I parameter
-is not set then set it to
-.I word;
-the value of the parameter is then substituted.
-Positional parameters may not be assigned to
-in this way.
-.TP
-$\fB\|{\fIparameter\|?\|word\|\fB}\fR
-If
-.I parameter
-is set then substitute its value;
-otherwise, print
-.I word
-and exit from the shell.
-If
-.I word
-is omitted then a standard message is printed.
-.TP
-$\fB\|{\fIparameter\|\(plword\|\fB}\fR
-If
-.I parameter
-is set then substitute
-.I word;
-otherwise substitute nothing.
-.LP
-In the above
-.I word
-is not evaluated unless it is
-to be used as the substituted string.
-(So that, for example,
-echo ${d\-\`pwd\`}
-will only execute
-.I pwd
-if
-.I d
-is unset.)
-.LP
-The following
-.I parameters
-are automatically set by the shell.
-.RS
-.TP
-.B #
-The number of positional parameters in decimal.
-.PD 0
-.TP
-.B \-
-Options supplied to the shell on invocation or by
-.BR set .
-.TP
-.B ?
-The value returned by the last executed command
-in decimal.
-.TP
-.B $
-The process number of this shell.
-.TP
-.B !
-The process number of the last background command invoked.
-.PD
-.RE
-.LP
-The following
-.I parameters
-are used but not set by the shell.
-.RS
-.TP
-.B
-.SM HOME
-The default argument (home directory) for the
-.B cd
-command.
-.PD 0
-.TP
-.B
-.SM PATH
-The search path for commands (see
-.BR execution ).
-.TP
-.B
-.SM MAIL
-If this variable is set to the name of
-a mail file then the shell informs the user of
-the arrival of mail in the specified file.
-.SM
-.TP
-.B PS1
-Primary prompt string, by default `$ '.
-.TP
-.SM
-.B PS2
-Secondary prompt string, by default `> '.
-.TP
-.SM
-.B IFS
-Internal field separators,
-normally
-.BR space ,
-.BR tab ,
-and
-.BR newline .
-.PD
-.RE
-.PP
-.B Blank interpretation.
-.br
-After parameter and command substitution,
-any results of substitution are scanned for internal field separator
-characters (those found in
-.SM
-.BR $IFS \*S)
-and split into distinct arguments where such characters are found.
-Explicit null arguments ("" or \'\') are retained.
-Implicit null arguments
-(those resulting from
-.I parameters
-that have no values) are removed.
-.PP
-.B File name generation.
-.br
-Following substitution, each command word is scanned for
-the characters
-.BR * ,
-.B ?
-and
-.B \*(OK.
-If one of these characters appears
-then the word is regarded as a pattern.
-The word is replaced with alphabetically sorted file names that match the pattern.
-If no file name is found that matches the pattern then
-the word is left unchanged.
-The character
-.B .
-at the start of a file name
-or immediately following a
-.BR / ,
-and the character
-.BR / ,
-must be matched explicitly.
-.TP 
-.B \*(ST
-Matches any string, including the null string.
-.PD 0
-.TP 
-.B ?
-Matches any single character.
-.TP 
-.B \*(OK...\*(CK
-Matches any one of the characters
-enclosed.
-A pair of characters separated by
-.B \-
-matches any
-character lexically between the pair.
-.PD
-.PP
-.B Quoting.
-.br
-The following characters have a special meaning to the shell
-and cause termination of a word unless quoted.
-.LP
-       \fB;   &   (   )   \(or   \*(LT   \*(GT   newline   space   tab\fP
-.LP
-A character may be
-.I quoted
-by preceding
-it with a
-.B
-\\\|.
-.B \\\\newline
-is ignored.
-All characters enclosed between a pair of quote marks (\fB\'\|\'\fP),
-except a single quote,
-are quoted.
-Inside double quotes
-(\fB"\|"\fP)
-parameter and command substitution occurs and
-.B
-\\
-quotes the characters
-.B
-\\ \` "
-and
-.BR $ \|.
-.LP
-.B
-"$*"
-is equivalent to
-.SM
-.B
-"$1 $2 ..."
-whereas
-.br
-.B
-"$@"
-is equivalent to
-.SM
-.B
-"$1" "$2" ... .
-.PP
-.B Prompting.
-.br
-When used interactively,
-the shell prompts with the value of
-.SM
-PS1
-before reading a command.
-If at any time a newline is typed and further input is needed
-to complete a command then the secondary prompt
-.RB ( \s-2$PS2\s0 )
-is issued.
-.PP
-.B Input output.
-.br
-Before a command is executed its input and output
-may be redirected using a special notation interpreted by the shell.
-The following may appear anywhere in a simple-command
-or may precede or follow a
-.I command
-and are not passed on to the invoked command.
-Substitution occurs before
-.I word
-or
-.I digit
-is used.
-.TP
-\*(LT\fI\|word\fP
-Use file
-.I word
-as standard input (file descriptor 0).
-.PD
-.TP
-\*(GT\fI\|word\fP
-Use file
-.I word
-as standard output (file descriptor 1).
-If the file does not exist then it is created;
-otherwise it is truncated to zero length.
-.TP
-\*(GT\*(GT\fI\|word\fP
-Use file
-.I word
-as standard output.
-If the file exists then output is appended (by seeking to the end);
-otherwise the file is created.
-.TP
-\*(LT\*(LT\fI\|word\fP
-The shell input is read up to a line the same as
-.IR word ,
-or end of file.
-The resulting document becomes
-the standard input.
-If any character of
-.I word
-is quoted then no interpretation
-is placed upon the characters of the document;
-otherwise, parameter and command substitution occurs,
-.B
-\\newline
-is ignored,
-and
-.B
-\\
-is used to quote the characters
-.B
-\\ $ \`
-and the first character of
-.I word.
-.TP
-\*(LT\|&\|\fIdigit\fP
-The standard input is duplicated from file descriptor
-.I digit;
-see
-.IR dup (2).
-Similarly for the standard output using \*(GT\|.
-.TP
-\*(LT\|&\|\-
-The standard input is closed.
-Similarly for the standard output using \*(GT\|.
-.PD
-.LP
-If one of the above is preceded by a digit
-then the
-file descriptor created is that specified
-by the digit
-(instead of the default 0 or 1).
-For example,
-.LP
-       \&... 2\*(GT&1
-.LP
-creates file descriptor 2 to be a duplicate
-of file descriptor 1.
-.LP
-If a command is followed by
-.B &
-then the default standard input
-for the command
-is the empty file
-(/dev/null).
-Otherwise, the environment for the execution of a command contains the
-file descriptors of the invoking shell as modified by input
-output specifications.
-.PP
-.B Environment.
-.br
-The environment
-is a list of name-value pairs that is passed to
-an executed program in the same way as a normal argument list;
-see
-.IR exec (2)
-and
-.IR environ (5).
-The shell interacts with the environment in several ways.
-On invocation, the shell scans the environment
-and creates a
-.I parameter
-for each name found,
-giving it the corresponding value.
-Executed commands inherit the same environment.
-If the user modifies the values of these
-.I parameters
-or creates new ones,
-none of these affects the environment
-unless the
-.B export
-command is used to bind the shell's
-.I parameter
-to the environment.
-The environment seen by any executed command is thus composed
-of any unmodified name-value pairs originally inherited by the shell,
-plus any modifications or additions,
-all of which must be noted in
-.B export
-commands.
-.LP
-The environment for any
-.I simple-command
-may be augmented by prefixing it with one or more assignments to
-.I parameters.
-Thus these two lines are equivalent
-.IP
-TERM=450 cmd args
-.br
-(export TERM; TERM=450; cmd args)
-.LP
-If the
-.B \-k
-flag is set,
-.I all
-keyword arguments are placed in the environment,
-even if the occur after the command name.
-The following prints `a=b c' and `c':
-.nf
-echo a=b c
-set \-k
-echo a=b c
-.fi
-.PP
-.B Signals.
-.br
-The INTERRUPT and QUIT signals for an invoked
-command are ignored if the command is followed by
-.BR & ;
-otherwise signals have the values
-inherited by the shell from its parent.
-(But see also
-.BR trap. )
-.PP
-.B Execution.
-.br
-Each time a command is executed the above substitutions
-are carried out.
-Except for the `special commands' listed below a new
-process is created and
-an attempt is made to execute the command via an
-.IR exec (2).
-.LP
-The shell parameter
-.B
-.SM $PATH
-defines the search path for
-the directory containing the command.
-Each alternative directory name is separated by
-a colon
-.RB ( : ).
-The default path is
-.BR :/bin:/usr/bin .
-If the command name contains a / then the search path
-is not used.
-Otherwise, each directory in the path is
-searched for an executable file.
-If the file has execute permission but is not an
-.I a.out
-file,
-it is assumed to be a file containing shell commands.
-A subshell (i.e., a separate process) is spawned to read it.
-A parenthesized command is also executed in
-a subshell.
-.PP
-.B Special commands.
-.br
-The following commands are executed in the shell process
-and except where specified
-no input output redirection is permitted for such commands.
-.TP
-.B :
-No effect; the command does nothing.
-.PD 0
-.TP
-.BI . \ file
-Read and execute commands from
-.I file
-and return.
-The search path
-.B
-.SM $PATH
-is used to find the directory containing
-.IR file .
-.TP
-\fBbreak\fR \*(OK\fIn\fR\*(CK
-Exit from the enclosing
-.B for
-or
-.B while
-loop, if any.
-If
-.I n
-is specified then break
-.I n
-levels.
-.TP
-\fBcontinue\fR \*(OK\fIn\fR\*(CK
-Resume the next iteration of the enclosing
-.B for
-or
-.B while
-loop.
-If
-.I n
-is specified then resume at the
-.IR n -th
-enclosing loop.
-.TP
-\fBcd\fR \*(OK\fIarg\fR\*(CK
-Change the current directory to
-.I arg.
-The shell
-parameter
-.B
-.SM $HOME
-is the default
-.IR arg .
-.TP
-\fBeval\fR \*(OK\fIarg \fR...\*(CK
-The arguments are read as input
-to the shell
-and the resulting command(s) executed.
-.TP
-\fBexec\fR \*(OK\fIarg \fR...\*(CK
-The command specified by
-the arguments is executed in place of this shell
-without creating a new process.
-Input output arguments may appear and if no other
-arguments are given cause the shell input
-output to be modified.
-.TP
-\fBexit\fR \*(OK\fIn\fR\*(CK
-Causes a non interactive shell to exit
-with the exit status specified by
-.I n.
-If
-.I n
-is omitted then the exit status is that of the last command executed.
-(An end of file will also exit from the shell.)
-.TP
-\fBexport\fR \*(OK\fIname\fR ...\*(CK
-The given names are marked
-for automatic export to the
-.I environment
-of subsequently-executed commands.
-If no arguments are given then a list of
-exportable names is printed.
-.TP
-\fBlogin\fR \*(OK\fIarg\fR ...\*(CK
-Equivalent to `exec login arg ...'.
-.TP
-\fBnewgrp\fR \*(OK\fIarg \fR...\*(CK
-Equivalent to `exec newgrp arg ...'.
-.TP
-.BI read \ name\ ...
-One line is read from the standard input;
-successive words of the input are assigned to the
-variables
-.I name
-in order,
-with leftover words to the last variable.
-The return code is 0 unless the end-of-file is encountered.
-.TP
-\fBreadonly\fR \*(OK\fIname \fR...\*(CK
-The given names are marked readonly and
-the values of the these names may not be changed
-by subsequent assignment.
-If no arguments are given then a list
-of all readonly names is printed.
-.TP
-\fBset\fR \*(OK\fB\-eknptuvx\fR \*(OK\fIarg \fR...\*(CK\*(CK
-.RS
-.PD 0
-.TP 3m
-.B \-e
-If non interactive then exit immediately if a command fails.
-.TP
-.B \-k
-All keyword arguments are placed in the environment for a command,
-not just those that precede the command name.
-.TP
-.B \-n
-Read commands but do not execute them.
-.TP
-.B \-t
-Exit after reading and executing one command.
-.TP
-.B \-u
-Treat unset variables as an error when substituting.
-.TP
-.B \-v
-Print shell input lines as they are read.
-.TP
-.B \-x
-Print commands and their arguments as they are executed.
-.TP
-.B \-
-Turn off the
-.B \-x
-and
-.B \-v
-options.
-.PD
-.LP
-These flags can also be used upon invocation of the shell.
-The current set of flags may be found in
-.BR $\- .
-.LP
-Remaining arguments are positional
-parameters and are assigned, in order, to
-.SM
-.BR $1 ,
-.SM
-.BR $2 ,
-etc.
-If no arguments are given then the values
-of all names are printed.
-.RE
-.TP
-.B shift
-The positional parameters from
-.SM
-.BR $2 ...
-are renamed
-.SM
-.BR $1 ...
-.TP
-.B times
-Print the accumulated user and system times for
-processes run from the shell.
-.TP
-\fBtrap\fR \*(OK\fIarg\fR\*(CK \*(OK\fIn\fR\*(CK ...
-.I Arg
-is a command to be read and executed when the shell
-receives signal(s)
-.I n.
-(Note that
-.I arg
-is scanned once when
-the trap is set and once when the trap
-is taken.)
-Trap commands are executed in order of signal number.
-If
-.I arg
-is absent then all trap(s)
-.I n
-are reset
-to their original values.
-If
-.I arg
-is the null
-string then this signal is ignored by the shell and by invoked commands.
-If
-.I n
-is 0 then the command
-.I arg
-is executed
-on exit from the shell,
-otherwise upon receipt of signal
-.I n
-as numbered in
-.IR signal (2).
-.I Trap
-with no arguments prints a list
-of commands associated with each signal number.
-.TP
-\fBumask \fR[ \fInnn\fR ]
-The user file creation mask is set to
-the octal value
-.I nnn
-(see
-.IR umask (2)).
-If
-.I nnn
-is omitted, the current value of the mask is printed.
-.TP
-\fBwait\fP \*(OK\fIn\fP\*(CK
-Wait for the specified process and
-report its termination status.
-If
-.I n
-is not given then all currently active child processes are waited for.
-The return code from this command is that of
-the process waited for.
-.PD
-.LP
-.PP
-.B Invocation.
-.br
-If the first character of argument zero is
-.BR \- ,
-commands are read from
-.BR \s-2$HOME\s0/.\|profile ,
-if such a file exists.
-Commands are then read as described below.
-The following flags are interpreted by the shell
-when it is invoked.
-.PD 0
-.TP 11n
-.BI \-c \ string
-If the
-.B \-c
-flag is present then
-commands are read from
-.I string\|.
-.TP 11n
-.B \-s
-If the
-.B \-s
-flag is present or if no
-arguments remain
-then commands are read from the standard input.
-Shell output is written to
-file descriptor 2.
-.TP 11n
-.B \-i
-If the
-.B \-i
-flag is present or
-if the shell input and output are attached to a terminal (as told by
-.IR gtty )
-then this shell is
-.I interactive.
-In this case the terminate signal
-SIGTERM (see
-.IR signal (2))
-is ignored (so that `kill 0'
-does not kill an interactive shell) and the interrupt signal
-SIGINT is caught and ignored
-(so that
-.B wait
-is interruptable).
-In all cases SIGQUIT is ignored by the shell.
-.PD
-.LP
-The remaining flags and arguments are described under the
-.B set
-command.
-.SH FILES
-.RB $HOME/ . \^profile
-.br
-/tmp/sh*
-.br
-/dev/null
-.SH SEE ALSO
-test(1),
-exec(2),
-.SH DIAGNOSTICS
-Errors detected by the shell, such as syntax errors
-cause the shell
-to return a non zero exit status.
-If the shell is being used non interactively
-then execution of the shell file is abandoned.
-Otherwise, the shell returns the exit status of
-the last command executed (see also
-.BR exit ).
-.SH BUGS
-If \*(LT\*(LT is used to provide standard input to an asynchronous
-process invoked by &,
-the shell gets mixed up about naming the input document.
-A garbage file /tmp/sh* is created, and the shell complains about
-not being able to find the file by another name.
diff --git a/.ref-Research-V7/usr/man/man1/size.1 b/.ref-Research-V7/usr/man/man1/size.1
deleted file mode 100644 (file)
index a805978..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.TH SIZE 1 
-.SH NAME
-size \- size of an object file
-.SH SYNOPSIS
-.B size
-[ object ... ]
-.SH DESCRIPTION
-.I Size
-prints the (decimal) number of bytes
-required by the
-text, data, and bss
-portions, and their sum in octal and decimal,
-of each object-file argument.
-If no file is specified,
-.B a.out
-is used.
-.SH "SEE ALSO"
-a.out(5)
diff --git a/.ref-Research-V7/usr/man/man1/sleep.1 b/.ref-Research-V7/usr/man/man1/sleep.1
deleted file mode 100644 (file)
index 546ce20..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-.TH SLEEP 1 
-.SH NAME
-sleep \- suspend execution for an interval
-.SH SYNOPSIS
-.B sleep
-time
-.SH DESCRIPTION
-.I Sleep
-suspends execution for
-.I time
-seconds.
-It is used to execute a command
-after a certain amount of time as in:
-.PP
-       (sleep 105; command)&
-.PP
-or to execute a command every so often, as in:
-.PP
-       while true
-.br
-       do
-.br
-               command
-.br
-               sleep 37
-.br
-       done
-.SH "SEE ALSO"
-alarm(2), sleep(3)
-.SH BUGS
-.I Time
-must be less than 65536 seconds.
diff --git a/.ref-Research-V7/usr/man/man1/sort.1 b/.ref-Research-V7/usr/man/man1/sort.1
deleted file mode 100644 (file)
index ccc7c47..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-.TH SORT 1 
-.SH NAME
-sort \- sort or merge files
-.SH SYNOPSIS
-.B sort
-[
-.if t \fB\-mubdf\&inrt\fIx\fR
-.if n -mubdfinrt\b\b\b\b\b\b\b\b\b_________x
-]
-[ \fB+\fIpos1 \fR [ \fB\-\fIpos2 \fR]
-] ...
-[ 
-.B \-o 
-name ] [
-.B \-T
-directory ] [ name ] ...
-.SH DESCRIPTION
-.I Sort
-sorts
-lines of all the named files together
-and writes the result on
-the standard output.
-The name `\-' means
-the standard input.
-If no input files are named, the standard input is sorted.
-.PP
-The default sort key is an entire line.
-Default ordering is
-lexicographic by bytes in machine
-collating sequence.
-The ordering is affected globally by the following options,
-one or more of which may appear.
-.TP 5
-.B  b
-Ignore leading blanks (spaces and tabs) in field comparisons.
-.TP 5
-.B  d
-`Dictionary' order: only letters, digits and blanks
-are significant in comparisons.
-.TP 5
-.B  f
-Fold upper case
-letters onto lower case.
-.TP 5
-.B  i
-Ignore characters outside the ASCII range 040-0176
-in nonnumeric comparisons.
-.TP 5
-.B  n
-An initial numeric string,
-consisting of optional blanks, optional minus sign,
-and zero or more digits with optional decimal point,
-is sorted by arithmetic value.
-Option
-.B n
-implies option
-.B b.
-.TP 5
-.B  r
-Reverse the sense of comparisons.
-.TP 5
-.BI t x
-`Tab character' separating fields is
-.IR x .
-.PP
-The notation
-.BI + "pos1 " "\-\fIpos2"
-restricts a sort key to a field beginning at
-.I pos1
-and ending just before
-.IR pos2 .
-.I Pos1
-and
-.I pos2
-each have the form
-.IB m . n\fR,
-optionally followed by one or more of the flags
-.B bdf\&inr,
-where
-.I m
-tells a number of fields to skip from the beginning of the line and
-.I n
-tells a number of characters to skip further.
-If any flags are present they override all the global
-ordering options for this key.
-If the
-.B b
-option is in effect
-.I n
-is counted from the first nonblank in the field;
-.B b
-is attached independently to 
-.IR pos2 .
-A missing
-\&\fB.\fIn\fR
-means .0;
-a missing
-.BI \- pos2
-means the end of the line.
-Under the
-.BI \-t x
-option, fields are strings separated by
-.IR x ;
-otherwise fields are
-nonempty nonblank strings separated by blanks.
-.PP
-When there are multiple sort keys, later keys
-are compared only after all earlier keys
-compare equal.
-Lines that otherwise compare equal are ordered
-with all bytes significant.
-.PP
-These option arguments are also understood:
-.TP 5
-.B c
-Check that the input file is sorted according to the ordering rules;
-give no output unless the file is out of sort.
-.TP 5
-.B  m
-Merge only, the input files are already sorted.
-.TP 5
-.B  o
-The next argument is the name of an output file
-to use instead of the standard output.
-This file may be the same as one of the inputs.
-.TP 5
-.B T
-The next argument is the name of a directory in which temporary files
-should be made.
-.TP 5
-.B  u
-Suppress all but one in each
-set of equal lines.
-Ignored bytes
-and bytes outside keys
-do not participate in
-this comparison.
-.PP
-.B Examples.
-Print in alphabetical order all the unique spellings
-in a list of words.
-Capitalized words differ from uncapitalized.
-.PP
-.ti +8
-sort \-u +0f +0 list
-.PP
-Print the password file
-.RI ( passwd (5))
-sorted by user id number (the 3rd colon-separated field).
-.PP
-.ti +8
-sort \-t: +2n /etc/passwd
-.PP
-Print the first instance of each month in an already sorted file
-of (month day) entries.
-The options
-.B \-um
-with just one input file make the choice of a
-unique representative from a set of equal lines predictable.
-.PP
-.ti +8
-sort \-um +0 \-1 dates
-.SH FILES
-/usr/tmp/stm*, /tmp/*: first and second tries for
-temporary files
-.SH "SEE ALSO"
-uniq(1),
-comm(1),
-rev(1),
-join(1)
-.SH DIAGNOSTICS
-Comments and exits with nonzero status for various trouble
-conditions and for disorder discovered under option
-.BR \-c .
-.SH BUGS
-Very long lines are silently truncated.
diff --git a/.ref-Research-V7/usr/man/man1/spell.1 b/.ref-Research-V7/usr/man/man1/spell.1
deleted file mode 100644 (file)
index ac58569..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-.TH SPELL 1 
-.SH NAME
-spell, spellin, spellout \- find spelling errors
-.SH SYNOPSIS
-.B spell
-[ option ] ...
-[ file ] ...
-.PP
-.B /usr/src/cmd/spell/spellin
-[ list ]
-.PP
-.B /usr/src/cmd/spell/spellout
-[
-.B \-d
-] list
-.SH DESCRIPTION
-.I Spell
-collects words from the named documents,
-and looks them up in a spelling list.
-Words that neither occur among nor are derivable
-(by applying certain inflections,
-prefixes or suffixes) from words in the spelling list
-are printed on the standard output.
-If no files are named,
-words are collected from the standard input.
-.PP
-.I Spell
-ignores most
-.I troff,
-.I tbl
-and
-.IR  eqn (1)
-constructions.
-.PP
-Under the
-.B \-v
-option, all words not literally in the spelling list are printed,
-and plausible derivations from spelling list words are indicated.
-.PP
-Under the 
-.B \-b
-option, British spelling is checked.
-Besides preferring
-.ft I
-centre, colour, speciality, travelled,
-.ft R
-etc.,
-this option insists upon
-.I -ise
-in words like
-.I standardise,
-Fowler and the OED to the contrary
-notwithstanding.
-.PP
-Under the 
-.B \-x
-option, every plausible stem is printed with `=' for each word.
-.PP
-The spelling list is based on many sources,
-and while more haphazard than an ordinary
-dictionary, is also more effective in respect to
-proper names and popular technical words.
-Coverage of
-the specialized vocabularies of biology,
-medicine and chemistry is light.
-.PP
-Pertinent auxiliary files may be specified by
-name arguments, indicated below with their
-default settings.
-Copies of all output
-are accumulated in the history file.
-The stop list filters out misspellings (e.g. thier=thy\-y+ier)
-that would otherwise pass.
-.PP
-Two routines help maintain the hash lists used by
-.I spell.
-Both expect a list of words, one per line,
-from the standard input.
-.I Spellin
-adds the words on the standard input to the
-preexisting
-.I list
-and places a new list on the standard output.
-If no 
-.I list
-is specified, the new list is created from scratch.
-.I Spellout
-looks up each word in the standard input and prints
-on the standard output
-those that are missing from (or present on, with
-option
-.BR \-d )
-the hash list.
-.SH FILES
-D=/usr/dict/hlist[ab]: hashed spelling lists, American & British
-.br
-S=/usr/dict/hstop: hashed stop list
-.br
-H=/usr/dict/spellhist: history file
-.br
-/usr/lib/spell
-.br
-deroff(1), sort(1), tee(1), sed(1)
-.SH BUGS
-The spelling list's coverage is uneven;
-new installations will probably wish to 
-monitor the output for several months to gather
-local additions.
-.br
-British spelling was done by an American.
diff --git a/.ref-Research-V7/usr/man/man1/spline.1g b/.ref-Research-V7/usr/man/man1/spline.1g
deleted file mode 100644 (file)
index 4b0de58..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-.TH SPLINE 1G 
-.SH NAME
-spline \- interpolate smooth curve
-.SH SYNOPSIS
-.B spline
-[ option ] ...
-.SH DESCRIPTION
-.I Spline
-takes pairs of numbers from the standard input as abcissas and ordinates
-of a function.
-It produces a similar set, which
-is approximately equally spaced and
-includes the input set, on the standard output.
-The cubic spline output
-(R. W. Hamming,
-.ft I
-Numerical Methods for Scientists and Engineers,
-.ft R
-2nd ed., 349ff)
-has two continuous derivatives,
-and sufficiently many points to look smooth when plotted, for
-example by
-.IR  graph (1).
-.PP
-The following options are recognized,
-each as a separate argument.
-.TP 5
-.B  \-a
-Supply abscissas automatically (they are missing from
-the input); spacing is given by the next
-argument, or is assumed to be 1 if next argument is not a number.
-.TP 5
-.B  \-k
-The constant
-.IR k ""
-used in the boundary value computation
-.IP
-.if n .ig
-.ti +1.5i
-.ds ' \h'-\w'\(fm\(fm'u'
-.EQ
-.nr 99 \n(.s
-.nr 98 \n(.f
-'ps 10
-.ft I
-.ds 11 "y\(fm\(fm
-.nr 11 \w'\*(11'
-.ds 12 "\*'
-.nr 12 \w'\*(12'
-'ps 8
-.ds 13 "\fR0\fP
-.nr 13 \w'\*(13'
-.as 12 \v'18u'\s8\*(13\|\s10\v'-18u'
-'ps 10
-.nr 12 \n(12+\n(13+\w'\s8\|'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|=\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "ky\(fm\(fm
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\*'
-.nr 12 \w'\*(12'
-'ps 8
-.ds 13 "\fR1\fP
-.nr 13 \w'\*(13'
-.as 12 \v'18u'\s8\*(13\|\s10\v'-18u'
-'ps 10
-.nr 12 \n(12+\n(13+\w'\s8\|'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 ",
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "y\(fm\(fm
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\*'
-.nr 12 \w'\*(12'
-'ps 8
-.ds 13 "n
-.nr 13 \w'\*(13'
-.as 12 \v'18u'\s8\*(13\|\s10\v'-18u'
-'ps 10
-.nr 12 \n(12+\n(13+\w'\s8\|'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|=\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\|\|
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "ky\(fm\(fm
-.nr 12 \w'\*(12'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 12 "\*'
-.nr 12 \w'\*(12'
-'ps 8
-.ds 13 "n\|\(mi\|\fR1\fP
-.nr 13 \w'\*(13'
-.as 12 \v'18u'\s8\*(13\|\s10\v'-18u'
-'ps 10
-.nr 12 \n(12+\n(13+\w'\s8\|'
-.as 11 "\*(12
-.nr 11 \w'\*(11'
-.ds 11 \x'0'\fI\*(11\s\n(99\f\n(98
-.ne 78u
-\*(11
-'ps \n(99
-.ft \n(98
-.EN
-..
-.if t .ig
-.ce
-(2nd deriv. at end) = k*(2nd deriv. next to end)
-..
-.IP
-.br
-is set by the next argument.
-By default
-.IR k ""
-= 0.
-.TP 5
-.B  \-n
-Space output points
-so that approximately
-.I n
-intervals occur between the lower and upper
-.I x
-limits.
-(Default
-.I n
-= 100.)
-.TP 5
-.B  \-p
-Make output periodic, i.e. match
-derivatives at ends.
-First and last input values should normally agree.
-.TP 5
-.B  \-x
-Next 
-1 (or 2) arguments are lower (and upper) 
-.I x
-limits.
-Normally these limits are calculated from the data.
-Automatic abcissas start at lower limit
-(default 0).
-.SH "SEE ALSO"
-graph(1)
-.SH DIAGNOSTICS
-When data is not strictly monotone in
-.I x,
-.I spline
-reproduces the input without interpolating extra points.
-.SH BUGS
-A limit of 1000 input points is enforced silently.
diff --git a/.ref-Research-V7/usr/man/man1/split.1 b/.ref-Research-V7/usr/man/man1/split.1
deleted file mode 100644 (file)
index 0e5c682..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH SPLIT 1 
-.SH NAME
-split \- split a file into pieces
-.SH SYNOPSIS
-.B split
-[
-.B \-\fIn
-]
-[ file [ name ] ]
-.SH DESCRIPTION
-.I Split
-reads
-.I file
-and writes
-it in
-.IR n -line
-pieces
-(default 1000), as many as necessary,
-onto
-a set of output files.  The name of the first output
-file is
-.I name
-with
-.B aa
-appended, and so on
-lexicographically.
-If no output name is given,
-.B x
-is default.
-.PP
-If no input file is given, or
-if
-.B \-
-is given in its stead,
-then the standard input file is used.
diff --git a/.ref-Research-V7/usr/man/man1/strip.1 b/.ref-Research-V7/usr/man/man1/strip.1
deleted file mode 100644 (file)
index 7e189d5..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-.TH STRIP 1 
-.SH NAME
-strip  \-  remove symbols and relocation bits
-.SH SYNOPSIS
-.B strip
-name ...
-.SH DESCRIPTION
-.I Strip
-removes the symbol
-table and relocation bits ordinarily attached to the output
-of the assembler and loader.
-This is useful to save space after a program has been
-debugged.
-.PP
-The effect of
-.I strip
-is the same as use of the
-.B \-s
-option
-of
-.IR ld .
-.SH FILES
-/tmp/stm?      temporary file
-.SH "SEE ALSO"
-ld(1)
diff --git a/.ref-Research-V7/usr/man/man1/struct.1 b/.ref-Research-V7/usr/man/man1/struct.1
deleted file mode 100644 (file)
index aaa0c8b..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-.TH STRUCT 1 
-.SH NAME
-struct \- structure Fortran programs
-.SH SYNOPSIS
-.B struct
-[ option ] ...
-file
-.SH DESCRIPTION
-.LP
-.I Struct
-translates the Fortran program specified by
-.I file
-(standard input default)
-into a Ratfor program.
-Wherever possible, Ratfor control constructs
-replace the original Fortran.
-Statement numbers appear only where still necessary.
-Cosmetic changes are made, including changing Hollerith strings
-into quoted strings
-and relational operators into symbols (.e.g. `.GT.' into `>').
-The output is appropriately indented.
-.PP
-The following options may occur in any order.
-.TP
-.B  \-s
-Input is accepted in standard format, i.e.
-comments are specified by a c, C, or * in column 1, and continuation lines
-are specified by a nonzero, nonblank character in column 6.
-Normally, a statement whose first nonblank character
-is not alphanumeric is treated as a continuation.
-.TP
-.B  \-i
-Do not turn computed goto statements into
-switches.
-(Ratfor does not turn switches back
-into computed goto statements.)
-.TP
-.B  \-a
-Turn sequences of else ifs into a
-non-Ratfor switch of the form
-.IP
-.nf
-.ta 5 7
-switch {
-               case pred1: code
-               case pred2: code
-               case pred3: code
-               default: code
-       }
-.fi
-.DT
-.IP
-The case predicates are tested in order;
-the code appropriate to only one case is executed.
-This generalized form of switch statement does not
-occur in Ratfor.
-.TP
-.B  \-b
-Generate goto's instead of multilevel break statements.
-.TP
-.B  \-n
-Generate goto's instead of multilevel next statements.
-.TP
-.TP
-.BI \-e n
-If 
-.I n
-is 0 (default),
-place code within a loop only if it can
-lead to an iteration of the loop.
-If
-.I n
-is nonzero,
-admit code segments with fewer than
-.I n
-statements to a loop
-if otherwise the loop would have exits to several places including the segment,
-and the segment can be reached only from the loop.
-.SH FILES
-/tmp/struct*
-.br
-/usr/lib/struct/*
-.SH SEE ALSO
-f77(1)
-.SH BUGS
-Struct knows Fortran 66 syntax, but not full Fortran 77
-(alternate returns, IF...THEN...ELSE, etc.)
-.br
-If an input Fortran program contains identifiers which
-are reserved words in Ratfor, the structured
-version of the program
-will not be a valid Ratfor program.
-.br
-Extended range DO's generate cryptic errors.
-.br
-Columns 73-80 are not special even when
-.B \-s
-is in effect.
-.br
-Will not generate Ratfor FOR statements.
diff --git a/.ref-Research-V7/usr/man/man1/stty.1 b/.ref-Research-V7/usr/man/man1/stty.1
deleted file mode 100644 (file)
index 769ebb1..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-.TH STTY 1 
-.SH NAME
-stty \- set terminal options
-.SH SYNOPSIS
-.B stty
-[ option ... ]
-.SH DESCRIPTION
-.I Stty
-sets certain I/O options on the current output terminal.
-With no argument, it reports the current settings of the options.
-The option strings are
-selected from the following set:
-.TP  8n
-.B even 
-allow even parity
-.br
-.ns
-.TP 
-.B \-even 
-disallow even parity
-.br
-.ns
-.TP 
-.B odd 
-allow odd parity
-.br
-.ns
-.TP 
-.B \-odd 
-disallow odd parity
-.br
-.ns
-.TP 
-.B raw 
-raw mode input
-(no erase, kill, interrupt, quit, EOT; parity bit passed back)
-.br
-.ns
-.TP 
-.B \-raw 
-negate raw mode
-.br
-.ns
-.TP 
-.B cooked 
-same as `\-raw'
-.br
-.ns
-.TP
-.B cbreak
-make each character available to
-.IR read (2)
-as received; no erase and kill
-.br
-.ns
-.TP
-.B \-cbreak
-make characters available to 
-.I read
-only when newline is received
-.br
-.ns
-.TP 
-.B \-nl 
-allow carriage return for new-line,
-and output CR-LF for carriage return or new-line
-.br
-.ns
-.TP 
-.B nl 
-accept only new-line to end lines
-.br
-.ns
-.TP 
-.B echo 
-echo back every character typed
-.br
-.ns
-.TP 
-.B \-echo 
-do not echo characters
-.br
-.ns
-.TP 
-.B lcase 
-map upper case to lower case
-.br
-.ns
-.TP 
-.B \-lcase 
-do not map case
-.br
-.ns
-.TP 
-.B \-tabs 
-replace tabs by spaces when printing
-.br
-.ns
-.TP 
-.B tabs 
-preserve tabs
-.br
-.ns
-.TP 
-.B ek 
-reset erase and kill characters back to normal # and @
-.br
-.ns
-.TP 
-.BI erase  \ c\fR
-set erase character to
-.IR c .
-.I C
-can be of the form 
-.I `^X'
-which is interpreted as a `control X'.
-.br
-.ns
-.TP 
-.BI kill  \ c\fR
-set kill character to
-.IR c .
-.I `^X'
-works here also.
-.br
-.ns
-.TP
-.B  cr0 cr1 cr2 cr3
-.br
-select style of delay for carriage return (see
-.IR ioctl (2))
-.br
-.ns
-.TP
-.B  nl0 nl1 nl2 nl3
-.br
-select style of delay for linefeed 
-.br
-.ns
-.TP
-.B  tab0 tab1 tab2 tab3
-.br
-select style of delay for tab 
-.br
-.ns
-.TP
-.B  ff0 ff1
-select style of delay for form feed 
-.br
-.ns
-.TP
-.B bs0 bs1
-select style of delay for backspace
-.br
-.ns
-.TP 
-.B tty33 
-set all modes suitable for the
-Teletype Corporation Model 33 terminal.
-.br
-.ns
-.TP 
-.B tty37 
-set all modes suitable for the
-Teletype Corporation Model 37 terminal.
-.br
-.ns
-.TP 
-.B vt05 
-set all modes suitable for Digital Equipment Corp. VT05 terminal
-.br
-.ns
-.TP 
-.B tn300 
-set all modes suitable for a General Electric TermiNet 300
-.br
-.ns
-.TP 
-.B ti700 
-set all modes suitable for Texas Instruments 700 series terminal
-.br
-.ns
-.TP 
-.B tek 
-set all modes suitable for Tektronix 4014 terminal
-.br
-.ns
-.TP 
-.B hup 
-hang up dataphone on last close.
-.br
-.ns
-.TP 
-.B \-hup 
-do not hang up dataphone on last close.
-.br
-.ns
-.TP 
-.B 0 
-hang up phone line immediately
-.br
-.ns
-.TP
-.B  "50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 exta extb"
-.br
-Set terminal baud rate to the number given, if possible.
-(These are the speeds supported by the DH-11 interface).
-.dt
-.SH "SEE ALSO"
-ioctl(2), tabs(1)
diff --git a/.ref-Research-V7/usr/man/man1/su.1 b/.ref-Research-V7/usr/man/man1/su.1
deleted file mode 100644 (file)
index 14646aa..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-.TH SU 1 
-.SH NAME
-su  \-  substitute user id temporarily
-.SH SYNOPSIS
-.B su
-[ userid ]
-.SH DESCRIPTION
-.I Su
-demands the password of the specified
-.I userid,
-and if it is given,
-changes to that 
-.I userid
-and invokes the Shell
-.IR sh (1)
-without changing the current directory or the
-user environment (see
-.IR environ (5)).
-The new user ID stays in force until the Shell exits.
-.PP
-If no 
-.I userid
-is specified, `root' is assumed.
-To remind the super-user of his responsibilities,
-the Shell substitutes `#' for its usual prompt.
-.SH "SEE ALSO"
-sh(1)
diff --git a/.ref-Research-V7/usr/man/man1/sum.1 b/.ref-Research-V7/usr/man/man1/sum.1
deleted file mode 100644 (file)
index 58182c3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-.TH SUM 1 
-.SH NAME
-sum \- sum and count blocks in a file
-.SH SYNOPSIS
-.B sum
-file
-.SH DESCRIPTION
-.I Sum
-calculates and prints a 16-bit checksum for the named file,
-and also prints the number of blocks in the file.
-It is typically used to look for bad spots, or
-to validate a file communicated over
-some transmission line.
-.SH "SEE ALSO"
-wc(1)
-.SH DIAGNOSTICS
-`Read error'
-is indistinuishable from end of file on
-most devices; check the block count.
diff --git a/.ref-Research-V7/usr/man/man1/sync.1m b/.ref-Research-V7/usr/man/man1/sync.1m
deleted file mode 100644 (file)
index 350b4a7..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-.TH SYNC 1M 
-.SH NAME
-sync \- update the super block
-.SH SYNOPSIS
-.B sync
-.SH DESCRIPTION
-.I Sync
-executes the
-.I sync
-system primitive.
-If the system is to be stopped,
-.I sync
-must be called to insure
-file system integrity.
-See
-.IR sync (2)
-for details.
-.SH "SEE ALSO"
-sync(2), update(8)
diff --git a/.ref-Research-V7/usr/man/man1/tabs.1 b/.ref-Research-V7/usr/man/man1/tabs.1
deleted file mode 100644 (file)
index e5f63f7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH TABS 1 
-.SH NAME
-tabs \- set terminal tabs
-.SH SYNOPSIS
-.B tabs
-[
-.B \-n
-] [
-terminal
-]
-.SH DESCRIPTION
-.I Tabs
-sets the tabs on a variety of terminals.
-Various of the terminal names given in
-.IR term (7)
-are recognized;
-the default is, however, suitable for most 300
-baud terminals.
-If the
-.B \-n
-flag is present then the left
-margin is not indented as is normal.
-.SH SEE ALSO
-stty(1), term(7)
diff --git a/.ref-Research-V7/usr/man/man1/tail.1 b/.ref-Research-V7/usr/man/man1/tail.1
deleted file mode 100644 (file)
index 82edce4..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH TAIL 1 
-.SH NAME
-tail \- deliver the last part of a file
-.SH SYNOPSIS
-.B tail
-.if t [ \(+-number[\fBlbc\fR] ]
-.if n +\b_number[lbc\b\b\b___]
-[ file ]
-.SH DESCRIPTION
-.I Tail
-copies the named file to the standard output beginning
-at a designated place.
-If no file is named, the standard input is used.
-.PP
-Copying begins at distance
-.I +number
-from the beginning, or
-.I \-number
-from the end of the input.
-.I Number
-is counted in units of lines, blocks or characters,
-according to the appended option
-.B l,
-.B b
-or
-.B c.
-When no units are specified, counting is by lines.
-.SH "SEE ALSO"
-dd(1)
-.SH BUGS
-Tails relative to the end of the file
-are treasured up in a buffer, and thus 
-are limited in length.
-Various kinds of anomalous behavior may happen
-with character special files.
diff --git a/.ref-Research-V7/usr/man/man1/tar.1 b/.ref-Research-V7/usr/man/man1/tar.1
deleted file mode 100644 (file)
index cae6821..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-.TH TAR 1 
-.SH NAME
-tar  \-  tape archiver
-.SH SYNOPSIS
-.B tar
-[ key ] [ name ... ]
-.SH DESCRIPTION
-.I Tar
-saves and restores files
-on magtape.
-Its actions are controlled by the
-.I key
-argument.
-The
-.I key
-is a string of characters containing
-at most one function letter and possibly
-one or more function modifiers.
-Other arguments to the command are file or directory
-names specifying which files are to be dumped or restored.
-In all cases, appearance of a directory name refers to
-the files and (recursively) subdirectories of that directory.
-.PP
-The function portion of
-the key is specified by one of the following letters:
-.TP 8
-.B  r
-The named files
-are written
-on the end of the tape.
-The
-.B c
-function implies this.
-.TP 8
-.B  x
-The named files are extracted from the tape.
-If the named file matches a directory whose contents 
-had been written onto the tape, this directory is (recursively) extracted.
-The owner, modification time, and mode are restored (if possible).
-If no file argument is given, the entire content of the
-tape is extracted.
-Note that if multiple entries specifying the same file
-are on the tape, the last one overwrites
-all earlier.
-.TP 8
-.B  t
-The names of the specified files are listed each time they occur
-on the tape.
-If no file argument is given,
-all of the names on the tape are listed.
-.TP 8
-.B  u
-The named files are added to the tape if either they
-are not already there or have
-been modified since last put on the tape.
-.TP 8
-.B  c
-Create a new tape; writing begins on the beginning
-of the tape instead of after the last file.
-This command implies
-.B r.
-.PP
-The following characters may be used in addition to the letter
-which selects the function desired.
-.TP 10
-.B  0,...,7
-This
-modifier selects the drive on which the tape is mounted.
-The default is
-.BR 1 .
-.TP 10
-.B  v
-Normally
-.I tar
-does its work silently.
-The
-.B v
-(verbose)
-option causes it to type the name of each file it treats
-preceded by the function letter.
-With the
-.B t
-function,
-.B v
-gives more information about the
-tape entries than just the name.
-.TP 10
-.B  w
-causes
-.I tar
-to print the action to be taken followed by file name, then
-wait for user confirmation. If a word beginning with `y'
-is given, the action is performed. Any other input means
-don't do it.
-.TP 10
-.B f
-causes 
-.I tar
-to use the next argument as the name of the archive instead
-of /dev/mt?. 
-If the name of the file is `\-', tar writes to
-standard output or reads from standard input, whichever is
-appropriate. Thus,
-.I tar
-can be used as the head or tail of a filter chain
-.I Tar
-can also be used to move hierarchies with the command
-.ce 1
-cd fromdir; tar cf - . | (cd todir; tar xf -)
-.TP 10
-.B b
-causes
-.I tar
-to use the next argument as the blocking factor for tape
-records. The default is 1, the maximum is 20. This option
-should only be used with raw magnetic tape archives (See
-.B f
-above).
-The block size is determined automatically when reading
-tapes (key letters `x' and `t').
-.TP 10
-.B l
-tells
-.I tar
-to complain if it cannot resolve all of the links
-to the files dumped. If this is not specified, no
-error messages are printed.
-.TP 10
-.B m
-tells
-.I tar
-to not restore the modification times.
-The mod time
-will be the time of extraction.
-.PP
-.SH FILES
-/dev/mt?
-.br
-/tmp/tar*
-.SH DIAGNOSTICS
-Complaints about bad key characters and tape read/write errors.
-.br
-Complaints if enough memory is not available to hold
-the link tables.
-.SH BUGS
-There is no way to ask for the
-.IR n -th
-occurrence of a file.
-.br
-Tape errors are handled ungracefully.
-.br
-The
-.B u
-option can be slow.
-.br
-The
-.B b
-option should not be used with archives that are
-going to be updated. The current magtape driver cannot
-backspace raw magtape.
-If the archive is on a disk file the 
-.B b
-option should not be used at all, as updating
-an archive stored in this manner can destroy it.
-.br
-The current limit on file name length is
-100 characters.
diff --git a/.ref-Research-V7/usr/man/man1/tbl.1 b/.ref-Research-V7/usr/man/man1/tbl.1
deleted file mode 100644 (file)
index a8b45b7..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-.TH TBL 1 
-.SH NAME
-tbl \- format tables for nroff or troff
-.SH SYNOPSIS
-.B tbl
-[ files ] ...
-.SH DESCRIPTION
-.I Tbl
-is a preprocessor for formatting tables for
-.I nroff
-or
-.IR troff (1).
-The input files are copied to the standard output,
-except for lines between .TS and .TE
-command lines, which are assumed to describe tables
-and reformatted.
-Details are given in the reference manual.
-.PP
-As an example, letting \\t represent a tab (which should
-be typed as a genuine tab)
-the input
-.IP ""
-\&.TS
-.nf
-c s s
-c c s
-c c c
-l n n.
-Household Population
-Town\\tHouseholds
-\\tNumber\\tSize
-Bedminster\\t789\\t3.26
-Bernards Twp.\\t3087\\t3.74
-Bernardsville\\t2018\\t3.30
-Bound Brook\\t3425\\t3.04
-Branchburg\\t1644\\t3.49
-Bridgewater\\t7897\\t3.81
-Far Hills\\t240\\t3.19
-\&.TE
-.LP
-.fi
-yields
-.ne 10
-.IP " "
-.TS
-.nr 35 \n(.u
-.nf
-.nr 79 0n
-.nr 80 \n(79
-.nr 40 \n(79
-.nr 38 \n(79+\w!Town!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Bedminster!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Bernards Twp.!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Bernardsville!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Bound Brook!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Branchburg!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Bridgewater!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 38 \n(79+\w!Far Hills!
-.if \n(80<\n(38 .nr 80 \n(38
-.nr 81 \n(80
-.nr 41 \n(80
-.nr 38 \n(80+\w!Number!
-.if \n(81<\n(38 .nr 81 \n(38
-.nr 31 0
-.nr 32 0
-.nr 38 \w!789!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3087!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!2018!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3425!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!1644!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!7897!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!240!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 61 \n(80+\n(31
-.nr 38 \n(61+\n(32
-.if \n(38>\n(81 .nr 81 \n(38
-.if \n(38<\n(81 .nr 61 +(\n(81-\n(38)/2
-.nr 82 \n(81
-.nr 42 \n(81
-.nr 38 \n(81+\w!Size!
-.if \n(82<\n(38 .nr 82 \n(38
-.nr 31 0
-.nr 32 0
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.26!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.74!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.30!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.04!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.49!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.81!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 38 \w!3!
-.if \n(31<\n(38 .nr 31 \n(38
-.nr 38 \w!.19!
-.if \n(32<\n(38 .nr 32 \n(38
-.nr 62 \n(81+\n(31
-.nr 38 \n(62+\n(32
-.if \n(38>\n(82 .nr 82 \n(38
-.if \n(38<\n(82 .nr 62 +(\n(82-\n(38)/2
-.nr 38 \n(79+\w!Household Population!-\n(82
-.if \n(38>0 .nr 38 \n(38/2
-.if \n(38<0 .nr 38 0
-.nr 61 +1*\n(38
-.nr 81 +1*\n(38
-.nr 41 +1*\n(38
-.nr 62 +2*\n(38
-.nr 82 +2*\n(38
-.nr 42 +2*\n(38
-.nr 38 \n(80+\w!Households!-\n(82
-.if \n(38>0 .nr 38 \n(38/1
-.if \n(38<0 .nr 38 0
-.nr 62 +1*\n(38
-.nr 82 +1*\n(38
-.nr 42 +1*\n(38
-.nr 38 1n
-.nr 41 +3*\n(38
-.nr 81 +3*\n(38
-.nr 61 +3*\n(38
-.if n .if \n(61%24>0 .nr 61 +12u
-.nr 42 +6*\n(38
-.nr 82 +6*\n(38
-.nr 62 +6*\n(38
-.if n .if \n(62%24>0 .nr 62 +12u
-.nr TW \n(82
-.fc ! :
-.ta \n(82u 
-\&!:Household Population:!
-.ta \n(80u \n(82u 
-\&\h'|\n(40u'!:Town:!\h'|\n(41u'!:Households:!
-.ta \n(80u \n(81u \n(82u 
-\&\h'|\n(40u'!::!\h'|\n(41u'!:Number:!\h'|\n(42u'!:Size:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Bedminster:!\h'|\n(41u'!:789!\h'|\n(42u'!:3!!.26:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Bernards Twp.:!\h'|\n(41u'!:3087!\h'|\n(42u'!:3!!.74:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Bernardsville:!\h'|\n(41u'!:2018!\h'|\n(42u'!:3!!.30:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Bound Brook:!\h'|\n(41u'!:3425!\h'|\n(42u'!:3!!.04:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Branchburg:!\h'|\n(41u'!:1644!\h'|\n(42u'!:3!!.49:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Bridgewater:!\h'|\n(41u'!:7897!\h'|\n(42u'!:3!!.81:!
-.ta \n(80u \n(61u \n(62u \n(82u 
-\&\h'|\n(40u'!Far Hills:!\h'|\n(41u'!:240!\h'|\n(42u'!:3!!.19:!
-.fc
-.mk ##
-.nr ## -1v
-.if \n(35>0 .fi
-.TE
-.fi
-.PP
-If no arguments are given,
-.I tbl
-reads the standard input,
-so it may be used as a filter.
-When it is used with
-.I eqn
-or
-.I neqn
-the
-.I tbl
-command should be first, to minimize the volume
-of data passed through
-pipes.
-.SH SEE ALSO
-troff(1), eqn(1)
-.br
-M. E. Lesk,
-.I TBL.
diff --git a/.ref-Research-V7/usr/man/man1/tc.1 b/.ref-Research-V7/usr/man/man1/tc.1
deleted file mode 100644 (file)
index e476140..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-.TH TC 1 
-.SH NAME
-tc \- photypesetter simulator
-.SH SYNOPSIS
-.B tc
-[
-.B \-t
-]
-[
-.B \-s\c
-N
-]
-[
-.B \-p\c
-L
-]
-[
-file
-]
-.SH DESCRIPTION
-.I Tc
-interprets its
-input (standard input default)
-as device codes for a Graphic Systems phototypesetter (cat).
-The standard output of
-.I tc
-is intended for a Tektronix 4015 (a 4014 teminal
-with ASCII and APL character sets).
-The sixteen typesetter sizes are mapped into the 4014's
-four sizes;
-the entire TROFF character set is drawn using the 4014's
-character generator,
-using overstruck combinations where necessary.
-Typical usage:
-.IP "" 15
-troff \-t file | tc
-.PP
-At the end of each page
-.I tc
-waits for a newline (empty line) from the keyboard before
-continuing on to the next page.
-In this wait state, the command
-.B e
-will suppress the screen erase before the next page;
-.B s\c
-N will cause the next N pages to be skipped;
-and
-.B !\c
-line will send line to the shell.
-.PP
-The command line options are:
-.TP
-.B  \-t
-Don't wait between pages; for directing output into a file.
-.TP 
-.BR \-s N
-Skip the first N pages.
-.TP 
-.BR \-p L
-Set page length to L.
-L may include the scale factors
-.B p
-(points),
-.B i
-(inches),
-.B c
-(centimeters),
-and
-.B P
-(picas);
-default is picas.
-.TP
-.BI \(fm\- l\ w \(fm
-Multiply the default aspect ratio, 1.5, of a displayed page
-by
-.I l/w.
-.SH "SEE ALSO"
-troff(1),
-plot(1)
-.SH BUGS
-Font distinctions are lost.
-.br
-The aspect ratio option is unbelievable.
diff --git a/.ref-Research-V7/usr/man/man1/tee.1 b/.ref-Research-V7/usr/man/man1/tee.1
deleted file mode 100644 (file)
index 609a4cb..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH TEE 1 
-.SH NAME
-tee \- pipe fitting
-.SH SYNOPSIS
-.B tee
-[
-.B \-i
-] [
-.B \-a
-]
-[ file ] ...
-.SH DESCRIPTION
-.I Tee
-transcribes the standard input to the standard
-output and makes copies in the 
-.I files.
-Option
-.B \-i
-ignores interrupts;
-option
-.B \-a
-causes the output to be appended to the
-.I files
-rather than overwriting them.
diff --git a/.ref-Research-V7/usr/man/man1/test.1 b/.ref-Research-V7/usr/man/man1/test.1
deleted file mode 100644 (file)
index c744041..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-.TH TEST 1 
-.SH NAME
-test \-  condition command
-.SH SYNOPSIS
-.B test
-expr
-.SH DESCRIPTION
-.I test
-evaluates the expression
-.IR expr ,
-and if its value is true then returns zero exit status; otherwise, a
-non zero exit status is returned.
-.I test
-returns a non zero exit if there are no arguments.
-.PP
-The following primitives are used to construct
-.IR expr .
-.TP 9n
-.BR \-r " file"
-true if the file exists and is readable.
-.TP 
-.BR \-w " file"
-true if the file exists and is writable.
-.TP 
-.BR \-f " file"
-true if the file exists and is not a directory.
-.TP 
-.BR \-d " file"
-true if the file exists and is a directory.
-.TP 
-.BR \-s " file"
-true if the file exists and has a size greater than zero.
-.TP 
-.BR \-t " [ fildes ]"
-true if the open file whose file descriptor number is
-.I fildes
-(1 by default)
-is associated with a terminal device.
-.TP 
-.BR \-z " s1"
-true if the length of string
-.I s1
-is zero.
-.TP 
-.BR \-n " s1"
-true if the length of the string
-.I s1
-is nonzero.
-.TP 
-.RB s1 " = " s2
-true
-if the strings
-.I s1
-and
-.I s2
-are equal.
-.TP 
-.RB s1 " != " s2
-true
-if the strings
-.I s1
-and
-.I s2
-are not equal.
-.TP 
-s1
-true if
-.I s1
-is not the null string.
-.TP 
-.RB n1 " \-eq " n2
-true if the integers
-.I n1
-and
-.I n2
-are algebraically equal.
-Any of the comparisons
-.BR \-ne ,
-.BR \-gt ,
-.BR \-ge ,
-.BR \-lt ,
-or
-.BR \-le
-may be used in place of
-.BR \-eq .
-.PP
-These primaries may be combined with the
-following operators:
-.TP 
-.B  !
-unary negation operator
-.TP 
-.B  \-a
-binary
-.I and
-operator
-.TP 
-.B  \-o
-binary
-.I or
-operator
-.TP 
-.BR "( " "expr" " )"
-parentheses for grouping.
-.PP
-.B \-a
-has higher precedence than
-.B \-o.
-Notice that all the operators and flags are separate
-arguments to
-.IR test .
-Notice also that parentheses are meaningful
-to the Shell and must be escaped.
-.SH "SEE ALSO"
-sh(1), find(1)
diff --git a/.ref-Research-V7/usr/man/man1/time.1 b/.ref-Research-V7/usr/man/man1/time.1
deleted file mode 100644 (file)
index 45135e9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH TIME 1 
-.SH NAME
-time \- time a command
-.SH SYNOPSIS
-.B time
-command
-.SH DESCRIPTION
-The
-given command is executed; after it is complete,
-.I time
-prints the elapsed time during the command, the time
-spent in the system, and the time spent in execution
-of the command.
-Times are reported in seconds.
-.PP
-The execution time can depend on what kind of memory
-the program happens to land in;
-the user time in MOS is often half what it is in core.
-.PP
-The times are printed on the diagnostic output stream.
-.SH BUGS
-Elapsed time is accurate to the second,
-while the CPU times are measured
-to the 60th second.
-Thus the sum of the CPU times can be up to a second larger
-than the elapsed time.
diff --git a/.ref-Research-V7/usr/man/man1/tk.1 b/.ref-Research-V7/usr/man/man1/tk.1
deleted file mode 100644 (file)
index d2ebd72..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-.TH TK 1 
-.SH NAME
-tk \- paginator for the Tektronix 4014
-.SH SYNOPSIS
-.B tk
-[
-.B \-t
-]
-[
-.B \-\c
-.I  N
-]
-[
-.B \-p\c
-.I  L
-]
-[
-file
-]
-.SH DESCRIPTION
-The output of
-.I tk
-is intended for a Tektronix 4014 terminal.
-.I Tk
-arranges for 66 lines to fit on the screen,
-divides the screen into
-.I N
-columns,
-and
-contributes an eight space page offset
-in the (default) single-column case.
-Tabs, spaces, and backspaces are collected and plotted
-when necessary.
-Teletype Model 37 half- and reverse-line sequences
-are interpreted and plotted.
-At the end of each page
-.I tk
-waits for a newline (empty line) from the keyboard before
-continuing on to the next page.
-In this wait state, the command
-.BI ! command
-will send the
-.I command
-to the shell.
-.PP
-The command line options are:
-.TP
-.B \-t
-Don't wait between pages; for directing output into a file.
-.PP
-.TP
-.BI \- N
-Divide the screen into \fIN\fR columns and
-wait after the last column.
-.TP
-.BI \-p L
-Set page length to \fIL\fR
-lines.
-.SH SEE ALSO
-pr(1)
diff --git a/.ref-Research-V7/usr/man/man1/touch.1 b/.ref-Research-V7/usr/man/man1/touch.1
deleted file mode 100644 (file)
index 6ec9db2..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-.TH TOUCH 1 
-.SH NAME
-touch \- update date last modified of a file
-.SH SYNOPSIS
-.B touch
-[
-.B \-c
-]
-file ...
-.SH DESCRIPTION
-.I Touch
-attempts to set the modified date of each
-.I file.
-This is done by reading a character from the file
-and writing it back.
-.PP
-If a
-.I file
-does not exist,
-an attempt will be made to create it unless the
-.B \-c
-option is specified.
diff --git a/.ref-Research-V7/usr/man/man1/tp.1 b/.ref-Research-V7/usr/man/man1/tp.1
deleted file mode 100644 (file)
index 0b09c27..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-.TH TP 1  deprecated
-.SH NAME
-tp \- manipulate tape archive
-.SH SYNOPSIS
-.B tp
-[ key ] [ name ... ]
-.SH DESCRIPTION
-.I Tp
-saves and restores files
-on DECtape or magtape.
-Its actions are controlled by the
-.I key
-argument.
-The key is a string of characters containing
-at most one function letter and possibly
-one or more function modifiers.
-Other arguments to the command are file or directory
-names specifying which files are to be dumped, restored,
-or listed.
-In all cases, appearance of a directory name refers to
-the files and (recursively) subdirectories of that directory.
-.PP
-The function portion of
-the key is specified by one of the following letters:
-.TP 8
-.B  r
-The named files
-are written
-on the tape.
-If files with the same names
-already exist, they are replaced.
-`Same' is determined by string comparison, so
-`./abc' can never be the same as `/usr/dmr/abc' even
-if `/usr/dmr' is the current directory.
-If no file argument is given, `\fB.\fR' is the default.
-.TP 8
-.B  u
-updates the tape.
-.B u
-is like
-.B r,
-but a file is replaced only if its
-modification date is later than the date stored on the tape;
-that is to say, if it has changed since it was dumped.
-.B u
-is the default command if none is given.
-.TP 8
-.B  d
-deletes the named files from
-the tape.
-At least one name argument must be given.
-This function is not permitted on magtapes.
-.TP 8
-.B  x
-extracts the named files from the tape to the file system.
-The owner and mode are restored.
-If no file argument is given, the entire contents of the
-tape are extracted.
-.TP 8
-.B  t
-lists the names of the specified files.
-If no file argument is given,
-the entire contents of the tape is listed.
-.PP
-The following characters may be used in addition to the letter
-which selects the function desired.
-.TP 10
-.B  m
-Specifies magtape as opposed to DECtape.
-.TP 10
-.B  0,...,7
-This
-modifier selects the drive on which the tape is mounted.
-For DECtape, 
-.B x
-is default; for magtape
-`0' is the default.
-.TP 10
-.B  v
-Normally
-.I tp
-does its work silently.
-The
-.B v
-(verbose)
-option causes it to type the name of each file it treats
-preceded by the function letter.
-With the
-.B t
-function,
-.B v
-gives more information about the
-tape entries than just the name.
-.TP 10
-.B  c
-means a fresh dump is being created; the tape directory
-is cleared before beginning.
-Usable only with
-.B r
-and
-.B u.
-This option is assumed with magtape since
-it is impossible to selectively overwrite
-magtape.
-.TP 10
-.B  i
-Errors reading and writing the
-tape are noted, but no action is taken.
-Normally, errors cause a return to the command level.
-.TP 10
-.B f
-Use the first named file, rather than a tape,
-as the archive.
-This option is known to work only with
-.BR x .
-.TP 10
-.B  w
-causes
-.I tp
-to pause before treating each file, type
-the indicative letter and the file name (as with
-.BR v )
-and await the user's response.
-Response
-.B y
-means `yes', so the file is treated.
-Null response
-means `no', and the file does not take part
-in whatever is being done.
-Response
-.B x
-means `exit';
-the
-.I tp
-command terminates immediately.
-In the
-.B x
-function,
-files previously asked about
-have been extracted already.
-With
-.B "r, u,"
-and
-.B d
-no change has been made to the tape.
-.PP
-.SH FILES
-/dev/tap?
-.br
-/dev/mt?
-.SH SEE ALSO
-ar(1), tar(1)
-.SH DIAGNOSTICS
-Several; the non-obvious one is
-`Phase error', which means the file changed after it was selected for
-dumping but before it was dumped.
-.SH BUGS
-A single file with several links to it is treated like several files.
-.PP
-Binary-coded control information makes
-magnetic tapes written by
-.I tp
-difficult to carry to other machines;
-.IR tar (1)
-avoids the problem.
diff --git a/.ref-Research-V7/usr/man/man1/tr.1 b/.ref-Research-V7/usr/man/man1/tr.1
deleted file mode 100644 (file)
index 5850782..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-.TH TR 1 
-.SH NAME
-tr \- translate characters
-.SH SYNOPSIS
-.B tr
-[
-.B \-cds
-] [ string1 [ string2 ] ]
-.SH DESCRIPTION
-.I Tr
-copies the standard input to the standard output with 
-substitution or deletion of selected characters.
-Input characters found in 
-.I string1
-are mapped into the corresponding characters of
-.IR string2 .
-When 
-.I string2
-is short it is padded to the length of 
-.I string1
-by duplicating its last character.
-Any combination of the options
-.B \-cds
-may be used:
-.B \-c
-complements the set of characters in
-.I string1
-with respect to the universe of characters
-whose ASCII codes are 01 through 0377 octal;
-.B \-d
-deletes all input characters in
-.I string1;
-.B \-s
-squeezes all strings of repeated output characters that are
-in 
-.I string2
-to single characters.
-.PP
-In either string the notation
-.IB a \- b
-means a range of characters from
-.I a
-to
-.I b
-in increasing ASCII order.
-The character
-`\e' followed by 1, 2 or 3 octal digits stands for the
-character whose ASCII code is given by those digits.
-A `\e' followed by any other character stands
-for that character.
-.PP
-The following example creates a list of all
-the words in `file1' one per line in `file2',
-where a word is taken to be a maximal string of alphabetics.
-The second string is quoted
-to protect `\e' from the Shell.
-012 is the ASCII code for newline.
-.IP
-tr \-cs A\-Za\-z \'\e012\' <file1 >file2
-.SH "SEE ALSO"
-ed(1), ascii(7)
-.SH BUGS
-Won't handle ASCII NUL in
-.I string1
-or
-.I string2;
-always deletes NUL from input.
diff --git a/.ref-Research-V7/usr/man/man1/troff.1 b/.ref-Research-V7/usr/man/man1/troff.1
deleted file mode 100644 (file)
index ab83e32..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-.TH TROFF 1 
-.SH NAME
-troff, nroff \- text formatting and typesetting
-.SH SYNOPSIS
-.B troff
-[ option ] ...
-[ file ] ...
-.PP
-.B nroff
-[ option ] ...
-[ file ] ...
-.SH DESCRIPTION
-.I Troff
-formats text in the named
-.I files
-for
-printing on a Graphic Systems C/A/T phototypesetter;
-.I nroff
-for typewriter-like devices.
-Their capabilities are described in the
-.I Nroff/Troff user's manual.
-.PP
-If no
-.I file
-argument is present, the standard input is read.
-An argument consisting of a single minus
-.RB ( \- )
-is taken to be
-a file name corresponding to the standard input.
-The options, which may appear in any order so long as they appear
-before the files, are:
-.TP "\w'\f3\-m\f1name 'u"
-.BI \-o list
-Print only pages whose page numbers appear in
-the comma-separated
-.I list
-of numbers and ranges.
-A range
-.IB N \- M
-means pages
-.I N
-through
-.IR M ;
-an initial
-.I \-N
-means
-from the beginning to page
-.IR N ;
-and a final
-.IR N \-
-means
-from
-.I N
-to the end.
-.TP
-.BI \-n N
-Number first generated page
-.IR N .
-.TP
-.BI \-s N
-Stop every
-.I N
-pages.
-.I Nroff
-will halt prior to every
-.I N
-pages (default
-.IR N =1)
-to allow paper loading or
-changing, and will resume upon receipt of a newline.
-.I Troff
-will stop the phototypesetter every
-.I N
-pages,
-produce a trailer to allow changing cassettes,
-and resume when the typesetter's start button is pressed.
-.TP
-.BI \-m name
-Prepend the macro file
-.BI /usr/lib/tmac/tmac. name
-to the input
-.IR files .
-.TP
-.BI \-r aN
-Set register
-.I a
-(one-character) to
-.IR N .
-.TP
-.B \-i
-Read standard input after the input files are exhausted.
-.TP
-.B \-q
-Invoke the simultaneous input-output mode of the
-.B rd
-request.
-.HP
-.bd I 3
-.I Nroff only
-.br
-.bd I
-.TP
-.BI \-T name
-Prepare output for specified terminal.
-Known
-.I names
-are
-.B 37
-for the (default) 
-Teletype Corporation Model 37 terminal,
-.B tn300
-for the GE TermiNet\ 300 (or any terminal without half-line
-capability),
-.B 300S
-for the \s-1DASI\s+1-300S,
-.B 300
-for the \s-1DASI\s+1-300,
-and
-.B 450
-for the \s-1DASI\s+1-450
-(Diablo Hyterm).
-.TP
-.B \-e
-Produce equally-spaced words in adjusted
-lines, using full terminal resolution.
-.TP
-.B \-h
-Use output tabs during horizontal spacing
-to speed output and reduce output character count.
-Tab settings are assumed to be every
-8 nominal character widths.
-.HP
-.bd I 3
-.I Troff only
-.br
-.bd I
-.TP
-.B \-t
-Direct output to the standard output instead
-of the phototypesetter.
-.TP
-.B \-f
-Refrain from feeding out paper and stopping
-phototypesetter at the end of the run.
-.TP
-.B \-w
-Wait until phototypesetter is available, if
-currently busy.
-.TP
-.B \-b
-Report whether the phototypesetter
-is busy or available.
-No text processing is done.
-.TP
-.B \-a
-Send a printable ASCII approximation
-of the results to the standard output.
-.TP
-.BR \-p N
-Print all characters in point size
-.I  N
-while retaining all prescribed spacings and motions,
-to reduce phototypesetter elasped time.
-.TP
-.B \-g
-Prepare output for a GCOS
-phototypesetter and direct it to the standard output
-(see
-.IR gcat (1)).
-.PP
-If the file
-.I /usr/adm/tracct
-is writable,
-.I troff
-keeps phototypesetter accounting records there.
-The integrity of that file may be secured by making
-.I troff
-a `set user-id' program.
-.SH FILES
-.ta \w'/usr/lib/tmac/tmac.*  'u
-/usr/lib/suftab        suffix hyphenation tables
-.br
-/tmp/ta*       temporary file
-.br
-/usr/lib/tmac/tmac.*   standard macro files
-.br
-/usr/lib/term/*        terminal driving tables for
-.I nroff
-.br
-/usr/lib/font/*        font width tables for
-.I troff
-.br
-/dev/cat       phototypesetter
-.br
-/usr/adm/tracct        accounting statistics for /dev/cat
-.SH "SEE ALSO"
-J. F. Ossanna,
-.I Nroff/Troff user's manual
-.br
-B. W. Kernighan,
-.I
-A TROFF Tutorial
-.br
-eqn(1), tbl(1)
-.br
-col(1), tk(1)
-.RI ( nroff
-only)
-.br
-tc(1), gcat(1)
-.RI ( troff
-only)
diff --git a/.ref-Research-V7/usr/man/man1/true.1 b/.ref-Research-V7/usr/man/man1/true.1
deleted file mode 100644 (file)
index cf41571..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH TRUE 1 
-.SH NAME
-true, false \- provide truth values
-.SH SYNOPSIS
-.B true
-.PP
-.B false
-.SH DESCRIPTION
-.I True
-does nothing, successfully.
-.I False
-does nothing, unsuccessfully.
-They are typically used in input to
-.IR  sh (1)
-such as:
-.PP
-       while true
-.br
-       do
-.br
-               command
-.br
-       done
-.SH "SEE ALSO"
-sh(1)
-.SH DIAGNOSTICS
-.I True
-has exit status zero,
-.I false
-nonzero.
diff --git a/.ref-Research-V7/usr/man/man1/tsort.1 b/.ref-Research-V7/usr/man/man1/tsort.1
deleted file mode 100644 (file)
index 3893259..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-.TH TSORT 1 
-.SH NAME
-tsort \- topological sort
-.SH SYNOPSIS
-.B tsort
-[ file ]
-.SH DESCRIPTION
-.I Tsort
-produces on the standard output a totally ordered list of items
-consistent with a partial ordering of items
-mentioned in the input
-.IR file .
-If no
-.I file
-is specified, the standard input is understood.
-.PP
-The input consists of pairs of items (nonempty strings)
-separated by blanks.
-Pairs of different items indicate ordering.
-Pairs of identical items indicate presence, but not ordering.
-.SH "SEE ALSO"
-lorder(1)
-.SH DIAGNOSTICS
-Odd data: there is an odd number of fields in the input file.
-.SH BUGS
-Uses a quadratic algorithm;
-not worth fixing for the typical use of ordering
-a library archive file.
diff --git a/.ref-Research-V7/usr/man/man1/tty.1 b/.ref-Research-V7/usr/man/man1/tty.1
deleted file mode 100644 (file)
index 6b60cb2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.TH TTY 1 
-.SH NAME
-tty \- get terminal name
-.SH SYNOPSIS
-.B tty
-.SH DESCRIPTION
-.I Tty
-prints the pathname of the user's terminal.
-.SH DIAGNOSTICS
-`not a tty' if the standard input file is not a terminal.
diff --git a/.ref-Research-V7/usr/man/man1/uniq.1 b/.ref-Research-V7/usr/man/man1/uniq.1
deleted file mode 100644 (file)
index ad5439a..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-.TH UNIQ 1 
-.SH NAME
-uniq \- report repeated lines in a file
-.SH SYNOPSIS
-.B uniq
-[
-.B \-udc
-[
-.BR + n
-] [
-.BR \- n
-]
-] [ input [ output ] ]
-.SH DESCRIPTION
-.I Uniq
-reads the input
-file comparing adjacent lines.
-In the normal case, the second and succeeding copies
-of repeated lines are
-removed; the remainder is written on the output file.
-Note that repeated lines must be adjacent
-in order to be found;
-see
-.IR  sort (1).
-If the
-.B \-u
-flag is used,
-just the lines that are not repeated
-in the original file are output.
-The
-.B \-d
-option specifies that
-one copy of just the repeated lines is to
-be written.
-The normal mode output is the union of the
-.B \-u
-and
-.B \-d
-mode outputs.
-.PP
-The
-.B \-c
-option supersedes
-.B \-u
-and
-.B \-d
-and generates
-an output report in default style
-but with each line preceded by a count of the
-number of times it occurred.
-.PP
-The
-.I n
-arguments specify skipping an initial portion of each line
-in the comparison:
-.TP 8
-.BI \- n
-The first
-.IR n 
-fields
-together with any blanks before each are ignored.
-A field is defined as a string of non-space, non-tab characters
-separated by tabs and spaces from its neighbors.
-.TP 8
-.BI + n
-The first
-.IR n 
-characters are ignored.
-Fields are skipped before characters.
-.PP
-.SH "SEE ALSO"
-sort(1), comm(1)
diff --git a/.ref-Research-V7/usr/man/man1/units.1 b/.ref-Research-V7/usr/man/man1/units.1
deleted file mode 100644 (file)
index 21f5d39..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-.if n .ds / /
-.if t .ds / \z/\h'\w'*'u'
-.TH UNITS 1 
-.SH NAME
-units \- conversion program
-.SH SYNOPSIS
-.B units
-.SH DESCRIPTION
-.I Units
-converts quantities expressed
-in various standard scales to
-their equivalents in other scales.
-It works interactively in this fashion:
-.PP
-.I "   You have:"
-inch
-.br
-.I "   You want:"
-cm
-.br
-.I "           * 2.54000e+00
-.br
-.I "           \*/ 3.93701e\-01
-.PP
-A quantity is specified as a multiplicative combination of
-units optionally preceded by a numeric multiplier.
-Powers are indicated by suffixed positive integers,
-division by the usual sign:
-.PP
-.I "   You have:"
-15 pounds force/in2
-.br
-.I "   You want:"
-atm
-.br
-.I "           * 1.02069e+00"
-.br
-.I "           \*/ 9.79730e\-01"
-.PP
-.I Units 
-only does multiplicative scale changes.
-Thus it can convert Kelvin to Rankine, but not Centigrade to
-Fahrenheit.
-Most familiar units,
-abbreviations, and metric prefixes are recognized,
-together with a generous leavening of exotica
-and a few constants of nature including:
-.PP
-.nf
-       pi      ratio of circumference to diameter
-       c       speed of light
-       e       charge on an electron
-       g       acceleration of gravity 
-       force   same as g
-       mole    Avogadro's number
-       water   pressure head per unit height of water
-       au      astronomical unit
-.PP
-.fi
-`Pound' is a unit of
-mass.
-Compound names are run together, e.g. `lightyear'.
-British units that differ from their US counterparts
-are prefixed thus: `brgallon'.
-Currency is denoted `belgiumfranc', `britainpound', ...
-.PP
-For a complete list of units, `cat /usr/lib/units'.
-.SH FILES
-/usr/lib/units
-.SH BUGS
-Don't base your
-financial plans on the currency conversions.
diff --git a/.ref-Research-V7/usr/man/man1/uucp.1c b/.ref-Research-V7/usr/man/man1/uucp.1c
deleted file mode 100644 (file)
index 7c00809..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-.TH UUCP 1C 
-.SH NAME
-uucp, uulog \- unix to unix copy
-.SH SYNOPSIS
-.B uucp
-[ option ] ...
-source-file ...  destination-file
-.PP
-.B uulog
-[ option ] ...
-.SH DESCRIPTION
-.I Uucp
-copies files named by the source-file arguments
-to the destination-file argument.
-A file name may be a path name on your machine, or may 
-have the form
-.IP
-system-name!pathname
-.LP
-where `system-name' is taken from a list of system names
-which
-.I uucp
-knows about.
-Shell metacharacters ?*[] appearing in the pathname part
-will be expanded on the appropriate system.
-.PP
-Pathnames may be one of
-.IP (1)
-a full pathname;
-.IP (2)
-a pathname preceded by
-.IR ~user ;
-where
-.I user
-is a userid on the specified system
-and is replaced by that user's login directory;
-.IP (3)
-anything else is prefixed by the current directory.
-.PP
-If the result is an erroneous pathname for the remote system
-the copy will fail.
-If the destination-file is a directory, the last part of the
-source-file name is used.
-.ig
-If a simple
-.I ~user
-destination is inaccessible to 
-.I uucp,
-data is copied to a spool directory and the user
-is notified by
-.IR mail (1).
-..
-.PP
-.I Uucp
-preserves execute permissions across the transmission
-and gives 0666 read and write permissions (see
-.IR chmod (2)).
-.PP
-The following options are interpreted by
-.IR uucp .
-.TP 
-.B \-d
-Make all necessary directories for the file copy.
-.TP 
-.B \-c
-Use the source file when copying out rather than
-copying the file to the spool directory.
-.TP 
-.B \-m
-Send mail to the requester when the copy is complete.
-.PP
-.I Uulog
-maintains a summary log
-of 
-.I uucp
-and
-.IR uux (1)
-transactions in the file
-`/usr/spool/uucp/LOGFILE' by gathering
-information from partial log files named `/usr/spool/uucp/LOG.*.?'.
-It removes the partial log files.
-.PP
-The options cause 
-.I uulog 
-to print logging information:
-.TP
-.BI \-s sys
-Print information about work involving system
-.I sys.
-.TP
-.BI \-u user
-Print information about work done for the specified
-.I user.
-.SH FILES
-/usr/spool/uucp - spool directory
-.br
-/usr/lib/uucp/* - other data and program files
-.SH SEE ALSO
-uux(1), mail(1)
-.br
-D. A. Nowitz,
-.I Uucp Implementation Description
-.SH WARNING
-The domain of remotely accessible files can
-(and for obvious security reasons, usually should)
-be severely restricted.
-You will very likely not be able to fetch files
-by pathname;
-ask a responsible person on the remote system to
-send them to you.
-For the same reasons you will probably not be able
-to send files to arbitrary pathnames.
-.SH BUGS
-.br
-All files received by
-.I uucp
-will be owned by uucp.
-.br
-The \-m option will only work sending files or receiving
-a single file.
-(Receiving multiple files specified by special shell
-characters ?*[] will not activate
-the \-m option.)
diff --git a/.ref-Research-V7/usr/man/man1/uux.1c b/.ref-Research-V7/usr/man/man1/uux.1c
deleted file mode 100644 (file)
index 169a30c..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH UUX 1C
-.SH NAME
-uux \- unix to unix command execution
-.SH SYNOPSIS
-.B uux
-[
-.B \-
-]
-command-string
-.SH DESCRIPTION
-.I Uux
-will gather 0 or more files from various systems,
-execute a command on a specified system
-and send standard output to a file on a specified
-system.
-.PP
-The command-string is made up of one or more arguments that look
-like a shell command line,
-except that the command and file names
-may be prefixed by system-name!.
-A null system-name is interpreted as the local system.
-.PP
-File names may be one of
-.IP
-(1) a full pathname;
-.IP
-(2) a pathname preceded by
-.IR ~xxx ;
-where
-.I xxx
-is a userid on the specified system
-and is replaced by that user's login directory;
-.br
-.IP
-(3) anything else is prefixed by the current directory.
-.PP
-The `\-' option will cause the standard input to the
-.I uux
-command to be the standard input to the command-string.
-.PP
-For example, the command
-.IP
-uux "!diff usg!/usr/dan/f1 pwba!/a4/dan/f1 > !fi.diff"
-.PP
-will get the f1 files from the usg and pwba machines,
-execute a
-.I diff
-command
-and put the results in f1.diff in the local directory.
-.PP
-Any special shell characters such as <>;| should be quoted either
-by quoting the entire command-string, or quoting the special
-characters as individual arguments.
-.SH FILES
-/usr/uucp/spool - spool directory
-.br
-/usr/uucp/* - other data and programs
-.SH SEE ALSO
-uucp(1)
-.br
-D. A. Nowitz,
-.I Uucp implementation description
-.SH WARNING
-An installation may, and for security reasons
-generally will, limit the list of
-commands executable on behalf of an incoming request from
-.I uux.
-Typically, a restricted site will permit little other than
-the receipt of mail via 
-.I uux.
-.SH BUGS
-Only the first command of a shell pipeline may
-have a system-name!.
-All other commands are executed on the system of the first
-command.
-.br
-The use of the shell metacharacter
-.B *
-will probably not do what you want it to do.
-.br
-The shell tokens << and >> are not implemented.
-.br
-There is no notification of denial of execution
-on the remote machine.
diff --git a/.ref-Research-V7/usr/man/man1/wait.1 b/.ref-Research-V7/usr/man/man1/wait.1
deleted file mode 100644 (file)
index 16e92f2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH WAIT 1 
-.SH NAME
-wait \- await completion of process
-.SH SYNOPSIS
-.B wait
-.SH DESCRIPTION
-Wait until all processes started with
-.B &
-have completed,
-and report on abnormal terminations.
-.PP
-Because the
-.IR  wait (2)
-system call
-must be executed in the parent process,
-the Shell itself executes
-.I wait,
-without creating a new process.
-.SH "SEE ALSO"
-sh(1)
-.SH BUGS
-Not all the processes of a 3- or more-stage
-pipeline are children of the Shell, and
-thus can't be waited for.
diff --git a/.ref-Research-V7/usr/man/man1/wall.1m b/.ref-Research-V7/usr/man/man1/wall.1m
deleted file mode 100644 (file)
index b8fa2dc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH WALL 1M 
-.SH NAME
-wall  \-  write to all users
-.SH SYNOPSIS
-.B /etc/wall
-.SH DESCRIPTION
-.I Wall
-reads its standard input until an end-of-file.
-It then sends this message,
-preceded by
-`Broadcast Message ...',
-to all logged in users.
-.PP
-The sender should be super-user to override
-any protections the users may have invoked.
-.SH FILES
-/dev/tty?
-.br
-/etc/utmp
-.SH "SEE ALSO"
-mesg(1), write(1)
-.SH DIAGNOSTICS
-`Cannot send to ...' when the open on
-a user's tty file fails.
diff --git a/.ref-Research-V7/usr/man/man1/wc.1 b/.ref-Research-V7/usr/man/man1/wc.1
deleted file mode 100644 (file)
index 7363fcf..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.TH WC 1 
-.SH NAME
-wc \- word count
-.SH SYNOPSIS
-.B wc
-[
-.B \-lwc
-]
-[ name ... ]
-.SH DESCRIPTION
-.I Wc
-counts lines, words and characters in the named files,
-or in the standard input if no name appears.
-A word is a maximal string of characters
-delimited by spaces, tabs or newlines.
-.PP
-If the optional argument is present,
-just the specified counts (lines, words or characters)
-are selected by the letters
-.BR l ,
-.BR w ,
-or
-.BR c .
diff --git a/.ref-Research-V7/usr/man/man1/who.1 b/.ref-Research-V7/usr/man/man1/who.1
deleted file mode 100644 (file)
index 87bb284..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-.TH WHO 1 
-.SH NAME
-who  \-  who is on the system
-.SH SYNOPSIS
-.B who
-[ who-file ] [
-.B "am I"
-]
-.SH DESCRIPTION
-.I Who,
-without an argument,
-lists the login name, terminal name, and login time
-for each current UNIX user.
-.PP
-Without an argument,
-.I who
-examines the /etc/utmp
-file to obtain its information.
-If a file is given, that file is examined.
-Typically the given file will be /usr/adm/wtmp,
-which contains a record of all the logins since it
-was created.
-Then
-.I who
-lists
-logins, logouts, and crashes since the creation of
-the wtmp file.
-Each login is listed with user name,
-terminal name (with `/dev/'
-suppressed),
-and date and time.
-When an argument is given, logouts produce a similar line without a user name.
-Reboots produce a line with `x' in the place of the device name,
-and a fossil time indicative of when the system went down.
-.PP
-With two arguments,
-as in `who am I' (and also `who are you'),
-.I who
-tells who you are logged in as.
-.SH FILES
-/etc/utmp
-.SH "SEE ALSO"
-getuid(2), utmp(5)
diff --git a/.ref-Research-V7/usr/man/man1/write.1 b/.ref-Research-V7/usr/man/man1/write.1
deleted file mode 100644 (file)
index 2678371..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-.TH WRITE 1 
-.SH NAME
-write  \-  write to another user
-.SH SYNOPSIS
-.B write
-user [ ttyname ]
-.SH DESCRIPTION
-.I Write
-copies lines from your terminal to that of
-another user.
-When first called,
-it sends the message
-.PP
-     Message from yourname yourttyname...
-.PP
-The recipient of the message should write back at this point.
-Communication continues until an end of file is
-read from the terminal or an interrupt is sent.
-At that point
-.I write
-writes `EOT' on the other terminal and exits.
-.PP
-If you want to write to a user who is logged in more than once,
-the
-.I ttyname
-argument may be used to indicate the
-appropriate terminal name.
-.PP
-Permission to write may be denied or granted by use of the
-.I mesg
-command.
-At the outset writing is allowed.
-Certain commands, in particular
-.I nroff
-and
-.IR  pr (1)
-disallow
-messages in order to prevent messy output.
-.PP
-If the character `!' is found at the beginning of a line,
-.I write
-calls the shell
-to execute the rest of the
-line as a command.
-.PP
-The following protocol is suggested for using
-.IR write :
-when you first write to another user, wait for him to
-write back before starting to send.
-Each party should end each message with a distinctive
-signal\(em\fB(o)\fR
-for `over' is conventional\(emthat the other may reply.
-.B (oo)
-for `over and out' is suggested when conversation
-is about to be terminated.
-.SH FILES
-/etc/utmp      to find user
-.br
-/bin/sh                to execute `!'
-.SH "SEE ALSO"
-mesg(1), who(1), mail(1)
diff --git a/.ref-Research-V7/usr/man/man1/xsend.1 b/.ref-Research-V7/usr/man/man1/xsend.1
deleted file mode 100644 (file)
index 89f3de7..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH "XSEND, XGET, ENROLL" 1
-.SH NAME
-xsend, xget, enroll \- secret mail
-.SH SYNOPSIS
-.B xsend
-person
-.br
-.B xget
-.br
-.B enroll
-.SH DESCRIPTION
-These commands implement a secure communication
-channel;
-it is like
-.IR mail (1),
-but no one can read the messages except the intended recipient.
-The method embodies a public-key cryptosystem using knapsacks.
-.PP
-To receive messages, use
-.IR enroll ;
-it asks you for a password that you must subsequently quote
-in order to receive secret mail.
-.PP
-To receive secret mail,
-use
-.IR xget .
-It asks for your password, then gives you the messages.
-.PP
-To send secret mail, use
-.IR xsend
-in the same manner as the ordinary mail command.
-(However, it will accept only one target).
-A message announcing the receipt of secret mail is also sent
-by ordinary mail.
-.SH FILES
-/usr/spool/secretmail/*.key: keys
-/usr/spool/secretmail/*.[0-9]: messages
-.SH SEE ALSO
-mail (1)
-.SH BUGS
-It should be integrated with ordinary mail.
-The announcement of secret mail makes traffic analysis possible.
diff --git a/.ref-Research-V7/usr/man/man1/yacc.1 b/.ref-Research-V7/usr/man/man1/yacc.1
deleted file mode 100644 (file)
index f4e69dc..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-.TH YACC 1 
-.SH NAME
-yacc \- yet another compiler-compiler
-.SH SYNOPSIS
-.B yacc
-[
-.B \-vd
-]
-grammar
-.SH DESCRIPTION
-.I Yacc
-converts a context-free grammar into a set of
-tables for a simple automaton which executes an LR(1) parsing
-algorithm.
-The grammar may be ambiguous;
-specified precedence rules are used to break ambiguities.
-.PP
-The output file,
-.IR y.tab.c ,
-must be compiled by the C compiler
-to produce a program
-.IR yyparse .
-This program must be loaded with the lexical analyzer program,
-.IR yylex ,
-as well as
-.I main
-and
-.IR yyerror ,
-an error handling routine.
-These routines must be supplied by the user;
-.IR Lex (1)
-is useful for creating lexical analyzers usable by
-.IR yacc .
-.PP
-If the
-.B \-v
-flag is given, the file
-.I y.output
-is prepared, which contains a description of the parsing tables
-and a report on
-conflicts generated by ambiguities in the grammar.
-.PP
-If the \-\fBd\fR flag is used, the file
-.I y.tab.h
-is generated with the
-.I define
-statements that associate the
-.I yacc\c
--assigned `token codes' with the user-declared `token names'.
-This allows source files other than
-.I y.tab.c
-to access the token codes.
-.SH FILES
-.ta \w'yacc.tmp, yacc.acts 'u
-y.output
-.br
-y.tab.c
-.br
-y.tab.h        defines for token names
-.br
-yacc.tmp, yacc.acts    temporary files
-.br
-/usr/lib/yaccpar       parser prototype for C programs
-.br
-/lib/liby.a    library with default `main' and `yyerror'
-.SH "SEE ALSO"
-.IR lex (1)
-.br
-.I "LR Parsing"
-by A. V. Aho and S. C. Johnson,
-Computing Surveys, June, 1974.
-.br
-.I "YACC \- Yet Another Compiler Compiler"
-by S. C. Johnson.
-.SH DIAGNOSTICS
-The number of reduce-reduce and shift-reduce conflicts
-is reported on the standard output;
-a more detailed report is
-found in the
-.I y.output
-file.
-Similarly, if some rules are not reachable from the
-start symbol, this is also reported.
-.SH BUGS
-Because file names are fixed, at most one
-.I yacc
-process can be active in a given directory at
-a time.
diff --git a/.ref-Research-V7/usr/man/man2/access.2 b/.ref-Research-V7/usr/man/man2/access.2
deleted file mode 100644 (file)
index 5426c10..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-.TH ACCESS 2 
-.SH NAME
-access \- determine accessibility of file
-.SH SYNOPSIS
-.B access(name, mode)
-.br
-.B char *name;
-.SH DESCRIPTION
-.I Access
-checks the given
-file
-.I name
-for accessibility according to
-.I mode,
-which is 4 (read), 2 (write) or 1 (execute) or a combination thereof.
-Specifying mode 0
-tests whether the directories leading to the file can be
-searched and the file exists.
-.PP
-An appropriate error indication is returned if 
-.I name
-cannot be found or if any
-of the desired access modes would not be granted.
-On disallowed accesses
-\-1 is returned and the error code is in
-.IR errno .
-0 is returned from successful tests.
-.PP
-The user and group IDs with respect to which permission is checked
-are the real UID and GID of the process, so this call is
-useful to set-UID programs.
-.PP
-Notice that it is only access bits that are checked.
-A directory may be announced as writable by
-.I access,
-but an attempt to open it for writing will fail
-(although files may be created there);
-a file may look executable, but
-.I exec
-will fail unless it is in proper format.
-.PP
-.SH SEE ALSO
-stat(2)
-.SH ASSEMBLER
-(access = 33.)
-.br
-.B sys access; name; mode
diff --git a/.ref-Research-V7/usr/man/man2/acct.2 b/.ref-Research-V7/usr/man/man2/acct.2
deleted file mode 100644 (file)
index 0d10fd5..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH ACCT 2 
-.SH NAME
-acct \- turn accounting on or off
-.SH SYNOPSIS
-.B acct(file)
-.br
-.B char *file;
-.SH DESCRIPTION
-The system is prepared to write a record
-in an accounting
-.I file
-for each process as it terminates.
-This
-call, with a null-terminated string naming an existing file
-as argument, turns on accounting;
-records for each terminating process are appended to
-.IR file .
-An argument of 0 causes accounting to be turned off.
-.PP
-The accounting file format is given in
-.IR acct (5).
-.SH "SEE ALSO"
-acct(5), sa(1)
-.SH DIAGNOSTICS
-On error \-1 is returned.
-The file must exist and the call may be exercised only by the super-user.
-It is erroneous to try to turn on accounting when it is already on.
-.SH BUGS
-No accounting is produced for programs running
-when a crash occurs.
-In particular nonterminating programs are never
-accounted for.
-.SH ASSEMBLER
-(acct = 51.)
-.br
-.B sys acct; file
diff --git a/.ref-Research-V7/usr/man/man2/alarm.2 b/.ref-Research-V7/usr/man/man2/alarm.2
deleted file mode 100644 (file)
index 5a678fe..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH ALARM 2 
-.SH NAME
-alarm \- schedule signal after specified time
-.SH SYNOPSIS
-.B alarm(seconds)
-.br
-.B unsigned seconds;
-.SH DESCRIPTION
-.I Alarm
-causes signal SIGALRM, see
-.IR signal (2),
-to be sent to the invoking process
-in a number of seconds given by the argument.
-Unless caught or ignored, the signal terminates the process.
-.PP
-Alarm requests are not stacked;
-successive calls reset the alarm clock.
-If the argument is 0, any alarm request is cancelled.
-Because the clock has a 1-second resolution,
-the signal may occur up to one second early;
-because of scheduling delays,
-resumption of execution of when the signal is
-caught may be delayed an arbitrary amount.
-The longest specifiable delay time is 65535 seconds.
-.PP
-The return value is the amount of time
-previously remaining in the alarm clock.
-.SH "SEE ALSO"
-pause(2), signal(2), sleep(3)
-.SH ASSEMBLER
-(alarm = 27.)
-.br
-(seconds in r0)
-.br
-.B sys alarm
-.br
-(previous amount in r0)
diff --git a/.ref-Research-V7/usr/man/man2/brk.2 b/.ref-Research-V7/usr/man/man2/brk.2
deleted file mode 100644 (file)
index c52734d..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-.TH BRK 2 
-.SH NAME
-brk, sbrk, break \- change core allocation
-.SH SYNOPSIS
-.B char *brk(addr)
-.PP
-.B char *sbrk(incr)
-.SH DESCRIPTION
-.I Brk
-sets the system's idea of the lowest location not used by the program
-(called the break)
-to
-.I addr
-(rounded up to the next multiple of 64 bytes
-on the PDP11, 256 bytes on the Interdata 8/32, 512 bytes on the VAX-11/780).
-Locations not less than
-.I addr
-and below the stack pointer
-are not in the address space and will thus
-cause a memory violation if accessed.
-.PP
-In the alternate function
-.I sbrk,
-.I incr
-more bytes are added to the
-program's data space and a pointer to the
-start of the new area is returned.
-.PP
-When a program begins execution via
-.I exec
-the break is set at the
-highest location defined by the program
-and data storage areas.
-Ordinarily, therefore, only programs with growing
-data areas need to use
-.IR break .
-.SH "SEE ALSO"
-exec(2),
-malloc(3),
-end(3)
-.SH DIAGNOSTICS
-Zero is returned if the break could be set;
-\-1 if the program requests more
-memory than the system limit
-or if too many segmentation
-registers would be required to implement the break.
-.SH BUGS
-Setting the break in the range
-0177701 to 0177777 (on the PDP11) is the same as setting it to zero.
-.SH ASSEMBLER
-(break = 17.)
-.br
-.B sys break; addr
-.PP
-.I Break
-performs the function of
-.IR brk .
-The name of the routine differs from that in C
-for historical reasons.
diff --git a/.ref-Research-V7/usr/man/man2/chdir.2 b/.ref-Research-V7/usr/man/man2/chdir.2
deleted file mode 100644 (file)
index 4e038eb..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH "CHDIR" 2 
-.SH NAME
-chdir, chroot \- change default directory
-.SH SYNOPSIS
-.B chdir(dirname)
-.br
-.B char *dirname;
-.PP
-.B chroot(dirname)
-.br
-.B char *dirname;
-.SH DESCRIPTION
-.I Dirname
-is the address of the pathname of a directory, terminated by a null byte.
-.I Chdir
-causes this directory
-to become the current working directory,
-the starting point for path names not beginning with `/'.
-.PP
-.I Chroot
-sets the root directory, the
-starting point for path names beginning with `/'.
-The call is restricted to the super-user.
-.SH "SEE ALSO"
-cd(1)
-.SH DIAGNOSTICS
-Zero is returned if the directory is changed; \-1
-is returned
-if the given name is not that of a directory
-or is not searchable.
-.SH ASSEMBLER
-(chdir = 12.)
-.br
-.B sys chdir; dirname
-.PP
-(chroot = 61.)
-.br
-.B sys chroot; dirname
diff --git a/.ref-Research-V7/usr/man/man2/chmod.2 b/.ref-Research-V7/usr/man/man2/chmod.2
deleted file mode 100644 (file)
index 3796d60..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-.TH CHMOD 2 
-.SH NAME
-chmod \- change mode of file
-.SH SYNOPSIS
-.B chmod(name, mode)
-.br
-.B char *name;
-.SH DESCRIPTION
-The file whose name
-is given as the null-terminated string pointed to by
-.I name
-has its mode changed to
-.IR mode .
-Modes are constructed by ORing together some
-combination of the following:
-.PP
-.RS
- 04000 set user ID on execution
- 02000 set group ID on execution
- 01000 save text image after execution
- 00400 read by owner
- 00200 write by owner
- 00100 execute (search on directory) by owner
- 00070 read, write, execute (search) by group
- 00007 read, write, execute (search) by others
-.RE
-.PP
-If an executable file is set up for sharing
-(\fB\-n\fR or \fB\-i\fR option of
-.IR ld (1))
-then mode 1000 prevents the system from
-abandoning the swap-space image of the program-text portion
-of the file when its last user
-terminates.
-Thus when the next user of the file executes it,
-the text need not be read from the file
-system but can simply be swapped in,
-saving time.
-Ability to set this bit is restricted to the super-user
-since swap space is consumed
-by the images; it is only worth while for heavily used commands.
-.PP
-Only the owner of a file (or the super-user) may change the mode.
-Only the super-user can set the 1000 mode.
-.SH "SEE ALSO"
-chmod(1)
-.SH DIAGNOSTIC
-Zero is returned if the mode is changed;
-\-1 is returned if
-.I name
-cannot be found or if current user
-is neither the owner of the file nor the super-user.
-.SH ASSEMBLER
-(chmod = 15.)
-.br
-.B sys chmod; name; mode
diff --git a/.ref-Research-V7/usr/man/man2/chown.2 b/.ref-Research-V7/usr/man/man2/chown.2
deleted file mode 100644 (file)
index 2b24ad0..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-.TH CHOWN 2 
-.SH NAME
-chown \- change owner and group of a file
-.SH SYNOPSIS
-.B chown(name, owner, group)
-.br
-.B char *name;
-.SH DESCRIPTION
-The file
-whose name is given by the null-terminated string pointed
-to by
-.I name
-has its
-.I owner
-and 
-.I group
-changed as specified.
-Only the super-user may
-execute this call,
-because if users were able to give files away,
-they could defeat the (nonexistent)
-file-space accounting procedures.
-.SH "SEE ALSO"
-chown(1), passwd(5)
-.SH DIAGNOSTICS
-Zero is returned if the owner is changed;
-\-1 is returned
-on illegal owner changes.
-.SH ASSEMBLER
-(chown = 16.)
-.br
-.B sys chown; name; owner; group
diff --git a/.ref-Research-V7/usr/man/man2/close.2 b/.ref-Research-V7/usr/man/man2/close.2
deleted file mode 100644 (file)
index e6ea139..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-.TH CLOSE 2 
-.SH NAME
-close  \-  close a file
-.SH SYNOPSIS
-.B close(fildes)
-.PP
-.SH DESCRIPTION
-Given
-a file descriptor such as returned from an
-.I open,
-.I creat,
-.I dup
-or
-.IR pipe (2)
-call,
-.I close
-closes the associated file.
-A close of all files is automatic on
-.I exit,
-but since
-there is a limit on the number of open files per process,
-.I close
-is necessary for programs which deal with many files.
-.PP
-Files are closed upon termination of a process, and
-certain file descriptors may be closed by
-.IR exec (2)
-(see
-.IR ioctl (2)).
-.SH "SEE ALSO"
-creat(2), open(2), pipe(2), exec(2), ioctl(2)
-.SH DIAGNOSTICS
-Zero is returned if a file is closed;
-\-1 is returned for an unknown file descriptor.
-.SH ASSEMBLER
-(close = 6.)
-.br
-(file descriptor in r0)
-.br
-.B sys close
-.PP
diff --git a/.ref-Research-V7/usr/man/man2/creat.2 b/.ref-Research-V7/usr/man/man2/creat.2
deleted file mode 100644 (file)
index dca31a9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-.TH CREAT 2 
-.SH NAME
-creat  \-  create a new file
-.SH SYNOPSIS
-.B creat(name, mode)
-.br
-.B char *name;
-.SH DESCRIPTION
-.I Creat
-creates a new file or prepares to rewrite an existing
-file called 
-.I name,
-given as the address of a null-terminated string.
-If the file did not exist, it is given
-mode
-.IR mode ,
-as modified by the process's mode mask (see
-.IR umask (2)).
-Also see
-.IR  chmod (2)
-for the
-construction of the
-.I mode
-argument.
-.PP
-If the file did exist, its mode and owner remain unchanged
-but it is truncated to 0 length.
-.PP
-The file is also opened for writing, and its file descriptor
-is returned.
-.PP
-The
-.I mode
-given is arbitrary; it need not allow
-writing.
-This feature is used by programs which deal with temporary
-files of fixed names.
-The creation is done with
-a mode that forbids writing.
-Then if a second
-instance of the program attempts a
-.I creat,
-an error is
-returned and the program knows that the name is unusable
-for the moment.
-.SH "SEE ALSO"
-write(2), close(2), chmod(2), umask (2)
-.SH DIAGNOSTICS
-The value \-1 is returned if:
-a needed directory is not searchable;
-the file does not exist and the directory
-in which it is to be created is not writable; the file
-does exist and is unwritable;
-the file is a directory;
-there are already too many files open.
-.SH ASSEMBLER
-(creat = 8.)
-.br
-.B sys creat; name; mode
-.br
-(file descriptor in r0)
diff --git a/.ref-Research-V7/usr/man/man2/dup.2 b/.ref-Research-V7/usr/man/man2/dup.2
deleted file mode 100644 (file)
index 32502aa..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-.TH DUP 2 
-.SH NAME
-dup, dup2 \- duplicate an open file descriptor
-.SH SYNOPSIS
-.B dup(fildes)
-.br
-.B int fildes;
-.PP
-.B dup2(fildes, fildes2)
-.br
-.B int fildes, fildes2;
-.SH DESCRIPTION
-Given
-a file descriptor returned from
-an
-.I open,
-.I pipe,
-or
-.I creat
-call,
-.I dup
-allocates another file descriptor
-synonymous
-with
-the original.
-The new file descriptor is returned.
-.PP
-In the second form of the call,
-.I fildes
-is a file descriptor referring to an open file, and
-.I fildes2
-is a non-negative integer less than the maximum value
-allowed for file descriptors (approximately 19).
-.I Dup2
-causes
-.I fildes2
-to refer to the same file as
-.I fildes.
-If
-.I fildes2
-already referred to an open file, it is closed first.
-.SH "SEE ALSO"
-creat(2), open(2), close(2), pipe(2)
-.SH DIAGNOSTICS
-The value \-1 is returned if:
-the given file descriptor is invalid;
-there are already too many open files.
-.SH ASSEMBLER
-(dup = 41.)
-.br
-(file descriptor in r0)
-.br
-(new file descriptor in r1)
-.br
-.B sys dup
-.br
-(file descriptor in r0)
-.PP
-The
-.I dup2
-entry is implemented by adding 0100 to
-.I fildes.
diff --git a/.ref-Research-V7/usr/man/man2/exec.2 b/.ref-Research-V7/usr/man/man2/exec.2
deleted file mode 100644 (file)
index 19acdb9..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-.TH EXEC 2 
-.SH NAME
-execl, execv, execle, execve, execlp, execvp, exec, exece, environ  \- execute a file
-.SH SYNOPSIS
-.B execl(name, arg0, arg1, ..., argn, 0)
-.br
-.B char *name, *arg0, *arg1, ..., *argn;
-.PP
-.B execv(name, argv)
-.br
-.B char *name, *argv[ ];
-.PP
-.B "execle(name, arg0, arg1, ..., argn, 0, envp)
-.br
-.B "char *name, *arg0, *arg1, ..., *argn, *envp[ ];
-.PP
-.B execve(name, argv, envp);
-.br
-.B char *name, *argv[ ], *envp[ ];
-.PP
-.B extern char **environ;
-.SH DESCRIPTION
-.I Exec
-in all its forms
-overlays the calling process with the named file, then
-transfers to the
-entry point of the core image of the file.
-There can be no return from a successful exec; the calling
-core image is lost.
-.PP
-Files remain open across
-.I exec
-unless explicit arrangement has been made;
-see
-.IR ioctl (2).
-Ignored signals remain ignored across
-these calls, but
-signals that are caught (see
-.IR signal (2))
-are reset
-to their default values.
-.PP
-Each user has a
-.I real
-user ID and group ID and an
-.I effective
-user ID and group ID.
-The
-real
-ID
-identifies the person using the system;
-the
-effective
-ID
-determines his access privileges.
-.I Exec
-changes the effective user and group ID to
-the owner of the executed file if the file has the `set-user-ID'
-or `set-group-ID'
-modes.
-The
-real
-user ID is not affected.
-.PP
-The
-.I name
-argument
-is a pointer to the name of the file
-to be executed.
-The pointers
-.IR arg [ 0 ],
-.IR arg [ 1 "] ..."
-address null-terminated strings.
-Conventionally
-.IR arg [ 0 ]
-is the name of the
-file.
-.PP
-From C, two interfaces are available.
-.I Execl
-is useful when a known file with known arguments is
-being called;
-the arguments to
-.I execl
-are the character strings
-constituting the file and the arguments;
-the first argument is conventionally
-the same as the file name (or its last component).
-A 0 argument must end the argument list.
-.PP
-The
-.I execv
-version is useful when the number of arguments is unknown
-in advance;
-the arguments to
-.I execv
-are the name of the file to be
-executed and a vector of strings containing
-the arguments.
-The last argument string must be followed
-by a 0 pointer.
-.PP
-When a C program is executed,
-it is called as follows:
-.PP
-       main(argc, argv, envp)
-.br
-       int argc;
-.br
-       char **argv, **envp;
-.PP
-where
-.IR argc ""
-is the argument count
-and
-.IR argv ""
-is an array of character pointers
-to the arguments themselves.
-As indicated,
-.IR argc ""
-is conventionally at least one
-and the first member of the array points to a
-string containing the name of the file.
-.PP
-.I Argv
-is directly usable in another
-.I execv
-because
-.IR argv [ argc ]
-is 0.
-.PP
-.I Envp
-is a pointer to an array of strings that constitute
-the
-.I environment
-of the process.
-Each string consists of a name, an ``='', and a null-terminated value.
-The array of pointers is terminated by a null pointer.
-The shell
-.IR sh (1)
-passes an environment entry for each global shell variable
-defined when the program is called.
-See
-.IR environ (5)
-for some conventionally
-used names.
-The C run-time start-off routine places a copy of
-.I envp
-in the global cell
-.I environ,
-which is used
-by
-.IR execv \ and \ execl
-to pass the environment to any subprograms executed by the
-current program.
-The
-.I exec
-routines use lower-level routines as follows
-to pass an environment explicitly:
-.RS
-.nf
-execle(file, arg0, arg1, . . . , argn, 0, environ);
-execve(file, argv, environ);
-.fi
-.RE
-.PP
-.I Execlp
-and
-.I execvp
-are called with the same arguments as
-.I execl
-and
-.I execv,
-but duplicate the shell's actions in searching for an executable
-file in a list of directories.
-The directory list is obtained from the environment.
-.SH FILES
-.ta \w'/bin/sh  'u
-/bin/sh        shell, invoked if command file found
-by
-.I execlp
-or
-.I execvp
-.SH "SEE ALSO"
-fork(2), environ(5)
-.SH DIAGNOSTICS
-If the file cannot be found,
-if it is not executable,
-if it does not start with a valid magic number (see
-.IR a.out (5)),
-if maximum memory is exceeded,
-or if the arguments require too much space,
-a return
-constitutes the diagnostic;
-the return value is \-1.
-Even for the super-user,
-at least one of the execute-permission bits must be set for
-a file to be executed.
-.SH BUGS
-If
-.I execvp
-is called to execute a file that turns out to be a shell
-command file,
-and if it is impossible to execute the shell,
-the values of
-.I argv[0]
-and
-.I argv[\-1]
-will be modified before return.
-.SH ASSEMBLER
-.DT
-(exec = 11.)
-.br
-.B sys exec; name; argv
-.PP
-(exece = 59.)
-.br
-.B sys exece; name; argv; envp
-.PP
-Plain
-.I exec
-is obsoleted by
-.I exece,
-but remains for historical reasons.
-.PP
-When the called file starts execution on the PDP11,
-the stack pointer points to a word containing the number of arguments.
-Just above
-this number is a list of pointers to the argument strings,
-followed by a null pointer, followed by the pointers to
-the environment strings and then another null pointer.
-The strings themselves follow;
-a 0 word is left at the very top of memory.
-.PP
-  sp\(->       nargs
-.br
-       arg0
-.br
-       ...
-.br
-       argn
-.br
-       0
-.br
-       env0
-.br
-       ...
-.br
-       envm
-.br
-       0
-.PP
- arg0: <arg0\e0>
-.br
-       ...
-.br
- env0: <env0\e0>
-.br
-       0
-.PP
-On the Interdata 8/32,
-the stack begins at a conventional place
-(currently 0xD0000)
-and grows upwards.
-After
-.I exec,
-the layout of data on the stack is as follows.
-.PP
-.nf
-       int     0
- arg0: byte    ...
-       ...
-argp0: int     arg0
-       ...
-       int     0
-envp0: int     env0
-       ...
-       int     0
- %2\(->        space   40
-       int     nargs
-       int     argp0
-       int     envp0
- %3\(->
-.fi
-.PP
-This arrangement happens to conform well to C calling conventions.
diff --git a/.ref-Research-V7/usr/man/man2/exit.2 b/.ref-Research-V7/usr/man/man2/exit.2
deleted file mode 100644 (file)
index 3c0c541..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-.TH EXIT 2 
-.SH NAME
-exit \- terminate process
-.SH SYNOPSIS
-.B exit(status)
-.br
-.B int status;
-.PP
-.B _exit(status)
-.br
-.B int status;
-.SH DESCRIPTION
-.I Exit
-is the normal means of terminating a process.
-.I Exit
-closes all the process's files and notifies the parent process
-if it is executing a
-.IR wait .
-The low-order 8 bits of 
-.I status
-are available to the parent process.
-.PP
-This call can never return.
-.PP
-The C function
-.I exit
-may cause cleanup actions before the
-final `sys exit'.
-The function
-.I _exit
-circumvents all cleanup.
-.SH "SEE ALSO"
-wait(2)
-.SH ASSEMBLER
-(exit = 1.)
-.br
-(status in r0)
-.br
-.B sys exit
diff --git a/.ref-Research-V7/usr/man/man2/fork.2 b/.ref-Research-V7/usr/man/man2/fork.2
deleted file mode 100644 (file)
index 7ccb6ae..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-.TH FORK 2 
-.SH NAME
-fork  \-  spawn new process
-.SH SYNOPSIS
-.B fork( )
-.SH DESCRIPTION
-.I Fork
-is the only way new processes are created.
-The new process's core image is a copy of
-that of the caller of
-.IR fork .
-The only distinction
-is the fact
-that the value returned in the old (parent) process
-contains the process ID
-of the new (child) process,
-while the value returned in the child is 0.
-Process ID's range from 1 to 30,000.
-This process ID is used by
-.IR wait (2).
-.PP
-Files open before the fork
-are shared, and have a common read-write pointer.
-In particular,
-this is the way that standard input and output
-files are passed and also how
-pipes are set up.
-.SH "SEE ALSO"
-wait(2), exec(2)
-.SH DIAGNOSTICS
-Returns \-1 and fails to create a process if:
-there is inadequate swap space,
-the user is not super-user and has too many processes,
-or the system's process table is full.
-Only the super-user can take the last process-table slot.
-.SH ASSEMBLER
-(fork = 2.)
-.br
-.B sys fork
-.br
-(new process return)
-.br
-(old process return, new process ID in r0)
-.PP
-The return locations in the old and new process
-differ by one word.
-The C-bit is set in the old process if a new
-process could not be created.
diff --git a/.ref-Research-V7/usr/man/man2/getpid.2 b/.ref-Research-V7/usr/man/man2/getpid.2
deleted file mode 100644 (file)
index 41d0831..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-.TH GETPID 2 
-.SH NAME
-getpid  \-  get process identification
-.SH SYNOPSIS
-.B getpid( )
-.SH DESCRIPTION
-.I Getpid
-returns
-the process ID of
-the current process.
-Most often it is used to generate
-uniquely-named
-temporary files.
-.SH "SEE ALSO"
-mktemp(3)
-.SH ASSEMBLER
-(getpid = 20.)
-.br
-.B sys getpid
-.br
-(pid in r0)
diff --git a/.ref-Research-V7/usr/man/man2/getuid.2 b/.ref-Research-V7/usr/man/man2/getuid.2
deleted file mode 100644 (file)
index 4b22144..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-.TH GETUID 2 
-.SH NAME
-getuid, getgid, geteuid, getegid \- get user and group identity
-.SH SYNOPSIS
-.B getuid( )
-.PP
-.B geteuid( )
-.PP
-.B getgid( )
-.PP
-.B getegid( )
-.SH DESCRIPTION
-.I Getuid
-returns the real user ID of the current process,
-.I geteuid
-the effective user ID.
-The real user ID identifies the person who is logged in,
-in contradistinction to the effective user ID, which
-determines his access permission at the moment.
-It is thus useful to programs which operate using
-the `set user ID' mode, to find out who invoked them.
-.PP
-.I Getgid
-returns the real group ID,
-.I getegid
-the effective group ID.
-.SH "SEE ALSO"
-setuid(2)
-.SH ASSEMBLER
-(getuid = 24.)
-.br
-.B sys getuid
-.br
-(real user ID in r0, effective user ID in r1)
-.PP
-(getgid = 47.)
-.br
-.B sys getgid
-.br
-(real group ID in r0, effective group ID in r1)
diff --git a/.ref-Research-V7/usr/man/man2/indir.2 b/.ref-Research-V7/usr/man/man2/indir.2
deleted file mode 100644 (file)
index 5270aab..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-.TH INDIR 2 
-.SH NAME
-indir \- indirect system call
-.SH ASSEMBLER
-(indir = 0.)
-.br
-.B sys indir; call
-.PP
-The system call at the location
-.I call
-is executed.
-Execution resumes after the
-.I indir
-call.
-.PP
-The main purpose of
-.I indir
-is to allow a program to
-store arguments in system calls and execute them
-out of line in the data segment.
-This preserves the purity of the text segment.
-.PP
-If
-.I indir
-is executed indirectly,
-it is a no-op.
-If the instruction at the indirect
-location is not a system call,
-.I indir
-returns error code EINVAL;
-see
-.IR intro (2).
diff --git a/.ref-Research-V7/usr/man/man2/intro.2 b/.ref-Research-V7/usr/man/man2/intro.2
deleted file mode 100644 (file)
index b3c3440..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-.TH INTRO 2 
-.de en
-.HP
-\\$1  \\$2  \\$3
-.br
-..
-.SH NAME
-intro, errno \- introduction to system calls and error numbers
-.SH SYNOPSIS
-.B #include <errno.h>
-.SH DESCRIPTION
-Section 2 of this manual
-lists all the entries into the system.
-Most of these calls have an error return.
-.pg
-An error condition is indicated by an otherwise
-impossible returned value.
-Almost always this is \(mi1;
-the individual sections specify the details.
-An error number is also made available
-in the external variable
-.IR errno .
-.I Errno
-is not cleared on successful calls, so it should be tested only
-after an error has occurred.
-.PP
-There is a table of messages
-associated with each error, and a routine for printing the
-message;
-See
-.IR perror (3).
-The possible error numbers
-are not recited with each writeup in section 2, since many
-errors are possible for most of the calls.
-Here is a list of the error numbers,
-their names as defined in <errno.h>,
-and the messages available using
-.IR perror .
-.en 0 \h'\w'EIO'u' "Error 0
-Unused.
-.en 1 EPERM "Not owner
-Typically this error indicates
-an attempt to modify a file in some way forbidden
-except to its owner or super-user.
-It is also returned for attempts
-by ordinary users to do things
-allowed only to the super-user.
-.en 2 ENOENT "No such file or directory
-This error occurs when a file name is specified
-and the file should exist but doesn't, or when one
-of the directories in a path name does not exist.
-.en 3 ESRCH "No such process
-The process whose number was given to
-.I signal
-and
-.I ptrace
-does not exist, or is already dead.
-.en 4 EINTR "Interrupted system call
-An asynchronous signal (such as interrupt or quit),
-which the user has elected to catch,
-occurred during a system call.
-If execution is resumed
-after processing the signal,
-it will appear as if the interrupted system call
-returned this error condition.
-.en 5 EIO "I/O error
-Some physical I/O error occurred during a
-.I read
-or
-.IR write .
-This error may in some cases occur
-on a call following the one to which it actually applies.
-.en 6 ENXIO "No such device or address
-I/O on a special file refers to a subdevice that does not
-exist,
-or beyond the limits of the device.
-It may also occur when, for example, a tape drive
-is not dialled in or no disk pack is loaded on a drive.
-.en 7 E2BIG "Arg list too long
-An argument list longer than 5120 bytes
-is presented to
-.IR exec .
-.en 8 ENOEXEC "Exec format error
-A request is made to execute a file
-which, although it has the appropriate permissions,
-does not start with a valid magic number, see
-.IR a.out (5).
-.en 9 EBADF "Bad file number
-Either a file descriptor refers to no
-open file,
-or a read (resp. write) request is made to
-a file that is open only for writing (resp. reading).
-.en 10 ECHILD "No children
-.I Wait
-and the process has no
-living or unwaited-for children.
-.en 11 EAGAIN "No more processes
-In a
-.I fork,
-the system's process table is full
-or the user is not allowed to create any more
-processes.
-.en 12 ENOMEM "Not enough core
-During an
-.I exec
-or
-.I break,
-a program asks for more core than the system is able to supply.
-This is not a temporary condition; the maximum core size
-is a system parameter.
-The error may also occur if the arrangement
-of text, data, and stack segments
-requires too many segmentation registers.
-.en 13 EACCES "Permission denied
-An attempt was made to access a file in a way forbidden
-by the protection system.
-.en 14 EFAULT "Bad address
-The system encountered a hardware fault in attempting to
-access the arguments of a system call.
-.en 15 ENOTBLK "Block device required
-A plain file was mentioned where a block device was required,
-e.g. in
-.IR mount .
-.en 16 EBUSY "Mount device busy
-An attempt to mount a device that was already mounted or
-an attempt was made to dismount a device
-on which there is an active file
-(open file, current directory, mounted-on file, active text segment).
-.en 17 EEXIST "File exists
-An existing file was mentioned in an inappropriate context,
-e.g.
-.IR link .
-.en 18 EXDEV "Cross-device link
-A link to a file on another device
-was attempted.
-.en 19 ENODEV "No such device
-An attempt was made to apply an inappropriate
-system call to a device;
-e.g. read a write-only device.
-.en 20 ENOTDIR "Not a directory
-A non-directory was specified where a directory
-is required,
-for example in a path name or
-as an argument to
-.IR chdir .
-.en 21 EISDIR "Is a directory
-An attempt to write on a directory.
-.en 22 EINVAL "Invalid argument
-Some invalid argument:
-dismounting a non-mounted
-device,
-mentioning an unknown signal in
-.I signal,
-reading or writing a file for which
-.I seek
-has generated a negative pointer.
-Also set by math functions, see 
-.IR intro (3).
-.en 23 ENFILE "File table overflow
-The system's table of open files is full,
-and temporarily no more
-.I opens
-can be accepted.
-.en 24 EMFILE "Too many open files
-Customary configuration limit is 20 per process.
-.en 25 ENOTTY "Not a typewriter
-The file mentioned in
-.I stty
-or
-.I gtty
-is not a terminal or one of the other
-devices to which these calls apply.
-.en 26 ETXTBSY "Text file busy
-An attempt to execute a pure-procedure
-program that is currently open for writing
-(or reading!).
-Also an attempt to open for writing a pure-procedure
-program that is being executed.
-.en 27 EFBIG "File too large
-The size of a file exceeded the maximum (about
-.if t 10\u\s-29\s+2\d
-.if n 1.0E9
-bytes).
-.en 28 ENOSPC "No space left on device
-During a
-.I write
-to an ordinary file,
-there is no free space left on the device.
-.en 29 ESPIPE "Illegal seek
-An
-.I lseek
-was issued to a pipe.
-This error should also be issued for
-other non-seekable devices.
-.en 30 EROFS "Read-only file system
-An attempt to modify a file or directory
-was made
-on a device mounted read-only.
-.en 31 EMLINK "Too many links
-An attempt to make more than 32767 links to a file.
-.en 32 EPIPE "Broken pipe
-A write on a pipe for which there is no process
-to read the data.
-This condition normally generates a signal;
-the error is returned if the signal is ignored.
-.en 33 EDOM "Math argument
-The argument of a function in the math package (3M)
-is out of the domain of the function.
-.en 34 ERANGE "Result too large
-The value of a function in the math package (3M)
-is unrepresentable within machine precision.
-.SH SEE ALSO
-intro(3)
-.SH ASSEMBLER
-.B as /usr/include/sys.s file ...
-.PP
-The PDP11 assembly language interface is given for each
-system call.
-The assembler symbols are defined in `/usr/include/sys.s'.
-.PP
-Return values appear in registers r0 and r1;
-it is unwise to count on these registers being preserved
-when no value is expected.
-An erroneous call is always
-indicated by turning on the c-bit of the condition codes.
-The error number is returned in r0.
-The presence of an error is most easily tested
-by the instructions
-.I bes
-and
-.I bec
-(`branch on error set (or clear)').
-These are synonyms for
-the
-.I bcs
-and
-.I bcc
-instructions.
-.PP
-On the Interdata 8/32, the system call arguments
-correspond well to the arguments of the C routines.
-The sequence is:
-.IP
-.nf
-la     %2,errno
-l      %0,&callno
-svc    0,args
-.fi
-.PP
-Thus register 2 points to a word into which the error number will be
-stored as needed; it is cleared if no error occurs.
-Register 0 contains the system call number; the nomenclature
-is identical to that on the PDP11.
-The argument of the
-.I svc
-is the address of the arguments, laid out in storage
-as in the C calling sequence.
-The return value is in register 2 (possibly 3 also, as in
-.IR pipe )
-and is \-1 in case of error.
-The overflow bit in the program status word is also
-set when errors occur.
diff --git a/.ref-Research-V7/usr/man/man2/ioctl.2 b/.ref-Research-V7/usr/man/man2/ioctl.2
deleted file mode 100644 (file)
index 5c20d1c..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-.TH IOCTL 2 
-.SH NAME
-ioctl, stty, gtty \- control device
-.SH SYNOPSIS
-.B #include <sgtty.h>
-.PP
-.B ioctl(fildes, request, argp)
-.br
-.B struct sgttyb *argp;
-.PP
-.B stty(fildes, argp)
-.br
-.B struct sgttyb *argp;
-.PP
-.B gtty(fildes, argp)
-.br
-.B struct sgttyb *argp;
-.SH DESCRIPTION
-.I Ioctl
-performs a variety of functions
-on character special files (devices).
-The writeups of various devices
-in section 4 discuss how
-.I ioctl
-applies to them.
-.PP
-For certain status setting and status inquiries
-about terminal devices, the functions
-.I stty
-and
-.I gtty
-are equivalent to
-.RS
-.B ioctl(fildes, TIOCSETP, argp)
-.br
-.B ioctl(fildes, TIOCGETP, argp)
-.RE
-.LP
-respectively; see
-.IR tty (4).
-.PP
-The following two calls, however, apply to any open file:
-.PP
-.RS
-.B ioctl(fildes, FIOCLEX, NULL);
-.br
-.B ioctl(fildes, FIONCLEX, NULL);
-.RE
-.LP
-The first causes the file to be closed automatically during
-a successful
-.I exec
-operation;
-the second reverses the effect of the first.
-.SH "SEE ALSO"
-stty(1), tty(4), exec(2)
-.SH DIAGNOSTICS
-Zero is returned if the call was successful;
-\-1 if the file descriptor does not refer to
-the kind of file for which it was intended.
-.SH BUGS
-Strictly speaking,
-since 
-.I ioctl
-may be extended in different ways to devices with
-different properties,
-.I argp
-should have an open-ended declaration like
-.IP
-.B union { struct sgttyb
-.RB ... ;
-\&...
-.B } *argp;
-.PP
-The important thing is that the size is fixed by `struct sgttyb'.
-.SH ASSEMBLER
-(ioctl = 54.)
-.br
-.B sys ioctl; fildes; request; argp
-.PP
-(stty = 31.)
-.br
-(file descriptor in r0)
-.br
-.B stty; argp
-.PP
-(gtty = 32.)
-.br
-(file descriptor in r0)
-.br
-.B sys gtty; argp
diff --git a/.ref-Research-V7/usr/man/man2/kill.2 b/.ref-Research-V7/usr/man/man2/kill.2
deleted file mode 100644 (file)
index 4546204..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-.TH KILL 2 
-.SH NAME
-kill  \-  send signal to a process
-.SH SYNOPSIS
-.B kill(pid, sig);
-.SH DESCRIPTION
-.I Kill
-sends the signal
-.I sig
-to the process specified by the
-process number in r0.
-See
-.IR signal (2)
-for a list of signals.
-.PP
-The sending and receiving processes must
-have the same effective user ID, otherwise
-this call is restricted to the super-user.
-.PP
-If the process number is 0,
-the signal is sent to all other processes in the
-sender's process group;
-see
-.IR tty (4).
-.PP
-If the process number is \-1, and the user is the super-user,
-the signal is broadcast universally
-except to processes 0 and 1, the scheduler
-and initialization processes,
-see
-.IR init (8).
-.PP
-Processes may send signals to themselves.
-.SH "SEE ALSO"
-signal(2), kill(1)
-.SH DIAGNOSTICS
-Zero is returned if the process is killed;
-\-1 is returned if the process does not
-have the same effective user ID and the
-user is not super-user, or if the process
-does not exist.
-.SH ASSEMBLER
-(kill = 37.)
-.br
-(process number in r0)
-.br
-.B sys kill; sig
diff --git a/.ref-Research-V7/usr/man/man2/link.2 b/.ref-Research-V7/usr/man/man2/link.2
deleted file mode 100644 (file)
index 9b39a1f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH LINK 2 
-.SH NAME
-link \- link to a file
-.SH SYNOPSIS
-.B link(name1, name2)
-.br
-.B char *name1, *name2;
-.SH DESCRIPTION
-A link
-to
-.I name1
-is created;
-the link has the name
-.IR name2 .
-Either name may be an arbitrary path name.
-.SH "SEE ALSO"
-ln(1), unlink(2)
-.SH DIAGNOSTICS
-Zero is returned when a link is made;
-\-1 is returned when
-.I name1
-cannot be found; when
-.I name2
-already exists; when the directory of
-.I name2
-cannot be written; when
-an attempt is made to link to a directory by a user
-other than the super-user;
-when an attempt is made to link
-to a file on another file system;
-when a file has too many links.
-.SH ASSEMBLER
-(link = 9.)
-.br
-.B sys link; name1; name2
diff --git a/.ref-Research-V7/usr/man/man2/lock.2 b/.ref-Research-V7/usr/man/man2/lock.2
deleted file mode 100644 (file)
index eb5fe28..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-.TH LOCK 2 local
-.SH NAME
-lock \- lock a process in primary memory
-.SH SYNOPSIS
-.B lock(flag)
-.SH DESCRIPTION
-If the
-.I flag
-argument is non-zero,
-the process executing this call
-will not be swapped except if it is required
-to grow.
-If the argument is zero,
-the process is
-.RI un lock ed.
-This call may only be executed by
-the super-user.
-.SH BUGS
-.IR Lock ed
-processes interfere with the compaction of primary memory
-and can cause deadlock.
-This system call is not considered
-a permanent part of the system.
-.SH ASSEMBLER
-(lock = 53.)
-.br
-.B sys lock; flag
diff --git a/.ref-Research-V7/usr/man/man2/lseek.2 b/.ref-Research-V7/usr/man/man2/lseek.2
deleted file mode 100644 (file)
index a161a6b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.TH LSEEK 2 
-.SH NAME
-lseek, tell \- move read/write pointer
-.SH SYNOPSIS
-.B long lseek(fildes, offset, whence)
-.br
-.B long offset;
-.PP
-.B long tell(fildes)
-.SH DESCRIPTION
-The file
-descriptor refers to a file open for reading or writing.
-The read (resp. write) pointer for the file is set as follows:
-.IP
-If
-.I whence
-is 0, the pointer is set to
-.I offset
-bytes.
-.IP
-If
-.I whence
-is 1, the pointer is set to its current location plus
-.IR offset .
-.IP
-If
-.I whence
-is 2, the pointer is set to the size of the
-file plus
-.IR offset .
-.PP
-The returned value is the resulting pointer location.
-.PP
-The obsolete function
-.IR tell ( fildes )
-is identical to
-.IR lseek ( "fildes, 0L, 1" ).
-.PP
-Seeking far beyond the end of a file, then writing,
-creates a gap or `hole', which occupies no
-physical space and reads as zeros.
-.SH "SEE ALSO"
-open(2), creat(2), fseek(3)
-.SH DIAGNOSTICS
-\-1
-is returned for
-an undefined file descriptor,
-seek on a pipe,
-or seek to a position before the beginning of file.
-.SH BUGS
-.I Lseek
-is a no-op on character special files.
-.SH ASSEMBLER
-(lseek = 19.)
-.br
-(file descriptor in r0)
-.br
-.B sys lseek; offset1; offset2; whence
-.PP
-.I Offset1
-and
-.I offset2
-are the high and low words of 
-.IR offset ;
-r0 and r1 contain
-the pointer upon return.
diff --git a/.ref-Research-V7/usr/man/man2/mknod.2 b/.ref-Research-V7/usr/man/man2/mknod.2
deleted file mode 100644 (file)
index f968f23..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH MKNOD 2 
-.SH NAME
-mknod \- make a directory or a special file
-.SH SYNOPSIS
-.B mknod(name, mode, addr)
-.br
-.B char *name;
-.SH DESCRIPTION
-.I Mknod
-creates a new file
-whose name is the null-terminated string pointed
-to by
-.IR name .
-The mode of the new file
-(including directory and special file bits)
-is initialized from
-.IR mode .
-(The protection part of the mode
-is modified by the process's mode mask; see
-.IR umask (2)).
-The first block pointer of the i-node
-is initialized from
-.IR addr .
-For ordinary files and directories
-.I addr
-is normally zero.
-In the case of a special file,
-.I addr
-specifies which special file.
-.PP
-.I Mknod
-may be invoked only by the super-user.
-.SH "SEE ALSO"
-mkdir(1), mknod(1), filsys(5)
-.SH DIAGNOSTICS
-Zero is returned if the file has been made; \-1
-if the file already exists
-or if the user is not the super-user.
-.SH ASSEMBLER
-(mknod = 14.)
-.br
-.B sys  mknod; name; mode; addr
diff --git a/.ref-Research-V7/usr/man/man2/mount.2 b/.ref-Research-V7/usr/man/man2/mount.2
deleted file mode 100644 (file)
index 4affb4c..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-.TH MOUNT 2 
-.SH NAME
-mount, umount \- mount or remove file system
-.SH SYNOPSIS
-.B mount(special, name, rwflag)
-.br
-.B char *special, *name;
-.PP
-.B umount(special)
-.br
-.B char *special;
-.SH DESCRIPTION
-.I Mount
-announces to the system that a removable file system has
-been mounted on
-the block-structured special file
-.I special;
-from now on, references to file
-.I name
-will refer to
-the root file on the newly mounted file system.
-.I Special
-and
-.I name
-are pointers to null-terminated strings
-containing the appropriate path names.
-.PP
-.I Name
-must exist already. 
-.I Name
-must be a directory (unless the root of the mounted file system
-is not a directory).
-Its old contents
-are inaccessible while the file system
-is mounted.
-.PP
-The
-.I rwflag
-argument determines whether
-the file system can be written on; if it is 0 writing
-is allowed, if non-zero no writing is done.
-Physically write-protected and magnetic
-tape file systems must be mounted read-only or
-errors will occur when access times are updated,
-whether or not any
-explicit write is attempted.
-.PP
-.I Umount
-announces to the system that the
-.I special
-file is no longer to contain a removable file system.
-The associated file reverts to its ordinary interpretation.
-.SH "SEE ALSO"
-mount(1)
-.SH DIAGNOSTICS
-.I Mount
-returns 0 if the action occurred; \-1 if
-.I special
-is inaccessible or not an appropriate file; if
-.I name
-does not exist; if
-.I special
-is already mounted; if
-.I name
-is in use; or if
-there are already too many
-file systems mounted.
-.PP
-.I Umount
-returns 0 if the action occurred; \-1 if
-if the special file is inaccessible or
-does not have a mounted file system,
-or if there are active files in the mounted 
-file system.
-.SH ASSEMBLER
-(mount = 21.)
-.br
-.B sys  mount; special; name; rwflag
-.PP
-(umount = 22.)
-.br
-.B sys  umount; special
diff --git a/.ref-Research-V7/usr/man/man2/mpx.2 b/.ref-Research-V7/usr/man/man2/mpx.2
deleted file mode 100644 (file)
index 4efa812..0000000
+++ /dev/null
@@ -1,495 +0,0 @@
-.TH MPX 2 
-.SH NAME
-mpx \- create and manipulate multiplexed files
-.SH SYNOPSIS
-.B mpx(name, access)
-.B char *name;
-.PP
-.B join(fd, xd)
-.PP
-.B chan(xd)
-.PP
-.B extract(i, xd)
-.PP
-.B attach(i, xd)
-.PP
-.B detach(i, xd)
-.PP
-.B connect(fd, cd, end)
-.PP
-.B npgrp(i, xd, pgrp)
-.PP
-.B ckill(i, xd, signal)
-.PP
-.B #include <sys/mx.h>
-.br
-.B mpxcall(cmd, vec)
-.br
-.B int *vec;
-.SH DESCRIPTION
-.PP
-.B mpxcall(cmd, vec)
-is the system call shared by the 
-library routines described below.
-.I Cmd
-selects a command using values
-defined in
-.IR <sys/mx.h> .
-.I Vec
-is the address of a
-structure containing the arguments
-for the command.
-.PP
-.B mpx(name, access)
-.PP
-.I Mpx
-creates and opens the file 
-.I name
-with access permission
-.I access
-(see
-.IR creat (2))
-and returns a file descriptor available for
-reading and writing.
-A \-1 is returned if the file cannot be created,
-if
-.I name
-already exists, or
-if the file table or other operating system
-data structures are full.
-The file descriptor is required for use
-with other routines.
-.PP
-If
-.I name
-designates a null string,
-a file descriptor is returned as described
-but no entry is created in the file system.
-.PP
-Once created an mpx file may be opened
-(see
-.IR open (2))
-by any process.
-This provides a form of interprocess communication
-whereby a process B can `call' process A
-by opening an mpx file 
-created by A.
-To B, the file is ordinary with one exception:
-the
-.I connect
-primitive could be applied to it.
-Otherwise the functions
-described below are used only in process A
-and descendants that inherit the open mpx file.
-.PP
-When a process opens an mpx file, the owner of the
-file receives a control message when the file is next read.
-The method for `answering' 
-this kind of call involves 
-using
-.I attach
-and
-.I detach
-as described in more detail below.
-.PP
-Once B has opened A's mpx file
-it is said to have a
-.I channel
-to A.
-A channel is a pair of data streams:
-in this case, one from B to A and the
-other from A to B.
-Several processes may open the same mpx file
-yielding multiple channels within the one mpx file.
-By accessing the appropriate channel,
-A can communicate with B and any others.
-When A reads (see
-.IR read (2))
-from the mpx file
-data written to A by the other processes appears
-in A's buffer using a record format
-described in
-.IR mpxio (5).
-When A writes (see
-.IR write (2))
-on its mpx file the data must be formatted in a similar way.
-.PP
-The following commands
-are used to manipulate mpx files and channels.
-.IP
-.IR join \-
-adds a new channel on an mpx file to an open file F.
-I/O on the new channel is I/O on F.
-.br
-.IR chan \-
-creates a new channel.
-.br
-.IR extract \-
-file descriptor maintenance.
-.br
-.IR connect \-
-similar to join except that the open file F is connected
-to an existing channel.
-.br
-.I attach
-and
-.IR detach \-
-used with call protocol.
-.br
-.IR npgrp \-
-manipulates process group numbers so that a channel
-can act as a control terminal (see
-.IR tty (4)).
-.br
-.IR ckill \-
-send signal (see
-.IR signal (2))
-to process group through channel.
-.PP
-A maximum of 15 channels may be connected to an
-mpx file.
-They are numbered 0 through 14.
-.I Join
-may be used to make one mpx file appear as a channel
-on another mpx file.
-A hierarchy or tree of mpx files may be set up in this way.
-In this case
-one of the mpx files must be the root of a tree
-where the other mpx files are interior nodes.
-The maximum depth of such a tree
-is 4.
-.PP
-An
-.I index
-is a 16-bit value
-that denotes a location
-in an mpx tree other than the root:
-the path through mpx `nodes' from the root
-to the location is expressed as a sequence of
-4-bit nibbles.
-The branch taken at the root is represented by
-the low-order 4-bits of an index.
-Each succeeding branch is specified by the next
-higher-order nibble.
-If the length of a path to be expressed
-is less than 4,
-then the illegal channel number, 15,
-must be used to terminate the sequence.
-This is not strictly necessary for the
-simple case of a tree consisting of
-only a root node: its channels
-can be expressed by the numbers
-0 through 14.
-An index
-.I i
-and file descriptor
-.I xd
-for the root of an mpx tree are
-required as arguments to most
-of the commands described below.
-Indices also serve as channel identifiers
-in the record formats given in
-.IR mpxio (5).
-Since -1 is not a valid index,
-it can be returned as a error indication
-by subroutines that normally return
-indices.
-.PP
-The operating system informs the process managing an mpx file
-of changes in the status of channels attached to the file
-by generating messages that
-are read along with data from the channels.
-The form and content of these messages is described
-in
-.IR mpxio (5).
-.PP
-.B join(fd, xd)
-establishes a connection (channel) between an mpx file
-and another object.
-.I Fd
-is an open file descriptor for a character device
-or an mpx file and
-.I xd
-is the file descriptor of an
-mpx file.
-.I Join
-returns the index for the new channel
-if the operation succeeds and \-1
-if it does not.
-.PP
-Following  join,
-.I fd
-may still be used in any system call that would
-have been meaningful before the join operation.
-Thus
-a process can read and write directly to
-.I fd
-as well as access it via
-.I xd.
-If the number of channels
-required for a tree of mpx files
-exceeds the number of open files
-permitted a process by the operating system,
-some of the file descriptors can be released using
-the standard  
-.IR close (2)
-call.
-Following a close on an active file descriptor for a channel
-or internal mpx node,
-that object may still be accessed through the root of the
-tree.
-.PP
-.B chan(xd)
-allocates a channel and connects
-one end of it to the mpx file
-represented by file descriptor
-.I xd.
-.I Chan
-returns the index of the new channel or
-a \-1 indicating failure.
-The
-.I extract
-primitive can be used to get a non-multiplexed
-file descriptor for the free end of a channel
-created by
-.I chan.
-.PP
-Both
-.I chan
-and
-.I join
-operate on the mpx file specified by
-.IR xd .
-File descriptors for interior nodes of an
-mpx tree must be preserved or reconstructed with
-.I extract
-for use with
-.I join
-or
-.IR chan .
-For the remaining commands described here,
-.I xd
-denotes the file descriptor for the
-root of an mpx tree.
-.PP
-.B Extract(i, xd)
-returns a file descriptor for the object with
-index
-.I i
-on the mpx tree with root file descriptor
-.I xd.
-A \-1 is returned by extract if a file descriptor is not available
-or if the arguments do not refer to an existing
-channel and mpx file.
-.PP
-.B attach(i, xd)
-.br
-.BR "detach(i, xd)" .
-If a process A has created an mpx file represented
-by file descriptor
-.I xd,
-then a process B
-can open (see
-.IR open (2))
-the mpx file.
-The purpose is to establish a channel between
-A and B through the mpx file.
-.I Attach
-and 
-.I Detach
-are used by A to respond to
-such opens.
-.PP
-An open request by B fails immediately if a 
-new channel cannot be allocated on the mpx file,
-if the mpx file does not exist,
-or if it does exist
-but there is no process (A)
-with a multiplexed file descriptor
-for the mpx file
-(i.e.
-.I xd
-as returned by
-.IR mpx (2)).
-Otherwise a channel
-with index number
-.I i
-is allocated.
-The next time A reads on file descriptor
-.IR xd ,
-the WATCH control message
-(see
-.IR mpxio (5))
-will be delivered on channel
-.I i.
-A  responds to this message with
-.I attach
-or 
-.I detach.
-The former causes the open to complete and
-return a file descriptor to B.
-The latter deallocates channel
-.I i
-and causes the open to fail.
-.PP
-One mpx file may be placed in `listener' mode.
-This is done by writing
-.I "ioctl(xd, MXLSTN, 0)"
-where
-.I xd
-is an mpx file descriptor
-and MXLSTN is defined in 
-.IR /usr/include/sgtty.h .
-The semantics of listener mode are that
-all file names discovered by 
-.IR open (2)
-to have 
-the syntax
-.I "system!pathname"
-(see
-.IR uucp (1))
-are treated as opens on the mpx file.
-The operating system sends the listener process 
-an OPEN message (see
-.IR mpxio (5))
-which includes the file name being opened.
-.I Attach
-and
-.I detach
-then apply as described above.
-.PP
-.I Detach
-has two other uses:
-it closes and releases the resources
-of any active channel it is applied to,
-and should be used to respond to
-a CLOSE message (see
-.IR mpxio (5))
-on a channel so the channel may be reused.
-.PP
-.BR "connect(fd, cd, end)" .
-.I Fd
-is a character file descriptor and
-.I cd
-is a file descriptor for a channel,
-such as might be obtained via
-.I "extract( chan(xd), xd)"
-or by
-.IR open (2)
-followed by
-.I attach.
-.I Connect
-splices the two streams together.
-If
-.I end
-is negative, only
-the output of
-.I fd
-is spliced to the input of
-.I cd.
-If
-.I end
-is positive, the output of
-.I cd
-is spliced to the input of
-.I fd.
-If
-.I end
-is zero, then both splices are made.
-.PP
-.BR "npgrp(i, xd, pgrp)" .
-If
-.I xd
-is negative
-.I npgrp
-applies to the process executing it,
-otherwise
-.I i
-and
-.I xd
-are interpreted as a channel index and
-mpx file descriptor
-and
-.I npgrp
-is applied to the process on the
-non-multiplexed end of the channel.
-If
-.I pgrp
-is zero, the process group number of the indicated process
-is set to the process number of that process,
-otherwise the value of
-.I pgrp
-is used as the process group number.
-.PP
-.I Npgrp
-normally returns the new process group number.
-If
-.I i
-and
-.I xd
-specify  a nonexistant channel,
-.I npgrp
-returns \-1.
-.PP
-.B ckill(i, xd, signal)
-sends the specified signal (see
-.IR signal (2))
-through the channel specified by
-.I i
-and
-.I xd.
-If the channel is connected to anything other
-than a process,
-.I ckill
-is a null operation.
-If there is a process at the other end of the channel,
-the process group will be interrupted (see
-.IR signal (2),
-.IR kill (2)).
-.I Ckill
-normally returns 
-.I signal.
-If
-.I ch
-and
-.I xd
-specify a nonexistent channel,
-.I ckill
-returns \-1.
-.SH FILES
-/usr/include/sys/mx.h
-.br
-/usr/include/sgtty.h
-.SH "SEE ALSO"
-mpxio(5)
-.SH BUGS
-.PP
-Mpx files are an experimental part of the operating
-system more subject to change and prone to bugs
-than other parts.
-Maintenance programs, e.g.
-.IR icheck (1),
-diagnose mpx files as  an illegal mode.
-Channels may only be connected to objects in the operating
-system that are accessible through the line discipline
-mechanism.
-Higher performace line disciplines are needed.
-The maximum tree depth restriction is not really checked.
-A non-destructive
-.I disconnect
-primitive (inverse of
-.IR connect )
-is not provided.
-A non-blocking flow control strategy
-based on messages defined in
-.IR mpxio (5)
-should not be attempted by novices;
-the enabling
-.I ioctl
-command should be protected.
-The
-.I join
-operation could be subsumed by
-.I connect.
-A mechanism is needed for moving a channel from one
-location in an mpx tree to another.
diff --git a/.ref-Research-V7/usr/man/man2/mpxcall.2 b/.ref-Research-V7/usr/man/man2/mpxcall.2
deleted file mode 100644 (file)
index b32f577..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH MPXCALL 2
-.SH NAME
-mpxcall \- multiplexor and channel interface
-.SH SYNOPSIS
-.B mpxcall(arg1, arg2, arg3, cmd)
-.SH DESCRIPTION
-.I Mpxcall
-supplies a primitive interface to the kernel
-used by the routines listed below.
-Each routine that uses
-.I mpxcall
-passes an integer
-.I cmd
-as the fourth argument.
-These are defined in
-.I /usr/include/mx.h.
-.I Mpxcall
-always returns an integer which is to be interpreted
-in accordance with the definition of
-.I cmd.
-.SH "SEE ALSO"
-group(2), join(2), extract(2), connect(2), chan(2), attach(2), detach(2)
-.SH DIAGNOSTICS
-The value \-1 is returned on error.
diff --git a/.ref-Research-V7/usr/man/man2/nice.2 b/.ref-Research-V7/usr/man/man2/nice.2
deleted file mode 100644 (file)
index 04fb86c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-.TH NICE 2 
-.SH NAME
-nice \- set program priority
-.SH SYNOPSIS
-.B nice(incr)
-.SH DESCRIPTION
-The scheduling
-priority of the process is augmented by
-.IR incr .
-Positive priorities get less
-service than normal.
-Priority 10 is recommended to users
-who wish to execute long-running programs
-without flak from the administration.
-.PP
-Negative increments are ignored except on behalf of 
-the super-user.
-The priority is limited to the range
-\-20 (most urgent) to 20 (least).
-.PP
-The priority of a process is
-passed to a child process by
-.IR fork (2).
-For a privileged process to return to normal priority
-from an unknown state,
-.I nice
-should be called successively with arguments
-\-40 (goes to priority \-20 because of truncation),
-20 (to get to 0),
-then 0 (to maintain compatibility with previous versions
-of this call).
-.SH "SEE ALSO"
-nice(1)
-.SH ASSEMBLER
-(nice = 34.)
-.br
-(priority in r0)
-.br
-.B sys nice
diff --git a/.ref-Research-V7/usr/man/man2/open.2 b/.ref-Research-V7/usr/man/man2/open.2
deleted file mode 100644 (file)
index 25571cf..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH OPEN 2 
-.SH NAME
-open \- open for reading or writing
-.SH SYNOPSIS
-.B open(name, mode)
-.br
-.B char *name;
-.SH DESCRIPTION
-.I Open
-opens the file
-.I name
-for reading
-(if
-.I mode
-is 0),
-writing (if
-.I mode
-is 1) or for both reading and writing
-(if
-.I mode
-is 2).
-.I Name
-is the address of a string of ASCII characters representing
-a path name, terminated by a null character.
-.PP
-The file is positioned at the beginning (byte 0).
-The returned file descriptor must be used for subsequent calls
-for other input-output functions on the file.
-.SH "SEE ALSO"
-creat(2), read(2), write(2), dup(2), close(2)
-.SH DIAGNOSTICS
-The value \-1 is returned
-if the file does not exist,
-if one of the necessary directories
-does not exist or is unreadable, if the file is not
-readable (resp. writable), or if too many files are open.
-.SH ASSEMBLER
-(open = 5.)
-.br
-.B sys open; name; mode
-.br
-(file descriptor in r0)
diff --git a/.ref-Research-V7/usr/man/man2/pause.2 b/.ref-Research-V7/usr/man/man2/pause.2
deleted file mode 100644 (file)
index 0ef5b9d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-.TH PAUSE 2 
-.SH NAME
-pause \- stop until signal
-.SH SYNOPSIS
-.B pause( )
-.SH DESCRIPTION
-.I Pause
-never returns normally.
-It is used to give up control while waiting for
-a signal from
-.IR kill (2)
-or
-.IR alarm (2).
-.SH SEE ALSO
-kill(1), kill(2), alarm(2), signal(2), setjmp(3)
-.SH ASSEMBLER
-(pause = 29.)
-.br
-.B sys pause
diff --git a/.ref-Research-V7/usr/man/man2/phys.2 b/.ref-Research-V7/usr/man/man2/phys.2
deleted file mode 100644 (file)
index a95823d..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-.TH PHYS 2 PDP11
-.SH NAME
-phys \- allow a process to access physical addresses
-.SH SYNOPSIS
-.B phys(segreg, size, physadr)
-.SH DESCRIPTION
-The argument
-.I segreg
-specifies a process virtual (data-space) address
-range of 8K bytes starting
-at virtual address
-.IR segreg \(mu8K
-bytes.
-This address range is mapped into
-physical address
-.IR physadr \(mu64
-bytes.
-Only the first
-.IR size \(mu64
-bytes of this mapping is addressable.
-If
-.I size
-is zero,
-any previous mapping of this
-virtual address range is nullified.
-For example,
-the call
-.PP
-       phys(6, 1, 0177775);
-.PP
-will map virtual addresses 0160000-0160077 into
-physical addresses 017777500-017777577.
-In particular,
-virtual address 0160060 is the PDP-11 console
-located at physical address 017777560.
-.PP
-This call may only be executed by the super-user.
-.SH "SEE ALSO"
-PDP-11 segmentation hardware
-.SH DIAGNOSTICS
-The function value zero is returned if
-the physical mapping is in effect.
-The value \-1 is returned
-if not super-user,
-if
-.I segreg
-is not in the range 0-7,
-if
-.I size
-is not in the range 0-127,
-or if
-the specified
-.I segreg
-is already used for other than
-a previous call to
-.IR phys .
-.SH BUGS
-This system call is obviously very machine
-dependent and very dangerous.
-This system call is not considered
-a permanent part of the system.
-.SH ASSEMBLER
-(phys = 52.)
-.br
-.B sys phys; segreg; size; physadr
diff --git a/.ref-Research-V7/usr/man/man2/pipe.2 b/.ref-Research-V7/usr/man/man2/pipe.2
deleted file mode 100644 (file)
index 0499160..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH PIPE 2 
-.SH NAME
-pipe \- create an interprocess channel
-.SH SYNOPSIS
-.B pipe(fildes)
-.br
-.B int fildes[2];
-.SH DESCRIPTION
-The
-.I pipe
-system call
-creates an I/O mechanism called a pipe.
-The file descriptors returned can
-be used in read and write operations.
-When the pipe is written using the descriptor
-.IR fildes [1]
-up to 4096 bytes of data are buffered
-before the writing process is suspended.
-A read using the descriptor
-.IR fildes [0]
-will pick up the data.
-Writes with a count of 4096 bytes or less are atomic;
-no other process can intersperse data.
-.PP
-It is assumed that after the
-pipe has been set up,
-two (or more)
-cooperating processes
-(created by subsequent
-.I fork
-calls)
-will pass data through the
-pipe with
-.I read
-and
-.I write
-calls.
-.PP
-The Shell has a syntax
-to set up a linear array of processes
-connected by pipes.
-.PP
-Read calls on an empty
-pipe (no buffered data) with only one end
-(all write file descriptors closed)
-returns an end-of-file.
-.SH "SEE ALSO"
-sh(1), read(2), write(2), fork(2)
-.SH DIAGNOSTICS
-The function value zero is returned if the
-pipe was created; \-1 if
-too many files are already open.
-A signal is generated if a write on a pipe with only one end is attempted.
-.SH BUGS
-Should more than 4096 bytes be necessary in any
-pipe among a loop of processes, deadlock will occur.
-.SH ASSEMBLER
-(pipe = 42.)
-.br
-.B sys pipe
-.br
-(read file descriptor in r0)
-.br
-(write file descriptor in r1)
diff --git a/.ref-Research-V7/usr/man/man2/pkon.2 b/.ref-Research-V7/usr/man/man2/pkon.2
deleted file mode 100644 (file)
index b6c0757..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-.TH PKON 2
-.SH NAME
-pkon, pkoff \- establish packet protocol
-.SH SYNOPSIS
-.B pkon(fd, size)
-.PP
-.B pkoff(fd)
-.SH DESCRIPTION
-.I Pkon
-establishes packet protocol (see
-.IR pk (4))
-on the open character special file whose file
-descriptor is
-.I fd.
-.I Size
-is a desired packet size, a power of 2 in the range
-.RI 32\(<= size \(<=4096.
-The size is negotiated with a remote packet driver,
-and a possibly smaller actual packet size is returned.
-.PP
-An asynchronous line used for packet
-communication should be in raw mode;
-see
-.IR tty (4).
-.PP
-.I Pkoff
-turns off the packet driver on the channel whose
-file descriptor is
-.I fd.
-.SH SEE ALSO
-pk(4), pkopen(3), tty(4), signal(2)
-.SH DIAGNOSTICS
-.I Pkon
-returns \-1 if 
-.I fd
-does not describe an open file, or if
-packet communication cannot
-be established.
-.PP
-.I Pkoff
-returns \-1 for an unknown file descriptor.
-.PP
-Writing on a packet driver link that has been shut down
-by
-.I close
-or
-.I pkoff
-at the other end raises signal SIGPIPE
-in the writing process.
diff --git a/.ref-Research-V7/usr/man/man2/profil.2 b/.ref-Research-V7/usr/man/man2/profil.2
deleted file mode 100644 (file)
index 8410d38..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.TH PROFIL 2 
-.SH NAME
-profil \- execution time profile
-.SH SYNOPSIS
-.B profil(buff, bufsiz, offset, scale)
-.br
-.B char *buff;
-.br
-.B int bufsiz, offset, scale;
-.SH DESCRIPTION
-.I Buff
-points to an area of core whose length (in bytes) is given by
-.IR bufsiz .
-After this call, the user's program counter (pc)
-is examined each clock tick (60th second);
-.I offset
-is subtracted from it, and the result multiplied by
-.IR scale .
-If the resulting number corresponds to a word
-inside
-.I buff,
-that word is incremented.
-.PP
-The scale is interpreted as an unsigned,
-fixed-point fraction with binary point at the
-left: 0177777(8) gives a 1-1 mapping of pc's to words
-in
-.I buff;
-077777(8) maps each pair of instruction words
-together.
-02(8) maps all instructions onto the beginning of
-.I buff
-(producing a non-interrupting core clock).
-.PP
-Profiling is turned off by giving a
-.I scale
-of 0 or 1.
-It is rendered
-ineffective by giving a
-.I bufsiz
-of 0.
-Profiling is turned off when an
-.I exec
-is executed, but remains on in child and parent both
-after a
-.IR fork .
-Profiling may be turned off if an update in
-.I buff
-would cause a memory fault.
-.SH "SEE ALSO"
-monitor(3), prof(1)
-.SH ASSEMBLER
-(profil = 44.)
-.br
-.B sys profil; buff; bufsiz; offset; scale
diff --git a/.ref-Research-V7/usr/man/man2/ptrace.2 b/.ref-Research-V7/usr/man/man2/ptrace.2
deleted file mode 100644 (file)
index e0f5909..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-.TH PTRACE 2 
-.SH NAME
-ptrace  \-  process trace
-.SH SYNOPSIS
-#include <signal.h>
-.PP
-.B ptrace(request, pid, addr, data)
-.br
-.B int *addr;
-.SH DESCRIPTION
-.I Ptrace
-provides a means by which a parent process
-may control the execution of a child process,
-and examine and change its core image.
-Its primary use is for the implementation of breakpoint debugging.
-There are four arguments whose interpretation
-depends on a
-.I request
-argument.
-Generally,
-.I pid
-is the process ID of the traced process,
-which must be a child (no more distant descendant)
-of the tracing process.
-A process being traced
-behaves normally until it encounters some signal whether internally generated
-like `illegal instruction' or externally generated like `interrupt.'
-See
-.IR signal (2)
-for the list.
-Then the traced process enters a stopped state
-and its parent is notified via
-.IR  wait (2).
-When the child is in the stopped state,
-its core image can be examined and modified
-using
-.IR ptrace .
-If desired, another
-.I ptrace
-request can then cause the child either to terminate
-or to continue, possibly ignoring the signal.
-.PP
-The value of the
-.I request
-argument determines the precise
-action of the call:
-.TP 4
-0
-This request is the only one used by the child process;
-it declares that the process is to be traced by its parent.
-All the other arguments are ignored.
-Peculiar results will ensue
-if the parent does not expect to trace the child.
-.TP 4
-1,2
-The
-word in the child process's address space
-at
-.I addr
-is returned.
-If I and D space are separated, request 1 indicates I space,
-2 D space.
-.I Addr
-must be even.
-The child must be stopped.
-The input
-.I data
-is ignored.
-.TP 4
-3
-The word
-of the system's per-process data area corresponding to
-.I addr
-is returned.
-.I Addr
-must be even and less than 512.
-This space contains the registers and other information about
-the process;
-its layout corresponds to the
-.I user
-structure in the system.
-.TP 4
-4,5
-The
-given
-.I data
-is written at the word in the process's address space corresponding to
-.I addr,
-which must be even.
-No useful value is returned.
-If I and D space are separated, request 4 indicates I space, 
-5 D space.
-Attempts to write in pure procedure
-fail if another process is executing the same file.
-.TP 4
-6
-The process's system data is written,
-as it is read with request 3.
-Only a few locations can be written in this way:
-the general registers,
-the floating point status and registers,
-and certain bits of the processor status word.
-.TP 4
-7
-The
-.I data
-argument is taken as a signal number
-and the child's execution continues
-at location
-.I addr
-as if it had incurred that signal.
-Normally the signal number will be
-either 0 to indicate that the signal that caused the stop
-should be ignored,
-or that value fetched out of the
-process's image indicating which signal caused
-the stop.
-If
-.I addr
-is (int *)1 then execution continues from where it stopped.
-.TP 4
-8
-The traced process terminates.
-.TP 4
-9
-Execution continues as in request 7;
-however, as soon as possible after execution of at least one instruction,
-execution stops again.
-The signal number from the stop is
-SIGTRAP.
-(On the PDP-11 the T-bit is used and just one instruction
-is executed;
-on the Interdata the stop does not take place
-until a store instruction is executed.)
-This is part of the mechanism for implementing breakpoints.
-.PP
-As indicated,
-these calls
-(except for request 0)
-can be used only when the subject process has stopped.
-The
-.I wait
-call is used to determine
-when a process stops;
-in such a case the `termination' status
-returned by
-.I wait
-has the value 0177 to indicate stoppage rather
-than genuine termination.
-.PP
-To forestall possible fraud,
-.I ptrace
-inhibits the set-user-id facility
-on subsequent
-.IR  exec (2)
-calls.
-If a traced process calls
-.I exec,
-it will stop before executing the first instruction of the new image
-showing signal SIGTRAP.
-.PP
-On the Interdata 8/32,
-`word' means a 32-bit word and `even' means 0 mod 4.
-.SH "SEE ALSO"
-wait(2), signal(2), adb(1)
-.SH DIAGNOSTICS
-The value \-1 is returned if
-.I request 
-is invalid,
-.I pid
-is not a traceable process,
-.I addr
-is out of bounds,
-or
-.I data
-specifies an illegal signal number.
-.SH BUGS
-On the Interdata 8/32,
-`as soon as possible' (request 7)
-means `as soon as a store instruction has been executed.'
-.PP
-The request 0 call should be able to specify
-signals which are to be treated normally and not cause a stop.
-In this way, for example,
-programs with simulated floating point (which
-use `illegal instruction' signals at a very high rate)
-could be efficiently debugged.
-.br
-The error indication, \-1, is a legitimate function value;
-.I errno,
-see
-.IR intro (2),
-can be used to disambiguate.
-.PP
-It should be possible to stop a process on occurrence of a system
-call;
-in this way a completely controlled environment could
-be provided.
-.SH ASSEMBLER
-(ptrace = 26.)
-.br
-(data in r0)
-.br
-.B sys ptrace; pid; addr; request
-.br
-(value in r0)
diff --git a/.ref-Research-V7/usr/man/man2/read.2 b/.ref-Research-V7/usr/man/man2/read.2
deleted file mode 100644 (file)
index 63d481b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-.TH READ 2 
-.SH NAME
-read \- read from file
-.SH SYNOPSIS
-.B read(fildes, buffer, nbytes)
-.br
-.B char *buffer;
-.SH DESCRIPTION
-A file descriptor is a word
-returned from a successful
-.I "open, creat, dup,"
-or
-.I pipe
-call.
-.I Buffer
-is the location of
-.I nbytes
-contiguous
-bytes into which the input will be placed.
-It is not guaranteed
-that all
-.I nbytes
-bytes will be read; for example
-if the file refers to a typewriter at most one line
-will be returned.
-In any event the number of characters read is returned.
-.PP
-If the returned value is 0, then
-end-of-file has been reached.
-.SH "SEE ALSO"
-open(2), creat(2), dup(2), pipe(2)
-.SH DIAGNOSTICS
-As mentioned,
-0 is returned when the end of the file has been reached.
-If the read was otherwise unsuccessful
-the return value is \-1.
-Many conditions
-can generate an error:
-physical I/O errors, bad buffer address,
-preposterous
-.I nbytes,
-file descriptor not that of
-an input file.
-.SH ASSEMBLER
-(read = 3.)
-.br
-(file descriptor in r0)
-.br
-.B sys read; buffer; nbytes
-.br
-(byte count in r0)
diff --git a/.ref-Research-V7/usr/man/man2/setuid.2 b/.ref-Research-V7/usr/man/man2/setuid.2
deleted file mode 100644 (file)
index 47d1b01..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH SETUID 2 
-.SH NAME
-setuid, setgid \- set user and group ID
-.SH SYNOPSIS
-.B setuid(uid)
-.PP
-.B setgid(gid)
-.SH DESCRIPTION
-The user ID (group ID) of the current process is set to
-the argument.
-Both the effective and the real ID are set.
-These calls are only permitted to the super-user
-or if the argument is the real ID.
-.SH "SEE ALSO"
-getuid(2)
-.SH DIAGNOSTICS
-Zero is returned if the user (group) ID is set;
-\-1 is returned otherwise.
-.SH ASSEMBLER
-(setuid = 23.)
-.br
-(user ID in r0)
-.br
-.B sys setuid
-.PP
-(setgid = 46.)
-.br
-(group ID in r0)
-.br
-.B sys  setgid
diff --git a/.ref-Research-V7/usr/man/man2/signal.2 b/.ref-Research-V7/usr/man/man2/signal.2
deleted file mode 100644 (file)
index 50da35b..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-.TH SIGNAL 2 
-.SH NAME
-signal \- catch or ignore signals
-.SH SYNOPSIS
-.B #include <signal.h>
-.PP
-.B (*signal(sig, func))()
-.br
-.B (*func)();
-.SH DESCRIPTION
-A signal
-is generated by some abnormal event,
-initiated either by user at a typewriter (quit, interrupt),
-by a program error (bus error, etc.),
-or by request of another program (kill).
-Normally all signals
-cause termination of the receiving process,
-but a
-.I signal
-call allows them either to be ignored
-or to cause an interrupt to a specified location.
-Here is the list of signals with names as in
-the include file.
-.LP
-.nf
-.ta \w'SIGMMMM 'u +\w'15*  'u
-SIGHUP 1       hangup
-SIGINT 2       interrupt
-SIGQUIT        3*      quit
-SIGILL 4*      illegal instruction (not reset when caught)
-SIGTRAP        5*      trace trap (not reset when caught)
-SIGIOT 6*      IOT instruction
-SIGEMT 7*      EMT instruction
-SIGFPE 8*      floating point exception
-SIGKILL        9       kill (cannot be caught or ignored)
-SIGBUS 10*     bus error
-SIGSEGV        11*     segmentation violation
-SIGSYS 12*     bad argument to system call
-SIGPIPE        13      write on a pipe or link with no one to read it
-SIGALRM        14      alarm clock
-SIGTERM        15      software termination signal
-       16      unassigned
-.fi
-.PP
-The starred signals in the list above cause a core image
-if not caught or ignored.
-.PP
-If
-.I func
-is SIG_DFL, the default action
-for signal
-.I sig
-is reinstated; this default is termination,
-sometimes with a core image.
-If
-.I func
-is SIG_IGN the signal is ignored.
-Otherwise
-when the signal occurs
-.I func
-will be called with the
-signal number as argument.
-A return from the function will
-continue the process at the point it was interrupted.
-Except as indicated,
-a signal is reset to SIG_DFL after being caught.
-Thus if it is desired to
-catch every such signal,
-the catching routine must
-issue another
-.I signal
-call.
-.PP
-When a caught signal occurs
-during certain system calls, the call terminates prematurely.
-In particular this can occur
-during a
-.I read
-or
-.IR write (2)
-on a slow device (like a typewriter; but not a file);
-and during
-.I pause
-or
-.IR wait (2).
-When such a signal occurs, the saved user status
-is arranged in such a way that when return from the
-signal-catching takes place, it will appear that the
-system call returned an error status.
-The user's program may then, if it wishes,
-re-execute the call.
-.PP
-The value of
-.I signal
-is the previous (or initial)
-value of
-.I func
-for the particular signal.
-.PP
-After a
-.IR  fork (2)
-the child inherits
-all signals.
-.IR  Exec (2)
-resets all
-caught signals to default action.
-.SH "SEE ALSO"
-kill(1), kill(2),
-ptrace(2),
-setjmp(3)
-.SH DIAGNOSTICS
-The value (int)\-1 is returned if the
-given signal is out of range.
-.SH BUGS
-If a repeated signal arrives before the last one can be
-reset, there is no chance to catch it.
-.PP
-The type specification of the routine and its
-.I func
-argument are problematical.
-.SH ASSEMBLER
-(signal = 48.)
-.br
-.B sys  signal; sig; label
-.br
-(old label in r0)
-.PP
-If
-.I label
-is 0,
-default action is reinstated.
-If
-.I label
-is odd, the signal is ignored.
-Any other even
-.I label
-specifies an address in the process
-where an interrupt is simulated.
-An RTI or RTT instruction will return from the
-interrupt.
diff --git a/.ref-Research-V7/usr/man/man2/stat.2 b/.ref-Research-V7/usr/man/man2/stat.2
deleted file mode 100644 (file)
index ab924a6..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-.TH STAT 2 
-.SH NAME
-stat, fstat \- get file status
-.SH SYNOPSIS
-.B #include <sys/types.h>
-.br
-.B #include <sys/stat.h>
-.PP
-.B stat(name, buf)
-.br
-.B char *name;
-.br
-.B struct stat *buf;
-.PP
-.B fstat(fildes, buf)
-.br
-.B struct stat *buf;
-.SH DESCRIPTION
-.I Stat
-obtains detailed information about a named file.
-.I Fstat
-obtains the same information about an open file
-known by the file descriptor from a successful
-.I open, creat, dup
-or
-.IR pipe (2)
-call.
-.PP
-.I Name
-points to a null-terminated string naming
-a file;
-.I buf
-is the address of a buffer
-into which information is placed concerning the file.
-It is unnecessary to have any
-permissions at all with respect to the file, but all directories
-leading to the file must be searchable.
-The layout of the structure pointed to by buf
-as defined in
-.I <stat.h>
-is given below.
-.I St_mode 
-is encoded according to the `#define' statements.
-.PP
-.nf
-.so /usr/include/sys/stat.h
-.fi
-.PP
-The mode bits 0000070 and 0000007 encode group and
-others permissions (see
-.IR chmod (2)).
-The defined types,
-.I 
-ino_t, off_t, time_t,
-name various width integer values;
-.I dev_t
-encodes
-major and minor device numbers;
-their exact definitions are in
-the include file <sys/types.h>
-(see
-.IR types (5).
-.PP
-When
-.I fildes
-is associated with a pipe,
-.I fstat
-reports an ordinary file
-with restricted permissions.
-The size is the number of bytes queued in the pipe.
-.PP
-.I st_atime
-is the file was last read.
-For reasons of efficiency, it is not set when a directory
-is searched, although this would be more logical.
-.I st_mtime
-is the time the file was last written or created.
-It is not set by changes of owner, group, link count, or mode.
-.I st_ctime
-is set both both by writing and changing the i-node.
-.SH "SEE ALSO"
-ls(1), filsys(5)
-.SH DIAGNOSTICS
-Zero is returned if a status is available;
-\-1 if the file cannot be found.
-.SH ASSEMBLER
-(stat = 18.)
-.br
-.B sys stat; name; buf
-.PP
-(fstat = 28.)
-.br
-(file descriptor in r0)
-.br
-.B sys fstat; buf
diff --git a/.ref-Research-V7/usr/man/man2/stime.2 b/.ref-Research-V7/usr/man/man2/stime.2
deleted file mode 100644 (file)
index e1208ec..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH STIME 2 
-.SH NAME
-stime \- set time
-.SH SYNOPSIS
-.B stime(tp)
-.br
-.B long *tp;
-.SH DESCRIPTION
-.I Stime
-sets the system's idea of the time and date.
-Time, pointed to by
-.I tp,
-is measured in seconds from 0000 GMT Jan 1, 1970.
-Only the super-user may use this call.
-.SH "SEE ALSO"
-date(1), time(2), ctime(3)
-.SH DIAGNOSTICS
-Zero is returned if the time was set;
-\-1 if user is not the super-user.
-.SH ASSEMBLER
-(stime = 25.)
-.br
-(time in r0-r1)
-.br
-.B sys stime
-.PP
diff --git a/.ref-Research-V7/usr/man/man2/sync.2 b/.ref-Research-V7/usr/man/man2/sync.2
deleted file mode 100644 (file)
index aa676d7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-.TH SYNC 2 
-.SH NAME
-sync \- update super-block
-.SH SYNOPSIS
-.B sync( )
-.SH DESCRIPTION
-.I Sync
-causes all information in core
-memory that should be on disk to be written out.
-This includes modified super blocks,
-modified i-nodes, and delayed block I/O.
-.PP
-It should be used by programs which examine a file system,
-for example
-.I "icheck, df,"
-etc.
-It is mandatory before a boot.
-.SH "SEE ALSO"
-sync(1), update(8)
-.SH BUGS
-The writing, although scheduled, is not necessarily
-complete upon return from 
-.IR sync .
-.SH ASSEMBLER
-(sync = 36.)
-.br
-.B sys sync
diff --git a/.ref-Research-V7/usr/man/man2/time.2 b/.ref-Research-V7/usr/man/man2/time.2
deleted file mode 100644 (file)
index 7c9df4d..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-.TH TIME 2 
-.SH NAME
-time, ftime \- get date and time
-.SH SYNOPSIS
-.B long time(0)
-.PP
-.B long time(tloc)
-.br
-.B long *tloc;
-.sp
-.B #include <sys/types.h>
-.br
-.B #include <sys/timeb.h>
-.br
-.B ftime(tp)
-.br
-.B struct timeb *tp;
-.SH DESCRIPTION
-.I Time
-returns the time since 00:00:00 GMT, Jan. 1, 1970, measured
-in seconds.
-.PP
-If
-.I tloc
-is nonnull,
-the return value is also stored in the
-place to which
-.I tloc
-points.
-.PP
-The
-.I ftime
-entry fills in a structure pointed to by its argument,
-as defined by
-.IR <sys/timeb.h> :
-.PP
-.nf
-.ta .5i +\w'unsigned 'u
-.so /usr/include/sys/timeb.h
-.fi
-.PP
-The structure contains the time since the epoch in seconds,
-up to 1000 milliseconds of more-precise interval,
-the local timezone (measured in minutes of time westward from Greenwich),
-and a flag that, if nonzero, indicates that
-Daylight Saving time applies locally during the appropriate part of the year.
-.SH "SEE ALSO"
-date(1), stime(2), ctime(3)
-.SH ASSEMBLER
-(ftime = 35.)
-.br
-.B sys ftime; bufptr
-.PP
-(time = 13.; obsolete call)
-.br
-.B sys time
-.br
-(time since 1970 in r0-r1)
diff --git a/.ref-Research-V7/usr/man/man2/times.2 b/.ref-Research-V7/usr/man/man2/times.2
deleted file mode 100644 (file)
index 4ded016..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH TIMES 2 
-.SH NAME
-times \- get process times
-.SH SYNOPSIS
-.B times(buffer)
-.br
-.B struct tbuffer *buffer;
-.SH DESCRIPTION
-.I Times
-returns time-accounting information
-for the current process
-and for the terminated child processes
-of the current process.
-All times are in 1/HZ seconds,
-where HZ=60 in North America.
-.PP
-After the call, the buffer will appear as follows:
-.PP
-.nf
-struct tbuffer {
-       long    proc_user_time;
-       long    proc_system_time;
-       long    child_user_time;
-       long    child_system_time;
-};
-.PP
-.fi
-The children times are the sum
-of the children's process times and
-their children's times.
-.SH "SEE ALSO"
-time(1), time(2)
-.SH ASSEMBLER
-(times = 43.)
-.br
-.B sys times; buffer
diff --git a/.ref-Research-V7/usr/man/man2/umask.2 b/.ref-Research-V7/usr/man/man2/umask.2
deleted file mode 100644 (file)
index e27dc90..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH UMASK 2
-.SH NAME
-umask \- set file creation mode mask
-.SH SYNOPSIS
-.B umask(complmode)
-.SH DESCRIPTION
-.I Umask
-sets a mask used whenever a file is created by
-.IR creat (2)
-or
-.IR mknod (2):
-the actual mode (see
-.IR chmod (2))
-of the newly-created file is the logical
-.B and
-of the given mode and the complement of the argument.
-Only the low-order 9 bits of the mask (the protection bits)
-participate.
-In other words, the mask shows the bits to be turned off
-when files are created.
-.PP
-The previous value of the mask is returned by the call.
-The value is initially 0 (no restrictions).
-The mask is inherited by child processes.
-.SH SEE ALSO
-creat(2), mknod(2), chmod(2)
-.SH ASSEMBLER
-(umask = 60.)
-.br
-.B sys umask; complmode
diff --git a/.ref-Research-V7/usr/man/man2/unlink.2 b/.ref-Research-V7/usr/man/man2/unlink.2
deleted file mode 100644 (file)
index 8368b05..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH UNLINK 2 
-.SH NAME
-unlink \- remove directory entry
-.SH SYNOPSIS
-.B unlink(name)
-.br
-.B char *name;
-.SH DESCRIPTION
-.I Name
-points to a null-terminated string.
-.I Unlink
-removes the entry for the file pointed to by
-.I name
-from its directory.
-If this entry was the last link to the file,
-the contents of the file are freed and the file is destroyed.
-If, however, the file was open in any process, the actual
-destruction is delayed until it is closed, even though
-the directory entry has disappeared.
-.SH "SEE ALSO"
-rm(1), link(2)
-.SH DIAGNOSTICS
-Zero is normally returned;
-\-1 indicates that the file does not
-exist, that its directory cannot be written,
-or that the file contains pure procedure text
-that is currently in use.
-Write permission is not required on the file itself.
-It is also illegal to unlink a directory
-(except for the super-user).
-.SH ASSEMBLER
-(unlink = 10.)
-.br
-.B sys  unlink; name
diff --git a/.ref-Research-V7/usr/man/man2/utime.2 b/.ref-Research-V7/usr/man/man2/utime.2
deleted file mode 100644 (file)
index 0a0c3c1..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-.TH UTIME 2
-.SH NAME
-utime \- set file times
-.SH SYNOPSIS
-.B #include <sys/types.h>
-.br
-.B utime(file, timep)
-.br
-.B char *file;
-.br
-.B time_t timep[2];
-.SH DESCRIPTION
-The
-.I utime
-call
-uses the
-`accessed' and `updated' times in that order
-from the
-.I timep
-vector
-to set the corresponding recorded times for
-.I file.
-.PP
-The caller must be the owner of the file or the super-user.
-The `inode-changed' time of the file is set to the current time.
-.SH SEE ALSO
-stat (2)
-.SH ASSEMBLER
-(utime = 30.)
-.br
-.B sys utime; file; timep
diff --git a/.ref-Research-V7/usr/man/man2/wait.2 b/.ref-Research-V7/usr/man/man2/wait.2
deleted file mode 100644 (file)
index 0b7abd2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH WAIT 2 
-.SH NAME
-wait \- wait for process to terminate
-.SH SYNOPSIS
-.B wait(status)
-.br
-.B int *status;
-.PP
-.B wait(0)
-.SH DESCRIPTION
-.I Wait
-causes its caller to delay until a signal is received or
-one of its child
-processes terminates.
-If any child has died since the last
-.I wait,
-return is immediate;
-if there are no children, return is immediate with
-the error bit set
-(resp. with a value of \-1 returned).
-The normal return yields the process ID of the terminated child.
-In the case of several children several
-.I wait
-calls are needed
-to learn of all the deaths.
-.PP
-If
-.RI (int) status
-is nonzero, the high byte of the word pointed to
-receives the low byte of the
-argument of
-.I exit
-when the child terminated.
-The low byte
-receives the termination status
-of the process.
-See
-.IR signal (2)
-for a list of termination statuses (signals);
-0 status indicates normal termination.
-A special status (0177) is returned for a stopped process
-which has not terminated and can be restarted.
-See
-.IR ptrace (2).
-If the 0200 bit of the termination status
-is set,
-a core image of the process was produced
-by the system.
-.PP
-If the parent process terminates without
-waiting on its children,
-the initialization process
-(process ID = 1)
-inherits the children.
-.SH "SEE ALSO"
-exit(2), fork(2), signal(2)
-.SH DIAGNOSTICS
-Returns
-\-1 if there are no children not previously waited for.
-.SH ASSEMBLER
-(wait = 7.)
-.br
-.B sys  wait
-.br
-(process ID in r0)
-.br
-(status in r1)
-.PP
-The high byte of the status is
-the low byte of r0 in the child at termination.
diff --git a/.ref-Research-V7/usr/man/man2/write.2 b/.ref-Research-V7/usr/man/man2/write.2
deleted file mode 100644 (file)
index 6ba5336..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-.TH WRITE 2 
-.SH NAME
-write \- write on a file
-.SH SYNOPSIS
-.B write(fildes, buffer, nbytes)
-.br
-.B char *buffer;
-.SH DESCRIPTION
-A file descriptor is a word returned from a
-successful
-.I open,
-.I creat,
-.I dup,
-or
-.IR pipe (2)
-call.
-.PP
-.I Buffer
-is the address of
-.I nbytes
-contiguous
-bytes which are written on the output file.
-The number of characters actually written is returned.
-It should be regarded as an error
-if this is not the same as requested.
-.PP
-Writes which are multiples
-of 512 characters long and begin on a 512-byte boundary
-in the file
-are more efficient than any others.
-.SH "SEE ALSO"
-creat(2), open(2), pipe(2)
-.SH DIAGNOSTICS
-Returns
-\-1 on error: bad descriptor, buffer address, or
-count; physical I/O errors.
-.SH ASSEMBLER
-(write = 4.)
-.br
-(file descriptor in r0)
-.br
-.B sys  write; buffer; nbytes
-.br
-(byte count in r0)
diff --git a/.ref-Research-V7/usr/man/man3/abort.3 b/.ref-Research-V7/usr/man/man3/abort.3
deleted file mode 100644 (file)
index 1aa6c6f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-.TH ABORT 3
-.SH NAME
-abort \- generate IOT fault
-.SH DESCRIPTION
-.I Abort
-executes the PDP11 IOT instruction.
-This causes a signal that normally terminates
-the process with a core dump, which may be used for debugging.
-.SH SEE ALSO
-adb(1), signal(2), exit(2)
-.SH DIAGNOSTICS
-Usually `IOT trap \- core dumped' from the shell.
diff --git a/.ref-Research-V7/usr/man/man3/abs.3 b/.ref-Research-V7/usr/man/man3/abs.3
deleted file mode 100644 (file)
index 69f332e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-.TH ABS 3 
-.SH NAME
-abs \- integer absolute value
-.SH SYNOPSIS
-.B abs(i)
-.SH DESCRIPTION
-.I Abs
-returns
-the absolute value of its integer operand.
-.SH SEE ALSO
-floor(3) for
-.I fabs
-.SH BUGS
-You get what the hardware gives on the largest negative integer.
diff --git a/.ref-Research-V7/usr/man/man3/assert.3x b/.ref-Research-V7/usr/man/man3/assert.3x
deleted file mode 100644 (file)
index 90af9d5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-.TH ASSERT 3X
-.SH NAME
-assert \-
-program verification
-.SH SYNOPSIS
-.B #include <assert.h>
-.PP
-.B assert (expression)
-.SH DESCRIPTION
-.PP
-.I Assert
-is a macro that indicates
-.I expression
-is expected to be true at this point in the program.
-It causes an
-.IR exit (2)
-with a diagnostic comment on the standard output
-when
-.I expression
-is false (0).
-Compiling with the 
-.IR cc (1)
-option
-.SM
-.B \-DNDEBUG
-effectively deletes
-.I assert
-from the program.
-.SH DIAGNOSTICS
-`Assertion failed: file
-.I f
-line
-.I n.'
-.I F
-is the source file and
-.I n
-the source line number
-of the
-.I assert
-statement.
diff --git a/.ref-Research-V7/usr/man/man3/atof.3 b/.ref-Research-V7/usr/man/man3/atof.3
deleted file mode 100644 (file)
index 4eb2760..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-.TH ATOF 3 
-.SH NAME
-atof, atoi, atol \- convert ASCII to numbers
-.SH SYNOPSIS
-.B double atof(nptr)
-.br
-.B char *nptr;
-.PP
-.B atoi(nptr)
-.br
-.B char *nptr;
-.PP
-.B long atol(nptr)
-.br
-.B char *nptr;
-.SH DESCRIPTION
-These functions convert a string pointed to by
-.I nptr
-to floating, integer, and long integer
-representation respectively.
-The first unrecognized character ends the string.
-.PP
-.I Atof
-recognizes an optional string of tabs and spaces,
-then an optional sign, then
-a string of digits optionally containing a decimal
-point, then an optional `e' or `E' followed
-by an optionally signed integer.
-.PP
-.I Atoi
-and
-.I atol
-recognize an optional string of tabs and spaces,
-then an optional sign, then a string of
-digits.
-.SH SEE ALSO
-scanf(3)
-.SH BUGS
-There are no provisions for overflow.
diff --git a/.ref-Research-V7/usr/man/man3/crypt.3 b/.ref-Research-V7/usr/man/man3/crypt.3
deleted file mode 100644 (file)
index 1c057a1..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.TH CRYPT 3 
-.SH NAME
-crypt, setkey, encrypt \- DES encryption
-.SH SYNOPSIS
-.B char *crypt(key, salt)
-.br
-.B char *key, *salt;
-.PP
-.B setkey(key)
-.br
-.B char *key;
-.PP
-.B encrypt(block, edflag)
-.br
-.B char *block;
-.SH DESCRIPTION
-.I Crypt
-is the password encryption routine.
-It is based on the NBS Data Encryption Standard, with
-variations intended (among other things) to frustrate use of hardware
-implementations of the DES for key search.
-.PP
-The first argument to
-.I crypt
-is a user's typed password.
-The second is a 2-character string chosen from the
-set [a-zA-Z0-9./].
-The
-.I salt
-string is used to perturb the DES algorithm in one of 4096
-different ways, after which the password
-is used as the key to encrypt repeatedly a constant string.
-The returned value points to the encrypted password,
-in the same alphabet as the salt.
-The first two characters are the salt itself.
-.PP
-The other entries provide (rather primitive)
-access to the actual DES algorithm.
-The argument of
-.I setkey
-is a character array of length 64 containing only the characters
-with numerical value 0 and 1.
-If this string is divided into groups of 8,
-the low-order bit in each group is ignored,
-leading to a 56-bit key which is set into the machine.
-.PP
-The argument to the
-.I encrypt
-entry is likewise a character array of length 64
-containing 0's and 1's.
-The argument array is modified in place
-to a similar array
-representing the bits of the argument after having been
-subjected to the DES algorithm using the key set by
-.I setkey.
-If
-.I edflag
-is 0, the argument is encrypted;
-if non-zero,
-it is decrypted.
-.SH "SEE ALSO"
-passwd(1), passwd(5), login(1), getpass(3)
-.SH BUGS
-The return value
-points to static data whose content is overwritten
-by each call.
diff --git a/.ref-Research-V7/usr/man/man3/ctime.3 b/.ref-Research-V7/usr/man/man3/ctime.3
deleted file mode 100644 (file)
index 5f9f0ed..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-.TH CTIME 3 
-.SH NAME
-ctime, localtime, gmtime, asctime, timezone \-  convert date and time to ASCII
-.SH SYNOPSIS
-.B char *ctime(clock)
-.br
-.B long *clock;
-.PP
-.B #include <time.h>
-.PP
-.B struct tm *localtime(clock)
-.br
-.B long *clock;
-.PP
-.B struct tm *gmtime(clock)
-.br
-.B long *clock;
-.PP
-.B char *asctime(tm)
-.br
-.B struct tm *tm;
-.PP
-.B char *timezone(zone, dst)
-.SH DESCRIPTION
-.I Ctime
-converts a time pointed to by
-.I clock
-such as returned by
-.IR time (2)
-into ASCII
-and returns a pointer to a
-26-character string
-in the following form.
-All the fields have constant width.
-.PP
-    Sun Sep 16 01:03:52 1973\\n\\0
-.PP
-.I Localtime
-and
-.I gmtime
-return pointers to structures containing
-the broken-down time.
-.I Localtime
-corrects for the time zone and possible daylight savings time;
-.I gmtime
-converts directly to GMT, which is the time UNIX uses.
-.I Asctime
-converts a broken-down time to ASCII and returns a pointer
-to a 26-character string.
-.PP
-The structure declaration from the include file is:
-.RS
-.PP
-.nf
-.so /usr/include/time.h
-.fi
-.RE
-.PP
-These quantities give the time on a 24-hour clock,
-day of month (1-31), month of year (0-11), day of week
-(Sunday = 0), year \- 1900, day of year (0-365),
-and a flag that is nonzero if daylight saving time is in effect.
-.PP
-When local time is called for,
-the program consults the system to determine the time zone and
-whether the standard U.S.A. daylight saving time adjustment is
-appropriate.
-The program knows about the peculiarities
-of this conversion in 1974 and 1975;
-if necessary,
-a table for these years can be extended.
-.PP
-.I Timezone
-returns the name of the time zone associated with its first argument,
-which is measured in minutes westward from Greenwich.
-If the second argument is 0, the standard name is used,
-otherwise the Daylight Saving version.
-If the required name does not appear in a table
-built into the routine,
-the difference from GMT is produced; e.g.
-in Afghanistan
-.I timezone(\-(60*4+30), 0)
-is appropriate because it is 4:30 ahead of GMT
-and the string
-.B GMT+4:30
-is produced.
-.SH "SEE ALSO"
-time(2)
-.SH BUGS
-The return values point to static data
-whose content is overwritten by each call.
diff --git a/.ref-Research-V7/usr/man/man3/ctype.3 b/.ref-Research-V7/usr/man/man3/ctype.3
deleted file mode 100644 (file)
index 048ca84..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.TH CTYPE 3 
-.SH NAME
-isalpha, isupper, islower, isdigit, isalnum, isspace, ispunct, 
-isprint, iscntrl, isascii \-
-character classification
-.SH SYNOPSIS
-.B #include <ctype.h>
-.PP
-.B isalpha(c)
-.PP
-.B . . .
-.SH DESCRIPTION
-These macros classify ASCII-coded integer values
-by table lookup.
-Each is a predicate returning nonzero for true,
-zero for false.
-.I Isascii
-is defined on all integer values; the rest
-are defined only where 
-.I isascii
-is true and on the single non-ASCII value
-EOF (see
-.IR stdio (3)).
-.TP 15n
-.I isalpha
-.I c
-is a letter
-.TP
-.I isupper
-.I c
-is an upper case letter
-.TP
-.I islower 
-.I c
-is a lower case letter
-.TP
-.I isdigit
-.I c
-is a digit
-.TP
-.I isalnum
-.I c
-is an alphanumeric character
-.TP
-.I isspace
-.I c
-is a space, tab, carriage return, newline, or formfeed
-.TP
-.I ispunct
-.I c
-is a punctuation character (neither control nor alphanumeric)
-.TP
-.I isprint
-.I c
-is a printing character, code 040(8) (space) through 0176 (tilde)
-.TP
-.I iscntrl
-.I c
-is a delete character (0177) or ordinary control character
-(less than 040).
-.TP
-.I isascii
-.I c
-is an ASCII character, code less than 0200
-.SH "SEE ALSO"
-ascii(7)
diff --git a/.ref-Research-V7/usr/man/man3/dbm.3x b/.ref-Research-V7/usr/man/man3/dbm.3x
deleted file mode 100644 (file)
index 02afe6d..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-.TH DBM 3X 
-.SH NAME
-dbminit, fetch, store, delete, firstkey, nextkey \- data base subroutines
-.SH SYNOPSIS
-.nf
-.PP
-.B "typedef struct { char *dptr; int dsize; } datum;"
-.PP
-.B dbminit(file)
-.B char *file;
-.PP
-.B datum fetch(key)
-.B datum key;
-.PP
-.B store(key, content)
-.B datum key, content;
-.PP
-.B delete(key)
-.B datum key;
-.PP
-.B datum firstkey();
-.PP
-.B datum nextkey(key);
-.B datum key;
-.SH DESCRIPTION
-These functions maintain
-key/content pairs in a data base.
-The functions will handle very large
-(a billion blocks)
-databases and will access a keyed item
-in one or two filesystem accesses.
-The functions are obtained with the loader option
-.BR \-ldbm .
-.PP
-.IR Key s
-and
-.IR content s
-are
-described by the
-.I datum
-typedef.
-A
-.I datum
-specifies a string of
-.I dsize
-bytes pointed to by
-.I dptr.
-Arbitrary binary data, as well as normal
-ASCII strings, are allowed.
-The data base is stored in two files.
-One file is a directory containing a bit map
-and has `.dir' as its suffix.
-The second file contains all data and
-has `.pag' as its suffix.
-.PP
-Before a database can be accessed,
-it must be opened by
-.I dbminit.
-At the time of this call,
-the files
-.IB file .dir
-and
-.IB file .pag
-must exist.
-(An empty database is created by
-creating zero-length
-`.dir' and `.pag' files.)
-.PP
-Once open,
-the data stored under a key is
-accessed by
-.I fetch
-and data is placed under a key
-by
-.IR store .
-A key (and its associated contents)
-is deleted by
-.IR delete .
-A linear pass through all keys in a database
-may be made,
-in an (apparently) random order,
-by use of
-.I firstkey
-and
-.IR nextkey .
-.I Firstkey
-will return the first key
-in the database.
-With any key
-.I nextkey
-will return the next key in the database.
-This code will traverse the data base:
-.PP
-       for(key=firstkey(); key.dptr!=NULL; key=nextkey(key))
-.SH DIAGNOSTICS
-All functions that return an
-.I int
-indicate errors with negative values.
-A zero return indicates ok.
-Routines that return a
-.I datum
-indicate errors with a null (0)
-.I dptr.
-.SH BUGS
-The
-`.pag'
-file will contain holes so
-that its apparent size is about
-four times its actual content.
-Older UNIX systems may create real
-file blocks for these holes when touched.
-These files cannot be copied
-by normal means (cp, cat, tp, tar, ar)
-without filling in the holes.
-.PP
-.I Dptr
-pointers returned
-by these subroutines
-point into static storage
-that is changed by subsequent calls.
-.PP
-The sum of the sizes of
-a
-key/content pair must not exceed
-the internal block size
-(currently 512 bytes).
-Moreover all key/content pairs that hash
-together must fit on a single block.
-.I Store
-will return an error in the event that
-a disk block fills with inseparable data.
-.PP
-.I Delete
-does not physically reclaim file space,
-although it does make it available for reuse.
-.PP
-The order of keys presented by
-.I firstkey
-and
-.I nextkey
-depends on a hashing function, not on anything
-interesting.
diff --git a/.ref-Research-V7/usr/man/man3/ecvt.3 b/.ref-Research-V7/usr/man/man3/ecvt.3
deleted file mode 100644 (file)
index 231dbc4..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-.TH ECVT 3 
-.SH NAME
-ecvt, fcvt, gcvt \- output conversion
-.SH SYNOPSIS
-.B char *ecvt(value, ndigit, decpt, sign)
-.br
-.B double value;
-.br
-.B int ndigit, *decpt, *sign;
-.PP
-.B char *fcvt(value, ndigit, decpt, sign)
-.br
-.B double value;
-.br
-.B int ndigit, *decpt, *sign;
-.PP
-.B char *gcvt(value, ndigit, buf)
-.br
-.B double value;
-.br
-.B char *buf;
-.SH DESCRIPTION
-.I Ecvt
-converts the 
-.I value
-to a null-terminated string of
-.I ndigit
-ASCII digits
-and returns a pointer thereto.
-The position of the decimal point relative to the
-beginning of the string is stored indirectly
-through
-.IR decpt ""
-(negative means to the left of the
-returned digits).
-If the sign of the result is negative,
-the word pointed to by
-.IR sign ""
-is non-zero, otherwise
-it is zero.
-The low-order digit is rounded.
-.PP
-.IR Fcvt " is identical to " "ecvt\fR, except that the correct digit"
-has been rounded for Fortran F-format output of the number
-of digits specified by
-.IR \(*_ndigits .
-.PP
-.I Gcvt
-converts the
-.I value
-to a null-terminated ASCII string in
-.I buf
-and returns a pointer to 
-.I buf.
-It attempts to produce
-.I ndigit
-significant digits in Fortran F format if
-possible, otherwise E format, ready for
-printing.
-Trailing zeros may be suppressed.
-.SH "SEE ALSO"
-printf(3)
-.SH BUGS
-The return values point to static data
-whose content is overwritten by each call.
diff --git a/.ref-Research-V7/usr/man/man3/end.3 b/.ref-Research-V7/usr/man/man3/end.3
deleted file mode 100644 (file)
index c6fc011..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-.TH END 3 
-.SH NAME
-end, etext, edata \- last locations in program
-.SH SYNOPSIS
-.B extern end;
-.br
-.B extern etext;
-.br
-.B extern edata;
-.SH DESCRIPTION
-These names refer neither to routines
-nor to locations with interesting contents.
-The address of
-.I etext
-is the first address above the program text,
-.I edata
-above the initialized data region, and
-.I end
-above the uninitialized data region.
-.PP
-When execution begins, the program break
-coincides with
-.I end,
-but many functions reset the program break, among them
-the routines of
-.IR brk (2),
-.IR malloc (3), 
-standard input/output
-.RI ( stdio (3)),
-the profile
-.RB ( \-p )
-option of 
-.IR cc (1),
-etc.
-The current value of the program break
-is reliably returned by `sbrk(0)',
-see
-.IR brk (2).
-.SH "SEE ALSO"
-brk(2), malloc(3)
diff --git a/.ref-Research-V7/usr/man/man3/exp.3m b/.ref-Research-V7/usr/man/man3/exp.3m
deleted file mode 100644 (file)
index 4b78b09..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-.TH EXP 3M 
-.SH NAME
-exp, log, log10, pow, sqrt \- exponential, logarithm, power, square root
-.SH SYNOPSIS
-.B #include <math.h>
-.PP
-.B double exp(x)
-.br
-.B double x;
-.PP
-.B double log(x)
-.br
-.B double x;
-.PP
-.B double log10(x)
-.br
-.B double x;
-.PP
-.B double pow(x, y)
-.br
-.B double x, y;
-.PP
-.B double sqrt(x)
-.br
-.B double x;
-.SH DESCRIPTION
-.I Exp
-returns the exponential function of 
-.I x.
-.PP
-.I Log
-returns the natural logarithm of 
-.IR x ;
-.I log10
-returns the base 10 logarithm.
-.PP
-.I Pow
-returns
-.I  x\u\s8y\s10\d.
-.PP
-.I Sqrt
-returns the square root of 
-.I x.
-.SH SEE ALSO
-hypot(3),
-sinh(3),
-intro(2)
-.SH DIAGNOSTICS
-.I Exp
-and
-.I pow
-return a huge value when the correct value would
-overflow;
-.I errno
-is set to ERANGE.
-.I Pow
-returns 0 and sets
-.I errno
-to
-EDOM when the second argument is negative and non-integral and
-when
-both arguments are 0.
-.PP
-.I Log
-returns 0 when
-.I x
-is zero or negative;
-.I errno
-is set to EDOM.
-.PP
-.I Sqrt
-returns 0 when 
-.I x
-is negative;
-.I errno
-is set to EDOM.
diff --git a/.ref-Research-V7/usr/man/man3/fclose.3s b/.ref-Research-V7/usr/man/man3/fclose.3s
deleted file mode 100644 (file)
index 695f3ab..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-.TH FCLOSE 3S 
-.SH NAME
-fclose, fflush \- close or flush a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B fclose(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B fflush(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Fclose
-causes any buffers for the named
-.I stream
-to be emptied, and the file to be closed.
-Buffers allocated by the standard input/output system
-are freed.
-.PP
-.I Fclose
-is performed automatically upon
-calling
-.IR  exit (2).
-.PP
-.I Fflush
-causes any buffered data for the named output
-.I stream
-to be written to that file.
-The stream remains open.
-.SH "SEE ALSO"
-close(2),
-fopen(3),
-setbuf(3)
-.SH DIAGNOSTICS
-These routines return
-.SM
-.B EOF
-if
-.I stream
-is not associated with an output file, or
-if buffered data cannot be transferred to that file.
diff --git a/.ref-Research-V7/usr/man/man3/ferror.3s b/.ref-Research-V7/usr/man/man3/ferror.3s
deleted file mode 100644 (file)
index 71fdc80..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-.TH FERROR 3S 
-.SH NAME
-feof, ferror, clearerr, fileno \- stream status inquiries
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B feof(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B ferror(stream)
-.br
-.SM
-.B FILE
-.B *stream
-.PP
-.B clearerr(stream)
-.br
-.SM
-.B FILE
-.B *stream
-.PP
-.B fileno(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Feof
-returns non-zero when end of file is read on the named input
-.I stream,
-otherwise zero.
-.PP
-.I Ferror
-returns non-zero when an error has occurred reading or writing
-the named
-.I stream,
-otherwise zero.
-Unless cleared by
-.I clearerr,
-the error indication lasts until
-the stream is closed.
-.PP
-.I Clrerr
-resets the error indication on the named
-.I stream.
-.PP
-.I Fileno
-returns the integer file descriptor
-associated with the
-.I stream,
-see
-.IR  open (2).
-.PP
-These functions
-are implemented as macros;
-they cannot be redeclared.
-.SH "SEE ALSO"
-fopen(3), open(2)
diff --git a/.ref-Research-V7/usr/man/man3/floor.3m b/.ref-Research-V7/usr/man/man3/floor.3m
deleted file mode 100644 (file)
index f47974b..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH FLOOR 3M 
-.SH NAME
-fabs, floor, ceil \- absolute value, floor, ceiling functions
-.SH SYNOPSIS
-.B #include <math.h>
-.PP
-.B double floor(x)
-.br
-.B double x;
-.PP
-.B double ceil(x)
-.br
-.B double x;
-.PP
-.B double fabs(x)
-.br
-.B double(x);
-.SH DESCRIPTION
-.I Fabs
-returns the absolute value
-.RI | \|x\| |.
-.PP
-.I Floor
-returns the
-largest integer
-not greater than
-.IR x .
-.PP
-.I Ceil
-returns the
-smallest integer
-not less than
-.IR x .
-.SH SEE ALSO
-abs(3)
diff --git a/.ref-Research-V7/usr/man/man3/fopen.3s b/.ref-Research-V7/usr/man/man3/fopen.3s
deleted file mode 100644 (file)
index 4d95bbd..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-.TH FOPEN 3S 
-.SH NAME
-fopen, freopen, fdopen \- open a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.SM
-.B FILE
-.B *fopen(filename, type)
-.br
-.B char *filename, *type;
-.PP
-.SM
-.B FILE
-.B *freopen(filename, type, stream)
-.br
-.B char *filename, *type;
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.SM
-.B FILE
-.B *fdopen(fildes, type)
-.br
-.B char *type;
-.SH DESCRIPTION
-.I Fopen
-opens the file named by
-.I filename
-and associates a stream with it.
-.I Fopen
-returns a pointer to be used to identify
-the stream in subsequent operations.
-.PP
-.I Type
-is a character string having one of the following values:
-.TP 5
-"r"
-open for reading
-.ns
-.TP 5
-"w"
-create for writing
-.ns
-.TP 5
-"a"
-append: open for writing at end
-of file, or create for writing
-.PP
-.I Freopen
-substitutes the named file in place
-of the open
-.IR stream .
-It returns the original value of
-.IR stream .
-The original stream is closed.
-.PP
-.I Freopen
-is typically used to attach the preopened
-constant names,
-.B stdin, stdout, stderr,
-to specified files.
-.PP
-.I Fdopen
-associates a stream with a file descriptor obtained from
-.I open, dup, creat,
-or
-.IR pipe (2).
-The
-.I type
-of the stream must agree with the mode of the open file.
-.SH "SEE ALSO"
-open(2),
-fclose(3)
-.SH DIAGNOSTICS
-.I Fopen
-and 
-.I freopen
-return the pointer
-.SM
-.B NULL
-if
-.I filename
-cannot be accessed.
-.SH BUGS
-.I Fdopen
-is not portable to systems other than UNIX.
diff --git a/.ref-Research-V7/usr/man/man3/fread.3s b/.ref-Research-V7/usr/man/man3/fread.3s
deleted file mode 100644 (file)
index e2542f5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-.TH FREAD 3S 
-.SH NAME
-fread, fwrite \- buffered binary input/output
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B fread(ptr, sizeof(*ptr), nitems, stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B fwrite(ptr, sizeof(*ptr), nitems, stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Fread
-reads, into a block beginning at
-.I ptr,
-.I nitems
-of data of the type of
-.I *ptr
-from the named input
-.IR stream .
-It returns the number of items actually read.
-.PP
-.I Fwrite
-appends at most
-.I nitems
-of data of the type of
-.I *ptr
-beginning at
-.I ptr
-to the named output
-.IR stream .
-It returns the number of items actually written.
-.SH "SEE ALSO"
-read(2), write(2),
-fopen(3),
-getc(3), putc(3),
-gets(3), puts(3),
-printf(3), scanf(3)
-.SH DIAGNOSTICS
-.I Fread
-and
-.I fwrite
-return
-0
-upon end of file or error.
diff --git a/.ref-Research-V7/usr/man/man3/frexp.3 b/.ref-Research-V7/usr/man/man3/frexp.3
deleted file mode 100644 (file)
index 6168c4d..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-.TH FREXP 3
-.SH NAME
-frexp, ldexp, modf \- split into mantissa and exponent
-.SH SYNOPSIS
-.B double frexp(value, eptr)
-.br
-.B double value;
-.br
-.B int *eptr;
-.PP
-.B double ldexp(value, exp)
-.br
-.B double value;
-.PP
-.B double modf(value, iptr)
-.br
-.B double value, *iptr;
-.SH DESCRIPTION
-.I Frexp
-returns the mantissa of a double 
-.I value
-as a double quantity,
-.I x,
-of magnitude less than 1
-and stores an integer 
-.I n
-such that
-.I value
-=
-.IR x *2** n
-indirectly through 
-.I eptr.
-.PP
-.I Ldexp
-returns the quantity
-.IR value *2** exp.
-.PP
-.I Modf
-returns the positive fractional part of
-.I value
-and stores the integer part indirectly
-through 
-.I iptr.
diff --git a/.ref-Research-V7/usr/man/man3/fseek.3s b/.ref-Research-V7/usr/man/man3/fseek.3s
deleted file mode 100644 (file)
index 2e4a5bf..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-.TH FSEEK 3S 
-.SH NAME
-fseek, ftell, rewind \- reposition a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B fseek(stream, offset, ptrname)
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B long offset;
-.PP
-.B long ftell(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B rewind(stream)
-.SH DESCRIPTION
-.I Fseek
-sets the position of the next input or output
-operation on the
-.IR stream .
-The new position is at the signed distance
-.I offset
-bytes
-from the beginning, the current position, or the end of the file,
-according as 
-.I ptrname
-has the value 0, 1, or 2.
-.PP
-.I Fseek
-undoes any effects of
-.IR  ungetc (3).
-.PP
-.I Ftell
-returns the current value of the offset relative to the beginning
-of the file associated with the named
-.IR stream .
-It is measured in bytes on UNIX;
-on some other systems it is a magic cookie,
-and the only foolproof way to obtain an 
-.I offset
-for
-.IR fseek .
-.PP
-.I Rewind(stream)
-is equivalent to
-.I "fseek(stream, 0L, 0)."
-.SH "SEE ALSO"
-lseek(2),
-fopen(3)
-.SH DIAGNOSTICS
-.I Fseek
-returns \-1 for improper seeks.
diff --git a/.ref-Research-V7/usr/man/man3/getc.3s b/.ref-Research-V7/usr/man/man3/getc.3s
deleted file mode 100644 (file)
index 3191d1a..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-.TH GETC 3S 
-.SH NAME
-getc, getchar, fgetc, getw \- get character or word from stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B int getc(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B int getchar()
-.PP 
-.B int fgetc(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B int getw(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Getc
-returns the next character from the named input
-.IR stream .
-.PP
-.I Getchar()
-is identical to 
-.IR getc(stdin) .
-.PP
-.I Fgetc
-behaves like 
-.I getc,
-but is a genuine function, not a macro;
-it may be used to save object text.
-.PP
-.I Getw
-returns the next
-word from the named input
-.IR stream .
-It returns the constant
-.SM
-.B EOF
-upon end of file or error, but since that is a good
-integer value,
-.I feof
-and
-.IR  ferror (3)
-should be used to check the success of
-.IR getw .
-.I Getw
-assumes no special alignment in the file.
-.SH "SEE ALSO"
-fopen(3), putc(3),
-gets(3), scanf(3),
-fread(3),
-ungetc(3)
-.SH DIAGNOSTICS
-These functions return the integer constant
-.SM
-.B EOF
-at end of file or upon read error.
-.PP
-A stop with message,
-`Reading bad file', means an attempt has been made to
-read from a stream that has not been opened for
-reading by
-.IR fopen .
-.SH BUGS
-The end-of-file return from
-.I getchar
-is incompatible with that in UNIX editions 1-6.
-.PP
-Because it is implemented as a macro,
-.I getc
-treats a
-.I stream
-argument with side effects incorrectly.
-In particular,
-`getc(*f++);'
-doesn't work sensibly.
diff --git a/.ref-Research-V7/usr/man/man3/getenv.3 b/.ref-Research-V7/usr/man/man3/getenv.3
deleted file mode 100644 (file)
index 79d6476..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-.TH GETENV 3
-.SH NAME
-getenv \- value for environment name
-.SH SYNOPSIS
-.B char *getenv(name)
-.br
-.B char *name;
-.SH DESCRIPTION
-.I Getenv
-.a
-searches the environment list
-(see
-.IR environ (5))
-for a string of the form
-.IB name = value
-and returns
-.I value
-if such a string is present, otherwise 0 (NULL).
-.SH SEE ALSO
-environ(5), exec(2)
diff --git a/.ref-Research-V7/usr/man/man3/getgrent.3 b/.ref-Research-V7/usr/man/man3/getgrent.3
deleted file mode 100644 (file)
index a4a650d..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-.TH GETGRENT 3 
-.SH NAME
-getgrent, getgrgid, getgrnam, setgrent, endgrent \- get group file entry
-.SH SYNOPSIS
-.B #include <grp.h>
-.PP
-.B struct group *getgrent();
-.PP
-.B struct group *getgrgid(gid) int gid;
-.PP
-.B struct group *getgrnam(name) char *name;
-.PP
-.B int setgrent();
-.PP
-.B int endgrent();
-.SH DESCRIPTION
-.I Getgrent,
-.I getgrgid
-and
-.I getgrnam
-each return pointers
-to an object
-with the following structure
-containing the broken-out
-fields of a line in the group file.
-.RS
-.PP
-.nf
-.so /usr/include/grp.h
-.fi
-.RE
-.PP
-The members of this structure are:
-.TP
-gr_name
-The name of the group.
-.br
-.ns
-.TP
-gr_passwd
-The encrypted password of the group.
-.br
-.ns
-.TP
-gr_gid
-The numerical group-ID.
-.br
-.ns
-.TP
-gr_mem
-Null-terminated vector
-of pointers to the individual
-member names.
-.PP
-.I Getgrent
-simply reads the next
-line while
-.I getgrgid
-and
-.I getgrnam
-search until a matching
-.I gid
-or
-.I name
-is found
-(or until EOF is encountered).
-Each routine picks up
-where the others leave off
-so successive calls may be used
-to search the entire file.
-.PP
-A call to
-.I setgrent
-has the effect of rewinding
-the group file
-to allow
-repeated searches.
-.I Endgrent
-may be called to
-close the group file
-when processing is complete.
-.SH FILES
-/etc/group
-.SH "SEE ALSO"
-getlogin(3), getpwent(3), group(5)
-.SH DIAGNOSTICS
-A null pointer
-(0) is returned on EOF or error.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.
diff --git a/.ref-Research-V7/usr/man/man3/getlogin.3 b/.ref-Research-V7/usr/man/man3/getlogin.3
deleted file mode 100644 (file)
index 0f852aa..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-.TH GETLOGIN 3 
-.SH NAME
-getlogin \- get login name
-.SH SYNOPSIS
-.B char *getlogin();
-.SH DESCRIPTION
-.I Getlogin
-returns a pointer to
-the login name
-as found in
-.IR /etc/utmp .
-It may be used
-in conjunction
-with
-.I getpwnam
-to locate the correct
-password file entry
-when the same userid
-is shared by several
-login names.
-.PP
-If
-.I getlogin
-is called within a process
-that is not attached to a
-typewriter, it returns NULL.
-The correct procedure
-for determining the login name
-is to first call
-.I getlogin
-and if it fails,
-to call
-.IR getpwuid .
-.SH FILES
-/etc/utmp
-.SH "SEE ALSO"
-getpwent(3), getgrent(3), utmp(5)
-.SH DIAGNOSTICS
-Returns NULL (0) if name not found.
-.SH BUGS
-The return values point to static data
-whose content is overwritten by each call.
diff --git a/.ref-Research-V7/usr/man/man3/getpass.3 b/.ref-Research-V7/usr/man/man3/getpass.3
deleted file mode 100644 (file)
index ffea3d1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH GETPASS 3 
-.SH NAME
-getpass \- read a password
-.SH SYNOPSIS
-.B char *getpass(prompt)
-.br
-.B char *prompt;
-.SH DESCRIPTION
-.I Getpass
-reads a password from the file
-.IR /dev/tty ,
-or if that cannot be opened, from the standard input,
-after prompting with the null-terminated string
-.I prompt
-and disabling echoing.
-A pointer is returned to a null-terminated string
-of at most 8 characters.
-.SH FILES
-/dev/tty
-.SH "SEE ALSO"
-crypt(3)
-.SH BUGS
-The return value points to static data
-whose content is overwritten by each call.
diff --git a/.ref-Research-V7/usr/man/man3/getpw.3 b/.ref-Research-V7/usr/man/man3/getpw.3
deleted file mode 100644 (file)
index 03694d6..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH GETPW 3  deprecated
-.SH NAME
-getpw \- get name from UID
-.SH SYNOPSIS
-.B getpw(uid, buf)
-.br
-.B char *buf;
-.SH DESCRIPTION
-.I Getpw
-searches the password file for
-the (numerical)
-.IR uid ", and fills in " "buf"
-with the corresponding line;
-it returns non-zero if
-.IR uid ""
-could not
-be found.
-The line is null-terminated.
-.SH FILES
-/etc/passwd
-.SH "SEE ALSO"
-getpwent(3),
-passwd(5)
-.SH DIAGNOSTICS
-Non-zero
-return on error.
diff --git a/.ref-Research-V7/usr/man/man3/getpwent.3 b/.ref-Research-V7/usr/man/man3/getpwent.3
deleted file mode 100644 (file)
index d791817..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-.TH GETPWENT 3 
-.SH NAME
-getpwent, getpwuid, getpwnam, setpwent, endpwent
-\- get password file entry
-.SH SYNOPSIS
-.B #include <pwd.h>
-.PP
-.B struct passwd *getpwent();
-.PP
-.B struct passwd *getpwuid(uid) int uid;
-.PP
-.B struct passwd *getpwnam(name) char *name;
-.PP
-.B int setpwent();
-.PP
-.B int endpwent();
-.SH DESCRIPTION
-.I Getpwent,
-.I getpwuid
-and
-.I getpwnam
-each return a pointer to an object with the
-following structure
-containing the broken-out
-fields of a line in the password file.
-.RS
-.PP
-.nf
-.so /usr/include/pwd.h
-.ft R
-.ad
-.fi
-.RE
-.PP
-The fields
-.I pw_quota
-and
-.I pw_comment
-are unused; the others have meanings described in
-.IR passwd (5).
-.PP
-.I Getpwent
-reads the next
-line (opening the file if necessary);
-.I setpwent
-rewinds the file;
-.I endpwent
-closes it.
-.PP
-.I Getpwuid
-and
-.I getpwnam
-search from the beginning until a matching
-.I uid
-or
-.I name
-is found
-(or until EOF is encountered).
-.SH FILES
-/etc/passwd
-.SH "SEE ALSO"
-getlogin(3), getgrent(3), passwd(5)
-.SH DIAGNOSTICS
-Null pointer
-(0) returned on EOF or error.
-.SH BUGS
-All information
-is contained in a static area
-so it must be copied if it is
-to be saved.
-.br
diff --git a/.ref-Research-V7/usr/man/man3/gets.3s b/.ref-Research-V7/usr/man/man3/gets.3s
deleted file mode 100644 (file)
index 061824d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-.TH GETS 3S 
-.SH NAME
-gets, fgets \- get a string from a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B char *gets(s)
-.br
-.B char *s;
-.PP
-.B char *fgets(s, n, stream)
-.br
-.B char *s;
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Gets
-reads a string into
-.I s
-from the standard input stream
-.B stdin.
-The string is terminated by a newline
-character, which is replaced in
-.I s
-by a null character.
-.I Gets
-returns its argument.
-.PP
-.I Fgets
-reads 
-.IR n \-1
-characters, or up to a newline
-character, whichever comes first,
-from the
-.I stream
-into the string
-.IR s .
-The last character read into
-.I s
-is followed by a null character.
-.I Fgets
-returns its first argument.
-.SH "SEE ALSO"
-puts(3),
-getc(3), scanf(3), fread(3),
-ferror(3)
-.SH DIAGNOSTICS
-.I Gets
-and
-.I fgets
-return the constant pointer 
-.SM
-.B NULL
-upon end of file or error.
-.SH BUGS
-.I Gets
-deletes a newline,
-.I fgets
-keeps it,
-all in the name of backward compatibility.
diff --git a/.ref-Research-V7/usr/man/man3/hypot.3m b/.ref-Research-V7/usr/man/man3/hypot.3m
deleted file mode 100644 (file)
index 283279a..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH HYPOT 3M 
-.SH NAME
-hypot, cabs \- euclidean distance
-.SH SYNOPSIS
-.B #include <math.h>
-.PP
-.B double hypot(x, y)
-.br
-.B double x, y;
-.PP
-.B double cabs(z)
-.br
-.B struct { double x, y;} z;
-.SH DESCRIPTION
-.I Hypot
-and
-.I cabs
-return
-.PP
-.IP "" 15n
-sqrt(x*x + y*y),
-.LP
-taking precautions against unwarranted overflows.
-.SH SEE ALSO
-exp(3) for
-.I sqrt
diff --git a/.ref-Research-V7/usr/man/man3/intro.3 b/.ref-Research-V7/usr/man/man3/intro.3
deleted file mode 100644 (file)
index 76f5b81..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-.TH INTRO 3
-.SH NAME
-intro \- introduction to library functions
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B #include <math.h>
-.SH DESCRIPTION
-This section describes functions that may be found
-in various libraries, other than those functions
-that directly invoke UNIX system primitives,
-which are described in section 2.
-Functions are divided into various libraries distinguished
-by the section number at the top of the page:
-.TP 6n
-(3)
-These functions, together with those of section 2 and those
-marked (3S), constitute library
-.I libc,
-which is automatically loaded by the C compiler
-.IR cc (1)
-and the Fortran compiler
-.IR f77 (1).
-The link editor
-.IR ld (1)
-searches this library under the `\-lc' option.
-Declarations for some of these functions may be obtained
-from include files indicated on the appropriate pages.
-.TP
-(3M)
-These functions constitute the math library,
-.I libm.
-They are automatically loaded as needed by the Fortran compiler
-.IR f77 (1).
-The link editor searches this library under the `\-lm' option.
-Declarations for these functions may be obtained from
-the include file <math.h>.
-.TP 
-(3S)
-These functions constitute the
-`standard I/O package',
-see
-.IR stdio (3).
-These functions are in the library
-.I libc
-already mentioned.
-Declarations for these functions may be obtained from
-the include file <stdio.h>.
-.TP
-(3X)
-Various
-specialized libraries have not been given distinctive
-captions.
-The files in which these libraries are found are named
-on the appropriate pages.
-.SH FILES
-/lib/libc.a
-.br
-/lib/libm.a, /usr/lib/libm.a (one or the other)
-.SH SEE ALSO
-stdio(3),
-nm(1), ld(1), cc(1), f77(1), intro(2)
-.SH DIAGNOSTICS
-Functions in the math library (3M) may return
-conventional values when the function is undefined for the
-given arguments or when the value is not representable.
-In these cases the external variable
-.I errno
-(see
-.IR intro (2))
-is set to the value EDOM
-or ERANGE.
-The values of EDOM and ERANGE are defined in
-the include file
-.I <math.h>.
-.SH ASSEMBLER
-In assembly language these functions may be accessed
-by simulating the C calling sequence.
-For example,
-.IR ecvt (3)
-might be called this way:
-.IP ""
-.globl _ecvt
-.nf
-setd
-mov    $sign,\-(sp)
-mov    $decpt,\-(sp)
-mov    ndigit,\-(sp)
-movf   value,\-(sp)
-jsr    pc,_ecvt
-add    $14.,sp
-.fi
diff --git a/.ref-Research-V7/usr/man/man3/j0.3m b/.ref-Research-V7/usr/man/man3/j0.3m
deleted file mode 100644 (file)
index f9dffcf..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-.TH J0 3M 
-.SH NAME
-j0, j1, jn, y0, y1, yn \- bessel functions
-.SH SYNOPSIS
-.B #include <math.h>
-.PP
-.B double j0(x)
-.br
-.B double x;
-.PP
-.B double j1(x)
-.br
-.B double x;
-.PP
-.B double jn(n, x);
-.br
-.B double x;
-.PP
-.B double y0(x)
-.br
-.B double x;
-.PP
-.B double y1(x)
-.br
-.B double x;
-.PP
-.B double yn(n, x)
-.br
-.B double x;
-.SH DESCRIPTION
-These functions calculate Bessel functions of the first
-and second kinds for real arguments and integer orders.
-.SH DIAGNOSTICS
-Negative arguments cause
-.I y0, y1,
-and
-.I yn
-to return a huge negative value
-and set
-.I errno
-to EDOM.
diff --git a/.ref-Research-V7/usr/man/man3/l3tol.3 b/.ref-Research-V7/usr/man/man3/l3tol.3
deleted file mode 100644 (file)
index 5b3c3de..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH L3TOL 3 
-.SH NAME
-l3tol, ltol3 \- convert between 3-byte integers and long integers
-.SH SYNOPSIS
-.B l3tol(lp, cp, n)
-.br
-.B long *lp;
-.br
-.B char *cp;
-.PP
-.B ltol3(cp, lp, n)
-.br
-.B char *cp;
-.br
-.B long *lp;
-.SH DESCRIPTION
-.I L3tol
-converts a list of
-.I n
-three-byte integers packed into a character string
-pointed to by 
-.I cp
-into a list of long integers pointed to by
-.IR lp .
-.PP
-.I Ltol3
-performs the reverse conversion from long integers
-.RI ( lp )
-to three-byte integers
-.RI ( cp ).
-.PP
-These functions are useful for file-system maintenance;
-disk addresses are three bytes long.
-.SH SEE ALSO
-filsys(5)
diff --git a/.ref-Research-V7/usr/man/man3/malloc.3 b/.ref-Research-V7/usr/man/man3/malloc.3
deleted file mode 100644 (file)
index 57073ab..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-.TH MALLOC 3 
-.SH NAME
-malloc, free, realloc, calloc \- main memory allocator
-.SH SYNOPSIS
-.B char *malloc(size)
-.br
-.B unsigned size;
-.PP
-.B free(ptr)
-.br
-.B char *ptr;
-.PP
-.B char *realloc(ptr, size)
-.br
-.B char *ptr;
-.br
-.B unsigned size;
-.PP
-.B char *calloc(nelem, elsize)
-.br
-.B unsigned nelem, elsize;
-.SH DESCRIPTION
-.I Malloc
-and
-.I free
-provide a simple general-purpose memory allocation package.
-.I Malloc
-returns a pointer to a block of at least
-.I size
-bytes beginning on a word boundary.
-.PP
-The argument to
-.I free
-is a pointer to a block previously allocated by
-.IR malloc ;
-this space is made available for further allocation,
-but its contents are left undisturbed.
-.PP
-Needless to say, grave disorder will result if the space
-assigned by
-.I malloc
-is overrun or if some random number is handed to
-.IR free .
-.PP
-.I Malloc
-allocates the first big enough contiguous reach of
-free space
-found in a circular search from the last 
-block allocated or freed,
-coalescing adjacent free blocks as it searches.
-It calls
-.I sbrk
-(see
-.IR break (2))
-to get more memory from the system when there is no
-suitable space already free.
-.PP
-.I Realloc
-changes the size of the block pointed to by
-.I ptr
-to
-.I size
-bytes and returns a pointer to the (possibly moved)
-block.
-The contents will be unchanged up to the
-lesser of the new and old sizes.
-.PP
-.I Realloc
-also works if
-.I ptr
-points to a block freed since the last call of
-.I malloc, realloc
-or
-.IR calloc ;
-thus sequences of
-.I free, malloc
-and
-.I realloc
-can exploit the search strategy of
-.I malloc
-to do storage compaction.
-.PP
-.I Calloc
-allocates space for
-an array of
-.I nelem
-elements of size
-.I elsize.
-The space is initialized to zeros.
-.PP
-Each of the allocation routines returns a pointer
-to space suitably aligned (after possible pointer coercion)
-for storage of any type of object.
-.SH DIAGNOSTICS
-.I Malloc, realloc
-and
-.I calloc
-return a null pointer (0) if there is no available memory
-or if the arena has been detectably corrupted by storing outside the bounds
-of a block.
-.I Malloc
-may be recompiled to check the arena very stringently
-on every transaction;
-see the source code.
-.SH BUGS
-When
-.I realloc
-returns 0,
-the block
-pointed to by
-.I ptr
-may be destroyed.
diff --git a/.ref-Research-V7/usr/man/man3/mktemp.3 b/.ref-Research-V7/usr/man/man3/mktemp.3
deleted file mode 100644 (file)
index 691bae6..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.TH MKTEMP 3 
-.SH NAME
-mktemp \- make a unique file name
-.SH SYNOPSIS
-.B char *mktemp(template)
-.br
-.B char *template;
-.SH DESCRIPTION
-.I Mktemp
-replaces
-.I template
-by a unique file name, and returns the
-address of the template.
-The template should look like a file name with six trailing
-X's, which will be replaced with the
-current process id and a unique letter.
-.SH "SEE ALSO"
-getpid(2)
diff --git a/.ref-Research-V7/usr/man/man3/monitor.3 b/.ref-Research-V7/usr/man/man3/monitor.3
deleted file mode 100644 (file)
index 611bc95..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-.TH MONITOR 3 
-.SH NAME
-monitor \- prepare execution profile
-.SH SYNOPSIS
-.B monitor(lowpc, highpc, buffer, bufsize, nfunc)
-.br
-.B
-int (*lowpc)( ), (*highpc)( );
-.br
-.B short buffer[ ];
-.SH DESCRIPTION
-An executable program created by
-`cc \-p' automatically includes calls for
-.I monitor
-with default parameters;
-.I monitor
-needn't be called explicitly
-except to gain fine control over profiling.
-.PP
-.I Monitor
-is an interface to
-.IR profil (2).
-.I Lowpc
-and
-.I highpc
-are the addresses of two functions;
-.I buffer
-is the address of a (user supplied)
-array of
-.I bufsize
-short integers.
-.I Monitor
-arranges to record a histogram of
-periodically sampled values of the program counter,
-and of counts of calls
-of certain functions, in the buffer.
-The lowest address sampled
-is that of
-.I lowpc
-and the highest is
-just below
-.IR highpc .
-At most
-.I nfunc
-call counts can be kept; only calls of functions
-compiled with the profiling option
-.B \-p
-of
-.IR cc (1)
-are recorded.
-For the results to be significant,
-especially where there are small, heavily
-used routines,
-it is suggested that the buffer be no more
-than a few times smaller than the range
-of locations sampled.
-.PP
-To profile the entire program,
-it is sufficient to use
-.PP
-       extern etext();
-.br
-       ...
-.br
-       monitor((int)2, etext, buf, bufsize, nfunc);
-.PP
-.I Etext
-lies just above all the
-program text, see
-.IR end (3).
-.PP
-To stop execution monitoring and write the results
-on the file
-.I mon.out,
-use
-.PP
-       monitor(0);
-.LP
-then
-.IR prof (1)
-can be used
-to examine the results.
-.SH FILES
-mon.out
-.SH "SEE ALSO"
-prof(1), profil(2), cc(1)
diff --git a/.ref-Research-V7/usr/man/man3/mp.3x b/.ref-Research-V7/usr/man/man3/mp.3x
deleted file mode 100644 (file)
index c8c507a..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-.TH MP 3X
-.SH NAME
-itom, madd, msub, mult, mdiv, min, mout,
-pow, gcd, rpow \- multiple precision integer arithmetic
-.SH SYNOPSIS
-.nf
-.B "typedef struct { int len; short *val; } mint;"
-.PP
-.PP
-.B madd(a, b, c)
-.B msub(a, b, c)
-.B mult(a, b, c)
-.B mdiv(a, b, q, r)
-.B min(a)
-.B mout(a)
-.B pow(a, b, m, c)
-.B gcd(a, b, c)
-.B rpow(a, b, c)
-.B msqrt(a, b, r)
-.B mint *a, *b, *c, *m, "*q, *r;"
-.PP
-.B
-.B sdiv(a, n, q, r)
-.B mint *a, *q;
-.B short *r;
-.PP
-.B mint *itom(n)
-.SH DESCRIPTION
-These routines perform arithmetic on integers of
-arbitrary length.
-The integers are stored using the defined type
-.I mint.
-Pointers to
-a
-.I mint
-should be initialized using the function
-.IR itom ,
-which sets the initial value to
-.IR n .
-After that space is managed automatically by the routines.
-.PP
-.IR madd , " msub" , " mult" ,
-assign to their third arguments the sum, difference, and
-product, respectively, of their first two arguments.
-.I mdiv
-assigns the quotient and remainder, respectively,
-to its third and fourth arguments.
-.I sdiv
-is like
-.I mdiv
-except that the divisor is an ordinary integer.
-.I msqrt
-produces the square root and remainder of its first argument.
-.I rpow
-calculates
-.I a
-raised to the power
-.IR b ,
-while
-.I pow
-calculates this reduced modulo
-.IR m .
-.IR min " and" mout
-do decimal input and output.
-.PP
-The functions are obtained with the
-loader option
-.IR -lmp .
-.SH DIAGNOSTICS
-Illegal operations and running out of memory
-produce messages and core images.
diff --git a/.ref-Research-V7/usr/man/man3/nlist.3 b/.ref-Research-V7/usr/man/man3/nlist.3
deleted file mode 100644 (file)
index a318ba2..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-.TH NLIST 3 
-.SH NAME
-nlist \- get entries from name list
-.SH SYNOPSIS
-.B #include <a.out.h>
-.br
-.B nlist(filename, nl)
-.br
-.B char *filename;
-.DT
-.nf
-.ft 3
-struct nlist nl[ ];
-.fi
-.SH DESCRIPTION
-.I Nlist
-examines the name list in
-the given executable output file
-and selectively extracts a
-list of values.
-The name list consists of
-an array of structures containing names,
-types and values.
-The list is terminated with a null name.
-Each name is looked up in the name list of
-the file.
-If the name is found, the type and value of the
-name are inserted in the next two fields.
-If the name is not found, both entries are set to 0.
-See
-.IR a.out (5)
-for the structure declaration.
-.PP
-This subroutine is useful for
-examining the system name list kept in
-the file
-.BR /unix .
-In this way programs can obtain system addresses
-that are up to date.
-.SH "SEE ALSO"
-a.out(5)
-.SH DIAGNOSTICS
-All
-type entries are set to 0 if the file cannot be found
-or if it is not a valid namelist.
diff --git a/.ref-Research-V7/usr/man/man3/perror.3 b/.ref-Research-V7/usr/man/man3/perror.3
deleted file mode 100644 (file)
index cd9b7af..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-.TH PERROR 3 
-.SH NAME
-perror, sys_errlist, sys_nerr \- system error messages
-.SH SYNOPSIS
-.B perror(s)
-.br
-.B char *s;
-.PP
-.B int sys_nerr;
-.br
-.B char *sys_errlist[];
-.SH DESCRIPTION
-.I Perror
-produces a short error message
-on the standard error file
-describing the last error encountered during a call
-to the system from a C program.
-First the argument string
-.I s
-is printed, then a colon, then the message and a new-line.
-Most usefully, the argument string is the name
-of the program which incurred the error.
-The error number is taken from the external variable
-.I errno
-(see
-.IR intro (2)),
-which is set when errors occur but not cleared when
-non-erroneous calls are made.
-.PP
-To simplify variant formatting
-of messages, the vector of message strings
-.I sys_errlist
-is provided;
-.I errno
-can be used as an index in this table to get the
-message string without the newline.
-.I Sys_nerr
-is the number of messages provided for in the table;
-it should be checked because new
-error codes may be added to the system before
-they are added to the table.
-.SH "SEE ALSO"
-intro(2)
diff --git a/.ref-Research-V7/usr/man/man3/pkopen.3 b/.ref-Research-V7/usr/man/man3/pkopen.3
deleted file mode 100644 (file)
index 841b4b2..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.TH PKOPEN 3 deprecated
-.SH NAME
-pkopen, pkclose, pkread, pkwrite, pkfail \- packet driver simulator
-.SH SYNOPSIS
-.B char *pkopen(fd)
-.PP
-.B pkclose(ptr)
-.br
-.B char *ptr;
-.PP
-.B pkread(ptr, buffer, count)
-.br
-.B char *ptr, *buffer;
-.PP
-.B pkwrite(ptr, buffer, count)
-.br
-.B char *ptr, *buffer;
-.PP
-.B pkfail()
-.SH DESCRIPTION
-These routines are a user-level implementation of the 
-full-duplex
-end-to-end communication protocol described in
-.IR pk (4).
-If
-.I fd
-is a file descriptor open for reading and writing,
-.I pkopen
-carries out the initial synchronization and returns an identifying
-pointer.
-The pointer
-is used as the first parameter to
-.I pkread,
-.I pkwrite,
-and
-.I pkclose.
-.PP
-.I Pkread, pkwrite
-and
-.I pkclose
-behave analogously to
-.I read, write
-and
-.IR close (2).
-However, a write of zero bytes
-is meaningful and will produce a corresponding
-read of zero bytes.
-.SH SEE ALSO
-pk(4), pkon(2)
-.SH DIAGNOSTICS
-.I Pkfail
-is called upon persistent breakdown of communication.
-.I Pkfail
-must be supplied by the user.
-.PP
-.I Pkopen
-returns a null (0) pointer if packet protocol
-can not be established.
-.PP
-.I Pkread
-returns \-1 on end of file,
-0 in correspondence with a 0-length write.
-.SH BUGS
-This simulation of
-.IR pk (4)
-leaves something to be desired
-in needing special read and write routines, and in
-not being inheritable across calls of
-.IR exec (2).
-Its prime use is on systems that lack
-.I pk.
-.br
-These functions use
-.IR alarm (2);
-simultaneous use of
-.I alarm
-for other puposes may cause trouble.
diff --git a/.ref-Research-V7/usr/man/man3/plot.3x b/.ref-Research-V7/usr/man/man3/plot.3x
deleted file mode 100644 (file)
index fc40ec0..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-.TH PLOT 3X 
-.SH NAME
-plot: openpl et al. \- graphics interface
-.SH SYNOPSIS
-.B openpl( )
-.PP
-.B erase( )
-.PP
-.B label(s)
-.B char s[ ];
-.PP
-.B line(x1, y1, x2, y2)
-.PP
-.B circle(x, y, r)
-.PP
-.B arc(x, y, x0, y0, x1, y1)
-.PP
-.B move(x, y)
-.PP
-.B cont(x, y)
-.PP
-.B point(x, y)
-.PP
-.B linemod(s)
-.B char s[ ];
-.PP
-.B space(x0, y0, x1, y1)
-.PP
-.B closepl( )
-.fi
-.PP
-.ft R
-.SH DESCRIPTION
-These subroutines
-generate
-graphic output in a relatively
-device-independent manner.
-See
-.IR  plot (5)
-for a description
-of their effect.
-.I Openpl
-must be used before any of the others to open the
-device for writing.
-.I Closepl
-flushes the output.
-.PP
-String arguments to
-.I label
-and
-.I linemod
-are null-terminated, and do not contain newlines.
-.PP
-Various flavors of these functions exist for different
-output devices. 
-They are obtained by the following
-.IR ld (1)
-options:
-.TP 8n
-.B \-lplot
-device-independent
-graphics stream on standard
-output for 
-.IR plot (1)
-filters
-.br
-.ns
-.TP
-.B \-l300
-GSI 300 terminal
-.br
-.ns
-.TP
-.B \-l300s
-GSI 300S terminal
-.br
-.ns
-.TP
-.B \-l450
-DASI 450 terminal
-.br
-.ns
-.TP
-.B \-l4014
-Tektronix 4014 terminal
-.SH "SEE ALSO"
-plot(5), plot(1), graph(1)
diff --git a/.ref-Research-V7/usr/man/man3/popen.3s b/.ref-Research-V7/usr/man/man3/popen.3s
deleted file mode 100644 (file)
index d224b99..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.TH POPEN 3S
-.SH NAME
-popen, pclose \- initiate I/O to/from a process
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.SM
-.B FILE
-.B *popen(command, type)
-.br
-.B char *command, *type;
-.PP
-.B pclose(stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-The arguments to 
-.I popen
-are pointers to null-terminated strings
-containing respectively a shell command line and an I/O
-mode, either "r" for reading or "w" for
-writing.
-It creates a pipe between
-the calling process and
-the command to be executed.
-The value returned 
-is a stream pointer that
-can be used (as appropriate) to write to the standard input
-of the command or read from its standard output.
-.PP
-A stream opened by
-.I popen
-should be closed by
-.I pclose,
-which waits for the associated process to terminate
-and returns the exit status of the command.
-.PP
-Because open files are shared, a type "r" command
-may be used as an input filter,
-and a type "w" as an output filter.
-.SH "SEE ALSO"
-pipe(2),
-fopen(3),
-fclose(3),
-system(3),
-wait(2)
-.SH DIAGNOSTICS
-.I Popen
-returns a null pointer
-if files or processes cannot be created, or the Shell 
-cannot be accessed.
-.PP
-.I Pclose
-returns \-1 if
-.I stream
-is not associated with a `popened' command.
-.SH BUGS
-Buffered reading before opening an input filter
-may leave the standard input of that filter mispositioned.
-Similar problems with an output filter may be
-forestalled by careful buffer flushing, e.g. with
-.I fflush,
-see
-.IR fclose (3).
diff --git a/.ref-Research-V7/usr/man/man3/printf.3s b/.ref-Research-V7/usr/man/man3/printf.3s
deleted file mode 100644 (file)
index 3319f12..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-.TH PRINTF 3S 
-.SH NAME
-printf, fprintf, sprintf \- formatted output conversion
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B printf(format
-.RB [ ,
-arg ] ...
-.B )
-.br
-.B char *format;
-.PP
-.B fprintf(stream, format
-.RB [ ,
-arg ] ...
-.B )
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *format;
-.PP
-.B sprintf(s, format
-.RB [ ,
-arg ] ...
-.B )
-.br
-.B char *s, format;
-.SH DESCRIPTION
-.I Printf
-places output on the standard output stream
-.IR stdout .
-.I Fprintf
-places output on the named output
-.IR stream .
-.I Sprintf
-places `output' in the string
-.I s,
-followed by the character `\\0'.
-.PP
-Each of these functions 
-converts, formats, and prints its arguments after the first
-under control of the first argument.
-The first argument is a character string
-which contains
-two types of objects:
-plain characters, which are simply copied to the
-output stream,
-and conversion specifications,
-each of which causes conversion and printing
-of the next successive
-.I arg
-.IR printf .
-.PP
-Each conversion specification is introduced by
-the character
-.BR % .
-Following the
-.BR % ,
-there may be
-.TP
-\-
-an optional minus sign `\-' which specifies
-.I "left adjustment"
-of the converted value
-in the
-indicated field;
-.TP
-\-
-an optional digit string specifying a
-.I "field width;"
-if the converted value has fewer characters
-than the field width
-it will be blank-padded on the left (or right,
-if the left-adjustment indicator has been
-given) to make up the field width;
-if the field width begins with a zero,
-zero-padding will be done instead of blank-padding;
-.TP
-\-
-an optional period
-.RB ` . '
-which serves to
-separate the field width from the
-next digit string;
-.TP
-\-
-an optional digit string
-specifying a
-.I precision
-which specifies
-the number of digits to appear after the
-decimal point, for e- and f-conversion,
-or the maximum number of characters
-to be printed from a string;
-.TP
-\-
-the character
-.B l
-specifying that a following
-.BR d ,
-.BR o ,
-.BR x ,
-or
-.B u
-corresponds to a long integer
-.I arg.
-(A capitalized conversion code accomplishes
-the same thing.)
-.TP
-\-
-a character which indicates the type of
-conversion to be applied.
-.PP
-A field width or precision may be `*' instead of a digit string.
-In this case an integer
-.I arg
-supplies
-the field width or precision.
-.PP
-The conversion characters
-and their meanings are
-.TP
-.B dox
-The integer
-.I arg
-is converted to decimal, octal, or
-hexadecimal notation respectively.
-.TP
-.B f
-The float or double
-.I arg
-is converted to decimal notation
-in the style `[\fB\-\fR]ddd.ddd'
-where the number of d's after the decimal point
-is equal to the precision specification
-for the argument.
-If the precision
-is missing,
-6 digits are given;
-if the precision is explicitly 0, no digits and
-no decimal point are printed.
-.TP
-.B e
-The float or double
-.I arg
-is converted in the style
-`[\fB\-\fR]d\fB.\fRddd\fBe\fR\(+-dd'
-where there is one digit before the decimal point and
-the number after is equal to the
-precision specification for the argument;
-when the precision is missing,
-6 digits are produced.
-.TP
-.B g
-The float or double
-.I arg
-is printed in style
-.BR d ,
-in style
-.BR f ,
-or in
-style
-.BR e ,
-whichever gives full precision in minimum space.
-.TP
-.B c
-The character
-.I arg
-is printed.
-Null characters are ignored.
-.TP
-.B s
-.I Arg
-is taken to be a string (character pointer)
-and characters from the string are printed until
-a null character or until
-the number of characters indicated by the precision
-specification is reached;
-however if the precision is 0 or missing
-all characters up to a null are printed.
-.TP
-.B u
-The unsigned integer
-.I arg
-is converted to decimal
-and printed (the result will be in the
-range 0 to 65535).
-.TP
-.B %
-Print a `%'; no argument is converted.
-.PP
-In no case does a non-existent or small field width
-cause truncation of a field;
-padding takes place only if the specified field
-width exceeds the actual width.
-Characters generated by
-.I printf
-are printed by 
-.IR putc (3).
-.PP
-.B Examples
-.br
-To print a date and time in the form `Sunday, July 3, 10:02',
-where
-.I weekday
-and
-.I month
-are pointers to null-terminated strings:
-.RS
-.HP
-.nh
-printf("%s, %s %d, %02d:%02d", weekday, month, day, hour, min);
-.RE
-.hy
-.PP
-To print
-.if n pi
-.if t \(*p
-to 5 decimals:
-.IP
-printf("pi = %.5f", 4*atan(1.0));
-.SH "SEE ALSO"
-putc(3),
-scanf(3),
-ecvt(3)
-.SH BUGS
-Very wide fields (>128 characters) fail.
diff --git a/.ref-Research-V7/usr/man/man3/putc.3s b/.ref-Research-V7/usr/man/man3/putc.3s
deleted file mode 100644 (file)
index 473caf4..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-.TH PUTC 3S 
-.SH NAME
-putc, putchar, fputc, putw \- put character or word on a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B int putc(c, stream)
-.br
-.B char c;
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B putchar(c)
-.PP
-.B fputc(c, stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.PP
-.B putw(w, stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Putc
-appends the character
-.I c
-to the named output
-.IR stream .
-It returns the character written.
-.PP
-.I Putchar(c)
-is defined as 
-.I "putc(c, stdout)."
-.PP
-.I Fputc
-behaves like 
-.I putc,
-but is a genuine function rather than a macro.
-It may be used to save on object text.
-.PP
-.I Putw
-appends word 
-(i.e.
-.BR int )
-.I w
-to the output
-.IR stream .
-It returns the word written.
-.I Putw
-neither assumes nor causes special alignment in the file.
-.PP
-The standard stream
-.I stdout
-is normally buffered if and only if the
-output does not refer to a terminal;
-this default may be changed by
-.IR setbuf (3).
-The standard stream
-.I stderr
-is by default unbuffered unconditionally,
-but use of
-.I freopen
-(see
-.IR fopen (3))
-will cause it to become buffered;
-.IR setbuf ,
-again, will set the state to whatever is desired.
-When an output stream is unbuffered information appears on the
-destination file or terminal as soon as written;
-when it is buffered many characters are saved up and written as a block.
-.I Fflush
-(see 
-.IR fclose (3))
-may be used to force the block out early.
-.SH "SEE ALSO"
-fopen(3), fclose(3), getc(3),
-puts(3), printf(3),
-fread(3)
-.SH DIAGNOSTICS
-These functions return the constant
-.SM
-.B EOF
-upon error.
-Since this is a good integer,
-.IR  ferror (3)
-should be used to detect 
-.I putw
-errors.
-.SH BUGS
-Because it is implemented as a macro,
-.I putc
-treats a
-.I stream
-argument with side effects improperly.
-In particular
-`putc(c, *f++);'
-doesn't work sensibly.
diff --git a/.ref-Research-V7/usr/man/man3/puts.3s b/.ref-Research-V7/usr/man/man3/puts.3s
deleted file mode 100644 (file)
index 7457fbb..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-.TH PUTS 3S 
-.SH NAME
-puts, fputs \- put a string on a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B puts(s)
-.br
-.B char *s;
-.PP
-.B fputs(s, stream)
-.br
-.B char *s;
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Puts
-copies the null-terminated string
-.I s
-to the standard output stream
-.I stdout
-and appends a
-newline character.
-.PP
-.I Fputs
-copies the null-terminated string
-.I s
-to the named output
-.IR stream .
-.PP
-Neither routine copies the terminal null character.
-.SH "SEE ALSO"
-fopen(3), gets(3),
-putc(3), printf(3),
-ferror(3)
-.br
-fread(3) for
-.I fwrite
-.SH BUGS
-.I Puts
-appends a newline,
-.I fputs
-does not, all in the name of backward compatibility.
diff --git a/.ref-Research-V7/usr/man/man3/qsort.3 b/.ref-Research-V7/usr/man/man3/qsort.3
deleted file mode 100644 (file)
index 8a0e69b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH QSORT 3 
-.SH NAME
-qsort \- quicker sort
-.SH SYNOPSIS
-.B qsort(base, nel, width, compar)
-.br
-.B char *base;
-.br
-.B int (*compar)( );
-.SH DESCRIPTION
-.I Qsort
-is an implementation
-of the quicker-sort algorithm.
-The first argument is a pointer to the base of the data;
-the second is the number of elements;
-the third is the width of an element
-in bytes;
-the last is the name of the comparison routine
-to be called with two arguments which are pointers
-to the elements being compared.
-The routine must return
-an integer less than, equal to, or greater than 0
-according as the first argument is to be considered
-less than, equal to, or greater than the second.
-.SH "SEE ALSO"
-sort(1)
diff --git a/.ref-Research-V7/usr/man/man3/rand.3 b/.ref-Research-V7/usr/man/man3/rand.3
deleted file mode 100644 (file)
index 147360f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.TH RAND 3 
-.SH NAME
-rand, srand \- random number generator
-.SH SYNOPSIS
-.B srand(seed)
-.br
-.B int seed;
-.PP
-.B rand( )
-.SH DESCRIPTION
-.I Rand
-uses a multiplicative congruential
-random number generator
-with period 2\u\s732\s0\d
-to return successive pseudo-random
-numbers in the range from 0 to 2\u\s715\s10\d\-1.
-.PP
-The generator is reinitialized by calling
-.I srand
-with 1 as argument.
-It can be set to a random starting point by calling
-.I srand
-with whatever you like as argument.
diff --git a/.ref-Research-V7/usr/man/man3/scanf.3s b/.ref-Research-V7/usr/man/man3/scanf.3s
deleted file mode 100644 (file)
index eddd65d..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-.TH SCANF 3S 
-.SH NAME
-scanf, fscanf, sscanf \- formatted input conversion
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B scanf(format
-[ , pointer ] . . .
-.B )
-.br
-.B char *format;
-.PP
-.B fscanf(stream, format
-[ , pointer ] . . .
-.B )
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *format;
-.PP
-.B sscanf(s, format
-[ , pointer ] . . .
-.B )
-.br
-.B char *s, *format;
-.SH DESCRIPTION
-.I Scanf
-reads from the standard input stream
-.IR stdin .
-.I Fscanf
-reads from the named input
-.IR stream .
-.I Sscanf
-reads from the character string
-.IR s .
-Each function reads characters, interprets
-them according to a format, and stores the results in its arguments.
-Each expects as arguments
-a control string
-.I format,
-described below,
-and a set of
-.I pointer
-arguments
-indicating where the converted input should be stored.
-.PP
-The
-control string
-usually contains
-conversion specifications, which are used to direct interpretation
-of input sequences.
-The control string may contain:
-.TP 4
-1.
-Blanks, tabs or newlines,
-which match optional white space in the input.
-.TP 4
-2.
-An ordinary character (not %) which must match
-the next character of the input stream.
-.TP 4
-3.
-Conversion specifications, consisting of the
-character
-.BR % ,
-an optional assignment suppressing character
-.BR * ,
-an optional numerical maximum field width, and a conversion
-character.
-.PP
-A conversion specification directs the conversion of the
-next input field; the result
-is placed in the variable pointed to by the corresponding argument,
-unless assignment suppression was
-indicated by
-.BR * .
-An input field is defined as a string of non-space characters;
-it extends to the next inappropriate character or until the field
-width, if specified, is exhausted.
-.PP
-The conversion character indicates the interpretation of the
-input field; the corresponding pointer argument must
-usually be of a restricted type.
-The following conversion characters are legal:
-.TP 4
-.B  %
-a single `%' is expected
-in the input at this point;
-no assignment is done.
-.TP 4
-.B  d
-a decimal integer is expected;
-the corresponding argument should be an integer pointer.
-.TP 4
-.B  o
-an octal integer is expected;
-the corresponding argument should be a integer pointer.
-.TP 4
-.B  x
-a hexadecimal integer is expected;
-the corresponding argument should be an integer pointer.
-.ti -0.2i
-.TP 4
-.B  s
-a character string is expected;
-the corresponding argument should be a character pointer
-pointing to an array of characters large enough to accept the
-string and a terminating `\e0', which will be added.
-The input field is terminated by a space character
-or a newline.
-.TP 4
-.B  c
-a character is expected; the
-corresponding argument should be a character pointer.
-The normal skip over space characters is suppressed
-in this case;
-to read the next non-space character, try
-`%1s'.
-If a field width is given, the corresponding argument
-should refer to a character array, and the
-indicated number of characters is read.
-.TP 4
-\z\fBe\v'1'f\v'-1'\fR
-a
-floating point number is expected;
-the next field is converted accordingly and stored through the
-corresponding argument, which should be a pointer to a
-.IR float .
-The input format for
-floating point numbers is
-an optionally signed
-string of digits
-possibly containing a decimal point, followed by an optional
-exponent field consisting of an E or e followed by an optionally signed integer.
-.TP 4
-.B  [
-indicates a string not to be delimited by space characters.
-The left bracket is followed by a set of characters and a right
-bracket; the characters between the brackets define a set
-of characters making up the string.
-If the first character
-is not circumflex (\|^\|), the input field
-is all characters until the first character not in the set between
-the brackets; if the first character
-after the left bracket is ^, the input field is all characters
-until the first character which is in the remaining set of characters
-between the brackets.
-The corresponding argument must point to a character array.
-.PP
-The conversion characters
-.BR d ,
-.B o
-and
-.B x
-may be capitalized or preceeded by
-.B l
-to indicate that a pointer to
-.B long
-rather than to
-.B int
-is in the argument list.
-Similarly, the conversion characters
-.B e
-or
-.B f
-may be capitalized or
-preceded by
-.B l
-to indicate a pointer to 
-.B double
-rather than to 
-.BR float .
-The conversion characters
-.BR d ,
-.B o
-and
-.B x
-may be preceeded by
-.B h
-to indicate a pointer to
-.B short
-rather than to
-.BR int .
-.PP
-The
-.I scanf
-functions return the number of successfully matched and assigned input
-items.
-This can be used to decide how many input items were found.
-The constant
-.SM
-.B EOF
-is returned upon end of input; note that this is different
-from 0, which means that no conversion was done;
-if conversion was intended, it was frustrated by an
-inappropriate character in the input.
-.PP
-For example, the call
-.IP "" 10
-int i; float x; char name[50];
-.br
-scanf( "%d%f%s", &i, &x, name);
-.PP
-with the input line
-.IP
-25   54.32E\(mi1  thompson
-.PP
-will assign to
-.I i
-the value
-25,
-.I x
-the value 5.432, and
-.I name
-will contain
-.IR `thompson\e0' .
-Or,
-.IP
-int i; float x; char name[50];
-.br
-scanf("%2d%f%*d%[1234567890]", &i, &x, name);
-.PP
-with input
-.IP
-56789 0123 56a72
-.PP
-will assign 56 to
-.I i,
-789.0 to
-.I x,
-skip `0123',
-and place the string `56\e0' in
-.IR name .
-The next call to
-.I getchar
-will return `a'.
-.SH "SEE ALSO"
-atof(3),
-getc(3), printf(3)
-.SH DIAGNOSTICS
-The 
-.I scanf
-functions return
-.SM
-.B EOF
-on end of input,
-and a short count for missing or illegal data items.
-.SH BUGS
-The success of literal matches and suppressed
-assignments is not directly
-determinable.
diff --git a/.ref-Research-V7/usr/man/man3/setbuf.3s b/.ref-Research-V7/usr/man/man3/setbuf.3s
deleted file mode 100644 (file)
index 6d808b0..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-.TH SETBUF 3S 
-.SH NAME
-setbuf \- assign buffering to a stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B setbuf(stream, buf)
-.br
-.SM
-.B FILE
-.B *stream;
-.br
-.B char *buf;
-.SH DESCRIPTION
-.I Setbuf
-is used after a stream has been opened but before it
-is read or written.
-It causes the character array
-.I buf
-to be used instead of an automatically allocated buffer.
-If
-.I buf
-is the constant pointer
-.SM
-.B NULL,
-input/output will be completely unbuffered.
-.PP
-A manifest constant 
-.SM
-.B BUFSIZ
-tells how big an array is needed:
-.PP
-.in +10
-char buf[BUFSIZ];
-.PP
-A buffer is normally obtained from
-.IR  malloc (3)
-upon the first
-.I getc
-or
-.IR  putc (3)
-on the file,
-except that output streams directed to terminals,
-and the standard error stream
-.I stderr
-are normally not buffered.
-.SH "SEE ALSO"
-fopen(3), getc(3), putc(3), malloc(3)
diff --git a/.ref-Research-V7/usr/man/man3/setjmp.3 b/.ref-Research-V7/usr/man/man3/setjmp.3
deleted file mode 100644 (file)
index aae8841..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-.TH SETJMP 3
-.SH NAME
-setjmp, longjmp \- non-local goto
-.SH SYNOPSIS
-.B #include <setjmp.h>
-.PP
-.B setjmp(env)
-.br
-.B jmp_buf env;
-.PP
-.B longjmp(env, val)
-.br
-.B jmp_buf env;
-.SH DESCRIPTION
-These routines are useful for dealing with errors 
-and interrupts encountered in
-a low-level subroutine of a program.
-.PP
-.I Setjmp 
-saves its stack environment in
-.I env
-for later use by
-.I longjmp.
-It returns value 0.
-.PP
-.I Longjmp
-restores the environment saved by the last call of
-.IR setjmp .
-It then returns in such a way that execution
-continues as if the call of 
-.I setjmp
-had just returned the value
-.I val
-to the function that invoked
-.I setjmp,
-which must not itself have returned in the interim.
-All accessible data have values as of the time
-.I longjmp
-was called.
-.SH "SEE ALSO"
-signal(2)
diff --git a/.ref-Research-V7/usr/man/man3/sin.3m b/.ref-Research-V7/usr/man/man3/sin.3m
deleted file mode 100644 (file)
index b94767c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-.TH SIN 3M 
-.SH NAME
-sin, cos, tan, asin, acos, atan, atan2 \- trigonometric functions
-.SH SYNOPSIS
-.B #include <math.h>
-.PP
-.B double sin(x)
-.br
-.B double x;
-.PP
-.B double cos(x)
-.br
-.B double x;
-.PP
-.B double asin(x)
-.br
-.B double x;
-.PP
-.B double acos(x)
-.br
-.B double x;
-.PP
-.B double atan(x)
-.br
-.B double x;
-.PP
-.B double atan2(x, y)
-.br
-.B double x, y;
-.SH DESCRIPTION
-.I Sin, cos
-and
-.I tan
-return trigonometric functions of radian arguments.
-The magnitude of the argument should be checked
-by the caller to make sure the result is meaningful.
-.PP
-.I Asin
-returns the arc sin in the range \-\(*p/2 to \(*p/2.
-.PP
-.I Acos
-returns the arc cosine in the range
-0 to \(*p.
-.PP
-.I Atan
-returns the arc tangent of
-.I x
-in the range \-\(*p/2 to \(*p/2.
-.PP
-.I Atan2
-returns the arc tangent of
-.I x/y
-in the range \-\(*p to \(*p.
-.SH DIAGNOSTICS
-Arguments of magnitude greater than 1
-cause
-.I asin
-and
-.I acos
-to return value 0;
-.I errno
-is set to EDOM.
-The value of
-.I tan
-at its singular points is a huge number, and
-.I errno
-is set to ERANGE.
-.SH BUGS
-The value of
-.I tan
-for arguments greater than about 2**31 is garbage.
diff --git a/.ref-Research-V7/usr/man/man3/sinh.3m b/.ref-Research-V7/usr/man/man3/sinh.3m
deleted file mode 100644 (file)
index dd95735..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-.TH SINH 3M
-.SH NAME
-sinh, cosh, tanh \- hyperbolic functions
-.SH SYNOPSIS
-.B #include <math.h>
-.PP
-.B double sinh(x)
-.br
-.B double x;
-.PP
-.B double cosh(x)
-.br
-.B double x;
-.PP
-.B double tanh(x)
-.br
-.B double x;
-.SH DESCRIPTION
-These functions compute the designated hyperbolic functions
-for real arguments.
-.SH DIAGNOSTICS
-.I Sinh
-and
-.I cosh
-return a huge value of appropriate sign
-when the correct value would overflow.
diff --git a/.ref-Research-V7/usr/man/man3/sleep.3 b/.ref-Research-V7/usr/man/man3/sleep.3
deleted file mode 100644 (file)
index a62945c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-.TH SLEEP 3 
-.SH NAME
-sleep \- suspend execution for interval
-.SH SYNOPSIS
-.B sleep(seconds)
-.br
-.B unsigned seconds;
-.SH DESCRIPTION
-The current process is suspended from execution for the number
-of seconds specified by the argument.
-The actual suspension time may be up to 1 second less than
-that requested, because scheduled wakeups occur at fixed 1-second intervals,
-and an arbitrary amount longer because of other activity
-in the system.
-.PP
-The routine is implemented by setting an alarm clock signal
-and pausing until it occurs.
-The previous state of this signal is saved and restored.
-If the sleep time exceeds the time to the alarm signal,
-the process sleeps only until the signal would have occurred, and the
-signal is sent 1 second later.
-.SH "SEE ALSO"
-alarm(2), pause(2)
diff --git a/.ref-Research-V7/usr/man/man3/stdio.3s b/.ref-Research-V7/usr/man/man3/stdio.3s
deleted file mode 100644 (file)
index 0a8f606..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-.TH STDIO 3S 
-.SH NAME
-stdio \- standard buffered input/output package
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.SM
-.B FILE
-.B *stdin;
-.br
-.SM
-.B FILE
-.B *stdout;
-.br
-.SM
-.B FILE
-.B *stderr;
-.SH DESCRIPTION
-The functions described in Sections 3S constitute an efficient
-user-level buffering scheme.
-The in-line macros
-.I getc
-and
-.IR  putc (3)
-handle characters quickly.
-The higher level routines
-.I "gets, fgets, scanf, fscanf, fread,"
-.I "puts, fputs, printf, fprintf, fwrite"
-all use
-.I getc
-and
-.I putc;
-they can be freely intermixed.
-.PP
-A file with associated buffering is called a
-.I stream,
-and is declared to be a pointer to a defined type
-.SM
-.B FILE.
-.IR  Fopen (3)
-creates certain descriptive data for a stream
-and returns a pointer to designate the stream in all
-further transactions.
-There are three normally open streams with constant
-pointers declared in
-the include file and associated with the standard open files:
-.TP 10n
-.BR stdin
-standard input file
-.br
-.ns
-.TP
-.B stdout
-standard output file
-.br
-.ns
-.TP
-.BR stderr
-standard error file
-.PP
-A constant `pointer'
-.SM
-.B NULL
-(0)
-designates no stream at all.
-.PP
-An integer constant
-.SM
-.B EOF
-(\-1) is returned
-upon end of file or error by integer functions that
-deal with streams.
-.PP
-Any routine that uses the standard input/output package
-must include the header file <stdio.h> of pertinent
-macro definitions.
-The functions and constants mentioned in sections labeled 3S
-are declared in the include file
-and need no further declaration.
-The constants, and the following `functions' are
-implemented as macros; redeclaration of these names
-is perilous:
-.I getc,
-.I getchar,
-.I putc,
-.I putchar,
-.I feof,
-.I ferror,
-.IR fileno .
-.SH "SEE ALSO"
-open(2), close(2), read(2), write(2)
-.SH DIAGNOSTICS
-The value
-.SM
-.B EOF
-is returned uniformly to indicate that a
-.SM
-.B FILE
-pointer has not been initialized with
-.I fopen,
-input (output) has been attempted on an output (input) stream,
-or a
-.SM
-.B FILE
-pointer designates corrupt or otherwise unintelligible
-.SM
-.B FILE
-data.
diff --git a/.ref-Research-V7/usr/man/man3/string.3 b/.ref-Research-V7/usr/man/man3/string.3
deleted file mode 100644 (file)
index 47c4e3f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-.TH STRING 3 
-.SH NAME
-strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen, index, rindex \- string operations
-.SH SYNOPSIS
-.B char *strcat(s1, s2)
-.br
-.B char *s1, *s2;
-.PP
-.B char *strncat(s1, s2, n)
-.br
-.B char *s1, *s2;
-.PP
-.B strcmp(s1, s2)
-.br
-.B char *s1, *s2;
-.PP
-.B strncmp(s1, s2, n)
-.br
-.B char *s1, *s2;
-.PP
-.B char *strcpy(s1, s2)
-.br
-.B char *s1, *s2;
-.PP
-.B char *strncpy(s1, s2, n)
-.br
-.B char *s1, *s2;
-.PP
-.B strlen(s)
-.br
-.B char *s;
-.PP
-.B char *index(s, c)
-.br
-.B char *s, c;
-.PP
-.B char *rindex(s, c)
-.br
-.B char *s;
-.SH DESCRIPTION
-These functions operate on null-terminated strings.
-They do not check for overflow of any receiving string.
-.PP
-.I Strcat
-appends a copy of string
-.I s2
-to the end of string
-.IR s1 .
-.I Strncat
-copies at most
-.I n
-characters.
-Both return a pointer to the null-terminated result.
-.PP
-.I Strcmp
-compares its arguments and returns an integer
-greater than, equal to, or less than 0,
-according as
-.I s1
-is lexicographically greater than, equal to, or
-less than
-.IR s2 .
-.I Strncmp
-makes the same comparison but looks at at most
-.I n
-characters.
-.PP
-.I Strcpy
-copies string
-.I s2
-to
-.I s1,
-stopping after the null character has been moved.
-.I Strncpy
-copies exactly
-.I n
-characters,
-truncating or null-padding
-.I s2;
-the target may not be null-terminated if the length
-of
-.I s2
-is
-.I n
-or more.
-Both return
-.IR s1 .
-.PP
-.I Strlen
-returns the number of non-null characters in
-.IR s .
-.PP
-.I Index
-.RI ( rindex )
-returns a pointer to the first (last)
-occurrence of character 
-.I c
-in string
-.I s,
-or zero if
-.I c
-does not occur in  the string.
-.SH BUGS
-.I Strcmp 
-uses native character comparison, which is signed
-on PDP11's, unsigned on other machines.
diff --git a/.ref-Research-V7/usr/man/man3/swab.3 b/.ref-Research-V7/usr/man/man3/swab.3
deleted file mode 100644 (file)
index 7265581..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-.TH SWAB 3 
-.SH NAME
-swab \- swap bytes
-.SH SYNOPSIS
-.B swab(from, to, nbytes)
-.br
-.B char *from, *to;
-.SH DESCRIPTION
-.I Swab
-copies
-.I nbytes
-bytes pointed to by
-.I from
-to the position pointed to by
-.I to,
-exchanging adjacent even and odd bytes.
-It is useful for carrying binary data between
-PDP11's and other machines.
-.I Nbytes
-should be even.
diff --git a/.ref-Research-V7/usr/man/man3/system.3 b/.ref-Research-V7/usr/man/man3/system.3
deleted file mode 100644 (file)
index f56c3ff..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-.TH SYSTEM 3
-.SH NAME
-system \- issue a shell command 
-.SH SYNOPSIS
-.B system(string)
-.br
-.B char *string;
-.SH DESCRIPTION
-.I System
-causes the
-.I string
-to be given to
-.IR  sh (1)
-as input as if the string had been typed as a command
-at a terminal.
-The current process waits until the shell has
-completed, then returns the exit status of the shell.
-.SH "SEE ALSO"
-popen(3),
-exec(2), wait(2)
-.SH DIAGNOSTICS
-Exit status 127 indicates the shell couldn't be executed.
diff --git a/.ref-Research-V7/usr/man/man3/ttyname.3 b/.ref-Research-V7/usr/man/man3/ttyname.3
deleted file mode 100644 (file)
index b7d15ee..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-.TH TTYNAME 3 
-.SH NAME
-ttyname, isatty, ttyslot \- find name of a terminal
-.SH SYNOPSIS
-.B char *ttyname(fildes)
-.PP
-.B isatty(fildes)
-.PP
-.B ttyslot()
-.SH DESCRIPTION
-.I Ttyname
-returns a pointer to the null-terminated path name
-of the terminal device associated with file descriptor
-.IR fildes .
-.PP
-.I Isatty
-returns 1 if
-.I fildes
-is associated with a terminal device, 0 otherwise.
-.PP
-.I Ttyslot
-returns the number of the entry in the
-.IR ttys (5)
-file for the control terminal of the
-current process.
-.SH FILES
-/dev/*
-.br
-/etc/ttys
-.SH SEE ALSO
-ioctl(2), ttys(5)
-.SH DIAGNOSTICS
-.I Ttyname
-returns a null pointer (0) if
-.I fildes
-does not describe a terminal device in directory `/dev'.
-.PP
-.I Ttyslot
-returns 0 if `/etc/ttys' is inaccessible or if
-it cannot determine the control terminal.
-.SH BUGS
-The return value points to static data
-whose content is overwritten by each call.
diff --git a/.ref-Research-V7/usr/man/man3/ungetc.3s b/.ref-Research-V7/usr/man/man3/ungetc.3s
deleted file mode 100644 (file)
index a8fecad..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH UNGETC 3S 
-.SH NAME
-ungetc \- push character back into input stream
-.SH SYNOPSIS
-.B #include <stdio.h>
-.PP
-.B ungetc(c, stream)
-.br
-.SM
-.B FILE
-.B *stream;
-.SH DESCRIPTION
-.I Ungetc
-pushes the character
-.I c
-back on an input stream.
-That character will be returned by the next
-.I getc
-call on that stream.
-.I Ungetc 
-returns 
-.IR c .
-.PP
-One character of pushback is guaranteed provided
-something has been read from the stream and the stream is
-actually buffered.
-Attempts to push EOF are rejected.
-.PP
-.IR  Fseek (3)
-erases all memory of pushed back characters.
-.SH "SEE ALSO"
-getc(3), setbuf(3), fseek(3)
-.SH DIAGNOSTICS
-.I Ungetc
-returns
-.SM
-.B EOF
-if it can't push a character back.
diff --git a/.ref-Research-V7/usr/man/man4/cat.4 b/.ref-Research-V7/usr/man/man4/cat.4
deleted file mode 100644 (file)
index 9053a00..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-.TH CAT 4 
-.SH NAME
-cat \- phototypesetter interface
-.SH DESCRIPTION
-.I Cat
-provides the interface to a Graphic Systems C/A/T
-phototypesetter.
-Bytes written on the file specify font, size, and other control
-information as well as the characters to be flashed.
-The coding will not be described here.
-.PP
-Only one process may have
-this file open at a time.
-It is write-only.
-.SH FILES
-/dev/cat
-.SH "SEE ALSO"
-troff(1)
-.br
-Phototypesetter interface specification
diff --git a/.ref-Research-V7/usr/man/man4/dn.4 b/.ref-Research-V7/usr/man/man4/dn.4
deleted file mode 100644 (file)
index 7022821..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-.TH DN 4 
-.SH NAME
-dn \- DN-11 ACU interface
-.SH DESCRIPTION
-The
-.I dn?
-files
-are write-only.
-The permissible codes are:
-.TP
-0-9
-dial 0-9
-.br
-.ns
-.TP
-.B :
-dial *
-.br
-.ns
-.TP
-.B ;
-dial #
-.br
-.ns
-.TP
-\-
-4 second delay for second dial tone
-.br
-.ns
-.TP
-<
-end-of-number
-.PP
-The entire telephone number must be
-presented in a single
-.I write
-system call.
-.PP
-It is recommended that an end-of-number
-code be given even though not all
-ACU's actually require it.
-.DT
-.SH FILES
-/dev/dn0       connected to 801 with dp0
-.br
-/dev/dn1       not currently connected
-.br
-/dev/dn2       not currently connected
-.SH "SEE ALSO"
-dp(4)
diff --git a/.ref-Research-V7/usr/man/man4/du.4 b/.ref-Research-V7/usr/man/man4/du.4
deleted file mode 100644 (file)
index e3366b5..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-.TH DU 4 
-.SH NAME
-du, dp \- DU-11 201 data-phone interface
-.SH DESCRIPTION
-The
-.I dp0
-file
-is a 201 data-phone interface.
-.I Read
-and
-.I write
-calls
-to dp0
-are limited to a maximum of 512 bytes.
-Each write call is sent as a single record.
-Seven bits from each byte
-are written along with an eighth odd parity
-bit.
-The sync must be user supplied.
-Each read call returns characters received from a
-single record.
-Seven bits are returned unaltered; the eighth bit
-is set if the byte was not received in odd parity.
-A 10 second time out is set and a zero-byte
-record is returned if nothing is received in that time.
-.SH FILES
-/dev/dp0
-.SH "SEE ALSO"
-dn(4)
-.SH BUGS
-The name
-.I dp0
-is a historical dreg.
diff --git a/.ref-Research-V7/usr/man/man4/hp.4 b/.ref-Research-V7/usr/man/man4/hp.4
deleted file mode 100644 (file)
index 04f00ad..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-.TH HP 4 
-.SH NAME
-hp \- RH-11/RP04, RP05, RP06 moving-head disk
-.SH DESCRIPTION
-The octal representation of the minor device number is encoded
-.IR idp ,
-where
-.I i
-is an interleave flag,
-.I d
-is a physical drive number,
-and
-.I p
-is a pseudodrive (subsection) within a physical unit.
-If
-.I i
-is 0,
-the origins and sizes of the pseudodisks on each drive,
-counted in cylinders of 418 512-byte blocks, are:
-.nf
-.PP
-       disk    start   length
-       0       0       23
-       1       23      21
-       2       0       0
-       3       0       0
-       4       44      386
-       5       430     385
-       6       44      367
-       7       44      771
-.fi
-.PP
-If
-.I i
-is 1, the minor device consists of the specified 
-pseudodisk on drives numbered 0 through the designated
-drive number.
-Successively numbered blocks are distributed
-across the drives in rotation.
-.PP
-Systems distributed for these devices
-use disk 0 for the root, disk 1 for swapping, and
-disk 4 (RP04/5) or disk 7 (RP06) for a mounted
-user file system.
-.PP
-The
-block
-files
-access the disk via the system's normal
-buffering mechanism
-and may be read and written without regard to
-physical disk records.
-.PP
-A `raw' interface
-provides for direct transmission between the disk
-and the user's read or write buffer.
-A single read or write call results in exactly one I/O operation
-and therefore raw I/O is considerably more efficient when
-many words are transmitted.
-The names of the raw files
-conventionally
-begin with
-an extra `r.'
-In raw I/O the buffer must begin on a word boundary,
-and raw I/O to an interleaved device is likely to have
-disappointing results.
-.SH FILES
-/dev/rp?, /dev/rrp?
-.SH SEE ALSO
-rp(4)
-.SH BUGS
-In raw I/O
-.I read
-and
-.IR write (2)
-truncate file offsets to 512-byte block boundaries,
-and
-.I write
-scribbles on the tail of incomplete blocks.
-Thus,
-in programs that are likely to access raw devices,
-.I read, write
-and
-.IR lseek (2)
-should always deal in 512-byte multiples.
-.PP
-Raw device drivers don't work on interleaved devices.
diff --git a/.ref-Research-V7/usr/man/man4/hs.4 b/.ref-Research-V7/usr/man/man4/hs.4
deleted file mode 100644 (file)
index ad53700..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-.TH HS 4 
-.SH NAME
-hs \- RH11/RS03-RS04 fixed-head disk file
-.SH DESCRIPTION
-The files
-.I "hs0 ... hs7"
-refer to
-RJS03 disk drives 0 through 7.
-The files
-.I "hs8 ... hs15"
-refer to
-RJS04 disk drives 0 through 7.
-The RJS03 drives are each 1024 blocks long and
-the RJS04 drives are 2048 blocks long.
-.PP
-The
-.I hs
-files
-access the disk via the system's normal
-buffering mechanism
-and may be read and written without regard to
-physical disk records.
-There is also a `raw' inteface
-which provides for direct transmission between the disk
-and the user's read or write buffer.
-A single read or write call results in exactly one I/O operation
-and therefore raw I/O is considerably more efficient when
-many words are transmitted.
-The names of the raw HS files begin with
-.IR rhs .
-The same minor device considerations
-hold for the raw interface as for the normal interface.
-.PP
-In raw I/O the buffer must begin on a word boundary,
-and counts should be a multiple of 512 bytes
-(a disk block).
-Likewise
-.I lseek
-calls should specify a multiple of 512 bytes.
-.SH FILES
-/dev/hs?, /dev/rhs?
diff --git a/.ref-Research-V7/usr/man/man4/ht.4 b/.ref-Research-V7/usr/man/man4/ht.4
deleted file mode 100644 (file)
index 62f7fd5..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-.TH HT 4 
-.SH NAME
-ht \- RH-11/TU-16 magtape interface
-.SH DESCRIPTION
-The files
-.I mt0, mt1, ...
-refer to the DEC RH/TM/TU16 magtape.
-When opened for reading or writing,
-the tape is not rewound.
-When closed, it is rewound (unless the 0200 bit is on, see below).
-If the tape was open for writing, a double end-of-file is written.
-If the tape is not to be rewound the 
-tape is backspaced to just between the two
-tapemarks.
-.PP
-A standard tape consists of a
-series of 512 byte records terminated by a double
-end-of-file.
-To the extent possible, the system makes
-it possible, if inefficient, to treat
-the tape like any other file.
-Seeks have their usual meaning and it is possible
-to read or write a byte at a time.
-Writing in very small units is inadvisable,
-however, because it tends to create monstrous record
-gaps.
-.PP
-The last octal digit of the minor device
-number selects the drive.
-The middle digit selects a controller.
-The initial digit is even to select 800 BPI,
-odd to select 1600 BPI.
-If the 0200 bit is on (initial digit 2 or 3), the tape is not rewound
-on close.
-Note that the
-minor device number has no necessary connection
-with the file name, and in fact
-.IR tp (1)
-turns the short name
-.I x
-into
-.RI `/dev/mt x '.
-.PP
-The
-.I mt
-files discussed above are useful
-when it is desired to access the tape in a way
-compatible with ordinary files.
-When foreign tapes are to be dealt with, and especially
-when long records are to be read or written, the
-`raw' interface is appropriate.
-The associated files may be named
-.I "rmt0, ..., rmt7,"
-but the same minor-device considerations
-as for the regular files still apply.
-.PP
-Each
-.I read
-or
-.I write
-call reads or writes the next record on the tape.
-In the write case the record has the same length as the
-buffer given.
-During a read, the record size is passed
-back as the number of bytes read, provided it is no greater
-than the buffer size;
-if the record is long, an error is indicated.
-In raw tape I/O, the buffer must begin on a word boundary
-and the count must be even.
-Seeks are ignored.
-A zero count is returned when a tape mark is read;
-another read will fetch the first record of the
-next tape file.
-.SH FILES
-/dev/mt?,
-/dev/rmt?
-.SH "SEE ALSO"
-tp(1)
-.SH BUGS
-The magtape system is supposed to be able
-to take 64 drives.
-Such addressing has never been tried.
-.PP
-Taking a drive off line, or running off the end of tape,
-while writing have been known to hang the system.
-.PP
-If any non-data error is encountered, it refuses to do anything
-more until closed.
-In raw I/O, there should be a way
-to perform forward and backward record and file spacing and
-to write an EOF mark explicitly.
diff --git a/.ref-Research-V7/usr/man/man4/mem.4 b/.ref-Research-V7/usr/man/man4/mem.4
deleted file mode 100644 (file)
index e3f6612..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.TH MEM 4 
-.SH NAME
-mem, kmem  \-  core memory
-.SH DESCRIPTION
-.I Mem
-is a special file that is an image of the core memory
-of the computer.
-It may be used, for example, to examine,
-and even to patch the system.
-.I Kmem
-is the same as 
-.I mem
-except that kernel virtual memory
-rather than physical memory is accessed.
-.PP
-Byte addresses
-are interpreted as memory addresses.
-References to non-existent locations return errors.
-.PP
-Examining and patching device registers is likely
-to lead to unexpected results when read-only or write-only
-bits are present.
-.PP
-On PDP11's, the I/O page
-begins at location 0160000 of
-.I kmem
-and per-process data for the current process
-begins at 0140000.
-.SH FILES
-/dev/mem,
-/dev/kmem
-.SH BUGS
-On PDP11's, memory files are accessed one byte
-at a time, an inapproriate method for some
-device registers.
diff --git a/.ref-Research-V7/usr/man/man4/null.4 b/.ref-Research-V7/usr/man/man4/null.4
deleted file mode 100644 (file)
index a464301..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-.TH NULL 4 
-.SH NAME
-null \- data sink
-.SH DESCRIPTION
-Data written on 
-a null special file
-is discarded.
-.PP
-Reads from 
-a null special file
-always return 0 bytes.
-.SH FILES
-/dev/null
diff --git a/.ref-Research-V7/usr/man/man4/pk.4 b/.ref-Research-V7/usr/man/man4/pk.4
deleted file mode 100644 (file)
index 995019b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH PK 4   local
-.SH NAME
-pk \- packet driver
-.SH DESCRIPTION
-The packet driver
-implements a full-duplex end-to-end flow control strategy
-for machine-to-machine communication.
-Packet driver protocol is established by
-calling
-.IR pkon (2)
-with a character device file descriptor and
-a desired packet size in bytes.
-The packet size must be a power of 2,
-.RI 32\(<= size \(<=4096.
-The file descriptor
-must represent an 8-bit data path.
-This is normally obtained by  setting
-the device in raw mode
-(see
-.IR ioctl (2)).
-.PP
-The actual packet size, which may be smaller than
-the desired packet size, is arrived at by
-negotiation with the packet driver
-at the remote end of the data link.
-.PP
-The packet driver maintains two
-data areas
-for incoming and outgoing packets.
-The output area is needed to implement retransmission
-on errors,
-and
-arriving packets are queued in the input area.
-Data arriving for a file not open for reading is discarded.
-Initially the size of both areas is set
-to two packets.
-.PP
-It is not necessary that reads and writes
-be multiples of the packet size although
-there is less system overhead if they are.
-Read operations return the maximum amount of data
-available from the input area up to the 
-number of bytes specified in the system call.
-The buffer sizes in write operations
-are not normally transmitted across the link.
-However, writes of zero length are treated specially
-and are reflected at the remote end as a
-zero-length read.
-This facilitates marking the serial byte stream,
-usually for delimiting files.
-.PP
-When one side of a packet driver link is shut down by 
-.IR close (2) or
-.I pkoff
-(see
-.IR pkon (2)),
-.IR read (2)
-on the other side will return 0, and
-.I write
-on the other side
-will raise a SIGPIPE signal.
-.SH "SEE ALSO"
-pkon(2), pkopen(3)
diff --git a/.ref-Research-V7/usr/man/man4/rf.4 b/.ref-Research-V7/usr/man/man4/rf.4
deleted file mode 100644 (file)
index b2995c6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-.TH RF 4 
-.SH NAME
-rf \- RF11/RS11 fixed-head disk file
-.SH DESCRIPTION
-This file refers to the
-concatenation of all RS-11 disks.
-.PP
-Each disk contains 1024 256-word blocks.
-The length of the combined RF file is
-1024\(mu(minor+1) blocks.
-That is minor device zero
-is taken to be
-1024 blocks long;
-minor device one is 2048,
-etc.
-.PP
-The
-.I rf0
-file
-accesses the disk via the system's normal
-buffering mechanism
-and may be read and written without regard to
-physical disk records.
-There is also a `raw' interface
-which provides for direct transmission between the disk
-and the user's read or write buffer.
-A single read or write call results in exactly one I/O operation
-and therefore raw I/O is considerably more efficient when
-many words are transmitted.
-The name of the raw RF file is
-.IR rrf0 .
-The same minor device considerations
-hold for the raw interface as for the normal interface.
-.PP
-In raw I/O the buffer must begin on a word boundary,
-and counts should be a multiple of 512 bytes
-(a disk block).
-Likewise
-.I seek
-calls should specify a multiple of 512 bytes.
-.SH FILES
-/dev/rf0, /dev/rrf0
-.SH BUGS
-The 512-byte restrictions on the raw device are not
-physically necessary,
-but are still imposed.
diff --git a/.ref-Research-V7/usr/man/man4/rk.4 b/.ref-Research-V7/usr/man/man4/rk.4
deleted file mode 100644 (file)
index fb14baa..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH RK 4 
-.SH NAME
-rk  \-  RK-11/RK03 or RK05 disk
-.SH DESCRIPTION
-.I Rk?
-refers to an entire disk as a single sequentially-addressed
-file.
-Its 256-word blocks are numbered 0 to 4871.
-Minor device numbers are drive numbers on one controller.
-.PP
-The
-.I rk
-files
-discussed above access the disk via the system's normal
-buffering mechanism
-and may be read and written without regard to
-physical disk records.
-There is also a `raw' interface
-which provides for direct transmission between the disk
-and the user's read or write buffer.
-A single read or write call results in exactly one I/O operation
-and therefore raw I/O is considerably more efficient when
-many words are transmitted.
-The names of the raw RK files
-begin with
-.I rrk
-and end with a number which selects the same disk
-as the corresponding
-.I rk
-file.
-.PP
-In raw I/O the buffer must begin on a word boundary,
-and counts should be a multiple of 512 bytes
-(a disk block).
-Likewise
-.I seek
-calls should specify a multiple of 512 bytes.
-.SH FILES
-/dev/rk?, /dev/rrk?
-.SH BUGS
-In raw I/O
-.I read
-and
-.IR write (2)
-truncate file offsets to 512-byte block boundaries,
-and
-.I write
-scribbles on the tail of incomplete blocks.
-Thus,
-in programs that are likely to access raw devices,
-.I read, write
-and
-.IR lseek (2)
-should always deal in 512-byte multiples.
diff --git a/.ref-Research-V7/usr/man/man4/rp.4 b/.ref-Research-V7/usr/man/man4/rp.4
deleted file mode 100644 (file)
index 98a097b..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-.TH RP 4 
-.SH NAME
-rp \- RP-11/RP03 moving-head disk
-.SH DESCRIPTION
-The files
-.I "rp0 ... rp7"
-refer to sections of RP disk drive 0.
-The files
-.I "rp8 ... rp15"
-refer to drive 1 etc.
-This allows a large disk to be broken up
-into more manageable pieces.
-.PP
-The origin and size of the pseudo-disks on each drive are
-as follows:
-.PP
-.br
-       disk    start   length
-.br
-       0       0       81000
-.br
-       1       0       5000
-.br
-       2       5000    2000
-.br
-       3       7000    74000
-.br
-       4-7     unassigned
-.PP
-Thus rp0 covers the whole drive,
-while rp1, rp2, rp3 can serve usefully as a root, swap, and
-mounted user file system respectively.
-.PP
-The
-.I rp
-files
-access the disk via the system's normal
-buffering mechanism
-and may be read and written without regard to
-physical disk records.
-There is also a `raw' interface
-which provides for direct transmission between the disk
-and the user's read or write buffer.
-A single read or write call results in exactly one I/O operation
-and therefore raw I/O is considerably more efficient when
-many words are transmitted.
-The names of the raw RP files
-begin with
-.I rrp
-and end with a number which selects the same disk
-section as the corresponding
-.I rp
-file.
-.PP
-In raw I/O the buffer must begin on a word boundary.
-.SH FILES
-/dev/rp?, /dev/rrp?
-.SH SEE ALSO
-hp(4)
-.SH BUGS
-In raw I/O
-.I read
-and
-.IR write (2)
-truncate file offsets to 512-byte block boundaries,
-and
-.I write
-scribbles on the tail of incomplete blocks.
-Thus,
-in programs that are likely to access raw devices,
-.I read, write
-and
-.IR lseek (2)
-should always deal in 512-byte multiples.
diff --git a/.ref-Research-V7/usr/man/man4/tc.4 b/.ref-Research-V7/usr/man/man4/tc.4
deleted file mode 100644 (file)
index 55aa890..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-.TH TC 4 
-.SH NAME
-tc \- TC-11/TU56 DECtape
-.SH DESCRIPTION
-The files
-.I "tap0 ... tap7"
-refer to the
-TC-11/TU56 DECtape drives 0 to 7.
-.PP
-The 256-word blocks on a standard DECtape are numbered 0 to 577.
-.SH FILES
-/dev/tap?
-.SH "SEE ALSO"
-tp(1)
diff --git a/.ref-Research-V7/usr/man/man4/tm.4 b/.ref-Research-V7/usr/man/man4/tm.4
deleted file mode 100644 (file)
index 4b0fef4..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-.TH TM 4 
-.SH NAME
-tm \- TM-11/TU-10 magtape interface
-.SH DESCRIPTION
-The files
-.I "mt0, ..., mt7"
-refer to the DEC TU10/TM11 magtape.
-When closed it can be rewound or not, see below.
-If it was open for writing, two end-of-files are written.
-If the tape is not to be rewound
-it is positioned with the head between the two
-tapemarks.
-.PP
-If the 0200 bit is on in the minor device number the
-tape is not rewound when closed.
-.PP
-A standard tape consists of a
-series of 512 byte records terminated by an
-end-of-file.
-To the extent possible, the system makes
-it possible, if inefficient, to treat
-the tape like any other file.
-Seeks have their usual meaning and it is possible
-to read or write a byte at a time.
-Writing in very small units is inadvisable,
-however, because it tends to create monstrous record
-gaps.
-.PP
-The
-.I mt
-files discussed above are useful
-when it is desired to access the tape in a way
-compatible with ordinary files.
-When foreign tapes are to be dealt with, and especially
-when long records are to be read or written, the
-`raw' interface is appropriate.
-The associated files are named
-.I "rmt0, ..., rmt7."
-Each
-.I read
-or
-.I write
-call reads or writes the next record on the tape.
-In the write case the record has the same length as the
-buffer given.
-During a read, the record size is passed
-back as the number of bytes read, provided it is no greater
-than the buffer size;
-if the record is long, an error is indicated.
-In raw tape I/O, the buffer must begin on a word boundary
-and the count must be even.
-Seeks are ignored.
-A zero byte count is returned when a tape mark is read,
-but another read will fetch the first record of the
-new tape file.
-.SH FILES
-/dev/mt?,
-/dev/rmt?
-.SH "SEE ALSO"
-tp(1)
-.SH BUGS
-If any non-data error is encountered, it refuses to do anything
-more until closed.
-In raw I/O, there should be a way
-to perform forward and backward record and file spacing and
-to write an EOF mark.
diff --git a/.ref-Research-V7/usr/man/man4/tty.4 b/.ref-Research-V7/usr/man/man4/tty.4
deleted file mode 100644 (file)
index 959e3a9..0000000
+++ /dev/null
@@ -1,469 +0,0 @@
-.TH TTY 4 
-.SH NAME
-tty \- general terminal interface
-.SH DESCRIPTION
-This section describes
-both a particular special file,
-and the general nature of the terminal interface.
-.PP
-The file
-.I /dev/tty
-is, in each process, a synonym
-for the control terminal associated with that process.
-It is useful for programs that wish to
-be sure of writing messages on the terminal
-no matter how output has been redirected.
-It can also be used for programs that demand a file name
-for output, when typed output is desired
-and it is tiresome to find out which terminal
-is currently in use.
-.PP
-As for terminals in general: all of the low-speed asynchronous
-communications ports use the
-same general interface, no matter what
-hardware is involved.
-The remainder of this section discusses
-the common features of the interface.
-.PP
-When a terminal file is opened, it causes
-the process to wait until a connection is established.
-In practice user's programs seldom open these
-files; they are opened by
-.I init
-and become a user's
-input and output file.
-The very first terminal file open in a process becomes
-the
-.I "control terminal"
-for that process.
-The control terminal plays a special
-role in handling quit or interrupt signals, as discussed
-below.
-The control terminal is inherited by a child process during a
-.IR fork ,
-even if the control terminal is closed.
-The set of processes that thus share a control terminal
-is called a
-.I process
-.IR group ;
-all members of a process group receive certain signals
-together, see DEL below and
-.IR kill (2).
-.PP
-A terminal associated with one of these files ordinarily
-operates in full-duplex mode.
-Characters may be typed at any time,
-even while output is occurring, and are only lost when the
-system's character input buffers become completely
-choked, which is rare,
-or when the user has accumulated the maximum allowed number of
-input characters that have not yet been read by some program.
-Currently this limit is 256 characters.
-When the input limit is reached all the
-saved characters are thrown away without notice.
-.PP
-Normally, terminal input is processed in units of lines.
-This means that a program attempting
-to read will be suspended until an entire line has been
-typed.
-Also, no matter how many characters are requested
-in the read call, at most one line will be returned.
-It is not however necessary to read a whole line at
-once; any number of characters may be
-requested in a read, even one, without losing information.
-There are special modes, discussed below,
-that permit the program to read each character as typed
-without waiting for a full line.
-.PP
-During input, erase and kill processing is normally
-done.
-By default, the character `#' erases the
-last character typed, except that it will not erase
-beyond the beginning of a line or an EOT.
-By default, the character `@' kills the entire
-line up to the point where it was typed, but not beyond an EOT.
-Both these
-characters operate on a keystroke basis independently
-of any backspacing or tabbing that may have been done.
-Either `@' or `#' may be entered literally by preceding
-it by `\\';
-the erase or kill character remains, but the
-`\\' disappears.
-These two characters may be changed to others.
-.PP
-When desired,
-all upper-case letters are mapped into
-the corresponding lower-case letter.
-The upper-case letter may be generated by preceding
-it by `\\'.
-In addition, the following escape sequences can be generated
-on output and accepted on input:
-.PP
-.nf
-for    use
-\`     \e\'
-|      \\!
-~      \e^
-{      \e(
-}      \e)
-.fi
-.PP
-Certain ASCII control characters have special meaning.
-These characters are not passed to a reading program
-except in raw mode where they lose their special character.
-Also, it is possible to change these characters from the default;
-see below.
-.TP
-EOT
-(Control-D) may be used to generate an end of file
-from a terminal.
-When an EOT is received, all the characters
-waiting to be read are immediately passed to
-the program, without waiting for a new-line,
-and the EOT is discarded.
-Thus if there are no characters waiting, which
-is to say the EOT occurred at the beginning of a line,
-zero characters will be passed back, and this is
-the standard end-of-file indication.
-.TP
-DEL
-(Rubout)
-is not passed to a program but generates
-an
-.I interrupt
-signal
-which is sent to all processes with the associated control terminal.
-Normally each such process is forced to terminate,
-but arrangements may be made either to
-ignore the signal or to receive a
-trap to an agreed-upon location.
-See
-.IR signal (2).
-.TP
-FS
-(Control-\\ or control-shift-L)
-generates the
-.I quit
-signal.
-Its treatment is identical to the interrupt signal
-except that unless a receiving process has
-made other arrangements it will not only be terminated
-but a core image file will be generated.
-.TP
-DC3
-(Control-S) delays all printing on the terminal
-until something is typed in.
-.TP
-DC1
-(Control-Q) restarts  printing after DC3 without generating
-any input to a program.
-.PP
-When the carrier signal from the dataset drops (usually
-because the user has hung up his terminal)
-a
-.I hangup
-signal is sent to all processes with the terminal
-as control terminal.
-Unless other arrangements have been made,
-this signal causes the processes to terminate.
-If the hangup signal is ignored, any read
-returns with an end-of-file indication.
-Thus programs that read a terminal and test for
-end-of-file on their input
-can terminate appropriately when
-hung up on.
-.PP
-When one or more
-characters are written, they are actually transmitted
-to the terminal as soon as previously-written characters
-have finished typing.
-Input characters are echoed by putting them in the output queue
-as they arrive.
-When a process produces characters more rapidly than they can be typed,
-it will be suspended when its output queue exceeds some limit.
-When the queue has drained down to some threshold
-the program is resumed.
-Even parity is always generated on output.
-The EOT character is not transmitted
-(except in raw mode)
-to prevent terminals
-that respond to it from hanging up.
-.PP
-Several
-.IR ioctl (2)
-calls apply to terminals.
-Most of them use the following structure,
-defined in
-.IR <sgtty.h> :
-.PP
-.nf
-.ft 3
-struct sgttyb {
-       char    sg_ispeed;
-       char    sg_ospeed;
-       char    sg_erase;
-       char    sg_kill;
-       int     sg_flags;
-};
-.ft R
-.fi
-.PP
-The
-.I sg_ispeed 
-and 
-.I sg_ospeed
-fields describe the input and output speeds of the
-device according to the following table,
-which corresponds to the DEC DH-11 interface.
-If other hardware is used,
-impossible speed changes are ignored.
-Symbolic values in the table are as defined in
-.IR <sgtty.h> .
-.PP
-.nf
-.ta \w'B9600   'u +5n
-B0     0       (hang up dataphone)
-B50    1       50 baud
-B75    2       75 baud
-B110   3       110 baud
-B134   4       134.5 baud
-B150   5       150 baud
-B200   6       200 baud
-B300   7       300 baud
-B600   8       600 baud
-B1200  9       1200 baud
-B1800  10      1800 baud
-B2400  11      2400 baud
-B4800  12      4800 baud
-B9600  13      9600 baud
-EXTA   14      External A
-EXTB   15      External B
-.fi
-.DT
-.PP
-In the current configuration,
-only 110, 150, 300 and 1200 baud are really supported on dial-up lines.
-Code conversion and line control required for
-IBM 2741's (134.5 baud)
-must be implemented by the user's
-program.
-The half-duplex line discipline
-required for the 202 dataset (1200 baud)
-is not supplied; full-duplex 212 datasets work fine.
-.PP
-The
-.I sg_erase
-and
-.I sg_kill
-fields of the argument structure
-specify the erase and kill characters respectively.
-(Defaults are # and @.)
-.PP
-The
-.I sg_flags
-field of the argument structure
-contains several bits that determine the
-system's treatment of the terminal:
-.PP
-.ta \w'ALLDELAY 'u +\w'0100000 'u
-.nf
-ALLDELAY       0177400 Delay algorithm selection
-BSDELAY        0100000 Select backspace delays (not implemented):
-BS0    0
-BS1    0100000
-VTDELAY        0040000 Select form-feed and vertical-tab delays:
-FF0    0
-FF1    0100000
-CRDELAY        0030000 Select carriage-return delays:
-CR0    0
-CR1    0010000
-CR2    0020000
-CR3    0030000
-TBDELAY        0006000 Select tab delays:
-TAB0   0
-TAB1   0001000
-TAB2   0004000
-XTABS  0006000
-NLDELAY        0001400 Select new-line delays:
-NL0    0
-NL1    0000400
-NL2    0001000
-NL3    0001400
-EVENP  0000200 Even parity allowed on input (most terminals)
-ODDP   0000100 Odd parity allowed on input
-RAW    0000040 Raw mode: wake up on all characters, 8-bit interface
-CRMOD  0000020 Map CR into LF; echo LF or CR as CR-LF
-ECHO   0000010 Echo (full duplex)
-LCASE  0000004 Map upper case to lower on input
-CBREAK 0000002 Return each character as soon as typed
-TANDEM 0000001 Automatic flow control
-.DT
-.fi
-.PP
-The delay bits specify how long
-transmission stops to allow for mechanical or other movement
-when certain characters are sent to the terminal.
-In all cases a value of 0 indicates no delay.
-.PP
-Backspace delays are currently ignored but might
-be used for Terminet 300's.
-.PP
-If a form-feed/vertical tab delay is specified,
-it lasts for about 2 seconds.
-.PP
-Carriage-return delay type 1 lasts about .08 seconds
-and is suitable for the Terminet 300.
-Delay type 2 lasts about .16 seconds and is suitable
-for the VT05 and the TI 700.
-Delay type 3 is unimplemented and is 0.
-.PP
-New-line delay type 1 is dependent on the current column
-and is tuned for Teletype model 37's.
-Type 2 is useful for the VT05 and is about .10 seconds.
-Type 3 is unimplemented and is 0.
-.PP
-Tab delay type 1 is dependent on the amount of movement
-and is tuned to the Teletype model
-37.
-Type 3, called XTABS,
-is not a delay at all but causes tabs to be replaced
-by the appropriate number of spaces on output.
-.PP
-Characters with the wrong parity, as determined by bits 200 and
-100, are ignored.
-.PP
-In raw mode, every character is passed immediately
-to the program without waiting until a full line has been typed.
-No erase or kill processing is done;
-the end-of-file indicator (EOT), the interrupt character
-(DEL) and the quit character (FS) are not treated specially.
-There are no delays and no echoing, and no replacement of
-one character for another;
-characters are a full 8 bits for both input and output
-(parity is up to the program).
-.PP
-Mode 020 causes input carriage returns to be turned into
-new-lines;
-input of either CR or LF causes LF-CR both to
-be echoed
-(for terminals with a new-line function).
-.PP
-CBREAK is a sort of half-cooked (rare?) mode.
-Programs can read each character as soon as typed, instead
-of waiting for a full line,
-but quit and interrupt work, and output delays, case-translation,
-CRMOD, XTABS, ECHO, and parity work normally.
-On the other hand there is no erase or kill,
-and no special treatment of \e or EOT.
-.PP
-TANDEM mode causes the system to produce
-a stop character (default DC3) whenever the input
-queue is in danger of overflowing, and a start character
-(default DC1)
-when the input queue has drained sufficiently.
-It is useful for flow control when the `terminal'
-is actually another machine that obeys the conventions.
-.PP
-Several
-.I ioctl
-calls have the form:
-.PP
-.B #include <sgtty.h>
-.PP
-.B ioctl(fildes, code, arg)
-.br
-.B struct sgttyb *arg;
-.PP
-The applicable codes are:
-.TP
-TIOCGETP
-Fetch the parameters associated with the terminal, and store
-in the pointed-to structure.
-.TP
-TIOCSETP
-Set the parameters according to the pointed-to structure.
-The interface delays until output is quiescent,
-then throws away any unread characters,
-before changing the modes.
-.TP
-TIOCSETN
-Set the parameters but do not delay or flush input.
-Switching out of RAW or CBREAK mode
-may cause some garbage input.
-.PP
-With the following codes the
-.I arg
-is ignored.
-.TP
-TIOCEXCL
-Set ``exclusive-use'' mode:
-no further opens are permitted until the file has been closed.
-.TP
-TIOCNXCL
-Turn off ``exclusive-use'' mode.
-.TP
-TIOCHPCL
-When the file is closed for the last time,
-hang up the terminal.
-This is useful when the line is associated
-with an ACU used to place outgoing calls.
-.TP
-TIOCFLUSH
-All characters waiting in input or output queues are flushed.
-.PP
-The following codes affect characters that are special
-to the terminal interface.
-The argument is a pointer to the following structure,
-defined in
-.IR <sgtty.h> :
-.PP
-.nf
-.ft 3
-struct tchars {
-       char    t_intrc;                /* interrupt */
-       char    t_quitc;                /* quit */
-       char    t_startc;       /* start output */
-       char    t_stopc;        /* stop output */
-       char    t_eofc;         /* end-of-file */
-       char    t_brkc;         /* input delimiter (like nl) */
-};
-.fi
-.ft R
-.PP
-The default values for these characters are
-DEL, FS, DC1, DC3, EOT, and \-1.
-A character value of \-1
-eliminates the effect of that character.
-The
-.I t_brkc
-character, by default \-1,
-acts like a new-line in that it terminates a `line,'
-is echoed, and is passed to the program.
-The `stop' and `start' characters may be the same,
-to produce a toggle effect.
-It is probably counterproductive to make
-other special characters (including erase an kill)
-identical.
-.PP
-The calls are:
-.TP
-TIOCSETC
-Change the various special characters to those given in the structure.
-.TP
-TIOCSETP
-Set the special characters to those given in the structure.
-.SH FILES
-/dev/tty
-.br
-/dev/tty*
-.br
-/dev/console
-.SH SEE ALSO
-getty(8), stty (1), signal(2), ioctl(2)
-.SH BUGS
-Half-duplex terminals are not supported.
-.PP
-The terminal handler has clearly entered the
-race for ever-greater complexity and generality.
-It's still not complex and general enough for
-TENEX fans.
diff --git a/.ref-Research-V7/usr/man/man4/vp.4 b/.ref-Research-V7/usr/man/man4/vp.4
deleted file mode 100644 (file)
index 50ebb56..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-.TH VP 4 
-.SH NAME
-vp \- Versatec printer-plotter
-.SH DESCRIPTION
-.I Vp0
-is the interface to a Versatec D1200A printer-plotter
-with a Versatec C-PDP11(DMA) controller.
-Ordinarily bytes written on it are interpreted as ASCII characters
-and printed.
-As a printer, it writes 64 lines of 132 characters each on
-11 by 8.5 inch paper.
-Only some of the ASCII control characters are interpreted.
-.TP
-NL
-performs the usual new-line function, i.e.
-spaces up the paper and resets to the left margin.
-It is ignored however following a CR which ends a non-empty line.
-.TP
-CR
-is ignored if the current line is empty but is otherwise
-like NL.
-.TP
-FF
-resets to the left margin and then to the top of the next page.
-.TP
-EOT
-resets to the left margin, advances 8 inches, and then performs a FF.
-.PP
-The
-.IR  ioctl (2)
-system call may be used to change the mode of the device.
-Only the first word of the 3-word argument structure is used.
-The bits mean:
-.TP
-0400
-Enter simultaneous print/plot mode.
-.br
-.ns
-.TP
-0200
-Enter plot mode.
-.br
-.ns
-.TP
-0100
-Enter print mode (default on open).
-.br
-.ns
-.TP
-040
-Send remote terminate.
-.br
-.ns
-.TP
-020
-Send remote form-feed.
-.br
-.ns
-.TP
-010
-Send remote EOT.
-.br
-.ns
-.TP
-04
-Send remote clear.
-.br
-.ns
-.TP
-02
-Send remote reset.
-.PP
-On open a reset, clear, and form-feed are performed automatically.
-Notice that the mode bits are not encoded, so that it is required
-that exactly one be set.
-.PP
-In plot mode each byte is interpreted as 8 bits
-of which the high-order is plotted to the left;
-a `1' leaves a visible dot.
-A full line of dots is produced by 264 bytes;
-lines are terminated only by count or by a remote terminate function.
-There are 200 dots per inch both vertically and horizontally.
-.PP
-When simultaneous print-plot mode is entered
-exactly one line of characters, terminated by NL, CR, or
-the remote terminate function,
-should be written.
-Then the device enters plot mode and
-at least 20 lines of plotting bytes should be sent.
-As the line of characters (which is 20 dots high)
-is printed, the plotting bytes overlay the characters.
-Notice that it is impossible to print characters on baselines
-that differ by fewer than 20 dot-lines.
-.PP
-In print mode lines may be terminated either with
-an appropriate ASCII character or by using the remote
-terminate function.
-.SH FILES
-/dev/vp0
-.SH "SEE ALSO"
-opr(1)
diff --git a/.ref-Research-V7/usr/man/man5/a.out.5 b/.ref-Research-V7/usr/man/man5/a.out.5
deleted file mode 100644 (file)
index adb2c35..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-.TH A.OUT 5 
-.SH NAME
-a.out \- assembler and link editor output
-.SH SYNOPSIS
-.B #include <a.out.h>
-.SH DESCRIPTION
-.I A.out
-is the output file of the assembler
-.IR as (1)
-and the link editor
-.IR ld (1).
-Both programs make
-.I a.out
-executable if there were no
-errors and no unresolved external references.
-Layout information as given in the include file for the PDP11 is:
-.PP
-.nf
-.ta 8n +9n +11n
-.PP
-.so /usr/include/a.out.h
-.fi
-.PP
-The file has four sections:
-a header, the program and data text,
-relocation information, and a symbol table
-(in that order).
-The last two may be empty
-if the program was loaded
-with the `\-s' option
-of
-.I ld
-or if the symbols and relocation have been
-removed by
-.IR strip (1).
-.PP
-In the header the sizes of each section are given in bytes, but are even.
-The size of the header is not included in any of the other sizes.
-.PP
-When an
-.I a.out
-file is loaded into core for execution, three logical segments are
-set up: the text segment, the data segment
-(with uninitialized data, which starts off as all 0, following
-initialized),
-and a stack.
-The text segment begins at 0
-in the core image; the header is not loaded.
-If the magic number in the header is 0407(8), it indicates that the text
-segment is not to be write-protected and shared,
-so the data segment is immediately contiguous
-with the text segment.
-If the magic number is 0410,
-the data segment begins at the first 0 mod 8K byte
-boundary following the text segment,
-and the text segment is not writable by the program;
-if other processes are executing the same file,
-they will share the text segment.
-If the magic number is 411,
-the text segment is again pure, write-protected, and shared,
-and moreover instruction and data space are separated;
-the text and data segment both begin at location 0.
-If the magic number is 0405, the text segment
-is overlaid on an existing (0411 or 0405) text segment
-and the existing data segment is preserved.
-.PP
-The stack will occupy the highest possible locations
-in the core image: from 0177776(8) and growing downwards.
-The stack is automatically extended as required.
-The data segment is only extended as requested by
-.IR brk (2).
-.PP
-The start of the text segment in the file is 020(8);
-the start of the data segment is 020+S\s6\dt\u\s10 (the size of the text)
-the start of the relocation information is
-020+S\s6\dt\u\s10+S\s6\dd\u\s10;
-the start of the symbol table is
-020+2(S\s6\dt\u\s10+S\s6\dd\u\s10)
-if the
-relocation information is present,
-020+S\s6\dt\u\s10+S\s6\dd\u\s10
-if not.
-.PP
-The layout of a symbol table entry and the principal flag values
-that distinguish symbol types are given in the include file.
-Other flag values may occur if an assembly language program
-defines machine instructions.
-.PP
-If a symbol's type is undefined external,
-and the value field is non-zero,
-the symbol is interpreted by the loader
-.I ld
-as
-the name of a common region
-whose size is indicated by the value of the
-symbol.
-.PP
-The value of a word in the text or data portions which is not
-a reference to an undefined external symbol
-is exactly that value which will appear in core
-when the file is executed.
-If a word in the text or data portion
-involves a reference to an undefined external symbol,
-as indicated by the relocation information
-for that word,
-then the value of the word as stored in the file
-is an offset from the associated external symbol.
-When the file is processed by the
-link editor and the external symbol becomes
-defined, the value of the symbol will
-be added into the word in the file.
-.PP
-If relocation
-information is present, it amounts to one word per
-word of program text or initialized data.
-There is no relocation information if the `relocation info stripped'
-flag in the header is on.
-.PP
-Bits 3-1 of a relocation word indicate the segment referred
-to by the text or data word associated with the relocation
-word:
-.TP
-000
-absolute number
-.br
-.ns
-.TP
-002
-reference to text segment
-.br
-.ns
-.TP
-004
-reference to initialized data
-.br
-.ns
-.TP
-006
-reference to uninitialized data (bss)
-.br
-.ns
-.TP
-010
-reference to undefined external symbol
-.PP
-Bit 0 of the relocation word indicates, if 1,
-that the
-reference is relative to the pc (e.g. `clr x');
-if 0,
-that
-the reference is to the actual symbol (e.g.,
-`clr *$x').
-.PP
-The remainder of the relocation word (bits 15-4)
-contains a symbol number in the case of external
-references, and is unused otherwise.
-The first symbol is numbered 0, the second 1, etc.
-.SH "SEE ALSO"
-as(1), ld(1), nm(1)
diff --git a/.ref-Research-V7/usr/man/man5/acct.5 b/.ref-Research-V7/usr/man/man5/acct.5
deleted file mode 100644 (file)
index 200e8a0..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-.TH ACCT 5
-.SH NAME
-acct \- execution accounting file
-.SH SYNOPSIS
-.B #include <sys/acct.h>
-.SH DESCRIPTION
-.IR Acct (2)
-causes entries to be made into an accounting file
-for each process that terminates.
-The accounting file is a sequence of entries whose layout,
-as defined by the include file
-is:
-.PP
-.nf
-.ta \w'typedef 'u +\w'comp_t  'u +\w'ac_comm[10]; 'u
-.so /usr/include/sys/acct.h
-.fi
-.PP
-If the process does an
-.IR exec (2),
-the first 10 characters of the filename appear in
-.I ac_comm.
-The accounting flag contains bits indicating whether
-.IR exec (2)
-was ever accomplished, and whether the
-process ever had super-user privileges.
-.SH SEE ALSO
-acct(2), sa(1)
diff --git a/.ref-Research-V7/usr/man/man5/ar.5 b/.ref-Research-V7/usr/man/man5/ar.5
deleted file mode 100644 (file)
index bee6b35..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-.TH AR 5 
-.SH NAME
-ar \- archive (library) file format
-.SH SYNOPSIS
-.B #include <ar.h>
-.SH DESCRIPTION
-The archive command
-.I ar
-is used to combine several files into
-one.
-Archives are used mainly as libraries to be searched
-by the link-editor
-.I ld.
-.PP
-A file produced by
-.I ar
-has a magic number at the start,
-followed by the constituent files, each preceded by a file header.
-The magic number and header layout as described in the
-include file are:
-.RS
-.PP
-.nf
-.ta \w'#define 'u +\w'ARMAG 'u
-.so /usr/include/ar.h
-.fi
-.RE
-.LP
-The name is a null-terminated string; the date is in the
-form of
-.IR time (2);
-the user ID and group ID are numbers; the mode is a bit pattern
-per
-.IR chmod (2);
-the size is counted in bytes.
-.PP
-Each file begins on a word boundary;
-a null byte is inserted between files if necessary.
-Nevertheless the size given reflects the
-actual size of the file exclusive of padding.
-.PP
-Notice there is no provision for empty areas in an archive
-file.
-.SH "SEE ALSO"
-ar(1), ld(1), nm(1)
-.SH BUGS
-Coding user and group IDs as characters is a botch.
diff --git a/.ref-Research-V7/usr/man/man5/core.5 b/.ref-Research-V7/usr/man/man5/core.5
deleted file mode 100644 (file)
index deff5a6..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH CORE 5 
-.SH NAME
-core \- format of core image file
-.SH DESCRIPTION
-UNIX
-writes out a core image of a terminated
-process when any of various errors occur.
-See
-.IR signal (2)
-for the list of reasons;
-the most common are memory violations, illegal
-instructions, bus errors, and user-generated
-quit signals.
-The core image is called `core' and is written in the process's
-working directory (provided it can be; normal
-access controls apply).
-.PP
-The first 1024 bytes of the core image
-are a copy of the system's per-user
-data for the process, including the registers
-as they were at the time of the fault;
-see the system listings for the format of this area.
-The
-remainder represents the actual contents of
-the user's core area when the core image
-was written.
-If the text segment
-is write-protected and shared,
-it is not dumped; otherwise the entire
-address space is dumped.
-.PP
-In general the debugger
-.IR adb (1)
-is sufficient to deal with core images.
-.SH "SEE ALSO"
-adb(1), signal(2)
diff --git a/.ref-Research-V7/usr/man/man5/dir.5 b/.ref-Research-V7/usr/man/man5/dir.5
deleted file mode 100644 (file)
index c80ed62..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH DIR 5 
-.SH NAME
-dir \- format of directories
-.SH SYNOPSIS
-.B #include <sys/dir.h>
-.SH DESCRIPTION
-A directory
-behaves exactly like an ordinary file, save that no
-user may write into a directory.
-The fact that a file is a directory is indicated by
-a bit in the flag word of its i-node entry
-see,
-.IR filsys (5).
-The structure of a directory entry as given in the
-include file is:
-.RS
-.ta 8n +6n
-.PP
-.nf
-.so /usr/include/sys/dir.h
-.fi
-.RE
-.PP
-By convention, the first two entries in each directory
-are for `\fB.\fR' and `\fB..\fR'.  The first is an entry for the
-directory itself.  The second is for the parent
-directory.
-The meaning of `\fB..\fR' is modified for the root directory
-of the master file system and for the root directories of removable
-file systems.
-In the first case, there is no parent, and in the second,
-the system does not permit off-device references.
-Therefore in both cases `\fB..\fR' has the
-same meaning as `\fB.\fR'.
-.SH "SEE ALSO"
-filsys(5)
diff --git a/.ref-Research-V7/usr/man/man5/dump.5 b/.ref-Research-V7/usr/man/man5/dump.5
deleted file mode 100644 (file)
index d3639e7..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-.TH DUMP 5 
-.SH NAME
-dump, ddate \- incremental dump format
-.SH SYNOPSIS
-.B #include <sys/types.h>
-.br
-.B #include <sys/ino.h>
-.br
-.B # include <dumprestor.h>
-.SH DESCRIPTION
-Tapes used by
-.I dump
-and
-.IR restor (1)
-contain:
-.nf
-.IP ""
-a header record
-two groups of bit map records
-a group of records describing directories
-a group of records describing files
-.fi
-.PP
-The format of the header record and of the first
-record of each description as given in the
-include file
-.I <dumprestor.h>
-is:
-.PP
-.nf
-.ta .5i \w'#define\ TS_INODE\ 'u
-.so /usr/include/dumprestor.h
-.fi
-.PP
-.I NTREC
-is the number of 512 byte records in a physical
-tape block.
-.I MLEN
-is the number of bits in a bit map word.
-.I MSIZ 
-is the number of bit map words.
-.PP
-The
-.I TS_
-entries are used in the
-.I c_type
-field to indicate what sort of header
-this is.
-The types and their meanings are as follows:
-.TP \w'CHECKSUM\|'u
-TS_TAPE
-Tape volume label
-.PD 0
-.TP
-TS_INODE
-A file or directory follows.
-The
-.I c_dinode
-field is a copy of the disk inode and contains
-bits telling what sort of file this is.
-.TP
-TS_BITS
-A bit map follows.
-This bit map has a one bit
-for each inode that was dumped.
-.TP
-TS_ADDR
-A subrecord of a file description.
-See
-.I c_addr
-below.
-.TP
-TS_END
-End of tape record.
-.TP
-TS_CLRI
-A bit map follows.
-This bit map contains a zero bit for
-all inodes that were empty on the file system when dumped.
-.TP
-MAGIC
-All header records have this number in
-.I c_magic.
-.TP
-CHECKSUM
-Header records checksum to this value.
-.PD
-.PP
-The fields of the header structure are as follows:
-.TP \w'TS_INODE\ 'u
-c_type
-The type of the header.
-.PD 0
-.TP
-c_date
-The date the dump was taken.
-.TP
-c_ddate
-The date the file system was dumped from.
-.TP
-c_volume
-The current volume number of the dump.
-.TP
-c_tapea
-The current number of this (512-byte) record.
-.TP
-c_inumber
-The number of the inode being dumped if this
-is of type
-.I TS_INODE.
-.TP
-c_magic
-This contains the value
-.I MAGIC
-above, truncated as needed.
-.TP
-c_checksum
-This contains whatever value is needed to
-make the record sum to 
-.I CHECKSUM.
-.TP
-c_dinode
-This is a copy of the inode as it appears on the
-file system; see
-.IR filsys (5).
-.TP
-c_count
-The count of characters in
-.I c_addr.
-.TP
-c_addr
-An array of characters describing the blocks of the
-dumped file.
-A character is zero if the block associated with that character was not
-present on the file system, otherwise the character is non-zero.
-If the block was not present on the file system, no block was dumped;
-the block will be restored as a hole in the file.
-If there is not sufficient space in this record to describe
-all of the blocks in a file,
-.I TS_ADDR
-records will be scattered through the file, each one
-picking up where the last left off.
-.PD
-.PP
-Each volume except the last ends with a tapemark (read as an end
-of file).
-The last volume ends with a
-.I TS_END
-record and then the tapemark.
-.PP
-The structure
-.I idates
-describes an entry of the file
-.I /etc/ddate
-where dump history is kept.
-The fields of the structure are:
-.TP \w'TS_INODE\ 'u
-id_name
-The dumped filesystem is
-.RI `/dev/ id_nam'.
-.PD 0
-.TP
-id_incno
-The level number of the dump tape;
-see
-.IR dump (1).
-.TP
-id_ddate
-The date of the incremental dump in system format
-see
-.IR types (5).
-.PD
-.SH FILES
-/etc/ddate
-.SH "SEE ALSO"
-dump(1), dumpdir(1), restor(1), filsys(5), types(5)
diff --git a/.ref-Research-V7/usr/man/man5/environ.5 b/.ref-Research-V7/usr/man/man5/environ.5
deleted file mode 100644 (file)
index baf7c53..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH ENVIRON 5
-.SH NAME
-environ \- user environment
-.SH SYNOPSIS
-.B extern char **environ;
-.SH DESCRIPTION
-An array of strings called the `environment' is
-made available by
-.IR exec (2)
-when a process begins.
-By convention these strings have the form
-`name=value'.
-The following names are used by various commands:
-.TP
-PATH
-The sequence of directory prefixes that
-.I sh, time,
-.IR nice (1),
-etc.,
-apply in searching for a file known by an incomplete path name.
-The prefixes are separated by `:'.
-.IR Login (1)
-sets PATH=:/bin:/usr/bin.
-.TP
-HOME
-A user's login directory, set by
-.IR login (1)
-from the password file
-.IR passwd (5).
-.TP
-TERM
-The kind of terminal for which output is to be prepared.
-This information is used by commands, such as
-.I nroff
-or
-.IR plot (1),
-which may exploit special terminal capabilities.
-See
-.IR term (7)
-for a list of terminal types.
-.PP
-Further names may be placed in the environment by
-the
-.I export
-command and `name=value' arguments in
-.IR sh (1),
-or by 
-.IR exec (2).
-It is unwise to conflict with
-certain Shell variables that are frequently exported by
-`.profile' files:
-MAIL, PS1, PS2, IFS.
-.SH SEE ALSO
-exec(2), sh(1), term(7), login(1)
diff --git a/.ref-Research-V7/usr/man/man5/filsys.5 b/.ref-Research-V7/usr/man/man5/filsys.5
deleted file mode 100644 (file)
index 9f1baa9..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-.TH FILSYS  5
-.SH NAME
-filsys, flblk, ino \- format of file system volume
-.SH SYNOPSIS
-.B #include <sys/types.h>
-.br
-.B #include <sys/flbk.h>
-.br
-.B #include <sys/filsys.h>
-.br
-.B #include <sys/ino.h>
-.SH DESCRIPTION
-Every
-file system storage volume
-(e.g. RF disk, RK disk, RP disk, DECtape reel)
-has a common format for certain vital information.
-Every such volume is divided into a certain number
-of 512-byte blocks.
-Block 0 is unused and is available to contain
-a bootstrap program, pack label, or other information.
-.PP
-Block 1 is the
-.I "super block."
-The layout of the super block as defined by the include file
-.I <sys/filsys.h>
-is:
-.PP
-.nf
-.ta \w'struct 'u +\w'daddr_t  'u +\w's_inode[NICINOD]; 'u
-.so /usr/include/sys/filsys.h
-.fi
-.PP
-.I S_isize
-is the address of the first block after the i-list,
-which starts just after the super-block, in block 2.
-Thus is i-list is
-.IR s_isize \-2
-blocks long.
-.I S_fsize
-is the address of the first block not potentially
-available for allocation
-to a file.
-These numbers are used by the system to
-check for bad block addresses;
-if an `impossible' block address is allocated from the free list
-or is freed,
-a diagnostic is written on the on-line console.
-Moreover, the free array is cleared, so as to prevent further
-allocation from a presumably corrupted free list.
-.PP
-The free list for each volume is maintained as
-follows.
-The
-.I s_free
-array contains, in
-.I "s_free[1], ... , s_free[s_nfree\-1],"
-up to NICFREE free block numbers.
-NICFREE is a configuration constant.
-.I S_free[0]
-is the block address of the head
-of a chain of blocks constituting the free list.
-The layout of each block of the free chain as defined
-in the include file
-.I <sys/fblk.h>
-is:
-.PP
-.nf
-.so /usr/include/sys/fblk.h
-.fi
-.PP
-The fields
-.I df_nfree
-and
-.I df_free
-in a free block are used exactly like
-.I s_nfree
-and 
-.I s_free
-in the super block.
-To allocate a block:
-decrement
-.I s_nfree,
-and the new block number is
-.I s_free[s_nfree].
-If the new block address is 0,
-there are no blocks left, so give an error.
-If
-.I s_nfree
-became 0,
-read the new block into
-.I s_nfree
-and 
-.I s_free.
-To free a block, check if
-.I s_nfree
-is NICFREE; if so,
-copy
-.I s_nfree
-and the
-.I s_free
-array into it,
-write it out, and set
-.I s_nfree
-to 0.
-In any event set
-.I s_free[s_nfree]
-to the freed block's address and
-increment
-.I s_nfree.
-.PP
-.I S_ninode
-is the number of free i-numbers in the
-.I s_inode
-array.
-To allocate an i-node:
-if
-.I s_ninode
-is greater than 0,
-decrement it and return
-.I s_inode[s_ninode].
-If it was 0, read the i-list
-and place the numbers of all free inodes
-(up to NICINOD) into the
-.I s_inode
-array,
-then try again.
-To free an i-node,
-provided
-.I s_ninode
-is less than NICINODE,
-place its number into
-.I s_inode[s_ninode]
-and increment
-.I s_ninode.
-If
-.I s_ninode
-is already NICINODE, don't bother to enter the freed i-node into any table.
-This list of i-nodes is only to speed
-up the allocation process; the information
-as to whether the inode is really free
-or not is maintained in the inode itself.
-.PP
-.I S_flock
-and
-.I s_ilock
-are flags maintained in the core
-copy of the file system
-while it is mounted
-and their values on disk are immaterial.
-The value of
-.I s_fmod
-on disk is likewise immaterial;
-it is used as a flag to indicate that the super-block has
-changed and should be copied to
-the disk during the next periodic update of file
-system information.
-.I S_ronly
-is a write-protection indicator; its disk value is also immaterial.
-.PP
-.I S_time
-is the last time the super-block of the file system was changed.
-During a reboot,
-.I s_time
-of the super-block for the root file system
-is used to set the system's idea of the time.
-.PP
-The fields
-.I s_tfree, s_tinode, s_fname
-and
-.I s_fpack
-are not currently maintained.
-.PP
-I-numbers begin at 1, and the storage for i-nodes
-begins in block 2.
-.tr |
-I-nodes are 64 bytes long, so 8 of them fit into a block.
-I-node 2 is reserved for the root directory of the file
-system, but no other i-number has a built-in
-meaning.
-Each i-node represents one file.
-The format of an i-node as given in the include file
-.I <sys/ino.h>
-is:
-.PP
-.nf
-.ta \w'#define 'u +\w'time_t  'u +\w'di_addr[40]; 'u
-.so /usr/include/sys/ino.h
-.fi
-.PP
-.I Di_mode
-tells the kind of file; it
-is encoded identically to the
-.I st_mode field of
-.IR stat (2).
-.I Di_nlink
-is the number of directory entries
-(links) that refer to this i-node.
-.I Di_uid
-and
-.I di_gid
-are the owner's user and group IDs.
-.I Size
-is the number of bytes in the file.
-.I Di_atime
-and
-.I di_mtime
-are the times of last access and modification
-of the file contents (read, write or create)
-(see
-.IR times (2));
-.I Di_ctime
-records the time of last modification
-to the inode or to the file, and is used
-to determine whether it should be dumped.
-.PP
-Special files are recognized by their modes
-and not by i-number.
-A block-type special file is one which
-can potentially be mounted as a file system;
-a character-type special file cannot, though it is
-not necessarily character-oriented.
-For special files, the 
-.I di_addr
-field is occupied by the device code
-(see
-.IR types (5)).
-The device codes
-of block and character special files overlap.
-.PP
-Disk addresses of plain files and directories
-are kept in the array
-.I di_addr
-packed into 3 bytes each.
-The first 10 addresses specify device blocks directly.
-The last 3 addresses are singly, doubly, and triply
-indirect and point to blocks of 128 block pointers.
-Pointers in indirect blocks have the type
-.I daddr_t
-(see
-.IR types (5)).
-.PP
-For block
-.I b
-in a file to exist,
-it
-is not necessary that all blocks less than
-.I b
-exist.
-A zero block number either in the address words of
-the i-node or in an indirect block indicates that the
-corresponding block has never been allocated.
-Such a missing block reads as if it contained all zero words.
-.SH "SEE ALSO"
-icheck(1), dcheck(1), dir(5), mount(1), stat(2), types(5)
diff --git a/.ref-Research-V7/usr/man/man5/group.5 b/.ref-Research-V7/usr/man/man5/group.5
deleted file mode 100644 (file)
index 8a05f33..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH GROUP 5 
-.SH NAME
-group \- group file
-.SH DESCRIPTION
-.I Group
-contains for each group the
-following information:
-.HP 10
-group name
-.br
-.ns
-.HP 10
-encrypted password
-.br
-.ns
-.HP 10
-numerical group ID
-.br
-.ns
-.HP 10
-a comma separated list of all users allowed in the group
-.PP
-This is an ASCII file.
-The fields are separated
-by colons;
-Each group is separated from the next by a new-line.
-If the password field is null, no password is demanded.
-.PP
-This file resides in directory /etc.
-Because of the encrypted
-passwords, it can and does have general read
-permission and can be used, for example,
-to map numerical group ID's to names.
-.SH FILES
-/etc/group
-.SH "SEE ALSO"
-newgrp(1), crypt(3), passwd(1), passwd(5)
diff --git a/.ref-Research-V7/usr/man/man5/mpxio.5 b/.ref-Research-V7/usr/man/man5/mpxio.5
deleted file mode 100644 (file)
index 548803d..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-.TH MPXIO 5 
-.SH NAME
-mpxio \- multiplexed i/o
-.SH SYNOPSIS
-.B #include <sys/mx.h>
-.PP
-.B #include <sgtty.h>
-.SH DESCRIPTION
-Data transfers on
-mpx files
-(see
-.IR mpx (2))
-are multiplexed by
-imposing
-a record structure  on the io stream.
-Each record represents  data
-from/to
-a particular channel or 
-a control or status message associated with a particular channel.
-.PP
-The prototypical data record read from an mpx file is as follows
-.PP
-.in +.5i
-.nf
-struct input_record {
-       short   index;
-       short   count;
-       short   ccount;
-       char    data[];
-};
-.PP
-.fi
-where
-.I index
-identifies the channel,
-and
-.I count
-specifies the number of characters in
-.I data.
-If
-.I count
-is zero,
-.I ccount
-gives the size of
-.I data,
-and the record is  a control or status message.
-Although
-.I count
-or
-.I ccount
-might be odd,
-the operating system aligns records
-on short (i.e. 16\-bit) boundaries
-by skipping bytes when necessary.
-.PP
-Data written to an mpx file must be formatted as an array
-of record structures defined as follows
-.PP
-.in +.5i
-.nf
-struct output_record {
-       short   index;
-       short   count;
-       short   ccount;
-       char    *data;
-};
-.fi
-.PP
-where the data portion of the record is referred
-to indirectly and the other cells have the same interpretation
-as in
-.I input_record.
-.PP
-The 
-control messages listed below may be read from
-a multiplexed file descriptor.
-They are presented as two 16-bit integers:
-the first number is the message code
-(defined in
-.IR <sys/mx.h> ),
-the second is an optional parameter meaningful
-only with M_WATCH and M_BLK.
-.PP
-.in +1i
-.ti -.5i
-M_WATCH \- a process `wants to attach' on this channel.
-The second parameter is the 16-bit 
-user-id of the process that executed the open.
-.br
-.ti -.5i
-M_CLOSE \- the channel is closed.
-This message is generated when the last 
-file descriptor referencing
-a channel is closed.
-The
-.I detach
-command
-(see
-.IR mpx (2)
-should be used in response to this message.
-.br
-.ti -.5i
-M_EOT \- indicates logical end of file on a channel.
-If the channel is joined to a typewriter,
-EOT (control-d)
-will cause the M_EOT message 
-under the conditions specified in
-.IR tty (4)
-for  end of file.
-If the channel is attached to a process,
-M_EOT will be generated whenever the process
-writes zero bytes on the channel.
-.br
-.ti -.5i
-M_BLK \- if non-blocking mode has been enabled on an
-mpx file descriptor
-.I xd
-by executing
-.IR "ioctl(xd, MXNBLK, 0)" ,
-write operations on the  file are truncated in the kernel
-when internal queues become full.
-This is done on a per-channel basis:
-the parameter 
-is a count of the number of characters
-not transferred to the channel on which
-M_BLK is received.
-.br
-.ti -.5i
-M_UBLK \- is generated for a channel
-after M_BLK when the internal queues have
-drained below a threshold.
-.in -1i
-.PP
-Two other messages may be generated by the kernel.
-As with other messages, the first
-16-bit quantity is the message code.
-.PP
-.in +1i
-.ti -.5i
-M_OPEN \- is generated in conjunction with 
-`listener' mode (see
-.IR mpx (2)).
-The uid of the calling process follows the message code
-as with M_WATCH.
-This is followed by a null-terminated string
-which is the name of the file being opened.
-.br
-.ti -.5i
-M_IOCTL \- is generated for a channel connected
-to a process
-when that process executes the
-.I "ioctl(fd, cmd, &vec)"
-call on the channel file descriptor.
-The M_IOCTL code is followed by
-the
-.I cmd
-argument given to
-.I ioctl
-followed by 
-the contents of the structure
-.I vec.
-It is assumed,
-not needing a better compromise at this time,
-that the length of
-.I vec
-is determined by
-.I "sizeof (struct sgttyb)"
-as declared in
-.IR <sgtty.h> .
-.in -1i
-.PP
-Two control messages are understood by the operating system.
-M_EOT may be sent through an mpx file to a channel.
-It is equivalent to propagating a zero-length record
-through the channel;
-i.e. the channel is allowed to drain and the process or
-device at the other end receives a zero-length
-transfer before data starts flowing through the channel again.
-M_IOCTL can also be sent through a channel.
-The format is identical to that described above.
diff --git a/.ref-Research-V7/usr/man/man5/mtab.5 b/.ref-Research-V7/usr/man/man5/mtab.5
deleted file mode 100644 (file)
index 2055d71..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH MTAB 5 
-.SH NAME
-mtab \- mounted file system table
-.SH DESCRIPTION
-.I Mtab
-resides in directory
-.I /etc
-and contains a table of devices mounted by the
-.I mount
-command.
-.I Umount
-removes entries.
-.PP
-Each entry is 64 bytes long;
-the first 32 are the null-padded name of the
-place where the special file is mounted;
-the second 32 are the null-padded name of the special
-file.
-The special file has all its directories
-stripped away;
-that is, everything through the last `/' is thrown
-away.
-.PP
-This table is present only so people can look at it.
-It does not matter to
-.I mount
-if there are duplicated entries nor
-to
-.I umount
-if a name cannot be found.
-.SH FILES
-/etc/mtab
-.SH "SEE ALSO"
-mount(1)
diff --git a/.ref-Research-V7/usr/man/man5/passwd.5 b/.ref-Research-V7/usr/man/man5/passwd.5
deleted file mode 100644 (file)
index c418b2e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-.TH PASSWD 5 
-.SH NAME
-passwd \- password file
-.SH DESCRIPTION
-.I Passwd
-contains for each user the
-following information:
-.HP 10
-name (login name, contains no upper case)
-.br
-.ns
-.HP 10
-encrypted password
-.br
-.ns
-.HP 10
-numerical user ID
-.br
-.ns
-.HP 10
-numerical group ID
-.br
-.ns
-.HP 10
-GCOS job number, box number, optional GCOS user-id
-.br
-.ns
-.HP 10
-initial working directory
-.br
-.ns
-.HP 10
-program to use as Shell
-.PP
-This is an ASCII file.  Each field within each user's entry
-is separated from the next by a colon.
-The GCOS field is used only when communicating with that
-system, and in other installations can contain
-any desired information.
-Each user is separated from the next by a new-line.
-If the password field is null, no password is demanded;
-if the Shell field is null, the Shell itself
-is used.
-.PP
-This file resides in directory /etc.
-Because of the encrypted
-passwords, it can and does have general read
-permission and can be used, for example,
-to map numerical user ID's to names.
-.SH FILES
-/etc/passwd
-.SH "SEE ALSO"
-getpwent(3), login(1), crypt(3), passwd(1), group(5)
diff --git a/.ref-Research-V7/usr/man/man5/plot.5 b/.ref-Research-V7/usr/man/man5/plot.5
deleted file mode 100644 (file)
index 040c536..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-.TH PLOT 5 
-.SH NAME
-plot \- graphics interface
-.SH DESCRIPTION
-Files of this format are produced by routines
-described in 
-.IR  plot (3),
-and are interpreted for various devices
-by commands described in
-.IR  plot (1).
-A graphics file is a stream of plotting instructions.
-Each instruction consists of an ASCII letter
-usually followed by bytes of binary information.
-The instructions are executed in order.
-A point is designated by
-four bytes representing
-the
-x and y
-values;
-each value
-is a signed integer.
-The last designated point in an
-.B "l, m, n,"
-or
-.B p
-instruction becomes the `current point'
-for the next instruction.
-.PP
-Each of the following descriptions begins with the name
-of the corresponding routine in
-.IR  plot (3).
-.TP 3
-.B  m
-move: The next four bytes give a new current point.
-.TP 3
-.B  n
-cont: Draw a line from the current point to
-the point given by the next four bytes.
-See
-.IR  plot (1).
-.TP 3
-.B  p
-point: Plot the point given by the next four bytes.
-.TP 3
-.B  l
-line: Draw a line from the point given by the next
-four bytes to the point given by the following four bytes.
-.TP 3
-.B  t
-label: Place the following ASCII string so that its
-first character falls on the current point.
-The string is terminated by a newline.
-.TP 3
-.B  a
-arc:
-The first four bytes give the center, the next four give the
-starting point,
-and the last four give the end point of a circular arc.
-The least significant coordinate of the end point is
-used only to determine the quadrant.
-The arc is drawn counter-clockwise.
-.TP 3
-.B  c
-circle:
-The first four bytes give the center of the circle,
-the next two the radius.
-.TP 3
-.B  e
-erase: Start another frame of output.
-.TP 3
-.B  f
-linemod: Take the following string, up to a newline,
-as the style for drawing further lines.
-The styles are
-`dotted,'
-`solid,' `longdashed,' `shortdashed,' and `dotdashed.'
-Effective only in 
-.I plot 4014
-and
-.I plot ver.
-.TP 3
-.B  s
-space: The next four bytes give
-the lower left corner of the plotting area;
-the following four give the upper right corner.
-The plot will be magnified or reduced to fit
-the device as closely as possible.
-.IP
-Space settings that exactly fill the plotting area
-with unity scaling appear below for
-devices supported by the filters of
-.IR  plot (1).
-The upper limit is just outside the plotting area.
-In every case the plotting area is taken to be square;
-points outside may be displayable on
-devices whose face isn't square.
-.RS
-.TP 10n
-4014
-space(0, 0, 3120, 3120);
-.br
-.ns
-.TP 
-ver
-space(0, 0, 2048, 2048);
-.br
-.ns
-.TP 
-300, 300s
-space(0, 0, 4096, 4096);
-.br
-.ns
-.TP 
-450
-space(0, 0, 4096, 4096);
-.RE
-.SH "SEE ALSO"
-plot(1), plot(3), graph(1)
diff --git a/.ref-Research-V7/usr/man/man5/tp.5 b/.ref-Research-V7/usr/man/man5/tp.5
deleted file mode 100644 (file)
index 6f8453b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH TP 5 
-.SH NAME
-tp \- DEC/mag tape formats
-.SH DESCRIPTION
-The
-command
-.I tp
-dumps files to and extracts files from
-DECtape and magtape.
-The formats of these tapes are the same except
-that magtapes have larger directories.
-.PP
-Block zero contains a
-copy of a stand-alone bootstrap program.
-See
-.IR bproc (8).
-.PP
-Blocks 1 through 24
-for DECtape (1 through 62 for magtape)
-contain a directory of the tape.
-There are 192 (resp. 496) entries in the directory;
-8 entries per block;
-64 bytes per entry.
-Each entry has the following format:
-.nf
-.IP ""
-struct {
-       char    pathname[32];
-       int     mode;
-       char    uid;
-       char    gid;
-       char    unused1;
-       char    size[3];
-       long    modtime;
-       int     tapeaddr;
-       char    unused2[16];
-       int     checksum;
-};
-.fi
-.PP
-The path name entry is the path name of the
-file when put on the tape.
-If the pathname starts with a zero word,
-the entry is empty.
-It is at most 32 bytes long and ends in a null byte.
-Mode, uid, gid, size and time modified
-are the same as described under i-nodes 
-(see file system
-.IR filsys (5)).
-The tape address is the tape block number of the start of
-the contents of the file.
-Every file
-starts on a block boundary.
-The file occupies (size+511)/512 blocks
-of continuous tape.
-The checksum entry has a value such that
-the sum of the 32 words of the directory entry is zero.
-.PP
-Blocks above 25 (resp. 63) are available for file storage.
-.PP
-A fake entry
-has a size of zero.
-.SH "SEE ALSO"
-filsys(5), tp(1)
-.SH BUGS
-The
-.I pathname, uid, gid,
-and
-.I size
-fields are too small.
diff --git a/.ref-Research-V7/usr/man/man5/ttys.5 b/.ref-Research-V7/usr/man/man5/ttys.5
deleted file mode 100644 (file)
index 03da300..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH TTYS 5 
-.SH NAME
-ttys \- terminal initialization data
-.SH DESCRIPTION
-The
-.I ttys
-file is read by the
-.I init
-program and specifies
-which terminal special files are to have
-a process created for them which will allow people to
-log in.
-It contains one line per special file.
-.PP
-The first character of a line is either `0' or `1';
-the former causes the line to be ignored,
-the latter causes it to be effective.
-The second character is used as an argument to
-.IR getty (8),
-which performs such tasks as baud-rate recognition,
-reading the login name,
-and calling
-.I login.
-For normal lines,
-the character is `0';
-other characters can be used, for example, with hard-wired terminals
-where speed recognition is unnecessary
-or which have special characteristics.
-.RI ( Getty
-will have to be fixed in such cases.)
-The remainder of the line is the terminal's entry
-in the device directory, /dev.
-.SH FILES
-/etc/ttys
-.SH "SEE ALSO"
-init(8), getty(8), login(1)
diff --git a/.ref-Research-V7/usr/man/man5/types.5 b/.ref-Research-V7/usr/man/man5/types.5
deleted file mode 100644 (file)
index f0884f3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-.TH TYPES 5
-.SH NAME
-types \- primitive system data types
-.SH SYNOPSIS
-.B #include <sys/types.h>
-.SH DESCRIPTION
-The data types defined in the include file
-are used in UNIX system code;
-some data of these types are accessible to user code:
-.PP
-.nf
-.so /usr/include/sys/types.h
-.fi
-.PP
-The form
-.I daddr_t
-is used for disk addresses except in an
-i-node on disk, see
-.IR filsys (5).
-Times are encoded in seconds since 00:00:00 GMT, January 1, 1970.
-The major and minor parts of a device code
-specify kind and unit number of a device
-and are installation-dependent.
-Offsets are measured in bytes from the beginning of a file.
-The
-.I label_t
-variables are used to save the processor state
-while another process is running.
-.SH SEE ALSO
-filsys(5), time(2), lseek(2), adb(1)
diff --git a/.ref-Research-V7/usr/man/man5/utmp.5 b/.ref-Research-V7/usr/man/man5/utmp.5
deleted file mode 100644 (file)
index 9468a3e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-.TH UTMP 5 
-.SH NAME
-utmp, wtmp \- login records
-.SH SYNOPSIS
-.B #include <utmp.h>
-.SH DESCRIPTION
-The
-.I utmp
-file allows one to discover information about who is currently
-using UNIX.
-The file is a sequence of entries with the following
-structure declared in the include file:
-.RS
-.PP
-.nf
-.so /usr/include/utmp.h
-.fi
-.RE
-.PP
-This structure gives the name of the special file
-associated with the user's terminal, the user's login name,
-and the time of the login in the form of
-.IR time (2).
-.PP
-The
-.I wtmp
-file records all logins and logouts.
-Its format is exactly like
-.I utmp
-except that
-a null user name indicates a logout on the associated
-terminal.
-Furthermore, the terminal name `~' indicates that the
-system was rebooted at the indicated time;
-the adjacent pair of entries with terminal names
-`\^|\^' and `}' indicate the system-maintained time
-just before and just after a
-.I date
-command has changed the system's idea of the time.
-.PP
-.I Wtmp
-is maintained by
-.IR login (1)
-and
-.IR init (8).
-Neither of these programs creates the file,
-so if it is removed record-keeping is turned off.
-It is summarized by
-.IR ac (1).
-.SH FILES
-/etc/utmp
-.br
-/usr/adm/wtmp
-.SH "SEE ALSO"
-login(1), init(8), who(1), ac(1)
diff --git a/.ref-Research-V7/usr/man/man6/arithmetic.6 b/.ref-Research-V7/usr/man/man6/arithmetic.6
deleted file mode 100644 (file)
index a023cbc..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-.TH ARITHMETIC 6 
-.SH NAME
-arithmetic \- provide drill in number facts
-.SH SYNOPSIS
-.B /usr/games/arithmetic
-[
-.B +\-x/
-] [ range ]
-.SH DESCRIPTION
-.I Arithmetic
-types out simple arithmetic problems,
-and waits for an answer to be typed in.
-If the answer is correct,
-it types back "Right!",
-and a new problem.
-If the answer is wrong,
-it replies "What?",
-and waits for another answer.
-Every twenty problems, it publishes
-statistics on correctness and the time required
-to answer.
-.PP
-To quit the program,
-type an interrupt (delete).
-.PP
-The first optional argument determines the kind of problem
-to be generated;
-.B +\-x/
-respectively cause
-addition, subtraction, multiplication, and division
-problems to be generated.
-One or more characters can be given;
-if more than one is given, the different types of
-problems will be mixed in random order; default is
-.B +\-
-.PP
-.I Range
-is a decimal number;
-all addends, subtrahends, differences, multiplicands, divisors,
-and quotients will be less than or equal to the value of
-.IR range .
-Default
-.I range
-is 10.
-.PP
-At the start, all numbers less than or equal to
-.I range
-are equally likely
-to appear.
-If the respondent makes a mistake,
-the numbers in the problem which was missed
-become more likely to reappear.
-.PP
-As a matter of educational philosophy, the program will
-not give correct answers,
-since the learner should, in principle,
-be able to calculate them.
-Thus the program is intended to provide drill for
-someone just past the first learning stage,
-not to teach number facts
-.I de
-.IR novo .
-For almost all users,
-the relevant statistic should be
-time per problem, not percent correct.
diff --git a/.ref-Research-V7/usr/man/man6/backgammon.6 b/.ref-Research-V7/usr/man/man6/backgammon.6
deleted file mode 100644 (file)
index c7bc3ec..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-.TH BACKGAMMON 6 
-.SH NAME
-backgammon \- the game
-.SH SYNOPSIS
-.B /usr/games/backgammon
-.SH DESCRIPTION
-This program does what you expect.
-It will ask whether you need instructions.
diff --git a/.ref-Research-V7/usr/man/man6/banner.6 b/.ref-Research-V7/usr/man/man6/banner.6
deleted file mode 100644 (file)
index 2945ecb..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-.TH BANNER 6 
-.SH NAME
-banner \- make long posters
-.SH SYNOPSIS
-.B /usr/games/banner
-.SH DESCRIPTION
-.I Banner
-reads the standard input and
-prints it sideways in huge built-up letters
-on the standard output.
diff --git a/.ref-Research-V7/usr/man/man6/bcd.6 b/.ref-Research-V7/usr/man/man6/bcd.6
deleted file mode 100644 (file)
index 3badae5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.TH BCD 6 
-.SH NAME
-bcd, ppt \- convert to antique media
-.SH SYNOPSIS
-.B /usr/games/bcd
-text
-.PP
-.B /usr/games/ppt
-.SH DESCRIPTION
-.I Bcd
-converts the literal
-.I text
-into a form familiar to old-timers.
-.PP
-.I Ppt
-converts the standard input into yet another form.
-.SH "SEE ALSO"
-dd(1)
diff --git a/.ref-Research-V7/usr/man/man6/bj.6 b/.ref-Research-V7/usr/man/man6/bj.6
deleted file mode 100644 (file)
index cb2e8f7..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.TH BJ 6 
-.SH NAME
-bj \- the game of black jack
-.SH SYNOPSIS
-.B /usr/games/bj
-.SH DESCRIPTION
-.I Bj
-is a serious attempt at
-simulating the dealer
-in the game of black jack (or twenty-one)
-as might be found in Reno.
-The following rules apply:
-.HP 5
-The bet is $2 every hand.
-.IP
-A player `natural' (black jack) pays $3.
-A dealer natural loses $2.
-Both dealer and player naturals
-is a `push' (no money exchange).
-.IP
-If the dealer has an ace up,
-the player is allowed to make an `insurance'
-bet against the chance of a dealer natural.
-If this bet is not taken, play resumes as normal.
-If the bet is taken, it is a side bet
-where the player wins $2 if the dealer has
-a natural and loses $1 if the dealer does not.
-.IP
-If the player is dealt two cards
-of the same value, he is allowed to
-`double'.
-He is allowed to play two
-hands, each with one of these cards.
-(The bet is doubled also; $2 on each hand.)
-.IP
-If a dealt hand
-has a total of ten or eleven,
-the player may `double down'.
-He may double the bet ($2 to $4)
-and receive exactly one more card on that hand.
-.IP
-Under normal play,
-the player may `hit' (draw a card)
-as long as his total is not over twenty-one.
-If the player `busts' (goes over twenty-one),
-the dealer wins the bet.
-.IP
-When the player `stands' (decides not to hit),
-the dealer hits until he attains
-a total of seventeen or more.
-If the dealer busts, the player wins the bet.
-.IP
-If both player and dealer stand,
-the one with the largest total wins.
-A tie is a push.
-.PP
-The machine deals and keeps score.
-The following questions will be asked at
-appropriate times.
-Each question is
-answered by
-.B y
-followed by a new line for `yes',
-or just new line for `no'.
-.PP
-?              (means, `do you want a hit?')
-.br
-Insurance?
-.br
-Double down?
-.PP
-Every time the deck is shuffled,
-the dealer so states and the `action' (total bet)
-and `standing' (total won or lost)
-is printed.
-To exit, hit the interrupt key (DEL)
-and the action and standing will be printed.
diff --git a/.ref-Research-V7/usr/man/man6/checkers.6 b/.ref-Research-V7/usr/man/man6/checkers.6
deleted file mode 100644 (file)
index c2c59fe..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-.TH CHECKERS 6
-.SH NAME
-checkers \- game
-.SH SYNOPSIS
-.B /usr/games/checkers
-.SH DESCRIPTION
-.I Checkers
-uses standard notation for the board:
-.PP
-.ce
-BLACK
-.nf
-.TS
-center, box;
-r|r|r|r|r|r|r|r.
-////   1       ////    2       ////    3       ////    4
-////           ////            ////            ////
-_
-5      ////    6       ////    7       ////    8       ////
-       ////            ////            ////            ////
-_
-////   9       ////    10      ////    11      ////    12
-////           ////            ////            ////
-_
-13     ////    14      ////    15      ////    16      ////
-       ////            ////            ////            ////
-_
-////   17      ////    18      ////    19      ////    20
-////           ////            ////            ////
-_
-21     ////    22      ////    23      ////    24      ////
-       ////            ////            ////            ////
-_
-////   25      ////    26      ////    27      ////    28
-////           ////            ////            ////
-_
-29     ////    30      ////    31      ////    32      ////
-       ////            ////            ////            ////
-_
-.TE
-.ce
-WHITE
-.fi
-.PP
-Black plays first.
-The program normally plays white.
-To specify a move, name the square moved from
-and the square moved to.
-For multiple jumps name all the squares touched.
-.PP
-.PP
-Certain commands may be given instead of moves:
-.TP \w'reverse\ \ 'u
-reverse
-Reverse roles; the program takes over your pieces.
-.TP
-backup
-Undo the last move for each player.
-.TP
-list
-Print the record of the game.
-.TP
-move
-Let the program select a move for you.
-.TP
-print
-Print a map of the present position.
diff --git a/.ref-Research-V7/usr/man/man6/chess.6 b/.ref-Research-V7/usr/man/man6/chess.6
deleted file mode 100644 (file)
index 5fef18a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-.TH CHESS 6 
-.SH NAME
-chess \- the game of chess
-.SH SYNOPSIS
-.B /usr/games/chess
-.SH DESCRIPTION
-.I Chess
-is a computer program that plays class D chess.
-Moves may be given either in standard (descriptive) notation
-or in algebraic notation.
-The symbol `+' is used to specify check;
-`o-o' and `o-o-o' specify castling.
-To play black, type `first';
-to print the board, type an empty line.
-.PP
-Each move is echoed in the appropriate notation followed by
-the program's reply.
-.SH FILES
-/usr/lib/book          opening `book'
-.SH DIAGNOSTICS
-The most cryptic diagnostic is `eh?' which
-means that the input was syntactically incorrect.
-.SH WARNING
-Over-use of this program
-will cause it to go away.
-.SH BUGS
-Pawns may be promoted only to queens.
diff --git a/.ref-Research-V7/usr/man/man6/ching.6 b/.ref-Research-V7/usr/man/man6/ching.6
deleted file mode 100644 (file)
index b4c221d..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-.TH CHING 6 
-.SH NAME
-ching, fortune \- the book of changes and other cookies
-.SH SYNOPSIS
-.B /usr/games/ching
-[ hexagram ]
-.PP
-.B /usr/games/fortune
-.SH DESCRIPTION
-The
-.I "I Ching"
-or
-.I "Book of Changes"
-is an ancient Chinese oracle
-that has been in use for
-centuries
-as a source of wisdom
-and advice.
-.PP
-The text of the
-.I oracle
-(as it is sometimes known)
-consists of sixty-four
-.I hexagrams,
-each symbolized
-by a particular
-arrangement of
-six straight
-(\-\-\-)
-and broken
-(\-\ \-)
-lines.
-These lines
-have values ranging
-from six through nine,
-with the even
-values indicating
-the broken lines.
-.PP
-Each hexagram
-consists of two major sections.
-The
-.B  Judgement
-relates specifically
-to the matter at hand
-(E.g.,
-"It furthers one to have somewhere to go.")
-while the
-.B  Image
-describes
-the general attributes
-of the hexagram
-and how they apply
-to one's own life
-("Thus the superior man
-makes himself strong
-and untiring.").
-.PP
-When any of the lines
-have the values six or nine,
-they are moving lines;
-for each
-there is an appended
-judgement which
-becomes significant.
-Furthermore, the moving lines
-are inherently unstable and
-change into their opposites;
-a second hexagram
-(and thus an additional judgement)
-is formed.
-.PP
-Normally, one consults the oracle
-by fixing the desired question
-firmly in mind
-and then casting a set of changes
-(lines)
-using yarrow\-stalks
-or tossed coins.
-The resulting hexagram
-will be the answer
-to the question.
-.PP
-Using an algorithm
-suggested by S. C. Johnson,
-the Unix
-.IR oracle " simply reads"
-a question
-from the standard input
-(up to an EOF)
-and hashes the individual
-characters
-in combination with the
-time of day, process id
-and any other magic numbers
-which happen to be lying
-around the system.
-The resulting value
-is used as the seed
-of a random number generator
-which drives a simulated
-coin\-toss divination.
-The answer is then piped through
-.BR nroff " for formatting"
-and will appear on the
-standard output.
-.PP
-For those who wish
-to remain steadfast
-in the old traditions,
-the oracle will also accept
-the results of a personal
-divination using,
-for example,
-coins.
-To do this,
-cast the change
-and then type the
-resulting line values
-as an argument.
-.PP
-The impatient modern may prefer to settle for
-Chinese cookies; try
-.I fortune.
-.SH "SEE ALSO"
-It furthers one to see the great man.
-.SH DIAGNOSTICS
-The great prince issues commands,
-.br
-Founds states, vests families with fiefs.
-.br
-Inferior people should not be employed.
-.SH BUGS
-Waiting in the mud
-.br
-Brings about the arrival of the enemy.
-.PP
-If one is not extremely careful,
-.br
-Somebody may come up from behind and strike him.
-.br
-Misfortune.
diff --git a/.ref-Research-V7/usr/man/man6/cubic.6 b/.ref-Research-V7/usr/man/man6/cubic.6
deleted file mode 100644 (file)
index 1b8265d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-.so /usr/man/man6/ttt.6
diff --git a/.ref-Research-V7/usr/man/man6/maze.6 b/.ref-Research-V7/usr/man/man6/maze.6
deleted file mode 100644 (file)
index 3c3153f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-.TH MAZE 6 
-.SH NAME
-maze \- generate a maze problem
-.SH SYNOPSIS
-.B /usr/games/maze/
-.SH DESCRIPTION
-.I Maze
-asks a few questions and then
-prints a maze.
-.SH BUGS
-Some mazes (especially small ones)
-have no solutions.
diff --git a/.ref-Research-V7/usr/man/man6/moo.6 b/.ref-Research-V7/usr/man/man6/moo.6
deleted file mode 100644 (file)
index 7e06c0c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-.TH MOO 6 
-.SH NAME
-moo \- guessing game
-.SH SYNOPSIS
-.B /usr/games/moo
-.SH DESCRIPTION
-.I Moo
-is a guessing game imported from England.
-The computer picks a number consisting
-of four distinct decimal digits.
-The player guesses four distinct digits
-being scored on each guess.
-A `cow' is a correct digit in an incorrect position.
-A `bull' is a correct digit in a correct position.
-The game continues until the player guesses the number
-(a score of four bulls).
diff --git a/.ref-Research-V7/usr/man/man6/quiz.6 b/.ref-Research-V7/usr/man/man6/quiz.6
deleted file mode 100644 (file)
index c58ba4b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH QUIZ 6 
-.SH NAME
-quiz \- test your knowledge
-.SH SYNOPSIS
-.B /usr/games/quiz
-[
-.B \-i
-file ]
-[
-.B \-t
-] [ category1 category2 ]
-.SH DESCRIPTION
-.I Quiz
-gives associative
-knowledge tests on various subjects.
-It asks items chosen from
-.I category1
-and expects answers from
-.IR category2 .
-If no categories are specified,
-.I quiz
-gives instructions
-and lists the available categories.
-.PP
-.I Quiz
-tells a correct answer whenever you type
-a bare newline.
-At the end of input, upon interrupt,
-or when questions run out,
-.I quiz
-reports a score and terminates.
-.PP
-The
-.B \-t
-flag specifies `tutorial' mode,
-where missed questions are repeated
-later, and material is gradually introduced as you learn.
-.PP
-The
-.B \-i
-flag causes the named file to be substituted for the
-default index file.
-The lines of these files have the  syntax:
-.IP "" 4
-.nf
-.ta \w'alternate 'u
-line   = category newline \(bv category `:' line
-category       = alternate \(bv category `|' alternate
-alternate      = empty \(bv alternate primary
-primary        = character \(bv `[' category `]' \(bv option
-option = `{' category `}'
-.PP
-.fi
-The first category on each
-line of an index file names an information file.
-The remaining categories specify the order and contents of
-the data in each line of the
-information file.
-Information files have the same syntax.
-Backslash `\\' is used as with
-.IR sh (1)
-to quote syntactically
-significant characters or to insert transparent
-newlines into a line.
-When either a question or its answer is empty,
-.I quiz
-will refrain from asking it.
-.SH FILES
-/usr/games/quiz.k/*
-.SH BUGS
-The construct `a|ab' doesn't work in an information
-file.
-Use `a{b}'.
diff --git a/.ref-Research-V7/usr/man/man6/reversi.6 b/.ref-Research-V7/usr/man/man6/reversi.6
deleted file mode 100644 (file)
index 2b15e1e..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-.TH REVERSI 6 
-.SH NAME
-reversi \- a game of dramatic reversals
-.SH SYNOPSIS
-.B /usr/games/reversi
-[ [
-.B \-r
-]
-.I file
-]
-.SH DESCRIPTION
-.I Reversi
-(also known as `friends',
-`Chinese friends' and `Othello')
-is played on an 8\(mu8 board
-using two-sided tokens.
-Each player takes his turn by placing
-a token with his side up in an empty square.
-During the first four turns, players
-may only place tokens in the four central squares
-of the board.
-Subsequently, with each turn, a player
-.I must
-capture one or more
-of his opponent's tokens.
-He does this by placing
-one of his tokens such that
-it and another of his tokens embrace
-a solid line of his opponent's
-horizontally, vertically or diagonally.
-Captured tokens are flipped over
-and thus can be re-captured.
-If a player cannot outflank
-his opponent he forfeits
-his turn.
-The play continues until the
-board is filled or until no more
-outflanking is possible.
-.PP
-In this game,
-your tokens are asterisks
-and the machine's are at-signs.
-You move by typing in the row and column
-at which you want to place your token
-as two digits (1-8),
-optionally separated by blanks or tabs.
-You can also type
-.TP
-.B  c
-to continue the game after hitting break
-(this is only necessary if you interrupt the machine
-while it is deliberating).
-.TP
-.BR g " \fIn"
-to start
-.I reversi
-playing against itself
-for the next
-.IR n ""
-moves
-(or until the break key is hit).
-.TP
-.B  n
-to stop printing the board after each move.
-.TP
-.B  o
-to start it up again.
-.TP
-.B  p
-to print the board regardless.
-.TP
-.B  q
-to quit (without dishonor).
-.TP
-.B  s
-to print the score.
-.PP
-.I Reversi
-also recognizes several commands which are valid only
-at the start of the game, before any moves have been made.
-They are
-.TP
-.B  f
-to let the machine go first.
-.TP
-.BR h " \fIn"
-to ask for a handicap
-of from one to four corner squares.
-If you're
-good, you can give the machine
-a handicap by typing a negative number.
-.TP
-.BR l " \fIn"
-to set the amount of lookahead
-used by the machine in searching for moves.
-Zero means none at all. Four is the default.
-Greater than six means you may fall asleep
-waiting for the machine to move.
-.TP
-.BR t " \fIn"
-to tell
-.I reversi
-that you will only need
-.IR n ""
-seconds
-to consider each move. If you fail to respond in the
-alloted time, you forfeit your turn.
-.PP
-If
-.I reversi
-is given a file name as an argument,
-it will checkpoint the game,
-move by move, by dumping the board onto
-.IR file .
-The
-.B \-r
-option will cause
-.I reversi
-to restart the game from
-.I file
-and continue logging.
diff --git a/.ref-Research-V7/usr/man/man6/ttt.6 b/.ref-Research-V7/usr/man/man6/ttt.6
deleted file mode 100644 (file)
index ee0adbc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-.TH TTT 6 
-.SH NAME
-ttt, cubic \- tic-tac-toe
-.SH SYNOPSIS
-.B /usr/games/ttt
-.PP
-.B /usr/games/cubic
-.SH DESCRIPTION
-.I Ttt
-is the X and O game popular in the first grade.
-This is a learning program that never makes the same
-mistake twice.
-.PP
-Although it learns, it learns slowly.
-It must lose nearly 80 games to
-completely know the game.
-.PP
-.I Cubic
-plays three-dimensional tic-tac-toe on a 4\(mu4\(mu4
-board.
-Moves are specified as a sequence of three
-coordinate numbers in the range 1-4.
-.SH FILES
-/usr/games/ttt.k       learning file
diff --git a/.ref-Research-V7/usr/man/man6/words.6 b/.ref-Research-V7/usr/man/man6/words.6
deleted file mode 100644 (file)
index 5e71af1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-.TH WORDS 6 
-.SH NAME
-hangman, words \- word games
-.SH SYNOPSIS
-.B /usr/games/hangman
-[ dict ]
-.PP
-.B /usr/games/words
-.SH DESCRIPTION
-.I Hangman
-chooses a word at least seven letters
-long from a word list.
-The user is to guess letters one at a time.
-.PP
-The optional argument
-names an alternate word list.
-The special name `\-a' gets a particular very large
-word list.
-.PP
-.I Words
-prints all the uncapitalized words
-in the word list that can be made from
-letters in
-.I string.
-.SH FILES
-/usr/dict/words                the regular word list
-.br
-/crp/dict/web2         the the \-a word list
-.SH DIAGNOSTICS
-After each round,
-.I hangman
-reports the average number of guesses per round
-and the number of rounds.
-.SH BUGS
-Hyphenated compounds are run together.
-.PP
-UNIX software is distributed without
-the \-a word list.
diff --git a/.ref-Research-V7/usr/man/man6/wump.6 b/.ref-Research-V7/usr/man/man6/wump.6
deleted file mode 100644 (file)
index da26a10..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-.TH WUMP 6 
-.SH NAME
-wump \- the game of hunt-the-wumpus
-.SH SYNOPSIS
-.B /usr/games/wump
-.SH DESCRIPTION
-.I Wump
-plays the game of `Hunt the Wumpus.'
-A Wumpus is a creature that lives in a cave with several rooms
-connected by tunnels.
-You wander among the rooms, trying to
-shoot the Wumpus with an arrow, meanwhile avoiding
-being eaten by the Wumpus and falling
-into
-Bottomless Pits.
-There are also Super Bats which are likely to pick you up
-and drop you in some random room.
-.PP
-The program asks various questions which you answer
-one per line;
-it will give a more detailed description
-if you want.
-.PP
-This program is based on one described in
-.I "People's Computer Company,"
-.I 2,
-2 (November 1973).
-.SH BUGS
-It will never replace Space War.
diff --git a/.ref-Research-V7/usr/man/man7/ascii.7 b/.ref-Research-V7/usr/man/man7/ascii.7
deleted file mode 100644 (file)
index 2dbe08e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-.TH ASCII 7 
-.SH NAME
-ascii \- map of ASCII character set
-.SH SYNOPSIS
-.B cat /usr/pub/ascii
-.SH DESCRIPTION
-.I Ascii
-is a map of the ASCII character set, to be printed as needed.
-It contains:
-.nf
-
-.cs R 20
-|000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel|
-|010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si |
-|020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb|
-|030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us |
-|040 sp |041  ! |042  " |043  # |044  $ |045  % |046  & |047  \' |
-|050  ( |051  ) |052  * |053  + |054  , |055  \- |056  . |057  / |
-|060  0 |061  1 |062  2 |063  3 |064  4 |065  5 |066  6 |067  7 |
-|070  8 |071  9 |072  : |073  ; |074  < |075  = |076  > |077  ? |
-|100  @ |101  A |102  B |103  C |104  D |105  E |106  F |107  G |
-|110  H |111  I |112  J |113  K |114  L |115  M |116  N |117  O |
-|120  P |121  Q |122  R |123  S |124  T |125  U |126  V |127  W |
-|130  X |131  Y |132  Z |133  [ |134  \\ |135  ] |136  ^ |137  _ |
-|140  \` |141  a |142  b |143  c |144  d |145  e |146  f |147  g |
-|150  h |151  i |152  j |153  k |154  l |155  m |156  n |157  o |
-|160  p |161  q |162  r |163  s |164  t |165  u |166  v |167  w |
-|170  x |171  y |172  z |173  { |174  | |175  } |176  ~ |177 del|
-
-.fi
-.cs R
-.SH FILES
-/usr/pub/ascii
diff --git a/.ref-Research-V7/usr/man/man7/eqnchar.7 b/.ref-Research-V7/usr/man/man7/eqnchar.7
deleted file mode 100644 (file)
index ec04d9f..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-.EQ
-tdefine ciplus % "\o'\(pl\(ci'" %
-ndefine ciplus % O\b+ %
-tdefine citimes % "\o'\(mu\(ci'" %
-ndefine citimes % O\bx %
-tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" %
-ndefine =wig % =\b"~" %
-tdefine bigstar % "\o'\(pl\(mu'" %
-ndefine bigstar % X\b|\b- %
-tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" %
-ndefine =dot % = dot %
-tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" %
-ndefine orsign % \e/ %
-tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" %
-ndefine andsign % /\e %
-tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" %
-ndefine =del % = to DELTA %
-tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" %
-ndefine oppA % V\b- %
-tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" %
-ndefine oppE % E\b/ %
-tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em\v'-.45m'\s+1" %
-ndefine incl % C\b_ %
-tdefine nomem % "\o'\(mo\(sl'" %
-ndefine nomem % C\b-\b/ %
-tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" %
-ndefine angstrom % A to o %
-tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}%
-ndefine star % * %
-tdefine || % \(or\(or %
-tdefine <wig % "\z<\v'.4m'\(ap\v'-.4m'" %
-ndefine <wig %{ < from "~" }%
-tdefine >wig % "\z>\v'.4m'\(ap\v'-.4m'" %
-ndefine >wig %{ > from "~" }%
-tdefine langle % "\s-3\b'\(sl\e'\s0" %
-ndefine langle %<%
-tdefine rangle % "\s-3\b'\e\(sl'\s0" %
-ndefine rangle %>%
-tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" %
-ndefine hbar % h\b\u-\d %
-ndefine ppd % _\b| %
-tdefine ppd % "\o'\(ru\s-2\(or\s+2'" %
-tdefine <-> % "\o'\(<-\(->'" %
-ndefine <-> % "<-->" %
-tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" %
-ndefine <=> % "<=>" %
-tdefine |< % "\o'<\(or'" %
-ndefine |< % <\b| %
-tdefine |> % "\o'>\(or'" %
-ndefine |> % |\b> %
-tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" %
-ndefine ang % /\b_ %
-tdefine rang % "\z\(or\h'.15m'\(ru" %
-ndefine rang % L %
-tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" %
-ndefine 3dot % .\b\u.\b\u.\d\d %
-tdefine thf % ".\v'-.5m'.\v'.5m'." %
-ndefine thf % ..\b\u.\d %
-tdefine quarter % roman \(14 %
-ndefine quarter % 1/4 %
-tdefine 3quarter % roman \(34 %
-ndefine 3quarter % 3/4 %
-tdefine degree % \(de %
-ndefine degree % nothing sup o %
-tdefine square % \(sq %
-ndefine square % [] %
-tdefine circle % \(ci %
-ndefine circle % O %
-tdefine blot % "\fB\(sq\fP" %
-ndefine blot % H\bI\bX %
-tdefine bullet % \(bu %
-ndefine bullet % o\bx\be %
-tdefine -wig % "\(~=" %
-ndefine -wig % - to "~" %
-tdefine wig % \(ap %
-ndefine wig % "~" %
-tdefine prop % \(pt %
-ndefine prop % oc %
-tdefine empty % \(es %
-ndefine empty % O\b/ %
-tdefine member % \(mo %
-ndefine member % C\b- %
-tdefine cup % \(cu %
-ndefine cup % U %
-define cap % \(ca %
-define subset % \(sb %
-define supset % \(sp %
-define !subset % \(ib %
-define !supset % \(ip %
-.EN
-.TH EQNCHAR 7 
-.SH NAME
-eqnchar \- special character definitions for eqn
-.SH SYNOPSIS
-.B eqn /usr/pub/eqnchar
-[ files ]
-.B \(bv troff
-[ options ]
-.PP
-.B neqn /usr/pub/eqnchar
-[ files ]
-.B \(bv nroff
-[ options ]
-.SH DESCRIPTION
-.I Eqnchar
-contains
-.I troff
-and
-.I nroff
-character definitions for constructing characters that are not
-available on the Graphic Systems typesetter.
-These definitions are primarily intended for use with
-.I eqn
-and
-.IR neqn .
-It contains
-definitions for the following characters
-.PP
-.nf
-.ta \w'angstrom  'u \n(.lu/3u +\w'angstrom  'u \n(.lu*2u/3u +\w'angstrom  'u
-.EQ
-"ciplus"       ciplus  "|\||"  ||      "square"        square
-.EN
-.EQ
-"citimes"      citimes "langle"        langle  "circle"        circle
-.EN
-.EQ
-"wig"  wig     "rangle"        rangle  "blot"  blot
-.EN
-.EQ
-"-wig" -wig    "hbar"  hbar    "bullet"        bullet
-.EN
-.EQ
-">wig" >wig    "ppd"   ppd     "prop"  prop
-.EN
-.EQ
-"<wig" <wig    "<->"   <->     "empty" empty
-.EN
-.EQ
-"=wig" =wig    "<=>"   <=>     "member"        member
-.EN
-.EQ
-"star" star    "|\|"   |<      "nomem" nomem
-.EN
-.EQ
-"bigstar"      bigstar "|\|>"  |>      "cup"   cup
-.EN
-.EQ
-"=dot" =dot    "ang"   ang     "cap"   cap
-.EN
-.EQ
-"orsign"       orsign  "rang"  rang    "incl"  incl
-.EN
-.EQ
-"andsign"      andsign "3dot"  3dot    "subset"        subset
-.EN
-.EQ
-"=del" =del    "thf"   thf     "supset"        supset
-.EN
-.EQ
-"oppA" oppA    "quarter"       quarter "!subset"       !subset
-.EN
-.EQ
-"oppE" oppE    "3quarter"      3quarter        "!supset"       !supset
-.EN
-.EQ
-"angstrom"     angstrom        "degree"        degree
-.EN
-.SH FILES
-/usr/pub/eqnchar
-.SH SEE ALSO
-troff(1), eqn(1)
diff --git a/.ref-Research-V7/usr/man/man7/hier.7 b/.ref-Research-V7/usr/man/man7/hier.7
deleted file mode 100644 (file)
index 3abc524..0000000
+++ /dev/null
@@ -1,518 +0,0 @@
-.TH HIER 7
-.SH NAME
-hier \- file system hierarchy
-.SH DESCRIPTION
-The following outline gives a quick tour through
-a representative directory hierarchy.
-.na
-.nh
-.IP /
-root
-.PD 0
-.IP /dev/
-devices (4)
-.RS
-.IP console
-main console,
-.IR tty (4)
-.IP tty*
-terminals,
-.IR tty (4)
-.IP cat
-phototypesetter
-.IR cat (4)
-.IP rp*
-disks,
-.I rp,
-.IR hp (4)
-.IP rrp*
-raw disks,
-.I rp,
-.IR hp (4)
-.IP ...
-.RE
-.IP /bin/
-utility programs, cf /usr/bin/ (1)
-.RS
-.IP as
-assembler first pass,
-cf /usr/lib/as2
-.IP cc
-C compiler executive,
-cf /usr/lib/c[012]
-.IP ...
-.RE
-.IP /lib/
-object libraries and other stuff, cf /usr/lib/
-.RS
-.IP libc.a
-system calls, standard I/O, etc. (2,3,3S)
-.IP libm.a
-math routines (3M)
-.IP libplot.a
-plotting routines,
-.IR plot (3)
-.IP libF77.a
-Fortran runtime support
-.IP libI77.a
-Fortran I/O
-.IP ...
-.IP as2
-second pass of
-.IR as (1)
-.IP c[012]
-passes of
-.IR cc (1)
-.IP ...
-.RE
-.IP /etc/
-essential data and dangerous maintenance utilities
-.RS
-.IP passwd
-password file,
-.IR passwd (5)
-.IP group
-group file,
-.IR group (5)
-.IP motd
-message of the day,
-.IR login (1)
-.IP mtab
-mounted file table,
-.IR mtab (5)
-.IP ddate
-dump history,
-.IR dump (1)
-.IP ttys
-properties of terminals,
-.IR ttys (5)
-.IP getty
-part of
-.IR login ,
-.IR getty (8)
-.IP init
-the father of all processes,
-.IR init (8)
-.IP rc
-shell program to bring the system up
-.IP cron
-the clock daemon,
-.IR cron (8)
-.IP mount
-.IR mount (1)
-.IP wall
-.IR wall (1)
-.IP ...
-.RE
-.IP /tmp/
-temporary files, usually on a fast device, cf /usr/tmp/
-.RS
-.IP e*
-used by
-.IR ed (1)
-.IP ctm*
-used by 
-.IR cc (1)
-.IP ...
-.RE
-.IP /usr/
-general-pupose directory, usually a mounted file system
-.RS
-.IP adm/
-administrative information
-.RS
-.IP wtmp
-login history,
-.IR utmp (5)
-.IP messages
-hardware error messages
-.IP tracct
-phototypesetter accounting,
-.IR troff (1)
-.IP vpacct
-line printer accounting
-.IR lpr (1)
-.RE
-.RE
-.IP /usr\t/bin
-.RS
-utility programs, to keep /bin/ small
-.IP tmp/
-temporaries, to keep /tmp/ small
-.RS
-.IP stm*
-used by
-.IR sort (1)
-.IP raster
-used by
-.IR plot (1)
-.RE
-.IP dict/
-word lists, etc.
-.RS
-.IP words
-principal word list, used by
-.IR look (1)
-.IP spellhist
-history file for
-.IR spell (1)
-.RE
-.IP games/
-.RS
-.IP bj
-blackjack
-.IP hangman
-.IP quiz.k/
-what
-.IR quiz (6)
-knows
-.RS
-.IP index
-category index
-.IP africa
-countries and capitals
-.IP ...
-.RE
-.IP ...
-.RE
-.IP include/
-standard #include files
-.RS
-.IP a.out.h
-object file layout,
-.IR a.out (5)
-.IP stdio.h
-standard I/O,
-.IR stdio (3)
-.IP math.h
-(3M)
-.IP ...
-.IP sys/
-system-defined layouts, cf /usr/sys/h
-.RS
-.IP acct.h
-process accounts,
-.IR acct (5)
-.IP buf.h
-internal system buffers
-.IP ...
-.RE
-.RE
-.IP lib/
-object libraries and stuff, to keep /lib/ small
-.RS
-.IP lint[12]
-subprocesses for
-.IR lint (1)
-.IP llib-lc
-dummy declarations for /lib/libc.a, used by
-.IR lint (1)
-.IP llib-lm
-dummy declarations for /lib/libc.m
-.IP atrun
-scheduler for
-.IR at (1)
-.IP struct/
-passes of
-.IR struct (1)
-.IP ...
-.IP tmac/
-macros for
-.IR troff (1)
-.RS
-.IP tmac.an
-macros for
-.IR man (7)
-.IP tmac.s
-macros for
-.IR ms (7)
-.IP ...
-.RE
-.IP font/
-fonts for
-.IR troff (1)
-.RS
-.IP R
-Times Roman
-.IP B
-Times Bold
-.IP ...
-.RE
-.IP uucp/
-programs and data for
-.IR uucp (1)
-.RS
-.IP L.sys
-remote system names and numbers
-.IP uucico
-the real copy program
-.IP ...
-.RE
-.IP suftab
-table of suffixes for hyphenation, used by
-.IR troff (1)
-.IP units
-conversion tables for
-.IR units (1)
-.IP eign
-list of English words to be ignored by
-.IR ptx (1)
-.RE
-.RE
-.IP /usr/\tman/
-.RS
-volume 1 of this manual,
-.IR man (1)
-.RS
-.IP man0/
-general
-.RS
-.IP intro
-introduction to volume 1,
-.IR ms (7)
-format
-.IP xx
-template for manual page
-.RE
-.IP man1/
-chapter 1
-.RS
-.IP as.1
-.IP mount.1m
-.IP ...
-.RE
-.IP cat1/
-preprinted pages for man1/
-.RS
-.IP as.1
-.IP mount.1m
-.RE
-.IP ...
-.RE
-.IP spool/
-delayed execution files
-.RS
-.IP at/
-used by 
-.IR at (1)
-.IP lpd/
-used by
-.IR lpr (1)
-.RS
-.IP lock
-present when line printer is active
-.IP cf*
-copy of file to be printed, if necessary
-.IP df*
-daemon control file,
-.IR lpd (8)
-.IP tf*
-transient control file, while 
-.I lpr
-is working
-.RE
-.IP uucp/
-work files and staging area for 
-.IR uucp (1)
-.RS
-.IP LOGFILE
-summary log
-.IP LOG.*
-log file for one transaction
-.RE
-.RE
-.IP mail/
-mailboxes for
-.IR mail (1)
-.RS
-.TP
-.I uid
-mail file for user
-.I uid
-.TP
-.IR uid .lock
-lock file while
-.I uid
-is receiving mail
-.RE
-.TP
-.I wd
-initial working directory of a user,
-typically
-.I wd
-is the user's login name
-.RS
-.TP
-.BR . profile
-set environment for
-.IR sh (1),
-.IR environ (5)
-.IP calendar
-user's datebook for
-.IR calendar (1)
-.RE
-.IP doc/
-papers, mostly in volume 2 of this manual, typically in
-.IR ms (7)
-format
-.RS
-.IP as/
-assembler manual
-.IP c
-C manual
-.IP ...
-.RE
-.IP sys/
-system source
-.RS
-.IP dev/
-device drivers
-.RS
-.IP bio.c
-common code
-.IP cat.c
-.IR cat (4)
-.IP dh.c
-DH11,
-.IR tty (4)
-.IP tty
-.IR tty (4)
-.IP ...
-.RE
-.IP conf/
-hardware-dependent code
-.RS
-.IP mch.s
-assembly language portion
-.IP conf
-configuration generator
-.IP ...
-.RE
-.IP h/
-header (include) files
-.RS
-.IP acct.h
-.IR acct (5)
-.IP stat.h
-.IR stat (2)
-.IP ...
-.RE
-.IP sys/
-source for system proper
-.RS
-.IP main.c
-.IP pipe.c
-.IP sysent.c
-system entry points
-.IP ...
-.RE
-.RE
-.RE
-.IP /usr/\tsrc/
-.RS
-source programs for utilities, etc.
-.RS
-.IP cmd/
-source of commands
-.RS
-.IP as/
-assembler
-.RS
-.IP makefile
-recipe for rebuilding the assembler
-.IP as1?.s
-source of pass1
-.RE
-.IP ar.c
-source for
-.IR ar (1)
-.IP ...
-.IP troff/
-source for
-.I nroff
-and
-.IR troff (1)
-.RS
-.IP nmake
-makefile for
-.I nroff
-.IP tmake
-makefile for
-.I troff
-.IP font/
-source for font tables, /usr/lib/font/
-.RS
-.IP ftR.c
-Roman
-.IP ...
-.RE
-.IP term/
-terminal characteristics tables, /usr/lib/term/
-.RS
-.IP tab300.c
-DASI 300
-.IP ...
-.RE
-.IP ...
-.RE
-.RE
-.IP libc/
-source for functions in /lib/libc.a
-.RS
-.IP crt/
-C runtime support
-.RS
-.IP ldiv.s
-division into a long
-.IP lmul.s
-multiplication to produce long
-.IP ...
-.RE
-.IP csu/
-startup and wrapup routines needed with every C program
-.RS
-.IP crt0.s
-regular startup
-.IP mcrt0.s
-modified startup for
-.I cc \-p
-.RE
-.IP sys/
-system calls (2)
-.RS
-.IP access.s
-.IP alarm.s
-.IP ...
-.RE
-.IP stdio/
-standard I/O functions (3S)
-.RS
-.IP fgets.c
-.IP fopen.c
-.IP ...
-.RE
-.IP gen/
-other functions in (3)
-.RS
-.IP abs.c
-.IP atof.c
-.IP ...
-.RE
-.IP compall
-shell procedure to compile libc
-.IP mklib
-shell procedure to make /lib/libc.a
-.RE
-.IP libI77/
-source for /lib/libI77
-.IP libF77/
-.IP ...
-.IP games/
-source for /usr/games
-.RE
-.RE
-.ad
-.SH SEE ALSO
-ls(1), ncheck(1), find(1), grep(1)
-.SH BUGS
-The position of files is subject to change without notice.
diff --git a/.ref-Research-V7/usr/man/man7/man.7 b/.ref-Research-V7/usr/man/man7/man.7
deleted file mode 100644 (file)
index adeed8d..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-.TH MAN 7 
-.SH NAME
-man \- macros to typeset manual
-.SH SYNOPSIS
-.B
-nroff  \-man\ 
-file ...
-.PP
-.B
-troff  \-man\ 
-file ...
-.SH DESCRIPTION
-These macros are used to lay out pages of this manual.
-A skeleton page may be found in the file 
-/usr/man/man0/xx.
-.PP
-Any text argument
-.I t
-may be zero to six words.
-Quotes may be used to include blanks in a `word'.
-If 
-.I text
-is empty,
-the special treatment is applied to
-the next input line with text to be printed.
-In this way
-.BR . I
-may be used to italicize a whole line, or
-.BR . SM
-followed by
-.BR . B
-to make small bold letters.
-.PP
-A prevailing indent distance is remembered between
-successive indented paragraphs,
-and is reset to default value upon reaching a non-indented paragraph.
-Default units for indents
-.I i
-are ens.
-.PP
-Type font and size are reset to default values
-before each paragraph, and after processing
-font and size setting macros.
-.PP
-These strings are predefined by
-.BR \-man :
-.IP \e*R
-.if t `\*R', `(Reg)' in
-.if t .I nroff.
-.if n `(Reg)', trademark symbol in
-.if n .I troff.
-.IP \e*S
-Change to default type size.
-.SH FILES
-/usr/lib/tmac/tmac.an
-.br
-/usr/man/man0/xx
-.SH SEE ALSO
-troff(1), man(1)
-.SH BUGS
-Relative indents don't nest.
-.SH REQUESTS
-.ta \w'.TH n c x 'u +\w'Cause 'u +\w'Argument\ 'u
-.di xx
-                       \ka
-.br
-.di
-.in \nau
-.ti0
-Request        Cause   If no   Explanation
-.ti0
-       Break   Argument
-.ti0
-.li
-.B \fIt\fR     no      \fIt\fR=n.t.l.* Text
-.I t
-is bold.
-.ti0
-.li
-.BI \fIt\fR    no      \fIt\fR=n.t.l.  Join
-words of
-.I t
-alternating bold and italic.
-.ti0
-.li
-.BR \fIt\fR    no      \fIt\fR=n.t.l.  Join
-words of
-.I t
-alternating bold and Roman.
-.ti0
-.li
-.DT    no      .5i 1i...       Restore default tabs.
-.ti0
-.li
-.HP \fIi\fR    yes     \fIi\fR=p.i.*   Set prevailing indent to
-.I i.
-Begin paragraph with hanging indent.
-.ti0
-.li
-.I \fIt\fR     no      \fIt\fR=n.t.l.  Text
-.I t
-is italic.
-.ti0
-.li
-.IB \fIt\fR    no      \fIt\fR=n.t.l.  Join
-words of
-.I t
-alternating italic and bold.
-.ti0
-.li
-.IP \fIx i\fR  yes     \fIx\fR=""      Same as .TP with tag
-.I x.
-.ti0
-.li
-.IR \fIt\fR    no      \fIt\fR=n.t.l.  Join
-words of
-.I t
-alternating italic and Roman.
-.ti0
-.li
-.LP    yes     -       Same as .PP.
-.ti0
-.li
-.PD \fId\fR    no      \fId\fR=.4v     Interparagraph distance is 
-.I d.
-.ti0
-.li
-.PP    yes     -       Begin paragraph.
-Set prevailing indent to .5i.
-.ti0
-.li
-.RE    yes     -       End of relative indent.
-Set prevailing indent to amount of starting .RS.
-.ti0
-.li
-.RB \fIt\fR    no      \fIt\fR=n.t.l.  Join
-words of
-.I t
-alternating Roman and bold.
-.ti0
-.li
-.RI \fIt\fR    no      \fIt\fR=n.t.l.  Join
-words of
-.I t
-alternating Roman and italic.
-.ti0
-.li
-.RS \fIi\fR    yes     \fIi\fR=p.i.    Start relative indent,
-move left margin in distance
-.I i.
-Set prevailing indent to .5i for nested indents.
-.ti0
-.li
-.SH \fIt\fR    yes     \fIt\fR=n.t.l.  Subhead.
-.ti0
-.li
-.SM \fIt\fR    no      \fIt\fR=n.t.l.  Text
-.I t
-is small.
-.ti0
-.li
-.TH \fIn c x\fR        yes     -       Begin page named
-.I n
-of chapter
-.IR c;
-.I x
-is extra commentary, e.g. `local', for page foot.
-Set prevailing indent and tabs to .5i.
-.ti0
-.li
-.TP \fIi\fR    yes     \fIi\fR=p.i.    Set prevailing indent to
-.I i.
-Begin indented paragraph
-with hanging tag given by next text line.
-If tag doesn't fit, place it on separate line.
-.PP
-.ti0
-* n.t.l. = next text line; p.i. = prevailing indent
diff --git a/.ref-Research-V7/usr/man/man7/ms.7 b/.ref-Research-V7/usr/man/man7/ms.7
deleted file mode 100644 (file)
index dc7511f..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-.hc %
-.TH MS 7 
-.SH NAME
-ms \- macros for formatting manuscripts
-.SH SYNOPSIS
-.B "nroff \-ms"
-[ options ]
-file ... 
-.br
-.B "troff \-ms"
-[ options ]
-file ... 
-.SH DESCRIPTION
-This package of 
-.I nroff
-and
-.I troff
-macro definitions provides a canned formatting
-.li
-facility for tech%nical papers in various formats.
-When producing 2-column output on a terminal, filter
-the output through
-.IR  col (1).
-.PP
-The macro requests are defined below.
-Many
-.I nroff
-and
-.I troff
-requests are unsafe in conjunction with
-this package, however these requests may be used with
-impunity after the first .PP:
-.IP
-.ta \w'.sp n 'u
-.li
-.bp    begin new page
-.nf
-.li
-.br    break output line here
-.li
-.sp n  insert n spacing lines
-.li
-.ls n  (line spacing) n=1 single, n=2 double space
-.li
-.na    no alignment of right margin
-.fi
-.PP
-Output of the
-.I eqn,
-.I neqn,
-.I refer,
-and
-.IR  tbl (1)
-preprocessors
-for equations and tables is acceptable as input.
-.SH FILES
-/usr/lib/tmac/tmac.s
-.SH "SEE ALSO"
-eqn(1), troff(1), refer(1), tbl(1)
-.tr &.
-.SH REQUESTS 
-.ta \w'..ND \fIdate\fR 'u +\w'Initial 'u +\w'Cause 'u
-.br
-.di x
-                       \ka
-.br
-.di
-.in \nau
-.ti0
-Request        Initial Cause   Explanation
-.ti0
-       Value   Break
-.br
-.in \nau
-.ti0
-.li
-.1C    yes     yes     One column format on a new page.
-.ti0
-.li
-.2C    no      yes     Two column format.
-.ti0
-.li
-.AB    no      yes     Begin abstract.
-.ti0
-.li
-.AE    -       yes     End abstract.
-.ti0
-.li
-.AI    no      yes     Author's institution follows.
-Suppressed in TM.
-.ti0
-.li
-.AT    no      yes     Print `\ 1Attached' and turn off line filling.
-.ti0
-.li
-.AU \fIx y\fR  no      yes     Author's name follows.
-.IR x " is location and " "y\fR is"
-extension, ignored except in TM.
-.ti0
-.li
-.B \fIx\fR     no      no      Print \fIx\fR in boldface; if no argument switch to boldface.
-.ti 0
-.li
-.B1    no      yes     Begin text to be enclosed in a box.
-.ti0
-.li
-.B2    no      yes     End text to be boxed & print it.
-.ti0
-.li
-.BT    date    no      Bottom title, automatically invoked at
-foot of page.
-May be redefined.
-.ti0
-.li
-.BX \fIx\fR    no      no      Print \fIx\fR in a box.
-.ti0
-.li
-.CS \fIx...\fR -       yes     Cover sheet info if
-TM format, suppressed otherwise.
-Arguments are number of text pages,
-other pages, total pages, figures, tables, references.
-.ti0
-.li
-.CT    no      yes     Print `Copies to' and enter no-fill mode.
-.ti0
-.li
-.DA \fIx\fR    nroff   no      `Date line' at bottom of page
-is
-.IR x .
-Default is today.
-.ti0
-.li
-.DE    -       yes     End displayed text.
-Implies .KE.
-.ti0
-.li
-.DS \fIx\fR    no      yes     Start of displayed text,
-to appear verbatim line-by-line.
-.IR x "=I for indented display (default),"
-.IR x "=L for left-justified on the page,"
-.IR x "=C for centered,"
-.IR x "=B for make left-justified block, then center whole block."
-Implies .KS.
-.ti0
-.li
-.EG    no      -       Print document in BTL format for `Engineer's Notes.'  Must be first.
-.ti0
-.li
-.EN    -       yes     Space after equation
-produced by
-.I eqn
-or
-.IR neqn .
-.ti0
-.li
-.EQ \fIx y\fR  -       yes     Precede equation; break out and
-add space.
-Equation number is
-.IR y .
-The optional argument \fIx\fR
-may be
-.I I
-to indent equation (default),
-.I L
-to left-adjust the equation, or
-.I C
-to center the equation.
-.ti0
-.li
-.FE    -       yes     End footnote.
-.ti0
-.li
-.FS    no      no      Start footnote.
-The note will be moved to the bottom of the page.
-.ti0
-.li
-.HO    -       no      `Bell Laboratories, Holmdel,
-New Jersey 07733'.
-.ti0
-.li
-.I \fIx\fR     no      no      Italicize \fIx\fR;
-if \fIx\fR missing, italic text follows.
-.ti0
-.li
-.IH    no      no      `Bell Laboratories, Naperville, Illinois 60540'
-.ti0
-.li
-.IM    no      no      Print document in BTL format for an internal memorandum.  Must be first.
-.ti0
-.li
-.IP \fIx y\fR  no      yes     Start indented paragraph,
-with hanging tag
-.IR x .
-Indentation is
-.IR y ""
-ens (default 5).
-.ti0
-.li
-.KE    -       yes     End keep.
-Put kept text on next page if not enough room.
-.ti0
-.li
-.KF    no      yes     Start floating keep.
-If the kept text must be moved to the next page,
-float later text back to this page.
-.ti0
-.li
-.KS    no      yes     Start keeping following text.
-.ti0
-.li
-.LG    no      no      Make letters larger.
-.ti0
-.li
-.LP    yes     yes     Start left-blocked paragraph.
-.ti0
-.li
-.MF    -       -       Print document in BTL format for `Memorandum for File.'  Must be first.
-.ti0
-.li
-.MH    -       no      `Bell Laboratories, Murray Hill,
-New Jersey 07974'.
-.ti0
-.li
-.MR    -       -       Print document in BTL format for `Memorandum for Record.'  Must be first.
-.ti0
-.li
-.ND \fIdate\fR troff   no      Use date supplied (if any) only in
-special BTL format positions; omit from page footer.
-.ti0
-.li
-.NH \fIn\fR    -       yes     Same as .SH, with section
-number supplied automatically.
-Numbers are multilevel, like 1.2.3,
-where
-.IR n ""
-tells what level is wanted (default is 1).
-.ti0
-.li
-.NL    yes     no      Make letters normal size.
-.ti0
-.li
-.OK    -       yes     `Other keywords' for TM cover
-sheet follow.
-.ti0
-.li
-.PP    no      yes     Begin paragraph.
-First line indented.
-.ti0
-.li
-.PT    pg #    -       Page title, automatically invoked at
-top of page.
-May be redefined.
-.ti0
-.li
-.PY    -       no      `Bell Laboratories, Piscataway, New Jersey 08854'
-.ti0
-.li
-.QE    -       yes     End quoted (indented and shorter) material.
-.ti0
-.li
-.QP    -       yes     Begin single paragraph which is indented and shorter.
-.ti0
-.li
-.QS    -       yes     Begin quoted (indented and shorter) material.
-.ti0
-.li
-.R     yes     no      Roman text follows.
-.ti0
-.li
-.RE    -       yes     End relative indent level.
-.ti0
-.li
-.RP    no      -       Cover sheet and first page for released
-paper.
-Must precede other requests.
-.ti0
-.li
-.RS    -       yes     Start level of relative indentation.
-Following .IP's are measured from current indentation.
-.ti0
-.li
-.SG \fIx\fR    no      yes     Insert signature(s) of author(s),
-ignored except in TM.
-.IR x " is the reference line (initials of author and typist)."
-.ti0
-.li
-.SH    -       yes     Section head follows,
-font automatically bold.
-.ti0
-.li
-.SM    no      no      Make letters smaller.
-.ti0
-.li
-.TA \fIx\fR... 5...    no      Set tabs in ens.
-Default is 5 10 15 ...
-.ti0
-.li
-.TE    -       yes     End table.
-.ti0
-.li
-.TH    -       yes     End heading section of table.
-.ti0
-.li
-.TL    no      yes     Title follows.
-.ti0
-.li
-.TM \fIx\fR... no      -       Print document in BTL technical memorandum format.
-Arguments are TM number, (quoted list of) case number(s), and file number.
-Must precede other requests.
-.ti0
-.li
-.TR \fIx\fR    -       -       Print in BTL technical report format; report number is \fIx\fR.  Must be first.
-.ti0
-.li
-.TS \fIx\fR    -       yes     Begin table; if \fIx\fR is
-.I H
-table has repeated heading.
-.ti0
-.li
-.UL \fIx\fR    -       no      Underline argument (even in troff).
-.ti0
-.li
-.UX    -       no      `UNIX'; first time used, add footnote `UNIX is a trademark of
-Bell Laboratories.'
-.ti0
-.li
-.WH    -       no      `Bell Laboratories, Whippany,
-New Jersey 07981'.
diff --git a/.ref-Research-V7/usr/man/man7/term.7 b/.ref-Research-V7/usr/man/man7/term.7
deleted file mode 100644 (file)
index 16fb12f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-.TH TERM 7 
-.SH NAME
-terminals\- conventional names
-.SH DESCRIPTION
-These names
-are used by certain commands and are maintained 
-as part of the shell environment
-(see
-.IR sh (1), environ (5)).
-.LP
-.nf
-.ta \w'450\-12\-8  'u
-1620   DIABLO 1620 (and others using HyType II)
-1620\-12       same, in 12-pitch mode
-300    DASI/DTC/GSI 300 (and others using HyType I)
-300\-12        same, in 12-pitch mode
-300s   DASI/DTC 300/S
-300s\-12       same, in 12-pitch mode
-33     TELETYPE\*R Model 33
-37     TELETYPE Model 37
-40\-2  TELETYPE Model 40/2
-43     TELETYPE Model 43
-450    DASI 450 (same as Diablo 1620)
-450\-12        same, in 12-pitch mode
-450\-12\-8     same, in 12-pitch, 8 lines/inch mode
-735    Texas Instruments TI735 (and TI725)
-745    Texas Instruments TI745
-dumb   terminals with no special features
-hp     Hewlett-Packard HP264? series terminals
-4014   Tektronix 4014
-tn1200 General Electric TermiNet 1200
-tn300  General Electric TermiNet 300
-vt05   Digital Equipment Corp. VT05
-.fi
-.PP
-Commands whose behavior may depend on the terminal
-accept arguments of the form
-.BR \-Tterm,
-where
-.I term
-is one of the names given above.
-If no such argument is present,
-a command may consult the shell environment
-for the terminal type.
-.SH SEE ALSO
-stty(1), tabs(1), plot(1),
-sh(1), environ(5)
-.br
-troff(1) for
-.I nroff
-.SH BUGS
-The programs that ought to adhere to this nomenclature
-do so only fitfully.
diff --git a/.ref-Research-V7/usr/man/man8/boot.8 b/.ref-Research-V7/usr/man/man8/boot.8
deleted file mode 100644 (file)
index d04d772..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-.TH BOOT 8
-.SH NAME
-boot \- startup procedures
-.SH DESCRIPTION
-A PDP11/45 and PDP11/70 UNIX system is started by
-a two-stage process.
-The first is a primary bootstrap
-which is able to read in relatively small stand-alone programs;
-the second (called
-.IR boot )
-is used to read in the system itself.
-.PP
-The primary bootstrap must reside
-in the otherwise unused block zero of the boot device.
-It can be read in and started by the standard ROM
-programs,
-or if necessary by keying in a small startup routine.
-This program is capable of loading type 407 executable
-files (not shared, not separate I&D).
-The user types on the system console
-the name of the program wished, in this case
-.IR boot ,
-followed by a carriage return;
-the named program is retrieved from the file system
-that starts at block 0 of drive 0 of the boot device.
-No prompt is given,
-no diagnostic results if the file cannot be found, and no
-provision is made for correcting typographical errors.
-.PP
-The second step, called
-.I boot,
-actually brings in the system.
-When read into location 0 and executed,
-.I boot
-sets up memory management, relocates itself into
-high memory, and types a `:' on the console.
-Then it
-reads from the console
-a device specification (see below) followed immediately by
-a pathname.
-.I Boot
-finds the corresponding file on the given device,
-loads that file into memory location zero,
-sets up memory management as required,
-and calls the program by executing a `trap' instruction.
-Normal
-line editing characters can be used.
-.PP
-Conventionally, the name of the secondary boot program
-is `/boot' and the name of the current version of the system
-is `/unix'.
-Then, the recipe is:
-.TP
-1)
-Load block 0 of the boot device by fiddling with the
-console keys as appropriate for your hardware.
-If you have no appropriate ROM, some programs suitable
-for manual use are given below.
-.TP
-2)
-Type
-.IR boot .
-.TP
-3)
-When the prompt is given, type
-.br
-       hp(0,0)unix
-.br
-or
-.br
-       rp(0,0)unix
-.br
-depending on whether you are loading from an RP04/5/6 or an RP03
-respectively.
-The first 0 indicates the physical unit number;
-the second indicates
-the block number of the beginning of the logical file
-system to be searched.
-(See below).
-.PP
-When the system is running, it types a `#' prompt.
-After doing any file system checks and setting the date
-.RI ( date (8))
-a multi-user system is brought up by typing an EOT
-(control-d)
-in response to the `#' prompt.
-.PP
-.B Device specifications.
-A device specification has the following form:
-.IP " "
-device(unit,offset)
-.LP
-where
-.I device
-is the type of the device to be searched,
-.I unit
-is the unit number of the device,
-and 
-.I offset
-is the block offset of the file system on the device.
-.I Device
-is one of the following
-.br
-.nf
-       rp      RP03
-       hp      RP04/5/6
-       rk      RK05
-.fi
-For example, the specification
-.IP " "
-hp(1,7000)
-.LP
-indicates an RP03 disk, unit 1, and the file system found
-starting at block 7000 (cylinder 35).
-.PP
-.SM
-.B ROM
-.B programs.
-The following programs to call the primary bootstrap
-may be installed in read-only memories
-or manually keyed into main 
-memory.
-Each program is position-independent
-but should be placed well above location 0
-so it will not be overwritten.
-Each reads a block from the
-beginning of a device into core location
-zero.
-The octal words constituting the program are
-listed on the left.
-.PP
-.ne 5
-.nf
-.if n .ta 3 11 15 23 38
-.if t .ta .3i 1i 1.4i 2i 3.5i
-RK (drive 0):
-       012700          mov     $rkda,r0
-       177412
-       005040          clr     \-(r0)  / rkda cleared by start
-       010040          mov     r0,\-(r0)
-       012740          mov     $5,\-(r0)
-       000005
-       105710  1:      tstb    (r0)
-       002376          bge     1b
-       005007          clr     pc
-.PP
-.ne 11
-RP (drive 0)
-       012700          mov     $rpmr,r0
-       176726
-       005040          clr     \-(r0)
-       005040          clr     \-(r0)
-       005040          clr     \-(r0)
-       010040          mov     r0,\-(r0)
-       012740          mov     $5,\-(r0)
-       000005
-       105710  1:      tstb    (r0)
-       002376          bge     1b
-       005007          clr     pc
-.DT
-.SH FILES
-/unix \- system code
-.br
-/usr/mdec/rpuboot, /usr/mdec/hpuboot \- copies of primary bootstrap
-.br
-/boot \- second stage bootstrap
-.SH "SEE ALSO"
-init(8)
diff --git a/.ref-Research-V7/usr/man/man8/crash.8 b/.ref-Research-V7/usr/man/man8/crash.8
deleted file mode 100644 (file)
index 8919446..0000000
+++ /dev/null
@@ -1,343 +0,0 @@
-.TH CRASH 8 
-.SH NAME
-crash \- what to do when the system crashes
-.SH DESCRIPTION
-This section gives at least a few clues about how to proceed if the
-system crashes.
-It can't pretend to be complete.
-.PP
-.I Bringing it back up.
-If the reason for the crash is not evident
-(see below for guidance on `evident')
-you may want to try to dump the system if you feel up to
-debugging.
-At the moment a dump can be taken only on magtape.
-With a tape mounted and ready,
-stop the machine, load address 44, and start.
-This should write a copy of all of core
-on the tape with an EOF mark.
-Caution:
-Any error is taken to mean the end of core has been reached.
-This means that you must be sure the ring is in,
-the tape is ready, and the tape is clean and new.
-If the dump fails, you can try again,
-but some of the registers will be lost.
-See below for what to do with the tape.
-.PP
-In restarting after a crash,
-always bring up the system single-user.
-This is accomplished by following the directions in
-.IR boot (8)
-as modified for your particular installation;
-a single-user system is indicated by having a particular value
-in the switches (173030 unless you've changed
-.I init)
-as the system starts executing.
-When it is running,
-perform a
-.I dcheck
-and
-.IR  icheck (1)
-on all file systems which could have been in use at the time
-of the crash.
-If any serious file system problems are found, they should be repaired.
-When you are satisfied with the health of your disks,
-check and set the date if necessary,
-then come up multi-user.
-This is most easily accomplished by changing the
-single-user value in the switches to something else,
-then logging out
-by typing an EOT.
-.PP
-To even boot \s8UNIX\s10 at all,
-three files (and the directories leading to them)
-must be intact.
-First,
-the initialization program
-.I /etc/init
-must be present and executable.
-If it is not,
-the CPU will loop in user mode at location 6.
-For
-.I init
-to work correctly,
-.I /dev/tty8
-and
-.I /bin/sh
-must be present.
-If either does not exist,
-the symptom is best described
-as thrashing.
-.I Init
-will go into a
-.I fork/exec
-loop trying to create a
-Shell with proper standard input and output.
-.PP
-If you cannot get the system to boot,
-a runnable system must be obtained from
-a backup medium.
-The root file system may then be doctored as
-a mounted file system as described below.
-If there are any problems with the root
-file system,
-it is probably prudent to go to a
-backup system to avoid working on a
-mounted file system.
-.PP
-.I Repairing disks.
-The first rule to keep in mind is that an addled disk
-should be treated gently;
-it shouldn't be mounted unless necessary,
-and if it is very valuable yet
-in quite bad shape, perhaps it should be dumped before
-trying surgery on it.
-This is an area where experience and informed courage count for much.
-.PP
-The problems reported by
-.I icheck
-typically fall into two kinds.
-There can be
-problems with the free list:
-duplicates in the free list, or free blocks also in files.
-These can be cured easily with an
-.I icheck \-s.
-If the same block appears in more than one file
-or if a file contains bad blocks,
-the files should be deleted, and the free list reconstructed.
-The best way to delete such a file is to use
-.IR  clri (1),
-then remove its directory entries.
-If any of the affected files is really precious,
-you can try to copy it to another device
-first.
-.PP
-.I Dcheck
-may report files which
-have more directory entries than links.
-Such situations are potentially dangerous;
-.I clri
-discusses a special case of the problem.
-All the directory entries for the file should be removed.
-If on the other hand there are more links than directory entries,
-there is no danger of spreading infection, but merely some disk space
-that is lost for use.
-It is sufficient to copy the file (if it has any entries and is useful)
-then use
-.I clri
-on its inode and remove any directory
-entries that do exist.
-.PP
-Finally,
-there may be inodes reported by
-.I dcheck
-that have 0 links and 0 entries.
-These occur on the root device when the system is stopped
-with pipes open, and on other file systems when the system
-stops with files that have been deleted while still open.
-A
-.I clri
-will free the inode, and an
-.I icheck -s
-will
-recover any missing blocks.
-.PP
-.I Why did it crash?
-UNIX types a message
-on the console typewriter when it voluntarily crashes.
-Here is the current list of such messages,
-with enough information to provide
-a hope at least of the remedy.
-The message has the form `panic: ...',
-possibly accompanied by other information.
-Left unstated in all cases
-is the possibility that hardware or software
-error produced the message in some unexpected way.
-.HP 5
-blkdev
-.br
-The
-.I getblk
-routine was called with a nonexistent major device as argument.
-Definitely hardware or software error.
-.HP 5
-devtab
-.br
-Null device table entry for the major device used as argument to
-.I getblk.
-Definitely hardware or software error.
-.HP 5
-iinit
-.br
-An I/O error reading the super-block for the root file system
-during initialization.
-.HP 5
-out of inodes
-.br
-A mounted file system has no more i-nodes when creating a file.
-Sorry, the device isn't available;
-the
-.I icheck
-should tell you.
-.HP 5
-no fs
-.br
-A device has disappeared from the mounted-device table.
-Definitely hardware or software error.
-.HP 5
-no imt
-.br
-Like `no fs', but produced elsewhere.
-.HP 5
-no inodes
-.br
-The in-core inode table is full.
-Try increasing NINODE in param.h.
-Shouldn't be a panic, just a user error.
-.HP 5
-no clock
-.br
-During initialization,
-neither the line nor programmable clock was found to exist.
-.HP 5
-swap error
-.br
-An unrecoverable I/O error during a swap.
-Really shouldn't be a panic,
-but it is hard to fix.
-.HP 5
-unlink \- iget
-.br
-The directory containing a file being deleted can't be found.
-Hardware or software.
-.HP 5
-out of swap space
-.br
-A program needs to be swapped out, and there is no more swap space.
-It has to be increased.
-This really shouldn't be a panic, but there is no easy fix.
-.HP 5
-out of text
-.br
-A pure procedure program is being executed,
-and the table for such things is full.
-This shouldn't be a panic.
-.HP 5
-trap
-.br
-An unexpected trap has occurred within the system.
-This is accompanied by three numbers:
-a `ka6', which is the contents of the segmentation
-register for the area in which the system's stack is kept;
-`aps', which is the location where the hardware stored
-the program status word during the trap;
-and a `trap type' which encodes
-which trap occurred.
-The trap types are:
-.TP 10
-0
-bus error
-.br
-.ns
-.TP 10
-1
-illegal instruction
-.br
-.ns
-.TP 10
-2
-BPT/trace
-.br
-.ns
-.TP 10
-3
-IOT
-.br
-.ns
-.TP 10
-4
-power fail
-.br
-.ns
-.TP 10
-5
-EMT
-.br
-.ns
-.TP 10
-6
-recursive system call (TRAP instruction)
-.br
-.ns
-.TP 10
-7
-11/70 cache parity, or programmed interrupt
-.br
-.ns
-.TP 10
-10
-floating point trap
-.br
-.ns
-.TP 10
-11
-segmentation violation
-.PP
-In some of these cases it is
-possible for octal 20 to be added into the trap type;
-this indicates that the processor was in user mode when the trap occurred.
-If you wish to examine the stack after such a trap,
-either dump the system, or use the console switches to examine core;
-the required address mapping is described below.
-.PP
-.I Interpreting dumps.
-All file system problems
-should be taken care of before attempting to look at dumps.
-The dump should be read into the file
-.I /usr/sys/core;
-.IR  cp (1)
-will do.
-At this point, you should execute
-.I ps \-alxk
-and
-.I who
-to print the process table and the users who were on
-at the time of the crash.
-You should dump (
-.IR  od (1))
-the first 30 bytes of
-.I /usr/sys/core.
-Starting at location 4,
-the registers R0, R1, R2, R3, R4, R5, SP
-and KDSA6 (KISA6 for 11/40s) are stored.
-If the dump had to be restarted,
-R0 will not be correct.
-Next, take the value of KA6 (location 022(8) in the dump)
-multiplied by 0100(8) and dump 01000(8) bytes starting from there.
-This is the per-process data associated with the process running
-at the time of the crash.
-Relabel
-the addresses 140000 to 141776.
-R5 is C's frame or display pointer.
-Stored at (R5) is the old R5 pointing to the previous
-stack frame.
-At (R5)+2
-is the saved PC of the calling procedure.
-Trace
-this calling chain until
-you obtain an R5 value of 141756, which
-is where the user's R5 is stored.
-If the chain is broken,
-you have to look for a plausible
-R5, PC pair and continue from there.
-Each PC should be looked up in the system's name list
-using
-.IR  adb (1)
-and its `:' command,
-to get a reverse calling order.
-In most cases this procedure will give
-an idea of what is wrong.
-A more complete discussion
-of system debugging is impossible here.
-.SH SEE ALSO
-clri(1), icheck(1), dcheck(1), boot(8)
diff --git a/.ref-Research-V7/usr/man/man8/cron.8 b/.ref-Research-V7/usr/man/man8/cron.8
deleted file mode 100644 (file)
index 3411d60..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-.TH CRON 8 
-.SH NAME
-cron \- clock daemon
-.SH SYNOPSIS
-.B /etc/cron
-.SH DESCRIPTION
-.I Cron
-executes commands at specified dates and times
-according to the instructions in the file
-/usr/lib/crontab.
-Since
-.I cron
-never exits,
-it should only be executed once.
-This is best done by running
-.I cron
-from the initialization
-process through the file
-/etc/rc;
-see
-.IR init (8).
-.PP
-Crontab
-consists of lines of six fields each.
-The fields are separated by spaces or tabs.
-The first five are integer patterns to
-specify the
-minute (0-59),
-hour (0-23),
-day of the month (1-31),
-month of the year (1-12),
-and day of the week (1-7 with 1=monday).
-Each of these patterns may
-contain a number in the range above;
-two numbers separated by
-a minus
-meaning a range inclusive;
-a list of numbers separated by
-commas meaning any of the numbers;
-or an asterisk meaning all legal values.
-The sixth field is a string
-that is executed by the Shell at the
-specified times.
-A percent character
-in this field is translated to a new-line
-character.
-Only the first line (up to a % or end of line)
-of the command field is executed by the Shell.
-The other lines are made available to the
-command as standard input.
-.PP
-Crontab is examined by
-.I cron
-every minute.
-.SH FILES
-/usr/lib/crontab
diff --git a/.ref-Research-V7/usr/man/man8/getty.8 b/.ref-Research-V7/usr/man/man8/getty.8
deleted file mode 100644 (file)
index 67955ef..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-.TH GETTY 8 
-.SH NAME
-getty  \- set typewriter mode
-.SH SYNOPSIS
-.B /etc/getty
-[ char ]
-.SH DESCRIPTION
-.I Getty
-is invoked
-by
-.IR  init (8)
-immediately after a typewriter is opened
-following a dial-up.
-It reads the user's login name and calls
-.IR login (1)
-with the name as argument.
-While reading the name
-.I getty
-attempts to adapt the system to the speed and type of terminal
-being used.
-.PP
-.I Init
-calls
-.I getty
-with a single character argument taken from
-the
-.IR ttys (5)
-file entry for the terminal line.
-This argument determines a sequence of line speeds through which
-.I getty
-cycles, and also the `login:' greeting message,
-which can contain character sequences to put various kinds of
-terminals in useful states.
-.PP
-The user's name is terminated by a new-line or
-carriage-return character.
-In the second case CRMOD mode is set
-(see
-.IR  ioctl (2)).
-.PP
-The name is scanned to see if
-it contains any lower-case alphabetic characters; if not,
-and if the name is nonempty, the
-system is told to map any future upper-case characters
-into the corresponding lower-case characters.
-.PP
-If the terminal's `break' key is depressed,
-.I getty
-cycles to the next speed appropriate to the type of line
-and prints the greeting message again.
-.PP
-Finally, login is called with the user's name as argument.
-.PP
-The following arguments from the
-.I ttys
-file are understood.
-.TP
-0
-Cycles through 300-1200-150-110 baud.
-Useful as a default for dialup lines accessed by a variety
-of terminals.
-.TP
-\-
-Intended for an on-line Teletype model 33, for example
-an operator's console.
-.TP
-1
-Optimized for a 150-baud Teletype model 37.
-.TP
-2
-Intended for an on-line 9600-baud terminal, for example
-the Textronix 4104.
-.TP
-3
-Starts at 1200 baud, cycles to 300 and back.
-Useful with 212 datasets where most terminals
-run at 1200 speed.
-.TP
-5
-Same as `3' but starts at 300.
-.TP
-4
-Useful for on-line console DECwriter (LA36).
-.SH "SEE ALSO"
-init(8), login(1), ioctl(2), ttys(5)
diff --git a/.ref-Research-V7/usr/man/man8/init.8 b/.ref-Research-V7/usr/man/man8/init.8
deleted file mode 100644 (file)
index 3caae5e..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-.TH INIT 8 
-.SH NAME
-init, rc  \-  process control initialization
-.SH SYNOPSIS
-.B /etc/init
-.br
-.B /etc/rc
-.SH DESCRIPTION
-.I Init
-is invoked as the last step of the boot procedure (see
-.IR boot (8)).
-Generally its role is to create a process for each
-typewriter on which a user may log in.
-.PP
-When
-.I init
-first is executed
-the console typewriter
-.I /dev/console.
-is opened for reading
-and writing and the shell is invoked immediately.
-This feature is used to bring up a single-user system.
-If the shell terminates,
-.I init
-comes up multi-user and the process described below is started.
-.PP
-When
-.I init
-comes up multiuser,
-it
-invokes a shell, with input taken from the
-file
-.I /etc/rc.
-This command file
-performs housekeeping
-like removing temporary files,
-mounting file systems, and starting
-daemons.
-.PP
-Then
-.I init
-reads the file
-.I /etc/ttys
-and
-forks several times to create a process
-for each typewriter specified in the file.
-Each of these processes opens the appropriate typewriter
-for reading and writing.  These channels thus
-receive file descriptors 0, 1 and 2, the standard input,
-output and error files.
-Opening the typewriter will usually involve a delay,
-since the
-.IR open ""
-is not completed until someone
-is dialed up and carrier established on the channel.
-Then
-.I /etc/getty
-is called with argument as specified by the last character of
-the
-.I ttys
-file line.
-.I Getty
-reads the user's name and invokes
-.IR login (1)
-to log in the user and execute the shell.
-.PP
-Ultimately the shell will terminate
-because of an end-of-file either
-typed explicitly or generated as a result of hanging up.
-The main path of
-.IR init ,
-which has been waiting
-for such an event,
-wakes up and removes the appropriate entry from the
-file
-.IR utmp ,
-which records current users, and
-makes an entry in
-.IR /usr/adm/wtmp ,
-which maintains a history
-of logins and logouts.
-Then the appropriate typewriter is reopened and
-.I getty
-is
-reinvoked.
-.PP
-.I Init
-catches the
-hangup signal SIGHUP and interprets it to mean that
-the
-system should be brought from multi user to single
-user.
-Use `kill -1 1' to send the hangup signal.
-.SH FILES
-/dev/tty?, /etc/utmp, /usr/adm/wtmp, /etc/ttys, /etc/rc
-.SH "SEE ALSO"
-login(1), kill(1), sh(1), ttys(5), getty(8)
diff --git a/.ref-Research-V7/usr/man/man8/lpd.8 b/.ref-Research-V7/usr/man/man8/lpd.8
deleted file mode 100644 (file)
index aa6ba76..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-.TH LPD 8 
-.SH NAME
-lpd \- line printer daemon
-.SH SYNOPSIS
-.B /etc/lpd
-.SH DESCRIPTION
-.I Lpd
-is the daemon for the line printer.
-.I Lpd
-uses the directory
-.IR /usr/spool/lpd .
-The file
-.I lock
-in that directory is used
-to prevent two daemons from becoming active.
-After the program has successfully set the lock,
-it forks and the main path exits, thus
-spawning the daemon.
-The directory is scanned for files
-beginning with
-.B df.
-Each such file is submitted as a job.
-Each line of a job file must begin with a key
-character to specify what to do with the remainder
-of the line.
-.TP 5
-.B  L
-specifies that the remainder of the line is to
-be sent as a literal.
-.TP 5
-.B  B
-specifies that the rest of the line
-is a file name.
-.TP 5
-.B  F
-is the same as
-.B B
-except a form feed is prepended to the file.
-.TP 5
-.B  U
-specifies that the rest of the line
-is a file name.
-After the job has been transmitted,
-the file is unlinked.
-.TP 5
-.B  M
-is followed by a user ID; after the job is sent,
-a message is
-mailed to the user via the
-.IR mail (1)
-command
-to verify the sending of the job.
-.PP
-Any error encountered will cause the daemon to
-wait and start over.
-This means that an improperly constructed
-.B df
-file may cause the same job to be submitted
-repeatedly.
-.PP
-.I Lpd
-is automatically initiated by the line printer command,
-.I lpr.
-.PP
-.PP
-To restart
-.I lpd
-(in the case of hardware or software malfunction),
-it is necessary to first kill the old
-daemon
-(if still alive),
-and remove the lock file
-before initiating
-the new daemon.
-This is done automatically when the system is brought up,
-by
-.I /etc/rc,
-in case there were any jobs left in the spooling directory
-when the system last went down.
-.SH FILES
-/usr/spool/lpd/*
-spool area for line printer daemon
-.br
-/etc/passwd
-to get the user's name
-.br
-/dev/lp
-line printer device
-.SH "SEE ALSO"
-lpr(1)
diff --git a/.ref-Research-V7/usr/man/man8/makekey.8 b/.ref-Research-V7/usr/man/man8/makekey.8
deleted file mode 100644 (file)
index 39f96a7..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-.TH MAKEKEY 8 
-.SH NAME
-makekey \- generate encryption key
-.SH SYNOPSIS
-.B /usr/lib/makekey
-.SH DESCRIPTION
-.I Makekey
-improves the usefulness of encryption schemes
-depending on a key by increasing the amount of time required to
-search the key space.
-It reads 10 bytes from its standard input,
-and writes 13 bytes on its standard output.
-The output depends on the input in a way intended
-to be difficult to compute (i.e. to require a substantial
-fraction of a second).
-.PP
-The first eight input bytes
-(the
-.IR "input key" )
-can be arbitrary ASCII characters.
-The last 
-two (the
-.IR salt )
-are best chosen from the set of digits, upper- and lower-case
-letters, and `.' and `/'.
-The salt characters are repeated as the first two characters of the output.
-The remaining 11 output characters are chosen from the same set as the salt
-and constitute the
-.I "output key."
-.PP
-The transformation performed is essentially the following:
-the salt is used to select one of 4096 cryptographic
-machines all based on the National Bureau of Standards
-DES algorithm, but modified in 4096 different ways.
-Using the input key as key,
-a constant string is fed into the machine and recirculated
-a number of times.
-The 64 bits that come out are distributed into the
-66 useful key bits in the result.
-.PP
-.I Makekey
-is intended for programs that perform encryption
-(e.g.
-.I ed
-and
-.IR crypt (1)).
-Usually its input and output will be pipes.
-.SH SEE ALSO
-crypt(1), ed(1)
diff --git a/.ref-Research-V7/usr/man/man8/update.8 b/.ref-Research-V7/usr/man/man8/update.8
deleted file mode 100644 (file)
index 0940221..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.TH UPDATE 8 
-.SH NAME
-update \- periodically update the super block
-.SH SYNOPSIS
-.B /etc/update
-.SH DESCRIPTION
-.I Update
-is a program that executes
-the
-.IR sync (2)
-primitive every 30 seconds.
-This insures that the file system
-is fairly up to date in case of a crash.
-This command should not be executed directly,
-but should be executed out of the
-initialization shell command file.
-.SH "SEE ALSO"
-sync(2), sync(1), init(8)
-.SH BUGS
-With
-.I update
-running,
-if the CPU is
-halted just as
-the
-.I sync
-is executed,
-a file system can be damaged.
-This is partially due to DEC hardware that
-writes zeros when NPR requests fail.
-A fix would be to have
-.IR sync (1)
-temporarily increment the system time by at
-least 30 seconds to trigger the execution of
-.I update.
-This would give 30 seconds grace to halt the CPU.
diff --git a/.ref-Research-V7/usr/mdec/hpuboot.s b/.ref-Research-V7/usr/mdec/hpuboot.s
deleted file mode 100644 (file)
index 46609bf..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-/ disk boot program to load and transfer
-/ to a unix entry
-
-/ entry is made by jsr pc,*$0
-/ so return can be rts pc
-
-core = 28.
-.. = [core*2048.]-512.
-
-/ establish sp and check if running below
-/ intended origin, if so, copy
-/ program up to 'core' K words.
-start:
-       mov     $..,sp
-       mov     sp,r1
-       cmp     pc,r1
-       bhis    2f
-       clr     r0
-       cmp     (r0),$407
-       bne     1f
-       mov     $20,r0
-1:
-       mov     (r0)+,(r1)+
-       cmp     r1,$end
-       blo     1b
-       jmp     (sp)
-
-/ clear core to make things clean
-2:
-       clr     (r0)+
-       cmp     r0,sp
-       blo     2b
-
-/ at origin, read pathname,
-/ initialize rp
-       mov     $drive,*$hpcs2
-       mov     $preset+go,*$hpcs1
-       mov     $fmt22,*$hpof
-
-/ spread out in array 'names', one
-/ component every 14 bytes.
-       mov     $names,r1
-1:
-       mov     r1,r2
-2:
-       jsr     pc,getc
-       cmp     r0,$'\n
-       beq     1f
-       cmp     r0,$'/
-       beq     3f
-       movb    r0,(r2)+
-       br      2b
-3:
-       cmp     r1,r2
-       beq     2b
-       add     $14.,r1
-       br      1b
-
-/ now start reading the inodes
-/ starting at the root and
-/ going through directories
-1:
-       mov     $names,r1
-       mov     $2,r0
-1:
-       clr     bno
-       jsr     pc,iget
-       tst     (r1)
-       beq     1f
-2:
-       jsr     pc,rmblk
-               br start
-       mov     $buf,r2
-3:
-       mov     r1,r3
-       mov     r2,r4
-       add     $16.,r2
-       tst     (r4)+
-       beq     5f
-4:
-       cmpb    (r3)+,(r4)+
-       bne     5f
-       cmp     r4,r2
-       blo     4b
-       mov     -16.(r2),r0
-       add     $14.,r1
-       br      1b
-5:
-       cmp     r2,$buf+512.
-       blo     3b
-       br      2b
-
-/ read file into core until
-/ a mapping error, (no disk address)
-1:
-       clr     r1
-1:
-       jsr     pc,rmblk
-               br 1f
-       mov     $buf,r2
-2:
-       mov     (r2)+,(r1)+
-       cmp     r2,$buf+512.
-       blo     2b
-       br      1b
-/ relocate core around
-/ assembler header
-1:
-       clr     r0
-       cmp     (r0),$407
-       bne     2f
-1:
-       mov     20(r0),(r0)+
-       cmp     r0,sp
-       blo     1b
-/ enter program and
-/ restart if return
-2:
-       jsr     pc,*$0
-       br      start
-
-/ get the inode specified in r0
-iget:
-       add     $15.,r0
-       mov     r0,r5
-       ash     $-3.,r0
-       bic     $!17777,r0
-       mov     r0,dno
-       clr     r0
-       jsr     pc,rblk
-       bic     $!7,r5
-       ash     $6,r5
-       add     $buf,r5
-       mov     $inod,r4
-1:
-       mov     (r5)+,(r4)+
-       cmp     r4,$inod+64.
-       blo     1b
-       rts     pc
-
-/ read a mapped block
-/ offset in file is in bno.
-/ skip if success, no skip if fail
-/ the algorithm only handles a single
-/ indirect block. that means that
-/ files longer than 10+128 blocks cannot
-/ be loaded.
-rmblk:
-       add     $2,(sp)
-       mov     bno,r0
-       cmp     r0,$10.
-       blt     1f
-       mov     $10.,r0
-1:
-       mov     r0,-(sp)
-       asl     r0
-       add     (sp)+,r0
-       add     $addr+1,r0
-       movb    (r0)+,dno
-       movb    (r0)+,dno+1
-       movb    -3(r0),r0
-       bne     1f
-       tst     dno
-       beq     2f
-1:
-       jsr     pc,rblk
-       mov     bno,r0
-       inc     bno
-       sub     $10.,r0
-       blt     1f
-       ash     $2,r0
-       mov     buf+2(r0),dno
-       mov     buf(r0),r0
-       bne     rblk
-       tst     dno
-       bne     rblk
-2:
-       sub     $2,(sp)
-1:
-       rts     pc
-
-drive  = 0
-cyl    = 0.
-read   = 70
-preset = 20
-go     = 1
-fmt22  = 10000
-
-hpcs1  = 176700
-hpda   = hpcs1+6
-hpcs2  = hpcs1+10
-hpds   = hpcs1+12
-hpof   = hpcs1+32
-hpca   = hpcs1+34
-
-/ rp0456 disk driver.
-/ low order address in dno,
-/ high order in r0.
-rblk:
-       mov     r1,-(sp)
-       mov     dno,r1
-       div     $22.*19.,r0
-       add     $cyl,r0
-       mov     r0,*$hpca
-       clr     r0
-       div     $22.,r0
-       swab    r0
-       bis     r1,r0
-       mov     $hpda,r1
-       mov     r0,(r1)
-       mov     $buf,-(r1)
-       mov     $-256.,-(r1)
-       mov     $read+go,-(r1)
-1:
-       tstb    (r1)
-       bge     1b
-       mov     (sp)+,r1
-       rts     pc
-
-tks = 177560
-tkb = 177562
-/ read and echo a teletype character
-getc:
-       mov     $tks,r0
-       inc     (r0)
-1:
-       tstb    (r0)
-       bge     1b
-       mov     tkb,r0
-       bic     $!177,r0
-       cmp     r0,$'A
-       blo     1f
-       cmp     r0,$'Z
-       bhi     1f
-       add     $'a-'A,r0
-1:
-
-tps = 177564
-tpb = 177566
-/ print a teletype character
-putc:
-       tstb    *$tps
-       bge     putc
-       mov     r0,*$tpb
-       cmp     r0,$'\r
-       bne     1f
-       mov     $'\n,r0
-       br      putc
-1:
-       rts     pc
-
-end:
-inod = ..-1024.
-addr = inod+12.
-buf = inod+64.
-bno = buf+512.
-dno = bno+2
-names = dno+2
-reset = 5
diff --git a/.ref-Research-V7/usr/mdec/makefile b/.ref-Research-V7/usr/mdec/makefile
deleted file mode 100644 (file)
index fe78a87..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-hpuboot:
-       as -o hpuboot hpuboot.s
-       strip rpuboot
-
-rpuboot:
-       as -o rpuboot rpuboot.s
-       strip hpuboot
diff --git a/.ref-Research-V7/usr/mdec/rpuboot.s b/.ref-Research-V7/usr/mdec/rpuboot.s
deleted file mode 100644 (file)
index e9ab92a..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/ disk boot program to load and transfer
-/ to a unix entry
-
-/ entry is made by jsr pc,*$0
-/ so return can be rts pc
-
-core = 28.
-.. = [core*2048.]-512.
-
-/ establish sp and check if running below
-/ intended origin, if so, copy
-/ program up to 'core' K words.
-start:
-       mov     $..,sp
-       mov     sp,r1
-       cmp     pc,r1
-       bhis    2f
-       clr     r0
-       cmp     (r0),$407
-       bne     1f
-       mov     $20,r0
-1:
-       mov     (r0)+,(r1)+
-       cmp     r1,$end
-       blo     1b
-       jmp     (sp)
-
-/ clear core to make things clean
-2:
-       clr     (r0)+
-       cmp     r0,sp
-       blo     2b
-
-/ at origin, read pathname,
-/ initialize rp
-
-       clr     *$rpcs          / selects drive zero
-/ spread out in array 'names', one
-/ component every 14 bytes.
-       mov     $names,r1
-1:
-       mov     r1,r2
-2:
-       jsr     pc,getc
-       cmp     r0,$'\n
-       beq     1f
-       cmp     r0,$'/
-       beq     3f
-       movb    r0,(r2)+
-       br      2b
-3:
-       cmp     r1,r2
-       beq     2b
-       add     $14.,r1
-       br      1b
-
-/ now start reading the inodes
-/ starting at the root and
-/ going through directories
-1:
-       mov     $names,r1
-       mov     $2,r0
-1:
-       clr     bno
-       jsr     pc,iget
-       tst     (r1)
-       beq     1f
-2:
-       jsr     pc,rmblk
-               br start
-       mov     $buf,r2
-3:
-       mov     r1,r3
-       mov     r2,r4
-       add     $16.,r2
-       tst     (r4)+
-       beq     5f
-4:
-       cmpb    (r3)+,(r4)+
-       bne     5f
-       cmp     r4,r2
-       blo     4b
-       mov     -16.(r2),r0
-       add     $14.,r1
-       br      1b
-5:
-       cmp     r2,$buf+512.
-       blo     3b
-       br      2b
-
-/ read file into core until
-/ a mapping error, (no disk address)
-1:
-       clr     r1
-1:
-       jsr     pc,rmblk
-               br 1f
-       mov     $buf,r2
-2:
-       mov     (r2)+,(r1)+
-       cmp     r2,$buf+512.
-       blo     2b
-       br      1b
-/ relocate core around
-/ assembler header
-1:
-       clr     r0
-       cmp     (r0),$407
-       bne     2f
-1:
-       mov     20(r0),(r0)+
-       cmp     r0,sp
-       blo     1b
-/ enter program and
-/ restart if return
-2:
-       jsr     pc,*$0
-       br      start
-
-/ get the inode specified in r0
-iget:
-       add     $15.,r0
-       mov     r0,r5
-       ash     $-3.,r0
-       bic     $!17777,r0
-       mov     r0,dno
-       clr     r0
-       jsr     pc,rblk
-       bic     $!7,r5
-       ash     $6,r5
-       add     $buf,r5
-       mov     $inod,r4
-1:
-       mov     (r5)+,(r4)+
-       cmp     r4,$inod+64.
-       blo     1b
-       rts     pc
-
-/ read a mapped block
-/ offset in file is in bno.
-/ skip if success, no skip if fail
-/ the algorithm only handles a single
-/ indirect block. that means that
-/ files longer than 10+128 blocks cannot
-/ be loaded.
-rmblk:
-       add     $2,(sp)
-       mov     bno,r0
-       cmp     r0,$10.
-       blt     1f
-       mov     $10.,r0
-1:
-       mov     r0,-(sp)
-       asl     r0
-       add     (sp)+,r0
-       add     $addr+1,r0
-       movb    (r0)+,dno
-       movb    (r0)+,dno+1
-       movb    -3(r0),r0
-       bne     1f
-       tst     dno
-       beq     2f
-1:
-       jsr     pc,rblk
-       mov     bno,r0
-       inc     bno
-       sub     $10.,r0
-       blt     1f
-       ash     $2,r0
-       mov     buf+2(r0),dno
-       mov     buf(r0),r0
-       bne     rblk
-       tst     dno
-       bne     rblk
-2:
-       sub     $2,(sp)
-1:
-       rts     pc
-
-cyl    = 0.
-read   = 4
-go     = 1
-
-rpcs   = 176710
-rpda   = 176724
-rpca   = 176722
-rpba   = 176720
-/ rp03 disk driver.
-/ low order address in dno,
-/ high order in r0.
-rblk:
-       mov     r1,-(sp)
-       mov     dno,r1
-       div     $20.*10.,r0
-/      add     $cyl,r0
-       mov     r0,*$rpca
-       clr     r0
-       div     $10.,r0
-       swab    r0
-       bis     r1,r0
-       mov     r0,*$rpda
-       mov     $rpba,r1
-       mov     $buf,(r1)
-       mov     $-256.,-(r1)
-       mov     $read+go,-(r1)
-1:
-       tstb    (r1)
-       bge     1b
-       mov     (sp)+,r1
-       rts     pc
-
-tks = 177560
-tkb = 177562
-/ read and echo a teletype character
-getc:
-       mov     $tks,r0
-       inc     (r0)
-1:
-       tstb    (r0)
-       bge     1b
-       mov     tkb,r0
-       bic     $!177,r0
-       cmp     r0,$'A
-       blo     1f
-       cmp     r0,$'Z
-       bhi     1f
-       add     $'a-'A,r0
-1:
-
-tps = 177564
-tpb = 177566
-/ print a teletype character
-putc:
-       tstb    *$tps
-       bge     putc
-       mov     r0,*$tpb
-       cmp     r0,$'\r
-       bne     1f
-       mov     $'\n,r0
-       br      putc
-1:
-       rts     pc
-
-end:
-inod = ..-1024.
-addr = inod+12.
-buf = inod+64.
-bno = buf+512.
-dno = bno+2
-names = dno+2
-reset = 5
diff --git a/.ref-Research-V7/usr/pub/ascii b/.ref-Research-V7/usr/pub/ascii
deleted file mode 100644 (file)
index d3283fe..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-|000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel|
-|010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si |
-|020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb|
-|030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us |
-|040 sp |041  ! |042  " |043  # |044  $ |045  % |046  & |047  ' |
-|050  ( |051  ) |052  * |053  + |054  , |055  - |056  . |057  / |
-|060  0 |061  1 |062  2 |063  3 |064  4 |065  5 |066  6 |067  7 |
-|070  8 |071  9 |072  : |073  ; |074  < |075  = |076  > |077  ? |
-|100  @ |101  A |102  B |103  C |104  D |105  E |106  F |107  G |
-|110  H |111  I |112  J |113  K |114  L |115  M |116  N |117  O |
-|120  P |121  Q |122  R |123  S |124  T |125  U |126  V |127  W |
-|130  X |131  Y |132  Z |133  [ |134  \ |135  ] |136  ^ |137  _ |
-|140  ` |141  a |142  b |143  c |144  d |145  e |146  f |147  g |
-|150  h |151  i |152  j |153  k |154  l |155  m |156  n |157  o |
-|160  p |161  q |162  r |163  s |164  t |165  u |166  v |167  w |
-|170  x |171  y |172  z |173  { |174  | |175  } |176  ~ |177 del|
diff --git a/.ref-Research-V7/usr/pub/eqnchar b/.ref-Research-V7/usr/pub/eqnchar
deleted file mode 100644 (file)
index b933974..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-.EQ
-tdefine ciplus % "\o'\(pl\(ci'" %
-ndefine ciplus % O\b+ %
-tdefine citimes % "\o'\(mu\(ci'" %
-ndefine citimes % O\bx %
-tdefine =wig % "\(eq\h'-\w'\(eq'u-\w'\s-2\(ap'u/2u'\v'-.4m'\s-2\z\(ap\(ap\s+2\v'.4m'\h'\w'\(eq'u-\w'\s-2\(ap'u/2u'" %
-ndefine =wig % =\b"~" %
-tdefine bigstar % "\o'\(pl\(mu'" %
-ndefine bigstar % X\b|\b- %
-tdefine =dot % "\z\(eq\v'-.6m'\h'.2m'\s+2.\s-2\v'.6m'\h'.1m'" %
-ndefine =dot % = dot %
-tdefine orsign % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'.15m'\s+2" %
-ndefine orsign % \e/ %
-tdefine andsign % "\s-2\v'-.15m'\z\(sl\(sl\h'-.05m'\z\e\e\v'.15m'\s+2" %
-ndefine andsign % /\e %
-tdefine =del % "\v'.3m'\z=\v'-.6m'\h'.3m'\s-1\(*D\s+1\v'.3m'" %
-ndefine =del % = to DELTA %
-tdefine oppA % "\s-2\v'-.15m'\z\e\e\h'-.05m'\z\(sl\(sl\v'-.15m'\h'-.75m'\z-\z-\h'.2m'\z-\z-\v'.3m'\h'.4m'\s+2" %
-ndefine oppA % V\b- %
-tdefine oppE %"\s-3\v'.2m'\z\(em\v'-.5m'\z\(em\v'-.5m'\z\(em\v'.55m'\h'.9m'\z\(br\z\(br\v'.25m'\s+3" %
-ndefine oppE % E\b/ %
-tdefine incl % "\s-1\z\(or\h'-.1m'\v'-.45m'\z\(em\v'.7m'\z\(em\v'.2m'\(em\v'-.45m'\s+1" %
-ndefine incl % C\b_ %
-tdefine nomem % "\o'\(mo\(sl'" %
-ndefine nomem % C\b-\b/ %
-tdefine angstrom % "\fR\zA\v'-.3m'\h'.2m'\(de\v'.3m'\fP\h'.2m'" %
-ndefine angstrom % A to o %
-tdefine star %{ roman "\v'.5m'\s+3*\s-3\v'-.5m'"}%
-ndefine star % * %
-tdefine || % \(or\(or %
-tdefine <wig % "\z<\v'.4m'\(ap\v'-.4m'" %
-ndefine <wig %{ < from "~" }%
-tdefine >wig % "\z>\v'.4m'\(ap\v'-.4m'" %
-ndefine >wig %{ > from "~" }%
-tdefine langle % "\s-3\b'\(sl\e'\s0" %
-ndefine langle %<%
-tdefine rangle % "\s-3\b'\e\(sl'\s0" %
-ndefine rangle %>%
-tdefine hbar % "\zh\v'-.6m'\h'.05m'\(ru\v'.6m'" %
-ndefine hbar % h\b\u-\d %
-ndefine ppd % _\b| %
-tdefine ppd % "\o'\(ru\s-2\(or\s+2'" %
-tdefine <-> % "\o'\(<-\(->'" %
-ndefine <-> % "<-->" %
-tdefine <=> % "\s-2\z<\v'.05m'\h'.2m'\z=\h'.55m'=\h'-.6m'\v'-.05m'>\s+2" %
-ndefine <=> % "<=>" %
-tdefine |< % "\o'<\(or'" %
-ndefine |< % <\b| %
-tdefine |> % "\o'>\(or'" %
-ndefine |> % |\b> %
-tdefine ang % "\v'-.15m'\z\s-2\(sl\s+2\v'.15m'\(ru" %
-ndefine ang % /\b_ %
-tdefine rang % "\z\(or\h'.15m'\(ru" %
-ndefine rang % L %
-tdefine 3dot % "\v'-.8m'\z.\v'.5m'\z.\v'.5m'.\v'-.2m'" %
-ndefine 3dot % .\b\u.\b\u.\d\d %
-tdefine thf % ".\v'-.5m'.\v'.5m'." %
-ndefine thf % ..\b\u.\d %
-tdefine quarter % roman \(14 %
-ndefine quarter % 1/4 %
-tdefine 3quarter % roman \(34 %
-ndefine 3quarter % 3/4 %
-tdefine degree % \(de %
-ndefine degree % nothing sup o %
-tdefine square % \(sq %
-ndefine square % [] %
-tdefine circle % \(ci %
-ndefine circle % O %
-tdefine blot % "\fB\(sq\fP" %
-ndefine blot % H\bI\bX %
-tdefine bullet % \(bu %
-ndefine bullet % o\bx\be %
-tdefine -wig % "\(~=" %
-ndefine -wig % - to "~" %
-tdefine wig % \(ap %
-ndefine wig % "~" %
-tdefine prop % \(pt %
-ndefine prop % oc %
-tdefine empty % \(es %
-ndefine empty % O\b/ %
-tdefine member % \(mo %
-ndefine member % C\b- %
-tdefine cup % \(cu %
-ndefine cup % U %
-define cap % \(ca %
-define subset % \(sb %
-define supset % \(sp %
-define !subset % \(ib %
-define !supset % \(ip %
-.EN
diff --git a/.ref-Research-V7/usr/pub/greek b/.ref-Research-V7/usr/pub/greek
deleted file mode 100644 (file)
index cb64422..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-alpha  \ eA\ f  A  |  beta \ eB\ f  B  |  gamma        \ e\\ f  \
-GAMMA  \ eG\ f  G  |  delta        \ eD\ f  D  |  DELTA        \ eW\ f  W
-epsilon        \ eS\ f  S  |  zeta \ eQ\ f  Q  |  eta  \ eN\ f  N
-THETA  \ eT\ f  T  |  theta        \ eO\ f  O  |  lambda       \ eL\ f  L
-LAMBDA \ eE\ f  E  |  mu   \ eM\ f  M  |  nu   \ e@\ f  @
-xi     \ eX\ f  X  |  pi   \ eJ\ f  J  |  PI   \ eP\ f  P
-rho    \ eK\ f  K  |  sigma        \ eY\ f  Y  |  SIGMA        \ eR\ f  R
-tau    \ eI\ f  I  |  phi  \ eU\ f  U  |  PHI  \ eF\ f  F
-psi    \ eV\ f  V  |  PSI  \ eH\ f  H  |  omega        \ eC\ f  C
-OMEGA  \ eZ\ f  Z  |  nabla        \ e[\ f  [  |  not  \ e_\ f  _
-partial        \ e]\ f  ]  |  integral \ e^\ f ^
diff --git a/.ref-Research-V7/usr/spool/at/lasttimedone b/.ref-Research-V7/usr/spool/at/lasttimedone
deleted file mode 100644 (file)
index 7105d93..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1455
diff --git a/.ref-Research-V7/usr/spool/dpd/empty b/.ref-Research-V7/usr/spool/dpd/empty
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.ref-Research-V7/usr/spool/mail/dmr b/.ref-Research-V7/usr/spool/mail/dmr
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.ref-Research-V7/usr/spool/mail/root b/.ref-Research-V7/usr/spool/mail/root
deleted file mode 100644 (file)
index a4bd552..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-From bin Thu Jan 11 19:28:15 1979
-Secret mail has arrived.
-
diff --git a/.ref-Research-V7/usr/spool/secretmail/notice b/.ref-Research-V7/usr/spool/secretmail/notice
deleted file mode 100644 (file)
index 253b5d9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Secret mail has arrived.
diff --git a/.ref-Research-V7/usr/src/cmd/ac.c b/.ref-Research-V7/usr/src/cmd/ac.c
deleted file mode 100644 (file)
index 81a6e9f..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * acct [ -w wtmp ] [ -d ] [ -p ] [ people ]
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <time.h>
-#include <utmp.h>
-#include <sys/types.h>
-#include <sys/timeb.h>
-
-#define        TSIZE   33
-#define        USIZE   200
-struct  utmp ibuf;
-
-struct ubuf {
-       char    uname[8];
-       long    utime;
-} ubuf[USIZE];
-
-struct tbuf {
-       struct  ubuf    *userp;
-       long    ttime;
-} tbuf[TSIZE];
-
-char   *wtmp;
-int    pflag, byday;
-long   dtime;
-long   midnight;
-long   lastime;
-long   day     = 86400L;
-int    pcount;
-char   **pptr;
-
-main(argc, argv) 
-char **argv;
-{
-       int c, fl;
-       register i;
-       FILE *wf;
-
-       wtmp = "/usr/adm/wtmp";
-       while (--argc > 0 && **++argv == '-')
-       switch(*++*argv) {
-       case 'd':
-               byday++;
-               continue;
-
-       case 'w':
-               if (--argc>0)
-                       wtmp = *++argv;
-               continue;
-
-       case 'p':
-               pflag++;
-               continue;
-       }
-       pcount = argc;
-       pptr = argv;
-       if ((wf = fopen(wtmp, "r")) == NULL) {
-               printf("No %s\n", wtmp);
-               exit(1);
-       }
-       for(;;) {
-               if (fread((char *)&ibuf, sizeof(ibuf), 1, wf) != 1)
-                       break;
-               fl = 0;
-               for (i=0; i<8; i++) {
-                       c = ibuf.ut_name[i];
-                       if(isdigit(c) || isalpha(c)) {
-                               if (fl)
-                                       goto skip;
-                               continue;
-                       }
-                       if (c==' ' || c=='\0') {
-                               fl++;
-                               ibuf.ut_name[i] = '\0';
-                       } else
-                               goto skip;
-               }
-               loop();
-    skip:;
-       }
-       ibuf.ut_name[0] = '\0';
-       ibuf.ut_line[0] = '~';
-       time(&ibuf.ut_time);
-       loop();
-       print();
-       exit(0);
-}
-
-loop()
-{
-       register i;
-       register struct tbuf *tp;
-       register struct ubuf *up;
-
-       if(ibuf.ut_line[0] == '|') {
-               dtime = ibuf.ut_time;
-               return;
-       }
-       if(ibuf.ut_line[0] == '}') {
-               if(dtime == 0)
-                       return;
-               for(tp = tbuf; tp < &tbuf[TSIZE]; tp++)
-                       tp->ttime += ibuf.ut_time-dtime;
-               dtime = 0;
-               return;
-       }
-       if (lastime>ibuf.ut_time || lastime+(1.5*day)<ibuf.ut_time)
-               midnight = 0;
-       if (midnight==0)
-               newday();
-       lastime = ibuf.ut_time;
-       if (byday && ibuf.ut_time > midnight) {
-               upall(1);
-               print();
-               newday();
-               for (up=ubuf; up < &ubuf[USIZE]; up++)
-                       up->utime = 0;
-       }
-       if (ibuf.ut_line[0] == '~') {
-               ibuf.ut_name[0] = '\0';
-               upall(0);
-               return;
-       }
-       if (ibuf.ut_line[0]=='t')
-               i = (ibuf.ut_line[3]-'0')*10 + (ibuf.ut_line[4]-'0');
-       else
-               i = TSIZE-1;
-       if (i<0 || i>=TSIZE)
-               i = TSIZE-1;
-       tp = &tbuf[i];
-       update(tp, 0);
-}
-
-print()
-{
-       int i;
-       long ttime, t;
-
-       ttime = 0;
-       for (i=0; i<USIZE; i++) {
-               if(!among(i))
-                       continue;
-               t = ubuf[i].utime;
-               if (t>0)
-                       ttime += t;
-               if (pflag && ubuf[i].utime > 0) {
-                       printf("\t%-8.8s%6.2f\n",
-                           ubuf[i].uname, ubuf[i].utime/3600.);
-               }
-       }
-       if (ttime > 0) {
-               pdate();
-               printf("\ttotal%9.2f\n", ttime/3600.);
-       }
-}
-
-upall(f)
-{
-       register struct tbuf *tp;
-
-       for (tp=tbuf; tp < &tbuf[TSIZE]; tp++)
-               update(tp, f);
-}
-
-update(tp, f)
-struct tbuf *tp;
-{
-       int j;
-       struct ubuf *up;
-       long t, t1;
-
-       if (f)
-               t = midnight;
-       else
-               t = ibuf.ut_time;
-       if (tp->userp) {
-               t1 = t - tp->ttime;
-               if (t1>0 && t1 < 1.5*day)
-                       tp->userp->utime += t1;
-       }
-       tp->ttime = t;
-       if (f)
-               return;
-       if (ibuf.ut_name[0]=='\0') {
-               tp->userp = 0;
-               return;
-       }
-       for (up=ubuf; up < &ubuf[USIZE]; up++) {
-               if (up->uname[0] == '\0')
-                       break;
-               for (j=0; j<8 && up->uname[j]==ibuf.ut_name[j]; j++);
-               if (j>=8)
-                       break;
-       }
-       for (j=0; j<8; j++)
-               up->uname[j] = ibuf.ut_name[j];
-       tp->userp = up;
-}
-
-among(i)
-{
-       register j, k;
-       register char *p;
-
-       if (pcount==0)
-               return(1);
-       for (j=0; j<pcount; j++) {
-               p = pptr[j];
-               for (k=0; k<8; k++) {
-                       if (*p == ubuf[i].uname[k]) {
-                               if (*p++ == '\0')
-                                       return(1);
-                       } else
-                               break;
-               }
-       }
-       return(0);
-}
-
-newday()
-{
-       long ttime;
-       struct timeb tb;
-       struct tm *localtime();
-
-       time(&ttime);
-       if (midnight == 0) {
-               ftime(&tb);
-               midnight = 60*(long)tb.timezone;
-               if (localtime(&ttime)->tm_isdst)
-                       midnight -= 3600;
-       }
-       while (midnight <= ibuf.ut_time)
-               midnight += day;
-}
-
-pdate()
-{
-       long x;
-       char *ctime();
-
-       if (byday==0)
-               return;
-       x = midnight-1;
-       printf("%.6s", ctime(&x)+4);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/accton.c b/.ref-Research-V7/usr/src/cmd/accton.c
deleted file mode 100644 (file)
index 90f1e9f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-main(argc, argv)
-char **argv;
-{
-       extern errno;
-       if (argc > 1)
-               acct(argv[1]);
-       else
-               acct((char *)0);
-       if (errno) {
-               perror("accton");
-               exit(1);
-       }
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/access.c b/.ref-Research-V7/usr/src/cmd/adb/access.c
deleted file mode 100644 (file)
index a591679..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            ODDADR;
-MSG            BADDAT;
-MSG            BADTXT;
-MAP            txtmap;
-MAP            datmap;
-INT            wtflag;
-STRING         errflg;
-INT            errno;
-
-INT            pid;
-
-
-
-
-/* file handling and access routines */
-
-put(adr,space,value)
-L_INT  adr;
-{
-       access(WT,adr,space,value);
-}
-
-POS    get(adr, space)
-L_INT          adr;
-{
-       return(access(RD,adr,space,0));
-}
-
-POS    chkget(n, space)
-L_INT          n;
-{
-       REG INT         w;
-
-       w = get(n, space);
-       chkerr();
-       return(w);
-}
-
-access(mode,adr,space,value)
-L_INT  adr;
-{
-       INT             w, w1, pmode, rd, file;
-       rd = mode==RD;
-
-       IF space == NSP THEN return(0); FI
-
-       IF pid          /* tracing on? */
-       THEN IF (adr&01) ANDF !rd THEN error(ODDADR); FI
-            pmode = (space&DSP?(rd?RDUSER:WDUSER):(rd?RIUSER:WIUSER));
-            w = ptrace(pmode, pid, shorten(adr&~01), value);
-            IF adr&01
-            THEN w1 = ptrace(pmode, pid, shorten(adr+1), value);
-                 w = (w>>8)&LOBYTE | (w1<<8);
-            FI
-            IF errno
-            THEN errflg = (space&DSP ? BADDAT : BADTXT);
-            FI
-            return(w);
-       FI
-       w = 0;
-       IF mode==WT ANDF wtflag==0
-       THEN    error("not in write mode");
-       FI
-       IF !chkmap(&adr,space)
-       THEN return(0);
-       FI
-       file=(space&DSP?datmap.ufd:txtmap.ufd);
-       IF longseek(file,adr)==0 ORF
-          (rd ? read(file,&w,2) : write(file,&value,2)) < 1
-       THEN    errflg=(space&DSP?BADDAT:BADTXT);
-       FI
-       return(w);
-
-}
-
-chkmap(adr,space)
-       REG L_INT       *adr;
-       REG INT         space;
-{
-       REG MAPPTR amap;
-       amap=((space&DSP?&datmap:&txtmap));
-       IF space&STAR ORF !within(*adr,amap->b1,amap->e1)
-       THEN IF within(*adr,amap->b2,amap->e2)
-            THEN *adr += (amap->f2)-(amap->b2);
-            ELSE errflg=(space&DSP?BADDAT:BADTXT); return(0);
-            FI
-       ELSE *adr += (amap->f1)-(amap->b1);
-       FI
-       return(1);
-}
-
-within(adr,lbd,ubd)
-L_INT  adr, lbd, ubd;
-{
-       return(adr>=lbd && adr<ubd);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/command.c b/.ref-Research-V7/usr/src/cmd/adb/command.c
deleted file mode 100644 (file)
index e4a7885..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            BADEQ;
-MSG            NOMATCH;
-MSG            BADVAR;
-MSG            BADCOM;
-
-MAP            txtmap;
-MAP            datmap;
-INT            executing;
-CHAR           *lp;
-INT            fcor;
-INT            fsym;
-INT            mkfault;
-STRING         errflg;
-
-CHAR           lastc;
-CHAR           eqformat[128] "o";
-CHAR           stformat[128] "o\"= \"^i";
-POS            *endhdr;
-
-L_INT          dot;
-L_INT          ditto;
-INT            dotinc;
-INT            lastcom '=';
-L_INT          var[];
-L_INT          locval;
-L_INT          locmsk;
-INT            pid;
-L_INT          expv;
-L_INT          adrval;
-INT            adrflg;
-L_INT          cntval;
-INT            cntflg;
-
-
-
-
-/* command decoding */
-
-command(buf,defcom)
-STRING         buf;
-CHAR           defcom;
-{
-       INT             itype, ptype, modifier, regptr;
-       BOOL            longpr, eqcom;
-       CHAR            wformat[1];
-       CHAR            savc;
-       L_INT           w, savdot;
-       STRING          savlp=lp;
-       IF buf
-       THEN IF *buf==EOR
-            THEN return(FALSE);
-            ELSE lp=buf;
-            FI
-       FI
-
-       REP
-       IF adrflg=expr(0)
-       THEN dot=expv; ditto=dot;
-       FI
-       adrval=dot;
-       IF rdc()==',' ANDF expr(0)
-       THEN cntflg=TRUE; cntval=expv;
-       ELSE cntflg=FALSE; cntval=1; lp--;
-       FI
-
-       IF !eol(rdc())
-       THEN lastcom=lastc;
-       ELSE IF adrflg==0 THEN dot=inkdot(dotinc); FI
-            lp--; lastcom=defcom;
-       FI
-
-       switch(lastcom&STRIP) {
-
-           case '/':
-               itype=DSP; ptype=DSYM;
-               goto trystar;
-
-           case '=':
-               itype=NSP; ptype=ASYM;
-               goto trypr;
-
-           case '?':
-               itype=ISP; ptype=ISYM;
-               goto trystar;
-
-           trystar:
-               IF rdc()=='*' THEN lastcom |= QUOTE; ELSE lp--; FI
-               IF lastcom&QUOTE
-               THEN itype |= STAR; ptype = (DSYM+ISYM)-ptype;
-               FI
-
-           trypr:
-               longpr=FALSE; eqcom=lastcom=='=';
-               switch (rdc()) {
-
-                       case 'm':
-                           {/*reset map data*/
-                           INT         fcount;
-                           MAP         *smap;
-                           UNION{MAP *m; L_INT *mp;}amap;
-
-                           IF eqcom THEN error(BADEQ); FI
-                           smap=(itype&DSP?&datmap:&txtmap);
-                           amap.m=smap; fcount=3;
-                           IF itype&STAR
-                           THEN amap.mp += 3;
-                           FI
-                           WHILE fcount-- ANDF expr(0)
-                           DO *(amap.mp)++ = expv; OD
-                           IF rdc()=='?' THEN smap->ufd=fsym;
-                           ELIF lastc == '/' THEN smap->ufd=fcor;
-                           ELSE lp--;
-                           FI
-                           }
-                           break;
-
-                       case 'L':
-                           longpr=TRUE;
-                       case 'l':
-                           /*search for exp*/
-                           IF eqcom THEN error(BADEQ); FI
-                           dotinc=2; savdot=dot;
-                           expr(1); locval=expv;
-                           IF expr(0) THEN locmsk=expv; ELSE locmsk = -1L; FI
-                           LOOP w=leng(get(dot,itype));
-                                IF longpr
-                                THEN w=itol(w,get(inkdot(2),itype));
-                                FI
-                                IF errflg ORF mkfault ORF (w&locmsk)==locval THEN break; FI
-                                dot=inkdot(dotinc);
-                           POOL
-                           IF errflg
-                           THEN dot=savdot; errflg=NOMATCH;
-                           FI
-                           psymoff(dot,ptype,"");
-                           break;
-
-                       case 'W':
-                           longpr=TRUE;
-                       case 'w':
-                           IF eqcom THEN error(BADEQ); FI
-                           wformat[0]=lastc; expr(1);
-                           REP  savdot=dot; psymoff(dot,ptype,":%16t"); exform(1,wformat,itype,ptype);
-                                errflg=0; dot=savdot;
-                                IF longpr
-                                THEN put(dot,itype,expv);
-                                FI
-                                put((longpr?inkdot(2):dot),itype,shorten(expv));
-                                savdot=dot;
-                                printf("=%8t"); exform(1,wformat,itype,ptype);
-                                newline();
-                           PER  expr(0) ANDF errflg==0 DONE
-                           dot=savdot;
-                           chkerr();
-                           break;
-
-                       default:
-                           lp--;
-                           getformat(eqcom ? eqformat : stformat);
-                           IF !eqcom
-                           THEN psymoff(dot,ptype,":%16t");
-                           FI
-                           scanform(cntval,(eqcom?eqformat:stformat),itype,ptype);
-               }
-               break;
-
-           case '>':
-               lastcom=0; savc=rdc();
-               IF regptr=getreg(savc)
-               THEN endhdr[regptr]=shorten(dot);
-                    ptrace(WUREGS,pid,2*(512+regptr),endhdr[regptr]);
-               ELIF (modifier=varchk(savc)) != -1
-               THEN    var[modifier]=dot;
-               ELSE    error(BADVAR);
-               FI
-               break;
-
-           case '!':
-               lastcom=0;
-               unox(); break;
-
-           case '$':
-               lastcom=0;
-               printtrace(nextchar()); break;
-
-           case ':':
-               IF !executing
-               THEN executing=TRUE;
-                    subpcs(nextchar());
-                    executing=FALSE;
-                    lastcom=0;
-               FI
-               break;
-
-           case 0:
-               prints(DBNAME);
-               break;
-
-           default: error(BADCOM);
-       }
-
-       flushbuf();
-       PER rdc()==';' DONE
-       IF buf THEN lp=savlp; ELSE lp--; FI
-       return(adrflg ANDF dot!=0);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/defs.h b/.ref-Research-V7/usr/src/cmd/adb/defs.h
deleted file mode 100644 (file)
index 427be15..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-/*
- *
- *     UNIX debugger - common definitions
- *
- */
-
-
-
-/*     Layout of a.out file (fsym):
- *
- *     header of 8 words       magic number 405, 407, 410, 411
- *                             text size       )
- *                             data size       ) in bytes but even
- *                             bss size        )
- *                             symbol table size
- *                             entry point
- *                             {unused}
- *                             flag set if no relocation
- *
- *
- *     header:         0
- *     text:           16
- *     data:           16+textsize
- *     relocation:     16+textsize+datasize
- *     symbol table:   16+2*(textsize+datasize) or 16+textsize+datasize
- *
- */
-
-
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <sys/reg.h>
-#include <sys/user.h>
-#include <sgtty.h>
-#include "mac.h"
-#include "mode.h"
-
-
-#define VARB   11
-#define VARD   13
-#define VARE   14
-#define VARM   22
-#define VARS   28
-#define VART   29
-
-#define COREMAGIC 0140000
-
-#define RD     0
-#define WT     1
-#define NSP    0
-#define        ISP     1
-#define        DSP     2
-#define STAR   4
-#define STARCOM 0200
-#define DSYM   7
-#define ISYM   2
-#define ASYM   1
-#define NSYM   0
-#define ESYM   (-1)
-#define BKPTSET        1
-#define BKPTEXEC 2
-#define        SYMSIZ  100
-#define MAXSIG 20
-
-#define USERPS 2*(512-1)
-#define USERPC 2*(512-2)
-#define BPT    03
-#define FD     0200
-#define        SETTRC  0
-#define        RDUSER  2
-#define        RIUSER  1
-#define        WDUSER  5
-#define WIUSER 4
-#define        RUREGS  3
-#define        WUREGS  6
-#define        CONTIN  7
-#define        SINGLE  9
-#define        EXIT    8
-
-#define FROFF  (&(0->fpsr))
-#define FRLEN  25
-#define FRMAX  6
-
-#define        ps      -1
-#define        pc      -2
-#define        sp      -6
-#define        r5      -9
-#define        r4      -10
-#define        r3      -11
-#define        r2      -12
-#define        r1      -5
-#define        r0      -3
-
-#define MAXOFF 255
-#define MAXPOS 80
-#define MAXLIN 128
-#define EOF    0
-#define EOR    '\n'
-#define TB     '\t'
-#define QUOTE  0200
-#define STRIP  0177
-#define LOBYTE 0377
-#define EVEN   -2
-
-
-/* long to ints and back (puns) */
-union {
-       INT     I[2];
-       L_INT   L;
-} itolws;
-
-#define leng(a)                ((long)((unsigned)(a)))
-#define shorten(a)     ((int)(a))
-#define itol(a,b)      (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L)
-
-
-
-/* result type declarations */
-L_INT          inkdot();
-SYMPTR         lookupsym();
-SYMPTR         symget();
-POS            get();
-POS            chkget();
-STRING         exform();
-L_INT          round();
-BKPTR          scanbkpt();
-VOID           fault();
-
-typedef struct sgttyb TTY;
-TTY    adbtty, usrtty;
-#include <setjmp.h>
-jmp_buf erradb;
diff --git a/.ref-Research-V7/usr/src/cmd/adb/dummy.c b/.ref-Research-V7/usr/src/cmd/adb/dummy.c
deleted file mode 100644 (file)
index 5c0eabd..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-/*
- *
- *     UNIX debugger - small version
- *
- */
-
-subpcs(modif)
-{
-       prints("sub processes not supported\n");
-}
-
-delbp()
-{;}
-
-endpcs()
-{;}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/expr.c b/.ref-Research-V7/usr/src/cmd/adb/expr.c
deleted file mode 100644 (file)
index e73b325..0000000
+++ /dev/null
@@ -1,313 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            BADSYM;
-MSG            BADVAR;
-MSG            BADKET;
-MSG            BADSYN;
-MSG            NOCFN;
-MSG            NOADR;
-MSG            BADLOC;
-
-SYMTAB         symbol;
-INT            lastframe;
-INT            savlastf;
-L_INT          savframe;
-INT            savpc;
-INT            callpc;
-
-
-
-CHAR           *lp;
-INT            octal;
-STRING         errflg;
-L_INT          localval;
-CHAR           isymbol[8];
-
-CHAR           lastc;
-POS            *endhdr;
-
-L_INT          dot;
-L_INT          ditto;
-INT            dotinc;
-L_INT          var[];
-L_INT          expv;
-
-
-
-
-expr(a)
-{      /* term | term dyadic expr |  */
-       INT             rc;
-       L_INT           lhs;
-
-       rdc(); lp--; rc=term(a);
-
-       WHILE rc
-       DO  lhs = expv;
-
-           switch (readchar()) {
-
-                   case '+':
-                       term(a|1); expv += lhs; break;
-
-                   case '-':
-                       term(a|1); expv = lhs - expv; break;
-
-                   case '#':
-                       term(a|1); expv = round(lhs,expv); break;
-
-                   case '*':
-                       term(a|1); expv *= lhs; break;
-
-                   case '%':
-                       term(a|1); expv = lhs/expv; break;
-
-                   case '&':
-                       term(a|1); expv &= lhs; break;
-
-                   case '|':
-                       term(a|1); expv |= lhs; break;
-
-                   case ')':
-                       IF (a&2)==0 THEN error(BADKET); FI
-
-                   default:
-                       lp--;
-                       return(rc);
-           }
-       OD
-       return(rc);
-}
-
-term(a)
-{      /* item | monadic item | (expr) | */
-
-       switch (readchar()) {
-
-                   case '*':
-                       term(a|1); expv=chkget(expv,DSP); return(1);
-
-                   case '@':
-                       term(a|1); expv=chkget(expv,ISP); return(1);
-
-                   case '-':
-                       term(a|1); expv = -expv; return(1);
-
-                   case '~':
-                       term(a|1); expv = ~expv; return(1);
-
-                   case '(':
-                       expr(2);
-                       IF *lp!=')'
-                       THEN    error(BADSYN);
-                       ELSE    lp++; return(1);
-                       FI
-
-                   default:
-                       lp--;
-                       return(item(a));
-       }
-}
-
-item(a)
-{      /* name [ . local ] | number | . | ^ | <var | <register | 'x | | */
-       INT             base, d, frpt, regptr;
-       CHAR            savc;
-       BOOL            hex;
-       L_INT           frame;
-       UNION{REAL r; L_INT i;} real;
-       SYMPTR          symp;
-
-       hex=FALSE;
-
-       readchar();
-       IF symchar(0)
-       THEN    readsym();
-               IF lastc=='.'
-               THEN    frame=endhdr[r5]&EVEN; lastframe=0; callpc=endhdr[pc];
-                       WHILE errflg==0
-                       DO  savpc=callpc;
-                           findroutine(frame);
-                           IF  eqsym(symbol.symc,isymbol,'~')
-                           THEN break;
-                           FI
-                           lastframe=frame;
-                           frame=get(frame,DSP)&EVEN;
-                           IF frame==0
-                           THEN error(NOCFN);
-                           FI
-                       OD
-                       savlastf=lastframe; savframe=frame;
-                       readchar();
-                       IF symchar(0)
-                       THEN    chkloc(expv=frame);
-                       FI
-               ELIF (symp=lookupsym(isymbol))==0 THEN error(BADSYM);
-               ELSE expv = symp->symv;
-               FI
-               lp--;
-
-
-       ELIF digit(lastc) ORF (hex=TRUE, lastc=='#' ANDF hexdigit(readchar()))
-       THEN    expv = 0;
-               base = (lastc == '0' ORF octal ? 8 : (hex ? 16 : 10));
-               WHILE (hex ? hexdigit(lastc) : digit(lastc))
-               DO  expv *= base;
-                   IF (d=convdig(lastc))>=base THEN error(BADSYN); FI
-                   expv += d; readchar();
-                   IF expv==0 ANDF (lastc=='x' ORF lastc=='X')
-                   THEN hex=TRUE; base=16; readchar();
-                   FI
-               OD
-               IF lastc=='.' ANDF (base==10 ORF expv==0) ANDF !hex
-               THEN    real.r=expv; frpt=0; base=10;
-                       WHILE digit(readchar())
-                       DO      real.r *= base; frpt++;
-                               real.r += lastc-'0';
-                       OD
-                       WHILE frpt--
-                       DO      real.r /= base; OD
-                       expv = real.i;
-               FI
-               lp--;
-
-       ELIF lastc=='.'
-       THEN    readchar();
-               IF symchar(0)
-               THEN    lastframe=savlastf; callpc=savpc; findroutine(savframe);
-                       chkloc(savframe);
-               ELSE    expv=dot;
-               FI
-               lp--;
-
-       ELIF lastc=='"'
-       THEN    expv=ditto;
-
-       ELIF lastc=='+'
-       THEN    expv=inkdot(dotinc);
-
-       ELIF lastc=='^'
-       THEN    expv=inkdot(-dotinc);
-
-       ELIF lastc=='<'
-       THEN    savc=rdc();
-               IF regptr=getreg(savc)
-               THEN    expv=endhdr[regptr];
-               ELIF (base=varchk(savc)) != -1
-               THEN    expv=var[base];
-               ELSE    error(BADVAR);
-               FI
-
-       ELIF lastc=='\''
-       THEN    d=4; expv=0;
-               WHILE quotchar()
-               DO  IF d--
-                   THEN IF d==1 THEN expv =<<16; FI
-                        expv |= ((d&1)?lastc:lastc<<8);
-                   ELSE error(BADSYN);
-                   FI
-               OD
-
-       ELIF a
-       THEN    error(NOADR);
-       ELSE    lp--; return(0);
-       FI
-       return(1);
-}
-
-/* service routines for expression reading */
-
-readsym()
-{
-       REG char        *p;
-
-       p = isymbol;
-       REP IF p < &isymbol[8]
-           THEN *p++ = lastc;
-           FI
-           readchar();
-       PER symchar(1) DONE
-       WHILE p < &isymbol[8] DO *p++ = 0; OD
-}
-
-SYMPTR lookupsym(symstr)
-STRING symstr;
-{
-       SYMPTR          symp;
-       symset();
-       WHILE (symp=symget())
-       DO IF (symp->symf&SYMCHK)==symp->symf
-          ANDF eqsym(symp->symc, symstr,'_')
-           THEN return(symp);
-           FI
-       OD
-       return(0);
-}
-
-hexdigit(c)
-CHAR c;
-{      return((c>='0' ANDF c<='9') ORF (c>='a' ANDF c<='f'));
-}
-
-convdig(c)
-CHAR c;
-{
-       IF digit(c)
-       THEN    return(c-'0');
-       ELIF hexdigit(c)
-       THEN    return(c-'a'+10);
-       ELSE    return(17);
-       FI
-}
-
-digit(c) char c;       {return(c>='0' ANDF c<='9');}
-
-letter(c) char c;      {return(c>='a' ANDF c<='z' ORF c>='A' ANDF c<='Z');}
-
-symchar(dig)
-{
-       IF lastc=='\\' THEN readchar(); return(TRUE); FI
-       return( letter(lastc) ORF lastc=='_' ORF dig ANDF digit(lastc) );
-}
-
-varchk(name)
-{
-       IF digit(name) THEN return(name-'0'); FI
-       IF letter(name) THEN return((name&037)-1+10); FI
-       return(-1);
-}
-
-chkloc(frame)
-L_INT          frame;
-{
-       readsym();
-       REP IF localsym(frame)==0 THEN error(BADLOC); FI
-           expv=localval;
-       PER !eqsym(symbol.symc,isymbol,'~') DONE
-}
-
-eqsym(s1, s2, c)
-REG STRING     s1, s2;
-CHAR           c;
-{
-       IF eqstr(s1,s2)
-       THEN    return(TRUE);
-       ELIF *s1==c
-       THEN    CHAR            s3[8];
-               REG INT         i;
-
-               s3[0]=c;
-               FOR i=1; i<8; i++
-               DO s3[i] = *s2++; OD
-
-               return(eqstr(s1,s3));
-       FI
-}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/findfn.c b/.ref-Research-V7/usr/src/cmd/adb/findfn.c
deleted file mode 100644 (file)
index 6c5e8d9..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            NOCFN;
-
-INT            callpc;
-BOOL           localok;
-SYMTAB         symbol;
-
-STRING         errflg;
-
-
-findroutine(cframe)
-       L_INT           cframe;
-{
-       REG INT         narg, inst;
-       INT             lastpc, back2;
-       BOOL            v;
-
-       v=FALSE; localok=FALSE; lastpc=callpc;
-       callpc=get(cframe+2, DSP); back2=get(leng(callpc-2), ISP);
-       IF (inst=get(leng(callpc-4), ISP)) == 04737     /* jsr pc,*$... */
-       THEN    narg = 1;
-       ELIF (inst&~077)==04700                 /* jsr pc,... */
-       THEN    narg=0; v=(inst!=04767);
-       ELIF (back2&~077)==04700
-       THEN    narg=0; v=TRUE;
-       ELSE    errflg=NOCFN;
-               return(0);
-       FI
-       IF findsym( (v ? lastpc : ((inst==04767?callpc:0) + back2) ),ISYM) == -1
-           ANDF !v
-       THEN    symbol.symc[0] = '?';
-               symbol.symc[1] = 0;
-               symbol.symv = 0;
-       ELSE    localok=TRUE;
-       FI
-       inst = get(leng(callpc), ISP);
-       IF inst == 05726                /* tst (sp)+ */
-       THEN    return(narg+1);
-       FI
-       IF inst == 022626               /* cmp (sp)+,(sp)+ */
-       THEN    return(narg+2);
-       FI
-       IF inst == 062706               /* add $n,sp */
-       THEN    return(narg+get(leng(callpc+2), ISP)/2);
-       FI
-       return(narg);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/format.c b/.ref-Research-V7/usr/src/cmd/adb/format.c
deleted file mode 100644 (file)
index 6707255..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            BADMOD;
-MSG            NOFORK;
-MSG            ADWRAP;
-
-SYMTAB         symbol;
-
-INT            mkfault;
-CHAR           *lp;
-INT            maxoff;
-INT            sigint;
-INT            sigqit;
-STRING         errflg;
-CHAR           lastc;
-L_INT          dot;
-INT            dotinc;
-L_INT          var[];
-
-
-scanform(icount,ifp,itype,ptype)
-L_INT          icount;
-STRING         ifp;
-{
-       STRING          fp;
-       CHAR            modifier;
-       INT             fcount, init=1;
-       L_INT           savdot;
-
-       WHILE icount
-       DO  fp=ifp;
-           IF init==0 ANDF findsym(shorten(dot),ptype)==0 ANDF maxoff
-           THEN printf("\n%.8s:%16t",symbol.symc);
-           FI
-           savdot=dot; init=0;
-
-           /*now loop over format*/
-           WHILE *fp ANDF errflg==0
-           DO  IF digit(modifier = *fp)
-               THEN fcount=0;
-                    WHILE digit(modifier = *fp++)
-                    DO fcount *= 10;
-                       fcount += modifier-'0';
-                    OD
-                    fp--;
-               ELSE fcount=1;
-               FI
-
-               IF *fp==0 THEN break; FI
-               fp=exform(fcount,fp,itype,ptype);
-           OD
-           dotinc=dot-savdot;
-           dot=savdot;
-
-           IF errflg
-           THEN IF icount<0
-                THEN errflg=0; break;
-                ELSE error(errflg);
-                FI
-           FI
-           IF --icount
-           THEN dot=inkdot(dotinc);
-           FI
-           IF mkfault THEN error(0); FI
-       OD
-}
-
-STRING exform(fcount,ifp,itype,ptype)
-INT            fcount;
-STRING         ifp;
-{
-       /* execute single format item `fcount' times
-        * sets `dotinc' and moves `dot'
-        * returns address of next format item
-        */
-       POS             w;
-       L_INT           savdot, wx;
-       STRING          fp;
-       CHAR            c, modifier, longpr;
-       L_REAL          fw;
-       struct{
-               L_INT   sa;
-               INT     sb,sc;
-       };
-
-       WHILE fcount>0
-       DO      fp = ifp; c = *fp;
-               longpr=(c>='A')&(c<='Z')|(c=='f');
-               IF itype==NSP ORF *fp=='a'
-               THEN wx=dot; w=dot;
-               ELSE w=get(dot,itype);
-                    IF longpr
-                    THEN wx=itol(w,get(inkdot(2),itype));
-                    ELSE wx=w;
-                    FI
-               FI
-               IF c=='F'
-               THEN fw.sb=get(inkdot(4),itype);
-                    fw.sc=get(inkdot(6),itype);
-               FI
-               IF errflg THEN return(fp); FI
-               IF mkfault THEN error(0); FI
-               var[0]=wx;
-               modifier = *fp++;
-               dotinc=(longpr?4:2);;
-
-               IF charpos()==0 ANDF modifier!='a' THEN printf("%16m"); FI
-
-               switch(modifier) {
-
-                   case SP: case TB:
-                       break;
-
-                   case 't': case 'T':
-                       printf("%T",fcount); return(fp);
-
-                   case 'r': case 'R':
-                       printf("%M",fcount); return(fp);
-
-                   case 'a':
-                       psymoff(dot,ptype,":%16t"); dotinc=0; break;
-
-                   case 'p':
-                       psymoff(var[0],ptype,"%16t"); break;
-
-                   case 'u':
-                       printf("%-8u",w); break;
-
-                   case 'U':
-                       printf("%-16U",wx); break;
-
-                   case 'c': case 'C':
-                       IF modifier=='C'
-                       THEN printesc(w&LOBYTE);
-                       ELSE printc(w&LOBYTE);
-                       FI
-                       dotinc=1; break;
-
-                   case 'b': case 'B':
-                       printf("%-8o", w&LOBYTE); dotinc=1; break;
-
-                   case 's': case 'S':
-                       savdot=dot; dotinc=1;
-                       WHILE (c=get(dot,itype)&LOBYTE) ANDF errflg==0
-                       DO dot=inkdot(1);
-                          IF modifier == 'S'
-                          THEN printesc(c);
-                          ELSE printc(c);
-                          FI
-                          endline();
-                       OD
-                       dotinc=dot-savdot+1; dot=savdot; break;
-
-                   case 'x':
-                       printf("%-8x",w); break;
-
-                   case 'X':
-                       printf("%-16X", wx); break;
-
-                   case 'Y':
-                       printf("%-24Y", wx); break;
-
-                   case 'q':
-                       printf("%-8q", w); break;
-
-                   case 'Q':
-                       printf("%-16Q", wx); break;
-
-                   case 'o':
-                   case 'w':
-                       printf("%-8o", w); break;
-
-                   case 'O':
-                   case 'W':
-                       printf("%-16O", wx); break;
-
-                   case 'i':
-                       printins(0,itype,w); printc(EOR); break;
-
-                   case 'd':
-                       printf("%-8d", w); break;
-
-                   case 'D':
-                       printf("%-16D", wx); break;
-
-                   case 'f':
-                       fw = 0;
-                       fw.sa = wx;
-                       printf("%-16.9f", fw);
-                       dotinc=4; break;
-
-                   case 'F':
-                       fw.sa = wx;
-                       printf("%-32.18F", fw);
-                       dotinc=8; break;
-
-                   case 'n': case 'N':
-                       printc('\n'); dotinc=0; break;
-
-                   case '"':
-                       dotinc=0;
-                       WHILE *fp != '"' ANDF *fp
-                       DO printc(*fp++); OD
-                       IF *fp THEN fp++; FI
-                       break;
-
-                   case '^':
-                       dot=inkdot(-dotinc*fcount); return(fp);
-
-                   case '+':
-                       dot=inkdot(fcount); return(fp);
-
-                   case '-':
-                       dot=inkdot(-fcount); return(fp);
-
-                   default: error(BADMOD);
-               }
-               IF itype!=NSP
-               THEN    dot=inkdot(dotinc);
-               FI
-               fcount--; endline();
-       OD
-
-       return(fp);
-}
-
-unox()
-{
-       INT             rc, status, unixpid;
-       STRING          argp lp;
-
-       WHILE lastc!=EOR DO rdc(); OD
-       IF (unixpid=fork())==0
-       THEN    signal(SIGINT,sigint); signal(SIGQUIT,sigqit);
-               *lp=0; execl("/bin/sh", "sh", "-c", argp, 0);
-               exit(16);
-       ELIF unixpid == -1
-       THEN    error(NOFORK);
-       ELSE    signal(SIGINT,1);
-               WHILE (rc = wait(&status)) != unixpid ANDF rc != -1 DONE
-               signal(SIGINT,sigint);
-               prints("!"); lp--;
-       FI
-}
-
-
-printesc(c)
-{
-       c &= STRIP;
-       IF c<SP ORF c>'~' ORF c=='@'
-       THEN printf("@%c",(c=='@' ? '@' : c^0140));
-       ELSE printc(c);
-       FI
-}
-
-L_INT  inkdot(incr)
-{
-       L_INT           newdot;
-
-       newdot=dot+incr;
-       IF (dot NEQ newdot) >> 24 THEN error(ADWRAP); FI
-       return(newdot);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/input.c b/.ref-Research-V7/usr/src/cmd/adb/input.c
deleted file mode 100644 (file)
index ce52a3e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-INT            mkfault;
-CHAR           line[LINSIZ];
-INT            infile;
-CHAR           *lp;
-CHAR           lastc EOR;
-INT            eof;
-
-/* input routines */
-
-eol(c)
-CHAR   c;
-{
-       return(c==EOR ORF c==';');
-}
-
-rdc()
-{      REP     readchar();
-       PER     lastc==SP ORF lastc==TB
-       DONE
-       return(lastc);
-}
-
-readchar()
-{
-       IF eof
-       THEN    lastc=EOF;
-       ELSE    IF lp==0
-               THEN    lp=line;
-                       REP eof = read(infile,lp,1)==0;
-                           IF mkfault THEN error(0); FI
-                       PER eof==0 ANDF *lp++!=EOR DONE
-                       *lp=0; lp=line;
-               FI
-               IF lastc = *lp THEN lp++; FI
-       FI
-       return(lastc);
-}
-
-nextchar()
-{
-       IF eol(rdc())
-       THEN lp--; return(0);
-       ELSE return(lastc);
-       FI
-}
-
-quotchar()
-{
-       IF readchar()=='\\'
-       THEN    return(readchar());
-       ELIF lastc=='\''
-       THEN    return(0);
-       ELSE    return(lastc);
-       FI
-}
-
-getformat(deformat)
-STRING         deformat;
-{
-       REG STRING      fptr;
-       REG BOOL        quote;
-       fptr=deformat; quote=FALSE;
-       WHILE (quote ? readchar()!=EOR : !eol(readchar()))
-       DO  IF (*fptr++ = lastc)=='"'
-           THEN quote = ~quote;
-           FI
-       OD
-       lp--;
-       IF fptr!=deformat THEN *fptr++ = '\0'; FI
-}
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/mac.h b/.ref-Research-V7/usr/src/cmd/adb/mac.h
deleted file mode 100644 (file)
index a5510d6..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-/*
- *     UNIX debugger
- */
-
-#define TYPE   typedef
-#define STRUCT struct
-#define UNION  union
-#define REG    register
-
-#define BEGIN  {
-#define END    }
-
-#define IF     if(
-#define THEN   ){
-#define ELSE   } else {
-#define ELIF   } else if (
-#define FI     }
-
-#define FOR    for(
-#define WHILE  while(
-#define DO     ){
-#define OD     }
-#define REP    do{
-#define PER    }while(
-#define DONE   );
-#define LOOP   for(;;){
-#define POOL   }
-
-#define SKIP   ;
-#define DIV    /
-#define REM    %
-#define NEQ    ^
-#define ANDF   &&
-#define ORF    ||
-
-#define TRUE    (-1)
-#define FALSE  0
-#define LOBYTE 0377
-#define HIBYTE 0177400
-#define STRIP  0177
-#define HEXMSK 017
-
-#define SP     ' '
-#define TB     '\t'
-#define NL     '\n'
-#define EOF    0
diff --git a/.ref-Research-V7/usr/src/cmd/adb/machine.h b/.ref-Research-V7/usr/src/cmd/adb/machine.h
deleted file mode 100644 (file)
index 12b2a3a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-/*
- *     UNIX/INTERDATA debugger
- */
-
-/* unix parameters */
-#define DBNAME "adb\n"
-#define LPRMODE "%Q"
-#define OFFMODE "+%o"
-#define TXTRNDSIZ 8192L
-
-TYPE   unsigned TXTHDR[8];
-TYPE   unsigned SYMV;
-
-/* symbol table in a.out file */
-struct symtab {
-       char    symc[8];
-       int     symf;
-       SYMV    symv;
-};
-#define SYMTABSIZ (sizeof (struct symtab))
-
-#define SYMCHK 047
-#define SYMTYPE(symflg) (( symflg>=041 || (symflg>=02 && symflg<=04))\
-                               ?  ((symflg&07)>=3 ? DSYM : (symflg&07))\
-                               : NSYM\
-                       )
diff --git a/.ref-Research-V7/usr/src/cmd/adb/main.c b/.ref-Research-V7/usr/src/cmd/adb/main.c
deleted file mode 100644 (file)
index 6d7c7fa..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            NOEOR;
-
-INT            mkfault;
-INT            executing;
-INT            infile;
-CHAR           *lp;
-INT            maxoff;
-INT            maxpos;
-INT            sigint;
-INT            sigqit;
-INT            wtflag;
-L_INT          maxfile;
-L_INT          maxstor;
-L_INT          txtsiz;
-L_INT          datsiz;
-L_INT          datbas;
-L_INT          stksiz;
-STRING         errflg;
-INT            exitflg;
-INT            magic;
-L_INT          entrypt;
-
-CHAR           lastc;
-INT            eof;
-
-INT            lastcom;
-L_INT          var[36];
-STRING         symfil;
-STRING         corfil;
-CHAR           printbuf[];
-CHAR           *printptr;
-
-
-L_INT  round(a,b)
-L_INT          a, b;
-{
-       L_INT           w;
-       w = ((a+b-1)/b)*b;
-       return(w);
-}
-
-/* error handling */
-
-chkerr()
-{
-       IF errflg ORF mkfault
-       THEN    error(errflg);
-       FI
-}
-
-error(n)
-       STRING          n;
-{
-       errflg=n;
-       iclose(); oclose();
-       longjmp(erradb,1);
-}
-
-fault(a)
-{
-       signal(a,fault);
-       lseek(infile,0L,2);
-       mkfault++;
-}
-
-/* set up files and initial address mappings */
-INT argcount;
-
-main(argc, argv)
-REG STRING     *argv;
-REG INT                argc;
-{
-       maxfile=1L<<24; maxstor=1L<<16;
-
-       gtty(0,&adbtty);
-       gtty(0,&usrtty);
-       WHILE argc>1
-       DO      IF eqstr("-w",argv[1])
-               THEN    wtflag=2; argc--; argv++;
-               ELSE    break;
-               FI
-       OD
-
-       IF argc>1 THEN symfil = argv[1]; FI
-       IF argc>2 THEN corfil = argv[2]; FI
-       argcount=argc;
-       setsym(); setcor();
-
-       /* set up variables for user */
-       maxoff=MAXOFF; maxpos=MAXPOS;
-       var[VARB] = datbas;
-       var[VARD] = datsiz;
-       var[VARE] = entrypt;
-       var[VARM] = magic;
-       var[VARS] = stksiz;
-       var[VART] = txtsiz;
-
-       IF (sigint=signal(SIGINT,01))!=01
-       THEN    sigint=fault; signal(SIGINT,fault);
-       FI
-       sigqit=signal(SIGQUIT,1);
-       setjmp(erradb);
-       IF executing THEN delbp(); FI
-       executing=FALSE;
-
-       LOOP    flushbuf();
-               IF errflg
-               THEN printf("%s\n",errflg);
-                    exitflg=errflg;
-                    errflg=0;
-               FI
-               IF mkfault
-               THEN    mkfault=0; printc(EOR); prints(DBNAME);
-               FI
-               lp=0; rdc(); lp--;
-               IF eof
-               THEN    IF infile
-                       THEN    iclose(); eof=0; longjmp(erradb,1);
-                       ELSE    done();
-                       FI
-               ELSE    exitflg=0;
-               FI
-               command(0,lastcom);
-               IF lp ANDF lastc!=EOR THEN error(NOEOR); FI
-       POOL
-}
-
-done()
-{
-       endpcs();
-       exit(exitflg);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/makefile b/.ref-Research-V7/usr/src/cmd/adb/makefile
deleted file mode 100644 (file)
index 9256b7f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-CFLAGS = -i -O
-
-all:   adb
-
-cmp:   adb
-       cmp adb /bin/adb
-       rm adb *.o
-
-cp:    adb
-       cp adb /bin/adb
-       rm adb *.o
-
-adb:   access.o command.o expr.o findfn.o
-adb:   format.o input.o opset.o main.o
-adb:   message.o output.o pcs.o print.o
-adb:   runpcs.o setup.o sym.o
-adb:;  cc -o adb -i *.o
-
-
-access.o:      defs.h
-command.o:     defs.h
-expr.o:                defs.h
-findrtn.o:     defs.h
-format.o:      defs.h
-input.o:       defs.h
-main.o:                defs.h
-message.o:     mac.h mode.h
-output.o:      defs.h
-pcs.o:         defs.h
-print.o:       defs.h
-runpcs.o:      defs.h
-setup.o:       defs.h
-sym.o:         defs.h
diff --git a/.ref-Research-V7/usr/src/cmd/adb/message.c b/.ref-Research-V7/usr/src/cmd/adb/message.c
deleted file mode 100644 (file)
index 0a7b9f1..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-
-
-#include       "mac.h"
-#include       "mode.h"
-
-MSG            version = "\nVERSION sys117     DATE 1978 Dec 27 16:37:44\n";
-
-MSG            BADMOD  =  "bad modifier";
-MSG            BADCOM  =  "bad command";
-MSG            BADSYM  =  "symbol not found";
-MSG            BADLOC  =  "automatic variable not found";
-MSG            NOCFN   =  "c routine not found";
-MSG            NOMATCH =  "cannot locate value";
-MSG            NOBKPT  =  "no breakpoint set";
-MSG            BADKET  =  "unexpected ')'";
-MSG            NOADR   =  "address expected";
-MSG            NOPCS   =  "no process";
-MSG            BADVAR  =  "bad variable";
-MSG            BADTXT  =  "text address not found";
-MSG            BADDAT  =  "data address not found";
-MSG            ODDADR  =  "odd address";
-MSG            EXBKPT  =  "too many breakpoints";
-MSG            A68BAD  =  "bad a68 frame";
-MSG            A68LNK  =  "bad a68 link";
-MSG            ADWRAP  =  "address wrap around";
-MSG            BADEQ   =  "unexpected `='";
-MSG            BADWAIT =  "wait error: process disappeared!";
-MSG            ENDPCS  =  "process terminated";
-MSG            NOFORK  =  "try again";
-MSG            BADSYN  =  "syntax error";
-MSG            NOEOR   =  "newline expected";
-MSG            SZBKPT  =  "bkpt: command too long";
-MSG            BADFIL  =  "bad file format";
-MSG            BADNAM  =  "not enough space for symbols";
-MSG            LONGFIL =  "filename too long";
-MSG            NOTOPEN =  "cannot open";
-MSG            BADMAG  =  "bad core magic number";
diff --git a/.ref-Research-V7/usr/src/cmd/adb/mode.h b/.ref-Research-V7/usr/src/cmd/adb/mode.h
deleted file mode 100644 (file)
index 61c1c82..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#include "machine.h"
-/*
- *     UNIX debugger
- */
-
-#define MAXCOM 64
-#define MAXARG 32
-#define LINSIZ 256
-TYPE   int             INT;
-TYPE   int             VOID;
-TYPE   long int        L_INT;
-TYPE   float           REAL;
-TYPE   double          L_REAL;
-TYPE   unsigned        POS;
-TYPE   char            BOOL;
-TYPE   char            CHAR;
-TYPE   char            *STRING;
-TYPE   char            MSG[];
-TYPE   struct map      MAP;
-TYPE   MAP             *MAPPTR;
-TYPE   struct symtab   SYMTAB;
-TYPE   SYMTAB          *SYMPTR;
-TYPE   struct symslave SYMSLAVE;
-TYPE   struct bkpt     BKPT;
-TYPE   BKPT            *BKPTR;
-
-
-/* file address maps */
-struct map {
-       L_INT   b1;
-       L_INT   e1;
-       L_INT   f1;
-       L_INT   b2;
-       L_INT   e2;
-       L_INT   f2;
-       INT     ufd;
-};
-
-
-/* slave table for symbols */
-struct symslave {
-       SYMV    valslave;
-       INT     typslave;
-};
-
-struct bkpt {
-       INT     loc;
-       INT     ins;
-       INT     count;
-       INT     initcnt;
-       INT     flag;
-       CHAR    comm[MAXCOM];
-       BKPT    *nxtbkpt;
-};
-
-TYPE   struct reglist  REGLIST;
-TYPE   REGLIST         *REGPTR;
-struct reglist {
-       STRING  rname;
-       INT     roffs;
-};
-
-struct {
-       INT     junk[2];
-       INT     fpsr;
-       REAL    Sfr[6];
-};
-
-struct {
-       INT     junk[2];
-       INT     fpsr;
-       L_REAL  Lfr[6];
-};
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/opset.c b/.ref-Research-V7/usr/src/cmd/adb/opset.c
deleted file mode 100644 (file)
index e74b181..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-STRING         errflg;
-L_INT          dot;
-INT            dotinc;
-L_INT          var[];
-
-
-/* instruction printing */
-
-#define        DOUBLE  0
-#define DOUBLW 1
-#define        SINGLE  2
-#define SINGLW 3
-#define        REVERS  4
-#define        BRANCH  5
-#define        NOADDR  6
-#define        DFAULT  7
-#define        TRAP    8
-#define        SYS     9
-#define        SOB     10
-#define JMP    11
-#define JSR    12
-
-
-TYPE   struct optab    *OPTAB;
-struct optab {
-       int     mask;
-       int     val;
-       int     itype;
-       char    *iname;
-} optab[] {
-       0107777, 0010000, DOUBLE, "mov",
-       0107777, 0020000, DOUBLE, "cmp",
-       0107777, 0030000, DOUBLE, "bit",
-       0107777, 0040000, DOUBLE, "bic",
-       0107777, 0050000, DOUBLE, "bis",
-       0007777, 0060000, DOUBLE, "add",
-       0007777, 0160000, DOUBLE, "su",
-       0100077, 0005000, SINGLE, "clr",
-       0100077, 0005100, SINGLE, "com",
-       0100077, 0005200, SINGLE, "inc",
-       0100077, 0005300, SINGLE, "dec",
-       0100077, 0005400, SINGLE, "neg",
-       0100077, 0005500, SINGLE, "adc",
-       0100077, 0005600, SINGLE, "sbc",
-       0100077, 0005700, SINGLE, "tst",
-       0100077, 0006000, SINGLE, "ror",
-       0100077, 0006100, SINGLE, "rol",
-       0100077, 0006200, SINGLE, "asr",
-       0100077, 0006300, SINGLE, "asl",
-       0000077, 0000100, JMP,    "jmp",
-       0000077, 0000300, SINGLE, "swab",
-       0000077, 0170100, SINGLW, "ldfps",
-       0000077, 0170200, SINGLW, "stfps",
-       0000077, 0170300, SINGLW, "stst",
-       0000077, 0170400, SINGLW, "clrf",
-       0000077, 0170500, SINGLW, "tstf",
-       0000077, 0170600, SINGLW, "absf",
-       0000077, 0170700, SINGLW, "negf",
-       0000077, 0006700, SINGLW, "sxt",
-       0000077, 0006600, SINGLW, "mtpi",
-       0000077, 0106600, SINGLW, "mtpd",
-       0000077, 0006500, SINGLW, "mfpi",
-       0000077, 0106500, SINGLW, "mfpd",
-       0000777, 0070000, REVERS, "mul",
-       0000777, 0071000, REVERS, "div",
-       0000777, 0072000, REVERS, "ash",
-       0000777, 0073000, REVERS, "ashc",
-       LOBYTE,  0000400, BRANCH, "br",
-       LOBYTE,  0001000, BRANCH, "bne",
-       LOBYTE,  0001400, BRANCH, "beq",
-       LOBYTE,  0002000, BRANCH, "bge",
-       LOBYTE,  0002400, BRANCH, "blt",
-       LOBYTE,  0003000, BRANCH, "bgt",
-       LOBYTE,  0003400, BRANCH, "ble",
-       LOBYTE,  0100000, BRANCH, "bpl",
-       LOBYTE,  0100400, BRANCH, "bmi",
-       LOBYTE,  0101000, BRANCH, "bhi",
-       LOBYTE,  0101400, BRANCH, "blos",
-       LOBYTE,  0102000, BRANCH, "bvc",
-       LOBYTE,  0102400, BRANCH, "bvs",
-       LOBYTE,  0103000, BRANCH, "bcc",
-       LOBYTE,  0103400, BRANCH, "bcs",
-       0000000, 0000000, NOADDR, "halt",
-       0000000, 0000001, NOADDR, "wait",
-       0000000, 0000002, NOADDR, "rti",
-       0000000, 0000003, NOADDR, "bpt",
-       0000000, 0000004, NOADDR, "iot",
-       0000000, 0000005, NOADDR, "reset",
-       LOBYTE,  0171000, REVERS, "mulf",
-       LOBYTE,  0171400, REVERS, "modf",
-       LOBYTE,  0172000, REVERS, "addf",
-       LOBYTE,  0172400, REVERS, "movf",
-       LOBYTE,  0173000, REVERS, "subf",
-       LOBYTE,  0173400, REVERS, "cmpf",
-       LOBYTE,  0174000, DOUBLW, "movf",
-       LOBYTE,  0174400, REVERS, "divf",
-       LOBYTE,  0175000, DOUBLW, "movei",
-       LOBYTE,  0175400, DOUBLW, "movfi",
-       LOBYTE,  0176000, DOUBLW, "movfo",
-       LOBYTE,  0176400, REVERS, "movie",
-       LOBYTE,  0177000, REVERS, "movif",
-       LOBYTE,  0177400, REVERS, "movof",
-       0000000, 0170000, NOADDR, "cfcc",
-       0000000, 0170001, NOADDR, "setf",
-       0000000, 0170002, NOADDR, "seti",
-       0000000, 0170011, NOADDR, "setd",
-       0000000, 0170012, NOADDR, "setl",
-       0000777, 0004000, JSR,    "jsr",
-       0000777, 0074000, DOUBLE, "xor",
-       0000007, 0000200, SINGLE, "rts",
-       0000017, 0000240, DFAULT, "cflg",
-       0000017, 0000260, DFAULT, "sflg",
-       LOBYTE,  0104000, TRAP,   "emt",
-       LOBYTE,  0104400, SYS,    "sys",
-       0000077, 0006400, TRAP,   "mark",
-       0000777, 0077000, SOB,    "sob",
-       0000007, 0000230, TRAP,   "spl",
-       0177777, 0000000, DFAULT, "",
-};
-
-#define SYSTAB struct systab
-SYSTAB {
-       int     argc;
-       char    *sname;
-} systab[] {
-       1, "indir",
-       0, "exit",
-       0, "fork",
-       2, "read",
-       2, "write",
-       2, "open",
-       0, "close",
-       0, "wait",
-       2, "creat",
-       2, "link",
-       1, "unlink",
-       2, "exec",
-       1, "chdir",
-       0, "time",
-       3, "mknod",
-       2, "chmod",
-       2, "chown",
-       1, "break",
-       2, "stat",
-       2, "seek",
-       0, "getpid",
-       3, "mount",
-       1, "umount",
-       0, "setuid",
-       0, "getuid",
-       0, "stime",
-       3, "ptrace",
-       0, "alarm",
-       1, "fstat",
-       0, "pause",
-       1, "30",
-       1, "stty",
-       1, "gtty",
-       0, "access",
-       0, "nice",
-       0, "sleep",
-       0, "sync",
-       1, "kill",
-       0, "csw",
-       0, "setpgrp",
-       0, "tell",
-       0, "dup",
-       0, "pipe",
-       1, "times",
-       4, "profil",
-       0, "tiu",
-       0, "setgid",
-       0, "getgid",
-       2, "signal",
-       0, "49",
-       0, "50",
-       0, "51",
-       0, "52",
-       0, "53",
-       0, "54",
-       0, "55",
-       0, "56",
-       0, "57",
-       0, "58",
-       0, "59",
-       0, "60",
-       0, "61",
-       0, "62",
-       0, "63",
-};
-
-STRING regname[] { "r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc"};
-
-POS    type, space, incp;
-
-printins(f,idsp,ins)
-REG INT                ins;
-{
-       INT             byte;
-       REG OPTAB       p;
-
-       type=DSYM; space=idsp; incp=2;
-       FOR p=optab;; p++
-       DO      IF (ins & ~p->mask) == p->val
-               THEN    break;
-               FI
-       OD
-       prints(p->iname); byte=ins&0100000; ins &= p->mask;
-       switch (p->itype) {
-
-           case JMP:
-               type=ISYM;
-
-           case SINGLE:
-               IF byte THEN printc('b'); FI
-           case SINGLW:
-               paddr("%8t",ins);
-               break;
-
-           case REVERS:
-               doubl(ins&077,(ins>>6)&07);
-               break;
-
-           case JSR:
-               type=ISYM;
-
-           case DOUBLE:
-               IF byte THEN printc('b'); FI
-           case DOUBLW:
-               doubl(ins>>6,ins);
-
-           case NOADDR:
-               break;
-
-           case SOB:
-               paddr("%8t",(ins>>6)&07);
-               branch(",",-(ins&077));
-               break;
-
-           case BRANCH:
-               branch("%8t",ins);
-               break;
-
-           case SYS:
-               BEGIN
-                  INT          indir;
-                  REG INT      w;
-                  printf("%8t%s", systab[ins &= 077].sname);
-                  IF ins==0 ANDF f==0 ANDF idsp!=NSP   /* indir */
-                  THEN w=dot; dot=chkget(inkdot(2),idsp);
-                       prints(" {");
-                       indir=get(dot,DSP);
-                       IF errflg
-                       THEN errflg=0; printc('?');
-                       ELSE printins(1,DSP,indir);
-                       FI
-                       printc('}');
-                       dot=w; incp=4;
-                  ELSE w = systab[ins].argc;
-                       WHILE w-- ANDF idsp!=NSP
-                       DO prints("; ");
-                          psymoff(leng(get(inkdot(incp),idsp)), NSYM, "");
-                          incp += 2;
-                       OD
-                  FI
-               END
-               break;
-
-           case TRAP:
-           case DFAULT:
-           default:
-               printf("%8t%o", ins);
-       }
-       dotinc=incp;
-}
-
-doubl(a,b)
-{
-       paddr("%8t",a); paddr(",",b);
-}
-
-branch(s,ins)
-STRING         s;
-REG INT                ins;
-{
-       printf(s);
-       IF ins&0200 THEN ins |= 0177400; FI
-       ins = shorten(dot) + (ins<<1) + 2;
-       psymoff(leng(ins),ISYM,"");
-}
-
-paddr(s, a)
-STRING         s;
-REG INT                a;
-{
-       REG INT         r;
-
-       var[2]=var[1];
-       r = a&07; a &= 070;
-
-       printf(s);
-       IF r==7 ANDF a&020
-       THEN IF a&010 THEN printc('*'); FI
-            IF a&040
-            THEN IF space==NSP
-                 THEN printc('?');
-                 ELSE  var[1]=chkget(inkdot(incp),space) + shorten(inkdot(incp+2));
-                      psymoff(var[1],(a&010?DSYM:type),"");
-                 FI
-            ELSE printc('$');
-                 IF space==NSP
-                 THEN printc('?');
-                 ELSE var[1]=chkget(inkdot(incp), space);
-                       psymoff(var[1], (a&010?type:NSYM), "");
-                 FI
-            FI
-            incp += 2;
-            return;
-       FI
-       r = regname[r];
-       switch (a) {
-           /* r */
-           case 000:
-               prints(r);
-               return;
-
-           /* (r) */
-           case 010:
-               printf("(%s)", r);
-               return;
-
-           /* *(r)+ */
-           case 030:
-               printc('*');
-
-           /* (r)+ */
-           case 020:
-               printf("(%s)+", r);
-               return;
-
-           /* *-(r) */
-           case 050:
-               printc('*');
-
-           /* -(r) */
-           case 040:
-               printf("-(%s)", r);
-               return;
-
-           /* *x(r) */
-           case 070:
-               printc('*');
-
-           /* x(r) */
-           case 060:
-               IF space==NSP
-               THEN printc('?');
-               ELSE    var[1]=chkget(inkdot(incp), space);
-                       psymoff(var[1], (a==070?type:NSYM), "");
-               FI
-               incp += 2;
-               printf("(%s)", r);
-               return;
-       }
-}
-
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/output.c b/.ref-Research-V7/usr/src/cmd/adb/output.c
deleted file mode 100644 (file)
index 24e4893..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-INT            mkfault;
-INT            infile;
-INT            outfile 1;
-INT            maxpos;
-
-CHAR           printbuf[MAXLIN];
-CHAR           *printptr printbuf;
-CHAR           *digitptr;
-
-
-eqstr(s1, s2)
-       REG STRING      s1, s2;
-{
-       REG STRING       es1;
-       es1 = s1+8;
-       WHILE *s1++ == *s2
-       DO IF *s2++ == 0 ORF s1>=es1
-          THEN return(1);
-          FI
-       OD
-       return(0);
-}
-
-length(s)
-       STRING          s;
-{
-       INT             n 0;
-       WHILE *s++ DO n++; OD
-       return(n);
-}
-
-printc(c)
-       CHAR            c;
-{
-       CHAR            d;
-       STRING          q;
-       INT             posn, tabs, p;
-
-       IF mkfault
-       THEN    return;
-       ELIF (*printptr=c)==EOR
-       THEN tabs=0; posn=0; q=printbuf;
-            FOR p=0; p<printptr-printbuf; p++
-            DO d=printbuf[p];
-               IF (p&7)==0 ANDF posn
-               THEN tabs++; posn=0;
-               FI
-               IF d==SP
-               THEN posn++;
-               ELSE WHILE tabs>0 DO *q++=TB; tabs--; OD
-                    WHILE posn>0 DO *q++=SP; posn--; OD
-                    *q++=d;
-               FI
-            OD
-            *q++=EOR;
-            write(outfile,printbuf,q-printbuf);
-            printptr=printbuf;
-       ELIF c==TB
-       THEN *printptr++=SP;
-            WHILE (printptr-printbuf)&7 DO *printptr++=SP; OD
-       ELIF c
-       THEN printptr++;
-       FI
-}
-
-charpos()
-{      return(printptr-printbuf);
-}
-
-flushbuf()
-{      IF printptr!=printbuf
-       THEN printc(EOR);
-       FI
-}
-
-printf(fmat,a1)
-       STRING          fmat;
-       STRING          *a1;
-{
-       STRING          fptr, s;
-       INT             *vptr;
-       L_INT           *dptr;
-       L_REAL          *rptr;
-       INT             width, prec;
-       CHAR            c, adj;
-       INT             x, decpt, n;
-       L_INT           lx;
-       CHAR            digits[64];
-
-       fptr = fmat; vptr = &a1;
-
-       WHILE c = *fptr++
-       DO  IF c!='%'
-           THEN printc(c);
-           ELSE IF *fptr=='-' THEN adj='l'; fptr++; ELSE adj='r'; FI
-                width=convert(&fptr);
-                IF *fptr=='.' THEN fptr++; prec=convert(&fptr); ELSE prec = -1; FI
-                digitptr=digits;
-                dptr=rptr=vptr; lx = *dptr; x = *vptr++;
-                s=0;
-                switch (c = *fptr++) {
-
-                   case 'd':
-                   case 'u':
-                       printnum(x,c,10); break;
-                   case 'o':
-                       printoct(0,x,0); break;
-                   case 'q':
-                       lx=x; printoct(lx,-1); break;
-                   case 'x':
-                       printdbl(0,x,c,16); break;
-                   case 'Y':
-                       printdate(lx); vptr++; break;
-                   case 'D':
-                   case 'U':
-                       printdbl(lx,c,10); vptr++; break;
-                   case 'O':
-                       printoct(lx,0); vptr++; break;
-                   case 'Q':
-                       printoct(lx,-1); vptr++; break;
-                   case 'X':
-                       printdbl(lx,'x',16); vptr++; break;
-                   case 'c':
-                       printc(x); break;
-                   case 's':
-                       s=x; break;
-                   case 'f':
-                   case 'F':
-                       vptr += 7;
-                       s=ecvt(*rptr, prec, &decpt, &n);
-                       *digitptr++=(n?'-':'+');
-                       *digitptr++ = (decpt<=0 ? '0' : *s++);
-                       IF decpt>0 THEN decpt--; FI
-                       *digitptr++ = '.';
-                       WHILE *s ANDF prec-- DO *digitptr++ = *s++; OD
-                       WHILE *--digitptr=='0' DONE
-                       digitptr += (digitptr-digits>=3 ? 1 : 2);
-                       IF decpt
-                       THEN *digitptr++ = 'e'; printnum(decpt,'d',10);
-                       FI
-                       s=0; prec = -1; break;
-                   case 'm':
-                       vptr--; break;
-                   case 'M':
-                       width=x; break;
-                   case 'T':
-                   case 't':
-                       IF c=='T'
-                       THEN width=x;
-                       ELSE vptr--;
-                       FI
-                       IF width
-                       THEN width -= charpos()%width;
-                       FI
-                       break;
-                   default:
-                       printc(c); vptr--;
-               }
-
-               IF s==0
-               THEN *digitptr=0; s=digits;
-               FI
-               n=length(s);
-               n=(prec<n ANDF prec>=0 ? prec : n);
-               width -= n;
-               IF adj=='r'
-               THEN WHILE width-- > 0
-                    DO printc(SP); OD
-               FI
-               WHILE n-- DO printc(*s++); OD
-               WHILE width-- > 0 DO printc(SP); OD
-               digitptr=digits;
-           FI
-       OD
-}
-
-printdate(tvec)
-       L_INT           tvec;
-{
-       REG INT         i;
-       REG STRING      timeptr;
-       timeptr = ctime(&tvec);
-       FOR i=20; i<24; i++ DO *digitptr++ = *(timeptr+i); OD
-       FOR i=3; i<19; i++ DO *digitptr++ = *(timeptr+i); OD
-} /*printdate*/
-
-prints(s)
-char *s;
-{      printf("%s",s);
-}
-
-newline()
-{
-       printc(EOR);
-}
-
-convert(cp)
-REG STRING     *cp;
-{
-       REG CHAR        c;
-       INT             n;
-       n=0;
-       WHILE ((c = *(*cp)++)>='0') ANDF (c<='9') DO n=n*10+c-'0'; OD
-       (*cp)--;
-       return(n);
-}
-
-printnum(n,fmat,base)
-       REG INT         n;
-{
-       REG CHAR        k;
-       REG INT         *dptr;
-       INT             digs[15];
-       dptr=digs;
-       IF n<0 ANDF fmat=='d' THEN n = -n; *digitptr++ = '-'; FI
-       WHILE n
-       DO  *dptr++ = ((POS)n)%base;
-           n=((POS)n)/base;
-       OD
-       IF dptr==digs THEN *dptr++=0; FI
-       WHILE dptr!=digs
-       DO  k = *--dptr;
-           *digitptr++ = (k+(k<=9 ? '0' : 'a'-10));
-       OD
-}
-
-printoct(o,s)
-       L_INT           o;
-       INT             s;
-{
-       INT             i;
-       L_INT           po = o;
-       CHAR            digs[12];
-
-       IF s
-       THEN IF po<0
-            THEN po = -po; *digitptr++='-';
-            ELSE IF s>0 THEN *digitptr++='+'; FI
-            FI
-       FI
-       FOR i=0;i<=11;i++
-       DO digs[i] = po&7; po =>> 3; OD
-       digs[10] &= 03; digs[11]=0;
-       FOR i=11;i>=0;i--
-       DO IF digs[i] THEN break; FI OD
-       FOR i++;i>=0;i--
-       DO *digitptr++=digs[i]+'0'; OD
-}
-
-printdbl(lx,ly,fmat,base)
-INT lx, ly; char fmat; int base;
-{      int digs[20]; int *dptr; char k;
-       L_REAL f ,g; long q;
-       dptr=digs;
-       IF fmat!='D'
-       THEN    f=leng(lx); f *= itol(1,0); f += leng(ly);
-               IF fmat=='x' THEN *digitptr++='#'; FI
-       ELSE    f=itol(lx,ly);
-               IF f<0 THEN *digitptr++='-'; f = -f; FI
-       FI
-       WHILE f
-       DO  q=f/base; g=q;
-           *dptr++ = f-g*base;
-           f=q;
-       OD
-       IF dptr==digs THEN *dptr++=0; FI
-       WHILE dptr!=digs
-       DO  k = *--dptr;
-           *digitptr++ = (k+(k<=9 ? '0' : 'a'-10));
-       OD
-}
-
-iclose()
-{
-       IF infile
-       THEN    close(infile); infile=0;
-       FI
-}
-
-oclose()
-{
-       IF outfile!=1
-       THEN    flushbuf(); close(outfile); outfile=1;
-       FI
-}
-
-endline()
-{
-       IF charpos()>=maxpos
-       THEN printf("\n");
-       FI
-}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/pcs.c b/.ref-Research-V7/usr/src/cmd/adb/pcs.c
deleted file mode 100644 (file)
index 983a4b4..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            NOBKPT;
-MSG            SZBKPT;
-MSG            EXBKPT;
-MSG            NOPCS;
-MSG            BADMOD;
-
-/* breakpoints */
-BKPTR          bkpthead;
-
-CHAR           *lp;
-CHAR           lastc;
-POS            corhdr[512];
-POS            *endhdr;
-
-INT            signo;
-L_INT          dot;
-INT            pid;
-L_INT          cntval;
-L_INT          loopcnt;
-
-
-
-/* sub process control */
-
-subpcs(modif)
-{
-       REG INT         check;
-       INT             execsig;
-       INT             runmode;
-       REG BKPTR       bkptr;
-       STRING          comptr;
-       execsig=0; loopcnt=cntval;
-
-       switch(modif) {
-
-           /* delete breakpoint */
-           case 'd': case 'D':
-               IF (bkptr=scanbkpt(shorten(dot)))
-               THEN bkptr->flag=0; return;
-               ELSE error(NOBKPT);
-               FI
-
-           /* set breakpoint */
-           case 'b': case 'B':
-               IF (bkptr=scanbkpt(shorten(dot)))
-               THEN bkptr->flag=0;
-               FI
-               FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt
-               DO IF bkptr->flag == 0
-                  THEN break;
-                  FI
-               OD
-               IF bkptr==0
-               THEN IF (bkptr=sbrk(sizeof *bkptr)) == -1
-                    THEN error(SZBKPT);
-                    ELSE bkptr->nxtbkpt=bkpthead;
-                         bkpthead=bkptr;
-                    FI
-               FI
-               bkptr->loc = dot;
-               bkptr->initcnt = bkptr->count = cntval;
-               bkptr->flag = BKPTSET;
-               check=MAXCOM-1; comptr=bkptr->comm; rdc(); lp--;
-               REP *comptr++ = readchar();
-               PER check-- ANDF lastc!=EOR DONE
-               *comptr=0; lp--;
-               IF check
-               THEN return;
-               ELSE error(EXBKPT);
-               FI
-
-           /* exit */
-           case 'k' :case 'K':
-               IF pid
-               THEN printf("%d: killed", pid); endpcs(); return;
-               FI
-               error(NOPCS);
-
-           /* run program */
-           case 'r': case 'R':
-               endpcs();
-               setup();
-               runmode=CONTIN;
-               break;
-
-           /* single step */
-           case 's': case 'S':
-               runmode=SINGLE;
-               IF pid
-               THEN execsig=getsig(signo);
-               ELSE setup(); loopcnt--;
-               FI
-               break;
-
-           /* continue with optional signal */
-           case 'c': case 'C': case 0:
-               IF pid==0 THEN error(NOPCS); FI
-               runmode=CONTIN;
-               execsig=getsig(signo);
-               break;
-
-           default: error(BADMOD);
-       }
-
-       IF loopcnt>0 ANDF runpcs(runmode, execsig)
-       THEN printf("breakpoint%16t");
-       ELSE printf("stopped at%16t");
-       FI
-       delbp();
-       printpc();
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/print.c b/.ref-Research-V7/usr/src/cmd/adb/print.c
deleted file mode 100644 (file)
index e82d4bf..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            LONGFIL;
-MSG            NOTOPEN;
-MSG            A68BAD;
-MSG            A68LNK;
-MSG            BADMOD;
-
-MAP            txtmap;
-MAP            datmap;
-
-SYMTAB         symbol;
-INT            lastframe;
-INT            callpc;
-
-INT            infile;
-INT            outfile;
-CHAR           *lp;
-INT            maxoff;
-INT            maxpos;
-INT            octal;
-
-/* symbol management */
-L_INT          localval;
-
-/* breakpoints */
-BKPTR          bkpthead;
-
-REGLIST reglist [] {
-               "ps", ps,
-               "pc", pc,
-               "sp", sp,
-               "r5", r5,
-               "r4", r4,
-               "r3", r3,
-               "r2", r2,
-               "r1", r1,
-               "r0", r0,
-};
-
-INT            frnames[] { 0, 3, 4, 5, 1, 2 };
-
-char           lastc;
-POS            corhdr[];
-POS            *endhdr;
-
-INT            fcor;
-STRING         errflg;
-INT            signo;
-
-
-L_INT          dot;
-L_INT          var[];
-STRING         symfil;
-STRING         corfil;
-INT            pid;
-L_INT          adrval;
-INT            adrflg;
-L_INT          cntval;
-INT            cntflg;
-
-STRING         signals[] {
-               "",
-               "hangup",
-               "interrupt",
-               "quit",
-               "illegal instruction",
-               "trace/BPT",
-               "IOT",
-               "EMT",
-               "floating exception",
-               "killed",
-               "bus error",
-               "memory fault",
-               "bad system call",
-               "broken pipe",
-               "alarm call",
-               "terminated",
-};
-
-
-
-
-/* general printing routines ($) */
-
-printtrace(modif)
-{
-       INT             narg, i, stat, name, limit;
-       POS             dynam;
-       REG BKPTR       bkptr;
-       CHAR            hi, lo;
-       INT             word;
-       STRING          comptr;
-       L_INT           argp, frame, link;
-       SYMPTR          symp;
-
-       IF cntflg==0 THEN cntval = -1; FI
-
-       switch (modif) {
-
-           case '<':
-           case '>':
-               {CHAR           file[64];
-               INT             index;
-
-               index=0;
-               IF modif=='<'
-               THEN    iclose();
-               ELSE    oclose();
-               FI
-               IF rdc()!=EOR
-               THEN    REP file[index++]=lastc;
-                           IF index>=63 THEN error(LONGFIL); FI
-                       PER readchar()!=EOR DONE
-                       file[index]=0;
-                       IF modif=='<'
-                       THEN    infile=open(file,0);
-                               IF infile<0
-                               THEN    infile=0; error(NOTOPEN);
-                               FI
-                       ELSE    outfile=open(file,1);
-                               IF outfile<0
-                               THEN    outfile=creat(file,0644);
-                               ELSE    lseek(outfile,0L,2);
-                               FI
-                       FI
-
-               FI
-               lp--;
-               }
-               break;
-
-           case 'o':
-               octal = TRUE; break;
-
-           case 'd':
-               octal = FALSE; break;
-
-           case 'q': case 'Q': case '%':
-               done();
-
-           case 'w': case 'W':
-               maxpos=(adrflg?adrval:MAXPOS);
-               break;
-
-           case 's': case 'S':
-               maxoff=(adrflg?adrval:MAXOFF);
-               break;
-
-           case 'v': case 'V':
-               prints("variables\n");
-               FOR i=0;i<=35;i++
-               DO IF var[i]
-                  THEN printc((i<=9 ? '0' : 'a'-10) + i);
-                       printf(" = %Q\n",var[i]);
-                  FI
-               OD
-               break;
-
-           case 'm': case 'M':
-               printmap("? map",&txtmap);
-               printmap("/ map",&datmap);
-               break;
-
-           case 0: case '?':
-               IF pid
-               THEN printf("pcs id = %d\n",pid);
-               ELSE prints("no process\n");
-               FI
-               sigprint(); flushbuf();
-
-           case 'r': case 'R':
-               printregs();
-               return;
-
-           case 'f': case 'F':
-               printfregs(modif=='F');
-               return;
-
-           case 'c': case 'C':
-               frame=(adrflg?adrval:endhdr[r5])&EVEN; lastframe=0;
-               callpc=(adrflg?get(frame+2,DSP):endhdr[pc]);
-               WHILE cntval--
-               DO      chkerr();
-                       narg = findroutine(frame);
-                       printf("%.8s(", symbol.symc);
-                       argp = frame+4;
-                       IF --narg >= 0
-                       THEN    printf("%o", get(argp, DSP));
-                       FI
-                       WHILE --narg >= 0
-                       DO      argp += 2;
-                               printf(",%o", get(argp, DSP));
-                       OD
-                       prints(")\n");
-
-                       IF modif=='C'
-                       THEN WHILE localsym(frame)
-                            DO word=get(localval,DSP);
-                               printf("%8t%.8s:%10t", symbol.symc);
-                               IF errflg THEN prints("?\n"); errflg=0; ELSE printf("%o\n",word); FI
-                            OD
-                       FI
-
-                       lastframe=frame;
-                       frame=get(frame, DSP)&EVEN;
-                       IF frame==0 THEN break; FI
-               OD
-               break;
-
-           /*print externals*/
-           case 'e': case 'E':
-               symset();
-               WHILE (symp=symget())
-               DO chkerr();
-                  IF (symp->symf)==043 ORF (symp->symf)==044
-                  THEN printf("%.8s:%12t%o\n", symp->symc, get(leng(symp->symv),DSP));
-                  FI
-               OD
-               break;
-
-           case 'a': case 'A':
-               frame=(adrflg ? adrval : endhdr[r4]);
-
-               WHILE cntval--
-               DO chkerr();
-                  stat=get(frame,DSP); dynam=get(frame+2,DSP); link=get(frame+4,DSP);
-                  IF modif=='A'
-                  THEN printf("%8O:%8t%-8o,%-8o,%-8o",frame,stat,dynam,link);
-                  FI
-                  IF stat==1 THEN break; FI
-                  IF errflg THEN error(A68BAD); FI
-
-                  IF get(link-4,ISP)!=04767
-                  THEN IF get(link-2,ISP)!=04775
-                       THEN error(A68LNK);
-                       ELSE /*compute entry point of routine*/
-                            prints(" ? ");
-                       FI
-                  ELSE printf("%8t");
-                       valpr(name=shorten(link)+get(link-2,ISP),ISYM);
-                       name=get(leng(name-2),ISP);
-                       printf("%8t\""); limit=8;
-                       REP word=get(leng(name),DSP); name += 2;
-                           lo=word&LOBYTE; hi=(word>>8)&LOBYTE;
-                           printc(lo); printc(hi);
-                       PER lo ANDF hi ANDF limit-- DONE
-                       printc('"');
-                  FI
-                  limit=4; i=6; printf("%24targs:%8t");
-                  WHILE limit--
-                  DO printf("%8t%o",get(frame+i,DSP)); i += 2; OD
-                  printc(EOR);
-
-                  frame=dynam;
-               OD
-               errflg=0;
-               flushbuf();
-               break;
-
-           /*set default c frame*/
-           /*print breakpoints*/
-           case 'b': case 'B':
-               printf("breakpoints\ncount%8tbkpt%24tcommand\n");
-               FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt
-               DO IF bkptr->flag
-                  THEN printf("%-8.8d",bkptr->count);
-                       psymoff(leng(bkptr->loc),ISYM,"%24t");
-                       comptr=bkptr->comm;
-                       WHILE *comptr DO printc(*comptr++); OD
-                  FI
-               OD
-               break;
-
-           default: error(BADMOD);
-       }
-
-}
-
-printmap(s,amap)
-STRING s; MAP *amap;
-{
-       int file;
-       file=amap->ufd;
-       printf("%s%12t`%s'\n",s,(file<0 ? "-" : (file==fcor ? corfil : symfil)));
-       printf("b1 = %-16Q",amap->b1);
-       printf("e1 = %-16Q",amap->e1);
-       printf("f1 = %-16Q",amap->f1);
-       printf("\nb2 = %-16Q",amap->b2);
-       printf("e2 = %-16Q",amap->e2);
-       printf("f2 = %-16Q",amap->f2);
-       printc(EOR);
-}
-
-printfregs(longpr)
-{
-       REG i;
-       L_REAL f;
-
-       printf("fpsr    %o\n", corhdr[0].fpsr);
-       FOR i=0; i<FRMAX; i++
-       DO      IF corhdr[0].fpsr&FD ORF longpr /* long mode */
-               THEN    f = corhdr[0].Lfr[frnames[i]];
-               ELSE    f = corhdr[0].Sfr[frnames[i]];
-               FI
-               printf("fr%-8d%-32.18f\n", i, f);
-       OD
-}
-
-printregs()
-{
-       REG REGPTR      p;
-       INT             v;
-
-       FOR p=reglist; p < &reglist[9]; p++
-       DO      printf("%s%8t%o%8t", p->rname, v=endhdr[p->roffs]);
-               valpr(v,(p->roffs==pc?ISYM:DSYM));
-               printc(EOR);
-       OD
-       printpc();
-}
-
-getreg(regnam)
-{
-       REG REGPTR      p;
-       REG STRING      regptr;
-       CHAR            regnxt;
-       regnxt=readchar();
-       FOR p=reglist; p<&reglist[9]; p++
-       DO      regptr=p->rname;
-               IF (regnam == *regptr++) ANDF (regnxt == *regptr)
-               THEN    return(p->roffs);
-               FI
-       OD
-       lp--;
-       return(0);
-}
-
-printpc()
-{
-       dot=endhdr[pc];
-       psymoff(dot,ISYM,":%16t"); printins(0,ISP,chkget(dot,ISP));
-       printc(EOR);
-}
-
-sigprint()
-{
-       prints(signals[signo]);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/runpcs.c b/.ref-Research-V7/usr/src/cmd/adb/runpcs.c
deleted file mode 100644 (file)
index 821554f..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            NOFORK;
-MSG            ENDPCS;
-MSG            BADWAIT;
-
-CHAR           *lp;
-INT            sigint;
-INT            sigqit;
-
-/* breakpoints */
-BKPTR          bkpthead;
-
-REGLIST                reglist[];
-
-CHAR           lastc;
-POS            corhdr[];
-POS            *endhdr;
-
-INT            fcor;
-INT            fsym;
-STRING         errflg;
-INT            errno;
-INT            signo;
-
-L_INT          dot;
-STRING         symfil;
-INT            wtflag;
-INT            pid;
-L_INT          expv;
-INT            adrflg;
-L_INT          loopcnt;
-
-
-
-
-
-/* service routines for sub process control */
-
-getsig(sig)
-{      return(expr(0) ? shorten(expv) : sig);
-}
-
-INT            userpc=1;
-
-runpcs(runmode, execsig)
-{
-       INT             rc;
-       REG BKPTR       bkpt;
-       IF adrflg
-       THEN userpc=shorten(dot);
-       FI
-       setbp();
-       printf("%s: running\n", symfil);
-
-       WHILE (loopcnt--)>0
-       DO
-#ifdef DEBUG
-               printf("\ncontinue %d %d\n",userpc,execsig);
-#endif
-               stty(0,&usrtty);
-               ptrace(runmode,pid,userpc,execsig);
-               bpwait(); chkerr(); readregs();
-
-               /*look for bkpt*/
-               IF signo==0 ANDF (bkpt=scanbkpt(endhdr[pc]-2))
-               THEN /*stopped at bkpt*/
-                    userpc=endhdr[pc]=bkpt->loc;
-                    IF bkpt->flag==BKPTEXEC
-                       ORF ((bkpt->flag=BKPTEXEC, command(bkpt->comm,':')) ANDF --bkpt->count)
-                    THEN execbkpt(bkpt); execsig=0; loopcnt++;
-                         userpc=1;
-                    ELSE bkpt->count=bkpt->initcnt;
-                         rc=1;
-                    FI
-               ELSE rc=0; execsig=signo; userpc=1;
-               FI
-       OD
-       return(rc);
-}
-
-endpcs()
-{
-       REG BKPTR       bkptr;
-       IF pid
-       THEN ptrace(EXIT,pid,0,0); pid=0; userpc=1;
-            FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt
-            DO IF bkptr->flag
-               THEN bkptr->flag=BKPTSET;
-               FI
-            OD
-       FI
-}
-
-setup()
-{
-       close(fsym); fsym = -1;
-       IF (pid = fork()) == 0
-       THEN ptrace(SETTRC,0,0,0);
-            signal(SIGINT,sigint); signal(SIGQUIT,sigqit);
-            doexec(); exit(0);
-       ELIF pid == -1
-       THEN error(NOFORK);
-       ELSE bpwait(); readregs(); lp[0]=EOR; lp[1]=0;
-            fsym=open(symfil,wtflag);
-            IF errflg
-            THEN printf("%s: cannot execute\n",symfil);
-                 endpcs(); error(0);
-            FI
-       FI
-}
-
-execbkpt(bkptr)
-BKPTR  bkptr;
-{      INT             bkptloc;
-#ifdef DEBUG
-       printf("exbkpt: %d\n",bkptr->count);
-#endif
-       bkptloc = bkptr->loc;
-       ptrace(WIUSER,pid,bkptloc,bkptr->ins);
-       stty(0,&usrtty);
-       ptrace(SINGLE,pid,bkptloc,0);
-       bpwait(); chkerr();
-       ptrace(WIUSER,pid,bkptloc,BPT);
-       bkptr->flag=BKPTSET;
-}
-
-
-doexec()
-{
-       STRING          argl[MAXARG];
-       CHAR            args[LINSIZ];
-       STRING          p, *ap, filnam;
-       ap=argl; p=args;
-       *ap++=symfil;
-       REP     IF rdc()==EOR THEN break; FI
-               *ap = p;
-               WHILE lastc!=EOR ANDF lastc!=SP ANDF lastc!=TB DO *p++=lastc; readchar(); OD
-               *p++=0; filnam = *ap+1;
-               IF **ap=='<'
-               THEN    close(0);
-                       IF open(filnam,0)<0
-                       THEN    printf("%s: cannot open\n",filnam); exit(0);
-                       FI
-               ELIF **ap=='>'
-               THEN    close(1);
-                       IF creat(filnam,0666)<0
-                       THEN    printf("%s: cannot create\n",filnam); exit(0);
-                       FI
-               ELSE    ap++;
-               FI
-       PER lastc!=EOR DONE
-       *ap++=0;
-       execv(symfil, argl);
-}
-
-BKPTR  scanbkpt(adr)
-{
-       REG BKPTR       bkptr;
-       FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt
-       DO IF bkptr->flag ANDF bkptr->loc==adr
-          THEN break;
-          FI
-       OD
-       return(bkptr);
-}
-
-delbp()
-{
-       REG INT         a;
-       REG BKPTR       bkptr;
-       FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt
-       DO IF bkptr->flag
-          THEN a=bkptr->loc;
-               ptrace(WIUSER,pid,a,bkptr->ins);
-          FI
-       OD
-}
-
-setbp()
-{
-       REG INT         a;
-       REG BKPTR       bkptr;
-
-       FOR bkptr=bkpthead; bkptr; bkptr=bkptr->nxtbkpt
-       DO IF bkptr->flag
-          THEN a = bkptr->loc;
-               bkptr->ins = ptrace(RIUSER, pid, a, 0);
-               ptrace(WIUSER, pid, a, BPT);
-               IF errno
-               THEN prints("cannot set breakpoint: ");
-                    psymoff(leng(bkptr->loc),ISYM,"\n");
-               FI
-          FI
-       OD
-}
-
-bpwait()
-{
-       REG INT w;
-       INT stat;
-
-       signal(SIGINT, 1);
-       WHILE (w = wait(&stat))!=pid ANDF w != -1 DONE
-       signal(SIGINT,sigint);
-       gtty(0,&usrtty);
-       stty(0,&adbtty);
-       IF w == -1
-       THEN pid=0;
-            errflg=BADWAIT;
-       ELIF (stat & 0177) != 0177
-       THEN IF signo = stat&0177
-            THEN sigprint();
-            FI
-            IF stat&0200
-            THEN prints(" - core dumped");
-                 close(fcor);
-                 setcor();
-            FI
-            pid=0;
-            errflg=ENDPCS;
-       ELSE signo = stat>>8;
-            IF signo!=SIGTRC
-            THEN sigprint();
-            ELSE signo=0;
-            FI
-            flushbuf();
-       FI
-}
-
-readregs()
-{
-       /*get REG values from pcs*/
-       REG i;
-       FOR i=0; i<9; i++
-       DO endhdr[reglist[i].roffs] =
-                   ptrace(RUREGS, pid, 2*(512+reglist[i].roffs), 0);
-       OD
-
-       /* REALing poINT                */
-       FOR i=FROFF; i<FRLEN+FROFF; i++
-       DO corhdr[i] = ptrace(RUREGS,pid,i,0); OD
-}
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/adb/setup.c b/.ref-Research-V7/usr/src/cmd/adb/setup.c
deleted file mode 100644 (file)
index 8ed84a8..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            BADNAM;
-MSG            BADMAG;
-
-MAP            txtmap;
-MAP            datmap;
-SYMSLAVE       *symvec;
-INT            wtflag;
-INT            fcor;
-INT            fsym;
-L_INT          maxfile;
-L_INT          maxstor;
-L_INT          txtsiz;
-L_INT          datsiz;
-L_INT          datbas;
-L_INT          stksiz;
-STRING         errflg;
-INT            magic;
-L_INT          symbas;
-L_INT          symnum;
-L_INT          entrypt;
-
-INT            argcount;
-INT            signo;
-POS            corhdr[512];
-POS            *endhdr &corhdr[512];
-
-STRING         symfil  "a.out";
-STRING         corfil  "core";
-
-#define TXTHDRSIZ      (sizeof(txthdr))
-
-setsym()
-{
-       INT             relflg;
-       INT             symval, symflg;
-       SYMSLAVE        *symptr;
-       SYMPTR          symp;
-       TXTHDR          txthdr;
-
-       fsym=getfile(symfil,1);
-       txtmap.ufd=fsym;
-       IF read(fsym, txthdr, TXTHDRSIZ)==TXTHDRSIZ
-       THEN    magic=txthdr[0];
-               IF magic!=0411 ANDF magic!=0410 ANDF magic!=0407 ANDF magic!=0405
-               THEN    magic=0;
-               ELSE    symnum=txthdr[4]/SYMTABSIZ;
-                       txtsiz=txthdr[1];
-                       datsiz=txthdr[2];
-                       symbas=txtsiz+datsiz;
-                       txtmap.b1=0;
-                       txtmap.e1=(magic==0407?symbas:txtsiz);
-                       txtmap.f1 = TXTHDRSIZ;
-                       txtmap.b2=datbas=(magic==0410?round(txtsiz,TXTRNDSIZ):0);
-                       txtmap.e2=txtmap.b2+(magic==0407?symbas:datsiz);
-                       txtmap.f2 = TXTHDRSIZ+(magic==0407?0:txtmap.e1);
-                       entrypt=txthdr[5];
-                       relflg=txthdr[7];
-                       IF relflg!=1 THEN symbas =<< 1; FI
-                       symbas += TXTHDRSIZ;
-
-                       /* set up symvec */
-                       symvec=sbrk(shorten((1+symnum))*sizeof (SYMSLAVE));
-                       IF (symptr=symvec)==-1
-                       THEN    printf("%s\n",BADNAM);
-                               symptr=symvec=sbrk(sizeof (SYMSLAVE));
-                       ELSE    symset();
-                               WHILE (symp=symget()) ANDF errflg==0
-                               DO  symval=symp->symv; symflg=symp->symf;
-                                   symptr->valslave=symval;
-                                   symptr->typslave=SYMTYPE(symflg);
-                                   symptr++;
-                               OD
-                       FI
-                       symptr->typslave=ESYM;
-               FI
-       FI
-       IF magic==0 THEN txtmap.e1=maxfile; FI
-}
-
-setcor()
-{
-       fcor=getfile(corfil,2);
-       datmap.ufd=fcor;
-       IF read(fcor, corhdr, ctob(USIZE))==ctob(USIZE)
-       THEN    txtsiz = corhdr->u_tsize << 6;
-               datsiz = corhdr->u_dsize << 6;
-               stksiz = corhdr->u_ssize << 6;
-               datmap.b1 = datbas = (magic==0410?round(txtsiz,TXTRNDSIZ):0);
-               datmap.e1=(magic==0407?txtsiz:datmap.b1)+datsiz;
-               datmap.f1 = ctob(USIZE);
-               datmap.b2 = maxstor-stksiz;
-               datmap.e2 = maxstor;
-               datmap.f2 = ctob(USIZE)+(magic==0410?datsiz:datmap.e1);
-               IF magic ANDF magic!=corhdr[0].u_exdata.ux_mag
-               THEN    printf("%s\n",BADMAG);
-               FI
-       ELSE    datmap.e1 = maxfile;
-       FI
-}
-
-create(f)
-STRING f;
-{      int fd;
-       IF (fd=creat(f,0644))>=0
-       THEN close(fd); return(open(f,wtflag));
-       ELSE return(-1);
-       FI
-}
-
-getfile(filnam,cnt)
-STRING filnam;
-{
-       REG INT         fsym;
-
-       IF !eqstr("-",filnam)
-       THEN    fsym=open(filnam,wtflag);
-               IF fsym<0 ANDF argcount>cnt
-               THEN    IF wtflag
-                       THEN    fsym=create(filnam);
-                       FI
-                       IF fsym<0
-                       THEN printf("cannot open `%s'\n", filnam);
-                       FI
-               FI
-       ELSE    fsym = -1;
-       FI
-       return(fsym);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/adb/sym.c b/.ref-Research-V7/usr/src/cmd/adb/sym.c
deleted file mode 100644 (file)
index 0ebb0f9..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-/*
- *
- *     UNIX debugger
- *
- */
-
-#include "defs.h"
-
-
-MSG            BADFIL;
-
-SYMTAB         symbol;
-BOOL           localok;
-INT            lastframe;
-SYMSLAVE               *symvec;
-POS            maxoff;
-L_INT          maxstor;
-
-/* symbol management */
-L_INT          symbas;
-L_INT          symcnt;
-L_INT          symnum;
-L_INT          localval;
-char           symrqd -1;
-SYMTAB         symbuf[SYMSIZ];
-SYMPTR         symnxt;
-SYMPTR         symend;
-
-
-INT            fsym;
-STRING         errflg;
-POS            findsym();
-
-
-/* symbol table and file handling service routines */
-
-longseek(f, a)
-L_INT a;
-{
-       return(lseek(f,a,0) != -1);
-}
-
-valpr(v,idsp)
-{
-       POS             d;
-       d = findsym(v,idsp);
-       IF d < maxoff
-       THEN    printf("%.8s", symbol.symc);
-               IF d
-               THEN    printf(OFFMODE, d);
-               FI
-       FI
-}
-
-localsym(cframe)
-L_INT cframe;
-{
-       INT symflg;
-       WHILE nextsym() ANDF localok
-               ANDF symbol.symc[0]!='~'
-               ANDF (symflg=symbol.symf)!=037
-       DO IF symflg>=2 ANDF symflg<=4
-          THEN localval=symbol.symv;
-               return(TRUE);
-          ELIF symflg==1
-          THEN localval=leng(shorten(cframe)+symbol.symv);
-               return(TRUE);
-          ELIF symflg==20 ANDF lastframe
-          THEN localval=leng(lastframe+2*symbol.symv-10);
-               return(TRUE);
-          FI
-       OD
-       return(FALSE);
-}
-psymoff(v,type,s)
-L_INT v; int type; char *s;
-{
-       POS             w;
-       w = findsym(shorten(v),type);
-       IF w >= maxoff
-       THEN printf(LPRMODE,v);
-       ELSE printf("%.8s", symbol.symc);
-            IF w THEN printf(OFFMODE,w); FI
-       FI
-       printf(s);
-}
-
-POS    findsym(svalue,type)
-POS    svalue;
-INT    type;
-{
-       L_INT           diff, value, symval, offset;
-       INT             symtyp;
-       REG SYMSLAVE    *symptr;
-       SYMSLAVE        *symsav;
-       value=svalue; diff = 0377777L; symsav=0;
-       IF type!=NSYM ANDF (symptr=symvec)
-       THEN    WHILE diff ANDF (symtyp=symptr->typslave)!=ESYM
-               DO  IF symtyp==type
-                   THEN symval=leng(symptr->valslave);
-                        IF value-symval<diff
-                           ANDF value>=symval
-                        THEN diff = value-symval;
-                             symsav=symptr;
-                        FI
-                   FI
-                   symptr++;
-               OD
-               IF symsav
-               THEN    offset=leng(symsav-symvec);
-                       symcnt=symnum-offset;
-                       longseek(fsym, symbas+offset*SYMTABSIZ);
-                       read(fsym,&symbol,SYMTABSIZ);
-               FI
-       FI
-       return(shorten(diff));
-}
-
-nextsym()
-{
-       IF (--symcnt)<0
-       THEN    return(FALSE);
-       ELSE    return(longseek(fsym, symbas+(symnum-symcnt)*SYMTABSIZ)!=0 ANDF
-                       read(fsym,&symbol,SYMTABSIZ)==SYMTABSIZ);
-       FI
-}
-
-
-
-/* sequential search through file */
-symset()
-{
-       symcnt = symnum;
-       symnxt = symbuf;
-       IF symrqd
-       THEN    longseek(fsym, symbas);
-               symread(); symrqd=FALSE;
-       ELSE    longseek(fsym, symbas+sizeof symbuf);
-       FI
-}
-
-SYMPTR symget()
-{
-       REG INT rc;
-       IF symnxt >= symend
-       THEN    rc=symread(); symrqd=TRUE;
-       ELSE    rc=TRUE;
-       FI
-       IF --symcnt>0 ANDF rc==0 THEN errflg=BADFIL; FI
-       return( (symcnt>=0 && rc) ? symnxt++ : 0);
-}
-
-symread()
-{
-       INT             symlen;
-
-       IF (symlen=read(fsym,symbuf,sizeof symbuf))>=SYMTABSIZ
-       THEN    symnxt = symbuf;
-               symend = &symbuf[symlen/SYMTABSIZ];
-               return(TRUE);
-       ELSE    return(FALSE);
-       FI
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ar.c b/.ref-Research-V7/usr/src/cmd/ar.c
deleted file mode 100644 (file)
index c499e68..0000000
+++ /dev/null
@@ -1,705 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <ar.h>
-#include <signal.h>
-struct stat    stbuf;
-struct ar_hdr  arbuf;
-
-#define        SKIP    1
-#define        IODD    2
-#define        OODD    4
-#define        HEAD    8
-
-char   *man    =       { "mrxtdpq" };
-char   *opt    =       { "uvnbail" };
-
-int    signum[] = {SIGHUP, SIGINT, SIGQUIT, 0};
-int    sigdone();
-long   lseek();
-int    rcmd();
-int    dcmd();
-int    xcmd();
-int    tcmd();
-int    pcmd();
-int    mcmd();
-int    qcmd();
-int    (*comfun)();
-char   flg[26];
-char   **namv;
-int    namc;
-char   *arnam;
-char   *ponam;
-char   *tmpnam         =       { "/tmp/vXXXXX" };
-char   *tmp1nam        =       { "/tmp/v1XXXXX" };
-char   *tmp2nam        =       { "/tmp/v2XXXXX" };
-char   *tfnam;
-char   *tf1nam;
-char   *tf2nam;
-char   *file;
-char   name[16];
-int    af;
-int    tf;
-int    tf1;
-int    tf2;
-int    qf;
-int    bastate;
-char   buf[512];
-
-char   *trim();
-char   *mktemp();
-char   *ctime();
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-       register char *cp;
-
-       for(i=0; signum[i]; i++)
-               if(signal(signum[i], SIG_IGN) != SIG_IGN)
-                       signal(signum[i], sigdone);
-       if(argc < 3)
-               usage();
-       cp = argv[1];
-       for(cp = argv[1]; *cp; cp++)
-       switch(*cp) {
-       case 'l':
-       case 'v':
-       case 'u':
-       case 'n':
-       case 'a':
-       case 'b':
-       case 'c':
-       case 'i':
-               flg[*cp - 'a']++;
-               continue;
-
-       case 'r':
-               setcom(rcmd);
-               continue;
-
-       case 'd':
-               setcom(dcmd);
-               continue;
-
-       case 'x':
-               setcom(xcmd);
-               continue;
-
-       case 't':
-               setcom(tcmd);
-               continue;
-
-       case 'p':
-               setcom(pcmd);
-               continue;
-
-       case 'm':
-               setcom(mcmd);
-               continue;
-
-       case 'q':
-               setcom(qcmd);
-               continue;
-
-       default:
-               fprintf(stderr, "ar: bad option `%c'\n", *cp);
-               done(1);
-       }
-       if(flg['l'-'a']) {
-               tmpnam = "vXXXXX";
-               tmp1nam = "v1XXXXX";
-               tmp2nam = "v2XXXXX";
-               }
-       if(flg['i'-'a'])
-               flg['b'-'a']++;
-       if(flg['a'-'a'] || flg['b'-'a']) {
-               bastate = 1;
-               ponam = trim(argv[2]);
-               argv++;
-               argc--;
-               if(argc < 3)
-                       usage();
-       }
-       arnam = argv[2];
-       namv = argv+3;
-       namc = argc-3;
-       if(comfun == 0) {
-               if(flg['u'-'a'] == 0) {
-                       fprintf(stderr, "ar: one of [%s] must be specified\n", man);
-                       done(1);
-               }
-               setcom(rcmd);
-       }
-       (*comfun)();
-       done(notfound());
-}
-
-setcom(fun)
-int (*fun)();
-{
-
-       if(comfun != 0) {
-               fprintf(stderr, "ar: only one of [%s] allowed\n", man);
-               done(1);
-       }
-       comfun = fun;
-}
-
-rcmd()
-{
-       register f;
-
-       init();
-       getaf();
-       while(!getdir()) {
-               bamatch();
-               if(namc == 0 || match()) {
-                       f = stats();
-                       if(f < 0) {
-                               if(namc)
-                                       fprintf(stderr, "ar: cannot open %s\n", file);
-                               goto cp;
-                       }
-                       if(flg['u'-'a'])
-                               if(stbuf.st_mtime <= arbuf.ar_date) {
-                                       close(f);
-                                       goto cp;
-                               }
-                       mesg('r');
-                       copyfil(af, -1, IODD+SKIP);
-                       movefil(f);
-                       continue;
-               }
-       cp:
-               mesg('c');
-               copyfil(af, tf, IODD+OODD+HEAD);
-       }
-       cleanup();
-}
-
-dcmd()
-{
-
-       init();
-       if(getaf())
-               noar();
-       while(!getdir()) {
-               if(match()) {
-                       mesg('d');
-                       copyfil(af, -1, IODD+SKIP);
-                       continue;
-               }
-               mesg('c');
-               copyfil(af, tf, IODD+OODD+HEAD);
-       }
-       install();
-}
-
-xcmd()
-{
-       register f;
-
-       if(getaf())
-               noar();
-       while(!getdir()) {
-               if(namc == 0 || match()) {
-                       f = creat(file, arbuf.ar_mode & 0777);
-                       if(f < 0) {
-                               fprintf(stderr, "ar: %s cannot create\n", file);
-                               goto sk;
-                       }
-                       mesg('x');
-                       copyfil(af, f, IODD);
-                       close(f);
-                       continue;
-               }
-       sk:
-               mesg('c');
-               copyfil(af, -1, IODD+SKIP);
-               if (namc > 0  &&  !morefil())
-                       done(0);
-       }
-}
-
-pcmd()
-{
-
-       if(getaf())
-               noar();
-       while(!getdir()) {
-               if(namc == 0 || match()) {
-                       if(flg['v'-'a']) {
-                               printf("\n<%s>\n\n", file);
-                               fflush(stdout);
-                       }
-                       copyfil(af, 1, IODD);
-                       continue;
-               }
-               copyfil(af, -1, IODD+SKIP);
-       }
-}
-
-mcmd()
-{
-
-       init();
-       if(getaf())
-               noar();
-       tf2nam = mktemp(tmp2nam);
-       close(creat(tf2nam, 0600));
-       tf2 = open(tf2nam, 2);
-       if(tf2 < 0) {
-               fprintf(stderr, "ar: cannot create third temp\n");
-               done(1);
-       }
-       while(!getdir()) {
-               bamatch();
-               if(match()) {
-                       mesg('m');
-                       copyfil(af, tf2, IODD+OODD+HEAD);
-                       continue;
-               }
-               mesg('c');
-               copyfil(af, tf, IODD+OODD+HEAD);
-       }
-       install();
-}
-
-tcmd()
-{
-
-       if(getaf())
-               noar();
-       while(!getdir()) {
-               if(namc == 0 || match()) {
-                       if(flg['v'-'a'])
-                               longt();
-                       printf("%s\n", trim(file));
-               }
-               copyfil(af, -1, IODD+SKIP);
-       }
-}
-
-qcmd()
-{
-       register i, f;
-
-       if (flg['a'-'a'] || flg['b'-'a']) {
-               fprintf(stderr, "ar: abi not allowed with q\n");
-               done(1);
-       }
-       getqf();
-       for(i=0; signum[i]; i++)
-               signal(signum[i], SIG_IGN);
-       lseek(qf, 0l, 2);
-       for(i=0; i<namc; i++) {
-               file = namv[i];
-               if(file == 0)
-                       continue;
-               namv[i] = 0;
-               mesg('q');
-               f = stats();
-               if(f < 0) {
-                       fprintf(stderr, "ar: %s cannot open\n", file);
-                       continue;
-               }
-               tf = qf;
-               movefil(f);
-               qf = tf;
-       }
-}
-
-init()
-{
-       static mbuf = ARMAG;
-
-       tfnam = mktemp(tmpnam);
-       close(creat(tfnam, 0600));
-       tf = open(tfnam, 2);
-       if(tf < 0) {
-               fprintf(stderr, "ar: cannot create temp file\n");
-               done(1);
-       }
-       if (write(tf, (char *)&mbuf, sizeof(int)) != sizeof(int))
-               wrerr();
-}
-
-getaf()
-{
-       int mbuf;
-
-       af = open(arnam, 0);
-       if(af < 0)
-               return(1);
-       if (read(af, (char *)&mbuf, sizeof(int)) != sizeof(int) || mbuf!=ARMAG) {
-               fprintf(stderr, "ar: %s not in archive format\n", arnam);
-               done(1);
-       }
-       return(0);
-}
-
-getqf()
-{
-       int mbuf;
-
-       if ((qf = open(arnam, 2)) < 0) {
-               if(!flg['c'-'a'])
-                       fprintf(stderr, "ar: creating %s\n", arnam);
-               close(creat(arnam, 0666));
-               if ((qf = open(arnam, 2)) < 0) {
-                       fprintf(stderr, "ar: cannot create %s\n", arnam);
-                       done(1);
-               }
-               mbuf = ARMAG;
-               if (write(qf, (char *)&mbuf, sizeof(int)) != sizeof(int))
-                       wrerr();
-       }
-       else if (read(qf, (char *)&mbuf, sizeof(int)) != sizeof(int)
-               || mbuf!=ARMAG) {
-               fprintf(stderr, "ar: %s not in archive format\n", arnam);
-               done(1);
-       }
-}
-
-usage()
-{
-       printf("usage: ar [%s][%s] archive files ...\n", opt, man);
-       done(1);
-}
-
-noar()
-{
-
-       fprintf(stderr, "ar: %s does not exist\n", arnam);
-       done(1);
-}
-
-sigdone()
-{
-       done(100);
-}
-
-done(c)
-{
-
-       if(tfnam)
-               unlink(tfnam);
-       if(tf1nam)
-               unlink(tf1nam);
-       if(tf2nam)
-               unlink(tf2nam);
-       exit(c);
-}
-
-notfound()
-{
-       register i, n;
-
-       n = 0;
-       for(i=0; i<namc; i++)
-               if(namv[i]) {
-                       fprintf(stderr, "ar: %s not found\n", namv[i]);
-                       n++;
-               }
-       return(n);
-}
-
-morefil()
-{
-       register i, n;
-
-       n = 0;
-       for(i=0; i<namc; i++)
-               if(namv[i])
-                       n++;
-       return(n);
-}
-
-cleanup()
-{
-       register i, f;
-
-       for(i=0; i<namc; i++) {
-               file = namv[i];
-               if(file == 0)
-                       continue;
-               namv[i] = 0;
-               mesg('a');
-               f = stats();
-               if(f < 0) {
-                       fprintf(stderr, "ar: %s cannot open\n", file);
-                       continue;
-               }
-               movefil(f);
-       }
-       install();
-}
-
-install()
-{
-       register i;
-
-       for(i=0; signum[i]; i++)
-               signal(signum[i], SIG_IGN);
-       if(af < 0)
-               if(!flg['c'-'a'])
-                       fprintf(stderr, "ar: creating %s\n", arnam);
-       close(af);
-       af = creat(arnam, 0666);
-       if(af < 0) {
-               fprintf(stderr, "ar: cannot create %s\n", arnam);
-               done(1);
-       }
-       if(tfnam) {
-               lseek(tf, 0l, 0);
-               while((i = read(tf, buf, 512)) > 0)
-                       if (write(af, buf, i) != i)
-                               wrerr();
-       }
-       if(tf2nam) {
-               lseek(tf2, 0l, 0);
-               while((i = read(tf2, buf, 512)) > 0)
-                       if (write(af, buf, i) != i)
-                               wrerr();
-       }
-       if(tf1nam) {
-               lseek(tf1, 0l, 0);
-               while((i = read(tf1, buf, 512)) > 0)
-                       if (write(af, buf, i) != i)
-                               wrerr();
-       }
-}
-
-/*
- * insert the file 'file'
- * into the temporary file
- */
-movefil(f)
-{
-       register char *cp;
-       register i;
-
-       cp = trim(file);
-       for(i=0; i<14; i++)
-               if(arbuf.ar_name[i] = *cp)
-                       cp++;
-       arbuf.ar_size = stbuf.st_size;
-       arbuf.ar_date = stbuf.st_mtime;
-       arbuf.ar_uid = stbuf.st_uid;
-       arbuf.ar_gid = stbuf.st_gid;
-       arbuf.ar_mode = stbuf.st_mode;
-       copyfil(f, tf, OODD+HEAD);
-       close(f);
-}
-
-stats()
-{
-       register f;
-
-       f = open(file, 0);
-       if(f < 0)
-               return(f);
-       if(fstat(f, &stbuf) < 0) {
-               close(f);
-               return(-1);
-       }
-       return(f);
-}
-
-/*
- * copy next file
- * size given in arbuf
- */
-copyfil(fi, fo, flag)
-{
-       register i, o;
-       int pe;
-
-       if(flag & HEAD)
-               if (write(fo, (char *)&arbuf, sizeof arbuf) != sizeof arbuf)
-                       wrerr();
-       pe = 0;
-       while(arbuf.ar_size > 0) {
-               i = o = 512;
-               if(arbuf.ar_size < i) {
-                       i = o = arbuf.ar_size;
-                       if(i&1) {
-                               if(flag & IODD)
-                                       i++;
-                               if(flag & OODD)
-                                       o++;
-                       }
-               }
-               if(read(fi, buf, i) != i)
-                       pe++;
-               if((flag & SKIP) == 0)
-                       if (write(fo, buf, o) != o)
-                               wrerr();
-               arbuf.ar_size -= 512;
-       }
-       if(pe)
-               phserr();
-}
-
-getdir()
-{
-       register i;
-
-       i = read(af, (char *)&arbuf, sizeof arbuf);
-       if(i != sizeof arbuf) {
-               if(tf1nam) {
-                       i = tf;
-                       tf = tf1;
-                       tf1 = i;
-               }
-               return(1);
-       }
-       for(i=0; i<14; i++)
-               name[i] = arbuf.ar_name[i];
-       file = name;
-       return(0);
-}
-
-match()
-{
-       register i;
-
-       for(i=0; i<namc; i++) {
-               if(namv[i] == 0)
-                       continue;
-               if(strcmp(trim(namv[i]), file) == 0) {
-                       file = namv[i];
-                       namv[i] = 0;
-                       return(1);
-               }
-       }
-       return(0);
-}
-
-bamatch()
-{
-       register f;
-
-       switch(bastate) {
-
-       case 1:
-               if(strcmp(file, ponam) != 0)
-                       return;
-               bastate = 2;
-               if(flg['a'-'a'])
-                       return;
-
-       case 2:
-               bastate = 0;
-               tf1nam = mktemp(tmp1nam);
-               close(creat(tf1nam, 0600));
-               f = open(tf1nam, 2);
-               if(f < 0) {
-                       fprintf(stderr, "ar: cannot create second temp\n");
-                       return;
-               }
-               tf1 = tf;
-               tf = f;
-       }
-}
-
-phserr()
-{
-
-       fprintf(stderr, "ar: phase error on %s\n", file);
-}
-
-mesg(c)
-{
-
-       if(flg['v'-'a'])
-               if(c != 'c' || flg['v'-'a'] > 1)
-                       printf("%c - %s\n", c, file);
-}
-
-char *
-trim(s)
-char *s;
-{
-       register char *p1, *p2;
-
-       for(p1 = s; *p1; p1++)
-               ;
-       while(p1 > s) {
-               if(*--p1 != '/')
-                       break;
-               *p1 = 0;
-       }
-       p2 = s;
-       for(p1 = s; *p1; p1++)
-               if(*p1 == '/')
-                       p2 = p1+1;
-       return(p2);
-}
-
-#define        IFMT    060000
-#define        ISARG   01000
-#define        LARGE   010000
-#define        SUID    04000
-#define        SGID    02000
-#define        ROWN    0400
-#define        WOWN    0200
-#define        XOWN    0100
-#define        RGRP    040
-#define        WGRP    020
-#define        XGRP    010
-#define        ROTH    04
-#define        WOTH    02
-#define        XOTH    01
-#define        STXT    01000
-
-longt()
-{
-       register char *cp;
-
-       pmode();
-       printf("%3d/%1d", arbuf.ar_uid, arbuf.ar_gid);
-       printf("%7D", arbuf.ar_size);
-       cp = ctime(&arbuf.ar_date);
-       printf(" %-12.12s %-4.4s ", cp+4, cp+20);
-}
-
-int    m1[] = { 1, ROWN, 'r', '-' };
-int    m2[] = { 1, WOWN, 'w', '-' };
-int    m3[] = { 2, SUID, 's', XOWN, 'x', '-' };
-int    m4[] = { 1, RGRP, 'r', '-' };
-int    m5[] = { 1, WGRP, 'w', '-' };
-int    m6[] = { 2, SGID, 's', XGRP, 'x', '-' };
-int    m7[] = { 1, ROTH, 'r', '-' };
-int    m8[] = { 1, WOTH, 'w', '-' };
-int    m9[] = { 2, STXT, 't', XOTH, 'x', '-' };
-
-int    *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
-
-pmode()
-{
-       register int **mp;
-
-       for (mp = &m[0]; mp < &m[9];)
-               select(*mp++);
-}
-
-select(pairp)
-int *pairp;
-{
-       register int n, *ap;
-
-       ap = pairp;
-       n = *ap++;
-       while (--n>=0 && (arbuf.ar_mode&*ap++)==0)
-               ap++;
-       putchar(*ap);
-}
-
-wrerr()
-{
-       perror("ar write error");
-       done(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/arcv.c b/.ref-Research-V7/usr/src/cmd/arcv.c
deleted file mode 100644 (file)
index 639afa1..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Convert old to new archive format
-*/
-
-#include <signal.h>
-#include <ar.h>
-
-#define        omag    0177555
-
-struct ar_hdr nh;
-struct
-{
-       char    oname[8];
-       long    odate;
-       char    ouid;
-       char    omode;
-       unsigned siz;
-} oh;
-
-char   *tmp;
-char   *mktemp();
-int    f;
-int    tf;
-union {
-       char    buf[512];
-       int     magic;
-} b;
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-
-       tmp = mktemp("/tmp/arcXXXXX");
-       for(i=1; i<4; i++)
-               signal(i, SIG_IGN);
-       for(i=1; i<argc; i++)
-               conv(argv[i]);
-       unlink(tmp);
-}
-
-conv(fil)
-char *fil;
-{
-       register unsigned i, n;
-
-       f = open(fil, 2);
-       if(f < 0) {
-               printf("arcv: cannot open %s\n", fil);
-               return;
-       }
-       close(creat(tmp, 0600));
-       tf = open(tmp, 2);
-       if(tf < 0) {
-               printf("arcv: cannot open temp\n");
-               close(f);
-               return;
-       }
-       b.magic = 0;
-       read(f, (char *)&b.magic, sizeof(b.magic));
-       if(b.magic != omag) {
-               printf("arcv: %s not archive format\n", fil);
-               close(tf);
-               close(f);
-               return;
-       }
-       b.magic = ARMAG;
-       write(tf, (char *)&b.magic, sizeof(b.magic));
-loop:
-       i = read(f, (char *)&oh, sizeof(oh));
-       if(i != sizeof(oh))
-               goto out;
-       for(i=0; i<8; i++)
-               nh.ar_name[i] = oh.oname[i];
-       nh.ar_size = oh.siz;
-       nh.ar_uid = oh.ouid;
-       nh.ar_gid = 1;
-       nh.ar_mode = 0666;
-       nh.ar_date = oh.odate;
-       n = (oh.siz+1) & ~01;
-       write(tf, (char *)&nh, sizeof(nh));
-       while(n > 0) {
-               i = 512;
-               if(n < i)
-                       i = n;
-               read(f, b.buf, i);
-               write(tf, b.buf, i);
-               n -= i;
-       }
-       goto loop;
-out:
-       lseek(f, 0L, 0);
-       lseek(tf, 0L, 0);
-       while((i=read(tf, b.buf, 512)) > 0)
-               write(f, b.buf, i);
-       close(f);
-       close(tf);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/as/as11.s b/.ref-Research-V7/usr/src/cmd/as/as11.s
deleted file mode 100644 (file)
index a5e5ae9..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/
-/
-
-/ PDP-11 assembler pass 0
-
-       jmp     start
-go:
-       jsr     pc,assem
-       movb    pof,r0
-       sys     write; outbuf; 512.
-       jes     wrterr
-       movb    pof,r0
-       sys     close
-       movb    fbfil,r0
-       sys     close
-       tstb    errflg
-       bne     aexit
-       jsr     r5,fcreat; a.tmp3
-       mov     r0,r1
-       mov     symend,0f
-       sub     $usymtab,0f
-       sys     indir; 9f
-       jes     wrterr
-       .data
-9:     sys     write; usymtab; 0:..
-       .text
-       mov     r1,r0
-       sys     close
-       sys     exec; fpass2; 1f
-       mov     $fpass2,r0
-       jsr     r5,filerr; "?\n
-
-aexit:
-       sys     unlink; a.tmp1
-       sys     unlink; a.tmp2
-       sys     unlink; a.tmp3
-       mov     $3,r0
-       sys     exit
-.data
-1:
-       fpass2
-       globfl
-       outfl
-outfp:
-       outfile
-       a.tmp1
-       a.tmp2
-       a.tmp3
-       0
-fpass2:
-       </lib/as2\0>
-globfl:
-unglob=.+1
-       <-\0\0>
-outfl:
-       <-o\0>
-outfile:
-       <a.out\0>
-3:
-       <-g\0>
-       .even
-       .text
-
-filerr:
-       mov     r4,-(sp)
-       mov     r0,r4
-       mov     r4,0f
-       clr     r0
-1:
-       tstb    (r4)+
-       beq     1f
-       inc     r0
-       br      1b
-1:
-       mov     r0,1f
-       mov     $1,r0
-       sys     indir; 9f
-       .data
-9:     sys     write; 0:0; 1:0
-       .text
-       mov     r5,0f
-       mov     $1,0f+2
-       tstb    1(r5)
-       beq     1f
-       mov     $2,0f+2
-1:
-       mov     $1,r0
-       sys     indir; 9f
-       .data
-9:     sys     write; 0:0; 1
-       .text
-       tst     (r5)+
-       mov     (sp)+,r4
-       rts     r5
-
-fcreat:
-       mov     r4,-(sp)
-       mov     (r5)+,r4
-       mov     r4,0f
-1:
-       sys     indir; 9f
-       .data
-9:     sys     stat; 0:..; outbuf
-       .text
-       bec     2f
-       mov     r4,0f
-       sys     indir; 9f
-       .data
-9:     sys     creat; 0:..; 444
-       .text
-       bes     2f
-       mov     (sp)+,r4
-       rts     r5
-2:
-       incb    9.(r4)
-       cmpb    9.(r4),$'z
-       blos    1b
-       mov     r4,r0
-       jsr     r5,filerr; "?\n
-       mov     $3,r0
-       sys     exit
-
-.=.+2
-wrterr:
-       mov     $1,r0
-       sys     write; 9f; 9f-8f
-       inc     errflg
-       jbr     aexit
-9:     <as: Write error on temp file.\n>; 8:
diff --git a/.ref-Research-V7/usr/src/cmd/as/as12.s b/.ref-Research-V7/usr/src/cmd/as/as12.s
deleted file mode 100644 (file)
index ab555a4..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/
-/
-
-/ a2 -- pdp-11 assembler pass 1
-
-error:
-       incb    errflg
-       mov     r0,-(sp)
-       mov     r1,-(sp)
-       mov     (r5)+,r0
-       tst     *curarg
-       beq     1f
-       mov     r0,-(sp)
-       mov     *curarg,r0
-       clr     *curarg
-       jsr     r5,filerr; '\n
-       mov     (sp)+,r0
-1:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     line,r3
-       movb    r0,1f
-       mov     $1f+6,r0
-       mov     $4,r1
-2:
-       clr     r2
-       dvd     $10.,r2
-       add     $'0,r3
-       movb    r3,-(r0)
-       mov     r2,r3
-       sob     r1,2b
-       mov     $1,r0
-       sys     write; 1f; 7
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       mov     (sp)+,r0
-       rts     r5
-
-       .data
-1:     <f xxxx\n>
-       .even
-       .text
-
-betwen:
-       cmp     r0,(r5)+
-       blt     1f
-       cmp     (r5)+,r0
-       blt     2f
-1:
-       tst     (r5)+
-2:
-       rts     r5
-
-putw:
-       tst     ifflg
-       beq     1f
-       cmp     r4,$'\n
-       bne     2f
-1:
-       mov     r4,*obufp
-       add     $2,obufp
-       cmp     obufp,$outbuf+512.
-       blo     2f
-       mov     $outbuf,obufp
-       movb    pof,r0
-       sys     write; outbuf; 512.
-       jes     wrterr
-2:
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as13.s b/.ref-Research-V7/usr/src/cmd/as/as13.s
deleted file mode 100644 (file)
index 9e49eba..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/
-/
-
-/ a3 -- pdp-11 assembler pass 1
-
-assem:
-       jsr     pc,readop
-       jsr     pc,checkeos
-               br ealoop
-       tst     ifflg
-       beq     3f
-       cmp     r4,$200
-       blos    assem
-       cmpb    (r4),$21        /if
-       bne     2f
-       inc     ifflg
-2:
-       cmpb    (r4),$22   /endif
-       bne     assem
-       dec     ifflg
-       br      assem
-3:
-       mov     r4,-(sp)
-       jsr     pc,readop
-       cmp     r4,$'=
-       beq     4f
-       cmp     r4,$':
-       beq     1f
-       mov     r4,savop
-       mov     (sp)+,r4
-       jsr     pc,opline
-       br      ealoop
-1:
-       mov     (sp)+,r4
-       cmp     r4,$200
-       bhis    1f
-       cmp     r4,$1           / digit
-       beq     3f
-       jsr     r5,error; 'x
-       br      assem
-1:
-       bitb    $37,(r4)
-       beq     1f
-       jsr     r5,error; 'm
-1:
-       bisb    dot-2,(r4)
-       mov     dot,2(r4)
-       br      assem
-3:
-       mov     numval,r0
-       jsr     pc,fbcheck
-       movb    dotrel,curfbr(r0)
-       asl     r0
-       movb    dotrel,nxtfb
-       mov     dot,nxtfb+2
-       movb    r0,nxtfb+1
-       mov     dot,curfb(r0)
-       movb    fbfil,r0
-       sys     write; nxtfb; 4
-       jes     wrterr
-       br      assem
-4:
-       jsr     pc,readop
-       jsr     pc,expres
-       mov     (sp)+,r1
-       cmp     r1,$200
-       bhis    1f
-       jsr     r5,error; 'x
-       br      ealoop
-1:
-       cmp     r1,$dotrel
-       bne     2f
-       bic     $40,r3
-       cmp     r3,dotrel
-       bne     1f
-2:
-       bicb    $37,(r1)
-       bic     $!37,r3
-       bne     2f
-       clr     r2
-2:
-       bisb    r3,(r1)
-       mov     r2,2(r1)
-       br      ealoop
-1:
-       jsr     r5,error; '.
-       movb    $2,dotrel
-ealoop:
-       cmp     r4,$';
-       beq     assem1
-       cmp     r4,$'\n
-       bne     1f
-       inc     line
-       br      assem1
-1:
-       cmp     r4,$'\e
-       bne     2f
-       tst     ifflg
-       beq     1f
-       jsr     r5,error; 'x
-1:
-       rts     pc
-2:
-       jsr     r5,error; 'x
-2:
-       jsr     pc,checkeos
-               br assem1
-       jsr     pc,readop
-       br      2b
-assem1:
-       jmp     assem
-
-fbcheck:
-       cmp     r0,$9.
-       bhi     1f
-       rts     pc
-1:
-       jsr     r5,error; 'f
-       clr     r0
-       rts     pc
-
-checkeos:
-       cmp     r4,$'\n
-       beq     1f
-       cmp     r4,$';
-       beq     1f
-       cmp     r4,$'\e
-       beq     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as14.s b/.ref-Research-V7/usr/src/cmd/as/as14.s
deleted file mode 100644 (file)
index f8a5018..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/
-/
-
-/ a4 -- pdp-11 assembler pass1
-
-rname:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     $8,r5
-       mov     $symbol+8.,r2
-       clr     -(r2)
-       clr     -(r2)
-       clr     -(r2)
-       clr     -(r2)
-       clr     -(sp)
-       clr     -(sp)
-       cmp     r0,$'~          /  symbol not for hash table
-       bne     1f
-       inc     2(sp)
-       clrb    ch
-1:
-       jsr     pc,rch
-       movb    chartab(r0),r3
-       ble     1f
-       add     r3,(sp)
-       swab    (sp)
-       dec     r5
-       blt     1b
-       movb    r3,(r2)+
-       br      1b
-1:
-       movb    r0,ch
-       mov     (sp)+,r1
-       clr     r0
-       tst     (sp)+
-       beq     1f
-       mov     symend,r4
-       br      4f
-1:
-       div     $hshsiz,r0
-       ashc    $1,r0
-       add     $hshtab,r1
-       clr     timesaround
-1:
-       sub     r0,r1
-       cmp     r1,$hshtab
-       bhi     2f
-       add     $2*hshsiz,r1
-       tst     timesaround
-       beq     3f
-       mov     $1,r0
-       sys     write; 9f; 8f-9f
-       jmp     aexit
-       .data
-timesaround:
-       .=.+2
-9:     <as: symbol table overflow\n>; 8: .even
-       .text
-3:
-       inc     timesaround
-2:
-       mov     $symbol,r2
-       mov     -(r1),r4
-       beq     3f
-       cmp     (r2)+,(r4)+
-       bne     1b
-       cmp     (r2)+,(r4)+
-       bne     1b
-       cmp     (r2)+,(r4)+
-       bne     1b
-       cmp     (r2)+,(r4)+
-       bne     1b
-       br      1f
-3:
-       mov     symend,r4
-       mov     r4,(r1)
-4:
-       mov     $symbol,r2
-       mov     r4,-(sp)
-       add     $20,r4
-       cmp     r4,0f
-       blos    4f
-       add     $512.,0f
-       sys     indir; 9f
-       .data
-9:     sys     break; 0:end
-       .text
-4:
-       mov     (sp)+,r4
-       mov     (r2)+,(r4)+
-       mov     (r2)+,(r4)+
-       mov     (r2)+,(r4)+
-       mov     (r2)+,(r4)+
-       clr     (r4)+
-       clr     (r4)+
-       mov     r4,symend
-       sub     $4,r4
-1:
-       mov     r4,-(sp)
-       mov     r4,r3
-       sub     $8,r3
-       cmp     r3,$usymtab
-       blo     1f
-       sub     $usymtab,r3
-       clr     r2
-       div     $3,r2
-       mov     r2,r4
-       add     $4000,r4                / user symbol
-       br      2f
-1:
-       sub     $symtab,r3
-       clr     r2
-       div     $3,r2
-       mov     r2,r4
-       add     $1000,r4                / builtin symbol
-2:
-       jsr     pc,putw
-       mov     (sp)+,r4
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       tst     (sp)+
-       rts     pc
-
-number:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     r5,-(sp)
-       clr     r1
-       clr     r5
-1:
-       jsr     pc,rch
-       jsr     r5,betwen; '0; '9
-               br 1f
-       sub     $'0,r0
-       mpy     $10.,r5
-       add     r0,r5
-       als     $3,r1
-       add     r0,r1
-       br      1b
-1:
-       cmp     r0,$'b
-       beq     1f
-       cmp     r0,$'f
-       beq     1f
-       cmp     r0,$'.
-       bne     2f
-       mov     r5,r1
-       clr     r0
-2:
-       movb    r0,ch
-       mov     r1,r0
-       mov     (sp)+,r5
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       rts     pc
-1:
-       mov     r0,r3
-       mov     r5,r0
-       jsr     pc,fbcheck
-       add     $141,r0
-       cmp     r3,$'b
-       beq     1f
-       add     $10.,r0
-1:
-       mov     r0,r4
-       mov     (sp)+,r5
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       add     $2,(sp)
-       rts     pc
-
-rch:
-       movb    ch,r0
-       beq     1f
-       clrb    ch
-       rts     pc
-1:
-       dec     inbfcnt
-       blt     2f
-       movb    *inbfp,r0
-       inc     inbfp
-       bic     $!177,r0
-       beq     1b
-       rts     pc
-2:
-       movb    fin,r0
-       beq     3f
-       sys     read; inbuf;512.
-       bcs     2f
-       tst     r0
-       beq     2f
-       mov     r0,inbfcnt
-       mov     $inbuf,inbfp
-       br      1b
-2:
-       movb    fin,r0
-       clrb    fin
-       sys     close
-3:
-       decb    nargs
-       bgt     2f
-       mov     $'\e,r0
-       rts     pc
-2:
-       tst     ifflg
-       beq     2f
-       jsr     r5,error; 'i
-       jmp     aexit
-2:
-       mov     curarg,r0
-       tst     (r0)+
-       mov     (r0),0f
-       mov     r0,curarg
-       incb    fileflg
-       sys     indir; 9f
-       .data
-9:     sys     open; 0:0; 0
-       .text
-       bec     2f
-       mov     0b,r0
-       jsr     r5,filerr; <?\n>
-       jmp     aexit
-2:
-       movb    r0,fin
-       mov     $1,line
-       mov     r4,-(sp)
-       mov     r1,-(sp)
-       mov     $5,r4
-       jsr     pc,putw
-       mov     *curarg,r1
-2:
-       movb    (r1)+,r4
-       beq     2f
-       jsr     pc,putw
-       br      2b
-2:
-       mov     $-1,r4
-       jsr     pc,putw
-       mov     (sp)+,r1
-       mov     (sp)+,r4
-       br      1b
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as15.s b/.ref-Research-V7/usr/src/cmd/as/as15.s
deleted file mode 100644 (file)
index a6981b3..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/
-/
-
-/ a5 -- pdp-11 assembler pass 1
-
-readop:
-       mov     savop,r4
-       beq     1f
-       clr     savop
-       rts     pc
-1:
-       jsr     pc,8f
-       jsr     pc,putw
-       rts     pc
-
-8:
-       jsr     pc,rch
-_readop:
-       mov     r0,r4
-       movb    chartab(r0),r1
-       bgt     rdname
-       jmp     *1f-2(r1)
-
-       fixor
-       escp
-       8b
-       retread
-       dquote
-       garb
-       squote
-       rdname
-       skip
-       rdnum
-       retread
-       string
-1:
-
-escp:
-       jsr     pc,rch
-       mov     $esctab,r1
-1:
-       cmpb    r0,(r1)+
-       beq     1f
-       tstb    (r1)+
-       bne     1b
-       rts     pc
-1:
-       movb    (r1),r4
-       rts     pc
-
-esctab:
-       .byte '/, '/
-       .byte '\<, 035
-       .byte '>, 036
-       .byte '%, 037
-       .byte 0, 0
-
-fixor:
-       mov     $037,r4
-retread:
-       rts     pc
-
-rdname:
-       movb    r0,ch
-       cmp     r1,$'0
-       blo     1f
-       cmp     r1,$'9
-       blos    rdnum
-1:
-       jmp     rname
-
-rdnum:
-       jsr     pc,number
-               br 1f
-       rts     pc
-
-squote:
-       jsr     pc,rsch
-       br      1f
-dquote:
-       jsr     pc,rsch
-       mov     r0,-(sp)
-       jsr     pc,rsch
-       swab    r0
-       bis     (sp)+,r0
-1:
-       mov     r0,numval
-       mov     $1,r4
-       jsr     pc,putw
-       mov     numval,r4
-       jsr     pc,putw
-       mov     $1,r4
-       tst     (sp)+
-       rts     pc
-
-skip:
-       jsr     pc,rch
-       mov     r0,r4
-       cmp     r0,$'\e
-       beq     1f
-       cmp     r0,$'\n
-       bne     skip
-1:
-       rts     pc
-
-garb:
-       jsr     r5,error; 'g
-       br      8b
-
-string:
-       mov     $'<,r4
-       jsr     pc,putw
-       clr     numval
-1:
-       jsr     pc,rsch
-       tst     r1
-       bne     1f
-       mov     r0,r4
-       bis     $400,r4
-       jsr     pc,putw
-       inc      numval
-       br      1b
-1:
-       mov     $-1,r4
-       jsr     pc,putw
-       mov     $'<,r4
-       tst     (sp)+
-       rts     pc
-
-rsch:
-       jsr     pc,rch
-       cmp     r0,$'\e
-       beq     4f
-       cmp     r0,$'\n
-       beq     4f
-       clr     r1
-       cmp     r0,$'\\
-       bne     3f
-       jsr     pc,rch
-       mov     $schar,r2
-1:
-       cmpb    (r2)+,r0
-       beq     2f
-       tstb    (r2)+
-       bpl     1b
-       rts     pc
-2:
-       movb    (r2)+,r0
-       clr     r1
-       rts     pc
-3:
-       cmp     r0,$'>
-       bne     1f
-       inc     r1
-1:
-       rts     pc
-4:
-       jsr     r5,error; '<
-       jmp     aexit
-
-schar:
-       .byte 'n, 012
-       .byte 's, 040
-       .byte 't, 011
-       .byte 'e, 004
-       .byte '0, 000
-       .byte 'r, 015
-       .byte 'a, 006
-       .byte 'p, 033
-       .byte 0,  -1
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as16.s b/.ref-Research-V7/usr/src/cmd/as/as16.s
deleted file mode 100644 (file)
index 799c9fe..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/
-/
-
-/ a6 -- pdp-11 assembler pass 1
-
-opline:
-       mov     r4,r0
-       jsr     r5,betwen; 0; 200
-               br      1f
-       cmp     r0,$'<
-       bne     xpr
-       jmp     opl17
-xpr:
-       jsr     pc,expres
-       add     $2,dot
-       rts     pc
-1:
-       movb    (r4),r0
-       cmp     r0,$24
-       beq     xpr
-       jsr     r5,betwen; 5; 36
-               br xpr
-       mov     r0,-(sp)
-       jsr     pc,readop
-       mov     (sp)+,r0
-       asl     r0
-       jmp     *1f-12(r0)
-
-1:
-       opl13   / map fop freg,fdst to double
-       opl6
-       opl7
-       opl10
-       opl11
-       opl13   / map fld/fst to double
-       opl13
-       opl13   / map fop fsrc,freg to double
-       opl15
-       opl16
-       opl17
-       opl20
-       opl21
-       opl22
-       opl23
-       xpr
-       opl25
-       opl26
-       opl27
-       opl13  / map mul s,r to double
-       opl31
-       opl32
-       xpr
-       xpr
-       opl35
-       opl36
-
-/ jbr
-opl35:
-       mov     $4,-(sp)
-       br      1f
-
-/ jeq, etc
-opl36:
-       mov     $6,-(sp)
-1:
-       jsr     pc,expres
-       cmp     r3,dotrel
-       bne     1f
-       sub     dot,r2
-       bge     1f
-       cmp     r2,$-376
-       blt     1f
-       mov     $2,(sp)
-1:
-       add     (sp)+,dot
-       rts     pc
-
-/double
-opl13:
-opl7:
-       jsr     pc,addres
-op2:
-       cmp     r4,$',
-       beq     1f
-       jsr     pc,errora
-       rts     pc
-1:
-       jsr     pc,readop
-opl15:   / single operand
-       jsr     pc,addres
-       add     $2,dot
-       rts     pc
-
-opl31: / sob
-       jsr     pc,expres
-       cmp     r4,$',
-       beq     1f
-       jsr     pc,errora
-1:
-       jsr     pc,readop
-
-/branch
-opl6:
-opl10:
-opl11:
-       jsr     pc,expres
-       add     $2,dot
-       rts     pc
-
-/ .byte
-opl16:
-       jsr     pc,expres
-       inc     dot
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       br      opl16
-1:
-       rts     pc
-
-/ < (.ascii)
-opl17:
-       add     numval,dot
-       jsr     pc,readop
-       rts     pc
-
-/.even
-opl20:
-       inc     dot
-       bic     $1,dot
-       rts     pc
-
-/.if
-opl21:
-       jsr     pc,expres
-       tst     r3
-       bne     1f
-       jsr     r5,error; 'U
-1:
-       tst     r2
-       bne     opl22
-       inc     ifflg
-opl22: /endif
-       rts     pc
-
-/.globl
-opl23:
-       cmp     r4,$200
-       blo     1f
-       bisb    $40,(r4)
-       jsr     pc,readop
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       br      opl23
-1:
-       rts     pc
-
-opl25:
-opl26:
-opl27:
-       mov     dotrel,r1
-       asl     r1
-       mov     dot,savdot-4(r1)
-       mov     savdot-[2*25](r0),dot
-       asr     r0
-       sub     $25-2,r0
-       mov     r0,dotrel
-       rts     pc
-
-/ .common
-opl32:
-       cmp     r4,$200
-       blo     1f
-       bis     $40,(r4)
-       jsr     pc,readop
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       jsr     pc,expres
-       rts     pc
-1:
-       jsr     r5,error; 'x
-       rts     pc
-
-addres:
-       cmp     r4,$'(
-       beq     alp
-       cmp     r4,$'-
-       beq     amin
-       cmp     r4,$'$
-       beq     adoll
-       cmp     r4,$'*
-       beq     astar
-getx:
-       jsr     pc,expres
-       cmp     r4,$'(
-       bne     2f
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkreg
-       jsr     pc,checkrp
-       add     $2,dot
-       clr     r0
-       rts     pc
-2:
-       cmp     r3,$24          / register type
-       bne     1f
-       jsr     pc,checkreg
-       clr     r0
-       rts     pc
-1:
-       add     $2,dot
-       clr     r0
-       rts     pc
-
-alp:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       cmp     r4,$'+
-       bne     1f
-       jsr     pc,readop
-       clr     r0
-       rts     pc
-1:
-       mov     $2,r0
-       rts     pc
-
-amin:
-       jsr     pc,readop
-       cmp     r4,$'(
-       beq     1f
-       mov     r4,savop
-       mov     $'-,r4
-       br      getx
-1:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       clr     r0
-       rts     pc
-
-adoll:
-       jsr     pc,readop
-       jsr     pc,expres
-       add     $2,dot
-       clr     r0
-       rts     pc
-
-astar:
-       jsr     pc,readop
-       cmp     r4,$'*
-       bne     1f
-       jsr     r5,error; '*
-1:
-       jsr     pc,addres
-       add     r0,dot
-       rts     pc
-
-errora:
-       jsr     r5,error; 'a
-       rts     pc
-
-checkreg:
-       cmp     r2,$7
-       bhi     1f
-       cmp     r3,$1
-       beq     2f
-       cmp     r3,$4
-       bhi     2f
-1:
-       jsr     pc,errora
-2:
-       rts     pc
-
-errore:
-       jsr     r5,error; 'e
-       rts     pc
-
-checkrp:
-       cmp     r4,$')
-       beq     1f
-       jsr     r5,error; ')
-       rts     pc
-1:
-       jsr     pc,readop
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as17.s b/.ref-Research-V7/usr/src/cmd/as/as17.s
deleted file mode 100644 (file)
index 30a17c2..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/
-/
-
-/  a7 -- pdp-11 assembler pass 1
-
-expres:
-       mov     r5,-(sp)
-       mov     $'+,-(sp)
-       clr     opfound
-       clr     r2
-       mov     $1,r3
-       br      1f
-advanc:
-       jsr     pc,readop
-1:
-       mov     r4,r0
-       jsr     r5,betwen; 0; 177
-               br .+4
-       br      7f
-       movb    (r4),r0
-       mov     2(r4),r1
-       br      oprand
-7:
-       cmp     r4,$141
-       blo     1f
-       cmp     r4,$141+10.
-       bhis    2f
-       movb    curfbr-141(r4),r0
-       asl     r4
-       mov     curfb-[2*141](r4),r2
-       cmp     r2,$-1
-       bne     oprand
-       jsr     r5,error; 'f
-       br      oprand
-2:
-       clr     r3
-       clr     r2
-       br      oprand
-1:
-       mov     $esw1,r1
-1:
-       cmp     (r1)+,r4
-       beq     1f
-       tst     (r1)+
-       bne     1b
-       tst     opfound
-       bne     2f
-       jsr     pc,errore
-2:
-       tst     (sp)+
-       mov     (sp)+,r5
-       rts     pc
-1:
-       jmp     *(r1)
-
-esw1:
-       '+;     binop
-       '-;     binop
-       '*;     binop
-       '/;     binop
-       '&;     binop
-       037;    binop
-       035;    binop
-       036;    binop
-       '%;     binop
-       '[;     brack
-       '^;     binop
-       1;      exnum
-       '!;     binop
-       0;      0
-
-binop:
-       cmpb    (sp),$'+
-       beq     1f
-       jsr     pc,errore
-1:
-       movb    r4,(sp)
-       br      advanc
-
-exnum:
-       mov     numval,r1
-       mov     $1,r0
-       br      oprand
-
-brack:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       jsr     pc,readop
-       jsr     pc,expres
-       cmp     r4,$']
-       beq     1f
-       jsr     r5,error; ']
-1:
-       mov     r3,r0
-       mov     r2,r1
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-
-oprand:
-       inc     opfound
-       mov     $exsw2,r5
-1:
-       cmp     (sp),(r5)+
-       beq     1f
-       tst     (r5)+
-       bne     1b
-       br      eoprnd
-1:
-       jmp     *(r5)
-
-exsw2:
-       '+; exadd
-       '-; exsub
-       '*; exmul
-       '/; exdiv
-       037; exor
-       '&; exand
-       035;exlsh
-       036;exrsh
-       '%; exmod
-       '!; exnot
-       '^; excmbin
-       0;  0
-
-excmbin:
-       mov     r0,r3                   / give left flag of right
-       br      eoprnd
-
-exrsh:
-       neg     r1
-       beq     exlsh
-       inc     r1
-       clc
-       ror     r2
-exlsh:
-       jsr     r5,combin; 0
-       als     r1,r2
-       br      eoprnd
-
-exmod:
-       jsr     r5,combin; 0
-       mov     r1,-(sp)
-       mov     r2,r1
-       clr     r0
-       dvd     (sp)+,r0
-       mov     r1,r2
-       br      eoprnd
-
-exadd:
-       jsr     r5,combin; 0
-       add     r1,r2
-       br      eoprnd
-
-exsub:
-       jsr     r5,combin; 1
-       sub     r1,r2
-       br      eoprnd
-
-exand:
-       jsr     r5,combin; 0
-       com     r1
-       bic     r1,r2
-       br      eoprnd
-
-exor:
-       jsr     r5,combin; 0
-       bis     r1,r2
-       br      eoprnd
-
-exmul:
-       jsr     r5,combin; 0
-       mpy     r2,r1
-       mov     r1,r2
-       br      eoprnd
-
-exdiv:
-       jsr     r5,combin; 0
-       mov     r1,-(sp)
-       mov     r2,r1
-       clr     r0
-       dvd     (sp)+,r0
-       mov     r0,r2
-       br      eoprnd
-
-exnot:
-       jsr     r5,combin; 0
-       com     r1
-       add     r1,r2
-       br      eoprnd
-
-eoprnd:
-       mov     $'+,(sp)
-       jmp     advanc
-
-combin:
-       mov     r0,-(sp)
-       bis     r3,(sp)
-       bic     $!40,(sp)
-       bic     $!37,r0
-       bic     $!37,r3
-       cmp     r0,r3
-       ble     1f
-       mov     r0,-(sp)
-       mov     r3,r0
-       mov     (sp)+,r3
-1:
-       tst     r0
-       beq     1f
-       tst     (r5)+
-       beq     2f
-       cmp     r0,r3
-       bne     2f
-       mov     $1,r3
-       br      2f
-1:
-       tst     (r5)+
-       clr     r3
-2:
-       bis     (sp)+,r3
-       rts     r5
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as18.s b/.ref-Research-V7/usr/src/cmd/as/as18.s
deleted file mode 100644 (file)
index 6b6eb81..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/
-/
-
-/ a8 -- pdp-11 assembler pass 1
-
-chartab:
-       .byte -14,-14,-14,-14,-02,-14,-14,-14
-       .byte -14,-22, -2,-14,-14,-22,-14,-14
-       .byte -14,-14,-14,-14,-14,-14,-14,-14
-       .byte -14,-14,-14,-14,-14,-14,-14,-14
-       .byte -22,-20,-16,-14,-20,-20,-20,-12
-       .byte -20,-20,-20,-20,-20,-20,056,-06
-       .byte 060,061,062,063,064,065,066,067
-       .byte 070,071,-20,-02,-00,-20,-14,-14
-       .byte -14,101,102,103,104,105,106,107
-       .byte 110,111,112,113,114,115,116,117
-       .byte 120,121,122,123,124,125,126,127
-       .byte 130,131,132,-20,-24,-20,-20,137
-       .byte -14,141,142,143,144,145,146,147
-       .byte 150,151,152,153,154,155,156,157
-       .byte 160,161,162,163,164,165,166,167
-       .byte 170,171,172,-14,-26,-14,176,-14
-
-.data
-
-namedone:.byte 0
-a.tmp1:        </tmp/atm1a\0>
-a.tmp2:        </tmp/atm2a\0>
-a.tmp3:        </tmp/atm3a\0>
-       .even
-curfb:
-       -1;-1;-1;-1;-1;-1;-1;-1;-1;-1
-obufp: outbuf
-symend:        usymtab
-
-.bss
-curfbr:        .=.+10.
-savdot:        .=.+6
-bufcnt:        .=.+2
-hshsiz = 3001.
-hshtab:        .=2*hshsiz+.
-pof:   .=.+1
-wordf: .=.+1
-fin:   .=.+1
-fbfil: .=.+1
-fileflg:.=.+1
-errflg:        .=.+1
-ch:    .=.+1
-.even
-symbol:        .=.+8.
-obufc: .=.+2
-outbuf:        .=.+512.
-line:  .=.+2
-inbfcnt:.=.+2
-ifflg: .=.+2
-inbfp: .=.+2
-nargs: .=.+2
-curarg:        .=.+2
-opfound:.=.+2
-savop: .=.+2
-numval:        .=.+2
-nxtfb: .=.+4
-usymtab:.=.+36.
-end:
-.text
diff --git a/.ref-Research-V7/usr/src/cmd/as/as19.s b/.ref-Research-V7/usr/src/cmd/as/as19.s
deleted file mode 100644 (file)
index 6c7be87..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-/
-/
-
-/ a9 -- pdp-11 assembler pass 1
-
-eae = 0
-
-/ key to types
-
-/      0       undefined
-/      1       absolute
-/      2       text
-/      3       data
-/      4       bss
-/      5       flop freg,dst (movfo, = stcfd)
-/      6       branch
-/      7       jsr
-/      10      rts
-/      11      sys
-/      12      movf (=ldf,stf)
-/      13      double operand (mov)
-/      14      flop fsrc,freg (addf)
-/      15      single operand (clr)
-/      16      .byte
-/      17      string (.ascii, "<")
-/      20      .even
-/      21      .if
-/      22      .endif
-/      23      .globl
-/      24      register
-/      25      .text
-/      26      .data
-/      27      .bss
-/      30      mul,div, etc
-/      31      sob
-/      32      .comm
-/      33      estimated text
-/      34      estimated data
-/      35      jbr
-/      36      jeq, jne, etc
-
-       .data
-symtab:
-/ special variables
-
-<.\0\0\0\0\0\0\0>; dotrel:02; dot:000000
-<..\0\0\0\0\0\0>;      01; dotdot:000000
-
-/ register
-
-<r0\0\0\0\0\0\0>;      24;000000
-<r1\0\0\0\0\0\0>;      24;000001
-<r2\0\0\0\0\0\0>;      24;000002
-<r3\0\0\0\0\0\0>;      24;000003
-<r4\0\0\0\0\0\0>;      24;000004
-<r5\0\0\0\0\0\0>;      24;000005
-<sp\0\0\0\0\0\0>;      24;000006
-<pc\0\0\0\0\0\0>;      24;000007
-
-.if eae
-
-/eae & switches
-
-<csw\0\0\0\0\0>;       01;177570
-<div\0\0\0\0\0>;       01;177300
-<ac\0\0\0\0\0\0>;      01;177302
-<mq\0\0\0\0\0\0>;      01;177304
-<mul\0\0\0\0\0>;       01;177306
-<sc\0\0\0\0\0\0>;      01;177310
-<sr\0\0\0\0\0\0>;      01;177311
-<nor\0\0\0\0\0>;       01;177312
-<lsh\0\0\0\0\0>;       01;177314
-<ash\0\0\0\0\0>;       01;177316
-
-.endif
-
-/ double operand
-
-<mov\0\0\0\0\0>;       13;0010000
-<movb\0\0\0\0>;                13;0110000
-<cmp\0\0\0\0\0>;       13;0020000
-<cmpb\0\0\0\0>;                13;0120000
-<bit\0\0\0\0\0>;       13;0030000
-<bitb\0\0\0\0>;                13;0130000
-<bic\0\0\0\0\0>;       13;0040000
-<bicb\0\0\0\0>;                13;0140000
-<bis\0\0\0\0\0>;       13;0050000
-<bisb\0\0\0\0>;                13;0150000
-<add\0\0\0\0\0>;       13;0060000
-<sub\0\0\0\0\0>;       13;0160000
-
-/ branch
-
-<br\0\0\0\0\0\0>;      06;0000400
-<bne\0\0\0\0\0>;       06;0001000
-<beq\0\0\0\0\0>;       06;0001400
-<bge\0\0\0\0\0>;       06;0002000
-<blt\0\0\0\0\0>;       06;0002400
-<bgt\0\0\0\0\0>;       06;0003000
-<ble\0\0\0\0\0>;       06;0003400
-<bpl\0\0\0\0\0>;       06;0100000
-<bmi\0\0\0\0\0>;       06;0100400
-<bhi\0\0\0\0\0>;       06;0101000
-<blos\0\0\0\0>;                06;0101400
-<bvc\0\0\0\0\0>;       06;0102000
-<bvs\0\0\0\0\0>;       06;0102400
-<bhis\0\0\0\0>;                06;0103000
-<bec\0\0\0\0\0>;       06;0103000
-<bcc\0\0\0\0\0>;       06;0103000
-<blo\0\0\0\0\0>;       06;0103400
-<bcs\0\0\0\0\0>;       06;0103400
-<bes\0\0\0\0\0>;       06;0103400
-
-/ jump/branch type
-
-<jbr\0\0\0\0\0>;       35;0000400
-<jne\0\0\0\0\0>;       36;0001000
-<jeq\0\0\0\0\0>;       36;0001400
-<jge\0\0\0\0\0>;       36;0002000
-<jlt\0\0\0\0\0>;       36;0002400
-<jgt\0\0\0\0\0>;       36;0003000
-<jle\0\0\0\0\0>;       36;0003400
-<jpl\0\0\0\0\0>;       36;0100000
-<jmi\0\0\0\0\0>;       36;0100400
-<jhi\0\0\0\0\0>;       36;0101000
-<jlos\0\0\0\0>;                36;0101400
-<jvc\0\0\0\0\0>;       36;0102000
-<jvs\0\0\0\0\0>;       36;0102400
-<jhis\0\0\0\0>;                36;0103000
-<jec\0\0\0\0\0>;       36;0103000
-<jcc\0\0\0\0\0>;       36;0103000
-<jlo\0\0\0\0\0>;       36;0103400
-<jcs\0\0\0\0\0>;       36;0103400
-<jes\0\0\0\0\0>;       36;0103400
-
-/ single operand
-
-<clr\0\0\0\0\0>;       15;0005000
-<clrb\0\0\0\0>;                15;0105000
-<com\0\0\0\0\0>;       15;0005100
-<comb\0\0\0\0>;                15;0105100
-<inc\0\0\0\0\0>;       15;0005200
-<incb\0\0\0\0>;                15;0105200
-<dec\0\0\0\0\0>;       15;0005300
-<decb\0\0\0\0>;                15;0105300
-<neg\0\0\0\0\0>;       15;0005400
-<negb\0\0\0\0>;                15;0105400
-<adc\0\0\0\0\0>;       15;0005500
-<adcb\0\0\0\0>;                15;0105500
-<sbc\0\0\0\0\0>;       15;0005600
-<sbcb\0\0\0\0>;                15;0105600
-<tst\0\0\0\0\0>;       15;0005700
-<tstb\0\0\0\0>;                15;0105700
-<ror\0\0\0\0\0>;       15;0006000
-<rorb\0\0\0\0>;                15;0106000
-<rol\0\0\0\0\0>;       15;0006100
-<rolb\0\0\0\0>;                15;0106100
-<asr\0\0\0\0\0>;       15;0006200
-<asrb\0\0\0\0>;                15;0106200
-<asl\0\0\0\0\0>;       15;0006300
-<aslb\0\0\0\0>;                15;0106300
-<jmp\0\0\0\0\0>;       15;0000100
-<swab\0\0\0\0>;                15;0000300
-
-/ jsr
-
-<jsr\0\0\0\0\0>;       07;0004000
-
-/ rts
-
-<rts\0\0\0\0\0>;       010;000200
-
-/ simple operand
-
-<sys\0\0\0\0\0>;       011;104400
-
-/ flag-setting
-
-<clc\0\0\0\0\0>;       01;0000241
-<clv\0\0\0\0\0>;       01;0000242
-<clz\0\0\0\0\0>;       01;0000244
-<cln\0\0\0\0\0>;       01;0000250
-<sec\0\0\0\0\0>;       01;0000261
-<sev\0\0\0\0\0>;       01;0000262
-<sez\0\0\0\0\0>;       01;0000264
-<sen\0\0\0\0\0>;       01;0000270
-
-/ floating point ops
-
-<cfcc\0\0\0\0>;                01;170000
-<setf\0\0\0\0>;                01;170001
-<setd\0\0\0\0>;                01;170011
-<seti\0\0\0\0>;                01;170002
-<setl\0\0\0\0>;                01;170012
-<clrf\0\0\0\0>;                15;170400
-<negf\0\0\0\0>;                15;170700
-<absf\0\0\0\0>;                15;170600
-<tstf\0\0\0\0>;                15;170500
-<movf\0\0\0\0>;                12;172400
-<movif\0\0\0>;         14;177000
-<movfi\0\0\0>;         05;175400
-<movof\0\0\0>;         14;177400
-<movfo\0\0\0>;         05;176000
-<addf\0\0\0\0>;                14;172000
-<subf\0\0\0\0>;                14;173000
-<mulf\0\0\0\0>;                14;171000
-<divf\0\0\0\0>;                14;174400
-<cmpf\0\0\0\0>;                14;173400
-<modf\0\0\0\0>;                14;171400
-<movie\0\0\0>;         14;176400
-<movei\0\0\0>;         05;175000
-<ldfps\0\0\0>;         15;170100
-<stfps\0\0\0>;         15;170200
-<fr0\0\0\0\0\0>;       24;000000
-<fr1\0\0\0\0\0>;       24;000001
-<fr2\0\0\0\0\0>;       24;000002
-<fr3\0\0\0\0\0>;       24;000003
-<fr4\0\0\0\0\0>;       24;000004
-<fr5\0\0\0\0\0>;       24;000005
-
-/ 11/45 operations
-
-<als\0\0\0\0\0>;       30;072000
-<alsc\0\0\0\0>;                30;073000
-<mpy\0\0\0\0\0>;       30;070000
-.if eae-1
-<mul\0\0\0\0\0>;       30;070000
-<div\0\0\0\0\0>;       30;071000
-<ash\0\0\0\0\0>;       30;072000
-<ashc\0\0\0\0>;                30;073000
-.endif
-<dvd\0\0\0\0\0>;       30;071000
-<xor\0\0\0\0\0>;       07;074000
-<sxt\0\0\0\0\0>;       15;006700
-<mark\0\0\0\0>;                11;006400
-<sob\0\0\0\0\0>;       31;077000
-
-/ specials
-
-<.byte\0\0\0>;         16;000000
-<.even\0\0\0>;         20;000000
-<.if\0\0\0\0\0>;       21;000000
-<.endif\0\0>;          22;000000
-<.globl\0\0>;          23;000000
-<.text\0\0\0>;         25;000000
-<.data\0\0\0>;         26;000000
-<.bss\0\0\0\0>;                27;000000
-<.comm\0\0\0>;         32;000000
-
-ebsymtab:
-
-
-start:
-       sys     signal; 2; 1
-       ror     r0
-       bcs     1f
-       sys     signal; 2; aexit
-1:
-       mov     (sp)+,r0
-       tst     (sp)+
-1:
-       mov     (sp),r1
-       cmpb    (r1),$'-
-       bne     1f
-       tst     (sp)+
-       dec     r0
-       cmpb    1(r1),$'u
-       bne     2f
-       movb    $'g,unglob
-       br      1b
-2:
-       tstb    1(r1)
-       bne     2f
-       movb    $'g,unglob
-       br      1b
-2:
-       cmpb    1(r1),$'o
-       bne     1f
-       mov     (sp),outfp
-       tst     (sp)+
-       dec     r0
-       br      1b
-1:
-       movb    r0,nargs
-       tst     -(sp)
-       mov     sp,curarg
-       jsr     r5,fcreat; a.tmp1
-       movb    r0,pof
-       jsr     r5,fcreat; a.tmp2
-       movb    r0,fbfil
-       jsr     pc,setup
-       jmp     go
-
-setup:
-       mov     $symtab,r1
-1:
-       clr     r3
-       mov     $8,r2
-       mov     r1,-(sp)
-2:
-       movb    (r1)+,r4
-       beq     2f
-       add     r4,r3
-       swab    r3
-       sob     r2,2b
-2:
-       clr     r2
-       div     $hshsiz,r2
-       ashc    $1,r2
-       add     $hshtab,r3
-4:
-       sub     r2,r3
-       cmp     r3,$hshtab
-       bhi     3f
-       add     $2*hshsiz,r3
-3:
-       tst     -(r3)
-       bne     4b
-       mov     (sp)+,r1
-       mov     r1,(r3)
-       add     $12.,r1
-       cmp     r1,$ebsymtab
-       blo     1b
-       rts     pc
-
-/overlay buffer
-inbuf  = setup
-.      =inbuf+512.
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as21.s b/.ref-Research-V7/usr/src/cmd/as/as21.s
deleted file mode 100644 (file)
index d4a2263..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/
-/
-
-/ a21 -- pdp-11 assembler pass 2 
-
-main:
-       sys     signal; 2; 1
-       ror     r0
-       bcs     1f
-       sys     signal; 2; saexit
-1:
-       jmp     start
-
-/ set up sizes and origins
-
-go:
-
-/ read in symbol table
-
-       mov     $usymtab,r1
-1:
-       jsr     pc,getw
-       bvs     1f
-       add     $14,symsiz              / count symbols
-       jsr     pc,getw
-       jsr     pc,getw
-       jsr     pc,getw
-       jsr     pc,getw
-       mov     r4,r0
-       bic     $!37,r0
-       cmp     r0,$2                   /text
-       blo     2f
-       cmp     r0,$3                   /data
-       bhi     2f
-       add     $31,r4                  /mark "estimated"
-       mov     r4,(r1)+
-       jsr     pc,getw
-       mov     r4,(r1)+
-       br      3f
-2:
-       clr     (r1)+
-       clr     (r1)+
-       jsr     pc,getw
-3:
-       jsr     pc,setbrk
-       br      1b
-1:
-
-/ read in f-b definitions
-
-       mov     r1,fbbufp
-       movb    fbfil,fin
-       clr     ibufc
-1:
-       jsr     pc,getw
-       bvs     1f
-       add     $31,r4                  / "estimated"
-       mov     r4,(r1)+
-       jsr     pc,getw
-       mov     r4,(r1)+
-       jsr     pc,setbrk
-       br      1b
-1:
-       mov     r1,endtable
-       mov     $100000,(r1)+
-
-/ set up input text file; initialize f-b table
-
-       jsr     pc,setup
-/ do pass 1
-
-       jsr     pc,assem
-
-/ prepare for pass 2
-       cmp     outmod,$777
-       beq     1f
-       jmp     aexit
-1:
-       clr     dot
-       mov     $2,dotrel
-       mov     $..,dotdot
-       clr     brtabp
-       movb    fin,r0
-       sys     close
-       jsr     r5,ofile; a.tmp1
-       movb    r0,fin
-       clr     ibufc
-       jsr     pc,setup
-       inc     passno
-       inc     bsssiz
-       bic     $1,bsssiz
-       mov     txtsiz,r1
-       inc     r1
-       bic     $1,r1
-       mov     r1,txtsiz
-       mov     datsiz,r2
-       inc     r2
-       bic     $1,r2
-       mov     r2,datsiz
-       mov     r1,r3
-       mov     r3,datbase      / txtsiz
-       mov     r3,savdot+2
-       add     r2,r3
-       mov     r3,bssbase      / txtsiz+datsiz
-       mov     r3,savdot+4
-       clr     r0
-       asl     r3
-       adc     r0
-       add     $20,r3
-       adc     r0
-       mov     r3,symseek+2    / 2*txtsiz+2*datsiz+20
-       mov     r0,symseek
-       sub     r2,r3
-       sbc     r0
-       mov     r3,drelseek+2   / 2*txtsiz+datsiz
-       mov     r0,drelseek
-       sub     r1,r3
-       sbc     r0
-       mov     r3,trelseek+2   / txtsiz+datsiz+20
-       mov     r0,trelseek
-       sub     r2,r3
-       sbc     r0
-       mov     r0,datseek
-       mov     r3,datseek+2    / txtsiz+20
-       mov     $usymtab,r1
-1:
-       jsr     pc,doreloc
-       add     $4,r1
-       cmp     r1,endtable
-       blo     1b
-       clr     r0
-       clr     r1
-       jsr     r5,oset; txtp
-       mov     trelseek,r0
-       mov     trelseek+2,r1
-       jsr     r5,oset; relp
-       mov     $8.,r2
-       mov     $txtmagic,r1
-1:
-       mov     (r1)+,r0
-       jsr     r5,putw; txtp
-       dec     r2
-       bne     1b
-       jsr     pc,assem
-
-/polish off text and relocation
-
-       jsr     r5,flush; txtp
-       jsr     r5,flush; relp
-
-/ append full symbol table
-
-       mov     symf,r0
-       mov     r0,fin
-       sys     lseek; 0; 0; 0
-       clr     ibufc
-       mov     symseek,r0
-       mov     symseek+2,r1
-       jsr     r5,oset; txtp
-       mov     $usymtab,r1
-1:
-       jsr     pc,getw
-       bvs     1f
-       mov     r4,r0
-       jsr     r5,putw; txtp
-       jsr     pc,getw
-       mov     r4,r0
-       jsr     r5,putw; txtp
-       jsr     pc,getw
-       mov     r4,r0
-       jsr     r5,putw; txtp
-       jsr     pc,getw
-       mov     r4,r0
-       jsr     r5,putw; txtp
-       mov     (r1)+,r0
-       jsr     r5,putw; txtp
-       mov     (r1)+,r0
-       jsr     r5,putw; txtp
-       jsr     pc,getw
-       jsr     pc,getw
-       br      1b
-1:
-       jsr     r5,flush; txtp
-       jmp     aexit
-
-       .data
-saexit:
-       mov     pc,errflg
-
-aexit:
-       mov     a.tmp1,0f
-       sys     unlink; 0:..
-       mov     a.tmp2,0f
-       sys     unlink; 0:..
-       mov     a.tmp3,0f
-       sys     unlink; 0:..
-       tst     errflg
-       bne     2f
-       sys     umask; 0
-       bic     r0,outmod
-       sys     chmod; a.outp2:a.out; outmod: 777
-       clr     r0
-       br      1f
-2:
-       mov     $2,r0
-1:
-       sys     exit
-       .text
-
-filerr:
-       mov     *(r5),r5
-1:
-       movb    (r5)+,ch
-       beq     1f
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       mov     $1,r0
-       sys     write; qnl; 2
-       jmp     saexit
-
-doreloc:
-       movb    (r1),r0
-       bne     1f
-       bisb    defund,(r1)
-1:
-       bic     $!37,r0
-       cmp     r0,$5
-       bhis    1f
-       cmp     r0,$3
-       blo     1f
-       beq     2f
-       add     bssbase,2(r1)
-       rts     pc
-2:
-       add     datbase,2(r1)
-1:
-       rts     pc
-
-setbrk:
-       mov     r1,-(sp)
-       add     $20,r1
-       cmp     r1,0f
-       blo     1f
-       add     $512.,0f
-       sys     indir; 9f
-       .data
-9:     sys     break; 0: end
-       .text
-1:
-       mov     (sp)+,r1
-       rts     pc
-
-setup:
-       mov     $curfb,r4
-1:
-       clr     (r4)+
-       cmp     r4,$curfb+40.
-       blo     1b
-       mov     txtfil,fin
-       clr     ibufc
-       clr     r4
-1:
-       jsr     pc,fbadv
-       tstb    (r4)+
-       cmp     r4,$10.
-       blt     1b
-       rts     pc
-
-ofile:
-       mov     *(r5),0f
-       sys     indir; 9f
-       .data
-9:     sys     open; 0:..; 0
-       .text
-       bes     1f
-       tst     (r5)+
-       rts     r5
-1:
-       jmp     filerr
diff --git a/.ref-Research-V7/usr/src/cmd/as/as22.s b/.ref-Research-V7/usr/src/cmd/as/as22.s
deleted file mode 100644 (file)
index 1fbdb3b..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/
-/
-
-/ a2 -- pdp-11 assembler pass 2
-
-outw:
-       cmp     dot-2,$4
-       beq     9f
-       bit     $1,dot
-       bne     1f
-       add     $2,dot
-       tstb    passno
-       beq     8f
-       clr     -(sp)
-       rol     r3
-       adc     (sp)
-       asr     r3              / get relative pc bit
-       cmp     r3,$40
-       bne     2f
-/ external references
-       mov     $666,outmod             / make nonexecutable
-       mov     xsymbol,r3
-       sub     $usymtab,r3
-       asl     r3
-       bis     $4,r3           / external relocation
-       br      3f
-2:
-       bic     $40,r3          / clear any ext bits
-       cmp     r3,$5
-       blo     4f
-       cmp     r3,$33          / est. text, data
-       beq     6f
-       cmp     r3,$34
-       bne     7f
-6:
-       jsr     r5,error; 'r
-7:
-       mov     $1,r3           / make absolute
-4:
-       cmp     r3,$2
-       blo     5f
-       cmp     r3,$4
-       bhi     5f
-       tst     (sp)
-       bne     4f
-       add     dotdot,r2
-       br      4f
-5:
-       tst     (sp)
-       beq     4f
-       sub     dotdot,r2
-4:
-       dec     r3
-       bpl     3f
-       clr     r3
-3:
-       asl     r3
-       bis     (sp)+,r3
-       mov     r2,r0
-       jsr     r5,putw; txtp
-       mov     tseekp,r0
-       add     $2,2(r0)
-       adc     (r0)
-       mov     r3,r0
-       jsr     r5,putw; relp
-       mov     rseekp,r0
-       add     $2,2(r0)
-       adc     (r0)
-8:
-       rts     pc
-1:
-       jsr     r5,error; 'o
-       clr     r3
-       jsr     pc,outb
-       rts     pc
-
-9:
-       jsr     r5,error; 'x
-       rts     pc
-
-outb:
-       cmp     dot-2,$4                / test bss mode
-       beq     9b
-       cmp     r3,$1
-       blos    1f
-       jsr     r5,error; 'r
-1:
-       tstb    passno
-       beq     2f
-       mov     r2,r0
-       bit     $1,dot
-       bne     1f
-       jsr     r5,putw; txtp
-       clr     r0
-       jsr     r5,putw; relp
-       mov     tseekp,r0
-       add     $2,2(r0)
-       adc     (r0)
-       mov     rseekp,r0
-       add     $2,2(r0)
-       adc     (r0)
-       br      2f
-1:
-       mov     txtp,r0
-       movb    r2,-1(r0)
-2:
-       inc     dot
-       rts     pc
-
-error:
-       mov     pc,errflg
-       mov     $666,outmod             / make nonexecutable
-       mov     r3,-(sp)
-       mov     r2,-(sp)
-       mov     r1,-(sp)
-       mov     r0,-(sp)
-       mov     $argb,r1
-1:
-       movb    (r1),ch
-       beq     1f
-       clrb    (r1)+
-       mov     $1,r0
-       sys     write; ch; 1
-       br      1b
-1:
-       mov     (r5)+,r0
-       movb    r0,0f
-       mov     line,r3
-       mov     $0f+6,r0
-       mov     $4,r1
-2:
-       clr     r2
-       dvd     $10.,r2
-       add     $'0,r3
-       movb    r3,-(r0)
-       mov     r2,r3
-       sob     r1,2b
-       mov     $1,r0
-       sys     write; 0f; 7
-       mov     (sp)+,r0
-       mov     (sp)+,r1
-       mov     (sp)+,r2
-       mov     (sp)+,r3
-       rts     r5
-
-       .data
-0:     <f xxxx\n>
-       .even
-       .text
-
-betwen:
-       cmp     r0,(r5)+
-       blt     1f
-       cmp     (r5)+,r0
-       blt     2f
-1:
-       tst     (r5)+
-2:
-       rts     r5
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as23.s b/.ref-Research-V7/usr/src/cmd/as/as23.s
deleted file mode 100644 (file)
index 26f16c8..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/
-/
-
-/ a3 -- pdp-11 assembler pass 2
-
-assem:
-       jsr     pc,readop
-       cmp     r4,$5
-       beq     2f
-       cmp     r4,$'<
-       beq     2f
-       jsr     pc,checkeos
-               br eal1
-       mov     r4,-(sp)
-       cmp     (sp),$1
-       bne     1f
-       mov     $2,(sp)
-       jsr     pc,getw
-       mov     r4,numval
-1:
-       jsr     pc,readop
-       cmp     r4,$'=
-       beq     4f
-       cmp     r4,$':
-       beq     1f
-       mov     r4,savop
-       mov     (sp)+,r4
-2:
-       jsr     pc,opline
-dotmax:
-       tstb    passno
-       bne     eal1
-       movb    dotrel,r0
-       asl     r0
-       cmp     dot,txtsiz-4(r0)
-       blos    ealoop
-       mov     dot,txtsiz-4(r0)
-eal1:
-       jmp     ealoop
-1:
-       mov     (sp)+,r4
-       cmp     r4,$200
-       bhis    1f
-       cmp     r4,$2
-       beq     3f
-       jsr     r5,error; 'x
-       br      assem
-1:
-       tstb    passno
-       bne     2f
-       movb    (r4),r0
-       bic     $!37,r0
-       beq     5f
-       cmp     r0,$33
-       blt     6f
-       cmp     r0,$34
-       ble     5f
-6:
-       jsr     r5,error; 'm
-5:
-       bic     $37,(r4)
-       bis     dotrel,(r4)
-       mov     2(r4),brdelt
-       sub     dot,brdelt
-       mov     dot,2(r4)
-       br      assem
-2:
-       cmp     dot,2(r4)
-       beq     assem
-       jsr     r5,error; 'p
-       br      assem
-3:
-       mov     numval,r4
-       jsr     pc,fbadv
-       asl     r4
-       mov     curfb(r4),r0
-       movb    dotrel,(r0)
-       mov     2(r0),brdelt
-       sub     dot,brdelt
-       mov     dot,2(r0)
-       br      assem
-4:
-       jsr     pc,readop
-       jsr     pc,expres
-       mov     (sp)+,r1
-       cmp     r1,$symtab      /test for dot
-       bne     1f
-       bic     $40,r3
-       cmp     r3,dotrel       / can't change relocation
-       bne     2f
-       cmp     r3,$4           / bss
-       bne     3f
-       mov     r2,dot
-       br      dotmax
-3:
-       sub     dot,r2
-       bmi     2f
-       mov     r2,-(sp)
-3:
-       dec     (sp)
-       bmi     3f
-       clr     r2
-       mov     $1,r3
-       jsr     pc,outb
-       br      3b
-3:
-       tst     (sp)+
-       br      dotmax
-2:
-       jsr     r5,error; '.
-       br      ealoop
-1:
-       cmp     r3,$40
-       bne     1f
-       jsr     r5,error; 'r
-1:
-       bic     $37,(r1)
-       bic     $!37,r3
-       bne     1f
-       clr     r2
-1:
-       bisb    r3,(r1)
-       mov     r2,2(r1)
-
-ealoop:
-       cmp     r4,$'\n
-       beq     1f
-       cmp     r4,$'\e
-       bne     9f
-       rts     pc
-1:
-       inc     line
-9:
-       jmp     assem
-
-checkeos:
-       cmp     r4,$'\n
-       beq     1f
-       cmp     r4,$';
-       beq     1f
-       cmp     r4,$'\e
-       beq     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
-fbadv:
-       asl     r4
-       mov     nxtfb(r4),r1
-       mov     r1,curfb(r4)
-       bne     1f
-       mov     fbbufp,r1
-       br      2f
-1:
-       add     $4,r1
-2:
-       cmpb    1(r1),r4
-       beq     1f
-       tst     (r1)
-       bpl     1b
-1:
-       mov     r1,nxtfb(r4)
-       asr     r4
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as24.s b/.ref-Research-V7/usr/src/cmd/as/as24.s
deleted file mode 100644 (file)
index b192663..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/
-/
-
-/ a4 -- pdp-11 assembler pass 2
-
-oset:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     (r5)+,r3
-       mov     r1,r2
-       bic     $!777,r1
-       add     r3,r1
-       add     $8,r1
-       mov     r1,(r3)+        / next slot
-       mov     r3,r1
-       add     $1006,r1
-       mov     r1,(r3)+        / buf max
-       mov     r0,(r3)+
-       mov     r2,(r3)+        / seek addr
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       rts     r5
-
-putw:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     (r5)+,r2
-       mov     (r2)+,r1        / slot
-       cmp     r1,(r2)         / buf max
-       bhis    1f
-       mov     r0,(r1)+
-       mov     r1,-(r2)
-       br      2f
-1:
-       tst     (r2)+
-       mov     r0,-(sp)
-       jsr     r5,flush1
-       mov     (sp)+,r0
-       mov     r0,*(r2)+
-       add     $2,-(r2)
-2:
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       rts     r5
-
-flush:
-       mov     (r5)+,r2
-       cmp     (r2)+,(r2)+
-flush1:
-       mov     (r2)+,0f
-       mov     (r2)+,r1
-       mov     r1,0f+2         / seek address
-       mov     fout,r0
-       sys     indir; 9f
-       .data
-9:     sys     lseek; 0:..; ..; 0
-       .text
-       bic     $!777,r1
-       add     r2,r1           / write address
-       mov     r1,0f
-       mov     r2,r0
-       bis     $777,-(r2)
-       add     $1,(r2)         / new seek addr
-       adc     -(r2)
-       cmp     -(r2),-(r2)
-       sub     (r2),r1
-       neg     r1
-       mov     r1,0f+2         / count
-       mov     r0,(r2)         / new next slot
-       mov     fout,r0
-       sys     indir; 9f
-       jes     wrterr
-       .data
-9:     sys     write; 0:..; ..
-       .text
-       rts     r5
-
-wrterr:
-       mov     $1,r0
-       sys     write; 9f; 8f-9f
-       jmp     saexit
-9:     <as: write error on output\n>; 8:
-
-readop:
-       mov     savop,r4
-       beq     1f
-       clr     savop
-       rts     pc
-1:
-       jsr     pc,getw1
-       cmp     r4,$200
-       blo     1f
-       cmp     r4,$4000
-       blo     2f
-       add     $usymtab-4000,r4
-       rts     pc
-2:
-       add     $symtab-1000,r4
-1:
-       rts     pc
-
-getw:
-       mov     savop,r4
-       beq     getw1
-       clr     savop
-       rts     pc
-getw1:
-       dec     ibufc
-       bgt     1f
-       movb    fin,r0
-       sys     read; inbuf; 512.
-       bes     3f
-       asr     r0
-       mov     r0,ibufc
-       bne     2f
-3:
-       mov     $4,r4
-       sev
-       rts     pc
-2:
-       mov     $inbuf,ibufp
-1:
-       mov     *ibufp,r4
-       add     $2,ibufp
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/cmd/as/as25.s b/.ref-Research-V7/usr/src/cmd/as/as25.s
deleted file mode 100644 (file)
index f8aaf11..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/
-/
-
-/ as25 is empty
diff --git a/.ref-Research-V7/usr/src/cmd/as/as26.s b/.ref-Research-V7/usr/src/cmd/as/as26.s
deleted file mode 100644 (file)
index b818624..0000000
+++ /dev/null
@@ -1,562 +0,0 @@
-/
-/
-
-/ a6 -- pdp-11 assembler pass 2
-
-opline:
-       mov     r4,r0
-       jsr     r5,betwen; 0; 177
-               br 2f
-       cmp     r4,$5
-       beq     opeof
-       cmp     r4,$'<
-       bne     xpr
-       jmp     opl17
-xxpr:
-       tst     (sp)+
-xpr:
-       jsr     pc,expres
-       jsr     pc,outw
-       rts     pc
-2:
-       movb    (r4),r0
-       cmp     r0,$24          /reg
-       beq     xpr
-       cmp     r0,$33          /est text
-       beq     xpr
-       cmp     r0,$34          / est data
-       beq     xpr
-       jsr     r5,betwen; 5; 36
-               br xpr
-       mov     2(r4),-(sp)
-       mov     r0,-(sp)
-       jsr     pc,readop
-       mov     (sp)+,r0
-       asl     r0
-       mov     $adrbuf,r5
-       clr     swapf
-       mov     $-1,rlimit
-       jmp     *1f-10.(r0)
-
-1:
-       opl5
-       opl6
-       opl7
-       opl10
-       opl11
-       opl12
-       opl13
-       opl14
-       opl15
-       opl16
-       opl17
-       opl20
-       opl21
-       opl22
-       opl23
-       xxpr
-       opl25
-       opl26
-       opl27
-       opl30
-       opl31
-       opl32
-       xxpr
-       xxpr
-       opl35
-       opl36
-
-opeof:
-       mov     $1,line
-       mov     $20,-(sp)
-       mov     $argb,r1
-1:
-       jsr     pc,getw
-       tst     r4
-       bmi     1f
-       movb    r4,(r1)+
-       dec     (sp)
-       bgt     1b
-       tstb    -(r1)
-       br      1b
-1:
-       movb    $'\n,(r1)+
-       clrb    (r1)+
-       tst     (sp)+
-       rts     pc
-
-opl30: / mpy, dvd etc
-       inc     swapf
-       mov     $1000,rlimit
-       br      opl13
-
-opl14:         / flop freg,fsrc
-       inc     swapf
-
-opl5:          / flop src,freg
-       mov     $400,rlimit
-
-/double
-opl13:
-       jsr     pc,addres
-op2a:
-       mov     r2,-(sp)
-       jsr     pc,readop
-op2b:
-       jsr     pc,addres
-       tst     swapf
-       beq     1f
-       mov     (sp),r0
-       mov     r2,(sp)
-       mov     r0,r2
-1:
-       swab    (sp)
-       asr     (sp)
-       asr     (sp)
-       cmp     (sp),rlimit
-       blo     1f
-       jsr     r5,error; 'x
-1:
-       bis     (sp)+,r2
-       bis     (sp)+,r2
-       clr     r3
-       jsr     pc,outw
-       mov     $adrbuf,r1
-1:
-       cmp     r1,r5
-       bhis    1f
-       mov     (r1)+,r2
-       mov     (r1)+,r3
-       mov     (r1)+,xsymbol
-       jsr     pc,outw
-       br      1b
-1:
-       rts     pc
-
-opl15:         / single operand
-       clr     -(sp)
-       br      op2b
-
-opl12:         / movf
-       mov     $400,rlimit
-       jsr     pc,addres
-       cmp     r2,$4           / see if source is fregister
-       blo     1f
-       inc     swapf
-       br      op2a
-1:
-       mov     $174000,(sp)
-       br      op2a
-
-/ jbr
-opl35:
-/ jeq, jne, etc
-opl36:
-       jsr     pc,expres
-       tstb    passno
-       bne     1f
-       mov     r2,r0
-       jsr     pc,setbr
-       tst     r2
-       beq     2f
-       cmp     (sp),$br
-       beq     2f
-       add     $2,r2
-2:
-       add     r2,dot          / if doesn't fit
-       add     $2,dot
-       tst     (sp)+
-       rts     pc
-1:
-       jsr     pc,getbr
-       bcc     dobranch
-       mov     (sp)+,r0
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       cmp     r0,$br
-       beq     2f
-       mov     $402,r2
-       xor     r0,r2           / flip cond, add ".+6"
-       mov     $1,r3
-       jsr     pc,outw
-2:
-       mov     $1,r3
-       mov     $jmp+37,r2
-       jsr     pc,outw
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       jsr     pc,outw
-       rts     pc
-
-/sob
-opl31: / sob
-       jsr     pc,expres
-       jsr     pc,checkreg
-       swab    r2
-       asr     r2
-       asr     r2
-       bis     r2,(sp)
-       jsr     pc,readop
-       jsr     pc,expres
-       tstb    passno
-       beq     3f
-       sub     dot,r2
-       neg     r2
-       mov     r2,r0
-       jsr     r5,betwen; -2; 175
-               br 2f
-       add     $4,r2
-       br      1f
-
-/branch
-opl6:
-       jsr     pc,expres
-       tstb    passno
-       beq     3f
-dobranch:
-       sub     dot,r2
-       mov     r2,r0
-       jsr     r5,betwen; -254.; 256.
-               br 2f
-1:
-       bit     $1,r2
-       bne     2f
-       cmp     r3,dot-2        / same relocation as .
-       bne     2f
-       asr     r2
-       dec     r2
-       bic     $177400,r2
-3:
-       bis     (sp)+,r2
-       clr     r3
-       jsr     pc,outw
-       rts     pc
-2:
-       jsr     r5,error; 'b
-       clr     r2
-       br      3b
-
-/jsr
-opl7:
-       jsr     pc,expres
-       jsr     pc,checkreg
-       jmp     op2a
-
-/ rts
-opl10:
-       jsr     pc,expres
-       jsr     pc,checkreg
-       br      1f
-
-/ sys, emt etc
-opl11:
-       jsr     pc,expres
-       cmp     r2,$256.
-       bhis    0f
-       cmp     r3,$1
-       ble     1f
-0:
-       jsr     pc,errora
-1:
-       bis     (sp)+,r2
-       jsr     pc,outw
-       rts     pc
-
-/ .byte
-opl16:
-       jsr     pc,expres
-       jsr     pc,outb
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       br      opl16
-1:
-       tst     (sp)+
-       rts     pc
-
-/ < (.ascii)
-opl17:
-       jsr     pc,getw
-       mov     $1,r3
-       mov     r4,r2
-       bmi     2f
-       bic     $!377,r2
-       jsr     pc,outb
-       br      opl17
-2:
-       jsr     pc,getw
-       rts     pc
-
-/.even
-opl20:
-       bit     $1,dot
-       beq     1f
-       cmp     dot-2,$4
-       beq     2f              / bss mode
-       clr     r2
-       clr     r3
-       jsr     pc,outb
-       br      1f
-2:
-       inc     dot
-1:
-       tst     (sp)+
-       rts     pc
-opl21: /if
-       jsr     pc,expres
-opl22:
-oplret:
-       tst     (sp)+
-       rts     pc
-
-
-/.globl
-opl23:
-       cmp     r4,$200
-       blo     1f
-       bisb    $40,(r4)
-       jsr     pc,readop
-       cmp     r4,$',
-       bne     1f
-       jsr     pc,readop
-       br      opl23
-1:
-       tst     (sp)+
-       rts     pc
-
-/ .text, .data, .bss
-opl25:
-opl26:
-opl27:
-       inc     dot
-       bic     $1,dot
-       mov     r0,-(sp)
-       mov     dot-2,r1
-       asl     r1
-       mov     dot,savdot-4(r1)
-       tstb    passno
-       beq     1f
-       jsr     r5,flush; txtp
-       jsr     r5,flush; relp
-       mov     (sp),r2
-       asl     r2
-       add     $txtseek-[4*25],r2
-       mov     r2,tseekp
-       mov     (r2),r0
-       mov     2(r2),r1
-       jsr     r5,oset; txtp
-       add     $trelseek-txtseek,r2
-       mov     (r2),r0
-       mov     2(r2),r1
-       mov     r2,rseekp
-       jsr     r5,oset; relp
-1:
-       mov     (sp)+,r0
-       mov     savdot-[2*25](r0),dot
-       asr     r0
-       sub     $25-2,r0
-       mov     r0,dot-2        / new . relocation
-       tst     (sp)+
-       rts     pc
-
-opl32:
-       cmp     r4,$200
-       blo     1f
-       mov     r4,-(sp)
-       jsr     pc,readop
-       jsr     pc,readop
-       jsr     pc,expres
-       mov     (sp)+,r0
-       bit     $37,(r0)
-       bne     1f
-       bis     $40,(r0)
-       mov     r2,2(r0)
-1:
-       tst     (sp)+
-       rts     pc
-
-addres:
-       clr     -(sp)
-4:
-       cmp     r4,$'(
-       beq     alp
-       cmp     r4,$'-
-       beq     amin
-       cmp     r4,$'$
-       beq     adoll
-       cmp     r4,$'*
-       bne     getx
-       jmp     astar
-getx:
-       jsr     pc,expres
-       cmp     r4,$'(
-       bne     2f
-       jsr     pc,readop
-       mov     r2,(r5)+
-       mov     r3,(r5)+
-       mov     xsymbol,(r5)+
-       jsr     pc,expres
-       jsr     pc,checkreg
-       jsr     pc,checkrp
-       bis     $60,r2
-       bis     (sp)+,r2
-       rts     pc
-
-2:
-       cmp     r3,$24
-       bne     1f
-       jsr     pc,checkreg
-       bis     (sp)+,r2
-       rts     pc
-1:
-       mov     r3,-(sp)
-       bic     $40,r3
-       mov     (sp)+,r3
-       bis     $100000,r3
-       sub     dot,r2
-       sub     $4,r2
-       cmp     r5,$adrbuf
-       beq     1f
-       sub     $2,r2
-1:
-       mov     r2,(r5)+                / index
-       mov     r3,(r5)+                / index reloc.
-       mov     xsymbol,(r5)+           / index global
-       mov     $67,r2                  / address mode
-       bis     (sp)+,r2
-       rts     pc
-
-alp:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       cmp     r4,$'+
-       beq     1f
-       tst     (sp)+
-       beq     2f
-       bis     $70,r2
-       clr     (r5)+
-       clr     (r5)+
-       mov     xsymbol,(r5)+
-       rts     pc
-2:
-       bis     $10,r2
-       rts     pc
-1:
-       jsr     pc,readop
-       bis     $20,r2
-       bis     (sp)+,r2
-       rts     pc
-
-amin:
-       jsr     pc,readop
-       cmp     r4,$'(
-       beq     1f
-       mov     r4,savop
-       mov     $'-,r4
-       br      getx
-1:
-       jsr     pc,readop
-       jsr     pc,expres
-       jsr     pc,checkrp
-       jsr     pc,checkreg
-       bis     (sp)+,r2
-       bis     $40,r2
-       rts     pc
-
-adoll:
-       jsr     pc,readop
-       jsr     pc,expres
-       mov     r2,(r5)+
-       mov     r3,(r5)+
-       mov     xsymbol,(r5)+
-       mov     (sp)+,r2
-       bis     $27,r2
-       rts     pc
-
-astar:
-       tst     (sp)
-       beq     1f
-       jsr     r5,error; '*
-1:
-       mov     $10,(sp)
-       jsr     pc,readop
-       jmp     4b
-
-errora:
-       jsr     r5,error; 'a
-       rts     pc
-
-checkreg:
-       cmp     r2,$7
-       bhi     1f
-       cmp     r1,$1
-       blos    2f
-       cmp     r3,$5
-       blo     1f
-2:
-       rts     pc
-1:
-       jsr     pc,errora
-       clr     r2
-       clr     r3
-       rts     pc
-
-errore:
-       jsr     r5,error; 'e
-       rts     pc
-
-checkrp:
-       cmp     r4,$')
-       beq     1f
-       jsr     r5,error; ')
-       rts     pc
-1:
-       jsr     pc,readop
-       rts     pc
-
-setbr:
-       mov     brtabp,r1
-       cmp     r1,$brlen
-       blt     1f
-       mov     $2,r2
-       rts     pc
-1:
-       inc     brtabp
-       clr     -(sp)
-       sub     dot,r0
-       ble     1f
-       sub     brdelt,r0
-1:
-       jsr     r5,betwen; -254.; 256.
-               br 1f
-       br      2f
-1:
-       mov     r1,-(sp)
-       bic     $!7,(sp)
-       mov     $1,r0
-       ash     (sp)+,r0
-       ash     $-3,r1
-       bisb    r0,brtab(r1)
-       mov     $2,(sp)
-2:
-       mov     (sp)+,r2
-       rts     pc
-
-getbr:
-       mov     brtabp,r1
-       cmp     r1,$brlen
-       blt     1f
-       sec
-       rts     pc
-1:
-       mov     r1,-(sp)
-       bic     $!7,(sp)
-       neg     (sp)
-       inc     brtabp
-       ash     $-3,r1
-       movb    brtab(r1),r1
-       ash     (sp)+,r1
-       ror     r1              / 0-bit into c-bit
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/cmd/as/as27.s b/.ref-Research-V7/usr/src/cmd/as/as27.s
deleted file mode 100644 (file)
index cfcfaa8..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/
-/
-
-/  a7 -- pdp-11 assembler
-
-expres:
-       clr     xsymbol
-expres1:
-       mov     r5,-(sp)
-       mov     $'+,-(sp)
-       clr     r2
-       mov     $1,r3
-       br      1f
-advanc:
-       jsr     pc,readop
-1:
-       mov     r4,r0
-       jsr     r5,betwen; 0; 177
-               br .+4
-       br      7f
-       movb    (r4),r0
-       tst     r0
-       bne     1f
-       tstb    passno
-       beq     1f
-       jsr     r5,error; 'u
-1:
-       cmp     r0,$40
-       bne     1f
-       mov     r4,xsymbol
-       clr     r1
-       br      oprand
-1:
-       mov     2(r4),r1
-       br      oprand
-7:
-       cmp     r4,$141
-       blo     1f
-       asl     r4
-       mov     curfb-[2*141](r4),r0
-       mov     2(r0),r1
-       movb    (r0),r0
-       br      oprand
-1:
-       mov     $esw1,r1
-1:
-       cmp     (r1)+,r4
-       beq     1f
-       tst     (r1)+
-       bne     1b
-       tst     (sp)+
-       mov     (sp)+,r5
-       rts     pc
-1:
-       jmp     *(r1)
-
-esw1:
-       '+;     binop
-       '-;     binop
-       '*;     binop
-       '/;     binop
-       '&;     binop
-       037;    binop
-       035;    binop
-       036;    binop
-       '%;     binop
-       '[;     brack
-       '^;     binop
-       1;      exnum
-       2;      exnum1
-       '!;     binop
-       200;    0
-
-binop:
-       cmpb    (sp),$'+
-       beq     1f
-       jsr     pc,errore
-1:
-       movb    r4,(sp)
-       br      advanc
-
-exnum1:
-       mov     numval,r1
-       br      1f
-
-exnum:
-       jsr     pc,getw
-       mov     r4,r1
-1:
-       mov     $1,r0
-       br      oprand
-
-brack:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       jsr     pc,readop
-       jsr     pc,expres1
-       cmp     r4,$']
-       beq     1f
-       jsr     r5,error; ']
-1:
-       mov     r3,r0
-       mov     r2,r1
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-
-oprand:
-       mov     $exsw2,r5
-1:
-       cmp     (sp),(r5)+
-       beq     1f
-       tst     (r5)+
-       bne     1b
-       br      eoprnd
-1:
-       jmp     *(r5)
-
-exsw2:
-       '+; exadd
-       '-; exsub
-       '*; exmul
-       '/; exdiv
-       037; exor
-       '&; exand
-       035;exlsh
-       036;exrsh
-       '%; exmod
-       '^; excmbin
-       '!; exnot
-       200;  0
-
-excmbin:
-       mov     r0,r3
-       br      eoprnd
-
-exrsh:
-       neg     r1
-       beq     exlsh
-       inc     r1
-       clc
-       ror     r2
-exlsh:
-       jsr     r5,combin; relte2
-       als     r1,r2
-       br      eoprnd
-
-exmod:
-       jsr     r5,combin; relte2
-       mov     r3,r0
-       mov     r2,r3
-       clr     r2
-       dvd     r1,r2
-       mov     r3,r2
-       mov     r0,r3
-       br      eoprnd
-
-exadd:
-       jsr     r5,combin; reltp2
-       add     r1,r2
-       br      eoprnd
-
-exsub:
-       jsr     r5,combin; reltm2
-       sub     r1,r2
-       br      eoprnd
-
-exand:
-       jsr     r5,combin; relte2
-       com     r1
-       bic     r1,r2
-       br      eoprnd
-
-exor:
-       jsr     r5,combin; relte2
-       bis     r1,r2
-       br      eoprnd
-
-exmul:
-       jsr     r5,combin; relte2
-       mpy     r2,r1
-       mov     r1,r2
-       br      eoprnd
-
-exdiv:
-       jsr     r5,combin; relte2
-       mov     r3,r0
-       mov     r2,r3
-       clr     r2
-       dvd     r1,r2
-       mov     r0,r3
-       br      eoprnd
-
-exnot:
-       jsr     r5,combin; relte2
-       com     r1
-       add     r1,r2
-       br      eoprnd
-
-eoprnd:
-       mov     $'+,(sp)
-       jmp     advanc
-
-combin:
-       tstb    passno
-       bne     combin1
-       mov     r0,-(sp)
-       bis     r3,(sp)
-       bic     $!40,(sp)
-       bic     $!37,r0
-       bic     $!37,r3
-       cmp     r0,r3
-       ble     1f
-       mov     r0,-(sp)
-       mov     r3,r0
-       mov     (sp)+,r3
-1:
-       tst     r0
-       beq     1f
-       cmp     (r5)+,$reltm2
-       bne     2f
-       cmp     r0,r3
-       bne     2f
-       mov     $1,r3
-       br      2f
-1:
-       tst     (r5)+
-       clr     r3
-2:
-       bis     (sp)+,r3
-       rts     r5
-combin1:
-       mov     r1,-(sp)
-       clr     maxtyp
-       jsr     pc,maprel
-       mov     r0,r1
-       mpy     $6,r1
-       mov     r3,r0
-       jsr     pc,maprel
-       add     (r5)+,r0
-       add     r1,r0
-       movb    (r0),r3
-       bpl     1f
-       cmp     r3,$-1
-       beq     2f
-       jsr     r5,error; 'r
-2:
-       mov     maxtyp,r3
-1:
-       mov     (sp)+,r1
-       rts     r5
-
-maprel:
-       cmp     r0,$40
-       bne     1f
-       mov     $5,r0
-       rts     pc
-1:
-       bic     $!37,r0
-       cmp     r0,maxtyp
-       blos    1f
-       mov     r0,maxtyp
-1:
-       cmp     r0,$5
-       blo     1f
-       mov     $1,r0
-1:
-       rts     pc
-
-X = -2
-M = -1
-reltp2:
-       .byte 0, 0, 0, 0, 0, 0
-       .byte 0, M, 2, 3, 4,40
-       .byte 0, 2, X, X, X, X
-       .byte 0, 3, X, X, X, X
-       .byte 0, 4, X, X, X, X
-       .byte 0,40, X, X, X, X
-
-reltm2:
-       .byte 0, 0, 0, 0, 0, 0
-       .byte 0, M, 2, 3, 4,40
-       .byte 0, X, 1, X, X, X
-       .byte 0, X, X, 1, X, X
-       .byte 0, X, X, X, 1, X
-       .byte 0, X, X, X, X, X
-
-relte2:
-       .byte 0, 0, 0, 0, 0, 0
-       .byte 0, M, X, X, X, X
-       .byte 0, X, X, X, X, X
-       .byte 0, X, X, X, X, X
-       .byte 0, X, X, X, X, X
-       .byte 0, X, X, X, X, X
-
diff --git a/.ref-Research-V7/usr/src/cmd/as/as28.s b/.ref-Research-V7/usr/src/cmd/as/as28.s
deleted file mode 100644 (file)
index a5e03cc..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/
-/
-
-/ as8 -- PDP-11 assembler pass 2
-
-qnl:   <?\n>
-a.out: <a.out\0>
-.even
-.data
-a.outp:        a.out
-
-a.tmp1:        0
-a.tmp2:        0
-a.tmp3:        0
-
-tseekp:        txtseek
-rseekp:        trelseek
-
-txtmagic:
-       br      .+20
-txtsiz:        .=.+2
-datsiz:        .=.+2
-bsssiz:        .=.+2
-symsiz:        .=.+2
-stksiz:        .=.+2
-exorig:        .=.+2
-       .=.+2
-
-txtseek:0; 20
-datseek:.=.+4
-       .=.+4
-trelseek:.=.+4
-drelseek:.=.+4
-       .=.+4
-symseek:.=.+4
-
-.bss
-
-brlen  = 1024.
-brtab: .=.+[brlen\/8.]
-brtabp:        .=.+2
-brdelt:        .=.+2
-fbbufp:        .=.+2
-defund:        .=.+2
-savdot:        .=.+6
-datbase:.=.+2
-bssbase:.=.+2
-fbfil: .=.+2
-fin:   .=.+2
-ibufc: .=.+2
-txtfil:        .=.+2
-symf:  .=.+2
-adrbuf:        .=.+12.
-xsymbol:.=.+2
-fout:  .=.+2
-ch:    .=.+2
-errflg:        .=.+2
-wordf: .=.+2
-argb:  .=.+22.
-line:  .=.+2
-savop: .=.+2
-curfb: .=.+20.
-nxtfb: .=.+20.
-numval:        .=.+2
-maxtyp:        .=.+2
-relfil:        .=.+2
-ibufp: .=.+2
-txtp:  .=.+8+512.
-relp:  .=.+8+512.
-swapf: .=.+2
-rlimit:        .=.+2
-passno:        .=.+2
-endtable:.=.+2
-usymtab:.=.+20.
-end:
-
-.text
diff --git a/.ref-Research-V7/usr/src/cmd/as/as29.s b/.ref-Research-V7/usr/src/cmd/as/as29.s
deleted file mode 100644 (file)
index c17cae2..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/
-/
-
-/ as9 -- PDP-11 assembler pass 2
-
-eae = 0
-
-       .data
-symtab:
-
-/ special variables
-
-dotrel: 02; dot:000000 /.
- 01; dotdot:000000 /..
-
-/ register
-
-24;000000 /r0
-24;000001 /r1
-24;000002 /r2
-24;000003 /r3
-24;000004 /r4
-24;000005 /r5
-24;000006 /sp
-24;000007 /pc
-
-
-.if eae
-/eae & switches
-
-01;177570 /csw
-01;177300 /div
-01;177302 /ac
-01;177304 /mq
-01;177306 /mul
-01;177310 /sc
-01;177311 /sr
-01;177312 /nor
-01;177314 /lsh
-01;177316 /ash
-
-.endif
-
-/ double operand
-
-13;0010000 /mov
-13;0110000 /movb
-13;0020000 /cmp
-13;0120000 /cmpb
-13;0030000 /bit
-13;0130000 /bitb
-13;0040000 /bic
-13;0140000 /bicb
-13;0050000 /bis
-13;0150000 /bisb
-13;0060000 /add
-13;0160000 /sub
-
-/ branch
-
-06;0000400 /br
-06;0001000 /bne
-06;0001400 /beq
-06;0002000 /bge
-06;0002400 /blt
-06;0003000 /bgt
-06;0003400 /ble
-06;0100000 /bpl
-06;0100400 /bmi
-06;0101000 /bhi
-06;0101400 /blos
-06;0102000 /bvc
-06;0102400 /bvs
-06;0103000 /bhis
-06;0103000 /bec
-06;0103000 /bcc
-06;0103400 /blo
-06;0103400 /bcs
-06;0103400 /bes
-
-/ jump/ branch type
-
-35;0000400 /jbr
-36;0001000 /jne
-36;0001400 /jeq
-36;0002000 /jge
-36;0002400 /jlt
-36;0003000 /jgt
-36;0003400 /jle
-36;0100000 /jpl
-36;0100400 /jmi
-36;0101000 /jhi
-36;0101400 /jlos
-36;0102000 /jvc
-36;0102400 /jvs
-36;0103000 /jhis
-36;0103000 /jec
-36;0103000 /jcc
-36;0103400 /jlo
-36;0103400 /jcs
-36;0103400 /jes
-
-/ single operand
-
-15;0005000 /clr
-15;0105000 /clrb
-15;0005100 /com
-15;0105100 /comb
-15;0005200 /inc
-15;0105200 /incb
-15;0005300 /dec
-15;0105300 /decb
-15;0005400 /neg
-15;0105400 /negb
-15;0005500 /adc
-15;0105500 /adcb
-15;0005600 /sbc
-15;0105600 /sbcb
-15;0005700 /tst
-15;0105700 /tstb
-15;0006000 /ror
-15;0106000 /rorb
-15;0006100 /rol
-15;0106100 /rolb
-15;0006200 /asr
-15;0106200 /asrb
-15;0006300 /asl
-15;0106300 /aslb
-15;0000100 /jmp
-15;0000300 /swab
-
-/ jsr
-
-07;0004000 /jsr
-
-/ rts
-
-10;000200 /rts
-
-/ simple operand
-
-11;104400 /sys
-
-/ flag-setting
-
-01;0000241 /clc
-01;0000242 /clv
-01;0000244 /clz
-01;0000250 /cln
-01;0000261 /sec
-01;0000262 /sev
-01;0000264 /sez
-01;0000270 /sen
-
-/ floating point ops
-
-01;170000 / cfcc
-01;170001 / setf
-01;170011 / setd
-01;170002 / seti
-01;170012 / setl
-15;170400 / clrf
-15;170700 / negf
-15;170600 / absf
-15;170500 / tstf
-12;172400 / movf
-14;177000 / movif
-05;175400 / movfi
-14;177400 / movof
-05;176000 / movfo
-14;172000 / addf
-14;173000 / subf
-14;171000 / mulf
-14;174400 / divf
-14;173400 / cmpf
-14;171400 / modf
-14;176400 / movie
-05;175000 / movei
-15;170100 / ldfps
-15;170200 / stfps
-24;000000 / fr0
-24;000001 / fr1
-24;000002 / fr2
-24;000003 / fr3
-24;000004 / fr4
-24;000005 / fr5
-
-/ 11/45 operations
-
-30;072000 /als (ash)
-30;073000 /alsc (ashc)
-30;070000 /mpy
-.if eae-1
-30;070000/ mul
-30;071000 / div
-30;072000 / ash
-30;073000 /ashc
-.endif
-30;071000 /dvd
-07;074000 /xor
-15;006700 /sxt
-11;006400 /mark
-31;077000 /sob
-
-/ specials
-
-16;000000 /.byte
-20;000000 /.even
-21;000000 /.if
-22;000000 /.endif
-23;000000 /.globl
-25;000000 /.text
-26;000000 /.data
-27;000000 /.bss
-32;000000 /.comm
-
-start:
-       mov     (sp)+,r0
-       tst     (sp)+
-1:
-       mov     (sp)+,r1
-       cmpb    (r1),$'-
-       bne     1f
-       dec     r0
-       cmpb    1(r1),$'g
-       bne     2f
-       mov     $40,defund      / globalize externals
-       br      1b
-2:
-       cmpb    1(r1),$'o
-       bne     1b
-       dec     r0
-       mov     (sp)+,r1
-       mov     r1,a.outp
-       mov     r1,a.outp1
-       mov     r1,a.outp2
-       br      1b
-1:
-       cmp     r0,$4
-       bge     1f
-       jmp     aexit
-1:
-       mov     r1,a.tmp1
-       mov     (sp)+,a.tmp2
-       mov     (sp)+,a.tmp3
-       jsr     r5,ofile; a.tmp1
-       movb    r0,txtfil
-       jsr     r5,ofile; a.tmp2
-       movb    r0,fbfil
-       jsr     r5,ofile; a.tmp3
-       movb    r0,symf
-       movb    r0,fin
-       sys     creat; a.outp1:a.out; 666
-       bec     1f
-       jsr     r5,filerr; a.outp
-1:
-       movb    r0,fout
-       jmp     go
-
-/ overlaid buffer
-inbuf  = start
-.      = inbuf+512.
diff --git a/.ref-Research-V7/usr/src/cmd/as/makefile b/.ref-Research-V7/usr/src/cmd/as/makefile
deleted file mode 100644 (file)
index 899a596..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-all:   as as2
-
-cmp:   as as2
-       cmp as /bin/as
-       cmp as2 /lib/as2
-       rm as as2 a.out
-
-cp:    as as2
-       cp as /bin/as
-       cp as2 /lib/as2
-       rm as as2 a.out
-
-as:
-       as /usr/include/sys.s as1?.s
-       ld -n -s a.out -o as
-
-as2:
-       as /usr/include/sys.s as2?.s
-       ld -n -s a.out -o as2
diff --git a/.ref-Research-V7/usr/src/cmd/at.c b/.ref-Research-V7/usr/src/cmd/at.c
deleted file mode 100644 (file)
index bc5e60f..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * at time mon day
- * at time wday
- * at time wday 'week'
- *
- */
-#include <stdio.h>
-#include <ctype.h>
-#include <time.h>
-#include <signal.h>
-
-#define HOUR 100
-#define HALFDAY        (12*HOUR)
-#define DAY    (24*HOUR)
-#define THISDAY "/usr/spool/at"
-
-char *days[] = {
-       "sunday",
-       "monday",
-       "tuesday",
-       "wednesday",
-       "thursday",
-       "friday",
-       "saturday",
-};
-
-struct monstr {
-       char *mname; 
-       int mlen;
-} months[] = {
-       { "january", 31 },
-       { "february", 28 },
-       { "march", 31 },
-       { "april", 30 },
-       { "may", 31 },
-       { "june", 30 },
-       { "july", 31 },
-       { "august", 31 },
-       { "september", 30 },
-       { "october", 31 },
-       { "november", 30 },
-       { "december", 31 },
-       { 0, 0 },
-};
-
-char   fname[100];
-int    utime;  /* requested time in grains */
-int    now;    /* when is it */
-int    uday; /* day of year to be done */
-int    uyear; /* year */
-int    today; /* day of year today */
-FILE   *file;
-FILE   *ifile;
-char   **environ;
-char   *prefix();
-FILE   *popen();
-
-main(argc, argv)
-char **argv;
-{
-       extern onintr();
-       register c;
-       char pwbuf[100];
-       FILE *pwfil;
-       int larg;
-
-       /* argv[1] is the user's time: e.g.,  3AM */
-       /* argv[2] is a month name or day of week */
-       /* argv[3] is day of month or 'week' */
-       /* another argument might be an input file */
-       if (argc < 2) {
-               fprintf(stderr, "at: arg count\n");
-               exit(1);
-       }
-       makeutime(argv[1]);
-       larg = makeuday(argc,argv)+1;
-       if (uday==today && larg<=2 && utime<=now)
-               uday++;
-       c = uyear%4==0? 366: 365;
-       if (uday >= c) {
-               uday -= c;
-               uyear++;
-       }
-       filename(THISDAY, uyear, uday, utime);
-       ifile = stdin;
-       if (argc > larg)
-               ifile = fopen(argv[larg], "r");
-       if (ifile == NULL) {
-               fprintf(stderr, "at: cannot open input: %s\n", argv[larg]);
-               exit(1);
-       }
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, onintr);
-       file = fopen(fname, "a");
-       chmod(fname, 0644);
-       if (file == NULL) {
-               fprintf(stderr, "at: cannot open memo file\n");
-               exit(1);
-       }
-       if ((pwfil = popen("pwd", "r")) == NULL) {
-               fprintf(stderr, "at: can't execute pwd\n");
-               exit(1);
-       }
-       fgets(pwbuf, 100, pwfil);
-       pclose(pwfil);
-       fprintf(file, "cd %s", pwbuf);
-       if (environ) {
-               char **ep = environ;
-               while(*ep)
-                       fprintf(file, "%s\n", *ep++);
-       }
-       while((c = getc(ifile)) != EOF) {
-               putc(c, file);
-       }
-       exit(0);
-}
-
-makeutime(pp)
-char *pp; 
-{
-       register val;
-       register char *p;
-
-       /* p points to a user time */
-       p = pp;
-       val = 0;
-       while(isdigit(*p)) {
-               val = val*10+(*p++ -'0');
-       }
-       if (p-pp < 3)
-               val *= HOUR;
-
-       for (;;) {
-               switch(*p) {
-
-               case ':':
-                       ++p;
-                       if (isdigit(*p)) {
-                               if (isdigit(p[1])) {
-                                       val +=(10* *p + p[1] - 11*'0');
-                                       p += 2;
-                                       continue;
-                               }
-                       }
-                       fprintf(stderr, "at: bad time format:\n");
-                       exit(1);
-
-               case 'A':
-               case 'a':
-                       if (val >= HALFDAY+HOUR)
-                               val = DAY+1;  /* illegal */
-                       if (val >= HALFDAY && val <(HALFDAY+HOUR))
-                               val -= HALFDAY;
-                       break;
-
-               case 'P':
-               case 'p':
-                       if (val >= HALFDAY+HOUR)
-                               val = DAY+1;  /* illegal */
-                       if (val < HALFDAY)
-                               val += HALFDAY;
-                       break;
-
-               case 'n':
-               case 'N':
-                       val = HALFDAY;
-                       break;
-
-               case 'M':
-               case 'm':
-                       val = 0;
-                       break;
-
-
-               case '\0':
-               case ' ':
-                       /* 24 hour time */
-                       if (val == DAY)
-                               val -= DAY;
-                       break;
-
-               default:
-                       fprintf(stderr, "at: bad time format\n");
-                       exit(1);
-
-               }
-               break;
-       }
-       if (val < 0 || val >= DAY) {
-               fprintf(stderr, "at: time out of range\n");
-               exit(1);
-       }
-       if (val%HOUR >= 60) {
-               fprintf(stderr, "at: illegal minute field\n");
-               exit(1);
-       }
-       utime = val;
-}
-
-
-makeuday(argc,argv)
-char **argv;
-{
-       /* the presumption is that argv[2], argv[3] are either
-          month day OR weekday [week].  Returns either 2 or 3 as last
-          argument used */
-       /* first of all, what's today */
-       long tm;
-       int found = -1;
-       char **ps;
-       struct tm *detail, *localtime();
-       struct monstr *pt;
-
-       time(&tm);
-       detail = localtime(&tm);
-       uday = today = detail->tm_yday;
-       uyear = detail->tm_year;
-       now = detail->tm_hour*100+detail->tm_min;
-       if (argc<=2)
-               return(1);
-       /* is the next argument a month name ? */
-       for (pt=months; pt->mname; pt++) {
-               if (prefix(argv[2], pt->mname)) {
-                       if (found<0)
-                               found = pt-months;
-                       else {
-                               fprintf(stderr, "at: ambiguous month\n");
-                               exit(1);
-                       }
-               }
-       }
-       if (found>=0) {
-               if (argc<=3)
-                       return(2);
-               uday = atoi(argv[3]) - 1;
-               if (uday<0) {
-                       fprintf(stderr, "at: illegal day\n");
-                       exit(1);
-               }
-               while(--found>=0)
-                       uday += months[found].mlen;
-               if (detail->tm_year%4==0 && uday>59)
-                       uday += 1;
-               return(3);
-       }
-       /* not a month, try day of week */
-       found = -1;
-       for (ps=days; ps<days+7; ps++) {
-               if (prefix(argv[2], *ps)) {
-                       if (found<0)
-                               found = ps-days;
-                       else {
-                               fprintf(stderr, "at: ambiguous day of week\n");
-                               exit(1);
-                       }
-               }
-       }
-       if (found<0)
-               return(1);
-       /* find next day of this sort */
-       uday = found - detail->tm_wday;
-       if (uday<=0)
-               uday += 7;
-       uday += today;
-       if (argc>3 && strcmp("week", argv[3])==0) {
-               uday += 7;
-               return(3);
-       }
-       return(2);
-}
-
-char *
-prefix(begin, full)
-char *begin, *full;
-{
-       int c;
-       while (c = *begin++) {
-               if (isupper(c))
-                       c = tolower(c);
-               if (*full != c)
-                       return(0);
-               else
-                       full++;
-       }
-       return(full);
-}
-
-filename(dir, y, d, t)
-char *dir;
-{
-       register i;
-
-       for (i=0; ; i += 53) {
-               sprintf(fname, "%s/%02d.%03d.%04d.%02d", dir, y, d, t,
-                  (getpid()+i)%100);
-               if (access(fname, 0) == -1)
-                       return;
-       }
-}
-
-onintr()
-{
-       unlink(fname);
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/atrun.c b/.ref-Research-V7/usr/src/cmd/atrun.c
deleted file mode 100644 (file)
index e997fad..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Run programs submitted by at.
- */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/dir.h>
-#include <time.h>
-#include <sys/stat.h>
-
-# define DIR "/usr/spool/at"
-# define PDIR  "past"
-# define LASTF "/usr/spool/at/lasttimedone"
-
-int    nowtime;
-int    nowdate;
-int    nowyear;
-
-main(argc, argv)
-char **argv;
-{
-       int tt, day, year, uniq;
-       struct direct dirent;
-       char file[DIRSIZ+1];
-       FILE *dirf;
-
-       chdir(DIR);
-       makenowtime();
-       if ((dirf = fopen(".", "r")) == NULL) {
-               fprintf(stderr, "Cannot read at directory\n");
-               exit(1);
-       }
-       while (fread((char *)&dirent, sizeof(dirent), 1, dirf) == 1) {
-               if (dirent.d_ino==0)
-                       continue;
-               strncpy(file, dirent.d_name, DIRSIZ);
-               file[DIRSIZ] = '\0';
-               if (sscanf(file, "%2d.%3d.%4d.%2d", &year, &day, &tt, &uniq) != 4)
-                       continue;
-               if (nowyear < year)
-                       continue;
-               if (nowyear==year && nowdate < day)
-                       continue;
-               if (nowyear==year && nowdate==day && nowtime < tt)
-                       continue;
-               run(file);
-       }
-       fclose(dirf);
-       updatetime(nowtime);
-       exit(0);
-}
-
-makenowtime()
-{
-       long t;
-       struct tm *localtime();
-       register struct tm *tp;
-
-       time(&t);
-       tp = localtime(&t);
-       nowtime = tp->tm_hour*100 + tp->tm_min;
-       nowdate = tp->tm_yday;
-       nowyear = tp->tm_year;
-}
-
-updatetime(t)
-{
-       FILE *tfile;
-
-       tfile = fopen(LASTF, "w");
-       if (tfile == NULL) {
-               fprintf(stderr, "can't write lastfile\n");
-               exit(1);
-       }
-       fprintf(tfile, "%04d\n", t);
-}
-
-run(file)
-char *file;
-{
-       struct stat stbuf;
-       register pid, i;
-       char sbuf[64];
-
-       if (fork()!=0)
-               return;
-       for (i=0; i<15; i++)
-               close(i);
-       dup(dup(open("/dev/null", 0)));
-       sprintf(sbuf, "/bin/mv %.14s %s", file, PDIR);
-       system(sbuf);
-       chdir(PDIR);
-       if (stat(file, &stbuf) == -1)
-               exit(1);
-       setgid(stbuf.st_gid);
-       setuid(stbuf.st_uid);
-       if (pid = fork()) {
-               if (pid == -1)
-                       exit(1);
-               wait((int *)0);
-               unlink(file);
-               exit(0);
-       }
-       nice(3);
-       execl("/bin/sh", "sh", file, 0);
-       execl("/usr/bin/sh", "sh", file, 0);
-       fprintf(stderr, "Can't execl shell\n");
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/awk.def b/.ref-Research-V7/usr/src/cmd/awk/awk.def
deleted file mode 100644 (file)
index e1d7d5a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#define        xfree(a)        { if(a!=NULL) yfree(a); a=NULL;}
-#define yfree free
-#ifdef DEBUG
-#      define  dprintf if(dbg)printf
-#else
-#      define  dprintf(x1, x2, x3, x4)
-#endif
-typedef        double  awkfloat;
-
-extern char    **FS;
-extern char    **RS;
-extern char    **ORS;
-extern char    **OFS;
-extern char    **OFMT;
-extern awkfloat *NR;
-extern awkfloat *NF;
-extern char    **FILENAME;
-
-extern char    record[];
-extern int     dbg;
-extern int     lineno;
-extern int     errorflag;
-extern int     donefld;        /* 1 if record broken into fields */
-extern int     donerec;        /* 1 if record is valid (no fld has changed */
-
-typedef struct val {   /* general value during processing */
-       char    *nval;  /* name, for variables only */
-       char    *sval;  /* string value */
-       awkfloat        fval;   /* value as number */
-       unsigned        tval;   /* type info */
-       struct val      *nextval;       /* ptr to next if chained */
-} cell;
-extern cell *symtab[];
-cell   *setsymtab(), *lookup(), **makesymtab();
-
-extern cell    *recloc;        /* location of input record */
-extern cell    *nrloc;         /* NR */
-extern cell    *nfloc;         /* NF */
-
-#define        STR     01      /* string value is valid */
-#define        NUM     02      /* number value is valid */
-#define FLD    04      /* FLD means don't free string space */
-#define        CON     010     /* this is a constant */
-#define        ARR     020     /* this is an array */
-
-awkfloat setfval(), getfval();
-char   *setsval(), *getsval();
-char   *tostring(), *tokname(), *malloc();
-double log(), sqrt(), exp(), atof();
-
-/* function types */
-#define        FLENGTH 1
-#define        FSQRT   2
-#define        FEXP    3
-#define        FLOG    4
-#define        FINT    5
-
-typedef struct {
-       char otype;
-       char osub;
-       cell *optr;
-} obj;
-
-#define BOTCH  1
-struct nd {
-       char ntype;
-       char subtype;
-       struct nd *nnext;
-       int nobj;
-       struct nd *narg[BOTCH]; /* C won't take a zero length array */
-};
-typedef struct nd node;
-extern node    *winner;
-extern node    *nullstat;
-
-/* otypes */
-#define OCELL  0
-#define OEXPR  1
-#define OBOOL  2
-#define OJUMP  3
-
-/* cell subtypes */
-#define CTEMP  4
-#define CNAME  3 
-#define CVAR   2
-#define CFLD   1
-#define CCON   0
-
-/* bool subtypes */
-#define BTRUE  1
-#define BFALSE 2
-
-/* jump subtypes */
-#define JEXIT  1
-#define JNEXT  2
-#define        JBREAK  3
-#define        JCONT   4
-
-/* node types */
-#define NVALUE 1
-#define NSTAT  2
-#define NEXPR  3
-#define NPA2   4
-
-extern obj     (*proctab[])();
-extern obj     true, false;
-extern int     pairstack[], paircnt;
-
-#define cantexec(n)    (n->ntype == NVALUE)
-#define notlegal(n)    (n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN]== nullproc)
-#define isexpr(n)      (n->ntype == NEXPR)
-#define isjump(n)      (n.otype == OJUMP)
-#define isexit(n)      (n.otype == OJUMP && n.osub == JEXIT)
-#define        isbreak(n)      (n.otype == OJUMP && n.osub == JBREAK)
-#define        iscont(n)       (n.otype == OJUMP && n.osub == JCONT)
-#define        isnext(n)       (n.otype == OJUMP && n.osub == JNEXT)
-#define isstr(n)       (n.optr->tval & STR)
-#define istrue(n)      (n.otype == OBOOL && n.osub == BTRUE)
-#define istemp(n)      (n.otype == OCELL && n.osub == CTEMP)
-#define isfld(n)       (!donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval==0)
-#define isrec(n)       (donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval!=0)
-obj    nullproc();
-obj    relop();
-
-#define MAXSYM 16
-#define        HAT     0177    /* matches ^ in regular expr */
-                       /* watch out for mach dep */
diff --git a/.ref-Research-V7/usr/src/cmd/awk/awk.g.y b/.ref-Research-V7/usr/src/cmd/awk/awk.g.y
deleted file mode 100644 (file)
index 3a51f76..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-%token FIRSTTOKEN      /*must be first*/
-%token FINAL FATAL
-%token LT LE GT GE EQ NE
-%token MATCH NOTMATCH
-%token APPEND
-%token ADD MINUS MULT DIVIDE MOD UMINUS 
-%token ASSIGN ADDEQ SUBEQ MULTEQ DIVEQ MODEQ
-%token JUMP
-%token XBEGIN XEND
-%token NL
-%token PRINT PRINTF SPRINTF SPLIT
-%token IF ELSE WHILE FOR IN NEXT EXIT BREAK CONTINUE
-%token PROGRAM PASTAT PASTAT2
-
-%right ASGNOP
-%left  BOR
-%left  AND
-%left  NOT
-%left  NUMBER VAR ARRAY FNCN SUBSTR LSUBSTR INDEX
-%nonassoc RELOP MATCHOP
-%left  OR
-%left  STRING  DOT CCL NCCL CHAR
-%left  '(' '^' '$'
-%left  CAT
-%left  '+' '-'
-%left  '*' '/' '%'
-%left  STAR PLUS QUEST
-%left  POSTINCR PREINCR POSTDECR PREDECR INCR DECR
-%left  FIELD INDIRECT
-%token LASTTOKEN       /* has to be last */
-
-%{
-#include "awk.def"
-#ifndef        DEBUG   
-#      define  PUTS(x)
-#endif
-%}
-%%
-
-program:
-         begin pa_stats end    { if (errorflag==0) winner = stat3(PROGRAM, $1, $2, $3); }
-       | error                 { yyclearin; yyerror("bailing out"); }
-       ;
-
-begin:
-         XBEGIN '{' stat_list '}'      { PUTS("XBEGIN list"); $$ = $3; }
-       | begin NL
-       |       { PUTS("empty XBEGIN"); $$ = nullstat; }
-       ;
-
-end:
-         XEND '{' stat_list '}'        { PUTS("XEND list"); $$ = $3; }
-       | end NL
-       |       { PUTS("empty END"); $$ = nullstat; }
-       ;
-
-compound_conditional:
-         conditional BOR conditional   { PUTS("cond||cond"); $$ = op2(BOR, $1, $3); }
-       | conditional AND conditional   { PUTS("cond&&cond"); $$ = op2(AND, $1, $3); }
-       | NOT conditional               { PUTS("!cond"); $$ = op1(NOT, $2); }
-       | '(' compound_conditional ')'  { $$ = $2; }
-       ;
-
-compound_pattern:
-         pattern BOR pattern   { PUTS("pat||pat"); $$ = op2(BOR, $1, $3); }
-       | pattern AND pattern   { PUTS("pat&&pat"); $$ = op2(AND, $1, $3); }
-       | NOT pattern           { PUTS("!pat"); $$ = op1(NOT, $2); }
-       | '(' compound_pattern ')'      { $$ = $2; }
-       ;
-
-conditional:
-         expr  { PUTS("expr"); $$ = op2(NE, $1, valtonode(lookup("0", symtab), CCON)); }
-       | rel_expr              { PUTS("relexpr"); }
-       | lex_expr              { PUTS("lexexpr"); }
-       | compound_conditional  { PUTS("compcond"); }
-       ;
-
-else:
-         ELSE optNL    { PUTS("else"); }
-       ;
-
-field:
-         FIELD         { PUTS("field"); $$ = valtonode($1, CFLD); }
-       | INDIRECT term { PUTS("ind field"); $$ = op1(INDIRECT, $2); }
-       ;
-
-if:
-         IF '(' conditional ')' optNL  { PUTS("if(cond)"); $$ = $3; }
-       ;
-
-lex_expr:
-         expr MATCHOP regular_expr     { PUTS("expr~re"); $$ = op2($2, $1, makedfa($3)); }
-       | '(' lex_expr ')'      { PUTS("(lex_expr)"); $$ = $2; }
-       ;
-
-var:
-         NUMBER        {PUTS("number"); $$ = valtonode($1, CCON); }
-       | STRING        { PUTS("string"); $$ = valtonode($1, CCON); }
-       | VAR           { PUTS("var"); $$ = valtonode($1, CVAR); }
-       | VAR '[' expr ']'      { PUTS("array[]"); $$ = op2(ARRAY, $1, $3); }
-       | field
-       ;
-term:
-         var
-       | FNCN          { PUTS("func");
-                       $$ = op2(FNCN, $1, valtonode(lookup("$record", symtab), CFLD));
-                       }
-       | FNCN '(' ')'  { PUTS("func()"); 
-                       $$ = op2(FNCN, $1, valtonode(lookup("$record", symtab), CFLD));
-                       }
-       | FNCN '(' expr ')'     { PUTS("func(expr)"); $$ = op2(FNCN, $1, $3); }
-       | SPRINTF print_list    { PUTS("sprintf"); $$ = op1($1, $2); }
-       | SUBSTR '(' expr ',' expr ',' expr ')'
-                       { PUTS("substr(e,e,e)"); $$ = op3(SUBSTR, $3, $5, $7); }
-       | SUBSTR '(' expr ',' expr ')'
-                       { PUTS("substr(e,e,e)"); $$ = op3(SUBSTR, $3, $5, nullstat); }
-       | SPLIT '(' expr ',' VAR ',' expr ')'
-                       { PUTS("split(e,e,e)"); $$ = op3(SPLIT, $3, $5, $7); }
-       | SPLIT '(' expr ',' VAR ')'
-                       { PUTS("split(e,e,e)"); $$ = op3(SPLIT, $3, $5, nullstat); }
-       | INDEX '(' expr ',' expr ')'
-                       { PUTS("index(e,e)"); $$ = op2(INDEX, $3, $5); }
-       | '(' expr ')'                  {PUTS("(expr)");  $$ = $2; }
-       | term '+' term                 { PUTS("t+t"); $$ = op2(ADD, $1, $3); }
-       | term '-' term                 { PUTS("t-t"); $$ = op2(MINUS, $1, $3); }
-       | term '*' term                 { PUTS("t*t"); $$ = op2(MULT, $1, $3); }
-       | term '/' term                 { PUTS("t/t"); $$ = op2(DIVIDE, $1, $3); }
-       | term '%' term                 { PUTS("t%t"); $$ = op2(MOD, $1, $3); }
-       | '-' term %prec QUEST          { PUTS("-term"); $$ = op1(UMINUS, $2); }
-       | '+' term %prec QUEST          { PUTS("+term"); $$ = $2; }
-       | INCR var      { PUTS("++var"); $$ = op1(PREINCR, $2); }
-       | DECR var      { PUTS("--var"); $$ = op1(PREDECR, $2); }
-       | var INCR      { PUTS("var++"); $$= op1(POSTINCR, $1); }
-       | var DECR      { PUTS("var--"); $$= op1(POSTDECR, $1); }
-       ;
-
-expr:
-         term          { PUTS("term"); }
-       | expr term     { PUTS("expr term"); $$ = op2(CAT, $1, $2); }
-       | var ASGNOP expr       { PUTS("var=expr"); $$ = stat2($2, $1, $3); }
-       ;
-
-optNL:
-         NL
-       |
-       ;
-
-pa_stat:
-         pattern       { PUTS("pattern"); $$ = stat2(PASTAT, $1, genprint()); }
-       | pattern '{' stat_list '}'     { PUTS("pattern {...}"); $$ = stat2(PASTAT, $1, $3); }
-       | pattern ',' pattern           { PUTS("srch,srch"); $$ = pa2stat($1, $3, genprint()); }
-       | pattern ',' pattern '{' stat_list '}' 
-                                       { PUTS("srch, srch {...}"); $$ = pa2stat($1, $3, $5); }
-       | '{' stat_list '}'     { PUTS("null pattern {...}"); $$ = stat2(PASTAT, nullstat, $2); }
-       ;
-
-pa_stats:
-         pa_stats pa_stat st   { PUTS("pa_stats pa_stat"); $$ = linkum($1, $2); }
-       |       { PUTS("null pa_stat"); $$ = nullstat; }
-       | pa_stats pa_stat      {PUTS("pa_stats pa_stat"); $$ = linkum($1, $2); }
-       ;
-
-pattern:
-         regular_expr  { PUTS("regex");
-               $$ = op2(MATCH, valtonode(lookup("$record", symtab), CFLD), makedfa($1));
-               }
-       | rel_expr      { PUTS("relexpr"); }
-       | lex_expr      { PUTS("lexexpr"); }
-       | compound_pattern      { PUTS("comp pat"); }
-       ;
-
-print_list:
-         expr  { PUTS("expr"); }
-       | pe_list       { PUTS("pe_list"); }
-       |               { PUTS("null print_list"); $$ = valtonode(lookup("$record", symtab), CFLD); }
-       ;
-
-pe_list:
-         expr ',' expr {$$ = linkum($1, $3); }
-       | pe_list ',' expr      {$$ = linkum($1, $3); }
-       | '(' pe_list ')'               {$$ = $2; }
-       ;
-
-redir:
-         RELOP
-       | '|'
-       ;
-
-regular_expr:
-         '/'   { startreg(); }
-         r '/'
-               { PUTS("/r/"); $$ = $3; }
-       ;
-
-r:
-         CHAR          { PUTS("regex CHAR"); $$ = op2(CHAR, (node *) 0, $1); }
-       | DOT           { PUTS("regex DOT"); $$ = op2(DOT, (node *) 0, (node *) 0); }
-       | CCL           { PUTS("regex CCL"); $$ = op2(CCL, (node *) 0, cclenter($1)); }
-       | NCCL          { PUTS("regex NCCL"); $$ = op2(NCCL, (node *) 0, cclenter($1)); }
-       | '^'           { PUTS("regex ^"); $$ = op2(CHAR, (node *) 0, HAT); }
-       | '$'           { PUTS("regex $"); $$ = op2(CHAR, (node *) 0 ,(node *) 0); }
-       | r OR r        { PUTS("regex OR"); $$ = op2(OR, $1, $3); }
-       | r r   %prec CAT
-                       { PUTS("regex CAT"); $$ = op2(CAT, $1, $2); }
-       | r STAR        { PUTS("regex STAR"); $$ = op2(STAR, $1, (node *) 0); }
-       | r PLUS        { PUTS("regex PLUS"); $$ = op2(PLUS, $1, (node *) 0); }
-       | r QUEST       { PUTS("regex QUEST"); $$ = op2(QUEST, $1, (node *) 0); }
-       | '(' r ')'     { PUTS("(regex)"); $$ = $2; }
-       ;
-
-rel_expr:
-         expr RELOP expr
-               { PUTS("expr relop expr"); $$ = op2($2, $1, $3); }
-       | '(' rel_expr ')'
-               { PUTS("(relexpr)"); $$ = $2; }
-       ;
-
-st:
-         NL
-       | ';'
-       ;
-
-simple_stat:
-         PRINT print_list redir expr
-               { PUTS("print>stat"); $$ = stat3($1, $2, $3, $4); }
-       | PRINT print_list      
-               { PUTS("print list"); $$ = stat3($1, $2, nullstat, nullstat); }
-       | PRINTF print_list redir expr
-               { PUTS("printf>stat"); $$ = stat3($1, $2, $3, $4); }
-       | PRINTF print_list     
-               { PUTS("printf list"); $$ = stat3($1, $2, nullstat, nullstat); }
-       | expr  { PUTS("expr"); $$ = exptostat($1); }
-       |               { PUTS("null simple statement"); $$ = nullstat; }
-       | error         { yyclearin; yyerror("illegal statement"); }
-       ;
-
-statement:
-         simple_stat st        { PUTS("simple stat"); }
-       | if statement          { PUTS("if stat"); $$ = stat3(IF, $1, $2, nullstat); }
-       | if statement else statement
-               { PUTS("if-else stat"); $$ = stat3(IF, $1, $2, $4); }
-       | while statement       { PUTS("while stat"); $$ = stat2(WHILE, $1, $2); }
-       | for                   { PUTS("for stat"); }
-       | NEXT st               { PUTS("next"); $$ = genjump(NEXT); }
-       | EXIT st               { PUTS("exit"); $$ = genjump(EXIT); }
-       | BREAK st              { PUTS("break"); $$ = genjump(BREAK); }
-       | CONTINUE st           { PUTS("continue"); $$ = genjump(CONTINUE); }
-       | '{' stat_list '}'     { PUTS("{statlist}"); $$ = $2; }
-       ;
-
-stat_list:
-         stat_list statement   { PUTS("stat_list stat"); $$ = linkum($1, $2); }
-       |                       { PUTS("null stat list"); $$ = nullstat; }
-       ;
-
-while:
-         WHILE '(' conditional ')' optNL       { PUTS("while(cond)"); $$ = $3; }
-       ;
-
-for:
-         FOR '(' simple_stat ';' conditional ';' simple_stat ')' optNL statement
-               { PUTS("for(e;e;e)"); $$ = stat4(FOR, $3, $5, $7, $10); }
-       | FOR '(' simple_stat ';'  ';' simple_stat ')' optNL statement
-               { PUTS("for(e;e;e)"); $$ = stat4(FOR, $3, nullstat, $6, $9); }
-       | FOR '(' VAR IN VAR ')' optNL statement
-               { PUTS("for(v in v)"); $$ = stat3(IN, $3, $5, $8); }
-       ;
-
-%%
diff --git a/.ref-Research-V7/usr/src/cmd/awk/awk.lx.l b/.ref-Research-V7/usr/src/cmd/awk/awk.lx.l
deleted file mode 100644 (file)
index 8a74cb6..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-%Start A str chc sc reg comment
-
-%{
-#include       "awk.h"
-#include       "awk.def"
-#undef input   /* defeat lex */
-extern int     yylval;
-extern int     mustfld;
-
-int    lineno  1;
-#ifdef DEBUG
-#      define  RETURN(x)       {if (dbg) ptoken(x); return(x); }
-#else
-#      define  RETURN(x)       return(x)
-#endif
-#define        CADD    cbuf[clen++]=yytext[0]; if(clen>=CBUFLEN-1) {yyerror("string too long", cbuf); BEGIN A;}
-#define        CBUFLEN 150
-char   cbuf[CBUFLEN];
-int    clen, cflag;
-%}
-
-A      [a-zA-Z]
-B      [a-zA-Z0-9]
-D      [0-9]
-WS     [ \t]
-
-%%
-       switch (yybgin-yysvec-1) {      /* witchcraft */
-       case 0:
-               BEGIN A;
-               break;
-       case sc:
-               BEGIN A;
-               RETURN('}');
-       }
-
-<A>^\n         lineno++;
-<A>^{WS}*#.*\n lineno++;       /* strip comment lines */
-<A>{WS}                ;
-<A,reg>"\\"\n  lineno++;
-<A>"||"                RETURN(BOR);
-<A>BEGIN       RETURN(XBEGIN);
-<A>END         RETURN(XEND);
-<A>PROGEND     RETURN(EOF);
-<A>"&&"                RETURN(AND);
-<A>"!"         RETURN(NOT);
-<A>"!="                { yylval = NE; RETURN(RELOP); }
-<A>"~"         { yylval = MATCH; RETURN(MATCHOP); }
-<A>"!~"                { yylval = NOTMATCH; RETURN(MATCHOP); }
-<A>"<"         { yylval = LT; RETURN(RELOP); }
-<A>"<="                { yylval = LE; RETURN(RELOP); }
-<A>"=="                { yylval = EQ; RETURN(RELOP); }
-<A>">="                { yylval = GE; RETURN(RELOP); }
-<A>">"         { yylval = GT; RETURN(RELOP); }
-<A>">>"                { yylval = APPEND; RETURN(RELOP); }
-<A>"++"                { yylval = INCR; RETURN(INCR); }
-<A>"--"                { yylval = DECR; RETURN(DECR); }
-<A>"+="                { yylval = ADDEQ; RETURN(ASGNOP); }
-<A>"-="                { yylval = SUBEQ; RETURN(ASGNOP); }
-<A>"*="                { yylval = MULTEQ; RETURN(ASGNOP); }
-<A>"/="                { yylval = DIVEQ; RETURN(ASGNOP); }
-<A>"%="                { yylval = MODEQ; RETURN(ASGNOP); }
-<A>"="         { yylval = ASSIGN; RETURN(ASGNOP); }
-
-<A>"$"{D}+     {       if (atoi(yytext+1)==0) {
-                               yylval = lookup("$record", symtab);
-                               RETURN(STRING);
-                       } else {
-                               yylval = fieldadr(atoi(yytext+1));
-                               RETURN(FIELD);
-                       }
-               }
-<A>"$"{WS}*    { RETURN(INDIRECT); }
-<A>NF          { mustfld=1; yylval = setsymtab(yytext, NULL, 0.0, NUM, symtab); RETURN(VAR); }
-<A>({D}+("."?){D}*|"."{D}+)((e|E)("+"|-)?{D}+)?        {
-               yylval = setsymtab(yytext, NULL, atof(yytext), CON|NUM, symtab); RETURN(NUMBER); }
-<A>"}"{WS}*\n  { BEGIN sc; lineno++; RETURN(';'); }
-<A>"}"         { BEGIN sc; RETURN(';'); }
-<A>;\n         { lineno++; RETURN(';'); }
-<A>\n          { lineno++; RETURN(NL); }
-<A>while       RETURN(WHILE);
-<A>for         RETURN(FOR);
-<A>if          RETURN(IF);
-<A>else                RETURN(ELSE);
-<A>next                RETURN(NEXT);
-<A>exit                RETURN(EXIT);
-<A>break       RETURN(BREAK);
-<A>continue    RETURN(CONTINUE);
-<A>print       { yylval = PRINT; RETURN(PRINT); }
-<A>printf      { yylval = PRINTF; RETURN(PRINTF); }
-<A>sprintf     { yylval = SPRINTF; RETURN(SPRINTF); }
-<A>split       { yylval = SPLIT; RETURN(SPLIT); }
-<A>substr      RETURN(SUBSTR);
-<A>index       RETURN(INDEX);
-<A>in          RETURN(IN);
-<A>length      { yylval = FLENGTH; RETURN(FNCN); }
-<A>log         { yylval = FLOG; RETURN(FNCN); }
-<A>int         { yylval = FINT; RETURN(FNCN); }
-<A>exp         { yylval = FEXP; RETURN(FNCN); }
-<A>sqrt                { yylval = FSQRT; RETURN(FNCN); }
-<A>{A}{B}*     { yylval = setsymtab(yytext, tostring(""), 0.0, STR, symtab); RETURN(VAR); }
-<A>\"          { BEGIN str; clen=0; }
-
-<A>#           { BEGIN comment; }
-<comment>\n    { BEGIN A; lineno++; RETURN(NL); }
-<comment>.     ;
-
-<A>.           { yylval = yytext[0]; RETURN(yytext[0]); }
-
-<reg>"["       { BEGIN chc; clen=0; cflag=0; }
-<reg>"[^"      { BEGIN chc; clen=0; cflag=1; }
-
-<reg>"?"       RETURN(QUEST);
-<reg>"+"       RETURN(PLUS);
-<reg>"*"       RETURN(STAR);
-<reg>"|"       RETURN(OR);
-<reg>"."       RETURN(DOT);
-<reg>"("       RETURN('(');
-<reg>")"       RETURN(')');
-<reg>"^"       RETURN('^');
-<reg>"$"       RETURN('$');
-<reg>\\.       {       if (yytext[1]=='n') yylval = '\n';
-                       else if (yytext[1] == 't') yylval = '\t';
-                       else yylval = yytext[1];
-                       RETURN(CHAR);
-               }
-<reg>"/"       { BEGIN A; unput('/'); }
-<reg>\n                { yyerror("newline in regular expression"); lineno++; BEGIN A; }
-<reg>.         { yylval = yytext[0]; RETURN(CHAR); }
-
-<str>\"                { BEGIN A; cbuf[clen]=0; yylval = setsymtab(cbuf, tostring(cbuf), 0.0, CON|STR, symtab); RETURN(STRING); }
-<str>\n                { yyerror("newline in string"); lineno++; BEGIN A; }
-<str>"\\\""    { cbuf[clen++]='"'; }
-<str,chc>"\\"n { cbuf[clen++]='\n'; }
-<str,chc>"\\"t { cbuf[clen++]='\t'; }
-<str,chc>"\\\\"        { cbuf[clen++]='\\'; }
-<str>.         { CADD; }
-
-<chc>"\\""]"   { cbuf[clen++]=']'; }
-<chc>"]"       { BEGIN reg; cbuf[clen]=0; yylval = tostring(cbuf);
-               if (cflag==0) { RETURN(CCL); }
-               else { RETURN(NCCL); } }
-<chc>\n                { yyerror("newline in character class"); lineno++; BEGIN A; }
-<chc>.         { CADD; }
-
-%%
-
-input()
-{
-       register c;
-       extern char *lexprog;
-
-       if (yysptr > yysbuf)
-               c = U(*--yysptr);
-       else if (yyin == NULL)
-               c = *lexprog++;
-       else
-               c = getc(yyin);
-       if (c == '\n')
-               yylineno++;
-       else if (c == EOF)
-               c = 0;
-       return(c);
-}
-
-startreg()
-{
-       BEGIN reg;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/b.c b/.ref-Research-V7/usr/src/cmd/awk/b.c
deleted file mode 100644 (file)
index f520604..0000000
+++ /dev/null
@@ -1,535 +0,0 @@
-#include "awk.def"
-#include "stdio.h"
-#include "awk.h"
-
-extern node *op2();
-extern struct fa *cgotofn();
-#define MAXLIN 256
-#define NCHARS 128
-#define NSTATES 256
-
-#define type(v)        v->nobj
-#define left(v)        v->narg[0]
-#define right(v)       v->narg[1]
-#define parent(v)      v->nnext
-
-#define LEAF   case CCL: case NCCL: case CHAR: case DOT:
-#define UNARY  case FINAL: case STAR: case PLUS: case QUEST:
-
-/* encoding in tree nodes:
-       leaf (CCL, NCCL, CHAR, DOT): left is index, right contains value or pointer to value
-       unary (FINAL, STAR, PLUS, QUEST): left is child, right is null
-       binary (CAT, OR): left and right are children
-       parent contains pointer to parent
-*/
-
-struct fa {
-       int cch;
-       struct fa *st;
-};
-
-int    *state[NSTATES];
-int    *foll[MAXLIN];
-char   chars[MAXLIN];
-int    setvec[MAXLIN];
-node   *point[MAXLIN];
-
-int    setcnt;
-int    line;
-
-
-struct fa *makedfa(p)  /* returns dfa for tree pointed to by p */
-node *p;
-{
-       node *p1;
-       struct fa *fap;
-       p1 = op2(CAT, op2(STAR, op2(DOT, (node *) 0, (node *) 0), (node *) 0), p);
-               /* put DOT STAR in front of reg. exp. */
-       p1 = op2(FINAL, p1, (node *) 0);                /* install FINAL node */
-
-       line = 0;
-       penter(p1);     /* enter parent pointers and leaf indices */
-       point[line] = p1;       /* FINAL node */
-       setvec[0] = 1;          /* for initial DOT STAR */
-       cfoll(p1);      /* set up follow sets */
-       fap = cgotofn();
-       freetr(p1);     /* add this when alloc works */
-       return(fap);
-}
-
-penter(p)      /* set up parent pointers and leaf indices */
-node *p;
-{
-       switch(type(p)) {
-               LEAF
-                       left(p) = (node *) line;
-                       point[line++] = p;
-                       break;
-               UNARY
-                       penter(left(p));
-                       parent(left(p)) = p;
-                       break;
-               case CAT:
-               case OR:
-                       penter(left(p));
-                       penter(right(p));
-                       parent(left(p)) = p;
-                       parent(right(p)) = p;
-                       break;
-               default:
-                       error(FATAL, "unknown type %d in penter\n", type(p));
-                       break;
-       }
-}
-
-freetr(p)      /* free parse tree and follow sets */
-node *p;
-{
-       switch(type(p)) {
-               LEAF
-                       xfree(foll[(int) left(p)]);
-                       xfree(p);
-                       break;
-               UNARY
-                       freetr(left(p));
-                       xfree(p);
-                       break;
-               case CAT:
-               case OR:
-                       freetr(left(p));
-                       freetr(right(p));
-                       xfree(p);
-                       break;
-               default:
-                       error(FATAL, "unknown type %d in freetr", type(p));
-                       break;
-       }
-}
-char *cclenter(p)
-register char *p;
-{
-       register i, c;
-       char *op;
-
-       op = p;
-       i = 0;
-       while ((c = *p++) != 0) {
-               if (c == '-' && i > 0 && chars[i-1] != 0) {
-                       if (*p != 0) {
-                               c = chars[i-1];
-                               while (c < *p) {
-                                       if (i >= MAXLIN)
-                                               overflo();
-                                       chars[i++] = ++c;
-                               }
-                               p++;
-                               continue;
-                       }
-               }
-               if (i >= MAXLIN)
-                       overflo();
-               chars[i++] = c;
-       }
-       chars[i++] = '\0';
-       dprintf("cclenter: in = |%s|, out = |%s|\n", op, chars, NULL);
-       xfree(op);
-       return(tostring(chars));
-}
-
-overflo()
-{
-       error(FATAL, "regular expression too long\n");
-}
-
-cfoll(v)               /* enter follow set of each leaf of vertex v into foll[leaf] */
-register node *v;
-{
-       register i;
-       int prev;
-       int *add();
-
-       switch(type(v)) {
-               LEAF
-                       setcnt = 0;
-                       for (i=1; i<=line; i++)
-                               setvec[i] = 0;
-                       follow(v);
-                       if (notin(foll, ( (int) left(v))-1, &prev)) {
-                               foll[(int) left(v)] = add(setcnt);
-                       }
-                       else
-                               foll[ (int) left(v)] = foll[prev];
-                       break;
-               UNARY
-                       cfoll(left(v));
-                       break;
-               case CAT:
-               case OR:
-                       cfoll(left(v));
-                       cfoll(right(v));
-                       break;
-               default:
-                       error(FATAL, "unknown type %d in cfoll", type(v));
-       }
-}
-
-first(p)                       /* collects initially active leaves of p into setvec */
-register node *p;              /* returns 0 or 1 depending on whether p matches empty string */
-{
-       register b;
-
-       switch(type(p)) {
-               LEAF
-                       if (setvec[(int) left(p)] != 1) {
-                               setvec[(int) left(p)] = 1;
-                               setcnt++;
-                       }
-                       if (type(p) == CCL && (*(char *) right(p)) == '\0')
-                               return(0);              /* empty CCL */
-                       else return(1);
-               case FINAL:
-               case PLUS:
-                       if (first(left(p)) == 0) return(0);
-                       return(1);
-               case STAR:
-               case QUEST:
-                       first(left(p));
-                       return(0);
-               case CAT:
-                       if (first(left(p)) == 0 && first(right(p)) == 0) return(0);
-                       return(1);
-               case OR:
-                       b = first(right(p));
-                       if (first(left(p)) == 0 || b == 0) return(0);
-                       return(1);
-       }
-       error(FATAL, "unknown type %d in first\n", type(p));
-       return(-1);
-}
-
-follow(v)
-node *v;               /* collects leaves that can follow v into setvec */
-{
-       node *p;
-
-       if (type(v) == FINAL)
-               return;
-       p = parent(v);
-       switch (type(p)) {
-               case STAR:
-               case PLUS:      first(v);
-                               follow(p);
-                               return;
-
-               case OR:
-               case QUEST:     follow(p);
-                               return;
-
-               case CAT:       if (v == left(p)) {     /* v is left child of p */
-                                       if (first(right(p)) == 0) {
-                                               follow(p);
-                                               return;
-                                       }
-                               }
-                               else            /* v is right child */
-                                       follow(p);
-                               return;
-               case FINAL:     if (setvec[line] != 1) {
-                                       setvec[line] = 1;
-                                       setcnt++;
-                               }
-                               return;
-       }
-}
-
-member(c, s)   /* is c in s? */
-register char c, *s;
-{
-       while (*s)
-               if (c == *s++)
-                       return(1);
-       return(0);
-}
-
-notin(array, n, prev)          /* is setvec in array[0] thru array[n]? */
-int **array;
-int *prev; {
-       register i, j;
-       int *ptr;
-       for (i=0; i<=n; i++) {
-               ptr = array[i];
-               if (*ptr == setcnt) {
-                       for (j=0; j < setcnt; j++)
-                               if (setvec[*(++ptr)] != 1) goto nxt;
-                       *prev = i;
-                       return(0);
-               }
-               nxt: ;
-       }
-       return(1);
-}
-
-int *add(n) {          /* remember setvec */
-       int *ptr, *p;
-       register i;
-       if ((p = ptr = (int *) malloc((n+1)*sizeof(int))) == NULL)
-               overflo();
-       *ptr = n;
-       dprintf("add(%d)\n", n, NULL, NULL);
-       for (i=1; i <= line; i++)
-               if (setvec[i] == 1) {
-                       *(++ptr) = i;
-                       dprintf("  ptr = %o, *ptr = %d, i = %d\n", ptr, *ptr, i);
-               }
-       dprintf("\n", NULL, NULL, NULL);
-       return(p);
-}
-
-struct fa *cgotofn()
-{
-       register i, k;
-       register int *ptr;
-       char c;
-       char *p;
-       node *cp;
-       int j, n, s, ind, numtrans;
-       int finflg;
-       int curpos, num, prev;
-       struct fa *where[NSTATES];
-
-       int fatab[257];
-       struct fa *pfa;
-
-       char index[MAXLIN];
-       char iposns[MAXLIN];
-       int sposns[MAXLIN];
-       int spmax, spinit;
-
-       char symbol[NCHARS];
-       char isyms[NCHARS];
-       char ssyms[NCHARS];
-       int ssmax, ssinit;
-
-       for (i=0; i<=line; i++) index[i] = iposns[i] = setvec[i] = 0;
-       for (i=0; i<NCHARS; i++)  isyms[i] = symbol[i] = 0;
-       setcnt = 0;
-       /* compute initial positions and symbols of state 0 */
-       ssmax = 0;
-       ptr = state[0] = foll[0];
-       spinit = *ptr;
-       for (i=0; i<spinit; i++) {
-               curpos = *(++ptr);
-               sposns[i] = curpos;
-               iposns[curpos] = 1;
-               cp = point[curpos];
-               dprintf("i = %d, spinit = %d, curpos = %d\n", i, spinit, curpos);
-               switch (type(cp)) {
-                       case CHAR:
-                               k = (int) right(cp);
-                               if (isyms[k] != 1) {
-                                       isyms[k] = 1;
-                                       ssyms[ssmax++] = k;
-                               }
-                               break;
-                       case DOT:
-                               for (k=1; k<NCHARS; k++) {
-                                       if (k != HAT) {
-                                               if (isyms[k] != 1) {
-                                                       isyms[k] = 1;
-                                                       ssyms[ssmax++] = k;
-                                               }
-                                       }
-                               }
-                               break;
-                       case CCL:
-                               for (p = (char *) right(cp); *p; p++) {
-                                       if (*p != HAT) {
-                                               if (isyms[*p] != 1) {
-                                                       isyms[*p] = 1;
-                                                       ssyms[ssmax++] = *p;
-                                               }
-                                       }
-                               }
-                               break;
-                       case NCCL:
-                               for (k=1; k<NCHARS; k++) {
-                                       if (k != HAT && !member(k, (char *) right(cp))) {
-                                               if (isyms[k] != 1) {
-                                                       isyms[k] = 1;
-                                                       ssyms[ssmax++] = k;
-                                               }
-                                       }
-                               }
-               }
-       }
-       ssinit = ssmax;
-       n = 0;
-       for (s=0; s<=n; s++)  {
-       dprintf("s = %d\n", s, NULL, NULL);
-               ind = 0;
-               numtrans = 0;
-               finflg = 0;
-               if (*(state[s] + *state[s]) == line) {          /* s final? */
-                       finflg = 1;
-                       goto tenter;
-               }
-               spmax = spinit;
-               ssmax = ssinit;
-               ptr = state[s];
-               num = *ptr;
-               for (i=0; i<num; i++) {
-                       curpos = *(++ptr);
-                       if (iposns[curpos] != 1 && index[curpos] != 1) {
-                               index[curpos] = 1;
-                               sposns[spmax++] = curpos;
-                       }
-                       cp = point[curpos];
-                       switch (type(cp)) {
-                               case CHAR:
-                                       k = (int) right(cp);
-                                       if (isyms[k] == 0 && symbol[k] == 0) {
-                                               symbol[k] = 1;
-                                               ssyms[ssmax++] = k;
-                                       }
-                                       break;
-                               case DOT:
-                                       for (k=1; k<NCHARS; k++) {
-                                               if (k != HAT) {
-                                                       if (isyms[k] == 0 && symbol[k] == 0) {
-                                                               symbol[k] = 1;
-                                                               ssyms[ssmax++] = k;
-                                                       }
-                                               }
-                                       }
-                                       break;
-                               case CCL:
-                                       for (p = (char *) right(cp); *p; p++) {
-                                               if (*p != HAT) {
-                                                       if (isyms[*p] == 0 && symbol[*p] == 0) {
-                                                               symbol[*p] = 1;
-                                                               ssyms[ssmax++] = *p;
-                                                       }
-                                               }
-                                       }
-                                       break;
-                               case NCCL:
-                                       for (k=1; k<NCHARS; k++) {
-                                               if (k != HAT && !member(k, (char *) right(cp))) {
-                                                       if (isyms[k] == 0 && symbol[k] == 0) {
-                                                               symbol[k] = 1;
-                                                               ssyms[ssmax++] = k;
-                                                       }
-                                               }
-                                       }
-                       }
-               }
-               for (j=0; j<ssmax; j++) {       /* nextstate(s, ssyms[j]) */
-                       c = ssyms[j];
-                       symbol[c] = 0;
-                       setcnt = 0;
-                       for (k=0; k<=line; k++) setvec[k] = 0;
-                       for (i=0; i<spmax; i++) {
-                               index[sposns[i]] = 0;
-                               cp = point[sposns[i]];
-                               if ((k = type(cp)) != FINAL)
-                                       if (k == CHAR && c == (int) right(cp)
-                                        || k == DOT
-                                        || k == CCL && member(c, (char *) right(cp))
-                                        || k == NCCL && !member(c, (char *) right(cp))) {
-                                               ptr = foll[sposns[i]];
-                                               num = *ptr;
-                                               for (k=0; k<num; k++) {
-                                                       if (setvec[*(++ptr)] != 1
-                                                               && iposns[*ptr] != 1) {
-                                                               setvec[*ptr] = 1;
-                                                               setcnt++;
-                                                       }
-                                               }
-                                       }
-                       } /* end nextstate */
-                       if (notin(state, n, &prev)) {
-                               if (n >= NSTATES) {
-                                       dprintf("cgotofn: notin; state = %d, n = %d\n", state, n, NULL);
-                                       overflo();
-                               }
-                               state[++n] = add(setcnt);
-                               dprintf("       delta(%d,%o) = %d", s,c,n);
-                               dprintf(", ind = %d\n", ind+1, NULL, NULL);
-                               fatab[++ind] = c;
-                               fatab[++ind] = n;
-                               numtrans++;
-                       }
-                       else {
-                               if (prev != 0) {
-                                       dprintf("       delta(%d,%o) = %d", s,c,prev);
-                                       dprintf(", ind = %d\n", ind+1, NULL, NULL);
-                                       fatab[++ind] = c;
-                                       fatab[++ind] = prev;
-                                       numtrans++;
-                               }
-                       }
-               }
-       tenter:
-               if ((pfa = (struct fa *) malloc((numtrans + 1) * sizeof(struct fa))) == NULL)
-                       overflo();
-               where[s] = pfa;
-               if (finflg)
-                       pfa->cch = -1;          /* s is a final state */
-               else
-                       pfa->cch = numtrans;
-               pfa->st = 0;
-               for (i=1, pfa += 1; i<=numtrans; i++, pfa++) {
-                       pfa->cch = fatab[2*i-1];
-                       pfa->st = (struct fa *) fatab[2*i];
-               }
-       }
-       for (i=0; i<=n; i++) {
-               xfree(state[i]);        /* free state[i] */
-               pfa = where[i];
-               pfa->st = where[0];
-               dprintf("state %d: (%o)\n", i, pfa, NULL);
-               dprintf("       numtrans = %d,  default = %o\n", pfa->cch, pfa->st, NULL);
-               for (k=1; k<=pfa->cch; k++) {
-                       (pfa+k)->st = where[ (int) (pfa+k)->st];
-                       dprintf("       char = %o,      nextstate = %o\n",(pfa+k)->cch, (pfa+k)->st, NULL);
-               }
-       }
-       pfa = where[0];
-       if ((num = pfa->cch) < 0)
-               return(where[0]);
-       for (pfa += num; num; num--, pfa--)
-               if (pfa->cch == HAT) {
-                       return(pfa->st);
-               }
-       return(where[0]);
-}
-
-match(pfa, p)
-register struct fa *pfa;
-register char *p;
-{
-       register count;
-       char c;
-       if (p == 0) return(0);
-       if (pfa->cch == 1) {            /* fast test for first character, if possible */
-               c = (++pfa)->cch;
-               do
-                       if (c == *p) {
-                               p++;
-                               pfa = pfa->st;
-                               goto adv;
-                       }
-               while (*p++ != 0);
-               return(0);
-       }
-   adv: if ((count = pfa->cch) < 0) return(1);
-       do {
-               for (pfa += count; count; count--, pfa--)
-                       if (pfa->cch == *p) {
-                               break;
-                       }
-               pfa = pfa->st;
-               if ((count = pfa->cch) < 0) return(1);
-       } while(*p++ != 0);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/lib.c b/.ref-Research-V7/usr/src/cmd/awk/lib.c
deleted file mode 100644 (file)
index bdc9abb..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-#include "stdio.h"
-#include "awk.def"
-#include "awk.h"
-#include "ctype.h"
-
-FILE   *infile = NULL;
-char   *file;
-#define        RECSIZE 512
-char   record[RECSIZE];
-char   fields[RECSIZE];
-
-#define        MAXFLD  50
-int    donefld;        /* 1 = implies rec broken into fields */
-int    donerec;        /* 1 = record is valid (no flds have changed) */
-int    mustfld;        /* 1 = NF seen, so always break*/
-
-#define        FINIT   {0, NULL, 0.0, FLD|STR}
-cell fldtab[MAXFLD] = {        /*room for fields */
-       { "$record", record, 0.0, STR|FLD},
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT,
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT,
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT,
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT,
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT,
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT,
-       FINIT, FINIT, FINIT, FINIT, FINIT, FINIT, FINIT
-};
-int    maxfld  = 0;    /* last used field */
-
-
-getrec()
-{
-       register char *rr;
-       extern int svargc;
-       extern char **svargv;
-       register c, sep;
-
-       dprintf("**RS=%o, **FS=%o\n", **RS, **FS, NULL);
-       donefld = 0;
-       donerec = 1;
-       record[0] = 0;
-       while (svargc > 0) {
-               dprintf("svargc=%d, *svargv=%s\n", svargc, *svargv, NULL);
-               if (infile == NULL) {   /* have to open a new file */
-                       if (member('=', *svargv)) {     /* it's a var=value argument */
-                               setclvar(*svargv);
-                               svargv++;
-                               svargc--;
-                               continue;
-                       }
-                       *FILENAME = file = *svargv;
-                       dprintf("opening file %s\n", file, NULL, NULL);
-                       if (*file == '-')
-                               infile = stdin;
-                       else if ((infile = fopen(file, "r")) == NULL)
-                               error(FATAL, "can't open %s", file);
-               }
-               if ((sep = **RS) == 0)
-                       sep = '\n';
-               for (rr = record; ; ) {
-                       for (; (c=getc(infile)) != sep && c != EOF; *rr++ = c)
-                               ;
-                       if (**RS == sep || c == EOF)
-                               break;
-                       if ((c = getc(infile)) == '\n' || c == EOF)     /* 2 in a row */
-                               break;
-                       *rr++ = '\n';
-                       *rr++ = c;
-               }
-               if (rr > record+RECSIZE)
-                       error(FATAL, "record `%.20s...' too long", record);
-               *rr = 0;
-               if (mustfld)
-                       fldbld();
-               if (c != EOF)   /* normal record */
-                       return(1);
-               /* EOF arrived on this file; set up next */
-               if (infile != stdin)
-                       fclose(infile);
-               infile = NULL;
-               svargc--;
-               svargv++;
-       }
-       return(0);      /* true end of file */
-}
-
-setclvar(s)    /* set var=value from s */
-char *s;
-{
-       char *p;
-       cell *q;
-
-       for (p=s; *p != '='; p++)
-               ;
-       *p++ = 0;
-       q = setsymtab(s, tostring(p), 0.0, STR, symtab);
-       setsval(q, p);
-       dprintf("command line set %s to |%s|\n", s, p, NULL);
-}
-
-fldbld()
-{
-       register char *r, *fr, sep;
-       int i, j;
-
-       r = record;
-       fr = fields;
-       if ((sep = **FS) == ' ')
-               for (i = 0; ; ) {
-                       while (*r == ' ' || *r == '\t' || *r == '\n')
-                               r++;
-                       if (*r == 0)
-                               break;
-                       i++;
-                       if (i >= MAXFLD)
-                               error(FATAL, "record `%.20s...' has too many fields", record);
-                       if (!(fldtab[i].tval&FLD))
-                               xfree(fldtab[i].sval);
-                       fldtab[i].sval = fr;
-                       fldtab[i].tval = FLD | STR;
-                       do
-                               *fr++ = *r++;
-                       while (*r != ' ' && *r != '\t' && *r != '\n' && *r != '\0');
-                       *fr++ = 0;
-               }
-       else
-               for (i = 0; ; ) {
-                       i++;
-                       if (i >= MAXFLD)
-                               error(FATAL, "record `%.20s...' has too many fields", record);
-                       if (!(fldtab[i].tval&FLD))
-                               xfree(fldtab[i].sval);
-                       fldtab[i].sval = fr;
-                       fldtab[i].tval = FLD | STR;
-                       while (*r != sep && *r != '\n' && *r != '\0')   /* \n always a separator */
-                               *fr++ = *r++;
-                       *fr++ = '\0';
-                       if (*r == 0) break;
-                       r++;
-               }
-       *fr = 0;
-       for (j=maxfld; j>i; j--) {      /* clean out junk from previous record */
-               if (!(fldtab[j].tval&FLD))
-                       xfree(fldtab[j].sval);
-               fldtab[j].tval = STR | FLD;
-               fldtab[j].sval = NULL;
-       }
-       maxfld = i;
-       donefld = 1;
-       for(i=1; i<=maxfld; i++)
-               if(isnumber(fldtab[i].sval))
-               {       fldtab[i].fval = atof(fldtab[i].sval);
-                       fldtab[i].tval |= NUM;
-               }
-       setfval(lookup("NF", symtab), (awkfloat) maxfld);
-       if (dbg)
-               for (i = 0; i <= maxfld; i++)
-                       printf("field %d: |%s|\n", i, fldtab[i].sval);
-}
-
-recbld()
-{
-       int i;
-       register char *r, *p;
-
-       if (donefld == 0 || donerec == 1)
-               return;
-       r = record;
-       for (i = 1; i <= *NF; i++) {
-               p = getsval(&fldtab[i]);
-               while (*r++ = *p++)
-                       ;
-               *(r-1) = **OFS;
-       }
-       *(r-1) = '\0';
-       dprintf("in recbld FS=%o, recloc=%o\n", **FS, recloc, NULL);
-       recloc->tval = STR | FLD;
-       dprintf("in recbld FS=%o, recloc=%o\n", **FS, recloc, NULL);
-       if (r > record+RECSIZE)
-               error(FATAL, "built giant record `%.20s...'", record);
-       dprintf("recbld = |%s|\n", record, NULL, NULL);
-}
-
-cell *fieldadr(n)
-{
-       if (n >= MAXFLD)
-               error(FATAL, "trying to access field %d", n);
-       return(&fldtab[n]);
-}
-
-int    errorflag       = 0;
-
-yyerror(s) char *s; {
-       fprintf(stderr, "awk: %s near line %d\n", s, lineno);
-       errorflag = 2;
-}
-
-error(f, s, a1, a2, a3, a4, a5, a6, a7) {
-       fprintf(stderr, "awk: ");
-       fprintf(stderr, s, a1, a2, a3, a4, a5, a6, a7);
-       fprintf(stderr, "\n");
-       if (*NR > 0)
-               fprintf(stderr, " record number %g\n", *NR);
-       if (f)
-               exit(2);
-}
-
-PUTS(s) char *s; {
-       dprintf("%s\n", s, NULL, NULL);
-}
-
-#define        MAXEXPON        38      /* maximum exponenet for fp number */
-
-isnumber(s)
-register char *s;
-{
-       register d1, d2;
-       int point;
-       char *es;
-
-       d1 = d2 = point = 0;
-       while (*s == ' ' || *s == '\t' || *s == '\n')
-               s++;
-       if (*s == '\0')
-               return(0);      /* empty stuff isn't number */
-       if (*s == '+' || *s == '-')
-               s++;
-       if (!isdigit(*s) && *s != '.')
-               return(0);
-       if (isdigit(*s)) {
-               d1++;
-               do {
-                       s++;
-               } while (isdigit(*s));
-       }
-       if (*s == '.') {
-               point++;
-               s++;
-       }
-       if (d1 == 0 && point == 0)
-               return(0);
-       if (isdigit(*s)) {
-               d2++;
-               do {
-                       s++;
-               } while (isdigit(*s));
-       }
-       if (!(d1 || point && d2))
-               return(0);
-       if (*s == 'e' || *s == 'E') {
-               s++;
-               if (*s == '+' || *s == '-')
-                       s++;
-               if (!isdigit(*s))
-                       return(0);
-               es = s;
-               do {
-                       s++;
-               } while (isdigit(*s));
-               if (s - es > 2)
-                       return(0);
-               else if (s - es == 2 && 10 * (*es-'0') + *(es+1)-'0' >= MAXEXPON)
-                       return(0);
-       }
-       while (*s == ' ' || *s == '\t' || *s == '\n')
-               s++;
-       if (*s == '\0')
-               return(1);
-       else
-               return(0);
-}
-/*
-isnumber(s) char *s; {return(0);}
-*/
diff --git a/.ref-Research-V7/usr/src/cmd/awk/main.c b/.ref-Research-V7/usr/src/cmd/awk/main.c
deleted file mode 100644 (file)
index 135cb6e..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-#include "stdio.h"
-#include "awk.def"
-#include "awk.h"
-
-int    dbg     = 0;
-int    svargc;
-char   **svargv, **xargv;
-extern FILE    *yyin;  /* lex input file */
-char   *lexprog;       /* points to program argument if it exists */
-extern errorflag;      /* non-zero if any syntax errors; set by yyerror */
-
-int filefd, iflag, symnum, ansfd;
-char *filelist;
-extern int maxsym, errno;
-main(argc, argv) int argc; char *argv[]; {
-       if (argc == 1)
-               error(FATAL, "Usage: awk [-f source | 'cmds'] [files]");
-       if (strcmp(argv[0], "a.out"))
-               logit(argc, argv);
-       syminit();
-       while (argc > 1) {
-               argc--;
-               argv++;
-               if (argv[0][0] == '-' && argv[0][1] == 'f') {
-                       yyin = fopen(argv[1], "r");
-                       if (yyin == NULL)
-                               error(FATAL, "can't open %s", argv[1]);
-                       argc--;
-                       argv++;
-                       break;
-               } else if (argv[0][0] == '-' && argv[0][1] == 'F') {    /* set field sep */
-                       if (argv[0][2] == 't')  /* special case for tab */
-                               **FS = '\t';
-                       else
-                               **FS = argv[0][2];
-                       continue;
-               } else if (argv[0][0] != '-') {
-                       dprintf("cmds=|%s|\n", argv[0], NULL, NULL);
-                       yyin = NULL;
-                       lexprog = argv[0];
-                       argv[0] = argv[-1];     /* need this space */
-                       break;
-               } else if (strcmp("-d", argv[0])==0)
-                       dbg = 1;
-               else if (argv[0][0]=='-' && argv[0][1]=='i') {
-                       iflag=1;
-                       sscanf(argv[0], "-i%d, %d", &filefd, &ansfd);
-               }
-       }
-       if (argc <= 1 && !iflag) {
-               argv[0][0] = '-';
-               argv[0][1] = '\0';
-               argc++;
-               argv--;
-       }
-       if (!iflag) {
-               svargc = --argc;
-               svargv = ++argv;
-               dprintf("svargc=%d svargv[0]=%s\n", svargc, svargv[0], NULL);
-       }
-       *FILENAME = *svargv;    /* initial file name */
-iloop:
-       if (iflag)
-               msgfiles();
-       yyparse();
-       dprintf("errorflag=%d\n", errorflag, NULL, NULL);
-       if (errorflag)
-               exit(0);
-       run();
-       if (iflag)
-               write(ansfd, &errorflag, sizeof(errorflag));
-       else exit(errorflag);
-/*sym cleanup should go here , followed by another syminit*/
-       goto iloop;
-}
-
-logit(n, s) char *s[];
-{      int i, tvec[2];
-       FILE *f, *g;
-       char buf[512];
-       if ((f=fopen("/usr/pjw/awk/awkhist", "a"))==NULL)
-               return;
-       time(tvec);
-       fprintf(f, "%-8s %s", getlogin(), ctime(tvec));
-       for (i=0; i<n; i++)
-               fprintf(f, "'%s'", s[i]);
-       putc('\n', f);
-       if (strcmp(s[1], "-f")) {
-               fclose(f);
-               return;
-       }
-       if ((g=fopen(s[2], "r"))==NULL) {
-               fclose(f);
-               return;
-       }
-       while ((i=fread(buf, 1, 512, g))>0)
-               fwrite(buf, 1, i, f);
-       fclose(f);
-       fclose(g);
-}
-
-yywrap()
-{
-       return(1);
-}
-
-msgfiles()
-{      char buf[512], *p, *q, **s;
-       int n;
-       n=read(filefd, buf, 512);
-       if (n<=0)       /*no one at other end?*/ {
-               perror("no files");
-               exit(errno);
-       }
-       xfree(filelist);
-       q=filelist=malloc(n);
-       for (p=buf; *p==' ' || *p=='\t' || *p=='\n'; p++); 
-       for (n=0; *p!=';'; )
-       {
-               if (*p==' ' || *p=='\t' || *p=='\n') {
-                       n++;
-                       *q++=0;
-                       while (*p==' ' || *p=='\t' || *p=='\n')
-                               p++;
-               }
-               else    *q++ = *p++;
-       }
-       if (q!=filelist && *(q-1)!=0) {
-               n++;
-               *q++ = 0;
-       }
-       svargc=n;
-       xfree(xargv);
-       xargv=s=svargv=malloc(n*sizeof(char *));
-       for (p=filelist; n>0; n--)
-       {
-               *s++=p;
-               while (*p++ != 0);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/makefile b/.ref-Research-V7/usr/src/cmd/awk/makefile
deleted file mode 100644 (file)
index 631cdff..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-CFLAGS=-O
-YFLAGS=-d
-
-all:   awk
-
-cp:    awk
-       cp awk /bin/awk
-       rm *.o awk.h proc awk proctab.c y.tab.h
-
-cmp:   awk
-       cmp awk /bin/awk
-       rm *.o awk.h proc awk proctab.c y.tab.h
-
-FILES=awk.lx.o b.o main.o token.o tran.o lib.o run.o parse.o proctab.o 
-SOURCE=awk.def awk.g.y awk.lx.l b.c lib.c main.c parse.c proctab.c \
-       proc.c\
-       run.c token.c tran.c
-
-awk:   $(FILES) awk.g.o
-       cc -i -s $(CFLAGS) awk.g.o $(FILES) -lm -o awk
-
-y.tab.h:       awk.g.o
-
-awk.h: y.tab.h
-       -cmp -s y.tab.h awk.h || cp y.tab.h awk.h
-
-$(FILES):      awk.h awk.def
-
-token.c:       awk.h
-       ed - <tokenscript
-       rm temp
-
-src:   $(SOURCE) test.a tokenscript makefile
-       cp $? /usr/src/cmd/awk
-       touch src
-
-profile:       awk.g.o $(FILES)
-       cc -p -i awk.g.o $(FILES) -lm
-
-find:
-       egrep -n "$(PAT)" *.[ylhc] awk.def
-
-list:
-       -pr $(SOURCE) makefile
-
-lint:
-       lint -spu b.c main.c token.c tran.c run.c lib.c parse.c -lm |\
-               egrep -v '^(error|free|malloc)'
-
-proctab.c:     proc
-       proc > proctab.c
-proc:  awk.h proc.o token.o
-       cc -o proc proc.c token.o
diff --git a/.ref-Research-V7/usr/src/cmd/awk/parse.c b/.ref-Research-V7/usr/src/cmd/awk/parse.c
deleted file mode 100644 (file)
index 24ef508..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#include "awk.def"
-#include "awk.h"
-#include "stdio.h"
-node *ALLOC(n)
-{      node *x;
-       x = (node *)malloc(sizeof(node)+n*sizeof(node *));
-       if (x == NULL)
-               error(FATAL, "out of space in ALLOC");
-       return(x);
-}
-node *exptostat(a) node *a;
-{
-       a->ntype = NSTAT;
-       return(a);
-}
-node   *nullstat;
-node *node0(a)
-{      node *x;
-       x=ALLOC(0);
-       x->nnext = NULL;
-       x->nobj=a;
-       return(x);
-}
-node *node1(a,b) node *b;
-{      node *x;
-       x=ALLOC(1);
-       x->nnext = NULL;
-       x->nobj=a;
-       x->narg[0]=b;
-       return(x);
-}
-node *node2(a,b,c) node *b, *c;
-{      node *x;
-       x = ALLOC(2);
-       x->nnext = NULL;
-       x->nobj = a;
-       x->narg[0] = b;
-       x->narg[1] = c;
-       return(x);
-}
-node *node3(a,b,c,d) node *b, *c, *d;
-{      node *x;
-       x = ALLOC(3);
-       x->nnext = NULL;
-       x->nobj = a;
-       x->narg[0] = b;
-       x->narg[1] = c;
-       x->narg[2] = d;
-       return(x);
-}
-node *node4(a,b,c,d,e) node *b, *c, *d, *e;
-{      node *x;
-       x = ALLOC(4);
-       x->nnext = NULL;
-       x->nobj = a;
-       x->narg[0] = b;
-       x->narg[1] = c;
-       x->narg[2] = d;
-       x->narg[3] = e;
-       return(x);
-}
-node *stat3(a,b,c,d) node *b, *c, *d;
-{      node *x;
-       x = node3(a,b,c,d);
-       x->ntype = NSTAT;
-       return(x);
-}
-node *op2(a,b,c) node *b, *c;
-{      node *x;
-       x = node2(a,b,c);
-       x->ntype = NEXPR;
-       return(x);
-}
-node *op1(a,b) node *b;
-{      node *x;
-       x = node1(a,b);
-       x->ntype = NEXPR;
-       return(x);
-}
-node *stat1(a,b) node *b;
-{      node *x;
-       x = node1(a,b);
-       x->ntype = NSTAT;
-       return(x);
-}
-node *op3(a,b,c,d) node *b, *c, *d;
-{      node *x;
-       x = node3(a,b,c,d);
-       x->ntype = NEXPR;
-       return(x);
-}
-node *stat2(a,b,c) node *b, *c;
-{      node *x;
-       x = node2(a,b,c);
-       x->ntype = NSTAT;
-       return(x);
-}
-node *stat4(a,b,c,d,e) node *b, *c, *d, *e;
-{      node *x;
-       x = node4(a,b,c,d,e);
-       x->ntype = NSTAT;
-       return(x);
-}
-node *valtonode(a, b) cell *a;
-{      node *x;
-       x = node0(a);
-       x->ntype = NVALUE;
-       x->subtype = b;
-       return(x);
-}
-node *genjump(a)
-{      node *x;
-       x = node0(a);
-       x->ntype = NSTAT;
-       return(x);
-}
-node *pa2stat(a,b,c) node *a, *b, *c;
-{      node *x;
-       x = node3(paircnt++, a, b, c);
-       x->ntype = NPA2;
-       return(x);
-}
-node *linkum(a,b) node *a, *b;
-{      node *c;
-       if(a == NULL) return(b);
-       else if(b == NULL) return(a);
-       for(c=a; c->nnext != NULL; c=c->nnext);
-       c->nnext = b;
-       return(a);
-}
-node *genprint()
-{      node *x;
-       x = stat2(PRINT,valtonode(lookup("$record", symtab), CFLD), nullstat);
-       return(x);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/proc.c b/.ref-Research-V7/usr/src/cmd/awk/proc.c
deleted file mode 100644 (file)
index 869e9e9..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#include "awk.h"
-#define NULL 0
-struct xx
-{      int token;
-       char *name;
-       char *pname;
-} proc[] {
-       { PROGRAM, "program", NULL},
-       { BOR, "boolop", " || "},
-       { AND, "boolop", " && "},
-       { NOT, "boolop", " !"},
-       { NE, "relop", " != "},
-       { EQ, "relop", " == "},
-       { LE, "relop", " <= "},
-       { LT, "relop", " < "},
-       { GE, "relop", " >= "},
-       { GT, "relop", " > "},
-       { ARRAY, "array", NULL},
-       { INDIRECT, "indirect", "$("},
-       { SUBSTR, "substr", "substr"},
-       { INDEX, "sindex", "sindex"},
-       { SPRINTF, "asprintf", "sprintf "},
-       { ADD, "arith", " + "},
-       { MINUS, "arith", " - "},
-       { MULT, "arith", " * "},
-       { DIVIDE, "arith", " / "},
-       { MOD, "arith", " % "},
-       { UMINUS, "arith", " -"},
-       { PREINCR, "incrdecr", "++"},
-       { POSTINCR, "incrdecr", "++"},
-       { PREDECR, "incrdecr", "--"},
-       { POSTDECR, "incrdecr", "--"},
-       { CAT, "cat", " "},
-       { PASTAT, "pastat", NULL},
-       { PASTAT2, "dopa2", NULL},
-       { MATCH, "matchop", " ~ "},
-       { NOTMATCH, "matchop", " !~ "},
-       { PRINTF, "aprintf", "printf"},
-       { PRINT, "print", "print"},
-       { SPLIT, "split", "split"},
-       { ASSIGN, "assign", " = "},
-       { ADDEQ, "assign", " += "},
-       { SUBEQ, "assign", " -= "},
-       { MULTEQ, "assign", " *= "},
-       { DIVEQ, "assign", " /= "},
-       { MODEQ, "assign", " %= "},
-       { IF, "ifstat", "if("},
-       { WHILE, "whilestat", "while("},
-       { FOR, "forstat", "for("},
-       { IN, "instat", "instat"},
-       { NEXT, "jump", "next"},
-       { EXIT, "jump", "exit"},
-       { BREAK, "jump", "break"},
-       { CONTINUE, "jump", "continue"},
-       { FNCN, "fncn", "fncn"},
-       { 0, ""},
-};
-#define SIZE   LASTTOKEN - FIRSTTOKEN
-char *table[SIZE];
-char *names[SIZE];
-main()
-{      struct xx *p;
-       int i;
-       printf("#include \"awk.def\"\n");
-       printf("obj nullproc();\n");
-       for(p=proc;p->token!=0;p++)
-               if(p==proc || strcmp(p->name, (p-1)->name))
-                       printf("extern obj %s();\n",p->name);
-       for(p=proc;p->token!=0;p++)
-               table[p->token-FIRSTTOKEN]=p->name;
-       printf("obj (*proctab[%d])() {\n", SIZE);
-       for(i=0;i<SIZE;i++)
-               if(table[i]==0) printf("/*%s*/\tnullproc,\n",tokname(i+FIRSTTOKEN));
-               else printf("/*%s*/\t%s,\n",tokname(i+FIRSTTOKEN),table[i]);
-       printf("};\n");
-       printf("char *printname[%d] {\n", SIZE);
-       for(p=proc; p->token!=0; p++)
-               names[p->token-FIRSTTOKEN] = p->pname;
-       for(i=0; i<SIZE; i++)
-               printf("/*%s*/\t\"%s\",\n",tokname(i+FIRSTTOKEN),names[i]);
-       printf("};\n");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/run.c b/.ref-Research-V7/usr/src/cmd/awk/run.c
deleted file mode 100644 (file)
index 4fc6d43..0000000
+++ /dev/null
@@ -1,832 +0,0 @@
-#include "awk.def"
-#include       "math.h"
-#define RECSIZE 512
-#include "awk.h"
-#include "stdio.h"
-
-#define FILENUM        10
-struct
-{
-       FILE *fp;
-       char *fname;
-} files[FILENUM];
-FILE *popen();
-
-extern obj execute(), nodetoobj(), fieldel(), dopa2();
-#define PA2NUM 29
-int pairstack[PA2NUM], paircnt;
-node *winner = (node *)NULL;
-#define MAXTMP 20
-cell tmps[MAXTMP];
-static cell nullval ={0,0,0.0,NUM,0};
-obj    true    ={ OBOOL, BTRUE, 0 };
-obj    false   ={ OBOOL, BFALSE, 0 };
-
-run()
-{
-       return(execute(winner).otype);
-}
-
-obj execute(u) node *u;
-{
-       register obj (*proc)();
-       obj x;
-       node *a;
-       extern char *printname[];
-
-       if (u==(node *)NULL)
-               return(true);
-       for (a = u; ; a = a->nnext) {
-               if (cantexec(a))
-                       return(nodetoobj(a));
-               if (a->ntype==NPA2)
-                       proc=dopa2;
-               else {
-                       if (notlegal(a->nobj))
-                               error(FATAL, "illegal statement %o", a);
-                       proc = proctab[a->nobj-FIRSTTOKEN];
-               }
-               x = (*proc)(a->narg,a->nobj);
-               if (isfld(x)) fldbld();
-               if (isexpr(a))
-                       return(x);
-               /* a statement, goto next statement */
-               if (isjump(x))
-                       return(x);
-               if (a->nnext == (node *)NULL)
-                       return(x);
-               tempfree(x);
-       }
-}
-
-obj program(a, n) node **a;
-{
-       obj x;
-
-       if (a[0] != NULL) {
-               x = execute(a[0]);
-               if (isexit(x))
-                       return(true);
-               if (isjump(x))
-                       error(FATAL, "unexpected break, continue or next");
-               tempfree(x);
-       }
-       while (getrec()) {
-               recloc->tval &= ~NUM;
-               recloc->tval |= STR;
-               ++nrloc->fval;
-               nrloc->tval &= ~STR;
-               nrloc->tval |= NUM;
-               x = execute(a[1]);
-               if (isexit(x)) break;
-               tempfree(x);
-       }
-       tempfree(x);
-       if (a[2] != NULL) {
-               x = execute(a[2]);
-               if (isbreak(x) || isnext(x) || iscont(x))
-                       error(FATAL, "unexpected break, continue or next");
-               tempfree(x);
-       }
-       return(true);
-}
-
-obj array(a,n) node **a;
-{
-       obj x, y;
-       extern obj arrayel();
-
-       x = execute(a[1]);
-       y = arrayel(a[0], x);
-       tempfree(x);
-       return(y);
-}
-
-obj arrayel(a,b) node *a; obj b;
-{
-       char *s;
-       cell *x;
-       int i;
-       obj y;
-
-       s = getsval(b.optr);
-       x = (cell *) a;
-       if (!(x->tval&ARR)) {
-               xfree(x->sval);
-               x->tval &= ~STR;
-               x->tval |= ARR;
-               x->sval = (char *) makesymtab();
-       }
-       y.optr = setsymtab(s, tostring(""), 0.0, STR, x->sval);
-       y.otype = OCELL;
-       y.osub = CVAR;
-       return(y);
-}
-
-obj matchop(a,n) node **a;
-{
-       obj x;
-       char *s;
-       int i;
-
-       x = execute(a[0]);
-       if (isstr(x)) s = x.optr->sval;
-       else    s = getsval(x.optr);
-       tempfree(x);
-       i = match(a[1], s);
-       if (n==MATCH && i==1 || n==NOTMATCH && i==0)
-               return(true);
-       else
-               return(false);
-}
-
-obj boolop(a,n) node **a;
-{
-       obj x, y;
-       int i;
-
-       x = execute(a[0]);
-       i = istrue(x);
-       tempfree(x);
-       switch (n) {
-       default:
-               error(FATAL, "unknown boolean operator %d", n);
-       case BOR:
-               if (i) return(true);
-               y = execute(a[1]);
-               i = istrue(y);
-               tempfree(y);
-               if (i) return(true);
-               else return(false);
-       case AND:
-               if ( !i ) return(false);
-               y = execute(a[1]);
-               i = istrue(y);
-               tempfree(y);
-               if (i) return(true);
-               else return(false);
-       case NOT:
-               if (i) return(false);
-               else return(true);
-       }
-}
-
-obj relop(a,n) node **a;
-{
-       int i;
-       obj x, y;
-       awkfloat j;
-
-       x = execute(a[0]);
-       y = execute(a[1]);
-       if (x.optr->tval&NUM && y.optr->tval&NUM) {
-               j = x.optr->fval - y.optr->fval;
-               i = j<0? -1: (j>0? 1: 0);
-       } else {
-               i = strcmp(getsval(x.optr), getsval(y.optr));
-       }
-       tempfree(x);
-       tempfree(y);
-       switch (n) {
-       default:
-               error(FATAL, "unknown relational operator %d", n);
-       case LT:        if (i<0) return(true);
-                       else return(false);
-       case LE:        if (i<=0) return(true);
-                       else return(false);
-       case NE:        if (i!=0) return(true);
-                       else return(false);
-       case EQ:        if (i==0) return(true);
-                       else return(false);
-       case GE:        if (i>=0) return(true);
-                       else return(false);
-       case GT:        if (i>0) return(true);
-                       else return(false);
-       }
-}
-
-tempfree(a) obj a;
-{
-       if (!istemp(a)) return;
-       xfree(a.optr->sval);
-       a.optr->tval = 0;
-}
-
-obj gettemp()
-{
-       int i;
-       obj x;
-
-       for (i=0; i<MAXTMP; i++)
-               if (tmps[i].tval==0)
-                       break;
-       if (i==MAXTMP)
-               error(FATAL, "out of temporaries in gettemp");
-       x.optr = &tmps[i];
-       tmps[i] = nullval;
-       x.otype = OCELL;
-       x.osub = CTEMP;
-       return(x);
-}
-
-obj indirect(a,n) node **a;
-{
-       obj x;
-       int m;
-       cell *fieldadr();
-
-       x = execute(a[0]);
-       m = getfval(x.optr);
-       tempfree(x);
-       x.optr = fieldadr(m);
-       x.otype = OCELL;
-       x.osub = CFLD;
-       return(x);
-}
-
-obj substr(a, nnn) node **a;
-{
-       char *s, *p, temp[100];
-       obj x;
-       int k, m, n;
-
-       x = execute(a[0]);
-       s = getsval(x.optr);
-       k = strlen(s) + 1;
-       tempfree(x);
-       x = execute(a[1]);
-       m = getfval(x.optr);
-       if (m <= 0)
-               m = 1;
-       else if (m > k)
-               m = k;
-       tempfree(x);
-       if (a[2] != nullstat) {
-               x = execute(a[2]);
-               n = getfval(x.optr);
-               tempfree(x);
-       }
-       else
-               n = k - 1;
-       if (n < 0)
-               n = 0;
-       else if (n > k - m)
-               n = k - m;
-       dprintf("substr: m=%d, n=%d, s=%s\n", m, n, s);
-       p = temp;
-       s += m - 1;
-       while (n-- > 0)
-               *p++ = *s++;
-       *p = '\0';
-       x = gettemp();
-       setsval(x.optr, temp);
-       return(x);
-}
-
-obj sindex(a, nnn) node **a;
-{
-       obj x, y;
-       char *s1, *s2, *p1, *p2, *q;
-
-       x = execute(a[0]);
-       s1 = getsval(x.optr);
-       tempfree(x);
-       y = execute(a[1]);
-       s2 = getsval(y.optr);
-       tempfree(y);
-
-       x = gettemp();
-       for (p1 = s1; *p1 != '\0'; p1++) {
-               for (q=p1, p2=s2; *p2 != '\0' && *q == *p2; q++, p2++)
-                       ;
-               if (*p2 == '\0') {
-                       setfval(x.optr, (awkfloat) (p1 - s1 + 1));      /* origin 1 */
-                       return(x);
-               }
-       }
-       setfval(x.optr, 0.0);
-       return(x);
-}
-
-char *format(s,a) char *s; node *a;
-{
-       char *buf, *p, fmt[100], *t, *os;
-       obj x;
-       int flag = 0;
-       awkfloat xf;
-
-       os = s;
-       p = buf = (char *)malloc(RECSIZE);
-       while (*s) {
-               if (*s != '%') {
-                       *p++ = *s++;
-                       continue;
-               }
-               if (*(s+1) == '%') {
-                       *p++ = '%';
-                       *p++ = '%';
-                       s += 2;
-                       continue;
-               }
-               for (t=fmt; (*t++ = *s) != '\0'; s++)
-                       if (*s >= 'a' && *s <= 'z' && *s != 'l')
-                               break;
-               *t = '\0';
-               if (t > fmt + 100)
-                       error(FATAL, "format item %.20s... too long", os);
-               switch (*s) {
-               case 'f': case 'e': case 'g':
-                       flag = 1;
-                       break;
-               case 'd':
-                       flag = 2;
-                       if(*(s-1) == 'l') break;
-                       *(t-1) = 'l';
-                       *t = 'd';
-                       *++t = '\0';
-                       break;
-               case 'o': case 'x':
-                       flag = *(s-1)=='l' ? 2 : 3;
-                       break;
-               case 's':
-                       flag = 4;
-                       break;
-               default:
-                       flag = 0;
-                       break;
-               }
-               if (flag == 0) {
-                       sprintf(p, "%s", fmt);
-                       p += strlen(p);
-                       continue;
-               }
-               if (a == NULL)
-                       error(FATAL, "not enough arguments in printf(%s)", os);
-               x = execute(a);
-               a = a->nnext;
-               if (flag != 4)  /* watch out for converting to numbers! */
-                       xf = getfval(x.optr);
-               if (flag==1) sprintf(p, fmt, xf);
-               else if (flag==2) sprintf(p, fmt, (long)xf);
-               else if (flag==3) sprintf(p, fmt, (int)xf);
-               else if (flag==4) sprintf(p, fmt, x.optr->sval==NULL ? "" : getsval(x.optr));
-               tempfree(x);
-               p += strlen(p);
-               s++;
-       }
-       *p = '\0';
-       return(buf);
-}
-
-obj asprintf(a,n) node **a;
-{
-       obj x;
-       node *y;
-       char *s;
-
-       y = a[0]->nnext;
-       x = execute(a[0]);
-       s = format(getsval(x.optr), y);
-       tempfree(x);
-       x = gettemp();
-       x.optr->sval = s;
-       x.optr->tval = STR;
-       return(x);
-}
-
-obj arith(a,n) node **a;
-{
-       awkfloat i,j;
-       obj x,y,z;
-
-       x = execute(a[0]);
-       i = getfval(x.optr);
-       tempfree(x);
-       if (n != UMINUS) {
-               y = execute(a[1]);
-               j = getfval(y.optr);
-               tempfree(y);
-       }
-       z = gettemp();
-       switch (n) {
-       default:
-               error(FATAL, "illegal arithmetic operator %d", n);
-       case ADD:
-               setfval(z.optr, i+j);
-               break;
-       case MINUS:
-               setfval(z.optr, i-j);
-               break;
-       case MULT:
-               setfval(z.optr, i*j);
-               break;
-       case DIVIDE:
-               if (j == 0)
-                       error(FATAL, "division by zero");
-               setfval(z.optr, i/j);
-               break;
-       case MOD:
-               if (j == 0)
-                       error(FATAL, "division by zero");
-               setfval(z.optr, i-j*(long)(i/j));
-               break;
-       case UMINUS:
-               setfval(z.optr, -i);
-               break;
-       }
-       return(z);
-}
-
-obj incrdecr(a, n) node **a;
-{
-       obj x, z;
-       int k;
-       awkfloat xf;
-
-       x = execute(a[0]);
-       xf = getfval(x.optr);
-       k = (n == PREINCR || n == POSTINCR) ? 1 : -1;
-       if (n == PREINCR || n == PREDECR) {
-               setfval(x.optr, xf + k);
-               return(x);
-       }
-       z = gettemp();
-       setfval(z.optr, xf);
-       setfval(x.optr, xf + k);
-       tempfree(x);
-       return(z);
-}
-
-
-obj assign(a,n) node **a;
-{
-       obj x, y;
-       awkfloat xf, yf;
-
-       x = execute(a[0]);
-       y = execute(a[1]);
-       if (n == ASSIGN) {      /* ordinary assignment */
-               if (y.optr->tval&STR) setsval(x.optr, y.optr->sval);
-               if (y.optr->tval&NUM) setfval(x.optr, y.optr->fval);
-               tempfree(y);
-               return(x);
-       }
-       xf = getfval(x.optr);
-       yf = getfval(y.optr);
-       switch (n) {
-       case ADDEQ:
-               setfval(x.optr, xf + yf);
-               break;
-       case SUBEQ:
-               setfval(x.optr, xf - yf);
-               break;
-       case MULTEQ:
-               setfval(x.optr, xf * yf);
-               break;
-       case DIVEQ:
-               if (yf == 0)
-                       error(FATAL, "division by zero");
-               setfval(x.optr, xf / yf);
-               break;
-       case MODEQ:
-               if (yf == 0)
-                       error(FATAL, "division by zero");
-               setfval(x.optr, xf - yf*(long)(xf/yf));
-               break;
-       default:
-               error(FATAL, "illegal assignment operator %d", n);
-               break;
-       }
-       tempfree(y);
-       return(x);
-}
-
-obj cat(a,q) node **a;
-{
-       obj x,y,z;
-       int n;
-       char *s;
-
-       x = execute(a[0]);
-       y = execute(a[1]);
-       getsval(x.optr);
-       getsval(y.optr);
-       n = strlen(x.optr->sval) + strlen(y.optr->sval);
-       s = (char *)malloc(n+1);
-       strcpy(s, x.optr->sval);
-       strcat(s, y.optr->sval);
-       tempfree(y);
-       z = gettemp();
-       z.optr->sval = s;
-       z.optr->tval = STR;
-       tempfree(x);
-       return(z);
-}
-
-obj pastat(a,n) node **a;
-{
-       obj x;
-
-       if (a[0]==nullstat)
-               x = true;
-       else
-               x = execute(a[0]);
-       if (istrue(x)) {
-               tempfree(x);
-               x = execute(a[1]);
-       }
-       return(x);
-}
-
-obj dopa2(a,n) node **a;
-{
-       obj x;
-
-       if (pairstack[n]==0) {
-               x = execute(a[0]);
-               if (istrue(x))
-                       pairstack[n] = 1;
-               tempfree(x);
-       }
-       if (pairstack[n] == 1) {
-               x = execute(a[1]);
-               if (istrue(x))
-                       pairstack[n] = 0;
-               tempfree(x);
-               x = execute(a[2]);
-               return(x);
-       }
-       return(false);
-}
-
-obj aprintf(a,n) node **a;
-{
-       obj x;
-
-       x = asprintf(a,n);
-       if (a[1]==NULL) {
-               printf(x.optr->sval);
-               tempfree(x);
-               return(true);
-       }
-       redirprint(x.optr->sval, (int)a[1], a[2]);
-       return(x);
-}
-
-obj split(a,nnn) node **a;
-{
-       obj x;
-       cell *ap;
-       register char *s, *p;
-       char *t, temp[100], num[5];
-       register int sep;
-       int n;
-
-       x = execute(a[0]);
-       s = getsval(x.optr);
-       tempfree(x);
-       if (a[2] == nullstat)
-               sep = **FS;
-       else {
-               x = execute(a[2]);
-               sep = getsval(x.optr)[0];
-               tempfree(x);
-       }
-       n = 0;
-       ap = (cell *) a[1];
-       freesymtab(ap);
-       dprintf("split: s=|%s|, a=%s, sep=|%c|\n", s, ap->nval, sep);
-       ap->tval &= ~STR;
-       ap->tval |= ARR;
-       ap->sval = (char *) makesymtab();
-       /* here we go */
-       for (;;) {
-               if (sep == ' ')
-                       while (*s == ' ' || *s == '\t' || *s == '\n')
-                               s++;
-               if (*s == '\0')
-                       break;
-               n++;
-               for (p=s, t=temp; (*t = *p) != '\0'; p++, t++)
-                       if (*p == sep
-                         || sep == ' ' && (*p == '\t' || *p == '\n')
-                         || sep == '\t' && *p == '\n')
-                               break;
-               *t = '\0';
-               dprintf("n=%d, s=|%s|, temp=|%s|\n", n, s, temp);
-               sprintf(num, "%d", n);
-               setsymtab(num, tostring(temp), 0.0, STR, ap->sval);
-               if (*p == '\0') /* all done */
-                       break;
-               s = p + 1;
-       }
-       x = gettemp();
-       x.optr->tval = NUM;
-       x.optr->fval = n;
-       return(x);
-}
-
-obj ifstat(a,n) node **a;
-{
-       obj x;
-
-       x = execute(a[0]);
-       if (istrue(x)) {
-               tempfree(x);
-               x = execute(a[1]);
-       }
-       else if (a[2] != nullstat) {
-               tempfree(x);
-               x = execute(a[2]);
-       }
-       return(x);
-}
-
-obj whilestat(a,n) node **a;
-{
-       obj x;
-
-       for (;;) {
-               x = execute(a[0]);
-               if (!istrue(x)) return(x);
-               tempfree(x);
-               x = execute(a[1]);
-               if (isbreak(x)) {
-                       x = true;
-                       return(x);
-               }
-               if (isnext(x) || isexit(x))
-                       return(x);
-               tempfree(x);
-       }
-}
-
-obj forstat(a,n) node **a;
-{
-       obj x;
-
-       tempfree(execute(a[0]));
-       for (;;) {
-               if (a[1]!=nullstat) {
-                       x = execute(a[1]);
-                       if (!istrue(x)) return(x);
-                       else tempfree(x);
-               }
-               x = execute(a[3]);
-               if (isbreak(x)) {       /* turn off break */
-                       x = true;
-                       return(x);
-               }
-               if (isnext(x) || isexit(x))
-                       return(x);
-               tempfree(x);
-               tempfree(execute(a[2]));
-       }
-}
-
-obj instat(a, n) node **a;
-{
-       cell *vp, *arrayp, *cp, **tp;
-       obj x;
-       int i;
-
-       vp = (cell *) a[0];
-       arrayp = (cell *) a[1];
-       if (!(arrayp->tval & ARR))
-               error(FATAL, "%s is not an array", arrayp->nval);
-       tp = (cell **) arrayp->sval;
-       for (i = 0; i < MAXSYM; i++) {  /* this routine knows too much */
-               for (cp = tp[i]; cp != NULL; cp = cp->nextval) {
-                       xfree(vp->sval);
-                       vp->sval = tostring(cp->nval);
-                       vp->tval = STR;
-                       x = execute(a[2]);
-                       if (isbreak(x)) {
-                               x = true;
-                               return(x);
-                       }
-                       if (isnext(x) || isexit(x))
-                               return(x);
-                       tempfree(x);
-               }
-       }
-}
-
-obj jump(a,n) node **a;
-{
-       obj x;
-
-       x.otype = OJUMP;
-       switch (n) {
-       default:
-               error(FATAL, "illegal jump type %d", n);
-               break;
-       case EXIT:
-               x.osub = JEXIT;
-               break;
-       case NEXT:
-               x.osub = JNEXT;
-               break;
-       case BREAK:
-               x.osub = JBREAK;
-               break;
-       case CONTINUE:
-               x.osub = JCONT;
-               break;
-       }
-       return(x);
-}
-
-obj fncn(a,n) node **a;
-{
-       obj x;
-       awkfloat u;
-       int t;
-
-       t = (int) a[0];
-       x = execute(a[1]);
-       if (t == FLENGTH)
-               u = (awkfloat) strlen(getsval(x.optr));
-       else if (t == FLOG)
-               u = log(getfval(x.optr));
-       else if (t == FINT)
-               u = (awkfloat) (long) getfval(x.optr);
-       else if (t == FEXP)
-               u = exp(getfval(x.optr));
-       else if (t == FSQRT)
-               u = sqrt(getfval(x.optr));
-       else
-               error(FATAL, "illegal function type %d", t);
-       tempfree(x);
-       x = gettemp();
-       setfval(x.optr, u);
-       return(x);
-}
-
-obj print(a,n) node **a;
-{
-       register node *x;
-       obj y;
-       char s[RECSIZE];
-
-       s[0] = '\0';
-       for (x=a[0]; x!=NULL; x=x->nnext) {
-               y = execute(x);
-               strcat(s, getsval(y.optr));
-               tempfree(y);
-               if (x->nnext==NULL)
-                       strcat(s, *ORS);
-               else
-                       strcat(s, *OFS);
-       }
-       if (strlen(s) >= RECSIZE)
-               error(FATAL, "string %.20s ... too long to print", s);
-       if (a[1]==nullstat) {
-               printf("%s", s);
-               return(true);
-       }
-       redirprint(s, (int)a[1], a[2]);
-       return(false);
-}
-
-obj nullproc() {}
-
-obj nodetoobj(a) node *a;
-{
-       obj x;
-
-       x.optr = (cell *) a->nobj;
-       x.otype = OCELL;
-       x.osub = a->subtype;
-       if (isfld(x)) fldbld();
-       return(x);
-}
-
-redirprint(s, a, b) char *s; node *b;
-{
-       register int i;
-       obj x;
-
-       x = execute(b);
-       getsval(x.optr);
-       for (i=0; i<FILENUM; i++)
-               if (strcmp(x.optr->sval, files[i].fname) == 0)
-                       goto doit;
-       for (i=0; i<FILENUM; i++)
-               if (files[i].fp == 0)
-                       break;
-       if (i >= FILENUM)
-               error(FATAL, "too many output files %d", i);
-       if (a == '|')   /* a pipe! */
-               files[i].fp = popen(x.optr->sval, "w");
-       else if (a == APPEND)
-               files[i].fp = fopen(x.optr->sval, "a");
-       else
-               files[i].fp = fopen(x.optr->sval, "w");
-       if (files[i].fp == NULL)
-               error(FATAL, "can't open file %s", x.optr->sval);
-       files[i].fname = tostring(x.optr->sval);
-doit:
-       fprintf(files[i].fp, "%s", s);
-       tempfree(x);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/token.c b/.ref-Research-V7/usr/src/cmd/awk/token.c
deleted file mode 100644 (file)
index 3b559e5..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "awk.h"
-struct tok
-{      char *tnm;
-       int yval;
-} tok[]        = {
-"FIRSTTOKEN", 257,
-"FINAL", 258,
-"FATAL", 259,
-"LT", 260,
-"LE", 261,
-"GT", 262,
-"GE", 263,
-"EQ", 264,
-"NE", 265,
-"MATCH", 266,
-"NOTMATCH", 267,
-"APPEND", 268,
-"ADD", 269,
-"MINUS", 270,
-"MULT", 271,
-"DIVIDE", 272,
-"MOD", 273,
-"UMINUS", 274,
-"ASSIGN", 275,
-"ADDEQ", 276,
-"SUBEQ", 277,
-"MULTEQ", 278,
-"DIVEQ", 279,
-"MODEQ", 280,
-"JUMP", 281,
-"XBEGIN", 282,
-"XEND", 283,
-"NL", 284,
-"PRINT", 285,
-"PRINTF", 286,
-"SPRINTF", 287,
-"SPLIT", 288,
-"IF", 289,
-"ELSE", 290,
-"WHILE", 291,
-"FOR", 292,
-"IN", 293,
-"NEXT", 294,
-"EXIT", 295,
-"BREAK", 296,
-"CONTINUE", 297,
-"PROGRAM", 298,
-"PASTAT", 299,
-"PASTAT2", 300,
-"ASGNOP", 301,
-"BOR", 302,
-"AND", 303,
-"NOT", 304,
-"NUMBER", 305,
-"VAR", 306,
-"ARRAY", 307,
-"FNCN", 308,
-"SUBSTR", 309,
-"LSUBSTR", 310,
-"INDEX", 311,
-"RELOP", 312,
-"MATCHOP", 313,
-"OR", 314,
-"STRING", 315,
-"DOT", 316,
-"CCL", 317,
-"NCCL", 318,
-"CHAR", 319,
-"CAT", 320,
-"STAR", 321,
-"PLUS", 322,
-"QUEST", 323,
-"POSTINCR", 324,
-"PREINCR", 325,
-"POSTDECR", 326,
-"PREDECR", 327,
-"INCR", 328,
-"DECR", 329,
-"FIELD", 330,
-"INDIRECT", 331,
-"LASTTOKEN", 332,
-};
-ptoken(n)
-{
-       if(n<128) printf("lex: %c\n",n);
-       else    if(n<=256) printf("lex:? %o\n",n);
-       else    if(n<LASTTOKEN) printf("lex: %s\n",tok[n-257].tnm);
-       else    printf("lex:? %o\n",n);
-       return;
-}
-
-char *tokname(n)
-{
-       if (n<=256 || n >= LASTTOKEN)
-               n = 257;
-       return(tok[n-257].tnm);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/awk/tokenscript b/.ref-Research-V7/usr/src/cmd/awk/tokenscript
deleted file mode 100644 (file)
index 809784c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-e y.tab.h
-1,$s/# *define *//
-1,$s/^/"/
-1,$s/ /", /
-1,$s/$/,/
-w temp
-e token.c
-/= *{$/+1,/^};$/-1d
--r temp
-w token.c
-q
diff --git a/.ref-Research-V7/usr/src/cmd/awk/tran.c b/.ref-Research-V7/usr/src/cmd/awk/tran.c
deleted file mode 100644 (file)
index b5f7f06..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-#include "stdio.h"
-#include "awk.def"
-#include "awk.h"
-
-cell *symtab[MAXSYM];  /* symbol table pointers */
-
-char   **FS;   /* initial field sep */
-char   **RS;   /* initial record sep */
-char   **OFS;  /* output field sep */
-char   **ORS;  /* output record sep */
-char   **OFMT; /*output format for numbers*/
-awkfloat *NF;  /* number of fields in current record */
-awkfloat *NR;  /* number of current record */
-char   **FILENAME;     /* current filename argument */
-
-cell   *recloc;        /* location of record */
-cell   *nrloc;         /* NR */
-cell   *nfloc;         /* NF */
-
-syminit()
-{
-       setsymtab("0", tostring("0"), 0.0, NUM|STR|CON|FLD, symtab);
-       recloc = setsymtab("$record", record, 0.0, STR|FLD, symtab);
-       dprintf("recloc %o lookup %o\n", recloc, lookup("$record", symtab), NULL);
-       FS = &setsymtab("FS", tostring(" "), 0.0, STR|FLD, symtab)->sval;
-       RS = &setsymtab("RS", tostring("\n"), 0.0, STR|FLD, symtab)->sval;
-       OFS = &setsymtab("OFS", tostring(" "), 0.0, STR|FLD, symtab)->sval;
-       ORS = &setsymtab("ORS", tostring("\n"), 0.0, STR|FLD, symtab)->sval;
-       OFMT = &setsymtab("OFMT", tostring("%.6g"), 0.0, STR|FLD, symtab)->sval;
-       FILENAME = &setsymtab("FILENAME", NULL, 0.0, STR|FLD, symtab)->sval;
-       nfloc = setsymtab("NF", NULL, 0.0, NUM, symtab);
-       NF = &nfloc->fval;
-       nrloc = setsymtab("NR", NULL, 0.0, NUM, symtab);
-       NR = &nrloc->fval;
-}
-
-cell **makesymtab()
-{
-       int i;
-       cell **cp;
-
-       cp = (char *) malloc(MAXSYM * sizeof(cell *));
-       if (cp == NULL)
-               error(FATAL, "out of space in makesymtab");
-       for (i = 0; i < MAXSYM; i++)
-               *((cell **) cp + i) = 0;
-       return(cp);
-}
-
-freesymtab(ap) /* free symbol table */
-cell *ap;
-{
-       cell *cp, **tp;
-       int i;
-
-       if (!(ap->tval & ARR))
-               return;
-       tp = (cell **) ap->sval;
-       for (i = 0; i < MAXSYM; i++) {
-               for (cp = tp[i]; cp != NULL; cp = cp->nextval) {
-                       xfree(cp->nval);
-                       xfree(cp->sval);
-                       free(cp);
-               }
-       }
-       xfree(tp);
-}
-
-cell *setsymtab(n, s, f, t, tab)
-char *n, *s;
-awkfloat f;
-unsigned t;
-cell **tab;
-{
-       register h;
-       register cell *p;
-       cell *lookup();
-
-       if (n != NULL && (p = lookup(n, tab)) != NULL) {
-               xfree(s);
-               dprintf("setsymtab found %o: %s", p, p->nval, NULL);
-               dprintf(" %s %g %o\n", p->sval, p->fval, p->tval);
-               return(p);
-       }
-       p = (cell *) malloc(sizeof(cell));
-       if (p == NULL)
-               error(FATAL, "symbol table overflow at %s", n);
-       p->nval = tostring(n);
-       p->sval = s;
-       p->fval = f;
-       p->tval = t;
-       h = hash(n);
-       p->nextval = tab[h];
-       tab[h] = p;
-       dprintf("setsymtab set %o: %s", p, p->nval, NULL);
-       dprintf(" %s %g %o\n", p->sval, p->fval, p->tval);
-       return(p);
-}
-
-hash(s)        /* form hash value for string s */
-register char *s;
-{
-       register int hashval;
-
-       for (hashval = 0; *s != '\0'; )
-               hashval += *s++;
-       return(hashval % MAXSYM);
-}
-
-cell *lookup(s, tab)   /* look for s in tab */
-register char *s;
-cell **tab;
-{
-       register cell *p;
-
-       for (p = tab[hash(s)]; p != NULL; p = p->nextval)
-               if (strcmp(s, p->nval) == 0)
-                       return(p);      /* found it */
-       return(NULL);   /* not found */
-}
-
-awkfloat setfval(vp, f)
-register cell *vp;
-awkfloat f;
-{
-       dprintf("setfval: %o %g\n", vp, f, NULL);
-       checkval(vp);
-       if (vp == recloc)
-               error(FATAL, "can't set $0");
-       vp->tval &= ~STR;       /* mark string invalid */
-       vp->tval |= NUM;        /* mark number ok */
-       if ((vp->tval & FLD) && vp->nval == 0)
-               donerec = 0;
-       return(vp->fval = f);
-}
-
-char *setsval(vp, s)
-register cell *vp;
-char *s;
-{
-       dprintf("setsval: %o %s\n", vp, s, NULL);
-       checkval(vp);
-       if (vp == recloc)
-               error(FATAL, "can't set $0");
-       vp->tval &= ~NUM;
-       vp->tval |= STR;
-       if ((vp->tval & FLD) && vp->nval == 0)
-               donerec = 0;
-       if (!(vp->tval&FLD))
-               xfree(vp->sval);
-       vp->tval &= ~FLD;
-       return(vp->sval = tostring(s));
-}
-
-awkfloat getfval(vp)
-register cell *vp;
-{
-       awkfloat atof();
-
-       if (vp->sval == record && donerec == 0)
-               recbld();
-       dprintf("getfval: %o", vp, NULL, NULL);
-       checkval(vp);
-       if ((vp->tval & NUM) == 0) {
-               /* the problem is to make non-numeric things */
-               /* have unlikely numeric variables, so that */
-               /* $1 == $2 comparisons sort of make sense when */
-               /* one or the other is numeric */
-               if (isnumber(vp->sval)) {
-                       vp->fval = atof(vp->sval);
-                       if (!(vp->tval & CON))  /* don't change type of a constant */
-                               vp->tval |= NUM;
-               }
-               else
-                       vp->fval = 0.0; /* not a very good idea */
-       }
-       dprintf("  %g\n", vp->fval, NULL, NULL);
-       return(vp->fval);
-}
-
-char *getsval(vp)
-register cell *vp;
-{
-       char s[100];
-
-       if (vp->sval == record && donerec == 0)
-               recbld();
-       dprintf("getsval: %o", vp, NULL, NULL);
-       checkval(vp);
-       if ((vp->tval & STR) == 0) {
-               if (!(vp->tval&FLD))
-                       xfree(vp->sval);
-               if ((long)vp->fval==vp->fval)
-                       sprintf(s, "%.20g", vp->fval);
-               else
-                       sprintf(s, *OFMT, vp->fval);
-               vp->sval = tostring(s);
-               vp->tval &= ~FLD;
-               vp->tval |= STR;
-       }
-       dprintf("  %s\n", vp->sval, NULL, NULL);
-       return(vp->sval);
-}
-
-checkval(vp)
-register cell *vp;
-{
-       if (vp->tval & ARR)
-               error(FATAL, "illegal reference to array %s", vp->nval);
-       if ((vp->tval & (NUM | STR)) == 0)
-               error(FATAL, "funny variable %o: %s %s %g %o", vp, vp->nval,
-                       vp->sval, vp->fval, vp->tval);
-}
-
-char *tostring(s)
-register char *s;
-{
-       register char *p;
-
-       p = malloc(strlen(s)+1);
-       if (p == NULL)
-               error(FATAL, "out of space in tostring on %s", s);
-       strcpy(p, s);
-       return(p);
-}
-#ifndef yfree
-yfree(a) char *a;
-{
-       printf("%o\n", a);
-       free(a);
-}
-#endif
-#ifdef malloc
-#undef malloc
-char *ymalloc(u) unsigned u;
-{      char *p;
-       p = malloc(u);
-       printf("%o %o\n", u, p);
-       return(p);
-}
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/bas/bas.s b/.ref-Research-V7/usr/src/cmd/bas/bas.s
deleted file mode 100644 (file)
index 19c65d0..0000000
+++ /dev/null
@@ -1,2128 +0,0 @@
-/
-/
-
-/ bas0 -- basic
-
-scope = 1
-.globl main
-.globl sin, cos, log, exp, atan, pow, sqrt
-.globl rand, srand
-.globl fptrap
-.globl fopen, getc
-
-indir =        0  /for  indirect sys calls. (not in as)
-one = 40200
-
-main:
-       mov     $1,prfile /initial print file
-       sys     signal; 4; fptrap
-       setd
-       sys     time
-       mov     r1,r0
-       mov     r0,randx
-       jsr     pc,srand
-       sys     signal; 1; _done
-       sys     signal; 2; intrup
-       tst     r0
-       jeq     1f
-       sys     signal; 2; 1
-1:
-       mov     sp,gsp
-       clr     seeka
-       mov     $'a,r1
-1:
-       movb    r1,tmpf+8
-       sys     stat; tmpf; line
-       bes     1f
-       inc     r1
-       cmp     r1,$'z
-       blos    1b
-       br      2f
-1:
-       sys     creat; tmpf; 600
-       bes     2f
-       mov     r0,tfo
-       sys     open; tmpf; 0
-       bec     1f
-2:
-       mov     $3f,r0
-       jsr     pc,print
-       sys     exit
-3:
-       <Tmp file?\n\0>; .even
-1:
-       mov     r0,tfi
-
-       mov     gsp,sp
-       cmp     (sp),$2  /is there a file argument
-       blt     noarg
-       mov     4(sp),r0
-       mov     $argname,r1
-1:
-       movb    (r0)+,(r1)+
-       bne     1b
-aftered: / after edit
-       mov     $argname,r0
-       jsr     r5,fopen; iobuf
-       bes     1f
-noarg:
-       jsr     pc,isymtab
-       br      loop
-1:
-       mov     $1f,r0
-       jsr     pc,print
-       br      loop
-1:
-       <Cannot open file\n\0>; .even
-
-intrup:
-       sys     signal; 2; intrup
-       mov     $'\n,r0
-       jsr     r5,xputc
-       jsr     r5,error
-               <ready\n\0>; .even
-
-loop:
-       mov     gsp,sp
-       clr     lineno
-       jsr     pc,rdline
-       mov     $line,r3
-1:
-       movb    (r3),r0
-       jsr     pc,digit
-               br 1f
-       jsr     r5,atoi
-       cmp     r0,$' /
-       beq     3f
-       cmp     r0,$'    /tab
-       bne     1f
-3:
-       mov     $lintab,r3
-       mov     r1,r0
-       bgt     2f
-       jsr     pc,serror
-2:
-       cmp     r0,(r3)
-       beq     2f
-       tst     (r3)
-       beq     2f
-       add     $6,r3
-       br      2b
-2:
-       cmp     r3,$elintab-12.
-       blo     2f
-       jsr     r5,error
-               <too many lines\n\0>; .even
-2:
-       mov     r0,(r3)+
-       mov     seeka,(r3)+
-       mov     tfo,r0
-       mov     seeka,seekx
-       sys     indir; sysseek
-       mov     $line,r0
-       jsr     pc,size
-       inc     r0
-       add     r0,seeka
-       mov     r0,wlen
-       mov     tfo,r0
-       mov     $line,wbuf
-       sys     indir;syswrit
-       br      loop
-1:
-       mov     $line,r3
-       jsr     pc,singstat
-       br      loop
-
-nextc:
-       movb    (r3)+,r0
-       rts     r5
-
-size:
-       clr     -(sp)
-1:
-       inc     (sp)
-       cmpb    (r0),$'\n
-       beq     1f
-       cmpb    (r0),$0
-       beq     1f
-       inc     r0
-       br      1b
-1:
-       mov     (sp)+,r0
-       rts     pc
-
-rdline:  / read input (file or tty) to carr. ret.
-       mov     $line,r1
-1:
-       jsr     r5,getc; iobuf
-       bes     2f
-       tst     r0
-       beq     2f
-       cmp     r1,$line+99.
-       bhis    2f                      / bad check, but a check
-       movb    r0,(r1)+
-       cmpb    r0,$'\n
-       bne     1b
-       clrb    (r1)
-       rts     pc
-2:
-       mov     fi,r0
-       beq     1f
-       sys     close
-       clr     fi
-       br      1b
-1:
-       jmp     _done
-
-error:
-       tst     fi
-       beq     1f
-       sys     close
-       clr     fi
-1:
-       tst     lineno
-       beq     1f
-       jsr     pc,nextlin
-               br 1f
-       mov     $line,r0
-       jsr     pc,print
-1:
-       mov     r5,r0
-       jsr     pc,print
-       jmp     loop
-
-serror:
-       dec     r3
-       tst     fi
-       beq     1f
-       sys     close
-       clr     fi
-1:
-       mov     $line,r1
-1:
-       cmp     r1,r3
-       bne     2f
-       mov     $'_,r0
-       jsr     r5,xputc
-       mov     $10,r0
-       jsr     r5,xputc
-2:
-       movb    (r1),r0
-       jsr     r5,xputc
-       cmpb    (r1)+,$'\n
-       bne     1b
-       jmp     loop
-
-print:
-       mov     r0,wbuf
-       jsr     pc,size
-       mov     r0,wlen
-       mov     prfile,r0
-       sys     indir; syswrit
-       rts     pc
-
-digit:
-       cmp     r0,$'0
-       blo     1f
-       cmp     r0,$'9
-       bhi     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
-alpha:
-       cmp     r0,$'a
-       blo     1f
-       cmp     r0,$'z
-       bhi     1f
-       add     $2,(sp)
-1:
-       cmp     r0,$'A
-       blo     1f
-       cmp     r0,$'Z
-       bhi     1f
-       add     $2,(sp)
-1:
-       rts     pc
-
-name:
-       mov     $nameb,r1
-       clr     (r1)
-       clr     2(r1)
-1:
-       cmp     r1,$nameb+4
-       bhis    2f
-       movb    r0,(r1)+
-2:
-       movb    (r3)+,r0
-       jsr     pc,alpha
-               br 2f
-       br      1b
-2:
-       jsr     pc,digit
-               br 2f
-       br      1b
-2:
-       mov     $resnam,r1
-1:
-       cmp     nameb,(r1)
-       bne     2f
-       cmp     nameb+2,2(r1)
-       bne     2f
-       sub     $resnam,r1
-       asr     r1
-       add     $2,(sp)
-       rts     pc
-2:
-       add     $4,r1
-       cmp     r1,$eresnam
-       blo     1b
-       mov     $symtab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     nameb,(r1)
-       bne     2f
-       cmp     nameb+2,2(r1)
-       bne     2f
-       rts     pc
-2:
-       add     $14.,r1
-       br      1b
-1:
-       cmp     r1,$esymtab-28.
-       blo     1f
-       jsr     r5,error
-               <out of symbol space\n\0>; .even
-1:
-       mov     nameb,(r1)
-       mov     nameb+2,2(r1)
-       clr     4(r1)
-       clr     14.(r1)
-       rts     pc
-
-skip:
-       cmp     r0,$' /
-       beq     1f
-       cmp     r0,$'     / tab
-       bne     2f
-1:
-       movb    (r3)+,r0
-       br      skip
-2:
-       rts     pc
-
-xputc:
-.if scope  / for plotting
-       tstb    drflg
-       beq     1f
-       jsr     pc,drput
-       rts     r5
-1:
-.endif
-       mov     r0,ch
-       mov     $1,r0
-       sys     write; ch; 1
-       rts     r5
-
-nextlin:
-       clr     -(sp)
-       mov     $lintab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     lineno,(r1)
-       bhi     2f
-       mov     (sp),r0
-       beq     3f
-       cmp     (r0),(r1)
-       blos    2f
-3:
-       mov     r1,(sp)
-2:
-       add     $6,r1
-       br      1b
-1:
-       mov     (sp)+,r1
-       beq     1f
-       mov     (r1)+,lineno
-       mov     (r1)+,seekx
-       mov     tfi,r0
-       sys     indir; sysseek
-       mov     tfi,r0
-       sys     read; line; 100.
-       add     $2,(sp)
-1:
-       rts     pc
-
-getloc:
-       mov     $lintab,r1
-1:
-       tst     (r1)
-       beq     1f
-       cmp     r0,(r1)
-       beq     2f
-       add     $6,r1
-       br      1b
-1:
-       jsr     r5,error
-               <label not found\n\0>; .even
-2:
-       rts     pc
-
-isymtab:
-       mov     $symtab,r0
-       mov     $symtnam,r1
-       clrf    fr0
-       movf    $one,fr1
-1:
-       mov     (r1)+,(r0)+
-       mov     (r1)+,(r0)+
-       mov     $1,(r0)+
-       subf    r1,r0
-       movf    r0,(r0)+
-       cmp     r1,$esymtnam
-       blo     1b
-       clr     (r0)+
-       rts     pc
-
-/
-/
-
-/ bas1 -- compile
-/
-/    convention:       jsr pc,subrout /test
-/                              br failside
-/                      succeed ...
-
-compile:
-       clr     forp
-       mov     $iflev,ifp /added for if..else..fi
-       mov     $space,r4
-       tst     lineno
-       beq     1f
-       rts     pc
-1:
-       jsr     pc,nextlin
-               br 1f
-       mov     lineno,r0
-       jsr     pc,getloc
-       mov     r4,4(r1)
-       jsr     pc,statement
-               br .+2
-       inc     lineno
-       cmp     r4,$espace+20  / out of code space?
-       blo     1b
-       jsr     r5,error
-               <out of code space\n\0>; .even
-1:
-       tst     forp
-       jne     forer
-       cmp     ifp,$iflev
-       jne     fier   /hanging if..fi
-       mov     $loop,(r4)+
-       rts     pc
-
-singstat:
-       clr     forp
-       mov     $iflev,ifp
-       mov     $exline,r4
-       jsr     pc,statement
-               br 1f
-       cmp     -2(r4),$_asgn
-       beq     1f
-       mov     $_print,(r4)+
-       mov     $_nline,(r4)+
-1:
-       tst     forp
-       jne     forer
-       cmp     r4,$eexline
-       blo     1f
-       jsr     r5,error
-               <out of code space\n\0>; .even
-1:
-       mov     $loop,(r4)+
-       mov     r4,exprloc
-       mov     $exline,r4
-       jmp     execute
-
-statement:
-       mov     $line,r3
-       movb    (r3)+,r0
-       jsr     pc,digit
-               br stat1
-       dec     r3
-       jsr     r5,atoi
-       cmp     r0,$' /
-       beq     1f
-       cmp     r0,$'    /tab
-       beq     1f
-       mov     $line,r3
-       movb    (r3)+,r0
-       br      stat1
-1:
-       mov     $_line,(r4)+
-       mov     r1,(r4)+
-
-stat1:
-       jsr     pc,skip
-       cmp     r0,$'\n
-       bne     .+4
-       rts     pc
-       mov     r3,-(sp)
-       jsr     pc,alpha
-               br 1f
-       jsr     pc,name
-               br 1f
-       tst     (sp)+
-       jsr     pc,skip
-       dec     r3
-       jmp     *2f(r1)
-2:
-       stlist
-       stdone
-       stdone
-       strun
-       stprint
-       stprompt   / prompt is like print except for cr
-       stif
-       stgoto
-       streturn
-       stfor
-       stnext
-       stoctl
-       stsave
-       stdump
-       stfi
-       stelse
-       stedit
-       stcomment
-.if scope    / for plotting on tektronix
-       stdisp
-       stdraw
-       steras
-.endif
-
-1:
-       mov     (sp)+,r3
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       jne     joe
-       add     $2,(sp)
-       rts     pc
-
-stsave:
-       mov     $_save,func
-       br      1f
-
-stlist:
-       mov     $_list,func
-1:
-       cmp     r0,$'\n
-       bne     1f
-       clrf    r0
-       jsr     pc,const
-       movif   $77777,r0
-       jsr     pc,const
-       br      2f
-1:
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     1f
-       mov     $_dup,(r4)+
-       br      2f
-1:
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       jne     joe
-2:
-       mov     func,(r4)+
-       rts     pc
-
-stdone:
-       cmp     r0,$'\n
-       jne     joe
-       mov     $_done,(r4)+
-       rts     pc
-
-strun:
-       cmp     r0,$'\n
-       jne     joe
-       mov     $_run,(r4)+
-       rts     pc
-
-
-stprompt:
-       clr     -(sp)
-       br      stpr2
-
-stdump:
-       cmp     r0,$'\n
-       jne     joe
-       mov     $_dump,(r4)+
-       rts     pc
-
-stprint:
-       mov     pc,-(sp)
-stpr2:
-       movb    (r3)+,r0
-       jsr     pc,skip
-1:
-       cmp     r0,$'\n
-       beq     2f
-       cmp     r0,$'"
-       beq     1f
-       dec     r3
-       jsr     pc,expr
-       mov     $_print,(r4)+
-       br      1b
-1:
-       mov     $_ascii,(r4)+
-1:
-       movb    (r3)+,(r4)
-       cmpb    (r4),$'"
-       beq     1f
-       cmpb    (r4)+,$'\n
-       bne     1b
-       jbr     joe
-1:
-       add     $2,r4
-       bic     $1,r4
-       br      stpr2
-2:
-       tst     (sp)+
-       beq     1f
-       mov     $_nline,(r4)+
-1:
-       rts     pc
-
-stif:
-       jsr     pc,expr
-       mov     $_if,(r4)+
-       mov     r4,*ifp
-       add     $2,ifp
-       tst     (r4)+
-       jsr     pc,skip
-       cmp     r0,$'\n   / if ... fi
-       beq     1f
-       jsr     pc,stat1
-               br  .+2
-stfi:
-       sub     $2,ifp
-       cmp     ifp,$iflev
-       jlo     fier
-       mov     *ifp,r1  /for jump around if
-       mov     r4,(r1)
-1:
-       rts     pc
-
-fier:
-       jsr     r5,error; <if...else...fi imbalance\n\0>; .even
-
-stelse:
-       mov     $_tra,(r4)+  /jump around else side
-       mov     r4+,-(sp) / save hole
-       tst     (r4)+
-       sub     $2,ifp
-       cmp     ifp,$iflev
-       jlo     fier
-       mov     *ifp,r1
-       mov     r4,(r1)  /fill in jump to else
-       mov     (sp)+,*ifp /save hole for fi
-       add     $2,ifp
-       rts     pc
-
-stedit:  / enter the regular editor <ed>
-       sys fork
-       br      newpr
-       mov     $lintab,r0  / zero out line table during edit
-1:
-       cmp     r0,$elintab  /done
-       beq     1f
-       mov     $0,(r0)+
-       br      1b
-1:
-       sys     unlink; tmpf
-       sys     wait
-       jmp     aftered / start over
-newpr:
-       sys     exec; ed; edarg
-       sys     exit
-ed:    </bin/ed\0> ; .even
-ednm:  <-\n>
- .even
-edarg: ednm; argname; 0
-
-stcomment:  /comment line
-       cmp     r0,$'\n
-       beq     1f
-       movb    (r3)+,r0
-       br      stcomment
-1:
-       rts     pc
-stgoto:
-       jsr     pc,expr
-       mov     $_goto,(r4)+
-       rts     pc
-
-streturn:
-       cmp     r0,$'\n
-       beq     1f
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     joe
-       br      2f
-1:
-       clrf    r0
-       jsr     pc,const
-2:
-       mov     $_return,(r4)+
-       rts     pc
-
-joe:
-       jsr     pc,serror
-
-stfor:
-       mov     r4,-(sp)
-       jsr     pc,e2
-       mov     r4,-(sp)
-       cmp     r0,$'=
-       bne     joe
-       tst     val
-       bne     joe
-       jsr     pc,expr
-       mov     forp,(r4)+      / overlay w _asgn
-       mov     r4,forp
-       cmp     (r4)+,(r4)+     / _tra ..
-       mov     (sp)+,r0
-       mov     (sp)+,r1
-1:
-       mov     (r1)+,(r4)+
-       cmp     r1,r0
-       blo     1b
-       mov     $_fori,(r4)+
-       mov     forp,r1
-       mov     $_tra,(r1)+
-       mov     r4,(r1)+
-       dec     r3
-       jsr     pc,expr
-       mov     $_lesseq,(r4)+
-       mov     $_if,(r4)+
-       mov     forp,(r4)+
-       mov     r4,forp
-       cmp     r0,$'\n
-       beq     1f
-       jsr     pc,stat1
-               br .+2
-       br      stnext
-1:
-       rts     pc
-
-forer:
-       jsr     r5,error; <for/next imbalance\n\0>; .even
-
-stnext:
-       mov     forp,r1
-       beq     forer
-       mov     -(r1),r0
-       mov     -(r0),forp
-       mov     $_ptra,(r4)+
-       mov     $_asgn,(r0)+
-       cmp     (r0)+,(r0)+
-       mov     r0,(r4)+
-       mov     r4,(r1)+
-       rts     pc
-
-stoctl:
-       jsr     pc,expr
-       mov     $_octal,(r4)+
-       rts     pc
-
-.if scope  / for plotting
-stdisp:
-       mov     $_sdisp,(r4)+
-       jsr     pc,stprint
-       mov     $_fdisp,(r4)+
-       rts     pc
-stdraw:
-       jsr     pc,expr
-       dec     r3
-       jsr     pc,expr
-       cmp     r0,$'\n
-       bne     1f
-       movf    $one,r0
-       jsr     pc,const
-       br      2f
-1:
-       dec     r3
-       jsr     pc,expr
-2:
-       mov     $_draw,(r4)+
-       rts     pc
-
-steras:
-       mov     $_erase,(r4)+
-       rts     pc
-.endif
-
-/
-/
-
-/ bas2 -- expression evaluation
-
-expr:
-       jsr     pc,e1
-       jsr     pc,rval
-       rts     pc
-
-/ assignment right to left
-e1:
-       jsr     pc,e2
-       cmp     r0,$'=
-       beq     1f
-       jsr     pc,rval
-       rts     pc
-1:
-       tst     val
-       beq     1f
-       jsr     pc,serror
-1:
-       jsr     pc,e1
-       jsr     r5,op; _asgn
-       rts     pc
-
-/ and or left to right
-e2:
-       jsr     pc,e3
-1:
-       cmp     r0,$'&
-       beq     2f
-       cmp     r0,$'|
-       beq     3f
-       rts     pc
-2:
-       jsr     pc,rval
-       jsr     pc,e3
-       jsr     r5,op; _and
-       br      1b
-3:
-       jsr     pc,rval
-       jsr     pc,e3
-       jsr     r5,op; _or
-       br      1b
-
-/ relation extended relation
-e3:
-       jsr     pc,e4
-       jsr     pc,e3a
-               rts pc
-       clr     -(sp)
-1:
-       mov     r0,-(sp)
-       jsr     pc,e4
-       jsr     pc,rval
-       mov     (sp)+,(r4)+
-       jsr     pc,e3a
-               br 1f
-       mov     $_extr,(r4)+
-       inc     (sp)
-       br      1b
-1:
-       dec     (sp)
-       blt     1f
-       mov     $_and,(r4)+
-       br      1b
-1:
-       tst     (sp)+
-       rts     pc
-
-/ relational operator
-e3a:
-       cmp     r0,$'>
-       beq     1f
-       cmp     r0,$'<
-       beq     2f
-       cmp     r0,$'=
-       beq     3f
-       rts     pc
-1:
-       mov     $_great,r0
-       cmpb    (r3),$'=
-       bne     1f
-       inc     r3
-       mov     $_greateq,r0
-       br      1f
-2:
-       cmpb    (r3),$'>
-       bne     2f
-       inc     r3
-       mov     $_noteq,r0
-       br      1f
-2:
-       mov     $_less,r0
-       cmpb    (r3),$'=
-       bne     1f
-       inc     r3
-       mov     $_lesseq,r0
-       br      1f
-3:
-       cmpb    (r3),$'=
-       beq     2f
-       rts     pc
-2:
-       inc     r3
-       mov     $_equal,r0
-1:
-       jsr     pc,rval
-       add     $2,(sp)
-       rts     pc
-
-/ add subtract
-e4:
-       jsr     pc,e5
-1:
-       cmp     r0,$'+
-       beq     2f
-       cmp     r0,$'-
-       beq     3f
-       rts     pc
-2:
-       jsr     pc,rval
-       jsr     pc,e5
-       jsr     r5,op; _add
-       br      1b
-3:
-       jsr     pc,rval
-       jsr     pc,e5
-       jsr     r5,op; _sub
-       br      1b
-
-/ multiply divide
-e5:
-       jsr     pc,e6
-1:
-       cmp     r0,$'*
-       beq     2f
-       cmp     r0,$'/
-       beq     3f
-       rts     pc
-2:
-       jsr     pc,rval
-       jsr     pc,e6
-       jsr     r5,op; _mult
-       br      1b
-3:
-       jsr     pc,rval
-       jsr     pc,e6
-       jsr     r5,op; _divid
-       br      1b
-
-/ exponential
-e6:
-       jsr     pc,e6a
-1:
-       cmp     r0,$'^
-       beq     2f
-       rts     pc
-2:
-       jsr     pc,rval
-       jsr     pc,e6a
-       jsr     r5,op; _expon
-       br      1b
-
-e6a:
-       movb    (r3)+,r0
-       jsr     pc,skip
-       cmp     r0,$'_
-       bne     1f
-       jsr     pc,e6a
-       jsr     r5,op; _neg
-       rts     pc
-1:
-       dec     r3
-       jsr     pc,e7
-       rts     pc
-/ end of unary -
-
-/ primary
-e7:
-       movb    (r3)+,r0
-       jsr     pc,skip
-       mov     $1,val
-       cmp     r0,$'(
-       bne     1f
-       jsr     pc,e1
-       cmp     r0,$')
-       bne     2f
-       movb    (r3)+,r0
-       br      e7a
-2:
-       jsr     pc,serror
-1:
-       cmp     r0,$'.
-       beq     2f
-       jsr     pc,digit
-               br 1f
-2:
-       dec     r3
-       jsr     r5,atof; nextc
-       jsr     pc,const
-       br      e7a
-1:
-       jsr     pc,alpha
-               br jim
-       jsr     pc,name
-               br 2f
-       jsr     r5,error; <reserved name\n\0>; .even
-2:
-/ try to fix illegal symbol bug:
-       cmp     r4,$eexline
-       bhis    jim
-
-       mov     $_lval,(r4)+
-       mov     r1,(r4)+
-       clr     val
-       br      e7a
-jim:
-       jsr     pc,serror
-
-e7a:
-       jsr     pc,skip
-       cmp     r0,$'(
-       bne     1f
-       jsr     pc,rval
-       jsr     r5,rlist; _funct
-       cmp     r0,$')
-       bne     jim
-       movb    (r3)+,r0
-       br      e7a
-1:
-       cmp     r0,$'[
-       bne     1f
-       tst     val
-       beq     2f
-       jsr     pc,serror
-2:
-       jsr     r5,rlist; _subscr
-       clr     val
-       cmp     r0,$']
-       bne     jim
-       movb    (r3)+,r0
-       br      e7a
-1:
-       rts     pc
-
-op:
-       jsr     pc,rval
-       mov     (r5)+,(r4)+
-       rts     r5
-
-rval:
-       tst     val
-       bne     1f
-       mov     $_rval,(r4)+
-       inc     val
-1:
-       rts     pc
-
-const:
-       mov     r0,-(sp)
-       movf    r1,-(sp)
-       tstf    r0
-       cfcc
-       bne     1f
-       mov     $_con0,(r4)+
-       br      2f
-1:
-       cmpf    $one,r0
-       cfcc
-       bne     1f
-       mov     $_con1,(r4)+
-       br      2f
-1:
-       movfi   r0,r0
-       movif   r0,r1
-       cmpf    r0,r1
-       cfcc
-       bne     1f
-       mov     $_intcon,(r4)+
-       mov     r0,(r4)+
-       br      2f
-1:
-       mov     $_const,(r4)+
-       movf    r0,(r4)+
-2:
-       movf    (sp)+,r1
-       mov     (sp)+,r0
-       rts     pc
-
-rlist:
-       clr     -(sp)
-       cmpb    (r3),$')
-       bne     1f
-       movb    (r3)+,r0
-       br      2f
-1:
-       inc     (sp)
-       jsr     pc,expr
-       cmp     r0,$',
-       beq     1b
-2:
-       mov     (r5)+,(r4)+
-       mov     (sp)+,(r4)+
-       rts     r5
-
-/
-/
-/ bas3 -- execution
-
-execute:
-       mov     $estack,r3
-       mov     r3,sstack
-       jmp     *(r4)+
-
-_if:
-       tstf    (r3)+
-       cfcc
-       beq     _tra
-       tst     (r4)+
-       jmp     *(r4)+
-
-_ptra:
-       mov     sstack,r3
-
-_tra:
-       mov     (r4)+,r4
-       jmp     *(r4)+
-
-_funct:
-       mov     r4,-(r3)
-       mov     sstack,-(r3)
-       mov     r3,sstack
-       inc     sublev
-       clr     r0
-       jsr     pc,arg
-       tstf    r0
-       cfcc
-       bge     1f
-       jmp     builtin
-
-_goto:
-       movf    (r3),r0
-1:
-       movfi   r0,-(sp)
-       jsr     pc,compile
-       mov     (sp)+,r0
-       jsr     pc,getloc
-       mov     4(r1),r4
-       jmp     *(r4)+
-
-_run:
-       jsr     pc,isymtab
-       mov     randx,r0
-       jsr     pc,srand
-       jsr     pc,compile
-       mov     $space,r4
-       jmp     *(r4)+
-
-_save:    / _save is a _list to the file named on the bas command
-       sys     creat; argname; 666
-       bes     1f
-       mov     r0,prfile
-       br      2f
-1:
-       mov     1f,r0
-       mov     $1,prfile
-       jsr     pc,print
-       br      _done
-1:     <Cannot create b.out\n\0>; .even
-
-_list:
-       mov     $1,prfile
-2:
-       movf    (r3)+,r0
-       movfi   r0,-(sp)
-/ probably vistigal??  mov     r3,0f
-       movf    (r3),r0
-       movfi   r0,lineno
-1:
-       jsr     pc,nextlin
-               br 1f
-       cmp     lineno,(sp)
-       bhi     1f
-       mov     $line,r0
-       jsr     pc,print
-       inc     lineno
-       br      1b
-1:
-       cmp     $1,prfile
-       beq     1f
-       mov     prfile,r0
-       sys     close
-       mov     $1,prfile
-1:
-       tst     (sp)+
-       jmp     *(r4)+
-
-_done:
-       sys     unlink; tmpf
-       sys     exit
-
-.if scope  / for plotting
-_sdisp:
-       mov     $2,r0
-       jsr     pc,drput
-       jsr     pc,drxy
-       mov     $1,r0
-       jsr     pc,drput
-       mov     $3,r0
-       jsr     pc,drput
-       incb    drflg
-       jmp     *(r4)+
-
-_fdisp:
-       clr     r0
-       jsr     pc,drput
-       clrb    drflg
-       jmp     *(r4)+
-
-_draw:
-       movf    (r3)+,r2
-       movf    (r3)+,r1
-       movf    (r3)+,r0
-       jsr     r5,draw
-       jmp     *(r4)+
-
-_erase:
-       mov     $1,r0
-       jsr     pc,drput
-       mov     $1,r0
-       jsr     pc,drput
-       jmp     *(r4)+
-.endif
-
-_print:
-       movf    (r3)+,r0
-       jsr     r5,ftoa; xputc
-       jmp     *(r4)+
-
-_octal:
-       movf    (r3)+,r0
-       jsr     r5,ftoo; xputc
-       jmp     *(r4)+
-
-_nline:
-       mov     $'\n,r0
-       jsr     r5,xputc
-       jmp     *(r4)+
-
-_ascii:
-       movb    (r4)+,r0
-       cmp     r0,$'"
-       beq     1f
-       jsr     r5,xputc
-       br      _ascii
-1:
-       inc     r4
-       bic     $1,r4
-       jmp     *(r4)+
-
-_line:
-       mov     sstack,r3
-       cmp     r3,$stack+20.
-       bhi     1f
-       jsr     r5,error
-               <out of space\n\0>; .even
-1:
-       mov     (r4)+,lineno
-       jmp     *(r4)+
-
-_or:
-       tstf    (r3)+
-       cfcc
-       bne     stone
-       tstf    (r3)
-       cfcc
-       bne     stone
-       br      stzero
-
-_and:
-       tstf    (r3)+
-       cfcc
-       beq     stzero
-       tstf    (r3)
-       cfcc
-       beq     stzero
-       br      stone
-
-_great:
-       jsr     pc,bool
-       bgt     stone
-       br      stzero
-
-_greateq:
-       jsr     pc,bool
-       bge     stone
-       br      stzero
-
-_less:
-       jsr     pc,bool
-       blt     stone
-       br      stzero
-
-_lesseq:
-       jsr     pc,bool
-       ble     stone
-       br      stzero
-
-_noteq:
-       jsr     pc,bool
-       bne     stone
-       br      stzero
-
-_equal:
-       jsr     pc,bool
-       beq     stone
-
-stzero:
-       clrf    r0
-       br      advanc
-
-stone:
-       movf    $one,r0
-       br      advanc
-
-_extr:
-       movf    r1,r0           / dup for _and in extended rel
-       br      subadv
-
-_asgn:
-       movf    (r3)+,r0
-       mov     (r3)+,r0
-       add     $4,r0
-       bis     $1,(r0)+
-       movf    r0,(r0)
-       br      subadv
-
-_add:
-       movf    (r3)+,r0
-       addf    (r3),r0
-       br      advanc
-
-_sub:
-       movf    (r3)+,r0
-       negf    r0
-       addf    (r3),r0
-       br      advanc
-
-_mult:
-       movf    (r3)+,r0
-       mulf    (r3),r0
-       br      advanc
-
-_divid:
-       movf    (r3)+,r1
-       movf    (r3),r0
-       divf    r1,r0
-       br      advanc
-
-_expon:
-       movf    (r3)+,fr1
-       movf    (r3),fr0
-       jsr     pc,pow
-       bec     advanc
-       jsr     r5,error
-               <Bad exponentiation\n\0>; .even
-
-_neg:  / unary -
-       negf    r0
-       jbr     advanc
-/ end of _neg
-
-_intcon:
-       movif   (r4)+,r0
-       jbr     subadv
-
-_con0:
-       clrf    r0
-       jbr     subadv
-
-_con1:
-       movf    $one,r0
-       jbr     subadv
-
-_const:
-       movf    (r4)+,r0
-
-subadv:
-       movf    r0,-(r3)
-       jmp     *(r4)+
-
-advanc:
-       movf    r0,(r3)
-       jmp     *(r4)+
-
-_rval:
-       jsr     pc,getlv
-       br      subadv
-
-_fori:
-       jsr     pc,getlv
-       addf    $one,r0
-       movf    r0,(r0)
-       br      subadv
-
-_lval:
-       mov     (r4)+,-(r3)
-       jmp     *(r4)+
-
-_dup:
-       movf    (r3),r0
-       br      subadv
-
-_return:
-       dec     sublev
-       bge     1f
-       jsr     r5,error
-               <bad return\n\0>; .even
-1:
-       movf    (r3),r0
-       mov     sstack,r3
-       mov     (r3)+,sstack
-       mov     (r3)+,r4
-       mov     (r4)+,r0
-1:
-       dec     r0
-       blt     advanc
-       add     $8,r3
-       br      1b
-
-_subscr:
-       mov     (r4),r1
-       mpy     $8.,r1
-       add     r1,r3
-       mov     r3,-(sp)
-       mov     (r3),r0
-       mov     (r4)+,-(sp)
-1:
-       dec     (sp)
-       blt     1f
-       movf    -(r3),r0
-       movfi   r0,r2
-       com     r2
-       blt     2f
-       jsr     r5,error
-               <subscript out of range\n\0>; .even
-2:
-       mov     r0,r1
-       mov     4(r0),r0
-       bic     $1,r0
-2:
-       beq     2f
-       cmp     r2,(r0)+
-       bne     3f
-       tst     -(r0)
-       br      1b
-3:
-       mov     (r0),r0
-       br      2b
-2:
-       mov     $symtab,r0
-2:
-       tst     (r0)
-       beq     2f
-       add     $14.,r0
-       br      2b
-2:
-       cmp     r0,$esymtab-28.
-       blo     2f
-       jsr     r5,error
-               <out of symbol space\n\0>; .even
-2:
-       cmp     (r1)+,(r1)+
-       mov     r0,-(sp)
-       clr     14.(r0)
-       mov     r2,(r0)+
-       mov     (r1),r2
-       bic     $1,r2
-       mov     r2,(r0)+
-       clr     (r0)+
-       mov     (sp)+,r0
-       bic     $!1,(r1)
-       bis     r0,(r1)
-       br      1b
-1:
-       tst     (sp)+
-       mov     (sp)+,r3
-       mov     r0,(r3)
-       jmp     *(r4)+
-
-bool:
-       movf    (r3)+,r1        / r1 used in extended rel
-       cmpf    (r3),r1
-       cfcc
-       rts     pc
-
-getlv:
-       mov     (r3)+,r0
-       add     $4,r0
-       bit     $1,(r0)+
-       bne     1f
-       jsr     r5,error;<used before set\n\0>; .even
-1:
-       movf    (r0),r0
-       rts     pc
-
-/
-/
-
-/ bas4 -- builtin functions
-
-builtin:
-       dec     sublev
-       mov     (r3)+,sstack
-       mov     (r3)+,r4
-       movfi   r0,r0
-       com     r0
-       asl     r0
-       cmp     r0,$2f-1f
-       bhis    2f
-       jmp     *1f(r0)
-1:
-       fnarg
-       fnexp
-       fnlog
-       fnsin
-       fncos
-       fnatan
-       fnrand
-       fnexpr
-       fnint
-       fnabs
-       fnsqr
-       fnlast
-2:
-       mov     $-1,r0
-       jsr     pc,getloc               / label not found diagnostic
-
-fnarg:
-       cmp     (r4)+,$1
-       jne     narg
-       movf    (r3),r0
-       movfi   r0,r0
-       jsr     pc,arg
-       br      fnadvanc
-
-fnexp:
-       jsr     r5,fnfn; exp
-       br      fnadvanc
-
-fnlog:
-       jsr     r5,fnfn; log
-       bec     fnadvanc
-       jsr     r5,error
-               <Bad log\n\0>; .even
-
-fnsin:
-       jsr     r5,fnfn; sin
-       bec     fnadvanc
-       jsr     r5,error
-               <Bad sine\n\0>; .even
-
-fncos:
-       jsr     r5,fnfn; cos
-       bec     fnadvanc
-       jsr     r5,error
-               <Bad cosine\n\0>; .even
-
-fnatan:
-       jsr     r5,fnfn; atan
-       bec     fnadvanc
-       jsr     r5,error
-               <Bad arctangent\n\0>; .even
-
-fnrand:
-       tst     (r4)+
-       bne     narg
-       jsr     pc,rand
-       movif   r0,r0
-       divf    $44000,r0
-       jmp     advanc
-
-fnexpr:
-       tst     (r4)+
-       bne     narg
-       mov     r3,-(sp)
-       mov     r4,-(sp)
-       jsr     pc,rdline
-       mov     exprloc,r4
-       mov     $line,r3
-       jsr     pc,expr
-       mov     $_tra,(r4)+
-       mov     (sp)+,(r4)+
-       mov     (sp)+,r3
-       mov     exprloc,r4
-       add     $8,r3
-       jmp     *(r4)+
-
-fnint:
-       cmp     (r4)+,$1
-       bne     narg
-       movf    (r3),r0
-       modf    $one,r0
-       movf    r1,r0
-       br      fnadvanc
-
-fnabs:
-       cmp     (r4)+,$1
-       bne     narg
-       movf    (r3),r0
-       cfcc
-       bge     fnadvanc
-       negf    r0
-       br      fnadvanc
-
-fnlast:
-       tst     (r4)+
-       bne     narg
-       movf    lastpr,fr0
-       jbr     advanc
-
-fnsqr:
-       jsr     r5,fnfn; sqrt
-       bec     fnadvanc
-       jsr     r5,error
-       <Bad square root arg\n\0>; .even
-fnadvanc:
-       add     $8,r3
-       jmp     advanc
-
-narg:
-       jsr     r5,error
-               <arg count\n\0>; .even
-
-arg:
-       tst     sublev
-       beq     1f
-       mov     sstack,r1
-       sub     *2(r1),r0
-       bhi     1f
-2:
-       inc     r0
-       bgt     2f
-       add     $8,r1
-       br      2b
-2:
-       movf    4(r1),r0
-       rts     pc
-1:
-       jsr     r5,error
-               <bad arg\n\0>; .even
-
-fnfn:
-       cmp     (r4)+,$1
-       bne     narg
-       movf    (r3),r0
-       jsr     pc,*(r5)+
-       rts     r5
-
-.if scope / for plotting
-draw:
-       tstf    r2
-       cfcc
-       bne     1f
-       movf    r0,drx
-       movf    r1,dry
-       rts     r5
-1:
-       movf    r0,-(sp)
-       movf    r1,-(sp)
-       mov     $3,r0
-       jsr     pc,drput
-       jsr     pc,drxy
-       movf    (sp)+,r0
-       movf    r0,dry
-       movf    (sp)+,r0
-       movf    r0,drx
-       jsr     pc,drxy
-       rts     r5
-
-drxy:
-       movf    drx,r0
-       jsr     pc,drco
-       movf    dry,r0
-
-drco:
-       tstf    r0
-       cfcc
-       bge     1f
-       clrf    r0
-1:
-       cmpf    $40200,r0               / 1.0
-       cfcc
-       bgt     1f
-       movf    $40177,r0               / 1.0-eps
-1:
-       subf    $40000,r0               / .5
-       mulf    $43200,r0               / 4096
-       movfi   r0,r0
-       mov     r0,-(sp)
-       jsr     pc,drput
-       mov     (sp)+,r0
-       swab    r0
-
-drput:
-       movb    r0,ch
-       mov     drfo,r0
-       bne     1f
-       sys     open; vt; 1
-       bec     2f
-       4
-2:
-       mov     r0,drfo
-1:
-       sys     write; ch; 1
-       rts     pc
-
-.endif
-/ bas4 -- old library routines
-atoi:
-       clr     r1
-       jsr     r5,nextc
-       clr     -(sp)
-       cmp     r0,$'-
-       bne     2f
-       inc     (sp)
-1:
-       jsr     r5,nextc
-2:
-       sub     $'0,r0
-       cmp     r0,$9
-       bhi     1f
-       mpy     $10.,r1
-       bcs     3f / >32k
-       add     r0,r1
-       bcs     3f / >32k
-       br      1b
-1:
-       add     $'0,r0
-       tst     (sp)+
-       beq     1f
-       neg     r1
-1:
-       rts     r5
-3:
-       tst     (sp)+
-       mov     $'.,r0  / faking overflow
-       br      1b
-
-ldfps = 170100^tst
-stfps = 170200^tst
-atof:
-       stfps   -(sp)
-       ldfps   $200
-       movf    fr1,-(sp)
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       clr     -(sp)
-       clrf    fr0
-       clr     r2
-       jsr     r5,*(r5)
-       cmpb    r0,$'-
-       bne     2f
-       inc     (sp)
-1:
-       jsr     r5,*(r5)
-2:
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     2f
-       jsr     pc,dig
-               br      1b
-       inc     r2
-       br      1b
-2:
-       cmpb    r0,$'.-'0
-       bne     2f
-1:
-       jsr     r5,*(r5)
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     2f
-       jsr     pc,dig
-               dec r2
-       br      1b
-2:
-       cmpb    r0,$'e-'0
-       bne     1f
-       jsr     r5,atoi
-       sub     $'0,r0
-       add     r1,r2
-1:
-       movf    $one,fr1
-       mov     r2,-(sp)
-       beq     2f
-       bgt     1f
-       neg     r2
-1:
-       cmp     r2,$38.
-       blos    1f
-       clrf    fr0
-       tst     (sp)+
-       bmi     out
-       movf    $huge,fr0
-       br      out
-1:
-       mulf    $ten,fr1
-       sob     r2,1b
-2:
-       tst     (sp)+
-       bge     1f
-       divf    fr1,fr0
-       br      2f
-1:
-       mulf    fr1,fr0
-       cfcc
-       bvc     2f
-       movf    $huge,fr0
-2:
-out:
-       tst     (sp)+
-       beq     1f
-       negf    fr0
-1:
-       add     $'0,r0
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       movf    (sp)+,fr1
-       ldfps   (sp)+
-       tst     (r5)+
-       rts     r5
-
-dig:
-       cmpf    $big,fr0
-       cfcc
-       blt     1f
-       mulf    $ten,fr0
-       movif   r0,fr1
-       addf    fr1,fr0
-       rts     pc
-1:
-       add     $2,(sp)
-       rts     pc
-
-one    = 40200
-ten    = 41040
-big    = 56200
-huge   = 77777
-
-.globl _ndigits
-.globl ecvt
-.globl fcvt
-
-ftoa:
-       movf    fr0,lastpr
-       jsr     pc,ecvt
-       mov     r0,bufptr
-       tstb    r1
-       beq     1f
-       mov     $'-,r0
-       jsr     r5,*(r5)
-1:
-       cmp     r3,$-2
-       blt     econ
-       cmp     r2,$-5
-       ble     econ
-       cmp     r2,$6
-       bgt     econ
-       jsr     pc,cout
-       tst     (r5)+
-       rts     r5
-
-econ:
-       mov     r2,-(sp)
-       mov     $1,r2
-       jsr     pc,cout
-       mov     $'e,r0
-       jsr     r5,*(r5)
-       mov     (sp)+,r0
-       dec     r0
-       jmp     itoa
-
-cout:
-       mov     bufptr,r1
-       add     _ndigits,r1
-       mov     r2,-(sp)
-       add     bufptr,r2
-1:
-       cmp     r1,r2
-       blos    1f
-       cmpb    -(r1),$'0
-       beq     1b
-       inc     r1
-1:
-       mov     (sp)+,r2
-       bge     2f
-       mov     $'.,r0
-       jsr     r5,*(r5)
-1:
-       mov     $'0,r0
-       jsr     r5,*(r5)
-       inc     r2
-       blt     1b
-       dec     r2
-2:
-       mov     r2,-(sp)
-       mov     bufptr,r2
-1:
-       cmp     r2,r1
-       bhis    1f
-       tst     (sp)
-       bne     2f
-       mov     $'.,r0
-       jsr     r5,*(r5)
-2:
-       dec     (sp)
-       movb    (r2)+,r0
-       jsr     r5,*(r5)
-       br      1b
-1:
-       tst     (sp)+
-       rts     pc
-
-.bss
-bufptr:        .=.+2
-.text
-
-ftoo:
-       stfps   -(sp)
-       ldfps   $200
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     $buf,r1
-       movf    fr0,(r1)+
-       mov     $buf,r2
-       br      2f
-1:
-       cmp     r2,r1
-       bhis    1f
-       mov     $';,r0
-       jsr     r5,*(r5)
-2:
-       mov     (r2)+,r0
-       jsr     pc,oct
-       br      1b
-1:
-       mov     $'\n,r0
-       jsr     pc,*(r5)+
-       ldfps   (sp)+
-       rts     r5
-
-oct:
-       mov     r0,x+2
-       setl
-       movif   x,fr0
-       mulf    $small,fr0
-       seti
-       mov     $6.,-(sp)
-1:
-       modf    $eight,fr0
-       movfi   fr1,r0
-       add     $'0,r0
-       jsr     r5,*(r5)
-       dec     (sp)
-       bne     1b
-       tst     (sp)+
-       rts     pc
-
-eight  = 41000
-small  = 33600
-.bss
-buf:   .=.+8
-x:     .=.+4
-.text
-
-itoa:
-       mov     r1,-(sp)
-       mov     r0,r1
-       bge     1f
-       neg     r1
-       mov     $'-,r0
-       jsr     r5,*(r5)
-1:
-       jsr     pc,1f
-       mov     (sp)+,r1
-       tst     (r5)+
-       rts     r5
-
-1:
-       clr     r0
-       dvd     $10.,r0
-       mov     r1,-(sp)
-       mov     r0,r1
-       beq     1f
-       jsr     pc,1b
-1:
-       mov     (sp)+,r0
-       add     $'0,r0
-       jsr     r5,*(r5)
-       rts     pc
-/ bas -- BASIC
-/ new command "dump" which dumps symbol table values by name
-/              R. Haight
-/
-_dump:
-       mov     r4,-(sp)
-       mov     $12.*14.+symtab-14.,r4
-1:
-       add     $14.,r4
-       tst     (r4)
-       beq     1f
-       bit     $1,4(r4)
-       beq     1b
-       jsr     pc,dmp1
-       mov     $'=,r0
-       jsr     r5,xputc
-       movf    6(r4),r0
-       jsr     r5,ftoa; xputc
-       mov     $'\n,r0
-       jsr     r5,xputc
-       br      1b
-1:
-       mov     (sp)+,r4
-       jmp     *(r4)+
-
-dmp1:
-       tst     (r4)
-       blt     1f
-       mov     (r4),nameb
-       mov     2(r4),nameb+2
-       mov     $nameb,r0
-       jsr     pc,print
-       rts     pc
-1:
-       mov     r4,-(sp)
-       mov     $symtab-14.,r4
-1:
-       add     $14.,r4
-       tst     (r4)
-       beq     1f
-       mov     4(r4),r0
-       bic     $1,r0
-2:
-       beq     1b
-       cmp     r0,(sp)
-       beq     2f
-       mov     2(r0),r0
-       br      2b
-2:
-       jsr     pc,dmp1
-       mov     $'[,r0
-       jsr     r5,xputc
-       mov     *(sp),r0
-       com     r0
-       movif   r0,r0
-       jsr     r5,ftoa; xputc
-       mov     $'],r0
-       jsr     r5,xputc
-1:
-       mov     (sp)+,r4
-       rts     pc
-/
-/
-
-/ basx -- data
-
-one = 40200
-
-.data
-
-_ndigits:10.
-tmpf:  </tmp/btma\0>
-argname: <b.out\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>
-vt:    </dev/vt0\0>
-.even
-pname: <\0\0\0\0\0\0>
-       .even
-
-resnam:
-       <list>
-       <done>
-       <q\0\0\0>
-       <run\0>
-       <prin>
-       <prom>   / prompt is like print without \n (cr)
-       <if\0\0>
-       <goto>
-       <retu>
-       <for\0>
-       <next>
-       <octa>
-       <save>
-       <dump>
-       <fi\0\0>
-       <else>
-       <edit>
-       <comm>  / comment
-.if scope / for plotting
-       <disp>
-       <draw>
-       <eras>
-.endif
-eresnam:
-
-symtnam:
-       <arg\0>
-       <exp\0>
-       <log\0>
-       <sin\0>
-       <cos\0>
-       <atn\0>
-       <rnd\0>
-       <expr>
-       <int\0>
-       <abs\0>
-       <sqr\0>
-       <last>
-esymtnam:
-
-/ indirect sys calls:
-sysseek:       sys     lseek; 0; seekx: 0; 0
-syswrit:       sys     write; wbuf: 0; wlen: 0
-sysread:       sys     read; rbuf: 0; rlen: 0
-sysopen:       sys     open; ofile: 0 ; omode: 0
-syscreat:      sys     creat; cfile: 0; cmode: 0
-.bss
-drx:   .=.+8
-dry:   .=.+8
-drfo:  .=.+2
-ch:    .=.+2
-drflg: .=.+2
-randx: .=.+2
-gsp:   .=.+2
-forp:  .=.+2
-exprloc:.=.+2
-sstack:        .=.+2
-sublev:        .=.+2
-val:   .=.+2
-splimit:       .=.+2  / statement size limit
-iflev: .=.+20.  / nested if compile stack: 10 deep
-ifp:   .=.+2    / current pointer to iflev
-line:  .=.+100.
-prfile:        .=.+2   / output from _list or _save
-tfi:   .=.+2  / input file
-lastpr:        .=.+8   / last printed number
-func:  .=.+2   / alternate functions, eg: _list or _save
-seeka: .=.+2   / seek offset 1
-lineno:        .=.+2
-nameb: .=.+4
-tfo:   .=.+2
-symtab:        .=.+2800.; esymtab: / symbol=7wds; symtab for 200
-space: .=.+8000.; espace: / code space
-exline:        .=.+1000.; eexline: / line execute space
-lintab:        .=.+1800.; elintab: / 3wds per statement = 300 stmts
-stack: .=.+800.; estack:
-
-iobuf: fi: .=.+518.  / should be acquired??
diff --git a/.ref-Research-V7/usr/src/cmd/bas/makefile b/.ref-Research-V7/usr/src/cmd/bas/makefile
deleted file mode 100644 (file)
index 4fc8b3e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-bas cp cmp:
-       @echo Sorry, the bas source will not compile
-       @echo the object because it calls for old-style
-       @echo library routines.
-       @echo It\'s here just in case you want to play.
diff --git a/.ref-Research-V7/usr/src/cmd/basename.c b/.ref-Research-V7/usr/src/cmd/basename.c
deleted file mode 100644 (file)
index 52df45f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#include       "stdio.h"
-
-main(argc, argv)
-char **argv;
-{
-       register char *p1, *p2, *p3;
-
-       if (argc < 2) {
-               putchar('\n');
-               exit(1);
-       }
-       p1 = argv[1];
-       p2 = p1;
-       while (*p1) {
-               if (*p1++ == '/')
-                       p2 = p1;
-       }
-       if (argc>2) {
-               for(p3=argv[2]; *p3; p3++) 
-                       ;
-               while(p1>p2 && p3>argv[2])
-                       if(*--p3 != *--p1)
-                               goto output;
-               *p1 = '\0';
-       }
-output:
-       puts(p2, stdout);
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/bc.y b/.ref-Research-V7/usr/src/cmd/bc.y
deleted file mode 100644 (file)
index e4dc51a..0000000
+++ /dev/null
@@ -1,597 +0,0 @@
-%{
-       int *getout();
-%}
-%right '='
-%left '+' '-'
-%left '*' '/' '%'
-%right '^'
-%left UMINUS
-
-%term LETTER DIGIT SQRT LENGTH _IF  FFF EQ
-%term _WHILE _FOR NE LE GE INCR DECR
-%term _RETURN _BREAK _DEFINE BASE OBASE SCALE
-%term EQPL EQMI EQMUL EQDIV EQREM EQEXP
-%term _AUTO DOT
-%term QSTR
-
-%{
-#include <stdio.h>
-int in;
-char cary[1000], *cp = { cary };
-char string[1000], *str = {string};
-int crs = '0';
-int rcrs = '0';  /* reset crs */
-int bindx = 0;
-int lev = 0;
-int ln;
-char *ss;
-int bstack[10] = { 0 };
-char *numb[15] = {
-  " 0", " 1", " 2", " 3", " 4", " 5",
-  " 6", " 7", " 8", " 9", " 10", " 11",
-  " 12", " 13", " 14" };
-int *pre, *post;
-%}
-%%
-start  : 
-       |  start stat tail
-               = output( $2 );
-       |  start def dargs ')' '{' dlist slist '}'
-               ={      bundle( 6,pre, $7, post ,"0",numb[lev],"Q");
-                       conout( $$, $2 );
-                       rcrs = crs;
-                       output( "" );
-                       lev = bindx = 0;
-                       }
-       ;
-
-dlist  :  tail
-       | dlist _AUTO dlets tail
-       ;
-
-stat   :  e 
-               ={ bundle(2, $1, "ps." ); }
-       | 
-               ={ bundle(1, "" ); }
-       |  QSTR
-               ={ bundle(3,"[",$1,"]P");}
-       |  LETTER '=' e
-               ={ bundle(3, $3, "s", $1 ); }
-       |  LETTER '[' e ']' '=' e
-               ={ bundle(4, $6, $3, ":", geta($1)); }
-       |  LETTER EQOP e
-               ={ bundle(6, "l", $1, $3, $2, "s", $1 ); }
-       |  LETTER '[' e ']' EQOP e
-               ={ bundle(8,$3, ";", geta($1), $6, $5, $3, ":", geta($1));}
-       |  _BREAK
-               ={ bundle(2, numb[lev-bstack[bindx-1]], "Q" ); }
-       |  _RETURN '(' e ')'
-               = bundle(4, $3, post, numb[lev], "Q" );
-       |  _RETURN '(' ')'
-               = bundle(4, "0", post, numb[lev], "Q" );
-       | _RETURN
-               = bundle(4,"0",post,numb[lev],"Q");
-       | SCALE '=' e
-               = bundle(2, $3, "k");
-       | SCALE EQOP e
-               = bundle(4,"K",$3,$2,"k");
-       | BASE '=' e
-               = bundle(2,$3, "i");
-       | BASE EQOP e
-               = bundle(4,"I",$3,$2,"i");
-       | OBASE '=' e
-               = bundle(2,$3,"o");
-       | OBASE EQOP e
-               = bundle(4,"O",$3,$2,"o");
-       |  '{' slist '}'
-               ={ $$ = $2; }
-       |  FFF
-               ={ bundle(1,"fY"); }
-       |  error
-               ={ bundle(1,"c"); }
-       |  _IF CRS BLEV '(' re ')' stat
-               ={      conout( $7, $2 );
-                       bundle(3, $5, $2, " " );
-                       }
-       |  _WHILE CRS '(' re ')' stat BLEV
-               ={      bundle(3, $6, $4, $2 );
-                       conout( $$, $2 );
-                       bundle(3, $4, $2, " " );
-                       }
-       |  fprefix CRS re ';' e ')' stat BLEV
-               ={      bundle(5, $7, $5, "s.", $3, $2 );
-                       conout( $$, $2 );
-                       bundle(5, $1, "s.", $3, $2, " " );
-                       }
-       |  '~' LETTER '=' e
-               ={      bundle(3,$4,"S",$2); }
-       ;
-
-EQOP   :  EQPL
-               ={ $$ = "+"; }
-       |  EQMI
-               ={ $$ = "-"; }
-       |  EQMUL
-               ={ $$ = "*"; }
-       |  EQDIV
-               ={ $$ = "/"; }
-       |  EQREM
-               ={ $$ = "%%"; }
-       |  EQEXP
-               ={ $$ = "^"; }
-       ;
-
-fprefix        :  _FOR '(' e ';'
-               ={ $$ = $3; }
-       ;
-
-BLEV   :
-               ={ --bindx; }
-       ;
-
-slist  :  stat
-       |  slist tail stat
-               ={ bundle(2, $1, $3 ); }
-       ;
-
-tail   :  '\n'
-               ={ln++;}
-       |  ';'
-       ;
-
-re     :  e EQ e
-               = bundle(3, $1, $3, "=" );
-       |  e '<' e
-               = bundle(3, $1, $3, ">" );
-       |  e '>' e
-               = bundle(3, $1, $3, "<" );
-       |  e NE e
-               = bundle(3, $1, $3, "!=" );
-       |  e GE e
-               = bundle(3, $1, $3, "!>" );
-       |  e LE e
-               = bundle(3, $1, $3, "!<" );
-       |  e
-               = bundle(2, $1, " 0!=" );
-       ;
-
-e      :  e '+' e
-               = bundle(3, $1, $3, "+" );
-       |  e '-' e
-               = bundle(3, $1, $3, "-" );
-       | '-' e         %prec UMINUS
-               = bundle(3, " 0", $2, "-" );
-       |  e '*' e
-               = bundle(3, $1, $3, "*" );
-       |  e '/' e
-               = bundle(3, $1, $3, "/" );
-       |  e '%' e
-               = bundle(3, $1, $3, "%%" );
-       |  e '^' e
-               = bundle(3, $1, $3, "^" );
-       |  LETTER '[' e ']'
-               ={ bundle(3,$3, ";", geta($1)); }
-       |  LETTER INCR
-               = bundle(4, "l", $1, "d1+s", $1 );
-       |  INCR LETTER
-               = bundle(4, "l", $2, "1+ds", $2 );
-       |  DECR LETTER
-               = bundle(4, "l", $2, "1-ds", $2 );
-       |  LETTER DECR
-               = bundle(4, "l", $1, "d1-s", $1 );
-       | LETTER '[' e ']' INCR
-               = bundle(7,$3,";",geta($1),"d1+",$3,":",geta($1));
-       | INCR LETTER '[' e ']'
-               = bundle(7,$4,";",geta($2),"1+d",$4,":",geta($2));
-       | LETTER '[' e ']' DECR
-               = bundle(7,$3,";",geta($1),"d1-",$3,":",geta($1));
-       | DECR LETTER '[' e ']'
-               = bundle(7,$4,";",geta($2),"1-d",$4,":",geta($2));
-       | SCALE INCR
-               = bundle(1,"Kd1+k");
-       | INCR SCALE
-               = bundle(1,"K1+dk");
-       | SCALE DECR
-               = bundle(1,"Kd1-k");
-       | DECR SCALE
-               = bundle(1,"K1-dk");
-       | BASE INCR
-               = bundle(1,"Id1+i");
-       | INCR BASE
-               = bundle(1,"I1+di");
-       | BASE DECR
-               = bundle(1,"Id1-i");
-       | DECR BASE
-               = bundle(1,"I1-di");
-       | OBASE INCR
-               = bundle(1,"Od1+o");
-       | INCR OBASE
-               = bundle(1,"O1+do");
-       | OBASE DECR
-               = bundle(1,"Od1-o");
-       | DECR OBASE
-               = bundle(1,"O1-do");
-       |  LETTER '(' cargs ')'
-               = bundle(4, $3, "l", getf($1), "x" );
-       |  LETTER '(' ')'
-               = bundle(3, "l", getf($1), "x" );
-       |  cons
-               ={ bundle(2, " ", $1 ); }
-       |  DOT cons
-               ={ bundle(2, " .", $2 ); }
-       |  cons DOT cons
-               ={ bundle(4, " ", $1, ".", $3 ); }
-       |  cons DOT
-               ={ bundle(3, " ", $1, "." ); }
-       |  DOT
-               ={ $$ = "l."; }
-       |  LETTER
-               = { bundle(2, "l", $1 ); }
-       |  LETTER '=' e
-               ={ bundle(3, $3, "ds", $1 ); }
-       |  LETTER EQOP e        %prec '='
-               ={ bundle(6, "l", $1, $3, $2, "ds", $1 ); }
-       | LETTER '[' e ']' '=' e
-               = { bundle(5,$6,"d",$3,":",geta($1)); }
-       | LETTER '[' e ']' EQOP e
-               = { bundle(9,$3,";",geta($1),$6,$5,"d",$3,":",geta($1)); }
-       | LENGTH '(' e ')'
-               = bundle(2,$3,"Z");
-       | SCALE '(' e ')'
-               = bundle(2,$3,"X");     /* must be before '(' e ')' */
-       |  '(' e ')'
-               = { $$ = $2; }
-       |  '?'
-               ={ bundle(1, "?" ); }
-       |  SQRT '(' e ')'
-               ={ bundle(2, $3, "v" ); }
-       | '~' LETTER
-               ={ bundle(2,"L",$2); }
-       | SCALE '=' e
-               = bundle(2,$3,"dk");
-       | SCALE EQOP e          %prec '='
-               = bundle(4,"K",$3,$2,"dk");
-       | BASE '=' e
-               = bundle(2,$3,"di");
-       | BASE EQOP e           %prec '='
-               = bundle(4,"I",$3,$2,"di");
-       | OBASE '=' e
-               = bundle(2,$3,"do");
-       | OBASE EQOP e          %prec '='
-               = bundle(4,"O",$3,$2,"do");
-       | SCALE
-               = bundle(1,"K");
-       | BASE
-               = bundle(1,"I");
-       | OBASE
-               = bundle(1,"O");
-       ;
-
-cargs  :  eora
-       |  cargs ',' eora
-               = bundle(2, $1, $3 );
-       ;
-eora:    e
-       | LETTER '[' ']'
-               =bundle(2,"l",geta($1));
-       ;
-
-cons   :  constant
-               ={ *cp++ = '\0'; }
-
-constant:
-         '_'
-               ={ $$ = cp; *cp++ = '_'; }
-       |  DIGIT
-               ={ $$ = cp; *cp++ = $1; }
-       |  constant DIGIT
-               ={ *cp++ = $2; }
-       ;
-
-CRS    :
-               ={ $$ = cp; *cp++ = crs++; *cp++ = '\0';
-                       if(crs == '[')crs=+3;
-                       if(crs == 'a')crs='{';
-                       if(crs >= 0241){yyerror("program too big");
-                               getout();
-                       }
-                       bstack[bindx++] = lev++; }
-       ;
-
-def    :  _DEFINE LETTER '('
-               ={      $$ = getf($2);
-                       pre = "";
-                       post = "";
-                       lev = 1;
-                       bstack[bindx=0] = 0;
-                       }
-       ;
-
-dargs  :
-       |  lora
-               ={ pp( $1 ); }
-       |  dargs ',' lora
-               ={ pp( $3 ); }
-       ;
-
-dlets  :  lora
-               ={ tp($1); }
-       |  dlets ',' lora
-               ={ tp($3); }
-       ;
-lora   :  LETTER
-       |  LETTER '[' ']'
-               ={ $$ = geta($1); }
-       ;
-
-%%
-# define error 256
-
-int peekc = -1;
-int sargc;
-int ifile;
-char **sargv;
-
-char funtab[52] = {
-       01,0,02,0,03,0,04,0,05,0,06,0,07,0,010,0,011,0,012,0,013,0,014,0,015,0,016,0,017,0,
-       020,0,021,0,022,0,023,0,024,0,025,0,026,0,027,0,030,0,031,0,032,0 };
-char atab[52] = {
-       0241,0,0242,0,0243,0,0244,0,0245,0,0246,0,0247,0,0250,0,0251,0,0252,0,0253,0,
-       0254,0,0255,0,0256,0,0257,0,0260,0,0261,0,0262,0,0263,0,0264,0,0265,0,0266,0,
-       0267,0,0270,0,0271,0,0272,0};
-char *letr[26] = {
-  "a","b","c","d","e","f","g","h","i","j",
-  "k","l","m","n","o","p","q","r","s","t",
-  "u","v","w","x","y","z" } ;
-char *dot = { "." };
-yylex(){
-       int c, ch;
-restart:
-       c = getch();
-       peekc = -1;
-       while( c == ' ' || c == '\t' ) c = getch();
-       if(c == '\\'){
-               getch();
-               goto restart;
-       }
-       if( c<= 'z' && c >= 'a' ) {
-               /* look ahead to look for reserved words */
-               peekc = getch();
-               if( peekc >= 'a' && peekc <= 'z' ){ /* must be reserved word */
-                       if( c=='i' && peekc=='f' ){ c=_IF; goto skip; }
-                       if( c=='w' && peekc=='h' ){ c=_WHILE; goto skip; }
-                       if( c=='f' && peekc=='o' ){ c=_FOR; goto skip; }
-                       if( c=='s' && peekc=='q' ){ c=SQRT; goto skip; }
-                       if( c=='r' && peekc=='e' ){ c=_RETURN; goto skip; }
-                       if( c=='b' && peekc=='r' ){ c=_BREAK; goto skip; }
-                       if( c=='d' && peekc=='e' ){ c=_DEFINE; goto skip; }
-                       if( c=='s' && peekc=='c' ){ c= SCALE; goto skip; }
-                       if( c=='b' && peekc=='a' ){ c=BASE; goto skip; }
-                       if( c=='i' && peekc == 'b'){ c=BASE; goto skip; }
-                       if( c=='o' && peekc=='b' ){ c=OBASE; goto skip; }
-                       if( c=='d' && peekc=='i' ){ c=FFF; goto skip; }
-                       if( c=='a' && peekc=='u' ){ c=_AUTO; goto skip; }
-                       if( c == 'l' && peekc=='e'){ c=LENGTH; goto skip; }
-                       if( c == 'q' && peekc == 'u'){getout();}
-                       /* could not be found */
-                       return( error );
-               skip:   /* skip over rest of word */
-                       peekc = -1;
-                       while( (ch = getch()) >= 'a' && ch <= 'z' );
-                       peekc = ch;
-                       return( c );
-               }
-
-               /* usual case; just one single letter */
-
-               yylval = letr[c-'a'];
-               return( LETTER );
-       }
-       if( c>= '0' && c <= '9' || c>= 'A' && c<= 'F' ){
-               yylval = c;
-               return( DIGIT );
-       }
-       switch( c ){
-       case '.':       return( DOT );
-       case '=':
-               switch( peekc = getch() ){
-               case '=': c=EQ; goto gotit;
-               case '+': c=EQPL; goto gotit;
-               case '-': c=EQMI; goto gotit;
-               case '*': c=EQMUL; goto gotit;
-               case '/': c=EQDIV; goto gotit;
-               case '%': c=EQREM; goto gotit;
-               case '^': c=EQEXP; goto gotit;
-               default:   return( '=' );
-                         gotit:     peekc = -1; return(c);
-                 }
-       case '+':       return( cpeek( '+', INCR, '+' ) );
-       case '-':       return( cpeek( '-', DECR, '-' ) );
-       case '<':       return( cpeek( '=', LE, '<' ) );
-       case '>':       return( cpeek( '=', GE, '>' ) );
-       case '!':       return( cpeek( '=', NE, '!' ) );
-       case '/':
-               if((peekc = getch()) == '*'){
-                       peekc = -1;
-                       while((getch() != '*') || ((peekc = getch()) != '/'));
-                       peekc = -1;
-                       goto restart;
-               }
-               else return(c);
-       case '"':       
-                yylval = str;
-                while((c=getch()) != '"'){*str++ = c;
-                       if(str >= &string[999]){yyerror("string space exceeded");
-                       getout();
-               }
-       }
-        *str++ = '\0';
-       return(QSTR);
-       default:         return( c );
-       }
-}
-
-cpeek( c, yes, no ){
-       if( (peekc=getch()) != c ) return( no );
-       else {
-               peekc = -1;
-               return( yes );
-       }
-}
-
-getch(){
-       int ch;
-loop:
-       ch = (peekc < 0) ? getc(in) : peekc;
-       peekc = -1;
-       if(ch != EOF)return(ch);
-       if(++ifile > sargc){
-               if(ifile >= sargc+2)getout();
-               in = stdin;
-               ln = 0;
-               goto loop;
-       }
-       fclose(in);
-       if((in = fopen(sargv[ifile],"r")) != NULL){
-               ln = 0;
-               ss = sargv[ifile];
-               goto loop;
-       }
-       yyerror("cannot open input file");
-}
-# define b_sp_max 3000
-int b_space [ b_sp_max ];
-int * b_sp_nxt = { b_space };
-
-int    bdebug = 0;
-bundle(a){
-       int i, *p, *q;
-
-       p = &a;
-       i = *p++;
-       q = b_sp_nxt;
-       if( bdebug ) printf("bundle %d elements at %o\n",i,  q );
-       while(i-- > 0){
-               if( b_sp_nxt >= & b_space[b_sp_max] ) yyerror( "bundling space exceeded" );
-               * b_sp_nxt++ = *p++;
-       }
-       * b_sp_nxt++ = 0;
-       yyval = q;
-       return( q );
-}
-
-routput(p) int *p; {
-       if( bdebug ) printf("routput(%o)\n", p );
-       if( p >= &b_space[0] && p < &b_space[b_sp_max]){
-               /* part of a bundle */
-               while( *p != 0 ) routput( *p++ );
-       }
-       else printf( p );        /* character string */
-}
-
-output( p ) int *p; {
-       routput( p );
-       b_sp_nxt = & b_space[0];
-       printf( "\n" );
-       fflush(stdout);
-       cp = cary;
-       crs = rcrs;
-}
-
-conout( p, s ) int *p; char *s; {
-       printf("[");
-       routput( p );
-       printf("]s%s\n", s );
-       fflush(stdout);
-       lev--;
-}
-
-yyerror( s ) char *s; {
-       if(ifile > sargc)ss="teletype";
-       printf("c[%s on line %d, %s]pc\n", s ,ln+1,ss);
-       fflush(stdout);
-       cp = cary;
-       crs = rcrs;
-       bindx = 0;
-       lev = 0;
-       b_sp_nxt = &b_space[0];
-}
-
-pp( s ) char *s; {
-       /* puts the relevant stuff on pre and post for the letter s */
-
-       bundle(3, "S", s, pre );
-       pre = yyval;
-       bundle(4, post, "L", s, "s." );
-       post = yyval;
-}
-
-tp( s ) char *s; { /* same as pp, but for temps */
-       bundle(3, "0S", s, pre );
-       pre = yyval;
-       bundle(4, post, "L", s, "s." );
-       post = yyval;
-}
-
-yyinit(argc,argv) int argc; char *argv[];{
-       signal( 2, (int(*)())1 );       /* ignore all interrupts */
-       sargv=argv;
-       sargc= -- argc;
-       if(sargc == 0)in=stdin;
-       else if((in = fopen(sargv[1],"r")) == NULL)
-               yyerror("cannot open input file");
-       ifile = 1;
-       ln = 0;
-       ss = sargv[1];
-}
-int *getout(){
-       printf("q");
-       fflush(stdout);
-       exit();
-}
-
-int *
-getf(p) char *p;{
-       return(&funtab[2*(*p -0141)]);
-}
-int *
-geta(p) char *p;{
-       return(&atab[2*(*p - 0141)]);
-}
-
-main(argc, argv)
-char **argv;
-{
-       int p[2];
-
-
-       if (argc > 1 && *argv[1] == '-') {
-               if((argv[1][1] == 'd')||(argv[1][1] == 'c')){
-                       yyinit(--argc, ++argv);
-                       yyparse();
-                       exit();
-               }
-               if(argv[1][1] != 'l'){
-                       printf("unrecognizable argument\n");
-                       fflush(stdout);
-                       exit();
-               }
-               argv[1] = "/usr/lib/lib.b";
-       }
-       pipe(p);
-       if (fork()==0) {
-               close(1);
-               dup(p[1]);
-               close(p[0]);
-               close(p[1]);
-               yyinit(argc, argv);
-               yyparse();
-               exit();
-       }
-       close(0);
-       dup(p[0]);
-       close(p[0]);
-       close(p[1]);
-       execl("/bin/dc", "dc", "-", 0);
-       execl("/usr/bin/dc", "dc", "-", 0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c0.h b/.ref-Research-V7/usr/src/cmd/c/c0.h
deleted file mode 100644 (file)
index 4aced95..0000000
+++ /dev/null
@@ -1,458 +0,0 @@
-#
-/*
-*      C compiler-- first pass header
-*/
-
-#include <stdio.h>
-
-/*
- * parameters
- */
-
-#define        LTYPE   long    /* change to int if no long consts */
-#define        MAXINT  077777  /* Largest positive short integer */
-#define        MAXUINT 0177777 /* largest unsigned integer */
-#define        NCPS    8       /* # chars per symbol */
-#define        HSHSIZ  400     /* # entries in hash table for names */
-#define        CMSIZ   40      /* size of expression stack */
-#define        SSIZE   20      /* size of other expression stack */
-#define        SWSIZ   230     /* size of switch table */
-#define        NMEMS   128     /* Number of members in a structure */
-#define        NBPW    16      /* bits per word, object machine */
-#define        NBPC    8       /* bits per character, object machine */
-#define        NCPW    2       /* chars per word, object machine */
-#define        LNCPW   2       /* chars per word, compiler's machine */
-#define        STAUTO  (-6)    /* offset of first auto variable */
-#define        STARG   4       /* offset of first argument */
-
-
-/*
- * # bytes in primitive types
- */
-#define        SZCHAR  1
-#define        SZINT   2
-#define        SZPTR   2
-#define        SZFLOAT 4
-#define        SZLONG  4
-#define        SZDOUB  8
-
-/*
- * format of a structure description
- */
-struct str {
-       int     ssize;                  /* structure size */
-       struct hshtab   **memlist;      /* member list */
-};
-
-/*
- * For fields, strp points here instead.
- */
-struct field {
-       int     flen;           /* field width in bits */
-       int     bitoffs;        /* shift count */
-};
-
-/*
- * Structure of tree nodes for operators
- */
-struct tnode {
-       int     op;             /* operator */
-       int     type;           /* data type */
-       int     *subsp;         /* subscript list (for arrays) */
-       struct  str *strp;      /* structure description for structs */
-       struct  tnode *tr1;     /* left operand */
-       struct  tnode *tr2;     /* right operand */
-};
-
-/*
- * Tree node for constants
- */
-struct cnode {
-       int     op;
-       int     type;
-       int     *subsp;
-       struct  str *strp;
-       int     value;
-};
-
-/*
- * Tree node for long constants
- */
-struct lnode {
-       int     op;
-       int     type;
-       int     *subsp;
-       struct  str *strp;
-       LTYPE   lvalue;
-};
-
-/*
- * tree node for floating
- * constants
- */
-struct fnode {
-       int     op;
-       int     type;
-       int     *subsp;
-       struct  str *strp;
-       char    *cstr;
-};
-
-/*
- * Structure of namelist
- */
-/*
- * Pushed-down entry for block structure
- */
-struct phshtab {
-       char    hclass;
-       char    hflag;
-       int     htype;
-       int     *hsubsp;
-       struct  str *hstrp;
-       int     hoffset;
-       struct  phshtab *hpdown;
-       char    hblklev;
-};
-
-/*
- * Top-level namelist
- */
-struct hshtab {
-       char    hclass;         /* storage class */
-       char    hflag;          /* various flags */
-       int     htype;          /* type */
-       int     *hsubsp;        /* subscript list */
-       struct  str *hstrp;     /* structure description */
-       int     hoffset;        /* post-allocation location */
-       struct  phshtab *hpdown;        /* Pushed-down name in outer block */
-       char    hblklev;        /* Block level of definition */
-       char    name[NCPS];     /* ASCII name */
-};
-
-/*
- * Place used to keep dimensions
- * during declarations
- */
-struct tdim {
-       int     rank;
-       int     dimens[5];
-};
-
-/*
- * Table for recording switches.
- */
-struct swtab {
-       int     swlab;
-       int     swval;
-};
-
-char   cvtab[4][4];
-char   filename[64];
-int    opdope[];
-char   ctab[];
-char   symbuf[NCPS+2];
-int    hshused;
-struct hshtab  hshtab[HSHSIZ];
-struct tnode **cp;
-int    isn;
-struct swtab   swtab[SWSIZ];
-struct swtab   *swp;
-int    contlab;
-int    brklab;
-int    retlab;
-int    deflab;
-unsigned autolen;              /* make these int if necessary */
-unsigned maxauto;              /* ... will only cause trouble rarely */
-int    peeksym;
-int    peekc;
-int    eof;
-int    line;
-char   *funcbase;
-char   *curbase;
-char   *coremax;
-char   *maxdecl;
-struct hshtab  *defsym;
-struct hshtab  *funcsym;
-int    proflg;
-struct hshtab  *csym;
-int    cval;
-LTYPE  lcval;
-int    nchstr;
-int    nerror;
-struct hshtab  **paraml;
-struct hshtab  **parame;
-int    strflg;
-int    mosflg;
-int    initflg;
-int    inhdr;
-char   sbuf[BUFSIZ];
-FILE   *sbufp;
-int    regvar;
-int    bitoffs;
-struct tnode   funcblk;
-char   cvntab[];
-char   numbuf[64];
-struct hshtab **memlist;
-int    nmems;
-struct hshtab  structhole;
-int    blklev;
-int    mossym;
-
-/*
-  operators
-*/
-#define        EOFC    0
-#define        NULLOP  218
-#define        SEMI    1
-#define        LBRACE  2
-#define        RBRACE  3
-#define        LBRACK  4
-#define        RBRACK  5
-#define        LPARN   6
-#define        RPARN   7
-#define        COLON   8
-#define        COMMA   9
-#define        FSEL    10
-#define        CAST    11
-#define        ETYPE   12
-
-#define        KEYW    19
-#define        NAME    20
-#define        CON     21
-#define        STRING  22
-#define        FCON    23
-#define        SFCON   24
-#define        LCON    25
-#define        SLCON   26
-
-#define        SIZEOF  91
-#define        INCBEF  30
-#define        DECBEF  31
-#define        INCAFT  32
-#define        DECAFT  33
-#define        EXCLA   34
-#define        AMPER   35
-#define        STAR    36
-#define        NEG     37
-#define        COMPL   38
-
-#define        DOT     39
-#define        PLUS    40
-#define        MINUS   41
-#define        TIMES   42
-#define        DIVIDE  43
-#define        MOD     44
-#define        RSHIFT  45
-#define        LSHIFT  46
-#define        AND     47
-#define        OR      48
-#define        EXOR    49
-#define        ARROW   50
-#define        ITOF    51
-#define        FTOI    52
-#define        LOGAND  53
-#define        LOGOR   54
-#define        FTOL    56
-#define        LTOF    57
-#define        ITOL    58
-#define        LTOI    59
-#define        ITOP    13
-#define        PTOI    14
-#define        LTOP    15
-
-#define        EQUAL   60
-#define        NEQUAL  61
-#define        LESSEQ  62
-#define        LESS    63
-#define        GREATEQ 64
-#define        GREAT   65
-#define        LESSEQP 66
-#define        LESSP   67
-#define        GREATQP 68
-#define        GREATP  69
-
-#define        ASPLUS  70
-#define        ASMINUS 71
-#define        ASTIMES 72
-#define        ASDIV   73
-#define        ASMOD   74
-#define        ASRSH   75
-#define        ASLSH   76
-#define        ASSAND  77
-#define        ASOR    78
-#define        ASXOR   79
-#define        ASSIGN  80
-
-#define        QUEST   90
-#define        MAX     93
-#define        MAXP    94
-#define        MIN     95
-#define        MINP    96
-#define        SEQNC   97
-#define        CALL    100
-#define        MCALL   101
-#define        JUMP    102
-#define        CBRANCH 103
-#define        INIT    104
-#define        SETREG  105
-#define        RFORCE  110
-#define        BRANCH  111
-#define        LABEL   112
-#define        NLABEL  113
-#define        RLABEL  114
-#define        STRASG  115
-#define        ITOC    109
-#define        SEOF    200     /* stack EOF marker in expr compilation */
-
-/*
-  types
-*/
-#define        INT     0
-#define        CHAR    1
-#define        FLOAT   2
-#define        DOUBLE  3
-#define        STRUCT  4
-#define        LONG    6
-#define        UNSIGN  7
-#define        UNION   8               /* adjusted later to struct */
-
-#define        ALIGN   01
-#define        TYPE    07
-#define        BIGTYPE 060000
-#define        TYLEN   2
-#define        XTYPE   (03<<3)
-#define        PTR     010
-#define        FUNC    020
-#define        ARRAY   030
-
-/*
-  storage classes
-*/
-#define        KEYWC   1
-#define        DEFXTRN 20
-#define        TYPEDEF 9
-#define        MOS     10
-#define        AUTO    11
-#define        EXTERN  12
-#define        STATIC  13
-#define        REG     14
-#define        STRTAG  15
-#define ARG    16
-#define        ARG1    17
-#define        AREG    18
-#define        MOU     21
-#define        ENUMTAG 22
-#define        ENUMCON 24
-
-/*
-  keywords
-*/
-#define        GOTO    20
-#define        RETURN  21
-#define        IF      22
-#define        WHILE   23
-#define        ELSE    24
-#define        SWITCH  25
-#define        CASE    26
-#define        BREAK   27
-#define        CONTIN  28
-#define        DO      29
-#define        DEFAULT 30
-#define        FOR     31
-#define        ENUM    32
-
-/*
-  characters
-*/
-#define        BSLASH  117
-#define        SHARP   118
-#define        INSERT  119
-#define        PERIOD  120
-#define        SQUOTE  121
-#define        DQUOTE  122
-#define        LETTER  123
-#define        DIGIT   124
-#define        NEWLN   125
-#define        SPACE   126
-#define        UNKN    127
-
-/*
- * Special operators in intermediate code
- */
-#define        BDATA   200
-#define        WDATA   201
-#define        PROG    202
-#define        DATA    203
-#define        BSS     204
-#define        CSPACE  205
-#define        SSPACE  206
-#define        SYMDEF  207
-#define        SAVE    208
-#define        RETRN   209
-#define        EVEN    210
-#define        PROFIL  212
-#define        SWIT    213
-#define        EXPR    214
-#define        SNAME   215
-#define        RNAME   216
-#define        ANAME   217
-#define        SETSTK  219
-#define        SINIT   220
-
-/*
-  Flag bits
-*/
-
-#define        BINARY  01
-#define        LVALUE  02
-#define        RELAT   04
-#define        ASSGOP  010
-#define        LWORD   020
-#define        RWORD   040
-#define        COMMUTE 0100
-#define        RASSOC  0200
-#define        LEAF    0400
-
-/*
- * Conversion codes
- */
-#define        ITF     1
-#define        ITL     2
-#define        LTF     3
-#define        ITP     4
-#define        PTI     5
-#define        FTI     6
-#define        LTI     7
-#define        FTL     8
-#define        LTP     9
-#define        ITC     10
-#define        XX      15
-
-/*
- * symbol table flags
- */
-
-#define        FMOS    01
-#define        FKEYW   04
-#define        FFIELD  020
-#define        FINIT   040
-#define        FLABL   0100
-
-/*
- * functions
- */
-char   *sbrk();
-struct tnode *tree();
-char   *copnum();
-struct tnode *convert();
-struct tnode *chkfun();
-struct tnode *disarray();
-struct tnode *block();
-struct cnode *cblock();
-struct fnode *fblock();
-char   *gblock();
-struct tnode *pexpr();
-struct str *strdec();
-struct hshtab *xprtype();
-struct tnode *nblock();
diff --git a/.ref-Research-V7/usr/src/cmd/c/c00.c b/.ref-Research-V7/usr/src/cmd/c/c00.c
deleted file mode 100644 (file)
index a5747e1..0000000
+++ /dev/null
@@ -1,884 +0,0 @@
-#
-/* C compiler
- *
- *
- *
- * Called from cc:
- *   c0 source temp1 temp2 [ profileflag ]
- * temp1 gets most of the intermediate code;
- * strings are put on temp2, which c1 reads after temp1.
- */
-
-#include "c0.h"
-
-int    isn     1;
-int    peeksym -1;
-int    line    1;
-struct tnode   funcblk { NAME, 0, NULL, NULL, NULL, NULL };
-
-struct kwtab {
-       char    *kwname;
-       int     kwval;
-} kwtab[]
-{
-       "int",          INT,
-       "char",         CHAR,
-       "float",        FLOAT,
-       "double",       DOUBLE,
-       "struct",       STRUCT,
-       "long",         LONG,
-       "unsigned",     UNSIGN,
-       "union",        UNION,
-       "short",        INT,
-       "auto",         AUTO,
-       "extern",       EXTERN,
-       "static",       STATIC,
-       "register",     REG,
-       "goto",         GOTO,
-       "return",       RETURN,
-       "if",           IF,
-       "while",        WHILE,
-       "else",         ELSE,
-       "switch",       SWITCH,
-       "case",         CASE,
-       "break",        BREAK,
-       "continue",     CONTIN,
-       "do",           DO,
-       "default",      DEFAULT,
-       "for",          FOR,
-       "sizeof",       SIZEOF,
-       "typedef",      TYPEDEF,
-       "enum",         ENUM,
-       0,              0,
-};
-
-main(argc, argv)
-char *argv[];
-{
-       register char *sp;
-       register i;
-       register struct kwtab *ip;
-
-       if(argc<4) {
-               error("Arg count");
-               exit(1);
-       }
-       if (freopen(argv[1], "r", stdin)==NULL) {
-               error("Can't find %s", argv[1]);
-               exit(1);
-       }
-       if (freopen(argv[2], "w", stdout)==NULL || (sbufp=fopen(argv[3],"w"))==NULL) {
-               error("Can't create temp");
-               exit(1);
-       }
-       setbuf(sbufp, sbuf);
-       if (argc>4)
-               proflg++;
-       /*
-        * The hash table locations of the keywords
-        * are marked; if an identifier hashes to one of
-        * these locations, it is looked up in in the keyword
-        * table first.
-        */
-       for (ip=kwtab; (sp = ip->kwname); ip++) {
-               i = 0;
-               while (*sp)
-                       i =+ *sp++;
-               hshtab[i%HSHSIZ].hflag = FKEYW;
-       }
-       coremax = funcbase = curbase = sbrk(0);
-       while(!eof)
-               extdef();
-       outcode("B", EOFC);
-       strflg++;
-       outcode("B", EOFC);
-       exit(nerror!=0);
-}
-
-/*
- * Look up the identifier in symbuf in the symbol table.
- * If it hashes to the same spot as a keyword, try the keyword table
- * first.  An initial "." is ignored in the hash.
- * Return is a ptr to the symbol table entry.
- */
-lookup()
-{
-       int ihash;
-       register struct hshtab *rp;
-       register char *sp, *np;
-
-       ihash = 0;
-       sp = symbuf;
-       while (sp<symbuf+NCPS)
-               ihash =+ *sp++&0177;
-       rp = &hshtab[ihash%HSHSIZ];
-       if (rp->hflag&FKEYW)
-               if (findkw())
-                       return(KEYW);
-       while (*(np = rp->name)) {
-               for (sp=symbuf; sp<symbuf+NCPS;)
-                       if (*np++ != *sp++)
-                               goto no;
-               if (mossym != (rp->hflag&FMOS))
-                       goto no;
-               csym = rp;
-               return(NAME);
-       no:
-               if (++rp >= &hshtab[HSHSIZ])
-                       rp = hshtab;
-       }
-       if(++hshused >= HSHSIZ) {
-               error("Symbol table overflow");
-               exit(1);
-       }
-       rp->hclass = 0;
-       rp->htype = 0;
-       rp->hoffset = 0;
-       rp->subsp = NULL;
-       rp->strp = NULL;
-       rp->hpdown = NULL;
-       rp->hblklev = blklev;
-       rp->hflag =| mossym;
-       sp = symbuf;
-       for (np=rp->name; sp<symbuf+NCPS;)
-               *np++ = *sp++;
-       csym = rp;
-       return(NAME);
-}
-
-/*
- * Search the keyword table.
- * Ignore initial "." to avoid member-of-structure
- * problems.
- */
-findkw()
-{
-       register struct kwtab *kp;
-       register char *p1, *p2;
-       char *wp;
-       int firstc;
-
-       wp = symbuf;
-       firstc = *wp;
-       for (kp=kwtab; (p2 = kp->kwname); kp++) {
-               p1 = wp;
-               while (*p1 == *p2++)
-                       if (*p1++ == '\0') {
-                               cval = kp->kwval;
-                               return(1);
-                       }
-       }
-       *wp = firstc;
-       return(0);
-}
-
-
-/*
- * Return the next symbol from the input.
- * peeksym is a pushed-back symbol, peekc is a pushed-back
- * character (after peeksym).
- * mosflg means that the next symbol, if an identifier,
- * is a member of structure or a structure tag, and it
- * gets a "." prepended to it to distinguish
- * it from other identifiers.
- */
-symbol() {
-       register c;
-       register char *sp;
-       register tline;
-
-       if (peeksym>=0) {
-               c = peeksym;
-               peeksym = -1;
-               if (c==NAME)
-                       mosflg = 0;
-               return(c);
-       }
-       if (peekc) {
-               c = peekc;
-               peekc = 0;
-       } else
-               if (eof)
-                       return(EOFC);
-               else
-                       c = getchar();
-loop:
-       if (c==EOF) {
-               eof++;
-               return(EOFC);
-       }
-       switch(ctab[c]) {
-
-       case SHARP:
-               if ((c=symbol())!=CON) {
-                       error("Illegal #");
-                       return(c);
-               }
-               tline = cval;
-               while (ctab[peekc]==SPACE)
-                       peekc = getchar();
-               if (peekc=='"') {
-                       sp = filename;
-                       while ((c = mapch('"')) >= 0)
-                               *sp++ = c;
-                       *sp++ = 0;
-                       peekc = getchar();
-               }
-               if (peekc != '\n') {
-                       error("Illegal #");
-                       while (getchar()!='\n' && eof==0)
-                               ;
-               }
-               peekc = 0;
-               line = tline;
-               return(symbol());
-
-       case INSERT:            /* ignore newlines */
-               inhdr = 1;
-               c = getchar();
-               goto loop;
-
-       case NEWLN:
-               if (!inhdr)
-                       line++;
-               inhdr = 0;
-
-       case SPACE:
-               c = getchar();
-               goto loop;
-
-       case PLUS:
-               return(subseq(c,PLUS,INCBEF));
-
-       case MINUS:
-               return(subseq(c,subseq('>',MINUS,ARROW),DECBEF));
-
-       case ASSIGN:
-               c = spnextchar();
-               peekc = 0;
-               if (c=='=')
-                       return(EQUAL);
-               if (c==' ')
-                       return(ASSIGN);
-               if (c=='<' || c=='>') {
-                       if (spnextchar() != c) {
-                               peeksym = ctab[c];
-                               return(ASSIGN);
-                       }
-                       peekc = 0;
-                       return(c=='<'? ASLSH: ASRSH);
-               }
-               if (ctab[c]>=PLUS && ctab[c]<=EXOR) {
-                       if (spnextchar() != ' '
-                        && (c=='-' || c=='&' || c=='*')) {
-                               error("Warning: %c= operator assumed", c);
-                               nerror--;
-                       }
-                       c = ctab[c];
-                       return(c+ASPLUS-PLUS);
-               }
-               peekc = c;
-               return(ASSIGN);
-
-       case LESS:
-               if (subseq(c,0,1)) return(LSHIFT);
-               return(subseq('=',LESS,LESSEQ));
-
-       case GREAT:
-               if (subseq(c,0,1)) return(RSHIFT);
-               return(subseq('=',GREAT,GREATEQ));
-
-       case EXCLA:
-               return(subseq('=',EXCLA,NEQUAL));
-
-       case BSLASH:
-               if (subseq('/', 0, 1))
-                       return(MAX);
-               goto unkn;
-
-       case DIVIDE:
-               if (subseq('\\', 0, 1))
-                       return(MIN);
-               if (subseq('*',1,0))
-                       return(DIVIDE);
-               while ((c = spnextchar()) != EOFC) {
-                       peekc = 0;
-                       if (c=='*') {
-                               if (spnextchar() == '/') {
-                                       peekc = 0;
-                                       c = getchar();
-                                       goto loop;
-                               }
-                       }
-               }
-               eof++;
-               error("Nonterminated comment");
-               return(0);
-
-       case PERIOD:
-       case DIGIT:
-               peekc = c;
-               return(getnum());
-
-       case DQUOTE:
-               cval = isn++;
-               return(STRING);
-
-       case SQUOTE:
-               return(getcc());
-
-       case LETTER:
-               sp = symbuf;
-               while(ctab[c]==LETTER || ctab[c]==DIGIT) {
-                       if (sp<symbuf+NCPS)
-                               *sp++ = c;
-                       c = getchar();
-               }
-               while(sp<symbuf+NCPS)
-                       *sp++ = '\0';
-               mossym = 0;
-               if (mosflg) {
-                       mossym = FMOS;
-                       mosflg = 0;
-               }
-               peekc = c;
-               if ((c=lookup())==KEYW && cval==SIZEOF)
-                       c = SIZEOF;
-               return(c);
-
-       case AND:
-               return(subseq('&', AND, LOGAND));
-
-       case OR:
-               return(subseq('|', OR, LOGOR));
-
-       case UNKN:
-       unkn:
-               error("Unknown character");
-               c = getchar();
-               goto loop;
-
-       }
-       return(ctab[c]);
-}
-
-/*
- * Read a number.  Return kind.
- */
-getnum()
-{
-       register char *np;
-       register c, base;
-       int expseen, sym, ndigit;
-       char *nsyn;
-       int maxdigit;
-
-       nsyn = "Number syntax";
-       lcval = 0;
-       base = 10;
-       maxdigit = 0;
-       np = numbuf;
-       ndigit = 0;
-       sym = CON;
-       expseen = 0;
-       if ((c=spnextchar()) == '0')
-               base = 8;
-       for (;; c = getchar()) {
-               *np++ = c;
-               if (ctab[c]==DIGIT || (base==16) && ('a'<=c&&c<='f'||'A'<=c&&c<='F')) {
-                       if (base==8)
-                               lcval =<< 3;
-                       else if (base==10)
-                               lcval = ((lcval<<2) + lcval)<<1;
-                       else
-                               lcval =<< 4;
-                       if (ctab[c]==DIGIT)
-                               c =- '0';
-                       else if (c>='a')
-                               c =- 'a'-10;
-                       else
-                               c =- 'A'-10;
-                       lcval =+ c;
-                       ndigit++;
-                       if (c>maxdigit)
-                               maxdigit = c;
-                       continue;
-               }
-               if (c=='.') {
-                       if (base==16 || sym==FCON)
-                               error(nsyn);
-                       sym = FCON;
-                       base = 10;
-                       continue;
-               }
-               if (ndigit==0) {
-                       sym = DOT;
-                       break;
-               }
-               if ((c=='e'||c=='E') && expseen==0) {
-                       expseen++;
-                       sym = FCON;
-                       if (base==16 || maxdigit>=10)
-                               error(nsyn);
-                       base = 10;
-                       *np++ = c = getchar();
-                       if (c!='+' && c!='-' && ctab[c]!=DIGIT)
-                               break;
-               } else if (c=='x' || c=='X') {
-                       if (base!=8 || lcval!=0 || sym!=CON)
-                               error(nsyn);
-                       base = 16;
-               } else if ((c=='l' || c=='L') && sym==CON) {
-                       c = getchar();
-                       sym = LCON;
-                       break;
-               } else
-                       break;
-       }
-       peekc = c;
-       if (maxdigit >= base)
-               error(nsyn);
-       if (sym==FCON) {
-               np[-1] = 0;
-               cval = np-numbuf;
-               return(FCON);
-       }
-       if (sym==CON && (lcval<0 || lcval>MAXINT&&base==10 || (lcval>>1)>MAXINT)) {
-               sym = LCON;
-       }
-       cval = lcval;
-       return(sym);
-}
-
-/*
- * If the next input character is c, return b and advance.
- * Otherwise push back the character and return a.
- */
-subseq(c,a,b)
-{
-       if (spnextchar() != c)
-               return(a);
-       peekc = 0;
-       return(b);
-}
-
-/*
- * Write out a string, either in-line
- * or in the string temp file labelled by
- * lab.
- */
-putstr(lab, amax)
-{
-       register int c, max;
-
-       nchstr = 0;
-       max = amax;
-       if (lab) {
-               strflg++;
-               outcode("BNB", LABEL, lab, BDATA);
-               max = 10000;
-       } else
-               outcode("B", BDATA);
-       while ((c = mapch('"')) >= 0) {
-               if (nchstr < max) {
-                       nchstr++;
-                       if (nchstr%15 == 0)
-                               outcode("0B", BDATA);
-                       outcode("1N", c & 0377);
-               }
-       }
-       if (nchstr < max) {
-               nchstr++;
-               outcode("10");
-       }
-       outcode("0");
-       strflg = 0;
-}
-
-/*
- * read a single-quoted character constant.
- * The routine is sensitive to the layout of
- * characters in a word.
- */
-getcc()
-{
-       register int c, cc;
-       register char *ccp;
-       char realc;
-
-       cval = 0;
-       ccp = &cval;
-       cc = 0;
-       while((c=mapch('\'')) >= 0)
-               if(cc++ < LNCPW)
-                       *ccp++ = c;
-       if (cc>LNCPW)
-               error("Long character constant");
-       if (cc==1) {
-               realc = cval;
-               cval = realc;
-       }
-       return(CON);
-}
-
-/*
- * Read a character in a string or character constant,
- * detecting the end of the string.
- * It implements the escape sequences.
- */
-mapch(ac)
-{
-       register int a, c, n;
-       static mpeek;
-
-       c = ac;
-       if (a = mpeek)
-               mpeek = 0;
-       else
-               a = getchar();
-loop:
-       if (a==c)
-               return(-1);
-       switch(a) {
-
-       case '\n':
-       case '\0':
-               error("Nonterminated string");
-               peekc = a;
-               return(-1);
-
-       case '\\':
-               switch (a=getchar()) {
-
-               case 't':
-                       return('\t');
-
-               case 'n':
-                       return('\n');
-
-               case 'b':
-                       return('\b');
-
-               case 'f':
-                       return('\014');
-
-               case 'v':
-                       return('\013');
-
-               case '0': case '1': case '2': case '3':
-               case '4': case '5': case '6': case '7':
-                       n = 0;
-                       c = 0;
-                       while (++c<=3 && '0'<=a && a<='7') {
-                               n =<< 3;
-                               n =+ a-'0';
-                               a = getchar();
-                       }
-                       mpeek = a;
-                       return(n);
-
-               case 'r':
-                       return('\r');
-
-               case '\n':
-                       if (!inhdr)
-                               line++;
-                       inhdr = 0;
-                       a = getchar();
-                       goto loop;
-               }
-       }
-       return(a);
-}
-
-/*
- * Read an expression and return a pointer to its tree.
- * It's the classical bottom-up, priority-driven scheme.
- * The initflg prevents the parse from going past
- * "," or ":" because those delimiters are special
- * in initializer (and some other) expressions.
- */
-struct tnode *
-tree()
-{
-       int *op, opst[SSIZE], *pp, prst[SSIZE];
-       register int andflg, o;
-       register struct hshtab *cs;
-       int p, ps, os;
-       struct tnode *cmst[CMSIZ];
-       struct lnode *lcp;
-
-       curbase = funcbase;
-       op = opst;
-       pp = prst;
-       cp = cmst;
-       *op = SEOF;
-       *pp = 06;
-       andflg = 0;
-
-advanc:
-       switch (o=symbol()) {
-
-       case NAME:
-               cs = csym;
-               if (cs->hclass==TYPEDEF)
-                       goto atype;
-               if (cs->hclass==ENUMCON) {
-                       *cp++ = cblock(cs->hoffset);
-                       goto tand;
-               }
-               if (cs->hclass==0 && cs->htype==0)
-                       if(nextchar()=='(') {
-                               /* set function */
-                               cs->hclass = EXTERN;
-                               cs->htype = FUNC;
-                       } else {
-                               cs->hclass = STATIC;
-                               error("%.8s undefined; func. %.8s", cs->name, funcsym->name);
-                               if (initflg) {
-                                       cs->hclass = EXTERN;
-                                       error("(Warning only)");
-                                       nerror =- 2;
-                               }
-                       }
-               *cp++ = nblock(cs);
-               goto tand;
-
-       case FCON:
-               *cp++ = fblock(DOUBLE, copnum(cval));
-               goto tand;
-
-       case LCON:
-               cs = gblock(sizeof(*lcp));
-               cs->op = LCON;
-               cs->type = LONG;
-               cs->lvalue = lcval;
-               *cp++ = cs;
-               goto tand;
-
-       case CON:
-               *cp++ = cblock(cval);
-               goto tand;
-
-       /* fake a static char array */
-       case STRING:
-               putstr(cval, 0);
-               cs = gblock(sizeof(*cs));
-               cs->hclass = STATIC;
-               cs->hoffset = cval;
-               *cp++ = block(NAME, ARRAY+CHAR, &nchstr, NULL, cs);
-
-       tand:
-               if(cp>=cmst+CMSIZ) {
-                       error("Expression overflow");
-                       exit(1);
-               }
-               if (andflg)
-                       goto syntax;
-               andflg = 1;
-               goto advanc;
-
-       case KEYW:
-       atype:
-               if (*op != LPARN || andflg)
-                       goto syntax;
-               peeksym = o;
-               *cp++ = xprtype(gblock(sizeof(*xprtype())));
-               if ((o=symbol()) != RPARN)
-                       goto syntax;
-               o = CAST;
-               --op;
-               --pp;
-               if (*op == SIZEOF) {
-                       andflg = 1;
-                       *pp = 100;
-                       goto advanc;
-               }
-               goto oponst;
-
-       case INCBEF:
-       case DECBEF:
-               if (andflg)
-                       o =+ 2;
-               goto oponst;
-
-       case COMPL:
-       case EXCLA:
-       case SIZEOF:
-               if (andflg)
-                       goto syntax;
-               goto oponst;
-
-       case MINUS:
-               if (!andflg)
-                       o = NEG;
-               andflg = 0;
-               goto oponst;
-
-       case AND:
-       case TIMES:
-               if (andflg)
-                       andflg = 0;
-               else if (o==AND)
-                       o = AMPER;
-               else
-                       o = STAR;
-               goto oponst;
-
-       case LPARN:
-               if (andflg) {
-                       o = symbol();
-                       if (o==RPARN)
-                               o = MCALL;
-                       else {
-                               peeksym = o;
-                               o = CALL;
-                               andflg = 0;
-                       }
-               }
-               goto oponst;
-
-       case RBRACK:
-       case RPARN:
-               if (!andflg)
-                       goto syntax;
-               goto oponst;
-
-       case DOT:
-       case ARROW:
-               mosflg++;
-               break;
-
-       case ASSIGN:
-               if (andflg==0 && PLUS<=*op && *op<=EXOR) {
-                       o = *op-- + ASPLUS - PLUS;
-                       pp--;
-                       goto oponst;
-               }
-               break;
-
-       }
-       /* binaries */
-       if (andflg==0)
-               goto syntax;
-       andflg = 0;
-
-oponst:
-       p = (opdope[o]>>9) & 077;
-opon1:
-       ps = *pp;
-       if (p>ps || p==ps && (opdope[o]&RASSOC)!=0) {
-               switch (o) {
-
-               case INCAFT:
-               case DECAFT:
-                       p = 37;
-                       break;
-               case LPARN:
-               case LBRACK:
-               case CALL:
-                       p = 04;
-               }
-               if (initflg) {
-                       if ((o==COMMA && *op!=LPARN && *op!=CALL)
-                        || (o==COLON && *op!=QUEST)) {
-                               p = 00;
-                               goto opon1;
-                       }
-               }
-               if (op >= &opst[SSIZE-1]) {
-                       error("expression overflow");
-                       exit(1);
-               }
-               *++op = o;
-               *++pp = p;
-               goto advanc;
-       }
-       --pp;
-       switch (os = *op--) {
-
-       case SEOF:
-               peeksym = o;
-               build(0);               /* flush conversions */
-               return(*--cp);
-
-       case COMMA:
-               if (*op != CALL)
-                       os = SEQNC;
-               break;
-
-       case CALL:
-               if (o!=RPARN)
-                       goto syntax;
-               build(os);
-               goto advanc;
-
-       case MCALL:
-               *cp++ = NULL;   /* empty arglist */
-               os = CALL;
-               break;
-
-       case INCBEF:
-       case INCAFT:
-       case DECBEF:
-       case DECAFT:
-               *cp++ = cblock(1);
-               break;
-
-       case LPARN:
-               if (o!=RPARN)
-                       goto syntax;
-               goto advanc;
-
-       case LBRACK:
-               if (o!=RBRACK)
-                       goto syntax;
-               build(LBRACK);
-               goto advanc;
-       }
-       build(os);
-       goto opon1;
-
-syntax:
-       error("Expression syntax");
-       errflush(o);
-       return(0);
-}
-
-struct hshtab *
-xprtype(atyb)
-struct hshtab *atyb;
-{
-       register struct hshtab *tyb;
-       struct hshtab typer;
-       int sc;
-       register char *md, *fb;
-       struct tnode *scp;
-
-       tyb = atyb;
-       fb = funcbase;
-       md = maxdecl;
-       scp = cp;
-       funcbase = curbase;
-       sc = DEFXTRN;           /* will cause error if class mentioned */
-       getkeywords(&sc, &typer);
-       tyb->hclass = 0;
-       tyb->hblklev = 0;
-       decl1(&sc, &typer, 0, tyb);
-       funcbase = fb;
-       maxdecl = md;
-       cp = scp;
-       tyb->op = ETYPE;
-       return(tyb);
-}
-
-char *
-copnum(len)
-{
-       register char *s1, *s2, *s3;
-
-       s1 = s2 = gblock((len+LNCPW-1) & ~(LNCPW-1));
-       s3 = numbuf;
-       while (*s2++ = *s3++);
-       return(s1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c01.c b/.ref-Research-V7/usr/src/cmd/c/c01.c
deleted file mode 100644 (file)
index 2a9d96d..0000000
+++ /dev/null
@@ -1,644 +0,0 @@
-#
-/*
- * C compiler
- *
- *
- */
-
-#include "c0.h"
-
-/*
- * Called from tree, this routine takes the top 1, 2, or 3
- * operands on the expression stack, makes a new node with
- * the operator op, and puts it on the stack.
- * Essentially all the work is in inserting
- * appropriate conversions.
- */
-build(op)
-{
-       register int t1;
-       int t2, t;
-       register struct tnode *p1, *p2;
-       struct tnode *p3;
-       int dope, leftc, cvn, pcvn;
-
-       /*
-        * a[i] => *(a+i)
-        */
-       if (op==LBRACK) {
-               build(PLUS);
-               op = STAR;
-       }
-       dope = opdope[op];
-       if ((dope&BINARY)!=0) {
-               p2 = chkfun(disarray(*--cp));
-               t2 = p2->type;
-       }
-       p1 = *--cp;
-       /*
-        * sizeof gets turned into a number here.
-        */
-       if (op==SIZEOF) {
-               t1 = cblock(length(p1));
-               t1->type = UNSIGN;
-               *cp++ = t1;
-               return;
-       }
-       if (op!=AMPER) {
-               p1 = disarray(p1);
-               if (op!=CALL)
-                       p1 = chkfun(p1);
-       }
-       t1 = p1->type;
-       pcvn = 0;
-       t = INT;
-       switch (op) {
-
-       case CAST:
-               if ((t1&XTYPE)==FUNC || (t1&XTYPE)==ARRAY)
-                       error("Disallowed conversion");
-               if (t1==UNSIGN && t2==CHAR) {
-                       t2 = INT;
-                       p2 = block(AND,INT,NULL,NULL,p2,cblock(0377));
-               }
-               break;
-
-       /* end of expression */
-       case 0:
-               *cp++ = p1;
-               return;
-
-       /* no-conversion operators */
-       case QUEST:
-               if (p2->op!=COLON)
-                       error("Illegal conditional");
-               else
-                       if (fold(QUEST, p1, p2))
-                               return;
-
-       case SEQNC:
-               t = t2;
-
-       case COMMA:
-       case LOGAND:
-       case LOGOR:
-               *cp++ = block(op, t, NULL, NULL, p1, p2);
-               return;
-
-       case EXCLA:
-               t1 = INT;
-               break;
-
-       case CALL:
-               if ((t1&XTYPE) != FUNC)
-                       error("Call of non-function");
-               *cp++ = block(CALL,decref(t1),p1->subsp,p1->strp,p1,p2);
-               return;
-
-       case STAR:
-               if ((t1&XTYPE) == FUNC)
-                       error("Illegal indirection");
-               *cp++ = block(STAR, decref(t1), p1->subsp, p1->strp, p1);
-               return;
-
-       case AMPER:
-               if (p1->op==NAME || p1->op==STAR) {
-                       *cp++ = block(op,incref(t1),p1->subsp,p1->strp,p1);
-                       return;
-               }
-               error("Illegal lvalue");
-               break;
-
-       /*
-        * a.b goes to (&a)->b
-        */
-       case DOT:
-               if (p1->op==CALL && t1==STRUCT) {
-                       t1 = incref(t1);
-                       setype(p1, t1, p1);
-               } else {
-                       *cp++ = p1;
-                       build(AMPER);
-                       p1 = *--cp;
-               }
-
-       /*
-        * In a->b, a is given the type ptr-to-structure element;
-        * then the offset is added in without conversion;
-        * then * is tacked on to access the member.
-        */
-       case ARROW:
-               if (p2->op!=NAME || p2->tr1->hclass!=MOS) {
-                       error("Illegal structure ref");
-                       *cp++ = p1;
-                       return;
-               }
-               if (t2==INT && p2->tr1->hflag&FFIELD)
-                       t2 = UNSIGN;
-               t = incref(t2);
-               chkw(p1, -1);
-               setype(p1, t, p2);
-               *cp++ = block(PLUS,t,p2->subsp,p2->strp,p1,cblock(p2->tr1->hoffset));
-               build(STAR);
-               if (p2->tr1->hflag&FFIELD)
-                       *cp++ = block(FSEL,UNSIGN,NULL,NULL,*--cp,p2->tr1->hstrp);
-               return;
-       }
-       if ((dope&LVALUE)!=0)
-               chklval(p1);
-       if ((dope&LWORD)!=0)
-               chkw(p1, LONG);
-       if ((dope&RWORD)!=0)
-               chkw(p2, LONG);
-       if ((dope&BINARY)==0) {
-               if (op==ITOF)
-                       t1 = DOUBLE;
-               else if (op==FTOI)
-                       t1 = INT;
-               if (!fold(op, p1, 0))
-                       *cp++ = block(op,t1,p1->subsp,p1->strp,p1);
-               return;
-       }
-       cvn = 0;
-       if (t1==STRUCT || t2==STRUCT) {
-               if (t1!=t2 || p1->strp != p2->strp)
-                       error("Incompatible structures");
-               cvn = 0;
-       } else
-               cvn = cvtab[lintyp(t1)][lintyp(t2)];
-       leftc = (cvn>>4)&017;
-       cvn =& 017;
-       t = leftc? t2:t1;
-       if ((t==INT||t==CHAR) && (t1==UNSIGN||t2==UNSIGN))
-               t = UNSIGN;
-       if (dope&ASSGOP || op==CAST) {
-               t = t1;
-               if (op==ASSIGN || op==CAST) {
-                       if (cvn==ITP||cvn==PTI)
-                               cvn = leftc = 0;
-                       else if (cvn==LTP) {
-                               if (leftc==0)
-                                       cvn = LTI;
-                               else {
-                                       cvn = ITL;
-                                       leftc = 0;
-                               }
-                       }
-               }
-               if (leftc)
-                       cvn = leftc;
-               leftc = 0;
-       } else if (op==COLON || op==MAX || op==MIN) {
-               if (t1>=PTR && t1==t2)
-                       cvn = 0;
-               if (op!=COLON && (t1>=PTR || t2>=PTR))
-                       op =+ MAXP-MAX;
-       } else if (dope&RELAT) {
-               if (op>=LESSEQ && (t1>=PTR||t2>=PTR||(t1==UNSIGN||t2==UNSIGN)
-                && (t==INT||t==CHAR||t==UNSIGN)))
-                       op =+ LESSEQP-LESSEQ;
-               if (cvn==ITP || cvn==PTI)
-                       cvn = 0;
-       }
-       if (cvn==PTI) {
-               cvn = 0;
-               if (op==MINUS) {
-                       t = INT;
-                       pcvn++;
-               } else {
-                       if (t1!=t2 || t1!=(PTR+CHAR))
-                               cvn = XX;
-               }
-       }
-       if (cvn) {
-               t1 = plength(p1);
-               t2 = plength(p2);
-               if (cvn==XX || (cvn==PTI&&t1!=t2))
-                       error("Illegal conversion");
-               else if (leftc)
-                       p1 = convert(p1, t, cvn, t2);
-               else
-                       p2 = convert(p2, t, cvn, t1);
-       }
-       if (dope&RELAT)
-               t = INT;
-       if (t==FLOAT)
-               t = DOUBLE;
-       if (t==CHAR)
-               t = INT;
-       if (op==CAST) {
-               if (t!=DOUBLE && (t!=INT || p2->type!=CHAR)) {
-                       p2->type = t;
-                       p2->subsp = p1->subsp;
-                       p2->strp = p1->strp;
-               }
-               if (t==INT && p1->type==CHAR)
-                       p2 = block(ITOC, INT, NULL, NULL, p2);
-               *cp++ = p2;
-               return;
-       }
-       if (fold(op, p1, p2)==0) {
-               p3 = leftc?p2:p1;
-               *cp++ = block(op, t, p3->subsp, p3->strp, p1, p2);
-       }
-       if (pcvn && t1!=(PTR+CHAR)) {
-               p1 = *--cp;
-               *cp++ = convert(p1, 0, PTI, plength(p1->tr1));
-       }
-}
-
-/*
- * Generate the appropriate conversion operator.
- */
-struct tnode *
-convert(p, t, cvn, len)
-struct tnode *p;
-{
-       register int op;
-
-       op = cvntab[cvn];
-       if (opdope[op]&BINARY) {
-               if (len==0)
-                       error("Illegal conversion");
-               return(block(op, t, NULL, NULL, p, cblock(len)));
-       }
-       return(block(op, t, NULL, NULL, p));
-}
-
-/*
- * Traverse an expression tree, adjust things
- * so the types of things in it are consistent
- * with the view that its top node has
- * type at.
- * Used with structure references.
- */
-setype(ap, at, anewp)
-struct tnode *ap, *anewp;
-{
-       register struct tnode *p, *newp;
-       register t;
-
-       p = ap;
-       t = at;
-       newp = anewp;
-       for (;; p = p->tr1) {
-               p->subsp = newp->subsp;
-               p->strp = newp->strp;
-               p->type = t;
-               if (p->op==AMPER)
-                       t = decref(t);
-               else if (p->op==STAR)
-                       t = incref(t);
-               else if (p->op!=PLUS)
-                       break;
-       }
-}
-
-/*
- * A mention of a function name is turned into
- * a pointer to that function.
- */
-struct tnode *
-chkfun(ap)
-struct tnode *ap;
-{
-       register struct tnode *p;
-       register int t;
-
-       p = ap;
-       if (((t = p->type)&XTYPE)==FUNC && p->op!=ETYPE)
-               return(block(AMPER,incref(t),p->subsp,p->strp,p));
-       return(p);
-}
-
-/*
- * A mention of an array is turned into
- * a pointer to the base of the array.
- */
-struct tnode *
-disarray(ap)
-struct tnode *ap;
-{
-       register int t;
-       register struct tnode *p;
-
-       p = ap;
-       /* check array & not MOS and not typer */
-       if (((t = p->type)&XTYPE)!=ARRAY || p->op==NAME&&p->tr1->hclass==MOS
-        || p->op==ETYPE)
-               return(p);
-       p->subsp++;
-       *cp++ = p;
-       setype(p, decref(t), p);
-       build(AMPER);
-       return(*--cp);
-}
-
-/*
- * make sure that p is a ptr to a node
- * with type int or char or 'okt.'
- * okt might be nonexistent or 'long'
- * (e.g. for <<).
- */
-chkw(p, okt)
-struct tnode *p;
-{
-       register int t;
-
-       if ((t=p->type)!=INT && t<PTR && t!=CHAR && t!=UNSIGN && t!=okt)
-               error("Illegal type of operand");
-       return;
-}
-
-/*
- *'linearize' a type for looking up in the
- * conversion table
- */
-lintyp(t)
-{
-       switch(t) {
-
-       case INT:
-       case CHAR:
-       case UNSIGN:
-               return(0);
-
-       case FLOAT:
-       case DOUBLE:
-               return(1);
-
-       case LONG:
-               return(2);
-
-       default:
-               return(3);
-       }
-}
-
-/*
- * Report an error.
- */
-error(s, p1, p2, p3, p4, p5, p6)
-{
-       nerror++;
-       if (filename[0])
-               fprintf(stderr, "%s:", filename);
-       fprintf(stderr, "%d: ", line);
-       fprintf(stderr, s, p1, p2, p3, p4, p5, p6);
-       fprintf(stderr, "\n");
-}
-
-/*
- * Generate a node in an expression tree,
- * setting the operator, type, dimen/struct table ptrs,
- * and the operands.
- */
-struct tnode *
-block(op, t, subs, str, p1,p2)
-int *subs;
-struct str *str;
-struct tnode *p1, *p2;
-{
-       register struct tnode *p;
-
-       p = gblock(sizeof(*p));
-       p->op = op;
-       p->type = t;
-       p->subsp = subs;
-       p->strp = str;
-       p->tr1 = p1;
-       if (opdope[op]&BINARY)
-               p->tr2 = p2;
-       else
-               p->tr2 = NULL;
-       return(p);
-}
-
-struct tnode *
-nblock(ads)
-struct hshtab *ads;
-{
-       register struct hshtab *ds;
-
-       ds = ads;
-       return(block(NAME, ds->htype, ds->hsubsp, ds->hstrp, ds));
-}
-
-/*
- * Generate a block for a constant
- */
-struct cnode *
-cblock(v)
-{
-       register struct cnode *p;
-
-       p = gblock(sizeof(*p));
-       p->op = CON;
-       p->type = INT;
-       p->subsp = NULL;
-       p->strp = NULL;
-       p->value = v;
-       return(p);
-}
-
-/*
- * A block for a float or long constant
- */
-struct fnode *
-fblock(t, string)
-char *string;
-{
-       register struct fnode *p;
-
-       p = gblock(sizeof(*p));
-       p->op = FCON;
-       p->type = t;
-       p->subsp = NULL;
-       p->strp = NULL;
-       p->cstr = string;
-       return(p);
-}
-
-/*
- * Assign a block for use in the
- * expression tree.
- */
-char *
-gblock(n)
-{
-       register int *p;
-
-       p = curbase;
-       if ((curbase =+ n) >= coremax) {
-               if (sbrk(1024) == -1) {
-                       error("Out of space");
-                       exit(1);
-               }
-               coremax =+ 1024;
-       }
-       return(p);
-}
-
-/*
- * Check that a tree can be used as an lvalue.
- */
-chklval(ap)
-struct tnode *ap;
-{
-       register struct tnode *p;
-
-       p = ap;
-       if (p->op==FSEL)
-               p = p->tr1;
-       if (p->op!=NAME && p->op!=STAR)
-               error("Lvalue required");
-}
-
-/*
- * reduce some forms of `constant op constant'
- * to a constant.  More of this is done in the next pass
- * but this is used to allow constant expressions
- * to be used in switches and array bounds.
- */
-fold(op, ap1, ap2)
-struct tnode *ap1, *ap2;
-{
-       register struct tnode *p1;
-       register int v1, v2;
-       int unsignf;
-
-       p1 = ap1;
-       if (p1->op!=CON)
-               return(0);
-       unsignf = p1->type==UNSIGN;
-       if (op==QUEST) {
-               if (ap2->tr1->op==CON && ap2->tr2->op==CON) {
-                       p1->value = p1->value? ap2->tr1->value: ap2->tr2->value;
-                       *cp++ = p1;
-                       return(1);
-               }
-               return(0);
-       }
-       if (ap2) {
-               if (ap2->op!=CON)
-                       return(0);
-               v2 = ap2->value;
-               unsignf |= ap2->type==UNSIGN;
-       }
-       v1 = p1->value;
-       switch (op) {
-
-       case PLUS:
-               v1 =+ v2;
-               break;
-
-       case MINUS:
-               v1 =- v2;
-               break;
-
-       case TIMES:
-               v1 =* v2;
-               break;
-
-       case DIVIDE:
-               if (v2==0)
-                       goto divchk;
-               if (unsignf) {
-                       v1 = (unsigned)v1 / v2;
-                       break;
-               }
-               v1 =/ v2;
-               break;
-
-       case MOD:
-               if (v2==0)
-                       goto divchk;
-               if (unsignf) {
-                       v1 = (unsigned)v1 % v2;
-                       break;
-               }
-               v1 =% v2;
-               break;
-
-       case AND:
-               v1 =& v2;
-               break;
-
-       case OR:
-               v1 =| v2;
-               break;
-
-       case EXOR:
-               v1 =^ v2;
-               break;
-
-       case NEG:
-               v1 = - v1;
-               break;
-
-       case COMPL:
-               v1 = ~ v1;
-               break;
-
-       case LSHIFT:
-               v1 =<< v2;
-               break;
-
-       case RSHIFT:
-               if (unsignf) {
-                       v1 = (unsigned)v1 >> v2;
-                       break;
-               }
-               v1 =>> v2;
-               break;
-
-       case EQUAL:
-               v1 = v1==v2;
-               break;
-
-       case NEQUAL:
-               v1 = v1!=v2;
-               break;
-
-       case LESS:
-               v1 = v1<v2;
-               break;
-
-       case GREAT:
-               v1 = v1>v2;
-               break;
-
-       case LESSEQ:
-               v1 = v1<=v2;
-               break;
-
-       case GREATEQ:
-               v1 = v1>=v2;
-               break;
-
-       divchk:
-               error("Divide check");
-       default:
-               return(0);
-       }
-       p1->value = v1;
-       *cp++ = p1;
-       return(1);
-}
-
-/*
- * Compile an expression expected to have constant value,
- * for example an array bound or a case value.
- */
-conexp()
-{
-       register struct tnode *t;
-
-       initflg++;
-       if (t = tree())
-               if (t->op != CON)
-                       error("Constant required");
-       initflg--;
-       curbase = funcbase;
-       return(t->value);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c02.c b/.ref-Research-V7/usr/src/cmd/c/c02.c
deleted file mode 100644 (file)
index 8decd43..0000000
+++ /dev/null
@@ -1,792 +0,0 @@
-#
-/* C compiler
- *
- *
- */
-
-#include "c0.h"
-
-/*
- * Process a single external definition
- */
-extdef()
-{
-       register o;
-       int sclass, scflag, *cb;
-       struct hshtab typer;
-       register struct hshtab *ds;
-
-       if(((o=symbol())==EOFC) || o==SEMI)
-               return;
-       peeksym = o;
-       sclass = 0;
-       blklev = 0;
-       if (getkeywords(&sclass, &typer)==0) {
-               sclass = EXTERN;
-               if (peeksym!=NAME)
-                       goto syntax;
-       }
-       scflag = 0;
-       if (sclass==DEFXTRN) {
-               scflag++;
-               sclass = EXTERN;
-       }
-       if (sclass!=EXTERN && sclass!=STATIC && sclass!=TYPEDEF)
-               error("Illegal storage class");
-       do {
-               defsym = 0;
-               paraml = 0;
-               parame = 0;
-               if (sclass==TYPEDEF) {
-                       decl1(TYPEDEF, &typer, 0, NULL);
-                       continue;
-               }
-               decl1(EXTERN, &typer, 0, NULL);
-               if ((ds=defsym)==0)
-                       return;
-               funcsym = ds;
-               if ((ds->type&XTYPE)==FUNC) {
-                       if ((peeksym=symbol())==LBRACE || peeksym==KEYW
-                        || (peeksym==NAME && csym->hclass==TYPEDEF)) {
-                               funcblk.type = decref(ds->type);
-                               funcblk.strp = ds->strp;
-                               setinit(ds);
-                               outcode("BS", SYMDEF, sclass==EXTERN?ds->name:"");
-                               cfunc();
-                               return;
-                       }
-                       if (paraml)
-                               error("Inappropriate parameters");
-               } else if ((o=symbol())==COMMA || o==SEMI) {
-                       peeksym = o;
-                       o = (length(ds)+ALIGN) & ~ALIGN;
-                       if (sclass==STATIC) {
-                               setinit(ds);
-                               outcode("BSBBSBN", SYMDEF, "", BSS, NLABEL, ds->name, SSPACE, o);
-                       } else if (scflag)
-                               outcode("BSN", CSPACE, ds->name, o);
-               } else {
-                       if (o!=ASSIGN)
-                               peeksym = o;
-                       setinit(ds);
-                       if (sclass==EXTERN)
-                               outcode("BS", SYMDEF, ds->name);
-                       outcode("BBS", DATA, NLABEL, ds->name);
-                       cb = funcbase;
-                       if (cinit(ds, 1, sclass) & ALIGN)
-                               outcode("B", EVEN);
-                       if (maxdecl > cb)
-                               cb = maxdecl;
-                       funcbase = cb;
-               }
-       } while ((o=symbol())==COMMA);
-       if (o==SEMI)
-               return;
-syntax:
-       if (o==RBRACE) {
-               error("Too many }'s");
-               peeksym = 0;
-               return;
-       }
-       error("External definition syntax");
-       errflush(o);
-       statement();
-}
-
-/*
- * Process a function definition.
- */
-cfunc()
-{
-       register int *cb;
-       register sloc;
-
-       sloc = isn;
-       isn =+ 2;
-       outcode("BBS", PROG, RLABEL, funcsym->name);
-       if (proflg)
-               outcode("BN", PROFIL, isn++);
-       cb = curbase;
-       regvar = 5;
-       autolen = STAUTO;
-       maxauto = STAUTO;
-       blklev = 1;
-       declist(ARG);
-       outcode("B", SAVE);
-       funchead();
-       branch(sloc);
-       label(sloc+1);
-       retlab = isn++;
-       blklev = 0;
-       if ((peeksym = symbol()) != LBRACE)
-               error("Compound statement required");
-       statement();
-       outcode("BNB", LABEL, retlab, RETRN);
-       label(sloc);
-       outcode("BN", SETSTK, -maxauto);
-       branch(sloc+1);
-       if (cb < maxdecl)
-               cb = maxdecl;
-       curbase = funcbase = cb;
-}
-
-/*
- * Process the initializers for an external definition.
- */
-cinit(anp, flex, sclass)
-struct hshtab *anp;
-{
-       register struct phshtab *np;
-       register nel, ninit;
-       int width, isarray, o, brace, realtype, *cb;
-       struct tnode *s;
-
-       cb = funcbase;
-       np = gblock(sizeof(*np));
-       funcbase = curbase;
-       cpysymb(np, anp);
-       realtype = np->type;
-       isarray = 0;
-       if ((realtype&XTYPE) == ARRAY)
-               isarray++;
-       else
-               flex = 0;
-       width = length(np);
-       nel = 1;
-       /*
-        * If it's an array, find the number of elements.
-        * temporarily modify to look like kind of thing it's
-        * an array of.
-        */
-       if (sclass==AUTO)
-               if (isarray || realtype==STRUCT)
-                       error("No auto. aggregate initialization");
-       if (isarray) {
-               np->type = decref(realtype);
-               np->subsp++;
-               if (width==0 && flex==0)
-                       error("0-length row: %.8s", anp->name);
-               o = length(np);
-               /* nel = ldiv(0, width, o); */
-               nel = (unsigned)width/o;
-               width = o;
-       }
-       brace = 0;
-       if ((peeksym=symbol())==LBRACE && (isarray || np->type!=STRUCT)) {
-               peeksym = -1;
-               brace++;
-       }
-       ninit = 0;
-       do {
-               if ((o=symbol())==RBRACE)
-                       break;
-               peeksym = o;
-               if (o==STRING && realtype==ARRAY+CHAR) {
-                       if (sclass==AUTO)
-                               error("No strings in automatic");
-                       peeksym = -1;
-                       putstr(0, flex?10000:nel);
-                       ninit =+ nchstr;
-                       o = symbol();
-                       break;
-               } else if (np->type==STRUCT) {
-                       strinit(np, sclass);
-               } else if ((np->type&ARRAY)==ARRAY || peeksym==LBRACE)
-                       cinit(np, 0, sclass);
-               else {
-                       initflg++;
-                       s = tree();
-                       initflg = 0;
-                       if (np->hflag&FFIELD)
-                               error("No field initialization");
-                       *cp++ = nblock(np);
-                       *cp++ = s;
-                       build(ASSIGN);
-                       if (sclass==AUTO||sclass==REG)
-                               rcexpr(*--cp);
-                       else if (sclass==ENUMCON) {
-                               if (s->op!=CON)
-                                       error("Illegal enum constant for %.8s", anp->name);
-                               anp->hoffset = s->value;
-                       } else
-                               rcexpr(block(INIT,np->type,NULL,NULL,(*--cp)->tr2));
-               }
-               ninit++;
-               if ((ninit&077)==0 && sclass==EXTERN)
-                       outcode("BS", SYMDEF, "");
-       } while ((o=symbol())==COMMA && (ninit<nel || brace || flex));
-       if (brace==0 || o!=RBRACE)
-               peeksym = o;
-       /*
-        * If there are too few initializers, allocate
-        * more storage.
-        * If there are too many initializers, extend
-        * the declared size for benefit of "sizeof"
-        */
-       if (ninit<nel && sclass!=AUTO)
-               outcode("BN", SSPACE, (nel-ninit)*width);
-       else if (ninit>nel) {
-               if (flex && nel==0) {
-                       np->subsp[-1] = ninit;
-               } else
-                       error("Too many initializers: %.8s", anp->name);
-               nel = ninit;
-       }
-       curbase = funcbase = cb;
-       return(nel*width);
-}
-
-/*
- * Initialize a structure
- */
-strinit(np, sclass)
-struct tnode *np;
-{
-       register struct hshtab **mlp;
-       static zerloc;
-       register int o, brace;
-
-       if ((mlp = np->strp->memlist)==NULL) {
-               mlp = &zerloc;
-               error("Undefined structure initialization");
-       }
-       brace = 0;
-       if ((o = symbol()) == LBRACE)
-               brace++;
-       else
-               peeksym = o;
-       do {
-               if ((o=symbol()) == RBRACE)
-                       break;
-               peeksym = o;
-               if (*mlp==0) {
-                       error("Too many structure initializers");
-                       cinit(&funcblk, 0, sclass);
-               } else
-                       cinit(*mlp++, 0, sclass);
-               if (*mlp ==  &structhole) {
-                       outcode("B", EVEN);
-                       mlp++;
-               }
-       } while ((o=symbol())==COMMA && (*mlp || brace));
-       if (sclass!=AUTO && sclass!=REG) {
-               if (*mlp)
-                       outcode("BN", SSPACE, np->strp->ssize - (*mlp)->hoffset);
-               outcode("B", EVEN);
-       }
-       if (o!=RBRACE || brace==0)
-               peeksym = o;
-}
-
-/*
- * Mark already initialized
- */
-setinit(anp)
-struct hshtab *anp;
-{
-       register struct hshtab *np;
-
-       np = anp;
-       if (np->hflag&FINIT)
-               error("%s multiply defined", np->name);
-       np->hflag =| FINIT;
-}
-
-/*
- * Process one statement in a function.
- */
-statement()
-{
-       register o, o1, o2;
-       int o3;
-       struct tnode *np;
-       int sauto, sreg;
-
-stmt:
-       switch(o=symbol()) {
-
-       case EOFC:
-               error("Unexpected EOF");
-       case SEMI:
-               return;
-
-       case LBRACE:
-               sauto = autolen;
-               sreg = regvar;
-               blockhead();
-               while (!eof) {
-                       if ((o=symbol())==RBRACE) {
-                               autolen = sauto;
-                               if (sreg!=regvar)
-                                       outcode("BN", SETREG, sreg);
-                               regvar = sreg;
-                               blkend();
-                               return;
-                       }
-                       peeksym = o;
-                       statement();
-               }
-               error("Missing '}'");
-               return;
-
-       case KEYW:
-               switch(cval) {
-
-               case GOTO:
-                       if (o1 = simplegoto())
-                               branch(o1);
-                       else 
-                               dogoto();
-                       goto semi;
-
-               case RETURN:
-                       doret();
-                       goto semi;
-
-               case IF:
-                       np = pexpr();
-                       o2 = 0;
-                       if ((o1=symbol())==KEYW) switch (cval) {
-                       case GOTO:
-                               if (o2=simplegoto())
-                                       goto simpif;
-                               cbranch(np, o2=isn++, 0);
-                               dogoto();
-                               label(o2);
-                               goto hardif;
-
-                       case RETURN:
-                               if (nextchar()==';') {
-                                       o2 = retlab;
-                                       goto simpif;
-                               }
-                               cbranch(np, o1=isn++, 0);
-                               doret();
-                               label(o1);
-                               o2++;
-                               goto hardif;
-
-                       case BREAK:
-                               o2 = brklab;
-                               goto simpif;
-
-                       case CONTIN:
-                               o2 = contlab;
-                       simpif:
-                               chconbrk(o2);
-                               cbranch(np, o2, 1);
-                       hardif:
-                               if ((o=symbol())!=SEMI)
-                                       goto syntax;
-                               if ((o1=symbol())==KEYW && cval==ELSE) 
-                                       goto stmt;
-                               peeksym = o1;
-                               return;
-                       }
-                       peeksym = o1;
-                       cbranch(np, o1=isn++, 0);
-                       statement();
-                       if ((o=symbol())==KEYW && cval==ELSE) {
-                               o2 = isn++;
-                               branch(o2);
-                               label(o1);
-                               statement();
-                               label(o2);
-                               return;
-                       }
-                       peeksym = o;
-                       label(o1);
-                       return;
-
-               case WHILE:
-                       o1 = contlab;
-                       o2 = brklab;
-                       label(contlab = isn++);
-                       cbranch(pexpr(), brklab=isn++, 0);
-                       statement();
-                       branch(contlab);
-                       label(brklab);
-                       contlab = o1;
-                       brklab = o2;
-                       return;
-
-               case BREAK:
-                       chconbrk(brklab);
-                       branch(brklab);
-                       goto semi;
-
-               case CONTIN:
-                       chconbrk(contlab);
-                       branch(contlab);
-                       goto semi;
-
-               case DO:
-                       o1 = contlab;
-                       o2 = brklab;
-                       contlab = isn++;
-                       brklab = isn++;
-                       label(o3 = isn++);
-                       statement();
-                       label(contlab);
-                       contlab = o1;
-                       if ((o=symbol())==KEYW && cval==WHILE) {
-                               cbranch(tree(), o3, 1);
-                               label(brklab);
-                               brklab = o2;
-                               goto semi;
-                       }
-                       goto syntax;
-
-               case CASE:
-                       o1 = conexp();
-                       if ((o=symbol())!=COLON)
-                               goto syntax;
-                       if (swp==0) {
-                               error("Case not in switch");
-                               goto stmt;
-                       }
-                       if(swp>=swtab+SWSIZ) {
-                               error("Switch table overflow");
-                       } else {
-                               swp->swlab = isn;
-                               (swp++)->swval = o1;
-                               label(isn++);
-                       }
-                       goto stmt;
-
-               case SWITCH:
-                       o1 = brklab;
-                       brklab = isn++;
-                       np = pexpr();
-                       chkw(np, -1);
-                       rcexpr(block(RFORCE,0,NULL,NULL,np));
-                       pswitch();
-                       brklab = o1;
-                       return;
-
-               case DEFAULT:
-                       if (swp==0)
-                               error("Default not in switch");
-                       if (deflab)
-                               error("More than 1 'default'");
-                       if ((o=symbol())!=COLON)
-                               goto syntax;
-                       label(deflab = isn++);
-                       goto stmt;
-
-               case FOR:
-                       o1 = contlab;
-                       o2 = brklab;
-                       contlab = isn++;
-                       brklab = isn++;
-                       if (o=forstmt())
-                               goto syntax;
-                       label(brklab);
-                       contlab = o1;
-                       brklab = o2;
-                       return;
-
-               case ELSE:
-                       error("Inappropriate 'else'");
-                       statement();
-                       return;
-               }
-               error("Unknown keyword");
-               goto syntax;
-
-       case NAME:
-               if (nextchar()==':') {
-                       peekc = 0;
-                       o1 = csym;
-                       if (o1->hclass>0) {
-                               if (o1->hblklev==0) {
-                                       pushdecl(o1);
-                                       o1->hoffset = 0;
-                               } else {
-                                       defsym = o1;
-                                       redec();
-                                       goto stmt;
-                               }
-                       }
-                       o1->hclass = STATIC;
-                       o1->htype = ARRAY;
-                       o1->hflag =| FLABL;
-                       if (o1->hoffset==0)
-                               o1->hoffset = isn++;
-                       label(o1->hoffset);
-                       goto stmt;
-               }
-       }
-       peeksym = o;
-       rcexpr(tree());
-
-semi:
-       if ((o=symbol())==SEMI)
-               return;
-syntax:
-       error("Statement syntax");
-       errflush(o);
-}
-
-/*
- * Process a for statement.
- */
-forstmt()
-{
-       register int l, o, sline;
-       int sline1, *ss;
-       struct tnode *st;
-
-       if ((o=symbol()) != LPARN)
-               return(o);
-       if ((o=symbol()) != SEMI) {             /* init part */
-               peeksym = o;
-               rcexpr(tree());
-               if ((o=symbol()) != SEMI)
-                       return(o);
-       }
-       label(contlab);
-       if ((o=symbol()) != SEMI) {             /* test part */
-               peeksym = o;
-               cbranch(tree(), brklab, 0);
-               if ((o=symbol()) != SEMI)
-                       return(o);
-       }
-       if ((peeksym=symbol()) == RPARN) {      /* incr part */
-               peeksym = -1;
-               statement();
-               branch(contlab);
-               return(0);
-       }
-       l = contlab;
-       contlab = isn++;
-       st = tree();
-       sline = line;
-       if ((o=symbol()) != RPARN)
-               return(o);
-       ss = funcbase;
-       funcbase = curbase;
-       statement();
-       sline1 = line;
-       line = sline;
-       label(contlab);
-       rcexpr(st);
-       line = sline1;
-       if (ss < maxdecl)
-               ss = maxdecl;
-       curbase = funcbase = ss;
-       branch(l);
-       return(0);
-}
-
-/*
- * A parenthesized expression,
- * as after "if".
- */
-struct tnode *
-pexpr()
-{
-       register o, t;
-
-       if ((o=symbol())!=LPARN)
-               goto syntax;
-       t = tree();
-       if ((o=symbol())!=RPARN)
-               goto syntax;
-       return(t);
-syntax:
-       error("Statement syntax");
-       errflush(o);
-       return(0);
-}
-
-/*
- * The switch statement, which involves collecting the
- * constants and labels for the cases.
- */
-pswitch()
-{
-       register struct swtab *cswp, *sswp;
-       int dl, swlab;
-
-       cswp = sswp = swp;
-       if (swp==0)
-               cswp = swp = swtab;
-       branch(swlab=isn++);
-       dl = deflab;
-       deflab = 0;
-       statement();
-       branch(brklab);
-       label(swlab);
-       if (deflab==0)
-               deflab = brklab;
-       outcode("BNN", SWIT, deflab, line);
-       for (; cswp < swp; cswp++)
-               outcode("NN", cswp->swlab, cswp->swval);
-       outcode("0");
-       label(brklab);
-       deflab = dl;
-       swp = sswp;
-}
-
-/*
- * funchead is called at the start of each function
- * to process the arguments, which have been linked in a list.
- * This list is necessary because in
- * f(a, b) float b; int a; ...
- * the names are seen before the types.
- */
-/*
- * Structure resembling a block for a register variable.
- */
-struct hshtab  hreg    { REG, 0, 0, NULL, NULL, 0 };
-struct tnode   areg    { NAME, 0, NULL, NULL, &hreg};
-funchead()
-{
-       register pl;
-       register struct hshtab *cs;
-       struct tnode *bstack[2];
-
-       pl = STARG;
-       while(paraml) {
-               parame->hoffset = 0;
-               cs = paraml;
-               paraml = paraml->hoffset;
-               if (cs->htype==FLOAT)
-                       cs->htype = DOUBLE;
-               cs->hoffset = pl;
-               if ((cs->htype&XTYPE) == ARRAY) {
-                       cs->htype =- (ARRAY-PTR);       /* set ptr */
-                       cs->subsp++;            /* pop dims */
-               }
-               pl =+ rlength(cs);
-               if (cs->hclass==AREG && (hreg.hoffset=goodreg(cs))>=0) {
-                       bstack[0] = &areg;
-                       bstack[1] = nblock(cs);
-                       cp = &bstack[2];
-                       areg.type = cs->htype;
-                       cs->hclass = AUTO;
-                       build(ASSIGN);
-                       rcexpr(bstack[0]);
-                       cs->hoffset = hreg.hoffset;
-                       cs->hclass = REG;
-               } else
-                       cs->hclass = AUTO;
-               prste(cs);
-       }
-       for (cs=hshtab; cs<hshtab+HSHSIZ; cs++) {
-               if (cs->name[0] == '\0')
-                       continue;
-               if (cs->hclass == ARG || cs->hclass==AREG)
-                       error("Not an argument: %.8s", cs->name);
-       }
-       outcode("BN", SETREG, regvar);
-}
-
-blockhead()
-{
-       register r;
-
-       r = regvar;
-       blklev++;
-       declist(0);
-       if (r != regvar)
-               outcode("BN", SETREG, regvar);
-}
-
-/*
- * After the end of a block, delete local
- * symbols; save those that are external.
- * Also complain about undefined labels.
- */
-blkend()
-{
-       register struct hshtab *cs, *ncs;
-       struct hshtab *endcs;
-       register i;
-
-       blklev--;
-       for (cs=hshtab; cs->name[0] && cs<hshtab+HSHSIZ-1; ++cs)
-               ;
-       endcs = cs;
-       do  if (cs->name[0]) {
-               if (cs->hblklev <= blklev)
-                       continue;
-               if ((cs->hclass!=EXTERN || blklev!=0)
-                && ((cs->hflag&FLABL)==0 || blklev==0)) {
-                       if (cs->hclass==0)
-                               error("%.8s undefined", cs->name);
-                       if ((ncs = cs->hpdown)==NULL) {
-                               cs->name[0] = '\0';
-                               hshused--;
-                               cs->hflag =& FKEYW;
-                       } else {
-                               cpysymb(cs, ncs);
-                       }
-                       continue;
-               }
-               /*
-                * Retained name; must rehash.
-                */
-               for (i=0; i<NCPS; i++)
-                       symbuf[i] = cs->name[i];
-               mossym = cs->hflag&FMOS;
-               lookup();
-               if ((ncs=csym) != cs) {
-                       cs->name[0] = '\0';
-                       hshused--;
-                       i = ncs->hflag;
-                       cpysymb(ncs, cs);
-                       ncs->hflag =| i&FKEYW;
-                       cs->hflag =& FKEYW;
-               }
-               if (ncs->hblklev>1 || (ncs->hblklev>0 && ncs->hclass==EXTERN))
-                       ncs->hblklev--;
-       } while ((cs = (cs<&hshtab[HSHSIZ-1])? ++cs: hshtab) != endcs);
-}
-
-/*
- * write out special definitions of local symbols for
- * benefit of the debugger.  None of these are used
- * by the assembler except to save them.
- */
-prste(acs)
-struct hshtab *acs;
-{
-       register struct hshtab *cs;
-       register nkind;
-
-       cs = acs;
-       switch (cs->hclass) {
-       case REG:
-               nkind = RNAME;
-               break;
-
-       case AUTO:
-               nkind = ANAME;
-               break;
-
-       case STATIC:
-               nkind = SNAME;
-               break;
-
-       default:
-               return;
-
-       }
-       outcode("BSN", nkind, cs->name, cs->hoffset);
-}
-
-/*
- * In case of error, skip to the next
- * statement delimiter.
- */
-errflush(ao)
-{
-       register o;
-
-       o = ao;
-       while(o>RBRACE) /* ; { } */
-               o = symbol();
-       peeksym  = o;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c03.c b/.ref-Research-V7/usr/src/cmd/c/c03.c
deleted file mode 100644 (file)
index 993d3af..0000000
+++ /dev/null
@@ -1,695 +0,0 @@
-#
-/*
- * C compiler, phase 1
- *
- *
- * Handles processing of declarations,
- * except for top-level processing of
- * externals.
- */
-
-#include "c0.h"
-
-/*
- * Process a sequence of declaration statements
- */
-declist(sclass)
-{
-       register sc, offset;
-       struct hshtab typer;
-
-       offset = 0;
-       sc = sclass;
-       while (getkeywords(&sclass, &typer)) {
-               offset = declare(sclass, &typer, offset);
-               sclass = sc;
-       }
-       return(offset+align(INT, offset, 0));
-}
-
-/*
- * Read the keywords introducing a declaration statement
- * Store back the storage class, and fill in the type
- * entry, which looks like a hash table entry.
- */
-getkeywords(scptr, tptr)
-int *scptr;
-struct hshtab *tptr;
-{
-       register skw, tkw, longf;
-       int o, isadecl, ismos, unsignf;
-
-       isadecl = 0;
-       longf = 0;
-       unsignf = 0;
-       tptr->htype = INT;
-       tptr->hstrp = NULL;
-       tptr->hsubsp = NULL;
-       tkw = -1;
-       skw = *scptr;
-       ismos = skw==MOS||skw==MOU;
-       for (;;) {
-               mosflg = ismos && isadecl;
-               o = symbol();
-               if (o==NAME && csym->hclass==TYPEDEF && tkw<0) {
-                       tkw = csym->htype;
-                       tptr->hsubsp = csym->hsubsp;
-                       tptr->hstrp = csym->hstrp;
-                       isadecl++;
-                       continue;
-               }
-               switch (o==KEYW? cval: -1) {
-               case AUTO:
-               case STATIC:
-               case EXTERN:
-               case REG:
-               case TYPEDEF:
-                       if (skw && skw!=cval) {
-                               if (skw==ARG && cval==REG)
-                                       cval = AREG;
-                               else
-                                       error("Conflict in storage class");
-                       }
-                       skw = cval;
-                       break;
-       
-               case UNSIGN:
-                       unsignf++;
-                       break;
-
-               case LONG:
-                       longf++;
-                       break;
-
-               case ENUM:
-                       strdec(ismos, cval);
-                       cval = INT;
-                       goto types;
-
-               case UNION:
-               case STRUCT:
-                       tptr->hstrp = strdec(ismos, cval);
-                       cval = STRUCT;
-               case INT:
-               case CHAR:
-               case FLOAT:
-               case DOUBLE:
-               types:
-                       if (tkw>=0)
-                               error("Type clash");
-                       tkw = cval;
-                       break;
-       
-               default:
-                       peeksym = o;
-                       if (isadecl==0)
-                               return(0);
-                       if (tkw<0)
-                               tkw = INT;
-                       if (skw==0)
-                               skw = blklev==0? DEFXTRN: AUTO;
-                       if (unsignf) {
-                               if (tkw==INT)
-                                       tkw = UNSIGN;
-                               else
-                                       error("Misplaced 'unsigned'");
-                       }
-                       if (longf) {
-                               if (tkw==FLOAT)
-                                       tkw = DOUBLE;
-                               else if (tkw==INT)
-                                       tkw = LONG;
-                               else
-                                       error("Misplaced 'long'");
-                       }
-                       *scptr = skw;
-                       tptr->htype = tkw;
-                       return(1);
-               }
-               isadecl++;
-       }
-}
-
-/*
- * Process a structure, union, or enum declaration; a subroutine
- * of getkeywords.
- */
-struct str *
-strdec(mosf, kind)
-{
-       register elsize, o;
-       register struct hshtab *ssym;
-       int savebits;
-       struct hshtab **savememlist;
-       int savenmems;
-       struct str *strp;
-       struct hshtab *ds;
-       struct hshtab *mems[NMEMS];
-       struct hshtab typer;
-       int tagkind;
-
-       if (kind!=ENUM) {
-               tagkind = STRTAG;
-               mosflg = 1;
-       } else
-               tagkind = ENUMTAG;
-       ssym = 0;
-       if ((o=symbol())==NAME) {
-               ssym = csym;
-               mosflg = mosf;
-               o = symbol();
-               if (o==LBRACE && ssym->hblklev<blklev)
-                       pushdecl(ssym);
-               if (ssym->hclass==0) {
-                       ssym->hclass = tagkind;
-                       ssym->strp = gblock(sizeof(*strp));
-                       funcbase = curbase;
-                       ssym->strp->ssize = 0;
-                       ssym->strp->memlist = NULL;
-               }
-               if (ssym->hclass != tagkind)
-                       redec();
-               strp = ssym->strp;
-       } else {
-               strp = gblock(sizeof(*strp));
-               funcbase = curbase;
-               strp->ssize = 0;
-               strp->memlist = NULL;
-       }
-       mosflg = 0;
-       if (o != LBRACE) {
-               if (ssym==0)
-                       goto syntax;
-               if (ssym->hclass!=tagkind)
-                       error("Bad structure/union/enum name");
-               peeksym = o;
-       } else {
-               ds = defsym;
-               mosflg = 0;
-               savebits = bitoffs;
-               savememlist = memlist;
-               savenmems = nmems;
-               memlist = mems;
-               nmems = 2;
-               bitoffs = 0;
-               if (kind==ENUM) {
-                       typer.htype = INT;
-                       typer.hstrp = strp;
-                       declare(ENUM, &typer, 0);
-               } else
-                       elsize = declist(kind==UNION?MOU:MOS);
-               bitoffs = savebits;
-               defsym = ds;
-               if (strp->ssize)
-                       error("%.8s redeclared", ssym->name);
-               strp->ssize = elsize;
-               *memlist++ = NULL;
-               strp->memlist = gblock((memlist-mems)*sizeof(*memlist));
-               funcbase = curbase;
-               for (o=0; &mems[o] != memlist; o++)
-                       strp->memlist[o] = mems[o];
-               memlist = savememlist;
-               nmems = savenmems;
-               if ((o = symbol()) != RBRACE)
-                       goto syntax;
-       }
-       return(strp);
-   syntax:
-       decsyn(o);
-       return(0);
-}
-
-/*
- * Process a comma-separated list of declarators
- */
-declare(askw, tptr, offset)
-struct hshtab *tptr;
-{
-       register int o;
-       register int skw, isunion;
-
-       skw = askw;
-       isunion = 0;
-       if (skw==MOU) {
-               skw = MOS;
-               isunion++;
-               mosflg = 1;
-               if ((peeksym=symbol()) == SEMI) {
-                       o = length(tptr);
-                       if (o>offset)
-                               offset = o;
-               }
-       }
-       do {
-               if (skw==ENUM && (peeksym=symbol())==RBRACE) {
-                       o = peeksym;
-                       peeksym = -1;
-                       break;
-               }
-               o = decl1(skw, tptr, isunion?0:offset, NULL);
-               if (isunion) {
-                       o =+ align(CHAR, o, 0);
-                       if (o>offset)
-                               offset = o;
-               } else
-                       offset =+ o;
-       } while ((o=symbol()) == COMMA);
-       if (o==RBRACE) {
-               peeksym = o;
-               o = SEMI;
-       }
-       if (o!=SEMI && (o!=RPARN || skw!=ARG1))
-               decsyn(o);
-       return(offset);
-}
-
-/*
- * Process a single declarator
- */
-decl1(askw, atptr, offset, absname)
-struct hshtab *atptr, *absname;
-{
-       int t1, chkoff, a, elsize;
-       register int skw;
-       int type;
-       register struct hshtab *dsym;
-       register struct hshtab *tptr;
-       struct tdim dim;
-       struct field *fldp;
-       int *dp;
-       int isinit;
-
-       skw = askw;
-       tptr = atptr;
-       chkoff = 0;
-       mosflg = skw==MOS;
-       dim.rank = 0;
-       if (((peeksym=symbol())==SEMI || peeksym==RPARN) && absname==NULL)
-               return(0);
-       /*
-        * Filler field
-        */
-       if (peeksym==COLON && skw==MOS) {
-               peeksym = -1;
-               t1 = conexp();
-               elsize = align(tptr->htype, offset, t1);
-               bitoffs =+ t1;
-               return(elsize);
-       }
-       t1 = getype(&dim, absname);
-       if (t1 == -1)
-               return(0);
-       if (tptr->hsubsp) {
-               type = tptr->htype;
-               for (a=0; type&XTYPE;) {
-                       if ((type&XTYPE)==ARRAY)
-                               dim.dimens[dim.rank++] = tptr->hsubsp[a++];
-                       type =>> TYLEN;
-               }
-       }
-       type = tptr->htype & ~TYPE;
-       while (t1&XTYPE) {
-               if (type&BIGTYPE) {
-                       typov();
-                       type = t1 = 0;
-               }
-               type = type<<TYLEN | (t1 & XTYPE);
-               t1 =>> TYLEN;
-       }
-       type =| tptr->htype&TYPE;
-       if (absname)
-               defsym = absname;
-       dsym = defsym;
-       if (dsym->hblklev < blklev)
-               pushdecl(dsym);
-       if (dim.rank == 0)
-               dsym->subsp = NULL;
-       else {
-               dp = gblock(dim.rank*sizeof(dim.rank));
-               funcbase = curbase;
-               if (skw==EXTERN)
-                       maxdecl = curbase;
-               for (a=0; a<dim.rank; a++) {
-                       if ((t1 = dp[a] = dim.dimens[a])
-                        && (dsym->htype&XTYPE) == ARRAY
-                        && dsym->subsp[a] && t1!=dsym->subsp[a])
-                               redec();
-               }
-               dsym->subsp = dp;
-       }
-       if ((type&XTYPE) == FUNC) {
-               if (skw==AUTO)
-                       skw = EXTERN;
-               if ((skw!=EXTERN && skw!=TYPEDEF) && absname==NULL)
-                       error("Bad func. storage class");
-       }
-       if (!(dsym->hclass==0
-          || ((skw==ARG||skw==AREG) && dsym->hclass==ARG1)
-          || (skw==EXTERN && dsym->hclass==EXTERN && dsym->htype==type)))
-               if (skw==MOS && dsym->hclass==MOS && dsym->htype==type)
-                       chkoff = 1;
-               else {
-                       redec();
-                       goto syntax;
-               }
-       if (dsym->hclass && (dsym->htype&TYPE)==STRUCT && (type&TYPE)==STRUCT)
-               if (dsym->hstrp != tptr->hstrp) {
-                       error("Warning: structure redeclaration");
-                       nerror--;
-               }
-       dsym->htype = type;
-       if (tptr->hstrp)
-               dsym->hstrp = tptr->hstrp;
-       if (skw==TYPEDEF) {
-               dsym->hclass = TYPEDEF;
-               return(0);
-       }
-       if (absname)
-               return(0);
-       if (skw==ARG1) {
-               if (paraml==0)
-                       paraml = dsym;
-               else
-                       parame->hoffset = dsym;
-               parame = dsym;
-               dsym->hclass = skw;
-               return(0);
-       }
-       elsize = 0;
-       if (skw==MOS) {
-               elsize = length(dsym);
-               if ((peeksym = symbol())==COLON) {
-                       elsize = 0;
-                       peeksym = -1;
-                       t1 = conexp();
-                       a = align(type, offset, t1);
-                       if (dsym->hflag&FFIELD) {
-                               if (dsym->hstrp->bitoffs!=bitoffs
-                                || dsym->hstrp->flen!=t1)
-                                       redec();
-                       } else {
-                               dsym->hstrp = gblock(sizeof(*fldp));
-                               funcbase = curbase;
-                       }
-                       dsym->hflag =| FFIELD;
-                       dsym->hstrp->bitoffs = bitoffs;
-                       dsym->hstrp->flen = t1;
-                       bitoffs =+ t1;
-               } else
-                       a = align(type, offset, 0);
-               elsize =+ a;
-               offset =+ a;
-               if (++nmems >= NMEMS) {
-                       error("Too many structure members");
-                       nmems =- NMEMS/2;
-                       memlist =- NMEMS/2;
-               }
-               if (a)
-                       *memlist++ = &structhole;
-               if (chkoff && dsym->hoffset != offset)
-                       redec();
-               dsym->hoffset = offset;
-               *memlist++ = dsym;
-       }
-       if (skw==REG)
-               if ((dsym->hoffset = goodreg(dsym)) < 0)
-                       skw = AUTO;
-       dsym->hclass = skw;
-       isinit = 0;
-       if ((a=symbol())!=COMMA && a!=SEMI && a!=RBRACE)
-               isinit++;
-       if (a!=ASSIGN)
-               peeksym = a;
-       if (skw==AUTO) {
-       /*      if (STAUTO < 0) {       */
-                       autolen =- rlength(dsym);
-                       dsym->hoffset = autolen;
-                       if (autolen < maxauto)
-                               maxauto = autolen;
-       /*      } else {                        */
-       /*              dsym->hoffset = autolen;        */
-       /*              autolen =+ rlength(dsym);       */
-       /*              if (autolen > maxauto)          */
-       /*                      maxauto = autolen;      */
-       /*      }                       */
-               if (isinit)
-                       cinit(dsym, 0, AUTO);
-       } else if (skw==STATIC) {
-               dsym->hoffset = isn;
-               if (isinit) {
-                       outcode("BBN", DATA, LABEL, isn++);
-                       if (cinit(dsym, 1, STATIC) & ALIGN)
-                               outcode("B", EVEN);
-               } else
-                       outcode("BBNBN", BSS, LABEL, isn++, SSPACE, rlength(dsym));
-               outcode("B", PROG);
-       } else if (skw==REG && isinit)
-               cinit(dsym, 0, REG);
-       else if (skw==ENUM) {
-               if (type!=INT)
-                       error("Illegal enumeration %.8s", dsym->name);
-               dsym->hclass = ENUMCON;
-               dsym->hoffset = offset;
-               if (isinit)
-                       cinit(dsym, 0, ENUMCON);
-               elsize = dsym->hoffset-offset+1;
-       }
-       prste(dsym);
-syntax:
-       return(elsize);
-}
-
-/*
- * Push down an outer-block declaration
- * after redeclaration in an inner block.
- */
-pushdecl(asp)
-struct phshtab *asp;
-{
-       register struct phshtab *sp, *nsp;
-
-       sp = asp;
-       nsp = gblock(sizeof(*nsp));
-       maxdecl = funcbase = curbase;
-       cpysymb(nsp, sp);
-       sp->hclass = 0;
-       sp->hflag =& (FKEYW|FMOS);
-       sp->htype = 0;
-       sp->hoffset = 0;
-       sp->hblklev = blklev;
-       sp->hpdown = nsp;
-}
-
-/*
- * Copy the non-name part of a symbol
- */
-cpysymb(s1, s2)
-struct phshtab *s1, *s2;
-{
-       register struct phshtab *rs1, *rs2;
-
-       rs1 = s1;
-       rs2 = s2;
-       rs1->hclass = rs2->hclass;
-       rs1->hflag = rs2->hflag;
-       rs1->htype = rs2->htype;
-       rs1->hoffset = rs2->hoffset;
-       rs1->hsubsp = rs2->hsubsp;
-       rs1->hstrp = rs2->hstrp;
-       rs1->hblklev = rs2->hblklev;
-       rs1->hpdown = rs2->hpdown;
-}
-
-
-/*
- * Read a declarator and get the implied type
- */
-getype(adimp, absname)
-struct tdim *adimp;
-struct hshtab *absname;
-{
-       static struct hshtab argtype;
-       int type;
-       register int o;
-       register struct hshtab *ds;
-       register struct tdim *dimp;
-
-       ds = defsym;
-       dimp = adimp;
-       type = 0;
-       switch(o=symbol()) {
-
-       case TIMES:
-               type = getype(dimp, absname);
-               if (type==-1)
-                       return(type);
-               if (type&BIGTYPE) {
-                       typov();
-                       type = 0;
-               }
-               return(type<<TYLEN | PTR);
-
-       case LPARN:
-               if (absname==NULL || nextchar()!=')') {
-                       type = getype(dimp, absname);
-                       if (type==-1)
-                               return(type);
-                       ds = defsym;
-                       if ((o=symbol()) != RPARN)
-                               goto syntax;
-                       goto getf;
-               }
-
-       default:
-               peeksym = o;
-               if (absname) {
-                       defsym = ds = absname;
-                       absname = NULL;
-                       goto getf;
-               }
-               break;
-
-       case NAME:
-               defsym = ds = csym;
-       getf:
-               switch(o=symbol()) {
-
-               case LPARN:
-                       if (blklev==0) {
-                               blklev++;
-                               ds = defsym;
-                               declare(ARG1, &argtype, 0);
-                               defsym = ds;
-                               blklev--;
-                       } else
-                               if ((o=symbol()) != RPARN)
-                                       goto syntax;
-                       if (type&BIGTYPE) {
-                               typov();
-                               type = 0;
-                       }
-                       type = type<<TYLEN | FUNC;
-                       goto getf;
-
-               case LBRACK:
-                       if (dimp->rank>=5) {
-                               error("Rank too large");
-                               dimp->rank = 4;
-                       }
-                       if ((o=symbol()) != RBRACK) {
-                               peeksym = o;
-                               cval = conexp();
-                               defsym = ds;
-                               if ((o=symbol())!=RBRACK)
-                                       goto syntax;
-                       } else {
-                               if (dimp->rank!=0)
-                                       error("Null dimension");
-                               cval = 0;
-                       }
-                       dimp->dimens[dimp->rank++] = cval;
-                       if (type&BIGTYPE) {
-                               typov();
-                               type = 0;
-                       }
-                       type = type<<TYLEN | ARRAY;
-                       goto getf;
-               }
-               peeksym = o;
-               return(type);
-       }
-syntax:
-       decsyn(o);
-       return(-1);
-}
-
-/*
- * More bits required for type than allowed.
- */
-typov()
-{
-       error("Type is too complicated");
-}
-
-/*
- * Enforce alignment restrictions in structures,
- * including bit-field considerations.
- */
-align(type, offset, aflen)
-{
-       register a, t, flen;
-       char *ftl;
-
-       flen = aflen;
-       a = offset;
-       t = type;
-       ftl = "Field too long";
-       if (flen==0) {
-               a =+ (NBPC+bitoffs-1) / NBPC;
-               bitoffs = 0;
-       }
-       while ((t&XTYPE)==ARRAY)
-               t = decref(t);
-       if (t!=CHAR) {
-               a = (a+ALIGN) & ~ALIGN;
-               if (a>offset)
-                       bitoffs = 0;
-       }
-       if (flen) {
-               if (type==INT || type==UNSIGN) {
-                       if (flen > NBPW)
-                               error(ftl);
-                       if (flen+bitoffs > NBPW) {
-                               bitoffs = 0;
-                               a =+ NCPW;
-                       }
-               } else if (type==CHAR) {
-                       if (flen > NBPC)
-                               error(ftl);
-                       if (flen+bitoffs > NBPC) {
-                               bitoffs = 0;
-                               a =+ 1;
-                       }
-               } else
-                       error("Bad type for field");
-       }
-       return(a-offset);
-}
-
-/*
- * Complain about syntax error in declaration
- */
-decsyn(o)
-{
-       error("Declaration syntax");
-       errflush(o);
-}
-
-/*
- * Complain about a redeclaration
- */
-redec()
-{
-       error("%.8s redeclared", defsym->name);
-}
-
-/*
- * Determine if a variable is suitable for storage in
- * a register; if so return the register number
- */
-goodreg(hp)
-struct hshtab *hp;
-{
-       int type;
-
-       type = hp->htype;
-       /*
-        * Special dispensation for unions
-        */
-       if (type==STRUCT && length(hp)<=SZINT)
-               type = INT;
-       if ((type!=INT && type!=CHAR && type!=UNSIGN && (type&XTYPE)==0)
-        || (type&XTYPE)>PTR || regvar<3)
-               return(-1);
-       return(--regvar);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c04.c b/.ref-Research-V7/usr/src/cmd/c/c04.c
deleted file mode 100644 (file)
index 9667ffa..0000000
+++ /dev/null
@@ -1,428 +0,0 @@
-#
-/*
- * C compiler
- *
- *
- */
-
-#include "c0.h"
-
-/*
- * Reduce the degree-of-reference by one.
- * e.g. turn "ptr-to-int" into "int".
- */
-decref(at)
-{
-       register t;
-
-       t = at;
-       if ((t & ~TYPE) == 0) {
-               error("Illegal indirection");
-               return(t);
-       }
-       return((t>>TYLEN) & ~TYPE | t&TYPE);
-}
-
-/*
- * Increase the degree of reference by
- * one; e.g. turn "int" to "ptr-to-int".
- */
-incref(t)
-{
-       return(((t&~TYPE)<<TYLEN) | (t&TYPE) | PTR);
-}
-
-/*
- * Make a tree that causes a branch to lbl
- * if the tree's value is non-zero together with the cond.
- */
-cbranch(t, lbl, cond)
-struct tnode *t;
-{
-       treeout(t, 0);
-       outcode("BNNN", CBRANCH, lbl, cond, line);
-}
-
-/*
- * Write out a tree.
- */
-rcexpr(atp)
-struct tnode *atp;
-{
-       register struct tnode *tp;
-
-       /*
-        * Special optimization
-        */
-       if ((tp=atp)->op==INIT && tp->tr1->op==CON) {
-               if (tp->type==CHAR) {
-                       outcode("B1N0", BDATA, tp->tr1->value);
-                       return;
-               } else if (tp->type==INT || tp->type==UNSIGN) {
-                       outcode("BN", SINIT, tp->tr1->value);
-                       return;
-               }
-       }
-       treeout(tp, 0);
-       outcode("BN", EXPR, line);
-}
-
-treeout(atp, isstruct)
-struct tnode *atp;
-{
-       register struct tnode *tp;
-       register struct hshtab *hp;
-       register nextisstruct;
-
-       if ((tp = atp) == 0) {
-               outcode("B", NULLOP);
-               return;
-       }
-       nextisstruct = tp->type==STRUCT;
-       switch(tp->op) {
-
-       case NAME:
-               hp = tp->tr1;
-               if (hp->hclass==TYPEDEF)
-                       error("Illegal use of type name");
-               outcode("BNN", NAME, hp->hclass==0?STATIC:hp->hclass, tp->type);
-               if (hp->hclass==EXTERN)
-                       outcode("S", hp->name);
-               else
-                       outcode("N", hp->hoffset);
-               break;
-
-       case LCON:
-               outcode("BNNN", tp->op, tp->type, tp->lvalue);
-               break;
-
-       case CON:
-               outcode("BNN", tp->op, tp->type, tp->value);
-               break;
-
-       case FCON:
-               outcode("BNF", tp->op, tp->type, tp->cstr);
-               break;
-
-       case STRING:
-               outcode("BNNN", NAME, STATIC, tp->type, tp->tr1);
-               break;
-
-       case FSEL:
-               treeout(tp->tr1, nextisstruct);
-               outcode("BNNN",tp->op,tp->type,tp->tr2->bitoffs,tp->tr2->flen);
-               break;
-
-       case ETYPE:
-               error("Illegal use of type");
-               break;
-
-       case AMPER:
-               treeout(tp->tr1, 1);
-               outcode("BN", tp->op, tp->type);
-               break;
-
-
-       case CALL:
-               treeout(tp->tr1, 1);
-               treeout(tp->tr2, 0);
-               outcode("BN", CALL, tp->type);
-               break;
-
-       default:
-               treeout(tp->tr1, nextisstruct);
-               if (opdope[tp->op]&BINARY)
-                       treeout(tp->tr2, nextisstruct);
-               outcode("BN", tp->op, tp->type);
-               break;
-       }
-       if (nextisstruct && isstruct==0)
-               outcode("BNN", STRASG, STRUCT, tp->strp->ssize);
-}
-
-/*
- * Generate a branch
- */
-branch(lab)
-{
-       outcode("BN", BRANCH, lab);
-}
-
-/*
- * Generate a label
- */
-label(l)
-{
-       outcode("BN", LABEL, l);
-}
-
-/*
- * ap is a tree node whose type
- * is some kind of pointer; return the size of the object
- * to which the pointer points.
- */
-plength(ap)
-struct tname *ap;
-{
-       register t, l;
-       register struct tnode *p;
-
-       p = ap;
-       if (p==0 || ((t=p->type)&~TYPE) == 0)           /* not a reference */
-               return(1);
-       p->type = decref(t);
-       l = length(p);
-       p->type = t;
-       return(l);
-}
-
-/*
- * return the number of bytes in the object
- * whose tree node is acs.
- */
-length(acs)
-struct tnode *acs;
-{
-       register t, elsz;
-       long n;
-       register struct tnode *cs;
-       int nd;
-
-       cs = acs;
-       t = cs->type;
-       n = 1;
-       nd = 0;
-       while ((t&XTYPE) == ARRAY) {
-               t = decref(t);
-               n =* cs->subsp[nd++];
-       }
-       if ((t&~TYPE)==FUNC)
-               return(0);
-       if (t>=PTR)
-               elsz = SZPTR;
-       else switch(t&TYPE) {
-
-       case INT:
-       case UNSIGN:
-               elsz = SZINT;
-               break;
-
-       case CHAR:
-               elsz = 1;
-               break;
-
-       case FLOAT:
-               elsz = SZFLOAT;
-               break;
-
-       case LONG:
-               elsz = SZLONG;
-               break;
-
-       case DOUBLE:
-               elsz = SZDOUB;
-               break;
-
-       case STRUCT:
-               if ((elsz = cs->strp->ssize) == 0)
-                       error("Undefined structure");
-               break;
-       default:
-               error("Compiler error (length)");
-               return(0);
-       }
-       n *= elsz;
-       if (n >= (unsigned)50000) {
-               error("Warning: very large data structure");
-               nerror--;
-       }
-       return(n);
-}
-
-/*
- * The number of bytes in an object, rounded up to a word.
- */
-rlength(cs)
-struct tnode *cs;
-{
-       return((length(cs)+ALIGN) & ~ALIGN);
-}
-
-/*
- * After an "if (...) goto", look to see if the transfer
- * is to a simple label.
- */
-simplegoto()
-{
-       register struct hshtab *csp;
-
-       if ((peeksym=symbol())==NAME && nextchar()==';') {
-               csp = csym;
-               if (csp->hblklev == 0)
-                       pushdecl(csp);
-               if (csp->hclass==0 && csp->htype==0) {
-                       csp->htype = ARRAY;
-                       csp->hflag =| FLABL;
-                       if (csp->hoffset==0)
-                               csp->hoffset = isn++;
-               }
-               if ((csp->hclass==0||csp->hclass==STATIC)
-                &&  csp->htype==ARRAY) {
-                       peeksym = -1;
-                       return(csp->hoffset);
-               }
-       }
-       return(0);
-}
-
-/*
- * Return the next non-white-space character
- */
-nextchar()
-{
-       while (spnextchar()==' ')
-               peekc = 0;
-       return(peekc);
-}
-
-/*
- * Return the next character, translating all white space
- * to blank and handling line-ends.
- */
-spnextchar()
-{
-       register c;
-
-       if ((c = peekc)==0)
-               c = getchar();
-       if (c=='\t' || c=='\014')       /* FF */
-               c = ' ';
-       else if (c=='\n') {
-               c = ' ';
-               if (inhdr==0)
-                       line++;
-               inhdr = 0;
-       } else if (c=='\001') { /* SOH, insert marker */
-               inhdr++;
-               c = ' ';
-       }
-       peekc = c;
-       return(c);
-}
-
-/*
- * is a break or continue legal?
- */
-chconbrk(l)
-{
-       if (l==0)
-               error("Break/continue error");
-}
-
-/*
- * The goto statement.
- */
-dogoto()
-{
-       register struct tnode *np;
-
-       *cp++ = tree();
-       build(STAR);
-       chkw(np = *--cp, -1);
-       rcexpr(block(JUMP,0,NULL,NULL,np));
-}
-
-/*
- * The return statement, which has to convert
- * the returned object to the function's type.
- */
-doret()
-{
-       register struct tnode *t;
-
-       if (nextchar() != ';') {
-               t = tree();
-               *cp++ = &funcblk;
-               *cp++ = t;
-               build(ASSIGN);
-               cp[-1] = cp[-1]->tr2;
-               if (funcblk.type==CHAR)
-                       cp[-1] = block(ITOC, INT, NULL, NULL, cp[-1]);
-               build(RFORCE);
-               rcexpr(*--cp);
-       }
-       branch(retlab);
-}
-
-/*
- * Write a character on the error output.
- */
-/*
- * Coded output:
- *   B: beginning of line; an operator
- *   N: a number
- *   S: a symbol (external)
- *   1: number 1
- *   0: number 0
- */
-outcode(s, a)
-char *s;
-{
-       register *ap;
-       register FILE *bufp;
-       int n;
-       register char *np;
-
-       bufp = stdout;
-       if (strflg)
-               bufp = sbufp;
-       ap = &a;
-       for (;;) switch(*s++) {
-       case 'B':
-               putc(*ap++, bufp);
-               putc(0376, bufp);
-               continue;
-
-       case 'N':
-               putc(*ap, bufp);
-               putc(*ap++>>8, bufp);
-               continue;
-
-       case 'F':
-               n = 1000;
-               np = *ap++;
-               goto str;
-
-       case 'S':
-               n = NCPS;
-               np = *ap++;
-               if (*np)
-                       putc('_', bufp);
-       str:
-               while (n-- && *np) {
-                       putc(*np++&0177, bufp);
-               }
-               putc(0, bufp);
-               continue;
-
-       case '1':
-               putc(1, bufp);
-               putc(0, bufp);
-               continue;
-
-       case '0':
-               putc(0, bufp);
-               putc(0, bufp);
-               continue;
-
-       case '\0':
-               if (ferror(bufp)) {
-                       error("Write error on temp");
-                       exit(1);
-               }
-               return;
-
-       default:
-               error("Botch in outcode");
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c05.c b/.ref-Research-V7/usr/src/cmd/c/c05.c
deleted file mode 100644 (file)
index 9e39061..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-#
-#include "c0.h"
-/*
- *  info on operators:
- *   01-- is binary operator
- *   02-- left (or only) operand must be lvalue
- *   04-- is relational operator
- *  010-- is assignment-type operator
- *  020-- non-float req. on left
- *  040-- non-float req. on right
- * 0100-- is commutative
- * 0200-- is right, not left-associative
- * 0400-- is leaf of tree
- * *0XX000-- XX is priority of operator
- */
-int opdope[] {
-       000000, /* EOFC */
-       000000, /* ; */
-       000000, /* { */
-       000000, /* } */
-       036000, /* [ */
-       002000, /* ] */
-       037000, /* ( */
-       002000, /* ) */
-       014201, /* : */
-       007001, /* , */
-       000001, /* field selection */
-       034201, /* CAST */
-       000000, /* ETYPE */
-       000001, /* integer->ptr */
-       000001, /* ptr->integer */
-       000001, /* long->ptr */
-       000000, /* 16 */
-       000000, /* 17 */
-       000000, /* 18 */
-       000000, /* 19 */
-       000400, /* name */
-       000400, /* short constant */
-       000400, /* string */
-       000400, /* float */
-       000400, /* double */
-       000400, /* long constant */
-       000400, /* long constant <= 16 bits */
-       000000, /* 27 */
-       000000, /* 28 */
-       000000, /* 29 */
-       034203, /* ++pre */
-       034203, /* --pre */
-       034203, /* ++post */
-       034203, /* --post */
-       034200, /* !un */
-       034202, /* &un */
-       034220, /* *un */
-       034200, /* -un */
-       034220, /* ~un */
-       036001, /* . (structure reference) */
-       030101, /* + */
-       030001, /* - */
-       032101, /* * */
-       032001, /* / */
-       032001, /* % */
-       026061, /* >> */
-       026061, /* << */
-       020161, /* & */
-       017161, /* | */
-       017161, /* ^ */
-       036001, /* -> */
-       000000, /* int -> double */
-       000000, /* double -> int */
-       016001, /* && */
-       015001, /* || */
-       030001, /* &~ */
-       000000, /* 56 */
-       000000, /* 57 */
-       000000, /* 58 */
-       000000, /* 59 */
-       022005, /* == */
-       022005, /* != */
-       024005, /* <= */
-       024005, /* < */
-       024005, /* >= */
-       024005, /* > */
-       024005, /* <p */
-       024005, /* <=p */
-       024005, /* >p */
-       024005, /* >=p */
-       012213, /* =+ */
-       012213, /* =- */
-       012213, /* =* */
-       012213, /* =/ */
-       012213, /* =% */
-       012253, /* =>> */
-       012253, /* =<< */
-       012253, /* =& */
-       012253, /* =| */
-       012253, /* =^ */
-       012213, /* = */
-       000000, /* 81 */
-       000000, /* 82 */
-       000000, /* 83 */
-       000000, /* 84 */
-       000000, /* 85 */
-       000000, /* 86 */
-       000000, /* 87 */
-       000000, /* 88 */
-       000000, /* 89 */
-       014201, /* ? */
-       034200, /* sizeof */
-       000000, /* 92 */
-       021101, /* min */
-       021101, /* minp */
-       021101, /* max */
-       021101, /* maxp */
-       007001, /* , */
-       000000, /* 98 */
-       000000, /* 99 */
-       036001, /* call */
-       036001, /* mcall */
-       000000, /* goto */
-       000000, /* jump cond */
-       000000, /* branch cond */
-       000000, /* 105 */
-       000000, /* 106 */
-       000000, /* 107 */
-       000000, /* 108 */
-       000000, /* char->int */
-       000000  /* force r0 */
-};
-
-/*
- * conversion table:
- * FTI: float (or double) to integer
- * ITF: integer to float
- * ITP: integer to pointer
- * ITL: integer to long
- * LTI: long to integer
- * LTF: long to float
- * FTL: float to long
- * PTI: pointer to integer
- * LTP: long to ptr (ptr[long])
- * XX: usually illegal
- * When FTI, LTI, FTL are added in they specify
- * that it is the left operand that should be converted.
- * For + this is done and the conversion is turned back into
- * ITF, ITL, LTF.
- * For = however the left operand can't be converted
- * and the specified conversion is applied to the rhs.
- */
-char cvtab[4][4] {
-/*             int     double          long            ptr */
-/* int */      0,      (FTI<<4)+ITF,   (LTI<<4)+ITL,   (ITP<<4)+ITP,   
-/* double */   ITF,    0,              LTF,            XX,
-/* long */     ITL,    (FTL<<4)+LTF,   0,              (LTP<<4)+LTP,
-/* ptr */      ITP,    XX,             LTP,            PTI,
-};
-
-/*
- * relate conversion numbers to operators
- */
-char   cvntab[] {
-       0, ITOF, ITOL, LTOF, ITOP, PTOI, FTOI, LTOI, FTOL, LTOP,
-};
-
-/*
- * character type table
- */
-char ctab[] {
-       EOFC,   INSERT, UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,
-       UNKN,   SPACE,  NEWLN,  SPACE,  SPACE,  UNKN,   UNKN,   UNKN,
-       UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,
-       UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,   UNKN,
-       SPACE,  EXCLA,  DQUOTE, SHARP,  UNKN,   MOD,    AND,    SQUOTE,
-       LPARN,  RPARN,  TIMES,  PLUS,   COMMA,  MINUS,  PERIOD, DIVIDE,
-       DIGIT,  DIGIT,  DIGIT,  DIGIT,  DIGIT,  DIGIT,  DIGIT,  DIGIT,
-       DIGIT,  DIGIT,  COLON,  SEMI,   LESS,   ASSIGN, GREAT,  QUEST,
-       UNKN,   LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER,
-       LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER,
-       LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER,
-       LETTER, LETTER, LETTER, LBRACK, BSLASH, RBRACK, EXOR,   LETTER,
-       UNKN,   LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER,
-       LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER,
-       LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER, LETTER,
-       LETTER, LETTER, LETTER, LBRACE, OR,     RBRACE, COMPL,  UNKN
-};
diff --git a/.ref-Research-V7/usr/src/cmd/c/c1.h b/.ref-Research-V7/usr/src/cmd/c/c1.h
deleted file mode 100644 (file)
index 2faa6f4..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-/*
- * C code generator header
- */
-
-#include <stdio.h>
-
-#define        LTYPE   long    /* change to int for no long consts */
-#define        NCPS    8
-#define        NULL    0
-
-/*
- *  Tree node for unary and binary
- */
-struct tnode {
-       int     op;
-       int     type;
-       int     degree;
-       struct  tnode *tr1, *tr2;
-};
-
-/*
- * tree names for locals
- */
-struct tname {
-       int     op;
-       int     type;
-       char    class;
-       char    regno;
-       int     offset;
-       int     nloc;
-};
-
-/*
- * tree names for externals
- */
-struct xtname {
-       int     op;
-       int     type;
-       char    class;
-       char    regno;
-       int     offset;
-       char    name[NCPS];
-};
-
-struct tconst {
-       int     op;
-       int     type;
-       int     value;
-};
-
-/*
- * long constants
- */
-struct lconst {
-       int     op;
-       int     type;
-       LTYPE   lvalue;
-};
-
-struct ftconst {
-       int     op;
-       int     type;
-       int     value;
-       double  fvalue;
-};
-
-/*
- * Node used for field assignemnts
- */
-struct fasgn {
-       int     op;
-       int     type;
-       int     degree;
-       struct  tnode *tr1, *tr2;
-       int     mask;
-};
-
-struct optab {
-       char    tabdeg1;
-       char    tabtyp1;
-       char    tabdeg2;
-       char    tabtyp2;
-       char    *tabstring;
-};
-
-struct table {
-       int     tabop;
-       struct  optab *tabp;
-};
-
-struct instab {
-       int     iop;
-       char    *str1;
-       char    *str2;
-};
-
-struct swtab {
-       int     swlab;
-       int     swval;
-};
-
-char   maprel[];
-char   notrel[];
-int    nreg;
-int    isn;
-int    namsiz;
-int    line;
-int    nerror;
-struct table   cctab[];
-struct table   efftab[];
-struct table   regtab[];
-struct table   sptab[];
-struct table   lsptab[1];
-struct instab  instab[];
-struct instab  branchtab[];
-int    opdope[];
-char   *opntab[];
-int    nstack;
-int    nfloat;
-struct tname   sfuncr;
-char   *funcbase;
-char   *curbase;
-char   *coremax;
-struct tconst czero, cone;
-struct ftconst fczero;
-long   totspace;
-/*
- * Some special stuff for long comparisons
- */
-int    xlab1, xlab2, xop, xzero;
-
-/*
-       operators
-*/
-#define        EOFC    0
-#define        SEMI    1
-#define        LBRACE  2
-#define        RBRACE  3
-#define        LBRACK  4
-#define        RBRACK  5
-#define        LPARN   6
-#define        RPARN   7
-#define        COLON   8
-#define        COMMA   9
-#define        FSEL    10
-#define        FSELR   11
-#define        FSELT   12
-#define        FSELA   16
-#define        ULSH    17
-#define        ASULSH  18
-
-#define        KEYW    19
-#define        NAME    20
-#define        CON     21
-#define        STRING  22
-#define        FCON    23
-#define        SFCON   24
-#define        LCON    25
-#define        SLCON   26
-
-#define        AUTOI   27
-#define        AUTOD   28
-#define        INCBEF  30
-#define        DECBEF  31
-#define        INCAFT  32
-#define        DECAFT  33
-#define        EXCLA   34
-#define        AMPER   35
-#define        STAR    36
-#define        NEG     37
-#define        COMPL   38
-
-#define        DOT     39
-#define        PLUS    40
-#define        MINUS   41
-#define        TIMES   42
-#define        DIVIDE  43
-#define        MOD     44
-#define        RSHIFT  45
-#define        LSHIFT  46
-#define        AND     47
-#define        ANDN    55
-#define        OR      48
-#define        EXOR    49
-#define        ARROW   50
-#define        ITOF    51
-#define        FTOI    52
-#define        LOGAND  53
-#define        LOGOR   54
-#define        FTOL    56
-#define        LTOF    57
-#define        ITOL    58
-#define        LTOI    59
-#define        ITOP    13
-#define        PTOI    14
-#define        LTOP    15
-
-#define        EQUAL   60
-#define        NEQUAL  61
-#define        LESSEQ  62
-#define        LESS    63
-#define        GREATEQ 64
-#define        GREAT   65
-#define        LESSEQP 66
-#define        LESSP   67
-#define        GREATQP 68
-#define        GREATP  69
-
-#define        ASPLUS  70
-#define        ASMINUS 71
-#define        ASTIMES 72
-#define        ASDIV   73
-#define        ASMOD   74
-#define        ASRSH   75
-#define        ASLSH   76
-#define        ASAND   77
-#define        ASOR    78
-#define        ASXOR   79
-#define        ASSIGN  80
-#define        TAND    81
-#define        LTIMES  82
-#define        LDIV    83
-#define        LMOD    84
-#define        ASANDN  85
-#define        LASTIMES 86
-#define        LASDIV  87
-#define        LASMOD  88
-
-#define        QUEST   90
-#define        MAX     93
-#define        MAXP    94
-#define        MIN     95
-#define        MINP    96
-#define        LLSHIFT 91
-#define        ASLSHL  92
-#define        SEQNC   97
-#define        CALL1   98
-#define        CALL2   99
-#define        CALL    100
-#define        MCALL   101
-#define        JUMP    102
-#define        CBRANCH 103
-#define        INIT    104
-#define        SETREG  105
-#define        LOAD    106
-#define        ITOC    109
-#define        RFORCE  110
-
-/*
- * Intermediate code operators
- */
-#define        BRANCH  111
-#define        LABEL   112
-#define        NLABEL  113
-#define        RLABEL  114
-#define        STRASG  115
-#define        STRSET  116
-#define        BDATA   200
-#define        PROG    202
-#define        DATA    203
-#define        BSS     204
-#define        CSPACE  205
-#define        SSPACE  206
-#define        SYMDEF  207
-#define        SAVE    208
-#define        RETRN   209
-#define        EVEN    210
-#define        PROFIL  212
-#define        SWIT    213
-#define        EXPR    214
-#define        SNAME   215
-#define        RNAME   216
-#define        ANAME   217
-#define        NULLOP  218
-#define        SETSTK  219
-#define        SINIT   220
-#define        GLOBAL  221
-#define        C3BRANCH        222
-
-/*
- *     types
- */
-#define        INT     0
-#define        CHAR    1
-#define        FLOAT   2
-#define        DOUBLE  3
-#define        STRUCT  4
-#define        RSTRUCT 5
-#define        LONG    6
-#define        UNSIGN  7
-
-#define        TYLEN   2
-#define        TYPE    07
-#define        XTYPE   (03<<3)
-#define        PTR     010
-#define        FUNC    020
-#define        ARRAY   030
-
-/*
-       storage classes
-*/
-#define        KEYWC   1
-#define        MOS     10
-#define        AUTO    11
-#define        EXTERN  12
-#define        STATIC  13
-#define        REG     14
-#define        STRTAG  15
-#define        ARG     16
-#define        OFFS    20
-#define        XOFFS   21
-#define        SOFFS   22
-
-/*
-       Flag    bits
-*/
-
-#define        BINARY  01
-#define        LVALUE  02
-#define        RELAT   04
-#define        ASSGOP  010
-#define        LWORD   020
-#define        RWORD   040
-#define        COMMUTE 0100
-#define        RASSOC  0200
-#define        LEAF    0400
-#define        CNVRT   01000
diff --git a/.ref-Research-V7/usr/src/cmd/c/c10.c b/.ref-Research-V7/usr/src/cmd/c/c10.c
deleted file mode 100644 (file)
index 229391b..0000000
+++ /dev/null
@@ -1,1200 +0,0 @@
-#
-/*
-
-               C compiler, part 2
-
-
-*/
-
-#include "c1.h"
-
-#define        dbprint(op)     /* */
-#ifdef DEBUG
-#define        dbprint(op)     printf("        / %s", opntab[op])
-#endif
-
-char   maprel[] {      EQUAL, NEQUAL, GREATEQ, GREAT, LESSEQ,
-                       LESS, GREATQP, GREATP, LESSEQP, LESSP
-};
-
-char   notrel[] {      NEQUAL, EQUAL, GREAT, GREATEQ, LESS,
-                       LESSEQ, GREATP, GREATQP, LESSP, LESSEQP
-};
-
-struct tconst czero { CON, INT, 0};
-struct tconst cone  { CON, INT, 1};
-
-struct tname sfuncr { NAME, STRUCT, STATIC, 0, 0, 0 };
-
-struct table   *cregtab;
-
-int    nreg    3;
-int    isn     10000;
-
-main(argc, argv)
-char *argv[];
-{
-
-       if (argc<4) {
-               error("Arg count");
-               exit(1);
-       }
-       if (freopen(argv[1], "r", stdin)==NULL) {
-               error("Missing temp file");
-               exit(1);
-       }
-       if ((freopen(argv[3], "w", stdout)) == NULL) {
-               error("Can't create %s", argv[3]);
-               exit(1);
-       }
-       funcbase = curbase = coremax = sbrk(0);
-       getree();
-       /*
-        * If any floating-point instructions
-        * were used, generate a reference that
-        * pulls in the floating-point part of printf.
-        */
-       if (nfloat)
-               printf(".globl  fltused\n");
-       /*
-        * tack on the string file.
-        */
-       printf(".globl\n.data\n");
-       if (*argv[2] != '-') {
-               if (freopen(argv[2], "r", stdin)==NULL) {
-                       error("Missing temp file");
-                       exit(1);
-               }
-               getree();
-       }
-       if (totspace >= (unsigned)56000) {
-               error("Warning: possibly too much data");
-               nerror--;
-       }
-       exit(nerror!=0);
-}
-
-/*
- * Given a tree, a code table, and a
- * count of available registers, find the code table
- * for the appropriate operator such that the operands
- * are of the right type and the number of registers
- * required is not too large.
- * Return a ptr to the table entry or 0 if none found.
- */
-char *
-match(atree, table, nrleft, nocvt)
-struct tnode *atree;
-struct table *table;
-{
-#define        NOCVL   1
-#define        NOCVR   2
-       int op, d1, d2, dope;
-       struct tnode *p2;
-       register struct tnode *p1, *tree;
-       register struct optab *opt;
-
-       if ((tree=atree)==0)
-               return(0);
-       if (table==lsptab)
-               table = sptab;
-       if ((op = tree->op)==0)
-               return(0);
-       dope = opdope[op];
-       if ((dope&LEAF) == 0)
-               p1 = tree->tr1;
-       else
-               p1 = tree;
-       d1 = dcalc(p1, nrleft);
-       if ((dope&BINARY)!=0) {
-               p2 = tree->tr2;
-               /*
-                * If a subtree starts off with a conversion operator,
-                * try for a match with the conversion eliminated.
-                * E.g. int = double can be done without generating
-                * the converted int in a register by
-                * movf double,fr0; movfi fr0,int .
-                */
-               if (opdope[p2->op]&CNVRT && (nocvt&NOCVR)==0
-                        && (opdope[p2->tr1->op]&CNVRT)==0) {
-                       tree->tr2 = p2->tr1;
-                       if (opt = match(tree, table, nrleft, NOCVL))
-                               return(opt);
-                       tree->tr2 = p2;
-               } else if (opdope[p1->op]&CNVRT && (nocvt&NOCVL)==0
-                && (opdope[p1->tr1->op]&CNVRT)==0) {
-                       tree->tr1 = p1->tr1;
-                       if (opt = match(tree, table, nrleft, NOCVR))
-                               return(opt);
-                       tree->tr1 = p1;
-               }
-               d2 = dcalc(p2, nrleft);
-       }
-       for (; table->op!=op; table++)
-               if (table->op==0)
-                       return(0);
-       for (opt = table->tabp; opt->tabdeg1!=0; opt++) {
-               if (d1 > (opt->tabdeg1&077)
-                || (opt->tabdeg1 >= 0100 && (p1->op != STAR)))
-                       continue;
-               if (notcompat(p1, opt->tabtyp1, op)) {
-                       continue;
-               }
-               if ((opdope[op]&BINARY)!=0 && p2!=0) {
-                       if (d2 > (opt->tabdeg2&077)
-                        || (opt->tabdeg2 >= 0100) && (p2->op != STAR) )
-                               continue;
-                       if (notcompat(p2,opt->tabtyp2, 0))
-                               continue;
-               }
-               return(opt);
-       }
-       return(0);
-}
-
-/*
- * Given a tree, a code table, and a register,
- * produce code to evaluate the tree with the appropriate table.
- * Registers reg and upcan be used.
- * If there is a value, it is desired that it appear in reg.
- * The routine returns the register in which the value actually appears.
- * This routine must work or there is an error.
- * If the table called for is cctab, sptab, or efftab,
- * and tree can't be done using the called-for table,
- * another try is made.
- * If the tree can't be compiled using cctab, regtab is
- * used and a "tst" instruction is produced.
- * If the tree can't be compiled using sptab,
- * regtab is used and the register is pushed on the stack.
- * If the tree can't be compiled using efftab,
- * just use regtab.
- * Regtab must succeed or an "op not found" error results.
- *
- * A number of special cases are recognized, and
- * there is an interaction with the optimizer routines.
- */
-rcexpr(atree, atable, reg)
-struct tnode *atree;
-struct table *atable;
-{
-       register r;
-       int modf, nargs, recurf;
-       register struct tnode *tree;
-       register struct table *table;
-
-       table = atable;
-       recurf = 0;
-       if (reg<0) {
-               recurf++;
-               reg = ~reg;
-               if (reg>=020) {
-                       reg =- 020;
-                       recurf++;
-               }
-       }
-again:
-       if((tree=atree)==0)
-               return(0);
-       if (opdope[tree->op]&RELAT && tree->tr2->op==CON && tree->tr2->value==0
-        && table==cctab)
-               tree = atree = tree->tr1;
-       /*
-        * fieldselect(...) : in efftab mode,
-        * ignore the select, otherwise
-        * do the shift and mask.
-        */
-       if (tree->op == FSELT) {
-               if (table==efftab)
-                       atree = tree = tree->tr1;
-               else {
-                       tree->op = FSEL;
-                       atree = tree = optim(tree);
-               }
-       }
-       switch (tree->op)  {
-
-       /*
-        * Structure assignments
-        */
-       case STRASG:
-               strasg(tree);
-               return(0);
-
-       /*
-        * An initializing expression
-        */
-       case INIT:
-               tree = optim(tree);
-               doinit(tree->type, tree->tr1);
-               return(0);
-
-       /*
-        * Put the value of an expression in r0,
-        * for a switch or a return
-        */
-       case RFORCE:
-               tree = tree->tr1;
-               if((r=rcexpr(tree, regtab, reg)) != 0)
-                       movreg(r, 0, tree);
-               return(0);
-
-       /*
-        * sequential execution
-        */
-       case SEQNC:
-               r = nstack;
-               rcexpr(tree->tr1, efftab, reg);
-               nstack = r;
-               atree = tree = tree->tr2;
-               goto again;
-
-       /*
-        * In the generated &~ operator,
-        * fiddle things so a PDP-11 "bit"
-        * instruction will be produced when cctab is used.
-        */
-       case ANDN:
-               if (table==cctab) {
-                       tree->op = TAND;
-                       tree->tr2 = optim(tnode(COMPL, tree->type, tree->tr2));
-               }
-               break;
-
-       /*
-        * Handle a subroutine call. It has to be done
-        * here because if cexpr got called twice, the
-        * arguments might be compiled twice.
-        * There is also some fiddling so the
-        * first argument, in favorable circumstances,
-        * goes to (sp) instead of -(sp), reducing
-        * the amount of stack-popping.
-        */
-       case CALL:
-               r = 0;
-               nargs = 0;
-               modf = 0;
-               if (tree->tr1->op!=NAME || tree->tr1->class!=EXTERN) {
-                       nargs++;
-                       nstack++;
-               }
-               tree = tree->tr2;
-               if(tree->op) {
-                       while (tree->op==COMMA) {
-                               r =+ comarg(tree->tr2, &modf);
-                               tree = tree->tr1;
-                               nargs++;
-                       }
-                       r =+ comarg(tree, &modf);
-                       nargs++;
-               }
-               tree = atree;
-               tree->op = CALL2;
-               if (modf && tree->tr1->op==NAME && tree->tr1->class==EXTERN)
-                       tree->op = CALL1;
-               if (cexpr(tree, regtab, reg)<0)
-                       error("compiler botch: call");
-               popstk(r);
-               nstack =- nargs;
-               if (table==efftab || table==regtab)
-                       return(0);
-               r = 0;
-               goto fixup;
-
-       /*
-        * Longs need special treatment.
-        */
-       case ASLSH:
-       case LSHIFT:
-               if (tree->type==LONG) {
-                       if (tree->tr2->op==ITOL)
-                               tree->tr2 = tree->tr2->tr1;
-                       else
-                               tree->tr2 = optim(tnode(LTOI,INT,tree->tr2));
-                       if (tree->op==ASLSH)
-                               tree->op = ASLSHL;
-                       else
-                               tree->op = LLSHIFT;
-               }
-               break;
-
-       /*
-        * Try to change * to shift.
-        */
-       case TIMES:
-       case ASTIMES:
-               tree = pow2(tree);
-       }
-       /*
-        * Try to find postfix ++ and -- operators that can be
-        * pulled out and done after the rest of the expression
-        */
-       if (table!=cctab && table!=cregtab && recurf<2
-        && (opdope[tree->op]&LEAF)==0) {
-               if (r=delay(&atree, table, reg)) {
-                       tree = atree;
-                       table = efftab;
-                       reg = r-1;
-               }
-       }
-       /*
-        * Basically, try to reorder the computation
-        * so  reg = x+y  is done as  reg = x; reg =+ y
-        */
-       if (recurf==0 && reorder(&atree, table, reg)) {
-               if (table==cctab && atree->op==NAME)
-                       return(reg);
-       }
-       tree = atree;
-       if (table==efftab && tree->op==NAME)
-               return(reg);
-       if ((r=cexpr(tree, table, reg))>=0)
-               return(r);
-       if (table!=regtab && (table!=cctab||(opdope[tree->op]&RELAT)==0)) {
-               if((r=cexpr(tree, regtab, reg))>=0) {
-       fixup:
-                       modf = isfloat(tree);
-                       dbprint(tree->op);
-                       if (table==sptab || table==lsptab) {
-                               if (tree->type==LONG) {
-                                       printf("mov\tr%d,-(sp)\n",r+1);
-                                       nstack++;
-                               }
-                               printf("mov%c   r%d,%c(sp)\n", modf, r,
-                                       table==sptab? '-':0);
-                               nstack++;
-                       }
-                       if (table==cctab)
-                               printf("tst%c   r%d\n", modf, r);
-                       return(r);
-               }
-       }
-       /*
-        * There's a last chance for this operator
-        */
-       if (tree->op==LTOI) {
-               r = rcexpr(tree->tr1, regtab, reg);
-               if (r >= 0) {
-                       r++;
-                       goto fixup;
-               }
-       }
-       if (tree->type == STRUCT)
-               error("Illegal operation on structure");
-       else if (tree->op>0 && tree->op<RFORCE && opntab[tree->op])
-               error("No code table for op: %s", opntab[tree->op]);
-       else
-               error("No code table for op %d", tree->op);
-       return(reg);
-}
-
-/*
- * Try to compile the tree with the code table using
- * registers areg and up.  If successful,
- * return the register where the value actually ended up.
- * If unsuccessful, return -1.
- *
- * Most of the work is the macro-expansion of the
- * code table.
- */
-cexpr(atree, table, areg)
-struct tnode *atree;
-struct table *table;
-{
-       int c, r;
-       register struct tnode *p, *p1, *tree;
-       struct table *ctable;
-       struct tnode *p2;
-       char *string;
-       int reg, reg1, rreg, flag, opd;
-       char *opt;
-
-       tree = atree;
-       reg = areg;
-       p1 = tree->tr2;
-       c = tree->op;
-       opd = opdope[c];
-       /*
-        * When the value of a relational or a logical expression is
-        * desired, more work must be done.
-        */
-       if ((opd&RELAT||c==LOGAND||c==LOGOR||c==EXCLA) && table!=cctab) {
-               cbranch(tree, c=isn++, 1, reg);
-               rcexpr(&czero, table, reg);
-               branch(isn, 0);
-               label(c);
-               rcexpr(&cone, table, reg);
-               label(isn++);
-               return(reg);
-       }
-       if(c==QUEST) {
-               if (table==cctab)
-                       return(-1);
-               cbranch(tree->tr1, c=isn++, 0, reg);
-               flag = nstack;
-               rreg = rcexpr(p1->tr1, table, reg);
-               nstack = flag;
-               branch(r=isn++, 0);
-               label(c);
-               reg = rcexpr(p1->tr2, table, rreg);
-               if (rreg!=reg)
-                       movreg(reg, rreg, tree->tr2);
-               label(r);
-               return(rreg);
-       }
-       reg = oddreg(tree, reg);
-       reg1 = reg+1;
-       /*
-        * long values take 2 registers.
-        */
-       if ((tree->type==LONG||opd&RELAT&&tree->tr1->type==LONG) && tree->op!=ITOL)
-               reg1++;
-       /*
-        * Leaves of the expression tree
-        */
-       if ((r = chkleaf(tree, table, reg)) >= 0)
-               return(r);
-       /*
-        * x + (-1) is better done as x-1.
-        */
-
-       if ((tree->op==PLUS||tree->op==ASPLUS) &&
-           (p1=tree->tr2)->op == CON && p1->value == -1) {
-               p1->value = 1;
-               tree->op =+ (MINUS-PLUS);
-       }
-       /*
-        * Because of a peculiarity of the PDP11 table
-        * char = *intreg++ and *--intreg cannot go through.
-        */
-       if (tree->tr1->type==CHAR && tree->tr2->type!=CHAR
-        && (tree->tr2->op==AUTOI||tree->tr2->op==AUTOD))
-               tree->tr2 = tnode(LOAD, tree->tr2->type, tree->tr2);
-       if (table==cregtab)
-               table = regtab;
-       /*
-        * The following peculiar code depends on the fact that
-        * if you just want the codition codes set, efftab
-        * will generate the right code unless the operator is
-        * a shift or
-        * postfix ++ or --. Unravelled, if the table is
-        * cctab and the operator is not special, try first
-        * for efftab;  if the table isn't, if the operator is,
-        * or the first match fails, try to match
-        * with the table actually asked for.
-        */
-       /*
-        * Account for longs and oddregs; below is really
-        * r = nreg - reg - (reg-areg) - (reg1-reg-1);
-        */
-       r = nreg - reg + areg - reg1 + 1;
-       if (table!=cctab || c==INCAFT || c==DECAFT || tree->type==LONG
-        || c==ASRSH || c==ASLSH || c==ASULSH
-        || (opt = match(tree, efftab, r, 0)) == 0)
-               if ((opt=match(tree, table, r, 0))==0)
-                       return(-1);
-       string = opt->tabstring;
-       p1 = tree->tr1;
-       if (p1->op==FCON && p1->value>0) {
-               printf(".data\nL%d:%o;%o;%o;%o\n.text\n", p1->value, p1->fvalue);
-               p1->value = -p1->value;
-       }
-       p2 = 0;
-       if (opdope[tree->op]&BINARY) {
-               p2 = tree->tr2;
-               if (p2->op==FCON && p2->value>0) {
-                       printf(".data\nL%d:%o;%o;%o;%o\n.text\n", p2->value, p2->fvalue);
-                       p2->value = -p2->value;
-               }
-       }
-loop:
-       /*
-        * The 0200 bit asks for a tab.
-        */
-       if ((c = *string++) & 0200) {
-               c =& 0177;
-               putchar('\t');
-       }
-       switch (c) {
-
-       case '\n':
-               dbprint(tree->op);
-               break;
-
-       case '\0':
-               if (!isfloat(tree))
-                       if (tree->op==DIVIDE||tree->op==ASDIV||tree->op==PTOI)
-                               reg--;
-               return(reg);
-
-       /* A1 */
-       case 'A':
-               p = p1;
-               goto adr;
-
-       /* A2 */
-       case 'B':
-               p = p2;
-               goto adr;
-
-       adr:
-               c = 0;
-               while (*string=='\'') {
-                       c++;
-                       string++;
-               }
-               if (*string=='+') {
-                       c = 100;
-                       string++;
-               }
-               pname(p, c);
-               goto loop;
-
-       /* I */
-       case 'M':
-               if ((c = *string)=='\'')
-                       string++;
-               else
-                       c = 0;
-               prins(tree->op, c, instab);
-               goto loop;
-
-       /* B1 */
-       case 'C':
-               if ((opd&LEAF) != 0)
-                       p = tree;
-               else
-                       p = p1;
-               goto pbyte;
-
-       /* BF */
-       case 'P':
-               p = tree;
-               goto pb1;
-
-       /* B2 */
-       case 'D':
-               p = p2;
-       pbyte:
-               if (p->type==CHAR)
-                       putchar('b');
-       pb1:
-               if (isfloat(p))
-                       putchar('f');
-               goto loop;
-
-       /* BE */
-       case 'L':
-               if (p1->type==CHAR || p2->type==CHAR)
-                       putchar('b');
-               p = tree;
-               goto pb1;
-
-       /* F */
-       case 'G':
-               p = p1;
-               flag = 01;
-               goto subtre;
-
-       /* S */
-       case 'K':
-               p = p2;
-               flag = 02;
-               goto subtre;
-
-       /* H */
-       case 'H':
-               p = tree;
-               flag = 04;
-
-       subtre:
-               ctable = regtab;
-               if (flag&04)
-                       ctable = cregtab;
-               c = *string++ - 'A';
-               if (*string=='!') {
-                       string++;
-                       c =| 020;       /* force right register */
-               }
-               if ((c&02)!=0)
-                       ctable = sptab;
-               if ((c&04)!=0)
-                       ctable = cctab;
-               if ((flag&01) && ctable==regtab && (c&01)==0
-                 && (tree->op==DIVIDE||tree->op==MOD
-                  || tree->op==ASDIV||tree->op==ASMOD||tree->op==ITOL))
-                       ctable = cregtab;
-               if ((c&01)!=0) {
-                       p = p->tr1;
-                       if(collcon(p) && ctable!=sptab) {
-                               if (p->op==STAR)
-                                       p = p->tr1;
-                               p = p->tr1;
-                       }
-               }
-               if (table==lsptab && ctable==sptab)
-                       ctable = lsptab;
-               if (c&010)
-                       r = reg1;
-               else
-                       if (opdope[p->op]&LEAF || p->degree < 2)
-                               r = reg;
-                       else
-                               r = areg;
-               rreg = rcexpr(p, ctable, r);
-               if (ctable!=regtab && ctable!=cregtab)
-                       goto loop;
-               if (c&010) {
-                       if (c&020 && rreg!=reg1)
-                               movreg(rreg, reg1, p);
-                       else
-                               reg1 = rreg;
-               } else if (rreg!=reg)
-                       if ((c&020)==0 && oddreg(tree, 0)==0 && tree->type!=LONG
-                       && (flag&04
-                         || flag&01&&xdcalc(p2,nreg-rreg-1)<=(opt->tabdeg2&077)
-                         || flag&02&&xdcalc(p1,nreg-rreg-1)<=(opt->tabdeg1&077))) {
-                               reg = rreg;
-                               reg1 = rreg+1;
-                       } else
-                               movreg(rreg, reg, p);
-               goto loop;
-
-       /* R */
-       case 'I':
-               r = reg;
-               if (*string=='-') {
-                       string++;
-                       r--;
-               }
-               goto preg;
-
-       /* R1 */
-       case 'J':
-               r = reg1;
-       preg:
-               if (*string=='+') {
-                       string++;
-                       r++;
-               }
-               if (r>nreg || r>=4 && tree->type==DOUBLE)
-                       error("Register overflow: simplify expression");
-               printf("r%d", r);
-               goto loop;
-
-       case '-':               /* check -(sp) */
-               if (*string=='(') {
-                       nstack++;
-                       if (table!=lsptab)
-                               putchar('-');
-                       goto loop;
-               }
-               break;
-
-       case ')':               /* check (sp)+ */
-               putchar(')');
-               if (*string=='+')
-                       nstack--;
-               goto loop;
-
-       /* #1 */
-       case '#':
-               p = p1->tr1;
-               goto nmbr;
-
-       /* #2 */
-       case '"':
-               p = p2->tr1;
-
-       nmbr:
-               if(collcon(p)) {
-                       if (p->op==STAR) {
-                               printf("*");
-                               p = p->tr1;
-                       }
-                       if ((p = p->tr2)->op == CON) {
-                               if (p->value)
-                                       psoct(p->value);
-                       } else if (p->op==AMPER)
-                               pname(p->tr1, 0);
-               }
-               goto loop;
-
-       /*
-        * Certain adjustments for / % and PTOI
-        */
-       case 'T':
-               c = reg-1;
-               if (tree->op == PTOI) {
-                       printf("bic     r%d,r%d\nsbc    r%d\n", c,c,c);
-                       goto loop;
-               }
-               if (p1->type==UNSIGN || p1->type&XTYPE) {
-                       printf("clr     r%d\n", c);
-                       goto loop;
-               }
-               if (dcalc(p1, 5)>12 && !match(p1, cctab, 10, 0))
-                       printf("tst     r%d\n", reg);
-               printf("sxt     r%d\n", c);
-               goto loop;
-
-       case 'V':       /* adc sbc, clr, or sxt as required for longs */
-               switch(tree->op) {
-               case PLUS:
-               case ASPLUS:
-               case INCBEF:
-               case INCAFT:
-                       printf("adc");
-                       break;
-
-               case MINUS:
-               case ASMINUS:
-               case NEG:
-               case DECBEF:
-               case DECAFT:
-                       printf("sbc");
-                       break;
-
-               case ASSIGN:
-                       p = tree->tr2;
-                       goto lcasev;
-
-               case ASDIV:
-               case ASMOD:
-               case ASULSH:
-                       p = tree->tr1;
-               lcasev:
-                       if (p->type!=LONG) {
-                               if (p->type==UNSIGN || p->type&XTYPE)
-                                       printf("clr");
-                               else
-                                       printf("sxt");
-                               goto loop;
-                       }
-               default:
-                       while ((c = *string++)!='\n' && c!='\0');
-                       break;
-               }
-               goto loop;
-
-       /*
-        * Mask used in field assignments
-        */
-       case 'Z':
-               printf("$%o", tree->mask);
-               goto loop;
-
-       /*
-        * Relational on long values.
-        * Might bug out early. E.g.,
-        * (long<0) can be determined with only 1 test.
-        */
-       case 'X':
-               if (xlongrel(*string++ - '0'))
-                       return(reg);
-               goto loop;
-       }
-       putchar(c);
-       goto loop;
-}
-
-/*
- * This routine just calls sreorder (below)
- * on the subtrees and then on the tree itself.
- * It returns non-zero if anything changed.
- */
-reorder(treep, table, reg)
-struct tnode **treep;
-struct table *table;
-{
-       register r, o;
-       register struct tnode *p;
-
-       p = *treep;
-       o = p->op;
-       if (opdope[o]&LEAF || o==LOGOR || o==LOGAND)
-               return(0);
-       while(sreorder(&p->tr1, regtab, reg, 1))
-               ;
-       if (opdope[o]&BINARY) 
-               while(sreorder(&p->tr2, regtab, reg, 1))
-                       ;
-       r = 0;
-       if (table!=cctab)
-       while (sreorder(treep, table, reg, 0))
-               r++;
-       *treep = optim(*treep);
-       return(r);
-}
-
-/*
- * Basically this routine carries out two kinds of optimization.
- * First, it observes that "x + (reg = y)" where actually
- * the = is any assignment op is better done as "reg=y; x+reg".
- * In this case rcexpr is called to do the first part and the
- * tree is modified so the name of the register
- * replaces the assignment.
- * Moreover, expressions like "reg = x+y" are best done as
- * "reg = x; reg =+ y" (so long as "reg" and "y" are not the same!).
- */
-sreorder(treep, table, reg, recurf)
-struct tnode **treep;
-struct table *table;
-{
-       register struct tnode *p, *p1;
-
-       p = *treep;
-       if (opdope[p->op]&LEAF)
-               return(0);
-       if (p->op==PLUS && recurf)
-               if (reorder(&p->tr2, table, reg))
-                       *treep = p = optim(p);
-       p1 = p->tr1;
-       if (p->op==STAR || p->op==PLUS) {
-               if (recurf && reorder(&p->tr1, table, reg))
-                       *treep = p = optim(p);
-               p1 = p->tr1;
-       }
-       if (p1->op==NAME) switch(p->op) {
-               case ASLSH:
-               case ASRSH:
-               case ASSIGN:
-                       if (p1->class != REG||p1->type==CHAR||isfloat(p->tr2))
-                               return(0);
-                       if (p->op==ASSIGN) switch (p->tr2->op) {
-                       case TIMES:
-                               if (!ispow2(p->tr2))
-                                       break;
-                               p->tr2 = pow2(p->tr2);
-                       case PLUS:
-                       case MINUS:
-                       case AND:
-                       case ANDN:
-                       case OR:
-                       case EXOR:
-                       case LSHIFT:
-                       case RSHIFT:
-                               p1 = p->tr2->tr2;
-                               if (xdcalc(p1, 16) > 12
-                                || p1->op==NAME
-                                &&(p1->nloc==p->tr1->nloc
-                                 || p1->regno==p->tr1->nloc))
-                                       return(0);
-                               p1 = p->tr2;
-                               p->tr2 = p1->tr1;
-                               if (p1->tr1->op!=NAME
-                                || p1->tr1->class!=REG
-                                || p1->tr1->nloc!=p->tr1->nloc)
-                                       rcexpr(p, efftab, reg);
-                               p->tr2 = p1->tr2;
-                               p->op = p1->op + ASPLUS - PLUS;
-                               *treep = p;
-                               return(1);
-                       }
-                       goto OK;
-
-               case ASTIMES:
-                       if (!ispow2(p))
-                               return(0);
-               case ASPLUS:
-               case ASMINUS:
-               case ASAND:
-               case ASANDN:
-               case ASOR:
-               case ASXOR:
-               case INCBEF:
-               case DECBEF:
-               OK:
-                       if (table==cctab||table==cregtab)
-                               reg =+ 020;
-                       rcexpr(optim(p), efftab, ~reg);
-                       *treep = p1;
-                       return(1);
-       }
-       return(0);
-}
-
-/*
- * Delay handles postfix ++ and -- 
- * It observes that "x + y++" is better
- * treated as "x + y; y++".
- * If the operator is ++ or -- itself,
- * it calls rcexpr to load the operand, letting
- * the calling instance of rcexpr to do the
- * ++ using efftab.
- * Otherwise it uses sdelay to search for inc/dec
- * among the operands.
- */
-delay(treep, table, reg)
-struct tnode **treep;
-{
-       register struct tnode *p, *p1;
-       register r;
-
-       p = *treep;
-       if ((p->op==INCAFT||p->op==DECAFT)
-        && p->tr1->op==NAME) {
-               return(1+rcexpr(p->tr1, table, reg));
-       }
-       p1 = 0;
-       if (opdope[p->op]&BINARY) {
-               if (p->op==LOGAND || p->op==LOGOR)
-                       return(0);
-               }
-               p1 = sdelay(&p->tr2);
-       if (p1==0)
-               p1 = sdelay(&p->tr1);
-       if (p1) {
-               r = rcexpr(optim(p), table, reg);
-               *treep = p1;
-               return(r+1);
-       }
-       return(0);
-}
-
-sdelay(ap)
-struct tnode **ap;
-{
-       register struct tnode *p, *p1;
-
-       p = *ap;
-       if ((p->op==INCAFT||p->op==DECAFT) && p->tr1->op==NAME) {
-               *ap = ncopy(p->tr1);
-               return(p);
-       }
-       if (p->op==STAR || p->op==PLUS)
-               if (p1=sdelay(&p->tr1))
-                       return(p1);
-       if (p->op==PLUS)
-               return(sdelay(&p->tr2));
-       return(0);
-}
-
-/*
- * Copy a tree node for a register variable.
- * Used by sdelay because if *reg-- is turned
- * into *reg; reg-- the *reg will in turn
- * be changed to some offset class, accidentally
- * modifying the reg--.
- */
-ncopy(ap)
-struct tname *ap;
-{
-       register struct tname *p, *q;
-
-       p = ap;
-       if (p->class!=REG)
-               return(p);
-       q = getblk(sizeof(*p));
-       q->op = p->op;
-       q->type = p->type;
-       q->class = p->class;
-       q->offset = p->offset;
-       q->nloc = p->nloc;
-       return(q);
-}
-
-/*
- * If the tree can be immediately loaded into a register,
- * produce code to do so and return success.
- */
-chkleaf(atree, table, reg)
-struct tnode *atree;
-{
-       struct tnode lbuf;
-       register struct tnode *tree;
-
-       tree = atree;
-       if (tree->op!=STAR && dcalc(tree, nreg-reg) > 12)
-               return(-1);
-       lbuf.op = LOAD;
-       lbuf.type = tree->type;
-       lbuf.degree = tree->degree;
-       lbuf.tr1 = tree;
-       return(rcexpr(&lbuf, table, reg));
-}
-
-/*
- * Compile a function argument.
- * If the stack is currently empty, put it in (sp)
- * rather than -(sp); this will save a pop.
- * Return the number of bytes pushed,
- * for future popping.
- */
-comarg(atree, flagp)
-int *flagp;
-{
-       register struct tnode *tree;
-       register retval;
-       int i;
-       int size;
-
-       tree = atree;
-       if (tree->op==STRASG) {
-               size = tree->mask;
-               tree = tree->tr1;
-               tree = strfunc(tree);
-               if (size <= 2) {
-                       setype(tree, INT);
-                       goto normal;
-               }
-               if (size <= 4) {
-                       setype(tree, LONG);
-                       goto normal;
-               }
-               if (tree->op!=NAME && tree->op!=STAR) {
-                       error("Unimplemented structure assignment");
-                       return(0);
-               }
-               tree = tnode(AMPER, STRUCT+PTR, tree);
-               tree = tnode(PLUS, STRUCT+PTR, tree, tconst(size, INT));
-               tree = optim(tree);
-               retval = rcexpr(tree, regtab, 0);
-               size =>> 1;
-               if (size <= 5) {
-                       for (i=0; i<size; i++)
-                               printf("mov     -(r%d),-(sp)\n", retval);
-               } else {
-                       if (retval!=0)
-                               printf("mov     r%d,r0\n", retval);
-                       printf("mov     $%o,r1\n", size);
-                       printf("L%d:mov -(r0),-(sp)\ndec\tr1\njne\tL%d\n", isn, isn);
-                       isn++;
-               }
-               nstack++;
-               return(size*2);
-       }
-normal:
-       if (nstack || isfloat(tree) || tree->type==LONG) {
-               rcexpr(tree, sptab, 0);
-               retval = arlength(tree->type);
-       } else {
-               (*flagp)++;
-               rcexpr(tree, lsptab, 0);
-               retval = 0;
-       }
-       return(retval);
-}
-
-struct tnode *
-strfunc(atp)
-struct tnode *atp;
-{
-       register struct tnode *tp;
-
-       tp = atp;
-       if (tp->op != CALL)
-               return(tp);
-       setype(tp, STRUCT+PTR);
-       return(tnode(STAR, STRUCT, tp));
-}
-
-/*
- * Compile an initializing expression
- */
-doinit(atype, atree)
-struct tnode *atree;
-{
-       register struct tnode *tree;
-       register int type;
-       float sfval;
-       double fval;
-       long lval;
-
-       tree = atree;
-       type = atype;
-       if (type==CHAR) {
-               printf(".byte ");
-               if (tree->type&XTYPE)
-                       goto illinit;
-               type = INT;
-       }
-       if (type&XTYPE)
-               type = INT;
-       switch (type) {
-       case INT:
-       case UNSIGN:
-               if (tree->op==FTOI) {
-                       if (tree->tr1->op!=FCON && tree->tr1->op!=SFCON)
-                               goto illinit;
-                       tree = tree->tr1;
-                       tree->value = tree->fvalue;
-                       tree->op = CON;
-               } else if (tree->op==LTOI) {
-                       if (tree->tr1->op!=LCON)
-                               goto illinit;
-                       tree = tree->tr1;
-                       lval = tree->lvalue;
-                       tree->op = CON;
-                       tree->value = lval;
-               }
-               if (tree->op == CON)
-                       printf("%o\n", tree->value);
-               else if (tree->op==AMPER) {
-                       pname(tree->tr1, 0);
-                       putchar('\n');
-               } else
-                       goto illinit;
-               return;
-
-       case DOUBLE:
-       case FLOAT:
-               if (tree->op==ITOF) {
-                       if (tree->tr1->op==CON) {
-                               fval = tree->tr1->value;
-                       } else
-                               goto illinit;
-               } else if (tree->op==FCON || tree->op==SFCON)
-                       fval = tree->fvalue;
-               else if (tree->op==LTOF) {
-                       if (tree->tr1->op!=LCON)
-                               goto illinit;
-                       fval = tree->tr1->lvalue;
-               } else
-                       goto illinit;
-               if (type==FLOAT) {
-                       sfval = fval;
-                       printf("%o; %o\n", sfval);
-               } else
-                       printf("%o; %o; %o; %o\n", fval);
-               return;
-
-       case LONG:
-               if (tree->op==FTOL) {
-                       tree = tree->tr1;
-                       if (tree->op==SFCON)
-                               tree->op = FCON;
-                       if (tree->op!= FCON)
-                               goto illinit;
-                       lval = tree->fvalue;
-               } else if (tree->op==ITOL) {
-                       if (tree->tr1->op != CON)
-                               goto illinit;
-                       lval = tree->tr1->value;
-               } else if (tree->op==LCON)
-                       lval = tree->lvalue;
-               else
-                       goto illinit;
-               printf("%o; %o\n", lval);
-               return;
-       }
-illinit:
-       error("Illegal initialization");
-}
-
-movreg(r0, r1, tree)
-struct tnode *tree;
-{
-       register char *s;
-
-       if (r0==r1)
-               return;
-       if (tree->type==LONG) {
-               s = "mov        r%d,r%d\nmov    r%d,r%d\n";
-               if (r0 < r1)
-                       printf(s, r0+1,r1+1,r0,r1);
-               else
-                       printf(s, r0,r1,r0+1,r1+1);
-               return;
-       }
-       printf("mov%c   r%d,r%d\n", isfloat(tree), r0, r1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c11.c b/.ref-Research-V7/usr/src/cmd/c/c11.c
deleted file mode 100644 (file)
index 332b66c..0000000
+++ /dev/null
@@ -1,1167 +0,0 @@
-#
-/*
- *  C compiler
- */
-
-#include "c1.h"
-
-max(a, b)
-{
-       if (a>b)
-               return(a);
-       return(b);
-}
-
-degree(at)
-struct tnode *at;
-{
-       register struct tnode *t, *t1;
-
-       if ((t=at)==0 || t->op==0)
-               return(0);
-       if (t->op == CON)
-               return(-3);
-       if (t->op == AMPER)
-               return(-2);
-       if (t->op==ITOL) {
-               if ((t1 = isconstant(t)) && (t1->value>=0 || t1->type==UNSIGN))
-                       return(-2);
-               if ((t1=t->tr1)->type==UNSIGN && opdope[t1->op]&LEAF)
-                       return(-1);
-       }
-       if ((opdope[t->op] & LEAF) != 0) {
-               if (t->type==CHAR || t->type==FLOAT)
-                       return(1);
-               return(0);
-       }
-       return(t->degree);
-}
-
-pname(ap, flag)
-struct tnode *ap;
-{
-       register i;
-       register struct tnode *p;
-       struct { int intx[2]; };
-
-       p = ap;
-loop:
-       switch(p->op) {
-
-       case LCON:
-               printf("$%o", flag>10? p->lvalue.intx[1]:p->lvalue.intx[0]);
-               return;
-
-       case SFCON:
-       case CON:
-               printf("$");
-               psoct(p->value);
-               return;
-
-       case FCON:
-               printf("L%d", (p->value>0? p->value: -p->value));
-               return;
-
-       case NAME:
-               i = p->offset;
-               if (flag>10)
-                       i =+ 2;
-               if (i) {
-                       psoct(i);
-                       if (p->class!=OFFS)
-                               putchar('+');
-                       if (p->class==REG)
-                               regerr();
-               }
-               switch(p->class) {
-
-               case SOFFS:
-               case XOFFS:
-                       pbase(p);
-
-               case OFFS:
-                       printf("(r%d)", p->regno);
-                       return;
-
-               case EXTERN:
-               case STATIC:
-                       pbase(p);
-                       return;
-
-               case REG:
-                       printf("r%d", p->nloc);
-                       return;
-
-               }
-               error("Compiler error: pname");
-               return;
-
-       case AMPER:
-               putchar('$');
-               p = p->tr1;
-               if (p->op==NAME && p->class==REG)
-                       regerr();
-               goto loop;
-
-       case AUTOI:
-               printf("(r%d)%c", p->nloc, flag==1?0:'+');
-               return;
-
-       case AUTOD:
-               printf("%c(r%d)", flag==2?0:'-', p->nloc);
-               return;
-
-       case STAR:
-               p = p->tr1;
-               putchar('*');
-               goto loop;
-
-       }
-       error("pname called illegally");
-}
-
-regerr()
-{
-       error("Illegal use of register");
-}
-
-pbase(ap)
-struct tnode *ap;
-{
-       register struct tnode *p;
-
-       p = ap;
-       if (p->class==SOFFS || p->class==STATIC)
-               printf("L%d", p->nloc);
-       else
-               printf("%.8s", &(p->nloc));
-}
-
-xdcalc(ap, nrleft)
-struct tnode *ap;
-{
-       register struct tnode *p;
-       register d;
-
-       p = ap;
-       d = dcalc(p, nrleft);
-       if (d<20 && p->type==CHAR) {
-               if (nrleft>=1)
-                       d = 20;
-               else
-                       d = 24;
-       }
-       return(d);
-}
-
-dcalc(ap, nrleft)
-struct tnode *ap;
-{
-       register struct tnode *p, *p1;
-
-       if ((p=ap)==0)
-               return(0);
-       switch (p->op) {
-
-       case NAME:
-               if (p->class==REG)
-                       return(9);
-
-       case AMPER:
-       case FCON:
-       case LCON:
-       case AUTOI:
-       case AUTOD:
-               return(12);
-
-       case CON:
-       case SFCON:
-               if (p->value==0)
-                       return(4);
-               if (p->value==1)
-                       return(5);
-               if (p->value > 0)
-                       return(8);
-               return(12);
-
-       case STAR:
-               p1 = p->tr1;
-               if (p1->op==NAME||p1->op==CON||p1->op==AUTOI||p1->op==AUTOD)
-                       if (p->type!=LONG)
-                               return(12);
-       }
-       if (p->type==LONG)
-               nrleft--;
-       return(p->degree <= nrleft? 20: 24);
-}
-
-notcompat(ap, ast, op)
-struct tnode *ap;
-{
-       register at, st;
-       register struct tnode *p;
-
-       p = ap;
-       at = p->type;
-       st = ast;
-       if (st==0)              /* word, byte */
-               return(at!=CHAR && at!=INT && at!=UNSIGN && at<PTR);
-       if (st==1)              /* word */
-               return(at!=INT && at!=UNSIGN && at<PTR);
-       if (st==9 && (at&XTYPE))
-               return(0);
-       st =- 2;
-       if ((at&(~(TYPE+XTYPE))) != 0)
-               at = 020;
-       if ((at&(~TYPE)) != 0)
-               at = at&TYPE | 020;
-       if (st==FLOAT && at==DOUBLE)
-               at = FLOAT;
-       if (p->op==NAME && p->class==REG && op==ASSIGN && st==CHAR)
-               return(0);
-       return(st != at);
-}
-
-prins(op, c, itable)
-struct instab *itable;
-{
-       register struct instab *insp;
-       register char *ip;
-
-       for (insp=itable; insp->op != 0; insp++) {
-               if (insp->op == op) {
-                       ip = c? insp->str2: insp->str1;
-                       if (ip==0)
-                               break;
-                       printf("%s", ip);
-                       return;
-               }
-       }
-       error("No match' for op %d", op);
-}
-
-collcon(ap)
-struct tnode *ap;
-{
-       register op;
-       register struct tnode *p;
-
-       p = ap;
-       if (p->op==STAR) {
-               if (p->type==LONG+PTR) /* avoid *x(r); *x+2(r) */
-                       return(0);
-               p = p->tr1;
-       }
-       if (p->op==PLUS) {
-               op = p->tr2->op;
-               if (op==CON || op==AMPER)
-                       return(1);
-       }
-       return(0);
-}
-
-isfloat(at)
-struct tnode *at;
-{
-       register struct tnode *t;
-
-       t = at;
-       if ((opdope[t->op]&RELAT)!=0)
-               t = t->tr1;
-       if (t->type==FLOAT || t->type==DOUBLE) {
-               nfloat = 1;
-               return('f');
-       }
-       return(0);
-}
-
-oddreg(t, areg)
-struct tnode *t;
-{
-       register reg;
-
-       reg = areg;
-       if (!isfloat(t)) {
-               if (opdope[t->op]&RELAT) {
-                       if (t->tr1->type==LONG)
-                               return((reg+1) & ~01);
-                       return(reg);
-               }
-               switch(t->op) {
-               case LLSHIFT:
-               case ASLSHL:
-                       return((reg+1)&~01);
-
-               case DIVIDE:
-               case MOD:
-               case ASDIV:
-               case ASMOD:
-               case PTOI:
-               case ULSH:
-               case ASULSH:
-                       reg++;
-
-               case TIMES:
-               case ASTIMES:
-                       return(reg|1);
-               }
-       }
-       return(reg);
-}
-
-arlength(t)
-{
-       if (t>=PTR)
-               return(2);
-       switch(t) {
-
-       case INT:
-       case CHAR:
-       case UNSIGN:
-               return(2);
-
-       case LONG:
-               return(4);
-
-       case FLOAT:
-       case DOUBLE:
-               return(8);
-       }
-       return(1024);
-}
-
-/*
- * Strings for switch code.
- */
-
-char   dirsw[] {"\
-cmp    r0,$%o\n\
-jhi    L%d\n\
-asl    r0\n\
-jmp    *L%d(r0)\n\
-.data\n\
-L%d:\
-" };
-
-char   hashsw[] {"\
-mov    r0,r1\n\
-clr    r0\n\
-div    $%o,r0\n\
-asl    r1\n\
-jmp    *L%d(r1)\n\
-.data\n\
-L%d:\
-"};
-
-/*
- * If the unsigned casts below won't compile,
- * try using the calls to lrem and ldiv.
- */
-
-pswitch(afp, alp, deflab)
-struct swtab *afp, *alp;
-{
-       int ncase, i, j, tabs, worst, best, range;
-       register struct swtab *swp, *fp, *lp;
-       int *poctab;
-
-       fp = afp;
-       lp = alp;
-       if (fp==lp) {
-               printf("jbr     L%d\n", deflab);
-               return;
-       }
-       isn++;
-       if (sort(fp, lp))
-               return;
-       ncase = lp-fp;
-       lp--;
-       range = lp->swval - fp->swval;
-       /* direct switch */
-       if (range>0 && range <= 3*ncase) {
-               if (fp->swval)
-                       printf("sub     $%o,r0\n", fp->swval);
-               printf(dirsw, range, deflab, isn, isn);
-               isn++;
-               for (i=fp->swval; ; i++) {
-                       if (i==fp->swval) {
-                               printf("L%d\n", fp->swlab);
-                               if (fp==lp)
-                                       break;
-                               fp++;
-                       } else
-                               printf("L%d\n", deflab);
-               }
-               printf(".text\n");
-               return;
-       }
-       /* simple switch */
-       if (ncase<10) {
-               for (fp = afp; fp<=lp; fp++)
-                       breq(fp->swval, fp->swlab);
-               printf("jbr     L%d\n", deflab);
-               return;
-       }
-       /* hash switch */
-       best = 077777;
-       poctab = getblk(((ncase+2)/2) * sizeof(*poctab));
-       for (i=ncase/4; i<=ncase/2; i++) {
-               for (j=0; j<i; j++)
-                       poctab[j] = 0;
-               for (swp=fp; swp<=lp; swp++)
-                       /* lrem(0, swp->swval, i) */
-                       poctab[(unsigned)swp->swval%i]++;
-               worst = 0;
-               for (j=0; j<i; j++)
-                       if (poctab[j]>worst)
-                               worst = poctab[j];
-               if (i*worst < best) {
-                       tabs = i;
-                       best = i*worst;
-               }
-       }
-       i = isn++;
-       printf(hashsw, tabs, i, i);
-       isn++;
-       for (i=0; i<tabs; i++)
-               printf("L%d\n", isn+i);
-       printf(".text\n");
-       for (i=0; i<tabs; i++) {
-               printf("L%d:", isn++);
-               for (swp=fp; swp<=lp; swp++) {
-                       /* lrem(0, swp->swval, tabs) */
-                       if ((unsigned)swp->swval%tabs == i) {
-                               /* ldiv(0, swp->swval, tabs) */
-                               breq((unsigned)swp->swval/tabs, swp->swlab);
-                       }
-               }
-               printf("jbr     L%d\n", deflab);
-       }
-}
-
-breq(v, l)
-{
-       if (v==0)
-               printf("tst     r0\n");
-       else
-               printf("cmp     r0,$%o\n", v);
-       printf("jeq     L%d\n", l);
-}
-
-sort(afp, alp)
-struct swtab *afp, *alp;
-{
-       register struct swtab *cp, *fp, *lp;
-       int intch, t;
-
-       fp = afp;
-       lp = alp;
-       while (fp < --lp) {
-               intch = 0;
-               for (cp=fp; cp<lp; cp++) {
-                       if (cp->swval == cp[1].swval) {
-                               error("Duplicate case (%d)", cp->swval);
-                               return(1);
-                       }
-                       if (cp->swval > cp[1].swval) {
-                               intch++;
-                               t = cp->swval;
-                               cp->swval = cp[1].swval;
-                               cp[1].swval = t;
-                               t = cp->swlab;
-                               cp->swlab = cp[1].swlab;
-                               cp[1].swlab = t;
-                       }
-               }
-               if (intch==0)
-                       break;
-       }
-       return(0);
-}
-
-ispow2(atree)
-{
-       register int d;
-       register struct tnode *tree;
-
-       tree = atree;
-       if (!isfloat(tree) && tree->tr2->op==CON) {
-               d = tree->tr2->value;
-               if (d>1 && (d&(d-1))==0)
-                       return(d);
-       }
-       return(0);
-}
-
-pow2(atree)
-struct tnode *atree;
-{
-       register int d, i;
-       register struct tnode *tree;
-
-       tree = atree;
-       if (d = ispow2(tree)) {
-               for (i=0; (d=>>1)!=0; i++);
-               tree->tr2->value = i;
-               switch (tree->op) {
-
-               case TIMES:
-                       tree->op = LSHIFT;
-                       break;
-
-               case ASTIMES:
-                       tree->op = ASLSH;
-                       break;
-
-               case DIVIDE:
-                       tree->op = ULSH;
-                       tree->tr2->value = -i;
-                       break;
-
-               case ASDIV:
-                       tree->op = ASULSH;
-                       tree->tr2->value = -i;
-                       break;
-
-               case MOD:
-                       tree->op = AND;
-                       tree->tr2->value = (1<<i)-1;
-                       break;
-
-               case ASMOD:
-                       tree->op = ASAND;
-                       tree->tr2->value = (1<<i)-1;
-                       break;
-
-               default:
-                       error("pow2 botch");
-               }
-               tree = optim(tree);
-       }
-       return(tree);
-}
-
-cbranch(atree, albl, cond, areg)
-struct tnode *atree;
-{
-       int l1, op;
-       register lbl, reg;
-       register struct tnode *tree;
-
-       lbl = albl;
-       reg = areg;
-again:
-       if ((tree=atree)==0)
-               return;
-       switch(tree->op) {
-
-       case LOGAND:
-               if (cond) {
-                       cbranch(tree->tr1, l1=isn++, 0, reg);
-                       cbranch(tree->tr2, lbl, 1, reg);
-                       label(l1);
-               } else {
-                       cbranch(tree->tr1, lbl, 0, reg);
-                       cbranch(tree->tr2, lbl, 0, reg);
-               }
-               return;
-
-       case LOGOR:
-               if (cond) {
-                       cbranch(tree->tr1, lbl, 1, reg);
-                       cbranch(tree->tr2, lbl, 1, reg);
-               } else {
-                       cbranch(tree->tr1, l1=isn++, 1, reg);
-                       cbranch(tree->tr2, lbl, 0, reg);
-                       label(l1);
-               }
-               return;
-
-       case EXCLA:
-               cbranch(tree->tr1, lbl, !cond, reg);
-               return;
-
-       case SEQNC:
-               rcexpr(tree->tr1, efftab, reg);
-               atree = tree->tr2;
-               goto again;
-
-       case ITOL:
-               tree = tree->tr1;
-               break;
-       }
-       op = tree->op;
-       if (opdope[op]&RELAT
-        && tree->tr1->op==ITOL && tree->tr2->op==ITOL) {
-               tree->tr1 = tree->tr1->tr1;
-               tree->tr2 = tree->tr2->tr1;
-               if (op>=LESSEQ && op<=GREAT
-                && (tree->tr1->type==UNSIGN || tree->tr2->type==UNSIGN))
-                       tree->op = op = op+LESSEQP-LESSEQ;
-       }
-       if (tree->type==LONG
-         || opdope[op]&RELAT&&tree->tr1->type==LONG) {
-               longrel(tree, lbl, cond, reg);
-               return;
-       }
-       rcexpr(tree, cctab, reg);
-       op = tree->op;
-       if ((opdope[op]&RELAT)==0)
-               op = NEQUAL;
-       else {
-               l1 = tree->tr2->op;
-               if ((l1==CON || l1==SFCON) && tree->tr2->value==0)
-                       op =+ 200;              /* special for ptr tests */
-               else
-                       op = maprel[op-EQUAL];
-       }
-       if (isfloat(tree))
-               printf("cfcc\n");
-       branch(lbl, op, !cond);
-}
-
-branch(lbl, aop, c)
-{
-       register op;
-
-       if(op=aop)
-               prins(op, c, branchtab);
-       else
-               printf("jbr");
-       printf("\tL%d\n", lbl);
-}
-
-longrel(atree, lbl, cond, reg)
-struct tnode *atree;
-{
-       int xl1, xl2, xo, xz;
-       register int op, isrel;
-       register struct tnode *tree;
-
-       if (reg&01)
-               reg++;
-       reorder(&atree, cctab, reg);
-       tree = atree;
-       isrel = 0;
-       if (opdope[tree->op]&RELAT) {
-               isrel++;
-               op = tree->op;
-       } else
-               op = NEQUAL;
-       if (!cond)
-               op = notrel[op-EQUAL];
-       xl1 = xlab1;
-       xl2 = xlab2;
-       xo = xop;
-       xlab1 = lbl;
-       xlab2 = 0;
-       xop = op;
-       xz = xzero;
-       xzero = !isrel || tree->tr2->op==ITOL && tree->tr2->tr1->op==CON
-               && tree->tr2->tr1->value==0;
-       if (tree->op==ANDN) {
-               tree->op = TAND;
-               tree->tr2 = optim(tnode(COMPL, LONG, tree->tr2));
-       }
-       if (cexpr(tree, cctab, reg) < 0) {
-               reg = rcexpr(tree, regtab, reg);
-               printf("ashc    $0,r%d\n", reg);
-               branch(xlab1, op, 0);
-       }
-       xlab1 = xl1;
-       xlab2 = xl2;
-       xop = xo;
-       xzero = xz;
-}
-
-/*
- * Tables for finding out how best to do long comparisons.
- * First dimen is whether or not the comparison is with 0.
- * Second is which test: e.g. a>b->
- *     cmp     a,b
- *     bgt     YES             (first)
- *     blt     NO              (second)
- *     cmp     a+2,b+2
- *     bhi     YES             (third)
- *  NO:        ...
- * Note some tests may not be needed.
- */
-char   lrtab[2][3][6] {
-       0,      NEQUAL, LESS,   LESS,   GREAT,  GREAT,
-       NEQUAL, 0,      GREAT,  GREAT,  LESS,   LESS,
-       EQUAL,  NEQUAL, LESSEQP,LESSP,  GREATQP,GREATP,
-
-       0,      NEQUAL, LESS,   LESS,   GREATEQ,GREAT,
-       NEQUAL, 0,      GREAT,  0,      0,      LESS,
-       EQUAL,  NEQUAL, EQUAL,  0,      0,      NEQUAL,
-};
-
-xlongrel(f)
-{
-       register int op, bno;
-
-       op = xop;
-       if (f==0) {
-               if (bno = lrtab[xzero][0][op-EQUAL])
-                       branch(xlab1, bno, 0);
-               if (bno = lrtab[xzero][1][op-EQUAL]) {
-                       xlab2 = isn++;
-                       branch(xlab2, bno, 0);
-               }
-               if (lrtab[xzero][2][op-EQUAL]==0)
-                       return(1);
-       } else {
-               branch(xlab1, lrtab[xzero][2][op-EQUAL], 0);
-               if (xlab2)
-                       label(xlab2);
-       }
-       return(0);
-}
-
-label(l)
-{
-       printf("L%d:", l);
-}
-
-popstk(a)
-{
-       switch(a) {
-
-       case 0:
-               return;
-
-       case 2:
-               printf("tst     (sp)+\n");
-               return;
-
-       case 4:
-               printf("cmp     (sp)+,(sp)+\n");
-               return;
-       }
-       printf("add     $%o,sp\n", a);
-}
-
-error(s, p1, p2, p3, p4, p5, p6)
-{
-
-       nerror++;
-       fprintf(stderr, "%d: ", line);
-       fprintf(stderr, s, p1, p2, p3, p4, p5, p6);
-       putc('\n', stderr);
-}
-
-psoct(an)
-{
-       register int n, sign;
-
-       sign = 0;
-       if ((n = an) < 0) {
-               n = -n;
-               sign = '-';
-       }
-       printf("%c%o", sign, n);
-}
-
-/*
- * Read in an intermediate file.
- */
-#define        STKS    100
-getree()
-{
-       struct tnode *expstack[STKS];
-       register struct tnode **sp;
-       register t, op;
-       static char s[9];
-       struct swtab *swp;
-       double atof();
-       char numbuf[64];
-       struct tname *np;
-       struct xtname *xnp;
-       struct ftconst *fp;
-       struct lconst *lp;
-       struct fasgn *sap;
-       int lbl, cond, lbl2, lbl3;
-
-       curbase = funcbase;
-       sp = expstack;
-       for (;;) {
-               if (sp >= &expstack[STKS])
-                       error("Stack overflow botch");
-               op = geti();
-               if ((op&0177400) != 0177000) {
-                       error("Intermediate file error");
-                       exit(1);
-               }
-               lbl = 0;
-               switch(op =& 0377) {
-
-       case SINIT:
-               printf("%o\n", geti());
-               break;
-
-       case EOFC:
-               return;
-
-       case BDATA:
-               if (geti() == 1) {
-                       printf(".byte ");
-                       for (;;)  {
-                               printf("%o", geti());
-                               if (geti() != 1)
-                                       break;
-                               printf(",");
-                       }
-                       printf("\n");
-               }
-               break;
-
-       case PROG:
-               printf(".text\n");
-               break;
-
-       case DATA:
-               printf(".data\n");
-               break;
-
-       case BSS:
-               printf(".bss\n");
-               break;
-
-       case SYMDEF:
-               outname(s);
-               printf(".globl%s%.8s\n", s[0]?" ":"", s);
-               sfuncr.nloc = 0;
-               break;
-
-       case RETRN:
-               printf("jmp     cret\n");
-               break;
-
-       case CSPACE:
-               t = outname(s);
-               printf(".comm   %.8s,%o\n", t, geti());
-               break;
-
-       case SSPACE:
-               printf(".=.+%o\n", (t=geti()));
-               totspace += (unsigned)t;
-               break;
-
-       case EVEN:
-               printf(".even\n");
-               break;
-
-       case SAVE:
-               printf("jsr     r5,csv\n");
-               break;
-
-       case SETSTK:
-               t = geti()-6;
-               if (t==2)
-                       printf("tst     -(sp)\n");
-               else if (t != 0)
-                       printf("sub     $%o,sp\n", t);
-               break;
-
-       case PROFIL:
-               t = geti();
-               printf("mov     $L%d,r0\njsr    pc,mcount\n", t);
-               printf(".bss\nL%d:.=.+2\n.text\n", t);
-               break;
-
-       case SNAME:
-               t = outname(s);
-               printf("~%s=L%d\n", t+1, geti());
-               break;
-
-       case ANAME:
-               t = outname(s);
-               printf("~%s=%o\n", t+1, geti());
-               break;
-
-       case RNAME:
-               t = outname(s);
-               printf("~%s=r%d\n", t+1, geti());
-               break;
-
-       case SWIT:
-               t = geti();
-               line = geti();
-               curbase = funcbase;
-               while(swp=getblk(sizeof(*swp)), swp->swlab = geti())
-                       swp->swval = geti();
-               pswitch(funcbase, swp, t);
-               break;
-
-       case C3BRANCH:          /* for fortran [sic] */
-               lbl = geti();
-               lbl2 = geti();
-               lbl3 = geti();
-               goto xpr;
-
-       case CBRANCH:
-               lbl = geti();
-               cond = geti();
-
-       case EXPR:
-       xpr:
-               line = geti();
-               if (sp != &expstack[1]) {
-                       error("Expression input botch");
-                       exit(1);
-               }
-               nstack = 0;
-               *sp = optim(*--sp);
-               if (op==CBRANCH)
-                       cbranch(*sp, lbl, cond, 0);
-               else if (op==EXPR)
-                       rcexpr(*sp, efftab, 0);
-               else {
-                       if ((*sp)->type==LONG) {
-                               rcexpr(tnode(RFORCE, (*sp)->type, *sp), efftab, 0);
-                               printf("ashc    $0,r0\n");
-                       } else {
-                               rcexpr(*sp, cctab, 0);
-                               if (isfloat(*sp))
-                                       printf("cfcc\n");
-                       }
-                       printf("jgt     L%d\n", lbl3);
-                       printf("jlt     L%d\njbr        L%d\n", lbl, lbl2);
-               }
-               curbase = funcbase;
-               break;
-
-       case NAME:
-               t = geti();
-               if (t==EXTERN) {
-                       np = getblk(sizeof(*xnp));
-                       np->type = geti();
-                       outname(np->name);
-               } else {
-                       np = getblk(sizeof(*np));
-                       np->type = geti();
-                       np->nloc = geti();
-               }
-               np->op = NAME;
-               np->class = t;
-               np->regno = 0;
-               np->offset = 0;
-               *sp++ = np;
-               break;
-
-       case CON:
-               t = geti();
-               *sp++ = tconst(geti(), t);
-               break;
-
-       case LCON:
-               geti(); /* ignore type, assume long */
-               t = geti();
-               op = geti();
-               if (t==0 && op>=0 || t == -1 && op<0) {
-                       *sp++ = tnode(ITOL, LONG, tconst(op, INT));
-                       break;
-               }
-               lp = getblk(sizeof(*lp));
-               lp->op = LCON;
-               lp->type = LONG;
-               lp->lvalue = ((long)t<<16) + (unsigned)op;      /* nonportable */
-               *sp++ = lp;
-               break;
-
-       case FCON:
-               t = geti();
-               outname(numbuf);
-               fp = getblk(sizeof(*fp));
-               fp->op = FCON;
-               fp->type = t;
-               fp->value = isn++;
-               fp->fvalue = atof(numbuf);
-               *sp++ = fp;
-               break;
-
-       case FSEL:
-               *sp = tnode(FSEL, geti(), *--sp, NULL);
-               t = geti();
-               (*sp++)->tr2 = tnode(COMMA, INT, tconst(geti(), INT), tconst(t, INT));
-               break;
-
-       case STRASG:
-               sap = getblk(sizeof(*sap));
-               sap->op = STRASG;
-               sap->type = geti();
-               sap->mask = geti();
-               sap->tr1 = *--sp;
-               sap->tr2 = NULL;
-               *sp++ = sap;
-               break;
-
-       case NULLOP:
-               *sp++ = tnode(0, 0, NULL, NULL);
-               break;
-
-       case LABEL:
-               label(geti());
-               break;
-
-       case NLABEL:
-               t = outname(s);
-               printf("%.8s:\n", t, t);
-               break;
-
-       case RLABEL:
-               t = outname(s);
-               printf("%.8s:\n~~%s:\n", t, t+1);
-               break;
-
-       case BRANCH:
-               branch(geti(), 0);
-               break;
-
-       case SETREG:
-               nreg = geti()-1;
-               break;
-
-       default:
-               if (opdope[op]&BINARY) {
-                       if (sp < &expstack[1]) {
-                               error("Binary expression botch");
-                               exit(1);
-                       }
-                       t = *--sp;
-                       *sp++ = tnode(op, geti(), *--sp, t);
-               } else
-                       sp[-1] = tnode(op, geti(), sp[-1]);
-               break;
-       }
-       }
-}
-
-geti()
-{
-       register i;
-
-       i = getchar();
-       i += getchar()<<8;
-       return(i);
-}
-
-outname(s)
-{
-       register char *p, c;
-       register n;
-
-       p = s;
-       n = 0;
-       while (c = getchar()) {
-               *p++ = c;
-               n++;
-       }
-       do {
-               *p++ = 0;
-       } while (n++ < 8);
-       return(s);
-}
-
-strasg(atp)
-struct fasgn *atp;
-{
-       register struct tnode *tp;
-       register nwords, i;
-
-       nwords = atp->mask/sizeof(int);
-       tp = atp->tr1;
-       if (tp->op != ASSIGN) {
-               if (tp->op==RFORCE) {   /* function return */
-                       if (sfuncr.nloc==0) {
-                               sfuncr.nloc = isn++;
-                               printf(".bss\nL%d:.=.+%o\n.text\n", sfuncr.nloc, nwords*sizeof(int));
-                       }
-                       atp->tr1 = tnode(ASSIGN, STRUCT, &sfuncr, tp->tr1);
-                       strasg(atp);
-                       printf("mov     $L%d,r0\n", sfuncr.nloc);
-                       return;
-               }
-               if (tp->op==CALL) {
-                       rcexpr(tp, efftab, 0);
-                       return;
-               }
-               error("Illegal structure operation");
-               return;
-       }
-       tp->tr2 = strfunc(tp->tr2);
-       if (nwords==1)
-               setype(tp, INT);
-       else if (nwords==sizeof(int))
-               setype(tp, LONG);
-       else {
-               if (tp->tr1->op!=NAME && tp->tr1->op!=STAR
-                || tp->tr2->op!=NAME && tp->tr2->op!=STAR) {
-                       error("unimplemented structure assignment");
-                       return;
-               }
-               tp->tr1 = tnode(AMPER, STRUCT+PTR, tp->tr1);
-               tp->tr2 = tnode(AMPER, STRUCT+PTR, tp->tr2);
-               tp->op = STRSET;
-               tp->type = STRUCT+PTR;
-               tp = optim(tp);
-               rcexpr(tp, efftab, 0);
-               if (nwords < 7) {
-                       for (i=0; i<nwords; i++)
-                               printf("mov     (r1)+,(r0)+\n");
-                       return;
-               }
-               if (nreg<=1)
-                       printf("mov     r2,-(sp)\n");
-               printf("mov     $%o,r2\n", nwords);
-               printf("L%d:mov (r1)+,(r0)+\ndec\tr2\njne\tL%d\n", isn, isn);
-               isn++;
-               if (nreg<=1)
-                       printf("mov     (sp)+,r2\n");
-               return;
-       }
-       rcexpr(tp, efftab, 0);
-}
-
-setype(p, t)
-register struct tnode *p;
-register t;
-{
-
-       for (;; p = p->tr1) {
-               p->type = t;
-               if (p->op==AMPER)
-                       t = decref(t);
-               else if (p->op==STAR)
-                       t = incref(t);
-               else if (p->op==ASSIGN)
-                       setype(p->tr2, t);
-               else if (p->op!=PLUS)
-                       break;
-       }
-}
-
-/*
- * Reduce the degree-of-reference by one.
- * e.g. turn "ptr-to-int" into "int".
- */
-decref(at)
-{
-       register t;
-
-       t = at;
-       if ((t & ~TYPE) == 0) {
-               error("Illegal indirection");
-               return(t);
-       }
-       return((t>>TYLEN) & ~TYPE | t&TYPE);
-}
-
-/*
- * Increase the degree of reference by
- * one; e.g. turn "int" to "ptr-to-int".
- */
-incref(t)
-{
-       return(((t&~TYPE)<<TYLEN) | (t&TYPE) | PTR);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c12.c b/.ref-Research-V7/usr/src/cmd/c/c12.c
deleted file mode 100644 (file)
index c58242e..0000000
+++ /dev/null
@@ -1,1080 +0,0 @@
-#
-/*
- *             C compiler part 2 -- expression optimizer
- *
- */
-
-#include "c1.h"
-
-optim(atree)
-struct tnode *atree;
-{
-       struct { int intx[4]; };
-       register op, dope;
-       int d1, d2;
-       struct tnode *t;
-       register struct tnode *tree;
-
-       if ((tree=atree)==0)
-               return(0);
-       if ((op = tree->op)==0)
-               return(tree);
-       if (op==NAME && tree->class==AUTO) {
-               tree->class = OFFS;
-               tree->regno = 5;
-               tree->offset = tree->nloc;
-       }
-       dope = opdope[op];
-       if ((dope&LEAF) != 0) {
-               if (op==FCON
-                && tree->fvalue.intx[1]==0
-                && tree->fvalue.intx[2]==0
-                && tree->fvalue.intx[3]==0) {
-                       tree->op = SFCON;
-                       tree->value = tree->fvalue.intx[0];
-               }
-               return(tree);
-       }
-       if ((dope&BINARY) == 0)
-               return(unoptim(tree));
-       /* is known to be binary */
-       if (tree->type==CHAR)
-               tree->type = INT;
-       switch(op) {
-       /*
-        * PDP-11 special:
-        * generate new =&~ operator out of =&
-        * by complementing the RHS.
-        */
-       case ASAND:
-               tree->op = ASANDN;
-               tree->tr2 = tnode(COMPL, tree->tr2->type, tree->tr2);
-               break;
-
-       /*
-        * On the PDP-11, int->ptr via multiplication
-        * Longs are just truncated.
-        */
-       case LTOP:
-               tree->op = ITOP;
-               tree->tr1 = unoptim(tnode(LTOI,INT,tree->tr1));
-       case ITOP:
-               tree->op = TIMES;
-               break;
-
-       case MINUS:
-               if ((t = isconstant(tree->tr2)) && (t->type!=UNSIGN || tree->type!=LONG)) {
-                       tree->op = PLUS;
-                       if (t->type==DOUBLE)
-                               /* PDP-11 FP representation */
-                               t->value =^ 0100000;
-                       else
-                               t->value = -t->value;
-               }
-               break;
-       }
-       op = tree->op;
-       dope = opdope[op];
-       if (dope&LVALUE && tree->tr1->op==FSEL)
-               return(lvfield(tree));
-       if ((dope&COMMUTE)!=0) {
-               d1 = tree->type;
-               tree = acommute(tree);
-               if (tree->op == op)
-                       tree->type = d1;
-               /*
-                * PDP-11 special:
-                * replace a&b by a ANDN ~ b.
-                * This will be undone when in
-                * truth-value context.
-                */
-               if (tree->op!=AND)
-                       return(tree);
-               /*
-                * long & pos-int is simpler
-                */
-               if (tree->type==LONG && tree->tr2->op==ITOL
-                && (tree->tr2->tr1->op==CON && tree->tr2->tr1->value>=0
-                  || tree->tr2->tr1->type==UNSIGN)) {
-                       tree->type = UNSIGN;
-                       t = tree->tr2;
-                       tree->tr2 = tree->tr2->tr1;
-                       t->tr1 = tree;
-                       tree->tr1 = tnode(LTOI, UNSIGN, tree->tr1);
-                       return(optim(t));
-               }
-               /*
-                * Keep constants to the right
-                */
-               if ((tree->tr1->op==ITOL && tree->tr1->tr1->op==CON)
-                 || tree->tr1->op==LCON) {
-                       t = tree->tr1;
-                       tree->tr1 = tree->tr2;
-                       tree->tr2 = t;
-               }
-               tree->op = ANDN;
-               op = ANDN;
-               tree->tr2 = tnode(COMPL, tree->tr2->type, tree->tr2);
-       }
-    again:
-       tree->tr1 = optim(tree->tr1);
-       tree->tr2 = optim(tree->tr2);
-       if (tree->type == LONG) {
-               t = lconst(tree->op, tree->tr1, tree->tr2);
-               if (t)
-                       return(t);
-       }
-       if ((dope&RELAT) != 0) {
-               if ((d1=degree(tree->tr1)) < (d2=degree(tree->tr2))
-                || d1==d2 && tree->tr1->op==NAME && tree->tr2->op!=NAME) {
-                       t = tree->tr1;
-                       tree->tr1 = tree->tr2;
-                       tree->tr2 = t;
-                       tree->op = maprel[op-EQUAL];
-               }
-               if (tree->tr1->type==CHAR && tree->tr2->op==CON
-                && (dcalc(tree->tr1, 0) <= 12 || tree->tr1->op==STAR)
-                && tree->tr2->value <= 127 && tree->tr2->value >= 0)
-                       tree->tr2->type = CHAR;
-       }
-       d1 = max(degree(tree->tr1), islong(tree->type));
-       d2 = max(degree(tree->tr2), 0);
-       switch (op) {
-
-       /*
-        * In assignment to fields, treat all-zero and all-1 specially.
-        */
-       case FSELA:
-               if (tree->tr2->op==CON && tree->tr2->value==0) {
-                       tree->op = ASAND;
-                       tree->tr2->value = ~tree->mask;
-                       return(optim(tree));
-               }
-               if (tree->tr2->op==CON && tree->mask==tree->tr2->value) {
-                       tree->op = ASOR;
-                       return(optim(tree));
-               }
-
-       case LTIMES:
-       case LDIV:
-       case LMOD:
-       case LASTIMES:
-       case LASDIV:
-       case LASMOD:
-               tree->degree = 10;
-               break;
-
-       case ANDN:
-               if (isconstant(tree->tr2) && tree->tr2->value==0) {
-                       return(tree->tr1);
-               }
-               goto def;
-
-       case CALL:
-               tree->degree = 10;
-               break;
-
-       case QUEST:
-       case COLON:
-               tree->degree = max(d1, d2);
-               break;
-
-       case DIVIDE:
-       case ASDIV:
-       case ASTIMES:
-       case PTOI:
-               if (tree->tr2->op==CON && tree->tr2->value==1)
-                       return(tree->tr1);
-       case MOD:
-       case ASMOD:
-               if (tree->tr1->type==UNSIGN && ispow2(tree))
-                       return(pow2(tree));
-               if ((op==MOD||op==ASMOD) && tree->type==DOUBLE) {
-                       error("Floating %% not defined");
-                       tree->type = INT;
-               }
-       case ULSH:
-       case ASULSH:
-               d1 =+ 2;
-               d2 =+ 2;
-               if (tree->type==LONG)
-                       return(hardlongs(tree));
-               goto constant;
-
-       case LSHIFT:
-       case RSHIFT:
-       case ASRSH:
-       case ASLSH:
-               if (tree->tr2->op==CON && tree->tr2->value==0) {
-                       return(tree->tr1);
-               }
-               /*
-                * PDP-11 special: turn right shifts into negative
-                * left shifts
-                */
-               if (tree->type == LONG) {
-                       d1++;
-                       d2++;
-               }
-               if (op==LSHIFT||op==ASLSH)
-                       goto constant;
-               if (tree->tr2->op==CON && tree->tr2->value==1
-                && tree->tr1->type!=UNSIGN)
-                       goto constant;
-               op =+ (LSHIFT-RSHIFT);
-               tree->op = op;
-               tree->tr2 = tnode(NEG, tree->type, tree->tr2);
-               if (tree->tr1->type==UNSIGN) {
-                       if (tree->op==LSHIFT)
-                               tree->op = ULSH;
-                       else if (tree->op==ASLSH)
-                               tree->op = ASULSH;
-               }
-               goto again;
-
-       constant:
-               if (tree->tr1->op==CON && tree->tr2->op==CON) {
-                       const(op, &tree->tr1->value, tree->tr2->value);
-                       return(tree->tr1);
-               }
-
-
-       def:
-       default:
-               if (dope&RELAT) {
-                       if (tree->tr1->type==LONG)      /* long relations are a mess */
-                               d1 = 10;
-                       if (opdope[tree->tr1->op]&RELAT && tree->tr2->op==CON
-                        && tree->tr2->value==0) {
-                               tree = tree->tr1;
-                               switch(op) {
-                               case GREATEQ:
-                                       return(&cone);
-                               case LESS:
-                                       return(&czero);
-                               case LESSEQ:
-                               case EQUAL:
-                                       tree->op = notrel[tree->op-EQUAL];
-                               }
-                               return(tree);
-                       }
-               }
-               tree->degree = d1==d2? d1+islong(tree->type): max(d1, d2);
-               break;
-       }
-       return(tree);
-}
-
-unoptim(atree)
-struct tnode *atree;
-{
-       struct { int intx[4]; };
-       register struct tnode *subtre, *tree;
-       register int *p;
-       double static fv;
-       struct ftconst *fp;
-
-       if ((tree=atree)==0)
-               return(0);
-    again:
-       if (tree->op==AMPER && tree->tr1->op==STAR) {
-               subtre = tree->tr1->tr1;
-               subtre->type = tree->type;
-               return(optim(subtre));
-       }
-       subtre = tree->tr1 = optim(tree->tr1);
-       switch (tree->op) {
-
-       case ITOL:
-               if (subtre->op==CON && subtre->type==INT && subtre->value<0) {
-                       subtre = getblk(sizeof(struct lconst));
-                       subtre->op = LCON;
-                       subtre->type = LONG;
-                       subtre->lvalue = tree->tr1->value;
-                       return(subtre);
-               }
-               break;
-
-       case FTOI:
-               if (tree->type==UNSIGN) {
-                       tree->op = FTOL;
-                       tree->type = LONG;
-                       tree = tnode(LTOI, UNSIGN, tree);
-               }
-               break;
-
-       case LTOF:
-               if (subtre->op==LCON) {
-                       tree = getblk(sizeof(*fp));
-                       tree->op = FCON;
-                       tree->type = DOUBLE;
-                       tree->value = isn++;
-                       tree->fvalue = subtre->lvalue;
-                       return(optim(tree));
-               }
-               break;
-
-       case ITOF:
-               if (tree->tr1->type==UNSIGN) {
-                       tree->tr1 = tnode(ITOL, LONG, tree->tr1);
-                       tree->op = LTOF;
-                       tree = optim(tree);
-               }
-               if (subtre->op!=CON)
-                       break;
-               fv = subtre->value;
-               p = &fv;
-               p++;
-               if (*p++==0 && *p++==0 && *p++==0) {
-                       tree = getblk(sizeof(*fp));
-                       tree->op = SFCON;
-                       tree->type = DOUBLE;
-                       tree->value = * (int *) &fv;
-                       tree->fvalue = fv;
-                       return(tree);
-               }
-               break;
-
-       case ITOC:
-               p = tree->tr1;
-               /*
-                * Sign-extend PDP-11 characters
-                */
-               if (p->op==CON) {
-                       p->value = p->value << 8 >> 8;
-                       return(p);
-               } else if (p->op==NAME) {
-                       p->type = CHAR;
-                       return(p);
-               }
-               break;
-
-       case LTOI:
-               p = tree->tr1;
-               switch (p->op) {
-
-               case LCON:
-                       p->op = CON;
-                       p->type = tree->type;
-                       p->value = p->lvalue;
-                       return(p);
-
-               case NAME:
-                       p->offset =+ 2;
-                       p->type = tree->type;
-                       return(p);
-
-               case STAR:
-                       p->type = tree->type;
-                       p->tr1->type = tree->type+PTR;
-                       p->tr1 = tnode(PLUS, tree->type, p->tr1, tconst(2, INT));
-                       return(optim(p));
-
-               case ITOL:
-                       return(p->tr1);
-
-               case PLUS:
-               case MINUS:
-               case AND:
-               case ANDN:
-               case OR:
-               case EXOR:
-                       p->tr2 = tnode(LTOI, tree->type, p->tr2);
-               case NEG:
-               case COMPL:
-                       p->tr1 = tnode(LTOI, tree->type, p->tr1);
-                       p->type = tree->type;
-                       return(optim(p));
-               }
-               break;
-
-       case FSEL:
-               tree->op = AND;
-               tree->tr1 = tree->tr2->tr1;
-               tree->tr2->tr1 = subtre;
-               tree->tr2->op = RSHIFT;
-               tree->tr1->value = (1 << tree->tr1->value) - 1;
-               return(optim(tree));
-
-       case FSELR:
-               tree->op = LSHIFT;
-               tree->type = UNSIGN;
-               tree->tr1 = tree->tr2;
-               tree->tr1->op = AND;
-               tree->tr2 = tree->tr2->tr2;
-               tree->tr1->tr2 = subtre;
-               tree->tr1->tr1->value = (1 << tree->tr1->tr1->value) -1;
-               return(optim(tree));
-
-       case AMPER:
-               if (subtre->op==STAR)
-                       return(subtre->tr1);
-               if (subtre->op==NAME && subtre->class == OFFS) {
-                       p = tnode(PLUS, tree->type, subtre, tree);
-                       subtre->type = tree->type;
-                       tree->op = CON;
-                       tree->type = INT;
-                       tree->degree = 0;
-                       tree->value = subtre->offset;
-                       subtre->class = REG;
-                       subtre->nloc = subtre->regno;
-                       subtre->offset = 0;
-                       return(optim(p));
-               }
-               break;
-
-       case STAR:
-               if (subtre->op==AMPER) {
-                       subtre->tr1->type = tree->type;
-                       return(subtre->tr1);
-               }
-               if (tree->type==STRUCT)
-                       break;
-               if (subtre->op==NAME && subtre->class==REG) {
-                       subtre->type = tree->type;
-                       subtre->class = OFFS;
-                       subtre->regno = subtre->nloc;
-                       return(subtre);
-               }
-               p = subtre->tr1;
-               if ((subtre->op==INCAFT||subtre->op==DECBEF)&&tree->type!=LONG
-                && p->op==NAME && p->class==REG && p->type==subtre->type) {
-                       p->type = tree->type;
-                       p->op = subtre->op==INCAFT? AUTOI: AUTOD;
-                       return(p);
-               }
-               if (subtre->op==PLUS && p->op==NAME && p->class==REG) {
-                       if (subtre->tr2->op==CON) {
-                               p->offset =+ subtre->tr2->value;
-                               p->class = OFFS;
-                               p->type = tree->type;
-                               p->regno = p->nloc;
-                               return(p);
-                       }
-                       if (subtre->tr2->op==AMPER) {
-                               subtre = subtre->tr2->tr1;
-                               subtre->class =+ XOFFS-EXTERN;
-                               subtre->regno = p->nloc;
-                               subtre->type = tree->type;
-                               return(subtre);
-                       }
-               }
-               break;
-       case EXCLA:
-               if ((opdope[subtre->op]&RELAT)==0)
-                       break;
-               tree = subtre;
-               tree->op = notrel[tree->op-EQUAL];
-               break;
-
-       case COMPL:
-               if (tree->type==CHAR)
-                       tree->type = INT;
-               if (tree->op == subtre->op)
-                       return(subtre->tr1);
-               if (subtre->op==CON) {
-                       subtre->value = ~subtre->value;
-                       return(subtre);
-               }
-               if (subtre->op==LCON) {
-                       subtre->lvalue = ~subtre->lvalue;
-                       return(subtre);
-               }
-               if (subtre->op==ITOL) {
-                       if (subtre->tr1->op==CON) {
-                               tree = getblk(sizeof(struct lconst));
-                               tree->op = LCON;
-                               tree->type = LONG;
-                               if (subtre->tr1->type==UNSIGN)
-                                       tree->lvalue = ~(long)(unsigned)subtre->tr1->value;
-                               else
-                                       tree->lvalue = ~subtre->tr1->value;
-                               return(tree);
-                       }
-                       if (subtre->tr1->type==UNSIGN)
-                               break;
-                       subtre->op = tree->op;
-                       subtre->type = subtre->tr1->type;
-                       tree->op = ITOL;
-                       tree->type = LONG;
-                       goto again;
-               }
-
-       case NEG:
-               if (tree->type==CHAR)
-                       tree->type = INT;
-               if (tree->op==subtre->op)
-                       return(subtre->tr1);
-               if (subtre->op==CON) {
-                       subtre->value = -subtre->value;
-                       return(subtre);
-               }
-               if (subtre->op==LCON) {
-                       subtre->lvalue = -subtre->lvalue;
-                       return(subtre);
-               }
-               if (subtre->op==ITOL && subtre->tr1->op==CON) {
-                       tree = getblk(sizeof(struct lconst));
-                       tree->op = LCON;
-                       tree->type = LONG;
-                       if (subtre->tr1->type==UNSIGN)
-                               tree->lvalue = -(long)(unsigned)subtre->tr1->value;
-                       else
-                               tree->lvalue = -subtre->tr1->value;
-                       return(tree);
-               }
-               /*
-                * PDP-11 FP negation
-                */
-               if (subtre->op==SFCON) {
-                       subtre->value =^ 0100000;
-                       subtre->fvalue.intx[0] =^ 0100000;
-                       return(subtre);
-               }
-               if (subtre->op==FCON) {
-                       subtre->fvalue.intx[0] =^ 0100000;
-                       return(subtre);
-               }
-       }
-       if ((opdope[tree->op]&LEAF)==0)
-               tree->degree = max(islong(tree->type), degree(subtre));
-       return(tree);
-}
-
-/*
- * Deal with assignments to partial-word fields.
- * The game is that select(x) =+ y turns into
- * select(x =+ select(y)) where the shifts and masks
- * are chosen properly.  The outer select
- * is discarded where the value doesn't matter.
- * Sadly, overflow is undetected on =+ and the like.
- * Pure assignment is handled specially.
- */
-
-lvfield(at)
-struct tnode *at;
-{
-       register struct tnode *t, *t1;
-       register struct fasgn *t2;
-
-       t = at;
-       switch (t->op) {
-
-       case ASSIGN:
-               t2 = getblk(sizeof(*t2));
-               t2->op = FSELA;
-               t2->type = UNSIGN;
-               t1 = t->tr1->tr2;
-               t2->mask = ((1<<t1->tr1->value)-1)<<t1->tr2->value;
-               t2->tr1 = t->tr1;
-               t2->tr2 = t->tr2;
-               t = t2;
-
-       case ASANDN:
-       case ASPLUS:
-       case ASMINUS:
-       case ASOR:
-       case ASXOR:
-       case INCBEF:
-       case INCAFT:
-       case DECBEF:
-       case DECAFT:
-               t1 = t->tr1;
-               t1->op = FSELR;
-               t->tr1 = t1->tr1;
-               t1->tr1 = t->tr2;
-               t->tr2 = t1;
-               t1 = t1->tr2;
-               t1 = tnode(COMMA, INT, tconst(t1->tr1->value, INT),
-                       tconst(t1->tr2->value, INT));
-               return(optim(tnode(FSELT, UNSIGN, t, t1)));
-
-       }
-       error("Unimplemented field operator");
-       return(t);
-}
-
-#define        LSTSIZ  20
-struct acl {
-       int nextl;
-       int nextn;
-       struct tnode *nlist[LSTSIZ];
-       struct tnode *llist[LSTSIZ+1];
-};
-
-acommute(atree)
-{
-       struct acl acl;
-       int d, i, op, flt, d1;
-       register struct tnode *t1, **t2, *tree;
-       struct tnode *t;
-
-       acl.nextl = 0;
-       acl.nextn = 0;
-       tree = atree;
-       op = tree->op;
-       flt = isfloat(tree);
-       insert(op, tree, &acl);
-       acl.nextl--;
-       t2 = &acl.llist[acl.nextl];
-       if (!flt) {
-               /* put constants together */
-               for (i=acl.nextl; i>0; i--) {
-                       if (t2[0]->op==CON && t2[-1]->op==CON) {
-                               acl.nextl--;
-                               t2--;
-                               const(op, &t2[0]->value, t2[1]->value);
-                       } else if (t = lconst(op, t2[-1], t2[0])) {
-                               acl.nextl--;
-                               t2--;
-                               t2[0] = t;
-                       }
-               }
-       }
-       if (op==PLUS || op==OR) {
-               /* toss out "+0" */
-               if (acl.nextl>0 && (t1 = isconstant(*t2)) && t1->value==0
-                || (*t2)->op==LCON && (*t2)->lvalue==0) {
-                       acl.nextl--;
-                       t2--;
-               }
-               if (acl.nextl <= 0) {
-                       if ((*t2)->type==CHAR)
-                               *t2 = tnode(LOAD, tree->type, *t2, NULL);
-                       (*t2)->type = tree->type;
-                       return(*t2);
-               }
-               /* subsume constant in "&x+c" */
-               if (op==PLUS && t2[0]->op==CON && t2[-1]->op==AMPER) {
-                       t2--;
-                       t2[0]->tr1->offset =+ t2[1]->value;
-                       acl.nextl--;
-               }
-       } else if (op==TIMES || op==AND) {
-               t1 = acl.llist[acl.nextl];
-               if (t1->op==CON) {
-                       if (t1->value==0)
-                               return(t1);
-                       if (op==TIMES && t1->value==1 && acl.nextl>0)
-                               if (--acl.nextl <= 0) {
-                                       t1 = acl.llist[0];
-                                       if (tree->type == UNSIGN)
-                                               t1->type = tree->type;
-                                       return(t1);
-                               }
-               }
-       }
-       if (op==PLUS && !flt)
-               distrib(&acl);
-       tree = *(t2 = &acl.llist[0]);
-       d = max(degree(tree), islong(tree->type));
-       if (op==TIMES && !flt)
-               d++;
-       for (i=0; i<acl.nextl; i++) {
-               t1 = acl.nlist[i];
-               t1->tr2 = t = *++t2;
-               d1 = degree(t);
-               /*
-                * PDP-11 strangeness:
-                * rt. op of ^ must be in a register.
-                */
-               if (op==EXOR && dcalc(t, 0)<=12) {
-                       t1->tr2 = t = optim(tnode(LOAD, t->type, t));
-                       d1 = t->degree;
-               }
-               t1->degree = d = d==d1? d+islong(t1->type): max(d, d1);
-               t1->tr1 = tree;
-               tree = t1;
-               if (tree->type==LONG) {
-                       if (tree->op==TIMES)
-                               tree = hardlongs(tree);
-                       else if (tree->op==PLUS && (t = isconstant(tree->tr1))
-                              && t->value < 0 && t->type!=UNSIGN) {
-                               tree->op = MINUS;
-                               t->value = - t->value;
-                               t = tree->tr1;
-                               tree->tr1 = tree->tr2;
-                               tree->tr2 = t;
-                       }
-               }
-       }
-       if (tree->op==TIMES && ispow2(tree))
-               tree->degree = max(degree(tree->tr1), islong(tree->type));
-       return(tree);
-}
-
-distrib(list)
-struct acl *list;
-{
-/*
- * Find a list member of the form c1c2*x such
- * that c1c2 divides no other such constant, is divided by
- * at least one other (say in the form c1*y), and which has
- * fewest divisors. Reduce this pair to c1*(y+c2*x)
- * and iterate until no reductions occur.
- */
-       register struct tnode **p1, **p2;
-       struct tnode *t;
-       int ndmaj, ndmin;
-       struct tnode **dividend, **divisor;
-       struct tnode **maxnod, **mindiv;
-
-    loop:
-       maxnod = &list->llist[list->nextl];
-       ndmaj = 1000;
-       dividend = 0;
-       for (p1 = list->llist; p1 <= maxnod; p1++) {
-               if ((*p1)->op!=TIMES || (*p1)->tr2->op!=CON)
-                       continue;
-               ndmin = 0;
-               for (p2 = list->llist; p2 <= maxnod; p2++) {
-                       if (p1==p2 || (*p2)->op!=TIMES || (*p2)->tr2->op!=CON)
-                               continue;
-                       if ((*p1)->tr2->value == (*p2)->tr2->value) {
-                               (*p2)->tr2 = (*p1)->tr1;
-                               (*p2)->op = PLUS;
-                               (*p1)->tr1 = (*p2);
-                               *p1 = optim(*p1);
-                               squash(p2, maxnod);
-                               list->nextl--;
-                               goto loop;
-                       }
-                       if (((*p2)->tr2->value % (*p1)->tr2->value) == 0)
-                               goto contmaj;
-                       if (((*p1)->tr2->value % (*p2)->tr2->value) == 0) {
-                               ndmin++;
-                               mindiv = p2;
-                       }
-               }
-               if (ndmin > 0 && ndmin < ndmaj) {
-                       ndmaj = ndmin;
-                       dividend = p1;
-                       divisor = mindiv;
-               }
-    contmaj:;
-       }
-       if (dividend==0)
-               return;
-       t = list->nlist[--list->nextn];
-       p1 = dividend;
-       p2 = divisor;
-       t->op = PLUS;
-       t->type = (*p1)->type;
-       t->tr1 = (*p1);
-       t->tr2 = (*p2)->tr1;
-       (*p1)->tr2->value =/ (*p2)->tr2->value;
-       (*p2)->tr1 = t;
-       t = optim(*p2);
-       if (p1 < p2) {
-               *p1 = t;
-               squash(p2, maxnod);
-       } else {
-               *p2 = t;
-               squash(p1, maxnod);
-       }
-       list->nextl--;
-       goto loop;
-}
-
-squash(p, maxp)
-struct tnode **p, **maxp;
-{
-       register struct tnode **np;
-
-       for (np = p; np < maxp; np++)
-               *np = *(np+1);
-}
-
-const(op, vp, av)
-int *vp;
-{
-       register int v;
-       struct { unsigned u;};
-
-       v = av;
-       switch (op) {
-
-       case PTOI:
-               (*vp).u =/ v;
-               return;
-
-       case PLUS:
-               *vp =+ v;
-               return;
-
-       case TIMES:
-               *vp =* v;
-               return;
-
-       case AND:
-               *vp =& v;
-               return;
-
-       case OR:
-               *vp =| v;
-               return;
-
-       case EXOR:
-               *vp =^ v;
-               return;
-
-       case DIVIDE:
-       case MOD:
-               if (v==0)
-                       error("Divide check");
-               else
-                       if (op==DIVIDE)
-                               *vp =/ v;
-                       else
-                               *vp =% v;
-               return;
-
-       case RSHIFT:
-               *vp =>> v;
-               return;
-
-       case LSHIFT:
-               *vp =<< v;
-               return;
-
-       case ANDN:
-               *vp =& ~ v;
-               return;
-       }
-       error("C error: const");
-}
-
-struct tnode *
-lconst(op, lp, rp)
-register struct tnode *lp, *rp;
-{
-       long l, r;
-
-       if (lp->op==LCON)
-               l = lp->lvalue;
-       else if (lp->op==ITOL && lp->tr1->op==CON) {
-               if (lp->tr1->type==INT)
-                       l = lp->tr1->value;
-               else
-                       l = (unsigned)lp->tr1->value;
-       } else
-               return(0);
-       if (rp->op==LCON)
-               r = rp->lvalue;
-       else if (rp->op==ITOL && rp->tr1->op==CON) {
-               if (rp->tr1->type==INT)
-                       r = rp->tr1->value;
-               else
-                       r = (unsigned)rp->tr1->value;
-       } else
-               return(0);
-       switch (op) {
-
-       case PLUS:
-               l += r;
-               break;
-
-       case MINUS:
-               l -= r;
-               break;
-
-       case TIMES:
-       case LTIMES:
-               l *= r;
-               break;
-
-       case DIVIDE:
-       case LDIV:
-               if (r==0)
-                       error("Divide check");
-               else
-                       l /= r;
-               break;
-
-       case MOD:
-       case LMOD:
-               if (r==0)
-                       error("Divide check");
-               else
-                       l %= r;
-               break;
-
-       case AND:
-               l &= r;
-               break;
-
-       case ANDN:
-               l &= ~r;
-               break;
-
-       case OR:
-               l |= r;
-               break;
-
-       case EXOR:
-               l ^= r;
-               break;
-
-       case LSHIFT:
-               l <<= r;
-               break;
-
-       case RSHIFT:
-               l >>= r;
-               break;
-
-       default:
-               return(0);
-       }
-       if (lp->op==LCON) {
-               lp->lvalue = l;
-               return(lp);
-       }
-       lp = getblk(sizeof(struct lconst));
-       lp->op = LCON;
-       lp->type = LONG;
-       lp->lvalue = l;
-       return(lp);
-}
-
-insert(op, atree, alist)
-struct acl *alist;
-{
-       register d;
-       register struct acl *list;
-       register struct tnode *tree;
-       int d1, i;
-       struct tnode *t;
-
-       tree = atree;
-       list = alist;
-ins:
-       if (tree->op != op)
-               tree = optim(tree);
-       if (tree->op == op && list->nextn < LSTSIZ-2) {
-               list->nlist[list->nextn++] = tree;
-               insert(op, tree->tr1, list);
-               insert(op, tree->tr2, list);
-               return;
-       }
-       if (!isfloat(tree)) {
-               /* c1*(x+c2) -> c1*x+c1*c2 */
-               if ((tree->op==TIMES||tree->op==LSHIFT)
-                 && tree->tr2->op==CON && tree->tr2->value>0
-                 && tree->tr1->op==PLUS && tree->tr1->tr2->op==CON) {
-                       d = tree->tr2->value;
-                       if (tree->op==TIMES)
-                               tree->tr2->value =* tree->tr1->tr2->value;
-                       else
-                               tree->tr2->value = tree->tr1->tr2->value << d;
-                       tree->tr1->tr2->value = d;
-                       tree->tr1->op = tree->op;
-                       tree->op = PLUS;
-                       tree = optim(tree);
-                       if (op==PLUS)
-                               goto ins;
-               }
-       }
-       d = degree(tree);
-       for (i=0; i<list->nextl; i++) {
-               if ((d1=degree(list->llist[i]))<d) {
-                       t = list->llist[i];
-                       list->llist[i] = tree;
-                       tree = t;
-                       d = d1;
-               }
-       }
-       list->llist[list->nextl++] = tree;
-}
-
-tnode(op, type, tr1, tr2)
-struct tnode *tr1, *tr2;
-{
-       register struct tnode *p;
-
-       p = getblk(sizeof(*p));
-       p->op = op;
-       p->type = type;
-       p->degree = 0;
-       p->tr1 = tr1;
-       if (opdope[op]&BINARY)
-               p->tr2 = tr2;
-       else
-               p->tr2 = NULL;
-       return(p);
-}
-
-tconst(val, type)
-{
-       register struct tconst *p;
-
-       p = getblk(sizeof(*p));
-       p->op = CON;
-       p->type = type;
-       p->value = val;
-       return(p);
-}
-
-getblk(size)
-{
-       register *p;
-
-       if (size&01)
-               abort();
-       p = curbase;
-       if ((curbase =+ size) >= coremax) {
-               if (sbrk(1024) == -1) {
-                       error("Out of space-- c1");
-                       exit(1);
-               }
-               coremax =+ 1024;
-       }
-       return(p);
-}
-
-islong(t)
-{
-       if (t==LONG)
-               return(2);
-       return(1);
-}
-
-isconstant(at)
-struct tnode *at;
-{
-       register struct tnode *t;
-
-       t = at;
-       if (t->op==CON || t->op==SFCON)
-               return(t);
-       if (t->op==ITOL && t->tr1->op==CON)
-               return(t->tr1);
-       return(0);
-}
-
-hardlongs(at)
-struct tnode *at;
-{
-       register struct tnode *t;
-
-       t = at;
-       switch(t->op) {
-
-       case TIMES:
-       case DIVIDE:
-       case MOD:
-               t->op =+ LTIMES-TIMES;
-               break;
-
-       case ASTIMES:
-       case ASDIV:
-       case ASMOD:
-               t->op =+ LASTIMES-ASTIMES;
-               t->tr1 = tnode(AMPER, LONG+PTR, t->tr1);
-               break;
-
-       default:
-               return(t);
-       }
-       return(optim(t));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c13.c b/.ref-Research-V7/usr/src/cmd/c/c13.c
deleted file mode 100644 (file)
index 0af8ae7..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-/*
- * C second pass -- tables
- */
-#include "c1.h"
-/*
- * Operator dope table-- see description in c0.
- */
-int opdope[] {
-       000000, /* EOFC */
-       000000, /* ; */
-       000000, /* { */
-       000000, /* } */
-       036000, /* [ */
-       002000, /* ] */
-       036000, /* ( */
-       002000, /* ) */
-       014201, /* : */
-       007001, /* , */
-       000000, /* field selection */
-       000000, /* reverse field selection */
-       000001, /* temporary field selection */
-       000001, /* int->ptr */
-       000001, /* ptr->int */
-       000001, /* long->ptr */
-       000001, /* field assignment */
-       000001, /* >> unsigned */
-       000001, /* >> unsigned */
-       000000, /* 19 */
-       000400, /* name */
-       000400, /* short constant */
-       000400, /* string */
-       000400, /* float */
-       000400, /* double */
-       0000400,        /* long const */
-       000400, /* long const <= 16 bits */
-       000400, /* autoi, *r++ */
-       000400, /* autod, *--r */
-       000000, /* 29 */
-       034203, /* ++pre */
-       034203, /* --pre */
-       034203, /* ++post */
-       034203, /* --post */
-       034220, /* !un */
-       034202, /* &un */
-       034220, /* *un */
-       034200, /* -un */
-       034220, /* ~un */
-       036001, /* . (structure reference) */
-       030101, /* + */
-       030001, /* - */
-       032101, /* * */
-       032001, /* / */
-       032001, /* % */
-       026061, /* >> */
-       026061, /* << */
-       020161, /* & */
-       016161, /* | */
-       016161, /* ^ */
-       036001, /* -> */
-       001000, /* int -> double */
-       001000, /* double -> int */
-       000001, /* && */
-       000001, /* || */
-       030001, /* &~ */
-       001000, /* double -> long */
-       001000, /* long -> double */
-       001000, /* integer -> long */
-       000000, /* long -> integer */
-       022005, /* == */
-       022005, /* != */
-       024005, /* <= */
-       024005, /* < */
-       024005, /* >= */
-       024005, /* > */
-       024005, /* <p */
-       024005, /* <=p */
-       024005, /* >p */
-       024005, /* >=p */
-       012213, /* =+ */
-       012213, /* =- */
-       012213, /* =* */
-       012213, /* =/ */
-       012213, /* =% */
-       012253, /* =>> */
-       012253, /* =<< */
-       012253, /* =& */
-       012253, /* =| */
-       012253, /* =^ */
-       012213, /* = */
-       030001, /* & for tests */
-       032001, /*  * (long) */
-       032001, /*  / (long) */
-       032001, /* % (long) */
-       012253, /* =& ~ */
-       012213, /* =* (long) */
-       012213, /* / (long) */
-       012213, /* % (long) */
-       000000, /* 89 */
-       014201, /* ? */
-       026061, /* long << */
-       012253, /* long =<< */
-       000101, /* max */
-       000101, /* maxp */
-       000101, /* min */
-       000101, /* minp */
-       000001, /* , */
-       000000, /* 98 */
-       000000, /* 99 */
-       036001, /* call */
-       036000, /* mcall */
-       000000, /* goto */
-       000000, /* jump cond */
-       000000, /* branch cond */
-       000400, /* set nregs */
-       000000, /* 106 */
-       000000, /* 107 */
-       000000, /* 108 */
-       000000, /* int->char */
-       000000, /* force r0 */
-       000000, /* 111 */
-       000000, /* 112 */
-       000000, /* 113 */
-       000000, /* 114 */
-       000000, /* structure assign */
-       000001, /* struct assignment setup */
-};
-
-char   *opntab[] {
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       ":",
-       ",",
-       "field select",
-       0,
-       0,
-       "int->ptr",
-       "ptr->int",
-       "long->ptr",
-       "field assign",
-       ">>",
-       ">>",
-       0,
-       "name",
-       "short constant",
-       "string",
-       "float",
-       "double",
-       "long constant",
-       "long constant",
-       "*r++",
-       "*--r",
-       0,
-       "++pre",
-       "--pre",
-       "++post",
-       "--post",
-       "!un",
-       "&",
-       "*",
-       "-",
-       "~",
-       ".",
-       "+",
-       "-",
-       "*",
-       "/",
-       "%",
-       ">>",
-       "<<",
-       "&",
-       "|",
-       "^",
-       "->",
-       "int->double",
-       "double->int",
-       "&&",
-       "||",
-       "&~",
-       "double->long",
-       "long->double",
-       "integer->long",
-       "long->integer",
-       "==",
-       "!=",
-       "<=",
-       "<",
-       ">=",
-       ">",
-       "<p",
-       "<=p",
-       ">p",
-       ">=p",
-       "+=",
-       "-=",
-       "*=",
-       "/=",
-       "%=",
-       ">>=",
-       "<<=",
-       "&=",
-       "|=",
-       "^=",
-       "=",
-       "& for tests",
-       "*",
-       "/",
-       "%",
-       "&= ~",
-       "*=",
-       "/=",
-       "%=",
-       0,
-       "?",
-       "<<",
-       "<<=",
-       "\\/",
-       "\\/",
-       "/\\",
-       "/\\",
-       0,
-       "call",
-       "call",
-       "call",
-       0,
-       "goto",
-       "jump cond",
-       "branch cond",
-       "set nregs",
-       "load value",
-       0,
-       0,
-       "int->char",
-       "force register",
-       "",
-       "",
-       "",
-       "",
-       "=structure",
-       "= (struct setup)",
-};
-
-/*
- * Strings for instruction tables.
- */
-char   mov[]   "mov";
-char   clr[]   "clr";
-char   cmp[]   "cmp";
-char   tst[]   "tst";
-char   add[]   "add";
-char   sub[]   "sub";
-char   inc[]   "inc";
-char   dec[]   "dec";
-char   mul[]   "mul";
-char   div[]   "div";
-char   asr[]   "asr";
-char   ash[]   "ash";
-char   asl[]   "asl";
-char   bic[]   "bic";
-char   bic1[]  "bic $1,";
-char   bit[]   "bit";
-char   bit1[]  "bit $1,";
-char   bis[]   "bis";
-char   bis1[]  "bis $1,";
-char   xor[]   "xor";
-char   neg[]   "neg";
-char   com[]   "com";
-char   stdol[] "*$";
-char   ashc[]  "ashc";
-char   slmul[] "lmul";
-char   sldiv[] "ldiv";
-char   slrem[] "lrem";
-char   almul[] "almul";
-char   aldiv[] "aldiv";
-char   alrem[] "alrem";
-char   jeq[]   "jeq";
-char   jne[]   "jne";
-char   jle[]   "jle";
-char   jgt[]   "jgt";
-char   jlt[]   "jlt";
-char   jge[]   "jge";
-char   jlos[]  "jlos";
-char   jhi[]   "jhi";
-char   jlo[]   "jlo";
-char   jhis[]  "jhis";
-char   nop[]   "/nop";
-char   jbr[]   "jbr";
-
-/*
- * Instruction tables, accessed by
- * I (first operand) or I' (second) macros.
- */
-
-struct instab instab[] {
-       LOAD,   mov,    tst,
-       ASSIGN, mov,    clr,
-       EQUAL,  cmp,    tst,
-       NEQUAL, cmp,    tst,
-       LESSEQ, cmp,    tst,
-       LESS,   cmp,    tst,
-       GREATEQ,cmp,    tst,
-       GREAT,  cmp,    tst,
-       LESSEQP,cmp,    tst,
-       LESSP,  cmp,    tst,
-       GREATQP,cmp,    tst,
-       GREATP, cmp,    tst,
-       PLUS,   add,    inc,
-       ASPLUS, add,    inc,
-       MINUS,  sub,    dec,
-       ASMINUS,sub,    dec,
-       INCBEF, add,    inc,
-       DECBEF, sub,    dec,
-       INCAFT, add,    inc,
-       DECAFT, sub,    dec,
-       TIMES,  mul,    mul,
-       ASTIMES,mul,    mul,
-       DIVIDE, div,    div,
-       ASDIV,  div,    div,
-       MOD,    div,    div,
-       ASMOD,  div,    div,
-       PTOI,   div,    div,
-       RSHIFT, ash,    asr,
-       ASRSH,  ash,    asr,
-       LSHIFT, ash,    asl,
-       ASLSH,  ash,    asl,
-       AND,    bic,    bic1,
-       ANDN,   bic,    bic1,
-       ASANDN, bic,    bic1,
-       TAND,   bit,    bit1,
-       OR,     bis,    bis1,
-       ASOR,   bis,    bis1,
-       EXOR,   xor,    xor,
-       ASXOR,  xor,    xor,
-       NEG,    neg,    neg,
-       COMPL,  com,    com,
-       CALL1,  stdol,  stdol,
-       CALL2,  "",     "",
-       LLSHIFT,ashc,   ashc,
-       ASLSHL, ashc,   ashc,
-       LTIMES, slmul,  slmul,
-       LDIV,   sldiv,  sldiv,
-       LMOD,   slrem,  slrem,
-       LASTIMES,almul, almul,
-       LASDIV, aldiv,  aldiv,
-       LASMOD, alrem,  alrem,
-       ULSH,   ashc,   ashc,
-       ASULSH, ashc,   ashc,
-       0,      0,      0};
-
-/*
- * Similar table for relationals.
- * The first string is for the positive
- * test, the second for the inverted one.
- * The '200+' entries are 
- * used in tests against 0 where a 'tst'
- * instruction is used; it clears the c-bit
- * the c-bit so ptr tests are funny.
- */
-struct instab branchtab[] {
-       EQUAL,  jeq,    jne,
-       NEQUAL, jne,    jeq,
-       LESSEQ, jle,    jgt,
-       LESS,   jlt,    jge,
-       GREATEQ,jge,    jlt,
-       GREAT,  jgt,    jle,
-       LESSEQP,jlos,   jhi,
-       LESSP,  jlo,    jhis,
-       GREATQP,jhis,   jlo,
-       GREATP, jhi,    jlos,
-       200+EQUAL,      jeq,    jne,
-       200+NEQUAL,     jne,    jeq,
-       200+LESSEQ,     jle,    jgt,
-       200+LESS,       jlt,    jge,
-       200+GREATEQ,    jge,    jlt,
-       200+GREAT,      jgt,    jle,
-       200+LESSEQP,    jeq,    jne,
-       200+LESSP,      nop,    jbr,
-       200+GREATQP,    jbr,    nop,
-       200+GREATP,     jne,    jeq,
-       0,      0,      0 };
diff --git a/.ref-Research-V7/usr/src/cmd/c/c2.h b/.ref-Research-V7/usr/src/cmd/c/c2.h
deleted file mode 100644 (file)
index 5a8c587..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Header for object code improver
- */
-
-#include <stdio.h>
-
-#define        JBR     1
-#define        CBR     2
-#define        JMP     3
-#define        LABEL   4
-#define        DLABEL  5
-#define        EROU    7
-#define        JSW     9
-#define        MOV     10
-#define        CLR     11
-#define        COM     12
-#define        INC     13
-#define        DEC     14
-#define        NEG     15
-#define        TST     16
-#define        ASR     17
-#define        ASL     18
-#define        SXT     19
-#define        CMP     20
-#define        ADD     21
-#define        SUB     22
-#define        BIT     23
-#define        BIC     24
-#define        BIS     25
-#define        MUL     26
-#define        DIV     27
-#define        ASH     28
-#define        XOR     29
-#define        TEXT    30
-#define        DATA    31
-#define        BSS     32
-#define        EVEN    33
-#define        MOVF    34
-#define        MOVOF   35
-#define        MOVFO   36
-#define        ADDF    37
-#define        SUBF    38
-#define        DIVF    39
-#define        MULF    40
-#define        CLRF    41
-#define        CMPF    42
-#define        NEGF    43
-#define        TSTF    44
-#define        CFCC    45
-#define        SOB     46
-#define        JSR     47
-#define        END     48
-
-#define        JEQ     0
-#define        JNE     1
-#define        JLE     2
-#define        JGE     3
-#define        JLT     4
-#define        JGT     5
-#define        JLO     6
-#define        JHI     7
-#define        JLOS    8
-#define        JHIS    9
-
-#define        BYTE    100
-#define        LSIZE   512
-
-struct node {
-       char    op;
-       char    subop;
-       struct  node    *forw;
-       struct  node    *back;
-       struct  node    *ref;
-       int     labno;
-       char    *code;
-       int     refc;
-};
-
-struct optab {
-       char    *opstring;
-       int     opcode;
-} optab[];
-
-char   line[LSIZE];
-struct node    first;
-char   *curlp;
-int    nbrbr;
-int    nsaddr;
-int    redunm;
-int    iaftbr;
-int    njp1;
-int    nrlab;
-int    nxjump;
-int    ncmot;
-int    nrevbr;
-int    loopiv;
-int    nredunj;
-int    nskip;
-int    ncomj;
-int    nsob;
-int    nrtst;
-int    nlit;
-
-int    nchange;
-int    isn;
-int    debug;
-int    lastseg;
-char   *lasta;
-char   *lastr;
-char   *firstr;
-char   revbr[];
-char   regs[12][20];
-char   conloc[20];
-char   conval[20];
-char   ccloc[20];
-
-#define        RT1     10
-#define        RT2     11
-#define        FREG    5
-#define        NREG    5
-#define        LABHS   127
-#define        OPHS    57
-
-struct optab *ophash[OPHS];
-struct node *nonlab();
-char   *copy();
-char   *sbrk();
-char   *findcon();
-struct node *insertl();
-struct node *codemove();
-char   *sbrk();
-char   *alloc();
diff --git a/.ref-Research-V7/usr/src/cmd/c/c20.c b/.ref-Research-V7/usr/src/cmd/c/c20.c
deleted file mode 100644 (file)
index 8bee9fe..0000000
+++ /dev/null
@@ -1,695 +0,0 @@
-#
-/*
- *      C object code improver
- */
-
-#include "c2.h"
-
-struct optab optab[] {
-       "jbr",  JBR,
-       "jeq",  CBR | JEQ<<8,
-       "jne",  CBR | JNE<<8,
-       "jle",  CBR | JLE<<8,
-       "jge",  CBR | JGE<<8,
-       "jlt",  CBR | JLT<<8,
-       "jgt",  CBR | JGT<<8,
-       "jlo",  CBR | JLO<<8,
-       "jhi",  CBR | JHI<<8,
-       "jlos", CBR | JLOS<<8,
-       "jhis", CBR | JHIS<<8,
-       "jmp",  JMP,
-       ".globl",EROU,
-       "mov",  MOV,
-       "clr",  CLR,
-       "com",  COM,
-       "inc",  INC,
-       "dec",  DEC,
-       "neg",  NEG,
-       "tst",  TST,
-       "asr",  ASR,
-       "asl",  ASL,
-       "sxt",  SXT,
-       "cmp",  CMP,
-       "add",  ADD,
-       "sub",  SUB,
-       "bit",  BIT,
-       "bic",  BIC,
-       "bis",  BIS,
-       "mul",  MUL,
-       "ash",  ASH,
-       "xor",  XOR,
-       ".text",TEXT,
-       ".data",DATA,
-       ".bss", BSS,
-       ".even",EVEN,
-       "movf", MOVF,
-       "movof",MOVOF,
-       "movfo",MOVFO,
-       "addf", ADDF,
-       "subf", SUBF,
-       "divf", DIVF,
-       "mulf", MULF,
-       "clrf", CLRF,
-       "cmpf", CMPF,
-       "negf", NEGF,
-       "tstf", TSTF,
-       "cfcc", CFCC,
-       "sob",  SOB,
-       "jsr",  JSR,
-       ".end", END,
-       0,      0};
-
-char   revbr[] { JNE, JEQ, JGT, JLT, JGE, JLE, JHIS, JLOS, JHI, JLO };
-int    isn     = 20000;
-int    lastseg = -1;
-
-main(argc, argv)
-char **argv;
-{
-       register int niter, maxiter, isend;
-       extern end;
-       int nflag;
-
-       if (argc>1 && argv[1][0]=='+') {
-               argc--;
-               argv++;
-               debug++;
-       }
-       nflag = 0;
-       if (argc>1 && argv[1][0]=='-') {
-               argc--;
-               argv++;
-               nflag++;
-       }
-       if (argc>1) {
-               if (freopen(argv[1], "r", stdin) == NULL) {
-                       fprintf(stderr, "C2: can't find %s\n", argv[1]);
-                       exit(1);
-               }
-       }
-       if (argc>2) {
-               if (freopen(argv[2], "w", stdout) == NULL) {
-                       fprintf(stderr, "C2: can't create %s\n", argv[2]);
-                       exit(1);
-               }
-       }
-       lasta = firstr = lastr = sbrk(2);
-       maxiter = 0;
-       opsetup();
-       do {
-               isend = input();
-               movedat();
-               niter = 0;
-               do {
-                       refcount();
-                       do {
-                               iterate();
-                               clearreg();
-                               niter++;
-                       } while (nchange);
-                       comjump();
-                       rmove();
-               } while (nchange || jumpsw());
-               addsob();
-               output();
-               if (niter > maxiter)
-                       maxiter = niter;
-               lasta = firstr;
-       } while (isend);
-       if (nflag) {
-               fprintf(stderr, "%d iterations\n", maxiter);
-               fprintf(stderr, "%d jumps to jumps\n", nbrbr);
-               fprintf(stderr, "%d inst. after jumps\n", iaftbr);
-               fprintf(stderr, "%d jumps to .+2\n", njp1);
-               fprintf(stderr, "%d redundant labels\n", nrlab);
-               fprintf(stderr, "%d cross-jumps\n", nxjump);
-               fprintf(stderr, "%d code motions\n", ncmot);
-               fprintf(stderr, "%d branches reversed\n", nrevbr);
-               fprintf(stderr, "%d redundant moves\n", redunm);
-               fprintf(stderr, "%d simplified addresses\n", nsaddr);
-               fprintf(stderr, "%d loops inverted\n", loopiv);
-               fprintf(stderr, "%d redundant jumps\n", nredunj);
-               fprintf(stderr, "%d common seqs before jmp's\n", ncomj);
-               fprintf(stderr, "%d skips over jumps\n", nskip);
-               fprintf(stderr, "%d sob's added\n", nsob);
-               fprintf(stderr, "%d redundant tst's\n", nrtst);
-               fprintf(stderr, "%d literals eliminated\n", nlit);
-               fprintf(stderr, "%dK core\n", (((int)lastr+01777)>>10)&077);
-       }
-       exit(0);
-}
-
-input()
-{
-       register struct node *p, *lastp;
-       register int oper;
-
-       lastp = &first;
-       for (;;) {
-               oper = getline();
-               switch (oper&0377) {
-       
-               case LABEL:
-                       p = (struct node *)alloc(sizeof first);
-                       if (line[0] == 'L') {
-                               p->op = LABEL;
-                               p->subop = 0;
-                               p->labno = getnum(line+1);
-                               p->code = 0;
-                       } else {
-                               p->op = DLABEL;
-                               p->subop = 0;
-                               p->labno = 0;
-                               p->code = copy(1, line);
-                       }
-                       break;
-       
-               case JBR:
-               case CBR:
-               case JMP:
-               case JSW:
-                       p = (struct node *)alloc(sizeof first);
-                       p->op = oper&0377;
-                       p->subop = oper>>8;
-                       if (*curlp=='L' && (p->labno = getnum(curlp+1)))
-                               p->code = 0;
-                       else {
-                               p->labno = 0;
-                               p->code = copy(1, curlp);
-                       }
-                       break;
-
-               default:
-                       p = (struct node *)alloc(sizeof first);
-                       p->op = oper&0377;
-                       p->subop = oper>>8;
-                       p->labno = 0;
-                       p->code = copy(1, curlp);
-                       break;
-
-               }
-               p->forw = 0;
-               p->back = lastp;
-               lastp->forw = p;
-               lastp = p;
-               p->ref = 0;
-               if (oper==EROU)
-                       return(1);
-               if (oper==END)
-                       return(0);
-       }
-}
-
-getline()
-{
-       register char *lp;
-       register c;
-
-       lp = line;
-       while ((c = getchar())==' ' || c=='\t')
-               ;
-       do {
-               if (c==':') {
-                       *lp++ = 0;
-                       return(LABEL);
-               }
-               if (c=='\n') {
-                       *lp++ = 0;
-                       return(oplook());
-               }
-               if (lp >= &line[LSIZE-2]) {
-                       fprintf(stderr, "C2: Sorry, input line too long\n");
-                       exit(1);
-               }
-               *lp++ = c;
-       } while ((c = getchar()) != EOF);
-       *lp++ = 0;
-       return(END);
-}
-
-getnum(ap)
-char *ap;
-{
-       register char *p;
-       register n, c;
-
-       p = ap;
-       n = 0;
-       while ((c = *p++) >= '0' && c <= '9')
-               n = n*10 + c - '0';
-       if (*--p != 0)
-               return(0);
-       return(n);
-}
-
-output()
-{
-       register struct node *t;
-       register struct optab *oper;
-       register int byte;
-
-       t = &first;
-       while (t = t->forw) switch (t->op) {
-
-       case END:
-               return;
-
-       case LABEL:
-               printf("L%d:", t->labno);
-               continue;
-
-       case DLABEL:
-               printf("%s:", t->code);
-               continue;
-
-       case TEXT:
-       case DATA:
-       case BSS:
-               lastseg = t->op;
-
-       default:
-               if ((byte = t->subop) == BYTE)
-                       t->subop = 0;
-               for (oper = optab; oper->opstring!=0; oper++) 
-                       if ((oper->opcode&0377) == t->op
-                        && (oper->opcode>>8) == t->subop) {
-                               printf("%s", oper->opstring);
-                               if (byte==BYTE)
-                                       printf("b");
-                               break;
-                       }
-               if (t->code) {
-                       reducelit(t);
-                       printf("\t%s\n", t->code);
-               } else if (t->op==JBR || t->op==CBR)
-                       printf("\tL%d\n", t->labno);
-               else
-                       printf("\n");
-               continue;
-
-       case JSW:
-               printf("L%d\n", t->labno);
-               continue;
-
-       case SOB:
-               printf("sob     %s", t->code);
-               if (t->labno)
-                       printf(",L%d", t->labno);
-               printf("\n");
-               continue;
-
-       case 0:
-               if (t->code)
-                       printf("%s", t->code);
-               printf("\n");
-               continue;
-       }
-}
-
-/*
- * Notice addresses of the form
- * $xx,xx(r)
- * and replace them with (pc),xx(r)
- *     -- Thanx and a tip of the Hatlo hat to Bliss-11.
- */
-reducelit(at)
-struct node *at;
-{
-       register char *c1, *c2;
-       char *c2s;
-       register struct node *t;
-
-       t = at;
-       if (*t->code != '$')
-               return;
-       c1 = t->code;
-       while (*c1 != ',')
-               if (*c1++ == '\0')
-                       return;
-       c2s = c1;
-       c1++;
-       if (*c1=='*')
-               c1++;
-       c2 = t->code+1;
-       while (*c1++ == *c2++);
-       if (*--c1!='(' || *--c2!=',')
-               return;
-       t->code = copy(2, "(pc)", c2s);
-       nlit++;
-}
-
-char *
-copy(na, ap)
-char *ap;
-{
-       register char *p, *np;
-       char *onp;
-       register n;
-
-       p = ap;
-       n = 0;
-       if (*p==0)
-               return(0);
-       do
-               n++;
-       while (*p++);
-       if (na>1) {
-               p = (&ap)[1];
-               while (*p++)
-                       n++;
-       }
-       onp = np = alloc(n);
-       p = ap;
-       while (*np++ = *p++)
-               ;
-       if (na>1) {
-               p = (&ap)[1];
-               np--;
-               while (*np++ = *p++);
-       }
-       return(onp);
-}
-
-opsetup()
-{
-       register struct optab *optp, **ophp;
-       register char *p;
-
-       for (optp = optab; p = optp->opstring; optp++) {
-               ophp = &ophash[(((p[0]<<3)+(p[1]<<1)+p[2])&077777) % OPHS];
-               while (*ophp++)
-                       if (ophp > &ophash[OPHS])
-                               ophp = ophash;
-               *--ophp = optp;
-       }
-}
-
-oplook()
-{
-       register struct optab *optp;
-       register char *lp, *np;
-       static char tmpop[32];
-       struct optab **ophp;
-
-       if (line[0]=='\0') {
-               curlp = line;
-               return(0);
-       }
-       np = tmpop;
-       for (lp = line; *lp && *lp!=' ' && *lp!='\t';)
-               *np++ = *lp++;
-       *np++ = 0;
-       while (*lp=='\t' || *lp==' ')
-               lp++;
-       curlp = lp;
-       ophp = &ophash[(((tmpop[0]<<3)+(tmpop[1]<<1)+tmpop[2])&077777) % OPHS];
-       while (optp = *ophp) {
-               np = optp->opstring;
-               lp = tmpop;
-               while (*lp == *np++)
-                       if (*lp++ == 0)
-                               return(optp->opcode);
-               if (*lp++=='b' && *lp++==0 && *--np==0)
-                       return(optp->opcode + (BYTE<<8));
-               ophp++;
-               if (ophp >= &ophash[OPHS])
-                       ophp = ophash;
-       }
-       if (line[0]=='L') {
-               lp = &line[1];
-               while (*lp)
-                       if (*lp<'0' || *lp++>'9')
-                               return(0);
-               curlp = line;
-               return(JSW);
-       }
-       curlp = line;
-       return(0);
-}
-
-refcount()
-{
-       register struct node *p, *lp;
-       static struct node *labhash[LABHS];
-       register struct node **hp, *tp;
-
-       for (hp = labhash; hp < &labhash[LABHS];)
-               *hp++ = 0;
-       for (p = first.forw; p!=0; p = p->forw)
-               if (p->op==LABEL) {
-                       labhash[p->labno % LABHS] = p;
-                       p->refc = 0;
-               }
-       for (p = first.forw; p!=0; p = p->forw) {
-               if (p->op==JBR || p->op==CBR || p->op==JSW) {
-                       p->ref = 0;
-                       lp = labhash[p->labno % LABHS];
-                       if (lp==0 || p->labno!=lp->labno)
-                       for (lp = first.forw; lp!=0; lp = lp->forw) {
-                               if (lp->op==LABEL && p->labno==lp->labno)
-                                       break;
-                       }
-                       if (lp) {
-                               tp = nonlab(lp)->back;
-                               if (tp!=lp) {
-                                       p->labno = tp->labno;
-                                       lp = tp;
-                               }
-                               p->ref = lp;
-                               lp->refc++;
-                       }
-               }
-       }
-       for (p = first.forw; p!=0; p = p->forw)
-               if (p->op==LABEL && p->refc==0
-                && (lp = nonlab(p))->op && lp->op!=JSW)
-                       decref(p);
-}
-
-iterate()
-{
-       register struct node *p, *rp, *p1;
-
-       nchange = 0;
-       for (p = first.forw; p!=0; p = p->forw) {
-               if ((p->op==JBR||p->op==CBR||p->op==JSW) && p->ref) {
-                       rp = nonlab(p->ref);
-                       if (rp->op==JBR && rp->labno && p->labno!=rp->labno) {
-                               nbrbr++;
-                               p->labno = rp->labno;
-                               decref(p->ref);
-                               rp->ref->refc++;
-                               p->ref = rp->ref;
-                               nchange++;
-                       }
-               }
-               if (p->op==CBR && (p1 = p->forw)->op==JBR) {
-                       rp = p->ref;
-                       do
-                               rp = rp->back;
-                       while (rp->op==LABEL);
-                       if (rp==p1) {
-                               decref(p->ref);
-                               p->ref = p1->ref;
-                               p->labno = p1->labno;
-                               p1->forw->back = p;
-                               p->forw = p1->forw;
-                               p->subop = revbr[p->subop];
-                               nchange++;
-                               nskip++;
-                       }
-               }
-               if (p->op==JBR || p->op==JMP) {
-                       while (p->forw && p->forw->op!=LABEL
-                               && p->forw->op!=DLABEL
-                               && p->forw->op!=EROU && p->forw->op!=END
-                               && p->forw->op!=0 && p->forw->op!=DATA) {
-                               nchange++;
-                               iaftbr++;
-                               if (p->forw->ref)
-                                       decref(p->forw->ref);
-                               p->forw = p->forw->forw;
-                               p->forw->back = p;
-                       }
-                       rp = p->forw;
-                       while (rp && rp->op==LABEL) {
-                               if (p->ref == rp) {
-                                       p->back->forw = p->forw;
-                                       p->forw->back = p->back;
-                                       p = p->back;
-                                       decref(rp);
-                                       nchange++;
-                                       njp1++;
-                                       break;
-                               }
-                               rp = rp->forw;
-                       }
-               }
-               if (p->op==JBR || p->op==JMP) {
-                       xjump(p);
-                       p = codemove(p);
-               }
-       }
-}
-
-xjump(p1)
-register struct node *p1;
-{
-       register struct node *p2, *p3;
-
-       if ((p2 = p1->ref)==0)
-               return;
-       for (;;) {
-               while ((p1 = p1->back) && p1->op==LABEL);
-               while ((p2 = p2->back) && p2->op==LABEL);
-               if (!equop(p1, p2) || p1==p2)
-                       return;
-               p3 = insertl(p2);
-               p1->op = JBR;
-               p1->subop = 0;
-               p1->ref = p3;
-               p1->labno = p3->labno;
-               p1->code = 0;
-               nxjump++;
-               nchange++;
-       }
-}
-
-struct node *
-insertl(oldp)
-register struct node *oldp;
-{
-       register struct node *lp;
-
-       if (oldp->op == LABEL) {
-               oldp->refc++;
-               return(oldp);
-       }
-       if (oldp->back->op == LABEL) {
-               oldp = oldp->back;
-               oldp->refc++;
-               return(oldp);
-       }
-       lp = (struct node *)alloc(sizeof first);
-       lp->op = LABEL;
-       lp->subop = 0;
-       lp->labno = isn++;
-       lp->ref = 0;
-       lp->code = 0;
-       lp->refc = 1;
-       lp->back = oldp->back;
-       lp->forw = oldp;
-       oldp->back->forw = lp;
-       oldp->back = lp;
-       return(lp);
-}
-
-struct node *
-codemove(p)
-struct node *p;
-{
-       register struct node *p1, *p2, *p3;
-       struct node *t, *tl;
-       int n;
-
-       p1 = p;
-       if (p1->op!=JBR || (p2 = p1->ref)==0)
-               return(p1);
-       while (p2->op == LABEL)
-               if ((p2 = p2->back) == 0)
-                       return(p1);
-       if (p2->op!=JBR && p2->op!=JMP)
-               goto ivloop;
-       p2 = p2->forw;
-       p3 = p1->ref;
-       while (p3) {
-               if (p3->op==JBR || p3->op==JMP) {
-                       if (p1==p3)
-                               return(p1);
-                       ncmot++;
-                       nchange++;
-                       p1->back->forw = p2;
-                       p1->forw->back = p3;
-                       p2->back->forw = p3->forw;
-                       p3->forw->back = p2->back;
-                       p2->back = p1->back;
-                       p3->forw = p1->forw;
-                       decref(p1->ref);
-                       return(p2);
-               } else
-                       p3 = p3->forw;
-       }
-       return(p1);
-ivloop:
-       if (p1->forw->op!=LABEL)
-               return(p1);
-       p3 = p2 = p2->forw;
-       n = 16;
-       do {
-               if ((p3 = p3->forw) == 0 || p3==p1 || --n==0)
-                       return(p1);
-       } while (p3->op!=CBR || p3->labno!=p1->forw->labno);
-       do 
-               if ((p1 = p1->back) == 0)
-                       return(p);
-       while (p1!=p3);
-       p1 = p;
-       tl = insertl(p1);
-       p3->subop = revbr[p3->subop];
-       decref(p3->ref);
-       p2->back->forw = p1;
-       p3->forw->back = p1;
-       p1->back->forw = p2;
-       p1->forw->back = p3;
-       t = p1->back;
-       p1->back = p2->back;
-       p2->back = t;
-       t = p1->forw;
-       p1->forw = p3->forw;
-       p3->forw = t;
-       p2 = insertl(p1->forw);
-       p3->labno = p2->labno;
-       p3->ref = p2;
-       decref(tl);
-       if (tl->refc<=0)
-               nrlab--;
-       loopiv++;
-       nchange++;
-       return(p3);
-}
-
-comjump()
-{
-       register struct node *p1, *p2, *p3;
-
-       for (p1 = first.forw; p1!=0; p1 = p1->forw)
-               if (p1->op==JBR && (p2 = p1->ref) && p2->refc > 1)
-                       for (p3 = p1->forw; p3!=0; p3 = p3->forw)
-                               if (p3->op==JBR && p3->ref == p2)
-                                       backjmp(p1, p3);
-}
-
-backjmp(ap1, ap2)
-struct node *ap1, *ap2;
-{
-       register struct node *p1, *p2, *p3;
-
-       p1 = ap1;
-       p2 = ap2;
-       for(;;) {
-               while ((p1 = p1->back) && p1->op==LABEL);
-               p2 = p2->back;
-               if (equop(p1, p2)) {
-                       p3 = insertl(p1);
-                       p2->back->forw = p2->forw;
-                       p2->forw->back = p2->back;
-                       p2 = p2->forw;
-                       decref(p2->ref);
-                       p2->labno = p3->labno;
-                       p2->ref = p3;
-                       nchange++;
-                       ncomj++;
-               } else
-                       return;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/c21.c b/.ref-Research-V7/usr/src/cmd/c/c21.c
deleted file mode 100644 (file)
index 267c824..0000000
+++ /dev/null
@@ -1,791 +0,0 @@
-#
-/*
- * C object code improver-- second part
- */
-
-#include "c2.h"
-
-rmove()
-{
-       register struct node *p;
-       register int r;
-       register  r1, flt;
-
-       for (p=first.forw; p!=0; p = p->forw) {
-       flt = 0;
-       switch (p->op) {
-
-       case MOVF:
-       case MOVFO:
-       case MOVOF:
-               flt = NREG;
-
-       case MOV:
-               if (p->subop==BYTE)
-                       goto dble;
-               dualop(p);
-               if ((r = findrand(regs[RT1], flt)) >= 0) {
-                       if (r == flt+isreg(regs[RT2]) && p->forw->op!=CBR
-                          && p->forw->op!=SXT
-                          && p->forw->op!=CFCC) {
-                               p->forw->back = p->back;
-                               p->back->forw = p->forw;
-                               redunm++;
-                               continue;
-                       }
-               }
-               if (equstr(regs[RT1], "$0")) {
-                       p->op = CLR;
-                       strcpy(regs[RT1], regs[RT2]);
-                       regs[RT2][0] = 0;
-                       p->code = copy(1, regs[RT1]);
-                       goto sngl;
-               }
-               repladdr(p, 0, flt);
-               r = isreg(regs[RT1]);
-               r1 = isreg(regs[RT2]);
-               dest(regs[RT2], flt);
-               if (r >= 0)
-                       if (r1 >= 0)
-                               savereg(r1+flt, regs[r+flt]);
-                       else
-                               savereg(r+flt, regs[RT2]);
-               else
-                       if (r1 >= 0)
-                               savereg(r1+flt, regs[RT1]);
-                       else
-                               setcon(regs[RT1], regs[RT2]);
-               source(regs[RT1]);
-               setcc(regs[RT2]);
-               continue;
-
-       case ADDF:
-       case SUBF:
-       case DIVF:
-       case MULF:
-               flt = NREG;
-               goto dble;
-
-       case ADD:
-       case SUB:
-       case BIC:
-       case BIS:
-       case MUL:
-       case DIV:
-       case ASH:
-       dble:
-               dualop(p);
-               if (p->op==BIC && (equstr(regs[RT1], "$-1") || equstr(regs[RT1], "$177777"))) {
-                       p->op = CLR;
-                       strcpy(regs[RT1], regs[RT2]);
-                       regs[RT2][0] = 0;
-                       p->code = copy(1, regs[RT1]);
-                       goto sngl;
-               }
-               if ((p->op==BIC || p->op==BIS) && equstr(regs[RT1], "$0")) {
-                       if (p->forw->op!=CBR) {
-                               p->back->forw = p->forw;
-                               p->forw->back = p->back;
-                               continue;
-                       }
-               }
-               repladdr(p, 0, flt);
-               source(regs[RT1]);
-               dest(regs[RT2], flt);
-               if (p->op==DIV && (r = isreg(regs[RT2])>=0))
-                       regs[r+1][0] = 0;
-               ccloc[0] = 0;
-               continue;
-
-       case CLRF:
-       case NEGF:
-               flt = NREG;
-
-       case CLR:
-       case COM:
-       case INC:
-       case DEC:
-       case NEG:
-       case ASR:
-       case ASL:
-       case SXT:
-               singop(p);
-       sngl:
-               dest(regs[RT1], flt);
-               if (p->op==CLR && flt==0)
-                       if ((r = isreg(regs[RT1])) >= 0)
-                               savereg(r, "$0");
-                       else
-                               setcon("$0", regs[RT1]);
-               ccloc[0] = 0;
-               continue;
-
-       case TSTF:
-               flt = NREG;
-
-       case TST:
-               singop(p);
-               repladdr(p, 0, flt);
-               source(regs[RT1]);
-               if (equstr(regs[RT1], ccloc)) {
-                       p->back->forw = p->forw;
-                       p->forw->back = p->back;
-                       p = p->back;
-                       nrtst++;
-                       nchange++;
-               }
-               continue;
-
-       case CMPF:
-               flt = NREG;
-
-       case CMP:
-       case BIT:
-               dualop(p);
-               source(regs[RT1]);
-               source(regs[RT2]);
-               if(p->op==BIT) {
-                       if (equstr(regs[RT1], "$-1") || equstr(regs[RT1], "$177777")) {
-                               p->op = TST;
-                               strcpy(regs[RT1], regs[RT2]);
-                               regs[RT2][0] = 0;
-                               p->code = copy(1, regs[RT1]);
-                               nchange++;
-                               nsaddr++;
-                       } else if (equstr(regs[RT2], "$-1") || equstr(regs[RT2], "$177777")) {
-                               p->op = TST;
-                               regs[RT2][0] = 0;
-                               p->code = copy(1, regs[RT1]);
-                               nchange++;
-                               nsaddr++;
-                       }
-                       if (equstr(regs[RT1], "$0")) {
-                               p->op = TST;
-                               regs[RT2][0] = 0;
-                               p->code = copy(1, regs[RT1]);
-                               nchange++;
-                               nsaddr++;
-                       } else if (equstr(regs[RT2], "$0")) {
-                               p->op = TST;
-                               strcpy(regs[RT1], regs[RT2]);
-                               regs[RT2][0] = 0;
-                               p->code = copy(1, regs[RT1]);
-                               nchange++;
-                               nsaddr++;
-                       }
-               }
-               repladdr(p, 1, flt);
-               ccloc[0] = 0;
-               continue;
-
-       case CBR:
-               if (p->back->op==TST || p->back->op==CMP) {
-                       if (p->back->op==TST) {
-                               singop(p->back);
-                               savereg(RT2, "$0");
-                       } else
-                               dualop(p->back);
-                       r = compare(p->subop, findcon(RT1), findcon(RT2));
-                       if (r==0) {
-                               p->back->back->forw = p->forw;
-                               p->forw->back = p->back->back;
-                               decref(p->ref);
-                               p = p->back->back;
-                               nchange++;
-                       } else if (r>0) {
-                               p->op = JBR;
-                               p->subop = 0;
-                               p->back->back->forw = p;
-                               p->back = p->back->back;
-                               p = p->back;
-                               nchange++;
-                       }
-               }
-       case CFCC:
-               ccloc[0] = 0;
-               continue;
-
-       case JBR:
-               redunbr(p);
-
-       default:
-               clearreg();
-       }
-       }
-}
-
-jumpsw()
-{
-       register struct node *p, *p1;
-       register t;
-       register struct node *tp;
-       int nj;
-
-       t = 0;
-       nj = 0;
-       for (p=first.forw; p!=0; p = p->forw)
-               p->refc = ++t;
-       for (p=first.forw; p!=0; p = p1) {
-               p1 = p->forw;
-               if (p->op == CBR && p1->op==JBR && p->ref && p1->ref
-                && abs(p->refc - p->ref->refc) > abs(p1->refc - p1->ref->refc)) {
-                       if (p->ref==p1->ref)
-                               continue;
-                       p->subop = revbr[p->subop];
-                       tp = p1->ref;
-                       p1->ref = p->ref;
-                       p->ref = tp;
-                       t = p1->labno;
-                       p1->labno = p->labno;
-                       p->labno = t;
-                       nrevbr++;
-                       nj++;
-               }
-       }
-       return(nj);
-}
-
-addsob()
-{
-       register struct node *p, *p1;
-
-       for (p = &first; (p1 = p->forw)!=0; p = p1) {
-               if (p->op==DEC && isreg(p->code)>=0
-                && p1->op==CBR && p1->subop==JNE) {
-                       if (p->refc < p1->ref->refc)
-                               continue;
-                       if (toofar(p1))
-                               continue;
-                       p->labno = p1->labno;
-                       p->op = SOB;
-                       p->subop = 0;
-                       p1->forw->back = p;
-                       p->forw = p1->forw;
-                       nsob++;
-               }
-       }
-}
-
-toofar(p)
-struct node *p;
-{
-       register struct node *p1;
-       int len;
-
-       len = 0;
-       for (p1 = p->ref; p1 && p1!=p; p1 = p1->forw)
-               len += ilen(p1);
-       if (len < 128)
-               return(0);
-       return(1);
-}
-
-ilen(p)
-register struct node *p;
-{
-       register l;
-
-       switch (p->op) {
-       case LABEL:
-       case DLABEL:
-       case TEXT:
-       case EROU:
-       case EVEN:
-               return(0);
-
-       case CBR:
-               return(6);
-
-       default:
-               dualop(p);
-               return(2 + adrlen(regs[RT1]) + adrlen(regs[RT2]));
-       }
-}
-
-adrlen(s)
-register char *s;
-{
-       if (*s == 0)
-               return(0);
-       if (*s=='r')
-               return(0);
-       if (*s=='(' && *(s+1)=='r')
-               return(0);
-       if (*s=='-' && *(s+1)=='(')
-               return(0);
-       return(2);
-}
-
-abs(x)
-{
-       return(x<0? -x: x);
-}
-
-equop(ap1, p2)
-struct node *ap1, *p2;
-{
-       register char *cp1, *cp2;
-       register struct node *p1;
-
-       p1 = ap1;
-       if (p1->op!=p2->op || p1->subop!=p2->subop)
-               return(0);
-       if (p1->op>0 && p1->op<MOV)
-               return(0);
-       cp1 = p1->code;
-       cp2 = p2->code;
-       if (cp1==0 && cp2==0)
-               return(1);
-       if (cp1==0 || cp2==0)
-               return(0);
-       while (*cp1 == *cp2++)
-               if (*cp1++ == 0)
-                       return(1);
-       return(0);
-}
-
-decref(p)
-register struct node *p;
-{
-       if (--p->refc <= 0) {
-               nrlab++;
-               p->back->forw = p->forw;
-               p->forw->back = p->back;
-       }
-}
-
-struct node *
-nonlab(p)
-struct node *p;
-{
-       while (p && p->op==LABEL)
-               p = p->forw;
-       return(p);
-}
-
-char *
-alloc(n)
-register n;
-{
-       register char *p;
-
-       n++;
-       n &= ~01;
-       if (lasta+n >= lastr) {
-               if (sbrk(2000) == (char *)-1) {
-                       fprintf(stderr, "C Optimizer: out of space\n");
-                       exit(1);
-               }
-               lastr += 2000;
-       }
-       p = lasta;
-       lasta += n;
-       return(p);
-}
-
-clearreg()
-{
-       register int i;
-
-       for (i=0; i<2*NREG; i++)
-               regs[i][0] = '\0';
-       conloc[0] = 0;
-       ccloc[0] = 0;
-}
-
-savereg(ai, as)
-char *as;
-{
-       register char *p, *s, *sp;
-
-       sp = p = regs[ai];
-       s = as;
-       if (source(s))
-               return;
-       while (*p++ = *s) {
-               if (s[0]=='(' && s[1]=='r' && s[2]<'5') {
-                       *sp = 0;
-                       return;
-               }
-               if (*s++ == ',')
-                       break;
-       }
-       *--p = '\0';
-}
-
-dest(as, flt)
-char *as;
-{
-       register char *s;
-       register int i;
-
-       s = as;
-       source(s);
-       if ((i = isreg(s)) >= 0)
-               regs[i+flt][0] = 0;
-       for (i=0; i<NREG+NREG; i++)
-               if (*regs[i]=='*' && equstr(s, regs[i]+1))
-                       regs[i][0] = 0;
-       while ((i = findrand(s, flt)) >= 0)
-               regs[i][0] = 0;
-       while (*s) {
-               if ((*s=='(' && (*(s+1)!='r' || *(s+2)!='5')) || *s++=='*') {
-                       for (i=0; i<NREG+NREG; i++) {
-                               if (regs[i][0] != '$')
-                                       regs[i][0] = 0;
-                               conloc[0] = 0;
-                       }
-                       return;
-               }
-       }
-}
-
-singop(ap)
-struct node *ap;
-{
-       register char *p1, *p2;
-
-       p1 = ap->code;
-       p2 = regs[RT1];
-       while (*p2++ = *p1++);
-       regs[RT2][0] = 0;
-}
-
-
-dualop(ap)
-struct node *ap;
-{
-       register char *p1, *p2;
-       register struct node *p;
-
-       p = ap;
-       p1 = p->code;
-       p2 = regs[RT1];
-       while (*p1 && *p1!=',')
-               *p2++ = *p1++;
-       *p2++ = 0;
-       p2 = regs[RT2];
-       *p2 = 0;
-       if (*p1++ !=',')
-               return;
-       while (*p2++ = *p1++);
-}
-
-findrand(as, flt)
-char *as;
-{
-       register int i;
-       for (i = flt; i<NREG+flt; i++) {
-               if (equstr(regs[i], as))
-                       return(i);
-       }
-       return(-1);
-}
-
-isreg(as)
-char *as;
-{
-       register char *s;
-
-       s = as;
-       if (s[0]=='r' && s[1]>='0' && s[1]<='4' && s[2]==0)
-               return(s[1]-'0');
-       return(-1);
-}
-
-check()
-{
-       register struct node *p, *lp;
-
-       lp = &first;
-       for (p=first.forw; p!=0; p = p->forw) {
-               if (p->back != lp)
-                       abort();
-               lp = p;
-       }
-}
-
-source(ap)
-char *ap;
-{
-       register char *p1, *p2;
-
-       p1 = ap;
-       p2 = p1;
-       if (*p1==0)
-               return(0);
-       while (*p2++);
-       if (*p1=='-' && *(p1+1)=='('
-        || *p1=='*' && *(p1+1)=='-' && *(p1+2)=='('
-        || *(p2-2)=='+') {
-               while (*p1 && *p1++!='r');
-               if (*p1>='0' && *p1<='4')
-                       regs[*p1 - '0'][0] = 0;
-               return(1);
-       }
-       return(0);
-}
-
-repladdr(p, f, flt)
-struct node *p;
-{
-       register r;
-       int r1;
-       register char *p1, *p2;
-       static char rt1[50], rt2[50];
-
-       if (f)
-               r1 = findrand(regs[RT2], flt);
-       else
-               r1 = -1;
-       r = findrand(regs[RT1], flt);
-       if (r1 >= NREG)
-               r1 -= NREG;
-       if (r >= NREG)
-               r -= NREG;
-       if (r>=0 || r1>=0) {
-               p2 = regs[RT1];
-               for (p1 = rt1; *p1++ = *p2++;);
-               if (regs[RT2][0]) {
-                       p1 = rt2;
-                       *p1++ = ',';
-                       for (p2 = regs[RT2]; *p1++ = *p2++;);
-               } else
-                       rt2[0] = 0;
-               if (r>=0) {
-                       rt1[0] = 'r';
-                       rt1[1] = r + '0';
-                       rt1[2] = 0;
-                       nsaddr++;
-               }
-               if (r1>=0) {
-                       rt2[1] = 'r';
-                       rt2[2] = r1 + '0';
-                       rt2[3] = 0;
-                       nsaddr++;
-               }
-               p->code = copy(2, rt1, rt2);
-       }
-}
-
-movedat()
-{
-       register struct node *p1, *p2;
-       struct node *p3;
-       register seg;
-       struct node data;
-       struct node *datp;
-
-       if (first.forw == 0)
-               return;
-       if (lastseg != TEXT && lastseg != -1) {
-               p1 = (struct node *)alloc(sizeof(first));
-               p1->op = lastseg;
-               p1->subop = 0;
-               p1->code = NULL;
-               p1->forw = first.forw;
-               p1->back = &first;
-               first.forw->back = p1;
-               first.forw = p1;
-       }
-       datp = &data;
-       for (p1 = first.forw; p1!=0; p1 = p1->forw) {
-               if (p1->op == DATA) {
-                       p2 = p1->forw;
-                       while (p2 && p2->op!=TEXT)
-                               p2 = p2->forw;
-                       if (p2==0)
-                               break;
-                       p3 = p1->back;
-                       p1->back->forw = p2->forw;
-                       p2->forw->back = p3;
-                       p2->forw = 0;
-                       datp->forw = p1;
-                       p1->back = datp;
-                       p1 = p3;
-                       datp = p2;
-               }
-       }
-       if (data.forw) {
-               datp->forw = first.forw;
-               first.forw->back = datp;
-               data.forw->back = &first;
-               first.forw = data.forw;
-       }
-       seg = lastseg;
-       for (p1 = first.forw; p1!=0; p1 = p1->forw) {
-               if (p1->op==TEXT||p1->op==DATA||p1->op==BSS) {
-                       if (p2 = p1->forw) {
-                               if (p2->op==TEXT||p2->op==DATA||p2->op==BSS)
-                                       p1->op  = p2->op;
-                       }
-                       if (p1->op == seg || p1->forw&&p1->forw->op==seg) {
-                               p1->back->forw = p1->forw;
-                               p1->forw->back = p1->back;
-                               p1 = p1->back;
-                               continue;
-                       }
-                       seg = p1->op;
-               }
-       }
-}
-
-redunbr(p)
-register struct node *p;
-{
-       register struct node *p1;
-       register char *ap1;
-       char *ap2;
-
-       if ((p1 = p->ref) == 0)
-               return;
-       p1 = nonlab(p1);
-       if (p1->op==TST) {
-               singop(p1);
-               savereg(RT2, "$0");
-       } else if (p1->op==CMP)
-               dualop(p1);
-       else
-               return;
-       if (p1->forw->op!=CBR)
-               return;
-       ap1 = findcon(RT1);
-       ap2 = findcon(RT2);
-       p1 = p1->forw;
-       if (compare(p1->subop, ap1, ap2)>0) {
-               nredunj++;
-               nchange++;
-               decref(p->ref);
-               p->ref = p1->ref;
-               p->labno = p1->labno;
-               p->ref->refc++;
-       }
-}
-
-char *
-findcon(i)
-{
-       register char *p;
-       register r;
-
-       p = regs[i];
-       if (*p=='$')
-               return(p);
-       if ((r = isreg(p)) >= 0)
-               return(regs[r]);
-       if (equstr(p, conloc))
-               return(conval);
-       return(p);
-}
-
-compare(oper, cp1, cp2)
-register char *cp1, *cp2;
-{
-       register unsigned n1, n2;
-
-       if (*cp1++ != '$' || *cp2++ != '$')
-               return(-1);
-       n1 = 0;
-       while (*cp2 >= '0' && *cp2 <= '7') {
-               n1 <<= 3;
-               n1 += *cp2++ - '0';
-       }
-       n2 = n1;
-       n1 = 0;
-       while (*cp1 >= '0' && *cp1 <= '7') {
-               n1 <<= 3;
-               n1 += *cp1++ - '0';
-       }
-       if (*cp1=='+')
-               cp1++;
-       if (*cp2=='+')
-               cp2++;
-       do {
-               if (*cp1++ != *cp2)
-                       return(-1);
-       } while (*cp2++);
-       switch(oper) {
-
-       case JEQ:
-               return(n1 == n2);
-       case JNE:
-               return(n1 != n2);
-       case JLE:
-               return((int)n1 <= (int)n2);
-       case JGE:
-               return((int)n1 >= (int)n2);
-       case JLT:
-               return((int)n1 < (int)n2);
-       case JGT:
-               return((int)n1 > (int)n2);
-       case JLO:
-               return(n1 < n2);
-       case JHI:
-               return(n1 > n2);
-       case JLOS:
-               return(n1 <= n2);
-       case JHIS:
-               return(n1 >= n2);
-       }
-       return(-1);
-}
-
-setcon(ar1, ar2)
-char *ar1, *ar2;
-{
-       register char *cl, *cv, *p;
-
-       cl = ar2;
-       cv = ar1;
-       if (*cv != '$')
-               return;
-       if (!natural(cl))
-               return;
-       p = conloc;
-       while (*p++ = *cl++);
-       p = conval;
-       while (*p++ = *cv++);
-}
-
-equstr(ap1, ap2)
-char *ap1, *ap2;
-{
-       char *p1, *p2;
-
-       p1 = ap1;
-       p2 = ap2;
-       do {
-               if (*p1++ != *p2)
-                       return(0);
-       } while (*p2++);
-       return(1);
-}
-
-setcc(ap)
-char *ap;
-{
-       register char *p, *p1;
-
-       p = ap;
-       if (!natural(p)) {
-               ccloc[0] = 0;
-               return;
-       }
-       p1 = ccloc;
-       while (*p1++ = *p++);
-}
-
-natural(ap)
-char *ap;
-{
-       register char *p;
-
-       p = ap;
-       if (*p=='*' || *p=='(' || *p=='-'&&*(p+1)=='(')
-               return(0);
-       while (*p++);
-       p--;
-       if (*--p == '+' || *p ==')' && *--p != '5')
-               return(0);
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/cvopt.c b/.ref-Research-V7/usr/src/cmd/c/cvopt.c
deleted file mode 100644 (file)
index 6592641..0000000
+++ /dev/null
@@ -1,363 +0,0 @@
-#include <stdio.h>
-
-int    tabflg;
-int    labno   = 1;
-FILE   *curbuf;
-FILE   *obuf;
-
-main(argc, argv)
-char **argv;
-{
-/*
-       A1 -> A
-       A2    B
-       A     O
-       B1    C
-       B2    D
-       BE    L
-       BF    P
-       C1    E
-       C2    F
-       F     G
-       H     H
-       R     I
-       R1    J
-       S     K
-       I     M
-       M     N
-
-               *       +1
-               S       +2
-               C       +4
-               1       +8
-
-       z  -> 4
-       c     10
-       a     14
-       e     20
-       n     63
-       *       +0100
-*/
-
-       int c, snlflg, nlflg, t, smode, m, ssmode, peekc;
-
-       smode = nlflg = snlflg = ssmode = 0;
-       if (argc>1)
-               if (freopen(argv[1], "r", stdin) == NULL) {
-                       fprintf(stderr, "%s?\n", argv[1]);
-                       return(1);
-               }
-       if (argc>2) 
-               if (freopen(argv[2], "w", stdout) == NULL) {
-                       fprintf(stderr, "%s?\n", argv[2]);
-                       return(1);
-               }
-       if ((obuf = fopen("cvopt.tmp", "w")) == NULL) {
-               fprintf(stderr, "cvopt.tmp?\n");
-               exit(1);
-       }
-       curbuf = obuf;
-loop:
-       c = getchar();
-       if (c!='\n' && c!='\t')
-               nlflg = 0;
-       if (ssmode!=0 && c!='%') {
-               ssmode = 0;
-               curbuf = stdout;
-               fprintf(curbuf, "L%d:<", labno++);
-       }
-       switch(c) {
-
-       case EOF:
-               fprintf(obuf, "0\n");
-               fclose(obuf);
-               fprintf(stdout, ".even\n");
-               if (freopen("cvopt.tmp", "r", stdin) == NULL) {
-                       fprintf(stderr, "tmp?\n");
-                       exit(1);
-               }
-               while ((c = getchar()) != EOF)
-                       putchar(c);
-               unlink("cvopt.tmp");
-               return(0);
-
-       case ':':
-               if (!smode)
-                       fprintf(curbuf, "=.+2; 0"); else
-                       put(':');
-               goto loop;
-
-       case 'A':
-               if ((c=getchar())=='1' || c=='2') {
-                       put(c+'A'-'1');
-                       goto loop;
-               }
-               put('O');
-               ungetc(c, stdin);
-               goto loop;
-
-       case 'B':
-               switch (getchar()) {
-
-               case '1':
-                       put('C');
-                       goto loop;
-
-               case '2':
-                       put('D');
-                       goto loop;
-
-               case 'E':
-                       put('L');
-                       goto loop;
-
-               case 'F':
-                       put('P');
-                       goto loop;
-               }
-               put('?');
-               goto loop;
-
-       case 'C':
-               put(getchar()+'E'-'1');
-               goto loop;
-
-       case 'F':
-               put('G');
-               goto subtre;
-
-       case 'R':
-               if ((c=getchar()) == '1')
-               put('J'); else {
-                       put('I');
-                       ungetc(c, stdin);
-               }
-               goto loop;
-
-       case 'H':
-               put('H');
-               goto subtre;
-
-       case 'I':
-               put('M');
-               goto loop;
-
-       case 'S':
-               put('K');
-subtre:
-               snlflg = 1;
-               t = 'A';
-l1:
-               switch (c=getchar()) {
-
-               case '*':
-                       t++;
-                       goto l1;
-
-               case 'S':
-                       t =+ 2;
-                       goto l1;
-
-               case 'C':
-                       t =+ 4;
-                       goto l1;
-
-               case '1':
-                       t =+ 8;
-                       goto l1;
-
-               case '2':
-                       t =+ 16;
-                       goto l1;
-               }
-               ungetc(c, stdin);
-               put(t);
-               goto loop;
-
-       case '#':
-               if(getchar()=='1')
-                       put('#'); else
-                       put('"');
-               goto loop;
-
-       case '%':
-               if (smode)
-                       curbuf = obuf;
-               if (ssmode==0) {
-                       if ((peekc=getchar())=='[') {
-                               curbuf = stdout;
-                               while((c=getchar())!=']')
-                                       put(c);
-                               getchar();
-                               fprintf(curbuf, ";");
-                               curbuf = obuf;
-                               goto loop;
-                       }
-                       ungetc(peekc, stdin);
-               }
-loop1:
-               switch (c=getchar()) {
-
-               case ' ':
-               case '\t':
-                       goto loop1;
-               case 'a':
-                       m = 16;
-                       t = flag();
-                       goto pf;
-
-               case ',':
-                       put(';');
-                       goto loop1;
-
-               case 'i':
-                       m = 12;
-                       t = flag();
-                       goto pf;
-               case 'z':
-                       m = 4;
-                       t = flag();
-                       goto pf;
-
-               case 'r':
-                       m = 9;
-                       t = flag();
-                       goto pf;
-
-               case '1':
-                       m = 5;
-                       t = flag();
-                       goto pf;
-
-               case 'c':
-                       t = 0;
-                       m = 8;
-                       goto pf;
-
-               case 'e':
-                       t = flag();
-                       m = 20;
-                       goto pf;
-
-               case 'n':
-                       t = flag();
-                       m = 63;
-pf:
-                       if ((c=getchar())=='*')
-                               m =+ 0100; else
-                               ungetc(c, stdin);
-                       fprintf(curbuf, ".byte %o,%o", m, t);
-                       goto loop1;
-               case '[':
-                       fprintf(curbuf, "L%d=", labno++);
-                       while ((c=getchar())!=']')
-                               put(c);
-                       ssmode = 0;
-                       smode = 0;
-                       goto loop;
-
-               case '\n':
-                       fprintf(curbuf, "\nL%d\n", labno);
-                       ssmode = 1;
-                       nlflg = 1;
-                       smode = 1;
-                       goto loop;
-               }
-               put(c);
-               goto loop1;
-
-       case '\t':
-               if (nlflg) {
-                       nlflg = 0;
-                       goto loop;
-               }
-               if (smode) {
-                       tabflg++;
-                       goto loop;
-               }
-               put('\t');
-               goto loop;
-
-       case '\n':
-               if (!smode)  {
-                       put('\n');
-                       goto loop;
-               }
-               if (nlflg) {
-                       nlflg = 0;
-                       fprintf(curbuf, "\\0>\n");
-                       curbuf = obuf;
-                       smode = 0;
-                       goto loop;
-               }
-               if (!snlflg)
-                       fprintf(curbuf, "\\n");
-               snlflg = 0;
-               fprintf(curbuf, ">\n<");
-               nlflg = 1;
-               goto loop;
-
-       case 'X':
-       case 'Y':
-       case 'T':
-               snlflg++;
-       }
-       put(c);
-       goto loop;
-}
-
-flag() {
-       register c, f;
-
-       f = 0;
-l1:
-       switch(c=getchar()) {
-
-       case 'w':
-               f = 1;
-               goto l1;
-
-       case 'i':
-               f = 2;
-               goto l1;
-
-       case 'b':
-               f = 3;
-               goto l1;
-
-       case 'f':
-               f = 4;
-               goto l1;
-
-       case 'd':
-               f = 5;
-               goto l1;
-
-       case 'u':
-               f = 9;
-               goto l1;
-
-       case 's':
-               f = 6;
-               goto l1;
-
-       case 'l':
-               f = 8;
-               goto l1;
-
-       case 'p':
-               f =+ 16;
-               goto l1;
-       }
-       ungetc(c, stdin);
-       return(f);
-}
-
-put(c)
-{
-       if (tabflg) {
-               tabflg = 0;
-               fprintf(curbuf, ">;.byte %o;<", c+0200);
-       } else
-               putc(c, curbuf);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/c/makefile b/.ref-Research-V7/usr/src/cmd/c/makefile
deleted file mode 100644 (file)
index c7fdd05..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-CFLAGS = -O -n -s
-
-all:   c0 c1 c2
-
-cmp:   all
-       cmp c0 /lib/c0
-       cmp c1 /lib/c1
-       cmp c2 /lib/c2
-       rm c0 c1 c2 *.o
-
-cp:    all
-       cp c0 /lib/c0
-       cp c1 /lib/c1
-       cp c2 /lib/c2
-       rm c0 c1 c2 *.o
-
-fcp:   fc1
-       cp fc1 /lib/fc1
-       rm fc1 c1*.o
-
-c0: c00.o c01.o c02.o c03.o c04.o c05.o
-       cc $(CFLAGS) -o c0 c00.o c01.o c02.o c03.o c04.o c05.o
-
-c00.o c01.o c02.o c03.o c04.o c05.o: c0.h
-
-c1: c10.o c11.o c12.o c13.o table.o
-       cc $(CFLAGS) -o c1 c10.o c11.o c12.o c13.o table.o
-
-fc1: c10.o c11.o c12.o c13.o table.o
-       cc $(CFLAGS) -f -o fc1 c10.o c11.o c12.o c13.o table.o
-
-c10.o c11.o c12.o c13.o: c1.h
-
-table.o: table.s cvopt
-       cvopt <table.s >table.i
-       as -o table.o table.i
-       rm table.i
-
-c2: c20.o c21.o
-       cc -i -O -s -o c2 c20.o c21.o
-
-c20.o c21.o: c2.h
-
-cvopt: cvopt.c
-       cc $(CFLAGS) -o cvopt cvopt.c
diff --git a/.ref-Research-V7/usr/src/cmd/c/table.s b/.ref-Research-V7/usr/src/cmd/c/table.s
deleted file mode 100644 (file)
index f8ead47..0000000
+++ /dev/null
@@ -1,1601 +0,0 @@
-/
-/ c code tables-- compile to register
-/
-
-.globl _regtab
-
-.data
-_regtab=.
-       106.;   cr106
-       30.;    cr70
-       31.;    cr70
-       32.;    cr32
-       33.;    cr32
-       37.;    cr37
-       38.;    cr37
-       98.;    cr100
-       99.;    cr100
-       80.;    cr80
-       40.;    cr40
-       41.;    cr40    / - like +
-       42.;    cr42
-       43.;    cr43
-       14.;    cr43
-       44.;    cr43
-       45.;    cr45
-       46.;    cr40
-       55.;    cr40
-       48.;    cr40
-       49.;    cr49
-       70.;    cr70
-       71.;    cr70
-       72.;    cr72
-       73.;    cr73
-       74.;    cr74
-       75.;    cr75
-       76.;    cr72
-       78.;    cr70
-       85.;    cr70
-       79.;    cr79
-       102.;   cr102
-       51.;    cr51
-       52.;    cr52
-       56.;    cr56
-       57.;    cr57
-       58.;    cr58
-       59.;    cr59
-       91.;    cr91
-       82.;    cr82
-       83.;    cr82
-       84.;    cr82
-       86.;    cr86
-       87.;    cr86
-       88.;    cr86
-       16.;    cr16
-       92.;    cr92
-       17.;    cr43
-       18.;    cr74
-       109.; cr109
-       0
-.text
-
-/ goto
-cr102:
-%a,n
-       jmp     A1
-
-%n*,n
-       F*
-       jmp     #1(R)
-
-/ call
-cr100:
-%a,n
-       jsr     pc,IA1
-
-%n*,n
-       F*
-       jsr     pc,#1(R)
-
-%n,n
-       F
-       jsr     pc,(R)
-
-/ addressible
-cr106:
-%z,n
-       clr     R
-
-%zf,n
-       clrf    R
-
-%a,n
-%ad,n
-       movB1   A1,R
-
-%af,n
-       movof   A1,R
-
-%n*,n
-%nd*,n
-       F*
-       movB1   #1(R),R
-
-%nf*,n
-       F*
-       movof   #1(R),R
-
-%al,n
-       mov     A1+,R+
-       mov     A1,R
-
-%nl*,n
-       F*
-       mov     #1+2(R),R+
-       mov     #1(R),R
-
-%n,n
-       F
-
-/ ++,-- postfix
-cr32:
-%a,1
-       movB1   A1',R
-       I'B1    A1''
-
-%aw,n
-       mov     A1',R
-       I       A2,A1''
-
-%e*,1
-       F1*
-       movB1   #1(R1),R
-       I'B1    #1(R1)
-
-%n*,1
-       F*
-       movB1   #1(R),-(sp)
-       I'B1    #1(R)
-       movB1   (sp)+,R
-
-%ew*,n
-       F1*
-       mov     #1(R1),R
-       I       A2,#1(R1)
-
-%nw*,n
-       F*
-       mov     #1(R),-(sp)
-       I       A2,#1(R)
-       mov     (sp)+,R
-
-%al,1
-       F
-       I       $1,A1+
-       V       A1
-
-%el*,1
-       F1*
-       mov     #1+2(R1),R+
-       mov     #1(R1),R
-       I       $1,#1+2(R1)
-       V       #1(R1)
-
-%nl*,1
-       F*
-       mov     #1+2(R),-(sp)
-       mov     #1(R),-(sp)
-       I       $1,#1+2(R)
-       V       #1(R)
-       mov     (sp)+,R
-       mov     (sp)+,R+
-
-/ - unary, ~
-cr37:
-%n,n
-%nf,n
-       F
-       IBF     R
-
-%nl,n
-       F
-       I       R
-       I       R+
-       V       R
-
-/ =
-cr80:
-%a,n
-%ad,nf
-       S
-       movB1   R,A1
-
-%af,nf
-       S
-       movfo   R,A1
-
-%nd*,af
-       F*
-       S
-       movf    R,#1(R)
-
-%n*,aw
-       F*
-       movB1   A2,#1(R)
-       movB1   #1(R),R
-
-%nf*,af
-       F*
-       S
-       movfo   R,#1(R)
-
-%n*,e
-       F*
-       S1
-       movB1   R1,#1(R)
-       movB1   R1,R
-
-%ed*,nf
-       S
-       F1*
-       movf    R,#1(R1)
-
-%ef*,nf
-       S
-       F1*
-       movfo   R,#1(R1)
-
-%n*,n
-%nd*,nf
-       FS*
-       S
-       movB1   R,*(sp)+
-
-%nf*,nf
-       FS*
-       S
-       movfo   R,*(sp)+
-
-%al,nl
-       S
-       mov     R+,A1+
-       mov     R,A1
-
-%el*,nl
-       S
-       F1*
-       mov     R+,2+#1(R1)
-       mov     R,#1(R1)
-
-%nl*,nl
-       FS*
-       S
-       mov     R,*(sp)
-       add     $2,(sp)
-       mov     R+,*(sp)+
-
-/ field assign, value in reg.
-cr16:
-%a,n
-       S
-       bicB1   Z,A1'
-       bisB1   R,A1''
-
-%e*,n
-%      [fas1]
-
-%n*,n
-       SS
-       F*
-       bicB1   Z,#1(R)
-       bisB1   (sp),#1(R)
-       mov     (sp)+,R
-
-/ +, -, |, &~, <<
-cr40:
-%n,z
-       F
-
-%n,1
-       F
-       I'      R
-
-%[add1:]
-%n,aw
-%nf,ad
-       F
-       IB2     A2,R
-
-%[add2:]
-%n,ew*
-%nf,ed*
-       F
-       S1*
-       IB2     #2(R1),R
-
-%[add3:]
-%n,e
-%nf,ef
-       F
-       S1
-       IBF     R1,R
-
-%[add4:]
-%n,nw*
-%nf,nd*
-       SS*
-       F
-       IB2     *(sp)+,R
-
-%[add5:]
-%n,n
-%nf,nf
-       SS
-       F
-       IBF     (sp)+,R
-
-%nl,c
-%nl,au
-       F
-       I       A2,R+
-       V       R
-
-%nl,eu
-       F
-       S1
-       I       R1,R+
-       V       R
-
-%nl,al
-       F
-       I       A2,R
-       I       A2+,R+
-       V       R
-
-%[addl1:]
-%nl,el
-       F
-       S1
-       I       R1+,R+
-       V       R
-       I       R1,R
-
-%[addl2:]
-%nl,nl
-       SS
-       F
-       I       (sp)+,R
-       I       (sp)+,R+
-       V       R
-
-/ ^ -- xor
-cr49:
-%n,e
-%      [add3]
-
-%n,n
-       FS
-       S
-       xor     R,(sp)
-       mov     (sp)+,R
-
-%nl,el
-%      [addl1]
-
-%nl,nl
-       SS
-       F
-       I       R,(sp)
-       mov     (sp)+,R
-       I       R+,(sp)
-       mov     (sp)+,R+
-
-/ >> (all complicated cases taken care of by << -)
-cr45:
-%n,1
-       F
-       asr     R
-
-/ * -- R must be odd on integers
-cr42:
-%n,aw
-%nf,ad
-%      [add1]
-
-%n,ew*
-%nf,ed*
-%      [add2]
-
-%n,e
-%nf,ef
-%      [add3]
-
-%n,n
-%nf,nf
-%      [add5]
-
-/ / R must be odd on integers
-cr43:
-%n,aw
-       F
-       T
-       I       A2,R-
-
-%n,ew*
-       F
-       T
-       S1*
-       I       #2(R1),R-
-
-%n,e
-       F
-       T
-       S1
-       I       R1,R-
-
-%n,n
-       SS
-       F
-       T
-       I       (sp)+,R-
-
-%nf,ad
-%      [add1]
-
-%nf,ed*
-%      [add2]
-
-%nf,ef
-%      [add3]
-
-%nf,nf
-%      [add5]
-
-/ =+, =-, =|, =&~
-cr70:
-%[addq1:]
-%aw,aw
-       I       A2,A1'
-       mov     A1'',R
-
-%[addq1a:]
-%a,aw
-%ad,ad
-       movB1   A1',R
-       IBF     A2,R
-       movB1   R,A1''
-
-%[addq2:]
-%aw,nw*
-       S*
-       I       #2(R),A1'
-       mov     A1'',R
-
-%[addq3:]
-%aw,n
-       S
-       I       R,A1'
-       mov     A1'',R
-
-%[addq4:]
-%ew*,nw*
-       S*
-       F1*
-       I       #2(R),#1(R1)
-       mov     #1(R1),R
-
-%[addq4a:]
-%ad,ef
-       movf    A1',R
-       S1
-       IBF     R1,R
-       movf    R,A1''
-
-%[addq5:]
-%a,n
-%ad,nf
-       SS
-       movB1   A1',R
-       IBF     (sp)+,R
-       movB1   R,A1''
-
-%[addq6:]
-%af,nf
-       SS
-       movof   A1',R
-       IBF     (sp)+,R
-       movfo   R,A1''
-
-%[addq7:]
-%ew*,n
-       S
-       F1*
-       I       R,#1(R1)
-       mov     #1(R1),R
-
-%[addq8:]
-%nw*,n
-       SS
-       F*
-       I       (sp)+,#1(R)
-       mov     #1(R),R
-
-%[addq9:]
-%n*,n
-       FS*
-       SS
-       movB1   *2(sp),R
-       IBF     (sp)+,R
-       movB1   R,*(sp)+
-
-%[addq9a:]
-%nd*,nf
-       SS
-       F*
-       movB1   #1(R),R
-       IBF     (sp)+,R
-       movB1   R,#1(R)
-
-%[addq10:]
-%nf*,nf
-       SS
-       F*
-       movof   #1(R),R1
-       IBF     (sp)+,R1
-       movfo   R1,#1(R)
-       movf    R1,R
-
-%al,c
-       I       A2,A1+
-       V       A1
-       F
-
-%al,al
-       I       A2+,A1+
-       V       A1
-       I       A2,A1
-       F
-
-%al,nl
-       S
-       I       R+,A1+
-       V       A1
-       I       R,A1
-       F
-
-%nl*,c
-       F*
-       I       A2,#1+2(R)
-       V       #1(R)
-       mov     #1+2(R),R+
-       mov     #1(R),R
-
-%nl*,al
-       F*
-       I       A2+,#1+2(R)
-       V       #1(R)
-       I       A2,#1(R)
-       mov     #1+2(R),R+
-       mov     #1(R),R
-
-%nl*,nl
-       SS
-       F*
-       I       (sp)+,#1(R)
-       I       (sp)+,#1+2(R)
-       V       #1(R)
-       mov     #1+2(R),R+
-       mov     #1(R),R
-
-/ =*, =<< (for integer multiply, R must be odd)
-cr72:
-%a,aw
-%ad,ad
-%      [addq1a]
-
-%ad,ef
-%      [addq4a]
-
-%a,n
-%ad,nf
-%      [addq5]
-
-%af,nf
-%      [addq6]
-
-%n*,n
-%      [addq9]
-
-%nd*,nf
-%      [addq9a]
-
-%nf*,nf
-%      [addq10]
-
-/ =/ ;  R must be odd on integers
-cr73:
-%a,aw
-       movB1   A1',R
-       V       R-
-       IBF     A2,R-
-       movB1   R-,A1''
-
-%a,n
-       SS
-       movB1   A1',R
-       V       R-
-       I       (sp)+,R-
-       movB1   R-,A1''
-
-%e*,n
-       SS
-       F1*
-       movB1   #1(R1),R
-       V       R-
-       I       (sp)+,R-
-       movB1   R-,#1(R1)
-
-%n*,n
-       FS*
-       SS
-       movB1   *2(sp),R
-       V       R-
-       I       (sp)+,R-
-       movB1   R-,*(sp)+
-
-%ad,ad
-%      [addq1a]
-
-%ad,ef
-%      [addq4a]
-
-%ad,nf
-%      [addq5]
-
-%af,nf
-%      [addq6]
-
-%nd*,nf
-%      [addq9a]
-
-%nf*,nf
-%      [addq10]
-
-/ =mod; R must be odd on integers
-cr74:
-%a,aw
-       movB1   A1',R
-       V       R-
-       I       A2,R-
-       movB1   R,A1''
-
-%a,n
-       SS
-       movB1   A1',R
-       V       R-
-       I       (sp)+,R-
-       movB1   R,A1''
-
-%e*,n
-       SS
-       F1*
-       movB1   #1(R1),R
-       V       R-
-       I       (sp)+,R-
-       movB1   R,#1(R1)
-
-%n*,n
-       FS*
-       SS
-       movB1   *2(sp),R
-       V       R-
-       I       (sp)+,R-
-       mov     R,*(sp)+
-
-/ =^ -- =xor
-cr79:
-%aw,n
-%      [addq3]
-
-%ab,n
-       SS
-       movb    A1',R
-       xor     R,(sp)
-       mov     (sp)+,R
-       movb    R,A1''
-
-%n*,n
-       FS*
-       movB1   *(sp),-(sp)
-       S
-       xor     R,(sp)
-       movB1   (sp)+,R
-       movB1   R,*(sp)+
-
-/ =>> (all complicated cases done by =<< -)
-cr75:
-%a,1
-       asrB1   A1'
-       movB1   A1'',R
-
-%n*,1
-       F*
-       asrB1   #1(R)
-       movB1   #1(R),R
-
-/ << for longs
-cr91:
-%nl,aw
-%      [add1]
-
-%nl,ew*
-%      [add2]
-
-%nl,e
-%      [add3]
-
-%nl,nw*
-%      [add4]
-
-%nl,n
-%      [add5]
-
-/ int -> float
-cr51:
-%aw,n
-       movif   A1,R
-
-%nw*,n
-       F*
-       movif   #1(R),R
-
-%n,n
-       F
-       movif   R,R
-
-/ float, double -> int
-cr52:
-%nf,n
-       F
-       movfi   R,R
-
-/ double (float) to long
-cr56:
-%nf,n
-       F
-       setl
-       movfi   R,-(sp)
-       mov     (sp)+,R
-       mov     (sp)+,R+
-       seti
-
-/ long to double
-cr57:
-%al,n
-       setl
-       movif   A1,R
-       seti
-
-%nl*,n
-       F*
-       setl
-       movif   #1(R),R
-       seti
-
-%nl,n
-       FS
-       setl
-       movif   (sp)+,R
-       seti
-
-/ integer to long
-cr58:
-%eu,n
-       F1!
-       clr     R
-
-%nu,n
-       F
-       mov     R,R1
-       clr     R
-
-%e,n
-       F1!
-       sxt     R
-
-%n,n
-       F
-       mov     R,R1
-       sxt     R
-
-/ long to integer
-cr59:
-%al,n
-       mov     A1+,R
-
-%nl*,n
-       F*
-       mov     #1+2(R),R
-
-/ *, /, remainder for longs.
-cr82:
-%nl,nl
-       SS
-       FS
-       jsr     pc,I
-       add     $10,sp
-
-/ =*, =/, =rem for longs
-/ Operands of the form &x op y, so stack space is known.
-cr86:
-%n,nl
-       SS
-       FS
-       jsr     pc,I
-       add     $6,sp
-
-/ convert integer to character (sign extend)
-cr109:
-%n,n
-       F
-       movb    R,R
-
-/
-/ c code tables -- compile for side effects.
-/ Also set condition codes properly (except for ++, --)
-/
-
-.globl _efftab
-
-.data
-_efftab=.
-       30.;    ci70
-       31.;    ci70
-       32.;    ci70
-       33.;    ci70
-       80.;    ci80
-       70.;    ci70
-       71.;    ci70    / - like +
-       78.;    ci78
-       79.;    ci79
-       85.;    ci78
-       75.;    ci75
-       76.;    ci76
-       16.;    ci16
-       116.;   ci116
-       0
-.text
-
-/ =
-ci80:
-%[move1:]
-%a,z
-%ad,zf
-       I'B1    A1
-
-%[move2:]
-%n*,z
-%nd*,zf
-       F*
-       I'B1    #1(R)
-
-%[move3:]
-%a,aw
-%ab,a
-       IBE     A2,A1
-
-%[move4:]
-%ab,n*
-%a,nw*
-       S*
-       IBE     #2(R),A1
-
-%[move5:]
-%a,n
-       S
-       IB1     R,A1
-
-%[move6:]
-%n*,aw
-%nb*,a
-       F*
-       IBE     A2,#1(R)
-
-%[move7:]
-%n*,ew*
-%nb*,e*
-       F*
-       S1*
-       IBE     #2(R1),#1(R)
-
-%[move8:]
-%n*,e
-       F*
-       S1
-       IB1     R1,#1(R)
-
-%[move9:]
-%e*,nw*
-%eb*,n*
-       S*
-       F1*
-       IBE     #2(R),#1(R1)
-
-%[move10:]
-%e*,n
-       S
-       F1*
-       IB1     R,#1(R1)
-
-%[move11:]
-%n*,nw*
-%nb*,n*
-       FS*
-       S*
-       IBE     #2(R),*(sp)+
-
-%[move12:]
-%n*,n
-       FS*
-       S
-       IB1     R,*(sp)+
-
-%aw,nf
-       S
-       movfi   R,A1
-
-%ew*,nf
-       S
-       F1*
-       movfi   R,#1(R1)
-
-%al,z
-       clr     A1
-       clr     A1+
-
-%nl*,z
-       F*
-       clr     #1(R)
-       clr     2+#1(R)
-
-%[move13a:]
-%al,aw
-       I       A2,A1+
-       V       A1
-
-%al,nw*
-       S*
-       mov     #2(R),A1+
-       V       A1
-
-%al,n
-       S
-       mov     R,A1+
-       V       A1
-
-%al,nf
-       S
-       setl
-       movfi   R,A1
-       seti
-
-%el*,nf
-       S
-       F1*
-       setl
-       movfi   R,#1(R1)
-       seti
-
-%[move13:]
-%al,al
-       I       A2,A1
-       I       A2+,A1+
-       V       A1
-
-%[move14:]
-%al,nl*
-       S*
-       I       #2(R),A1
-       I       #2+2(R),A1+
-       V       A1
-
-%[move15:]
-%al,nl
-       S
-       I       R,A1
-       I       R+,A1+
-       V       A1
-
-%[move14a:]
-%nl*,aw
-       F*
-       I       A2,#1+2(R)
-       V       #1(R)
-
-%[move16a:]
-%nl*,al
-       F*
-       I       A2+,#1+2(R)
-       V       #1(R)
-       I       A2,#1(R)
-
-%[move16:]
-%el*,nl
-       S
-       F1*
-       I       R+,#1+2(R1)
-       V       #1(R1)
-       I       R,#1(R1)
-
-%nl*,n
-       SS
-       F*
-       mov     (sp)+,#1+2(R)
-       V       #1(R)
-
-%[move17:]
-%nl*,nl
-       SS
-       F*
-       I       (sp)+,#1(R)
-       I       (sp)+,#1+2(R)
-       V       #1(R)
-
-/ =| and =& ~
-ci78:
-%a,aw
-%ab,a
-%      [move3]
-
-%a,n
-%      [move5]
-
-%n*,aw
-%nb*,a
-%      [move6]
-
-%n*,ew*
-%nb*,e*
-%      [move7]
-
-%n*,e
-%      [move8]
-
-%e*,nw*
-%eb*,n*
-%      [move9]
-
-%e*,n
-%      [move10]
-
-%n*,nw*
-%nb*,n*
-%      [move11]
-
-%n*,n
-%      [move12]
-
-%al,c
-%al,au
-%      [move13a]
-
-%al,al
-%      [move13]
-
-%al,nl*
-%      [move14]
-
-%al,nl
-%      [move15]
-
-%nl*,c
-%      [move14a]
-
-%nl*,al
-%      [move16a]
-
-%el*,nl
-%      [move16]
-
-%nl*,nl
-%      [move17]
-
-/ =^
-ci79:
-%al,nl
-%      [move15]
-
-%el*,nl
-%      [move16]
-
-%nl*,nl
-       FS*
-       S
-       I       R,*(sp)
-       mov     (sp)+,R
-       I       R+,2(R)
-
-/ =+
-ci70:
-%n*,z
-%a,z
-
-%a,1
-       I'B1    A1
-
-%aw,aw
-%      [move3]
-
-%aw,nw*
-%      [move4]
-
-%aw,n
-%      [move5]
-
-%n*,1
-%      [move2]
-
-%ew*,nw*
-%      [move9]
-
-%a,nw*
-       S*
-       movB1   A1',R1
-       I       #2(R),R1
-       movB1   R1,A1''
-
-%a,n
-       S
-       movB1   A1',R1
-       I       R,R1
-       movB1   R1,A1''
-
-%ew*,n
-%      [move10]
-
-%nw*,n
-%      [move12]
-
-%n*,n
-       SS
-       F*
-       movB1   #1(R),R1
-       I       (sp)+,R1
-       movB1   R1,#1(R)
-
-%al,c
-%al,au
-%      [move13a]
-
-%al,al
-%      [move13]
-
-%al,nl*
-%      [move14]
-
-%al,nl
-%      [move15]
-
-%nl*,c
-%nl*,au
-%      [move14a]
-
-%nl*,al
-%      [move16a]
-
-%el*,nl
-%      [move16]
-
-%nl*,nl
-%      [move17]
-
-/ =>> (all harder cases handled by =<< -)
-ci75:
-%a,1
-       asrB1   A1
-
-%n*,1
-       F*
-       asrB1   #1(R)
-
-/ =<<
-ci76:
-%a,1
-       aslB1   A1
-
-%n*,1
-       F*
-       aslB1   #1(R)
-
-%r,aw
-       ash     A2,A1
-
-%r,nw*
-       S*
-       ash     #2(R),A1
-
-%r,n
-       S
-       ash     R,A1
-
-/ =<< for longs
-cr92:
-%al,aw
-       F
-       ashc    A2,R
-       mov     R,A1
-       mov     R+,A1+
-
-%al,n
-       SS
-       F
-       ashc    (sp)+,R
-       mov     R,A1
-       mov     R+,A1+
-
-%nl*,n
-       FS*
-       SS
-       mov     2(sp),R
-       mov     2(R),R+
-       mov     (R),R
-       ashc    (sp)+,R
-       mov     R,*(sp)
-       add     $2,(sp)
-       mov     R+,*(sp)+
-
-/ field = ...
-ci16:
-%a,a
-       bicB1   Z,A1'
-       bisB1   A2,A1''
-
-%a,n
-       S
-       bicB1   Z,A1'
-       bisB1   R,A1''
-
-%n*,a
-       F*
-       bicB1   Z,#1(R)
-       bisB1   A2,#1(R)
-
-%[fas1:]
-%e*,n
-       S
-       F1*
-       bicB1   Z,#1(R1)
-       bisB1   R,#1(R1)
-
-%n*,e
-       F*
-       S1
-       bicB1   Z,#1(R)
-       bisB1   R1,#1(R)
-
-%n*,n
-       SS
-       F*
-       bicB1   Z,#1(R)
-       bisB1   (sp)+,#1(R)
-
-/
-/ c code tables-- set condition codes
-/
-
-.globl _cctab
-
-.data
-_cctab=.
-       106.;   cc60
-       28.;    rest
-       55.;    rest
-       34.;    rest
-       35.;    rest
-       36.;    rest
-       37.;    rest
-       40.;    rest
-       41.;    rest
-       42.;    rest
-       43.;    rest
-       81.;    cc81    / & as in "if ((a&b)==0)"
-       48.;    rest
-       60.;    cc60
-       61.;    cc60
-       62.;    cc60
-       63.;    cc60
-       64.;    cc60
-       65.;    cc60
-       66.;    cc60
-       67.;    cc60
-       68.;    cc60
-       69.;    cc60
-       72.;    rest
-       73.;    rest
-       79.;    rest
-       0
-.text
-
-/ relationals
-cc60:
-%a,z
-%ad,zf
-%      [move1]
-
-%af,z
-       movof   A1,R
-
-%n*,z
-%nd*,zf
-%      [move2]
-
-%nf*,z
-       F*
-       movof   #1(R),R
-
-%n,z
-%nf,zf
-       FC
-
-%aw,aw
-%ab,ab
-%      [move3]
-
-%nw*,aw
-%nb*,ab
-%      [move6]
-
-%n,aw
-%nf,ad
-%      [add1]
-
-%nw*,ew*
-%nb*,eb*
-%      [move7]
-
-%nw*,e
-%      [move8]
-
-%n,ew*
-%nf,ed*
-%      [add2]
-
-%n,e
-%nf,ef
-%      [add3]
-
-%nw*,nw*
-%nb*,nb*
-%      [move11]
-
-%nw*,n
-%      [move12]
-
-%n,n
-%nf,nf
-%      [add5]
-
-%al,z
-       tst     A1
-       X0
-       tst     A1+
-       X1
-
-%al,c
-%al,au
-       tst     A1
-       X0
-       cmp     A1+,A2
-       X1
-
-%[lcmp1:]
-%al,al
-       I       A1,A2
-       X0
-       I       A1+,A2+
-       X1
-
-%nl*,z
-       F*
-       tst     #1(R)
-       X0
-       tst     #1+2(R)
-       X1
-
-%nl*,c
-%nl*,au
-       F*
-       tst     #1(R)
-       X0
-       cmp     #1+2(R),A2
-       X1
-
-%[lcmp2:]
-%nl*,al
-       F*
-       I       #1(R),A2
-       X0
-       I       #1+2(R),A2+
-       X1
-
-%nl,z
-       F
-       tst     R
-       X0
-       tst     R+
-       X1
-
-%nl,c
-%nl,au
-       F
-       tst     R
-       X0
-       cmp     R+,A2
-       X1
-
-%[lcmp3:]
-%nl,al
-       F
-       I       R,A2
-       X0
-       I       R+,A2+
-       X1
-
-%[lcmp4:]
-%nl*,el*
-       F*
-       S1*
-       I       #1(R),#2(R1)
-       X0
-       I       #1+2(R),#2+2(R1)
-       X1
-
-%[lcmp5:]
-%nl,el*
-       F
-       S1*
-       I       R,#2(R1)
-       X0
-       I       R+,#2+2(R1)
-       X1
-
-%[lcmp6:]
-%nl,nl
-       FS
-       S
-       mov     R,-(sp)
-       mov     4(sp),R
-       mov     (sp)+,2(sp)
-       I       (sp)+,(sp)+
-       X0
-       I       R,R+
-       X1
-
-/ & as in "if ((a&b) ==0)"
-cc81:
-%a,a
-%      [move3]
-
-%n*,a
-%      [move6]
-
-%n,a
-%      [add1]
-
-%n,e
-%      [add3]
-
-%n,n
-%      [add5]
-
-%al,c
-%al,au
-       /bit    $0,A1
-       /X0
-       bit     A2,A1+
-       X1
-
-%nl*,c
-%nl*,au
-       F*
-       /bit    $0,#2(R)
-       /X0
-       bit     A2,#2+2(R)
-       X1
-
-%al,al
-%      [lcmp1]
-
-%nl*,al
-%      [lcmp2]
-
-%nl,al
-%      [lcmp3]
-
-%nl*,el*
-%      [lcmp4]
-
-%nl,el*
-%      [lcmp5]
-
-%nl,nl
-%      [lcmp6]
-
-%nl,c
-%nl,au
-       F
-       /bit    $0,R
-       /X0
-       bit     A2,R+
-       X1
-
-/ set codes right
-rest:
-%n,n
-%nf,nf
-       H
-
-/
-/ c code tables-- expression to -(sp)
-/
-
-.globl _sptab
-
-.data
-_sptab=.
-       106.;   cs106
-       40.;    cs40
-       41.;    cs40
-       55.;    cs40
-       48.;    cs40
-       58.;    cs58
-       56.;    cs56
-       0
-.text
-
-/ name
-cs106:
-%z,n
-%zf,n
-       clrB1   -(sp)
-
-%aw,n
-       mov     A1,-(sp)
-
-%nw*,n
-       F*
-       mov     #1(R),-(sp)
-
-%al,n
-       mov     A1+,-(sp)
-       mov     A1,-(sp)
-
-/ +, -, |, &~
-cs40:
-%a,1
-       FS
-       I'      (sp)
-
-%a,aw
-       FS
-       I       A2,(sp)
-
-%a,nw*
-       FS
-       S*
-       I       #2(R),(sp)
-
-%a,n
-       FS
-       S
-       I       R,(sp)
-
-/ integer to long
-cs58:
-%nu,n
-       FS
-       clr     -(sp)
-
-%n,n
-       FS
-       sxt     -(sp)
-
-/ float to long
-cs56:
-%nf,n
-       F
-       setl
-       movfi   R,-(sp)
-       seti
-
-/ setup for structure assign
-ci116:
-%n,e
-       F!
-       S1!
-
-%n,n
-       SS
-       F!
-       mov     (sp)+,r1
-
diff --git a/.ref-Research-V7/usr/src/cmd/cal.c b/.ref-Research-V7/usr/src/cmd/cal.c
deleted file mode 100644 (file)
index 432a37d..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-char   dayw[] = {
-       " S  M Tu  W Th  F  S"
-};
-char   *smon[]= {
-       "January", "February", "March", "April",
-       "May", "June", "July", "August",
-       "September", "October", "November", "December",
-};
-char   string[432];
-main(argc, argv)
-char *argv[];
-{
-       register y, i, j;
-       int m;
-
-       if(argc < 2) {
-               printf("usage: cal [month] year\n");
-               exit(0);
-       }
-       if(argc == 2)
-               goto xlong;
-
-/*
- *     print out just month
- */
-
-       m = number(argv[1]);
-       if(m<1 || m>12)
-               goto badarg;
-       y = number(argv[2]);
-       if(y<1 || y>9999)
-               goto badarg;
-       printf("   %s %u\n", smon[m-1], y);
-       printf("%s\n", dayw);
-       cal(m, y, string, 24);
-       for(i=0; i<6*24; i+=24)
-               pstr(string+i, 24);
-       exit(0);
-
-/*
- *     print out complete year
- */
-
-xlong:
-       y = number(argv[1]);
-       if(y<1 || y>9999)
-               goto badarg;
-       printf("\n\n\n");
-       printf("                                %u\n", y);
-       printf("\n");
-       for(i=0; i<12; i+=3) {
-               for(j=0; j<6*72; j++)
-                       string[j] = '\0';
-               printf("         %.3s", smon[i]);
-               printf("                        %.3s", smon[i+1]);
-               printf("                       %.3s\n", smon[i+2]);
-               printf("%s   %s   %s\n", dayw, dayw, dayw);
-               cal(i+1, y, string, 72);
-               cal(i+2, y, string+23, 72);
-               cal(i+3, y, string+46, 72);
-               for(j=0; j<6*72; j+=72)
-                       pstr(string+j, 72);
-       }
-       printf("\n\n\n");
-       exit(0);
-
-badarg:
-       printf("Bad argument\n");
-}
-
-number(str)
-char *str;
-{
-       register n, c;
-       register char *s;
-
-       n = 0;
-       s = str;
-       while(c = *s++) {
-               if(c<'0' || c>'9')
-                       return(0);
-               n = n*10 + c-'0';
-       }
-       return(n);
-}
-
-pstr(str, n)
-char *str;
-{
-       register i;
-       register char *s;
-
-       s = str;
-       i = n;
-       while(i--)
-               if(*s++ == '\0')
-                       s[-1] = ' ';
-       i = n+1;
-       while(i--)
-               if(*--s != ' ')
-                       break;
-       s[1] = '\0';
-       printf("%s\n", str);
-}
-
-char   mon[] = {
-       0,
-       31, 29, 31, 30,
-       31, 30, 31, 31,
-       30, 31, 30, 31,
-};
-
-cal(m, y, p, w)
-char *p;
-{
-       register d, i;
-       register char *s;
-
-       s = p;
-       d = jan1(y);
-       mon[2] = 29;
-       mon[9] = 30;
-
-       switch((jan1(y+1)+7-d)%7) {
-
-       /*
-        *      non-leap year
-        */
-       case 1:
-               mon[2] = 28;
-               break;
-
-       /*
-        *      1752
-        */
-       default:
-               mon[9] = 19;
-               break;
-
-       /*
-        *      leap year
-        */
-       case 2:
-               ;
-       }
-       for(i=1; i<m; i++)
-               d += mon[i];
-       d %= 7;
-       s += 3*d;
-       for(i=1; i<=mon[m]; i++) {
-               if(i==3 && mon[m]==19) {
-                       i += 11;
-                       mon[m] += 11;
-               }
-               if(i > 9)
-                       *s = i/10+'0';
-               s++;
-               *s++ = i%10+'0';
-               s++;
-               if(++d == 7) {
-                       d = 0;
-                       s = p+w;
-                       p = s;
-               }
-       }
-}
-
-/*
- *     return day of the week
- *     of jan 1 of given year
- */
-
-jan1(yr)
-{
-       register y, d;
-
-/*
- *     normal gregorian calendar
- *     one extra day per four years
- */
-
-       y = yr;
-       d = 4+y+(y+3)/4;
-
-/*
- *     julian calendar
- *     regular gregorian
- *     less three days per 400
- */
-
-       if(y > 1800) {
-               d -= (y-1701)/100;
-               d += (y-1601)/400;
-       }
-
-/*
- *     great calendar changeover instant
- */
-
-       if(y > 1752)
-               d += 3;
-
-       return(d%7);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/calendar.c b/.ref-Research-V7/usr/src/cmd/calendar.c
deleted file mode 100644 (file)
index 35ca4e3..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* /usr/lib/calendar produces an egrep -f file
-   that will select today's and tomorrow's
-   calendar entries, with special weekend provisions
-
-   used by calendar command
-*/
-#include <time.h>
-
-#define DAY (3600*24L)
-
-char *month[] = {
-       "[Jj]an",
-       "[Ff]eb",
-       "[Mm]ar",
-       "[Aa]pr",
-       "[Mm]ay",
-       "[Jj]un",
-       "[Jj]ul",
-       "[Aa]ug",
-       "[Ss]ep",
-       "[Oo]ct",
-       "[Nn]ov",
-       "[Dd]ec"
-};
-struct tm *localtime();
-
-tprint(t)
-long t;
-{
-       struct tm *tm;
-       tm = localtime(&t);
-       printf("(^|[ (,;])((%s[^ ]* *|%d/)0*%d)([^0123456789]|$)\n",
-               month[tm->tm_mon], tm->tm_mon + 1, tm->tm_mday);
-}
-
-main()
-{
-       long t;
-       time(&t);
-       tprint(t);
-       switch(localtime(&t)->tm_wday) {
-       case 5:
-               t += DAY;
-               tprint(t);
-       case 6:
-               t += DAY;
-               tprint(t);
-       default:
-               t += DAY;
-               tprint(t);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cat.c b/.ref-Research-V7/usr/src/cmd/cat.c
deleted file mode 100644 (file)
index e0f4ef6..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Concatenate files.
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-char   stdbuf[BUFSIZ];
-
-main(argc, argv)
-char **argv;
-{
-       int fflg = 0;
-       register FILE *fi;
-       register c;
-       int dev, ino = -1;
-       struct stat statb;
-
-       setbuf(stdout, stdbuf);
-       for( ; argc>1 && argv[1][0]=='-'; argc--,argv++) {
-               switch(argv[1][1]) {
-               case 0:
-                       break;
-               case 'u':
-                       setbuf(stdout, (char *)NULL);
-                       continue;
-               }
-               break;
-       }
-       fstat(fileno(stdout), &statb);
-       statb.st_mode &= S_IFMT;
-       if (statb.st_mode!=S_IFCHR && statb.st_mode!=S_IFBLK) {
-               dev = statb.st_dev;
-               ino = statb.st_ino;
-       }
-       if (argc < 2) {
-               argc = 2;
-               fflg++;
-       }
-       while (--argc > 0) {
-               if (fflg || (*++argv)[0]=='-' && (*argv)[1]=='\0')
-                       fi = stdin;
-               else {
-                       if ((fi = fopen(*argv, "r")) == NULL) {
-                               fprintf(stderr, "cat: can't open %s\n", *argv);
-                               continue;
-                       }
-               }
-               fstat(fileno(fi), &statb);
-               if (statb.st_dev==dev && statb.st_ino==ino) {
-                       fprintf(stderr, "cat: input %s is output\n",
-                          fflg?"-": *argv);
-                       fclose(fi);
-                       continue;
-               }
-               while ((c = getc(fi)) != EOF)
-                       putchar(c);
-               if (fi!=stdin)
-                       fclose(fi);
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cb.c b/.ref-Research-V7/usr/src/cmd/cb.c
deleted file mode 100644 (file)
index 9645aa0..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-#include <stdio.h>
-int    slevel[10];
-int    clevel  = 0;
-int    spflg[20][10];
-int    sind[20][10];
-int    siflev[10];
-int    sifflg[10];
-int    iflev   = 0;
-int    ifflg   = -1;
-int    level   = 0;
-int    ind[10] = {
-       0,0,0,0,0,0,0,0,0,0 };
-int    eflg    = 0;
-int    paren   = 0;
-int    pflg[10] = {
-       0,0,0,0,0,0,0,0,0,0 };
-char   lchar;
-char   pchar;
-int    aflg    = 0;
-int    ct;
-int    stabs[20][10];
-int    qflg    = 0;
-char   *wif[] = {
-       "if",0};
-char   *welse[] = {
-       "else",0};
-char   *wfor[] = {
-       "for",0};
-char   *wds[] = {
-       "case","default",0};
-int    j       = 0;
-char   string[200];
-char   cc;
-int    sflg    = 1;
-int    peek    = -1;
-int    tabs    = 0;
-int    lastchar;
-int    c;
-main(argc,argv) int argc;
-char argv[];
-{
-       while((c = getch()) != EOF){
-               switch(c){
-               case ' ':
-               case '\t':
-                       if(lookup(welse) == 1){
-                               gotelse();
-                               if(sflg == 0 || j > 0)string[j++] = c;
-                               puts();
-                               sflg = 0;
-                               if(getnl() == 1){
-                                       puts();
-                                       printf("\n");
-                                       sflg = 1;
-                                       pflg[level]++;
-                                       tabs++;
-                               }
-                               continue;
-                       }
-                       if(sflg == 0 || j > 0)string[j++] = c;
-                       continue;
-               case '\n':
-                       if((eflg = lookup(welse)) == 1)gotelse();
-                       puts();
-                       printf("\n");
-                       sflg = 1;
-                       if(eflg == 1){
-                               pflg[level]++;
-                               tabs++;
-                       }
-                       else
-                               if(pchar == lchar)
-                                       aflg = 1;
-                       continue;
-               case '{':
-                       if(lookup(welse) == 1)gotelse();
-                       siflev[clevel] = iflev;
-                       sifflg[clevel] = ifflg;
-                       iflev = ifflg = 0;
-                       clevel++;
-                       if(sflg == 1 && pflg[level] != 0){
-                               pflg[level]--;
-                               tabs--;
-                       }
-                       string[j++] = c;
-                       puts();
-                       getnl();
-                       puts();
-                       printf("\n");
-                       tabs++;
-                       sflg = 1;
-                       if(pflg[level] > 0){
-                               ind[level] = 1;
-                               level++;
-                               slevel[level] = clevel;
-                       }
-                       continue;
-               case '}':
-                       clevel--;
-                       if((iflev = siflev[clevel]-1) < 0)iflev = 0;
-                       ifflg = sifflg[clevel];
-                       if(pflg[level] >0 && ind[level] == 0){
-                               tabs -= pflg[level];
-                               pflg[level] = 0;
-                       }
-                       puts();
-                       tabs--;
-                       ptabs();
-                       if((peek = getch()) == ';'){
-                               printf("%c;",c);
-                               peek = -1;
-                       }
-                       else printf("%c",c);
-                       getnl();
-                       puts();
-                       printf("\n");
-                       sflg = 1;
-                       if(clevel < slevel[level])if(level > 0)level--;
-                       if(ind[level] != 0){
-                               tabs -= pflg[level];
-                               pflg[level] = 0;
-                               ind[level] = 0;
-                       }
-                       continue;
-               case '"':
-               case '\'':
-                       string[j++] = c;
-                       while((cc = getch()) != c){
-                               string[j++] = cc;
-                               if(cc == '\\'){
-                                       string[j++] = getch();
-                               }
-                               if(cc == '\n'){
-                                       puts();
-                                       sflg = 1;
-                               }
-                       }
-                       string[j++] = cc;
-                       if(getnl() == 1){
-                               lchar = cc;
-                               peek = '\n';
-                       }
-                       continue;
-               case ';':
-                       string[j++] = c;
-                       puts();
-                       if(pflg[level] > 0 && ind[level] == 0){
-                               tabs -= pflg[level];
-                               pflg[level] = 0;
-                       }
-                       getnl();
-                       puts();
-                       printf("\n");
-                       sflg = 1;
-                       if(iflev > 0)
-                               if(ifflg == 1){iflev--;
-                                       ifflg = 0;
-                               }
-                               else iflev = 0;
-                       continue;
-               case '\\':
-                       string[j++] = c;
-                       string[j++] = getch();
-                       continue;
-               case '?':
-                       qflg = 1;
-                       string[j++] = c;
-                       continue;
-               case ':':
-                       string[j++] = c;
-                       if(qflg == 1){
-                               qflg = 0;
-                               continue;
-                       }
-                       if(lookup(wds) == 0){
-                               sflg = 0;
-                               puts();
-                       }
-                       else{
-                               tabs--;
-                               puts();
-                               tabs++;
-                       }
-                       if((peek = getch()) == ';'){
-                               printf(";");
-                               peek = -1;
-                       }
-                       getnl();
-                       puts();
-                       printf("\n");
-                       sflg = 1;
-                       continue;
-               case '/':
-                       string[j++] = c;
-                       if((peek = getch()) != '*')continue;
-                       string[j++] = peek;
-                       peek = -1;
-                       comment();
-                       continue;
-               case ')':
-                       paren--;
-                       string[j++] = c;
-                       puts();
-                       if(getnl() == 1){
-                               peek = '\n';
-                               if(paren != 0)aflg = 1;
-                               else if(tabs > 0){
-                                       pflg[level]++;
-                                       tabs++;
-                                       ind[level] = 0;
-                               }
-                       }
-                       continue;
-               case '#':
-                       string[j++] = c;
-                       while((cc = getch()) != '\n')string[j++] = cc;
-                       string[j++] = cc;
-                       sflg = 0;
-                       puts();
-                       sflg = 1;
-                       continue;
-               case '(':
-                       string[j++] = c;
-                       paren++;
-                       if(lookup(wfor) == 1){
-                               while((c = gets()) != ';');
-                               ct=0;
-cont:
-                               while((c = gets()) != ')'){
-                                       if(c == '(') ct++;
-                               }
-                               if(ct != 0){
-                                       ct--;
-                                       goto cont;
-                               }
-                               paren--;
-                               puts();
-                               if(getnl() == 1){
-                                       peek = '\n';
-                                       pflg[level]++;
-                                       tabs++;
-                                       ind[level] = 0;
-                               }
-                               continue;
-                       }
-                       if(lookup(wif) == 1){
-                               puts();
-                               stabs[clevel][iflev] = tabs;
-                               spflg[clevel][iflev] = pflg[level];
-                               sind[clevel][iflev] = ind[level];
-                               iflev++;
-                               ifflg = 1;
-                       }
-                       continue;
-               default:
-                       string[j++] = c;
-                       if(c != ',')lchar = c;
-               }
-       }
-}
-ptabs(){
-       int i;
-       for(i=0; i < tabs; i++)printf("\t");
-}
-getch(){
-       if(peek < 0 && lastchar != ' ' && lastchar != '\t')pchar = lastchar;
-       lastchar = (peek<0) ? getc(stdin):peek;
-       peek = -1;
-       return(lastchar);
-}
-puts(){
-       if(j > 0){
-               if(sflg != 0){
-                       ptabs();
-                       sflg = 0;
-                       if(aflg == 1){
-                               aflg = 0;
-                               if(tabs > 0)printf("    ");
-                       }
-               }
-               string[j] = '\0';
-               printf("%s",string);
-               j = 0;
-       }
-       else{
-               if(sflg != 0){
-                       sflg = 0;
-                       aflg = 0;
-               }
-       }
-}
-lookup(tab)
-char *tab[];
-{
-       char r;
-       int l,kk,k,i;
-       if(j < 1)return(0);
-       kk=0;
-       while(string[kk] == ' ')kk++;
-       for(i=0; tab[i] != 0; i++){
-               l=0;
-               for(k=kk;(r = tab[i][l++]) == string[k] && r != '\0';k++);
-               if(r == '\0' && (string[k] < 'a' || string[k] > 'z' || k >= j))return(1);
-       }
-       return(0);
-}
-gets(){
-       char ch;
-beg:
-       if((ch = string[j++] = getch()) == '\\'){
-               string[j++] = getch();
-               goto beg;
-       }
-       if(ch == '\'' || ch == '"'){
-               while((cc = string[j++] = getch()) != ch)if(cc == '\\')string[j++] = getch();
-               goto beg;
-       }
-       if(ch == '\n'){
-               puts();
-               aflg = 1;
-               goto beg;
-       }
-       else return(ch);
-}
-gotelse(){
-       tabs = stabs[clevel][iflev];
-       pflg[level] = spflg[clevel][iflev];
-       ind[level] = sind[clevel][iflev];
-       ifflg = 1;
-}
-getnl(){
-       while((peek = getch()) == '\t' || peek == ' '){
-               string[j++] = peek;
-               peek = -1;
-       }
-       if((peek = getch()) == '/'){
-               peek = -1;
-               if((peek = getch()) == '*'){
-                       string[j++] = '/';
-                       string[j++] = '*';
-                       peek = -1;
-                       comment();
-               }
-               else string[j++] = '/';
-       }
-       if((peek = getch()) == '\n'){
-               peek = -1;
-               return(1);
-       }
-       return(0);
-}
-comment(){
-rep:
-       while((c = string[j++] = getch()) != '*')
-               if(c == '\n'){
-                       puts();
-                       sflg = 1;
-               }
-gotstar:
-       if((c = string[j++] = getch()) != '/'){
-               if(c == '*')goto gotstar;
-               goto rep;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cc.c b/.ref-Research-V7/usr/src/cmd/cc.c
deleted file mode 100644 (file)
index 017a03c..0000000
+++ /dev/null
@@ -1,467 +0,0 @@
-#
-# include <stdio.h>
-# include <ctype.h>
-# include <signal.h>
-
-/* cc command */
-
-# define MAXINC 10
-# define MAXFIL 100
-# define MAXLIB 100
-# define MAXOPT 100
-char   *tmp0;
-char   *tmp1;
-char   *tmp2;
-char   *tmp3;
-char   *tmp4;
-char   *tmp5;
-char   *outfile;
-# define CHSPACE 1000
-char   ts[CHSPACE+50];
-char   *tsa = ts;
-char   *tsp = ts;
-char   *av[50];
-char   *clist[MAXFIL];
-char   *llist[MAXLIB];
-int    pflag;
-int    sflag;
-int    cflag;
-int    eflag;
-int    exflag;
-int    oflag;
-int    proflag;
-int    noflflag;
-char   *chpass ;
-char   *npassname ;
-char   pass0[20] = "/lib/c0";
-char   pass1[20] = "/lib/c1";
-char   pass2[20] = "/lib/c2";
-char   passp[20] = "/lib/cpp";
-char   *pref = "/lib/crt0.o";
-char   *copy();
-char   *setsuf();
-char   *strcat();
-char   *strcpy();
-
-main(argc, argv)
-char *argv[]; 
-{
-       char *t;
-       char *savetsp;
-       char *assource;
-       char **pv, *ptemp[MAXOPT], **pvt;
-       int nc, nl, i, j, c, f20, nxo, na;
-       int idexit();
-
-       i = nc = nl = f20 = nxo = 0;
-       setbuf(stdout, (char *)NULL);
-       pv = ptemp;
-       while(++i < argc) {
-               if(*argv[i] == '-') switch (argv[i][1]) {
-               default:
-                       goto passa;
-               case 'S':
-                       sflag++;
-                       cflag++;
-                       break;
-               case 'o':
-                       if (++i < argc) {
-                               outfile = argv[i];
-                               if ((c=getsuf(outfile))=='c'||c=='o') {
-                                       error("Would overwrite %s", outfile);
-                                       exit(8);
-                               }
-                       }
-                       break;
-               case 'O':
-                       oflag++;
-                       break;
-               case 'p':
-                       proflag++;
-                       break;
-               case 'E':
-                       exflag++;
-               case 'P':
-                       pflag++;
-                       *pv++ = argv[i];
-               case 'c':
-                       cflag++;
-                       break;
-
-               case 'f':
-                       noflflag++;
-                       if (npassname || chpass)
-                               error("-f overwrites earlier option", (char *)NULL);
-                       npassname = "/lib/f";
-                       chpass = "1";
-                       break;
-
-               case '2':
-                       if(argv[i][2] == '\0')
-                               pref = "/lib/crt2.o";
-                       else {
-                               pref = "/lib/crt20.o";
-                               f20 = 1;
-                       }
-                       break;
-               case 'D':
-               case 'I':
-               case 'U':
-               case 'C':
-                       *pv++ = argv[i];
-                       if (pv >= ptemp+MAXOPT) {
-                               error("Too many DIUC options", (char *)NULL);
-                               --pv;
-                       }
-                       break;
-               case 't':
-                       if (chpass)
-                               error("-t overwrites earlier option", (char *)NULL);
-                       chpass = argv[i]+2;
-                       if (chpass[0]==0)
-                               chpass = "012p";
-                       break;
-
-               case 'B':
-                       if (npassname)
-                               error("-B overwrites earlier option", (char *)NULL);
-                       npassname = argv[i]+2;
-                       if (npassname[0]==0)
-                               npassname = "/usr/src/cmd/c/o";
-                       break;
-               } 
-               else {
-passa:
-                       t = argv[i];
-                       if((c=getsuf(t))=='c' || c=='s'|| exflag) {
-                               clist[nc++] = t;
-                               if (nc>=MAXFIL) {
-                                       error("Too many source files", (char *)NULL);
-                                       exit(1);
-                               }
-                               t = setsuf(t, 'o');
-                       }
-                       if (nodup(llist, t)) {
-                               llist[nl++] = t;
-                               if (nl >= MAXLIB) {
-                                       error("Too many object/library files", (char *)NULL);
-                                       exit(1);
-                               }
-                               if (getsuf(t)=='o')
-                                       nxo++;
-                       }
-               }
-       }
-       if (npassname && chpass ==0)
-               chpass = "012p";
-       if (chpass && npassname==0)
-               npassname = "/usr/src/cmd/c/";
-       if (chpass)
-               for (t=chpass; *t; t++) {
-                       switch (*t) {
-                       case '0':
-                               strcpy (pass0, npassname);
-                               strcat (pass0, "c0");
-                               continue;
-                       case '1':
-                               strcpy (pass1, npassname);
-                               strcat (pass1, "c1");
-                               continue;
-                       case '2':
-                               strcpy (pass2, npassname);
-                               strcat (pass2, "c2");
-                               continue;
-                       case 'p':
-                               strcpy (passp, npassname);
-                               strcat (passp, "cpp");
-                               continue;
-                       }
-               }
-       if (noflflag)
-               pref = proflag ? "/lib/fmcrt0.o" : "/lib/fcrt0.o";
-       else if (proflag)
-               pref = "/lib/mcrt0.o";
-       if(nc==0)
-               goto nocom;
-       if (pflag==0) {
-               tmp0 = copy("/tmp/ctm0a");
-               while (access(tmp0, 0)==0)
-                       tmp0[9]++;
-               while((creat(tmp0, 0400))<0) {
-                       if (tmp0[9]=='z') {
-                               error("cc: cannot create temp", NULL);
-                               exit(1);
-                       }
-                       tmp0[9]++;
-               }
-       }
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, idexit);
-       if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
-               signal(SIGTERM, idexit);
-       (tmp1 = copy(tmp0))[8] = '1';
-       (tmp2 = copy(tmp0))[8] = '2';
-       (tmp3 = copy(tmp0))[8] = '3';
-       if (oflag)
-               (tmp5 = copy(tmp0))[8] = '5';
-       if (pflag==0)
-               (tmp4 = copy(tmp0))[8] = '4';
-       pvt = pv;
-       for (i=0; i<nc; i++) {
-               if (nc>1)
-                       printf("%s:\n", clist[i]);
-               if (getsuf(clist[i])=='s') {
-                       assource = clist[i];
-                       goto assemble;
-               } 
-               else
-                       assource = tmp3;
-               if (pflag)
-                       tmp4 = setsuf(clist[i], 'i');
-               savetsp = tsp;
-               av[0] = "cpp";
-               av[1] = clist[i];
-               av[2] = exflag ? "-" : tmp4;
-               na = 3;
-               for(pv=ptemp; pv <pvt; pv++)
-                       av[na++] = *pv;
-               av[na++]=0;
-               if (callsys(passp, av)) {
-                       cflag++;
-                       eflag++;
-                       continue;
-               }
-               av[1] = tmp4;
-               tsp = savetsp;
-               av[0]= "c0";
-               if (pflag) {
-                       cflag++;
-                       continue;
-               }
-               av[2] = tmp1;
-               av[3] = tmp2;
-               if (proflag) {
-                       av[4] = "-P";
-                       av[5] = 0;
-               } 
-               else
-                       av[4] = 0;
-               if (callsys(pass0, av)) {
-                       cflag++;
-                       eflag++;
-                       continue;
-               }
-               av[0] = "c1";
-               av[1] = tmp1;
-               av[2] = tmp2;
-               if (sflag)
-                       assource = tmp3 = setsuf(clist[i], 's');
-               av[3] = tmp3;
-               if (oflag)
-                       av[3] = tmp5;
-               av[4] = 0;
-               if(callsys(pass1, av)) {
-                       cflag++;
-                       eflag++;
-                       continue;
-               }
-               if (oflag) {
-                       av[0] = "c2";
-                       av[1] = tmp5;
-                       av[2] = tmp3;
-                       av[3] = 0;
-                       if (callsys(pass2, av)) {
-                               unlink(tmp3);
-                               tmp3 = assource = tmp5;
-                       } 
-                       else
-                               unlink(tmp5);
-               }
-               if (sflag)
-                       continue;
-assemble:
-               av[0] = "as";
-               av[1] = "-u";
-               av[2] = "-o";
-               av[3] = setsuf(clist[i], 'o');
-               av[4] = assource;
-               av[5] = 0;
-               cunlink(tmp1);
-               cunlink(tmp2);
-               cunlink(tmp4);
-               if (callsys("/bin/as", av) > 1) {
-                       cflag++;
-                       eflag++;
-                       continue;
-               }
-       }
-nocom:
-       if (cflag==0 && nl!=0) {
-               i = 0;
-               av[0] = "ld";
-               av[1] = "-X";
-               av[2] = pref;
-               j = 3;
-               if (noflflag) {
-                       j = 4;
-                       av[3] = "-lfpsim";
-               }
-               if (outfile) {
-                       av[j++] = "-o";
-                       av[j++] = outfile;
-               }
-               while(i<nl)
-                       av[j++] = llist[i++];
-               if(f20)
-                       av[j++] = "-l2";
-               else {
-                       av[j++] = "-lc";
-               }
-               av[j++] = 0;
-               eflag |= callsys("/bin/ld", av);
-               if (nc==1 && nxo==1 && eflag==0)
-                       cunlink(setsuf(clist[0], 'o'));
-       }
-       dexit();
-}
-
-idexit()
-{
-       eflag = 100;
-       dexit();
-}
-
-dexit()
-{
-       if (!pflag) {
-               cunlink(tmp1);
-               cunlink(tmp2);
-               if (sflag==0)
-                       cunlink(tmp3);
-               cunlink(tmp4);
-               cunlink(tmp5);
-               cunlink(tmp0);
-       }
-       exit(eflag);
-}
-
-error(s, x)
-char *s, *x;
-{
-       fprintf(exflag?stderr:stdout, s, x);
-       putc('\n', exflag? stderr : stdout);
-       cflag++;
-       eflag++;
-}
-
-
-
-
-getsuf(as)
-char as[];
-{
-       register int c;
-       register char *s;
-       register int t;
-
-       s = as;
-       c = 0;
-       while(t = *s++)
-               if (t=='/')
-                       c = 0;
-               else
-                       c++;
-       s -= 3;
-       if (c<=14 && c>2 && *s++=='.')
-               return(*s);
-       return(0);
-}
-
-char *
-setsuf(as, ch)
-char *as;
-{
-       register char *s, *s1;
-
-       s = s1 = copy(as);
-       while(*s)
-               if (*s++ == '/')
-                       s1 = s;
-       s[-1] = ch;
-       return(s1);
-}
-
-callsys(f, v)
-char f[], *v[]; 
-{
-       int t, status;
-
-       if ((t=fork())==0) {
-               execv(f, v);
-               printf("Can't find %s\n", f);
-               exit(100);
-       } else
-               if (t == -1) {
-                       printf("Try again\n");
-                       return(100);
-               }
-       while(t!=wait(&status))
-               ;
-       if (t = status&0377) {
-               if (t!=SIGINT) {
-                       printf("Fatal error in %s\n", f);
-                       eflag = 8;
-               }
-               dexit();
-       }
-       return((status>>8) & 0377);
-}
-
-char *
-copy(as)
-char *as;
-{
-       char *malloc();
-       register char *otsp, *s;
-
-       otsp = tsp;
-       s = as;
-       while (*tsp++ = *s++)
-               ;
-       if (tsp > tsa+CHSPACE) {
-               tsp = tsa = malloc(CHSPACE+50);
-               if (tsp==NULL) {
-                       error("no space for file names", (char *)NULL);
-                       dexit();
-               }
-       }
-       return(otsp);
-}
-
-nodup(l, os)
-char **l, *os;
-{
-       register char *t, *s;
-       register int c;
-
-       s = os;
-       if (getsuf(s) != 'o')
-               return(1);
-       while(t = *l++) {
-               while(c = *s++)
-                       if (c != *t++)
-                               break;
-               if (*t=='\0' && c=='\0')
-                       return(0);
-               s = os;
-       }
-       return(1);
-}
-
-cunlink(f)
-char *f;
-{
-       if (f==NULL)
-               return;
-       unlink(f);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/checkeq.c b/.ref-Research-V7/usr/src/cmd/checkeq.c
deleted file mode 100644 (file)
index 7d473a8..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <stdio.h>
-FILE   *fin;
-int    delim   = 0;
-/* today's version assumes no delimiters;
-they must be explicitly set
-*/
-
-main(argc, argv) char **argv; {
-
-       while (argc > 1 && argv[1][0] == '-') {
-               switch (argv[1][1]) {
-               case 'd':
-                       delim = argv[1][2];
-                       break;
-               }
-               argc--;
-               argv++;
-       }
-       if (argc <= 1)
-               check(stdin);
-       else
-               while (--argc > 0) {
-                       if ((fin = fopen(*++argv, "r")) == NULL) {
-                               printf("Can't open %s\n", *argv);
-                               exit(1);
-                       }
-                       printf("%s:\n", *argv);
-                       check(fin);
-                       fclose(fin);
-               }
-}
-
-check(f)
-FILE   *f;
-{
-       int start, line, eq, ndel, totdel;
-       char in[600], *p;
-
-       start = eq = line = ndel = totdel = 0;
-       while (fgets(in, 600, f) != NULL) {
-               line++;
-               ndel = 0;
-               for (p = in; *p; p++)
-                       if (*p == delim)
-                               ndel++;
-               if (*in=='.' && *(in+1)=='E' && *(in+2)=='Q') {
-                       if (eq++)
-                               printf("   Spurious EQ, line %d\n", line);
-                       if (totdel)
-                               printf("   EQ in %c%c, line %d\n", delim, delim, line);
-               } else if (*in=='.' && *(in+1)=='E' && *(in+2)=='N') {
-                       if (eq==0)
-                               printf("   Spurious EN, line %d\n", line);
-                       else
-                               eq = 0;
-                       if (totdel > 0)
-                               printf("   EN in %c%c, line %d\n", delim, delim, line);
-                       start = 0;
-               } else if (eq && *in=='d' && *(in+1)=='e' && *(in+2)=='l' && *(in+3)=='i' && *(in+4)=='m') {
-                       for (p=in+5; *p; p++)
-                               if (*p != ' ') {
-                                       if (*p == 'o' && *(p+1) == 'f')
-                                               delim = 0;
-                                       else {
-                                               delim = *p;
-                                               ndel = totdel = 0;
-                                       }
-                                       break;
-                               }
-                       if (delim == 0)
-                               printf("   Delim off, line %d\n", line);
-                       else
-                               printf("   New delims %c%c, line %d\n", delim, delim, line);
-               }
-               if (ndel > 0 && eq > 0)
-                       printf("   %c%c in EQ, line %d\n", delim, delim, line);
-               if (ndel == 0)
-                       continue;
-               totdel += ndel;
-               if (totdel%2) {
-                       if (start == 0)
-                               start = line;
-                       else {
-                               printf("   %d line %c%c, lines %d-%d\n", line-start+1, delim, delim, start, line);
-                               start = line;
-                       }
-               } else {
-                       if (start > 0) {
-                               printf("   %d line %c%c, lines %d-%d\n", line-start+1, delim, delim, start, line);
-                               start = 0;
-                       }
-                       totdel = 0;
-               }
-       }
-       if (totdel)
-               printf("   Unfinished %c%c\n", delim, delim);
-       if (eq)
-               printf("   Unfinished EQ\n");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/chgrp.c b/.ref-Research-V7/usr/src/cmd/chgrp.c
deleted file mode 100644 (file)
index 13b23ff..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * chgrp gid file ...
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <grp.h>
-
-struct group   *gr,*getgrnam();
-struct stat    stbuf;
-int    gid;
-int    status;
-
-main(argc, argv)
-char *argv[];
-{
-       register c;
-
-       if(argc < 3) {
-               printf("usage: chgrp gid file ...\n");
-               exit(4);
-       }
-       if(isnumber(argv[1])) {
-               gid = atoi(argv[1]);
-       } else {
-               if((gr=getgrnam(argv[1])) == NULL) {
-                       printf("unknown group: %s\n",argv[1]);
-                       exit(4);
-               }
-               gid = gr->gr_gid;
-       }
-       for(c=2; c<argc; c++) {
-               stat(argv[c], &stbuf);
-               if(chown(argv[c], stbuf.st_uid, gid) < 0) {
-                       perror(argv[c]);
-                       status = 1;
-               }
-       }
-       exit(status);
-}
-
-isnumber(s)
-char *s;
-{
-       register c;
-
-       while(c = *s++)
-               if(!isdigit(c))
-                       return(0);
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/chmod.c b/.ref-Research-V7/usr/src/cmd/chmod.c
deleted file mode 100644 (file)
index 4d09ad0..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * chmod [ugoa][+-=][rwxstugo] files
- *  change mode of files
- */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#define        USER    05700   /* user's bits */
-#define        GROUP   02070   /* group's bits */
-#define        OTHER   00007   /* other's bits */
-#define        ALL     01777   /* all (note absence of setuid, etc) */
-
-#define        READ    00444   /* read permit */
-#define        WRITE   00222   /* write permit */
-#define        EXEC    00111   /* exec permit */
-#define        SETID   06000   /* set[ug]id */
-#define        STICKY  01000   /* sticky bit */
-
-char   *ms;
-int    um;
-struct stat st;
-
-main(argc,argv)
-char **argv;
-{
-       register i;
-       register char *p;
-       int status = 0;
-
-       if (argc < 3) {
-               fprintf(stderr, "Usage: chmod [ugoa][+-=][rwxstugo] file ...\n");
-               exit(255);
-       }
-       ms = argv[1];
-       um = umask(0);
-       newmode(0);
-       for (i = 2; i < argc; i++) {
-               p = argv[i];
-               if (stat(p, &st) < 0) {
-                       fprintf(stderr, "chmod: can't access %s\n", p);
-                       ++status;
-                       continue;
-               }
-               ms = argv[1];
-               if (chmod(p, newmode(st.st_mode)) < 0) {
-                       fprintf(stderr, "chmod: can't change %s\n", p);
-                       ++status;
-                       continue;
-               }
-       }
-       exit(status);
-}
-
-newmode(nm)
-unsigned nm;
-{
-       register o, m, b;
-
-       m = abs();
-       if (!*ms)
-               return(m);
-       do {
-               m = who();
-               while (o = what()) {
-                       b = where(nm);
-                       switch (o) {
-                       case '+':
-                               nm |= b & m;
-                               break;
-                       case '-':
-                               nm &= ~(b & m);
-                               break;
-                       case '=':
-                               nm &= ~m;
-                               nm |= b & m;
-                               break;
-                       }
-               }
-       } while (*ms++ == ',');
-       if (*--ms) {
-               fprintf(stderr, "chmod: invalid mode\n");
-               exit(255);
-       }
-       return(nm);
-}
-
-abs()
-{
-       register c, i;
-
-       i = 0;
-       while ((c = *ms++) >= '0' && c <= '7')
-               i = (i << 3) + (c - '0');
-       ms--;
-       return(i);
-}
-
-who()
-{
-       register m;
-
-       m = 0;
-       for (;;) switch (*ms++) {
-       case 'u':
-               m |= USER;
-               continue;
-       case 'g':
-               m |= GROUP;
-               continue;
-       case 'o':
-               m |= OTHER;
-               continue;
-       case 'a':
-               m |= ALL;
-               continue;
-       default:
-               ms--;
-               if (m == 0)
-                       m = ALL & ~um;
-               return m;
-       }
-}
-
-what()
-{
-       switch (*ms) {
-       case '+':
-       case '-':
-       case '=':
-               return *ms++;
-       }
-       return(0);
-}
-
-where(om)
-register om;
-{
-       register m;
-
-       m = 0;
-       switch (*ms) {
-       case 'u':
-               m = (om & USER) >> 6;
-               goto dup;
-       case 'g':
-               m = (om & GROUP) >> 3;
-               goto dup;
-       case 'o':
-               m = (om & OTHER);
-       dup:
-               m &= (READ|WRITE|EXEC);
-               m |= (m << 3) | (m << 6);
-               ++ms;
-               return m;
-       }
-       for (;;) switch (*ms++) {
-       case 'r':
-               m |= READ;
-               continue;
-       case 'w':
-               m |= WRITE;
-               continue;
-       case 'x':
-               m |= EXEC;
-               continue;
-       case 's':
-               m |= SETID;
-               continue;
-       case 't':
-               m |= STICKY;
-               continue;
-       default:
-               ms--;
-               return m;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/chown.c b/.ref-Research-V7/usr/src/cmd/chown.c
deleted file mode 100644 (file)
index edfa00e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * chown uid file ...
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pwd.h>
-
-struct passwd  *pwd,*getpwnam();
-struct stat    stbuf;
-int    uid;
-int    status;
-
-main(argc, argv)
-char *argv[];
-{
-       register c;
-
-       if(argc < 3) {
-               printf("usage: chown uid file ...\n");
-               exit(4);
-       }
-       if(isnumber(argv[1])) {
-               uid = atoi(argv[1]);
-               goto cho;
-       }
-       if((pwd=getpwnam(argv[1])) == NULL) {
-               printf("unknown user id: %s\n",argv[1]);
-               exit(4);
-       }
-       uid = pwd->pw_uid;
-
-cho:
-       for(c=2; c<argc; c++) {
-               stat(argv[c], &stbuf);
-               if(chown(argv[c], uid, stbuf.st_gid) < 0) {
-                       perror(argv[c]);
-                       status = 1;
-               }
-       }
-       exit(status);
-}
-
-isnumber(s)
-char *s;
-{
-       register c;
-
-       while(c = *s++)
-               if(!isdigit(c))
-                       return(0);
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/clri.c b/.ref-Research-V7/usr/src/cmd/clri.c
deleted file mode 100644 (file)
index d4da6de..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * clri filsys inumber ...
- */
-
-#include <sys/types.h>
-#include <sys/ino.h>
-#define ISIZE  (sizeof(struct dinode))
-#define        BSIZE   512
-#define        NI      (BSIZE/ISIZE)
-struct ino
-{
-       char    junk[ISIZE];
-};
-struct ino     buf[NI];
-int    status;
-
-main(argc, argv)
-char *argv[];
-{
-       register i, f;
-       unsigned n;
-       int j, k;
-       long off;
-
-       if(argc < 3) {
-               printf("usage: clri filsys inumber ...\n");
-               exit(4);
-       }
-       f = open(argv[1], 2);
-       if(f < 0) {
-               printf("cannot open %s\n", argv[1]);
-               exit(4);
-       }
-       for(i=2; i<argc; i++) {
-               if(!isnumber(argv[i])) {
-                       printf("%s: is not a number\n", argv[i]);
-                       status = 1;
-                       continue;
-               }
-               n = atoi(argv[i]);
-               if(n == 0) {
-                       printf("%s: is zero\n", argv[i]);
-                       status = 1;
-                       continue;
-               }
-               off = ((n-1)/NI + 2) * (long)512;
-               lseek(f, off, 0);
-               if(read(f, (char *)buf, BSIZE) != BSIZE) {
-                       printf("%s: read error\n", argv[i]);
-                       status = 1;
-               }
-       }
-       if(status)
-               exit(status);
-       for(i=2; i<argc; i++) {
-               n = atoi(argv[i]);
-               printf("clearing %u\n", n);
-               off = ((n-1)/NI + 2) * (long)512;
-               lseek(f, off, 0);
-               read(f, (char *)buf, BSIZE);
-               j = (n-1)%NI;
-               for(k=0; k<ISIZE; k++)
-                       buf[j].junk[k] = 0;
-               lseek(f, off, 0);
-               write(f, (char *)buf, BSIZE);
-       }
-       exit(status);
-}
-
-isnumber(s)
-char *s;
-{
-       register c;
-
-       while(c = *s++)
-               if(c < '0' || c > '9')
-                       return(0);
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cmake b/.ref-Research-V7/usr/src/cmd/cmake
deleted file mode 100755 (executable)
index 27e8279..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-C=
-for a
-do
-       s=.c
-       case $a in
-       *.y)    s=.y ;;
-       *.s)    s=.s ;;
-       esac
-       b=`basename $a $s`
-       D=/bin
-       echo $a:
-       case $b in
-       -cmp)   C=cmp
-               continue ;;
-       -cp)    C=cp
-               continue ;;
-       ac)     cc -n -s -O ac.c -o ac ;;
-       accton) cc -n -s -O accton.c -o accton; D=/etc ;;
-       ar)     cc -n -s -O ar.c -o ar ;;
-       arcv)   cc -n -s -O arcv.c -o arcv ;;
-       at)     cc -n -s -O at.c -o at ;;
-       atrun)  cc -n -s -O atrun.c -o atrun; D=/usr/lib ;;
-       basename)       cc -n -s -O basename.c -o basename ;;
-       bc)     yacc bc.y && mv y.tab.c bc.c && cc -n -s -O bc.c -o bc && rm bc.c ;;
-       cal)    cc -n -s -O cal.c -o cal ;;
-       calendar)       cc -n -s -O calendar.c -o calendar; D=/usr/lib ;;
-       cat)    cc -n -s -O cat.c -o cat ;;
-       cb)     cc -n -s -O cb.c -o cb ;;
-       cc)     cc -n -s -O cc.c -o cc ;;
-       checkeq)        cc -n -s -O checkeq.c -o checkeq ;;
-       chgrp)  cc -n -s -O chgrp.c -o chgrp ;;
-       chmod)  cc -n -s -O chmod.c -o chmod ;;
-       chown)  cc -n -s -O chown.c -o chown ;;
-       clri)   cc -n -s -O clri.c -o clri ;;
-       cmp)    cc -n -s -O cmp.c -o cmp ;;
-       col)    cc -n -s -O col.c -o col ;;
-       comm)   cc -n -s -O comm.c -o comm ;;
-       cp)     cc -n -s -O cp.c -o cp ;;
-       cron)   cc -n -s -O cron.c -o cron; D=/etc ;;
-       crypt)  cc -n -s -O crypt.c -o crypt ;;
-       cu)     cc -n -s -O cu.c -o cu ;;
-       date)   cc -n -s -O date.c -o date ;;
-       dcheck) cc -i -s -O dcheck.c -o dcheck ;;
-       dd)     cc -i -s -O dd.c -o dd ;;
-       deroff) cc -n -s -O deroff.c -o deroff ;;
-       df)     cc -n -s -O df.c -o df ;;
-       diff)   cc -n -s -O diff.c -o diff ;;
-       diff3)  cc -n -s -O diff3.c -o diff3; D=/usr/lib ;;
-       diffh)  cc -n -s -O diffh.c -o diffh; D=/usr/lib ;;
-       dmesg)  cc -n -s -O dmesg.c -o dmesg; D=/etc ;;
-       du)     cc -n -s -O du.c -o du ;;
-       dump)   cc -n -s -O dump.c -o dump ;;
-       dumpdir)        cc -n -s -O dumpdir.c -o dumpdir ;;
-       echo)   cc -n -s -O echo.c -o echo ;;
-       ed)     cc -n -s -O ed.c -o ed ;;
-       egrep)  yacc egrep.y && mv y.tab.c egrep.c && cc -n -s -O egrep.c -o egrep && rm egrep.c ;;
-       expr)   yacc expr.y && mv y.tab.c expr.c && cc -n -s -O expr.c -o expr && rm expr.c ;;
-       factor) as -o factor factor.s && strip factor;;
-       fgrep)  cc -i -s -O fgrep.c -o fgrep ;;
-       file)   cc -n -s -O file.c -o file ;;
-       find)   cc -n -s -O find.c -o find ;;
-       getty)  cc -n -s -O getty.c -o getty; D=/etc ;;
-       graph)  cc -n -s -O graph.c -o graph -lplot -lm ;;
-       grep)   cc -n -s -O grep.c -o grep ;;
-       icheck) cc -i -s -O icheck.c -o icheck ;;
-       init)   cc -n -s -O init.c -o init; D=/etc ;;
-       iostat) cc -n -s -O iostat.c -o iostat ;;
-       join)   cc -n -s -O join.c -o join ;;
-       kill)   cc -n -s -O kill.c -o kill ;;
-       ld)     cc -n -s -O ld.c -o ld ;;
-       ln)     cc -n -s -O ln.c -o ln ;;
-       login)  cc -n -s -O login.c -o login ;;
-       look)   cc -n -s -O look.c -o look ;;
-       ls)     cc -n -s -O ls.c -o ls ;;
-       mail)   cc -n -s -O mail.c -o mail ;;
-       makekey)        cc -n -s -O makekey.c -o makekey; D=/usr/lib ;;
-       mesg)   cc -n -s -O mesg.c -o mesg ;;
-       mkdir)  cc -n -s -O mkdir.c -o mkdir ;;
-       mkfs)   cc -n -s -O mkfs.c -o mkfs; D=/etc ;;
-       mknod)  cc -n -s -O mknod.c -o mknod; D=/etc ;;
-       mount)  cc -n -s -O mount.c -o mount; D=/etc ;;
-       mv)     cc -n -s -O mv.c -o mv ;;
-       ncheck) cc -i -s -O ncheck.c -o ncheck ;;
-       newgrp) cc -n -s -O newgrp.c -o newgrp ;;
-       nice)   cc -n -s -O nice.c -o nice ;;
-       nm)     cc -n -s -O nm.c -o nm ;;
-       od)     cc -n -s -O od.c -o od ;;
-       osh)    cc -n -s -O osh.c -o osh ;;
-       passwd) cc -n -s -O passwd.c -o passwd ;;
-       pr)     cc -n -s -O pr.c -o pr ;;
-       primes) as -o primes /usr/include/sys.s primes.s && strip primes ;;
-       prof)   cc -n -s -O -Dplot prof.c -lplot -o prof ;;
-       ps)     cc -n -s -O ps.c -o ps ;;
-       pstat)  cc -n -s -O pstat.c -o pstat ;;
-       ptx)    cc -n -s -O ptx.c -o ptx ;;
-       pwd)    cc -n -s -O pwd.c -o pwd ;;
-       quot)   cc -n -s -O quot.c -o quot ;;
-       random) cc -n -s -O random.c -o random ;;
-       ranlib) cc -n -s -O ranlib.c -o ranlib ;;
-       restor) cc -i -s -O restor.c -o restor ;;
-       rev)    cc -n -s -O rev.c -o rev ;;
-       rm)     cc -n -s -O rm.c -o rm ;;
-       rmdir)  cc -n -s -O rmdir.c -o rmdir ;;
-       sa)     cc -n -s -O sa.c -o sa ;;
-       size)   cc -n -s -O size.c -o size ;;
-       sleep)  cc -n -s -O sleep.c -o sleep ;;
-       sort)   cc -i -s -O sort.c -o sort ;;
-       sp)     cc -n -s -O sp.c -o sp ;;
-       spline) cc -n -s -O spline.c -o spline ;;
-       split)  cc -n -s -O split.c -o split ;;
-       strip)  cc -n -s -O strip.c -o strip ;;
-       stty)   cc -n -s -O stty.c -o stty ;;
-       su)     cc -n -s -O su.c -o su ;;
-       sum)    cc -n -s -O sum.c -o sum ;;
-       sync)   cc -n -s -O sync.c -o sync ;;
-       tabs)   cc -n -s -O tabs.c -o tabs ;;
-       tail)   cc -n -s -O tail.c -o tail ;;
-       tc)     cc -n -s -O tc.c -o tc ;;
-       tee)    cc -n -s -O tee.c -o tee ;;
-       test)   cc -n -s -O test.c -o test ;;
-       time)   cc -n -s -O time.c -o time ;;
-       tk)     cc -n -s -O tk.c -o tk ;;
-       touch)  cc -n -s -O touch.c -o touch ;;
-       tr)     cc -n -s -O tr.c -o tr ;;
-       tsort)  cc -n -s -O tsort.c -o tsort ;;
-       tty)    cc -n -s -O tty.c -o tty ;;
-       umount) cc -n -s -O umount.c -o umount; D=/etc ;;
-       uniq)   cc -n -s -O uniq.c -o uniq ;;
-       units)  cc -n -s -O units.c -o units ;;
-       update) cc -n -s -O update.c -o update; D=/etc ;;
-       vpr)    cc -n -s -O vpr.c -o vpr ;;
-       wall)   cc -n -s -O wall.c -o wall; D=/etc ;;
-       wc)     cc -n -s -O wc.c -o wc ;;
-       who)    cc -n -s -O who.c -o who ;;
-       write)  cc -n -s -O write.c -o write ;;
-       yes)    cc -n -s -O yes.c -o yes ;;
-       *)      echo "cmake: don't know about $b"
-               continue ;;
-       esac || continue
-       case $C in
-       cmp)    cmp $b $D/$b && rm $b ;;
-       cp)     cp $b $D/$b && rm $b ;;
-       esac
-done
diff --git a/.ref-Research-V7/usr/src/cmd/cmp.c b/.ref-Research-V7/usr/src/cmd/cmp.c
deleted file mode 100644 (file)
index 4400b85..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-
-FILE   *file1,*file2;
-int    eflg;
-int    lflg    = 1;
-long   line    = 1;
-long   chr     = 0;
-long   skip1;
-long   skip2;
-
-long   otoi();
-
-main(argc, argv)
-char **argv;
-{
-       register c1, c2;
-       char *arg;
-
-       if(argc < 3)
-               goto narg;
-       arg = argv[1];
-       if(arg[0] == '-' && arg[1] == 's') {
-               lflg--;
-               argv++;
-               argc--;
-       }
-       arg = argv[1];
-       if(arg[0] == '-' && arg[1] == 'l') {
-               lflg++;
-               argv++;
-               argc--;
-       }
-       if(argc < 3)
-               goto narg;
-       arg = argv[1];
-       if( arg[0]=='-' && arg[1]==0 )
-               file1 = stdin;
-       else if((file1 = fopen(arg, "r")) == NULL)
-               goto barg;
-       arg = argv[2];
-       if((file2 = fopen(arg, "r")) == NULL)
-               goto barg;
-       if (argc>3)
-               skip1 = otoi(argv[3]);
-       if (argc>4)
-               skip2 = otoi(argv[4]);
-       while (skip1) {
-               if ((c1 = getc(file1)) == EOF) {
-                       arg = argv[1];
-                       goto earg;
-               }
-               skip1--;
-       }
-       while (skip2) {
-               if ((c2 = getc(file2)) == EOF) {
-                       arg = argv[2];
-                       goto earg;
-               }
-               skip2--;
-       }
-
-loop:
-       chr++;
-       c1 = getc(file1);
-       c2 = getc(file2);
-       if(c1 == c2) {
-               if (c1 == '\n')
-                       line++;
-               if(c1 == EOF) {
-                       if(eflg)
-                               exit(1);
-                       exit(0);
-               }
-               goto loop;
-       }
-       if(lflg == 0)
-               exit(1);
-       if(c1 == EOF) {
-               arg = argv[1];
-               goto earg;
-       }
-       if(c2 == EOF)
-               goto earg;
-       if(lflg == 1) {
-               printf("%s %s differ: char %ld, line %ld\n", argv[1], arg,
-                       chr, line);
-               exit(1);
-       }
-       eflg = 1;
-       printf("%6ld %3o %3o\n", chr, c1, c2);
-       goto loop;
-
-narg:
-       printf("cmp: arg count\n");
-       exit(2);
-
-barg:
-       if (lflg)
-       printf("cmp: cannot open %s\n", arg);
-       exit(2);
-
-earg:
-       printf("cmp: EOF on %s\n", arg);
-       exit(1);
-}
-
-long otoi(s)
-char *s;
-{
-       long v;
-       int base;
-
-       v = 0;
-       base = 10;
-       if (*s == '0')
-               base = 8;
-       while(isdigit(*s))
-               v = v*base + *s++ - '0';
-       return(v);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/col.c b/.ref-Research-V7/usr/src/cmd/col.c
deleted file mode 100644 (file)
index a26ac03..0000000
+++ /dev/null
@@ -1,314 +0,0 @@
-# include <stdio.h>
-
-# define PL 256
-# define ESC '\033'
-# define RLF '\013'
-# define SI '\017'
-# define SO '\016'
-# define GREEK 0200
-# define LINELN 800
-
-char *page[PL];
-char lbuff [LINELN], *line;
-int bflag, xflag, fflag;
-int half;
-int cp, lp;
-int ll, llh, mustwr;
-int pcp = 0;
-char *pgmname;
-char *strcpy();
-
-main (argc, argv)
-       int argc; char **argv;
-{
-       int i;
-       int greek;
-       register int c;
-       char fbuff[BUFSIZ];
-
-       setbuf (stdout, fbuff);
-       pgmname = argv[0];
-
-       for (i = 1; i < argc; i++) {
-               register char *p;
-               if (*argv[i] != '-') {
-                       fprintf (stderr, "%s: bad option %s\n",
-                               pgmname, argv[i]);
-                       exit (2);
-               }
-               for (p = argv[i]+1; *p; p++) {
-                       switch (*p) {
-                       case 'b':
-                               bflag++;
-                               break;
-
-                       case 'x':
-                               xflag++;
-                               break;
-
-                       case 'f':
-                               fflag++;
-                               break;
-
-                       default:
-                               fprintf (stderr, "%s: bad option letter %c\n",
-                                       pgmname, *p);
-                               exit (2);
-                       }
-               }
-       }
-
-       for (ll=0; ll<PL; ll++)
-               page[ll] = 0;
-
-       cp = 0;
-       ll = 0;
-       greek = 0;
-       mustwr = PL;
-       line = lbuff;
-
-       while ((c = getchar()) != EOF) {
-               switch (c) {
-               case '\n':
-                       incr();
-                       incr();
-                       cp = 0;
-                       continue;
-
-               case '\0':
-                       continue;
-
-               case ESC:
-                       c = getchar();
-                       switch (c) {
-                       case '7':       /* reverse full line feed */
-                               decr();
-                               decr();
-                               break;
-
-                       case '8':       /* reverse half line feed */
-                               if (fflag)
-                                       decr();
-                               else {
-                                       if (--half < -1) {
-                                               decr();
-                                               decr();
-                                               half += 2;
-                                       }
-                               }
-                               break;
-
-                       case '9':       /* forward half line feed */
-                               if (fflag)
-                                       incr();
-                               else {
-                                       if (++half > 0) {
-                                               incr();
-                                               incr();
-                                               half -= 2;
-                                       }
-                               }
-                               break;
-                       }
-                       continue;
-
-               case SO:
-                       greek = GREEK;
-                       continue;
-
-               case SI:
-                       greek = 0;
-                       continue;
-
-               case RLF:
-                       decr();
-                       decr();
-                       continue;
-
-               case '\r':
-                       cp = 0;
-                       continue;
-
-               case '\t':
-                       cp = (cp + 8) & -8;
-                       continue;
-
-               case '\b':
-                       if (cp > 0)
-                               cp--;
-                       continue;
-
-               case ' ':
-                       cp++;
-                       continue;
-
-               default:
-                       c &= 0177;
-                       if (c > 040 && c < 0177) {      /* if printable */
-                               outc(c | greek);
-                               cp++;
-                       }
-                       continue;
-               }
-       }
-
-       for (i=0; i<PL; i++)
-               if (page[(mustwr+i)%PL] != 0)
-                       emit (page[(mustwr+i) % PL], mustwr+i-PL);
-       emit (" ", (llh + 1) & -2);
-       return 0;
-}
-
-outc (c)
-       register char c;
-{
-       if (lp > cp) {
-               line = lbuff;
-               lp = 0;
-       }
-
-       while (lp < cp) {
-               switch (*line) {
-               case '\0':
-                       *line = ' ';
-                       lp++;
-                       break;
-
-               case '\b':
-                       lp--;
-                       break;
-
-               default:
-                       lp++;
-               }
-               line++;
-       }
-       while (*line == '\b') {
-               line += 2;
-       }
-       if (bflag || *line == '\0' || *line == ' ')
-               *line = c;
-       else {
-               register char c1, c2, c3;
-               c1 = *++line;
-               *line++ = '\b';
-               c2 = *line;
-               *line++ = c;
-               while (c1) {
-                       c3 = *line;
-                       *line++ = c1;
-                       c1 = c2;
-                       c2 = c3;
-               }
-               lp = 0;
-               line = lbuff;
-       }
-}
-
-store (lno)
-{
-       char *malloc();
-
-       lno %= PL;
-       if (page[lno] != 0)
-               free (page[lno]);
-       page[lno] = malloc((unsigned)strlen(lbuff) + 2);
-       if (page[lno] == 0) {
-               fprintf (stderr, "%s: no storage\n", pgmname);
-               exit (2);
-       }
-       strcpy (page[lno],lbuff);
-}
-
-fetch(lno)
-{
-       register char *p;
-
-       lno %= PL;
-       p = lbuff;
-       while (*p)
-               *p++ = '\0';
-       line = lbuff;
-       lp = 0;
-       if (page[lno])
-               strcpy (line, page[lno]);
-}
-emit (s, lineno)
-       char *s;
-       int lineno;
-{
-       static int cline = 0;
-       register int ncp;
-       register char *p;
-       static int gflag = 0;
-
-       if (*s) {
-               if (gflag) {
-                       putchar (SI);
-                       gflag = 0;
-               }
-               while (cline < lineno - 1) {
-                       putchar ('\n');
-                       pcp = 0;
-                       cline += 2;
-               }
-               if (cline != lineno) {
-                       putchar (ESC);
-                       putchar ('9');
-                       cline++;
-               }
-               if (pcp)
-                       putchar ('\r');
-               pcp = 0;
-               p = s;
-               while (*p) {
-                       ncp = pcp;
-                       while (*p++ == ' ') {
-                               if ((++ncp & 7) == 0 && !xflag) {
-                                       pcp = ncp;
-                                       putchar ('\t');
-                               }
-                       }
-                       if (!*--p)
-                               break;
-                       while (pcp < ncp) {
-                               putchar (' ');
-                               pcp++;
-                       }
-                       if (gflag != (*p & GREEK) && *p != '\b') {
-                               if (gflag)
-                                       putchar (SI);
-                               else
-                                       putchar (SO);
-                               gflag ^= GREEK;
-                       }
-                       putchar (*p & ~GREEK);
-                       if (*p++ == '\b')
-                               pcp--;
-                       else
-                               pcp++;
-               }
-       }
-}
-
-incr()
-{
-       store (ll++);
-       if (ll > llh)
-               llh = ll;
-       if (ll >= mustwr && page[ll%PL]) {
-               emit (page[ll%PL], ll - PL);
-               mustwr++;
-               free (page[ll%PL]);
-               page[ll%PL] = 0;
-       }
-       fetch (ll);
-}
-
-decr()
-{
-       if (ll > mustwr - PL) {
-               store (ll--);
-               fetch (ll);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/comm.c b/.ref-Research-V7/usr/src/cmd/comm.c
deleted file mode 100644 (file)
index a137ca3..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-#include <stdio.h>
-#define LB 256
-int    one;
-int    two;
-int    three;
-
-char   *ldr[3];
-
-FILE *ib1;
-FILE *ib2;
-FILE *openfil();
-main(argc,argv)
-char   *argv[];
-{
-       int     l;
-       char    lb1[LB],lb2[LB];
-
-       ldr[0] = "";
-       ldr[1] = "\t";
-       ldr[2] = "\t\t";
-       if(argc > 1)  {
-               if(*argv[1] == '-' && argv[1][1] != 0) {
-                       l = 1;
-                       while(*++argv[1]) {
-                               switch(*argv[1]) {
-                               case'1':
-                                       if(!one) {
-                                               one = 1;
-                                               ldr[1][0] =
-                                               ldr[2][l--] = '\0';
-                                       }
-                                       break;
-                               case '2':
-                                       if(!two) {
-                                               two = 1;
-                                               ldr[2][l--] = '\0';
-                                       }
-                                       break;
-                               case '3':
-                                       three = 1;
-                                       break;
-                               default:
-                               fprintf(stderr,"comm: illegal flag\n");
-                               exit(1);
-                               }
-                       }
-                       argv++;
-                       argc--;
-               }
-       }
-
-       if(argc < 3) {
-               fprintf(stderr,"comm: arg count\n");
-               exit(1);
-       }
-
-       ib1 = openfil(argv[1]);
-       ib2 = openfil(argv[2]);
-
-
-       if(rd(ib1,lb1) < 0) {
-               if(rd(ib2,lb2) < 0)     exit(0);
-               copy(ib2,lb2,2);
-       }
-       if(rd(ib2,lb2) < 0)     copy(ib1,lb1,1);
-
-       while(1) {
-
-               switch(compare(lb1,lb2)) {
-
-                       case 0:
-                               wr(lb1,3);
-                               if(rd(ib1,lb1) < 0) {
-                                       if(rd(ib2,lb2) < 0)     exit(0);
-                                       copy(ib2,lb2,2);
-                               }
-                               if(rd(ib2,lb2) < 0)     copy(ib1,lb1,1);
-                               continue;
-
-                       case 1:
-                               wr(lb1,1);
-                               if(rd(ib1,lb1) < 0)     copy(ib2,lb2,2);
-                               continue;
-
-                       case 2:
-                               wr(lb2,2);
-                               if(rd(ib2,lb2) < 0)     copy(ib1,lb1,1);
-                               continue;
-               }
-       }
-}
-
-rd(file,buf)
-FILE *file;
-char *buf;
-{
-
-       register int i, c;
-       i = 0;
-       while((c = getc(file)) != EOF) {
-               *buf = c;
-               if(c == '\n' || i > LB-2) {
-                       *buf = '\0';
-                       return(0);
-               }
-               i++;
-               buf++;
-       }
-       return(-1);
-}
-
-wr(str,n)
-       char    *str;
-{
-
-       switch(n) {
-
-               case 1:
-                       if(one) return;
-                       break;
-
-               case 2:
-                       if(two) return;
-                       break;
-
-               case 3:
-                       if(three)       return;
-       }
-       printf("%s%s\n",ldr[n-1],str);
-}
-
-copy(ibuf,lbuf,n)
-FILE *ibuf;
-char *lbuf;
-{
-       do {
-               wr(lbuf,n);
-       } while(rd(ibuf,lbuf) >= 0);
-
-       exit(0);
-}
-
-compare(a,b)
-       char    *a,*b;
-{
-       register char *ra,*rb;
-
-       ra = --a;
-       rb = --b;
-       while(*++ra == *++rb)
-               if(*ra == '\0') return(0);
-       if(*ra < *rb)   return(1);
-       return(2);
-}
-FILE *openfil(s)
-char *s;
-{
-       FILE *b;
-       if(s[0]=='-' && s[1]==0)
-               b = stdin;
-       else if((b=fopen(s,"r")) == NULL) {
-               fprintf(stderr,"comm: cannot open %s\n",s);
-               exit(1);
-       }
-       return(b);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cp.c b/.ref-Research-V7/usr/src/cmd/cp.c
deleted file mode 100644 (file)
index 7af6362..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * cp oldfile newfile
- */
-
-#define        BSIZE   512
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-struct stat    stbuf1, stbuf2;
-char   iobuf[BSIZE];
-
-main(argc, argv)
-char *argv[];
-{
-       register i, r;
-
-       if (argc < 3) 
-               goto usage;
-       if (argc > 3) {
-               if (stat(argv[argc-1], &stbuf2) < 0)
-                       goto usage;
-               if ((stbuf2.st_mode&S_IFMT) != S_IFDIR) 
-                       goto usage;
-       }
-       r = 0;
-       for(i=1; i<argc-1;i++)
-               r |= copy(argv[i], argv[argc-1]);
-       exit(r);
-usage:
-       fprintf(stderr, "Usage: cp: f1 f2; or cp f1 ... fn d2\n");
-       exit(1);
-}
-
-copy(from, to)
-char *from, *to;
-{
-       int fold, fnew, n;
-       register char *p1, *p2, *bp;
-       int mode;
-       if ((fold = open(from, 0)) < 0) {
-               fprintf(stderr, "cp: cannot open %s\n", from);
-               return(1);
-       }
-       fstat(fold, &stbuf1);
-       mode = stbuf1.st_mode;
-       /* is target a directory? */
-       if (stat(to, &stbuf2) >=0 &&
-          (stbuf2.st_mode&S_IFMT) == S_IFDIR) {
-               p1 = from;
-               p2 = to;
-               bp = iobuf;
-               while(*bp++ = *p2++)
-                       ;
-               bp[-1] = '/';
-               p2 = bp;
-               while(*bp = *p1++)
-                       if (*bp++ == '/')
-                               bp = p2;
-               to = iobuf;
-       }
-       if (stat(to, &stbuf2) >= 0) {
-               if (stbuf1.st_dev == stbuf2.st_dev &&
-                  stbuf1.st_ino == stbuf2.st_ino) {
-                       fprintf(stderr, "cp: cannot copy file to itself.\n");
-                       return(1);
-               }
-       }
-       if ((fnew = creat(to, mode)) < 0) {
-               fprintf(stderr, "cp: cannot create %s\n", to);
-               close(fold);
-               return(1);
-       }
-       while(n = read(fold,  iobuf,  BSIZE)) {
-               if (n < 0) {
-                       fprintf(stderr, "cp: read error\n");
-                       close(fold);
-                       close(fnew);
-                       return(1);
-               } else
-                       if (write(fnew, iobuf, n) != n) {
-                               fprintf(stderr, "cp: write error.\n");
-                               close(fold);
-                               close(fnew);
-                               return(1);
-                       }
-       }
-       close(fold);
-       close(fnew);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cpp/README b/.ref-Research-V7/usr/src/cmd/cpp/README
deleted file mode 100644 (file)
index 3d64dfa..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-Files in this directory form the C preprocessor, which handles '#include'
-files and macro definition and expansion for the C compiler.
-This new version was written by John F. Reiser and is from 5 to 12
-times faster than the old.
-
-To create the executable file 'cpp' in the current directory:
-       make
-
-To install the preprocessor 'cpp' so it will be used by the C compiler:
-       : backup the existing version
-       cp /lib/cpp /lib/ocpp
-       : install the new version
-       cp cpp /lib/cpp
-
-Documentation clarifications:
-       Symbols defined on the command line by "-Dfoo" are defined as "1",
-               i.e., as if they had been defined by "#define foo 1" or "-Dfoo=1".
-       An unescaped linefeed (the single character "\n") terminates a
-               character constant or quoted string.
-       An escaped linefeed (the two-character sequence "\\\n") may be
-               used in the body of a '#define' statement to continue
-               the definition onto the next line.  The escaped linefeed is
-               not included in the macro body.
-       Comments are uniformly removed.  They are also ignored, except
-               that a comment terminates a token.
-               Thus "foo/* la di da */bar" may expand 'foo' and 'bar' but
-               will never expand 'foobar'.  If neither 'foo' nor 'bar' is a
-               macro then the output is "foobar", even if 'foobar'
-               is defined as something else.  The file
-                       #define foo(a,b)b/**/a
-                       foo(1,2)
-               produces "21" because the comment causes a break which enables
-               the recognition of 'b' and 'a' as formals in the string "b/**/a".
-       Macro formals are recognized even inside character constants
-               and quoted strings.  The output from
-                       #define foo(a) '\a'
-                       foo(bar)
-               is the seven characters " '\\bar'".
-       Macros are not expanded while processing a '#define' or '#undef'.
-               Thus
-                       #define foo bletch
-                       #define bar foo
-                       #undef foo
-                       bar
-               produces "foo".
-       Macros are not expanded during the scan which determines the actual
-               parameters to another macro call.  Thus
-                       #define foo(a,b)b a
-                       #define bar hi
-                       foo(bar,
-                       #define bar bye
-                       )
-               produces " bye" (and warns about the redefinition of 'bar').
-
-There are some differences between the new and the old preprocessor.
-Bugs fixed:
-       "1.e4" is recognized as a floating-point number, rather than as an
-               opportunity to expand the possible macro name "e4".
-       Any kind and amount of white space (space, tab, linefeed, vertical tab,
-               formfeed, carriage return) is allowed between a macro name and
-               the left parenthesis which introduces its actual parameters.
-       The comma operator is legal in preprocessor '#if' statements.
-       Macros with parameters are legal in preprocessor '#if' statements.
-       Single-character character constants are legal in preprocessor '#if' statements.
-       Linefeeds are put out in the proper place when a multiline comment
-               is not passed through to the output.
-       The following example expands to "# # #" :
-               #define foo #
-               foo foo foo
-       Recursion in macro definitions is strictly obeyed (to the extent that
-               space is available).  In particular,
-                       #define a a
-                       a
-               causes an infinite loop with very little output.  The tail recursion
-                       #define a <b
-                       #define b >a
-                       a
-               causes the string "<>" to be output infinitely many times.  The
-               non-tail recursion
-                       #define a b>
-                       #define b a<
-                       a
-               complains "too much pushback", dumps the pushback, and continues
-               (again, infinitely).
-       
-Stylistic choice:
-       Nothing (not even linefeeds) is output while a false '#if', '#ifdef',
-               or '#ifndef' is in effect.  Thus when all conditions become true
-               a line of the form "# 12345 foo.c" is output.
-       Error and warning messages always appear on standard error (file
-               descriptor 2).
-       Mismatch between the number of formals and actuals in a macro call
-               produces only a warning, and not an error.  Excess actuals
-               are ignored; missing actuals are turned into null strings.
-
-Incompatibility:
-       The virgule '/' in "a=/*b" is interpreted as the first character of
-               the pair "/*" which introduces a comment, rather than as the
-               second character of the divide-and-replace operator "=/".
-               This incompatibility reflects the recent change in the C language
-               which made "a/=*b" the legal way to write such a statement
-               if the meaning "a=a/ *b" is intended.
diff --git a/.ref-Research-V7/usr/src/cmd/cpp/cpp.c b/.ref-Research-V7/usr/src/cmd/cpp/cpp.c
deleted file mode 100644 (file)
index 9fdd442..0000000
+++ /dev/null
@@ -1,1132 +0,0 @@
-#
-# include "stdio.h"
-/* C command
-/* written by John F. Reiser
-/* July/August 1978
-*/
-
-#define STATIC
-
-#define STDIN 0
-#define STDOUT 1
-#define STDERR 2
-#define READ 0
-#define WRITE 1
-#define SALT '#'
-#ifndef BUFSIZ
-#define BUFSIZ 512
-#endif
-
-char *pbeg,*pbuf,*pend;
-char *outp,*inp;
-char *newp;
-char cinit;
-
-/* some code depends on whether characters are sign or zero extended */
-/*     #if '\377' < 0          not used here, old cpp doesn't understand */
-#if pdp11 | vax
-#define COFF 128
-#else
-#define COFF 0
-#endif
-
-# if gcos
-#define ALFSIZ 512     /* alphabet size */
-# else
-#define ALFSIZ 256     /* alphabet size */
-# endif
-char macbit[ALFSIZ+11];
-char toktyp[ALFSIZ];
-#define BLANK 1
-#define IDENT 2
-#define NUMBR 3
-
-/* a superimposed code is used to reduce the number of calls to the
-/* symbol table lookup routine.  (if the kth character of an identifier
-/* is 'a' and there are no macro names whose kth character is 'a'
-/* then the identifier cannot be a macro name, hence there is no need
-/* to look in the symbol table.)  'scw1' enables the test based on
-/* single characters and their position in the identifier.  'scw2'
-/* enables the test based on adjacent pairs of characters and their
-/* position in the identifier.  scw1 typically costs 1 indexed fetch,
-/* an AND, and a jump per character of identifier, until the identifier
-/* is known as a non-macro name or until the end of the identifier.
-/* scw1 is inexpensive.  scw2 typically costs 4 indexed fetches,
-/* an add, an AND, and a jump per character of identifier, but it is also
-/* slightly more effective at reducing symbol table searches.
-/* scw2 usually costs too much because the symbol table search is
-/* usually short; but if symbol table search should become expensive,
-/* the code is here.
-/* using both scw1 and scw2 is of dubious value.
-*/
-#define scw1 1
-#define scw2 0
-
-#if scw2
-char t21[ALFSIZ],t22[ALFSIZ],t23[ALFSIZ+8];
-#endif
-
-#if scw1
-#define b0 1
-#define b1 2
-#define b2 4
-#define b3 8
-#define b4 16
-#define b5 32
-#define b6 64
-#define b7 128
-#endif
-
-#define IB 1
-#define SB 2
-#define NB 4
-#define CB 8
-#define QB 16
-#define WB 32
-char fastab[ALFSIZ];
-char slotab[ALFSIZ];
-char *ptrtab;
-#define isslo (ptrtab==(slotab+COFF))
-#define isid(a)  ((fastab+COFF)[a]&IB)
-#define isspc(a) (ptrtab[a]&SB)
-#define isnum(a) ((fastab+COFF)[a]&NB)
-#define iscom(a) ((fastab+COFF)[a]&CB)
-#define isquo(a) ((fastab+COFF)[a]&QB)
-#define iswarn(a) ((fastab+COFF)[a]&WB)
-
-#define eob(a) ((a)>=pend)
-#define bob(a) (pbeg>=(a))
-
-char buffer[8+BUFSIZ+BUFSIZ+8];
-
-# define SBSIZE 12000
-char   sbf[SBSIZE];
-char   *savch  = sbf;
-
-# define DROP 0xFE     /* special character not legal ASCII or EBCDIC */
-# define WARN DROP
-# define SAME 0
-# define MAXINC 10
-# define MAXFRE 14     /* max buffers of macro pushback */
-# define MAXFRM 31     /* max number of formals/actuals to a macro */
-
-static char warnc = WARN;
-
-int mactop,fretop;
-char *instack[MAXFRE],*bufstack[MAXFRE],*endbuf[MAXFRE];
-
-int plvl;      /* parenthesis level during scan for macro actuals */
-int maclin;    /* line number of macro call requiring actuals */
-char *macfil;  /* file name of macro call requiring actuals */
-char *macnam;  /* name of macro requiring actuals */
-int maclvl;    /* # calls since last decrease in nesting level */
-char *macforw; /* pointer which must be exceeded to decrease nesting level */
-int macdam;    /* offset to macforw due to buffer shifting */
-
-#if tgp
-int tgpscan;   /* flag for dump(); */
-#endif
-
-STATIC int     inctop[MAXINC];
-STATIC char    *fnames[MAXINC];
-STATIC char    *dirnams[MAXINC];       /* actual directory of #include files */
-STATIC int     fins[MAXINC];
-STATIC int     lineno[MAXINC];
-
-STATIC char    *dirs[10];      /* -I and <> directories */
-char *strdex(), *copy(), *subst(), *trmdir();
-struct symtab *stsym();
-STATIC int     fin     = STDIN;
-STATIC FILE    *fout   = stdout;
-STATIC int     nd      = 1;
-STATIC int     pflag;  /* don't put out lines "# 12 foo.c" */
-STATIC int     passcom;        /* don't delete comments */
-STATIC int rflag;      /* allow macro recursion */
-STATIC int     ifno;
-# define NPREDEF 20
-STATIC char *prespc[NPREDEF];
-STATIC char **predef = prespc;
-STATIC char *punspc[NPREDEF];
-STATIC char **prund = punspc;
-STATIC int     exfail;
-struct symtab {
-       char    *name;
-       char    *value;
-} *lastsym, *lookup(), *slookup();
-
-# if gcos
-#include <setjmp.h>
-static jmp_buf env;
-# define main  mainpp
-# undef exit
-# define exit(S)       longjmp(env, 1)
-# define open(S,D)     fileno(fopen(S, "r"))
-# define close(F)      fclose(_f[F])
-extern FILE *_f[];
-# define symsiz 500
-# else
-# define symsiz 400
-# endif
-STATIC struct symtab stab[symsiz];
-
-STATIC struct symtab *defloc;
-STATIC struct symtab *udfloc;
-STATIC struct symtab *incloc;
-STATIC struct symtab *ifloc;
-STATIC struct symtab *elsloc;
-STATIC struct symtab *eifloc;
-STATIC struct symtab *ifdloc;
-STATIC struct symtab *ifnloc;
-STATIC struct symtab *ysysloc;
-STATIC struct symtab *varloc;
-STATIC struct symtab *lneloc;
-STATIC struct symtab *ulnloc;
-STATIC struct symtab *uflloc;
-STATIC int     trulvl;
-STATIC int     flslvl;
-
-sayline() {
-       if (pflag==0) fprintf(fout,"# %d \"%s\"\n", lineno[ifno], fnames[ifno]);
-}
-
-/* data structure guide
-/*
-/* most of the scanning takes place in the buffer:
-/*
-/*  (low address)                                             (high address)
-/*  pbeg                           pbuf                                 pend
-/*  |      <-- BUFSIZ chars -->      |         <-- BUFSIZ chars -->        |
-/*  _______________________________________________________________________
-/* |_______________________________________________________________________|
-/*          |               |               |
-/*          |<-- waiting -->|               |<-- waiting -->
-/*          |    to be      |<-- current -->|    to be
-/*          |    written    |    token      |    scanned
-/*          |               |               |
-/*          outp            inp             p
-/*
-/*  *outp   first char not yet written to output file
-/*  *inp    first char of current token
-/*  *p      first char not yet scanned
-/*
-/* macro expansion: write from *outp to *inp (chars waiting to be written),
-/* ignore from *inp to *p (chars of the macro call), place generated
-/* characters in front of *p (in reverse order), update pointers,
-/* resume scanning.
-/*
-/* symbol table pointers point to just beyond the end of macro definitions;
-/* the first preceding character is the number of formal parameters.
-/* the appearance of a formal in the body of a definition is marked by
-/* 2 chars: the char WARN, and a char containing the parameter number.
-/* the first char of a definition is preceded by a zero character.
-/*
-/* when macro expansion attempts to back up over the beginning of the
-/* buffer, some characters preceding *pend are saved in a side buffer,
-/* the address of the side buffer is put on 'instack', and the rest
-/* of the main buffer is moved to the right.  the end of the saved buffer
-/* is kept in 'endbuf' since there may be nulls in the saved buffer.
-/*
-/* similar action is taken when an 'include' statement is processed,
-/* except that the main buffer must be completely emptied.  the array
-/* element 'inctop[ifno]' records the last side buffer saved when
-/* file 'ifno' was included.  these buffers remain dormant while
-/* the file is being read, and are reactivated at end-of-file.
-/*
-/* instack[0 : mactop] holds the addresses of all pending side buffers.
-/* instack[inctop[ifno]+1 : mactop-1] holds the addresses of the side
-/* buffers which are "live"; the side buffers instack[0 : inctop[ifno]]
-/* are dormant, waiting for end-of-file on the current file.
-/*
-/* space for side buffers is obtained from 'savch' and is never returned.
-/* bufstack[0:fretop-1] holds addresses of side buffers which
-/* are available for use.
-*/
-
-dump() {
-/* write part of buffer which lies between  outp  and  inp .
-/* this should be a direct call to 'write', but the system slows to a crawl
-/* if it has to do an unaligned copy.  thus we buffer.  this silly loop
-/* is 15% of the total time, thus even the 'putc' macro is too slow.
-*/
-       register char *p1,*p2; register FILE *f;
-       if ((p1=outp)==inp || flslvl!=0) return;
-#if tgp
-#define MAXOUT 80
-       if (!tgpscan) {/* scan again to insure <= MAXOUT chars between linefeeds */
-               register char c,*pblank; char savc,stopc,brk;
-               tgpscan=1; brk=stopc=pblank=0; p2=inp; savc= *p2; *p2='\0';
-               while (c= *p1++) {
-                       if (c=='\\') c= *p1++;
-                       if (stopc==c) stopc=0;
-                       else if (c=='"' || c=='\'') stopc=c;
-                       if (p1-outp>MAXOUT && pblank!=0) {
-                               *pblank++='\n'; inp=pblank; dump(); brk=1; pblank=0;
-                       }
-                       if (c==' ' && stopc==0) pblank=p1-1;
-               }
-               if (brk) sayline();
-               *p2=savc; inp=p2; p1=outp; tgpscan=0;
-       }
-#endif
-       f=fout;
-# if gcos
-/* filter out "$ program c" card if first line of input */
-/* gmatch is a simple pattern matcher in the GCOS Standard Library */
-{      static int gmfirst = 0;
-       if (!gmfirst) {
-               ++gmfirst;
-               if (gmatch(p1, "^$*program[ \t]*c*"))
-                       p1 = strdex(p1, '\n');
-       }
-}
-# endif
-       while (p1<inp) putc(*p1++,f);
-       outp=p1;
-}
-
-char *
-refill(p) register char *p; {
-/* dump buffer.  save chars from inp to p.  read into buffer at pbuf,
-/* contiguous with p.  update pointers, return new p.
-*/
-       register char *np,*op; register int ninbuf;
-       dump(); np=pbuf-(p-inp); op=inp;
-       if (bob(np+1)) {pperror("token too long"); np=pbeg; p=inp+BUFSIZ;}
-       macdam += np-inp; outp=inp=np;
-       while (op<p) *np++= *op++;
-       p=np;
-       for (;;) {
-               if (mactop>inctop[ifno]) {/* retrieve hunk of pushed-back macro text */
-                       op=instack[--mactop]; np=pbuf;
-                       do {while (*np++= *op++);} while (op<endbuf[mactop]); pend=np-1;
-                       /* make buffer space avail for 'include' processing */
-                       if (fretop<MAXFRE) bufstack[fretop++]=instack[mactop];
-                       return(p);
-               } else {/* get more text from file(s) */
-                       maclvl=0;
-                       if (0<(ninbuf=read(fin,pbuf,BUFSIZ))) {
-                               pend=pbuf+ninbuf; *pend='\0';
-                               return(p);
-                       }
-                       /* end of #include file */
-                       if (ifno==0) {/* end of input */
-                               if (plvl!=0) {
-                                       int n=plvl,tlin=lineno[ifno]; char *tfil=fnames[ifno];
-                                       lineno[ifno]=maclin; fnames[ifno]=macfil;
-                                       pperror("%s: unterminated macro call",macnam);
-                                       lineno[ifno]=tlin; fnames[ifno]=tfil;
-                                       np=p; *np++='\n';       /* shut off unterminated quoted string */
-                                       while (--n>=0) *np++=')';       /* supply missing parens */
-                                       pend=np; *np='\0'; if (plvl<0) plvl=0;
-                                       return(p);
-                               }
-                               inp=p; dump(); exit(exfail);
-                       }
-                       close(fin); fin=fins[--ifno]; dirs[0]=dirnams[ifno]; sayline();
-               }
-       }
-}
-
-#define BEG 0
-#define LF 1
-
-char *
-cotoken(p) register char *p; {
-       register int c,i; char quoc;
-       static int state = BEG;
-
-       if (state!=BEG) goto prevlf;
-for (;;) {
-again:
-       while (!isspc(*p++));
-       switch (*(inp=p-1)) {
-       case 0: {
-               if (eob(--p)) {p=refill(p); goto again;}
-               else ++p; /* ignore null byte */
-       } break;
-       case '|': case '&': for (;;) {/* sloscan only */
-               if (*p++== *inp) break;
-               if (eob(--p)) p=refill(p);
-               else break;
-       } break;
-       case '=': case '!': for (;;) {/* sloscan only */
-               if (*p++=='=') break;
-               if (eob(--p)) p=refill(p);
-               else break;
-       } break;
-       case '<': case '>': for (;;) {/* sloscan only */
-               if (*p++=='=' || p[-2]==p[-1]) break;
-               if (eob(--p)) p=refill(p);
-               else break;
-       } break;
-       case '\\': for (;;) {
-               if (*p++=='\n') {++lineno[ifno]; break;}
-               if (eob(--p)) p=refill(p);
-               else {++p; break;}
-       } break;
-       case '/': for (;;) {
-               if (*p++=='*') {/* comment */
-                       if (!passcom) {inp=p-2; dump(); ++flslvl;}
-                       for (;;) {
-                               while (!iscom(*p++));
-                               if (p[-1]=='*') for (;;) {
-                                       if (*p++=='/') goto endcom;
-                                       if (eob(--p)) {
-                                               if (!passcom) {inp=p; p=refill(p);}
-                                               else if ((p-inp)>=BUFSIZ) {/* split long comment */
-                                                       inp=p; p=refill(p);     /* last char written is '*' */
-                                                       putc('/',fout); /* terminate first part */
-                                                       /* and fake start of 2nd */
-                                                       outp=inp=p-=3; *p++='/'; *p++='*'; *p++='*';
-                                               } else p=refill(p);
-                                       } else break;
-                               } else if (p[-1]=='\n') {
-                                       ++lineno[ifno]; if (!passcom) putc('\n',fout);
-                               } else if (eob(--p)) {
-                                       if (!passcom) {inp=p; p=refill(p);}
-                                       else if ((p-inp)>=BUFSIZ) {/* split long comment */
-                                               inp=p; p=refill(p);
-                                               putc('*',fout); putc('/',fout);
-                                               outp=inp=p-=2; *p++='/'; *p++='*';
-                                       } else p=refill(p);
-                               } else ++p; /* ignore null byte */
-                       }
-               endcom:
-                       if (!passcom) {outp=inp=p; --flslvl; goto again;}
-                       break;
-               }
-               if (eob(--p)) p=refill(p);
-               else break;
-       } break;
-# if gcos
-       case '`':
-# endif
-       case '"': case '\'': {
-               quoc=p[-1];
-               for (;;) {
-                       while (!isquo(*p++));
-                       if (p[-1]==quoc) break;
-                       if (p[-1]=='\n') {--p; break;} /* bare \n terminates quotation */
-                       if (p[-1]=='\\') for (;;) {
-                               if (*p++=='\n') {++lineno[ifno]; break;} /* escaped \n ignored */
-                               if (eob(--p)) p=refill(p);
-                               else {++p; break;}
-                       } else if (eob(--p)) p=refill(p);
-                       else ++p;       /* it was a different quote character */
-               }
-       } break;
-       case '\n': {
-               ++lineno[ifno]; if (isslo) {state=LF; return(p);}
-prevlf:
-               state=BEG;
-               for (;;) {
-                       if (*p++=='#') return(p);
-                       if (eob(inp= --p)) p=refill(p);
-                       else goto again;
-               }
-       } break;
-       case '0': case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8': case '9':
-       for (;;) {
-               while (isnum(*p++));
-               if (eob(--p)) p=refill(p);
-               else break;
-       } break;
-       case 'A': case 'B': case 'C': case 'D': case 'E':
-       case 'F': case 'G': case 'H': case 'I': case 'J':
-       case 'K': case 'L': case 'M': case 'N': case 'O':
-       case 'P': case 'Q': case 'R': case 'S': case 'T':
-       case 'U': case 'V': case 'W': case 'X': case 'Y':
-       case 'Z': case '_':
-       case 'a': case 'b': case 'c': case 'd': case 'e':
-       case 'f': case 'g': case 'h': case 'i': case 'j':
-       case 'k': case 'l': case 'm': case 'n': case 'o':
-       case 'p': case 'q': case 'r': case 's': case 't':
-       case 'u': case 'v': case 'w': case 'x': case 'y':
-       case 'z':
-#if scw1
-#define tmac1(c,bit) if (!xmac1(c,bit,&)) goto nomac
-#define xmac1(c,bit,op) ((macbit+COFF)[c] op (bit))
-#else
-#define tmac1(c,bit)
-#define xmac1(c,bit,op)
-#endif
-
-#if scw2
-#define tmac2(c0,c1,cpos) if (!xmac2(c0,c1,cpos,&)) goto nomac
-#define xmac2(c0,c1,cpos,op)\
-       ((macbit+COFF)[(t21+COFF)[c0]+(t22+COFF)[c1]] op (t23+COFF+cpos)[c0])
-#else
-#define tmac2(c0,c1,cpos)
-#define xmac2(c0,c1,cpos,op)
-#endif
-
-       if (flslvl) goto nomac;
-       for (;;) {
-               c= p[-1];                          tmac1(c,b0);
-               i= *p++; if (!isid(i)) goto endid; tmac1(i,b1); tmac2(c,i,0);
-               c= *p++; if (!isid(c)) goto endid; tmac1(c,b2); tmac2(i,c,1);
-               i= *p++; if (!isid(i)) goto endid; tmac1(i,b3); tmac2(c,i,2);
-               c= *p++; if (!isid(c)) goto endid; tmac1(c,b4); tmac2(i,c,3);
-               i= *p++; if (!isid(i)) goto endid; tmac1(i,b5); tmac2(c,i,4);
-               c= *p++; if (!isid(c)) goto endid; tmac1(c,b6); tmac2(i,c,5);
-               i= *p++; if (!isid(i)) goto endid; tmac1(i,b7); tmac2(c,i,6);
-                                                               tmac2(i,0,7);
-               while (isid(*p++));
-               if (eob(--p)) {refill(p); p=inp+1; continue;}
-               goto lokid;
-       endid:
-               if (eob(--p)) {refill(p); p=inp+1; continue;}
-               tmac2(p[-1],0,-1+(p-inp));
-       lokid:
-               slookup(inp,p,0); if (newp) {p=newp; goto again;}
-               else break;
-       nomac:
-               while (isid(*p++));
-               if (eob(--p)) {p=refill(p); goto nomac;}
-               else break;
-       } break;
-       } /* end of switch */
-       
-       if (isslo) return(p);
-} /* end of infinite loop */
-}
-
-char *
-skipbl(p) register char *p; {/* get next non-blank token */
-       do {outp=inp=p; p=cotoken(p);} while ((toktyp+COFF)[*inp]==BLANK);
-       return(p);
-}
-
-char *
-unfill(p) register char *p; {
-/* take <= BUFSIZ chars from right end of buffer and put them on instack .
-/* slide rest of buffer to the right, update pointers, return new p.
-*/
-       register char *np,*op; register int d;
-       if (mactop>=MAXFRE) {
-               pperror("%s: too much pushback",macnam);
-               p=inp=pend; dump();     /* begin flushing pushback */
-               while (mactop>inctop[ifno]) {p=refill(p); p=inp=pend; dump();}
-       }
-       if (fretop>0) np=bufstack[--fretop];
-       else {
-               np=savch; savch+=BUFSIZ;
-               if (savch>=sbf+SBSIZE) {pperror("no space"); exit(exfail);}
-               *savch++='\0';
-       }
-       instack[mactop]=np; op=pend-BUFSIZ; if (op<p) op=p;
-       for (;;) {while (*np++= *op++); if (eob(op)) break;} /* out with old */
-       endbuf[mactop++]=np;    /* mark end of saved text */
-       np=pbuf+BUFSIZ; op=pend-BUFSIZ; pend=np; if (op<p) op=p;
-       while (outp<op) *--np= *--op; /* slide over new */
-       if (bob(np)) pperror("token too long");
-       d=np-outp; outp+=d; inp+=d; macdam+=d; return(p+d);
-}
-
-char *
-doincl(p) register char *p; {
-       int filok,inctype;
-       register char *cp; char **dirp,*nfil; char filname[BUFSIZ];
-
-       p=skipbl(p); cp=filname;
-       if (*inp++=='<') {/* special <> syntax */
-               inctype=1;
-               for (;;) {
-                       outp=inp=p; p=cotoken(p);
-                       if (*inp=='\n') {--p; *cp='\0'; break;}
-                       if (*inp=='>') {      *cp='\0'; break;}
-# ifdef gimpel
-                       if (*inp=='.' && !intss()) *inp='#';
-# endif
-                       while (inp<p) *cp++= *inp++;
-               }
-       } else if (inp[-1]=='"') {/* regular "" syntax */
-               inctype=0;
-# ifdef gimpel
-               while (inp<p) {if (*inp=='.' && !intss()) *inp='#'; *cp++= *inp++;}
-# else
-               while (inp<p) *cp++= *inp++;
-# endif
-               if (*--cp=='"') *cp='\0';
-       } else {pperror("bad include syntax",0); inctype=2;}
-       /* flush current file to \n , then write \n */
-       ++flslvl; do {outp=inp=p; p=cotoken(p);} while (*inp!='\n'); --flslvl;
-       inp=p; dump(); if (inctype==2) return(p);
-       /* look for included file */
-       if (ifno+1 >=MAXINC) {
-               pperror("Unreasonable include nesting",0); return(p);
-       }
-       if((nfil=savch)>sbf+SBSIZE-BUFSIZ) {pperror("no space"); exit(exfail);}
-       filok=0;
-       for (dirp=dirs+inctype; *dirp; ++dirp) {
-               if (
-# if gcos
-                       strdex(filname, '/')
-# else
-                       filname[0]=='/' 
-# endif
-                               || **dirp=='\0') strcpy(nfil,filname);
-               else {
-                       strcpy(nfil,*dirp);
-# if unix || gcos
-                       strcat(nfil,"/");
-# endif
-#ifdef ibm
-#ifndef gimpel
-                       strcat(nfil,".");
-#endif
-#endif
-                       strcat(nfil,filname);
-               }
-               if (0<(fins[ifno+1]=open(nfil,READ))) {
-                       filok=1; fin=fins[++ifno]; break;
-               }
-       }
-       if (filok==0) pperror("Can't find include file %s",filname);
-       else {
-               lineno[ifno]=1; fnames[ifno]=cp=nfil; while (*cp++); savch=cp;
-               dirnams[ifno]=dirs[0]=trmdir(copy(nfil));
-               sayline();
-               /* save current contents of buffer */
-               while (!eob(p)) p=unfill(p);
-               inctop[ifno]=mactop;
-       }
-       return(p);
-}
-
-equfrm(a,p1,p2) register char *a,*p1,*p2; {
-       register char c; int flag;
-       c= *p2; *p2='\0';
-       flag=strcmp(a,p1); *p2=c; return(flag==SAME);
-}
-
-char *
-dodef(p) char *p; {/* process '#define' */
-       register char *pin,*psav,*cf;
-       char **pf,**qf; int b,c,params; struct symtab *np;
-       char *oldval,*oldsavch;
-       char *formal[MAXFRM]; /* formal[n] is name of nth formal */
-       char formtxt[BUFSIZ]; /* space for formal names */
-
-       if (savch>sbf+SBSIZE-BUFSIZ) {pperror("too much defining"); return(p);}
-       oldsavch=savch; /* to reclaim space if redefinition */
-       ++flslvl; /* prevent macro expansion during 'define' */
-       p=skipbl(p); pin=inp;
-       if ((toktyp+COFF)[*pin]!=IDENT) {
-               ppwarn("illegal macro name"); while (*inp!='\n') p=skipbl(p); return(p);
-       }
-       np=slookup(pin,p,1);
-       if (oldval=np->value) savch=oldsavch;   /* was previously defined */
-       b=1; cf=pin;
-       while (cf<p) {/* update macbit */
-               c= *cf++; xmac1(c,b,|=); b=(b+b)&0xFF;
-               if (cf!=p) xmac2(c,*cf,-1+(cf-pin),|=);
-               else xmac2(c,0,-1+(cf-pin),|=);
-       }
-       params=0; outp=inp=p; p=cotoken(p); pin=inp;
-       if (*pin=='(') {/* with parameters; identify the formals */
-               cf=formtxt; pf=formal;
-               for (;;) {
-                       p=skipbl(p); pin=inp;
-                       if (*pin=='\n') {
-                               --lineno[ifno]; --p; pperror("%s: missing )",np->name); break;
-                       }
-                       if (*pin==')') break;
-                       if (*pin==',') continue;
-                       if ((toktyp+COFF)[*pin]!=IDENT) {
-                               c= *p; *p='\0'; pperror("bad formal: %s",pin); *p=c;
-                       } else if (pf>= &formal[MAXFRM]) {
-                               c= *p; *p='\0'; pperror("too many formals: %s",pin); *p=c;
-                       } else {
-                               *pf++=cf; while (pin<p) *cf++= *pin++; *cf++='\0'; ++params;
-                       }
-               }
-               if (params==0) --params; /* #define foo() ... */
-       } else if (*pin=='\n') {--lineno[ifno]; --p;}
-       /* remember beginning of macro body, so that we can
-       /* warn if a redefinition is different from old value.
-       */
-       oldsavch=psav=savch;
-       for (;;) {/* accumulate definition until linefeed */
-               outp=inp=p; p=cotoken(p); pin=inp;
-               if (*pin=='\\' && pin[1]=='\n') continue;       /* ignore escaped lf */
-               if (*pin=='\n') break;
-               if (params) {/* mark the appearance of formals in the definiton */
-                       if ((toktyp+COFF)[*pin]==IDENT) {
-                               for (qf=pf; --qf>=formal; ) {
-                                       if (equfrm(*qf,pin,p)) {
-                                               *psav++=qf-formal+1; *psav++=WARN; pin=p; break;
-                                       }
-                               }
-                       } else if (*pin=='"' || *pin=='\''
-# if gcos
-                                       || *pin=='`'
-# endif
-                                               ) {/* inside quotation marks, too */
-                               char quoc= *pin;
-                               for (*psav++= *pin++; pin<p && *pin!=quoc; ) {
-                                       while (pin<p && !isid(*pin)) *psav++= *pin++;
-                                       cf=pin; while (cf<p && isid(*cf)) ++cf;
-                                       for (qf=pf; --qf>=formal; ) {
-                                               if (equfrm(*qf,pin,cf)) {
-                                                       *psav++=qf-formal+1; *psav++=WARN; pin=cf; break;
-                                               }
-                                       }
-                                       while (pin<cf) *psav++= *pin++;
-                               }
-                       }
-               }
-               while (pin<p) *psav++= *pin++;
-       }
-       *psav++=params; *psav++='\0';
-       if ((cf=oldval)!=NULL) {/* redefinition */
-               --cf;   /* skip no. of params, which may be zero */
-               while (*--cf);  /* go back to the beginning */
-               if (0!=strcmp(++cf,oldsavch)) {/* redefinition different from old */
-                       --lineno[ifno]; ppwarn("%s redefined",np->name); ++lineno[ifno];
-                       np->value=psav-1;
-               } else psav=oldsavch; /* identical redef.; reclaim space */
-       } else np->value=psav-1;
-       --flslvl; inp=pin; savch=psav; return(p);
-}
-
-#define fasscan() ptrtab=fastab+COFF
-#define sloscan() ptrtab=slotab+COFF
-
-char *
-control(p) register char *p; {/* find and handle preprocessor control lines */
-       register struct symtab *np;
-for (;;) {
-       fasscan(); p=cotoken(p); if (*inp=='\n') ++inp; dump();
-       sloscan(); p=skipbl(p);
-       *--inp=SALT; outp=inp; ++flslvl; np=slookup(inp,p,0); --flslvl;
-       if (np==defloc) {/* define */
-               if (flslvl==0) {p=dodef(p); continue;}
-       } else if (np==incloc) {/* include */
-               if (flslvl==0) {p=doincl(p); continue;}
-       } else if (np==ifnloc) {/* ifndef */
-               ++flslvl; p=skipbl(p); np=slookup(inp,p,0); --flslvl;
-               if (flslvl==0 && np->value==0) ++trulvl;
-               else ++flslvl;
-       } else if (np==ifdloc) {/* ifdef */
-               ++flslvl; p=skipbl(p); np=slookup(inp,p,0); --flslvl;
-               if (flslvl==0 && np->value!=0) ++trulvl;
-               else ++flslvl;
-       } else if (np==eifloc) {/* endif */
-               if (flslvl) {if (--flslvl==0) sayline();}
-               else if (trulvl) --trulvl;
-               else pperror("If-less endif",0);
-       } else if (np==elsloc) {/* else */
-               if (flslvl) {
-                       if (--flslvl!=0) ++flslvl;
-                       else {++trulvl; sayline();}
-               }
-               else if (trulvl) {++flslvl; --trulvl;}
-               else pperror("If-less else",0);
-       } else if (np==udfloc) {/* undefine */
-               if (flslvl==0) {
-                       ++flslvl; p=skipbl(p); slookup(inp,p,DROP); --flslvl;
-               }
-       } else if (np==ifloc) {/* if */
-#if tgp
-               pperror(" IF not implemented, true assumed", 0);
-               if (flslvl==0) ++trulvl; else ++flslvl;
-#else
-               newp=p;
-               if (flslvl==0 && yyparse()) ++trulvl; else ++flslvl;
-               p=newp;
-#endif
-       } else if (np==lneloc) {/* line */
-               if (flslvl==0 && pflag==0) {
-                       outp=inp=p; *--outp='#'; while (*inp!='\n') p=cotoken(p);
-                       continue;
-               }
-       } else if (*++inp=='\n') outp=inp;      /* allows blank line after # */
-       else pperror("undefined control",0);
-       /* flush to lf */
-       ++flslvl; while (*inp!='\n') {outp=inp=p; p=cotoken(p);} --flslvl;
-}
-}
-
-struct symtab *
-stsym(s) register char *s; {
-       char buf[BUFSIZ]; register char *p;
-
-       /* make definition look exactly like end of #define line */
-       /* copy to avoid running off end of world when param list is at end */
-       p=buf; while (*p++= *s++);
-       p=buf; while (isid(*p++)); /* skip first identifier */
-       if (*--p=='=') {*p++=' '; while (*p++);}
-       else {s=" 1"; while (*p++= *s++);}
-       pend=p; *--p='\n';
-       sloscan(); dodef(buf); return(lastsym);
-}
-
-struct symtab *
-ppsym(s) char *s; {/* kluge */
-       register struct symtab *sp;
-       cinit=SALT; *savch++=SALT; sp=stsym(s); --sp->name; cinit=0; return(sp);
-}
-
-/* VARARGS1 */
-pperror(s,x,y) char *s; {
-       if (fnames[ifno][0]) fprintf(stderr,
-# if gcos
-                       "*%c*   \"%s\", line ", exfail >= 0 ? 'F' : 'W',
-# else
-                       "%s: ",
-# endif
-                                fnames[ifno]);
-       fprintf(stderr, "%d: ",lineno[ifno]);
-       fprintf(stderr, s, x, y);
-       fprintf(stderr,"\n");
-       ++exfail;
-}
-
-yyerror(s,a,b) char *s; {
-       pperror(s,a,b);
-}
-
-ppwarn(s,x) char *s; {
-       int fail = exfail;
-       exfail = -1;
-       pperror(s,x);
-       exfail = fail;
-}
-
-struct symtab *
-lookup(namep, enterf)
-char *namep;
-{
-       register char *np, *snp;
-       register int c, i; int around;
-       register struct symtab *sp;
-
-       /* namep had better not be too long (currently, <=8 chars) */
-       np=namep; around=0; i=cinit;
-       while (c= *np++) i += i+c; c=i; /* c=i for register usage on pdp11 */
-       c %= symsiz; if (c<0) c += symsiz;
-       sp = &stab[c];
-       while (snp=sp->name) {
-               np = namep;
-               while (*snp++ == *np) if (*np++ == '\0') {
-                               if (enterf==DROP) {sp->name[0]= DROP; sp->value=0;}
-                               return(lastsym=sp);
-                       }
-               if (--sp < &stab[0])
-                       if (around) {pperror("too many defines", 0); exit(exfail);}
-                       else {++around; sp = &stab[symsiz-1];}
-       }
-       if (enterf>0) sp->name=namep;
-       return(lastsym=sp);
-}
-
-struct symtab *
-slookup(p1,p2,enterf) register char *p1,*p2; int enterf;{
-       register char *p3; char c2,c3; struct symtab *np;
-                c2= *p2; *p2='\0';     /* mark end of token */
-       if ((p2-p1)>8) p3=p1+8; else p3=p2;
-                        c3= *p3; *p3='\0';     /* truncate to 8 chars or less */
-       if (enterf==1) p1=copy(p1);
-       np=lookup(p1,enterf); *p3=c3; *p2=c2;
-       if (np->value!=0 && flslvl==0) newp=subst(p2,np);
-       else newp=0;
-       return(np);
-}
-
-char *
-subst(p,sp) register char *p; struct symtab *sp; {
-       static char match[]="%s: argument mismatch";
-       register char *ca,*vp; int params;
-       char *actual[MAXFRM]; /* actual[n] is text of nth actual */
-       char acttxt[BUFSIZ]; /* space for actuals */
-
-       if (0==(vp=sp->value)) return(p);
-       if ((p-macforw)<=macdam) {
-               if (++maclvl>symsiz && !rflag) {
-                       pperror("%s: macro recursion",sp->name); return(p);
-               }
-       } else maclvl=0;        /* level decreased */
-       macforw=p; macdam=0;    /* new target for decrease in level */
-       macnam=sp->name;
-       dump();
-       if (sp==ulnloc) {
-               vp=acttxt; *vp++='\0';
-               sprintf(vp,"%d",lineno[ifno]); while (*vp++);
-       } else if (sp==uflloc) {
-               vp=acttxt; *vp++='\0';
-               sprintf(vp,"\"%s\"",fnames[ifno]); while (*vp++);
-       }
-       if (0!=(params= *--vp&0xFF)) {/* definition calls for params */
-               register char **pa;
-               ca=acttxt; pa=actual;
-               if (params==0xFF) params=1;     /* #define foo() ... */
-               sloscan(); ++flslvl; /* no expansion during search for actuals */
-               plvl= -1;
-               do p=skipbl(p); while (*inp=='\n');     /* skip \n too */
-               if (*inp=='(') {
-                       maclin=lineno[ifno]; macfil=fnames[ifno];
-                       for (plvl=1; plvl!=0; ) {
-                               *ca++='\0';
-                               for (;;) {
-                                       outp=inp=p; p=cotoken(p);
-                                       if (*inp=='(') ++plvl;
-                                       if (*inp==')' && --plvl==0) {--params; break;}
-                                       if (plvl==1 && *inp==',') {--params; break;}
-                                       while (inp<p) *ca++= *inp++;
-                                       if (ca> &acttxt[BUFSIZ])
-                                               pperror("%s: actuals too long",sp->name);
-                               }
-                               if (pa>= &actual[MAXFRM]) ppwarn(match,sp->name);
-                               else *pa++=ca;
-                       }
-               }
-               if (params!=0) ppwarn(match,sp->name);
-               while (--params>=0) *pa++=""+1; /* null string for missing actuals */
-               --flslvl; fasscan();
-       }
-       for (;;) {/* push definition onto front of input stack */
-               while (!iswarn(*--vp)) {
-                       if (bob(p)) {outp=inp=p; p=unfill(p);}
-                       *--p= *vp;
-               }
-               if (*vp==warnc) {/* insert actual param */
-                       ca=actual[*--vp-1];
-                       while (*--ca) {
-                               if (bob(p)) {outp=inp=p; p=unfill(p);}
-                               *--p= *ca;
-                       }
-               } else break;
-       }
-       outp=inp=p;
-       return(p);
-}
-
-
-
-
-char *
-trmdir(s) register char *s; {
-       register char *p = s;
-       while (*p++); --p; while (p>s && *--p!='/');
-# if unix
-       if (p==s) *p++='.';
-# endif
-       *p='\0';
-       return(s);
-}
-
-STATIC char *
-copy(s) register char *s; {
-       register char *old;
-
-       old = savch; while (*savch++ = *s++);
-       return(old);
-}
-
-char *
-strdex(s,c) char *s,c; {
-       while (*s) if (*s++==c) return(--s);
-       return(0);
-}
-
-yywrap(){ return(1); }
-
-main(argc,argv)
-       char *argv[];
-{
-       register int i,c;
-       register char *p;
-       char *tf,**cp2;
-
-# if gcos
-       if (setjmp(env)) return (exfail);
-# endif
-       p="_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
-               i=0;
-               while (c= *p++) {
-                       (fastab+COFF)[c] |= IB|NB|SB; (toktyp+COFF)[c]=IDENT;
-#if scw2
-                       /* 53 == 63-10; digits rarely appear in identifiers,
-                       /* and can never be the first char of an identifier.
-                       /* 11 == 53*53/sizeof(macbit) .
-                       */
-                       ++i; (t21+COFF)[c]=(53*i)/11; (t22+COFF)[c]=i%11;
-#endif
-               }
-       p="0123456789.";
-               while (c= *p++) {(fastab+COFF)[c] |= NB|SB; (toktyp+COFF)[c]=NUMBR;}
-# if gcos
-       p="\n\"'`/\\";
-# else
-       p="\n\"'/\\";
-# endif
-               while (c= *p++) (fastab+COFF)[c] |= SB;
-# if gcos
-       p="\n\"'`\\";
-# else
-       p="\n\"'\\";
-# endif
-               while (c= *p++) (fastab+COFF)[c] |= QB;
-       p="*\n"; while (c= *p++) (fastab+COFF)[c] |= CB;
-       (fastab+COFF)[warnc] |= WB;
-       (fastab+COFF)['\0'] |= CB|QB|SB|WB;
-       for (i=ALFSIZ; --i>=0; ) slotab[i]=fastab[i]|SB;
-       p=" \t\013\f\r";        /* note no \n;  \v not legal for vertical tab? */
-               while (c= *p++) (toktyp+COFF)[c]=BLANK;
-#if scw2
-       for ((t23+COFF)[i=ALFSIZ+7-COFF]=1; --i>=-COFF; )
-               if (((t23+COFF)[i]=(t23+COFF+1)[i]<<1)==0) (t23+COFF)[i]=1;
-#endif
-
-# if unix
-       fnames[ifno=0] = "";
-# endif
-# if ibm
-       fnames[ifno=0] = "";
-# endif
-# if gcos
-       if (inquire(stdin, _TTY)) freopen("*src", "rt", stdin);
-# endif
-# if gimpel || gcos
-       fnames[ifno=0] = (char *)inquire(stdin, _FILENAME);
-       dirnams[0] = dirs[0] = trmdir(copy(fnames[0]));
-# endif
-       for(i=1; i<argc; i++)
-               {
-               switch(argv[i][0])
-                       {
-                       case '-':
-# if gcos
-                       switch(toupper(argv[i][1])) { /* case-independent on GCOS */
-# else
-                       switch(argv[i][1]) {
-# endif
-                               case 'P': pflag++;
-                               case 'E': continue;
-                               case 'R': ++rflag; continue;
-                               case 'C': passcom++; continue;
-                               case 'D':
-                                       if (predef>prespc+NPREDEF) {
-                                               pperror("too many -D options, ignoring %s",argv[i]);
-                                               continue;
-                                       }
-                                       /* ignore plain "-D" (no argument) */
-                                       if (*(argv[i]+2)) *predef++ = argv[i]+2;
-                                       continue;
-                               case 'U':
-                                       if (prund>punspc+NPREDEF) {
-                                               pperror("too many -U options, ignoring %s",argv[i]);
-                                               continue;
-                                       }
-                                       *prund++ = argv[i]+2;
-                                       continue;
-                               case 'I':
-                                       if (nd>8) pperror("excessive -I file (%s) ignored",argv[i]);
-                                       else dirs[nd++] = argv[i]+2;
-                                       continue;
-                               case '\0': continue;
-                               default: 
-                                       pperror("unknown flag %s", argv[i]);
-                                       continue;
-                               }
-                       default:
-                               if (fin==STDIN) {
-                                       if (0>(fin=open(argv[i], READ))) {
-                                               pperror("No source file %s",argv[i]); exit(8);
-                                       }
-                                       fnames[ifno]=copy(argv[i]);
-                                       dirs[0]=dirnams[ifno]=trmdir(argv[i]);
-# ifndef gcos
-/* too dangerous to have file name in same syntactic position
-   be input or output file depending on file redirections,
-   so force output to stdout, willy-nilly
-       [i don't see what the problem is.  jfr]
-*/
-                               } else if (fout==stdout) {
-                                       extern char _sobuf[BUFSIZ];
-                                       if (NULL==(fout=fopen(argv[i], "w"))) {
-                                               pperror("Can't create %s", argv[i]); exit(8);
-                                       } else {fclose(stdout); setbuf(fout,_sobuf);}
-# endif
-                               } else pperror("extraneous name %s", argv[i]);
-                       }
-               }
-
-       fins[ifno]=fin;
-       exfail = 0;
-               /* after user -I files here are the standard include libraries */
-# if unix
-       dirs[nd++] = "/usr/include";
-# endif
-# if gcos
-       dirs[nd++] = "cc/include";
-# endif
-# if ibm
-# ifndef gimpel
-       dirs[nd++] = "BTL$CLIB";
-# endif
-# endif
-# ifdef gimpel
-       dirs[nd++] = intss() ?  "SYS3.C." : "" ;
-# endif
-       /* dirs[nd++] = "/compool"; */
-       dirs[nd++] = 0;
-       defloc=ppsym("define");
-       udfloc=ppsym("undef");
-       incloc=ppsym("include");
-       elsloc=ppsym("else");
-       eifloc=ppsym("endif");
-       ifdloc=ppsym("ifdef");
-       ifnloc=ppsym("ifndef");
-       ifloc=ppsym("if");
-       lneloc=ppsym("line");
-       for (i=sizeof(macbit)/sizeof(macbit[0]); --i>=0; ) macbit[i]=0;
-# if unix
-       ysysloc=stsym("unix");
-# endif
-# if gcos
-       ysysloc=stsym ("gcos");
-# endif
-# if ibm
-       ysysloc=stsym ("ibm");
-# endif
-# if pdp11
-       varloc=stsym("pdp11");
-# endif
-# if vax
-       varloc=stsym("vax");
-# endif
-# if interdata
-       varloc=stsym ("interdata");
-# endif
-# if tss
-       varloc=stsym ("tss");
-# endif
-# if os
-       varloc=stsym ("os");
-# endif
-# if mert
-       varloc=stsym ("mert");
-# endif
-       ulnloc=stsym ("__LINE__");
-       uflloc=stsym ("__FILE__");
-
-       tf=fnames[ifno]; fnames[ifno]="command line"; lineno[ifno]=1;
-       cp2=prespc;
-       while (cp2<predef) stsym(*cp2++);
-       cp2=punspc;
-       while (cp2<prund) {
-               if (p=strdex(*cp2, '=')) *p++='\0';
-               lookup(*cp2++, DROP);
-       }
-       fnames[ifno]=tf;
-       pbeg=buffer+8; pbuf=pbeg+BUFSIZ; pend=pbuf+BUFSIZ;
-
-       trulvl = 0; flslvl = 0;
-       lineno[0] = 1; sayline();
-       outp=inp=pend;
-       control(pend);
-       return (exfail);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cpp/cpy.y b/.ref-Research-V7/usr/src/cmd/cpp/cpy.y
deleted file mode 100644 (file)
index e95138e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-%term number stop DEFINED
-%term EQ NE LE GE LS RS
-%term ANDAND OROR
-%left ','
-%right '='
-%right '?' ':'
-%left OROR
-%left ANDAND
-%left '|' '^'
-%left '&'
-%binary EQ NE
-%binary '<' '>' LE GE
-%left LS RS
-%left '+' '-'
-%left '*' '/' '%'
-%right '!' '~' UMINUS
-%left '(' '.'
-%%
-S:     e stop  ={return($1);}
-
-
-e:       e '*' e
-               ={$$ = $1 * $3;}
-       | e '/' e
-               ={$$ = $1 / $3;}
-       | e '%' e
-               ={$$ = $1 % $3;}
-       | e '+' e
-               ={$$ = $1 + $3;}
-       | e '-' e
-               ={$$ = $1 - $3;}
-       | e LS e
-               ={$$ = $1 << $3;}
-       | e RS e
-               ={$$ = $1 >> $3;}
-       | e '<' e
-               ={$$ = $1 < $3;}
-       | e '>' e
-               ={$$ = $1 > $3;}
-       | e LE e
-               ={$$ = $1 <= $3;}
-       | e GE e
-               ={$$ = $1 >= $3;}
-       | e EQ e
-               ={$$ = $1 == $3;}
-       | e NE e
-               ={$$ = $1 != $3;}
-       | e '&' e
-               ={$$ = $1 & $3;}
-       | e '^' e
-               ={$$ = $1 ^ $3;}
-       | e '|' e
-               ={$$ = $1 | $3;}
-       | e ANDAND e
-               ={$$ = $1 && $3;}
-       | e OROR e
-               ={$$ = $1 || $3;}
-       | e '?' e ':' e
-               ={$$ = $1 ? $3 : $5;}
-       | e ',' e
-               ={$$ = $3;}
-       | term
-               ={$$ = $1;}
-term:
-         '-' term %prec UMINUS
-               ={$$ = -$1;}
-       | '!' term
-               ={$$ = !$1;}
-       | '~' term
-               ={$$ = ~$1;}
-       | '(' e ')'
-               ={$$ = $2;}
-       | DEFINED '(' number ')'
-               ={$$= $3;}
-       | DEFINED number
-               ={$$ = $2;}
-       | number
-               ={$$= $1;}
-%%
-# include "yylex.c"
diff --git a/.ref-Research-V7/usr/src/cmd/cpp/makefile b/.ref-Research-V7/usr/src/cmd/cpp/makefile
deleted file mode 100644 (file)
index e8e6a89..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-CFLAGS=-O -n -s
-
-all:   cpp
-
-cp:    cpp
-       cp cpp /lib
-       rm *.o cpp
-
-cmp:   cpp
-       cmp cpp /lib/cpp
-       rm *.o cpp
-
-cpp: cpp.o cpy.o
-       cc $(CFLAGS) cpp.o cpy.o -o cpp
-cpp.o: cpp.c
-       cc $(CFLAGS) -c -Dunix=1 -Dpdp11=1 cpp.c
-cpy.o: cpy.y yylex.c
diff --git a/.ref-Research-V7/usr/src/cmd/cpp/yylex.c b/.ref-Research-V7/usr/src/cmd/cpp/yylex.c
deleted file mode 100644 (file)
index 6bc7d8d..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#define isid(a)  ((fastab+COFF)[a]&IB)
-#define IB 1
-/*     #if '\377' < 0          it would be nice if this worked properly!!!!! */
-#if pdp11 | vax
-#define COFF 128
-#else
-#define COFF 0
-#endif
-
-yylex() {
-       static int ifdef=0;
-       static char *op2[]={"||",  "&&" , ">>", "<<", ">=", "<=", "!=", "=="};
-       static int  val2[]={OROR, ANDAND,  RS,   LS,   GE,   LE,   NE,   EQ};
-       static char *opc="b\bt\tn\nf\fr\r\\\\";
-       extern char fastab[];
-       extern char *outp,*inp,*newp; extern int flslvl;
-       register char savc, *s; char *skipbl(); int val;
-       register char **p2;
-       struct symtab {
-               char *name;
-               char *value;
-       } *sp;
-
-for (;;) {
-       newp=skipbl(newp);
-       if (*inp=='\n') return(stop);   /* end of #if */
-       savc= *newp; *newp='\0';
-       for (p2=op2+8; --p2>=op2; )     /* check 2-char ops */
-               if (0==strcmp(*p2,inp)) {val=val2[p2-op2]; goto ret;}
-       s="+-*/%<>&^|?:!~(),";  /* check 1-char ops */
-       while (*s) if (*s++== *inp) {val= *--s; goto ret;}
-       if (*inp<='9' && *inp>='0') {/* a number */
-               if (*inp=='0') yylval= (inp[1]=='x' || inp[1]=='X') ?
-                       tobinary(inp+2,16) : tobinary(inp+1,8);
-               else yylval=tobinary(inp,10);
-               val=number;
-       } else if (isid(*inp)) {
-               if (0==strcmp(inp,"defined")) {ifdef=1; ++flslvl; val=DEFINED;}
-               else {
-                       sp=lookup(inp,-1); if (ifdef!=0) {ifdef=0; --flslvl;}
-                       yylval= (sp->value==0) ? 0 : 1;
-                       val=number;
-               }
-       } else  if (*inp=='\'') {/* character constant */
-               val=number;
-               if (inp[1]=='\\') {/* escaped */
-                       char c; if (newp[-1]=='\'') newp[-1]='\0';
-                       s=opc;
-                       while (*s) if (*s++!=inp[2]) ++s; else {yylval= *s; goto ret;}
-                       if (inp[2]<='9' && inp[2]>='0') yylval=c=tobinary(inp+2,8);
-                       else yylval=inp[2];
-               } else yylval=inp[1];
-       } else if (0==strcmp("\\\n",inp)) {*newp=savc; continue;}
-       else {
-               *newp=savc; pperror("Illegal character %c in preprocessor if", *inp);
-               continue;
-       }
-ret:
-       *newp=savc; outp=inp=newp; return(val);
-}
-}
-
-tobinary(st, b) char *st; {
-       int n, c, t;
-       char *s;
-       n=0;
-       s=st;
-       while (c = *s++) {
-       switch(c) {
-               case '0': case '1': case '2': case '3': case '4': 
-               case '5': case '6': case '7': case '8': case '9': 
-                       t = c-'0'; break;
-               case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': 
-                       t = c-'a'; if (b>10) break;
-               case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': 
-                       t = c - 'A'; if (b>10) break;
-               default:
-                       t = -1;
-                       if ( c=='l' || c=='L') if (*s=='\0') break;
-                       pperror("Illegal number %s", st);
-       }
-       if (t<0) break;
-       n = n*b+t;
-       }
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cron.c b/.ref-Research-V7/usr/src/cmd/cron.c
deleted file mode 100644 (file)
index eda9e9c..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-#include <sys/types.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/stat.h>
-
-#define        LISTS   512
-
-#define        EXACT   100
-#define        ANY     101
-#define        LIST    102
-#define        RANGE   103
-#define        EOS     104
-char   crontab[]       = "/usr/lib/crontab";
-time_t itime;
-struct tm *loct;
-struct tm *localtime();
-char   *malloc();
-char   *realloc();
-int    flag;
-char   *list;
-unsigned listsize;
-
-main()
-{
-       register char *cp;
-       char *cmp();
-       time_t filetime = 0;
-
-       setuid(1);
-       if (fork())
-               exit(0);
-       chdir("/");
-       freopen(crontab, "r", stdin);
-       freopen("/", "r", stdout);
-       freopen("/", "r", stderr);
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       time(&itime);
-       itime -= localtime(&itime)->tm_sec;
-       fclose(stdin);
-
-       for (;; itime+=60, slp()) {
-               struct stat cstat;
-
-               if (stat(crontab, &cstat) == -1)
-                       continue;
-               if (cstat.st_mtime > filetime) {
-                       filetime = cstat.st_mtime;
-                       init();
-               }
-               loct = localtime(&itime);
-               loct->tm_mon++;          /* 1-12 for month */
-               for(cp = list; *cp != EOS;) {
-                       flag = 0;
-                       cp = cmp(cp, loct->tm_min);
-                       cp = cmp(cp, loct->tm_hour);
-                       cp = cmp(cp, loct->tm_mday);
-                       cp = cmp(cp, loct->tm_mon);
-                       cp = cmp(cp, loct->tm_wday);
-                       if(flag == 0) {
-                               slp();
-                               ex(cp);
-                       }
-                       while(*cp++ != 0)
-                               ;
-               }
-       }
-}
-
-char *
-cmp(p, v)
-char *p;
-{
-       register char *cp;
-
-       cp = p;
-       switch(*cp++) {
-
-       case EXACT:
-               if (*cp++ != v)
-                       flag++;
-               return(cp);
-
-       case ANY:
-               return(cp);
-
-       case LIST:
-               while(*cp != LIST)
-                       if(*cp++ == v) {
-                               while(*cp++ != LIST)
-                                       ;
-                               return(cp);
-                       }
-               flag++;
-               return(cp+1);
-
-       case RANGE:
-               if(*cp > v || cp[1] < v)
-                       flag++;
-               return(cp+2);
-       }
-       if(cp[-1] != v)
-               flag++;
-       return(cp);
-}
-
-slp()
-{
-       register i;
-       time_t t;
-
-       time(&t);
-       i = itime - t;
-       if(i > 0)
-               sleep(i);
-}
-
-ex(s)
-char *s;
-{
-       int st;
-
-       if(fork()) {
-               wait(&st);
-               return;
-       }
-       if(fork())
-               exit(0);
-       freopen("/", "r", stdin);
-       execl("/bin/sh", "sh", "-c", s, 0);
-       exit(0);
-}
-
-init()
-{
-       register i, c;
-       register char *cp;
-       register char *ocp;
-       register int n;
-
-       freopen(crontab, "r", stdin);
-       if (list) {
-               free(list);
-               list = realloc(list, LISTS);
-       } else
-               list = malloc(LISTS);
-       listsize = LISTS;
-       cp = list;
-
-loop:
-       if(cp > list+listsize-100) {
-               char *olist;
-               listsize += LISTS;
-               olist = list;
-               free(list);
-               list = realloc(list, listsize);
-               cp = list + (cp - olist);
-       }
-       ocp = cp;
-       for(i=0;; i++) {
-               do
-                       c = getchar();
-               while(c == ' ' || c == '\t')
-                       ;
-               if(c == EOF || c == '\n')
-                       goto ignore;
-               if(i == 5)
-                       break;
-               if(c == '*') {
-                       *cp++ = ANY;
-                       continue;
-               }
-               if ((n = number(c)) < 0)
-                       goto ignore;
-               c = getchar();
-               if(c == ',')
-                       goto mlist;
-               if(c == '-')
-                       goto mrange;
-               if(c != '\t' && c != ' ')
-                       goto ignore;
-               *cp++ = EXACT;
-               *cp++ = n;
-               continue;
-
-       mlist:
-               *cp++ = LIST;
-               *cp++ = n;
-               do {
-                       if ((n = number(getchar())) < 0)
-                               goto ignore;
-                       *cp++ = n;
-                       c = getchar();
-               } while (c==',');
-               if(c != '\t' && c != ' ')
-                       goto ignore;
-               *cp++ = LIST;
-               continue;
-
-       mrange:
-               *cp++ = RANGE;
-               *cp++ = n;
-               if ((n = number(getchar())) < 0)
-                       goto ignore;
-               c = getchar();
-               if(c != '\t' && c != ' ')
-                       goto ignore;
-               *cp++ = n;
-       }
-       while(c != '\n') {
-               if(c == EOF)
-                       goto ignore;
-               if(c == '%')
-                       c = '\n';
-               *cp++ = c;
-               c = getchar();
-       }
-       *cp++ = '\n';
-       *cp++ = 0;
-       goto loop;
-
-ignore:
-       cp = ocp;
-       while(c != '\n') {
-               if(c == EOF) {
-                       *cp++ = EOS;
-                       *cp++ = EOS;
-                       fclose(stdin);
-                       return;
-               }
-               c = getchar();
-       }
-       goto loop;
-}
-
-number(c)
-register c;
-{
-       register n = 0;
-
-       while (isdigit(c)) {
-               n = n*10 + c - '0';
-               c = getchar();
-       }
-       ungetc(c, stdin);
-       if (n>=100)
-               return(-1);
-       return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/crypt.c b/.ref-Research-V7/usr/src/cmd/crypt.c
deleted file mode 100644 (file)
index b53e451..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *     A one-rotor machine designed along the lines of Enigma
- *     but considerably trivialized.
- */
-
-#define ECHO 010
-#include <stdio.h>
-#define ROTORSZ 256
-#define MASK 0377
-char   t1[ROTORSZ];
-char   t2[ROTORSZ];
-char   t3[ROTORSZ];
-char   *getpass();
-
-setup(pw)
-char *pw;
-{
-       int ic, i, k, temp, pf[2];
-       unsigned random;
-       char buf[13];
-       long seed;
-
-       strncpy(buf, pw, 8);
-       while (*pw)
-               *pw++ = '\0';
-       buf[8] = buf[0];
-       buf[9] = buf[1];
-       pipe(pf);
-       if (fork()==0) {
-               close(0);
-               close(1);
-               dup(pf[0]);
-               dup(pf[1]);
-               execl("/usr/lib/makekey", "-", 0);
-               execl("/lib/makekey", "-", 0);
-               exit(1);
-       }
-       write(pf[1], buf, 10);
-       wait((int *)NULL);
-       if (read(pf[0], buf, 13) != 13) {
-               fprintf(stderr, "crypt: cannot generate key\n");
-               exit(1);
-       }
-       seed = 123;
-       for (i=0; i<13; i++)
-               seed = seed*buf[i] + i;
-       for(i=0;i<ROTORSZ;i++)
-               t1[i] = i;
-       for(i=0;i<ROTORSZ;i++) {
-               seed = 5*seed + buf[i%13];
-               random = seed % 65521;
-               k = ROTORSZ-1 - i;
-               ic = (random&MASK)%(k+1);
-               random >>= 8;
-               temp = t1[k];
-               t1[k] = t1[ic];
-               t1[ic] = temp;
-               if(t3[k]!=0) continue;
-               ic = (random&MASK) % k;
-               while(t3[ic]!=0) ic = (ic+1) % k;
-               t3[k] = ic;
-               t3[ic] = k;
-       }
-       for(i=0;i<ROTORSZ;i++)
-               t2[t1[i]&MASK] = i;
-}
-
-main(argc, argv)
-char *argv[];
-{
-       register i, n1, n2;
-
-       if (argc != 2){
-               setup(getpass("Enter key:"));
-       }
-       else
-               setup(argv[1]);
-       n1 = 0;
-       n2 = 0;
-
-       while((i=getchar()) >=0) {
-               i = t2[(t3[(t1[(i+n1)&MASK]+n2)&MASK]-n2)&MASK]-n1;
-               putchar(i);
-               n1++;
-               if(n1==ROTORSZ) {
-                       n1 = 0;
-                       n2++;
-                       if(n2==ROTORSZ) n2 = 0;
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/cu.c b/.ref-Research-V7/usr/src/cmd/cu.c
deleted file mode 100644 (file)
index 39ee82c..0000000
+++ /dev/null
@@ -1,539 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-#include <sgtty.h>
-/*
- *     cu telno [-t] [-s speed] [-l line] [-a acu]
- *
- *     -t is for dial-out to terminal.
- *     speeds are: 110, 134, 150, 300, 1200. 300 is default.
- *
- *     Escape with `~' at beginning of line.
- *     Ordinary diversions are ~<, ~> and ~>>.
- *     Silent output diversions are ~>: and ~>>:.
- *     Terminate output diversion with ~> alone.
- *     Quit is ~. and ~! gives local command or shell.
- *     Also ~$ for canned procedure pumping remote.
- *     ~%put from [to]  and  ~%take from [to] invoke builtins
- */
-
-#define CRLF "\r\n"
-#define wrc(ds) write(ds,&c,1)
-
-
-char   *devcul = "/dev/cul0";
-char   *devcua = "/dev/cua0";
-char   *lspeed = "300";
-
-int    ln;     /* fd for comm line */
-char   tkill, terase;  /* current input kill & erase */
-char   c;
-
-char   *connmsg[] = {
-       "",
-       "line busy",
-       "call dropped",
-       "no carrier",
-       "can't fork",
-       "acu access",
-       "tty access",
-       "tty hung",
-       "usage: cu telno [-t] [-s speed] [-l line] [-a acu]"
-};
-
-rdc(ds) {
-
-       ds=read(ds,&c,1); 
-       c&= 0177; 
-       return (ds);
-}
-
-int intr;
-
-sig2()
-{
-       signal(SIGINT, SIG_IGN); 
-       intr = 1;
-}
-
-int set14;
-
-xsleep(n)
-{
-       xalarm(n);
-       pause();
-       xalarm(0);
-}
-
-xalarm(n)
-{
-       set14=n; 
-       alarm(n);
-}
-
-sig14()
-{
-       signal(SIGALRM, sig14); 
-       if (set14) alarm(1);
-}
-
-int    dout;
-int    nhup;
-
-/*
- *     main: get connection, set speed for line.
- *     spawn child to invoke rd to read from line, output to fd 1
- *     main line invokes wr to read tty, write to line
- */
-main(ac,av)
-char *av[];
-{
-       int fk;
-       int speed;
-       char *telno;
-       struct sgttyb stbuf;
-
-       signal(SIGALRM, sig14);
-       if (ac < 2) {
-               prf(connmsg[8]);
-               exit(8);
-       }
-       telno = av[1];
-       av += 2;
-       ac -= 2;
-       for (; ac > 0; av++) {
-               if (equal(*av, "-t")) {
-                       dout = 1;
-                       --ac;
-                       continue;
-               }
-               if (ac < 2)
-                       break;
-               if (equal(*av, "-s"))
-                       lspeed = *++av;
-               else if (equal(*av, "-l"))
-                       devcul = *++av;
-               else if (equal(*av, "-a"))
-                       devcua = *++av;
-               else
-                       break;
-               ac -= 2;
-       }
-       if (!exists(devcua) || !exists(devcul))
-               exit(9);
-       ln = conn(devcul, devcua, telno);
-       if (ln < 0) {
-               prf("Connect failed: %s",connmsg[-ln]);
-               exit(-ln);
-       }
-       switch(atoi(lspeed)) {
-       case 110:
-               speed = B110;break;
-       case 150:
-               speed = B150;break;
-       default:
-       case 300:
-               speed = B300;break;
-       case 1200:
-               speed = B1200;break;
-       }
-       stbuf.sg_ispeed = speed;
-       stbuf.sg_ospeed = speed;
-       stbuf.sg_flags = EVENP|ODDP;
-       if (!dout)
-               stbuf.sg_flags |= RAW;
-       ioctl(TIOCSETP, ln, &stbuf);
-       ioctl(TIOCEXCL, ln, (struct sgttyb *)NULL);
-       ioctl(TIOCHPCL, ln, (struct sgttyb *)NULL);
-       prf("Connected");
-       if (dout)
-               fk = -1;
-       else
-               fk = fork();
-       nhup = (int)signal(SIGINT, SIG_IGN);
-       if (fk == 0) {
-               rd();
-               prf("\007Lost carrier");
-               exit(3);
-       }
-       mode(1);
-       wr();
-       mode(0);
-       kill(fk, SIGKILL);
-       wait((int *)NULL);
-       stbuf.sg_ispeed = 0;
-       stbuf.sg_ospeed = 0;
-       ioctl(TIOCSETP, ln, &stbuf);
-       prf("Disconnected");
-       exit(0);
-}
-
-/*
- *     conn: establish dial-out connection.
- *     Example:  fd = conn("/dev/ttyh","/dev/dn1","4500");
- *     Returns descriptor open to tty for reading and writing.
- *     Negative values (-1...-7) denote errors in connmsg.
- *     Uses alarm and fork/wait; requires sig14 handler.
- *     Be sure to disconnect tty when done, via HUPCL or stty 0.
- */
-
-conn(dev,acu,telno)
-char *dev, *acu, *telno;
-{
-       struct sgttyb stbuf;
-       extern errno;
-       char *p, *q, b[30];
-       int er, fk, dn, dh, t;
-       er=0; 
-       fk=(-1);
-       if ((dn=open(acu,1))<0) {
-               er=(errno == 6? 1:5); 
-               goto X;
-       }
-       if ((fk=fork()) == (-1)) {
-               er=4; 
-               goto X;
-       }
-       if (fk == 0) {
-               open(dev,2); 
-               for (;;) pause();
-       }
-       xsleep(2);
-       /*
-        *      copy phone #, assure EON
-        */
-       p=b; 
-       q=telno;
-       while (*p++=(*q++))
-               ;
-       p--;
-       if (*(p-1)!='<') {
-               if (*(p-1)!='-') *p++='-';
-               *p++='<';
-       }
-       t=p-b;
-       xalarm(5*t);
-       t=write(dn,b,t);
-       xalarm(0);
-       if (t<0) {
-               er=2; 
-               goto X;
-       }
-       /* close(dn) */
-       xalarm(40);             /* was 5; sometimes missed carrier */
-       dh = open(dev,2);
-       xalarm(0);
-       if (dh<0) {
-               er=(errno == 4? 3:6); 
-               goto X;
-       }
-       ioctl(TIOCGETP, ln, &stbuf);
-       stbuf.sg_flags &= ~ECHO;
-       xalarm(10);
-       ioctl(TIOCSETP, dh, &stbuf);
-       ioctl(TIOCHPCL, dh, (struct sgttyb *)NULL);
-       xalarm(0);
-X: 
-       if (er) close(dn);
-       if (fk!=(-1)) {
-               kill(fk, SIGKILL);
-               xalarm(10);
-               while ((t=wait((int *)NULL))!=(-1) && t!=fk);
-               xalarm(0);
-       }
-       return (er? -er:dh);
-}
-
-/*
- *     wr: write to remote: 0 -> line.
- *     ~.      terminate
- *     ~<file  send file
- *     ~!      local login-style shell
- *     ~!cmd   execute cmd locally
- *     ~$proc  execute proc locally, send output to line
- *     ~%cmd   execute builtin cmd (put and take)
- */
-
-wr()
-{
-       int ds,fk,lcl,x;
-       char *p,b[600];
-       for (;;) {
-               p=b;
-               while (rdc(0) == 1) {
-                       if (p == b) lcl=(c == '~');
-                       if (p == b+1 && b[0] == '~') lcl=(c!='~');
-                       if (c == 0) c=0177;
-                       if (!lcl) {
-                               if (wrc(ln) == 0) {
-                                       prf("line gone"); return;
-                               }
-                       }
-                       if (lcl) {
-                               if (c == 0177) c=tkill;
-                               if (c == '\r' || c == '\n') goto A;
-                               if (!dout) wrc(0);
-                       }
-                       *p++=c;
-                       if (c == terase) {
-                               p=p-2; 
-                               if (p<b) p=b;
-                       }
-                       if (c == tkill || c == 0177 || c == '\r' || c == '\n') p=b;
-               }
-               return;
-A: 
-               if (!dout) echo("");
-               *p=0;
-               switch (b[1]) {
-               case '.':
-               case '\004':
-                       return;
-               case '!':
-               case '$':
-                       fk = fork();
-                       if (fk == 0) {
-                               close(1);
-                               dup(b[1] == '$'? ln:2);
-                               close(ln);
-                               mode(0);
-                               if (!nhup) signal(SIGINT, SIG_DFL);
-                               if (b[2] == 0) execl("/bin/sh","-",0);
-                               else execl("/bin/sh","sh","-c",b+2,0);
-                               prf("Can't execute shell");
-                               exit(~0);
-                       }
-                       if (fk!=(-1)) {
-                               while (wait(&x)!=fk);
-                       }
-                       mode(1);
-                       if (b[1] == '!') echo("!");
-                       else {
-                               if (dout) echo("$");
-                       }
-                       break;
-               case '<':
-                       if (b[2] == 0) break;
-                       if ((ds=open(b+2,0))<0) {
-                               prf("Can't divert %s",b+1); 
-                               break;
-                       }
-                       intr=x=0;
-                       mode(2);
-                       if (!nhup) signal(SIGINT, sig2);
-                       while (!intr && rdc(ds) == 1) {
-                               if (wrc(ln) == 0) {
-                                       x=1; 
-                                       break;
-                               }
-                       }
-                       signal(SIGINT, SIG_IGN);
-                       close(ds);
-                       mode(1);
-                       if (x) return;
-                       if (dout) echo("<");
-                       break;
-               case '%':
-                       dopercen(&b[2]);
-                       break;
-               default:
-                       prf("Use `~~' to start line with `~'");
-               }
-               continue;
-       }
-}
-
-dopercen(line)
-register char *line;
-{
-       char *args[10];
-       register narg, f;
-       int rcount;
-       for (narg = 0; narg < 10;) {
-               while(*line == ' ' || *line == '\t')
-                       line++;
-               if (*line == '\0')
-                       break;
-               args[narg++] = line;
-               while(*line != '\0' && *line != ' ' && *line != '\t')
-                       line++;
-               if (*line == '\0')
-                       break;
-               *line++ = '\0';
-       }
-       if (equal(args[0], "take")) {
-               if (narg < 2) {
-                       prf("usage: ~%%take from [to]");
-                       return;
-               }
-               if (narg < 3)
-                       args[2] = args[1];
-               wrln("echo '~>:'");
-               wrln(args[2]);
-               wrln(";tee /dev/null <");
-               wrln(args[1]);
-               wrln(";echo '~>'\n");
-               return;
-       } else if (equal(args[0], "put")) {
-               if (narg < 2) {
-                       prf("usage: ~%%put from [to]");
-                       return;
-               }
-               if (narg < 3)
-                       args[2] = args[1];
-               if ((f = open(args[1], 0)) < 0) {
-                       prf("cannot open: %s", args[1]);
-                       return;
-               }
-               wrln("stty -echo;cat >");
-               wrln(args[2]);
-               wrln(";stty echo\n");
-               xsleep(5);
-               intr = 0;
-               if (!nhup)
-                       signal(SIGINT, sig2);
-               mode(2);
-               rcount = 0;
-               while(!intr && rdc(f) == 1) {
-                       rcount++;
-                       if (c == tkill || c == terase)
-                               wrln("\\");
-                       if (wrc(ln) != 1) {
-                               xsleep(2);
-                               if (wrc(ln) != 1) {
-                                       prf("character missed");
-                                       intr = 1;
-                                       break;
-                               }
-                       }
-               }
-               signal(SIGINT, SIG_IGN);
-               close(f);
-               if (intr) {
-                       wrln("\n");
-                       prf("stopped after %d bytes", rcount);
-               }
-               wrln("\004");
-               xsleep(5);
-               mode(1);
-               return;
-       }
-       prf("~%%%s unknown\n", args[0]);
-}
-
-equal(s1, s2)
-register char *s1, *s2;
-{
-       while (*s1++ == *s2)
-               if (*s2++ == '\0')
-                       return(1);
-       return(0);
-}
-
-wrln(s)
-register char *s;
-{
-       while (*s)
-               write(ln, s++, 1);
-}
-
-/*
- *     rd: read from remote: line -> 1
- *     catch:
- *     ~>[>][:][file]
- *     stuff from file...
- *     ~>      (ends diversion)
- */
-
-rd()
-{
-       int ds,slnt;
-       char *p,*q,b[600];
-       p=b;
-       ds=(-1);
-       while (rdc(ln) == 1) {
-               if (ds<0) slnt=0;
-               if (!slnt) wrc(1);
-               *p++=c;
-               if (c!='\n') continue;
-               q=p; 
-               p=b;
-               if (b[0]!='~' || b[1]!='>') {
-                       if (*(q-2) == '\r') {
-                               q--; 
-                               *(q-1)=(*q);
-                       }
-                       if (ds>=0) write(ds,b,q-b);
-                       continue;
-               }
-               if (ds>=0) close(ds);
-               if (slnt) {
-                       write(1, b, q - b);
-                       write(1, CRLF, sizeof(CRLF));
-               }
-               if (*(q-2) == '\r') q--;
-               *(q-1)=0;
-               slnt=0;
-               q=b+2;
-               if (*q == '>') q++;
-               if (*q == ':') {
-                       slnt=1; 
-                       q++;
-               }
-               if (*q == 0) {
-                       ds=(-1); 
-                       continue;
-               }
-               if (b[2]!='>' || (ds=open(q,1))<0) ds=creat(q,0644);
-               lseek(ds, (long)0, 2);
-               if (ds<0) prf("Can't divert %s",b+1);
-       }
-}
-
-struct {char lobyte; char hibyte;};
-mode(f)
-{
-       struct sgttyb stbuf;
-       if (dout) return;
-       ioctl(TIOCGETP, 0, &stbuf);
-       tkill = stbuf.sg_kill;
-       terase = stbuf.sg_erase;
-       if (f == 0) {
-               stbuf.sg_flags &= ~RAW;
-               stbuf.sg_flags |= ECHO|CRMOD;
-       }
-       if (f == 1) {
-               stbuf.sg_flags |= RAW;
-               stbuf.sg_flags &= ECHO|CRMOD;
-       }
-       if (f == 2) {
-               stbuf.sg_flags &= ~RAW;
-               stbuf.sg_flags &= ~(ECHO|CRMOD);
-       }
-       ioctl(TIOCSETP, 0, &stbuf);
-}
-
-echo(s)
-char *s;
-{
-       char *p;
-       for (p=s;*p;p++);
-       if (p>s) write(0,s,p-s);
-       write(0,CRLF, sizeof(CRLF));
-}
-
-prf(f, s)
-char *f;
-char *s;
-{
-       fprintf(stderr, f, s);
-       fprintf(stderr, CRLF);
-}
-
-exists(devname)
-char *devname;
-{
-       if (access(devname, 0)==0)
-               return(1);
-       prf("%s does not exist", devname);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/date.c b/.ref-Research-V7/usr/src/cmd/date.c
deleted file mode 100644 (file)
index a005765..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * date : print date
- * date YYMMDDHHMM[.SS] : set date, if allowed
- * date -u ... : date in GMT
- */
-#include <time.h>
-#include <sys/types.h>
-#include <sys/timeb.h>
-#include <utmp.h>
-long   timbuf;
-char   *ap, *ep, *sp;
-int    uflag;
-
-char   *timezone();
-static int     dmsize[12] =
-{
-       31,
-       28,
-       31,
-       30,
-       31,
-       30,
-       31,
-       31,
-       30,
-       31,
-       30,
-       31
-};
-
-struct utmp wtmp[2] = { {"|", "", 0}, {"{", "", 0}};
-
-char   *ctime();
-char   *asctime();
-struct tm *localtime();
-struct tm *gmtime();
-
-main(argc, argv)
-char *argv[];
-{
-       register char *tzn;
-       struct timeb info;
-       int wf, rc;
-
-       rc = 0;
-       ftime(&info);
-       if (argc>1 && argv[1][0]=='-' && argv[1][1]=='u') {
-               argc--;
-               argv++;
-               uflag++;
-       }
-       if(argc > 1) {
-               ap = argv[1];
-               if (gtime()) {
-                       printf("date: bad conversion\n");
-                       exit(1);
-               }
-               /* convert to GMT assuming local time */
-               if (uflag==0) {
-                       timbuf += (long)info.timezone*60;
-                       /* now fix up local daylight time */
-                       if(localtime(&timbuf)->tm_isdst)
-                               timbuf -= 60*60;
-               }
-               time(&wtmp[0].ut_time);
-               if(stime(&timbuf) < 0) {
-                       rc++;
-                       printf("date: no permission\n");
-               } else if ((wf = open("/usr/adm/wtmp", 1)) >= 0) {
-                       time(&wtmp[1].ut_time);
-                       lseek(wf, 0L, 2);
-                       write(wf, (char *)wtmp, sizeof(wtmp));
-                       close(wf);
-               }
-       }
-       if (rc==0)
-               time(&timbuf);
-       if(uflag) {
-               ap = asctime(gmtime(&timbuf));
-               tzn = "GMT";
-       } else {
-               struct tm *tp;
-               tp = localtime(&timbuf);
-               ap = asctime(tp);
-               tzn = timezone(info.timezone, tp->tm_isdst);
-       }
-       printf("%.20s", ap);
-       if (tzn)
-               printf("%s", tzn);
-       printf("%s", ap+19);
-       exit(rc);
-}
-
-gtime()
-{
-       register int i, year, month;
-       int day, hour, mins, secs;
-       struct tm *L;
-       char x;
-
-       ep=ap;
-       while(*ep) ep++;
-       sp=ap;
-       while(sp<ep) {
-               x = *sp;
-               *sp++ = *--ep;
-               *ep = x;
-       }
-       sp=ap;
-       time(&timbuf);
-       L=localtime(&timbuf);
-       secs = gp(-1);
-       if(*sp!='.') {
-               mins=secs;
-               secs=0;
-       } else {sp++;
-               mins = gp(-1);
-       }
-       hour = gp(-1);
-       day = gp(L->tm_mday);
-       month = gp(L->tm_mon+1);
-       year = gp(L->tm_year);
-       if(*sp)
-               return(1);
-       if( month<1 || month>12 ||
-           day<1 || day>31 ||
-           mins<0 || mins>59 ||
-           secs<0 || secs>59)
-               return(1);
-       if (hour==24) {
-               hour=0; day++;
-       }
-       if (hour<0 || hour>23)
-               return(1);
-       timbuf = 0;
-       year += 1900;
-       for(i=1970; i<year; i++)
-               timbuf += dysize(i);
-       /* Leap year */
-       if (dysize(year)==366 && month >= 3)
-               timbuf++;
-       while(--month)
-               timbuf += dmsize[month-1];
-       timbuf += day-1;
-       timbuf = 24*timbuf + hour;
-       timbuf = 60*timbuf + mins;
-       timbuf = 60*timbuf + secs;
-       return(0);
-
-}
-
-gp(dfault)
-{
-       register int c, d;
-
-       if(*sp==0)
-               return(dfault);
-       c = (*sp++)-'0';
-       d = (*sp ? (*sp++)-'0' : 0);
-       if(c<0 || c>9 || d<0 || d>9)
-               return(-1);
-       return(c+10*d);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/dc/dc.c b/.ref-Research-V7/usr/src/cmd/dc/dc.c
deleted file mode 100644 (file)
index 7b3078e..0000000
+++ /dev/null
@@ -1,1941 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-#include "dc.h"
-main(argc,argv)
-int argc;
-char *argv[];
-{
-       init(argc,argv);
-       commnds();
-}
-commnds(){
-       register int c;
-       register struct blk *p,*q;
-       long l;
-       int sign;
-       struct blk **ptr,*s,*t;
-       struct sym *sp;
-       int sk,sk1,sk2;
-       int n,d;
-
-       while(1){
-               if(((c = readc())>='0' && c <= '9')|| (c>='A' && c <='F') || c == '.'){
-                       unreadc(c);
-                       p = readin();
-                       pushp(p);
-                       continue;
-               }
-               switch(c){
-               case ' ':
-               case '\n':
-               case 0377:
-               case EOF:
-                       continue;
-               case 'Y':
-                       sdump("stk",*stkptr);
-                       printf("all %ld rel %ld headmor %ld\n",all,rel,headmor);
-                       printf("nbytes %ld\n",nbytes);
-                       continue;
-               case '_':
-                       p = readin();
-                       savk = sunputc(p);
-                       chsign(p);
-                       sputc(p,savk);
-                       pushp(p);
-                       continue;
-               case '-':
-                       subt();
-                       continue;
-               case '+':
-                       if(eqk() != 0)continue;
-                       binop('+');
-                       continue;
-               case '*':
-                       arg1 = pop();
-                       EMPTY;
-                       arg2 = pop();
-                       EMPTYR(arg1);
-                       sk1 = sunputc(arg1);
-                       sk2 = sunputc(arg2);
-                       binop('*');
-                       p = pop();
-                       sunputc(p);
-                       savk = sk1+sk2;
-                       if(savk>k && savk>sk1 && savk>sk2){
-                               sk = sk1;
-                               if(sk<sk2)sk = sk2;
-                               if(sk<k)sk = k;
-                               p = removc(p,savk-sk);
-                               savk = sk;
-                       }
-                       sputc(p,savk);
-                       pushp(p);
-                       continue;
-               case '/':
-casediv:
-                       if(dscale() != 0)continue;
-                       binop('/');
-                       if(irem != 0)release(irem);
-                       release(rem);
-                       continue;
-               case '%':
-                       if(dscale() != 0)continue;
-                       binop('/');
-                       p = pop();
-                       release(p);
-                       if(irem == 0){
-                               sputc(rem,skr+k);
-                               pushp(rem);
-                               continue;
-                       }
-                       p = add0(rem,skd-(skr+k));
-                       q = add(p,irem);
-                       release(p);
-                       release(irem);
-                       sputc(q,skd);
-                       pushp(q);
-                       continue;
-               case 'v':
-                       p = pop();
-                       EMPTY;
-                       savk = sunputc(p);
-                       if(length(p) == 0){
-                               sputc(p,savk);
-                               pushp(p);
-                               continue;
-                       }
-                       if((c = sbackc(p))<0){
-                               error("sqrt of neg number\n");
-                       }
-                       if(k<savk)n = savk;
-                       else{
-                               n = k*2-savk;
-                               savk = k;
-                       }
-                       arg1 = add0(p,n);
-                       arg2 = sqrt(arg1);
-                       sputc(arg2,savk);
-                       pushp(arg2);
-                       continue;
-               case '^':
-                       neg = 0;
-                       arg1 = pop();
-                       EMPTY;
-                       if(sunputc(arg1) != 0)error("exp not an integer\n");
-                       arg2 = pop();
-                       EMPTYR(arg1);
-                       if(sfbeg(arg1) == 0 && sbackc(arg1)<0){
-                               neg++;
-                               chsign(arg1);
-                       }
-                       if(length(arg1)>=3){
-                               error("exp too big\n");
-                       }
-                       savk = sunputc(arg2);
-                       p = exp(arg2,arg1);
-                       release(arg2);
-                       rewind(arg1);
-                       c = sgetc(arg1);
-                       if(sfeof(arg1) == 0)
-                               c = sgetc(arg1)*100 + c;
-                       d = c*savk;
-                       release(arg1);
-                       if(neg == 0){
-                               if(k>=savk)n = k;
-                               else n = savk;
-                               if(n<d){
-                                       q = removc(p,d-n);
-                                       sputc(q,n);
-                                       pushp(q);
-                               }
-                               else {
-                                       sputc(p,d);
-                                       pushp(p);
-                               }
-                       }
-                       else {
-                               sputc(p,d);
-                               pushp(p);
-                       }
-                       if(neg == 0)continue;
-                       p = pop();
-                       q = salloc(2);
-                       sputc(q,1);
-                       sputc(q,0);
-                       pushp(q);
-                       pushp(p);
-                       goto casediv;
-               case 'z':
-                       p = salloc(2);
-                       n = stkptr - stkbeg;
-                       if(n >= 100){
-                               sputc(p,n/100);
-                               n %= 100;
-                       }
-                       sputc(p,n);
-                       sputc(p,0);
-                       pushp(p);
-                       continue;
-               case 'Z':
-                       p = pop();
-                       EMPTY;
-                       n = (length(p)-1)<<1;
-                       fsfile(p);
-                       sbackc(p);
-                       if(sfbeg(p) == 0){
-                               if((c = sbackc(p))<0){
-                                       n -= 2;
-                                       if(sfbeg(p) == 1)n += 1;
-                                       else {
-                                               if((c = sbackc(p)) == 0)n += 1;
-                                               else if(c > 90)n -= 1;
-                                       }
-                               }
-                               else if(c < 10) n -= 1;
-                       }
-                       release(p);
-                       q = salloc(1);
-                       if(n >= 100){
-                               sputc(q,n%100);
-                               n /= 100;
-                       }
-                       sputc(q,n);
-                       sputc(q,0);
-                       pushp(q);
-                       continue;
-               case 'i':
-                       p = pop();
-                       EMPTY;
-                       p = scalint(p);
-                       release(inbas);
-                       inbas = p;
-                       continue;
-               case 'I':
-                       p = copy(inbas,length(inbas)+1);
-                       sputc(p,0);
-                       pushp(p);
-                       continue;
-               case 'o':
-                       p = pop();
-                       EMPTY;
-                       p = scalint(p);
-                       sign = 0;
-                       n = length(p);
-                       q = copy(p,n);
-                       fsfile(q);
-                       l = c = sbackc(q);
-                       if(n != 1){
-                               if(c<0){
-                                       sign = 1;
-                                       chsign(q);
-                                       n = length(q);
-                                       fsfile(q);
-                                       l = c = sbackc(q);
-                               }
-                               if(n != 1){
-                                       while(sfbeg(q) == 0)l = l*100+sbackc(q);
-                               }
-                       }
-                       logo = log2(l);
-                       obase = l;
-                       release(basptr);
-                       if(sign == 1)obase = -l;
-                       basptr = p;
-                       outdit = bigot;
-                       if(n == 1 && sign == 0){
-                               if(c <= 16){
-                                       outdit = hexot;
-                                       fw = 1;
-                                       fw1 = 0;
-                                       ll = 70;
-                                       release(q);
-                                       continue;
-                               }
-                       }
-                       n = 0;
-                       if(sign == 1)n++;
-                       p = salloc(1);
-                       sputc(p,-1);
-                       t = add(p,q);
-                       n += length(t)*2;
-                       fsfile(t);
-                       if((c = sbackc(t))>9)n++;
-                       release(t);
-                       release(q);
-                       release(p);
-                       fw = n;
-                       fw1 = n-1;
-                       ll = 70;
-                       if(fw>=ll)continue;
-                       ll = (70/fw)*fw;
-                       continue;
-               case 'O':
-                       p = copy(basptr,length(basptr)+1);
-                       sputc(p,0);
-                       pushp(p);
-                       continue;
-               case '[':
-                       n = 0;
-                       p = salloc(0);
-                       while(1){
-                               if((c = readc()) == ']'){
-                                       if(n == 0)break;
-                                       n--;
-                               }
-                               sputc(p,c);
-                               if(c == '[')n++;
-                       }
-                       pushp(p);
-                       continue;
-               case 'k':
-                       p = pop();
-                       EMPTY;
-                       p = scalint(p);
-                       if(length(p)>1){
-                               error("scale too big\n");
-                       }
-                       rewind(p);
-                       k = sfeof(p)?0:sgetc(p);
-                       release(scalptr);
-                       scalptr = p;
-                       continue;
-               case 'K':
-                       p = copy(scalptr,length(scalptr)+1);
-                       sputc(p,0);
-                       pushp(p);
-                       continue;
-               case 'X':
-                       p = pop();
-                       EMPTY;
-                       fsfile(p);
-                       n = sbackc(p);
-                       release(p);
-                       p = salloc(2);
-                       sputc(p,n);
-                       sputc(p,0);
-                       pushp(p);
-                       continue;
-               case 'Q':
-                       p = pop();
-                       EMPTY;
-                       if(length(p)>2){
-                               error("Q?\n");
-                       }
-                       rewind(p);
-                       if((c =  sgetc(p))<0){
-                               error("neg Q\n");
-                       }
-                       release(p);
-                       while(c-- > 0){
-                               if(readptr == &readstk[0]){
-                                       error("readstk?\n");
-                               }
-                               if(*readptr != 0)release(*readptr);
-                               readptr--;
-                       }
-                       continue;
-               case 'q':
-                       if(readptr <= &readstk[1])exit(0);
-                       if(*readptr != 0)release(*readptr);
-                       readptr--;
-                       if(*readptr != 0)release(*readptr);
-                       readptr--;
-                       continue;
-               case 'f':
-                       if(stkptr == &stack[0])printf("empty stack\n");
-                       else {
-                               for(ptr = stkptr; ptr > &stack[0];){
-                                       print(*ptr--);
-                               }
-                       }
-                       continue;
-               case 'p':
-                       if(stkptr == &stack[0])printf("empty stack\n");
-                       else{
-                               print(*stkptr);
-                       }
-                       continue;
-               case 'P':
-                       p = pop();
-                       EMPTY;
-                       sputc(p,0);
-                       printf("%s",p->beg);
-                       release(p);
-                       continue;
-               case 'd':
-                       if(stkptr == &stack[0]){
-                               printf("empty stack\n");
-                               continue;
-                       }
-                       q = *stkptr;
-                       n = length(q);
-                       p = copy(*stkptr,n);
-                       pushp(p);
-                       continue;
-               case 'c':
-                       while(stkerr == 0){
-                               p = pop();
-                               if(stkerr == 0)release(p);
-                       }
-                       continue;
-               case 'S':
-                       if(stkptr == &stack[0]){
-                               error("save: args\n");
-                       }
-                       c = readc() & 0377;
-                       sptr = stable[c];
-                       sp = stable[c] = sfree;
-                       sfree = sfree->next;
-                       if(sfree == 0)goto sempty;
-                       sp->next = sptr;
-                       p = pop();
-                       EMPTY;
-                       if(c >= ARRAYST){
-                               q = copy(p,PTRSZ);
-                               for(n = 0;n < PTRSZ-1;n++)sputc(q,0);
-                               release(p);
-                               p = q;
-                       }
-                       sp->val = p;
-                       continue;
-sempty:
-                       error("symbol table overflow\n");
-               case 's':
-                       if(stkptr == &stack[0]){
-                               error("save:args\n");
-                       }
-                       c = readc() & 0377;
-                       sptr = stable[c];
-                       if(sptr != 0){
-                               p = sptr->val;
-                               if(c >= ARRAYST){
-                                       rewind(p);
-                                       while(sfeof(p) == 0)release(getwd(p));
-                               }
-                               release(p);
-                       }
-                       else{
-                               sptr = stable[c] = sfree;
-                               sfree = sfree->next;
-                               if(sfree == 0)goto sempty;
-                               sptr->next = 0;
-                       }
-                       p = pop();
-                       sptr->val = p;
-                       continue;
-               case 'l':
-                       load();
-                       continue;
-               case 'L':
-                       c = readc() & 0377;
-                       sptr = stable[c];
-                       if(sptr == 0){
-                               error("L?\n");
-                       }
-                       stable[c] = sptr->next;
-                       sptr->next = sfree;
-                       sfree = sptr;
-                       p = sptr->val;
-                       if(c >= ARRAYST){
-                               rewind(p);
-                               while(sfeof(p) == 0){
-                                       q = getwd(p);
-                                       if(q != 0)release(q);
-                               }
-                       }
-                       pushp(p);
-                       continue;
-               case ':':
-                       p = pop();
-                       EMPTY;
-                       q = scalint(p);
-                       fsfile(q);
-                       c = 0;
-                       if((sfbeg(q) == 0) && ((c = sbackc(q))<0)){
-                               error("neg index\n");
-                       }
-                       if(length(q)>2){
-                               error("index too big\n");
-                       }
-                       if(sfbeg(q) == 0)c = c*100+sbackc(q);
-                       if(c >= MAXIND){
-                               error("index too big\n");
-                       }
-                       release(q);
-                       n = readc() & 0377;
-                       sptr = stable[n];
-                       if(sptr == 0){
-                               sptr = stable[n] = sfree;
-                               sfree = sfree->next;
-                               if(sfree == 0)goto sempty;
-                               sptr->next = 0;
-                               p = salloc((c+PTRSZ)*PTRSZ);
-                               zero(p);
-                       }
-                       else{
-                               p = sptr->val;
-                               if(length(p)-PTRSZ < c*PTRSZ){
-                                       q = copy(p,(c+PTRSZ)*PTRSZ);
-                                       release(p);
-                                       p = q;
-                               }
-                       }
-                       seekc(p,c*PTRSZ);
-                       q = lookwd(p);
-                       if (q!=NULL) release(q);
-                       s = pop();
-                       EMPTY;
-                       salterwd(p,s);
-                       sptr->val = p;
-                       continue;
-               case ';':
-                       p = pop();
-                       EMPTY;
-                       q = scalint(p);
-                       fsfile(q);
-                       c = 0;
-                       if((sfbeg(q) == 0) && ((c = sbackc(q))<0)){
-                               error("neg index\n");
-                       }
-                       if(length(q)>2){
-                               error("index too big\n");
-                       }
-                       if(sfbeg(q) == 0)c = c*100+sbackc(q);
-                       if(c >= MAXIND){
-                               error("index too big\n");
-                       }
-                       release(q);
-                       n = readc() & 0377;
-                       sptr = stable[n];
-                       if(sptr != 0){
-                               p = sptr->val;
-                               if(length(p)-PTRSZ >= c*PTRSZ){
-                                       seekc(p,c*PTRSZ);
-                                       s = getwd(p);
-                                       if(s != 0){
-                                               q = copy(s,length(s));
-                                               pushp(q);
-                                               continue;
-                                       }
-                               }
-                       }
-                       q = salloc(PTRSZ);
-                       putwd(q, (struct blk *)0);
-                       pushp(q);
-                       continue;
-               case 'x':
-execute:
-                       p = pop();
-                       EMPTY;
-                       if((readptr != &readstk[0]) && (*readptr != 0)){
-                               if((*readptr)->rd == (*readptr)->wt)
-                                       release(*readptr);
-                               else{
-                                       if(readptr++ == &readstk[RDSKSZ]){
-                                               error("nesting depth\n");
-                                       }
-                               }
-                       }
-                       else readptr++;
-                       *readptr = p;
-                       if(p != 0)rewind(p);
-                       else{
-                               if((c = readc()) != '\n')unreadc(c);
-                       }
-                       continue;
-               case '?':
-                       if(++readptr == &readstk[RDSKSZ]){
-                               error("nesting depth\n");
-                       }
-                       *readptr = 0;
-                       fsave = curfile;
-                       curfile = stdin;
-                       while((c = readc()) == '!')command();
-                       p = salloc(0);
-                       sputc(p,c);
-                       while((c = readc()) != '\n'){
-                               sputc(p,c);
-                               if(c == '\\')sputc(p,readc());
-                       }
-                       curfile = fsave;
-                       *readptr = p;
-                       continue;
-               case '!':
-                       if(command() == 1)goto execute;
-                       continue;
-               case '<':
-               case '>':
-               case '=':
-                       if(cond(c) == 1)goto execute;
-                       continue;
-               default:
-                       printf("%o is unimplemented\n",c);
-               }
-       }
-}
-struct blk *
-div(ddivd,ddivr)
-struct blk *ddivd,*ddivr;
-{
-       int divsign,remsign,offset,divcarry;
-       int carry, dig,magic,d,dd;
-       long c,td,cc;
-       struct blk *ps;
-       register struct blk *p,*divd,*divr;
-
-       rem = 0;
-       p = salloc(0);
-       if(length(ddivr) == 0){
-               pushp(ddivr);
-               errorrt("divide by 0\n");
-       }
-       divsign = remsign = 0;
-       divr = ddivr;
-       fsfile(divr);
-       if(sbackc(divr) == -1){
-               divr = copy(ddivr,length(ddivr));
-               chsign(divr);
-               divsign = ~divsign;
-       }
-       divd = copy(ddivd,length(ddivd));
-       fsfile(divd);
-       if(sfbeg(divd) == 0 && sbackc(divd) == -1){
-               chsign(divd);
-               divsign = ~divsign;
-               remsign = ~remsign;
-       }
-       offset = length(divd) - length(divr);
-       if(offset < 0)goto ddone;
-       seekc(p,offset+1);
-       sputc(divd,0);
-       magic = 0;
-       fsfile(divr);
-       c = sbackc(divr);
-       if(c<10)magic++;
-       c = c*100 + (sfbeg(divr)?0:sbackc(divr));
-       if(magic>0){
-               c = (c*100 +(sfbeg(divr)?0:sbackc(divr)))*2;
-               c /= 25;
-       }
-       while(offset >= 0){
-               fsfile(divd);
-               td = sbackc(divd)*100;
-               dd = sfbeg(divd)?0:sbackc(divd);
-               td = (td+dd)*100;
-               dd = sfbeg(divd)?0:sbackc(divd);
-               td = td+dd;
-               cc = c;
-               if(offset == 0)td += 1;
-               else cc += 1;
-               if(magic != 0)td = td<<3;
-               dig = td/cc;
-               rewind(divr);
-               rewind(divxyz);
-               carry = 0;
-               while(sfeof(divr) == 0){
-                       d = sgetc(divr)*dig+carry;
-                       carry = d / 100;
-                       salterc(divxyz,d%100);
-               }
-               salterc(divxyz,carry);
-               rewind(divxyz);
-               seekc(divd,offset);
-               carry = 0;
-               while(sfeof(divd) == 0){
-                       d = slookc(divd);
-                       d = d-(sfeof(divxyz)?0:sgetc(divxyz))-carry;
-                       carry = 0;
-                       if(d < 0){
-                               d += 100;
-                               carry = 1;
-                       }
-                       salterc(divd,d);
-               }
-               divcarry = carry;
-               sbackc(p);
-               salterc(p,dig);
-               sbackc(p);
-               if(--offset >= 0)divd->wt--;
-       }
-       if(divcarry != 0){
-               salterc(p,dig-1);
-               salterc(divd,-1);
-               ps = add(divr,divd);
-               release(divd);
-               divd = ps;
-       }
-
-       rewind(p);
-       divcarry = 0;
-       while(sfeof(p) == 0){
-               d = slookc(p)+divcarry;
-               divcarry = 0;
-               if(d >= 100){
-                       d -= 100;
-                       divcarry = 1;
-               }
-               salterc(p,d);
-       }
-       if(divcarry != 0)salterc(p,divcarry);
-       fsfile(p);
-       while(sfbeg(p) == 0){
-               if(sbackc(p) == 0)truncate(p);
-               else break;
-       }
-       if(divsign < 0)chsign(p);
-       fsfile(divd);
-       while(sfbeg(divd) == 0){
-               if(sbackc(divd) == 0)truncate(divd);
-               else break;
-       }
-ddone:
-       if(remsign<0)chsign(divd);
-       if(divr != ddivr)release(divr);
-       rem = divd;
-       return(p);
-}
-dscale(){
-       register struct blk *dd,*dr;
-       register struct blk *r;
-       int c;
-
-       dr = pop();
-       EMPTYS;
-       dd = pop();
-       EMPTYSR(dr);
-       fsfile(dd);
-       skd = sunputc(dd);
-       fsfile(dr);
-       skr = sunputc(dr);
-       if(sfbeg(dr) == 1 || (sfbeg(dr) == 0 && sbackc(dr) == 0)){
-               sputc(dr,skr);
-               pushp(dr);
-               errorrt("divide by 0\n");
-       }
-       c = k-skd+skr;
-       if(c < 0)r = removr(dd,-c);
-       else {
-               r = add0(dd,c);
-               irem = 0;
-       }
-       arg1 = r;
-       arg2 = dr;
-       savk = k;
-       return(0);
-}
-struct blk *
-removr(p,n)
-struct blk *p;
-{
-       int nn;
-       register struct blk *q,*s,*r;
-
-       rewind(p);
-       nn = (n+1)/2;
-       q = salloc(nn);
-       while(n>1){
-               sputc(q,sgetc(p));
-               n -= 2;
-       }
-       r = salloc(2);
-       while(sfeof(p) == 0)sputc(r,sgetc(p));
-       release(p);
-       if(n == 1){
-               s = div(r,tenptr);
-               release(r);
-               rewind(rem);
-               if(sfeof(rem) == 0)sputc(q,sgetc(rem));
-               release(rem);
-               irem = q;
-               return(s);
-       }
-       irem = q;
-       return(r);
-}
-struct blk *
-sqrt(p)
-struct blk *p;
-{
-       struct blk *t;
-       struct blk *r,*q,*s;
-       int c,n,nn;
-
-       n = length(p);
-       fsfile(p);
-       c = sbackc(p);
-       if((n&1) != 1)c = c*100+(sfbeg(p)?0:sbackc(p));
-       n = (n+1)>>1;
-       r = salloc(n);
-       zero(r);
-       seekc(r,n);
-       nn=1;
-       while((c -= nn)>=0)nn+=2;
-       c=(nn+1)>>1;
-       fsfile(r);
-       sbackc(r);
-       if(c>=100){
-               c -= 100;
-               salterc(r,c);
-               sputc(r,1);
-       }
-       else salterc(r,c);
-       while(1){
-               q = div(p,r);
-               s = add(q,r);
-               release(q);
-               release(rem);
-               q = div(s,sqtemp);
-               release(s);
-               release(rem);
-               s = copy(r,length(r));
-               chsign(s);
-               t = add(s,q);
-               release(s);
-               fsfile(t);
-               nn = sfbeg(t)?0:sbackc(t);
-               if(nn>=0)break;
-               release(r);
-               release(t);
-               r = q;
-       }
-       release(t);
-       release(q);
-       release(p);
-       return(r);
-}
-struct blk *
-exp(base,ex)
-struct blk *base,*ex;
-{
-       register struct blk *r,*e,*p;
-       struct blk *e1,*t,*cp;
-       int temp,c,n;
-       r = salloc(1);
-       sputc(r,1);
-       p = copy(base,length(base));
-       e = copy(ex,length(ex));
-       fsfile(e);
-       if(sfbeg(e) != 0)goto edone;
-       temp=0;
-       c = sbackc(e);
-       if(c<0){
-               temp++;
-               chsign(e);
-       }
-       while(length(e) != 0){
-               e1=div(e,sqtemp);
-               release(e);
-               e = e1;
-               n = length(rem);
-               release(rem);
-               if(n != 0){
-                       e1=mult(p,r);
-                       release(r);
-                       r = e1;
-               }
-               t = copy(p,length(p));
-               cp = mult(p,t);
-               release(p);
-               release(t);
-               p = cp;
-       }
-       if(temp != 0){
-               if((c = length(base)) == 0){
-                       goto edone;
-               }
-               if(c>1)create(r);
-               else{
-                       rewind(base);
-                       if((c = sgetc(base))<=1){
-                               create(r);
-                               sputc(r,c);
-                       }
-                       else create(r);
-               }
-       }
-edone:
-       release(p);
-       release(e);
-       return(r);
-}
-init(argc,argv)
-int argc;
-char *argv[];
-{
-       register struct sym *sp;
-
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT,onintr);
-       setbuf(stdout,(char *)NULL);
-       svargc = --argc;
-       svargv = argv;
-       while(svargc>0 && svargv[1][0] == '-'){
-               switch(svargv[1][1]){
-               default:
-                       dbg=1;
-               }
-               svargc--;
-               svargv++;
-       }
-       ifile=1;
-       if(svargc<=0)curfile = stdin;
-       else if((curfile = fopen(svargv[1],"r")) == NULL){
-               printf("can't open file %s\n",svargv[1]);
-               exit(1);
-               }
-       dummy = malloc(1);
-       scalptr = salloc(1);
-       sputc(scalptr,0);
-       basptr = salloc(1);
-       sputc(basptr,10);
-       obase=10;
-       log10=log2(10L);
-       ll=70;
-       fw=1;
-       fw1=0;
-       tenptr = salloc(1);
-       sputc(tenptr,10);
-       obase=10;
-       inbas = salloc(1);
-       sputc(inbas,10);
-       sqtemp = salloc(1);
-       sputc(sqtemp,2);
-       chptr = salloc(0);
-       strptr = salloc(0);
-       divxyz = salloc(0);
-       stkbeg = stkptr = &stack[0];
-       stkend = &stack[STKSZ];
-       stkerr = 0;
-       readptr = &readstk[0];
-       k=0;
-       sp = sptr = &symlst[0];
-       while(sptr < &symlst[TBLSZ]){
-               sptr->next = ++sp;
-               sptr++;
-       }
-       sptr->next=0;
-       sfree = &symlst[0];
-       return;
-}
-onintr(){
-
-       signal(SIGINT,onintr);
-       while(readptr != &readstk[0]){
-               if(*readptr != 0){release(*readptr);}
-               readptr--;
-       }
-       curfile = stdin;
-       commnds();
-}
-pushp(p)
-struct blk *p;
-{
-       if(stkptr == stkend){
-               printf("out of stack space\n");
-               return;
-       }
-       stkerr=0;
-       *++stkptr = p;
-       return;
-}
-struct blk *
-pop(){
-       if(stkptr == stack){
-               stkerr=1;
-               return(0);
-       }
-       return(*stkptr--);
-}
-struct blk *
-readin(){
-       register struct blk *p,*q;
-       int dp,dpct;
-       register int c;
-
-       dp = dpct=0;
-       p = salloc(0);
-       while(1){
-               c = readc();
-               switch(c){
-               case '.':
-                       if(dp != 0){
-                               unreadc(c);
-                               break;
-                       }
-                       dp++;
-                       continue;
-               case '\\':
-                       readc();
-                       continue;
-               default:
-                       if(c >= 'A' && c <= 'F')c = c - 'A' + 10;
-                       else if(c >= '0' && c <= '9')c -= '0';
-                       else goto gotnum;
-                       if(dp != 0){
-                               if(dpct >= 99)continue;
-                               dpct++;
-                       }
-                       create(chptr);
-                       if(c != 0)sputc(chptr,c);
-                       q = mult(p,inbas);
-                       release(p);
-                       p = add(chptr,q);
-                       release(q);
-               }
-       }
-gotnum:
-       unreadc(c);
-       if(dp == 0){
-               sputc(p,0);
-               return(p);
-       }
-       else{
-               q = scale(p,dpct);
-               return(q);
-       }
-}
-struct blk *
-add0(p,ct)
-int ct;
-struct blk *p;
-{
-               /* returns pointer to struct with ct 0's & p */
-       register struct blk *q,*t;
-
-       q = salloc(length(p)+(ct+1)/2);
-       while(ct>1){
-               sputc(q,0);
-               ct -= 2;
-       }
-       rewind(p);
-       while(sfeof(p) == 0){
-               sputc(q,sgetc(p));
-       }
-       release(p);
-       if(ct == 1){
-               t = mult(tenptr,q);
-               release(q);
-               return(t);
-       }
-       return(q);
-}
-struct blk *
-mult(p,q)
-struct blk *p,*q;
-{
-       register struct blk *mp,*mq,*mr;
-       int sign,offset,carry;
-       int cq,cp,mt,mcr;
-
-       offset = sign = 0;
-       fsfile(p);
-       mp = p;
-       if(sfbeg(p) == 0){
-               if(sbackc(p)<0){
-                       mp = copy(p,length(p));
-                       chsign(mp);
-                       sign = ~sign;
-               }
-       }
-       fsfile(q);
-       mq = q;
-       if(sfbeg(q) == 0){
-               if(sbackc(q)<0){
-                       mq = copy(q,length(q));
-                       chsign(mq);
-                       sign = ~sign;
-               }
-       }
-       mr = salloc(length(mp)+length(mq));
-       zero(mr);
-       rewind(mq);
-       while(sfeof(mq) == 0){
-               cq = sgetc(mq);
-               rewind(mp);
-               rewind(mr);
-               mr->rd += offset;
-               carry=0;
-               while(sfeof(mp) == 0){
-                       cp = sgetc(mp);
-                       mcr = sfeof(mr)?0:slookc(mr);
-                       mt = cp*cq + carry + mcr;
-                       carry = mt/100;
-                       salterc(mr,mt%100);
-               }
-               offset++;
-               if(carry != 0){
-                       mcr = sfeof(mr)?0:slookc(mr);
-                       salterc(mr,mcr+carry);
-               }
-       }
-       if(sign < 0){
-               chsign(mr);
-       }
-       if(mp != p)release(mp);
-       if(mq != q)release(mq);
-       return(mr);
-}
-chsign(p)
-struct blk *p;
-{
-       register int carry;
-       register char ct;
-
-       carry=0;
-       rewind(p);
-       while(sfeof(p) == 0){
-               ct=100-slookc(p)-carry;
-               carry=1;
-               if(ct>=100){
-                       ct -= 100;
-                       carry=0;
-               }
-               salterc(p,ct);
-       }
-       if(carry != 0){
-               sputc(p,-1);
-               fsfile(p);
-               sbackc(p);
-               ct = sbackc(p);
-               if(ct == 99){
-                       truncate(p);
-                       sputc(p,-1);
-               }
-       }
-       else{
-               fsfile(p);
-               ct = sbackc(p);
-               if(ct == 0)truncate(p);
-       }
-       return;
-}
-readc(){
-loop:
-       if((readptr != &readstk[0]) && (*readptr != 0)){
-               if(sfeof(*readptr) == 0)return(lastchar = sgetc(*readptr));
-               release(*readptr);
-               readptr--;
-               goto loop;
-       }
-       lastchar = getc(curfile);
-       if(lastchar != EOF)return(lastchar);
-       if(readptr != &readptr[0]){
-               readptr--;
-               if(*readptr == 0)curfile = stdin;
-               goto loop;
-       }
-       if(curfile != stdin){
-               fclose(curfile);
-               curfile = stdin;
-               goto loop;
-       }
-       exit(0);
-}
-unreadc(c)
-char c;
-{
-
-       if((readptr != &readstk[0]) && (*readptr != 0)){
-               sungetc(*readptr,c);
-       }
-       else ungetc(c,curfile);
-       return;
-}
-binop(c)
-char c;
-{
-       register struct blk *r;
-
-       switch(c){
-       case '+':
-               r = add(arg1,arg2);
-               break;
-       case '*':
-               r = mult(arg1,arg2);
-               break;
-       case '/':
-               r = div(arg1,arg2);
-               break;
-       }
-       release(arg1);
-       release(arg2);
-       sputc(r,savk);
-       pushp(r);
-       return;
-}
-print(hptr)
-struct blk *hptr;
-{
-       int sc;
-       register struct blk *p,*q,*dec;
-       int dig,dout,ct;
-
-       rewind(hptr);
-       while(sfeof(hptr) == 0){
-               if(sgetc(hptr)>99){
-                       rewind(hptr);
-                       while(sfeof(hptr) == 0){
-                               printf("%c",sgetc(hptr));
-                       }
-                       printf("\n");
-                       return;
-               }
-       }
-       fsfile(hptr);
-       sc = sbackc(hptr);
-       if(sfbeg(hptr) != 0){
-               printf("0\n");
-               return;
-       }
-       count = ll;
-       p = copy(hptr,length(hptr));
-       sunputc(p);
-       fsfile(p);
-       if(sbackc(p)<0){
-               chsign(p);
-               OUTC('-');
-       }
-       if((obase == 0) || (obase == -1)){
-               oneot(p,sc,'d');
-               return;
-       }
-       if(obase == 1){
-               oneot(p,sc,'1');
-               return;
-       }
-       if(obase == 10){
-               tenot(p,sc);
-               return;
-       }
-       create(strptr);
-       dig = log10*sc;
-       dout = ((dig/10) + dig) /logo;
-       dec = getdec(p,sc);
-       p = removc(p,sc);
-       while(length(p) != 0){
-               q = div(p,basptr);
-               release(p);
-               p = q;
-               (*outdit)(rem,0);
-       }
-       release(p);
-       fsfile(strptr);
-       while(sfbeg(strptr) == 0)OUTC(sbackc(strptr));
-       if(sc == 0){
-               release(dec);
-               printf("\n");
-               return;
-       }
-       create(strptr);
-       OUTC('.');
-       ct=0;
-       do{
-               q = mult(basptr,dec);
-               release(dec);
-               dec = getdec(q,sc);
-               p = removc(q,sc);
-               (*outdit)(p,1);
-       }while(++ct < dout);
-       release(dec);
-       rewind(strptr);
-       while(sfeof(strptr) == 0)OUTC(sgetc(strptr));
-       printf("\n");
-       return;
-}
-
-struct blk *
-getdec(p,sc)
-struct blk *p;
-{
-       int cc;
-       register struct blk *q,*t,*s;
-
-       rewind(p);
-       if(length(p)*2 < sc){
-               q = copy(p,length(p));
-               return(q);
-       }
-       q = salloc(length(p));
-       while(sc >= 1){
-               sputc(q,sgetc(p));
-               sc -= 2;
-       }
-       if(sc != 0){
-               t = mult(q,tenptr);
-               s = salloc(cc = length(q));
-               release(q);
-               rewind(t);
-               while(cc-- > 0)sputc(s,sgetc(t));
-               sputc(s,0);
-               release(t);
-               t = div(s,tenptr);
-               release(s);
-               release(rem);
-               return(t);
-       }
-       return(q);
-}
-tenot(p,sc)
-struct blk *p;
-{
-       register int c,f;
-
-       fsfile(p);
-       f=0;
-       while((sfbeg(p) == 0) && ((p->rd-p->beg-1)*2 >= sc)){
-               c = sbackc(p);
-               if((c<10) && (f == 1))printf("0%d",c);
-               else printf("%d",c);
-               f=1;
-               TEST2;
-       }
-       if(sc == 0){
-               printf("\n");
-               release(p);
-               return;
-       }
-       if((p->rd-p->beg)*2 > sc){
-               c = sbackc(p);
-               printf("%d.",c/10);
-               TEST2;
-               OUTC(c%10 +'0');
-               sc--;
-       }
-       else {
-               OUTC('.');
-       }
-       if(sc > (p->rd-p->beg)*2){
-               while(sc>(p->rd-p->beg)*2){
-                       OUTC('0');
-                       sc--;
-               }
-       }
-       while(sc > 1){
-               c = sbackc(p);
-               if(c<10)printf("0%d",c);
-               else printf("%d",c);
-               sc -= 2;
-               TEST2;
-       }
-       if(sc == 1){
-               OUTC(sbackc(p)/10 +'0');
-       }
-       printf("\n");
-       release(p);
-       return;
-}
-oneot(p,sc,ch)
-struct blk *p;
-char ch;
-{
-       register struct blk *q;
-
-       q = removc(p,sc);
-       create(strptr);
-       sputc(strptr,-1);
-       while(length(q)>0){
-               p = add(strptr,q);
-               release(q);
-               q = p;
-               OUTC(ch);
-       }
-       release(q);
-       printf("\n");
-       return;
-}
-hexot(p,flg)
-struct blk *p;
-{
-       register int c;
-       rewind(p);
-       if(sfeof(p) != 0){
-               sputc(strptr,'0');
-               release(p);
-               return;
-       }
-       c = sgetc(p);
-       release(p);
-       if(c >= 16){
-               printf("hex digit > 16");
-               return;
-       }
-       sputc(strptr,c<10?c+'0':c-10+'A');
-       return;
-}
-bigot(p,flg)
-struct blk *p;
-{
-       register struct blk *t,*q;
-       register int l;
-       int neg;
-
-       if(flg == 1)t = salloc(0);
-       else{
-               t = strptr;
-               l = length(strptr)+fw-1;
-       }
-       neg=0;
-       if(length(p) != 0){
-               fsfile(p);
-               if(sbackc(p)<0){
-                       neg=1;
-                       chsign(p);
-               }
-               while(length(p) != 0){
-                       q = div(p,tenptr);
-                       release(p);
-                       p = q;
-                       rewind(rem);
-                       sputc(t,sfeof(rem)?'0':sgetc(rem)+'0');
-                       release(rem);
-               }
-       }
-       release(p);
-       if(flg == 1){
-               l = fw1-length(t);
-               if(neg != 0){
-                       l--;
-                       sputc(strptr,'-');
-               }
-               fsfile(t);
-               while(l-- > 0)sputc(strptr,'0');
-               while(sfbeg(t) == 0)sputc(strptr,sbackc(t));
-               release(t);
-       }
-       else{
-               l -= length(strptr);
-               while(l-- > 0)sputc(strptr,'0');
-               if(neg != 0){
-                       sunputc(strptr);
-                       sputc(strptr,'-');
-               }
-       }
-       sputc(strptr,' ');
-       return;
-}
-struct blk *
-add(a1,a2)
-struct blk *a1,*a2;
-{
-       register struct blk *p;
-       register int carry,n;
-       int size;
-       int c,n1,n2;
-
-       size = length(a1)>length(a2)?length(a1):length(a2);
-       p = salloc(size);
-       rewind(a1);
-       rewind(a2);
-       carry=0;
-       while(--size >= 0){
-               n1 = sfeof(a1)?0:sgetc(a1);
-               n2 = sfeof(a2)?0:sgetc(a2);
-               n = n1 + n2 + carry;
-               if(n>=100){
-                       carry=1;
-                       n -= 100;
-               }
-               else if(n<0){
-                       carry = -1;
-                       n += 100;
-               }
-               else carry = 0;
-               sputc(p,n);
-       }
-       if(carry != 0)sputc(p,carry);
-       fsfile(p);
-       if(sfbeg(p) == 0){
-               while(sfbeg(p) == 0 && (c = sbackc(p)) == 0);
-               if(c != 0)salterc(p,c);
-               truncate(p);
-       }
-       fsfile(p);
-       if(sfbeg(p) == 0 && sbackc(p) == -1){
-               while((c = sbackc(p)) == 99){
-                       if(c == EOF)break;
-               }
-               sgetc(p);
-               salterc(p,-1);
-               truncate(p);
-       }
-       return(p);
-}
-eqk(){
-       register struct blk *p,*q;
-       register int skp;
-       int skq;
-
-       p = pop();
-       EMPTYS;
-       q = pop();
-       EMPTYSR(p);
-       skp = sunputc(p);
-       skq = sunputc(q);
-       if(skp == skq){
-               arg1=p;
-               arg2=q;
-               savk = skp;
-               return(0);
-       }
-       else if(skp < skq){
-               savk = skq;
-               p = add0(p,skq-skp);
-       }
-       else {
-               savk = skp;
-               q = add0(q,skp-skq);
-       }
-       arg1=p;
-       arg2=q;
-       return(0);
-}
-struct blk *
-removc(p,n)
-struct blk *p;
-{
-       register struct blk *q,*r;
-
-       rewind(p);
-       while(n>1){
-               sgetc(p);
-               n -= 2;
-       }
-       q = salloc(2);
-       while(sfeof(p) == 0)sputc(q,sgetc(p));
-       if(n == 1){
-               r = div(q,tenptr);
-               release(q);
-               release(rem);
-               q = r;
-       }
-       release(p);
-       return(q);
-}
-struct blk *
-scalint(p)
-struct blk *p;
-{
-       register int n;
-       n = sunputc(p);
-       p = removc(p,n);
-       return(p);
-}
-struct blk *
-scale(p,n)
-struct blk *p;
-{
-       register struct blk *q,*s,*t;
-
-       t = add0(p,n);
-       q = salloc(1);
-       sputc(q,n);
-       s = exp(inbas,q);
-       release(q);
-       q = div(t,s);
-       release(t);
-       release(s);
-       release(rem);
-       sputc(q,n);
-       return(q);
-}
-subt(){
-       arg1=pop();
-       EMPTYS;
-       savk = sunputc(arg1);
-       chsign(arg1);
-       sputc(arg1,savk);
-       pushp(arg1);
-       if(eqk() != 0)return(1);
-       binop('+');
-       return(0);
-}
-command(){
-       int c;
-       char line[100],*sl;
-       register (*savint)(),pid,rpid;
-       int retcode;
-
-       switch(c = readc()){
-       case '<':
-               return(cond(NL));
-       case '>':
-               return(cond(NG));
-       case '=':
-               return(cond(NE));
-       default:
-               sl = line;
-               *sl++ = c;
-               while((c = readc()) != '\n')*sl++ = c;
-               *sl = 0;
-               if((pid = fork()) == 0){
-                       execl("/bin/sh","sh","-c",line,0);
-                       exit(0100);
-               }
-               savint = signal(SIGINT, SIG_IGN);
-               while((rpid = wait(&retcode)) != pid && rpid != -1);
-               signal(SIGINT,savint);
-               printf("!\n");
-               return(0);
-       }
-}
-cond(c)
-char c;
-{
-       register struct blk *p;
-       register char cc;
-
-       if(subt() != 0)return(1);
-       p = pop();
-       sunputc(p);
-       if(length(p) == 0){
-               release(p);
-               if(c == '<' || c == '>' || c == NE){
-                       readc();
-                       return(0);
-               }
-               load();
-               return(1);
-       }
-       else {
-               if(c == '='){
-                       release(p);
-                       readc();
-                       return(0);
-               }
-       }
-       if(c == NE){
-               release(p);
-               load();
-               return(1);
-       }
-       fsfile(p);
-       cc = sbackc(p);
-       release(p);
-       if((cc<0 && (c == '<' || c == NG)) ||
-               (cc >0) && (c == '>' || c == NL)){
-               readc();
-               return(0);
-       }
-       load();
-       return(1);
-}
-load(){
-       register int c;
-       register struct blk *p,*q;
-       struct blk *t,*s;
-       c = readc() & 0377;
-       sptr = stable[c];
-       if(sptr != 0){
-               p = sptr->val;
-               if(c >= ARRAYST){
-                       q = salloc(length(p));
-                       rewind(p);
-                       while(sfeof(p) == 0){
-                               s = getwd(p);
-                               if(s == 0){putwd(q, (struct blk *)NULL);}
-                               else{
-                                       t = copy(s,length(s));
-                                       putwd(q,t);
-                               }
-                       }
-                       pushp(q);
-               }
-               else{
-                       q = copy(p,length(p));
-                       pushp(q);
-               }
-       }
-       else{
-               q = salloc(1);
-               sputc(q,0);
-               pushp(q);
-       }
-       return;
-}
-log2(n)
-long n;
-{
-       register int i;
-
-       if(n == 0)return(0);
-       i=31;
-       if(n<0)return(i);
-       while((n= n<<1) >0)i--;
-       return(--i);
-}
-
-struct blk *
-salloc(size)
-int size;
-{
-       register struct blk *hdr;
-       register char *ptr;
-       all++;
-       nbytes += size;
-       ptr = malloc((unsigned)size);
-       if(ptr == 0){
-               garbage("salloc");
-               if((ptr = malloc((unsigned)size)) == 0)
-                       ospace("salloc");
-       }
-       if((hdr = hfree) == 0)hdr = morehd();
-       hfree = (struct blk *)hdr->rd;
-       hdr->rd = hdr->wt = hdr->beg = ptr;
-       hdr->last = ptr+size;
-       return(hdr);
-}
-struct blk *
-morehd(){
-       register struct blk *h,*kk;
-       headmor++;
-       nbytes += HEADSZ;
-       hfree = h = (struct blk *)malloc(HEADSZ);
-       if(hfree == 0){
-               garbage("morehd");
-               if((hfree = h = (struct blk *)malloc(HEADSZ)) == 0)
-                       ospace("headers");
-       }
-       kk = h;
-       while(h<hfree+(HEADSZ/BLK))(h++)->rd = (char *)++kk;
-       (--h)->rd=0;
-       return(hfree);
-}
-/*
-sunputc(hptr)
-struct blk *hptr;
-{
-       hptr->wt--;
-       hptr->rd = hptr->wt;
-       return(*hptr->wt);
-}
-*/
-struct blk *
-copy(hptr,size)
-struct blk *hptr;
-int size;
-{
-       register struct blk *hdr;
-       register unsigned sz;
-       register char *ptr;
-
-       all++;
-       nbytes += size;
-       sz = length(hptr);
-       ptr = nalloc(hptr->beg, (unsigned)size);
-       if(ptr == 0){
-               garbage("copy");
-               if((ptr = nalloc(hptr->beg, (unsigned)size)) == NULL){
-                       printf("copy size %d\n",size);
-                       ospace("copy");
-               }
-       }
-       if((hdr = hfree) == 0)hdr = morehd();
-       hfree = (struct blk *)hdr->rd;
-       hdr->rd = hdr->beg = ptr;
-       hdr->last = ptr+size;
-       hdr->wt = ptr+sz;
-       ptr = hdr->wt;
-       while(ptr<hdr->last)*ptr++ = '\0';
-       return(hdr);
-}
-sdump(s1,hptr)
-char *s1;
-struct blk *hptr;
-{
-       char *p;
-       printf("%s %o rd %o wt %o beg %o last %o\n",s1,hptr,hptr->rd,hptr->wt,hptr->beg,hptr->last);
-       p = hptr->beg;
-       while(p < hptr->wt)printf("%d ",*p++);
-       printf("\n");
-}
-seekc(hptr,n)
-struct blk *hptr;
-{
-       register char *nn,*p;
-
-       nn = hptr->beg+n;
-       if(nn > hptr->last){
-               nbytes += nn - hptr->last;
-               free(hptr->beg);
-               p = realloc(hptr->beg, (unsigned)n);
-               if(p == 0){
-                       hptr->beg = realloc(hptr->beg, (unsigned)(hptr->last-hptr->beg));
-                       garbage("seekc");
-                       if((p = realloc(hptr->beg, (unsigned)n)) == 0)
-                               ospace("seekc");
-               }
-               hptr->beg = p;
-               hptr->wt = hptr->last = hptr->rd = p+n;
-               return;
-       }
-       hptr->rd = nn;
-       if(nn>hptr->wt)hptr->wt = nn;
-       return;
-}
-salterwd(hptr,n)
-struct wblk *hptr;
-struct blk *n;
-{
-       if(hptr->rdw == hptr->lastw)more(hptr);
-       *hptr->rdw++ = n;
-       if(hptr->rdw > hptr->wtw)hptr->wtw = hptr->rdw;
-       return;
-}
-more(hptr)
-struct blk *hptr;
-{
-       register unsigned size;
-       register char *p;
-
-       if((size=(hptr->last-hptr->beg)*2) == 0)size=1;
-       nbytes += size/2;
-       free(hptr->beg);
-       p = realloc(hptr->beg, (unsigned)size);
-       if(p == 0){
-               hptr->beg = realloc(hptr->beg, (unsigned)(hptr->last-hptr->beg));
-               garbage("more");
-               if((p = realloc(hptr->beg,size)) == 0)
-                       ospace("more");
-       }
-       hptr->rd = hptr->rd-hptr->beg+p;
-       hptr->wt = hptr->wt-hptr->beg+p;
-       hptr->beg = p;
-       hptr->last = p+size;
-       return;
-}
-ospace(s)
-char *s;
-{
-       printf("out of space: %s\n",s);
-       printf("all %ld rel %ld headmor %ld\n",all,rel,headmor);
-       printf("nbytes %ld\n",nbytes);
-       sdump("stk",*stkptr);
-       abort();
-}
-garbage(s)
-char *s;
-{
-       int i;
-       struct blk *p, *q;
-       struct sym *tmps;
-       int ct;
-
-/*     printf("got to garbage %s\n",s);        */
-       for(i=0;i<TBLSZ;i++){
-               tmps = stable[i];
-               if(tmps != 0){
-                       if(i < ARRAYST){
-                               do {
-                                       p = tmps->val;
-                                       if(((int)p->beg & 01)  != 0){
-                                               printf("string %o\n",i);
-                                               sdump("odd beg",p);
-                                       }
-                                       redef(p);
-                                       tmps = tmps->next;
-                               } while(tmps != 0);
-                               continue;
-                       }
-                       else {
-                               do {
-                                       p = tmps->val;
-                                       rewind(p);
-                                       ct = 0;
-                                       while((q = getwd(p)) != NULL){
-                                               ct++;
-                                               if(q != 0){
-                                                       if(((int)q->beg & 01) != 0){
-                                                               printf("array %o elt %d odd\n",i-ARRAYST,ct);
-printf("tmps %o p %o\n",tmps,p);
-                                                               sdump("elt",q);
-                                                       }
-                                                       redef(q);
-                                               }
-                                       }
-                                       tmps = tmps->next;
-                               } while(tmps != 0);
-                       }
-               }
-       }
-}
-redef(p)
-struct blk *p;
-{
-       register offset;
-       register char *newp;
-
-       if ((int)p->beg&01) {
-               printf("odd ptr %o hdr %o\n",p->beg,p);
-               ospace("redef-bad");
-       }
-       free(p->beg);
-       free(dummy);
-       dummy = malloc(1);
-       if(dummy == NULL)ospace("dummy");
-       newp = realloc(p->beg, (unsigned)(p->last-p->beg));
-       if(newp == NULL)ospace("redef");
-       offset = newp - p->beg;
-       p->beg = newp;
-       p->rd += offset;
-       p->wt += offset;
-       p->last += offset;
-}
-
-release(p)
-register struct blk *p;
-{
-       rel++;
-       nbytes -= p->last - p->beg;
-       p->rd = (char *)hfree;
-       hfree = p;
-       free(p->beg);
-}
-
-struct blk *
-getwd(p)
-struct blk *p;
-{
-       register struct wblk *wp;
-
-       wp = (struct wblk *)p;
-       if (wp->rdw == wp->wtw)
-               return(NULL);
-       return(*wp->rdw++);
-}
-
-putwd(p, c)
-struct blk *p, *c;
-{
-       register struct wblk *wp;
-
-       wp = (struct wblk *)p;
-       if (wp->wtw == wp->lastw)
-               more(p);
-       *wp->wtw++ = c;
-}
-
-struct blk *
-lookwd(p)
-struct blk *p;
-{
-       register struct wblk *wp;
-
-       wp = (struct wblk *)p;
-       if (wp->rdw == wp->wtw)
-               return(NULL);
-       return(*wp->rdw);
-}
-char *
-nalloc(p,nbytes)
-register char *p;
-unsigned nbytes;
-{
-       char *malloc();
-       register char *q, *r;
-       q = r = malloc(nbytes);
-       if(q==0)
-               return(0);
-       while(nbytes--)
-               *q++ = *p++;
-       return(r);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/dc/dc.h b/.ref-Research-V7/usr/src/cmd/dc/dc.h
deleted file mode 100644 (file)
index eaea5af..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#define FATAL 0
-#define NFATAL 1
-#define BLK sizeof(struct blk)
-#define PTRSZ sizeof(int *)
-#define HEADSZ 1024
-#define STKSZ 100
-#define RDSKSZ 100
-#define TBLSZ 256
-#define ARRAYST 0241
-#define MAXIND 2048
-#define NL 1
-#define NG 2
-#define NE 3
-#define length(p) ((p)->wt-(p)->beg)
-#define rewind(p) (p)->rd=(p)->beg
-#define create(p)      (p)->rd = (p)->wt = (p)->beg
-#define fsfile(p)      (p)->rd = (p)->wt
-#define truncate(p)    (p)->wt = (p)->rd
-#define sfeof(p)       (((p)->rd==(p)->wt)?1:0)
-#define sfbeg(p)       (((p)->rd==(p)->beg)?1:0)
-#define sungetc(p,c)   *(--(p)->rd)=c
-#ifdef interdata
-#define NEGBYTE 0200
-#define MASK (-1 & ~0377)
-#define sgetc(p)       ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? ( *(p)->rd++ | MASK): *(p)->rd++ ))
-#define slookc(p)      ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? (*(p)->rd | MASK) : *(p)->rd ))
-#define sbackc(p)      ( ((p)->rd==(p)->beg) ? EOF :( ((*(--(p)->rd) & NEGBYTE) != 0) ? (*(p)->rd | MASK): *(p)->rd ))
-#endif
-#ifndef interdata
-#define sgetc(p)       (((p)->rd==(p)->wt)?EOF:*(p)->rd++)
-#define slookc(p)      (((p)->rd==(p)->wt)?EOF:*(p)->rd)
-#define sbackc(p)      (((p)->rd==(p)->beg)?EOF:*(--(p)->rd))
-#endif
-#define sputc(p,c)     {if((p)->wt==(p)->last)more(p); *(p)->wt++ = c; }
-#define salterc(p,c)   {if((p)->rd==(p)->last)more(p); *(p)->rd++ = c; if((p)->rd>(p)->wt)(p)->wt=(p)->rd;}
-#define sunputc(p)     (*( (p)->rd = --(p)->wt))
-#define zero(p)        for(pp=(p)->beg;pp<(p)->last;)*pp++='\0'
-#define OUTC(x) {printf("%c",x); if(--count == 0){printf("\\\n"); count=ll;} }
-#define TEST2  {if((count -= 2) <=0){printf("\\\n");count=ll;}}
-#define EMPTY if(stkerr != 0){printf("stack empty\n"); continue; }
-#define EMPTYR(x) if(stkerr!=0){pushp(x);printf("stack empty\n");continue;}
-#define EMPTYS if(stkerr != 0){printf("stack empty\n"); return(1);}
-#define EMPTYSR(x) if(stkerr !=0){printf("stack empty\n");pushp(x);return(1);}
-#define error(p)       {printf(p); continue; }
-#define errorrt(p)     {printf(p); return(1); }
-struct blk {
-       char    *rd;
-       char    *wt;
-       char    *beg;
-       char    *last;
-};
-struct blk *hfree;
-struct blk *getwd();
-struct blk *lookwd();
-struct blk *getdec();
-struct blk *morehd();
-
-struct blk *arg1, *arg2;
-int    svargc;
-char   savk;
-char   **svargv;
-int    dbg;
-int    ifile;
-FILE   *curfile;
-struct blk *scalptr, *basptr, *tenptr, *inbas;
-struct blk *sqtemp, *chptr, *strptr, *divxyz;
-struct blk *stack[STKSZ];
-struct blk **stkptr,**stkbeg;
-struct blk **stkend;
-int    stkerr;
-int    lastchar;
-struct blk *readstk[RDSKSZ];
-struct blk **readptr;
-struct blk *rem;
-int    k;
-struct blk *irem;
-int    skd,skr;
-struct blk *pop(),*readin(),*add0(),*mult();
-struct blk *scalint();
-struct blk *removc();
-struct blk *add(),*div(),*removr();
-struct blk *exp();
-struct blk *sqrt();
-struct blk *salloc(),*copy();
-struct blk *scale();
-int    neg;
-struct sym {
-       struct  sym *next;
-       struct  blk *val;
-} symlst[TBLSZ];
-struct sym *stable[TBLSZ];
-struct sym *sptr,*sfree;
-struct wblk {
-       struct blk **rdw;
-       struct blk **wtw;
-       struct blk **begw;
-       struct blk **lastw;
-};
-FILE   *fsave;
-long   rel;
-long   nbytes;
-long   all;
-long   headmor;
-long   obase;
-int    fw,fw1,ll;
-int    (*outdit)();
-int    bigot(),hexot();
-int    logo;
-int    log10;
-int    count;
-char   *pp;
-int    (*signal())();
-int    onintr();
-char   *malloc();
-char   *nalloc();
-char   *realloc();
-char   *dummy;
diff --git a/.ref-Research-V7/usr/src/cmd/dc/makefile b/.ref-Research-V7/usr/src/cmd/dc/makefile
deleted file mode 100644 (file)
index 40f420f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-all:   dc
-
-cmp:   dc
-       cmp dc /bin/dc
-       rm dc
-
-cp:    dc
-       cp dc /bin/dc
-       rm dc
-
-dc:    dc.c dc.h
-       cc -n -s -O dc.c -o dc
diff --git a/.ref-Research-V7/usr/src/cmd/dcheck.c b/.ref-Research-V7/usr/src/cmd/dcheck.c
deleted file mode 100644 (file)
index 3766aa9..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * dcheck - check directory consistency
- */
-#define        NI      16
-#define        NB      10
-#define        NDIR    (BSIZE/sizeof(struct direct))
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/inode.h>
-#include <sys/ino.h>
-#include <sys/dir.h>
-#include <sys/filsys.h>
-#include <sys/fblk.h>
-
-
-struct filsys  sblock;
-struct dinode  itab[INOPB*NI];
-daddr_t        iaddr[NADDR];
-ino_t  ilist[NB];
-
-int    fi;
-ino_t  ino;
-char   *ecount;
-int    headpr;
-unsigned       nfiles;
-
-int    nerror;
-daddr_t        bmap();
-long   atol();
-char   *malloc();
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-       long n;
-
-       while (--argc) {
-               argv++;
-               if (**argv=='-')
-               switch ((*argv)[1]) {
-
-               case 'i':
-                       for(i=0; i<NB; i++) {
-                               n = atol(argv[1]);
-                               if(n == 0)
-                                       break;
-                               ilist[i] = n;
-                               argv++;
-                               argc--;
-                       }
-                       ilist[i] = 0;
-                       continue;
-
-               default:
-                       printf("Bad flag %c\n", (*argv)[1]);
-                       nerror++;
-               }
-               check(*argv);
-       }
-       return(nerror);
-}
-
-check(file)
-char *file;
-{
-       register i;
-       register j;
-
-       fi = open(file, 0);
-       if(fi < 0) {
-               printf("cannot open %s\n", file);
-               nerror++;
-               return;
-       }
-       headpr = 0;
-       printf("%s:\n", file);
-       sync();
-       bread((daddr_t)1, (char *)&sblock, sizeof(sblock));
-       nfiles = (sblock.s_isize-2)*INOPB;
-       if (nfiles > 40000) {
-               printf("Only doing 40000 files\n");
-               nfiles = 40000;
-       }
-       ecount = malloc(nfiles+1);
-       if (ecount==NULL) {
-               printf("Not enough core\n");
-               exit(04);
-       }
-       for (i=0; i<=nfiles; i++)
-               ecount[i] = 0;
-       ino = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= nfiles)
-                       break;
-               bread((daddr_t)i, (char *)itab, sizeof(itab));
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= nfiles)
-                               break;
-                       ino++;
-                       pass1(&itab[j]);
-               }
-       }
-       ino = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= nfiles)
-                       break;
-               bread((daddr_t)i, (char *)itab, sizeof(itab));
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= nfiles)
-                               break;
-                       ino++;
-                       pass2(&itab[j]);
-               }
-       }
-       free(ecount);
-}
-
-pass1(ip)
-register struct dinode *ip;
-{
-       struct direct dbuf[NDIR];
-       long doff;
-       struct direct *dp;
-       register i, j;
-       int k;
-       daddr_t d;
-       ino_t kno;
-
-       if((ip->di_mode&IFMT) != IFDIR)
-               return;
-       l3tol(iaddr, ip->di_addr, NADDR);
-       doff = 0;
-       for(i=0;; i++) {
-               if(doff >= ip->di_size)
-                       break;
-               d = bmap(i);
-               if(d == 0)
-                       break;
-               bread(d, (char *)dbuf, BSIZE);
-               for(j=0; j<NDIR; j++) {
-                       if(doff >= ip->di_size)
-                               break;
-                       doff += sizeof(struct direct);
-                       dp = &dbuf[j];
-                       kno = dp->d_ino;
-                       if(kno == 0)
-                               continue;
-                       if(kno > nfiles || kno <= 1) {
-                               printf("%5u bad; %u/%.14s\n", kno, ino, dp->d_name);
-                               nerror++;
-                               continue;
-                       }
-                       for (k=0; ilist[k] != 0; k++)
-                               if (ilist[k]==kno) {
-                                       printf("%5u arg; %u/%.14s\n", kno, ino, dp->d_name);
-                                       nerror++;
-                               }
-                       ecount[kno]++;
-                       if (ecount[kno] == 0)
-                               ecount[kno] = 0377;
-               }
-       }
-}
-
-pass2(ip)
-register struct dinode *ip;
-{
-       register i;
-
-       i = ino;
-       if ((ip->di_mode&IFMT)==0 && ecount[i]==0)
-               return;
-       if (ip->di_nlink==((ecount[i])&0377) && ip->di_nlink!=0)
-               return;
-       if (ino < ROOTINO && ip->di_nlink==0 && ecount[i]==0)
-               return;
-       if (headpr==0) {
-               printf("     entries  link cnt\n");
-               headpr++;
-       }
-       printf("%u      %d      %d\n", ino,
-           ecount[i]&0377, ip->di_nlink);
-}
-
-bread(bno, buf, cnt)
-daddr_t bno;
-char *buf;
-{
-       register i;
-
-       lseek(fi, bno*BSIZE, 0);
-       if (read(fi, buf, cnt) != cnt) {
-               printf("read error %D\n", bno);
-               for(i=0; i<BSIZE; i++)
-                       buf[i] = 0;
-       }
-}
-
-
-daddr_t
-bmap(i)
-{
-       daddr_t ibuf[NINDIR];
-
-       if(i < NADDR-3)
-               return(iaddr[i]);
-       i -= NADDR-3;
-       if(i > NINDIR) {
-               printf("%u - huge directory\n", ino);
-               return((daddr_t)0);
-       }
-       bread(iaddr[NADDR-3], (char *)ibuf, sizeof(ibuf));
-       return(ibuf[i]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/dd.c b/.ref-Research-V7/usr/src/cmd/dd.c
deleted file mode 100644 (file)
index 930af9b..0000000
+++ /dev/null
@@ -1,541 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-
-#define        BIG     32767
-#define        LCASE   01
-#define        UCASE   02
-#define        SWAB    04
-#define NERR   010
-#define SYNC   020
-int    cflag;
-int    fflag;
-int    skip;
-int    seekn;
-int    count;
-int    files   = 1;
-char   *string;
-char   *ifile;
-char   *ofile;
-char   *ibuf;
-char   *obuf;
-char   *sbrk();
-int    ibs     = 512;
-int    obs     = 512;
-int    bs;
-int    cbs;
-int    ibc;
-int    obc;
-int    cbc;
-int    nifr;
-int    nipr;
-int    nofr;
-int    nopr;
-int    ntrunc;
-int    ibf;
-int    obf;
-char   *op;
-int    nspace;
-char   etoa[] = {
-       0000,0001,0002,0003,0234,0011,0206,0177,
-       0227,0215,0216,0013,0014,0015,0016,0017,
-       0020,0021,0022,0023,0235,0205,0010,0207,
-       0030,0031,0222,0217,0034,0035,0036,0037,
-       0200,0201,0202,0203,0204,0012,0027,0033,
-       0210,0211,0212,0213,0214,0005,0006,0007,
-       0220,0221,0026,0223,0224,0225,0226,0004,
-       0230,0231,0232,0233,0024,0025,0236,0032,
-       0040,0240,0241,0242,0243,0244,0245,0246,
-       0247,0250,0133,0056,0074,0050,0053,0041,
-       0046,0251,0252,0253,0254,0255,0256,0257,
-       0260,0261,0135,0044,0052,0051,0073,0136,
-       0055,0057,0262,0263,0264,0265,0266,0267,
-       0270,0271,0174,0054,0045,0137,0076,0077,
-       0272,0273,0274,0275,0276,0277,0300,0301,
-       0302,0140,0072,0043,0100,0047,0075,0042,
-       0303,0141,0142,0143,0144,0145,0146,0147,
-       0150,0151,0304,0305,0306,0307,0310,0311,
-       0312,0152,0153,0154,0155,0156,0157,0160,
-       0161,0162,0313,0314,0315,0316,0317,0320,
-       0321,0176,0163,0164,0165,0166,0167,0170,
-       0171,0172,0322,0323,0324,0325,0326,0327,
-       0330,0331,0332,0333,0334,0335,0336,0337,
-       0340,0341,0342,0343,0344,0345,0346,0347,
-       0173,0101,0102,0103,0104,0105,0106,0107,
-       0110,0111,0350,0351,0352,0353,0354,0355,
-       0175,0112,0113,0114,0115,0116,0117,0120,
-       0121,0122,0356,0357,0360,0361,0362,0363,
-       0134,0237,0123,0124,0125,0126,0127,0130,
-       0131,0132,0364,0365,0366,0367,0370,0371,
-       0060,0061,0062,0063,0064,0065,0066,0067,
-       0070,0071,0372,0373,0374,0375,0376,0377,
-};
-char   atoe[] = {
-       0000,0001,0002,0003,0067,0055,0056,0057,
-       0026,0005,0045,0013,0014,0015,0016,0017,
-       0020,0021,0022,0023,0074,0075,0062,0046,
-       0030,0031,0077,0047,0034,0035,0036,0037,
-       0100,0117,0177,0173,0133,0154,0120,0175,
-       0115,0135,0134,0116,0153,0140,0113,0141,
-       0360,0361,0362,0363,0364,0365,0366,0367,
-       0370,0371,0172,0136,0114,0176,0156,0157,
-       0174,0301,0302,0303,0304,0305,0306,0307,
-       0310,0311,0321,0322,0323,0324,0325,0326,
-       0327,0330,0331,0342,0343,0344,0345,0346,
-       0347,0350,0351,0112,0340,0132,0137,0155,
-       0171,0201,0202,0203,0204,0205,0206,0207,
-       0210,0211,0221,0222,0223,0224,0225,0226,
-       0227,0230,0231,0242,0243,0244,0245,0246,
-       0247,0250,0251,0300,0152,0320,0241,0007,
-       0040,0041,0042,0043,0044,0025,0006,0027,
-       0050,0051,0052,0053,0054,0011,0012,0033,
-       0060,0061,0032,0063,0064,0065,0066,0010,
-       0070,0071,0072,0073,0004,0024,0076,0341,
-       0101,0102,0103,0104,0105,0106,0107,0110,
-       0111,0121,0122,0123,0124,0125,0126,0127,
-       0130,0131,0142,0143,0144,0145,0146,0147,
-       0150,0151,0160,0161,0162,0163,0164,0165,
-       0166,0167,0170,0200,0212,0213,0214,0215,
-       0216,0217,0220,0232,0233,0234,0235,0236,
-       0237,0240,0252,0253,0254,0255,0256,0257,
-       0260,0261,0262,0263,0264,0265,0266,0267,
-       0270,0271,0272,0273,0274,0275,0276,0277,
-       0312,0313,0314,0315,0316,0317,0332,0333,
-       0334,0335,0336,0337,0352,0353,0354,0355,
-       0356,0357,0372,0373,0374,0375,0376,0377,
-};
-char   atoibm[] =
-{
-       0000,0001,0002,0003,0067,0055,0056,0057,
-       0026,0005,0045,0013,0014,0015,0016,0017,
-       0020,0021,0022,0023,0074,0075,0062,0046,
-       0030,0031,0077,0047,0034,0035,0036,0037,
-       0100,0132,0177,0173,0133,0154,0120,0175,
-       0115,0135,0134,0116,0153,0140,0113,0141,
-       0360,0361,0362,0363,0364,0365,0366,0367,
-       0370,0371,0172,0136,0114,0176,0156,0157,
-       0174,0301,0302,0303,0304,0305,0306,0307,
-       0310,0311,0321,0322,0323,0324,0325,0326,
-       0327,0330,0331,0342,0343,0344,0345,0346,
-       0347,0350,0351,0255,0340,0275,0137,0155,
-       0171,0201,0202,0203,0204,0205,0206,0207,
-       0210,0211,0221,0222,0223,0224,0225,0226,
-       0227,0230,0231,0242,0243,0244,0245,0246,
-       0247,0250,0251,0300,0117,0320,0241,0007,
-       0040,0041,0042,0043,0044,0025,0006,0027,
-       0050,0051,0052,0053,0054,0011,0012,0033,
-       0060,0061,0032,0063,0064,0065,0066,0010,
-       0070,0071,0072,0073,0004,0024,0076,0341,
-       0101,0102,0103,0104,0105,0106,0107,0110,
-       0111,0121,0122,0123,0124,0125,0126,0127,
-       0130,0131,0142,0143,0144,0145,0146,0147,
-       0150,0151,0160,0161,0162,0163,0164,0165,
-       0166,0167,0170,0200,0212,0213,0214,0215,
-       0216,0217,0220,0232,0233,0234,0235,0236,
-       0237,0240,0252,0253,0254,0255,0256,0257,
-       0260,0261,0262,0263,0264,0265,0266,0267,
-       0270,0271,0272,0273,0274,0275,0276,0277,
-       0312,0313,0314,0315,0316,0317,0332,0333,
-       0334,0335,0336,0337,0352,0353,0354,0355,
-       0356,0357,0372,0373,0374,0375,0376,0377,
-};
-
-
-main(argc, argv)
-int    argc;
-char   **argv;
-{
-       int (*conv)();
-       register char *ip;
-       register c;
-       int ebcdic(), ibm(), ascii(), null(), cnull(), term();
-       int a;
-
-       conv = null;
-       for(c=1; c<argc; c++) {
-               string = argv[c];
-               if(match("ibs=")) {
-                       ibs = number(BIG);
-                       continue;
-               }
-               if(match("obs=")) {
-                       obs = number(BIG);
-                       continue;
-               }
-               if(match("cbs=")) {
-                       cbs = number(BIG);
-                       continue;
-               }
-               if (match("bs=")) {
-                       bs = number(BIG);
-                       continue;
-               }
-               if(match("if=")) {
-                       ifile = string;
-                       continue;
-               }
-               if(match("of=")) {
-                       ofile = string;
-                       continue;
-               }
-               if(match("skip=")) {
-                       skip = number(BIG);
-                       continue;
-               }
-               if(match("seek=")) {
-                       seekn = number(BIG);
-                       continue;
-               }
-               if(match("count=")) {
-                       count = number(BIG);
-                       continue;
-               }
-               if(match("files=")) {
-                       files = number(BIG);
-                       continue;
-               }
-               if(match("conv=")) {
-               cloop:
-                       if(match(","))
-                               goto cloop;
-                       if(*string == '\0')
-                               continue;
-                       if(match("ebcdic")) {
-                               conv = ebcdic;
-                               goto cloop;
-                       }
-                       if(match("ibm")) {
-                               conv = ibm;
-                               goto cloop;
-                       }
-                       if(match("ascii")) {
-                               conv = ascii;
-                               goto cloop;
-                       }
-                       if(match("lcase")) {
-                               cflag |= LCASE;
-                               goto cloop;
-                       }
-                       if(match("ucase")) {
-                               cflag |= UCASE;
-                               goto cloop;
-                       }
-                       if(match("swab")) {
-                               cflag |= SWAB;
-                               goto cloop;
-                       }
-                       if(match("noerror")) {
-                               cflag |= NERR;
-                               goto cloop;
-                       }
-                       if(match("sync")) {
-                               cflag |= SYNC;
-                               goto cloop;
-                       }
-               }
-               fprintf(stderr,"bad arg: %s\n", string);
-               exit(0);
-       }
-       if(conv == null && cflag&(LCASE|UCASE))
-               conv = cnull;
-       if (ifile)
-               ibf = open(ifile, 0);
-       else
-               ibf = dup(0);
-       if(ibf < 0) {
-               fprintf(stderr,"cannot open: %s\n", ifile);
-               exit(0);
-       }
-       if (ofile)
-               obf = creat(ofile, 0666);
-       else
-               obf = dup(1);
-       if(obf < 0) {
-               fprintf(stderr,"cannot create: %s\n", ofile);
-               exit(0);
-       }
-       if (bs) {
-               ibs = obs = bs;
-               if (conv == null)
-                       fflag++;
-       }
-       if(ibs == 0 || obs == 0) {
-               fprintf(stderr,"counts: cannot be zero\n");
-               exit(0);
-       }
-       ibuf = sbrk(ibs);
-       if (fflag)
-               obuf = ibuf;
-       else
-               obuf = sbrk(obs);
-       sbrk(64);       /* For good measure */
-       if(ibuf == (char *)-1 || obuf == (char *)-1) {
-               fprintf(stderr, "not enough memory\n");
-               exit(0);
-       }
-       ibc = 0;
-       obc = 0;
-       cbc = 0;
-       op = obuf;
-
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, term);
-       while(skip) {
-               read(ibf, ibuf, ibs);
-               skip--;
-       }
-       while(seekn) {
-               lseek(obf, (long)obs, 1);
-               seekn--;
-       }
-
-loop:
-       if(ibc-- == 0) {
-               ibc = 0;
-               if(count==0 || nifr+nipr!=count) {
-                       if(cflag&(NERR|SYNC))
-                       for(ip=ibuf+ibs; ip>ibuf;)
-                               *--ip = 0;
-                       ibc = read(ibf, ibuf, ibs);
-               }
-               if(ibc == -1) {
-                       perror("read");
-                       if((cflag&NERR) == 0) {
-                               flsh();
-                               term();
-                       }
-                       ibc = 0;
-                       for(c=0; c<ibs; c++)
-                               if(ibuf[c] != 0)
-                                       ibc = c;
-                       stats();
-               }
-               if(ibc == 0 && --files<=0) {
-                       flsh();
-                       term();
-               }
-               if(ibc != ibs) {
-                       nipr++;
-                       if(cflag&SYNC)
-                               ibc = ibs;
-               } else
-                       nifr++;
-               ip = ibuf;
-               c = (ibc>>1) & ~1;
-               if(cflag&SWAB && c)
-               do {
-                       a = *ip++;
-                       ip[-1] = *ip;
-                       *ip++ = a;
-               } while(--c);
-               ip = ibuf;
-               if (fflag) {
-                       obc = ibc;
-                       flsh();
-                       ibc = 0;
-               }
-               goto loop;
-       }
-       c = 0;
-       c |= *ip++;
-       c &= 0377;
-       (*conv)(c);
-       goto loop;
-}
-
-flsh()
-{
-       register c;
-
-       if(obc) {
-               if(obc == obs)
-                       nofr++; else
-                       nopr++;
-               c = write(obf, obuf, obc);
-               if(c != obc) {
-                       perror("write");
-                       term();
-               }
-               obc = 0;
-       }
-}
-
-match(s)
-char *s;
-{
-       register char *cs;
-
-       cs = string;
-       while(*cs++ == *s)
-               if(*s++ == '\0')
-                       goto true;
-       if(*s != '\0')
-               return(0);
-
-true:
-       cs--;
-       string = cs;
-       return(1);
-}
-
-number(big)
-{
-       register char *cs;
-       long n;
-
-       cs = string;
-       n = 0;
-       while(*cs >= '0' && *cs <= '9')
-               n = n*10 + *cs++ - '0';
-       for(;;)
-       switch(*cs++) {
-
-       case 'k':
-               n *= 1024;
-               continue;
-
-       case 'w':
-               n *= sizeof(int);
-               continue;
-
-       case 'b':
-               n *= 512;
-               continue;
-
-       case '*':
-       case 'x':
-               string = cs;
-               n *= number(BIG);
-
-       case '\0':
-               if (n>=big || n<0) {
-                       fprintf(stderr, "dd: argument %D out of range\n", n);
-                       exit(1);
-               }
-               return(n);
-       }
-       /* never gets here */
-}
-
-cnull(cc)
-{
-       register c;
-
-       c = cc;
-       if(cflag&UCASE && c>='a' && c<='z')
-               c += 'A'-'a';
-       if(cflag&LCASE && c>='A' && c<='Z')
-               c += 'a'-'A';
-       null(c);
-}
-
-null(c)
-{
-
-       *op = c;
-       op++;
-       if(++obc >= obs) {
-               flsh();
-               op = obuf;
-       }
-}
-
-ascii(cc)
-{
-       register c;
-
-       c = etoa[cc] & 0377;
-       if(cbs == 0) {
-               cnull(c);
-               return;
-       }
-       if(c == ' ') {
-               nspace++;
-               goto out;
-       }
-       while(nspace > 0) {
-               null(' ');
-               nspace--;
-       }
-       cnull(c);
-
-out:
-       if(++cbc >= cbs) {
-               null('\n');
-               cbc = 0;
-               nspace = 0;
-       }
-}
-
-ebcdic(cc)
-{
-       register c;
-
-       c = cc;
-       if(cflag&UCASE && c>='a' && c<='z')
-               c += 'A'-'a';
-       if(cflag&LCASE && c>='A' && c<='Z')
-               c += 'a'-'A';
-       c = atoe[c] & 0377;
-       if(cbs == 0) {
-               null(c);
-               return;
-       }
-       if(cc == '\n') {
-               while(cbc < cbs) {
-                       null(atoe[' ']);
-                       cbc++;
-               }
-               cbc = 0;
-               return;
-       }
-       if(cbc == cbs)
-               ntrunc++;
-       cbc++;
-       if(cbc <= cbs)
-               null(c);
-}
-
-ibm(cc)
-{
-       register c;
-
-       c = cc;
-       if(cflag&UCASE && c>='a' && c<='z')
-               c += 'A'-'a';
-       if(cflag&LCASE && c>='A' && c<='Z')
-               c += 'a'-'A';
-       c = atoibm[c] & 0377;
-       if(cbs == 0) {
-               null(c);
-               return;
-       }
-       if(cc == '\n') {
-               while(cbc < cbs) {
-                       null(atoibm[' ']);
-                       cbc++;
-               }
-               cbc = 0;
-               return;
-       }
-       if(cbc == cbs)
-               ntrunc++;
-       cbc++;
-       if(cbc <= cbs)
-               null(c);
-}
-
-term()
-{
-
-       stats();
-       exit(0);
-}
-
-stats()
-{
-
-       fprintf(stderr,"%u+%u records in\n", nifr, nipr);
-       fprintf(stderr,"%u+%u records out\n", nofr, nopr);
-       if(ntrunc)
-               fprintf(stderr,"%u truncated records\n", ntrunc);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/deroff.c b/.ref-Research-V7/usr/src/cmd/deroff.c
deleted file mode 100644 (file)
index 2d7c3e0..0000000
+++ /dev/null
@@ -1,494 +0,0 @@
-char *xxxvers = "\nDeroff Version 1.02    24 July 1978\n";
-
-
-#include <stdio.h>
-
-/* Deroff command -- strip troff, eqn, and Tbl sequences from
-a file.  Has one flag argument, -w, to cause output one word per line
-rather than in the original format.
-Deroff follows .so and .nx commands, removes contents of macro
-definitions, equations (both .EQ ... .EN and $...$),
-Tbl command sequences, and Troff backslash constructions.
-
-All input is through the C macro; the most recently read character is in c.
-*/
-
-#define C ( (c=getc(infile)) == EOF ? eof() : ((c==ldelim)&&(filesp==files) ? skeqn() : c) )
-#define C1 ( (c=getc(infile)) == EOF ? eof() :  c)
-#define SKIP while(C != '\n') 
-
-#define YES 1
-#define NO 0
-
-#define NOCHAR -2
-#define SPECIAL 0
-#define APOS 1
-#define DIGIT 2
-#define LETTER 3
-
-int wordflag = NO;
-int inmacro = NO;
-int intable = NO;
-
-char chars[128];  /* SPECIAL, APOS, DIGIT, or LETTER */
-
-char line[512];
-char *lp;
-
-int c;
-int ldelim     = NOCHAR;
-int rdelim     = NOCHAR;
-
-
-int argc;
-char **argv;
-
-char fname[50];
-FILE *files[15];
-FILE **filesp;
-FILE *infile;
-
-char *calloc();
-
-
-
-main(ac, av)
-int ac;
-char **av;
-{
-register int i;
-register char *p;
-static char onechar[2] = "X";
-FILE *opn();
-
-argc = ac - 1;
-argv = av + 1;
-
-while(argc>0 && argv[0][0]=='-' && argv[0][1]!='\0') 
-       {
-       for(p=argv[0]+1; *p; ++p) switch(*p)
-               {
-               case 'w':
-                       wordflag = YES;
-                       break;
-               default:
-                       onechar[0] = *p;
-                       fatal("Invalid flag %s\n", onechar);
-               }
-       --argc;
-       ++argv;
-       }
-
-if(argc == 0)
-       infile = stdin;
-else   {
-       infile = opn(argv[0]);
-       --argc;
-       ++argv;
-       }
-
-files[0] = infile;
-filesp = &files[0];
-
-for(i='a'; i<='z' ; ++i)
-       chars[i] = LETTER;
-for(i='A'; i<='Z'; ++i)
-       chars[i] = LETTER;
-for(i='0'; i<='9'; ++i)
-       chars[i] = DIGIT;
-chars['\''] = APOS;
-chars['&'] = APOS;
-
-work();
-}
-
-
-
-skeqn()
-{
-while((c = getc(infile)) != rdelim)
-       if(c == EOF)
-               c = eof();
-       else if(c == '"')
-               while( (c = getc(infile)) != '"')
-                       if(c == EOF)
-                               c = eof();
-                       else if(c == '\\')
-                               if((c = getc(infile)) == EOF)
-                                       c = eof();
-return(c = ' ');
-}
-
-
-FILE *opn(p)
-register char *p;
-{
-FILE *fd;
-
-if(p[0]=='-' && p[1]=='\0')
-       fd = stdin;
-else if( (fd = fopen(p, "r")) == NULL)
-       fatal("Cannot open file %s\n", p);
-
-return(fd);
-}
-
-
-
-eof()
-{
-if(infile != stdin)
-       fclose(infile);
-if(filesp > files)
-       infile = *--filesp;
-else if(argc > 0)
-       {
-       infile = opn(argv[0]);
-       --argc;
-       ++argv;
-       }
-else
-       exit(0);
-
-return(C);
-}
-
-
-
-getfname()
-{
-register char *p;
-struct chain { struct chain *nextp; char *datap; } *chainblock;
-register struct chain *q;
-static struct chain *namechain = NULL;
-char *copys();
-
-while(C == ' ') ;
-
-for(p = fname ; (*p=c)!= '\n' && c!=' ' && c!='\t' && c!='\\' ; ++p)
-       C;
-*p = '\0';
-while(c != '\n')
-       C;
-
-/* see if this name has already been used */
-
-for(q = namechain ; q; q = q->nextp)
-       if( ! strcmp(fname, q->datap))
-               {
-               fname[0] = '\0';
-               return;
-               }
-
-q = (struct chain *) calloc(1, sizeof(*chainblock));
-q->nextp = namechain;
-q->datap = copys(fname);
-namechain = q;
-}
-
-
-
-
-fatal(s,p)
-char *s, *p;
-{
-fprintf(stderr, "Deroff: ");
-fprintf(stderr, s, p);
-exit(1);
-}
-\f
-work()
-{
-
-for( ;; )
-       {
-       if(C == '.'  ||  c == '\'')
-               comline();
-       else
-               regline(NO);
-       }
-}
-
-
-
-
-regline(macline)
-int macline;
-{
-line[0] = c;
-lp = line;
-for( ; ; )
-       {
-       if(c == '\\')
-               {
-               *lp = ' ';
-               backsl();
-               }
-       if(c == '\n') break;
-       if(intable && c=='T')
-               {
-               *++lp = C;
-               if(c=='{' || c=='}')
-                       {
-                       lp[-1] = ' ';
-                       *lp = C;
-                       }
-               }
-       else    *++lp = C;
-       }
-
-*lp = '\0';
-
-if(line[0] != '\0')
-       if(wordflag)
-               putwords(macline);
-       else if(macline)
-               putmac(line);
-       else
-               puts(line);
-}
-
-
-
-
-putmac(s)
-register char *s;
-{
-register char *t;
-
-while(*s)
-       {
-       while(*s==' ' || *s=='\t')
-               putchar(*s++);
-       for(t = s ; *t!=' ' && *t!='\t' && *t!='\0' ; ++t)
-               ;
-       if(t>s+2 && chars[ s[0] ]==LETTER && chars[ s[1] ]==LETTER)
-               while(s < t)
-                       putchar(*s++);
-       else
-               s = t;
-       }
-putchar('\n');
-}
-
-
-
-putwords(macline)      /* break into words for -w option */
-int macline;
-{
-register char *p, *p1;
-int i, nlet;
-
-
-for(p1 = line ; ;)
-       {
-       /* skip initial specials ampersands and apostrophes */
-       while( chars[*p1] < DIGIT)
-               if(*p1++ == '\0') return;
-       nlet = 0;
-       for(p = p1 ; (i=chars[*p]) != SPECIAL ; ++p)
-               if(i == LETTER) ++nlet;
-
-       if( (!macline && nlet>1)   /* MDM definition of word */
-          || (macline && nlet>2 && chars[ p1[0] ]==LETTER && chars[ p1[1] ]==LETTER) )
-               {
-               /* delete trailing ampersands and apostrophes */
-               while(p[-1]=='\'' || p[-1]=='&')
-                        --p;
-               while(p1 < p) putchar(*p1++);
-               putchar('\n');
-               }
-       else
-               p1 = p;
-       }
-}
-
-\f
-
-comline()
-{
-register int c1, c2;
-
-while(C==' ' || c=='\t')
-       ;
-if( (c1=c) == '\n')
-       return;
-c2 = C;
-if(c1=='.' && c2!='.')
-       inmacro = NO;
-if(c2 == '\n')
-       return;
-
-if(c1=='E' && c2=='Q' && filesp==files)
-       eqn();
-else if(c1=='T' && (c2=='S' || c2=='C' || c2=='&') && filesp==files)
-       tbl();
-else if(c1=='T' && c2=='E')
-       intable = NO;
-else if(!inmacro && c1=='d' && c2=='e')
-       macro();
-else if(!inmacro && c1=='i' && c2=='g')
-       macro();
-else if(!inmacro && c1=='a' && c2 == 'm')
-       macro();
-else if(c1=='s' && c2=='o')
-       {
-       getfname();
-       if( fname[0] )
-               infile = *++filesp = opn( fname );
-       }
-else if(c1=='n' && c2=='x')
-       {
-       getfname();
-       if(fname[0] == '\0') exit(0);
-       if(infile != stdin)
-               fclose(infile);
-       infile = *filesp = opn(fname);
-       }
-else if(c1=='h' && c2=='w')
-       { SKIP; }
-else
-       {
-       if(c1=='.' && c2=='.')
-               while(C == '.')
-                       ;
-       ++inmacro;
-       regline(YES);
-       --inmacro;
-       }
-}
-
-
-
-macro()
-{
-/*
-do { SKIP; }
-       while(C!='.' || C!='.' || C=='.');      /* look for  .. */
-SKIP;
-inmacro = YES;
-}
-
-
-
-
-tbl()
-{
-while(C != '.');
-SKIP;
-intable = YES;
-}
-
-eqn()
-{
-register int c1, c2;
-
-SKIP;
-
-for( ;;)
-       {
-       if(C == '.'  || c == '\'')
-               {
-               while(C==' ' || c=='\t')
-                       ;
-               if(c=='E' && C=='N')
-                       {
-                       SKIP;
-                       return;
-                       }
-               }
-       else if(c == 'd')       /* look for delim */
-               {
-               if(C=='e' && C=='l')
-                   if( C=='i' && C=='m')
-                       {
-                       while(C1 == ' ');
-                       if((c1=c)=='\n' || (c2=C1)=='\n'
-                           || (c1=='o' && c2=='f' && C1=='f') )
-                               {
-                               ldelim = NOCHAR;
-                               rdelim = NOCHAR;
-                               }
-                       else    {
-                               ldelim = c1;
-                               rdelim = c2;
-                               }
-                       }
-               }
-
-       if(c != '\n')  SKIP;
-       }
-}
-
-\f
-
-backsl()       /* skip over a complete backslash construction */
-{
-int bdelim;
-
-sw:  switch(C)
-       {
-       case '"':
-               SKIP;
-               return;
-       case 's':
-               if(C == '\\') backsl();
-               else    {
-                       while(C>='0' && c<='9') ;
-                       ungetc(c,infile);
-                       c = '0';
-                       }
-               --lp;
-               return;
-
-       case 'f':
-       case 'n':
-       case '*':
-               if(C != '(')
-                       return;
-
-       case '(':
-               if(C != '\n') C;
-               return;
-
-       case '$':
-               C;      /* discard argument number */
-               return;
-
-       case 'b':
-       case 'x':
-       case 'v':
-       case 'h':
-       case 'w':
-       case 'o':
-       case 'l':
-       case 'L':
-               if( (bdelim=C) == '\n')
-                       return;
-               while(C!='\n' && c!=bdelim)
-                       if(c == '\\') backsl();
-               return;
-
-       case '\\':
-               if(inmacro)
-                       goto sw;
-       default:
-               return;
-       }
-}
-
-
-
-
-char *copys(s)
-register char *s;
-{
-register char *t, *t0;
-
-if( (t0 = t = calloc( strlen(s)+1, sizeof(*t) ) ) == NULL)
-       fatal("Cannot allocate memory", (char *) NULL);
-
-while( *t++ = *s++ )
-       ;
-return(t0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/df.c b/.ref-Research-V7/usr/src/cmd/df.c
deleted file mode 100644 (file)
index b773b77..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/filsys.h>
-#include <sys/fblk.h>
-
-daddr_t        blkno   = 1;
-char   *dargv[] = {
-       0,
-       "/dev/rp0",
-       "/dev/rp3",
-       0
-};
-
-
-struct filsys sblock;
-
-int    fi;
-daddr_t        alloc();
-
-main(argc, argv)
-char **argv;
-{
-       int i;
-
-       if(argc <= 1) {
-               for(argc = 1; dargv[argc]; argc++);
-               argv = dargv;
-       }
-
-       for(i=1; i<argc; i++) {
-               dfree(argv[i]);
-       }
-}
-
-dfree(file)
-char *file;
-{
-       daddr_t i;
-
-       fi = open(file, 0);
-       if(fi < 0) {
-               fprintf(stderr,"cannot open %s\n", file);
-               return;
-       }
-       sync();
-       bread(1L, (char *)&sblock, sizeof(sblock));
-       i = 0;
-       while(alloc())
-               i++;
-       printf("%s %D\n", file, i);
-       close(fi);
-}
-
-daddr_t
-alloc()
-{
-       int i;
-       daddr_t b;
-       struct fblk buf;
-
-       i = --sblock.s_nfree;
-       if(i<0 || i>=NICFREE) {
-               printf("bad free count, b=%D\n", blkno);
-               return(0);
-       }
-       b = sblock.s_free[i];
-       if(b == 0)
-               return(0);
-       if(b<sblock.s_isize || b>=sblock.s_fsize) {
-               printf("bad free block (%D)\n", b);
-               return(0);
-       }
-       if(sblock.s_nfree <= 0) {
-               bread(b, (char *)&buf, sizeof(buf));
-               blkno = b;
-               sblock.s_nfree = buf.df_nfree;
-               for(i=0; i<NICFREE; i++)
-                       sblock.s_free[i] = buf.df_free[i];
-       }
-       return(b);
-}
-
-bread(bno, buf, cnt)
-daddr_t bno;
-char *buf;
-{
-       int n;
-       extern errno;
-
-       lseek(fi, bno<<BSHIFT, 0);
-       if((n=read(fi, buf, cnt)) != cnt) {
-               printf("read error %D\n", bno);
-               printf("count = %d; errno = %d\n", n, errno);
-               exit(0);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/diff.c b/.ref-Research-V7/usr/src/cmd/diff.c
deleted file mode 100644 (file)
index 5620965..0000000
+++ /dev/null
@@ -1,645 +0,0 @@
-#
-/*     diff - differential file comparison
-*
-*      Uses an algorithm due to Harold Stone, which finds
-*      a pair of longest identical subsequences in the two
-*      files.
-*
-*      The major goal is to generate the match vector J.
-*      J[i] is the index of the line in file1 corresponding
-*      to line i file0. J[i] = 0 if there is no
-*      such line in file1.
-*
-*      Lines are hashed so as to work in core. All potential
-*      matches are located by sorting the lines of each file
-*      on the hash (called value\b\b\b\b\b_____). In particular, this
-*      collects the equivalence classes in file1 together.
-*      Subroutine equiv\b\b\b\b____  replaces the value of each line in
-*      file0 by the index of the first element of its 
-*      matching equivalence in (the reordered) file1.
-*      To save space equiv\b\b\b\b\b_____ squeezes file1 into a single
-*      array member\b\b\b\b\b\b______ in which the equivalence classes
-*      are simply concatenated, except that their first
-*      members are flagged by changing sign.
-*
-*      Next the indices that point into member\b\b\b\b\b\b______ are unsorted\b\b\b\b\b\b\b\b_______   into
-*      array class\b\b\b\b\b_____ according to the original order of file0.
-*
-*      The cleverness lies in routine stone\b\b\b\b\b______. This marches
-*      through the lines of file0, developing a vector klist\b\b\b\b\b_____
-*      of "k-candidates". At step i a k-candidate is a matched
-*      pair of lines x,y (x in file0 y in file1) such that
-*      there is a common subsequence of lenght k
-*      between the first i lines of file0 and the first y 
-*      lines of file1, but there is no such subsequence for
-*      any smaller y. x is the earliest possible mate to y
-*      that occurs in such a subsequence.
-*
-*      Whenever any of the members of the equivalence class of
-*      lines in file1 matable to a line in file0 has serial number 
-*      less than the y of some k-candidate, that k-candidate 
-*      with the smallest such y is replaced. The new 
-*      k-candidate is chained (via pred\b\b\b\b____) to the current
-*      k-1 candidate so that the actual subsequence can
-*      be recovered. When a member has serial number greater
-*      that the y of all k-candidates, the klist is extended.
-*      At the end, the longest subsequence is pulled out
-*      and placed in the array J by unravel\b\b\b\b\b\b\b_______.
-*
-*      With J in hand, the matches there recorded are
-*      check\b\b\b\b\b_____ed against reality to assure that no spurious
-*      matches have crept in due to hashing. If they have,
-*      they are broken, and "jackpot " is recorded--a harmless
-*      matter except that a true match for a spuriously
-*      mated line may now be unnecessarily reported as a change.
-*
-*      Much of the complexity of the program comes simply
-*      from trying to minimize core utilization and
-*      maximize the range of doable problems by dynamically
-*      allocating what is needed and reusing what is not.
-*      The core requirements for problems larger than somewhat
-*      are (in words) 2*length(file0) + length(file1) +
-*      3*(number of k-candidates installed),  typically about
-*      6n words for files of length n. 
-*/
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#define        prints(s)       fputs(s,stdout)
-
-#define HALFLONG 16
-#define low(x) (x&((1L<<HALFLONG)-1))
-#define high(x)        (x>>HALFLONG)
-FILE *input[2];
-FILE *fopen();
-
-struct cand {
-       int x;
-       int y;
-       int pred;
-} cand;
-struct line {
-       int serial;
-       int value;
-} *file[2], line;
-int len[2];
-struct line *sfile[2]; /*shortened by pruning common prefix and suffix*/
-int slen[2];
-int pref, suff;        /*length of prefix and suffix*/
-int *class;    /*will be overlaid on file[0]*/
-int *member;   /*will be overlaid on file[1]*/
-int *klist;            /*will be overlaid on file[0] after class*/
-struct cand *clist;    /* merely a free storage pot for candidates */
-int clen = 0;
-int *J;                /*will be overlaid on class*/
-long *ixold;   /*will be overlaid on klist*/
-long *ixnew;   /*will be overlaid on file[1]*/
-int opt;       /* -1,0,1 = -e,normal,-f */
-int status = 2;
-int anychange = 0;
-char *empty = "";
-int bflag;
-
-char *tempfile;        /*used when comparing against std input*/
-char *mktemp();
-char *dummy;   /*used in resetting storage search ptr*/
-
-done()
-{
-       unlink(tempfile);
-       exit(status);
-}
-
-char *talloc(n)
-{
-       extern char *malloc();
-       register char *p;
-       p = malloc((unsigned)n);
-       if(p!=NULL)
-               return(p);
-       noroom();
-}
-
-char *ralloc(p,n)      /*compacting reallocation */
-char *p;
-{
-       register char *q;
-       char *realloc();
-       free(p);
-       free(dummy);
-       dummy = malloc(1);
-       q = realloc(p, (unsigned)n);
-       if(q==NULL)
-               noroom();
-       return(q);
-}
-
-noroom()
-{
-       mesg("files too big, try -h\n",empty);
-       done();
-}
-
-sort(a,n)      /*shellsort CACM #201*/
-struct line *a;
-{
-       struct line w;
-       register int j,m;
-       struct line *ai;
-       register struct line *aim;
-       int k;
-       for(j=1;j<=n;j*= 2)
-               m = 2*j - 1;
-       for(m/=2;m!=0;m/=2) {
-               k = n-m;
-               for(j=1;j<=k;j++) {
-                       for(ai = &a[j]; ai > a; ai -= m) {
-                               aim = &ai[m];
-                               if(aim < ai)
-                                       break;  /*wraparound*/
-                               if(aim->value > ai[0].value ||
-                                  aim->value == ai[0].value &&
-                                  aim->serial > ai[0].serial)
-                                       break;
-                               w.value = ai[0].value;
-                               ai[0].value = aim->value;
-                               aim->value = w.value;
-                               w.serial = ai[0].serial;
-                               ai[0].serial = aim->serial;
-                               aim->serial = w.serial;
-                       }
-               }
-       }
-}
-
-unsort(f, l, b)
-struct line *f;
-int *b;
-{
-       register int *a;
-       register int i;
-       a = (int *)talloc((l+1)*sizeof(int));
-       for(i=1;i<=l;i++)
-               a[f[i].serial] = f[i].value;
-       for(i=1;i<=l;i++)
-               b[i] = a[i];
-       free((char *)a);
-}
-
-filename(pa1, pa2)
-char **pa1, **pa2;
-{
-       register char *a1, *b1, *a2;
-       char buf[512];
-       struct stat stbuf;
-       int i, f;
-       a1 = *pa1;
-       a2 = *pa2;
-       if(stat(a1,&stbuf)!=-1 && ((stbuf.st_mode&S_IFMT)==S_IFDIR)) {
-               b1 = *pa1 = malloc(100);
-               while(*b1++ = *a1++) ;
-               b1[-1] = '/';
-               a1 = b1;
-               while(*a1++ = *a2++)
-                       if(*a2 && *a2!='/' && a2[-1]=='/')
-                               a1 = b1;
-       }
-       else if(a1[0]=='-'&&a1[1]==0&&tempfile==0) {
-               signal(SIGHUP,done);
-               signal(SIGINT,done);
-               signal(SIGPIPE,done);
-               signal(SIGTERM,done);
-               *pa1 = tempfile = mktemp("/tmp/dXXXXX");
-               if((f=creat(tempfile,0600)) < 0) {
-                       mesg("cannot create ",tempfile);
-                       done();
-               }
-               while((i=read(0,buf,512))>0)
-                       write(f,buf,i);
-               close(f);
-       }
-}
-
-prepare(i, arg)
-char *arg;
-{
-       register struct line *p;
-       register j,h;
-       if((input[i] = fopen(arg,"r")) == NULL){
-               mesg("cannot open ", arg);
-               done();
-       }
-       p = (struct line *)talloc(3*sizeof(line));
-       for(j=0; h=readhash(input[i]);) {
-               p = (struct line *)ralloc((char *)p,(++j+3)*sizeof(line));
-               p[j].value = h;
-       }
-       len[i] = j;
-       file[i] = p;
-       fclose(input[i]);
-}
-
-prune()
-{
-       register i,j;
-       for(pref=0;pref<len[0]&&pref<len[1]&&
-               file[0][pref+1].value==file[1][pref+1].value;
-               pref++ ) ;
-       for(suff=0;suff<len[0]-pref&&suff<len[1]-pref&&
-               file[0][len[0]-suff].value==file[1][len[1]-suff].value;
-               suff++) ;
-       for(j=0;j<2;j++) {
-               sfile[j] = file[j]+pref;
-               slen[j] = len[j]-pref-suff;
-               for(i=0;i<=slen[j];i++)
-                       sfile[j][i].serial = i;
-       }
-}
-
-equiv(a,n,b,m,c)
-struct line *a, *b;
-int *c;
-{
-       register int i, j;
-       i = j = 1;
-       while(i<=n && j<=m) {
-               if(a[i].value <b[j].value)
-                       a[i++].value = 0;
-               else if(a[i].value == b[j].value)
-                       a[i++].value = j;
-               else
-                       j++;
-       }
-       while(i <= n)
-               a[i++].value = 0;
-       b[m+1].value = 0;
-       j = 0;
-       while(++j <= m) {
-               c[j] = -b[j].serial;
-               while(b[j+1].value == b[j].value) {
-                       j++;
-                       c[j] = b[j].serial;
-               }
-       }
-       c[j] = -1;
-}
-
-main(argc, argv)
-char **argv;
-{
-       register int k;
-       char **args;
-
-       args = argv;
-       if(argc>3 && *argv[1]=='-') {
-               argc--;
-               argv++;
-               for(k=1;argv[0][k];k++) {
-                       switch(argv[0][k]) {
-                       case 'e':
-                               opt = -1;
-                               break;
-                       case 'f':
-                               opt = 1;
-                               break;
-                       case 'b':
-                               bflag = 1;
-                               break;
-                       case 'h':
-                               execv("/usr/lib/diffh",args);
-                               mesg("cannot find diffh",empty);
-                               done();
-                       }
-               }
-       }
-       if(argc!=3) {
-               mesg("arg count",empty);
-               done();
-       }
-       dummy = malloc(1);
-
-       filename(&argv[1], &argv[2]);
-       filename(&argv[2], &argv[1]);
-       prepare(0, argv[1]);
-       prepare(1, argv[2]);
-       prune();
-       sort(sfile[0],slen[0]);
-       sort(sfile[1],slen[1]);
-
-       member = (int *)file[1];
-       equiv(sfile[0], slen[0], sfile[1], slen[1], member);
-       member = (int *)ralloc((char *)member,(slen[1]+2)*sizeof(int));
-
-       class = (int *)file[0];
-       unsort(sfile[0], slen[0], class);
-       class = (int *)ralloc((char *)class,(slen[0]+2)*sizeof(int));
-
-       klist = (int *)talloc((slen[0]+2)*sizeof(int));
-       clist = (struct cand *)talloc(sizeof(cand));
-       k = stone(class, slen[0], member, klist);
-       free((char *)member);
-       free((char *)class);
-
-       J = (int *)talloc((len[0]+2)*sizeof(int));
-       unravel(klist[k]);
-       free((char *)clist);
-       free((char *)klist);
-
-       ixold = (long *)talloc((len[0]+2)*sizeof(long));
-       ixnew = (long *)talloc((len[1]+2)*sizeof(long));
-       check(argv);
-       output(argv);
-       status = anychange;
-       done();
-}
-
-stone(a,n,b,c)
-int *a;
-int *b;
-int *c;
-{
-       register int i, k,y;
-       int j, l;
-       int oldc, tc;
-       int oldl;
-       k = 0;
-       c[0] = newcand(0,0,0);
-       for(i=1; i<=n; i++) {
-               j = a[i];
-               if(j==0)
-                       continue;
-               y = -b[j];
-               oldl = 0;
-               oldc = c[0];
-               do {
-                       if(y <= clist[oldc].y)
-                               continue;
-                       l = search(c, k, y);
-                       if(l!=oldl+1)
-                               oldc = c[l-1];
-                       if(l<=k) {
-                               if(clist[c[l]].y <= y)
-                                       continue;
-                               tc = c[l];
-                               c[l] = newcand(i,y,oldc);
-                               oldc = tc;
-                               oldl = l;
-                       } else {
-                               c[l] = newcand(i,y,oldc);
-                               k++;
-                               break;
-                       }
-               } while((y=b[++j]) > 0);
-       }
-       return(k);
-}
-
-newcand(x,y,pred)
-{
-       register struct cand *q;
-       clist = (struct cand *)ralloc((char *)clist,++clen*sizeof(cand));
-       q = clist + clen -1;
-       q->x = x;
-       q->y = y;
-       q->pred = pred;
-       return(clen-1);
-}
-
-search(c, k, y)
-int *c;
-{
-       register int i, j, l;
-       int t;
-       if(clist[c[k]].y<y)     /*quick look for typical case*/
-               return(k+1);
-       i = 0;
-       j = k+1;
-       while((l=(i+j)/2) > i) {
-               t = clist[c[l]].y;
-               if(t > y)
-                       j = l;
-               else if(t < y)
-                       i = l;
-               else
-                       return(l);
-       }
-       return(l+1);
-}
-
-unravel(p)
-{
-       register int i;
-       register struct cand *q;
-       for(i=0; i<=len[0]; i++)
-               J[i] =  i<=pref ? i:
-                       i>len[0]-suff ? i+len[1]-len[0]:
-                       0;
-       for(q=clist+p;q->y!=0;q=clist+q->pred)
-               J[q->x+pref] = q->y+pref;
-}
-
-/* check does double duty:
-1.  ferret out any fortuitous correspondences due
-to confounding by hashing (which result in "jackpot")
-2.  collect random access indexes to the two files */
-
-check(argv)
-char **argv;
-{
-       register int i, j;
-       int jackpot;
-       long ctold, ctnew;
-       char c,d;
-       input[0] = fopen(argv[1],"r");
-       input[1] = fopen(argv[2],"r");
-       j = 1;
-       ixold[0] = ixnew[0] = 0;
-       jackpot = 0;
-       ctold = ctnew = 0;
-       for(i=1;i<=len[0];i++) {
-               if(J[i]==0) {
-                       ixold[i] = ctold += skipline(0);
-                       continue;
-               }
-               while(j<J[i]) {
-                       ixnew[j] = ctnew += skipline(1);
-                       j++;
-               }
-               for(;;) {
-                       c = getc(input[0]);
-                       d = getc(input[1]);
-                       ctold++;
-                       ctnew++;
-                       if(bflag && isspace(c) && isspace(d)) {
-                               do {
-                                       if(c=='\n') break;
-                                       ctold++;
-                               } while(isspace(c=getc(input[0])));
-                               do {
-                                       if(d=='\n') break;
-                                       ctnew++;
-                               } while(isspace(d=getc(input[1])));
-                       }
-                       if(c!=d) {
-                               jackpot++;
-                               J[i] = 0;
-                               if(c!='\n')
-                                       ctold += skipline(0);
-                               if(d!='\n')
-                                       ctnew += skipline(1);
-                               break;
-                       }
-                       if(c=='\n')
-                               break;
-               }
-               ixold[i] = ctold;
-               ixnew[j] = ctnew;
-               j++;
-       }
-       for(;j<=len[1];j++) {
-               ixnew[j] = ctnew += skipline(1);
-       }
-       fclose(input[0]);
-       fclose(input[1]);
-/*
-       if(jackpot)
-               mesg("jackpot",empty);
-*/
-}
-
-skipline(f)
-{
-       register i;
-       for(i=1;getc(input[f])!='\n';i++) ;
-       return(i);
-}
-
-output(argv)
-char **argv;
-{
-       int m;
-       register int i0, i1, j1;
-       int j0;
-       input[0] = fopen(argv[1],"r");
-       input[1] = fopen(argv[2],"r");
-       m = len[0];
-       J[0] = 0;
-       J[m+1] = len[1]+1;
-       if(opt!=-1) for(i0=1;i0<=m;i0=i1+1) {
-               while(i0<=m&&J[i0]==J[i0-1]+1) i0++;
-               j0 = J[i0-1]+1;
-               i1 = i0-1;
-               while(i1<m&&J[i1+1]==0) i1++;
-               j1 = J[i1+1]-1;
-               J[i1] = j1;
-               change(i0,i1,j0,j1);
-       } else for(i0=m;i0>=1;i0=i1-1) {
-               while(i0>=1&&J[i0]==J[i0+1]-1&&J[i0]!=0) i0--;
-               j0 = J[i0+1]-1;
-               i1 = i0+1;
-               while(i1>1&&J[i1-1]==0) i1--;
-               j1 = J[i1-1]+1;
-               J[i1] = j1;
-               change(i1,i0,j1,j0);
-       }
-       if(m==0)
-               change(1,0,1,len[1]);
-}
-
-change(a,b,c,d)
-{
-       if(a>b&&c>d) return;
-       anychange = 1;
-       if(opt!=1) {
-               range(a,b,",");
-               putchar(a>b?'a':c>d?'d':'c');
-               if(opt!=-1) range(c,d,",");
-       } else {
-               putchar(a>b?'a':c>d?'d':'c');
-               range(a,b," ");
-       }
-       putchar('\n');
-       if(opt==0) {
-               fetch(ixold,a,b,input[0],"< ");
-               if(a<=b&&c<=d) prints("---\n");
-       }
-       fetch(ixnew,c,d,input[1],opt==0?"> ":empty);
-       if(opt!=0&&c<=d) prints(".\n");
-}
-
-range(a,b,separator)
-char *separator;
-{
-       printf("%d", a>b?b:a);
-       if(a<b) {
-               printf("%s%d", separator, b);
-       }
-}
-
-fetch(f,a,b,lb,s)
-long *f;
-FILE *lb;
-char *s;
-{
-       register int i, j;
-       register int nc;
-       for(i=a;i<=b;i++) {
-               fseek(lb,f[i-1],0);
-               nc = f[i]-f[i-1];
-               prints(s);
-               for(j=0;j<nc;j++)
-                       putchar(getc(lb));
-       }
-}
-
-/* hashing has the effect of
- * arranging line in 7-bit bytes and then
- * summing 1-s complement in 16-bit hunks 
-*/
-
-readhash(f)
-FILE *f;
-{
-       long sum;
-       register unsigned shift;
-       register space;
-       register t;
-       sum = 1;
-       space = 0;
-       if(!bflag) for(shift=0;(t=getc(f))!='\n';shift+=7) {
-               if(t==-1)
-                       return(0);
-               sum += (long)t << (shift%=HALFLONG);
-       }
-       else for(shift=0;;) {
-               switch(t=getc(f)) {
-               case -1:
-                       return(0);
-               case '\t':
-               case ' ':
-                       space++;
-                       continue;
-               default:
-                       if(space) {
-                               shift += 7;
-                               space = 0;
-                       }
-                       sum += (long)t << (shift%=HALFLONG);
-                       shift += 7;
-                       continue;
-               case '\n':
-                       break;
-               }
-               break;
-       }
-       sum = low(sum) + high(sum);
-       return((short)low(sum) + (short)high(sum));
-}
-
-mesg(s,t)
-char *s, *t;
-{
-       fprintf(stderr,"diff: %s%s\n",s,t);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/diff3.c b/.ref-Research-V7/usr/src/cmd/diff3.c
deleted file mode 100644 (file)
index 0983b6f..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-#include <stdio.h>
-#
-
-/* diff3 - 3-way differential file comparison*/
-
-/* diff3 [-e] d13 d23 f1 f2 f3 
- *
- * d13 = diff report on f1 vs f3
- * d23 = diff report on f2 vs f3
- * f1, f2, f3 the 3 files
-*/
-
-struct  range {int from,to; };
-       /* from is first in range of changed lines
-        * to is last+1
-        * from=to=line after point of insertion
-       * for added lines
-       */
-struct diff {struct range old, new;};
-
-#define NC 200
-/* de is used to gather editing scripts,
- * that are later spewed out in reverse order.
- * its first element must be all zero
- * the "new" component of de contains line positions
- * or byte positions depending on when you look(!?)
-*/
-struct diff d13[NC];
-struct diff d23[NC];
-struct diff de[NC];
-char line[256];
-FILE *fp[3];
-int linct[3] = {0,0,0};
-/*     the number of the last-read line in each file
- *     is kept in cline[0-2]
-*/
-int cline[3];
-/*     the latest known correspondence between line
- *     numbers of the 3 files is stored in last[1-3]
-*/
-int last[4];
-int eflag;
-int debug  = 0;
-
-main(argc,argv)
-char **argv;
-{
-       register i,m,n;
-       if(*argv[1]=='-') {
-               switch(argv[1][1]) {
-               default:
-                       eflag = 3;
-                       break;
-               case '3':
-                       eflag = 2;
-                       break;
-               case 'x':
-                       eflag = 1;
-               }
-               argv++;
-               argc--;
-       }
-       if(argc<6) {
-               fprintf(stderr,"diff3: arg count\n");
-               exit(1);
-       }
-       m = readin(argv[1],d13);
-       n = readin(argv[2],d23);
-       for(i=0;i<=2;i++)
-               if((fp[i] = fopen(argv[i+3],"r")) == NULL) {
-                       printf("diff3: can't open %s\n",argv[i+3]);
-                       exit(1);
-               }
-       merge(m,n);
-}
-
-/*pick up the line numbers of allcahnges from
- * one change file
- * (this puts the numbers in a vector, which is not
- * strictly necessary, since the vector is processed
- * in one sequential pass. The vector could be optimized
- * out of existence)
-*/
-
-readin(name,dd)
-char *name;
-struct diff *dd;
-{
-       register i;
-       int a,b,c,d;
-       char kind;
-       char *p;
-       fp[0] = fopen(name,"r");
-       for(i=0;getchange(fp[0]);i++) {
-               if(i>=NC) {
-                       fprintf(stderr,"diff3: too many changes\n");
-                       exit(0);
-               }
-               p = line;
-               a = b = number(&p);
-               if(*p==',') {
-                       p++;
-                       b = number(&p);
-               }
-               kind = *p++;
-               c = d = number(&p);
-               if(*p==',') {
-                       p++;
-                       d = number(&p);
-               }
-               if(kind=='a')
-                       a++;
-               if(kind=='d')
-                       c++;
-               b++;
-               d++;
-               dd[i].old.from = a;
-               dd[i].old.to = b;
-               dd[i].new.from = c;
-               dd[i].new.to = d;
-       }
-       dd[i].old.from = dd[i-1].old.to;
-       dd[i].new.from = dd[i-1].new.to;
-       fclose(fp[0]);
-       return(i);
-}
-
-number(lc)
-char **lc;
-{
-       register nn;
-       nn = 0;
-       while(digit(**lc))
-               nn = nn*10 + *(*lc)++ - '0';
-       return(nn);
-}
-
-digit(c)
-{
-       return(c>='0'&&c<='9');
-}
-
-getchange(b)
-FILE *b;
-{
-       while(getline(b))
-               if(digit(line[0]))
-                       return(1);
-       return(0);
-}
-
-getline(b)
-FILE *b;
-{
-       register i, c;
-       for(i=0;i<sizeof(line)-1;i++) {
-               c = getc(b);
-               if(c==EOF)
-                       break;
-               line[i] = c;
-               if(c=='\n') {
-                       line[++i] = 0;
-                       return(i);
-               }
-       }
-       return(0);
-}
-
-merge(m1,m2)
-{
-       register struct diff *d1, *d2, *d3;
-       int dup;
-       int j;
-       int t1,t2;
-       d1 = d13;
-       d2 = d23;
-       j = 0;
-       for(;(t1 = d1<d13+m1) | (t2 = d2<d23+m2);) {
-               if(debug) {
-                       printf("%d,%d=%d,%d %d,%d=%d,%d\n",
-                       d1->old.from,d1->old.to,
-                       d1->new.from,d1->new.to,
-                       d2->old.from,d2->old.to,
-                       d2->new.from,d2->new.to);
-               }
-/*                     first file is different from others*/
-               if(!t2||t1&&d1->new.to < d2->new.from) {
-/*                     stuff peculiar to 1st file */
-                       if(eflag==0) {
-                               separate("1");
-                               change(1,&d1->old,0);
-                               keep(2,&d1->old,&d1->new);
-                               change(3,&d1->new,0);
-                       }
-                       d1++;
-                       continue;
-               }
-/*                     second file is different from others*/
-               if(!t1||t2&&d2->new.to < d1->new.from) {
-                       if(eflag==0) {
-                               separate("2");
-                               keep(1,&d2->old,&d2->new);
-                               change(2,&d2->old,0);
-                               change(3,&d2->new,0);
-                       }
-                       d2++;
-                       continue;
-               }
-/*                     merge overlapping changes in first file
- *                     this happens after extension see below*/
-               if(d1+1<d13+m1 &&
-                  d1->new.to>=d1[1].new.from) {
-                       d1[1].old.from = d1->old.from;
-                       d1[1].new.from = d1->new.from;
-                       d1++;
-                       continue;
-               }
-/*                     merge overlapping changes in second*/
-               if(d2+1<d23+m2 &&
-                  d2->new.to>=d2[1].new.from) {
-                       d2[1].old.from = d2->old.from;
-                       d2[1].new.from = d2->new.from;
-                       d2++;
-                       continue;
-               }
-/*                     stuff peculiar to third file or different in all*/
-               if(d1->new.from==d2->new.from&&
-                  d1->new.to==d2->new.to) {
-                       dup = duplicate(&d1->old,&d2->old);
-/*                             dup=0 means all files differ
- *                             dup =1 meands files 1&2 identical*/
-                       if(eflag==0) {
-                               separate(dup?"3":"");
-                               change(1,&d1->old,dup);
-                               change(2,&d2->old,0);
-                               d3 = d1->old.to>d1->old.from?d1:d2;
-                               change(3,&d3->new,0);
-                       } else
-                               j = edit(d1,dup,j);
-                       d1++;
-                       d2++;
-                       continue;
-               }
-/*                     overlapping changes from file1 & 2
- *                     extend changes appropriately to
- *                     make them coincide*/
-                if(d1->new.from<d2->new.from) {
-                       d2->old.from -= d2->new.from-d1->new.from;
-                       d2->new.from = d1->new.from;
-               }
-               else if(d2->new.from<d1->new.from) {
-                       d1->old.from -= d1->new.from-d2->new.from;
-                       d1->new.from = d2->new.from;
-               }
-               if(d1->new.to >d2->new.to) {
-                       d2->old.to += d1->new.to - d2->new.to;
-                       d2->new.to = d1->new.to;
-               }
-               else if(d2->new.to >d1->new.to) {
-                       d1->old.to += d2->new.to - d1->new.to;
-                       d1->new.to = d2->new.to;
-               }
-       }
-       if(eflag)
-               edscript(j);
-}
-
-separate(s)
-char *s;
-{
-       printf("====%s\n",s);
-}
-
-/*     the range of ines rold.from thru rold.to in file i
- *     is to be changed. it is to be printed only if
- *     it does not duplicate something to be printed later
-*/
-change(i,rold,dup)
-struct range *rold;
-{
-       printf("%d:",i);
-       last[i] = rold->to;
-       prange(rold);
-       if(dup)
-               return;
-       if(debug)
-               return;
-       i--;
-       skip(i,rold->from,(char *)0);
-       skip(i,rold->to,"  ");
-}
-
-/*     print the range of line numbers, rold.from  thru rold.to
- *     as n1,n2 or n1
-*/
-prange(rold)
-struct range *rold;
-{
-       if(rold->to<=rold->from)
-               printf("%da\n",rold->from-1);
-       else {
-               printf("%d",rold->from);
-               if(rold->to > rold->from+1)
-                       printf(",%d",rold->to-1);
-               printf("c\n");
-       }
-}
-
-/*     no difference was reported by diff between file 1(or 2)
- *     and file 3, and an artificial dummy difference (trange)
- *     must be ginned up to correspond to the change reported
- *     in the other file
-*/
-keep(i,rold,rnew)
-struct range *rold, *rnew;
-{
-       register delta;
-       struct range trange;
-       delta = last[3] - last[i];
-       trange.from = rnew->from - delta;
-       trange.to = rnew->to - delta;
-       change(i,&trange,1);
-}
-
-/*     skip to just befor line number from in file i
- *     if "pr" is nonzero, print all skipped stuff
- * w   with string pr as a prefix
-*/
-skip(i,from,pr)
-char *pr;
-{
-       register j,n;
-       for(n=0;cline[i]<from-1;n+=j) {
-               if((j=getline(fp[i]))==0)
-                       trouble();
-               if(pr)
-                       printf("%s%s",pr,line);
-               cline[i]++;
-       }
-       return(n);
-}
-
-/*     return 1 or 0 according as the old range
- *     (in file 1) contains exactly the same data
- *     as the new range (in file 2)
-*/
-duplicate(r1,r2)
-struct range *r1, *r2;
-{
-       register c,d;
-       register nchar;
-       int nline;
-       if(r1->to-r1->from != r2->to-r2->from)
-               return(0);
-       skip(0,r1->from,(char *)0);
-       skip(1,r2->from,(char *)0);
-       nchar = 0;
-       for(nline=0;nline<r1->to-r1->from;nline++) {
-               do {
-                       c = getc(fp[0]);
-                       d = getc(fp[1]);
-                       if(c== -1||d== -1)
-                               trouble();
-                       nchar++;
-                       if(c!=d) {
-                               repos(nchar);
-                               return;
-                       }
-               } while(c!= '\n');
-       }
-       repos(nchar);
-       return(1);
-}
-
-repos(nchar)
-{
-       register i;
-       for(i=0;i<2;i++) 
-               fseek(fp[i], (long)-nchar, 1);
-}
-
-trouble()
-{
-       fprintf(stderr,"diff3: logic error\n");
-       abort();
-}
-
-/*     collect an editing script for later regurgitation
-*/
-edit(diff,dup,j)
-struct diff *diff;
-{
-       if(((dup+1)&eflag)==0)
-               return(j);
-       j++;
-       de[j].old.from = diff->old.from;
-       de[j].old.to = diff->old.to;
-       de[j].new.from = de[j-1].new.to
-           +skip(2,diff->new.from,(char *)0);
-       de[j].new.to = de[j].new.from
-           +skip(2,diff->new.to,(char *)0);
-       return(j);
-}
-
-/*             regurgitate */
-edscript(n)
-{
-       register j,k;
-       char block[512];
-       for(n=n;n>0;n--) {
-               prange(&de[n].old);
-               fseek(fp[2], (long)de[n].new.from, 0);
-               for(k=de[n].new.to-de[n].new.from;k>0;k-= j) {
-                       j = k>512?512:k;
-                       if(fread(block,1,j,fp[2])!=j)
-                               trouble();
-                       fwrite(block, 1, j, stdout);
-               }
-               printf(".\n");
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/diffh.c b/.ref-Research-V7/usr/src/cmd/diffh.c
deleted file mode 100644 (file)
index 2fb37c8..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#define C 3
-#define RANGE 30
-#define LEN 255
-#define INF 16384
-
-char *text[2][RANGE];
-long lineno[2] = {1, 1};       /*no. of 1st stored line in each file*/
-int ntext[2];          /*number of stored lines in each*/
-long n0,n1;            /*scan pointer in each*/
-int bflag;
-int debug = 0;
-FILE *file[2];
-
-       /* return pointer to line n of file f*/
-char *getl(f,n)
-long n;
-{
-       register char *t;
-       char *malloc();
-       register delta, nt;
-again:
-       delta = n - lineno[f];
-       nt = ntext[f];
-       if(delta<0)
-               progerr("1");
-       if(delta<nt)
-               return(text[f][delta]);
-       if(delta>nt)
-               progerr("2");
-       if(nt>=RANGE)
-               progerr("3");
-       if(feof(file[f]))
-               return(NULL);
-       t = text[f][nt];
-       if(t==0) {
-               t = text[f][nt] = malloc(LEN+1);
-               if(t==NULL)
-                       if(hardsynch())
-                               goto again;
-                       else
-                               progerr("5");
-       }
-       t = fgets(t,LEN,file[f]);
-       if(t!=NULL)
-               ntext[f]++;
-       return(t);
-}
-
-       /*remove thru line n of file f from storage*/
-clrl(f,n)
-long n;
-{
-       register i,j;
-       j = n-lineno[f]+1;
-       for(i=0;i+j<ntext[f];i++)
-               movstr(text[f][i+j],text[f][i]);
-       lineno[f] = n+1;
-       ntext[f] -= j;
-}
-
-movstr(s,t)
-register char *s, *t;
-{
-       while(*t++= *s++)
-               continue;
-}
-
-main(argc,argv)
-char **argv;
-{
-       char *s0,*s1;
-       FILE *dopen();
-       if(*argv[1]=='-') {
-               argc--;
-               argv++;
-               while(*++argv[0])
-                       if(*argv[0]=='b')
-                               bflag++;
-       }
-       if(argc!=3)
-               error("must have 2 file arguments","");
-       file[0] = dopen(argv[1],argv[2]);
-       file[1] = dopen(argv[2],argv[1]);
-       for(;;) {
-               s0 = getl(0,++n0);
-               s1 = getl(1,++n1);
-               if(s0==NULL||s1==NULL)
-                       break;
-               if(cmp(s0,s1)!=0) {
-                       if(!easysynch()&&!hardsynch())
-                               progerr("5");
-               } else {
-                       clrl(0,n0);
-                       clrl(1,n1);
-               }
-       }
-       if(s0==NULL&&s1==NULL)
-               return;
-       if(s0==NULL)
-               output(-1,INF);
-       if(s1==NULL)
-               output(INF,-1);
-}
-
-       /* synch on C successive matches*/
-easysynch()
-{
-       int i,j;
-       register k,m;
-       char *s0,*s1;
-       for(i=j=1;i<RANGE&&j<RANGE;i++,j++) {
-               s0 = getl(0,n0+i);
-               if(s0==NULL)
-                       return(output(INF,INF));
-               for(k=C-1;k<j;k++) {
-                       for(m=0;m<C;m++)
-                               if(cmp(getl(0,n0+i-m),
-                                       getl(1,n1+k-m))!=0)
-                                       goto cont1;
-                       return(output(i-C,k-C));
-cont1:                 ;
-               }
-               s1 = getl(1,n1+j);
-               if(s1==NULL)
-                       return(output(INF,INF));
-               for(k=C-1;k<=i;k++) {
-                       for(m=0;m<C;m++)
-                               if(cmp(getl(0,n0+k-m),
-                                       getl(1,n1+j-m))!=0)
-                                       goto cont2;
-                       return(output(k-C,j-C));
-cont2:                 ;
-               }
-       }
-       return(0);
-}
-
-output(a,b)
-{
-       register i;
-       char *s;
-       if(a<0)
-               change(n0-1,0,n1,b,"a");
-       else if(b<0)
-               change(n0,a,n1-1,0,"d");
-       else
-               change(n0,a,n1,b,"c");
-       for(i=0;i<=a;i++) {
-               s = getl(0,n0+i);
-               if(s==NULL)
-                       break;
-               printf("< %s",s);
-               clrl(0,n0+i);
-       }
-       n0 += i-1;
-       if(a>=0&&b>=0)
-               printf("---\n");
-       for(i=0;i<=b;i++) {
-               s = getl(1,n1+i);
-               if(s==NULL)
-                       break;
-               printf("> %s",s);
-               clrl(1,n1+i);
-       }
-       n1 += i-1;
-       return(1);
-}
-
-change(a,b,c,d,s)
-long a,c;
-char *s;
-{
-       range(a,b);
-       printf("%s",s);
-       range(c,d);
-       printf("\n");
-}
-
-range(a,b)
-long a;
-{
-       if(b==INF)
-               printf("%ld,$",a);
-       else if(b==0)
-               printf("%ld",a);
-       else
-               printf("%ld,%ld",a,a+b);
-}
-
-cmp(s,t)
-char *s,*t;
-{
-       if(debug)
-               printf("%s:%s\n",s,t);
-       for(;;){
-               if(bflag&&isspace(*s)&&isspace(*t)) {
-                       while(isspace(*++s)) ;
-                       while(isspace(*++t)) ;
-               }
-               if(*s!=*t||*s==0)
-                       break;
-               s++;
-               t++;
-       }
-       return(*s-*t);
-}
-
-FILE *dopen(f1,f2)
-char *f1,*f2;
-{
-       FILE *f;
-       char b[100],*bptr,*eptr;
-       struct stat statbuf;
-       if(cmp(f1,"-")==0)
-               if(cmp(f2,"-")==0)
-                       error("can't do - -","");
-               else
-                       return(stdin);
-       if(stat(f1,&statbuf)==-1)
-               error("can't access ",f1);
-       if((statbuf.st_mode&S_IFMT)==S_IFDIR) {
-               for(bptr=b;*bptr= *f1++;bptr++) ;
-               *bptr++ = '/';
-               for(eptr=f2;*eptr;eptr++)
-                       if(*eptr=='/'&&eptr[1]!=0&&eptr[1]!='/')
-                               f2 = eptr+1;
-               while(*bptr++= *f2++) ;
-               f1 = b;
-       }
-       f = fopen(f1,"r");
-       if(f==NULL)
-               error("can't open",f1);
-       return(f);
-}
-
-
-progerr(s)
-char *s;
-{
-       error("program error ",s);
-}
-
-error(s,t)
-char *s,*t;
-{
-       fprintf(stderr,"diffh: %s%s\n",s,t);
-       exit(1);
-}
-
-       /*stub for resychronization beyond limits of text buf*/
-hardsynch()
-{
-       change(n0,INF,n1,INF,"c");
-       printf("---change record omitted\n");
-       error("can't resynchronize","");
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/dmesg.c b/.ref-Research-V7/usr/src/cmd/dmesg.c
deleted file mode 100644 (file)
index eeff1f7..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *     Suck up system messages
- */
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <a.out.h>
-
-char   msgbuf[MSGBUFS];
-char   *msgbufp;
-int    sflg;
-int    of      = -1;
-
-struct {
-       char    *omsgflg;
-       int     omindex;
-       char    omsgbuf[MSGBUFS];
-} omesg;
-struct nlist nl[3] = {
-       {"_msgbuf"},
-       {"_msgbufp"}
-};
-
-main(argc, argv)
-char **argv;
-{
-       int mem;
-       register char *mp, *omp, *mstart;
-       int samef;
-
-       if (argc>1 && argv[1][0] == '-') {
-               sflg++;
-               argc--;
-               argv++;
-       }
-       if (sflg)
-               of = open("/usr/adm/msgbuf", 2);
-       read(of, (char *)&omesg, sizeof(omesg));
-       lseek(of, 0L, 0);
-       sflg = 0;
-       nlist(argc>2? argv[2]:"/unix", nl);
-       if (nl[0].n_type==0)
-               done("No namelist\n");
-       if ((mem = open((argc>1? argv[1]: "/dev/mem"), 0)) < 0)
-               done("No mem\n");
-       lseek(mem, (long)nl[0].n_value, 0);
-       read(mem, msgbuf, MSGBUFS);
-       lseek(mem, (long)nl[1].n_value, 0);
-       read(mem, (char *)&msgbufp, sizeof(msgbufp));
-       if (msgbufp < (char *)nl[0].n_value || msgbufp >= (char *)nl[0].n_value+MSGBUFS)
-               done("Namelist mismatch\n");
-       msgbufp += msgbuf - (char *)nl[0].n_value;
-       mstart = &msgbuf[omesg.omindex];
-       omp = &omesg.omsgbuf[msgbufp-msgbuf];
-       mp = msgbufp;
-       samef = 1;
-       do {
-               if (*mp++ != *omp++) {
-                       mstart = msgbufp;
-                       samef = 0;
-                       pdate();
-                       printf("...\n");
-                       break;
-               }
-               if (mp == &msgbuf[MSGBUFS])
-                       mp = msgbuf;
-               if (omp == &omesg.omsgbuf[MSGBUFS])
-                       omp = omesg.omsgbuf;
-       } while (mp != mstart);
-       if (samef && mstart == msgbufp)
-               exit(0);
-       mp = mstart;
-       do {
-               pdate();
-               if (*mp)
-                       putchar(*mp);
-               mp++;
-               if (mp == &msgbuf[MSGBUFS])
-                       mp = msgbuf;
-       } while (mp != msgbufp);
-       done((char *)NULL);
-}
-
-done(s)
-char *s;
-{
-       register char *p, *q;
-
-       if (s && s!=omesg.omsgflg && sflg==0) {
-               pdate();
-               printf(s);
-       }
-       omesg.omsgflg = s;
-       q = omesg.omsgbuf;
-       for (p = msgbuf; p < &msgbuf[MSGBUFS]; )
-               *q++ = *p++;
-       omesg.omindex = msgbufp - msgbuf;
-       write(of, (char *)&omesg, sizeof(omesg));
-       exit(s!=NULL);
-}
-
-pdate()
-{
-       extern char *ctime();
-       static firstime;
-       time_t tbuf;
-
-       if (firstime==0) {
-               firstime++;
-               time(&tbuf);
-               printf("\n%.12s\n", ctime(&tbuf)+4);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/du.c b/.ref-Research-V7/usr/src/cmd/du.c
deleted file mode 100644 (file)
index 10f4c12..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#define EQ(x,y)        (strcmp(x,y)==0)
-#define ML     1000
-
-struct stat Statb;
-char   path[256], name[256];
-int    Aflag = 0,
-       Sflag = 0,
-       Noarg = 0;
-struct {
-       int     dev,
-               ino;
-} ml[ML];
-long   descend();
-char   *rindex();
-char   *strcpy();
-
-main(argc, argv)
-char **argv;
-{
-       register        i = 1;
-       long    blocks = 0;
-       register char   *np;
-
-       if (argc>1) {
-               if(EQ(argv[i], "-s")) {
-                       ++i;
-                       ++Sflag;
-               } else if(EQ(argv[i], "-a")) {
-                       ++i;
-                       ++Aflag;
-               }
-       }
-       if(i == argc)
-               ++Noarg;
-
-       do {
-               strcpy(path, Noarg? ".": argv[i]);
-               strcpy(name, path);
-               if(np = rindex(name, '/')) {
-                       *np++ = '\0';
-                       if(chdir(*name? name: "/") == -1) {
-                               fprintf(stderr, "cannot chdir()\n");
-                               exit(1);
-                       }
-               } else
-                       np = path;
-               blocks = descend(path, *np? np: ".");
-               if(Sflag)
-                       printf("%ld     %s\n", blocks, path);
-       } while(++i < argc);
-
-       exit(0);
-}
-
-long
-descend(np, fname)
-char *np, *fname;
-{
-       int dir = 0, /* open directory */
-               offset,
-               dsize,
-               entries,
-               dirsize;
-
-       struct direct dentry[32];
-       register  struct direct *dp;
-       register char *c1, *c2;
-       int i;
-       char *endofname;
-       long blocks = 0;
-
-       if(stat(fname,&Statb)<0) {
-               fprintf(stderr, "--bad status < %s >\n", name);
-               return 0L;
-       }
-       if(Statb.st_nlink > 1 && (Statb.st_mode&S_IFMT)!=S_IFDIR) {
-               static linked = 0;
-
-               for(i = 0; i <= linked; ++i) {
-                       if(ml[i].ino==Statb.st_ino && ml[i].dev==Statb.st_dev)
-                               return 0;
-               }
-               if (linked < ML) {
-                       ml[linked].dev = Statb.st_dev;
-                       ml[linked].ino = Statb.st_ino;
-                       ++linked;
-               }
-       }
-       blocks = (Statb.st_size + BSIZE-1) >> BSHIFT;
-
-       if((Statb.st_mode&S_IFMT)!=S_IFDIR) {
-               if(Aflag)
-                       printf("%ld     %s\n", blocks, np);
-               return(blocks);
-       }
-
-       for(c1 = np; *c1; ++c1);
-       if(*(c1-1) == '/')
-               --c1;
-       endofname = c1;
-       dirsize = Statb.st_size;
-       if(chdir(fname) == -1)
-               return 0;
-       for(offset=0; offset < dirsize; offset += 512) { /* each block */
-               dsize = 512<(dirsize-offset)? 512: (dirsize-offset);
-               if(!dir) {
-                       if((dir=open(".",0))<0) {
-                               fprintf(stderr, "--cannot open < %s >\n",
-                                       np);
-                               goto ret;
-                       }
-                       if(offset) lseek(dir, (long)offset, 0);
-                       if(read(dir, (char *)dentry, dsize)<0) {
-                               fprintf(stderr, "--cannot read < %s >\n",
-                                       np);
-                               goto ret;
-                       }
-                       if(dir > 10) {
-                               close(dir);
-                               dir = 0;
-                       }
-               } else 
-                       if(read(dir, (char *)dentry, dsize)<0) {
-                               fprintf(stderr, "--cannot read < %s >\n",
-                                       np);
-                               goto ret;
-                       }
-               for(dp=dentry, entries=dsize>>4; entries; --entries, ++dp) {
-                       /* each directory entry */
-                       if(dp->d_ino==0
-                       || EQ(dp->d_name, ".")
-                       || EQ(dp->d_name, ".."))
-                               continue;
-                       c1 = endofname;
-                       *c1++ = '/';
-                       c2 = dp->d_name;
-                       for(i=0; i<DIRSIZ; ++i)
-                               if(*c2)
-                                       *c1++ = *c2++;
-                               else
-                                       break;
-                       *c1 = '\0';
-                       if(c1 == endofname) /* ?? */
-                               return 0L;
-                       blocks += descend(np, endofname+1);
-               }
-       }
-       *endofname = '\0';
-       if(!Sflag)
-               printf("%ld     %s\n", blocks, np);
-ret:
-       if(dir)
-               close(dir);
-       if(chdir("..") == -1) {
-               *endofname = '\0';
-               fprintf(stderr, "Bad directory <%s>\n", np);
-               while(*--endofname != '/');
-               *endofname = '\0';
-               if(chdir(np) == -1)
-                       exit(1);
-       }
-       return(blocks);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/dump.c b/.ref-Research-V7/usr/src/cmd/dump.c
deleted file mode 100644 (file)
index 986d424..0000000
+++ /dev/null
@@ -1,639 +0,0 @@
-#define        NI      16
-#define        DIRPB   (BSIZE/sizeof(struct direct))
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/inode.h>
-#include <sys/ino.h>
-#include <sys/fblk.h>
-#include <sys/filsys.h>
-#include <sys/dir.h>
-#include <dumprestor.h>
-
-#define        MWORD(m,i) (m[(unsigned)(i-1)/MLEN])
-#define        MBIT(i) (1<<((unsigned)(i-1)%MLEN))
-#define        BIS(i,w)        (MWORD(w,i) |=  MBIT(i))
-#define        BIC(i,w)        (MWORD(w,i) &= ~MBIT(i))
-#define        BIT(i,w)        (MWORD(w,i) & MBIT(i))
-
-struct filsys  sblock;
-struct dinode  itab[INOPB*NI];
-short  clrmap[MSIZ];
-short  dirmap[MSIZ];
-short  nodmap[MSIZ];
-
-char   *disk;
-char   *tape;
-char   *increm;
-char   incno;
-int    uflag;
-int    fi;
-int    to;
-ino_t  ino;
-int    nsubdir;
-int    ntape;
-int    nadded;
-int    dadded;
-int    density = 160;
-
-char   *ctime();
-char   *prdate();
-long   atol();
-int    fi;
-long   tsize;
-long   esize;
-long   asize;
-int    mark();
-int    add();
-int    dump();
-int    tapsrec();
-int    dmpspc();
-int    dsrch();
-int    nullf();
-
-#define        HOUR    (60L*60L)
-#define        DAY     (24L*HOUR)
-#define        YEAR    (365L*DAY)
-
-main(argc, argv)
-char *argv[];
-{
-       char *arg;
-       register i;
-
-       time(&spcl.c_date);
-
-       tsize = 2300L*12L*10L;
-       tape = "/dev/rmt1";
-       disk = "/dev/rrp3";
-       increm = "/etc/ddate";
-       incno = '9';
-       uflag = 0;
-       arg = "u";
-       if(argc > 1) {
-               argv++;
-               argc--;
-               arg = *argv;
-       }
-       while(*arg)
-       switch (*arg++) {
-
-       case 'f':
-               if(argc > 1) {
-                       argv++;
-                       argc--;
-                       tape = *argv;
-               }
-               break;
-
-       case 'd':
-               if (argc > 1) {
-                       argv++;
-                       argc--;
-                       density = atoi(*argv)/10;
-               }
-               break;
-
-       case 's':
-               if(argc > 1) {
-                       argv++;
-                       argc--;
-                       tsize = atol(*argv);
-                       tsize *= 12L*10L;
-               }
-               break;
-
-       case '0':
-       case '1':
-       case '2':
-       case '3':
-       case '4':
-       case '5':
-       case '6':
-       case '7':
-       case '8':
-       case '9':
-               incno = arg[-1];
-               break;
-
-       case 'u':
-               uflag++;
-               break;
-
-       default:
-               printf("bad key '%c%'\n", arg[-1]);
-               exit(1);
-       }
-       if(argc > 1) {
-               argv++;
-               argc--;
-               disk = *argv;
-       }
-
-       getitime();
-       printf("     date = %s\n", prdate(spcl.c_date));
-       printf("dump date = %s\n", prdate(spcl.c_ddate));
-       printf("dumping %s to %s\n", disk, tape);
-       fi = open(disk, 0);
-       if(fi < 0) {
-               printf("dump: cannot open %s\n", disk);
-               exit(1);
-       }
-       otape();
-       printf("I\n");
-       esize = 0;
-       CLR(clrmap);
-       CLR(dirmap);
-       CLR(nodmap);
-
-       pass(mark, (short *)NULL);
-       do {
-               printf("II\n");
-               nadded = 0;
-               pass(add, dirmap);
-       } while(nadded);
-
-       bmapest(clrmap);
-       bmapest(nodmap);
-       printf("estimated %ld tape blocks on %d tape(s)\n",
-               esize, 0);
-
-       printf("III\n");
-       bitmap(clrmap, TS_CLRI);
-       pass(dump, dirmap);
-       printf("IV\n");
-       pass(dump, nodmap);
-       putitime();
-       printf("DONE\n");
-       spcl.c_type = TS_END;
-       for(i=0; i<NTREC; i++)
-               spclrec();
-       printf("%ld tape blocks on %d tape(s)\n",
-               spcl.c_tapea, spcl.c_volume);
-}
-
-pass(fn, map)
-int (*fn)();
-short *map;
-{
-       register i, j;
-       int bits;
-       ino_t mino;
-       daddr_t d;
-
-       sync();
-       bread((daddr_t)1, (char *)&sblock, sizeof(sblock));
-       mino = (sblock.s_isize-2) * INOPB;
-       ino = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= mino)
-                       break;
-               d = (unsigned)i;
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= mino)
-                               break;
-                       if((ino % MLEN) == 0) {
-                               bits = ~0;
-                               if(map != NULL)
-                                       bits = *map++;
-                       }
-                       ino++;
-                       if(bits & 1) {
-                               if(d != 0) {
-                                       bread(d, (char *)itab, sizeof(itab));
-                                       d = 0;
-                               }
-                               (*fn)(&itab[j]);
-                       }
-                       bits >>= 1;
-               }
-       }
-}
-
-icat(ip, fn1, fn2)
-struct dinode  *ip;
-int (*fn1)(), (*fn2)();
-{
-       register i;
-       daddr_t d[NADDR];
-
-       l3tol(&d[0], &ip->di_addr[0], NADDR);
-       (*fn2)(d, NADDR-3);
-       for(i=0; i<NADDR; i++) {
-               if(d[i] != 0) {
-                       if(i < NADDR-3)
-                               (*fn1)(d[i]); else
-                               indir(d[i], fn1, fn2, i-(NADDR-3));
-               }
-       }
-}
-
-indir(d, fn1, fn2, n)
-daddr_t d;
-int (*fn1)(), (*fn2)();
-{
-       register i;
-       daddr_t idblk[NINDIR];
-
-       bread(d, (char *)idblk, sizeof(idblk));
-       if(n <= 0) {
-               spcl.c_type = TS_ADDR;
-               (*fn2)(idblk, NINDIR);
-               for(i=0; i<NINDIR; i++) {
-                       d = idblk[i];
-                       if(d != 0)
-                               (*fn1)(d);
-               }
-       } else {
-               n--;
-               for(i=0; i<NINDIR; i++) {
-                       d = idblk[i];
-                       if(d != 0)
-                               indir(d, fn1, fn2, n);
-               }
-       }
-}
-
-mark(ip)
-struct dinode *ip;
-{
-       register f;
-
-       f = ip->di_mode & IFMT;
-       if(f == 0)
-               return;
-       BIS(ino, clrmap);
-       if(f == IFDIR)
-               BIS(ino, dirmap);
-       if(ip->di_mtime >= spcl.c_ddate ||
-          ip->di_ctime >= spcl.c_ddate) {
-               BIS(ino, nodmap);
-               if (f != IFREG)
-                       return;
-               est(ip);
-       }
-}
-
-add(ip)
-struct dinode *ip;
-{
-
-       if(BIT(ino, nodmap))
-               return;
-       nsubdir = 0;
-       dadded = 0;
-       icat(ip, dsrch, nullf);
-       if(dadded) {
-               BIS(ino, nodmap);
-               est(ip);
-               nadded++;
-       }
-       if(nsubdir == 0)
-               if(!BIT(ino, nodmap))
-                       BIC(ino, dirmap);
-}
-
-dump(ip)
-struct dinode *ip;
-{
-       register i;
-
-       if(ntape) {
-               ntape = 0;
-               bitmap(nodmap, TS_BITS);
-       }
-       BIC(ino, nodmap);
-       spcl.c_dinode = *ip;
-       spcl.c_type = TS_INODE;
-       spcl.c_count = 0;
-       i = ip->di_mode & IFMT;
-       if(i != IFDIR && i != IFREG) {
-               spclrec();
-               return;
-       }
-       icat(ip, tapsrec, dmpspc);
-}
-
-dmpspc(dp, n)
-daddr_t *dp;
-{
-       register i, t;
-
-       spcl.c_count = n;
-       for(i=0; i<n; i++) {
-               t = 0;
-               if(dp[i] != 0)
-                       t++;
-               spcl.c_addr[i] = t;
-       }
-       spclrec();
-}
-
-bitmap(map, typ)
-short *map;
-{
-       register i, n;
-       char *cp;
-
-       n = -1;
-       for(i=0; i<MSIZ; i++)
-               if(map[i])
-                       n = i;
-       if(n < 0)
-               return;
-       spcl.c_type = typ;
-       spcl.c_count = (n*sizeof(map[0]) + BSIZE)/BSIZE;
-       spclrec();
-       cp = (char *)map;
-       for(i=0; i<spcl.c_count; i++) {
-               taprec(cp);
-               cp += BSIZE;
-       }
-}
-
-spclrec()
-{
-       register i, *ip, s;
-
-       spcl.c_inumber = ino;
-       spcl.c_magic = MAGIC;
-       spcl.c_checksum = 0;
-       ip = (int *)&spcl;
-       s = 0;
-       for(i=0; i<BSIZE/sizeof(*ip); i++)
-               s += *ip++;
-       spcl.c_checksum = CHECKSUM - s;
-       taprec((char *)&spcl);
-}
-
-dsrch(d)
-daddr_t d;
-{
-       register char *cp;
-       register i;
-       register ino_t in;
-       struct direct dblk[DIRPB];
-
-       if(dadded)
-               return;
-       bread(d, (char *)dblk, sizeof(dblk));
-       for(i=0; i<DIRPB; i++) {
-               in = dblk[i].d_ino;
-               if(in == 0)
-                       continue;
-               cp = dblk[i].d_name;
-               if(cp[0] == '.') {
-                       if(cp[1] == '\0')
-                               continue;
-                       if(cp[1] == '.' && cp[2] == '\0')
-                               continue;
-               }
-               if(BIT(in, nodmap)) {
-                       dadded++;
-                       return;
-               }
-               if(BIT(in, dirmap))
-                       nsubdir++;
-       }
-}
-
-nullf()
-{
-}
-
-bread(da, ba, c)
-daddr_t da;
-char *ba;
-{
-       register n;
-
-       lseek(fi, da*512, 0);
-       n = read(fi, ba, c);
-       if(n != c)
-               printf("asked %d; got %d\n", c, n);
-}
-
-CLR(map)
-register short *map;
-{
-       register n;
-
-       n = MSIZ;
-       do
-               *map++ = 0;
-       while(--n);
-}
-
-
-char   tblock[NTREC][BSIZE];
-daddr_t        tdaddr[NTREC];
-int    trecno;
-
-taprec(dp)
-char *dp;
-{
-       register i;
-
-       for(i=0; i<BSIZE; i++)
-               tblock[trecno][i] = *dp++;
-       tdaddr[trecno] = 0;
-       trecno++;
-       spcl.c_tapea++;
-       if(trecno >= NTREC)
-               flusht();
-}
-
-tapsrec(d)
-daddr_t d;
-{
-
-       if(d == 0)
-               return;
-       tdaddr[trecno] = d;
-       trecno++;
-       spcl.c_tapea++;
-       if(trecno >= NTREC)
-               flusht();
-}
-
-flusht()
-{
-       char place[100];
-       register i, si;
-       daddr_t d;
-
-       while(trecno < NTREC)
-               tdaddr[trecno++] = 1;
-
-loop:
-       d = 0;
-       for(i=0; i<NTREC; i++)
-               if(tdaddr[i] != 0)
-               if(d == 0 || tdaddr[i] < d) {
-                       si = i;
-                       d = tdaddr[i];
-               }
-       if(d != 0) {
-               bread(d, tblock[si], BSIZE);
-               tdaddr[si] = 0;
-               goto loop;
-       }
-       trecno = 0;
-       write(to, tblock[0], sizeof(tblock));
-       asize += sizeof(tblock)/density;
-       asize += 7;
-       if(asize > tsize) {
-               close(to);
-               printf("change tapes\n");
-               read(0, place, sizeof(place));
-               otape();
-       }
-}
-
-otape()
-{
-       to = creat(tape, 0666);
-       if(to < 0) {
-               printf("dump: cannot create %s\n", tape);
-               exit(1);
-       }
-       asize = 0;
-       ntape++;
-       spcl.c_volume++;
-       spcl.c_type = TS_TAPE;
-       spclrec();
-}
-
-char *
-prdate(d)
-time_t d;
-{
-       char *p;
-
-       if(d == 0)
-               return("the epoch");
-       p = ctime(&d);
-       p[24] = 0;
-       return(p);
-}
-
-getitime()
-{
-       register i, df;
-       struct idates idbuf;
-       char *fname;
-
-       fname = disk;
-l1:
-       for(i=0; fname[i]; i++)
-               if(fname[i] == '/') {
-                       fname += i+1;
-                       goto l1;
-               }
-
-       spcl.c_ddate = 0;
-       df = open(increm, 0);
-       if(df < 0) {
-               printf("cannot open %s\n", increm);
-               exit(1);
-       }
-
-l2:
-       i = read(df, (char *)&idbuf, sizeof(idbuf));
-       if(i != sizeof(idbuf)) {
-               close(df);
-               return;
-       }
-       for(i=0;; i++) {
-               if(fname[i] != idbuf.id_name[i])
-                       goto l2;
-               if(fname[i] == '\0')
-                       break;
-       }
-       if(idbuf.id_incno >= incno)
-               goto l2;
-       if(idbuf.id_ddate <= spcl.c_ddate)
-               goto l2;
-       spcl.c_ddate = idbuf.id_ddate;
-       goto l2;
-}
-
-putitime()
-{
-       register i, n, df;
-       struct idates idbuf;
-       char *fname;
-
-       if(uflag == 0)
-               return;
-       fname = disk;
-l1:
-       for(i=0; fname[i]; i++)
-               if(fname[i] == '/') {
-                       fname += i+1;
-                       goto l1;
-               }
-
-       spcl.c_ddate = 0;
-       df = open(increm, 2);
-       if(df < 0) {
-               printf("cannot open %s\n", increm);
-               exit(1);
-       }
-       n = 0;
-l2:
-       i = read(df, (char *)&idbuf, sizeof(idbuf));
-       if(i != sizeof(idbuf))
-               goto l3;
-       n++;
-       for(i=0;; i++) {
-               if(fname[i] != idbuf.id_name[i])
-                       goto l2;
-               if(fname[i] == '\0')
-                       break;
-       }
-       if(idbuf.id_incno != incno)
-               goto l2;
-l3:
-       lseek(df, (long)n*sizeof(idbuf), 0);
-       for(i=0;; i++) {
-               idbuf.id_name[i] = fname[i];
-               if(fname[i] == '\0')
-                       break;
-       }
-       idbuf.id_incno = incno;
-       idbuf.id_ddate = spcl.c_date;
-       write(df, (char *)&idbuf, sizeof(idbuf));
-       close(df);
-       printf("level %c dump on %s\n", incno, prdate(spcl.c_date));
-}
-
-est(ip)
-struct dinode *ip;
-{
-       long s;
-
-       esize++;
-       s = (ip->di_size + BSIZE-1) / BSIZE;
-       esize += s;
-       if(s > NADDR-3) {
-               s -= NADDR-3;
-               s = (s + (BSIZE/sizeof(daddr_t))-1) / (BSIZE/sizeof(daddr_t));
-               esize += s;
-       }
-}
-
-bmapest(map)
-short *map;
-{
-       register i, n;
-
-       n = -1;
-       for(i=0; i<MSIZ; i++)
-               if(map[i])
-                       n = i;
-       if(n < 0)
-               return;
-       esize++;
-       esize += (n + (BSIZE/sizeof(short))-1) / (BSIZE/sizeof(short));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/dumpdir.c b/.ref-Research-V7/usr/src/cmd/dumpdir.c
deleted file mode 100644 (file)
index 37f20f0..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-#define MAXINO 3000
-#define BITS   8
-#define MAXXTR 60
-#define NCACHE 3
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/inode.h>
-#include <sys/ino.h>
-#include <sys/fblk.h>
-#include <sys/filsys.h>
-#include <sys/dir.h>
-#include <dumprestor.h>
-
-#define        MWORD(m,i) (m[(unsigned)(i-1)/MLEN])
-#define        MBIT(i) (1<<((unsigned)(i-1)%MLEN))
-#define        BIS(i,w)        (MWORD(w,i) |=  MBIT(i))
-#define        BIC(i,w)        (MWORD(w,i) &= ~MBIT(i))
-#define        BIT(i,w)        (MWORD(w,i) & MBIT(i))
-
-int    mt;
-char   tapename[] = "/dev/rmt1";
-char   *magtape = tapename;
-
-daddr_t        seekpt;
-int    ofile;
-FILE   *df;
-char   dirfile[] = "rstXXXXXX";
-
-struct {
-       ino_t   t_ino;
-       daddr_t t_seekpt;
-} inotab[MAXINO];
-int    ipos;
-
-#define ONTAPE 1
-#define XTRACTD        2
-#define XINUSE 4
-
-short  dumpmap[MSIZ];
-short  clrimap[MSIZ];
-
-
-int bct = NTREC+1;
-char tbf[NTREC*BSIZE];
-
-char prebuf[512];
-
-int volno;
-
-main(argc, argv)
-char *argv[];
-{
-       extern char *ctime();
-
-       mktemp(dirfile);
-       argv++;
-       if (argc>=3 && *argv[0] == 'f')
-               magtape = *++argv;
-       df = fopen(dirfile, "w");
-       if (df == NULL) {
-               printf("dumpdir: %s - cannot create directory temporary\n", dirfile);
-               exit(1);
-       }
-
-       if ((mt = open(magtape, 0)) < 0) {
-               printf("%s: cannot open tape\n", magtape);
-               exit(1);
-       }
-       if (readhdr(&spcl) == 0) {
-               printf("Tape is not a dump tape\n");
-               exit(1);
-       }
-       printf("Dump   date: %s", ctime(&spcl.c_date));
-       printf("Dumped from: %s", ctime(&spcl.c_ddate));
-       if (checkvol(&spcl, 1) == 0) {
-               printf("Tape is not volume 1 of the dump\n");
-               exit(1);
-       }
-       pass1();  /* This sets the various maps on the way by */
-       freopen(dirfile, "r", df);
-       strcpy(prebuf, "/");
-       printem(prebuf, (ino_t) 2);
-       exit(0);
-}
-       i = 0;
-/*
- * Read the tape, bulding up a directory structure for extraction
- * by name
- */
-pass1()
-{
-       register i;
-       struct dinode *ip;
-       int     putdir(), null();
-
-       while (gethead(&spcl) == 0) {
-               printf("Can't find directory header!\n");
-       }
-       for (;;) {
-               if (checktype(&spcl, TS_BITS) == 1) {
-                       readbits(dumpmap);
-                       continue;
-               }
-               if (checktype(&spcl, TS_CLRI) == 1) {
-                       readbits(clrimap);
-                       continue;
-               }
-               if (checktype(&spcl, TS_INODE) == 0) {
-finish:
-                       flsh();
-                       close(mt);
-                       return;
-               }
-               ip = &spcl.c_dinode;
-               i = ip->di_mode & IFMT;
-               if (i != IFDIR) {
-                       goto finish;
-               }
-               inotab[ipos].t_ino = spcl.c_inumber;
-               inotab[ipos++].t_seekpt = seekpt;
-               getfile(spcl.c_inumber, putdir, null, spcl.c_dinode.di_size);
-               putent("\000\000/");
-       }
-}
-
-printem(prefix, inum)
-char *prefix;
-ino_t  inum;
-{
-       struct direct dir;
-       register int i;
-
-       for (i = 0; i < MAXINO; i++)
-               if (inotab[i].t_ino == inum) {
-                       goto found;
-               }
-       printf("PANIC - can't find directory %d\n", inum);
-       return;
-found:
-       mseek(inotab[i].t_seekpt);
-       for (;;) {
-               getent((char *) &dir);
-               if (direq(dir.d_name, "/"))
-                       return;
-               if (search(dir.d_ino) != 0 && direq(dir.d_name, ".") == 0 && direq(dir.d_name, "..") == 0) {
-                       int len;
-                       FILE *tdf;
-
-                       tdf = df;
-                       df = fopen(dirfile, "r");
-                       len = strlen(prefix);
-                       strncat(prefix, dir.d_name, sizeof(dir.d_name));
-                       strcat(prefix, "/");
-                       printem(prefix, dir.d_ino);
-                       prefix[len] = '\0';
-                       fclose(df);
-                       df = tdf;
-               }
-               else
-                       if (BIT(dir.d_ino, dumpmap))
-                               printf("%5d     %s%-.14s\n", dir.d_ino, prefix, dir.d_name);
-       }
-}
-/*
- * Do the file extraction, calling the supplied functions
- * with the blocks
- */
-getfile(n, f1, f2, size)
-ino_t  n;
-int    (*f2)(), (*f1)();
-long   size;
-{
-       register i;
-       struct spcl addrblock;
-       char buf[BSIZE];
-
-       addrblock = spcl;
-       goto start;
-       for (;;) {
-               if (gethead(&addrblock) == 0) {
-                       printf("Missing address (header) block\n");
-                       goto eloop;
-               }
-               if (checktype(&addrblock, TS_ADDR) == 0) {
-                       spcl = addrblock;
-                       return;
-               }
-start:
-               for (i = 0; i < addrblock.c_count; i++) {
-                       if (addrblock.c_addr[i]) {
-                               readtape(buf);
-                               (*f1)(buf, size > BSIZE ? (long) BSIZE : size);
-                       }
-                       else {
-                               clearbuf(buf);
-                               (*f2)(buf, size > BSIZE ? (long) BSIZE : size);
-                       }
-                       if ((size -= BSIZE) <= 0) {
-eloop:
-                               while (gethead(&spcl) == 0)
-                                       ;
-                               if (checktype(&spcl, TS_ADDR) == 1)
-                                       goto eloop;
-                               return;
-                       }
-               }
-       }
-}
-
-/*
- * Do the tape i\/o, dealling with volume changes
- * etc..
- */
-readtape(b)
-char *b;
-{
-       register i;
-       struct spcl tmpbuf;
-
-       if (bct >= NTREC) {
-               for (i = 0; i < NTREC; i++)
-                       ((struct spcl *)&tbf[i*BSIZE])->c_magic = 0;
-               bct = 0;
-               if ((i = read(mt, tbf, NTREC*BSIZE)) < 0) {
-                       exit(1);
-               }
-               if (i == 0) {
-                       bct = NTREC + 1;
-                       volno++;
-loop:
-                       flsht();
-                       close(mt);
-                       printf("Mount volume %d\n", volno);
-                       while (getchar() != '\n')
-                               ;
-                       if ((mt = open(magtape, 0)) == -1) {
-                               printf("Cannot open tape!\n");
-                       }
-                       if (readhdr(&tmpbuf) == 0) {
-                               printf("Not a dump tape.Try again\n");
-                               goto loop;
-                       }
-                       if (checkvol(&tmpbuf, volno) == 0) {
-                               printf("Wrong tape. Try again\n");
-                               goto loop;
-                       }
-                       readtape(b);
-                       return;
-               }
-       }
-       copy(&tbf[(bct++*BSIZE)], b, BSIZE);
-}
-
-flsht()
-{
-       bct = NTREC+1;
-}
-
-copy(f, t, s)
-register char *f, *t;
-{
-       register i;
-
-       i = s;
-       do
-               *t++ = *f++;
-       while (--i);
-}
-
-clearbuf(cp)
-register char *cp;
-{
-       register i;
-
-       i = BSIZE;
-       do
-               *cp++ = 0;
-       while (--i);
-}
-
-/*
- * Put and get the directory entries from the compressed
- * directory file
- */
-putent(cp)
-char   *cp;
-{
-       register i;
-
-       for (i = 0; i < sizeof(ino_t); i++)
-               writec(*cp++);
-       for (i = 0; i < DIRSIZ; i++) {
-               writec(*cp);
-               if (*cp++ == 0)
-                       return;
-       }
-       return;
-}
-
-getent(bf)
-register char *bf;
-{
-       register i;
-
-       for (i = 0; i < sizeof(ino_t); i++)
-               *bf++ = readc();
-       for (i = 0; i < DIRSIZ; i++)
-               if ((*bf++ = readc()) == 0)
-                       return;
-       return;
-}
-
-/*
- * read/write te directory file
- */
-writec(c)
-char c;
-{
-       seekpt++;
-       fwrite(&c, 1, 1, df);
-}
-
-readc()
-{
-       char c;
-
-       fread(&c, 1, 1, df);
-       return(c);
-}
-
-mseek(pt)
-daddr_t pt;
-{
-       fseek(df, pt, 0);
-}
-
-flsh()
-{
-       fflush(df);
-}
-
-/*
- * search the directory inode ino
- * looking for entry cp
- */
-search(inum)
-ino_t  inum;
-{
-       register low, high, probe;
-
-       low = 0;
-       high = ipos-1;
-
-       while (low != high) {
-               probe = (high - low + 1)/2 + low;
-/*
-printf("low = %d, high = %d, probe = %d, ino = %d, inum = %d\n", low, high, probe, inum, inotab[probe].t_ino);
-*/
-               if (inum >= inotab[probe].t_ino)
-                       low = probe;
-               else
-                       high = probe - 1;
-       }
-       return(inum == inotab[low].t_ino);
-}
-
-direq(s1, s2)
-register char *s1, *s2;
-{
-       register i;
-
-       for (i = 0; i < DIRSIZ; i++)
-               if (*s1++ == *s2) {
-                       if (*s2++ == 0)
-                               return(1);
-               } else
-                       return(0);
-       return(1);
-}
-
-/*
- * read the tape into buf, then return whether or
- * or not it is a header block.
- */
-gethead(buf)
-struct spcl *buf;
-{
-       readtape((char *)buf);
-       if (buf->c_magic != MAGIC || checksum((int *) buf) == 0)
-               return(0);
-       return(1);
-}
-
-/*
- * return whether or not the buffer contains a header block
- */
-checktype(b, t)
-struct spcl *b;
-int    t;
-{
-       return(b->c_type == t);
-}
-
-
-checksum(b)
-int *b;
-{
-       register i, j;
-
-       j = BSIZE/sizeof(int);
-       i = 0;
-       do
-               i += *b++;
-       while (--j);
-       if (i != CHECKSUM) {
-               printf("Checksum error %o\n", i);
-               return(0);
-       }
-       return(1);
-}
-
-checkvol(b, t)
-struct spcl *b;
-int t;
-{
-       if (b->c_volume == t)
-               return(1);
-       return(0);
-}
-
-readhdr(b)
-struct spcl *b;
-{
-       if (gethead(b) == 0)
-               return(0);
-       if (checktype(b, TS_TAPE) == 0)
-               return(0);
-       return(1);
-}
-
-putdir(b)
-char *b;
-{
-       register struct direct *dp;
-       register i;
-
-       for (dp = (struct direct *) b, i = 0; i < BSIZE; dp++, i += sizeof(*dp)) {
-               if (dp->d_ino == 0)
-                       continue;
-               putent((char *) dp);
-       }
-}
-
-/*
- * read a bit mask from the tape into m.
- */
-readbits(m)
-short  *m;
-{
-       register i;
-
-       i = spcl.c_count;
-
-       while (i--) {
-               readtape((char *) m);
-               m += (BSIZE/(MLEN/BITS));
-       }
-       while (gethead(&spcl) == 0)
-               ;
-}
-
-null() { ; }
diff --git a/.ref-Research-V7/usr/src/cmd/echo.c b/.ref-Research-V7/usr/src/cmd/echo.c
deleted file mode 100644 (file)
index c9ee03c..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdio.h>
-
-main(argc, argv)
-int argc;
-char *argv[];
-{
-       register int i, nflg;
-
-       nflg = 0;
-       if(argc > 1 && argv[1][0] == '-' && argv[1][1] == 'n') {
-               nflg++;
-               argc--;
-               argv++;
-       }
-       for(i=1; i<argc; i++) {
-               fputs(argv[i], stdout);
-               if (i < argc-1)
-                       putchar(' ');
-       }
-       if(nflg == 0)
-               putchar('\n');
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ed.c b/.ref-Research-V7/usr/src/cmd/ed.c
deleted file mode 100644 (file)
index c6bcf68..0000000
+++ /dev/null
@@ -1,1762 +0,0 @@
-/*
- * Editor
- */
-
-#include <signal.h>
-#include <sgtty.h>
-#include <setjmp.h>
-#define        NULL    0
-#define        FNSIZE  64
-#define        LBSIZE  512
-#define        ESIZE   128
-#define        GBSIZE  256
-#define        NBRA    5
-#define        EOF     -1
-#define        KSIZE   9
-
-#define        CBRA    1
-#define        CCHR    2
-#define        CDOT    4
-#define        CCL     6
-#define        NCCL    8
-#define        CDOL    10
-#define        CEOF    11
-#define        CKET    12
-#define        CBACK   14
-
-#define        STAR    01
-
-char   Q[]     = "";
-char   T[]     = "TMP";
-#define        READ    0
-#define        WRITE   1
-
-int    peekc;
-int    lastc;
-char   savedfile[FNSIZE];
-char   file[FNSIZE];
-char   linebuf[LBSIZE];
-char   rhsbuf[LBSIZE/2];
-char   expbuf[ESIZE+4];
-int    circfl;
-int    *zero;
-int    *dot;
-int    *dol;
-int    *addr1;
-int    *addr2;
-char   genbuf[LBSIZE];
-long   count;
-char   *nextip;
-char   *linebp;
-int    ninbuf;
-int    io;
-int    pflag;
-long   lseek();
-int    (*oldhup)();
-int    (*oldquit)();
-int    vflag   = 1;
-int    xflag;
-int    xtflag;
-int    kflag;
-char   key[KSIZE + 1];
-char   crbuf[512];
-char   perm[768];
-char   tperm[768];
-int    listf;
-int    col;
-char   *globp;
-int    tfile   = -1;
-int    tline;
-char   *tfname;
-char   *loc1;
-char   *loc2;
-char   *locs;
-char   ibuff[512];
-int    iblock  = -1;
-char   obuff[512];
-int    oblock  = -1;
-int    ichanged;
-int    nleft;
-char   WRERR[] = "WRITE ERROR";
-int    names[26];
-int    anymarks;
-char   *braslist[NBRA];
-char   *braelist[NBRA];
-int    nbra;
-int    subnewa;
-int    subolda;
-int    fchange;
-int    wrapp;
-unsigned nlall = 128;
-
-int    *address();
-char   *getline();
-char   *getblock();
-char   *place();
-char   *mktemp();
-char   *malloc();
-char   *realloc();
-jmp_buf        savej;
-
-main(argc, argv)
-char **argv;
-{
-       register char *p1, *p2;
-       extern int onintr(), quit(), onhup();
-       int (*oldintr)();
-
-       oldquit = signal(SIGQUIT, SIG_IGN);
-       oldhup = signal(SIGHUP, SIG_IGN);
-       oldintr = signal(SIGINT, SIG_IGN);
-       if ((int)signal(SIGTERM, SIG_IGN) == 0)
-               signal(SIGTERM, quit);
-       argv++;
-       while (argc > 1 && **argv=='-') {
-               switch((*argv)[1]) {
-
-               case '\0':
-                       vflag = 0;
-                       break;
-
-               case 'q':
-                       signal(SIGQUIT, SIG_DFL);
-                       vflag = 1;
-                       break;
-
-               case 'x':
-                       xflag = 1;
-                       break;
-               }
-               argv++;
-               argc--;
-       }
-       if(xflag){
-               getkey();
-               kflag = crinit(key, perm);
-       }
-
-       if (argc>1) {
-               p1 = *argv;
-               p2 = savedfile;
-               while (*p2++ = *p1++)
-                       ;
-               globp = "r";
-       }
-       zero = (int *)malloc(nlall*sizeof(int));
-       tfname = mktemp("/tmp/eXXXXX");
-       init();
-       if (((int)oldintr&01) == 0)
-               signal(SIGINT, onintr);
-       if (((int)oldhup&01) == 0)
-               signal(SIGHUP, onhup);
-       setjmp(savej);
-       commands();
-       quit();
-}
-
-commands()
-{
-       int getfile(), gettty();
-       register *a1, c;
-
-       for (;;) {
-       if (pflag) {
-               pflag = 0;
-               addr1 = addr2 = dot;
-               goto print;
-       }
-       addr1 = 0;
-       addr2 = 0;
-       do {
-               addr1 = addr2;
-               if ((a1 = address())==0) {
-                       c = getchr();
-                       break;
-               }
-               addr2 = a1;
-               if ((c=getchr()) == ';') {
-                       c = ',';
-                       dot = a1;
-               }
-       } while (c==',');
-       if (addr1==0)
-               addr1 = addr2;
-       switch(c) {
-
-       case 'a':
-               setdot();
-               newline();
-               append(gettty, addr2);
-               continue;
-
-       case 'c':
-               delete();
-               append(gettty, addr1-1);
-               continue;
-
-       case 'd':
-               delete();
-               continue;
-
-       case 'E':
-               fchange = 0;
-               c = 'e';
-       case 'e':
-               setnoaddr();
-               if (vflag && fchange) {
-                       fchange = 0;
-                       error(Q);
-               }
-               filename(c);
-               init();
-               addr2 = zero;
-               goto caseread;
-
-       case 'f':
-               setnoaddr();
-               filename(c);
-               puts(savedfile);
-               continue;
-
-       case 'g':
-               global(1);
-               continue;
-
-       case 'i':
-               setdot();
-               nonzero();
-               newline();
-               append(gettty, addr2-1);
-               continue;
-
-
-       case 'j':
-               if (addr2==0) {
-                       addr1 = dot;
-                       addr2 = dot+1;
-               }
-               setdot();
-               newline();
-               nonzero();
-               join();
-               continue;
-
-       case 'k':
-               if ((c = getchr()) < 'a' || c > 'z')
-                       error(Q);
-               newline();
-               setdot();
-               nonzero();
-               names[c-'a'] = *addr2 & ~01;
-               anymarks |= 01;
-               continue;
-
-       case 'm':
-               move(0);
-               continue;
-
-       case '\n':
-               if (addr2==0)
-                       addr2 = dot+1;
-               addr1 = addr2;
-               goto print;
-
-       case 'l':
-               listf++;
-       case 'p':
-       case 'P':
-               newline();
-       print:
-               setdot();
-               nonzero();
-               a1 = addr1;
-               do {
-                       puts(getline(*a1++));
-               } while (a1 <= addr2);
-               dot = addr2;
-               listf = 0;
-               continue;
-
-       case 'Q':
-               fchange = 0;
-       case 'q':
-               setnoaddr();
-               newline();
-               quit();
-
-       case 'r':
-               filename(c);
-       caseread:
-               if ((io = open(file, 0)) < 0) {
-                       lastc = '\n';
-                       error(file);
-               }
-               setall();
-               ninbuf = 0;
-               c = zero != dol;
-               append(getfile, addr2);
-               exfile();
-               fchange = c;
-               continue;
-
-       case 's':
-               setdot();
-               nonzero();
-               substitute(globp!=0);
-               continue;
-
-       case 't':
-               move(1);
-               continue;
-
-       case 'u':
-               setdot();
-               nonzero();
-               newline();
-               if ((*addr2&~01) != subnewa)
-                       error(Q);
-               *addr2 = subolda;
-               dot = addr2;
-               continue;
-
-       case 'v':
-               global(0);
-               continue;
-
-       case 'W':
-               wrapp++;
-       case 'w':
-               setall();
-               nonzero();
-               filename(c);
-               if(!wrapp ||
-                 ((io = open(file,1)) == -1) ||
-                 ((lseek(io, 0L, 2)) == -1))
-                       if ((io = creat(file, 0666)) < 0)
-                               error(file);
-               wrapp = 0;
-               putfile();
-               exfile();
-               if (addr1==zero+1 && addr2==dol)
-                       fchange = 0;
-               continue;
-
-       case 'x':
-               setnoaddr();
-               newline();
-               xflag = 1;
-               puts("Entering encrypting mode!");
-               getkey();
-               kflag = crinit(key, perm);
-               continue;
-
-
-       case '=':
-               setall();
-               newline();
-               count = (addr2-zero)&077777;
-               putd();
-               putchr('\n');
-               continue;
-
-       case '!':
-               callunix();
-               continue;
-
-       case EOF:
-               return;
-
-       }
-       error(Q);
-       }
-}
-
-int *
-address()
-{
-       register *a1, minus, c;
-       int n, relerr;
-
-       minus = 0;
-       a1 = 0;
-       for (;;) {
-               c = getchr();
-               if ('0'<=c && c<='9') {
-                       n = 0;
-                       do {
-                               n *= 10;
-                               n += c - '0';
-                       } while ((c = getchr())>='0' && c<='9');
-                       peekc = c;
-                       if (a1==0)
-                               a1 = zero;
-                       if (minus<0)
-                               n = -n;
-                       a1 += n;
-                       minus = 0;
-                       continue;
-               }
-               relerr = 0;
-               if (a1 || minus)
-                       relerr++;
-               switch(c) {
-               case ' ':
-               case '\t':
-                       continue;
-       
-               case '+':
-                       minus++;
-                       if (a1==0)
-                               a1 = dot;
-                       continue;
-
-               case '-':
-               case '^':
-                       minus--;
-                       if (a1==0)
-                               a1 = dot;
-                       continue;
-       
-               case '?':
-               case '/':
-                       compile(c);
-                       a1 = dot;
-                       for (;;) {
-                               if (c=='/') {
-                                       a1++;
-                                       if (a1 > dol)
-                                               a1 = zero;
-                               } else {
-                                       a1--;
-                                       if (a1 < zero)
-                                               a1 = dol;
-                               }
-                               if (execute(0, a1))
-                                       break;
-                               if (a1==dot)
-                                       error(Q);
-                       }
-                       break;
-       
-               case '$':
-                       a1 = dol;
-                       break;
-       
-               case '.':
-                       a1 = dot;
-                       break;
-
-               case '\'':
-                       if ((c = getchr()) < 'a' || c > 'z')
-                               error(Q);
-                       for (a1=zero; a1<=dol; a1++)
-                               if (names[c-'a'] == (*a1 & ~01))
-                                       break;
-                       break;
-       
-               default:
-                       peekc = c;
-                       if (a1==0)
-                               return(0);
-                       a1 += minus;
-                       if (a1<zero || a1>dol)
-                               error(Q);
-                       return(a1);
-               }
-               if (relerr)
-                       error(Q);
-       }
-}
-
-setdot()
-{
-       if (addr2 == 0)
-               addr1 = addr2 = dot;
-       if (addr1 > addr2)
-               error(Q);
-}
-
-setall()
-{
-       if (addr2==0) {
-               addr1 = zero+1;
-               addr2 = dol;
-               if (dol==zero)
-                       addr1 = zero;
-       }
-       setdot();
-}
-
-setnoaddr()
-{
-       if (addr2)
-               error(Q);
-}
-
-nonzero()
-{
-       if (addr1<=zero || addr2>dol)
-               error(Q);
-}
-
-newline()
-{
-       register c;
-
-       if ((c = getchr()) == '\n')
-               return;
-       if (c=='p' || c=='l') {
-               pflag++;
-               if (c=='l')
-                       listf++;
-               if (getchr() == '\n')
-                       return;
-       }
-       error(Q);
-}
-
-filename(comm)
-{
-       register char *p1, *p2;
-       register c;
-
-       count = 0;
-       c = getchr();
-       if (c=='\n' || c==EOF) {
-               p1 = savedfile;
-               if (*p1==0 && comm!='f')
-                       error(Q);
-               p2 = file;
-               while (*p2++ = *p1++)
-                       ;
-               return;
-       }
-       if (c!=' ')
-               error(Q);
-       while ((c = getchr()) == ' ')
-               ;
-       if (c=='\n')
-               error(Q);
-       p1 = file;
-       do {
-               *p1++ = c;
-               if (c==' ' || c==EOF)
-                       error(Q);
-       } while ((c = getchr()) != '\n');
-       *p1++ = 0;
-       if (savedfile[0]==0 || comm=='e' || comm=='f') {
-               p1 = savedfile;
-               p2 = file;
-               while (*p1++ = *p2++)
-                       ;
-       }
-}
-
-exfile()
-{
-       close(io);
-       io = -1;
-       if (vflag) {
-               putd();
-               putchr('\n');
-       }
-}
-
-onintr()
-{
-       signal(SIGINT, onintr);
-       putchr('\n');
-       lastc = '\n';
-       error(Q);
-}
-
-onhup()
-{
-       signal(SIGINT, SIG_IGN);
-       signal(SIGHUP, SIG_IGN);
-       if (dol > zero) {
-               addr1 = zero+1;
-               addr2 = dol;
-               io = creat("ed.hup", 0666);
-               if (io > 0)
-                       putfile();
-       }
-       fchange = 0;
-       quit();
-}
-
-error(s)
-char *s;
-{
-       register c;
-
-       wrapp = 0;
-       listf = 0;
-       putchr('?');
-       puts(s);
-       count = 0;
-       lseek(0, (long)0, 2);
-       pflag = 0;
-       if (globp)
-               lastc = '\n';
-       globp = 0;
-       peekc = lastc;
-       if(lastc)
-               while ((c = getchr()) != '\n' && c != EOF)
-                       ;
-       if (io > 0) {
-               close(io);
-               io = -1;
-       }
-       longjmp(savej, 1);
-}
-
-getchr()
-{
-       char c;
-       if (lastc=peekc) {
-               peekc = 0;
-               return(lastc);
-       }
-       if (globp) {
-               if ((lastc = *globp++) != 0)
-                       return(lastc);
-               globp = 0;
-               return(EOF);
-       }
-       if (read(0, &c, 1) <= 0)
-               return(lastc = EOF);
-       lastc = c&0177;
-       return(lastc);
-}
-
-gettty()
-{
-       register c;
-       register char *gf;
-       register char *p;
-
-       p = linebuf;
-       gf = globp;
-       while ((c = getchr()) != '\n') {
-               if (c==EOF) {
-                       if (gf)
-                               peekc = c;
-                       return(c);
-               }
-               if ((c &= 0177) == 0)
-                       continue;
-               *p++ = c;
-               if (p >= &linebuf[LBSIZE-2])
-                       error(Q);
-       }
-       *p++ = 0;
-       if (linebuf[0]=='.' && linebuf[1]==0)
-               return(EOF);
-       return(0);
-}
-
-getfile()
-{
-       register c;
-       register char *lp, *fp;
-
-       lp = linebuf;
-       fp = nextip;
-       do {
-               if (--ninbuf < 0) {
-                       if ((ninbuf = read(io, genbuf, LBSIZE)-1) < 0)
-                               return(EOF);
-                       fp = genbuf;
-                       while(fp < &genbuf[ninbuf]) {
-                               if (*fp++ & 0200) {
-                                       if (kflag)
-                                               crblock(perm, genbuf, ninbuf+1, count);
-                                       break;
-                               }
-                       }
-                       fp = genbuf;
-               }
-               c = *fp++;
-               if (c=='\0')
-                       continue;
-               if (c&0200 || lp >= &linebuf[LBSIZE]) {
-                       lastc = '\n';
-                       error(Q);
-               }
-               *lp++ = c;
-               count++;
-       } while (c != '\n');
-       *--lp = 0;
-       nextip = fp;
-       return(0);
-}
-
-putfile()
-{
-       int *a1, n;
-       register char *fp, *lp;
-       register nib;
-
-       nib = 512;
-       fp = genbuf;
-       a1 = addr1;
-       do {
-               lp = getline(*a1++);
-               for (;;) {
-                       if (--nib < 0) {
-                               n = fp-genbuf;
-                               if(kflag)
-                                       crblock(perm, genbuf, n, count-n);
-                               if(write(io, genbuf, n) != n) {
-                                       puts(WRERR);
-                                       error(Q);
-                               }
-                               nib = 511;
-                               fp = genbuf;
-                       }
-                       count++;
-                       if ((*fp++ = *lp++) == 0) {
-                               fp[-1] = '\n';
-                               break;
-                       }
-               }
-       } while (a1 <= addr2);
-       n = fp-genbuf;
-       if(kflag)
-               crblock(perm, genbuf, n, count-n);
-       if(write(io, genbuf, n) != n) {
-               puts(WRERR);
-               error(Q);
-       }
-}
-
-append(f, a)
-int *a;
-int (*f)();
-{
-       register *a1, *a2, *rdot;
-       int nline, tl;
-
-       nline = 0;
-       dot = a;
-       while ((*f)() == 0) {
-               if ((dol-zero)+1 >= nlall) {
-                       int *ozero = zero;
-                       nlall += 512;
-                       free((char *)zero);
-                       if ((zero = (int *)realloc((char *)zero, nlall*sizeof(int)))==NULL) {
-                               lastc = '\n';
-                               zero = ozero;
-                               error("MEM?");
-                       }
-                       dot += zero - ozero;
-                       dol += zero - ozero;
-               }
-               tl = putline();
-               nline++;
-               a1 = ++dol;
-               a2 = a1+1;
-               rdot = ++dot;
-               while (a1 > rdot)
-                       *--a2 = *--a1;
-               *rdot = tl;
-       }
-       return(nline);
-}
-
-callunix()
-{
-       register (*savint)(), pid, rpid;
-       int retcode;
-
-       setnoaddr();
-       if ((pid = fork()) == 0) {
-               signal(SIGHUP, oldhup);
-               signal(SIGQUIT, oldquit);
-               execl("/bin/sh", "sh", "-t", 0);
-               exit(0100);
-       }
-       savint = signal(SIGINT, SIG_IGN);
-       while ((rpid = wait(&retcode)) != pid && rpid != -1)
-               ;
-       signal(SIGINT, savint);
-       puts("!");
-}
-
-quit()
-{
-       if (vflag && fchange && dol!=zero) {
-               fchange = 0;
-               error(Q);
-       }
-       unlink(tfname);
-       exit(0);
-}
-
-delete()
-{
-       setdot();
-       newline();
-       nonzero();
-       rdelete(addr1, addr2);
-}
-
-rdelete(ad1, ad2)
-int *ad1, *ad2;
-{
-       register *a1, *a2, *a3;
-
-       a1 = ad1;
-       a2 = ad2+1;
-       a3 = dol;
-       dol -= a2 - a1;
-       do {
-               *a1++ = *a2++;
-       } while (a2 <= a3);
-       a1 = ad1;
-       if (a1 > dol)
-               a1 = dol;
-       dot = a1;
-       fchange = 1;
-}
-
-gdelete()
-{
-       register *a1, *a2, *a3;
-
-       a3 = dol;
-       for (a1=zero+1; (*a1&01)==0; a1++)
-               if (a1>=a3)
-                       return;
-       for (a2=a1+1; a2<=a3;) {
-               if (*a2&01) {
-                       a2++;
-                       dot = a1;
-               } else
-                       *a1++ = *a2++;
-       }
-       dol = a1-1;
-       if (dot>dol)
-               dot = dol;
-       fchange = 1;
-}
-
-char *
-getline(tl)
-{
-       register char *bp, *lp;
-       register nl;
-
-       lp = linebuf;
-       bp = getblock(tl, READ);
-       nl = nleft;
-       tl &= ~0377;
-       while (*lp++ = *bp++)
-               if (--nl == 0) {
-                       bp = getblock(tl+=0400, READ);
-                       nl = nleft;
-               }
-       return(linebuf);
-}
-
-putline()
-{
-       register char *bp, *lp;
-       register nl;
-       int tl;
-
-       fchange = 1;
-       lp = linebuf;
-       tl = tline;
-       bp = getblock(tl, WRITE);
-       nl = nleft;
-       tl &= ~0377;
-       while (*bp = *lp++) {
-               if (*bp++ == '\n') {
-                       *--bp = 0;
-                       linebp = lp;
-                       break;
-               }
-               if (--nl == 0) {
-                       bp = getblock(tl+=0400, WRITE);
-                       nl = nleft;
-               }
-       }
-       nl = tline;
-       tline += (((lp-linebuf)+03)>>1)&077776;
-       return(nl);
-}
-
-char *
-getblock(atl, iof)
-{
-       extern read(), write();
-       register bno, off;
-       register char *p1, *p2;
-       register int n;
-       
-       bno = (atl>>8)&0377;
-       off = (atl<<1)&0774;
-       if (bno >= 255) {
-               lastc = '\n';
-               error(T);
-       }
-       nleft = 512 - off;
-       if (bno==iblock) {
-               ichanged |= iof;
-               return(ibuff+off);
-       }
-       if (bno==oblock)
-               return(obuff+off);
-       if (iof==READ) {
-               if (ichanged) {
-                       if(xtflag)
-                               crblock(tperm, ibuff, 512, (long)0);
-                       blkio(iblock, ibuff, write);
-               }
-               ichanged = 0;
-               iblock = bno;
-               blkio(bno, ibuff, read);
-               if(xtflag)
-                       crblock(tperm, ibuff, 512, (long)0);
-               return(ibuff+off);
-       }
-       if (oblock>=0) {
-               if(xtflag) {
-                       p1 = obuff;
-                       p2 = crbuf;
-                       n = 512;
-                       while(n--)
-                               *p2++ = *p1++;
-                       crblock(tperm, crbuf, 512, (long)0);
-                       blkio(oblock, crbuf, write);
-               } else
-                       blkio(oblock, obuff, write);
-       }
-       oblock = bno;
-       return(obuff+off);
-}
-
-blkio(b, buf, iofcn)
-char *buf;
-int (*iofcn)();
-{
-       lseek(tfile, (long)b<<9, 0);
-       if ((*iofcn)(tfile, buf, 512) != 512) {
-               error(T);
-       }
-}
-
-init()
-{
-       register *markp;
-
-       close(tfile);
-       tline = 2;
-       for (markp = names; markp < &names[26]; )
-               *markp++ = 0;
-       subnewa = 0;
-       anymarks = 0;
-       iblock = -1;
-       oblock = -1;
-       ichanged = 0;
-       close(creat(tfname, 0600));
-       tfile = open(tfname, 2);
-       if(xflag) {
-               xtflag = 1;
-               makekey(key, tperm);
-       }
-       dot = dol = zero;
-}
-
-global(k)
-{
-       register char *gp;
-       register c;
-       register int *a1;
-       char globuf[GBSIZE];
-
-       if (globp)
-               error(Q);
-       setall();
-       nonzero();
-       if ((c=getchr())=='\n')
-               error(Q);
-       compile(c);
-       gp = globuf;
-       while ((c = getchr()) != '\n') {
-               if (c==EOF)
-                       error(Q);
-               if (c=='\\') {
-                       c = getchr();
-                       if (c!='\n')
-                               *gp++ = '\\';
-               }
-               *gp++ = c;
-               if (gp >= &globuf[GBSIZE-2])
-                       error(Q);
-       }
-       *gp++ = '\n';
-       *gp++ = 0;
-       for (a1=zero; a1<=dol; a1++) {
-               *a1 &= ~01;
-               if (a1>=addr1 && a1<=addr2 && execute(0, a1)==k)
-                       *a1 |= 01;
-       }
-       /*
-        * Special case: g/.../d (avoid n^2 algorithm)
-        */
-       if (globuf[0]=='d' && globuf[1]=='\n' && globuf[2]=='\0') {
-               gdelete();
-               return;
-       }
-       for (a1=zero; a1<=dol; a1++) {
-               if (*a1 & 01) {
-                       *a1 &= ~01;
-                       dot = a1;
-                       globp = globuf;
-                       commands();
-                       a1 = zero;
-               }
-       }
-}
-
-join()
-{
-       register char *gp, *lp;
-       register *a1;
-
-       gp = genbuf;
-       for (a1=addr1; a1<=addr2; a1++) {
-               lp = getline(*a1);
-               while (*gp = *lp++)
-                       if (gp++ >= &genbuf[LBSIZE-2])
-                               error(Q);
-       }
-       lp = linebuf;
-       gp = genbuf;
-       while (*lp++ = *gp++)
-               ;
-       *addr1 = putline();
-       if (addr1<addr2)
-               rdelete(addr1+1, addr2);
-       dot = addr1;
-}
-
-substitute(inglob)
-{
-       register *markp, *a1, nl;
-       int gsubf;
-       int getsub();
-
-       gsubf = compsub();
-       for (a1 = addr1; a1 <= addr2; a1++) {
-               int *ozero;
-               if (execute(0, a1)==0)
-                       continue;
-               inglob |= 01;
-               dosub();
-               if (gsubf) {
-                       while (*loc2) {
-                               if (execute(1, (int *)0)==0)
-                                       break;
-                               dosub();
-                       }
-               }
-               subnewa = putline();
-               *a1 &= ~01;
-               if (anymarks) {
-                       for (markp = names; markp < &names[26]; markp++)
-                               if (*markp == *a1)
-                                       *markp = subnewa;
-               }
-               subolda = *a1;
-               *a1 = subnewa;
-               ozero = zero;
-               nl = append(getsub, a1);
-               nl += zero-ozero;
-               a1 += nl;
-               addr2 += nl;
-       }
-       if (inglob==0)
-               error(Q);
-}
-
-compsub()
-{
-       register seof, c;
-       register char *p;
-
-       if ((seof = getchr()) == '\n' || seof == ' ')
-               error(Q);
-       compile(seof);
-       p = rhsbuf;
-       for (;;) {
-               c = getchr();
-               if (c=='\\')
-                       c = getchr() | 0200;
-               if (c=='\n') {
-                       if (globp)
-                               c |= 0200;
-                       else
-                               error(Q);
-               }
-               if (c==seof)
-                       break;
-               *p++ = c;
-               if (p >= &rhsbuf[LBSIZE/2])
-                       error(Q);
-       }
-       *p++ = 0;
-       if ((peekc = getchr()) == 'g') {
-               peekc = 0;
-               newline();
-               return(1);
-       }
-       newline();
-       return(0);
-}
-
-getsub()
-{
-       register char *p1, *p2;
-
-       p1 = linebuf;
-       if ((p2 = linebp) == 0)
-               return(EOF);
-       while (*p1++ = *p2++)
-               ;
-       linebp = 0;
-       return(0);
-}
-
-dosub()
-{
-       register char *lp, *sp, *rp;
-       int c;
-
-       lp = linebuf;
-       sp = genbuf;
-       rp = rhsbuf;
-       while (lp < loc1)
-               *sp++ = *lp++;
-       while (c = *rp++&0377) {
-               if (c=='&') {
-                       sp = place(sp, loc1, loc2);
-                       continue;
-               } else if (c&0200 && (c &= 0177) >='1' && c < nbra+'1') {
-                       sp = place(sp, braslist[c-'1'], braelist[c-'1']);
-                       continue;
-               }
-               *sp++ = c&0177;
-               if (sp >= &genbuf[LBSIZE])
-                       error(Q);
-       }
-       lp = loc2;
-       loc2 = sp - genbuf + linebuf;
-       while (*sp++ = *lp++)
-               if (sp >= &genbuf[LBSIZE])
-                       error(Q);
-       lp = linebuf;
-       sp = genbuf;
-       while (*lp++ = *sp++)
-               ;
-}
-
-char *
-place(sp, l1, l2)
-register char *sp, *l1, *l2;
-{
-
-       while (l1 < l2) {
-               *sp++ = *l1++;
-               if (sp >= &genbuf[LBSIZE])
-                       error(Q);
-       }
-       return(sp);
-}
-
-move(cflag)
-{
-       register int *adt, *ad1, *ad2;
-       int getcopy();
-
-       setdot();
-       nonzero();
-       if ((adt = address())==0)
-               error(Q);
-       newline();
-       if (cflag) {
-               int *ozero, delta;
-               ad1 = dol;
-               ozero = zero;
-               append(getcopy, ad1++);
-               ad2 = dol;
-               delta = zero - ozero;
-               ad1 += delta;
-               adt += delta;
-       } else {
-               ad2 = addr2;
-               for (ad1 = addr1; ad1 <= ad2;)
-                       *ad1++ &= ~01;
-               ad1 = addr1;
-       }
-       ad2++;
-       if (adt<ad1) {
-               dot = adt + (ad2-ad1);
-               if ((++adt)==ad1)
-                       return;
-               reverse(adt, ad1);
-               reverse(ad1, ad2);
-               reverse(adt, ad2);
-       } else if (adt >= ad2) {
-               dot = adt++;
-               reverse(ad1, ad2);
-               reverse(ad2, adt);
-               reverse(ad1, adt);
-       } else
-               error(Q);
-       fchange = 1;
-}
-
-reverse(a1, a2)
-register int *a1, *a2;
-{
-       register int t;
-
-       for (;;) {
-               t = *--a2;
-               if (a2 <= a1)
-                       return;
-               *a2 = *a1;
-               *a1++ = t;
-       }
-}
-
-getcopy()
-{
-       if (addr1 > addr2)
-               return(EOF);
-       getline(*addr1++);
-       return(0);
-}
-
-compile(aeof)
-{
-       register eof, c;
-       register char *ep;
-       char *lastep;
-       char bracket[NBRA], *bracketp;
-       int cclcnt;
-
-       ep = expbuf;
-       eof = aeof;
-       bracketp = bracket;
-       if ((c = getchr()) == eof) {
-               if (*ep==0)
-                       error(Q);
-               return;
-       }
-       circfl = 0;
-       nbra = 0;
-       if (c=='^') {
-               c = getchr();
-               circfl++;
-       }
-       peekc = c;
-       lastep = 0;
-       for (;;) {
-               if (ep >= &expbuf[ESIZE])
-                       goto cerror;
-               c = getchr();
-               if (c==eof) {
-                       if (bracketp != bracket)
-                               goto cerror;
-                       *ep++ = CEOF;
-                       return;
-               }
-               if (c!='*')
-                       lastep = ep;
-               switch (c) {
-
-               case '\\':
-                       if ((c = getchr())=='(') {
-                               if (nbra >= NBRA)
-                                       goto cerror;
-                               *bracketp++ = nbra;
-                               *ep++ = CBRA;
-                               *ep++ = nbra++;
-                               continue;
-                       }
-                       if (c == ')') {
-                               if (bracketp <= bracket)
-                                       goto cerror;
-                               *ep++ = CKET;
-                               *ep++ = *--bracketp;
-                               continue;
-                       }
-                       if (c>='1' && c<'1'+NBRA) {
-                               *ep++ = CBACK;
-                               *ep++ = c-'1';
-                               continue;
-                       }
-                       *ep++ = CCHR;
-                       if (c=='\n')
-                               goto cerror;
-                       *ep++ = c;
-                       continue;
-
-               case '.':
-                       *ep++ = CDOT;
-                       continue;
-
-               case '\n':
-                       goto cerror;
-
-               case '*':
-                       if (lastep==0 || *lastep==CBRA || *lastep==CKET)
-                               goto defchar;
-                       *lastep |= STAR;
-                       continue;
-
-               case '$':
-                       if ((peekc=getchr()) != eof)
-                               goto defchar;
-                       *ep++ = CDOL;
-                       continue;
-
-               case '[':
-                       *ep++ = CCL;
-                       *ep++ = 0;
-                       cclcnt = 1;
-                       if ((c=getchr()) == '^') {
-                               c = getchr();
-                               ep[-2] = NCCL;
-                       }
-                       do {
-                               if (c=='\n')
-                                       goto cerror;
-                               if (c=='-' && ep[-1]!=0) {
-                                       if ((c=getchr())==']') {
-                                               *ep++ = '-';
-                                               cclcnt++;
-                                               break;
-                                       }
-                                       while (ep[-1]<c) {
-                                               *ep = ep[-1]+1;
-                                               ep++;
-                                               cclcnt++;
-                                               if (ep>=&expbuf[ESIZE])
-                                                       goto cerror;
-                                       }
-                               }
-                               *ep++ = c;
-                               cclcnt++;
-                               if (ep >= &expbuf[ESIZE])
-                                       goto cerror;
-                       } while ((c = getchr()) != ']');
-                       lastep[1] = cclcnt;
-                       continue;
-
-               defchar:
-               default:
-                       *ep++ = CCHR;
-                       *ep++ = c;
-               }
-       }
-   cerror:
-       expbuf[0] = 0;
-       nbra = 0;
-       error(Q);
-}
-
-execute(gf, addr)
-int *addr;
-{
-       register char *p1, *p2, c;
-
-       for (c=0; c<NBRA; c++) {
-               braslist[c] = 0;
-               braelist[c] = 0;
-       }
-       if (gf) {
-               if (circfl)
-                       return(0);
-               p1 = linebuf;
-               p2 = genbuf;
-               while (*p1++ = *p2++)
-                       ;
-               locs = p1 = loc2;
-       } else {
-               if (addr==zero)
-                       return(0);
-               p1 = getline(*addr);
-               locs = 0;
-       }
-       p2 = expbuf;
-       if (circfl) {
-               loc1 = p1;
-               return(advance(p1, p2));
-       }
-       /* fast check for first character */
-       if (*p2==CCHR) {
-               c = p2[1];
-               do {
-                       if (*p1!=c)
-                               continue;
-                       if (advance(p1, p2)) {
-                               loc1 = p1;
-                               return(1);
-                       }
-               } while (*p1++);
-               return(0);
-       }
-       /* regular algorithm */
-       do {
-               if (advance(p1, p2)) {
-                       loc1 = p1;
-                       return(1);
-               }
-       } while (*p1++);
-       return(0);
-}
-
-advance(lp, ep)
-register char *ep, *lp;
-{
-       register char *curlp;
-       int i;
-
-       for (;;) switch (*ep++) {
-
-       case CCHR:
-               if (*ep++ == *lp++)
-                       continue;
-               return(0);
-
-       case CDOT:
-               if (*lp++)
-                       continue;
-               return(0);
-
-       case CDOL:
-               if (*lp==0)
-                       continue;
-               return(0);
-
-       case CEOF:
-               loc2 = lp;
-               return(1);
-
-       case CCL:
-               if (cclass(ep, *lp++, 1)) {
-                       ep += *ep;
-                       continue;
-               }
-               return(0);
-
-       case NCCL:
-               if (cclass(ep, *lp++, 0)) {
-                       ep += *ep;
-                       continue;
-               }
-               return(0);
-
-       case CBRA:
-               braslist[*ep++] = lp;
-               continue;
-
-       case CKET:
-               braelist[*ep++] = lp;
-               continue;
-
-       case CBACK:
-               if (braelist[i = *ep++]==0)
-                       error(Q);
-               if (backref(i, lp)) {
-                       lp += braelist[i] - braslist[i];
-                       continue;
-               }
-               return(0);
-
-       case CBACK|STAR:
-               if (braelist[i = *ep++] == 0)
-                       error(Q);
-               curlp = lp;
-               while (backref(i, lp))
-                       lp += braelist[i] - braslist[i];
-               while (lp >= curlp) {
-                       if (advance(lp, ep))
-                               return(1);
-                       lp -= braelist[i] - braslist[i];
-               }
-               continue;
-
-       case CDOT|STAR:
-               curlp = lp;
-               while (*lp++)
-                       ;
-               goto star;
-
-       case CCHR|STAR:
-               curlp = lp;
-               while (*lp++ == *ep)
-                       ;
-               ep++;
-               goto star;
-
-       case CCL|STAR:
-       case NCCL|STAR:
-               curlp = lp;
-               while (cclass(ep, *lp++, ep[-1]==(CCL|STAR)))
-                       ;
-               ep += *ep;
-               goto star;
-
-       star:
-               do {
-                       lp--;
-                       if (lp==locs)
-                               break;
-                       if (advance(lp, ep))
-                               return(1);
-               } while (lp > curlp);
-               return(0);
-
-       default:
-               error(Q);
-       }
-}
-
-backref(i, lp)
-register i;
-register char *lp;
-{
-       register char *bp;
-
-       bp = braslist[i];
-       while (*bp++ == *lp++)
-               if (bp >= braelist[i])
-                       return(1);
-       return(0);
-}
-
-cclass(set, c, af)
-register char *set, c;
-{
-       register n;
-
-       if (c==0)
-               return(0);
-       n = *set++;
-       while (--n)
-               if (*set++ == c)
-                       return(af);
-       return(!af);
-}
-
-putd()
-{
-       register r;
-
-       r = count%10;
-       count /= 10;
-       if (count)
-               putd();
-       putchr(r + '0');
-}
-
-puts(sp)
-register char *sp;
-{
-       col = 0;
-       while (*sp)
-               putchr(*sp++);
-       putchr('\n');
-}
-
-char   line[70];
-char   *linp   = line;
-
-putchr(ac)
-{
-       register char *lp;
-       register c;
-
-       lp = linp;
-       c = ac;
-       if (listf) {
-               col++;
-               if (col >= 72) {
-                       col = 0;
-                       *lp++ = '\\';
-                       *lp++ = '\n';
-               }
-               if (c=='\t') {
-                       c = '>';
-                       goto esc;
-               }
-               if (c=='\b') {
-                       c = '<';
-               esc:
-                       *lp++ = '-';
-                       *lp++ = '\b';
-                       *lp++ = c;
-                       goto out;
-               }
-               if (c<' ' && c!= '\n') {
-                       *lp++ = '\\';
-                       *lp++ = (c>>3)+'0';
-                       *lp++ = (c&07)+'0';
-                       col += 2;
-                       goto out;
-               }
-       }
-       *lp++ = c;
-out:
-       if(c == '\n' || lp >= &line[64]) {
-               linp = line;
-               write(1, line, lp-line);
-               return;
-       }
-       linp = lp;
-}
-crblock(permp, buf, nchar, startn)
-char *permp;
-char *buf;
-long startn;
-{
-       register char *p1;
-       int n1;
-       int n2;
-       register char *t1, *t2, *t3;
-
-       t1 = permp;
-       t2 = &permp[256];
-       t3 = &permp[512];
-
-       n1 = startn&0377;
-       n2 = (startn>>8)&0377;
-       p1 = buf;
-       while(nchar--) {
-               *p1 = t2[(t3[(t1[(*p1+n1)&0377]+n2)&0377]-n2)&0377]-n1;
-               n1++;
-               if(n1==256){
-                       n1 = 0;
-                       n2++;
-                       if(n2==256) n2 = 0;
-               }
-               p1++;
-       }
-}
-
-getkey()
-{
-       struct sgttyb b;
-       int save;
-       int (*sig)();
-       register char *p;
-       register c;
-
-       sig = signal(SIGINT, SIG_IGN);
-       if (gtty(0, &b) == -1)
-               error("Input not tty");
-       save = b.sg_flags;
-       b.sg_flags &= ~ECHO;
-       stty(0, &b);
-       puts("Key:");
-       p = key;
-       while(((c=getchr()) != EOF) && (c!='\n')) {
-               if(p < &key[KSIZE])
-                       *p++ = c;
-       }
-       *p = 0;
-       b.sg_flags = save;
-       stty(0, &b);
-       signal(SIGINT, sig);
-       return(key[0] != 0);
-}
-
-/*
- * Besides initializing the encryption machine, this routine
- * returns 0 if the key is null, and 1 if it is non-null.
- */
-crinit(keyp, permp)
-char   *keyp, *permp;
-{
-       register char *t1, *t2, *t3;
-       register i;
-       int ic, k, temp, pf[2];
-       unsigned random;
-       char buf[13];
-       long seed;
-
-       t1 = permp;
-       t2 = &permp[256];
-       t3 = &permp[512];
-       if(*keyp == 0)
-               return(0);
-       strncpy(buf, keyp, 8);
-       while (*keyp)
-               *keyp++ = '\0';
-       buf[8] = buf[0];
-       buf[9] = buf[1];
-       if (pipe(pf)<0)
-               pf[0] = pf[1] = -1;
-       if (fork()==0) {
-               close(0);
-               close(1);
-               dup(pf[0]);
-               dup(pf[1]);
-               execl("/usr/lib/makekey", "-", 0);
-               execl("/lib/makekey", "-", 0);
-               exit(1);
-       }
-       write(pf[1], buf, 10);
-       if (wait((int *)NULL)==-1 || read(pf[0], buf, 13)!=13)
-               error("crypt: cannot generate key");
-       close(pf[0]);
-       close(pf[1]);
-       seed = 123;
-       for (i=0; i<13; i++)
-               seed = seed*buf[i] + i;
-       for(i=0;i<256;i++){
-               t1[i] = i;
-               t3[i] = 0;
-       }
-       for(i=0; i<256; i++) {
-               seed = 5*seed + buf[i%13];
-               random = seed % 65521;
-               k = 256-1 - i;
-               ic = (random&0377) % (k+1);
-               random >>= 8;
-               temp = t1[k];
-               t1[k] = t1[ic];
-               t1[ic] = temp;
-               if(t3[k]!=0) continue;
-               ic = (random&0377) % k;
-               while(t3[ic]!=0) ic = (ic+1) % k;
-               t3[k] = ic;
-               t3[ic] = k;
-       }
-       for(i=0; i<256; i++)
-               t2[t1[i]&0377] = i;
-       return(1);
-}
-
-makekey(a, b)
-char *a, *b;
-{
-       register int i;
-       long t;
-       char temp[KSIZE + 1];
-
-       for(i = 0; i < KSIZE; i++)
-               temp[i] = *a++;
-       time(&t);
-       t += getpid();
-       for(i = 0; i < 4; i++)
-               temp[i] ^= (t>>(8*i))&0377;
-       crinit(temp, b);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/egrep.y b/.ref-Research-V7/usr/src/cmd/egrep.y
deleted file mode 100644 (file)
index 58b81c6..0000000
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * egrep -- print lines containing (or not containing) a regular expression
- *
- *     status returns:
- *             0 - ok, and some matches
- *             1 - ok, but no matches
- *             2 - some error
- */
-%token CHAR DOT CCL NCCL OR CAT STAR PLUS QUEST
-%left OR
-%left CHAR DOT CCL NCCL '('
-%left CAT
-%left STAR PLUS QUEST
-
-%{
-#include <stdio.h>
-
-#define MAXLIN 350
-#define MAXPOS 4000
-#define NCHARS 128
-#define NSTATES 128
-#define FINAL -1
-char gotofn[NSTATES][NCHARS];
-int state[NSTATES];
-char out[NSTATES];
-int line 1;
-int name[MAXLIN];
-int left[MAXLIN];
-int right[MAXLIN];
-int parent[MAXLIN];
-int foll[MAXLIN];
-int positions[MAXPOS];
-char chars[MAXLIN];
-int nxtpos;
-int nxtchar 0;
-int tmpstat[MAXLIN];
-int initstat[MAXLIN];
-int xstate;
-int count;
-int icount;
-char *input;
-
-long   lnum;
-int    bflag;
-int    cflag;
-int    fflag;
-int    lflag;
-int    nflag;
-int    hflag   = 1;
-int    sflag;
-int    vflag;
-int    nfile;
-long   blkno;
-long   tln;
-int    nsucc;
-
-int    f;
-int    fname;
-%}
-
-%%
-s:     t
-               ={ unary(FINAL, $1);
-                 line--;
-               }
-       ;
-t:     b r
-               ={ $$ = node(CAT, $1, $2); }
-       | OR b r OR
-               ={ $$ = node(CAT, $2, $3); }
-       | OR b r
-               ={ $$ = node(CAT, $2, $3); }
-       | b r OR
-               ={ $$ = node(CAT, $1, $2); }
-       ;
-b:
-               ={ $$ = enter(DOT);
-                  $$ = unary(STAR, $$); }
-       ;
-r:     CHAR
-               ={ $$ = enter($1); }
-       | DOT
-               ={ $$ = enter(DOT); }
-       | CCL
-               ={ $$ = cclenter(CCL); }
-       | NCCL
-               ={ $$ = cclenter(NCCL); }
-       ;
-
-r:     r OR r
-               ={ $$ = node(OR, $1, $3); }
-       | r r %prec CAT
-               ={ $$ = node(CAT, $1, $2); }
-       | r STAR
-               ={ $$ = unary(STAR, $1); }
-       | r PLUS
-               ={ $$ = unary(PLUS, $1); }
-       | r QUEST
-               ={ $$ = unary(QUEST, $1); }
-       | '(' r ')'
-               ={ $$ = $2; }
-       | error 
-       ;
-
-%%
-yyerror(s) {
-       fprintf(stderr, "egrep: %s\n", s);
-       exit(2);
-}
-
-yylex() {
-       extern int yylval;
-       int cclcnt, x;
-       register char c, d;
-       switch(c = nextch()) {
-               case '$':
-               case '^': c = '\n';
-                       goto defchar;
-               case '|': return (OR);
-               case '*': return (STAR);
-               case '+': return (PLUS);
-               case '?': return (QUEST);
-               case '(': return (c);
-               case ')': return (c);
-               case '.': return (DOT);
-               case '\0': return (0);
-               case '\n': return (OR);
-               case '[': 
-                       x = CCL;
-                       cclcnt = 0;
-                       count = nxtchar++;
-                       if ((c = nextch()) == '^') {
-                               x = NCCL;
-                               c = nextch();
-                       }
-                       do {
-                               if (c == '\0') synerror();
-                               if (c == '-' && cclcnt > 0 && chars[nxtchar-1] != 0) {
-                                       if ((d = nextch()) != 0) {
-                                               c = chars[nxtchar-1];
-                                               while (c < d) {
-                                                       if (nxtchar >= MAXLIN) overflo();
-                                                       chars[nxtchar++] = ++c;
-                                                       cclcnt++;
-                                               }
-                                               continue;
-                                       }
-                               }
-                               if (nxtchar >= MAXLIN) overflo();
-                               chars[nxtchar++] = c;
-                               cclcnt++;
-                       } while ((c = nextch()) != ']');
-                       chars[count] = cclcnt;
-                       return (x);
-               case '\\':
-                       if ((c = nextch()) == '\0') synerror();
-               defchar:
-               default: yylval = c; return (CHAR);
-       }
-}
-nextch() {
-       register char c;
-       if (fflag) {
-               if ((c = getc(stdin)) == EOF) return(0);
-       }
-       else c = *input++;
-       return(c);
-}
-
-synerror() {
-       fprintf(stderr, "egrep: syntax error\n");
-       exit(2);
-}
-
-enter(x) int x; {
-       if(line >= MAXLIN) overflo();
-       name[line] = x;
-       left[line] = 0;
-       right[line] = 0;
-       return(line++);
-}
-
-cclenter(x) int x; {
-       register linno;
-       linno = enter(x);
-       right[linno] = count;
-       return (linno);
-}
-
-node(x, l, r) {
-       if(line >= MAXLIN) overflo();
-       name[line] = x;
-       left[line] = l;
-       right[line] = r;
-       parent[l] = line;
-       parent[r] = line;
-       return(line++);
-}
-
-unary(x, d) {
-       if(line >= MAXLIN) overflo();
-       name[line] = x;
-       left[line] = d;
-       right[line] = 0;
-       parent[d] = line;
-       return(line++);
-}
-overflo() {
-       fprintf(stderr, "egrep: regular expression too long\n");
-       exit(2);
-}
-
-cfoll(v) {
-       register i;
-       if (left[v] == 0) {
-               count = 0;
-               for (i=1; i<=line; i++) tmpstat[i] = 0;
-               follow(v);
-               add(foll, v);
-       }
-       else if (right[v] == 0) cfoll(left[v]);
-       else {
-               cfoll(left[v]);
-               cfoll(right[v]);
-       }
-}
-cgotofn() {
-       register c, i, k;
-       int n, s;
-       char symbol[NCHARS];
-       int j, nc, pc, pos;
-       int curpos, num;
-       int number, newpos;
-       count = 0;
-       for (n=3; n<=line; n++) tmpstat[n] = 0;
-       if (cstate(line-1)==0) {
-               tmpstat[line] = 1;
-               count++;
-               out[0] = 1;
-       }
-       for (n=3; n<=line; n++) initstat[n] = tmpstat[n];
-       count--;                /*leave out position 1 */
-       icount = count;
-       tmpstat[1] = 0;
-       add(state, 0);
-       n = 0;
-       for (s=0; s<=n; s++)  {
-               if (out[s] == 1) continue;
-               for (i=0; i<NCHARS; i++) symbol[i] = 0;
-               num = positions[state[s]];
-               count = icount;
-               for (i=3; i<=line; i++) tmpstat[i] = initstat[i];
-               pos = state[s] + 1;
-               for (i=0; i<num; i++) {
-                       curpos = positions[pos];
-                       if ((c = name[curpos]) >= 0) {
-                               if (c < NCHARS) symbol[c] = 1;
-                               else if (c == DOT) {
-                                       for (k=0; k<NCHARS; k++)
-                                               if (k!='\n') symbol[k] = 1;
-                               }
-                               else if (c == CCL) {
-                                       nc = chars[right[curpos]];
-                                       pc = right[curpos] + 1;
-                                       for (k=0; k<nc; k++) symbol[chars[pc++]] = 1;
-                               }
-                               else if (c == NCCL) {
-                                       nc = chars[right[curpos]];
-                                       for (j = 0; j < NCHARS; j++) {
-                                               pc = right[curpos] + 1;
-                                               for (k = 0; k < nc; k++)
-                                                       if (j==chars[pc++]) goto cont;
-                                               if (j!='\n') symbol[j] = 1;
-                                               cont:;
-                                       }
-                               }
-                               else printf("something's funny\n");
-                       }
-                       pos++;
-               }
-               for (c=0; c<NCHARS; c++) {
-                       if (symbol[c] == 1) { /* nextstate(s,c) */
-                               count = icount;
-                               for (i=3; i <= line; i++) tmpstat[i] = initstat[i];
-                               pos = state[s] + 1;
-                               for (i=0; i<num; i++) {
-                                       curpos = positions[pos];
-                                       if ((k = name[curpos]) >= 0)
-                                               if (
-                                                       (k == c)
-                                                       | (k == DOT)
-                                                       | (k == CCL && member(c, right[curpos], 1))
-                                                       | (k == NCCL && member(c, right[curpos], 0))
-                                               ) {
-                                                       number = positions[foll[curpos]];
-                                                       newpos = foll[curpos] + 1;
-                                                       for (k=0; k<number; k++) {
-                                                               if (tmpstat[positions[newpos]] != 1) {
-                                                                       tmpstat[positions[newpos]] = 1;
-                                                                       count++;
-                                                               }
-                                                               newpos++;
-                                                       }
-                                               }
-                                       pos++;
-                               } /* end nextstate */
-                               if (notin(n)) {
-                                       if (n >= NSTATES) overflo();
-                                       add(state, ++n);
-                                       if (tmpstat[line] == 1) out[n] = 1;
-                                       gotofn[s][c] = n;
-                               }
-                               else {
-                                       gotofn[s][c] = xstate;
-                               }
-                       }
-               }
-       }
-}
-
-cstate(v) {
-       register b;
-       if (left[v] == 0) {
-               if (tmpstat[v] != 1) {
-                       tmpstat[v] = 1;
-                       count++;
-               }
-               return(1);
-       }
-       else if (right[v] == 0) {
-               if (cstate(left[v]) == 0) return (0);
-               else if (name[v] == PLUS) return (1);
-               else return (0);
-       }
-       else if (name[v] == CAT) {
-               if (cstate(left[v]) == 0 && cstate(right[v]) == 0) return (0);
-               else return (1);
-       }
-       else { /* name[v] == OR */
-               b = cstate(right[v]);
-               if (cstate(left[v]) == 0 || b == 0) return (0);
-               else return (1);
-       }
-}
-
-
-member(symb, set, torf) {
-       register i, num, pos;
-       num = chars[set];
-       pos = set + 1;
-       for (i=0; i<num; i++)
-               if (symb == chars[pos++]) return (torf);
-       return (!torf);
-}
-
-notin(n) {
-       register i, j, pos;
-       for (i=0; i<=n; i++) {
-               if (positions[state[i]] == count) {
-                       pos = state[i] + 1;
-                       for (j=0; j < count; j++)
-                               if (tmpstat[positions[pos++]] != 1) goto nxt;
-                       xstate = i;
-                       return (0);
-               }
-               nxt: ;
-       }
-       return (1);
-}
-
-add(array, n) int *array; {
-       register i;
-       if (nxtpos + count > MAXPOS) overflo();
-       array[n] = nxtpos;
-       positions[nxtpos++] = count;
-       for (i=3; i <= line; i++) {
-               if (tmpstat[i] == 1) {
-                       positions[nxtpos++] = i;
-               }
-       }
-}
-
-follow(v) int v; {
-       int p;
-       if (v == line) return;
-       p = parent[v];
-       switch(name[p]) {
-               case STAR:
-               case PLUS:      cstate(v);
-                               follow(p);
-                               return;
-
-               case OR:
-               case QUEST:     follow(p);
-                               return;
-
-               case CAT:       if (v == left[p]) {
-                                       if (cstate(right[p]) == 0) {
-                                               follow(p);
-                                               return;
-                                       }
-                               }
-                               else follow(p);
-                               return;
-               case FINAL:     if (tmpstat[line] != 1) {
-                                       tmpstat[line] = 1;
-                                       count++;
-                               }
-                               return;
-       }
-}
-
-
-main(argc, argv)
-char **argv;
-{
-       while (--argc > 0 && (++argv)[0][0]=='-')
-               switch (argv[0][1]) {
-
-               case 's':
-                       sflag++;
-                       continue;
-
-               case 'h':
-                       hflag = 0;
-                       continue;
-
-               case 'b':
-                       bflag++;
-                       continue;
-
-               case 'c':
-                       cflag++;
-                       continue;
-
-               case 'e':
-                       argc--;
-                       argv++;
-                       goto out;
-
-               case 'f':
-                       fflag++;
-                       continue;
-
-               case 'l':
-                       lflag++;
-                       continue;
-
-               case 'n':
-                       nflag++;
-                       continue;
-
-               case 'v':
-                       vflag++;
-                       continue;
-
-               default:
-                       fprintf(stderr, "egrep: unknown flag\n");
-                       continue;
-               }
-out:
-       if (argc<=0)
-               exit(2);
-       if (fflag) {
-               if (freopen(fname = *argv, "r", stdin) == NULL) {
-                       fprintf(stderr, "egrep: can't open %s\n", fname);
-                       exit(2);
-               }
-       }
-       else input = *argv;
-       argc--;
-       argv++;
-
-       yyparse();
-
-       cfoll(line-1);
-       cgotofn();
-       nfile = argc;
-       if (argc<=0) {
-               if (lflag) exit(1);
-               execute(0);
-       }
-       else while (--argc >= 0) {
-               execute(*argv);
-               argv++;
-       }
-       exit(nsucc == 0);
-}
-
-execute(file)
-char *file;
-{
-       register char *p;
-       register cstat;
-       register ccount;
-       char buf[1024];
-       char *nlp;
-       int istat;
-       if (file) {
-               if ((f = open(file, 0)) < 0) {
-                       fprintf(stderr, "egrep: can't open %s\n", file);
-                       exit(2);
-               }
-       }
-       else f = 0;
-       ccount = 0;
-       lnum = 1;
-       tln = 0;
-       p = buf;
-       nlp = p;
-       if ((ccount = read(f,p,512))<=0) goto done;
-       blkno = ccount;
-       istat = cstat = gotofn[0]['\n'];
-       if (out[cstat]) goto found;
-       for (;;) {
-               cstat = gotofn[cstat][*p&0377]; /* all input chars made positive */
-               if (out[cstat]) {
-               found:  for(;;) {
-                               if (*p++ == '\n') {
-                                       if (vflag == 0) {
-                               succeed:        nsucc = 1;
-                                               if (cflag) tln++;
-                                               else if (sflag)
-                                                       ;       /* ugh */
-                                               else if (lflag) {
-                                                       printf("%s\n", file);
-                                                       close(f);
-                                                       return;
-                                               }
-                                               else {
-                                                       if (nfile > 1 && hflag) printf("%s:", file);
-                                                       if (bflag) printf("%ld:", (blkno-ccount-1)/512);
-                                                       if (nflag) printf("%ld:", lnum);
-                                                       if (p <= nlp) {
-                                                               while (nlp < &buf[1024]) putchar(*nlp++);
-                                                               nlp = buf;
-                                                       }
-                                                       while (nlp < p) putchar(*nlp++);
-                                               }
-                                       }
-                                       lnum++;
-                                       nlp = p;
-                                       if ((out[(cstat=istat)]) == 0) goto brk2;
-                               }
-                               cfound:
-                               if (--ccount <= 0) {
-                                       if (p <= &buf[512]) {
-                                               if ((ccount = read(f, p, 512)) <= 0) goto done;
-                                       }
-                                       else if (p == &buf[1024]) {
-                                               p = buf;
-                                               if ((ccount = read(f, p, 512)) <= 0) goto done;
-                                       }
-                                       else {
-                                               if ((ccount = read(f, p, &buf[1024]-p)) <= 0) goto done;
-                                       }
-                                       if(nlp>p && nlp<=p+ccount)
-                                               nlp = p+ccount;
-                                       blkno += ccount;
-                               }
-                       }
-               }
-               if (*p++ == '\n') {
-                       if (vflag) goto succeed;
-                       else {
-                               lnum++;
-                               nlp = p;
-                               if (out[(cstat=istat)]) goto cfound;
-                       }
-               }
-               brk2:
-               if (--ccount <= 0) {
-                       if (p <= &buf[512]) {
-                               if ((ccount = read(f, p, 512)) <= 0) break;
-                       }
-                       else if (p == &buf[1024]) {
-                               p = buf;
-                               if ((ccount = read(f, p, 512)) <= 0) break;
-                       }
-                       else {
-                               if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break;
-                       }
-                       if(nlp>p && nlp<=p+ccount)
-                               nlp = p+ccount;
-                       blkno += ccount;
-               }
-       }
-done:  close(f);
-       if (cflag) {
-               if (nfile > 1)
-                       printf("%s:", file);
-               printf("%ld\n", tln);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/diacrit.c b/.ref-Research-V7/usr/src/cmd/eqn/diacrit.c
deleted file mode 100644 (file)
index 236868f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-diacrit(p1, type) int p1, type; {
-       int c, t, effps;
-
-       c = oalloc();
-       t = oalloc();
-       effps = EFFPS(ps);
-       nrwid(p1, effps, p1);
-       printf(".nr 10 %du\n", VERT(max(eht[p1]-ebase[p1]-6*ps,0)));    /* vertical shift if high */
-       printf(".if \\n(ct>1 .nr 10 \\n(10+\\s%d.25m\\s0\n", effps);
-       printf(".nr %d \\s%d.1m\\s0\n", t, effps);      /* horiz shift if high */
-       printf(".if \\n(ct>1 .nr %d \\s%d.15m\\s0\n", t, effps);
-       switch(type) {
-               case VEC:
-                       printf(".ds %d \\v'-.4m'\\s%d\\(->\\s0\\v'.4m'\n", c, max(effps-3, 6));
-                       break;
-               case DYAD:
-                       printf(".ds %d \\v'-.4m'\\s%d\\z\\(<-\\(->\\s0\\v'.4m'\n", c, max(effps-3, 6));
-                       break;
-               case HAT:
-                       printf(".ds %d ^\n", c);
-                       break;
-               case TILDE:
-                       printf(".ds %d ~\n", c);
-                       break;
-               case DOT:
-                       printf(".ds %d \\s%d\\v'-.67m'.\\v'.67m'\\s0\n", c, effps);
-                       break;
-               case DOTDOT:
-                       printf(".ds %d \\s%d\\v'-.67m'..\\v'.67m\\s0'\n", c, effps);
-                       break;
-               case BAR:
-                       printf(".ds %d \\s%d\\v'.18m'\\h'.05m'\\l'\\n(%du-.1m\\(rn'\\h'.05m'\\v'-.18m'\\s0\n",
-                               c, effps, p1);
-                       break;
-               case UNDER:
-                       printf(".ds %d \\l'\\n(%du\\(ul'\n", c, p1);
-                       printf(".nr %d 0\n", t);
-                       printf(".nr 10 0-%d\n", ebase[p1]);
-                       break;
-               }
-       nrwid(c, ps, c);
-       if (lfont[p1] != ITAL)
-               printf(".nr %d 0\n", t);
-       printf(".as %d \\h'-\\n(%du-\\n(%du/2u+\\n(%du'\\v'0-\\n(10u'\\*(%d", 
-               p1, p1, c, t, c);
-       printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u-\\n(%du'\n", c, p1, t);
-       /* BUG - should go to right end of widest */
-       if (type != UNDER)
-               eht[p1] += VERT( (6*ps*15) / 100);      /* 0.15m */
-       if(dbg)printf(".\tdiacrit: %c over S%d, lf=%c, rf=%c, h=%d,b=%d\n",
-               type, p1, lfont[p1], rfont[p1], eht[p1], ebase[p1]);
-       ofree(c); ofree(t);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/e.h b/.ref-Research-V7/usr/src/cmd/eqn/e.h
deleted file mode 100644 (file)
index 54fa047..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdio.h>
-
-#define        FATAL   1
-#define        ROM     '1'
-#define        ITAL    '2'
-#define        BLD     '3'
-
-#define        VERT(n) ((((n)+1)/3)*3)
-#define        EFFPS(p)        ((p) >= 6 ? (p) : 6)
-
-extern int     dbg;
-extern int     ct;
-extern int     lp[];
-extern int     used[]; /* available registers */
-extern int     ps;     /* dflt init pt size */
-extern int     deltaps;        /* default change in ps */
-extern int     gsize;  /* global size */
-extern int     gfont;  /* global font */
-extern int     ft;     /* dflt font */
-extern FILE    *curfile;       /* current input file */
-extern int     ifile;  /* input file number */
-extern int     linect; /* line number in current file */
-extern int     eqline; /* line where eqn started */
-extern int     svargc;
-extern char    **svargv;
-extern int     eht[];
-extern int     ebase[];
-extern int     lfont[];
-extern int     rfont[];
-extern int     yyval;
-extern int     *yypv;
-extern int     yylval;
-extern int     eqnreg, eqnht;
-extern int     lefteq, righteq;
-extern int     lastchar;       /* last character read by lex */
-extern int     markline;       /* 1 if this EQ/EN contains mark or lineup */
-
-typedef struct s_tbl {
-       char    *name;
-       char    *defn;
-       struct s_tbl *next;
-} tbl;
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/e.y b/.ref-Research-V7/usr/src/cmd/eqn/e.y
deleted file mode 100644 (file)
index f294e59..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-%{#
-#include "e.h"
-#
-int    fromflg;
-%}
-%term  CONTIG QTEXT SPACE THIN TAB
-%term  MATRIX LCOL CCOL RCOL COL
-%term  MARK LINEUP
-%term  SUM INT PROD UNION INTER
-%term  LPILE PILE CPILE RPILE ABOVE
-%term  DEFINE TDEFINE NDEFINE DELIM GSIZE GFONT INCLUDE
-%right FROM TO
-%left  OVER SQRT
-%right SUP SUB
-%right SIZE FONT ROMAN ITALIC BOLD FAT
-%right UP DOWN BACK FWD
-%left  LEFT RIGHT
-%right DOT DOTDOT HAT TILDE BAR UNDER VEC DYAD
-
-%%
-
-stuff  : eqn   { putout($1); }
-       | error { error(!FATAL, "syntax error"); }
-       |       { eqnreg = 0; }
-       ;
-
-eqn    : box
-       | eqn box       { eqnbox($1, $2, 0); }
-       | eqn lineupbox { eqnbox($1, $2, 1); }
-       | LINEUP        { lineup(0); }
-       ;
-
-lineupbox: LINEUP box  { $$ = $2; lineup(1); }
-       ;
-
-matrix : MATRIX        { $$ = ct; } ;
-
-collist        : column
-       | collist column
-       ;
-
-column : lcol '{' list '}'     { column('L', $1); }
-       | ccol '{' list '}'     { column('C', $1); }
-       | rcol '{' list '}'     { column('R', $1); }
-       | col '{' list '}'      { column('-', $1); }
-       ;
-
-lcol   : LCOL          { $$ = ct++; } ;
-ccol   : CCOL          { $$ = ct++; } ;
-rcol   : RCOL          { $$ = ct++; } ;
-col    : COL           { $$ = ct++; } ;
-
-sbox   : sup box       %prec SUP       { $$ = $2; }
-       ;
-
-tbox   : to box        %prec TO        { $$ = $2; }
-       |               %prec FROM      { $$ = 0; }
-       ;
-
-box    : box OVER box  { boverb($1, $3); }
-       | MARK box      { mark($2); }
-       | size box      %prec SIZE      { size($1, $2); }
-       | font box      %prec FONT      { font($1, $2); }
-       | FAT box       { fatbox($2); }
-       | SQRT box      { sqrt($2); }
-       | lpile '{' list '}'    { lpile('L', $1, ct); ct = $1; }
-       | cpile '{' list '}'    { lpile('C', $1, ct); ct = $1; }
-       | rpile '{' list '}'    { lpile('R', $1, ct); ct = $1; }
-       | pile '{' list '}'     { lpile('-', $1, ct); ct = $1; }
-       | box sub box sbox      %prec SUB       { shift2($1, $3, $4); }
-       | box sub box           %prec SUB       { bshiftb($1, $2, $3); }
-       | box sup box           %prec SUP       { bshiftb($1, $2, $3); }
-       | int sub box sbox      %prec SUB       { integral($1, $3, $4); }
-       | int sub box           %prec SUB       { integral($1, $3, 0); }
-       | int sup box           %prec SUP       { integral($1, 0, $3); }
-       | int                                   { integral($1, 0, 0); }
-       | left eqn right        { paren($1, $2, $3); }
-       | pbox
-       | box from box tbox     %prec FROM      { fromto($1, $3, $4); fromflg=0; }
-       | box to box    %prec TO        { fromto($1, 0, $3); }
-       | box diacrit   { diacrit($1, $2); }
-       | fwd box       %prec UP        { move(FWD, $1, $2); }
-       | up box        %prec UP        { move(UP, $1, $2); }
-       | back box      %prec UP        { move(BACK, $1, $2); }
-       | down box      %prec UP        { move(DOWN, $1, $2); }
-       | matrix '{' collist '}'        { matrix($1); }
-       ;
-
-int    : INT   { setintegral(); }
-       ;
-
-fwd    : FWD text      { $$ = atoi((char *) $1); } ;
-up     : UP text       { $$ = atoi((char *) $1); } ;
-back   : BACK text     { $$ = atoi((char *) $1); } ;
-down   : DOWN text     { $$ = atoi((char *) $1); } ;
-
-diacrit        : HAT   { $$ = HAT; }
-       | VEC   { $$ = VEC; }
-       | DYAD  { $$ = DYAD; }
-       | BAR   { $$ = BAR; }
-       | UNDER { $$ = UNDER; } /* under bar */
-       | DOT   { $$ = DOT; }
-       | TILDE { $$ = TILDE; }
-       | DOTDOT        { $$ = DOTDOT; } /* umlaut = double dot */
-       ;
-
-from   : FROM  { $$=ps; ps -= 3; fromflg = 1;
-               if(dbg)printf(".\tfrom: old ps %d, new ps %d, fflg %d\n", $$, ps, fromflg);
-               }
-       ;
-
-to     : TO    { $$=ps; if(fromflg==0)ps -= 3; 
-                       if(dbg)printf(".\tto: old ps %d, new ps %d\n", $$, ps);
-               }
-       ;
-
-left   : LEFT text     { $$ = ((char *)$2)[0]; }
-       | LEFT '{'      { $$ = '{'; }
-       ;
-
-right  : RIGHT text    { $$ = ((char *)$2)[0]; }
-       | RIGHT '}'     { $$ = '}'; }
-       |               { $$ = 0; }
-       ;
-
-list   : eqn   { lp[ct++] = $1; }
-       | list ABOVE eqn        { lp[ct++] = $3; }
-       ;
-
-lpile  : LPILE { $$ = ct; } ;
-cpile  : CPILE { $$ = ct; } ;
-pile   : PILE  { $$ = ct; } ;
-rpile  : RPILE { $$ = ct; } ;
-
-size   : SIZE text     { $$ = ps; setsize((char *) $2); }
-       ;
-
-font   : ROMAN         { setfont(ROM); }
-       | ITALIC        { setfont(ITAL); }
-       | BOLD          { setfont(BLD); }
-       | FONT text     { setfont(((char *)$2)[0]); }
-       ;
-
-sub    : SUB   { shift(SUB); }
-       ;
-
-sup    : SUP   { shift(SUP); }
-       ;
-
-pbox   : '{' eqn '}'   { $$ = $2; }
-       | QTEXT         { text(QTEXT, (char *) $1); }
-       | CONTIG        { text(CONTIG, (char *) $1); }
-       | SPACE         { text(SPACE, 0); }
-       | THIN          { text(THIN, 0); }
-       | TAB           { text(TAB, 0); }
-       | SUM           { funny(SUM); }
-       | PROD          { funny(PROD); }
-       | UNION         { funny(UNION); }
-       | INTER         { funny(INTER); }       /* intersection */
-       ;
-
-text   : CONTIG
-       | QTEXT
-       ;
-
-%%
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/eqnbox.c b/.ref-Research-V7/usr/src/cmd/eqn/eqnbox.c
deleted file mode 100644 (file)
index 2aea8da..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# include "e.h"
-
-eqnbox(p1, p2, lu) {
-       int b, h;
-       char *sh;
-
-       yyval = p1;
-       b = max(ebase[p1], ebase[p2]);
-       eht[yyval] = h = b + max(eht[p1]-ebase[p1], 
-               eht[p2]-ebase[p2]);
-       ebase[yyval] = b;
-       if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", 
-               yyval, p1, p2, b, h);
-       if (rfont[p1] == ITAL && lfont[p2] == ROM)
-               sh = "\\|";
-       else
-               sh = "";
-       if (lu) {
-               printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh);
-               printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1);
-       }
-       printf(".as %d \"%s\\*(%d\n", yyval, sh, p2);
-       rfont[p1] = rfont[p2];
-       ofree(p2);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/font.c b/.ref-Research-V7/usr/src/cmd/eqn/font.c
deleted file mode 100644 (file)
index 3ef0e85..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# include "e.h"
-
-setfont(ch1) char ch1; {
-       /* use number '1', '2', '3' for roman, italic, bold */
-       yyval = ft;
-       if (ch1 == 'r' || ch1 == 'R')
-               ft = ROM;
-       else if (ch1 == 'i' || ch1 == 'I')
-               ft = ITAL;
-       else if (ch1 == 'b' || ch1 == 'B')
-               ft = BLD;
-       else
-               ft = ch1;
-       printf(".ft %c\n", ft);
-       if(dbg)printf(".\tsetfont %c %c\n", ch1, ft);
-}
-
-font(p1, p2) int p1, p2; {
-               /* old font in p1, new in ft */
-       yyval = p2;
-       lfont[yyval] = rfont[yyval] = ft==ITAL ? ITAL : ROM;
-       if(dbg)printf(".\tb:fb: S%d <- \\f%c S%d \\f%c b=%d,h=%d,lf=%c,rf=%c\n", 
-               yyval, ft, p2, p1, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]);
-       printf(".ds %d \\f%c\\*(%d\\f%c\n", 
-               yyval, ft, p2, p1);
-       ft = p1;
-       printf(".ft %c\n", ft);
-}
-
-fatbox(p) int p; {
-       int sh;
-
-       yyval = p;
-       sh = ps / 4;
-       nrwid(p, ps, p);
-       printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p);
-       if(dbg)printf(".\tfat %d, sh=%d\n", p, sh);
-}
-
-globfont() {
-       char temp[20];
-
-       getstr(temp, 20);
-       yyval = eqnreg = 0;
-       gfont = temp[0];
-       switch (gfont) {
-       case 'r': case 'R':
-               gfont = '1';
-               break;
-       case 'i': case 'I':
-               gfont = '2';
-               break;
-       case 'b': case 'B':
-               gfont = '3';
-               break;
-       }
-       printf(".ft %c\n", gfont);
-       ft = gfont;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/fromto.c b/.ref-Research-V7/usr/src/cmd/eqn/fromto.c
deleted file mode 100644 (file)
index d973b15..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# include "e.h"
-
-fromto(p1, p2, p3) int p1, p2, p3; {
-       int b, h1, b1, pss;
-       yyval = oalloc();
-       lfont[yyval] = rfont[yyval] = 0;
-       h1 = eht[yyval] = eht[p1];
-       b1 = ebase[p1];
-       b = 0;
-       pss = EFFPS(ps);
-       ps += 3;
-       nrwid(p1, ps, p1);
-       printf(".nr %d \\n(%d\n", yyval, p1);
-       if( p2>0 ) {
-               nrwid(p2, pss, p2);
-               printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, yyval, yyval, p2);
-               eht[yyval] += eht[p2];
-               b = eht[p2];
-       }
-       if( p3>0 ) {
-               nrwid(p3, pss, p3);
-               printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p3, yyval, yyval, p3);
-               eht[yyval] += eht[p3];
-       }
-       printf(".ds %d ", yyval);       /* bottom of middle box */
-       if( p2>0 ) {
-               printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d", 
-                       eht[p2]-ebase[p2]+b1, yyval, p2, pss, p2, EFFPS(ps));
-               printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\\n", 
-                       yyval, p2, -(eht[p2]-ebase[p2]+b1));
-       }
-       printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du/2u'\\\n", 
-               yyval, p1, p1, yyval, p1);
-       if( p3>0 ) {
-               printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'\\v'%du'\\\n", 
-                       -(h1-b1+ebase[p3]), yyval, p3, pss, p3, EFFPS(ps), yyval, p3, (h1-b1+ebase[p3]));
-       }
-       printf("\n");
-       ebase[yyval] = b + b1;
-       if(dbg)printf(".\tfrom to: S%d <- %d f %d t %d; h=%d b=%d\n", 
-               yyval, p1, p2, p3, eht[yyval], ebase[yyval]);
-       ofree(p1);
-       if( p2>0 ) ofree(p2);
-       if( p3>0 ) ofree(p3);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/funny.c b/.ref-Research-V7/usr/src/cmd/eqn/funny.c
deleted file mode 100644 (file)
index a041d14..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-funny(n) int n; {
-       char *f;
-
-       yyval = oalloc();
-       switch(n) {
-       case SUM:
-               f = "\\(*S"; break;
-       case UNION:
-               f = "\\(cu"; break;
-       case INTER:     /* intersection */
-               f = "\\(ca"; break;
-       case PROD:
-               f = "\\(*P"; break;
-       default:
-               error(FATAL, "funny type %d in funny", n);
-       }
-       printf(".ds %d \\s%d\\v'.3m'\\s+5%s\\s-5\\v'-.3m'\\s%d\n", yyval, ps, f, ps);
-       eht[yyval] = VERT( (ps+5)*6 -(ps*6*2)/10 );
-       ebase[yyval] = VERT( (ps*6*3)/10 );
-       if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n", 
-               yyval, f, eht[yyval], ebase[yyval]);
-       lfont[yyval] = rfont[yyval] = ROM;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/glob.c b/.ref-Research-V7/usr/src/cmd/eqn/glob.c
deleted file mode 100644 (file)
index 834a33f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "e.h"
-
-int    dbg;    /* debugging print if non-zero */
-int    lp[80]; /* stack for things like piles and matrices */
-int    ct;     /* pointer to lp */
-int    used[100];      /* available registers */
-int    ps;     /* default init point size */
-int    deltaps = 3;    /* default change in ps */
-int    gsize   = 10;   /* default initial point size */
-int    gfont   = ITAL; /* italic */
-int    ft;     /* default font */
-FILE   *curfile;       /* current input file */
-int    ifile;
-int    linect; /* line number in file */
-int    eqline; /* line where eqn started */
-int    svargc;
-char   **svargv;
-int    eht[100];
-int    ebase[100];
-int    lfont[100];
-int    rfont[100];
-int    eqnreg; /* register where final string appears */
-int    eqnht;  /* inal height of equation */
-int    lefteq  = '\0'; /* left in-line delimiter */
-int    righteq = '\0'; /* right in-line delimiter */
-int    lastchar;       /* last character read by lex */
-int    markline        = 0;    /* 1 if this EQ/EN contains mark or lineup */
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/integral.c b/.ref-Research-V7/usr/src/cmd/eqn/integral.c
deleted file mode 100644 (file)
index 6e4bcb7..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-integral(p, p1, p2) {
-       if (p1 != 0)
-               printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1);
-       if (p2 != 0)
-               printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2);
-       if (p1 != 0 && p2 != 0)
-               shift2(p, p1, p2);
-       else if (p1 != 0)
-               bshiftb(p, SUB, p1);
-       else if (p2 != 0)
-               bshiftb(p, SUP, p2);
-       if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n", 
-               p, eht[p], ebase[p]);
-       lfont[p] = ROM;
-}
-
-setintegral() {
-       char *f;
-
-       yyval = oalloc();
-       f = "\\(is";
-       printf(".ds %d \\s%d\\v'.1m'\\s+4%s\\s-4\\v'-.1m'\\s%d\n", 
-               yyval, ps, f, ps);
-       eht[yyval] = VERT( (((ps+4)*12)/10)*6 );
-       ebase[yyval] = VERT( (ps*6*3)/10 );
-       lfont[yyval] = rfont[yyval] = ROM;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/io.c b/.ref-Research-V7/usr/src/cmd/eqn/io.c
deleted file mode 100644 (file)
index 776bac7..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-# include "e.h"
-#define        MAXLINE 1200    /* maximum input line */
-
-char   in[MAXLINE];    /* input buffer */
-int    eqnexit();
-int noeqn;
-
-main(argc,argv) int argc; char *argv[];{
-
-       eqnexit(eqn(argc, argv));
-}
-
-eqnexit(n) {
-#ifdef gcos
-       if (n)
-               fprintf(stderr, "run terminated due to eqn error\n");
-       exit(0);
-#endif
-       exit(n);
-}
-
-eqn(argc,argv) int argc; char *argv[];{
-       int i, type;
-
-       setfile(argc,argv);
-       init_tbl();     /* install keywords in tables */
-       while ((type=getline(in)) != EOF) {
-               eqline = linect;
-               if (in[0]=='.' && in[1]=='E' && in[2]=='Q') {
-                       for (i=11; i<100; used[i++]=0);
-                       printf("%s",in);
-                       printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n");
-                       markline = 0;
-                       init();
-                       yyparse();
-                       if (eqnreg>0) {
-                               printf(".nr %d \\w'\\*(%d'\n", eqnreg, eqnreg);
-                               /* printf(".if \\n(%d>\\n(.l .tm too-long eqn, file %s, between lines %d-%d\n", */
-                               /*      eqnreg, svargv[ifile], eqline, linect); */
-                               printf(".nr MK %d\n", markline);        /* for -ms macros */
-                               printf(".if %d>\\n(.v .ne %du\n", eqnht, eqnht);
-                               printf(".rn %d 10\n", eqnreg);
-                               if(!noeqn)printf("\\*(10\n");
-                       }
-                       printf(".ps \\n(99\n.ft \\n(98\n");
-                       printf(".EN");
-                       if (lastchar == EOF) {
-                               putchar('\n');
-                               break;
-                       }
-                       if (putchar(lastchar) != '\n')
-                               while (putchar(gtc()) != '\n');
-               }
-               else if (type == lefteq)
-                       inline();
-               else
-                       printf("%s",in);
-       }
-       return(0);
-}
-
-getline(s) register char *s; {
-       register c;
-       while((*s++=c=gtc())!='\n' && c!=EOF && c!=lefteq)
-               if (s >= in+MAXLINE) {
-                       error( !FATAL, "input line too long: %.20s\n", in);
-                       in[MAXLINE] = '\0';
-                       break;
-               }
-       if (c==lefteq)
-               s--;
-       *s++ = '\0';
-       return(c);
-}
-
-inline() {
-       int ds;
-
-       printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n");
-       ds = oalloc();
-       printf(".rm %d \n", ds);
-       do{
-               if (*in)
-                       printf(".as %d \"%s\n", ds, in);
-               init();
-               yyparse();
-               if (eqnreg > 0) {
-                       printf(".as %d \\*(%d\n", ds, eqnreg);
-                       ofree(eqnreg);
-               }
-               printf(".ps \\n(99\n.ft \\n(98\n");
-       } while (getline(in) == lefteq);
-       if (*in)
-               printf(".as %d \"%s", ds, in);
-       printf(".ps \\n(99\n.ft \\n(98\n");
-       printf("\\*(%d\n", ds);
-       ofree(ds);
-}
-
-putout(p1) int p1; {
-       extern int gsize, gfont;
-       int before, after;
-       if(dbg)printf(".\tanswer <- S%d, h=%d,b=%d\n",p1, eht[p1], ebase[p1]);
-       eqnht = eht[p1];
-       printf(".ds %d \\x'0'", p1);
-       /* suppposed to leave room for a subscript or superscript */
-       before = eht[p1] - ebase[p1] - VERT((ps*6*12)/10);
-       if (before > 0)
-               printf("\\x'0-%du'", before);
-       printf("\\f%c\\s%d\\*(%d%s\\s\\n(99\\f\\n(98",
-               gfont, gsize, p1, rfont[p1] == ITAL ? "\\|" : "");
-       after = ebase[p1] - VERT((ps*6*2)/10);
-       if (after > 0)
-               printf("\\x'%du'", after);
-       putchar('\n');
-       eqnreg = p1;
-}
-
-max(i,j) int i,j; {
-       return (i>j ? i : j);
-}
-
-oalloc() {
-       int i;
-       for (i=11; i<100; i++)
-               if (used[i]++ == 0) return(i);
-       error( FATAL, "no eqn strings left", i);
-       return(0);
-}
-
-ofree(n) int n; {
-       used[n] = 0;
-}
-
-setps(p) int p; {
-       printf(".ps %d\n", EFFPS(p));
-}
-
-nrwid(n1, p, n2) int n1, p, n2; {
-       printf(".nr %d \\w'\\s%d\\*(%d'\n", n1, EFFPS(p), n2);
-}
-
-setfile(argc, argv) int argc; char *argv[]; {
-       static char *nullstr = "-";
-
-       svargc = --argc;
-       svargv = argv;
-       while (svargc > 0 && svargv[1][0] == '-') {
-               switch (svargv[1][1]) {
-
-               case 'd': lefteq=svargv[1][2]; righteq=svargv[1][3]; break;
-               case 's': gsize = atoi(&svargv[1][2]); break;
-               case 'p': deltaps = atoi(&svargv[1][2]); break;
-               case 'f': gfont = svargv[1][2]; break;
-               case 'e': noeqn++; break;
-               default: dbg = 1;
-               }
-               svargc--;
-               svargv++;
-       }
-       ifile = 1;
-       linect = 1;
-       if (svargc <= 0) {
-               curfile = stdin;
-               svargv[1] = nullstr;
-       }
-       else if ((curfile = fopen(svargv[1], "r")) == NULL)
-               error( FATAL,"can't open file %s", svargv[1]);
-}
-
-yyerror() {;}
-
-init() {
-       ct = 0;
-       ps = gsize;
-       ft = gfont;
-       setps(ps);
-       printf(".ft %c\n", ft);
-}
-
-error(fatal, s1, s2) int fatal; char *s1, *s2; {
-       if (fatal>0)
-               printf("eqn fatal error: ");
-       printf(s1,s2);
-       printf("\nfile %s, between lines %d and %d\n",
-                svargv[ifile], eqline, linect);
-       fprintf(stderr, "eqn: ");
-       if (fatal>0)
-               fprintf(stderr, "fatal error: ");
-       fprintf(stderr, s1, s2);
-       fprintf(stderr, "\nfile %s, between lines %d and %d\n",
-                svargv[ifile], eqline, linect);
-       if (fatal > 0)
-               eqnexit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/lex.c b/.ref-Research-V7/usr/src/cmd/eqn/lex.c
deleted file mode 100644 (file)
index 19860a2..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#include "e.h"
-#include "e.def"
-
-#define        SSIZE   400
-char   token[SSIZE];
-int    sp;
-#define        putbak(c)       *ip++ = c;
-#define        PUSHBACK        300     /* maximum pushback characters */
-char   ibuf[PUSHBACK+SSIZE];   /* pushback buffer for definitions, etc. */
-char   *ip     = ibuf;
-
-gtc() {
-  loop:
-       if (ip > ibuf)
-               return(*--ip);  /* already present */
-       lastchar = getc(curfile);
-       if (lastchar=='\n')
-               linect++;
-       if (lastchar != EOF)
-               return(lastchar);
-       if (++ifile > svargc) {
-               return(EOF);
-       }
-       fclose(curfile);
-       linect = 1;
-       if ((curfile=fopen(svargv[ifile], "r")) != NULL)
-               goto loop;
-       error(FATAL, "can't open file %s", svargv[ifile]);
-       return(EOF);
-}
-
-pbstr(str)
-register char *str;
-{
-       register char *p;
-
-       p = str;
-       while (*p++);
-       --p;
-       if (ip >= &ibuf[PUSHBACK])
-               error( FATAL, "pushback overflow");
-       while (p > str)
-               putbak(*--p);
-}
-
-yylex() {
-       register int c;
-       tbl *tp, *lookup();
-       extern tbl **keytbl, **deftbl;
-
-  beg:
-       while ((c=gtc())==' ' || c=='\n')
-               ;
-       yylval=c;
-       switch(c) {
-
-       case EOF:
-               return(EOF);
-       case '~':
-               return(SPACE);
-       case '^':
-               return(THIN);
-       case '\t':
-               return(TAB);
-       case '{':
-               return('{');
-       case '}':
-               return('}');
-       case '"':
-               for (sp=0; (c=gtc())!='"' && c != '\n'; ) {
-                       if (c == '\\')
-                               if ((c = gtc()) != '"')
-                                       token[sp++] = '\\';
-                       token[sp++] = c;
-                       if (sp>=SSIZE)
-                               error(FATAL, "quoted string %.20s... too long", token);
-               }
-               token[sp]='\0';
-               yylval = (int) &token[0];
-               if (c == '\n')
-                       error(!FATAL, "missing \" in %.20s", token);
-               return(QTEXT);
-       }
-       if (c==righteq)
-               return(EOF);
-
-       putbak(c);
-       getstr(token, SSIZE);
-       if (dbg)printf(".\tlex token = |%s|\n", token);
-       if ((tp = lookup(&deftbl, token, NULL)) != NULL) {
-               putbak(' ');
-               pbstr(tp->defn);
-               putbak(' ');
-               if (dbg)
-                       printf(".\tfound %s|=%s|\n", token, tp->defn);
-       }
-       else if ((tp = lookup(&keytbl, token, NULL)) == NULL) {
-               if(dbg)printf(".\t%s is not a keyword\n", token);
-               return(CONTIG);
-       }
-       else if (tp->defn == (char *) DEFINE || tp->defn == (char *) NDEFINE || tp->defn == (char *) TDEFINE)
-               define(tp->defn);
-       else if (tp->defn == (char *) DELIM)
-               delim();
-       else if (tp->defn == (char *) GSIZE)
-               globsize();
-       else if (tp->defn == (char *) GFONT)
-               globfont();
-       else if (tp->defn == (char *) INCLUDE)
-               include();
-       else {
-               return((int) tp->defn);
-       }
-       goto beg;
-}
-
-getstr(s, n) char *s; register int n; {
-       register int c;
-       register char *p;
-
-       p = s;
-       while ((c = gtc()) == ' ' || c == '\n')
-               ;
-       if (c == EOF) {
-               *s = 0;
-               return;
-       }
-       while (c != ' ' && c != '\t' && c != '\n' && c != '{' && c != '}'
-         && c != '"' && c != '~' && c != '^' && c != righteq) {
-               if (c == '\\')
-                       if ((c = gtc()) != '"')
-                               *p++ = '\\';
-               *p++ = c;
-               if (--n <= 0)
-                       error(FATAL, "token %.20s... too long", s);
-               c = gtc();
-       }
-       if (c=='{' || c=='}' || c=='"' || c=='~' || c=='^' || c=='\t' || c==righteq)
-               putbak(c);
-       *p = '\0';
-       yylval = (int) s;
-}
-
-cstr(s, quote, maxs) char *s; int quote; {
-       int del, c, i;
-
-       while((del=gtc()) == ' ' || del == '\t' || del == '\n');
-       if (quote)
-               for (i=0; (c=gtc()) != del && c != EOF;) {
-                       s[i++] = c;
-                       if (i >= maxs)
-                               return(1);      /* disaster */
-               }
-       else {
-               s[0] = del;
-               for (i=1; (c=gtc())!=' ' && c!= '\t' && c!='\n' && c!=EOF;) {
-                       s[i++]=c;
-                       if (i >= maxs)
-                               return(1);      /* disaster */
-               }
-       }
-       s[i] = '\0';
-       if (c == EOF)
-               error(FATAL, "Unexpected end of input at %.20s", s);
-       return(0);
-}
-
-define(type) int type; {
-       char *strsave(), *p1, *p2;
-       tbl *lookup();
-       extern tbl **deftbl;
-
-       getstr(token, SSIZE);   /* get name */
-       if (type != DEFINE) {
-               cstr(token, 1, SSIZE);  /* skip the definition too */
-               return;
-       }
-       p1 = strsave(token);
-       if (cstr(token, 1, SSIZE))
-               error(FATAL, "Unterminated definition at %.20s", token);
-       p2 = strsave(token);
-       lookup(&deftbl, p1, p2);
-       if (dbg)printf(".\tname %s defined as %s\n", p1, p2);
-}
-
-char *strsave(s)
-char *s;
-{
-       char *malloc();
-       register char *q;
-
-       q = malloc(strlen(s)+1);
-       if (q == NULL)
-               error(FATAL, "out of space in strsave on %s", s);
-       strcpy(q, s);
-       return(q);
-}
-
-include() {
-       error(!FATAL, "Include not yet implemented");
-}
-
-delim() {
-       yyval = eqnreg = 0;
-       if (cstr(token, 0, SSIZE))
-               error(FATAL, "Bizarre delimiters at %.20s", token);
-       lefteq = token[0];
-       righteq = token[1];
-       if (lefteq == 'o' && righteq == 'f')
-               lefteq = righteq = '\0';
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/lookup.c b/.ref-Research-V7/usr/src/cmd/eqn/lookup.c
deleted file mode 100644 (file)
index aa6ea92..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-# include "e.h"
-#include "e.def"
-
-#define        TBLSIZE 100
-
-tbl    *keytbl[TBLSIZE];       /* key words */
-tbl    *restbl[TBLSIZE];       /* reserved words */
-tbl    *deftbl[TBLSIZE];       /* user-defined names */
-
-struct {
-       char    *key;
-       int     keyval;
-} keyword[]    ={
-       "sub",  SUB, 
-       "sup",  SUP, 
-       ".EN",  EOF, 
-       "from",         FROM, 
-       "to",   TO, 
-       "sum",  SUM, 
-       "hat",  HAT, 
-       "vec", VEC, 
-       "dyad", DYAD, 
-       "dot",  DOT, 
-       "dotdot",       DOTDOT, 
-       "bar",  BAR, 
-       "tilde",        TILDE, 
-       "under",        UNDER, 
-       "prod",         PROD, 
-       "int",  INT, 
-       "integral",     INT, 
-       "union",        UNION, 
-       "inter",        INTER, 
-       "pile",         PILE, 
-       "lpile",        LPILE, 
-       "cpile",        CPILE, 
-       "rpile",        RPILE, 
-       "over",         OVER, 
-       "sqrt",         SQRT, 
-       "above",        ABOVE, 
-       "size",         SIZE, 
-       "font",         FONT, 
-       "fat", FAT, 
-       "roman",        ROMAN, 
-       "italic",       ITALIC, 
-       "bold",         BOLD, 
-       "left",         LEFT, 
-       "right",        RIGHT, 
-       "delim",        DELIM, 
-       "define",       DEFINE, 
-
-#ifdef NEQN    /* make ndefine synonym for define, tdefine a no-op */
-
-       "tdefine",      TDEFINE,
-       "ndefine",      DEFINE,
-
-#else          /* tdefine = define, ndefine = no-op */
-
-       "tdefine",      DEFINE, 
-       "ndefine",      NDEFINE, 
-
-#endif
-
-       "gsize",        GSIZE, 
-       ".gsize",       GSIZE, 
-       "gfont",        GFONT, 
-       "include",      INCLUDE, 
-       "up",   UP, 
-       "down",         DOWN, 
-       "fwd",  FWD, 
-       "back",         BACK, 
-       "mark",         MARK, 
-       "lineup",       LINEUP, 
-       "matrix",       MATRIX, 
-       "col",  COL, 
-       "lcol",         LCOL, 
-       "ccol",         CCOL, 
-       "rcol",         RCOL, 
-       0,      0
-};
-
-struct {
-       char    *res;
-       char    *resval;
-} resword[]    ={
-       ">=",   "\\(>=",
-       "<=",   "\\(<=",
-       "==",   "\\(==",
-       "!=",   "\\(!=",
-       "+-",   "\\(+-",
-       "->",   "\\(->",
-       "<-",   "\\(<-",
-       "inf",  "\\(if",
-       "infinity",     "\\(if",
-       "partial",      "\\(pd",
-       "half", "\\f1\\(12\\fP",
-       "prime",        "\\f1\\(fm\\fP",
-       "dollar",       "\\f1$\\fP",
-       "nothing",      "",
-       "times",        "\\(mu",
-       "del",  "\\(gr",
-       "grad", "\\(gr",
-#ifdef NEQN
-       "<<",   "<<",
-       ">>",   ">>",
-       "approx",       "~\b\\d~\\u",
-       "cdot", "\\v'-.5'.\\v'.5'",
-       "...",  "...",
-       ",...,",        ",...,",
-#else
-       "<<",   "<\\h'-.3m'<",
-       ">>",   ">\\h'-.3m'>",
-       "approx",       "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'",
-       "cdot", "\\v'-.3m'.\\v'.3m'",
-       "...",  "\\v'-.3m'\\ .\\ .\\ .\\ \\v'.3m'",
-       ",...,",        ",\\ .\\ .\\ .\\ ,\\|",
-#endif
-
-       "alpha",        "\\(*a",
-       "beta", "\\(*b",
-       "gamma",        "\\(*g",
-       "GAMMA",        "\\(*G",
-       "delta",        "\\(*d",
-       "DELTA",        "\\(*D",
-       "epsilon",      "\\(*e",
-       "EPSILON",      "\\f1E\\fP",
-       "omega",        "\\(*w",
-       "OMEGA",        "\\(*W",
-       "lambda",       "\\(*l",
-       "LAMBDA",       "\\(*L",
-       "mu",   "\\(*m",
-       "nu",   "\\(*n",
-       "theta",        "\\(*h",
-       "THETA",        "\\(*H",
-       "phi",  "\\(*f",
-       "PHI",  "\\(*F",
-       "pi",   "\\(*p",
-       "PI",   "\\(*P",
-       "sigma",        "\\(*s",
-       "SIGMA",        "\\(*S",
-       "xi",   "\\(*c",
-       "XI",   "\\(*C",
-       "zeta", "\\(*z",
-       "iota", "\\(*i",
-       "eta",  "\\(*y",
-       "kappa",        "\\(*k",
-       "rho",  "\\(*r",
-       "tau",  "\\(*t",
-       "omicron",      "\\(*o",
-       "upsilon",      "\\(*u",
-       "UPSILON",      "\\(*U",
-       "psi",  "\\(*q",
-       "PSI",  "\\(*Q",
-       "chi",  "\\(*x",
-       "and",  "\\f1and\\fP",
-       "for",  "\\f1for\\fP",
-       "if",   "\\f1if\\fP",
-       "Re",   "\\f1Re\\fP",
-       "Im",   "\\f1Im\\fP",
-       "sin",  "\\f1sin\\fP",
-       "cos",  "\\f1cos\\fP",
-       "tan",  "\\f1tan\\fP",
-       "arc",  "\\f1arc\\fP",
-       "sinh", "\\f1sinh\\fP",
-       "coth", "\\f1coth\\fP",
-       "tanh", "\\f1tanh\\fP",
-       "cosh", "\\f1cosh\\fP",
-       "lim",  "\\f1lim\\fP",
-       "log",  "\\f1log\\fP",
-       "max",  "\\f1max\\fP",
-       "min",  "\\f1min\\fP",
-       "ln",   "\\f1ln\\fP",
-       "exp",  "\\f1exp\\fP",
-       "det",  "\\f1det\\fP",
-       0,      0
-};
-
-tbl *lookup(tblp, name, defn)  /* find name in tbl. if defn non-null, install */
-tbl **tblp;
-char *name, *defn;
-{
-       register tbl *p;
-       register int h;
-       register char *s = name;
-       char *malloc();
-
-       for (h = 0; *s != '\0'; )
-               h += *s++;
-       h %= TBLSIZE;
-
-       for (p = tblp[h]; p != NULL; p = p->next)
-               if (strcmp(name, p->name) == 0) {       /* found it */
-                       if (defn != NULL)
-                               p->defn = defn;
-                       return(p);
-               }
-       /* didn't find it */
-       if (defn == NULL)
-               return(NULL);
-       p = (tbl *) malloc(sizeof (tbl));
-       if (p == NULL)
-               error(FATAL, "out of space in lookup");
-       p->name = name;
-       p->defn = defn;
-       p->next = tblp[h];
-       tblp[h] = p;
-       return(p);
-}
-
-init_tbl()     /* initialize all tables */
-{
-       int i;
-
-       for (i = 0; keyword[i].key != NULL; i++)
-               lookup(keytbl, keyword[i].key, keyword[i].keyval);
-       for (i = 0; resword[i].res != NULL; i++)
-               lookup(restbl, resword[i].res, resword[i].resval);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/makefile b/.ref-Research-V7/usr/src/cmd/eqn/makefile
deleted file mode 100644 (file)
index 50c64a0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-CFLAGS=-O
-YFLAGS=-d
-
-all:   eqn
-
-cp:    eqn
-       cp eqn /bin/eqn
-       rm *.o e.c e.def eqn
-
-cmp:   eqn
-       cmp eqn /bin/eqn
-       rm *.o e.c e.def eqn
-
-SOURCE = e.y e.h diacrit.c eqnbox.c font.c fromto.c funny.c glob.c integral.c \
- io.c lex.c lookup.c mark.c matrix.c move.c over.c paren.c \
- pile.c shift.c size.c sqrt.c text.c
-
-FILES = e.o diacrit.o eqnbox.o font.o fromto.o funny.o glob.o integral.o \
- io.o lex.o lookup.o mark.o matrix.o move.o over.o paren.o \
- pile.o shift.o size.o sqrt.o text.o
-
-eqn:   $(FILES)
-       cc -n -s $(CFLAGS) $(FILES) -o eqn
-
-e.c:   e.def
-
-e.def: e.y
-       yacc -d e.y
-       mv y.tab.c e.c
-       mv y.tab.h e.def
-
-$(FILES):      e.h e.def
-
-list:
-       pr TODO $(SOURCE) makefile
-
-gcos:  y.tab.c
-       fsend e.h e.y *.c
-
-src:   makefile $(SOURCE)
-       cp $? /usr/src/cmd/eqn
-       touch src
-
-lint:  y.tab.c
-       lint -spb *.c
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/mark.c b/.ref-Research-V7/usr/src/cmd/eqn/mark.c
deleted file mode 100644 (file)
index 6e03156..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "e.h"
-
-mark(p1) int p1; {
-       markline = 1;
-       printf(".ds %d \\k(97\\*(%d\n", p1, p1);
-       yyval = p1;
-       if(dbg)printf(".\tmark %d\n", p1);
-}
-
-lineup(p1) {
-       markline = 1;
-       if (p1 == 0) {
-               yyval = oalloc();
-               printf(".ds %d \\h'|\\n(97u'\n", yyval);
-       }
-       if(dbg)printf(".\tlineup %d\n", p1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/matrix.c b/.ref-Research-V7/usr/src/cmd/eqn/matrix.c
deleted file mode 100644 (file)
index 209e37b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "e.h"
-
-column(type, p1) int type, p1; {
-       int i;
-
-       lp[p1] = ct - p1 - 1;
-       if( dbg ){
-               printf(".\t%d column of", type);
-               for( i=p1+1; i<ct; i++ )
-                       printf(" S%d", lp[i]);
-               printf(", rows=%d\n",lp[p1]);
-       }
-       lp[ct++] = type;
-}
-
-matrix(p1) int p1; {
-       int nrow, ncol, i, j, k, hb, b, val[100];
-       char *space;
-
-       space = "\\ \\ ";
-       nrow = lp[p1];  /* disaster if rows inconsistent */
-       ncol = 0;
-       for( i=p1; i<ct; i += lp[i]+2 ){
-               ncol++;
-               if(dbg)printf(".\tcolct=%d\n",lp[i]);
-       }
-       for( k=1; k<=nrow; k++ ) {
-               hb = b = 0;
-               j = p1 + k;
-               for( i=0; i<ncol; i++ ) {
-                       hb = max(hb, eht[lp[j]]-ebase[lp[j]]);
-                       b = max(b, ebase[lp[j]]);
-                       j += nrow + 2;
-               }
-               if(dbg)printf(".\trow %d: b=%d, hb=%d\n", k, b, hb);
-               j = p1 + k;
-               for( i=0; i<ncol; i++ ) {
-                       ebase[lp[j]] = b;
-                       eht[lp[j]] = b + hb;
-                       j += nrow + 2;
-               }
-       }
-       j = p1;
-       for( i=0; i<ncol; i++ ) {
-               lpile(lp[j+lp[j]+1], j+1, j+lp[j]+1);
-               val[i] = yyval;
-               j += nrow + 2;
-       }
-       yyval = oalloc();
-       eht[yyval] = eht[val[0]];
-       ebase[yyval] = ebase[val[0]];
-       lfont[yyval] = rfont[yyval] = 0;
-       if(dbg)printf(".\tmatrix S%d: r=%d, c=%d, h=%d, b=%d\n",
-               yyval,nrow,ncol,eht[yyval],ebase[yyval]);
-       printf(".ds %d \"", yyval);
-       for( i=0; i<ncol; i++ )  {
-               printf("\\*(%d%s", val[i], i==ncol-1 ? "" : space);
-               ofree(val[i]);
-       }
-       printf("\n");
-       ct = p1;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/move.c b/.ref-Research-V7/usr/src/cmd/eqn/move.c
deleted file mode 100644 (file)
index c4d30fa..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-move(dir, amt, p) int dir, amt, p; {
-       int a;
-
-       yyval = p;
-       a = VERT( (EFFPS(ps) * 6 * amt) / 100);
-       printf(".ds %d ", yyval);
-       if( dir == FWD || dir == BACK ) /* fwd, back */
-               printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
-       else if (dir == UP)
-               printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
-       else if (dir == DOWN)
-               printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
-       if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n", 
-               p, dir, a, eht[yyval], ebase[yyval]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/over.c b/.ref-Research-V7/usr/src/cmd/eqn/over.c
deleted file mode 100644 (file)
index feadac3..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# include "e.h"
-
-boverb(p1, p2) int p1, p2; {
-       int h, b, treg, d;
-
-       treg = oalloc();
-       yyval = p1;
-       d = VERT((ps*6*3) / 10);        /* 0.3m */
-       h = eht[p1] + eht[p2] + d;
-       b = eht[p2] - d;
-       if(dbg)printf(".\tb:bob: S%d <- S%d over S%d; b=%d, h=%d\n", 
-               yyval, p1, p2, b, h);
-       nrwid(p1, ps, p1);
-       nrwid(p2, ps, p2);
-       printf(".nr %d \\n(%d\n", treg, p1);
-       printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2);
-       printf(".nr %d \\n(%d+\\s%d.5m\\s0\n", treg, treg, EFFPS(ps));
-       printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n", 
-               yyval, eht[p2]-ebase[p2]-d, treg, p2, p2);
-       printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n", 
-               p2, p1, -(eht[p2]-ebase[p2]+d+ebase[p1]), p1);
-       printf("\\h'-\\n(%du-\\n(%du/2u+.1m'\\v'%du'\\l'\\n(%du-.2m'\\h'.1m'\\v'%du'\n", 
-                treg, p1, ebase[p1]+d, treg, d);
-       ebase[yyval] = b;
-       eht[yyval] = h;
-       lfont[yyval] = rfont[yyval] = 0;
-       ofree(p2);
-       ofree(treg);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/paren.c b/.ref-Research-V7/usr/src/cmd/eqn/paren.c
deleted file mode 100644 (file)
index f789581..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-# include "e.h"
-
-paren(leftc, p1, rightc) int p1, leftc, rightc; {
-       int n, m, h1, j, b1, v;
-       h1 = eht[p1]; b1 = ebase[p1];
-       yyval = p1;
-       lfont[yyval] = rfont[yyval] = 0;
-       n = (h1+(6*EFFPS(ps)-1))/(6*EFFPS(ps));
-       if( n<2 ) n = 1;
-       m = n-2;
-       if (leftc=='{' || rightc == '}') {
-               n = n%2 ? n : ++n;
-               if( n<3 ) n=3;
-               m = n-3;
-       }
-       eht[yyval] = VERT(6 * ps * n);
-       ebase[yyval] = b1 + (eht[yyval]-h1)/2;
-       v = b1 - h1/2 + VERT( (ps*6*4)/10 );
-       printf(".ds %d \\|\\v'%du'", yyval, v);
-       switch( leftc ) {
-               case 'n':       /* nothing */
-               case '\0':
-                       break;
-               case 'f':       /* floor */
-                       if (n <= 1)
-                               printf("\\(lf");
-                       else
-                               brack(m, "\\(bv", "\\(bv", "\\(lf");
-                       break;
-               case 'c':       /* ceiling */
-                       if (n <= 1)
-                               printf("\\(lc");
-                       else
-                               brack(m, "\\(lc", "\\(bv", "\\(bv");
-                       break;
-               case '{':
-                       printf("\\b'\\(lt");
-                       for(j = 0; j < m; j += 2) printf("\\(bv");
-                       printf("\\(lk");
-                       for(j = 0; j < m; j += 2) printf("\\(bv");
-                       printf("\\(lb'");
-                       break;
-               case '(':
-                       brack(m, "\\(lt", "\\(bv", "\\(lb");
-                       break;
-               case '[':
-                       brack(m, "\\(lc", "\\(bv", "\\(lf");
-                       break;
-               case '|':
-                       brack(m, "|", "|", "|");
-                       break;
-               default:
-                       brack(m, (char *) &leftc, (char *) &leftc, (char *) &leftc);
-                       break;
-               }
-       printf("\\v'%du'\\*(%d", -v, p1);
-       if( rightc ) {
-               printf("\\|\\v'%du'", v);
-               switch( rightc ) {
-                       case 'f':       /* floor */
-                               if (n <= 1)
-                                       printf("\\(rf");
-                               else
-                                       brack(m, "\\(bv", "\\(bv", "\\(rf");
-                               break;
-                       case 'c':       /* ceiling */
-                               if (n <= 1)
-                                       printf("\\(rc");
-                               else
-                                       brack(m, "\\(rc", "\\(bv", "\\(bv");
-                               break;
-                       case '}':
-                               printf("\\b'\\(rt");
-                               for(j = 0; j< m; j += 2)printf("\\(bv");
-                               printf("\\(rk");
-                               for(j = 0; j< m; j += 2) printf("\\(bv");
-                               printf("\\(rb'");
-                               break;
-                       case ']':
-                               brack(m, "\\(rc", "\\(bv", "\\(rf");
-                               break;
-                       case ')':
-                               brack(m, "\\(rt", "\\(bv", "\\(rb");
-                               break;
-                       case '|':
-                               brack(m, "|", "|", "|");
-                               break;
-                       default:
-                               brack(m, (char *) &rightc, (char *) &rightc, (char *) &rightc);
-                               break;
-               }
-               printf("\\v'%du'", -v);
-       }
-       printf("\n");
-       if(dbg)printf(".\tcurly: h=%d b=%d n=%d v=%d l=%c, r=%c\n", 
-               eht[yyval], ebase[yyval], n, v, leftc, rightc);
-}
-
-brack(m, t, c, b) int m; char *t, *c, *b; {
-       int j;
-       printf("\\b'%s", t);
-       for( j=0; j<m; j++)
-               printf("%s", c);
-       printf("%s'", b);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/pile.c b/.ref-Research-V7/usr/src/cmd/eqn/pile.c
deleted file mode 100644 (file)
index c2873d2..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# include "e.h"
-
-lpile(type, p1, p2) int type, p1, p2; {
-       int bi, hi, i, gap, h, b, nlist, nlist2, mid;
-       yyval = oalloc();
-       gap = VERT( (ps*6*4)/10 ); /* 4/10 m between blocks */
-       if( type=='-' ) gap = 0;
-       nlist = p2 - p1;
-       nlist2 = (nlist+1)/2;
-       mid = p1 + nlist2 -1;
-       h = 0;
-       for( i=p1; i<p2; i++ )
-               h += eht[lp[i]];
-       eht[yyval] = h + (nlist-1)*gap;
-       b = 0;
-       for( i=p2-1; i>mid; i-- )
-               b += eht[lp[i]] + gap;
-       ebase[yyval] = (nlist%2) ? b + ebase[lp[mid]]
-                       : b - VERT( (ps*6*5)/10 ) - gap;
-       if(dbg) {
-               printf(".\tS%d <- %c pile of:", yyval, type);
-               for( i=p1; i<p2; i++)
-                       printf(" S%d", lp[i]);
-               printf(";h=%d b=%d\n", eht[yyval], ebase[yyval]);
-       }
-       nrwid(lp[p1], ps, lp[p1]);
-       printf(".nr %d \\n(%d\n", yyval, lp[p1]);
-       for( i = p1+1; i<p2; i++ ) {
-               nrwid(lp[i], ps, lp[i]);
-               printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", 
-                       lp[i], yyval, yyval, lp[i]);
-       }
-       printf(".ds %d \\v'%du'\\h'%du*\\n(%du'\\\n", yyval, ebase[yyval], 
-               type=='R' ? 1 : 0, yyval);
-       for(i = p2-1; i >=p1; i--) {
-               hi = eht[lp[i]]; 
-               bi = ebase[lp[i]];
-       switch(type) {
-
-       case 'L':
-               printf("\\v'%du'\\*(%d\\h'-\\n(%du'\\v'0-%du'\\\n", 
-                       -bi, lp[i], lp[i], hi-bi+gap);
-               continue;
-       case 'R':
-               printf("\\v'%du'\\h'-\\n(%du'\\*(%d\\v'0-%du'\\\n", 
-                       -bi, lp[i], lp[i], hi-bi+gap);
-               continue;
-       case 'C':
-       case '-':
-               printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d", 
-                       -bi, yyval, lp[i], lp[i]);
-               printf("\\h'-\\n(%du-\\n(%du/2u'\\v'0-%du'\\\n", 
-                       yyval, lp[i], hi-bi+gap);
-               continue;
-               }
-       }
-       printf("\\v'%du'\\h'%du*\\n(%du'\n", eht[yyval]-ebase[yyval]+gap, 
-               type!='R' ? 1 : 0, yyval);
-       for( i=p1; i<p2; i++ )
-               ofree(lp[i]);
-       lfont[yyval] = rfont[yyval] = 0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/shift.c b/.ref-Research-V7/usr/src/cmd/eqn/shift.c
deleted file mode 100644 (file)
index adc7664..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-# include "e.h"
-#include "e.def"
-
-bshiftb(p1, dir, p2) int p1, dir, p2; {
-       int shval, diffps, effps, effps2, d1, h1, b1, h2, b2;
-       char *sh1, *sh2;
-
-       yyval = p1;
-       h1 = eht[p1];
-       b1 = ebase[p1];
-       h2 = eht[p2];
-       b2 = ebase[p2];
-       effps = EFFPS(ps);
-       effps2 = EFFPS(ps+deltaps);
-       diffps = deltaps;
-       sh1 = sh2 = "";
-       if( dir == SUB ) {
-               /* top 1/2m above bottom of main box */
-               d1 = VERT( (effps2*6)/2 );
-               shval = - d1 + h2 - b2;
-               if( d1+b1 > h2 ) /* move little sub down */
-                       shval = b1-b2;
-               ebase[yyval] = b1 + max(0, h2-b1-d1);
-               eht[yyval] = h1 + max(0, h2-b1-d1);
-               if (rfont[p1] == ITAL && lfont[p2] == ROM)
-                       sh1 = "\\|";
-               if (rfont[p2] == ITAL)
-                       sh2 = "\\|";
-       } else {        /* superscript */
-               /* 4/10 up main box */
-               d1 = VERT( (effps*6*2)/10 );
-               ebase[yyval] = b1;
-               shval = -VERT( (4 * (h1-b1)) / 10 ) - b2;
-               if( VERT(4*(h1-b1)/10) + h2 < h1-b1 )   /* raise little super */
-                       shval = -(h1-b1) + h2-b2 - d1;
-               eht[yyval] = h1 + max(0, h2-VERT((6*(h1-b1))/10));
-               if (rfont[p1] == ITAL)
-                       sh1 = "\\|";
-               if (rfont[p2] == ITAL)
-                       sh2 = "\\|";
-       }
-       if(dbg)printf(".\tb:b shift b: S%d <- S%d vert %d S%d vert %d; b=%d, h=%d\n", 
-               yyval, p1, shval, p2, -shval, ebase[yyval], eht[yyval]);
-       printf(".as %d \\v'%du'\\s-%d%s\\*(%d\\s+%d%s\\v'%du'\n", 
-               yyval, shval, diffps, sh1, p2, diffps, sh2, -shval);
-       ps += deltaps;
-       if (rfont[p2] == ITAL)
-               rfont[p1] = 0;
-       else
-               rfont[p1] = rfont[p2];
-       ofree(p2);
-}
-
-shift(p1) int p1; {
-       ps -= deltaps;
-       yyval = p1;
-       if(dbg)printf(".\tshift: %d;ps=%d\n", yyval, ps);
-}
-
-shift2(p1, p2, p3) int p1, p2, p3; {
-       int effps, effps2, h1, h2, h3, b1, b2, b3, subsh, d1, d2, supsh;
-       int treg;
-       treg = oalloc();
-       yyval = p1;
-       if(dbg)printf(".\tshift2 s%d <- %d %d %d\n", yyval, p1, p2, p3);
-       effps = EFFPS(ps+deltaps);
-       eht[p3] = h3 = VERT( (eht[p3] * effps) / EFFPS(ps) );
-       ps += deltaps;
-       effps2 = EFFPS(ps+deltaps);
-       h1 = eht[p1]; b1 = ebase[p1];
-       h2 = eht[p2]; b2 = ebase[p2];
-       b3 = ebase[p3];
-       d1 = VERT( (effps2*6)/2 );
-       subsh = -d1+h2-b2;
-       if( d1+b1 > h2 ) /* move little sub down */
-               subsh = b1-b2;
-       supsh = -VERT( (4*(h1-b1))/10 ) - b3;
-       d2 = VERT( (effps*6*2)/10 );
-       if( VERT(4*(h1-b1)/10)+h3 < h1-b1 )
-               supsh = -(h1-b1) + (h3-b3) - d2;
-       eht[yyval] = h1 + max(0, h3-VERT( (6*(h1-b1))/10 )) + max(0, h2-b1-d1);
-       ebase[yyval] = b1+max(0, h2-b1-d1);
-       if (rfont[p1] == ITAL && lfont[p2] == ROM)
-               printf(".ds %d \\|\\*(%d\n", p2, p2);
-       if (rfont[p2] == ITAL)
-               printf(".as %d \\|\n", p2);
-       nrwid(p2, effps, p2);
-       if (rfont[p1] == ITAL && lfont[p3] == ROM)
-               printf(".ds %d \\|\\|\\*(%d\n", p3, p3);
-       else
-               printf(".ds %d \\|\\*(%d\n", p3, p3);
-       nrwid(p3, effps, p3);
-       printf(".nr %d \\n(%d\n", treg, p3);
-       printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2);
-       printf(".as %d \\v'%du'\\s%d\\*(%d\\h'-\\n(%du'\\v'%du'\\\n", 
-               p1, subsh, effps, p2, p2, -subsh+supsh);
-       printf("\\s%d\\*(%d\\h'-\\n(%du+\\n(%du'\\s%d\\v'%du'\n", 
-               effps, p3, p3, treg, effps2, -supsh);
-       ps += deltaps;
-       if (rfont[p2] == ITAL)
-               rfont[yyval] = 0;       /* lie */
-       ofree(p2); ofree(p3); ofree(treg);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/size.c b/.ref-Research-V7/usr/src/cmd/eqn/size.c
deleted file mode 100644 (file)
index 8f99fa6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# include "e.h"
-
-setsize(p)     /* set size as found in p */
-char *p;
-{
-       if (*p == '+')
-               ps += atoi(p+1);
-       else if (*p == '-')
-               ps -= atoi(p+1);
-       else
-               ps = atoi(p);
-       if(dbg)printf(".\tsetsize %s; ps = %d\n", p, ps);
-}
-
-size(p1, p2) int p1, p2; {
-               /* old size in p1, new in ps */
-       int effps, effp1;
-
-       yyval = p2;
-       if(dbg)printf(".\tb:sb: S%d <- \\s%d S%d \\s%d; b=%d, h=%d\n", 
-               yyval, ps, p2, p1, ebase[yyval], eht[yyval]);
-       effps = EFFPS(ps);
-       effp1 = EFFPS(p1);
-       printf(".ds %d \\s%d\\*(%d\\s%d\n", 
-               yyval, effps, p2, effp1);
-       ps = p1;
-}
-
-globsize() {
-       char temp[20];
-
-       getstr(temp, 20);
-       if (temp[0] == '+')
-               gsize += atoi(temp+1);
-       else if (temp[0] == '-')
-               gsize -= atoi(temp+1);
-       else
-               gsize = atoi(temp);
-       yyval = eqnreg = 0;
-       setps(gsize);
-       ps = gsize;
-       if (gsize >= 12)        /* sub and sup size change */
-               deltaps = gsize / 4;
-       else
-               deltaps = gsize / 3;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/sqrt.c b/.ref-Research-V7/usr/src/cmd/eqn/sqrt.c
deleted file mode 100644 (file)
index 2229328..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# include "e.h"
-
-sqrt(p2) int p2; {
-       int nps;
-       nps = EFFPS(((eht[p2]*9)/10+5)/6);
-       yyval = p2;
-       eht[yyval] = VERT( (nps*6*12)/10 );
-       if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", 
-               yyval, p2, ebase[yyval], eht[yyval]);
-       if (rfont[yyval] == ITAL)
-               printf(".as %d \\|\n", yyval);
-       nrwid(p2, ps, p2);
-       printf(".ds %d \\v'%du'\\s%d\\v'-.2m'\\(sr\\l'\\n(%du\\(rn'\\v'.2m'\\s%d", 
-               yyval, ebase[p2], nps, p2, ps);
-       printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", -ebase[p2], p2, p2);
-       lfont[yyval] = ROM;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/eqn/text.c b/.ref-Research-V7/usr/src/cmd/eqn/text.c
deleted file mode 100644 (file)
index 79289d0..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-int    csp;
-int    psp;
-#define        CSSIZE  400
-char   cs[420];
-
-int    lf, rf; /* temporary spots for left and right fonts */
-
-text(t,p1) int t; char *p1; {
-       int c;
-       char *p;
-       tbl *tp, *lookup();
-       extern tbl *restbl;
-
-       yyval = oalloc();
-       ebase[yyval] = 0;
-       eht[yyval] = VERT(6 * ((ps>6)?ps:6));   /* ht in machine units */
-       lfont[yyval] = rfont[yyval] = ROM;
-       if (t == QTEXT)
-               p = p1;
-       else if ( t == SPACE )
-               p = "\\ ";
-       else if ( t == THIN )
-               p = "\\|";
-       else if ( t == TAB )
-               p = "\\t";
-       else if ((tp = lookup(&restbl, p1, NULL)) != NULL)
-               p = tp->defn;
-       else {
-               lf = rf = 0;
-               for (csp=psp=0; (c=p1[psp++])!='\0';) {
-                       rf = trans(c, p1);
-                       if (lf == 0)
-                               lf = rf;        /* save first */
-                       if (csp>CSSIZE)
-                               error(FATAL,"converted token %.25s... too long",p1);
-               }
-               cs[csp] = '\0';
-               p = cs;
-               lfont[yyval] = lf;
-               rfont[yyval] = rf;
-       }
-       if(dbg)printf(".\t%dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c\n",
-               t, yyval, p, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]);
-       printf(".ds %d \"%s\n", yyval, p);
-}
-
-trans(c,p1) int c; char *p1; {
-       int f;
-       f = ROM;
-       switch( c) {
-       case '0': case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8': case '9':
-       case ':': case ';': case '!': case '%':
-       case '(': case '[': case ')': case ']':
-       case ',':
-               if (rf == ITAL)
-                       shim();
-               roman(c); break;
-       case '.':
-               if (rf == ROM)
-                       roman(c);
-               else
-                       cs[csp++] = c;
-               f = rf;
-               break;
-       case '|':
-               if (rf == ITAL)
-                       shim();
-               shim(); roman(c); shim(); break;
-       case '=':
-               if (rf == ITAL)
-                       shim();
-               name4('e','q');
-               break;
-       case '+':
-               if (rf == ITAL)
-                       shim();
-               name4('p', 'l');
-               break;
-       case '>': case '<':
-               if (rf == ITAL)
-                       shim();
-               if (p1[psp]=='=') {     /* look ahead for == <= >= */
-                       name4(c,'=');
-                       psp++;
-               } else {
-                       cs[csp++] = c;  
-               }
-               break;
-       case '-':
-               if (rf == ITAL)
-                       shim();
-               if (p1[psp]=='>') {
-                       name4('-','>'); psp++;
-               } else {
-                       name4('m','i');
-               }
-               break;
-       case '/':
-               if (rf == ITAL)
-                       shim();
-               name4('s','l');
-               break;
-       case '~': case ' ':
-               shim(); shim(); break;
-       case '^':
-               shim(); break;
-       case '\\':      /* troff - pass 2 or 3 more chars */
-               if (rf == ITAL)
-                       shim();
-               cs[csp++] = c; cs[csp++] = c = p1[psp++]; cs[csp++] = p1[psp++];
-               if (c=='(') cs[csp++] = p1[psp++];
-               if (c=='*' && cs[csp-1] == '(') {
-                       cs[csp++] = p1[psp++];
-                       cs[csp++] = p1[psp++];
-               }
-               break;
-       case '\'':
-               cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = rf==ITAL ? ITAL : ROM;
-               name4('f','m');
-               cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P';
-               f = rf==ITAL ? ITAL : ROM;
-               break;
-
-       case 'f':
-               if (ft == ITAL) {
-                       cs[csp++] = '\\'; cs[csp++] = '^';
-                       cs[csp++] = 'f';
-                       cs[csp++] = '\\'; cs[csp++] = '|';      /* trying | instead of ^ */
-                       f = ITAL;
-               }
-               else
-                       cs[csp++] = 'f';
-               break;
-       case 'j':
-               if (ft == ITAL) {
-                       cs[csp++] = '\\'; cs[csp++] = '^';
-                       cs[csp++] = 'j';
-                       f = ITAL;
-               }
-               else
-                       cs[csp++] = 'j';
-               break;
-       default:
-               cs[csp++] = c;
-               f = ft==ITAL ? ITAL : ROM;
-               break;
-       }
-       return(f);
-}
-
-shim() {
-       cs[csp++] = '\\'; cs[csp++] = '|';
-}
-
-roman(c) int c; {
-       cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = ROM;
-       cs[csp++] = c;
-       cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P';
-}
-
-name4(c1,c2) int c1,c2; {
-       cs[csp++] = '\\';
-       cs[csp++] = '(';
-       cs[csp++] = c1;
-       cs[csp++] = c2;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/expr.y b/.ref-Research-V7/usr/src/cmd/expr.y
deleted file mode 100644 (file)
index c31facf..0000000
+++ /dev/null
@@ -1,669 +0,0 @@
-/* Yacc productions for "expr" command: */
-
-%token OR AND ADD SUBT MULT DIV REM EQ GT GEQ LT LEQ NEQ
-%token A_STRING SUBSTR LENGTH INDEX NOARG MATCH
-
-/* operators listed below in increasing precedence: */
-%left OR
-%left AND
-%left EQ LT GT GEQ LEQ NEQ
-%left ADD SUBT
-%left MULT DIV REM
-%left MCH
-%left MATCH
-%left SUBSTR
-%left LENGTH INDEX
-%%
-
-/* a single `expression' is evaluated and printed: */
-
-expression:    expr NOARG = {
-                       printf("%s\n", $1);
-                       exit((!strcmp($1,"0")||!strcmp($1,"\0"))? 1: 0);
-                       }
-       ;
-
-
-expr:  '(' expr ')' = { $$ = $2; }
-       | expr OR expr   = { $$ = conj(OR, $1, $3); }
-       | expr AND expr   = { $$ = conj(AND, $1, $3); }
-       | expr EQ expr   = { $$ = rel(EQ, $1, $3); }
-       | expr GT expr   = { $$ = rel(GT, $1, $3); }
-       | expr GEQ expr   = { $$ = rel(GEQ, $1, $3); }
-       | expr LT expr   = { $$ = rel(LT, $1, $3); }
-       | expr LEQ expr   = { $$ = rel(LEQ, $1, $3); }
-       | expr NEQ expr   = { $$ = rel(NEQ, $1, $3); }
-       | expr ADD expr   = { $$ = arith(ADD, $1, $3); }
-       | expr SUBT expr   = { $$ = arith(SUBT, $1, $3); }
-       | expr MULT expr   = { $$ = arith(MULT, $1, $3); }
-       | expr DIV expr   = { $$ = arith(DIV, $1, $3); }
-       | expr REM expr   = { $$ = arith(REM, $1, $3); }
-       | expr MCH expr  = { $$ = match($1, $3); }
-       | MATCH expr expr = { $$ = match($2, $3); }
-       | SUBSTR expr expr expr = { $$ = substr($2, $3, $4); }
-       | LENGTH expr       = { $$ = length($2); }
-       | INDEX expr expr = { $$ = index($2, $3); }
-       | A_STRING
-       ;
-%%
-/*     expression command */
-#include <stdio.h>
-#define ESIZE  256
-#define error(c)       errxx(c)
-#define EQL(x,y) !strcmp(x,y)
-long atol();
-char   **Av;
-int    Ac;
-int    Argi;
-
-char Mstring[1][128];
-char *malloc();
-extern int nbra;
-
-main(argc, argv) char **argv; {
-       Ac = argc;
-       Argi = 1;
-       Av = argv;
-       yyparse();
-}
-
-char *operators[] = { "|", "&", "+", "-", "*", "/", "%", ":",
-       "=", "==", "<", "<=", ">", ">=", "!=",
-       "match", "substr", "length", "index", "\0" };
-int op[] = { OR, AND, ADD,  SUBT, MULT, DIV, REM, MCH,
-       EQ, EQ, LT, LEQ, GT, GEQ, NEQ,
-       MATCH, SUBSTR, LENGTH, INDEX };
-yylex() {
-       register char *p;
-       register i;
-
-       if(Argi >= Ac) return NOARG;
-
-       p = Av[Argi++];
-
-       if(*p == '(' || *p == ')')
-               return (int)*p;
-       for(i = 0; *operator[i]; ++i)
-               if(EQL(operator[i], p))
-                       return op[i];
-
-       yylval = p;
-       return A_STRING;
-}
-
-char *rel(op, r1, r2) register char *r1, *r2; {
-       register i;
-
-       if(ematch(r1, "-*[0-9]*$") && ematch(r2, "[0-9]*$"))
-               i = atol(r1) - atol(r2);
-       else
-               i = strcmp(r1, r2);
-       switch(op) {
-       case EQ: i = i==0; break;
-       case GT: i = i>0; break;
-       case GEQ: i = i>=0; break;
-       case LT: i = i<0; break;
-       case LEQ: i = i>=0; break;
-       case NEQ: i = i!=0; break;
-       }
-       return i? "1": "0";
-}
-
-char *arith(op, r1, r2) char *r1, *r2; {
-       long i1, i2;
-       register char *rv;
-
-       if(!(ematch(r1, "[0-9]*$") && ematch(r2, "[0-9]*$")))
-               yyerror("non-numeric argument");
-       i1 = atol(r1);
-       i2 = atol(r2);
-
-       switch(op) {
-       case ADD: i1 = i1 + i2; break;
-       case SUBT: i1 = i1 - i2; break;
-       case MULT: i1 = i1 * i2; break;
-       case DIV: i1 = i1 / i2; break;
-       case REM: i1 = i1 % i2; break;
-       }
-       rv = malloc(16);
-       sprintf(rv, "%D", i1);
-       return rv;
-}
-char *conj(op, r1, r2) char *r1, *r2; {
-       register char *rv;
-
-       switch(op) {
-
-       case OR:
-               if(EQL(r1, "0")
-               || EQL(r1, ""))
-                       if(EQL(r2, "0")
-                       || EQL(r2, ""))
-                               rv = "0";
-                       else
-                               rv = r2;
-               else
-                       rv = r1;
-               break;
-       case AND:
-               if(EQL(r1, "0")
-               || EQL(r1, ""))
-                       rv = "0";
-               else if(EQL(r2, "0")
-               || EQL(r2, ""))
-                       rv = "0";
-               else
-                       rv = r1;
-               break;
-       }
-       return rv;
-}
-
-char *substr(v, s, w) char *v, *s, *w; {
-register si, wi;
-register char *res;
-
-       si = atol(s);
-       wi = atol(w);
-       while(--si) if(*v) ++v;
-
-       res = v;
-
-       while(wi--) if(*v) ++v;
-
-       *v = '\0';
-       return res;
-}
-
-char *length(s) register char *s; {
-       register i = 0;
-       register char *rv;
-
-       while(*s++) ++i;
-
-       rv = malloc(8);
-       sprintf(rv, "%d", i);
-       return rv;
-}
-
-char *index(s, t) char *s, *t; {
-       register i, j;
-       register char *rv;
-
-       for(i = 0; s[i] ; ++i)
-               for(j = 0; t[j] ; ++j)
-                       if(s[i]==t[j]) {
-                               sprintf(rv = malloc(8), "%d", ++i);
-                               return rv;
-                       }
-       return "0";
-}
-
-char *match(s, p)
-{
-       register char *rv;
-
-       sprintf(rv = malloc(8), "%d", ematch(s, p));
-       if(nbra) {
-               rv = malloc(strlen(Mstring[0])+1);
-               strcpy(rv, Mstring[0]);
-       }
-       return rv;
-}
-
-#define INIT   register char *sp = instring;
-#define GETC()         (*sp++)
-#define PEEKC()                (*sp)
-#define UNGETC(c)      (--sp)
-#define RETURN(c)      return
-#define ERROR(c)       errxx(c)
-
-
-ematch(s, p)
-char *s;
-register char *p;
-{
-       static char expbuf[ESIZE];
-       char *compile();
-       register num;
-       extern char *braslist[], *braelist[], *loc2;
-
-       compile(p, expbuf, &expbuf[512], 0);
-       if(nbra > 1)
-               yyerror("Too many '\\('s");
-       if(advance(s, expbuf)) {
-               if(nbra == 1) {
-                       p = braslist[0];
-                       num = braelist[0] - p;
-                       strncpy(Mstring[0], p, num);
-                       Mstring[0][num] = '\0';
-               }
-               return(loc2-s);
-       }
-       return(0);
-}
-
-errxx(c)
-{
-       yyerror("RE error");
-}
-
-#define        CBRA    2
-#define        CCHR    4
-#define        CDOT    8
-#define        CCL     12
-#define        CDOL    20
-#define        CEOF    22
-#define        CKET    24
-#define        CBACK   36
-
-#define        STAR    01
-#define RNGE   03
-
-#define        NBRA    9
-
-#define PLACE(c)       ep[c >> 3] |= bittab[c & 07]
-#define ISTHERE(c)     (ep[c >> 3] & bittab[c & 07])
-
-char   *braslist[NBRA];
-char   *braelist[NBRA];
-int    nbra;
-char *loc1, *loc2, *locs;
-int    sed;
-
-int    circf;
-int    low;
-int    size;
-
-char   bittab[] = {
-       1,
-       2,
-       4,
-       8,
-       16,
-       32,
-       64,
-       128
-};
-
-char *
-compile(instring, ep, endbuf, seof)
-register char *ep;
-char *instring, *endbuf;
-{
-       INIT    /* Dependent declarations and initializations */
-       register c;
-       register eof = seof;
-       char *lastep = instring;
-       int cclcnt;
-       char bracket[NBRA], *bracketp;
-       int closed;
-       char neg;
-       int lc;
-       int i, cflg;
-
-       lastep = 0;
-       if((c = GETC()) == eof) {
-               if(*ep == 0 && !sed)
-                       ERROR(41);
-               RETURN(ep);
-       }
-       bracketp = bracket;
-       circf = closed = nbra = 0;
-       if (c == '^')
-               circf++;
-       else
-               UNGETC(c);
-       for (;;) {
-               if (ep >= endbuf)
-                       ERROR(50);
-               if((c = GETC()) != '*' && ((c != '\\') || (PEEKC() != '{')))
-                       lastep = ep;
-               if (c == eof) {
-                       *ep++ = CEOF;
-                       RETURN(ep);
-               }
-               switch (c) {
-
-               case '.':
-                       *ep++ = CDOT;
-                       continue;
-
-               case '\n':
-                       ERROR(36);
-               case '*':
-                       if (lastep==0 || *lastep==CBRA || *lastep==CKET)
-                               goto defchar;
-                       *lastep |= STAR;
-                       continue;
-
-               case '$':
-                       if(PEEKC() != eof)
-                               goto defchar;
-                       *ep++ = CDOL;
-                       continue;
-
-               case '[':
-                       if(&ep[17] >= endbuf)
-                               ERROR(50);
-
-                       *ep++ = CCL;
-                       lc = 0;
-                       for(i = 0; i < 16; i++)
-                               ep[i] = 0;
-
-                       neg = 0;
-                       if((c = GETC()) == '^') {
-                               neg = 1;
-                               c = GETC();
-                       }
-
-                       do {
-                               if(c == '\0' || c == '\n')
-                                       ERROR(49);
-                               if(c == '-' && lc != 0) {
-                                       if ((c = GETC()) == ']') {
-                                               PLACE('-');
-                                               break;
-                                       }
-                                       while(lc < c) {
-                                               PLACE(lc);
-                                               lc++;
-                                       }
-                               }
-                               lc = c;
-                               PLACE(c);
-                       } while((c = GETC()) != ']');
-                       if(neg) {
-                               for(cclcnt = 0; cclcnt < 16; cclcnt++)
-                                       ep[cclcnt] ^= -1;
-                               ep[0] &= 0376;
-                       }
-
-                       ep += 16;
-
-                       continue;
-
-               case '\\':
-                       switch(c = GETC()) {
-
-                       case '(':
-                               if(nbra >= NBRA)
-                                       ERROR(43);
-                               *bracketp++ = nbra;
-                               *ep++ = CBRA;
-                               *ep++ = nbra++;
-                               continue;
-
-                       case ')':
-                               if(bracketp <= bracket)
-                                       ERROR(42);
-                               *ep++ = CKET;
-                               *ep++ = *--bracketp;
-                               closed++;
-                               continue;
-
-                       case '{':
-                               if(lastep == (char *) (0))
-                                       goto defchar;
-                               *lastep |= RNGE;
-                               cflg = 0;
-                       nlim:
-                               c = GETC();
-                               i = 0;
-                               do {
-                                       if ('0' <= c && c <= '9')
-                                               i = 10 * i + c - '0';
-                                       else
-                                               ERROR(16);
-                               } while(((c = GETC()) != '\\') && (c != ','));
-                               if (i > 255)
-                                       ERROR(11);
-                               *ep++ = i;
-                               if (c == ',') {
-                                       if(cflg++)
-                                               ERROR(44);
-                                       if((c = GETC()) == '\\')
-                                               *ep++ = 255;
-                                       else {
-                                               UNGETC(c);
-                                               goto nlim; /* get 2'nd number */
-                                       }
-                               }
-                               if(GETC() != '}')
-                                       ERROR(45);
-                               if(!cflg)       /* one number */
-                                       *ep++ = i;
-                               else if((ep[-1] & 0377) < (ep[-2] & 0377))
-                                       ERROR(46);
-                               continue;
-
-                       case '\n':
-                               ERROR(36);
-
-                       case 'n':
-                               c = '\n';
-                               goto defchar;
-
-                       default:
-                               if(c >= '1' && c <= '9') {
-                                       if((c -= '1') >= closed)
-                                               ERROR(25);
-                                       *ep++ = CBACK;
-                                       *ep++ = c;
-                                       continue;
-                               }
-                       }
-                       /* Drop through to default to use \ to turn off special chars */
-
-               defchar:
-               default:
-                       lastep = ep;
-                       *ep++ = CCHR;
-                       *ep++ = c;
-               }
-       }
-}
-
-step(p1, p2)
-register char *p1, *p2;
-{
-       register c;
-
-       if (circf) {
-               loc1 = p1;
-               return(advance(p1, p2));
-       }
-       /* fast check for first character */
-       if (*p2==CCHR) {
-               c = p2[1];
-               do {
-                       if (*p1 != c)
-                               continue;
-                       if (advance(p1, p2)) {
-                               loc1 = p1;
-                               return(1);
-                       }
-               } while (*p1++);
-               return(0);
-       }
-               /* regular algorithm */
-       do {
-               if (advance(p1, p2)) {
-                       loc1 = p1;
-                       return(1);
-               }
-       } while (*p1++);
-       return(0);
-}
-
-advance(lp, ep)
-register char *lp, *ep;
-{
-       register char *curlp;
-       char c;
-       char *bbeg;
-       int ct;
-
-       for (;;) switch (*ep++) {
-
-       case CCHR:
-               if (*ep++ == *lp++)
-                       continue;
-               return(0);
-
-       case CDOT:
-               if (*lp++)
-                       continue;
-               return(0);
-
-       case CDOL:
-               if (*lp==0)
-                       continue;
-               return(0);
-
-       case CEOF:
-               loc2 = lp;
-               return(1);
-
-       case CCL:
-               c = *lp++ & 0177;
-               if(ISTHERE(c)) {
-                       ep += 16;
-                       continue;
-               }
-               return(0);
-       case CBRA:
-               braslist[*ep++] = lp;
-               continue;
-
-       case CKET:
-               braelist[*ep++] = lp;
-               continue;
-
-       case CCHR|RNGE:
-               c = *ep++;
-               getrnge(ep);
-               while(low--)
-                       if(*lp++ != c)
-                               return(0);
-               curlp = lp;
-               while(size--) 
-                       if(*lp++ != c)
-                               break;
-               if(size < 0)
-                       lp++;
-               ep += 2;
-               goto star;
-
-       case CDOT|RNGE:
-               getrnge(ep);
-               while(low--)
-                       if(*lp++ == '\0')
-                               return(0);
-               curlp = lp;
-               while(size--)
-                       if(*lp++ == '\0')
-                               break;
-               if(size < 0)
-                       lp++;
-               ep += 2;
-               goto star;
-
-       case CCL|RNGE:
-               getrnge(ep + 16);
-               while(low--) {
-                       c = *lp++ & 0177;
-                       if(!ISTHERE(c))
-                               return(0);
-               }
-               curlp = lp;
-               while(size--) {
-                       c = *lp++ & 0177;
-                       if(!ISTHERE(c))
-                               break;
-               }
-               if(size < 0)
-                       lp++;
-               ep += 18;               /* 16 + 2 */
-               goto star;
-
-       case CBACK:
-               bbeg = braslist[*ep];
-               ct = braelist[*ep++] - bbeg;
-
-               if(ecmp(bbeg, lp, ct)) {
-                       lp += ct;
-                       continue;
-               }
-               return(0);
-
-       case CBACK|STAR:
-               bbeg = braslist[*ep];
-               ct = braelist[*ep++] - bbeg;
-               curlp = lp;
-               while(ecmp(bbeg, lp, ct))
-                       lp += ct;
-
-               while(lp >= curlp) {
-                       if(advance(lp, ep))     return(1);
-                       lp -= ct;
-               }
-               return(0);
-
-
-       case CDOT|STAR:
-               curlp = lp;
-               while (*lp++);
-               goto star;
-
-       case CCHR|STAR:
-               curlp = lp;
-               while (*lp++ == *ep);
-               ep++;
-               goto star;
-
-       case CCL|STAR:
-               curlp = lp;
-               do {
-                       c = *lp++ & 0177;
-               } while(ISTHERE(c));
-               ep += 16;
-               goto star;
-
-       star:
-               do {
-                       if(--lp == locs)
-                               break;
-                       if (advance(lp, ep))
-                               return(1);
-               } while (lp > curlp);
-               return(0);
-
-       }
-}
-
-getrnge(str)
-register char *str;
-{
-       low = *str++ & 0377;
-       size = *str == 255 ? 20000 : (*str &0377) - low;
-}
-
-ecmp(a, b, count)
-register char  *a, *b;
-register       count;
-{
-       if(a == b) /* should have been caught in compile() */
-               error(51);
-       while(count--)
-               if(*a++ != *b++)        return(0);
-       return(1);
-}
-
-yyerror(s)
-
-{
-       fprintf(stderr, "%s\n", s);
-       exit(2);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/data.c b/.ref-Research-V7/usr/src/cmd/f77/data.c
deleted file mode 100644 (file)
index 3ac8b33..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-#include "defs"
-
-/* ROUTINES CALLED DURING DATA STATEMENT PROCESSING */
-
-static char datafmt[] = "%s\t%05ld\t%05ld\t%d" ;
-
-/* another initializer, called from parser */
-dataval(repp, valp)
-register struct constblock *repp, *valp;
-{
-int i, nrep;
-ftnint elen, vlen;
-register struct addrblock *p;
-struct addrblock *nextdata();
-
-if(repp == NULL)
-       nrep = 1;
-else if (ISICON(repp) && repp->const.ci >= 0)
-       nrep = repp->const.ci;
-else
-       {
-       err("invalid repetition count in DATA statement");
-       frexpr(repp);
-       goto ret;
-       }
-frexpr(repp);
-
-if( ! ISCONST(valp) )
-       {
-       err("non-constant initializer");
-       goto ret;
-       }
-
-if(toomanyinit) goto ret;
-for(i = 0 ; i < nrep ; ++i)
-       {
-       p = nextdata(&elen, &vlen);
-       if(p == NULL)
-               {
-               err("too many initializers");
-               toomanyinit = YES;
-               goto ret;
-               }
-       setdata(p, valp, elen, vlen);
-       frexpr(p);
-       }
-
-ret:
-       frexpr(valp);
-}
-
-
-struct addrblock *nextdata(elenp, vlenp)
-ftnint *elenp, *vlenp;
-{
-register struct impldoblock *ip;
-struct primblock *pp;
-register struct nameblock *np;
-register struct rplblock *rp;
-tagptr p;
-expptr neltp;
-register expptr q;
-int skip;
-ftnint off;
-struct constblock *mkintcon();
-
-while(curdtp)
-       {
-       p = curdtp->datap;
-       if(p->tag == TIMPLDO)
-               {
-               ip = p;
-               if(ip->implb==NULL || ip->impub==NULL || ip->varnp==NULL)
-                       fatal1("bad impldoblock 0%o", ip);
-               if(ip->isactive)
-                       ip->varvp->const.ci += ip->impdiff;
-               else
-                       {
-                       q = fixtype(cpexpr(ip->implb));
-                       if( ! ISICON(q) )
-                               goto doerr;
-                       ip->varvp = q;
-
-                       if(ip->impstep)
-                               {
-                               q = fixtype(cpexpr(ip->impstep));
-                               if( ! ISICON(q) )
-                                       goto doerr;
-                               ip->impdiff = q->const.ci;
-                               frexpr(q);
-                               }
-                       else
-                               ip->impdiff = 1;
-
-                       q = fixtype(cpexpr(ip->impub));
-                       if(! ISICON(q))
-                               goto doerr;
-                       ip->implim = q->const.ci;
-                       frexpr(q);
-
-                       ip->isactive = YES;
-                       rp = ALLOC(rplblock);
-                       rp->nextp = rpllist;
-                       rpllist = rp;
-                       rp->rplnp = ip->varnp;
-                       rp->rplvp = ip->varvp;
-                       rp->rpltag = TCONST;
-                       }
-
-               if( (ip->impdiff>0 && (ip->varvp->const.ci <= ip->implim))
-                || (ip->impdiff<0 && (ip->varvp->const.ci >= ip->implim)) )
-                       { /* start new loop */
-                       curdtp = ip->datalist;
-                       goto next;
-                       }
-
-               /* clean up loop */
-
-               popstack(&rpllist);
-
-               frexpr(ip->varvp);
-               ip->isactive = NO;
-               curdtp = curdtp->nextp;
-               goto next;
-               }
-
-       pp = p;
-       np = pp->namep;
-       skip = YES;
-
-       if(p->argsp==NULL && np->vdim!=NULL)
-               {   /* array initialization */
-               q = mkaddr(np);
-               off = typesize[np->vtype] * curdtelt;
-               if(np->vtype == TYCHAR)
-                       off *= np->vleng->const.ci;
-               q->memoffset = mkexpr(OPPLUS, q->memoffset, mkintcon(off) );
-               if( (neltp = np->vdim->nelt) && ISCONST(neltp))
-                       {
-                       if(++curdtelt < neltp->const.ci)
-                               skip = NO;
-                       }
-               else
-                       err("attempt to initialize adjustable array");
-               }
-       else
-               q = mklhs( cpexpr(pp) );
-       if(skip)
-               {
-               curdtp = curdtp->nextp;
-               curdtelt = 0;
-               }
-       if(q->vtype == TYCHAR)
-               if(ISICON(q->vleng))
-                       *elenp = q->vleng->const.ci;
-               else    {
-                       err("initialization of string of nonconstant length");
-                       continue;
-                       }
-       else    *elenp = typesize[q->vtype];
-
-       if(np->vstg == STGCOMMON)
-               *vlenp = extsymtab[np->vardesc.varno].maxleng;
-       else if(np->vstg == STGEQUIV)
-               *vlenp = eqvclass[np->vardesc.varno].eqvleng;
-       else    {
-               *vlenp =  (np->vtype==TYCHAR ?
-                               np->vleng->const.ci : typesize[np->vtype]);
-               if(np->vdim)
-                       *vlenp *= np->vdim->nelt->const.ci;
-               }
-       return(q);
-
-doerr:
-               err("nonconstant implied DO parameter");
-               frexpr(q);
-               curdtp = curdtp->nextp;
-
-next:  curdtelt = 0;
-       }
-
-return(NULL);
-}
-
-
-
-
-
-
-LOCAL setdata(varp, valp, elen, vlen)
-struct addrblock *varp;
-ftnint elen, vlen;
-struct constblock *valp;
-{
-union constant con;
-int i, k;
-int stg, type, valtype;
-ftnint offset;
-register char *s, *t;
-char *memname();
-static char varname[XL+2];
-
-/* output form of name is padded with blanks and preceded
-   with a storage class digit
-*/
-
-stg = varp->vstg;
-varname[0] = (stg==STGCOMMON ? '2' : (stg==STGEQUIV ? '1' : '0') );
-s = memname(stg, varp->memno);
-for(t = varname+1 ; *s ; )
-       *t++ = *s++;
-while(t < varname+XL+1)
-       *t++ = ' ';
-varname[XL+1] = '\0';
-
-offset = varp->memoffset->const.ci;
-type = varp->vtype;
-valtype = valp->vtype;
-if(type!=TYCHAR && valtype==TYCHAR)
-       {
-       if(! ftn66flag)
-               warn("non-character datum initialized with character string");
-       varp->vleng = ICON(typesize[type]);
-       varp->vtype = type = TYCHAR;
-       }
-else if( (type==TYCHAR && valtype!=TYCHAR) ||
-        (cktype(OPASSIGN,type,valtype) == TYERROR) )
-       {
-       err("incompatible types in initialization");
-       return;
-       }
-if(type != TYCHAR)
-       if(valtype == TYUNKNOWN)
-               con.ci = valp->const.ci;
-       else    consconv(type, &con, valtype, &valp->const);
-
-k = 1;
-switch(type)
-       {
-       case TYLOGICAL:
-               type = tylogical;
-       case TYSHORT:
-       case TYLONG:
-               fprintf(initfile, datafmt, varname, offset, vlen, type);
-               prconi(initfile, type, con.ci);
-               break;
-
-       case TYCOMPLEX:
-               k = 2;
-               type = TYREAL;
-       case TYREAL:
-               goto flpt;
-
-       case TYDCOMPLEX:
-               k = 2;
-               type = TYDREAL;
-       case TYDREAL:
-       flpt:
-
-               for(i = 0 ; i < k ; ++i)
-                       {
-                       fprintf(initfile, datafmt, varname, offset, vlen, type);
-                       prconr(initfile, type, con.cd[i]);
-                       offset += typesize[type];
-                       }
-               break;
-
-       case TYCHAR:
-               k = valp->vleng->const.ci;
-               if(elen < k)
-                       k = elen;
-
-               for(i = 0 ; i < k ; ++i)
-                       {
-                       fprintf(initfile, datafmt, varname, offset++, vlen, TYCHAR);
-                       fprintf(initfile, "\t%d\n", valp->const.ccp[i]);
-                       }
-               k = elen - valp->vleng->const.ci;
-               while( k-- > 0)
-                       {
-                       fprintf(initfile, datafmt, varname, offset++, vlen, TYCHAR);
-                       fprintf(initfile, "\t%d\n", ' ');
-                       }
-               break;
-
-       default:
-               fatal1("setdata: impossible type %d", type);
-       }
-
-}
-
-
-
-frdata(p0)
-chainp p0;
-{
-register chainp p;
-register tagptr q;
-
-for(p = p0 ; p ; p = p->nextp)
-       {
-       q = p->datap;
-       if(q->tag == TIMPLDO)
-               {
-               if(q->isbusy)
-                       return; /* circular chain completed */
-               q->isbusy = YES;
-               frdata(q->datalist);
-               free(q);
-               }
-       else
-               frexpr(q);
-       }
-
-frchain( &p0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/defines b/.ref-Research-V7/usr/src/cmd/f77/defines
deleted file mode 100644 (file)
index cb44024..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-#define INTERDATA 2
-#define GCOS 3
-#define PDP11 4
-#define IBM 5
-#define CMACH 6
-#define VAX 7
-
-#define DMR 2
-#define SCJ 3
-
-#define BINARY 2
-#define ASCII 3
-
-#define PREFIX 2
-#define POSTFIX 3
-
-#ifndef FAMILY
-FAMILY NOT DEFINED !!!
-Family = FAMILY
-#endif
-
-#ifndef HERE
-HERE NOT DEFINED !!!!
-Here = HERE
-#endif
-
-#ifndef OUTPUT
-OUTPUT NOT DEFINED!!!!
-Output = OUTPUT
-#endif
-
-#ifndef POLISH
-POLISH NOT DEFINED !!!
-Polish = POLISH
-#endif
-
-#define M(x) (1<<x)
-#define ALLOC(x) (struct x *) ckalloc(sizeof(struct x))
-typedef int *ptr;
-typedef FILE *FILEP;
-typedef short flag;
-typedef long int ftnint;
-#define LOCAL static
-
-#define NO 0
-#define YES 1
-
-
-
-/* block tag values */
-
-#define TNAME 1
-#define TCONST 2
-#define TEXPR 3
-#define TADDR 4
-#define TPRIM 5
-#define TLIST 6
-#define TIMPLDO 7
-#define TERROR 8
-
-
-/* parser states */
-
-#define OUTSIDE 0
-#define INSIDE 1
-#define INDCL 2
-#define INDATA 3
-#define INEXEC 4
-
-/* procedure classes */
-
-#define PROCMAIN 1
-#define PROCBLOCK 2
-#define PROCSUBR 3
-#define PROCFUNCT 4
-
-
-/* storage classes */
-
-#define STGUNKNOWN 0
-#define STGARG 1
-#define STGAUTO 2
-#define STGBSS 3
-#define STGINIT 4
-#define STGCONST 5
-#define STGEXT 6
-#define STGINTR 7
-#define STGSTFUNCT 8
-#define STGCOMMON 9
-#define STGEQUIV 10
-#define STGREG 11
-#define STGLENG 12
-
-/* name classes */
-
-#define CLUNKNOWN 0
-#define CLPARAM 1
-#define CLVAR 2
-#define CLENTRY 3
-#define CLMAIN 4
-#define CLBLOCK 5
-#define CLPROC 6
-
-
-/* vproclass values */
-
-#define PUNKNOWN 0
-#define PEXTERNAL 1
-#define PINTRINSIC 2
-#define PSTFUNCT 3
-#define PTHISPROC 4
-
-/* control stack codes */
-
-#define CTLDO 1
-#define CTLIF 2
-#define CTLELSE 3
-
-
-/* operators */
-
-#define OPPLUS 1
-#define OPMINUS 2
-#define OPSTAR 3
-#define OPSLASH 4
-#define OPPOWER 5
-#define OPNEG 6
-#define OPOR 7
-#define OPAND 8
-#define OPEQV 9
-#define OPNEQV 10
-#define OPNOT 11
-#define OPCONCAT 12
-#define OPLT 13
-#define OPEQ 14
-#define OPGT 15
-#define OPLE 16
-#define OPNE 17
-#define OPGE 18
-#define OPCALL 19
-#define OPCCALL 20
-#define OPASSIGN 21
-#define OPPLUSEQ 22
-#define OPSTAREQ 23
-#define OPCONV 24
-#define OPLSHIFT 25
-#define OPMOD 26
-#define OPCOMMA 27
-#define OPQUEST 28
-#define OPCOLON 29
-#define OPABS 30
-#define OPMIN 31
-#define OPMAX 32
-#define OPADDR 33
-#define OPINDIRECT 34
-#define OPBITOR 35
-#define OPBITAND 36
-#define OPBITXOR 37
-#define OPBITNOT 38
-#define OPRSHIFT 39
-
-
-/* memory regions */
-
-#define REGARG 1
-#define REGAUTO 2
-#define REGBSS 3
-#define REGINIT 4
-#define REGCONST 5
-#define REGEXT 6
-#define REGPROG 7
-
-/* label type codes */
-
-#define LABUNKNOWN 0
-#define LABEXEC 1
-#define LABFORMAT 2
-#define LABOTHER 3
-
-
-/* INTRINSIC function codes*/
-
-#define INTREND 0
-#define INTRCONV 1
-#define INTRMIN 2
-#define INTRMAX 3
-#define INTRGEN 4
-#define INTRSPEC 5
-#define INTRBOOL 6
-#define INTRCNST 7
-
-
-/* I/O statement codes */
-
-#define IOSTDIN ICON(5)
-#define IOSTDOUT ICON(6)
-
-#define IOSBAD (-1)
-#define IOSPOSITIONAL 0
-#define IOSUNIT 1
-#define IOSFMT 2
-
-#define IOINQUIRE 1
-#define IOOPEN 2
-#define IOCLOSE 3
-#define IOREWIND 4
-#define IOBACKSPACE 5
-#define IOENDFILE 6
-#define IOREAD 7
-#define IOWRITE 8
-
-
-/* type masks */
-
-#define MSKLOGICAL     M(TYLOGICAL)
-#define MSKADDR        M(TYADDR)
-#define MSKCHAR        M(TYCHAR)
-#define MSKINT M(TYSHORT)|M(TYLONG)
-#define MSKREAL        M(TYREAL)|M(TYDREAL)
-#define MSKCOMPLEX     M(TYCOMPLEX)|M(TYDCOMPLEX)
-
-/* miscellaneous macros */
-
-#define ONEOF(x,y) (M(x) & (y))
-#define ISCOMPLEX(z) ONEOF(z, MSKCOMPLEX)
-#define ISREAL(z) ONEOF(z, MSKREAL)
-#define ISNUMERIC(z) ONEOF(z, MSKINT|MSKREAL|MSKCOMPLEX)
-#define ISICON(z) (z->tag==TCONST && ISINT(z->vtype))
-#define ISCHAR(z) (z->vtype==TYCHAR)
-#define ISINT(z)   ONEOF(z, MSKINT)
-#define ISCONST(z) (z->tag==TCONST)
-#define ISERROR(z) (z->tag==TERROR)
-#define ISPLUSOP(z) (z->tag==TEXPR && z->opcode==OPPLUS)
-#define ISSTAROP(z) (z->tag==TEXPR && z->opcode==OPSTAR)
-#define ISONE(z) (ISICON(z) && z->const.ci==1)
-#define INT(z) ONEOF(z, MSKINT|MSKCHAR)
-#define ICON(z) mkintcon( (ftnint)(z) )
-#define CHCON(z) mkstrcon(strlen(z), z)
-
-/* round a up to a multiple of b */
-#define roundup(a,b)    ( b * ( (a+b-1)/b) )
diff --git a/.ref-Research-V7/usr/src/cmd/f77/defs b/.ref-Research-V7/usr/src/cmd/f77/defs
deleted file mode 100644 (file)
index b9539cc..0000000
+++ /dev/null
@@ -1,440 +0,0 @@
-#include <stdio.h>
-
-#ifdef unix
-#      include <ctype.h>
-#endif
-
-#include "ftypes"
-#include "defines"
-#include "locdefs"
-
-#define VL 6
-
-#define MAXINCLUDES 10
-#define MAXLITERALS 20
-#define MAXCTL 20
-#define MAXHASH 401
-#define MAXSTNO 201
-#define MAXEXT 200
-#define MAXEQUIV 150
-#define MAXLABLIST 125
-
-typedef union expression *expptr;
-typedef union taggedblock *tagptr;
-typedef union chainedblock *chainp;
-
-extern FILEP infile;
-extern FILEP diagfile;
-extern FILEP textfile;
-extern FILEP asmfile;
-extern FILEP initfile;
-extern long int headoffset;
-
-extern char token [ ];
-extern int toklen;
-extern int yylval;
-extern int lineno;
-extern char *infname;
-extern int needkwd;
-extern struct labelblock *thislabel;
-
-extern flag profileflag;
-extern flag optimflag;
-extern flag nowarnflag;
-extern flag ftn66flag;
-extern flag shiftcase;
-extern flag undeftype;
-extern flag shortsubs;
-extern flag onetripflag;
-extern flag checksubs;
-extern flag debugflag;
-extern int nerr;
-extern int nwarn;
-extern int ndata;
-
-extern int parstate;
-extern flag headerdone;
-extern int blklevel;
-extern flag saveall;
-extern flag substars;
-extern int impltype[ ];
-extern int implleng[ ];
-extern int implstg[ ];
-
-extern int tyint;
-extern int tylogical;
-extern ftnint typesize[];
-extern int typealign[];
-extern int procno;
-extern int proctype;
-extern char * procname;
-extern int rtvlabel[ ];
-extern int fudgelabel; /* to confuse the pdp11 optimizer */
-extern struct addrblock *typeaddr;
-extern struct addrblock *retslot;
-extern int cxslot;
-extern int chslot;
-extern int chlgslot;
-extern int procclass;
-extern ftnint procleng;
-extern int nentry;
-extern flag multitype;
-extern int blklevel;
-extern int lastlabno;
-extern int lastvarno;
-extern int lastargslot;
-extern int argloc;
-extern ftnint autoleng;
-extern ftnint bssleng;
-extern int retlabel;
-extern int ret0label;
-extern int dorange;
-extern int regnum[ ];
-extern struct nameblock *regnamep[ ];
-extern int maxregvar;
-extern int highregvar;
-extern int nregvar;
-
-extern chainp templist;
-extern chainp holdtemps;
-extern struct entrypoint *entries;
-extern struct rplblock *rpllist;
-extern chainp curdtp;
-extern ftnint curdtelt;
-extern flag toomanyinit;
-
-extern flag inioctl;
-extern int iostmt;
-extern struct addrblock *ioblkp;
-extern int nioctl;
-extern int nequiv;
-extern int nintnames;
-extern int nextnames;
-\f
-struct chain
-       {
-       chainp nextp;
-       tagptr datap;
-       };
-
-extern chainp chains;
-
-struct ctlframe
-       {
-       unsigned ctltype:8;
-       unsigned dostepsign:8;
-       int ctlabels[4];
-       int dolabel;
-       struct nameblock *donamep;
-       expptr domax;
-       expptr dostep;
-       };
-#define endlabel ctlabels[0]
-#define elselabel ctlabels[1]
-#define dobodylabel ctlabels[1]
-#define doposlabel ctlabels[2]
-#define doneglabel ctlabels[3]
-extern struct ctlframe ctls[ ];
-extern struct ctlframe *ctlstack;
-extern struct ctlframe *lastctl;
-
-struct extsym
-       {
-       char extname[XL];
-       unsigned extstg:4;
-       unsigned extsave:1;
-       unsigned extinit:1;
-       ptr extp;
-       ftnint extleng;
-       ftnint maxleng;
-       };
-
-extern struct extsym extsymtab[ ];
-extern struct extsym *nextext;
-extern struct extsym *lastext;
-
-struct labelblock
-       {
-       int labelno;
-       unsigned blklevel:8;
-       unsigned labused:1;
-       unsigned labinacc:1;
-       unsigned labdefined:1;
-       unsigned labtype:2;
-       ftnint stateno;
-       };
-
-extern struct labelblock labeltab[ ];
-extern struct labelblock *labtabend;
-extern struct labelblock *highlabtab;
-
-struct entrypoint
-       {
-       chainp nextp;
-       struct extsym *entryname;
-       chainp arglist;
-       int entrylabel;
-       int typelabel;
-       ptr enamep;
-       };
-
-struct primblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       struct nameblock *namep;
-       struct listblock *argsp;
-       expptr fcharp;
-       expptr lcharp;
-       };
-
-
-struct hashentry
-       {
-       int hashval;
-       struct nameblock *varp;
-       };
-extern struct hashentry hashtab[ ];
-extern struct hashentry *lasthash;
-
-struct intrpacked      /* bits for intrinsic function description */
-       {
-       unsigned f1:3;
-       unsigned f2:4;
-       unsigned f3:7;
-       };
-
-struct nameblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       unsigned vclass:4;
-       unsigned vstg:4;
-       expptr vleng;
-       char varname[VL];
-       unsigned vdovar:1;
-       unsigned vdcldone:1;
-       unsigned vadjdim:1;
-       unsigned vsave:1;
-       unsigned vprocclass:3;
-       unsigned vregno:4;
-       union   {
-               int varno;
-               chainp vstfdesc;        /* points to (formals, expr) pair */
-               struct intrpacked intrdesc;     /* bits for intrinsic function */
-               } vardesc;
-       struct dimblock *vdim;
-       int voffset;
-       };
-
-
-struct paramblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       unsigned vclass:4;
-       expptr vleng;
-       char varname[VL];
-       ptr paramval;
-       } ;
-
-
-struct exprblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       unsigned vclass:4;
-       expptr vleng;
-       unsigned opcode:6;
-       expptr leftp;
-       expptr rightp;
-       };
-
-
-union constant
-       {
-       char *ccp;
-       ftnint ci;
-       double cd[2];
-       };
-
-struct constblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       expptr vleng;
-       union constant const;
-       };
-
-
-struct listblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       chainp listp;
-       };
-
-
-
-struct addrblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       unsigned vclass:4;
-       unsigned vstg:4;
-       expptr vleng;
-       int memno;
-       expptr memoffset;
-       unsigned istemp:1;
-       unsigned ntempelt:10;
-       };
-
-
-
-struct errorblock
-       {
-       unsigned tag:4;
-       unsigned vtype:4;
-       };
-
-
-union expression
-       {
-       struct exprblock;
-       struct addrblock;
-       struct constblock;
-       struct errorblock;
-       struct listblock;
-       struct primblock;
-       } ;
-
-
-
-struct dimblock
-       {
-       int ndim;
-       expptr nelt;
-       expptr baseoffset;
-       expptr basexpr;
-       struct
-               {
-               expptr dimsize;
-               expptr dimexpr;
-               } dims[1];
-       };
-
-
-struct impldoblock
-       {
-       unsigned tag:4;
-       unsigned isactive:1;
-       unsigned isbusy:1;
-       struct nameblock *varnp;
-       struct constblock *varvp;
-       expptr implb;
-       expptr impub;
-       expptr impstep;
-       ftnint impdiff;
-       ftnint implim;
-       chainp datalist;
-       };
-
-
-struct rplblock        /* name replacement block */
-       {
-       chainp nextp;
-       struct nameblock *rplnp;
-       ptr rplvp;
-       struct exprblock *rplxp;
-       int rpltag;
-       };
-
-
-
-struct equivblock
-       {
-       ptr equivs;
-       unsigned eqvinit:1;
-       long int eqvtop;
-       long int eqvbottom;
-       } ;
-#define eqvleng eqvtop
-
-extern struct equivblock eqvclass[ ];
-
-
-struct eqvchain
-       {
-       chainp nextp;
-       ptr eqvitem;
-       long int eqvoffset;
-       } ;
-
-union chainedblock
-       {
-       struct chain;
-       struct entrypoint;
-       struct rplblock;
-       struct eqvchain;
-       };
-
-
-
-union taggedblock
-       {
-       struct nameblock;
-       struct paramblock;
-       struct exprblock;
-       struct constblock;
-       struct listblock;
-       struct addrblock;
-       struct errorblock;
-       struct primblock;
-       struct impldoblock;
-       } ;
-
-
-
-
-struct literal
-       {
-       short littype;
-       short litnum;
-       union   {
-               ftnint litival;
-               double litdval;
-               struct  {
-                       char litclen;   /* small integer */
-                       char litcstr[XL];
-                       } litcval;
-               } litval;
-       };
-
-extern struct literal litpool[ ];
-extern int nliterals;
-
-
-
-
-
-/* popular functions with non integer return values */
-
-
-int *ckalloc();
-char *varstr(), *nounder(), *varunder();
-char *copyn(), *copys();
-chainp hookup(), mkchain();
-ftnint convci();
-char *convic();
-char *setdoto();
-double convcd();
-struct nameblock *mkname();
-struct labelblock *mklabel();
-struct extsym *mkext(), *newentry();
-struct exprblock *addrof(), *call1(), *call2(), *call3(), *call4();
-struct addrblock *builtin(), *mktemp(), *mktmpn();
-struct addrblock *autovar(), *mklhs(), *mkaddr(), *putconst(), *memversion();
-struct constblock *mkintcon();
-expptr mkexpr(), mkconv(), mkfunct(), fixexpr(), fixtype();
-tagptr cpexpr(), mkprim();
-struct errorblock *errnode();
diff --git a/.ref-Research-V7/usr/src/cmd/f77/dmrdefs b/.ref-Research-V7/usr/src/cmd/f77/dmrdefs
deleted file mode 100644 (file)
index 8937b54..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#define P2BAD -1
-#define P2NAME 20
-#define P2ICON 21
-#define P2PLUS 40
-#define P2PLUSEQ       70
-#define P2MINUS        41
-#define P2NEG  37
-#define P2STAR 42
-#define P2STAREQ       72
-#define P2ADDR 35
-#define P2INDIRECT     36
-#define P2BITNOT       38
-#define P2BITAND       47
-#define P2BITOR        48
-#define P2BITXOR       49
-#define P2QUEST        90
-#define P2COLON        8
-#define P2ANDAND       53
-#define P2OROR 54
-#define P2GOTO 111
-#define P2LISTOP       9
-#define P2ASSIGN       80
-#define P2COMOP        97
-#define P2SLASH        43
-#define P2MOD  44
-#define P2RSHIFT       45
-#define P2LSHIFT       46
-#define P2CALL 100
-
-#define P2NOT  34
-#define P2EQ   60
-#define P2NE   61
-#define P2LE   62
-#define P2LT   63
-#define P2GE   64
-#define P2GT   65
-#define P2EXTERN       12
-#define P2STATIC       13
-#define P2REG  14
-#define P2CONV -1
-#define P2FORCE        110
-#define P2CBRANCH      103
-#define P2ARIF 222
-
-#define P2EXPR 214
-#define P2JUMP 102
-#define P2LABEL        112
-#define P2RLABEL       114
-#define P2SWITCH       213
-#define P2LCON 25
-#define P2NULL 218
-#define P2EOF  0
-#define P2RETURN       209
-#define P2SAVE 208
-#define P2SETREG       105
-#define P2SETSTK       219
-#define P2PROG 202
-
-#define P2CHAR 1
-
-#if TARGET==PDP11
-#      define P2SHORT  0
-#      define P2INT    0
-#      define P2LONG   6
-#else
-#      define P2SHORT  0
-#      define P2INT    6
-#      define P2LONG   6
-#endif
-
-#define P2REAL 2
-#define P2DREAL        3
-#define P2PTR  010
-#define P2FUNCT        020
-
-#define P2ITOF 51
-#define P2FTOI 52
-#define P2FTOL 56
-#define P2LTOF 57
-#define P2ITOL 58
-#define P2LTOI 59
-#define P2ITOC 109
-
-#define P2PROFIL       212
diff --git a/.ref-Research-V7/usr/src/cmd/f77/drivedefs b/.ref-Research-V7/usr/src/cmd/f77/drivedefs
deleted file mode 100644 (file)
index c992da6..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-  Driver for Fortran 77 Compiler
-  For the PDP11, Running on the PDP11, 
-  Using the Ritchie C compiler's second pass
-*/
-
-#if HERE!=PDP11 || TARGET!=PDP11 || FAMILY!=DMR
-       Wrong Definitions File!
-#endif
-
-#define PASS1NAME      "/lib/f77pass1"
-#define PASS2NAME      "/lib/c1"
-#define PASS2OPT       "/lib/c2"
-#define NOFLPASS2      "/lib/fc1"
-#define ASMNAME        "/bin/as"
-#define LDNAME "/bin/ld"
-#define FOOTNAME       "/lib/crt0.o"
-#define PROFFOOT       "/lib/mcrt0.o"
-#define NOFLFOOT       "/lib/fcrt0.o"
-#define NOFLPROFFOOT   "/lib/fmcrt0.o"
-
-static char *liblist [ ] =
-       {
-       "-lF77",
-       "-lI77",
-       "-lm",
-       "-lc",
-       NULL };
diff --git a/.ref-Research-V7/usr/src/cmd/f77/driver.c b/.ref-Research-V7/usr/src/cmd/f77/driver.c
deleted file mode 100644 (file)
index daf3456..0000000
+++ /dev/null
@@ -1,1135 +0,0 @@
-char *xxxvers[] = "\n FORTRAN 77 DRIVER, VERSION 1.13,   20 APRIL 1979\n";
-#include <stdio.h>
-#include <ctype.h>
-#include "defines"
-#include "locdefs"
-#include "drivedefs"
-#include "ftypes"
-#include <signal.h>
-
-static FILEP diagfile  = {stderr} ;
-static int pid;
-static int sigivalue   = 0;
-static int sigqvalue   = 0;
-static int sighvalue   = 0;
-static int sigtvalue   = 0;
-
-static char *pass1name = PASS1NAME ;
-static char *pass2name = PASS2NAME ;
-static char *asmname   = ASMNAME ;
-static char *ldname    = LDNAME ;
-static char *footname  = FOOTNAME;
-static char *proffoot  = PROFFOOT;
-static char *macroname = "m4";
-static char *shellname = "/bin/sh";
-static char *aoutname  = "a.out" ;
-
-static char *infname;
-static char textfname[15];
-static char asmfname[15];
-static char asmpass2[15];
-static char initfname[15];
-static char sortfname[15];
-static char prepfname[15];
-static char objfdefault[15];
-static char optzfname[15];
-static char setfname[15];
-
-static char fflags[30] = "-";
-static char cflags[20] = "-c";
-static char eflags[30] = "";
-static char rflags[30] = "";
-static char lflag[3]   = "-x";
-static char *fflagp    = fflags+1;
-static char *cflagp    = cflags+2;
-static char *eflagp    = eflags;
-static char *rflagp    = rflags;
-static char **loadargs;
-static char **loadp;
-
-static flag erred      = NO;
-static flag loadflag   = YES;
-static flag saveasmflag        = NO;
-static flag profileflag        = NO;
-static flag optimflag  = NO;
-static flag debugflag  = NO;
-static flag verbose    = NO;
-static flag nofloating = NO;
-static flag fortonly   = NO;
-static flag macroflag  = NO;
-
-\f
-main(argc, argv)
-int argc;
-char **argv;
-{
-int i, c, status;
-char *setdoto(), *lastchar(), *lastfield();
-ptr ckalloc();
-register char *s;
-char fortfile[20], *t;
-char buff[100];
-int intrupt();
-
-sigivalue = (int) signal(SIGINT, 1) & 01;
-sigqvalue = (int) signal(SIGQUIT,1) & 01;
-sighvalue = (int) signal(SIGHUP, 1) & 01;
-sigtvalue = (int) signal(SIGTERM,1) & 01;
-enbint(intrupt);
-
-pid = getpid();
-crfnames();
-
-loadargs = (char **) ckalloc( (argc+20) * sizeof(*loadargs) );
-loadargs[1] = "-X";
-loadargs[2] = "-u";
-#if HERE==PDP11 || HERE==VAX
-       loadargs[3] = "_MAIN__";
-#endif
-#if HERE == INTERDATA
-       loadargs[3] = "main";
-#endif
-loadp = loadargs + 4;
-
---argc;
-++argv;
-
-while(argc>0 && argv[0][0]=='-' && argv[0][1]!='\0')
-       {
-       for(s = argv[0]+1 ; *s ; ++s) switch(*s)
-               {
-               case 'T':  /* use special passes */
-                       switch(*++s)
-                               {
-                               case '1':
-                                       pass1name = s+1; goto endfor;
-                               case '2':
-                                       pass2name = s+1; goto endfor;
-                               case 'a':
-                                       asmname = s+1; goto endfor;
-                               case 'l':
-                                       ldname = s+1; goto endfor;
-                               case 'F':
-                                       footname = s+1; goto endfor;
-                               case 'm':
-                                       macroname = s+1; goto endfor;
-                               default:
-                                       fatal1("bad option -T%c", *s);
-                               }
-                       break;
-
-               case 'w':
-                       if(s[1]=='6' && s[2]=='6')
-                               {
-                               *fflagp++ = *s++;
-                               *fflagp++ = *s++;
-                               }
-
-               copyfflag:
-               case 'u':
-               case 'U':
-               case 'M':
-               case '1':
-               case 'C':
-                       *fflagp++ = *s;
-                       break;
-
-               case 'O':
-                       optimflag = YES;
-#if TARGET == INTERDATA
-                               *loadp++ = "-r";
-                               *loadp++ = "-d";
-#endif
-                       *fflagp++ = 'O';
-                       if( isdigit(s[1]) )
-                               *fflagp++ = *++s;
-                       break;
-
-               case 'm':
-                       if(s[1] == '4')
-                               ++s;
-                       macroflag = YES;
-                       break;
-
-               case 'S':
-                       saveasmflag = YES;
-
-               case 'c':
-                       loadflag = NO;
-                       break;
-
-               case 'v':
-                       verbose = YES;
-                       break;
-
-               case 'd':
-                       debugflag = YES;
-                       goto copyfflag;
-
-               case 'p':
-                       profileflag = YES;
-                       *cflagp++ = 'p';
-                       goto copyfflag;
-
-               case 'o':
-                       if( ! strcmp(s, "onetrip") )
-                               {
-                               *fflagp++ = '1';
-                               goto endfor;
-                               }
-                       aoutname = *++argv;
-                       --argc;
-                       break;
-
-#if TARGET == PDP11
-               case 'f':
-                       nofloating = YES;
-                       pass2name = NOFLPASS2;
-               break;
-#endif
-
-               case 'F':
-                       fortonly = YES;
-                       loadflag = NO;
-                       break;
-
-               case 'I':
-                       if(s[1]=='2' || s[1]=='4' || s[1]=='s')
-                               {
-                               *fflagp++ = *s++;
-                               goto copyfflag;
-                               }
-                       fprintf(diagfile, "invalid flag -I%c\n", s[1]);
-                       done(1);
-
-               case 'l':       /* letter ell--library */
-                       s[-1] = '-';
-                       *loadp++ = s-1;
-                       goto endfor;
-
-               case 'E':       /* EFL flag argument */
-                       while( *eflagp++ = *++s)
-                               ;
-                       *eflagp++ = ' ';
-                       goto endfor;
-               case 'R':
-                       while( *rflagp++ = *++s )
-                               ;
-                       *rflagp++ = ' ';
-                       goto endfor;
-               default:
-                       lflag[1] = *s;
-                       *loadp++ = copys(lflag);
-                       break;
-               }
-endfor:
-       --argc;
-       ++argv;
-       }
-
-loadargs[0] = ldname;
-#if TARGET == PDP11
-       if(nofloating)
-               *loadp++ = (profileflag ? NOFLPROF : NOFLFOOT);
-       else
-#endif
-*loadp++ = (profileflag ? proffoot : footname);
-
-for(i = 0 ; i<argc ; ++i)
-       switch(c =  dotchar(infname = argv[i]) )
-               {
-               case 'r':       /* Ratfor file */
-               case 'e':       /* EFL file */
-                       if( unreadable(argv[i]) )
-                               {
-                               erred = YES;
-                               break;
-                               }
-                       s = fortfile;
-                       t = lastfield(argv[i]);
-                       while( *s++ = *t++)
-                               ;
-                       s[-2] = 'f';
-
-                       if(macroflag)
-                               {
-                               if(sys(sprintf(buff, "%s %s >%s", macroname, infname, prepfname) ))
-                                       {
-                                       rmf(prepfname);
-                                       erred = YES;
-                                       break;
-                                       }
-                               infname = prepfname;
-                               }
-
-                       if(c == 'e')
-                               sprintf(buff, "efl %s %s >%s", eflags, infname, fortfile);
-                       else
-                               sprintf(buff, "ratfor %s %s >%s", rflags, infname, fortfile);
-                       status = sys(buff);
-                       if(macroflag)
-                               rmf(infname);
-                       if(status)
-                               {
-                               erred = YES;
-                               rmf(fortfile);
-                               break;
-                               }
-
-                       if( ! fortonly )
-                               {
-                               infname = argv[i] = lastfield(argv[i]);
-                               *lastchar(infname) = 'f';
-       
-                               if( dofort(argv[i]) )
-                                       erred = YES;
-                               else    {
-                                       if( nodup(t = setdoto(argv[i])) )
-                                               *loadp++ = t;
-                                       rmf(fortfile);
-                                       }
-                               }
-                       break;
-
-               case 'f':       /* Fortran file */
-               case 'F':
-                       if( unreadable(argv[i]) )
-                               erred = YES;
-                       else if( dofort(argv[i]) )
-                               erred = YES;
-                       else if( nodup(t=setdoto(argv[i])) )
-                               *loadp++ = t;
-                       break;
-
-               case 'c':       /* C file */
-               case 's':       /* Assembler file */
-                       if( unreadable(argv[i]) )
-                               {
-                               erred = YES;
-                               break;
-                               }
-#if HERE==PDP11 || HERE==VAX
-                       fprintf(diagfile, "%s:\n", argv[i]);
-#endif
-                       sprintf(buff, "cc -c %s", argv[i] );
-                       if( sys(buff) )
-                               erred = YES;
-                       else
-                               if( nodup(t = setdoto(argv[i])) )
-                                       *loadp++ = t;
-                       break;
-
-               case 'o':
-                       if( nodup(argv[i]) )
-                               *loadp++ = argv[i];
-                       break;
-
-               default:
-                       if( ! strcmp(argv[i], "-o") )
-                               aoutname = argv[++i];
-                       else
-                               *loadp++ = argv[i];
-                       break;
-               }
-
-if(loadflag && !erred)
-       doload(loadargs, loadp);
-done(erred);
-}
-\f
-dofort(s)
-char *s;
-{
-int retcode;
-char buff[200];
-
-infname = s;
-sprintf(buff, "%s %s %s %s %s %s",
-       pass1name, fflags, s, asmfname, initfname, textfname);
-switch( sys(buff) )
-       {
-       case 1:
-               goto error;
-       case 0:
-               break;
-       default:
-               goto comperror;
-       }
-
-if(content(initfname) > 0)
-       if( dodata() )
-               goto error;
-if( dopass2() )
-       goto comperror;
-doasm(s);
-retcode = 0;
-
-ret:
-       rmf(asmfname);
-       rmf(initfname);
-       rmf(textfname);
-       return(retcode);
-
-error:
-       fprintf(diagfile, "\nError.  No assembly.\n");
-       retcode = 1;
-       goto ret;
-
-comperror:
-       fprintf(diagfile, "\ncompiler error.\n");
-       retcode = 2;
-       goto ret;
-}
-
-
-
-
-dopass2()
-{
-char buff[100];
-
-if(verbose)
-       fprintf(diagfile, "PASS2.");
-
-#if FAMILY==DMR
-       sprintf(buff, "%s %s - %s", pass2name, textfname, asmpass2);
-       return( sys(buff) );
-#endif
-
-#if FAMILY == SCJ
-#      if TARGET==INTERDATA
-       sprintf(buff, "%s -A%s <%s >%s", pass2name, setfname, textfname, asmpass2);
-#      else
-       sprintf(buff, "%s <%s >%s", pass2name, textfname, asmpass2);
-#      endif
-       return( sys(buff) );
-#endif
-}
-
-
-
-
-doasm(s)
-char *s;
-{
-register char *lastc;
-char *obj;
-char buff[200];
-
-if(*s == '\0')
-       s = objfdefault;
-lastc = lastchar(s);
-obj = setdoto(s);
-
-#if TARGET==PDP11 || TARGET==VAX
-#ifdef PASS2OPT
-if(optimflag)
-       {
-       if( sys(sprintf(buff, "%s %s %s", PASS2OPT, asmpass2, optzfname)) )
-               rmf(optzfname);
-       else
-               sys(sprintf(buff,"mv %s %s", optzfname, asmpass2));
-       }
-#endif
-#endif
-
-if(saveasmflag)
-       {
-       *lastc = 's';
-#if TARGET == INTERDATA
-       sys( sprintf(buff, "cat %s %s %s >%s",
-               asmfname, setfname, asmpass2, obj) );
-#else
-       sys( sprintf(buff, "cat %s %s >%s",
-                       asmfname, asmpass2, obj) );
-#endif
-       *lastc = 'o';
-       }
-else
-       {
-       if(verbose)
-               fprintf(diagfile, "  ASM.");
-#if TARGET == INTERDATA
-       sprintf(buff, "%s -o %s %s %s %s", asmname, obj, asmfname, setfname, asmpass2);
-#endif
-
-#if TARGET == VAX
-       /* vax assembler currently accepts only one input file */
-       sys(sprintf(buff, "cat %s >>%s", asmpass2, asmfname));
-       sprintf(buff, "%s -o %s %s", asmname, obj, asmfname);
-#endif
-
-#if TARGET == PDP11
-       sprintf(buff, "%s -u -o %s %s %s", asmname, obj, asmfname, asmpass2);
-#endif
-
-#if TARGET!=INTERDATA && TARGET!=PDP11 && TARGET!=VAX
-       sprintf(buff, "%s -o %s %s %s", asmname, obj, asmfname, asmpass2);
-#endif
-
-       if( sys(buff) )
-               fatal("assembler error");
-       if(verbose)
-               fprintf(diagfile, "\n");
-#if HERE==PDP11 && TARGET!=PDP11
-       rmf(obj);
-#endif
-       }
-
-rmf(asmpass2);
-}
-
-
-
-doload(v0, v)
-register char *v0[], *v[];
-{
-char **p;
-int waitpid;
-
-for(p = liblist ; *p ; *v++ = *p++)
-       ;
-
-*v++ = "-o";
-*v++ = aoutname;
-*v = NULL;
-
-if(verbose)
-       fprintf(diagfile, "LOAD.");
-if(debugflag)
-       {
-       for(p = v0 ; p<v ; ++p)
-               fprintf(diagfile, "%s ", *p);
-       fprintf(diagfile, "\n");
-       }
-
-#if HERE==PDP11 || HERE==INTERDATA || HERE==VAX
-       if( (waitpid = fork()) == 0)
-               {
-               enbint(SIG_DFL);
-               execv(ldname, v0);
-               fatal1("couldn't load %s", ldname);
-               }
-       await(waitpid);
-#endif
-
-#if HERE==INTERDATA
-       if(optimflag)
-               {
-               char buff[100];
-               if( sys(sprintf(buff, "nopt %s -o junk.%d", aoutname, pid))
-                || sys(sprintf(buff, "mv junk.%d %s", pid, aoutname)) )
-                       err("bad optimization");
-               }
-#endif
-
-if(verbose)
-       fprintf(diagfile, "\n");
-}
-\f
-/* Process control and Shell-simulating routines */
-
-sys(str)
-char *str;
-{
-register char *s, *t;
-char *argv[100], path[100];
-char *inname, *outname;
-int append;
-int waitpid;
-int argc;
-
-
-if(debugflag)
-       fprintf(diagfile, "%s\n", str);
-inname  = NULL;
-outname = NULL;
-argv[0] = shellname;
-argc = 1;
-
-t = str;
-while( isspace(*t) )
-       ++t;
-while(*t)
-       {
-       if(*t == '<')
-               inname = t+1;
-       else if(*t == '>')
-               {
-               if(t[1] == '>')
-                       {
-                       append = YES;
-                       outname = t+2;
-                       }
-               else    {
-                       append = NO;
-                       outname = t+1;
-                       }
-               }
-       else
-               argv[argc++] = t;
-       while( !isspace(*t) && *t!='\0' )
-               ++t;
-       if(*t)
-               {
-               *t++ = '\0';
-               while( isspace(*t) )
-                       ++t;
-               }
-       }
-
-if(argc == 1)   /* no command */
-       return(-1);
-argv[argc] = 0;
-
-s = path;
-t = "/usr/bin/";
-while(*t)
-       *s++ = *t++;
-for(t = argv[1] ; *s++ = *t++ ; )
-       ;
-if((waitpid = fork()) == 0)
-       {
-       if(inname)
-               freopen(inname, "r", stdin);
-       if(outname)
-               freopen(outname, (append ? "a" : "w"), stdout);
-       enbint(SIG_DFL);
-
-       texec(path+9, argv);  /* command */
-       texec(path+4, argv);  /*  /bin/command */
-       texec(path  , argv);  /* /usr/bin/command */
-
-       fatal1("Cannot load %s",path+9);
-       }
-
-return( await(waitpid) );
-}
-
-
-
-
-
-#include "errno.h"
-
-/* modified version from the Shell */
-texec(f, av)
-char *f;
-char **av;
-{
-extern int errno;
-
-execv(f, av+1);
-
-if (errno==ENOEXEC)
-       {
-       av[1] = f;
-       execv(shellname, av);
-       fatal("No shell!");
-       }
-if (errno==ENOMEM)
-       fatal1("%s: too large", f);
-}
-
-
-
-
-
-
-done(k)
-int k;
-{
-static int recurs      = NO;
-
-if(recurs == NO)
-       {
-       recurs = YES;
-       rmfiles();
-       }
-exit(k);
-}
-
-
-
-
-
-
-enbint(k)
-int (*k)();
-{
-if(sigivalue == 0)
-       signal(SIGINT,k);
-if(sigqvalue == 0)
-       signal(SIGQUIT,k);
-if(sighvalue == 0)
-       signal(SIGHUP,k);
-if(sigtvalue == 0)
-       signal(SIGTERM,k);
-}
-
-
-
-
-intrupt()
-{
-done(2);
-}
-
-
-
-await(waitpid)
-int waitpid;
-{
-int w, status;
-
-enbint(SIG_IGN);
-while ( (w = wait(&status)) != waitpid)
-       if(w == -1)
-               fatal("bad wait code");
-enbint(intrupt);
-if(status & 0377)
-       {
-       if(status != SIGINT)
-               fprintf(diagfile, "Termination code %d", status);
-       done(3);
-       }
-return(status>>8);
-}
-\f
-/* File Name and File Manipulation Routines */
-
-unreadable(s)
-register char *s;
-{
-register FILE *fp;
-
-if(fp = fopen(s, "r"))
-       {
-       fclose(fp);
-       return(NO);
-       }
-
-else
-       {
-       fprintf(diagfile, "Error: Cannot read file %s\n", s);
-       return(YES);
-       }
-}
-
-
-
-clf(p)
-FILEP *p;
-{
-if(p!=NULL && *p!=NULL && *p!=stdout)
-       {
-       if(ferror(*p))
-               fatal("writing error");
-       fclose(*p);
-       }
-*p = NULL;
-}
-
-rmfiles()
-{
-rmf(textfname);
-rmf(asmfname);
-rmf(initfname);
-rmf(asmpass2);
-#if TARGET == INTERDATA
-       rmf(setfname);
-#endif
-}
-
-
-
-
-
-
-
-
-/* return -1 if file does not exist, 0 if it is of zero length
-   and 1 if of positive length
-*/
-content(filename)
-char *filename;
-{
-#ifdef VERSION6
-       struct stat
-               {
-               char cjunk[9];
-               char size0;
-               int size1;
-               int ijunk[12];
-               } buf;
-#else
-#      include <sys/types.h>
-#      include <sys/stat.h>
-       struct stat buf;
-#endif
-
-if(stat(filename,&buf) < 0) 
-       return(-1);
-#ifdef VERSION6
-       return(buf.size0 || buf.size1);
-#else
-       return( buf.st_size > 0 );
-#endif
-}
-
-
-
-
-crfnames()
-{
-fname(textfname, "x");
-fname(asmfname, "s");
-fname(asmpass2, "a");
-fname(initfname, "d");
-fname(sortfname, "S");
-fname(objfdefault, "o");
-fname(prepfname, "p");
-fname(optzfname, "z");
-fname(setfname, "A");
-}
-
-
-
-
-rmf(fn)
-register char *fn;
-{
-if(!debugflag && fn!=NULL && *fn!='\0')
-       unlink(fn);
-}
-
-
-
-
-
-LOCAL fname(name, suff)
-char *name, *suff;
-{
-sprintf(name, "fort%d.%s", pid, suff);
-}
-
-
-
-
-dotchar(s)
-register char *s;
-{
-for( ; *s ; ++s)
-       if(s[0]=='.' && s[1]!='\0' && s[2]=='\0')
-               return( s[1] );
-return(NO);
-}
-
-
-
-char *lastfield(s)
-register char *s;
-{
-register char *t;
-for(t = s; *s ; ++s)
-       if(*s == '/')
-               t = s+1;
-return(t);
-}
-
-
-
-char *lastchar(s)
-register char *s;
-{
-while(*s)
-       ++s;
-return(s-1);
-}
-
-char *setdoto(s)
-register char *s;
-{
-*lastchar(s) = 'o';
-return( lastfield(s) );
-}
-
-
-
-badfile(s)
-char *s;
-{
-fatal1("cannot open intermediate file %s", s);
-}
-
-
-
-ptr ckalloc(n)
-int n;
-{
-ptr p, calloc();
-
-if( p = calloc(1, (unsigned) n) )
-       return(p);
-
-fatal("out of memory");
-/* NOTREACHED */
-}
-
-
-
-
-
-copyn(n, s)
-register int n;
-register char *s;
-{
-register char *p, *q;
-
-p = q = (char *) ckalloc(n);
-while(n-- > 0)
-       *q++ = *s++;
-return(p);
-}
-
-
-
-copys(s)
-char *s;
-{
-return( copyn( strlen(s)+1 , s) );
-}
-
-
-
-
-
-nodup(s)
-char *s;
-{
-register char **p;
-
-for(p = loadargs ; p < loadp ; ++p)
-       if( !strcmp(*p, s) )
-               return(NO);
-
-return(YES);
-}
-
-
-
-static fatal(t)
-char *t;
-{
-fprintf(diagfile, "Compiler error in file %s: %s\n", infname, t);
-if(debugflag)
-       abort();
-done(1);
-exit(1);
-}
-
-
-
-
-static fatal1(t,d)
-char *t, *d;
-{
-char buff[100];
-fatal( sprintf(buff, t, d) );
-}
-
-
-
-
-err(s)
-char *s;
-{
-fprintf(diagfile, "Error in file %s: %s\n", infname, s);
-}
-\f
-LOCAL int nch  = 0;
-LOCAL FILEP asmfile;
-LOCAL FILEP sortfile;
-
-#include "ftypes"
-
-static ftnint typesize[NTYPES]
-       = { 1, SZADDR, SZSHORT, SZLONG, SZLONG, 2*SZLONG,
-           2*SZLONG, 4*SZLONG, SZLONG, 1, 1, 1};
-static int typealign[NTYPES]
-       = { 1, ALIADDR, ALISHORT, ALILONG, ALILONG, ALIDOUBLE,
-           ALILONG, ALIDOUBLE, ALILONG, 1, 1, 1};
-
-dodata()
-{
-char buff[50];
-char varname[XL+1], ovarname[XL+1];
-int status;
-flag erred;
-ftnint offset, vlen, type;
-register ftnint ooffset, ovlen;
-ftnint vchar;
-int size, align;
-int vargroup;
-ftnint totlen, doeven();
-
-erred = NO;
-ovarname[0] = '\0';
-ooffset = 0;
-ovlen = 0;
-totlen = 0;
-nch = 0;
-
-if(status = sys( sprintf(buff, "sort %s >%s", initfname, sortfname) ) )
-       fatal1("call sort status = %d", status);
-if( (sortfile = fopen(sortfname, "r")) == NULL)
-       badfile(sortfname);
-if( (asmfile = fopen(asmfname, "a")) == NULL)
-       badfile(asmfname);
-pruse(asmfile, USEINIT);
-
-while( rdname(&vargroup, varname) && rdlong(&offset) && rdlong(&vlen) && rdlong(&type) )
-       {
-       size = typesize[type];
-       if( strcmp(varname, ovarname) )
-               {
-               prspace(ovlen-ooffset);
-               strcpy(ovarname, varname);
-               ooffset = 0;
-               totlen += ovlen;
-               ovlen = vlen;
-               if(vargroup == 0)
-                       align = (type==TYCHAR ? SZLONG : typealign[type]);
-               else    align = ALIDOUBLE;
-               totlen = doeven(totlen, align);
-               if(vargroup == 2)
-                       prcomblock(asmfile, varname);
-               else
-                       fprintf(asmfile, LABELFMT, varname);
-               }
-       if(offset < ooffset)
-               {
-               erred = YES;
-               err("overlapping initializations");
-               }
-       if(offset > ooffset)
-               {
-               prspace(offset-ooffset);
-               ooffset = offset;
-               }
-       if(type == TYCHAR)
-               {
-               if( ! rdlong(&vchar) )
-                       fatal("bad intermediate file format");
-               prch( (int) vchar );
-               }
-       else
-               {
-               putc('\t', asmfile);
-               while   ( putc( getc(sortfile), asmfile)  != '\n')
-                       ;
-               }
-       if( (ooffset += size) > ovlen)
-               {
-               erred = YES;
-               err("initialization out of bounds");
-               }
-       }
-
-prspace(ovlen-ooffset);
-totlen = doeven(totlen+ovlen, (ALIDOUBLE>SZLONG ? ALIDOUBLE : SZLONG) );
-clf(&sortfile);
-clf(&asmfile);
-clf(&sortfile);
-rmf(sortfname);
-return(erred);
-}
-
-
-
-
-prspace(n)
-register ftnint n;
-{
-register ftnint m;
-
-while(nch>0 && n>0)
-       {
-       --n;
-       prch(0);
-       }
-m = SZSHORT * (n/SZSHORT);
-if(m > 0)
-       prskip(asmfile, m);
-for(n -= m ; n>0 ; --n)
-       prch(0);
-}
-
-
-
-
-ftnint doeven(tot, align)
-register ftnint tot;
-int align;
-{
-ftnint new;
-new = roundup(tot, align);
-prspace(new - tot);
-return(new);
-}
-
-
-
-rdname(vargroupp, name)
-int *vargroupp;
-register char *name;
-{
-register int i, c;
-
-if( (c = getc(sortfile)) == EOF)
-       return(NO);
-*vargroupp = c - '0';
-
-for(i = 0 ; i<XL ; ++i)
-       {
-       if( (c = getc(sortfile)) == EOF)
-               return(NO);
-       if(c != ' ')
-               *name++ = c;
-       }
-*name = '\0';
-return(YES);
-}
-
-
-
-rdlong(n)
-register ftnint *n;
-{
-register int c;
-
-for(c = getc(sortfile) ; c!=EOF && isspace(c) ; c = getc(sortfile) );
-       ;
-if(c == EOF)
-       return(NO);
-
-for(*n = 0 ; isdigit(c) ; c = getc(sortfile) )
-       *n = 10* (*n) + c - '0';
-return(YES);
-}
-
-
-
-
-prch(c)
-register int c;
-{
-static int buff[SZSHORT];
-
-buff[nch++] = c;
-if(nch == SZSHORT)
-       {
-       prchars(asmfile, buff);
-       nch = 0;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/equiv.c b/.ref-Research-V7/usr/src/cmd/f77/equiv.c
deleted file mode 100644 (file)
index 7b6db7f..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-#include "defs"
-
-/* ROUTINES RELATED TO EQUIVALENCE CLASS PROCESSING */
-
-/* called at end of declarations section to process chains
-   created by EQUIVALENCE statements
- */
-doequiv()
-{
-register int i;
-int inequiv, comno, ovarno;
-ftnint comoffset, offset, leng, iarrlen(), lmin(), lmax();
-register struct equivblock *p;
-register struct eqvchain *q;
-struct primblock *itemp;
-register struct nameblock *np;
-expptr offp, suboffset();
-int ns, nsubs();
-chainp cp;
-
-for(i = 0 ; i < nequiv ; ++i)
-       {
-       p = &eqvclass[i];
-       p->eqvbottom = p->eqvtop = 0;
-       comno = -1;
-
-       for(q = p->equivs ; q ; q = q->nextp)
-               {
-               itemp = q->eqvitem;
-               vardcl(np = itemp->namep);
-               if(itemp->argsp || itemp->fcharp)
-                       {
-                       if(np->vdim!=NULL && np->vdim->ndim>1 &&
-                          nsubs(itemp->argsp)==1 )
-                               {
-                               if(! ftn66flag)
-                                       warn("1-dim subscript in EQUIVALENCE");
-                               cp = NULL;
-                               ns = np->vdim->ndim;
-                               while(--ns > 0)
-                                       cp = mkchain( ICON(1), cp);
-                               itemp->argsp->listp->nextp = cp;
-                               }
-                       offp = suboffset(itemp);
-                       }
-               else    offp = ICON(0);
-               if(ISICON(offp))
-                       offset = q->eqvoffset = offp->const.ci;
-               else    {
-                       dclerr("nonconstant subscript in equivalence ", np);
-                       np = NULL;
-                       goto endit;
-                       }
-               if( (leng = iarrlen(np)) < 0)
-                       {
-                       dclerr("adjustable in equivalence", np);
-                       np = NULL;
-                       goto endit;
-                       }
-               p->eqvbottom = lmin(p->eqvbottom, -offset);
-               p->eqvtop = lmax(p->eqvtop, leng-offset);
-
-               switch(np->vstg)
-                       {
-                       case STGUNKNOWN:
-                       case STGBSS:
-                       case STGEQUIV:
-                               break;
-
-                       case STGCOMMON:
-                               comno = np->vardesc.varno;
-                               comoffset = np->voffset + offset;
-                               break;
-
-                       default:
-                               dclerr("bad storage class in equivalence", np);
-                               np = NULL;
-                               goto endit;
-                       }
-       endit:
-               frexpr(offp);
-               q->eqvitem = np;
-               }
-
-       if(comno >= 0)
-               eqvcommon(p, comno, comoffset);
-       else  for(q = p->equivs ; q ; q = q->nextp)
-               {
-               if(np = q->eqvitem)
-                       {
-                       inequiv = NO;
-                       if(np->vstg==STGEQUIV)
-                               if( (ovarno = np->vardesc.varno) == i)
-                                       {
-                                       if(np->voffset + q->eqvoffset != 0)
-                                               dclerr("inconsistent equivalence", np);
-                                       }
-                               else    {
-                                       offset = np->voffset;
-                                       inequiv = YES;
-                                       }
-
-                       np->vstg = STGEQUIV;
-                       np->vardesc.varno = i;
-                       np->voffset = - q->eqvoffset;
-
-                       if(inequiv)
-                               eqveqv(i, ovarno, q->eqvoffset + offset);
-                       }
-               }
-       }
-
-for(i = 0 ; i < nequiv ; ++i)
-       {
-       p = & eqvclass[i];
-       if(p->eqvbottom!=0 || p->eqvtop!=0)
-               {
-               for(q = p->equivs ; q; q = q->nextp)
-                       {
-                       np = q->eqvitem;
-                       np->voffset -= p->eqvbottom;
-                       if(np->voffset % typealign[np->vtype] != 0)
-                               dclerr("bad alignment forced by equivalence", np);
-                       }
-               p->eqvtop -= p->eqvbottom;
-               p->eqvbottom = 0;
-               }
-       freqchain(p);
-       }
-}
-
-
-
-
-
-/* put equivalence chain p at common block comno + comoffset */
-
-LOCAL eqvcommon(p, comno, comoffset)
-struct equivblock *p;
-int comno;
-ftnint comoffset;
-{
-int ovarno;
-ftnint k, offq;
-register struct nameblock *np;
-register struct eqvchain *q;
-
-if(comoffset + p->eqvbottom < 0)
-       {
-       err1("attempt to extend common %s backward",
-               nounder(XL, extsymtab[comno].extname) );
-       freqchain(p);
-       return;
-       }
-
-if( (k = comoffset + p->eqvtop) > extsymtab[comno].extleng)
-       extsymtab[comno].extleng = k;
-
-for(q = p->equivs ; q ; q = q->nextp)
-       if(np = q->eqvitem)
-               {
-               switch(np->vstg)
-                       {
-                       case STGUNKNOWN:
-                       case STGBSS:
-                               np->vstg = STGCOMMON;
-                               np->vardesc.varno = comno;
-                               np->voffset = comoffset - q->eqvoffset;
-                               break;
-
-                       case STGEQUIV:
-                               ovarno = np->vardesc.varno;
-                               offq = comoffset - q->eqvoffset - np->voffset;
-                               np->vstg = STGCOMMON;
-                               np->vardesc.varno = comno;
-                               np->voffset = comoffset - q->eqvoffset;
-                               if(ovarno != (p - eqvclass))
-                                       eqvcommon(&eqvclass[ovarno], comno, offq);
-                               break;
-
-                       case STGCOMMON:
-                               if(comno != np->vardesc.varno ||
-                                  comoffset != np->voffset+q->eqvoffset)
-                                       dclerr("inconsistent common usage", np);
-                               break;
-
-
-                       default:
-                               fatal1("eqvcommon: impossible vstg %d", np->vstg);
-                       }
-               }
-
-freqchain(p);
-p->eqvbottom = p->eqvtop = 0;
-}
-
-
-/* put all items on ovarno chain on front of nvarno chain
- * adjust offsets of ovarno elements and top and bottom of nvarno chain
- */
-
-LOCAL eqveqv(nvarno, ovarno, delta)
-int ovarno, nvarno;
-ftnint delta;
-{
-register struct equivblock *p0, *p;
-register struct nameblock *np;
-struct eqvchain *q, *q1;
-
-p0 = eqvclass + nvarno;
-p = eqvclass + ovarno;
-p0->eqvbottom = lmin(p0->eqvbottom, p->eqvbottom - delta);
-p0->eqvtop = lmax(p0->eqvtop, p->eqvtop - delta);
-p->eqvbottom = p->eqvtop = 0;
-
-for(q = p->equivs ; q ; q = q1)
-       {
-       q1 = q->nextp;
-       if( (np = q->eqvitem) && np->vardesc.varno==ovarno)
-               {
-               q->nextp = p0->equivs;
-               p0->equivs = q;
-               q->eqvoffset -= delta;
-               np->vardesc.varno = nvarno;
-               np->voffset -= delta;
-               }
-       else    free(q);
-       }
-p->equivs = NULL;
-}
-
-
-
-
-LOCAL freqchain(p)
-register struct equivblock *p;
-{
-register struct eqvchain *q, *oq;
-
-for(q = p->equivs ; q ; q = oq)
-       {
-       oq = q->nextp;
-       free(q);
-       }
-p->equivs = NULL;
-}
-
-
-
-
-
-LOCAL nsubs(p)
-register struct listblock *p;
-{
-register int n;
-register chainp q;
-
-n = 0;
-if(p)
-       for(q = p->listp ; q ; q = q->nextp)
-               ++n;
-
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/error.c b/.ref-Research-V7/usr/src/cmd/f77/error.c
deleted file mode 100644 (file)
index 7cfa33b..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "defs"
-
-
-warn1(s,t)
-char *s, *t;
-{
-char buff[100];
-warn( sprintf(buff, s, t) );
-}
-
-
-warn(s)
-char *s;
-{
-if(nowarnflag)
-       return;
-fprintf(diagfile, "Warning on line %d of %s: %s\n", lineno, infname, s);
-++nwarn;
-}
-
-
-
-err2(s,t,u)
-char *s, *t, *u;
-{
-char buff[100];
-err( sprintf(buff, s, t, u) );
-}
-
-
-err1(s,t)
-char *s, *t;
-{
-char buff[100];
-err( sprintf(buff, s, t) );
-}
-
-
-err(s)
-char *s;
-{
-fprintf(diagfile, "Error on line %d of %s: %s\n", lineno, infname, s);
-++nerr;
-}
-
-
-yyerror(s)
-char *s;
-{ err(s); }
-
-
-
-dclerr(s, v)
-char *s;
-struct nameblock *v;
-{
-char buff[100];
-
-if(v)
-       err( sprintf(buff, "Declaration error for %s: %s", varstr(VL, v->varname), s) );
-else
-       err1("Declaration error %s", s);
-}
-
-
-
-execerr(s, n)
-char *s, *n;
-{
-char buf1[100], buf2[100];
-
-sprintf(buf1, "Execution error %s", s);
-err( sprintf(buf2, buf1, n) );
-}
-
-
-fatal(t)
-char *t;
-{
-fprintf(diagfile, "Compiler error line %d of %s: %s\n", lineno, infname, t);
-if(debugflag)
-       abort();
-done(3);
-exit(3);
-}
-
-
-
-
-fatal1(t,d)
-char *t, *d;
-{
-char buff[100];
-fatal( sprintf(buff, t, d) );
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/exec.c b/.ref-Research-V7/usr/src/cmd/f77/exec.c
deleted file mode 100644 (file)
index 1351ad6..0000000
+++ /dev/null
@@ -1,556 +0,0 @@
-#include "defs"
-
-/*   Logical IF codes
-*/
-
-
-exif(p)
-expptr p;
-{
-pushctl(CTLIF);
-ctlstack->elselabel = newlabel();
-putif(p, ctlstack->elselabel);
-}
-
-
-
-exelif(p)
-expptr p;
-{
-if(ctlstack->ctltype == CTLIF)
-       {
-       if(ctlstack->endlabel == 0)
-               ctlstack->endlabel = newlabel();
-       putgoto(ctlstack->endlabel);
-       putlabel(ctlstack->elselabel);
-       ctlstack->elselabel = newlabel();
-       putif(p, ctlstack->elselabel);
-       }
-
-else   execerr("elseif out of place", 0);
-}
-
-
-
-
-
-exelse()
-{
-if(ctlstack->ctltype==CTLIF)
-       {
-       if(ctlstack->endlabel == 0)
-               ctlstack->endlabel = newlabel();
-       putgoto( ctlstack->endlabel );
-       putlabel(ctlstack->elselabel);
-       ctlstack->ctltype = CTLELSE;
-       }
-
-else   execerr("else out of place", 0);
-}
-
-
-exendif()
-{
-if(ctlstack->ctltype == CTLIF)
-       {
-       putlabel(ctlstack->elselabel);
-       if(ctlstack->endlabel)
-               putlabel(ctlstack->endlabel);
-       popctl();
-       }
-else if(ctlstack->ctltype == CTLELSE)
-       {
-       putlabel(ctlstack->endlabel);
-       popctl();
-       }
-
-else
-       execerr("endif out of place", 0);
-}
-
-
-
-LOCAL pushctl(code)
-int code;
-{
-register int i;
-
-if(++ctlstack >= lastctl)
-       fatal("nesting too deep");
-ctlstack->ctltype = code;
-for(i = 0 ; i < 4 ; ++i)
-       ctlstack->ctlabels[i] = 0;
-++blklevel;
-}
-
-
-LOCAL popctl()
-{
-if( ctlstack-- < ctls )
-       fatal("control stack empty");
---blklevel;
-}
-
-
-
-LOCAL poplab()
-{
-register struct labelblock  *lp;
-
-for(lp = labeltab ; lp < highlabtab ; ++lp)
-       if(lp->labdefined)
-               {
-               /* mark all labels in inner blocks unreachable */
-               if(lp->blklevel > blklevel)
-                       lp->labinacc = YES;
-               }
-       else if(lp->blklevel > blklevel)
-               {
-               /* move all labels referred to in inner blocks out a level */
-               lp->blklevel = blklevel;
-               }
-}
-\f
-
-
-/*  BRANCHING CODE
-*/
-
-exgoto(lab)
-struct labelblock *lab;
-{
-putgoto(lab->labelno);
-}
-
-
-
-
-
-
-
-exequals(lp, rp)
-register struct primblock *lp;
-register expptr rp;
-{
-if(lp->tag != TPRIM)
-       {
-       err("assignment to a non-variable");
-       frexpr(lp);
-       frexpr(rp);
-       }
-else if(lp->namep->vclass!=CLVAR && lp->argsp)
-       {
-       if(parstate >= INEXEC)
-               err("statement function amid executables");
-       else
-               mkstfunct(lp, rp);
-       }
-else
-       {
-       if(parstate < INDATA)
-               enddcl();
-       puteq(mklhs(lp), rp);
-       }
-}
-
-
-
-mkstfunct(lp, rp)
-struct primblock *lp;
-expptr rp;
-{
-register struct primblock *p;
-register struct nameblock *np;
-chainp args;
-
-np = lp->namep;
-if(np->vclass == CLUNKNOWN)
-       np->vclass = CLPROC;
-else
-       {
-       dclerr("redeclaration of statement function", np);
-       return;
-       }
-np->vprocclass = PSTFUNCT;
-np->vstg = STGSTFUNCT;
-impldcl(np);
-args = (lp->argsp ? lp->argsp->listp : NULL);
-np->vardesc.vstfdesc = mkchain(args , rp );
-
-for( ; args ; args = args->nextp)
-       if( (p = args->datap)->tag!=TPRIM ||
-               p->argsp || p->fcharp || p->lcharp)
-               err("non-variable argument in statement function definition");
-       else
-               {
-               vardcl(args->datap = p->namep);
-               free(p);
-               }
-}
-
-
-
-excall(name, args, nstars, labels)
-struct hashentry *name;
-struct listblock *args;
-int nstars;
-struct labelblock *labels[ ];
-{
-register expptr p;
-
-settype(name, TYSUBR, NULL);
-p = mkfunct( mkprim(name, args, NULL, NULL) );
-p->vtype = p->leftp->vtype = TYINT;
-if(nstars > 0)
-       putcmgo(p, nstars, labels);
-else putexpr(p);
-}
-
-
-
-exstop(stop, p)
-int stop;
-register expptr p;
-{
-char *q;
-int n;
-struct constblock *mkstrcon();
-
-if(p)
-       {
-       if( ! ISCONST(p) )
-               {
-               execerr("pause/stop argument must be constant", 0);
-               frexpr(p);
-               p = mkstrcon(0, 0);
-               }
-       else if( ISINT(p->vtype) )
-               {
-               q = convic(p->const.ci);
-               n = strlen(q);
-               if(n > 0)
-                       {
-                       p->const.ccp = copyn(n, q);
-                       p->vtype = TYCHAR;
-                       p->vleng = ICON(n);
-                       }
-               else
-                       p = mkstrcon(0, 0);
-               }
-       else if(p->vtype != TYCHAR)
-               {
-               execerr("pause/stop argument must be integer or string", 0);
-               p = mkstrcon(0, 0);
-               }
-       }
-else   p = mkstrcon(0, 0);
-
-putexpr( call1(TYSUBR, (stop ? "s_stop" : "s_paus"), p) );
-}
-\f
-/* DO LOOP CODE */
-
-#define DOINIT par[0]
-#define DOLIMIT        par[1]
-#define DOINCR par[2]
-
-#define VARSTEP        0
-#define POSSTEP        1
-#define NEGSTEP        2
-
-
-exdo(range, spec)
-int range;
-chainp spec;
-{
-register expptr p, q;
-expptr *q1;
-register struct nameblock *np;
-chainp cp;
-register int i;
-int dotype, incsign;
-struct addrblock *dovarp, *dostgp;
-expptr par[3];
-
-pushctl(CTLDO);
-dorange = ctlstack->dolabel = range;
-np = spec->datap;
-ctlstack->donamep = NULL;
-if(np->vdovar)
-       {
-       err1("nested loops with variable %s", varstr(VL,np->varname));
-       ctlstack->donamep = NULL;
-       return;
-       }
-
-dovarp = mklhs( mkprim(np, 0,0,0) );
-if( ! ONEOF(dovarp->vtype, MSKINT|MSKREAL) )
-       {
-       err("bad type on do variable");
-       return;
-       }
-ctlstack->donamep = np;
-
-np->vdovar = YES;
-if( enregister(np) )
-       {
-       /* stgp points to a storage version, varp to a register version */
-       dostgp = dovarp;
-       dovarp = mklhs( mkprim(np, 0,0,0) );
-       }
-else
-       dostgp = NULL;
-dotype = dovarp->vtype;
-
-for(i=0 , cp = spec->nextp ; cp!=NULL && i<3 ; cp = cp->nextp)
-       {
-       p = par[i++] = fixtype(cp->datap);
-       if( ! ONEOF(p->vtype, MSKINT|MSKREAL) )
-               {
-               err("bad type on DO parameter");
-               return;
-               }
-       }
-
-frchain(&spec);
-switch(i)
-       {
-       case 0:
-       case 1:
-               err("too few DO parameters");
-               return;
-
-       default:
-               err("too many DO parameters");
-               return;
-
-       case 2:
-               DOINCR = ICON(1);
-
-       case 3:
-               break;
-       }
-
-ctlstack->endlabel = newlabel();
-ctlstack->dobodylabel = newlabel();
-
-if( ISCONST(DOLIMIT) )
-       ctlstack->domax = mkconv(dotype, DOLIMIT);
-else
-       ctlstack->domax = mktemp(dotype, NULL);
-
-if( ISCONST(DOINCR) )
-       {
-       ctlstack->dostep = mkconv(dotype, DOINCR);
-       if( (incsign = conssgn(ctlstack->dostep)) == 0)
-               err("zero DO increment");
-       ctlstack->dostepsign = (incsign > 0 ? POSSTEP : NEGSTEP);
-       }
-else
-       {
-       ctlstack->dostep = mktemp(dotype, NULL);
-       ctlstack->dostepsign = VARSTEP;
-       ctlstack->doposlabel = newlabel();
-       ctlstack->doneglabel = newlabel();
-       }
-
-if( ISCONST(ctlstack->domax) && ISCONST(DOINIT) && ctlstack->dostepsign!=VARSTEP)
-       {
-       puteq(cpexpr(dovarp), cpexpr(DOINIT));
-       if( onetripflag )
-               frexpr(DOINIT);
-       else
-               {
-               q = mkexpr(OPPLUS, ICON(1),
-                       mkexpr(OPMINUS, cpexpr(ctlstack->domax), cpexpr(DOINIT)) );
-               if(incsign != conssgn(q))
-                       {
-                       warn("DO range never executed");
-                       putgoto(ctlstack->endlabel);
-                       }
-               frexpr(q);
-               }
-       }
-else if(ctlstack->dostepsign!=VARSTEP && !onetripflag)
-       {
-       if( ISCONST(ctlstack->domax) )
-               q = cpexpr(ctlstack->domax);
-       else
-               q = mkexpr(OPASSIGN, cpexpr(ctlstack->domax), DOLIMIT);
-
-       q1 = mkexpr(OPASSIGN, cpexpr(dovarp), DOINIT);
-       q = mkexpr( (ctlstack->dostepsign==POSSTEP ? OPLE : OPGE), q1, q);
-       putif(q, ctlstack->endlabel);
-       }
-else
-       {
-       if(! ISCONST(ctlstack->domax) )
-               puteq( cpexpr(ctlstack->domax), DOLIMIT);
-       q = DOINIT;
-       if( ! onetripflag )
-               q = mkexpr(OPMINUS, q,
-                       mkexpr(OPASSIGN, cpexpr(ctlstack->dostep), DOINCR) );
-       puteq( cpexpr(dovarp), q);
-       if(onetripflag && ctlstack->dostepsign==VARSTEP)
-               puteq( cpexpr(ctlstack->dostep), DOINCR);
-       }
-
-if(ctlstack->dostepsign == VARSTEP)
-       {
-       if(onetripflag)
-               putgoto(ctlstack->dobodylabel);
-       else
-               putif( mkexpr(OPGE, cpexpr(ctlstack->dostep), ICON(0)),
-                       ctlstack->doneglabel );
-       putlabel(ctlstack->doposlabel);
-       putif( mkexpr(OPLE,
-               mkexpr(OPPLUSEQ, cpexpr(dovarp), cpexpr(ctlstack->dostep)),
-               cpexpr(ctlstack->domax) ),
-                       ctlstack->endlabel);
-       }
-putlabel(ctlstack->dobodylabel);
-if(dostgp)
-       puteq(dostgp, cpexpr(dovarp));
-frexpr(dovarp);
-}
-
-
-
-enddo(here)
-int here;
-{
-register struct ctlframe *q;
-register expptr t;
-struct nameblock *np;
-struct addrblock *ap;
-register int i;
-
-while(here == dorange)
-       {
-       if(np = ctlstack->donamep)
-               {
-               t = mkexpr(OPPLUSEQ, mklhs(mkprim(ctlstack->donamep, 0,0,0)),
-                       cpexpr(ctlstack->dostep) );
-       
-               if(ctlstack->dostepsign == VARSTEP)
-                       {
-                       putif( mkexpr(OPLE, cpexpr(ctlstack->dostep), ICON(0)), ctlstack->doposlabel);
-                       putlabel(ctlstack->doneglabel);
-                       putif( mkexpr(OPLT, t, ctlstack->domax), ctlstack->dobodylabel);
-                       }
-               else
-                       putif( mkexpr( (ctlstack->dostepsign==POSSTEP ? OPGT : OPLT),
-                               t, ctlstack->domax),
-                               ctlstack->dobodylabel);
-               putlabel(ctlstack->endlabel);
-               if(ap = memversion(np))
-                       puteq(ap, mklhs( mkprim(np,0,0,0)) );
-               for(i = 0 ; i < 4 ; ++i)
-                       ctlstack->ctlabels[i] = 0;
-               deregister(ctlstack->donamep);
-               ctlstack->donamep->vdovar = NO;
-               frexpr(ctlstack->dostep);
-               }
-
-       popctl();
-       poplab();
-       dorange = 0;
-       for(q = ctlstack ; q>=ctls ; --q)
-               if(q->ctltype == CTLDO)
-                       {
-                       dorange = q->dolabel;
-                       break;
-                       }
-       }
-}
-\f
-exassign(vname, labelval)
-struct nameblock *vname;
-struct labelblock *labelval;
-{
-struct addrblock *p;
-struct constblock *mkaddcon();
-
-p = mklhs(mkprim(vname,0,0,0));
-if( ! ONEOF(p->vtype, MSKINT|MSKADDR) )
-       err("noninteger assign variable");
-else
-       puteq(p, mkaddcon(labelval->labelno) );
-}
-
-
-
-exarif(expr, neglab, zerlab, poslab)
-expptr expr;
-struct labelblock *neglab, *zerlab, *poslab;
-{
-register int lm, lz, lp;
-
-lm = neglab->labelno;
-lz = zerlab->labelno;
-lp = poslab->labelno;
-expr = fixtype(expr);
-
-if( ! ONEOF(expr->vtype, MSKINT|MSKREAL) )
-       {
-       err("invalid type of arithmetic if expression");
-       frexpr(expr);
-       }
-else
-       {
-       if(lm == lz)
-               exar2(OPLE, expr, lm, lp);
-       else if(lm == lp)
-               exar2(OPNE, expr, lm, lz);
-       else if(lz == lp)
-               exar2(OPGE, expr, lz, lm);
-       else
-               prarif(expr, lm, lz, lp);
-       }
-}
-
-
-
-LOCAL exar2(op, e, l1, l2)
-int op;
-expptr e;
-int l1, l2;
-{
-putif( mkexpr(op, e, ICON(0)), l2);
-putgoto(l1);
-}
-
-
-exreturn(p)
-register expptr p;
-{
-if(procclass != CLPROC)
-       warn("RETURN statement in main or block data");
-if(p && (proctype!=TYSUBR || procclass!=CLPROC) )
-       {
-       err("alternate return in nonsubroutine");
-       p = 0;
-       }
-
-if(p)
-       {
-       putforce(TYINT, p);
-       putgoto(retlabel);
-       }
-else
-       putgoto(proctype==TYSUBR ? ret0label : retlabel);
-}
-
-
-
-exasgoto(labvar)
-struct hashentry *labvar;
-{
-register struct addrblock *p;
-
-p = mklhs( mkprim(labvar,0,0,0) );
-if( ! ISINT(p->vtype) )
-       err("assigned goto variable must be integer");
-else
-       putbranch(p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/expr.c b/.ref-Research-V7/usr/src/cmd/f77/expr.c
deleted file mode 100644 (file)
index 5989952..0000000
+++ /dev/null
@@ -1,2214 +0,0 @@
-#include "defs"
-
-/* little routines to create constant blocks */
-
-struct constblock *mkconst(t)
-register int t;
-{
-register struct constblock *p;
-
-p = ALLOC(constblock);
-p->tag = TCONST;
-p->vtype = t;
-return(p);
-}
-
-
-struct constblock *mklogcon(l)
-register int l;
-{
-register struct constblock * p;
-
-p = mkconst(TYLOGICAL);
-p->const.ci = l;
-return(p);
-}
-
-
-
-struct constblock *mkintcon(l)
-ftnint l;
-{
-register struct constblock *p;
-
-p = mkconst(TYLONG);
-p->const.ci = l;
-#ifdef MAXSHORT
-       if(l >= -MAXSHORT   &&   l <= MAXSHORT)
-               p->vtype = TYSHORT;
-#endif
-return(p);
-}
-
-
-
-struct constblock *mkaddcon(l)
-register int l;
-{
-register struct constblock *p;
-
-p = mkconst(TYADDR);
-p->const.ci = l;
-return(p);
-}
-
-
-
-struct constblock *mkrealcon(t, d)
-register int t;
-double d;
-{
-register struct constblock *p;
-
-p = mkconst(t);
-p->const.cd[0] = d;
-return(p);
-}
-
-
-struct constblock *mkbitcon(shift, leng, s)
-int shift;
-int leng;
-char *s;
-{
-register struct constblock *p;
-
-p = mkconst(TYUNKNOWN);
-p->const.ci = 0;
-while(--leng >= 0)
-       if(*s != ' ')
-               p->const.ci = (p->const.ci << shift) | hextoi(*s++);
-return(p);
-}
-
-
-
-
-
-struct constblock *mkstrcon(l,v)
-int l;
-register char *v;
-{
-register struct constblock *p;
-register char *s;
-
-p = mkconst(TYCHAR);
-p->vleng = ICON(l);
-p->const.ccp = s = (char *) ckalloc(l);
-while(--l >= 0)
-       *s++ = *v++;
-return(p);
-}
-
-
-struct constblock *mkcxcon(realp,imagp)
-register expptr realp, imagp;
-{
-int rtype, itype;
-register struct constblock *p;
-
-rtype = realp->vtype;
-itype = imagp->vtype;
-
-if( ISCONST(realp) && ISNUMERIC(rtype) && ISCONST(imagp) && ISNUMERIC(itype) )
-       {
-       p = mkconst( (rtype==TYDREAL||itype==TYDREAL) ? TYDCOMPLEX : TYCOMPLEX );
-       if( ISINT(rtype) )
-               p->const.cd[0] = realp->const.ci;
-       else    p->const.cd[0] = realp->const.cd[0];
-       if( ISINT(itype) )
-               p->const.cd[1] = imagp->const.ci;
-       else    p->const.cd[1] = imagp->const.cd[0];
-       }
-else
-       {
-       err("invalid complex constant");
-       p = errnode();
-       }
-
-frexpr(realp);
-frexpr(imagp);
-return(p);
-}
-
-
-struct errorblock *errnode()
-{
-struct errorblock *p;
-p = ALLOC(errorblock);
-p->tag = TERROR;
-p->vtype = TYERROR;
-return(p);
-}
-
-
-
-
-
-expptr mkconv(t, p)
-register int t;
-register expptr p;
-{
-register expptr q;
-register int pt;
-expptr opconv();
-
-if(t==TYUNKNOWN || t==TYERROR)
-       fatal1("mkconv of impossible type %d", t);
-pt = p->vtype;
-if(t == pt)
-       return(p);
-
-else if( ISCONST(p) && pt!=TYADDR)
-       {
-       q = mkconst(t);
-       consconv(t, &(q->const), p->vtype, &(p->const));
-       frexpr(p);
-       }
-#if TARGET == PDP11
-       else if(ISINT(t) && pt==TYCHAR)
-               {
-               q = mkexpr(OPBITAND, opconv(p,TYSHORT), ICON(255));
-               if(t == TYLONG)
-                       q = opconv(q, TYLONG);
-               }
-#endif
-else
-       q = opconv(p, t);
-
-if(t == TYCHAR)
-       q->vleng = ICON(1);
-return(q);
-}
-
-
-
-expptr opconv(p, t)
-expptr p;
-int t;
-{
-register expptr q;
-
-q = mkexpr(OPCONV, p, 0);
-q->vtype = t;
-return(q);
-}
-
-
-
-struct exprblock *addrof(p)
-expptr p;
-{
-return( mkexpr(OPADDR, p, NULL) );
-}
-
-
-
-tagptr cpexpr(p)
-register tagptr p;
-{
-register tagptr e;
-int tag;
-register chainp ep, pp;
-ptr cpblock();
-
-static int blksize[ ] =
-       {       0,
-               sizeof(struct nameblock),
-               sizeof(struct constblock),
-               sizeof(struct exprblock),
-               sizeof(struct addrblock),
-               sizeof(struct primblock),
-               sizeof(struct listblock),
-               sizeof(struct errorblock)
-       };
-
-if(p == NULL)
-       return(NULL);
-
-if( (tag = p->tag) == TNAME)
-       return(p);
-
-e = cpblock( blksize[p->tag] , p);
-
-switch(tag)
-       {
-       case TCONST:
-               if(e->vtype == TYCHAR)
-                       {
-                       e->const.ccp = copyn(1+strlen(e->const.ccp), e->const.ccp);
-                       e->vleng = cpexpr(e->vleng);
-                       }
-       case TERROR:
-               break;
-
-       case TEXPR:
-               e->leftp = cpexpr(p->leftp);
-               e->rightp = cpexpr(p->rightp);
-               break;
-
-       case TLIST:
-               if(pp = p->listp)
-                       {
-                       ep = e->listp = mkchain( cpexpr(pp->datap), NULL);
-                       for(pp = pp->nextp ; pp ; pp = pp->nextp)
-                               ep = ep->nextp = mkchain( cpexpr(pp->datap), NULL);
-                       }
-               break;
-
-       case TADDR:
-               e->vleng = cpexpr(e->vleng);
-               e->memoffset = cpexpr(e->memoffset);
-               e->istemp = NO;
-               break;
-
-       case TPRIM:
-               e->argsp = cpexpr(e->argsp);
-               e->fcharp = cpexpr(e->fcharp);
-               e->lcharp = cpexpr(e->lcharp);
-               break;
-
-       default:
-               fatal1("cpexpr: impossible tag %d", tag);
-       }
-
-return(e);
-}
-\f
-frexpr(p)
-register tagptr p;
-{
-register chainp q;
-
-if(p == NULL)
-       return;
-
-switch(p->tag)
-       {
-       case TCONST:
-               if( ISCHAR(p) )
-                       {
-                       free(p->const.ccp);
-                       frexpr(p->vleng);
-                       }
-               break;
-
-       case TADDR:
-               if(p->istemp)
-                       {
-                       frtemp(p);
-                       return;
-                       }
-               frexpr(p->vleng);
-               frexpr(p->memoffset);
-               break;
-
-       case TERROR:
-               break;
-
-       case TNAME:
-               return;
-
-       case TPRIM:
-               frexpr(p->argsp);
-               frexpr(p->fcharp);
-               frexpr(p->lcharp);
-               break;
-
-       case TEXPR:
-               frexpr(p->leftp);
-               if(p->rightp)
-                       frexpr(p->rightp);
-               break;
-
-       case TLIST:
-               for(q = p->listp ; q ; q = q->nextp)
-                       frexpr(q->datap);
-               frchain( &(p->listp) );
-               break;
-
-       default:
-               fatal1("frexpr: impossible tag %d", p->tag);
-       }
-
-free(p);
-}
-\f
-/* fix up types in expression; replace subtrees and convert
-   names to address blocks */
-
-expptr fixtype(p)
-register tagptr p;
-{
-
-if(p == 0)
-       return(0);
-
-switch(p->tag)
-       {
-       case TCONST:
-               if( ! ONEOF(p->vtype, MSKINT|MSKLOGICAL|MSKADDR) )
-                       p = putconst(p);
-               return(p);
-
-       case TADDR:
-               p->memoffset = fixtype(p->memoffset);
-               return(p);
-
-       case TERROR:
-               return(p);
-
-       default:
-               fatal1("fixtype: impossible tag %d", p->tag);
-
-       case TEXPR:
-               return( fixexpr(p) );
-
-       case TLIST:
-               return( p );
-
-       case TPRIM:
-               if(p->argsp && p->namep->vclass!=CLVAR)
-                       return( mkfunct(p) );
-               else    return( mklhs(p) );
-       }
-}
-
-
-
-
-
-/* special case tree transformations and cleanups of expression trees */
-
-expptr fixexpr(p)
-register struct exprblock *p;
-{
-expptr lp;
-register expptr rp;
-register expptr q;
-int opcode, ltype, rtype, ptype, mtype;
-expptr mkpower();
-
-if(p->tag == TERROR)
-       return(p);
-else if(p->tag != TEXPR)
-       fatal1("fixexpr: invalid tag %d", p->tag);
-opcode = p->opcode;
-lp = p->leftp = fixtype(p->leftp);
-ltype = lp->vtype;
-if(opcode==OPASSIGN && lp->tag!=TADDR)
-       {
-       err("left side of assignment must be variable");
-       frexpr(p);
-       return( errnode() );
-       }
-
-if(p->rightp)
-       {
-       rp = p->rightp = fixtype(p->rightp);
-       rtype = rp->vtype;
-       }
-else
-       {
-       rp = NULL;
-       rtype = 0;
-       }
-
-/* force folding if possible */
-if( ISCONST(lp) && (rp==NULL || ISCONST(rp)) )
-       {
-       q = mkexpr(opcode, lp, rp);
-       if( ISCONST(q) )
-               return(q);
-       free(q);        /* constants did not fold */
-       }
-
-if( (ptype = cktype(opcode, ltype, rtype)) == TYERROR)
-       {
-       frexpr(p);
-       return( errnode() );
-       }
-
-switch(opcode)
-       {
-       case OPCONCAT:
-               if(p->vleng == NULL)
-                       p->vleng = mkexpr(OPPLUS, cpexpr(lp->vleng),
-                               cpexpr(rp->vleng) );
-               break;
-
-       case OPASSIGN:
-       case OPPLUSEQ:
-       case OPSTAREQ:
-               if(ltype == rtype)
-                       break;
-               if( ! ISCONST(rp) && ISREAL(ltype) && ISREAL(rtype) )
-                       break;
-               if( ISCOMPLEX(ltype) || ISCOMPLEX(rtype) )
-                       break;
-               if( ONEOF(ltype, MSKADDR|MSKINT) && ONEOF(rtype, MSKADDR|MSKINT)
-#if FAMILY==SCJ
-                   && typesize[ltype]>=typesize[rtype] )
-#else
-                   && typesize[ltype]==typesize[rtype] )
-#endif
-                       break;
-               p->rightp = fixtype( mkconv(ptype, rp) );
-               break;
-
-       case OPSLASH:
-               if( ISCOMPLEX(rtype) )
-                       {
-                       p = call2(ptype, ptype==TYCOMPLEX? "c_div" : "z_div",
-                               mkconv(ptype, lp), mkconv(ptype, rp) );
-                       break;
-                       }
-       case OPPLUS:
-       case OPMINUS:
-       case OPSTAR:
-       case OPMOD:
-               if(ptype==TYDREAL && ( (ltype==TYREAL && ! ISCONST(lp) ) ||
-                   (rtype==TYREAL && ! ISCONST(rp) ) ))
-                       break;
-               if( ISCOMPLEX(ptype) )
-                       break;
-               if(ltype != ptype)
-                       p->leftp = fixtype(mkconv(ptype,lp));
-               if(rtype != ptype)
-                       p->rightp = fixtype(mkconv(ptype,rp));
-               break;
-
-       case OPPOWER:
-               return( mkpower(p) );
-
-       case OPLT:
-       case OPLE:
-       case OPGT:
-       case OPGE:
-       case OPEQ:
-       case OPNE:
-               if(ltype == rtype)
-                       break;
-               mtype = cktype(OPMINUS, ltype, rtype);
-               if(mtype==TYDREAL && ( (ltype==TYREAL && ! ISCONST(lp)) ||
-                   (rtype==TYREAL && ! ISCONST(rp)) ))
-                       break;
-               if( ISCOMPLEX(mtype) )
-                       break;
-               if(ltype != mtype)
-                       p->leftp = fixtype(mkconv(mtype,lp));
-               if(rtype != mtype)
-                       p->rightp = fixtype(mkconv(mtype,rp));
-               break;
-
-
-       case OPCONV:
-               ptype = cktype(OPCONV, p->vtype, ltype);
-               if(lp->tag==TEXPR && lp->opcode==OPCOMMA)
-                       {
-                       lp->rightp = fixtype( mkconv(ptype, lp->rightp) );
-                       free(p);
-                       p = lp;
-                       }
-               break;
-
-       case OPADDR:
-               if(lp->tag==TEXPR && lp->opcode==OPADDR)
-                       fatal("addr of addr");
-               break;
-
-       case OPCOMMA:
-       case OPQUEST:
-       case OPCOLON:
-               break;
-
-       case OPMIN:
-       case OPMAX:
-               ptype = p->vtype;
-               break;
-
-       default:
-               break;
-       }
-
-p->vtype = ptype;
-return(p);
-}
-\f
-#if SZINT < SZLONG
-/*
-   for efficient subscripting, replace long ints by shorts
-   in easy places
-*/
-
-expptr shorten(p)
-register expptr p;
-{
-register expptr q;
-
-if(p->vtype != TYLONG)
-       return(p);
-
-switch(p->tag)
-       {
-       case TERROR:
-       case TLIST:
-               return(p);
-
-       case TCONST:
-       case TADDR:
-               return( mkconv(TYINT,p) );
-
-       case TEXPR:
-               break;
-
-       default:
-               fatal1("shorten: invalid tag %d", p->tag);
-       }
-
-switch(p->opcode)
-       {
-       case OPPLUS:
-       case OPMINUS:
-       case OPSTAR:
-               q = shorten( cpexpr(p->rightp) );
-               if(q->vtype == TYINT)
-                       {
-                       p->leftp = shorten(p->leftp);
-                       if(p->leftp->vtype == TYLONG)
-                               frexpr(q);
-                       else
-                               {
-                               frexpr(p->rightp);
-                               p->rightp = q;
-                               p->vtype = TYINT;
-                               }
-                       }
-               break;
-
-       case OPNEG:
-               p->leftp = shorten(p->leftp);
-               if(p->leftp->vtype == TYINT)
-                       p->vtype = TYINT;
-               break;
-
-       case OPCALL:
-       case OPCCALL:
-               p = mkconv(TYINT,p);
-               break;
-       default:
-               break;
-       }
-
-return(p);
-}
-#endif
-\f
-fixargs(doput, p0)
-int doput;
-struct listblock *p0;
-{
-register chainp p;
-register tagptr q, t;
-register int qtag;
-int nargs;
-struct addrblock *mkaddr();
-
-nargs = 0;
-if(p0)
-    for(p = p0->listp ; p ; p = p->nextp)
-       {
-       ++nargs;
-       q = p->datap;
-       qtag = q->tag;
-       if(qtag == TCONST)
-               {
-               if(q->vtype == TYSHORT)
-                       q = mkconv(tyint, q);
-               if(doput)
-                       p->datap = putconst(q);
-               else
-                       p->datap = q;
-               }
-       else if(qtag==TPRIM && q->argsp==0 && q->namep->vclass==CLPROC)
-               p->datap = mkaddr(q->namep);
-       else if(qtag==TPRIM && q->argsp==0 && q->namep->vdim!=NULL)
-               p->datap = mkscalar(q->namep);
-       else if(qtag==TPRIM && q->argsp==0 && q->namep->vdovar && 
-               (t = memversion(q->namep)) )
-                       p->datap = fixtype(t);
-       else    p->datap = fixtype(q);
-       }
-return(nargs);
-}
-
-
-mkscalar(np)
-register struct nameblock *np;
-{
-register struct addrblock *ap;
-register struct dimblock *dp;
-
-vardcl(np);
-ap = mkaddr(np);
-
-#if TARGET == VAX
-       /* on the VAX, prolog causes array arguments
-          to point at the (0,...,0) element, except when
-          subscript checking is on
-       */
-       if( !checksubs && np->vstg==STGARG)
-               {
-               dp = np->vdim;
-               frexpr(ap->memoffset);
-               ap->memoffset = mkexpr(OPSTAR, ICON(typesize[np->vtype]),
-                                       cpexpr(dp->baseoffset) );
-               }
-#endif
-return(ap);
-}
-
-
-
-
-
-expptr mkfunct(p)
-register struct primblock * p;
-{
-struct entrypoint *ep;
-struct addrblock *ap;
-struct extsym *mkext(), *extp;
-register struct nameblock *np;
-register struct exprblock *q;
-struct exprblock *intrcall(), *stfcall();
-int k, nargs;
-int class;
-
-np = p->namep;
-class = np->vclass;
-
-if(class == CLUNKNOWN)
-       {
-       np->vclass = class = CLPROC;
-       if(np->vstg == STGUNKNOWN)
-               {
-               if(k = intrfunct(np->varname))
-                       {
-                       np->vstg = STGINTR;
-                       np->vardesc.varno = k;
-                       np->vprocclass = PINTRINSIC;
-                       }
-               else
-                       {
-                       extp = mkext( varunder(VL,np->varname) );
-                       extp->extstg = STGEXT;
-                       np->vstg = STGEXT;
-                       np->vardesc.varno = extp - extsymtab;
-                       np->vprocclass = PEXTERNAL;
-                       }
-               }
-       else if(np->vstg==STGARG)
-               {
-               if(np->vtype!=TYCHAR && !ftn66flag)
-                   warn("Dummy procedure not declared EXTERNAL. Code may be wrong.");
-               np->vprocclass = PEXTERNAL;
-               }
-       }
-
-if(class != CLPROC)
-       fatal1("invalid class code for function", class);
-if(p->fcharp || p->lcharp)
-       {
-       err("no substring of function call");
-       goto error;
-       }
-impldcl(np);
-nargs = fixargs( np->vprocclass!=PINTRINSIC,  p->argsp);
-
-switch(np->vprocclass)
-       {
-       case PEXTERNAL:
-               ap = mkaddr(np);
-       call:
-               q = mkexpr(OPCALL, ap, p->argsp);
-               q->vtype = np->vtype;
-               if(np->vleng)
-                       q->vleng = cpexpr(np->vleng);
-               break;
-
-       case PINTRINSIC:
-               q = intrcall(np, p->argsp, nargs);
-               break;
-
-       case PSTFUNCT:
-               q = stfcall(np, p->argsp);
-               break;
-
-       case PTHISPROC:
-               warn("recursive call");
-               for(ep = entries ; ep ; ep = ep->nextp)
-                       if(ep->enamep == np)
-                               break;
-               if(ep == NULL)
-                       fatal("mkfunct: impossible recursion");
-               ap = builtin(np->vtype, varstr(XL, ep->entryname->extname) );
-               goto call;
-
-       default:
-               fatal1("mkfunct: impossible vprocclass %d", np->vprocclass);
-       }
-free(p);
-return(q);
-
-error:
-       frexpr(p);
-       return( errnode() );
-}
-
-
-
-LOCAL struct exprblock *stfcall(np, actlist)
-struct nameblock *np;
-struct listblock *actlist;
-{
-register chainp actuals;
-int nargs;
-chainp oactp, formals;
-int type;
-struct exprblock *q, *rhs;
-expptr ap;
-register struct rplblock *rp;
-struct rplblock *tlist;
-
-if(actlist)
-       {
-       actuals = actlist->listp;
-       free(actlist);
-       }
-else
-       actuals = NULL;
-oactp = actuals;
-
-nargs = 0;
-tlist = NULL;
-type = np->vtype;
-formals = np->vardesc.vstfdesc->datap;
-rhs = np->vardesc.vstfdesc->nextp;
-
-/* copy actual arguments into temporaries */
-while(actuals!=NULL && formals!=NULL)
-       {
-       rp = ALLOC(rplblock);
-       rp->rplnp = q = formals->datap;
-       ap = fixtype(actuals->datap);
-       if(q->vtype==ap->vtype && q->vtype!=TYCHAR
-          && (ap->tag==TCONST || ap->tag==TADDR) )
-               {
-               rp->rplvp = ap;
-               rp->rplxp = NULL;
-               rp->rpltag = ap->tag;
-               }
-       else    {
-               rp->rplvp = mktemp(q->vtype, q->vleng);
-               rp->rplxp = fixtype( mkexpr(OPASSIGN, cpexpr(rp->rplvp), ap) );
-               if( (rp->rpltag = rp->rplxp->tag) == TERROR)
-                       err("disagreement of argument types in statement function call");
-               }
-       rp->nextp = tlist;
-       tlist = rp;
-       actuals = actuals->nextp;
-       formals = formals->nextp;
-       ++nargs;
-       }
-
-if(actuals!=NULL || formals!=NULL)
-       err("statement function definition and argument list differ");
-
-/*
-   now push down names involved in formal argument list, then
-   evaluate rhs of statement function definition in this environment
-*/
-rpllist = hookup(tlist, rpllist);
-q = mkconv(type, fixtype(cpexpr(rhs)) );
-
-/* now generate the tree ( t1=a1, (t2=a2,... , f))))) */
-while(--nargs >= 0)
-       {
-       if(rpllist->rplxp)
-               q = mkexpr(OPCOMMA, rpllist->rplxp, q);
-       rp = rpllist->nextp;
-       frexpr(rpllist->rplvp);
-       free(rpllist);
-       rpllist = rp;
-       }
-
-frchain( &oactp );
-return(q);
-}
-
-
-
-
-struct addrblock *mklhs(p)
-register struct primblock * p;
-{
-register struct addrblock *s;
-expptr suboffset();
-struct nameblock *np;
-register struct rplblock *rp;
-int regn;
-
-/* first fixup name */
-
-if(p->tag != TPRIM)
-       return(p);
-np = p->namep;
-
-/* is name on the replace list? */
-
-for(rp = rpllist ; rp ; rp = rp->nextp)
-       {
-       if(np == rp->rplnp)
-               {
-               if(rp->rpltag == TNAME)
-                       {
-                       np = p->namep = rp->rplvp;
-                       break;
-                       }
-               else    return( cpexpr(rp->rplvp) );
-               }
-       }
-
-/* is variable a DO index in a register ? */
-
-if(np->vdovar && ( (regn = inregister(np)) >= 0) )
-       if(np->vtype == TYERROR)
-               return( errnode() );
-       else
-               {
-               s = ALLOC(addrblock);
-               s->tag = TADDR;
-               s->vstg = STGREG;
-               s->vtype = TYIREG;
-               s->memno = regn;
-               s->memoffset = ICON(0);
-               return(s);
-               }
-
-vardcl(np);
-s = mkaddr(np);
-s->memoffset = mkexpr(OPPLUS, s->memoffset, suboffset(p) );
-frexpr(p->argsp);
-p->argsp = NULL;
-
-/* now do substring part */
-
-if(p->fcharp || p->lcharp)
-       {
-       if(np->vtype != TYCHAR)
-               err1("substring of noncharacter %s", varstr(VL,np->varname));
-       else    {
-               if(p->lcharp == NULL)
-                       p->lcharp = cpexpr(s->vleng);
-               if(p->fcharp)
-                       s->vleng = mkexpr(OPMINUS, p->lcharp,
-                               mkexpr(OPMINUS, p->fcharp, ICON(1) ));
-               else    {
-                       frexpr(s->vleng);
-                       s->vleng = p->lcharp;
-                       }
-               }
-       }
-
-s->vleng = fixtype( s->vleng );
-s->memoffset = fixtype( s->memoffset );
-free(p);
-return(s);
-}
-
-
-
-
-
-deregister(np)
-struct nameblock *np;
-{
-if(nregvar>0 && regnamep[nregvar-1]==np)
-       {
-       --nregvar;
-#if FAMILY == DMR
-       putnreg();
-#endif
-       }
-}
-
-
-
-
-struct addrblock *memversion(np)
-register struct nameblock *np;
-{
-register struct addrblock *s;
-
-if(np->vdovar==NO || (inregister(np)<0) )
-       return(NULL);
-np->vdovar = NO;
-s = mklhs( mkprim(np, 0,0,0) );
-np->vdovar = YES;
-return(s);
-}
-
-
-
-inregister(np)
-register struct nameblock *np;
-{
-register int i;
-
-for(i = 0 ; i < nregvar ; ++i)
-       if(regnamep[i] == np)
-               return( regnum[i] );
-return(-1);
-}
-
-
-
-
-enregister(np)
-struct nameblock *np;
-{
-if( inregister(np) >= 0)
-       return(YES);
-if(nregvar >= maxregvar)
-       return(NO);
-vardcl(np);
-if( ONEOF(np->vtype, MSKIREG) )
-       {
-       regnamep[nregvar++] = np;
-       if(nregvar > highregvar)
-               highregvar = nregvar;
-#if FAMILY == DMR
-       putnreg();
-#endif
-       return(YES);
-       }
-else
-       return(NO);
-}
-
-
-
-
-expptr suboffset(p)
-register struct primblock *p;
-{
-int n;
-expptr size;
-chainp cp;
-expptr offp, prod;
-expptr subcheck();
-struct dimblock *dimp;
-expptr sub[8];
-register struct nameblock *np;
-
-np = p->namep;
-offp = ICON(0);
-n = 0;
-if(p->argsp)
-       for(cp = p->argsp->listp ; cp ; cp = cp->nextp)
-               {
-               sub[n++] = fixtype(cpexpr(cp->datap));
-               if(n > 7)
-                       {
-                       err("more than 7 subscripts");
-                       break;
-                       }
-               }
-
-dimp = np->vdim;
-if(n>0 && dimp==NULL)
-       err("subscripts on scalar variable");
-else if(dimp && dimp->ndim!=n)
-       err1("wrong number of subscripts on %s",
-               varstr(VL, np->varname) );
-else if(n > 0)
-       {
-       prod = sub[--n];
-       while( --n >= 0)
-               prod = mkexpr(OPPLUS, sub[n],
-                       mkexpr(OPSTAR, prod, cpexpr(dimp->dims[n].dimsize)) );
-#if TARGET == VAX
-       if(checksubs || np->vstg!=STGARG)
-               prod = mkexpr(OPMINUS, prod, cpexpr(dimp->baseoffset));
-#else
-       prod = mkexpr(OPMINUS, prod, cpexpr(dimp->baseoffset));
-#endif
-       if(checksubs)
-               prod = subcheck(np, prod);
-       if(np->vtype == TYCHAR)
-               size = cpexpr(np->vleng);
-       else    size = ICON( typesize[np->vtype] );
-       prod = mkexpr(OPSTAR, prod, size);
-       offp = mkexpr(OPPLUS, offp, prod);
-       }
-
-if(p->fcharp && np->vtype==TYCHAR)
-       offp = mkexpr(OPPLUS, offp, mkexpr(OPMINUS, cpexpr(p->fcharp), ICON(1) ));
-
-return(offp);
-}
-
-
-
-
-expptr subcheck(np, p)
-struct nameblock *np;
-register expptr p;
-{
-struct dimblock *dimp;
-expptr t, checkvar, checkcond, badcall;
-
-dimp = np->vdim;
-if(dimp->nelt == NULL)
-       return(p);      /* don't check arrays with * bounds */
-checkvar = NULL;
-checkcond = NULL;
-if( ISICON(p) )
-       {
-       if(p->const.ci < 0)
-               goto badsub;
-       if( ISICON(dimp->nelt) )
-               if(p->const.ci < dimp->nelt->const.ci)
-                       return(p);
-               else
-                       goto badsub;
-       }
-if(p->tag==TADDR && p->vstg==STGREG)
-       {
-       checkvar = cpexpr(p);
-       t = p;
-       }
-else   {
-       checkvar = mktemp(p->vtype, NULL);
-       t = mkexpr(OPASSIGN, cpexpr(checkvar), p);
-       }
-checkcond = mkexpr(OPLT, t, cpexpr(dimp->nelt) );
-if( ! ISICON(p) )
-       checkcond = mkexpr(OPAND, checkcond,
-                       mkexpr(OPLE, ICON(0), cpexpr(checkvar)) );
-
-badcall = call4(p->vtype, "s_rnge", mkstrcon(VL, np->varname),
-               mkconv(TYLONG,  cpexpr(checkvar)),
-               mkstrcon(XL, procname), ICON(lineno));
-badcall->opcode = OPCCALL;
-p = mkexpr(OPQUEST, checkcond,
-       mkexpr(OPCOLON, checkvar, badcall));
-
-return(p);
-
-badsub:
-       frexpr(p);
-       err1("subscript on variable %s out of range", varstr(VL,np->varname));
-       return ( ICON(0) );
-}
-
-
-
-
-struct addrblock *mkaddr(p)
-register struct nameblock *p;
-{
-struct extsym *mkext(), *extp;
-register struct addrblock *t;
-struct addrblock *intraddr();
-
-switch( p->vstg)
-       {
-       case STGUNKNOWN:
-               if(p->vclass != CLPROC)
-                       break;
-               extp = mkext( varunder(VL, p->varname) );
-               extp->extstg = STGEXT;
-               p->vstg = STGEXT;
-               p->vardesc.varno = extp - extsymtab;
-               p->vprocclass = PEXTERNAL;
-
-       case STGCOMMON:
-       case STGEXT:
-       case STGBSS:
-       case STGINIT:
-       case STGEQUIV:
-       case STGARG:
-       case STGLENG:
-       case STGAUTO:
-               t = ALLOC(addrblock);
-               t->tag = TADDR;
-               if(p->vclass==CLPROC && p->vprocclass==PTHISPROC)
-                       t->vclass = CLVAR;
-               else
-                       t->vclass = p->vclass;
-               t->vtype = p->vtype;
-               t->vstg = p->vstg;
-               t->memno = p->vardesc.varno;
-               t->memoffset = ICON(p->voffset);
-               if(p->vleng)
-                       t->vleng = cpexpr(p->vleng);
-               return(t);
-
-       case STGINTR:
-               return( intraddr(p) );
-
-       }
-/*debug*/ fprintf(diagfile, "mkaddr. vtype=%d, vclass=%d\n", p->vtype, p->vclass);
-fatal1("mkaddr: impossible storage tag %d", p->vstg);
-/* NOTREACHED */
-}
-
-
-
-
-mkarg(type, argno)
-int type, argno;
-{
-register struct addrblock *p;
-
-p = ALLOC(addrblock);
-p->tag = TADDR;
-p->vtype = type;
-p->vclass = CLVAR;
-p->vstg = (type==TYLENG ? STGLENG : STGARG);
-p->memno = argno;
-return(p);
-}
-
-
-
-
-tagptr mkprim(v, args, lstr, rstr)
-register union { struct paramblock; struct nameblock; } *v;
-struct listblock *args;
-expptr lstr, rstr;
-{
-register struct primblock *p;
-
-if(v->vclass == CLPARAM)
-       {
-       if(args || lstr || rstr)
-               {
-               err1("no qualifiers on parameter name", varstr(VL,v->varname));
-               frexpr(args);
-               frexpr(lstr);
-               frexpr(rstr);
-               frexpr(v);
-               return( errnode() );
-               }
-       return( cpexpr(v->paramval) );
-       }
-
-p = ALLOC(primblock);
-p->tag = TPRIM;
-p->vtype = v->vtype;
-p->namep = v;
-p->argsp = args;
-p->fcharp = lstr;
-p->lcharp = rstr;
-return(p);
-}
-
-
-
-vardcl(v)
-register struct nameblock *v;
-{
-int nelt;
-struct dimblock *t;
-struct addrblock *p;
-expptr neltp;
-
-if(v->vdcldone) return;
-
-if(v->vtype == TYUNKNOWN)
-       impldcl(v);
-if(v->vclass == CLUNKNOWN)
-       v->vclass = CLVAR;
-else if(v->vclass!=CLVAR && v->vprocclass!=PTHISPROC)
-       {
-       dclerr("used as variable", v);
-       return;
-       }
-if(v->vstg==STGUNKNOWN)
-       v->vstg = implstg[ letter(v->varname[0]) ];
-
-switch(v->vstg)
-       {
-       case STGBSS:
-               v->vardesc.varno = ++lastvarno;
-               break;
-       case STGAUTO:
-               if(v->vclass==CLPROC && v->vprocclass==PTHISPROC)
-                       break;
-               nelt = 1;
-               if(t = v->vdim)
-                       if( (neltp = t->nelt) && ISCONST(neltp) )
-                               nelt = neltp->const.ci;
-                       else
-                               dclerr("adjustable automatic array", v);
-               p = autovar(nelt, v->vtype, v->vleng);
-               v->voffset = p->memoffset->const.ci;
-               frexpr(p);
-               break;
-
-       default:
-               break;
-       }
-v->vdcldone = YES;
-}
-
-
-
-
-impldcl(p)
-register struct nameblock *p;
-{
-register int k;
-int type, leng;
-
-if(p->vdcldone || (p->vclass==CLPROC && p->vprocclass==PINTRINSIC) )
-       return;
-if(p->vtype == TYUNKNOWN)
-       {
-       k = letter(p->varname[0]);
-       type = impltype[ k ];
-       leng = implleng[ k ];
-       if(type == TYUNKNOWN)
-               {
-               if(p->vclass == CLPROC)
-                       return;
-               dclerr("attempt to use undefined variable", p);
-               type = TYERROR;
-               leng = 1;
-               }
-       settype(p, type, leng);
-       }
-}
-
-
-
-
-LOCAL letter(c)
-register int c;
-{
-if( isupper(c) )
-       c = tolower(c);
-return(c - 'a');
-}
-\f
-#define ICONEQ(z, c)  (ISICON(z) && z->const.ci==c)
-#define COMMUTE        { e = lp;  lp = rp;  rp = e; }
-
-
-expptr mkexpr(opcode, lp, rp)
-int opcode;
-register expptr lp, rp;
-{
-register struct exprblock *e, *e1;
-int etype;
-int ltype, rtype;
-int ltag, rtag;
-expptr fold();
-
-ltype = lp->vtype;
-ltag = lp->tag;
-if(rp && opcode!=OPCALL && opcode!=OPCCALL)
-       {
-       rtype = rp->vtype;
-       rtag = rp->tag;
-       }
-else  rtype = 0;
-
-etype = cktype(opcode, ltype, rtype);
-if(etype == TYERROR)
-       goto error;
-
-switch(opcode)
-       {
-       /* check for multiplication by 0 and 1 and addition to 0 */
-
-       case OPSTAR:
-               if( ISCONST(lp) )
-                       COMMUTE
-
-               if( ISICON(rp) )
-                       {
-                       if(rp->const.ci == 0)
-                               goto retright;
-                       goto mulop;
-                       }
-               break;
-
-       case OPSLASH:
-       case OPMOD:
-               if( ICONEQ(rp, 0) )
-                       {
-                       err("attempted division by zero");
-                       rp = ICON(1);
-                       break;
-                       }
-               if(opcode == OPMOD)
-                       break;
-
-
-       mulop:
-               if( ISICON(rp) )
-                       {
-                       if(rp->const.ci == 1)
-                               goto retleft;
-
-                       if(rp->const.ci == -1)
-                               {
-                               frexpr(rp);
-                               return( mkexpr(OPNEG, lp, 0) );
-                               }
-                       }
-
-               if( ISSTAROP(lp) && ISICON(lp->rightp) )
-                       {
-                       if(opcode == OPSTAR)
-                               e = mkexpr(OPSTAR, lp->rightp, rp);
-                       else  if(ISICON(rp) && lp->rightp->const.ci % rp->const.ci == 0)
-                               e = mkexpr(OPSLASH, lp->rightp, rp);
-                       else    break;
-
-                       e1 = lp->leftp;
-                       free(lp);
-                       return( mkexpr(OPSTAR, e1, e) );
-                       }
-               break;
-
-
-       case OPPLUS:
-               if( ISCONST(lp) )
-                       COMMUTE
-               goto addop;
-
-       case OPMINUS:
-               if( ICONEQ(lp, 0) )
-                       {
-                       frexpr(lp);
-                       return( mkexpr(OPNEG, rp, 0) );
-                       }
-
-               if( ISCONST(rp) )
-                       {
-                       opcode = OPPLUS;
-                       consnegop(rp);
-                       }
-
-       addop:
-               if( ISICON(rp) )
-                       {
-                       if(rp->const.ci == 0)
-                               goto retleft;
-                       if( ISPLUSOP(lp) && ISICON(lp->rightp) )
-                               {
-                               e = mkexpr(OPPLUS, lp->rightp, rp);
-                               e1 = lp->leftp;
-                               free(lp);
-                               return( mkexpr(OPPLUS, e1, e) );
-                               }
-                       }
-               break;
-
-
-       case OPPOWER:
-               break;
-
-       case OPNEG:
-               if(ltag==TEXPR && lp->opcode==OPNEG)
-                       {
-                       e = lp->leftp;
-                       free(lp);
-                       return(e);
-                       }
-               break;
-
-       case OPNOT:
-               if(ltag==TEXPR && lp->opcode==OPNOT)
-                       {
-                       e = lp->leftp;
-                       free(lp);
-                       return(e);
-                       }
-               break;
-
-       case OPCALL:
-       case OPCCALL:
-               etype = ltype;
-               if(rp!=NULL && rp->listp==NULL)
-                       {
-                       free(rp);
-                       rp = NULL;
-                       }
-               break;
-
-       case OPAND:
-       case OPOR:
-               if( ISCONST(lp) )
-                       COMMUTE
-
-               if( ISCONST(rp) )
-                       {
-                       if(rp->const.ci == 0)
-                               if(opcode == OPOR)
-                                       goto retleft;
-                               else
-                                       goto retright;
-                       else if(opcode == OPOR)
-                               goto retright;
-                       else
-                               goto retleft;
-                       }
-       case OPEQV:
-       case OPNEQV:
-
-       case OPBITAND:
-       case OPBITOR:
-       case OPBITXOR:
-       case OPBITNOT:
-       case OPLSHIFT:
-       case OPRSHIFT:
-
-       case OPLT:
-       case OPGT:
-       case OPLE:
-       case OPGE:
-       case OPEQ:
-       case OPNE:
-
-       case OPCONCAT:
-               break;
-       case OPMIN:
-       case OPMAX:
-
-       case OPASSIGN:
-       case OPPLUSEQ:
-       case OPSTAREQ:
-
-       case OPCONV:
-       case OPADDR:
-
-       case OPCOMMA:
-       case OPQUEST:
-       case OPCOLON:
-               break;
-
-       default:
-               fatal1("mkexpr: impossible opcode %d", opcode);
-       }
-
-e = ALLOC(exprblock);
-e->tag = TEXPR;
-e->opcode = opcode;
-e->vtype = etype;
-e->leftp = lp;
-e->rightp = rp;
-if(ltag==TCONST && (rp==0 || rtag==TCONST) )
-       e = fold(e);
-return(e);
-
-retleft:
-       frexpr(rp);
-       return(lp);
-
-retright:
-       frexpr(lp);
-       return(rp);
-
-error:
-       frexpr(lp);
-       if(rp && opcode!=OPCALL && opcode!=OPCCALL)
-               frexpr(rp);
-       return( errnode() );
-}
-\f
-#define ERR(s)   { errs = s; goto error; }
-
-cktype(op, lt, rt)
-register int op, lt, rt;
-{
-char *errs;
-
-if(lt==TYERROR || rt==TYERROR)
-       goto error1;
-
-if(lt==TYUNKNOWN)
-       return(TYUNKNOWN);
-if(rt==TYUNKNOWN)
-       if(op!=OPNOT && op!=OPBITNOT && op!=OPNEG && op!=OPCALL && op!=OPCCALL && op!=OPADDR)
-               return(TYUNKNOWN);
-
-switch(op)
-       {
-       case OPPLUS:
-       case OPMINUS:
-       case OPSTAR:
-       case OPSLASH:
-       case OPPOWER:
-       case OPMOD:
-               if( ISNUMERIC(lt) && ISNUMERIC(rt) )
-                       return( maxtype(lt, rt) );
-               ERR("nonarithmetic operand of arithmetic operator")
-
-       case OPNEG:
-               if( ISNUMERIC(lt) )
-                       return(lt);
-               ERR("nonarithmetic operand of negation")
-
-       case OPNOT:
-               if(lt == TYLOGICAL)
-                       return(TYLOGICAL);
-               ERR("NOT of nonlogical")
-
-       case OPAND:
-       case OPOR:
-       case OPEQV:
-       case OPNEQV:
-               if(lt==TYLOGICAL && rt==TYLOGICAL)
-                       return(TYLOGICAL);
-               ERR("nonlogical operand of logical operator")
-
-       case OPLT:
-       case OPGT:
-       case OPLE:
-       case OPGE:
-       case OPEQ:
-       case OPNE:
-               if(lt==TYCHAR || rt==TYCHAR || lt==TYLOGICAL || rt==TYLOGICAL)
-                       {
-                       if(lt != rt)
-                               ERR("illegal comparison")
-                       }
-
-               else if( ISCOMPLEX(lt) || ISCOMPLEX(rt) )
-                       {
-                       if(op!=OPEQ && op!=OPNE)
-                               ERR("order comparison of complex data")
-                       }
-
-               else if( ! ISNUMERIC(lt) || ! ISNUMERIC(rt) )
-                       ERR("comparison of nonarithmetic data")
-               return(TYLOGICAL);
-
-       case OPCONCAT:
-               if(lt==TYCHAR && rt==TYCHAR)
-                       return(TYCHAR);
-               ERR("concatenation of nonchar data")
-
-       case OPCALL:
-       case OPCCALL:
-               return(lt);
-
-       case OPADDR:
-               return(TYADDR);
-
-       case OPCONV:
-               if(rt == 0)
-                       return(0);
-               if(lt==TYCHAR && ISINT(rt) )
-                       return(TYCHAR);
-       case OPASSIGN:
-       case OPPLUSEQ:
-       case OPSTAREQ:
-               if( ISINT(lt) && rt==TYCHAR)
-                       return(lt);
-               if(lt==TYCHAR || rt==TYCHAR || lt==TYLOGICAL || rt==TYLOGICAL)
-                       if(op!=OPASSIGN || lt!=rt)
-                               {
-/* debug fprintf(diagfile, " lt=%d, rt=%d, op=%d\n", lt, rt, op); */
-/* debug fatal("impossible conversion.  possible compiler bug"); */
-                               ERR("impossible conversion")
-                               }
-               return(lt);
-
-       case OPMIN:
-       case OPMAX:
-       case OPBITOR:
-       case OPBITAND:
-       case OPBITXOR:
-       case OPBITNOT:
-       case OPLSHIFT:
-       case OPRSHIFT:
-               return(lt);
-
-       case OPCOMMA:
-       case OPQUEST:
-       case OPCOLON:
-               return(rt);
-
-       default:
-               fatal1("cktype: impossible opcode %d", op);
-       }
-error: err(errs);
-error1:        return(TYERROR);
-}
-\f
-LOCAL expptr fold(e)
-register struct exprblock *e;
-{
-struct constblock *p;
-#ifdef VERSION6
-       expptr lp, rp;
-#else
-       register expptr lp, rp;
-#endif
-int etype, mtype, ltype, rtype, opcode;
-int i, ll, lr;
-char *q, *s;
-union constant lcon, rcon;
-
-opcode = e->opcode;
-etype = e->vtype;
-
-lp = e->leftp;
-ltype = lp->vtype;
-rp = e->rightp;
-
-if(rp == 0)
-       switch(opcode)
-               {
-               case OPNOT:
-                       lp->const.ci = ! lp->const.ci;
-                       return(lp);
-
-               case OPBITNOT:
-                       lp->const.ci = ~ lp->const.ci;
-                       return(lp);
-
-               case OPNEG:
-                       consnegop(lp);
-                       return(lp);
-
-               case OPCONV:
-               case OPADDR:
-                       return(e);
-
-               default:
-                       fatal1("fold: invalid unary operator %d", opcode);
-               }
-
-rtype = rp->vtype;
-
-p = ALLOC(constblock);
-p->tag = TCONST;
-p->vtype = etype;
-p->vleng = e->vleng;
-
-switch(opcode)
-       {
-       case OPCOMMA:
-       case OPQUEST:
-       case OPCOLON:
-               return(e);
-
-       case OPAND:
-               p->const.ci = lp->const.ci && rp->const.ci;
-               break;
-
-       case OPOR:
-               p->const.ci = lp->const.ci || rp->const.ci;
-               break;
-
-       case OPEQV:
-               p->const.ci = lp->const.ci == rp->const.ci;
-               break;
-
-       case OPNEQV:
-               p->const.ci = lp->const.ci != rp->const.ci;
-               break;
-
-       case OPBITAND:
-               p->const.ci = lp->const.ci & rp->const.ci;
-               break;
-
-       case OPBITOR:
-               p->const.ci = lp->const.ci | rp->const.ci;
-               break;
-
-       case OPBITXOR:
-               p->const.ci = lp->const.ci ^ rp->const.ci;
-               break;
-
-       case OPLSHIFT:
-               p->const.ci = lp->const.ci << rp->const.ci;
-               break;
-
-       case OPRSHIFT:
-               p->const.ci = lp->const.ci >> rp->const.ci;
-               break;
-
-       case OPCONCAT:
-               ll = lp->vleng->const.ci;
-               lr = rp->vleng->const.ci;
-               p->const.ccp = q = (char *) ckalloc(ll+lr);
-               p->vleng = ICON(ll+lr);
-               s = lp->const.ccp;
-               for(i = 0 ; i < ll ; ++i)
-                       *q++ = *s++;
-               s = rp->const.ccp;
-               for(i = 0; i < lr; ++i)
-                       *q++ = *s++;
-               break;
-
-
-       case OPPOWER:
-               if( ! ISINT(rtype) )
-                       return(e);
-               conspower(&(p->const), lp, rp->const.ci);
-               break;
-
-
-       default:
-               if(ltype == TYCHAR)
-                       {
-                       lcon.ci = cmpstr(lp->const.ccp, rp->const.ccp,
-                                       lp->vleng->const.ci, rp->vleng->const.ci);
-                       rcon.ci = 0;
-                       mtype = tyint;
-                       }
-               else    {
-                       mtype = maxtype(ltype, rtype);
-                       consconv(mtype, &lcon, ltype, &(lp->const) );
-                       consconv(mtype, &rcon, rtype, &(rp->const) );
-                       }
-               consbinop(opcode, mtype, &(p->const), &lcon, &rcon);
-               break;
-       }
-
-frexpr(e);
-return(p);
-}
-
-
-
-/* assign constant l = r , doing coercion */
-
-consconv(lt, lv, rt, rv)
-int lt, rt;
-register union constant *lv, *rv;
-{
-switch(lt)
-       {
-       case TYCHAR:
-               *(lv->ccp = ckalloc(1)) = rv->ci;
-               break;
-
-       case TYSHORT:
-       case TYLONG:
-               if(rt == TYCHAR)
-                       lv->ci = rv->ccp[0];
-               else if( ISINT(rt) )
-                       lv->ci = rv->ci;
-               else    lv->ci = rv->cd[0];
-               break;
-
-       case TYCOMPLEX:
-       case TYDCOMPLEX:
-               switch(rt)
-                       {
-                       case TYSHORT:
-                       case TYLONG:
-                               /* fall through and do real assignment of
-                                  first element
-                               */
-                       case TYREAL:
-                       case TYDREAL:
-                               lv->cd[1] = 0; break;
-                       case TYCOMPLEX:
-                       case TYDCOMPLEX:
-                               lv->cd[1] = rv->cd[1]; break;
-                       }
-
-       case TYREAL:
-       case TYDREAL:
-               if( ISINT(rt) )
-                       lv->cd[0] = rv->ci;
-               else    lv->cd[0] = rv->cd[0];
-               break;
-
-       case TYLOGICAL:
-               lv->ci = rv->ci;
-               break;
-       }
-}
-
-
-
-consnegop(p)
-register struct constblock *p;
-{
-switch(p->vtype)
-       {
-       case TYSHORT:
-       case TYLONG:
-               p->const.ci = - p->const.ci;
-               break;
-
-       case TYCOMPLEX:
-       case TYDCOMPLEX:
-               p->const.cd[1] = - p->const.cd[1];
-               /* fall through and do the real parts */
-       case TYREAL:
-       case TYDREAL:
-               p->const.cd[0] = - p->const.cd[0];
-               break;
-       default:
-               fatal1("consnegop: impossible type %d", p->vtype);
-       }
-}
-
-
-
-LOCAL conspower(powp, ap, n)
-register union constant *powp;
-struct constblock *ap;
-ftnint n;
-{
-register int type;
-union constant x;
-
-switch(type = ap->vtype)       /* pow = 1 */ 
-       {
-       case TYSHORT:
-       case TYLONG:
-               powp->ci = 1;
-               break;
-       case TYCOMPLEX:
-       case TYDCOMPLEX:
-               powp->cd[1] = 0;
-       case TYREAL:
-       case TYDREAL:
-               powp->cd[0] = 1;
-               break;
-       default:
-               fatal1("conspower: invalid type %d", type);
-       }
-
-if(n == 0)
-       return;
-if(n < 0)
-       {
-       if( ISINT(type) )
-               {
-               err("integer ** negative power ");
-               return;
-               }
-       n = - n;
-       consbinop(OPSLASH, type, &x, powp, &(ap->const));
-       }
-else
-       consbinop(OPSTAR, type, &x, powp, &(ap->const));
-
-for( ; ; )
-       {
-       if(n & 01)
-               consbinop(OPSTAR, type, powp, powp, &x);
-       if(n >>= 1)
-               consbinop(OPSTAR, type, &x, &x, &x);
-       else
-               break;
-       }
-}
-
-
-
-/* do constant operation cp = a op b */
-
-
-LOCAL consbinop(opcode, type, cp, ap, bp)
-int opcode, type;
-register union constant *ap, *bp, *cp;
-{
-int k;
-double temp;
-
-switch(opcode)
-       {
-       case OPPLUS:
-               switch(type)
-                       {
-                       case TYSHORT:
-                       case TYLONG:
-                               cp->ci = ap->ci + bp->ci;
-                               break;
-                       case TYCOMPLEX:
-                       case TYDCOMPLEX:
-                               cp->cd[1] = ap->cd[1] + bp->cd[1];
-                       case TYREAL:
-                       case TYDREAL:
-                               cp->cd[0] = ap->cd[0] + bp->cd[0];
-                               break;
-                       }
-               break;
-
-       case OPMINUS:
-               switch(type)
-                       {
-                       case TYSHORT:
-                       case TYLONG:
-                               cp->ci = ap->ci - bp->ci;
-                               break;
-                       case TYCOMPLEX:
-                       case TYDCOMPLEX:
-                               cp->cd[1] = ap->cd[1] - bp->cd[1];
-                       case TYREAL:
-                       case TYDREAL:
-                               cp->cd[0] = ap->cd[0] - bp->cd[0];
-                               break;
-                       }
-               break;
-
-       case OPSTAR:
-               switch(type)
-                       {
-                       case TYSHORT:
-                       case TYLONG:
-                               cp->ci = ap->ci * bp->ci;
-                               break;
-                       case TYREAL:
-                       case TYDREAL:
-                               cp->cd[0] = ap->cd[0] * bp->cd[0];
-                               break;
-                       case TYCOMPLEX:
-                       case TYDCOMPLEX:
-                               temp = ap->cd[0] * bp->cd[0] -
-                                           ap->cd[1] * bp->cd[1] ;
-                               cp->cd[1] = ap->cd[0] * bp->cd[1] +
-                                           ap->cd[1] * bp->cd[0] ;
-                               cp->cd[0] = temp;
-                               break;
-                       }
-               break;
-       case OPSLASH:
-               switch(type)
-                       {
-                       case TYSHORT:
-                       case TYLONG:
-                               cp->ci = ap->ci / bp->ci;
-                               break;
-                       case TYREAL:
-                       case TYDREAL:
-                               cp->cd[0] = ap->cd[0] / bp->cd[0];
-                               break;
-                       case TYCOMPLEX:
-                       case TYDCOMPLEX:
-                               zdiv(cp,ap,bp);
-                               break;
-                       }
-               break;
-
-       case OPMOD:
-               if( ISINT(type) )
-                       {
-                       cp->ci = ap->ci % bp->ci;
-                       break;
-                       }
-               else
-                       fatal("inline mod of noninteger");
-
-       default:          /* relational ops */
-               switch(type)
-                       {
-                       case TYSHORT:
-                       case TYLONG:
-                               if(ap->ci < bp->ci)
-                                       k = -1;
-                               else if(ap->ci == bp->ci)
-                                       k = 0;
-                               else    k = 1;
-                               break;
-                       case TYREAL:
-                       case TYDREAL:
-                               if(ap->cd[0] < bp->cd[0])
-                                       k = -1;
-                               else if(ap->cd[0] == bp->cd[0])
-                                       k = 0;
-                               else    k = 1;
-                               break;
-                       case TYCOMPLEX:
-                       case TYDCOMPLEX:
-                               if(ap->cd[0] == bp->cd[0] &&
-                                  ap->cd[1] == bp->cd[1] )
-                                       k = 0;
-                               else    k = 1;
-                               break;
-                       }
-
-               switch(opcode)
-                       {
-                       case OPEQ:
-                               cp->ci = (k == 0);
-                               break;
-                       case OPNE:
-                               cp->ci = (k != 0);
-                               break;
-                       case OPGT:
-                               cp->ci = (k == 1);
-                               break;
-                       case OPLT:
-                               cp->ci = (k == -1);
-                               break;
-                       case OPGE:
-                               cp->ci = (k >= 0);
-                               break;
-                       case OPLE:
-                               cp->ci = (k <= 0);
-                               break;
-                       }
-               break;
-       }
-}
-
-
-
-
-conssgn(p)
-register expptr p;
-{
-if( ! ISCONST(p) )
-       fatal( "sgn(nonconstant)" );
-
-switch(p->vtype)
-       {
-       case TYSHORT:
-       case TYLONG:
-               if(p->const.ci > 0) return(1);
-               if(p->const.ci < 0) return(-1);
-               return(0);
-
-       case TYREAL:
-       case TYDREAL:
-               if(p->const.cd[0] > 0) return(1);
-               if(p->const.cd[0] < 0) return(-1);
-               return(0);
-
-       case TYCOMPLEX:
-       case TYDCOMPLEX:
-               return(p->const.cd[0]!=0 || p->const.cd[1]!=0);
-
-       default:
-               fatal1( "conssgn(type %d)", p->vtype);
-       }
-/* NOTREACHED */
-}
-\f
-char *powint[ ] = { "pow_ii", "pow_ri", "pow_di", "pow_ci", "pow_zi" };
-
-
-LOCAL expptr mkpower(p)
-register struct exprblock *p;
-{
-register expptr q, lp, rp;
-int ltype, rtype, mtype;
-
-lp = p->leftp;
-rp = p->rightp;
-ltype = lp->vtype;
-rtype = rp->vtype;
-
-if(ISICON(rp))
-       {
-       if(rp->const.ci == 0)
-               {
-               frexpr(p);
-               if( ISINT(ltype) )
-                       return( ICON(1) );
-               else
-                       return( putconst( mkconv(ltype, ICON(1))) );
-               }
-       if(rp->const.ci < 0)
-               {
-               if( ISINT(ltype) )
-                       {
-                       frexpr(p);
-                       err("integer**negative");
-                       return( errnode() );
-                       }
-               rp->const.ci = - rp->const.ci;
-               p->leftp = lp = fixexpr(mkexpr(OPSLASH, ICON(1), lp));
-               }
-       if(rp->const.ci == 1)
-               {
-               frexpr(rp);
-               free(p);
-               return(lp);
-               }
-
-       if( ONEOF(ltype, MSKINT|MSKREAL) )
-               {
-               p->vtype = ltype;
-               return(p);
-               }
-       }
-if( ISINT(rtype) )
-       {
-       if(ltype==TYSHORT && rtype==TYSHORT && (!ISCONST(lp) || tyint==TYSHORT) )
-               q = call2(TYSHORT, "pow_hh", lp, rp);
-       else    {
-               if(ltype == TYSHORT)
-                       {
-                       ltype = TYLONG;
-                       lp = mkconv(TYLONG,lp);
-                       }
-               q = call2(ltype, powint[ltype-TYLONG], lp, mkconv(TYLONG, rp));
-               }
-       }
-else if( ISREAL( (mtype = maxtype(ltype,rtype)) ))
-       q = call2(mtype, "pow_dd",
-               mkconv(TYDREAL,lp), mkconv(TYDREAL,rp));
-else   {
-       q = call2(TYDCOMPLEX, "pow_zz",
-               mkconv(TYDCOMPLEX,lp), mkconv(TYDCOMPLEX,rp));
-       if(mtype == TYCOMPLEX)
-               q = mkconv(TYCOMPLEX, q);
-       }
-free(p);
-return(q);
-}
-\f
-
-
-/* Complex Division.  Same code as in Runtime Library
-*/
-
-struct dcomplex { double dreal, dimag; };
-
-
-LOCAL zdiv(c, a, b)
-register struct dcomplex *a, *b, *c;
-{
-double ratio, den;
-double abr, abi;
-
-if( (abr = b->dreal) < 0.)
-       abr = - abr;
-if( (abi = b->dimag) < 0.)
-       abi = - abi;
-if( abr <= abi )
-       {
-       if(abi == 0)
-               fatal("complex division by zero");
-       ratio = b->dreal / b->dimag ;
-       den = b->dimag * (1 + ratio*ratio);
-       c->dreal = (a->dreal*ratio + a->dimag) / den;
-       c->dimag = (a->dimag*ratio - a->dreal) / den;
-       }
-
-else
-       {
-       ratio = b->dimag / b->dreal ;
-       den = b->dreal * (1 + ratio*ratio);
-       c->dreal = (a->dreal + a->dimag*ratio) / den;
-       c->dimag = (a->dimag - a->dreal*ratio) / den;
-       }
-
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/fio.h b/.ref-Research-V7/usr/src/cmd/f77/fio.h
deleted file mode 100644 (file)
index 1ebe1f4..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#include <stdio.h>
-typedef long ftnint;
-typedef ftnint flag;
-typedef long ftnlen;
-/*external read, write*/
-typedef struct
-{      flag cierr;
-       ftnint ciunit;
-       flag ciend;
-       char *cifmt;
-       ftnint cirec;
-} cilist;
-/*internal read, write*/
-typedef struct
-{      flag icierr;
-       char *iciunit;
-       flag iciend;
-       char *icifmt;
-       ftnint icirlen;
-       ftnint icirnum;
-} icilist;
-/*open*/
-typedef struct
-{      flag oerr;
-       ftnint ounit;
-       char *ofnm;
-       ftnlen ofnmlen;
-       char *osta;
-       char *oacc;
-       char *ofm;
-       ftnint orl;
-       char *oblnk;
-} olist;
-/*close*/
-typedef struct
-{      flag cerr;
-       ftnint cunit;
-       char *csta;
-} cllist;
-/*rewind, backspace, endfile*/
-typedef struct
-{      flag aerr;
-       ftnint aunit;
-} alist;
-/*units*/
-typedef struct
-{      FILE *ufd;      /*0=unconnected*/
-       char *ufnm;
-       long uinode;
-       int url;        /*0=sequential*/
-       flag useek;     /*true=can backspace, use dir, ...*/
-       flag ufmt;
-       flag uprnt;
-       flag ublnk;
-       flag uend;
-       flag uwrt;      /*last io was write*/
-       flag uscrtch;
-} unit;
-typedef struct
-{      flag inerr;
-       ftnint inunit;
-       char *infile;
-       ftnlen infilen;
-       ftnint  *inex;  /*parameters in standard's order*/
-       ftnint  *inopen;
-       ftnint  *innum;
-       ftnint  *innamed;
-       char    *inname;
-       ftnlen  innamlen;
-       char    *inacc;
-       ftnlen  inacclen;
-       char    *inseq;
-       ftnlen  inseqlen;
-       char    *indir;
-       ftnlen  indirlen;
-       char    *infmt;
-       ftnlen  infmtlen;
-       char    *inform;
-       ftnint  informlen;
-       char    *inunf;
-       ftnlen  inunflen;
-       ftnint  *inrecl;
-       ftnint  *innrec;
-       char    *inblank;
-       ftnlen  inblanklen;
-} inlist;
-
-extern int errno;
-extern flag init;
-extern cilist *elist;  /*active external io list*/
-extern flag reading,external,sequential,formatted;
-extern int (*getn)(),(*putn)();        /*for formatted io*/
-extern FILE *cf;       /*current file*/
-extern unit *curunit;  /*current unit*/
-extern unit units[];
-#define err(f,n,s) {if(f) errno= n; else fatal(n,s); return(n);}
-
-/*Table sizes*/
-#define MXUNIT 10
-
-extern int recpos;     /*position in current record*/
diff --git a/.ref-Research-V7/usr/src/cmd/f77/ftypes b/.ref-Research-V7/usr/src/cmd/f77/ftypes
deleted file mode 100644 (file)
index 8cb28b3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-
-/* variable types
- * numeric assumptions:
- *     int < reals < complexes
- *     TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX
- */
-
-#define TYUNKNOWN 0
-#define TYADDR 1
-#define TYSHORT 2
-#define TYLONG 3
-#define TYREAL 4
-#define TYDREAL 5
-#define TYCOMPLEX 6
-#define TYDCOMPLEX 7
-#define TYLOGICAL 8
-#define TYCHAR 9
-#define TYSUBR 10
-#define TYERROR 11
-
-#define NTYPES (TYERROR+1)
diff --git a/.ref-Research-V7/usr/src/cmd/f77/gram.dcl b/.ref-Research-V7/usr/src/cmd/f77/gram.dcl
deleted file mode 100644 (file)
index 4a911fb..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-spec:    dcl
-       | common
-       | external
-       | intrinsic
-       | equivalence
-       | data
-       | implicit
-       | SSAVE
-               { saveall = YES; }
-       | SSAVE savelist
-       | SFORMAT
-               { fmtstmt(thislabel); setfmt(thislabel); }
-       | SPARAM in_dcl SLPAR paramlist SRPAR
-       ;
-
-dcl:     type name in_dcl lengspec dims
-               { settype($2, $1, $4);
-                 if(ndim>0) setbound($2,ndim,dims);
-               }
-       | dcl SCOMMA name lengspec dims
-               { settype($3, $1, $4);
-                 if(ndim>0) setbound($3,ndim,dims);
-               }
-       ;
-
-type:    typespec lengspec
-               { varleng = $2; }
-       ;
-
-typespec:  typename
-               { varleng = ($1<0 || $1==TYLONG ? 0 : typesize[$1]); }
-       ;
-
-typename:    SINTEGER  { $$ = TYLONG; }
-       | SREAL         { $$ = TYREAL; }
-       | SCOMPLEX      { $$ = TYCOMPLEX; }
-       | SDOUBLE       { $$ = TYDREAL; }
-       | SDCOMPLEX     { $$ = TYDCOMPLEX; }
-       | SLOGICAL      { $$ = TYLOGICAL; }
-       | SCHARACTER    { $$ = TYCHAR; }
-       | SUNDEFINED    { $$ = TYUNKNOWN; }
-       | SDIMENSION    { $$ = TYUNKNOWN; }
-       | SAUTOMATIC    { $$ = - STGAUTO; }
-       | SSTATIC       { $$ = - STGBSS; }
-       ;
-
-lengspec:
-               { $$ = varleng; }
-       | SSTAR expr
-               {
-                 if( ! ISICON($2) )
-                       {
-                       $$ = 0;
-                       dclerr("length must be an integer constant", 0);
-                       }
-                 else $$ = $2->const.ci;
-               }
-       | SSTAR SLPAR SSTAR SRPAR
-               { $$ = 0; }
-       ;
-
-common:          SCOMMON in_dcl var
-               { incomm( $$ = comblock(0, 0) , $3 ); }
-       | SCOMMON in_dcl comblock var
-               { $$ = $3;  incomm($3, $4); }
-       | common opt_comma comblock opt_comma var
-               { $$ = $3;  incomm($3, $5); }
-       | common SCOMMA var
-               { incomm($1, $3); }
-       ;
-
-comblock:  SCONCAT
-               { $$ = comblock(0, 0); }
-       | SSLASH SNAME SSLASH
-               { $$ = comblock(toklen, token); }
-       ;
-
-external: SEXTERNAL in_dcl name
-               { setext($3); }
-       | external SCOMMA name
-               { setext($3); }
-       ;
-
-intrinsic:  SINTRINSIC in_dcl name
-               { setintr($3); }
-       | intrinsic SCOMMA name
-               { setintr($3); }
-       ;
-
-equivalence:  SEQUIV in_dcl equivset
-       | equivalence SCOMMA equivset
-       ;
-
-equivset:  SLPAR equivlist SRPAR
-               {
-               struct equivblock *p;
-               if(nequiv >= MAXEQUIV)
-                       fatal("too many equivalences");
-               p  =  & eqvclass[nequiv++];
-               p->eqvinit = 0;
-               p->eqvbottom = 0;
-               p->eqvtop = 0;
-               p->equivs = $2;
-               }
-       ;
-
-equivlist:  lhs
-               { $$ = ALLOC(eqvchain); $$->eqvitem = $1; }
-       | equivlist SCOMMA lhs
-               { $$ = ALLOC(eqvchain); $$->eqvitem = $3; $$->nextp = $1; }
-       ;
-
-data:    SDATA in_data datalist
-       | data opt_comma datalist
-       ;
-
-in_data:
-               { if(parstate == OUTSIDE)
-                       {
-                       newproc();
-                       startproc(0, CLMAIN);
-                       }
-                 if(parstate < INDATA)
-                       {
-                       enddcl();
-                       parstate = INDATA;
-                       }
-               }
-       ;
-
-datalist:  datavarlist SSLASH vallist SSLASH
-               { ftnint junk;
-                 if(nextdata(&junk,&junk) != NULL)
-                       {
-                       err("too few initializers");
-                       curdtp = NULL;
-                       }
-                 frdata($1);
-                 frrpl();
-               }
-       ;
-
-vallist:  { toomanyinit = NO; }  val
-       | vallist SCOMMA val
-       ;
-
-val:     value
-               { dataval(NULL, $1); }
-       | simple SSTAR value
-               { dataval($1, $3); }
-       ;
-
-value:   simple
-       | addop simple
-               { if( $1==OPMINUS && ISCONST($2) )
-                       consnegop($2);
-                 $$ = $2;
-               }
-       | complex_const
-       | bit_const
-       ;
-
-savelist: saveitem
-       | savelist SCOMMA saveitem
-       ;
-
-saveitem: name
-               { int k;
-                 $1->vsave = 1;
-                 k = $1->vstg;
-               if( ! ONEOF(k, M(STGUNKNOWN)|M(STGBSS)|M(STGINIT)) )
-                       dclerr("can only save static variables", $1);
-               }
-       | comblock
-               { $1->extsave = 1; }
-       ;
-
-paramlist:  paramitem
-       | paramlist SCOMMA paramitem
-       ;
-
-paramitem:  name SEQUALS expr
-               { if($1->vclass == CLUNKNOWN)
-                       { $1->vclass = CLPARAM;
-                         $1->paramval = $3;
-                       }
-                 else dclerr("cannot make %s parameter", $1);
-               }
-       ;
-
-var:     name dims
-               { if(ndim>0) setbounds($1, ndim, dims); }
-       ;
-
-datavar:         lhs
-               { ptr np;
-                 vardcl(np = $1->namep);
-                 if(np->vstg == STGBSS)
-                       np->vstg = STGINIT;
-                 else if(np->vstg == STGCOMMON)
-                       extsymtab[np->vardesc.varno].extinit = YES;
-                 else if(np->vstg==STGEQUIV)
-                       eqvclass[np->vardesc.varno].eqvinit = YES;
-                 else if(np->vstg != STGINIT)
-                       dclerr("inconsistent storage classes", np);
-                 $$ = mkchain($1, 0);
-               }
-       | SLPAR datavarlist SCOMMA dospec SRPAR
-               { chainp p; struct impldoblock *q;
-               q = ALLOC(impldoblock);
-               q->tag = TIMPLDO;
-               q->varnp = $4->datap;
-               p = $4->nextp;
-               if(p)  { q->implb = p->datap; p = p->nextp; }
-               if(p)  { q->impub = p->datap; p = p->nextp; }
-               if(p)  { q->impstep = p->datap; p = p->nextp; }
-               frchain( & ($4) );
-               $$ = mkchain(q, 0);
-               q->datalist = hookup($2, $$);
-               }
-       ;
-
-datavarlist: datavar
-               { curdtp = $1; curdtelt = 0; }
-       | datavarlist SCOMMA datavar
-               { $$ = hookup($1, $3); }
-       ;
-
-dims:
-               { ndim = 0; }
-       | SLPAR dimlist SRPAR
-       ;
-
-dimlist:   { ndim = 0; }   dim
-       | dimlist SCOMMA dim
-       ;
-
-dim:     ubound
-               { dims[ndim].lb = 0;
-                 dims[ndim].ub = $1;
-                 ++ndim;
-               }
-       | expr SCOLON ubound
-               { dims[ndim].lb = $1;
-                 dims[ndim].ub = $3;
-                 ++ndim;
-               }
-       ;
-
-ubound:          SSTAR
-               { $$ = 0; }
-       | expr
-       ;
-
-labellist: label
-               { nstars = 1; labarray[0] = $1; }
-       | labellist SCOMMA label
-               { if(nstars < MAXLABLIST)  labarray[nstars++] = $3; }
-       ;
-
-label:   labelval
-               { if($1->labinacc)
-                       warn1("illegal branch to inner block, statement %s",
-                               convic( (ftnint) ($1->stateno) ));
-                 else if($1->labdefined == NO)
-                       $1->blklevel = blklevel;
-                 $1->labused = YES;
-               }
-       ;
-
-labelval:   SICON
-               { $$ = mklabel( convci(toklen, token) ); }
-       ;
-
-implicit:  SIMPLICIT in_dcl implist
-       | implicit SCOMMA implist
-       ;
-
-implist:  imptype SLPAR letgroups SRPAR
-       ;
-
-imptype:   { needkwd = 1; } type
-               { vartype = $2; }
-       ;
-
-letgroups: letgroup
-       | letgroups SCOMMA letgroup
-       ;
-
-letgroup:  letter
-               { setimpl(vartype, varleng, $1, $1); }
-       | letter SMINUS letter
-               { setimpl(vartype, varleng, $1, $3); }
-       ;
-
-letter:  SNAME
-               { if(toklen!=1 || token[0]<'a' || token[0]>'z')
-                       {
-                       dclerr("implicit item must be single letter", 0);
-                       $$ = 0;
-                       }
-                 else $$ = token[0];
-               }
-       ;
-
-in_dcl:
-               { switch(parstate)      
-                       {
-                       case OUTSIDE:   newproc();
-                                       startproc(0, CLMAIN);
-                       case INSIDE:    parstate = INDCL;
-                       case INDCL:     break;
-
-                       default:
-                               dclerr("declaration among executables", 0);
-                       }
-               }
-       ;
diff --git a/.ref-Research-V7/usr/src/cmd/f77/gram.exec b/.ref-Research-V7/usr/src/cmd/f77/gram.exec
deleted file mode 100644 (file)
index c1199c0..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-exec:    iffable
-       | SDO end_spec label dospec
-               {
-               if($3->labdefined)
-                       execerr("no backward DO loops");
-               $3->blklevel = blklevel+1;
-               exdo($3->labelno, $4);
-               }
-       | logif iffable
-               { exendif();  thiswasbranch = NO; }
-       | logif STHEN
-       | SELSEIF end_spec SLPAR expr SRPAR STHEN
-               { exelif($4); }
-       | SELSE end_spec
-               { exelse(); }
-       | SENDIF end_spec
-               { exendif(); }
-       ;
-
-logif:   SLOGIF end_spec SLPAR expr SRPAR
-               { exif($4); }
-       ;
-
-dospec:          name SEQUALS exprlist
-               { $$ = mkchain($1, $3); }
-       ;
-
-iffable:  let lhs SEQUALS expr
-               { exequals($2, $4); }
-       | SASSIGN end_spec labelval STO name
-               { exassign($5, $3); }
-       | SCONTINUE end_spec
-       | goto
-       | io
-               { inioctl = NO; }
-       | SARITHIF end_spec SLPAR expr SRPAR label SCOMMA label SCOMMA label
-               { exarif($4, $6, $8, $10);  thiswasbranch = YES; }
-       | call
-               { excall($1, 0, 0, labarray); }
-       | call SLPAR SRPAR
-               { excall($1, 0, 0, labarray); }
-       | call SLPAR callarglist SRPAR
-               { if(nstars < MAXLABLIST)
-                       excall($1, mklist($3), nstars, labarray);
-                 else
-                       err("too many alternate returns");
-               }
-       | SRETURN end_spec opt_expr
-               { exreturn($3);  thiswasbranch = YES; }
-       | stop end_spec opt_expr
-               { exstop($1, $3);  thiswasbranch = $1; }
-       ;
-
-let:     SLET
-               { if(parstate == OUTSIDE)
-                       {
-                       newproc();
-                       startproc(0, CLMAIN);
-                       }
-               }
-       ;
-
-goto:    SGOTO end_spec label
-               { exgoto($3);  thiswasbranch = YES; }
-       | SASGOTO end_spec name
-               { exasgoto($3);  thiswasbranch = YES; }
-       | SASGOTO end_spec name opt_comma SLPAR labellist SRPAR
-               { exasgoto($3);  thiswasbranch = YES; }
-       | SCOMPGOTO end_spec SLPAR labellist SRPAR opt_comma expr
-               { if(nstars < MAXLABLIST)
-                       putcmgo(fixtype($7), nstars, labarray);
-                 else
-                       err("computed GOTO list too long");
-               }
-       ;
-
-opt_comma:
-       | SCOMMA
-       ;
-
-call:    SCALL end_spec name
-               { nstars = 0; $$ = $3; }
-       ;
-
-callarglist:  callarg
-               { $$ = ($1 ? mkchain($1,0) : 0); }
-       | callarglist SCOMMA callarg
-               { if($3)
-                       if($1) $$ = hookup($1, mkchain($3,0));
-                       else $$ = mkchain($3,0);
-               }
-       ;
-
-callarg:  expr
-       | SSTAR label
-               { if(nstars<MAXLABLIST) labarray[nstars++] = $2; $$ = 0; }
-       ;
-
-stop:    SPAUSE
-               { $$ = 0; }
-       | SSTOP
-               { $$ = 1; }
-       ;
-
-exprlist:  expr
-               { $$ = mkchain($1, 0); }
-       | exprlist SCOMMA expr
-               { $$ = hookup($1, mkchain($3,0) ); }
-       ;
-
-end_spec:
-               { if(parstate == OUTSIDE)
-                       {
-                       newproc();
-                       startproc(0, CLMAIN);
-                       }
-                 if(parstate < INDATA) enddcl();
-               }
-       ;
diff --git a/.ref-Research-V7/usr/src/cmd/f77/gram.expr b/.ref-Research-V7/usr/src/cmd/f77/gram.expr
deleted file mode 100644 (file)
index 4491d0b..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-funarglist:
-               { $$ = 0; }
-       | funargs
-       ;
-
-funargs:  expr
-               { $$ = mkchain($1, 0); }
-       | funargs SCOMMA expr
-               { $$ = hookup($1, mkchain($3,0) ); }
-       ;
-
-
-expr:    uexpr
-       | SLPAR expr SRPAR      { $$ = $2; }
-       | complex_const
-       ;
-
-uexpr:   lhs
-       | simple_const
-       | expr addop expr   %prec SPLUS
-               { $$ = mkexpr($2, $1, $3); }
-       | expr SSTAR expr
-               { $$ = mkexpr(OPSTAR, $1, $3); }
-       | expr SSLASH expr
-               { $$ = mkexpr(OPSLASH, $1, $3); }
-       | expr SPOWER expr
-               { $$ = mkexpr(OPPOWER, $1, $3); }
-       | addop expr  %prec SSTAR
-               { if($1 == OPMINUS)
-                       $$ = mkexpr(OPNEG, $2, 0);
-                 else  $$ = $2;
-               }
-       | expr relop expr  %prec SEQ
-               { $$ = mkexpr($2, $1, $3); }
-       | expr SEQV expr
-               { $$ = mkexpr(OPEQV, $1,$3); }
-       | expr SNEQV expr
-               { $$ = mkexpr(OPNEQV, $1, $3); }
-       | expr SOR expr
-               { $$ = mkexpr(OPOR, $1, $3); }
-       | expr SAND expr
-               { $$ = mkexpr(OPAND, $1, $3); }
-       | SNOT expr
-               { $$ = mkexpr(OPNOT, $2, 0); }
-       | expr SCONCAT expr
-               { $$ = mkexpr(OPCONCAT, $1, $3); }
-       ;
-
-addop:   SPLUS         { $$ = OPPLUS; }
-       | SMINUS        { $$ = OPMINUS; }
-       ;
-
-relop:   SEQ   { $$ = OPEQ; }
-       | SGT   { $$ = OPGT; }
-       | SLT   { $$ = OPLT; }
-       | SGE   { $$ = OPGE; }
-       | SLE   { $$ = OPLE; }
-       | SNE   { $$ = OPNE; }
-       ;
-
-lhs:    name
-               { $$ = mkprim($1, 0, 0, 0); }
-       | name SLPAR opt_expr SCOLON opt_expr SRPAR
-               { $$ = mkprim($1, 0, $3, $5); }
-       | name SLPAR funarglist SRPAR
-               { $$ = mkprim($1, mklist($3), 0, 0); }
-       | name SLPAR funarglist SRPAR SLPAR opt_expr SCOLON opt_expr SRPAR
-               { $$ = mkprim($1, mklist($3), $6, $8); }
-       ;
-
-opt_expr:
-               { $$ = 0; }
-       | expr
-       ;
-
-simple:          name
-               { if($1->vclass == CLPARAM)
-                       $$ = cpexpr($1->paramval);
-               }
-       | simple_const
-       ;
-
-simple_const:   STRUE  { $$ = mklogcon(1); }
-       | SFALSE        { $$ = mklogcon(0); }
-       | SHOLLERITH  { $$ = mkstrcon(toklen, token); }
-       | SICON = { $$ = mkintcon( convci(toklen, token) ); }
-       | SRCON = { $$ = mkrealcon(TYREAL, convcd(toklen, token)); }
-       | SDCON = { $$ = mkrealcon(TYDREAL, convcd(toklen, token)); }
-       ;
-
-complex_const:  SLPAR uexpr SCOMMA uexpr SRPAR
-               { $$ = mkcxcon($2,$4); }
-       ;
-
-bit_const:  SHEXCON
-               { $$ = mkbitcon(4, toklen, token); }
-       | SOCTCON
-               { $$ = mkbitcon(3, toklen, token); }
-       | SBITCON
-               { $$ = mkbitcon(1, toklen, token); }
-       ;
-
-fexpr:   unpar_fexpr
-       | SLPAR fexpr SRPAR
-               { $$ = $2; }
-       ;
-
-unpar_fexpr:     lhs
-       | simple_const
-       | fexpr addop fexpr   %prec SPLUS
-               { $$ = mkexpr($2, $1, $3); }
-       | fexpr SSTAR fexpr
-               { $$ = mkexpr(OPSTAR, $1, $3); }
-       | fexpr SSLASH fexpr
-               { $$ = mkexpr(OPSLASH, $1, $3); }
-       | fexpr SPOWER fexpr
-               { $$ = mkexpr(OPPOWER, $1, $3); }
-       | addop fexpr  %prec SSTAR
-               { if($1 == OPMINUS)
-                       $$ = mkexpr(OPNEG, $2, 0);
-                 else  $$ = $2;
-               }
-       | fexpr SCONCAT fexpr
-               { $$ = mkexpr(OPCONCAT, $1, $3); }
-       ;
diff --git a/.ref-Research-V7/usr/src/cmd/f77/gram.head b/.ref-Research-V7/usr/src/cmd/f77/gram.head
deleted file mode 100644 (file)
index a8a834f..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-%{
-#include "defs"
-
-static int nstars;
-static int ndim;
-static int vartype;
-static ftnint varleng;
-static struct { ptr lb, ub; } dims[8];
-static struct labelblock *labarray[MAXLABLIST];
-static int lastwasbranch = NO;
-static int thiswasbranch = NO;
-extern ftnint yystno;
-
-ftnint convci();
-double convcd();
-struct addrblock *nextdata(), *mkbitcon();
-struct constblock *mklogcon(), *mkaddcon(), *mkrealcon();
-struct constblock *mkstrcon(), *mkcxcon();
-struct listblock *mklist();
-struct listblock *mklist();
-struct impldoblock *mkiodo();
-struct extsym *comblock();
-
-%}
-
-/* Specify precedences and associativies. */
-
-%left SCOMMA
-%nonassoc SCOLON
-%right SEQUALS
-%left SEQV SNEQV
-%left SOR
-%left SAND
-%left SNOT
-%nonassoc SLT SGT SLE SGE SEQ SNE
-%left SCONCAT
-%left SPLUS SMINUS
-%left SSTAR SSLASH
-%right SPOWER
-
-%%
-
-program:
-       | program stat SEOS
-       ;
-
-stat:    thislabel entry
-               { lastwasbranch = NO; }
-       | thislabel  spec
-       | thislabel  exec
-               { if($1 && ($1->labelno==dorange))
-                       enddo($1->labelno);
-                 if(lastwasbranch && thislabel==NULL)
-                       warn1("statement cannot be reached");
-                 lastwasbranch = thiswasbranch;
-                 thiswasbranch = NO;
-               }
-       | thislabel SINCLUDE filename
-               { doinclude( $3 ); }
-       | thislabel  SEND  end_spec
-               { lastwasbranch = NO;  endproc(); }
-       | thislabel SUNKNOWN
-               { execerr("unclassifiable statement", 0);  flline(); };
-       | error
-               { flline();  needkwd = NO;  inioctl = NO; 
-                 yyerrok; yyclearin; }
-       ;
-
-thislabel:  SLABEL
-               {
-               if(yystno != 0)
-                       {
-                       $$ = thislabel =  mklabel(yystno);
-                       if( ! headerdone )
-                               puthead(NULL, procclass);
-                       if(thislabel->labdefined)
-                               execerr("label %s already defined",
-                                       convic(thislabel->stateno) );
-                       else    {
-                               if(thislabel->blklevel!=0 && thislabel->blklevel<blklevel
-                                   && thislabel->labtype!=LABFORMAT)
-                                       warn1("there is a branch to label %s from outside block",
-                                             convic( (ftnint) (thislabel->stateno) ) );
-                               thislabel->blklevel = blklevel;
-                               thislabel->labdefined = YES;
-                               if(thislabel->labtype != LABFORMAT)
-                                       putlabel(thislabel->labelno);
-                               }
-                       }
-               else    $$ = thislabel = NULL;
-               }
-       ;
-
-entry:   SPROGRAM new_proc progname
-               { startproc($3, CLMAIN); }
-       | SBLOCK new_proc progname
-               { startproc($3, CLBLOCK); }
-       | SSUBROUTINE new_proc entryname arglist
-               { entrypt(CLPROC, TYSUBR, (ftnint) 0,  $3, $4); }
-       | SFUNCTION new_proc entryname arglist
-               { entrypt(CLPROC, TYUNKNOWN, (ftnint) 0, $3, $4); }
-       | type SFUNCTION new_proc entryname arglist
-               { entrypt(CLPROC, $1, varleng, $4, $5); }
-       | SENTRY entryname arglist
-               { if(parstate==OUTSIDE || procclass==CLMAIN
-                       || procclass==CLBLOCK)
-                               execerr("misplaced entry statement", 0);
-                 entrypt(CLENTRY, 0, (ftnint) 0, $2, $3);
-               }
-       ;
-
-new_proc:
-               { newproc(); }
-       ;
-
-entryname:  name
-               { $$ = newentry($1); }
-       ;
-
-name:    SNAME
-               { $$ = mkname(toklen, token); }
-       ;
-
-progname:              { $$ = NULL; }
-       | entryname
-       ;
-
-arglist:
-               { $$ = 0; }
-       | SLPAR SRPAR
-               { $$ = 0; }
-       | SLPAR args SRPAR
-               {$$ = $2; }
-       ;
-
-args:    arg
-               { $$ = ($1 ? mkchain($1,0) : 0 ); }
-       | args SCOMMA arg
-               { if($3) $1 = $$ = hookup($1, mkchain($3,0)); }
-       ;
-
-arg:     name
-               { $1->vstg = STGARG; }
-       | SSTAR
-               { $$ = 0;  substars = YES; }
-       ;
-
-
-
-filename:   SHOLLERITH
-               {
-               char *s;
-               s = copyn(toklen+1, token);
-               s[toklen] = '\0';
-               $$ = s;
-               }
-       ;
diff --git a/.ref-Research-V7/usr/src/cmd/f77/gram.io b/.ref-Research-V7/usr/src/cmd/f77/gram.io
deleted file mode 100644 (file)
index 469214c..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-  /*  Input/Output Statements */
-
-io:      io1
-               { endio(); }
-       ;
-
-io1:     iofmove ioctl
-       | iofmove unpar_fexpr
-               { ioclause(IOSUNIT, $2); endioctl(); }
-       | iofctl ioctl
-       | read ioctl
-               { doio(NULL); }
-       | read ioctl inlist
-               { doio($3); }
-       | read infmt SCOMMA inlist
-               { doio($4); }
-       | read ioctl SCOMMA inlist
-               { doio($4); }
-       | write ioctl
-               { doio(NULL); }
-       | write ioctl outlist
-               { doio($3); }
-       | print
-               { doio(NULL); }
-       | print SCOMMA outlist
-               { doio($3); }
-       ;
-
-iofmove:   fmkwd end_spec in_ioctl
-       ;
-
-fmkwd:   SBACKSPACE
-               { iostmt = IOREWIND; }
-       | SREWIND
-               { iostmt = IOREWIND; }
-       | SENDFILE
-               { iostmt = IOENDFILE; }
-       ;
-
-iofctl:  ctlkwd end_spec in_ioctl
-       ;
-
-ctlkwd:          SINQUIRE
-               { iostmt = IOINQUIRE; }
-       | SOPEN
-               { iostmt = IOOPEN; }
-       | SCLOSE
-               { iostmt = IOCLOSE; }
-       ;
-
-infmt:   unpar_fexpr
-               {
-               ioclause(IOSUNIT, NULL);
-               ioclause(IOSFMT, $1);
-               endioctl();
-               }
-       | SSTAR
-               {
-               ioclause(IOSUNIT, NULL);
-               ioclause(IOSFMT, NULL);
-               endioctl();
-               }
-       ;
-
-ioctl:   SLPAR fexpr SRPAR
-               { ioclause(IOSUNIT, $2); endioctl(); }
-       | SLPAR ctllist SRPAR
-               { endioctl(); }
-       ;
-
-ctllist:  ioclause SCOMMA ioclause
-       | ctllist SCOMMA ioclause
-       ;
-
-ioclause:  fexpr
-               { ioclause(IOSPOSITIONAL, $1); }
-       | SSTAR
-               { ioclause(IOSPOSITIONAL, NULL); }
-       | nameeq expr
-               { ioclause($1, $2); }
-       | nameeq SSTAR
-               { ioclause($1, NULL); }
-       ;
-
-nameeq:  SNAMEEQ
-               { $$ = iocname(); }
-       ;
-
-read:    SREAD end_spec in_ioctl
-               { iostmt = IOREAD; }
-       ;
-
-write:   SWRITE end_spec in_ioctl
-               { iostmt = IOWRITE; }
-       ;
-
-print:   SPRINT end_spec fexpr in_ioctl
-               {
-               iostmt = IOWRITE;
-               ioclause(IOSUNIT, NULL);
-               ioclause(IOSFMT, $3);
-               endioctl();
-               }
-       | SPRINT end_spec SSTAR in_ioctl
-               {
-               iostmt = IOWRITE;
-               ioclause(IOSUNIT, NULL);
-               ioclause(IOSFMT, NULL);
-               endioctl();
-               }
-       ;
-
-inlist:          inelt
-               { $$ = mkchain($1,0); }
-       | inlist SCOMMA inelt
-               { $$ = hookup($1, mkchain($3,0)); }
-       ;
-
-inelt:   lhs
-       | SLPAR inlist SCOMMA dospec SRPAR
-               { $$ = mkiodo($4,$2); }
-       ;
-
-outlist:  uexpr
-               { $$ = mkchain($1, 0); }
-       | other
-               { $$ = mkchain($1, 0); }
-       | out2
-       ;
-
-out2:    uexpr SCOMMA uexpr
-               { $$ = mkchain($1, mkchain($3, 0) ); }
-       | uexpr SCOMMA other
-               { $$ = mkchain($1, mkchain($3, 0) ); }
-       | other SCOMMA uexpr
-               { $$ = mkchain($1, mkchain($3, 0) ); }
-       | other SCOMMA other
-               { $$ = mkchain($1, mkchain($3, 0) ); }
-       | out2  SCOMMA uexpr
-               { $$ = hookup($1, mkchain($3, 0) ); }
-       | out2  SCOMMA other
-               { $$ = hookup($1, mkchain($3, 0) ); }
-       ;
-
-other:   complex_const
-       | SLPAR uexpr SCOMMA dospec SRPAR
-               { $$ = mkiodo($4, mkchain($2, 0) ); }
-       | SLPAR other SCOMMA dospec SRPAR
-               { $$ = mkiodo($4, mkchain($2, 0) ); }
-       | SLPAR out2  SCOMMA dospec SRPAR
-               { $$ = mkiodo($4, $2); }
-       ;
-
-in_ioctl:
-               { startioctl(); }
-       ;
diff --git a/.ref-Research-V7/usr/src/cmd/f77/init.c b/.ref-Research-V7/usr/src/cmd/f77/init.c
deleted file mode 100644 (file)
index 0d7db8d..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-#include "defs"
-
-
-FILEP infile   = { stdin };
-FILEP diagfile = { stderr };
-
-FILEP textfile;
-FILEP asmfile;
-FILEP initfile;
-long int headoffset;
-
-char token[200];
-int toklen;
-int lineno;
-char *infname;
-int needkwd;
-struct labelblock *thislabel   = NULL;
-flag nowarnflag        = NO;
-flag ftn66flag = NO;
-flag profileflag       = NO;
-flag optimflag = NO;
-flag shiftcase = YES;
-flag undeftype = NO;
-flag shortsubs = YES;
-flag onetripflag       = NO;
-flag checksubs = NO;
-flag debugflag = NO;
-int nerr;
-int nwarn;
-int ndata;
-
-flag saveall;
-flag substars;
-int parstate   = OUTSIDE;
-flag headerdone        = NO;
-int blklevel;
-int impltype[26];
-int implleng[26];
-int implstg[26];
-
-int tyint      = TYLONG ;
-int tylogical  = TYLONG;
-ftnint typesize[NTYPES]
-       = { 1, SZADDR, SZSHORT, SZLONG, SZLONG, 2*SZLONG,
-           2*SZLONG, 4*SZLONG, SZLONG, 1, 1, 1};
-int typealign[NTYPES]
-       = { 1, ALIADDR, ALISHORT, ALILONG, ALILONG, ALIDOUBLE,
-           ALILONG, ALIDOUBLE, ALILONG, 1, 1, 1};
-int procno;
-int proctype   = TYUNKNOWN;
-char *procname;
-int rtvlabel[NTYPES];
-int fudgelabel;
-struct addrblock *typeaddr;
-struct addrblock *retslot;
-int cxslot     = -1;
-int chslot     = -1;
-int chlgslot   = -1;
-int procclass  = CLUNKNOWN;
-int nentry;
-flag multitype;
-ftnint procleng;
-int lastlabno  = 10;
-int lastvarno;
-int lastargslot;
-int argloc;
-ftnint autoleng;
-ftnint bssleng = 0;
-int retlabel;
-int ret0label;
-struct ctlframe ctls[MAXCTL];
-struct ctlframe *ctlstack      = ctls-1;
-struct ctlframe *lastctl       = ctls+MAXCTL ;
-
-struct nameblock *regnamep[MAXREGVAR];
-int highregvar;
-int nregvar;
-
-struct extsym extsymtab[MAXEXT];
-struct extsym *nextext = extsymtab;
-struct extsym *lastext = extsymtab+MAXEXT;
-
-struct equivblock eqvclass[MAXEQUIV];
-struct hashentry hashtab[MAXHASH];
-struct hashentry *lasthash     = hashtab+MAXHASH;
-
-struct labelblock labeltab[MAXSTNO];
-struct labelblock *labtabend   = labeltab+MAXSTNO;
-struct labelblock *highlabtab =        labeltab;
-struct rplblock *rpllist       = NULL;
-chainp curdtp  = NULL;
-flag toomanyinit;
-ftnint curdtelt;
-chainp templist        = NULL;
-chainp holdtemps       = NULL;
-int dorange    = 0;
-struct entrypoint *entries     = NULL;
-
-chainp chains  = NULL;
-
-flag inioctl;
-struct addrblock *ioblkp;
-int iostmt;
-int nioctl;
-int nequiv     = 0;
-int nintnames  = 0;
-int nextnames  = 0;
-
-struct literal litpool[MAXLITERALS];
-int nliterals;
-
-
-
-fileinit()
-{
-procno = 0;
-lastlabno = 10;
-lastvarno = 0;
-nextext = extsymtab;
-nliterals = 0;
-nerr = 0;
-ndata = 0;
-}
-
-
-
-
-
-procinit()
-{
-register struct nameblock *p;
-register struct dimblock *q;
-register struct hashentry *hp;
-register struct labelblock *lp;
-chainp cp;
-int i;
-
-pruse(asmfile, USECONST);
-#if FAMILY == SCJ
-       p2pass(USETEXT);
-#endif
-parstate = OUTSIDE;
-headerdone = NO;
-blklevel = 1;
-saveall = NO;
-substars = NO;
-nwarn = 0;
-thislabel = NULL;
-needkwd = 0;
-
-++procno;
-proctype = TYUNKNOWN;
-procname = "MAIN_    ";
-procclass = CLUNKNOWN;
-nentry = 0;
-multitype = NO;
-typeaddr = NULL;
-retslot = NULL;
-cxslot = -1;
-chslot = -1;
-chlgslot = -1;
-procleng = 0;
-blklevel = 1;
-lastargslot = 0;
-#if TARGET==PDP11
-       autoleng = 6;
-#else
-       autoleng = 0;
-#endif
-
-for(lp = labeltab ; lp < labtabend ; ++lp)
-       lp->stateno = 0;
-
-for(hp = hashtab ; hp < lasthash ; ++hp)
-       if(p = hp->varp)
-               {
-               frexpr(p->vleng);
-               if(q = p->vdim)
-                       {
-                       for(i = 0 ; i < q->ndim ; ++i)
-                               {
-                               frexpr(q->dims[i].dimsize);
-                               frexpr(q->dims[i].dimexpr);
-                               }
-                       frexpr(q->nelt);
-                       frexpr(q->baseoffset);
-                       frexpr(q->basexpr);
-                       free(q);
-                       }
-               free(p);
-               hp->varp = NULL;
-               }
-nintnames = 0;
-highlabtab = labeltab;
-
-ctlstack = ctls - 1;
-for(cp = templist ; cp ; cp = cp->nextp)
-       free(cp->datap);
-frchain(&templist);
-holdtemps = NULL;
-dorange = 0;
-nregvar = 0;
-highregvar = 0;
-entries = NULL;
-rpllist = NULL;
-inioctl = NO;
-ioblkp = NULL;
-nequiv = 0;
-
-for(i = 0 ; i<NTYPES ; ++i)
-       rtvlabel[i] = 0;
-fudgelabel = 0;
-
-if(undeftype)
-       setimpl(TYUNKNOWN, (ftnint) 0, 'a', 'z');
-else
-       {
-       setimpl(TYREAL, (ftnint) 0, 'a', 'z');
-       setimpl(tyint,  (ftnint) 0, 'i', 'n');
-       }
-setimpl(-STGBSS, (ftnint) 0, 'a', 'z');        /* set class */
-setlog();
-}
-
-
-
-
-setimpl(type, length, c1, c2)
-int type;
-ftnint length;
-int c1, c2;
-{
-int i;
-char buff[100];
-
-if(c1==0 || c2==0)
-       return;
-
-if(c1 > c2)
-       err( sprintf(buff, "characters out of order in implicit:%c-%c", c1, c2) );
-else
-       if(type < 0)
-               for(i = c1 ; i<=c2 ; ++i)
-                       implstg[i-'a'] = - type;
-       else
-               {
-               type = lengtype(type, (int) length);
-               if(type != TYCHAR)
-                       length = 0;
-               for(i = c1 ; i<=c2 ; ++i)
-                       {
-                       impltype[i-'a'] = type;
-                       implleng[i-'a'] = length;
-                       }
-               }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/intr.c b/.ref-Research-V7/usr/src/cmd/f77/intr.c
deleted file mode 100644 (file)
index 2922d48..0000000
+++ /dev/null
@@ -1,560 +0,0 @@
-#include "defs"
-
-union
-       {
-       int ijunk;
-       struct intrpacked bits;
-       } packed;
-
-struct intrbits
-       {
-       int intrgroup /* :3 */;
-       int intrstuff /* result type or number of generics */;
-       int intrno /* :7 */;
-       };
-
-LOCAL struct intrblock
-       {
-       char intrfname[VL];
-       struct intrbits intrval;
-       } intrtab[ ] =
-{
-"int",                 { INTRCONV, TYLONG },
-"real",        { INTRCONV, TYREAL },
-"dble",        { INTRCONV, TYDREAL },
-"cmplx",       { INTRCONV, TYCOMPLEX },
-"dcmplx",      { INTRCONV, TYDCOMPLEX },
-"ifix",        { INTRCONV, TYLONG },
-"idint",       { INTRCONV, TYLONG },
-"float",       { INTRCONV, TYREAL },
-"dfloat",      { INTRCONV, TYDREAL },
-"sngl",        { INTRCONV, TYREAL },
-"ichar",       { INTRCONV, TYLONG },
-"char",        { INTRCONV, TYCHAR },
-
-"max",                 { INTRMAX, TYUNKNOWN },
-"max0",        { INTRMAX, TYLONG },
-"amax0",       { INTRMAX, TYREAL },
-"max1",        { INTRMAX, TYLONG },
-"amax1",       { INTRMAX, TYREAL },
-"dmax1",       { INTRMAX, TYDREAL },
-
-"and",         { INTRBOOL, TYUNKNOWN, OPBITAND },
-"or",          { INTRBOOL, TYUNKNOWN, OPBITOR },
-"xor",         { INTRBOOL, TYUNKNOWN, OPBITXOR },
-"not",         { INTRBOOL, TYUNKNOWN, OPBITNOT },
-"lshift",      { INTRBOOL, TYUNKNOWN, OPLSHIFT },
-"rshift",      { INTRBOOL, TYUNKNOWN, OPRSHIFT },
-
-"min",                 { INTRMIN, TYUNKNOWN },
-"min0",        { INTRMIN, TYLONG },
-"amin0",       { INTRMIN, TYREAL },
-"min1",        { INTRMIN, TYLONG },
-"amin1",       { INTRMIN, TYREAL },
-"dmin1",       { INTRMIN, TYDREAL },
-
-"aint",        { INTRGEN, 2, 0 },
-"dint",        { INTRSPEC, TYDREAL, 1 },
-
-"anint",       { INTRGEN, 2, 2 },
-"dnint",       { INTRSPEC, TYDREAL, 3 },
-
-"nint",        { INTRGEN, 4, 4 },
-"idnint",      { INTRGEN, 2, 6 },
-
-"abs",                 { INTRGEN, 6, 8 },
-"iabs",        { INTRGEN, 2, 9 },
-"dabs",        { INTRSPEC, TYDREAL, 11 },
-"cabs",        { INTRSPEC, TYREAL, 12 },
-"zabs",        { INTRSPEC, TYDREAL, 13 },
-
-"mod",                 { INTRGEN, 4, 14 },
-"amod",        { INTRSPEC, TYREAL, 16 },
-"dmod",        { INTRSPEC, TYDREAL, 17 },
-
-"sign",        { INTRGEN, 4, 18 },
-"isign",       { INTRGEN, 2, 19 },
-"dsign",       { INTRSPEC, TYDREAL, 21 },
-
-"dim",                 { INTRGEN, 4, 22 },
-"idim",        { INTRGEN, 2, 23 },
-"ddim",        { INTRSPEC, TYDREAL, 25 },
-
-"dprod",       { INTRSPEC, TYDREAL, 26 },
-
-"len",                 { INTRSPEC, TYLONG, 27 },
-"index",       { INTRSPEC, TYLONG, 29 },
-
-"imag",        { INTRGEN, 2, 31 },
-"aimag",       { INTRSPEC, TYREAL, 31 },
-"dimag",       { INTRSPEC, TYDREAL, 32 },
-
-"conjg",       { INTRGEN, 2, 33 },
-"dconjg",      { INTRSPEC, TYDCOMPLEX, 34 },
-
-"sqrt",        { INTRGEN, 4, 35 },
-"dsqrt",       { INTRSPEC, TYDREAL, 36 },
-"csqrt",       { INTRSPEC, TYCOMPLEX, 37 },
-"zsqrt",       { INTRSPEC, TYDCOMPLEX, 38 },
-
-"exp",                 { INTRGEN, 4, 39 },
-"dexp",        { INTRSPEC, TYDREAL, 40 },
-"cexp",        { INTRSPEC, TYCOMPLEX, 41 },
-"zexp",        { INTRSPEC, TYDCOMPLEX, 42 },
-
-"log",                 { INTRGEN, 4, 43 },
-"alog",        { INTRSPEC, TYREAL, 43 },
-"dlog",        { INTRSPEC, TYDREAL, 44 },
-"clog",        { INTRSPEC, TYCOMPLEX, 45 },
-"zlog",        { INTRSPEC, TYDCOMPLEX, 46 },
-
-"log10",       { INTRGEN, 2, 47 },
-"alog10",      { INTRSPEC, TYREAL, 47 },
-"dlog10",      { INTRSPEC, TYDREAL, 48 },
-
-"sin",                 { INTRGEN, 4, 49 },
-"dsin",        { INTRSPEC, TYDREAL, 50 },
-"csin",        { INTRSPEC, TYCOMPLEX, 51 },
-"zsin",        { INTRSPEC, TYDCOMPLEX, 52 },
-
-"cos",                 { INTRGEN, 4, 53 },
-"dcos",        { INTRSPEC, TYDREAL, 54 },
-"ccos",        { INTRSPEC, TYCOMPLEX, 55 },
-"zcos",        { INTRSPEC, TYDCOMPLEX, 56 },
-
-"tan",                 { INTRGEN, 2, 57 },
-"dtan",        { INTRSPEC, TYDREAL, 58 },
-
-"asin",        { INTRGEN, 2, 59 },
-"dasin",       { INTRSPEC, TYDREAL, 60 },
-
-"acos",        { INTRGEN, 2, 61 },
-"dacos",       { INTRSPEC, TYDREAL, 62 },
-
-"atan",        { INTRGEN, 2, 63 },
-"datan",       { INTRSPEC, TYDREAL, 64 },
-
-"atan2",       { INTRGEN, 2, 65 },
-"datan2",      { INTRSPEC, TYDREAL, 66 },
-
-"sinh",        { INTRGEN, 2, 67 },
-"dsinh",       { INTRSPEC, TYDREAL, 68 },
-
-"cosh",        { INTRGEN, 2, 69 },
-"dcosh",       { INTRSPEC, TYDREAL, 70 },
-
-"tanh",        { INTRGEN, 2, 71 },
-"dtanh",       { INTRSPEC, TYDREAL, 72 },
-
-"lge",         { INTRSPEC, TYLOGICAL, 73},
-"lgt",         { INTRSPEC, TYLOGICAL, 75},
-"lle",         { INTRSPEC, TYLOGICAL, 77},
-"llt",         { INTRSPEC, TYLOGICAL, 79},
-
-"" };
-\f
-
-LOCAL struct specblock
-       {
-       char atype;
-       char rtype;
-       char nargs;
-       char spxname[XL];
-       char othername; /* index into callbyvalue table */
-       } spectab[ ] =
-{
-       { TYREAL,TYREAL,1,"r_int" },
-       { TYDREAL,TYDREAL,1,"d_int" },
-
-       { TYREAL,TYREAL,1,"r_nint" },
-       { TYDREAL,TYDREAL,1,"d_nint" },
-
-       { TYREAL,TYSHORT,1,"h_nint" },
-       { TYREAL,TYLONG,1,"i_nint" },
-
-       { TYDREAL,TYSHORT,1,"h_dnnt" },
-       { TYDREAL,TYLONG,1,"i_dnnt" },
-
-       { TYREAL,TYREAL,1,"r_abs" },
-       { TYSHORT,TYSHORT,1,"h_abs" },
-       { TYLONG,TYLONG,1,"i_abs" },
-       { TYDREAL,TYDREAL,1,"d_abs" },
-       { TYCOMPLEX,TYREAL,1,"c_abs" },
-       { TYDCOMPLEX,TYDREAL,1,"z_abs" },
-
-       { TYSHORT,TYSHORT,2,"h_mod" },
-       { TYLONG,TYLONG,2,"i_mod" },
-       { TYREAL,TYREAL,2,"r_mod" },
-       { TYDREAL,TYDREAL,2,"d_mod" },
-
-       { TYREAL,TYREAL,2,"r_sign" },
-       { TYSHORT,TYSHORT,2,"h_sign" },
-       { TYLONG,TYLONG,2,"i_sign" },
-       { TYDREAL,TYDREAL,2,"d_sign" },
-
-       { TYREAL,TYREAL,2,"r_dim" },
-       { TYSHORT,TYSHORT,2,"h_dim" },
-       { TYLONG,TYLONG,2,"i_dim" },
-       { TYDREAL,TYDREAL,2,"d_dim" },
-
-       { TYREAL,TYDREAL,2,"d_prod" },
-
-       { TYCHAR,TYSHORT,1,"h_len" },
-       { TYCHAR,TYLONG,1,"i_len" },
-
-       { TYCHAR,TYSHORT,2,"h_indx" },
-       { TYCHAR,TYLONG,2,"i_indx" },
-
-       { TYCOMPLEX,TYREAL,1,"r_imag" },
-       { TYDCOMPLEX,TYDREAL,1,"d_imag" },
-       { TYCOMPLEX,TYCOMPLEX,1,"r_cnjg" },
-       { TYDCOMPLEX,TYDCOMPLEX,1,"d_cnjg" },
-
-       { TYREAL,TYREAL,1,"r_sqrt", 1 },
-       { TYDREAL,TYDREAL,1,"d_sqrt", 1 },
-       { TYCOMPLEX,TYCOMPLEX,1,"c_sqrt" },
-       { TYDCOMPLEX,TYDCOMPLEX,1,"z_sqrt" },
-
-       { TYREAL,TYREAL,1,"r_exp", 2 },
-       { TYDREAL,TYDREAL,1,"d_exp", 2 },
-       { TYCOMPLEX,TYCOMPLEX,1,"c_exp" },
-       { TYDCOMPLEX,TYDCOMPLEX,1,"z_exp" },
-
-       { TYREAL,TYREAL,1,"r_log", 3 },
-       { TYDREAL,TYDREAL,1,"d_log", 3 },
-       { TYCOMPLEX,TYCOMPLEX,1,"c_log" },
-       { TYDCOMPLEX,TYDCOMPLEX,1,"z_log" },
-
-       { TYREAL,TYREAL,1,"r_lg10" },
-       { TYDREAL,TYDREAL,1,"d_lg10" },
-
-       { TYREAL,TYREAL,1,"r_sin", 4 },
-       { TYDREAL,TYDREAL,1,"d_sin", 4 },
-       { TYCOMPLEX,TYCOMPLEX,1,"c_sin" },
-       { TYDCOMPLEX,TYDCOMPLEX,1,"z_sin" },
-
-       { TYREAL,TYREAL,1,"r_cos", 5 },
-       { TYDREAL,TYDREAL,1,"d_cos", 5 },
-       { TYCOMPLEX,TYCOMPLEX,1,"c_cos" },
-       { TYDCOMPLEX,TYDCOMPLEX,1,"z_cos" },
-
-       { TYREAL,TYREAL,1,"r_tan", 6 },
-       { TYDREAL,TYDREAL,1,"d_tan", 6 },
-
-       { TYREAL,TYREAL,1,"r_asin", 7 },
-       { TYDREAL,TYDREAL,1,"d_asin", 7 },
-
-       { TYREAL,TYREAL,1,"r_acos", 8 },
-       { TYDREAL,TYDREAL,1,"d_acos", 8 },
-
-       { TYREAL,TYREAL,1,"r_atan", 9 },
-       { TYDREAL,TYDREAL,1,"d_atan", 9 },
-
-       { TYREAL,TYREAL,2,"r_atn2", 10 },
-       { TYDREAL,TYDREAL,2,"d_atn2", 10 },
-
-       { TYREAL,TYREAL,1,"r_sinh", 11 },
-       { TYDREAL,TYDREAL,1,"d_sinh", 11 },
-
-       { TYREAL,TYREAL,1,"r_cosh", 12 },
-       { TYDREAL,TYDREAL,1,"d_cosh", 12 },
-
-       { TYREAL,TYREAL,1,"r_tanh", 13 },
-       { TYDREAL,TYDREAL,1,"d_tanh", 13 },
-
-       { TYCHAR,TYLOGICAL,2,"hl_ge" },
-       { TYCHAR,TYLOGICAL,2,"l_ge" },
-
-       { TYCHAR,TYLOGICAL,2,"hl_gt" },
-       { TYCHAR,TYLOGICAL,2,"l_gt" },
-
-       { TYCHAR,TYLOGICAL,2,"hl_le" },
-       { TYCHAR,TYLOGICAL,2,"l_le" },
-
-       { TYCHAR,TYLOGICAL,2,"hl_lt" },
-       { TYCHAR,TYLOGICAL,2,"l_lt" }
-} ;
-
-
-
-
-
-
-char callbyvalue[ ][XL] =
-       {
-       "sqrt",
-       "exp",
-       "log",
-       "sin",
-       "cos",
-       "tan",
-       "asin",
-       "acos",
-       "atan",
-       "atan2",
-       "sinh",
-       "cosh",
-       "tanh"
-       };
-\f
-struct exprblock *intrcall(np, argsp, nargs)
-struct nameblock *np;
-struct listblock *argsp;
-int nargs;
-{
-int i, rettype;
-struct addrblock *ap;
-register struct specblock *sp;
-struct exprblock *q, *inline();
-register chainp cp;
-struct constblock *mkcxcon();
-expptr ep;
-int mtype;
-int op;
-
-packed.ijunk = np->vardesc.varno;
-if(nargs == 0)
-       goto badnargs;
-
-mtype = 0;
-for(cp = argsp->listp ; cp ; cp = cp->nextp)
-       {
-/* TEMPORARY */ ep = cp->datap;
-/* TEMPORARY */        if( ISCONST(ep) && ep->vtype==TYSHORT )
-/* TEMPORARY */                cp->datap = mkconv(tyint, ep);
-       mtype = maxtype(mtype, ep->vtype);
-       }
-
-switch(packed.bits.f1)
-       {
-       case INTRBOOL:
-               op = packed.bits.f3;
-               if( ! ONEOF(mtype, MSKINT|MSKLOGICAL) )
-                       goto badtype;
-               if(op == OPBITNOT)
-                       {
-                       if(nargs != 1)
-                               goto badnargs;
-                       q = mkexpr(OPBITNOT, argsp->listp->datap, NULL);
-                       }
-               else
-                       {
-                       if(nargs != 2)
-                               goto badnargs;
-                       q = mkexpr(op, argsp->listp->datap,
-                               argsp->listp->nextp->datap);
-                       }
-               frchain( &(argsp->listp) );
-               free(argsp);
-               return(q);
-
-       case INTRCONV:
-               rettype = packed.bits.f2;
-               if(rettype == TYLONG)
-                       rettype = tyint;
-               if( ISCOMPLEX(rettype) && nargs==2)
-                       {
-                       expptr qr, qi;
-                       qr = argsp->listp->datap;
-                       qi = argsp->listp->nextp->datap;
-                       if(ISCONST(qr) && ISCONST(qi))
-                               q = mkcxcon(qr,qi);
-                       else    q = mkexpr(OPCONV,mkconv(rettype-2,qr),
-                                       mkconv(rettype-2,qi));
-                       }
-               else if(nargs == 1)
-                       q = mkconv(rettype, argsp->listp->datap);
-               else goto badnargs;
-
-               q->vtype = rettype;
-               frchain(&(argsp->listp));
-               free(argsp);
-               return(q);
-
-
-       case INTRGEN:
-               sp = spectab + packed.bits.f3;
-               for(i=0; i<packed.bits.f2 ; ++i)
-                       if(sp->atype == mtype)
-                               goto specfunct;
-                       else
-                               ++sp;
-               goto badtype;
-
-       case INTRSPEC:
-               sp = spectab + packed.bits.f3;
-               if(tyint==TYLONG && sp->rtype==TYSHORT)
-                       ++sp;
-
-       specfunct:
-               if(nargs != sp->nargs)
-                       goto badnargs;
-               if(mtype != sp->atype)
-                       goto badtype;
-               fixargs(YES, argsp);
-               if(q = inline(sp-spectab, mtype, argsp->listp))
-                       {
-                       frchain( &(argsp->listp) );
-                       free(argsp);
-                       }
-               else if(sp->othername)
-                       {
-                       ap = builtin(sp->rtype,
-                               varstr(XL, callbyvalue[sp->othername-1]) );
-                       q = fixexpr( mkexpr(OPCCALL, ap, argsp) );
-                       }
-               else
-                       {
-                       ap = builtin(sp->rtype, varstr(XL, sp->spxname) );
-                       q = fixexpr( mkexpr(OPCALL, ap, argsp) );
-                       }
-               return(q);
-
-       case INTRMIN:
-       case INTRMAX:
-               if(nargs < 2)
-                       goto badnargs;
-               if( ! ONEOF(mtype, MSKINT|MSKREAL) )
-                       goto badtype;
-               argsp->vtype = mtype;
-               q = mkexpr( (packed.bits.f1==INTRMIN ? OPMIN : OPMAX), argsp, NULL);
-
-               q->vtype = mtype;
-               rettype = packed.bits.f2;
-               if(rettype == TYLONG)
-                       rettype = tyint;
-               else if(rettype == TYUNKNOWN)
-                       rettype = mtype;
-               return( mkconv(rettype, q) );
-
-       default:
-               fatal1("intrcall: bad intrgroup %d", packed.bits.f1);
-       }
-badnargs:
-       err1("bad number of arguments to intrinsic %s",
-               varstr(VL,np->varname) );
-       goto bad;
-
-badtype:
-       err1("bad argument type to intrinsic %s", varstr(VL, np->varname) );
-
-bad:
-       return( errnode() );
-}
-
-
-
-
-intrfunct(s)
-char s[VL];
-{
-register struct intrblock *p;
-char nm[VL];
-register int i;
-
-for(i = 0 ; i<VL ; ++s)
-       nm[i++] = (*s==' ' ? '\0' : *s);
-
-for(p = intrtab; p->intrval.intrgroup!=INTREND ; ++p)
-       {
-       if( eqn(VL, nm, p->intrfname) )
-               {
-               packed.bits.f1 = p->intrval.intrgroup;
-               packed.bits.f2 = p->intrval.intrstuff;
-               packed.bits.f3 = p->intrval.intrno;
-               return(packed.ijunk);
-               }
-       }
-
-return(0);
-}
-
-
-
-
-
-struct addrblock *intraddr(np)
-struct nameblock *np;
-{
-struct addrblock *q;
-struct specblock *sp;
-
-if(np->vclass!=CLPROC || np->vprocclass!=PINTRINSIC)
-       fatal1("intraddr: %s is not intrinsic", varstr(VL,np->varname));
-packed.ijunk = np->vardesc.varno;
-
-switch(packed.bits.f1)
-       {
-       case INTRGEN:
-               /* imag, log, and log10 arent specific functions */
-               if(packed.bits.f3==31 || packed.bits.f3==43 || packed.bits.f3==47)
-                       goto bad;
-
-       case INTRSPEC:
-               sp = spectab + packed.bits.f3;
-               if(tyint==TYLONG && sp->rtype==TYSHORT)
-                       ++sp;
-               q = builtin(sp->rtype, varstr(XL,sp->spxname) );
-               return(q);
-
-       case INTRCONV:
-       case INTRMIN:
-       case INTRMAX:
-       case INTRBOOL:
-       bad:
-               err1("cannot pass %s as actual",
-                       varstr(VL,np->varname));
-               return( errnode() );
-       }
-fatal1("intraddr: impossible f1=%d\n", packed.bits.f1);
-/* NOTREACHED */
-}
-
-
-
-
-
-struct exprblock *inline(fno, type, args)
-int fno;
-int type;
-chainp args;
-{
-register struct exprblock *q, *t, *t1;
-
-switch(fno)
-       {
-       case 8: /* real abs */
-       case 9: /* short int abs */
-       case 10:        /* long int abs */
-       case 11:        /* double precision abs */
-               if( addressable(q = args->datap) )
-                       {
-                       t = q;
-                       q = NULL;
-                       }
-               else
-                       t = mktemp(type);
-               t1 = mkexpr(OPQUEST,  mkexpr(OPLE, mkconv(type,ICON(0)), cpexpr(t)),
-                       mkexpr(OPCOLON, cpexpr(t),
-                               mkexpr(OPNEG, cpexpr(t), NULL) ));
-               if(q)
-                       t1 = mkexpr(OPCOMMA, mkexpr(OPASSIGN, cpexpr(t),q), t1);
-               frexpr(t);
-               return(t1);
-
-       case 26:        /* dprod */
-               q = mkexpr(OPSTAR, args->datap, args->nextp->datap);
-               q->vtype = TYDREAL;
-               return(q);
-
-       case 27:        /* len of character string */
-               q = cpexpr(args->datap->vleng);
-               frexpr(args->datap);
-               return(q);
-
-       case 14:        /* half-integer mod */
-       case 15:        /* mod */
-               return( mkexpr(OPMOD, args->datap, args->nextp->datap) );
-       }
-return(NULL);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/io.c b/.ref-Research-V7/usr/src/cmd/f77/io.c
deleted file mode 100644 (file)
index f7b8157..0000000
+++ /dev/null
@@ -1,734 +0,0 @@
-/* TEMPORARY */
-#define TYIOINT TYLONG
-#define SZIOINT SZLONG
-
-#include "defs"
-
-
-LOCAL char ioroutine[XL+1];
-
-LOCAL int ioendlab;
-LOCAL int ioerrlab;
-LOCAL int endbit;
-LOCAL int jumplab;
-LOCAL int skiplab;
-LOCAL int ioformatted;
-
-#define UNFORMATTED 0
-#define FORMATTED 1
-#define LISTDIRECTED 2
-
-#define V(z)   ioc[z].iocval
-
-#define IOALL 07777
-
-LOCAL struct ioclist
-       {
-       char *iocname;
-       int iotype;
-       expptr iocval;
-       } ioc[ ] =
-       {
-               { "", 0 },
-               { "unit", IOALL },
-               { "fmt", M(IOREAD) | M(IOWRITE) },
-               { "err", IOALL },
-               { "end", M(IOREAD) },
-               { "iostat", IOALL },
-               { "rec", M(IOREAD) | M(IOWRITE) },
-               { "recl", M(IOOPEN) | M(IOINQUIRE) },
-               { "file", M(IOOPEN) | M(IOINQUIRE) },
-               { "status", M(IOOPEN) | M(IOCLOSE) },
-               { "access", M(IOOPEN) | M(IOINQUIRE) },
-               { "form", M(IOOPEN) | M(IOINQUIRE) },
-               { "blank", M(IOOPEN) | M(IOINQUIRE) },
-               { "exist", M(IOINQUIRE) },
-               { "opened", M(IOINQUIRE) },
-               { "number", M(IOINQUIRE) },
-               { "named", M(IOINQUIRE) },
-               { "name", M(IOINQUIRE) },
-               { "sequential", M(IOINQUIRE) },
-               { "direct", M(IOINQUIRE) },
-               { "formatted", M(IOINQUIRE) },
-               { "unformatted", M(IOINQUIRE) },
-               { "nextrec", M(IOINQUIRE) }
-       } ;
-
-#define NIOS (sizeof(ioc)/sizeof(struct ioclist) - 1)
-#define MAXIO  SZFLAG + 10*SZIOINT + 15*SZADDR
-
-#define IOSUNIT 1
-#define IOSFMT 2
-#define IOSERR 3
-#define IOSEND 4
-#define IOSIOSTAT 5
-#define IOSREC 6
-#define IOSRECL 7
-#define IOSFILE 8
-#define IOSSTATUS 9
-#define IOSACCESS 10
-#define IOSFORM 11
-#define IOSBLANK 12
-#define IOSEXIST 13
-#define IOSOPENEDED 14
-#define IOSNUMBER 15
-#define IOSNAMED 16
-#define IOSNAME 17
-#define IOSSEQUENTIAL 18
-#define IOSDIRECT 19
-#define IOSFORMATTED 20
-#define IOSUNFORMATTED 21
-#define IOSNEXTREC 22
-
-#define IOSTP V(IOSIOSTAT)
-
-
-/* offsets in generated structures */
-
-#define SZFLAG SZIOINT
-
-#define XERR 0
-#define XUNIT  SZFLAG
-#define XEND   SZFLAG + SZIOINT
-#define XFMT   2*SZFLAG + SZIOINT
-#define XREC   2*SZFLAG + SZIOINT + SZADDR
-#define XRLEN  2*SZFLAG + 2*SZADDR
-#define XRNUM  2*SZFLAG + 2*SZADDR + SZIOINT
-
-#define XIFMT  2*SZFLAG + SZADDR
-#define XIEND  SZFLAG + SZADDR
-#define XIUNIT SZFLAG
-
-#define XFNAME SZFLAG + SZIOINT
-#define XFNAMELEN      SZFLAG + SZIOINT + SZADDR
-#define XSTATUS        SZFLAG + 2*SZIOINT + SZADDR
-#define XACCESS        SZFLAG + 2*SZIOINT + 2*SZADDR
-#define XFORMATTED     SZFLAG + 2*SZIOINT + 3*SZADDR
-#define XRECLEN        SZFLAG + 2*SZIOINT + 4*SZADDR
-#define XBLANK SZFLAG + 3*SZIOINT + 4*SZADDR
-
-#define XCLSTATUS      SZFLAG + SZIOINT
-
-#define XFILE  SZFLAG + SZIOINT
-#define XFILELEN       SZFLAG + SZIOINT + SZADDR
-#define XEXISTS        SZFLAG + 2*SZIOINT + SZADDR
-#define XOPEN  SZFLAG + 2*SZIOINT + 2*SZADDR
-#define XNUMBER        SZFLAG + 2*SZIOINT + 3*SZADDR
-#define XNAMED SZFLAG + 2*SZIOINT + 4*SZADDR
-#define XNAME  SZFLAG + 2*SZIOINT + 5*SZADDR
-#define XNAMELEN       SZFLAG + 2*SZIOINT + 6*SZADDR
-#define XQACCESS       SZFLAG + 3*SZIOINT + 6*SZADDR
-#define XQACCLEN       SZFLAG + 3*SZIOINT + 7*SZADDR
-#define XSEQ   SZFLAG + 4*SZIOINT + 7*SZADDR
-#define XSEQLEN        SZFLAG + 4*SZIOINT + 8*SZADDR
-#define XDIRECT        SZFLAG + 5*SZIOINT + 8*SZADDR
-#define XDIRLEN        SZFLAG + 5*SZIOINT + 9*SZADDR
-#define XFORM  SZFLAG + 6*SZIOINT + 9*SZADDR
-#define XFORMLEN       SZFLAG + 6*SZIOINT + 10*SZADDR
-#define XFMTED SZFLAG + 7*SZIOINT + 10*SZADDR
-#define XFMTEDLEN      SZFLAG + 7*SZIOINT + 11*SZADDR
-#define XUNFMT SZFLAG + 8*SZIOINT + 11*SZADDR
-#define XUNFMTLEN      SZFLAG + 8*SZIOINT + 12*SZADDR
-#define XQRECL SZFLAG + 9*SZIOINT + 12*SZADDR
-#define XNEXTREC       SZFLAG + 9*SZIOINT + 13*SZADDR
-#define XQBLANK        SZFLAG + 9*SZIOINT + 14*SZADDR
-#define XQBLANKLEN     SZFLAG + 9*SZIOINT + 15*SZADDR
-\f
-fmtstmt(lp)
-register struct labelblock *lp;
-{
-if(lp == NULL)
-       {
-       execerr("unlabeled format statement" , 0);
-       return(-1);
-       }
-if(lp->labtype == LABUNKNOWN)
-       {
-       lp->labtype = LABFORMAT;
-       lp->labelno = newlabel();
-       }
-else if(lp->labtype != LABFORMAT)
-       {
-       execerr("bad format number", 0);
-       return(-1);
-       }
-return(lp->labelno);
-}
-
-
-
-setfmt(lp)
-struct labelblock *lp;
-{
-ftnint n;
-char *s, *lexline();
-
-s = lexline(&n);
-preven(ALILONG);
-prlabel(asmfile, lp->labelno);
-putstr(asmfile, s, n);
-flline();
-}
-
-
-
-startioctl()
-{
-register int i;
-
-inioctl = YES;
-nioctl = 0;
-ioerrlab = 0;
-ioformatted = UNFORMATTED;
-for(i = 1 ; i<=NIOS ; ++i)
-       V(i) = NULL;
-}
-
-
-
-endioctl()
-{
-int i;
-expptr p;
-struct labelblock *mklabel();
-
-inioctl = NO;
-if(ioblkp == NULL)
-       ioblkp = autovar( (MAXIO+SZIOINT-1)/SZIOINT , TYIOINT, NULL);
-
-/* set up for error recovery */
-
-ioerrlab = ioendlab = skiplab = jumplab = 0;
-
-if(p = V(IOSEND))
-       if(ISICON(p))
-               ioendlab = mklabel(p->const.ci)->labelno;
-       else
-               err("bad end= clause");
-
-if(p = V(IOSERR))
-       if(ISICON(p))
-               ioerrlab = mklabel(p->const.ci)->labelno;
-       else
-               err("bad err= clause");
-
-if(IOSTP==NULL && ioerrlab!=0 && ioendlab!=0 && ioerrlab!=ioendlab)
-       IOSTP = mktemp(TYINT, NULL);
-
-if(IOSTP != NULL)
-       if(IOSTP->tag!=TADDR || ! ISINT(IOSTP->vtype) )
-               {
-               err("iostat must be an integer variable");
-               frexpr(IOSTP);
-               IOSTP = NULL;
-               }
-
-if(IOSTP)
-       {
-       if( (iostmt==IOREAD || iostmt==IOWRITE) &&
-           (ioerrlab!=ioendlab || ioerrlab==0) )
-               jumplab = skiplab = newlabel();
-       else
-               jumplab = ioerrlab;
-       }
-else
-       {
-       jumplab = ioerrlab;
-       if(ioendlab)
-               jumplab = ioendlab;
-       }
-
-ioset(TYIOINT, XERR, ICON(IOSTP!=NULL || ioerrlab!=0) );
-endbit = IOSTP!=NULL || ioendlab!=0;   /* for use in startrw() */
-
-switch(iostmt)
-       {
-       case IOOPEN:
-               dofopen();  break;
-
-       case IOCLOSE:
-               dofclose();  break;
-
-       case IOINQUIRE:
-               dofinquire();  break;
-
-       case IOBACKSPACE:
-               dofmove("f_back"); break;
-
-       case IOREWIND:
-               dofmove("f_rew");  break;
-
-       case IOENDFILE:
-               dofmove("f_end");  break;
-
-       case IOREAD:
-       case IOWRITE:
-               startrw();  break;
-
-       default:
-               fatal1("impossible iostmt %d", iostmt);
-       }
-for(i = 1 ; i<=NIOS ; ++i)
-       if(i!=IOSIOSTAT || (iostmt!=IOREAD && iostmt!=IOWRITE) )
-               frexpr(V(i));
-}
-
-
-
-iocname()
-{
-register int i;
-int found, mask;
-
-found = 0;
-mask = M(iostmt);
-for(i = 1 ; i <= NIOS ; ++i)
-       if(toklen==strlen(ioc[i].iocname) && eqn(toklen, token, ioc[i].iocname))
-               if(ioc[i].iotype & mask)
-                       return(i);
-               else    found = i;
-if(found)
-       err1("invalid control %s for statement", ioc[found].iocname);
-else
-       err1("unknown iocontrol %s", varstr(toklen, token) );
-return(IOSBAD);
-}
-
-
-ioclause(n, p)
-register int n;
-register expptr p;
-{
-struct ioclist *iocp;
-
-++nioctl;
-if(n == IOSBAD)
-       return;
-if(n == IOSPOSITIONAL)
-       {
-       if(nioctl > IOSFMT)
-               {
-               err("illegal positional iocontrol");
-               return;
-               }
-       n = nioctl;
-       }
-
-if(p == NULL)
-       {
-       if(n == IOSUNIT)
-               p = (iostmt==IOREAD ? IOSTDIN : IOSTDOUT);
-       else if(n != IOSFMT)
-               {
-               err("illegal * iocontrol");
-               return;
-               }
-       }
-if(n == IOSFMT)
-       ioformatted = (p==NULL ? LISTDIRECTED : FORMATTED);
-
-iocp = & ioc[n];
-if(iocp->iocval == NULL)
-       {
-       if(n!=IOSFMT && ( n!=IOSUNIT || (p!=NULL && p->vtype!=TYCHAR) ) )
-               p = fixtype(p);
-       iocp->iocval = p;
-}
-else
-       err1("iocontrol %s repeated", iocp->iocname);
-}
-
-/* io list item */
-
-doio(list)
-chainp list;
-{
-struct exprblock *call0();
-doiolist(list);
-ioroutine[0] = 'e';
-putiocall( call0(TYINT, ioroutine) );
-frexpr(IOSTP);
-}
-
-
-
-
-
-LOCAL doiolist(p0)
-chainp p0;
-{
-chainp p;
-register tagptr q;
-register expptr qe;
-register struct nameblock *qn;
-struct addrblock *tp, *mkscalar();
-int range;
-
-for (p = p0 ; p ; p = p->nextp)
-       {
-       q = p->datap;
-       if(q->tag == TIMPLDO)
-               {
-               exdo(range=newlabel(), q->varnp);
-               doiolist(q->datalist);
-               enddo(range);
-               free(q);
-               }
-       else    {
-               if(q->tag==TPRIM && q->argsp==NULL && q->namep->vdim!=NULL)
-                       {
-                       vardcl(qn = q->namep);
-                       if(qn->vdim->nelt)
-                               putio( fixtype(cpexpr(qn->vdim->nelt)),
-                                       mkscalar(qn) );
-                       else
-                               err("attempt to i/o array of unknown size");
-                       }
-               else if(q->tag==TPRIM && q->argsp==NULL && (qe = memversion(q->namep)) )
-                       putio(ICON(1),qe);
-               else if( (qe = fixtype(cpexpr(q)))->tag==TADDR)
-                       putio(ICON(1), qe);
-               else if(qe->vtype != TYERROR)
-                       {
-                       if(iostmt == IOWRITE)
-                               {
-                               tp = mktemp(qe->vtype, qe->vleng);
-                               puteq( cpexpr(tp), qe);
-                               putio(ICON(1), tp);
-                               }
-                       else
-                               err("non-left side in READ list");
-                       }
-               frexpr(q);
-               }
-       }
-frchain( &p0 );
-}
-
-
-
-
-
-LOCAL putio(nelt, addr)
-expptr nelt;
-register expptr addr;
-{
-int type;
-register struct exprblock *q;
-struct exprblock *call2(), *call3();
-
-type = addr->vtype;
-if(ioformatted!=LISTDIRECTED && ISCOMPLEX(type) )
-       {
-       nelt = mkexpr(OPSTAR, ICON(2), nelt);
-       type -= (TYCOMPLEX-TYREAL);
-       }
-
-/* pass a length with every item.  for noncharacter data, fake one */
-if(type != TYCHAR)
-       {
-       if( ISCONST(addr) )
-               addr = putconst(addr);
-       addr->vtype = TYCHAR;
-       addr->vleng = ICON( typesize[type] );
-       }
-
-nelt = fixtype( mkconv(TYLENG,nelt) );
-if(ioformatted == LISTDIRECTTED)
-       q = call3(TYINT, "do_lio", mkconv(TYLONG, ICON(type)), nelt, addr);
-else
-       q = call2(TYINT, (ioformatted==FORMATTED ? "do_fio" : "do_uio"),
-               nelt, addr);
-putiocall(q);
-}
-
-
-
-
-endio()
-{
-if(skiplab)
-       {
-       putlabel(skiplab);
-       if(ioendlab)
-               putif( mkexpr(OPGE, cpexpr(IOSTP), ICON(0)), ioendlab);
-       if(ioerrlab)
-               putif( mkexpr( ( (iostmt==IOREAD||iostmt==IOWRITE) ? OPLE : OPEQ),
-                       cpexpr(IOSTP), ICON(0)) , ioerrlab);
-       }
-if(IOSTP)
-       frexpr(IOSTP);
-}
-
-
-
-LOCAL putiocall(q)
-register struct exprblock *q;
-{
-if(IOSTP)
-       {
-       q->vtype = TYINT;
-       q = fixexpr( mkexpr(OPASSIGN, cpexpr(IOSTP), q));
-       }
-
-if(jumplab)
-       putif( mkexpr(OPEQ, q, ICON(0) ), jumplab);
-else
-       putexpr(q);
-}
-\f
-
-startrw()
-{
-register expptr p;
-register struct nameblock *np;
-register struct addrblock *unitp, *nump;
-struct constblock *mkaddcon();
-int k, fmtoff;
-int intfile, sequential;
-
-
-sequential = YES;
-if(p = V(IOSREC))
-       if( ISINT(p->vtype) )
-               {
-               ioset(TYIOINT, XREC, cpexpr(p) );
-               sequential = NO;
-               }
-       else
-               err("bad REC= clause");
-
-intfile = NO;
-if(p = V(IOSUNIT))
-       {
-       if( ISINT(p->vtype) )
-               ioset(TYIOINT, XUNIT, cpexpr(p) );
-       else if(p->vtype == TYCHAR)
-               {
-               intfile = YES;
-               if(p->tag==TPRIM && p->argsp==NULL && (np = p->namep)->vdim!=NULL)
-                       {
-                       vardcl(np);
-                       if(np->vdim->nelt)
-                               nump = cpexpr(np->vdim->nelt);
-                       else
-                               {
-                               err("attempt to use internal unit array of unknown size");
-                               nump = ICON(1);
-                               }
-                       unitp = mkscalar(np);
-                       }
-               else    {
-                       nump = ICON(1);
-                       unitp = fixtype(cpexpr(p));
-                       }
-               ioset(TYIOINT, XRNUM, nump);
-               ioset(TYIOINT, XRLEN, cpexpr(unitp->vleng) );
-               ioset(TYADDR, XUNIT, addrof(unitp) );
-               }
-       }
-else
-       err("bad unit specifier");
-
-if(iostmt == IOREAD)
-       ioset(TYIOINT, (intfile ? XIEND : XEND), ICON(endbit) );
-
-fmtoff = (intfile ? XIFMT : XFMT);
-
-if(p = V(IOSFMT))
-       {
-       if(p->tag==TPRIM && p->argsp==NULL)
-               {
-               vardcl(np = p->namep);
-               if(np->vdim)
-                       {
-                       ioset(TYADDR, fmtoff, addrof(mkscalar(np)) );
-                       goto endfmt;
-                       }
-               if( ISINT(np->vtype) )
-                       {
-                       ioset(TYADDR, fmtoff, p);
-                       goto endfmt;
-                       }
-               }
-       p = V(IOSFMT) = fixtype(p);
-       if(p->vtype == TYCHAR)
-               ioset(TYADDR, fmtoff, addrof(cpexpr(p)) );
-       else if( ISICON(p) )
-               {
-               if( (k = fmtstmt( mklabel(p->const.ci) )) > 0 )
-                       ioset(TYADDR, fmtoff, mkaddcon(k) );
-               else
-                       ioformatted = UNFORMATTED;
-               }
-       else    {
-               err("bad format descriptor");
-               ioformatted = UNFORMATTED;
-               }
-       }
-else
-       ioset(TYADDR, fmtoff, ICON(0) );
-
-endfmt:
-
-
-ioroutine[0] = 's';
-ioroutine[1] = '_';
-ioroutine[2] = (iostmt==IOREAD ? 'r' : 'w');
-ioroutine[3] = (sequential ? 's' : 'd');
-ioroutine[4] = "ufl" [ioformatted];
-ioroutine[5] = (intfile ? 'i' : 'e');
-ioroutine[6] = '\0';
-putiocall( call1(TYINT, ioroutine, cpexpr(ioblkp) ));
-}
-
-
-
-LOCAL dofopen()
-{
-register expptr p;
-
-if( (p = V(IOSUNIT)) && ISINT(p->vtype) )
-       ioset(TYIOINT, XUNIT, cpexpr(p) );
-else
-       err("bad unit in open");
-if( (p = V(IOSFILE)) && p->vtype==TYCHAR)
-       {
-       ioset(TYIOINT, XFNAMELEN, cpexpr(p->vleng) );
-       iosetc(XFNAME, p);
-       }
-else
-       err("bad file in open");
-
-if(p = V(IOSRECL))
-       if( ISINT(p->vtype) )
-               ioset(TYIOINT, XRECLEN, cpexpr(p) );
-       else
-               err("bad recl");
-else
-       ioset(TYIOINT, XRECLEN, ICON(0) );
-
-iosetc(XSTATUS, V(IOSSTATUS));
-iosetc(XACCESS, V(IOSACCESS));
-iosetc(XFORMATTED, V(IOSFORM));
-iosetc(XBLANK, V(IOSBLANK));
-
-putiocall( call1(TYINT, "f_open", cpexpr(ioblkp) ));
-}
-
-
-LOCAL dofclose()
-{
-register expptr p;
-
-if( (p = V(IOSUNIT)) && ISINT(p->vtype) )
-       {
-       ioset(TYIOINT, XUNIT, cpexpr(p) );
-       iosetc(XCLSTATUS, V(IOSSTATUS));
-       putiocall( call1(TYINT, "f_clos", cpexpr(ioblkp)) );
-       }
-else
-       err("bad unit in close statement");
-}
-
-
-LOCAL dofinquire()
-{
-register expptr p;
-if(p = V(IOSUNIT))
-       {
-       if( V(IOSFILE) )
-               err("inquire by unit or by file, not both");
-       ioset(TYIOINT, XUNIT, cpexpr(p) );
-       }
-else if( ! V(IOSFILE) )
-       err("must inquire by unit or by file");
-iosetlc(IOSFILE, XFILE, XFILELEN);
-iosetip(IOSEXISTS, XEXISTS);
-iosetip(IOSOPENED, XOPEN);
-iosetip(IOSNUMBER, XNUMBER);
-iosetip(IOSNAMED, XNAMED);
-iosetlc(IOSNAME, XNAME, XNAMELEN);
-iosetlc(IOSACCESS, XQACCESS, XQACCLEN);
-iosetlc(IOSSEQUENTIAL, XSEQ, XSEQLEN);
-iosetlc(IOSDIRECT, XDIRECT, XDIRLEN);
-iosetlc(IOSFORM, XFORM, XFORMLEN);
-iosetlc(IOSFORMATTED, XFMTED, XFMTEDLEN);
-iosetlc(IOSUNFORMATTED, XUNFMT, XUNFMTLEN);
-iosetip(IOSRECL, XQRECL);
-iosetip(IOSNEXTREC, XNEXTREC);
-
-putiocall( call1(TYINT,  "f_inqu", cpexpr(ioblkp) ));
-}
-
-
-
-LOCAL dofmove(subname)
-char *subname;
-{
-register expptr p;
-
-if( (p = V(IOSUNIT)) && ISINT(p->vtype) )
-       {
-       ioset(TYIOINT, XUNIT, cpexpr(p) );
-       putiocall( call1(TYINT, subname, cpexpr(ioblkp) ));
-       }
-else
-       err("bad unit in move statement");
-}
-
-
-
-LOCAL ioset(type, offset, p)
-int type, offset;
-expptr p;
-{
-register struct addrblock *q;
-
-q = cpexpr(ioblkp);
-q->vtype = type;
-q->memoffset = fixtype( mkexpr(OPPLUS, q->memoffset, ICON(offset)) );
-puteq(q, p);
-}
-
-
-
-
-LOCAL iosetc(offset, p)
-int offset;
-register expptr p;
-{
-if(p == NULL)
-       ioset(TYADDR, offset, ICON(0) );
-else if(p->vtype == TYCHAR)
-       ioset(TYADDR, offset, addrof(cpexpr(p) ));
-else
-       err("non-character control clause");
-}
-
-
-
-LOCAL iosetip(i, offset)
-int i, offset;
-{
-register expptr p;
-
-if(p = V(i))
-       if(p->tag==TADDR && ONEOF(p->vtype, M(TYLONG)|M(TYLOGICAL)) )
-               ioset(TYADDR, offset, addrof(cpexpr(p)) );
-       else
-               err1("impossible inquire parameter %s", ioc[i].iocname);
-else
-       ioset(TYADDR, offset, ICON(0) );
-}
-
-
-
-LOCAL iosetlc(i, offp, offl)
-int i, offp, offl;
-{
-register expptr p;
-if( (p = V(i)) && p->vtype==TYCHAR)
-       ioset(TYIOINT, offl, cpexpr(p->vleng) );
-iosetc(offp, p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/lex.c b/.ref-Research-V7/usr/src/cmd/f77/lex.c
deleted file mode 100644 (file)
index 85bb1e9..0000000
+++ /dev/null
@@ -1,901 +0,0 @@
-#include "defs"
-#include "tokdefs"
-
-# define BLANK ' '
-# define MYQUOTE (2)
-# define SEOF 0
-
-/* card types */
-
-# define STEOF 1
-# define STINITIAL 2
-# define STCONTINUE 3
-
-/* lex states */
-
-#define NEWSTMT        1
-#define FIRSTTOKEN     2
-#define OTHERTOKEN     3
-#define RETEOS 4
-
-
-LOCAL int stkey;
-ftnint yystno;
-LOCAL long int stno;
-LOCAL long int nxtstno;
-LOCAL int parlev;
-LOCAL int expcom;
-LOCAL int expeql;
-LOCAL char *nextch;
-LOCAL char *lastch;
-LOCAL char *nextcd     = NULL;
-LOCAL char *endcd;
-LOCAL int prevlin;
-LOCAL int thislin;
-LOCAL int code;
-LOCAL int lexstate     = NEWSTMT;
-LOCAL char s[1390];
-LOCAL char *send       = s+20*66;
-LOCAL int nincl        = 0;
-
-struct inclfile
-       {
-       struct inclfile *inclnext;
-       FILEP inclfp;
-       char *inclname;
-       int incllno;
-       char *incllinp;
-       int incllen;
-       int inclcode;
-       ftnint inclstno;
-       } ;
-
-LOCAL struct inclfile *inclp   =  NULL;
-LOCAL struct keylist { char *keyname; int keyval; } ;
-LOCAL struct punctlist { char punchar; int punval; };
-LOCAL struct fmtlist { char fmtchar; int fmtval; };
-LOCAL struct dotlist { char *dotname; int dotval; };
-LOCAL struct keylist *keystart[26], *keyend[26];
-
-
-
-
-inilex(name)
-char *name;
-{
-nincl = 0;
-inclp = NULL;
-doinclude(name);
-lexstate = NEWSTMT;
-return(NO);
-}
-
-
-
-/* throw away the rest of the current line */
-flline()
-{
-lexstate = RETEOS;
-}
-
-
-
-char *lexline(n)
-ftnint *n;
-{
-*n = (lastch - nextch) + 1;
-return(nextch);
-}
-
-
-
-
-
-doinclude(name)
-char *name;
-{
-FILEP fp;
-struct inclfile *t;
-
-if(inclp)
-       {
-       inclp->incllno = thislin;
-       inclp->inclcode = code;
-       inclp->inclstno = nxtstno;
-       if(nextcd)
-               inclp->incllinp = copyn(inclp->incllen = endcd-nextcd , nextcd);
-       else
-               inclp->incllinp = 0;
-       }
-nextcd = NULL;
-
-if(++nincl >= MAXINCLUDE)
-       fatal("includes nested too deep");
-if(name[0] == '\0')
-       fp = stdin;
-else
-       fp = fopen(name, "r");
-if( fp )
-       {
-       t = inclp;
-       inclp = ALLOC(inclfile);
-       inclp->inclnext = t;
-       prevlin = thislin = 0;
-       infname = inclp->inclname = name;
-       infile = inclp->inclfp = fp;
-       }
-else
-       {
-       fprintf(diagfile, "Cannot open file %s", name);
-       done(1);
-       }
-}
-
-
-
-
-LOCAL popinclude()
-{
-struct inclfile *t;
-register char *p;
-register int k;
-
-if(infile != stdin)
-       clf(&infile);
-free(infname);
-
---nincl;
-t = inclp->inclnext;
-free(inclp);
-inclp = t;
-if(inclp == NULL)
-       return(NO);
-
-infile = inclp->inclfp;
-infname = inclp->inclname;
-prevlin = thislin = inclp->incllno;
-code = inclp->inclcode;
-stno = nxtstno = inclp->inclstno;
-if(inclp->incllinp)
-       {
-       endcd = nextcd = s;
-       k = inclp->incllen;
-       p = inclp->incllinp;
-       while(--k >= 0)
-               *endcd++ = *p++;
-       free(inclp->incllinp);
-       }
-else
-       nextcd = NULL;
-return(YES);
-}
-
-
-
-
-yylex()
-{
-static int  tokno;
-
-       switch(lexstate)
-       {
-case NEWSTMT : /* need a new statement */
-       if(getcds() == STEOF)
-               return(SEOF);
-       crunch();
-       tokno = 0;
-       lexstate = FIRSTTOKEN;
-       yystno = stno;
-       stno = nxtstno;
-       toklen = 0;
-       return(SLABEL);
-
-first:
-case FIRSTTOKEN :      /* first step on a statement */
-       analyz();
-       lexstate = OTHERTOKEN;
-       tokno = 1;
-       return(stkey);
-
-case OTHERTOKEN :      /* return next token */
-       if(nextch > lastch)
-               goto reteos;
-       ++tokno;
-       if((stkey==SLOGIF || stkey==SELSEIF) && parlev==0 && tokno>3) goto first;
-       if(stkey==SASSIGN && tokno==3 && nextch<lastch &&
-               nextch[0]=='t' && nextch[1]=='o')
-                       {
-                       nextch+=2;
-                       return(STO);
-                       }
-       return(gettok());
-
-reteos:
-case RETEOS:
-       lexstate = NEWSTMT;
-       return(SEOS);
-       }
-fatal1("impossible lexstate %d", lexstate);
-/* NOTREACHED */
-}
-\f
-LOCAL getcds()
-{
-register char *p, *q;
-
-top:
-       if(nextcd == NULL)
-               {
-               code = getcd( nextcd = s );
-               stno = nxtstno;
-               prevlin = thislin;
-               }
-       if(code == STEOF)
-               if( popinclude() )
-                       goto top;
-               else
-                       return(STEOF);
-
-       if(code == STCONTINUE)
-               {
-               lineno = thislin;
-               err("illegal continuation card ignored");
-               nextcd = NULL;
-               goto top;
-               }
-
-       if(nextcd > s)
-               {
-               q = nextcd;
-               p = s;
-               while(q < endcd)
-                       *p++ = *q++;
-               endcd = p;
-               }
-       for(nextcd = endcd ;
-               nextcd+66<=send && (code = getcd(nextcd))==STCONTINUE ;
-               nextcd = endcd )
-                       ;
-       nextch = s;
-       lastch = nextcd - 1;
-       if(nextcd >= send)
-               nextcd = NULL;
-       lineno = prevlin;
-       prevlin = thislin;
-       return(STINITIAL);
-}
-\f
-LOCAL getcd(b)
-register char *b;
-{
-register int c;
-register char *p, *bend;
-int speclin;
-static char a[6];
-static char *aend      = a+6;
-
-top:
-       endcd = b;
-       bend = b+66;
-       speclin = NO;
-
-       if( (c = getc(infile)) == '&')
-               {
-               a[0] = BLANK;
-               a[5] = 'x';
-               speclin = YES;
-               bend = send;
-               }
-       else if(c=='c' || c=='C' || c=='*')
-               {
-               while( (c = getc(infile)) != '\n')
-                       if(c == EOF)
-                               return(STEOF);
-               ++thislin;
-               goto top;
-               }
-
-       else if(c != EOF)
-               {
-               /* a tab in columns 1-6 skips to column 7 */
-               ungetc(c, infile);
-               for(p=a; p<aend && (c=getc(infile)) != '\n' && c!=EOF; )
-                       if(c == '\t')
-                               {
-                               while(p < aend)
-                                       *p++ = BLANK;
-                               speclin = YES;
-                               bend = send;
-                               }
-                       else
-                               *p++ = c;
-               }
-       if(c == EOF)
-               return(STEOF);
-       if(c == '\n')
-               {
-               while(p < aend)
-                       *p++ = BLANK;
-               if( ! speclin )
-                       while(endcd < bend)
-                               *endcd++ = BLANK;
-               }
-       else    {       /* read body of line */
-               while( endcd<bend && (c=getc(infile)) != '\n' && c!=EOF )
-                       *endcd++ = c;
-               if(c == EOF)
-                       return(STEOF);
-               if(c != '\n')
-                       {
-                       while( (c=getc(infile)) != '\n')
-                               if(c == EOF)
-                                       return(STEOF);
-                       }
-
-               if( ! speclin )
-                       while(endcd < bend)
-                               *endcd++ = BLANK;
-               }
-       ++thislin;
-       if( !isspace(a[5]) && a[5]!='0')
-               return(STCONTINUE);
-       for(p=a; p<aend; ++p)
-               if( !isspace(*p) ) goto initline;
-       for(p = b ; p<endcd ; ++p)
-               if( !isspace(*p) ) goto initline;
-       goto top;
-
-initline:
-       nxtstno = 0;
-       for(p = a ; p<a+5 ; ++p)
-               if( !isspace(*p) )
-                       if(isdigit(*p))
-                               nxtstno = 10*nxtstno + (*p - '0');
-                       else    {
-                               lineno = thislin;
-                               err("nondigit in statement number field");
-                               nxtstno = 0;
-                               break;
-                               }
-       return(STINITIAL);
-}
-\f
-LOCAL crunch()
-{
-register char *i, *j, *j0, *j1, *prvstr;
-int ten, nh, quote;
-
-/* i is the next input character to be looked at
-j is the next output character */
-parlev = 0;
-expcom = 0;    /* exposed ','s */
-expeql = 0;    /* exposed equal signs */
-j = s;
-prvstr = s;
-for(i=s ; i<=lastch ; ++i)
-       {
-       if(isspace(*i) )
-               continue;
-       if(*i=='\'' ||  *i=='"')
-               {
-               quote = *i;
-               *j = MYQUOTE; /* special marker */
-               for(;;)
-                       {
-                       if(++i > lastch)
-                               {
-                               err("unbalanced quotes; closing quote supplied");
-                               break;
-                               }
-                       if(*i == quote)
-                               if(i<lastch && i[1]==quote) ++i;
-                               else break;
-                       else if(*i=='\\' && i<lastch)
-                               switch(*++i)
-                                       {
-                                       case 't':
-                                               *i = '\t'; break;
-                                       case 'b':
-                                               *i = '\b'; break;
-                                       case 'n':
-                                               *i = '\n'; break;
-                                       case 'f':
-                                               *i = '\f'; break;
-                                       case '0':
-                                               *i = '\0'; break;
-                                       default:
-                                               break;
-                                       }
-                       *++j = *i;
-                       }
-               j[1] = MYQUOTE;
-               j += 2;
-               prvstr = j;
-               }
-       else if( (*i=='h' || *i=='H')  && j>prvstr)     /* test for Hollerith strings */
-               {
-               if( ! isdigit(j[-1])) goto copychar;
-               nh = j[-1] - '0';
-               ten = 10;
-               j1 = prvstr - 1;
-               if (j1<j-5) j1=j-5;
-               for(j0=j-2 ; j0>j1; -- j0)
-                       {
-                       if( ! isdigit(*j0 ) ) break;
-                       nh += ten * (*j0-'0');
-                       ten*=10;
-                       }
-               if(j0 <= j1) goto copychar;
-/* a hollerith must be preceded by a punctuation mark.
-   '*' is possible only as repetition factor in a data statement
-   not, in particular, in character*2h
-*/
-
-               if( !(*j0=='*'&&s[0]=='d') && *j0!='/' && *j0!='(' &&
-                       *j0!=',' && *j0!='=' && *j0!='.')
-                               goto copychar;
-               if(i+nh > lastch)
-                       {
-                       err1("%dH too big", nh);
-                       nh = lastch - i;
-                       }
-               j0[1] = MYQUOTE; /* special marker */
-               j = j0 + 1;
-               while(nh-- > 0)
-                       {
-                       if(*++i == '\\')
-                               switch(*++i)
-                                       {
-                                       case 't':
-                                               *i = '\t'; break;
-                                       case 'b':
-                                               *i = '\b'; break;
-                                       case 'n':
-                                               *i = '\n'; break;
-                                       case 'f':
-                                               *i = '\f'; break;
-                                       case '0':
-                                               *i = '\0'; break;
-                                       default:
-                                               break;
-                                       }
-                       *++j = *i;
-                       }
-               j[1] = MYQUOTE;
-               j+=2;
-               prvstr = j;
-               }
-       else    {
-               if(*i == '(') ++parlev;
-               else if(*i == ')') --parlev;
-               else if(parlev == 0)
-                       if(*i == '=') expeql = 1;
-                       else if(*i == ',') expcom = 1;
-copychar:              /*not a string or space -- copy, shifting case if necessary */
-               if(shiftcase && isupper(*i))
-                       *j++ = tolower(*i);
-               else    *j++ = *i;
-               }
-       }
-lastch = j - 1;
-nextch = s;
-}
-\f
-LOCAL analyz()
-{
-register char *i;
-
-       if(parlev != 0)
-               {
-               err("unbalanced parentheses, statement skipped");
-               stkey = SUNKNOWN;
-               return;
-               }
-       if(nextch+2<=lastch && nextch[0]=='i' && nextch[1]=='f' && nextch[2]=='(')
-               {
-/* assignment or if statement -- look at character after balancing paren */
-               parlev = 1;
-               for(i=nextch+3 ; i<=lastch; ++i)
-                       if(*i == (MYQUOTE))
-                               {
-                               while(*++i != MYQUOTE)
-                                       ;
-                               }
-                       else if(*i == '(')
-                               ++parlev;
-                       else if(*i == ')')
-                               {
-                               if(--parlev == 0)
-                                       break;
-                               }
-               if(i >= lastch)
-                       stkey = SLOGIF;
-               else if(i[1] == '=')
-                       stkey = SLET;
-               else if( isdigit(i[1]) )
-                       stkey = SARITHIF;
-               else    stkey = SLOGIF;
-               if(stkey != SLET)
-                       nextch += 2;
-               }
-       else if(expeql) /* may be an assignment */
-               {
-               if(expcom && nextch<lastch &&
-                       nextch[0]=='d' && nextch[1]=='o')
-                               {
-                               stkey = SDO;
-                               nextch += 2;
-                               }
-               else    stkey = SLET;
-               }
-/* otherwise search for keyword */
-       else    {
-               stkey = getkwd();
-               if(stkey==SGOTO && lastch>=nextch)
-                       if(nextch[0]=='(')
-                               stkey = SCOMPGOTO;
-                       else if(isalpha(nextch[0]))
-                               stkey = SASGOTO;
-               }
-       parlev = 0;
-}
-
-
-
-LOCAL getkwd()
-{
-register char *i, *j;
-register struct keylist *pk, *pend;
-int k;
-
-if(! isalpha(nextch[0]) )
-       return(SUNKNOWN);
-k = nextch[0] - 'a';
-if(pk = keystart[k])
-       for(pend = keyend[k] ; pk<=pend ; ++pk )
-               {
-               i = pk->keyname;
-               j = nextch;
-               while(*++i==*++j && *i!='\0')
-                       ;
-               if(*i=='\0' && j<=lastch+1)
-                       {
-                       nextch = j;
-                       return(pk->keyval);
-                       }
-               }
-return(SUNKNOWN);
-}
-
-
-
-initkey()
-{
-extern struct keylist keys[];
-register struct keylist *p;
-register int i,j;
-
-for(i = 0 ; i<26 ; ++i)
-       keystart[i] = NULL;
-
-for(p = keys ; p->keyname ; ++p)
-       {
-       j = p->keyname[0] - 'a';
-       if(keystart[j] == NULL)
-               keystart[j] = p;
-       keyend[j] = p;
-       }
-}
-\f
-LOCAL gettok()
-{
-int havdot, havexp, havdbl;
-int radix;
-extern struct punctlist puncts[];
-struct punctlist *pp;
-extern struct fmtlist fmts[];
-extern struct dotlist dots[];
-struct dotlist *pd;
-
-char *i, *j, *n1, *p;
-
-       if(*nextch == (MYQUOTE))
-               {
-               ++nextch;
-               p = token;
-               while(*nextch != MYQUOTE)
-                       *p++ = *nextch++;
-               ++nextch;
-               toklen = p - token;
-               *p = '\0';
-               return (SHOLLERITH);
-               }
-/*
-       if(stkey == SFORMAT)
-               {
-               for(pf = fmts; pf->fmtchar; ++pf)
-                       {
-                       if(*nextch == pf->fmtchar)
-                               {
-                               ++nextch;
-                               if(pf->fmtval == SLPAR)
-                                       ++parlev;
-                               else if(pf->fmtval == SRPAR)
-                                       --parlev;
-                               return(pf->fmtval);
-                               }
-                       }
-               if( isdigit(*nextch) )
-                       {
-                       p = token;
-                       *p++ = *nextch++;
-                       while(nextch<=lastch && isdigit(*nextch) )
-                               *p++ = *nextch++;
-                       toklen = p - token;
-                       *p = '\0';
-                       if(nextch<=lastch && *nextch=='p')
-                               {
-                               ++nextch;
-                               return(SSCALE);
-                               }
-                       else    return(SICON);
-                       }
-               if( isalpha(*nextch) )
-                       {
-                       p = token;
-                       *p++ = *nextch++;
-                       while(nextch<=lastch &&
-                               (*nextch=='.' || isdigit(*nextch) || isalpha(*nextch) ))
-                                       *p++ = *nextch++;
-                       toklen = p - token;
-                       *p = '\0';
-                       return(SFIELD);
-                       }
-               goto badchar;
-               }
-/* Not a format statement */
-
-if(needkwd)
-       {
-       needkwd = 0;
-       return( getkwd() );
-       }
-
-       for(pp=puncts; pp->punchar; ++pp)
-               if(*nextch == pp->punchar)
-                       {
-                       if( (*nextch=='*' || *nextch=='/') &&
-                               nextch<lastch && nextch[1]==nextch[0])
-                                       {
-                                       if(*nextch == '*')
-                                               yylval = SPOWER;
-                                       else    yylval = SCONCAT;
-                                       nextch+=2;
-                                       }
-                       else    {yylval=pp->punval;
-                                       if(yylval==SLPAR)
-                                               ++parlev;
-                                       else if(yylval==SRPAR)
-                                               --parlev;
-                                       ++nextch;
-                               }
-                       return(yylval);
-                       }
-       if(*nextch == '.')
-               if(nextch >= lastch) goto badchar;
-               else if(isdigit(nextch[1])) goto numconst;
-               else    {
-                       for(pd=dots ; (j=pd->dotname) ; ++pd)
-                               {
-                               for(i=nextch+1 ; i<=lastch ; ++i)
-                                       if(*i != *j) break;
-                                       else if(*i != '.') ++j;
-                                       else    {
-                                               nextch = i+1;
-                                               return(pd->dotval);
-                                               }
-                               }
-                       goto badchar;
-                       }
-       if( isalpha(*nextch) )
-               {
-               p = token;
-               *p++ = *nextch++;
-               while(nextch<=lastch)
-                       if( isalpha(*nextch) || isdigit(*nextch) )
-                               *p++ = *nextch++;
-                       else break;
-               toklen = p - token;
-               *p = '\0';
-               if(inioctl && nextch<=lastch && *nextch=='=')
-                       {
-                       ++nextch;
-                       return(SNAMEEQ);
-                       }
-               if(toklen>=8 && eqn(8, token, "function") &&
-                       nextch<lastch && *nextch=='(')
-                               {
-                               nextch -= (toklen - 8);
-                               return(SFUNCTION);
-                               }
-               if(toklen > VL)
-                       {
-                       err2("name %s too long, truncated to %d", token, VL);
-                       toklen = VL;
-                       token[6] = '\0';
-                       }
-               if(toklen==1 && *nextch==MYQUOTE)
-                       {
-                       switch(token[0])
-                               {
-                               case 'z':  case 'Z':
-                               case 'x':  case 'X':
-                                       radix = 16; break;
-                               case 'o':  case 'O':
-                                       radix = 8; break;
-                               case 'b':  case 'B':
-                                       radix = 2; break;
-                               default:
-                                       err("bad bit identifier");
-                                       return(SNAME);
-                               }
-                       ++nextch;
-                       for(p = token ; *nextch!=MYQUOTE ; )
-                               if( hextoi(*p++ = *nextch++) >= radix)
-                                       {
-                                       err("invalid binary character");
-                                       break;
-                                       }
-                       ++nextch;
-                       toklen = p - token;
-                       return( radix==16 ? SHEXCON : (radix==8 ? SOCTCON : SBITCON) );
-                       }
-               return(SNAME);
-               }
-       if( ! isdigit(*nextch) ) goto badchar;
-numconst:
-       havdot = NO;
-       havexp = NO;
-       havdbl = NO;
-       for(n1 = nextch ; nextch<=lastch ; ++nextch)
-               {
-               if(*nextch == '.')
-                       if(havdot) break;
-                       else if(nextch+2<=lastch && isalpha(nextch[1])
-                               && isalpha(nextch[2]))
-                                       break;
-                       else    havdot = YES;
-               else if(*nextch=='d' || *nextch=='e')
-                       {
-                       p = nextch;
-                       havexp = YES;
-                       if(*nextch == 'd')
-                               havdbl = YES;
-                       if(nextch<lastch)
-                               if(nextch[1]=='+' || nextch[1]=='-')
-                                       ++nextch;
-                       if( ! isdigit(*++nextch) )
-                               {
-                               nextch = p;
-                               havdbl = havexp = NO;
-                               break;
-                               }
-                       for(++nextch ;
-                               nextch<=lastch && isdigit(*nextch);
-                               ++nextch);
-                       break;
-                       }
-               else if( ! isdigit(*nextch) )
-                       break;
-               }
-       p = token;
-       i = n1;
-       while(i < nextch)
-               *p++ = *i++;
-       toklen = p - token;
-       *p = '\0';
-       if(havdbl) return(SDCON);
-       if(havdot || havexp) return(SRCON);
-       return(SICON);
-badchar:
-       s[0] = *nextch++;
-       return(SUNKNOWN);
-}
-\f
-/* KEYWORD AND SPECIAL CHARACTER TABLES
-*/
-
-struct punctlist puncts[ ] =
-       {
-       '(', SLPAR,
-       ')', SRPAR,
-       '=', SEQUALS,
-       ',', SCOMMA,
-       '+', SPLUS,
-       '-', SMINUS,
-       '*', SSTAR,
-       '/', SSLASH,
-       '$', SCURRENCY,
-       ':', SCOLON,
-       0, 0 } ;
-
-/*
-LOCAL struct fmtlist  fmts[ ] =
-       {
-       '(', SLPAR,
-       ')', SRPAR,
-       '/', SSLASH,
-       ',', SCOMMA,
-       '-', SMINUS,
-       ':', SCOLON,
-       0, 0 } ;
-*/
-
-LOCAL struct dotlist  dots[ ] =
-       {
-       "and.", SAND, 
-       "or.", SOR, 
-       "not.", SNOT, 
-       "true.", STRUE, 
-       "false.", SFALSE, 
-       "eq.", SEQ, 
-       "ne.", SNE, 
-       "lt.", SLT, 
-       "le.", SLE, 
-       "gt.", SGT, 
-       "ge.", SGE, 
-       "neqv.", SNEQV, 
-       "eqv.", SEQV, 
-       0, 0 } ;
-
-LOCAL struct keylist  keys[ ] =
-       {
-       "assign",  SASSIGN,
-       "automatic",  SAUTOMATIC,
-       "backspace",  SBACKSPACE,
-       "blockdata",  SBLOCK,
-       "call",  SCALL,
-       "character",  SCHARACTER,
-       "close",  SCLOSE,
-       "common",  SCOMMON,
-       "complex",  SCOMPLEX,
-       "continue",  SCONTINUE,
-       "data",  SDATA,
-       "dimension",  SDIMENSION,
-       "doubleprecision",  SDOUBLE,
-       "doublecomplex", SDCOMPLEX,
-       "elseif",  SELSEIF,
-       "else",  SELSE,
-       "endfile",  SENDFILE,
-       "endif",  SENDIF,
-       "end",  SEND,
-       "entry",  SENTRY,
-       "equivalence",  SEQUIV,
-       "external",  SEXTERNAL,
-       "format",  SFORMAT,
-       "function",  SFUNCTION,
-       "goto",  SGOTO,
-       "implicit",  SIMPLICIT,
-       "include",  SINCLUDE,
-       "inquire",  SINQUIRE,
-       "intrinsic",  SINTRINSIC,
-       "integer",  SINTEGER,
-       "logical",  SLOGICAL,
-       "open",  SOPEN,
-       "parameter",  SPARAM,
-       "pause",  SPAUSE,
-       "print",  SPRINT,
-       "program",  SPROGRAM,
-       "punch",  SPUNCH,
-       "read",  SREAD,
-       "real",  SREAL,
-       "return",  SRETURN,
-       "rewind",  SREWIND,
-       "save",  SSAVE,
-       "static",  SSTATIC,
-       "stop",  SSTOP,
-       "subroutine",  SSUBROUTINE,
-       "then",  STHEN,
-       "undefined", SUNDEFINED,
-       "write",  SWRITE,
-       0, 0 };
diff --git a/.ref-Research-V7/usr/src/cmd/f77/locdefs b/.ref-Research-V7/usr/src/cmd/f77/locdefs
deleted file mode 100644 (file)
index b315a5d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef TARGET
-TARGET NOT DEFINED !!!
-#endif
-#if TARGET!=PDP11
-Target= TARGET OUT OF RANGE!!
-#endif
-
-#ifndef FAMILY
-FAMILY NOT DEFINED!!!
-#endif
-#if FAMILY!=SCJ && FAMILY!=DMR
-Family = FAMILY OUT OF RANGE
-#endif
-
-#define TYLENG TYLONG
-
-#define TYINT  TYSHORT
-#define SZADDR 2
-#define SZSHORT        2
-#define SZINT  2
-
-#define SZLONG 4
-#define SZLENG SZLONG
-
-#define ALIADDR SZADDR
-#define ALISHORT SZSHORT
-#define ALILONG 2
-#define ALIDOUBLE 2
-#define ALIINT ALILONG
-#define ALILENG        ALILONG
-
-
-#define AUTOREG 5
-#define ARGREG 4
-#define SAVESPACE 6
-
-#define FUDGEOFFSET 1
-#define BITSPERCHAR 8
-#define XL 8
-
-#define USETEXT        "\t.text"
-#define USECONST       "\t.data"
-#define USEBSS "\t.bss"
-#define USEINIT        "\t.data"
-
-#define BLANKCOMMON "_BLNK_"
-
-#define LABELFMT "%s:\n"
-#define MAXSHORT 32767
-
-#define MAXREGVAR 2
-#define TYIREG TYSHORT
-#define MSKIREG  M(TYSHORT)
diff --git a/.ref-Research-V7/usr/src/cmd/f77/main.c b/.ref-Research-V7/usr/src/cmd/f77/main.c
deleted file mode 100644 (file)
index 90064a7..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-char *xxxvers[] = "\nFORTRAN 77 PASS 1, VERSION 1.21,  20 APRIL 1979\n";
-
-#include "defs"
-
-
-main(argc, argv)
-int argc;
-char **argv;
-{
-char *s;
-int k, retcode;
-FILEP opf();
-
-#define DONE(c)        { retcode = c; goto finis; }
-
---argc;
-++argv;
-
-while(argc>0 && argv[0][0]=='-')
-       {
-       for(s = argv[0]+1 ; *s ; ++s) switch(*s)
-               {
-               case 'w':
-                       if(s[1]=='6' && s[2]=='6')
-                               {
-                               ftn66flag = YES;
-                               s += 2;
-                               }
-                       else
-                               nowarnflag = YES;
-                       break;
-
-               case 'U':
-                       shiftcase = NO;
-                       break;
-
-               case 'u':
-                       undeftype = YES;
-                       break;
-
-               case 'O':
-                       optimflag = YES;
-                       if( isdigit(s[1]) )
-                               {
-                               k = *++s - '0';
-                               if(k > MAXREGVAR)
-                                       {
-                                       warn1("-O%d: too many register variables", k);
-                                       maxregvar = MAXREGVAR;
-                                       }
-                               else
-                                       maxregvar = k;
-                               }
-                       break;
-
-               case 'd':
-                       debugflag = YES;
-                       break;
-
-               case 'p':
-                       profileflag = YES;
-                       break;
-
-               case 'C':
-                       checksubs = YES;
-                       break;
-
-               case '1':
-                       onetripflag = YES;
-                       break;
-
-               case 'I':
-                       if(*++s == '2')
-                               tyint = TYSHORT;
-                       else if(*s == '4')
-                               {
-                               shortsubs = NO;
-                               tyint = TYLONG;
-                               }
-                       else if(*s == 's')
-                               shortsubs = YES;
-                       else
-                               fatal1("invalid flag -I%c\n", *s);
-                       tylogical = tyint;
-                       break;
-
-               default:
-                       fatal1("invalid flag %c\n", *s);
-               }
-       --argc;
-       ++argv;
-       }
-
-if(argc != 4)
-       fatal1("arg count %d", argc);
-asmfile  = opf(argv[1]);
-initfile = opf(argv[2]);
-textfile = opf(argv[3]);
-
-initkey();
-if(inilex( copys(argv[0]) ))
-       DONE(1);
-fprintf(diagfile, "%s:\n", argv[0]);
-fileinit();
-procinit();
-if(k = yyparse())
-       {
-       fprintf(diagfile, "Bad parse, return code %d\n", k);
-       DONE(1);
-       }
-if(nerr > 0)
-       DONE(1);
-if(parstate != OUTSIDE)
-       {
-       warn("missing END statement");
-       endproc();
-       }
-doext();
-preven(ALIDOUBLE);
-prtail();
-#if FAMILY==SCJ
-       puteof();
-#endif
-DONE(0);
-
-
-finis:
-       done(retcode);
-       return(retcode);
-}
-
-
-
-done(k)
-int k;
-{
-static int recurs      = NO;
-
-if(recurs == NO)
-       {
-       recurs = YES;
-       clfiles();
-       }
-exit(k);
-}
-
-
-LOCAL FILEP opf(fn)
-char *fn;
-{
-FILEP fp;
-if( fp = fopen(fn, "w") )
-       return(fp);
-
-fatal1("cannot open intermediate file %s", fn);
-/* NOTREACHED */
-}
-
-
-
-LOCAL clfiles()
-{
-clf(&textfile);
-clf(&asmfile);
-clf(&initfile);
-}
-
-
-clf(p)
-FILEP *p;
-{
-if(p!=NULL && *p!=NULL && *p!=stdout)
-       {
-       if(ferror(*p))
-               fatal("writing error");
-       fclose(*p);
-       }
-*p = NULL;
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/f77/makefile b/.ref-Research-V7/usr/src/cmd/f77/makefile
deleted file mode 100644 (file)
index 86a9af1..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#      Makefile for the Fortran 77 compiler
-#      running on the PDP11,
-#      generating code for the PDP11,
-#      using the Ritchie pass 2
-
-all:   f77 f77pass1
-
-cp:    all
-       cp f77 /bin
-       cp f77pass1 /lib
-       rm *.o gram.c f77 f77pass1
-
-cmp:   all
-       cmp f77 /bin/f77
-       cmp f77pass1 /lib/f77pass1
-       rm *.o gram.c f77 f77pass1
-
-CFL = -DTARGET=PDP11 -DFAMILY=DMR -DHERE=PDP11 -DOUTPUT=BINARY -DPOLISH=POSTFIX
-CFLAGS = -O -s $(CFL)
-LDFLAGS = -i -s
-
-OBJECTS = main.o init.o gram.o lex.o proc.o \
-         equiv.o data.o expr.o exec.o intr.o io.o misc.o error.o\
-         put.o putdmr.o pdp11.o pdp11x.o
-
-compiler :: f77 f77pass1
-       touch compiler
-
-compiler :: /lib/c1
-       @echo "***Warning: /lib/c1 has changed"
-
-f77 : driver.o pdp11x.o
-       cc -n -s driver.o pdp11x.o -o f77
-       @size f77
-f77pass1 : $(OBJECTS)
-       @echo LOAD
-       @$(CC) $(LDFLAGS)  $(OBJECTS) -o f77pass1
-       @size f77pass1
-
-gram.c:        gram.head gram.dcl gram.expr gram.exec gram.io tokdefs
-       ( sed <tokdefs "s/#define/%token/" ;\
-               cat gram.head gram.dcl gram.expr gram.exec gram.io ) >gram.in
-       $(YACC) $(YFLAGS) gram.in
-       mv y.tab.c gram.c
-       rm gram.in
-
-tokdefs: tokens
-       grep -n . <tokens | sed "s/\([^:]*\):\(.*\)/#define \2 \1/" >tokdefs
-
-lex.o : tokdefs
-driver.o $(OBJECTS)  : defs defines locdefs ftypes
-driver.o : drivedefs
-
-locdefs : pdp11defs
-       cp pdp11defs locdefs
-
-put.o putdmr.o pdp11.o : dmrdefs
-io.o : fio.h
-
-lint:
-       @echo "LINT DRIVER" >Lintout
-       @lint -p $(CFL) driver.c pdp11x.c >>Lintout
-       echo "LINT PASS1" >>Lintout
-       @nohup lint -p $(CFL) error.c exec.c intr.c expr.c gram.c init.c io.c\
-               lex.c main.c proc.c misc.c put.c putdmr.c pdp11.c pdp11x.c\
-               equiv.c data.c >>Lintout&
-
-cleanup:
-       -rm f gram.c *.o
-       du
-
-install: /usr/bin/f77 /usr/lib/f77pass1
-
-/usr/bin/f77 : f77
-       strip f77
-       @size f77 /usr/bin/f77
-       cp f77 /usr/bin/f77
-
-/usr/lib/f77pass1 : f77pass1
-       strip f77pass1
-       @size f77pass1 /usr/lib/f77pass1
-       -chmod u-t /usr/lib/f77pass1
-       @/usr/lib/f77pass1 2>/dev/null
-       cp f77pass1 /usr/lib/f77pass1
-       echo "***Now do a    chmod u+t /usr/lib/f77pass1    in su mode"
diff --git a/.ref-Research-V7/usr/src/cmd/f77/malloc.c b/.ref-Research-V7/usr/src/cmd/f77/malloc.c
deleted file mode 100644 (file)
index f2a4094..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#define ASSERT(p) if(!(p))botch("p");else
-botch(s)
-char *s;
-{
-       printf("assertion botched: %s\n",s);
-       abort();
-}
-/*     C storage allocator
- *     circular first-fit strategy
- *     works with noncontiguous, but monotonically linked, arena
- *     each block is preceded by a ptr to the (pointer of) 
- *     the next following block
- *     blocks are exact number of words long; BUSY
- *     bit in ptr is 1 for busy, 0 for idle
- *     gaps in arena are merely noted as busy blocks
- *     last block of arena (pointed to by alloct) is empty and
- *     has a pointer to first
- *     idle blocks are coalesced during space search
-*/
-/*     all these defines must be powers of 2 */
-#define WORD sizeof(struct store)
-#define BLOCK 1024
-#define BUSY 1
-#define NULL 0
-#define testbusy(p) ((int)(p)&BUSY)
-#define setbusy(p) ((int)(p)+BUSY)
-#define clearbusy(p) ((int)(p)&~BUSY)
-
-struct store { struct store *ptr; };
-
-struct store allocs[] = {      /*initial arena*/
-       setbusy(&allocs[1].ptr),
-       setbusy(&allocs[0].ptr)
-};
-struct store *allocp = &allocs[1];     /*search ptr*/
-struct store *alloct = &allocs[1];     /*arena top*/
-struct store *allocx;          /*for benefit of realloc*/
-struct store *sbrk();
-
-struct store *
-malloc(nbytes)
-unsigned nbytes;
-{
-       register struct store *p, *q;
-       register nw;
-       static temp;    /*coroutines assume no auto*/
-
-       nw = (nbytes+2*WORD-1)/WORD;
-       ASSERT(allocp>allocs && allocp<=alloct);
-       for(p=allocp; ; ) {
-               for(temp=0; ; ) {
-                       if(!testbusy(p->ptr)) {
-                               while(!testbusy((q=p->ptr)->ptr)) {
-                                       ASSERT(q>p&&q<alloct);
-                                       p->ptr = q->ptr;
-                               }
-                               if(q>=p+nw && p+nw>=p)
-                                       goto found;
-                       }
-                       q = p;
-                       p = clearbusy(p->ptr);
-                       if(p>q)
-                               ASSERT(p<=alloct);
-                       else if(q!=alloct || p!=allocs) {
-                               write(2,"corrupt arena\n",14);
-                               exit(0175);
-                       } else if(++temp>1)
-                               break;
-               }
-               temp = (nw+BLOCK/WORD)&~(BLOCK/WORD-1);
-               q = sbrk(0);
-               if(q+temp < q)
-                       return(NULL);
-               q = sbrk(temp*WORD);
-               if((int)q == -1)
-                       return(NULL);
-               ASSERT(q>alloct);
-               alloct->ptr = q;
-               if(q!=alloct+1)
-                       alloct->ptr = setbusy(alloct->ptr);
-               alloct = q->ptr = q+temp-1;
-               alloct->ptr = setbusy(allocs);
-       }
-found:
-       allocp = p + nw;
-       ASSERT(allocp<=alloct);
-       if(q>allocp) {
-               allocx = allocp->ptr;
-               allocp->ptr = p->ptr;
-       }
-       p->ptr = setbusy(allocp);
-       return(p+1);
-}
-/*     freeing strategy tuned for LIFO allocation
-*/
-free(p)
-register struct store *p;
-{
-       ASSERT(p>clearbusy(allocs[1].ptr)&&p<=alloct);
-       allocp = --p;
-       ASSERT(testbusy(p->ptr));
-       p->ptr = clearbusy(p->ptr);
-       ASSERT(p->ptr > allocp && p->ptr <= alloct);
-}
-\f
-struct { unsigned tag:4, vtype:4;};
-
-prbusy()
-{
-       register struct store *p, *q;
-
-       ASSERT(allocp>allocs && allocp<=alloct);
-       for(p=allocs; ; ) {
-                       if(testbusy(p->ptr))
-                               {
-                               printf("busy 0%o, tag %d, type %d, length %d\n",
-                                       p, p[1].tag, p[1].vtype,
-                                       clearbusy(p->ptr) - (int) p - 2 );
-                               }
-                       q = p;
-                       p = clearbusy(p->ptr);
-                       if(p>q)
-                               ASSERT(p<=alloct);
-                       else if(q!=alloct || p!=allocs)
-                               {
-                               write(2,"corrupt arena\n",14);
-                               exit(0175);
-                               }
-                       else return;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/misc.c b/.ref-Research-V7/usr/src/cmd/f77/misc.c
deleted file mode 100644 (file)
index 648fd33..0000000
+++ /dev/null
@@ -1,660 +0,0 @@
-#include "defs"
-
-
-
-cpn(n, a, b)
-register int n;
-register char *a, *b;
-{
-while(--n >= 0)
-       *b++ = *a++;
-}
-
-
-
-eqn(n, a, b)
-register int n;
-register char *a, *b;
-{
-while(--n >= 0)
-       if(*a++ != *b++)
-               return(NO);
-return(YES);
-}
-
-
-
-
-
-
-
-cmpstr(a, b, la, lb)   /* compare two strings */
-register char *a, *b;
-ftnint la, lb;
-{
-register char *aend, *bend;
-aend = a + la;
-bend = b + lb;
-
-
-if(la <= lb)
-       {
-       while(a < aend)
-               if(*a != *b)
-                       return( *a - *b );
-               else
-                       { ++a; ++b; }
-
-       while(b < bend)
-               if(*b != ' ')
-                       return(' ' - *b);
-               else
-                       ++b;
-       }
-
-else
-       {
-       while(b < bend)
-               if(*a != *b)
-                       return( *a - *b );
-               else
-                       { ++a; ++b; }
-       while(a < aend)
-               if(*a != ' ')
-                       return(*a - ' ');
-               else
-                       ++a;
-       }
-return(0);
-}
-
-
-
-
-
-chainp hookup(x,y)
-register chainp x, y;
-{
-register chainp p;
-
-if(x == NULL)
-       return(y);
-
-for(p = x ; p->nextp ; p = p->nextp)
-       ;
-p->nextp = y;
-return(x);
-}
-
-
-
-struct listblock *mklist(p)
-chainp p;
-{
-register struct listblock *q;
-
-q = ALLOC(listblock);
-q->tag = TLIST;
-q->listp = p;
-return(q);
-}
-
-
-chainp mkchain(p,q)
-register int p, q;
-{
-register chainp r;
-
-if(chains)
-       {
-       r = chains;
-       chains = chains->nextp;
-       }
-else
-       r = ALLOC(chain);
-
-r->datap = p;
-r->nextp = q;
-return(r);
-}
-
-
-
-char * varstr(n, s)
-register int n;
-register char *s;
-{
-register int i;
-static char name[XL+1];
-
-for(i=0;  i<n && *s!=' ' && *s!='\0' ; ++i)
-       name[i] = *s++;
-
-name[i] = '\0';
-
-return( name );
-}
-
-
-
-
-char * varunder(n, s)
-register int n;
-register char *s;
-{
-register int i;
-static char name[XL+1];
-
-for(i=0;  i<n && *s!=' ' && *s!='\0' ; ++i)
-       name[i] = *s++;
-
-#if TARGET != GCOS
-name[i++] = '_';
-#endif
-
-name[i] = '\0';
-
-return( name );
-}
-
-
-
-
-
-char * nounder(n, s)
-register int n;
-register char *s;
-{
-register int i;
-static char name[XL+1];
-
-for(i=0;  i<n && *s!=' ' && *s!='\0' ; ++s)
-       if(*s != '_')
-               name[i++] = *s;
-
-name[i] = '\0';
-
-return( name );
-}
-
-
-
-char *copyn(n, s)
-register int n;
-register char *s;
-{
-register char *p, *q;
-
-p = q = ckalloc(n);
-while(--n >= 0)
-       *q++ = *s++;
-return(p);
-}
-
-
-
-char *copys(s)
-char *s;
-{
-return( copyn( strlen(s)+1 , s) );
-}
-
-
-
-ftnint convci(n, s)
-register int n;
-register char *s;
-{
-ftnint sum;
-sum = 0;
-while(n-- > 0)
-       sum = 10*sum + (*s++ - '0');
-return(sum);
-}
-
-char *convic(n)
-ftnint n;
-{
-static char s[20];
-register char *t;
-
-s[19] = '\0';
-t = s+19;
-
-do     {
-       *--t = '0' + n%10;
-       n /= 10;
-       } while(n > 0);
-
-return(t);
-}
-
-
-
-double convcd(n, s)
-int n;
-register char *s;
-{
-double atof();
-char v[100];
-register char *t;
-if(n > 90)
-       {
-       err("too many digits in floating constant");
-       n = 90;
-       }
-for(t = v ; n-- > 0 ; s++)
-       *t++ = (*s=='d' ? 'e' : *s);
-*t = '\0';
-return( atof(v) );
-}
-
-
-
-struct nameblock *mkname(l, s)
-int l;
-register char *s;
-{
-struct hashentry *hp;
-int hash;
-register struct nameblock *q;
-register int i;
-char n[VL];
-
-hash = 0;
-for(i = 0 ; i<l && *s!='\0' ; ++i)
-       {
-       hash += *s;
-       n[i] = *s++;
-       }
-hash %= MAXHASH;
-while( i < VL )
-       n[i++] = ' ';
-
-hp = hashtab + hash;
-while(q = hp->varp)
-       if( hash==hp->hashval && eqn(VL,n,q->varname) )
-               return(q);
-       else if(++hp >= lasthash)
-               hp = hashtab;
-
-if(++nintnames >= MAXHASH-1)
-       fatal("hash table full");
-hp->varp = q = ALLOC(nameblock);
-hp->hashval = hash;
-q->tag = TNAME;
-cpn(VL, n, q->varname);
-return(q);
-}
-
-
-
-struct labelblock *mklabel(l)
-ftnint l;
-{
-register struct labelblock *lp;
-
-if(l == 0)
-       return(0);
-
-for(lp = labeltab ; lp < highlabtab ; ++lp)
-       if(lp->stateno == l)
-               return(lp);
-
-if(++highlabtab >= labtabend)
-       fatal("too many statement numbers");
-
-lp->stateno = l;
-lp->labelno = newlabel();
-lp->blklevel = 0;
-lp->labused = NO;
-lp->labdefined = NO;
-lp->labinacc = NO;
-lp->labtype = LABUNKNOWN;
-return(lp);
-}
-
-
-newlabel()
-{
-return( ++lastlabno );
-}
-
-
-/* find or put a name in the external symbol table */
-
-struct extsym *mkext(s)
-char *s;
-{
-int i;
-register char *t;
-char n[XL];
-struct extsym *p;
-
-i = 0;
-t = n;
-while(i<XL && *s)
-       *t++ = *s++;
-while(t < n+XL)
-       *t++ = ' ';
-
-for(p = extsymtab ; p<nextext ; ++p)
-       if(eqn(XL, n, p->extname))
-               return( p );
-
-if(nextext >= lastext)
-       fatal("too many external symbols");
-
-cpn(XL, n, nextext->extname);
-nextext->extstg = STGUNKNOWN;
-nextext->extsave = NO;
-nextext->extp = 0;
-nextext->extleng = 0;
-nextext->maxleng = 0;
-nextext->extinit = NO;
-return( nextext++ );
-}
-
-
-
-
-
-
-
-
-struct addrblock *builtin(t, s)
-int t;
-char *s;
-{
-register struct extsym *p;
-register struct addrblock *q;
-
-p = mkext(s);
-if(p->extstg == STGUNKNOWN)
-       p->extstg = STGEXT;
-else if(p->extstg != STGEXT)
-       {
-       err1("improper use of builtin %s", s);
-       return(0);
-       }
-
-q = ALLOC(addrblock);
-q->tag = TADDR;
-q->vtype = t;
-q->vclass = CLPROC;
-q->vstg = STGEXT;
-q->memno = p - extsymtab;
-return(q);
-}
-
-
-
-frchain(p)
-register chainp *p;
-{
-register chainp q;
-
-if(p==0 || *p==0)
-       return;
-
-for(q = *p; q->nextp ; q = q->nextp)
-       ;
-q->nextp = chains;
-chains = *p;
-*p = 0;
-}
-
-
-ptr cpblock(n,p)
-register int n;
-register char * p;
-{
-register char *q;
-ptr q0;
-
-q = q0 = ckalloc(n);
-while(n-- > 0)
-       *q++ = *p++;
-return(q0);
-}
-
-
-
-max(a,b)
-int a,b;
-{
-return( a>b ? a : b);
-}
-
-
-ftnint lmax(a, b)
-ftnint a, b;
-{
-return( a>b ? a : b);
-}
-
-ftnint lmin(a, b)
-ftnint a, b;
-{
-return(a < b ? a : b);
-}
-
-
-
-
-maxtype(t1, t2)
-int t1, t2;
-{
-int t;
-
-t = max(t1, t2);
-if(t==TYCOMPLEX && (t1==TYDREAL || t2==TYDREAL) )
-       t = TYDCOMPLEX;
-return(t);
-}
-
-
-
-/* return log base 2 of n if n a power of 2; otherwise -1 */
-#if FAMILY == SCJ
-log2(n)
-ftnint n;
-{
-int k;
-
-/* trick based on binary representation */
-
-if(n<=0 || (n & (n-1))!=0)
-       return(-1);
-
-for(k = 0 ;  n >>= 1  ; ++k)
-       ;
-return(k);
-}
-#endif
-
-
-
-frrpl()
-{
-struct rplblock *rp;
-
-while(rpllist)
-       {
-       rp = rpllist->nextp;
-       free(rpllist);
-       rpllist = rp;
-       }
-}
-
-
-popstack(p)
-register chainp *p;
-{
-register chainp q;
-
-if(p==NULL || *p==NULL)
-       fatal("popstack: stack empty");
-q = (*p)->nextp;
-free(*p);
-*p = q;
-}
-
-
-
-struct exprblock *callk(type, name, args)
-int type;
-char *name;
-chainp args;
-{
-register struct exprblock *p;
-
-p = mkexpr(OPCALL, builtin(type,name), args);
-p->vtype = type;
-return(p);
-}
-
-
-
-struct exprblock *call4(type, name, arg1, arg2, arg3, arg4)
-int type;
-char *name;
-expptr arg1, arg2, arg3, arg4;
-{
-struct listblock *args;
-args = mklist( mkchain(arg1, mkchain(arg2, mkchain(arg3, mkchain(arg4, NULL)) ) ) );
-return( callk(type, name, args) );
-}
-
-
-
-
-struct exprblock *call3(type, name, arg1, arg2, arg3)
-int type;
-char *name;
-expptr arg1, arg2, arg3;
-{
-struct listblock *args;
-args = mklist( mkchain(arg1, mkchain(arg2, mkchain(arg3, NULL) ) ) );
-return( callk(type, name, args) );
-}
-
-
-
-
-
-struct exprblock *call2(type, name, arg1, arg2)
-int type;
-char *name;
-expptr arg1, arg2;
-{
-struct listblock *args;
-
-args = mklist( mkchain(arg1, mkchain(arg2, NULL) ) );
-return( callk(type,name, args) );
-}
-
-
-
-
-struct exprblock *call1(type, name, arg)
-int type;
-char *name;
-expptr arg;
-{
-return( callk(type,name, mklist(mkchain(arg,0)) ));
-}
-
-
-struct exprblock *call0(type, name)
-int type;
-char *name;
-{
-return( callk(type, name, NULL) );
-}
-
-
-
-struct impldoblock *mkiodo(dospec, list)
-chainp dospec, list;
-{
-register struct impldoblock *q;
-
-q = ALLOC(impldoblock);
-q->tag = TIMPLDO;
-q->varnp = dospec;
-q->datalist = list;
-return(q);
-}
-
-
-
-
-ptr ckalloc(n)
-register int n;
-{
-register ptr p;
-ptr calloc();
-
-if( p = calloc(1, (unsigned) n) )
-       return(p);
-
-fatal("out of memory");
-/* NOTREACHED */
-}
-
-
-
-
-
-isaddr(p)
-register expptr p;
-{
-if(p->tag == TADDR)
-       return(YES);
-if(p->tag == TEXPR)
-       switch(p->opcode)
-               {
-               case OPCOMMA:
-                       return( isaddr(p->rightp) );
-
-               case OPASSIGN:
-               case OPPLUSEQ:
-                       return( isaddr(p->leftp) );
-               }
-return(NO);
-}
-
-
-
-
-
-addressable(p)
-register expptr p;
-{
-switch(p->tag)
-       {
-       case TCONST:
-               return(YES);
-
-       case TADDR:
-               return( addressable(p->memoffset) );
-
-       default:
-               return(NO);
-       }
-}
-
-
-
-hextoi(c)
-register int c;
-{
-register char *p;
-static char p0[17] = "0123456789abcdef";
-
-for(p = p0 ; *p ; ++p)
-       if(*p == c)
-               return( p-p0 );
-return(16);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/pdp11.c b/.ref-Research-V7/usr/src/cmd/f77/pdp11.c
deleted file mode 100644 (file)
index 8936b92..0000000
+++ /dev/null
@@ -1,465 +0,0 @@
-#include "defs"
-#if FAMILY == DMR
-#      include "dmrdefs"
-#endif
-#if FAMILY==SCJ && OUTPUT==BINARY
-#      include "scjdefs"
-#endif
-
-/*
-      PDP 11-SPECIFIC PRINTING ROUTINES
-*/
-
-int maxregvar = 0;
-static char textline[50];
-int regnum[] = { 3, 2 };
-
-
-prsave()
-{
-}
-
-
-
-goret(type)
-int type;
-{
-#if  FAMILY == DMR
-       p2op(P2RETURN);
-#endif
-#if FAMILY==SCJ
-       p2pass(sprintf(textline, "\tjmp\tcret"));
-#endif
-}
-
-
-
-
-/*
- * move argument slot arg1 (relative to ap)
- * to slot arg2 (relative to ARGREG)
- */
-
-mvarg(type, arg1, arg2)
-int type, arg1, arg2;
-{
-mvarg1(arg1+4, arg2);
-if(type == TYLONG)
-       mvarg1(arg1+6, arg2+2);
-}
-
-
-
-
-mvarg1(m, n)
-int m, n;
-{
-#if FAMILY == DMR
-       p2reg(ARGREG, P2SHORT|P2PTR);
-       p2op2(P2ICON, P2SHORT);
-       p2i(n);
-       p2op2(P2PLUS, P2SHORT|P2PTR);
-       p2op2(P2INDIRECT, P2SHORT);
-       p2reg(AUTOREG, P2SHORT|P2PTR);
-       p2op2(P2ICON, P2SHORT);
-       p2i(m);
-       p2op2(P2PLUS, P2SHORT|P2PTR);
-       p2op2(P2INDIRECT, P2SHORT);
-       p2op2(P2ASSIGN, P2SHORT);
-       putstmt();
-#endif
-#if FAMILY == SCJ
-       p2pass(sprintf(textline, "\tmov\t%d.(r5),%d.(r4)", m, n));
-#endif
-}
-
-
-
-
-prlabel(fp, k)
-FILEP fp;
-int k;
-{
-fprintf(fp, "L%d:\n", k);
-}
-
-
-
-prconi(fp, type, n)
-FILEP fp;
-int type;
-ftnint n;
-{
-register int *np;
-np = &n;
-if(type == TYLONG)
-       fprintf(fp, "\t%d.;%d.\n", np[0], np[1]);
-else
-       fprintf(fp, "\t%d.\n", np[1]);
-}
-
-
-
-prcona(fp, a)
-FILEP fp;
-ftnint a;
-{
-fprintf(fp, "L%ld\n", a);
-}
-
-
-
-#if HERE!=PDP11
-BAD NEWS
-#endif
-
-#if HERE==PDP11
-prconr(fp, type, x)
-FILEP fp;
-int type;
-double x;
-{
-register int k, *n;
-n = &x;        /* nonportable cheat */
-k = (type==TYREAL ? 2 : 4);
-fprintf(fp, "\t");
-while(--k >= 0)
-       fprintf(fp, "%d.%c", *n++, (k==0 ? '\n' : ';') );
-}
-#endif
-
-
-
-
-preven(k)
-int k;
-{
-if(k > 1)
-       fprintf(asmfile, "\t.even\n", k);
-}
-
-
-
-#if FAMILY == SCJ
-
-prcmgoto(p, nlab, skiplabel, labarray)
-expptr p;
-int nlab, skiplabel, labarray;
-{
-int regno;
-
-putforce(p->vtype, p);
-
-if(p->vtype == TYLONG)
-       {
-       regno = 1;
-       p2pass(sprintf(textline, "\ttst\tr0"));
-       p2pass(sprintf(textline, "\tbne\tL%d", skiplabel));
-       }
-else
-       regno = 0;
-
-p2pass(sprintf(textline, "\tcmp\tr%d,$%d.", regno, nlab));
-p2pass(sprintf(textline, "\tbhi\tL%d", skiplabel));
-p2pass(sprintf(textline, "\tasl\tr%d", regno));
-p2pass(sprintf(textline, "\tjmp\t*L%d(r%d)", labarray, regno));
-}
-
-
-prarif(p, neg,zer,pos)
-expptr p;
-int neg, zer, pos;
-{
-register int ptype;
-
-putforce( ptype = p->vtype, p);
-if( ISINT(ptype) )
-       {
-       p2pass(sprintf(textline, "\ttst\tr0"));
-       p2pass(sprintf(textline, "\tjlt\tL%d", neg));
-       p2pass(sprintf(textline, "\tjgt\tL%d", pos));
-       if(ptype != TYSHORT)
-               {
-               p2pass(sprintf(textline, "\ttst\tr1"));
-               p2pass(sprintf(textline, "\tjeq\tL%d", zer));
-               }
-       p2pass(sprintf(textline, "\tjbr\tL%d", pos));
-       }
-else
-       {
-       p2pass(sprintf(textline, "\ttstf\tr0"));
-       p2pass(sprintf(textline, "\tcfcc"));
-       p2pass(sprintf(textline, "\tjeq\tL%d", zer));
-       p2pass(sprintf(textline, "\tjlt\tL%d", neg));
-       p2pass(sprintf(textline, "\tjmp\tL%d", pos));
-       }
-}
-
-#endif
-
-
-
-
-char *memname(stg, mem)
-int stg, mem;
-{
-static char s[20];
-
-switch(stg)
-       {
-       case STGCOMMON:
-       case STGEXT:
-               sprintf(s, "_%s", varstr(XL, extsymtab[mem].extname) );
-               break;
-
-       case STGBSS:
-       case STGINIT:
-               sprintf(s, "v.%d", mem);
-               break;
-
-       case STGCONST:
-               sprintf(s, "L%d", mem);
-               break;
-
-       case STGEQUIV:
-               sprintf(s, "q.%d", mem);
-               break;
-
-       default:
-               fatal1("memname: invalid vstg %d", stg);
-       }
-return(s);
-}
-
-
-prlocvar(s, len)
-char *s;
-ftnint len;
-{
-fprintf(asmfile, "%s:", s);
-prskip(asmfile, len);
-}
-
-
-
-prext(name, leng, init)
-char *name;
-ftnint leng;
-int init;
-{
-if(leng==0 || init)
-       fprintf(asmfile, "\t.globl\t_%s\n", name);
-else
-       fprintf(asmfile, "\t.comm\t_%s,%ld.\n", name, leng);
-}
-
-
-
-prendproc()
-{
-}
-
-
-
-prtail()
-{
-#if FAMILY == SCJ
-       p2pass(sprintf(textline, "\t.globl\tcsv,cret"));
-#else
-       p2op(P2EOF);
-#endif
-}
-
-
-
-prolog(ep, argvec)
-struct entrypoint *ep;
-struct addrblock *argvec;
-{
-int i, argslot, proflab;
-register chainp p;
-register struct nameblock *q;
-register struct dimblock *dp;
-struct constblock *mkaddcon();
-
-if(procclass == CLMAIN)
-       prentry("MAIN__");
-
-if(ep->entryname)
-       prentry( varstr(XL, ep->entryname->extname) );
-
-if(procclass == CLBLOCK)
-       return;
-if(profileflag)
-       proflab = newlabel();
-#if FAMILY == SCJ
-       if(profileflag)
-               {
-               fprintf(asmfile, "L%d:\t. = .+2\n", proflab);
-               p2pass(sprintf(textline, "\tmov\t$L%d,r0", proflab));
-               p2pass(sprintf(textline, "\tjsr\tpc,mcount"));
-               }
-       p2pass(sprintf(textline, "\tjsr\tr5,csv"));
-       p2pass(sprintf(textline, "\tsub\t$.F%d,sp", procno));
-#else
-       if(profileflag)
-               p2op2(P2PROFILE, proflab);
-       p2op(P2SAVE);
-       p2op2(P2SETSTK, ( (((int) autoleng)+1) & ~01) );
-#endif
-
-if(argvec == NULL)
-       addreg(argloc = 4);
-else
-       {
-       addreg( argloc = argvec->memoffset->const.ci );
-       if(proctype == TYCHAR)
-               {
-               mvarg(TYADDR, 0, chslot);
-               mvarg(TYLENG, SZADDR, chlgslot);
-               argslot = SZADDR + SZLENG;
-               }
-       else if( ISCOMPLEX(proctype) )
-               {
-               mvarg(TYADDR, 0, cxslot);
-               argslot = SZADDR;
-               }
-       else
-               argslot = 0;
-
-       for(p = ep->arglist ; p ; p =p->nextp)
-               {
-               q = p->datap;
-               mvarg(TYADDR, argslot, q->vardesc.varno);
-               argslot += SZADDR;
-               }
-       for(p = ep->arglist ; p ; p = p->nextp)
-               {
-               q = p->datap;
-               if(q->vtype==TYCHAR || q->vclass==CLPROC)
-                       {
-                       if( q->vleng && ! ISCONST(q->vleng) )
-                               mvarg(TYLENG, argslot, q->vleng->memno);
-                       argslot += SZLENG;
-                       }
-               }
-       }
-
-for(p = ep->arglist ; p ; p = p->nextp)
-       if(dp = ( (struct nameblock *) (p->datap) ) ->vdim)
-               {
-               for(i = 0 ; i < dp->ndim ; ++i)
-                       if(dp->dims[i].dimexpr)
-                               puteq( fixtype(cpexpr(dp->dims[i].dimsize)),
-                                       fixtype(cpexpr(dp->dims[i].dimexpr)));
-               if(dp->basexpr)
-                       puteq(  cpexpr(fixtype(dp->baseoffset)),
-                               cpexpr(fixtype(dp->basexpr)));
-               }
-
-if(typeaddr)
-       puteq( cpexpr(typeaddr), mkaddcon(ep->typelabel) );
-putgoto(ep->entrylabel);
-}
-
-
-
-prentry(s)
-char *s;
-{
-#if FAMILY == SCJ
-       p2pass(sprintf(textline, "_%s:", s));
-#else
-       p2op(P2RLABEL);
-       putc('_', textfile);
-       p2str(s);
-#endif
-}
-
-
-
-
-addreg(k)
-int k;
-{
-#if FAMILY == SCJ
-       p2pass(sprintf(textline, "\tmov\tr5,r4"));
-       p2pass(sprintf(textline, "\tadd\t$%d.,r4", k));
-#else
-       p2reg(ARGREG, P2SHORT);
-       p2reg(AUTOREG, P2SHORT);
-       p2op2(P2ICON, P2SHORT);
-       p2i(k);
-       p2op2(P2PLUS, P2SHORT);
-       p2op2(P2ASSIGN, P2SHORT);
-       putstmt();
-#endif
-}
-
-
-
-
-
-prhead(fp)
-FILEP fp;
-{
-#if FAMILY==SCJ
-#      if OUTPUT == BINARY
-               p2triple(P2LBRACKET, ARGREG-1-highregvar, procno);
-               p2word( (long) (BITSPERCHAR*autoleng) );
-               p2flush();
-#      else
-               fprintf(fp, "[%02d\t%06ld\t%02d\t\n", procno,
-                       BITSPERCHAR*autoleng, ARGREG-1-highregvar);
-#      endif
-#endif
-}
-\f
-prdbginfo()
-{
-register char *s;
-char *t, buff[50];
-register struct nameblock *p;
-struct hashentry *hp;
-
-if(s = entries->entryname->extname)
-       s = varstr(XL, s);
-else if(procclass == CLMAIN)
-       s = "MAIN__";
-else
-       return;
-
-if(procclass != CLBLOCK)
-       fprintf(asmfile, "~~%s = _%s\n", s, s);
-
-for(hp = hashtab ; hp<lasthash ; ++hp)
-    if(p = hp->varp)
-       {
-       s = NULL;
-       if(p->vstg == STGARG)
-               s = sprintf(buff, "%o", p->vardesc.varno+argloc);
-       else if(p->vclass == CLVAR)
-               switch(p->vstg)
-                       {
-                       case STGBSS:
-                       case STGINIT:
-                       case STGEQUIV:
-                               t = memname(p->vstg, p->vardesc.varno);
-                               if(p->voffset)
-                                       s = sprintf(buff, "%s+%o", t, p->voffset);
-                               else
-                                       s = sprintf(buff, "%s", t);
-                               break;
-
-                       case STGAUTO:
-                               s = sprintf(buff, "%o", p->voffset);
-                               break;
-
-                       default:
-                               break;
-                       }
-       if(s)
-               fprintf(asmfile, "~%s = %s\n", varstr(VL,p->varname), s);
-       }
-fprintf(asmfile, "~~:\n");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/pdp11defs b/.ref-Research-V7/usr/src/cmd/f77/pdp11defs
deleted file mode 100644 (file)
index b315a5d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef TARGET
-TARGET NOT DEFINED !!!
-#endif
-#if TARGET!=PDP11
-Target= TARGET OUT OF RANGE!!
-#endif
-
-#ifndef FAMILY
-FAMILY NOT DEFINED!!!
-#endif
-#if FAMILY!=SCJ && FAMILY!=DMR
-Family = FAMILY OUT OF RANGE
-#endif
-
-#define TYLENG TYLONG
-
-#define TYINT  TYSHORT
-#define SZADDR 2
-#define SZSHORT        2
-#define SZINT  2
-
-#define SZLONG 4
-#define SZLENG SZLONG
-
-#define ALIADDR SZADDR
-#define ALISHORT SZSHORT
-#define ALILONG 2
-#define ALIDOUBLE 2
-#define ALIINT ALILONG
-#define ALILENG        ALILONG
-
-
-#define AUTOREG 5
-#define ARGREG 4
-#define SAVESPACE 6
-
-#define FUDGEOFFSET 1
-#define BITSPERCHAR 8
-#define XL 8
-
-#define USETEXT        "\t.text"
-#define USECONST       "\t.data"
-#define USEBSS "\t.bss"
-#define USEINIT        "\t.data"
-
-#define BLANKCOMMON "_BLNK_"
-
-#define LABELFMT "%s:\n"
-#define MAXSHORT 32767
-
-#define MAXREGVAR 2
-#define TYIREG TYSHORT
-#define MSKIREG  M(TYSHORT)
diff --git a/.ref-Research-V7/usr/src/cmd/f77/pdp11x.c b/.ref-Research-V7/usr/src/cmd/f77/pdp11x.c
deleted file mode 100644 (file)
index 5a8cc3f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <stdio.h>
-#include "defines"
-#include "locdefs"
-
-
-
-prchars(fp, s)
-FILEP fp;
-register int *s;
-{
-register int i;
-
-fprintf(fp, ".byte ");
-for(i = 0; i<SZSHORT ; ++i)
-       fprintf(fp, "%o%c", *s++, (i==SZSHORT-1 ? '\n' : ',' ) );
-}
-
-
-
-
-
-pruse(fp, s)
-FILEP fp;
-char *s;
-{
-fprintf(fp, "%s\n", s);
-}
-
-
-
-
-
-prskip(fp, k)
-FILEP fp;
-ftnint k;
-{
-/* works around bug in the pdp11 assembler that bombs on  . = .+x  for x>= 32768 */
-for( ; k > 30000 ; k -= 30000)
-       fprintf(fp, "\t. = .+30000.\n");
-fprintf(fp, "\t. = .+%ld.\n", k);
-}
-
-
-prcomblock(fp, name)
-FILEP fp;
-char *name;
-{
-fprintf(fp, LABELFMT, name);
-}
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/f77/proc.c b/.ref-Research-V7/usr/src/cmd/f77/proc.c
deleted file mode 100644 (file)
index 48008a8..0000000
+++ /dev/null
@@ -1,883 +0,0 @@
-#include "defs"
-
-/* start a new procedure */
-
-newproc()
-{
-if(parstate != OUTSIDE)
-       {
-       execerr("missing end statement", 0);
-       endproc();
-       }
-
-parstate = INSIDE;
-procclass = CLMAIN;    /* default */
-}
-
-
-
-/* end of procedure. generate variables, epilogs, and prologs */
-
-endproc()
-{
-struct labelblock *lp;
-
-if(parstate < INDATA)
-       enddcl();
-if(ctlstack >= ctls)
-       err("DO loop or BLOCK IF not closed");
-for(lp = labeltab ; lp < labtabend ; ++lp)
-       if(lp->stateno!=0 && lp->labdefined==NO)
-               err1("missing statement number %s", convic(lp->stateno) );
-
-epicode();
-procode();
-dobss();
-prdbginfo();
-
-#if FAMILY == SCJ
-       putbracket();
-#endif
-
-procinit();    /* clean up for next procedure */
-}
-
-
-
-/* End of declaration section of procedure.  Allocate storage. */
-
-enddcl()
-{
-register struct entrypoint *p;
-
-parstate = INEXEC;
-docommon();
-doequiv();
-docomleng();
-for(p = entries ; p ; p = p->nextp)
-       doentry(p);
-}
-\f
-/* ROUTINES CALLED WHEN ENCOUNTERING ENTRY POINTS */
-
-/* Main program or Block data */
-
-startproc(progname, class)
-struct extsym * progname;
-int class;
-{
-register struct entrypoint *p;
-
-p = ALLOC(entrypoint);
-if(class == CLMAIN)
-       puthead("MAIN__", CLMAIN);
-else
-       puthead(NULL, CLBLOCK);
-if(class == CLMAIN)
-       newentry( mkname(5, "MAIN_") );
-p->entryname = progname;
-p->entrylabel = newlabel();
-entries = p;
-
-procclass = class;
-retlabel = newlabel();
-fprintf(diagfile, "   %s", (class==CLMAIN ? "MAIN" : "BLOCK DATA") );
-if(progname)
-       fprintf(diagfile, " %s", nounder(XL, procname = progname->extname) );
-fprintf(diagfile, ":\n");
-}
-
-/* subroutine or function statement */
-
-struct extsym *newentry(v)
-register struct nameblock *v;
-{
-register struct extsym *p;
-struct extsym *mkext();
-
-p = mkext( varunder(VL, v->varname) );
-
-if(p==NULL || p->extinit || ! ONEOF(p->extstg, M(STGUNKNOWN)|M(STGEXT)) )
-       {
-       if(p == 0)
-               dclerr("invalid entry name", v);
-       else    dclerr("external name already used", v);
-       return(0);
-       }
-v->vstg = STGAUTO;
-v->vprocclass = PTHISPROC;
-v->vclass = CLPROC;
-p->extstg = STGEXT;
-p->extinit = YES;
-return(p);
-}
-
-
-entrypt(class, type, length, entry, args)
-int class, type;
-ftnint length;
-struct extsym *entry;
-chainp args;
-{
-register struct nameblock *q;
-register struct entrypoint *p;
-
-if(class != CLENTRY)
-       puthead( varstr(XL, procname = entry->extname), class);
-if(class == CLENTRY)
-       fprintf(diagfile, "       entry ");
-fprintf(diagfile, "   %s:\n", nounder(XL, entry->extname));
-q = mkname(VL, nounder(XL,entry->extname) );
-
-if( (type = lengtype(type, (int) length)) != TYCHAR)
-       length = 0;
-if(class == CLPROC)
-       {
-       procclass = CLPROC;
-       proctype = type;
-       procleng = length;
-
-       retlabel = newlabel();
-       if(type == TYSUBR)
-               ret0label = newlabel();
-       }
-
-p = ALLOC(entrypoint);
-entries = hookup(entries, p);
-p->entryname = entry;
-p->arglist = args;
-p->entrylabel = newlabel();
-p->enamep = q;
-
-if(class == CLENTRY)
-       {
-       class = CLPROC;
-       if(proctype == TYSUBR)
-               type = TYSUBR;
-       }
-
-q->vclass = class;
-q->vprocclass = PTHISPROC;
-settype(q, type, (int) length);
-/* hold all initial entry points till end of declarations */
-if(parstate >= INDATA)
-       doentry(p);
-}
-\f
-/* generate epilogs */
-
-LOCAL epicode()
-{
-register int i;
-
-if(procclass==CLPROC)
-       {
-       if(proctype==TYSUBR)
-               {
-               putlabel(ret0label);
-               if(substars)
-                       putforce(TYINT, ICON(0) );
-               putlabel(retlabel);
-               goret(TYSUBR);
-               }
-       else    {
-               putlabel(retlabel);
-               if(multitypes)
-                       {
-                       typeaddr = autovar(1, TYADDR, NULL);
-                       putbranch( cpexpr(typeaddr) );
-                       for(i = 0; i < NTYPES ; ++i)
-                               if(rtvlabel[i] != 0)
-                                       {
-                                       putlabel(rtvlabel[i]);
-                                       retval(i);
-                                       }
-                       }
-               else
-                       retval(proctype);
-               }
-       }
-
-else if(procclass != CLBLOCK)
-       {
-       putlabel(retlabel);
-       goret(TYSUBR);
-       }
-}
-
-
-/* generate code to return value of type  t */
-
-LOCAL retval(t)
-register int t;
-{
-register struct addrblock *p;
-
-switch(t)
-       {
-       case TYCHAR:
-       case TYCOMPLEX:
-       case TYDCOMPLEX:
-               break;
-
-       case TYLOGICAL:
-               t = tylogical;
-       case TYADDR:
-       case TYSHORT:
-       case TYLONG:
-               p = cpexpr(retslot);
-               p->vtype = t;
-               putforce(t, p);
-               break;
-
-       case TYREAL:
-       case TYDREAL:
-               p = cpexpr(retslot);
-               p->vtype = t;
-               putforce(t, p);
-               break;
-
-       default:
-               fatal1("retval: impossible type %d", t);
-       }
-goret(t);
-}
-
-
-/* Allocate extra argument array if needed. Generate prologs. */
-
-LOCAL procode()
-{
-register struct entrypoint *p;
-struct addrblock *argvec;
-
-#if TARGET==GCOS
-       argvec = autovar(lastargslot/SZADDR, TYADDR, NULL);
-#else
-       if(lastargslot>0 && nentry>1)
-               argvec = autovar(lastargslot/SZADDR, TYADDR, NULL);
-       else
-               argvec = NULL;
-#endif
-
-
-#if TARGET == PDP11
-       /* for the optimizer */
-       if(fudgelabel)
-               putlabel(fudgelabel);
-#endif
-
-for(p = entries ; p ; p = p->nextp)
-       prolog(p, argvec);
-
-#if FAMILY == SCJ
-       putrbrack(procno);
-#endif
-
-prendproc();
-}
-\f
-/*
-   manipulate argument lists (allocate argument slot positions)
- * keep track of return types and labels
- */
-
-LOCAL doentry(ep)
-struct entrypoint *ep;
-{
-register int type;
-register struct nameblock *np;
-chainp p;
-register struct nameblock *q;
-
-++nentry;
-if(procclass == CLMAIN)
-       {
-       putlabel(ep->entrylabel);
-       return;
-       }
-else if(procclass == CLBLOCK)
-       return;
-
-impldcl( np = mkname(VL, nounder(XL, ep->entryname->extname) ) );
-type = np->vtype;
-if(proctype == TYUNKNOWN)
-       if( (proctype = type) == TYCHAR)
-               procleng = (np->vleng ? np->vleng->const.ci : (ftnint) 0);
-
-if(proctype == TYCHAR)
-       {
-       if(type != TYCHAR)
-               err("noncharacter entry of character function");
-       else if( (np->vleng ? np->vleng->const.ci : (ftnint) 0) != procleng)
-               err("mismatched character entry lengths");
-       }
-else if(type == TYCHAR)
-       err("character entry of noncharacter function");
-else if(type != proctype)
-       multitype = YES;
-if(rtvlabel[type] == 0)
-       rtvlabel[type] = newlabel();
-ep->typelabel = rtvlabel[type];
-
-if(type == TYCHAR)
-       {
-       if(chslot < 0)
-               {
-               chslot = nextarg(TYADDR);
-               chlgslot = nextarg(TYLENG);
-               }
-       np->vstg = STGARG;
-       np->vardesc.varno = chslot;
-       if(procleng == 0)
-               np->vleng = mkarg(TYLENG, chlgslot);
-       }
-else if( ISCOMPLEX(type) )
-       {
-       np->vstg = STGARG;
-       if(cxslot < 0)
-               cxslot = nextarg(TYADDR);
-       np->vardesc.varno = cxslot;
-       }
-else if(type != TYSUBR)
-       {
-       if(nentry == 1)
-               retslot = autovar(1, TYDREAL, NULL);
-       np->vstg = STGAUTO;
-       np->voffset = retslot->memoffset->const.ci;
-       }
-
-for(p = ep->arglist ; p ; p = p->nextp)
-       if(! ((q = p->datap)->vdcldone) )
-               q->vardesc.varno = nextarg(TYADDR);
-
-for(p = ep->arglist ; p ; p = p->nextp)
-       if(! ((q = p->datap)->vdcldone) )
-               {
-               impldcl(q);
-               q->vdcldone = YES;
-               if(q->vtype == TYCHAR)
-                       {
-                       if(q->vleng == NULL)    /* character*(*) */
-                               q->vleng = mkarg(TYLENG, nextarg(TYLENG) );
-                       else if(nentry == 1)
-                               nextarg(TYLENG);
-                       }
-               else if(q->vclass==CLPROC && nentry==1)
-                       nextarg(TYLENG) ;
-               }
-
-putlabel(ep->entrylabel);
-}
-
-
-
-LOCAL nextarg(type)
-int type;
-{
-int k;
-k = lastargslot;
-lastargslot += typesize[type];
-return(k);
-}
-\f
-/* generate variable references */
-
-LOCAL dobss()
-{
-register struct hashentry *p;
-register struct nameblock *q;
-register int i;
-int align;
-ftnint leng, iarrl, iarrlen();
-struct extsym *mkext();
-char *memname();
-
-pruse(asmfile, USEBSS);
-
-for(p = hashtab ; p<lasthash ; ++p)
-    if(q = p->varp)
-       {
-       if( (q->vclass==CLUNKNOWN && q->vstg!=STGARG) ||
-           (q->vclass==CLVAR && q->vstg==STGUNKNOWN) )
-               warn1("local variable %s never used", varstr(VL,q->varname) );
-       else if(q->vclass==CLVAR && q->vstg==STGBSS)
-               {
-               align = (q->vtype==TYCHAR ? ALILONG : typealign[q->vtype]);
-               if(bssleng % align != 0)
-                       {
-                       bssleng = roundup(bssleng, align);
-                       preven(align);
-                       }
-               prlocvar( memname(STGBSS, q->vardesc.varno), iarrl = iarrlen(q) );
-               bssleng += iarrl;
-               }
-       else if(q->vclass==CLPROC && q->vprocclass==PEXTERNAL && q->vstg!=STGARG)
-               mkext(varunder(VL, q->varname)) ->extstg = STGEXT;
-
-       if(q->vclass==CLVAR && q->vstg!=STGARG)
-               {
-               if(q->vdim && !ISICON(q->vdim->nelt) )
-                       dclerr("adjustable dimension on non-argument", q);
-               if(q->vtype==TYCHAR && (q->vleng==NULL || !ISICON(q->vleng)))
-                       dclerr("adjustable leng on nonargument", q);
-               }
-       }
-
-for(i = 0 ; i < nequiv ; ++i)
-       if(eqvclass[i].eqvinit==NO && (leng = eqvclass[i].eqvleng)!=0 )
-               {
-               bssleng = roundup(bssleng, ALIDOUBLE);
-               preven(ALIDOUBLE);
-               prlocvar( memname(STGEQUIV, i), leng);
-               bssleng += leng;
-               }
-}
-
-
-
-
-doext()
-{
-struct extsym *p;
-
-for(p = extsymtab ; p<nextext ; ++p)
-       prext( varstr(XL, p->extname), p->maxleng, p->extinit);
-}
-
-
-
-
-ftnint iarrlen(q)
-register struct nameblock *q;
-{
-ftnint leng;
-
-leng = typesize[q->vtype];
-if(leng <= 0)
-       return(-1);
-if(q->vdim)
-       if( ISICON(q->vdim->nelt) )
-               leng *= q->vdim->nelt->const.ci;
-       else    return(-1);
-if(q->vleng)
-       if( ISICON(q->vleng) )
-               leng *= q->vleng->const.ci;
-       else    return(-1);
-return(leng);
-}
-\f
-LOCAL docommon()
-{
-register struct extsym *p;
-register chainp q;
-struct dimblock *t;
-expptr neltp;
-register struct nameblock *v;
-ftnint size;
-int type;
-
-for(p = extsymtab ; p<nextext ; ++p)
-       if(p->extstg==STGCOMMON)
-               {
-               for(q = p->extp ; q ; q = q->nextp)
-                       {
-                       v = q->datap;
-                       if(v->vdcldone == NO)
-                               vardcl(v);
-                       type = v->vtype;
-                       if(p->extleng % typealign[type] != 0)
-                               {
-                               dclerr("common alignment", v);
-                               p->extleng = roundup(p->extleng, typealign[type]);
-                               }
-                       v->voffset = p->extleng;
-                       v->vardesc.varno = p - extsymtab;
-                       if(type == TYCHAR)
-                               size = v->vleng->const.ci;
-                       else    size = typesize[type];
-                       if(t = v->vdim)
-                               if( (neltp = t->nelt) && ISCONST(neltp) )
-                                       size *= neltp->const.ci;
-                               else
-                                       dclerr("adjustable array in common", v);
-                       p->extleng += size;
-                       }
-
-               frchain( &(p->extp) );
-               }
-}
-
-
-
-
-
-LOCAL docomleng()
-{
-register struct extsym *p;
-
-for(p = extsymtab ; p < nextext ; ++p)
-       if(p->extstg == STGCOMMON)
-               {
-               if(p->maxleng!=0 && p->extleng!=0 && p->maxleng!=p->extleng &&
-                   !eqn(XL,"_BLNK__ ",p->extname) )
-                       warn1("incompatible lengths for common block %s",
-                               nounder(XL, p->extname) );
-               if(p->maxleng < p->extleng)
-                       p->maxleng = p->extleng;
-               p->extleng = 0;
-       }
-}
-
-
-
-\f
-/* ROUTINES DEALING WITH AUTOMATIC AND TEMPORARY STORAGE */
-
-frtemp(p)
-struct addrblock *p;
-{
-holdtemps = mkchain(p, holdtemps);
-}
-
-
-
-
-/* allocate an automatic variable slot */
-
-struct addrblock *autovar(nelt, t, lengp)
-register int nelt, t;
-expptr lengp;
-{
-ftnint leng;
-register struct addrblock *q;
-
-if(t == TYCHAR)
-       if( ISICON(lengp) )
-               leng = lengp->const.ci;
-       else    {
-               fatal("automatic variable of nonconstant length");
-               }
-else
-       leng = typesize[t];
-autoleng = roundup( autoleng, typealign[t]);
-
-q = ALLOC(addrblock);
-q->tag = TADDR;
-q->vtype = t;
-if(t == TYCHAR)
-       q->vleng = ICON(leng);
-q->vstg = STGAUTO;
-q->ntempelt = nelt;
-#if TARGET==PDP11 || TARGET==VAX
-       /* stack grows downward */
-       autoleng += nelt*leng;
-       q->memoffset = ICON( - autoleng );
-#else
-       q->memoffset = ICON( autoleng );
-       autoleng += nelt*leng;
-#endif
-
-return(q);
-}
-
-
-struct addrblock *mktmpn(nelt, type, lengp)
-int nelt;
-register int type;
-expptr lengp;
-{
-ftnint leng;
-chainp p, oldp;
-register struct addrblock *q;
-
-if(type==TYUNKNOWN || type==TYERROR)
-       fatal1("mktmpn: invalid type %d", type);
-
-if(type==TYCHAR)
-       if( ISICON(lengp) )
-               leng = lengp->const.ci;
-       else    {
-               err("adjustable length");
-               return( errnode() );
-               }
-for(oldp = &templist ; p = oldp->nextp ; oldp = p)
-       {
-       q = p->datap;
-       if(q->vtype==type && q->ntempelt==nelt &&
-           (type!=TYCHAR || q->vleng->const.ci==leng) )
-               {
-               oldp->nextp = p->nextp;
-               free(p);
-               return(q);
-               }
-       }
-q = autovar(nelt, type, lengp);
-q->istemp = YES;
-return(q);
-}
-
-
-
-
-struct addrblock *mktemp(type, lengp)
-int type;
-expptr lengp;
-{
-return( mktmpn(1,type,lengp) );
-}
-\f
-/* VARIOUS ROUTINES FOR PROCESSING DECLARATIONS */
-
-struct extsym *comblock(len, s)
-register int len;
-register char *s;
-{
-struct extsym *mkext(), *p;
-
-if(len == 0)
-       {
-       s = BLANKCOMMON;
-       len = strlen(s);
-       }
-p = mkext( varunder(len, s) );
-if(p->extstg == STGUNKNOWN)
-       p->extstg = STGCOMMON;
-else if(p->extstg != STGCOMMON)
-       {
-       err1("%s cannot be a common block name", s);
-       return(0);
-       }
-
-return( p );
-}
-
-
-incomm(c, v)
-struct extsym *c;
-struct nameblock *v;
-{
-if(v->vstg != STGUNKNOWN)
-       dclerr("incompatible common declaration", v);
-else
-       {
-       v->vstg = STGCOMMON;
-       c->extp = hookup(c->extp, mkchain(v,NULL) );
-       }
-}
-
-
-
-
-settype(v, type, length)
-register struct nameblock * v;
-register int type;
-register int length;
-{
-if(type == TYUNKNOWN)
-       return;
-
-if(type==TYSUBR && v->vtype!=TYUNKNOWN && v->vstg==STGARG)
-       {
-       v->vtype = TYSUBR;
-       frexpr(v->vleng);
-       }
-else if(type < 0)      /* storage class set */
-       {
-       if(v->vstg == STGUNKNOWN)
-               v->vstg = - type;
-       else if(v->vstg != -type)
-               dclerr("incompatible storage declarations", v);
-       }
-else if(v->vtype == TYUNKNOWN)
-       {
-       if( (v->vtype = lengtype(type, length))==TYCHAR && length!=0)
-               v->vleng = ICON(length);
-       }
-else if(v->vtype!=type || (type==TYCHAR && v->vleng->const.ci!=length) )
-       dclerr("incompatible type declarations", v);
-}
-
-
-
-
-
-lengtype(type, length)
-register int type;
-register int length;
-{
-switch(type)
-       {
-       case TYREAL:
-               if(length == 8)
-                       return(TYDREAL);
-               if(length == 4)
-                       goto ret;
-               break;
-
-       case TYCOMPLEX:
-               if(length == 16)
-                       return(TYDCOMPLEX);
-               if(length == 8)
-                       goto ret;
-               break;
-
-       case TYSHORT:
-       case TYDREAL:
-       case TYDCOMPLEX:
-       case TYCHAR:
-       case TYUNKNOWN:
-       case TYSUBR:
-       case TYERROR:
-               goto ret;
-
-       case TYLOGICAL:
-               if(length == 4)
-                       goto ret;
-               break;
-
-       case TYLONG:
-               if(length == 0)
-                       return(tyint);
-               if(length == 2)
-                       return(TYSHORT);
-               if(length == 4)
-                       goto ret;
-               break;
-       default:
-               fatal1("lengtype: invalid type %d", type);
-       }
-
-if(length != 0)
-       err("incompatible type-length combination");
-
-ret:
-       return(type);
-}
-
-
-
-
-
-setintr(v)
-register struct nameblock * v;
-{
-register int k;
-
-if(v->vstg == STGUNKNOWN)
-       v->vstg = STGINTR;
-else if(v->vstg!=STGINTR)
-       dclerr("incompatible use of intrinsic function", v);
-if(v->vclass==CLUNKNOWN)
-       v->vclass = CLPROC;
-if(v->vprocclass == PUNKNOWN)
-       v->vprocclass = PINTRINSIC;
-else if(v->vprocclass != PINTRINSIC)
-       dclerr("invalid intrinsic declaration", v);
-if(k = intrfunct(v->varname))
-       v->vardesc.varno = k;
-else
-       dclerr("unknown intrinsic function", v);
-}
-
-
-
-setext(v)
-register struct nameblock * v;
-{
-if(v->vclass == CLUNKNOWN)
-       v->vclass = CLPROC;
-else if(v->vclass != CLPROC)
-       dclerr("invalid external declaration", v);
-
-if(v->vprocclass == PUNKNOWN)
-       v->vprocclass = PEXTERNAL;
-else if(v->vprocclass != PEXTERNAL)
-       dclerr("invalid external declaration", v);
-}
-
-
-
-
-/* create dimensions block for array variable */
-
-setbound(v, nd, dims)
-register struct nameblock * v;
-int nd;
-struct { expptr lb, ub; } dims[ ];
-{
-register expptr q, t;
-register struct dimblock *p;
-int i;
-
-if(v->vclass == CLUNKNOWN)
-       v->vclass = CLVAR;
-else if(v->vclass != CLVAR)
-       {
-       dclerr("only variables may be arrays", v);
-       return;
-       }
-
-v->vdim = p = (struct dimblock *) ckalloc( sizeof(int) + (3+2*nd)*sizeof(expptr) );
-p->ndim = nd;
-p->nelt = ICON(1);
-
-for(i=0 ; i<nd ; ++i)
-       {
-       if( (q = dims[i].ub) == NULL)
-               {
-               if(i == nd-1)
-                       {
-                       frexpr(p->nelt);
-                       p->nelt = NULL;
-                       }
-               else
-                       err("only last bound may be asterisk");
-               p->dims[i].dimsize = ICON(1);;
-               p->dims[i].dimexpr = NULL;
-               }
-       else
-               {
-               if(dims[i].lb)
-                       {
-                       q = mkexpr(OPMINUS, q, cpexpr(dims[i].lb));
-                       q = mkexpr(OPPLUS, q, ICON(1) );
-                       }
-               if( ISCONST(q) )
-                       {
-                       p->dims[i].dimsize = q;
-                       p->dims[i].dimexpr = NULL;
-                       }
-               else    {
-                       p->dims[i].dimsize = autovar(1, tyint, NULL);
-                       p->dims[i].dimexpr = q;
-                       }
-               if(p->nelt)
-                       p->nelt = mkexpr(OPSTAR, p->nelt, cpexpr(p->dims[i].dimsize));
-               }
-       }
-
-q = dims[nd-1].lb;
-if(q == NULL)
-       q = ICON(1);
-
-for(i = nd-2 ; i>=0 ; --i)
-       {
-       t = dims[i].lb;
-       if(t == NULL)
-               t = ICON(1);
-       if(p->dims[i].dimsize)
-               q = mkexpr(OPPLUS, t, mkexpr(OPSTAR, cpexpr(p->dims[i].dimsize), q) );
-       }
-
-if( ISCONST(q) )
-       {
-       p->baseoffset = q;
-       p->basexpr = NULL;
-       }
-else
-       {
-       p->baseoffset = autovar(1, tyint, NULL);
-       p->basexpr = q;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/put.c b/.ref-Research-V7/usr/src/cmd/f77/put.c
deleted file mode 100644 (file)
index bb92269..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * INTERMEDIATE CODE GENERATION PROCEDURES COMMON TO BOTH
- * JOHNSON AND RITCHIE FAMILIES OF SECOND PASSES
-*/
-
-#include "defs"
-
-#if FAMILY == SCJ
-#      include "scjdefs"
-#else
-#      include "dmrdefs"
-#endif
-
-/*
-char *ops [ ] =
-       {
-       "??", "+", "-", "*", "/", "**", "-",
-       "OR", "AND", "EQV", "NEQV", "NOT",
-       "CONCAT",
-       "<", "==", ">", "<=", "!=", ">=",
-       " of ", " ofC ", " = ", " += ", " *= ", " CONV ", " << ", " % ",
-       " , ", " ? ", " : "
-       " abs ", " min ", " max ", " addr ", " indirect ",
-       " bitor ", " bitand ", " bitxor ", " bitnot ", " >> ",
-       };
-*/
-
-int ops2 [ ] =
-       {
-       P2BAD, P2PLUS, P2MINUS, P2STAR, P2SLASH, P2BAD, P2NEG,
-       P2OROR, P2ANDAND, P2EQ, P2NE, P2NOT,
-       P2BAD,
-       P2LT, P2EQ, P2GT, P2LE, P2NE, P2GE,
-       P2CALL, P2CALL, P2ASSIGN, P2PLUSEQ, P2STAREQ, P2CONV, P2LSHIFT, P2MOD,
-       P2COMOP, P2QUEST, P2COLON,
-       P2BAD, P2BAD, P2BAD, P2BAD, P2BAD,
-       P2BITOR, P2BITAND, P2BITXOR, P2BITNOT, P2RSHIFT
-       };
-
-
-int types2 [ ] =
-       {
-       P2BAD, P2INT|P2PTR, P2SHORT, P2LONG, P2REAL, P2DREAL,
-#if TARGET == INTERDATA
-       P2BAD, P2BAD, P2LONG, P2CHAR, P2INT, P2BAD
-#else
-       P2REAL, P2DREAL, P2LONG, P2CHAR, P2INT, P2BAD
-#endif
-       };
-
-
-setlog()
-{
-types2[TYLOGICAL] = types2[tylogical];
-}
-
-
-putex1(p)
-expptr p;
-{
-putx( fixtype(p) );
-templist = hookup(templist, holdtemps);
-holdtemps = NULL;
-}
-
-
-
-
-
-putassign(lp, rp)
-expptr lp, rp;
-{
-putx( fixexpr( mkexpr(OPASSIGN, lp, rp) ));
-}
-
-
-
-
-puteq(lp, rp)
-expptr lp, rp;
-{
-putexpr( mkexpr(OPASSIGN, lp, rp) );
-}
-
-
-
-
-/* put code for  a *= b */
-
-putsteq(a, b)
-expptr a, b;
-{
-putx( fixexpr( mkexpr(OPSTAREQ, cpexpr(a), cpexpr(b)) ));
-}
-
-
-
-
-
-struct addrblock *realpart(p)
-register struct addrblock *p;
-{
-register struct addrblock *q;
-
-q = cpexpr(p);
-if( ISCOMPLEX(p->vtype) )
-       q->vtype += (TYREAL-TYCOMPLEX);
-return(q);
-}
-
-
-
-
-struct addrblock *imagpart(p)
-register struct addrblock *p;
-{
-register struct addrblock *q;
-struct constblock *mkrealcon();
-
-if( ISCOMPLEX(p->vtype) )
-       {
-       q = cpexpr(p);
-       q->vtype += (TYREAL-TYCOMPLEX);
-       q->memoffset = mkexpr(OPPLUS, q->memoffset, ICON(typesize[q->vtype]));
-       }
-else
-       q = mkrealcon( ISINT(p->vtype) ? TYDREAL : p->vtype , 0.0);
-return(q);
-}
-\f
-struct addrblock *putconst(p)
-register struct constblock *p;
-{
-register struct addrblock *q;
-struct literal *litp, *lastlit;
-int i, k, type;
-int litflavor;
-
-if( ! ISCONST(p) )
-       fatal1("putconst: bad tag %d", p->tag);
-
-q = ALLOC(addrblock);
-q->tag = TADDR;
-type = p->vtype;
-q->vtype = ( type==TYADDR ? TYINT : type );
-q->vleng = cpexpr(p->vleng);
-q->vstg = STGCONST;
-q->memno = newlabel();
-q->memoffset = ICON(0);
-
-/* check for value in literal pool, and update pool if necessary */
-
-switch(type = p->vtype)
-       {
-       case TYCHAR:
-               if(p->vleng->const.ci > XL)
-                       break;  /* too long for literal table */
-               litflavor = 1;
-               goto loop;
-
-       case TYREAL:
-       case TYDREAL:
-               litflavor = 2;
-               goto loop;
-
-       case TYLOGICAL:
-               type = tylogical;
-       case TYSHORT:
-       case TYLONG:
-               litflavor = 3;
-
-       loop:
-               lastlit = litpool + nliterals;
-               for(litp = litpool ; litp<lastlit ; ++litp)
-                       if(type == litp->littype) switch(litflavor)
-                               {
-                       case 1:
-                               if(p->vleng->const.ci != litp->litval.litcval.litclen)
-                                       break;
-                               if(! eqn( (int) p->vleng->const.ci, p->const.ccp,
-                                       litp->litval.litcval.litcstr) )
-                                               break;
-
-                       ret:
-                               q->memno = litp->litnum;
-                               frexpr(p);
-                               return(q);
-
-                       case 2:
-                               if(p->const.cd[0] == litp->litval.litdval)
-                                       goto ret;
-                               break;
-
-                       case 3:
-                               if(p->const.ci == litp->litval.litival)
-                                       goto ret;
-                               break;
-                               }
-               if(nliterals < MAXLITERALS)
-                       {
-                       ++nliterals;
-                       litp->littype = type;
-                       litp->litnum = q->memno;
-                       switch(litflavor)
-                               {
-                               case 1:
-                                       litp->litval.litcval.litclen = p->vleng->const.ci;
-                                       cpn( (int) litp->litval.litcval.litclen,
-                                               p->const.ccp,
-                                               litp->litval.litcval.litcstr);
-                                       break;
-
-                               case 2:
-                                       litp->litval.litdval = p->const.cd[0];
-                                       break;
-
-                               case 3:
-                                       litp->litval.litival = p->const.ci;
-                                       break;
-                               }
-                       }
-       default:
-               break;
-       }
-
-preven(typealign[ type==TYCHAR ? TYLONG : type ]);
-prlabel(asmfile, q->memno);
-
-k = 1;
-switch(type)
-       {
-       case TYLOGICAL:
-       case TYSHORT:
-       case TYLONG:
-               prconi(asmfile, type, p->const.ci);
-               break;
-
-       case TYCOMPLEX:
-               k = 2;
-       case TYREAL:
-               type = TYREAL;
-               goto flpt;
-
-       case TYDCOMPLEX:
-               k = 2;
-       case TYDREAL:
-               type = TYDREAL;
-
-       flpt:
-               for(i = 0 ; i < k ; ++i)
-                       prconr(asmfile, type, p->const.cd[i]);
-               break;
-
-       case TYCHAR:
-               putstr(asmfile, p->const.ccp, p->vleng->const.ci);
-               break;
-
-       case TYADDR:
-               prcona(asmfile, p->const.ci);
-               break;
-
-       default:
-               fatal1("putconst: bad type %d", p->vtype);
-       }
-
-frexpr(p);
-return( q );
-}
-\f
-/*
- * put out a character string constant.  begin every one on
- * a long integer boundary, and pad with nulls
- */
-putstr(fp, s, n)
-FILEP fp;
-char *s;
-ftnint n;
-{
-int b[SZSHORT];
-int i;
-
-i = 0;
-while(--n >= 0)
-       {
-       b[i++] = *s++;
-       if(i == SZSHORT)
-               {
-               prchars(fp, b);
-               i = 0;
-               }
-       }
-
-while(i < SZSHORT)
-       b[i++] = '\0';
-prchars(fp, b);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/putdmr.c b/.ref-Research-V7/usr/src/cmd/f77/putdmr.c
deleted file mode 100644 (file)
index 429f10f..0000000
+++ /dev/null
@@ -1,1281 +0,0 @@
-/*  INTERMEDIATE CODE GENERATION FOR D. M. RITCHIE C COMPILERS */
-#if FAMILY != DMR
-       WRONG put FILE !!!!
-#endif
-
-#include "defs"
-#include "dmrdefs"
-
-
-extern int ops2[];
-extern int types2[];
-
-
-puthead(s, class)
-char *s;
-int class;
-{
-if( ! headerdone )
-       {
-       p2op2(P2SETREG, ARGREG-maxregvar);
-       p2op(P2PROG);
-       headerdone = YES;
-#if TARGET == PDP11
-       /* fake jump to start the optimizer */
-       if(class != CLBLOCK)
-               putgoto( fudgelabel = newlabel() );
-#endif
-       }
-}
-
-
-
-
-putnreg()
-{
-p2op2(P2SETREG, ARGREG-nregvar);
-}
-
-
-
-
-
-
-puteof()
-{
-p2op(P2EOF);
-}
-
-
-
-putstmt()
-{
-p2op2(P2EXPR, lineno);
-}
-
-
-
-
-/* put out code for if( ! p) goto l  */
-putif(p,l)
-register expptr p;
-int l;
-{
-register int k;
-if( (k = (p = fixtype(p))->vtype) != TYLOGICAL)
-       {
-       if(k != TYERROR)
-               err("non-logical expression in IF statement");
-       frexpr(p);
-       }
-else
-       {
-       putex1(p);
-       p2op2(P2CBRANCH, l);
-       p2i(0);
-       p2i(lineno);
-       }
-}
-
-
-
-
-
-/* put out code for  goto l   */
-putgoto(label)
-int label;
-{
-p2op2(P2GOTO, label);
-}
-
-
-/* branch to address constant or integer variable */
-putbranch(p)
-register struct addrblock *p;
-{
-register int type;
-
-type = p->vtype;
-if(p->tag != TADDR)
-       fatal("invalid goto label");
-putaddr(p, YES);
-if(type != TYINT)
-       p2op2(P2LTOI, P2INT);
-p2op2(P2INDIRECT, P2INT);
-p2op2(P2JUMP, P2INT);
-putstmt();
-}
-
-
-
-/* put out label  l:     */
-putlabel(label)
-int label;
-{
-p2op2(P2LABEL, label);
-}
-
-
-
-
-putexpr(p)
-expptr p;
-{
-putex1(p);
-putstmt();
-}
-
-
-
-
-
-prarif(p, neg, zero, pos)
-expptr p;
-int neg ,zero, pos;
-{
-putx(p);
-p2op(P2ARIF);
-p2i(neg);
-p2i(zero);
-p2i(pos);
-p2i(lineno);
-}
-
-
-
-putcmgo(index, nlab, labs)
-expptr index;
-int nlab;
-struct labelblock *labs[];
-{
-register int i;
-int skiplabel;
-
-if(! ISINT(index->vtype) )
-       {
-       execerr("computed goto index must be integer", NULL);
-       return;
-       }
-
-putforce(TYINT, mkconv(TYINT, index) );
-p2op(P2SWITCH);
-p2i(skiplabel = newlabel() );
-p2i(lineno);
-for(i = 0 ; i<nlab ; ++i)
-       {
-       p2i(labs[i]->labelno);
-       p2i(i+1);
-       }
-p2i(0);
-putlabel(skiplabel);
-}
-\f
-putx(p)
-register expptr p;
-{
-struct addrblock *putcall(), *putcx1(), *realpart();
-char *memname();
-int opc;
-int type, ncomma;
-
-switch(p->tag)
-       {
-       case TERROR:
-               free(p);
-               break;
-
-       case TCONST:
-               switch(type = p->vtype)
-                       {
-                       case TYLOGICAL:
-                               type = tylogical;
-                       case TYLONG:
-                       case TYSHORT:
-                               if(type == TYSHORT)
-                                       {
-                                       p2op2(P2ICON, P2SHORT);
-                                       p2i( (short)(p->const.ci) );
-                                       }
-                               else
-                                       {
-                                       p2op2(P2LCON, P2LONG);
-                                       p2li(p->const.ci);
-                                       }
-                               free(p);
-                               break;
-
-                       case TYADDR:
-                               p2op(P2NAME);
-                               p2i(P2STATIC);
-                               p2i(P2INT);
-                               p2i( (int) p->const.ci);
-                               p2op2(P2ADDR, P2PTR);
-                               free(p);
-                               break;
-
-                       default:
-                               putx( putconst(p) );
-                               break;
-                       }
-               break;
-
-       case TEXPR:
-               switch(opc = p->opcode)
-                       {
-                       case OPCALL:
-                       case OPCCALL:
-                               if( ISCOMPLEX(p->vtype) )
-                                       putcxop(p);
-                               else    putcall(p);
-                               break;
-
-                       case OPMIN:
-                       case OPMAX:
-                               putmnmx(p);
-                               break;
-
-
-                       case OPASSIGN:
-                               if( ISCOMPLEX(p->leftp->vtype) || ISCOMPLEX(p->rightp->vtype) )
-                                       frexpr( putcxeq(p) );
-                               else if( ISCHAR(p) )
-                                       putcheq(p);
-                               else
-                                       goto putopp;
-                               break;
-
-                       case OPEQ:
-                       case OPNE:
-                               if( ISCOMPLEX(p->leftp->vtype) || ISCOMPLEX(p->rightp->vtype) )
-                                       {
-                                       putcxcmp(p);
-                                       break;
-                                       }
-                       case OPLT:
-                       case OPLE:
-                       case OPGT:
-                       case OPGE:
-                               if(ISCHAR(p->leftp))
-                                       putchcmp(p);
-                               else
-                                       goto putopp;
-                               break;
-
-                       case OPPOWER:
-                               putpower(p);
-                               break;
-
-                       case OPMOD:
-                               goto putopp;
-                       case OPSTAR:
-
-                       case OPPLUS:
-                       case OPMINUS:
-                       case OPSLASH:
-                       case OPNEG:
-                               if( ISCOMPLEX(p->vtype) )
-                                       putcxop(p);
-                               else    goto putopp;
-                               break;
-
-                       case OPCONV:
-                               if( ISCOMPLEX(p->vtype) )
-                                       putcxop(p);
-                               else if( ISCOMPLEX(p->leftp->vtype) )
-                                       {
-                                       ncomma = 0;
-                                       putx( mkconv(p->vtype,
-                                               realpart(putcx1(p->leftp, &ncomma))));
-                                       putcomma(ncomma, p->vtype, NO);
-                                       free(p);
-                                       }
-                               else    goto putopp;
-                               break;
-
-                       case OPNOT:
-                       case OPOR:
-                       case OPAND:
-                       case OPEQV:
-                       case OPNEQV:
-                       case OPADDR:
-                       case OPPLUSEQ:
-                       case OPSTAREQ:
-                       case OPCOMMA:
-                       case OPQUEST:
-                       case OPCOLON:
-                       case OPBITOR:
-                       case OPBITAND:
-                       case OPBITXOR:
-                       case OPBITNOT:
-                       case OPLSHIFT:
-                       case OPRSHIFT:
-               putopp:
-                               putop(p);
-                               break;
-
-                       default:
-                               fatal1("putx: invalid opcode %d", opc);
-                       }
-               break;
-
-       case TADDR:
-               putaddr(p, YES);
-               break;
-
-       default:
-               fatal1("putx: impossible tag %d", p->tag);
-       }
-}
-
-
-
-LOCAL putop(p)
-register expptr p;
-{
-int k, ncomma;
-int type2, ptype, ltype;
-int convop;
-register expptr lp, tp;
-
-switch(p->opcode)      /* check for special cases and rewrite */
-       {
-
-       case OPCONV:
-               lp = p->leftp;
-               while(p->tag==TEXPR && p->opcode==OPCONV &&
-                    (  ( (ptype = p->vtype) == (ltype = lp->vtype) ) ||
-                    (ISREAL(ptype)&&ISREAL(ltype)) ||
-                    (ONEOF(ptype, M(TYSHORT)|M(TYADDR)) &&
-                       ONEOF(ltype, M(TYSHORT)|M(TYADDR))) ||
-                       (ptype==TYINT && ONEOF(ltype, M(TYSUBR)|M(TYCHAR))) ))
-                               {
-                               free(p);
-                               p = lp;
-                               lp = p->leftp;
-                               }
-               if(p->tag!=TEXPR || p->opcode!=OPCONV || ISCOMPLEX((ltype = lp->vtype)) )
-                       {
-                       putx(p);
-                       return;
-                       }
-               ltype = lp->vtype;
-               switch(ptype = p->vtype)
-                       {
-                       case TYCHAR:
-                               p->leftp = lp = mkconv(TYSHORT, lp);
-                               convop = P2ITOC;
-                               break;
-
-                       case TYSHORT:
-                       case TYADDR:
-                               switch(ltype)
-                                       {
-                                       case TYLONG:
-                                               convop = P2LTOI; break;
-                                       case TYREAL:
-                                       case TYDREAL:
-                                               convop = P2FTOI; break;
-                                       default:
-                                               goto badconv;
-                                       }
-                               break;
-
-                       case TYLONG:
-                               switch(ltype)
-                                       {
-                                       case TYCHAR:
-                                       case TYSHORT:
-                                       case TYADDR:
-                                               convop = P2ITOL; break;
-                                       case TYREAL:
-                                       case TYDREAL:
-                                               convop = P2FTOL; break;
-                                       default:
-                                               goto badconv;
-                                       }
-                               break;
-
-                       case TYREAL:
-                       case TYDREAL:
-                               switch(ltype)
-                                       {
-                                       case TYCHAR:
-                                       case TYSHORT:
-                                       case TYADDR:
-                                               convop = P2ITOF; break;
-                                       case TYLONG:
-                                               convop = P2LTOF; break;
-                                       default:
-                                               goto badconv;
-                                       }
-                               break;
-
-                       default:
-                       badconv:
-                               fatal("putop: impossible conversion");
-                       }
-               putx(lp);
-               p2op2(convop, types2[ptype]);
-               free(p);
-               return;
-
-       case OPADDR:
-               lp = p->leftp;
-               if(lp->tag != TADDR)
-                       {
-                       tp = mktemp(lp->vtype, lp->vleng);
-                       putx( mkexpr(OPASSIGN, cpexpr(tp), lp) );
-                       ncomma = 1;
-                       lp = tp;
-                       }
-               else    ncomma = 0;
-               putaddr(lp, NO);
-               putcomma(ncomma, TYINT, NO);
-               free(p);
-               return;
-
-       case OPASSIGN:
-               if(p->vtype==TYLOGICAL && tylogical!=TYINT &&
-                  p->rightp->tag==TEXPR && p->rightp->opcode!=OPCALL && p->rightp->opcode!=OPCCALL)
-                       {
-                       p->rightp->vtype = TYINT;
-                       p->rightp = mkconv(tylogical, p->rightp);
-                       }
-               break;
-       }
-
-if( (k = ops2[p->opcode]) <= 0)
-       fatal1("putop: invalid opcode %d", p->opcode);
-putx(p->leftp);
-if(p->rightp)
-       putx(p->rightp);
-type2 = (p->vtype==TYLOGICAL ? P2INT : types2[p->vtype]);
-p2op2(k, type2);
-
-if(p->vleng)
-       frexpr(p->vleng);
-free(p);
-}
-\f
-putforce(t, p)
-int t;
-expptr p;
-{
-p = mkconv(t, fixtype(p));
-putx(p);
-p2op2(P2FORCE, (t==TYSHORT ? P2SHORT : (t==TYLONG ? P2LONG : P2DREAL)) );
-putstmt();
-}
-
-
-
-LOCAL putpower(p)
-expptr p;
-{
-expptr base;
-struct addrblock *t1, *t2;
-ftnint k;
-int type;
-int ncomma;
-
-if(!ISICON(p->rightp) || (k = p->rightp->const.ci)<2)
-       fatal("putpower: bad call");
-base = p->leftp;
-type = base->vtype;
-t1 = mktemp(type, NULL);
-t2 = NULL;
-ncomma = 1;
-putassign(cpexpr(t1), cpexpr(base) );
-
-for( ; (k&1)==0 && k>2 ; k>>=1 )
-       {
-       ++ncomma;
-       putsteq(t1, t1);
-       }
-
-if(k == 2)
-       putx( mkexpr(OPSTAR, cpexpr(t1), cpexpr(t1)) );
-else
-       {
-       t2 = mktemp(type, NULL);
-       ++ncomma;
-       putassign(cpexpr(t2), cpexpr(t1));
-       
-       for(k>>=1 ; k>1 ; k>>=1)
-               {
-               ++ncomma;
-               putsteq(t1, t1);
-               if(k & 1)
-                       {
-                       ++ncomma;
-                       putsteq(t2, t1);
-                       }
-               }
-       putx( mkexpr(OPSTAR, cpexpr(t2),
-               mkexpr(OPSTAR, cpexpr(t1), cpexpr(t1)) ));
-       }
-putcomma(ncomma, type, NO);
-frexpr(t1);
-if(t2)
-       frexpr(t2);
-frexpr(p);
-}
-
-
-
-
-LOCAL struct addrblock *intdouble(p, ncommap)
-struct addrblock *p;
-int *ncommap;
-{
-register struct addrblock *t;
-
-t = mktemp(TYDREAL, NULL);
-++*ncommap;
-putassign(cpexpr(t), p);
-return(t);
-}
-
-
-
-
-
-LOCAL putcxeq(p)
-register struct exprblock *p;
-{
-register struct addrblock *lp, *rp;
-int ncomma;
-
-ncomma = 0;
-lp = putcx1(p->leftp, &ncomma);
-rp = putcx1(p->rightp, &ncomma);
-putassign(realpart(lp), realpart(rp));
-if( ISCOMPLEX(p->vtype) )
-       {
-       ++ncomma;
-       putassign(imagpart(lp), imagpart(rp));
-       }
-putcomma(ncomma, TYREAL, NO);
-frexpr(rp);
-free(p);
-return(lp);
-}
-
-
-
-LOCAL putcxop(p)
-expptr p;
-{
-struct addrblock *putcx1();
-int ncomma;
-
-ncomma = 0;
-putaddr( putcx1(p, &ncomma), NO);
-putcomma(ncomma, TYINT, NO);
-}
-
-
-
-LOCAL struct addrblock *putcx1(p, ncommap)
-register expptr p;
-int *ncommap;
-{
-struct addrblock *q, *lp, *rp;
-register struct addrblock *resp;
-int opcode;
-int ltype, rtype;
-
-if(p == NULL)
-       return(NULL);
-
-switch(p->tag)
-       {
-       case TCONST:
-               if( ISCOMPLEX(p->vtype) )
-                       p = putconst(p);
-               return( p );
-
-       case TADDR:
-               if( ! addressable(p) )
-                       {
-                       ++*ncommap;
-                       resp = mktemp(tyint, NULL);
-                       putassign( cpexpr(resp), p->memoffset );
-                       p->memoffset = resp;
-                       }
-               return( p );
-
-       case TEXPR:
-               if( ISCOMPLEX(p->vtype) )
-                       break;
-               ++*ncommap;
-               resp = mktemp(TYDREAL, NO);
-               putassign( cpexpr(resp), p);
-               return(resp);
-
-       default:
-               fatal1("putcx1: bad tag %d", p->tag);
-       }
-
-opcode = p->opcode;
-if(opcode==OPCALL || opcode==OPCCALL)
-       {
-       ++*ncommap;
-       return( putcall(p) );
-       }
-else if(opcode == OPASSIGN)
-       {
-       ++*ncommap;
-       return( putcxeq(p) );
-       }
-resp = mktemp(p->vtype, NULL);
-if(lp = putcx1(p->leftp, ncommap) )
-       ltype = lp->vtype;
-if(rp = putcx1(p->rightp, ncommap) )
-       rtype = rp->vtype;
-
-switch(opcode)
-       {
-       case OPCOMMA:
-               frexpr(resp);
-               resp = rp;
-               rp = NULL;
-               break;
-
-       case OPNEG:
-               putassign( realpart(resp), mkexpr(OPNEG, realpart(lp), NULL) );
-               putassign( imagpart(resp), mkexpr(OPNEG, imagpart(lp), NULL) );
-               *ncommap += 2;
-               break;
-
-       case OPPLUS:
-       case OPMINUS:
-               putassign( realpart(resp), mkexpr(opcode, realpart(lp), realpart(rp) ));
-               if(rtype < TYCOMPLEX)
-                       putassign( imagpart(resp), imagpart(lp) );
-               else if(ltype < TYCOMPLEX)
-                       {
-                       if(opcode == OPPLUS)
-                               putassign( imagpart(resp), imagpart(rp) );
-                       else    putassign( imagpart(resp), mkexpr(OPNEG, imagpart(rp), NULL) );
-                       }
-               else
-                       putassign( imagpart(resp), mkexpr(opcode, imagpart(lp), imagpart(rp) ));
-
-               *ncommap += 2;
-               break;
-
-       case OPSTAR:
-               if(ltype < TYCOMPLEX)
-                       {
-                       if( ISINT(ltype) )
-                               lp = intdouble(lp, ncommap);
-                       putassign( realpart(resp), mkexpr(OPSTAR, cpexpr(lp), realpart(rp) ));
-                       putassign( imagpart(resp), mkexpr(OPSTAR, cpexpr(lp), imagpart(rp) ));
-                       }
-               else if(rtype < TYCOMPLEX)
-                       {
-                       if( ISINT(rtype) )
-                               rp = intdouble(rp, ncommap);
-                       putassign( realpart(resp), mkexpr(OPSTAR, cpexpr(rp), realpart(lp) ));
-                       putassign( imagpart(resp), mkexpr(OPSTAR, cpexpr(rp), imagpart(lp) ));
-                       }
-               else    {
-                       putassign( realpart(resp), mkexpr(OPMINUS,
-                               mkexpr(OPSTAR, realpart(lp), realpart(rp)),
-                               mkexpr(OPSTAR, imagpart(lp), imagpart(rp)) ));
-                       putassign( imagpart(resp), mkexpr(OPPLUS,
-                               mkexpr(OPSTAR, realpart(lp), imagpart(rp)),
-                               mkexpr(OPSTAR, imagpart(lp), realpart(rp)) ));
-                       }
-               *ncommap += 2;
-               break;
-
-       case OPSLASH:
-               /* fixexpr has already replaced all divisions
-                * by a complex by a function call
-                */
-               if( ISINT(rtype) )
-                       rp = intdouble(rp, ncommap);
-               putassign( realpart(resp), mkexpr(OPSLASH, realpart(lp), cpexpr(rp)) );
-               putassign( imagpart(resp), mkexpr(OPSLASH, imagpart(lp), cpexpr(rp)) );
-               *ncommap += 2;
-               break;
-
-       case OPCONV:
-               putassign( realpart(resp), realpart(lp) );
-               if( ISCOMPLEX(lp->vtype) )
-                       q = imagpart(lp);
-               else if(rp != NULL)
-                       q = realpart(rp);
-               else
-                       q = mkrealcon(TYDREAL, 0.0);
-               putassign( imagpart(resp), q);
-               *ncommap += 2;
-               break;
-
-       default:
-               fatal1("putcx1 of invalid opcode %d", opcode);
-       }
-
-frexpr(lp);
-frexpr(rp);
-free(p);
-return(resp);
-}
-
-
-
-
-LOCAL putcxcmp(p)
-register struct exprblock *p;
-{
-int opcode;
-int ncomma;
-register struct addrblock *lp, *rp;
-struct exprblock *q;
-
-ncomma = 0;
-opcode = p->opcode;
-lp = putcx1(p->leftp, &ncomma);
-rp = putcx1(p->rightp, &ncomma);
-
-q = mkexpr( opcode==OPEQ ? OPAND : OPOR ,
-       mkexpr(opcode, realpart(lp), realpart(rp)),
-       mkexpr(opcode, imagpart(lp), imagpart(rp)) );
-putx( fixexpr(q) );
-putcomma(ncomma, TYINT, NO);
-
-free(lp);
-free(rp);
-free(p);
-}
-\f
-LOCAL struct addrblock *putch1(p, ncommap)
-register expptr p;
-int * ncommap;
-{
-register struct addrblock *t;
-struct addrblock *mktemp(), *putconst();
-
-switch(p->tag)
-       {
-       case TCONST:
-               return( putconst(p) );
-
-       case TADDR:
-               return(p);
-
-       case TEXPR:
-               ++*ncommap;
-
-               switch(p->opcode)
-                       {
-                       case OPCALL:
-                       case OPCCALL:
-                               t = putcall(p);
-                               break;
-
-                       case OPCONCAT:
-                               t = mktemp(TYCHAR, cpexpr(p->vleng) );
-                               putcat( cpexpr(t), p );
-                               break;
-
-                       case OPCONV:
-                               if(!ISICON(p->vleng) || p->vleng->const.ci!=1
-                                  || ! INT(p->leftp->vtype) )
-                                       fatal("putch1: bad character conversion");
-                               t = mktemp(TYCHAR, ICON(1) );
-                               putop( mkexpr(OPASSIGN, cpexpr(t), p) );
-                               break;
-                       default:
-                               fatal1("putch1: invalid opcode %d", p->opcode);
-                       }
-               return(t);
-
-       default:
-               fatal1("putch1: bad tag %d", p->tag);
-       }
-/* NOTREACHED */
-}
-\f
-
-
-
-LOCAL putchop(p)
-expptr p;
-{
-int ncomma;
-
-ncomma = 0;
-putaddr( putch1(p, &ncomma) , NO );
-putcomma(ncomma, TYCHAR, YES);
-}
-
-
-
-
-LOCAL putcheq(p)
-register struct exprblock *p;
-{
-int ncomma;
-
-ncomma = 0;
-if( p->rightp->tag==TEXPR && p->rightp->opcode==OPCONCAT )
-       putcat(p->leftp, p->rightp);
-else if( ISONE(p->leftp->vleng) && ISONE(p->rightp->vleng) )
-       {
-       putaddr( putch1(p->leftp, &ncomma) , YES );
-       putaddr( putch1(p->rightp, &ncomma) , YES );
-       putcomma(ncomma, TYINT, NO);
-       p2op2(P2ASSIGN, P2CHAR);
-       }
-else
-       {
-       putx( call2(TYINT, "s_copy", p->leftp, p->rightp) );
-       putcomma(ncomma, TYINT, NO);
-       }
-frexpr(p->vleng);
-free(p);
-}
-
-
-
-
-LOCAL putchcmp(p)
-register struct exprblock *p;
-{
-int ncomma;
-
-ncomma = 0;
-if(ISONE(p->leftp->vleng) && ISONE(p->rightp->vleng) )
-       {
-       putaddr( putch1(p->leftp, &ncomma) , YES );
-       putaddr( putch1(p->rightp, &ncomma) , YES );
-       p2op2(ops2[p->opcode], P2CHAR);
-       free(p);
-       putcomma(ncomma, TYINT, NO);
-       }
-else
-       {
-       p->leftp = call2(TYINT,"s_cmp", p->leftp, p->rightp);
-       p->rightp = ICON(0);
-       putop(p);
-       }
-}
-
-
-
-
-
-LOCAL putcat(lhs, rhs)
-register struct addrblock *lhs;
-register expptr rhs;
-{
-int n, ncomma;
-struct addrblock *lp, *cp;
-
-ncomma = 0;
-n = ncat(rhs);
-lp = mktmpn(n, TYLENG, NULL);
-cp = mktmpn(n, TYADDR, NULL);
-
-n = 0;
-putct1(rhs, lp, cp, &n, &ncomma);
-
-putx( call4(TYSUBR, "s_cat", lhs, cp, lp, mkconv(TYLONG, ICON(n)) ) );
-putcomma(ncomma, TYINT, NO);
-}
-
-
-
-
-
-LOCAL ncat(p)
-register expptr p;
-{
-if(p->tag==TEXPR && p->opcode==OPCONCAT)
-       return( ncat(p->leftp) + ncat(p->rightp) );
-else   return(1);
-}
-
-
-
-
-LOCAL putct1(q, lp, cp, ip, ncommap)
-register expptr q;
-register struct addrblock *lp, *cp;
-int *ip, *ncommap;
-{
-int i;
-struct addrblock *lp1, *cp1;
-
-if(q->tag==TEXPR && q->opcode==OPCONCAT)
-       {
-       putct1(q->leftp, lp, cp, ip, ncommap);
-       putct1(q->rightp, lp, cp , ip, ncommap);
-       frexpr(q->vleng);
-       free(q);
-       }
-else
-       {
-       i = (*ip)++;
-       lp1 = cpexpr(lp);
-       lp1->memoffset = mkexpr(OPPLUS, lp1->memoffset, ICON(i*SZLENG));
-       cp1 = cpexpr(cp);
-       cp1->memoffset = mkexpr(OPPLUS, cp1->memoffset, ICON(i*SZADDR));
-       putassign( lp1, cpexpr(q->vleng) );
-       putassign( cp1, addrof(putch1(q,ncommap)) );
-       *ncommap += 2;
-       }
-}
-\f
-LOCAL putaddr(p, indir)
-register struct addrblock *p;
-int indir;
-{
-int type, type2, funct;
-expptr offp;
-
-type = p->vtype;
-type2 = types2[type];
-if(p->vclass == CLPROC)
-       {
-       funct = P2FUNCT;
-       if(type == TYUNKNOWN)
-               type2 = P2INT;
-       }
-else
-       funct = 0;
-if(p->memoffset && (!ISICON(p->memoffset) || p->memoffset->const.ci!=0) )
-       offp = cpexpr(p->memoffset);
-else
-       offp = NULL;
-
-#if FUDGEOFFSET != 1
-if(offp)
-       offp = mkexpr(OPSTAR, ICON(FUDGEOFFSET), offp);
-#endif
-
-switch(p->vstg)
-       {
-       case STGAUTO:
-               p2reg(AUTOREG, P2PTR);
-               p2offset(type2|P2PTR, offp);
-               if(indir)
-                       p2op2(P2INDIRECT, type2);
-               break;
-
-       case STGLENG:
-       case STGARG:
-               p2reg(ARGREG, type2|P2PTR|((funct?funct:P2PTR)<<2));
-               if(p->memno)
-                       {
-                       putx( ICON(p->memno) );
-                       p2op2(P2PLUS, type2|P2PTR|(funct<<2));
-                       }
-               if(p->vstg == STGARG)
-                       {
-                       p2op2(P2INDIRECT, type2|P2PTR);
-                       p2offset(type2|P2PTR|(funct<<2), offp);
-                       }
-               if(indir)
-                       p2op2(P2INDIRECT, type2|funct);
-               break;
-
-       case STGBSS:
-       case STGINIT:
-       case STGEXT:
-       case STGCOMMON:
-       case STGEQUIV:
-       case STGCONST:
-               p2op(P2NAME);
-               p2i(P2EXTERN);
-               p2i(type2|funct);
-               p2str( memname(p->vstg,p->memno) );
-               if(!indir || offp!=NULL)
-                       p2op2(P2ADDR, type2|P2PTR);
-               p2offset(type2|P2PTR, offp);
-               if(indir && offp!=NULL)
-                       p2op2(P2INDIRECT, type2);
-               break;
-
-       case STGREG:
-               if(indir)
-                       p2reg(p->memno, type2);
-               break;
-
-       default:
-               fatal1("putaddr: invalid vstg %d", p->vstg);
-       }
-frexpr(p);
-}
-
-
-
-
-\f
-LOCAL struct addrblock *putcall(p)
-register struct exprblock *p;
-{
-chainp arglist, charsp, cp;
-int first;
-struct addrblock *t;
-register struct exprblock *q;
-struct exprblock *fval;
-int type, type2, ctype, indir;
-
-if( (type = p->vtype) == TYLOGICAL)
-       type = tylogical;
-type2 = types2[type];
-charsp = NULL;
-first = YES;
-indir =  (p->opcode == OPCCALL);
-
-if(p->rightp)
-       {
-       arglist = p->rightp->listp;
-       free(p->rightp);
-       }
-else
-       arglist = NULL;
-
-if(!indir)  for(cp = arglist ; cp ; cp = cp->nextp)
-       {
-       q = cp->datap;
-       if( ISCONST(q) )
-               {
-               if(q->vtype == TYSHORT)
-                       q = mkconv(tyint, q);
-               cp->datap = q = putconst(q);
-               }
-       if( ISCHAR(q) )
-               charsp = hookup(charsp, mkchain(cpexpr(q->vleng), 0) );
-       else if(q->vclass == CLPROC)
-               charsp = hookup(charsp, mkchain( ICON(0) , 0));
-       }
-
-if(type == TYCHAR)
-       {
-       if( ISICON(p->vleng) )
-               fval = mktemp(TYCHAR, p->vleng);
-       else    {
-               err("adjustable character function");
-               return(NULL);
-               }
-       }
-else if( ISCOMPLEX(type) )
-       fval = mktemp(type, NULL);
-else
-       fval = NULL;
-
-ctype = (fval ? P2INT : type2);
-putaddr(p->leftp, YES);
-
-if(fval)
-       {
-       first = NO;
-       putaddr( cpexpr(fval), NO);
-       if(type==TYCHAR)
-               {
-               putx( mkconv(TYLENG, p->vleng) );
-               p2op2(P2LISTOP, P2INT);
-               }
-       }
-
-for(cp = arglist ; cp ; cp = cp->nextp)
-       {
-       q = cp->datap;
-       if(q->tag==TADDR && (indir || q->vstg!=STGREG) )
-               putaddr(q, indir && q->vtype!=TYCHAR);
-       else if( ISCOMPLEX(q->vtype) )
-               putcxop(q);
-       else if (ISCHAR(q) )
-               putchop(q);
-       else if( ! ISERROR(q) )
-               {
-               if(indir)
-                       putx(q);
-               else    {
-                       t = mktemp(q->vtype, q->vleng);
-                       putassign( cpexpr(t), q );
-                       putaddr(t, NO);
-                       putcomma(1, q->vtype, YES);
-                       }
-               }
-       if(first)
-               first = NO;
-       else
-               p2op2(P2LISTOP, P2INT);
-       }
-
-if(arglist)
-       frchain(&arglist);
-for(cp = charsp ; cp ; cp = cp->nextp)
-       {
-       putx( mkconv(TYLENG, cp->datap) );
-       if(first)
-               first = NO;
-       else
-               p2op2(P2LISTOP, P2INT);
-       }
-frchain(&charsp);
-
-if(first)
-       p2op(P2NULL);
-p2op2(P2CALL, ctype);
-free(p);
-return(fval);
-}
-
-
-
-LOCAL putmnmx(p)
-register struct exprblock *p;
-{
-int op, type;
-int ncomma;
-struct exprblock *qp;
-chainp p0, p1;
-struct addrblock *sp, *tp;
-
-type = p->vtype;
-op = (p->opcode==OPMIN ? OPLT : OPGT );
-p0 = p->leftp->listp;
-free(p->leftp);
-free(p);
-
-sp = mktemp(type, NULL);
-tp = mktemp(type, NULL);
-qp = mkexpr(OPCOLON, cpexpr(tp), cpexpr(sp));
-qp = mkexpr(OPQUEST, mkexpr(op, cpexpr(tp),cpexpr(sp)), qp);
-qp = fixexpr(qp);
-
-ncomma = 1;
-putassign( cpexpr(sp), p0->datap );
-
-for(p1 = p0->nextp ; p1 ; p1 = p1->nextp)
-       {
-       ++ncomma;
-       putassign( cpexpr(tp), p1->datap );
-       if(p1->nextp)
-               {
-               ++ncomma;
-               putassign( cpexpr(sp), cpexpr(qp) );
-               }
-       else
-               putx(qp);
-       }
-
-putcomma(ncomma, type, NO);
-frtemp(sp);
-frtemp(tp);
-frchain( &p0 );
-}
-
-
-
-
-LOCAL putcomma(n, type, indir)
-int n, type, indir;
-{
-type = types2[type];
-if(indir)
-       type |= P2PTR;
-while(--n >= 0)
-       p2op2(P2COMOP, type);
-}
-\f
-/*
- *  routines that put bytes on the pass2 input stream
-*/
-
-
-p2i(k)
-int k;
-{
-register char *s;
-s = &k;
-
-putc(*s++, textfile);
-putc(*s, textfile);
-}
-
-
-
-
-p2op(op)
-int op;
-{
-putc(op, textfile);
-putc(0376, textfile);   /* MAGIC NUMBER */
-}
-
-
-
-
-p2str(s)
-register char *s;
-{
-do
-       putc(*s, textfile);
-               while(*s++);
-}
-
-
-
-p2op2(op, i)
-int op, i;
-{
-p2op(op);
-p2i(i);
-}
-
-
-
-p2reg(k, type)
-int k;
-{
-p2op2(P2NAME, P2REG);
-p2i(type);
-p2i(k);
-}
-
-
-
-LOCAL p2li(n)
-long int n;
-{
-register int *p, i;
-
-p = &n;
-for(i = 0 ; i< sizeof(long int)/sizeof(int) ; ++i)
-       p2i(*p++);
-}
-
-
-
-LOCAL p2offset(type, offp)
-int type;
-register expptr offp;
-{
-expptr shorten();
-
-if(offp)
-       {
-#if SZINT < SZLONG
-       if(shortsubs)
-               offp = shorten(offp);
-#endif
-       if(offp->vtype != TYLONG)
-               offp = mkconv(TYINT, offp);
-       if(offp->vtype == TYLONG)
-               {
-               putx(offp);
-               p2op2(P2LTOI, P2INT);
-               }
-       else
-               putx( offp );
-       p2op2(P2PLUS, type);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/putscj.c b/.ref-Research-V7/usr/src/cmd/f77/putscj.c
deleted file mode 100644 (file)
index da10260..0000000
+++ /dev/null
@@ -1,1422 +0,0 @@
-/* INTERMEDIATE CODE GENERATION FOR S C JOHNSON C COMPILERS */
-/* NEW VERSION USING BINARY POLISH POSTFIX INTERMEDIATE */
-#if FAMILY != SCJ
-       WRONG put FULE !!!!
-#endif
-
-#include "defs"
-#include "scjdefs"
-
-#define FOUR 4
-extern int ops2[];
-extern int types2[];
-
-#define P2BUFFMAX 128
-static long int p2buff[P2BUFFMAX];
-static long int *p2bufp                = &p2buff[0];
-static long int *p2bufend      = &p2buff[P2BUFFMAX];
-
-
-puthead(s)
-char *s;
-{
-char buff[100];
-#if TARGET == VAX
-       if(s)
-               p2pass( sprintf(buff, "\t.globl\t_%s", s) );
-#endif
-/* put out fake copy of left bracket line, to be redone later */
-if( ! headerdone )
-       {
-#if FAMILY==SCJ && OUTPUT==BINARY
-       p2flush();
-#endif
-       headoffset = ftell(textfile);
-       prhead(textfile);
-       headerdone = YES;
-       p2triple(P2STMT, (strlen(infname)+FOUR-1)/FOUR, 0);
-       p2str(infname);
-       }
-}
-
-
-
-
-
-/* It is necessary to precede each procedure with a "left bracket"
- * line that tells pass 2 how many register variables and how
- * much automatic space is required for the function.  This compiler
- * does not know how much automatic space is needed until the
- * entire procedure has been processed.  Therefore, "puthead"
- * is called at the begining to record the current location in textfile,
- * then to put out a placeholder left bracket line.  This procedure
- * repositions the file and rewrites that line, then puts the
- * file pointer back to the end of the file.
- */
-
-putbracket()
-{
-long int hereoffset;
-
-#if FAMILY==SCJ && OUTPUT==BINARY
-       p2flush();
-#endif
-hereoffset = ftell(textfile);
-if(fseek(textfile, headoffset, 0))
-       fatal("fseek failed");
-prhead(textfile);
-if(fseek(textfile, hereoffset, 0))
-       fatal("fseek failed 2");
-}
-
-
-
-
-putrbrack(k)
-int k;
-{
-p2op(P2RBRACKET, k);
-}
-
-
-
-putnreg()
-{
-}
-
-
-
-
-
-
-puteof()
-{
-p2op(P2EOF, 0);
-p2flush();
-}
-
-
-
-putstmt()
-{
-p2triple(P2STMT, 0, lineno);
-}
-
-
-
-
-/* put out code for if( ! p) goto l  */
-putif(p,l)
-register expptr p;
-int l;
-{
-register int k;
-
-if( ( k = (p = fixtype(p))->vtype) != TYLOGICAL)
-       {
-       if(k != TYERROR)
-               err("non-logical expression in IF statement");
-       frexpr(p);
-       }
-else
-       {
-       putex1(p);
-       p2icon( (long int) l , P2INT);
-       p2op(P2CBRANCH, 0);
-       putstmt();
-       }
-}
-
-
-
-
-
-/* put out code for  goto l   */
-putgoto(label)
-int label;
-{
-p2triple(P2GOTO, 1, label);
-putstmt();
-}
-
-
-/* branch to address constant or integer variable */
-putbranch(p)
-register struct addrblock *p;
-{
-putex1(p);
-p2op(P2GOTO, P2INT);
-putstmt();
-}
-
-
-
-/* put out label  l:     */
-putlabel(label)
-int label;
-{
-p2op(P2LABEL, label);
-}
-
-
-
-
-putexpr(p)
-expptr p;
-{
-putex1(p);
-putstmt();
-}
-
-
-
-
-putcmgo(index, nlab, labs)
-expptr index;
-int nlab;
-struct labelblock *labs[];
-{
-int i, labarray, skiplabel;
-
-if(! ISINT(index->vtype) )
-       {
-       execerr("computed goto index must be integer", NULL);
-       return;
-       }
-
-#if TARGET == VAX
-       /* use special case instruction */
-       vaxgoto(index, nlab, labs);
-#else
-       labarray = newlabel();
-       preven(ALIADDR);
-       prlabel(asmfile, labarray);
-       prcona(asmfile, (ftnint) (skiplabel = newlabel()) );
-       for(i = 0 ; i < nlab ; ++i)
-               prcona(asmfile, (ftnint)(labs[i]->labelno) );
-       prcmgoto(index, nlab, skiplabel, labarray);
-       putlabel(skiplabel);
-#endif
-}
-\f
-putx(p)
-expptr p;
-{
-struct addrblock *putcall(), *putcx1(), *realpart();
-char *memname();
-int opc;
-int ncomma;
-int type, k;
-
-switch(p->tag)
-       {
-       case TERROR:
-               free(p);
-               break;
-
-       case TCONST:
-               switch(type = p->vtype)
-                       {
-                       case TYLOGICAL:
-                               type = tyint;
-                       case TYLONG:
-                       case TYSHORT:
-                               p2icon(p->const.ci, types2[type]);
-                               free(p);
-                               break;
-
-                       case TYADDR:
-                               p2triple(P2ICON, 1, P2INT|P2PTR);
-                               p2word(0L);
-                               p2name(memname(STGCONST, (int) p->const.ci) );
-                               free(p);
-                               break;
-
-                       default:
-                               putx( putconst(p) );
-                               break;
-                       }
-               break;
-
-       case TEXPR:
-               switch(opc = p->opcode)
-                       {
-                       case OPCALL:
-                       case OPCCALL:
-                               if( ISCOMPLEX(p->vtype) )
-                                       putcxop(p);
-                               else    putcall(p);
-                               break;
-
-                       case OPMIN:
-                       case OPMAX:
-                               putmnmx(p);
-                               break;
-
-
-                       case OPASSIGN:
-                               if( ISCOMPLEX(p->leftp->vtype) || ISCOMPLEX(p->rightp->vtype) )
-                                       frexpr( putcxeq(p) );
-                               else if( ISCHAR(p) )
-                                       putcheq(p);
-                               else
-                                       goto putopp;
-                               break;
-
-                       case OPEQ:
-                       case OPNE:
-                               if( ISCOMPLEX(p->leftp->vtype) || ISCOMPLEX(p->rightp->vtype) )
-                                       {
-                                       putcxcmp(p);
-                                       break;
-                                       }
-                       case OPLT:
-                       case OPLE:
-                       case OPGT:
-                       case OPGE:
-                               if(ISCHAR(p->leftp))
-                                       putchcmp(p);
-                               else
-                                       goto putopp;
-                               break;
-
-                       case OPPOWER:
-                               putpower(p);
-                               break;
-
-                       case OPSTAR:
-#if FAMILY == SCJ
-                               /*   m * (2**k) -> m<<k   */
-                               if(INT(p->leftp->vtype) && ISICON(p->rightp) &&
-                                  ( (k = log2(p->rightp->const.ci))>0) )
-                                       {
-                                       p->opcode = OPLSHIFT;
-                                       frexpr(p->rightp);
-                                       p->rightp = ICON(k);
-                                       goto putopp;
-                                       }
-#endif
-
-                       case OPMOD:
-                               goto putopp;
-                       case OPPLUS:
-                       case OPMINUS:
-                       case OPSLASH:
-                       case OPNEG:
-                               if( ISCOMPLEX(p->vtype) )
-                                       putcxop(p);
-                               else    goto putopp;
-                               break;
-
-                       case OPCONV:
-                               if( ISCOMPLEX(p->vtype) )
-                                       putcxop(p);
-                               else if( ISCOMPLEX(p->leftp->vtype) )
-                                       {
-                                       ncomma = 0;
-                                       putx( mkconv(p->vtype,
-                                               realpart(putcx1(p->leftp, &ncomma))));
-                                       putcomma(ncomma, p->vtype, NO);
-                                       free(p);
-                                       }
-                               else    goto putopp;
-                               break;
-
-                       case OPNOT:
-                       case OPOR:
-                       case OPAND:
-                       case OPEQV:
-                       case OPNEQV:
-                       case OPADDR:
-                       case OPPLUSEQ:
-                       case OPSTAREQ:
-                       case OPCOMMA:
-                       case OPQUEST:
-                       case OPCOLON:
-                       case OPBITOR:
-                       case OPBITAND:
-                       case OPBITXOR:
-                       case OPBITNOT:
-                       case OPLSHIFT:
-                       case OPRSHIFT:
-               putopp:
-                               putop(p);
-                               break;
-
-                       default:
-                               fatal1("putx: invalid opcode %d", opc);
-                       }
-               break;
-
-       case TADDR:
-               putaddr(p, YES);
-               break;
-
-       default:
-               fatal1("putx: impossible tag %d", p->tag);
-       }
-}
-
-
-
-LOCAL putop(p)
-expptr p;
-{
-int k;
-expptr lp, tp;
-int pt, lt;
-int comma;
-
-switch(p->opcode)      /* check for special cases and rewrite */
-       {
-       case OPCONV:
-               pt = p->vtype;
-               lp = p->leftp;
-               lt = lp->vtype;
-               while(p->tag==TEXPR && p->opcode==OPCONV &&
-                    ( (ISREAL(pt)&&ISREAL(lt)) ||
-                       (INT(pt)&&(ONEOF(lt,MSKINT|MSKADDR|MSKCHAR|M(TYSUBR)))) ))
-                       {
-#if SZINT < SZLONG
-                       if(lp->tag != TEXPR)
-                               {
-                               if(pt==TYINT && lt==TYLONG)
-                                       break;
-                               if(lt==TYINT && pt==TYLONG)
-                                       break;
-                               }
-#endif
-                       free(p);
-                       p = lp;
-                       pt = lt;
-                       lp = p->leftp;
-                       lt = lp->vtype;
-                       }
-               if(p->tag==TEXPR && p->opcode==OPCONV)
-                       break;
-               putx(p);
-               return;
-
-       case OPADDR:
-               comma = NO;
-               lp = p->leftp;
-               if(lp->tag != TADDR)
-                       {
-                       tp = mktemp(lp->vtype, lp->vleng);
-                       putx( mkexpr(OPASSIGN, cpexpr(tp), lp) );
-                       lp = tp;
-                       comma = YES;
-                       }
-               putaddr(lp, NO);
-               if(comma)
-                       putcomma(1, TYINT, NO);
-               free(p);
-               return;
-       }
-
-if( (k = ops2[p->opcode]) <= 0)
-       fatal1("putop: invalid opcode %d", p->opcode);
-putx(p->leftp);
-if(p->rightp)
-       putx(p->rightp);
-p2op(k, types2[p->vtype]);
-
-if(p->vleng)
-       frexpr(p->vleng);
-free(p);
-}
-\f
-putforce(t, p)
-int t;
-expptr p;
-{
-p = mkconv(t, fixtype(p));
-putx(p);
-p2op(P2FORCE,
-       (t==TYSHORT ? P2SHORT : (t==TYLONG ? P2LONG : P2DREAL)) );
-putstmt();
-}
-
-
-
-LOCAL putpower(p)
-expptr p;
-{
-expptr base;
-struct addrblock *t1, *t2;
-ftnint k;
-int type;
-int ncomma;
-
-if(!ISICON(p->rightp) || (k = p->rightp->const.ci)<2)
-       fatal("putpower: bad call");
-base = p->leftp;
-type = base->vtype;
-t1 = mktemp(type, NULL);
-t2 = NULL;
-ncomma = 1;
-putassign(cpexpr(t1), cpexpr(base) );
-
-for( ; (k&1)==0 && k>2 ; k>>=1 )
-       {
-       ++ncomma;
-       putsteq(t1, t1);
-       }
-
-if(k == 2)
-       putx( mkexpr(OPSTAR, cpexpr(t1), cpexpr(t1)) );
-else
-       {
-       t2 = mktemp(type, NULL);
-       ++ncomma;
-       putassign(cpexpr(t2), cpexpr(t1));
-       
-       for(k>>=1 ; k>1 ; k>>=1)
-               {
-               ++ncomma;
-               putsteq(t1, t1);
-               if(k & 1)
-                       {
-                       ++ncomma;
-                       putsteq(t2, t1);
-                       }
-               }
-       putx( mkexpr(OPSTAR, cpexpr(t2),
-               mkexpr(OPSTAR, cpexpr(t1), cpexpr(t1)) ));
-       }
-putcomma(ncomma, type, NO);
-frexpr(t1);
-if(t2)
-       frexpr(t2);
-frexpr(p);
-}
-
-
-
-
-LOCAL struct addrblock *intdouble(p, ncommap)
-struct addrblock *p;
-int *ncommap;
-{
-register struct addrblock *t;
-
-t = mktemp(TYDREAL, NULL);
-++*ncommap;
-putassign(cpexpr(t), p);
-return(t);
-}
-
-
-
-
-
-LOCAL putcxeq(p)
-register struct exprblock *p;
-{
-register struct addrblock *lp, *rp;
-int ncomma;
-
-ncomma = 0;
-lp = putcx1(p->leftp, &ncomma);
-rp = putcx1(p->rightp, &ncomma);
-putassign(realpart(lp), realpart(rp));
-if( ISCOMPLEX(p->vtype) )
-       {
-       ++ncomma;
-       putassign(imagpart(lp), imagpart(rp));
-       }
-putcomma(ncomma, TYREAL, NO);
-frexpr(rp);
-free(p);
-return(lp);
-}
-
-
-
-LOCAL putcxop(p)
-expptr p;
-{
-struct addrblock *putcx1();
-int ncomma;
-
-ncomma = 0;
-putaddr( putcx1(p, &ncomma), NO);
-putcomma(ncomma, TYINT, NO);
-}
-
-
-
-LOCAL struct addrblock *putcx1(p, ncommap)
-register expptr p;
-int *ncommap;
-{
-struct addrblock *q, *lp, *rp;
-register struct addrblock *resp;
-int opcode;
-int ltype, rtype;
-
-if(p == NULL)
-       return(NULL);
-
-switch(p->tag)
-       {
-       case TCONST:
-               if( ISCOMPLEX(p->vtype) )
-                       p = putconst(p);
-               return( p );
-
-       case TADDR:
-               if( ! addressable(p) )
-                       {
-                       ++*ncommap;
-                       resp = mktemp(tyint, NULL);
-                       putassign( cpexpr(resp), p->memoffset );
-                       p->memoffset = resp;
-                       }
-               return( p );
-
-       case TEXPR:
-               if( ISCOMPLEX(p->vtype) )
-                       break;
-               ++*ncommap;
-               resp = mktemp(TYDREAL, NO);
-               putassign( cpexpr(resp), p);
-               return(resp);
-
-       default:
-               fatal1("putcx1: bad tag %d", p->tag);
-       }
-
-opcode = p->opcode;
-if(opcode==OPCALL || opcode==OPCCALL)
-       {
-       ++*ncommap;
-       return( putcall(p) );
-       }
-else if(opcode == OPASSIGN)
-       {
-       ++*ncommap;
-       return( putcxeq(p) );
-       }
-resp = mktemp(p->vtype, NULL);
-if(lp = putcx1(p->leftp, ncommap) )
-       ltype = lp->vtype;
-if(rp = putcx1(p->rightp, ncommap) )
-       rtype = rp->vtype;
-
-switch(opcode)
-       {
-       case OPCOMMA:
-               frexpr(resp);
-               resp = rp;
-               rp = NULL;
-               break;
-
-       case OPNEG:
-               putassign( realpart(resp), mkexpr(OPNEG, realpart(lp), NULL) );
-               putassign( imagpart(resp), mkexpr(OPNEG, imagpart(lp), NULL) );
-               *ncommap += 2;
-               break;
-
-       case OPPLUS:
-       case OPMINUS:
-               putassign( realpart(resp), mkexpr(opcode, realpart(lp), realpart(rp) ));
-               if(rtype < TYCOMPLEX)
-                       putassign( imagpart(resp), imagpart(lp) );
-               else if(ltype < TYCOMPLEX)
-                       {
-                       if(opcode == OPPLUS)
-                               putassign( imagpart(resp), imagpart(rp) );
-                       else    putassign( imagpart(resp), mkexpr(OPNEG, imagpart(rp), NULL) );
-                       }
-               else
-                       putassign( imagpart(resp), mkexpr(opcode, imagpart(lp), imagpart(rp) ));
-
-               *ncommap += 2;
-               break;
-
-       case OPSTAR:
-               if(ltype < TYCOMPLEX)
-                       {
-                       if( ISINT(ltype) )
-                               lp = intdouble(lp, ncommap);
-                       putassign( realpart(resp), mkexpr(OPSTAR, cpexpr(lp), realpart(rp) ));
-                       putassign( imagpart(resp), mkexpr(OPSTAR, cpexpr(lp), imagpart(rp) ));
-                       }
-               else if(rtype < TYCOMPLEX)
-                       {
-                       if( ISINT(rtype) )
-                               rp = intdouble(rp, ncommap);
-                       putassign( realpart(resp), mkexpr(OPSTAR, cpexpr(rp), realpart(lp) ));
-                       putassign( imagpart(resp), mkexpr(OPSTAR, cpexpr(rp), imagpart(lp) ));
-                       }
-               else    {
-                       putassign( realpart(resp), mkexpr(OPMINUS,
-                               mkexpr(OPSTAR, realpart(lp), realpart(rp)),
-                               mkexpr(OPSTAR, imagpart(lp), imagpart(rp)) ));
-                       putassign( imagpart(resp), mkexpr(OPPLUS,
-                               mkexpr(OPSTAR, realpart(lp), imagpart(rp)),
-                               mkexpr(OPSTAR, imagpart(lp), realpart(rp)) ));
-                       }
-               *ncommap += 2;
-               break;
-
-       case OPSLASH:
-               /* fixexpr has already replaced all divisions
-                * by a complex by a function call
-                */
-               if( ISINT(rtype) )
-                       rp = intdouble(rp, ncommap);
-               putassign( realpart(resp), mkexpr(OPSLASH, realpart(lp), cpexpr(rp)) );
-               putassign( imagpart(resp), mkexpr(OPSLASH, imagpart(lp), cpexpr(rp)) );
-               *ncommap += 2;
-               break;
-
-       case OPCONV:
-               putassign( realpart(resp), realpart(lp) );
-               if( ISCOMPLEX(lp->vtype) )
-                       q = imagpart(lp);
-               else if(rp != NULL)
-                       q = realpart(rp);
-               else
-                       q = mkrealcon(TYDREAL, 0.0);
-               putassign( imagpart(resp), q);
-               *ncommap += 2;
-               break;
-
-       default:
-               fatal1("putcx1 of invalid opcode %d", opcode);
-       }
-
-frexpr(lp);
-frexpr(rp);
-free(p);
-return(resp);
-}
-
-
-
-
-LOCAL putcxcmp(p)
-register struct exprblock *p;
-{
-int opcode;
-int ncomma;
-register struct addrblock *lp, *rp;
-struct exprblock *q;
-
-ncomma = 0;
-opcode = p->opcode;
-lp = putcx1(p->leftp, &ncomma);
-rp = putcx1(p->rightp, &ncomma);
-
-q = mkexpr( opcode==OPEQ ? OPAND : OPOR ,
-       mkexpr(opcode, realpart(lp), realpart(rp)),
-       mkexpr(opcode, imagpart(lp), imagpart(rp)) );
-putx( fixexpr(q) );
-putcomma(ncomma, TYINT, NO);
-
-free(lp);
-free(rp);
-free(p);
-}
-\f
-LOCAL struct addrblock *putch1(p, ncommap)
-register expptr p;
-int * ncommap;
-{
-register struct addrblock *t;
-struct addrblock *mktemp(), *putconst();
-
-switch(p->tag)
-       {
-       case TCONST:
-               return( putconst(p) );
-
-       case TADDR:
-               return(p);
-
-       case TEXPR:
-               ++*ncommap;
-
-               switch(p->opcode)
-                       {
-                       case OPCALL:
-                       case OPCCALL:
-                               t = putcall(p);
-                               break;
-
-                       case OPCONCAT:
-                               t = mktemp(TYCHAR, cpexpr(p->vleng) );
-                               putcat( cpexpr(t), p );
-                               break;
-
-                       case OPCONV:
-                               if(!ISICON(p->vleng) || p->vleng->const.ci!=1
-                                  || ! INT(p->leftp->vtype) )
-                                       fatal("putch1: bad character conversion");
-                               t = mktemp(TYCHAR, ICON(1) );
-                               putop( mkexpr(OPASSIGN, cpexpr(t), p) );
-                               break;
-                       default:
-                               fatal1("putch1: invalid opcode %d", p->opcode);
-                       }
-               return(t);
-
-       default:
-               fatal1("putch1: bad tag %d", p->tag);
-       }
-/* NOTREACHED */
-}
-\f
-
-
-
-LOCAL putchop(p)
-expptr p;
-{
-int ncomma;
-
-ncomma = 0;
-putaddr( putch1(p, &ncomma) , NO );
-putcomma(ncomma, TYCHAR, YES);
-}
-
-
-
-
-LOCAL putcheq(p)
-register struct exprblock *p;
-{
-int ncomma;
-
-ncomma = 0;
-if( p->rightp->tag==TEXPR && p->rightp->opcode==OPCONCAT )
-       putcat(p->leftp, p->rightp);
-else if( ISONE(p->leftp->vleng) && ISONE(p->rightp->vleng) )
-       {
-       putaddr( putch1(p->leftp, &ncomma) , YES );
-       putaddr( putch1(p->rightp, &ncomma) , YES );
-       putcomma(ncomma, TYINT, NO);
-       p2op(P2ASSIGN, P2CHAR);
-       }
-else
-       {
-       putx( call2(TYINT, "s_copy", p->leftp, p->rightp) );
-       putcomma(ncomma, TYINT, NO);
-       }
-
-frexpr(p->vleng);
-free(p);
-}
-
-
-
-
-LOCAL putchcmp(p)
-register struct exprblock *p;
-{
-int ncomma;
-
-ncomma = 0;
-if(ISONE(p->leftp->vleng) && ISONE(p->rightp->vleng) )
-       {
-       putaddr( putch1(p->leftp, &ncomma) , YES );
-       putaddr( putch1(p->rightp, &ncomma) , YES );
-       p2op(ops2[p->opcode], P2CHAR);
-       free(p);
-       putcomma(ncomma, TYINT, NO);
-       }
-else
-       {
-       p->leftp = call2(TYINT,"s_cmp", p->leftp, p->rightp);
-       p->rightp = ICON(0);
-       putop(p);
-       }
-}
-
-
-
-
-
-LOCAL putcat(lhs, rhs)
-register struct addrblock *lhs;
-register expptr rhs;
-{
-int n, ncomma;
-struct addrblock *lp, *cp;
-
-ncomma = 0;
-n = ncat(rhs);
-lp = mktmpn(n, TYLENG, NULL);
-cp = mktmpn(n, TYADDR, NULL);
-
-n = 0;
-putct1(rhs, lp, cp, &n, &ncomma);
-
-putx( call4(TYSUBR, "s_cat", lhs, cp, lp, ICON(n) ) );
-putcomma(ncomma, TYINT, NO);
-}
-
-
-
-
-
-LOCAL ncat(p)
-register expptr p;
-{
-if(p->tag==TEXPR && p->opcode==OPCONCAT)
-       return( ncat(p->leftp) + ncat(p->rightp) );
-else   return(1);
-}
-
-
-
-
-LOCAL putct1(q, lp, cp, ip, ncommap)
-register expptr q;
-register struct addrblock *lp, *cp;
-int *ip, *ncommap;
-{
-int i;
-struct addrblock *lp1, *cp1;
-
-if(q->tag==TEXPR && q->opcode==OPCONCAT)
-       {
-       putct1(q->leftp, lp, cp, ip, ncommap);
-       putct1(q->rightp, lp, cp , ip, ncommap);
-       frexpr(q->vleng);
-       free(q);
-       }
-else
-       {
-       i = (*ip)++;
-       lp1 = cpexpr(lp);
-       lp1->memoffset = mkexpr(OPPLUS, lp1->memoffset, ICON(i*SZLENG));
-       cp1 = cpexpr(cp);
-       cp1->memoffset = mkexpr(OPPLUS, cp1->memoffset, ICON(i*SZADDR));
-       putassign( lp1, cpexpr(q->vleng) );
-       putassign( cp1, addrof(putch1(q,ncommap)) );
-       *ncommap += 2;
-       }
-}
-\f
-LOCAL putaddr(p, indir)
-register struct addrblock *p;
-int indir;
-{
-int type, type2, funct;
-ftnint offset, simoffset();
-expptr offp, shorten();
-
-type = p->vtype;
-type2 = types2[type];
-funct = (p->vclass==CLPROC ? P2FUNCT<<2 : 0);
-
-offp = (p->memoffset ? cpexpr(p->memoffset) : NULL);
-
-
-#if (FUDGEOFFSET != 1)
-if(offp)
-       offp = mkexpr(OPSTAR, ICON(FUDGEOFFSET), offp);
-#endif
-
-offset = simoffset( &offp );
-#if SZINT < SZLONG
-       if(offp)
-               if(shortsubs)
-                       offp = shorten(offp);
-               else
-                       offp = mkconv(TYINT, offp);
-#else
-       if(offp)
-               offp = mkconv(TYINT, offp);
-#endif
-
-switch(p->vstg)
-       {
-       case STGAUTO:
-               if(indir && !offp)
-                       {
-                       p2oreg(offset, AUTOREG, type2);
-                       break;
-                       }
-
-               if(!indir && !offp && !offset)
-                       {
-                       p2reg(AUTOREG, type2 | P2PTR);
-                       break;
-                       }
-
-               p2reg(AUTOREG, type2 | P2PTR);
-               if(offp)
-                       {
-                       putx(offp);
-                       if(offset)
-                               p2icon(offset, P2INT);
-                       }
-               else
-                       p2icon(offset, P2INT);
-               if(offp && offset)
-                       p2op(P2PLUS, type2 | P2PTR);
-               p2op(P2PLUS, type2 | P2PTR);
-               if(indir)
-                       p2op(P2INDIRECT, type2);
-               break;
-
-       case STGARG:
-               p2oreg(
-#ifdef ARGOFFSET
-                       ARGOFFSET +
-#endif
-                       (ftnint) (FUDGEOFFSET*p->memno),
-                       ARGREG,   type2 | P2PTR | funct );
-
-               if(offp)
-                       putx(offp);
-               if(offset)
-                       p2icon(offset, P2INT);
-               if(offp && offset)
-                       p2op(P2PLUS, type2 | P2PTR);
-               if(offp || offset)
-                       p2op(P2PLUS, type2 | P2PTR);
-               if(indir)
-                       p2op(P2INDIRECT, type2);
-               break;
-
-       case STGLENG:
-               if(indir)
-                       {
-                       p2oreg(
-#ifdef ARGOFFSET
-                               ARGOFFSET +
-#endif
-                               (ftnint) (FUDGEOFFSET*p->memno),
-                               ARGREG,   type2 | P2PTR );
-                       }
-               else    {
-                       p2reg(ARGREG, type2 | P2PTR );
-                       p2icon(
-#ifdef ARGOFFSET
-                               ARGOFFSET +
-#endif
-                               (ftnint) (FUDGEOFFSET*p->memno), P2INT);
-                       p2op(P2PLUS, type2 | P2PTR );
-                       }
-               break;
-
-
-       case STGBSS:
-       case STGINIT:
-       case STGEXT:
-       case STGCOMMON:
-       case STGEQUIV:
-       case STGCONST:
-               if(offp)
-                       {
-                       putx(offp);
-                       putmem(p, P2ICON, offset);
-                       p2op(P2PLUS, type2 | P2PTR);
-                       if(indir)
-                               p2op(P2INDIRECT, type2);
-                       }
-               else
-                       putmem(p, (indir ? P2NAME : P2ICON), offset);
-
-               break;
-
-       case STGREG:
-               if(indir)
-                       p2reg(p->memno, type2);
-               else
-                       fatal("attempt to take address of a register");
-               break;
-
-       default:
-               fatal1("putaddr: invalid vstg %d", p->vstg);
-       }
-frexpr(p);
-}
-
-
-
-
-LOCAL putmem(p, class, offset)
-expptr p;
-int class;
-ftnint offset;
-{
-int type2;
-int funct;
-char *name,  *memname();
-
-funct = (p->vclass==CLPROC ? P2FUNCT<<2 : 0);
-type2 = types2[p->vtype];
-if(p->vclass == CLPROC)
-       type2 |= (P2FUNCT<<2);
-name = memname(p->vstg, p->memno);
-if(class == P2ICON)
-       {
-       p2triple(P2ICON, name[0]!='\0', type2|P2PTR);
-       p2word(offset);
-       if(name[0])
-               p2name(name);
-       }
-else
-       {
-       p2triple(P2NAME, offset!=0, type2);
-       if(offset != 0)
-               p2word(offset);
-       p2name(name);
-       }
-}
-
-
-\f
-LOCAL struct addrblock *putcall(p)
-struct exprblock *p;
-{
-chainp arglist, charsp, cp;
-int n, first;
-struct addrblock *t;
-struct exprblock *q;
-struct exprblock *fval;
-int type, type2, ctype, indir;
-
-type2 = types2[type = p->vtype];
-charsp = NULL;
-indir =  (p->opcode == OPCCALL);
-n = 0;
-first = YES;
-
-if(p->rightp)
-       {
-       arglist = p->rightp->listp;
-       free(p->rightp);
-       }
-else
-       arglist = NULL;
-
-for(cp = arglist ; cp ; cp = cp->nextp)
-       if(indir)
-               ++n;
-       else    {
-               q = cp->datap;
-               if(q->tag == TCONST)
-                       cp->datap = q = putconst(q);
-               if( ISCHAR(q) )
-                       {
-                       charsp = hookup(charsp, mkchain(cpexpr(q->vleng), 0) );
-                       n += 2;
-                       }
-               else if(q->vclass == CLPROC)
-                       {
-                       charsp = hookup(charsp, mkchain( ICON(0) , 0));
-                       n += 2;
-                       }
-               else
-                       n += 1;
-               }
-
-if(type == TYCHAR)
-       {
-       if( ISICON(p->vleng) )
-               {
-               fval = mktemp(TYCHAR, p->vleng);
-               n += 2;
-               }
-       else    {
-               err("adjustable character function");
-               return;
-               }
-       }
-else if( ISCOMPLEX(type) )
-       {
-       fval = mktemp(type, NULL);
-       n += 1;
-       }
-else
-       fval = NULL;
-
-ctype = (fval ? P2INT : type2);
-putaddr(p->leftp, NO);
-
-if(fval)
-       {
-       first = NO;
-       putaddr( cpexpr(fval), NO);
-       if(type==TYCHAR)
-               {
-               putx( mkconv(TYLENG,p->vleng) );
-               p2op(P2LISTOP, type2);
-               }
-       }
-
-for(cp = arglist ; cp ; cp = cp->nextp)
-       {
-       q = cp->datap;
-       if(q->tag==TADDR && (indir || q->vstg!=STGREG) )
-               putaddr(q, indir && q->vtype!=TYCHAR);
-       else if( ISCOMPLEX(q->vtype) )
-               putcxop(q);
-       else if (ISCHAR(q) )
-               putchop(q);
-       else if( ! ISERROR(q) )
-               {
-               if(indir)
-                       putx(q);
-               else    {
-                       t = mktemp(q->vtype, q->vleng);
-                       putassign( cpexpr(t), q );
-                       putaddr(t, NO);
-                       putcomma(1, q->vtype, YES);
-                       }
-               }
-       if(first)
-               first = NO;
-       else
-               p2op(P2LISTOP, type2);
-       }
-
-if(arglist)
-       frchain(&arglist);
-for(cp = charsp ; cp ; cp = cp->nextp)
-       {
-       putx( mkconv(TYLENG,cp->datap) );
-       p2op(P2LISTOP, type2);
-       }
-frchain(&charsp);
-p2op(n>0 ? P2CALL : P2CALL0 , ctype);
-free(p);
-return(fval);
-}
-
-
-
-LOCAL putmnmx(p)
-register struct exprblock *p;
-{
-int op, type;
-int ncomma;
-struct exprblock *qp;
-chainp p0, p1;
-struct addrblock *sp, *tp;
-
-type = p->vtype;
-op = (p->opcode==OPMIN ? OPLT : OPGT );
-p0 = p->leftp->listp;
-free(p->leftp);
-free(p);
-
-sp = mktemp(type, NULL);
-tp = mktemp(type, NULL);
-qp = mkexpr(OPCOLON, cpexpr(tp), cpexpr(sp));
-qp = mkexpr(OPQUEST, mkexpr(op, cpexpr(tp),cpexpr(sp)), qp);
-qp = fixexpr(qp);
-
-ncomma = 1;
-putassign( cpexpr(sp), p0->datap );
-
-for(p1 = p0->nextp ; p1 ; p1 = p1->nextp)
-       {
-       ++ncomma;
-       putassign( cpexpr(tp), p1->datap );
-       if(p1->nextp)
-               {
-               ++ncomma;
-               putassign( cpexpr(sp), cpexpr(qp) );
-               }
-       else
-               putx(qp);
-       }
-
-putcomma(ncomma, type, NO);
-frtemp(sp);
-frtemp(tp);
-frchain( &p0 );
-}
-
-
-
-
-LOCAL putcomma(n, type, indir)
-int n, type, indir;
-{
-type = types2[type];
-if(indir)
-       type |= P2PTR;
-while(--n >= 0)
-       p2op(P2COMOP, type);
-}
-
-
-
-
-ftnint simoffset(p0)
-expptr *p0;
-{
-ftnint offset, prod;
-register expptr p, lp, rp;
-
-offset = 0;
-p = *p0;
-if(p == NULL)
-       return(0);
-
-if( ! ISINT(p->vtype) )
-       return(0);
-
-if(p->tag==TEXPR && p->opcode==OPSTAR)
-       {
-       lp = p->leftp;
-       rp = p->rightp;
-       if(ISICON(rp) && lp->tag==TEXPR && lp->opcode==OPPLUS && ISICON(lp->rightp))
-               {
-               p->opcode = OPPLUS;
-               lp->opcode = OPSTAR;
-               prod = rp->const.ci * lp->rightp->const.ci;
-               lp->rightp->const.ci = rp->const.ci;
-               rp->const.ci = prod;
-               }
-       }
-
-if(p->tag==TEXPR && p->opcode==OPPLUS && ISICON(p->rightp))
-       {
-       rp = p->rightp;
-       lp = p->leftp;
-       offset += rp->const.ci;
-       frexpr(rp);
-       free(p);
-       *p0 = lp;
-       }
-
-if(p->tag == TCONST)
-       {
-       offset += p->const.ci;
-       frexpr(p);
-       *p0 = NULL;
-       }
-
-return(offset);
-}
-\f
-
-
-
-
-p2op(op, type)
-int op, type;
-{
-p2triple(op, 0, type);
-}
-
-p2icon(offset, type)
-ftnint offset;
-int type;
-{
-p2triple(P2ICON, 0, type);
-p2word(offset);
-}
-
-
-
-
-p2oreg(offset, reg, type)
-ftnint offset;
-int reg, type;
-{
-p2triple(P2OREG, reg, type);
-p2word(offset);
-p2name("");
-}
-
-
-
-
-p2reg(reg, type)
-int reg, type;
-{
-p2triple(P2REG, reg, type);
-}
-
-
-
-p2pass(s)
-char *s;
-{
-p2triple(P2PASS, (strlen(s) + FOUR-1)/FOUR, 0);
-p2str(s);
-}
-
-
-
-
-p2str(s)
-register char *s;
-{
-union { long int word; char str[FOUR]; } u;
-register int i;
-
-i = 0;
-u.word = 0;
-while(*s)
-       {
-       u.str[i++] = *s++;
-       if(i == FOUR)
-               {
-               p2word(u.word);
-               u.word = 0;
-               i = 0;
-               }
-       }
-if(i > 0)
-       p2word(u.word);
-}
-
-
-
-
-p2triple(op, var, type)
-int op, var, type;
-{
-register long word;
-word = op | (var<<8);
-word |= ( (long int) type) <<16;
-p2word(word);
-}
-
-
-
-
-p2name(s)
-char *s;
-{
-int i;
-union  { long int word[2];  char str[8]; } u;
-
-u.word[0] = u.word[1] = 0;
-for(i = 0 ; i<8 && *s ; ++i)
-       u.str[i] = *s++;
-p2word(u.word[0]);
-p2word(u.word[1]);
-}
-
-
-
-
-p2word(w)
-long int w;
-{
-*p2bufp++ = w;
-if(p2bufp >= p2bufend)
-       p2flush();
-}
-
-
-
-p2flush()
-{
-if(p2bufp > p2buff)
-       write(fileno(textfile), p2buff, (p2bufp-p2buff)*sizeof(long int));
-p2bufp = p2buff;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/f77/scjdefs b/.ref-Research-V7/usr/src/cmd/f77/scjdefs
deleted file mode 100644 (file)
index a5c903f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#define P2BAD -1
-#define P2NAME 2
-#define P2ICON 4
-#define P2PLUS 6
-#define P2PLUSEQ 7
-#define P2MINUS 8
-#define P2NEG 10
-#define P2STAR 11
-#define P2STAREQ 12
-#define P2INDIRECT 13
-#define P2BITAND 14
-#define P2BITOR 17
-#define P2BITXOR 19
-#define P2QUEST 21
-#define P2COLON 22
-#define P2ANDAND 23
-#define P2OROR 24
-#define P2GOTO 37
-#define P2LISTOP 56
-#define P2ASSIGN 58
-#define P2COMOP 59
-#define P2SLASH 60
-#define P2MOD 62
-#define P2LSHIFT 64
-#define P2RSHIFT 66
-#define P2CALL 70
-#define P2CALL0 72
-
-#define P2NOT 76
-#define P2BITNOT 77
-#define P2EQ 80
-#define P2NE 81
-#define P2LE 82
-#define P2LT 83
-#define P2GE 84
-#define P2GT 85
-#define P2REG 94
-#define P2OREG 95
-#define P2CONV 104
-#define P2FORCE 108
-#define P2CBRANCH 109
-
-/* special operators included only for fortran's use */
-
-#define P2PASS 200
-#define P2STMT 201
-#define P2SWITCH 202
-#define P2LBRACKET 203
-#define P2RBRACKET 204
-#define P2EOF 205
-#define P2ARIF 206
-#define P2LABEL 207
-
-#if TARGET==PDP11
-#      define P2SHORT 4
-#      define P2INT 4
-#      define P2LONG 5
-#else
-#      define P2SHORT 3
-#      define P2INT 4
-#      define P2LONG 4
-#endif
-
-#define P2CHAR 2
-#define P2REAL 6
-#define P2DREAL 7
-#define P2PTR 020
-#define P2FUNCT 040
diff --git a/.ref-Research-V7/usr/src/cmd/f77/tokdefs b/.ref-Research-V7/usr/src/cmd/f77/tokdefs
deleted file mode 100644 (file)
index 2984d40..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#define SEOS 1
-#define SCOMMENT 2
-#define SLABEL 3
-#define SUNKNOWN 4
-#define SHOLLERITH 5
-#define SICON 6
-#define SRCON 7
-#define SDCON 8
-#define SBITCON 9
-#define SOCTCON 10
-#define SHEXCON 11
-#define STRUE 12
-#define SFALSE 13
-#define SNAME 14
-#define SNAMEEQ 15
-#define SFIELD 16
-#define SSCALE 17
-#define SINCLUDE 18
-#define SLET 19
-#define SASSIGN 20
-#define SAUTOMATIC 21
-#define SBACKSPACE 22
-#define SBLOCK 23
-#define SCALL 24
-#define SCHARACTER 25
-#define SCLOSE 26
-#define SCOMMON 27
-#define SCOMPLEX 28
-#define SCONTINUE 29
-#define SDATA 30
-#define SDCOMPLEX 31
-#define SDIMENSION 32
-#define SDO 33
-#define SDOUBLE 34
-#define SELSE 35
-#define SELSEIF 36
-#define SEND 37
-#define SENDFILE 38
-#define SENDIF 39
-#define SENTRY 40
-#define SEQUIV 41
-#define SEXTERNAL 42
-#define SFORMAT 43
-#define SFUNCTION 44
-#define SGOTO 45
-#define SASGOTO 46
-#define SCOMPGOTO 47
-#define SARITHIF 48
-#define SLOGIF 49
-#define SIMPLICIT 50
-#define SINQUIRE 51
-#define SINTEGER 52
-#define SINTRINSIC 53
-#define SLOGICAL 54
-#define SOPEN 55
-#define SPARAM 56
-#define SPAUSE 57
-#define SPRINT 58
-#define SPROGRAM 59
-#define SPUNCH 60
-#define SREAD 61
-#define SREAL 62
-#define SRETURN 63
-#define SREWIND 64
-#define SSAVE 65
-#define SSTATIC 66
-#define SSTOP 67
-#define SSUBROUTINE 68
-#define STHEN 69
-#define STO 70
-#define SUNDEFINED 71
-#define SWRITE 72
-#define SLPAR 73
-#define SRPAR 74
-#define SEQUALS 75
-#define SCOLON 76
-#define SCOMMA 77
-#define SCURRENCY 78
-#define SPLUS 79
-#define SMINUS 80
-#define SSTAR 81
-#define SSLASH 82
-#define SPOWER 83
-#define SCONCAT 84
-#define SAND 85
-#define SOR 86
-#define SNEQV 87
-#define SEQV 88
-#define SNOT 89
-#define SEQ 90
-#define SLT 91
-#define SGT 92
-#define SLE 93
-#define SGE 94
-#define SNE 95
diff --git a/.ref-Research-V7/usr/src/cmd/f77/tokens b/.ref-Research-V7/usr/src/cmd/f77/tokens
deleted file mode 100644 (file)
index 3868cea..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-SEOS
-SCOMMENT
-SLABEL
-SUNKNOWN
-SHOLLERITH
-SICON
-SRCON
-SDCON
-SBITCON
-SOCTCON
-SHEXCON
-STRUE
-SFALSE
-SNAME
-SNAMEEQ
-SFIELD
-SSCALE
-SINCLUDE
-SLET
-SASSIGN
-SAUTOMATIC
-SBACKSPACE
-SBLOCK
-SCALL
-SCHARACTER
-SCLOSE
-SCOMMON
-SCOMPLEX
-SCONTINUE
-SDATA
-SDCOMPLEX
-SDIMENSION
-SDO
-SDOUBLE
-SELSE
-SELSEIF
-SEND
-SENDFILE
-SENDIF
-SENTRY
-SEQUIV
-SEXTERNAL
-SFORMAT
-SFUNCTION
-SGOTO
-SASGOTO
-SCOMPGOTO
-SARITHIF
-SLOGIF
-SIMPLICIT
-SINQUIRE
-SINTEGER
-SINTRINSIC
-SLOGICAL
-SOPEN
-SPARAM
-SPAUSE
-SPRINT
-SPROGRAM
-SPUNCH
-SREAD
-SREAL
-SRETURN
-SREWIND
-SSAVE
-SSTATIC
-SSTOP
-SSUBROUTINE
-STHEN
-STO
-SUNDEFINED
-SWRITE
-SLPAR
-SRPAR
-SEQUALS
-SCOLON
-SCOMMA
-SCURRENCY
-SPLUS
-SMINUS
-SSTAR
-SSLASH
-SPOWER
-SCONCAT
-SAND
-SOR
-SNEQV
-SEQV
-SNOT
-SEQ
-SLT
-SGT
-SLE
-SGE
-SNE
diff --git a/.ref-Research-V7/usr/src/cmd/factor.s b/.ref-Research-V7/usr/src/cmd/factor.s
deleted file mode 100644 (file)
index b28f42f..0000000
+++ /dev/null
@@ -1,351 +0,0 @@
-.globl sqrt
-exit = 1.
-read = 3.
-write = 4.
-ldfps = 170100^tst
-/
-       ldfps   $240
-
-       clr     argflg
-       cmp     (sp)+,$2
-       blt     begin
-       tst     (sp)+
-       mov     (sp),r2
-       jsr     r5,atof; getch1
-       inc     argflg
-       br      begin1
-begin:
-       tst     argflg
-       beq 9f; sys exit; 9:
-       jsr     r5,atof; getch
-begin1:
-       tstf    fr0
-       cfcc
-       bpl 9f; jmp ouch; 9:
-       bne 9f; sys exit; 9:
-       cmpf    big,fr0
-       cfcc
-       bgt 9f; jmp ouch; 9:
-/
-       movf    fr0,n
-       jsr     pc,sqrt
-       movf    fr0,v
-       mov     $1,r0
-       sys     write; nl; 1
-/
-       movf    $one,fr0
-       movf    fr0,fr4
-/
-       movf    n,fr0
-       movf    $two,fr1
-       jsr     r5,xt
-/
-       movf    n,fr0
-       movif   $3,fr1
-       jsr     r5,xt
-/
-       movf    n,fr0
-       movif   $5,fr1
-       jsr     r5,xt
-/
-       movf    n,fr0
-       movif   $7,fr1
-       jsr     r5,xt
-/
-       movf    n,fr0
-       movif   $11.,fr1
-       jsr     r5,xt
-/
-       movf    n,fr0
-       movif   $13.,fr1
-       jsr     r5,xt
-/
-       movf    n,fr0
-       movif   $17.,fr1
-       mov     $tab+6,r4
-       jsr     pc,xx
-       jmp     begin
-/
-xt:
-       movf    fr0,fr2
-       divf    fr1,fr2
-       modf    $one,fr2
-       movf    fr3,fr2
-       mulf    fr1,fr2
-       cmpf    fr2,fr0
-       cfcc
-       beq     hit2
-       rts     r5
-/
-/
-out1:
-       mov     $tab,r4
-       br      in1
-
-out2:
-       modf    fr4,fr2
-       cfcc
-       bne 9f; mov $xx0,-(sp); jmp hit; 9:
-       br      in2
-xx:
-       mov     (r4)+,kazoo
-xx0:
-       mov     $kazoo,r0
-       mov     $100.,r1
-       clr     r2
-       mov     $gorp,r3
-       mov     $gorp+6,r5
-xx1:
-       movf    fr0,fr2
-       divf    fr1,fr2
-       cmp     r4,$tabend
-       bhis    out1
-in1:
-       movf    fr2,(r3)
-       bit     r2,(r5)
-       beq     out2
-in2:
-kazoo  =.+2
-       addf    $kazoo,fr1
-       mov     (r4)+,(r0)
-       sob     r1,xx1
-       mov     $100.,r1
-       mov     $127.,r2
-       cmpf    v,fr1
-       cfcc
-       bge     xx1
-       cmpf    $one,fr0
-       cfcc
-       beq     1f
-       mov     $1,r0
-       sys     write; sp5; 5
-       movf    n,fr0
-       jsr     r5,ftoa; wrchar
-       mov     $1,r0
-       sys     write; nl; 1
-1:
-       rts     pc
-/
-/
-/
-hit2:
-       movf    fr1,t
-       movf    fr3,n
-       movf    fr3,fr0
-       jsr     pc,sqrt
-       movf    fr0,v
-       mov     $1,r0
-       sys     write; sp5; 5
-       movf    t,fr0
-       jsr     r5,ftoa; wrchar
-       mov     $1,r0
-       sys     write; nl; 1
-       movf    n,fr0
-       movf    t,fr1
-       cmp     r4,$tab
-       bne     1f
-       mov     $tabend,r4
-1:
-       mov     -(r4),kazoo
-       jmp     xt
-/
-hit:
-       movf    fr1,t
-       movf    fr3,n
-       movf    fr3,fr0
-       jsr     pc,sqrt
-       movf    fr0,v
-       mov     $1,r0
-       sys     write; sp5; 5
-       movf    t,fr0
-       jsr     r5,ftoa; wrchar
-       mov     $1,r0
-       sys     write; nl; 1
-       movf    n,fr0
-       movf    t,fr1
-       mov     $kazoo,r0
-       rts     pc
-/
-/
-/      get one character from the console.
-/      called from atof.
-/
-getch:
-       clr     r0
-       sys     read; ch; 1
-       bec 9f; sys exit; 9:
-       tst r0; bne 9f; sys exit; 9:
-       mov     ch,r0
-       rts     r5
-/
-/
-/      get one character form the argument string.
-getch1:
-       movb    (r2)+,r0
-       rts     r5
-/
-/      write one character on the console
-/      called from ftoa.
-/
-wrchar:
-       mov     r0,ch
-       mov     $1,r0
-       sys     write; ch; 1
-       rts     r5
-/
-/
-/      read and convert a line from the console into fr0.
-/
-atof:
-       mov     r1,-(sp)
-       movif   $10.,r3
-       clrf    r0
-1:
-       jsr     r5,*(r5)
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     2f
-       mulf    r3,r0
-       movif   r0,r1
-       addf    r1,r0
-       br      1b
-2:
-       cmp     r0,$' -'0
-       beq     1b
-/
-       mov     (sp)+,r1
-       tst     (r5)+
-       rts     r5
-
-/
-/
-/
-/
-ftoa:
-       mov     $ebuf,r2
-1:
-       modf    tenth,fr0
-       movf    fr0,fr2
-       movf    fr1,fr0
-       addf    $epsilon,fr2
-       modf    $ten,fr2
-       movfi   fr3,r0
-       movb    r0,-(r2)
-       tstf    fr0
-       cfcc
-       bne     1b
-1:
-       movb    (r2)+,r0
-       add     $60,r0
-       jsr     r5,*(r5)
-       cmp     r2,$ebuf
-       blo     1b
-       tst     (r5)+
-       rts     r5
-/
-epsilon = 037114
-tenth: 037314; 146314; 146314; 146315
-       .bss
-buf:   .=.+18.
-ebuf:
-       .text
-/
-/
-/
-/      complain about a number which the program
-/      is unable to digest
-ouch:
-       mov     $2,r0
-       sys     write; 1f; 2f-1f
-       jmp     begin
-/
-1:     <Ouch.\n>
-2:     .even
-/
-/
-one    = 40200
-two    = 40400
-four   = 40600
-ten    = 41040
-/
-       .data
-big:   056177; 177777; 177777; 177777
-nl:    <\n>
-sp5:   <     >
-       .even
-/
-tab:
-       41040; 40400; 40600; 40400; 40600; 40700; 40400; 40700
-       40600; 40400; 40600; 40700; 40700; 40400; 40700; 40600
-       40400; 40700; 40600; 40700; 41000; 40600; 40400; 40600
-       40400; 40600; 41000; 40700; 40600; 40700; 40400; 40600
-       40700; 40400; 40700; 40700; 40600; 40400; 40600; 40700
-       40400; 40700; 40600; 40400; 40600; 40400; 41040; 40400
-tabend:
-/
-       .bss
-ch:    .=.+2
-t:     .=.+8
-n:     .=.+8
-v:     .=.+8
-gorp:  .=.+8
-argflg:        .=.+2
-       .text
-ldfps = 170100^tst
-stfps = 170200^tst
-/
-/      sqrt replaces the f.p. number in fr0 by its
-/      square root.  newton's method
-/
-.globl sqrt, _sqrt
-/
-/
-_sqrt:
-       mov     r5,-(sp)
-       mov     sp,r5
-       movf    4(r5),fr0
-       jsr     pc,sqrt
-       mov     (sp)+,r5
-       rts     pc
-
-sqrt:
-       tstf    fr0
-       cfcc
-       bne     1f
-       clc
-       rts     pc              /sqrt(0)
-1:
-       bgt     1f
-       clrf    fr0
-       sec
-       rts     pc              / sqrt(-a)
-1:
-       mov     r0,-(sp)
-       stfps   -(sp)
-       mov     (sp),r0
-       bic     $!200,r0                / retain mode
-       ldfps   r0
-       movf    fr1,-(sp)
-       movf    fr2,-(sp)
-/
-       movf    fr0,fr1
-       movf    fr0,-(sp)
-       asr     (sp)
-       add     $20100,(sp)
-       movf    (sp)+,fr0       /initial guess
-       mov     $4,r0
-1:
-       movf    fr1,fr2
-       divf    fr0,fr2
-       addf    fr2,fr0
-       mulf    $half,fr0       / x = (x+a/x)/2
-       sob     r0,1b
-2:
-       movf    (sp)+,fr2
-       movf    (sp)+,fr1
-       ldfps   (sp)+
-       mov     (sp)+,r0
-       clc
-       rts     pc
-/
-half   = 40000
diff --git a/.ref-Research-V7/usr/src/cmd/fgrep.c b/.ref-Research-V7/usr/src/cmd/fgrep.c
deleted file mode 100644 (file)
index 826c097..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * fgrep -- print all lines containing any of a set of keywords
- *
- *     status returns:
- *             0 - ok, and some matches
- *             1 - ok, but no matches
- *             2 - some error
- */
-
-#include <stdio.h>
-
-#define        MAXSIZ 6000
-#define QSIZE 400
-struct words {
-       char    inp;
-       char    out;
-       struct  words *nst;
-       struct  words *link;
-       struct  words *fail;
-} w[MAXSIZ], *smax, *q;
-
-long   lnum;
-int    bflag, cflag, fflag, lflag, nflag, vflag, xflag;
-int    hflag   = 1;
-int    sflag;
-int    nfile;
-long   blkno;
-int    nsucc;
-long   tln;
-FILE   *wordf;
-char   *argptr;
-
-main(argc, argv)
-char **argv;
-{
-       while (--argc > 0 && (++argv)[0][0]=='-')
-               switch (argv[0][1]) {
-
-               case 's':
-                       sflag++;
-                       continue;
-
-               case 'h':
-                       hflag = 0;
-                       continue;
-
-               case 'b':
-                       bflag++;
-                       continue;
-
-               case 'c':
-                       cflag++;
-                       continue;
-
-               case 'e':
-                       argc--;
-                       argv++;
-                       goto out;
-
-               case 'f':
-                       fflag++;
-                       continue;
-
-               case 'l':
-                       lflag++;
-                       continue;
-
-               case 'n':
-                       nflag++;
-                       continue;
-
-               case 'v':
-                       vflag++;
-                       continue;
-
-               case 'x':
-                       xflag++;
-                       continue;
-
-               default:
-                       fprintf(stderr, "egrep: unknown flag\n");
-                       continue;
-               }
-out:
-       if (argc<=0)
-               exit(2);
-       if (fflag) {
-               wordf = fopen(*argv, "r");
-               if (wordf==NULL) {
-                       fprintf(stderr, "egrep: can't open %s\n", *argv);
-                       exit(2);
-               }
-       }
-       else argptr = *argv;
-       argc--;
-       argv++;
-
-       cgotofn();
-       cfail();
-       nfile = argc;
-       if (argc<=0) {
-               if (lflag) exit(1);
-               execute((char *)NULL);
-       }
-       else while (--argc >= 0) {
-               execute(*argv);
-               argv++;
-       }
-       exit(nsucc == 0);
-}
-
-execute(file)
-char *file;
-{
-       register char *p;
-       register struct words *c;
-       register ccount;
-       char buf[1024];
-       int f;
-       int failed;
-       char *nlp;
-       if (file) {
-               if ((f = open(file, 0)) < 0) {
-                       fprintf(stderr, "fgrep: can't open %s\n", file);
-                       exit(2);
-               }
-       }
-       else f = 0;
-       ccount = 0;
-       failed = 0;
-       lnum = 1;
-       tln = 0;
-       blkno = 0;
-       p = buf;
-       nlp = p;
-       c = w;
-       for (;;) {
-               if (--ccount <= 0) {
-                       if (p == &buf[1024]) p = buf;
-                       if (p > &buf[512]) {
-                               if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break;
-                       }
-                       else if ((ccount = read(f, p, 512)) <= 0) break;
-                       blkno += ccount;
-               }
-               nstate:
-                       if (c->inp == *p) {
-                               c = c->nst;
-                       }
-                       else if (c->link != 0) {
-                               c = c->link;
-                               goto nstate;
-                       }
-                       else {
-                               c = c->fail;
-                               failed = 1;
-                               if (c==0) {
-                                       c = w;
-                                       istate:
-                                       if (c->inp == *p) {
-                                               c = c->nst;
-                                       }
-                                       else if (c->link != 0) {
-                                               c = c->link;
-                                               goto istate;
-                                       }
-                               }
-                               else goto nstate;
-                       }
-               if (c->out) {
-                       while (*p++ != '\n') {
-                               if (--ccount <= 0) {
-                                       if (p == &buf[1024]) p = buf;
-                                       if (p > &buf[512]) {
-                                               if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break;
-                                       }
-                                       else if ((ccount = read(f, p, 512)) <= 0) break;
-                                       blkno += ccount;
-                               }
-                       }
-                       if ( (vflag && (failed == 0 || xflag == 0)) || (vflag == 0 && xflag && failed) )
-                               goto nomatch;
-       succeed:        nsucc = 1;
-                       if (cflag) tln++;
-                       else if (sflag)
-                               ;       /* ugh */
-                       else if (lflag) {
-                               printf("%s\n", file);
-                               close(f);
-                               return;
-                       }
-                       else {
-                               if (nfile > 1 && hflag) printf("%s:", file);
-                               if (bflag) printf("%ld:", (blkno-ccount-1)/512);
-                               if (nflag) printf("%ld:", lnum);
-                               if (p <= nlp) {
-                                       while (nlp < &buf[1024]) putchar(*nlp++);
-                                       nlp = buf;
-                               }
-                               while (nlp < p) putchar(*nlp++);
-                       }
-       nomatch:        lnum++;
-                       nlp = p;
-                       c = w;
-                       failed = 0;
-                       continue;
-               }
-               if (*p++ == '\n')
-                       if (vflag) goto succeed;
-                       else {
-                               lnum++;
-                               nlp = p;
-                               c = w;
-                               failed = 0;
-                       }
-       }
-       close(f);
-       if (cflag) {
-               if (nfile > 1)
-                       printf("%s:", file);
-               printf("%ld\n", tln);
-       }
-}
-
-getargc()
-{
-       register c;
-       if (wordf)
-               return(getc(wordf));
-       if ((c = *argptr++) == '\0')
-               return(EOF);
-       return(c);
-}
-
-cgotofn() {
-       register c;
-       register struct words *s;
-
-       s = smax = w;
-nword: for(;;) {
-               c = getargc();
-               if (c==EOF)
-                       return;
-               if (c == '\n') {
-                       if (xflag) {
-                               for(;;) {
-                                       if (s->inp == c) {
-                                               s = s->nst;
-                                               break;
-                                       }
-                                       if (s->inp == 0) goto nenter;
-                                       if (s->link == 0) {
-                                               if (smax >= &w[MAXSIZ -1]) overflo();
-                                               s->link = ++smax;
-                                               s = smax;
-                                               goto nenter;
-                                       }
-                                       s = s->link;
-                               }
-                       }
-                       s->out = 1;
-                       s = w;
-               } else {
-               loop:   if (s->inp == c) {
-                               s = s->nst;
-                               continue;
-                       }
-                       if (s->inp == 0) goto enter;
-                       if (s->link == 0) {
-                               if (smax >= &w[MAXSIZ - 1]) overflo();
-                               s->link = ++smax;
-                               s = smax;
-                               goto enter;
-                       }
-                       s = s->link;
-                       goto loop;
-               }
-       }
-
-       enter:
-       do {
-               s->inp = c;
-               if (smax >= &w[MAXSIZ - 1]) overflo();
-               s->nst = ++smax;
-               s = smax;
-       } while ((c = getargc()) != '\n' && c!=EOF);
-       if (xflag) {
-       nenter: s->inp = '\n';
-               if (smax >= &w[MAXSIZ -1]) overflo();
-               s->nst = ++smax;
-       }
-       smax->out = 1;
-       s = w;
-       if (c != EOF)
-               goto nword;
-}
-
-overflo() {
-       fprintf(stderr, "wordlist too large\n");
-       exit(2);
-}
-cfail() {
-       struct words *queue[QSIZE];
-       struct words **front, **rear;
-       struct words *state;
-       register char c;
-       register struct words *s;
-       s = w;
-       front = rear = queue;
-init:  if ((s->inp) != 0) {
-               *rear++ = s->nst;
-               if (rear >= &queue[QSIZE - 1]) overflo();
-       }
-       if ((s = s->link) != 0) {
-               goto init;
-       }
-
-       while (rear!=front) {
-               s = *front;
-               if (front == &queue[QSIZE-1])
-                       front = queue;
-               else front++;
-       cloop:  if ((c = s->inp) != 0) {
-                       *rear = (q = s->nst);
-                       if (front < rear)
-                               if (rear >= &queue[QSIZE-1])
-                                       if (front == queue) overflo();
-                                       else rear = queue;
-                               else rear++;
-                       else
-                               if (++rear == front) overflo();
-                       state = s->fail;
-               floop:  if (state == 0) state = w;
-                       if (state->inp == c) {
-                               q->fail = state->nst;
-                               if ((state->nst)->out == 1) q->out = 1;
-                               continue;
-                       }
-                       else if ((state = state->link) != 0)
-                               goto floop;
-               }
-               if ((s = s->link) != 0)
-                       goto cloop;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/file.c b/.ref-Research-V7/usr/src/cmd/file.c
deleted file mode 100644 (file)
index b431a4a..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * determine type of file
- */
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <ctype.h>
-int in;
-int i  = 0;
-char buf[512];
-char *fort[] = {
-       "function","subroutine","common","dimension","block","integer",
-       "real","data","double",0};
-char *asc[] = {
-       "sys","mov","tst","clr","jmp",0};
-char *c[] = {
-       "int","char","float","double","struct","extern",0};
-char *as[] = {
-       "globl","byte","even","text","data","bss","comm",0};
-int    ifile;
-
-main(argc, argv)
-char **argv;
-{
-       FILE *fl;
-       register char *p;
-       char ap[128];
-
-       if (argc>1 && argv[1][0]=='-' && argv[1][1]=='f') {
-               if ((fl = fopen(argv[2], "r")) == NULL) {
-                       printf("Can't open %s\n", argv[2]);
-                       exit(2);
-               }
-               while ((p = fgets(ap, 128, fl)) != NULL) {
-                       int l = strlen(p);
-                       if (l>0)
-                               p[l-1] = '\0';
-                       printf("%s:     ", p);
-                       type(p);
-                       if (ifile>=0)
-                               close(ifile);
-               }
-               exit(1);
-       }
-       while(argc > 1) {
-               printf("%s:     ", argv[1]);
-               type(argv[1]);
-               argc--;
-               argv++;
-               if (ifile >= 0)
-                       close(ifile);
-       }
-}
-
-type(file)
-char *file;
-{
-       int j,nl;
-       char ch;
-       struct stat mbuf;
-
-       ifile = -1;
-       if(stat(file, &mbuf) < 0) {
-               printf("cannot stat\n");
-               return;
-       }
-       switch (mbuf.st_mode & S_IFMT) {
-
-       case S_IFCHR:
-               printf("character");
-               goto spcl;
-
-       case S_IFDIR:
-               printf("directory\n");
-               return;
-
-       case S_IFBLK:
-               printf("block");
-
-spcl:
-               printf(" special (%d/%d)\n", major(mbuf.st_rdev), minor(mbuf.st_rdev));
-               return;
-       }
-
-       ifile = open(file, 0);
-       if(ifile < 0) {
-               printf("cannot open\n");
-               return;
-       }
-       in = read(ifile, buf, 512);
-       if(in == 0){
-               printf("empty\n");
-               return;
-       }
-       switch(*(int *)buf) {
-
-       case 0410:
-               printf("pure ");
-               goto exec;
-
-       case 0411:
-               printf("separate ");
-
-       case 0407:
-exec:
-               printf("executable");
-               if(((int *)buf)[4] != 0)
-                       printf(" not stripped");
-               printf("\n");
-               goto out;
-
-       case 0177555:
-               printf("old archive\n");
-               goto out;
-
-       case 0177545:
-               printf("archive\n");
-               goto out;
-       }
-
-       i = 0;
-       if(ccom() == 0)goto notc;
-       while(buf[i] == '#'){
-               j = i;
-               while(buf[i++] != '\n'){
-                       if(i - j > 255){
-                               printf("data\n"); 
-                               goto out;
-                       }
-                       if(i >= in)goto notc;
-               }
-               if(ccom() == 0)goto notc;
-       }
-check:
-       if(lookup(c) == 1){
-               while((ch = buf[i++]) != ';' && ch != '{')if(i >= in)goto notc;
-               printf("c program text");
-               goto outa;
-       }
-       nl = 0;
-       while(buf[i] != '('){
-               if(buf[i] <= 0)
-                       goto notas;
-               if(buf[i] == ';'){
-                       i++; 
-                       goto check; 
-               }
-               if(buf[i++] == '\n')
-                       if(nl++ > 6)goto notc;
-               if(i >= in)goto notc;
-       }
-       while(buf[i] != ')'){
-               if(buf[i++] == '\n')
-                       if(nl++ > 6)goto notc;
-               if(i >= in)goto notc;
-       }
-       while(buf[i] != '{'){
-               if(buf[i++] == '\n')
-                       if(nl++ > 6)goto notc;
-               if(i >= in)goto notc;
-       }
-       printf("c program text");
-       goto outa;
-notc:
-       i = 0;
-       while(buf[i] == 'c' || buf[i] == '#'){
-               while(buf[i++] != '\n')if(i >= in)goto notfort;
-       }
-       if(lookup(fort) == 1){
-               printf("fortran program text");
-               goto outa;
-       }
-notfort:
-       i=0;
-       if(ascom() == 0)goto notas;
-       j = i-1;
-       if(buf[i] == '.'){
-               i++;
-               if(lookup(as) == 1){
-                       printf("assembler program text"); 
-                       goto outa;
-               }
-               else if(buf[j] == '\n' && isalpha(buf[j+2])){
-                       printf("roff, nroff, or eqn input text");
-                       goto outa;
-               }
-       }
-       while(lookup(asc) == 0){
-               if(ascom() == 0)goto notas;
-               while(buf[i] != '\n' && buf[i++] != ':')
-                       if(i >= in)goto notas;
-               while(buf[i] == '\n' || buf[i] == ' ' || buf[i] == '\t')if(i++ >= in)goto notas;
-               j = i-1;
-               if(buf[i] == '.'){
-                       i++;
-                       if(lookup(as) == 1){
-                               printf("assembler program text"); 
-                               goto outa; 
-                       }
-                       else if(buf[j] == '\n' && isalpha(buf[j+2])){
-                               printf("roff, nroff, or eqn input text");
-                               goto outa;
-                       }
-               }
-       }
-       printf("assembler program text");
-       goto outa;
-notas:
-       for(i=0; i < in; i++)if(buf[i]&0200){
-               if (buf[0]=='\100' && buf[1]=='\357') {
-                       printf("troff output\n");
-                       goto out;
-               }
-               printf("data\n"); 
-               goto out; 
-       }
-       if (mbuf.st_mode&((S_IEXEC)|(S_IEXEC>>3)|(S_IEXEC>>6)))
-               printf("commands text");
-       else
-           if (english(buf, in))
-               printf("English text");
-       else
-           printf("ascii text");
-outa:
-       while(i < in)
-               if((buf[i++]&0377) > 127){
-                       printf(" with garbage\n");
-                       goto out;
-               }
-       /* if next few lines in then read whole file looking for nulls ...
-               while((in = read(ifile,buf,512)) > 0)
-                       for(i = 0; i < in; i++)
-                               if((buf[i]&0377) > 127){
-                                       printf(" with garbage\n");
-                                       goto out;
-                               }
-               /*.... */
-       printf("\n");
-out:;
-}
-lookup(tab)
-char *tab[];
-{
-       char r;
-       int k,j,l;
-       while(buf[i] == ' ' || buf[i] == '\t' || buf[i] == '\n')i++;
-       for(j=0; tab[j] != 0; j++){
-               l=0;
-               for(k=i; ((r=tab[j][l++]) == buf[k] && r != '\0');k++);
-               if(r == '\0')
-                       if(buf[k] == ' ' || buf[k] == '\n' || buf[k] == '\t'
-                           || buf[k] == '{' || buf[k] == '/'){
-                               i=k;
-                               return(1);
-                       }
-       }
-       return(0);
-}
-ccom(){
-       char cc;
-       while((cc = buf[i]) == ' ' || cc == '\t' || cc == '\n')if(i++ >= in)return(0);
-       if(buf[i] == '/' && buf[i+1] == '*'){
-               i += 2;
-               while(buf[i] != '*' || buf[i+1] != '/'){
-                       if(buf[i] == '\\')i += 2;
-                       else i++;
-                       if(i >= in)return(0);
-               }
-               if((i += 2) >= in)return(0);
-       }
-       if(buf[i] == '\n')if(ccom() == 0)return(0);
-       return(1);
-}
-ascom(){
-       while(buf[i] == '/'){
-               i++;
-               while(buf[i++] != '\n')if(i >= in)return(0);
-               while(buf[i] == '\n')if(i++ >= in)return(0);
-       }
-       return(1);
-}
-
-english (bp, n)
-char *bp;
-{
-# define NASC 128
-       int ct[NASC], j, vow, freq, rare;
-       int badpun = 0, punct = 0;
-       if (n<50) return(0); /* no point in statistics on squibs */
-       for(j=0; j<NASC; j++)
-               ct[j]=0;
-       for(j=0; j<n; j++)
-       {
-               if (bp[j]<NASC)
-                       ct[bp[j]|040]++;
-               switch (bp[j])
-               {
-               case '.': 
-               case ',': 
-               case ')': 
-               case '%':
-               case ';': 
-               case ':': 
-               case '?':
-                       punct++;
-                       if ( j < n-1 &&
-                           bp[j+1] != ' ' &&
-                           bp[j+1] != '\n')
-                               badpun++;
-               }
-       }
-       if (badpun*5 > punct)
-               return(0);
-       vow = ct['a'] + ct['e'] + ct['i'] + ct['o'] + ct['u'];
-       freq = ct['e'] + ct['t'] + ct['a'] + ct['i'] + ct['o'] + ct['n'];
-       rare = ct['v'] + ct['j'] + ct['k'] + ct['q'] + ct['x'] + ct['z'];
-       if (2*ct[';'] > ct['e']) return(0);
-       if ( (ct['>']+ct['<']+ct['/'])>ct['e']) return(0); /* shell file test */
-       return (vow*5 >= n-ct[' '] && freq >= 10*rare);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/find.c b/.ref-Research-V7/usr/src/cmd/find.c
deleted file mode 100644 (file)
index d0aea47..0000000
+++ /dev/null
@@ -1,723 +0,0 @@
-/*     find    COMPILE:        cc -o find -s -O -i find.c -lS  */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/dir.h>
-#include <sys/stat.h>
-#define A_DAY  86400L /* a day full of seconds */
-#define EQ(x, y)       (strcmp(x, y)==0)
-
-int    Randlast;
-char   Pathname[200];
-
-struct anode {
-       int (*F)();
-       struct anode *L, *R;
-} Node[100];
-int Nn;  /* number of nodes */
-char   *Fname;
-long   Now;
-int    Argc,
-       Ai,
-       Pi;
-char   **Argv;
-/* cpio stuff */
-int    Cpio;
-short  *Buf, *Dbuf, *Wp;
-int    Bufsize = 5120;
-int    Wct = 2560;
-
-long   Newer;
-
-struct stat Statb;
-
-struct anode   *exp(),
-               *e1(),
-               *e2(),
-               *e3(),
-               *mk();
-char   *nxtarg();
-char   Home[128];
-long   Blocks;
-char *rindex();
-char *sbrk();
-main(argc, argv) char *argv[];
-{
-       struct anode *exlist;
-       int paths;
-       register char *cp, *sp = 0;
-       FILE *pwd, *popen();
-
-       time(&Now);
-       pwd = popen("pwd", "r");
-       fgets(Home, 128, pwd);
-       pclose(pwd);
-       Home[strlen(Home) - 1] = '\0';
-       Argc = argc; Argv = argv;
-       if(argc<3) {
-usage:         pr("Usage: find path-list predicate-list\n");
-               exit(1);
-       }
-       for(Ai = paths = 1; Ai < (argc-1); ++Ai, ++paths)
-               if(*Argv[Ai] == '-' || EQ(Argv[Ai], "(") || EQ(Argv[Ai], "!"))
-                       break;
-       if(paths == 1) /* no path-list */
-               goto usage;
-       if(!(exlist = exp())) { /* parse and compile the arguments */
-               pr("find: parsing error\n");
-               exit(1);
-       }
-       if(Ai<argc) {
-               pr("find: missing conjunction\n");
-               exit(1);
-       }
-       for(Pi = 1; Pi < paths; ++Pi) {
-               sp = 0;
-               chdir(Home);
-               strcpy(Pathname, Argv[Pi]);
-               if(cp = rindex(Pathname, '/')) {
-                       sp = cp + 1;
-                       *cp = '\0';
-                       if(chdir(*Pathname? Pathname: "/") == -1) {
-                               pr("find: bad starting directory\n");
-                               exit(2);
-                       }
-                       *cp = '/';
-               }
-               Fname = sp? sp: Pathname;
-               descend(Pathname, Fname, exlist); /* to find files that match  */
-       }
-       if(Cpio) {
-               strcpy(Pathname, "TRAILER!!!");
-               Statb.st_size = 0;
-               cpio();
-       }
-       exit(0);
-}
-
-/* compile time functions:  priority is  exp()<e1()<e2()<e3()  */
-
-struct anode *exp() { /* parse ALTERNATION (-o)  */
-       int or();
-       register struct anode * p1;
-
-       p1 = e1() /* get left operand */ ;
-       if(EQ(nxtarg(), "-o")) {
-               Randlast--;
-               return(mk(or, p1, exp()));
-       }
-       else if(Ai <= Argc) --Ai;
-       return(p1);
-}
-struct anode *e1() { /* parse CONCATENATION (formerly -a) */
-       int and();
-       register struct anode * p1;
-       register char *a;
-
-       p1 = e2();
-       a = nxtarg();
-       if(EQ(a, "-a")) {
-And:
-               Randlast--;
-               return(mk(and, p1, e1()));
-       } else if(EQ(a, "(") || EQ(a, "!") || (*a=='-' && !EQ(a, "-o"))) {
-               --Ai;
-               goto And;
-       } else if(Ai <= Argc) --Ai;
-       return(p1);
-}
-struct anode *e2() { /* parse NOT (!) */
-       int not();
-
-       if(Randlast) {
-               pr("find: operand follows operand\n");
-               exit(1);
-       }
-       Randlast++;
-       if(EQ(nxtarg(), "!"))
-               return(mk(not, e3(), (struct anode *)0));
-       else if(Ai <= Argc) --Ai;
-       return(e3());
-}
-struct anode *e3() { /* parse parens and predicates */
-       int exeq(), ok(), glob(),  mtime(), atime(), ctime(), user(),
-               group(), size(), perm(), links(), print(),
-               type(), ino(), cpio(), newer();
-       struct anode *p1;
-       int i;
-       register char *a, *b, s;
-
-       a = nxtarg();
-       if(EQ(a, "(")) {
-               Randlast--;
-               p1 = exp();
-               a = nxtarg();
-               if(!EQ(a, ")")) goto err;
-               return(p1);
-       }
-       else if(EQ(a, "-print")) {
-               return(mk(print, (struct anode *)0, (struct anode *)0));
-       }
-       b = nxtarg();
-       s = *b;
-       if(s=='+') b++;
-       if(EQ(a, "-name"))
-               return(mk(glob, (struct anode *)b, (struct anode *)0));
-       else if(EQ(a, "-mtime"))
-               return(mk(mtime, (struct anode *)atoi(b), (struct anode *)s));
-       else if(EQ(a, "-atime"))
-               return(mk(atime, (struct anode *)atoi(b), (struct anode *)s));
-       else if(EQ(a, "-ctime"))
-               return(mk(ctime, (struct anode *)atoi(b), (struct anode *)s));
-       else if(EQ(a, "-user")) {
-               if((i=getunum("/etc/passwd", b)) == -1) {
-                       if(gmatch(b, "[0-9][0-9][0-9]*")
-                       || gmatch(b, "[0-9][0-9]")
-                       || gmatch(b, "[0-9]"))
-                               return mk(user, (struct anode *)atoi(b), (struct anode *)s);
-                       pr("find: cannot find -user name\n");
-                       exit(1);
-               }
-               return(mk(user, (struct anode *)i, (struct anode *)s));
-       }
-       else if(EQ(a, "-inum"))
-               return(mk(ino, (struct anode *)atoi(b), (struct anode *)s));
-       else if(EQ(a, "-group")) {
-               if((i=getunum("/etc/group", b)) == -1) {
-                       if(gmatch(b, "[0-9][0-9][0-9]*")
-                       || gmatch(b, "[0-9][0-9]")
-                       || gmatch(b, "[0-9]"))
-                               return mk(group, (struct anode *)atoi(b), (struct anode *)s);
-                       pr("find: cannot find -group name\n");
-                       exit(1);
-               }
-               return(mk(group, (struct anode *)i, (struct anode *)s));
-       } else if(EQ(a, "-size"))
-               return(mk(size, (struct anode *)atoi(b), (struct anode *)s));
-       else if(EQ(a, "-links"))
-               return(mk(links, (struct anode *)atoi(b), (struct anode *)s));
-       else if(EQ(a, "-perm")) {
-               for(i=0; *b ; ++b) {
-                       if(*b=='-') continue;
-                       i <<= 3;
-                       i = i + (*b - '0');
-               }
-               return(mk(perm, (struct anode *)i, (struct anode *)s));
-       }
-       else if(EQ(a, "-type")) {
-               i = s=='d' ? S_IFDIR :
-                   s=='b' ? S_IFBLK :
-                   s=='c' ? S_IFCHR :
-                   s=='f' ? 0100000 :
-                   0;
-               return(mk(type, (struct anode *)i, (struct anode *)0));
-       }
-       else if (EQ(a, "-exec")) {
-               i = Ai - 1;
-               while(!EQ(nxtarg(), ";"));
-               return(mk(exeq, (struct anode *)i, (struct anode *)0));
-       }
-       else if (EQ(a, "-ok")) {
-               i = Ai - 1;
-               while(!EQ(nxtarg(), ";"));
-               return(mk(ok, (struct anode *)i, (struct anode *)0));
-       }
-       else if(EQ(a, "-cpio")) {
-               if((Cpio = creat(b, 0666)) < 0) {
-                       pr("find: cannot create "), pr(s), pr("\n");
-                       exit(1);
-               }
-               Buf = (short *)sbrk(512);
-               Wp = Dbuf = (short *)sbrk(5120);
-               return(mk(cpio, (struct anode *)0, (struct anode *)0));
-       }
-       else if(EQ(a, "-newer")) {
-               if(stat(b, &Statb) < 0) {
-                       pr("find: cannot access "), pr(b), pr("\n");
-                       exit(1);
-               }
-               Newer = Statb.st_mtime;
-               return mk(newer, (struct anode *)0, (struct anode *)0);
-       }
-err:   pr("find: bad option "), pr(a), pr("\n");
-       exit(1);
-}
-struct anode *mk(f, l, r)
-int (*f)();
-struct anode *l, *r;
-{
-       Node[Nn].F = f;
-       Node[Nn].L = l;
-       Node[Nn].R = r;
-       return(&(Node[Nn++]));
-}
-
-char *nxtarg() { /* get next arg from command line */
-       static strikes = 0;
-
-       if(strikes==3) {
-               pr("find: incomplete statement\n");
-               exit(1);
-       }
-       if(Ai>=Argc) {
-               strikes++;
-               Ai = Argc + 1;
-               return("");
-       }
-       return(Argv[Ai++]);
-}
-
-/* execution time functions */
-and(p)
-register struct anode *p;
-{
-       return(((*p->L->F)(p->L)) && ((*p->R->F)(p->R))?1:0);
-}
-or(p)
-register struct anode *p;
-{
-        return(((*p->L->F)(p->L)) || ((*p->R->F)(p->R))?1:0);
-}
-not(p)
-register struct anode *p;
-{
-       return( !((*p->L->F)(p->L)));
-}
-glob(p)
-register struct { int f; char *pat; } *p; 
-{
-       return(gmatch(Fname, p->pat));
-}
-print()
-{
-       puts(Pathname);
-       return(1);
-}
-mtime(p)
-register struct { int f, t, s; } *p; 
-{
-       return(scomp((int)((Now - Statb.st_mtime) / A_DAY), p->t, p->s));
-}
-atime(p)
-register struct { int f, t, s; } *p; 
-{
-       return(scomp((int)((Now - Statb.st_atime) / A_DAY), p->t, p->s));
-}
-ctime(p)
-register struct { int f, t, s; } *p; 
-{
-       return(scomp((int)((Now - Statb.st_ctime) / A_DAY), p->t, p->s));
-}
-user(p)
-register struct { int f, u, s; } *p; 
-{
-       return(scomp(Statb.st_uid, p->u, p->s));
-}
-ino(p)
-register struct { int f, u, s; } *p;
-{
-       return(scomp((int)Statb.st_ino, p->u, p->s));
-}
-group(p)
-register struct { int f, u; } *p; 
-{
-       return(p->u == Statb.st_gid);
-}
-links(p)
-register struct { int f, link, s; } *p; 
-{
-       return(scomp(Statb.st_nlink, p->link, p->s));
-}
-size(p)
-register struct { int f, sz, s; } *p; 
-{
-       return(scomp((int)((Statb.st_size+511)>>9), p->sz, p->s));
-}
-perm(p)
-register struct { int f, per, s; } *p; 
-{
-       register i;
-       i = (p->s=='-') ? p->per : 07777; /* '-' means only arg bits */
-       return((Statb.st_mode & i & 07777) == p->per);
-}
-type(p)
-register struct { int f, per, s; } *p;
-{
-       return((Statb.st_mode&S_IFMT)==p->per);
-}
-exeq(p)
-register struct { int f, com; } *p;
-{
-       fflush(stdout); /* to flush possible `-print' */
-       return(doex(p->com));
-}
-ok(p)
-struct { int f, com; } *p;
-{
-       int c;  int yes;
-       yes = 0;
-       fflush(stdout); /* to flush possible `-print' */
-       pr("< "), pr(Argv[p->com]), pr(" ... "), pr(Pathname), pr(" >?   ");
-       fflush(stderr);
-       if((c=getchar())=='y') yes = 1;
-       while(c!='\n')
-               if(c==EOF)
-                       exit(2);
-               else
-                       c = getchar();
-       if(yes) return(doex(p->com));
-       return(0);
-}
-
-#define MKSHORT(v, lv) {U.l=1L;if(U.c[0]) U.l=lv, v[0]=U.s[1], v[1]=U.s[0]; else U.l=lv, v[0]=U.s[0], v[1]=U.s[1];}
-union { long l; short s[2]; char c[4]; } U;
-long mklong(v)
-short v[];
-{
-       U.l = 1;
-       if(U.c[0] /* VAX */)
-               U.s[0] = v[1], U.s[1] = v[0];
-       else
-               U.s[0] = v[0], U.s[1] = v[1];
-       return U.l;
-}
-cpio()
-{
-#define MAGIC 070707
-       struct header {
-               short   h_magic,
-                       h_dev,
-                       h_ino,
-                       h_mode,
-                       h_uid,
-                       h_gid,
-                       h_nlink,
-                       h_rdev;
-               short   h_mtime[2];
-               short   h_namesize;
-               short   h_filesize[2];
-               char    h_name[256];
-       } hdr;
-       register ifile, ct;
-       static long fsz;
-       register i;
-
-       hdr.h_magic = MAGIC;
-       strcpy(hdr.h_name, !strncmp(Pathname, "./", 2)? Pathname+2: Pathname);
-       hdr.h_namesize = strlen(hdr.h_name) + 1;
-       hdr.h_uid = Statb.st_uid;
-       hdr.h_gid = Statb.st_gid;
-       hdr.h_dev = Statb.st_dev;
-       hdr.h_ino = Statb.st_ino;
-       hdr.h_mode = Statb.st_mode;
-       MKSHORT(hdr.h_mtime, Statb.st_mtime);
-       hdr.h_nlink = Statb.st_nlink;
-       fsz = hdr.h_mode & S_IFREG? Statb.st_size: 0L;
-       MKSHORT(hdr.h_filesize, fsz);
-       hdr.h_rdev = Statb.st_rdev;
-       if(EQ(hdr.h_name, "TRAILER!!!")) {
-               bwrite((short *)&hdr, (sizeof hdr-256)+hdr.h_namesize);
-               for(i = 0; i < 10; ++i)
-                       bwrite(Buf, 512);
-               return;
-       }
-       if(!mklong(hdr.h_filesize)) {
-               bwrite((short *)&hdr, (sizeof hdr-256)+hdr.h_namesize);
-               return;
-       }
-       if((ifile = open(Fname, 0)) < 0) {
-cerror:
-               pr("find: cannot copy "), pr(hdr.h_name), pr("\n");
-               return;
-       }
-       bwrite((short *)&hdr, (sizeof hdr-256)+hdr.h_namesize);
-       for(fsz = mklong(hdr.h_filesize); fsz > 0; fsz -= 512) {
-               ct = fsz>512? 512: fsz;
-               if(read(ifile, (char *)Buf, ct) < 0)
-                       goto cerror;
-               bwrite(Buf, ct);
-       }
-       close(ifile);
-       return;
-}
-newer()
-{
-       return Statb.st_mtime > Newer;
-}
-
-/* support functions */
-scomp(a, b, s) /* funny signed compare */
-register a, b;
-register char s;
-{
-       if(s == '+')
-               return(a > b);
-       if(s == '-')
-               return(a < (b * -1));
-       return(a == b);
-}
-
-doex(com)
-{
-       register np;
-       register char *na;
-       static char *nargv[50];
-       static ccode;
-
-       ccode = np = 0;
-       while (na=Argv[com++]) {
-               if(strcmp(na, ";")==0) break;
-               if(strcmp(na, "{}")==0) nargv[np++] = Pathname;
-               else nargv[np++] = na;
-       }
-       nargv[np] = 0;
-       if (np==0) return(9);
-       if(fork()) /*parent*/ wait(&ccode);
-       else { /*child*/
-               chdir(Home);
-               execvp(nargv[0], nargv, np);
-               exit(1);
-       }
-       return(ccode ? 0:1);
-}
-
-getunum(f, s) char *f, *s; { /* find user/group name and return number */
-       register i;
-       register char *sp;
-       register c;
-       char str[20];
-       FILE *pin;
-
-       i = -1;
-       pin = fopen(f, "r");
-       c = '\n'; /* prime with a CR */
-       do {
-               if(c=='\n') {
-                       sp = str;
-                       while((c = *sp++ = getc(pin)) != ':')
-                               if(c == EOF) goto RET;
-                       *--sp = '\0';
-                       if(EQ(str, s)) {
-                               while((c=getc(pin)) != ':')
-                                       if(c == EOF) goto RET;
-                               sp = str;
-                               while((*sp = getc(pin)) != ':') sp++;
-                               *sp = '\0';
-                               i = atoi(str);
-                               goto RET;
-                       }
-               }
-       } while((c = getc(pin)) != EOF);
- RET:
-       fclose(pin);
-       return(i);
-}
-
-descend(name, fname, exlist)
-struct anode *exlist;
-char *name, *fname;
-{
-       int     dir = 0, /* open directory */
-               offset,
-               dsize,
-               entries,
-               dirsize;
-       struct direct dentry[32];
-       register struct direct  *dp;
-       register char *c1, *c2;
-       int i;
-       int rv = 0;
-       char *endofname;
-
-       if(stat(fname, &Statb)<0) {
-               pr("find: bad status-- "), pr(name), pr("\n");
-               return(0);
-       }
-       (*exlist->F)(exlist);
-       if((Statb.st_mode&S_IFMT)!=S_IFDIR)
-               return(1);
-
-       for(c1 = name; *c1; ++c1);
-       if(*(c1-1) == '/')
-               --c1;
-       endofname = c1;
-       dirsize = Statb.st_size;
-
-       if(chdir(fname) == -1)
-               return(0);
-       for(offset=0 ; offset < dirsize ; offset += 512) { /* each block */
-               dsize = 512<(dirsize-offset)? 512: (dirsize-offset);
-               if(!dir) {
-                       if((dir=open(".", 0))<0) {
-                               pr("find: cannot open "), pr(name), pr("\n");
-                               rv = 0;
-                               goto ret;
-                       }
-                       if(offset) lseek(dir, (long)offset, 0);
-                       if(read(dir, (char *)dentry, dsize)<0) {
-                               pr("find: cannot read "), pr(name), pr("\n");
-                               rv = 0;
-                               goto ret;
-                       }
-                       if(dir > 10) {
-                               close(dir);
-                               dir = 0;
-                       }
-               } else 
-                       if(read(dir, (char *)dentry, dsize)<0) {
-                               pr("find: cannot read "), pr(name), pr("\n");
-                               rv = 0;
-                               goto ret;
-                       }
-               for(dp=dentry, entries=dsize>>4; entries; --entries, ++dp) { /* each directory entry */
-                       if(dp->d_ino==0
-                       || (dp->d_name[0]=='.' && dp->d_name[1]=='\0')
-                       || (dp->d_name[0]=='.' && dp->d_name[1]=='.' && dp->d_name[2]=='\0'))
-                               continue;
-                       c1 = endofname;
-                       *c1++ = '/';
-                       c2 = dp->d_name;
-                       for(i=0; i<14; ++i)
-                               if(*c2)
-                                       *c1++ = *c2++;
-                               else
-                                       break;
-                       *c1 = '\0';
-                       if(c1 == endofname) { /* ?? */
-                               rv = 0;
-                               goto ret;
-                       }
-                       Fname = endofname+1;
-                       if(!descend(name, Fname, exlist)) {
-                               *endofname = '\0';
-                               chdir(Home);
-                               if(chdir(Pathname) == -1) {
-                                       pr("find: bad directory tree\n");
-                                       exit(1);
-                               }
-                       }
-               }
-       }
-       rv = 1;
-ret:
-       if(dir)
-               close(dir);
-       if(chdir("..") == -1) {
-               *endofname = '\0';
-               pr("find: bad directory "), pr(name), pr("\n");
-               rv = 1;
-       }
-       return(rv);
-}
-
-gmatch(s, p) /* string match as in glob */
-register char *s, *p;
-{
-       if (*s=='.' && *p!='.') return(0);
-       return amatch(s, p);
-}
-
-amatch(s, p)
-register char *s, *p;
-{
-       register cc;
-       int scc, k;
-       int c, lc;
-
-       scc = *s;
-       lc = 077777;
-       switch (c = *p) {
-
-       case '[':
-               k = 0;
-               while (cc = *++p) {
-                       switch (cc) {
-
-                       case ']':
-                               if (k)
-                                       return(amatch(++s, ++p));
-                               else
-                                       return(0);
-
-                       case '-':
-                               k |= lc <= scc & scc <= (cc=p[1]);
-                       }
-                       if (scc==(lc=cc)) k++;
-               }
-               return(0);
-
-       case '?':
-       caseq:
-               if(scc) return(amatch(++s, ++p));
-               return(0);
-       case '*':
-               return(umatch(s, ++p));
-       case 0:
-               return(!scc);
-       }
-       if (c==scc) goto caseq;
-       return(0);
-}
-
-umatch(s, p)
-register char *s, *p;
-{
-       if(*p==0) return(1);
-       while(*s)
-               if (amatch(s++, p)) return(1);
-       return(0);
-}
-
-bwrite(rp, c)
-register short *rp;
-register c;
-{
-       register short *wp = Wp;
-
-       c = (c+1) >> 1;
-       while(c--) {
-               if(!Wct) {
-again:
-                       if(write(Cpio, (char *)Dbuf, Bufsize)<0) {
-                               Cpio = chgreel(1, Cpio);
-                               goto again;
-                       }
-                       Wct = Bufsize >> 1;
-                       wp = Dbuf;
-                       ++Blocks;
-               }
-               *wp++ = *rp++;
-               --Wct;
-       }
-       Wp = wp;
-}
-chgreel(x, fl)
-{
-       register f;
-       char str[22];
-       FILE *devtty;
-       struct stat statb;
-
-       pr("find: can't "), pr(x? "write output": "read input"), pr("\n");
-       fstat(fl, &statb);
-       if((statb.st_mode&S_IFMT) != S_IFCHR)
-               exit(1);
-again:
-       pr("If you want to go on, type device/file name when ready\n");
-       devtty = fopen("/dev/tty", "r");
-       fgets(str, 20, devtty);
-       str[strlen(str) - 1] = '\0';
-       if(!*str)
-               exit(1);
-       close(fl);
-       if((f = open(str, x? 1: 0)) < 0) {
-               pr("That didn't work");
-               fclose(devtty);
-               goto again;
-       }
-       return f;
-}
-pr(s)
-char *s;
-{
-       fputs(s, stderr);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/getty.c b/.ref-Research-V7/usr/src/cmd/getty.c
deleted file mode 100644 (file)
index 35ee772..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-#
-/*
- * getty -- adapt to terminal speed on dialup, and call login
- */
-
-#include <sgtty.h>
-#include <signal.h>
-#define ERASE  '#'
-#define KILL   '@'
-
-struct sgttyb tmode;
-struct tchars tchars = { '\177', '\034', '\021', '\023', '\004', '\377' };
-
-struct tab {
-       char    tname;          /* this table name */
-       char    nname;          /* successor table name */
-       int     iflags;         /* initial flags */
-       int     fflags;         /* final flags */
-       int     ispeed;         /* input speed */
-       int     ospeed;         /* output speed */
-       char    *message;       /* login message */
-} itab[] = {
-
-/* table '0'-1-2-3 300,1200,150,110 */
-
-       '0', 1,
-       ANYP+RAW+NL1+CR1, ANYP+ECHO+CR1,
-       B300, B300,
-       "\n\r\033;\007login: ",
-
-       1, 2,
-       ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD+FF1,
-       B1200, B1200,
-       "\n\r\033;login: ",
-
-       2, 3,
-       ANYP+RAW+NL1+CR1, EVENP+ECHO+FF1+CR2+TAB1+NL1,
-       B150, B150,
-       "\n\r\033:\006\006\017login: ",
-
-       3, '0',
-       ANYP+RAW+NL1+CR1, ANYP+ECHO+CRMOD+XTABS+LCASE+CR1,
-       B110, B110,
-       "\n\rlogin: ",
-
-/* table '-' -- Console TTY 110 */
-       '-', '-',
-       ANYP+RAW+NL1+CR1, ANYP+ECHO+CRMOD+XTABS+LCASE+CR1,
-       B110, B110,
-       "\n\rlogin: ",
-
-/* table '1' -- 150 */
-       '1', '1',
-       ANYP+RAW+NL1+CR1, EVENP+ECHO+FF1+CR2+TAB1+NL1,
-       B150, B150,
-       "\n\r\033:\006\006\017login: ",
-
-/* table '2' -- 9600 */
-       '2', '2',
-       ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD+FF1,
-       B9600, B9600,
-       "\n\r\033;login: ",
-
-/* table '3'-'5' -- 1200,300 */
-       '3', '5',
-       ANYP+RAW+NL1+CR1, ANYP+XTABS+ECHO+CRMOD+FF1,
-       B1200, B1200,
-       "\n\r\033;login: ",
-
-/* table '5'-'3' -- 300,1200 */
-       '5', '3',
-       ANYP+RAW+NL1+CR1, ANYP+ECHO+CR1,
-       B300, B300,
-       "\n\r\033;\007login: ",
-
-/* table '4' -- Console Decwriter */
-       '4', '4',
-       ANYP+RAW, ANYP+ECHO+CRMOD+XTABS,
-       B300, B300,
-       "\n\rlogin: ",
-
-/* table 'i' -- Interdata Console */
-       'i', 'i',
-       RAW+CRMOD, CRMOD+ECHO+LCASE,
-       0, 0,
-       "\n\rlogin: ",
-
-/* table 'l' -- LSI Chess Terminal */
-       'l', 'l',
-       ANYP+RAW/*+HUPCL*/, ANYP+ECHO/*+HUPCL*/,
-       B300, B300,
-       "*",
-/* table '6' -- 2400 11/23 line */
-       '6', '6',
-       ANYP+RAW+NL1+CR1, ANYP+ECHO,
-       B2400, B2400,
-       "\n\rlogin: ",
-
-};
-
-#define        NITAB   sizeof itab/sizeof itab[0]
-#define        EOT     04              /* EOT char */
-
-char   name[16];
-int    crmod;
-int    upper;
-int    lower;
-
-char partab[] = {
-       0001,0201,0201,0001,0201,0001,0001,0201,
-       0202,0004,0003,0205,0005,0206,0201,0001,
-       0201,0001,0001,0201,0001,0201,0201,0001,
-       0001,0201,0201,0001,0201,0001,0001,0201,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0201
-};
-
-main(argc, argv)
-char **argv;
-{
-       register struct tab *tabp;
-       int tname;
-
-       tname = '0';
-       if (argc > 1)
-               tname = argv[1][0];
-       switch (tname) {
-
-       case '3':               /* adapt to connect speed (212) */
-               ioctl(0, TIOCGETP, &tmode);
-               if (tmode.sg_ispeed==B300)
-                       tname = '0';
-               else
-                       tname = '3';
-               break;
-       }
-       for (;;) {
-               for(tabp = itab; tabp < &itab[NITAB]; tabp++)
-                       if(tabp->tname == tname)
-                               break;
-               if(tabp >= &itab[NITAB])
-                       tabp = itab;
-               tmode.sg_flags = tabp->iflags;
-               tmode.sg_ispeed = tabp->ispeed;
-               tmode.sg_ospeed = tabp->ospeed;
-               ioctl(0, TIOCSETP, &tmode);
-               ioctl(0, TIOCSETC, &tchars);
-               puts(tabp->message);
-               if(getname()) {
-                       tmode.sg_erase = ERASE;
-                       tmode.sg_kill = KILL;
-                       tmode.sg_flags = tabp->fflags;
-                       if(crmod)
-                               tmode.sg_flags |= CRMOD;
-                       if(upper)
-                               tmode.sg_flags |= LCASE;
-                       if(lower)
-                               tmode.sg_flags &= ~LCASE;
-                       stty(0, &tmode);
-                       putchr('\n');
-                       execl("/bin/login", "login", name, 0);
-                       exit(1);
-               }
-               tname = tabp->nname;
-       }
-}
-
-getname()
-{
-       register char *np;
-       register c;
-       char cs;
-
-       crmod = 0;
-       upper = 0;
-       lower = 0;
-       np = name;
-       for (;;) {
-               if (read(0, &cs, 1) <= 0)
-                       exit(0);
-               if ((c = cs&0177) == 0)
-                       return(0);
-               if (c==EOT)
-                       exit(1);
-               if (c=='\r' || c=='\n' || np >= &name[16])
-                       break;
-               putchr(cs);
-               if (c>='a' && c <='z')
-                       lower++;
-               else if (c>='A' && c<='Z') {
-                       upper++;
-                       c += 'a'-'A';
-               } else if (c==ERASE) {
-                       if (np > name)
-                               np--;
-                       continue;
-               } else if (c==KILL) {
-                       putchr('\r');
-                       putchr('\n');
-                       np = name;
-                       continue;
-               } else if(c == ' ')
-                       c = '_';
-               *np++ = c;
-       }
-       *np = 0;
-       if (c == '\r')
-               crmod++;
-       return(1);
-}
-
-puts(as)
-char *as;
-{
-       register char *s;
-
-       s = as;
-       while (*s)
-               putchr(*s++);
-}
-
-putchr(cc)
-{
-       char c;
-       c = cc;
-       c |= partab[c&0177] & 0200;
-       write(1, &c, 1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/graph.c b/.ref-Research-V7/usr/src/cmd/graph.c
deleted file mode 100644 (file)
index 7bd4125..0000000
+++ /dev/null
@@ -1,693 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-#include <math.h>
-#define        INF     1.e+37
-#define        F       .25
-
-struct xy {
-       int     xlbf;   /*flag:explicit lower bound*/
-       int     xubf;   /*flag:explicit upper bound*/
-       int     xqf;    /*flag:explicit quantum*/
-       double (*xf)(); /*transform function, e.g. log*/
-       float   xa,xb;  /*scaling coefficients*/
-       float   xlb,xub;        /*lower and upper bound*/
-       float   xquant; /*quantum*/
-       float   xoff;           /*screen offset fraction*/
-       float   xsize;          /*screen fraction*/
-       int     xbot,xtop;      /*screen coords of border*/     
-       float   xmult;  /*scaling constant*/
-} xd,yd;
-struct val {
-       float xv;
-       float yv;
-       int lblptr;
-} *xx;
-
-char *labs;
-int labsiz;
-
-int tick = 50;
-int top = 4000;
-int bot = 200;
-float absbot;
-int    n;
-int    erasf = 1;
-int    gridf = 2;
-int    symbf = 0;
-int    absf = 0;
-int    transf;
-int    brkf;
-float  dx;
-char   *plotsymb;
-
-double atof();
-#define BSIZ 80
-char   labbuf[BSIZ];
-char   titlebuf[BSIZ];
-
-char *modes[] = {
-       "disconnected",
-       "solid",
-       "dotted",
-       "dotdashed",
-       "shortdashed",
-       "longdashed"
-};
-int mode = 1;
-char *realloc();
-char *malloc();
-
-double ident(x)
-double x;
-{
-       return(x);
-}
-
-main(argc,argv)
-char *argv[];
-{
-
-       space(0,0,4096,4096);
-       init(&xd);
-       init(&yd);
-       xd.xsize = yd.xsize = 1.;
-       xx = (struct val *)malloc((unsigned)sizeof(struct val));
-       labs = malloc(1);
-       labs[labsiz++] = 0;
-       setopt(argc,argv);
-       if(erasf)
-               erase();
-       readin();
-       transpose();
-       scale(&xd,(struct val *)&xx->xv);
-       scale(&yd,(struct val *)&xx->yv);
-       axes();
-       title();
-       plot();
-       move(1,1);
-       closevt();
-       return(0);
-}
-
-init(p)
-struct xy *p;
-{
-       p->xf = ident;
-       p->xmult = 1;
-}
-
-setopt(argc,argv)
-char *argv[];
-{
-       char *p1, *p2;
-       float temp;
-
-       xd.xlb = yd.xlb = INF;
-       xd.xub = yd.xub = -INF;
-       while(--argc > 0) {
-               argv++;
-again:         switch(argv[0][0]) {
-               case '-':
-                       argv[0]++;
-                       goto again;
-               case 'l': /* label for plot */
-                       p1 = titlebuf;
-                       if (argc>=2) {
-                               argv++;
-                               argc--;
-                               p2 = argv[0];
-                               while (*p1++ = *p2++);
-                       }
-                       break;
-
-               case 'd':       /*disconnected,obsolete option*/
-               case 'm': /*line mode*/
-                       mode = 0;
-                       if(!numb(&temp,&argc,&argv))
-                               break;
-                       if(temp>=sizeof(modes)/sizeof(*modes))
-                               mode = 1;
-                       else if(temp>=0)
-                               mode = temp;
-                       break;
-
-               case 'a': /*automatic abscissas*/
-                       absf = 1;
-                       dx = 1;
-                       if(!numb(&dx,&argc,&argv))
-                               break;
-                       if(numb(&absbot,&argc,&argv))
-                               absf = 2;
-                       break;
-
-               case 's': /*save screen, overlay plot*/
-                       erasf = 0;
-                       break;
-
-               case 'g': /*grid style 0 none, 1 ticks, 2 full*/
-                       gridf = 0;
-                       if(!numb(&temp,&argc,&argv))
-                               temp = argv[0][1]-'0';  /*for caompatibility*/
-                       if(temp>=0&&temp<=2)
-                               gridf = temp;
-                       break;
-
-               case 'c': /*character(s) for plotting*/
-                       if(argc >= 2) {
-                               symbf = 1;
-                               plotsymb = argv[1];
-                               argv++;
-                               argc--;
-                       }
-                       break;
-
-               case 't':       /*transpose*/
-                       transf = 1;
-                       break;
-               case 'b':       /*breaks*/
-                       brkf = 1;
-                       break;
-               case 'x':       /*x limits */
-                       limread(&xd,&argc,&argv);
-                       break;
-               case 'y':
-                       limread(&yd,&argc,&argv);
-                       break;
-               case 'h': /*set height of plot */
-                       if(!numb(&yd.xsize, &argc,&argv))
-                               badarg();
-                       break;
-               case 'w': /*set width of plot */
-                       if(!numb(&xd.xsize, &argc, &argv))
-                               badarg();
-                       break;
-               case 'r': /* set offset to right */
-                       if(!numb(&xd.xoff, &argc, &argv))
-                               badarg();
-                       break;
-               case 'u': /*set offset up the screen*/
-                       if(!numb(&yd.xoff,&argc,&argv))
-                               badarg();
-                       break;
-               default:
-                       badarg();
-               }
-       }
-}
-
-limread(p, argcp, argvp)
-register struct xy *p;
-int *argcp;
-char ***argvp;
-{
-       if(*argcp>1 && (*argvp)[1][0]=='l') {
-               (*argcp)--;
-               (*argvp)++;
-               p->xf = log10;
-       }
-       if(!numb(&p->xlb,argcp,argvp))
-               return;
-       p->xlbf = 1;
-       if(!numb(&p->xub,argcp,argvp))
-               return;
-       p->xubf = 1;
-       if(!numb(&p->xquant,argcp,argvp))
-               return;
-       p->xqf = 1;
-}
-
-numb(np, argcp, argvp)
-int *argcp;
-float *np;
-register char ***argvp;
-{
-       register char c;
-
-       if(*argcp <= 1)
-               return(0);
-       while((c=(*argvp)[1][0]) == '+')
-               (*argvp)[1]++;
-       if(!(isdigit(c) || c=='-'&&(*argvp)[1][1]<'A' || c=='.'))
-               return(0);
-       *np = atof((*argvp)[1]);
-       (*argcp)--;
-       (*argvp)++;
-       return(1);
-}
-
-readin()
-{
-       register t;
-       struct val *temp;
-
-       if(absf==1) {
-               if(xd.xlbf)
-                       absbot = xd.xlb;
-               else if(xd.xf==log10)
-                       absbot = 1;
-       }
-       for(;;) {
-               temp = (struct val *)realloc((char*)xx,
-                       (unsigned)(n+1)*sizeof(struct val));
-               if(temp==0)
-                       return;
-               xx = temp;
-               if(absf)
-                       xx[n].xv = n*dx + absbot;
-               else
-                       if(!getfloat(&xx[n].xv))
-                               return;
-               if(!getfloat(&xx[n].yv))
-                       return;
-               xx[n].lblptr = -1;
-               t = getstring();
-               if(t>0)
-                       xx[n].lblptr = copystring(t);
-               n++;
-               if(t<0)
-                       return;
-       }
-}
-
-transpose()
-{
-       register i;
-       float f;
-       struct xy t;
-       if(!transf)
-               return;
-       t = xd; xd = yd; yd = t;
-       for(i= 0;i<n;i++) {
-               f = xx[i].xv; xx[i].xv = xx[i].yv; xx[i].yv = f;
-       }
-}
-
-copystring(k)
-{
-       register char *temp;
-       register i;
-       int q;
-
-       temp = realloc(labs,(unsigned)(labsiz+1+k));
-       if(temp==0)
-               return(0);
-       labs = temp;
-       q = labsiz;
-       for(i=0;i<=k;i++)
-               labs[labsiz++] = labbuf[i];
-       return(q);
-}
-
-float
-modceil(f,t)
-float f,t;
-{
-
-       t = fabs(t);
-       return(ceil(f/t)*t);
-}
-
-float
-modfloor(f,t)
-float f,t;
-{
-       t = fabs(t);
-       return(floor(f/t)*t);
-}
-
-getlim(p,v)
-register struct xy *p;
-struct val *v;
-{
-       register i;
-
-       i = 0;
-       do {
-               if(!p->xlbf && p->xlb>v[i].xv)
-                       p->xlb = v[i].xv;
-               if(!p->xubf && p->xub<v[i].xv)
-                       p->xub = v[i].xv;
-               i++;
-       } while(i < n);
-}
-
-struct z {
-       float lb,ub,mult,quant;
-} setloglim(), setlinlim();
-
-setlim(p)
-register struct xy *p;
-{
-       float t,delta,sign;
-       struct z z;
-       int mark[50];
-       float lb,ub;
-       int lbf,ubf;
-
-       lb = p->xlb;
-       ub = p->xub;
-       delta = ub-lb;
-       if(p->xqf) {
-               if(delta*p->xquant <=0 )
-                       badarg();
-               return;
-       }
-       sign = 1;
-       lbf = p->xlbf;
-       ubf = p->xubf;
-       if(delta < 0) {
-               sign = -1;
-               t = lb;
-               lb = ub;
-               ub = t;
-               t = lbf;
-               lbf = ubf;
-               ubf = t;
-       }
-       else if(delta == 0) {
-               if(ub > 0) {
-                       ub = 2*ub;
-                       lb = 0;
-               } 
-               else
-                       if(lb < 0) {
-                               lb = 2*lb;
-                               ub = 0;
-                       } 
-                       else {
-                               ub = 1;
-                               lb = -1;
-                       }
-       }
-       if(p->xf==log10 && lb>0 && ub>lb) {
-               z = setloglim(lbf,ubf,lb,ub);
-               p->xlb = z.lb;
-               p->xub = z.ub;
-               p->xmult *= z.mult;
-               p->xquant = z.quant;
-               if(setmark(mark,p)<2) {
-                       p->xqf = lbf = ubf = 1;
-                       lb = z.lb; ub = z.ub;
-               } else
-                       return;
-       }
-       z = setlinlim(lbf,ubf,lb,ub);
-       if(sign > 0) {
-               p->xlb = z.lb;
-               p->xub = z.ub;
-       } else {
-               p->xlb = z.ub;
-               p->xub = z.lb;
-       }
-       p->xmult *= z.mult;
-       p->xquant = sign*z.quant;
-}
-
-struct z
-setloglim(lbf,ubf,lb,ub)
-float lb,ub;
-{
-       float r,s,t;
-       struct z z;
-
-       for(s=1; lb*s<1; s*=10) ;
-       lb *= s;
-       ub *= s;
-       for(r=1; 10*r<=lb; r*=10) ;
-       for(t=1; t<ub; t*=10) ;
-       z.lb = !lbf ? r : lb;
-       z.ub = !ubf ? t : ub;
-       if(ub/lb<100) {
-               if(!lbf) {
-                       if(lb >= 5*z.lb)
-                               z.lb *= 5;
-                       else if(lb >= 2*z.lb)
-                               z.lb *= 2;
-               }
-               if(!ubf) {
-                       if(ub*5 <= z.ub)
-                               z.ub /= 5;
-                       else if(ub*2 <= z.ub)
-                               z.ub /= 2;
-               }
-       }
-       z.mult = s;
-       z.quant = r;
-       return(z);
-}
-
-struct z
-setlinlim(lbf,ubf,xlb,xub)
-int lbf,ubf;
-float xlb,xub;
-{
-       struct z z;
-       float r,s,delta;
-       float ub,lb;
-
-loop:
-       ub = xub;
-       lb = xlb;
-       delta = ub - lb;
-       /*scale up by s, a power of 10, so range (delta) exceeds 1*/
-       /*find power of 10 quantum, r, such that delta/10<=r<delta*/
-       r = s = 1;
-       while(delta*s < 10)
-               s *= 10;
-       delta *= s;
-       while(10*r < delta)
-               r *= 10;
-       lb *= s;
-       ub *= s;
-       /*set r=(1,2,5)*10**n so that 3-5 quanta cover range*/
-       if(r>=delta/2)
-               r /= 2;
-       else if(r<delta/5)
-               r *= 2;
-       z.ub = ubf? ub: modceil(ub,r);
-       z.lb = lbf? lb: modfloor(lb,r);
-       if(!lbf && z.lb<=r && z.lb>0) {
-               xlb = 0;
-               goto loop;
-       }
-       else if(!ubf && z.ub>=-r && z.ub<0) {
-               xub = 0;
-               goto loop;
-       }
-       z.quant = r;
-       z.mult = s;
-       return(z);
-}
-
-scale(p,v)
-register struct xy *p;
-struct val *v;
-{
-       float edge;
-
-       getlim(p,v);
-       setlim(p);
-       edge = top-bot;
-       p->xa = p->xsize*edge/((*p->xf)(p->xub) - (*p->xf)(p->xlb));
-       p->xbot = bot + edge*p->xoff;
-       p->xtop = p->xbot + (top-bot)*p->xsize;
-       p->xb = p->xbot - (*p->xf)(p->xlb)*p->xa + .5;
-}
-
-axes()
-{
-       register i;
-       int mark[50];
-       int xn, yn;
-       if(gridf==0)
-               return;
-
-       line(xd.xbot,yd.xbot,xd.xtop,yd.xbot);
-       cont(xd.xtop,yd.xtop);
-       cont(xd.xbot,yd.xtop);
-       cont(xd.xbot,yd.xbot);
-
-       xn = setmark(mark,&xd);
-       for(i=0; i<xn; i++) {
-               if(gridf==2)
-                       line(mark[i],yd.xbot,mark[i],yd.xtop);
-               if(gridf==1) {
-                       line(mark[i],yd.xbot,mark[i],yd.xbot+tick);
-                       line(mark[i],yd.xtop-tick,mark[i],yd.xtop);
-               }
-       }
-       yn = setmark(mark,&yd);
-       for(i=0; i<yn; i++) {
-               if(gridf==2)
-                       line(xd.xbot,mark[i],xd.xtop,mark[i]);
-               if(gridf==1) {
-                       line(xd.xbot,mark[i],xd.xbot+tick,mark[i]);
-                       line(xd.xtop-tick,mark[i],xd.xtop,mark[i]);
-               }
-       }
-}
-
-setmark(xmark,p)
-int *xmark;
-register struct xy *p;
-{
-       int xn = 0;
-       float x,xl,xu;
-       float q;
-       if(p->xf==log10&&!p->xqf) {
-               for(x=p->xquant; x<p->xub; x*=10) {
-                       submark(xmark,&xn,x,p);
-                       if(p->xub/p->xlb<=100) {
-                               submark(xmark,&xn,2*x,p);
-                               submark(xmark,&xn,5*x,p);
-                       }
-               }
-       } else {
-               xn = 0;
-               q = p->xquant;
-               if(q>0) {
-                       xl = modceil(p->xlb+q/6,q);
-                       xu = modfloor(p->xub-q/6,q)+q/2;
-               } else {
-                       xl = modceil(p->xub-q/6,q);
-                       xu = modfloor(p->xlb+q/6,q)-q/2;
-               }
-               for(x=xl; x<=xu; x+=fabs(p->xquant))
-                       xmark[xn++] = (*p->xf)(x)*p->xa + p->xb;
-       }
-       return(xn);
-}
-submark(xmark,pxn,x,p)
-int *xmark;
-int *pxn;
-float x;
-struct xy *p;
-{
-       if(1.001*p->xlb < x && .999*p->xub > x)
-               xmark[(*pxn)++] = log10(x)*p->xa + p->xb;
-}
-
-plot()
-{
-       int ix,iy;
-       int i;
-       int conn;
-
-       conn = 0;
-       if(mode!=0)
-               linemod(modes[mode]);
-       for(i=0; i<n; i++) {
-               if(!conv(xx[i].xv,&xd,&ix) ||
-                  !conv(xx[i].yv,&yd,&iy)) {
-                       conn = 0;
-                       continue;
-               }
-               if(mode!=0) {
-                       if(conn != 0)
-                               cont(ix,iy);
-                       else
-                               move(ix,iy);
-                       conn = 1;
-               }
-               conn &= symbol(ix,iy,xx[i].lblptr);
-       }
-       linemod(modes[1]);
-}
-
-conv(xv,p,ip)
-float xv;
-register struct xy *p;
-int *ip;
-{
-       long ix;
-       ix = p->xa*(*p->xf)(xv*p->xmult) + p->xb;
-       if(ix<p->xbot || ix>p->xtop)
-               return(0);
-       *ip = ix;
-       return(1);
-}
-
-getfloat(p)
-float *p;
-{
-       register i;
-
-       i = scanf("%f",p);
-       return(i==1);
-}
-
-getstring()
-{
-       register i;
-       char junk[20];
-       i = scanf("%1s",labbuf);
-       if(i==-1)
-               return(-1);
-       switch(*labbuf) {
-       default:
-               if(!isdigit(*labbuf)) {
-                       ungetc(*labbuf,stdin);
-                       i = scanf("%s",labbuf);
-                       break;
-               }
-       case '.':
-       case '+':
-       case '-':
-               ungetc(*labbuf,stdin);
-               return(0);
-       case '"':
-               i = scanf("%[^\"\n]",labbuf);
-               scanf("%[\"]",junk);
-               break;
-       }
-       if(i==-1)
-               return(-1);
-       return(strlen(labbuf));
-}
-
-
-symbol(ix,iy,k)
-{
-
-       if(symbf==0&&k<0) {
-               if(mode==0)
-                       point(ix,iy);
-               return(1);
-       } 
-       else {
-               move(ix,iy);
-               label(k>=0?labs+k:plotsymb);
-               move(ix,iy);
-               return(!brkf|k<0);
-       }
-}
-
-title()
-{
-       move(xd.xbot,yd.xbot-60);
-       if (titlebuf[0]) {
-               label(titlebuf);
-               label("       ");
-       }
-       if(erasf&&gridf) {
-               axlab('x',&xd);
-               label("  ");
-               axlab('y',&yd);
-       }
-}
-
-axlab(c,p)
-char c;
-struct xy *p;
-{
-       char buf[50];
-       sprintf(buf,"%g -%s%c- %g", p->xlb/p->xmult,
-               p->xf==log10?"log ":"", c, p->xub/p->xmult);
-       label(buf);
-}
-
-badarg()
-{
-       fprintf(stderr,"graph: error in arguments\n");
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/grep.c b/.ref-Research-V7/usr/src/cmd/grep.c
deleted file mode 100644 (file)
index da87cb4..0000000
+++ /dev/null
@@ -1,478 +0,0 @@
-/*
- * grep -- print lines matching (or not matching) a pattern
- *
- *     status returns:
- *             0 - ok, and some matches
- *             1 - ok, but no matches
- *             2 - some error
- */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/param.h>
-
-#define        CBRA    1
-#define        CCHR    2
-#define        CDOT    4
-#define        CCL     6
-#define        NCCL    8
-#define        CDOL    10
-#define        CEOF    11
-#define        CKET    12
-#define        CBACK   18
-
-#define        STAR    01
-
-#define        LBSIZE  512
-#define        ESIZE   256
-#define        NBRA    9
-
-char   expbuf[ESIZE];
-long   lnum;
-char   linebuf[LBSIZE+1];
-char   ybuf[ESIZE];
-int    bflag;
-int    lflag;
-int    nflag;
-int    cflag;
-int    vflag;
-int    nfile;
-int    hflag   = 1;
-int    sflag;
-int    yflag;
-int    circf;
-long   tln;
-int    nsucc;
-char   *braslist[NBRA];
-char   *braelist[NBRA];
-char   bittab[] = {
-       1,
-       2,
-       4,
-       8,
-       16,
-       32,
-       64,
-       128
-};
-
-main(argc, argv)
-char **argv;
-{
-       while (--argc > 0 && (++argv)[0][0]=='-')
-               switch (argv[0][1]) {
-
-               case 'y':
-                       yflag++;
-                       continue;
-
-               case 'h':
-                       hflag = 0;
-                       continue;
-
-               case 's':
-                       sflag++;
-                       continue;
-
-               case 'v':
-                       vflag++;
-                       continue;
-
-               case 'b':
-                       bflag++;
-                       continue;
-
-               case 'l':
-                       lflag++;
-                       continue;
-
-               case 'c':
-                       cflag++;
-                       continue;
-
-               case 'n':
-                       nflag++;
-                       continue;
-
-               case 'e':
-                       --argc;
-                       ++argv;
-                       goto out;
-
-               default:
-                       errexit("grep: unknown flag\n", (char *)NULL);
-                       continue;
-               }
-out:
-       if (argc<=0)
-               exit(2);
-       if (yflag) {
-               register char *p, *s;
-               for (s = ybuf, p = *argv; *p; ) {
-                       if (*p == '\\') {
-                               *s++ = *p++;
-                               if (*p)
-                                       *s++ = *p++;
-                       } else if (*p == '[') {
-                               while (*p != '\0' && *p != ']')
-                                       *s++ = *p++;
-                       } else if (islower(*p)) {
-                               *s++ = '[';
-                               *s++ = toupper(*p);
-                               *s++ = *p++;
-                               *s++ = ']';
-                       } else
-                               *s++ = *p++;
-                       if (s >= ybuf+ESIZE-5)
-                               errexit("grep: argument too long\n", (char *)NULL);
-               }
-               *s = '\0';
-               *argv = ybuf;
-       }
-       compile(*argv);
-       nfile = --argc;
-       if (argc<=0) {
-               if (lflag)
-                       exit(1);
-               execute((char *)NULL);
-       } else while (--argc >= 0) {
-               argv++;
-               execute(*argv);
-       }
-       exit(nsucc == 0);
-}
-
-compile(astr)
-char *astr;
-{
-       register c;
-       register char *ep, *sp;
-       char *cstart;
-       char *lastep;
-       int cclcnt;
-       char bracket[NBRA], *bracketp;
-       int closed;
-       char numbra;
-       char neg;
-
-       ep = expbuf;
-       sp = astr;
-       lastep = 0;
-       bracketp = bracket;
-       closed = numbra = 0;
-       if (*sp == '^') {
-               circf++;
-               sp++;
-       }
-       for (;;) {
-               if (ep >= &expbuf[ESIZE])
-                       goto cerror;
-               if ((c = *sp++) != '*')
-                       lastep = ep;
-               switch (c) {
-
-               case '\0':
-                       *ep++ = CEOF;
-                       return;
-
-               case '.':
-                       *ep++ = CDOT;
-                       continue;
-
-               case '*':
-                       if (lastep==0 || *lastep==CBRA || *lastep==CKET)
-                               goto defchar;
-                       *lastep |= STAR;
-                       continue;
-
-               case '$':
-                       if (*sp != '\0')
-                               goto defchar;
-                       *ep++ = CDOL;
-                       continue;
-
-               case '[':
-                       if(&ep[17] >= &expbuf[ESIZE])
-                               goto cerror;
-                       *ep++ = CCL;
-                       neg = 0;
-                       if((c = *sp++) == '^') {
-                               neg = 1;
-                               c = *sp++;
-                       }
-                       cstart = sp;
-                       do {
-                               if (c=='\0')
-                                       goto cerror;
-                               if (c=='-' && sp>cstart && *sp!=']') {
-                                       for (c = sp[-2]; c<*sp; c++)
-                                               ep[c>>3] |= bittab[c&07];
-                                       sp++;
-                               }
-                               ep[c>>3] |= bittab[c&07];
-                       } while((c = *sp++) != ']');
-                       if(neg) {
-                               for(cclcnt = 0; cclcnt < 16; cclcnt++)
-                                       ep[cclcnt] ^= -1;
-                               ep[0] &= 0376;
-                       }
-
-                       ep += 16;
-
-                       continue;
-
-               case '\\':
-                       if((c = *sp++) == '(') {
-                               if(numbra >= NBRA) {
-                                       goto cerror;
-                               }
-                               *bracketp++ = numbra;
-                               *ep++ = CBRA;
-                               *ep++ = numbra++;
-                               continue;
-                       }
-                       if(c == ')') {
-                               if(bracketp <= bracket) {
-                                       goto cerror;
-                               }
-                               *ep++ = CKET;
-                               *ep++ = *--bracketp;
-                               closed++;
-                               continue;
-                       }
-
-                       if(c >= '1' && c <= '9') {
-                               if((c -= '1') >= closed)
-                                       goto cerror;
-                               *ep++ = CBACK;
-                               *ep++ = c;
-                               continue;
-                       }
-
-               defchar:
-               default:
-                       *ep++ = CCHR;
-                       *ep++ = c;
-               }
-       }
-    cerror:
-       errexit("grep: RE error\n", (char *)NULL);
-}
-
-execute(file)
-char *file;
-{
-       register char *p1, *p2;
-       register c;
-
-       if (file) {
-               if (freopen(file, "r", stdin) == NULL)
-                       errexit("grep: can't open %s\n", file);
-       }
-       lnum = 0;
-       tln = 0;
-       for (;;) {
-               lnum++;
-               p1 = linebuf;
-               while ((c = getchar()) != '\n') {
-                       if (c == EOF) {
-                               if (cflag) {
-                                       if (nfile>1)
-                                               printf("%s:", file);
-                                       printf("%D\n", tln);
-                               }
-                               return;
-                       }
-                       *p1++ = c;
-                       if (p1 >= &linebuf[LBSIZE-1])
-                               break;
-               }
-               *p1++ = '\0';
-               p1 = linebuf;
-               p2 = expbuf;
-               if (circf) {
-                       if (advance(p1, p2))
-                               goto found;
-                       goto nfound;
-               }
-               /* fast check for first character */
-               if (*p2==CCHR) {
-                       c = p2[1];
-                       do {
-                               if (*p1!=c)
-                                       continue;
-                               if (advance(p1, p2))
-                                       goto found;
-                       } while (*p1++);
-                       goto nfound;
-               }
-               /* regular algorithm */
-               do {
-                       if (advance(p1, p2))
-                               goto found;
-               } while (*p1++);
-       nfound:
-               if (vflag)
-                       succeed(file);
-               continue;
-       found:
-               if (vflag==0)
-                       succeed(file);
-       }
-}
-
-advance(lp, ep)
-register char *lp, *ep;
-{
-       register char *curlp;
-       char c;
-       char *bbeg;
-       int ct;
-
-       for (;;) switch (*ep++) {
-
-       case CCHR:
-               if (*ep++ == *lp++)
-                       continue;
-               return(0);
-
-       case CDOT:
-               if (*lp++)
-                       continue;
-               return(0);
-
-       case CDOL:
-               if (*lp==0)
-                       continue;
-               return(0);
-
-       case CEOF:
-               return(1);
-
-       case CCL:
-               c = *lp++ & 0177;
-               if(ep[c>>3] & bittab[c & 07]) {
-                       ep += 16;
-                       continue;
-               }
-               return(0);
-       case CBRA:
-               braslist[*ep++] = lp;
-               continue;
-
-       case CKET:
-               braelist[*ep++] = lp;
-               continue;
-
-       case CBACK:
-               bbeg = braslist[*ep];
-               if (braelist[*ep]==0)
-                       return(0);
-               ct = braelist[*ep++] - bbeg;
-               if(ecmp(bbeg, lp, ct)) {
-                       lp += ct;
-                       continue;
-               }
-               return(0);
-
-       case CBACK|STAR:
-               bbeg = braslist[*ep];
-               if (braelist[*ep]==0)
-                       return(0);
-               ct = braelist[*ep++] - bbeg;
-               curlp = lp;
-               while(ecmp(bbeg, lp, ct))
-                       lp += ct;
-               while(lp >= curlp) {
-                       if(advance(lp, ep))     return(1);
-                       lp -= ct;
-               }
-               return(0);
-
-
-       case CDOT|STAR:
-               curlp = lp;
-               while (*lp++);
-               goto star;
-
-       case CCHR|STAR:
-               curlp = lp;
-               while (*lp++ == *ep);
-               ep++;
-               goto star;
-
-       case CCL|STAR:
-               curlp = lp;
-               do {
-                       c = *lp++ & 0177;
-               } while(ep[c>>3] & bittab[c & 07]);
-               ep += 16;
-               goto star;
-
-       star:
-               if(--lp == curlp) {
-                       continue;
-               }
-
-               if(*ep == CCHR) {
-                       c = ep[1];
-                       do {
-                               if(*lp != c)
-                                       continue;
-                               if(advance(lp, ep))
-                                       return(1);
-                       } while(lp-- > curlp);
-                       return(0);
-               }
-
-               do {
-                       if (advance(lp, ep))
-                               return(1);
-               } while (lp-- > curlp);
-               return(0);
-
-       default:
-               errexit("grep RE botch\n", (char *)NULL);
-       }
-}
-
-succeed(f)
-char *f;
-{
-       long ftell();
-       nsucc = 1;
-       if (sflag)
-               return;
-       if (cflag) {
-               tln++;
-               return;
-       }
-       if (lflag) {
-               printf("%s\n", f);
-               fseek(stdin, 0l, 2);
-               return;
-       }
-       if (nfile > 1 && hflag)
-               printf("%s:", f);
-       if (bflag)
-               printf("%ld:", (ftell(stdin)-1)/BSIZE);
-       if (nflag)
-               printf("%ld:", lnum);
-       printf("%s\n", linebuf);
-}
-
-ecmp(a, b, count)
-char   *a, *b;
-{
-       register cc = count;
-       while(cc--)
-               if(*a++ != *b++)        return(0);
-       return(1);
-}
-
-errexit(s, f)
-char *s, *f;
-{
-       fprintf(stderr, s, f);
-       exit(2);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/icheck.c b/.ref-Research-V7/usr/src/cmd/icheck.c
deleted file mode 100644 (file)
index b488390..0000000
+++ /dev/null
@@ -1,475 +0,0 @@
-#define        NI      16
-#define        NB      10
-#define        BITS    8
-#define        MAXFN   500
-
-#ifndef STANDALONE
-#include <stdio.h>
-#endif
-#include <sys/param.h>
-#include <sys/inode.h>
-#include <sys/ino.h>
-#include <sys/fblk.h>
-#include <sys/filsys.h>
-
-struct filsys  sblock;
-struct dinode  itab[INOPB*NI];
-daddr_t        iaddr[NADDR];
-daddr_t        blist[NB];
-char   *bmap;
-
-int    sflg;
-int    mflg;
-int    dflg;
-int    fi;
-ino_t  ino;
-
-ino_t  nrfile;
-ino_t  ndfile;
-ino_t  nbfile;
-ino_t  ncfile;
-
-daddr_t        ndirect;
-daddr_t        nindir;
-daddr_t        niindir;
-daddr_t        niiindir;
-daddr_t        nfree;
-daddr_t        ndup;
-
-int    nerror;
-
-long   atol();
-daddr_t        alloc();
-#ifndef STANDALONE
-char   *malloc();
-#endif
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-       long n;
-
-       blist[0] = -1;
-#ifndef STANDALONE
-       while (--argc) {
-               argv++;
-               if (**argv=='-')
-               switch ((*argv)[1]) {
-               case 'd':
-                       dflg++;
-                       continue;
-
-
-               case 'm':
-                       mflg++;
-                       continue;
-
-               case 's':
-                       sflg++;
-                       continue;
-
-               case 'b':
-                       for(i=0; i<NB; i++) {
-                               n = atol(argv[1]);
-                               if(n == 0)
-                                       break;
-                               blist[i] = n;
-                               argv++;
-                               argc--;
-                       }
-                       blist[i] = -1;
-                       continue;
-
-               default:
-                       printf("Bad flag\n");
-               }
-               check(*argv);
-       }
-#else
-       {
-               static char fname[0];
-
-               printf("File: ");
-               gets(fname);
-               check(fname);
-       }
-#endif
-       return(nerror);
-}
-
-check(file)
-char *file;
-{
-       register i, j;
-       ino_t mino;
-       daddr_t d;
-       long n;
-
-       fi = open(file, sflg?2:0);
-       if (fi < 0) {
-               printf("cannot open %s\n", file);
-               nerror |= 04;
-               return;
-       }
-       printf("%s:\n", file);
-       nrfile = 0;
-       ndfile = 0;
-       ncfile = 0;
-       nbfile = 0;
-
-       ndirect = 0;
-       nindir = 0;
-       niindir = 0;
-       niiindir = 0;
-
-       ndup = 0;
-#ifndef STANDALONE
-       sync();
-#endif
-       bread((daddr_t)1, (char *)&sblock, sizeof(sblock));
-       mino = (sblock.s_isize-2) * INOPB;
-       ino = 0;
-       n = (sblock.s_fsize - sblock.s_isize + BITS-1) / BITS;
-       if (n != (unsigned)n) {
-               printf("Check fsize and isize: %ld, %u\n",
-                  sblock.s_fsize, sblock.s_isize);
-       }
-#ifdef STANDALONE
-       bmap = NULL;
-#else
-       bmap = malloc((unsigned)n);
-#endif
-       if (bmap==NULL) {
-               printf("Not enough core; duplicates unchecked\n");
-               dflg++;
-               sflg = 0;
-       }
-       if(!dflg)
-       for(i=0; i<(unsigned)n; i++)
-               bmap[i] = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= mino)
-                       break;
-               bread((daddr_t)i, (char *)itab, sizeof(itab));
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= mino)
-                               break;
-                       ino++;
-                       pass1(&itab[j]);
-               }
-       }
-       ino = 0;
-#ifndef STANDALONE
-       sync();
-#endif
-       bread((daddr_t)1, (char *)&sblock, sizeof(sblock));
-       if (sflg) {
-               makefree();
-               close(fi);
-#ifndef STANDALONE
-               if (bmap)
-                       free(bmap);
-#endif
-               return;
-       }
-       nfree = 0;
-       while(n = alloc()) {
-               if (chk(n, "free"))
-                       break;
-               nfree++;
-       }
-       close(fi);
-#ifndef STANDALONE
-       if (bmap)
-               free(bmap);
-#endif
-
-       i = nrfile + ndfile + ncfile + nbfile;
-#ifndef STANDALONE
-       printf("files %6u (r=%u,d=%u,b=%u,c=%u)\n",
-               i, nrfile, ndfile, nbfile, ncfile);
-#else
-       printf("files %u (r=%u,d=%u,b=%u,c=%u)\n",
-               i, nrfile, ndfile, nbfile, ncfile);
-#endif
-       n = ndirect + nindir + niindir + niindir;
-#ifdef STANDALONE
-       printf("used %ld (i=%ld,ii=%ld,iii=%ld,d=%ld)\n",
-               n, nindir, niindir, niiindir, ndirect);
-       printf("free %ld\n", nfree);
-#else
-       printf("used %7ld (i=%ld,ii=%ld,iii=%ld,d=%ld)\n",
-               n, nindir, niindir, niiindir, ndirect);
-       printf("free %7ld\n", nfree);
-#endif
-       if(!dflg) {
-               n = 0;
-               for(d=sblock.s_isize; d<sblock.s_fsize; d++)
-                       if(!duped(d)) {
-                               if(mflg)
-                                       printf("%ld missing\n", d);
-                               n++;
-                       }
-               printf("missing%5ld\n", n);
-       }
-}
-
-pass1(ip)
-register struct dinode *ip;
-{
-       daddr_t ind1[NINDIR];
-       daddr_t ind2[NINDIR];
-       daddr_t ind3[NINDIR];
-       register i, j;
-       int k, l;
-
-       i = ip->di_mode & IFMT;
-       if(i == 0) {
-               sblock.s_tinode++;
-               return;
-       }
-       if(i == IFCHR) {
-               ncfile++;
-               return;
-       }
-       if(i == IFBLK) {
-               nbfile++;
-               return;
-       }
-       if(i == IFDIR)
-               ndfile++; else
-       if(i == IFREG)
-               nrfile++;
-       else {
-               printf("bad mode %u\n", ino);
-               return;
-       }
-       l3tol(iaddr, ip->di_addr, NADDR);
-       for(i=0; i<NADDR; i++) {
-               if(iaddr[i] == 0)
-                       continue;
-               if(i < NADDR-3) {
-                       ndirect++;
-                       chk(iaddr[i], "data (small)");
-                       continue;
-               }
-               nindir++;
-               if (chk(iaddr[i], "1st indirect"))
-                               continue;
-               bread(iaddr[i], (char *)ind1, BSIZE);
-               for(j=0; j<NINDIR; j++) {
-                       if(ind1[j] == 0)
-                               continue;
-                       if(i == NADDR-3) {
-                               ndirect++;
-                               chk(ind1[j], "data (large)");
-                               continue;
-                       }
-                       niindir++;
-                       if(chk(ind1[j], "2nd indirect"))
-                               continue;
-                       bread(ind1[j], (char *)ind2, BSIZE);
-                       for(k=0; k<NINDIR; k++) {
-                               if(ind2[k] == 0)
-                                       continue;
-                               if(i == NADDR-2) {
-                                       ndirect++;
-                                       chk(ind2[k], "data (huge)");
-                                       continue;
-                               }
-                               niiindir++;
-                               if(chk(ind2[k], "3rd indirect"))
-                                       continue;
-                               bread(ind2[k], (char *)ind3, BSIZE);
-                               for(l=0; l<NINDIR; l++)
-                                       if(ind3[l]) {
-                                               ndirect++;
-                                               chk(ind3[l], "data (garg)");
-                                       }
-                       }
-               }
-       }
-}
-
-chk(bno, s)
-daddr_t bno;
-char *s;
-{
-       register n;
-
-       if (bno<sblock.s_isize || bno>=sblock.s_fsize) {
-               printf("%ld bad; inode=%u, class=%s\n", bno, ino, s);
-               return(1);
-       }
-       if(duped(bno)) {
-               printf("%ld dup; inode=%u, class=%s\n", bno, ino, s);
-               ndup++;
-       }
-       for (n=0; blist[n] != -1; n++)
-               if (bno == blist[n])
-                       printf("%ld arg; inode=%u, class=%s\n", bno, ino, s);
-       return(0);
-}
-
-duped(bno)
-daddr_t bno;
-{
-       daddr_t d;
-       register m, n;
-
-       if(dflg)
-               return(0);
-       d = bno - sblock.s_isize;
-       m = 1 << (d%BITS);
-       n = (d/BITS);
-       if(bmap[n] & m)
-               return(1);
-       bmap[n] |= m;
-       return(0);
-}
-
-daddr_t
-alloc()
-{
-       int i;
-       daddr_t bno;
-       union {
-               char    data[BSIZE];
-               struct  fblk fb;
-       } buf;
-
-       sblock.s_tfree--;
-       if (sblock.s_nfree<=0)
-               return(0);
-       if (sblock.s_nfree>NICFREE) {
-               printf("Bad free list, s.b. count = %d\n", sblock.s_nfree);
-               return(0);
-       }
-       bno = sblock.s_free[--sblock.s_nfree];
-       sblock.s_free[sblock.s_nfree] = (daddr_t)0;
-       if(bno == 0)
-               return(bno);
-       if(sblock.s_nfree <= 0) {
-               bread(bno, buf.data, BSIZE);
-               sblock.s_nfree = buf.df_nfree;
-               if (sblock.s_nfree<0 || sblock.s_nfree>NICFREE) {
-                       printf("Bad free list, entry count of block %ld = %d\n",
-                               bno, sblock.s_nfree);
-                       sblock.s_nfree = 0;
-                       return(0);
-               }
-               for(i=0; i<NICFREE; i++)
-                       sblock.s_free[i] = buf.df_free[i];
-       }
-       return(bno);
-}
-
-bfree(bno)
-daddr_t bno;
-{
-       union {
-               char    data[BSIZE];
-               struct  fblk fb;
-       } buf;
-       int i;
-
-       sblock.s_tfree++;
-       if(sblock.s_nfree >= NICFREE) {
-               for(i=0; i<BSIZE; i++)
-                       buf.data[i] = 0;
-               buf.df_nfree = sblock.s_nfree;
-               for(i=0; i<NICFREE; i++)
-                       buf.df_free[i] = sblock.s_free[i];
-               bwrite(bno, buf.data);
-               sblock.s_nfree = 0;
-       }
-       sblock.s_free[sblock.s_nfree] = bno;
-       sblock.s_nfree++;
-}
-
-bread(bno, buf, cnt)
-daddr_t bno;
-char *buf;
-{
-       register i;
-
-       lseek(fi, bno*BSIZE, 0);
-       if (read(fi, buf, cnt) != cnt) {
-               printf("read error %ld\n", bno);
-               if (sflg) {
-                       printf("No update\n");
-                       sflg = 0;
-               }
-               for(i=0; i<BSIZE; i++)
-                       buf[i] = 0;
-       }
-}
-
-bwrite(bno, buf)
-daddr_t bno;
-char   *buf;
-{
-
-       lseek(fi, bno*BSIZE, 0);
-       if (write(fi, buf, BSIZE) != BSIZE)
-               printf("write error %ld\n", bno);
-}
-
-makefree()
-{
-       char flg[MAXFN];
-       int adr[MAXFN];
-       register i, j;
-       daddr_t f, d;
-       int m, n;
-
-       n = sblock.s_n;
-       if(n <= 0 || n > MAXFN)
-               n = MAXFN;
-       sblock.s_n = n;
-       m = sblock.s_m;
-       if(m <= 0 || m > sblock.s_n)
-               m = 3;
-       sblock.s_m = m;
-
-       for(i=0; i<n; i++)
-               flg[i] = 0;
-       i = 0;
-       for(j=0; j<n; j++) {
-               while(flg[i])
-                       i = (i+1)%n;
-               adr[j] = i+1;
-               flg[i]++;
-               i = (i+m)%n;
-       }
-
-       sblock.s_nfree = 0;
-       sblock.s_ninode = 0;
-       sblock.s_flock = 0;
-       sblock.s_ilock = 0;
-       sblock.s_fmod = 0;
-       sblock.s_ronly = 0;
-#ifndef STANDALONE
-       time(&sblock.s_time);
-#endif
-       sblock.s_tfree = 0;
-       sblock.s_tinode = 0;
-
-       bfree((daddr_t)0);
-       d = sblock.s_fsize-1;
-       while(d%sblock.s_n)
-               d++;
-       for(; d > 0; d -= sblock.s_n)
-       for(i=0; i<sblock.s_n; i++) {
-               f = d - adr[i];
-               if(f < sblock.s_fsize && f >= sblock.s_isize)
-                       if(!duped(f))
-                               bfree(f);
-       }
-       bwrite((daddr_t)1, (char *)&sblock);
-#ifndef STANDALONE
-       sync();
-#endif
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/in b/.ref-Research-V7/usr/src/cmd/in
deleted file mode 100644 (file)
index 5bb6521..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-cmake -cp \
-ac \
-calendar \
-cmp \
-comm \
-crypt \
-dcheck \
-dd \
-diff \
-diffh \
-du \
-dump \
-dumpdir \
-ed \
-fgrep \
-grep \
-icheck \
-init \
-iostat \
-ls \
-mail \
-mkfs \
-nm \
-od \
-prof \
-ps \
-quot \
-restor \
-size \
-strip \
-sum \
-tail \
-tee \
-tsort \
-units
diff --git a/.ref-Research-V7/usr/src/cmd/init.c b/.ref-Research-V7/usr/src/cmd/init.c
deleted file mode 100644 (file)
index 1a2534d..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-#include <signal.h>
-#include <sys/types.h>
-#include <utmp.h>
-#include <setjmp.h>
-
-#define        TABSIZ  100
-#define        ALL     p = &itab[0]; p < &itab[TABSIZ]; p++
-#define        EVER    ;;
-
-char   shell[] = "/bin/sh";
-char   getty[]  = "/etc/getty";
-char   minus[] = "-";
-char   runc[]  = "/etc/rc";
-char   ifile[] = "/etc/ttys";
-char   utmp[]  = "/etc/utmp";
-char   wtmpf[] = "/usr/adm/wtmp";
-char   ctty[]  = "/dev/console";
-char   dev[]   = "/dev/";
-
-struct utmp wtmp;
-struct
-{
-       char    line[8];
-       char    comn;
-       char    flag;
-} line;
-struct tab
-{
-       char    line[8];
-       char    comn;
-       int     pid;
-} itab[TABSIZ];
-
-int    fi;
-char   tty[20];
-jmp_buf        sjbuf;
-
-main()
-{
-       int reset();
-
-       setjmp(sjbuf);
-       signal(SIGHUP, reset);
-       for(EVER) {
-               shutdown();
-               single();
-               runcom();
-               merge();
-               multiple();
-       }
-}
-
-shutdown()
-{
-       register i;
-       register struct tab *p;
-
-       signal(SIGINT, SIG_IGN);
-       for(ALL)
-               term(p);
-       signal(SIGALRM, reset);
-       alarm(60);
-       for(i=0; i<5; i++)
-               kill(-1, SIGKILL);
-       while(wait((int *)0) != -1)
-               ;
-       alarm(0);
-       signal(SIGALRM, SIG_DFL);
-       for(i=0; i<10; i++)
-               close(i);
-}
-
-single()
-{
-       register pid;
-
-       pid = fork();
-       if(pid == 0) {
-/*
-               alarm(300);
-*/
-               signal(SIGHUP, SIG_DFL);
-               signal(SIGINT, SIG_DFL);
-               signal(SIGALRM, SIG_DFL);
-               open(ctty, 2);
-               dup(0);
-               dup(0);
-               execl(shell, minus, (char *)0);
-               exit(0);
-       }
-       while(wait((int *)0) != pid)
-               ;
-}
-
-runcom()
-{
-       register pid;
-
-       pid = fork();
-       if(pid == 0) {
-               open("/", 0);
-               dup(0);
-               dup(0);
-               execl(shell, shell, runc, (char *)0);
-               exit(0);
-       }
-       while(wait((int *)0) != pid)
-               ;
-}
-
-multiple()
-{
-       register struct tab *p;
-       register pid;
-
-       for(EVER) {
-               pid = wait((int *)0);
-               if(pid == -1)
-                       return;
-               for(ALL)
-                       if(p->pid == pid || p->pid == -1) {
-                               rmut(p);
-                               dfork(p);
-                       }
-       }
-}
-
-term(p)
-register struct tab *p;
-{
-
-       if(p->pid != 0) {
-               rmut(p);
-               kill(p->pid, SIGKILL);
-       }
-       p->pid = 0;
-       p->line[0] = 0;
-}
-
-rline()
-{
-       register c, i;
-
-       c = get();
-       if(c < 0)
-               return(0);
-       if(c == 0)
-               goto bad;
-       line.flag = c;
-       c = get();
-       if(c <= 0)
-               goto bad;
-       line.comn = c;
-       for(i=0; i<8; i++)
-               line.line[i] = 0;
-       for(i=0; i<7; i++) {
-               c = get();
-               if(c <= 0)
-                       break;
-               line.line[i] = c;
-       }
-       while(c > 0)
-               c = get();
-       maktty(line.line);
-       if(access(tty, 06) < 0)
-               goto bad;
-       return(1);
-
-bad:
-       line.flag = '0';
-       return(1);
-}
-
-maktty(lin)
-char *lin;
-{
-       register i, j;
-
-       for(i=0; dev[i]; i++)
-               tty[i] = dev[i];
-       for(j=0; lin[j]; j++) {
-               tty[i] = lin[j];
-               i++;
-       }
-       tty[i] = 0;
-}
-
-get()
-{
-       char b;
-
-       if(read(fi, &b, 1) != 1)
-               return(-1);
-       if(b == '\n')
-               return(0);
-       return(b);
-}
-
-merge()
-{
-       register struct tab *p, *q;
-       register i;
-
-       close(creat(utmp, 0644));
-       signal(SIGINT, merge);
-       fi = open(ifile, 0);
-       if(fi < 0)
-               return;
-       q = &itab[0];
-       while(rline()) {
-               if(line.flag == '0')
-                       continue;
-               for(ALL) {
-                       if(p->line[0] != 0)
-                       for(i=0; i<8; i++)
-                               if(p->line[i] != line.line[i])
-                                       goto contin;
-                       if(p >= q) {
-                               i = p->pid;
-                               p->pid = q->pid;
-                               q->pid = i;
-                               for(i=0; i<8; i++)
-                                       p->line[i] = q->line[i];
-                               p->comn = q->comn;
-                               for(i=0; i<8; i++)
-                                       q->line[i] = line.line[i];
-                               q->comn = line.comn;
-                               q++;
-                       }
-                       break;
-               contin:
-                       ;
-               }
-       }
-       close(fi);
-       for(; q < &itab[TABSIZ]; q++)
-               term(q);
-       for(ALL)
-               if(p->line[0] != 0 && p->pid == 0)
-                       dfork(p);
-}
-
-dfork(p)
-struct tab *p;
-{
-       register pid;
-
-       pid = fork();
-       if(pid == 0) {
-               signal(SIGHUP, SIG_DFL);
-               signal(SIGINT, SIG_DFL);
-               maktty(p->line);
-               chown(tty, 0, 0);
-               chmod(tty, 0622);
-               open(tty, 2);
-               dup(0);
-               dup(0);
-               tty[0] = p->comn;
-               tty[1] = 0;
-               execl(getty, minus, tty, (char *)0);
-               exit(0);
-       }
-       p->pid = pid;
-}
-
-rmut(p)
-register struct tab *p;
-{
-       register i, f;
-
-       f = open(utmp, 2);
-       if(f >= 0) {
-               while(read(f, (char *)&wtmp, sizeof(wtmp)) == sizeof(wtmp)) {
-                       for(i=0; i<8; i++)
-                               if(wtmp.ut_line[i] != p->line[i])
-                                       goto contin;
-                       lseek(f, -(long)sizeof(wtmp), 1);
-                       for(i=0; i<8; i++)
-                               wtmp.ut_name[i] = 0;
-                       time(&wtmp.ut_time);
-                       write(f, (char *)&wtmp, sizeof(wtmp));
-               contin:;
-               }
-               close(f);
-       }
-       f = open(wtmpf, 1);
-       if (f >= 0) {
-               for(i=0; i<8; i++) {
-                       wtmp.ut_name[i] = 0;
-                       wtmp.ut_line[i] = p->line[i];
-               }
-               time(&wtmp.ut_time);
-               lseek(f, (long)0, 2);
-               write(f, (char *)&wtmp, sizeof(wtmp));
-               close(f);
-       }
-}
-
-reset()
-{
-       longjmp(sjbuf, 1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/iostat.c b/.ref-Research-V7/usr/src/cmd/iostat.c
deleted file mode 100644 (file)
index 8e03f88..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-int    bflg;
-int    dflg;
-int    tflg;
-int    iflg;
-int    aflg;
-int    sflg;
-struct
-{
-       char    name[8];
-       int     type;
-       unsigned        value;
-} nl[] = {
-       "_dk_busy", 0, 0,
-       "_io_info", 0, 0,
-       "\0\0\0\0\0\0\0\0", 0, 0
-};
-struct
-{
-       int     busy;
-       long    etime[32];
-       long    numb[3];
-       long    wds[3];
-       long    tin;
-       long    tout;
-} s, s1;
-
-struct iostat {
-       int     nbuf;
-       long    nread;
-       long    nreada;
-       long    ncache;
-       long    nwrite;
-       long    bufcount[50];
-} io_info, io_delta;
-double etime;
-
-int    mf;
-
-main(argc, argv)
-char *argv[];
-{
-       extern char *ctime();
-       register  i;
-       int iter;
-       double f1, f2;
-       long t;
-
-       nlist("/unix", nl);
-       if(nl[0].type == -1) {
-               printf("dk_busy not found in /unix namelist\n");
-               exit(1);
-       }
-       mf = open("/dev/kmem", 0);
-       if(mf < 0) {
-               printf("cannot open /dev/kmem\n");
-               exit(1);
-       }
-       iter = 0;
-       while (argc>1&&argv[1][0]=='-') {
-               if (argv[1][1]=='d')
-                       dflg++;
-               else if (argv[1][1]=='s')
-                       sflg++;
-               else if (argv[1][1]=='a')
-                       aflg++;
-               else if (argv[1][1]=='t')
-                       tflg++;
-               else if (argv[1][1]=='i')
-                       iflg++;
-               else if (argv[1][1]=='b')
-                       bflg++;
-               argc--;
-               argv++;
-       }
-       if(argc > 2)
-               iter = atoi(argv[2]);
-       if (!(sflg|iflg)) {
-       if(tflg)
-               printf("         TTY");
-       if (bflg==0)
-       printf("   RF                RK                RP                  PERCENT\n");
-       if(tflg)
-               printf("   tin  tout");
-       if (bflg==0)
-       printf("   tpm  msps  mspt   tpm  msps  mspt   tpm  msps  mspt  user  nice systm  idle\n");
-       }
-
-loop:
-       lseek(mf, (long)nl[0].value, 0);
-       read(mf, (char *)&s, sizeof s);
-       for(i=0; i<40; i++) {
-               t = s.etime[i];
-               s.etime[i] -= s1.etime[i];
-               s1.etime[i] = t;
-       }
-       t = 0;
-       for(i=0; i<32; i++)
-               t += s.etime[i];
-       etime = t;
-       if(etime == 0.)
-               etime = 1.;
-       if (bflg) {
-               biostats();
-               goto contin;
-       }
-       if (dflg) {
-               long tm;
-               time(&tm);
-               printf("%s", ctime(&tm));
-       }
-       if (aflg)
-               printf("%.2f minutes total\n", etime/3600);
-       if (sflg) {
-               stats2(etime);
-               goto contin;
-       }
-       if (iflg) {
-               stats3(etime);
-               goto contin;
-       }
-       etime /= 60.;
-       if(tflg) {
-               f1 = s.tin;
-               f2 = s.tout;
-               printf("%6.1f", f1/etime);
-               printf("%6.1f", f2/etime);
-       }
-       for(i=0; i<3; i++)
-               stats(i);
-       for(i=0; i<4; i++)
-               stat1(i*8);
-       printf("\n");
-contin:
-       --iter;
-       if(iter)
-       if(argc > 1) {
-               sleep(atoi(argv[1]));
-               goto loop;
-       }
-}
-
-/* usec per word for the various disks */
-double xf[] = {
-       16.0,   /* RF */
-       11.1,   /* RK03/05 */
-       2.48,   /* RP06 */
-};
-
-stats(dn)
-{
-       register i;
-       double f1, f2, f3;
-       double f4, f5, f6;
-       long t;
-
-       t = 0;
-       for(i=0; i<32; i++)
-               if(i & (1<<dn))
-                       t += s.etime[i];
-       f1 = t;
-       f1 = f1/60.;
-       f2 = s.numb[dn];
-       if(f2 == 0.) {
-               printf("%6.0f%6.1f%6.1f", 0.0, 0.0, 0.0);
-               return;
-       }
-       f3 = s.wds[dn];
-       f3 = f3*32.;
-       f4 = xf[dn];
-       f4 = f4*1.0e-6;
-       f5 = f1 - f4*f3;
-       f6 = f1 - f5;
-       printf("%6.0f", f2*60./etime);
-       printf("%6.1f", f5*1000./f2);
-       printf("%6.1f", f6*1000./f2);
-}
-
-stat1(o)
-{
-       register i;
-       long t;
-       double f1, f2;
-
-       t = 0;
-       for(i=0; i<32; i++)
-               t += s.etime[i];
-       f1 = t;
-       if(f1 == 0.)
-               f1 = 1.;
-       t = 0;
-       for(i=0; i<8; i++)
-               t += s.etime[o+i];
-       f2 = t;
-       printf("%6.2f", f2*100./f1);
-}
-
-stats2(t)
-double t;
-{
-       register i, j;
-
-       for (i=0; i<4; i++) {
-               for (j=0; j<8; j++)
-                       printf("%6.2f\n", s.etime[8*i+j]/(t/100));
-               printf("\n");
-       }
-}
-
-stats3(t)
-double t;
-{
-       register i;
-       double sum;
-
-       t /= 100;
-       printf("%6.2f idle\n", s.etime[24]/t);
-       sum = 0;
-       for (i=0; i<8; i++)
-               sum += s.etime[i];
-       printf("%6.2f user\n", sum/t);
-       sum = 0;
-       for (i=0; i<8; i++)
-               sum += s.etime[8+i];
-       printf("%6.2f nice\n", sum/t);
-       sum = 0;
-       for (i=0; i<8; i++)
-               sum += s.etime[16+i];
-       printf("%6.2f system\n", sum/t);
-       sum = 0;
-       for (i=1; i<8; i++)
-               sum += s.etime[24+i];
-       printf("%6.2f IO wait\n", sum/t);
-       sum = 0;
-       for (i=1; i<8; i++)
-               sum += s.etime[i]+s.etime[i+8]+s.etime[i+16]+s.etime[i+24];
-       printf("%6.2f IO active\n", sum/t);
-       sum = 0;
-       for (i=0; i<32; i++)
-               if (i&01)
-                       sum += s.etime[i];
-       printf("%6.2f RF active\n", sum/t);
-       sum = 0;
-       for (i=0; i<32; i++)
-               if (i&02)
-                       sum += s.etime[i];
-       printf("%6.2f RK active\n", sum/t);
-       sum = 0;
-       for (i=0; i<32; i++)
-               if (i&04)
-                       sum += s.etime[i];
-       printf("%6.2f RP active\n", sum/t);
-}
-
-biostats()
-{
-register i;
-
-       lseek(mf,(long)nl[1].value, 0);
-       read(mf, (char *)&io_info, sizeof(io_info));
-       printf("%D\t%D\t%D\t%D\n",
-        io_info.nread-io_delta.nread, io_info.nreada-io_delta.nreada,
-        io_info.ncache-io_delta.ncache, io_info.nwrite-io_delta.nwrite);
-
-       for(i=0; i<30; ) {
-               printf("%D\t",(long)io_info.bufcount[i]-io_delta.bufcount[i]);
-               i++;
-               if (i % 10 == 0)
-                       printf("\n");
-       }
-       io_delta = io_info;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/join.c b/.ref-Research-V7/usr/src/cmd/join.c
deleted file mode 100644 (file)
index cc460e9..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*     join F1 F2 on stuff */
-
-#include       <stdio.h>
-#define F1 0
-#define F2 1
-#define        NFLD    20      /* max field per line */
-#define comp() cmp(ppi[F1][j1],ppi[F2][j2])
-
-FILE *f[2];
-char buf[2][BUFSIZ];   /*input lines */
-char *ppi[2][NFLD];    /* pointers to fields in lines */
-char *s1,*s2;
-int    j1      = 1;    /* join of this field of file 1 */
-int    j2      = 1;    /* join of this field of file 2 */
-int    olist[2*NFLD];  /* output these fields */
-int    olistf[2*NFLD]; /* from these files */
-int    no;     /* number of entries in olist */
-int    sep1    = ' ';  /* default field separator */
-int    sep2    = '\t';
-char*  null    = "";
-int    unpub1;
-int    unpub2;
-int    aflg;
-
-main(argc, argv)
-char *argv[];
-{
-       int i;
-       int n1, n2;
-       long top2, bot2;
-       long ftell();
-
-       while (argc > 1 && argv[1][0] == '-') {
-               if (argv[1][1] == '\0')
-                       break;
-               switch (argv[1][1]) {
-               case 'a':
-                       switch(argv[1][2]) {
-                       case '1':
-                               aflg |= 1;
-                               break;
-                       case '2':
-                               aflg |= 2;
-                               break;
-                       default:
-                               aflg |= 3;
-                       }
-                       break;
-               case 'e':
-                       null = argv[2];
-                       argv++;
-                       argc--;
-                       break;
-               case 't':
-                       sep1 = sep2 = argv[1][2];
-                       break;
-               case 'o':
-                       for (no = 0; no < 2*NFLD; no++) {
-                               if (argv[2][0] == '1' && argv[2][1] == '.') {
-                                       olistf[no] = F1;
-                                       olist[no] = atoi(&argv[2][2]);
-                               } else if (argv[2][0] == '2' && argv[2][1] == '.') {
-                                       olist[no] = atoi(&argv[2][2]);
-                                       olistf[no] = F2;
-                               } else
-                                       break;
-                               argc--;
-                               argv++;
-                       }
-                       break;
-               case 'j':
-                       if (argv[1][2] == '1')
-                               j1 = atoi(argv[2]);
-                       else if (argv[1][2] == '2')
-                               j2 = atoi(argv[2]);
-                       else
-                               j1 = j2 = atoi(argv[2]);
-                       argc--;
-                       argv++;
-                       break;
-               }
-               argc--;
-               argv++;
-       }
-       for (i = 0; i < no; i++)
-               olist[i]--;     /* 0 origin */
-       if (argc != 3)
-               error("usage: join [-j1 x -j2 y] [-o list] file1 file2");
-       j1--;
-       j2--;   /* everyone else believes in 0 origin */
-       s1 = ppi[F1][j1];
-       s2 = ppi[F2][j2];
-       if (argv[1][0] == '-')
-               f[F1] = stdin;
-       else if ((f[F1] = fopen(argv[1], "r")) == NULL)
-               error("can't open %s", argv[1]);
-       if ((f[F2] = fopen(argv[2], "r")) == NULL)
-               error("can't open %s", argv[2]);
-
-#define get1() n1=input(F1)
-#define get2() n2=input(F2)
-       get1();
-       bot2 = ftell(f[F2]);
-       get2();
-       while(n1>0 && n2>0 || aflg!=0 && n1+n2>0) {
-               if(n1>0 && n2>0 && comp()>0 || n1==0) {
-                       if(aflg&2) output(0, n2);
-                       bot2 = ftell(f[F2]);
-                       get2();
-               } else if(n1>0 && n2>0 && comp()<0 || n2==0) {
-                       if(aflg&1) output(n1, 0);
-                       get1();
-               } else /*(n1>0 && n2>0 && comp()==0)*/ {
-                       while(n2>0 && comp()==0) {
-                               output(n1, n2);
-                               top2 = ftell(f[F2]);
-                               get2();
-                       }
-                       fseek(f[F2], bot2, 0);
-                       get2();
-                       get1();
-                       for(;;) {
-                               if(n1>0 && n2>0 && comp()==0) {
-                                       output(n1, n2);
-                                       get2();
-                               } else if(n1>0 && n2>0 && comp()<0 || n2==0) {
-                                       fseek(f[F2], bot2, 0);
-                                       get2();
-                                       get1();
-                               } else /*(n1>0 && n2>0 && comp()>0 || n1==0)*/{
-                                       fseek(f[F2], top2, 0);
-                                       bot2 = top2;
-                                       get2();
-                                       break;
-                               }
-                       }
-               }
-       }
-       return(0);
-}
-
-input(n)               /* get input line and split into fields */
-{
-       register int i, c;
-       char *bp;
-       char **pp;
-
-       bp = buf[n];
-       pp = ppi[n];
-       if (fgets(bp, BUFSIZ, f[n]) == NULL)
-               return(0);
-       for (i = 0; ; i++) {
-               if (sep1 == ' ')        /* strip multiples */
-                       while ((c = *bp) == sep1 || c == sep2)
-                               bp++;   /* skip blanks */
-               else
-                       c = *bp;
-               if (c == '\n' || c == '\0')
-                       break;
-               *pp++ = bp;     /* record beginning */
-               while ((c = *bp) != sep1 && c != '\n' && c != sep2 && c != '\0')
-                       bp++;
-               *bp++ = '\0';   /* mark end by overwriting blank */
-                       /* fails badly if string doesn't have \n at end */
-       }
-       *pp = 0;
-       return(i);
-}
-
-output(on1, on2)       /* print items from olist */
-int on1, on2;
-{
-       int i;
-       char *temp;
-
-       if (no <= 0) {  /* default case */
-               printf("%s", on1? ppi[F1][j1]: ppi[F2][j2]);
-               for (i = 0; i < on1; i++)
-                       if (i != j1)
-                               printf("%c%s", sep1, ppi[F1][i]);
-               for (i = 0; i < on2; i++)
-                       if (i != j2)
-                               printf("%c%s", sep1, ppi[F2][i]);
-               printf("\n");
-       } else {
-               for (i = 0; i < no; i++) {
-                       temp = ppi[olistf[i]][olist[i]];
-                       if(olistf[i]==F1 && on1<=olist[i] ||
-                          olistf[i]==F2 && on2<=olist[i] ||
-                          *temp==0)
-                               temp = null;
-                       printf("%s", temp);
-                       if (i == no - 1)
-                               printf("\n");
-                       else
-                               printf("%c", sep1);
-               }
-       }
-}
-
-error(s1, s2, s3, s4, s5)
-char *s1;
-{
-       fprintf(stderr, "join: ");
-       fprintf(stderr, s1, s2, s3, s4, s5);
-       fprintf(stderr, "\n");
-       exit(1);
-}
-
-cmp(s1, s2)
-char *s1, *s2;
-{
-       return(strcmp(s1, s2));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/kill.c b/.ref-Research-V7/usr/src/cmd/kill.c
deleted file mode 100644 (file)
index e56f0f0..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * kill - send signal to process
- */
-
-#include <signal.h>
-
-main(argc, argv)
-char **argv;
-{
-       register signo, pid, res;
-       int errlev;
-       extern char *sys_errlist[];
-       extern errno;
-
-       errlev = 0;
-       if (argc <= 1) {
-       usage:
-               printf("usage: kill [ -signo ] pid ...\n");
-               exit(2);
-       }
-       if (*argv[1] == '-') {
-               signo = atoi(argv[1]+1);
-               argc--;
-               argv++;
-       } else
-               signo = SIGTERM;
-       argv++;
-       while (argc > 1) {
-               if (**argv<'0' || **argv>'9')
-                       goto usage;
-               res = kill(pid = atoi(*argv), signo);
-               if (res<0) {
-                       printf("%u: %s\n", pid, sys_errlist[errno]);
-                       errlev = 1;
-               }
-               argc--;
-               argv++;
-       }
-       return(errlev);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ld.c b/.ref-Research-V7/usr/src/cmd/ld.c
deleted file mode 100644 (file)
index 48f52a9..0000000
+++ /dev/null
@@ -1,1298 +0,0 @@
-/*
- *  link editor
- */
-
-#include <signal.h>
-#include "sys/types.h"
-#include "sys/stat.h"
-
-/*     Layout of a.out file :
- *
- *     header of 8 words       magic number 405, 407, 410, 411
- *                             text size       )
- *                             data size       ) in bytes but even
- *                             bss size        )
- *                             symbol table size
- *                             entry point
- *                             {unused}
- *                             flag set if no relocation
- *
- *
- *     header:         0
- *     text:           16
- *     data:           16+textsize
- *     relocation:     16+textsize+datasize
- *     symbol table:   16+2*(textsize+datasize) or 16+textsize+datasize
- *
- */
-#define TRUE   1
-#define FALSE  0
-
-
-#define        ARCMAGIC 0177545
-#define OMAGIC 0405
-#define        FMAGIC  0407
-#define        NMAGIC  0410
-#define        IMAGIC  0411
-
-#define        EXTERN  040
-#define        UNDEF   00
-#define        ABS     01
-#define        TEXT    02
-#define        DATA    03
-#define        BSS     04
-#define        COMM    05      /* internal use only */
-
-#define        RABS    00
-#define        RTEXT   02
-#define        RDATA   04
-#define        RBSS    06
-#define        REXT    010
-
-#define NOVLY  16
-#define        RELFLG  01
-#define        NROUT   256
-#define        NSYM    1103
-#define        NSYMPR  1000
-
-char   premeof[] = "Premature EOF";
-char   goodnm[] = "__.SYMDEF";
-
-/* table of contents stuff */
-#define TABSZ  700
-struct tab
-{      char cname[8];
-       long cloc;
-} tab[TABSZ];
-int tnum;
-
-
-/* overlay management */
-int    vindex;
-struct overlay {
-       int     argsav;
-       int     symsav;
-       struct liblist  *libsav;
-       char    *vname;
-       int     ctsav, cdsav, cbsav;
-       int     offt, offd, offb, offs;
-} vnodes[NOVLY];
-
-/* input management */
-struct page {
-       int     nuser;
-       int     bno;
-       int     nibuf;
-       int     buff[256];
-} page[2];
-
-struct {
-       int     nuser;
-       int     bno;
-} fpage;
-
-struct stream {
-       int     *ptr;
-       int     bno;
-       int     nibuf;
-       int     size;
-       struct page     *pno;
-};
-
-struct stream text;
-struct stream reloc;
-
-struct {
-       char    aname[14];
-       long    atime;
-       char    auid, agid;
-       int     amode;
-       long    asize;
-} archdr;
-
-struct {
-       int     fmagic;
-       int     tsize;
-       int     dsize;
-       int     bsize;
-       int     ssize;
-       int     entry;
-       int     pad;
-       int     relflg;
-} filhdr;
-
-
-/* one entry for each archive member referenced;
- * set in first pass; needs restoring for overlays
- */
-struct liblist {
-       long    loc;
-};
-
-struct liblist liblist[NROUT];
-struct liblist *libp = liblist;
-
-
-/* symbol management */
-struct symbol {
-       char    sname[8];
-       char    stype;
-       char    spare;
-       int     svalue;
-};
-
-struct local {
-       int locindex;           /* index to symbol in file */
-       struct symbol *locsymbol;       /* ptr to symbol table */
-};
-
-struct symbol  cursym;                 /* current symbol */
-struct symbol  symtab[NSYM];           /* actual symbols */
-struct symbol  **symhash[NSYM];        /* ptr to hash table entry */
-struct symbol  *lastsym;               /* last symbol entered */
-int    symindex;               /* next available symbol table entry */
-struct symbol  *hshtab[NSYM+2];        /* hash table for symbols */
-struct local   local[NSYMPR];
-
-/* internal symbols */
-struct symbol  *p_etext;
-struct symbol  *p_edata;
-struct symbol  *p_end;
-struct symbol  *entrypt;
-
-int    trace;
-/* flags */
-int    xflag;          /* discard local symbols */
-int    Xflag;          /* discard locals starting with 'L' */
-int    Sflag;          /* discard all except locals and globals*/
-int    rflag;          /* preserve relocation bits, don't define common */
-int    arflag;         /* original copy of rflag */
-int    sflag;          /* discard all symbols */
-int    nflag;          /* pure procedure */
-int    Oflag;          /* set magic # to 0405 (overlay) */
-int    dflag;          /* define common even with rflag */
-int    iflag;          /* I/D space separated */
-int    vflag;          /* overlays used */
-
-int    ofilfnd;
-char   *ofilename = "l.out";
-int    infil;
-char   *filname;
-
-/* cumulative sizes set in pass 1 */
-int    tsize;
-int    dsize;
-int    bsize;
-int    ssize;
-
-/* symbol relocation; both passes */
-int    ctrel;
-int    cdrel;
-int    cbrel;
-
-int    errlev;
-int    delarg  = 4;
-char   tfname[] = "/tmp/ldaXXXXX";
-
-
-/* output management */
-struct buf {
-       int     fildes;
-       int     nleft;
-       int     *xnext;
-       int     iobuf[256];
-};
-struct buf     toutb;
-struct buf     doutb;
-struct buf     troutb;
-struct buf     droutb;
-struct buf     soutb;
-
-struct symbol  **lookup();
-struct symbol  **slookup();
-struct symbol  *lookloc();
-
-delexit()
-{
-       unlink("l.out");
-       if (delarg==0)
-               chmod(ofilename, 0777 & ~umask(0));
-       exit(delarg);
-}
-
-main(argc, argv)
-char **argv;
-{
-       register int c, i; 
-       int num;
-       register char *ap, **p;
-       int found; 
-       int vscan; 
-       char save;
-
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, delexit);
-       if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
-               signal(SIGTERM, delexit);
-       if (argc == 1)
-               exit(4);
-       p = argv+1;
-
-       /* scan files once to find symdefs */
-       for (c=1; c<argc; c++) {
-               if (trace) printf("%s:\n", *p);
-               filname = 0;
-               ap = *p++;
-
-               if (*ap == '-') {
-                       for (i=1; ap[i]; i++) {
-                       switch (ap[i]) {
-                       case 'o':
-                               if (++c >= argc)
-                                       error(2, "Bad output file");
-                               ofilename = *p++;
-                               ofilfnd++;
-                               continue;
-
-                       case 'u':
-                       case 'e':
-                               if (++c >= argc)
-                                       error(2, "Bad 'use' or 'entry'");
-                               enter(slookup(*p++));
-                               if (ap[i]=='e')
-                                       entrypt = lastsym;
-                               continue;
-
-                       case 'v':
-                               if (++c >= argc)
-                                       error(2, "-v: arg missing");
-                               vflag=TRUE;
-                               vscan = vindex; 
-                               found=FALSE;
-                               while (--vscan>=0 && found==FALSE)
-                                       found = eq(vnodes[vscan].vname, *p);
-                               if (found) {
-                                       endload(c, argv);
-                                       restore(vscan);
-                               } else
-                                       record(c, *p);
-                               p++;
-                               continue;
-
-                       case 'D':
-                               if (++c >= argc)
-                                       error(2, "-D: arg missing");
-                               num = atoi(*p++);
-                               if (dsize>num)
-                                       error(2, "-D: too small");
-                               dsize = num;
-                               continue;
-
-                       case 'l':
-                               save = ap[--i]; 
-                               ap[i]='-';
-                               load1arg(&ap[i]); 
-                               ap[i]=save;
-                               break;
-
-                       case 'x':
-                               xflag++;
-                               continue;
-
-                       case 'X':
-                               Xflag++;
-                               continue;
-
-                       case 'S':
-                               Sflag++; 
-                               continue;
-
-                       case 'r':
-                               rflag++;
-                               arflag++;
-                               continue;
-
-                       case 's':
-                               sflag++;
-                               xflag++;
-                               continue;
-
-                       case 'n':
-                               nflag++;
-                               continue;
-
-                       case 'd':
-                               dflag++;
-                               continue;
-
-                       case 'i':
-                               iflag++;
-                               continue;
-
-                       case 'O':
-                               Oflag++;
-                               continue;
-
-                       case 't':
-                               trace++;
-                               continue;
-
-                       default:
-                               error(2, "bad flag");
-                       } /*endsw*/
-                       break;
-                       } /*endfor*/
-               } else
-                       load1arg(ap);
-       }
-       endload(argc, argv);
-}
-
-/* used after pass 1 */
-int    nsym;
-int    torigin;
-int    dorigin;
-int    borigin;
-
-endload(argc, argv)
-int argc; 
-char **argv;
-{
-       register int c, i; 
-       int dnum;
-       register char *ap, **p;
-       filname = 0;
-       middle();
-       setupout();
-       p = argv+1;
-       libp = liblist;
-       for (c=1; c<argc; c++) {
-               ap = *p++;
-               if (trace) printf("%s:\n", ap);
-               if (*ap == '-') {
-                       for (i=1; ap[i]; i++) {
-                       switch (ap[i]) {
-                       case 'D':
-                               for (dnum = atoi(*p); dorigin<dnum; dorigin += 2) {
-                                       putw(0, &doutb);
-                                       if (rflag)
-                                               putw(0, &droutb);
-                               }
-                       case 'u':
-                       case 'e':
-                       case 'o':
-                       case 'v':
-                               ++c; 
-                               ++p;
-
-                       default:
-                               continue;
-
-                       case 'l':
-                               ap[--i]='-'; 
-                               load2arg(&ap[i]);
-                               break;
-                       } /*endsw*/
-                       break;
-                       } /*endfor*/
-               } else
-                       load2arg(ap);
-       }
-       finishout();
-}
-
-record(c, nam)
-int c; 
-char *nam;
-{
-       register struct overlay *v;
-
-       v = &vnodes[vindex++];
-       v->argsav = c;
-       v->symsav = symindex;
-       v->libsav = libp;
-       v->vname = nam;
-       v->offt = tsize; 
-       v->offd = dsize; 
-       v->offb = bsize; 
-       v->offs = ssize;
-       v->ctsav = ctrel; 
-       v->cdsav = cdrel; 
-       v->cbsav = cbrel;
-}
-
-restore(vscan)
-int vscan;
-{
-       register struct overlay *v;
-       register int saved;
-
-       v = &vnodes[vscan];
-       vindex = vscan+1;
-       libp = v->libsav;
-       ctrel = v->ctsav; 
-       cdrel = v->cdsav; 
-       cbrel = v->cbsav;
-       tsize = v->offt; 
-       dsize = v->offd; 
-       bsize = v->offb; 
-       ssize = v->offs;
-       saved = v->symsav;
-       while (symindex>saved)
-               *symhash[--symindex]=0;
-}
-
-/* scan file to find defined symbols */
-load1arg(acp)
-char *acp;
-{
-       register char *cp;
-       long nloc;
-
-       cp = acp;
-       switch ( getfile(cp)) {
-       case 0:
-               load1(0, 0L);
-               break;
-
-       /* regular archive */
-       case 1:
-               nloc = 1;
-               while ( step(nloc))
-                       nloc += (archdr.asize + sizeof(archdr) + 1) >> 1;
-               break;
-
-       /* table of contents */
-       case 2:
-               tnum = archdr.asize / sizeof(struct tab);
-               if (tnum >= TABSZ) {
-                       error(2, "fast load buffer too small");
-               }
-               lseek(infil, (long)(sizeof(filhdr.fmagic)+sizeof(archdr)), 0);
-               read(infil, (char *)tab, tnum * sizeof(struct tab));
-               while (ldrand());
-               libp->loc = -1;
-               libp++;
-               break;
-       /* out of date table of contents */
-       case 3:
-               error(0, "out of date (warning)");
-               for(nloc = 1+((archdr.asize+sizeof(archdr)+1) >> 1); step(nloc);
-                       nloc += (archdr.asize + sizeof(archdr) + 1) >> 1);
-               break;
-       }
-       close(infil);
-}
-
-step(nloc)
-long nloc;
-{
-       dseek(&text, nloc, sizeof archdr);
-       if (text.size <= 0) {
-               libp->loc = -1;
-               libp++;
-               return(0);
-       }
-       mget((int *)&archdr, sizeof archdr);
-       if (load1(1, nloc + (sizeof archdr) / 2)) {
-               libp->loc = nloc;
-               libp++;
-       }
-       return(1);
-}
-
-ldrand()
-{
-       int i;
-       struct symbol *sp, **pp;
-       struct liblist *oldp = libp;
-       for(i = 0; i<tnum; i++) {
-               if ((pp = slookup(tab[i].cname)) == 0)
-                       continue;
-               sp = *pp;
-               if (sp->stype != EXTERN+UNDEF)
-                       continue;
-               step(tab[i].cloc >> 1);
-       }
-       return(oldp != libp);
-}
-
-add(a,b,s)
-int a, b;
-char *s;
-{
-       long r;
-
-       r = (long)(unsigned)a + (unsigned)b;
-       if (r >= 0200000)
-               error(1,s);
-       return(r);
-}
-
-
-/* single file or archive member */
-load1(libflg, loc)
-long loc;
-{
-       register struct symbol *sp;
-       int savindex;
-       int ndef, nloc, type, mtype;
-
-       readhdr(loc);
-       ctrel = tsize;
-       cdrel += dsize;
-       cbrel += bsize;
-       ndef = 0;
-       nloc = sizeof cursym;
-       savindex = symindex;
-       if ((filhdr.relflg&RELFLG)==1) {
-               error(1, "No relocation bits");
-               return(0);
-       }
-       loc += (sizeof filhdr)/2 + filhdr.tsize + filhdr.dsize;
-       dseek(&text, loc, filhdr.ssize);
-       while (text.size > 0) {
-               mget((int *)&cursym, sizeof cursym);
-               type = cursym.stype;
-               if (Sflag) {
-                       mtype = type&037;
-                       if (mtype==1 || mtype>4) {
-                               continue;
-                       }
-               }
-               if ((type&EXTERN)==0) {
-                       if (Xflag==0 || cursym.sname[0]!='L')
-                               nloc += sizeof cursym;
-                       continue;
-               }
-               symreloc();
-               if (enter(lookup()))
-                       continue;
-               if ((sp = lastsym)->stype != EXTERN+UNDEF)
-                       continue;
-               if (cursym.stype == EXTERN+UNDEF) {
-                       if (cursym.svalue > sp->svalue)
-                               sp->svalue = cursym.svalue;
-                       continue;
-               }
-               if (sp->svalue != 0 && cursym.stype == EXTERN+TEXT)
-                       continue;
-               ndef++;
-               sp->stype = cursym.stype;
-               sp->svalue = cursym.svalue;
-       }
-       if (libflg==0 || ndef) {
-               tsize = add(tsize,filhdr.tsize,"text overflow");
-               dsize = add(dsize,filhdr.dsize,"data overflow");
-               bsize = add(bsize,filhdr.bsize,"bss overflow");
-               ssize = add(ssize,nloc,"symbol table overflow");
-               return(1);
-       }
-       /*
-        * No symbols defined by this library member.
-        * Rip out the hash table entries and reset the symbol table.
-        */
-       while (symindex>savindex)
-               *symhash[--symindex]=0;
-       return(0);
-}
-
-middle()
-{
-       register struct symbol *sp, *symp;
-       register t, csize;
-       int nund, corigin;
-
-       torigin=0; 
-       dorigin=0; 
-       borigin=0;
-
-       p_etext = *slookup("_etext");
-       p_edata = *slookup("_edata");
-       p_end = *slookup("_end");
-       /*
-        * If there are any undefined symbols, save the relocation bits.
-        */
-       symp = &symtab[symindex];
-       if (rflag==0) {
-               for (sp = symtab; sp<symp; sp++)
-                       if (sp->stype==EXTERN+UNDEF && sp->svalue==0
-                               && sp!=p_end && sp!=p_edata && sp!=p_etext) {
-                               rflag++;
-                               dflag = 0;
-                               break;
-                       }
-       }
-       if (rflag)
-               nflag = sflag = iflag = Oflag = 0;
-       /*
-        * Assign common locations.
-        */
-       csize = 0;
-       if (dflag || rflag==0) {
-               ldrsym(p_etext, tsize, EXTERN+TEXT);
-               ldrsym(p_edata, dsize, EXTERN+DATA);
-               ldrsym(p_end, bsize, EXTERN+BSS);
-               for (sp = symtab; sp<symp; sp++)
-                       if (sp->stype==EXTERN+UNDEF && (t = sp->svalue)!=0) {
-                               t = (t+1) & ~01;
-                               sp->svalue = csize;
-                               sp->stype = EXTERN+COMM;
-                               csize = add(csize, t, "bss overflow");
-                       }
-       }
-       /*
-        * Now set symbols to their final value
-        */
-       if (nflag || iflag)
-               tsize = (tsize + 077) & ~077;
-       dorigin = tsize;
-       if (nflag)
-               dorigin = (tsize+017777) & ~017777;
-       if (iflag)
-               dorigin = 0;
-       corigin = dorigin + dsize;
-       borigin = corigin + csize;
-       nund = 0;
-       for (sp = symtab; sp<symp; sp++) switch (sp->stype) {
-       case EXTERN+UNDEF:
-               errlev |= 01;
-               if (arflag==0 && sp->svalue==0) {
-                       if (nund==0)
-                               printf("Undefined:\n");
-                       nund++;
-                       printf("%.8s\n", sp->sname);
-               }
-               continue;
-
-       case EXTERN+ABS:
-       default:
-               continue;
-
-       case EXTERN+TEXT:
-               sp->svalue += torigin;
-               continue;
-
-       case EXTERN+DATA:
-               sp->svalue += dorigin;
-               continue;
-
-       case EXTERN+BSS:
-               sp->svalue += borigin;
-               continue;
-
-       case EXTERN+COMM:
-               sp->stype = EXTERN+BSS;
-               sp->svalue += corigin;
-               continue;
-       }
-       if (sflag || xflag)
-               ssize = 0;
-       bsize = add(bsize, csize, "bss overflow");
-       nsym = ssize / (sizeof cursym);
-}
-
-ldrsym(asp, val, type)
-struct symbol *asp;
-{
-       register struct symbol *sp;
-
-       if ((sp = asp) == 0)
-               return;
-       if (sp->stype != EXTERN+UNDEF || sp->svalue) {
-               printf("%.8s: ", sp->sname);
-               error(1, "Multiply defined");
-               return;
-       }
-       sp->stype = type;
-       sp->svalue = val;
-}
-
-setupout()
-{
-       tcreat(&toutb, 0);
-       mktemp(tfname);
-       tcreat(&doutb, 1);
-       if (sflag==0 || xflag==0)
-               tcreat(&soutb, 1);
-       if (rflag) {
-               tcreat(&troutb, 1);
-               tcreat(&droutb, 1);
-       }
-       filhdr.fmagic = (Oflag ? OMAGIC :( iflag ? IMAGIC : ( nflag ? NMAGIC : FMAGIC )));
-       filhdr.tsize = tsize;
-       filhdr.dsize = dsize;
-       filhdr.bsize = bsize;
-       filhdr.ssize = sflag? 0: (ssize + (sizeof cursym)*symindex);
-       if (entrypt) {
-               if (entrypt->stype!=EXTERN+TEXT)
-                       error(1, "Entry point not in text");
-               else
-                       filhdr.entry = entrypt->svalue | 01;
-       } else
-               filhdr.entry=0;
-       filhdr.pad = 0;
-       filhdr.relflg = (rflag==0);
-       mput(&toutb, (int *)&filhdr, sizeof filhdr);
-}
-
-tcreat(buf, tempflg)
-struct buf *buf;
-{
-       register int ufd; 
-       char *nam;
-       nam = (tempflg ? tfname : ofilename);
-       if ((ufd = creat(nam, 0666)) < 0)
-               error(2, tempflg?"cannot create temp":"cannot create output");
-       close(ufd); 
-       buf->fildes = open(nam, 2);
-       if (tempflg)
-               unlink(tfname);
-       buf->nleft = sizeof(buf->iobuf)/sizeof(int);
-       buf->xnext = buf->iobuf;
-}
-
-load2arg(acp)
-char *acp;
-{
-       register char *cp;
-       register struct liblist *lp;
-
-       cp = acp;
-       if (getfile(cp) == 0) {
-               while (*cp)
-                       cp++;
-               while (cp >= acp && *--cp != '/');
-               mkfsym(++cp);
-               load2(0L);
-       } else {        /* scan archive members referenced */
-               for (lp = libp; lp->loc != -1; lp++) {
-                       dseek(&text, lp->loc, sizeof archdr);
-                       mget((int *)&archdr, sizeof archdr);
-                       mkfsym(archdr.aname);
-                       load2(lp->loc + (sizeof archdr) / 2);
-               }
-               libp = ++lp;
-       }
-       close(infil);
-}
-
-load2(loc)
-long loc;
-{
-       register struct symbol *sp;
-       register struct local *lp;
-       register int symno;
-       int type, mtype;
-
-       readhdr(loc);
-       ctrel = torigin;
-       cdrel += dorigin;
-       cbrel += borigin;
-       /*
-        * Reread the symbol table, recording the numbering
-        * of symbols for fixing external references.
-        */
-       lp = local;
-       symno = -1;
-       loc += (sizeof filhdr)/2;
-       dseek(&text, loc + filhdr.tsize + filhdr.dsize, filhdr.ssize);
-       while (text.size > 0) {
-               symno++;
-               mget((int *)&cursym, sizeof cursym);
-               symreloc();
-               type = cursym.stype;
-               if (Sflag) {
-                       mtype = type&037;
-                       if (mtype==1 || mtype>4) continue;
-               }
-               if ((type&EXTERN) == 0) {
-                       if (!sflag&&!xflag&&(!Xflag||cursym.sname[0]!='L'))
-                               mput(&soutb, (int *)&cursym, sizeof cursym);
-                       continue;
-               }
-               if ((sp = *lookup()) == 0)
-                       error(2, "internal error: symbol not found");
-               if (cursym.stype == EXTERN+UNDEF) {
-                       if (lp >= &local[NSYMPR])
-                               error(2, "Local symbol overflow");
-                       lp->locindex = symno;
-                       lp++->locsymbol = sp;
-                       continue;
-               }
-               if (cursym.stype!=sp->stype || cursym.svalue!=sp->svalue) {
-                       printf("%.8s: ", cursym.sname);
-                       error(1, "Multiply defined");
-               }
-       }
-       dseek(&text, loc, filhdr.tsize);
-       dseek(&reloc, loc + half(filhdr.tsize + filhdr.dsize), filhdr.tsize);
-       load2td(lp, ctrel, &toutb, &troutb);
-       dseek(&text, loc+half(filhdr.tsize), filhdr.dsize);
-       dseek(&reloc, loc+filhdr.tsize+half(filhdr.dsize), filhdr.dsize);
-       load2td(lp, cdrel, &doutb, &droutb);
-       torigin += filhdr.tsize;
-       dorigin += filhdr.dsize;
-       borigin += filhdr.bsize;
-}
-
-load2td(lp, creloc, b1, b2)
-struct local *lp;
-struct buf *b1, *b2;
-{
-       register r, t;
-       register struct symbol *sp;
-
-       for (;;) {
-               /*
-                        * The pickup code is copied from "get" for speed.
-                        */
-
-               /* next text or data word */
-               if (--text.size <= 0) {
-                       if (text.size < 0)
-                               break;
-                       text.size++;
-                       t = get(&text);
-               } else if (--text.nibuf < 0) {
-                       text.nibuf++;
-                       text.size++;
-                       t = get(&text);
-               } else
-                       t = *text.ptr++;
-
-               /* next relocation word */
-               if (--reloc.size <= 0) {
-                       if (reloc.size < 0)
-                               error(2, "Relocation error");
-                       reloc.size++;
-                       r = get(&reloc);
-               } else if (--reloc.nibuf < 0) {
-                       reloc.nibuf++;
-                       reloc.size++;
-                       r = get(&reloc);
-               } else
-                       r = *reloc.ptr++;
-
-               switch (r&016) {
-
-               case RTEXT:
-                       t += ctrel;
-                       break;
-
-               case RDATA:
-                       t += cdrel;
-                       break;
-
-               case RBSS:
-                       t += cbrel;
-                       break;
-
-               case REXT:
-                       sp = lookloc(lp, r);
-                       if (sp->stype==EXTERN+UNDEF) {
-                               r = (r&01) + ((nsym+(sp-symtab))<<4) + REXT;
-                               break;
-                       }
-                       t += sp->svalue;
-                       r = (r&01) + ((sp->stype-(EXTERN+ABS))<<1);
-                       break;
-               }
-               if (r&01)
-                       t -= creloc;
-               putw(t, b1);
-               if (rflag)
-                       putw(r, b2);
-       }
-}
-
-finishout()
-{
-       register n, *p;
-
-       if (nflag||iflag) {
-               n = torigin;
-               while (n&077) {
-                       n += 2;
-                       putw(0, &toutb);
-                       if (rflag)
-                               putw(0, &troutb);
-               }
-       }
-       copy(&doutb);
-       if (rflag) {
-               copy(&troutb);
-               copy(&droutb);
-       }
-       if (sflag==0) {
-               if (xflag==0)
-                       copy(&soutb);
-               for (p = (int *)symtab; p < (int *)&symtab[symindex];)
-                       putw(*p++, &toutb);
-       }
-       flush(&toutb);
-       close(toutb.fildes);
-       if (!ofilfnd) {
-               unlink("a.out");
-               link("l.out", "a.out");
-               ofilename = "a.out";
-       }
-       delarg = errlev;
-       delexit();
-}
-
-copy(buf)
-struct buf *buf;
-{
-       register f, *p, n;
-
-       flush(buf);
-       lseek(f = buf->fildes, (long)0, 0);
-       while ((n = read(f, (char *)doutb.iobuf, sizeof(doutb.iobuf))) > 1) {
-               n >>= 1;
-               p = (int *)doutb.iobuf;
-               do
-                       putw(*p++, &toutb);
-               while (--n);
-       }
-       close(f);
-}
-
-mkfsym(s)
-char *s;
-{
-
-       if (sflag || xflag)
-               return;
-       cp8c(s, cursym.sname);
-       cursym.stype = 037;
-       cursym.svalue = torigin;
-       mput(&soutb, (int *)&cursym, sizeof cursym);
-}
-
-mget(aloc, an)
-int *aloc;
-{
-       register *loc, n;
-       register *p;
-
-       n = an;
-       n >>= 1;
-       loc = aloc;
-       if ((text.nibuf -= n) >= 0) {
-               if ((text.size -= n) > 0) {
-                       p = text.ptr;
-                       do
-                               *loc++ = *p++;
-                       while (--n);
-                       text.ptr = p;
-                       return;
-               } else
-                       text.size += n;
-       }
-       text.nibuf += n;
-       do {
-               *loc++ = get(&text);
-       } 
-       while (--n);
-}
-
-mput(buf, aloc, an)
-struct buf *buf; 
-int *aloc;
-{
-       register *loc;
-       register n;
-
-       loc = aloc;
-       n = an>>1;
-       do {
-               putw(*loc++, buf);
-       } 
-       while (--n);
-}
-
-dseek(asp, aloc, s)
-long aloc;
-struct stream *asp;
-{
-       register struct stream *sp;
-       register struct page *p;
-       /* register */ long b, o;
-       int n;
-
-       b = aloc >> 8;
-       o = aloc & 0377;
-       sp = asp;
-       --sp->pno->nuser;
-       if ((p = &page[0])->bno!=b && (p = &page[1])->bno!=b)
-               if (p->nuser==0 || (p = &page[0])->nuser==0) {
-                       if (page[0].nuser==0 && page[1].nuser==0)
-                               if (page[0].bno < page[1].bno)
-                                       p = &page[0];
-                       p->bno = b;
-                       lseek(infil, (aloc & ~0377L) << 1, 0);
-                       if ((n = read(infil, (char *)p->buff, 512)>>1) < 0)
-                               n = 0;
-                       p->nibuf = n;
-       } else
-               error(2, "No pages");
-       ++p->nuser;
-       sp->bno = b;
-       sp->pno = p;
-       sp->ptr = p->buff + o;
-       if (s != -1)
-               sp->size = half(s);
-       if ((sp->nibuf = p->nibuf-o) <= 0)
-               sp->size = 0;
-}
-
-half(i)
-{
-       return((i>>1)&077777);
-}
-
-get(asp)
-struct stream *asp;
-{
-       register struct stream *sp;
-
-       sp = asp;
-       if (--sp->nibuf < 0) {
-               dseek(sp, (long)(sp->bno + 1) << 8, -1);
-               --sp->nibuf;
-       }
-       if (--sp->size <= 0) {
-               if (sp->size < 0)
-                       error(2, premeof);
-               ++fpage.nuser;
-               --sp->pno->nuser;
-               sp->pno = (struct page *)&fpage;
-       }
-       return(*sp->ptr++);
-}
-
-getfile(acp)
-char *acp;
-{
-       register char *cp;
-       register int c;
-       struct stat x;
-
-       cp = acp; 
-       infil = -1;
-       archdr.aname[0] = '\0';
-       filname = cp;
-       if (cp[0]=='-' && cp[1]=='l') {
-               if(cp[2] == '\0')
-                       cp = "-la";
-               filname = "/usr/lib/libxxxxxxxxxxxxxxx";
-               for(c=0; cp[c+2]; c++)
-                       filname[c+12] = cp[c+2];
-               filname[c+12] = '.';
-               filname[c+13] = 'a';
-               filname[c+14] = '\0';
-               if ((infil = open(filname+4, 0)) >= 0) {
-                       filname += 4;
-               }
-       }
-       if (infil == -1 && (infil = open(filname, 0)) < 0)
-               error(2, "cannot open");
-       page[0].bno = page[1].bno = -1;
-       page[0].nuser = page[1].nuser = 0;
-       text.pno = reloc.pno = (struct page *)&fpage;
-       fpage.nuser = 2;
-       dseek(&text, 0L, 2);
-       if (text.size <= 0)
-               error(2, premeof);
-       if(get(&text) != ARCMAGIC)
-               return(0);      /* regualr file */
-       dseek(&text, 1L, sizeof archdr);        /* word addressing */
-       if(text.size <= 0)
-               return(1);      /* regular archive */
-       mget((int *)&archdr, sizeof archdr);
-       if(strncmp(archdr.aname, goodnm, 14) != 0)
-               return(1);      /* regular archive */
-       else {
-               fstat(infil, &x);
-               if(x.st_mtime > archdr.atime)
-               {
-                       return(3);
-               }
-               else return(2);
-       }
-}
-
-struct symbol **lookup()
-{
-       int i; 
-       int clash;
-       register struct symbol **hp;
-       register char *cp, *cp1;
-
-       i = 0;
-       for (cp = cursym.sname; cp < &cursym.sname[8];)
-               i = (i<<1) + *cp++;
-       for (hp = &hshtab[(i&077777)%NSYM+2]; *hp!=0;) {
-               cp1 = (*hp)->sname; 
-               clash=FALSE;
-               for (cp = cursym.sname; cp < &cursym.sname[8];)
-                       if (*cp++ != *cp1++) {
-                               clash=TRUE; 
-                               break;
-                       }
-               if (clash) {
-                       if (++hp >= &hshtab[NSYM+2])
-                               hp = hshtab;
-               } else
-                       break;
-       }
-       return(hp);
-}
-
-struct symbol **slookup(s)
-char *s;
-{
-       cp8c(s, cursym.sname);
-       cursym.stype = EXTERN+UNDEF;
-       cursym.svalue = 0;
-       return(lookup());
-}
-
-enter(hp)
-struct symbol **hp;
-{
-       register struct symbol *sp;
-
-       if (*hp==0) {
-               if (symindex>=NSYM)
-                       error(2, "Symbol table overflow");
-               symhash[symindex] = hp;
-               *hp = lastsym = sp = &symtab[symindex++];
-               cp8c(cursym.sname, sp->sname);
-               sp->stype = cursym.stype;
-               sp->svalue = cursym.svalue;
-               return(1);
-       } else {
-               lastsym = *hp;
-               return(0);
-       }
-}
-
-symreloc()
-{
-       switch (cursym.stype) {
-
-       case TEXT:
-       case EXTERN+TEXT:
-               cursym.svalue += ctrel;
-               return;
-
-       case DATA:
-       case EXTERN+DATA:
-               cursym.svalue += cdrel;
-               return;
-
-       case BSS:
-       case EXTERN+BSS:
-               cursym.svalue += cbrel;
-               return;
-
-       case EXTERN+UNDEF:
-               return;
-       }
-       if (cursym.stype&EXTERN)
-               cursym.stype = EXTERN+ABS;
-}
-
-error(n, s)
-char *s;
-{
-       if (errlev==0)
-               printf("ld:");
-       if (filname) {
-               printf("%s", filname);
-               if (archdr.aname[0])
-                       printf("(%.14s)", archdr.aname);
-               printf(": ");
-       }
-       printf("%s\n", s);
-       if (n > 1)
-               delexit();
-       errlev = n;
-}
-
-struct symbol *
-lookloc(alp, r)
-struct local *alp;
-{
-       register struct local *clp, *lp;
-       register sn;
-
-       lp = alp;
-       sn = (r>>4) & 07777;
-       for (clp = local; clp<lp; clp++)
-               if (clp->locindex == sn)
-                       return(clp->locsymbol);
-       error(2, "Local symbol botch");
-}
-
-readhdr(loc)
-long loc;
-{
-       register st, sd;
-
-       dseek(&text, loc, sizeof filhdr);
-       mget((int *)&filhdr, sizeof filhdr);
-       if (filhdr.fmagic != FMAGIC)
-               error(2, "Bad format");
-       st = (filhdr.tsize+01) & ~01;
-       filhdr.tsize = st;
-       cdrel = -st;
-       sd = (filhdr.dsize+01) & ~01;
-       cbrel = - (st+sd);
-       filhdr.bsize = (filhdr.bsize+01) & ~01;
-}
-
-cp8c(from, to)
-char *from, *to;
-{
-       register char *f, *t, *te;
-
-       f = from;
-       t = to;
-       te = t+8;
-       while ((*t++ = *f++) && t<te);
-       while (t<te)
-               *t++ = 0;
-}
-
-eq(s1, s2)
-char *s1; 
-char *s2;
-{
-       while (*s1==*s2++)
-               if ((*s1++)==0)
-                       return(TRUE);
-       return(FALSE);
-}
-
-putw(w, b)
-register struct buf *b;
-{
-       *(b->xnext)++ = w;
-       if (--b->nleft <= 0)
-               flush(b);
-}
-
-flush(b)
-register struct buf *b;
-{
-       register n;
-
-       if ((n = (char *)b->xnext - (char *)b->iobuf) > 0)
-               if (write(b->fildes, (char *)b->iobuf, n) != n)
-                       error(2, "output error");
-       b->xnext = b->iobuf;
-       b->nleft = sizeof(b->iobuf)/sizeof(int);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/README b/.ref-Research-V7/usr/src/cmd/learn/README
deleted file mode 100644 (file)
index 1d5333e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-The C script is not complete; use at your own risk.
-
-Lessons are in
-       /usr/lib/learn/*
-Source is in
-       /usr/src/cmd/learn
-Miscellaneous supporting code is also in source.
-
-Make a learn by
-       make
-When this seems right, extract the lessons by
-       make lessons
-This extracts the lesson archives
-for each course.  You can also do this one step at a
-time with "make files", "make editor", etc.,
-if you don't want all courses.
-If you do things separately, you must also say
-       make play; make log
-
-Finally, check that it's sensible with
-       make check
-If that doesn't print any messages,
-you're probably in good shape.
-
-Learn requires general write permission on the user playpen
-directory .../lib/play.  Lesson directories may be protected.
-
-Learn collects a log file for each script in the .../lib/log
-directory, with a file for each script (files,
-editor, etc.) containing an entry for each lesson
-attempted. These files will grow without bound,
-unless they are periodically truncated. 
-The log files should have general write permission.
-If you don't want logging (a sensible position to take),
-set the variable "logging" to zero in source/lrndef
-before making learn.
-
-Learn requires about 1500 blocks to make itself,
-and about 1000 when completely made.
-
-Please report problems, bad lessons, etc., to
-Brian Kernighan, MH 6021, 2C-518, or
-Mike Lesk, MH 6377, 2C-572.  Thanks.
diff --git a/.ref-Research-V7/usr/src/cmd/learn/copy.c b/.ref-Research-V7/usr/src/cmd/learn/copy.c
deleted file mode 100644 (file)
index 8d1f0f7..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-#include "stdio.h"
-#include "signal.h"
-#include "lrnref"
-
-char last[100];
-char logf[100];
-char subdir[100];
-extern char * ctime();
-
-copy(prompt, fin)
-FILE *fin;
-{
-       FILE *fout, *f;
-       char s[100], t[100], s1[100], *r, *tod;
-       char nm[30];
-       int *p, tv[2];
-       extern int intrpt(), *action();
-       extern char *wordb();
-       int nmatch = 0;
-
-       if (subdir[0]==0)
-               sprintf(subdir, "../../%s", sname);
-       for (;;) {
-               if (pgets(s, prompt, fin) == 0)
-                       if (fin == stdin) {
-                               /* fprintf(stderr, "Don't type control-D\n"); */
-                               /* this didn't work out very well */
-                               continue;
-                       } else
-                               break;
-               trim(s);
-               /* change the sequence %s to lesson directory */
-               /* if needed */
-               for (r = s; *r; r++)
-                       if (*r == '%') {
-                               sprintf(s1, s, subdir, subdir, subdir);
-                               strcpy(s, s1);
-                               break;
-                       }
-               r = wordb(s, t);
-               p = action(t);
-               if (*p == ONCE) {       /* some actions done only once per script */
-                       if (wrong) {    /* we are on 2nd time */
-                               scopy(fin, NULL);
-                               continue;
-                       }
-                       strcpy(s, r);
-                       r = wordb(s, t);
-                       p = action(t);
-               }
-               if (p == 0) {
-                       if (comfile >= 0) {
-                               write(comfile, s, strlen(s));
-                               write(comfile, "\n", 1);
-                       }
-                       else {
-                               signal(SIGINT, SIG_IGN);
-                               status = mysys(s);
-                               signal(SIGINT, intrpt);
-                       }
-                       if (incopy) {
-                               fprintf(incopy, "%s\n", s);
-                               strcpy(last, s);
-                       }
-                       continue;
-               }
-               switch (*p) {
-               case READY:
-                       if (incopy && r) {
-                               fprintf(incopy, "%s\n", r);
-                               strcpy(last, r);
-                       }
-                       return;
-               case PRINT:
-                       if (wrong)
-                               scopy(fin, NULL);       /* don't repeat message */
-                       else if (r)
-                               list(r);
-                       else
-                               scopy(fin, stdout);
-                       break;
-               case NOP:
-                       break;
-               case MATCH:
-                       if (nmatch > 0) /* we have already passed */
-                               scopy(fin, NULL);
-                       else if ((status = strcmp(r, last)) == 0) {     /* did we pass this time? */
-                               nmatch++;
-                               scopy(fin, stdout);
-                       } else
-                               scopy(fin, NULL);
-                       break;
-               case BAD:
-                       if (strcmp(r, last) == 0) {
-                               scopy(fin, stdout);
-                       } else
-                               scopy(fin, NULL);
-                       break;
-               case SUCCEED:
-                       scopy(fin, (status == 0) ? stdout : NULL);
-                       break;
-               case FAIL:
-                       scopy(fin, (status != 0) ? stdout : NULL);
-                       break;
-               case CREATE:
-                       fout = fopen(r, "w");
-                       scopy(fin, fout);
-                       fclose(fout);
-                       break;
-               case CMP:
-                       status = cmp(r);        /* contains two file names */
-                       break;
-               case MV:
-                       sprintf(nm, "%s/L%s.%s", subdir, todo, r);
-                       fcopy(r, nm);
-                       break;
-               case USER:
-               case NEXT:
-                       more = 1;
-                       return;
-               case COPYIN:
-                       incopy = fopen(".copy", "w");
-                       break;
-               case UNCOPIN:
-                       fclose(incopy);
-                       incopy = NULL;
-                       break;
-               case COPYOUT:
-                       maktee();
-                       break;
-               case UNCOPOUT:
-                       untee();
-                       break;
-               case PIPE:
-                       comfile = makpipe();
-                       break;
-               case UNPIPE:
-                       close(comfile);
-                       wait(0);
-                       comfile = -1;
-                       break;
-               case YES:
-               case NO:
-                       if (incopy) {
-                               fprintf(incopy, "%s\n", s);
-                               strcpy(last, s);
-                       }
-                       return;
-               case WHERE:
-                       printf("You are in lesson %s\n", todo);
-                       fflush(stdout);
-                       break;
-               case BYE:
-                       more=0;
-                       return;
-               case CHDIR:
-                       printf("cd not allowed\n");
-                       fflush(stdout);
-                       break;
-               case LEARN:
-                       printf("You are already in learn.\n");
-                       fflush(stdout);
-                       break;
-               case LOG:
-                       if (!logging)
-                               break;
-                       if (logf[0] == 0)
-                               sprintf(logf, "%s/log/%s", direct, sname);
-                       f = fopen( (r? r : logf), "a");
-                       if (f == NULL)
-                               break;
-                       time(tv);
-                       tod = ctime(tv);
-                       tod[24] = 0;
-                       fprintf(f, "%s L%-6s %s %2d %s\n", tod,
-                               todo, status? "fail" : "pass", speed, pwline);
-                       fclose(f);
-                       break;
-               }
-       }
-       return;
-}
-
-pgets(s, prompt, f)
-FILE *f;
-{
-       if (prompt) {
-               if (comfile < 0)
-                       printf("$ ");
-               fflush(stdout);
-       }
-       if (fgets(s, 100,f))
-               return(1);
-       else
-               return(0);
-}
-
-trim(s)
-char *s;
-{
-       while (*s)
-               s++;
-       if (*--s == '\n')
-               *s=0;
-}
-
-scopy(fi, fo)  /* copy fi to fo until a line with # */
-FILE *fi, *fo;
-{
-       int c;
-
-       while ((c = getc(fi)) != '#' && c != EOF) {
-               do {
-                       if (fo != NULL)
-                               putc(c, fo);
-                       if (c == '\n')
-                               break;
-               } while ((c = getc(fi)) != EOF);
-       }
-       if (c == '#')
-               ungetc(c, fi);
-       fflush(fo);
-}
-
-cmp(r) /* compare two files for status */
-char *r;
-{
-       char *s;
-       FILE *f1, *f2;
-       int c1, c2, stat;
-
-       for (s = r; *s != ' ' && *s != '\0'; s++)
-               ;
-       *s++ = 0;       /* r contains file 1 */
-       while (*s == ' ')
-               s++;
-       f1 = fopen(r, "r");
-       f2 = fopen(s, "r");
-       if (f1 == NULL || f2 == NULL)
-               return(1);      /* failure */
-       stat = 0;
-       for (;;) {
-               c1 = getc(f1);
-               c2 = getc(f2);
-               if (c1 != c2) {
-                       stat = 1;
-                       break;
-               }
-               if (c1 == EOF || c2 == EOF)
-                       break;
-       }
-       fclose(f1);
-       fclose(f2);
-       return(stat);
-}
-
-char *
-wordb(s, t)    /* in s, t is prefix; return tail */
-char *s, *t;
-{
-       int c;
-
-       while (c = *s++) {
-               if (c == ' ' || c == '\t')
-                       break;
-               *t++ = c;
-       }
-       *t = 0;
-       while (*s == ' ' || *s == '\t')
-               s++;
-       return(c ? s : NULL);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/dounit.c b/.ref-Research-V7/usr/src/cmd/learn/dounit.c
deleted file mode 100644 (file)
index 26a65d4..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "stdio.h"
-#include "lrnref"
-
-dounit()
-{
-       char tbuff[100];
-
-       if (todo == 0)
-               return;
-       wrong = 0;
-retry:
-       start(todo);
-       sprintf(tbuff, "../../%s/L%s", sname, todo);    /* script = lesson */
-       scrin = fopen(tbuff, "r");
-       if (scrin == NULL) {
-               fprintf(stderr, "No script.\n");
-               wrapup(1);
-       }
-
-       copy(0, scrin);
-       if (more == 0)
-               return;
-       copy(1, stdin);
-       if (more == 0)
-               return;
-       copy(0, scrin);
-
-       if (comfile >= 0)
-               close(comfile);
-       wait(&didok);
-       didok = (status == 0);
-       if (!didok) {
-               wrong++;
-               printf("\nSorry, that's %snot right.  Do you want to try again?  ",
-                       wrong > 1 ? "still " : "");
-               fflush(stdout);
-               for(;;) {
-                       gets(tbuff);
-                       if (tbuff[0] == 'y') {
-                               printf("Try the problem again.\n");
-                               fflush(stdout);
-                               goto retry;
-                       } else if (strcmp(tbuff, "bye") == 0) {
-                               wrapup(1);
-                       } else if (tbuff[0] == 'n') {
-                               wrong = 0;
-                               printf("\nOK.  Lesson %s (%d)\n", todo, speed);
-                               printf("Skipping to next lesson.\n\n");
-                               fflush(stdout);
-                               break;
-                       } else {
-                               printf("Please type yes, no or bye:  ");
-                               fflush(stdout);
-                       }
-               }
-       }
-       setdid(todo, sequence++);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/learn/lcount.c b/.ref-Research-V7/usr/src/cmd/learn/lcount.c
deleted file mode 100644 (file)
index 110d827..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "stdio.h"
-
-main() /* count lines in something */
-{
-       register n, c;
-
-       n = 0;
-       while ((c = getchar()) != EOF)
-               if (c == '\n')
-                       n++;
-       printf("%d\n", n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/learn.c b/.ref-Research-V7/usr/src/cmd/learn/learn.c
deleted file mode 100644 (file)
index 3080f3f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "stdio.h"
-#include "lrndef"
-#include "lrnref"
-#include "signal.h"
-
-main(argc,argv)
-char *argv[];
-{
-       extern hangup(), intrpt();
-       extern char * getlogin();
-       char *malloc();
-
-       speed = 0;
-       more = 1;
-       pwline = getlogin();
-       setbuf(stdout, malloc(BUFSIZ));
-       selsub(argc, argv);
-       signal(SIGHUP, hangup);
-       signal(SIGINT, intrpt);
-       while (more) {
-               selunit();
-               dounit();
-               whatnow();
-       }
-       wrapup(0);
-}
-
-hangup()
-{
-       wrapup(1);
-}
-
-intrpt()
-{
-       char response[20], *p;
-
-       signal(SIGINT, hangup);
-       write(2, "\nInterrupt.\nWant to go on?  ", 28);
-       p = response;
-       *p = 'n';
-       while (read(0, p, 1) == 1 && *p != '\n')
-               p++;
-       if (response[0] != 'y')
-               wrapup(1);
-       ungetc('\n', stdin);
-       signal(SIGINT, intrpt);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/list.c b/.ref-Research-V7/usr/src/cmd/learn/list.c
deleted file mode 100644 (file)
index 76cf6e8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "stdio.h"
-#include "lrnref"
-#include "signal.h"
-
-int istop;
-
-list(r)
-char *r;
-{
-       int stop(), intrpt();
-       FILE *ft;
-       char s[100];
-
-       if (r==0)
-               return;
-       istop = 1;
-       signal(SIGINT, stop);
-       ft = fopen(r, "r");
-       if (ft != NULL) {
-               while (fgets(s, 100, ft) && istop)
-                       fputs(s, stdout);
-               fclose(ft);
-       }
-       signal(SIGINT, intrpt);
-}
-
-stop()
-{
-       istop=0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/lrndef b/.ref-Research-V7/usr/src/cmd/learn/lrndef
deleted file mode 100644 (file)
index be6b992..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#include       <stdio.h>
-char   *direct = "/usr/lib/learn";     /* CHANGE THIS ON YOUR SYSTEM */
-int    more;
-char   *level;
-int    speed;
-char   *sname;
-char   *todo;
-FILE   *incopy = NULL;
-int    didok;
-int    sequence        = 1;
-int    comfile = -1;
-int    status;
-int    wrong;
-char   *pwline;
-char   *dir;
-FILE   *scrin;
-int    logging = 1;    /* set to 0 to turn off logging */
-int    ask;
diff --git a/.ref-Research-V7/usr/src/cmd/learn/lrnref b/.ref-Research-V7/usr/src/cmd/learn/lrnref
deleted file mode 100644 (file)
index 602c0b2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#define        READY   0
-#define        PRINT   1
-#define        COPYIN  2
-#define        COPYOUT 3
-#define        UNCOPIN 4
-#define        UNCOPOUT        5
-#define        PIPE    6
-#define        UNPIPE  7
-#define        YES     8
-#define        NO      9
-#define        SUCCEED 10
-#define        FAIL    11
-#define        BYE     12
-#define        LOG     13
-#define        CHDIR   14
-#define        LEARN   15
-#define        MV      16
-#define        USER    17
-#define        NEXT    18
-#define        SKIP    19
-#define        WHERE   20
-#define        MATCH   21
-#define        NOP     22
-#define        BAD     23
-#define        CREATE  24
-#define        CMP     25
-#define        GOTO    26
-#define        ONCE    27
-
-extern int     more;
-extern char    *level;
-extern int     speed;
-extern char    *sname;
-extern char    *direct;
-extern char    *todo;
-extern int     didok;
-extern int     sequence;
-extern int     comfile;
-extern int     status;
-extern int     wrong;
-extern char    *pwline;
-extern char    *dir;
-extern FILE    *incopy;
-extern FILE    *scrin;
-extern int     logging;
-extern int     ask;
diff --git a/.ref-Research-V7/usr/src/cmd/learn/makefile b/.ref-Research-V7/usr/src/cmd/learn/makefile
deleted file mode 100644 (file)
index 43efc11..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-LESSONS = files editor morefiles macros eqn C
-
-FILES = lrndef lrnref \
-       copy.c dounit.c learn.c list.c \
-       makpipe.c maktee.c mem.c mysys.c selsub.c selunit.c \
-       start.c whatnow.c wrapup.c \
-       lcount.c tee.c \
-       makefile
-
-OBJECTS = copy.o dounit.o learn.o list.o mem.o \
-       makpipe.o maktee.o mysys.o selsub.o selunit.o \
-       start.o whatnow.o wrapup.o
-
-CFLAGS = -O
-LIBRARY =
-LLIB   = /usr/lib/learn
-
-cp:    all
-       cp learn /bin
-       cp tee $(LLIB)
-       cp lcount $(LLIB)
-       rm learn tee lcount *.o
-       @echo "Now do 'make lessons' if you need to extract the lesson archives"
-       @echo "Then do 'make play; make log' to make playpen and log directories"
-
-cmp:   all
-       cmp learn /bin/learn
-       cmp tee $(LLIB)/tee
-       cmp lcount $(LLIB)/lcount
-       rm learn tee lcount *.o
-
-all:   learn tee lcount
-
-learn: $(OBJECTS)
-       cc -n -s -o learn $(CFLAGS) $(OBJECTS) $(LIBRARY)
-
-$(OBJECTS): lrnref
-learn.o: lrndef
-
-lcount tee:
-       cc $(CFLAGS) -s -n $@.c -o $@ $(LIBRARY)
-
-lessons:       $(LESSONS)
-
-$(LESSONS):
-       -rm -r $(LLIB)/$@
-       mkdir $(LLIB)/$@
-       (cd $(LLIB)/$@; ar x ../$@.a)
-
-play log:
-       -rm -r $(LLIB)/$@; mkdir $(LLIB)/$@; chmod +w $(LLIB)/$@
-
-check:
-       -@test -r $(LLIB)/tee || echo 'tee not present; make tee'
-       -@test -r $(LLIB)/lcount || echo 'lcount not present; make lcount'
-       -@test -r $(LLIB)/play || echo 'play directory not present; make play'
-       -@test -r $(LLIB)/log || echo 'log directory not present; make log'
-       -@for i in $(LESSONS); do test -r $(LLIB)/$$i/L0 || echo $$i not unarchived, make $$i; done
diff --git a/.ref-Research-V7/usr/src/cmd/learn/makpipe.c b/.ref-Research-V7/usr/src/cmd/learn/makpipe.c
deleted file mode 100644 (file)
index 94e09c8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "stdio.h"
-
-makpipe()
-{
-       int f[2];
-
-       pipe(f);
-       if (fork()==0) {
-               close(f[1]);
-               close(0);
-               dup(f[0]);
-               close(f[0]);
-               execl ("/bin/sh", "sh", "-i", 0);
-               execl ("/usr/bin/sh", "sh", "-i", 0);
-               write(2,"Exec error\n",11);
-       }
-       close(f[0]);
-       sleep(2);       /* so shell won't eat up too much input */
-       return(f[1]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/maktee.c b/.ref-Research-V7/usr/src/cmd/learn/maktee.c
deleted file mode 100644 (file)
index 1585ac2..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "stdio.h"
-#include "signal.h"
-#include "lrnref"
-
-static int oldout;
-static char tee[50];
-
-maktee()
-{
-       int fpip[2], in, out;
-
-       if (tee[0] == 0)
-               sprintf(tee, "%s/tee", direct);
-       pipe(fpip);
-       in = fpip[0];
-       out= fpip[1];
-       if (fork() == 0) {
-               signal(SIGINT, SIG_IGN);
-               close(0);
-               close(out);
-               dup(in);
-               close(in);
-               execl (tee, "lrntee", 0);
-               fprintf(stderr, "Tee exec failed\n");
-               exit(1);
-       }
-       close(in);
-       fflush(stdout);
-       oldout = dup(1);
-       close(1);
-       if (dup(out) != 1)
-               fprintf(stderr, "Error making tee for copyout\n");
-       close(out);
-       return(1);
-}
-
-untee()
-{
-       int x;
-
-       fflush(stdout);
-       close(1);
-       dup(oldout);
-       close(oldout);
-       wait(&x);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/mem.c b/.ref-Research-V7/usr/src/cmd/learn/mem.c
deleted file mode 100644 (file)
index b226a8d..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-# include "stdio.h"
-# include "lrnref"
-# define SAME 0
-
-struct keys {
-       char *k_wd;
-       int k_val;
-} keybuff[] = {
-       {"ready",       READY},
-       {"answer",      READY},
-       {"#print",      PRINT},
-       {"#copyin",     COPYIN},
-       {"#uncopyin",   UNCOPIN},
-       {"#copyout",    COPYOUT},
-       {"#uncopyout",  UNCOPOUT},
-       {"#pipe",       PIPE},
-       {"#unpipe",     UNPIPE},
-       {"#succeed",    SUCCEED},
-       {"#fail",       FAIL},
-       {"bye",         BYE},
-       {"chdir",       CHDIR},
-       {"cd",          CHDIR},
-       {"learn",       LEARN},
-       {"#log",        LOG},
-       {"yes",         YES},
-       {"no",          NO},
-       {"#mv",         MV},
-       {"#user",       USER},
-       {"#next",       NEXT},
-       {"skip",        SKIP},
-       {"#where",      WHERE},
-       {"#match",      MATCH},
-       {"#bad",        BAD},
-       {"#create",     CREATE},
-       {"#cmp",        CMP},
-       {"#goto",       GOTO},
-       {"#once",       ONCE},
-       {"#",           NOP},
-       {NULL,          0}
-};
-
-int *action(s)
-char *s;
-{
-       struct keys *kp;
-       for (kp=keybuff; kp->k_wd; kp++)
-               if (strcmp(kp->k_wd, s) == SAME)
-                       return(&(kp->k_val));
-       return(NULL);
-}
-
-# define NW 100
-# define NWCH 800
-struct whichdid {
-       char *w_less;
-       int w_seq;
-} which[NW];
-int nwh = 0;
-char whbuff[NWCH];
-char *whcp = whbuff;
-
-setdid(lesson, sequence)
-char *lesson;
-{
-       struct whichdid *pw;
-       for(pw=which; pw < which+nwh; pw++)
-               if (strcmp(pw->w_less, lesson) == SAME)
-                       {
-                       pw->w_seq = sequence;
-                       return;
-                       }
-       pw=which+nwh++;
-       if (nwh >= NW) {
-               fprintf(stderr, "nwh>=NW\n");
-               wrapup(1);
-       }
-       pw->w_seq = sequence;
-       pw->w_less = whcp;
-       while (*whcp++ = *lesson++);
-       if (whcp >= whbuff + NWCH) {
-               fprintf(stderr, "lesson name too long\n");
-               wrapup(1);
-       }
-}
-
-already(lesson, sequence)
-char *lesson;
-{
-       struct whichdid *pw;
-       for (pw=which; pw < which+nwh; pw++)
-               if (strcmp(pw->w_less, lesson) == SAME)
-                       return(1);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/mysys.c b/.ref-Research-V7/usr/src/cmd/learn/mysys.c
deleted file mode 100644 (file)
index 77b4a2e..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#include "stdio.h"
-#include "signal.h"
-
-#define        EASY    1
-#define        MEDIUM  2
-#define        HARD    3
-
-mysys(s)
-char *s;
-{
-       /* like "system" but rips off "mv", etc.*/
-       /* also tries to guess if can get away with exec cmd */
-       /* instead of sh cmd */
-       char p[300];
-       char *np[40];
-       register char *t;
-       int nv, type, stat;
-
-       type = EASY;    /* we hope */
-       for (t = s; *t && type != HARD; t++) {
-               switch (*t) {
-               case '*': 
-               case '[': 
-               case '?': 
-               case '>': 
-               case '<': 
-               case '$':
-               case '\'':
-               case '"':
-                       type = MEDIUM;
-                       break;
-               case '|': 
-               case ';': 
-               case '&':
-                       type = HARD;
-                       break;
-               }
-       }
-       switch (type) {
-       case HARD:
-               return(system(s));
-       case MEDIUM:
-               strcpy(p, "exec ");
-               strcat(p, s);
-               return(system(p));
-       case EASY:
-               strcpy(p,s);
-               nv = getargs(p, np);
-               t=np[0];
-               if ((strcmp(t, "mv") == 0)||
-                   (strcmp(t, "cp") == 0)||
-                   (strcmp(t, "rm") == 0)||
-                   (strcmp(t, "ls") == 0) ) {
-                       if (fork() == 0) {
-                               char b[100];
-                               signal(SIGINT, SIG_DFL);
-                               strcpy(b, "/bin/");
-                               strcat(b, t);
-                               np[nv] = 0;
-                               execv(b, np);
-                               fprintf(stderr, "Execv failed\n");
-                               exit(1);
-                       }
-                       wait(&stat);
-                       return(stat);
-               }
-               return(system(s));
-       }
-}
-
-/*
- * system():
- *     same as library version, except that resets
- *     default handling of signals in child, so that
- *     user gets the behavior he expects.
- */
-
-system(s)
-char *s;
-{
-       int status, pid, w;
-       register int (*istat)(), (*qstat)();
-
-       istat = signal(SIGINT, SIG_IGN);
-       qstat = signal(SIGQUIT, SIG_IGN);
-       if ((pid = fork()) == 0) {
-               signal(SIGINT, SIG_DFL);
-               signal(SIGQUIT, SIG_DFL);
-               execl("/bin/sh", "sh", "-c", s, 0);
-               _exit(127);
-       }
-       while ((w = wait(&status)) != pid && w != -1)
-               ;
-       if (w == -1)
-               status = -1;
-       signal(SIGINT, istat);
-       signal(SIGQUIT, qstat);
-       return(status);
-}
-
-getargs(s, v)
-char *s, **v;
-{
-       int i;
-
-       i = 0;
-       for (;;) {
-               v[i++]=s;
-               while (*s != 0 && *s!=' '&& *s != '\t')
-                       s++;
-               if (*s == 0)
-                       break;
-               *s++ =0;
-               while (*s == ' ' || *s == '\t')
-                       s++;
-               if (*s == 0)
-                       break;
-       }
-       return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/selsub.c b/.ref-Research-V7/usr/src/cmd/learn/selsub.c
deleted file mode 100644 (file)
index 0685a5f..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "stdio.h"
-#include "lrnref"
-
-selsub(argc,argv)
-char *argv[];
-{
-       char ans1[100], *cp;
-       static char ans2[30];
-       static char dirname[20];
-       static char subname[20];
-
-       if (argc > 1 && argv[1][0] == '-') {
-               direct = argv[1]+1;
-               argc--;
-               argv++;
-       }
-       chknam(direct);
-       if (chdir(direct) != 0) {
-               fprintf(stderr, "can't cd to %s\,", direct);
-               exit(1);
-       }
-       sname = argc > 1 ? argv[1] : 0;
-       if (argc > 2)
-               strcpy (level=ans2, argv[2]);
-       else
-               level = 0;
-       if (argc > 3 )
-               speed = atoi(argv[3]);
-       if (!sname) {
-               printf("These are the available courses -\n");
-               list("Linfo");
-               printf("If you want more information about the courses,\n");
-               printf("or if you have never used 'learn' before,\n");
-               printf("type 'return'; otherwise type the name of\n");
-               printf("the course you want, followed by 'return'.\n");
-               fflush(stdout);
-               gets(sname=subname);
-               if (sname[0] == '\0') {
-                       list("Xinfo");
-                       do {
-                               printf("\nWhich subject?  ");
-                               fflush(stdout);
-                               gets(sname=subname);
-                       } while (sname[0] == '\0');
-               }
-       }
-       chknam(sname);
-       if (!level) {
-               printf("If you were in the middle of this subject\n");
-               printf("and want to start where you left off, type\n");
-               printf("the last lesson number the computer printed.\n");
-               printf("To start at the beginning, just hit return.\n");
-               fflush(stdout);
-               gets(ans2);
-               if (ans2[0]==0)
-                       strcpy(ans2,"0");
-               for (cp=ans2; *cp; cp++)
-                       if (*cp == '(' || *cp == ' ')
-                               *cp= 0;
-               level=ans2;
-       }
-
-       /* make new directory for user to play in */
-       if (chdir("play") != 0) {
-               fprintf(stderr, "can't cd to playpen\n");
-               exit(1);
-       }
-       sprintf(dir=dirname, "pl%da", getpid());
-       sprintf(ans1, "mkdir %s", dir);
-       system(ans1);
-       if (chdir(dir) < 0) {
-               fprintf(stderr, "Couldn't create working directory.\nBye.\n");
-               exit(1);
-       }
-       /* after this point, we have a working directory. */
-       /* have to call wrapup to clean up */
-       if (access(sprintf(ans1, "%s/%s/Init", direct, sname), 04)==0)
-               if (system(sprintf(ans1, "%s/%s/Init %s", direct,sname, level)) != 0) {
-                       printf("Leaving learn.\n");
-                       wrapup(1);
-               }
-       if (level[0] == '-')    /* no lesson names start with - */
-               ask = 1;
-       start(level);
-}
-
-chknam(name)
-char *name;
-{
-       if (access(name, 05) < 0) {
-               printf("Sorry, there is no subject or lesson named %s.\nBye.\n", name);
-               exit(1);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/selunit.c b/.ref-Research-V7/usr/src/cmd/learn/selunit.c
deleted file mode 100644 (file)
index ed5d1c9..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#include "stdio.h"
-#include "lrnref"
-
-int    nsave   = 0;
-
-selunit()
-{
-       char fnam[20], s[50];
-       static char dobuff[50];
-       char posslev[20][20];
-       int diff[20], i, k, m, n, best, alts;
-       FILE *f;
-       char zb[200];
-       static char saved[20];
-
-       while (ask) {
-               printf("What lesson? ");
-               fflush(stdout);
-               gets(dobuff);
-               if (strcmp(dobuff, "bye") == 0)
-                       wrapup(0);
-               level = todo = dobuff;
-               sprintf(s, "../../%s/L%s", sname, dobuff);
-               if (access(s, 04) == 0)
-                       return;
-               printf("no such lesson\n");
-       }
-       alts = 0;
-retry:
-       f=scrin;
-       if (f==NULL) {
-               sprintf(fnam, "../../%s/L%s", sname, level);
-               f = fopen(fnam, "r");
-               if (f==NULL) {
-                       fprintf(stderr, "No script for lesson %s.\n", level);
-                       wrapup(1);
-               }
-               while (fgets(zb, 200, f)) {
-                       trim(zb);
-                       if (strcmp(zb, "#next")==0)
-                               break;
-               }
-       }
-       if (feof(f)) {
-               printf("Congratulations; you have finished this sequence.\n");
-               fflush(stdout);
-               todo = 0;
-               return;
-       }
-       for(i=0; fgets(s, 50, f); i++) {
-               sscanf(s, "%s %d", posslev[i], &diff[i]);
-       }
-       best = -1;
-       /* cycle through lessons from random start */
-       /* first try the current place, failing that back up to
-            last place there are untried alternatives (but only one backup) */
-       n = grand()%i;
-       for(k=0; k<i; k++) {
-               m = (n+k)%i;
-               if (already(posslev[m],0)) continue;
-               if (best<0) best=m;
-               /* real alternatives */
-               alts++;
-               if (abs(diff[m]-speed) < abs(diff[best]-speed))
-                       best=m;
-       }
-       if (best < 0 && nsave) {
-               nsave--;
-               strcpy(level, saved);
-               goto retry;
-       }
-       if (best <0) {
-               /* lessons exhausted or missing */
-               printf("Sorry, there are no alternative lessons at this stage.\n");
-               printf("See someone for help.\n");
-               fflush(stdout);
-               todo = 0;
-               return;
-       }
-       strcpy (dobuff, posslev[best]);
-       if (alts>1) {
-               nsave=1;
-               strcpy (saved, level);
-       }
-       todo = dobuff;
-       fclose(f);
-}
-
-abs(x)
-{
-       return(x>=0? x: -x);
-}
-
-grand()
-{
-       static int garbage;
-       int a[2], b;
-
-       time(a);
-       b = a[1]+10*garbage++;
-       return(b&077777);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/start.c b/.ref-Research-V7/usr/src/cmd/learn/start.c
deleted file mode 100644 (file)
index 4c6d36b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "stdio.h"
-#include "lrnref"
-#define        ND      64
-
-start(lesson)
-char *lesson;
-{
-       struct direct {
-               int inode; 
-               char name[14];
-       };
-       struct direct dv[ND], *dm, *dp;
-       int f, c, n;
-       char where [100];
-
-       f = open(".", 0);
-       n = read(f, dv, ND*sizeof(*dp));
-       n /= sizeof(*dp);
-       if (n==ND)
-               fprintf(stderr, "lesson too long\n");
-       dm = dv+n;
-       for(dp=dv; dp<dm; dp++)
-               if (dp->inode) {
-                       n = strlen(dp->name);
-                       if (dp->name[n-2] == '.' && dp->name[n-1] == 'c')
-                               continue;
-                       c = dp->name[0];
-                       if (c>='a' && c<= 'z')
-                               unlink(dp->name);
-               }
-       close(f);
-       if (ask)
-               return;
-       sprintf(where, "../../%s/L%s", sname, lesson);
-       if (access(where, 04)==0)       /* there is a file */
-               return;
-       fprintf(stderr, "No lesson %s\n",lesson);
-       wrapup(1);
-}
-
-fcopy(new,old)
-char *new, *old;
-{
-       char b[512];
-       int n, fn, fo;
-       fn = creat(new, 0666);
-       fo = open(old,0);
-       if (fo<0) return;
-       if (fn<0) return;
-       while ( (n=read(fo, b, 512)) > 0)
-               write(fn, b, n);
-       close(fn);
-       close(fo);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/tee.c b/.ref-Research-V7/usr/src/cmd/learn/tee.c
deleted file mode 100644 (file)
index e75c497..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-main()
-{
-       int f, c;
-
-       f = creat(".ocopy", 0666);
-       while (read(0, &c, 1) == 1) {
-               write (1, &c, 1);
-               put(c, f);
-       }
-       fl(f);
-       close(f);
-}
-
-static char ln[512];
-char *p = ln;
-put(c, f)
-{
-       *p++ = c;
-       if (c == '\n') {
-               fl(f);
-               p=ln;
-       }
-}
-fl(f)
-{
-       register char *s;
-
-       s = ln;
-       while (*s == '$' && *(s+1) == ' ')
-               s += 2;
-       write(f, s, p-s);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/whatnow.c b/.ref-Research-V7/usr/src/cmd/learn/whatnow.c
deleted file mode 100644 (file)
index 7a61164..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#include "stdio.h"
-#include "lrnref"
-
-whatnow()
-{
-       if (todo == 0) {
-               more=0;
-               return;
-       }
-       if (didok) {
-               strcpy(level,todo);
-               if (speed<=9) speed++;
-       }
-       else {
-               speed -= 4;
-               /* the 4 above means that 4 right, one wrong leave
-                   you with the same speed. */
-               if (speed <0) speed=0;
-       }
-       if (wrong) {
-               speed -= 2;
-               if (speed <0 ) speed = 0;
-       }
-       if (didok && more) {
-               printf("\nGood.  Lesson %s (%d)\n\n",level, speed);
-               fflush(stdout);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/learn/wrapup.c b/.ref-Research-V7/usr/src/cmd/learn/wrapup.c
deleted file mode 100644 (file)
index cdf44cc..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "signal.h"
-#include "stdio.h"
-#include "lrnref"
-
-wrapup(n)
-int n;
-{
-       /* this routine does not use 'system' because it wants
-        interrupts turned off */
-       int retval, pid, pidw;
-
-       signal(SIGINT, SIG_IGN);
-       chdir("..");
-       if ( (pid=fork()) ==0) {
-               signal(SIGHUP, SIG_IGN);
-               execl("/bin/rm", "rm", "-r", dir, 0);
-               execl("/usr/bin/rm", "rm", "-r", dir, 0);
-               fprintf(stderr, "Can't find 'rm' command.\n");
-               exit(0);
-       }
-       printf("Bye.\n"); /* not only does this reassure user but 
-                       it stalls for time while deleting directory */
-       fflush(stdout);
-       /* printf("Wantd %d got %d val %d\n",pid, pidw, retval); */
-       exit(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lex/header.c b/.ref-Research-V7/usr/src/cmd/lex/header.c
deleted file mode 100644 (file)
index 1e9561c..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-# include "ldefs.c"
-phead1(){
-       ratfor ? rhd1() : chd1();
-       }
-
-chd1(){
-       fprintf(fout,"# include \"stdio.h\"\n");
-       if (ZCH>NCH)
-       fprintf(fout, "# define U(x) ((x)&0377)\n");
-       else
-       fprintf(fout, "# define U(x) x\n");
-       fprintf(fout, "# define NLSTATE yyprevious=YYNEWLINE\n");
-       fprintf(fout,"# define BEGIN yybgin = yysvec + 1 +\n");
-       fprintf(fout,"# define INITIAL 0\n");
-       fprintf(fout,"# define YYLERR yysvec\n");
-       fprintf(fout,"# define YYSTATE (yyestate-yysvec-1)\n");
-       if(optim)
-               fprintf(fout,"# define YYOPTIM 1\n");
-# ifdef DEBUG
-       fprintf(fout,"# define LEXDEBUG 1\n");
-# endif
-       fprintf(fout,"# define YYLMAX 200\n");
-       fprintf(fout,"# define output(c) putc(c,yyout)\n");
-       fprintf(fout, "%s%d%s\n",
-  "# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==",
-       ctable['\n'],
- "?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)");
-       fprintf(fout,
-"# define unput(c) {yytchar= (c);if(yytchar=='\\n')yylineno--;*yysptr++=yytchar;}\n");
-       fprintf(fout,"# define yymore() (yymorfg=1)\n");
-       fprintf(fout,"# define ECHO fprintf(yyout, \"%%s\",yytext)\n");
-       fprintf(fout,"# define REJECT { nstr = yyreject(); goto yyfussy;}\n");
-       fprintf(fout,"int yyleng; extern char yytext[];\n");
-       fprintf(fout,"int yymorfg;\n");
-       fprintf(fout,"extern char *yysptr, yysbuf[];\n");
-       fprintf(fout,"int yytchar;\n");
-       fprintf(fout,"FILE *yyin ={stdin}, *yyout ={stdout};\n");
-       fprintf(fout,"extern int yylineno;\n");
-       fprintf(fout,"struct yysvf { \n");
-       fprintf(fout,"\tstruct yywork *yystoff;\n");
-       fprintf(fout,"\tstruct yysvf *yyother;\n");
-       fprintf(fout,"\tint *yystops;};\n");
-       fprintf(fout,"struct yysvf *yyestate;\n");
-       fprintf(fout,"extern struct yysvf yysvec[], *yybgin;\n");
-       }
-
-rhd1(){
-       fprintf(fout,"integer function yylex(dummy)\n");
-       fprintf(fout,"define YYLMAX 200\n");
-       fprintf(fout,"define ECHO call yyecho(yytext,yyleng)\n");
-       fprintf(fout,"define REJECT nstr = yyrjct(yytext,yyleng);goto 30998\n");
-       fprintf(fout,"integer nstr,yylook,yywrap\n");
-       fprintf(fout,"integer yyleng, yytext(YYLMAX)\n");
-       fprintf(fout,"common /yyxel/ yyleng, yytext\n");
-       fprintf(fout,"common /yyldat/ yyfnd, yymorf, yyprev, yybgin, yylsp, yylsta\n");
-       fprintf(fout,"integer yyfnd, yymorf, yyprev, yybgin, yylsp, yylsta(YYLMAX)\n");
-       fprintf(fout,"for(;;){\n");
-       fprintf(fout,"\t30999 nstr = yylook(dummy)\n");
-       fprintf(fout,"\tgoto 30998\n");
-       fprintf(fout,"\t30000 k = yywrap(dummy)\n");
-       fprintf(fout,"\tif(k .ne. 0){\n");
-       fprintf(fout,"\tyylex=0; return; }\n");
-       fprintf(fout,"\t\telse goto 30998\n");
-       }
-
-phead2(){
-       if(!ratfor)chd2();
-       }
-
-chd2(){
-       fprintf(fout,"while((nstr = yylook()) >= 0)\n");
-       fprintf(fout,"yyfussy: switch(nstr){\n");
-       fprintf(fout,"case 0:\n");
-       fprintf(fout,"if(yywrap()) return(0); break;\n");
-       }
-
-ptail(){
-       if(!pflag)
-               ratfor ? rtail() : ctail();
-       pflag = 1;
-       }
-
-ctail(){
-       fprintf(fout,"case -1:\nbreak;\n");             /* for reject */
-       fprintf(fout,"default:\n");
-       fprintf(fout,"fprintf(yyout,\"bad switch yylook %%d\",nstr);\n");
-       fprintf(fout,"} return(0); }\n");
-       fprintf(fout,"/* end of yylex */\n");
-       }
-
-rtail(){
-       register int i;
-       fprintf(fout,"\n30998 if(nstr .lt. 0 .or. nstr .gt. %d)goto 30999\n",casecount);
-       fprintf(fout,"nstr = nstr + 1\n");
-       fprintf(fout,"goto(\n");
-       for(i=0; i<casecount; i++)
-               fprintf(fout,"%d,\n",30000+i);
-       fprintf(fout,"30999),nstr\n");
-       fprintf(fout,"30997 continue\n");
-       fprintf(fout,"}\nend\n");
-       }
-statistics(){
-       fprintf(errorf,"%d/%d nodes(%%e), %d/%d positions(%%p), %d/%d (%%n), %ld transitions\n",
-               tptr, treesize, nxtpos-positions, maxpos, stnum+1, nstates, rcount);
-       fprintf(errorf, ", %d/%d packed char classes(%%k)", pcptr-pchar, pchlen);
-       if(optim)fprintf(errorf,", %d/%d packed transitions(%%a)",nptr, ntrans);
-       fprintf(errorf, ", %d/%d output slots(%%o)", yytop, outsize);
-       putc('\n',errorf);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/lex/ldefs.c b/.ref-Research-V7/usr/src/cmd/lex/ldefs.c
deleted file mode 100644 (file)
index f874c87..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-# include <stdio.h>
-# define PP 1
-# ifdef unix
-
-# define CWIDTH 7
-# define CMASK 0177
-# define ASCII 1
-# endif
-
-# ifdef gcos
-# define CWIDTH 9
-# define CMASK 0777
-# define ASCII 1
-# endif
-
-# ifdef ibm
-# define CWIDTH 8
-# define CMASK 0377
-# define EBCDIC 1
-# endif
-
-# ifdef ASCII
-# define NCH 128
-# endif
-
-# ifdef EBCDIC
-# define NCH 256
-# endif
-
-
-# define TOKENSIZE 1000
-# define DEFSIZE 40
-# define DEFCHAR 1000
-# define STARTCHAR 100
-# define STARTSIZE 256
-# define CCLSIZE 1000
-# ifdef SMALL
-# define TREESIZE 600
-# define NTRANS 1500
-# define NSTATES 300
-# define MAXPOS 1500
-# define NOUTPUT 1500
-# endif
-
-# ifndef SMALL
-# define TREESIZE 1000
-# define NSTATES 500
-# define MAXPOS 2500
-# define NTRANS 2000
-# define NOUTPUT 3000
-# endif
-# define NACTIONS 100
-# define ALITTLEEXTRA 30
-
-# define RCCL NCH+90
-# define RNCCL NCH+91
-# define RSTR NCH+92
-# define RSCON NCH+93
-# define RNEWE NCH+94
-# define FINAL NCH+95
-# define RNULLS NCH+96
-# define RCAT NCH+97
-# define STAR NCH+98
-# define PLUS NCH+99
-# define QUEST NCH+100
-# define DIV NCH+101
-# define BAR NCH+102
-# define CARAT NCH+103
-# define S1FINAL NCH+104
-# define S2FINAL NCH+105
-
-# define DEFSECTION 1
-# define RULESECTION 2
-# define ENDSECTION 5
-# define TRUE 1
-# define FALSE 0
-
-# define PC 1
-# define PS 1
-
-# ifdef DEBUG
-# define LINESIZE 110
-extern int yydebug;
-extern int debug;              /* 1 = on */
-extern int charc;
-# endif
-
-# ifndef DEBUG
-# define freturn(s) s
-# endif
-
-extern int sargc;
-extern char **sargv;
-extern char buf[520];
-extern int ratfor;             /* 1 = ratfor, 0 = C */
-extern int yyline;             /* line number of file */
-extern int sect;
-extern int eof;
-extern int lgatflg;
-extern int divflg;
-extern int funcflag;
-extern int pflag;
-extern int casecount;
-extern int chset;      /* 1 = char set modified */
-extern FILE *fin, *fout, *fother, *errorf;
-extern int fptr;
-extern char *ratname, *cname;
-extern int prev;       /* previous input character */
-extern int pres;       /* present input character */
-extern int peek;       /* next input character */
-extern int *name;
-extern int *left;
-extern int *right;
-extern int *parent;
-extern char *nullstr;
-extern int tptr;
-extern char pushc[TOKENSIZE];
-extern char *pushptr;
-extern char slist[STARTSIZE];
-extern char *slptr;
-extern char **def, **subs, *dchar;
-extern char **sname, *schar;
-extern char *ccl;
-extern char *ccptr;
-extern char *dp, *sp;
-extern int dptr, sptr;
-extern char *bptr;             /* store input position */
-extern char *tmpstat;
-extern int count;
-extern int **foll;
-extern int *nxtpos;
-extern int *positions;
-extern int *gotof;
-extern int *nexts;
-extern char *nchar;
-extern int **state;
-extern int *sfall;             /* fallback state num */
-extern char *cpackflg;         /* true if state has been character packed */
-extern int *atable, aptr;
-extern int nptr;
-extern char symbol[NCH];
-extern char cindex[NCH];
-extern int xstate;
-extern int stnum;
-extern int ctable[];
-extern int ZCH;
-extern int ccount;
-extern char match[NCH];
-extern char extra[NACTIONS];
-extern char *pcptr, *pchar;
-extern int pchlen;
-extern int nstates, maxpos;
-extern int yytop;
-extern int report;
-extern int ntrans, treesize, outsize;
-extern long rcount;
-extern int optim;
-extern int *verify, *advance, *stoff;
-extern int scon;
-extern char *psave;
-extern char *calloc(), *myalloc();
-extern int buserr(), segviol();
diff --git a/.ref-Research-V7/usr/src/cmd/lex/lib/allprint.c b/.ref-Research-V7/usr/src/cmd/lex/lib/allprint.c
deleted file mode 100644 (file)
index 238cade..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-# include <stdio.h>
-allprint(c)
-  char c; {
-       extern FILE *yyout;
-       switch(c){
-               case '\n':
-                       fprintf(yyout,"\\n");
-                       break;
-               case '\t':
-                       fprintf(yyout,"\\t");
-                       break;
-               case '\b':
-                       fprintf(yyout,"\\b");
-                       break;
-               case ' ':
-                       fprintf(yyout,"\\\bb");
-                       break;
-               default:
-                       if(!printable(c))
-                               fprintf(yyout,"\\%-3o",c);
-                       else 
-                               putc(c,yyout);
-                       break;
-               }
-       return;
-       }
-sprint(s)
-  char *s; {
-       while(*s)
-               allprint(*s++);
-       return;
-       }
-printable(c)
-  int c;
-       {
-       return(040 < c && c < 0177);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/lex/lib/main.c b/.ref-Research-V7/usr/src/cmd/lex/lib/main.c
deleted file mode 100644 (file)
index 123b665..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# include "stdio.h"
-main(){
-yylex();
-exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lex/lib/reject.c b/.ref-Research-V7/usr/src/cmd/lex/lib/reject.c
deleted file mode 100644 (file)
index 7fa9282..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# include <stdio.h>
-extern struct {int *yyaa, *yybb; int *yystops;} *yylstate [], **yylsp, **yyolsp;
-yyreject ()
-{
-extern FILE *yyout, *yyin;
-extern int yyprevious , *yyfnd;
-extern char yyextra[];
-extern char yytext[];
-extern int yyleng;
-for( ; yylsp < yyolsp; yylsp++)
-       yytext[yyleng++] = yyinput();
-if (*yyfnd > 0)
-       return(yyracc(*yyfnd++));
-while (yylsp-- > yylstate)
-       {
-       yyunput(yytext[yyleng-1]);
-       yytext[--yyleng] = 0;
-       if (*yylsp != 0 && (yyfnd= (*yylsp)->yystops) && *yyfnd > 0)
-               return(yyracc(*yyfnd++));
-       }
-if (yytext[0] == 0)
-       return(0);
-yyoutput(yyprevious = yyinput());
-yyleng=0;
-return(-1);
-}
-yyracc(m)
-{
-yyolsp = yylsp;
-if (yyextra[m])
-       {
-       while (yyback((*yylsp)->yystops, -m) != 1 && yylsp>yylstate)
-               {
-               yylsp--;
-               yyunput(yytext[--yyleng]);
-               }
-       }
-yyprevious = yytext[yyleng-1];
-yytext[yyleng] = 0;
-return(m);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lex/lib/yyless.c b/.ref-Research-V7/usr/src/cmd/lex/lib/yyless.c
deleted file mode 100644 (file)
index 5914bd9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-yyless(x)
-{
-extern char yytext[];
-register char *lastch, *ptr;
-extern int yyleng;
-extern int yyprevious;
-lastch = yytext+yyleng;
-if (x>=0 && x <= yyleng)
-       ptr = x + yytext;
-else
-       ptr = x;
-while (lastch > ptr)
-       yyunput(*--lastch);
-*lastch = 0;
-if (ptr >yytext)
-       yyprevious = *--lastch;
-yyleng = ptr-yytext;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lex/lib/yywrap.c b/.ref-Research-V7/usr/src/cmd/lex/lib/yywrap.c
deleted file mode 100644 (file)
index 0866993..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-yywrap()
-{
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lex/lmain.c b/.ref-Research-V7/usr/src/cmd/lex/lmain.c
deleted file mode 100644 (file)
index 7f6f663..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-# include "ldefs.c"
-# include "once.c"
-
-       /* lex [-[drcyvntf]] [file] ... [file] */
-
-       /* Copyright 1976, Bell Telephone Laboratories, Inc.,
-           written by Eric Schmidt, August 27, 1976   */
-
-main(argc,argv)
-  int argc;
-  char **argv; {
-       register int i;
-# ifdef DEBUG
-       signal(10,buserr);
-       signal(11,segviol);
-# endif
-       while (argc > 1 && argv[1][0] == '-' ){
-               i = 0;
-               while(argv[1][++i]){
-                       switch (argv[1][i]){
-# ifdef DEBUG
-                               case 'd': debug++; break;
-                               case 'y': yydebug = TRUE; break;
-# endif
-                               case 'r': case 'R':
-                                       ratfor=TRUE; break;
-                               case 'c': case 'C':
-                                       ratfor=FALSE; break;
-                               case 't': case 'T':
-                                       fout = stdout;
-                                       errorf = stderr;
-                                       break;
-                               case 'v': case 'V':
-                                       report = 1;
-                                       break;
-                               case 'f': case 'F':
-                                       optim = FALSE;
-                                       break;
-                               case 'n': case 'N':
-                                       report = 0;
-                                       break;
-                               default:
-                                       warning("Unknown option %c",argv[1][i]);
-                               }
-                       }
-               argc--;
-               argv++;
-               }
-       sargc = argc;
-       sargv = argv;
-       if (argc > 1){
-               fin = fopen(argv[++fptr], "r");         /* open argv[1] */
-               sargc--;
-               sargv++;
-               }
-       else fin = stdin;
-       if(fin == NULL)
-               error ("Can't read input file %s",argc>1?argv[1]:"standard input");
-       gch();
-               /* may be gotten: def, subs, sname, schar, ccl, dchar */
-       get1core();
-               /* may be gotten: name, left, right, nullstr, parent */
-       scopy("INITIAL",sp);
-       sname[0] = sp;
-       sp =+ slength("INITIAL") + 1;
-       sname[1] = 0;
-       if(yyparse(0)) exit(1); /* error return code */
-               /* may be disposed of: def, subs, dchar */
-       free1core();
-               /* may be gotten: tmpstat, foll, positions, gotof, nexts, nchar, state, atable, sfall, cpackflg */
-       get2core();
-       ptail();
-       mkmatch();
-# ifdef DEBUG
-       if(debug) pccl();
-# endif
-       sect  = ENDSECTION;
-       if(tptr>0)cfoll(tptr-1);
-# ifdef DEBUG
-       if(debug)pfoll();
-# endif
-       cgoto();
-# ifdef DEBUG
-       if(debug){
-               printf("Print %d states:\n",stnum+1);
-               for(i=0;i<=stnum;i++)stprt(i);
-               }
-# endif
-               /* may be disposed of: positions, tmpstat, foll, state, name, left, right, parent, ccl, schar, sname */
-               /* may be gotten: verify, advance, stoff */
-       free2core();
-       get3core();
-       layout();
-               /* may be disposed of: verify, advance, stoff, nexts, nchar,
-                       gotof, atable, ccpackflg, sfall */
-# ifdef DEBUG
-       free3core();
-# endif
-       if (ZCH>NCH) cname="/usr/lib/lex/ebcform";
-       fother = fopen(ratfor?ratname:cname,"r");
-       if(fother == NULL)
-               error("Lex driver missing, file %s",ratfor?ratname:cname);
-       while ( (i=getc(fother)) != EOF)
-               putc(i,fout);
-
-       fclose(fother);
-       fclose(fout);
-       if(
-# ifdef DEBUG
-               debug   ||
-# endif
-                       report == 1)statistics();
-       fclose(stdout);
-       fclose(stderr);
-       exit(0);        /* success return code */
-       }
-get1core(){
-       register int i, val;
-       register char *p;
-ccptr =        ccl = myalloc(CCLSIZE,sizeof(*ccl));
-pcptr = pchar = myalloc(pchlen, sizeof(*pchar));
-       def = myalloc(DEFSIZE,sizeof(*def));
-       subs = myalloc(DEFSIZE,sizeof(*subs));
-dp =   dchar = myalloc(DEFCHAR,sizeof(*dchar));
-       sname = myalloc(STARTSIZE,sizeof(*sname));
-sp =   schar = myalloc(STARTCHAR,sizeof(*schar));
-       if(ccl == 0 || def == 0 || subs == 0 || dchar == 0 || sname == 0 || schar == 0)
-               error("Too little core to begin");
-       }
-free1core(){
-       cfree(def,DEFSIZE,sizeof(*def));
-       cfree(subs,DEFSIZE,sizeof(*subs));
-       cfree(dchar,DEFCHAR,sizeof(*dchar));
-       }
-get2core(){
-       register int i, val;
-       register char *p;
-       gotof = myalloc(nstates,sizeof(*gotof));
-       nexts = myalloc(ntrans,sizeof(*nexts));
-       nchar = myalloc(ntrans,sizeof(*nchar));
-       state = myalloc(nstates,sizeof(*state));
-       atable = myalloc(nstates,sizeof(*atable));
-       sfall = myalloc(nstates,sizeof(*sfall));
-       cpackflg = myalloc(nstates,sizeof(*cpackflg));
-       tmpstat = myalloc(tptr+1,sizeof(*tmpstat));
-       foll = myalloc(tptr+1,sizeof(*foll));
-nxtpos = positions = myalloc(maxpos,sizeof(*positions));
-       if(tmpstat == 0 || foll == 0 || positions == 0 ||
-               gotof == 0 || nexts == 0 || nchar == 0 || state == 0 || atable == 0 || sfall == 0 || cpackflg == 0 )
-               error("Too little core for state generation");
-       for(i=0;i<=tptr;i++)foll[i] = 0;
-       }
-free2core(){
-       cfree(positions,maxpos,sizeof(*positions));
-       cfree(tmpstat,tptr+1,sizeof(*tmpstat));
-       cfree(foll,tptr+1,sizeof(*foll));
-       cfree(name,treesize,sizeof(*name));
-       cfree(left,treesize,sizeof(*left));
-       cfree(right,treesize,sizeof(*right));
-       cfree(parent,treesize,sizeof(*parent));
-       cfree(nullstr,treesize,sizeof(*nullstr));
-       cfree(state,nstates,sizeof(*state));
-       cfree(sname,STARTSIZE,sizeof(*sname));
-       cfree(schar,STARTCHAR,sizeof(*schar));
-       cfree(ccl,CCLSIZE,sizeof(*ccl));
-       }
-get3core(){
-       register int i, val;
-       register char *p;
-       verify = myalloc(outsize,sizeof(*verify));
-       advance = myalloc(outsize,sizeof(*advance));
-       stoff = myalloc(stnum+2,sizeof(*stoff));
-       if(verify == 0 || advance == 0 || stoff == 0)
-               error("Too little core for final packing");
-       }
-# ifdef DEBUG
-free3core(){
-       cfree(advance,outsize,sizeof(*advance));
-       cfree(verify,outsize,sizeof(*verify));
-       cfree(stoff,stnum+1,sizeof(*stoff));
-       cfree(gotof,nstates,sizeof(*gotof));
-       cfree(nexts,ntrans,sizeof(*nexts));
-       cfree(nchar,ntrans,sizeof(*nchar));
-       cfree(atable,nstates,sizeof(*atable));
-       cfree(sfall,nstates,sizeof(*sfall));
-       cfree(cpackflg,nstates,sizeof(*cpackflg));
-       }
-# endif
-char *myalloc(a,b)
-  int a,b; {
-       register int i;
-       i = calloc(a, b);
-       if(i==0)
-               warning("OOPS - calloc returns a 0");
-       else if(i == -1){
-# ifdef DEBUG
-               warning("calloc returns a -1");
-# endif
-               return(0);
-               }
-       return(i);
-       }
-# ifdef DEBUG
-buserr(){
-       fflush(errorf);
-       fflush(fout);
-       fflush(stdout);
-       fprintf(errorf,"Bus error\n");
-       if(report == 1)statistics();
-       fflush(errorf);
-       }
-segviol(){
-       fflush(errorf);
-       fflush(fout);
-       fflush(stdout);
-       fprintf(errorf,"Segmentation violation\n");
-       if(report == 1)statistics();
-       fflush(errorf);
-       }
-# endif
-
-yyerror(s)
-char *s;
-{
-       fprintf(stderr, "%s\n", s);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lex/makefile b/.ref-Research-V7/usr/src/cmd/lex/makefile
deleted file mode 100644 (file)
index fc3baf8..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-CFLAGS = -O
-all: lex libln.a
-
-cmp:   all
-       cmp lex /bin/lex
-       ls -l libln.a /lib/libln.a
-       rm -f *.o libln.a lex y.tab.c
-
-cp:    all
-       cp lex /bin/lex
-       cp libln.a /lib
-       rm -f *.o libln.a lex y.tab.c
-
-lex: lmain.o y.tab.o sub1.o sub2.o header.o
-       cc -i -s lmain.o y.tab.o sub1.o sub2.o header.o -o lex
-
-smallex:
-       cc -DSMALL -n -s -O lmain.c y.tab.c sub1.c sub2.c header.c -o smallex
-
-y.tab.c: parser.y
-       yacc parser.y
-
-lmain.o:lmain.c ldefs.c once.c
-       cc -c -O lmain.c
-
-sub1.o: sub1.c ldefs.c
-       cc -c -O sub1.c
-
-sub2.o: sub2.c ldefs.c
-       cc -c -O sub2.c
-
-header.o: header.c ldefs.c
-       cc -c -O header.c
-
-libln.a:
-       cc -c -O lib/allprint.c lib/main.c lib/reject.c lib/yyless.c
-       cc -c -O lib/yywrap.c
-       rm -f libln.a
-       ar rvc libln.a allprint.o main.o reject.o yyless.o yywrap.o
-       rm allprint.o main.o reject.o yyless.o yywrap.o
diff --git a/.ref-Research-V7/usr/src/cmd/lex/once.c b/.ref-Research-V7/usr/src/cmd/lex/once.c
deleted file mode 100644 (file)
index 099e1fd..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-       /* because of external definitions, this code should occur only once */
-# ifdef ASCII
-int ctable[2*NCH] {
-  0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
-100,101,102,103,104,105,106,107,108,109,
-110,111,112,113,114,115,116,117,118,119,
-120,121,122,123,124,125,126,127};
-# endif
-# ifdef EBCDIC
-int ctable[2*NCH] {
-  0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
-100,101,102,103,104,105,106,107,108,109,
-110,111,112,113,114,115,116,117,118,119,
-120,121,122,123,124,125,126,127,128,129,
-130,131,132,133,134,135,136,137,138,139,
-140,141,142,143,144,145,146,147,148,149,
-150,151,152,153,154,155,156,157,158,159,
-160,161,162,163,164,165,166,167,168,169,
-170,171,172,173,174,175,176,177,178,179,
-180,181,182,183,184,185,186,187,188,189,
-190,191,192,193,194,195,196,197,198,199,
-200,201,202,203,204,205,206,207,208,209,
-210,211,212,213,214,215,216,217,218,219,
-220,221,222,223,224,225,226,227,228,229,
-230,231,232,233,234,235,236,237,238,239,
-240,241,242,243,244,245,246,247,248,249,
-250,251,252,253,254,255};
-# endif
-int ZCH NCH;
-FILE *fout NULL, *errorf {stdout};
-int sect DEFSECTION;
-int prev '\n'; /* previous input character */
-int pres '\n'; /* present input character */
-int peek '\n'; /* next input character */
-char *pushptr pushc;
-char *slptr slist;
-
-# if (unix || ibm)
-char *cname "/usr/lib/lex/ncform";
-char *ratname "/usr/lib/lex/nrform";
-# endif
-
-# ifdef gcos
-char *cname "pounce/lexcform";
-char *ratname "pounce/lexrform";
-# endif
-int ccount 1;
-int casecount 1;
-int aptr 1;
-int nstates NSTATES, maxpos MAXPOS;
-int treesize TREESIZE, ntrans NTRANS;
-int yytop;
-int outsize NOUTPUT;
-int sptr 1;
-int optim TRUE;
-int report 2;
-int debug;             /* 1 = on */
-int charc;
-int sargc;
-char **sargv;
-char buf[520];
-int ratfor;            /* 1 = ratfor, 0 = C */
-int yyline;            /* line number of file */
-int eof;
-int lgatflg;
-int divflg;
-int funcflag;
-int pflag;
-int chset;     /* 1 = char set modified */
-FILE *fin, *fother;
-int fptr;
-int *name;
-int *left;
-int *right;
-int *parent;
-char *nullstr;
-int tptr;
-char pushc[TOKENSIZE];
-char slist[STARTSIZE];
-char **def, **subs, *dchar;
-char **sname, *schar;
-char *ccl;
-char *ccptr;
-char *dp, *sp;
-int dptr;
-char *bptr;            /* store input position */
-char *tmpstat;
-int count;
-int **foll;
-int *nxtpos;
-int *positions;
-int *gotof;
-int *nexts;
-char *nchar;
-int **state;
-int *sfall;            /* fallback state num */
-char *cpackflg;                /* true if state has been character packed */
-int *atable;
-int nptr;
-char symbol[NCH];
-char cindex[NCH];
-int xstate;
-int stnum;
-char match[NCH];
-char extra[NACTIONS];
-char *pchar, *pcptr;
-int pchlen TOKENSIZE;
- long rcount;
-int *verify, *advance, *stoff;
-int scon;
-char *psave;
-int buserr(), segviol();
diff --git a/.ref-Research-V7/usr/src/cmd/lex/parser.y b/.ref-Research-V7/usr/src/cmd/lex/parser.y
deleted file mode 100644 (file)
index 2f152b4..0000000
+++ /dev/null
@@ -1,710 +0,0 @@
-%token CHAR CCL NCCL STR DELIM SCON ITER NEWE NULLS
-%left SCON '/' NEWE
-%left '|'
-%left '$' '^'
-%left CHAR CCL NCCL '(' '.' STR NULLS
-%left ITER
-%left CAT
-%left '*' '+' '?'
-
-%{
-# include "ldefs.c"
-%}
-%%
-%{
-int i;
-int j,k;
-int g;
-char *p;
-%}
-acc    :       lexinput
-       ={      
-# ifdef DEBUG
-               if(debug) sect2dump();
-# endif
-       }
-       ;
-lexinput:      defns delim prods end
-       |       defns delim end
-       ={
-               if(!funcflag)phead2();
-               funcflag = TRUE;
-       }
-       | error
-       ={
-# ifdef DEBUG
-               if(debug) {
-                       sect1dump();
-                       sect2dump();
-                       }
-# endif
-               }
-       ;
-end:           delim | ;
-defns: defns STR STR
-       ={      scopy($2,dp);
-               def[dptr] = dp;
-               dp =+ slength($2) + 1;
-               scopy($3,dp);
-               subs[dptr++] = dp;
-               if(dptr >= DEFSIZE)
-                       error("Too many definitions");
-               dp =+ slength($3) + 1;
-               if(dp >= dchar+DEFCHAR)
-                       error("Definitions too long");
-               subs[dptr]=def[dptr]=0; /* for lookup - require ending null */
-       }
-       |
-       ;
-delim: DELIM
-       ={
-# ifdef DEBUG
-               if(sect == DEFSECTION && debug) sect1dump();
-# endif
-               sect++;
-               }
-       ;
-prods: prods pr
-       ={      $$ = mn2(RNEWE,$1,$2);
-               }
-       |       pr
-       ={      $$ = $1;}
-       ;
-pr:    r NEWE
-       ={
-               if(divflg == TRUE)
-                       i = mn1(S1FINAL,casecount);
-               else i = mn1(FINAL,casecount);
-               $$ = mn2(RCAT,$1,i);
-               divflg = FALSE;
-               casecount++;
-               }
-       | error NEWE
-       ={
-# ifdef DEBUG
-               if(debug) sect2dump();
-# endif
-               }
-r:     CHAR
-       ={      $$ = mn0($1); }
-       | STR
-       ={
-               p = $1;
-               i = mn0(*p++);
-               while(*p)
-                       i = mn2(RSTR,i,*p++);
-               $$ = i;
-               }
-       | '.'
-       ={      symbol['\n'] = 0;
-               if(psave == FALSE){
-                       p = ccptr;
-                       psave = ccptr;
-                       for(i=1;i<'\n';i++){
-                               symbol[i] = 1;
-                               *ccptr++ = i;
-                               }
-                       for(i='\n'+1;i<NCH;i++){
-                               symbol[i] = 1;
-                               *ccptr++ = i;
-                               }
-                       *ccptr++ = 0;
-                       if(ccptr > ccl+CCLSIZE)
-                               error("Too many large character classes");
-                       }
-               else
-                       p = psave;
-               $$ = mn1(RCCL,p);
-               cclinter(1);
-               }
-       | CCL
-       ={      $$ = mn1(RCCL,$1); }
-       | NCCL
-       ={      $$ = mn1(RNCCL,$1); }
-       | r '*'
-       ={      $$ = mn1(STAR,$1); }
-       | r '+'
-       ={      $$ = mn1(PLUS,$1); }
-       | r '?'
-       ={      $$ = mn1(QUEST,$1); }
-       | r '|' r
-       ={      $$ = mn2(BAR,$1,$3); }
-       | r r %prec CAT
-       ={      $$ = mn2(RCAT,$1,$2); }
-       | r '/' r
-       ={      if(!divflg){
-                       j = mn1(S2FINAL,-casecount);
-                       i = mn2(RCAT,$1,j);
-                       $$ = mn2(DIV,i,$3);
-                       }
-               else {
-                       $$ = mn2(RCAT,$1,$3);
-                       warning("Extra slash removed");
-                       }
-               divflg = TRUE;
-               }
-       | r ITER ',' ITER '}'
-       ={      if($2 > $4){
-                       i = $2;
-                       $2 = $4;
-                       $4 = i;
-                       }
-               if($4 <= 0)
-                       warning("Iteration range must be positive");
-               else {
-                       j = $1;
-                       for(k = 2; k<=$2;k++)
-                               j = mn2(RCAT,j,dupl($1));
-                       for(i = $2+1; i<=$4; i++){
-                               g = dupl($1);
-                               for(k=2;k<=i;k++)
-                                       g = mn2(RCAT,g,dupl($1));
-                               j = mn2(BAR,j,g);
-                               }
-                       $$ = j;
-                       }
-       }
-       | r ITER '}'
-       ={
-               if($2 < 0)warning("Can't have negative iteration");
-               else if($2 == 0) $$ = mn0(RNULLS);
-               else {
-                       j = $1;
-                       for(k=2;k<=$2;k++)
-                               j = mn2(RCAT,j,dupl($1));
-                       $$ = j;
-                       }
-               }
-       | r ITER ',' '}'
-       ={
-                               /* from n to infinity */
-               if($2 < 0)warning("Can't have negative iteration");
-               else if($2 == 0) $$ = mn1(STAR,$1);
-               else if($2 == 1)$$ = mn1(PLUS,$1);
-               else {          /* >= 2 iterations minimum */
-                       j = $1;
-                       for(k=2;k<$2;k++)
-                               j = mn2(RCAT,j,dupl($1));
-                       k = mn1(PLUS,dupl($1));
-                       $$ = mn2(RCAT,j,k);
-                       }
-               }
-       | SCON r
-       ={      $$ = mn2(RSCON,$2,$1); }
-       | '^' r
-       ={      $$ = mn1(CARAT,$2); }
-       | r '$'
-       ={      i = mn0('\n');
-               if(!divflg){
-                       j = mn1(S2FINAL,-casecount);
-                       k = mn2(RCAT,$1,j);
-                       $$ = mn2(DIV,k,i);
-                       }
-               else $$ = mn2(RCAT,$1,i);
-               divflg = TRUE;
-               }
-       | '(' r ')'
-       ={      $$ = $2; }
-       |       NULLS
-       ={      $$ = mn0(RNULLS); }
-       ;
-%%
-yylex(){
-       register char *p;
-       register int c, i;
-       char  *t, *xp;
-       int n, j, k, x;
-       static int sectbegin;
-       static char token[TOKENSIZE];
-       static int iter;
-
-# ifdef DEBUG
-       yylval = 0;
-# endif
-
-       if(sect == DEFSECTION) {                /* definitions section */
-               while(!eof) {
-                       if(prev == '\n'){               /* next char is at beginning of line */
-                               getl(p=buf);
-                               switch(*p){
-                               case '%':
-                                       switch(c= *(p+1)){
-                                       case '%':
-                                               lgate();
-                                               if(!ratfor)fprintf(fout,"# ");
-                                               fprintf(fout,"define YYNEWLINE %d\n",ctable['\n']);
-                                               if(!ratfor)fprintf(fout,"yylex(){\nint nstr; extern int yyprevious;\n");
-                                               sectbegin = TRUE;
-                                               i = treesize*(sizeof(*name)+sizeof(*left)+
-                                                       sizeof(*right)+sizeof(*nullstr)+sizeof(*parent))+ALITTLEEXTRA;
-                                               c = myalloc(i,1);
-                                               if(c == 0)
-                                                       error("Too little core for parse tree");
-                                               p = c;
-                                               cfree(p,i,1);
-                                               name = myalloc(treesize,sizeof(*name));
-                                               left = myalloc(treesize,sizeof(*left));
-                                               right = myalloc(treesize,sizeof(*right));
-                                               nullstr = myalloc(treesize,sizeof(*nullstr));
-                                               parent = myalloc(treesize,sizeof(*parent));
-                                               if(name == 0 || left == 0 || right == 0 || parent == 0 || nullstr == 0)
-                                                       error("Too little core for parse tree");
-                                               return(freturn(DELIM));
-                                       case 'p': case 'P':     /* has overridden number of positions */
-                                               while(*p && !digit(*p))p++;
-                                               maxpos = siconv(p);
-# ifdef DEBUG
-                                               if (debug) printf("positions (%%p) now %d\n",maxpos);
-# endif
-                                               if(report == 2)report = 1;
-                                               continue;
-                                       case 'n': case 'N':     /* has overridden number of states */
-                                               while(*p && !digit(*p))p++;
-                                               nstates = siconv(p);
-# ifdef DEBUG
-                                               if(debug)printf( " no. states (%%n) now %d\n",nstates);
-# endif
-                                               if(report == 2)report = 1;
-                                               continue;
-                                       case 'e': case 'E':             /* has overridden number of tree nodes */
-                                               while(*p && !digit(*p))p++;
-                                               treesize = siconv(p);
-# ifdef DEBUG
-                                               if (debug) printf("treesize (%%e) now %d\n",treesize);
-# endif
-                                               if(report == 2)report = 1;
-                                               continue;
-                                       case 'o': case 'O':
-                                               while (*p && !digit(*p))p++;
-                                               outsize = siconv(p);
-                                               if (report ==2) report=1;
-                                               continue;
-                                       case 'a': case 'A':             /* has overridden number of transitions */
-                                               while(*p && !digit(*p))p++;
-                                               if(report == 2)report = 1;
-                                               ntrans = siconv(p);
-# ifdef DEBUG
-                                               if (debug)printf("N. trans (%%a) now %d\n",ntrans);
-# endif
-                                               continue;
-                                       case 'k': case 'K': /* overriden packed char classes */
-                                               while (*p && !digit(*p))p++;
-                                               if (report==2) report=1;
-                                               cfree(pchar, pchlen, sizeof(*pchar));
-                                               pchlen = siconv(p);
-# ifdef DEBUG
-                                               if (debug) printf( "Size classes (%%k) now %d\n",pchlen);
-# endif
-                                               pchar=pcptr=myalloc(pchlen, sizeof(*pchar));
-                                               continue;
-                                       case 't': case 'T':     /* character set specifier */
-                                               ZCH = atoi(p+2);
-                                               if (ZCH < NCH) ZCH = NCH;
-                                               if (ZCH > 2*NCH) error("ch table needs redeclaration");
-                                               chset = TRUE;
-                                               for(i = 0; i<ZCH; i++)
-                                                       ctable[i] = 0;
-                                               while(getl(p) && scomp(p,"%T") != 0 && scomp(p,"%t") != 0){
-                                                       if((n = siconv(p)) <= 0 || n > ZCH){
-                                                               warning("Character value %d out of range",n);
-                                                               continue;
-                                                               }
-                                                       while(!space(*p) && *p) p++;
-                                                       while(space(*p)) p++;
-                                                       t = p;
-                                                       while(*t){
-                                                               c = ctrans(&t);
-                                                               if(ctable[c]){
-                                                                       if (printable(c))
-                                                                               warning("Character '%c' used twice",c);
-                                                                       else
-                                                                               warning("Character %o used twice",c);
-                                                                       }
-                                                               else ctable[c] = n;
-                                                               t++;
-                                                               }
-                                                       p = buf;
-                                                       }
-                                               {
-                                               char chused[2*NCH]; int kr;
-                                               for(i=0; i<ZCH; i++)
-                                                       chused[i]=0;
-                                               for(i=0; i<NCH; i++)
-                                                       chused[ctable[i]]=1;
-                                               for(kr=i=1; i<NCH; i++)
-                                                       if (ctable[i]==0)
-                                                               {
-                                                               while (chused[kr] == 0)
-                                                                       kr++;
-                                                               ctable[i]=kr;
-                                                               chused[kr]=1;
-                                                               }
-                                               }
-                                               lgate();
-                                               continue;
-                                       case 'r': case 'R':
-                                               c = 'r';
-                                       case 'c': case 'C':
-                                               if(lgatflg)
-                                                       error("Too late for language specifier");
-                                               ratfor = (c == 'r');
-                                               continue;
-                                       case '{':
-                                               lgate();
-                                               while(getl(p) && scomp(p,"%}") != 0)
-                                                       fprintf(fout, "%s\n",p);
-                                               if(p[0] == '%') continue;
-                                               error("Premature eof");
-                                       case 's': case 'S':             /* start conditions */
-                                               lgate();
-                                               while(*p && index(*p," \t,") < 0) p++;
-                                               n = TRUE;
-                                               while(n){
-                                                       while(*p && index(*p," \t,") >= 0) p++;
-                                                       t = p;
-                                                       while(*p && index(*p," \t,") < 0)p++;
-                                                       if(!*p) n = FALSE;
-                                                       *p++ = 0;
-                                                       if (*t == 0) continue;
-                                                       i = sptr*2;
-                                                       if(!ratfor)fprintf(fout,"# ");
-                                                       fprintf(fout,"define %s %d\n",t,i);
-                                                       scopy(t,sp);
-                                                       sname[sptr++] = sp;
-                                                       sname[sptr] = 0;        /* required by lookup */
-                                                       if(sptr >= STARTSIZE)
-                                                               error("Too many start conditions");
-                                                       sp =+ slength(sp) + 1;
-                                                       if(sp >= schar+STARTCHAR)
-                                                               error("Start conditions too long");
-                                                       }
-                                               continue;
-                                       default:
-                                               warning("Invalid request %s",p);
-                                               continue;
-                                               }       /* end of switch after seeing '%' */
-                               case ' ': case '\t':            /* must be code */
-                                       lgate();
-                                       fprintf(fout, "%s\n",p);
-                                       continue;
-                               default:                /* definition */
-                                       while(*p && !space(*p)) p++;
-                                       if(*p == 0)
-                                               continue;
-                                       prev = *p;
-                                       *p = 0;
-                                       bptr = p+1;
-                                       yylval = buf;
-                                       if(digit(buf[0]))
-                                               warning("Substitution strings may not begin with digits");
-                                       return(freturn(STR));
-                                       }
-                               }
-                       /* still sect 1, but prev != '\n' */
-                       else {
-                               p = bptr;
-                               while(*p && space(*p)) p++;
-                               if(*p == 0)
-                                       warning("No translation given - null string assumed");
-                               scopy(p,token);
-                               yylval = token;
-                               prev = '\n';
-                               return(freturn(STR));
-                               }
-                       }
-               /* end of section one processing */
-               }
-       else if(sect == RULESECTION){           /* rules and actions */
-               while(!eof){
-                       switch(c=gch()){
-                       case '\0':
-                               return(freturn(0));
-                       case '\n':
-                               if(prev == '\n') continue;
-                               x = NEWE;
-                               break;
-                       case ' ':
-                       case '\t':
-                               if(sectbegin == TRUE){
-                                       cpyact();
-                                       while((c=gch()) && c != '\n');
-                                       continue;
-                                       }
-                               if(!funcflag)phead2();
-                               funcflag = TRUE;
-                               if(ratfor)fprintf(fout,"%d\n",30000+casecount);
-                               else fprintf(fout,"case %d:\n",casecount);
-                               if(cpyact()){
-                                       if(ratfor)fprintf(fout,"goto 30997\n");
-                                       else fprintf(fout,"break;\n");
-                                       }
-                               while((c=gch()) && c != '\n');
-                               if(peek == ' ' || peek == '\t' || sectbegin == TRUE){
-                                       warning("Executable statements should occur right after %%");
-                                       continue;
-                                       }
-                               x = NEWE;
-                               break;
-                       case '%':
-                               if(prev != '\n') goto character;
-                               if(peek == '{'){        /* included code */
-                                       getl(buf);
-                                       while(!eof && getl(buf) && scomp("%}",buf) != 0)
-                                               fprintf(fout,"%s\n",buf);
-                                       continue;
-                                       }
-                               if(peek == '%'){
-                                       c = gch();
-                                       c = gch();
-                                       x = DELIM;
-                                       break;
-                                       }
-                               goto character;
-                       case '|':
-                               if(peek == ' ' || peek == '\t' || peek == '\n'){
-                                       if(ratfor)fprintf(fout,"%d\n",30000+casecount++);
-                                       else fprintf(fout,"case %d:\n",casecount++);
-                                       continue;
-                                       }
-                               x = '|';
-                               break;
-                       case '$':
-                               if(peek == '\n' || peek == ' ' || peek == '\t' || peek == '|' || peek == '/'){
-                                       x = c;
-                                       break;
-                                       }
-                               goto character;
-                       case '^':
-                               if(prev != '\n' && scon != TRUE) goto character;        /* valid only at line begin */
-                               x = c;
-                               break;
-                       case '?':
-                       case '+':
-                       case '.':
-                       case '*':
-                       case '(':
-                       case ')':
-                       case ',':
-                       case '/':
-                               x = c;
-                               break;
-                       case '}':
-                               iter = FALSE;
-                               x = c;
-                               break;
-                       case '{':       /* either iteration or definition */
-                               if(digit(c=gch())){     /* iteration */
-                                       iter = TRUE;
-                               ieval:
-                                       i = 0;
-                                       while(digit(c)){
-                                               token[i++] = c;
-                                               c = gch();
-                                               }
-                                       token[i] = 0;
-                                       yylval = siconv(token);
-                                       munput('c',c);
-                                       x = ITER;
-                                       break;
-                                       }
-                               else {          /* definition */
-                                       i = 0;
-                                       while(c && c!='}'){
-                                               token[i++] = c;
-                                               c = gch();
-                                               }
-                                       token[i] = 0;
-                                       i = lookup(token,def);
-                                       if(i < 0)
-                                               warning("Definition %s not found",token);
-                                       else
-                                               munput('s',subs[i]);
-                                       continue;
-                                       }
-                       case '<':               /* start condition ? */
-                               if(prev != '\n')                /* not at line begin, not start */
-                                       goto character;
-                               t = slptr;
-                               do {
-                                       i = 0;
-                                       c = gch();
-                                       while(c != ',' && c && c != '>'){
-                                               token[i++] = c;
-                                               c = gch();
-                                               }
-                                       token[i] = 0;
-                                       if(i == 0)
-                                               goto character;
-                                       i = lookup(token,sname);
-                                       if(i < 0) {
-                                               warning("Undefined start condition %s",token);
-                                               continue;
-                                               }
-                                       *slptr++ = i+1;
-                                       } while(c && c != '>');
-                               *slptr++ = 0;
-                               /* check if previous value re-usable */
-                               for (xp=slist; xp<t; )
-                                       {
-                                       if (strcmp(xp, t)==0)
-                                               break;
-                                       while (*xp++);
-                                       }
-                               if (xp<t)
-                                       {
-                                       /* re-use previous pointer to string */
-                                       slptr=t;
-                                       t=xp;
-                                       }
-                               if(slptr > slist+STARTSIZE)             /* note not packed ! */
-                                       error("Too many start conditions used");
-                               yylval = t;
-                               x = SCON;
-                               break;
-                       case '"':
-                               i = 0;
-                               while((c=gch()) && c != '"' && c != '\n'){
-                                       if(c == '\\') c = usescape(c=gch());
-                                       token[i++] = c;
-                                       if(i > TOKENSIZE){
-                                               warning("String too long");
-                                               i = TOKENSIZE-1;
-                                               break;
-                                               }
-                                       }
-                               if(c == '\n') {
-                                       yyline--;
-                                       warning("Non-terminated string");
-                                       yyline++;
-                                       }
-                               token[i] = 0;
-                               if(i == 0)x = NULLS;
-                               else if(i == 1){
-                                       yylval = token[0];
-                                       x = CHAR;
-                                       }
-                               else {
-                                       yylval = token;
-                                       x = STR;
-                                       }
-                               break;
-                       case '[':
-                               for(i=1;i<NCH;i++) symbol[i] = 0;
-                               x = CCL;
-                               if((c = gch()) == '^'){
-                                       x = NCCL;
-                                       c = gch();
-                                       }
-                               while(c != ']' && c){
-                                       if(c == '\\') c = usescape(c=gch());
-                                       symbol[c] = 1;
-                                       j = c;
-                                       if((c=gch()) == '-' && peek != ']'){            /* range specified */
-                                               c = gch();
-                                               if(c == '\\') c = usescape(c=gch());
-                                               k = c;
-                                               if(j > k) {
-                                                       n = j;
-                                                       j = k;
-                                                       k = n;
-                                                       }
-                                               if(!(('A' <= j && k <= 'Z') ||
-                                                    ('a' <= j && k <= 'z') ||
-                                                    ('0' <= j && k <= '9')))
-                                                       warning("Non-portable Character Class");
-                                               for(n=j+1;n<=k;n++)
-                                                       symbol[n] = 1;          /* implementation dependent */
-                                               c = gch();
-                                               }
-                                       }
-                               /* try to pack ccl's */
-                               i = 0;
-                               for(j=0;j<NCH;j++)
-                                       if(symbol[j])token[i++] = j;
-                               token[i] = 0;
-                               p = ccptr;
-                               if(optim){
-                                       p = ccl;
-                                       while(p <ccptr && scomp(token,p) != 0)p++;
-                                       }
-                               if(p < ccptr)   /* found it */
-                                       yylval = p;
-                               else {
-                                       yylval = ccptr;
-                                       scopy(token,ccptr);
-                                       ccptr =+ slength(token) + 1;
-                                       if(ccptr >= ccl+CCLSIZE)
-                                               error("Too many large character classes");
-                                       }
-                               cclinter(x==CCL);
-                               break;
-                       case '\\':
-                               c = usescape(c=gch());
-                       default:
-                       character:
-                               if(iter){       /* second part of an iteration */
-                                       iter = FALSE;
-                                       if('0' <= c && c <= '9')
-                                               goto ieval;
-                                       }
-                               if(alpha(peek)){
-                                       i = 0;
-                                       yylval = token;
-                                       token[i++] = c;
-                                       while(alpha(peek))
-                                               token[i++] = gch();
-                                       if(peek == '?' || peek == '*' || peek == '+')
-                                               munput('c',token[--i]);
-                                       token[i] = 0;
-                                       if(i == 1){
-                                               yylval = token[0];
-                                               x = CHAR;
-                                               }
-                                       else x = STR;
-                                       }
-                               else {
-                                       yylval = c;
-                                       x = CHAR;
-                                       }
-                               }
-                       scon = FALSE;
-                       if(x == SCON)scon = TRUE;
-                       sectbegin = FALSE;
-                       return(freturn(x));
-                       }
-               }
-       /* section three */
-       ptail();
-# ifdef DEBUG
-       if(debug)
-               fprintf(fout,"\n/*this comes from section three - debug */\n");
-# endif
-       while(getl(buf) && !eof)
-               fprintf(fout,"%s\n",buf);
-       return(freturn(0));
-       }
-/* end of yylex */
-# ifdef DEBUG
-freturn(i)
-  int i; {
-       if(yydebug) {
-               printf("now return ");
-               if(i < NCH) allprint(i);
-               else printf("%d",i);
-               printf("   yylval = ");
-               switch(i){
-                       case STR: case CCL: case NCCL:
-                               strpt(yylval);
-                               break;
-                       case CHAR:
-                               allprint(yylval);
-                               break;
-                       default:
-                               printf("%d",yylval);
-                               break;
-                       }
-               putchar('\n');
-               }
-       return(i);
-       }
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/lex/sub1.c b/.ref-Research-V7/usr/src/cmd/lex/sub1.c
deleted file mode 100644 (file)
index f2aeb8a..0000000
+++ /dev/null
@@ -1,682 +0,0 @@
-# include "ldefs.c"
-getl(p)        /* return next line of input, throw away trailing '\n' */
-       /* returns 0 if eof is had immediately */
-  char *p;
-       {
-       register int c;
-       register char *s, *t;
-       t = s = p;
-       while(((c = gch()) != 0) && c != '\n')
-               *t++ = c;
-       *t = 0;
-       if(c == 0 && s == t) return(0);
-       prev = '\n';
-       pres = '\n';
-       return(s);
-       }
-space(ch)
-       {
-       switch(ch)
-               {
-               case ' ':
-               case '\t':
-               case '\n':
-                       return(1);
-               }
-       return(0);
-       }
-
-digit(c)
-{
-       return(c>='0' && c <= '9');
-}
-error(s,p,d)
-       {
-       if(!eof)fprintf(errorf,"%d: ",yyline);
-       fprintf(errorf,"(Error) ");
-       fprintf(errorf,s,p,d);
-       putc('\n',errorf);
-# ifdef DEBUG
-       if(debug && sect != ENDSECTION) {
-               sect1dump();
-               sect2dump();
-       }
-# endif
-       if(
-# ifdef DEBUG
-               debug ||
-# endif
-               report == 1) statistics();
-       exit(1);        /* error return code */
-       }
-
-warning(s,p,d)
-       {
-       if(!eof)fprintf(errorf,"%d: ",yyline);
-       fprintf(errorf,"(Warning) ");
-       fprintf(errorf,s,p,d);
-       putc('\n',errorf);
-       fflush(errorf);
-       fflush(fout);
-       fflush(stdout);
-       }
-index(a,s)
-       char *s;
-{
-       register int k;
-       for(k=0; s[k]; k++)
-               if (s[k]== a)
-                       return(k);
-       return(-1);
-       }
-
-alpha(c)
-  int c; {
-# ifdef ASCII
-return('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z');
-# endif
-# ifdef EBCDIC
-return(index(c,"abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") >= 0);
-# endif
-}
-printable(c)
-{
-# ifdef ASCII
-return( c>040 && c < 0177);
-# endif
-# ifdef EBCDIC
-return(index(c, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,;:><+*)('&%!-=\"")>=0);
-# endif
-}
-lgate()
-{
-       char fname[20];
-       if (lgatflg) return;
-       lgatflg=1;
-       if(fout == NULL){
-               sprintf(fname, "lex.yy.%c", ratfor ? 'r' : 'c' );
-               fout = fopen(fname, "w");
-               }
-       if(fout == NULL) error("Can't open %s",fname);
-       if(ratfor) fprintf( fout, "#\n");
-       phead1();
-       }
-/* scopy(ptr to str, ptr to str) - copy first arg str to second */
-/* returns ptr to second arg */
-scopy(s,t)
-  char *s, *t; {
-       register char *i;
-       i = t;
-       while(*i++ = *s++);
-       return;
-       }
-siconv(t)      /* convert string t, return integer value */
-  char *t; {
-       register int i,sw;
-       register char *s;
-       s = t;
-       while(!(('0' <= *s && *s <= '9') || *s == '-') && *s) s++;
-       sw = 0;
-       if(*s == '-'){  /* neg */
-               sw = 1;
-               s++;
-               }
-       i = 0;
-       while('0' <= *s && *s <= '9')
-               i = i * 10 + (*(s++)-'0');
-       return(sw ? -i : i);
-       }
-/* slength(ptr to str) - return integer length of string arg */
-/* excludes '\0' terminator */
-slength(s)
-  char *s; {
-       register int n;
-       register char *t;
-       t = s;
-       for (n = 0; *t++; n++);
-       return(n);
-       }
-/* scomp(x,y) - return -1 if x < y,
-               0 if x == y,
-               return 1 if x > y, all lexicographically */
-scomp(x,y)
-  char *x,*y; {
-       register char *a,*d;
-       a = x;
-       d = y;
-       while(*a || *d){
-               if(*a > *d)
-                       return(1);      /* greater */
-               if(*a < *d)
-                       return(-1);     /* less */
-               a++;
-               d++;
-               }
-       return(0);      /* equal */
-       }
-ctrans(ss)
-       char **ss;
-{
-       register int c, k;
-       if ((c = **ss) != '\\')
-               return(c);
-       switch(c= *++*ss)
-       {
-       case 'n': c = '\n'; break;
-       case 't': c = '\t'; break;
-       case 'r': c = '\r'; break;
-       case 'b': c = '\b'; break;
-       case 'f': c = 014; break;               /* form feed for ascii */
-       case '\\': c = '\\'; break;
-       case '0': case '1': case '2': case '3':
-       case '4': case '5': case '6': case '7':
-               c =- '0';
-               while ((k = *(*ss+1)) >= '0' && k <= '7')
-                       {
-                       c = c*8 + k - '0';
-                       (*ss)++;
-                       }
-               break;
-       }
-       return(c);
-}
-cclinter(sw)
-  int sw; {
-               /* sw = 1 ==> ccl */
-       register int i, j, k;
-       int m;
-       if(!sw){                /* is NCCL */
-               for(i=1;i<NCH;i++)
-                       symbol[i] =^ 1;                 /* reverse value */
-               }
-       for(i=1;i<NCH;i++)
-               if(symbol[i]) break;
-       if(i >= NCH) return;
-       i = cindex[i];
-       /* see if ccl is already in our table */
-       j = 0;
-       if(i){
-               for(j=1;j<NCH;j++){
-                       if((symbol[j] && cindex[j] != i) ||
-                          (!symbol[j] && cindex[j] == i)) break;
-                       }
-               }
-       if(j >= NCH) return;            /* already in */
-       m = 0;
-       k = 0;
-       for(i=1;i<NCH;i++)
-               if(symbol[i]){
-                       if(!cindex[i]){
-                               cindex[i] = ccount;
-                               symbol[i] = 0;
-                               m = 1;
-                               }
-                       else k = 1;
-                       }
-                       /* m == 1 implies last value of ccount has been used */
-       if(m)ccount++;
-       if(k == 0) return;      /* is now in as ccount wholly */
-       /* intersection must be computed */
-       for(i=1;i<NCH;i++){
-               if(symbol[i]){
-                       m = 0;
-                       j = cindex[i];  /* will be non-zero */
-                       for(k=1;k<NCH;k++){
-                               if(cindex[k] == j){
-                                       if(symbol[k]) symbol[k] = 0;
-                                       else {
-                                               cindex[k] = ccount;
-                                               m = 1;
-                                               }
-                                       }
-                               }
-                       if(m)ccount++;
-                       }
-               }
-       return;
-       }
-usescape(c)
-  int c; {
-       register char d;
-       switch(c){
-       case 'n': c = '\n'; break;
-       case 'r': c = '\r'; break;
-       case 't': c = '\t'; break;
-       case 'b': c = '\b'; break;
-       case 'f': c = 014; break;               /* form feed for ascii */
-       case '0': case '1': case '2': case '3':
-       case '4': case '5': case '6': case '7':
-               c =- '0';
-               while('0' <= (d=gch()) && d <= '7'){
-                       c = c * 8 + (d-'0');
-                       if(!('0' <= peek && peek <= '7')) break;
-                       }
-               break;
-       }
-       return(c);
-       }
-lookup(s,t)
-  char *s;
-  char **t; {
-       register int i;
-       i = 0;
-       while(*t){
-               if(scomp(s,*t) == 0)
-                       return(i);
-               i++;
-               t++;
-               }
-       return(-1);
-       }
-cpyact(){ /* copy C action to the next ; or closing } */
-       register int brac, c, mth;
-       int savline, sw;
-
-       brac = 0;
-       sw = TRUE;
-
-while(!eof){
-       c = gch();
-swt:
-       switch( c ){
-
-case '|':      if(brac == 0 && sw == TRUE){
-                       if(peek == '|')gch();           /* eat up an extra '|' */
-                       return(0);
-                       }
-               break;
-
-case ';':
-               if( brac == 0 ){
-                       putc(c,fout);
-                       putc('\n',fout);
-                       return(1);
-                       }
-               break;
-
-case '{':
-               brac++;
-               savline=yyline;
-               break;
-
-case '}':
-               brac--;
-               if( brac == 0 ){
-                       putc(c,fout);
-                       putc('\n',fout);
-                       return(1);
-                       }
-               break;
-
-case '/':      /* look for comments */
-               putc(c,fout);
-               c = gch();
-               if( c != '*' ) goto swt;
-
-               /* it really is a comment */
-
-               putc(c,fout);
-               savline=yyline;
-               while( c=gch() ){
-                       if( c=='*' ){
-                               putc(c,fout);
-                               if( (c=gch()) == '/' ) goto loop;
-                               }
-                       putc(c,fout);
-                       }
-               yyline=savline;
-               error( "EOF inside comment" );
-
-case '\'':     /* character constant */
-               mth = '\'';
-               goto string;
-
-case '"':      /* character string */
-               mth = '"';
-
-       string:
-
-               putc(c,fout);
-               while( c=gch() ){
-                       if( c=='\\' ){
-                               putc(c,fout);
-                               c=gch();
-                               }
-                       else if( c==mth ) goto loop;
-                       putc(c,fout);
-                       if (c == '\n')
-                               {
-                               yyline--;
-                               error( "Non-terminated string or character constant");
-                               }
-                       }
-               error( "EOF in string or character constant" );
-
-case '\0':
-               yyline = savline;
-               error("Action does not terminate");
-default:
-               break;          /* usual character */
-               }
-loop:
-       if(c != ' ' && c != '\t' && c != '\n') sw = FALSE;
-       putc(c,fout);
-       }
-error("Premature EOF");
-}
-gch(){
-       register int c;
-       prev = pres;
-       c = pres = peek;
-       peek = pushptr > pushc ? *--pushptr : getc(fin);
-       if(peek == EOF && sargc > 1){
-               fclose(fin);
-               fin = fopen(sargv[++fptr],"r");
-               if(fin == NULL)
-                       error("Cannot open file %s",sargv[fptr]);
-               peek = getc(fin);
-               sargc--;
-               sargv++;
-               }
-       if(c == EOF) {
-               eof = TRUE;
-               fclose(fin);
-               return(0);
-               }
-       if(c == '\n')yyline++;
-       return(c);
-       }
-mn2(a,d,c)
-  int a,d,c;
-       {
-       name[tptr] = a;
-       left[tptr] = d;
-       right[tptr] = c;
-       parent[tptr] = 0;
-       nullstr[tptr] = 0;
-       switch(a){
-       case RSTR:
-               parent[d] = tptr;
-               break;
-       case BAR:
-       case RNEWE:
-               if(nullstr[d] || nullstr[c]) nullstr[tptr] = TRUE;
-               parent[d] = parent[c] = tptr;
-               break;
-       case RCAT:
-       case DIV:
-               if(nullstr[d] && nullstr[c])nullstr[tptr] = TRUE;
-               parent[d] = parent[c] = tptr;
-               break;
-       case RSCON:
-               parent[d] = tptr;
-               nullstr[tptr] = nullstr[d];
-               break;
-# ifdef DEBUG
-       default:
-               warning("bad switch mn2 %d %d",a,d);
-               break;
-# endif
-               }
-       if(tptr > treesize)
-               error("Parse tree too big %s",(treesize == TREESIZE?"\nTry using %e num":""));
-       return(tptr++);
-       }
-mn1(a,d)
-  int a,d;
-       {
-       name[tptr] = a;
-       left[tptr] = d;
-       parent[tptr] = 0;
-       nullstr[tptr] = 0;
-       switch(a){
-       case RCCL:
-       case RNCCL:
-               if(slength(d) == 0) nullstr[tptr] = TRUE;
-               break;
-       case STAR:
-       case QUEST:
-               nullstr[tptr] = TRUE;
-               parent[d] = tptr;
-               break;
-       case PLUS:
-       case CARAT:
-               nullstr[tptr] = nullstr[d];
-               parent[d] = tptr;
-               break;
-       case S2FINAL:
-               nullstr[tptr] = TRUE;
-               break;
-# ifdef DEBUG
-       case FINAL:
-       case S1FINAL:
-               break;
-       default:
-               warning("bad switch mn1 %d %d",a,d);
-               break;
-# endif
-               }
-       if(tptr > treesize)
-               error("Parse tree too big %s",(treesize == TREESIZE?"\nTry using %e num":""));
-       return(tptr++);
-       }
-mn0(a)
-  int a;
-       {
-       name[tptr] = a;
-       parent[tptr] = 0;
-       nullstr[tptr] = 0;
-       if(a >= NCH) switch(a){
-       case RNULLS: nullstr[tptr] = TRUE; break;
-# ifdef DEBUG
-       default:
-               warning("bad switch mn0 %d",a);
-               break;
-# endif
-       }
-       if(tptr > treesize)
-               error("Parse tree too big %s",(treesize == TREESIZE?"\nTry using %e num":""));
-       return(tptr++);
-       }
-munput(t,p)    /* implementation dependent */
-  char *p;
-  int t; {
-       register int i,j;
-       if(t == 'c'){
-               *pushptr++ = peek;              /* watch out for this */
-               peek = p;
-               }
-       else if(t == 's'){
-               *pushptr++ = peek;
-               peek = p[0];
-               i = slength(p);
-               for(j = i-1; j>=1; j--)
-                       *pushptr++ = p[j];
-               }
-# ifdef DEBUG
-       else error("Unrecognized munput option %c",t);
-# endif
-       if(pushptr >= pushc+TOKENSIZE)
-               error("Too many characters pushed");
-       return;
-       }
-
-dupl(n)
-  int n; {
-       /* duplicate the subtree whose root is n, return ptr to it */
-       register int i;
-       i = name[n];
-       if(i < NCH) return(mn0(i));
-       switch(i){
-       case RNULLS:
-               return(mn0(i));
-       case RCCL: case RNCCL: case FINAL: case S1FINAL: case S2FINAL:
-               return(mn1(i,left[n]));
-       case STAR: case QUEST: case PLUS: case CARAT:
-               return(mn1(i,dupl(left[n])));
-       case RSTR: case RSCON:
-               return(mn2(i,dupl(left[n]),right[n]));
-       case BAR: case RNEWE: case RCAT: case DIV:
-               return(mn2(i,dupl(left[n]),dupl(right[n])));
-# ifdef DEBUG
-       default:
-               warning("bad switch dupl %d",n);
-# endif
-       }
-       return(0);
-       }
-# ifdef DEBUG
-allprint(c)
-  char c; {
-       switch(c){
-               case 014:
-                       printf("\\f");
-                       charc++;
-                       break;
-               case '\n':
-                       printf("\\n");
-                       charc++;
-                       break;
-               case '\t':
-                       printf("\\t");
-                       charc++;
-                       break;
-               case '\b':
-                       printf("\\b");
-                       charc++;
-                       break;
-               case ' ':
-                       printf("\\\bb");
-                       break;
-               default:
-                       if(!printable(c)){
-                               printf("\\%-3o",c);
-                               charc =+ 3;
-                               }
-                       else 
-                               putchar(c);
-                       break;
-               }
-       charc++;
-       return;
-       }
-strpt(s)
-  char *s; {
-       charc = 0;
-       while(*s){
-               allprint(*s++);
-               if(charc > LINESIZE){
-                       charc = 0;
-                       printf("\n\t");
-                       }
-               }
-       return;
-       }
-sect1dump(){
-       register int i;
-       printf("Sect 1:\n");
-       if(def[0]){
-               printf("str     trans\n");
-               i = -1;
-               while(def[++i])
-                       printf("%s\t%s\n",def[i],subs[i]);
-               }
-       if(sname[0]){
-               printf("start names\n");
-               i = -1;
-               while(sname[++i])
-                       printf("%s\n",sname[i]);
-               }
-       if(chset == TRUE){
-               printf("char set changed\n");
-               for(i=1;i<NCH;i++){
-                       if(i != ctable[i]){
-                               allprint(i);
-                               putchar(' ');
-                               printable(ctable[i]) ? putchar(ctable[i]) : printf("%d",ctable[i]);
-                               putchar('\n');
-                               }
-                       }
-               }
-       }
-sect2dump(){
-       printf("Sect 2:\n");
-       treedump();
-       }
-treedump()
-       {
-       register int t;
-       register char *p;
-       printf("treedump %d nodes:\n",tptr);
-       for(t=0;t<tptr;t++){
-               printf("%4d ",t);
-               parent[t] ? printf("p=%4d",parent[t]) : printf("      ");
-               printf("  ");
-               if(name[t] < NCH) {
-                               allprint(name[t]);
-                               }
-               else switch(name[t]){
-                       case RSTR:
-                               printf("%d ",left[t]);
-                               allprint(right[t]);
-                               break;
-                       case RCCL:
-                               printf("ccl ");
-                               strpt(left[t]);
-                               break;
-                       case RNCCL:
-                               printf("nccl ");
-                               strpt(left[t]);
-                               break;
-                       case DIV:
-                               printf("/ %d %d",left[t],right[t]);
-                               break;
-                       case BAR:
-                               printf("| %d %d",left[t],right[t]);
-                               break;
-                       case RCAT:
-                               printf("cat %d %d",left[t],right[t]);
-                               break;
-                       case PLUS:
-                               printf("+ %d",left[t]);
-                               break;
-                       case STAR:
-                               printf("* %d",left[t]);
-                               break;
-                       case CARAT:
-                               printf("^ %d",left[t]);
-                               break;
-                       case QUEST:
-                               printf("? %d",left[t]);
-                               break;
-                       case RNULLS:
-                               printf("nullstring");
-                               break;
-                       case FINAL:
-                               printf("final %d",left[t]);
-                               break;
-                       case S1FINAL:
-                               printf("s1final %d",left[t]);   
-                               break;
-                       case S2FINAL:
-                               printf("s2final %d",left[t]);
-                               break;
-                       case RNEWE:
-                               printf("new %d %d",left[t],right[t]);
-                               break;
-                       case RSCON:
-                               p = right[t];
-                               printf("start %s",sname[*p++-1]);
-                               while(*p)
-                                       printf(", %s",sname[*p++-1]);
-                               printf(" %d",left[t]);
-                               break;
-                       default:
-                               printf("unknown %d %d %d",name[t],left[t],right[t]);
-                               break;
-                       }
-               if(nullstr[t])printf("\t(null poss.)");
-               putchar('\n');
-               }
-       }
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/lex/sub2.c b/.ref-Research-V7/usr/src/cmd/lex/sub2.c
deleted file mode 100644 (file)
index f4960c0..0000000
+++ /dev/null
@@ -1,951 +0,0 @@
-# include "ldefs.c"
-cfoll(v)
-       int v;
-       {
-       register int i,j,k;
-       char *p;
-       i = name[v];
-       if(i < NCH) i = 1;      /* character */
-       switch(i){
-               case 1: case RSTR: case RCCL: case RNCCL: case RNULLS:
-                       for(j=0;j<tptr;j++)
-                               tmpstat[j] = FALSE;
-                       count = 0;
-                       follow(v);
-# ifdef PP
-                       padd(foll,v);           /* packing version */
-# endif
-# ifndef PP
-                       add(foll,v);            /* no packing version */
-# endif
-                       if(i == RSTR) cfoll(left[v]);
-                       else if(i == RCCL || i == RNCCL){       /* compress ccl list */
-                               for(j=1; j<NCH;j++)
-                                       symbol[j] = (i==RNCCL);
-                               p = left[v];
-                               while(*p)
-                                       symbol[*p++] = (i == RCCL);
-                               p = pcptr;
-                               for(j=1;j<NCH;j++)
-                                       if(symbol[j]){
-                                               for(k=0;p+k < pcptr; k++)
-                                                       if(cindex[j] == *(p+k))
-                                                               break;
-                                               if(p+k >= pcptr)*pcptr++ = cindex[j];
-                                               }
-                               *pcptr++ = 0;
-                               if(pcptr > pchar + pchlen)
-                                       error("Too many packed character classes");
-                               left[v] = p;
-                               name[v] = RCCL; /* RNCCL eliminated */
-# ifdef DEBUG
-                               if(debug && *p){
-                                       printf("ccl %d: %d",v,*p++);
-                                       while(*p)
-                                               printf(", %d",*p++);
-                                       putchar('\n');
-                                       }
-# endif
-                               }
-                       break;
-               case CARAT:
-                       cfoll(left[v]);
-                       break;
-               case STAR: case PLUS: case QUEST: case RSCON: 
-                       cfoll(left[v]);
-                       break;
-               case BAR: case RCAT: case DIV: case RNEWE:
-                       cfoll(left[v]);
-                       cfoll(right[v]);
-                       break;
-# ifdef DEBUG
-               case FINAL:
-               case S1FINAL:
-               case S2FINAL:
-                       break;
-               default:
-                       warning("bad switch cfoll %d",v);
-# endif
-               }
-       return;
-       }
-# ifdef DEBUG
-pfoll()
-       {
-       register int i,k,*p;
-       int j;
-       /* print sets of chars which may follow positions */
-       printf("pos\tchars\n");
-       for(i=0;i<tptr;i++)
-               if(p=foll[i]){
-                       j = *p++;
-                       if(j >= 1){
-                               printf("%d:\t%d",i,*p++);
-                               for(k=2;k<=j;k++)
-                                       printf(", %d",*p++);
-                               putchar('\n');
-                               }
-                       }
-       return;
-       }
-# endif
-add(array,n)
-  int **array;
-  int n; {
-       register int i, *temp;
-       register char *ctemp;
-       temp = nxtpos;
-       ctemp = tmpstat;
-       array[n] = nxtpos;              /* note no packing is done in positions */
-       *temp++ = count;
-       for(i=0;i<tptr;i++)
-               if(ctemp[i] == TRUE)
-                       *temp++ = i;
-       nxtpos = temp;
-       if(nxtpos >= positions+maxpos)
-               error("Too many positions %s",(maxpos== MAXPOS?"\nTry using %p num":""));
-       return;
-       }
-follow(v)
-  int v;
-       {
-       register int p;
-       if(v >= tptr-1)return;
-       p = parent[v];
-       if(p == 0) return;
-       switch(name[p]){
-                       /* will not be CHAR RNULLS FINAL S1FINAL S2FINAL RCCL RNCCL */
-               case RSTR:
-                       if(tmpstat[p] == FALSE){
-                               count++;
-                               tmpstat[p] = TRUE;
-                               }
-                       break;
-               case STAR: case PLUS:
-                       first(v);
-                       follow(p);
-                       break;
-               case BAR: case QUEST: case RNEWE:
-                       follow(p);
-                       break;
-               case RCAT: case DIV: 
-                       if(v == left[p]){
-                               if(nullstr[right[p]])
-                                       follow(p);
-                               first(right[p]);
-                               }
-                       else follow(p);
-                       break;
-               case RSCON: case CARAT: 
-                       follow(p);
-                       break;
-# ifdef DEBUG
-               default:
-                       warning("bad switch follow %d",p);
-# endif
-               }
-       return;
-       }
-first(v)       /* calculate set of positions with v as root which can be active initially */
-  int v; {
-       register int i;
-       register char *p;
-       i = name[v];
-       if(i < NCH)i = 1;
-       switch(i){
-               case 1: case RCCL: case RNCCL: case RNULLS: case FINAL: case S1FINAL: case S2FINAL:
-                       if(tmpstat[v] == FALSE){
-                               count++;
-                               tmpstat[v] = TRUE;
-                               }
-                       break;
-               case BAR: case RNEWE:
-                       first(left[v]);
-                       first(right[v]);
-                       break;
-               case CARAT:
-                       if(stnum % 2 == 1)
-                               first(left[v]);
-                       break;
-               case RSCON:
-                       i = stnum/2 +1;
-                       p = right[v];
-                       while(*p)
-                               if(*p++ == i){
-                                       first(left[v]);
-                                       break;
-                                       }
-                       break;
-               case STAR: case QUEST: case PLUS:  case RSTR:
-                       first(left[v]);
-                       break;
-               case RCAT: case DIV:
-                       first(left[v]);
-                       if(nullstr[left[v]])
-                               first(right[v]);
-                       break;
-# ifdef DEBUG
-               default:
-                       warning("bad switch first %d",v);
-# endif
-               }
-       return;
-       }
-cgoto(){
-       register int i, j, s;
-       int npos, curpos, n;
-       int tryit;
-       char tch[NCH];
-       int tst[NCH];
-       char *q;
-       /* generate initial state, for each start condition */
-       if(ratfor){
-               fprintf(fout,"blockdata\n");
-               fprintf(fout,"common /Lvstop/ vstop\n");
-               fprintf(fout,"define Svstop %d\n",nstates+1);
-               fprintf(fout,"integer vstop(Svstop)\n");
-               }
-       else fprintf(fout,"int yyvstop[] ={\n0,\n");
-       while(stnum < 2 || stnum/2 < sptr){
-               for(i = 0; i<tptr; i++) tmpstat[i] = 0;
-               count = 0;
-               if(tptr > 0)first(tptr-1);
-               add(state,stnum);
-# ifdef DEBUG
-               if(debug){
-                       if(stnum > 1)
-                               printf("%s:\n",sname[stnum/2]);
-                       pstate(stnum);
-                       }
-# endif
-               stnum++;
-               }
-       stnum--;
-       /* even stnum = might not be at line begin */
-       /* odd stnum  = must be at line begin */
-       /* even states can occur anywhere, odd states only at line begin */
-       for(s = 0; s <= stnum; s++){
-               tryit = FALSE;
-               cpackflg[s] = FALSE;
-               sfall[s] = -1;
-               acompute(s);
-               for(i=0;i<NCH;i++) symbol[i] = 0;
-               npos = *state[s];
-               for(i = 1; i<=npos; i++){
-                       curpos = *(state[s]+i);
-                       if(name[curpos] < NCH) symbol[name[curpos]] = TRUE;
-                       else switch(name[curpos]){
-                       case RCCL:
-                               tryit = TRUE;
-                               q = left[curpos];
-                               while(*q){
-                                       for(j=1;j<NCH;j++)
-                                               if(cindex[j] == *q)
-                                                       symbol[j] = TRUE;
-                                       q++;
-                                       }
-                               break;
-                       case RSTR:
-                               symbol[right[curpos]] = TRUE;
-                               break;
-# ifdef DEBUG
-                       case RNULLS:
-                       case FINAL:
-                       case S1FINAL:
-                       case S2FINAL:
-                               break;
-                       default:
-                               warning("bad switch cgoto %d state %d",curpos,s);
-                               break;
-# endif
-                       }
-               }
-# ifdef DEBUG
-               if(debug){
-                       printf("State %d transitions on:\n\t",s);
-                       charc = 0;
-                       for(i = 1; i<NCH; i++){
-                               if(symbol[i]) allprint(i);
-                               if(charc > LINESIZE){
-                                       charc = 0;
-                                       printf("\n\t");
-                                       }
-                               }
-                       putchar('\n');
-                       }
-# endif
-               /* for each char, calculate next state */
-               n = 0;
-               for(i = 1; i<NCH; i++){
-                       if(symbol[i]){
-                               nextstate(s,i);         /* executed for each state, transition pair */
-                               xstate = notin(stnum);
-                               if(xstate == -2) warning("bad state  %d %o",s,i);
-                               else if(xstate == -1){
-                                       if(stnum >= nstates)
-                                               error("Too many states %s",(nstates == NSTATES ? "\nTry using %n num":""));
-                                       add(state,++stnum);
-# ifdef DEBUG
-                                       if(debug)pstate(stnum);
-# endif
-                                       tch[n] = i;
-                                       tst[n++] = stnum;
-                                       }
-                               else {          /* xstate >= 0 ==> state exists */
-                                       tch[n] = i;
-                                       tst[n++] = xstate;
-                                       }
-                               }
-                       }
-               tch[n] = 0;
-               tst[n] = -1;
-               /* pack transitions into permanent array */
-               if(n > 0) packtrans(s,tch,tst,n,tryit);
-               else gotof[s] = -1;
-               }
-       ratfor ? fprintf(fout,"end\n") : fprintf(fout,"0};\n");
-       return;
-       }
-       /*      Beware -- 70% of total CPU time is spent in this subroutine -
-               if you don't believe me - try it yourself ! */
-nextstate(s,c)
-  int s,c; {
-       register int j, *newpos;
-       register char *temp, *tz;
-       int *pos, i, *f, num, curpos, number;
-       /* state to goto from state s on char c */
-       num = *state[s];
-       temp = tmpstat;
-       pos = state[s] + 1;
-       for(i = 0; i<num; i++){
-               curpos = *pos++;
-               j = name[curpos];
-               if(j < NCH && j == c
-               || j == RSTR && c == right[curpos]
-               || j == RCCL && member(c,left[curpos])){
-                       f = foll[curpos];
-                       number = *f;
-                       newpos = f+1;
-                       for(j=0;j<number;j++)
-                               temp[*newpos++] = 2;
-                       }
-               }
-       j = 0;
-       tz = temp + tptr;
-       while(temp < tz){
-               if(*temp == 2){
-                       j++;
-                       *temp++ = 1;
-                       }
-               else *temp++ = 0;
-               }
-       count = j;
-       return;
-       }
-notin(n)
-  int n;       {       /* see if tmpstat occurs previously */
-       register int *j,k;
-       register char *temp;
-       int i;
-       if(count == 0)
-               return(-2);
-       temp = tmpstat;
-       for(i=n;i>=0;i--){      /* for each state */
-               j = state[i];
-               if(count == *j++){
-                       for(k=0;k<count;k++)
-                               if(!temp[*j++])break;
-                       if(k >= count)
-                               return(i);
-                       }
-               }
-       return(-1);
-       }
-packtrans(st,tch,tst,cnt,tryit)
-  int st, *tst, cnt,tryit;
-  char *tch; {
-       /* pack transitions into nchar, nexts */
-       /* nchar is terminated by '\0', nexts uses cnt, followed by elements */
-       /* gotof[st] = index into nchr, nexts for state st */
-
-       /* sfall[st] =  t implies t is fall back state for st */
-       /*              == -1 implies no fall back */
-
-       int cmin, cval, tcnt, diff, p, *ast;
-       register int i,j,k;
-       char *ach;
-       int go[NCH], temp[NCH], c;
-       int swork[NCH];
-       char cwork[NCH];
-       int upper;
-
-       rcount =+ cnt;
-       cmin = -1;
-       cval = NCH;
-       ast = tst;
-       ach = tch;
-       /* try to pack transitions using ccl's */
-       if(!optim)goto nopack;          /* skip all compaction */
-       if(tryit){      /* ccl's used */
-               for(i=1;i<NCH;i++){
-                       go[i] = temp[i] = -1;
-                       symbol[i] = 1;
-                       }
-               for(i=0;i<cnt;i++){
-                       go[tch[i]] = tst[i];
-                       symbol[tch[i]] = 0;
-                       }
-               for(i=0; i<cnt;i++){
-                       c = match[tch[i]];
-                       if(go[c] != tst[i] || c == tch[i])
-                               temp[tch[i]] = tst[i];
-                       }
-               /* fill in error entries */
-               for(i=1;i<NCH;i++)
-                       if(symbol[i]) temp[i] = -2;     /* error trans */
-               /* count them */
-               k = 0;
-               for(i=1;i<NCH;i++)
-                       if(temp[i] != -1)k++;
-               if(k <cnt){     /* compress by char */
-# ifdef DEBUG
-                       if(debug) printf("use compression  %d,  %d vs %d\n",st,k,cnt);
-# endif
-                       k = 0;
-                       for(i=1;i<NCH;i++)
-                               if(temp[i] != -1){
-                                       cwork[k] = i;
-                                       swork[k++] = (temp[i] == -2 ? -1 : temp[i]);
-                                       }
-                       cwork[k] = 0;
-# ifdef PC
-                       ach = cwork;
-                       ast = swork;
-                       cnt = k;
-                       cpackflg[st] = TRUE;
-# endif
-                       }
-               }
-       for(i=0; i<st; i++){    /* get most similar state */
-                               /* reject state with more transitions, state already represented by a third state,
-                                       and state which is compressed by char if ours is not to be */
-               if(sfall[i] != -1) continue;
-               if(cpackflg[st] == 1) if(!(cpackflg[i] == 1)) continue;
-               p = gotof[i];
-               if(p == -1) /* no transitions */ continue;
-               tcnt = nexts[p];
-               if(tcnt > cnt) continue;
-               diff = 0;
-               k = 0;
-               j = 0;
-               upper = p + tcnt;
-               while(ach[j] && p < upper){
-                       while(ach[j] < nchar[p] && ach[j]){diff++; j++; }
-                       if(ach[j] == 0)break;
-                       if(ach[j] > nchar[p]){diff=NCH;break;}
-                       /* ach[j] == nchar[p] */
-                       if(ast[j] != nexts[++p] || ast[j] == -1 || (cpackflg[st] && ach[j] != match[ach[j]]))diff++;
-                       j++;
-                       }
-               while(ach[j]){
-                       diff++;
-                       j++;
-                       }
-               if(p < upper)diff = NCH;
-               if(diff < cval && diff < tcnt){
-                       cval = diff;
-                       cmin = i;
-                       if(cval == 0)break;
-                       }
-               }
-       /* cmin = state "most like" state st */
-# ifdef DEBUG
-       if(debug)printf("select st %d for st %d diff %d\n",cmin,st,cval);
-# endif
-# ifdef PS
-       if(cmin != -1){ /* if we can use st cmin */
-               gotof[st] = nptr;
-               k = 0;
-               sfall[st] = cmin;
-               p = gotof[cmin]+1;
-               j = 0;
-               while(ach[j]){
-                       /* if cmin has a transition on c, then so will st */
-                       /* st may be "larger" than cmin, however */
-                       while(ach[j] < nchar[p-1] && ach[j]){
-                               k++;
-                               nchar[nptr] = ach[j];
-                               nexts[++nptr] = ast[j];
-                               j++;
-                               }
-                       if(nchar[p-1] == 0)break;
-                       if(ach[j] > nchar[p-1]){
-                               warning("bad transition %d %d",st,cmin);
-                               goto nopack;
-                               }
-                       /* ach[j] == nchar[p-1] */
-                       if(ast[j] != nexts[p] || ast[j] == -1 || (cpackflg[st] && ach[j] != match[ach[j]])){
-                               k++;
-                               nchar[nptr] = ach[j];
-                               nexts[++nptr] = ast[j];
-                               }
-                       p++;
-                       j++;
-                       }
-               while(ach[j]){
-                       nchar[nptr] = ach[j];
-                       nexts[++nptr] = ast[j++];
-                       k++;
-                       }
-               nexts[gotof[st]] = cnt = k;
-               nchar[nptr++] = 0;
-               }
-       else {
-# endif
-nopack:
-       /* stick it in */
-               gotof[st] = nptr;
-               nexts[nptr] = cnt;
-               for(i=0;i<cnt;i++){
-                       nchar[nptr] = ach[i];
-                       nexts[++nptr] = ast[i];
-                       }
-               nchar[nptr++] = 0;
-# ifdef PS
-               }
-# endif
-       if(cnt < 1){
-               gotof[st] = -1;
-               nptr--;
-               }
-       else
-               if(nptr > ntrans)
-                       error("Too many transitions %s",(ntrans==NTRANS?"\nTry using %a num":""));
-       return;
-       }
-# ifdef DEBUG
-pstate(s)
-  int s; {
-       register int *p,i,j;
-       printf("State %d:\n",s);
-       p = state[s];
-       i = *p++;
-       if(i == 0) return;
-       printf("%4d",*p++);
-       for(j = 1; j<i; j++){
-               printf(", %4d",*p++);
-               if(j%30 == 0)putchar('\n');
-               }
-       putchar('\n');
-       return;
-       }
-# endif
-member(d,t)
-  int d;
-  char *t;     {
-       register int c;
-       register char *s;
-       c = d;
-       s = t;
-       c = cindex[c];
-       while(*s)
-               if(*s++ == c) return(1);
-       return(0);
-       }
-# ifdef DEBUG
-stprt(i)
-  int i; {
-       register int p, t;
-       printf("State %d:",i);
-       /* print actions, if any */
-       t = atable[i];
-       if(t != -1)printf(" final");
-       putchar('\n');
-       if(cpackflg[i] == TRUE)printf("backup char in use\n");
-       if(sfall[i] != -1)printf("fall back state %d\n",sfall[i]);
-       p = gotof[i];
-       if(p == -1) return;
-       printf("(%d transitions)\n",nexts[p]);
-       while(nchar[p]){
-               charc = 0;
-               if(nexts[p+1] >= 0)
-                       printf("%d\t",nexts[p+1]);
-               else printf("err\t");
-               allprint(nchar[p++]);
-               while(nexts[p] == nexts[p+1] && nchar[p]){
-                       if(charc > LINESIZE){
-                               charc = 0;
-                               printf("\n\t");
-                               }
-                       allprint(nchar[p++]);
-                       }
-               putchar('\n');
-               }
-       putchar('\n');
-       return;
-       }
-# endif
-acompute(s)    /* compute action list = set of poss. actions */
-  int s; {
-       register int *p, i, j;
-       int cnt, m;
-       int temp[300], k, neg[300], n;
-       k = 0;
-       n = 0;
-       p = state[s];
-       cnt = *p++;
-       if(cnt > 300)
-               error("Too many positions for one state - acompute");
-       for(i=0;i<cnt;i++){
-               if(name[*p] == FINAL)temp[k++] = left[*p];
-               else if(name[*p] == S1FINAL){temp[k++] = left[*p];
-                       if (left[*p] >NACTIONS) error("Too many right contexts");
-                       extra[left[*p]] = 1;
-                       }
-               else if(name[*p] == S2FINAL)neg[n++] = left[*p];
-               p++;
-               }
-       atable[s] = -1;
-       if(k < 1 && n < 1) return;
-# ifdef DEBUG
-       if(debug) printf("final %d actions:",s);
-# endif
-       /* sort action list */
-       for(i=0; i<k; i++)
-               for(j=i+1;j<k;j++)
-                       if(temp[j] < temp[i]){
-                               m = temp[j];
-                               temp[j] = temp[i];
-                               temp[i] = m;
-                               }
-       /* remove dups */
-       for(i=0;i<k-1;i++)
-               if(temp[i] == temp[i+1]) temp[i] = 0;
-       /* copy to permanent quarters */
-       atable[s] = aptr;
-# ifdef DEBUG
-       if(!ratfor)fprintf(fout,"/* actions for state %d */",s);
-# endif
-       putc('\n',fout);
-       for(i=0;i<k;i++)
-               if(temp[i] != 0){
-                       ratfor ? fprintf(fout,"data vstop(%d)/%d/\n",aptr,temp[i]) : fprintf(fout,"%d,\n",temp[i]);
-# ifdef DEBUG
-                       if(debug)
-                               printf("%d ",temp[i]);
-# endif
-                       aptr++;
-                       }
-       for(i=0;i<n;i++){               /* copy fall back actions - all neg */
-               ratfor ? fprintf(fout,"data vstop(%d)/%d/\n",aptr,neg[i]) : fprintf(fout,"%d,\n",neg[i]);
-               aptr++;
-# ifdef DEBUG
-               if(debug)printf("%d ",neg[i]);
-# endif
-               }
-# ifdef DEBUG
-       if(debug)putchar('\n');
-# endif
-       ratfor ? fprintf(fout,"data vstop (%d)/0/\n",aptr) : fprintf(fout,"0,\n");
-       aptr++;
-       return;
-       }
-# ifdef DEBUG
-pccl() {
-       /* print character class sets */
-       register int i, j;
-       printf("char class intersection\n");
-       for(i=0; i< ccount; i++){
-               charc = 0;
-               printf("class %d:\n\t",i);
-               for(j=1;j<NCH;j++)
-                       if(cindex[j] == i){
-                               allprint(j);
-                               if(charc > LINESIZE){
-                                       printf("\n\t");
-                                       charc = 0;
-                                       }
-                               }
-               putchar('\n');
-               }
-       charc = 0;
-       printf("match:\n");
-       for(i=0;i<NCH;i++){
-               allprint(match[i]);
-               if(charc > LINESIZE){
-                       putchar('\n');
-                       charc = 0;
-                       }
-               }
-       putchar('\n');
-       return;
-       }
-# endif
-mkmatch(){
-       register int i;
-       char tab[NCH];
-       for(i=0; i<ccount; i++)
-               tab[i] = 0;
-       for(i=1;i<NCH;i++)
-               if(tab[cindex[i]] == 0)
-                       tab[cindex[i]] = i;
-       /* tab[i] = principal char for new ccl i */
-       for(i = 1; i<NCH; i++)
-               match[i] = tab[cindex[i]];
-       return;
-       }
-layout(){
-       /* format and output final program's tables */
-       register int i, j, k;
-       int  top, bot, startup, omin;
-       startup = 0;
-       for(i=0; i<outsize;i++)
-               verify[i] = advance[i] = 0;
-       omin = 0;
-       yytop = 0;
-       for(i=0; i<= stnum; i++){       /* for each state */
-               j = gotof[i];
-               if(j == -1){
-                       stoff[i] = 0;
-                       continue;
-                       }
-               bot = j;
-               while(nchar[j])j++;
-               top = j - 1;
-# if DEBUG
-               if (debug)
-                       {
-                       printf("State %d: (layout)\n", i);
-                       for(j=bot; j<=top;j++)
-                               {
-                               printf("  %o", nchar[j]);
-                               if (j%10==0) putchar('\n');
-                               }
-                       putchar('\n');
-                       }
-# endif
-               while(verify[omin+ZCH]) omin++;
-               startup = omin;
-# if DEBUG
-               if (debug) printf("bot,top %d, %d startup begins %d\n",bot,top,startup);
-# endif
-               if(chset){
-                       do {
-                               startup =+ 1;
-                               if(startup > outsize - ZCH)
-                                       error("output table overflow");
-                               for(j = bot; j<= top; j++){
-                                       k=startup+ctable[nchar[j]];
-                                       if(verify[k])break;
-                                       }
-                               } while (j <= top);
-# if DEBUG
-                       if (debug) printf(" startup will be %d\n",startup);
-# endif
-                       /* have found place */
-                       for(j = bot; j<= top; j++){
-                               k = startup + ctable[nchar[j]];
-                               if (ctable[nchar[j]]<=0)
-                                printf("j %d nchar %d ctable.nch %d\n",j,nchar[j],ctable[nchar[k]]);
-                               verify[k] = i+1;                        /* state number + 1*/
-                               advance[k] = nexts[j+1]+1;              /* state number + 1*/
-                               if(yytop < k) yytop = k;
-                               }
-                       }
-               else {
-                       do {
-                               startup =+ 1;
-                               if(startup > outsize - ZCH)
-                                       error("output table overflow");
-                               for(j = bot; j<= top; j++){
-                                       k = startup + nchar[j];
-                                       if(verify[k])break;
-                                       }
-                               } while (j <= top);
-                       /* have found place */
-# if DEBUG
-       if (debug) printf(" startup going to be %d\n", startup);
-# endif
-                       for(j = bot; j<= top; j++){
-                               k = startup + nchar[j];
-                               verify[k] = i+1;                        /* state number + 1*/
-                               advance[k] = nexts[j+1]+1;              /* state number + 1*/
-                               if(yytop < k) yytop = k;
-                               }
-                       }
-               stoff[i] = startup;
-               }
-
-       /* stoff[i] = offset into verify, advance for trans for state i */
-       /* put out yywork */
-       if(ratfor){
-               fprintf(fout, "define YYTOPVAL %d\n", yytop);
-               rprint(verify,"verif",yytop+1);
-               rprint(advance,"advan",yytop+1);
-               shiftr(stoff, stnum); 
-               rprint(stoff,"stoff",stnum+1);
-               shiftr(sfall, stnum); upone(sfall, stnum+1);
-               rprint(sfall,"sfall",stnum+1);
-               bprint(extra,"extra",casecount+1);
-               bprint(match,"match",NCH);
-               shiftr(atable, stnum);
-               rprint(atable,"atable",stnum+1);
-               return;
-               }
-       fprintf(fout,"# define YYTYPE %s\n",stnum+1 > NCH ? "int" : "char");
-       fprintf(fout,"struct yywork { YYTYPE verify, advance; } yycrank[] ={\n");
-       for(i=0;i<=yytop;i=+4){
-               for(j=0;j<4;j++){
-                       k = i+j;
-                       if(verify[k])
-                               fprintf(fout,"%d,%d,\t",verify[k],advance[k]);
-                       else
-                               fprintf(fout,"0,0,\t");
-                       }
-               putc('\n',fout);
-               }
-       fprintf(fout,"0,0};\n");
-
-       /* put out yysvec */
-
-       fprintf(fout,"struct yysvf yysvec[] ={\n");
-       fprintf(fout,"0,\t0,\t0,\n");
-       for(i=0;i<=stnum;i++){  /* for each state */
-               if(cpackflg[i])stoff[i] = -stoff[i];
-               fprintf(fout,"yycrank+%d,\t",stoff[i]);
-               if(sfall[i] != -1)
-                       fprintf(fout,"yysvec+%d,\t", sfall[i]+1);       /* state + 1 */
-               else fprintf(fout,"0,\t\t");
-               if(atable[i] != -1)
-                       fprintf(fout,"yyvstop+%d,",atable[i]);
-               else fprintf(fout,"0,\t");
-# ifdef DEBUG
-               fprintf(fout,"\t\t/* state %d */",i);
-# endif
-               putc('\n',fout);
-               }
-       fprintf(fout,"0,\t0,\t0};\n");
-
-       /* put out yymatch */
-       
-       fprintf(fout,"struct yywork *yytop = yycrank+%d;\n",yytop);
-       fprintf(fout,"struct yysvf *yybgin = yysvec+1;\n");
-       if(optim){
-               fprintf(fout,"char yymatch[] ={\n");
-               if (chset==0) /* no chset, put out in normal order */
-                       {
-                       for(i=0; i<NCH; i=+8){
-                               for(j=0; j<8; j++){
-                                       int fbch;
-                                       fbch = match[i+j];
-                                       if(printable(fbch) && fbch != '\'' && fbch != '\\')
-                                               fprintf(fout,"'%c' ,",fbch);
-                                       else fprintf(fout,"0%-3o,",fbch);
-                                       }
-                               putc('\n',fout);
-                               }
-                       }
-               else
-                       {
-                       int *fbarr;
-                       fbarr = myalloc(2*NCH, sizeof(*fbarr));
-                       if (fbarr==0)
-                               error("No space for char table reverse",0);
-                       for(i=0; i<ZCH; i++)
-                               fbarr[i]=0;
-                       for(i=0; i<NCH; i++)
-                               fbarr[ctable[i]] = ctable[match[i]];
-                       for(i=0; i<ZCH; i+=8)
-                               {
-                               for(j=0; j<8; j++)
-                                       fprintf(fout, "0%-3o,",fbarr[i+j]);
-                               putc('\n',fout);
-                               }
-                       cfree(fbarr, 2*NCH, 1);
-                       }
-               fprintf(fout,"0};\n");
-               }
-       /* put out yyextra */
-       fprintf(fout,"char yyextra[] ={\n");
-       for(i=0;i<casecount;i=+8){
-               for(j=0;j<8;j++)
-                       fprintf(fout, "%d,", i+j<NACTIONS ?
-                               extra[i+j] : 0);
-               putc('\n',fout);
-               }
-       fprintf(fout,"0};\n");
-       return;
-       }
-rprint(a,s,n)
-  char *s;
-  int *a, n; {
-       register int i;
-       fprintf(fout,"block data\n");
-       fprintf(fout,"common /L%s/ %s\n",s,s);
-       fprintf(fout,"define S%s %d\n",s,n);
-       fprintf(fout,"integer %s (S%s)\n",s,s);
-       for(i=1; i<=n; i++)
-               {
-               if (i%8==1) fprintf(fout, "data ");
-               fprintf(fout, "%s (%d)/%d/",s,i,a[i]);
-               fprintf(fout, (i%8 && i<n) ? ", " : "\n");
-               }
-       fprintf(fout,"end\n");
-       }
-shiftr(a, n)
-       int *a;
-{
-int i;
-for(i=n; i>=0; i--)
-       a[i+1]=a[i];
-}
-upone(a,n)
-       int *a;
-{
-int i;
-for(i=0; i<=n ; i++)
-       a[i]++;
-}
-bprint(a,s,n)
- char *s,  *a;
- int  n; {
-       register int i, j, k;
-       fprintf(fout,"block data\n");
-       fprintf(fout,"common /L%s/ %s\n",s,s);
-       fprintf(fout,"define S%s %d\n",s,n);
-       fprintf(fout,"integer %s (S%s)\n",s,s);
-       for(i=1;i<n;i=+8){
-               fprintf(fout,"data %s (%d)/%d/",s,i,a[i]);
-               for(j=1;j<8;j++){
-                       k = i+j;
-                       if(k < n)fprintf(fout,", %s (%d)/%d/",s,k,a[k]);
-                       }
-               putc('\n',fout);
-               }
-       fprintf(fout,"end\n");
-       }
-# ifdef PP
-padd(array,n)
-  int **array;
-  int n; {
-       register int i, *j, k;
-       array[n] = nxtpos;
-       if(count == 0){
-               *nxtpos++ = 0;
-               return;
-               }
-       for(i=tptr-1;i>=0;i--){
-               j = array[i];
-               if(j && *j++ == count){
-                       for(k=0;k<count;k++)
-                               if(!tmpstat[*j++])break;
-                       if(k >= count){
-                               array[n] = array[i];
-                               return;
-                               }
-                       }
-               }
-       add(array,n);
-       return;
-       }
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/lint/READ_ME b/.ref-Research-V7/usr/src/cmd/lint/READ_ME
deleted file mode 100644 (file)
index 4d4dd04..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Most of lint's source files are shared with the portable
-compiler: they are found in /usr/src/cmd/mip.
-The files here are only those which are unique to lint.
diff --git a/.ref-Research-V7/usr/src/cmd/lint/SHELL b/.ref-Research-V7/usr/src/cmd/lint/SHELL
deleted file mode 100755 (executable)
index 77c772a..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-L=/usr/lib/lint T=/usr/tmp/lint.$$ PATH=/bin:/usr/bin O="-C -Dlint" X= P=unix
-LL=/usr/lib
-trap "rm -f $T; exit" 1 2 15
-for A in $*
-do
-       case $A in
-       -*n*)   P= ;;
-       -*p*)   P=port ;;
-       esac
-       case $A in
-       -l*)    (/lib/cpp $O $LL/llib$A | ${L}1 -v$X-L$A >>$T)2>&1 ;;
-       -[IDOU]*)       O="$O $A" ;;
-       -X)     LL=/usr/src/lint L=/usr/src/lint/lpass ;;
-       -*)     X="$X$A" ;;
-       *)      (/lib/cpp $O $A | ${L}1 $X-L$A >>$T)2>&1
-       esac
-       done
-case $P in
-       unix)   (/lib/cpp $O $LL/llib-lc | ${L}1 -v$X-L-lc >>$T)2>&1 ;;
-       port)   (/lib/cpp $O $LL/llib-port | ${L}1 -v$X-L-lc >>$T)2>&1 ;;
-       esac
-sort -u $T | ${L}2 $X
-rm -f $T
diff --git a/.ref-Research-V7/usr/src/cmd/lint/lint.c b/.ref-Research-V7/usr/src/cmd/lint/lint.c
deleted file mode 100644 (file)
index 663cd63..0000000
+++ /dev/null
@@ -1,793 +0,0 @@
-# include "mfile1"
-
-# include "lmanifest"
-
-# include <ctype.h>
-
-# define VAL 0
-# define EFF 1
-
-/* these are appropriate for the -p flag */
-int  SZCHAR = 8;
-int  SZINT = 16;
-int  SZFLOAT = 32;
-int  SZDOUBLE = 64;
-int  SZLONG = 32;
-int  SZSHORT = 16;
-int SZPOINT = 16;
-int ALCHAR = 8;
-int ALINT = 16;
-int ALFLOAT = 32;
-int ALDOUBLE = 64;
-int ALLONG = 32;
-int ALSHORT = 16;
-int ALPOINT = 16;
-int ALSTRUCT = 16;
-
-int vflag = 1;  /* tell about unused argments */
-int xflag = 0;  /* tell about unused externals */
-int argflag = 0;  /* used to turn off complaints about arguments */
-int libflag = 0;  /* used to generate library descriptions */
-int vaflag = -1;  /* used to signal functions with a variable number of args */
-int aflag = 0;  /* used th check precision of assignments */
-
-char *flabel = "xxx";
-
-# define LNAMES 100
-
-struct lnm {
-       short lid, flgs;
-       }  lnames[LNAMES], *lnp;
-
-contx( p, down, pl, pr ) register NODE *p; register *pl, *pr; {
-
-       *pl = *pr = VAL;
-       switch( p->op ){
-
-       case ANDAND:
-       case OROR:
-       case QUEST:
-               *pr = down;
-               break;
-
-       case SCONV:
-       case PCONV:
-       case COLON:
-               *pr = *pl = down;
-               break;
-
-       case COMOP:
-               *pl = EFF;
-               *pr = down;
-
-       case FORCE:
-       case INIT:
-       case UNARY CALL:
-       case STCALL:
-       case UNARY STCALL:
-       case CALL:
-       case UNARY FORTCALL:
-       case FORTCALL:
-       case CBRANCH:
-               break;
-
-       default:
-               if( asgop(p->op) ) break;
-               if( p->op == UNARY MUL && ( p->type == STRTY || p->type == UNIONTY) ) {
-                       break;  /* the compiler does this... */
-                       }
-               if( down == EFF && hflag ) werror( "null effect" );
-
-               }
-       }
-
-ecode( p ) NODE *p; {
-       /* compile code for p */
-
-       fwalk( p, contx, EFF );
-       lnp = lnames;
-       lprt( p, EFF, 0 );
-       }
-
-ejobcode( flag ){
-       /* called after processing each job */
-       /* flag is nonzero if errors were detected */
-       register k;
-       register struct symtab *p;
-
-       for( p=stab; p< &stab[SYMTSZ]; ++p ){
-
-               if( p->stype != TNULL ) {
-
-                       if( p->stype == STRTY || p->stype == UNIONTY ){
-                               if( dimtab[p->sizoff+1] < 0 ){ /* never defined */
-                                       if( hflag ) werror( "struct/union %.7s never defined", p->sname );
-                                       }
-                               }
-
-                       switch( p->sclass ){
-                       
-                       case STATIC:
-                               if( p->suse > 0 ){
-                                       k = lineno;
-                                       lineno = p->suse;
-                                       uerror( "static variable %s unused",
-                                               p->sname );
-                                       lineno = k;
-                                       break;
-                                       }
-
-                       case EXTERN:
-                       case USTATIC:
-                               /* with the xflag, worry about externs not used */
-                               /* the filename may be wrong here... */
-                               if( xflag && p->suse >= 0 && !libflag ){
-                                       printf( "%.7s\t%03d\t%o\t%d\t", p->sname, LDX, p->stype, 0 );
-                                       /* we don't really know the file number; we know only the line 
-                                               number, so we put only that out */
-                                       printf( "\"???\"\t%d\t%s\n", p->suse, flabel );
-                                       }
-                       
-                       case EXTDEF:
-                               if( p->suse < 0 ){  /* used */
-                                       printf( "%.7s\t%03d\t%o\t%d\t", exname(p->sname), LUM, p->stype, 0 );
-                                       fident( -p->suse );
-                                       }
-                               break;
-                               }
-                       
-                       }
-
-               }
-       exit( 0 );
-       }
-
-fident( line ){ /* like ident, but lineno = line */
-       register temp;
-       temp = lineno;
-       lineno = line;
-       ident();
-       lineno = temp;
-       }
-
-ident(){ /* write out file and line identification  */
-       printf( "%s\t%d\t%s\n", ftitle, lineno, flabel );
-       }
-
-bfcode( a, n ) int a[]; {
-       /* code for the beginning of a function; a is an array of
-               indices in stab for the arguments; n is the number */
-       /* this must also set retlab */
-       register i;
-       register struct symtab *cfp;
-       register unsigned t;
-
-       retlab = 1;
-       cfp = &stab[curftn];
-
-       /* if variable number of arguments, only print the ones which will be checked */
-       if( vaflag > 0 ){
-               if( n < vaflag ) werror( "declare the VARARGS arguments you want checked!" );
-               else n = vaflag;
-               }
-       printf( "%.7s\t%03d\t%o\t%d\t", exname(cfp->sname), libflag?LIB:LDI,
-               cfp->stype, vaflag>=0?-n:n );
-       vaflag = -1;
-
-       for( i=0; i<n; ++i ) {
-               switch( t = stab[a[i]].stype ){
-
-               case ULONG:
-                       break;
-
-               case CHAR:
-               case SHORT:
-                       t = INT;
-                       break;
-
-               case UCHAR:
-               case USHORT:
-               case UNSIGNED:
-                       t = UNSIGNED;
-                       break;
-
-                       }
-
-               printf( "%o\t", t );
-               }
-       ident();
-       }
-
-ctargs( p ) NODE *p; {
-       /* count arguments; p points to at least one */
-       /* the arguemnts are a tower of commasto the left */
-       register c;
-       c = 1; /* count the rhs */
-       while( p->op == CM ){
-               ++c;
-               p = p->left;
-               }
-       return( c );
-       }
-
-lpta( p ) NODE *p; {
-       TWORD t;
-
-       if( p->op == CM ){
-               lpta( p->left );
-               p = p->right;
-               }
-       switch( t = p->type ){
-
-               case CHAR:
-               case SHORT:
-                       t = INT;
-               case LONG:
-               case ULONG:
-               case INT:
-               case UNSIGNED:
-                       break;
-
-               case UCHAR:
-               case USHORT:
-                       t = UNSIGNED;
-                       break;
-
-               case FLOAT:
-                       printf( "%o\t", DOUBLE );
-                       return;
-
-               default:
-                       printf( "%o\t", p->type );
-                       return;
-               }
-
-       if( p->op == ICON ) printf( "%o<1\t", t );
-       else printf( "%o\t", t );
-       }
-
-# define VALSET 1
-# define VALUSED 2
-# define VALASGOP 4
-# define VALADDR 8
-
-lprt( p, down, uses ) register NODE *p; {
-       register struct symtab *q;
-       register id;
-       register acount;
-       register down1, down2;
-       register use1, use2;
-       register struct lnm *np1, *np2;
-
-       /* first, set variables which are set... */
-
-       use1 = use2 = VALUSED;
-       if( p->op == ASSIGN ) use1 = VALSET;
-       else if( p->op == UNARY AND ) use1 = VALADDR;
-       else if( asgop( p->op ) ){ /* =ops */
-               use1 = VALUSED|VALSET;
-               if( down == EFF ) use1 |= VALASGOP;
-               }
-
-
-       /* print the lines for lint */
-
-       down2 = down1 = VAL;
-       acount = 0;
-
-       switch( p->op ){
-
-       case EQ:
-       case NE:
-       case GT:
-       case GE:
-       case LT:
-       case LE:
-               if( p->left->type == CHAR && p->right->op==ICON && p->right->lval < 0 ){
-                       werror( "nonportable character comparison" );
-                       }
-               if( (p->op==EQ || p->op==NE ) && ISUNSIGNED(p->left->type) && p->right->op == ICON ){
-                       if( p->right->lval < 0 && p->right->rval == NONAME && !ISUNSIGNED(p->right->type) ){
-                               werror( "comparison of unsigned with negative constant" );
-                               }
-                       }
-               break;
-
-       case UGE:
-       case ULT:
-               if( p->right->op == ICON && p->right->lval == 0 && p->right->rval == NONAME ){
-                       werror( "unsigned comparison with 0?" );
-                       break;
-                       }
-       case UGT:
-       case ULE:
-               if( p->right->op == ICON && p->right->lval <= 0 && !ISUNSIGNED(p->right->type) && p->right->rval == NONAME ){
-                       werror( "degenerate unsigned comparison" );
-                       }
-               break;
-
-       case COMOP:
-               down1 = EFF;
-
-       case ANDAND:
-       case OROR:
-       case QUEST:
-               down2 = down;
-               /* go recursively left, then right  */
-               np1 = lnp;
-               lprt( p->left, down1, use1 );
-               np2 = lnp;
-               lprt( p->right, down2, use2 );
-               lmerge( np1, np2, 0 );
-               return;
-
-       case SCONV:
-       case PCONV:
-       case COLON:
-               down1 = down2 = down;
-               break;
-
-       case CALL:
-       case STCALL:
-       case FORTCALL:
-               acount = ctargs( p->right );
-       case UNARY CALL:
-       case UNARY STCALL:
-       case UNARY FORTCALL:
-               if( p->left->op == ICON && (id=p->left->rval) != NONAME ){ /* used to be &name */
-                       printf( "%.7s\t%03d\t%o\t%d\t",
-                               exname(stab[id].sname),
-                               down==EFF ? LUE : LUV,
-                               DECREF(p->left->type), acount );
-                       if( acount ) lpta( p->right );
-                       ident();
-                       }
-               break;
-
-       case ICON:
-               /* look for &name case */
-               if( (id = p->rval) >= 0 && id != NONAME ){
-                       q = &stab[id];
-                       q->sflags |= (SREF|SSET);
-                       }
-               return;
-
-       case NAME:
-               if( (id = p->rval) >= 0 && id != NONAME ){
-                       q = &stab[id];
-                       if( (uses&VALUSED) && !(q->sflags&SSET) ){
-                               if( q->sclass == AUTO || q->sclass == REGISTER ){
-                                       if( !ISARY(q->stype ) && !ISFTN(q->stype) && q->stype!=STRTY ){
-                                               werror( "%.7s may be used before set", q->sname );
-                                               q->sflags |= SSET;
-                                               }
-                                       }
-                               }
-                       if( uses & VALASGOP ) break;  /* not a real use */
-                       if( uses & VALSET ) q->sflags |= SSET;
-                       if( uses & VALUSED ) q->sflags |= SREF;
-                       if( uses & VALADDR ) q->sflags |= (SREF|SSET);
-                       if( p->lval == 0 ){
-                               lnp->lid = id;
-                               lnp->flgs = (uses&VALADDR)?0:((uses&VALSET)?VALSET:VALUSED);
-                               if( ++lnp >= &lnames[LNAMES] ) --lnp;
-                               }
-                       }
-               return;
-
-               }
-
-       /* recurse, going down the right side first if we can */
-
-       switch( optype(p->op) ){
-
-       case BITYPE:
-               np1 = lnp;
-               lprt( p->right, down2, use2 );
-       case UTYPE:
-               np2 = lnp;
-               lprt( p->left, down1, use1 );
-               }
-
-       if( optype(p->op) == BITYPE ){
-               if( p->op == ASSIGN && p->left->op == NAME ){ /* special case for a =  .. a .. */
-                       lmerge( np1, np2, 0 );
-                       }
-               else lmerge( np1, np2, p->op != COLON );
-               /* look for assignments to fields, and complain */
-               if( p->op == ASSIGN && p->left->op == FLD && p->right->op == ICON ) fldcon( p );
-               }
-
-       }
-
-lmerge( np1, np2, flag ) struct lnm *np1, *np2; {
-       /* np1 and np2 point to lists of lnm members, for the two sides
-        * of a binary operator
-        * flag is 1 if commutation is possible, 0 otherwise
-        * lmerge returns a merged list, starting at np1, resetting lnp
-        * it also complains, if appropriate, about side effects
-        */
-
-       register struct lnm *npx, *npy;
-
-       for( npx = np2; npx < lnp; ++npx ){
-
-               /* is it already there? */
-               for( npy = np1; npy < np2; ++npy ){
-                       if( npx->lid == npy->lid ){ /* yes */
-                               if( npx->flgs == 0 || npx->flgs == (VALSET|VALUSED) )
-                                       ;  /* do nothing */
-                               else if( (npx->flgs|npy->flgs)== (VALSET|VALUSED) ||
-                                       (npx->flgs&npy->flgs&VALSET) ){
-                                       if( flag ) werror( "%.8s evaluation order undefined", stab[npy->lid].sname );
-                                       }
-                               if( npy->flgs == 0 ) npx->flgs = 0;
-                               else npy->flgs |= npx->flgs;
-                               goto foundit;
-                               }
-                       }
-
-               /* not there: update entry */
-               np2->lid = npx->lid;
-               np2->flgs = npx->flgs;
-               ++np2;
-
-               foundit: ;
-               }
-
-       /* all finished: merged list is at np1 */
-       lnp = np2;
-       }
-
-efcode(){
-       /* code for the end of a function */
-       register struct symtab *cfp;
-
-       cfp = &stab[curftn];
-       if( retstat & RETVAL ){
-               printf( "%.7s\t%03d\t%o\t%d\t", exname(cfp->sname),
-                       LRV, DECREF( cfp->stype), 0 );
-               ident();
-               }
-       if( !vflag ){
-               vflag = argflag;
-               argflag = 0;
-               }
-       if( retstat == RETVAL+NRETVAL )
-               werror( "function %.8s has return(e); and return;", cfp->sname);
-       }
-
-aocode(p) struct symtab *p; {
-       /* called when automatic p removed from stab */
-       register struct symtab *cfs;
-       cfs = &stab[curftn];
-       if(p->suse>0 && !(p->sflags&SMOS) ){
-               if( p->sclass == PARAM ){
-                       if( vflag ) werror( "argument %.7s unused in function %.7s",
-                               p->sname,
-                               cfs->sname );
-                       }
-               else {
-                       if( p->sclass != TYPEDEF ) werror( "%.7s unused in function %.7s",
-                               p->sname, cfs->sname );
-                       }
-               }
-
-       if( p->suse < 0 && (p->sflags & (SSET|SREF|SMOS)) == SSET &&
-               !ISARY(p->stype) && !ISFTN(p->stype) ){
-
-               werror( "%.7s set but not used in function %.7s", p->sname, cfs->sname );
-               }
-
-       if( p->stype == STRTY || p->stype == UNIONTY || p->stype == ENUMTY ){
-               if( dimtab[p->sizoff+1] < 0 ) werror( "structure %.7s never defined", p->sname );
-               }
-
-       }
-
-defnam( p ) register struct symtab *p; {
-       /* define the current location as the name p->sname */
-
-       if( p->sclass == STATIC && p->slevel>1 ) return;
-
-       if( !ISFTN( p->stype ) ){
-               printf( "%.7s\t%03d\t%o\t%d\t",
-                       exname(p->sname), libflag?LIB:LDI, p->stype, 0 );
-               ident();
-               }
-       }
-
-zecode( n ){
-       /* n integer words of zeros */
-       OFFSZ temp;
-       temp = n;
-       inoff += temp*SZINT;
-       ;
-       }
-
-andable( p ) NODE *p; {  /* p is a NAME node; can it accept & ? */
-       register r;
-
-       if( p->op != NAME ) cerror( "andable error" );
-
-       if( (r = p->rval) < 0 ) return(1);  /* labels are andable */
-
-       if( stab[r].sclass == AUTO || stab[r].sclass == PARAM ) return(0); 
-       return(1);
-       }
-
-NODE *
-clocal(p) NODE *p; {
-
-       /* this is called to do local transformations on
-          an expression tree preparitory to its being
-          written out in intermediate code.
-       */
-
-       /* the major essential job is rewriting the
-          automatic variables and arguments in terms of
-          REG and OREG nodes */
-       /* conversion ops which are not necessary are also clobbered here */
-       /* in addition, any special features (such as rewriting
-          exclusive or) are easily handled here as well */
-
-       register o;
-       register unsigned t, tl;
-
-       switch( o = p->op ){
-
-       case SCONV:
-       case PCONV:
-               if( p->left->type==ENUMTY ){
-                       p->left = pconvert( p->left );
-                       }
-               /* assume conversion takes place; type is inherited */
-               t = p->type;
-               tl = p->left->type;
-               if( aflag && (tl==LONG||tl==ULONG) && (t!=LONG&&t!=ULONG) ){
-                       werror( "long assignment may lose accuracy" );
-                       }
-               if( ISPTR(tl) && ISPTR(t) ){
-                       tl = DECREF(tl);
-                       t = DECREF(t);
-                       switch( ISFTN(t) + ISFTN(tl) ){
-
-                       case 0:  /* neither is a function pointer */
-                               if( talign(t,p->csiz) > talign(tl,p->left->csiz) ){
-                                       if( hflag||pflag ) werror( "possible pointer alignment problem" );
-                                       }
-                               break;
-
-                       case 1:
-                               werror( "questionable conversion of function pointer" );
-
-                       case 2:
-                               ;
-                               }
-                       }
-               p->left->type = p->type;
-               p->left->cdim = p->cdim;
-               p->left->csiz = p->csiz;
-               p->op = FREE;
-               return( p->left );
-
-       case PVCONV:
-       case PMCONV:
-               if( p->right->op != ICON ) cerror( "bad conversion");
-               p->op = FREE;
-               return( buildtree( o==PMCONV?MUL:DIV, p->left, p->right ) );
-
-               }
-
-       return(p);
-       }
-
-NODE *
-offcon( off, t, d, s ) OFFSZ off; TWORD t;{  /* make a structure offset node */
-       register NODE *p;
-       p = bcon(0);
-       p->lval = off/SZCHAR;
-       return(p);
-       }
-
-noinit(){
-       /* storage class for such as "int a;" */
-       return( pflag ? EXTDEF : EXTERN );
-       }
-
-
-cinit( p, sz ) NODE *p; { /* initialize p into size sz */
-       inoff += sz;
-       if( p->op == INIT ){
-               if( p->left->op == ICON ) return;
-               if( p->left->op == NAME && p->left->type == MOE ) return;
-               }
-       uerror( "illegal initialization" );
-       }
-
-char *
-exname( p ) char *p; {
-       /* make a name look like an external name in the local machine */
-       static char aa[8];
-       register int i;
-
-       if( !pflag ) return(p);
-       for( i=0; i<6; ++i ){
-               if( isupper(*p ) ) aa[i] = tolower( *p );
-               else aa[i] = *p;
-               if( *p ) ++p;
-               }
-       aa[6] = '\0';
-       return( aa );
-       }
-
-where(f){ /* print true location of error */
-       if( f == 'u' && nerrors>1 ) --nerrors; /* don't get "too many errors" */
-       fprintf( stderr, "%s, line %d: ", ftitle, lineno );
-       }
-
-       /* a number of dummy routines, unneeded by lint */
-
-branch(n){;}
-defalign(n){;}
-deflab(n){;}
-bycode(t,i){;}
-cisreg(t){return(1);}  /* everyting is a register variable! */
-
-fldty(p) struct symtab *p; {
-       ; /* all types are OK here... */
-       }
-
-fldal(t) unsigned t; { /* field alignment... */
-       if( t == ENUMTY ) return( ALCHAR );  /* this should be thought through better... */
-       if( ISPTR(t) ){ /* really for the benefit of honeywell (and someday IBM) */
-               if( pflag ) uerror( "nonportable field type" );
-               }
-       else uerror( "illegal field type" );
-       return(ALINT);
-       }
-
-main( argc, argv ) char *argv[]; {
-       char *p;
-
-       /* handle options */
-
-       for( p=argv[1]; *p; ++p ){
-
-               switch( *p ){
-
-               case '-':
-                       continue;
-
-               case 'L':  /* produced by driver program */
-                       flabel = p;
-                       goto break2;
-
-               case '\0':
-                       break;
-
-               case 'b':
-                       brkflag = 1;
-                       continue;
-
-               case 'p':
-                       pflag = 1;
-                       continue;
-
-               case 'c':
-                       cflag = 1;
-                       continue;
-
-               case 's':
-                       /* for the moment, -s triggers -h */
-
-               case 'h':
-                       hflag = 1;
-                       continue;
-
-               case 'v':
-                       vflag = 0;
-                       continue;
-
-               case 'x':
-                       xflag = 1;
-                       continue;
-
-               case 'a':
-                       aflag = 1;
-               case 'u':       /* done in second pass */
-               case 'n':       /* done in shell script */
-                       continue;
-
-               case 't':
-                       werror( "option %c now default: see `man 6 lint'", *p );
-                       continue;
-
-               default:
-                       uerror( "illegal option: %c", *p );
-                       continue;
-
-                       }
-               }
-
-       break2:
-       if( !pflag ){  /* set sizes to sizes of target machine */
-# ifdef gcos
-               SZCHAR = ALCHAR = 9;
-# else
-               SZCHAR = ALCHAR = 8;
-# endif
-               SZINT = ALINT = sizeof(int)*SZCHAR;
-               SZFLOAT = ALFLOAT = sizeof(float)*SZCHAR;
-               SZDOUBLE = ALDOUBLE = sizeof(double)*SZCHAR;
-               SZLONG = ALLONG = sizeof(long)*SZCHAR;
-               SZSHORT = ALSHORT = sizeof(short)*SZCHAR;
-               SZPOINT = ALPOINT = sizeof(int *)*SZCHAR;
-               ALSTRUCT = ALINT;
-               /* now, fix some things up for various machines (I wish we had "alignof") */
-
-# ifdef pdp11
-               ALLONG = ALDOUBLE = ALFLOAT = ALINT;
-#endif
-# ifdef ibm
-               ALSTRUCT = ALCHAR;
-#endif
-               }
-
-       return( mainp1( argc, argv ) );
-       }
-
-ctype( type ) unsigned type; { /* are there any funny types? */
-       return( type );
-       }
-
-commdec( i ){
-       /* put out a common declaration */
-       register struct symtab *p;
-       p = &stab[i];
-       printf( "%.7s\t%03d\t%o\t%d\t", exname(p->sname), libflag?LIB:LDC, p->stype, 0 );
-       ident();
-       }
-
-isitfloat ( s ) char *s; {
-       /* s is a character string;
-          if floating point is implemented, set dcon to the value of s */
-       /* lint version
-       */
-       dcon = atof( s );
-       return( FCON );
-       }
-
-fldcon( p ) register NODE *p; {
-       /* p is an assignment of a constant to a field */
-       /* check to see if the assignment is going to overflow, or otherwise cause trouble */
-       register s;
-       CONSZ v;
-
-       if( !hflag & !pflag ) return;
-
-       s = UPKFSZ(p->left->rval);
-       v = p->right->lval;
-
-       switch( p->left->type ){
-
-       case CHAR:
-       case INT:
-       case SHORT:
-       case LONG:
-       case ENUMTY:
-               if( v>=0 && (v>>(s-1))==0 ) return;
-               werror( "precision lost in assignment to (possibly sign-extended) field" );
-       default:
-               return;
-
-       case UNSIGNED:
-       case UCHAR:
-       case USHORT:
-       case ULONG:
-               if( v<0 || (v>>s)!=0 ) werror( "precision lost in field assignment" );
-               
-               return;
-               }
-
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/lint/lmanifest b/.ref-Research-V7/usr/src/cmd/lint/lmanifest
deleted file mode 100644 (file)
index 2a6ed88..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*     the key:
-       LDI     defined and initialized: storage set aside
-       LIB     defined on a library
-       LDC     defined as a common region on UNIX
-       LDX     defined by an extern: if ! pflag, same as LDI
-       LRV     function returns a value
-       LUV     function used in a value context
-       LUE     function used in effects context
-       LUM     mentioned somewhere other than at the declaration
-       */
-# define LDI 01
-# define LIB 02
-# define LDC 04
-# define LDX 010
-# define LRV 020
-# define LUV 040
-# define LUE 0100
-# define LUM 0200
diff --git a/.ref-Research-V7/usr/src/cmd/lint/lpass2.c b/.ref-Research-V7/usr/src/cmd/lint/lpass2.c
deleted file mode 100644 (file)
index 5c20864..0000000
+++ /dev/null
@@ -1,367 +0,0 @@
-# include "lmanifest"
-# include "manifest"
-
-# define USED 01
-# define VUSED 02
-# define EUSED 04
-# define RVAL 010
-# define VARARGS 0100
-
-typedef struct { TWORD aty; int extra; } atype;
-
-struct line {
-       char name[8];
-       int decflag;
-       atype type;
-       int nargs;
-       atype atyp[50];
-       int fline;
-       char file[100];
-       }
-
-       l1,
-       l2,
-       *pd,    /* pointer to line having definition */
-       *pc,    /* pointer to current line read */
-       *p3;    /* used for swapping pc and pd */
-
-int uses = USED;
-int hflag = 0;
-int pflag = 0;
-int xflag = 0;
-int uflag = 1;
-
-
-main( argc, argv ) char *argv[]; {
-
-       register char *p;
-
-       /* first argument is - options */
-
-       if( argc>=2 && argv[1][0] == '-' ){
-               for( p=argv[1]; *p; ++p ){
-                       switch( *p ){
-
-                       case 'h':
-                               hflag = 1;
-                               break;
-
-                       case 'p':
-                               pflag = 1;
-                               break;
-
-                       case 'x':
-                               xflag = 1;
-                               break;
-
-                       case 'u':
-                               uflag = 0;
-                               break;
-
-                               }
-                       }
-               }
-
-
-
-       pd = &l1;
-       pc = &l2;
-       pd->name[0] = '\0' ;
-       pd->fline = 0;
-       pd->file[0] = '\0';
-       pd->decflag = LDI;
-
-       /* main loop: read a line;
-               if same as last line, check compatibility
-               if not same as last line, becomes df.
-               */
-
-       for(;;){
-               lread();
-               if( steq(pc->name, pd->name) ) chkcompat();
-               else {
-                       lastone();
-                       setuse();
-                       p3=pc;
-                       pc = pd;
-                       pd = p3;
-                       }
-               }
-
-       }
-
-lread(){ /* read a line into pc */
-
-       register i, n;
-
-       getnam( pc->name );
-
-       pc->decflag = rdin10();
-       rdinty( &pc->type );
-       n = pc->nargs = rdin10();
-       if( n<0 ) n = -n;
-
-       for( i=0; i<n; ++i ){
-               rdinty( &pc->atyp[i] );
-               }
-
-       getnam( pc->file );
-       pc->fline = rdin10();
-
-       while( getchar() != '\n' ) ; /* VOID */
-       }
-
-rdin10(){
-       register val, c, s;
-
-       val = 0;
-       s = 1;
-
-       while( (c=getchar()) != '\t' ){
-               if( c <= 0 ) error( "unexpected EOF" );
-               else if( c == '-' ) {
-                       s = -1;
-                       continue;
-                       }
-               else if( c<'0' || c>'9' ) {
-                       error("rotten digit: %o\n", c );
-                       }
-               val = val*10 + c - '0';
-               }
-       return( val*s );
-       }
-
-rdinty( p ) atype *p; {
-       register val, c, s;
-
-       val = 0;
-       s = 1;
-
-       while( (c=getchar()) != '\t' && c!= '<' ){
-               if( c <= 0 ) error( "unexpected EOF" );
-               else if( c == '-' ) {
-                       s = -1;
-                       continue;
-                       }
-               else if( c<'0' || c>'7' ) {
-                       error("rotten digit: %o\n", c );
-                       }
-               val = (val<<3) + c - '0';
-               }
-       p->aty = val*s;
-       if( c == '<' ) p->extra = rdin10();
-       else p->extra = 0;
-       }
-
-getnam(p) char *p; {
-       register c;
-       while( (c=getchar()) != '\t' ){
-               if( c == '\n' ) error( "rotten name\n" );
-               if( c <= 0 ) cleanup();
-               *p++ = c;
-               }
-       *p = '\0';
-       }
-
-/* VARARGS */
-error( s, a ) char *s; {
-
-       fprintf( stderr, "pass 2 error: " );
-       fprintf( stderr, s, a );
-       fprintf( stderr, "\n" );
-       exit(1);
-       }
-
-steq(p,q) char *p,*q; { /* check that the p and q names are the same */
-
-
-       while( *p == *q ){
-               if( *p == 0 ) return(1);
-               ++p;
-               ++q;
-               }
-
-       return(0);
-       }
-
-chkcompat(){
-       /* are the types, etc. in pc and pd compatible */
-       register int i;
-
-       setuse();
-
-       /* argument check */
-
-       if( pd->decflag & (LDI|LIB|LUV|LUE) ){
-               if( pc->decflag & (LUV|LIB|LUE) ){
-                       if( pd->nargs != pc->nargs ){
-                               if( !(uses&VARARGS) ){
-                                       printf( "%.7s: variable # of args.", pd->name );
-                                       viceversa();
-                                       }
-                               if( pc->nargs > pd->nargs ) pc->nargs = pd->nargs;
-                               if( !(pd->decflag & (LDI|LIB) ) ) {
-                                       pd->nargs = pc->nargs;
-                                       uses |= VARARGS;
-                                       }
-                               }
-                       for( i=0; i<pc->nargs; ++i ){
-                               if( chktype(&pd->atyp[i], &pc->atyp[i]) ){
-                                       printf( "%.7s, arg. %d used inconsistently",
-                                               pd->name, i+1 );
-                                       viceversa();
-                                       }
-                               }
-                       }
-               }
-
-       if( (pd->decflag&(LDI|LIB|LUV)) && pc->decflag==LUV ){
-               if( chktype( &pc->type, &pd->type ) ){
-                       printf( "%.7s value used inconsistently", pd->name );
-                       viceversa();
-                       }
-               }
-
-       /* check for multiple declaration */
-
-       if( (pd->decflag&LDI) && (pc->decflag&(LDI|LIB)) ){
-               printf( "%.7s multiply declared", pd->name );
-               viceversa();
-               }
-
-       /* do a bit of checking of definitions and uses... */
-
-       if( (pd->decflag & (LDI|LIB|LDX|LDC)) && (pc->decflag & (LDX|LDC)) && pd->type.aty != pc->type.aty ){
-               printf( "%.7s value declared inconsistently", pd->name );
-               viceversa();
-               }
-
-       /* better not call functions which are declared to be structure or union returning */
-
-       if( (pd->decflag & (LDI|LIB|LDX|LDC)) && (pc->decflag & LUE) && pd->type.aty != pc->type.aty ){
-               /* only matters if the function returns union or structure */
-               TWORD ty;
-               ty = pd->type.aty;
-               if( ISFTN(ty) && ((ty = DECREF(ty))==STRTY || ty==UNIONTY ) ){
-                       printf( "%.7s function value type must be declared before use", pd->name );
-                       viceversa();
-                       }
-               }
-
-       if( pflag && pd->decflag==LDX && pc->decflag == LUM && !ISFTN(pd->type.aty) ){
-               /* make the external declaration go away */
-               /* in effect, it was used without being defined */
-
-               /* swap pc and pd */
-               p3 = pc;
-               pc = pd;
-               pd = p3;
-               }
-
-       }
-
-viceversa(){
-       /* print out file comparison */
-       printf( "       %s(%d)  ::  %s(%d)\n", pd->file, pd->fline, pc->file, pc->fline );
-       }
-
-       /* messages for defintion/use */
-char *
-mess[2][2] = {
-       "",
-       "%.7s used( %s(%d) ), but not defined\n",
-       "%.7s defined( %s(%d) ), but never used\n",
-       "%.7s declared( %s(%d) ), but never used or defined\n"
-       };
-
-lastone(){
-
-       /* called when pc and pd are at last different */
-       register nu, nd;
-
-       nu = nd = 0;
-
-       if( !(uses&USED) && pd->decflag != LIB ) {
-               if( !steq(pd->name,"main") )
-                       nu = 1;
-               }
-
-       if( !ISFTN(pd->type.aty) ){
-               switch( pd->decflag ){
-
-               case LIB:
-                       nu = nd = 0;  /* don't complain about uses on libraries */
-                       break;
-               case LDX:
-                       if( !xflag ) break;
-               case LUV:
-               case LUE:
-               case LUM:
-                       nd = 1;
-                       }
-               }
-
-       if( uflag && ( nu || nd ) ) printf( mess[nu][nd], pd->name, pd->file, pd->fline );
-
-       if( (uses&(RVAL+EUSED)) == (RVAL+EUSED) ){
-               printf( "%.7s returns value which is %s ignored\n", pd->name,
-                       uses&VUSED ? "sometimes" : "always" );
-               }
-
-       if( (uses&(RVAL+VUSED)) == (VUSED) && (pd->decflag&(LDI|LIB)) ){
-               printf( "%.7s value is used, but none returned\n", pd->name );
-               }
-
-       /* clean up pc, in preparation for the next thing */
-
-       uses = 0;
-       if( pc->nargs < 0 ){
-               pc->nargs = -pc->nargs;
-               uses = VARARGS;
-               }
-
-       }
-
-cleanup(){ /* call lastone and die gracefully */
-       lastone();
-       exit(0);
-       }
-
-setuse(){ /* check new type to ensure that it is used */
-
-       switch( pc->decflag ){
-
-       case LRV:
-               uses |= RVAL;
-               return;
-       case LUV:
-               uses |= VUSED+USED;
-               return;
-       case LUE:
-               uses |= EUSED+USED;
-               return;
-       case LUM:
-               uses |= USED;
-               return;
-
-               }
-       }
-
-chktype( pt1, pt2 ) register atype *pt1, *pt2; {
-
-       /* check the two type words to see if they are compatible */
-       /* for the moment, enums are turned into ints, and should be checked as such */
-       if( pt1->aty == ENUMTY ) pt1->aty =  INT;
-       if( pt2->aty == ENUMTY ) pt2->aty = INT;
-
-       if( pt2->extra ){ /* constant passed in */
-               if( pt1->aty == UNSIGNED && pt2->aty == INT ) return( 0 );
-               else if( pt1->aty == ULONG && pt2->aty == LONG ) return( 0 );
-               }
-       else if( pt1->extra ){ /* for symmetry */
-               if( pt2->aty == UNSIGNED && pt1->aty == INT ) return( 0 );
-               else if( pt2->aty == ULONG && pt1->aty == LONG ) return( 0 );
-               }
-
-       return( pt1->aty != pt2->aty );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/lint/macdefs b/.ref-Research-V7/usr/src/cmd/lint/macdefs
deleted file mode 100644 (file)
index 3ec81bc..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# define makecc(val,i)  lastcon |= val<<(8*i);  /* pdp-11 womp next char  */
-
-# define  ARGINIT 288 /* initial offset for arguments */
-# define  AUTOINIT 0   /* initial automatic offset */
-extern int  SZCHAR;
-extern int  SZINT;
-extern int  SZFLOAT;
-extern int  SZDOUBLE;
-extern int  SZLONG;
-extern int  SZSHORT;
-extern int SZPOINT;
-extern int ALCHAR;
-extern int ALINT;
-extern int ALFLOAT;
-extern int ALDOUBLE;
-extern int ALLONG;
-extern int ALSHORT;
-extern int ALPOINT;
-extern int ALSTRUCT;
-# define SAVEADJUST 0 /* bits of adjustment required for stackframe */
-
-
-/* type (INT OR LONG) big enough to hold pointers */
-
-
-/*     size in which constants are converted */
-/*     should be long if feasable */
-
-# define CONSZ long
-# define CONFMT "%Ld"
-# define CONOFMT "%Lo"
-
-/*     size in which offsets are kept
-/*     should be large enough to cover address space in bits
-*/
-
-# define OFFSZ long
-
-/*     character set macro */
-
-# define  CCTRANS(x) x
-
-/*     register cookie for stack pointer */
-
-# define STKREG 9
-
-/*     maximum and minimum register variable values */
-
-# define MAXRVAR 1000
-# define MINRVAR 1
-
-/* many macro definitions for functions irrelevant to lint */
-
-# define locctr(n) 0
-# define getlab() 10
-# define genswitch( x,y)
-# define bccode()
-# define cendarg()
-# define incode(a,s) (inoff += (s))
-# define fincode(a,s) (inoff += (s) )
-# define vfdzero(n) (inoff += (n))
-# define aobeg()
-# define aoend()
-
-# ifndef unix
-# define NOFORTRAN  {extern int pflag; if(pflag) werror( "fortran keyword nonportable" );}
-# else
-# define NOFORTRAN { werror( "fortran keyword nonportable" ); }
-# endif
-
-# define LINT
diff --git a/.ref-Research-V7/usr/src/cmd/lint/makefile b/.ref-Research-V7/usr/src/cmd/lint/makefile
deleted file mode 100644 (file)
index f7fe44d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-M=/usr/src/cmd/mip
-LOAD1=-i -s
-LOAD2=-s -n
-CFLAGS=-O
-
-all:   head
-
-cp:    head
-       cp lpass1 /usr/lib/lint1
-       cp lpass2 /usr/lib/lint2
-       rm lpass1 lpass2 *.o cgram.c
-
-cmp:   head
-       cmp lpass1 /usr/lib/lint1
-       cmp lpass2 /usr/lib/lint2
-       rm lpass1 lpass2 *.o cgram.c
-
-head: lpass1 lpass2 ;
-lpass1: cgram.o xdefs.o scan.o comm1.o pftn.o trees.o optim.o lint.o
-       cc $(LOAD1) cgram.o xdefs.o scan.o comm1.o pftn.o trees.o optim.o lint.o
-       mv a.out lpass1
-trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c
-       cc -c $(CFLAGS) -I$M -I. $M/trees.c
-optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c
-       cc -c $(CFLAGS) -I$M -I. $M/optim.c
-pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c
-       cc -c $(CFLAGS) -I$M -I. $M/pftn.c
-lint.o: $M/manifest macdefs $M/mfile1 lmanifest
-       cc -c $(CFLAGS) -I$M -I. lint.c
-scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c
-       cc -c $(CFLAGS) -I$M -I. $M/scan.c
-xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c
-       cc -c $(CFLAGS) -I$M -I. $M/xdefs.c
-cgram.o: $M/manifest $M/mfile1 macdefs cgram.c
-       cc -c $(CFLAGS) -I$M -I. cgram.c
-cgram.c: $M/cgram.y
-       yacc $M/cgram.y
-       mv y.tab.c cgram.c
-comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c
-       cc -c $(CFLAGS) -I. -I$M $M/comm1.c
-shrink:
-       rm *.o
-clobber: shrink
-       rm lpass1 lpass2
-lpass2: lpass2.o
-       cc -o lpass2 $(LOAD2) lpass2.o
-lpass2.o: $M/manifest lmanifest
-       cc $(CFLAGS) -c -I$M -I. lpass2.c
-lintall:       cgram.c
-       lint -hpv -I. -I$M  cgram.c $M/xdefs.c $M/scan.c $M/pftn.c $M/trees.c $M/optim.c lint.c $M/reader.c local2.c order.c $M/match.c $M/allo.c $M/comm1.c table.c
-install:
-       echo better be newgrp bin...
-       diff SHELL /usr/bin/lint
-       diff llib-lc /usr/lib
-       diff llib-port /usr/lib
-       cp lpass1 /usr/lib/lint1
-       cp lpass2 /usr/lib/lint2
-       cp llib-* /usr/lib
-       cp SHELL /usr/bin/lint
-       cp SHELL llib-* lmanifest macdefs lint.c lpass2.c /usr/src/cmd/lint
diff --git a/.ref-Research-V7/usr/src/cmd/ln.c b/.ref-Research-V7/usr/src/cmd/ln.c
deleted file mode 100644 (file)
index ac6c619..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * ln [ -f ] target [ new name ]
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "stdio.h"
-char   *rindex();
-
-main(argc, argv)
-char **argv;
-{
-       struct stat statb;
-       register char *np;
-       int fflag = 0;
-       char nb[100], *name=nb, *arg2;
-       int statres;
-
-       if (argc >1 && strcmp(argv[1], "-f")==0) {
-               argc--;
-               argv++;
-               fflag++;
-       }
-       if (argc<2 || argc>3) {
-               printf("Usage: ln target [ newname ]\n");
-               exit(1);
-       }
-       np = rindex(argv[1], '/');
-       if (np==0)
-               np = argv[1];
-       else
-               np++;
-       if (argc==2)
-               arg2 = np;
-       else
-               arg2 = argv[2];
-       statres = stat(argv[1], &statb);
-       if (statres<0) {
-               printf ("ln: %s does not exist\n", argv[1]);
-               exit(1);
-       }
-       if (fflag==0 && (statb.st_mode&S_IFMT) == S_IFDIR) {
-               printf("ln: %s is a directory\n", argv[1]);
-               exit(1);
-       }
-       statres = stat(arg2, &statb);
-       if (statres>=0 && (statb.st_mode&S_IFMT) == S_IFDIR)
-               sprintf(name, "%s/%s", arg2, np);
-       else
-               name = arg2;
-       if (link(argv[1], name)<0) {
-               perror("ln");
-               exit(1);
-       }
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/login.c b/.ref-Research-V7/usr/src/cmd/login.c
deleted file mode 100644 (file)
index b09a404..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * login [ name ]
- */
-
-#include <sys/types.h>
-#include <sgtty.h>
-#include <utmp.h>
-#include <signal.h>
-#include <pwd.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#define SCPYN(a, b)    strncpy(a, b, sizeof(a))
-
-char   maildir[30] =   "/usr/spool/mail/";
-struct passwd nouser = {"", "nope"};
-struct sgttyb ttyb;
-struct utmp utmp;
-char   minusnam[16] = "-";
-char   homedir[64] = "HOME=";
-char   *envinit[] = {homedir, "PATH=:/bin:/usr/bin", 0};
-struct passwd *pwd;
-
-struct passwd *getpwnam();
-char   *strcat();
-int    setpwent();
-char   *ttyname();
-char   *crypt();
-char   *getpass();
-char   *rindex(), *index();
-extern char **environ;
-
-main(argc, argv)
-char **argv;
-{
-       register char *namep;
-       int t, f, c;
-       char *ttyn;
-
-       alarm(60);
-       signal(SIGQUIT, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       nice(-100);
-       nice(20);
-       nice(0);
-       gtty(0, &ttyb);
-       ttyb.sg_erase = '#';
-       ttyb.sg_kill = '@';
-       stty(0, &ttyb);
-       for (t=3; t<20; t++)
-               close(t);
-       ttyn = ttyname(0);
-       if (ttyn==0)
-               ttyn = "/dev/tty??";
-
-    loop:
-       SCPYN(utmp.ut_name, "");
-       if (argc>1) {
-               SCPYN(utmp.ut_name, argv[1]);
-               argc = 0;
-       }
-       while (utmp.ut_name[0] == '\0') {
-               namep = utmp.ut_name;
-               printf("login: ");
-               while ((c = getchar()) != '\n') {
-                       if(c == ' ')
-                               c = '_';
-                       if (c == EOF)
-                               exit(0);
-                       if (namep < utmp.ut_name+8)
-                               *namep++ = c;
-               }
-       }
-       setpwent();
-       if ((pwd = getpwnam(utmp.ut_name)) == NULL)
-               pwd = &nouser;
-       endpwent();
-       if (*pwd->pw_passwd != '\0') {
-               namep = crypt(getpass("Password:"),pwd->pw_passwd);
-               if (strcmp(namep, pwd->pw_passwd)) {
-                       printf("Login incorrect\n");
-                       goto loop;
-               }
-       }
-       if(chdir(pwd->pw_dir) < 0) {
-               printf("No directory\n");
-               goto loop;
-       }
-       time(&utmp.ut_time);
-       t = ttyslot();
-       if (t>0 && (f = open("/etc/utmp", 1)) >= 0) {
-               lseek(f, (long)(t*sizeof(utmp)), 0);
-               SCPYN(utmp.ut_line, index(ttyn+1, '/')+1);
-               write(f, (char *)&utmp, sizeof(utmp));
-               close(f);
-       }
-       if (t>0 && (f = open("/usr/adm/wtmp", 1)) >= 0) {
-               lseek(f, 0L, 2);
-               write(f, (char *)&utmp, sizeof(utmp));
-               close(f);
-       }
-       chown(ttyn, pwd->pw_uid, pwd->pw_gid);
-       setgid(pwd->pw_gid);
-       setuid(pwd->pw_uid);
-       if (*pwd->pw_shell == '\0')
-               pwd->pw_shell = "/bin/sh";
-       environ = envinit;
-       strncat(homedir, pwd->pw_dir, sizeof(homedir)-6);
-       if ((namep = rindex(pwd->pw_shell, '/')) == NULL)
-               namep = pwd->pw_shell;
-       else
-               namep++;
-       strcat(minusnam, namep);
-       alarm(0);
-       umask(02);
-       showmotd();
-       strcat(maildir, pwd->pw_name);
-       if(access(maildir,4)==0) {
-               struct stat statb;
-               stat(maildir, &statb);
-               if (statb.st_size)
-                       printf("You have mail.\n");
-       }
-       signal(SIGQUIT, SIG_DFL);
-       signal(SIGINT, SIG_DFL);
-       execlp(pwd->pw_shell, minusnam, 0);
-       printf("No shell\n");
-       exit(0);
-}
-
-int    stopmotd;
-catch()
-{
-       signal(SIGINT, SIG_IGN);
-       stopmotd++;
-}
-
-showmotd()
-{
-       FILE *mf;
-       register c;
-
-       signal(SIGINT, catch);
-       if((mf = fopen("/etc/motd","r")) != NULL) {
-               while((c = getc(mf)) != EOF && stopmotd == 0)
-                       putchar(c);
-               fclose(mf);
-       }
-       signal(SIGINT, SIG_IGN);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/look.c b/.ref-Research-V7/usr/src/cmd/look.c
deleted file mode 100644 (file)
index b2a9980..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-
-FILE *dfile;
-char *filenam  = "/usr/dict/words";
-
-int fold;
-int dict;
-int tab;
-char entry[250];
-char word[250];
-char key[50];
-
-main(argc,argv)
-char **argv;
-{
-       register c;
-       long top,bot,mid;
-       while(argc>=2 && *argv[1]=='-') {
-               for(;;) {
-                       switch(*++argv[1]) {
-                       case 'd':
-                               dict++;
-                               continue;
-                       case 'f':
-                               fold++;
-                               continue;
-                       case 't':
-                               tab = argv[1][1];
-                               if(tab)
-                                       ++argv[1];
-                               continue;
-                       case 0:
-                               break;
-                       default:
-                               continue;
-                       }
-                       break;
-               }
-               argc --;
-               argv++;
-       }
-       if(argc<=1)
-               return;
-       if(argc==2) {
-               fold++;
-               dict++;
-       } else
-               filenam = argv[2];
-       dfile = fopen(filenam,"r");
-       if(dfile==NULL) {
-               fprintf(stderr,"look: can't open %s\n",filenam);
-               exit(2);
-       }
-       canon(argv[1],key);
-       bot = 0;
-       fseek(dfile,0L,2);
-       top = ftell(dfile);
-       for(;;) {
-               mid = (top+bot)/2;
-               fseek(dfile,mid,0);
-               do {
-                       c = getc(dfile);
-                       mid++;
-               } while(c!=EOF && c!='\n');
-               if(!getword(entry))
-                       break;
-               canon(entry,word);
-               switch(compare(key,word)) {
-               case -2:
-               case -1:
-               case 0:
-                       if(top<=mid)
-                               break;
-                       top = mid;
-                       continue;
-               case 1:
-               case 2:
-                       bot = mid;
-                       continue;
-               }
-               break;
-       }
-       fseek(dfile,bot,0);
-       while(ftell(dfile)<top) {
-               if(!getword(entry))
-                       return;
-               canon(entry,word);
-               switch(compare(key,word)) {
-               case -2:
-                       return;
-               case -1:
-               case 0:
-                       puts(entry,stdout);
-                       break;
-               case 1:
-               case 2:
-                       continue;
-               }
-               break;
-       }
-       while(getword(entry)) {
-               canon(entry,word);
-               switch(compare(key,word)) {
-               case -1:
-               case 0:
-                       puts(entry,stdout);
-                       continue;
-               }
-               break;
-       }
-}
-
-compare(s,t)
-register char *s,*t;
-{
-       for(;*s==*t;s++,t++)
-               if(*s==0)
-                       return(0);
-       return(*s==0? -1:
-               *t==0? 1:
-               *s<*t? -2:
-               2);
-}
-
-getword(w)
-char *w;
-{
-       register c;
-       for(;;) {
-               c = getc(dfile);
-               if(c==EOF)
-                       return(0);
-               if(c=='\n')
-                       break;
-               *w++ = c;
-       }
-       *w = 0;
-       return(1);
-}
-
-canon(old,new)
-char *old,*new;
-{
-       register c;
-       for(;;) {
-               *new = c = *old++;
-               if(c==0||c==tab) {
-                       *new = 0;
-                       break;
-               }
-               if(dict) {
-                       if(!isalnum(c))
-                               continue;
-               }
-               if(fold) {
-                       if(isupper(c))
-                               *new += 'a' - 'A';
-               }
-               new++;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/chrtab.c b/.ref-Research-V7/usr/src/cmd/lpr/chrtab.c
deleted file mode 100644 (file)
index 4d8a81a..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-char   chrtab[][16] = {
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, sp, */
-0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0010,0000,0000,0000,0000,0000, /*, !, */
-0024,0024,0024,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ", */
-0000,0000,0000,0044,0044,0176,0044,0044,0176,0044,0044,0000,0000,0000,0000,0000, /*, #, */
-0000,0010,0010,0010,0076,0101,0100,0076,0001,0101,0076,0010,0010,0000,0000,0000, /*, $, */
-0000,0000,0000,0141,0142,0004,0010,0010,0020,0043,0103,0000,0000,0000,0000,0000, /*, %, */
-0000,0000,0070,0104,0110,0060,0060,0111,0106,0106,0071,0000,0000,0000,0000,0000, /*, &, */
-0004,0010,0020,0040,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ', */
-0000,0004,0010,0020,0040,0040,0040,0040,0040,0040,0020,0010,0004,0000,0000,0000, /*, (, */
-0000,0040,0020,0010,0004,0004,0004,0004,0004,0004,0010,0020,0040,0000,0000,0000, /*, ), */
-0000,0000,0000,0010,0111,0052,0034,0177,0034,0052,0111,0010,0000,0000,0000,0000, /*, *, */
-0000,0000,0000,0000,0010,0010,0010,0177,0010,0010,0010,0000,0000,0000,0000,0000, /*, +, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0010,0020,0000,0000,0000, /*, ,, */
-0000,0000,0000,0000,0000,0000,0000,0176,0000,0000,0000,0000,0000,0000,0000,0000, /*, -, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0000,0000,0000,0000,0000, /*, ., */
-0000,0000,0001,0002,0004,0010,0010,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, /, */
-0000,0030,0044,0102,0102,0102,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 0, */
-0000,0010,0030,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, 1, */
-0000,0070,0104,0004,0004,0010,0020,0040,0100,0100,0174,0000,0000,0000,0000,0000, /*, 2, */
-0000,0176,0004,0004,0010,0014,0002,0002,0002,0104,0070,0000,0000,0000,0000,0000, /*, 3, */
-0000,0004,0014,0024,0044,0104,0176,0004,0004,0004,0004,0000,0000,0000,0000,0000, /*, 4, */
-0000,0174,0100,0100,0130,0144,0002,0002,0102,0044,0030,0000,0000,0000,0000,0000, /*, 5, */
-0000,0074,0102,0100,0130,0144,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 6, */
-0000,0176,0004,0004,0010,0010,0020,0020,0040,0040,0040,0000,0000,0000,0000,0000, /*, 7, */
-0000,0034,0042,0101,0042,0076,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, 8, */
-0000,0034,0042,0101,0101,0101,0043,0036,0004,0010,0020,0040,0000,0000,0000,0000, /*, 9, */
-0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0000,0000,0000,0000,0000, /*, :, */
-0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0020,0040,0000,0000,0000, /*, ;, */
-0002,0004,0010,0020,0040,0100,0040,0020,0010,0004,0002,0000,0000,0000,0000,0000, /*, <, */
-0000,0000,0000,0000,0177,0000,0177,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, =, */
-0100,0040,0020,0010,0004,0002,0004,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, >, */
-0000,0030,0044,0102,0001,0002,0004,0010,0010,0000,0010,0000,0000,0000,0000,0000, /*, ?, */
-0000,0074,0102,0101,0115,0123,0121,0121,0121,0111,0046,0000,0000,0000,0000,0000, /*, @, */
-0000,0010,0024,0042,0101,0101,0177,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, A, */
-0000,0176,0101,0101,0101,0176,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, B, */
-0000,0076,0101,0100,0100,0100,0100,0100,0100,0101,0076,0000,0000,0000,0000,0000, /*, C, */
-0000,0176,0101,0101,0101,0101,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, D, */
-0000,0176,0100,0100,0100,0170,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, E, */
-0000,0177,0100,0100,0100,0174,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, F, */
-0000,0076,0101,0100,0100,0117,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, G, */
-0000,0101,0101,0101,0101,0176,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, H, */
-0000,0034,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, I, */
-0000,0016,0004,0004,0004,0004,0004,0004,0104,0104,0070,0000,0000,0000,0000,0000, /*, J, */
-0000,0101,0102,0104,0110,0120,0160,0110,0104,0102,0101,0000,0000,0000,0000,0000, /*, K, */
-0000,0100,0100,0100,0100,0100,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, L, */
-0000,0101,0143,0125,0111,0101,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, M, */
-0000,0101,0141,0121,0111,0105,0103,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, N, */
-0000,0076,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, O, */
-0000,0176,0101,0101,0101,0176,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, P, */
-0000,0076,0101,0101,0101,0101,0101,0101,0131,0105,0076,0002,0001,0000,0000,0000, /*, Q, */
-0000,0176,0101,0101,0101,0176,0104,0102,0101,0101,0101,0000,0000,0000,0000,0000, /*, R, */
-0000,0076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */
-0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */
-0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */
-0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */
-0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */
-0000,0101,0101,0042,0024,0010,0024,0042,0101,0101,0101,0000,0000,0000,0000,0000, /*, X, */
-0000,0101,0042,0024,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, Y, */
-0000,0177,0001,0002,0004,0010,0020,0040,0100,0100,0177,0000,0000,0000,0000,0000, /*, Z, */
-0000,0034,0020,0020,0020,0020,0020,0020,0020,0020,0020,0034,0000,0000,0000,0000, /*, [, */
-0000,0000,0100,0040,0020,0010,0010,0010,0004,0002,0001,0000,0000,0000,0000,0000, /*, , \, */
-0000,0070,0010,0010,0010,0010,0010,0010,0010,0010,0010,0070,0000,0000,0000,0000, /*, ], */
-0010,0024,0042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */
-0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */
-0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
-0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
-0000,0000,0000,0000,0000,0074,0102,0100,0100,0102,0074,0000,0000,0000,0000,0000, /*, c, */
-0002,0002,0002,0002,0002,0076,0102,0102,0102,0102,0076,0000,0000,0000,0000,0000, /*, d, */
-0000,0000,0000,0000,0000,0074,0102,0174,0100,0102,0074,0000,0000,0000,0000,0000, /*, e, */
-0000,0016,0020,0020,0020,0176,0020,0020,0020,0020,0020,0000,0000,0000,0000,0000, /*, f, */
-0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0102,0076,0000, /*, g, */
-0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, h, */
-0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, i, */
-0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0010,0010,0010,0050,0020,0000, /*, j, */
-0000,0100,0100,0100,0100,0106,0110,0120,0160,0110,0106,0000,0000,0000,0000,0000, /*, k, */
-0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */
-0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */
-0000,0000,0000,0000,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, n, */
-0000,0000,0000,0000,0000,0074,0102,0102,0102,0102,0074,0000,0000,0000,0000,0000, /*, o, */
-0000,0000,0000,0000,0000,0174,0102,0102,0102,0102,0174,0100,0100,0100,0100,0000, /*, p, */
-0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0002,0002,0000, /*, q, */
-0000,0000,0000,0000,0000,0134,0142,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, r, */
-0000,0000,0000,0000,0000,0076,0100,0074,0002,0102,0074,0000,0000,0000,0000,0000, /*, s, */
-0000,0020,0020,0020,0020,0176,0020,0020,0020,0020,0014,0000,0000,0000,0000,0000, /*, t, */
-0000,0000,0000,0000,0000,0102,0102,0102,0102,0102,0075,0000,0000,0000,0000,0000, /*, u, */
-0000,0000,0000,0000,0000,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, v, */
-0000,0000,0000,0000,0000,0111,0111,0111,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */
-0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */
-0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,0100,0000,0000, /*, y, */
-0000,0000,0000,0000,0000,0176,0004,0010,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */
-0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */
-0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */
-0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */
-0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */
-0000,0176,0176,0176,0176,0176,0176,0176,0176,0176,0176,0000,0000,0000,0000,0000, /*, del, */
-};
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/daemon.c b/.ref-Research-V7/usr/src/cmd/lpr/daemon.c
deleted file mode 100644 (file)
index ce1d192..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- *  daemon.c -- main control routines for spider and phone dpd daemons,
- *                     and for line printer daemon.
- */
-
-long   snsum = 0;              /*number of characters written*/
-
-#include       "daemon0.c"
-
-#include       <setjmp.h>
-#include       <sys/dir.h>
-
-struct direct  dbuf;
-int    LDIRNAM = 0;            /*length of directory name. MRW*/
-int    LCHAR   = 0;            /*length of file name thru 'df'.*/
-int    LPID    = 0;            /*length of file name to process-id.*/
-int    retcode = 1;
-int    nwait   = 0;
-char   *fowner;                /*RBB*/
-char   baddf[30];              /*name for unsendable df-files.*/
-FILE   *popen();
-
-#if LPD
-int    waittm  = 10;
-#else
-int    waittm  = 60;
-#endif
-
-main()
-{
-       register char *p1, *p2;
-       FILE *df;
-
-       dem_setup();
-       LDIRNAM = 0;            /*calculate length of directory name. MRW*/
-       while(dfname[LDIRNAM])  LDIRNAM++;
-       LCHAR = LDIRNAM + 2;
-       LPID = LDIRNAM + 3;
-
-again:
-       snsum = 0;
-       if(access(lock, 0) < 0){
-               logerr("Lock has disappeared.");
-               dem_dis();
-               exit(1);
-       }
-       df = fopen(dpd, "r");
-       if (df) {
-               do {
-                       if(fread((char *)&dbuf, sizeof dbuf, 1, df) < 1){
-                               dem_dis();      /*disconnect phone line. MRW*/
-                               unlink(lock);
-                               exit(0);
-                       }
-               } while (dbuf.d_ino==0 || dbuf.d_name[0]!='d' || dbuf.d_name[1]!='f');
-               fclose(df);
-       }
-       p1 = dbuf.d_name;
-       p2 = &dfname[LDIRNAM];
-       while (p1 < &dbuf.d_name[DIRSIZ])
-               *p2++ = *p1++;
-       if (trysend() == 0) {
-               waittm = 60;
-               nwait = 0;
-               goto again;
-               }
-#if PHONE
-       if(nwait > 10){         /*after 3 hours try fresh daemon. MRW*/
-               unlink(lock);
-               execl("/usr/lib/dpd", "dpd", (char *)0);
-               execl("/etc/dpd", "dpd", (char *)0);
-               logerr("Can't find dpd.");
-               exit(1);
-       }
-#endif
-       sleep(waittm);
-#if PHONE || SPIDER
-#ifndef DEBUG
-       if (waittm <= 8*60)
-               waittm *= 2;
-       else
-               nwait++;
-#endif
-#endif
-       goto again;
-}
-
-/*
- * The remaining part is the device interface, to spider, the dataphone,
- *    or the line printer.
- */
-
-#define        MXLINE  128
-#define        MXMESS  500
-
-char   *snumb;
-char   line[MXLINE];
-char   message[MXMESS+1];
-char   *mesp;
-char   mailfname[64];
-int    linel;
-FILE   *dfb = NULL;
-jmp_buf        env;
-char   ff      = '\014';               /*formfeed*/
-char   *copline();
-
-trysend()
-{
-       if(retcode != 0)
-               if(retcode = dem_con())         /*connect phone line.*/
-                       return(retcode);
-       retcode = 1;
-       if(setjmp(env))
-               return(retcode);
-       xtrysend();
-       return(0);
-}
-
-xtrysend()
-{
-       int i;
-
-       dem_open(dfname);               /*open spider connection.*/
-       if((dfb = fopen(dfname, "r")) == NULL){
-               if(LDIRNAM < (i = sizeof(baddf)-1)){
-                       strncpy(baddf, dfname, i);
-                       baddf[i] = '\0';
-                       baddf[LDIRNAM] = 'b';
-                       link(dfname, baddf);
-               }
-               unlink(dfname);
-               retcode = 0;
-               trouble("Can't read %s.", dfname);
-       }
-       getowner(dfname);               /*RBB*/
-       mesp = message;
-       *mesp = 0;
-       while (getline()) switch (line[0]) {
-
-       case 'S':
-               get_snumb();            /*get snumb for GCOS.*/
-               continue;
-
-       case 'B':
-               if(sascii(0))
-                       trouble("Can't send %s.", &line[1]);
-               continue;
-
-       case 'F':
-               if(sascii(1))
-                       trouble("Can't send %s.", &line[1]);
-               continue;
-
-       case 'I':                       /*mail back $IDENT card. MRW*/
-               mesp = copline(&line[1], linel-1, mesp);
-
-       case 'L':
-               lwrite();               /*write a literal line.*/
-               continue;
-
-       case 'M':
-               continue;
-
-       case 'N':                       /*mail back file name. MRW*/
-               copline(&line[1], linel-1, mailfname);
-               continue;
-
-       case 'Q':                       /*additional text to mail back*/
-               if(mesp+linel <= message+MXMESS)
-                       mesp = copline(&line[1], linel-1, mesp);
-
-       case 'U':
-               continue;
-       }
-/*
- * Second pass.
- * Unlink files and send mail.
- */
-       alarm(0);
-       fseek(dfb, (long)0, 0);
-       while (getline()) switch (line[0]) {
-
-       default:
-               continue;
-
-       case 'U':
-               unlink(&line[1]);
-               continue;
-
-       case 'M':
-               sendmail();
-               continue;
-       }
-       FCLOSE(dfb);
-       dem_close();            /*close connection to spider.*/
-       unlink(dfname);
-       retcode = 0;
-       trouble("OK: %-5s %-7s %-8s", snumb, fowner, dfname+LDIRNAM);   /*RBB*/
-}
-
-#define        LUBM    30      /*length of mail command line.*/
-#define        IARG1   5       /*start of arg to mail command.*/
-char   mail[LUBM+1]    = "mail ";
-FILE   *pmail;
-
-sendmail()
-{
-       register i;
-
-       alarm(0);
-       i = 0;
-       while((mail[IARG1+i] = line[i+1]) && (++i < LUBM-IARG1));
-       mail[IARG1+i] = 0;
-       if((pmail = popen(mail, "w")) == NULL){
-               logerr("Can't mail: %-5s %-8s",snumb,dfname+LDIRNAM);  /*MRW*/
-               return;
-       }
-       maildname();
-       pclose(pmail);
-}
-
-#if LPD == 0
-
-maildname()            /*break up dfname into command name, and process-id
-                           to send back in the mail. MRW*/
-{
-       char c;
-       char *command;
-
-       fprintf(pmail,"Sent %-5s:  file  %s%s",snumb,mailfname,message);
-/*
-       c = dfname[LCHAR];
-       switch (c){
-       case 'A':
-       case 'a':
-               command = "dpr";
-               break;
-
-       case 'G':
-       case 'g':
-               command = "gcat";
-               break;
-
-       case 'J':
-       case 'j':
-               command = "ibm";
-               break;
-
-       case 'N':
-       case 'n':
-               command = "fsend";
-               break;
-
-       case 'T':
-       case 't':
-               command = "fget";
-               break;
-
-       default:
-               command = &dfname[LDIRNAM];
-               break;
-       }
-       fprintf(pmail, "%s process-id was %s\n", command, &dfname[LPID]);
-*/
-}
-
-#endif
-
-
-getline()
-{
-       register char *lp;
-       register c;
-
-       lp = line;
-       linel = 0;
-       while ((c = getc(dfb)) != '\n' && linel < MXLINE-2) {
-               if (c == EOF)
-                       return(0);
-               if (c=='\t') {
-                       do {
-                               *lp++ = ' ';
-                               linel++;
-                       } while ((linel & 07) != 0);
-                       continue;
-               }
-               *lp++ = c;
-               linel++;
-       }
-       *lp++ = 0;
-       return(1);
-}
-
-char *
-copline(ab, n, ml)
-char   *ab;
-int    n;
-char   ml[64];
-{
-       register char *b, *p, *eb;
-
-       b = ab;
-       eb = b+n;
-       p = ml;
-       while (b<eb && p < &ml[63])
-               *p++ = *b++;
-       *p++ = '\n';
-       *p = 0;                 /*RBB*/
-       return(p);
-}
-
-#if LPD == 0
-
-/*
- * the following code determines who the file's owner is.
- *                     /*RBB*/
-
-struct passwd *getpwuid();
-
-getowner(file)
-char   *file;
-{
-       struct passwd *f;
-
-       if(stat(file, &statbuf) < 0)
-               return;
-       if((f = getpwuid(statbuf.st_uid)) == NULL)
-               fowner = "";
-       else
-               fowner = f->pw_name;
-}
-
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/daemon0.c b/.ref-Research-V7/usr/src/cmd/lpr/daemon0.c
deleted file mode 100644 (file)
index 615972c..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *  daemon0.c -- dem_setup() and logerr() routines for spider and
- *                     and dataphone dpd and fget daemons.
- */
-
-#include       <stdio.h>
-#include       <sys/types.h>
-#include       <sys/stat.h>
-#include       <pwd.h>
-#include       <signal.h>
-
-#define        WRMODE  2
-
-#define        FCLOSE(F)       if(F != NULL){ fclose(F);  F = NULL;}
-#define        DAEMUID 1
-#define        DAEMNAM "daemon\0\0"
-
-struct stat    statbuf;
-struct passwd *getpwuid();
-
-unlock()
-{
-       signal(SIGTERM, SIG_IGN);
-       dem_dis();
-       logerr("Daemon killed.");
-       unlink(lock);
-       exit(1);
-}
-
-
-dem_setup()
-{
-       int i;
-       int of;
-
-       setuid(DAEMUID);
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGTERM, unlock);
-#ifndef        DEBUG
-       signal(SIGQUIT, SIG_IGN);
-/*
- * Close all files, open /dev/null as 0, 1, 2
- * to assure standard environment
- */
-       freopen("/dev/null", "r", stdin);
-       freopen("/dev/null", "w", stdout);
-       freopen("/dev/null", "w", stderr);
-       for (of=3; of<_NFILE; of++)
-               close(of);
-#endif
-       if ((of=creat(lock, 0)) < 0)
-               exit(0);
-       if(fstat(of, &statbuf) < 0 || statbuf.st_mode != 0100000){
-               logerr("Bad lock file %s.", lock);
-               exit(1);
-       }
-       close(of);
-#ifndef        DEBUG
-       if (i = fork()){
-               if(i == -1){
-                       logerr("Unable to fork.");
-                       unlink(lock);
-                       exit(1);
-               }
-               exit(0);
-       }
-#endif
-       chdir(dpd);
-}
-
-
-#if LPD == 0
-
-int    nlog    = 0;
-
-/* VARARGS */
-logerr(s, a1, a2, a3, a4)
-char   *s;
-int    a1, a2, a3, a4;
-{
-       long static tb;
-       register i;
-       FILE *f;
-       struct passwd *pwp;
-
-       if(access(error, WRMODE) != 0)
-               return;
-       if((f = fopen(error, "a")) == NULL)
-               return;
-       time(&tb);
-       fprintf(f, "%.19s:%s:", ctime(&tb), dname);
-       fprintf(f, s, a1, a2, a3, a4);
-#if FGET == 0
-       i = snsum/1000;
-       if(i <= 0){
-               i = snsum;
-               fprintf(f, "  %3d bytes", i);
-       }
-       else
-               fprintf(f, " %3dk bytes", i);
-#endif
-       if(!nlog++ && ((pwp = getpwuid(getuid())) != NULL)){
-               putc(' ', f);  putc(' ', f);
-               i = 0;
-               while(pwp->pw_name[i])
-                       putc(pwp->pw_name[i++], f);
-       }
-       putc('\n', f);
-       fclose(f);
-}
-
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/lpd.c b/.ref-Research-V7/usr/src/cmd/lpr/lpd.c
deleted file mode 100644 (file)
index 764c66a..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-#
-/*
- * lpd -- line printer daemon dispatcher
- *
- */
-
-#include       <ctype.h>
-
-#define        SPIDER  0
-#define        PHONE   0
-#define        LPD     1
-
-char   dpd[]   = "/usr/spool/lpd";
-char   dfname[30] = "/usr/spool/lpd/";
-char   lock[]  = "/usr/spool/lpd/lock";
-
-#include       "daemon.c"
-
-/*
- * The remaining part is the line printer interface.
- */
-
-char   lp[]    = "/dev/lp";
-char   chrtab[][16];
-FILE   *lpf = NULL;
-
-dem_con()
-{
-       if((lpf = fopen(lp, "w")) == NULL)
-               return(-1);
-       return(0);
-}
-
-dem_dis()
-{
-
-       FCLOSE(lpf);
-       FCLOSE(dfb);
-}
-
-dem_open(file)
-char   *file;
-{
-}
-
-dem_close()
-{
-}
-
-get_snumb()
-{
-}
-
-lwrite()
-{
-       banner(&line[1]);
-}
-
-
-FILE   *ibuf;
-
-sascii(fff)
-{
-       if((ibuf = fopen(&line[1], "r")) == NULL)
-               return(0);
-       if(fff)
-               putc(ff, lpf);
-       bsopt();
-       fflush(lpf);
-       fclose(ibuf);
-       return(0);
-}
-
-/*
- *     Copy file ibuf to lpf arranging that no
- *     backspaces will appear in the output.  Courtesy ARK
- */
-
-#define BSIZE 256
-
-char b1[BSIZE], b2[BSIZE];
-int size1, size2;
-
-bsopt()
-{
-       register int cp, c;
-
-       size1 = size2 = cp = 0;
-       while ((c = getc(ibuf)) != EOF) {
-               if (isprint (c)) {
-                       if (cp < BSIZE) {
-                               if (cp >= size1 || b1[cp] == ' ') {
-                                       while (cp >= size1)
-                                               b1[size1++] = ' ';
-                               } else {
-                                       if (cp < size2 && b2[cp] != ' ')
-                                               pr2();
-                                       while (cp >= size2)
-                                               b2[size2++] = ' ';
-                                       b2[cp] = b1[cp];
-                               }
-                               b1[cp++] = c;
-                       }
-               } else {
-                       switch (c) {
-
-                       case ' ':
-                               cp++;
-                               break;
-                       
-                       case '\b':
-                               if (cp)
-                                       cp--;
-                               break;
-
-                       case '\t':
-                               cp = (cp + 8) & -8;
-                               break;
-
-                       case '\r':
-                               cp = 0;
-                               break;
-
-                       case '\n':
-                       case '\f':
-                               pr2();
-                               pr1();
-                               putc(c, lpf);
-                               size1 = cp = 0;
-                               break;
-
-                       }
-               }
-       }
-       pr2();
-       pr1();
-}
-pr1()
-{
-       register char *p, *lim;
-
-       p = b1;
-       lim = p + size1;
-       while (p < lim)
-               putc(*p++, lpf);
-       size1 = 0;
-}
-
-pr2()
-{
-       register char *p, *lim;
-
-       p = b2;
-       lim = p + size2;
-       if (p < lim) {
-               do
-                       putc(*p++, lpf);
-               while (p < lim);
-               putc('\r', lpf);
-       }
-       size2 = 0;
-}
-
-/* VARARGS */
-trouble(s, a1, a2, a3, a4)
-char   *s;
-{
-       if(retcode != 0){
-               dem_dis();
-       }
-       longjmp(env, 1);
-}
-
-/* VARARGS */
-logerr()
-{
-}
-
-getowner()
-{
-}
-
-maildname()
-{
-       fprintf(pmail, "Your lpr printer job is done.\n");
-}
-
-banner(s)
-char *s;
-{
-       long timeb;
-       register char *sp;
-       int i, j, t, lsw;
-
-       for(lsw=0; s[lsw] && lsw<5; lsw++);
-       putc(ff, lpf);
-       fprintf(lpf, "\n\n\n\n\n\n\n\n");
-       for (i=0; i<16; i++) {
-               if(lsw < 5)
-                       fprintf(lpf, "                ");
-               for (sp=s; *sp; sp++) {
-                       if (*sp<=' '|| *sp >'}')
-                               continue;
-                       fprintf(lpf, "  ");
-                       t = chrtab[*sp - ' '][i];
-                       for (j=7; j>=0; j--)
-                               if ((t>>j) & 01)
-                                       putc('X', lpf);
-                               else
-                                       putc(' ', lpf);
-               }
-               putc('\n', lpf);
-       }
-       fprintf(lpf, "\n\n\n\n\n\n\n\n");
-       time(&timeb);
-       fprintf(lpf, "                ");
-       fprintf(lpf, ctime(&timeb));
-       putc(ff, lpf);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/lpr.c b/.ref-Research-V7/usr/src/cmd/lpr/lpr.c
deleted file mode 100644 (file)
index 28eb6c9..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#include       <stdio.h>
-
-/*
- *  lpr -- on line print to line printer
- */
-#ifdef VPR
-/*  if VPR defined, uses versatek printer via /usr/spool/vpd. */
-#endif
-
-#define        DPR     0
-#define        FGET    0
-#define        FSEND   0
-#define        GCAT    0
-#define        LPR     1
-
-#ifdef VPR
-#define        NAME    "vpr"
-#else
-#define        NAME    "lpr"
-#endif
-
-#define        BF      'F'
-#define        MAXCOPY 204800L
-#define FIRSTCHAR 'A'-1
-
-#ifdef VPR
-char   cfname[]        = "/usr/spool/vpd/cf@XXXXX";
-char   dfname[]        = "/usr/spool/vpd/df@XXXXX";
-char   lfname[]        = "/usr/spool/vpd/lf@XXXXX";
-char   tfname[]        = "/usr/spool/vpd/tf@XXXXX";
-char   zfname[]        = "/usr/spool/vpd/zf@XXXXX";
-#else
-char   cfname[]        = "/usr/spool/lpd/cf@XXXXX";
-char   dfname[]        = "/usr/spool/lpd/df@XXXXX";
-char   lfname[]        = "/usr/spool/lpd/lf@XXXXX";
-char   tfname[]        = "/usr/spool/lpd/tf@XXXXX";
-char   zfname[]        = "/usr/spool/lpd/zf@XXXXX";
-#endif
-
-#include       "spool.c"
-
-main(agc, agv)
-int agc;
-char *agv[];
-{
-       argc = agc;    argv = agv;
-       pidfn();
-
-       while (argc>1 && (arg = argv[1])[0]=='-') {
-           if(!comopt(arg[1]))
-               switch (arg[1]) {
-
-               default:
-                       fprintf(stderr, "%s: Unrecognized option: %s\n", NAME, arg);
-                       break;
-               }
-               argc--;
-               argv++;
-       }
-
-       if(debug)
-               tff = stdout;
-       else
-               if((tff = nfile(tfname)) == NULL){
-                       fprintf(stderr, "%s: Can't create %s.\n", NAME, tfname);
-                       out();
-               }
-       if(ident())
-               out();
-
-       filargs();              /*process file arguments.*/
-
-       if(debug)
-               out();
-       fclose(tff);
-       if(nact) {
-               dfname[INCHAR]++;
-               if(link(tfname, dfname) < 0){
-                       fprintf(stderr, "%s: Cannot rename %s\n", NAME, tfname);
-                       out();
-               }
-               unlink(tfname);
-#ifdef VPR
-               execl("/usr/lib/vpd", "vpd", 0);
-               execl("/etc/vpd", "vpd", 0);
-#else
-               execl("/usr/lib/lpd", "lpd", 0);
-               execl("/etc/lpd", "lpd", 0);
-#endif
-               fprintf(stderr, "%s: Can't find daemon.\nFiles left in spooling dir.\n", NAME);
-               exit(1);
-       }
-       out();
-}
-
-
-archive()
-{
-}
-
-
-nuact()
-{
-}
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/makefile b/.ref-Research-V7/usr/src/cmd/lpr/makefile
deleted file mode 100644 (file)
index de5c503..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-lpr:   lpr.c spool.c
-       cc -n -s -O lpr.c -o lpr
-
-lpd:   lpd.c daemon.c daemon0.c
-       cc -n -s -O lpd.c -o lpd
-
-install:
-       cp lpr /bin/lpr
-       cp lpd /usr/lib/lpd
-       rm lpr
-       rm lpd
-       echo make sure /etc/rc contains
-       echo rm /usr/spool/lpd/lock; /usr/lib/lpd
-       mkdir /usr/spool
-       mkdir /usr/spool/lpd
diff --git a/.ref-Research-V7/usr/src/cmd/lpr/spool.c b/.ref-Research-V7/usr/src/cmd/lpr/spool.c
deleted file mode 100644 (file)
index 2aa9017..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-#include       <signal.h>
-#include       <sys/types.h>
-#include       <sys/stat.h>
-
-#define        ONL     0
-#define        TOSS    1
-int    INCHAR  = 0;            /*index of incremented character in
-                                       temporary file names. */
-
-char   version[] = "Version 2/6/79";
-
-char   grade;
-char   remote[]= "$    remote  **,onl";
-char   toss[]  = "$    sysout  toss";
-int    remotsw;                /*toss-output flag*/
-char   *mailfile = 0;
-char   wantmail = 0;
-char   *pp     = 0;            /*recipient of mail*/
-char   *identf = 0;            /*ident card info*/
-int    uidf    = 0;
-char   gcosid[13];             /*gcos userid*/
-char   cpflag = 'l';           /*copy/link flag*/
-int    rmflag  = 0;            /*remove flag*/
-int    debug   = 0;
-int    gcdebug = 0;            /*GCOS debug switch*/
-int    archsw = 0;             /*archive switch*/
-
-int    argc;
-char   **argv;
-char   *arg;
-char   buf[80];                /*used by card */
-int    nact = 0;               /*number of non-null files to process.*/
-int    gsize   = 20;           /*size of current file in GCOS blocks.*/
-long   usize   = 20*1200;      /*size of current file in bytes.*/
-FILE   *tff;           /*temporary control card file*/
-FILE   *nfile();
-char   *getarg();
-char   *sprintf();
-
-
-comopt(o)              /*routine to test for common options.*/
-char o;
-{
-       switch (o){
-
-       case 'c':
-               cpflag = 'c';
-               break;
-
-       case 'i':
-               identf = getarg('i');
-               break;
-
-       case 'm':
-               wantmail++;
-               if(arg[2])
-                       pp = &arg[2];
-               break;
-       
-       case 'n':               /*new option to suppress mail. MRW*/
-               wantmail = 0;
-               break;
-
-       case 'o':
-               remotsw = ONL;
-               break;
-
-       case 'r':
-               rmflag++;
-               break;
-
-       case 's':
-               if(arg[2] < '1' || arg[2] > '3')
-                       goto unknown;
-               grade = arg[2];
-               break;
-
-       case 't':
-               if(arg[2])
-                       goto unknown;
-               remotsw = TOSS;
-               break;
-
-       case '#':
-               debug = 1;
-               break;
-
-       case 'Z':                       /*GCOS debugging switch*/
-               gcdebug = 1;
-               break;
-
-unknown:
-       default:
-               return(0);
-       }
-       return(1);
-}
-
-
-#if LPR == 0
-
-spool1()               /*set up common initial GCOS control cards.*/
-{
-       if(debug)
-               tff = stdout;
-       else
-               if((tff = nfile(tfname)) == NULL){
-                       fprintf(stderr, "%s: Can't create %s.\n", NAME, tfname);
-                       out();
-               }
-       card('S', "");
-       card('L', sprintf(buf, "$       sgrade  %c   %s", grade, version ) );
-       if(ident())
-               out();
-       card('L', remote);
-       if(remotsw == TOSS)
-               card('L', toss);
-}
-
-
-spool2()                       /*add final control cards, and spool job.*/
-{
-       if(wantmail)
-               card('N', mailfile);
-       card('L', "$    endjob");
-       if(debug)
-               out();
-       fclose(tff);
-       if(nact) {
-               dfname[INCHAR]++;
-               if(link(tfname, dfname) < 0){
-                       fprintf(stderr, "%s: Cannot rename %s\n", NAME, tfname);
-                       out();
-               }
-               unlink(tfname);
-               execl("/usr/lib/dpd", "dpd", 0);
-               execl("/etc/dpd", "dpd", 0);
-               fprintf(stderr, "%s: Can't find dpd.\nFiles left in spooling dir.\n", NAME);
-               exit(1);
-       }
-}
-
-#endif
-
-
-#if FGET == 0
-
-filargs()              /*process file arguments for dpr, gcat, fsend, lpr.*/
-{
-       int i;
-       FILE *f;
-
-       if(argc == 1){
-               if(mailfile == 0)
-                       mailfile = "pipe.end";
-               if(copy(stdin, mailfile, GCAT) == -1)
-                       out();
-               if(archsw)
-                       archive();
-       }
-       while(--argc) {
-               arg = *++argv;
-               switch(cpflag){
-
-               case 'l':
-                       if(lfname[INCHAR]++ >= 'z')
-                               cpflag = rmflag ? 'c' : 'n';
-                       else if(link(arg, lfname) == 0){
-                               if(size(arg,arg) <= 0)
-                                       continue;
-                               nuact(arg);
-                               card(BF, lfname);
-                               card('U', lfname);
-                               break;
-                       }
-
-               case 'n':
-                       if(*arg == '/' && !rmflag){
-                               if(size(arg,arg) <= 0)
-                                       continue;
-                               nuact(arg);
-                               card(BF, arg);
-                               break;
-                       }
-
-               case 'c':
-                       f = fopen(arg, "r");
-                       if(f == NULL){
-                               fprintf(stderr, "%s: Cannot open %s\n", NAME, arg);
-                               continue;
-                       }
-                       i = copy(f, arg, GCAT);
-                       fclose(f);
-                       if(i == -1)
-                               continue;
-                       break;
-               }
-               if(archsw)
-                       archive();
-               if(rmflag){
-                       if(unlink(arg) < 0)
-                               fprintf(stderr, "%s: Cannot remove %s\n", NAME, arg);
-               }
-               if(mailfile == 0)
-                       mailfile = arg;
-       }
-}
-
-#endif
-
-
-FILE *nfile(name)              /*generate a new file name, and open file.*/
-char *name;
-{
-       FILE *f;
-
-       if(name[INCHAR] >= 'z')
-               return(NULL);
-       name[INCHAR]++;
-       if(!access(name, 0) || (f = fopen(name, "w")) == NULL)
-               return(NULL);
-       return(f);
-}
-
-#if FGET == 0
-copy(f, gname, gcatsw)
-FILE   *f;
-char   *gname;
-int    gcatsw;
-{
-       int c;
-       FILE *ff;
-       long cnt;
-
-       if((ff = nfile(cfname)) == NULL){
-               fprintf(stderr, "%s: Too many copy files; %s not copied\n", NAME, gname);
-               return(-1);
-       }
-       cnt = 0;
-       while((c = getc(f)) != EOF){
-               if(gcatsw)
-                   if(c != 0){
-                       fprintf(stderr, "%s: Bad input from %s.\n", NAME, gname);
-                       out();
-                   }else  gcatsw = 0;
-               if((putc(c, ff) == EOF) && ferror(ff)){
-                       fprintf(stderr, "%s: Write error on copy of %s.\n", NAME, gname);
-                       break;
-               }
-               cnt++;
-               if(cnt > MAXCOPY){
-                       fprintf(stderr, "%s: Copy file %s is too large\n", NAME, gname);
-                       break;
-               }
-       }
-       fclose(ff);
-       if(size(cfname,gname) <= 0)
-               return(-1);
-       nuact(gname);
-       card(BF, cfname);
-       card('U', cfname);
-       return(0);
-}
-
-#endif
-
-card(c, s)
-int c;
-char   *s;
-{
-       putc( c, tff );
-
-       while( (c = *s++) != '\0') putc( c, tff );
-
-       c = putc( '\n', tff );
-
-       if(c == EOF){
-               fprintf(stderr, "%s: Error writing control file.\n", NAME);
-               out();
-               }
-}
-
-size(file, name)
-char   *file, *name;
-{
-       struct stat stbuf;
-
-       if(stat(file,&stbuf) < 0){
-               fprintf(stderr, "%s: Cannot open %s\n", NAME, file);
-               return(-1);
-       }
-       if(!stbuf.st_size){
-               fprintf(stderr, "%s: File %s is empty.\n", NAME, name);
-               return(0);
-       }
-       usize = stbuf.st_size;
-       gsize = usize / 1200;
-       gsize++;
-       nact++;
-       return(gsize);
-}
-
-
-char *
-getarg(c)              /*get modifier for complex options --
-                           from either same or next argument. MRW
-                           e.g. either "-ffile" or "-f file"*/
-char   c;
-{
-
-       if(arg[2])
-               return(&arg[2]);
-       else if(--argc>1)
-               return(arg = (++argv)[1]);
-       fprintf(stderr, "%s: Incomplete -%c option\n", NAME,c);
-       out();
-}
-
-#include       <pwd.h>
-struct passwd *getpwuid();
-
-ident()
-{
-       int c, i, j, n, test, jsave;
-       struct passwd *b1;
-       static char b2[100];
-
-       if((b1 = getpwuid(getuid())) == NULL) {
-               fprintf(stderr, "%s: Invalid user id\n", NAME);
-               return(1);
-       }
-       j = 0;
-#if LPR == 0
-       while(c = "$    ident   "[j])
-               b2[j++] = c;
-
-       i = 0;
-       if(identf) 
-               while(c = identf[i++])
-                       b2[j++] = c;
-       else{
-               jsave = j;              /*use either usg or pwb-style passwd. MRW*/
-               while((c = b1->pw_gecos[i++]) && c != ':')
-                       if(c == ')')
-                               j = jsave;
-                       else
-                               b2[j++] = c;
-       }
-       b2[j++] = ',';
-#endif
-
-       i = 0;
-       if(!pp)
-               pp = &b2[j];
-       while(c = b1->pw_name[i++])
-               b2[j++] = c;
-       b2[j] = '\0';
-
-#if LPR == 0
-       i = 0;
-       n = 3;
-       while(--n) {
-               test = 0;
-               while((c=b2[i++]) && c != ',') {
-                       if('0' <= c && c <= '9') test += c -'0';
-                       else test = 0;
-               }
-               if(test == 0) {
-                       b2[j] = '\0';
-                       fprintf(stderr, "%s: Invalid IDENT information - %s\n", NAME, b2);
-                       return (1);
-               }
-       }
-
-       if(!uidf) {
-               n = 0;
-               while((c = b2[i++]) && c != ',') {
-                       if(n >= 12) break;
-                       gcosid[n++] = c;
-               }
-               gcosid[n++] = '\0';
-       }
-#endif
-       card('L', b2);
-       if(wantmail){
-               card('M',pp);
-               if(identf)
-                       card('Q', b2);  /*mail back $IDENT card.*/
-       }
-       return (0);
-}
-
-pidfn()                        /*rewrite using mktemp. MRW*/
-{
-       int out();
-
-       while(tfname[INCHAR] != 'X')
-               INCHAR++;
-       INCHAR--;
-       mktemp(cfname);
-       mktemp(dfname);
-       mktemp(lfname);
-       mktemp(tfname);
-       mktemp(zfname);
-       if(signal(SIGHUP, SIG_IGN) != SIG_IGN)
-               signal(SIGHUP, out);
-       if(signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, out);
-       if(signal(SIGQUIT, SIG_IGN) != SIG_IGN)
-               signal(SIGQUIT, out);
-       if(signal(SIGTERM, SIG_IGN) != SIG_IGN)
-               signal(SIGTERM, out);
-}
-
-out()
-{
-       register i;
-
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       signal(SIGTERM, SIG_IGN);
-       i = INCHAR;
-       for(; cfname[i] != FIRSTCHAR; cfname[i]--) 
-               unlink(cfname);
-       if(dfname[i] != FIRSTCHAR)
-               unlink(dfname);
-       for(; lfname[i] != FIRSTCHAR; lfname[i]--) 
-               unlink(lfname);
-       if(tfname[i] != FIRSTCHAR)
-               unlink(tfname);
-       for(; zfname[i] != FIRSTCHAR; zfname[i]--) 
-               unlink(zfname);
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ls.c b/.ref-Research-V7/usr/src/cmd/ls.c
deleted file mode 100644 (file)
index e3d2fae..0000000
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * list file or directory
- */
-
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <stdio.h>
-
-#define        NFILES  1024
-FILE   *pwdf, *dirf;
-char   stdbuf[BUFSIZ];
-
-struct lbuf {
-       union {
-               char    lname[15];
-               char    *namep;
-       } ln;
-       char    ltype;
-       short   lnum;
-       short   lflags;
-       short   lnl;
-       short   luid;
-       short   lgid;
-       long    lsize;
-       long    lmtime;
-};
-
-int    aflg, dflg, lflg, sflg, tflg, uflg, iflg, fflg, gflg, cflg;
-int    rflg    = 1;
-long   year;
-int    flags;
-int    lastuid = -1;
-char   tbuf[16];
-long   tblocks;
-int    statreq;
-struct lbuf    *flist[NFILES];
-struct lbuf    **lastp = flist;
-struct lbuf    **firstp = flist;
-char   *dotp   = ".";
-
-char   *makename();
-struct lbuf *gstat();
-char   *ctime();
-long   nblock();
-
-#define        ISARG   0100000
-
-main(argc, argv)
-char *argv[];
-{
-       int i;
-       register struct lbuf *ep, **ep1;
-       register struct lbuf **slastp;
-       struct lbuf **epp;
-       struct lbuf lb;
-       char *t;
-       int compar();
-
-       setbuf(stdout, stdbuf);
-       time(&lb.lmtime);
-       year = lb.lmtime - 6L*30L*24L*60L*60L; /* 6 months ago */
-       if (--argc > 0 && *argv[1] == '-') {
-               argv++;
-               while (*++*argv) switch (**argv) {
-
-               case 'a':
-                       aflg++;
-                       continue;
-
-               case 's':
-                       sflg++;
-                       statreq++;
-                       continue;
-
-               case 'd':
-                       dflg++;
-                       continue;
-
-               case 'g':
-                       gflg++;
-                       continue;
-
-               case 'l':
-                       lflg++;
-                       statreq++;
-                       continue;
-
-               case 'r':
-                       rflg = -1;
-                       continue;
-
-               case 't':
-                       tflg++;
-                       statreq++;
-                       continue;
-
-               case 'u':
-                       uflg++;
-                       continue;
-
-               case 'c':
-                       cflg++;
-                       continue;
-
-               case 'i':
-                       iflg++;
-                       continue;
-
-               case 'f':
-                       fflg++;
-                       continue;
-
-               default:
-                       continue;
-               }
-               argc--;
-       }
-       if (fflg) {
-               aflg++;
-               lflg = 0;
-               sflg = 0;
-               tflg = 0;
-               statreq = 0;
-       }
-       if(lflg) {
-               t = "/etc/passwd";
-               if(gflg)
-                       t = "/etc/group";
-               pwdf = fopen(t, "r");
-       }
-       if (argc==0) {
-               argc++;
-               argv = &dotp - 1;
-       }
-       for (i=0; i < argc; i++) {
-               if ((ep = gstat(*++argv, 1))==NULL)
-                       continue;
-               ep->ln.namep = *argv;
-               ep->lflags |= ISARG;
-       }
-       qsort(firstp, lastp - firstp, sizeof *lastp, compar);
-       slastp = lastp;
-       for (epp=firstp; epp<slastp; epp++) {
-               ep = *epp;
-               if (ep->ltype=='d' && dflg==0 || fflg) {
-                       if (argc>1)
-                               printf("\n%s:\n", ep->ln.namep);
-                       lastp = slastp;
-                       readdir(ep->ln.namep);
-                       if (fflg==0)
-                               qsort(slastp,lastp - slastp,sizeof *lastp,compar);
-                       if (lflg || sflg)
-                               printf("total %D\n", tblocks);
-                       for (ep1=slastp; ep1<lastp; ep1++)
-                               pentry(*ep1);
-               } else 
-                       pentry(ep);
-       }
-       exit(0);
-}
-
-pentry(ap)
-struct lbuf *ap;
-{
-       struct { char dminor, dmajor;};
-       register t;
-       register struct lbuf *p;
-       register char *cp;
-
-       p = ap;
-       if (p->lnum == -1)
-               return;
-       if (iflg)
-               printf("%5u ", p->lnum);
-       if (sflg)
-       printf("%4D ", nblock(p->lsize));
-       if (lflg) {
-               putchar(p->ltype);
-               pmode(p->lflags);
-               printf("%2d ", p->lnl);
-               t = p->luid;
-               if(gflg)
-                       t = p->lgid;
-               if (getname(t, tbuf)==0)
-                       printf("%-6.6s", tbuf);
-               else
-                       printf("%-6d", t);
-               if (p->ltype=='b' || p->ltype=='c')
-                       printf("%3d,%3d", major((int)p->lsize), minor((int)p->lsize));
-               else
-                       printf("%7ld", p->lsize);
-               cp = ctime(&p->lmtime);
-               if(p->lmtime < year)
-                       printf(" %-7.7s %-4.4s ", cp+4, cp+20); else
-                       printf(" %-12.12s ", cp+4);
-       }
-       if (p->lflags&ISARG)
-               printf("%s\n", p->ln.namep);
-       else
-               printf("%.14s\n", p->ln.lname);
-}
-
-getname(uid, buf)
-int uid;
-char buf[];
-{
-       int j, c, n, i;
-
-       if (uid==lastuid)
-               return(0);
-       if(pwdf == NULL)
-               return(-1);
-       rewind(pwdf);
-       lastuid = -1;
-       do {
-               i = 0;
-               j = 0;
-               n = 0;
-               while((c=fgetc(pwdf)) != '\n') {
-                       if (c==EOF)
-                               return(-1);
-                       if (c==':') {
-                               j++;
-                               c = '0';
-                       }
-                       if (j==0)
-                               buf[i++] = c;
-                       if (j==2)
-                               n = n*10 + c - '0';
-               }
-       } while (n != uid);
-       buf[i++] = '\0';
-       lastuid = uid;
-       return(0);
-}
-
-long
-nblock(size)
-long size;
-{
-       return((size+511)>>9);
-}
-
-int    m1[] = { 1, S_IREAD>>0, 'r', '-' };
-int    m2[] = { 1, S_IWRITE>>0, 'w', '-' };
-int    m3[] = { 2, S_ISUID, 's', S_IEXEC>>0, 'x', '-' };
-int    m4[] = { 1, S_IREAD>>3, 'r', '-' };
-int    m5[] = { 1, S_IWRITE>>3, 'w', '-' };
-int    m6[] = { 2, S_ISGID, 's', S_IEXEC>>3, 'x', '-' };
-int    m7[] = { 1, S_IREAD>>6, 'r', '-' };
-int    m8[] = { 1, S_IWRITE>>6, 'w', '-' };
-int    m9[] = { 2, S_ISVTX, 't', S_IEXEC>>6, 'x', '-' };
-
-int    *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
-
-pmode(aflag)
-{
-       register int **mp;
-
-       flags = aflag;
-       for (mp = &m[0]; mp < &m[sizeof(m)/sizeof(m[0])];)
-               select(*mp++);
-}
-
-select(pairp)
-register int *pairp;
-{
-       register int n;
-
-       n = *pairp++;
-       while (--n>=0 && (flags&*pairp++)==0)
-               pairp++;
-       putchar(*pairp);
-}
-
-char *
-makename(dir, file)
-char *dir, *file;
-{
-       static char dfile[100];
-       register char *dp, *fp;
-       register int i;
-
-       dp = dfile;
-       fp = dir;
-       while (*fp)
-               *dp++ = *fp++;
-       *dp++ = '/';
-       fp = file;
-       for (i=0; i<DIRSIZ; i++)
-               *dp++ = *fp++;
-       *dp = 0;
-       return(dfile);
-}
-
-readdir(dir)
-char *dir;
-{
-       static struct direct dentry;
-       register int j;
-       register struct lbuf *ep;
-
-       if ((dirf = fopen(dir, "r")) == NULL) {
-               printf("%s unreadable\n", dir);
-               return;
-       }
-       tblocks = 0;
-       for(;;) {
-               if (fread((char *)&dentry, sizeof(dentry), 1, dirf) != 1)
-                       break;
-               if (dentry.d_ino==0
-                || aflg==0 && dentry.d_name[0]=='.' &&  (dentry.d_name[1]=='\0'
-                       || dentry.d_name[1]=='.' && dentry.d_name[2]=='\0'))
-                       continue;
-               ep = gstat(makename(dir, dentry.d_name), 0);
-               if (ep==NULL)
-                       continue;
-               if (ep->lnum != -1)
-                       ep->lnum = dentry.d_ino;
-               for (j=0; j<DIRSIZ; j++)
-                       ep->ln.lname[j] = dentry.d_name[j];
-       }
-       fclose(dirf);
-}
-
-struct lbuf *
-gstat(file, argfl)
-char *file;
-{
-       extern char *malloc();
-       struct stat statb;
-       register struct lbuf *rep;
-       static int nomocore;
-
-       if (nomocore)
-               return(NULL);
-       rep = (struct lbuf *)malloc(sizeof(struct lbuf));
-       if (rep==NULL) {
-               fprintf(stderr, "ls: out of memory\n");
-               nomocore = 1;
-               return(NULL);
-       }
-       if (lastp >= &flist[NFILES]) {
-               static int msg;
-               lastp--;
-               if (msg==0) {
-                       fprintf(stderr, "ls: too many files\n");
-                       msg++;
-               }
-       }
-       *lastp++ = rep;
-       rep->lflags = 0;
-       rep->lnum = 0;
-       rep->ltype = '-';
-       if (argfl || statreq) {
-               if (stat(file, &statb)<0) {
-                       printf("%s not found\n", file);
-                       statb.st_ino = -1;
-                       statb.st_size = 0;
-                       statb.st_mode = 0;
-                       if (argfl) {
-                               lastp--;
-                               return(0);
-                       }
-               }
-               rep->lnum = statb.st_ino;
-               rep->lsize = statb.st_size;
-               switch(statb.st_mode&S_IFMT) {
-
-               case S_IFDIR:
-                       rep->ltype = 'd';
-                       break;
-
-               case S_IFBLK:
-                       rep->ltype = 'b';
-                       rep->lsize = statb.st_rdev;
-                       break;
-
-               case S_IFCHR:
-                       rep->ltype = 'c';
-                       rep->lsize = statb.st_rdev;
-                       break;
-               }
-               rep->lflags = statb.st_mode & ~S_IFMT;
-               rep->luid = statb.st_uid;
-               rep->lgid = statb.st_gid;
-               rep->lnl = statb.st_nlink;
-               if(uflg)
-                       rep->lmtime = statb.st_atime;
-               else if (cflg)
-                       rep->lmtime = statb.st_ctime;
-               else
-                       rep->lmtime = statb.st_mtime;
-               tblocks += nblock(statb.st_size);
-       }
-       return(rep);
-}
-
-compar(pp1, pp2)
-struct lbuf **pp1, **pp2;
-{
-       register struct lbuf *p1, *p2;
-
-       p1 = *pp1;
-       p2 = *pp2;
-       if (dflg==0) {
-               if (p1->lflags&ISARG && p1->ltype=='d') {
-                       if (!(p2->lflags&ISARG && p2->ltype=='d'))
-                               return(1);
-               } else {
-                       if (p2->lflags&ISARG && p2->ltype=='d')
-                               return(-1);
-               }
-       }
-       if (tflg) {
-               if(p2->lmtime == p1->lmtime)
-                       return(0);
-               if(p2->lmtime > p1->lmtime)
-                       return(rflg);
-               return(-rflg);
-       }
-       return(rflg * strcmp(p1->lflags&ISARG? p1->ln.namep: p1->ln.lname,
-                               p2->lflags&ISARG? p2->ln.namep: p2->ln.lname));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/m4/m4.c b/.ref-Research-V7/usr/src/cmd/m4/m4.c
deleted file mode 100644 (file)
index 3e6ce5b..0000000
+++ /dev/null
@@ -1,899 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-
-#define ERROR NULL
-#define        READ    "r"
-#define        WRITE   "w"
-
-#define        EOS     0
-int    lpar    = '(';
-#define        LPAR    lpar
-#define        RPAR    ')'
-#define        COMMA   ','
-#define        GRAVE   '`'
-#define        ACUTE   '\''
-#define LBRAK  '['
-#define RBRAK  ']'
-#ifdef  M4
-char   lquote  LBRAK;
-char   rquote  RBRAK;
-#endif
-#ifndef M4
-char   lquote  = GRAVE;
-char   rquote  = ACUTE;
-#endif
-#define        COMMENT '#'
-#define        ALPH    1
-#define        DIG     2
-
-#define        HSHSIZ  199     /* prime */
-#define        STACKS  50
-#define        SAVS    4096
-#define        TOKS    128
-
-#define        putbak(c)       *ip++ = c;
-#define        getchr()        (ip>cur_ip?*--ip: getc(infile[infptr]))
-#define        putchr(c)       if (cp==NULL) {if (curfile)putc(c,curfile);} else *op++ = c
-char   type[] = {
-       0,      0,      0,      0,      0,      0,      0,      0,
-       0,      0,      0,      0,      0,      0,      0,      0,
-       0,      0,      0,      0,      0,      0,      0,      0,
-       0,      0,      0,      0,      0,      0,      0,      0,
-       0,      0,      0,      0,      0,      0,      0,      0,
-       0,      0,      0,      0,      0,      0,      0,      0,
-       DIG,    DIG,    DIG,    DIG,    DIG,    DIG,    DIG,    DIG,
-       DIG,    DIG,    0,      0,      0,      0,      0,      0,
-       0,      ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,
-       ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,
-       ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,
-       ALPH,   ALPH,   ALPH,   0,      0,      0,      0,      ALPH,
-       0,      ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,
-       ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,
-       ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,   ALPH,
-       ALPH,   ALPH,   ALPH,   0,      0,      0,      0,      0,
-};
-
-char   token[TOKS];
-char   eoa[]   = "\0";
-struct nlist {
-       char    *name;
-       char    *def;
-       struct  nlist *next;
-};
-
-struct nlist   *hshtab[HSHSIZ];
-char   ibuf[SAVS+TOKS];
-char   obuf[SAVS+TOKS];
-char   *op     = obuf;
-char   *ip     = ibuf;
-char *ip_stk[10] = {ibuf};
-char *cur_ip = ibuf;
-struct call {
-       char    **argp;
-       int     plev;
-};
-struct call    *cp = NULL;
-
-char   *makeloc;
-char   *ifdefloc;
-char   *lenloc;
-char   *undefloc;
-char   *shiftloc;
-char   *cqloc;
-char   *defloc;
-char   *evaloc;
-char   *incrloc;
-char   *substrloc;
-char   *indexloc;
-char   *transloc;
-char   *ifloc;
-char   *divloc;
-char   *divnumloc;
-char   *undivloc;
-char   *dnlloc;
-char   *inclloc;
-char   *sinclloc;
-char   *syscmdloc;
-char   *dumploc;
-char   *errploc;
-
-char   *tempname;
-struct nlist   *lookup();
-char   *install();
-char   *malloc();
-char   *mktemp();
-char   *copy();
-long   ctol();
-int    hshval;
-FILE   *olist[11] = { stdout };
-int    okret;
-int    curout  = 0;
-FILE   *curfile = { stdout };
-FILE   *infile[10] = { stdin };
-int    infptr  = 0;
-
-main(argc, argv)
-char **argv;
-{
-       char *argstk[STACKS+10];
-       struct call callst[STACKS];
-       register char *tp, **ap;
-       int delexit(), catchsig();
-       register t;
-       int i;
-
-#ifdef gcos
-#ifdef M4
-       install("GCOS", eoa);
-#endif
-#ifndef M4
-       install("gcos", eoa);
-#endif
-#endif
-#ifdef unix
-#ifdef M4
-       install("UNIX", eoa);
-#endif
-#ifndef M4
-       install("unix", eoa);
-#endif
-#endif
-
-#ifdef M4
-       makeloc = install("MAKETEMP", eoa);
-       ifdefloc = install("IFDEF", eoa);
-       lenloc = install("LEN", eoa);
-       undefloc = install("UNDEFINE", eoa);
-       shiftloc = install("SHIFT", eoa);
-       cqloc = install("CHANGEQUOTE", eoa);
-       defloc = install("DEFINE", eoa);
-       evaloc = install("EVAL", eoa);
-       inclloc = install("INCLUDE", eoa);
-       sinclloc = install("SINCLUDE", eoa);
-       syscmdloc = install("SYSCMD", eoa);
-       dumploc = install("DUMPDEF", eoa);
-       errploc = install("ERRPRINT", eoa);
-       incrloc = install("INCR", eoa);
-       substrloc = install("SUBSTR", eoa);
-       indexloc = install("INDEX", eoa);
-       transloc = install("TRANSLIT", eoa);
-       ifloc = install("IFELSE", eoa);
-       divloc = install("DIVERT", eoa);
-       divnumloc = install("DIVNUM", eoa);
-       undivloc = install("UNDIVERT", eoa);
-       dnlloc = install("DNL", eoa);
-#endif
-
-#ifndef M4
-       makeloc = install("maketemp", eoa);
-       ifdefloc = install("ifdef", eoa);
-       lenloc = install("len", eoa);
-       undefloc = install("undefine", eoa);
-       shiftloc = install("shift", eoa);
-       cqloc = install("changequote", eoa);
-       defloc = install("define", eoa);
-       evaloc = install("eval", eoa);
-       inclloc = install("include", eoa);
-       sinclloc = install("sinclude", eoa);
-       syscmdloc = install("syscmd", eoa);
-       dumploc = install("dumpdef", eoa);
-       errploc = install("errprint", eoa);
-       incrloc = install("incr", eoa);
-       substrloc = install("substr", eoa);
-       indexloc = install("index", eoa);
-       transloc = install("translit", eoa);
-       ifloc = install("ifelse", eoa);
-       divloc = install("divert", eoa);
-       divnumloc = install("divnum", eoa);
-       undivloc = install("undivert", eoa);
-       dnlloc = install("dnl", eoa);
-#endif
-       ap = argstk;
-#ifndef gcos
-       if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
-               signal(SIGHUP, catchsig);
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, catchsig);
-       tempname = mktemp("/tmp/m4aXXXXX");
-       close(creat(tempname, 0));
-#endif
-#ifdef gcos
-       tempname = "m4.tempa";
-#endif
-       if (argc>1)
-               putbak(0);
-       for (;;) {
-               tp = token;
-               *tp++ = t = getchr();
-               *tp = EOS;
-               if (t<=0) {
-                       if (infptr > 0) {
-                               fclose(infile[infptr]);
-                               infptr--;
-                               cur_ip = ip_stk[infptr];
-                               continue;
-                       }
-                       if (argc<=1)
-                               break;
-                       argc--;
-                       argv++;
-                       if (infile[infptr]!=stdin)
-                               fclose(infile[infptr]);
-                       if (**argv=='-')
-                               infile[infptr] = stdin;
-                       else if ((infile[infptr]=fopen(argv[0], READ))==ERROR) {
-                               fprintf(stderr, "m4: file not found: %s\n", argv[0]);
-                               delexit();
-                       }
-                       continue;
-               }
-               if (type[t]==ALPH) {
-                       while ((t=type[*tp++=getchr()])==ALPH||t==DIG);
-                       putbak(*--tp);
-                       *tp = EOS;
-                       if (*ap = lookup(token)->def) {
-                               if (++ap >= &argstk[STACKS]) {
-                                       fprintf(stderr, "m4: arg stack overflow\n");
-                                       delexit();
-                               }
-                               if (cp==NULL)
-                                       cp = callst;
-                               else if (++cp > &callst[STACKS]) {
-                                       fprintf(stderr, "m4: call stack overflow\n");
-                                       delexit();
-                               }
-                               cp->argp = ap;
-                               *ap++ = op;
-                               puttok();
-                               *op++ = '\0';
-                               t = getchr();
-                               putbak(t);
-                               if (t!=LPAR) {
-                                       /* if (t!=' ' && t!='\t') */
-                                               putbak(')');
-                                       putbak('(');
-                               }
-                               else    /* try to fix arg count */
-                                       *ap++ = op;
-                               cp->plev = 0;
-                       } else
-                               puttok();
-               } else if (t==lquote) {
-                       i = 1;
-                       for (;;) {
-                               t = getchr();
-                               if (t==rquote) {
-                                       i--;
-                                       if (i==0)
-                                               break;
-                               } else if (t==lquote)
-                                       i++;
-                               else if (t<0) {
-                                       fprintf(stderr, "m4: EOF in string\n");
-                                       delexit();
-                               }
-                               putchr(t);
-                       }
-               } else if (t==COMMENT) {
-                       putbak(t);
-                       while ((t = getchr())!='\n'&& t>=0)
-                               if (cp==NULL)
-                                       putchr(t);
-                       putbak(t);
-               } else if (cp==NULL) {
-                       puttok();
-               } else if (t==LPAR) {
-                       if (cp->plev)
-                               *op++ = t;
-                       cp->plev++;
-                       while ( (t=getchr())==' ' || t=='\t' || t=='\n')
-                               ;       /* skip leading white space during arg collection */
-                       putbak(t);
-/*
-               } else if (t==' ' || t=='\t' || t=='\n') {
-                       continue;
-*/
-               } else if (t==RPAR) {
-                       cp->plev--;
-                       if (cp->plev==0) {
-                               *op++ = '\0';
-                               expand(cp->argp, ap-cp->argp-1);
-                               op = *cp->argp;
-                               ap = cp->argp-1;
-                               cp--;
-                               if (cp < callst)
-                                       cp = NULL;
-                       } else
-                               *op++ = t;
-               } else if (t==COMMA && cp->plev<=1) {
-                       *op++ = '\0';
-                       *ap++ = op;
-                       while ((t=getchr())==' ' || t=='\t' || t=='\n')
-                               ;       /* skip leading white space during arg collection */
-                       putbak(t);
-               } else
-                       *op++ = t;
-       }
-       if (cp!=NULL) {
-               fprintf(stderr, "m4: unexpected EOF\n");
-               delexit();
-       }
-       okret = 1;
-       delexit();
-}
-
-catchsig()
-{
-       okret = 0;
-       delexit();
-}
-
-delexit()
-{
-       register FILE *fp;
-       register i, c;
-
-       if (!okret) {
-               signal(SIGHUP, SIG_IGN);
-               signal(SIGINT, SIG_IGN);
-       }
-       for (i=1; i<10; i++) {
-               if (olist[i]==NULL)
-                       continue;
-               fclose(olist[i]);
-               tempname[7] = 'a'+i;
-               if (okret) {
-                       fp = fopen(tempname, READ);
-                       while ((c = getc(fp)) > 0)
-                               putchar(c);
-                       fclose(fp);
-               }
-               unlink(tempname);
-       }
-       tempname[7] = 'a';
-       unlink(tempname);
-       exit(1-okret);
-}
-
-puttok()
-{
-       register char *tp;
-
-       tp = token;
-       if (cp) {
-               if (op >= &obuf[SAVS]) {
-                       fprintf(stderr, "m4: argument overflow\n");
-                       delexit();
-               }
-               while (*tp)
-                       *op++ = *tp++;
-       } else if (curfile)
-               while (*tp)
-                       putc(*tp++, curfile);
-}
-
-pbstr(str)
-register char *str;
-{
-       register char *p;
-
-       p = str;
-       while (*p++);
-       --p;
-       if (ip >= &ibuf[SAVS]) {
-               fprintf(stderr, "m4: pushback overflow\n");
-               delexit();
-       }
-       while (p > str)
-               putbak(*--p);
-}
-
-expand(a1, c)
-register char **a1;
-{
-       register char *dp;
-       register n;
-
-       dp = a1[-1];
-       if (dp==defloc)
-               dodef(a1, c);
-       else if (dp==evaloc)
-               doeval(a1, c);
-       else if (dp==inclloc)
-               doincl(a1, c, 1);
-       else if (dp==sinclloc)
-               doincl(a1, c, 0);
-       else if (dp==makeloc)
-               domake(a1, c);
-       else if (dp==syscmdloc)
-               dosyscmd(a1, c);
-       else if (dp==incrloc)
-               doincr(a1, c);
-       else if (dp==substrloc)
-               dosubstr(a1, c);
-       else if (dp==indexloc)
-               doindex(a1, c);
-       else if (dp==transloc)
-               dotransl(a1, c);
-       else if (dp==ifloc)
-               doif(a1, c);
-       else if (dp==divloc)
-               dodiv(a1, c);
-       else if (dp==divnumloc)
-               dodivnum(a1, c);
-       else if (dp==undivloc)
-               doundiv(a1, c);
-       else if (dp==dnlloc)
-               dodnl(a1, c);
-       else if (dp==dumploc)
-               dodump(a1, c);
-       else if (dp==errploc)
-               doerrp(a1, c);
-       else if (dp==lenloc)
-               dolen(a1, c);
-       else if (dp==ifdefloc)
-               doifdef(a1, c);
-       else if (dp==undefloc)
-               doundef(a1, c);
-       else if (dp==shiftloc)
-               doshift(a1, c);
-       else if (dp==cqloc)
-               docq(a1, c);
-       else {
-               while (*dp++);
-               for (dp--; dp>a1[-1]; ) {
-                       if (--dp>a1[-1] && dp[-1]=='$') {
-                               n = *dp-'0';
-                               if (n>=0 && n<=9) {
-                                       if (n <= c)
-                                               pbstr(a1[n]);
-                                       dp--;
-                               } else
-                                       putbak(*dp);
-                       } else
-                               putbak(*dp);
-               }
-       }
-}
-
-struct nlist *lookup(str)
-char *str;
-{
-       register char *s1, *s2;
-       register struct nlist *np;
-       static struct nlist nodef;
-
-       s1 = str;
-       for (hshval = 0; *s1; )
-               hshval += *s1++;
-       hshval %= HSHSIZ;
-       for (np = hshtab[hshval]; np!=NULL; np = np->next) {
-               s1 = str;
-               s2 = np->name;
-               while (*s1++ == *s2)
-                       if (*s2++ == EOS)
-                               return(np);
-       }
-       return(&nodef);
-}
-
-char *install(nam, val)
-char *nam, *val;
-{
-       register struct nlist *np;
-
-       if ((np = lookup(nam))->name == NULL) {
-               np = (struct nlist *)malloc(sizeof(*np));
-               if (np == NULL) {
-                       fprintf(stderr, "m4: no space for alloc\n");
-                       exit(1);
-               }
-               np->name = copy(nam);
-               np->def = copy(val);
-               np->next = hshtab[hshval];
-               hshtab[hshval] = np;
-               return(np->def);
-       }
-       free(np->def);
-       np->def = copy(val);
-       return(np->def);
-}
-
-doundef(ap, c)
-char **ap;
-{
-       register struct nlist *np, *tnp;
-
-       if (c < 1 || (np = lookup(ap[1]))->name == NULL)
-               return;
-       tnp = hshtab[hshval];   /* lookup sets hshval */
-       if (tnp == np)  /* it's in first place */
-               hshtab[hshval] = np->next;
-       else {
-               for ( ; tnp->next != np; tnp = tnp->next)
-                       ;
-               tnp->next = np->next;
-       }
-       free(np->name);
-       free(np->def);
-       free((char *)np);
-}
-
-char *copy(s)
-register char *s;
-{
-       register char *p, *s1;
-
-       p = s1 = malloc((unsigned)strlen(s)+1);
-       if (p == NULL) {
-               fprintf(stderr, "m4: no space for alloc\n");
-               exit(1);
-       }
-       while (*s1++ = *s++);
-       return(p);
-}
-
-dodef(ap, c)
-char **ap;
-{
-       if (c >= 2) {
-               if (strcmp(ap[1], ap[2]) == 0) {
-                       fprintf(stderr, "m4: %s defined as itself\n", ap[1]);
-                       delexit();
-               }
-               install(ap[1], ap[2]);
-       }
-       else if (c == 1)
-               install(ap[1], "");
-}
-
-doifdef(ap, c)
-char **ap;
-{
-       register struct nlist *np;
-
-       if (c < 2)
-               return;
-       if (lookup(ap[1])->name != NULL)
-               pbstr(ap[2]);
-       else if (c >= 3)
-               pbstr(ap[3]);
-}
-
-dolen(ap, c)
-char **ap;
-{
-       putnum((long) strlen(ap[1]));
-}
-
-docq(ap, c)
-char **ap;
-{
-       if (c > 1) {
-               lquote = *ap[1];
-               rquote = *ap[2];
-       } else if (c == 1) {
-               lquote = rquote = *ap[1];
-       } else {
-#ifndef M4
-               lquote = GRAVE;
-               rquote = ACUTE;
-#endif
-#ifdef M4
-               lquote = LBRAK;
-               rquote = RBRAK;
-#endif
-       }
-}
-
-doshift(ap, c)
-char **ap;
-{
-       fprintf(stderr, "m4: shift not yet implemented\n");
-}
-
-dodump(ap, c)
-char **ap;
-{
-       int i;
-       register struct nlist *np;
-
-       if (c > 0)
-               while (c--) {
-                       if ((np = lookup(*++ap))->name != NULL)
-                               fprintf(stderr, "`%s'   `%s'\n", np->name, np->def);
-               }
-       else
-               for (i=0; i<HSHSIZ; i++)
-                       for (np=hshtab[i]; np!=NULL; np=np->next)
-                               fprintf(stderr, "`%s'   `%s'\n", np->name, np->def);
-}
-
-doerrp(ap, c)
-char **ap;
-{
-       if (c > 0) {
-               fprintf(stderr, ap[1], ap[2], ap[3], ap[4], ap[5], ap[6]);
-               fprintf(stderr, "\n");
-       }
-}
-
-
-long   evalval;        /* return value from yacc stuff */
-char   *pe;    /* used by grammar */
-
-doeval(ap, c)
-char **ap;
-{
-
-       if (c > 0) {
-               pe = ap[1];
-               if (yyparse() == 0)
-                       putnum(evalval);
-               else
-                       fprintf(stderr, "m4: invalid expression in eval: %s\n", ap[1]);
-       }
-}
-
-doincl(ap, c, noisy)
-char **ap;
-{
-       if (c > 0 && strlen(ap[1]) > 0) {
-               infptr++;
-               ip_stk[infptr] = cur_ip = ip;
-               if ((infile[infptr] = fopen(ap[1], READ))==ERROR) {
-                       if (noisy) {
-                               fprintf(stderr, "m4: file not found: %s\n", ap[1]);
-                               delexit();
-                       }
-                       else
-                               infptr--;
-               }
-       }
-}
-
-dosyscmd(ap, c)
-char **ap;
-{
-       if (c > 0)
-               system(ap[1]);
-}
-
-domake(ap, c)
-char **ap;
-{
-       if (c > 0)
-               pbstr(mktemp(ap[1]));
-}
-
-doincr(ap, c)
-char **ap;
-{
-       if (c >= 1)
-               putnum(ctol(ap[1])+1);
-}
-
-putnum(num)
-long num;
-{
-       register sign;
-
-       sign = (num < 0) ? '-' : '\0';
-       if (num < 0)
-               num = -num;
-       do {
-               putbak(num%10+'0');
-               num = num/10;
-       } while (num!=0);
-       if (sign == '-')
-               putbak('-');
-}
-
-dosubstr(ap, c)
-char **ap;
-{
-       int nc;
-       register char *sp, *fc;
-
-       if (c<2)
-               return;
-       if (c<3)
-               nc = TOKS;
-       else
-               nc = ctoi(ap[3]);
-       fc = ap[1] + max(0, min(ctoi(ap[2]), strlen(ap[1])));
-       sp = fc + min(nc, strlen(fc));
-       while (sp > fc)
-               putbak(*--sp);
-}
-
-doindex(ap, c)
-char **ap;
-{
-       if (c >= 2)
-               putnum((long) strindex(ap[1], ap[2]));
-}
-
-strindex(p1, p2)
-char *p1, *p2;
-{
-       register m;
-       register char *s, *t, *p;
-
-       for (p=p1; *p; p++) {
-               s = p;
-               m = 1;
-               for (t=p2; *t; )
-                       if (*t++ != *s++)
-                               m = 0;
-               if (m == 1)
-                       return(p-p1);
-       }
-       return(-1);
-}
-
-dotransl(ap, c)
-char **ap;
-{
-       register char *s, *fr, *to;
-
-       if (c <= 1) return;
-
-       if (c == 2) {
-               register int i;
-               to = ap[1];
-               for (s = ap[1]; *s; s++) {
-                       i = 0;
-                       for (fr = ap[2]; *fr; fr++)
-                               if (*s == *fr) {
-                                       i++;
-                                       break;
-                               }
-                       if (i == 0)
-                               *to++ = *s;
-               }
-               *to = '\0';
-       }
-
-       if (c >= 3) {
-               for (s = ap[1]; *s; s++)
-                       for (fr = ap[2], to = ap[3]; *fr && *to; fr++, to++)
-                               if (*s == *fr)
-                                       *s = *to;
-       }
-
-       pbstr(ap[1]);
-}
-
-doif(ap, c)
-register char **ap;
-{
-       if (c < 3)
-               return;
-       while (c >= 3) {
-               if (strcmp(ap[1], ap[2]) == 0) {
-                       pbstr(ap[3]);
-                       return;
-               }
-               c -= 3;
-               ap += 3;
-       }
-       if (c > 0)
-               pbstr(ap[1]);
-}
-
-dodiv(ap, c)
-register char **ap;
-{
-       register int f;
-
-       if (c<1)
-               f = 0;
-       else
-               f = ctoi(ap[1]);
-       if (f>=10 || f<0) {
-               curfile = NULL;
-               return;
-       }
-       tempname[7] = 'a' + f;
-       if (olist[f] || (olist[f]=fopen(tempname, WRITE))) {
-               curout = f;
-               curfile = olist[f];
-       }
-}
-
-doundiv(ap, c)
-char **ap;
-{
-       register FILE *fp;
-       register int i, ch;
-       int j;
-
-       if (c == 0) {
-               for (i=1; i<10; i++) {
-                       if (i==curout || olist[i]==NULL)
-                               continue;
-                       fclose(olist[i]);
-                       tempname[7] = 'a'+i;
-                       fp = fopen(tempname, READ);
-                       if (curfile != NULL)
-                               while ((ch = getc(fp)) > 0)
-                                       putc(ch, curfile);
-                       fclose(fp);
-                       unlink(tempname);
-                       olist[i] = NULL;
-               }
-
-       }
-       else {
-               for (j = 1; j <= c; j++) {
-                       i = ctoi(*++ap);
-                       if (i<1 || i>9 || i==curout || olist[i]==NULL)
-                               continue;
-                       fclose(olist[i]);
-                       tempname[7] = 'a'+i;
-                       fp = fopen(tempname, READ);
-                       if (curfile != NULL)
-                               while ((ch = getc(fp)) > 0)
-                                       putc(ch, curfile);
-                       fclose(fp);
-                       unlink(tempname);
-                       olist[i] = NULL;
-               }
-       }
-}
-
-dodivnum(ap, c)
-char **ap;
-{
-       putnum((long) curout);
-}
-
-dodnl(ap, c)
-char **ap;
-{
-       register t;
-
-       while ((t=getchr())!='\n' && t>=0)
-               ;
-}
-
-long ctol(str)
-register char *str;
-{
-       register sign;
-       long num;
-
-       while (*str==' ' || *str=='\t' || *str=='\n')
-               str++;
-       num = 0;
-       if (*str == '-') {
-               sign = -1;
-               str++;
-       }
-       else
-               sign = 1;
-       while (*str>='0' && *str<='9')
-               num = num*10 + *str++ - '0';
-       return(sign * num);
-}
-
-ctoi(s)
-char *s;
-{
-       return(ctol(s));
-}
-
-min(a, b)
-{
-       if (a>b)
-               return(b);
-       return(a);
-}
-
-max(a, b)
-{
-       if (a>b)
-               return(a);
-       return(b);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/m4/m4y.y b/.ref-Research-V7/usr/src/cmd/m4/m4y.y
deleted file mode 100644 (file)
index 40f5a3b..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-%{
-extern long    evalval;
-#define        YYSTYPE long
-%}
-
-%term DIGITS
-%left '|'
-%left '&'
-%right '!'
-%nonassoc GT GE LT LE NE EQ
-%left '+' '-'
-%left '*' '/' '%'
-%right POWER
-%right UMINUS
-%%
-
-s      : e     ={ evalval = $1; }
-       |       ={ evalval = 0; }
-       ;
-
-e      : e '|' e       ={ $$ = ($1!=0 || $3!=0) ? 1 : 0; }
-       | e '&' e       ={ $$ = ($1!=0 && $3!=0) ? 1 : 0; }
-       | '!' e         ={ $$ = $2 == 0; }
-       | e EQ e        ={ $$ = $1 == $3; }
-       | e NE e        ={ $$ = $1 != $3; }
-       | e GT e        ={ $$ = $1 > $3; }
-       | e GE e        ={ $$ = $1 >= $3; }
-       | e LT e        ={ $$ = $1 < $3; }
-       | e LE e        ={ $$ = $1 <= $3; }
-       | e '+' e       ={ $$ = ($1+$3); }
-       | e '-' e       ={ $$ = ($1-$3); }
-       | e '*' e       ={ $$ = ($1*$3); }
-       | e '/' e       ={ $$ = ($1/$3); }
-       | e '%' e       ={ $$ = ($1%$3); }
-       | '(' e ')'     ={ $$ = ($2); }
-       | e POWER e     ={ for ($$=1; $3-->0; $$ *= $1); }      
-       | '-' e %prec UMINUS    ={ $$ = $2-1; $$ = -$2; }
-       | '+' e %prec UMINUS    ={ $$ = $2-1; $$ = $2; }
-       | DIGITS        ={ $$ = evalval; }
-       ;
-
-%%
-
-yylex() {
-       extern char *pe;
-
-       while (*pe==' ' || *pe=='\t' || *pe=='\n')
-               pe++;
-       switch(*pe) {
-       case '\0':
-       case '+':
-       case '-':
-       case '/':
-       case '%':
-       case '(':
-       case ')':
-               return(*pe++);
-       case '^':
-               pe++;
-               return(POWER);
-       case '*':
-               return(peek('*', POWER, '*'));
-       case '>':
-               return(peek('=', GE, GT));
-       case '<':
-               return(peek('=', LE, LT));
-       case '=':
-               return(peek('=', EQ, EQ));
-       case '|':
-               return(peek('|', '|', '|'));
-       case '&':
-               return(peek('&', '&', '&'));
-       case '!':
-               return(peek('=', NE, '!'));
-       default:
-               evalval = 0;
-               while (*pe >= '0' && *pe <= '9')
-                       evalval = evalval*10 + *pe++ - '0';
-               return(DIGITS);
-       }
-}
-
-peek(c, r1, r2)
-{
-       if (*++pe != c)
-               return(r2);
-       ++pe;
-       return(r1);
-}
-
-yyerror(s)
-char *s;
-{
-}
diff --git a/.ref-Research-V7/usr/src/cmd/m4/makefile b/.ref-Research-V7/usr/src/cmd/m4/makefile
deleted file mode 100644 (file)
index e572734..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-CFLAGS = -n -O -s
-
-m4:    m4.o m4y.o
-       cc -n -s -o m4 m4.o m4y.o
-
-all:   m4
-
-cmp:   m4
-       cmp m4 /bin/m4
-       rm m4 *.o
-
-cp:    m4
-       cp m4 /bin/m4
-       rm m4 *.o
diff --git a/.ref-Research-V7/usr/src/cmd/mail.c b/.ref-Research-V7/usr/src/cmd/mail.c
deleted file mode 100644 (file)
index b43f498..0000000
+++ /dev/null
@@ -1,554 +0,0 @@
-#include <stdio.h>
-#include <pwd.h>
-#include <utmp.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <setjmp.h>
-#include <whoami.h>
-
-/*copylet flags */
-       /*remote mail, add rmtmsg */
-#define REMOTE 1
-       /* zap header and trailing empty line */
-#define ZAP    3
-#define ORDINARY 2
-#define        FORWARD 4
-#define        LSIZE   256
-#define        MAXLET  300     /* maximum number of letters */
-#define        MAILMODE (~0644)                /* mode of created mail */
-
-char   line[LSIZE];
-char   resp[LSIZE];
-struct let {
-       long    adr;
-       char    change;
-} let[MAXLET];
-int    nlet    = 0;
-char   lfil[50];
-long   iop, time();
-char   lettmp[] = "/tmp/maXXXXX";
-char   maildir[] = "/usr/spool/mail/";
-char   mailfile[] = "/usr/spool/mail/xxxxxxxxxxxxxxxxxxxxxxx";
-char   dead[] = "dead.letter";
-char   *thissys = sysname;
-char   forwmsg[] = " forwarded\n";
-char   *curlock;
-int    lockerror;
-FILE   *tmpf;
-FILE   *malf;
-char   *my_name;
-char   *getlogin();
-struct passwd  *getpwuid();
-int    error;
-int    locked;
-int    changed;
-int    forward;
-char   from[] = "From ";
-long   ftell();
-int    delete();
-char   *ctime();
-int    flgf;
-int    flgp;
-int    delflg = 1;
-jmp_buf        sjbuf;
-
-main(argc, argv)
-char **argv;
-{
-       register i;
-       char sobuf[BUFSIZ];
-
-       setbuf(stdout, sobuf);
-       mktemp(lettmp);
-       unlink(lettmp);
-       my_name = getlogin();
-       if (my_name == NULL) {
-               struct passwd *pwent;
-               pwent = getpwuid(getuid());
-               if (pwent==NULL)
-                       my_name = "???";
-               else
-                       my_name = pwent->pw_name;
-       }
-       if(setjmp(sjbuf)) done();
-       for (i=0; i<20; i++)
-               setsig(i, delete);
-       tmpf = fopen(lettmp, "w");
-       if (tmpf == NULL) {
-               fprintf(stderr, "mail: cannot open %s for writing\n", lettmp);
-               done();
-       }
-       if (argv[0][0] != 'r' &&        /* no favors for rmail*/
-          (argc == 1 || argv[1][0] == '-'))
-               printmail(argc, argv);
-       else
-               sendmail(argc, argv);
-       done();
-}
-
-setsig(i, f)
-int i;
-int (*f)();
-{
-       if(signal(i, SIG_IGN)!=SIG_IGN)
-               signal(i, f);
-}
-
-printmail(argc, argv)
-char **argv;
-{
-       int flg, i, j, print;
-       char *p, *getarg();
-
-       setuid(getuid());
-       cat(mailfile, maildir, my_name);
-       for (; argc>1; argv++, argc--) {
-               if (argv[1][0]=='-') {
-                       if (argv[1][1]=='q')
-                               delflg = 0;
-                       else if (argv[1][1]=='p') {
-                               flgp++;
-                               delflg = 0;
-                       } else if (argv[1][1]=='f') {
-                               if (argc>=3) {
-                                       strcpy(mailfile, argv[2]);
-                                       argv++;
-                                       argc--;
-                               }
-                       } else if (argv[1][1]=='r') {
-                               forward = 1;
-                       } else {
-                               fprintf(stderr, "mail: unknown option %c\n", argv[1][1]);
-                               done();
-                       }
-               } else
-                       break;
-       }
-       malf = fopen(mailfile, "r");
-       if (malf == NULL) {
-               fprintf(stdout, "No mail.\n");
-               return;
-       }
-       lock(mailfile);
-       copymt(malf, tmpf);
-       fclose(malf);
-       fclose(tmpf);
-       unlock();
-       tmpf = fopen(lettmp, "r");
-
-       changed = 0;
-       print = 1;
-       for (i = 0; i < nlet; ) {
-               j = forward ? i : nlet - i - 1;
-               if(setjmp(sjbuf)) {
-                       print=0;
-               } else {
-                       if (print)
-                               copylet(j, stdout, ORDINARY);
-                       print = 1;
-               }
-               if (flgp) {
-                       i++;
-                       continue;
-               }
-               setjmp(sjbuf);
-               fprintf(stdout, "? ");
-               fflush(stdout);
-               if (fgets(resp, LSIZE, stdin) == NULL)
-                       break;
-               switch (resp[0]) {
-
-               default:
-                       fprintf(stderr, "usage\n");
-               case '?':
-                       print = 0;
-                       fprintf(stderr, "q\tquit\n");
-                       fprintf(stderr, "x\texit without changing mail\n");
-                       fprintf(stderr, "p\tprint\n");
-                       fprintf(stderr, "s[file]\tsave (default mbox)\n");
-                       fprintf(stderr, "w[file]\tsame without header\n");
-                       fprintf(stderr, "-\tprint previous\n");
-                       fprintf(stderr, "d\tdelete\n");
-                       fprintf(stderr, "+\tnext (no delete)\n");
-                       fprintf(stderr, "m user\tmail to user\n");
-                       fprintf(stderr, "! cmd\texecute cmd\n");
-                       break;
-
-               case '+':
-               case 'n':
-               case '\n':
-                       i++;
-                       break;
-               case 'x':
-                       changed = 0;
-               case 'q':
-                       goto donep;
-               case 'p':
-                       break;
-               case '^':
-               case '-':
-                       if (--i < 0)
-                               i = 0;
-                       break;
-               case 'y':
-               case 'w':
-               case 's':
-                       flg = 0;
-                       if (resp[1] != '\n' && resp[1] != ' ') {
-                               printf("illegal\n");
-                               flg++;
-                               print = 0;
-                               continue;
-                       }
-                       if (resp[1] == '\n' || resp[1] == '\0')
-                               cat(resp+1, "mbox", "");
-                       for (p = resp+1; (p = getarg(lfil, p)) != NULL; ) {
-                               malf = fopen(lfil, "a");
-                               if (malf == NULL) {
-                                       fprintf(stdout, "mail: cannot append to %s\n", lfil);
-                                       flg++;
-                                       continue;
-                               }
-                               copylet(j, malf, resp[0]=='w'? ZAP: ORDINARY);
-                               fclose(malf);
-                       }
-                       if (flg)
-                               print = 0;
-                       else {
-                               let[j].change = 'd';
-                               changed++;
-                               i++;
-                       }
-                       break;
-               case 'm':
-                       flg = 0;
-                       if (resp[1] == '\n' || resp[1] == '\0') {
-                               i++;
-                               continue;
-                       }
-                       if (resp[1] != ' ') {
-                               printf("invalid command\n");
-                               flg++;
-                               print = 0;
-                               continue;
-                       }
-                       for (p = resp+1; (p = getarg(lfil, p)) != NULL; )
-                               if (!sendrmt(j, lfil))  /* couldn't send it */
-                                       flg++;
-                       if (flg)
-                               print = 0;
-                       else {
-                               let[j].change = 'd';
-                               changed++;
-                               i++;
-                       }
-                       break;
-               case '!':
-                       system(resp+1);
-                       printf("!\n");
-                       print = 0;
-                       break;
-               case 'd':
-                       let[j].change = 'd';
-                       changed++;
-                       i++;
-                       if (resp[1] == 'q')
-                               goto donep;
-                       break;
-               }
-       }
-   donep:
-       if (changed)
-               copyback();
-}
-
-copyback()     /* copy temp or whatever back to /usr/spool/mail */
-{
-       register i, n, c;
-       int new = 0;
-       struct stat stbuf;
-
-       signal(SIGINT, SIG_IGN);
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       lock(mailfile);
-       stat(mailfile, &stbuf);
-       if (stbuf.st_size != let[nlet].adr) {   /* new mail has arrived */
-               malf = fopen(mailfile, "r");
-               if (malf == NULL) {
-                       fprintf(stdout, "mail: can't re-read %s\n", mailfile);
-                       done();
-               }
-               fseek(malf, let[nlet].adr, 0);
-               fclose(tmpf);
-               tmpf = fopen(lettmp, "a");
-               fseek(tmpf, let[nlet].adr, 0);
-               while ((c = fgetc(malf)) != EOF)
-                       fputc(c, tmpf);
-               fclose(malf);
-               fclose(tmpf);
-               tmpf = fopen(lettmp, "r");
-               let[++nlet].adr = stbuf.st_size;
-               new = 1;
-       }
-       malf = fopen(mailfile, "w");
-       if (malf == NULL) {
-               fprintf(stderr, "mail: can't rewrite %s\n", lfil);
-               done();
-       }
-       n = 0;
-       for (i = 0; i < nlet; i++)
-               if (let[i].change != 'd') {
-                       copylet(i, malf, ORDINARY);
-                       n++;
-               }
-       fclose(malf);
-       if (new)
-               fprintf(stdout, "new mail arrived\n");
-       unlock();
-}
-
-copymt(f1, f2) /* copy mail (f1) to temp (f2) */
-FILE *f1, *f2;
-{
-       long nextadr;
-
-       nlet = nextadr = 0;
-       let[0].adr = 0;
-       while (fgets(line, LSIZE, f1) != NULL) {
-               if (isfrom(line))
-                       let[nlet++].adr = nextadr;
-               nextadr += strlen(line);
-               fputs(line, f2);
-       }
-       let[nlet].adr = nextadr;        /* last plus 1 */
-}
-
-copylet(n, f, type) FILE *f;
-{      int ch, k;
-       fseek(tmpf, let[n].adr, 0);
-       k = let[n+1].adr - let[n].adr;
-       while(k-- > 1 && (ch=fgetc(tmpf))!='\n')
-               if(type!=ZAP) fputc(ch,f);
-       if(type==REMOTE)
-               fprintf(f, " remote from %s\n", thissys);
-       else if (type==FORWARD)
-               fprintf(f, forwmsg);
-       else if(type==ORDINARY)
-               fputc(ch,f);
-       while(k-->1)
-               fputc(ch=fgetc(tmpf), f);
-       if(type!=ZAP || ch!= '\n')
-               fputc(fgetc(tmpf), f);
-}
-
-isfrom(lp)
-register char *lp;
-{
-       register char *p;
-
-       for (p = from; *p; )
-               if (*lp++ != *p++)
-                       return(0);
-       return(1);
-}
-
-sendmail(argc, argv)
-char **argv;
-{
-
-       time(&iop);
-       fprintf(tmpf, "%s%s %s", from, my_name, ctime(&iop));
-       iop = ftell(tmpf);
-       flgf = 1;
-       while (fgets(line, LSIZE, stdin) != NULL) {
-               if (line[0] == '.' && line[1] == '\n')
-                       break;
-               if (isfrom(line))
-                       fputs(">", tmpf);
-               fputs(line, tmpf);
-               flgf = 0;
-       }
-       fputs("\n", tmpf);
-       nlet = 1;
-       let[0].adr = 0;
-       let[1].adr = ftell(tmpf);
-       fclose(tmpf);
-       if (flgf)
-               return;
-       tmpf = fopen(lettmp, "r");
-       if (tmpf == NULL) {
-               fprintf(stderr, "mail: cannot reopen %s for reading\n", lettmp);
-               return;
-       }
-       while (--argc > 0)
-               if (!send(0, *++argv))  /* couldn't send to him */
-                       error++;
-       if (error) {
-               setuid(getuid());
-               malf = fopen(dead, "w");
-               if (malf == NULL) {
-                       fprintf(stdout, "mail: cannot open %s\n", dead);
-                       fclose(tmpf);
-                       return;
-               }
-               copylet(0, malf, ZAP);
-               fclose(malf);
-               fprintf(stdout, "Mail saved in %s\n", dead);
-       }
-       fclose(tmpf);
-}
-
-sendrmt(n, name)
-char *name;
-{
-       FILE *rmf, *popen();
-       register char *p;
-       char rsys[64], cmd[64];
-       register local, pid;
-       int sts;
-
-       local = 0;
-       if (*name=='!')
-               name++;
-       for(p=rsys; *name!='!'; *p++ = *name++)
-               if (*name=='\0') {
-                       local++;
-                       break;
-               }
-       *p = '\0';
-       if ((!local && *name=='\0') || (local && *rsys=='\0')) {
-               fprintf(stdout, "null name\n");
-               return(0);
-       }
-       if ((pid = fork()) == -1) {
-               fprintf(stderr, "mail: can't create proc for remote\n");
-               return(0);
-       }
-       if (pid) {
-               while (wait(&sts) != pid) {
-                       if (wait(&sts)==-1)
-                               return(0);
-               }
-               return(!sts);
-       }
-       setuid(getuid());
-       if (local)
-               sprintf(cmd, "mail %s", rsys);
-       else {
-               if (index(name+1, '!'))
-                       sprintf(cmd, "uux - %s!rmail \\(%s\\)", rsys, name+1);
-               else
-                       sprintf(cmd, "uux - %s!rmail %s", rsys, name+1);
-       }
-       if ((rmf=popen(cmd, "w")) == NULL)
-               exit(1);
-       copylet(n, rmf, local? FORWARD: REMOTE);
-       pclose(rmf);
-       exit(0);
-}
-
-send(n, name)  /* send letter n to name */
-int n;
-char *name;
-{
-       char file[50];
-       register char *p;
-       register mask;
-       struct passwd *pw, *getpwnam();
-
-       for(p=name; *p!='!' &&*p!='\0'; p++)
-               ;
-       if (*p == '!')
-               return(sendrmt(n, name));
-       if ((pw = getpwnam(name)) == NULL) {
-               fprintf(stdout, "mail: can't send to %s\n", name);
-               return(0);
-       }
-       cat(file, maildir, name);
-       mask = umask(MAILMODE);
-       malf = fopen(file, "a");
-       umask(mask);
-       if (malf == NULL) {
-               fprintf(stdout, "mail: cannot append to %s\n", file);
-               return(0);
-       }
-       lock(file);
-       chown(file, pw->pw_uid, pw->pw_gid);
-       copylet(n, malf, ORDINARY);
-       fclose(malf);
-       unlock();
-       return(1);
-}
-
-delete(i)
-{
-       setsig(i, delete);
-       fprintf(stderr, "\n");
-       if(delflg)
-               longjmp(sjbuf, 1);
-       done();
-}
-
-done()
-{
-       if(!lockerror)
-               unlock();
-       unlink(lettmp);
-       exit(error+lockerror);
-}
-
-lock(file)
-char *file;
-{
-       struct stat stbuf;
-
-       if (locked || flgf)
-               return;
-       if (stat(file, &stbuf)<0)
-               return;
-       if (stbuf.st_mode&01) {         /* user x bit is the lock */
-               if (stbuf.st_ctime+60 >= time((long *)0)) {
-                       fprintf(stderr, "%s busy; try again in a minute\n", file);
-                       lockerror++;
-                       done();
-               }
-       }
-       locked = stbuf.st_mode & ~01;
-       curlock = file;
-       chmod(file, stbuf.st_mode|01);
-}
-
-unlock()
-{
-       if (locked)
-               chmod(curlock, locked);
-       locked = 0;
-}
-
-cat(to, from1, from2)
-char *to, *from1, *from2;
-{
-       int i, j;
-
-       j = 0;
-       for (i=0; from1[i]; i++)
-               to[j++] = from1[i];
-       for (i=0; from2[i]; i++)
-               to[j++] = from2[i];
-       to[j] = 0;
-}
-
-char *getarg(s, p)     /* copy p... into s, update p */
-register char *s, *p;
-{
-       while (*p == ' ' || *p == '\t')
-               p++;
-       if (*p == '\n' || *p == '\0')
-               return(NULL);
-       while (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\0')
-               *s++ = *p++;
-       *s = '\0';
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/make/defs b/.ref-Research-V7/usr/src/cmd/make/defs
deleted file mode 100644 (file)
index 37db43a..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-
-#define SHELLCOM "/bin/sh"
-typedef long int TIMETYPE;
-
-#ifdef unix
-/*  to install metering, add a statement like */
-#define METERFILE "/usr/sif/make/Meter"
-/* to turn metering on, set external variable meteron to 1 */
-#endif
-
-/* define FSTATIC to be static on systems with C compilers
-   supporting file-static; otherwise define it to be null
-*/
-#define FSTATIC static
-
-#define NO 0
-#define YES 1
-
-#define unequal strcmp
-#define HASHSIZE 509
-#define NLEFTS 40
-#define NCHARS 500
-#define NINTS  250
-#define INMAX 1500
-#define OUTMAX 2500
-#define QBUFMAX 1500
-
-#define ALLDEPS  1
-#define SOMEDEPS 2
-
-#define META 01
-#define TERMINAL 02
-extern char funny[128];
-
-
-#define ALLOC(x) (struct x *) ckalloc(sizeof(struct x))
-
-extern int sigivalue;
-extern int sigqvalue;
-extern int waitpid;
-extern int dbgflag;
-extern int prtrflag;
-extern int silflag;
-extern int noexflag;
-extern int keepgoing;
-extern int noruleflag;
-extern int touchflag;
-extern int questflag;
-extern int ndocoms;
-extern int ignerr;
-extern int okdel;
-extern int inarglist;
-extern char *prompt;
-extern char junkname[ ];
-
-
-
-struct nameblock
-       {
-       struct nameblock *nxtnameblock;
-       char *namep;
-       struct lineblock *linep;
-       int done:3;
-       int septype:3;
-       TIMETYPE modtime;
-       };
-
-extern struct nameblock *mainname ;
-extern struct nameblock *firstname;
-
-struct lineblock
-       {
-       struct lineblock *nxtlineblock;
-       struct depblock *depp;
-       struct shblock *shp;
-       };
-extern struct lineblock *sufflist;
-
-struct depblock
-       {
-       struct depblock *nxtdepblock;
-       struct nameblock *depname;
-       };
-
-struct shblock
-       {
-       struct shblock *nxtshblock;
-       char *shbp;
-       };
-
-struct varblock
-       {
-       struct varblock *nxtvarblock;
-       char *varname;
-       char *varval;
-       int noreset:1;
-       int used:1;
-       };
-extern struct varblock *firstvar;
-
-struct pattern
-       {
-       struct pattern *nxtpattern;
-       char *patval;
-       };
-extern struct pattern *firstpat;
-
-struct opendir
-       {
-       struct opendir *nxtopendir;
-       FILE * dirfc;
-       char *dirn;
-       };
-extern struct opendir *firstod;
-
-
-struct chain
-       {
-       struct chain *nextp;
-       char *datap;
-       };
-
-char *copys(), *concat(), *subst(), *sprintf();
-int *ckalloc();
-struct nameblock *srchname(), *makename();
-TIMETYPE exists();
diff --git a/.ref-Research-V7/usr/src/cmd/make/doname.c b/.ref-Research-V7/usr/src/cmd/make/doname.c
deleted file mode 100644 (file)
index 407b57a..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-#include "defs"
-
-/*  BASIC PROCEDURE.  RECURSIVE.  */
-
-/*
-p->done = 0   don't know what to do yet
-p->done = 1   file in process of being updated
-p->done = 2   file already exists in current state
-p->done = 3   file make failed
-*/
-
-doname(p, reclevel, tval)
-register struct nameblock *p;
-int reclevel;
-TIMETYPE *tval;
-{
-int errstat;
-int okdel1;
-int didwork;
-TIMETYPE td, td1, tdep, ptime, ptime1, prestime();
-register struct depblock *q;
-struct depblock *qtemp, *srchdir(), *suffp, *suffp1;
-struct nameblock *p1, *p2;
-struct shblock *implcom, *explcom;
-register struct lineblock *lp;
-struct lineblock *lp1, *lp2;
-char sourcename[100], prefix[100], temp[100], concsuff[20];
-char *pnamep, *p1namep;
-char *mkqlist();
-struct chain *qchain, *appendq();
-
-if(p == 0)
-       {
-       *tval = 0;
-       return(0);
-       }
-
-if(dbgflag)
-       {
-       printf("doname(%s,%d)\n",p->namep,reclevel);
-       fflush(stdout);
-       }
-
-if(p->done > 0)
-       {
-       *tval = p->modtime;
-       return(p->done == 3);
-       }
-
-errstat = 0;
-tdep = 0;
-implcom = 0;
-explcom = 0;
-ptime = exists(p->namep);
-ptime1 = 0;
-didwork = NO;
-p->done = 1;   /* avoid infinite loops */
-
-qchain = NULL;
-
-/* Expand any names that have embedded metacharaters */
-
-for(lp = p->linep ; lp ; lp = lp->nxtlineblock)
-       for(q = lp->depp ; q ; q=qtemp )
-               {
-               qtemp = q->nxtdepblock;
-               expand(q);
-               }
-
-/* make sure all dependents are up to date */
-
-for(lp = p->linep ; lp ; lp = lp->nxtlineblock)
-       {
-       td = 0;
-       for(q = lp->depp ; q ; q = q->nxtdepblock)
-               {
-               errstat += doname(q->depname, reclevel+1, &td1);
-               if(dbgflag)
-                   printf("TIME(%s)=%ld\n", q->depname->namep, td1);
-               if(td1 > td) td = td1;
-               if(ptime < td1)
-                       qchain = appendq(qchain, q->depname->namep);
-               }
-       if(p->septype == SOMEDEPS)
-               {
-               if(lp->shp!=0)
-                    if( ptime<td || (ptime==0 && td==0) || lp->depp==0)
-                       {
-                       okdel1 = okdel;
-                       okdel = NO;
-                       setvar("@", p->namep);
-                       setvar("?", mkqlist(qchain) );
-                       qchain = NULL;
-                       if( !questflag )
-                               errstat += docom(lp->shp);
-                       setvar("@", (char *) NULL);
-                       okdel = okdel1;
-                       ptime1 = prestime();
-                       didwork = YES;
-                       }
-               }
-
-       else    {
-               if(lp->shp != 0)
-                       {
-                       if(explcom)
-                               fprintf(stderr, "Too many command lines for `%s'\n",
-                                       p->namep);
-                       else    explcom = lp->shp;
-                       }
-
-               if(td > tdep) tdep = td;
-               }
-       }
-
-/* Look for implicit dependents, using suffix rules */
-
-for(lp = sufflist ; lp ; lp = lp->nxtlineblock)
-    for(suffp = lp->depp ; suffp ; suffp = suffp->nxtdepblock)
-       {
-       pnamep = suffp->depname->namep;
-       if(suffix(p->namep , pnamep , prefix))
-               {
-               srchdir( concat(prefix,"*",temp) , NO, (struct depblock *) NULL);
-               for(lp1 = sufflist ; lp1 ; lp1 = lp1->nxtlineblock)
-                   for(suffp1=lp1->depp ; suffp1 ; suffp1 = suffp1->nxtdepblock)
-                       {
-                       p1namep = suffp1->depname->namep;
-                       if( (p1=srchname(concat(p1namep, pnamep ,concsuff))) &&
-                           (p2=srchname(concat(prefix, p1namep ,sourcename))) )
-                               {
-                               errstat += doname(p2, reclevel+1, &td);
-                               if(ptime < td)
-                                       qchain = appendq(qchain, p2->namep);
-if(dbgflag) printf("TIME(%s)=%ld\n", p2->namep, td);
-                               if(td > tdep) tdep = td;
-                               setvar("*", prefix);
-                               setvar("<", copys(sourcename));
-                               for(lp2=p1->linep ; lp2 ; lp2 = lp2->nxtlineblock)
-                                       if(implcom = lp2->shp) break;
-                               goto endloop;
-                               }
-                       }
-               }
-       }
-
-endloop:
-
-
-if(errstat==0 && (ptime<tdep || (ptime==0 && tdep==0) ) )
-       {
-       ptime = (tdep>0 ? tdep : prestime() );
-       setvar("@", p->namep);
-       setvar("?", mkqlist(qchain) );
-       if(explcom)
-               errstat += docom(explcom);
-       else if(implcom)
-               errstat += docom(implcom);
-       else if(p->septype == 0)
-               if(p1=srchname(".DEFAULT"))
-                       {
-                       setvar("<", p->namep);
-                       for(lp2 = p1->linep ; lp2 ; lp2 = lp2->nxtlineblock)
-                               if(implcom = lp2->shp)
-                                       {
-                                       errstat += docom(implcom);
-                                       break;
-                                       }
-                       }
-               else if(keepgoing)
-                       {
-                       printf("Don't know how to make %s\n", p->namep);
-                       ++errstat;
-                       }
-               else
-                       fatal1(" Don't know how to make %s", p->namep);
-
-       setvar("@", (char *) NULL);
-       if(noexflag || (ptime = exists(p->namep)) == 0)
-               ptime = prestime();
-       }
-
-else if(errstat!=0 && reclevel==0)
-       printf("`%s' not remade because of errors\n", p->namep);
-
-else if(!questflag && reclevel==0  &&  didwork==NO)
-       printf("`%s' is up to date.\n", p->namep);
-
-if(questflag && reclevel==0)
-       exit(ndocoms>0 ? -1 : 0);
-
-p->done = (errstat ? 3 : 2);
-if(ptime1 > ptime) ptime = ptime1;
-p->modtime = ptime;
-*tval = ptime;
-return(errstat);
-}
-\f
-docom(q)
-struct shblock *q;
-{
-char *s;
-struct varblock *varptr();
-int ign, nopr;
-char string[OUTMAX];
-
-++ndocoms;
-if(questflag)
-       return(NO);
-
-if(touchflag)
-       {
-       s = varptr("@")->varval;
-       if(!silflag)
-               printf("touch(%s)\n", s);
-       if(!noexflag)
-               touch(YES, s);
-       }
-
-else for( ; q ; q = q->nxtshblock )
-       {
-       subst(q->shbp,string);
-
-       ign = ignerr;
-       nopr = NO;
-       for(s = string ; *s=='-' || *s=='@' ; ++s)
-               if(*s == '-')  ign = YES;
-               else nopr = YES;
-
-       if( docom1(s, ign, nopr) && !ign)
-               if(keepgoing)
-                       return(YES);
-               else    fatal( (char *) NULL);
-       }
-return(NO);
-}
-
-
-
-docom1(comstring, nohalt, noprint)
-register char *comstring;
-int nohalt, noprint;
-{
-register int status;
-
-if(comstring[0] == '\0') return(0);
-
-if(!silflag && (!noprint || noexflag) )
-       {
-       printf("%s%s\n", (noexflag ? "" : prompt), comstring);
-       fflush(stdout);
-       }
-
-if(noexflag) return(0);
-
-if( status = dosys(comstring, nohalt) )
-       {
-       if( status>>8 )
-               printf("*** Error code %d", status>>8 );
-       else    printf("*** Termination code %d", status );
-
-       if(nohalt) printf(" (ignored)\n");
-       else    printf("\n");
-       fflush(stdout);
-       }
-
-return(status);
-}
-\f
-
-/*
-   If there are any Shell meta characters in the name,
-   expand into a list, after searching directory
-*/
-
-expand(q)
-register struct depblock *q;
-{
-register char *s;
-char *s1;
-struct depblock *p, *srchdir();
-
-s1 = q->depname->namep;
-for(s=s1 ; ;) switch(*s++)
-       {
-       case '\0':
-               return;
-
-       case '*':
-       case '?':
-       case '[':
-               if( p = srchdir(s1 , YES, q->nxtdepblock) )
-                       {
-                       q->nxtdepblock = p;
-                       q->depname = 0;
-                       }
-               return;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/make/dosys.c b/.ref-Research-V7/usr/src/cmd/make/dosys.c
deleted file mode 100644 (file)
index f0ef709..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-#include "defs"
-#include <signal.h>
-
-dosys(comstring,nohalt)
-register char *comstring;
-int nohalt;
-{
-register int status;
-
-if(metas(comstring))
-       status = doshell(comstring,nohalt);
-else   status = doexec(comstring);
-
-return(status);
-}
-
-
-
-metas(s)   /* Are there are any  Shell meta-characters? */
-register char *s;
-{
-register char c;
-
-while( (funny[c = *s++] & META) == 0 )
-       ;
-return( c );
-}
-\f
-doshell(comstring,nohalt)
-char *comstring;
-int nohalt;
-{
-if((waitpid = fork()) == 0)
-       {
-       enbint(SIG_DFL);
-       doclose();
-
-       execl(SHELLCOM, "sh", (nohalt ? "-c" : "-ce"), comstring, 0);
-       fatal("Couldn't load Shell");
-       }
-
-return( await() );
-}
-
-
-
-
-await()
-{
-int intrupt();
-int status;
-register int pid;
-
-enbint(SIG_IGN);
-while( (pid = wait(&status)) != waitpid)
-       if(pid == -1)
-               fatal("bad wait code");
-waitpid = 0;
-enbint(intrupt);
-return(status);
-}
-
-
-
-
-
-
-doclose()      /* Close open directory files before exec'ing */
-{
-register struct opendir *od;
-for (od = firstod; od; od = od->nxtopendir)
-       if (od->dirfc != NULL)
-               fclose(od->dirfc);
-}
-\f
-
-
-
-
-doexec(str)
-register char *str;
-{
-register char *t;
-char *argv[200];
-register char **p;
-
-while( *str==' ' || *str=='\t' )
-       ++str;
-if( *str == '\0' )
-       return(-1);     /* no command */
-
-p = argv;
-for(t = str ; *t ; )
-       {
-       *p++ = t;
-       while(*t!=' ' && *t!='\t' && *t!='\0')
-               ++t;
-       if(*t)
-               for( *t++ = '\0' ; *t==' ' || *t=='\t'  ; ++t)
-                       ;
-       }
-
-*p = NULL;
-
-if((waitpid = fork()) == 0)
-       {
-       enbint(SIG_DFL);
-       doclose();
-       enbint(intrupt);
-       execvp(str, argv);
-       fatal1("Cannot load %s",str);
-       }
-
-return( await() );
-}
-\f
-#include <errno.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-
-
-touch(force, name)
-int force;
-char *name;
-{
-struct stat stbuff;
-char junk[1];
-int fd;
-
-if( stat(name,&stbuff) < 0)
-       if(force)
-               goto create;
-       else
-               {
-               fprintf(stderr, "touch: file %s does not exist.\n", name);
-               return;
-               }
-
-if(stbuff.st_size == 0)
-       goto create;
-
-if( (fd = open(name, 2)) < 0)
-       goto bad;
-
-if( read(fd, junk, 1) < 1)
-       {
-       close(fd);
-       goto bad;
-       }
-lseek(fd, 0L, 0);
-if( write(fd, junk, 1) < 1 )
-       {
-       close(fd);
-       goto bad;
-       }
-close(fd);
-return;
-
-bad:
-       fprintf(stderr, "Cannot touch %s\n", name);
-       return;
-
-create:
-       if( (fd = creat(name, 0666)) < 0)
-               goto bad;
-       close(fd);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/make/files.c b/.ref-Research-V7/usr/src/cmd/make/files.c
deleted file mode 100644 (file)
index 97db54a..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-/* UNIX DEPENDENT PROCEDURES */
-
-
-/* DEFAULT RULES FOR UNIX */
-
-char *builtin[] =
-       {
-       ".SUFFIXES : .out .o .c .f .e .r .y .yr .ye .l .s",
-       "YACC=yacc",
-       "YACCR=yacc -r",
-       "YACCE=yacc -e",
-       "YFLAGS=",
-       "LEX=lex",
-       "LFLAGS=",
-       "CC=cc",
-#ifdef vax
-       "AS=as".
-#else
-       "AS=as -",
-#endif
-       "CFLAGS=",
-       "RC=f77",
-       "RFLAGS=",
-       "EC=f77",
-       "EFLAGS=",
-       "FFLAGS=",
-       "LOADLIBES=",
-
-       ".c.o :",
-       "\t$(CC) $(CFLAGS) -c $<",
-
-       ".e.o .r.o .f.o :",
-       "\t$(EC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<",
-
-       ".s.o :",
-       "\t$(AS) -o $@ $<",
-
-       ".y.o :",
-       "\t$(YACC) $(YFLAGS) $<",
-       "\t$(CC) $(CFLAGS) -c y.tab.c",
-       "\trm y.tab.c",
-       "\tmv y.tab.o $@",
-
-       ".yr.o:",
-       "\t$(YACCR) $(YFLAGS) $<",
-       "\t$(RC) $(RFLAGS) -c y.tab.r",
-       "\trm y.tab.r",
-       "\tmv y.tab.o $@",
-
-       ".ye.o :",
-       "\t$(YACCE) $(YFLAGS) $<",
-       "\t$(EC) $(RFLAGS) -c y.tab.e",
-       "\trm y.tab.e",
-       "\tmv y.tab.o $@",
-
-       ".l.o :",
-       "\t$(LEX) $(LFLAGS) $<",
-       "\t$(CC) $(CFLAGS) -c lex.yy.c",
-       "\trm lex.yy.c",
-       "\tmv lex.yy.o $@",
-
-       ".y.c :",
-       "\t$(YACC) $(YFLAGS) $<",
-       "\tmv y.tab.c $@",
-
-       ".l.c :",
-       "\t$(LEX) $<",
-       "\tmv lex.yy.c $@",
-
-       ".yr.r:",
-       "\t$(YACCR) $(YFLAGS) $<",
-       "\tmv y.tab.r $@",
-
-       ".ye.e :",
-       "\t$(YACCE) $(YFLAGS) $<",
-       "\tmv y.tab.e $@",
-
-       ".s.out .c.out .o.out :",
-       "\t$(CC) $(CFLAGS) $< $(LOADLIBES) -o $@",
-
-       ".f.out .r.out .e.out :",
-       "\t$(EC) $(EFLAGS) $(RFLAGS) $(FFLAGS) $< $(LOADLIBES) -o $@",
-       "\t-rm $*.o",
-
-       ".y.out :",
-       "\t$(YACC) $(YFLAGS) $<",
-       "\t$(CC) $(CFLAGS) y.tab.c $(LOADLIBES) -ly -o $@",
-       "\trm y.tab.c",
-
-       ".l.out :",
-       "\t$(LEX) $<",
-       "\t$(CC) $(CFLAGS) lex.yy.c $(LOADLIBES) -ll -o $@",
-       "\trm lex.yy.c",
-
-       0 };
-\f
-#include "defs"
-#include <sys/types.h>
-
-
-TIMETYPE exists(filename)
-char *filename;
-{
-#include <sys/stat.h>
-struct stat buf;
-register char *s;
-TIMETYPE lookarch();
-
-for(s = filename ; *s!='\0' && *s!='(' ; ++s)
-       ;
-
-if(*s == '(')
-       return(lookarch(filename));
-
-if(stat(filename,&buf) < 0) 
-       return(0);
-else   return(buf.st_mtime);
-}
-
-
-TIMETYPE prestime()
-{
-TIMETYPE t;
-time(&t);
-return(t);
-}
-
-\f
-
-#include <sys/dir.h>
-FSTATIC char n15[15];
-FSTATIC char *n15end   = &n15[14];
-
-
-
-struct depblock *srchdir(pat, mkchain, nextdbl)
-register char *pat; /* pattern to be matched in directory */
-int mkchain;  /* nonzero if results to be remembered */
-struct depblock *nextdbl;  /* final value for chain */
-{
-FILE * dirf;
-int i, nread;
-char *dirname, *dirpref, *endir, *filepat, *p, temp[100];
-char fullname[100], *p1, *p2;
-struct nameblock *q;
-struct depblock *thisdbl;
-struct opendir *od;
-struct pattern *patp;
-
-struct direct entry[32];
-
-
-thisdbl = 0;
-
-if(mkchain == NO)
-       for(patp=firstpat ; patp ; patp = patp->nxtpattern)
-               if(! unequal(pat, patp->patval)) return(0);
-
-patp = ALLOC(pattern);
-patp->nxtpattern = firstpat;
-firstpat = patp;
-patp->patval = copys(pat);
-
-endir = 0;
-
-for(p=pat; *p!='\0'; ++p)
-       if(*p=='/') endir = p;
-
-if(endir==0)
-       {
-       dirname = ".";
-       dirpref = "";
-       filepat = pat;
-       }
-else   {
-       dirname = pat;
-       *endir = '\0';
-       dirpref = concat(dirname, "/", temp);
-       filepat = endir+1;
-       }
-
-dirf = NULL;
-
-for(od = firstod ; od; od = od->nxtopendir)
-       if(! unequal(dirname, od->dirn) )
-               {
-               dirf = od->dirfc;
-               fseek(dirf,0L,0); /* start over at the beginning  */
-               break;
-               }
-
-if(dirf == NULL)
-       {
-       dirf = fopen(dirname, "r");
-       od = ALLOC(opendir);
-       od->nxtopendir = firstod;
-       firstod = od;
-       od->dirfc = dirf;
-       od->dirn = copys(dirname);
-       }
-
-if(dirf == NULL)
-       {
-       fprintf(stderr, "Directory %s: ", dirname);
-       fatal("Cannot open");
-       }
-
-else do
-       {
-       nread = fread( (char *) &entry[0], sizeof(struct direct), 32, dirf) ;
-       for(i=0; i<nread; ++i)
-               if(entry[i].d_ino!= 0)
-                       {
-                       p1 = entry[i].d_name;
-                       p2 = n15;
-                       while( (p2<n15end) &&
-                         (*p2++ = *p1++)!='\0' );
-                       if( amatch(n15,filepat) )
-                               {
-                               concat(dirpref,n15,fullname);
-                               if( (q=srchname(fullname)) ==0)
-                                       q = makename(copys(fullname));
-                               if(mkchain)
-                                       {
-                                       thisdbl = ALLOC(depblock);
-                                       thisdbl->nxtdepblock = nextdbl;
-                                       thisdbl->depname = q;
-                                       nextdbl = thisdbl;
-                                       }
-                               }
-                       }
-
-       } while(nread==32);
-
-if(endir != 0)  *endir = '/';
-
-return(thisdbl);
-}
-\f
-/* stolen from glob through find */
-
-static amatch(s, p)
-char *s, *p;
-{
-       register int cc, scc, k;
-       int c, lc;
-
-       scc = *s;
-       lc = 077777;
-       switch (c = *p) {
-
-       case '[':
-               k = 0;
-               while (cc = *++p) {
-                       switch (cc) {
-
-                       case ']':
-                               if (k)
-                                       return(amatch(++s, ++p));
-                               else
-                                       return(0);
-
-                       case '-':
-                               k |= (lc <= scc)  & (scc <= (cc=p[1]) ) ;
-                       }
-                       if (scc==(lc=cc)) k++;
-               }
-               return(0);
-
-       case '?':
-       caseq:
-               if(scc) return(amatch(++s, ++p));
-               return(0);
-       case '*':
-               return(umatch(s, ++p));
-       case 0:
-               return(!scc);
-       }
-       if (c==scc) goto caseq;
-       return(0);
-}
-
-static umatch(s, p)
-char *s, *p;
-{
-       if(*p==0) return(1);
-       while(*s)
-               if (amatch(s++,p)) return(1);
-       return(0);
-}
-\f
-#ifdef METERFILE
-#include <pwd.h>
-int meteron    = 0;    /* default: metering off */
-
-meter(file)
-char *file;
-{
-TIMETYPE tvec;
-char *p, *ctime();
-FILE * mout;
-struct passwd *pwd, *getpwuid();
-
-if(file==0 || meteron==0) return;
-
-pwd = getpwuid(getuid());
-
-time(&tvec);
-
-if( (mout=fopen(file,"a")) != NULL )
-       {
-       p = ctime(&tvec);
-       p[16] = '\0';
-       fprintf(mout,"User %s, %s\n",pwd->pw_name,p+4);
-       fclose(mout);
-       }
-}
-#endif
-\f
-
-/* look inside archives for notations a(b) and a((b))
-       a(b)    is file member   b   in archive a
-       a((b))  is entry point  _b  in object archive a
-*/
-#include <ar.h>
-#include <a.out.h>
-
-static struct ar_hdr arhead;
-FILE *arfd;
-long int arpos, arlen;
-
-static struct exec objhead;
-
-static struct nlist objentry;
-
-
-TIMETYPE lookarch(filename)
-char *filename;
-{
-char *p, *q, *send, s[15];
-int i, nc, nsym, objarch;
-
-for(p = filename; *p!= '(' ; ++p)
-       ;
-*p = '\0';
-openarch(filename);
-*p++ = '(';
-
-if(*p == '(')
-       {
-       objarch = YES;
-       nc = 8;
-       ++p;
-       }
-else
-       {
-       objarch = NO;
-       nc = 14;
-       }
-send = s + nc;
-
-for( q = s ; q<send && *p!='\0' && *p!=')' ; *q++ = *p++ )
-       ;
-while(q < send)
-       *q++ = '\0';
-while(getarch())
-       {
-       if(objarch)
-               {
-               getobj();
-               nsym = objhead.a_syms / sizeof(objentry);
-               for(i = 0; i<nsym ; ++i)
-                       {
-                       fread( (char *) &objentry, sizeof(objentry),1,arfd);
-                       if( (objentry.n_type & N_EXT)
-                          && ((objentry.n_type & ~N_EXT) || objentry.n_value)
-                          && eqstr(objentry.n_name,s,nc))
-                               {
-                               clarch();
-                               return(arhead.ar_date);
-                               }
-                       }
-               }
-
-       else if( eqstr(arhead.ar_name, s, nc))
-               {
-               clarch();
-               return( arhead.ar_date);
-               }
-       }
-
-clarch();
-return( 0L);
-}
-
-
-clarch()
-{
-fclose( arfd );
-}
-
-
-openarch(f)
-register char *f;
-{
-int word;
-#include <sys/stat.h>
-struct stat buf;
-
-stat(f, &buf);
-arlen = buf.st_size;
-
-arfd = fopen(f, "r");
-if(arfd == NULL)
-       fatal1("cannot open %s", f);
-fread( (char *) &word, sizeof(word), 1, arfd);
-if(word != ARMAG)
-       fatal1("%s is not an archive", f);
-arpos = 0;
-arhead.ar_size = 2 - sizeof(arhead);
-}
-
-
-
-getarch()
-{
-arpos += sizeof(arhead);
-arpos += (arhead.ar_size + 1 ) & ~1L;
-if(arpos >= arlen)
-       return(0);
-fseek(arfd, arpos, 0);
-fread( (char *) &arhead, sizeof(arhead), 1, arfd);
-return(1);
-}
-
-
-getobj()
-{
-long int skip;
-
-fread( (char *) &objhead, sizeof(objhead), 1, arfd);
-if( objhead.a_magic != A_MAGIC1 &&
-    objhead.a_magic != A_MAGIC2 &&
-    objhead.a_magic != A_MAGIC3 &&
-    objhead.a_magic != A_MAGIC4 )
-               fatal1("%s is not an object module", arhead.ar_name);
-skip = objhead.a_text + objhead.a_data;
-if(! objhead.a_flag )
-       skip *= 2;
-fseek(arfd, skip, 1);
-}
-
-
-eqstr(a,b,n)
-register char *a, *b;
-int n;
-{
-register int i;
-for(i = 0 ; i < n ; ++i)
-       if(*a++ != *b++)
-               return(NO);
-return(YES);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/make/gram.y b/.ref-Research-V7/usr/src/cmd/make/gram.y
deleted file mode 100644 (file)
index a6c3d17..0000000
+++ /dev/null
@@ -1,306 +0,0 @@
-%{#include "defs"
-%}
-
-%term NAME SHELLINE START MACRODEF COLON DOUBLECOLON GREATER
-%union
-       {
-       struct shblock *yshblock;
-       struct depblock *ydepblock;
-       struct nameblock *ynameblock;
-       }
-
-%type <yshblock> SHELLINE, shlist, shellist
-%type <ynameblock> NAME, namelist
-%type <ydepblock> deplist, dlist
-
-
-%%
-
-%{
-struct depblock *pp;
-FSTATIC struct shblock *prevshp;
-
-FSTATIC struct nameblock *lefts[NLEFTS];
-struct nameblock *leftp;
-FSTATIC int nlefts;
-
-struct lineblock *lp, *lpp;
-FSTATIC struct depblock *prevdep;
-FSTATIC int sepc;
-%}
-
-
-file:
-       | file comline
-       ;
-
-comline:  START
-       | MACRODEF
-       | START namelist deplist shellist = {
-           while( --nlefts >= 0)
-               {
-               leftp = lefts[nlefts];
-               if(leftp->septype == 0)
-                       leftp->septype = sepc;
-               else if(leftp->septype != sepc)
-                       fprintf(stderr, "Inconsistent rules lines for `%s'\n",
-                               leftp->namep);
-               else if(sepc==ALLDEPS && *(leftp->namep)!='.' && $4!=0)
-                       {
-                       for(lp=leftp->linep; lp->nxtlineblock!=0; lp=lp->nxtlineblock)
-                           if(lp->shp)
-                               fprintf(stderr, "Multiple rules lines for `%s'\n",
-                                   leftp->namep);
-                       }
-
-               lp = ALLOC(lineblock);
-               lp->nxtlineblock = NULL;
-               lp->depp = $3;
-               lp->shp = $4;
-
-               if(! unequal(leftp->namep, ".SUFFIXES") && $3==0)
-                       leftp->linep = 0;
-               else if(leftp->linep == 0)
-                       leftp->linep = lp;
-               else    {
-                       for(lpp = leftp->linep; lpp->nxtlineblock;
-                               lpp = lpp->nxtlineblock) ;
-                               if(sepc==ALLDEPS && leftp->namep[0]=='.')
-                                       lpp->shp = 0;
-                       lpp->nxtlineblock = lp;
-                       }
-               }
-       }
-       | error
-       ;
-
-namelist: NAME = { lefts[0] = $1; nlefts = 1; }
-       | namelist NAME = { lefts[nlefts++] = $2;
-               if(nlefts>NLEFTS) fatal("Too many lefts"); }
-       ;
-
-deplist:
-               {
-               char junk[10];
-               sprintf(junk, "%d", yylineno);
-               fatal1("Must be a separator on rules line %s", junk);
-               }
-       | dlist
-       ;
-
-dlist:  sepchar        = { prevdep = 0;  $$ = 0; }
-       | dlist NAME    = {
-                         pp = ALLOC(depblock);
-                         pp->nxtdepblock = NULL;
-                         pp->depname = $2;
-                         if(prevdep == 0) $$ = pp;
-                         else  prevdep->nxtdepblock = pp;
-                         prevdep = pp;
-                         }
-       ;
-
-sepchar:  COLON        = { sepc = ALLDEPS; }
-       | DOUBLECOLON   = { sepc = SOMEDEPS; }
-       ;
-
-shellist:      = {$$ = 0; }
-       | shlist = { $$ = $1; }
-       ;
-
-shlist:        SHELLINE   = { $$ = $1;  prevshp = $1; }
-       | shlist SHELLINE = { $$ = $1;
-                       prevshp->nxtshblock = $2;
-                       prevshp = $2;
-                       }
-       ;
-
-%%
-\f
-char *zznextc; /* zero if need another line; otherwise points to next char */
-int yylineno;
-extern FILE * fin;
-
-yylex()
-{
-register char *p;
-register char *q;
-char word[INMAX];
-
-if(zznextc == 0)
-       return( nextlin() );
-
-while( isspace(*zznextc) )
-       ++zznextc;
-
-if(*zznextc == '\0')
-       return( nextlin() );
-
-if(*zznextc == ':')
-       {
-       if(*++zznextc == ':')
-               {
-               ++zznextc;
-               return(DOUBLECOLON);
-               }
-       else    return(COLON);
-       }
-
-if(*zznextc == '>')
-       {
-       ++zznextc;
-       return(GREATER);
-       }
-
-if(*zznextc == ';')
-       return( retsh(zznextc) );
-
-p = zznextc;
-q = word;
-
-while( ! ( funny[*p] & TERMINAL) )
-       *q++ = *p++;
-
-if(p != zznextc)
-       {
-       *q = '\0';
-       if((yylval.ynameblock=srchname(word))==0)
-               yylval.ynameblock = makename(word);
-       zznextc = p;
-       return(NAME);
-       }
-
-else   {
-       fprintf(stderr,"Bad character %c (octal %o), line %d",
-               *zznextc,*zznextc,yylineno);
-       fatal( (char *) NULL );
-       }
-return(0);     /* never executed */
-}
-
-
-
-
-
-retsh(q)
-char *q;
-{
-register char *p;
-struct shblock *sp;
-char *copys();
-
-for(p=q+1 ; *p==' '||*p=='\t' ; ++p)  ;
-
-sp = ALLOC(shblock);
-sp->nxtshblock = NULL;
-sp->shbp = (fin == NULL ? p : copys(p) );
-yylval.yshblock = sp;
-zznextc = 0;
-return(SHELLINE);
-}
-\f
-nextlin()
-{
-static char yytext[INMAX];
-static char *yytextl   = yytext+INMAX;
-char *text, templin[INMAX];
-register char c;
-register char *p, *t;
-char lastch, *lastchp;
-extern char **linesptr;
-int incom;
-int kc;
-
-again:
-
-       incom = NO;
-       zznextc = 0;
-
-if(fin == NULL)
-       {
-       if( (text = *linesptr++) == 0)
-               return(0);
-       ++yylineno;
-       }
-
-else   {
-       for(p = text = yytext ; p<yytextl ; *p++ = kc)
-               switch(kc = getc(fin))
-                       {
-                       case '\t':
-                               if(p != yytext)
-                                       break;
-                       case ';':
-                               incom = YES;
-                               break;
-
-                       case '#':
-                               if(! incom)
-                                       kc = '\0';
-                               break;
-
-                       case '\n':
-                               ++yylineno;
-                               if(p==yytext || p[-1]!='\\')
-                                       {
-                                       *p = '\0';
-                                       goto endloop;
-                                       }
-                               p[-1] = ' ';
-                               while( (kc=getc(fin))=='\t' || kc==' ' || kc=='\n')
-                                       if(kc == '\n')
-                                               ++yylineno;
-       
-                               if(kc != EOF)
-                                       break;
-                       case EOF:
-                               *p = '\0';
-                               return(0);
-                       }
-
-       fatal("line too long");
-       }
-
-endloop:
-
-       if((c = text[0]) == '\t')
-               return( retsh(text) );
-       
-       if(isalpha(c) || isdigit(c) || c==' ' || c=='.')
-               for(p=text+1; *p!='\0'; )
-                       if(*p == ':')
-                               break;
-                       else if(*p++ == '=')
-                               {
-                               eqsign(text);
-                               return(MACRODEF);
-                               }
-
-/* substitute for macros on dependency line up to the semicolon if any */
-
-for(t = yytext ; *t!='\0' && *t!=';' ; ++t)
-       ;
-
-lastchp = t;
-lastch = *t;
-*t = '\0';
-
-subst(yytext, templin);                /* Substitute for macros on dependency lines */
-
-if(lastch)
-       {
-       for(t = templin ; *t ; ++t)
-               ;
-       *t = lastch;
-       while( *++t = *++lastchp ) ;
-       }
-
-p = templin;
-t = yytext;
-while( *t++ = *p++ )
-       ;
-
-for(p = zznextc = text ; *p ; ++p )
-       if(*p!=' ' && *p!='\t')
-               return(START);
-goto again;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/make/ident.c b/.ref-Research-V7/usr/src/cmd/make/ident.c
deleted file mode 100644 (file)
index ae1ab0c..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-char *xxxvers =  "\nMAKE.  VERSION 2.58     14 MARCH 1979\n" ;
-
-/*
-2.1 4/24/76    Base version
-
-2.2 4/26/76     Error found by SRB in overriding pattern rules;
-               corrected gram.y
-
-2.3 4/27/76    Further correction for overriding pattern rules;
-               corrected doname.c
-
-2.4            Removed .CLEAR name, added .IGNORE.
-               A .SUFFIXES rule without dependents clears the list
-
-2.5            Stripped output
-
-2.6            Changed doshell to accomodate new shell.
-
-2.7            Following SRB's sugestion, added ${...} as
-               alternate macro name
-
-2.8            Defined macros AS and DTGEN in files.c.
-
-2.9            Put in a fix to prevent removal of files
-               upon interrupt in a  ::  rule.
-
-2.10           Fixed bugs involving messages for ::
-               and closing standard input
-
-2.11           Changed time test from <= to <
-               (equal times are considered in sync)
-
-2.12           Installed -t flag (touch and update time of
-               files rather than issue commands)
-               Fixed bug in dosys
-
-2.13           Fixed lex.c to allow sharps (#) in commands
-
-2.14           Added .DEFAULT rule
-
-2.15           Changed to <lS> I/O System (stdio.h)
-
-2.16           Removed references to double floats and macro HAVELONGS;
-               committed to use of long ints for times.
-2.17           Corrected metacharacter list in dosys.c.
-2.18           Miscellaneous fixes
-2.19           Updated files.c to use include file stat.h
-2.20           Added -q flag for Mike Lesk
-2.21           Added AWK rules and  .w  suffix to  files.c
-2.22           Added colon to the list of metacharacters
-2.23           Macro substitutions on dependency lines.
-               Redid argument and macro setting.
-               Close files before exec'ing.
-               Print > at beginning of command lines.
-               No printing of commands beginnng with @.
-2.24   Parametrized propt sequence in doname.c (4/1/77)
-2.25   Added $? facility
-2.26   Fixed bug in macro expansion
-2.27   Repaired interrupt handling
-2.28   Repaired bug in -n
-2.29   Repaired bug in file closing and $? string creation
-2.30   Repaired bug in grammar about command lines
-2.31   Added -k flag, modified doname.c and defs
-2.32   Made "keepgoing" the default, added -S flag,
-               changed handling of funny characters internally
-2.3    Small fixups to interrupt and quit handling.
-              Changed default back to -k.
-2.34   Added  .PRECIOUS rule for interrupts
-2.35   Added references to include files (due to TLL)
-2.36   Fixed bug in lex.c so = permitted in rules on :; line
-2.37   Miscellaneous code cleanups
-2.38   Sleep one second after each touch in -t mode
-2.39   Extended string[] declaration in doname.c
-2.40   Permit recursive macro references
-2.41   Separated YYLMAX into INMAX and OUTMAX macros, specifying longest
-       input and output lines respectively.
-2.42   Fixed bug involving :: lines without dependents
-2.43   Main name is first name that contains a slash or doesn't
-       begin with a dot
-2.44   Fixed bug involving $$ on command line
-2.45   Changed files.c to put .f before .e, .r and to use f77 instead of fc.
-2.46   Changed dosys.c to eliminate copying and to call execvp.
-2.47   Changed files.c to add ".out" suffix and rules.
-2.48   Changed misc.c to permit tabs preceding = in macro definition
-2.49   Added reference to <ctyp.h>. Removed -lS references from files.c
-2.50   General cleanup to reduce lint messages.  (changes in declarations
-       and in uses of variables)
-2.51   Further cleanup making use of new Yacc features.
-2.52
-2.53   Changed handling of "touch"
-2.54   Fixed bug involving comments in lexical analyzer.
-2.55   Ignore commands that begin with a # are comments.
-2.56   Added = to list of META characters (to permit shell commands)
-2.57   Changed lookarch and getobj to fix bugs.
-2.58   Fixed interrupt handling.
-*/
diff --git a/.ref-Research-V7/usr/src/cmd/make/main.c b/.ref-Research-V7/usr/src/cmd/make/main.c
deleted file mode 100644 (file)
index 12de0ea..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-# include "defs"
-/*
-command make to update programs.
-Flags: 'd'  print out debugging comments
-       'p'  print out a version of the input graph
-       's'  silent mode--don't print out commands
-       'f'  the next argument is the name of the description file;
-            "makefile" is the default
-       'i'  ignore error codes from the shell
-       'S'  stop after any command fails (normally do parallel work)
-       'n'   don't issue, just print, commands
-       't'   touch (update time of) files but don't issue command
-       'q'   don't do anything, but check if object is up to date;
-             returns exit code 0 if up to date, -1 if not
-*/
-
-struct nameblock *mainname ;
-struct nameblock *firstname;
-struct lineblock *sufflist;
-struct varblock *firstvar;
-struct pattern *firstpat ;
-struct opendir *firstod;
-
-#include <signal.h>
-int sigivalue  = 0;
-int sigqvalue  = 0;
-int waitpid    = 0;
-
-int dbgflag    = NO;
-int prtrflag   = NO;
-int silflag    = NO;
-int noexflag   = NO;
-int keepgoing  = NO;
-int noruleflag = NO;
-int touchflag  = NO;
-int questflag  = NO;
-int ndocoms    = NO;
-int ignerr     = NO;    /* default is to stop on error */
-int okdel      = YES;
-int inarglist;
-char *prompt   = "";   /* other systems -- pick what you want */
-char junkname[20];
-char funny[128];
-
-main(argc,argv)
-int argc;
-char *argv[];
-{
-register struct nameblock *p;
-int i, j;
-int descset, nfargs;
-TIMETYPE tjunk;
-char c, *s;
-static char onechar[2] = "X";
-#ifdef unix
-int intrupt();
-
-
-
-#endif
-
-#ifdef METERFILE
-meter(METERFILE);
-#endif
-
-descset = 0;
-
-funny['\0'] = (META | TERMINAL);
-for(s = "=|^();&<>*?[]:$`'\"\\\n" ; *s ; ++s)
-       funny[*s] |= META;
-for(s = "\n\t :;&>|" ; *s ; ++s)
-       funny[*s] |= TERMINAL;
-
-
-inarglist = 1;
-for(i=1; i<argc; ++i)
-       if(argv[i]!=0 && argv[i][0]!='-' && eqsign(argv[i]))
-               argv[i] = 0;
-
-setvar("$","$");
-inarglist = 0;
-
-for(i=1; i<argc; ++i)
-    if(argv[i]!=0 && argv[i][0]=='-')
-       {
-       for(j=1 ; (c=argv[i][j])!='\0' ; ++j)  switch(c)
-               {
-               case 'd':
-                       dbgflag = YES;
-                       break;
-
-               case 'p':
-                       prtrflag = YES;
-                       break;
-
-               case 's':
-                       silflag = YES;
-                       break;
-
-               case 'i':
-                       ignerr = YES;
-                       break;
-
-               case 'S':
-                       keepgoing = NO;
-                       break;
-
-               case 'k':
-                       keepgoing = YES;
-                       break;
-
-               case 'n':
-                       noexflag = YES;
-                       break;
-
-               case 'r':
-                       noruleflag = YES;
-                       break;
-
-               case 't':
-                       touchflag = YES;
-                       break;
-
-               case 'q':
-                       questflag = YES;
-                       break;
-
-               case 'f':
-                       if(i >= argc-1)
-                         fatal("No description argument after -f flag");
-                       if( rddescf(argv[i+1]) )
-                               fatal1("Cannot open %s", argv[i+1]);
-                       argv[i+1] = 0;
-                       ++descset;
-                       break;
-
-               default:
-                       onechar[0] = c; /* to make lint happy */
-                       fatal1("Unknown flag argument %s", onechar);
-               }
-
-       argv[i] = 0;
-       }
-
-if( !descset )
-#ifdef unix
-       if( rddescf("makefile") )  rddescf("Makefile");
-#endif
-#ifdef gcos
-       rddescf("makefile");
-#endif
-
-if(prtrflag) printdesc(NO);
-
-if( srchname(".IGNORE") ) ++ignerr;
-if( srchname(".SILENT") ) silflag = 1;
-if(p=srchname(".SUFFIXES")) sufflist = p->linep;
-if( !sufflist ) fprintf(stderr,"No suffix list.\n");
-
-#ifdef unix
-sigivalue = (int) signal(SIGINT, SIG_IGN) & 01;
-sigqvalue = (int) signal(SIGQUIT, SIG_IGN) & 01;
-enbint(intrupt);
-#endif
-
-nfargs = 0;
-
-for(i=1; i<argc; ++i)
-       if((s=argv[i]) != 0)
-               {
-               if((p=srchname(s)) == 0)
-                       {
-                       p = makename(s);
-                       }
-               ++nfargs;
-               doname(p, 0, &tjunk);
-               if(dbgflag) printdesc(YES);
-               }
-
-/*
-If no file arguments have been encountered, make the first
-name encountered that doesn't start with a dot
-*/
-
-if(nfargs == 0)
-       if(mainname == 0)
-               fatal("No arguments or description file");
-       else    {
-               doname(mainname, 0, &tjunk);
-               if(dbgflag) printdesc(YES);
-               }
-
-exit(0);
-}
-
-
-
-#ifdef unix
-intrupt()
-{
-struct varblock *varptr();
-char *p;
-TIMETYPE exists();
-
-if(okdel && !noexflag && !touchflag &&
-       (p = varptr("@")->varval) && exists(p)>0 && !isprecious(p) )
-               {
-               fprintf(stderr, "\n***  %s removed.", p);
-               unlink(p);
-               }
-
-if(junkname[0])
-       unlink(junkname);
-fprintf(stderr, "\n");
-exit(2);
-}
-
-
-
-
-isprecious(p)
-char *p;
-{
-register struct lineblock *lp;
-register struct depblock *dp;
-register struct nameblock *np;
-
-if(np = srchname(".PRECIOUS"))
-       for(lp = np->linep ; lp ; lp = lp->nxtlineblock)
-               for(dp = lp->depp ; dp ; dp = dp->nxtdepblock)
-                       if(! unequal(p, dp->depname->namep))
-                               return(YES);
-
-return(NO);
-}
-
-
-enbint(k)
-int (*k)();
-{
-if(sigivalue == 0)
-       signal(SIGINT,k);
-if(sigqvalue == 0)
-       signal(SIGQUIT,k);
-}
-#endif
-\f
-extern char *builtin[];
-
-char **linesptr        = builtin;
-
-FILE * fin;
-int firstrd    = 0;
-
-
-rddescf(descfile)
-char *descfile;
-{
-extern int yylineno;
-extern char *zznextc;
-FILE * k;
-
-/* read and parse description */
-
-if( !firstrd++ )
-       {
-       if( !noruleflag )
-               rdd1( (FILE *) NULL);
-
-#ifdef pwb
-               {
-               char *nlog, s[100];
-               nlog = logdir();
-               if ( (k=fopen( concat(nlog,"/makecomm",s), "r")) != NULL)
-                       rdd1(k);
-               else if ( (k=fopen( concat(nlog,"/Makecomm",s), "r")) != NULL)
-                       rdd1(k);
-       
-               if ( (k=fopen("makecomm", "r")) != NULL)
-                       rdd1(k);
-               else if ( (k=fopen("Makecomm", "r")) != NULL)
-                       rdd1(k);
-               }
-#endif
-
-       }
-if(! unequal(descfile, "-"))
-       return( rdd1(stdin) );
-
-if( (k = fopen(descfile,"r")) != NULL)
-       return( rdd1(k) );
-
-return(1);
-}
-
-
-
-
-rdd1(k)
-FILE * k;
-{
-fin = k;
-yylineno = 0;
-zznextc = 0;
-
-if( yyparse() )
-       fatal("Description file error");
-
-if(fin != NULL)
-       fclose(fin);
-
-return(0);
-}
-\f
-printdesc(prntflag)
-int prntflag;
-{
-struct nameblock *p;
-struct depblock *dp;
-struct varblock *vp;
-struct opendir *od;
-struct shblock *sp;
-struct lineblock *lp;
-
-#ifdef unix
-if(prntflag)
-       {
-       printf("Open directories:\n");
-       for(od = firstod ; od ; od = od->nxtopendir)
-               printf("\t%d: %s\n", fileno(od->dirfc), od->dirn);
-       }
-#endif
-
-if(firstvar != 0) printf("Macros:\n");
-for(vp = firstvar; vp ; vp = vp->nxtvarblock)
-       printf("\t%s = %s\n" , vp->varname , vp->varval);
-
-for(p = firstname; p; p = p->nxtnameblock)
-       {
-       printf("\n\n%s",p->namep);
-       if(p->linep != 0) printf(":");
-       if(prntflag) printf("  done=%d",p->done);
-       if(p==mainname) printf("  (MAIN NAME)");
-       for(lp = p->linep ; lp ; lp = lp->nxtlineblock)
-               {
-               if( dp = lp->depp )
-                       {
-                       printf("\n depends on:");
-                       for(; dp ; dp = dp->nxtdepblock)
-                               if(dp->depname != 0)
-                                       printf(" %s ", dp->depname->namep);
-                       }
-       
-               if(sp = lp->shp)
-                       {
-                       printf("\n commands:\n");
-                       for( ; sp!=0 ; sp = sp->nxtshblock)
-                               printf("\t%s\n", sp->shbp);
-                       }
-               }
-       }
-printf("\n");
-fflush(stdout);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/make/makefile b/.ref-Research-V7/usr/src/cmd/make/makefile
deleted file mode 100644 (file)
index 77d0214..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# Description file for the Make command
-
-P = und -3 | opr -r2
-T =
-FILES = makefile ident.c defs main.c doname.c misc.c files.c dosys.c\
-       gram.y gcos.c
-OBJECTS = ident.o main.o doname.o misc.o files.o dosys.o gram.o 
-LIBES= 
-LINT = lint -ps
-CFLAGS = -O
-
-GCOSFILES = defs ident.c main.c doname.c misc.c gram.c gcos.c
-
-all:   make
-
-cmp:   make
-       cmp make /bin/make
-       rm *.o gram.c make
-
-cp:    make
-       cp make /bin/make
-       rm *.o gram.c make
-
-make:  $(OBJECTS)
-       $(CC) -n -s $(CFLAGS) $(OBJECTS) $(LIBES) -o make
-
-$(OBJECTS):  defs
-
-cleanup:
-       -rm *.o gram.c
-       -du
-
-install:
-       cp make /bin/make
-
-printall: # Print files off line.
-       -pr $(FILES) | $P
-       touch print
-
-print:  $(FILES)       # print recently changed files
-       -pr $? | $P
-       touch print
-
-save: # Write files on Spider store.
-       -nfs -ucv make $(FILES)
-
-test: 1zap 2zap
-       diff 1zap 2zap
-       rm 1zap 2zap
-
-1zap:
-       ./make -dp | grep -v TIME >1zap
-
-2zap:
-       /bin/make -dp | grep -v TIME >2zap
-
-time:  time1 time2 ;
-
-time1 time2 :
-       time ./make $T
-       time /bin/make $T
-
-lint :  dosys.c doname.c files.c main.c misc.c ident.c gram.c
-       $(LINT) dosys.c doname.c files.c main.c misc.c ident.c gram.c
-       rm gram.c
-
-src:
-       cp $(FILES) /usr/src/cmd/make
-
-gcos: $(GCOSFILES)
-       fsend -c -u sif $?
-       touch gcos
diff --git a/.ref-Research-V7/usr/src/cmd/make/misc.c b/.ref-Research-V7/usr/src/cmd/make/misc.c
deleted file mode 100644 (file)
index 3df4da0..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-#include "defs"
-
-FSTATIC struct nameblock *hashtab[HASHSIZE];
-FSTATIC int nhashed    = 0;
-
-
-/* simple linear hash.  hash function is sum of
-   characters mod hash table size.
-*/
-hashloc(s)
-char *s;
-{
-register int i;
-register int hashval;
-register char *t;
-
-hashval = 0;
-
-for(t=s; *t!='\0' ; ++t)
-       hashval += *t;
-
-hashval %= HASHSIZE;
-
-for(i=hashval;
-       hashtab[i]!=0 && unequal(s,hashtab[i]->namep);
-       i = (i+1)%HASHSIZE ) ;
-
-return(i);
-}
-
-
-struct nameblock *srchname(s)
-char *s;
-{
-return( hashtab[hashloc(s)] );
-}
-
-
-
-struct nameblock *makename(s)
-char *s;
-{
-/* make a fresh copy of the string s */
-
-char *copys();
-register struct nameblock *p;
-
-if(nhashed++ > HASHSIZE-3)
-       fatal("Hash table overflow");
-
-p = ALLOC(nameblock);
-p->nxtnameblock = firstname;
-p->namep = copys(s);
-p->linep = 0;
-p->done = 0;
-p->septype = 0;
-p->modtime = 0;
-
-firstname = p;
-if(mainname == NULL)
-       if(s[0]!='.' || hasslash(s) )
-               mainname = p;
-
-hashtab[hashloc(s)] = p;
-
-return(p);
-}
-
-
-
-hasslash(s)
-char *s;
-{
-for( ; *s ; ++s)
-       if(*s == '/')
-               return(YES);
-return(NO);
-}
-\f
-
-
-char *copys(s)
-register char *s;
-{
-char *calloc();
-register char *t, *t0;
-
-if( (t = t0 = calloc( strlen(s)+1 , sizeof(char)) ) == NULL)
-       fatal("out of memory");
-while(*t++ = *s++)
-       ;
-return(t0);
-}
-
-
-
-char *concat(a,b,c)   /* c = concatenation of a and b */
-register char *a,*b;
-char *c;
-{
-register char *t;
-t = c;
-
-while(*t = *a++) t++;
-while(*t++ = *b++);
-return(c);
-}
-
-
-
-suffix(a,b,p)  /* is b the suffix of a?  if so, set p = prefix */
-register char *a,*b,*p;
-{
-char *a0,*b0;
-a0 = a;
-b0 = b;
-
-while(*a++);
-while(*b++);
-
-if( (a-a0) < (b-b0) ) return(0);
-
-while(b>b0)
-       if(*--a != *--b) return(0);
-
-while(a0<a) *p++ = *a0++;
-*p = '\0';
-
-return(1);
-}
-
-
-
-
-
-
-int *ckalloc(n)
-register int n;
-{
-register int *p;
-
-if( p = (int *) calloc(1,n) )
-       return(p);
-
-fatal("out of memory");
-/* NOTREACHED */
-}
-\f
-/* copy string a into b, substituting for arguments */
-char *subst(a,b)
-register char *a,*b;
-{
-static depth   = 0;
-register char *s;
-char vname[100];
-struct varblock *varptr(), *vbp;
-char closer;
-
-if(++depth > 100)
-       fatal("infinitely recursive macro?");
-if(a!=0)  while(*a)
-       {
-       if(*a != '$') *b++ = *a++;
-       else if(*++a=='\0' || *a=='$')
-               *b++ = *a++;
-       else    {
-               s = vname;
-               if( *a=='(' || *a=='{' )
-                       {
-                       closer = ( *a=='(' ? ')' : '}');
-                       ++a;
-                       while(*a == ' ') ++a;
-                       while(*a!=' ' && *a!=closer && *a!='\0') *s++ = *a++;
-                       while(*a!=closer && *a!='\0') ++a;
-                       if(*a == closer) ++a;
-                       }
-               else    *s++ = *a++;
-
-               *s = '\0';
-               if( (vbp = varptr(vname)) ->varval != 0)
-                       {
-                       b = subst(vbp->varval, b);
-                       vbp->used = YES;
-                       }
-               }
-       }
-
-*b = '\0';
---depth;
-return(b);
-}
-
-
-setvar(v,s)
-char *v, *s;
-{
-struct varblock *varptr(), *p;
-
-p = varptr(v);
-if(p->noreset == 0)
-       {
-       p->varval = s;
-       p->noreset = inarglist;
-       if(p->used && unequal(v,"@") && unequal(v,"*")
-           && unequal(v,"<") && unequal(v,"?") )
-               fprintf(stderr, "Warning: %s changed after being used\n",v);
-       }
-}
-
-
-eqsign(a)   /*look for arguments with equal signs but not colons */
-char *a;
-{
-register char *s, *t;
-
-while(*a == ' ') ++a;
-for(s=a  ;   *s!='\0' && *s!=':'  ; ++s)
-       if(*s == '=')
-               {
-               for(t = a ; *t!='=' && *t!=' ' && *t!='\t' ;  ++t );
-               *t = '\0';
-
-               for(++s; *s==' ' || *s=='\t' ; ++s);
-               setvar(a, copys(s));
-               return(YES);
-               }
-
-return(NO);
-}
-
-
-struct varblock *varptr(v)
-char *v;
-{
-register struct varblock *vp;
-
-for(vp = firstvar; vp ; vp = vp->nxtvarblock)
-       if(! unequal(v , vp->varname))
-               return(vp);
-
-vp = ALLOC(varblock);
-vp->nxtvarblock = firstvar;
-firstvar = vp;
-vp->varname = copys(v);
-vp->varval = 0;
-return(vp);
-}
-
-
-fatal1(s, t)
-char *s, *t;
-{
-char buf[100];
-fatal( sprintf(buf, s, t) );
-}
-
-
-
-fatal(s)
-char *s;
-{
-if(s) fprintf(stderr, "Make: %s.  Stop.\n", s);
-else fprintf(stderr, "\nStop.\n");
-#ifdef unix
-exit(1);
-#endif
-#ifdef gcos
-exit(0);
-#endif
-}
-
-
-
-yyerror(s)
-char *s;
-{
-char buf[50];
-extern int yylineno;
-
-fatal( sprintf(buf, "line %d: %s", yylineno, s) );
-}
-
-
-
-struct chain *appendq(head, tail)
-struct chain *head;
-char *tail;
-{
-register struct chain *p, *q;
-
-p = ALLOC(chain);
-p->datap = tail;
-
-if(head)
-       {
-       for(q = head ; q->nextp ; q = q->nextp)
-               ;
-       q->nextp = p;
-       return(head);
-       }
-else
-       return(p);
-}
-
-
-
-
-
-char *mkqlist(p)
-struct chain *p;
-{
-register char *qbufp, *s;
-static char qbuf[QBUFMAX];
-
-if(p == NULL)
-       {
-       qbuf[0] = '\0';
-       return;
-       }
-
-qbufp = qbuf;
-
-for( ; p ; p = p->nextp)
-       {
-       s = p->datap;
-       if(qbufp+strlen(s) > &qbuf[QBUFMAX-3])
-               {
-               fprintf(stderr, "$? list too long\n");
-               break;
-               }
-       while (*s)
-               *qbufp++ = *s++;
-       *qbufp++ = ' ';
-       }
-*--qbufp = '\0';
-return(qbuf);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/makeall b/.ref-Research-V7/usr/src/cmd/makeall
deleted file mode 100755 (executable)
index 5b90239..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-arg=-cp
-case $1 in
-       -cmp)   arg=-cmp ;;
-esac
-
-for i in *.[csy]; do cmake $arg $i; done
-
-case $arg in
-       -cmp)   arg=cmp ;;
-       -cp)    arg=cp ;;
-esac
-(echo ==== adb =====; cd adb; make $arg)
-(echo ==== as =====; cd as; make $arg)
-(echo ==== awk =====; cd awk; make $arg)
-(echo ==== c =====; cd c; make $arg)
-(echo ==== cpp =====; cd cpp; make $arg)
-(echo ==== dc =====; cd dc; make $arg)
-(echo ==== eqn =====; cd eqn; make $arg)
-(echo ==== f77 =====; cd f77; make $arg)
-(echo ==== learn =====; cd learn; make $arg)
-(echo ==== lex =====; cd lex; make $arg)
-(echo ==== lint =====; cd lint; make $arg)
-(echo ==== m4 =====; cd m4; make $arg)
-(echo ==== make =====; cd make; make $arg)
-(echo ==== neqn =====; cd neqn; make $arg)
-(echo ==== pcc =====; cd pcc; make $arg)
-(echo ==== plot =====; cd plot; make $arg)
-(echo ==== prep =====; cd prep; make $arg)
-(echo ==== ratfor =====; cd ratfor; make $arg)
-(echo ==== refer =====; cd refer; make $arg)
-(echo ==== roff =====; cd roff; make $arg)
-(echo ==== sed =====; cd sed; make $arg)
-(echo ==== sh =====; cd sh; make $arg)
-(echo ==== spell =====; cd spell; make $arg)
-(echo ==== struct =====; cd struct; make $arg)
-(echo ==== tar =====; cd tar; make $arg)
-(echo ==== tbl =====; cd tbl; make $arg)
-(echo ==== tp =====; cd tp; make $arg)
-(echo ==== troff =====; cd troff; make $arg)
-(echo ==== uucp =====; cd uucp; make $arg)
-(echo ==== xsend =====; cd xsend; make $arg)
-(echo ==== yacc =====; cd yacc; make $arg)
diff --git a/.ref-Research-V7/usr/src/cmd/makekey.c b/.ref-Research-V7/usr/src/cmd/makekey.c
deleted file mode 100644 (file)
index 1640e51..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * You send it 10 bytes.
- * It sends you 13 bytes.
- * The transformation is expensive to perform
- * (a significant part of a second).
- */
-
-char   *crypt();
-
-main()
-{
-       char key[8];
-       char salt[2];
-       
-       read(0, key, 8);
-       read(0, salt, 2);
-       write(1, crypt(key, salt), 13);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/mesg.c b/.ref-Research-V7/usr/src/cmd/mesg.c
deleted file mode 100644 (file)
index 3d55a36..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * mesg -- set current tty to accept or
- *     forbid write permission.
- *
- *     mesg [y] [n]
- *             y allow messages
- *             n forbid messages
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-struct stat sbuf;
-
-char *tty;
-char *ttyname();
-
-main(argc, argv)
-char *argv[];
-{
-       int r=0;
-       tty = ttyname(2);
-       if(stat(tty, &sbuf) < 0) error("cannot stat");
-       if(argc < 2) {
-               if(sbuf.st_mode & 02)
-                       fprintf(stderr,"is y\n");
-               else {  r=1;
-                       fprintf(stderr,"is n\n");
-               }
-       } else  switch(*argv[1]) {
-               case 'y':
-                       newmode(0622); break;
-
-               case 'n':
-                       newmode(0600); r=1; break;
-
-               default:
-                       error("usage: mesg [y] [n]");
-               }
-       exit(r);
-}
-
-error(s)
-char *s;
-{
-       fprintf(stderr,"mesg: %s\n",s);
-       exit(-1);
-}
-
-newmode(m)
-{
-       if(chmod(tty,m)<0)
-               error("cannot change mode");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/mip/INDEX b/.ref-Research-V7/usr/src/cmd/mip/INDEX
deleted file mode 100644 (file)
index 858f8ac..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-This directory contains the machine independent parts of the
-portable C compiler.  For more explanation of how these files
-are used, see the "Tour through the Portable C Compiler"
-in Volume 2 of the UNIX(TM) documentation.
-
-The makefile in this directory is useful when makeing a compiler;
-create a directory, copy the makefile into it, write the
-machine dependent files, and you are off and running.  The file g
-is a useful aid for finding out when things are used.
-
-The pcc command (see the pcc source) uses this makefile and
-the files in this directory.  Lint also uses the files.
diff --git a/.ref-Research-V7/usr/src/cmd/mip/allo.c b/.ref-Research-V7/usr/src/cmd/mip/allo.c
deleted file mode 100644 (file)
index 58f111f..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-# include "mfile2"
-
-NODE resc[3];
-
-int busy[REGSZ];
-
-int maxa, mina, maxb, minb;
-
-allo0(){ /* free everything */
-
-       register i;
-
-       maxa = maxb = -1;
-       mina = minb = 0;
-
-       REGLOOP(i){
-               busy[i] = 0;
-               if( rstatus[i] & STAREG ){
-                       if( maxa<0 ) mina = i;
-                       maxa = i;
-                       }
-               if( rstatus[i] & STBREG ){
-                       if( maxb<0 ) minb = i;
-                       maxb = i;
-                       }
-               }
-       }
-
-# define TBUSY 01000
-
-allo( p, q ) NODE *p; struct optab *q; {
-
-       register n, i, j;
-
-       n = q->needs;
-       i = 0;
-
-       while( n & NACOUNT ){
-               resc[i].op = REG;
-               resc[i].rval = freereg( p, n&NAMASK );
-               resc[i].lval = 0;
-               resc[i].name[0] = '\0';
-               n -= NAREG;
-               ++i;
-               }
-
-       while( n & NBCOUNT ){
-               resc[i].op = REG;
-               resc[i].rval = freereg( p, n&NBMASK );
-               resc[i].lval = 0;
-               resc[i].name[0] = '\0';
-               n -= NBREG;
-               ++i;
-               }
-
-       if( n & NTMASK ){
-               resc[i].op = OREG;
-               resc[i].rval = TMPREG;
-               if( p->op == STCALL || p->op == STARG || p->op == UNARY STCALL || p->op == STASG ){
-                       resc[i].lval = freetemp( (SZCHAR*p->stsize + (SZINT-1))/SZINT );
-                       }
-               else {
-                       resc[i].lval = freetemp( (n&NTMASK)/NTEMP );
-                       }
-               resc[i].name[0] = '\0';
-               resc[i].lval = BITOOR(resc[i].lval);
-               ++i;
-               }
-
-       /* turn off "temporarily busy" bit */
-
-       REGLOOP(j){
-               busy[j] &= ~TBUSY;
-               }
-
-       for( j=0; j<i; ++j ) if( resc[j].rval < 0 ) return(0);
-       return(1);
-
-       }
-
-freetemp( k ){ /* allocate k integers worth of temp space */
-       /* we also make the convention that, if the number of words is more than 1,
-       /* it must be aligned for storing doubles... */
-
-# ifndef BACKTEMP
-       int t;
-
-       if( k>1 ){
-               SETOFF( tmpoff, ALDOUBLE );
-               }
-
-       t = tmpoff;
-       tmpoff += k*SZINT;
-       if( tmpoff > maxoff ) maxoff = tmpoff;
-       if( tmpoff-baseoff > maxtemp ) maxtemp = tmpoff-baseoff;
-       return(t);
-
-# else
-       tmpoff += k*SZINT;
-       if( k>1 ) {
-               SETOFF( tmpoff, ALDOUBLE );
-               }
-       if( tmpoff > maxoff ) maxoff = tmpoff;
-       if( tmpoff-baseoff > maxtemp ) maxtemp = tmpoff-baseoff;
-       return( -tmpoff );
-# endif
-       }
-
-freereg( p, n ) NODE *p; {
-       /* allocate a register of type n */
-       /* p gives the type, if floating */
-
-       register j;
-
-       /* not general; means that only one register (the result) OK for call */
-       if( callop(p->op) ){
-               j = callreg(p);
-               if( usable( p, n, j ) ) return( j );
-               /* have allocated callreg first */
-               }
-       j = p->rall & ~MUSTDO;
-       if( j!=NOPREF && usable(p,n,j) ){ /* needed and not allocated */
-               return( j );
-               }
-       if( n&NAMASK ){
-               for( j=mina; j<=maxa; ++j ) if( rstatus[j]&STAREG ){
-                       if( usable(p,n,j) ){
-                               return( j );
-                               }
-                       }
-               }
-       else if( n &NBMASK ){
-               for( j=minb; j<=maxb; ++j ) if( rstatus[j]&STBREG ){
-                       if( usable(p,n,j) ){
-                               return(j);
-                               }
-                       }
-               }
-
-       return( -1 );
-       }
-
-usable( p, n, r ) NODE *p; {
-       /* decide if register r is usable in tree p to satisfy need n */
-
-       /* checks, for the moment */
-       if( !istreg(r) ) cerror( "usable asked about nontemp register" );
-
-       if( busy[r] > 1 ) return(0);
-       if( isbreg(r) ){
-               if( n&NAMASK ) return(0);
-               }
-       else {
-               if( n & NBMASK ) return(0);
-               }
-       if( (n&NAMASK) && (szty(p->type) == 2) ){ /* only do the pairing for real regs */
-               if( r&01 ) return(0);
-               if( !istreg(r+1) ) return( 0 );
-               if( busy[r+1] > 1 ) return( 0 );
-               if( busy[r] == 0 && busy[r+1] == 0  ||
-                   busy[r+1] == 0 && shareit( p, r, n ) ||
-                   busy[r] == 0 && shareit( p, r+1, n ) ){
-                       busy[r] |= TBUSY;
-                       busy[r+1] |= TBUSY;
-                       return(1);
-                       }
-               else return(0);
-               }
-       if( busy[r] == 0 ) {
-               busy[r] |= TBUSY;
-               return(1);
-               }
-
-       /* busy[r] is 1: is there chance for sharing */
-       return( shareit( p, r, n ) );
-
-       }
-
-shareit( p, r, n ) NODE *p; {
-       /* can we make register r available by sharing from p
-          given that the need is n */
-       if( (n&(NASL|NBSL)) && ushare( p, 'L', r ) ) return(1);
-       if( (n&(NASR|NBSR)) && ushare( p, 'R', r ) ) return(1);
-       return(0);
-       }
-
-ushare( p, f, r ) NODE *p; {
-       /* can we find a register r to share on the left or right
-               (as f=='L' or 'R', respectively) of p */
-       p = getlr( p, f );
-       if( p->op == UNARY MUL ) p = p->left;
-       if( p->op == OREG ){
-               if( R2TEST(p->rval) ){
-                       return( r==R2UPK1(p->rval) || r==R2UPK2(p->rval) );
-                       }
-               else return( r == p->rval );
-               }
-       if( p->op == REG ){
-               return( r == p->rval || ( szty(p->type) == 2 && r==p->rval+1 ) );
-               }
-       return(0);
-       }
-
-recl2( p ) register NODE *p; {
-       register r = p->rval;
-       if( p->op == REG ) rfree( r, p->type );
-       else if( p->op == OREG ) {
-               if( R2TEST( r ) ) {
-                       rfree( R2UPK1( r ), PTR+INT );
-                       rfree( R2UPK2( r ), INT );
-                       }
-               else {
-                       rfree( r, PTR+INT );
-                       }
-               }
-       }
-
-int rdebug = 0;
-
-rfree( r, t ) TWORD t; {
-       /* mark register r free, if it is legal to do so */
-       /* t is the type */
-
-       if( rdebug ){
-               printf( "rfree( %s ), size %d\n", rnames[r], szty(t) );
-               }
-
-       if( istreg(r) ){
-               if( --busy[r] < 0 ) cerror( "register overfreed");
-               if( szty(t) == 2 ){
-                       if( (r&01) || (istreg(r)^istreg(r+1)) ) cerror( "illegal free" );
-                       if( --busy[r+1] < 0 ) cerror( "register overfreed" );
-                       }
-               }
-       }
-
-rbusy(r,t) TWORD t; {
-       /* mark register r busy */
-       /* t is the type */
-
-       if( rdebug ){
-               printf( "rbusy( %s ), size %d\n", rnames[r], szty(t) );
-               }
-
-       if( istreg(r) ) ++busy[r];
-       if( szty(t) == 2 ){
-               if( istreg(r+1) ) ++busy[r+1];
-               if( (r&01) || (istreg(r)^istreg(r+1)) ) cerror( "illegal register pair freed" );
-               }
-       }
-
-rwprint( rw ){ /* print rewriting rule */
-       register i, flag;
-       static char * rwnames[] = {
-
-               "RLEFT",
-               "RRIGHT",
-               "RESC1",
-               "RESC2",
-               "RESC3",
-               0,
-               };
-
-       if( rw == RNULL ){
-               printf( "RNULL" );
-               return;
-               }
-
-       if( rw == RNOP ){
-               printf( "RNOP" );
-               return;
-               }
-
-       flag = 0;
-       for( i=0; rwnames[i]; ++i ){
-               if( rw & (1<<i) ){
-                       if( flag ) printf( "|" );
-                       ++flag;
-                       printf( rwnames[i] );
-                       }
-               }
-       }
-
-reclaim( p, rw, cookie ) NODE *p; {
-       register NODE **qq;
-       register NODE *q;
-       register i;
-       NODE *recres[5];
-       struct respref *r;
-
-       /* get back stuff */
-
-       if( rdebug ){
-               printf( "reclaim( %o, ", p );
-               rwprint( rw );
-               printf( ", " );
-               prcook( cookie );
-               printf( " )\n" );
-               }
-
-       if( rw == RNOP || ( p->op==FREE && rw==RNULL ) ) return;  /* do nothing */
-
-       walkf( p, recl2 );
-
-       if( callop(p->op) ){
-               /* check that all scratch regs are free */
-               callchk(p);  /* ordinarily, this is the same as allchk() */
-               }
-
-       if( rw == RNULL || (cookie&FOREFF) ){ /* totally clobber, leaving nothing */
-               tfree(p);
-               return;
-               }
-
-       /* handle condition codes specially */
-
-       if( (cookie & FORCC) && (rw&RESCC)) {
-               /* result is CC register */
-               tfree(p);
-               p->op = CCODES;
-               p->lval = 0;
-               p->rval = 0;
-               return;
-               }
-
-       /* locate results */
-
-       qq = recres;
-
-       if( rw&RLEFT) *qq++ = getlr(p,'L');
-       if( rw&RRIGHT ) *qq++ = getlr(p,'R');
-       if( rw&RESC1 ) *qq++ = &resc[0];
-       if( rw&RESC2 ) *qq++ = &resc[1];
-       if( rw&RESC3 ) *qq++ = &resc[2];
-
-       if( qq == recres ){
-               cerror( "illegal reclaim");
-               }
-
-       *qq = NIL;
-
-       /* now, select the best result, based on the cookie */
-
-       for( r=respref; r->cform; ++r ){
-               if( cookie & r->cform ){
-                       for( qq=recres; (q= *qq) != NIL; ++qq ){
-                               if( tshape( q, r->mform ) ) goto gotit;
-                               }
-                       }
-               }
-
-       /* we can't do it; die */
-       cerror( "cannot reclaim");
-
-       gotit:
-
-       if( p->op == STARG ) p = p->left;  /* STARGs are still STARGS */
-
-       q->type = p->type;  /* to make multi-register allocations work */
-               /* maybe there is a better way! */
-       q = tcopy(q);
-
-       tfree(p);
-
-       p->op = q->op;
-       p->lval = q->lval;
-       p->rval = q->rval;
-       for( i=0; i<NCHNAM; ++i )
-               p->name[i] = q->name[i];
-
-       q->op = FREE;
-
-       /* if the thing is in a register, adjust the type */
-
-       switch( p->op ){
-
-       case REG:
-               if( !rtyflg ){
-                       /* the C language requires intermediate results to change type */
-                       /* this is inefficient or impossible on some machines */
-                       /* the "T" command in match supresses this type changing */
-                       if( p->type == CHAR || p->type == SHORT ) p->type = INT;
-                       else if( p->type == UCHAR || p->type == USHORT ) p->type = UNSIGNED;
-                       else if( p->type == FLOAT ) p->type = DOUBLE;
-                       }
-               if( ! (p->rall & MUSTDO ) ) return;  /* unless necessary, ignore it */
-               i = p->rall & ~MUSTDO;
-               if( i & NOPREF ) return;
-               if( i != p->rval ){
-                       if( busy[i] || ( szty(p->type)==2 && busy[i+1] ) ){
-                               cerror( "faulty register move" );
-                               }
-                       rbusy( i, p->type );
-                       rfree( p->rval, p->type );
-                       rmove( i, p->rval, p->type );
-                       p->rval = i;
-                       }
-
-       case OREG:
-               if( R2TEST(p->rval) ){
-                       int r1, r2;
-                       r1 = R2UPK1(p->rval);
-                       r2 = R2UPK2(p->rval);
-                       if( (busy[r1]>1 && istreg(r1)) || (busy[r2]>1 && istreg(r2)) ){
-                               cerror( "potential register overwrite" );
-                               }
-                       }
-               else if( (busy[p->rval]>1) && istreg(p->rval) ) cerror( "potential register overwrite");
-               }
-
-       }
-
-ncopy( q, p ) NODE *p, *q; {
-       /* copy the contents of p into q, without any feeling for
-          the contents */
-       /* this code assume that copying rval and lval does the job;
-          in general, it might be necessary to special case the
-          operator types */
-       register i;
-
-       q->op = p->op;
-       q->rall = p->rall;
-       q->type = p->type;
-       q->lval = p->lval;
-       q->rval = p->rval;
-       for( i=0; i<NCHNAM; ++i ) q->name[i]  = p->name[i];
-
-       }
-
-NODE *
-tcopy( p ) register NODE *p; {
-       /* make a fresh copy of p */
-
-       register NODE *q;
-       register r;
-
-       ncopy( q=talloc(), p );
-
-       r = p->rval;
-       if( p->op == REG ) rbusy( r, p->type );
-       else if( p->op == OREG ) {
-               if( R2TEST(r) ){
-                       rbusy( R2UPK1(r), PTR+INT );
-                       rbusy( R2UPK2(r), INT );
-                       }
-               else {
-                       rbusy( r, PTR+INT );
-                       }
-               }
-
-       switch( optype(q->op) ){
-
-       case BITYPE:
-               q->right = tcopy(p->right);
-       case UTYPE:
-               q->left = tcopy(p->left);
-               }
-
-       return(q);
-       }
-
-allchk(){
-       /* check to ensure that all register are free */
-
-       register i;
-
-       REGLOOP(i){
-               if( istreg(i) && busy[i] ){
-                       cerror( "register allocation error");
-                       }
-               }
-
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/cgram.y b/.ref-Research-V7/usr/src/cmd/mip/cgram.y
deleted file mode 100644 (file)
index 94d6348..0000000
+++ /dev/null
@@ -1,924 +0,0 @@
-%term NAME  2
-%term STRING  3
-%term ICON  4
-%term FCON  5
-%term PLUS   6
-%term MINUS   8
-%term MUL   11
-%term AND   14
-%term OR   17
-%term ER   19
-%term QUEST  21
-%term COLON  22
-%term ANDAND  23
-%term OROR  24
-
-/*     special interfaces for yacc alone */
-/*     These serve as abbreviations of 2 or more ops:
-       ASOP    =, = ops
-       RELOP   LE,LT,GE,GT
-       EQUOP   EQ,NE
-       DIVOP   DIV,MOD
-       SHIFTOP LS,RS
-       ICOP    ICR,DECR
-       UNOP    NOT,COMPL
-       STROP   DOT,STREF
-
-       */
-%term ASOP  25
-%term RELOP  26
-%term EQUOP  27
-%term DIVOP  28
-%term SHIFTOP  29
-%term INCOP  30
-%term UNOP  31
-%term STROP  32
-
-/*     reserved words, etc */
-%term TYPE  33
-%term CLASS  34
-%term STRUCT  35
-%term RETURN  36
-%term GOTO  37
-%term IF  38
-%term ELSE  39
-%term SWITCH  40
-%term BREAK  41
-%term CONTINUE  42
-%term WHILE  43
-%term DO  44
-%term FOR  45
-%term DEFAULT  46
-%term CASE  47
-%term SIZEOF  48
-%term ENUM 49
-
-
-/*     little symbols, etc. */
-/*     namely,
-
-       LP      (
-       RP      )
-
-       LC      {
-       RC      }
-
-       LB      [
-       RB      ]
-
-       CM      ,
-       SM      ;
-
-       */
-
-%term LP  50
-%term RP  51
-%term LC  52
-%term RC  53
-%term LB  54
-%term RB  55
-%term CM  56
-%term SM  57
-%term ASSIGN  58
-
-/* at last count, there were 7 shift/reduce, 1 reduce/reduce conflicts
-/* these involved:
-       if/else
-       recognizing functions in various contexts, including declarations
-       error recovery
-       */
-
-%left CM
-%right ASOP ASSIGN
-%right QUEST COLON
-%left OROR
-%left ANDAND
-%left OR
-%left ER
-%left AND
-%left EQUOP
-%left RELOP
-%left SHIFTOP
-%left PLUS MINUS
-%left MUL DIVOP
-%right UNOP
-%right INCOP SIZEOF
-%left LB LP STROP
-%{
-# include "mfile1"
-%}
-
-       /* define types */
-%start ext_def_list
-
-%type <intval> con_e ifelprefix ifprefix whprefix forprefix doprefix switchpart
-               enum_head str_head name_lp
-%type <nodep> e .e term attributes oattributes type enum_dcl struct_dcl
-               cast_type null_decl funct_idn declarator fdeclarator nfdeclarator
-               elist
-
-%token <intval> CLASS NAME STRUCT RELOP CM DIVOP PLUS MINUS SHIFTOP MUL AND OR ER ANDAND OROR
-               ASSIGN STROP INCOP UNOP ICON
-%token <nodep> TYPE
-
-%%
-
-%{
-       static int fake = 0;
-       static char fakename[NCHNAM+1];
-%}
-
-ext_def_list:     ext_def_list external_def
-               |
-                       =ftnend();
-               ;
-external_def:     data_def
-                       ={ curclass = SNULL;  blevel = 0; }
-               |  error
-                       ={ curclass = SNULL;  blevel = 0; }
-               ;
-data_def:
-                  oattributes  SM
-                       ={  $1->op = FREE; }
-               |  oattributes init_dcl_list  SM
-                       ={  $1->op = FREE; }
-               |  oattributes fdeclarator {
-                               defid( tymerge($1,$2), curclass==STATIC?STATIC:EXTDEF );
-                               }  function_body
-                       ={  
-                           if( blevel ) cerror( "function level error" );
-                           if( reached ) retstat |= NRETVAL; 
-                           $1->op = FREE;
-                           ftnend();
-                           }
-               ;
-
-function_body:    arg_dcl_list compoundstmt
-               ;
-arg_dcl_list:     arg_dcl_list declaration
-               |       ={  blevel = 1; }
-               ;
-
-stmt_list:        stmt_list statement
-               |  /* empty */
-                       ={  bccode();
-                           locctr(PROG);
-                           }
-               ;
-
-dcl_stat_list  :  dcl_stat_list attributes SM
-                       ={  $2->op = FREE; }
-               |  dcl_stat_list attributes init_dcl_list SM
-                       ={  $2->op = FREE; }
-               |  /* empty */
-               ;
-declaration:      attributes declarator_list  SM
-                       ={ curclass = SNULL;  $1->op = FREE; }
-               |  attributes SM
-                       ={ curclass = SNULL;  $1->op = FREE; }
-               |  error  SM
-                       ={  curclass = SNULL; }
-               ;
-oattributes:     attributes
-               |  /* VOID */
-                       ={  $$ = mkty(INT,0,INT);  curclass = SNULL; }
-               ;
-attributes:       class type
-                       ={  $$ = $2; }
-               |  type class
-               |  class
-                       ={  $$ = mkty(INT,0,INT); }
-               |  type
-                       ={ curclass = SNULL ; }
-               ;
-
-
-class:           CLASS
-                       ={  curclass = $1; }
-               ;
-
-type:             TYPE
-               |  TYPE TYPE
-                       ={  $1->type = types( $1->type, $2->type, UNDEF );
-                           $2->op = FREE;
-                           }
-               |  TYPE TYPE TYPE
-                       ={  $1->type = types( $1->type, $2->type, $3->type );
-                           $2->op = $3->op = FREE;
-                           }
-               |  struct_dcl
-               |  enum_dcl
-               ;
-
-enum_dcl:         enum_head LC moe_list optcomma RC
-                       ={ $$ = dclstruct($1); }
-               |  ENUM NAME
-                       ={  $$ = rstruct($2,0);  stwart = instruct; }
-               ;
-
-enum_head:        ENUM
-                       ={  $$ = bstruct(-1,0); }
-               |  ENUM NAME
-                       ={  $$ = bstruct($2,0); }
-               ;
-
-moe_list:         moe
-               |  moe_list CM moe
-               ;
-
-moe:              NAME
-                       ={  moedef( $1 ); }
-               |  NAME ASSIGN con_e
-                       ={  strucoff = $3;  moedef( $1 ); }
-               ;
-
-struct_dcl:       str_head LC type_dcl_list optsemi RC
-                       ={ $$ = dclstruct($1);  }
-               |  STRUCT NAME
-                       ={  $$ = rstruct($2,$1); }
-               ;
-
-str_head:         STRUCT
-                       ={  $$ = bstruct(-1,$1);  stwart=0; }
-               |  STRUCT NAME
-                       ={  $$ = bstruct($2,$1);  stwart=0;  }
-               ;
-
-type_dcl_list:    type_declaration
-               |  type_dcl_list SM type_declaration
-               ;
-
-type_declaration:  type declarator_list
-                       ={ curclass = SNULL;  stwart=0; $1->op = FREE; }
-               |  type
-                       ={  if( curclass != MOU ){
-                               curclass = SNULL;
-                               }
-                           else {
-                               sprintf( fakename, "$%dFAKE", fake++ );
-                               defid( tymerge($1, bdty(NAME,NIL,lookup( fakename, SMOS ))), curclass );
-                               }
-                           stwart = 0;
-                           $1->op = FREE;
-                           }
-               ;
-
-
-declarator_list:   declarator
-                       ={ defid( tymerge($<nodep>0,$1), curclass);  stwart = instruct; }
-               |  declarator_list  CM {$<nodep>$=$<nodep>0;}  declarator
-                       ={ defid( tymerge($<nodep>0,$4), curclass);  stwart = instruct; }
-               ;
-declarator:       fdeclarator
-               |  nfdeclarator
-               |  nfdeclarator COLON con_e
-                       %prec CM
-                       ={  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
-                           if( $3<0 || $3 >= FIELD ){
-                               uerror( "illegal field size" );
-                               $3 = 1;
-                               }
-                           defid( tymerge($<nodep>0,$1), FIELD|$3 );
-                           $$ = NIL;
-                           }
-               |  COLON con_e
-                       %prec CM
-                       ={  if( !(instruct&INSTRUCT) ) uerror( "field outside of structure" );
-                           falloc( stab, $2, -1, $<nodep>0 );  /* alignment or hole */
-                           $$ = NIL;
-                           }
-               |  error
-                       ={  $$ = NIL; }
-               ;
-
-               /* int (a)();   is not a function --- sorry! */
-nfdeclarator:     MUL nfdeclarator             
-                       ={  umul:
-                               $$ = bdty( UNARY MUL, $2, 0 ); }
-               |  nfdeclarator  LP   RP                
-                       ={  uftn:
-                               $$ = bdty( UNARY CALL, $1, 0 );  }
-               |  nfdeclarator LB RB           
-                       ={  uary:
-                               $$ = bdty( LB, $1, 0 );  }
-               |  nfdeclarator LB con_e RB     
-                       ={  bary:
-                               if( (int)$3 <= 0 ) werror( "zero or negative subscript" );
-                               $$ = bdty( LB, $1, $3 );  }
-               |  NAME                 
-                       ={  $$ = bdty( NAME, NIL, $1 );  }
-               |   LP  nfdeclarator  RP                
-                       ={ $$=$2; }
-               ;
-fdeclarator:      MUL fdeclarator
-                       ={  goto umul; }
-               |  fdeclarator  LP   RP
-                       ={  goto uftn; }
-               |  fdeclarator LB RB
-                       ={  goto uary; }
-               |  fdeclarator LB con_e RB
-                       ={  goto bary; }
-               |   LP  fdeclarator  RP
-                       ={ $$ = $2; }
-               |  name_lp  name_list  RP
-                       ={
-                               if( blevel!=0 ) uerror("function declaration in bad context");
-                               $$ = bdty( UNARY CALL, bdty(NAME,NIL,$1), 0 );
-                               stwart = 0;
-                               }
-               |  name_lp RP
-                       ={
-                               $$ = bdty( UNARY CALL, bdty(NAME,NIL,$1), 0 );
-                               stwart = 0;
-                               }
-               ;
-
-name_lp:         NAME LP
-                       ={
-                               /* turn off typedefs for argument names */
-                               stwart = SEENAME;
-                               }
-               ;
-
-name_list:        NAME                 
-                       ={ ftnarg( $1 );  stwart = SEENAME; }
-               |  name_list  CM  NAME 
-                       ={ ftnarg( $3 );  stwart = SEENAME; }
-               ;
-               /* always preceeded by attributes: thus the $<nodep>0's */
-init_dcl_list:    init_declarator
-                       %prec CM
-               |  init_dcl_list  CM {$<nodep>$=$<nodep>0;}  init_declarator
-               ;
-               /* always preceeded by attributes */
-xnfdeclarator:    nfdeclarator
-                       ={  defid( $1 = tymerge($<nodep>0,$1), curclass);
-                           beginit($1->rval);
-                           }
-               |  error
-               ;
-               /* always preceeded by attributes */
-init_declarator:   nfdeclarator
-                       ={  nidcl( tymerge($<nodep>0,$1) ); }
-               |  fdeclarator
-                       ={  defid( tymerge($<nodep>0,$1), uclass(curclass) );
-                       }
-               |  xnfdeclarator optasgn e
-                       %prec CM
-                       ={  doinit( $3 );
-                           endinit(); }
-               |  xnfdeclarator optasgn LC init_list optcomma RC
-                       ={  endinit(); }
-               ;
-
-init_list:        initializer
-                       %prec CM
-               |  init_list  CM  initializer
-               ;
-initializer:      e
-                       %prec CM
-                       ={  doinit( $1 ); }
-               |  ibrace init_list optcomma RC
-                       ={  irbrace(); }
-               ;
-
-optcomma       :       /* VOID */
-               |  CM
-               ;
-
-optsemi                :       /* VOID */
-               |  SM
-               ;
-
-optasgn                :       /* VOID */
-                       ={  werror( "old-fashioned initialization: use =" ); }
-               |  ASSIGN
-               ;
-
-ibrace         : LC
-                       ={  ilbrace(); }
-               ;
-
-/*     STATEMENTS      */
-
-compoundstmt:     begin dcl_stat_list stmt_list RC
-                       ={  --blevel;
-                           if( blevel == 1 ) blevel = 0;
-                           clearst( blevel );
-                           checkst( blevel );
-                           autooff = *--psavbc;
-                           regvar = *--psavbc;
-                           }
-               ;
-
-begin:           LC
-                       ={  if( blevel == 1 ) dclargs();
-                           ++blevel;
-                           if( psavbc > &asavbc[BCSZ-2] ) cerror( "nesting too deep" );
-                           *psavbc++ = regvar;
-                           *psavbc++ = autooff;
-                           }
-               ;
-
-statement:        e   SM
-                       ={ ecomp( $1 ); }
-               |  compoundstmt
-               |  ifprefix statement
-                       ={ deflab($1);
-                          reached = 1;
-                          }
-               |  ifelprefix statement
-                       ={  if( $1 != NOLAB ){
-                               deflab( $1 );
-                               reached = 1;
-                               }
-                           }
-               |  whprefix statement
-                       ={  branch(  contlab );
-                           deflab( brklab );
-                           if( (flostat&FBRK) || !(flostat&FLOOP)) reached = 1;
-                           else reached = 0;
-                           resetbc(0);
-                           }
-               |  doprefix statement WHILE  LP  e  RP   SM
-                       ={  deflab( contlab );
-                           if( flostat & FCONT ) reached = 1;
-                           ecomp( buildtree( CBRANCH, buildtree( NOT, $5, NIL ), bcon( $1 ) ) );
-                           deflab( brklab );
-                           reached = 1;
-                           resetbc(0);
-                           }
-               |  forprefix .e RP statement
-                       ={  deflab( contlab );
-                           if( flostat&FCONT ) reached = 1;
-                           if( $2 ) ecomp( $2 );
-                           branch( $1 );
-                           deflab( brklab );
-                           if( (flostat&FBRK) || !(flostat&FLOOP) ) reached = 1;
-                           else reached = 0;
-                           resetbc(0);
-                           }
-               | switchpart statement
-                       ={  if( reached ) branch( brklab );
-                           deflab( $1 );
-                          swend();
-                           deflab(brklab);
-                           if( (flostat&FBRK) || !(flostat&FDEF) ) reached = 1;
-                           resetbc(FCONT);
-                           }
-               |  BREAK  SM
-                       ={  if( brklab == NOLAB ) uerror( "illegal break");
-                           else if(reached) branch( brklab );
-                           flostat |= FBRK;
-                           if( brkflag ) goto rch;
-                           reached = 0;
-                           }
-               |  CONTINUE  SM
-                       ={  if( contlab == NOLAB ) uerror( "illegal continue");
-                           else branch( contlab );
-                           flostat |= FCONT;
-                           goto rch;
-                           }
-               |  RETURN  SM
-                       ={  retstat |= NRETVAL;
-                           branch( retlab );
-                       rch:
-                           if( !reached ) werror( "statement not reached");
-                           reached = 0;
-                           }
-               |  RETURN e  SM
-                       ={  register NODE *temp;
-                           idname = curftn;
-                           temp = buildtree( NAME, NIL, NIL );
-                           temp->type = DECREF( temp->type );
-                           temp = buildtree( RETURN, temp, $2 );
-                           /* now, we have the type of the RHS correct */
-                           temp->left->op = FREE;
-                           temp->op = FREE;
-                           ecomp( buildtree( FORCE, temp->right, NIL ) );
-                           retstat |= RETVAL;
-                           branch( retlab );
-                           reached = 0;
-                           }
-               |  GOTO NAME SM
-                       ={  register NODE *q;
-                           q = block( FREE, NIL, NIL, INT|ARY, 0, INT );
-                           q->rval = idname = $2;
-                           defid( q, ULABEL );
-                           stab[idname].suse = -lineno;
-                           branch( stab[idname].offset );
-                           goto rch;
-                           }
-               |   SM
-               |  error  SM
-               |  error RC
-               |  label statement
-               ;
-label:            NAME COLON
-                       ={  register NODE *q;
-                           q = block( FREE, NIL, NIL, INT|ARY, 0, LABEL );
-                           q->rval = $1;
-                           defid( q, LABEL );
-                           reached = 1;
-                           }
-               |  CASE e COLON
-                       ={  addcase($2);
-                           reached = 1;
-                           }
-               |  DEFAULT COLON
-                       ={  reached = 1;
-                           adddef();
-                           flostat |= FDEF;
-                           }
-               ;
-doprefix:      DO
-                       ={  savebc();
-                           if( !reached ) werror( "loop not entered at top");
-                           brklab = getlab();
-                           contlab = getlab();
-                           deflab( $$ = getlab() );
-                           reached = 1;
-                           }
-               ;
-ifprefix:      IF LP e RP
-                       ={  ecomp( buildtree( CBRANCH, $3, bcon( $$=getlab()) ) ) ;
-                           reached = 1;
-                           }
-               ;
-ifelprefix:      ifprefix statement ELSE
-                       ={  if( reached ) branch( $$ = getlab() );
-                           else $$ = NOLAB;
-                           deflab( $1 );
-                           reached = 1;
-                           }
-               ;
-
-whprefix:        WHILE  LP  e  RP
-                       ={  savebc();
-                           if( !reached ) werror( "loop not entered at top");
-                           if( $3->op == ICON && $3->lval != 0 ) flostat = FLOOP;
-                           deflab( contlab = getlab() );
-                           reached = 1;
-                           brklab = getlab();
-                           if( flostat == FLOOP ) tfree( $3 );
-                           else ecomp( buildtree( CBRANCH, $3, bcon( brklab) ) );
-                           }
-               ;
-forprefix:       FOR  LP  .e  SM .e  SM 
-                       ={  if( $3 ) ecomp( $3 );
-                           else if( !reached ) werror( "loop not entered at top");
-                           savebc();
-                           contlab = getlab();
-                           brklab = getlab();
-                           deflab( $$ = getlab() );
-                           reached = 1;
-                           if( $5 ) ecomp( buildtree( CBRANCH, $5, bcon( brklab) ) );
-                           else flostat |= FLOOP;
-                           }
-               ;
-switchpart:       SWITCH  LP  e  RP
-                       ={  savebc();
-                           brklab = getlab();
-                           ecomp( buildtree( FORCE, $3, NIL ) );
-                           branch( $$ = getlab() );
-                           swstart();
-                           reached = 0;
-                           }
-               ;
-/*     EXPRESSIONS     */
-con_e:            { $<intval>$=instruct; stwart=instruct=0; } e
-                       %prec CM
-                       ={  $$ = icons( $2 );  instruct=$<intval>1; }
-               ;
-.e:               e
-               |
-                       ={ $$=0; }
-               ;
-elist:            e
-                       %prec CM
-               |  elist  CM  e
-                       ={  goto bop; }
-               ;
-
-e:                e RELOP e
-                       ={
-                       preconf:
-                           if( yychar==RELOP||yychar==EQUOP||yychar==AND||yychar==OR||yychar==ER ){
-                           precplaint:
-                               if( hflag ) werror( "precedence confusion possible: parenthesize!" );
-                               }
-                       bop:
-                           $$ = buildtree( $2, $1, $3 );
-                           }
-               |  e CM e
-                       ={  $2 = COMOP;
-                           goto bop;
-                           }
-               |  e DIVOP e
-                       ={  goto bop; }
-               |  e PLUS e
-                       ={  if(yychar==SHIFTOP) goto precplaint; else goto bop; }
-               |  e MINUS e
-                       ={  if(yychar==SHIFTOP ) goto precplaint; else goto bop; }
-               |  e SHIFTOP e
-                       ={  if(yychar==PLUS||yychar==MINUS) goto precplaint; else goto bop; }
-               |  e MUL e
-                       ={  goto bop; }
-               |  e EQUOP  e
-                       ={  goto preconf; }
-               |  e AND e
-                       ={  if( yychar==RELOP||yychar==EQUOP ) goto preconf;  else goto bop; }
-               |  e OR e
-                       ={  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; }
-               |  e ER e
-                       ={  if(yychar==RELOP||yychar==EQUOP) goto preconf; else goto bop; }
-               |  e ANDAND e
-                       ={  goto bop; }
-               |  e OROR e
-                       ={  goto bop; }
-               |  e MUL ASSIGN e
-                       ={  abop:
-                               $$ = buildtree( ASG $2, $1, $4 );
-                               }
-               |  e DIVOP ASSIGN e
-                       ={  goto abop; }
-               |  e PLUS ASSIGN e
-                       ={  goto abop; }
-               |  e MINUS ASSIGN e
-                       ={  goto abop; }
-               |  e SHIFTOP ASSIGN e
-                       ={  goto abop; }
-               |  e AND ASSIGN e
-                       ={  goto abop; }
-               |  e OR ASSIGN e
-                       ={  goto abop; }
-               |  e ER ASSIGN e
-                       ={  goto abop; }
-               |  e QUEST e COLON e
-                       ={  $$=buildtree(QUEST, $1, buildtree( COLON, $3, $5 ) );
-                           }
-               |  e ASOP e
-                       ={  werror( "old-fashioned assignment operator" );  goto bop; }
-               |  e ASSIGN e
-                       ={  goto bop; }
-               |  term
-               ;
-term:             term INCOP
-                       ={  $$ = buildtree( $2, $1, bcon(1) ); }
-               |  MUL term
-                       ={ ubop:
-                           $$ = buildtree( UNARY $1, $2, NIL );
-                           }
-               |  AND term
-                       ={  if( ISFTN($2->type) || ISARY($2->type) ){
-                               werror( "& before array or function: ignored" );
-                               $$ = $2;
-                               }
-                           else goto ubop;
-                           }
-               |  MINUS term
-                       ={  goto ubop; }
-               |  UNOP term
-                       ={
-                           $$ = buildtree( $1, $2, NIL );
-                           }
-               |  INCOP term
-                       ={  $$ = buildtree( $1==INCR ? ASG PLUS : ASG MINUS,
-                                               $2,
-                                               bcon(1)  );
-                           }
-               |  SIZEOF term
-                       ={  $$ = doszof( $2 ); }
-               |  LP cast_type RP term  %prec INCOP
-                       ={  $$ = buildtree( CAST, $2, $4 );
-                           $$->left->op = FREE;
-                           $$->op = FREE;
-                           $$ = $$->right;
-                           }
-               |  SIZEOF LP cast_type RP  %prec SIZEOF
-                       ={  $$ = doszof( $3 ); }
-               |  term LB e RB
-                       ={  $$ = buildtree( UNARY MUL, buildtree( PLUS, $1, $3 ), NIL ); }
-               |  funct_idn  RP
-                       ={  $$=buildtree(UNARY CALL,$1,NIL); }
-               |  funct_idn elist  RP
-                       ={  $$=buildtree(CALL,$1,$2); }
-               |  term STROP NAME
-                       ={  if( $2 == DOT ){
-                               $1 = buildtree( UNARY AND, $1, NIL );
-                               }
-                           idname = $3;
-                           $$ = buildtree( STREF, $1, buildtree( NAME, NIL, NIL ) );
-                           }
-               |  NAME
-                       ={  idname = $1;
-                           /* recognize identifiers in initializations */
-                           if( blevel==0 && stab[idname].stype == UNDEF ) {
-                               register NODE *q;
-                               werror( "undeclared initializer name %.8s", stab[idname].sname );
-                               q = block( FREE, NIL, NIL, INT, 0, INT );
-                               q->rval = idname;
-                               defid( q, EXTERN );
-                               }
-                           $$=buildtree(NAME,NIL,NIL);
-                           stab[$1].suse = -lineno;
-                       }
-               |  ICON
-                       ={  $$=bcon(0);
-                           $$->lval = lastcon;
-                           $$->rval = NONAME;
-                           if( $1 ) $$->csiz = $$->type = ctype(LONG);
-                           }
-               |  FCON
-                       ={  $$=buildtree(FCON,NIL,NIL);
-                           $$->dval = dcon;
-                           }
-               |  STRING
-                       ={  $$ = getstr(); /* get string contents */ }
-               |   LP  e  RP
-                       ={ $$=$2; }
-               ;
-
-cast_type:       type null_decl
-                       ={
-                       $$ = tymerge( $1, $2 );
-                       $$->op = NAME;
-                       $1->op = FREE;
-                       }
-               ;
-
-null_decl:        /* empty */
-                       ={ $$ = bdty( NAME, NIL, -1 ); }
-               |  LP RP
-                       ={ $$ = bdty( UNARY CALL, bdty(NAME,NIL,-1),0); }
-               |  LP null_decl RP LP RP
-                       ={  $$ = bdty( UNARY CALL, $2, 0 ); }
-               |  MUL null_decl
-                       ={  goto umul; }
-               |  null_decl LB RB
-                       ={  goto uary; }
-               |  null_decl LB con_e RB
-                       ={  goto bary;  }
-               |  LP null_decl RP
-                       ={ $$ = $2; }
-               ;
-
-funct_idn:        NAME  LP 
-                       ={  if( stab[$1].stype == UNDEF ){
-                               register NODE *q;
-                               q = block( FREE, NIL, NIL, FTN|INT, 0, INT );
-                               q->rval = $1;
-                               defid( q, EXTERN );
-                               }
-                           idname = $1;
-                           $$=buildtree(NAME,NIL,NIL);
-                           stab[idname].suse = -lineno;
-                       }
-               |  term  LP 
-               ;
-%%
-
-NODE *
-mkty( t, d, s ) unsigned t; {
-       return( block( TYPE, NIL, NIL, t, d, s ) );
-       }
-
-NODE *
-bdty( op, p, v ) NODE *p; {
-       register NODE *q;
-
-       q = block( op, p, NIL, INT, 0, INT );
-
-       switch( op ){
-
-       case UNARY MUL:
-       case UNARY CALL:
-               break;
-
-       case LB:
-               q->right = bcon(v);
-               break;
-
-       case NAME:
-               q->rval = v;
-               break;
-
-       default:
-               cerror( "bad bdty" );
-               }
-
-       return( q );
-       }
-
-dstash( n ){ /* put n into the dimension table */
-       if( curdim >= DIMTABSZ-1 ){
-               cerror( "dimension table overflow");
-               }
-       dimtab[ curdim++ ] = n;
-       }
-
-savebc() {
-       if( psavbc > & asavbc[BCSZ-4 ] ){
-               cerror( "whiles, fors, etc. too deeply nested");
-               }
-       *psavbc++ = brklab;
-       *psavbc++ = contlab;
-       *psavbc++ = flostat;
-       *psavbc++ = swx;
-       flostat = 0;
-       }
-
-resetbc(mask){
-
-       swx = *--psavbc;
-       flostat = *--psavbc | (flostat&mask);
-       contlab = *--psavbc;
-       brklab = *--psavbc;
-
-       }
-
-addcase(p) NODE *p; { /* add case to switch */
-
-       p = optim( p );  /* change enum to ints */
-       if( p->op != ICON ){
-               uerror( "non-constant case expression");
-               return;
-               }
-       if( swp == swtab ){
-               uerror( "case not in switch");
-               return;
-               }
-       if( swp >= &swtab[SWITSZ] ){
-               cerror( "switch table overflow");
-               }
-       swp->sval = p->lval;
-       deflab( swp->slab = getlab() );
-       ++swp;
-       tfree(p);
-       }
-
-adddef(){ /* add default case to switch */
-       if( swtab[swx].slab >= 0 ){
-               uerror( "duplicate default in switch");
-               return;
-               }
-       if( swp == swtab ){
-               uerror( "default not inside switch");
-               return;
-               }
-       deflab( swtab[swx].slab = getlab() );
-       }
-
-swstart(){
-       /* begin a switch block */
-       if( swp >= &swtab[SWITSZ] ){
-               cerror( "switch table overflow");
-               }
-       swx = swp - swtab;
-       swp->slab = -1;
-       ++swp;
-       }
-
-swend(){ /* end a switch block */
-
-       register struct sw *swbeg, *p, *q, *r, *r1;
-       CONSZ temp;
-       int tempi;
-
-       swbeg = &swtab[swx+1];
-
-       /* sort */
-
-       r1 = swbeg;
-       r = swp-1;
-
-       while( swbeg < r ){
-               /* bubble largest to end */
-               for( q=swbeg; q<r; ++q ){
-                       if( q->sval > (q+1)->sval ){
-                               /* swap */
-                               r1 = q+1;
-                               temp = q->sval;
-                               q->sval = r1->sval;
-                               r1->sval = temp;
-                               tempi = q->slab;
-                               q->slab = r1->slab;
-                               r1->slab = tempi;
-                               }
-                       }
-               r = r1;
-               r1 = swbeg;
-               }
-
-       /* it is now sorted */
-
-       for( p = swbeg+1; p<swp; ++p ){
-               if( p->sval == (p-1)->sval ){
-                       uerror( "duplicate case in switch, %d", tempi=p->sval );
-                       return;
-                       }
-               }
-
-       genswitch( swbeg-1, swp-swbeg );
-       swp = swbeg-1;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/comm1.c b/.ref-Research-V7/usr/src/cmd/mip/comm1.c
deleted file mode 100644 (file)
index ed05ba5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# include "mfile1"
-
-# include "common"
-
diff --git a/.ref-Research-V7/usr/src/cmd/mip/common b/.ref-Research-V7/usr/src/cmd/mip/common
deleted file mode 100644 (file)
index cd6cb4b..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-# ifndef EXIT
-# define EXIT exit
-# endif
-
-int nerrors = 0;  /* number of errors */
-
-NODE *NIL;  /* pointer which always has 0 in it */
-
-NODE *lastfree;  /* pointer to last free node; (for allocator) */
-
-       /* VARARGS1 */
-uerror( s, a ) char *s; { /* nonfatal error message */
-       /* the routine where is different for pass 1 and pass 2;
-       /*  it tells where the error took place */
-
-       ++nerrors;
-       where('u');
-       fprintf( stderr, s, a );
-       fprintf( stderr, "\n" );
-       if( nerrors > 30 ) cerror( "too many errors");
-       }
-
-       /* VARARGS1 */
-cerror( s, a, b, c ) char *s; { /* compiler error: die */
-       where('c');
-       if( nerrors && nerrors <= 30 ){ /* give the compiler the benefit of the doubt */
-               fprintf( stderr, "cannot recover from earlier errors: goodbye!\n" );
-               }
-       else {
-               fprintf( stderr, "compiler error: " );
-               fprintf( stderr, s, a, b, c );
-               fprintf( stderr, "\n" );
-               }
-       EXIT(1);
-       }
-
-       /* VARARGS1 */
-werror( s, a, b ) char *s; {  /* warning */
-       where('w');
-       fprintf( stderr, "warning: " );
-       fprintf( stderr, s, a, b );
-       fprintf( stderr, "\n" );
-       }
-
-tinit(){ /* initialize expression tree search */
-
-       NODE *p;
-
-       for( p=node; p<= &node[TREESZ-1]; ++p ) p->op = FREE;
-       lastfree = node;
-
-       }
-
-# define TNEXT(p) (p== &node[TREESZ-1]?node:p+1)
-
-NODE *
-talloc(){
-       NODE *p, *q;
-
-       q = lastfree;
-       for( p = TNEXT(q); p!=q; p= TNEXT(p))
-               if( p->op ==FREE ) return(lastfree=p);
-
-       cerror( "out of tree space; simplify expression");
-       /* NOTREACHED */
-       }
-
-tcheck(){ /* ensure that all nodes have been freed */
-
-       NODE *p;
-
-       if( !nerrors )
-               for( p=node; p<= &node[TREESZ-1]; ++p )
-                       if( p->op != FREE ) cerror( "wasted space: %o", p );
-       tinit();
-       }
-tfree( p )  NODE *p; {
-       /* free the tree p */
-       extern tfree1();
-
-       if( p->op != FREE ) walkf( p, tfree1 );
-
-       }
-
-tfree1(p)  NODE *p; {
-       if( p == 0 ) cerror( "freeing blank tree!");
-       else p->op = FREE;
-       }
-
-fwalk( t, f, down ) register NODE *t; int (*f)(); {
-
-       int down1, down2;
-
-       more:
-       down1 = down2 = 0;
-
-       (*f)( t, down, &down1, &down2 );
-
-       switch( optype( t->op ) ){
-
-       case BITYPE:
-               fwalk( t->left, f, down1 );
-               t = t->right;
-               down = down2;
-               goto more;
-
-       case UTYPE:
-               t = t->left;
-               down = down1;
-               goto more;
-
-               }
-       }
-
-walkf( t, f ) register NODE *t;  int (*f)(); {
-       register opty;
-
-       opty = optype(t->op);
-
-       if( opty != LTYPE ) walkf( t->left, f );
-       if( opty == BITYPE ) walkf( t->right, f );
-       (*f)( t );
-       }
-
-
-
-int dope[ DSIZE ];
-char *opst[DSIZE];
-
-struct dopest { int dopeop; char opst[8]; int dopeval; } indope[] = {
-
-       NAME, "NAME", LTYPE,
-       STRING, "STRING", LTYPE,
-       REG, "REG", LTYPE,
-       OREG, "OREG", LTYPE,
-       ICON, "ICON", LTYPE,
-       FCON, "FCON", LTYPE,
-       CCODES, "CCODES", LTYPE,
-       UNARY MINUS, "U-", UTYPE,
-       UNARY MUL, "U*", UTYPE,
-       UNARY AND, "U&", UTYPE,
-       UNARY CALL, "UCALL", UTYPE|CALLFLG,
-       UNARY FORTCALL, "UFCALL", UTYPE|CALLFLG,
-       NOT, "!", UTYPE|LOGFLG,
-       COMPL, "~", UTYPE,
-       FORCE, "FORCE", UTYPE,
-       INIT, "INIT", UTYPE,
-       SCONV, "SCONV", UTYPE,
-       PCONV, "PCONV", UTYPE,
-       PLUS, "+", BITYPE|FLOFLG|SIMPFLG|COMMFLG,
-       ASG PLUS, "+=", BITYPE|ASGFLG|ASGOPFLG|FLOFLG|SIMPFLG|COMMFLG,
-       MINUS, "-", BITYPE|FLOFLG|SIMPFLG,
-       ASG MINUS, "-=", BITYPE|FLOFLG|SIMPFLG|ASGFLG|ASGOPFLG,
-       MUL, "*", BITYPE|FLOFLG|MULFLG,
-       ASG MUL, "*=", BITYPE|FLOFLG|MULFLG|ASGFLG|ASGOPFLG,
-       AND, "&", BITYPE|SIMPFLG|COMMFLG,
-       ASG AND, "&=", BITYPE|SIMPFLG|COMMFLG|ASGFLG|ASGOPFLG,
-       QUEST, "?", BITYPE,
-       COLON, ":", BITYPE,
-       ANDAND, "&&", BITYPE|LOGFLG,
-       OROR, "||", BITYPE|LOGFLG,
-       CM, ",", BITYPE,
-       COMOP, ",OP", BITYPE,
-       ASSIGN, "=", BITYPE|ASGFLG,
-       DIV, "/", BITYPE|FLOFLG|MULFLG|DIVFLG,
-       ASG DIV, "/=", BITYPE|FLOFLG|MULFLG|DIVFLG|ASGFLG|ASGOPFLG,
-       MOD, "%", BITYPE|DIVFLG,
-       ASG MOD, "%=", BITYPE|DIVFLG|ASGFLG|ASGOPFLG,
-       LS, "<<", BITYPE|SHFFLG,
-       ASG LS, "<<=", BITYPE|SHFFLG|ASGFLG|ASGOPFLG,
-       RS, ">>", BITYPE|SHFFLG,
-       ASG RS, ">>=", BITYPE|SHFFLG|ASGFLG|ASGOPFLG,
-       OR, "|", BITYPE|COMMFLG|SIMPFLG,
-       ASG OR, "|=", BITYPE|COMMFLG|SIMPFLG|ASGFLG|ASGOPFLG,
-       ER, "^", BITYPE|COMMFLG|SIMPFLG,
-       ASG ER, "^=", BITYPE|COMMFLG|SIMPFLG|ASGFLG|ASGOPFLG,
-       INCR, "++", BITYPE|ASGFLG,
-       DECR, "--", BITYPE|ASGFLG,
-       STREF, "->", BITYPE,
-       CALL, "CALL", BITYPE|CALLFLG,
-       FORTCALL, "FCALL", BITYPE|CALLFLG,
-       EQ, "==", BITYPE|LOGFLG,
-       NE, "!=", BITYPE|LOGFLG,
-       LE, "<=", BITYPE|LOGFLG,
-       LT, "<", BITYPE|LOGFLG,
-       GE, ">", BITYPE|LOGFLG,
-       GT, ">", BITYPE|LOGFLG,
-       UGT, "UGT", BITYPE|LOGFLG,
-       UGE, "UGE", BITYPE|LOGFLG,
-       ULT, "ULT", BITYPE|LOGFLG,
-       ULE, "ULE", BITYPE|LOGFLG,
-       ARS, "A>>", BITYPE,
-       TYPE, "TYPE", LTYPE,
-       LB, "[", BITYPE,
-       CBRANCH, "CBRANCH", BITYPE,
-       FLD, "FLD", UTYPE,
-       PMCONV, "PMCONV", BITYPE,
-       PVCONV, "PVCONV", BITYPE,
-       RETURN, "RETURN", BITYPE|ASGFLG|ASGOPFLG,
-       CAST, "CAST", BITYPE|ASGFLG|ASGOPFLG,
-       GOTO, "GOTO", UTYPE,
-       STASG, "STASG", BITYPE|ASGFLG,
-       STARG, "STARG", UTYPE,
-       STCALL, "STCALL", BITYPE|CALLFLG,
-       UNARY STCALL, "USTCALL", UTYPE|CALLFLG,
-
--1,    0
-};
-
-mkdope(){
-       register struct dopest *q;
-
-       for( q = indope; q->dopeop >= 0; ++q ){
-               dope[q->dopeop] = q->dopeval;
-               opst[q->dopeop] = q->opst;
-               }
-       }
-tprint( t )  TWORD t; { /* output a nice description of the type of t */
-
-       static char * tnames[] = {
-               "undef",
-               "farg",
-               "char",
-               "short",
-               "int",
-               "long",
-               "float",
-               "double",
-               "strty",
-               "unionty",
-               "enumty",
-               "moety",
-               "uchar",
-               "ushort",
-               "unsigned",
-               "ulong",
-               "?", "?"
-               };
-
-       for(;; t = DECREF(t) ){
-
-               if( ISPTR(t) ) printf( "PTR " );
-               else if( ISFTN(t) ) printf( "FTN " );
-               else if( ISARY(t) ) printf( "ARY " );
-               else {
-                       printf( "%s", tnames[t] );
-                       return;
-                       }
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/convert b/.ref-Research-V7/usr/src/cmd/mip/convert
deleted file mode 100644 (file)
index 179bea1..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-To convert two pass to 1 pass operation:
-(I suggest that you use a subdirectory, since
-it is hard to repair some of this damage once done)
-
-I assume that you have new copies of the machine-independent
-files.  The file cl is no longer used, and there is no
-use of lex at all.  The file scan.c contains the new
-lexical analyzer.  Moreover, the file comm2.c is no longer
-used when the passes are loaded together.
-These changes may affect local procedures for searching, printing,
-diffing, etc. the compiler.
-
-I suggest that you take the makefile in /usr/n as well, to help you
-along.
-
-The conversion process, as well as I understand it is as follows.
-
-1.  Make a subdirectory, and put in it the old machine dependent files
-macdefs, mac2defs, local.c, order.c, code.c, local2.c, and table.c.
-Put in all the new machine independent stuff, including the new makefile
-
-2.  Insert the line # define ONEPASS into macdefs
-Change LABFMT by deleting the \n.
-
-3.  In all the machine dependent source files local.c,
-code.c, order.c, local2.c, and table.c, remove the includes of
-manifest and macdefs; these are now included by mfile1 and mfile2.
-
-4.  The main routine for pass 2 (probably on local2.c)
-should be deleted; it probably only does a call to mainp2.
-If it does anything else of interest,
-let me know.
-
-5.  On the file local.c, in the routine `ecode',
-replace the lines
-     printf( ".%d\t%s\n", lineno, ftitle );
-     prtree( p );
-by
-     p2tree( p );
-     p2compile( p );
-
-6.  In code.c, in the function bccode, replace the line
-     printf( "[\t%d\t%d\t%d\t\n", ftnno, XXXX, YYYY );
-by
-     p2bbeg( XXXX, YYYY );
-Also, in efcode, replace the line which prints out the "]..."
-with
-     p2bend();
-
-7.  In code.c and local.c, look at all remaining printfs.  Lines
-which go onto the intermediate file all had ")" at the head.
-All of these must be clobbered.  Thus, a line which read
-     printf( ")    xxx yyy\n)   zzz  www\n" );
-must be changed to read
-     printf( "    xxx yyy\n   zzz  www\n" );
-This is tedious, although a few cleverly chosen ed commands
-will probably do the trick.
-
-8.  Say make, and stand back.  The result is a
-single program called comp.
-You may experience loading errors as a result of having used the
-same external names in the first and second pass.  Look at the
-beginning of mfile2 to get a hint about one way to deal with
-this problem (add stuff to mac2defs to change the names).
-The other way to deal with it is just fix it...
-
-9.  As a side-effect of other changes, the meaning of the arguments
-to match has changed slightly; ASG OPANY, as it always
-did, matches any assignment op except ++, --, and = itself.
-OPANY, on the other hand, matches only ops which are not assignment
-ops.  In table.c, there must be explicit rewriting rule entries for
-++, --, and =.  In most cases with which I am familiar, this should
-be true already, and no change is needed.
-
-10. Usage is  /lib/cpp x.c | comp
-which produces assembler output on the std. output.
-research!/usr/bin/ncc gives the interdata compiler, with many
-bells and whistles, as a Bourne shell script.
-regression tests, and checks that this compiler
-produces the same output as the earlier one, are
-both wise.
-
-Good Luck!
diff --git a/.ref-Research-V7/usr/src/cmd/mip/fallo.c b/.ref-Research-V7/usr/src/cmd/mip/fallo.c
deleted file mode 100644 (file)
index 4bed17b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# define FORT
-# include "allo.c"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/fcomm2.c b/.ref-Research-V7/usr/src/cmd/mip/fcomm2.c
deleted file mode 100644 (file)
index 6515439..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# define FORT
-# include "mfile2"
-# include "common"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/fconvert b/.ref-Research-V7/usr/src/cmd/mip/fconvert
deleted file mode 100644 (file)
index 6a0a02b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-In an attempt to speed up the Fortran 77
-compiler, we have provided a new interface between
-the fortran compiler and the portable C compiler.
-The intermediate file is binary, and the result is
-to speed up the execution of Fortran considerably.
-The changes necessary to make this work are as follows:
-
-***    The ONEPASS flag should be off for Fortran;
-       the simplest way of making this happen is to take
-       the line # define ONEPASS on macdefs, and put a
-       # ifndef FORT ... # endif around it.
-
-***    The function label from pass 1 must be put in
-       a file, fort.h.  Also,  a simple function, tlabel,
-       must be written to copy names and make labels.
-
-***    The function `where' must be defined, as well as the
-       function main (which was once on local2.c).
-       They can be defined on fort.h, or on local2.c
-       (surrounded by # ifnded ONEPASS and # endif)
-
-***    Other things from pass one may have crept into the pass 2
-       code: they must be also done, either on fort.h or
-       on local2.c surrounded by ifdefs.
-
-***    make fort  then creates the fortran interface...
-
diff --git a/.ref-Research-V7/usr/src/cmd/mip/flocal2.c b/.ref-Research-V7/usr/src/cmd/mip/flocal2.c
deleted file mode 100644 (file)
index a36e77b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# define FORT
-# include "local2.c"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/fmatch.c b/.ref-Research-V7/usr/src/cmd/mip/fmatch.c
deleted file mode 100644 (file)
index 76ff408..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# define FORT
-# include "match.c"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/forder.c b/.ref-Research-V7/usr/src/cmd/mip/forder.c
deleted file mode 100644 (file)
index 0853117..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# define FORT
-# include "order.c"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/fort.c b/.ref-Research-V7/usr/src/cmd/mip/fort.c
deleted file mode 100644 (file)
index ad2d56c..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-# define FORT
-/* this forces larger trees, etc. */
-# include "mfile2"
-# include "fort.h"
-
-/*     masks for unpacking longs */
-
-# ifndef FOP
-# define FOP(x) (int)((x)&0377)
-# endif
-
-# ifndef VAL
-# define VAL(x) (int)(((x)>>8)&0377)
-# endif
-
-# ifndef REST
-# define REST(x) (((x)>>16)&0177777)
-# endif
-
-FILE * lrd;  /* for default reading routines */
-# ifndef NOLREAD
-long lread(){
-       static long x;
-       if( fread( (char *) &x, 4, 1, lrd ) <= 0 ) cerror( "intermediate file read error" );
-       return( x );
-       }
-# endif
-
-# ifndef NOLOPEN
-lopen( s ) char *s; {
-       /* if null, opens the standard input */
-       if( *s ){
-               lrd = fopen( s, "r" );
-               if( lrd == NULL ) cerror( "cannot open intermediate file %s", s );
-               }
-       else  lrd = stdin;
-       }
-# endif
-
-# ifndef NOLCREAD
-lcread( cp, n ) char *cp; {
-       if( n > 0 ){
-               if( fread( cp, 4, n, lrd ) != n ) cerror( "intermediate file read error" );
-               }
-       }
-# endif
-
-# ifndef NOLCCOPY
-lccopy( n ) register n; {
-       register i;
-       static char fbuf[128];
-       if( n > 0 ){
-               if( n > 32 ) cerror( "lccopy asked to copy too much" );
-               if( fread( fbuf, 4, n, lrd ) != n ) cerror( "intermediate file read error" );
-               for( i=4*n; fbuf[i-1] == '\0' && i>0; --i ) { /* VOID */ }
-               if( i ) {
-                       if( fwrite( fbuf, 1, i, stdout ) != i ) cerror( "output file error" );
-                       }
-               }
-       }
-# endif
-
-/*     new opcode definitions */
-
-# define FORTOPS 200
-# define FTEXT 200
-# define FEXPR 201
-# define FSWITCH 202
-# define FLBRAC 203
-# define FRBRAC 204
-# define FEOF 205
-# define FARIF 206
-# define LABEL 207
-
-/*     stack for reading nodes in postfix form */
-
-# define NSTACKSZ 250
-
-NODE * fstack[NSTACKSZ];
-NODE ** fsp;  /* points to next free position on the stack */
-
-mainp2( argc, argv ) char *argv[]; {
-       int files;
-       register long x;
-       register NODE *p;
-
-       files = p2init( argc, argv );
-       tinit();
-
-               
-       if( files ){
-               while( files < argc && argv[files][0] == '-' ) {
-                       ++files;
-                       }
-               if( files > argc ) return( nerrors );
-               lopen( argv[files] );
-               }
-       else lopen( "" );
-
-       fsp = fstack;
-
-       for(;;){
-               /* read nodes, and go to work... */
-               x = lread();
-
-       if( xdebug ) fprintf( stderr, "op=%d, val = %d, rest = 0%o\n", FOP(x), VAL(x), (int)REST(x) );
-               switch( (int)FOP(x) ){  /* switch on opcode */
-
-               case 0:
-                       fprintf( stderr, "null opcode ignored\n" );
-                       continue;
-               case FTEXT:
-                       lccopy( VAL(x) );
-                       printf( "\n" );
-                       continue;
-
-               case FLBRAC:
-                       tmpoff = baseoff = lread();
-                       maxtreg = VAL(x);
-                       if( ftnno != REST(x) ){
-                               /* beginning of function */
-                               maxoff = baseoff;
-                               ftnno = REST(x);
-                               maxtemp = 0;
-                               }
-                       else {
-                               if( baseoff > maxoff ) maxoff = baseoff;
-                               /* maxoff at end of ftn is max of autos and temps 
-                                  over all blocks in the function */
-                               }
-                       setregs();
-                       continue;
-
-               case FRBRAC:
-                       SETOFF( maxoff, ALSTACK );
-                       eobl2();
-                       continue;
-
-               case FEOF:
-                       return( nerrors );
-
-               case FSWITCH:
-                       uerror( "switch not yet done" );
-                       for( x=VAL(x); x>0; --x ) lread();
-                       continue;
-
-               case ICON:
-                       p = talloc();
-                       p->op = ICON;
-                       p->type = REST(x);
-                       p->rval = 0;
-                       p->lval = lread();
-                       if( VAL(x) ){
-                               lcread( p->name, 2 );
-                               }
-                       else p->name[0] = '\0';
-
-               bump:
-                       p->su = 0;
-                       p->rall = NOPREF;
-                       *fsp++ = p;
-                       if( fsp >= &fstack[NSTACKSZ] ) uerror( "expression depth exceeded" );
-                       continue;
-
-               case NAME:
-                       p = talloc();
-                       p->op = NAME;
-                       p->type = REST(x);
-                       p->rval = 0;
-                       if( VAL(x) ) p->lval = lread();
-                       else p->lval = 0;
-                       lcread( p->name, 2 );
-                       goto bump;
-
-               case OREG:
-                       p = talloc();
-                       p->op = OREG;
-                       p->type = REST(x);
-                       p->rval = VAL(x);
-                       p->lval = lread();
-                       lcread( p->name, 2 );
-                       goto bump;
-
-               case REG:
-                       p = talloc();
-                       p->op = REG;
-                       p->type = REST(x);
-                       p->rval = VAL(x);
-                       rbusy( p->rval, p->type );
-                       p->lval = 0;
-                       p->name[0] = '\0';
-                       goto bump;
-
-               case FEXPR:
-                       lineno = REST(x);
-                       if( VAL(x) ) lcread( filename, VAL(x) );
-                       if( fsp == fstack ) continue;  /* filename only */
-                       if( --fsp != fstack ) uerror( "expression poorly formed" );
-                       if( lflag ) lineid( lineno, filename );
-                       tmpoff = baseoff;
-                       p = fstack[0];
-                       if( edebug ) fwalk( p, eprint, 0 );
-# ifdef MYREADER
-                       MYREADER(p);
-# endif
-
-                       nrecur = 0;
-                       delay( p );
-                       reclaim( p, RNULL, 0 );
-
-                       allchk();
-                       tcheck();
-                       continue;
-
-               case LABEL:
-                       if( VAL(x) ){
-                               tlabel();
-                               }
-                       else {
-                               label( (int) REST(x) );
-                               }
-                       continue;
-
-               case GOTO:
-                       if( VAL(x) ) {
-                               cbgen( 0, (int) REST(x), 'I' );  /* unconditional branch */
-                               continue;
-                               }
-                       /* otherwise, treat as unary */
-                       goto def;
-
-               default:
-               def:
-                       p = talloc();
-                       p->op = FOP(x);
-                       p->type = REST(x);
-
-                       switch( optype( p->op ) ){
-
-                       case BITYPE:
-                               p->right = *--fsp;
-                               p->left = *--fsp;
-                               goto bump;
-
-                       case UTYPE:
-                               p->left = *--fsp;
-                               p->rval = 0;
-                               goto bump;
-
-                       case LTYPE:
-                               uerror( "illegal leaf node: %d", p->op );
-                               exit( 1 );
-                               }
-                       }
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/freader.c b/.ref-Research-V7/usr/src/cmd/mip/freader.c
deleted file mode 100644 (file)
index 205b14b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# define FORT
-# define NOMAIN
-# include "reader.c"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/ftable.c b/.ref-Research-V7/usr/src/cmd/mip/ftable.c
deleted file mode 100644 (file)
index 95809a5..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# define FORT
-# include "table.c"
diff --git a/.ref-Research-V7/usr/src/cmd/mip/g b/.ref-Research-V7/usr/src/cmd/mip/g
deleted file mode 100755 (executable)
index 1f7fa9d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-grep -n "$1" macdefs code.c local.c mac2defs local2.c order.c table.c
-cd /usr/src/cmd/mip;grep -n "$1" manifest mfile1 cgram.y comm1.c scan.c xdefs.c pftn.c trees.c mfile2 reader.c allo.c match.c  common optim.c
diff --git a/.ref-Research-V7/usr/src/cmd/mip/makefile b/.ref-Research-V7/usr/src/cmd/mip/makefile
deleted file mode 100644 (file)
index f33460b..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-INSTALL=./ccom
-M=/usr/src/cmd/mip
-CFLAGS=-O
-head:  comp ;
-
-all cp cmp:
-       @echo "This makefile is just a prototype for a portable"
-       @echo "C compiler-- it isn't used for an existing command"
-
-comp: cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o reader.o local2.o order.o match.o allo.o comm1.o table.o
-       cc $(CFLAGS) -i cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o  reader.o local2.o order.o match.o allo.o comm1.o table.o
-       mv a.out comp
-trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c
-       cc -c $(CFLAGS) -I$M -I. $M/trees.c
-optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c
-       cc -c $(CFLAGS) -I$M -I. $M/optim.c
-pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c
-       cc -c $(CFLAGS) -I$M -I. $M/pftn.c
-code.o: $M/manifest macdefs $M/mfile1
-       cc -c $(CFLAGS) -I$M -I. code.c
-local.o: $M/manifest macdefs $M/mfile1
-       cc -c $(CFLAGS) -I$M -I. local.c
-scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c
-       cc -c $(CFLAGS) -I$M -I. $M/scan.c
-xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c
-       cc -c $(CFLAGS) -I$M -I. $M/xdefs.c
-cgram.o: $M/manifest $M/mfile1 macdefs $M/cgram.c
-       cc -c $(CFLAGS) -I$M -I. $M/cgram.c
-$M/cgram.c: $M/cgram.y
-       yacc $M/cgram.y
-       mv y.tab.c $M/cgram.c
-comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c
-       cc -c $(CFLAGS) -I. -I$M $M/comm1.c
-table.o: $M/manifest $M/mfile2 mac2defs macdefs table.c
-       cc -c $(CFLAGS) -I$M -I. table.c
-reader.o: $M/manifest $M/mfile2 mac2defs macdefs $M/reader.c
-       cc -c $(CFLAGS) -I$M -I. $M/reader.c
-local2.o: $M/manifest $M/mfile2 mac2defs macdefs
-       cc -c $(CFLAGS) -I$M -I. local2.c
-order.o: $M/manifest $M/mfile2 mac2defs macdefs
-       cc -c $(CFLAGS) -I$M -I. order.c
-match.o: $M/manifest $M/mfile2 mac2defs macdefs $M/match.c
-       cc -c $(CFLAGS) -I$M -I. $M/match.c
-allo.o: $M/manifest $M/mfile2 mac2defs macdefs $M/allo.c
-       cc -c $(CFLAGS) -I$M -I. $M/allo.c
-shrink:
-       rm *.o comp
-lintall:
-       lint -hpv -I. -I$M  $M/cgram.c $M/xdefs.c $M/scan.c $M/pftn.c $M/trees.c $M/optim.c code.c local.c $M/reader.c local2.c order.c $M/match.c $M/allo.c $M/comm1.c table.c
-fort: comp fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o
-       cc -i $(CFLAGS) fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o
-       mv a.out fort
-fort.o: fort.h $M/fort.c
-       cc -c $(CFLAGS) -I$M -I. $M/fort.c
-freader.o: reader.o
-       cc -c $(CFLAGS) -I$M -I. $M/freader.c
-fallo.o: allo.o
-       cc -c $(CFLAGS) -I$M -I. $M/fallo.c
-fmatch.o: match.o
-       cc -c $(CFLAGS) -I$M -I. $M/fmatch.c
-ftable.o: table.o
-       cc -c $(CFLAGS) -I$M -I. $M/ftable.c
-forder.o: order.o
-       cc -c $(CFLAGS) -I$M -I. $M/forder.c
-flocal2.o: local2.o
-       cc -c $(CFLAGS) -I$M -I. $M/flocal2.c
-fcomm2.o: $M/common
-       cc -c $(CFLAGS) -I$M -I. $M/fcomm2.c
-fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o: $M/mfile2 $M/manifest macdefs mac2defs
-install:
-       cp comp $(INSTALL)
diff --git a/.ref-Research-V7/usr/src/cmd/mip/manifest b/.ref-Research-V7/usr/src/cmd/mip/manifest
deleted file mode 100644 (file)
index 7711a29..0000000
+++ /dev/null
@@ -1,318 +0,0 @@
-
-# include <stdio.h>
-/*     manifest constant file for the lex/yacc interface */
-
-# define ERROR 1
-# define NAME 2
-# define STRING 3
-# define ICON 4
-# define FCON 5
-# define PLUS 6
-# define MINUS 8
-# define MUL 11
-# define AND 14
-# define OR 17
-# define ER 19
-# define QUEST 21
-# define COLON 22
-# define ANDAND 23
-# define OROR 24
-
-/*     special interfaces for yacc alone */
-/*     These serve as abbreviations of 2 or more ops:
-       ASOP    =, = ops
-       RELOP   LE,LT,GE,GT
-       EQUOP   EQ,NE
-       DIVOP   DIV,MOD
-       SHIFTOP LS,RS
-       ICOP    ICR,DECR
-       UNOP    NOT,COMPL
-       STROP   DOT,STREF
-
-       */
-# define ASOP 25
-# define RELOP 26
-# define EQUOP 27
-# define DIVOP 28
-# define SHIFTOP 29
-# define INCOP 30
-# define UNOP 31
-# define STROP 32
-
-/*     reserved words, etc */
-# define TYPE 33
-# define CLASS 34
-# define STRUCT 35
-# define RETURN 36
-# define GOTO 37
-# define IF 38
-# define ELSE 39
-# define SWITCH 40
-# define BREAK 41
-# define CONTINUE 42
-# define WHILE 43
-# define DO 44
-# define FOR 45
-# define DEFAULT 46
-# define CASE 47
-# define SIZEOF 48
-# define ENUM 49
-
-
-/*     little symbols, etc. */
-/*     namely,
-
-       LP      (
-       RP      )
-
-       LC      {
-       RC      }
-
-       LB      [
-       RB      ]
-
-       CM      ,
-       SM      ;
-
-       */
-
-# define LP 50
-# define RP 51
-# define LC 52
-# define RC 53
-# define LB 54
-# define RB 55
-# define CM 56
-# define SM 57
-# define ASSIGN 58
-
-/*     END OF YACC */
-
-/*     left over tree building operators */
-# define COMOP 59
-# define DIV 60
-# define MOD 62
-# define LS 64
-# define RS 66
-# define DOT 68
-# define STREF 69
-# define CALL 70
-# define FORTCALL 73
-# define NOT 76
-# define COMPL 77
-# define INCR 78
-# define DECR 79
-# define EQ 80
-# define NE 81
-# define LE 82
-# define LT 83
-# define GE 84
-# define GT 85
-# define ULE 86
-# define ULT 87
-# define UGE 88
-# define UGT 89
-# define SETBIT 90
-# define TESTBIT 91
-# define RESETBIT 92
-# define ARS 93
-# define REG 94
-# define OREG 95
-# define CCODES 96
-# define FREE 97
-# define STASG 98
-# define STARG 99
-# define STCALL 100
-
-/*     some conversion operators */
-# define FLD 103
-# define SCONV 104
-# define PCONV 105
-# define PMCONV 106
-# define PVCONV 107
-
-/*     special node operators, used for special contexts */
-# define FORCE 108
-# define CBRANCH 109
-# define INIT 110
-# define CAST 111
-
-/*     node types */
-# define LTYPE 02
-# define UTYPE 04
-# define BITYPE 010
-
-       /* DSIZE is the size of the dope array */
-# define DSIZE CAST+1
-
-/*     type names, used in symbol table building */
-# define TNULL PTR    /* pointer to UNDEF */
-# define UNDEF 0
-# define FARG 1
-# define CHAR 2
-# define SHORT 3
-# define INT 4
-# define LONG 5
-# define FLOAT 6
-# define DOUBLE 7
-# define STRTY 8
-# define UNIONTY 9
-# define ENUMTY 10
-# define MOETY 11
-# define UCHAR 12
-# define USHORT 13
-# define UNSIGNED 14
-# define ULONG 15
-
-# define ASG 1+
-# define UNARY 2+
-# define NOASG (-1)+
-# define NOUNARY (-2)+
-
-/*     various flags */
-# define NOLAB (-1)
-
-/* type modifiers */
-
-# define PTR  020
-# define FTN  040
-# define ARY  060
-
-/* type packing constants */
-
-# define TMASK 060
-# define TMASK1 0300
-# define TMASK2  0360
-# define BTMASK 017
-# define BTSHIFT 4
-# define TSHIFT 2
-
-/*     macros  */
-
-# define MODTYPE(x,y) x = (x&(~BTMASK))|y  /* set basic type of x to y */
-# define BTYPE(x)  (x&BTMASK)   /* basic type of x */
-# define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR)
-# define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR)
-# define ENUNSIGN(x) ((x)+(UNSIGNED-INT))
-# define DEUNSIGN(x) ((x)+(INT-UNSIGNED))
-# define ISPTR(x) ((x&TMASK)==PTR)
-# define ISFTN(x)  ((x&TMASK)==FTN)  /* is x a function type */
-# define ISARY(x)   ((x&TMASK)==ARY)   /* is x an array type */
-# define INCREF(x) (((x&~BTMASK)<<TSHIFT)|PTR|(x&BTMASK))
-# define DECREF(x) (((x>>TSHIFT)&~BTMASK)|(x&BTMASK))
-# define SETOFF(x,y)   if( x%y != 0 ) x = ( (x/y + 1) * y)
-               /* advance x to a multiple of y */
-# define NOFIT(x,y,z)   ( (x%z + y) > z )
-               /* can y bits be added to x without overflowing z */
-       /* pack and unpack field descriptors (size and offset) */
-# define PKFIELD(s,o) ((o<<6)|s)
-# define UPKFSZ(v)  (v&077)
-# define UPKFOFF(v) (v>>6)
-
-/*     operator information */
-
-# define TYFLG 016
-# define ASGFLG 01
-# define LOGFLG 020
-
-# define SIMPFLG 040
-# define COMMFLG 0100
-# define DIVFLG 0200
-# define FLOFLG 0400
-# define LTYFLG 01000
-# define CALLFLG 02000
-# define MULFLG 04000
-# define SHFFLG 010000
-# define ASGOPFLG 020000
-
-# define SPFLG 040000
-
-#define optype(o) (dope[o]&TYFLG)
-#define asgop(o) (dope[o]&ASGFLG)
-#define logop(o) (dope[o]&LOGFLG)
-#define callop(o) (dope[o]&CALLFLG)
-
-/*     table sizes     */
-
-# define BCSZ 100 /* size of the table to save break and continue labels */
-# define SYMTSZ 450 /* size of the symbol table */
-# define DIMTABSZ 750 /* size of the dimension/size table */
-# define PARAMSZ 150 /* size of the parameter stack */
-# ifndef FORT
-# define TREESZ 350 /* space for building parse tree */
-# else
-# define TREESZ 1000
-# endif
-# define SWITSZ 250 /* size of switch table */
-
-# define NCHNAM 8  /* number of characters in a name */
-
-/*     common defined variables */
-
-extern int nerrors;  /* number of errors seen so far */
-
-typedef union ndu NODE;
-typedef unsigned int TWORD;
-extern NODE *NIL;  /* a pointer which will always have 0 in it */
-extern int dope[];  /* a vector containing operator information */
-extern char *opst[];  /* a vector containing names for ops */
-
-# ifdef ONEPASS
-       /* in one-pass operation, define the tree nodes */
-
-union ndu {
-
-       struct {
-               int op;
-               int rall;
-               TWORD type;
-               int su;
-               char name[NCHNAM];
-               NODE *left;
-               NODE *right;
-               };
-       
-       struct {
-               int op;
-               int rall;
-               TWORD type;
-               int su;
-               char name[NCHNAM];
-               CONSZ lval;
-               int rval;
-               };
-       
-       struct {
-               int op, rall;
-               TWORD type;
-               int su;
-               int label;  /* for use with branching */
-               };
-
-       struct {
-               int op, rall;
-               TWORD type;
-               int su;
-               int stsize;  /* sizes of structure objects */
-               int stalign;  /* alignment of structure objects */
-               };
-
-       struct {
-               int op;
-               int cdim;
-               TWORD type;
-               int csiz;
-               };
-       
-       struct {
-               /* this structure is used when a floating point constant
-                  is being computed */
-               int op;
-               int cdim;
-               TWORD type;
-               int csiz;
-               double dval;
-               };
-
-       };
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/mip/match.c b/.ref-Research-V7/usr/src/cmd/mip/match.c
deleted file mode 100644 (file)
index 701bce0..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-# include "mfile2"
-
-
-int fldsz, fldshf;
-
-static int mamask[] = { /* masks for matching dope with shapes */
-       SIMPFLG,                /* OPSIMP */
-       SIMPFLG|ASGFLG,         /* ASG OPSIMP */
-       COMMFLG,        /* OPCOMM */
-       COMMFLG|ASGFLG, /* ASG OPCOMM */
-       MULFLG,         /* OPMUL */
-       MULFLG|ASGFLG,  /* ASG OPMUL */
-       DIVFLG,         /* OPDIV */
-       DIVFLG|ASGFLG,  /* ASG OPDIV */
-       UTYPE,          /* OPUNARY */
-       TYFLG,          /* ASG OPUNARY is senseless */
-       LTYPE,          /* OPLEAF */
-       TYFLG,          /* ASG OPLEAF is senseless */
-       0,              /* OPANY */
-       ASGOPFLG|ASGFLG,        /* ASG OPANY */
-       LOGFLG,         /* OPLOG */
-       TYFLG,          /* ASG OPLOG is senseless */
-       FLOFLG,         /* OPFLOAT */
-       FLOFLG|ASGFLG,  /* ASG OPFLOAT */
-       SHFFLG,         /* OPSHFT */
-       SHFFLG|ASGFLG,  /* ASG OPSHIFT */
-       SPFLG,          /* OPLTYPE */
-       TYFLG,          /* ASG OPLTYPE is senseless */
-       };
-
-int sdebug = 0;
-
-tshape( p, shape ) NODE *p; {
-       /* return true if shape is appropriate for the node p
-          side effect for SFLD is to set up fldsz,etc */
-       register o, mask;
-
-       o = p->op;
-
-       if( sdebug ){
-               printf( "tshape( %o, %o), op = %d\n", p, shape, o );
-               }
-
-       if( shape & SPECIAL ){
-
-               switch( shape ){
-
-               case SZERO:
-               case SONE:
-               case SMONE:
-                       if( o != ICON || p->name[0] ) return(0);
-                       if( p->lval == 0 && shape == SZERO ) return(1);
-                       else if( p->lval == 1 && shape == SONE ) return(1);
-                       else if( p->lval == -1 && shape == SMONE ) return(1);
-                       else return(0);
-
-               default:
-                       return( special( p, shape ) );
-                       }
-               }
-
-       if( shape & SANY ) return(1);
-
-       if( (shape&INTEMP) && shtemp(p) ) return(1);
-
-       if( (shape&SWADD) && (o==NAME||o==OREG) ){
-               if( BYTEOFF(p->lval) ) return(0);
-               }
-
-       switch( o ){
-
-       case NAME:
-               return( shape&SNAME );
-       case ICON:
-               mask = SCON;
-               return( shape & mask );
-
-       case FLD:
-               if( shape & SFLD ){
-                       if( !flshape( p->left ) ) return(0);
-                       /* it is a FIELD shape; make side-effects */
-                       o = p->rval;
-                       fldsz = UPKFSZ(o);
-# ifdef RTOLBYTES
-                       fldshf = UPKFOFF(o);
-# else
-                       fldshf = SZINT - fldsz - UPKFOFF(o);
-# endif
-                       return(1);
-                       }
-               return(0);
-
-       case CCODES:
-               return( shape&SCC );
-
-       case REG:
-               /* distinctions:
-               SAREG   any scalar register
-               STAREG  any temporary scalar register
-               SBREG   any lvalue (index) register
-               STBREG  any temporary lvalue register
-               */
-               mask = isbreg( p->rval ) ? SBREG : SAREG;
-               if( istreg( p->rval ) && busy[p->rval]<=1 ) mask |= mask==SAREG ? STAREG : STBREG;
-               return( shape & mask );
-
-       case OREG:
-               return( shape & SOREG );
-
-       case UNARY MUL:
-               /* return STARNM or STARREG or 0 */
-               return( shumul(p->left) & shape );
-
-               }
-
-       return(0);
-       }
-
-int tdebug = 0;
-
-ttype( t, tword ) TWORD t; {
-       /* does the type t match tword */
-
-       if( tword & TANY ) return(1);
-
-       if( tdebug ){
-               printf( "ttype( %o, %o )\n", t, tword );
-               }
-       if( ISPTR(t) && (tword&TPTRTO) ) {
-               do {
-                       t = DECREF(t);
-               } while ( ISARY(t) );
-                       /* arrays that are left are usually only
-                          in structure references... */
-               return( ttype( t, tword&(~TPTRTO) ) );
-               }
-       if( t != BTYPE(t) ) return( tword & TPOINT ); /* TPOINT means not simple! */
-       if( tword & TPTRTO ) return(0);
-
-       switch( t ){
-
-       case CHAR:
-               return( tword & TCHAR );
-       case SHORT:
-               return( tword & TSHORT );
-       case STRTY:
-       case UNIONTY:
-               return( tword & TSTRUCT );
-       case INT:
-               return( tword & TINT );
-       case UNSIGNED:
-               return( tword & TUNSIGNED );
-       case USHORT:
-               return( tword & TUSHORT );
-       case UCHAR:
-               return( tword & TUCHAR );
-       case ULONG:
-               return( tword & TULONG );
-       case LONG:
-               return( tword & TLONG );
-       case FLOAT:
-               return( tword & TFLOAT );
-       case DOUBLE:
-               return( tword & TDOUBLE );
-               }
-
-       return(0);
-       }
-
-struct optab *rwtable;
-
-struct optab *opptr[DSIZE];
-
-setrew(){
-       /* set rwtable to first value which allows rewrite */
-       register struct optab *q;
-       register int i;
-
-       for( q = table; q->op != FREE; ++q ){
-               if( q->needs == REWRITE ){
-                       rwtable = q;
-                       goto more;
-                       }
-               }
-       cerror( "bad setrew" );
-
-
-       more:
-       for( i=0; i<DSIZE; ++i ){
-               if( dope[i] ){ /* there is an op... */
-                       for( q=table; q->op != FREE; ++q ){
-                               /*  beware; things like LTYPE that match
-                                   multiple things in the tree must
-                                   not try to look at the NIL at this
-                                   stage of things!  Put something else
-                                   first in table.c  */
-                               /* at one point, the operator matching was 15% of the
-                                   total comile time; thus, the function
-                                   call that was here was removed...
-                               */
-
-                               if( q->op < OPSIMP ){
-                                       if( q->op==i ) break;
-                                       }
-                               else {
-                                       register opmtemp;
-                                       if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){
-                                               if( i==NAME || i==ICON || i==OREG ) break;
-                                               else if( shltype( i, NIL ) ) break;
-                                               }
-                                       else if( (dope[i]&(opmtemp|ASGFLG)) == opmtemp ) break;
-                                       }
-                               }
-                       opptr[i] = q;
-                       }
-               }
-       }
-
-match( p, cookie ) NODE *p; {
-       /* called by: order, gencall
-          look for match in table and generate code if found unless
-          entry specified REWRITE.
-          returns MDONE, MNOPE, or rewrite specification from table */
-
-       register struct optab *q;
-       register NODE *r;
-
-       rcount();
-       if( cookie == FORREW ) q = rwtable;
-       else q = opptr[p->op];
-
-       for( ; q->op != FREE; ++q ){
-
-               /* at one point the call that was here was over 15% of the total time;
-                   thus the function call was expanded inline */
-               if( q->op < OPSIMP ){
-                       if( q->op!=p->op ) continue;
-                       }
-               else {
-                       register opmtemp;
-                       if((opmtemp=mamask[q->op - OPSIMP])&SPFLG){
-                               if( p->op!=NAME && p->op!=ICON && p->op!= OREG &&
-                                       ! shltype( p->op, p ) ) continue;
-                               }
-                       else if( (dope[p->op]&(opmtemp|ASGFLG)) != opmtemp ) continue;
-                       }
-
-               if( !(q->visit & cookie ) ) continue;
-               r = getlr( p, 'L' );                    /* see if left child matches */
-               if( !tshape( r, q->lshape ) ) continue;
-               if( !ttype( r->type, q->ltype ) ) continue;
-               r = getlr( p, 'R' );                    /* see if right child matches */
-               if( !tshape( r, q->rshape ) ) continue;
-               if( !ttype( r->type, q->rtype ) ) continue;
-
-                       /* REWRITE means no code from this match but go ahead
-                          and rewrite node to help future match */
-               if( q->needs & REWRITE ) return( q->rewrite );
-               if( !allo( p, q ) ) continue;                   /* if can't generate code, skip entry */
-
-               /* resources are available */
-
-               expand( p, cookie, q->cstring );                /* generate code */
-               reclaim( p, q->rewrite, cookie );
-
-               return(MDONE);
-
-               }
-
-       return(MNOPE);
-       }
-
-int rtyflg = 0;
-
-expand( p, cookie, cp ) NODE *p;  register char *cp; {
-       /* generate code by interpreting table entry */
-
-       CONSZ val;
-
-       rtyflg = 0;
-
-       for( ; *cp; ++cp ){
-               switch( *cp ){
-
-               default:
-                       PUTCHAR( *cp );
-                       continue;  /* this is the usual case... */
-
-               case 'T':
-                       /* rewrite register type is suppressed */
-                       rtyflg = 1;
-                       continue;
-
-               case 'Z':  /* special machine dependent operations */
-                       zzzcode( p, *++cp );
-                       continue;
-
-               case 'F':  /* this line deleted if FOREFF is active */
-                       if( cookie & FOREFF ) while( *++cp != '\n' ) ; /* VOID */
-                       continue;
-
-               case 'S':  /* field size */
-                       printf( "%d", fldsz );
-                       continue;
-
-               case 'H':  /* field shift */
-                       printf( "%d", fldshf );
-                       continue;
-
-               case 'M':  /* field mask */
-               case 'N':  /* complement of field mask */
-                       val = 1;
-                       val <<= fldsz;
-                       --val;
-                       val <<= fldshf;
-                       adrcon( *cp=='M' ? val : ~val );
-                       continue;
-
-               case 'L':  /* output special label field */
-                       printf( "%d", p->label );
-                       continue;
-
-               case 'O':  /* opcode string */
-                       hopcode( *++cp, p->op );
-                       continue;
-
-               case 'B':  /* byte offset in word */
-                       val = getlr(p,*++cp)->lval;
-                       val = BYTEOFF(val);
-                       printf( CONFMT, val );
-                       continue;
-
-               case 'C': /* for constant value only */
-                       conput( getlr( p, *++cp ) );
-                       continue;
-
-               case 'I': /* in instruction */
-                       insput( getlr( p, *++cp ) );
-                       continue;
-
-               case 'A': /* address of */
-                       adrput( getlr( p, *++cp ) );
-                       continue;
-
-               case 'U': /* for upper half of address, only */
-                       upput( getlr( p, *++cp ) );
-                       continue;
-
-                       }
-
-               }
-
-       }
-
-NODE *
-getlr( p, c ) NODE *p; {
-
-       /* return the pointer to the left or right side of p, or p itself,
-          depending on the optype of p */
-
-       switch( c ) {
-
-       case '1':
-       case '2':
-       case '3':
-               return( &resc[c-'1'] );
-
-       case 'L':
-               return( optype( p->op ) == LTYPE ? p : p->left );
-
-       case 'R':
-               return( optype( p->op ) != BITYPE ? p : p->right );
-
-               }
-       cerror( "bad getlr: %c", c );
-       /* NOTREACHED */
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/mfile1 b/.ref-Research-V7/usr/src/cmd/mip/mfile1
deleted file mode 100644 (file)
index 141a46f..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-
-# include "macdefs"
-# include "manifest"
-
-/*     storage classes  */
-# define SNULL 0
-# define AUTO 1
-# define EXTERN 2
-# define STATIC 3
-# define REGISTER 4
-# define EXTDEF 5
-# define LABEL 6
-# define ULABEL 7
-# define MOS 8
-# define PARAM 9
-# define STNAME 10
-# define MOU 11
-# define UNAME 12
-# define TYPEDEF 13
-# define FORTRAN 14
-# define ENAME 15
-# define MOE 16
-# define UFORTRAN 17
-# define USTATIC 18
-       /* field size is ORed in */
-# define FIELD 0100
-# define FLDSIZ 077
-extern char *scnames();
-
-/*     location counters */
-# define PROG 0
-# define DATA 1
-# define ADATA 2
-# define STRNG 3
-# define ISTRNG 4
-# define STAB 5
-
-
-/* symbol table flags */
-# define SMOS 01
-# define SHIDDEN 02
-# define SHIDES 04
-# define SSET 010
-# define SREF 020
-
-# ifndef FIXDEF
-# define FIXDEF(p)
-#endif
-
-       /* alignment of initialized quantities */
-# ifndef AL_INIT
-#      define  AL_INIT ALINT
-# endif
-
-struct symtab {
-       char sname[NCHNAM];
-       TWORD stype;  /* type word */
-
-       char sclass;  /* storage class */
-       char slevel;  /* scope level */
-       char sflags;  /* flags for set, use, hidden, mos, etc. */
-       int offset;  /* offset or value */
-       short dimoff; /* offset into the dimension table */
-       short sizoff; /* offset into the size table */
-       short suse;  /* line number of last use of the variable */
-       };
-
-
-# ifdef ONEPASS
-/* NOPREF must be defined for use in first pass tree machine */
-# define NOPREF 020000  /* no preference for register assignment */
-#else
-
-union ndu {
-       struct {
-               int op;
-               TWORD type;
-               int cdim, csiz;
-               NODE *left;
-               NODE * right;
-               };
-       
-       struct {
-               /* this structure is the same as above,
-                  but is used when a value, rather than
-                  address, is kept in +left */
-               int op;
-               TWORD type;
-               int cdim, csiz;
-               CONSZ lval;
-               int rval;
-               };
-       
-       struct {
-               /* this structure is used when a floating point constant
-                  is being computed */
-               int op;
-               TWORD type;
-               int cdim, csiz;
-               double dval;
-               };
-
-       };
-# endif
-
-struct sw {
-       CONSZ sval;
-       int slab;
-       };
-
-extern struct sw swtab[];
-extern struct sw *swp;
-extern int swx;
-
-extern int ftnno;
-extern int blevel;
-extern int instruct, stwart;
-
-extern int lineno, nerrors;
-typedef union {
-       int intval;
-       NODE * nodep;
-       } YYSTYPE;
-extern YYSTYPE yylval;
-
-extern CONSZ lastcon;
-extern double dcon;
-
-extern char ftitle[];
-extern struct symtab stab[];
-extern int curftn;
-extern int curclass;
-extern int curdim;
-extern int dimtab[];
-extern int paramstk[];
-extern int paramno;
-extern int autooff, argoff, strucoff;
-extern int regvar;
-extern int minrvar;
-extern int brkflag;
-extern char yytext[];
-
-extern int strflg;
-
-extern OFFSZ inoff;
-
-extern int reached;
-
-/*     tunnel to buildtree for name id's */
-
-extern int idname;
-
-extern NODE node[];
-extern NODE *lastfree;
-
-extern int cflag, hflag, pflag;
-
-/* various labels */
-extern int brklab;
-extern int contlab;
-extern int flostat;
-extern int retlab;
-extern int retstat;
-extern int asavbc[], *psavbc;
-
-/*     flags used in structures/unions */
-
-# define SEENAME 01
-# define INSTRUCT 02
-# define INUNION 04
-# define FUNNYNAME 010
-
-/*     flags used in the (elementary) flow analysis ... */
-
-# define FBRK 02
-# define FCONT 04
-# define FDEF 010
-# define FLOOP 020
-
-/*     flags used for return status */
-
-# define RETVAL 1
-# define NRETVAL 2
-
-/*     used to mark a constant with no name field */
-
-# define NONAME 040000
-
-       /* mark an offset which is undefined */
-
-# define NOOFFSET (-10201)
-
-/*     declarations of various functions */
-
-extern NODE
-       *buildtree(),
-       *bdty(),
-       *mkty(),
-       *rstruct(),
-       *dclstruct(),
-       *getstr(),
-       *tymerge(),
-       *stref(),
-       *offcon(),
-       *bcon(),
-       *bpsize(),
-       *convert(),
-       *pconvert(),
-       *oconvert(),
-       *ptmatch(),
-       *tymatch(),
-       *makety(),
-       *block(),
-       *doszof(),
-       *talloc(),
-       *optim(),
-       *strargs(),
-       *clocal();
-
-OFFSZ  tsize(),
-       psize();
-
-TWORD  types();
-
-
-double atof();
-
-char *exname(), *exdcon();
-
-# define checkst(x)
-
-# ifndef CHARCAST
-/* to make character constants into character connstants */
-/* this is a macro to defend against cross-compilers, etc. */
-# define CHARCAST(x) (char)(x)
-# endif
-
diff --git a/.ref-Research-V7/usr/src/cmd/mip/mfile2 b/.ref-Research-V7/usr/src/cmd/mip/mfile2
deleted file mode 100644 (file)
index d7884eb..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-# include "macdefs"
-# include "mac2defs"
-# include "manifest"
-
-# ifdef ONEPASS
-
-/*     bunch of stuff for putting the passes together... */
-# define crslab crs2lab
-# define where where2
-# define xdebug x2debug
-# define tdebug t2debug
-# define deflab def2lab
-# define edebug e2debug
-# define eprint e2print
-# define getlab get2lab
-# define filename ftitle
-# endif
-
-/*     cookies, used as arguments to codgen */
-
-# define FOREFF 01 /* compute for effects only */
-# define INAREG 02 /* compute into a register */
-# define INTAREG 04 /* compute into a scratch register */
-# define INBREG 010 /* compute into a lvalue register */
-# define INTBREG 020 /* compute into a scratch lvalue register */
-# define FORCC 040 /* compute for condition codes only */
-# define INTEMP 010000 /* compute into a temporary location */
-# define FORARG 020000 /* compute for an argument of a function */
-# define FORREW 040000 /* search the table, looking for a rewrite rule */
-
-       /* OP descriptors */
-       /* the ASG operator may be used on some of these */
-
-# define OPSIMP 010000    /* +, -, &, |, ^ */
-# define OPCOMM 010002  /* +, &, |, ^ */
-# define OPMUL 010004  /* *, / */
-# define OPDIV 010006 /* /, % */
-# define OPUNARY 010010  /* unary ops */
-# define OPLEAF 010012  /* leaves */
-# define OPANY 010014  /* any op... */
-# define OPLOG 010016 /* logical ops */
-# define OPFLOAT 010020 /* +, -, *, or / (for floats) */
-# define OPSHFT 010022  /* <<, >> */
-# define OPLTYPE 010024  /* leaf type nodes (e.g, NAME, ICON, etc. ) */
-
-       /* match returns */
-
-# define MNOPE 010000
-# define MDONE 010001
-
-       /* shapes */
-
-# define SANY 01       /* same as FOREFF */
-# define SAREG 02      /* same as INAREG */
-# define STAREG 04     /* same as INTAREG */
-# define SBREG 010     /* same as INBREG */
-# define STBREG 020    /* same as INTBREG */
-# define SCC 040       /* same as FORCC */
-# define SNAME 0100
-# define SCON 0200
-# define SFLD 0400
-# define SOREG 01000
-# define STARNM 02000
-# define STARREG 04000
-# define SWADD 040000
-# define SPECIAL 0100000
-# define SZERO SPECIAL
-# define SONE (SPECIAL|1)
-# define SMONE (SPECIAL|2)
-
-       /* FORARG and INTEMP are carefully not conflicting with shapes */
-
-       /* types */
-
-# define TCHAR 01
-# define TSHORT 02
-# define TINT 04
-# define TLONG 010
-# define TFLOAT 020
-# define TDOUBLE 040
-# define TPOINT 0100
-# define TUCHAR 0200
-# define TUSHORT 0400
-# define TUNSIGNED 01000
-# define TULONG 02000
-# define TPTRTO 04000  /* pointer to one of the above */
-# define TANY 010000  /* matches anything within reason */
-# define TSTRUCT 020000   /* structure or union */
-
-       /* reclamation cookies */
-
-# define RNULL 0    /* clobber result */
-# define RLEFT 01
-# define RRIGHT 02
-# define RESC1 04
-# define RESC2 010
-# define RESC3 020
-# define RESCC 04000
-# define RNOP 010000   /* DANGER: can cause loops.. */
-
-       /* needs */
-
-# define NAREG 01
-# define NACOUNT 03
-# define NAMASK 017
-# define NASL 04  /* share left register */
-# define NASR 010 /* share right register */
-# define NBREG 020
-# define NBCOUNT 060
-# define NBMASK 0360
-# define NBSL 0100
-# define NBSR 0200
-# define NTEMP 0400
-# define NTMASK 07400
-# define REWRITE 010000
-
-
-# define MUSTDO 010000   /* force register requirements */
-# define NOPREF 020000  /* no preference for register assignment */
-
-
-       /* register allocation */
-
-extern int rstatus[];
-extern int busy[];
-
-extern struct respref { int cform; int mform; } respref[];
-
-# define isbreg(r) (rstatus[r]&SBREG)
-# define istreg(r) (rstatus[r]&(STBREG|STAREG))
-# define istnode(p) (p->op==REG && istreg(p->rval))
-
-# define TBUSY 01000
-# define REGLOOP(i) for(i=0;i<REGSZ;++i)
-
-# define SETSTO(x,y) (stotree=(x),stocook=(y))
-extern int stocook;
-# define DELAYS 20
-extern NODE *deltrees[DELAYS];
-extern int deli;   /* mmmmm */
-
-extern NODE *stotree;
-extern int callflag;
-
-extern int fregs;
-
-# ifndef ONEPASS
-union ndu {
-
-       struct {
-               int op;
-               int rall;
-               TWORD type;
-               int su;
-               char name[NCHNAM];
-               NODE *left;
-               NODE *right;
-               };
-       
-       struct {
-               int op;
-               int rall;
-               TWORD type;
-               int su;
-               char name[NCHNAM];
-               CONSZ lval;
-               int rval;
-               };
-       
-       struct {
-               int op, rall;
-               TWORD type;
-               int su;
-               int label;  /* for use with branching */
-               };
-
-       struct {
-               int op, rall;
-               TWORD type;
-               int su;
-               int stsize;  /* sizes of structure objects */
-               int stalign;  /* alignment of structure objects */
-               };
-
-       };
-#endif
-
-extern NODE node[];
-
-extern struct optab {
-       int op;
-       int visit;
-       int lshape;
-       int ltype;
-       int rshape;
-       int rtype;
-       int needs;
-       int rewrite;
-       char * cstring;
-       }
-       table[];
-
-extern NODE resc[];
-
-extern OFFSZ tmpoff;
-extern OFFSZ maxoff;
-extern OFFSZ baseoff;
-extern OFFSZ maxtemp;
-extern int maxtreg;
-extern int ftnno;
-extern int rtyflg;
-
-extern int nrecur;  /* flag to keep track of recursions */
-
-# define NRECUR (10*TREESZ)
-
-extern NODE
-       *talloc(),
-       *eread(),
-       *tcopy(),
-       *getlr();
-
-extern CONSZ rdin();
-
-extern int eprint();
-
-extern char *rnames[];
-
-extern int lineno;
-extern char filename[];
-extern int fldshf, fldsz;
-extern int lflag, xdebug, udebug, edebug, odebug, rdebug, radebug, tdebug, sdebug;
-
-#ifndef callchk
-#define callchk(x) allchk()
-#endif
-
-#ifndef PUTCHAR
-# define PUTCHAR(x) putchar(x)
-#endif
-
-       /* macros for doing double indexing */
-# define R2PACK(x,y) (0200*((x)+1)+y)
-# define R2UPK1(x) (((x)>>7)-1)
-# define R2UPK2(x) ((x)&0177)
-# define R2TEST(x) ((x)>=0200)
diff --git a/.ref-Research-V7/usr/src/cmd/mip/optim.c b/.ref-Research-V7/usr/src/cmd/mip/optim.c
deleted file mode 100644 (file)
index 7beaa7d..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-# include "mfile1"
-
-# define SWAP(p,q) {sp=p; p=q; q=sp;}
-# define RCON(p) (p->right->op==ICON)
-# define RO(p) p->right->op
-# define RV(p) p->right->lval
-# define LCON(p) (p->left->op==ICON)
-# define LO(p) p->left->op
-# define LV(p) p->left->lval
-
-int oflag = 0;
-
-NODE *
-fortarg( p ) NODE *p; {
-       /* fortran function arguments */
-
-       if( p->op == CM ){
-               p->left = fortarg( p->left );
-               p->right = fortarg( p->right );
-               return(p);
-               }
-
-       while( ISPTR(p->type) ){
-               p = buildtree( UNARY MUL, p, NIL );
-               }
-       return( optim(p) );
-       }
-
-       /* mapping relationals when the sides are reversed */
-short revrel[] ={ EQ, NE, GE, GT, LE, LT, UGE, UGT, ULE, ULT };
-NODE *
-optim(p) register NODE *p; {
-       /* local optimizations, most of which are probably machine independent */
-
-       register o, ty;
-       NODE *sp;
-       int i;
-       TWORD t;
-
-       if( (t=BTYPE(p->type))==ENUMTY || t==MOETY ) econvert(p);
-       if( oflag ) return(p);
-       ty = optype( o=p->op);
-       if( ty == LTYPE ) return(p);
-
-       if( ty == BITYPE ) p->right = optim(p->right);
-       p->left = optim(p->left);
-
-       /* collect constants */
-
-       switch(o){
-
-       case SCONV:
-       case PCONV:
-               return( clocal(p) );
-
-       case FORTCALL:
-               p->right = fortarg( p->right );
-               break;
-
-       case UNARY AND:
-               if( LO(p) != NAME ) cerror( "& error" );
-
-               if( !andable(p->left) ) return(p);
-
-               LO(p) = ICON;
-
-               setuleft:
-               /* paint over the type of the left hand side with the type of the top */
-               p->left->type = p->type;
-               p->left->cdim = p->cdim;
-               p->left->csiz = p->csiz;
-               p->op = FREE;
-               return( p->left );
-
-       case UNARY MUL:
-               if( LO(p) != ICON ) break;
-               LO(p) = NAME;
-               goto setuleft;
-
-       case MINUS:
-               if( !nncon(p->right) ) break;
-               RV(p) = -RV(p);
-               o = p->op = PLUS;
-
-       case MUL:
-       case PLUS:
-       case AND:
-       case OR:
-       case ER:
-               /* commutative ops; for now, just collect constants */
-               /* someday, do it right */
-               if( nncon(p->left) || ( LCON(p) && !RCON(p) ) ) SWAP( p->left, p->right );
-               /* make ops tower to the left, not the right */
-               if( RO(p) == o ){
-                       NODE *t1, *t2, *t3;
-                       t1 = p->left;
-                       sp = p->right;
-                       t2 = sp->left;
-                       t3 = sp->right;
-                       /* now, put together again */
-                       p->left = sp;
-                       sp->left = t1;
-                       sp->right = t2;
-                       p->right = t3;
-                       }
-               if(o == PLUS && LO(p) == MINUS && RCON(p) && RCON(p->left) &&
-                 conval(p->right, MINUS, p->left->right)){
-                       zapleft:
-                       RO(p->left) = FREE;
-                       LO(p) = FREE;
-                       p->left = p->left->left;
-               }
-               if( RCON(p) && LO(p)==o && RCON(p->left) && conval( p->right, o, p->left->right ) ){
-                       goto zapleft;
-                       }
-               else if( LCON(p) && RCON(p) && conval( p->left, o, p->right ) ){
-                       zapright:
-                       RO(p) = FREE;
-                       p->left = makety( p->left, p->type, p->cdim, p->csiz );
-                       p->op = FREE;
-                       return( clocal( p->left ) );
-                       }
-
-               /* change muls to shifts */
-
-               if( o==MUL && nncon(p->right) && (i=ispow2(RV(p)))>=0){
-                       if( i == 0 ){ /* multiplication by 1 */
-                               goto zapright;
-                               }
-                       o = p->op = LS;
-                       p->right->type = p->right->csiz = INT;
-                       RV(p) = i;
-                       }
-
-               /* change +'s of negative consts back to - */
-               if( o==PLUS && nncon(p->right) && RV(p)<0 ){
-                       RV(p) = -RV(p);
-                       o = p->op = MINUS;
-                       }
-               break;
-
-       case DIV:
-               if( nncon( p->right ) && p->right->lval == 1 ) goto zapright;
-               break;
-
-       case EQ:
-       case NE:
-       case LT:
-       case LE:
-       case GT:
-       case GE:
-       case ULT:
-       case ULE:
-       case UGT:
-       case UGE:
-               if( !LCON(p) ) break;
-
-               /* exchange operands */
-
-               sp = p->left;
-               p->left = p->right;
-               p->right = sp;
-               p->op = revrel[p->op - EQ ];
-               break;
-
-               }
-
-       return(p);
-       }
-
-ispow2( c ) CONSZ c; {
-       register i;
-       if( c <= 0 || (c&(c-1)) ) return(-1);
-       for( i=0; c>1; ++i) c >>= 1;
-       return(i);
-       }
-
-nncon( p ) NODE *p; {
-       /* is p a constant without a name */
-       return( p->op == ICON && p->rval == NONAME );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/pftn.c b/.ref-Research-V7/usr/src/cmd/mip/pftn.c
deleted file mode 100644 (file)
index 0a2dbc7..0000000
+++ /dev/null
@@ -1,1673 +0,0 @@
-# include "mfile1"
-
-struct instk {
-       int in_sz;   /* size of array element */
-       int in_x;    /* current index for structure member in structure initializations */
-       int in_n;    /* number of initializations seen */
-       int in_s;    /* sizoff */
-       int in_d;    /* dimoff */
-       TWORD in_t;    /* type */
-       int in_id;   /* stab index */
-       int in_fl;   /* flag which says if this level is controlled by {} */
-       OFFSZ in_off;  /* offset of the beginning of this level */
-       }
-instack[10],
-*pstk;
-
-       /* defines used for getting things off of the initialization stack */
-
-
-struct symtab *relook();
-
-
-int ddebug = 0;
-
-defid( q, class )  NODE *q; {
-       register struct symtab *p;
-       int idp;
-       TWORD type;
-       TWORD stp;
-       int scl;
-       int dsym, ddef;
-       int slev, temp;
-
-       if( q == NIL ) return;  /* an error was detected */
-
-       if( q < node || q >= &node[TREESZ] ) cerror( "defid call" );
-
-       idp = q->rval;
-
-       if( idp < 0 ) cerror( "tyreduce" );
-       p = &stab[idp];
-
-       if( ddebug ){
-               printf( "defid( %.8s (%d), ", p->sname, idp );
-               tprint( q->type );
-               printf( ", %s, (%d,%d) ), level %d\n", scnames(class), q->cdim, q->csiz, blevel );
-               }
-
-       fixtype( q, class );
-
-       type = q->type;
-       class = fixclass( class, type );
-
-       stp = p->stype;
-       slev = p->slevel;
-
-       if( ddebug ){
-               printf( "       modified to " );
-               tprint( type );
-               printf( ", %s\n", scnames(class) );
-               printf( "       previous def'n: " );
-               tprint( stp );
-               printf( ", %s, (%d,%d) ), level %d\n", scnames(p->sclass), p->dimoff, p->sizoff, slev );
-               }
-
-       if( stp == UNDEF|| stp == FARG ){
-               if( blevel==1 && stp!=FARG ) switch( class ){
-
-               default:
-                       if(!(class&FIELD)) uerror( "declared argument %.8s is missing", p->sname );
-               case MOS:
-               case STNAME:
-               case MOU:
-               case UNAME:
-               case MOE:
-               case ENAME:
-               case TYPEDEF:
-                       ;
-                       }
-               goto enter;
-               }
-       if( type != stp ) goto mismatch;
-       /* test (and possibly adjust) dimensions */
-       dsym = p->dimoff;
-       ddef = q->cdim;
-       for( temp=type; temp&TMASK; temp = DECREF(temp) ){
-               if( ISARY(temp) ){
-                       if( dimtab[dsym] == 0 ) dimtab[dsym] = dimtab[ddef];
-                       else if( dimtab[ddef]!=0 && dimtab[dsym] != dimtab[ddef] ){
-                               goto mismatch;
-                               }
-                       ++dsym;
-                       ++ddef;
-                       }
-               }
-
-       /* check that redeclarations are to the same structure */
-       if( (temp==STRTY||temp==UNIONTY||temp==ENUMTY) && p->sizoff != q->csiz && (type&TMASK) ) {
-               goto mismatch;
-               }
-
-       scl = ( p->sclass );
-
-       if( ddebug ){
-               printf( "       previous class: %s\n", scnames(scl) );
-               }
-
-       if( class&FIELD ){
-               /* redefinition */
-               if( !falloc( p, class&FLDSIZ, 1, NIL ) ) {
-                       /* successful allocation */
-                       psave( idp );
-                       return;
-                       }
-               /* blew it: resume at end of switch... */
-               }
-
-       else switch( class ){
-
-       case EXTERN:
-               switch( scl ){
-               case STATIC:
-               case USTATIC:
-                       if( slev==0 ) return;
-                       break;
-               case EXTDEF:
-               case EXTERN:
-               case FORTRAN:
-               case UFORTRAN:
-                       return;
-                       }
-               break;
-
-       case STATIC:
-               if( scl==USTATIC || (scl==EXTERN && blevel==0) ){
-                       p->sclass = STATIC;
-                       if( ISFTN(type) ) curftn = idp;
-                       return;
-                       }
-               break;
-
-       case USTATIC:
-               if( scl==STATIC || scl==USTATIC ) return;
-               break;
-
-       case LABEL:
-               if( scl == ULABEL ){
-                       p->sclass = LABEL;
-                       deflab( p->offset );
-                       return;
-                       }
-               break;
-
-       case TYPEDEF:
-               if( scl == class ) return;
-               break;
-
-       case UFORTRAN:
-               if( scl == UFORTRAN || scl == FORTRAN ) return;
-               break;
-
-       case FORTRAN:
-               if( scl == UFORTRAN ){
-                       p->sclass = FORTRAN;
-                       if( ISFTN(type) ) curftn = idp;
-                       return;
-                       }
-               break;
-
-       case MOU:
-       case MOS:
-               if( scl == class ) {
-                       if( oalloc( p, &strucoff ) ) break;
-                       if( class == MOU ) strucoff = 0;
-                       psave( idp );
-                       return;
-                       }
-               break;
-
-       case MOE:
-               if( scl == class ){
-                       if( p->offset!= strucoff++ ) break;
-                       psave( idp );
-                       }
-               break;
-
-       case EXTDEF:
-               if( scl == EXTERN ) {
-                       p->sclass = EXTDEF;
-                       if( ISFTN(type) ) curftn = idp;
-                       return;
-                       }
-               break;
-
-       case STNAME:
-       case UNAME:
-       case ENAME:
-               if( scl != class ) break;
-               if( dimtab[p->sizoff] == 0 ) return;  /* previous entry just a mention */
-               break;
-
-       case ULABEL:
-               if( scl == LABEL || scl == ULABEL ) return;
-       case PARAM:
-       case AUTO:
-       case REGISTER:
-               ;  /* mismatch.. */
-
-               }
-
-       mismatch:
-       if( blevel > slev && class != EXTERN && class != FORTRAN &&
-               class != UFORTRAN && !( class == LABEL && slev >= 2 ) ){
-               q->rval = idp = hide( p );
-               p = &stab[idp];
-               goto enter;
-               }
-       uerror( "redeclaration of %.8s", p->sname );
-       if( class==EXTDEF && ISFTN(type) ) curftn = idp;
-       return;
-
-       enter:  /* make a new entry */
-
-       if( ddebug ) printf( "  new entry made\n" );
-       p->stype = type;
-       p->sclass = class;
-       p->slevel = blevel;
-       p->offset = NOOFFSET;
-       p->suse = lineno;
-       if( class == STNAME || class == UNAME || class == ENAME ) {
-               p->sizoff = curdim;
-               dstash( 0 );  /* size */
-               dstash( -1 ); /* index to members of str or union */
-               dstash( ALSTRUCT );  /* alignment */
-               }
-       else {
-               switch( BTYPE(type) ){
-               case STRTY:
-               case UNIONTY:
-               case ENUMTY:
-                       p->sizoff = q->csiz;
-                       break;
-               default:
-                       p->sizoff = BTYPE(type);
-                       }
-               }
-
-       /* copy dimensions */
-
-       p->dimoff = q->cdim;
-
-       /* allocate offsets */
-       if( class&FIELD ){
-               falloc( p, class&FLDSIZ, 0, NIL );  /* new entry */
-               psave( idp );
-               }
-       else switch( class ){
-
-       case AUTO:
-               oalloc( p, &autooff );
-               break;
-       case STATIC:
-       case EXTDEF:
-               p->offset = getlab();
-               if( ISFTN(type) ) curftn = idp;
-               break;
-       case ULABEL:
-       case LABEL:
-               p->offset = getlab();
-               p->slevel = 2;
-               if( class == LABEL ){
-                       locctr( PROG );
-                       deflab( p->offset );
-                       }
-               break;
-
-       case EXTERN:
-       case UFORTRAN:
-       case FORTRAN:
-               p->offset = getlab();
-               p->slevel = 0;
-               break;
-       case MOU:
-       case MOS:
-               oalloc( p, &strucoff );
-               if( class == MOU ) strucoff = 0;
-               psave( idp );
-               break;
-
-       case MOE:
-               p->offset = strucoff++;
-               psave( idp );
-               break;
-       case REGISTER:
-               p->offset = regvar--;
-               if( blevel == 1 ) p->sflags |= SSET;
-               if( regvar < minrvar ) minrvar = regvar;
-               break;
-               }
-
-       /* user-supplied routine to fix up new definitions */
-
-       FIXDEF(p);
-
-       if( ddebug ) printf( "  dimoff, sizoff, offset: %d, %d, %d\n", p->dimoff, p->sizoff, p->offset );
-
-       }
-
-psave( i ){
-       if( paramno >= PARAMSZ ){
-               cerror( "parameter stack overflow");
-               }
-       paramstk[ paramno++ ] = i;
-       }
-
-ftnend(){ /* end of function */
-       if( retlab != NOLAB ){ /* inside a real function */
-               efcode();
-               }
-       checkst(0);
-       retstat = 0;
-       tcheck();
-       curclass = SNULL;
-       brklab = contlab = retlab = NOLAB;
-       flostat = 0;
-       if( nerrors == 0 ){
-               if( psavbc != & asavbc[0] ) cerror("bcsave error");
-               if( paramno != 0 ) cerror("parameter reset error");
-               if( swx != 0 ) cerror( "switch error");
-               }
-       psavbc = &asavbc[0];
-       paramno = 0;
-       autooff = AUTOINIT;
-       minrvar = regvar = MAXRVAR;
-       reached = 1;
-       swx = 0;
-       swp = swtab;
-       locctr(DATA);
-       }
-
-dclargs(){
-       register i, j;
-       register struct symtab *p;
-       register NODE *q;
-       argoff = ARGINIT;
-       for( i=0; i<paramno; ++i ){
-               if( (j = paramstk[i]) < 0 ) continue;
-               p = &stab[j];
-               if( p->stype == FARG ) {
-                       q = block(FREE,NIL,NIL,INT,0,INT);
-                       q->rval = j;
-                       defid( q, PARAM );
-                       }
-               oalloc( p, &argoff );  /* always set aside space, even for register arguments */
-               }
-       cendarg();
-       locctr(PROG);
-       defalign(ALINT);
-       ++ftnno;
-       bfcode( paramstk, paramno );
-       paramno = 0;
-       }
-
-NODE *
-rstruct( idn, soru ){ /* reference to a structure or union, with no definition */
-       register struct symtab *p;
-       register NODE *q;
-       p = &stab[idn];
-       switch( p->stype ){
-
-       case UNDEF:
-       def:
-               q = block( FREE, NIL, NIL, 0, 0, 0 );
-               q->rval = idn;
-               q->type = (soru&INSTRUCT) ? STRTY : ( (soru&INUNION) ? UNIONTY : ENUMTY );
-               defid( q, (soru&INSTRUCT) ? STNAME : ( (soru&INUNION) ? UNAME : ENAME ) );
-               break;
-
-       case STRTY:
-               if( soru & INSTRUCT ) break;
-               goto def;
-
-       case UNIONTY:
-               if( soru & INUNION ) break;
-               goto def;
-
-       case ENUMTY:
-               if( !(soru&(INUNION|INSTRUCT)) ) break;
-               goto def;
-
-               }
-       stwart = instruct;
-       return( mkty( p->stype, 0, p->sizoff ) );
-       }
-
-moedef( idn ){
-       register NODE *q;
-
-       q = block( FREE, NIL, NIL, MOETY, 0, 0 );
-       q -> rval = idn;
-       if( idn>=0 ) defid( q, MOE );
-       }
-
-bstruct( idn, soru ){ /* begining of structure or union declaration */
-       register NODE *q;
-
-       psave( instruct );
-       psave( curclass );
-       psave( strucoff );
-       strucoff = 0;
-       instruct = soru;
-       q = block( FREE, NIL, NIL, 0, 0, 0 );
-       q->rval = idn;
-       if( instruct==INSTRUCT ){
-               curclass = MOS;
-               q->type = STRTY;
-               if( idn >= 0 ) defid( q, STNAME );
-               }
-       else if( instruct == INUNION ) {
-               curclass = MOU;
-               q->type = UNIONTY;
-               if( idn >= 0 ) defid( q, UNAME );
-               }
-       else { /* enum */
-               curclass = MOE;
-               q->type = ENUMTY;
-               if( idn >= 0 ) defid( q, ENAME );
-               }
-       psave( q->rval );
-       return( paramno-4 );
-       }
-
-NODE *
-dclstruct( oparam ){
-       register struct symtab *p;
-       register i, al, sa, j, sz, szindex;
-       register TWORD temp;
-       register high, low;
-
-       /* paramstack contains:
-               paramstack[ oparam ] = previous instruct
-               paramstack[ oparam+1 ] = previous class
-               paramstk[ oparam+2 ] = previous strucoff
-               paramstk[ oparam+3 ] = structure name
-
-               paramstk[ oparam+4, ... ]  = member stab indices
-
-               */
-
-
-       if( (i=paramstk[oparam+3]) < 0 ){
-               szindex = curdim;
-               dstash( 0 );  /* size */
-               dstash( -1 );  /* index to member names */
-               dstash( ALSTRUCT );  /* alignment */
-               }
-       else {
-               szindex = stab[i].sizoff;
-               }
-
-       if( ddebug ){
-               printf( "dclstruct( %.8s ), szindex = %d\n", (i>=0)? stab[i].sname : "??", szindex );
-               }
-       temp = (instruct&INSTRUCT)?STRTY:((instruct&INUNION)?UNIONTY:ENUMTY);
-       stwart = instruct = paramstk[ oparam ];
-       curclass = paramstk[ oparam+1 ];
-       dimtab[ szindex+1 ] = curdim;
-       al = ALSTRUCT;
-
-       high = low = 0;
-
-       for( i = oparam+4;  i< paramno; ++i ){
-               dstash( j=paramstk[i] );
-               if( j<0 || j>= SYMTSZ ) cerror( "gummy structure member" );
-               p = &stab[j];
-               if( temp == ENUMTY ){
-                       if( p->offset < low ) low = p->offset;
-                       if( p->offset > high ) high = p->offset;
-                       p->sizoff = szindex;
-                       continue;
-                       }
-               sa = talign( p->stype, p->sizoff );
-               if( p->sclass & FIELD ){
-                       sz = p->sclass&FLDSIZ;
-                       }
-               else {
-                       sz = tsize( p->stype, p->dimoff, p->sizoff );
-                       }
-               if( sz == 0 ){
-                       uerror( "illegal zero sized structure member: %.8s", p->sname );
-                       }
-               if( sz > strucoff ) strucoff = sz;  /* for use with unions */
-               SETOFF( al, sa );
-               /* set al, the alignment, to the lcm of the alignments of the members */
-               }
-       dstash( -1 );  /* endmarker */
-       SETOFF( strucoff, al );
-
-       if( temp == ENUMTY ){
-               register TWORD ty;
-
-# ifdef ENUMSIZE
-               ty = ENUMSIZE(high,low);
-# else
-               if( (char)high == high && (char)low == low ) ty = ctype( CHAR );
-               else if( (short)high == high && (short)low == low ) ty = ctype( SHORT );
-               else ty = ctype(INT);
-#endif
-               strucoff = tsize( ty, 0, (int)ty );
-               dimtab[ szindex+2 ] = al = talign( ty, (int)ty );
-               }
-
-       if( strucoff == 0 ) uerror( "zero sized structure" );
-       dimtab[ szindex ] = strucoff;
-       dimtab[ szindex+2 ] = al;
-
-       if( ddebug>1 ){
-               printf( "\tdimtab[%d,%d,%d] = %d,%d,%d\n", szindex,szindex+1,szindex+2,
-                               dimtab[szindex],dimtab[szindex+1],dimtab[szindex+2] );
-               for( i = dimtab[szindex+1]; dimtab[i] >= 0; ++i ){
-                       printf( "\tmember %.8s(%d)\n", stab[dimtab[i]].sname, dimtab[i] );
-                       }
-               }
-
-       strucoff = paramstk[ oparam+2 ];
-       paramno = oparam;
-
-       return( mkty( temp, 0, szindex ) );
-       }
-
-       /* VARARGS */
-yyerror( s ) char *s; { /* error printing routine in parser */
-
-       uerror( s );
-
-       }
-
-yyaccpt(){
-       ftnend();
-       }
-
-ftnarg( idn ) {
-       if( stab[idn].stype != UNDEF ){
-               idn = hide( &stab[idn]);
-               }
-       stab[idn].stype = FARG;
-       stab[idn].sclass = PARAM;
-       psave( idn );
-       }
-
-talign( ty, s) register unsigned ty; register s; {
-       /* compute the alignment of an object with type ty, sizeoff index s */
-
-       register i;
-       if( s<0 && ty!=INT && ty!=CHAR && ty!=SHORT && ty!=UNSIGNED && ty!=UCHAR && ty!=USHORT 
-#ifdef LONGFIELDS
-               && ty!=LONG && ty!=ULONG
-#endif
-                                       ){
-               return( fldal( ty ) );
-               }
-
-       for( i=0; i<=(SZINT-BTSHIFT-1); i+=TSHIFT ){
-               switch( (ty>>i)&TMASK ){
-
-               case FTN:
-                       cerror( "compiler takes alignment of function");
-               case PTR:
-                       return( ALPOINT );
-               case ARY:
-                       continue;
-               case 0:
-                       break;
-                       }
-               }
-
-       switch( BTYPE(ty) ){
-
-       case UNIONTY:
-       case ENUMTY:
-       case STRTY:
-               return( dimtab[ s+2 ] );
-       case CHAR:
-       case UCHAR:
-               return( ALCHAR );
-       case FLOAT:
-               return( ALFLOAT );
-       case DOUBLE:
-               return( ALDOUBLE );
-       case LONG:
-       case ULONG:
-               return( ALLONG );
-       case SHORT:
-       case USHORT:
-               return( ALSHORT );
-       default:
-               return( ALINT );
-               }
-       }
-
-OFFSZ
-tsize( ty, d, s )  TWORD ty; {
-       /* compute the size associated with type ty,
-           dimoff d, and sizoff s */
-       /* BETTER NOT BE CALLED WHEN t, d, and s REFER TO A BIT FIELD... */
-
-       int i;
-       OFFSZ mult;
-
-       mult = 1;
-
-       for( i=0; i<=(SZINT-BTSHIFT-1); i+=TSHIFT ){
-               switch( (ty>>i)&TMASK ){
-
-               case FTN:
-                       cerror( "compiler takes size of function");
-               case PTR:
-                       return( SZPOINT * mult );
-               case ARY:
-                       mult *= dimtab[ d++ ];
-                       continue;
-               case 0:
-                       break;
-
-                       }
-               }
-
-       if( dimtab[s]==0 ) {
-               uerror( "unknown size");
-               return( SZINT );
-               }
-       return( dimtab[ s ] * mult );
-       }
-
-inforce( n ) OFFSZ n; {  /* force inoff to have the value n */
-       /* inoff is updated to have the value n */
-       OFFSZ wb;
-       register rest;
-       /* rest is used to do a lot of conversion to ints... */
-
-       if( inoff == n ) return;
-       if( inoff > n ) {
-               cerror( "initialization alignment error");
-               }
-
-       wb = inoff;
-       SETOFF( wb, SZINT );
-
-       /* wb now has the next higher word boundary */
-
-       if( wb >= n ){ /* in the same word */
-               rest = n - inoff;
-               vfdzero( rest );
-               return;
-               }
-
-       /* otherwise, extend inoff to be word aligned */
-
-       rest = wb - inoff;
-       vfdzero( rest );
-
-       /* now, skip full words until near to n */
-
-       rest = (n-inoff)/SZINT;
-       zecode( rest );
-
-       /* now, the remainder of the last word */
-
-       rest = n-inoff;
-       vfdzero( rest );
-       if( inoff != n ) cerror( "inoff error");
-
-       }
-
-vfdalign( n ){ /* make inoff have the offset the next alignment of n */
-       OFFSZ m;
-
-       m = inoff;
-       SETOFF( m, n );
-       inforce( m );
-       }
-
-
-int idebug = 0;
-
-int ibseen = 0;  /* the number of } constructions which have been filled */
-
-int iclass;  /* storage class of thing being initialized */
-
-int ilocctr = 0;  /* location counter for current initialization */
-
-beginit(curid){
-       /* beginning of initilization; set location ctr and set type */
-       register struct symtab *p;
-
-       if( idebug >= 3 ) printf( "beginit(), curid = %d\n", curid );
-
-       p = &stab[curid];
-
-       iclass = p->sclass;
-       if( curclass == EXTERN || curclass == FORTRAN ) iclass = EXTERN;
-       switch( iclass ){
-
-       case UNAME:
-       case EXTERN:
-               return;
-       case AUTO:
-       case REGISTER:
-               break;
-       case EXTDEF:
-       case STATIC:
-               ilocctr = ISARY(p->stype)?ADATA:DATA;
-               locctr( ilocctr );
-               defalign( talign( p->stype, p->sizoff ) );
-               defnam( p );
-
-               }
-
-       inoff = 0;
-       ibseen = 0;
-
-       pstk = 0;
-
-       instk( curid, p->stype, p->dimoff, p->sizoff, inoff );
-
-       }
-
-instk( id, t, d, s, off ) OFFSZ off; TWORD t; {
-       /* make a new entry on the parameter stack to initialize id */
-
-       register struct symtab *p;
-
-       for(;;){
-               if( idebug ) printf( "instk((%d, %o,%d,%d, %d)\n", id, t, d, s, off );
-
-               /* save information on the stack */
-
-               if( !pstk ) pstk = instack;
-               else ++pstk;
-
-               pstk->in_fl = 0;        /* { flag */
-               pstk->in_id =  id ;
-               pstk->in_t =  t ;
-               pstk->in_d =  d ;
-               pstk->in_s =  s ;
-               pstk->in_n = 0;  /* number seen */
-               pstk->in_x =  t==STRTY ?dimtab[s+1] : 0 ;
-               pstk->in_off =  off;   /* offset at the beginning of this element */
-               /* if t is an array, DECREF(t) can't be a field */
-               /* INS_sz has size of array elements, and -size for fields */
-               if( ISARY(t) ){
-                       pstk->in_sz = tsize( DECREF(t), d+1, s );
-                       }
-               else if( stab[id].sclass & FIELD ){
-                       pstk->in_sz = - ( stab[id].sclass & FLDSIZ );
-                       }
-               else {
-                       pstk->in_sz = 0;
-                       }
-
-               if( (iclass==AUTO || iclass == REGISTER ) &&
-                       (ISARY(t) || t==STRTY) ) uerror( "no automatic aggregate initialization" );
-
-               /* now, if this is not a scalar, put on another element */
-
-               if( ISARY(t) ){
-                       t = DECREF(t);
-                       ++d;
-                       continue;
-                       }
-               else if( t == STRTY ){
-                       id = dimtab[pstk->in_x];
-                       p = &stab[id];
-                       if( p->sclass != MOS && !(p->sclass&FIELD) ) cerror( "insane structure member list" );
-                       t = p->stype;
-                       d = p->dimoff;
-                       s = p->sizoff;
-                       off += p->offset;
-                       continue;
-                       }
-               else return;
-               }
-       }
-
-NODE *
-getstr(){ /* decide if the string is external or an initializer, and get the contents accordingly */
-
-       register l, temp;
-       register NODE *p;
-
-       if( (iclass==EXTDEF||iclass==STATIC) && (pstk->in_t == CHAR || pstk->in_t == UCHAR) &&
-                       pstk!=instack && ISARY( pstk[-1].in_t ) ){
-               /* treat "abc" as { 'a', 'b', 'c', 0 } */
-               strflg = 1;
-               ilbrace();  /* simulate { */
-               inforce( pstk->in_off );
-               /* if the array is inflexible (not top level), pass in the size and
-                       be prepared to throw away unwanted initializers */
-               lxstr((pstk-1)!=instack?dimtab[(pstk-1)->in_d]:0);  /* get the contents */
-               irbrace();  /* simulate } */
-               return( NIL );
-               }
-       else { /* make a label, and get the contents and stash them away */
-               if( iclass != SNULL ){ /* initializing */
-                       /* fill out previous word, to permit pointer */
-                       vfdalign( ALPOINT );
-                       }
-               temp = locctr( blevel==0?ISTRNG:STRNG ); /* set up location counter */
-               deflab( l = getlab() );
-               strflg = 0;
-               lxstr(0); /* get the contents */
-               locctr( blevel==0?ilocctr:temp );
-               p = buildtree( STRING, NIL, NIL );
-               p->rval = -l;
-               return(p);
-               }
-       }
-
-putbyte( v ){ /* simulate byte v appearing in a list of integer values */
-       register NODE *p;
-       p = bcon(v);
-       incode( p, SZCHAR );
-       tfree( p );
-       gotscal();
-       }
-
-endinit(){
-       register TWORD t;
-       register d, s, n, d1;
-
-       if( idebug ) printf( "endinit(), inoff = %d\n", inoff );
-
-       switch( iclass ){
-
-       case EXTERN:
-       case AUTO:
-       case REGISTER:
-               return;
-               }
-
-       pstk = instack;
-
-       t = pstk->in_t;
-       d = pstk->in_d;
-       s = pstk->in_s;
-       n = pstk->in_n;
-
-       if( ISARY(t) ){
-               d1 = dimtab[d];
-
-               vfdalign( pstk->in_sz );  /* fill out part of the last element, if needed */
-               n = inoff/pstk->in_sz;  /* real number of initializers */
-               if( d1 >= n ){
-                       /* once again, t is an array, so no fields */
-                       inforce( tsize( t, d, s ) );
-                       n = d1;
-                       }
-               if( d1!=0 && d1!=n ) uerror( "too many initializers");
-               if( n==0 ) werror( "empty array declaration");
-               dimtab[d] = n;
-               }
-
-       else if( t == STRTY || t == UNIONTY ){
-               /* clearly not fields either */
-               inforce( tsize( t, d, s ) );
-               }
-       else if( n > 1 ) uerror( "bad scalar initialization");
-       /* this will never be called with a field element... */
-       else inforce( tsize(t,d,s) );
-
-       paramno = 0;
-       vfdalign( AL_INIT );
-       inoff = 0;
-       iclass = SNULL;
-
-       }
-
-doinit( p ) register NODE *p; {
-
-       /* take care of generating a value for the initializer p */
-       /* inoff has the current offset (last bit written)
-               in the current word being generated */
-
-       register sz, d, s;
-       register TWORD t;
-
-       /* note: size of an individual initializer is assumed to fit into an int */
-
-       if( iclass < 0 ) goto leave;
-       if( iclass == EXTERN || iclass == UNAME ){
-               uerror( "cannot initialize extern or union" );
-               iclass = -1;
-               goto leave;
-               }
-
-       if( iclass == AUTO || iclass == REGISTER ){
-               /* do the initialization and get out, without regard 
-                   for filing out the variable with zeros, etc. */
-               bccode();
-               idname = pstk->in_id;
-               p = buildtree( ASSIGN, buildtree( NAME, NIL, NIL ), p );
-               ecomp(p);
-               return;
-               }
-
-       if( p == NIL ) return;  /* for throwing away strings that have been turned into lists */
-
-       if( ibseen ){
-               uerror( "} expected");
-               goto leave;
-               }
-
-       if( idebug > 1 ) printf( "doinit(%o)\n", p );
-
-       t = pstk->in_t;  /* type required */
-       d = pstk->in_d;
-       s = pstk->in_s;
-       if( pstk->in_sz < 0 ){  /* bit field */
-               sz = -pstk->in_sz;
-               }
-       else {
-               sz = tsize( t, d, s );
-               }
-
-       inforce( pstk->in_off );
-
-       p = buildtree( ASSIGN, block( NAME, NIL,NIL, t, d, s ), p );
-       p->left->op = FREE;
-       p->left = p->right;
-       p->right = NIL;
-       p->left = optim( p->left );
-       if( p->left->op == UNARY AND ){
-               p->left->op = FREE;
-               p->left = p->left->left;
-               }
-       p->op = INIT;
-
-       if( sz < SZINT ){ /* special case: bit fields, etc. */
-               if( p->left->op != ICON ) uerror( "illegal initialization" );
-               else incode( p->left, sz );
-               }
-       else if( p->left->op == FCON ){
-               fincode( p->left->dval, sz );
-               }
-       else {
-               cinit( optim(p), sz );
-               }
-
-       gotscal();
-
-       leave:
-       tfree(p);
-       }
-
-gotscal(){
-       register t, ix;
-       register n, id;
-       struct symtab *p;
-       OFFSZ temp;
-
-       for( ; pstk > instack; ) {
-
-               if( pstk->in_fl ) ++ibseen;
-
-               --pstk;
-               
-               t = pstk->in_t;
-
-               if( t == STRTY ){
-                       ix = ++pstk->in_x;
-                       if( (id=dimtab[ix]) < 0 ) continue;
-
-                       /* otherwise, put next element on the stack */
-
-                       p = &stab[id];
-                       instk( id, p->stype, p->dimoff, p->sizoff, p->offset+pstk->in_off );
-                       return;
-                       }
-               else if( ISARY(t) ){
-                       n = ++pstk->in_n;
-                       if( n >= dimtab[pstk->in_d] && pstk > instack ) continue;
-
-                       /* put the new element onto the stack */
-
-                       temp = pstk->in_sz;
-                       instk( pstk->in_id, (TWORD)DECREF(pstk->in_t), pstk->in_d+1, pstk->in_s,
-                               pstk->in_off+n*temp );
-                       return;
-                       }
-
-               }
-
-       }
-
-ilbrace(){ /* process an initializer's left brace */
-       register t;
-       struct instk *temp;
-
-       temp = pstk;
-
-       for( ; pstk > instack; --pstk ){
-
-               t = pstk->in_t;
-               if( t != STRTY && !ISARY(t) ) continue; /* not an aggregate */
-               if( pstk->in_fl ){ /* already associated with a { */
-                       if( pstk->in_n ) uerror( "illegal {");
-                       continue;
-                       }
-
-               /* we have one ... */
-               pstk->in_fl = 1;
-               break;
-               }
-
-       /* cannot find one */
-       /* ignore such right braces */
-
-       pstk = temp;
-       }
-
-irbrace(){
-       /* called when a '}' is seen */
-
-       if( idebug ) printf( "irbrace(): paramno = %d on entry\n", paramno );
-
-       if( ibseen ) {
-               --ibseen;
-               return;
-               }
-
-       for( ; pstk > instack; --pstk ){
-               if( !pstk->in_fl ) continue;
-
-               /* we have one now */
-
-               pstk->in_fl = 0;  /* cancel { */
-               gotscal();  /* take it away... */
-               return;
-               }
-
-       /* these right braces match ignored left braces: throw out */
-
-       }
-
-upoff( size, alignment, poff ) register alignment, *poff; {
-       /* update the offset pointed to by poff; return the
-       /* offset of a value of size `size', alignment `alignment',
-       /* given that off is increasing */
-
-       register off;
-
-       off = *poff;
-       SETOFF( off, alignment );
-       *poff = off+size;
-       return( off );
-       }
-
-oalloc( p, poff ) register struct symtab *p; register *poff; {
-       /* allocate p with offset *poff, and update *poff */
-       register al, off, tsz;
-       int noff;
-
-       al = talign( p->stype, p->sizoff );
-       noff = off = *poff;
-       tsz = tsize( p->stype, p->dimoff, p->sizoff );
-#ifdef BACKAUTO
-       if( p->sclass == AUTO ){
-               noff = off + tsz;
-               SETOFF( noff, al );
-               off = -noff;
-               }
-       else
-#endif
-               if( p->sclass == PARAM && (p->stype==CHAR||p->stype==UCHAR||p->stype==SHORT||
-                               p->stype==USHORT) ){
-                       off = upoff( SZINT, ALINT, &noff );
-# ifndef RTOLBYTES
-                       off = noff - tsz;
-#endif
-                       }
-               else
-               {
-               off = upoff( tsz, al, &noff );
-               }
-
-       if( p->sclass != REGISTER ){ /* in case we are allocating stack space for register arguments */
-               if( p->offset == NOOFFSET ) p->offset = off;
-               else if( off != p->offset ) return(1);
-               }
-
-       *poff = noff;
-       return(0);
-       }
-
-falloc( p, w, new, pty )  register struct symtab *p; NODE *pty; {
-       /* allocate a field of width w */
-       /* new is 0 if new entry, 1 if redefinition, -1 if alignment */
-
-       register al,sz,type;
-
-       type = (new<0)? pty->type : p->stype;
-
-       /* this must be fixed to use the current type in alignments */
-       switch( new<0?pty->type:p->stype ){
-
-       case ENUMTY:
-               {
-                       int s;
-                       s = new<0 ? pty->csiz : p->sizoff;
-                       al = dimtab[s+2];
-                       sz = dimtab[s];
-                       break;
-                       }
-
-       case CHAR:
-       case UCHAR:
-               al = ALCHAR;
-               sz = SZCHAR;
-               break;
-
-       case SHORT:
-       case USHORT:
-               al = ALSHORT;
-               sz = SZSHORT;
-               break;
-
-       case INT:
-       case UNSIGNED:
-               al = ALINT;
-               sz = SZINT;
-               break;
-#ifdef LONGFIELDS
-
-       case LONG:
-       case ULONG:
-               al = ALLONG;
-               sz = SZLONG;
-               break;
-#endif
-
-       default:
-               if( new < 0 ) {
-                       uerror( "illegal field type" );
-                       al = ALINT;
-                       }
-               else {
-                       al = fldal( p->stype );
-                       sz =SZINT;
-                       }
-               }
-
-       if( w > sz ) {
-               uerror( "field too big");
-               w = sz;
-               }
-
-       if( w == 0 ){ /* align only */
-               SETOFF( strucoff, al );
-               if( new >= 0 ) uerror( "zero size field");
-               return(0);
-               }
-
-       if( strucoff%al + w > sz ) SETOFF( strucoff, al );
-       if( new < 0 ) {
-               strucoff += w;  /* we know it will fit */
-               return(0);
-               }
-
-       /* establish the field */
-
-       if( new == 1 ) { /* previous definition */
-               if( p->offset != strucoff || p->sclass != (FIELD|w) ) return(1);
-               }
-       p->offset = strucoff;
-       strucoff += w;
-       p->stype = type;
-       fldty( p );
-       return(0);
-       }
-
-nidcl( p ) NODE *p; { /* handle unitialized declarations */
-       /* assumed to be not functions */
-       register class;
-       register commflag;  /* flag for labelled common declarations */
-
-       commflag = 0;
-
-       /* compute class */
-       if( (class=curclass) == SNULL ){
-               if( blevel > 1 ) class = AUTO;
-               else if( blevel != 0 || instruct ) cerror( "nidcl error" );
-               else { /* blevel = 0 */
-                       class = noinit();
-                       if( class == EXTERN ) commflag = 1;
-                       }
-               }
-
-       defid( p, class );
-
-       if( class==EXTDEF || class==STATIC ){
-               /* simulate initialization by 0 */
-               beginit(p->rval);
-               endinit();
-               }
-       if( commflag ) commdec( p->rval );
-       }
-
-TWORD
-types( t1, t2, t3 ) TWORD t1, t2, t3; {
-       /* return a basic type from basic types t1, t2, and t3 */
-
-       TWORD t[3], noun, adj, unsg;
-       register i;
-
-       t[0] = t1;
-       t[1] = t2;
-       t[2] = t3;
-
-       unsg = INT;  /* INT or UNSIGNED */
-       noun = UNDEF;  /* INT, CHAR, or FLOAT */
-       adj = INT;  /* INT, LONG, or SHORT */
-
-       for( i=0; i<3; ++i ){
-               switch( t[i] ){
-
-               default:
-               bad:
-                       uerror( "illegal type combination" );
-                       return( INT );
-
-               case UNDEF:
-                       continue;
-
-               case UNSIGNED:
-                       if( unsg != INT ) goto bad;
-                       unsg = UNSIGNED;
-                       continue;
-
-               case LONG:
-               case SHORT:
-                       if( adj != INT ) goto bad;
-                       adj = t[i];
-                       continue;
-
-               case INT:
-               case CHAR:
-               case FLOAT:
-                       if( noun != UNDEF ) goto bad;
-                       noun = t[i];
-                       continue;
-                       }
-               }
-
-       /* now, construct final type */
-       if( noun == UNDEF ) noun = INT;
-       else if( noun == FLOAT ){
-               if( unsg != INT || adj == SHORT ) goto bad;
-               return( adj==LONG ? DOUBLE : FLOAT );
-               }
-       else if( noun == CHAR && adj != INT ) goto bad;
-
-       /* now, noun is INT or CHAR */
-       if( adj != INT ) noun = adj;
-       if( unsg == UNSIGNED ) return( noun + (UNSIGNED-INT) );
-       else return( noun );
-       }
-
-NODE *
-tymerge( typ, idp ) NODE *typ, *idp; {
-       /* merge type typ with identifier idp  */
-
-       register unsigned t;
-       register i;
-       extern int eprint();
-
-       if( typ->op != TYPE ) cerror( "tymerge: arg 1" );
-       if(idp == NIL ) return( NIL );
-
-       if( ddebug > 2 ) fwalk( idp, eprint, 0 );
-
-       idp->type = typ->type;
-       idp->cdim = curdim;
-       tyreduce( idp );
-       idp->csiz = typ->csiz;
-
-       for( t=typ->type, i=typ->cdim; t&TMASK; t = DECREF(t) ){
-               if( ISARY(t) ) dstash( dimtab[i++] );
-               }
-
-       /* now idp is a single node: fix up type */
-
-       idp->type = ctype( idp->type );
-
-       if( (t = BTYPE(idp->type)) != STRTY && t != UNIONTY && t != ENUMTY ){
-               idp->csiz = t;  /* in case ctype has rewritten things */
-               }
-
-       return( idp );
-       }
-
-tyreduce( p ) register NODE *p; {
-
-       /* build a type, and stash away dimensions, from a parse tree of the declaration */
-       /* the type is build top down, the dimensions bottom up */
-       register o, temp;
-       register unsigned t;
-
-       o = p->op;
-       p->op = FREE;
-
-       if( o == NAME ) return;
-
-       t = INCREF( p->type );
-       if( o == UNARY CALL ) t += (FTN-PTR);
-       else if( o == LB ){
-               t += (ARY-PTR);
-               temp = p->right->lval;
-               p->right->op = FREE;
-               }
-
-       p->left->type = t;
-       tyreduce( p->left );
-
-       if( o == LB ) dstash( temp );
-
-       p->rval = p->left->rval;
-       p->type = p->left->type;
-
-       }
-
-fixtype( p, class ) register NODE *p; {
-       register unsigned t, type;
-       register mod1, mod2;
-       /* fix up the types, and check for legality */
-
-       if( (type = p->type) == UNDEF ) return;
-       if( mod2 = (type&TMASK) ){
-               t = DECREF(type);
-               while( mod1=mod2, mod2 = (t&TMASK) ){
-                       if( mod1 == ARY && mod2 == FTN ){
-                               uerror( "array of functions is illegal" );
-                               type = 0;
-                               }
-                       else if( mod1 == FTN && ( mod2 == ARY || mod2 == FTN ) ){
-                               uerror( "function returns illegal type" );
-                               type = 0;
-                               }
-                       t = DECREF(t);
-                       }
-               }
-
-       /* detect function arguments, watching out for structure declarations */
-
-       if( class==SNULL && blevel==1 && !(instruct&(INSTRUCT|INUNION)) ) class = PARAM;
-       if( class == PARAM || ( class==REGISTER && blevel==1 ) ){
-               if( type == FLOAT ) type = DOUBLE;
-               else if( ISARY(type) ){
-                       ++p->cdim;
-                       type += (PTR-ARY);
-                       }
-               else if( ISFTN(type) ) type = INCREF(type);
-
-               }
-
-       if( instruct && ISFTN(type) ){
-               uerror( "function illegal in structure or union" );
-               type = INCREF(type);
-               }
-       p->type = type;
-       }
-
-uclass( class ) register class; {
-       /* give undefined version of class */
-       if( class == SNULL ) return( EXTERN );
-       else if( class == STATIC ) return( USTATIC );
-       else if( class == FORTRAN ) return( UFORTRAN );
-       else return( class );
-       }
-
-fixclass( class, type ) TWORD type; {
-
-       /* first, fix null class */
-
-       if( class == SNULL ){
-               if( instruct&INSTRUCT ) class = MOS;
-               else if( instruct&INUNION ) class = MOU;
-               else if( blevel == 0 ) class = EXTDEF;
-               else if( blevel == 1 ) class = PARAM;
-               else class = AUTO;
-
-               }
-
-       /* now, do general checking */
-
-       if( ISFTN( type ) ){
-               switch( class ) {
-               default:
-                       uerror( "function has illegal storage class" );
-               case AUTO:
-                       class = EXTERN;
-               case EXTERN:
-               case EXTDEF:
-               case FORTRAN:
-               case TYPEDEF:
-               case STATIC:
-               case UFORTRAN:
-               case USTATIC:
-                       ;
-                       }
-               }
-
-       if( class&FIELD ){
-               if( !(instruct&INSTRUCT) ) uerror( "illegal use of field" );
-               return( class );
-               }
-
-       switch( class ){
-
-       case MOU:
-               if( !(instruct&INUNION) ) uerror( "illegal class" );
-               return( class );
-
-       case MOS:
-               if( !(instruct&INSTRUCT) ) uerror( "illegal class" );
-               return( class );
-
-       case MOE:
-               if( instruct & (INSTRUCT|INUNION) ) uerror( "illegal class" );
-               return( class );
-
-       case REGISTER:
-               if( blevel == 0 ) uerror( "illegal register declaration" );
-               else if( regvar >= MINRVAR && cisreg( type ) ) return( class );
-               if( blevel == 1 ) return( PARAM );
-               else return( AUTO );
-
-       case AUTO:
-       case LABEL:
-       case ULABEL:
-               if( blevel < 2 ) uerror( "illegal class" );
-               return( class );
-
-       case PARAM:
-               if( blevel != 1 ) uerror( "illegal class" );
-               return( class );
-
-       case UFORTRAN:
-       case FORTRAN:
-# ifdef NOFORTRAN
-                       NOFORTRAN;    /* a condition which can regulate the FORTRAN usage */
-# endif
-               if( !ISFTN(type) ) uerror( "fortran declaration must apply to function" );
-               else {
-                       type = DECREF(type);
-                       if( ISFTN(type) || ISARY(type) || ISPTR(type) ) {
-                               uerror( "fortran function has wrong type" );
-                               }
-                       }
-       case STNAME:
-       case UNAME:
-       case ENAME:
-       case EXTERN:
-       case STATIC:
-       case EXTDEF:
-       case TYPEDEF:
-       case USTATIC:
-               return( class );
-
-       default:
-               cerror( "illegal class: %d", class );
-               /* NOTREACHED */
-
-               }
-       }
-
-lookup( name, s) char *name; { 
-       /* look up name: must agree with s w.r.t. SMOS and SHIDDEN */
-
-       register char *p, *q;
-       int i, j, ii;
-       register struct symtab *sp;
-
-       /* compute initial hash index */
-       if( ddebug > 2 ){
-               printf( "lookup( %s, %d ), stwart=%d, instruct=%d\n", name, s, stwart, instruct );
-               }
-
-       i = 0;
-       for( p=name, j=0; *p != '\0'; ++p ){
-               i += *p;
-               if( ++j >= NCHNAM ) break;
-               }
-       i = i%SYMTSZ;
-       sp = &stab[ii=i];
-
-       for(;;){ /* look for name */
-
-               if( sp->stype == TNULL ){ /* empty slot */
-                       p = sp->sname;
-                       sp->sflags = s;  /* set SMOS if needed, turn off all others */
-                       for( j=0; j<NCHNAM; ++j ) if( *p++ = *name ) ++name;
-                       sp->stype = UNDEF;
-                       sp->sclass = SNULL;
-                       return( i );
-                       }
-               if( (sp->sflags & (SMOS|SHIDDEN)) != s ) goto next;
-               p = sp->sname;
-               q = name;
-               for( j=0; j<NCHNAM;++j ){
-                       if( *p++ != *q ) goto next;
-                       if( !*q++ ) break;
-                       }
-               return( i );
-       next:
-               if( ++i >= SYMTSZ ){
-                       i = 0;
-                       sp = stab;
-                       }
-               else ++sp;
-               if( i == ii ) cerror( "symbol table full" );
-               }
-       }
-
-#ifndef checkst
-/* if not debugging, make checkst a macro */
-checkst(lev){
-       register int s, i, j;
-       register struct symtab *p, *q;
-
-       for( i=0, p=stab; i<SYMTSZ; ++i, ++p ){
-               if( p->stype == TNULL ) continue;
-               j = lookup( p->sname, p->sflags&SMOS );
-               if( j != i ){
-                       q = &stab[j];
-                       if( q->stype == UNDEF ||
-                           q->slevel <= p->slevel ){
-                               cerror( "check error: %.8s", q->sname );
-                               }
-                       }
-               else if( p->slevel > lev ) cerror( "%.8s check at level %d", p->sname, lev );
-               }
-       }
-#endif
-
-struct symtab *
-relook(p) register struct symtab *p; {  /* look up p again, and see where it lies */
-
-       register struct symtab *q;
-
-       /* I'm not sure that this handles towers of several hidden definitions in all cases */
-       q = &stab[lookup( p->sname, p->sflags&(SMOS|SHIDDEN) )];
-       /* make relook always point to either p or an empty cell */
-       if( q->stype == UNDEF ){
-               q->stype = TNULL;
-               return(q);
-               }
-       while( q != p ){
-               if( q->stype == TNULL ) break;
-               if( ++q >= &stab[SYMTSZ] ) q=stab;
-               }
-       return(q);
-       }
-
-clearst( lev ){ /* clear entries of internal scope  from the symbol table */
-       register struct symtab *p, *q, *r;
-       register int temp, rehash;
-
-       temp = lineno;
-       aobeg();
-
-       /* first, find an empty slot to prevent newly hashed entries from
-          being slopped into... */
-
-       for( q=stab; q< &stab[SYMTSZ]; ++q ){
-               if( q->stype == TNULL )goto search;
-               }
-
-       cerror( "symbol table full");
-
-       search:
-       p = q;
-
-       for(;;){
-               if( p->stype == TNULL ) {
-                       rehash = 0;
-                       goto next;
-                       }
-               lineno = p->suse;
-               if( lineno < 0 ) lineno = - lineno;
-               if( p->slevel>lev ){ /* must clobber */
-                       if( p->stype == UNDEF || ( p->sclass == ULABEL && lev < 2 ) ){
-                               lineno = temp;
-                               uerror( "%.8s undefined", p->sname );
-                               }
-                       else aocode(p);
-                       if (ddebug) printf("removing %8s from stab[ %d], flags %o level %d\n",
-                               p->sname,p-stab,p->sflags,p->slevel);
-                       if( p->sflags & SHIDES ) unhide(p);
-                       p->stype = TNULL;
-                       rehash = 1;
-                       goto next;
-                       }
-               if( rehash ){
-                       if( (r=relook(p)) != p ){
-                               movestab( r, p );
-                               p->stype = TNULL;
-                               }
-                       }
-               next:
-               if( ++p >= &stab[SYMTSZ] ) p = stab;
-               if( p == q ) break;
-               }
-       lineno = temp;
-       aoend();
-       }
-
-movestab( p, q ) register struct symtab *p, *q; {
-       int k;
-       /* structure assignment: *p = *q; */
-       p->stype = q->stype;
-       p->sclass = q->sclass;
-       p->slevel = q->slevel;
-       p->offset = q->offset;
-       p->sflags = q->sflags;
-       p->dimoff = q->dimoff;
-       p->sizoff = q->sizoff;
-       p->suse = q->suse;
-       for( k=0; k<NCHNAM; ++k ){
-               p->sname[k] = q->sname[k];
-               }
-       }
-
-hide( p ) register struct symtab *p; {
-       register struct symtab *q;
-       for( q=p+1; ; ++q ){
-               if( q >= &stab[SYMTSZ] ) q = stab;
-               if( q == p ) cerror( "symbol table full" );
-               if( q->stype == TNULL ) break;
-               }
-       movestab( q, p );
-       p->sflags |= SHIDDEN;
-       q->sflags = (p->sflags&SMOS) | SHIDES;
-       if( hflag ) werror( "%.8s redefinition hides earlier one", p->sname );
-       if( ddebug ) printf( "  %d hidden in %d\n", p-stab, q-stab );
-       return( idname = q-stab );
-       }
-
-unhide( p ) register struct symtab *p; {
-       register struct symtab *q;
-       register s, j;
-
-       s = p->sflags & SMOS;
-       q = p;
-
-       for(;;){
-
-               if( q == stab ) q = &stab[SYMTSZ-1];
-               else --q;
-
-               if( q == p ) break;
-
-               if( (q->sflags&SMOS) == s ){
-                       for( j =0; j<NCHNAM; ++j ) if( p->sname[j] != q->sname[j] ) break;
-                       if( j == NCHNAM ){ /* found the name */
-                               q->sflags &= ~SHIDDEN;
-                               if( ddebug ) printf( "unhide uncovered %d from %d\n", q-stab,p-stab);
-                               return;
-                               }
-                       }
-
-               }
-       cerror( "unhide fails" );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/reader.c b/.ref-Research-V7/usr/src/cmd/mip/reader.c
deleted file mode 100644 (file)
index c1dec2f..0000000
+++ /dev/null
@@ -1,1253 +0,0 @@
-# include "mfile2"
-
-/*     some storage declarations */
-
-# ifndef ONEPASS
-NODE node[TREESZ];
-char filename[100] = "";  /* the name of the file */
-int ftnno;  /* number of current function */
-int lineno;
-# else
-# define NOMAIN
-#endif
-
-int nrecur;
-int lflag;
-int edebug = 0;
-int xdebug = 0;
-int udebug = 0;
-
-OFFSZ tmpoff;  /* offset for first temporary, in bits for current block */
-OFFSZ maxoff;  /* maximum temporary offset over all blocks in current ftn, in bits */
-int maxtreg;
-
-NODE *stotree;
-int stocook;
-
-OFFSZ baseoff = 0;
-OFFSZ maxtemp = 0;
-
-p2init( argc, argv ) char *argv[];{
-       /* set the values of the pass 2 arguments */
-
-       register int c;
-       register char *cp;
-       register files;
-
-       allo0();  /* free all regs */
-       files = 0;
-
-       for( c=1; c<argc; ++c ){
-               if( *(cp=argv[c]) == '-' ){
-                       while( *++cp ){
-                               switch( *cp ){
-
-                               case 'X':  /* pass1 flags */
-                                       while( *++cp ) { /* VOID */ }
-                                       --cp;
-                                       break;
-
-                               case 'l':  /* linenos */
-                                       ++lflag;
-                                       break;
-
-                               case 'e':  /* expressions */
-                                       ++edebug;
-                                       break;
-
-                               case 'o':  /* orders */
-                                       ++odebug;
-                                       break;
-
-                               case 'r':  /* register allocation */
-                                       ++rdebug;
-                                       break;
-
-                               case 'a':  /* rallo */
-                                       ++radebug;
-                                       break;
-
-                               case 't':  /* ttype calls */
-                                       ++tdebug;
-                                       break;
-
-                               case 's':  /* shapes */
-                                       ++sdebug;
-                                       break;
-
-                               case 'u':  /* Sethi-Ullman testing (machine dependent) */
-                                       ++udebug;
-                                       break;
-
-                               case 'x':  /* general machine-dependent debugging flag */
-                                       ++xdebug;
-                                       break;
-
-                               default:
-                                       cerror( "bad option: %c", *cp );
-                                       }
-                               }
-                       }
-               else files = 1;  /* assumed to be a filename */
-               }
-
-       mkdope();
-       setrew();
-       return( files );
-
-       }
-
-# ifndef NOMAIN
-
-mainp2( argc, argv ) char *argv[]; {
-       register files;
-       register temp;
-       register c;
-       register char *cp;
-       register NODE *p;
-
-       files = p2init( argc, argv );
-       tinit();
-
-       reread:
-
-       if( files ){
-               while( files < argc && argv[files][0] == '-' ) {
-                       ++files;
-                       }
-               if( files > argc ) return( nerrors );
-               freopen( argv[files], "r", stdin );
-               }
-       while( (c=getchar()) > 0 ) switch( c ){
-       case ')':
-               /* copy line unchanged */
-               while( (c=getchar()) > 0 ){
-                       PUTCHAR(c);
-                       if( c == '\n' ) break;
-                       }
-               continue;
-
-       case '[':
-               /* beginning of a block */
-               temp = rdin(10);  /* ftnno */
-               tmpoff = baseoff = rdin(10); /* autooff for block gives max offset of autos in block */
-               maxtreg = rdin(10);
-               if( getchar() != '\n' ) cerror( "intermediate file format error");
-
-               if( temp != ftnno ){ /* beginning of function */
-                       maxoff = baseoff;
-                       ftnno = temp;
-                       maxtemp = 0;
-                       }
-               else {
-                       if( baseoff > maxoff ) maxoff = baseoff;
-                       /* maxoff at end of ftn is max of autos and temps
-                          over all blocks in the function */
-                       }
-               setregs();
-               continue;
-
-       case ']':  /* end of block */
-               SETOFF( maxoff, ALSTACK );
-               eobl2();
-               while( (c=getchar()) != '\n' ){
-                       if( c <= 0 ) cerror( "intermediate file format eof" );
-                       }
-               continue;
-
-       case '.':
-               /* compile code for an expression */
-               lineno = rdin( 10 );
-               for( cp=filename; (*cp=getchar()) != '\n'; ++cp ) ; /* VOID, reads filename */
-               *cp = '\0';
-               if( lflag ) lineid( lineno, filename );
-
-               tmpoff = baseoff;  /* expression at top level reuses temps */
-               p = eread();
-
-               if( edebug ) fwalk( p, eprint, 0 );
-
-# ifdef MYREADER
-               MYREADER(p);  /* do your own laundering of the input */
-# endif
-
-               nrecur = 0;
-               delay( p );  /* expression statement  throws out results */
-               reclaim( p, RNULL, 0 );
-
-               allchk();
-               tcheck();
-               continue;
-
-       default:
-               cerror( "intermediate file format error" );
-
-               }
-
-       /* EOF */
-       if( files ) goto reread;
-       return(nerrors);
-
-       }
-
-# endif
-
-# ifdef ONEPASS
-
-p2compile( p ) NODE *p; {
-
-       if( lflag ) lineid( lineno, filename );
-       tmpoff = baseoff;  /* expression at top level reuses temps */
-       /* generate code for the tree p */
-       if( edebug ) fwalk( p, eprint, 0 );
-
-# ifdef MYREADER
-       MYREADER(p);  /* do your own laundering of the input */
-# endif
-       nrecur = 0;
-       delay( p );  /* do the code generation */
-       reclaim( p, RNULL, 0 );
-       allchk();
-       /* can't do tcheck here; some stuff (e.g., attributes) may be around from first pass */
-       /* first pass will do it... */
-       }
-
-p2bbeg( aoff, myreg ) {
-       static int myftn = -1;
-       tmpoff = baseoff = aoff;
-       maxtreg = myreg;
-       if( myftn != ftnno ){ /* beginning of function */
-               maxoff = baseoff;
-               myftn = ftnno;
-               maxtemp = 0;
-               }
-       else {
-               if( baseoff > maxoff ) maxoff = baseoff;
-               /* maxoff at end of ftn is max of autos and temps over all blocks */
-               }
-       setregs();
-       }
-
-p2bend(){
-       SETOFF( maxoff, ALSTACK );
-       eobl2();
-       }
-
-# endif
-
-NODE *deltrees[DELAYS];
-int deli;
-
-delay( p ) register NODE *p; {
-       /* look in all legal places for COMOP's and ++ and -- ops to delay */
-       /* note; don't delay ++ and -- within calls or things like
-       /* getchar (in their macro forms) will start behaving strangely */
-       register i;
-
-       /* look for visible COMOPS, and rewrite repeatedly */
-
-       while( delay1( p ) ) { /* VOID */ }
-
-       /* look for visible, delayable ++ and -- */
-
-       deli = 0;
-       delay2( p );
-       codgen( p, FOREFF );  /* do what is left */
-       for( i = 0; i<deli; ++i ) codgen( deltrees[i], FOREFF );  /* do the rest */
-       }
-
-delay1( p ) register NODE *p; {  /* look for COMOPS */
-       register o, ty;
-
-       o = p->op;
-       ty = optype( o );
-       if( ty == LTYPE ) return( 0 );
-       else if( ty == UTYPE ) return( delay1( p->left ) );
-
-       switch( o ){
-
-       case QUEST:
-       case ANDAND:
-       case OROR:
-               /* don't look on RHS */
-               return( delay1(p->left ) );
-
-       case COMOP:  /* the meat of the routine */
-               delay( p->left );  /* completely evaluate the LHS */
-               /* rewrite the COMOP */
-               { register NODE *q;
-                       q = p->right;
-                       ncopy( p, p->right );
-                       q->op = FREE;
-                       }
-               return( 1 );
-               }
-
-       return( delay1(p->left) || delay1(p->right ) );
-       }
-
-delay2( p ) register NODE *p; {
-
-       /* look for delayable ++ and -- operators */
-
-       register o, ty;
-       o = p->op;
-       ty = optype( o );
-
-       switch( o ){
-
-       case NOT:
-       case QUEST:
-       case ANDAND:
-       case OROR:
-       case CALL:
-       case UNARY CALL:
-       case STCALL:
-       case UNARY STCALL:
-       case FORTCALL:
-       case UNARY FORTCALL:
-       case COMOP:
-       case CBRANCH:
-               /* for the moment, don7t delay past a conditional context, or
-               /* inside of a call */
-               return;
-
-       case INCR:
-       case DECR:
-               if( deltest( p ) ){
-                       if( deli < DELAYS ){
-                               register NODE *q;
-                               deltrees[deli++] = tcopy(p);
-                               q = p->left;
-                               p->right->op = FREE;  /* zap constant */
-                               ncopy( p, q );
-                               q->op = FREE;
-                               return;
-                               }
-                       }
-
-               }
-
-       if( ty == BITYPE ) delay2( p->right );
-       if( ty != LTYPE ) delay2( p->left );
-       }
-
-codgen( p, cookie ) NODE *p; {
-
-       /* generate the code for p;
-          order may call codgen recursively */
-       /* cookie is used to describe the context */
-
-       for(;;){
-               canon(p);  /* creats OREG from * if possible and does sucomp */
-               stotree = NIL;
-               if( edebug ){
-                       printf( "store called on:\n" );
-                       fwalk( p, eprint, 0 );
-                       }
-               store(p);
-               if( stotree==NIL ) break;
-
-               /* because it's minimal, can do w.o. stores */
-
-               order( stotree, stocook );
-               }
-
-       order( p, cookie );
-
-       }
-
-char *cnames[] = {
-       "SANY",
-       "SAREG",
-       "STAREG",
-       "SBREG",
-       "STBREG",
-       "SCC",
-       "SNAME",
-       "SCON",
-       "SFLD",
-       "SOREG",
-       "STARNM",
-       "STARREG",
-       "INTEMP",
-       "FORARG",
-       "SWADD",
-       0,
-       };
-
-prcook( cookie ){
-
-       /* print a nice-looking description of cookie */
-
-       int i, flag;
-
-       if( cookie & SPECIAL ){
-               if( cookie == SZERO ) printf( "SZERO" );
-               else if( cookie == SONE ) printf( "SONE" );
-               else if( cookie == SMONE ) printf( "SMONE" );
-               else printf( "SPECIAL+%d", cookie & ~SPECIAL );
-               return;
-               }
-
-       flag = 0;
-       for( i=0; cnames[i]; ++i ){
-               if( cookie & (1<<i) ){
-                       if( flag ) printf( "|" );
-                       ++flag;
-                       printf( cnames[i] );
-                       }
-               }
-
-       }
-
-int odebug = 0;
-
-order(p,cook) NODE *p; {
-
-       register o, ty, m;
-       int m1;
-       int cookie;
-       NODE *p1, *p2;
-
-       /* by this time, p should be able to be generated without stores;
-          the only question is how */
-
-       again:
-
-       cookie = cook;
-       rcount();
-       canon(p);
-       rallo( p, p->rall );
-
-       if( odebug ){
-               printf( "order( %o, ", p );
-               prcook( cookie );
-               printf( " )\n" );
-               fwalk( p, eprint, 0 );
-               }
-
-       o = p->op;
-       ty = optype(o);
-
-       /* first of all, for most ops, see if it is in the table */
-
-       /* look for ops */
-
-       switch( m = p->op ){
-
-       default:
-               /* look for op in table */
-               for(;;){
-                       if( (m = match( p, cookie ) ) == MDONE ) goto cleanup;
-                       else if( m == MNOPE ){
-                               if( !(cookie = nextcook( p, cookie ) ) ) goto nomat;
-                               continue;
-                               }
-                       else break;
-                       }
-               break;
-
-       case COMOP:
-       case FORCE:
-       case CBRANCH:
-       case QUEST:
-       case ANDAND:
-       case OROR:
-       case NOT:
-       case UNARY CALL:
-       case CALL:
-       case UNARY STCALL:
-       case STCALL:
-       case UNARY FORTCALL:
-       case FORTCALL:
-               /* don't even go near the table... */
-               ;
-
-               }
-       /* get here to do rewriting if no match or
-          fall through from above for hard ops */
-
-       p1 = p->left;
-       if( ty == BITYPE ) p2 = p->right;
-       else p2 = NIL;
-       
-       if( odebug ){
-               printf( "order( %o, ", p );
-               prcook( cook );
-               printf( " ), cookie " );
-               prcook( cookie );
-               printf( ", rewrite %s\n", opst[m] );
-               }
-       switch( m ){
-       default:
-               nomat:
-               cerror( "no table entry for op %s", opst[p->op] );
-
-       case COMOP:
-               codgen( p1, FOREFF );
-               p2->rall = p->rall;
-               codgen( p2, cookie );
-               ncopy( p, p2 );
-               p2->op = FREE;
-               goto cleanup;
-
-       case FORCE:
-               /* recurse, letting the work be done by rallo */
-               p = p->left;
-               cook = INTAREG|INTBREG;
-               goto again;
-
-       case CBRANCH:
-               o = p2->lval;
-               cbranch( p1, -1, o );
-               p2->op = FREE;
-               p->op = FREE;
-               return;
-
-       case QUEST:
-               cbranch( p1, -1, m=getlab() );
-               p2->left->rall = p->rall;
-               codgen( p2->left, INTAREG|INTBREG );
-               /* force right to compute result into same reg used by left */
-               p2->right->rall = p2->left->rval|MUSTDO;
-               reclaim( p2->left, RNULL, 0 );
-               cbgen( 0, m1 = getlab(), 'I' );
-               deflab( m );
-               codgen( p2->right, INTAREG|INTBREG );
-               deflab( m1 );
-               p->op = REG;  /* set up node describing result */
-               p->lval = 0;
-               p->rval = p2->right->rval;
-               p->type = p2->right->type;
-               tfree( p2->right );
-               p2->op = FREE;
-               goto cleanup;
-
-       case ANDAND:
-       case OROR:
-       case NOT:  /* logical operators */
-               /* if here, must be a logical operator for 0-1 value */
-               cbranch( p, -1, m=getlab() );
-               p->op = CCODES;
-               p->label = m;
-               order( p, INTAREG );
-               goto cleanup;
-
-       case FLD:       /* fields of funny type */
-               if ( p1->op == UNARY MUL ){
-                       offstar( p1->left );
-                       goto again;
-                       }
-
-       case UNARY MINUS:
-               order( p1, INBREG|INAREG );
-               goto again;
-
-       case NAME:
-               /* all leaves end up here ... */
-               if( o == REG ) goto nomat;
-               order( p, INTAREG|INTBREG );
-               goto again;
-
-       case INIT:
-               uerror( "illegal initialization" );
-               return;
-
-       case UNARY FORTCALL:
-               p->right = NIL;
-       case FORTCALL:
-               o = p->op = UNARY FORTCALL;
-               if( genfcall( p, cookie ) ) goto nomat;
-               goto cleanup;
-
-       case UNARY CALL:
-               p->right = NIL;
-       case CALL:
-               o = p->op = UNARY CALL;
-               if( gencall( p, cookie ) ) goto nomat;
-               goto cleanup;
-
-       case UNARY STCALL:
-               p->right = NIL;
-       case STCALL:
-               o = p->op = UNARY STCALL;
-               if( genscall( p, cookie ) ) goto nomat;
-               goto cleanup;
-
-               /* if arguments are passed in register, care must be taken that reclaim
-               /* not throw away the register which now has the result... */
-
-       case UNARY MUL:
-               if( cook == FOREFF ){
-                       /* do nothing */
-                       order( p->left, FOREFF );
-                       p->op = FREE;
-                       return;
-                       }
-               offstar( p->left );
-               goto again;
-
-       case INCR:  /* INCR and DECR */
-               if( setincr(p) ) goto again;
-
-               /* x++ becomes (x += 1) -1; */
-
-               if( cook & FOREFF ){  /* result not needed so inc or dec and be done with it */
-                       /* x++ => x += 1 */
-                       p->op = (p->op==INCR)?ASG PLUS:ASG MINUS;
-                       goto again;
-                       }
-
-               p1 = tcopy(p);
-               reclaim( p->left, RNULL, 0 );
-               p->left = p1;
-               p1->op = (p->op==INCR)?ASG PLUS:ASG MINUS;
-               p->op = (p->op==INCR)?MINUS:PLUS;
-               goto again;
-
-       case STASG:
-               if( setstr( p ) ) goto again;
-               goto nomat;
-
-       case ASG PLUS:  /* and other assignment ops */
-               if( setasop(p) ) goto again;
-
-               /* there are assumed to be no side effects in LHS */
-
-               p2 = tcopy(p);
-               p->op = ASSIGN;
-               reclaim( p->right, RNULL, 0 );
-               p->right = p2;
-               canon(p);
-               rallo( p, p->rall );
-
-               if( odebug ) fwalk( p, eprint, 0 );
-
-               order( p2->left, INTBREG|INTAREG );
-               order( p2, INTBREG|INTAREG );
-               goto again;
-
-       case ASSIGN:
-               if( setasg( p ) ) goto again;
-               goto nomat;
-
-
-       case BITYPE:
-               if( setbin( p ) ) goto again;
-               /* try to replace binary ops by =ops */
-               switch(o){
-
-               case PLUS:
-               case MINUS:
-               case MUL:
-               case DIV:
-               case MOD:
-               case AND:
-               case OR:
-               case ER:
-               case LS:
-               case RS:
-                       p->op = ASG o;
-                       goto again;
-                       }
-               goto nomat;
-
-               }
-
-       cleanup:
-
-       /* if it is not yet in the right state, put it there */
-
-       if( cook & FOREFF ){
-               reclaim( p, RNULL, 0 );
-               return;
-               }
-
-       if( p->op==FREE ) return;
-
-       if( tshape( p, cook ) ) return;
-
-       if( (m=match(p,cook) ) == MDONE ) return;
-
-       /* we are in bad shape, try one last chance */
-       if( lastchance( p, cook ) ) goto again;
-
-       goto nomat;
-       }
-
-int callflag;
-int fregs;
-
-store( p ) register NODE *p; {
-
-       /* find a subtree of p which should be stored */
-
-       register o, ty;
-
-       o = p->op;
-       ty = optype(o);
-
-       if( ty == LTYPE ) return;
-
-       switch( o ){
-
-       case UNARY CALL:
-       case UNARY FORTCALL:
-       case UNARY STCALL:
-               ++callflag;
-               break;
-
-       case UNARY MUL:
-               if( asgop(p->left->op) ) stoasg( p->left, UNARY MUL );
-               break;
-
-       case CALL:
-       case FORTCALL:
-       case STCALL:
-               store( p->left );
-               stoarg( p->right, o );
-               ++callflag;
-               return;
-
-       case COMOP:
-               markcall( p->right );
-               if( p->right->su > fregs ) SETSTO( p, INTEMP );
-               store( p->left );
-               return;
-
-       case ANDAND:
-       case OROR:
-       case QUEST:
-               markcall( p->right );
-               if( p->right->su > fregs ) SETSTO( p, INTEMP );
-       case CBRANCH:   /* to prevent complicated expressions on the LHS from being stored */
-       case NOT:
-               constore( p->left );
-               return;
-
-               }
-
-       if( ty == UTYPE ){
-               store( p->left );
-               return;
-               }
-
-       if( asgop( p->right->op ) ) stoasg( p->right, o );
-
-       if( p->su>fregs ){ /* must store */
-               mkadrs( p );  /* set up stotree and stocook to subtree
-                                that must be stored */
-               }
-
-       store( p->right );
-       store( p->left );
-       }
-
-constore( p ) register NODE *p; {
-
-       /* store conditional expressions */
-       /* the point is, avoid storing expressions in conditional
-          conditional context, since the evaluation order is predetermined */
-
-       switch( p->op ) {
-
-       case ANDAND:
-       case OROR:
-       case QUEST:
-               markcall( p->right );
-       case NOT:
-               constore( p->left );
-               return;
-
-               }
-
-       store( p );
-       }
-
-markcall( p ) register NODE *p; {  /* mark off calls below the current node */
-
-       again:
-       switch( p->op ){
-
-       case UNARY CALL:
-       case UNARY STCALL:
-       case UNARY FORTCALL:
-       case CALL:
-       case STCALL:
-       case FORTCALL:
-               ++callflag;
-               return;
-
-               }
-
-       switch( optype( p->op ) ){
-
-       case BITYPE:
-               markcall( p->right );
-       case UTYPE:
-               p = p->left;
-               /* eliminate recursion (aren't I clever...) */
-               goto again;
-       case LTYPE:
-               return;
-               }
-
-       }
-
-stoarg( p, calltype ) register NODE *p; {
-       /* arrange to store the args */
-
-       if( p->op == CM ){
-               stoarg( p->left, calltype );
-               p = p->right ;
-               }
-       if( calltype == CALL ){
-               STOARG(p);
-               }
-       else if( calltype == STCALL ){
-               STOSTARG(p);
-               }
-       else {
-               STOFARG(p);
-               }
-       callflag = 0;
-       store(p);
-# ifndef NESTCALLS
-       if( callflag ){ /* prevent two calls from being active at once  */
-               SETSTO(p,INTEMP);
-               store(p); /* do again to preserve bottom up nature....  */
-               }
-#endif
-       }
-
-int negrel[] = { NE, EQ, GT, GE, LT, LE, UGT, UGE, ULT, ULE } ;  /* negatives of relationals */
-
-cbranch( p, true, false ) NODE *p; {
-       /* evaluate p for truth value, and branch to true or false
-       /* accordingly: label <0 means fall through */
-
-       register o, lab, flab, tlab;
-
-       lab = -1;
-
-       switch( o=p->op ){
-
-       case ULE:
-       case ULT:
-       case UGE:
-       case UGT:
-       case EQ:
-       case NE:
-       case LE:
-       case LT:
-       case GE:
-       case GT:
-               if( true < 0 ){
-                       o = p->op = negrel[ o-EQ ];
-                       true = false;
-                       false = -1;
-                       }
-#ifndef NOOPT
-               if( p->right->op == ICON && p->right->lval == 0 && p->right->name[0] == '\0' ){
-                       switch( o ){
-
-                       case UGT:
-                       case ULE:
-                               o = p->op = (o==UGT)?NE:EQ;
-                       case EQ:
-                       case NE:
-                       case LE:
-                       case LT:
-                       case GE:
-                       case GT:
-                               if( logop(p->left->op) ){
-                                       /* strange situation: e.g., (a!=0) == 0 */
-                                       /* must prevent reference to p->left->lable, so get 0/1 */
-                                       /* we could optimize, but why bother */
-                                       codgen( p->left, INAREG|INBREG );
-                                       }
-                               codgen( p->left, FORCC );
-                               cbgen( o, true, 'I' );
-                               break;
-
-                       case UGE:
-                               cbgen( 0, true, 'I' );  /* unconditional branch */
-                       case ULT:
-                               ;   /* do nothing for LT */
-                               }
-                       }
-               else
-#endif
-                       {
-                       p->label = true;
-                       codgen( p, FORCC );
-                       }
-               if( false>=0 ) cbgen( 0, false, 'I' );
-               reclaim( p, RNULL, 0 );
-               return;
-
-       case ANDAND:
-               lab = false<0 ? getlab() : false ;
-               cbranch( p->left, -1, lab );
-               cbranch( p->right, true, false );
-               if( false < 0 ) deflab( lab );
-               p->op = FREE;
-               return;
-
-       case OROR:
-               lab = true<0 ? getlab() : true;
-               cbranch( p->left, lab, -1 );
-               cbranch( p->right, true, false );
-               if( true < 0 ) deflab( lab );
-               p->op = FREE;
-               return;
-
-       case NOT:
-               cbranch( p->left, false, true );
-               p->op = FREE;
-               break;
-
-       case COMOP:
-               codgen( p->left, FOREFF );
-               p->op = FREE;
-               cbranch( p->right, true, false );
-               return;
-
-       case QUEST:
-               flab = false<0 ? getlab() : false;
-               tlab = true<0 ? getlab() : true;
-               cbranch( p->left, -1, lab = getlab() );
-               cbranch( p->right->left, tlab, flab );
-               deflab( lab );
-               cbranch( p->right->right, true, false );
-               if( true < 0 ) deflab( tlab);
-               if( false < 0 ) deflab( flab );
-               p->right->op = FREE;
-               p->op = FREE;
-               return;
-
-       case ICON:
-               if( p->type != FLOAT && p->type != DOUBLE ){
-
-                       if( p->lval || p->name[0] ){
-                               /* addresses of C objects are never 0 */
-                               if( true>=0 ) cbgen( 0, true, 'I' );
-                               }
-                       else if( false>=0 ) cbgen( 0, false, 'I' );
-                       p->op = FREE;
-                       return;
-                       }
-               /* fall through to default with other strange constants */
-
-       default:
-               /* get condition codes */
-               codgen( p, FORCC );
-               if( true >= 0 ) cbgen( NE, true, 'I' );
-               if( false >= 0 ) cbgen( true >= 0 ? 0 : EQ, false, 'I' );
-               reclaim( p, RNULL, 0 );
-               return;
-
-               }
-
-       }
-
-rcount(){ /* count recursions */
-       if( ++nrecur > NRECUR ){
-               cerror( "expression causes compiler loop: try simplifying" );
-               }
-
-       }
-
-eprint( p, down, a, b ) NODE *p; int *a, *b; {
-
-       *a = *b = down+1;
-       while( down >= 2 ){
-               printf( "\t" );
-               down -= 2;
-               }
-       if( down-- ) printf( "    " );
-
-
-       printf( "%o) %s", p, opst[p->op] );
-       switch( p->op ) { /* special cases */
-
-       case REG:
-               printf( " %s", rnames[p->rval] );
-               break;
-
-       case ICON:
-       case NAME:
-       case OREG:
-               printf( " " );
-               adrput( p );
-               break;
-
-       case STCALL:
-       case UNARY STCALL:
-       case STARG:
-       case STASG:
-               printf( " size=%d", p->stsize );
-               printf( " align=%d", p->stalign );
-               break;
-               }
-
-       printf( ", " );
-       tprint( p->type );
-       printf( ", " );
-       if( p->rall == NOPREF ) printf( "NOPREF" );
-       else {
-               if( p->rall & MUSTDO ) printf( "MUSTDO " );
-               else printf( "PREF " );
-               printf( "%s", rnames[p->rall&~MUSTDO]);
-               }
-       printf( ", SU= %d\n", p->su );
-
-       }
-
-# ifndef NOMAIN
-NODE *
-eread(){
-
-       /* call eread recursively to get subtrees, if any */
-
-       register NODE *p;
-       register i, c;
-       register char *pc;
-       register j;
-
-       i = rdin( 10 );
-
-       p = talloc();
-
-       p->op = i;
-
-       i = optype(i);
-
-       if( i == LTYPE ) p->lval = rdin( 10 );
-       if( i != BITYPE ) p->rval = rdin( 10 );
-
-       p->type = rdin(8 );
-       p->rall = NOPREF;  /* register allocation information */
-
-       if( p->op == STASG || p->op == STARG || p->op == STCALL || p->op == UNARY STCALL ){
-               p->stsize = (rdin( 10 ) + (SZCHAR-1) )/SZCHAR;
-               p->stalign = rdin(10) / SZCHAR;
-               if( getchar() != '\n' ) cerror( "illegal \n" );
-               }
-       else {   /* usual case */
-               if( p->op == REG ) rbusy( p->rval, p->type );  /* non usually, but sometimes justified */
-               for( pc=p->name,j=0; ( c = getchar() ) != '\n'; ++j ){
-                       if( j < NCHNAM ) *pc++ = c;
-                       }
-               if( j < NCHNAM ) *pc = '\0';
-               }
-
-       /* now, recursively read descendents, if any */
-
-       if( i != LTYPE ) p->left = eread();
-       if( i == BITYPE ) p->right = eread();
-
-       return( p );
-
-       }
-
-CONSZ
-rdin( base ){
-       register sign, c;
-       CONSZ val;
-
-       sign = 1;
-       val = 0;
-
-       while( (c=getchar()) > 0 ) {
-               if( c == '-' ){
-                       if( val != 0 ) cerror( "illegal -");
-                       sign = -sign;
-                       continue;
-                       }
-               if( c == '\t' ) break;
-               if( c>='0' && c<='9' ) {
-                       val *= base;
-                       if( sign > 0 )
-                               val += c-'0';
-                       else
-                               val -= c-'0';
-                       continue;
-                       }
-               cerror( "illegal character `%c' on intermediate file", c );
-               break;
-               }
-
-       if( c <= 0 ) {
-               cerror( "unexpected EOF");
-               }
-       return( val );
-       }
-# endif
-
-#ifndef FIELDOPS
-       /* do this if there is no special hardware support for fields */
-
-ffld( p, down, down1, down2 ) NODE *p; int *down1, *down2; {
-        /* look for fields that are not in an lvalue context, and rewrite them... */
-       register NODE *shp;
-       register s, o, v, ty;
-
-       *down1 =  asgop( p->op );
-       *down2 = 0;
-
-       if( !down && p->op == FLD ){ /* rewrite the node */
-
-               if( !rewfld(p) ) return;
-
-               ty = (szty(p->type) == 2)? LONG: INT;
-               v = p->rval;
-               s = UPKFSZ(v);
-# ifdef RTOLBYTES
-               o = UPKFOFF(v);  /* amount to shift */
-# else
-               o = szty(p->type)*SZINT - s - UPKFOFF(v);  /* amount to shift */
-#endif
-
-               /* make & mask part */
-
-               p->left->type = ty;
-
-               p->op = AND;
-               p->right = talloc();
-               p->right->op = ICON;
-               p->right->rall = NOPREF;
-               p->right->type = ty;
-               p->right->lval = 1;
-               p->right->rval = 0;
-               p->right->name[0] = '\0';
-               p->right->lval <<= s;
-               p->right->lval--;
-
-               /* now, if a shift is needed, do it */
-
-               if( o != 0 ){
-                       shp = talloc();
-                       shp->op = RS;
-                       shp->rall = NOPREF;
-                       shp->type = ty;
-                       shp->left = p->left;
-                       shp->right = talloc();
-                       shp->right->op = ICON;
-                       shp->right->rall = NOPREF;
-                       shp->right->type = ty;
-                       shp->right->rval = 0;
-                       shp->right->lval = o;  /* amount to shift */
-                       shp->right->name[0] = '\0';
-                       p->left = shp;
-                       /* whew! */
-                       }
-               }
-       }
-#endif
-
-oreg2( p ) register NODE *p; {
-
-       /* look for situations where we can turn * into OREG */
-
-       NODE *q;
-       register i;
-       register r;
-       register char *cp;
-       register NODE *ql, *qr;
-       CONSZ temp;
-
-       if( p->op == UNARY MUL ){
-               q = p->left;
-               if( q->op == REG ){
-                       temp = q->lval;
-                       r = q->rval;
-                       cp = q->name;
-                       goto ormake;
-                       }
-
-               if( q->op != PLUS && q->op != MINUS ) return;
-               ql = q->left;
-               qr = q->right;
-
-#ifdef R2REGS
-
-               /* look for doubly indexed expressions */
-
-               if( q->op==PLUS && qr->op==REG && ql->op==REG &&
-                               (szty(ql->type)==1||szty(qr->type)==1) ) {
-                       temp = 0;
-                       cp = ql->name;
-                       if( *cp ){
-                               if( *qr->name ) return;
-                               }
-                       else {
-                               cp = qr->name;
-                               }
-                       if( szty(qr->type)>1) r = R2PACK(qr->rval,ql->rval);
-                       else r = R2PACK(ql->rval,qr->rval);
-                       goto ormake;
-                       }
-
-               if( (q->op==PLUS||q->op==MINUS) && qr->op==ICON && ql->op==PLUS &&
-                               ql->left->op==REG &&
-                               ql->right->op==REG ){
-                       temp = qr->lval;
-                       cp = qr->name;
-                       if( q->op == MINUS ){
-                               if( *cp ) return;
-                               temp = -temp;
-                               }
-                       if( *cp ){
-                               if( *ql->name ) return;
-                               }
-                       else {
-                               cp = ql->name;
-                               }
-                       r = R2PACK(ql->left->rval,ql->right->rval);
-                       goto ormake;
-                       }
-
-#endif
-
-               if( (q->op==PLUS || q->op==MINUS) && qr->op == ICON &&
-                               ql->op==REG && szty(qr->type)==1) {
-                       temp = qr->lval;
-                       if( q->op == MINUS ) temp = -temp;
-                       r = ql->rval;
-                       temp += ql->lval;
-                       cp = qr->name;
-                       if( *cp && ( q->op == MINUS || *ql->name ) ) return;
-                       if( !*cp ) cp = ql->name;
-
-                       ormake:
-                       if( notoff( p->type, r, temp, cp ) ) return;
-                       p->op = OREG;
-                       p->rval = r;
-                       p->lval = temp;
-                       for( i=0; i<NCHNAM; ++i )
-                               p->name[i] = *cp++;
-                       tfree(q);
-                       return;
-                       }
-               }
-
-       }
-
-canon(p) NODE *p; {
-       /* put p in canonical form */
-       int oreg2(), sucomp();
-
-#ifndef FIELDOPS
-       int ffld();
-       fwalk( p, ffld, 0 ); /* look for field operators */
-# endif
-       walkf( p, oreg2 );  /* look for and create OREG nodes */
-#ifdef MYCANON
-       MYCANON(p);  /* your own canonicalization routine(s) */
-#endif
-       walkf( p, sucomp );  /* do the Sethi-Ullman computation */
-
-       }
-
diff --git a/.ref-Research-V7/usr/src/cmd/mip/scan.c b/.ref-Research-V7/usr/src/cmd/mip/scan.c
deleted file mode 100644 (file)
index 9d51ffd..0000000
+++ /dev/null
@@ -1,937 +0,0 @@
-# include "mfile1"
-# include <ctype.h>
-       /* temporarily */
-
-       /* lexical actions */
-
-# define A_ERR 0               /* illegal character */
-# define A_LET 1               /* saw a letter */
-# define A_DIG 2               /* saw a digit */
-# define A_1C 3                        /* return a single character */
-# define A_STR 4               /* string */
-# define A_CC 5                        /* character constant */
-# define A_BCD 6               /* GCOS BCD constant */
-# define A_SL 7                        /* saw a / */
-# define A_DOT 8               /* saw a . */
-# define A_PL 9                /* + */
-# define A_MI 10               /* - */
-# define A_EQ 11               /* = */
-# define A_NOT 12              /* ! */
-# define A_LT 13               /* < */
-# define A_GT 14               /* > */
-# define A_AND 16              /* & */
-# define A_OR 17               /* | */
-# define A_WS 18               /* whitespace (not \n) */
-# define A_NL 19               /* \n */
-
-       /* character classes */
-
-# define LEXLET 01
-# define LEXDIG 02
-# define LEXOCT 04
-# define LEXHEX 010
-# define LEXWS 020
-# define LEXDOT 040
-
-       /* reserved word actions */
-
-# define AR_TY 0               /* type word */
-# define AR_RW 1               /* simple reserved word */
-# define AR_CL 2               /* storage class word */
-# define AR_S 3                /* struct */
-# define AR_U 4                /* union */
-# define AR_E 5                /* enum */
-# define AR_A 6                /* asm */
-
-       /* text buffer */
-# define LXTSZ 100
-char yytext[LXTSZ];
-char * lxgcp;
-
-
-       /* ARGSUSED */
-mainp1( argc, argv ) int argc; char *argv[]; {  /* control multiple files */
-
-       register i;
-       register char *cp;
-       extern int idebug, bdebug, tdebug, edebug, ddebug, xdebug;
-
-       for( i=1; i<argc; ++i ){
-               if( *(cp=argv[i]) == '-' && *++cp == 'X' ){
-                       while( *++cp ){
-                               switch( *cp ){
-
-                               case 'd':
-                                       ++ddebug;
-                                       break;
-                               case 'i':
-                                       ++idebug;
-                                       break;
-                               case 'b':
-                                       ++bdebug;
-                                       break;
-                               case 't':
-                                       ++tdebug;
-                                       break;
-                               case 'e':
-                                       ++edebug;
-                                       break;
-                               case 'x':
-                                       ++xdebug;
-                                       break;
-                                       }
-                               }
-                       }
-               }
-
-# ifdef ONEPASS
-       p2init( argc, argv );
-# endif
-
-       for( i=0; i<SYMTSZ; ++i ) stab[i].stype = TNULL;
-
-       lxinit();
-       tinit();
-       mkdope();
-
-       lineno = 1;
-
-       /* dimension table initialization */
-
-       dimtab[NULL] = 0;
-       dimtab[CHAR] = SZCHAR;
-       dimtab[INT] = SZINT;
-       dimtab[FLOAT] = SZFLOAT;
-       dimtab[DOUBLE] = SZDOUBLE;
-       dimtab[LONG] = SZLONG;
-       dimtab[SHORT] = SZSHORT;
-       dimtab[UCHAR] = SZCHAR;
-       dimtab[USHORT] = SZSHORT;
-       dimtab[UNSIGNED] = SZINT;
-       dimtab[ULONG] = SZLONG;
-       /* starts past any of the above */
-       curdim = 16;
-       reached = 1;
-
-       yyparse();
-       yyaccpt();
-
-       ejobcode( nerrors ? 1 : 0 );
-       return(nerrors?1:0);
-
-       }
-
-# ifdef ibm
-
-# define CSMASK 0377
-# define CSSZ 256
-
-# else
-
-# define CSMASK 0177
-# define CSSZ 128
-
-# endif
-
-short lxmask[CSSZ+1];
-
-lxenter( s, m ) register char *s; register short m; {
-       /* enter a mask into lxmask */
-       register c;
-
-       while( c= *s++ ) lxmask[c+1] |= m;
-
-       }
-
-
-# define lxget(c,m) (lxgcp=yytext,lxmore(c,m))
-
-lxmore( c, m )  register c, m; {
-       register char *cp;
-
-       *(cp = lxgcp) = c;
-       while( c=getchar(), lxmask[c+1]&m ){
-               if( cp < &yytext[LXTSZ-1] ){
-                       *++cp = c;
-                       }
-               }
-       ungetc(c,stdin);
-       *(lxgcp = cp+1) = '\0';
-       }
-
-struct lxdope {
-       short lxch;     /* the character */
-       short lxact;    /* the action to be performed */
-       short lxtok;    /* the token number to be returned */
-       short lxval;    /* the value to be returned */
-       } lxdope[] = {
-
-       '$',    A_ERR,  0,      0,      /* illegal characters go here... */
-       '_',    A_LET,  0,      0,      /* letters point here */
-       '0',    A_DIG,  0,      0,      /* digits point here */
-       ' ',    A_WS,   0,      0,      /* whitespace goes here */
-       '\n',   A_NL,   0,      0,
-       '"',    A_STR,  0,      0,      /* character string */
-       '\'',   A_CC,   0,      0,      /* character constant */
-       '`',    A_BCD,  0,      0,      /* GCOS BCD constant */
-       '(',    A_1C,   LP,     0,
-       ')',    A_1C,   RP,     0,
-       '{',    A_1C,   LC,     0,
-       '}',    A_1C,   RC,     0,
-       '[',    A_1C,   LB,     0,
-       ']',    A_1C,   RB,     0,
-       '*',    A_1C,   MUL,    MUL,
-       '?',    A_1C,   QUEST,  0,
-       ':',    A_1C,   COLON,  0,
-       '+',    A_PL,   PLUS,   PLUS,
-       '-',    A_MI,   MINUS,  MINUS,
-       '/',    A_SL,   DIVOP,  DIV,
-       '%',    A_1C,   DIVOP,  MOD,
-       '&',    A_AND,  AND,    AND,
-       '|',    A_OR,   OR,     OR,
-       '^',    A_1C,   ER,     ER,
-       '!',    A_NOT,  UNOP,   NOT,
-       '~',    A_1C,   UNOP,   COMPL,
-       ',',    A_1C,   CM,     CM,
-       ';',    A_1C,   SM,     0,
-       '.',    A_DOT,  STROP,  DOT,
-       '<',    A_LT,   RELOP,  LT,
-       '>',    A_GT,   RELOP,  GT,
-       '=',    A_EQ,   ASSIGN, ASSIGN,
-       -1,     A_1C,   0,      0,
-       };
-
-struct lxdope *lxcp[CSSZ+1];
-
-lxinit(){
-       register struct lxdope *p;
-       register i;
-       register char *cp;
-       /* set up character classes */
-
-       lxenter( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", LEXLET );
-       lxenter( "0123456789", LEXDIG );
-       lxenter( "0123456789abcdefABCDEF", LEXHEX );
-       lxenter( " \t\r\b\f", LEXWS );
-       lxenter( "01234567", LEXOCT );
-       lxmask['.'+1] |= LEXDOT;
-
-       /* make lxcp point to appropriate lxdope entry for each character */
-
-       /* initialize error entries */
-
-       for( i= 0; i<=CSSZ; ++i ) lxcp[i] = lxdope;
-
-       /* make unique entries */
-
-       for( p=lxdope; ; ++p ) {
-               lxcp[p->lxch+1] = p;
-               if( p->lxch < 0 ) break;
-               }
-
-       /* handle letters, digits, and whitespace */
-       /* by convention, first, second, and third places */
-
-       cp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-       while( *cp ) lxcp[*cp++ + 1] = &lxdope[1];
-       cp = "123456789";
-       while( *cp ) lxcp[*cp++ + 1] = &lxdope[2];
-       cp = "\t\b\r\f";
-       while( *cp ) lxcp[*cp++ + 1] = &lxdope[3];
-
-       /* first line might have title */
-       lxtitle();
-
-       }
-
-int lxmatch;  /* character to be matched in char or string constant */
-
-lxstr(ct){
-       /* match a string or character constant, up to lxmatch */
-
-       register c;
-       register val;
-       register i;
-
-       i=0;
-       while( (c=getchar()) != lxmatch ){
-               switch( c ) {
-
-               case EOF:
-                       uerror( "unexpected EOF" );
-                       break;
-
-               case '\n':
-                       uerror( "newline in string or char constant" );
-                       ++lineno;
-                       break;
-
-               case '\\':
-                       switch( c = getchar() ){
-
-                       case '\n':
-                               ++lineno;
-                               continue;
-
-                       default:
-                               val = c;
-                               goto mkcc;
-
-                       case 'n':
-                               val = '\n';
-                               goto mkcc;
-
-                       case 'r':
-                               val = '\r';
-                               goto mkcc;
-
-                       case 'b':
-                               val = '\b';
-                               goto mkcc;
-
-                       case 't':
-                               val = '\t';
-                               goto mkcc;
-
-                       case 'f':
-                               val = '\f';
-                               goto mkcc;
-
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                               val = c-'0';
-                               c=getchar();  /* try for 2 */
-                               if( lxmask[c+1] & LEXOCT ){
-                                       val = (val<<3) | (c-'0');
-                                       c = getchar();  /* try for 3 */
-                                       if( lxmask[c+1] & LEXOCT ){
-                                               val = (val<<3) | (c-'0');
-                                               }
-                                       else ungetc( c ,stdin);
-                                       }
-                               else ungetc( c ,stdin);
-
-                               goto mkcc1;
-
-                               }
-               default:
-                       val =c;
-               mkcc:
-                       val = CCTRANS(val);
-               mkcc1:
-                       if( lxmatch == '\'' ){
-                               val = CHARCAST(val);  /* it is, after all, a "character" constant */
-                               makecc( val, i );
-                               }
-                       else { /* stash the byte into the string */
-                               if( strflg ) {
-                                       if( ct==0 || i<ct ) putbyte( val );
-                                       else if( i == ct ) werror( "non-null byte ignored in string initializer" );
-                                       }
-                               else bycode( val, i );
-                               }
-                       ++i;
-                       continue;
-                       }
-               break;
-               }
-       /* end of string or  char constant */
-
-       if( lxmatch == '"' ){
-               if( strflg ){ /* end the string */
-                       if( ct==0 || i<ct ) putbyte( 0 );  /* the null at the end */
-                       }
-               else {  /* the initializer gets a null byte */
-                       bycode( 0, i++ );
-                       bycode( -1, i );
-                       dimtab[curdim] = i;  /* in case of later sizeof ... */
-                       }
-               }
-       else { /* end the character constant */
-               if( i == 0 ) uerror( "empty character constant" );
-               if( i>(SZINT/SZCHAR) || ( (pflag||hflag)&&i>1) )
-                       uerror( "too many characters in character constant" );
-               }
-       }
-
-lxcom(){
-       register c;
-       /* saw a /*: process a comment */
-
-       for(;;){
-
-               switch( c = getchar() ){
-
-               case EOF:
-                       uerror( "unexpected EOF" );
-                       return;
-
-               case '\n':
-                       ++lineno;
-
-               default:
-                       continue;
-
-               case '*':
-                       if( (c = getchar()) == '/' ) return;
-                       else ungetc( c ,stdin);
-                       continue;
-
-# ifdef LINT
-               case 'V':
-                       lxget( c, LEXLET|LEXDIG );
-                       {
-                               extern int vaflag;
-                               int i;
-                               i = yytext[7]?yytext[7]-'0':0;
-                               yytext[7] = '\0';
-                               if( strcmp( yytext, "VARARGS" ) ) continue;
-                               vaflag = i;
-                               continue;
-                               }
-               case 'L':
-                       lxget( c, LEXLET );
-                       if( strcmp( yytext, "LINTLIBRARY" ) ) continue;
-                       {
-                               extern int libflag;
-                               libflag = 1;
-                               }
-                       continue;
-
-               case 'A':
-                       lxget( c, LEXLET );
-                       if( strcmp( yytext, "ARGSUSED" ) ) continue;
-                       {
-                               extern int argflag, vflag;
-                               argflag = 1;
-                               vflag = 0;
-                               }
-                       continue;
-
-               case 'N':
-                       lxget( c, LEXLET );
-                       if( strcmp( yytext, "NOTREACHED" ) ) continue;
-                       reached = 0;
-                       continue;
-# endif
-                       }
-               }
-       }
-
-yylex(){
-       for(;;){
-
-               register lxchar;
-               register struct lxdope *p;
-               register struct symtab *sp;
-               int id;
-
-               switch( (p=lxcp[(lxchar=getchar())+1])->lxact ){
-
-               onechar:
-                       ungetc( lxchar ,stdin);
-
-               case A_1C:
-                       /* eat up a single character, and return an opcode */
-
-                       yylval.intval = p->lxval;
-                       return( p->lxtok );
-
-               case A_ERR:
-                       uerror( "illegal character: %03o (octal)", lxchar );
-                       break;
-
-               case A_LET:
-                       /* collect an identifier, check for reserved word, and return */
-                       lxget( lxchar, LEXLET|LEXDIG );
-                       if( (lxchar=lxres()) > 0 ) return( lxchar ); /* reserved word */
-                       if( lxchar== 0 ) continue;
-                       id = lookup( yytext, (stwart&(INSTRUCT|INUNION|FUNNYNAME))?SMOS:0 );
-                       sp = &stab[id];
-                       if( sp->sclass == TYPEDEF && !stwart ){
-                               stwart = instruct;
-                               yylval.nodep = mkty( sp->stype, sp->dimoff, sp->sizoff );
-                               return( TYPE );
-                               }
-                       stwart = (stwart&SEENAME) ? instruct : 0;
-                       yylval.intval = id;
-                       return( NAME );
-
-               case A_DIG:
-                       /* collect a digit string, then look at last one... */
-                       lastcon = 0;
-                       lxget( lxchar, LEXDIG );
-                       switch( lxchar=getchar() ){
-
-                       case 'x':
-                       case 'X':
-                               if( yytext[0] != '0' && !yytext[1] ) uerror( "illegal hex constant" );
-                               lxmore( lxchar, LEXHEX );
-                               /* convert the value */
-                               {
-                                       register char *cp;
-                                       for( cp = yytext+2; *cp; ++cp ){
-                                               /* this code won't work for all wild character sets,
-                                                  but seems ok for ascii and ebcdic */
-                                               lastcon <<= 4;
-                                               if( isdigit( *cp ) ) lastcon += *cp-'0';
-                                               else if( isupper( *cp ) ) lastcon += *cp - 'A'+ 10;
-                                               else lastcon += *cp - 'a'+ 10;
-                                               }
-                                       }
-
-                       hexlong:
-                               /* criterion for longness for hex and octal constants is that it
-                                  fit within 0177777 */
-                               if( lastcon & ~0177777L ) yylval.intval = 1;
-                               else yylval.intval = 0;
-
-                               goto islong;
-
-                       case '.':
-                               lxmore( lxchar, LEXDIG );
-
-                       getfp:
-                               if( (lxchar=getchar()) == 'e' || lxchar == 'E' ){ /* exponent */
-
-                       case 'e':
-                       case 'E':
-                                       if( (lxchar=getchar()) == '+' || lxchar == '-' ){
-                                               *lxgcp++ = 'e';
-                                               }
-                                       else {
-                                               ungetc(lxchar,stdin);
-                                               lxchar = 'e';
-                                               }
-                                       lxmore( lxchar, LEXDIG );
-                                       /* now have the whole thing... */
-                                       }
-                               else {  /* no exponent */
-                                       ungetc( lxchar ,stdin);
-                                       }
-                               return( isitfloat( yytext ) );
-
-                       default:
-                               ungetc( lxchar ,stdin);
-                               if( yytext[0] == '0' ){
-                                       /* convert in octal */
-                                       register char *cp;
-                                       for( cp = yytext+1; *cp; ++cp ){
-                                               lastcon <<= 3;
-                                               lastcon += *cp - '0';
-                                               }
-                                       goto hexlong;
-                                       }
-                               else {
-                                       /* convert in decimal */
-                                       register char *cp;
-                                       for( cp = yytext; *cp; ++cp ){
-                                               lastcon = lastcon * 10 + *cp - '0';
-                                               }
-                                       }
-
-                               /* decide if it is long or not (decimal case) */
-
-                               /* if it is positive and fits in 15 bits, or negative and
-                                  and fits in 15 bits plus an extended sign, it is int; otherwise long */
-                               /* if there is an l or L following, all bets are off... */
-
-                               {       CONSZ v;
-                                       v = lastcon & ~077777L;
-                                       if( v == 0 || v == ~077777L ) yylval.intval = 0;
-                                       else yylval.intval = 1;
-                                       }
-
-                       islong:
-                               /* finally, look for trailing L or l */
-                               if( (lxchar = getchar()) == 'L' || lxchar == 'l' ) yylval.intval = 1;
-                               else ungetc( lxchar ,stdin);
-                               return( ICON );
-                               }
-
-               case A_DOT:
-                       /* look for a dot: if followed by a digit, floating point */
-                       lxchar = getchar();
-                       if( lxmask[lxchar+1] & LEXDIG ){
-                               ungetc(lxchar,stdin);
-                               lxget( '.', LEXDIG );
-                               goto getfp;
-                               }
-                       stwart = FUNNYNAME;
-                       goto onechar;
-
-               case A_STR:
-                       /* string constant */
-                       lxmatch = '"';
-                       return( STRING );
-
-               case A_CC:
-                       /* character constant */
-                       lxmatch = '\'';
-                       lastcon = 0;
-                       lxstr(0);
-                       yylval.intval = 0;
-                       return( ICON );
-
-               case A_BCD:
-                       {
-                               register i;
-                               int j;
-                               for( i=0; i<LXTSZ; ++i ){
-                                       if( ( j = getchar() ) == '`' ) break;
-                                       if( j == '\n' ){
-                                               uerror( "newline in BCD constant" );
-                                               break;
-                                               }
-                                       yytext[i] = j;
-                                       }
-                               yytext[i] = '\0';
-                               if( i>6 ) uerror( "BCD constant exceeds 6 characters" );
-# ifdef gcos
-                               else strtob( yytext, &lastcon, i );
-                               lastcon >>= 6*(6-i);
-# else
-                               uerror( "gcos BCD constant illegal" );
-# endif
-                               yylval.intval = 0;  /* not long */
-                               return( ICON );
-                               }
-
-               case A_SL:
-                       /* / */
-                       if( (lxchar=getchar()) != '*' ) goto onechar;
-                       lxcom();
-               case A_WS:
-                       continue;
-
-               case A_NL:
-                       ++lineno;
-                       lxtitle();
-                       continue;
-
-               case A_NOT:
-                       /* ! */
-                       if( (lxchar=getchar()) != '=' ) goto onechar;
-                       yylval.intval = NE;
-                       return( EQUOP );
-
-               case A_MI:
-                       /* - */
-                       if( (lxchar=getchar()) == '-' ){
-                               yylval.intval = DECR;
-                               return( INCOP );
-                               }
-                       if( lxchar != '>' ) goto onechar;
-                       stwart = FUNNYNAME;
-                       yylval.intval=STREF;
-                       return( STROP );
-
-               case A_PL:
-                       /* + */
-                       if( (lxchar=getchar()) != '+' ) goto onechar;
-                       yylval.intval = INCR;
-                       return( INCOP );
-
-               case A_AND:
-                       /* & */
-                       if( (lxchar=getchar()) != '&' ) goto onechar;
-                       return( yylval.intval = ANDAND );
-
-               case A_OR:
-                       /* | */
-                       if( (lxchar=getchar()) != '|' ) goto onechar;
-                       return( yylval.intval = OROR );
-
-               case A_LT:
-                       /* < */
-                       if( (lxchar=getchar()) == '<' ){
-                               yylval.intval = LS;
-                               return( SHIFTOP );
-                               }
-                       if( lxchar != '=' ) goto onechar;
-                       yylval.intval = LE;
-                       return( RELOP );
-
-               case A_GT:
-                       /* > */
-                       if( (lxchar=getchar()) == '>' ){
-                               yylval.intval = RS;
-                               return(SHIFTOP );
-                               }
-                       if( lxchar != '=' ) goto onechar;
-                       yylval.intval = GE;
-                       return( RELOP );
-
-               case A_EQ:
-                       /* = */
-                       switch( lxchar = getchar() ){
-
-                       case '=':
-                               yylval.intval = EQ;
-                               return( EQUOP );
-
-                       case '+':
-                               yylval.intval = ASG PLUS;
-                               break;
-
-                       case '-':
-                               yylval.intval = ASG MINUS;
-
-                       warn:
-                               if( lxmask[ (lxchar=getchar())+1] & (LEXLET|LEXDIG|LEXDOT) ){
-                                       werror( "ambiguous assignment: assignment op taken" );
-                                       }
-                               ungetc( lxchar ,stdin);
-                               break;
-
-                       case '*':
-                               yylval.intval = ASG MUL;
-                               goto warn;
-
-                       case '/':
-                               yylval.intval = ASG DIV;
-                               break;
-
-                       case '%':
-                               yylval.intval = ASG MOD;
-                               break;
-
-                       case '&':
-                               yylval.intval = ASG AND;
-                               break;
-
-                       case '|':
-                               yylval.intval = ASG OR;
-                               break;
-
-                       case '^':
-                               yylval.intval = ASG ER;
-                               break;
-
-                       case '<':
-                               if( (lxchar=getchar()) != '<' ){
-                                       uerror( "=<%c illegal", lxchar );
-                                       }
-                               yylval.intval = ASG LS;
-                               break;
-
-                       case '>':
-                               if( (lxchar=getchar()) != '>' ){
-                                       uerror( "=>%c illegal", lxchar );
-                                       }
-                               yylval.intval = ASG RS;
-                               break;
-
-                       default:
-                               goto onechar;
-
-                               }
-
-                       return( ASOP );
-
-               default:
-                       cerror( "yylex error, character %03o (octal)", lxchar );
-
-                       }
-
-               /* ordinarily, repeat here... */
-               cerror( "out of switch in yylex" );
-
-               }
-
-       }
-
-struct lxrdope {
-       /* dope for reserved, in alphabetical order */
-
-       char *lxrch;    /* name of reserved word */
-       short lxract;   /* reserved word action */
-       short lxrval;   /* value to be returned */
-       } lxrdope[] = {
-
-       "asm",          AR_A,   0,
-       "auto",         AR_CL,  AUTO,
-       "break",        AR_RW,  BREAK,
-       "char",         AR_TY,  CHAR,
-       "case",         AR_RW,  CASE,
-       "continue",     AR_RW,  CONTINUE,
-       "double",       AR_TY,  DOUBLE,
-       "default",      AR_RW,  DEFAULT,
-       "do",           AR_RW,  DO,
-       "extern",       AR_CL,  EXTERN,
-       "else",         AR_RW,  ELSE,
-       "enum",         AR_E,   ENUM,
-       "for",          AR_RW,  FOR,
-       "float",        AR_TY,  FLOAT,
-       "fortran",      AR_CL,  FORTRAN,
-       "goto",         AR_RW,  GOTO,
-       "if",           AR_RW,  IF,
-       "int",          AR_TY,  INT,
-       "long",         AR_TY,  LONG,
-       "return",       AR_RW,  RETURN,
-       "register",     AR_CL,  REGISTER,
-       "switch",       AR_RW,  SWITCH,
-       "struct",       AR_S,   0,
-       "sizeof",       AR_RW,  SIZEOF,
-       "short",        AR_TY,  SHORT,
-       "static",       AR_CL,  STATIC,
-       "typedef",      AR_CL,  TYPEDEF,
-       "unsigned",     AR_TY,  UNSIGNED,
-       "union",        AR_U,   0,
-       "while",        AR_RW,  WHILE,
-       "",             0,      0,      /* to stop the search */
-       };
-
-lxres() {
-       /* check to see of yytext is reserved; if so,
-       /* do the appropriate action and return */
-       /* otherwise, return -1 */
-
-       register c, ch;
-       register struct lxrdope *p;
-
-       ch = yytext[0];
-
-       if( !islower(ch) ) return( -1 );
-
-       switch( ch ){
-
-       case 'a':
-               c=0; break;
-       case 'b':
-               c=2; break;
-       case 'c':
-               c=3; break;
-       case 'd':
-               c=6; break;
-       case 'e':
-               c=9; break;
-       case 'f':
-               c=12; break;
-       case 'g':
-               c=15; break;
-       case 'i':
-               c=16; break;
-       case 'l':
-               c=18; break;
-       case 'r':
-               c=19; break;
-       case 's':
-               c=21; break;
-       case 't':
-               c=26; break;
-       case 'u':
-               c=27; break;
-       case 'w':
-               c=29; break;
-
-       default:
-               return( -1 );
-               }
-
-       for( p= lxrdope+c; p->lxrch[0] == ch; ++p ){
-               if( !strcmp( yytext, p->lxrch ) ){ /* match */
-                       switch( p->lxract ){
-
-                       case AR_TY:
-                               /* type word */
-                               stwart = instruct;
-                               yylval.nodep = mkty( (TWORD)p->lxrval, 0, p->lxrval );
-                               return( TYPE );
-
-                       case AR_RW:
-                               /* ordinary reserved word */
-                               return( yylval.intval = p->lxrval );
-
-                       case AR_CL:
-                               /* class word */
-                               yylval.intval = p->lxrval;
-                               return( CLASS );
-
-                       case AR_S:
-                               /* struct */
-                               stwart = INSTRUCT|SEENAME;
-                               yylval.intval = INSTRUCT;
-                               return( STRUCT );
-
-                       case AR_U:
-                               /* union */
-                               stwart = INUNION|SEENAME;
-                               yylval.intval = INUNION;
-                               return( STRUCT );
-
-                       case AR_E:
-                               /* enums */
-                               stwart = SEENAME;
-                               return( yylval.intval = ENUM );
-
-                       case AR_A:
-                               /* asm */
-                               lxget( ' ', LEXWS );
-                               if( getchar() != '(' ) goto badasm;
-                               lxget( ' ', LEXWS );
-                               if( getchar() != '"' ) goto badasm;
-# ifndef ONEPASS
-# ifndef LINT
-                               putchar(')');
-# endif
-# endif
-                               while( (c=getchar()) != '"' ){
-                                       if( c=='\n' || c==EOF ) goto badasm;
-# ifndef LINT
-                                       putchar(c);
-# endif
-                                       }
-                               lxget( ' ', LEXWS );
-                               if( getchar() != ')' ) goto badasm;
-# ifndef LINT
-                               putchar('\n');
-# endif
-                               return( 0 );
-
-                       badasm:
-                               uerror( "bad asm construction" );
-                               return( 0 );
-
-                       default:
-                               cerror( "bad AR_?? action" );
-                               }
-                       }
-               }
-       return( -1 );
-       }
-
-lxtitle(){
-       /* called after a newline; set linenumber and file name */
-
-       register c, val;
-       register char *cp;
-
-       for(;;){  /* might be several such lines in a row */
-               if( (c=getchar()) != '#' ){
-                       if( c != EOF ) ungetc(c,stdin);
-                       return;
-                       }
-
-               lxget( ' ', LEXWS );
-               val = 0;
-               for( c=getchar(); isdigit(c); c=getchar() ){
-                       val = val*10+ c - '0';
-                       }
-               ungetc( c, stdin );
-               lineno = val;
-               lxget( ' ', LEXWS );
-               if( (c=getchar()) != '\n' ){
-                       for( cp=ftitle; c!='\n'; c=getchar(),++cp ){
-                               *cp = c;
-                               }
-                       *cp = '\0';
-                       }
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mip/trees.c b/.ref-Research-V7/usr/src/cmd/mip/trees.c
deleted file mode 100644 (file)
index 755d029..0000000
+++ /dev/null
@@ -1,1388 +0,0 @@
-# include "mfile1"
-
-/*     some special actions, used in finding the type of nodes */
-# define NCVT 01
-# define PUN 02
-# define TYPL 04
-# define TYPR 010
-# define TYMATCH 040
-# define LVAL 0100
-# define CVTO 0200
-# define CVTL 0400
-# define CVTR 01000
-# define PTMATCH 02000
-# define OTHER 04000
-# define NCVTR 010000
-
-/* node conventions:
-
-       NAME:   rval>0 is stab index for external
-               rval<0 is -inlabel number
-               lval is offset in bits
-       ICON:   lval has the value
-               rval has the STAB index, or - label number,
-                       if a name whose address is in the constant
-               rval = NONAME means no name
-       REG:    rval is reg. identification cookie
-
-       */
-
-int bdebug = 0;
-
-NODE *
-buildtree( o, l, r ) register NODE *l, *r; {
-       register NODE *p, *q;
-       register actions;
-       register opty;
-       register struct symtab *sp;
-       register NODE *lr, *ll;
-       int i;
-       extern int eprint();
-
-       if( bdebug ) printf( "buildtree( %s, %o, %o )\n", opst[o], l, r );
-       opty = optype(o);
-
-       /* check for constants */
-
-       if( opty == UTYPE && l->op == ICON ){
-
-               switch( o ){
-
-               case NOT:
-                       if( hflag ) werror( "constant argument to NOT" );
-               case UNARY MINUS:
-               case COMPL:
-                       if( conval( l, o, l ) ) return(l);
-                       break;
-
-                       }
-               }
-
-       else if( o==UNARY MINUS && l->op==FCON ){
-               l->dval = -l->dval;
-               return(l);
-               }
-
-       else if( o==QUEST && l->op==ICON ) {
-               l->op = FREE;
-               r->op = FREE;
-               if( l->lval ){
-                       tfree( r->right );
-                       return( r->left );
-                       }
-               else {
-                       tfree( r->left );
-                       return( r->right );
-                       }
-               }
-
-       else if( (o==ANDAND || o==OROR) && (l->op==ICON||r->op==ICON) ) goto ccwarn;
-
-       else if( opty == BITYPE && l->op == ICON && r->op == ICON ){
-
-               switch( o ){
-
-               case ULT:
-               case UGT:
-               case ULE:
-               case UGE:
-               case LT:
-               case GT:
-               case LE:
-               case GE:
-               case EQ:
-               case NE:
-               case ANDAND:
-               case OROR:
-               case CBRANCH:
-
-               ccwarn:
-                       if( hflag ) werror( "constant in conditional context" );
-
-               case PLUS:
-               case MINUS:
-               case MUL:
-               case DIV:
-               case MOD:
-               case AND:
-               case OR:
-               case ER:
-               case LS:
-               case RS:
-                       if( conval( l, o, r ) ) {
-                               r->op = FREE;
-                               return(l);
-                               }
-                       break;
-                       }
-               }
-
-       else if( opty == BITYPE && (l->op==FCON||l->op==ICON) &&
-               (r->op==FCON||r->op==ICON) ){
-               switch(o){
-               case PLUS:
-               case MINUS:
-               case MUL:
-               case DIV:
-                       if( l->op == ICON ){
-                               l->dval = l->lval;
-                               }
-                       if( r->op == ICON ){
-                               r->dval = r->lval;
-                               }
-                       l->op = FCON;
-                       l->type = l->csiz = DOUBLE;
-                       r->op = FREE;
-                       switch(o){
-                       case PLUS:
-                               l->dval += r->dval;
-                               return(l);
-                       case MINUS:
-                               l->dval -= r->dval;
-                               return(l);
-                       case MUL:
-                               l->dval *= r->dval;
-                               return(l);
-                       case DIV:
-                               if( r->dval == 0 ) uerror( "division by 0." );
-                               else l->dval /= r->dval;
-                               return(l);
-                               }
-                       }
-               }
-
-       /* its real; we must make a new node */
-
-       p = block( o, l, r, INT, 0, INT );
-
-       actions = opact(p);
-
-       if( actions&LVAL ){ /* check left descendent */
-               if( notlval(p->left) ) {
-                       uerror( "lvalue required" );
-                       }
-               }
-
-       if( actions & NCVTR ){
-               p->left = pconvert( p->left );
-               }
-       else if( !(actions & NCVT ) ){
-               switch( opty ){
-
-               case BITYPE:
-                       p->right = pconvert( p->right );
-               case UTYPE:
-                       p->left = pconvert( p->left );
-
-                       }
-               }
-
-       if( (actions&PUN) && (o!=CAST||cflag) ){
-               chkpun(p);
-               }
-
-       if( actions & (TYPL|TYPR) ){
-
-               q = (actions&TYPL) ? p->left : p->right;
-
-               p->type = q->type;
-               p->cdim = q->cdim;
-               p->csiz = q->csiz;
-               }
-
-       if( actions & CVTL ) p = convert( p, CVTL );
-       if( actions & CVTR ) p = convert( p, CVTR );
-       if( actions & TYMATCH ) p = tymatch(p);
-       if( actions & PTMATCH ) p = ptmatch(p);
-
-       if( actions & OTHER ){
-               l = p->left;
-               r = p->right;
-
-               switch(o){
-
-               case NAME:
-                       sp = &stab[idname];
-                       if( sp->stype == UNDEF ){
-                               uerror( "%.8s undefined", sp->sname );
-                               /* make p look reasonable */
-                               p->type = p->cdim = p->csiz = INT;
-                               p->rval = idname;
-                               p->lval = 0;
-                               defid( p, SNULL );
-                               break;
-                               }
-                       p->type = sp->stype;
-                       p->cdim = sp->dimoff;
-                       p->csiz = sp->sizoff;
-                       p->lval = 0;
-                       p->rval = idname;
-                       /* special case: MOETY is really an ICON... */
-                       if( p->type == MOETY ){
-                               p->rval = NONAME;
-                               p->lval = sp->offset;
-                               p->cdim = 0;
-                               p->type = ENUMTY;
-                               p->op = ICON;
-                               }
-                       break;
-
-               case ICON:
-                       p->type = INT;
-                       p->cdim = 0;
-                       p->csiz = INT;
-                       break;
-
-               case STRING:
-                       p->op = NAME;
-                       p->type = CHAR+ARY;
-                       p->lval = 0;
-                       p->rval = NOLAB;
-                       p->cdim = curdim;
-                       p->csiz = CHAR;
-                       break;
-
-               case FCON:
-                       p->lval = 0;
-                       p->rval = 0;
-                       p->type = DOUBLE;
-                       p->cdim = 0;
-                       p->csiz = DOUBLE;
-                       break;
-
-               case STREF:
-                       /* p->x turned into *(p+offset) */
-                       /* rhs must be a name; check correctness */
-
-                       i = r->rval;
-                       if( i<0 || ((sp= &stab[i])->sclass != MOS && sp->sclass != MOU && !(sp->sclass&FIELD)) ){
-                               uerror( "member of structure or union required" );
-                               }
-                       else {
-                               register j;
-                               if( l->type != PTR+STRTY && l->type != PTR+UNIONTY ){
-                                       werror( "struct/union or struct/union pointer required" );
-                                       }
-                               else if( (j=l->csiz+1)<0 ) cerror( "undefined structure or union" );
-                               else if( !chkstr( i, dimtab[j], DECREF(l->type) ) ){
-                                       werror( "illegal member use: %.8s", stab[i].sname );
-                                       }
-                               }
-
-                       p = stref( p );
-                       break;
-
-               case UNARY MUL:
-                       if( l->op == UNARY AND ){
-                               p->op = l->op = FREE;
-                               p = l->left;
-                               }
-                       if( !ISPTR(l->type))uerror("illegal indirection");
-                       p->type = DECREF(l->type);
-                       p->cdim = l->cdim;
-                       p->csiz = l->csiz;
-                       break;
-
-               case UNARY AND:
-                       switch( l->op ){
-
-                       case UNARY MUL:
-                               p->op = l->op = FREE;
-                               p = l->left;
-                       case NAME:
-                               p->type = INCREF( l->type );
-                               p->cdim = l->cdim;
-                               p->csiz = l->csiz;
-                               break;
-
-                       case COMOP:
-                               lr = buildtree( UNARY AND, l->right, NIL );
-                               p->op = l->op = FREE;
-                               p = buildtree( COMOP, l->left, lr );
-                               break;
-
-                       case QUEST:
-                               lr = buildtree( UNARY AND, l->right->right, NIL );
-                               ll = buildtree( UNARY AND, l->right->left, NIL );
-                               p->op = l->op = l->right->op = FREE;
-                               p = buildtree( QUEST, l->left, buildtree( COLON, ll, lr ) );
-                               break;
-
-                       default:
-                               uerror( "unacceptable operand of &" );
-                               break;
-                               }
-                       break;
-
-               case LS:
-               case RS:
-               case ASG LS:
-               case ASG RS:
-                       if(tsize(p->right->type, p->right->cdim, p->right->csiz) > SZINT)
-                               p->right = makety(p->right, INT, 0, INT );
-                       break;
-
-               case RETURN:
-               case ASSIGN:
-               case CAST:
-                       /* structure assignment */
-                       /* take the addresses of the two sides; then make an
-                       /* operator using STASG and
-                       /* the addresses of left and right */
-
-                       {
-                               register TWORD t;
-                               register d, s;
-
-                               if( l->csiz != r->csiz ) uerror( "assignment of different structures" );
-
-                               r = buildtree( UNARY AND, r, NIL );
-                               t = r->type;
-                               d = r->cdim;
-                               s = r->csiz;
-
-                               l = block( STASG, l, r, t, d, s );
-
-                               if( o == RETURN ){
-                                       p->op = FREE;
-                                       p = l;
-                                       break;
-                                       }
-
-                               p->op = UNARY MUL;
-                               p->left = l;
-                               p->right = NIL;
-                               break;
-                               }
-               case COLON:
-                       /* structure colon */
-
-                       if( l->csiz != r->csiz ) uerror( "type clash in conditional" );
-                       break;
-
-               case CALL:
-                       p->right = r = strargs( p->right );
-               case UNARY CALL:
-                       if( !ISPTR(l->type)) uerror("illegal function");
-                       p->type = DECREF(l->type);
-                       if( !ISFTN(p->type)) uerror("illegal function");
-                       p->type = DECREF( p->type );
-                       p->cdim = l->cdim;
-                       p->csiz = l->csiz;
-                       if( l->op == UNARY AND && l->left->op == NAME &&
-                               l->left->rval >= 0 && l->left->rval != NONAME &&
-                               ( (i=stab[l->left->rval].sclass) == FORTRAN || i==UFORTRAN ) ){
-                               p->op += (FORTCALL-CALL);
-                               }
-                       if( p->type == STRTY || p->type == UNIONTY ){
-                               /* function returning structure */
-                               /*  make function really return ptr to str., with * */
-
-                               p->op += STCALL-CALL;
-                               p->type = INCREF( p->type );
-                               p = buildtree( UNARY MUL, p, NIL );
-
-                               }
-                       break;
-
-               default:
-                       cerror( "other code %d", o );
-                       }
-
-               }
-
-       if( actions & CVTO ) p = oconvert(p);
-       p = clocal(p);
-
-       if( bdebug ) fwalk( p, eprint, 0 );
-
-       return(p);
-
-       }
-
-NODE *
-strargs( p ) register NODE *p;  { /* rewrite structure flavored arguments */
-
-       if( p->op == CM ){
-               p->left = strargs( p->left );
-               p->right = strargs( p->right );
-               return( p );
-               }
-
-       if( p->type == STRTY || p->type == UNIONTY ){
-               p = block( STARG, p, NIL, p->type, p->cdim, p->csiz );
-               p->left = buildtree( UNARY AND, p->left, NIL );
-               p = clocal(p);
-               }
-       return( p );
-       }
-
-chkstr( i, j, type ) TWORD type; {
-       /* is the MOS or MOU at stab[i] OK for strict reference by a ptr */
-       /* i has been checked to contain a MOS or MOU */
-       /* j is the index in dimtab of the members... */
-       int k, kk;
-
-       extern int ddebug;
-
-       if( ddebug > 1 ) printf( "chkstr( %.8s(%d), %d )\n", stab[i].sname, i, j );
-       if( (k = j) < 0 ) uerror( "undefined structure or union" );
-       else {
-               for( ; (kk = dimtab[k] ) >= 0; ++k ){
-                       if( kk >= SYMTSZ ){
-                               cerror( "gummy structure" );
-                               return(1);
-                               }
-                       if( kk == i ) return( 1 );
-                       switch( stab[kk].stype ){
-
-                       case STRTY:
-                       case UNIONTY:
-                               if( type == STRTY ) continue;  /* no recursive looking for strs */
-                               if( chkstr( i, dimtab[stab[kk].sizoff+1], stab[kk].stype ) ) return(1);
-                               }
-                       }
-               }
-       return( 0 );
-       }
-
-conval( p, o, q ) register NODE *p, *q; {
-       /* apply the op o to the lval part of p; if binary, rhs is val */
-       int i, u;
-       CONSZ val;
-
-       val = q->lval;
-       u = ISUNSIGNED(p->type) || ISUNSIGNED(q->type);
-       if( u && (o==LE||o==LT||o==GE||o==GT)) o += (UGE-GE);
-
-       if( p->rval != NONAME && q->rval != NONAME ) return(0);
-       if( q->rval != NONAME && o!=PLUS ) return(0);
-       if( p->rval != NONAME && o!=PLUS && o!=MINUS ) return(0);
-
-       switch( o ){
-
-       case PLUS:
-               p->lval += val;
-               if( p->rval == NONAME ){
-                       p->rval = q->rval;
-                       p->type = q->type;
-                       }
-               break;
-       case MINUS:
-               p->lval -= val;
-               break;
-       case MUL:
-               p->lval *= val;
-               break;
-       case DIV:
-               if( val == 0 ) uerror( "division by 0" );
-               else p->lval /= val;
-               break;
-       case MOD:
-               if( val == 0 ) uerror( "division by 0" );
-               else p->lval %= val;
-               break;
-       case AND:
-               p->lval &= val;
-               break;
-       case OR:
-               p->lval |= val;
-               break;
-       case ER:
-               p->lval ^=  val;
-               break;
-       case LS:
-               i = val;
-               p->lval = p->lval << i;
-               break;
-       case RS:
-               i = val;
-               p->lval = p->lval >> i;
-               break;
-
-       case UNARY MINUS:
-               p->lval = - p->lval;
-               break;
-       case COMPL:
-               p->lval = ~p->lval;
-               break;
-       case NOT:
-               p->lval = !p->lval;
-               break;
-       case LT:
-               p->lval = p->lval < val;
-               break;
-       case LE:
-               p->lval = p->lval <= val;
-               break;
-       case GT:
-               p->lval = p->lval > val;
-               break;
-       case GE:
-               p->lval = p->lval >= val;
-               break;
-       case ULT:
-               p->lval = (p->lval-val)<0;
-               break;
-       case ULE:
-               p->lval = (p->lval-val)<=0;
-               break;
-       case UGE:
-               p->lval = (p->lval-val)>=0;
-               break;
-       case UGT:
-               p->lval = (p->lval-val)>0;
-               break;
-       case EQ:
-               p->lval = p->lval == val;
-               break;
-       case NE:
-               p->lval = p->lval != val;
-               break;
-       default:
-               return(0);
-               }
-       return(1);
-       }
-
-chkpun(p) register NODE *p; {
-
-       /* checks p for the existance of a pun */
-
-       /* this is called when the op of p is ASSIGN, RETURN, CAST, COLON, or relational */
-
-       /* one case is when enumerations are used: this applies only to lint */
-       /* in the other case, one operand is a pointer, the other integer type */
-       /* we check that this integer is in fact a constant zero... */
-
-       /* in the case of ASSIGN, any assignment of pointer to integer is illegal */
-       /* this falls out, because the LHS is never 0 */
-
-       register NODE *q;
-       register t1, t2;
-       register d1, d2;
-
-       t1 = p->left->type;
-       t2 = p->right->type;
-
-       if( t1==ENUMTY || t2==ENUMTY ) { /* check for enumerations */
-               if( logop( p->op ) && p->op != EQ && p->op != NE ) {
-                       uerror( "illegal comparison of enums" );
-                       return;
-                       }
-               if( t1==ENUMTY && t2==ENUMTY && p->left->csiz==p->right->csiz ) return;
-               werror( "enumeration type clash, operator %s", opst[p->op] );
-               return;
-               }
-
-       if( ISPTR(t1) || ISARY(t1) ) q = p->right;
-       else q = p->left;
-
-       if( !ISPTR(q->type) && !ISARY(q->type) ){
-               if( q->op != ICON || q->lval != 0 ){
-                       werror( "illegal combination of pointer and integer");
-                       }
-               }
-       else {
-               d1 = p->left->cdim;
-               d2 = p->right->cdim;
-               for( ;; ){
-                       if( t1 == t2 ) {;
-                               if( p->left->csiz != p->right->csiz ) {
-                                       werror( "illegal structure pointer combination" );
-                                       }
-                               return;
-                               }
-                       if( ISARY(t1) || ISPTR(t1) ){
-                               if( !ISARY(t2) && !ISPTR(t2) ) break;
-                               if( ISARY(t1) && ISARY(t2) && dimtab[d1] != dimtab[d2] ){
-                                       werror( "illegal array size combination" );
-                                       return;
-                                       }
-                               if( ISARY(t1) ) ++d1;
-                               if( ISARY(t2) ) ++d2;
-                               }
-                       else break;
-                       t1 = DECREF(t1);
-                       t2 = DECREF(t2);
-                       }
-               werror( "illegal pointer combination" );
-               }
-
-       }
-
-NODE *
-stref( p ) register NODE *p; {
-
-       TWORD t;
-       int d, s, dsc;
-       OFFSZ off;
-       register struct symtab *q;
-
-       /* make p->x */
-       /* this is also used to reference automatic variables */
-
-       q = &stab[p->right->rval];
-       p->right->op = FREE;
-       p->op = FREE;
-       p = pconvert( p->left );
-
-       /* make p look like ptr to x */
-
-       if( !ISPTR(p->type)){
-               p->type = PTR+UNIONTY;
-               }
-
-       t = INCREF( q->stype );
-       d = q->dimoff;
-       s = q->sizoff;
-
-       p = makety( p, t, d, s );
-
-       /* compute the offset to be added */
-
-       off = q->offset;
-       dsc = q->sclass;
-
-       if( dsc & FIELD ){ /* make fields look like ints */
-               off = (off/ALINT)*ALINT;
-               s = INT;
-               }
-       if( off != 0 ) p = clocal( block( PLUS, p, offcon( off, t, d, s ), t, d, s ) );
-
-       p = buildtree( UNARY MUL, p, NIL );
-
-       /* if field, build field info */
-
-       if( dsc & FIELD ){
-               p = block( FLD, p, NIL, q->stype, 0, q->sizoff );
-               p->rval = PKFIELD( dsc&FLDSIZ, q->offset%ALINT );
-               }
-
-       return( clocal(p) );
-       }
-
-notlval(p) register NODE *p; {
-
-       /* return 0 if p an lvalue, 1 otherwise */
-
-       again:
-
-       switch( p->op ){
-
-       case FLD:
-               p = p->left;
-               goto again;
-
-       case NAME:
-       case OREG:
-       case UNARY MUL:
-               if( ISARY(p->type) || ISFTN(p->type) ) return(1);
-       case REG:
-               return(0);
-
-       default:
-               return(1);
-
-               }
-
-       }
-
-NODE *
-bcon( i ){ /* make a constant node with value i */
-       register NODE *p;
-
-       p = block( ICON, NIL, NIL, INT, 0, INT );
-       p->lval = i;
-       p->rval = NONAME;
-       return( clocal(p) );
-       }
-
-NODE *
-bpsize(p) register NODE *p; {
-       return( offcon( psize(p), p->type, p->cdim, p->csiz ) );
-       }
-
-OFFSZ
-psize( p ) NODE *p; {
-       /* p is a node of type pointer; psize returns the
-          size of the thing pointed to */
-
-       if( !ISPTR(p->type) ){
-               uerror( "pointer required");
-               return( SZINT );
-               }
-       /* note: no pointers to fields */
-       return( tsize( DECREF(p->type), p->cdim, p->csiz ) );
-       }
-
-NODE *
-convert( p, f )  register NODE *p; {
-       /*  convert an operand of p
-           f is either CVTL or CVTR
-           operand has type int, and is converted by the size of the other side
-           */
-
-       register NODE *q, *r;
-
-       q = (f==CVTL)?p->left:p->right;
-
-       r = block( PMCONV,
-               q, bpsize(f==CVTL?p->right:p->left), INT, 0, INT );
-       r = clocal(r);
-       if( f == CVTL )
-               p->left = r;
-       else
-               p->right = r;
-       return(p);
-
-       }
-
-econvert( p ) register NODE *p; {
-
-       /* change enums to ints, or appropriate types */
-
-       register TWORD ty;
-
-       if( (ty=BTYPE(p->type)) == ENUMTY || ty == MOETY ) {
-               if( dimtab[ p->csiz ] == SZCHAR ) ty = CHAR;
-               else if( dimtab[ p->csiz ] == SZINT ) ty = INT;
-               else if( dimtab[ p->csiz ] == SZSHORT ) ty = SHORT;
-               else ty = LONG;
-               ty = ctype( ty );
-               p->csiz = ty;
-               MODTYPE(p->type,ty);
-               if( p->op == ICON && ty != LONG ) p->type = p->csiz = INT;
-               }
-       }
-
-NODE *
-pconvert( p ) register NODE *p; {
-
-       /* if p should be changed into a pointer, do so */
-
-       if( ISARY( p->type) ){
-               p->type = DECREF( p->type );
-               ++p->cdim;
-               return( buildtree( UNARY AND, p, NIL ) );
-               }
-       if( ISFTN( p->type) )
-               return( buildtree( UNARY AND, p, NIL ) );
-
-       return( p );
-       }
-
-NODE *
-oconvert(p) register NODE *p; {
-       /* convert the result itself: used for pointer and unsigned */
-
-       switch(p->op) {
-
-       case LE:
-       case LT:
-       case GE:
-       case GT:
-               if( ISUNSIGNED(p->left->type) || ISUNSIGNED(p->right->type) )  p->op += (ULE-LE);
-       case EQ:
-       case NE:
-               return( p );
-
-       case MINUS:
-               return(  clocal( block( PVCONV,
-                       p, bpsize(p->left), INT, 0, INT ) ) );
-               }
-
-       cerror( "illegal oconvert: %d", p->op );
-
-       return(p);
-       }
-
-NODE *
-ptmatch(p)  register NODE *p; {
-
-       /* makes the operands of p agree; they are
-          either pointers or integers, by this time */
-       /* with MINUS, the sizes must be the same */
-       /* with COLON, the types must be the same */
-
-       TWORD t1, t2, t;
-       int o, d2, d, s2, s;
-
-       o = p->op;
-       t = t1 = p->left->type;
-       t2 = p->right->type;
-       d = p->left->cdim;
-       d2 = p->right->cdim;
-       s = p->left->csiz;
-       s2 = p->right->csiz;
-
-       switch( o ){
-
-       case ASSIGN:
-       case RETURN:
-       case CAST:
-               {  break; }
-
-       case MINUS:
-               {  if( psize(p->left) != psize(p->right) ){
-                       uerror( "illegal pointer subtraction");
-                       }
-                  break;
-                  }
-       case COLON:
-               {  if( t1 != t2 ) uerror( "illegal types in :");
-                  break;
-                  }
-       default:  /* must work harder: relationals or comparisons */
-
-               if( !ISPTR(t1) ){
-                       t = t2;
-                       d = d2;
-                       s = s2;
-                       break;
-                       }
-               if( !ISPTR(t2) ){
-                       break;
-                       }
-
-               /* both are pointers */
-               if( talign(t2,s2) < talign(t,s) ){
-                       t = t2;
-                       s = s2;
-                       }
-               break;
-               }
-
-       p->left = makety( p->left, t, d, s );
-       p->right = makety( p->right, t, d, s );
-       if( o!=MINUS && !logop(o) ){
-
-               p->type = t;
-               p->cdim = d;
-               p->csiz = s;
-               }
-
-       return(clocal(p));
-       }
-
-int tdebug = 0;
-
-NODE *
-tymatch(p)  register NODE *p; {
-
-       /* satisfy the types of various arithmetic binary ops */
-
-       /* rules are:
-               if assignment, op, type of LHS
-               if any float or doubles, make double
-               if any longs, make long
-               otherwise, make int
-               if either operand is unsigned, the result is...
-       */
-
-       register TWORD t1, t2, t, tu;
-       register o, u;
-
-       o = p->op;
-
-       t1 = p->left->type;
-       t2 = p->right->type;
-
-       u = 0;
-       if( ISUNSIGNED(t1) ){
-               u = 1;
-               t1 = DEUNSIGN(t1);
-               }
-       if( ISUNSIGNED(t2) ){
-               u = 1;
-               t2 = DEUNSIGN(t2);
-               }
-
-       if( ( t1 == CHAR || t1 == SHORT ) && o!= RETURN ) t1 = INT;
-       if( t2 == CHAR || t2 == SHORT ) t2 = INT;
-
-       if( t1==DOUBLE || t1==FLOAT || t2==DOUBLE || t2==FLOAT ) t = DOUBLE;
-       else if( t1==LONG || t2==LONG ) t = LONG;
-       else t = INT;
-
-       if( asgop(o) ){
-               tu = p->left->type;
-               t = t1;
-               }
-       else {
-               tu = (u && UNSIGNABLE(t))?ENUNSIGN(t):t;
-               }
-
-       /* because expressions have values that are at least as wide
-          as INT or UNSIGNED, the only conversions needed
-          are those involving FLOAT/DOUBLE, and those
-          from LONG to INT and ULONG to UNSIGNED */
-
-       if( t != t1 ) p->left = makety( p->left, tu, 0, (int)tu );
-
-       if( t != t2 || o==CAST ) p->right = makety( p->right, tu, 0, (int)tu );
-
-       if( asgop(o) ){
-               p->type = p->left->type;
-               p->cdim = p->left->cdim;
-               p->csiz = p->left->csiz;
-               }
-       else if( !logop(o) ){
-               p->type = tu;
-               p->cdim = 0;
-               p->csiz = t;
-               }
-
-       if( tdebug ) printf( "tymatch(%o): %o %s %o => %o\n",p,t1,opst[o],t2,tu );
-
-       return(p);
-       }
-
-NODE *
-makety( p, t, d, s ) register NODE *p; TWORD t; {
-       /* make p into type t by inserting a conversion */
-
-       if( p->type == ENUMTY && p->op == ICON ) econvert(p);
-       if( t == p->type ){
-               p->cdim = d;
-               p->csiz = s;
-               return( p );
-               }
-
-       if( t & TMASK ){
-               /* non-simple type */
-               return( block( PCONV, p, NIL, t, d, s ) );
-               }
-
-       if( p->op == ICON ){
-               if( t==DOUBLE||t==FLOAT ){
-                       p->op = FCON;
-                       if( ISUNSIGNED(p->type) ){
-                               p->dval = /* (unsigned CONSZ) */ p->lval;
-                               }
-                       else {
-                               p->dval = p->lval;
-                               }
-
-                       p->type = p->csiz = t;
-                       return( clocal(p) );
-                       }
-               }
-
-       return( block( SCONV, p, NIL, t, d, s ) );
-
-       }
-
-NODE *
-block( o, l, r, t, d, s ) register NODE *l, *r; TWORD t; {
-
-       register NODE *p;
-
-       p = talloc();
-       p->op = o;
-       p->left = l;
-       p->right = r;
-       p->type = t;
-       p->cdim = d;
-       p->csiz = s;
-       return(p);
-       }
-
-icons(p) register NODE *p; {
-       /* if p is an integer constant, return its value */
-       int val;
-
-       if( p->op != ICON ){
-               uerror( "constant expected");
-               val = 1;
-               }
-       else {
-               val = p->lval;
-               if( val != p->lval ) uerror( "constant too big for cross-compiler" );
-               }
-       tfree( p );
-       return(val);
-       }
-
-/*     the intent of this table is to examine the
-       operators, and to check them for
-       correctness.
-
-       The table is searched for the op and the
-       modified type (where this is one of the
-       types INT (includes char and short), LONG,
-       DOUBLE (includes FLOAT), and POINTER
-
-       The default action is to make the node type integer
-
-       The actions taken include:
-               PUN       check for puns
-               CVTL      convert the left operand
-               CVTR      convert the right operand
-               TYPL      the type is determined by the left operand
-               TYPR      the type is determined by the right operand
-               TYMATCH   force type of left and right to match, by inserting conversions
-               PTMATCH   like TYMATCH, but for pointers
-               LVAL      left operand must be lval
-               CVTO      convert the op
-               NCVT      do not convert the operands
-               OTHER     handled by code
-               NCVTR     convert the left operand, not the right...
-
-       */
-
-# define MINT 01  /* integer */
-# define MDBI 02   /* integer or double */
-# define MSTR 04  /* structure */
-# define MPTR 010  /* pointer */
-# define MPTI 020  /* pointer or integer */
-# define MENU 040 /* enumeration variable or member */
-
-opact( p )  NODE *p; {
-
-       register mt12, mt1, mt2, o;
-
-       mt12 = 0;
-
-       switch( optype(o=p->op) ){
-
-       case BITYPE:
-               mt12=mt2 = moditype( p->right->type );
-       case UTYPE:
-               mt12 &= (mt1 = moditype( p->left->type ));
-
-               }
-
-       switch( o ){
-
-       case NAME :
-       case STRING :
-       case ICON :
-       case FCON :
-       case CALL :
-       case UNARY CALL:
-       case UNARY MUL:
-               {  return( OTHER ); }
-       case UNARY MINUS:
-               if( mt1 & MDBI ) return( TYPL );
-               break;
-
-       case COMPL:
-               if( mt1 & MINT ) return( TYPL );
-               break;
-
-       case UNARY AND:
-               {  return( NCVT+OTHER ); }
-       case INIT:
-       case CM:
-       case NOT:
-       case CBRANCH:
-       case ANDAND:
-       case OROR:
-               return( 0 );
-
-       case MUL:
-       case DIV:
-               if( mt12 & MDBI ) return( TYMATCH );
-               break;
-
-       case MOD:
-       case AND:
-       case OR:
-       case ER:
-               if( mt12 & MINT ) return( TYMATCH );
-               break;
-
-       case LS:
-       case RS:
-               if( mt12 & MINT ) return( TYPL+OTHER );
-               break;
-
-       case EQ:
-       case NE:
-       case LT:
-       case LE:
-       case GT:
-       case GE:
-               if( (mt1&MENU)||(mt2&MENU) ) return( PTMATCH+PUN+NCVT );
-               if( mt12 & MDBI ) return( TYMATCH+CVTO );
-               else if( mt12 & MPTR ) return( PTMATCH+PUN );
-               else if( mt12 & MPTI ) return( PTMATCH+PUN );
-               else break;
-
-       case QUEST:
-       case COMOP:
-               if( mt2&MENU ) return( TYPR+NCVTR );
-               return( TYPR );
-
-       case STREF:
-               return( NCVT+OTHER );
-
-       case FORCE:
-               return( TYPL );
-
-       case COLON:
-               if( mt12 & MENU ) return( NCVT+PUN+PTMATCH );
-               else if( mt12 & MDBI ) return( TYMATCH );
-               else if( mt12 & MPTR ) return( TYPL+PTMATCH+PUN );
-               else if( (mt1&MINT) && (mt2&MPTR) ) return( TYPR+PUN );
-               else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+PUN );
-               else if( mt12 & MSTR ) return( NCVT+TYPL+OTHER );
-               break;
-
-       case ASSIGN:
-       case RETURN:
-               if( mt12 & MSTR ) return( LVAL+NCVT+TYPL+OTHER );
-       case CAST:
-               if( mt12 & MDBI ) return( TYPL+LVAL+TYMATCH );
-               else if( (mt1&MENU)||(mt2&MENU) ) return( LVAL+NCVT+TYPL+PTMATCH+PUN );
-               else if( mt1 & MPTR ) return( LVAL+PTMATCH+PUN );
-               else if( mt12 & MPTI ) return( TYPL+LVAL+TYMATCH+PUN );
-               break;
-
-       case ASG LS:
-       case ASG RS:
-               if( mt12 & MINT ) return( TYPL+LVAL+OTHER );
-               break;
-
-       case ASG MUL:
-       case ASG DIV:
-               if( mt12 & MDBI ) return( LVAL+TYMATCH );
-               break;
-
-       case ASG MOD:
-       case ASG AND:
-       case ASG OR:
-       case ASG ER:
-               if( mt12 & MINT ) return( LVAL+TYMATCH );
-               break;
-
-       case ASG PLUS:
-       case ASG MINUS:
-       case INCR:
-       case DECR:
-               if( mt12 & MDBI ) return( TYMATCH+LVAL );
-               else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+LVAL+CVTR );
-               break;
-
-       case MINUS:
-               if( mt12 & MPTR ) return( CVTO+PTMATCH+PUN );
-               if( mt2 & MPTR ) break;
-       case PLUS:
-               if( mt12 & MDBI ) return( TYMATCH );
-               else if( (mt1&MPTR) && (mt2&MINT) ) return( TYPL+CVTR );
-               else if( (mt1&MINT) && (mt2&MPTR) ) return( TYPR+CVTL );
-
-               }
-       uerror( "operands of %s have incompatible types", opst[o] );
-       return( NCVT );
-       }
-
-moditype( ty ) TWORD ty; {
-
-       switch( ty ){
-
-       case ENUMTY:
-       case MOETY:
-               return( MENU );
-
-       case STRTY:
-       case UNIONTY:
-               return( MSTR );
-
-       case CHAR:
-       case SHORT:
-       case UCHAR:
-       case USHORT:
-               return( MINT|MDBI );
-       case UNSIGNED:
-       case ULONG:
-       case INT:
-       case LONG:
-               return( MINT|MDBI|MPTI );
-       case FLOAT:
-       case DOUBLE:
-               return( MDBI );
-       default:
-               return( MPTR|MPTI );
-
-               }
-       }
-
-NODE *
-doszof( p )  register NODE *p; {
-       /* do sizeof p */
-       int i;
-
-       /* whatever is the meaning of this if it is a bitfield? */
-       i = tsize( p->type, p->cdim, p->csiz )/SZCHAR;
-
-       tfree(p);
-       if( i <= 0 ) werror( "sizeof returns 0" );
-       return( bcon( i ) );
-       }
-
-eprint( p, down, a, b ) register NODE *p; int *a, *b; {
-       register ty;
-
-       *a = *b = down+1;
-       while( down > 1 ){
-               printf( "\t" );
-               down -= 2;
-               }
-       if( down ) printf( "    " );
-
-       ty = optype( p->op );
-
-       printf("%o) %s, ", p, opst[p->op] );
-       if( ty == LTYPE ){
-               printf( CONFMT, p->lval );
-               printf( ", %d, ", p->rval );
-               }
-       tprint( p->type );
-       printf( ", %d, %d\n", p->cdim, p->csiz );
-       }
-
-prtdcon( p ) register NODE *p; {
-       int i;
-
-       if( p->op == FCON ){
-               locctr( DATA );
-               defalign( ALDOUBLE );
-               deflab( i = getlab() );
-               fincode( p->dval, SZDOUBLE );
-               p->lval = 0;
-               p->rval = -i;
-               p->type = DOUBLE;
-               p->op = NAME;
-               }
-       }
-
-
-int edebug = 0;
-ecomp( p ) register NODE *p; {
-       if( edebug ) fwalk( p, eprint, 0 );
-       if( !reached ){
-               werror( "statement not reached" );
-               reached = 1;
-               }
-       p = optim(p);
-       walkf( p, prtdcon );
-       locctr( PROG );
-       ecode( p );
-       tfree(p);
-       }
-
-# ifdef STDPRTREE
-# ifndef ONEPASS
-
-prtree(p) register NODE *p; {
-
-       register struct symtab *q;
-       register ty;
-
-# ifdef MYPRTREE
-       MYPRTREE(p);  /* local action can be taken here; then return... */
-#endif
-
-       ty = optype(p->op);
-
-       printf( "%d\t", p->op );
-
-       if( ty == LTYPE ) {
-               printf( CONFMT, p->lval );
-               printf( "\t" );
-               }
-       if( ty != BITYPE ) {
-               if( p->op == NAME || p->op == ICON ) printf( "0\t" );
-               else printf( "%d\t", p->rval );
-               }
-
-       printf( "%o\t", p->type );
-
-       /* handle special cases */
-
-       switch( p->op ){
-
-       case NAME:
-       case ICON:
-               /* print external name */
-               if( p->rval == NONAME ) printf( "\n" );
-               else if( p->rval >= 0 ){
-                       q = &stab[p->rval];
-                       printf(  "%s\n", exname(q->sname) );
-                       }
-               else { /* label */
-                       printf( LABFMT, -p->rval );
-                       }
-               break;
-
-       case STARG:
-       case STASG:
-       case STCALL:
-       case UNARY STCALL:
-               /* print out size */
-               /* use lhs size, in order to avoid hassles with the structure `.' operator */
-
-               /* note: p->left not a field... */
-               printf( CONFMT, (CONSZ) tsize( STRTY, p->left->cdim, p->left->csiz ) );
-               printf( "\t%d\t\n", talign( STRTY, p->left->csiz ) );
-               break;
-
-       default:
-               printf(  "\n" );
-               }
-
-       if( ty != LTYPE ) prtree( p->left );
-       if( ty == BITYPE ) prtree( p->right );
-
-       }
-
-# else
-
-p2tree(p) register NODE *p; {
-       register ty;
-
-# ifdef MYP2TREE
-       MYP2TREE(p);  /* local action can be taken here; then return... */
-# endif
-
-       ty = optype(p->op);
-
-       switch( p->op ){
-
-       case NAME:
-       case ICON:
-               if( p->rval == NONAME ) p->name[0] = '\0';
-               else if( p->rval >= 0 ){ /* copy name from exname */
-                       register char *cp;
-                       register i;
-                       cp = exname( stab[p->rval].sname );
-                       for( i=0; i<NCHNAM; ++i ) p->name[i] = *cp++;
-                       }
-               else sprintf( p->name, LABFMT, -p->rval );
-               break;
-
-       case STARG:
-       case STASG:
-       case STCALL:
-       case UNARY STCALL:
-               /* set up size parameters */
-               p->stsize = (tsize(STRTY,p->left->cdim,p->left->csiz)+SZCHAR-1)/SZCHAR;
-               p->stalign = talign(STRTY,p->left->csiz)/SZCHAR;
-               break;
-
-       case REG:
-               rbusy( p->rval, p->type );
-       default:
-               p->name[0] = '\0';
-               }
-
-       p->rall = NOPREF;
-
-       if( ty != LTYPE ) p2tree( p->left );
-       if( ty == BITYPE ) p2tree( p->right );
-       }
-
-# endif
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/mip/xdefs.c b/.ref-Research-V7/usr/src/cmd/mip/xdefs.c
deleted file mode 100644 (file)
index 61caff7..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-# include "mfile1"
-
-/*     communication between lexical routines  */
-
-char   ftitle[100] = "";       /* title of the file */
-int    lineno;         /* line number of the input file */
-
-CONSZ lastcon;  /* the last constant read by the lexical analyzer */
-double dcon;   /* the last double read by the lexical analyzer */
-
-
-/*     symbol table maintainence */
-
-struct symtab stab[SYMTSZ+1];  /* one extra slot for scratch */
-
-int    curftn;  /* "current" function */
-int    ftnno;  /* "current" function number */
-
-int    curclass,         /* current storage class */
-       instruct,       /* "in structure" flag */
-       stwart,         /* for accessing names which are structure members or names */
-       blevel,         /* block level: 0 for extern, 1 for ftn args, >=2 inside function */
-       curdim;         /* current offset into the dimension table */
-       
-int    dimtab[ DIMTABSZ ];
-
-int    paramstk[ PARAMSZ ];  /* used in the definition of function parameters */
-int    paramno;          /* the number of parameters */
-int    autooff,        /* the next unused automatic offset */
-       argoff, /* the next unused argument offset */
-       strucoff;       /*  the next structure offset position */
-int    regvar;         /* the next free register for register variables */
-int    minrvar;        /* the smallest that regvar gets witing a function */
-OFFSZ  inoff;          /* offset of external element being initialized */
-int    brkflag = 0;    /* complain about break statements not reached */
-
-struct sw swtab[SWITSZ];  /* table for cases within a switch */
-struct sw *swp;  /* pointer to next free entry in swtab */
-int swx;  /* index of beginning of cases for current switch */
-
-/* debugging flag */
-int xdebug = 0;
-
-int strflg;  /* if on, strings are to be treated as lists */
-
-int reached;   /* true if statement can be reached... */
-
-int idname;    /* tunnel to buildtree for name id's */
-
-
-NODE node[TREESZ];
-
-int cflag = 0;  /* do we check for funny casts */
-int hflag = 0;  /* do we check for various heuristics which may indicate errors */
-int pflag = 0;  /* do we check for portable constructions */
-
-int brklab;
-int contlab;
-int flostat;
-int retlab = NOLAB;
-int retstat;
-
-/* save array for break, continue labels, and flostat */
-
-int asavbc[BCSZ];
-int *psavbc = asavbc ;
-
-static char *
-ccnames[] = { /* names of storage classes */
-       "SNULL",
-       "AUTO",
-       "EXTERN",
-       "STATIC",
-       "REGISTER",
-       "EXTDEF",
-       "LABEL",
-       "ULABEL",
-       "MOS",
-       "PARAM",
-       "STNAME",
-       "MOU",
-       "UNAME",
-       "TYPEDEF",
-       "FORTRAN",
-       "ENAME",
-       "MOE",
-       "UFORTRAN",
-       "USTATIC",
-       };
-
-char * scnames( c ) register c; {
-       /* return the name for storage class c */
-       static char buf[12];
-       if( c&FIELD ){
-               sprintf( buf, "FIELD[%d]", c&FLDSIZ );
-               return( buf );
-               }
-       return( ccnames[c] );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/mkdir.c b/.ref-Research-V7/usr/src/cmd/mkdir.c
deleted file mode 100644 (file)
index 0fb6f97..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-** make directory
-*/
-
-#include       <signal.h>
-#include       <stdio.h>
-
-int    Errors = 0;
-char   *strcat();
-char   *strcpy();
-
-main(argc, argv)
-char *argv[];
-{
-
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       signal(SIGPIPE, SIG_IGN);
-       signal(SIGTERM, SIG_IGN);
-
-       if(argc < 2) {
-               fprintf(stderr, "mkdir: arg count\n");
-               exit(1);
-       }
-       while(--argc)
-               mkdir(*++argv);
-       exit(Errors!=0);
-}
-
-mkdir(d)
-char *d;
-{
-       char pname[128], dname[128];
-       register i, slash = 0;
-
-       pname[0] = '\0';
-       for(i = 0; d[i]; ++i)
-               if(d[i] == '/')
-                       slash = i + 1;
-       if(slash)
-               strncpy(pname, d, slash);
-       strcpy(pname+slash, ".");
-       if (access(pname, 02)) {
-               fprintf(stderr,"mkdir: cannot access %s\n", pname);
-               ++Errors;
-               return;
-       }
-       if ((mknod(d, 040777, 0)) < 0) {
-               fprintf(stderr,"mkdir: cannot make directory %s\n", d);
-               ++Errors;
-               return;
-       }
-       chown(d, getuid(), getgid());
-       strcpy(dname, d);
-       strcat(dname, "/.");
-       if((link(d, dname)) < 0) {
-               fprintf(stderr, "mkdir: cannot link %s\n", dname);
-               unlink(d);
-               ++Errors;
-               return;
-       }
-       strcat(dname, ".");
-       if((link(pname, dname)) < 0) {
-               fprintf(stderr, "mkdir: cannot link %s\n",dname);
-               dname[strlen(dname)] = '\0';
-               unlink(dname);
-               unlink(d);
-               ++Errors;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/mkfs.c b/.ref-Research-V7/usr/src/cmd/mkfs.c
deleted file mode 100644 (file)
index cf66b7b..0000000
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * Make a file system prototype.
- * usage: mkfs filsys proto/size [ m n ]
- */
-#define        NIPB    (BSIZE/sizeof(struct dinode))
-#define        NINDIR  (BSIZE/sizeof(daddr_t))
-#define        NDIRECT (BSIZE/sizeof(struct direct))
-#define        LADDR   10
-#define        MAXFN   500
-#define        itoo(x) (int)((x+15)&07)
-#ifndef STANDALONE
-#include <stdio.h>
-#include <a.out.h>
-#endif
-#include <sys/param.h>
-#include <sys/ino.h>
-#include <sys/inode.h>
-#include <sys/filsys.h>
-#include <sys/fblk.h>
-#include <sys/dir.h>
-time_t utime;
-#ifndef STANDALONE
-FILE   *fin;
-#else
-int    fin;
-#endif
-int    fsi;
-int    fso;
-char   *charp;
-char   buf[BSIZE];
-union {
-       struct fblk fb;
-       char pad1[BSIZE];
-} fbuf;
-#ifndef STANDALONE
-struct exec head;
-#endif
-char   string[50];
-union {
-       struct filsys fs;
-       char pad2[BSIZE];
-} filsys;
-char   *fsys;
-char   *proto;
-int    f_n     = MAXFN;
-int    f_m     = 3;
-int    error;
-ino_t  ino;
-long   getnum();
-daddr_t        alloc();
-
-main(argc, argv)
-char *argv[];
-{
-       int f, c;
-       long n;
-
-#ifndef STANDALONE
-       time(&utime);
-       if(argc < 3) {
-               printf("usage: mkfs filsys proto/size [ m n ]\n");
-               exit(1);
-       }
-       fsys = argv[1];
-       proto = argv[2];
-#else
-       {
-               static char protos[60];
-
-               printf("file sys size: ");
-               gets(protos);
-               proto = protos;
-       }
-#endif
-#ifdef STANDALONE
-       {
-               char fsbuf[100];
-
-               do {
-                       printf("file system: ");
-                       gets(fsbuf);
-                       fso = open(fsbuf, 1);
-                       fsi = open(fsbuf, 0);
-               } while (fso < 0 || fsi < 0);
-       }
-       fin = NULL;
-       argc = 0;
-#else
-       fso = creat(fsys, 0666);
-       if(fso < 0) {
-               printf("%s: cannot create\n", fsys);
-               exit(1);
-       }
-       fsi = open(fsys, 0);
-       if(fsi < 0) {
-               printf("%s: cannot open\n", fsys);
-               exit(1);
-       }
-       fin = fopen(proto, "r");
-#endif
-       if(fin == NULL) {
-               n = 0;
-               for(f=0; c=proto[f]; f++) {
-                       if(c<'0' || c>'9') {
-                               printf("%s: cannot open\n", proto);
-                               exit(1);
-                       }
-                       n = n*10 + (c-'0');
-               }
-               filsys.s_fsize = n;
-               n = n/25;
-               if(n <= 0)
-                       n = 1;
-               if(n > 65500/NIPB)
-                       n = 65500/NIPB;
-               filsys.s_isize = n + 2;
-               printf("isize = %D\n", n*NIPB);
-               charp = "d--777 0 0 $ ";
-               goto f3;
-       }
-
-#ifndef STANDALONE
-       /*
-        * get name of boot load program
-        * and read onto block 0
-        */
-
-       getstr();
-       f = open(string, 0);
-       if(f < 0) {
-               printf("%s: cannot  open init\n", string);
-               goto f2;
-       }
-       read(f, (char *)&head, sizeof head);
-       if(head.a_magic != A_MAGIC1) {
-               printf("%s: bad format\n", string);
-               goto f1;
-       }
-       c = head.a_text + head.a_data;
-       if(c > BSIZE) {
-               printf("%s: too big\n", string);
-               goto f1;
-       }
-       read(f, buf, c);
-       wtfs((long)0, buf);
-
-f1:
-       close(f);
-
-       /*
-        * get total disk size
-        * and inode block size
-        */
-
-f2:
-       filsys.s_fsize = getnum();
-       n = getnum();
-       n /= NIPB;
-       filsys.s_isize = n + 3;
-
-#endif
-f3:
-       if(argc >= 5) {
-               f_m = atoi(argv[3]);
-               f_n = atoi(argv[4]);
-               if(f_n <= 0 || f_n >= MAXFN)
-                       f_n = MAXFN;
-               if(f_m <= 0 || f_m > f_n)
-                       f_m = 3;
-       }
-       filsys.s_m = f_m;
-       filsys.s_n = f_n;
-       printf("m/n = %d %d\n", f_m, f_n);
-       if(filsys.s_isize >= filsys.s_fsize) {
-               printf("%ld/%ld: bad ratio\n", filsys.s_fsize, filsys.s_isize-2);
-               exit(1);
-       }
-       filsys.s_tfree = 0;
-       filsys.s_tinode = 0;
-       for(c=0; c<BSIZE; c++)
-               buf[c] = 0;
-       for(n=2; n!=filsys.s_isize; n++) {
-               wtfs(n, buf);
-               filsys.s_tinode += NIPB;
-       }
-       ino = 0;
-
-       bflist();
-
-       cfile((struct inode *)0);
-
-       filsys.s_time = utime;
-       wtfs((long)1, (char *)&filsys);
-       exit(error);
-}
-
-cfile(par)
-struct inode *par;
-{
-       struct inode in;
-       int dbc, ibc;
-       char db[BSIZE];
-       daddr_t ib[NINDIR];
-       int i, f, c;
-
-       /*
-        * get mode, uid and gid
-        */
-
-       getstr();
-       in.i_mode = gmode(string[0], "-bcd", IFREG, IFBLK, IFCHR, IFDIR);
-       in.i_mode |= gmode(string[1], "-u", 0, ISUID, 0, 0);
-       in.i_mode |= gmode(string[2], "-g", 0, ISGID, 0, 0);
-       for(i=3; i<6; i++) {
-               c = string[i];
-               if(c<'0' || c>'7') {
-                       printf("%c/%s: bad octal mode digit\n", c, string);
-                       error = 1;
-                       c = 0;
-               }
-               in.i_mode |= (c-'0')<<(15-3*i);
-       }
-       in.i_uid = getnum();
-       in.i_gid = getnum();
-
-       /*
-        * general initialization prior to
-        * switching on format
-        */
-
-       ino++;
-       in.i_number = ino;
-       for(i=0; i<BSIZE; i++)
-               db[i] = 0;
-       for(i=0; i<NINDIR; i++)
-               ib[i] = (daddr_t)0;
-       in.i_nlink = 1;
-       in.i_size = 0;
-       for(i=0; i<NADDR; i++)
-               in.i_un.i_addr[i] = (daddr_t)0;
-       if(par == (struct inode *)0) {
-               par = &in;
-               in.i_nlink--;
-       }
-       dbc = 0;
-       ibc = 0;
-       switch(in.i_mode&IFMT) {
-
-       case IFREG:
-               /*
-                * regular file
-                * contents is a file name
-                */
-
-               getstr();
-               f = open(string, 0);
-               if(f < 0) {
-                       printf("%s: cannot open\n", string);
-                       error = 1;
-                       break;
-               }
-               while((i=read(f, db, BSIZE)) > 0) {
-                       in.i_size += i;
-                       newblk(&dbc, db, &ibc, ib);
-               }
-               close(f);
-               break;
-
-       case IFBLK:
-       case IFCHR:
-               /*
-                * special file
-                * content is maj/min types
-                */
-
-               i = getnum() & 0377;
-               f = getnum() & 0377;
-               in.i_un.i_addr[0] = (i<<8) | f;
-               break;
-
-       case IFDIR:
-               /*
-                * directory
-                * put in extra links
-                * call recursively until
-                * name of "$" found
-                */
-
-               par->i_nlink++;
-               in.i_nlink++;
-               entry(in.i_number, ".", &dbc, db, &ibc, ib);
-               entry(par->i_number, "..", &dbc, db, &ibc, ib);
-               in.i_size = 2*sizeof(struct direct);
-               for(;;) {
-                       getstr();
-                       if(string[0]=='$' && string[1]=='\0')
-                               break;
-                       entry(ino+1, string, &dbc, db, &ibc, ib);
-                       in.i_size += sizeof(struct direct);
-                       cfile(&in);
-               }
-               break;
-       }
-       if(dbc != 0)
-               newblk(&dbc, db, &ibc, ib);
-       iput(&in, &ibc, ib);
-}
-
-gmode(c, s, m0, m1, m2, m3)
-char c, *s;
-{
-       int i;
-
-       for(i=0; s[i]; i++)
-               if(c == s[i])
-                       return((&m0)[i]);
-       printf("%c/%s: bad mode\n", c, string);
-       error = 1;
-       return(0);
-}
-
-long
-getnum()
-{
-       int i, c;
-       long n;
-
-       getstr();
-       n = 0;
-       i = 0;
-       for(i=0; c=string[i]; i++) {
-               if(c<'0' || c>'9') {
-                       printf("%s: bad number\n", string);
-                       error = 1;
-                       return((long)0);
-               }
-               n = n*10 + (c-'0');
-       }
-       return(n);
-}
-
-getstr()
-{
-       int i, c;
-
-loop:
-       switch(c=getch()) {
-
-       case ' ':
-       case '\t':
-       case '\n':
-               goto loop;
-
-       case '\0':
-               printf("EOF\n");
-               exit(1);
-
-       case ':':
-               while(getch() != '\n');
-               goto loop;
-
-       }
-       i = 0;
-
-       do {
-               string[i++] = c;
-               c = getch();
-       } while(c!=' '&&c!='\t'&&c!='\n'&&c!='\0');
-       string[i] = '\0';
-}
-
-rdfs(bno, bf)
-daddr_t bno;
-char *bf;
-{
-       int n;
-
-       lseek(fsi, bno*BSIZE, 0);
-       n = read(fsi, bf, BSIZE);
-       if(n != BSIZE) {
-               printf("read error: %ld\n", bno);
-               exit(1);
-       }
-}
-
-wtfs(bno, bf)
-daddr_t bno;
-char *bf;
-{
-       int n;
-
-       lseek(fso, bno*BSIZE, 0);
-       n = write(fso, bf, BSIZE);
-       if(n != BSIZE) {
-               printf("write error: %D\n", bno);
-               exit(1);
-       }
-}
-
-daddr_t
-alloc()
-{
-       int i;
-       daddr_t bno;
-
-       filsys.s_tfree--;
-       bno = filsys.s_free[--filsys.s_nfree];
-       if(bno == 0) {
-               printf("out of free space\n");
-               exit(1);
-       }
-       if(filsys.s_nfree <= 0) {
-               rdfs(bno, (char *)&fbuf);
-               filsys.s_nfree = fbuf.df_nfree;
-               for(i=0; i<NICFREE; i++)
-                       filsys.s_free[i] = fbuf.df_free[i];
-       }
-       return(bno);
-}
-
-bfree(bno)
-daddr_t bno;
-{
-       int i;
-
-       filsys.s_tfree++;
-       if(filsys.s_nfree >= NICFREE) {
-               fbuf.df_nfree = filsys.s_nfree;
-               for(i=0; i<NICFREE; i++)
-                       fbuf.df_free[i] = filsys.s_free[i];
-               wtfs(bno, (char *)&fbuf);
-               filsys.s_nfree = 0;
-       }
-       filsys.s_free[filsys.s_nfree++] = bno;
-}
-
-entry(inum, str, adbc, db, aibc, ib)
-ino_t inum;
-char *str;
-int *adbc, *aibc;
-char *db;
-daddr_t *ib;
-{
-       struct direct *dp;
-       int i;
-
-       dp = (struct direct *)db;
-       dp += *adbc;
-       (*adbc)++;
-       dp->d_ino = inum;
-       for(i=0; i<DIRSIZ; i++)
-               dp->d_name[i] = 0;
-       for(i=0; i<DIRSIZ; i++)
-               if((dp->d_name[i] = str[i]) == 0)
-                       break;
-       if(*adbc >= NDIRECT)
-               newblk(adbc, db, aibc, ib);
-}
-
-newblk(adbc, db, aibc, ib)
-int *adbc, *aibc;
-char *db;
-daddr_t *ib;
-{
-       int i;
-       daddr_t bno;
-
-       bno = alloc();
-       wtfs(bno, db);
-       for(i=0; i<BSIZE; i++)
-               db[i] = 0;
-       *adbc = 0;
-       ib[*aibc] = bno;
-       (*aibc)++;
-       if(*aibc >= NINDIR) {
-               printf("indirect block full\n");
-               error = 1;
-               *aibc = 0;
-       }
-}
-
-getch()
-{
-
-#ifndef STANDALONE
-       if(charp)
-#endif
-               return(*charp++);
-#ifndef STANDALONE
-       return(getc(fin));
-#endif
-}
-
-bflist()
-{
-       struct inode in;
-       daddr_t ib[NINDIR];
-       int ibc;
-       char flg[MAXFN];
-       int adr[MAXFN];
-       int i, j;
-       daddr_t f, d;
-
-       for(i=0; i<f_n; i++)
-               flg[i] = 0;
-       i = 0;
-       for(j=0; j<f_n; j++) {
-               while(flg[i])
-                       i = (i+1)%f_n;
-               adr[j] = i+1;
-               flg[i]++;
-               i = (i+f_m)%f_n;
-       }
-
-       ino++;
-       in.i_number = ino;
-       in.i_mode = IFREG;
-       in.i_uid = 0;
-       in.i_gid = 0;
-       in.i_nlink = 0;
-       in.i_size = 0;
-       for(i=0; i<NADDR; i++)
-               in.i_un.i_addr[i] = (daddr_t)0;
-
-       for(i=0; i<NINDIR; i++)
-               ib[i] = (daddr_t)0;
-       ibc = 0;
-       bfree((daddr_t)0);
-       d = filsys.s_fsize-1;
-       while(d%f_n)
-               d++;
-       for(; d > 0; d -= f_n)
-       for(i=0; i<f_n; i++) {
-               f = d - adr[i];
-               if(f < filsys.s_fsize && f >= filsys.s_isize)
-                       if(badblk(f)) {
-                               if(ibc >= NINDIR) {
-                                       printf("too many bad blocks\n");
-                                       error = 1;
-                                       ibc = 0;
-                               }
-                               ib[ibc] = f;
-                               ibc++;
-                       } else
-                               bfree(f);
-       }
-       iput(&in, &ibc, ib);
-}
-
-iput(ip, aibc, ib)
-struct inode *ip;
-int *aibc;
-daddr_t *ib;
-{
-       struct dinode *dp;
-       daddr_t d;
-       int i;
-
-       filsys.s_tinode--;
-       d = itod(ip->i_number);
-       if(d >= filsys.s_isize) {
-               if(error == 0)
-                       printf("ilist too small\n");
-               error = 1;
-               return;
-       }
-       rdfs(d, buf);
-       dp = (struct dinode *)buf;
-       dp += itoo(ip->i_number);
-
-       dp->di_mode = ip->i_mode;
-       dp->di_nlink = ip->i_nlink;
-       dp->di_uid = ip->i_uid;
-       dp->di_gid = ip->i_gid;
-       dp->di_size = ip->i_size;
-       dp->di_atime = utime;
-       dp->di_mtime = utime;
-       dp->di_ctime = utime;
-
-       switch(ip->i_mode&IFMT) {
-
-       case IFDIR:
-       case IFREG:
-               for(i=0; i<*aibc; i++) {
-                       if(i >= LADDR)
-                               break;
-                       ip->i_un.i_addr[i] = ib[i];
-               }
-               if(*aibc >= LADDR) {
-                       ip->i_un.i_addr[LADDR] = alloc();
-                       for(i=0; i<NINDIR-LADDR; i++) {
-                               ib[i] = ib[i+LADDR];
-                               ib[i+LADDR] = (daddr_t)0;
-                       }
-                       wtfs(ip->i_un.i_addr[LADDR], (char *)ib);
-               }
-
-       case IFBLK:
-       case IFCHR:
-               ltol3(dp->di_addr, ip->i_un.i_addr, NADDR);
-               break;
-
-       default:
-               printf("bad mode %o\n", ip->i_mode);
-               exit(1);
-       }
-       wtfs(d, buf);
-}
-
-badblk(bno)
-daddr_t bno;
-{
-
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/mknod.c b/.ref-Research-V7/usr/src/cmd/mknod.c
deleted file mode 100644 (file)
index 4fccc28..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-main(argc, argv)
-int argc;
-char **argv;
-{
-       int m, a, b;
-
-       if(argc != 5) {
-               printf("arg count\n");
-               goto usage;
-       }
-       if(*argv[2] == 'b')
-               m = 060666; else
-       if(*argv[2] == 'c')
-               m = 020666; else
-               goto usage;
-       a = number(argv[3]);
-       if(a < 0)
-               goto usage;
-       b = number(argv[4]);
-       if(b < 0)
-               goto usage;
-       if(mknod(argv[1], m, (a<<8)|b) < 0)
-               perror("mknod");
-       exit(0);
-
-usage:
-       printf("usage: mknod name b/c major minor\n");
-}
-
-number(s)
-char *s;
-{
-       int n, c;
-
-       n = 0;
-       while(c = *s++) {
-               if(c<'0' || c>'9')
-                       return(-1);
-               n = n*10 + c-'0';
-       }
-       return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/mount.c b/.ref-Research-V7/usr/src/cmd/mount.c
deleted file mode 100644 (file)
index 6ec1d00..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <stdio.h>
-
-#define        NMOUNT  16
-#define        NAMSIZ  32
-
-struct mtab {
-       char    file[NAMSIZ];
-       char    spec[NAMSIZ];
-} mtab[NMOUNT];
-
-main(argc, argv)
-char **argv;
-{
-       register int ro;
-       register struct mtab *mp;
-       register char *np;
-       int mf;
-
-       mf = open("/etc/mtab", 0);
-       read(mf, (char *)mtab, NMOUNT*2*NAMSIZ);
-       if (argc==1) {
-               for (mp = mtab; mp < &mtab[NMOUNT]; mp++)
-                       if (mp->file[0])
-                               printf("%s on %s\n", mp->spec, mp->file);
-               exit(0);
-       }
-       if(argc < 3) {
-               fprintf(stderr,"arg count\n");
-               exit(1);
-       }
-       ro = 0;
-       if(argc > 3)
-               ro++;
-       if(mount(argv[1], argv[2], ro) < 0) {
-               perror("mount");
-               exit(1);
-       }
-       np = argv[1];
-       while(*np++)
-               ;
-       np--;
-       while(*--np == '/')
-               *np = '\0';
-       while(np > argv[1] && *--np != '/')
-               ;
-       if(*np == '/')
-               np++;
-       argv[1] = np;
-       for (mp = mtab; mp < &mtab[NMOUNT]; mp++) {
-               if (mp->file[0] == 0) {
-                       for (np = mp->spec; np < &mp->spec[NAMSIZ-1];)
-                               if ((*np++ = *argv[1]++) == 0)
-                                       argv[1]--;
-                       for (np = mp->file; np < &mp->file[NAMSIZ-1];)
-                               if ((*np++ = *argv[2]++) == 0)
-                                       argv[2]--;
-                       mp = &mtab[NMOUNT];
-                       while ((--mp)->file[0] == 0);
-                       mf = creat("/etc/mtab", 0644);
-                       write(mf, (char *)mtab, (mp-mtab+1)*2*NAMSIZ);
-                       exit(0);
-               }
-       }
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/mv.c b/.ref-Research-V7/usr/src/cmd/mv.c
deleted file mode 100644 (file)
index 0e2b701..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * mv file1 file2
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <signal.h>
-
-#define        DOT     "."
-#define        DOTDOT  ".."
-#define        DELIM   '/'
-#define SDELIM "/"
-#define        MAXN    100
-#define MODEBITS 07777
-#define ROOTINO 2
-
-char   *pname();
-char   *sprintf();
-char   *dname();
-struct stat s1, s2;
-
-main(argc, argv)
-register char *argv[];
-{
-       register i, r;
-
-       if (argc < 3)
-               goto usage;
-       if (stat(argv[1], &s1) < 0) {
-               fprintf(stderr, "mv: cannot access %s\n", argv[1]);
-               return(1);
-       }
-       if ((s1.st_mode & S_IFMT) == S_IFDIR) {
-               if (argc != 3)
-                       goto usage;
-               return mvdir(argv[1], argv[2]);
-       }
-       setuid(getuid());
-       if (argc > 3)
-               if (stat(argv[argc-1], &s2) < 0 || (s2.st_mode & S_IFMT) != S_IFDIR)
-                       goto usage;
-       r = 0;
-       for (i=1; i<argc-1; i++)
-               r |= move(argv[i], argv[argc-1]);
-       return(r);
-usage:
-       fprintf(stderr, "usage: mv f1 f2; or mv d1 d2; or mv f1 ... fn d1\n");
-       return(1);
-}
-
-move(source, target)
-char *source, *target;
-{
-       register c, i;
-       int     status;
-       char    buf[MAXN];
-
-       if (stat(source, &s1) < 0) {
-               fprintf(stderr, "mv: cannot access %s\n", source);
-               return(1);
-       }
-       if ((s1.st_mode & S_IFMT) == S_IFDIR) {
-               fprintf(stderr, "mv: directory rename only\n");
-               return(1);
-       }
-       if (stat(target, &s2) >= 0) {
-               if ((s2.st_mode & S_IFMT) == S_IFDIR) {
-                       sprintf(buf, "%s/%s", target, dname(source));
-                       target = buf;
-               }
-               if (stat(target, &s2) >= 0) {
-                       if ((s2.st_mode & S_IFMT) == S_IFDIR) {
-                               fprintf(stderr, "mv: %s is a directory\n", target);
-                               return(1);
-                       }
-                       if (s1.st_dev==s2.st_dev && s1.st_ino==s2.st_ino) {
-                               fprintf(stderr, "mv: %s and %s are identical\n",
-                                               source, target);
-                               return(1);
-                       }
-                       if (access(target, 2) < 0 && isatty(fileno(stdin))) {
-                               fprintf(stderr, "mv: %s: %o mode ", target,
-                                       s2.st_mode & MODEBITS);
-                               i = c = getchar();
-                               while (c != '\n' && c != EOF)
-                                       c = getchar();
-                               if (i != 'y')
-                                       return(1);
-                       }
-                       if (unlink(target) < 0) {
-                               fprintf(stderr, "mv: cannot unlink %s\n", target);
-                               return(1);
-                       }
-               }
-       }
-       if (link(source, target) < 0) {
-               i = fork();
-               if (i == -1) {
-                       fprintf(stderr, "mv: try again\n");
-                       return(1);
-               }
-               if (i == 0) {
-                       execl("/bin/cp", "cp", source, target, 0);
-                       fprintf(stderr, "mv: cannot exec cp\n");
-                       exit(1);
-               }
-               while ((c = wait(&status)) != i && c != -1)
-                       ;
-               if (status != 0)
-                       return(1);
-               utime(target, &s1.st_atime);
-       }
-       if (unlink(source) < 0) {
-               fprintf(stderr, "mv: cannot unlink %s\n", source);
-               return(1);
-       }
-       return(0);
-}
-
-mvdir(source, target)
-char *source, *target;
-{
-       register char *p;
-       register i;
-       char buf[MAXN];
-
-       if (stat(target, &s2) >= 0) {
-               if ((s2.st_mode&S_IFMT) != S_IFDIR) {
-                       fprintf(stderr, "mv: %s exists\n", target);
-                       return(1);
-               }
-               if (strlen(target) > MAXN-DIRSIZ-2) {
-                       fprintf(stderr, "mv :target name too long\n");
-                       return(1);
-               }
-               strcpy(buf, target);
-               target = buf;
-               strcat(buf, SDELIM);
-               strcat(buf, dname(source));
-               if (stat(target, &s2) >= 0) {
-                       fprintf(stderr, "mv: %s exists\n", buf);
-                       return(1);
-               }
-       }
-       if (strcmp(source, target) == 0) {
-               fprintf(stderr, "mv: ?? source == target, source exists and target doesnt\n");
-               return(1);
-       }
-       p = dname(source);
-       if (!strcmp(p, DOT) || !strcmp(p, DOTDOT) || !strcmp(p, "") || p[strlen(p)-1]=='/') {
-               fprintf(stderr, "mv: cannot rename %s\n", p);
-               return(1);
-       }
-       if (stat(pname(source), &s1) < 0 || stat(pname(target), &s2) < 0) {
-               fprintf(stderr, "mv: cannot locate parent\n");
-               return(1);
-       }
-       if (access(pname(target), 2) < 0) {
-               fprintf(stderr, "mv: no write access to %s\n", pname(target));
-               return(1);
-       }
-       if (access(pname(source), 2) < 0) {
-               fprintf(stderr, "mv: no write access to %s\n", pname(source));
-               return(1);
-       }
-       if (access(source, 2) < 0) {
-               fprintf(stderr, "mv: no write access to %s\n", source);
-               return(1);
-       }
-       if (s1.st_dev != s2.st_dev) {
-               fprintf(stderr, "mv: cannot move directories across devices\n");
-               return(1);
-       }
-       if (s1.st_ino != s2.st_ino) {
-               char dst[MAXN+5];
-
-               if (chkdot(source) || chkdot(target)) {
-                       fprintf(stderr, "mv: Sorry, path names including %s aren't allowed\n", DOTDOT);
-                       return(1);
-               }
-               stat(source, &s1);
-               if (check(pname(target), s1.st_ino))
-                       return(1);
-               for (i = 1; i <= NSIG; i++)
-                       signal(i, SIG_IGN);
-               if (link(source, target) < 0) {
-                       fprintf(stderr, "mv: cannot link %s to %s\n", target, source);
-                       return(1);
-               }
-               if (unlink(source) < 0) {
-                       fprintf(stderr, "mv: %s: cannot unlink\n", source);
-                       unlink(target);
-                       return(1);
-               }
-               strcat(dst, target);
-               strcat(dst, "/");
-               strcat(dst, DOTDOT);
-               if (unlink(dst) < 0) {
-                       fprintf(stderr, "mv: %s: cannot unlink\n", dst);
-                       if (link(target, source) >= 0)
-                               unlink(target);
-                       return(1);
-               }
-               if (link(pname(target), dst) < 0) {
-                       fprintf(stderr, "mv: cannot link %s to %s\n",
-                               dst, pname(target));
-                       if (link(pname(source), dst) >= 0)
-                               if (link(target, source) >= 0)
-                                       unlink(target);
-                       return(1);
-               }
-               return(0);
-       }
-       if (link(source, target) < 0) {
-               fprintf(stderr, "mv: cannot link %s and %s\n",
-                       source, target);
-               return(1);
-       }
-       if (unlink(source) < 0) {
-               fprintf(stderr, "mv: ?? cannot unlink %s\n", source);
-               return(1);
-       }
-       return(0);
-}
-
-char *
-pname(name)
-register char *name;
-{
-       register c;
-       register char *p, *q;
-       static  char buf[MAXN];
-
-       p = q = buf;
-       while (c = *p++ = *name++)
-               if (c == DELIM)
-                       q = p-1;
-       if (q == buf && *q == DELIM)
-               q++;
-       *q = 0;
-       return buf[0]? buf : DOT;
-}
-
-char *
-dname(name)
-register char *name;
-{
-       register char *p;
-
-       p = name;
-       while (*p)
-               if (*p++ == DELIM && *p)
-                       name = p;
-       return name;
-}
-
-check(spth, dinode)
-char *spth;
-ino_t dinode;
-{
-       char nspth[MAXN];
-       struct stat sbuf;
-
-       sbuf.st_ino = 0;
-
-       strcpy(nspth, spth);
-       while (sbuf.st_ino != ROOTINO) {
-               if (stat(nspth, &sbuf) < 0) {
-                       fprintf(stderr, "mv: cannot access %s\n", nspth);
-                       return(1);
-               }
-               if (sbuf.st_ino == dinode) {
-                       fprintf(stderr, "mv: cannot move a directory into itself\n");
-                       return(1);
-               }
-               if (strlen(nspth) > MAXN-2-sizeof(DOTDOT)) {
-                       fprintf(stderr, "mv: name too long\n");
-                       return(1);
-               }
-               strcat(nspth, SDELIM);
-               strcat(nspth, DOTDOT);
-       }
-       return(0);
-}
-
-chkdot(s)
-register char *s;
-{
-       do {
-               if (strcmp(dname(s), DOTDOT) == 0)
-                       return(1);
-               s = pname(s);
-       } while (strcmp(s, DOT) != 0 && strcmp(s, SDELIM) != 0);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ncheck.c b/.ref-Research-V7/usr/src/cmd/ncheck.c
deleted file mode 100644 (file)
index 3bbe4a2..0000000
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * ncheck -- obtain file names from reading filesystem
- */
-
-#define        NI      16
-#define        NB      100
-#define        HSIZE   2503
-#define        NDIR    (BSIZE/sizeof(struct direct))
-
-#include <stdio.h>
-#include <sys/param.h>
-#include <sys/inode.h>
-#include <sys/ino.h>
-#include <sys/dir.h>
-#include <sys/filsys.h>
-#include <sys/fblk.h>
-
-struct filsys  sblock;
-struct dinode  itab[INOPB*NI];
-daddr_t        iaddr[NADDR];
-ino_t  ilist[NB];
-struct htab
-{
-       ino_t   h_ino;
-       ino_t   h_pino;
-       char    h_name[DIRSIZ];
-} htab[HSIZE];
-
-int    aflg;
-int    sflg;
-int    fi;
-ino_t  ino;
-int    nhent;
-int    nxfile;
-
-int    nerror;
-daddr_t        bmap();
-long   atol();
-struct htab *lookup();
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-       long n;
-
-       while (--argc) {
-               argv++;
-               if (**argv=='-')
-               switch ((*argv)[1]) {
-
-               case 'a':
-                       aflg++;
-                       continue;
-
-               case 'i':
-                       for(i=0; i<NB; i++) {
-                               n = atol(argv[1]);
-                               if(n == 0)
-                                       break;
-                               ilist[i] = n;
-                               nxfile = i;
-                               argv++;
-                               argc--;
-                       }
-                       continue;
-
-               case 's':
-                       sflg++;
-                       continue;
-
-               default:
-                       fprintf(stderr, "ncheck: bad flag %c\n", (*argv)[1]);
-                       nerror++;
-               }
-               check(*argv);
-       }
-       return(nerror);
-}
-
-check(file)
-char *file;
-{
-       register i, j;
-       ino_t mino;
-
-       fi = open(file, 0);
-       if(fi < 0) {
-               fprintf(stderr, "ncheck: cannot open %s\n", file);
-               nerror++;
-               return;
-       }
-       nhent = 0;
-       printf("%s:\n", file);
-       sync();
-       bread((daddr_t)1, (char *)&sblock, sizeof(sblock));
-       mino = (sblock.s_isize-2) * INOPB;
-       ino = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= mino)
-                       break;
-               bread((daddr_t)i, (char *)itab, sizeof(itab));
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= mino)
-                               break;
-                       ino++;
-                       pass1(&itab[j]);
-               }
-       }
-       ilist[nxfile+1] = 0;
-       ino = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= mino)
-                       break;
-               bread((daddr_t)i, (char *)itab, sizeof(itab));
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= mino)
-                               break;
-                       ino++;
-                       pass2(&itab[j]);
-               }
-       }
-       ino = 0;
-       for(i=2;; i+=NI) {
-               if(ino >= mino)
-                       break;
-               bread((daddr_t)i, (char *)itab, sizeof(itab));
-               for(j=0; j<INOPB*NI; j++) {
-                       if(ino >= mino)
-                               break;
-                       ino++;
-                       pass3(&itab[j]);
-               }
-       }
-}
-
-pass1(ip)
-register struct dinode *ip;
-{
-       if((ip->di_mode & IFMT) != IFDIR) {
-               if (sflg==0 || nxfile>=NB)
-                       return;
-               if ((ip->di_mode&IFMT)==IFBLK || (ip->di_mode&IFMT)==IFCHR
-                 || ip->di_mode&(ISUID|ISGID))
-                       ilist[nxfile++] = ino;
-                       return;
-       }
-       lookup(ino, 1);
-}
-
-pass2(ip)
-register struct dinode *ip;
-{
-       struct direct dbuf[NDIR];
-       long doff;
-       struct direct *dp;
-       register i, j;
-       int k;
-       struct htab *hp;
-       daddr_t d;
-       ino_t kno;
-
-       if((ip->di_mode&IFMT) != IFDIR)
-               return;
-       l3tol(iaddr, ip->di_addr, NADDR);
-       doff = 0;
-       for(i=0;; i++) {
-               if(doff >= ip->di_size)
-                       break;
-               d = bmap(i);
-               if(d == 0)
-                       break;
-               bread(d, (char *)dbuf, sizeof(dbuf));
-               for(j=0; j<NDIR; j++) {
-                       if(doff >= ip->di_size)
-                               break;
-                       doff += sizeof(struct direct);
-                       dp = dbuf+j;
-                       kno = dp->d_ino;
-                       if(kno == 0)
-                               continue;
-                       hp = lookup(kno, 0);
-                       if(hp == 0)
-                               continue;
-                       if(dotname(dp))
-                               continue;
-                       hp->h_pino = ino;
-                       for(k=0; k<DIRSIZ; k++)
-                               hp->h_name[k] = dp->d_name[k];
-               }
-       }
-}
-
-pass3(ip)
-register struct dinode *ip;
-{
-       struct direct dbuf[NDIR];
-       long doff;
-       struct direct *dp;
-       register i, j;
-       int k;
-       daddr_t d;
-       ino_t kno;
-
-       if((ip->di_mode&IFMT) != IFDIR)
-               return;
-       l3tol(iaddr, ip->di_addr, NADDR);
-       doff = 0;
-       for(i=0;; i++) {
-               if(doff >= ip->di_size)
-                       break;
-               d = bmap(i);
-               if(d == 0)
-                       break;
-               bread(d, (char *)dbuf, sizeof(dbuf));
-               for(j=0; j<NDIR; j++) {
-                       if(doff >= ip->di_size)
-                               break;
-                       doff += sizeof(struct direct);
-                       dp = dbuf+j;
-                       kno = dp->d_ino;
-                       if(kno == 0)
-                               continue;
-                       if(aflg==0 && dotname(dp))
-                               continue;
-                       if(ilist[0] == 0)
-                               goto pr;
-                       for(k=0; ilist[k] != 0; k++)
-                               if(ilist[k] == kno)
-                                       goto pr;
-                       continue;
-               pr:
-                       printf("%u      ", kno);
-                       pname(ino, 0);
-                       printf("/%.14s", dp->d_name);
-                       if (lookup(kno, 0))
-                               printf("/.");
-                       printf("\n");
-               }
-       }
-}
-
-dotname(dp)
-register struct direct *dp;
-{
-
-       if (dp->d_name[0]=='.')
-               if (dp->d_name[1]==0 || (dp->d_name[1]=='.' && dp->d_name[2]==0))
-                       return(1);
-       return(0);
-}
-
-pname(i, lev)
-ino_t i;
-{
-       register struct htab *hp;
-
-       if (i==ROOTINO)
-               return;
-       if ((hp = lookup(i, 0)) == 0) {
-               printf("???");
-               return;
-       }
-       if (lev > 10) {
-               printf("...");
-               return;
-       }
-       pname(hp->h_pino, ++lev);
-       printf("/%.14s", hp->h_name);
-}
-
-struct htab *
-lookup(i, ef)
-ino_t i;
-{
-       register struct htab *hp;
-
-       for (hp = &htab[i%HSIZE]; hp->h_ino;) {
-               if (hp->h_ino==i)
-                       return(hp);
-               if (++hp >= &htab[HSIZE])
-                       hp = htab;
-       }
-       if (ef==0)
-               return(0);
-       if (++nhent >= HSIZE) {
-               fprintf(stderr, "ncheck: out of core-- increase HSIZE\n");
-               exit(1);
-       }
-       hp->h_ino = i;
-       return(hp);
-}
-
-bread(bno, buf, cnt)
-daddr_t bno;
-char *buf;
-{
-       register i;
-
-       lseek(fi, bno*BSIZE, 0);
-       if (read(fi, buf, cnt) != cnt) {
-               fprintf(stderr, "ncheck: read error %d\n", bno);
-               for(i=0; i<BSIZE; i++)
-                       buf[i] = 0;
-       }
-}
-
-daddr_t
-bmap(i)
-{
-       daddr_t ibuf[NINDIR];
-
-       if(i < NADDR-3)
-               return(iaddr[i]);
-       i -= NADDR-3;
-       if(i > NINDIR) {
-               fprintf(stderr, "ncheck: %u - huge directory\n", ino);
-               return((daddr_t)0);
-       }
-       bread(iaddr[NADDR-3], (char *)ibuf, sizeof(ibuf));
-       return(ibuf[i]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/diacrit.c b/.ref-Research-V7/usr/src/cmd/neqn/diacrit.c
deleted file mode 100644 (file)
index d38d24d..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-diacrit(p1, type) int p1, type; {
-       int c, t;
-
-       c = oalloc();
-       t = oalloc();
-       nrwid(p1, ps, p1);
-       printf(".nr 10 %du\n", max(eht[p1]-ebase[p1]-VERT(2),0));
-       switch(type) {
-               case VEC:       /* vec */
-               case DYAD:      /* dyad */
-                       printf(".ds %d \\v'-1'_\\v'1'\n", c);
-                       break;
-               case HAT:
-                       printf(".ds %d ^\n", c);
-                       break;
-               case TILDE:
-                       printf(".ds %d ~\n", c);
-                       break;
-               case DOT:
-                       printf(".ds %d \\v'-1'.\\v'1'\n", c);
-                       break;
-               case DOTDOT:
-                       printf(".ds %d \\v'-1'..\\v'1'\n", c);
-                       break;
-               case BAR:
-                       printf(".ds %d \\v'-1'\\l'\\n(%du'\\v'1'\n", 
-                               c, p1);
-                       break;
-               case UNDER:
-                       printf(".ds %d \\l'\\n(%du'\n", c, p1);
-                       break;
-               }
-       nrwid(c, ps, c);
-       printf(".as %d \\h'-\\n(%du-\\n(%du/2u'\\v'0-\\n(10u'\\*(%d", 
-               p1, p1, c, c);
-       printf("\\v'\\n(10u'\\h'-\\n(%du+\\n(%du/2u'\n", c, p1);
-       if (type != UNDER)
-               eht[p1] += VERT(1);
-       if (dbg) printf(".\tdiacrit: %c over S%d, h=%d, b=%d\n", type, p1, eht[p1], ebase[p1]);
-       ofree(c); ofree(t);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/e.h b/.ref-Research-V7/usr/src/cmd/neqn/e.h
deleted file mode 100644 (file)
index 4722f6b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdio.h>
-
-#define        FATAL   1
-#define        ROM     '1'
-#define        ITAL    '1'
-#define        BLD     '1'
-
-#define        VERT(n) (20 * (n))
-#define        EFFPS(p)        ((p) >= 6 ? (p) : 6)
-
-extern int     dbg;
-extern int     ct;
-extern int     lp[];
-extern int     used[]; /* available registers */
-extern int     ps;     /* dflt init pt size */
-extern int     deltaps;        /* default change in ps */
-extern int     gsize;  /* global size */
-extern int     gfont;  /* global font */
-extern int     ft;     /* dflt font */
-extern FILE    *curfile;       /* current input file */
-extern int     ifile;  /* input file number */
-extern int     linect; /* line number in current file */
-extern int     eqline; /* line where eqn started */
-extern int     svargc;
-extern char    **svargv;
-extern int     eht[];
-extern int     ebase[];
-extern int     lfont[];
-extern int     rfont[];
-extern int     yyval;
-extern int     *yypv;
-extern int     yylval;
-extern int     eqnreg, eqnht;
-extern int     lefteq, righteq;
-extern int     lastchar;       /* last character read by lex */
-extern int     markline;       /* 1 if this EQ/EN contains mark or lineup */
-
-typedef struct s_tbl {
-       char    *name;
-       char    *defn;
-       struct s_tbl *next;
-} tbl;
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/e.y b/.ref-Research-V7/usr/src/cmd/neqn/e.y
deleted file mode 100644 (file)
index f294e59..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-%{#
-#include "e.h"
-#
-int    fromflg;
-%}
-%term  CONTIG QTEXT SPACE THIN TAB
-%term  MATRIX LCOL CCOL RCOL COL
-%term  MARK LINEUP
-%term  SUM INT PROD UNION INTER
-%term  LPILE PILE CPILE RPILE ABOVE
-%term  DEFINE TDEFINE NDEFINE DELIM GSIZE GFONT INCLUDE
-%right FROM TO
-%left  OVER SQRT
-%right SUP SUB
-%right SIZE FONT ROMAN ITALIC BOLD FAT
-%right UP DOWN BACK FWD
-%left  LEFT RIGHT
-%right DOT DOTDOT HAT TILDE BAR UNDER VEC DYAD
-
-%%
-
-stuff  : eqn   { putout($1); }
-       | error { error(!FATAL, "syntax error"); }
-       |       { eqnreg = 0; }
-       ;
-
-eqn    : box
-       | eqn box       { eqnbox($1, $2, 0); }
-       | eqn lineupbox { eqnbox($1, $2, 1); }
-       | LINEUP        { lineup(0); }
-       ;
-
-lineupbox: LINEUP box  { $$ = $2; lineup(1); }
-       ;
-
-matrix : MATRIX        { $$ = ct; } ;
-
-collist        : column
-       | collist column
-       ;
-
-column : lcol '{' list '}'     { column('L', $1); }
-       | ccol '{' list '}'     { column('C', $1); }
-       | rcol '{' list '}'     { column('R', $1); }
-       | col '{' list '}'      { column('-', $1); }
-       ;
-
-lcol   : LCOL          { $$ = ct++; } ;
-ccol   : CCOL          { $$ = ct++; } ;
-rcol   : RCOL          { $$ = ct++; } ;
-col    : COL           { $$ = ct++; } ;
-
-sbox   : sup box       %prec SUP       { $$ = $2; }
-       ;
-
-tbox   : to box        %prec TO        { $$ = $2; }
-       |               %prec FROM      { $$ = 0; }
-       ;
-
-box    : box OVER box  { boverb($1, $3); }
-       | MARK box      { mark($2); }
-       | size box      %prec SIZE      { size($1, $2); }
-       | font box      %prec FONT      { font($1, $2); }
-       | FAT box       { fatbox($2); }
-       | SQRT box      { sqrt($2); }
-       | lpile '{' list '}'    { lpile('L', $1, ct); ct = $1; }
-       | cpile '{' list '}'    { lpile('C', $1, ct); ct = $1; }
-       | rpile '{' list '}'    { lpile('R', $1, ct); ct = $1; }
-       | pile '{' list '}'     { lpile('-', $1, ct); ct = $1; }
-       | box sub box sbox      %prec SUB       { shift2($1, $3, $4); }
-       | box sub box           %prec SUB       { bshiftb($1, $2, $3); }
-       | box sup box           %prec SUP       { bshiftb($1, $2, $3); }
-       | int sub box sbox      %prec SUB       { integral($1, $3, $4); }
-       | int sub box           %prec SUB       { integral($1, $3, 0); }
-       | int sup box           %prec SUP       { integral($1, 0, $3); }
-       | int                                   { integral($1, 0, 0); }
-       | left eqn right        { paren($1, $2, $3); }
-       | pbox
-       | box from box tbox     %prec FROM      { fromto($1, $3, $4); fromflg=0; }
-       | box to box    %prec TO        { fromto($1, 0, $3); }
-       | box diacrit   { diacrit($1, $2); }
-       | fwd box       %prec UP        { move(FWD, $1, $2); }
-       | up box        %prec UP        { move(UP, $1, $2); }
-       | back box      %prec UP        { move(BACK, $1, $2); }
-       | down box      %prec UP        { move(DOWN, $1, $2); }
-       | matrix '{' collist '}'        { matrix($1); }
-       ;
-
-int    : INT   { setintegral(); }
-       ;
-
-fwd    : FWD text      { $$ = atoi((char *) $1); } ;
-up     : UP text       { $$ = atoi((char *) $1); } ;
-back   : BACK text     { $$ = atoi((char *) $1); } ;
-down   : DOWN text     { $$ = atoi((char *) $1); } ;
-
-diacrit        : HAT   { $$ = HAT; }
-       | VEC   { $$ = VEC; }
-       | DYAD  { $$ = DYAD; }
-       | BAR   { $$ = BAR; }
-       | UNDER { $$ = UNDER; } /* under bar */
-       | DOT   { $$ = DOT; }
-       | TILDE { $$ = TILDE; }
-       | DOTDOT        { $$ = DOTDOT; } /* umlaut = double dot */
-       ;
-
-from   : FROM  { $$=ps; ps -= 3; fromflg = 1;
-               if(dbg)printf(".\tfrom: old ps %d, new ps %d, fflg %d\n", $$, ps, fromflg);
-               }
-       ;
-
-to     : TO    { $$=ps; if(fromflg==0)ps -= 3; 
-                       if(dbg)printf(".\tto: old ps %d, new ps %d\n", $$, ps);
-               }
-       ;
-
-left   : LEFT text     { $$ = ((char *)$2)[0]; }
-       | LEFT '{'      { $$ = '{'; }
-       ;
-
-right  : RIGHT text    { $$ = ((char *)$2)[0]; }
-       | RIGHT '}'     { $$ = '}'; }
-       |               { $$ = 0; }
-       ;
-
-list   : eqn   { lp[ct++] = $1; }
-       | list ABOVE eqn        { lp[ct++] = $3; }
-       ;
-
-lpile  : LPILE { $$ = ct; } ;
-cpile  : CPILE { $$ = ct; } ;
-pile   : PILE  { $$ = ct; } ;
-rpile  : RPILE { $$ = ct; } ;
-
-size   : SIZE text     { $$ = ps; setsize((char *) $2); }
-       ;
-
-font   : ROMAN         { setfont(ROM); }
-       | ITALIC        { setfont(ITAL); }
-       | BOLD          { setfont(BLD); }
-       | FONT text     { setfont(((char *)$2)[0]); }
-       ;
-
-sub    : SUB   { shift(SUB); }
-       ;
-
-sup    : SUP   { shift(SUP); }
-       ;
-
-pbox   : '{' eqn '}'   { $$ = $2; }
-       | QTEXT         { text(QTEXT, (char *) $1); }
-       | CONTIG        { text(CONTIG, (char *) $1); }
-       | SPACE         { text(SPACE, 0); }
-       | THIN          { text(THIN, 0); }
-       | TAB           { text(TAB, 0); }
-       | SUM           { funny(SUM); }
-       | PROD          { funny(PROD); }
-       | UNION         { funny(UNION); }
-       | INTER         { funny(INTER); }       /* intersection */
-       ;
-
-text   : CONTIG
-       | QTEXT
-       ;
-
-%%
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/eqnbox.c b/.ref-Research-V7/usr/src/cmd/neqn/eqnbox.c
deleted file mode 100644 (file)
index 2aea8da..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# include "e.h"
-
-eqnbox(p1, p2, lu) {
-       int b, h;
-       char *sh;
-
-       yyval = p1;
-       b = max(ebase[p1], ebase[p2]);
-       eht[yyval] = h = b + max(eht[p1]-ebase[p1], 
-               eht[p2]-ebase[p2]);
-       ebase[yyval] = b;
-       if(dbg)printf(".\te:eb: S%d <- S%d S%d; b=%d, h=%d\n", 
-               yyval, p1, p2, b, h);
-       if (rfont[p1] == ITAL && lfont[p2] == ROM)
-               sh = "\\|";
-       else
-               sh = "";
-       if (lu) {
-               printf(".nr %d \\w'\\s%d\\*(%d%s'\n", p1, ps, p1, sh);
-               printf(".ds %d \\h'|\\n(97u-\\n(%du'\\*(%d\n", p1, p1, p1);
-       }
-       printf(".as %d \"%s\\*(%d\n", yyval, sh, p2);
-       rfont[p1] = rfont[p2];
-       ofree(p2);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/font.c b/.ref-Research-V7/usr/src/cmd/neqn/font.c
deleted file mode 100644 (file)
index e4e026e..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# include "e.h"
-
-setfont(ch1) char ch1; {
-       /* use number '1', '2', '3' for roman, italic, bold */
-       yyval = ft;
-       if (ch1 == 'r' || ch1 == 'R')
-               ft = ROM;
-       else if (ch1 == 'i' || ch1 == 'I')
-               ft = ITAL;
-       else if (ch1 == 'b' || ch1 == 'B')
-               ft = BLD;
-       else
-               ft = ch1;
-       printf(".ft %c\n", ft);
-       if(dbg)printf(".\tsetfont %c\n", ft);
-}
-
-font(p1, p2) int p1, p2; {
-               /* old font in p1, new in ft */
-       yyval = p2;
-       lfont[yyval] = rfont[yyval] = ft==ITAL ? ITAL : ROM;
-       if(dbg)printf(".\tb:fb: S%d <- \\f%c S%d \\f%c b=%d,h=%d,lf=%c,rf=%c\n", 
-               yyval, ft, p2, p1, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]);
-       printf(".ds %d \\f%c\\*(%d\\f%c\n", 
-               yyval, ft, p2, p1);
-       ft = p1;
-       printf(".ft %c\n", ft);
-}
-
-fatbox(p) int p; {
-       int sh;
-
-       yyval = p;
-       sh = ps / 4;
-       nrwid(p, ps, p);
-       printf(".ds %d \\*(%d\\h'-\\n(%du+%du'\\*(%d\n", p, p, p, sh, p);
-       if(dbg)printf(".\tfat %d, sh=%d\n", p, sh);
-}
-
-globfont() {
-       char temp[20];
-
-       getstr(temp, 20);
-       yyval = eqnreg = 0;
-       gfont = temp[0];
-       switch (gfont) {
-       case 'r': case 'R':
-               gfont = '1';
-               break;
-       case 'i': case 'I':
-               gfont = '2';
-               break;
-       case 'b': case 'B':
-               gfont = '3';
-               break;
-       }
-       printf(".ft %c\n", gfont);
-       ft = gfont;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/fromto.c b/.ref-Research-V7/usr/src/cmd/neqn/fromto.c
deleted file mode 100644 (file)
index d792d1e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# include "e.h"
-
-fromto(p1, p2, p3) int p1, p2, p3; {
-       int b, h1, b1, pss;
-       yyval = oalloc();
-       lfont[yyval] = rfont[yyval] = 0;
-       h1 = eht[yyval] = eht[p1];
-       b1 = ebase[p1];
-       b = 0;
-       pss = EFFPS(ps);
-       ps += 3;
-       nrwid(p1, ps, p1);
-       printf(".nr %d \\n(%d\n", yyval, p1);
-       if( p2>0 ) {
-               nrwid(p2, pss, p2);
-               printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, yyval, yyval, p2);
-               eht[yyval] += eht[p2];
-               b = eht[p2];
-       }
-       if( p3>0 ) {
-               nrwid(p3, pss, p3);
-               printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p3, yyval, yyval, p3);
-               eht[yyval] += eht[p3];
-       }
-       printf(".ds %d ", yyval);       /* bottom of middle box */
-       if( p2>0 ) {
-               printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d", 
-                       eht[p2]-ebase[p2]+b1, yyval, p2, pss, p2, EFFPS(ps));
-               printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\\n", 
-                       yyval, p2, -(eht[p2]-ebase[p2]+b1));
-       }
-       printf("\\h'\\n(%du-\\n(%du/2u'\\*(%d\\h'\\n(%du-\\n(%du+2u/2u'\\\n", 
-               yyval, p1, p1, yyval, p1);
-       if( p3>0 ) {
-               printf("\\v'%du'\\h'-\\n(%du-\\n(%du/2u'\\s%d\\*(%d\\s%d\\h'\\n(%du-\\n(%du/2u'\\v'%du'\\\n", 
-                       -(h1-b1+ebase[p3]), yyval, p3, pss, p3, EFFPS(ps), yyval, p3, (h1-b1+ebase[p3]));
-       }
-       printf("\n");
-       ebase[yyval] = b + b1;
-       if(dbg)printf(".\tfrom to: S%d <- %d f %d t %d; h=%d b=%d\n", 
-               yyval, p1, p2, p3, eht[yyval], ebase[yyval]);
-       ofree(p1);
-       if( p2>0 ) ofree(p2);
-       if( p3>0 ) ofree(p3);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/funny.c b/.ref-Research-V7/usr/src/cmd/neqn/funny.c
deleted file mode 100644 (file)
index 1b93818..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-funny(n) int n; {
-       char *f;
-
-       yyval = oalloc();
-       switch(n) {
-       case SUM:
-               f = "\\(*S"; break;
-       case UNION:
-               f = "\\(cu"; break;
-       case INTER:     /* intersection */
-               f = "\\(ca"; break;
-       case PROD:
-               f = "\\(*P"; break;
-       default:
-               error(FATAL, "funny type %d in funny", n);
-       }
-       printf(".ds %d %s\n", yyval, f);
-       eht[yyval] = VERT(2);
-       ebase[yyval] = 0;
-       if(dbg)printf(".\tfunny: S%d <- %s; h=%d b=%d\n", 
-               yyval, f, eht[yyval], ebase[yyval]);
-       lfont[yyval] = rfont[yyval] = ROM;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/glob.c b/.ref-Research-V7/usr/src/cmd/neqn/glob.c
deleted file mode 100644 (file)
index 834a33f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "e.h"
-
-int    dbg;    /* debugging print if non-zero */
-int    lp[80]; /* stack for things like piles and matrices */
-int    ct;     /* pointer to lp */
-int    used[100];      /* available registers */
-int    ps;     /* default init point size */
-int    deltaps = 3;    /* default change in ps */
-int    gsize   = 10;   /* default initial point size */
-int    gfont   = ITAL; /* italic */
-int    ft;     /* default font */
-FILE   *curfile;       /* current input file */
-int    ifile;
-int    linect; /* line number in file */
-int    eqline; /* line where eqn started */
-int    svargc;
-char   **svargv;
-int    eht[100];
-int    ebase[100];
-int    lfont[100];
-int    rfont[100];
-int    eqnreg; /* register where final string appears */
-int    eqnht;  /* inal height of equation */
-int    lefteq  = '\0'; /* left in-line delimiter */
-int    righteq = '\0'; /* right in-line delimiter */
-int    lastchar;       /* last character read by lex */
-int    markline        = 0;    /* 1 if this EQ/EN contains mark or lineup */
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/integral.c b/.ref-Research-V7/usr/src/cmd/neqn/integral.c
deleted file mode 100644 (file)
index 1247250..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-integral(p, p1, p2) {
-#ifndef        NEQN
-       if (p1 != 0)
-               printf(".ds %d \\h'-0.4m'\\v'0.4m'\\*(%d\\v'-0.4m'\n", p1, p1);
-       if (p2 != 0)
-               printf(".ds %d \\v'-0.3m'\\*(%d\\v'0.3m'\n", p2, p2);
-#endif
-       if (p1 != 0 && p2 != 0)
-               shift2(p, p1, p2);
-       else if (p1 != 0)
-               bshiftb(p, SUB, p1);
-       else if (p2 != 0)
-               bshiftb(p, SUP, p2);
-       if(dbg)printf(".\tintegral: S%d; h=%d b=%d\n", 
-               p, eht[p], ebase[p]);
-       lfont[p] = ROM;
-}
-
-setintegral() {
-       char *f;
-
-       yyval = oalloc();
-       f = "\\(is";
-       printf(".ds %d %s\n", yyval, f);
-       eht[yyval] = VERT(2);
-       ebase[yyval] = 0;
-       lfont[yyval] = rfont[yyval] = ROM;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/io.c b/.ref-Research-V7/usr/src/cmd/neqn/io.c
deleted file mode 100644 (file)
index 541d31d..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-# include "e.h"
-#define        MAXLINE 1200    /* maximum input line */
-
-char   in[MAXLINE];    /* input buffer */
-int    eqnexit();
-int noeqn;
-
-main(argc,argv) int argc; char *argv[];{
-
-       eqnexit(eqn(argc, argv));
-}
-
-eqnexit(n) {
-#ifdef gcos
-       if (n)
-               fprintf(stderr, "run terminated due to eqn error\n");
-       exit(0);
-#endif
-       exit(n);
-}
-
-eqn(argc,argv) int argc; char *argv[];{
-       int i, type;
-
-       setfile(argc,argv);
-       init_tbl();     /* install keywords in tables */
-       while ((type=getline(in)) != EOF) {
-               eqline = linect;
-               if (in[0]=='.' && in[1]=='E' && in[2]=='Q') {
-                       for (i=11; i<100; used[i++]=0);
-                       printf("%s",in);
-                       printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n");
-                       markline = 0;
-                       init();
-                       yyparse();
-                       if (eqnreg>0) {
-                               printf(".nr %d \\w'\\*(%d'\n", eqnreg, eqnreg);
-                               /* printf(".if \\n(%d>\\n(.l .tm too-long eqn, file %s, between lines %d-%d\n", */
-                               /*      eqnreg, svargv[ifile], eqline, linect); */
-                               printf(".nr MK %d\n", markline);        /* for -ms macros */
-                               printf(".if %d>\\n(.v .ne %du\n", eqnht, eqnht);
-                               printf(".rn %d 10\n", eqnreg);
-                               if(!noeqn)printf("\\*(10\n");
-                       }
-                       printf(".ps \\n(99\n.ft \\n(98\n");
-                       printf(".EN");
-                       if (lastchar == EOF) {
-                               putchar('\n');
-                               break;
-                       }
-                       if (putchar(lastchar) != '\n')
-                               while (putchar(gtc()) != '\n');
-               }
-               else if (type == lefteq)
-                       inline();
-               else
-                       printf("%s",in);
-       }
-       return(0);
-}
-
-getline(s) register char *s; {
-       register c;
-       while((*s++=c=gtc())!='\n' && c!=EOF && c!=lefteq)
-               if (s >= in+MAXLINE) {
-                       error( !FATAL, "input line too long: %.20s\n", in);
-                       in[MAXLINE] = '\0';
-                       break;
-               }
-       if (c==lefteq)
-               s--;
-       *s++ = '\0';
-       return(c);
-}
-
-inline() {
-       int ds;
-
-       printf(".nr 99 \\n(.s\n.nr 98 \\n(.f\n");
-       ds = oalloc();
-       printf(".rm %d \n", ds);
-       do{
-               if (*in)
-                       printf(".as %d \"%s\n", ds, in);
-               init();
-               yyparse();
-               if (eqnreg > 0) {
-                       printf(".as %d \\*(%d\n", ds, eqnreg);
-                       ofree(eqnreg);
-               }
-               printf(".ps \\n(99\n.ft \\n(98\n");
-       } while (getline(in) == lefteq);
-       if (*in)
-               printf(".as %d \"%s", ds, in);
-       printf(".ps \\n(99\n.ft \\n(98\n");
-       printf("\\*(%d\n", ds);
-       ofree(ds);
-}
-
-putout(p1) int p1; {
-       extern int gsize, gfont;
-       int before, after;
-       if(dbg)printf(".\tanswer <- S%d, h=%d,b=%d\n",p1, eht[p1], ebase[p1]);
-       eqnht = eht[p1];
-       printf(".ds %d \\x'0'", p1);
-       /* suppposed to leave room for a subscript or superscript */
-       before = eht[p1] - ebase[p1] - VERT(3); /* 3 = 1.5 lines */
-       if (before > 0)
-               printf("\\x'0-%du'", before);
-       printf("\\f%c\\s%d\\*(%d%s\\s\\n(99\\f\\n(98",
-               gfont, gsize, p1, rfont[p1] == ITAL ? "\\|" : "");
-       after = ebase[p1] - VERT(1);
-       if (after > 0)
-               printf("\\x'%du'", after);
-       putchar('\n');
-       eqnreg = p1;
-}
-
-max(i,j) int i,j; {
-       return (i>j ? i : j);
-}
-
-oalloc() {
-       int i;
-       for (i=11; i<100; i++)
-               if (used[i]++ == 0) return(i);
-       error( FATAL, "no eqn strings left", i);
-       return(0);
-}
-
-ofree(n) int n; {
-       used[n] = 0;
-}
-
-setps(p) int p; {
-       printf(".ps %d\n", EFFPS(p));
-}
-
-nrwid(n1, p, n2) int n1, p, n2; {
-       printf(".nr %d \\w'\\s%d\\*(%d'\n", n1, EFFPS(p), n2);
-}
-
-setfile(argc, argv) int argc; char *argv[]; {
-       static char *nullstr = "-";
-
-       svargc = --argc;
-       svargv = argv;
-       while (svargc > 0 && svargv[1][0] == '-') {
-               switch (svargv[1][1]) {
-
-               case 'd': lefteq=svargv[1][2]; righteq=svargv[1][3]; break;
-               case 's': gsize = atoi(&svargv[1][2]); break;
-               case 'p': deltaps = atoi(&svargv[1][2]); break;
-               case 'f': gfont = svargv[1][2]; break;
-               case 'e': noeqn++; break;
-               default: dbg = 1;
-               }
-               svargc--;
-               svargv++;
-       }
-       ifile = 1;
-       linect = 1;
-       if (svargc <= 0) {
-               curfile = stdin;
-               svargv[1] = nullstr;
-       }
-       else if ((curfile = fopen(svargv[1], "r")) == NULL)
-               error( FATAL,"can't open file %s", svargv[1]);
-}
-
-yyerror() {;}
-
-init() {
-       ct = 0;
-       ps = gsize;
-       ft = gfont;
-       setps(ps);
-       printf(".ft %c\n", ft);
-}
-
-error(fatal, s1, s2) int fatal; char *s1, *s2; {
-       if (fatal>0)
-               printf("eqn fatal error: ");
-       printf(s1,s2);
-       printf("\nfile %s, between lines %d and %d\n",
-                svargv[ifile], eqline, linect);
-       fprintf(stderr, "eqn: ");
-       if (fatal>0)
-               fprintf(stderr, "fatal error: ");
-       fprintf(stderr, s1, s2);
-       fprintf(stderr, "\nfile %s, between lines %d and %d\n",
-                svargv[ifile], eqline, linect);
-       if (fatal > 0)
-               eqnexit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/lex.c b/.ref-Research-V7/usr/src/cmd/neqn/lex.c
deleted file mode 100644 (file)
index 19860a2..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-#include "e.h"
-#include "e.def"
-
-#define        SSIZE   400
-char   token[SSIZE];
-int    sp;
-#define        putbak(c)       *ip++ = c;
-#define        PUSHBACK        300     /* maximum pushback characters */
-char   ibuf[PUSHBACK+SSIZE];   /* pushback buffer for definitions, etc. */
-char   *ip     = ibuf;
-
-gtc() {
-  loop:
-       if (ip > ibuf)
-               return(*--ip);  /* already present */
-       lastchar = getc(curfile);
-       if (lastchar=='\n')
-               linect++;
-       if (lastchar != EOF)
-               return(lastchar);
-       if (++ifile > svargc) {
-               return(EOF);
-       }
-       fclose(curfile);
-       linect = 1;
-       if ((curfile=fopen(svargv[ifile], "r")) != NULL)
-               goto loop;
-       error(FATAL, "can't open file %s", svargv[ifile]);
-       return(EOF);
-}
-
-pbstr(str)
-register char *str;
-{
-       register char *p;
-
-       p = str;
-       while (*p++);
-       --p;
-       if (ip >= &ibuf[PUSHBACK])
-               error( FATAL, "pushback overflow");
-       while (p > str)
-               putbak(*--p);
-}
-
-yylex() {
-       register int c;
-       tbl *tp, *lookup();
-       extern tbl **keytbl, **deftbl;
-
-  beg:
-       while ((c=gtc())==' ' || c=='\n')
-               ;
-       yylval=c;
-       switch(c) {
-
-       case EOF:
-               return(EOF);
-       case '~':
-               return(SPACE);
-       case '^':
-               return(THIN);
-       case '\t':
-               return(TAB);
-       case '{':
-               return('{');
-       case '}':
-               return('}');
-       case '"':
-               for (sp=0; (c=gtc())!='"' && c != '\n'; ) {
-                       if (c == '\\')
-                               if ((c = gtc()) != '"')
-                                       token[sp++] = '\\';
-                       token[sp++] = c;
-                       if (sp>=SSIZE)
-                               error(FATAL, "quoted string %.20s... too long", token);
-               }
-               token[sp]='\0';
-               yylval = (int) &token[0];
-               if (c == '\n')
-                       error(!FATAL, "missing \" in %.20s", token);
-               return(QTEXT);
-       }
-       if (c==righteq)
-               return(EOF);
-
-       putbak(c);
-       getstr(token, SSIZE);
-       if (dbg)printf(".\tlex token = |%s|\n", token);
-       if ((tp = lookup(&deftbl, token, NULL)) != NULL) {
-               putbak(' ');
-               pbstr(tp->defn);
-               putbak(' ');
-               if (dbg)
-                       printf(".\tfound %s|=%s|\n", token, tp->defn);
-       }
-       else if ((tp = lookup(&keytbl, token, NULL)) == NULL) {
-               if(dbg)printf(".\t%s is not a keyword\n", token);
-               return(CONTIG);
-       }
-       else if (tp->defn == (char *) DEFINE || tp->defn == (char *) NDEFINE || tp->defn == (char *) TDEFINE)
-               define(tp->defn);
-       else if (tp->defn == (char *) DELIM)
-               delim();
-       else if (tp->defn == (char *) GSIZE)
-               globsize();
-       else if (tp->defn == (char *) GFONT)
-               globfont();
-       else if (tp->defn == (char *) INCLUDE)
-               include();
-       else {
-               return((int) tp->defn);
-       }
-       goto beg;
-}
-
-getstr(s, n) char *s; register int n; {
-       register int c;
-       register char *p;
-
-       p = s;
-       while ((c = gtc()) == ' ' || c == '\n')
-               ;
-       if (c == EOF) {
-               *s = 0;
-               return;
-       }
-       while (c != ' ' && c != '\t' && c != '\n' && c != '{' && c != '}'
-         && c != '"' && c != '~' && c != '^' && c != righteq) {
-               if (c == '\\')
-                       if ((c = gtc()) != '"')
-                               *p++ = '\\';
-               *p++ = c;
-               if (--n <= 0)
-                       error(FATAL, "token %.20s... too long", s);
-               c = gtc();
-       }
-       if (c=='{' || c=='}' || c=='"' || c=='~' || c=='^' || c=='\t' || c==righteq)
-               putbak(c);
-       *p = '\0';
-       yylval = (int) s;
-}
-
-cstr(s, quote, maxs) char *s; int quote; {
-       int del, c, i;
-
-       while((del=gtc()) == ' ' || del == '\t' || del == '\n');
-       if (quote)
-               for (i=0; (c=gtc()) != del && c != EOF;) {
-                       s[i++] = c;
-                       if (i >= maxs)
-                               return(1);      /* disaster */
-               }
-       else {
-               s[0] = del;
-               for (i=1; (c=gtc())!=' ' && c!= '\t' && c!='\n' && c!=EOF;) {
-                       s[i++]=c;
-                       if (i >= maxs)
-                               return(1);      /* disaster */
-               }
-       }
-       s[i] = '\0';
-       if (c == EOF)
-               error(FATAL, "Unexpected end of input at %.20s", s);
-       return(0);
-}
-
-define(type) int type; {
-       char *strsave(), *p1, *p2;
-       tbl *lookup();
-       extern tbl **deftbl;
-
-       getstr(token, SSIZE);   /* get name */
-       if (type != DEFINE) {
-               cstr(token, 1, SSIZE);  /* skip the definition too */
-               return;
-       }
-       p1 = strsave(token);
-       if (cstr(token, 1, SSIZE))
-               error(FATAL, "Unterminated definition at %.20s", token);
-       p2 = strsave(token);
-       lookup(&deftbl, p1, p2);
-       if (dbg)printf(".\tname %s defined as %s\n", p1, p2);
-}
-
-char *strsave(s)
-char *s;
-{
-       char *malloc();
-       register char *q;
-
-       q = malloc(strlen(s)+1);
-       if (q == NULL)
-               error(FATAL, "out of space in strsave on %s", s);
-       strcpy(q, s);
-       return(q);
-}
-
-include() {
-       error(!FATAL, "Include not yet implemented");
-}
-
-delim() {
-       yyval = eqnreg = 0;
-       if (cstr(token, 0, SSIZE))
-               error(FATAL, "Bizarre delimiters at %.20s", token);
-       lefteq = token[0];
-       righteq = token[1];
-       if (lefteq == 'o' && righteq == 'f')
-               lefteq = righteq = '\0';
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/lookup.c b/.ref-Research-V7/usr/src/cmd/neqn/lookup.c
deleted file mode 100644 (file)
index aa6ea92..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-# include "e.h"
-#include "e.def"
-
-#define        TBLSIZE 100
-
-tbl    *keytbl[TBLSIZE];       /* key words */
-tbl    *restbl[TBLSIZE];       /* reserved words */
-tbl    *deftbl[TBLSIZE];       /* user-defined names */
-
-struct {
-       char    *key;
-       int     keyval;
-} keyword[]    ={
-       "sub",  SUB, 
-       "sup",  SUP, 
-       ".EN",  EOF, 
-       "from",         FROM, 
-       "to",   TO, 
-       "sum",  SUM, 
-       "hat",  HAT, 
-       "vec", VEC, 
-       "dyad", DYAD, 
-       "dot",  DOT, 
-       "dotdot",       DOTDOT, 
-       "bar",  BAR, 
-       "tilde",        TILDE, 
-       "under",        UNDER, 
-       "prod",         PROD, 
-       "int",  INT, 
-       "integral",     INT, 
-       "union",        UNION, 
-       "inter",        INTER, 
-       "pile",         PILE, 
-       "lpile",        LPILE, 
-       "cpile",        CPILE, 
-       "rpile",        RPILE, 
-       "over",         OVER, 
-       "sqrt",         SQRT, 
-       "above",        ABOVE, 
-       "size",         SIZE, 
-       "font",         FONT, 
-       "fat", FAT, 
-       "roman",        ROMAN, 
-       "italic",       ITALIC, 
-       "bold",         BOLD, 
-       "left",         LEFT, 
-       "right",        RIGHT, 
-       "delim",        DELIM, 
-       "define",       DEFINE, 
-
-#ifdef NEQN    /* make ndefine synonym for define, tdefine a no-op */
-
-       "tdefine",      TDEFINE,
-       "ndefine",      DEFINE,
-
-#else          /* tdefine = define, ndefine = no-op */
-
-       "tdefine",      DEFINE, 
-       "ndefine",      NDEFINE, 
-
-#endif
-
-       "gsize",        GSIZE, 
-       ".gsize",       GSIZE, 
-       "gfont",        GFONT, 
-       "include",      INCLUDE, 
-       "up",   UP, 
-       "down",         DOWN, 
-       "fwd",  FWD, 
-       "back",         BACK, 
-       "mark",         MARK, 
-       "lineup",       LINEUP, 
-       "matrix",       MATRIX, 
-       "col",  COL, 
-       "lcol",         LCOL, 
-       "ccol",         CCOL, 
-       "rcol",         RCOL, 
-       0,      0
-};
-
-struct {
-       char    *res;
-       char    *resval;
-} resword[]    ={
-       ">=",   "\\(>=",
-       "<=",   "\\(<=",
-       "==",   "\\(==",
-       "!=",   "\\(!=",
-       "+-",   "\\(+-",
-       "->",   "\\(->",
-       "<-",   "\\(<-",
-       "inf",  "\\(if",
-       "infinity",     "\\(if",
-       "partial",      "\\(pd",
-       "half", "\\f1\\(12\\fP",
-       "prime",        "\\f1\\(fm\\fP",
-       "dollar",       "\\f1$\\fP",
-       "nothing",      "",
-       "times",        "\\(mu",
-       "del",  "\\(gr",
-       "grad", "\\(gr",
-#ifdef NEQN
-       "<<",   "<<",
-       ">>",   ">>",
-       "approx",       "~\b\\d~\\u",
-       "cdot", "\\v'-.5'.\\v'.5'",
-       "...",  "...",
-       ",...,",        ",...,",
-#else
-       "<<",   "<\\h'-.3m'<",
-       ">>",   ">\\h'-.3m'>",
-       "approx",       "\\v'-.2m'\\z\\(ap\\v'.25m'\\(ap\\v'-.05m'",
-       "cdot", "\\v'-.3m'.\\v'.3m'",
-       "...",  "\\v'-.3m'\\ .\\ .\\ .\\ \\v'.3m'",
-       ",...,",        ",\\ .\\ .\\ .\\ ,\\|",
-#endif
-
-       "alpha",        "\\(*a",
-       "beta", "\\(*b",
-       "gamma",        "\\(*g",
-       "GAMMA",        "\\(*G",
-       "delta",        "\\(*d",
-       "DELTA",        "\\(*D",
-       "epsilon",      "\\(*e",
-       "EPSILON",      "\\f1E\\fP",
-       "omega",        "\\(*w",
-       "OMEGA",        "\\(*W",
-       "lambda",       "\\(*l",
-       "LAMBDA",       "\\(*L",
-       "mu",   "\\(*m",
-       "nu",   "\\(*n",
-       "theta",        "\\(*h",
-       "THETA",        "\\(*H",
-       "phi",  "\\(*f",
-       "PHI",  "\\(*F",
-       "pi",   "\\(*p",
-       "PI",   "\\(*P",
-       "sigma",        "\\(*s",
-       "SIGMA",        "\\(*S",
-       "xi",   "\\(*c",
-       "XI",   "\\(*C",
-       "zeta", "\\(*z",
-       "iota", "\\(*i",
-       "eta",  "\\(*y",
-       "kappa",        "\\(*k",
-       "rho",  "\\(*r",
-       "tau",  "\\(*t",
-       "omicron",      "\\(*o",
-       "upsilon",      "\\(*u",
-       "UPSILON",      "\\(*U",
-       "psi",  "\\(*q",
-       "PSI",  "\\(*Q",
-       "chi",  "\\(*x",
-       "and",  "\\f1and\\fP",
-       "for",  "\\f1for\\fP",
-       "if",   "\\f1if\\fP",
-       "Re",   "\\f1Re\\fP",
-       "Im",   "\\f1Im\\fP",
-       "sin",  "\\f1sin\\fP",
-       "cos",  "\\f1cos\\fP",
-       "tan",  "\\f1tan\\fP",
-       "arc",  "\\f1arc\\fP",
-       "sinh", "\\f1sinh\\fP",
-       "coth", "\\f1coth\\fP",
-       "tanh", "\\f1tanh\\fP",
-       "cosh", "\\f1cosh\\fP",
-       "lim",  "\\f1lim\\fP",
-       "log",  "\\f1log\\fP",
-       "max",  "\\f1max\\fP",
-       "min",  "\\f1min\\fP",
-       "ln",   "\\f1ln\\fP",
-       "exp",  "\\f1exp\\fP",
-       "det",  "\\f1det\\fP",
-       0,      0
-};
-
-tbl *lookup(tblp, name, defn)  /* find name in tbl. if defn non-null, install */
-tbl **tblp;
-char *name, *defn;
-{
-       register tbl *p;
-       register int h;
-       register char *s = name;
-       char *malloc();
-
-       for (h = 0; *s != '\0'; )
-               h += *s++;
-       h %= TBLSIZE;
-
-       for (p = tblp[h]; p != NULL; p = p->next)
-               if (strcmp(name, p->name) == 0) {       /* found it */
-                       if (defn != NULL)
-                               p->defn = defn;
-                       return(p);
-               }
-       /* didn't find it */
-       if (defn == NULL)
-               return(NULL);
-       p = (tbl *) malloc(sizeof (tbl));
-       if (p == NULL)
-               error(FATAL, "out of space in lookup");
-       p->name = name;
-       p->defn = defn;
-       p->next = tblp[h];
-       tblp[h] = p;
-       return(p);
-}
-
-init_tbl()     /* initialize all tables */
-{
-       int i;
-
-       for (i = 0; keyword[i].key != NULL; i++)
-               lookup(keytbl, keyword[i].key, keyword[i].keyval);
-       for (i = 0; resword[i].res != NULL; i++)
-               lookup(restbl, resword[i].res, resword[i].resval);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/makefile b/.ref-Research-V7/usr/src/cmd/neqn/makefile
deleted file mode 100644 (file)
index 1fe54e6..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-CFLAGS=-O -s -DNEQN
-YFLAGS=-d
-
-all:   neqn
-
-cp:    neqn
-       cp neqn /bin/neqn
-       rm *.o e.c e.def neqn
-
-cmp:   neqn
-       cmp neqn /bin/neqn
-       rm *.o e.c e.def neqn
-
-SOURCE = e.y e.h diacrit.c eqnbox.c font.c fromto.c funny.c glob.c integral.c \
- io.c lex.c lookup.c mark.c matrix.c move.c over.c paren.c \
- pile.c shift.c size.c sqrt.c text.c
-
-FILES = e.o diacrit.o eqnbox.o font.o fromto.o funny.o glob.o integral.o \
- io.o lex.o lookup.o mark.o matrix.o move.o over.o paren.o \
- pile.o shift.o size.o sqrt.o text.o
-
-neqn:  $(FILES)
-       cc -n $(CFLAGS) $(FILES) -o neqn
-
-e.c:   e.def
-
-e.def: e.y
-       yacc -d e.y
-       mv y.tab.c e.c
-       mv y.tab.h e.def
-
-$(FILES):      e.h e.def
-
-list:
-       pr TODO $(SOURCE) makefile
-
-gcos:  y.tab.c
-       fsend e.h e.y *.c
-
-src:   makefile $(SOURCE)
-       cp $? /usr/src/cmd/neqn
-       touch src
-
-lint:  y.tab.c
-       lint -spb *.c
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/mark.c b/.ref-Research-V7/usr/src/cmd/neqn/mark.c
deleted file mode 100644 (file)
index 6e03156..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "e.h"
-
-mark(p1) int p1; {
-       markline = 1;
-       printf(".ds %d \\k(97\\*(%d\n", p1, p1);
-       yyval = p1;
-       if(dbg)printf(".\tmark %d\n", p1);
-}
-
-lineup(p1) {
-       markline = 1;
-       if (p1 == 0) {
-               yyval = oalloc();
-               printf(".ds %d \\h'|\\n(97u'\n", yyval);
-       }
-       if(dbg)printf(".\tlineup %d\n", p1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/matrix.c b/.ref-Research-V7/usr/src/cmd/neqn/matrix.c
deleted file mode 100644 (file)
index 209e37b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "e.h"
-
-column(type, p1) int type, p1; {
-       int i;
-
-       lp[p1] = ct - p1 - 1;
-       if( dbg ){
-               printf(".\t%d column of", type);
-               for( i=p1+1; i<ct; i++ )
-                       printf(" S%d", lp[i]);
-               printf(", rows=%d\n",lp[p1]);
-       }
-       lp[ct++] = type;
-}
-
-matrix(p1) int p1; {
-       int nrow, ncol, i, j, k, hb, b, val[100];
-       char *space;
-
-       space = "\\ \\ ";
-       nrow = lp[p1];  /* disaster if rows inconsistent */
-       ncol = 0;
-       for( i=p1; i<ct; i += lp[i]+2 ){
-               ncol++;
-               if(dbg)printf(".\tcolct=%d\n",lp[i]);
-       }
-       for( k=1; k<=nrow; k++ ) {
-               hb = b = 0;
-               j = p1 + k;
-               for( i=0; i<ncol; i++ ) {
-                       hb = max(hb, eht[lp[j]]-ebase[lp[j]]);
-                       b = max(b, ebase[lp[j]]);
-                       j += nrow + 2;
-               }
-               if(dbg)printf(".\trow %d: b=%d, hb=%d\n", k, b, hb);
-               j = p1 + k;
-               for( i=0; i<ncol; i++ ) {
-                       ebase[lp[j]] = b;
-                       eht[lp[j]] = b + hb;
-                       j += nrow + 2;
-               }
-       }
-       j = p1;
-       for( i=0; i<ncol; i++ ) {
-               lpile(lp[j+lp[j]+1], j+1, j+lp[j]+1);
-               val[i] = yyval;
-               j += nrow + 2;
-       }
-       yyval = oalloc();
-       eht[yyval] = eht[val[0]];
-       ebase[yyval] = ebase[val[0]];
-       lfont[yyval] = rfont[yyval] = 0;
-       if(dbg)printf(".\tmatrix S%d: r=%d, c=%d, h=%d, b=%d\n",
-               yyval,nrow,ncol,eht[yyval],ebase[yyval]);
-       printf(".ds %d \"", yyval);
-       for( i=0; i<ncol; i++ )  {
-               printf("\\*(%d%s", val[i], i==ncol-1 ? "" : space);
-               ofree(val[i]);
-       }
-       printf("\n");
-       ct = p1;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/move.c b/.ref-Research-V7/usr/src/cmd/neqn/move.c
deleted file mode 100644 (file)
index 2f3076c..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-move(dir, amt, p) int dir, amt, p; {
-       int a;
-
-       yyval = p;
-       a = VERT( (amt+49)/50 );        /* nearest number of half-lines */
-       printf(".ds %d ", yyval);
-       if( dir == FWD || dir == BACK ) /* fwd, back */
-               printf("\\h'%s%du'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
-       else if (dir == UP)
-               printf("\\v'-%du'\\*(%d\\v'%du'\n", a, p, a);
-       else if (dir == DOWN)
-               printf("\\v'%du'\\*(%d\\v'-%du'\n", a, p, a);
-       if(dbg)printf(".\tmove %d dir %d amt %d; h=%d b=%d\n", 
-               p, dir, a, eht[yyval], ebase[yyval]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/over.c b/.ref-Research-V7/usr/src/cmd/neqn/over.c
deleted file mode 100644 (file)
index 4625e36..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# include "e.h"
-
-boverb(p1, p2) int p1, p2; {
-       int h, b, treg, d;
-
-       treg = oalloc();
-       yyval = p1;
-       d = VERT(1);
-       h = eht[p1] + eht[p2];
-       b = eht[p2] - d;
-       if(dbg)printf(".\tb:bob: S%d <- S%d over S%d; b=%d, h=%d\n", 
-               yyval, p1, p2, b, h);
-       nrwid(p1, ps, p1);
-       nrwid(p2, ps, p2);
-       printf(".nr %d \\n(%d\n", treg, p1);
-       printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2);
-       printf(".ds %d \\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d\\\n", 
-               yyval, eht[p2]-ebase[p2]-d, treg, p2, p2);
-       printf("\\h'-\\n(%du-\\n(%du/2u'\\v'%du'\\*(%d\\\n", 
-               p2, p1, -eht[p2]+ebase[p2]-ebase[p1], p1);
-       printf("\\h'-\\n(%du-\\n(%du-2u/2u'\\v'%du'\\l'\\n(%du'\\v'%du'\n", 
-                treg, p1, ebase[p1], treg, d);
-       ebase[yyval] = b;
-       eht[yyval] = h;
-       lfont[yyval] = rfont[yyval] = 0;
-       ofree(p2);
-       ofree(treg);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/paren.c b/.ref-Research-V7/usr/src/cmd/neqn/paren.c
deleted file mode 100644 (file)
index 58c91bb..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# include "e.h"
-
-paren(leftc, p1, rightc) int p1, leftc, rightc; {
-       int n, m, h1, j, b1, v;
-       h1 = eht[p1]; b1 = ebase[p1];
-       yyval = p1;
-       n = max(b1+VERT(1), h1-b1-VERT(1)) / VERT(1);
-       if( n<2 ) n = 1;
-       m = n-2;
-       if (leftc=='{' || rightc == '}') {
-               n = n%2 ? n : ++n;
-               if( n<3 ) n=3;
-               m = n-3;
-       }
-       eht[yyval] = VERT(2 * n);
-       ebase[yyval] = (n)/2 * VERT(2);
-       if (n%2 == 0)
-               ebase[yyval] -= VERT(1);
-       v = b1 - h1/2 + VERT(1);
-       printf(".ds %d \\|\\v'%du'", yyval, v);
-       switch( leftc ) {
-               case 'n':       /* nothing */
-               case '\0':
-                       break;
-               case 'f':       /* floor */
-                       if (n <= 1)
-                               printf("\\(lf");
-                       else
-                               brack(m, "\\(bv", "\\(bv", "\\(lf");
-                       break;
-               case 'c':       /* ceiling */
-                       if (n <= 1)
-                               printf("\\(lc");
-                       else
-                               brack(m, "\\(lc", "\\(bv", "\\(bv");
-                       break;
-               case '{':
-                       printf("\\b'\\(lt");
-                       for(j = 0; j < m; j += 2) printf("\\(bv");
-                       printf("\\(lk");
-                       for(j = 0; j < m; j += 2) printf("\\(bv");
-                       printf("\\(lb'");
-                       break;
-               case '(':
-                       brack(m, "\\(lt", "\\(bv", "\\(lb");
-                       break;
-               case '[':
-                       brack(m, "\\(lc", "\\(bv", "\\(lf");
-                       break;
-               case '|':
-                       brack(m, "|", "|", "|");
-                       break;
-               default:
-                       brack(m, (char *) &leftc, (char *) &leftc, (char *) &leftc);
-                       break;
-               }
-       printf("\\v'%du'\\*(%d", -v, p1);
-       if( rightc ) {
-               printf("\\|\\v'%du'", v);
-               switch( rightc ) {
-                       case 'f':       /* floor */
-                               if (n <= 1)
-                                       printf("\\(rf");
-                               else
-                                       brack(m, "\\(bv", "\\(bv", "\\(rf");
-                               break;
-                       case 'c':       /* ceiling */
-                               if (n <= 1)
-                                       printf("\\(rc");
-                               else
-                                       brack(m, "\\(rc", "\\(bv", "\\(bv");
-                               break;
-                       case '}':
-                               printf("\\b'\\(rt");
-                               for(j = 0; j< m; j += 2)printf("\\(bv");
-                               printf("\\(rk");
-                               for(j = 0; j< m; j += 2) printf("\\(bv");
-                               printf("\\(rb'");
-                               break;
-                       case ']':
-                               brack(m, "\\(rc", "\\(bv", "\\(rf");
-                               break;
-                       case ')':
-                               brack(m, "\\(rt", "\\(bv", "\\(rb");
-                               break;
-                       case '|':
-                               brack(m, "|", "|", "|");
-                               break;
-                       default:
-                               brack(m, (char *) &rightc, (char *) &rightc, (char *) &rightc);
-                               break;
-               }
-               printf("\\v'%du'", -v);
-       }
-       printf("\n");
-       if(dbg)printf(".\tcurly: h=%d b=%d n=%d v=%d l=%c, r=%c\n", 
-               eht[yyval], ebase[yyval], n, v, leftc, rightc);
-}
-
-brack(m, t, c, b) int m; char *t, *c, *b; {
-       int j;
-       printf("\\b'%s", t);
-       for( j=0; j<m; j++)
-               printf("%s", c);
-       printf("%s'", b);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/pile.c b/.ref-Research-V7/usr/src/cmd/neqn/pile.c
deleted file mode 100644 (file)
index c2fca93..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# include "e.h"
-
-lpile(type, p1, p2) int type, p1, p2; {
-       int bi, hi, i, gap, h, b, nlist, nlist2, mid;
-       yyval = oalloc();
-       gap = VERT(1);
-       if( type=='-' ) gap = 0;
-       nlist = p2 - p1;
-       nlist2 = (nlist+1)/2;
-       mid = p1 + nlist2 -1;
-       h = 0;
-       for( i=p1; i<p2; i++ )
-               h += eht[lp[i]];
-       eht[yyval] = h + (nlist-1)*gap;
-       b = 0;
-       for( i=p2-1; i>mid; i-- )
-               b += eht[lp[i]] + gap;
-       ebase[yyval] = (nlist%2) ? b + ebase[lp[mid]]
-                       : b - VERT(1) - gap;
-       if(dbg) {
-               printf(".\tS%d <- %c pile of:", yyval, type);
-               for( i=p1; i<p2; i++)
-                       printf(" S%d", lp[i]);
-               printf(";h=%d b=%d\n", eht[yyval], ebase[yyval]);
-       }
-       nrwid(lp[p1], ps, lp[p1]);
-       printf(".nr %d \\n(%d\n", yyval, lp[p1]);
-       for( i = p1+1; i<p2; i++ ) {
-               nrwid(lp[i], ps, lp[i]);
-               printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", 
-                       lp[i], yyval, yyval, lp[i]);
-       }
-       printf(".ds %d \\v'%du'\\h'%du*\\n(%du'\\\n", yyval, ebase[yyval], 
-               type=='R' ? 1 : 0, yyval);
-       for(i = p2-1; i >=p1; i--) {
-               hi = eht[lp[i]]; 
-               bi = ebase[lp[i]];
-       switch(type) {
-
-       case 'L':
-               printf("\\v'%du'\\*(%d\\h'-\\n(%du'\\v'0-%du'\\\n", 
-                       -bi, lp[i], lp[i], hi-bi+gap);
-               continue;
-       case 'R':
-               printf("\\v'%du'\\h'-\\n(%du'\\*(%d\\v'0-%du'\\\n", 
-                       -bi, lp[i], lp[i], hi-bi+gap);
-               continue;
-       case 'C':
-       case '-':
-               printf("\\v'%du'\\h'\\n(%du-\\n(%du/2u'\\*(%d", 
-                       -bi, yyval, lp[i], lp[i]);
-               printf("\\h'-\\n(%du-\\n(%du/2u'\\v'0-%du'\\\n", 
-                       yyval, lp[i], hi-bi+gap);
-               continue;
-               }
-       }
-       printf("\\v'%du'\\h'%du*\\n(%du'\n", eht[yyval]-ebase[yyval]+gap, 
-               type!='R' ? 1 : 0, yyval);
-       for( i=p1; i<p2; i++ )
-               ofree(lp[i]);
-       lfont[yyval] = rfont[yyval] = 0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/shift.c b/.ref-Research-V7/usr/src/cmd/neqn/shift.c
deleted file mode 100644 (file)
index 068cb72..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# include "e.h"
-#include "e.def"
-
-bshiftb(p1, dir, p2) int p1, dir, p2; {
-       int shval, d1, h1, b1, h2, b2;
-       yyval = p1;
-       h1 = eht[p1];
-       b1 = ebase[p1];
-       h2 = eht[p2];
-       b2 = ebase[p2];
-       if( dir == SUB ) {      /* subscript */
-               d1 = VERT(1);
-               shval = - d1 + h2 - b2;
-               if( d1+b1 > h2 ) /* move little sub down */
-                       shval = b1-b2;
-               ebase[yyval] = b1 + max(0, h2-b1-d1);
-               eht[yyval] = h1 + max(0, h2-b1-d1);
-       } else {        /* superscript */
-               d1 = VERT(1);
-               ebase[yyval] = b1;
-               shval = -VERT(1) - b2;
-               if( VERT(1) + h2 < h1-b1 )      /* raise little super */
-                       shval = -(h1-b1) + h2-b2 - d1;
-               eht[yyval] = h1 + max(0, h2 - VERT(1));
-       }
-       if(dbg)printf(".\tb:b shift b: S%d <- S%d vert %d S%d vert %d; b=%d, h=%d\n", 
-               yyval, p1, shval, p2, -shval, ebase[yyval], eht[yyval]);
-       printf(".as %d \\v'%du'\\*(%d\\v'%du'\n", 
-               yyval, shval, p2, -shval);
-       ofree(p2);
-}
-
-shift(p1) int p1; {
-       ps -= deltaps;
-       yyval = p1;
-       if(dbg)printf(".\tshift: %d;ps=%d\n", yyval, ps);
-}
-
-shift2(p1, p2, p3) int p1, p2, p3; {
-       int effps, h1, h2, h3, b1, b2, b3, subsh, d1, d2, supsh;
-       int treg;
-
-       treg = oalloc();
-       yyval = p1;
-       if(dbg)printf(".\tshift2 s%d <- %d %d %d\n", yyval, p1, p2, p3);
-       effps = EFFPS(ps+deltaps);
-       h1 = eht[p1]; b1 = ebase[p1];
-       h2 = eht[p2]; b2 = ebase[p2];
-       h3 = eht[p3]; b3 = ebase[p3];
-       d1 = VERT(1);
-       subsh = -d1+h2-b2;
-       if( d1+b1 > h2 ) /* move little sub down */
-               subsh = b1-b2;
-       supsh = - VERT(1) - b3;
-       d2 = VERT(1);
-       if( VERT(1)+h3 < h1-b1 )
-               supsh = -(h1-b1) + (h3-b3) - d2;
-       eht[yyval] = h1 + max(0, h3-VERT(1)) + max(0, h2-b1-d1);
-       ebase[yyval] = b1+max(0, h2-b1-d1);
-       nrwid(p2, effps, p2);
-       nrwid(p3, effps, p3);
-       printf(".nr %d \\n(%d\n", treg, p3);
-       printf(".if \\n(%d>\\n(%d .nr %d \\n(%d\n", p2, treg, treg, p2);
-       printf(".as %d \\v'%du'\\*(%d\\h'-\\n(%du'\\v'%du'\\\n", 
-               p1, subsh, p2, p2, -subsh+supsh);
-       printf("\\*(%d\\h'-\\n(%du+\\n(%du'\\v'%du'\n", 
-               p3, p3, treg, -supsh);
-       ps += deltaps;
-       ofree(p2); ofree(p3); ofree(treg);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/size.c b/.ref-Research-V7/usr/src/cmd/neqn/size.c
deleted file mode 100644 (file)
index 8f99fa6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# include "e.h"
-
-setsize(p)     /* set size as found in p */
-char *p;
-{
-       if (*p == '+')
-               ps += atoi(p+1);
-       else if (*p == '-')
-               ps -= atoi(p+1);
-       else
-               ps = atoi(p);
-       if(dbg)printf(".\tsetsize %s; ps = %d\n", p, ps);
-}
-
-size(p1, p2) int p1, p2; {
-               /* old size in p1, new in ps */
-       int effps, effp1;
-
-       yyval = p2;
-       if(dbg)printf(".\tb:sb: S%d <- \\s%d S%d \\s%d; b=%d, h=%d\n", 
-               yyval, ps, p2, p1, ebase[yyval], eht[yyval]);
-       effps = EFFPS(ps);
-       effp1 = EFFPS(p1);
-       printf(".ds %d \\s%d\\*(%d\\s%d\n", 
-               yyval, effps, p2, effp1);
-       ps = p1;
-}
-
-globsize() {
-       char temp[20];
-
-       getstr(temp, 20);
-       if (temp[0] == '+')
-               gsize += atoi(temp+1);
-       else if (temp[0] == '-')
-               gsize -= atoi(temp+1);
-       else
-               gsize = atoi(temp);
-       yyval = eqnreg = 0;
-       setps(gsize);
-       ps = gsize;
-       if (gsize >= 12)        /* sub and sup size change */
-               deltaps = gsize / 4;
-       else
-               deltaps = gsize / 3;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/sqrt.c b/.ref-Research-V7/usr/src/cmd/neqn/sqrt.c
deleted file mode 100644 (file)
index e236f0e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# include "e.h"
-
-sqrt(p2) int p2; {
-       yyval = p2;
-       nrwid(p2, ps, p2);
-       printf(".ds %d \\v'%du'\\e\\L'%du'\\l'\\n(%du'",
-               p2, ebase[p2], -eht[p2], p2);
-       printf("\\v'%du'\\h'-\\n(%du'\\*(%d\n", eht[p2]-ebase[p2], p2, p2);
-       eht[p2] =+ VERT(1);
-       if(dbg)printf(".\tsqrt: S%d <- S%d;b=%d, h=%d\n", 
-               p2, p2, ebase[p2], eht[p2]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/neqn/text.c b/.ref-Research-V7/usr/src/cmd/neqn/text.c
deleted file mode 100644 (file)
index 0686dca..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-# include "e.h"
-# include "e.def"
-
-int    csp;
-int    psp;
-#define        CSSIZE  400
-char   cs[420];
-
-int    lf, rf; /* temporary spots for left and right fonts */
-
-text(t,p1) int t; char *p1; {
-       int c;
-       char *p;
-       tbl *tp, *lookup();
-       extern tbl *restbl;
-
-       yyval = oalloc();
-       ebase[yyval] = 0;
-       eht[yyval] = VERT(2);   /* 2 half-spaces */
-       lfont[yyval] = rfont[yyval] = ROM;
-       if (t == QTEXT)
-               p = p1;
-       else if ( t == SPACE )
-               p = "\\ ";
-       else if ( t == THIN )
-               p = "\\|";
-       else if ( t == TAB )
-               p = "\\t";
-       else if ((tp = lookup(&restbl, p1, NULL)) != NULL)
-               p = tp->defn;
-       else {
-               lf = rf = 0;
-               for (csp=psp=0; (c=p1[psp++])!='\0';) {
-                       rf = trans(c, p1);
-                       if (lf == 0)
-                               lf = rf;        /* save first */
-                       if (csp>CSSIZE)
-                               error(FATAL,"converted token %.25s... too long",p1);
-               }
-               cs[csp] = '\0';
-               p = cs;
-               lfont[yyval] = lf;
-               rfont[yyval] = rf;
-       }
-       if(dbg)printf(".\t%dtext: S%d <- %s; b=%d,h=%d,lf=%c,rf=%c\n",
-               t, yyval, p, ebase[yyval], eht[yyval], lfont[yyval], rfont[yyval]);
-       printf(".ds %d \"%s\n", yyval, p);
-}
-
-trans(c,p1) int c; char *p1; {
-       int f;
-       f = ROM;
-       switch( c) {
-       case '0': case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8': case '9':
-       case ':': case ';': case '!': case '%':
-       case '(': case '[': case ')': case ']':
-       case ',':
-               if (rf == ITAL)
-                       shim();
-               roman(c); break;
-       case '.':
-               if (rf == ROM)
-                       roman(c);
-               else
-                       cs[csp++] = c;
-               f = rf;
-               break;
-       case '|':
-               if (rf == ITAL)
-                       shim();
-               shim(); roman(c); shim(); break;
-       case '=':
-               if (rf == ITAL)
-                       shim();
-               name4('e','q');
-               break;
-       case '+':
-               if (rf == ITAL)
-                       shim();
-               name4('p', 'l');
-               break;
-       case '>': case '<':
-               if (rf == ITAL)
-                       shim();
-               if (p1[psp]=='=') {     /* look ahead for == <= >= */
-                       name4(c,'=');
-                       psp++;
-               } else {
-                       cs[csp++] = c;  
-               }
-               break;
-       case '-':
-               if (rf == ITAL)
-                       shim();
-               if (p1[psp]=='>') {
-                       name4('-','>'); psp++;
-               } else {
-                       name4('m','i');
-               }
-               break;
-       case '/':
-               if (rf == ITAL)
-                       shim();
-               name4('s','l');
-               break;
-       case '~': case ' ':
-               shim(); shim(); break;
-       case '^':
-               shim(); break;
-       case '\\':      /* troff - pass 2 or 3 more chars */
-               if (rf == ITAL)
-                       shim();
-               cs[csp++] = c; cs[csp++] = c = p1[psp++]; cs[csp++] = p1[psp++];
-               if (c=='(') cs[csp++] = p1[psp++];
-               if (c=='*' && cs[csp-1] == '(') {
-                       cs[csp++] = p1[psp++];
-                       cs[csp++] = p1[psp++];
-               }
-               break;
-       case '\'':
-               cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = rf==ITAL ? ITAL : ROM;
-               name4('f','m');
-               cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P';
-               f = rf==ITAL ? ITAL : ROM;
-               break;
-
-       case 'f':
-               if (ft == ITAL) {
-                       cs[csp++] = '\\'; cs[csp++] = '^';
-                       cs[csp++] = 'f';
-                       cs[csp++] = '\\'; cs[csp++] = '|';      /* trying | instead of ^ */
-                       f = ITAL;
-               }
-               else
-                       cs[csp++] = 'f';
-               break;
-       case 'j':
-               if (ft == ITAL) {
-                       cs[csp++] = '\\'; cs[csp++] = '^';
-                       cs[csp++] = 'j';
-                       f = ITAL;
-               }
-               else
-                       cs[csp++] = 'j';
-               break;
-       default:
-               cs[csp++] = c;
-               f = ft==ITAL ? ITAL : ROM;
-               break;
-       }
-       return(f);
-}
-
-shim() {
-       cs[csp++] = '\\'; cs[csp++] = '|';
-}
-
-roman(c) int c; {
-       cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = ROM;
-       cs[csp++] = c;
-       cs[csp++] = '\\'; cs[csp++] = 'f'; cs[csp++] = 'P';
-}
-
-name4(c1,c2) int c1,c2; {
-       cs[csp++] = '\\';
-       cs[csp++] = '(';
-       cs[csp++] = c1;
-       cs[csp++] = c2;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/newgrp.c b/.ref-Research-V7/usr/src/cmd/newgrp.c
deleted file mode 100644 (file)
index af49a5e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <stdio.h>
-#include <grp.h>
-#include <pwd.h>
-
-struct group   *getgrnam(), *grp;
-struct passwd  *getpwuid(), *pwd;
-char   *getpass(), *crypt();
-
-main(argc,argv)
-int    argc;
-char   **argv;
-{
-       register i;
-       if(argc != 2) {
-               printf("usage: newgrp groupname\n");
-               done();
-       }
-       if((grp=getgrnam(argv[1])) == NULL) {
-               printf("%s: no such group\n", argv[1]);
-               done();
-       }
-       if((pwd=getpwuid(getuid())) == NULL) {
-               printf("You do not exist!\n");
-               done();
-       }
-       for(i=0;grp->gr_mem[i];i++) 
-               if(strcmp(grp->gr_mem[i], pwd->pw_name) == 0)
-                       break;
-       if(grp->gr_mem[i] == 0 && strcmp(grp->gr_name,"other")) {
-               printf("Sorry\n");
-               done();
-       }
-
-       if(grp->gr_passwd[0] != '\0' && pwd->pw_passwd[0] == '\0') {
-               if(strcmp(grp->gr_passwd, crypt(getpass("Password:"),grp->gr_passwd)) != 0) {
-                       printf("Sorry\n");
-                       done();
-               }
-       }
-       if(setgid(grp->gr_gid) < 0)
-               perror("setgid");
-       done();
-}
-
-done()
-{
-       register i;
-
-       setuid(getuid());
-       for (i=3; i<15; i++)
-               close(i);
-       execl("/bin/sh", "sh", 0);
-       printf("No shell!\n");
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/nice.c b/.ref-Research-V7/usr/src/cmd/nice.c
deleted file mode 100644 (file)
index ed22a93..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* nice */
-
-#include <stdio.h>
-
-main(argc, argv)
-int argc;
-char *argv[];
-{
-       int nicarg = 10;
-       extern errno;
-       extern char *sys_errlist[];
-
-       if(argc > 1 && argv[1][0] == '-') {
-               nicarg = atoi(&argv[1][1]);
-               argc--;
-               argv++;
-       }
-       if(argc < 2) {
-               fputs("usage: nice [ -n ] command\n", stderr);
-               exit(1);
-       }
-       nice(nicarg);
-       execvp(argv[1], &argv[1]);
-       fprintf(stderr, "%s: %s\n", sys_errlist[errno], argv[1]);
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/nm.c b/.ref-Research-V7/usr/src/cmd/nm.c
deleted file mode 100644 (file)
index 2d3ee27..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
-**     print symbol tables for
-**     object or archive files
-**
-**     nm [-goprun] [name ...]
-*/
-
-
-
-#include       <ar.h>
-#include       <a.out.h>
-#include       <stdio.h>
-#include       <ctype.h>
-#define        MAGIC   exp.a_magic
-#define        BADMAG  MAGIC!=A_MAGIC1 && MAGIC!=A_MAGIC2  \
-               && MAGIC!=A_MAGIC3 && MAGIC!=A_MAGIC4
-#define        SELECT  arch_flg ? arp.ar_name : *argv
-int    numsort_flg;
-int    undef_flg;
-int    revsort_flg = 1;
-int    globl_flg;
-int    nosort_flg;
-int    arch_flg;
-int    prep_flg;
-struct ar_hdr  arp;
-struct exec    exp;
-FILE   *fi;
-long   off;
-long   ftell();
-char   *malloc();
-char   *realloc();
-
-main(argc, argv)
-char **argv;
-{
-       int narg;
-       int  compare();
-
-       if (--argc>0 && argv[1][0]=='-' && argv[1][1]!=0) {
-               argv++;
-               while (*++*argv) switch (**argv) {
-               case 'n':               /* sort numerically */
-                       numsort_flg++;
-                       continue;
-
-               case 'g':               /* globl symbols only */
-                       globl_flg++;
-                       continue;
-
-               case 'u':               /* undefined symbols only */
-                       undef_flg++;
-                       continue;
-
-               case 'r':               /* sort in reverse order */
-                       revsort_flg = -1;
-                       continue;
-
-               case 'p':               /* don't sort -- symbol table order */
-                       nosort_flg++;
-                       continue;
-
-               case 'o':               /* prepend a name to each line */
-                       prep_flg++;
-                       continue;
-
-               default:                /* oops */
-                       fprintf(stderr, "nm: invalid argument -%c\n", *argv[0]);
-                       exit(1);
-               }
-               argc--;
-       }
-       if (argc == 0) {
-               argc = 1;
-               argv[1] = "a.out";
-       }
-       narg = argc;
-       while(argc--) {
-               fi = fopen(*++argv,"r");
-               if (fi == NULL) {
-                       fprintf(stderr, "nm: cannot open %s\n", *argv);
-                       continue;
-               }
-               off = sizeof(exp.a_magic);
-               fread((char *)&exp, 1, sizeof(MAGIC), fi);      /* get magic no. */
-               if (MAGIC == ARMAG)
-                       arch_flg++;
-               else if (BADMAG) {
-                       fprintf(stderr, "nm: %s-- bad format\n", *argv);
-                       continue;
-               }
-               fseek(fi, 0L, 0);
-               if (arch_flg) {
-                       nextel(fi);
-                       if (narg > 1)
-                               printf("\n%s:\n", *argv);
-               }
-               do {
-                       long o;
-                       register i, n, c;
-                       struct nlist *symp = NULL;
-                       struct nlist sym;
-
-                       fread((char *)&exp, 1, sizeof(struct exec), fi);
-                       if (BADMAG)             /* archive element not in  */
-                               continue;       /* proper format - skip it */
-                       o = (long)exp.a_text + exp.a_data;
-                       if ((exp.a_flag & 01) == 0)
-                               o *= 2;
-                       fseek(fi, o, 1);
-                       n = exp.a_syms / sizeof(struct nlist);
-                       if (n == 0) {
-                               fprintf(stderr, "nm: %s-- no name list\n", SELECT);
-                               continue;
-                       }
-                       i = 0;
-                       while (--n >= 0) {
-                               fread((char *)&sym, 1, sizeof(sym), fi);
-                               if (globl_flg && (sym.n_type&N_EXT)==0)
-                                       continue;
-                               switch (sym.n_type&N_TYPE) {
-
-                               case N_UNDF:
-                                       c = 'u';
-                                       if (sym.n_value)
-                                               c = 'c';
-                                       break;
-
-                               default:
-                               case N_ABS:
-                                       c = 'a';
-                                       break;
-
-                               case N_TEXT:
-                                       c = 't';
-                                       break;
-
-                               case N_DATA:
-                                       c = 'd';
-                                       break;
-
-                               case N_BSS:
-                                       c = 'b';
-                                       break;
-
-                               case N_FN:
-                                       c = 'f';
-                                       break;
-
-                               case N_REG:
-                                       c = 'r';
-                                       break;
-                               }
-                               if (undef_flg && c!='u')
-                                       continue;
-                               if (sym.n_type&N_EXT)
-                                       c = toupper(c);
-                               sym.n_type = c;
-                               if (symp==NULL)
-                                       symp = (struct nlist *)malloc(sizeof(struct nlist));
-                               else {
-                                       symp = (struct nlist *)realloc(symp, (i+1)*sizeof(struct nlist));
-                               }
-                               if (symp == NULL) {
-                                       fprintf(stderr, "nm: out of memory on %s\n", *argv);
-                                       exit(2);
-                               }
-                               symp[i++] = sym;
-                       }
-                       if (nosort_flg==0)
-                               qsort(symp, i, sizeof(struct nlist), compare);
-                       if ((arch_flg || narg>1) && prep_flg==0)
-                               printf("\n%s:\n", SELECT);
-                       for (n=0; n<i; n++) {
-                               if (prep_flg) {
-                                       if (arch_flg)
-                                               printf("%s:", *argv);
-                                       printf("%s:", SELECT);
-                               }
-                               c = symp[n].n_type;
-                               if (!undef_flg) {
-                                       if (c=='u' || c=='U')
-                                               printf("      ");
-                                       else
-                                               printf(FORMAT, symp[n].n_value);
-                                       printf(" %c ", c);
-                               }
-                               printf("%.8s\n", symp[n].n_name);
-                       }
-                       if (symp)
-                               free((char *)symp);
-               } while(arch_flg && nextel(fi));
-               fclose(fi);
-       }
-       exit(0);
-}
-
-compare(p1, p2)
-struct nlist *p1, *p2;
-{
-       register i;
-
-       if (numsort_flg) {
-               if (p1->n_value > p2->n_value)
-                       return(revsort_flg);
-               if (p1->n_value < p2->n_value)
-                       return(-revsort_flg);
-       }
-       for(i=0; i<sizeof(p1->n_name); i++)
-               if (p1->n_name[i] != p2->n_name[i]) {
-                       if (p1->n_name[i] > p2->n_name[i])
-                               return(revsort_flg);
-                       else
-                               return(-revsort_flg);
-               }
-       return(0);
-}
-
-nextel(af)
-FILE *af;
-{
-       register r;
-
-       fseek(af, off, 0);
-       r = fread((char *)&arp, 1, sizeof(struct ar_hdr), af);  /* read archive header */
-       if (r <= 0)
-               return(0);
-       if (arp.ar_size & 1)
-               ++arp.ar_size;
-       off = ftell(af) + arp.ar_size;  /* offset to next element */
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/od.c b/.ref-Research-V7/usr/src/cmd/od.c
deleted file mode 100644 (file)
index f0809c9..0000000
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * od -- octal (also hex, decimal, and character) dump
- */
-
-#include <stdio.h>
-
-unsigned short word[8];
-unsigned short lastword[8];
-int    conv;
-int    base =  010;
-int    max;
-long   addr;
-
-main(argc, argv)
-char **argv;
-{
-       register char *p;
-       register n, f, same;
-
-
-       argv++;
-       f = 0;
-       if(argc > 1) {
-               p = *argv;
-               if(*p == '-') {
-                       while(*p != '\0') {
-                               switch(*p++) {
-                               case 'o':
-                                       conv |= 001;
-                                       f = 6;
-                                       break;
-                               case 'd':
-                                       conv |= 002;
-                                       f = 5;
-                                       break;
-                               case 'x':
-                               case 'h':
-                                       conv |= 010;
-                                       f = 4;
-                                       break;
-                               case 'c':
-                                       conv |= 020;
-                                       f = 7;
-                                       break;
-                               case 'b':
-                                       conv |= 040;
-                                       f = 7;
-                                       break;
-                               }
-                               if(f > max)
-                                       max = f;
-                       }
-                       argc--;
-                       argv++;
-               }
-       }
-       if(!conv) {
-               max = 6;
-               conv = 1;
-       }
-       if(argc > 1)
-       if(**argv != '+') {
-               if (freopen(*argv, "r", stdin) == NULL) {
-                       printf("cannot open %s\n", *argv);
-                       exit(1);
-               }
-               argv++;
-               argc--;
-       }
-       if(argc > 1)
-               offset(*argv);
-
-       same = -1;
-       for ( ; (n = fread((char *)word, 1, sizeof(word), stdin)) > 0; addr += n) {
-               if (same>=0) {
-                       for (f=0; f<8; f++)
-                               if (lastword[f] != word[f])
-                                       goto notsame;
-                       if (same==0) {
-                               printf("*\n");
-                               same = 1;
-                       }
-                       continue;
-               }
-       notsame:
-               line(addr, word, (n+sizeof(word[0])-1)/sizeof(word[0]));
-               same = 0;
-               for (f=0; f<8; f++)
-                       lastword[f] = word[f];
-               for (f=0; f<8; f++)
-                       word[f] = 0;
-       }
-       putn(addr, base, 7);
-       putchar('\n');
-}
-
-line(a, w, n)
-long a;
-unsigned short *w;
-{
-       register i, f, c;
-
-       f = 1;
-       for(c=1; c; c<<=1) {
-               if((c&conv) == 0)
-                       continue;
-               if(f) {
-                       putn(a, base, 7);
-                       putchar(' ');
-                       f = 0;
-               } else
-                       putchar('\t');
-               for (i=0; i<n; i++) {
-                       putx(w[i], c);
-                       putchar(i==n-1? '\n': ' ');
-               }
-       }
-}
-
-putx(n, c)
-unsigned n;
-{
-
-       switch(c) {
-       case 001:
-               pre(6);
-               putn((long)n, 8, 6);
-               break;
-       case 002:
-               pre(5);
-               putn((long)n, 10, 5);
-               break;
-       case 010:
-               pre(4);
-               putn((long)n, 16, 4);
-               break;
-       case 020:
-               pre(7);
-               {
-                       unsigned short sn = n;
-                       cput(*(char *)&sn);
-                       putchar(' ');
-                       cput(*((char *)&sn + 1));
-                       break;
-               }
-       case 040:
-               pre(7);
-               {
-                       unsigned short sn = n;
-                       putn((long)(*(char *)&sn)&0377, 8, 3);
-                       putchar(' ');
-                       putn((long)(*((char *)&sn + 1))&0377, 8, 3);
-                       break;
-               }
-       }
-}
-
-cput(c)
-{
-       c &= 0377;
-       if(c>037 && c<0177) {
-               printf("  ");
-               putchar(c);
-               return;
-       }
-       switch(c) {
-       case '\0':
-               printf(" \\0");
-               break;
-       case '\b':
-               printf(" \\b");
-               break;
-       case '\f':
-               printf(" \\f");
-               break;
-       case '\n':
-               printf(" \\n");
-               break;
-       case '\r':
-               printf(" \\r");
-               break;
-       case '\t':
-               printf(" \\t");
-               break;
-       default:
-               putn((long)c, 8, 3);
-       }
-}
-
-putn(n, b, c)
-long n;
-{
-       register d;
-
-       if(!c)
-               return;
-       putn(n/b, b, c-1);
-       d = n%b;
-       if (d > 9)
-               putchar(d-10+'a');
-       else
-               putchar(d+'0');
-}
-
-pre(n)
-{
-       int i;
-
-       for(i=n; i<max; i++)
-               putchar(' ');
-}
-
-offset(s)
-register char *s;
-{
-       register char *p;
-       long a;
-       register int d;
-
-       if (*s=='+')
-               s++;
-       if (*s=='x') {
-               s++;
-               base = 16;
-       } else if (*s=='0' && s[1]=='x') {
-               s += 2;
-               base = 16;
-       } else if (*s == '0')
-               base = 8;
-       p = s;
-       while(*p) {
-               if (*p++=='.')
-                       base = 10;
-       }
-       for (a=0; *s; s++) {
-               d = *s;
-               if(d>='0' && d<='9')
-                       a = a*base + d - '0';
-               else if (d>='a' && d<='f' && base==16)
-                       a = a*base + d + 10 - 'a';
-               else
-                       break;
-       }
-       if (*s == '.')
-               s++;
-       if(*s=='b' || *s=='B')
-               a *= 512;
-       fseek(stdin, a, 0);
-       addr = a;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/osh.c b/.ref-Research-V7/usr/src/cmd/osh.c
deleted file mode 100644 (file)
index 12b1c23..0000000
+++ /dev/null
@@ -1,844 +0,0 @@
-/*
- */
-
-#include <setjmp.h>
-#define        INTR    2
-#define        QUIT    3
-#define LINSIZ 1000
-#define ARGSIZ 50
-#define TRESIZ 100
-
-#define QUOTE 0200
-#define FAND 1
-#define FCAT 2
-#define FPIN 4
-#define FPOU 8
-#define FPAR 16
-#define FINT 32
-#define FPRS 64
-#define TCOM 1
-#define TPAR 2
-#define TFIL 3
-#define TLST 4
-#define DTYP 0
-#define DLEF 1
-#define DRIT 2
-#define DFLG 3
-#define DSPR 4
-#define DCOM 5
-#define        ENOMEM  12
-#define        ENOEXEC 8
-
-int errval;
-char   *dolp;
-char   pidp[6];
-char   **dolv;
-jmp_buf        jmpbuf;
-int    dolc;
-char   *promp;
-char   *linep;
-char   *elinep;
-char   **argp;
-char   **eargp;
-int    *treep;
-int    *treeend;
-char   peekc;
-char   gflg;
-char   error;
-char   uid;
-char   setintr;
-char   *arginp;
-int    onelflg;
-int    stoperr;
-
-#define        NSIG    16
-char   *mesg[NSIG] {
-       0,
-       "Hangup",
-       0,
-       "Quit",
-       "Illegal instruction",
-       "Trace/BPT trap",
-       "IOT trap",
-       "EMT trap",
-       "Floating exception",
-       "Killed",
-       "Bus error",
-       "Memory fault",
-       "Bad system call",
-       0,
-       "Alarm clock",
-       "Terminated",
-};
-
-char   line[LINSIZ];
-char   *args[ARGSIZ];
-int    trebuf[TRESIZ];
-
-main(c, av)
-int c;
-char **av;
-{
-       register f;
-       register char *acname, **v;
-
-       for(f=3; f<15; f++)
-               close(f);
-       dolc = getpid();
-       for(f=4; f>=0; f--) {
-               dolc = dolc/10;
-               pidp[f] = dolc%10 + '0';
-       }
-       v = av;
-       acname = "<none>";
-       promp = "% ";
-       if((uid = getuid()) == 0)
-               promp = "# ";
-       if(c>1 && v[1][0]=='-' && v[1][1]=='e') {
-               ++stoperr;
-               v[1] = v[0];
-               ++v;
-               --c;
-       }
-       if(c > 1) {
-               promp = 0;
-               if (*v[1]=='-') {
-                       **v = '-';
-                       if (v[1][1]=='c' && c>2)
-                               arginp = v[2];
-                       else if (v[1][1]=='t')
-                               onelflg = 2;
-               } else {
-                       close(0);
-                       f = open(v[1], 0);
-                       if(f < 0) {
-                               prs(v[1]);
-                               err(": cannot open",255);
-                       }
-               }
-       }
-       if(**v == '-') {
-               signal(QUIT, 1);
-               f = signal(INTR, 1);
-               if ((arginp==0&&onelflg==0) || (f&01)==0)
-                       setintr++;
-       }
-       dolv = v+1;
-       dolc = c-1;
-
-loop:
-       if(promp != 0)
-               prs(promp);
-       peekc = getc();
-       main1();
-       goto loop;
-}
-
-main1()
-{
-       register char  *cp;
-       register *t;
-
-       argp = args;
-       eargp = args+ARGSIZ-5;
-       linep = line;
-       elinep = line+LINSIZ-5;
-       error = 0;
-       gflg = 0;
-       do {
-               cp = linep;
-               word();
-       } while(*cp != '\n');
-       treep = trebuf;
-       treeend = &trebuf[TRESIZ];
-       if(gflg == 0) {
-               if(error == 0) {
-                       setjmp(jmpbuf);
-                       if (error)
-                               return;
-                       t = syntax(args, argp);
-               }
-               if(error != 0)
-                       err("syntax error",255); else
-                       execute(t);
-       }
-}
-
-word()
-{
-       register char c, c1;
-
-       *argp++ = linep;
-
-loop:
-       switch(c = getc()) {
-
-       case ' ':
-       case '\t':
-               goto loop;
-
-       case '\'':
-       case '"':
-               c1 = c;
-               while((c=readc()) != c1) {
-                       if(c == '\n') {
-                               error++;
-                               peekc = c;
-                               return;
-                       }
-                       *linep++ = c|QUOTE;
-               }
-               goto pack;
-
-       case '&':
-       case ';':
-       case '<':
-       case '>':
-       case '(':
-       case ')':
-       case '|':
-       case '^':
-       case '\n':
-               *linep++ = c;
-               *linep++ = '\0';
-               return;
-       }
-
-       peekc = c;
-
-pack:
-       for(;;) {
-               c = getc();
-               if(any(c, " '\"\t;&<>()|^\n")) {
-                       peekc = c;
-                       if(any(c, "\"'"))
-                               goto loop;
-                       *linep++ = '\0';
-                       return;
-               }
-               *linep++ = c;
-       }
-}
-
-tree(n)
-int n;
-{
-       register *t;
-
-       t = treep;
-       treep =+ n;
-       if (treep>treeend) {
-               prs("Command line overflow\n");
-               error++;
-               longjmp(jmpbuf, 1);
-       }
-       return(t);
-}
-
-getc()
-{
-       register char c;
-
-       if(peekc) {
-               c = peekc;
-               peekc = 0;
-               return(c);
-       }
-       if(argp > eargp) {
-               argp =- 10;
-               while((c=getc()) != '\n');
-               argp =+ 10;
-               err("Too many args",255);
-               gflg++;
-               return(c);
-       }
-       if(linep > elinep) {
-               linep =- 10;
-               while((c=getc()) != '\n');
-               linep =+ 10;
-               err("Too many characters",255);
-               gflg++;
-               return(c);
-       }
-getd:
-       if(dolp) {
-               c = *dolp++;
-               if(c != '\0')
-                       return(c);
-               dolp = 0;
-       }
-       c = readc();
-       if(c == '\\') {
-               c = readc();
-               if(c == '\n')
-                       return(' ');
-               return(c|QUOTE);
-       }
-       if(c == '$') {
-               c = readc();
-               if(c>='0' && c<='9') {
-                       if(c-'0' < dolc)
-                               dolp = dolv[c-'0'];
-                       goto getd;
-               }
-               if(c == '$') {
-                       dolp = pidp;
-                       goto getd;
-               }
-       }
-       return(c&0177);
-}
-
-readc()
-{
-       int rdstat;
-       char cc;
-       register c;
-
-       if (arginp) {
-               if (arginp == 1)
-                       exit(errval);
-               if ((c = *arginp++) == 0) {
-                       arginp = 1;
-                       c = '\n';
-               }
-               return(c);
-       }
-       if (onelflg==1)
-               exit(255);
-       if((rdstat = read(0, &cc, 1)) != 1)
-               if(rdstat==0) exit(errval); /* end of file*/
-               else exit(255); /* error */
-       if (cc=='\n' && onelflg)
-               onelflg--;
-       return(cc);
-}
-
-/*
- * syntax
- *     empty
- *     syn1
- */
-
-syntax(p1, p2)
-char **p1, **p2;
-{
-
-       while(p1 != p2) {
-               if(any(**p1, ";&\n"))
-                       p1++; else
-                       return(syn1(p1, p2));
-       }
-       return(0);
-}
-
-/*
- * syn1
- *     syn2
- *     syn2 & syntax
- *     syn2 ; syntax
- */
-
-syn1(p1, p2)
-char **p1, **p2;
-{
-       register char **p;
-       register *t, *t1;
-       int l;
-
-       l = 0;
-       for(p=p1; p!=p2; p++)
-       switch(**p) {
-
-       case '(':
-               l++;
-               continue;
-
-       case ')':
-               l--;
-               if(l < 0)
-                       error++;
-               continue;
-
-       case '&':
-       case ';':
-       case '\n':
-               if(l == 0) {
-                       l = **p;
-                       t = tree(4);
-                       t[DTYP] = TLST;
-                       t[DLEF] = syn2(p1, p);
-                       t[DFLG] = 0;
-                       if(l == '&') {
-                               t1 = t[DLEF];
-                               t1[DFLG] =| FAND|FPRS|FINT;
-                       }
-                       t[DRIT] = syntax(p+1, p2);
-                       return(t);
-               }
-       }
-       if(l == 0)
-               return(syn2(p1, p2));
-       error++;
-       return(0);
-}
-
-/*
- * syn2
- *     syn3
- *     syn3 | syn2
- */
-
-syn2(p1, p2)
-char **p1, **p2;
-{
-       register char **p;
-       register int l, *t;
-
-       l = 0;
-       for(p=p1; p!=p2; p++)
-       switch(**p) {
-
-       case '(':
-               l++;
-               continue;
-
-       case ')':
-               l--;
-               continue;
-
-       case '|':
-       case '^':
-               if(l == 0) {
-                       t = tree(4);
-                       t[DTYP] = TFIL;
-                       t[DLEF] = syn3(p1, p);
-                       t[DRIT] = syn2(p+1, p2);
-                       t[DFLG] = 0;
-                       return(t);
-               }
-       }
-       return(syn3(p1, p2));
-}
-
-/*
- * syn3
- *     ( syn1 ) [ < in  ] [ > out ]
- *     word word* [ < in ] [ > out ]
- */
-
-syn3(p1, p2)
-char **p1, **p2;
-{
-       register char **p;
-       char **lp, **rp;
-       register *t;
-       int n, l, i, o, c, flg;
-
-       flg = 0;
-       if(**p2 == ')')
-               flg =| FPAR;
-       lp = 0;
-       rp = 0;
-       i = 0;
-       o = 0;
-       n = 0;
-       l = 0;
-       for(p=p1; p!=p2; p++)
-       switch(c = **p) {
-
-       case '(':
-               if(l == 0) {
-                       if(lp != 0)
-                               error++;
-                       lp = p+1;
-               }
-               l++;
-               continue;
-
-       case ')':
-               l--;
-               if(l == 0)
-                       rp = p;
-               continue;
-
-       case '>':
-               p++;
-               if(p!=p2 && **p=='>')
-                       flg =| FCAT; else
-                       p--;
-
-       case '<':
-               if(l == 0) {
-                       p++;
-                       if(p == p2) {
-                               error++;
-                               p--;
-                       }
-                       if(any(**p, "<>("))
-                               error++;
-                       if(c == '<') {
-                               if(i != 0)
-                                       error++;
-                               i = *p;
-                               continue;
-                       }
-                       if(o != 0)
-                               error++;
-                       o = *p;
-               }
-               continue;
-
-       default:
-               if(l == 0)
-                       p1[n++] = *p;
-       }
-       if(lp != 0) {
-               if(n != 0)
-                       error++;
-               t = tree(5);
-               t[DTYP] = TPAR;
-               t[DSPR] = syn1(lp, rp);
-               goto out;
-       }
-       if(n == 0)
-               error++;
-       p1[n++] = 0;
-       t = tree(n+5);
-       t[DTYP] = TCOM;
-       for(l=0; l<n; l++)
-               t[l+DCOM] = p1[l];
-out:
-       t[DFLG] = flg;
-       t[DLEF] = i;
-       t[DRIT] = o;
-       return(t);
-}
-
-scan(at, f)
-int *at;
-int (*f)();
-{
-       register char *p, c;
-       register *t;
-
-       t = at+DCOM;
-       while(p = *t++)
-               while(c = *p)
-                       *p++ = (*f)(c);
-}
-
-tglob(c)
-int c;
-{
-
-       if(any(c, "[?*"))
-               gflg = 1;
-       return(c);
-}
-
-trim(c)
-int c;
-{
-
-       return(c&0177);
-}
-
-execute(t, pf1, pf2)
-int *t, *pf1, *pf2;
-{
-       int i, f, pv[2];
-       register *t1;
-       register char *cp1, *cp2;
-       extern errno;
-
-       if(t != 0)
-       switch(t[DTYP]) {
-
-       case TCOM:
-               cp1 = t[DCOM];
-               if(equal(cp1, "chdir")) {
-                       if(t[DCOM+1] != 0) {
-                               if(chdir(t[DCOM+1]) < 0)
-                                       err("chdir: bad directory",255);
-                       } else
-                               err("chdir: arg count",255);
-                       return;
-               }
-               if(equal(cp1, "shift")) {
-                       if(dolc < 1) {
-                               prs("shift: no args\n");
-                               return;
-                       }
-                       dolv[1] = dolv[0];
-                       dolv++;
-                       dolc--;
-                       return;
-               }
-               if(equal(cp1, "login")) {
-                       if(promp != 0) {
-                               execv("/bin/login", t+DCOM);
-                       }
-                       prs("login: cannot execute\n");
-                       return;
-               }
-               if(equal(cp1, "newgrp")) {
-                       if(promp != 0) {
-                               execv("/bin/newgrp", t+DCOM);
-                       }
-                       prs("newgrp: cannot execute\n");
-                       return;
-               }
-               if(equal(cp1, "wait")) {
-                       pwait(-1, 0);
-                       return;
-               }
-               if(equal(cp1, ":"))
-                       return;
-
-       case TPAR:
-               f = t[DFLG];
-               i = 0;
-               if((f&FPAR) == 0)
-                       i = fork();
-               if(i == -1) {
-                       err("try again",255);
-                       return;
-               }
-               if(i != 0) {
-                       if((f&FPIN) != 0) {
-                               close(pf1[0]);
-                               close(pf1[1]);
-                       }
-                       if((f&FPRS) != 0) {
-                               prn(i);
-                               prs("\n");
-                       }
-                       if((f&FAND) != 0)
-                               return;
-                       if((f&FPOU) == 0)
-                               pwait(i, t);
-                       return;
-               }
-               if(t[DLEF] != 0) {
-                       close(0);
-                       i = open(t[DLEF], 0);
-                       if(i < 0) {
-                               prs(t[DLEF]);
-                               err(": cannot open",255);
-                               exit(255);
-                       }
-               }
-               if(t[DRIT] != 0) {
-                       if((f&FCAT) != 0) {
-                               i = open(t[DRIT], 1);
-                               if(i >= 0) {
-                                       lseek(i, 0L, 2);
-                                       goto f1;
-                               }
-                       }
-                       i = creat(t[DRIT], 0666);
-                       if(i < 0) {
-                               prs(t[DRIT]);
-                               err(": cannot create",255);
-                               exit(255);
-                       }
-               f1:
-                       close(1);
-                       dup(i);
-                       close(i);
-               }
-               if((f&FPIN) != 0) {
-                       close(0);
-                       dup(pf1[0]);
-                       close(pf1[0]);
-                       close(pf1[1]);
-               }
-               if((f&FPOU) != 0) {
-                       close(1);
-                       dup(pf2[1]);
-                       close(pf2[0]);
-                       close(pf2[1]);
-               }
-               if((f&FINT)!=0 && t[DLEF]==0 && (f&FPIN)==0) {
-                       close(0);
-                       open("/dev/null", 0);
-               }
-               if((f&FINT) == 0 && setintr) {
-                       signal(INTR, 0);
-                       signal(QUIT, 0);
-               }
-               if(t[DTYP] == TPAR) {
-                       if(t1 = t[DSPR])
-                               t1[DFLG] =| f&FINT;
-                       execute(t1);
-                       exit(255);
-               }
-               gflg = 0;
-               scan(t, tglob);
-               if(gflg) {
-                       t[DSPR] = "/etc/glob";
-                       execv(t[DSPR], t+DSPR);
-                       prs("glob: cannot execute\n");
-                       exit(255);
-               }
-               scan(t, trim);
-               *linep = 0;
-               texec(t[DCOM], t);
-               cp1 = linep;
-               cp2 = "/usr/bin/";
-               while(*cp1 = *cp2++)
-                       cp1++;
-               cp2 = t[DCOM];
-               while(*cp1++ = *cp2++);
-               texec(linep+4, t);
-               texec(linep, t);
-               prs(t[DCOM]);
-               err(": not found",255);
-               exit(255);
-
-       case TFIL:
-               f = t[DFLG];
-               pipe(pv);
-               t1 = t[DLEF];
-               t1[DFLG] =| FPOU | (f&(FPIN|FINT|FPRS));
-               execute(t1, pf1, pv);
-               t1 = t[DRIT];
-               t1[DFLG] =| FPIN | (f&(FPOU|FINT|FAND|FPRS));
-               execute(t1, pv, pf2);
-               return;
-
-       case TLST:
-               f = t[DFLG]&FINT;
-               if(t1 = t[DLEF])
-                       t1[DFLG] =| f;
-               execute(t1);
-               if(t1 = t[DRIT])
-                       t1[DFLG] =| f;
-               execute(t1);
-               return;
-
-       }
-}
-
-texec(f, at)
-int *at;
-{
-       extern errno;
-       register int *t;
-
-       t = at;
-       execv(f, t+DCOM);
-       if (errno==ENOEXEC) {
-               if (*linep)
-                       t[DCOM] = linep;
-               t[DSPR] = "/usr/bin/osh";
-               execv(t[DSPR], t+DSPR);
-               prs("No shell!\n");
-               exit(255);
-       }
-       if (errno==ENOMEM) {
-               prs(t[DCOM]);
-               err(": too large",255);
-               exit(255);
-       }
-}
-
-err(s, exitno)
-char *s;
-int exitno;
-{
-
-       prs(s);
-       prs("\n");
-       if(promp == 0) {
-               lseek(0, 0L, 2);
-               exit(exitno);
-       }
-}
-
-prs(as)
-char *as;
-{
-       register char *s;
-
-       s = as;
-       while(*s)
-               putc(*s++);
-}
-
-putc(c)
-{
-       char cc;
-
-       cc = c;
-       write(2, &cc, 1);
-}
-
-prn(n)
-int n;
-{
-       register a;
-
-       if (a = n/10)
-               prn(a);
-       putc(n%10 + '0');
-}
-
-any(c, as)
-int c;
-char *as;
-{
-       register char *s;
-
-       s = as;
-       while(*s)
-               if(*s++ == c)
-                       return(1);
-       return(0);
-}
-
-equal(as1, as2)
-char *as1, *as2;
-{
-       register char *s1, *s2;
-
-       s1 = as1;
-       s2 = as2;
-       while(*s1++ == *s2)
-               if(*s2++ == '\0')
-                       return(1);
-       return(0);
-}
-
-pwait(i, t)
-int i, *t;
-{
-       register p, e;
-       int s;
-
-       if(i != 0)
-       for(;;) {
-               p = wait(&s);
-               if(p == -1)
-                       break;
-               e = s&0177;
-               if (e>=NSIG || mesg[e]) {
-                       if(p != i) {
-                               prn(p);
-                               prs(": ");
-                       }
-                       if (e < NSIG)
-                               prs(mesg[e]);
-                       else {
-                               prs("Signal ");
-                               prn(e);
-                       }
-                       if(s&0200)
-                               prs(" -- Core dumped");
-               }
-               if (e || s&&stoperr)
-                       err("", (s>>8)|e );
-               errval =| (s>>8);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/passwd.c b/.ref-Research-V7/usr/src/cmd/passwd.c
deleted file mode 100644 (file)
index 2ecf762..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * enter a password in the password file
- * this program should be suid with owner
- * with an owner with write permission on /etc/passwd
- */
-#include <stdio.h>
-#include <signal.h>
-#include <pwd.h>
-
-char   passwd[] = "/etc/passwd";
-char   temp[]   = "/etc/ptmp";
-struct passwd *pwd;
-struct passwd *getpwent();
-int    endpwent();
-char   *strcpy();
-char   *crypt();
-char   *getpass();
-char   *getlogin();
-char   *pw;
-char   pwbuf[10];
-char   buf[512];
-
-main(argc, argv)
-char *argv[];
-{
-       char *p;
-       int i;
-       char saltc[2];
-       long salt;
-       int u,fi,fo;
-       int insist;
-       int ok, flags;
-       int c;
-       int pwlen;
-       FILE *tf;
-       char *uname;
-
-       insist = 0;
-       if(argc < 2) {
-               if ((uname = getlogin()) == NULL) {
-                       printf ("Usage: passwd user\n");
-                       goto bex;
-               } else {
-                       printf("Changing password for %s\n", uname);
-               }
-       } else {
-               uname = argv[1];
-       }
-       while(((pwd=getpwent()) != NULL)&&(strcmp(pwd->pw_name,uname)!=0));
-       u = getuid();
-       if((pwd==NULL) || (u!=0 && u != pwd->pw_uid))
-               {
-               printf("Permission denied.\n");
-               goto bex;
-               }
-       endpwent();
-       if (pwd->pw_passwd[0] && u != 0) {
-               strcpy(pwbuf, getpass("Old password:"));
-               pw = crypt(pwbuf, pwd->pw_passwd);
-               if(strcmp(pw, pwd->pw_passwd) != 0) {
-                       printf("Sorry.\n");
-                       goto bex;
-               }
-       }
-tryagn:
-       strcpy(pwbuf, getpass("New password:"));
-       pwlen = strlen(pwbuf);
-       if (pwlen == 0) {
-               printf("Password unchanged.\n");
-               goto bex;
-       }
-       ok = 0;
-       flags = 0;
-       p = pwbuf;
-       while(c = *p++){
-               if(c>='a' && c<='z') flags |= 2;
-               else if(c>='A' && c<='Z') flags |= 4;
-               else if(c>='0' && c<='9') flags |= 1;
-               else flags |= 8;
-       }
-       if(flags >=7 && pwlen>= 4) ok = 1;
-       if(((flags==2)||(flags==4)) && pwlen>=6) ok = 1;
-       if(((flags==3)||(flags==5)||(flags==6))&&pwlen>=5) ok = 1;
-
-       if((ok==0) && (insist<2)){
-               if(flags==1)
-               printf("Please use at least one non-numeric character.\n");
-               else
-               printf("Please use a longer password.\n");
-               insist++;
-               goto tryagn;
-               }
-
-       if (strcmp(pwbuf,getpass("Retype new password:")) != 0) {
-               printf ("Mismatch - password unchanged.\n");
-               goto bex;
-       }
-
-       time(&salt);
-       salt += getpid();
-
-       saltc[0] = salt & 077;
-       saltc[1] = (salt>>6) & 077;
-       for(i=0;i<2;i++){
-               c = saltc[i] + '.';
-               if(c>'9') c += 7;
-               if(c>'Z') c += 6;
-               saltc[i] = c;
-       }
-       pw = crypt(pwbuf, saltc);
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-
-       if(access(temp, 0) >= 0) {
-               printf("Temporary file busy -- try again\n");
-               goto bex;
-       }
-       close(creat(temp,0600));
-       if((tf=fopen(temp,"w")) == NULL) {
-               printf("Cannot create temporary file\n");
-               goto bex;
-       }
-
-/*
- *     copy passwd to temp, replacing matching lines
- *     with new password.
- */
-
-       while((pwd=getpwent()) != NULL) {
-               if(strcmp(pwd->pw_name,uname) == 0) {
-                       u = getuid();
-                       if(u != 0 && u != pwd->pw_uid) {
-                               printf("Permission denied.\n");
-                               goto out;
-                       }
-                       pwd->pw_passwd = pw;
-               }
-               fprintf(tf,"%s:%s:%d:%d:%s:%s:%s\n",
-                       pwd->pw_name,
-                       pwd->pw_passwd,
-                       pwd->pw_uid,
-                       pwd->pw_gid,
-                       pwd->pw_gecos,
-                       pwd->pw_dir,
-                       pwd->pw_shell);
-       }
-       endpwent();
-       fclose(tf);
-
-/*
- *     copy temp back to passwd file
- */
-
-       if((fi=open(temp,0)) < 0) {
-               printf("Temp file disappeared!\n");
-               goto out;
-       }
-       if((fo=creat(passwd, 0644)) < 0) {
-               printf("Cannot recreat passwd file.\n");
-               goto out;
-       }
-       while((u=read(fi,buf,sizeof(buf))) > 0) write(fo,buf,u);
-
-out:
-       unlink(temp);
-
-bex:
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/INDEX b/.ref-Research-V7/usr/src/cmd/pcc/INDEX
deleted file mode 100644 (file)
index 270cc0a..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains the machine-dependent files for the
-pcc compiler, which is a PDP-11 C compiler based on the portable
-C compiler.  The machine-independent files are obtained
-from directory /usr/src/cmd/mip.
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/code.c b/.ref-Research-V7/usr/src/cmd/pcc/code.c
deleted file mode 100644 (file)
index e629a37..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-# include <stdio.h>
-# include <signal.h>
-
-# include "mfile1"
-
-int proflag;
-int strftn = 0;        /* is the current function one which returns a value */
-FILE *tmpfile;
-FILE *outfile = stdout;
-
-branch( n ){
-       /* output a branch to label n */
-       /* exception is an ordinary function branching to retlab: then, return */
-       if( n == retlab && !strftn ){
-               printf( "       jmp     cret\n" );
-               }
-       else printf( "  jbr     L%d\n", n );
-       }
-
-int lastloc = PROG;
-
-defalign(n) {
-       /* cause the alignment to become a multiple of n */
-       n /= SZCHAR;
-       if( lastloc != PROG && n > 1 ) printf( "        .even\n" );
-       }
-
-locctr( l ){
-       register temp;
-       /* l is PROG, ADATA, DATA, STRNG, ISTRNG, or STAB */
-
-       if( l == lastloc ) return(l);
-       temp = lastloc;
-       lastloc = l;
-       switch( l ){
-
-       case PROG:
-               outfile = stdout;
-               printf( "       .text\n" );
-               break;
-
-       case DATA:
-       case ADATA:
-               outfile = stdout;
-               if( temp != DATA && temp != ADATA )
-                       printf( "       .data\n" );
-               break;
-
-       case STRNG:
-       case ISTRNG:
-               outfile = tmpfile;
-               break;
-
-       case STAB:
-               cerror( "locctr: STAB unused" );
-               break;
-
-       default:
-               cerror( "illegal location counter" );
-               }
-
-       return( temp );
-       }
-
-deflab( n ){
-       /* output something to define the current position as label n */
-       fprintf( outfile, "L%d:\n", n );
-       }
-
-int crslab = 10;
-
-getlab(){
-       /* return a number usable for a label */
-       return( ++crslab );
-       }
-
-efcode(){
-       /* code for the end of a function */
-
-       if( strftn ){  /* copy output (in r0) to caller */
-               register struct symtab *p;
-               register int stlab;
-               register int count;
-               int size;
-
-               p = &stab[curftn];
-
-               deflab( retlab );
-
-               stlab = getlab();
-               printf( "       mov     $L%d,r1\n", stlab );
-               size = tsize( DECREF(p->stype), p->dimoff, p->sizoff ) / SZCHAR;
-               count = size/2;
-               while( count-- ) {
-                       printf( "       mov     (r0)+,(r1)+\n" );
-                       }
-               printf( "       mov     $L%d,r0\n", stlab );
-               printf( "       .bss\nL%d:      .=.+%d.\n       .text\n", stlab, size );
-               /* turn off strftn flag, so return sequence will be generated */
-               strftn = 0;
-               }
-       branch( retlab );
-       p2bend();
-       }
-
-bfcode( a, n ) int a[]; {
-       /* code for the beginning of a function; a is an array of
-               indices in stab for the arguments; n is the number */
-       register i;
-       register temp;
-       register struct symtab *p;
-       int off;
-
-       locctr( PROG );
-       p = &stab[curftn];
-       defnam( p );
-       temp = p->stype;
-       temp = DECREF(temp);
-       strftn = (temp==STRTY) || (temp==UNIONTY);
-
-       retlab = getlab();
-       if( proflag ){
-               int plab;
-               plab = getlab();
-               printf( "       mov     $L%d,r0\n", plab );
-               printf( "       jsr     pc,mcount\n" );
-               printf( "       .bss\nL%d:      .=.+2\n .text\n", plab );
-               }
-
-       /* routine prolog */
-
-       printf( "       jsr     r5,csv\n" );
-       /* adjust stack for autos */
-       printf( "       sub     $.F%d,sp\n", ftnno );
-
-       off = ARGINIT;
-
-       for( i=0; i<n; ++i ){
-               p = &stab[a[i]];
-               if( p->sclass == REGISTER ){
-                       temp = p->offset;  /* save register number */
-                       p->sclass = PARAM;  /* forget that it is a register */
-                       p->offset = NOOFFSET;
-                       oalloc( p, &off );
-                       printf( "       mov     %d.(r5),r%d\n", p->offset/SZCHAR, temp );
-                       p->offset = temp;  /* remember register number */
-                       p->sclass = REGISTER;   /* remember that it is a register */
-                       }
-               else {
-                       if( oalloc( p, &off ) ) cerror( "bad argument" );
-                       }
-
-               }
-       }
-
-bccode(){ /* called just before the first executable statment */
-               /* by now, the automatics and register variables are allocated */
-       SETOFF( autooff, SZINT );
-       /* set aside store area offset */
-       p2bbeg( autooff, regvar );
-       }
-
-ejobcode( flag ){
-       /* called just before final exit */
-       /* flag is 1 if errors, 0 if none */
-       }
-
-aobeg(){
-       /* called before removing automatics from stab */
-       }
-
-aocode(p) struct symtab *p; {
-       /* called when automatic p removed from stab */
-       }
-
-aoend(){
-       /* called after removing all automatics from stab */
-       }
-
-defnam( p ) register struct symtab *p; {
-       /* define the current location as the name p->sname */
-
-       if( p->sclass == EXTDEF ){
-               printf( "       .globl  %s\n", exname( p->sname ) );
-               }
-       if( p->sclass == STATIC && p->slevel>1 ) deflab( p->offset );
-       else printf( "%s:\n", exname( p->sname ) );
-
-       }
-
-bycode( t, i ){
-       /* put byte i+1 in a string */
-
-       i &= 07;
-       if( t < 0 ){ /* end of the string */
-               if( i != 0 ) fprintf( outfile, "\n" );
-               }
-
-       else { /* stash byte t into string */
-               if( i == 0 ) fprintf( outfile, "        .byte   " );
-               else fprintf( outfile, "," );
-               fprintf( outfile, "%o", t );
-               if( i == 07 ) fprintf( outfile, "\n" );
-               }
-       }
-
-zecode( n ){
-       /* n integer words of zeros */
-       OFFSZ temp;
-       register i;
-
-       if( n <= 0 ) return;
-       printf( "       " );
-       for( i=1; i<n; i++ ) {
-               if( i%8 == 0 )
-                       printf( "\n     " );
-               printf( "0; " );
-               }
-       printf( "0\n" );
-       temp = n;
-       inoff += temp*SZINT;
-       }
-
-fldal( t ) unsigned t; { /* return the alignment of field of type t */
-       uerror( "illegal field type" );
-       return( ALINT );
-       }
-
-fldty( p ) struct symtab *p; { /* fix up type of field p */
-       ;
-       }
-
-where(c){ /* print location of error  */
-       /* c is either 'u', 'c', or 'w' */
-       fprintf( stderr, "%s, line %d: ", ftitle, lineno );
-       }
-
-char *tmpname = "/tmp/pcXXXXXX";
-
-main( argc, argv ) char *argv[]; {
-       int dexit();
-       register int c;
-       register int i;
-       int r;
-
-       for( i=1; i<argc; ++i )
-               if( argv[i][0] == '-' && argv[i][1] == 'X' && argv[i][2] == 'p' ) {
-                       proflag = 1;
-                       }
-
-       mktemp(tmpname);
-       if(signal( SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, dexit);
-       if(signal( SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, dexit);
-       if(signal( SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM, dexit);
-       tmpfile = fopen( tmpname, "w" );
-
-       r = mainp1( argc, argv );
-
-       tmpfile = freopen( tmpname, "r", tmpfile );
-       if( tmpfile != NULL )
-               while((c=getc(tmpfile)) != EOF )
-                       putchar(c);
-       else cerror( "Lost temp file" );
-       unlink(tmpname);
-       return( r );
-       }
-
-dexit( v ) {
-       unlink(tmpname);
-       exit(1);
-       }
-
-genswitch(p,n) register struct sw *p;{
-       /*      p points to an array of structures, each consisting
-               of a constant value and a label.
-               The first is >=0 if there is a default label;
-               its value is the label number
-               The entries p[1] to p[n] are the nontrivial cases
-               */
-       register i;
-       register CONSZ j, range;
-       register dlab, swlab;
-
-       range = p[n].sval-p[1].sval;
-
-       if( range>0 && range <= 3*n && n>=4 ){ /* implement a direct switch */
-
-               dlab = p->slab >= 0 ? p->slab : getlab();
-
-               if( p[1].sval ){
-                       printf( "       sub     $" );
-                       printf( CONFMT, p[1].sval );
-                       printf( ".,r0\n" );
-                       }
-
-               /* note that this is a cl; it thus checks
-                  for numbers below range as well as out of range.
-                  */
-               printf( "       cmp     r0,$%ld.\n", range );
-               printf( "       jhi     L%d\n", dlab );
-
-               printf( "       asl     r0\n" );
-               printf( "       jmp     *L%d(r0)\n", swlab = getlab() );
-
-               /* output table */
-
-               locctr( ADATA );
-               defalign( ALPOINT );
-               deflab( swlab );
-
-               for( i=1,j=p[1].sval; i<=n; ++j ){
-
-                       printf( "       L%d\n", ( j == p[i].sval ) ?
-                               p[i++].slab : dlab );
-                       }
-
-               locctr( PROG );
-
-               if( p->slab< 0 ) deflab( dlab );
-               return;
-
-               }
-
-       /* debugging code */
-
-       /* out for the moment
-       if( n >= 4 ) werror( "inefficient switch: %d, %d", n, (int) (range/n) );
-       */
-
-       /* simple switch code */
-
-       for( i=1; i<=n; ++i ){
-               /* already in r0 */
-
-               printf( "       cmp     r0,$" );
-               printf( CONFMT, p[i].sval );
-               printf( ".\n    jeq     L%d\n", p[i].slab );
-               }
-
-       if( p->slab>=0 ) branch( p->slab );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/local.c b/.ref-Research-V7/usr/src/cmd/pcc/local.c
deleted file mode 100644 (file)
index c9fe72f..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-# include "mfile1"
-
-
-/*     this file contains code which is dependent on the target machine */
-
-NODE *
-cast( p, t ) register NODE *p; TWORD t; {
-       /* cast node p to type t */
-
-       p = buildtree( CAST, block( NAME, NIL, NIL, t, 0, (int)t ), p );
-       p->left->op = FREE;
-       p->op = FREE;
-       return( p->right );
-       }
-
-NODE *
-clocal(p) NODE *p; {
-
-       /* this is called to do local transformations on
-          an expression tree preparitory to its being
-          written out in intermediate code.
-       */
-
-       /* the major essential job is rewriting the
-          automatic variables and arguments in terms of
-          REG and OREG nodes */
-       /* conversion ops which are not necessary are also clobbered here */
-       /* in addition, any special features (such as rewriting
-          exclusive or) are easily handled here as well */
-
-       register struct symtab *q;
-       register NODE *r;
-       register o;
-       register m, ml;
-
-       switch( o = p->op ){
-
-       case NAME:
-               if( p->rval < 0 ) { /* already processed; ignore... */
-                       return(p);
-                       }
-               q = &stab[p->rval];
-               switch( q->sclass ){
-
-               case AUTO:
-               case PARAM:
-                       /* fake up a structure reference */
-                       r = block( REG, NIL, NIL, PTR+STRTY, 0, 0 );
-                       r->lval = 0;
-                       r->rval = (q->sclass==AUTO?STKREG:ARGREG);
-                       p = stref( block( STREF, r, p, 0, 0, 0 ) );
-                       break;
-
-               case ULABEL:
-               case LABEL:
-               case STATIC:
-                       if( q->slevel == 0 ) break;
-                       p->lval = 0;
-                       p->rval = -q->offset;
-                       break;
-
-               case REGISTER:
-                       p->op = REG;
-                       p->lval = 0;
-                       p->rval = q->offset;
-                       break;
-
-                       }
-               break;
-       case LT:
-       case LE:
-       case GT:
-       case GE:
-               if( ISPTR( p->left->type ) || ISPTR( p->right->type ) ){
-                       p->op += (ULT-LT);
-                       }
-               break;
-
-       case PCONV:
-               /* do pointer conversions for char and longs */
-               ml = p->left->type;
-               if( ( ml==CHAR || ml==UCHAR || ml==LONG || ml==ULONG ) && p->left->op != ICON ) break;
-
-               /* pointers all have the same representation; the type is inherited */
-               p->left->type = p->type;
-               p->left->cdim = p->cdim;
-               p->left->csiz = p->csiz;
-               p->op = FREE;
-               return( p->left );
-
-       case SCONV:
-               m = (p->type == FLOAT || p->type == DOUBLE );
-               ml = (p->left->type == FLOAT || p->left->type == DOUBLE );
-               if( m != ml ) break;
-
-               /* now, look for conversions downwards */
-
-               m = p->type;
-               ml = p->left->type;
-               if( p->left->op == ICON ){ /* simulate the conversion here */
-                       CONSZ val;
-                       val = p->left->lval;
-                       switch( m ){
-                       case CHAR:
-                               p->left->lval = (char) val;
-                               break;
-                       case UCHAR:
-                               p->left->lval = val & 0XFF;
-                               break;
-                       case UNSIGNED:
-                               p->left->lval = val & 0XFFFFL;
-                               break;
-                       case INT:
-                               p->left->lval = (int)val;
-                               break;
-                               }
-                       p->left->type = m;
-                       }
-               else {
-                       /* meaningful ones are conversion of int to char, int to short,
-                          and short to char, and unsigned version of them */
-                       if( m==CHAR || m==UCHAR ){
-                               if( ml==LONG || ml==ULONG ) break;
-                               }
-                       else if( m==INT || m==UNSIGNED ){
-                               if( ml==LONG || ml==ULONG ) break;
-                               }
-                       else if( m==LONG || m==ULONG ){
-                               if( ml!=LONG && ml!= ULONG ) break;
-                               }
-                       }
-
-               /* clobber conversion */
-               p->op = FREE;
-               return( p->left );  /* conversion gets clobbered */
-
-       case ASSIGN:
-               /* get rid of SCONV for assignments
-                  from LONG -> CHAR|INT        */
-               if( p->right->op == SCONV ) {
-                       m = p->right->type;
-                       ml = p->right->left->type;
-                       if( ( m==LONG || m==ULONG ) &&
-                           ml!=FLOAT && ml!=DOUBLE ) {
-                               p->right->op = FREE;
-                               p->right = p->right->left;
-                               }
-                       }
-               break;
-
-       case PVCONV:
-       case PMCONV:
-               if( p->right->op != ICON ) cerror( "bad conversion", 0);
-               p->op = FREE;
-               return( buildtree( o==PMCONV?MUL:DIV, p->left, p->right ) );
-
-       case PLUS:
-       case MINUS:
-       case LS:
-       case MUL:
-               /* optimize address calculations with long indexes */
-               if( ISPTR( p->type ) || ISARY( p->type ) ) {
-                       if( p->left->type==LONG || p->left->type==ULONG )
-                               p->left = cast( p->left, INT );
-                       if( p->right->type==LONG || p->right->type==ULONG )
-                               p->right = cast( p->right, INT );
-                       }
-               break;
-
-               }
-
-       return(p);
-       }
-
-andable( p ) NODE *p; {
-       return(1);  /* all names can have & taken on them */
-       }
-
-cendarg(){ /* at the end of the arguments of a ftn, set the automatic offset */
-       autooff = AUTOINIT;
-       }
-
-cisreg( t ) TWORD t; { /* is an automatic variable of type t OK for a register variable */
-
-       if( t==INT || t==UNSIGNED || ISPTR(t) ) return(1);
-       return(0);
-       }
-
-NODE *
-offcon( off, t, d, s ) OFFSZ off; TWORD t; {
-
-       /* return a node, for structure references, which is suitable for
-          being added to a pointer of type t, in order to be off bits offset
-          into a structure */
-
-       register NODE *p;
-
-       /* t, d, and s are the type, dimension offset, and sizeoffset */
-       /* in general they  are necessary for offcon, but not on H'well */
-
-       p = bcon(0);
-       p->lval = off/SZCHAR;
-       return(p);
-
-       }
-
-static inwd    /* current bit offsed in word */;
-static word    /* word being built from fields */;
-
-incode( p, sz ) register NODE *p; {
-
-       /* generate initialization code for assigning a constant c
-               to a field of width sz */
-       /* we assume that the proper alignment has been obtained */
-       /* inoff is updated to have the proper final value */
-       /* we also assume sz  < SZINT */
-
-       if((sz+inwd) > SZINT) cerror("incode: field > int");
-       word |= p->lval<<inwd;
-       inwd += sz;
-       inoff += sz;
-       if(inoff%SZINT == 0) {
-               printf( "       %o\n", word);
-               word = inwd = 0;
-               }
-       }
-
-fincode( d, sz ) double d; {
-       /* output code to initialize space of size sz to the value d */
-       /* the proper alignment has been obtained */
-       /* inoff is updated to have the proper final value */
-       /* on the target machine, write it out in octal! */
-
-       register int *mi = (int *)&d;
-
-       if( sz==SZDOUBLE )
-               printf( "       %o; %o; %o; %o\n", mi[0], mi[1], mi[2], mi[3] );
-       else
-               printf( "       %o; %o\n", mi[0], mi[1] );
-       inoff += sz;
-       }
-
-cinit( p, sz ) NODE *p; {
-       /* arrange for the initialization of p into a space of
-       size sz */
-       /* the proper alignment has been opbtained */
-       /* inoff is updated to have the proper final value */
-       ecode( p );
-       inoff += sz;
-       }
-
-vfdzero( n ){ /* define n bits of zeros in a vfd */
-
-       if( n <= 0 ) return;
-
-       inwd += n;
-       inoff += n;
-       if( inoff%ALINT ==0 ) {
-               printf( "       %o\n", word );
-               word = inwd = 0;
-               }
-       }
-
-
-char *
-exname( p ) char *p; {
-       /* make a name look like an external name in the local machine */
-
-       static char text[NCHNAM+1];
-
-       register i;
-
-       text[0] = '_';
-       for( i=1; *p&&i<NCHNAM; ++i ){
-               text[i] = *p++;
-               }
-
-       text[i] = '\0';
-       text[NCHNAM] = '\0';  /* truncate */
-
-       return( text );
-       }
-
-ctype( type ) TWORD type; { /* map types which are not defined on the local machine */
-       switch( BTYPE(type) ){
-       case SHORT:
-               MODTYPE(type,INT);
-               break;
-       case USHORT:
-               MODTYPE(type,UNSIGNED);
-               }
-       return( type );
-       }
-
-noinit() { /* curid is a variable which is defined but
-       is not initialized (and not a function );
-       This routine returns the stroage class for an uninitialized declaration */
-
-       return(EXTERN);
-
-       }
-
-commdec( id ){ /* make a common declaration for id, if reasonable */
-       register struct symtab *q;
-       OFFSZ off;
-
-       q = &stab[id];
-       printf( "       .comm   %s,", exname( q->sname ) );
-       off = tsize( q->stype, q->dimoff, q->sizoff );
-       printf( CONFMT, off/SZCHAR );
-       printf( ".\n" );
-       }
-
-isitlong( cb, ce ){ /* is lastcon to be long or short */
-       /* cb is the first character of the representation, ce the last */
-
-       if( ce == 'l' || ce == 'L' ||
-               lastcon >= (1L << (SZINT-1) ) ) return (1);
-       return(0);
-       }
-
-
-isitfloat( s ) char *s; {
-       double atof();
-       dcon = atof(s);
-       return( FCON );
-       }
-
-ecode( p ) NODE *p; {
-
-       /* walk the tree and write out the nodes.. */
-
-       if( nerrors ) return;
-       p2tree( p );
-       p2compile( p );
-       }
-
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/local2.c b/.ref-Research-V7/usr/src/cmd/pcc/local2.c
deleted file mode 100644 (file)
index bd5de34..0000000
+++ /dev/null
@@ -1,918 +0,0 @@
-# include "mfile2"
-/* a lot of the machine dependent parts of the second pass */
-
-# define BITMASK(n) ((1L<<n)-1)
-
-lineid( l, fn ) char *fn; {
-       /* identify line l and file fn */
-       printf( "/      line %d, file %s\n", l, fn );
-       }
-
-eobl2(){
-       OFFSZ spoff;    /* offset from stack pointer */
-
-       spoff = maxoff;
-       if( spoff >= AUTOINIT ) spoff -= AUTOINIT;
-       spoff /= SZCHAR;
-       SETOFF(spoff,2);
-       printf( "       .F%d = %Ld.\n", ftnno, spoff );
-       if( fltused ) {
-               fltused = 0;
-               printf( "       .globl  fltused\n" );
-               }
-       }
-
-struct hoptab { int opmask; char * opstring; } ioptab[]= {
-
-       ASG PLUS, "add",
-       ASG MINUS, "sub",
-       ASG OR, "bis",
-       ASG AND,        "bic",
-       ASG ER, "xor",
-       ASG MUL, "mul",
-       ASG DIV, "div",
-       ASG MOD, "div",
-       ASG LS, "asl",
-       ASG RS, "asr",
-
-       -1, ""    };
-
-hopcode( f, o ){
-       /* output the appropriate string from the above table */
-
-       register struct hoptab *q;
-
-       for( q = ioptab;  q->opmask>=0; ++q ){
-               if( q->opmask == o ){
-                       printf( "%s", q->opstring );
-                       if( f == 'F' ) printf( "f" );
-                       return;
-                       }
-               }
-       cerror( "no hoptab for %s", opst[o] );
-       }
-
-char *
-rnames[]= {  /* keyed to register number tokens */
-
-       "r0", "r1",
-       "r2", "r3", "r4",
-       "r5", "sp", "pc",
-
-       "fr0", "fr1", "fr2", "fr3",
-       "fr4", "fr5",   /* not accumulators - used for temps */
-       };
-
-int rstatus[] = {
-       SAREG|STAREG, SAREG|STAREG,
-       SAREG|STAREG, SAREG|STAREG, SAREG|STAREG,       /* use as scratch if not reg var */
-       SAREG, SAREG, SAREG,
-
-       SBREG|STBREG, SBREG|STBREG, SBREG|STBREG, SBREG|STBREG,
-       SBREG, SBREG,
-       };
-
-NODE *brnode;
-int brcase;
-
-int toff = 0; /* number of stack locations used for args */
-
-zzzcode( p, c ) NODE *p; {
-       register m;
-       switch( c ){
-
-       case 'B':       /* output b if type is byte */
-               if( p->type == CHAR || p->type == UCHAR ) printf( "b" );
-               return;
-
-       case 'N':  /* logical ops, turned into 0-1 */
-               /* use register given by register 1 */
-               cbgen( 0, m=getlab(), 'I' );
-               deflab( p->label );
-               printf( "       clr     %s\n", rnames[getlr( p, '1' )->rval] );
-               if( p->type == LONG || p->type == ULONG )
-                       printf( "       clr     %s\n", rnames[getlr( p, '1' )->rval + 1] );
-               deflab( m );
-               return;
-
-       case 'I':
-       case 'F':
-               cbgen( p->op, p->label, c );
-               return;
-
-       case 'A':
-       case 'C':
-               /* logical operators for longs
-                  defer comparisons until branch occurs */
-
-               brnode = tcopy( p );
-               brcase = c;
-               return;
-
-       case 'H':  /* fix up unsigned shifts */
-               {       register NODE *q;
-                       register r, l;
-                       TWORD t;
-
-                       if( p->op == ASG LS ) return;
-                       if( p->op != ASG RS ) cerror( "ZH bad" );
-                       if( p->left->op != REG ) cerror( "SH left bad" );
-
-                       r = p->left->rval;
-                       t = p->left->type;
-                       l = (t==LONG || t == ULONG );
-
-                       if( t != UNSIGNED && t != UCHAR && t != ULONG ) return;  /* signed is ok */
-
-                       /* there are three cases:  right side is a constant,
-                               and has the shift value; right side is
-                               a temporary reg, and has the - shift value,
-                               and right side is something else: A1 has the
-                               - shift value then */
-
-                       /* in the case where the value is known (rhs a constant),
-                               the mask is just computed and put out... */
-
-                       if( p->right->op == ICON ){
-                               int s;
-                               s = p->right->lval;
-                               if( l ){
-                                       if( s >= 16 ){
-                                               printf( "       clr     r%d\n", r );
-                                               s -= 16;
-                                               ++r;
-                                               }
-                                       }
-                               if( s >= 16 ) printf( " clr     r%d\n", r );
-                               else {
-                                       m = 0100000;
-                                       m >>= s;  /* sign extends... */
-                                       m <<= 1;
-                                       printf( "       bic     $%o,r%d\n", m, r );
-                                       }
-                               return;
-                               }
-
-                       /* general case */
-
-                       if( istnode( p->right ) ) q = p->right;
-                       else q = getlr( p, '1' );  /* where -shift is stored */
-
-                       /* first, we store the shifted value on the stack */
-                       printf( "       mov     r%d,-(sp)\n", r );
-                       if( l ) printf( "       mov     r%d,-(sp)\n", r+1 );
-
-                       /* now, make a mask */
-
-                       printf( "       mov     $100000,r%d\n", r );
-                       if( l ) printf( "       clr     r%d\n", r+1 );
-                       
-                       /* shift (arithmetically ) */
-                       if( l ) expand( q, RNOP, "      ashc    AR" );
-                       else expand( q, RNOP, " ash     AR" );
-                       printf( ",r%d\n", r );
-
-                       if( l ) printf( "       ashc    $1,r%d\n", r );
-                       else printf( "  asl     r%d\n", r );
-
-                       /* now, we have a mask: use it to clear sp, and reload */
-
-                       if( l ){
-                               printf( "\tbic\tr%d,(sp)\n\tmov\t(sp)+,r%d\n", r+1, r+1 );
-                               }
-                       printf( "\tbic\tr%d,(sp)\n\tmov\t(sp)+,r%d\n", r, r );
-                       /* whew! */
-                       return;
-                       }
-
-       case 'V':
-               /* sign extend or not -- register is one less than the
-                  left descendent */
-
-               m = p->left->rval - 1;
-
-               if( ISUNSIGNED(p->type) ){
-                       printf( "       clr     r%d\n", m );
-                       }
-               else {
-                       printf( "       sxt     r%d\n", m );
-                       }
-               return;
-
-               /* stack management macros */
-       case '-':
-               if( toff ++ ) printf( "-" );
-               printf( "(sp)" );
-               return;
-
-       case '4':
-               if( toff == 0 ) ++toff;  /* can't push doubles that way */
-               printf( "-(sp)" );
-               toff += 4;
-               return;
-
-       case '~':
-               /* complimented CR */
-               p->right->lval = ~p->right->lval;
-               conput( getlr( p, 'R' ) );
-               p->right->lval = ~p->right->lval;
-               return;
-
-       case 'M':
-               /* negated CR */
-               p->right->lval = -p->right->lval;
-               conput( getlr( p, 'R' ) );
-               p->right->lval = -p->right->lval;
-               return;
-
-       case 'L':  /* INIT for long constants */
-               {
-                       unsigned hi, lo;
-                       lo = p->left->lval & BITMASK(SZINT);
-                       hi = ( p->left->lval >> SZINT ) & BITMASK(SZINT);
-                       printf( "       %o; %o\n", hi, lo );
-                       return;
-               }
-
-       case 'T':
-               /* Truncate longs for type conversions:
-                   LONG|ULONG -> CHAR|UCHAR|INT|UNSIGNED
-                  increment offset to second word */
-
-               m = p->type;
-               p = p->left;
-               switch( p->op ){
-               case NAME:
-               case OREG:
-                       p->lval += SZINT/SZCHAR;
-                       return;
-               case REG:
-                       rfree( p->rval, p->type );
-                       p->rval += 1;
-                       p->type = m;
-                       rbusy( p->rval, p->type );
-                       return;
-               default:
-                       cerror( "Illegal ZT type conversion" );
-                       return;
-
-                       }
-
-       case 'U':
-               /* same as AL for exp under U* */
-               if( p->left->op == UNARY MUL ) {
-                       adrput( getlr( p->left, 'L' ) );
-                       return;
-                       }
-               cerror( "Illegal ZU" );
-               /* NO RETURN */
-
-       case 'W':       /* structure size */
-               if( p->op == STASG )
-                       printf( "%d", p->stsize);
-               else    cerror( "Not a structure" );
-               return;
-
-       case 'S':  /* structure assignment */
-               {
-                       register NODE *l, *r;
-                       register size, count;
-
-                       if( p->op == STASG ){
-                               l = p->left;
-                               r = p->right;
-                               }
-                       else if( p->op == STARG ){  /* store an arg onto the stack */
-                               r = p->left;
-                               }
-                       else cerror( "STASG bad" );
-
-                       if( r->op == ICON ) r->op = NAME;
-                       else if( r->op == REG ) r->op = OREG;
-                       else if( r->op != OREG ) cerror( "STASG-r" );
-
-                       size = p->stsize;
-                       count = size / 2;
-
-                       r->lval += size;
-                       if( p->op == STASG ) l->lval += size;
-
-                       while( count-- ){ /* simple load/store loop */
-                               r->lval -= 2;
-                               expand( r, FOREFF, "    mov     AR," );
-                               if( p->op == STASG ){
-                                       l->lval -= 2;
-                                       expand( l, FOREFF, "AR\n" );
-                                       }
-                               else {
-                                       printf( "-(sp)\n" );
-                                       }
-
-                               }
-
-                       if( r->op == NAME ) r->op = ICON;
-                       else if( r->op == OREG ) r->op = REG;
-
-                       }
-               break;
-
-       default:
-               cerror( "illegal zzzcode" );
-               }
-       }
-
-rmove( rt, rs, t ) TWORD t; {
-       printf( "       %s      %s,%s\n", (t==FLOAT||t==DOUBLE)?"movf":"mov", rnames[rs], rnames[rt] );
-       }
-
-struct respref
-respref[] = {
-       INTAREG|INTBREG,        INTAREG|INTBREG,
-       INAREG|INBREG,  INAREG|INBREG|SOREG|STARREG|SNAME|STARNM|SCON,
-       INTEMP, INTEMP,
-       FORARG, FORARG,
-       INTAREG,        SOREG|SNAME,
-       0,      0 };
-
-setregs(){ /* set up temporary registers */
-       register i;
-
-       /* use any unused variable registers as scratch registers */
-       fregs = maxtreg>=MINRVAR ? maxtreg + 1 : MINRVAR;
-       if( xdebug ){
-               /* -x changes number of free regs to 2, -xx to 3, etc. */
-               if( (xdebug+1) < fregs ) fregs = xdebug+1;
-               }
-       /* NOTE: for pdp11 fregs <= 4 for float regs */
-       if( fregs > 4 ) fregs = 4;
-       for( i=MINRVAR; i<=MAXRVAR; i++ )
-               rstatus[i] = i<fregs ? SAREG|STAREG : SAREG;
-       }
-
-szty(t) TWORD t; { /* size, in words, needed to hold thing of type t */
-       /* really is the number of registers to hold type t */
-       switch( t ) {
-
-       case LONG:
-       case ULONG:
-               return( SZLONG/SZINT );
-
-       default:
-               return(1);
-
-               }
-       }
-
-rewfld( p ) NODE *p; {
-       return(1);
-       }
-
-callreg(p) NODE *p; {
-       return( (p->type==DOUBLE||p->type==FLOAT) ? FR0 : R0 );
-       }
-
-shltype( o, p ) NODE *p; {
-       if( o == NAME|| o==REG || o == ICON || o == OREG ) return( 1 );
-       return( o==UNARY MUL && shumul(p->left) );
-       }
-
-flshape( p ) register NODE *p; {
-       register o = p->op;
-       if( o==NAME || o==REG || o==ICON || o==OREG ) return( 1 );
-       return( o==UNARY MUL && shumul(p->left)==STARNM );
-       }
-
-shtemp( p ) register NODE *p; {
-       if( p->op == UNARY MUL ) p = p->left;
-       if( p->op == REG || p->op == OREG ) return( !istreg( p->rval ) );
-       return( p->op == NAME || p->op == ICON );
-       }
-
-spsz( t, v ) TWORD t; CONSZ v; {
-
-       /* is v the size to increment something of type t */
-
-       if( !ISPTR(t) ) return( 0 );
-       t = DECREF(t);
-
-       if( ISPTR(t) ) return( v == 2 );
-
-       switch( t ){
-
-       case UCHAR:
-       case CHAR:
-               return( v == 1 );
-
-       case INT:
-       case UNSIGNED:
-               return( v == 2 );
-
-       case FLOAT:
-               return( v == 4 );
-
-       case DOUBLE:
-               return( v == 8 );
-               }
-
-       return( 0 );
-       }
-
-shumul( p ) register NODE *p; {
-       register o;
-
-       o = p->op;
-       if( o == NAME || o == OREG || o == ICON ) return( STARNM );
-
-       if( ( o == INCR || o == ASG MINUS ) &&
-           ( p->left->op == REG && p->right->op == ICON ) &&
-           p->right->name[0] == '\0' &&
-           spsz( p->left->type, p->right->lval ) )
-               return( STARREG );
-
-       return( 0 );
-       }
-
-adrcon( val ) CONSZ val; {
-       printf( CONFMT, val );
-       }
-
-conput( p ) register NODE *p; {
-       switch( p->op ){
-
-       case ICON:
-               acon( p );
-               return;
-
-       case REG:
-               printf( "%s", rnames[p->rval] );
-               return;
-
-       default:
-               cerror( "illegal conput" );
-               }
-       }
-
-insput( p ) NODE *p; {
-       cerror( "insput" );
-       }
-
-upput( p ) NODE *p; {
-       /* output the address of the second word in the
-          pair pointed to by p (for LONGs)*/
-       CONSZ save;
-
-       if( p->op == FLD ){
-               p = p->left;
-               }
-
-       save = p->lval;
-       switch( p->op ){
-
-       case NAME:
-               p->lval += SZINT/SZCHAR;
-               acon( p );
-               break;
-
-       case ICON:
-               /* addressable value of the constant */
-               p->lval &= BITMASK(SZINT);
-               printf( "$" );
-               acon( p );
-               break;
-
-       case REG:
-               printf( "%s", rnames[p->rval+1] );
-               break;
-
-       case OREG:
-               p->lval += SZINT/SZCHAR;
-               if( p->rval == R5 ){  /* in the argument region */
-                       if( p->name[0] != '\0' ) werror( "bad arg temp" );
-                       }
-               if( p->lval != 0 || p->name[0] != '\0' ) acon( p );
-               printf( "(%s)", rnames[p->rval] );
-               break;
-
-       default:
-               cerror( "illegal upper address" );
-               break;
-
-               }
-       p->lval = save;
-
-       }
-
-adrput( p ) register NODE *p; {
-       /* output an address, with offsets, from p */
-
-       if( p->op == FLD ){
-               p = p->left;
-               }
-       switch( p->op ){
-
-       case NAME:
-               acon( p );
-               return;
-
-       case ICON:
-               /* addressable value of the constant */
-               if( szty( p->type ) == 2 ) {
-                       /* print the high order value */
-                       CONSZ save;
-                       save = p->lval;
-                       p->lval = ( p->lval >> SZINT ) & BITMASK(SZINT);
-                       printf( "$" );
-                       acon( p );
-                       p->lval = save;
-                       return;
-                       }
-               printf( "$" );
-               acon( p );
-               return;
-
-       case REG:
-               printf( "%s", rnames[p->rval] );
-               return;
-
-       case OREG:
-               if( p->rval == R5 ){  /* in the argument region */
-                       if( p->name[0] != '\0' ) werror( "bad arg temp" );
-                       printf( CONFMT, p->lval );
-                       printf( ".(r5)" );
-                       return;
-                       }
-               if( p->lval != 0 || p->name[0] != '\0' ) acon( p );
-               printf( "(%s)", rnames[p->rval] );
-               return;
-
-       case UNARY MUL:
-               /* STARNM or STARREG found */
-               if( tshape(p, STARNM) ) {
-                       printf( "*" );
-                       adrput( p->left);
-                       }
-               else {  /* STARREG - really auto inc or dec */
-                       /* turn into OREG so replacement node will
-                          reflect the value of the expression */
-                       register i;
-                       register NODE *q, *l;
-
-                       l = p->left;
-                       q = l->left;
-                       p->op = OREG;
-                       p->rall = q->rall;
-                       p->lval = q->lval;
-                       p->rval = q->rval;
-                       for( i=0; i<NCHNAM; i++ )
-                               p->name[i] = q->name[i];
-                       if( l->op == INCR ) {
-                               adrput( p );
-                               printf( "+" );
-                               p->lval -= l->right->lval;
-                               }
-                       else {  /* l->op == ASG MINUS */
-                               printf( "-" );
-                               adrput( p );
-                               }
-                       tfree( l );
-               }
-               return;
-
-       default:
-               cerror( "illegal address" );
-               return;
-
-               }
-
-       }
-
-acon( p ) register NODE *p; { /* print out a constant */
-
-       if( p->name[0] == '\0' ){       /* constant only */
-               printf( CONFMT, p->lval);
-               printf( "." );
-               }
-       else if( p->lval == 0 ) {       /* name only */
-               printf( "%.8s", p->name );
-               }
-       else {                          /* name + offset */
-               printf( "%.8s+", p->name );
-               printf( CONFMT, p->lval );
-               printf( "." );
-               }
-       }
-
-genscall( p, cookie ) register NODE *p; {
-       /* structure valued call */
-       return( gencall( p, cookie ) );
-       }
-
-gencall( p, cookie ) register NODE *p; {
-       /* generate the call given by p */
-       register temp;
-       register m;
-
-       if( p->right ) temp = argsize( p->right );
-       else temp = 0;
-
-       if( p->right ){ /* generate args */
-               genargs( p->right );
-               }
-
-       if( !shltype( p->left->op, p->left ) ) {
-               order( p->left, INAREG|SOREG );
-               }
-
-       p->op = UNARY CALL;
-       m = match( p, INTAREG|INTBREG );
-       popargs( temp );
-       return(m != MDONE);
-       }
-
-popargs( size ) register size; {
-       /* pop arguments from stack */
-
-       toff -= size/2;
-       if( toff == 0 && size >= 2 ) size -= 2;
-       switch( size ) {
-       case 0:
-               break;
-       case 2:
-               printf( "       tst     (sp)+\n" );
-               break;
-       case 4:
-               printf( "       cmp     (sp)+,(sp)+\n" );
-               break;
-       default:
-               printf( "       add     $%d.,sp\n", size);
-               }
-       }
-
-char *
-ccbranches[] = {
-       "       jeq     L%d\n",
-       "       jne     L%d\n",
-       "       jle     L%d\n",
-       "       jlt     L%d\n",
-       "       jge     L%d\n",
-       "       jgt     L%d\n",
-       "       jlos    L%d\n",
-       "       jlo     L%d\n",
-       "       jhis    L%d\n",
-       "       jhi     L%d\n",
-       };
-
-/*     long branch table
-
-   This table, when indexed by a logical operator,
-   selects a set of three logical conditions required
-   to generate long comparisons and branches.  A zero
-   entry indicates that no branch is required.
-   E.G.:  The <= operator would generate:
-       cmp     AL,AR
-       jlt     lable   / 1st entry LT -> lable
-       jgt     1f      / 2nd entry GT -> 1f
-       cmp     UL,UR
-       jlos    lable   / 3rd entry ULE -> lable
-   1:
- */
-
-int lbranches[][3] = {
-       /*EQ*/  0,      NE,     EQ,
-       /*NE*/  NE,     0,      NE,
-       /*LE*/  LT,     GT,     ULE,
-       /*LT*/  LT,     GT,     ULT,
-       /*GE*/  GT,     LT,     UGE,
-       /*GT*/  GT,     LT,     UGT,
-       /*ULE*/ ULT,    UGT,    ULE,
-       /*ULT*/ ULT,    UGT,    ULT,
-       /*UGE*/ UGT,    ULT,    UGE,
-       /*UGT*/ UGT,    ULT,    UGT,
-       };
-
-/* logical relations when compared in reverse order (cmp R,L) */
-extern short revrel[] ;
-
-cbgen( o, lab, mode ) { /*   printf conditional and unconditional branches */
-       register *plb;
-       int lab1f;
-
-       if( o == 0 ) printf( "  jbr     L%d\n", lab );
-       else    if( o > UGT ) cerror( "bad conditional branch: %s", opst[o] );
-       else {
-               switch( brcase ) {
-
-               case 'A':
-               case 'C':
-                       plb = lbranches[ o-EQ ];
-                       lab1f = getlab();
-                       expand( brnode, FORCC, brcase=='C' ? "\tcmp\tAL,AR\n" : "\ttst\tAR\n" );
-                       if( *plb != 0 )
-                               printf( ccbranches[*plb-EQ], lab);
-                       if( *++plb != 0 )
-                               printf( ccbranches[*plb-EQ], lab1f);
-                       expand( brnode, FORCC, brcase=='C' ? "\tcmp\tUL,UR\n" : "\ttst\tUR\n" );
-                       printf( ccbranches[*++plb-EQ], lab);
-                       deflab( lab1f );
-                       reclaim( brnode, RNULL, 0 );
-                       break;
-
-               default:
-                       if( mode=='F' ) o = revrel[ o-EQ ];
-                       printf( ccbranches[o-EQ], lab );
-                       break;
-                       }
-
-               brcase = 0;
-               brnode = 0;
-               }
-       }
-
-nextcook( p, cookie ) NODE *p; {
-       /* we have failed to match p with cookie; try another */
-       if( cookie == FORREW ) return( 0 );  /* hopeless! */
-       if( !(cookie&(INTAREG|INTBREG)) ) return( INTAREG|INTBREG );
-       if( !(cookie&INTEMP) && asgop(p->op) ) return( INTEMP|INAREG|INTAREG|INTBREG|INBREG );
-       return( FORREW );
-       }
-
-lastchance( p, cook ) NODE *p; {
-       /* forget it! */
-       return(0);
-       }
-
-struct functbl {
-       int fop;
-       TWORD ftype;
-       char *func;
-       } opfunc[] = {
-       MUL,            LONG,   "lmul",
-       DIV,            LONG,   "ldiv",
-       MOD,            LONG,   "lrem",
-       ASG MUL,        LONG,   "almul",
-       ASG DIV,        LONG,   "aldiv",
-       ASG MOD,        LONG,   "alrem",
-       MUL,            ULONG,  "lmul",
-       DIV,            ULONG,  "uldiv",
-       MOD,            ULONG,  "ulrem",
-       ASG MUL,        ULONG,  "almul",
-       ASG DIV,        ULONG,  "auldiv",
-       ASG MOD,        ULONG,  "aulrem",
-       0,      0,      0 };
-
-hardops(p)  register NODE *p; {
-       /* change hard to do operators into function calls.
-          for pdp11 do long * / %      */
-       register NODE *q;
-       register struct functbl *f;
-       register o;
-       register TWORD t;
-
-       o = p->op;
-       t = p->type;
-       if( t!=LONG && t!=ULONG ) return;
-
-       for( f=opfunc; f->fop; f++ ) {
-               if( o==f->fop && t==f->ftype ) goto convert;
-               }
-       return;
-
-       /* need address of left node for ASG OP */
-       /* WARNING - this won't work for long in a REG */
-       convert:
-       if( asgop( o ) ) {
-               switch( p->left->op ) {
-
-               case UNARY MUL: /* convert to address */
-                       p->left->op = FREE;
-                       p->left = p->left->left;
-                       break;
-
-               case NAME:      /* convert to ICON pointer */
-                       p->left->op = ICON;
-                       p->left->type = INCREF( p->left->type );
-                       break;
-
-               case OREG:      /* convert OREG to address */
-                       p->left->op = REG;
-                       p->left->type = INCREF( p->left->type );
-                       if( p->left->lval != 0 ) {
-                               q = talloc();
-                               q->op = PLUS;
-                               q->rall = NOPREF;
-                               q->type = p->left->type;
-                               q->left = p->left;
-                               q->right = talloc();
-
-                               q->right->op = ICON;
-                               q->right->rall = NOPREF;
-                               q->right->type = INT;
-                               q->right->name[0] = '\0';
-                               q->right->lval = p->left->lval;
-                               q->right->rval = 0;
-
-                               p->left->lval = 0;
-                               p->left = q;
-                               }
-                       break;
-
-               default:
-                       cerror( "Bad address for hard ops" );
-                       /* NO RETURN */
-
-                       }
-               }
-
-       /* build comma op for args to function */
-       q = talloc();
-       q->op = CM;
-       q->rall = NOPREF;
-       q->type = INT;
-       q->left = p->left;
-       q->right = p->right;
-       p->op = CALL;
-       p->right = q;
-
-       /* put function name in left node of call */
-       p->left = q = talloc();
-       q->op = ICON;
-       q->rall = NOPREF;
-       q->type = INCREF( FTN + p->type );
-       strcpy( q->name, f->func );
-       q->lval = 0;
-       q->rval = 0;
-
-       return;
-
-       }
-
-optim2( p ) register NODE *p; {
-       /* do local tree transformations and optimizations */
-
-       register NODE *r;
-
-       switch( p->op ) {
-
-       case AND:
-               /* commute L and R to eliminate compliments and constants */
-               if( p->left->op==ICON || p->left->op==COMPL ) {
-                       r = p->left;
-                       p->left = p->right;
-                       p->right = r;
-                       }
-       case ASG AND:
-               /* change meaning of AND to ~R&L - bic on pdp11 */
-               r = p->right;
-               if( r->op==ICON ) { /* compliment constant */
-                       r->lval = ~r->lval;
-                       }
-               else if( r->op==COMPL ) { /* ~~A => A */
-                       r->op = FREE;
-                       p->right = r->left;
-                       }
-               else { /* insert complement node */
-                       p->right = talloc();
-                       p->right->op = COMPL;
-                       p->right->rall = NOPREF;
-                       p->right->type = r->type;
-                       p->right->left = r;
-                       p->right->right = NULL;
-                       }
-               break;
-
-               }
-       }
-
-myreader(p) register NODE *p; {
-       walkf( p, hardops );    /* convert ops to function calls */
-       canon( p );             /* expands r-vals for fileds */
-       walkf( p, optim2 );
-       toff = 0;  /* stack offset swindle */
-       }
-
-special( p, shape ) register NODE *p; {
-       /* special shape matching routine */
-
-       switch( shape ) {
-
-       case SCCON:
-               if( p->op == ICON && p->name[0]=='\0' && p->lval>= -128 && p->lval <=127 ) return( 1 );
-               break;
-
-       case SICON:
-               if( p->op == ICON && p->name[0]=='\0' && p->lval>= 0 && p->lval <=32767 ) return( 1 );
-               break;
-
-       default:
-               cerror( "bad special shape" );
-
-               }
-
-       return( 0 );
-       }
-
-# ifndef ONEPASS
-main( argc, argv ) char *argv[]; {
-       return( mainp2( argc, argv ) );
-       }
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/mac2defs b/.ref-Research-V7/usr/src/cmd/pcc/mac2defs
deleted file mode 100644 (file)
index 59476ee..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*     PDP11 Registers */
-
-       /* scratch registers */
-# define R0 0
-# define R1 1
-
-       /* register variables */
-# define R2 2
-# define R3 3
-# define R4 4
-
-       /* special purpose */
-# define R5 5  /* frame pointer */
-# define SP 6  /* stack pointer */
-# define PC 7  /* program counter */
-
-       /* floating registers */
-
-# define FR0 8
-# define FR1 9
-# define FR2 10
-# define FR3 11
-# define FR4 12
-# define FR5 13
-
-# define SAVEREGION 8 /* number of bytes for save area */
-
-# define BYTEOFF(x) ((x)&01)
-# define wdal(k) (BYTEOFF(k)==0)
-# define BITOOR(x) ((x)>>3)  /* bit offset to oreg offset */
-
-# define REGSZ 14
-
-# define TMPREG R5
-
-
-# define STOARG(p)     /* just evaluate the arguments, and be done with it... */
-# define STOFARG(p)
-# define STOSTARG(p)
-# define genfcall(a,b) gencall(a,b)
-
-
-       /* shape for constants between -128 and 127 */
-# define SCCON (SPECIAL+100)
-       /* shape for constants between 0 and 32767 */
-# define SICON (SPECIAL+101)
-
-# define MYREADER(p) myreader(p)
-extern int fltused;
-       /* calls can be nested on the PDP-11 */
-# define NESTCALLS
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/macdefs b/.ref-Research-V7/usr/src/cmd/pcc/macdefs
deleted file mode 100644 (file)
index 07289e9..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# define makecc(val,i)  lastcon = i ? (val<<8)|lastcon : val  
-
-# define  ARGINIT 32 
-# define  AUTOINIT 48 
-# define  SZCHAR 8
-# define  SZINT 16
-# define  SZFLOAT 32
-# define  SZDOUBLE 64
-# define  SZLONG 32
-# define  SZSHORT 16
-# define SZPOINT 16
-# define ALCHAR 8
-# define ALINT 16
-# define ALFLOAT 16
-# define ALDOUBLE 16
-# define ALLONG 16
-# define ALSHORT 16
-# define ALPOINT 16
-# define ALSTRUCT 16
-# define  ALSTACK 16 
-
-/*     size in which constants are converted */
-/*     should be long if feasable */
-
-# define CONSZ long
-# define CONFMT "%Ld"
-
-/*     size in which offsets are kept
-/*     should be large enough to cover address space in bits
-*/
-
-# define OFFSZ long
-
-/*     character set macro */
-
-# define  CCTRANS(x) x
-
-/* register cookie for stack poINTer */
-
-# define  STKREG 5
-# define ARGREG 5
-
-/*     maximum and minimum register variables */
-
-# define MAXRVAR 4
-# define MINRVAR 2
-
-       /* various standard pieces of code are used */
-# define STDPRTREE
-# define LABFMT "L%d"
-
-/* definition indicates automatics and/or temporaries
-   are on a negative growing stack */
-
-# define BACKAUTO
-# define BACKTEMP
-
-# define RTOLBYTES
-# ifndef FORT
-# define ONEPASS
-# endif
-
-# ifndef FORT
-# define EXIT dexit
-# endif
-
-# define ENUMSIZE(high,low) INT
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/makefile b/.ref-Research-V7/usr/src/cmd/pcc/makefile
deleted file mode 100644 (file)
index c10af76..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-INSTALL=/usr/lib/ccom
-M=/usr/src/cmd/mip
-CFLAGS=-O
-head:  ccom ;
-
-all:   ccom
-
-cp:    ccom
-       cp ccom /usr/lib/ccom
-       rm *.o cgram.c ccom
-
-cmp:   ccom
-       cmp ccom /usr/lib/ccom
-       rm *.o cgram.c ccom
-
-ccom: cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o reader.o local2.o order.o match.o allo.o comm1.o table.o
-       cc $(CFLAGS) -s -o ccom -i cgram.o xdefs.o scan.o pftn.o trees.o optim.o code.o local.o reader.o local2.o order.o match.o allo.o comm1.o table.o
-trees.o: $M/manifest macdefs $M/mfile1 $M/trees.c
-       cc -c $(CFLAGS) -I$M -I. $M/trees.c
-optim.o: $M/manifest macdefs $M/mfile1 $M/optim.c
-       cc -c $(CFLAGS) -I$M -I. $M/optim.c
-pftn.o: $M/manifest macdefs $M/mfile1 $M/pftn.c
-       cc -c $(CFLAGS) -I$M -I. $M/pftn.c
-code.o: $M/manifest macdefs $M/mfile1
-       cc -c $(CFLAGS) -I$M -I. code.c
-local.o: $M/manifest macdefs $M/mfile1
-       cc -c $(CFLAGS) -I$M -I. local.c
-scan.o: $M/manifest macdefs $M/mfile1 $M/scan.c
-       cc -c $(CFLAGS) -I$M -I. $M/scan.c
-xdefs.o: $M/manifest $M/mfile1 macdefs $M/xdefs.c
-       cc -c $(CFLAGS) -I$M -I. $M/xdefs.c
-cgram.o: $M/manifest $M/mfile1 macdefs cgram.c
-       cc -c $(CFLAGS) -I$M -I. cgram.c
-cgram.c: $M/cgram.y
-       yacc $M/cgram.y
-       mv y.tab.c cgram.c
-comm1.o: $M/manifest $M/mfile1 $M/common macdefs $M/comm1.c
-       cc -c $(CFLAGS) -I. -I$M $M/comm1.c
-table.o: $M/manifest $M/mfile2 mac2defs macdefs table.c
-       cc -c $(CFLAGS) -I$M -I. table.c
-reader.o: $M/manifest $M/mfile2 mac2defs macdefs $M/reader.c
-       cc -c $(CFLAGS) -I$M -I. $M/reader.c
-local2.o: $M/manifest $M/mfile2 mac2defs macdefs
-       cc -c $(CFLAGS) -I$M -I. local2.c
-order.o: $M/manifest $M/mfile2 mac2defs macdefs
-       cc -c $(CFLAGS) -I$M -I. order.c
-match.o: $M/manifest $M/mfile2 mac2defs macdefs $M/match.c
-       cc -c $(CFLAGS) -I$M -I. $M/match.c
-allo.o: $M/manifest $M/mfile2 mac2defs macdefs $M/allo.c
-       cc -c $(CFLAGS) -I$M -I. $M/allo.c
-shrink:
-       rm *.o ccom
-lintall:
-       lint -hpv -I. -I$M  cgram.c xdefs.c $M/scan.c $M/pftn.c $M/trees.c $M/optim.c code.c local.c $M/reader.c local2.c order.c $M/match.c $M/allo.c $M/comm1.c table.c
-fort: ccom fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o
-       cc -i $(CFLAGS) fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o
-       mv a.out fort
-fort.o: fort.h $M/fort.c
-       cc -c $(CFLAGS) -I$M -I. $M/fort.c
-freader.o: reader.o
-       cc -c $(CFLAGS) -I$M -I. $M/freader.c
-fallo.o: allo.o
-       cc -c $(CFLAGS) -I$M -I. $M/fallo.c
-fmatch.o: match.o
-       cc -c $(CFLAGS) -I$M -I. $M/fmatch.c
-ftable.o: table.o
-       cc -c $(CFLAGS) -I$M -I. $M/ftable.c
-forder.o: order.o
-       cc -c $(CFLAGS) -I$M -I. $M/forder.c
-flocal2.o: local2.o
-       cc -c $(CFLAGS) -I$M -I. $M/flocal2.c
-fcomm2.o: $M/common
-       cc -c $(CFLAGS) -I$M -I. $M/fcomm2.c
-fort.o freader.o fallo.o fmatch.o ftable.o forder.o flocal2.o fcomm2.o: $M/mfile2 $M/manifest macdefs mac2defs
-install:
-       cp ccom $(INSTALL)
-       cp macdefs mac2defs local.c code.c local2.c order.c table.c /usr/src/cmd/pcc
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/order.c b/.ref-Research-V7/usr/src/cmd/pcc/order.c
deleted file mode 100644 (file)
index e21f334..0000000
+++ /dev/null
@@ -1,725 +0,0 @@
-# include "mfile2"
-
-int fltused = 0;
-
-stoasg( p, o ) register NODE *p; {
-       /* should the assignment op p be stored,
-          given that it lies as the right operand of o
-          (or the left, if o==UNARY MUL) */
-       return( shltype(p->left->op, p->left ) );
-
-       }
-
-deltest( p ) register NODE *p; {
-       /* should we delay the INCR or DECR operation p */
-       if( p->op == INCR && p->left->op == REG && spsz( p->left->type, p->right->lval ) ){
-               /* STARREG */
-               return( 0 );
-               }
-
-       p = p->left;
-       if( p->op == UNARY MUL ) p = p->left;
-       return( p->op == NAME || p->op == OREG || p->op == REG );
-       }
-
-mkadrs(p) register NODE *p; {
-       register o;
-
-       o = p->op;
-
-       if( asgop(o) ){
-               if( p->left->su >= p->right->su ){
-                       if( p->left->op == UNARY MUL ){
-                               if( p->left->su > 0 )
-                                       SETSTO( p->left->left, INTEMP );
-                               else {
-                                       if( p->right->su > 0 ) SETSTO( p->right, INTEMP );
-                                       else cerror( "store finds both sides trivial" );
-                                       }
-                               }
-                       else if( p->left->op == FLD && p->left->left->op == UNARY MUL ){
-                               SETSTO( p->left->left->left, INTEMP );
-                               }
-                       else { /* should be only structure assignment */
-                               SETSTO( p->left, INTEMP );
-                               }
-                       }
-               else SETSTO( p->right, INTEMP );
-               }
-       else {
-               if( p->left->su > p->right->su ){
-                       SETSTO( p->left, INTEMP );
-                       }
-               else {
-                       SETSTO( p->right, INTEMP );
-                       }
-               }
-       }
-
-notoff( t, r, off, cp) TWORD t; CONSZ off; char *cp; {
-       /* is it legal to make an OREG or NAME entry which has an
-       /* offset of off, (from a register of r), if the
-       /* resulting thing had type t */
-
-       /* return( 1 );  /* NO */
-       return(0);  /* YES */
-       }
-
-# define max(x,y) ((x)<(y)?(y):(x))
-# define min(x,y) ((x)<(y)?(x):(y))
-
-
-# define ZCHAR 01
-# define ZLONG 02
-# define ZFLOAT 04
-
-zum( p, zap ) register NODE *p; {
-       /* zap Sethi-Ullman number for chars, longs, floats */
-       /* in the case of longs, only STARNM's are zapped */
-       /* ZCHAR, ZLONG, ZFLOAT are used to select the zapping */
-
-       register su;
-
-       su = p->su;
-
-       switch( p->type ){
-
-       case CHAR:
-       case UCHAR:
-               if( !(zap&ZCHAR) ) break;
-               if( su == 0 ) p->su = su = 1;
-               break;
-
-       case LONG:
-       case ULONG:
-               if( !(zap&ZLONG) ) break;
-               if( p->op == UNARY MUL && su == 0 ) p->su = su = 2;
-               break;
-
-       case FLOAT:
-               if( !(zap&ZFLOAT) ) break;
-               if( su == 0 ) p->su = su = 1;
-
-               }
-
-       return( su );
-       }
-
-sucomp( p ) register NODE *p; {
-
-       /* set the su field in the node to the sethi-ullman
-          number, or local equivalent */
-
-       register o, ty, sul, sur;
-       register nr;
-
-       ty = optype( o=p->op);
-       nr = szty( p->type );
-       p->su = 0;
-
-       if( ty == LTYPE ) {
-               if( p->type==FLOAT ) p->su = 1;
-               return;
-               }
-       else if( ty == UTYPE ){
-               switch( o ) {
-               case UNARY CALL:
-               case UNARY STCALL:
-                       p->su = fregs;  /* all regs needed */
-                       return;
-
-               case UNARY MUL:
-                       if( shumul( p->left ) ) return;
-
-               default:
-                       p->su = max( p->left->su, nr);
-                       return;
-                       }
-               }
-
-
-       /* If rhs needs n, lhs needs m, regular su computation */
-
-       sul = p->left->su;
-       sur = p->right->su;
-
-       if( o == ASSIGN ){
-               asop:  /* also used for +=, etc., to memory */
-               if( sul==0 ){
-                       /* don't need to worry about the left side */
-                       p->su = max( sur, nr );
-                       }
-               else {
-                       /* right, left address, op */
-                       if( sur == 0 ){
-                               /* just get the lhs address into a register, and mov */
-                               /* the `nr' covers the case where value is in reg afterwards */
-                               p->su = max( sul, nr );
-                               }
-                       else {
-                               /* right, left address, op */
-                               p->su = max( sur, nr+sul );
-                               }
-                       }
-               return;
-               }
-
-       if( o == CALL || o == STCALL ){
-               /* in effect, takes all free registers */
-               p->su = fregs;
-               return;
-               }
-
-       if( o == STASG ){
-               /* right, then left */
-               p->su = max( max( sul+nr, sur), fregs );
-               return;
-               }
-
-       if( logop(o) ){
-               /* do the harder side, then the easier side, into registers */
-               /* left then right, max(sul,sur+nr) */
-               /* right then left, max(sur,sul+nr) */
-               /* to hold both sides in regs: nr+nr */
-               nr = szty( p->left->type );
-               sul = zum( p->left, ZLONG|ZCHAR|ZFLOAT );
-               sur = zum( p->right, ZLONG|ZCHAR|ZFLOAT );
-               p->su = min( max(sul,sur+nr), max(sur,sul+nr) );
-               return;
-               }
-
-       if( asgop(o) ){
-               /* computed by doing right, doing left address, doing left, op, and store */
-               switch( o ) {
-               case INCR:
-               case DECR:
-                       /* do as binary op */
-                       break;
-
-               case ASG DIV:
-               case ASG MOD:
-               case ASG MUL:
-                       if( p->type!=FLOAT && p->type!=DOUBLE ) nr = fregs;
-                       goto gencase;
-
-               case ASG PLUS:
-               case ASG MINUS:
-               case ASG AND:  /* really bic */
-               case ASG OR:
-                       if( p->type == INT || p->type == UNSIGNED || ISPTR(p->type) ) goto asop;
-
-               gencase:
-               default:
-                       sur = zum( p->right, ZCHAR|ZLONG|ZFLOAT );
-                       if( sur == 0 ){ /* easy case: if addressable,
-                               do left value, op, store */
-                               if( sul == 0 ) p->su = nr;
-                               /* harder: left adr, val, op, store */
-                               else p->su = max( sul, nr+1 );
-                               }
-                       else { /* do right, left adr, left value, op, store */
-                               if( sul == 0 ){  /* right, left value, op, store */
-                                       p->su = max( sur, nr+nr );
-                                       }
-                               else {
-                                       p->su = max( sur, max( sul+nr, 1+nr+nr ) );
-                                       }
-                               }
-                       return;
-                       }
-               }
-
-       switch( o ){
-       case ANDAND:
-       case OROR:
-       case QUEST:
-       case COLON:
-       case COMOP:
-               p->su = max( max(sul,sur), nr);
-               return;
-               }
-
-       if( ( o==DIV || o==MOD || o==MUL )
-           && p->type!=FLOAT && p->type!=DOUBLE ) nr = fregs;
-       if( o==PLUS || o==MUL || o==OR || o==ER ){
-               /* AND is ruined by the hardware */
-               /* permute: get the harder on the left */
-
-               register rt, lt;
-
-               if( istnode( p->left ) || sul > sur ) goto noswap;  /* don't do it! */
-
-               /* look for a funny type on the left, one on the right */
-
-
-               lt = p->left->type;
-               rt = p->right->type;
-
-               if( rt == FLOAT && lt == DOUBLE ) goto swap;
-
-               if( (rt==CHAR||rt==UCHAR) && (lt==INT||lt==UNSIGNED||ISPTR(lt)) ) goto swap;
-
-               if( lt==LONG || lt==ULONG ){
-                       if( rt==LONG || rt==ULONG ){
-                               /* if one is a STARNM, swap */
-                               if( p->left->op == UNARY MUL && sul==0 ) goto noswap;
-                               if( p->right->op == UNARY MUL && p->left->op != UNARY MUL ) goto swap;
-                               goto noswap;
-                               }
-                       else if( p->left->op == UNARY MUL && sul == 0 ) goto noswap;
-                       else goto swap;  /* put long on right, unless STARNM */
-                       }
-
-               /* we are finished with the type stuff now; if one is addressable,
-                       put it on the right */
-               if( sul == 0 && sur != 0 ){
-
-                       NODE *s;
-                       int ssu;
-
-               swap:
-                       ssu = sul;  sul = sur; sur = ssu;
-                       s = p->left;  p->left = p->right; p->right = s;
-                       }
-               }
-       noswap:
-
-       sur = zum( p->right, ZCHAR|ZLONG|ZFLOAT );
-       if( sur == 0 ){
-               /* get left value into a register, do op */
-               p->su = max( nr, sul );
-               }
-       else {
-               /* do harder into a register, then easier */
-               p->su = max( nr+nr, min( max( sul, nr+sur ), max( sur, nr+sul ) ) );
-               }
-       }
-
-int radebug = 0;
-
-mkrall( p, r ) register NODE *p; {
-       /* insure that the use of p gets done with register r; in effect, */
-       /* simulate offstar */
-
-       if( p->op == FLD ){
-               p->left->rall = p->rall;
-               p = p->left;
-               }
-
-       if( p->op != UNARY MUL ) return;  /* no more to do */
-       p = p->left;
-       if( p->op == UNARY MUL ){
-               p->rall = r;
-               p = p->left;
-               }
-       if( p->op == PLUS && p->right->op == ICON ){
-               p->rall = r;
-               p = p->left;
-               }
-       rallo( p, r );
-       }
-
-rallo( p, down ) register NODE *p; {
-       /* do register allocation */
-       register o, type, down1, down2, ty;
-
-       if( radebug ) printf( "rallo( %o, %o )\n", p, down );
-
-       down2 = NOPREF;
-       p->rall = down;
-       down1 = ( down &= ~MUSTDO );
-
-       ty = optype( o = p->op );
-       type = p->type;
-
-
-       if( type == DOUBLE || type == FLOAT ){
-               if( o == FORCE ) down1 = FR0|MUSTDO;
-               ++fltused;
-               }
-       else switch( o ) {
-       case ASSIGN:    
-               down1 = NOPREF;
-               down2 = down;
-               break;
-
-       case ASG MUL:
-       case ASG DIV:
-       case ASG MOD:
-               /* keep the addresses out of the hair of (r0,r1) */
-               if(fregs == 2 ){
-                       /* lhs in (r0,r1), nothing else matters */
-                       down1 = R1|MUSTDO;
-                       down2 = NOPREF;
-                       break;
-                       }
-               /* at least 3 regs free */
-               /* compute lhs in (r0,r1), address of left in r2 */
-               p->left->rall = R1|MUSTDO;
-               mkrall( p->left, R2|MUSTDO );
-               /* now, deal with right */
-               if( fregs == 3 ) rallo( p->right, NOPREF );
-               else {
-                       /* put address of long or value here */
-                       p->right->rall = R3|MUSTDO;
-                       mkrall( p->right, R3|MUSTDO );
-                       }
-               return;
-
-       case MUL:
-       case DIV:
-       case MOD:
-               rallo( p->left, R1|MUSTDO );
-
-               if( fregs == 2 ){
-                       rallo( p->right, NOPREF );
-                       return;
-                       }
-               /* compute addresses, stay away from (r0,r1) */
-
-               p->right->rall = (fregs==3) ? R2|MUSTDO : R3|MUSTDO ;
-               mkrall( p->right, R2|MUSTDO );
-               return;
-
-       case CALL:
-       case STASG:
-       case EQ:
-       case NE:
-       case GT:
-       case GE:
-       case LT:
-       case LE:
-       case NOT:
-       case ANDAND:
-       case OROR:
-               down1 = NOPREF;
-               break;
-
-       case FORCE:     
-               down1 = R0|MUSTDO;
-               break;
-
-               }
-
-       if( ty != LTYPE ) rallo( p->left, down1 );
-       if( ty == BITYPE ) rallo( p->right, down2 );
-
-       }
-
-offstar( p ) register NODE *p; {
-       /* handle indirections */
-
-       if( p->op == UNARY MUL ) p = p->left;
-
-       if( p->op == PLUS || p->op == MINUS ){
-               if( p->right->op == ICON ){
-                       order( p->left , INTAREG|INAREG );
-                       return;
-                       }
-               }
-       order( p, INTAREG|INAREG );
-       }
-
-setincr( p ) NODE *p; {
-       return( 0 );    /* for the moment, don't bother */
-       }
-
-niceuty( p ) register NODE *p; {
-       register TWORD t;
-
-       return( p->op == UNARY MUL && (t=p->type)!=CHAR &&
-               t!= UCHAR && t!= FLOAT &&
-               shumul( p->left) != STARREG );
-       }
-setbin( p ) register NODE *p; {
-       register NODE *r, *l;
-
-       r = p->right;
-       l = p->left;
-
-       if( p->right->su == 0 ){ /* rhs is addressable */
-               if( logop( p->op ) ){
-                       if( l->op == UNARY MUL && l->type != FLOAT && shumul( l->left ) != STARREG ) offstar( l->left );
-                       else order( l, INAREG|INTAREG|INBREG|INTBREG|INTEMP );
-                       return( 1 );
-                       }
-               if( !istnode( l ) ){
-                       order( l, INTAREG|INTBREG );
-                       return( 1 );
-                       }
-               /* rewrite */
-               return( 0 );
-               }
-       /* now, rhs is complicated: must do both sides into registers */
-       /* do the harder side first */
-
-       if( logop( p->op ) ){
-               /* relational: do both sides into regs if need be */
-
-               if( r->su > l->su ){
-                       if( niceuty(r) ){
-                               offstar( r->left );
-                               return( 1 );
-                               }
-                       else if( !istnode( r ) ){
-                               order( r, INTAREG|INAREG|INTBREG|INBREG|INTEMP );
-                               return( 1 );
-                               }
-                       }
-               if( niceuty(l) ){
-                       offstar( l->left );
-                       return( 1 );
-                       }
-               else if( niceuty(r) ){
-                       offstar( r->left );
-                       return( 1 );
-                       }
-               else if( !istnode( l ) ){
-                       order( l, INTAREG|INAREG|INTBREG|INBREG|INTEMP );
-                       return( 1 );
-                       }
-               if( !istnode( r ) ){
-                       order( r, INTAREG|INAREG|INTBREG|INBREG|INTEMP );
-                       return( 1 );
-                       }
-               cerror( "setbin can't deal with %s", opst[p->op] );
-               }
-
-       /* ordinary operator */
-
-       if( !istnode(r) && r->su > l->su ){
-               /* if there is a chance of making it addressable, try it... */
-               if( niceuty(r) ){
-                       offstar( r->left );
-                       return( 1 );  /* hopefully, it is addressable by now */
-                       }
-               order( r, INTAREG|INAREG|INTBREG|INBREG|INTEMP );  /* anything goes on rhs */
-               return( 1 );
-               }
-       else {
-               if( !istnode( l ) ){
-                       order( l, INTAREG|INTBREG );
-                       return( 1 );
-                       }
-               /* rewrite */
-               return( 0 );
-               }
-       }
-
-setstr( p ) register NODE *p; { /* structure assignment */
-       if( p->right->op != REG ){
-               order( p->right, INTAREG );
-               return(1);
-               }
-       p = p->left;
-       if( p->op != NAME && p->op != OREG ){
-               if( p->op != UNARY MUL ) cerror( "bad setstr" );
-               order( p->left, INTAREG );
-               return( 1 );
-               }
-       return( 0 );
-       }
-
-setasg( p ) register NODE *p; {
-       /* setup for assignment operator */
-
-       if( p->right->su != 0 && p->right->op != REG ) {
-               if( p->right->op == UNARY MUL )
-                       offstar( p->right->left );
-               else
-                       order( p->right, INAREG|INBREG|SOREG|SNAME|SCON );
-               return(1);
-               }
-       if( p->right->op != REG && ( p->type == FLOAT || p->type == DOUBLE ) ) {
-               order( p->right, INBREG );
-               return(1);
-               }
-       if( p->left->op == UNARY MUL && !tshape( p->left, STARREG|STARNM ) ){
-               offstar( p->left->left );
-               return(1);
-               }
-       if( p->left->op == FLD && p->left->left->op == UNARY MUL ){
-               offstar( p->left->left->left );
-               return(1);
-               }
-       /* if things are really strange, get rhs into a register */
-       if( p->right->op != REG ){
-               order( p->right, INAREG|INBREG );
-               return( 1 );
-               }
-       return(0);
-       }
-
-setasop( p ) register NODE *p; {
-       /* setup for =ops */
-       register sul, sur;
-       register NODE *q, *p2;
-
-       sul = p->left->su;
-       sur = p->right->su;
-
-       switch( p->op ){
-
-       case ASG PLUS:
-       case ASG OR:
-       case ASG MINUS:
-               if( p->type != INT && p->type != UNSIGNED && !ISPTR(p->type) ) break;
-               if( p->right->type == CHAR || p->right->type == UCHAR ){
-                       order( p->right, INAREG );
-                       return( 1 );
-                       }
-               break;
-
-       case ASG ER:
-               if( sul == 0 || p->left->op == REG ){
-                       if( p->left->type == CHAR || p->left->type == UCHAR ) goto rew;  /* rewrite */
-                       order( p->right, INAREG|INBREG );
-                       return( 1 );
-                       }
-               goto leftadr;
-               }
-
-       if( sur == 0 ){
-
-       leftadr:
-               /* easy case: if addressable, do left value, op, store */
-               if( sul == 0 ) goto rew;  /* rewrite */
-
-               /* harder; make aleft address, val, op, and store */
-
-               if( p->left->op == UNARY MUL ){
-                       offstar( p->left->left );
-                       return( 1 );
-                       }
-               if( p->left->op == FLD && p->left->left->op == UNARY MUL ){
-                       offstar( p->left->left->left );
-                       return( 1 );
-                       }
-       rew:    /* rewrite, accounting for autoincrement and autodecrement */
-
-               q = p->left;
-               if( q->op == FLD ) q = q->left;
-               if( q->op != UNARY MUL || shumul(q->left) != STARREG ) return(0); /* let reader.c do it */
-
-               /* mimic code from reader.c */
-
-               p2 = tcopy( p );
-               p->op = ASSIGN;
-               reclaim( p->right, RNULL, 0 );
-               p->right = p2;
-
-               /* now, zap INCR on right, ASG MINUS on left */
-
-               if( q->left->op == INCR ){
-                       q = p2->left;
-                       if( q->op == FLD ) q = q->left;
-                       if( q->left->op != INCR ) cerror( "bad incr rewrite" );
-                       }
-               else if( q->left->op != ASG MINUS )  cerror( " bad -= rewrite" );
-
-               q->left->right->op = FREE;
-               q->left->op = FREE;
-               q->left = q->left->left;
-
-               /* now, resume reader.c rewriting code */
-
-               canon(p);
-               rallo( p, p->rall );
-               order( p2->left, INTBREG|INTAREG );
-               order( p2, INTBREG|INTAREG );
-               return( 1 );
-               }
-
-       /* harder case: do right, left address, left value, op, store */
-
-       if( p->right->op == UNARY MUL ){
-               offstar( p->right->left );
-               return( 1 );
-               }
-       /* sur> 0, since otherwise, done above */
-       if( p->right->op == REG ) goto leftadr;  /* make lhs addressable */
-       order( p->right, INAREG|INBREG );
-       return( 1 );
-       }
-
-int crslab = 10000;
-
-getlab(){
-       return( crslab++ );
-       }
-
-deflab( l ){
-       printf( "L%d:\n", l );
-       }
-
-genargs( p) register NODE *p; {
-       register size;
-
-       /* generate code for the arguments */
-
-       /*  first, do the arguments on the right (last->first) */
-       while( p->op == CM ){
-               genargs( p->right );
-               p->op = FREE;
-               p = p->left;
-               }
-
-       if( p->op == STARG ){ /* structure valued argument */
-
-               size = p->stsize;
-               if( p->left->op == ICON ){
-                       /* make into a name node */
-                       p->op = FREE;
-                       p= p->left;
-                       p->op = NAME;
-                       }
-               else {
-                       /* make it look beautiful... */
-                       p->op = UNARY MUL;
-                       canon( p );  /* turn it into an oreg */
-                       if( p->op != OREG ){
-                               offstar( p->left );
-                               canon( p );
-                               if( p->op != OREG ) cerror( "stuck starg" );
-                               }
-                       }
-
-               p->lval += size;  /* end of structure */
-               /* put on stack backwards */
-               for( ; size>0; size -= 2 ){
-                       p->lval -= 2;
-                       expand( p, RNOP, "      mov     AR,Z-\n" );
-                       }
-               reclaim( p, RNULL, 0 );
-               return;
-               }
-
-       /* ordinary case */
-
-       order( p, FORARG );
-       }
-
-argsize( p ) register NODE *p; {
-       register t;
-       t = 0;
-       if( p->op == CM ){
-               t = argsize( p->left );
-               p = p->right;
-               }
-       if( p->type == DOUBLE || p->type == FLOAT ){
-               SETOFF( t, 2 );
-               return( t+8 );
-               }
-       else if( p->type == LONG || p->type == ULONG ) {
-               SETOFF( t, 2);
-               return( t+4 );
-               }
-       else if( p->op == STARG ){
-               SETOFF( t, p->stalign );  /* alignment */
-               return( t + p->stsize );  /* size */
-               }
-       else {
-               SETOFF( t, 2 );
-               return( t+2 );
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/pcc/table.c b/.ref-Research-V7/usr/src/cmd/pcc/table.c
deleted file mode 100644 (file)
index 47e07c8..0000000
+++ /dev/null
@@ -1,854 +0,0 @@
-# include "mfile2"
-
-# define AWD SNAME|SOREG|SCON|STARNM|STARREG|SAREG
-# define LWD SNAME|SOREG|SCON|SAREG
-
-struct optab  table[] = {
-
-ASSIGN,        INAREG|FOREFF|FORCC,
-       AWD,    TPOINT|TINT|TUNSIGNED|TCHAR|TUCHAR,
-       SZERO,  TANY,
-               0,      RLEFT|RRIGHT|RESCC,
-               "       clrZB   AL\n",
-
-ASSIGN,        INAREG|FOREFF|FORCC,
-       AWD,    TINT|TUNSIGNED,
-       AWD,    TCHAR,
-               NAREG|NASR,     RLEFT|RESC1|RESCC,
-               "       movb    AR,A1\n mov     A1,AL\n",
-
-ASSIGN,        INAREG|FOREFF|FORCC,
-       AWD,    TINT|TUNSIGNED,
-       AWD,    TUCHAR,
-               0,      RLEFT|RESCC,
-               "       movb    AR,AL\n bic     $!377,AL\n",
-
-ASSIGN,        INAREG|FOREFF|FORCC,
-       AWD,    TPOINT|TINT|TUNSIGNED|TCHAR|TUCHAR,
-       AWD,    TPOINT|TINT|TUNSIGNED|TCHAR|TUCHAR,
-               0,      RLEFT|RRIGHT|RESCC,
-               "       movZB   AR,AL\n",
-
-ASSIGN,        INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       SZERO,  TANY,
-               0,      RLEFT|RRIGHT,
-               "       clr     AL\n    clr     UL\n",
-
-ASSIGN,        INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT|RRIGHT,
-               "       mov     AR,AL\n mov     UR,UL\n",
-
-ASSIGN,        FOREFF|INAREG,
-       STARNM,         TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               NAREG|NASL,     RRIGHT,
-               "       mov     ZU,A1\n mov     AR,(A1)+\n      mov     UR,(A1)\n",
-
-ASSIGN,        FOREFF,
-       STARNM, TLONG|TULONG,
-       AWD,    TUNSIGNED|TPOINT,
-               NAREG|NASL,     RRIGHT,
-               "       mov     ZU,A1\n clr     (A1)+\n mov     AR,(A1)\n",
-
-ASSIGN,        FOREFF,
-       STARNM, TLONG|TULONG,
-       AWD,    TINT,
-               NAREG|NASL,     RRIGHT,
-               "       mov     ZU,A1\n mov     AR,2(A1)\n      sxt     (A1)\n",
-
-       /* PANIC! */
-ASSIGN,        FOREFF|INAREG,
-       STARNM, TLONG|TULONG,
-       AWD,    TUNSIGNED|TPOINT,
-               NAREG|NASL|NASR,        RESC1,
-               "\tmov\tAR,-(sp)\n\tmov\tZU,A1\n\tclr\t(A1)+\n\tmov\t(sp)+,(A1)\
-               \nF\tmov\t(A1),U1\nF\tclr\tA1\n",
-
-ASSIGN,        FOREFF|INAREG,
-       STARNM, TLONG|TULONG,
-       AWD,    TINT,
-               NAREG|NASL|NASR,        RESC1,
-               "\tmov\tAR,-(sp)\n\tmov\tZU,A1\n\tmov\t(sp)+,2(A1)\nF\tmov\t2(A1),U1\
-               \n\tsxt\t(A1)\nF\tsxt\tA1\n",
-
-ASSIGN,        FOREFF|INAREG,
-       STARNM, TLONG|TULONG,
-       SAREG,  TLONG|TULONG,
-               0,      RRIGHT,
-               "       mov     AR,AL\n mov     ZU,AR\n mov     UR,2(AR)\nF     mov     (AR),AR\n",
-
-ASSIGN,        INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       AWD,    TCHAR,
-               NAREG,  RESC1,
-               "       movb    AR,U1\n mov     U1,UL\n sxt     AL\nF   sxt     A1\n",
-
-ASSIGN,        INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       AWD,    TUCHAR,
-               0,      RLEFT,
-               "       movb    AR,UL\n bic     $!377,UL\n      clr     AL\n",
-
-ASSIGN,        INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       AWD,    TINT,
-               0,      RLEFT,
-               "       mov     AR,UL\n sxt     AL\n",
-
-ASSIGN,        INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       AWD,    TUNSIGNED|TPOINT,
-               0,      RLEFT,
-               "       mov     AR,UL\n clr     AL\n",
-
-ASSIGN,        INBREG|INTBREG|FOREFF,
-       AWD,    TDOUBLE,
-       SBREG,  TDOUBLE,
-               0,      RRIGHT,
-               "       movf    AR,AL\n",
-
-ASSIGN,        INBREG|INTBREG|FOREFF,
-       AWD,    TFLOAT,
-       SBREG,  TDOUBLE,
-               0,      RRIGHT,
-               "       movfo   AR,AL\n",
-
-ASSIGN, INAREG|FOREFF,
-       SFLD,   TANY,
-       SZERO,  TANY,
-               0,      RRIGHT,
-               "       bic     $M.,AL\n",
-
-ASSIGN, INTAREG|INAREG|FOREFF,
-       SFLD,   TANY,
-       STAREG, TANY,
-               0,      RRIGHT,
-               "F\tmov\tAR,-(sp)\n\tash\t$H.,AR\n\tbic\t$!M.,AR\n\tbic\t$M.,AL\n\tbis\tAR,AL\nF\tmov\t(sp)+,AR\n",
-
-ASSIGN, INAREG|FOREFF,
-       SFLD,   TANY,
-       AWD,    TANY,
-               NAREG,  RRIGHT,
-               "\tmov\tAR,A1\n\tash\t$H.,A1\n\tbic\t$!M.,A1\n\tbic\t$M.,AL\n\tbis\tA1,AL\n",
-
-ASSIGN,        FOREFF,
-       AWD,    TFLOAT,
-       AWD,    TFLOAT,
-               NBREG,  RESC1,
-               "       movof   AR,A1\n movfo   A1,AL\n",
-
-/* put this here so UNARY MUL nodes match OPLTYPE when appropriate */
-UNARY MUL,     INTAREG|INAREG,
-       SANY,   TANY,
-       STARNM, TLONG|TULONG,
-               NAREG|NASR,     RESC1,
-               "       mov     AL,U1\n mov     (U1)+,A1\n      mov     (U1),U1\n",
-
-OPLTYPE,       FOREFF,
-       SANY,   TANY,
-       LWD,    TANY,
-               0,      RRIGHT,
-               "",   /* this entry throws away computations which don't do anything */
-OPLTYPE,       INTAREG|INAREG,
-       SANY,   TANY,
-       SZERO,  TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-               NAREG|NASR,     RESC1,
-               "       clr     A1\n",
-
-OPLTYPE,       INTAREG|INAREG,
-       SANY,   TANY,
-       SZERO,  TLONG|TULONG,
-               NAREG|NASR,     RESC1,
-               "       clr     A1\n    clr     U1\n",
-
-OPLTYPE,       INTAREG|INAREG,
-       SANY,   TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT|TCHAR,
-               NAREG|NASR,     RESC1,
-               "       movZB   AR,A1\n",
-
-OPLTYPE,       INTEMP,
-       SANY,   TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT,
-               NTEMP,  RESC1,
-               "       mov     AR,A1\n",
-
-OPLTYPE,       FORCC,
-       SANY,   TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-               0,      RESCC,
-               "       tstZB   AR\n",
-
-
-OPLTYPE,       FORARG,
-       SANY,   TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT,
-               0,      RNULL,
-               "       mov     AR,Z-\n",
-
-OPLTYPE,       INTAREG|INAREG,
-       SANY,   TANY,
-       AWD,    TUCHAR,
-               NAREG|NASR,     RESC1,
-               "       movb    AR,A1\n bic     $!377,A1\n",
-
-OPLTYPE,       INTAREG|INAREG,
-       SANY,   TANY,
-       LWD,    TLONG|TULONG,
-               NAREG,  RESC1,
-               "       mov     UR,U1\n mov     AR,A1\n",
-
-OPLTYPE,       INTAREG|INAREG,  /* for use when there are no free regs */
-       SANY,   TANY,
-       LWD,    TLONG|TULONG,
-               NAREG|NASR,     RESC1,
-               "       mov     AR,-(sp)\n      mov     UR,U1\n mov     (sp)+,A1\n",
-
-OPLTYPE,       INTEMP,
-       SANY,   TANY,
-       LWD,    TLONG|TULONG,
-               2*NTEMP,        RESC1,
-               "       mov     AR,A1\n mov     UR,U1\n",
-
-OPLTYPE,       FORCC,
-       SANY,   TANY,
-       LWD,    TLONG|TULONG,
-               0,      RESCC,
-               "ZA",
-
-OPLTYPE, FORARG,
-       SANY,   TANY,
-       LWD,    TLONG|TULONG,
-               0,      RNULL,
-               "       mov     UR,Z-\n mov     AR,Z-\n",
-
-UNARY MUL,     FORARG,
-       STARNM, TANY,
-       SANY,   TLONG|TULONG,
-               NAREG|NASR,     RNULL,
-               "       mov     AL,A1\n mov     2(A1),Z-\n      mov     (A1),Z-\n",
-
-OPLTYPE, FORARG,
-       SANY,   TANY,
-       SBREG,  TDOUBLE,
-               0,      RNULL,
-               "       movf    AR,Z4\n",
-
-OPLTYPE,       INTBREG|INBREG,
-       SANY,   TANY,
-       AWD,    TDOUBLE,
-               NBREG,  RESC1,
-               "       movf    AR,A1\n",
-
-OPLTYPE,       INTEMP,
-       SANY,   TANY,
-       SBREG,  TDOUBLE,
-               4*NTEMP,        RESC1,
-               "       movf    AR,A1\n",
-
-OPLTYPE,       FORCC,
-       SANY,   TANY,
-       AWD,    TDOUBLE,
-               0,      RESCC,
-               "       tstf    AR\n    cfcc\n",
-
-OPLTYPE,       INTBREG|INBREG,
-       SANY,   TANY,
-       AWD,    TFLOAT,
-               NBREG,  RESC1,
-               "       movof   AR,A1\n",
-
-OPLTYPE,       FORCC,
-       SANY,   TANY,
-       AWD,    TFLOAT,
-               NBREG,  RESCC,
-               "       movof   AR,A1\n cfcc\n",
-
-
-OPLOG, FORCC,
-       AWD,    TPOINT|TINT|TUNSIGNED,
-       AWD,    TPOINT|TINT|TUNSIGNED,
-               0,      RESCC,
-               "       cmp     AL,AR\nZI",
-
-OPLOG, FORCC,
-       AWD,    TCHAR|TUCHAR,
-       AWD,    TCHAR|TUCHAR,
-               0,      RESCC,
-               "       cmpb    AL,AR\nZI",
-
-OPLOG, FORCC,
-       AWD,    TCHAR|TUCHAR,
-       SCCON,  TINT,                           /* look for constants between -128 and 127 */
-               0,      RESCC,
-               "       cmpb    AL,AR\nZI",
-
-OPLOG, FORCC,
-       LWD,    TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RESCC,
-               "ZCZI",
-
-OPLOG, FORCC,
-       SBREG,  TDOUBLE,
-       AWD,    TFLOAT,
-               NBREG,  RESCC,
-               "       movof   AR,A1\n cmpf    A1,AL\n cfcc\nZF",
-
-OPLOG, FORCC,
-       SBREG,  TDOUBLE,
-       SBREG|AWD,      TDOUBLE,
-               0,      RESCC,
-               "       cmpf    AR,AL\n cfcc\nZF",
-
-CCODES,        INTAREG|INAREG,
-       SANY,   TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-               NAREG,  RESC1,
-               "       mov     $1,A1\nZN",
-
-CCODES,        INTAREG|INAREG,
-       SANY,   TANY,
-       SANY,   TLONG|TULONG,
-               NAREG,  RESC1,
-               "       clr     A1\n    mov     $1,U1\nZN",
-
-UNARY MINUS,   INTAREG|INAREG,
-       STAREG, TINT|TUNSIGNED,
-       SANY,   TANY,
-               0,      RLEFT,
-               "       neg     AL\n",
-
-UNARY MINUS,   INTAREG|INAREG,
-       STAREG, TLONG|TULONG,
-       SANY,   TANY,
-               0,      RLEFT,
-               "       neg     AL\n    neg     UL\n    sbc     AL\n",
-
-UNARY MINUS,   INTBREG|INBREG,
-       STBREG, TDOUBLE,
-       SANY,   TANY,
-               0,      RLEFT,
-               "       negf    AL\n",
-
-COMPL, INTAREG|INAREG,
-       STAREG, TINT|TUNSIGNED,
-       SANY,   TANY,
-               0,      RLEFT,
-               "       com     AL\n",
-
-INCR,  INTAREG|INAREG|FOREFF,
-       AWD,    TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-       SONE,   TANY,
-               NAREG,  RESC1,
-               "F      movZB   AL,A1\n incZB   AL\n",
-
-DECR,  INTAREG|INAREG|FOREFF,
-       AWD,    TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-       SONE,   TANY,
-               NAREG,  RESC1,
-               "F      movZB   AL,A1\n decZB   AL\n",
-
-INCR,  INTAREG|INAREG|FOREFF,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       SCON,   TANY,
-               NAREG,  RESC1,
-               "F      mov     AL,A1\n add     AR,AL\n",
-
-DECR,  INTAREG|INAREG|FOREFF,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       SCON,   TANY,
-               NAREG,  RESC1,
-               "F      mov     AL,A1\n sub     AR,AL\n",
-
-INCR,  INTAREG|INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       SCON,   TANY,
-               NAREG,  RESC1,
-               "F      mov     AL,A1\nF        mov     UL,U1\n add     AR,AL\n add     UR,UL\n adc     AL\n",
-
-DECR,  INTAREG|INAREG|FOREFF,
-       LWD,    TLONG|TULONG,
-       SCON,   TANY,
-               NAREG,  RESC1,
-               "F      mov     AL,A1\nF        mov     UL,U1\n sub     AR,AL\n sub     UR,UL\n sbc     AL\n",
-
-COMPL, INTAREG|INAREG,
-       STAREG, TLONG|TULONG,
-       SANY,   TANY,
-               0,      RLEFT,
-               "       com     AL\n    com     UL\n",
-
-AND,   FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       SCON,   TANY,
-               0,      RESCC,
-               "       bit     AL,$Z~\n",
-
-ASG MUL,       INAREG,
-       STAREG, TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NAREG,  RLEFT,
-               "       mul     AR,AL\n",
-
-ASG DIV,       INAREG,
-       STAREG, TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NAREG,  RESC1,
-               "ZV     div     AR,r0\n",  /* since lhs must be in r1 */
-
-ASG MOD,       INAREG,
-       STAREG, TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NAREG,  RLEFT,
-               "ZV     div     AR,r0\n",  /* since lhs must be in r1 */
-
-ASG PLUS,      INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-       SONE,   TINT,
-               0,      RLEFT|RESCC,
-               "       incZB   AL\n",
-
-ASG PLUS,      INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT|RESCC,
-               "       add     AR,AL\n",
-
-ASG MINUS,     INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-       SONE,   TINT,
-               0,      RLEFT|RESCC,
-               "       decZB   AL\n",
-
-ASG MINUS,     INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT|RESCC,
-               "       sub     AR,AL\n",
-
-ASG OR,        INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT|RESCC,
-               "       bis     AR,AL\n",
-
-/* AND transformed to "pdp11 bic" in first pass. */
-ASG AND,       INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT|RESCC,
-               "       bic     AR,AL\n",
-
-ASG ER,        INAREG|FORCC,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT|RESCC,
-               "       xor     AR,AL\n",
-
-ASG OPSHFT,    INAREG,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-       SONE,   TINT,
-               0,      RLEFT,
-               "       OI      AL\nZH",
-
-ASG LS,        INAREG,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT,
-               "       ash     AR,AL\n",
-
-ASG RS,        INAREG,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-       SCON,   TANY,
-               0,      RLEFT,
-               "       ash     $ZM,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-       STAREG, TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT,
-               "       neg     AR\n    ash     AR,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NAREG|NASR,     RLEFT,
-               "       mov     AR,A1\n neg     A1\n    ash     A1,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TINT,
-       AWD,    TINT,
-               0,      RLEFT,
-               "       mov     AR,-(sp)\n      neg     (sp)\n  ash     (sp)+,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NTEMP,  RLEFT,
-               "       mov     AR,A1\n neg     A1\n    ash     A1,AL\nZH",
-
-ASG OR,        INAREG|FORCC,
-       AWD,    TCHAR|TUCHAR,
-       AWD,    TCHAR|TUCHAR,
-               0,      RLEFT|RESCC,
-               "       bisb    AR,AL\n",
-
-/* AND transformed to "pdp11 bic" in first pass. */
-ASG AND,       INAREG|FORCC,
-       AWD,    TCHAR|TUCHAR,
-       AWD,    TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-               0,      RLEFT|RESCC,
-               "       bicb    AR,AL\n",
-
-ASG PLUS,      INAREG,
-       LWD,    TLONG|TULONG,
-       SICON,  TINT|TLONG|TULONG,
-               0,      RLEFT,
-               "       add     UR,UL\n adc     AL\n",
-
-ASG PLUS,      INAREG,
-       STARNM, TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               NAREG,  RLEFT,
-               "       mov     ZU,A1\n add     AR,(A1)+\n      add     UR,(A1)\n       adc     -(A1)\n",
-
-ASG PLUS,      INAREG,
-       LWD,    TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "       add     AR,AL\n add     UR,UL\n adc     AL\n",
-
-ASG PLUS,      INAREG,
-       AWD,    TPOINT,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "       add     UR,AL\n",
-
-ASG MINUS,     INAREG,
-       LWD,    TLONG|TULONG,
-       SICON,  TINT|TLONG|TULONG,
-               0,      RLEFT,
-               "       sub     UR,UL\n sbc     AL\n",
-
-ASG MINUS,     INAREG,
-       STARNM, TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               NAREG,  RLEFT,
-               "       mov     ZU,A1\n sub     AR,(A1)+\n      sub     UR,(A1)\n       sbc     -(A1)\n",
-
-ASG MINUS,     INAREG,
-       LWD,    TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "       sub     AR,AL\n sub     UR,UL\n sbc     AL\n",
-
-ASG MINUS,     INAREG,
-       AWD,    TPOINT,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "       sub     UR,AL\n",
-
-ASG OR,        INAREG,
-       LWD,    TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "       bis     AR,AL\n bis     UR,UL\n",
-
-/* AND transformed to "pdp11 bic" in first pass. */
-ASG AND,       INAREG,
-       LWD,    TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "       bic     AR,AL\n bic     UR,UL\n",
-
-ASG ER,        INAREG,
-       LWD,    TLONG|TULONG,
-       SAREG,  TLONG|TULONG,
-               0,      RLEFT,
-               "       xor     AR,AL\n xor     UR,UL\n",
-
-       /* table entries for ^ which correspond to the usual way of doing busingess
-               (rhs in a temp register */
-
-ASG ER,        INAREG|INTAREG,
-       STAREG, TLONG|TULONG,
-       LWD,    TLONG|TULONG,
-               0,      RLEFT,
-               "\tmov\tAL,-(sp)\n\tmov\tUR,AL\n\txor\tAL,UL\n\tmov\tAR,AL\n\txor\tAL,(sp)\n\tmov\t(sp)+,AL\n",
-
-ASG ER,        INAREG|INTAREG,
-       STAREG, TINT|TUNSIGNED|TPOINT,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT,
-               "\tmov\tAL,-(sp)\n\tmov\tAR,AL\n\txor\tAL,(sp)\n\tmov\t(sp)+,AL\n",
-
-ASG LS,        INAREG,
-       SAREG,  TLONG|TULONG,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT,
-               "       ashc    AR,AL\n",
-
-ASG RS,        INAREG,
-       SAREG,  TLONG|TULONG,
-       SCON,   TANY,
-               0,      RLEFT,
-               "       ashc    $ZM,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TLONG|TULONG,
-       STAREG, TINT|TUNSIGNED|TPOINT,
-               0,      RLEFT,
-               "       neg     AR\n    ashc    AR,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TLONG|TULONG,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NAREG|NASR,     RLEFT,
-               "       mov     AR,A1\n neg     A1\n    ashc    A1,AL\nZH",
-
-ASG RS,        INAREG,
-       SAREG,  TLONG|TULONG,
-       AWD,    TINT|TUNSIGNED|TPOINT,
-               NTEMP,  RLEFT,
-               "       mov     AR,A1\n neg     A1\n    ashc    A1,AL\nZH",
-
-ASG OPFLOAT,   INBREG|INTBREG,
-       STBREG, TDOUBLE,
-       SBREG|AWD,      TDOUBLE,
-               0,      RLEFT|RESCC,
-               "       OF      AR,AL\n",
-
-ASG OPFLOAT,   INBREG|INTBREG,
-       STBREG, TDOUBLE,
-       AWD,    TFLOAT,
-               NBREG|NBSR,     RLEFT|RESCC,
-               "       movof   AR,A1\n OF      A1,AL\n",
-
-ASG OPFLOAT,   FORCC,
-       STBREG, TDOUBLE,
-       SBREG|AWD,      TDOUBLE,
-               0,      RESCC,
-               "       OF      AR,AL\n cfcc\n",
-
-ASG OPFLOAT,   FORCC,
-       STBREG, TDOUBLE,
-       AWD,    TFLOAT,
-               NBREG|NBSR,     RESCC,
-               "       movof   AR,A1\n OF      A1,AL\n cfcc\n",
-
-UNARY CALL,    INTAREG,
-       SAREG|SNAME|SOREG|SCON, TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR|TLONG|TULONG,
-               NAREG|NASL,     RESC1, /* should be register 0 */
-               "       jsr     pc,*AL\n",
-
-UNARY CALL,    INTBREG,
-       SAREG|SNAME|SOREG|SCON, TANY,
-       SANY,   TDOUBLE|TFLOAT,
-               NBREG,  RESC1, /* should be register FR0 */
-               "       jsr     pc,*AL\n",
-
-SCONV, INTAREG,
-       STAREG, TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-       SANY,   TUCHAR,
-               0,      RLEFT,
-               "       bic     $!377,AL\n",
-
-SCONV, INTAREG,
-       AWD,    TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-       SANY,   TCHAR|TINT,
-               NAREG|NASL,     RESC1,
-               "       movZB   AL,A1\n",
-
-SCONV, INAREG|INTAREG,
-       LWD,    TLONG|TULONG,
-       SANY,   TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-               0,      RLEFT,
-               "ZT",
-
-SCONV, INTAREG,
-       AWD,    TUCHAR,
-       SANY,   TLONG|TULONG,
-               NAREG|NASL,     RESC1,
-               "       movb    AL,U1\n bic     $!377,U1\n      clr     A1\n",
-
-SCONV, INTAREG,
-       AWD,    TINT,
-       SANY,   TLONG|TULONG,
-               NAREG|NASL,     RESC1,
-               "       mov     AL,U1\n sxt     A1\n",
-
-SCONV, INTAREG,
-       AWD,    TUNSIGNED|TPOINT,
-       SANY,   TLONG|TULONG,
-               NAREG|NASL,     RESC1,
-               "       mov     AL,U1\n clr     A1\n",
-
-SCONV, INTAREG,
-       SBREG,  TDOUBLE,
-       SANY,   TINT|TUNSIGNED|TPOINT|TCHAR|TUCHAR,
-               NAREG,  RESC1,
-               "       movfi   AL,A1\n",
-
-SCONV, INTAREG,
-       STBREG, TDOUBLE,
-       SANY,   TLONG|TULONG,
-               NAREG,  RESC1,
-               "       setl\n  movfi   AL,-(sp)\n      seti\n  mov     (sp)+,A1\n      mov     (sp)+,U1\n",
-
-SCONV, FORARG,
-       STBREG, TDOUBLE,
-       SANY,   TLONG|TULONG,
-               0,      RNULL,
-               "       setl\n  movfi   AL,Z4\n seti\n",
-
-SCONV, INTBREG,
-       SAREG,  TLONG,
-       SANY,   TANY,
-               NBREG,  RESC1,
-               "\tmov\tUL,-(sp)\n\tmov\tAL,-(sp)\n\tsetl\n\tmovif\t(sp)+,A1\n\tseti\n",
-
-SCONV, INTBREG,
-       LWD,    TLONG,
-       SANY,   TANY,
-               NBREG,  RESC1,
-               "\tsetl\n\tmovif\tAL,A1\n\tseti\n",
-
-SCONV, INTBREG,
-       AWD,    TINT,
-       SANY,   TANY,
-               NBREG,  RESC1,
-               "       movif   AL,A1\n",
-
-SCONV, INTBREG,
-       SAREG,  TULONG,
-       SANY,   TANY,
-               NBREG,  RESC1,
-               "\tmov\tUL,-(sp)\n\tmov\tAL,-(sp)\n\tsetl\n\tmovif\t(sp)+,A1\n\tseti\n\tcfcc\n\tbpl\t1f\n\taddf\t$050200,A1\n1:\n",
-
-SCONV, INTBREG,
-       LWD,    TULONG,
-       SANY,   TANY,
-               NBREG,  RESC1,
-               "\tsetl\n\tmovif\tAL,A1\n\tseti\n\tcfcc\n\tbpl\t1f\n\taddf\t$050200,A1\n1:\n",
-
-SCONV, INTBREG,
-       STAREG, TUNSIGNED|TPOINT,
-       SANY,   TANY,
-               NBREG,  RESC1,
-               "\tmovif\tAL,A1\n\tcfcc\n\tbpl\t1f\n\taddf\t$044200,A1\n1:\n",
-
-PCONV, INTAREG,
-       AWD,    TCHAR|TUCHAR,
-       SANY,   TPOINT,
-               NAREG|NASL,     RESC1,
-               "       movb    AL,A1\n",
-
-PCONV, INAREG|INTAREG,
-       LWD,    TLONG|TULONG,
-       SANY,   TPOINT,
-               0,      RLEFT,
-               "ZT",
-
-STARG, FORARG,
-       SNAME|SOREG,    TANY,
-       SANY,   TANY,
-               0,      RNULL,
-               "ZS",
-
-STASG, FOREFF,
-       SNAME|SOREG,    TANY,
-       SCON|SAREG,     TANY,
-               0,      RNOP,
-               "ZS",
-
-STASG, INTAREG|INAREG,
-       SNAME|SOREG,    TANY,
-       STAREG, TANY,
-               0,      RRIGHT,
-               "ZS",
-
-STASG, INAREG|INTAREG,
-       SNAME|SOREG,    TANY,
-       SCON|SAREG,     TANY,
-               NAREG,  RESC1,
-               "ZS     mov     AR,A1\n",
-
-INIT,  FOREFF,
-       SCON,   TANY,
-       SANY,   TINT|TUNSIGNED|TPOINT,
-               0,      RNOP,
-               "       CL\n",
-
-INIT,  FOREFF,
-       SCON,   TANY,
-       SANY,   TLONG|TULONG,
-               0,      RNOP,
-               "ZL",
-
-INIT,  FOREFF,
-       SCON,   TANY,
-       SANY,   TCHAR|TUCHAR,
-               0,      RNOP,
-               "       .byte   CL\n",
-
-       /* for the use of fortran only */
-
-GOTO,  FOREFF,
-       SCON,   TANY,
-       SANY,   TANY,
-               0,      RNOP,
-               "       jbr     CL\n",
-
-GOTO,  FOREFF,
-       SNAME,  TLONG|TULONG,
-       SANY,   TANY,
-               0,      RNOP,
-               "       jmp     *UL\n",
-
-GOTO,  FOREFF,
-       SNAME,  TINT|TUNSIGNED|TCHAR|TUCHAR|TPOINT,
-       SANY,   TANY,
-               0,      RNOP,
-               "       jmp     *AL\n",
-
-       /* Default actions for hard trees ... */
-
-# define DF(x) FORREW,SANY,TANY,SANY,TANY,REWRITE,x,""
-
-UNARY MUL, DF( UNARY MUL ),
-
-INCR, DF(INCR),
-
-DECR, DF(INCR),
-
-ASSIGN, DF(ASSIGN),
-
-STASG, DF(STASG),
-
-OPLEAF, DF(NAME),
-
-OPLOG, FORCC,
-       SANY,   TANY,
-       SANY,   TANY,
-               REWRITE,        BITYPE,
-               "",
-
-OPLOG, DF(NOT),
-
-COMOP, DF(COMOP),
-
-INIT, DF(INIT),
-
-OPUNARY, DF(UNARY MINUS),
-
-
-ASG OPANY, DF(ASG PLUS),
-
-OPANY, DF(BITYPE),
-
-FREE,  FREE,   FREE,   FREE,   FREE,   FREE,   FREE,   FREE,   "help; I'm in trouble\n" };
diff --git a/.ref-Research-V7/usr/src/cmd/plot/chrtab.c b/.ref-Research-V7/usr/src/cmd/plot/chrtab.c
deleted file mode 100644 (file)
index 4d8a81a..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-char   chrtab[][16] = {
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, sp, */
-0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0010,0000,0000,0000,0000,0000, /*, !, */
-0024,0024,0024,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ", */
-0000,0000,0000,0044,0044,0176,0044,0044,0176,0044,0044,0000,0000,0000,0000,0000, /*, #, */
-0000,0010,0010,0010,0076,0101,0100,0076,0001,0101,0076,0010,0010,0000,0000,0000, /*, $, */
-0000,0000,0000,0141,0142,0004,0010,0010,0020,0043,0103,0000,0000,0000,0000,0000, /*, %, */
-0000,0000,0070,0104,0110,0060,0060,0111,0106,0106,0071,0000,0000,0000,0000,0000, /*, &, */
-0004,0010,0020,0040,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ', */
-0000,0004,0010,0020,0040,0040,0040,0040,0040,0040,0020,0010,0004,0000,0000,0000, /*, (, */
-0000,0040,0020,0010,0004,0004,0004,0004,0004,0004,0010,0020,0040,0000,0000,0000, /*, ), */
-0000,0000,0000,0010,0111,0052,0034,0177,0034,0052,0111,0010,0000,0000,0000,0000, /*, *, */
-0000,0000,0000,0000,0010,0010,0010,0177,0010,0010,0010,0000,0000,0000,0000,0000, /*, +, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0010,0020,0000,0000,0000, /*, ,, */
-0000,0000,0000,0000,0000,0000,0000,0176,0000,0000,0000,0000,0000,0000,0000,0000, /*, -, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0000,0000,0000,0000,0000, /*, ., */
-0000,0000,0001,0002,0004,0010,0010,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, /, */
-0000,0030,0044,0102,0102,0102,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 0, */
-0000,0010,0030,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, 1, */
-0000,0070,0104,0004,0004,0010,0020,0040,0100,0100,0174,0000,0000,0000,0000,0000, /*, 2, */
-0000,0176,0004,0004,0010,0014,0002,0002,0002,0104,0070,0000,0000,0000,0000,0000, /*, 3, */
-0000,0004,0014,0024,0044,0104,0176,0004,0004,0004,0004,0000,0000,0000,0000,0000, /*, 4, */
-0000,0174,0100,0100,0130,0144,0002,0002,0102,0044,0030,0000,0000,0000,0000,0000, /*, 5, */
-0000,0074,0102,0100,0130,0144,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 6, */
-0000,0176,0004,0004,0010,0010,0020,0020,0040,0040,0040,0000,0000,0000,0000,0000, /*, 7, */
-0000,0034,0042,0101,0042,0076,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, 8, */
-0000,0034,0042,0101,0101,0101,0043,0036,0004,0010,0020,0040,0000,0000,0000,0000, /*, 9, */
-0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0000,0000,0000,0000,0000, /*, :, */
-0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0020,0040,0000,0000,0000, /*, ;, */
-0002,0004,0010,0020,0040,0100,0040,0020,0010,0004,0002,0000,0000,0000,0000,0000, /*, <, */
-0000,0000,0000,0000,0177,0000,0177,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, =, */
-0100,0040,0020,0010,0004,0002,0004,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, >, */
-0000,0030,0044,0102,0001,0002,0004,0010,0010,0000,0010,0000,0000,0000,0000,0000, /*, ?, */
-0000,0074,0102,0101,0115,0123,0121,0121,0121,0111,0046,0000,0000,0000,0000,0000, /*, @, */
-0000,0010,0024,0042,0101,0101,0177,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, A, */
-0000,0176,0101,0101,0101,0176,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, B, */
-0000,0076,0101,0100,0100,0100,0100,0100,0100,0101,0076,0000,0000,0000,0000,0000, /*, C, */
-0000,0176,0101,0101,0101,0101,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, D, */
-0000,0176,0100,0100,0100,0170,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, E, */
-0000,0177,0100,0100,0100,0174,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, F, */
-0000,0076,0101,0100,0100,0117,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, G, */
-0000,0101,0101,0101,0101,0176,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, H, */
-0000,0034,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, I, */
-0000,0016,0004,0004,0004,0004,0004,0004,0104,0104,0070,0000,0000,0000,0000,0000, /*, J, */
-0000,0101,0102,0104,0110,0120,0160,0110,0104,0102,0101,0000,0000,0000,0000,0000, /*, K, */
-0000,0100,0100,0100,0100,0100,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, L, */
-0000,0101,0143,0125,0111,0101,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, M, */
-0000,0101,0141,0121,0111,0105,0103,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, N, */
-0000,0076,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, O, */
-0000,0176,0101,0101,0101,0176,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, P, */
-0000,0076,0101,0101,0101,0101,0101,0101,0131,0105,0076,0002,0001,0000,0000,0000, /*, Q, */
-0000,0176,0101,0101,0101,0176,0104,0102,0101,0101,0101,0000,0000,0000,0000,0000, /*, R, */
-0000,0076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */
-0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */
-0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */
-0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */
-0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */
-0000,0101,0101,0042,0024,0010,0024,0042,0101,0101,0101,0000,0000,0000,0000,0000, /*, X, */
-0000,0101,0042,0024,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, Y, */
-0000,0177,0001,0002,0004,0010,0020,0040,0100,0100,0177,0000,0000,0000,0000,0000, /*, Z, */
-0000,0034,0020,0020,0020,0020,0020,0020,0020,0020,0020,0034,0000,0000,0000,0000, /*, [, */
-0000,0000,0100,0040,0020,0010,0010,0010,0004,0002,0001,0000,0000,0000,0000,0000, /*, , \, */
-0000,0070,0010,0010,0010,0010,0010,0010,0010,0010,0010,0070,0000,0000,0000,0000, /*, ], */
-0010,0024,0042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */
-0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */
-0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
-0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
-0000,0000,0000,0000,0000,0074,0102,0100,0100,0102,0074,0000,0000,0000,0000,0000, /*, c, */
-0002,0002,0002,0002,0002,0076,0102,0102,0102,0102,0076,0000,0000,0000,0000,0000, /*, d, */
-0000,0000,0000,0000,0000,0074,0102,0174,0100,0102,0074,0000,0000,0000,0000,0000, /*, e, */
-0000,0016,0020,0020,0020,0176,0020,0020,0020,0020,0020,0000,0000,0000,0000,0000, /*, f, */
-0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0102,0076,0000, /*, g, */
-0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, h, */
-0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, i, */
-0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0010,0010,0010,0050,0020,0000, /*, j, */
-0000,0100,0100,0100,0100,0106,0110,0120,0160,0110,0106,0000,0000,0000,0000,0000, /*, k, */
-0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */
-0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */
-0000,0000,0000,0000,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, n, */
-0000,0000,0000,0000,0000,0074,0102,0102,0102,0102,0074,0000,0000,0000,0000,0000, /*, o, */
-0000,0000,0000,0000,0000,0174,0102,0102,0102,0102,0174,0100,0100,0100,0100,0000, /*, p, */
-0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0002,0002,0000, /*, q, */
-0000,0000,0000,0000,0000,0134,0142,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, r, */
-0000,0000,0000,0000,0000,0076,0100,0074,0002,0102,0074,0000,0000,0000,0000,0000, /*, s, */
-0000,0020,0020,0020,0020,0176,0020,0020,0020,0020,0014,0000,0000,0000,0000,0000, /*, t, */
-0000,0000,0000,0000,0000,0102,0102,0102,0102,0102,0075,0000,0000,0000,0000,0000, /*, u, */
-0000,0000,0000,0000,0000,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, v, */
-0000,0000,0000,0000,0000,0111,0111,0111,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */
-0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */
-0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,0100,0000,0000, /*, y, */
-0000,0000,0000,0000,0000,0176,0004,0010,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */
-0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */
-0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */
-0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */
-0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */
-0000,0176,0176,0176,0176,0176,0176,0176,0176,0176,0176,0000,0000,0000,0000,0000, /*, del, */
-};
diff --git a/.ref-Research-V7/usr/src/cmd/plot/driver.c b/.ref-Research-V7/usr/src/cmd/plot/driver.c
deleted file mode 100644 (file)
index 52d0b1f..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-#include <stdio.h>
-
-float deltx;
-float delty;
-
-main(argc,argv)  char **argv; {
-       int std=1;
-       FILE *fin;
-
-       while(argc-- > 1) {
-               if(*argv[1] == '-')
-                       switch(argv[1][1]) {
-                               case 'l':
-                                       deltx = atoi(&argv[1][2]) - 1;
-                                       break;
-                               case 'w':
-                                       delty = atoi(&argv[1][2]) - 1;
-                                       break;
-                               }
-
-               else {
-                       std = 0;
-                       if ((fin = fopen(argv[1], "r")) == NULL) {
-                               fprintf(stderr, "can't open %s\n", argv[1]);
-                               exit(1);
-                               }
-                       fplt(fin);
-                       }
-               argv++;
-               }
-       if (std)
-               fplt( stdin );
-       exit(0);
-       }
-
-
-fplt(fin)  FILE *fin; {
-       int c;
-       char s[256];
-       int xi,yi,x0,y0,x1,y1,r,dx,n,i;
-       int pat[256];
-
-       openpl();
-       while((c=getc(fin)) != EOF){
-               switch(c){
-               case 'm':
-                       xi = getsi(fin);
-                       yi = getsi(fin);
-                       move(xi,yi);
-                       break;
-               case 'l':
-                       x0 = getsi(fin);
-                       y0 = getsi(fin);
-                       x1 = getsi(fin);
-                       y1 = getsi(fin);
-                       line(x0,y0,x1,y1);
-                       break;
-               case 't':
-                       gets(s,fin);
-                       label(s);
-                       break;
-               case 'e':
-                       erase();
-                       break;
-               case 'p':
-                       xi = getsi(fin);
-                       yi = getsi(fin);
-                       point(xi,yi);
-                       break;
-               case 'n':
-                       xi = getsi(fin);
-                       yi = getsi(fin);
-                       cont(xi,yi);
-                       break;
-               case 's':
-                       x0 = getsi(fin);
-                       y0 = getsi(fin);
-                       x1 = getsi(fin);
-                       y1 = getsi(fin);
-                       space(x0,y0,x1,y1);
-                       break;
-               case 'a':
-                       xi = getsi(fin);
-                       yi = getsi(fin);
-                       x0 = getsi(fin);
-                       y0 = getsi(fin);
-                       x1 = getsi(fin);
-                       y1 = getsi(fin);
-                       arc(xi,yi,x0,y0,x1,y1);
-                       break;
-               case 'c':
-                       xi = getsi(fin);
-                       yi = getsi(fin);
-                       r = getsi(fin);
-                       circle(xi,yi,r);
-                       break;
-               case 'f':
-                       gets(s,fin);
-                       linemod(s);
-                       break;
-               case 'd':
-                       xi = getsi(fin);
-                       yi = getsi(fin);
-                       dx = getsi(fin);
-                       n = getsi(fin);
-                       for(i=0; i<n; i++)pat[i] = getsi(fin);
-                       dot(xi,yi,dx,n,pat);
-                       break;
-                       }
-               }
-       closepl();
-       }
-getsi(fin)  FILE *fin; {       /* get an integer stored in 2 ascii bytes. */
-       short a, b;
-       if((b = getc(fin)) == EOF)
-               return(EOF);
-       if((a = getc(fin)) == EOF)
-               return(EOF);
-       a = a<<8;
-       return(a|b);
-}
-gets(s,fin)  char *s;  FILE *fin; {
-       for( ; *s = getc(fin); s++)
-               if(*s == '\n')
-                       break;
-       *s = '\0';
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/plot/makefile b/.ref-Research-V7/usr/src/cmd/plot/makefile
deleted file mode 100644 (file)
index ff7c70b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-CFLAGS = -n -O -s
-
-all:   tek t300 t300s t450 vplot
-       :
-
-cp:    all
-       cp tek t300 t300s t450 vplot /bin
-       rm tek t300 t300s t450 vplot driver.o
-
-cmp:   all
-       cmp tek /bin/tek
-       rm tek
-       cmp t300 /bin/t300
-       rm t300
-       cmp t300s /bin/t300s
-       rm t300s
-       cmp t450 /bin/t450
-       rm t450
-       cmp vplot /bin/vplot
-       rm vplot
-       rm -f driver.o
-
-tek:   driver.o
-       cc -n -s -o tek  driver.o -lt4014 -lm
-t300:  driver.o 
-       cc -n -s -o t300 driver.o -lt300 -lm
-t300s: driver.o 
-       cc -n -s -o t300s driver.o -lt300s -lm
-t450:  driver.o 
-       cc -n -s -o t450 driver.o -lt450 -lm
-
-vplot: chrtab.o vplot.o
-       cc -n -s -o vplot vplot.o chrtab.o
-       rm vplot.o chrtab.o
diff --git a/.ref-Research-V7/usr/src/cmd/plot/vplot.c b/.ref-Research-V7/usr/src/cmd/plot/vplot.c
deleted file mode 100644 (file)
index 5a96cc6..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Reads standard graphics input
- * Makes a plot on a 200 dot-per-inch 11" wide
- * Versatek plotter.
- *
- * Creates and leaves /usr/tmp/raster (1000 blocks)
- * which is the bitmap
- */
-#include "stdio.h"
-#include <signal.h>
-
-#define        NB      88
-#define BSIZ   512
-#define        mapx(x) ((1536*((x)-botx)/del)+centx)
-#define        mapy(y) ((1536*(del-(y)+boty)/del)-centy)
-#define SOLID -1
-#define DOTTED 014
-#define SHORTDASHED 034
-#define DOTDASHED 054
-#define LONGDASHED 074
-#define        SETSTATE        (('v'<<8)+1)
-
-int    linmod  = SOLID;
-int    again;
-int    done1;
-char   chrtab[][16];
-int    plotcom[]       { 0200, 0, 0};
-int    eotcom[]                { 0210, 0, 0};
-char   blocks  [NB][BSIZ];
-int    obuf[264];
-int    lastx;
-int    lasty;
-double topx    = 1536;
-double topy    = 1536;
-double botx    = 0;
-double boty    = 0;
-int    centx;
-int    centy;
-double delx    = 1536;
-double dely    = 1536;
-double del     = 1536;
-
-struct buf {
-       int     bno;
-       char    *block;
-};
-struct buf     bufs[NB];
-
-int    in, out;
-char *picture = "/usr/tmp/raster";
-
-main(argc, argv)
-char **argv;
-{
-       extern int onintr();
-       register i;
-
-       if (argc>1) {
-               in = open(argv[1], 0);
-               putpict();
-               exit(0);
-       }
-       signal(SIGTERM, onintr);
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, onintr);
-another:
-       for (i=0; i<NB; i++) {
-               bufs[i].bno = -1;
-               bufs[i].block = blocks[i];
-       }
-       out = creat(picture, 0666);
-       in = open(picture, 0);
-       zseek(out, 32*32);
-       write(out, blocks[0], BSIZ);
-/*delete following code when filsys deals properly with
-holes in files*/
-       for(i=0;i<512;i++)
-               blocks[0][i] = 0;
-       zseek(out, 0);
-       for(i=0;i<32*32;i++)
-               write(out,blocks[0],512);
-/**/
-       getpict();
-       for (i=0; i<NB; i++)
-               if (bufs[i].bno != -1) {
-                       zseek(out, bufs[i].bno);
-                       write(out, bufs[i].block, BSIZ);
-               }
-       putpict();
-       if (again) {
-               close(in);
-               close(out);
-               goto another;
-       }
-       exit(0);
-}
-
-getpict()
-{
-       register x1, y1;
-
-       again = 0;
-       for (;;) switch (x1 = getc(stdin)) {
-
-       case 's':
-               botx = getw(stdin);
-               boty = getw(stdin);
-               topx = getw(stdin);
-               topy = getw(stdin);
-               delx = topx-botx;
-               dely = topy-boty;
-               if (dely/delx > 1536./2048.)
-                       del = dely;
-               else
-                       del = delx * (1566./2048.);
-               centx = 0;
-               centx = (2048 - mapx(topx)) / 2;
-               centy = 0;
-               centy = mapy(topy) / 2;
-               continue;
-
-       case 'l':
-               done1 |= 01;
-               x1 = mapx(getw(stdin));
-               y1 = mapy(getw(stdin));
-               lastx = mapx(getw(stdin));
-               lasty = mapy(getw(stdin));
-               line(x1, y1, lastx, lasty);
-               continue;
-
-       case 'm':
-               lastx = mapx(getw(stdin));
-               lasty = mapy(getw(stdin));
-               continue;
-
-       case 't':
-               done1 |= 01;
-               while ((x1 = getc(stdin)) != '\n')
-                       plotch(x1);
-               continue;
-
-       case 'e':
-               if (done1) {
-                       again++;
-                       return;
-               }
-               continue;
-
-       case 'p':
-               done1 |= 01;
-               lastx = mapx(getw(stdin));
-               lasty = mapy(getw(stdin));
-               point(lastx, lasty);
-               point(lastx+1, lasty);
-               point(lastx, lasty+1);
-               point(lastx+1, lasty+1);
-               continue;
-
-       case 'n':
-               done1 |= 01;
-               x1 = mapx(getw(stdin));
-               y1 = mapy(getw(stdin));
-               line(lastx, lasty, x1, y1);
-               lastx = x1;
-               lasty = y1;
-               continue;
-
-       case 'f':
-               getw(stdin);
-               getc(stdin);
-               switch(getc(stdin)) {
-               case 't':
-                       linmod = DOTTED;
-                       break;
-               default:
-               case 'i':
-                       linmod = SOLID;
-                       break;
-               case 'g':
-                       linmod = LONGDASHED;
-                       break;
-               case 'r':
-                       linmod = SHORTDASHED;
-                       break;
-               case 'd':
-                       linmod = DOTDASHED;
-                       break;
-               }
-               while((x1=getc(stdin))!='\n')
-                       if(x1==-1) return;
-               continue;
-
-       case 'd':
-               getw(stdin);
-               getw(stdin);
-               getw(stdin);
-               x1 = getw(stdin);
-               while (--x1 >= 0)
-                       getw(stdin);
-               continue;
-
-       case -1:
-               return;
-
-       default:
-               printf("Botch\n");
-               return;
-       }
-}
-
-plotch(c)
-register c;
-{
-       register j;
-       register char *cp;
-       int i;
-
-       if (c<' ' || c >0177)
-               return;
-       cp = chrtab[c-' '];
-       for (i = -16; i<16; i += 2) {
-               c = *cp++;
-               for (j=7; j>=0; --j)
-                       if ((c>>j)&1) {
-                               point(lastx+6-j*2, lasty+i);
-                               point(lastx+7-j*2, lasty+i);
-                               point(lastx+6-j*2, lasty+i+1);
-                               point(lastx+7-j*2, lasty+i+1);
-                       }
-       }
-       lastx += 16;
-}
-
-int    f; /* versatec file number */
-putpict()
-{
-       register x, *ip, *op;
-       int y;
-
-       if (f==0){
-               f = open("/dev/vp0", 1);
-               if (f < 0) {
-                       printf("Cannot open vp\n");
-                       exit(1);
-               }
-               ioctl(f, SETSTATE, plotcom);
-       }
-       op = obuf;
-       lseek(in, 0L, 0);
-       for (y=0; y<2048; y++) {
-               if ((y&077) == 0)
-                       read(in, blocks[0], 32*BSIZ);
-               for (x=0; x<32; x++)  {
-                       ip = (int *)&blocks[x][(y&077)<<3];
-                       *op++ = *ip++;
-                       *op++ = *ip++;
-                       *op++ = *ip++;
-                       *op++ = *ip++;
-               }
-               *op++ = 0;
-               *op++ = 0;
-               *op++ = 0;
-               *op++ = 0;
-               if (y&1) {
-                       write(f, (char *)obuf, sizeof(obuf));
-                       op = obuf;
-               }
-       }
-}
-
-line(x0, y0, x1, y1)
-register x0, y0;
-{
-       int dx, dy;
-       int xinc, yinc;
-       register res1;
-       int res2;
-       int slope;
-
-       xinc = 1;
-       yinc = 1;
-       if ((dx = x1-x0) < 0) {
-               xinc = -1;
-               dx = -dx;
-       }
-       if ((dy = y1-y0) < 0) {
-               yinc = -1;
-               dy = -dy;
-       }
-       slope = xinc*yinc;
-       res1 = 0;
-       res2 = 0;
-       if (dx >= dy) while (x0 != x1) {
-       if((x0+slope*y0)&linmod)
-       if (((x0>>6) + ((y0&~077)>>1)) == bufs[0].bno)
-               bufs[0].block[((y0&077)<<3)+((x0>>3)&07)] |= 1 << (7-(x0&07));
-       else
-               point(x0, y0);
-               if (res1 > res2) {
-                       res2 += dx - res1;
-                       res1 = 0;
-                       y0 += yinc;
-               }
-               res1 += dy;
-               x0 += xinc;
-       } else while (y0 != y1) {
-       if((x0+slope*y0)&linmod)
-       if (((x0>>6) + ((y0&~077)>>1)) == bufs[0].bno)
-               bufs[0].block[((y0&077)<<3)+((x0>>3)&07)] |= 1 << (7-(x0&07));
-       else
-               point(x0, y0);
-               if (res1 > res2) {
-                       res2 += dy - res1;
-                       res1 = 0;
-                       x0 += xinc;
-               }
-               res1 += dx;
-               y0 += yinc;
-       }
-       if((x1+slope*y1)&linmod)
-       if (((x1>>6) + ((y1&~077)>>1)) == bufs[0].bno)
-               bufs[0].block[((y1&077)<<3)+((x1>>3)&07)] |= 1 << (7-(x1&07));
-       else
-               point(x1, y1);
-}
-
-point(x, y)
-register x, y;
-{
-       register bno;
-
-       bno = ((x&03700)>>6) + ((y&03700)>>1);
-       if (bno != bufs[0].bno) {
-               if (bno < 0 || bno >= 1024)
-                       return;
-               getblk(bno);
-       }
-       bufs[0].block[((y&077)<<3)+((x>>3)&07)] |= 1 << (7-(x&07));
-}
-
-getblk(b)
-register b;
-{
-       register struct buf *bp1, *bp2;
-       register char *tp;
-
-loop:
-       for (bp1 = bufs; bp1 < &bufs[NB]; bp1++) {
-               if (bp1->bno == b || bp1->bno == -1) {
-                       tp = bp1->block;
-                       for (bp2 = bp1; bp2>bufs; --bp2) {
-                               bp2->bno = (bp2-1)->bno;
-                               bp2->block = (bp2-1)->block;
-                       }
-                       bufs[0].bno = b;
-                       bufs[0].block = tp;
-                       return;
-               }
-       }
-       zseek(out, bufs[NB-1].bno);
-       write(out, bufs[NB-1].block, BSIZ);
-       zseek(in, b);
-       read(in, bufs[NB-1].block, BSIZ);
-       bufs[NB-1].bno = b;
-       goto loop;
-}
-
-onintr()
-{
-       exit(1);
-}
-
-zseek(a, b)
-{
-       return(lseek(a, (long)b*512, 0));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/pr.c b/.ref-Research-V7/usr/src/cmd/pr.c
deleted file mode 100644 (file)
index ced0dc8..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-/*
- *   print file with headings
- *  2+head+2+page[56]+5
- */
-
-#include <stdio.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-int    ncol    = 1;
-char   *header;
-int    col;
-int    icol;
-FILE   *file;
-char   *bufp;
-#define        BUFS    6720
-char   buffer[BUFS];   /* for multi-column output */
-char   obuf[BUFSIZ];
-#define        FF      014
-int    line;
-char   *colp[72];
-int    nofile;
-char   isclosed[10];
-FILE   *ifile[10];
-char   **lastarg;
-int    peekc;
-int    fpage;
-int    page;
-int    colw;
-int    nspace;
-int    width   = 72;
-int    length  = 66;
-int    plength = 61;
-int    margin  = 10;
-int    ntflg;
-int    mflg;
-int    tabc;
-char   *tty;
-int    mode;
-char   *ttyname();
-char   *ctime();
-
-main(argc, argv)
-char **argv;
-{
-       int nfdone;
-       int onintr();
-
-       setbuf(stdout, obuf);
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, onintr);
-       lastarg = &argv[argc-1];
-       fixtty();
-       for (nfdone=0; argc>1; argc--) {
-               argv++;
-               if (**argv == '-') {
-                       switch (*++*argv) {
-                       case 'h':
-                               if (argc>=2) {
-                                       header = *++argv;
-                                       argc--;
-                               }
-                               continue;
-
-                       case 't':
-                               ntflg++;
-                               continue;
-
-                       case 'l':
-                               length = atoi(++*argv);
-                               continue;
-
-                       case 'w':
-                               width = atoi(++*argv);
-                               continue;
-
-                       case 's':
-                               if (*++*argv)
-                                       tabc = **argv;
-                               else
-                                       tabc = '\t';
-                               continue;
-
-                       case 'm':
-                               mflg++;
-                               continue;
-
-                       default:
-                               ncol = atoi(*argv);
-                               continue;
-                       }
-               } else if (**argv == '+') {
-                       fpage = atoi(++*argv);
-               } else {
-                       print(*argv, argv);
-                       nfdone++;
-                       if (mflg)
-                               break;
-               }
-       }
-       if (nfdone==0)
-               print((char *)0, (char **)0);
-       done();
-}
-
-done()
-{
-
-       if (tty)
-               chmod(tty, mode);
-       exit(0);
-}
-
-onintr()
-{
-
-       if (tty)
-               chmod(tty, mode);
-       _exit(1);
-}
-
-fixtty()
-{
-       struct stat sbuf;
-
-       tty = ttyname(1);
-       if (tty == 0)
-               return;
-       stat(tty, &sbuf);
-       mode = sbuf.st_mode&0777;
-       chmod(tty, 0600);
-}
-
-print(fp, argp)
-char *fp;
-char **argp;
-{
-       extern char *sprintf();
-       struct stat sbuf;
-       register sncol;
-       register char *sheader;
-       register char *cbuf;
-       char linebuf[150], *cp;
-
-       if (ntflg)
-               margin = 0;
-       else
-               margin = 10;
-       if (length <= margin)
-               length = 66;
-       if (width <= 0)
-               width = 72;
-       if (ncol>72 || ncol>width) {
-               fprintf(stderr, "pr: No room for columns.\n");
-               done();
-       }
-       if (mflg) {
-               mopen(argp);
-               ncol = nofile;
-       }
-       colw = width/ncol;
-       sncol = ncol;
-       sheader = header;
-       plength = length-5;
-       if (ntflg)
-               plength = length;
-       if (--ncol<0)
-               ncol = 0;
-       if (mflg)
-               fp = 0;
-       if (fp) {
-               if((file=fopen(fp, "r"))==NULL) {
-                       if (tty==NULL)
-                               fprintf(stderr, "pr: can't open %s\n", fp);
-                       ncol = sncol;
-                       header = sheader;
-                       return;
-               }
-               stat(fp, &sbuf);
-       } else {
-               file = stdin;
-               time(&sbuf.st_mtime);
-       }
-       if (header == 0)
-               header = fp?fp:"";
-       cbuf = ctime(&sbuf.st_mtime);
-       cbuf[16] = '\0';
-       cbuf[24] = '\0';
-       page = 1;
-       icol = 0;
-       colp[ncol] = bufp = buffer;
-       if (mflg==0)
-               nexbuf();
-       while (mflg&&nofile || (!mflg)&&tpgetc(ncol)>0) {
-               if (mflg==0) {
-                       colp[ncol]--;
-                       if (colp[ncol] < buffer)
-                               colp[ncol] = &buffer[BUFS];
-               }
-               line = 0;
-               if (ntflg==0) {
-                       sprintf(linebuf, "\n\n%s %s  %s Page %d\n\n\n",
-                               cbuf+4, cbuf+20, header, page);
-                       for(cp=linebuf;*cp;) put(*cp++);
-               }
-               putpage();
-               if (ntflg==0)
-                       while(line<length)
-                               put('\n');
-               page++;
-       }
-       fclose(file);
-       ncol = sncol;
-       header = sheader;
-}
-
-mopen(ap)
-char **ap;
-{
-       register char **p, *p1;
-
-       p = ap;
-       while((p1 = *p) && p++ <= lastarg) {
-               if((ifile[nofile]=fopen(p1, "r")) == NULL){
-                       isclosed[nofile] = 1;
-                       nofile--;
-               }
-               else
-                       isclosed[nofile] = 0;
-               if(++nofile>=10) {
-                       fprintf(stderr, "pr: Too many args\n");
-                       done();
-               }
-       }
-}
-
-putpage()
-{
-       register int lastcol, i, c;
-       int j;
-
-       if (ncol==0) {
-               while (line<plength) {
-                       while((c = tpgetc(0)) && c!='\n' && c!=FF)
-                               putcp(c);
-                       putcp('\n');
-                       line++;
-                       if (c==FF)
-                               break;
-               }
-               return;
-       }
-       colp[0] = colp[ncol];
-       if (mflg==0) for (i=1; i<=ncol; i++) {
-               colp[i] = colp[i-1];
-               for (j = margin; j<length; j++)
-                       while((c=tpgetc(i))!='\n')
-                               if (c==0)
-                                       break;
-       }
-       while (line<plength) {
-               lastcol = colw;
-               for (i=0; i<ncol; i++) {
-                       while ((c=pgetc(i)) && c!='\n')
-                               if (col<lastcol || tabc!=0)
-                                       put(c);
-                       if (c==0)
-                               continue;
-                       if (tabc)
-                               put(tabc);
-                       else while (col<lastcol)
-                               put(' ');
-                       lastcol += colw;
-               }
-               while ((c = pgetc(ncol)) && c!='\n')
-                       put(c);
-               put('\n');
-       }
-}
-
-nexbuf()
-{
-       register int n;
-       register char *rbufp;
-
-       rbufp = bufp;
-       n = &buffer[BUFS] - rbufp;
-       if (n>512)
-               n = 512;
-       if(feof(file) ||
-          (n=fread(rbufp,1,n,file)) <= 0){
-               fclose(file);
-               *rbufp = 0376;
-       }
-       else {
-               rbufp += n;
-               if (rbufp >= &buffer[BUFS])
-                       rbufp = buffer;
-               *rbufp = 0375;
-       }
-       bufp = rbufp;
-}
-
-tpgetc(ai)
-{
-       register char **p;
-       register int c, i;
-
-       i = ai;
-       if (mflg) {
-               if((c=getc(ifile[i])) == EOF) {
-                       if (isclosed[i]==0) {
-                               isclosed[i] = 1;
-                               if (--nofile <= 0)
-                                       return(0);
-                       }
-                       return('\n');
-               }
-               if (c==FF && ncol>0)
-                       c = '\n';
-               return(c);
-       }
-loop:
-       c = **(p = &colp[i]) & 0377;
-       if (c == 0375) {
-               nexbuf();
-               c = **p & 0377;
-       }
-       if (c == 0376)
-               return(0);
-       (*p)++;
-       if (*p >= &buffer[BUFS])
-               *p = buffer;
-       if (c==0)
-               goto loop;
-       return(c);
-}
-
-pgetc(i)
-{
-       register int c;
-
-       if (peekc) {
-               c = peekc;
-               peekc = 0;
-       } else
-               c = tpgetc(i);
-       if (tabc)
-               return(c);
-       switch (c) {
-
-       case '\t':
-               icol++;
-               if ((icol&07) != 0)
-                       peekc = '\t';
-               return(' ');
-
-       case '\n':
-               icol = 0;
-               break;
-
-       case 010:
-       case 033:
-               icol--;
-               break;
-       }
-       if (c >= ' ')
-               icol++;
-       return(c);
-}
-put(ac)
-{
-       register int ns, c;
-
-       c = ac;
-       if (tabc) {
-               putcp(c);
-               if (c=='\n')
-                       line++;
-               return;
-       }
-       switch (c) {
-
-       case ' ':
-               nspace++;
-               col++;
-               return;
-
-       case '\n':
-               col = 0;
-               nspace = 0;
-               line++;
-               break;
-
-       case 010:
-       case 033:
-               if (--col<0)
-                       col = 0;
-               if (--nspace<0)
-                       nspace = 0;
-
-       }
-       while(nspace) {
-               if (nspace>2 && col > (ns=((col-nspace)|07))) {
-                       nspace = col-ns-1;
-                       putcp('\t');
-               } else {
-                       nspace--;
-                       putcp(' ');
-               }
-       }
-       if (c >= ' ')
-               col++;
-       putcp(c);
-}
-
-putcp(c)
-{
-       if (page >= fpage)
-               putchar(c);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/prep.h b/.ref-Research-V7/usr/src/cmd/prep.h
deleted file mode 100644 (file)
index b7b0da2..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# define NUMC 128
-# define NUMS 3
-# define       NUMA    8
-# define PTRI 1600
-# define CHARI 16000
-# define OUT   3
-
-# define SKIP  0
-# define COLLECT       1
-# define SKIP2 2
-# define WIDTH 6
-struct {
-               char    *beg;
-               int     ct;
-               long    wdno;
-       } temp[30];
-
-int    lflag;
-int    puncfl;
-int    hsw;
-int    san;
-int    t1;
-
-
-
-char   tab[NUMS][NUMC];
-
-int    coll();
-int    save();
-int    hyphen();
-int    hyp1();
-int    hyp2();
-int    error();
-int    ctout();
-int    bsp();
-int    bsp1();
-int    gobble2();
-int    bslash();
-int    punc();
-
-char   line[300];
-int    l;
-int    lno;
-int    c;
-
-int    only;
-int    cs;
-int    (*flag[8])();
-int    fl;
-int    wdflg;
-long   wdnum;
-char   num[WIDTH + 1];
-int    igflg;
-
-struct htab    {
-               int     hsiz;
-               int     ssiz;
-               int     nsym;
-               int     curb;
-               int     *hptr;
-               char    *symt;
-               };
-
-struct htab    itab;
-
-int    ipsp[PTRI];
-char   issp[CHARI];
-
-
-
-FILE   *fi;
diff --git a/.ref-Research-V7/usr/src/cmd/prep/makefile b/.ref-Research-V7/usr/src/cmd/prep/makefile
deleted file mode 100644 (file)
index 5d1d5d3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-CFLAGS = -n -O
-
-all:   prep
-       :
-
-cp:    all
-       cp prep /bin
-       rm prep *.o
-
-cmp:   all
-       cmp prep /bin/prep
-       rm prep *.o
-
-prep:  prep0.o prep1.o prep2.o; cc -s -o prep -n *.o
-
-prep0.o: prep0.c prep.h
-prep1.o: prep1.c prep.h
-prep2.o: prep2.c
diff --git a/.ref-Research-V7/usr/src/cmd/prep/prep.h b/.ref-Research-V7/usr/src/cmd/prep/prep.h
deleted file mode 100644 (file)
index b7b0da2..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# define NUMC 128
-# define NUMS 3
-# define       NUMA    8
-# define PTRI 1600
-# define CHARI 16000
-# define OUT   3
-
-# define SKIP  0
-# define COLLECT       1
-# define SKIP2 2
-# define WIDTH 6
-struct {
-               char    *beg;
-               int     ct;
-               long    wdno;
-       } temp[30];
-
-int    lflag;
-int    puncfl;
-int    hsw;
-int    san;
-int    t1;
-
-
-
-char   tab[NUMS][NUMC];
-
-int    coll();
-int    save();
-int    hyphen();
-int    hyp1();
-int    hyp2();
-int    error();
-int    ctout();
-int    bsp();
-int    bsp1();
-int    gobble2();
-int    bslash();
-int    punc();
-
-char   line[300];
-int    l;
-int    lno;
-int    c;
-
-int    only;
-int    cs;
-int    (*flag[8])();
-int    fl;
-int    wdflg;
-long   wdnum;
-char   num[WIDTH + 1];
-int    igflg;
-
-struct htab    {
-               int     hsiz;
-               int     ssiz;
-               int     nsym;
-               int     curb;
-               int     *hptr;
-               char    *symt;
-               };
-
-struct htab    itab;
-
-int    ipsp[PTRI];
-char   issp[CHARI];
-
-
-
-FILE   *fi;
diff --git a/.ref-Research-V7/usr/src/cmd/prep/prep0.c b/.ref-Research-V7/usr/src/cmd/prep/prep0.c
deleted file mode 100644 (file)
index 7395b84..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-# include <stdio.h>
-# include "prep.h"
-
-int    (*acts[])() =   {0,
-                       coll,
-                       save,
-                       ctout,
-                       gobble2,
-                       hyphen,
-                       bsp,
-                       bslash,
-                       punc
-                       };
-
-
-char   *ignonl = "/usr/lib/eign";
-
-char tab[NUMS][NUMC] = {
-
-/*SKIP*/
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 3, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 8, 0, 0, 0, 0, 0, 0,
-       8, 8, 0, 0, 8, 0, 8, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 8, 8, 0, 0, 0, 8,
-       0, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 0, 7, 0, 0, 0,
-       0, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 0, 0, 0, 0, 0,
-/*COLLECT*/
-       2, 2, 2, 2, 2, 2, 2, 2,
-       6, 2, 3, 2, 2, 2, 2, 2,
-       2, 2, 2, 2, 2, 2, 2, 2,
-       2, 2, 2, 2, 2, 2, 2, 2,
-       2, 8, 2, 2, 2, 2, 2, 0,
-       8, 8, 2, 2, 8, 5, 8, 2,
-       2, 2, 2, 2, 2, 2, 2, 2,
-       2, 2, 8, 8, 2, 2, 2, 8,
-       2, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 2, 7, 2, 2, 2,
-       2, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 2, 2, 2, 2, 2,
-/*SKIP2*/
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 3, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 8, 0, 0, 0, 0, 0, 0,
-       8, 8, 0, 0, 8, 0, 8, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 8, 8, 0, 0, 0, 8,
-       0, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 0, 0, 0, 0, 0,
-       0, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       1, 1, 1, 0, 0, 0, 0, 0
-};
-
-main(argc,argv)
-       char    *argv[];
-{
-       auto    i,j;
-
-       if(argc > 1 && *argv[1] == '-') {
-               j = flags(argv);
-               argv += j;
-               argc -= j;
-       }
-
-       init();
-
-       i = 0;
-       if(argc == 1) {
-               fi = stdin;
-               goto pipe;
-       }
-       while(++i < argc) {
-
-               if((fi = fopen(argv[i], "r")) == NULL) {
-                       fprintf(stderr, "Can't open %s\n",argv[i]);
-                       exit(1);
-               }
-
-pipe:
-               lno = 1;
-
-               driver(argv[i]);
-
-               fclose(fi);
-       }
-       flsh();
-
-       exit(0);
-}
-
-driver(arg)
-char   *arg;
-{
-       auto    p;
-
-       l = -1;
-       while((c = line[++l] = getc(fi)) != -1) {
-/*     fprintf(stderr, "driver: c = %o l = %d\n",c,l); /*DEBUG*/
-               if(l >= 299) {
-                       lflag++;
-                       l--;
-               }
-
-               if(c & 0200) {
-                       fprintf(stderr, "Illegal character: %o line %d file %s\n",
-                               c, lno, arg);
-                       exit(1);
-               }
-
-               if(l == 0 && (c == '.' || c == '\'')) {
-                       while((c = getc(fi)) != '\n' )
-                               if(c == -1)     return;
-                       lno++;
-                       l = -1;
-                       continue;
-               }
-
-               if(fl) {
-                       if((*flag[fl])())
-                               continue;
-               }
-
-/*fprintf(stderr, "cs = %d cc = %c ca = %d\n",cs,c,tab[cs][c]);        /*DEBUG*/
-
-               if(p = tab[cs][c])
-                       (*acts[p])();
-               continue;
-       }
-       return;
-
-}
-
-init()
-{
-       FILE    *fio, *fopen();
-       extern  coll(),save(),ctout(),asym(),asw(),csym(),csw();
-       extern  incl(),decl(),sk(),sk2();
-
-
-       if(!igflg)return;
-
-       itab.hptr = ipsp;
-       itab.symt = issp;
-       itab.hsiz = PTRI;
-       itab.ssiz = CHARI;
-       itab.nsym = 0;
-       itab.curb = 1;
-
-       if((fio = fopen(ignonl, "r")) == NULL) {
-               fprintf(stderr, "Cannot open ignore/only file.\n");
-               exit(1);
-       }
-       compile(fio);
-       return;
-}
-
-
-flags(argv)
-       char    *argv[];
-{
-       int     j;
-       char    *ap;
-
-       j = 1;
-       ap = argv[1];
-       while(*++ap != '\0') {
-               switch(*ap) {
-
-                       default:
-                               fprintf(stderr, "Unrecognized flag: %c\n",*ap);
-                               exit(1);
-
-
-                       case 'i':       /* Ignore file */
-                               if(!igflg) {
-                                       igflg = 1;
-                                       only = 0;
-                                       ignonl = argv[++j];
-                               }
-                               continue;
-
-                       case 'o':       /*only file*/
-                               if(!igflg) {
-                                       igflg = 1;
-                                       only = 1;
-                                       ignonl = argv[++j];
-                               }
-                               continue;
-                       case 'd':       /*word number*/
-                               wdflg = 1;
-                               wdnum = 0;
-                               num[WIDTH] = ' ';
-                               continue;
-
-                       case 'p':
-                               puncfl = 1;
-                               continue;
-               }
-
-       }
-       return(j);
-}
-compile(fio)
-FILE   *fio;
-{
-       char    buf[40],*b;
-       int     i,v;
-
-
-       b = buf - 1;
-       while((i = *++b = getc(fio)) != EOF) {
-               if(*b == '\n') {
-                       *b = '\0';
-                       search(buf,b - buf,&itab,1);
-                       b = buf - 1;
-               } else {
-                       if(*b == '\t') {
-                               v = 0;
-                               while((i = getc(fio)) != -1) {
-                                       if(i == '\n')   break;
-                                       v = v*10 + (i - '0');
-                               }
-                               search(buf,b - buf,&itab,v);
-                               b = buf - 1;
-                       } else {
-                               if((b - buf) > 39) {
-                                       fprintf(stderr, "Ignore/only symbol too long.\n");
-                                       exit(1);
-                               }
-                       }
-               }
-       }
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/prep/prep1.c b/.ref-Research-V7/usr/src/cmd/prep/prep1.c
deleted file mode 100644 (file)
index fd1aa54..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-# include <stdio.h>
-# include "prep.h"
-# define SKIP 0
-# define COLLECT 1
-# define SKIP2 2
-
-int    tlno = 1;
-
-coll()
-{
-       cs = COLLECT;
-       temp[t1].beg = &line[l];
-       return;
-}
-
-save()
-{
-       extern  only;
-       char    *pt1,*pt2,cbuf[30];
-       int     val;
-
-       if(cs != COLLECT) {
-               cs = SKIP;
-               return;
-       }
-       cs = SKIP;
-       line[l] = '\0';
-       temp[t1].ct = &line[l] - temp[t1].beg;
-       pt1 = temp[t1].beg-1;
-       pt2 = cbuf-1;
-
-       wdnum++;
-       while(*++pt2 = *++pt1)
-               if(*pt2 >= 'A' && *pt2 <= 'Z')
-                       *pt2 |= 040;
-
-       if(igflg){
-               val = search(cbuf,temp[t1].ct,&itab,0);
-               if(!val == !only) goto yes;
-
-               line[l] = c;
-               return;
-       }
-yes:
-       temp[t1++].wdno = wdnum;
-       line[l] = c;
-       return;
-}
-
-ctout()
-{
-       register int    ct;
-       register char   *t2;
-       int     t3;
-       long    xxx;
-
-       if(lflag) {
-               fprintf(stderr, "line too long:  line %d\n",lno);
-               lflag = 0;
-       }
-       if(cs == COLLECT)       save();
-
-       t3 = t1;
-       t1 = -1;
-       while(++t1 < t3) {
-               if(wdflg){
-                       xxx = temp[t1].wdno;
-                       conf(xxx, WIDTH, num);
-                       put(num,WIDTH+1);
-               }
-               ct = temp[t1].ct;
-               t2 = temp[t1].beg - 1;
-/*             fprintf(stderr, "out: %s        %d\n", temp[t1].beg, ct);       /*DEBUG*/
-               while(ct--)
-                       if(*++t2 >= 'A' && *t2 <= 'Z')
-                               *t2 |= 040;
-
-               ct = temp[t1].ct;
-               while(*--t2 == '\'' && san == 0)
-                       ct--;
-
-               put(temp[t1].beg, ct);
-               put("\n", 1);
-       }
-       t1 = 0;
-       l = -1;
-       lno += tlno;
-       tlno = 1;
-       cs = SKIP;
-       return;
-}
-
-conf(n,width,buf) 
-       long n;
-       char    *buf;
-{
-       long    a;
-       auto i;
-
-       i = width;
-       while(i--)      buf[i] = ' ';
-
-       a = n/10;
-       if(a)
-               width = conf(a, --width, buf);
-       else
-               width--;
-       buf[width] = n%10 + '0';
-
-       return(++width);
-}
-
-hyphen()
-{
-/*     fprintf(stderr, "hyphen\n");    /*DEBUG*/
-       flag[++fl] = hyp1;
-       return(1);
-}
-
-hyp1()
-{
-/*     fprintf(stderr, "hyp1 c = %o\n",c);     /*DEBUG*/
-       if(c !=  '\n') {
-               fl--;
-               l--;
-               save();
-               l++;
-               punc();
-               return(0);
-       } else {
-               l -= 2;
-               flag[fl] = hyp2;
-               hsw = 1;
-               return(1);
-       }
-}
-
-hyp2()
-{
-       extern  (*acts[])();
-/*     fprintf(stderr, "hyp2 c = %o l = %d\n",c,l);    /*DEBUG*/
-       if(hsw && (tab[2][c] == 0)) {
-               l--;
-               if(c == '\n')   tlno++;
-               return(1);
-       }
-       hsw = 0;
-       if(c == '\n'){
-               l--;
-               return(1);
-       }
-       if(tab[cs][c]) {
-               line[l] = '\n';
-               (*acts[OUT])();
-               fl--;
-               return(0);
-       }
-       return(1);
-}
-
-gobble2()
-{
-       static  ct2;
-
-       if(cs == COLLECT)       save();
-
-       if(flag[fl] != gobble2) {
-               ct2 = 1;
-               flag[++fl] = gobble2;
-               return(1);
-       }
-       if(ct2--)       return(1);
-
-       fl--;
-       cs = SKIP;
-       return(1);
-}
-
-bslash()
-{
-       if(cs == COLLECT)       save();
-       cs = SKIP2;
-       return(1);
-}
-
-bsp()
-{
-       flag[++fl] = bsp1;
-       return(1);
-}
-
-bsp1()
-{
-       fl--;
-       if(c == '"')    return(1);
-
-       line[--l] = c;
-       return(0);
-}
-
-punc()
-{
-
-       if(cs == COLLECT)
-               save();
-       if(puncfl) {
-               temp[t1].beg = &line[l];
-               temp[t1].ct = 1;
-               temp[t1++].wdno = 0;
-       }
-}
-
-search(symbol,length,params,install)
-       char    *symbol;
-       int     length;
-       struct  htab    *params;
-       int     install;
-{
-       char    *sp,*p;
-       static  int     *hptr,hsiz,nsym;
-       static  int     ssiz;
-       static  int     curb;
-       static  char    *symt;
-       auto    h,i,j;
-
-       if(hptr != params->hptr) {
-               hptr = params->hptr;
-               hsiz = params->hsiz;
-               symt = params->symt;
-               ssiz = params->ssiz;
-               curb = params->curb;
-               nsym = params->nsym;
-       }
-
-       symbol[length] = '\0';
-/*fprintf(stderr, "ssiz = %d; nsym = %d; %s\n", ssiz, nsym, symbol);/*DEBUG*/
-       sp = symbol;
-
-       i = length;
-       h = 1;
-       while(i--)
-               h *= *sp++;
-
-       if(h == 0100000) {
-               h = 1;
-       } else {
-               h = h<0?(-h)%hsiz:h%hsiz;
-       }
-       if(h == 0)      h++;
-/*             fprintf(stderr, "%s %d\n",symbol,h);    /*DEBUG*/
-
-       while((p = &symt[hptr[h]]) > symt) {
-               j = length + 2;
-               sp = symbol;
-               while(--j) {
-                       if(*p++ != *sp++)       goto no;
-               }
-               return(*p);
-no:
-               h++;
-               if(h >= hsiz)   h -= hsiz;
-       }
-       if(install) {
-               if(++nsym >= hsiz) {
-                       fprintf(stderr, "Too many symbols in ignore/only file.\n");
-                       exit(1);
-               }
-
-               hptr[h] = curb;
-               length++;
-               if((curb + length) >= ssiz) {
-                       fprintf(stderr, "i/o file too big; ssiz = %d\n", ssiz);
-                       exit(1);
-               }
-
-               while(length--)
-                       symt[curb++] = *symbol++;
-               symt[curb++] = install;
-               params->curb = curb;
-               params->nsym = nsym;
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/prep/prep2.c b/.ref-Research-V7/usr/src/cmd/prep/prep2.c
deleted file mode 100644 (file)
index 6eaf72b..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-int    optr;
-
-char   obuf[512];
-
-int    nflush;
-
-put(string,n)
-       char    *string;
-{
-       int     i;
-       char    *o;
-
-/*printf("%c %d\n",*string,n);/*DEBUG*/
-
-       string--;
-
-       if((i = optr + n - 512) >= 0) {
-               n -= i;
-               o = &obuf[optr] -1;
-               while(--n >= 0)
-                       *++o = *++string;
-               optr = 512;
-               flsh();
-               n = i;
-       }
-
-       o = &obuf[optr] - 1;
-       optr += n;
-
-       while(--n >= 0) {
-               *++o = *++string;
-       }
-       return(0);
-}
-
-flsh()
-{
-
-       if(optr <= 0)   return(optr);
-
-       nflush++;
-       if(write(1,obuf,optr) != optr)
-               return(-1);
-       optr = 0;
-       return(0);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/primes.s b/.ref-Research-V7/usr/src/cmd/primes.s
deleted file mode 100644 (file)
index ad80946..0000000
+++ /dev/null
@@ -1,355 +0,0 @@
-ldfps = 170100^tst
-/
-       ldfps   $240
-
-       clr     argflg
-       cmp     (sp)+,$2
-       blt     begin
-       tst     (sp)+
-       mov     (sp),r2
-       jsr     r5,atof; getch1
-       inc     argflg
-       br      begin1
-begin:
-       tst     argflg
-       beq 9f; sys exit; 9:
-       jsr     r5,atof; getch
-begin1:
-       tstf    fr0
-       cfcc
-       bpl 9f; jmp ouch; 9:
-       bne 9f; sys exit; 9:
-       cmpf    big,fr0
-       cfcc
-       bgt 9f; jmp ouch; 9:
-/
-       movf    $f100,fr1
-       cmpf    fr0,fr1
-       cfcc
-       bge     1f
-       mov     $pt,r3
-3:
-       cmp     r3,$ptend
-       bhis    1f
-       movif   (r3)+,fr1
-       cmpf    fr1,fr0
-       cfcc
-       blt     3b
-       tst     -(r3)
-3:
-       movif   (r3),fr0
-       jsr     r5,ftoa; wrchar
-       mov     $'\n,r0
-       jsr     r5,wrchar
-       tst     (r3)+
-       cmp     r3,$ptend
-       blo     3b
-       movf    $f100,fr0
-/
-1:
-       divf    $two,fr0
-       modf    $one,fr0
-       movf    fr1,fr0
-       mulf    $two,fr0
-       addf    $one,fr0
-       movif   $tsiz8,fr1
-       movf    fr1,fr5
-       movf    fr0,nn
-/
-/
-/
-/      clear the sieve table
-/
-2:
-       mov     $table,r3
-3:
-       cmp     r3,$table+tabsiz
-       bhis    3f
-       clrb    (r3)+
-       br      3b
-/
-/      run the sieve
-/
-3:
-       movf    nn,fr0
-       addf    fr5,fr0
-       jsr     r5,sqrt
-       movf    fr0,v
-/
-       movf    nn,fr0
-       movif   $3.,fr1
-       jsr     pc,5f
-       movif   $5.,fr1
-       jsr     pc,5f
-       movif   $7.,fr1
-       jsr     pc,5f
-       movif   $11.,fr1
-       mov     $factab+2,r4
-4:
-       jsr     pc,5f
-       mov     (r4)+,kazoo
-kazoo  =.+2
-       addf    $kazoo,fr1
-       cmp     r4,$ftabend
-       blo     3f
-       mov     $factab,r4
-3:
-       cmpf    v,fr1
-       cfcc
-       bge     4b
-       br      1f
-/
-/
-5:
-       movf    fr0,fr2
-       divf    fr1,fr2
-       modf    $one,fr2
-       mulf    fr1,fr3
-       subf    fr0,fr3
-       cfcc
-       bpl     3f
-       addf    fr1,fr3
-3:
-       cmpf    fr5,fr3
-       cfcc
-       ble     3f
-       movfi   fr3,r0
-       ashc    $-3.,r0
-       ash     $-13.,r1
-       bic     $177770,r1
-       bisb    bittab(r1),table(r0)
-       addf    fr1,fr3
-       br      3b
-3:
-       rts     pc
-/
-/
-/      get one character form the argument string.
-getch1:
-       movb    (r2)+,r0
-       rts     r5
-/
-/      now get the primes from the table
-/      and print them.
-/
-1:
-/
-       movf    nn,fr0
-       clr     r3
-       br      4f
-/
-1:
-       inc     r3
-       inc     r3
-       cmp     r3,$tsiz8
-       bge     2b
-/
-4:
-/
-       jsr     pc,prime
-       bec     3f
-       movf    nn,fr0
-       jsr     r5,ftoa; wrchar
-       mov     $'\n,r0
-       jsr     r5,wrchar
-3:
-       movf    nn,fr0
-       addf    $two,fr0
-       movf    fr0,nn
-       br      1b
-/
-/
-/
-/
-prime:
-       mov     r3,r4
-       ashc    $-3.,r4
-       ash     $-13.,r5
-       bic     $177770,r5
-       bitb    bittab(r5),table(r4)
-       bne     1f
-       sec
-1:
-       rts     pc
-/
-/
-/
-/
-one    = 40200
-half   = 40000
-opower = 34400
-power  = 44000
-f100   = 41710
-/
-/      get one character from the console.
-/      called from atof.
-/
-getch:
-       clr     r0
-       sys     read; ch; 1
-       bec 9f; sys exit; 9:
-       tst r0; bne 9f; sys exit; 9:
-       mov     ch,r0
-       rts     r5
-/
-/
-/      write one character on the console
-/      called from ftoa.
-/
-wrchar:
-       tst     iobuf
-       bne     1f
-       mov     $iobuf+2,iobuf
-1:
-       movb    r0,*iobuf
-       inc     iobuf
-       cmp     iobuf,$iobuf+514.
-       blo     1f
-       mov     $1,r0
-       sys     write; iobuf+2; 512.
-       mov     $iobuf+2,iobuf
-1:
-       rts     r5
-/
-       .bss
-iobuf: .=.+518.
-       .text
-/
-/
-/      read and convert a line from the console into fr0.
-/
-atof:
-       mov     r1,-(sp)
-       movif   $10.,r3
-       clrf    r0
-1:
-       jsr     r5,*(r5)
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     2f
-       mulf    r3,r0
-       movif   r0,r1
-       addf    r1,r0
-       br      1b
-2:
-       cmp     r0,$' -'0
-       beq     1b
-/
-       mov     (sp)+,r1
-       tst     (r5)+
-       rts     r5
-/
-/
-ftoa:
-       mov     $ebuf,r2
-1:
-       movf    fr0,fr1
-       divf    $ten,fr1
-       movf    fr1,fr2
-       modf    $one,fr2
-       movf    fr3,-(sp)
-       mulf    $ten,fr3
-       negf    fr3
-       addf    fr0,fr3
-       movfi   fr3,-(r2)
-       movf    (sp)+,fr0
-       tstf    fr0
-       cfcc
-       bne     1b
-1:
-       mov     (r2)+,r0
-       add     $60,r0
-       jsr     r5,*(r5)
-       cmp     r2,$ebuf
-       blo     1b
-       tst     (r5)+
-       rts     r5
-/
-/
-/
-/      replace the f.p. number in fr0 by its square root
-/
-sqrt:
-       movf    r0,r1           / a
-       tstf    fr0
-       cfcc
-       beq     2f
-       bgt     1f
-       sec
-       rts     r5              / sqrt(-a)
-1:
-       seti
-       movf    fr0,-(sp)
-       asr     (sp)
-       add     $20100,(sp)
-       movf    (sp)+,fr0
-       movif   $2,r3           / constant 2
-       mov     $4,r0
-1:
-       movf    r1,r2
-       divf    r0,r2
-       addf    r2,r0
-       divf    r3,r0           / x = (x+a/x)/2
-       dec     r0
-       bgt     1b
-2:
-       clc
-       rts     r5
-/
-/
-buf:   .=.+38.
-ebuf:
-/
-/
-/
-/      complain about a number which the program
-/      is unable to digest
-ouch:
-       mov     $2,r0
-       sys     write; 1f; 2f-1f
-       jmp     begin
-/
-1:     <Ouch.\n>
-2:     .even
-/
-/
-one    = 40200
-two    = 40400
-four   = 40600
-six    = 40700
-ten    = 41040
-/
-       .data
-bittab:        .byte   1, 2, 4, 10, 20, 40, 100, 200
-big:   056177; 177777; 177777; 177777
-/
-pt:    2.; 3.; 5.; 7.; 11.; 13.; 17.; 19.; 23.; 29.; 31.; 37.; 41.; 43.
-       47.; 53.; 59.; 61.; 67.; 71.; 73.; 79.; 83.; 89.; 97.
-ptend:
-nl:    <\n>
-sp5:   <     >
-       .even
-/
-/
-factab:
-       41040; 40400; 40600; 40400; 40600; 40700; 40400; 40700
-       40600; 40400; 40600; 40700; 40700; 40400; 40700; 40600
-       40400; 40700; 40600; 40700; 41000; 40600; 40400; 40600
-       40400; 40600; 41000; 40700; 40600; 40700; 40400; 40600
-       40700; 40400; 40700; 40700; 40600; 40400; 40600; 40700
-       40400; 40700; 40600; 40400; 40600; 40400; 41040; 40400
-ftabend:
-/
-       .bss
-ch:    .=.+2
-t:     .=.+8
-n:     .=.+8
-v:     .=.+8
-nn:    .=.+8
-place: .=.+8
-/
-tabsiz = 1000.
-tsiz8  = 8000.
-table: .=.+tabsiz
-argflg:        .=.+2
-       .text
diff --git a/.ref-Research-V7/usr/src/cmd/prof.c b/.ref-Research-V7/usr/src/cmd/prof.c
deleted file mode 100644 (file)
index 696e8bb..0000000
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- *  Print execution profile
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <a.out.h>
-
-typedef        short UNIT;             /* unit of profiling */
-
-struct stat stbuf;
-struct nl {
-       char    name[8];
-       unsigned value;
-       float   time;
-       long    ncall;
-};
-
-struct hdr {
-       UNIT    *lowpc;
-       UNIT    *highpc;
-       int     ncount;
-};
-
-struct nl nl[1200];
-
-struct cnt {
-       unsigned cvalue;
-       long    cncall;
-} cbuf[350];
-
-FILE   *pfile, *nfile;
-unsigned highpc;
-unsigned lowpc;
-double ransca;
-double ranoff;
-unsigned pcl;
-unsigned pch;
-unsigned bufs;
-int    nname;
-double ftime;
-double actime;
-double totime;
-double maxtime;
-double scale;
-double lastx;
-double lasty;
-struct nl *np;
-struct nl *npe;
-int    aflg;
-int    vflg;
-int    lflg;
-long   symoff;
-
-main(argc, argv)
-char **argv;
-{
-       char *namfil;
-       int timcmp(), valcmp();
-       int i, overlap;
-       long pfpos;
-       double lastsx;
-       struct cnt *cp;
-       double tx, ty;
-       struct exec xbuf;
-       struct hdr h;
-
-       lowpc = -1;
-       highpc = -1;
-       argv++;
-       namfil = "a.out";
-       while (argc>1) {
-               if (**argv == '-') {
-                       if (*++*argv == 'l')
-                               lflg++;
-                       if (**argv == 'a')
-                               aflg = 040;
-                       if(**argv == 'v')
-                               vflg++;
-                       if(**argv >= '0' && **argv <= '9') {
-                               i = atoi(*argv);
-                               if(lowpc == -1)
-                                       lowpc = i;
-                               else
-                                       highpc = i;
-                       }
-               } else
-                       namfil = *argv;
-               argc--;
-               argv++;
-       }
-       if (lowpc >= 100)
-               lowpc = 0;
-       if(highpc <= lowpc || highpc > 100)
-               highpc = 100;
-       ransca = 100./(highpc-lowpc);
-       ranoff = 2040. + 40.8*lowpc*ransca;
-       if((nfile=fopen(namfil,"r"))==NULL) {
-               fprintf(stderr, "%s: not found\n", namfil);
-               done();
-       }
-       fread((char *)&xbuf, 1, sizeof(xbuf), nfile);
-       if (xbuf.a_magic!=A_MAGIC1 && xbuf.a_magic!=A_MAGIC2 && xbuf.a_magic!=A_MAGIC3) {
-               fprintf(stderr, "%s: bad format\n", namfil);
-               done();
-       }
-       symoff = (long)xbuf.a_text + xbuf.a_data;
-       if ((xbuf.a_flag&01) == 0)
-               symoff *= 2;
-       fseek(nfile, symoff+sizeof(xbuf), 0);
-       if((pfile = fopen("mon.out","r")) == NULL) {
-               fprintf(stderr, "No mon.out\n");
-               done();
-       }
-       fstat(fileno(pfile), &stbuf);
-       fread((char *)&h, sizeof(struct hdr), 1, pfile);
-       lowpc = h.lowpc - (UNIT *)0;
-       highpc = h.highpc - (UNIT *)0;
-       bufs = stbuf.st_size - sizeof(struct hdr) - h.ncount*sizeof(struct cnt);
-       fread((char *)cbuf, sizeof(struct cnt), h.ncount, pfile);
-       pfpos = ftell(pfile);
-       npe = nl;
-       for (nname = 0; xbuf.a_syms > 0; xbuf.a_syms -= sizeof(struct nlist)) {
-               struct nlist nbuf;
-               fread((char *)&nbuf, sizeof(nbuf), 1, nfile);
-               if (nbuf.n_type!=N_TEXT && nbuf.n_type!=N_TEXT+N_EXT)
-                       continue;
-               if (aflg==0 && nbuf.n_type!=N_TEXT+N_EXT)
-                       continue;
-               npe->value = nbuf.n_value/sizeof(UNIT);
-               for (i=0; i<8; i++)
-                       npe->name[i] = nbuf.n_name[i];
-               npe++;
-               nname++;
-       }
-       if (nname == 0) {
-               fprintf(stderr, "%s: no symbols\n", namfil);
-               done();
-       }
-       npe->value = -1;
-       npe++;
-       for (cp = cbuf; cp < &cbuf[h.ncount]; cp++)
-               for (np = nl; np < npe; np++)
-                       if ((unsigned)(cp->cvalue/sizeof(UNIT) - np->value) <=10) {
-                               np->ncall = cp->cncall;
-                               break;
-                       }
-       qsort(nl, nname, sizeof(struct nl), valcmp);
-       scale = highpc - lowpc;
-       scale /= bufs/sizeof(UNIT);
-       for(i=0;;i++) {
-               register j;
-               unsigned UNIT ccnt;
-               fread((char *)&ccnt, sizeof(ccnt), 1, pfile);
-               if(feof(pfile))
-                       break;
-               if (ccnt == 0)
-                       continue;
-               pcl = lowpc + scale*i;
-               pch = lowpc + scale*(i+1);
-               ftime = ccnt;
-               totime += ftime;
-               if(ftime > maxtime)
-                       maxtime = ftime;
-               for (j=0; j<nname; j++) {
-                       if (pch < nl[j].value)
-                               break;
-                       if (pcl >= nl[j+1].value)
-                               continue;
-                       overlap=(min(pch,nl[j+1].value)-max(pcl,nl[j].value));
-                       nl[j].time += overlap*ftime/scale;
-               }
-       }
-       if (totime==0.0) {
-               fprintf(stderr, "No time accumulated\n");
-               done();
-       }
-#ifdef plot
-       if(!vflg)
-               goto print;
-       openpl();
-       erase();
-       space(-2048, -2048, 2048, 2048);
-       line(-2040, -2040, -2040, 2040);
-       line(0, 2040, 0, -2040);
-       for(i=0; i<11; i++)
-               line(-2040, 2040-i*408, 0, 2040-i*408);
-       lastx = 0.;
-       lasty = ranoff;
-       scale = (4080.*ransca)/(bufs/sizeof(UNIT));
-       fclose(pfile);  /*to turn off eof*/
-       pfile = fopen("mon.out", "r");
-       fseek(pfile, pfpos, 0);
-       lastsx = 0.0;
-       for(;;) {
-               unsigned UNIT ccnt;
-               fread((char *)&ccnt, sizeof(ccnt), 1, pfile);
-               if(feof(pfile))
-                       break;
-               ftime = ccnt;
-               tx = lastsx;
-               ty = lasty;
-               lastsx -= 2000.*ftime/totime;
-               lasty -= scale;
-               if(lasty >= -2040. && ty <= 2040.) {
-                       line((int)tx, (int)ty, (int)lastsx, (int)lasty);
-                       if (ccnt!=0 || lastx!=0.0) {
-                               tx = lastx;
-                               lastx = -ftime*2000./maxtime;
-                               ty += scale/2;
-                               line(0, (int)ty, (int)tx, (int)ty);
-                       }
-               }
-       }
-       scale = (4080.*ransca)/(highpc-lowpc);
-       lastx = 50.;
-       for(np = nl; np<npe;  np++) {
-               if(np->value < lowpc)
-                       continue;
-               if(np->value >= highpc)
-                       continue;
-               ftime = np->time/totime;
-               lasty = ranoff - (np->value - lowpc)*scale;
-               if(lasty >= -2040. && lasty <= 2040.) {
-                       char bufl[8+3], *namp;
-                       register j;
-                       line(0, (int)lasty, 50, (int)lasty);
-                       line((int)(lastx-50),(int)lasty,(int)lastx,(int)lasty);
-                       point((int)(lastx+30), (int)(lasty+10));
-                       namp = bufl;
-                       for(j=0; j<8; j++)
-                               if(np->name[j] != '_')
-                                       *namp++ = np->name[j];
-                       *namp++ = '\n';
-                       *namp++ = 0;
-                       label(bufl);
-               }
-               lastx += 500.;
-               if(lastx > 2000.)
-                       lastx = 50.;
-       }
-       done();
-
-print:
-#endif
-       actime = 0;
-       printf("    name %%time  cumsecs  #call  ms/call\n");
-       if (!lflg)
-               qsort(nl, nname, sizeof(struct nl), timcmp);
-       for (np = nl; np<npe-1; np++) {
-               ftime = np->time/totime;
-               actime += np->time;
-               printf("%8.8s%6.1f%9.2f", np->name, 100*ftime, actime/60);
-               if(np->ncall!=0) {
-                       printf("%6ld", np->ncall);
-                       printf(" %7.2f\n", np->time/(np->ncall*.06));
-               } else
-                       printf("\n");
-       }
-       done();
-}
-
-min(a, b)
-unsigned a, b;
-{
-       if (a<b)
-               return(a);
-       return(b);
-}
-
-max(a, b)
-unsigned a, b;
-{
-       if (a>b)
-               return(a);
-       return(b);
-}
-
-valcmp(p1, p2)
-struct nl *p1, *p2;
-{
-       return(p1->value - p2->value);
-}
-
-timcmp(p1, p2)
-struct nl *p1, *p2;
-{
-       float d;
-
-       d = p2->time - p1->time;
-       if (d > 0.0)
-               return(1);
-       if (d < 0.0)
-               return(-1);
-       return(0);
-}
-
-done()
-{
-
-#ifdef plot
-       if(vflg) {
-               point(0, -2040);
-               closepl();
-       }
-#endif
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ps.c b/.ref-Research-V7/usr/src/cmd/ps.c
deleted file mode 100644 (file)
index a5e2bb7..0000000
+++ /dev/null
@@ -1,400 +0,0 @@
-/*
- *     ps - process status
- *     examine and print certain things about processes
- */
-
-#include <stdio.h>
-#include <a.out.h>
-#include <core.h>
-#include <sys/param.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/dir.h>
-#include <sys/user.h>
-
-struct nlist nl[] = {
-       { "_proc" },
-       { "_swapdev" },
-       { "_swplo" },
-       { "" },
-};
-
-struct proc mproc;
-
-struct user u;
-int    chkpid;
-int    retcode=1;
-int    lflg;
-int    vflg;
-int    kflg;
-int    xflg;
-char   *tptr;
-long   lseek();
-char   *gettty();
-char   *getptr();
-char   *strncmp();
-int    aflg;
-int    mem;
-int    swmem;
-int    swap;
-daddr_t        swplo;
-
-int    ndev;
-struct devl {
-       char    dname[DIRSIZ];
-       dev_t   dev;
-} devl[256];
-
-char   *coref;
-
-main(argc, argv)
-char **argv;
-{
-       int i;
-       char *ap;
-       int uid, puid;
-
-       if (argc>1) {
-               ap = argv[1];
-               while (*ap) switch (*ap++) {
-
-               case 'v':
-                       vflg++;
-                       break;
-
-               case 'a':
-                       aflg++;
-                       break;
-
-               case 't':
-                       if(*ap)
-                               tptr = ap;
-                       aflg++;
-                       if (*tptr == '?')
-                               xflg++;
-                       goto bbreak;
-
-               case 'x':
-                       xflg++;
-                       break;
-
-               case '-':
-                       break;
-
-               case 'l':
-                       lflg++;
-                       break;
-
-               case 'k':
-                       kflg++;
-                       break;
-
-               default:
-                       chkpid = atoi(ap-1);
-                       goto bbreak;
-                       break;
-               }
-       }
-
-bbreak:
-       if(chdir("/dev") < 0) {
-               fprintf(stderr, "Can't change to /dev\n");
-               exit(1);
-       }
-       nlist(argc>2? argv[2]:"/unix", nl);
-       if (nl[0].n_type==0) {
-               fprintf(stderr, "No namelist\n");
-               exit(1);
-       }
-       coref = "/dev/mem";
-       if(kflg)
-               coref = "/usr/sys/core";
-       if ((mem = open(coref, 0)) < 0) {
-               fprintf(stderr, "No mem\n");
-               exit(1);
-       }
-       swmem = open(coref, 0);
-       /*
-        * read mem to find swap dev.
-        */
-       lseek(mem, (long)nl[1].n_value, 0);
-       read(mem, (char *)&nl[1].n_value, sizeof(nl[1].n_value));
-       /*
-        * Find base of swap
-        */
-       lseek(mem, (long)nl[2].n_value, 0);
-       read(mem, (char *)&swplo, sizeof(swplo));
-       /*
-        * Locate proc table
-        */
-       lseek(mem, (long)nl[0].n_value, 0);
-       getdev();
-       uid = getuid();
-       if (lflg)
-       printf(" F S UID   PID  PPID CPU PRI NICE  ADDR  SZ  WCHAN TTY TIME CMD\n"); else
-               if (chkpid==0) printf("   PID TTY TIME CMD\n");
-       for (i=0; i<NPROC; i++) {
-               read(mem, (char *)&mproc, sizeof mproc);
-               if (mproc.p_stat==0)
-                       continue;
-               if (mproc.p_pgrp==0 && xflg==0 && mproc.p_uid==0)
-                       continue;
-               puid = mproc.p_uid;
-               if ((uid != puid && aflg==0) ||
-                   (chkpid!=0 && chkpid!=mproc.p_pid))
-                       continue;
-               if(prcom(puid)) {
-                       printf("\n");
-                       retcode=0;
-               }
-       }
-       exit(retcode);
-}
-
-getdev()
-{
-#include <sys/stat.h>
-       register FILE *df;
-       struct stat sbuf;
-       struct direct dbuf;
-
-       if ((df = fopen("/dev", "r")) == NULL) {
-               fprintf(stderr, "Can't open /dev\n");
-               exit(1);
-       }
-       ndev = 0;
-       while (fread((char *)&dbuf, sizeof(dbuf), 1, df) == 1) {
-               if(dbuf.d_ino == 0)
-                       continue;
-               if(stat(dbuf.d_name, &sbuf) < 0)
-                       continue;
-               if ((sbuf.st_mode&S_IFMT) != S_IFCHR)
-                       continue;
-               strcpy(devl[ndev].dname, dbuf.d_name);
-               devl[ndev].dev = sbuf.st_rdev;
-               ndev++;
-       }
-       fclose(df);
-       if ((swap = open("/dev/swap", 0)) < 0) {
-               fprintf(stderr, "Can't open /dev/swap\n");
-               exit(1);
-       }
-}
-
-long
-round(a, b)
-       long            a, b;
-{
-       long            w = ((a+b-1)/b)*b;
-
-       return(w);
-}
-
-struct map {
-       long    b1, e1; long f1;
-       long    b2, e2; long f2;
-};
-struct map datmap;
-int    file;
-prcom(puid)
-{
-       char abuf[512];
-       long addr;
-       register int *ip;
-       register char *cp, *cp1;
-       long tm;
-       int c, nbad;
-       register char *tp;
-       long txtsiz, datsiz, stksiz;
-       int septxt;
-       int lw=(lflg?35:80);
-       char **ap;
-
-       if (mproc.p_flag&SLOAD) {
-               addr = ctob((long)mproc.p_addr);
-               file = swmem;
-       } else {
-               addr = (mproc.p_addr+swplo)<<9;
-               file = swap;
-       }
-       lseek(file, addr, 0);
-       if (read(file, (char *)&u, sizeof(u)) != sizeof(u))
-               return(0);
-
-       /* set up address maps for user pcs */
-       txtsiz = ctob(u.u_tsize);
-       datsiz = ctob(u.u_dsize);
-       stksiz = ctob(u.u_ssize);
-       septxt = u.u_sep;
-       datmap.b1 = (septxt ? 0 : round(txtsiz,TXTRNDSIZ));
-       datmap.e1 = datmap.b1+datsiz;
-       datmap.f1 = ctob(USIZE)+addr;
-       datmap.b2 = stackbas(stksiz);
-       datmap.e2 = stacktop(stksiz);
-       datmap.f2 = ctob(USIZE)+(datmap.e1-datmap.b1)+addr;
-
-       tp = gettty();
-       if (tptr && strncmp(tptr, tp, 2))
-               return(0);
-       if (lflg) {
-               printf("%2o %c%4d", mproc.p_flag,
-                       "0SWRIZT"[mproc.p_stat], puid);
-       }
-       printf("%6u", mproc.p_pid);
-       if (lflg) {
-               printf("%6u%4d%4d%5d%6o%4d", mproc.p_ppid, mproc.p_cpu&0377,
-                       mproc.p_pri,
-                       mproc.p_nice,
-                       mproc.p_addr, (mproc.p_size+7)>>3);
-               if (mproc.p_wchan)
-                       printf("%7o", mproc.p_wchan);
-               else
-                       printf("       ");
-       }
-       printf(" %-2.2s", tp);
-       if (mproc.p_stat==SZOMB) {
-               printf("  <defunct>");
-               return(1);
-       }
-       tm = (u.u_utime + u.u_stime + 30)/60;
-       printf(" %2ld:", tm/60);
-       tm %= 60;
-       printf(tm<10?"0%ld":"%ld", tm);
-       if (vflg && lflg==0) {  /* 0 == old tflg (print long times) */
-               tm = (u.u_cstime + 30)/60;
-               printf(" %2ld:", tm/60);
-               tm %= 60;
-               printf(tm<10?"0%ld":"%ld", tm);
-               tm = (u.u_cutime + 30)/60;
-               printf(" %2ld:", tm/60);
-               tm %= 60;
-               printf(tm<10?"0%ld":"%ld", tm);
-       }
-       if (mproc.p_pid == 0) {
-               printf(" swapper");
-               return(1);
-       }
-       addr += ctob((long)mproc.p_size) - 512;
-
-       /* look for sh special */
-       lseek(file, addr+512-sizeof(char **), 0);
-       if (read(file, (char *)&ap, sizeof(char *)) != sizeof(char *))
-               return(1);
-       if (ap) {
-               char b[82];
-               char *bp = b;
-               while((cp=getptr(ap++)) && cp && (bp<b+lw) ) {
-                       nbad = 0;
-                       while((c=getbyte(cp++)) && (bp<b+lw)) {
-                               if (c<' ' || c>'~') {
-                                       if (nbad++>3)
-                                               break;
-                                       continue;
-                               }
-                               *bp++ = c;
-                       }
-                       *bp++ = ' ';
-               }
-               *bp++ = 0;
-               printf(lflg?" %.30s":" %.60s", b);
-               return(1);
-       }
-
-       lseek(file, addr, 0);
-       if (read(file, abuf, sizeof(abuf)) != sizeof(abuf))
-               return(1);
-       for (ip = (int *)&abuf[512]-2; ip > (int *)abuf; ) {
-               if (*--ip == -1 || *ip==0) {
-                       cp = (char *)(ip+1);
-                       if (*cp==0)
-                               cp++;
-                       nbad = 0;
-                       for (cp1 = cp; cp1 < &abuf[512]; cp1++) {
-                               c = *cp1&0177;
-                               if (c==0)
-                                       *cp1 = ' ';
-                               else if (c < ' ' || c > 0176) {
-                                       if (++nbad >= 5) {
-                                               *cp1++ = ' ';
-                                               break;
-                                       }
-                                       *cp1 = '?';
-                               } else if (c=='=') {
-                                       *cp1 = 0;
-                                       while (cp1>cp && *--cp1!=' ')
-                                               *cp1 = 0;
-                                       break;
-                               }
-                       }
-                       while (*--cp1==' ')
-                               *cp1 = 0;
-                       printf(lflg?" %.30s":" %.60s", cp);
-                       return(1);
-               }
-       }
-       return(1);
-}
-
-char *
-gettty()
-{
-       register i;
-       register char *p;
-
-       if (u.u_ttyp==0)
-               return("?");
-       for (i=0; i<ndev; i++) {
-               if (devl[i].dev == u.u_ttyd) {
-                       p = devl[i].dname;
-                       if (p[0]=='t' && p[1]=='t' && p[2]=='y')
-                               p += 3;
-                       return(p);
-               }
-       }
-       return("?");
-}
-
-char *
-getptr(adr)
-char **adr;
-{
-       char *ptr;
-       register char *p, *pa;
-       register i;
-
-       ptr = 0;
-       pa = (char *)adr;
-       p = (char *)&ptr;
-       for (i=0; i<sizeof(ptr); i++)
-               *p++ = getbyte(pa++);
-       return(ptr);
-}
-
-getbyte(adr)
-char *adr;
-{
-       register struct map *amap = &datmap;
-       char b;
-       long saddr;
-
-       if(!within(adr, amap->b1, amap->e1)) {
-               if(within(adr, amap->b2, amap->e2)) {
-                       saddr = (unsigned)adr + amap->f2 - amap->b2;
-               } else
-                       return(0);
-       } else
-               saddr = (unsigned)adr + amap->f1 - amap->b1;
-       if(lseek(file, saddr, 0)==-1
-                  || read(file, &b, 1)<1) {
-               return(0);
-       }
-       return((unsigned)b);
-}
-
-
-within(adr,lbd,ubd)
-char *adr;
-long lbd, ubd;
-{
-       return((unsigned)adr>=lbd && (unsigned)adr<ubd);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/pstat.c b/.ref-Research-V7/usr/src/cmd/pstat.c
deleted file mode 100644 (file)
index 17a7474..0000000
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * Print system stuff
- */
-
-#define mask(x) (x&0377)
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/tty.h>
-
-char   *fcore  = "/dev/mem";
-char   *fnlist = "/unix";
-int    fc;
-
-struct setup {
-       char    name[8];
-       int     type;
-       unsigned        value;
-} setup[] = {
-#define        SINODE  0
-       "_inode", 0, 0,
-#define        STEXT   1
-       "_text", 0, 0,
-#define        SPROC   2
-       "_proc", 0, 0,
-#define        SDH     3
-       "_dh11", 0, 0,
-#define        SNDH    4
-       "_ndh11", 0, 0,
-#define        SKL     5
-       "_kl11", 0, 0,
-#define        SFIL    6
-       "_file", 0, 0,
-       0,
-};
-
-int    inof;
-int    txtf;
-int    prcf;
-int    ttyf;
-int    usrf;
-long   ubase;
-int    filf;
-int    allflg;
-
-main(argc, argv)
-char **argv;
-{
-
-       while (--argc && **++argv == '-') {
-               while (*++*argv)
-               switch (**argv) {
-
-               case 'a':
-                       allflg++;
-                       break;
-
-               case 'i':
-                       inof++;
-                       break;
-
-               case 'x':
-                       txtf++;
-                       break;
-               case 'p':
-                       prcf++;
-                       break;
-
-               case 't':
-                       ttyf++;
-                       break;
-
-               case 'u':
-                       if (--argc == 0)
-                               break;
-                       usrf++;
-                       ubase = oatoi(*++argv);
-                       break;
-
-               case 'f':
-                       filf++;
-                       break;
-               }
-       }
-       if (argc>0)
-               fcore = argv[0];
-       if ((fc = open(fcore, 0)) < 0) {
-               printf("Can't find %s\n", fcore);
-               exit(1);
-       }
-       if (argc>1)
-               fnlist = argv[1];
-       nlist(fnlist, setup);
-       if (setup[SINODE].type == -1) {
-               printf("no namelist\n");
-               exit(1);
-       }
-       if (inof)
-               doinode();
-       if (txtf)
-               dotext();
-       if (ttyf)
-               dotty();
-       if (prcf)
-               doproc();
-       if (usrf)
-               dousr();
-       if (filf)
-               dofil();
-}
-
-doinode()
-{
-#include <sys/inode.h>
-       register struct inode *ip;
-       struct inode xinode[NINODE];
-       register int nin, loc;
-
-       nin = 0;
-       lseek(fc, (long)setup[SINODE].value, 0);
-       read(fc, (char *)xinode, sizeof(xinode));
-       for (ip = xinode; ip < &xinode[NINODE]; ip++)
-               if (ip->i_count)
-                       nin++;
-       printf("%d active inodes\n", nin);
-       printf("   LOC  FLAGS  CNT DEVICE   INO   MODE NLK UID  SIZE/DEV\n");
-       loc = setup[SINODE].value;
-       for (ip = xinode; ip < &xinode[NINODE]; ip++, loc += sizeof(xinode[0])) {
-               if (ip->i_count == 0)
-                       continue;
-               printf("%7.1o ", loc);
-               putf(ip->i_flag&ILOCK, 'L');
-               putf(ip->i_flag&IUPD, 'U');
-               putf(ip->i_flag&IACC, 'A');
-               putf(ip->i_flag&IMOUNT, 'M');
-               putf(ip->i_flag&IWANT, 'W');
-               putf(ip->i_flag&ITEXT, 'T');
-               printf("%4d", ip->i_count&0377);
-               printf("%3d,%3d", major(ip->i_dev), minor(ip->i_dev));
-               printf("%6l", ip->i_number);
-               printf("%7o", ip->i_mode);
-               printf("%4d", ip->i_nlink);
-               printf("%4d", ip->i_uid);
-               if ((ip->i_mode&IFMT)==IFBLK || (ip->i_mode&IFMT)==IFCHR)
-                       printf("%6d,%3d", major(ip->i_un.i_rdev), minor(ip->i_un.i_rdev));
-               else
-                       printf("%10ld", ip->i_size);
-               printf("\n");
-       }
-}
-
-putf(v, n)
-{
-       if (v)
-               printf("%c", n);
-       else
-               printf(" ");
-}
-
-dotext()
-{
-#include <sys/text.h>
-       register struct text *xp;
-       struct text xtext[NTEXT];
-       register loc;
-       int ntx;
-
-       ntx = 0;
-       lseek(fc, (long)setup[STEXT].value, 0);
-       read(fc, (char *)xtext, sizeof(xtext));
-       for (xp = xtext; xp < &xtext[NTEXT]; xp++)
-               if (xp->x_iptr!=NULL)
-                       ntx++;
-       printf("%d text segments\n", ntx);
-       printf("   LOC FLAGS DADDR  CADDR SIZE   IPTR  CNT CCNT\n");
-       loc = setup[STEXT].value;
-       for (xp = xtext; xp < &xtext[NTEXT]; xp++, loc+=sizeof(xtext[0])) {
-               if (xp->x_iptr == NULL)
-                       continue;
-               printf("%7.1o", loc);
-               printf(" ");
-               putf(xp->x_flag&XTRC, 'T');
-               putf(xp->x_flag&XWRIT, 'W');
-               putf(xp->x_flag&XLOAD, 'L');
-               putf(xp->x_flag&XLOCK, 'K');
-               putf(xp->x_flag&XWANT, 'w');
-               printf("%5u", xp->x_daddr);
-               printf("%7.1o", xp->x_caddr);
-               printf("%5d", xp->x_size);
-               printf("%8.1o", xp->x_iptr);
-               printf("%4d", xp->x_count&0377);
-               printf("%4d", xp->x_ccount);
-               printf("\n");
-       }
-}
-
-doproc()
-{
-#include <sys/proc.h>
-       struct proc xproc[NPROC];
-       register struct proc *pp;
-       register loc, np;
-
-       lseek(fc, (long)setup[SPROC].value, 0);
-       read(fc, (char *)xproc, sizeof(xproc));
-       np = 0;
-       for (pp=xproc; pp < &xproc[NPROC]; pp++)
-               if (pp->p_stat)
-                       np++;
-       printf("%d processes\n", np);
-       printf("   LOC S  F  PRI SIGNAL UID TIM CPU NI  PGRP   PID  PPID ADDR SIZE  WCHAN   LINK  TEXTP  CLKT\n");
-       for (loc=setup[SPROC].value,pp=xproc; pp<&xproc[NPROC]; pp++,loc+=sizeof(xproc[0])) {
-               if (pp->p_stat==0 && allflg==0)
-                       continue;
-               printf("%6o", loc);
-               printf("%2d", pp->p_stat);
-               printf("%3o", pp->p_flag);
-               printf("%5d", pp->p_pri);
-               printf("%7o", pp->p_sig);
-               printf("%4d", pp->p_uid&0377);
-               printf("%4d", pp->p_time&0377);
-               printf("%4d", pp->p_cpu&0377);
-               printf("%3d", pp->p_nice);
-               printf("%6d", pp->p_pgrp);
-               printf("%6d", pp->p_pid);
-               printf("%6d", pp->p_ppid);
-               printf("%5o", pp->p_addr);
-               printf("%5o", pp->p_size);
-               printf("%7o", pp->p_wchan);
-               printf("%7o", pp->p_link);
-               printf("%7o", pp->p_textp);
-               printf(" %u", pp->p_clktim);
-               printf("\n");
-       }
-}
-
-dotty()
-{
-       struct tty dh11[48];
-       int ndh;
-       register struct tty *tp;
-       register char *mesg;
-
-       printf("1 kl11\n");
-       lseek(fc, (long)setup[SKL].value, 0);
-       read(fc, (char *)dh11, sizeof(dh11[0]));
-       mesg = " # RAW CAN OUT   MODE   ADDR   DEL COL  STATE   PGRP\n";
-       printf(mesg);
-       ttyprt(0, &dh11[0]);
-       if (setup[SNDH].type == -1)
-               return;
-       lseek(fc, (long)setup[SNDH].value, 0);
-       read(fc, (char *)&ndh, sizeof(ndh));
-       printf("%d dh lines\n", ndh);
-       lseek(fc, (long)setup[SDH].value, 0);
-       read(fc, (char *)dh11, sizeof(dh11));
-       for (tp = dh11; tp < &dh11[ndh]; tp++)
-               ttyprt(tp-dh11, tp);
-}
-
-ttyprt(n, atp)
-struct tty *atp;
-{
-       register struct tty *tp;
-
-       tp = atp;
-       printf("%2d", n);
-       printf("%4d", tp->t_rawq.c_cc);
-       printf("%4d", tp->t_canq.c_cc);
-       printf("%4d", tp->t_outq.c_cc);
-       printf("%8.1o", tp->t_flags);
-       printf("%8.1o", tp->t_addr);
-       printf("%3d", tp->t_delct);
-       printf("%4d ", tp->t_col);
-       putf(tp->t_state&TIMEOUT, 'T');
-       putf(tp->t_state&WOPEN, 'W');
-       putf(tp->t_state&ISOPEN, 'O');
-       putf(tp->t_state&CARR_ON, 'C');
-       putf(tp->t_state&BUSY, 'B');
-       putf(tp->t_state&ASLEEP, 'A');
-       putf(tp->t_state&XCLUDE, 'X');
-       putf(tp->t_state&HUPCLS, 'H');
-       printf("%6d", tp->t_pgrp);
-       printf("\n");
-}
-
-dousr()
-{
-#include <sys/dir.h>
-#include <sys/user.h>
-       union {
-               struct  user rxu;
-               char    fxu[ctob(USIZE)];
-       } xu;
-       register struct user *up;
-       register i;
-
-       lseek(fc, ubase<<6, 0);
-       read(fc, (char *)&xu, sizeof(xu));
-       up = &xu.rxu;
-       printf("rsav %.1o %.1o\n", up->u_rsav[0], up->u_rsav[1]);
-       printf("segflg, error %d, %d\n", up->u_segflg, up->u_error);
-       printf("uids %d,%d,%d,%d\n", up->u_uid,up->u_gid,up->u_ruid,up->u_rgid);
-       printf("procp %.1o\n", up->u_procp);
-       printf("base, count, offset %.1o %.1o %ld\n", up->u_base,
-               up->u_count, up->u_offset);
-       printf("cdir %.1o\n", up->u_cdir);
-       printf("dbuf %.14s\n", up->u_dbuf);
-       printf("dirp %.1o\n", up->u_dirp);
-       printf("dent %d %.14s\n", up->u_dent.d_ino, up->u_dent.d_name);
-       printf("pdir %.1o\n", up->u_pdir);
-       printf("dseg");
-       for (i=0; i<8; i++)
-               printf("%8.1o", up->u_uisa[i]);
-       printf("\n    ");
-       for (i=0; i<8; i++)
-               printf("%8.1o", up->u_uisd[i]);
-       if (up->u_sep) {
-               printf("\ntseg");
-               for (i=8; i<16; i++)
-                       printf("%8.1o", up->u_uisa[i]);
-               printf("\n    ");
-               for (i=8; i<16; i++)
-                       printf("%8.1o", up->u_uisd[i]);
-       }
-       printf("\nfile");
-       for (i=0; i<10; i++)
-               printf("%8.1o", up->u_ofile[i]);
-       printf("\n    ");
-       for (i=10; i<NOFILE; i++)
-               printf("%8.1o", up->u_ofile[i]);
-       printf("\nargs");
-       for (i=0; i<5; i++)
-               printf(" %.1o", up->u_arg[i]);
-       printf("\nsizes %.1o %.1o %.1o\n", up->u_tsize, up->u_dsize, up->u_ssize);
-       printf("sep %d\n", up->u_sep);
-       printf("qsav %.1o %.1o\n", up->u_qsav[0], up->u_qsav[1]);
-       printf("ssav %.1o %.1o\n", up->u_ssav[0], up->u_ssav[1]);
-       printf("sigs");
-       for (i=0; i<NSIG; i++)
-               printf(" %.1o", up->u_signal[i]);
-       printf("\ntimes %ld %ld\n", up->u_utime/60, up->u_stime/60);
-       printf("ctimes %ld %ld\n", up->u_cutime/60, up->u_cstime/60);
-       printf("ar0 %.1o\n", up->u_ar0);
-/*
-       printf("prof");
-       for (i=0; i<4; i++)
-               printf(" %.1o", up->u_prof[i]);
-*/
-       printf("\nintflg %d\n", up->u_intflg);
-       printf("ttyp %.1o\n", up->u_ttyp);
-       printf("ttydev %d,%d\n", major(up->u_ttyd), minor(up->u_ttyd));
-       printf("comm %.14s\n", up->u_comm);
-}
-
-oatoi(s)
-char *s;
-{
-       register v;
-
-       v = 0;
-       while (*s)
-               v = (v<<3) + *s++ - '0';
-       return(v);
-}
-
-dofil()
-{
-#include <sys/file.h>
-       struct file xfile[NFILE];
-       register struct file *fp;
-       register nf;
-       int loc;
-
-       nf = 0;
-       lseek(fc, (long)setup[SFIL].value, 0);
-       read(fc, (char *)xfile, sizeof(xfile));
-       for (fp=xfile; fp < &xfile[NFILE]; fp++)
-               if (fp->f_count)
-                       nf++;
-       printf("%d open files\n", nf);
-       printf("  LOC   FLG CNT   INO    OFFS\n");
-       for (fp=xfile,loc=setup[SFIL].value; fp < &xfile[NFILE]; fp++,loc+=sizeof(xfile[0])) {
-               if (fp->f_count==0)
-                       continue;
-               printf("%7.1o ", loc);
-               putf(fp->f_flag&FREAD, 'R');
-               putf(fp->f_flag&FWRITE, 'W');
-               putf(fp->f_flag&FPIPE, 'P');
-               printf("%4d", mask(fp->f_count));
-               printf("%8.1o", fp->f_inode);
-               printf(" %ld\n", fp->f_un.f_offset);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ptx.c b/.ref-Research-V7/usr/src/cmd/ptx.c
deleted file mode 100644 (file)
index 712911d..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-#
-
-/*     permuted title index
-       ptx [-t] [-i ignore] [-o only] [-w num] [-f] [input] [output]
-       Ptx reads the input file and permutes on words in it.
-       It excludes all words in the ignore file.
-       Alternately it includes words in the only file.
-       if neither is given it excludes the words in /usr/lib/eign.
-
-       The width of the output line can be changed to num
-       characters.  If omitted 72 is default unless troff than 100.
-       the -f flag tells the program to fold the output
-       the -t flag says the output is for troff and the
-       output is then wider.
-
-\e      make: cc ptx.c -lS
-       */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#define DEFLTX "/usr/lib/eign"
-#define TILDE 0177
-#define SORT "/bin/sort"
-#define        N 30
-#define        MAX     N*BUFSIZ
-#define LMAX   200
-#define MAXT   2048
-#define MASK   03777
-#define SET    1
-
-#define isabreak(c) (btable[c])
-
-extern char *calloc(), *mktemp();
-extern char *getline();
-int status;
-
-
-char *hasht[MAXT];
-char line[LMAX];
-char btable[128];
-int ignore;
-int only;
-int llen = 72;
-int gap = 3;
-int gutter = 3;
-int mlen = LMAX;
-int wlen;
-int rflag;
-int halflen;
-char *strtbufp, *endbufp;
-char *empty = "";
-
-char *infile;
-FILE *inptr = stdin;
-
-char *outfile;
-FILE *outptr = stdout;
-
-char *sortfile;        /* output of sort program */
-char nofold[] = {'-', 'd', 't', TILDE, 0};
-char fold[] = {'-', 'd', 'f', 't', TILDE, 0};
-char *sortopt = nofold;
-FILE *sortptr;
-
-char *bfile;   /*contains user supplied break chars */
-FILE *bptr;
-
-main(argc,argv)
-int argc;
-char **argv;
-{
-       register int c;
-       register char *bufp;
-       int pid;
-       char *pend;
-       extern onintr();
-
-       char *xfile;
-       FILE *xptr;
-
-       if(signal(SIGHUP,onintr)==SIG_IGN)
-               signal(SIGHUP,SIG_IGN);
-       if(signal(SIGINT,onintr)==SIG_IGN)
-               signal(SIGINT,SIG_IGN);
-       signal(SIGPIPE,onintr);
-       signal(SIGTERM,onintr);
-
-/*     argument decoding       */
-
-       xfile = DEFLTX;
-       argv++;
-       while(argc>1 && **argv == '-') {
-               switch (*++*argv){
-
-               case 'r':
-                       rflag++;
-                       break;
-               case 'f':
-                       sortopt = fold;
-                       break;
-
-               case 'w':
-                       if(argc >= 2) {
-                               argc--;
-                               wlen++;
-                               llen = atoi(*++argv);
-                               if(llen == 0)
-                                       diag("Wrong width:",*argv);
-                               if(llen > LMAX) {
-                                       llen = LMAX;
-                                       msg("Lines truncated to 200 chars.",empty);
-                               }
-                               break;
-                       }
-
-               case 't':
-                       if(wlen == 0)
-                               llen = 100;
-                       break;
-               case 'g':
-                       if(argc >=2) {
-                               argc--;
-                               gap = gutter = atoi(*++argv);
-                       }
-                       break;
-
-               case 'i':
-                       if(only) 
-                               diag("Only file already given.",empty);
-                       if (argc>=2){
-                               argc--;
-                               ignore++;
-                               xfile = *++argv;
-                       }
-                       break;
-
-               case 'o':
-                       if(ignore)
-                               diag("Ignore file already given",empty);
-                       if (argc>=2){
-                               only++;
-                               argc--;
-                               xfile = *++argv;
-                       }
-                       break;
-
-               case 'b':
-                       if(argc>=2) {
-                               argc--;
-                               bfile = *++argv;
-                       }
-                       break;
-
-               default:
-                       msg("Illegal argument:",*argv);
-               }
-               argc--;
-               argv++;
-       }
-
-       if(argc>3)
-               diag("Too many filenames",empty);
-       else if(argc==3){
-               infile = *argv++;
-               outfile = *argv;
-               if((outptr = fopen(outfile,"w")) == NULL)
-                       diag("Cannot open output file:",outfile);
-       } else if(argc==2) {
-               infile = *argv;
-               outfile = 0;
-       }
-
-
-       /* Default breaks of blank, tab and newline */
-       btable[' '] = SET;
-       btable['\t'] = SET;
-       btable['\n'] = SET;
-       if(bfile) {
-               if((bptr = fopen(bfile,"r")) == NULL)
-                       diag("Cannot open break char file",bfile);
-
-               while((c = getc(bptr)) != EOF)
-                       btable[c] = SET;
-       }
-
-/*     Allocate space for a buffer.  If only or ignore file present
-       read it into buffer. Else read in default ignore file
-       and put resulting words in buffer.
-       */
-
-
-       if((strtbufp = calloc(N,BUFSIZ)) == NULL)
-               diag("Out of memory space",empty);
-       bufp = strtbufp;
-       endbufp = strtbufp+MAX;
-
-       if((xptr = fopen(xfile,"r")) == NULL)
-               diag("Cannot open  file",xfile);
-
-       while(bufp < endbufp && (c = getc(xptr)) != EOF) {
-               if(isabreak(c)) {
-                       if(storeh(hash(strtbufp,bufp),strtbufp))
-                               diag("Too many words",xfile);
-                       *bufp++ = '\0';
-                       strtbufp = bufp;
-               }
-               else {
-                       *bufp++ = (isupper(c)?tolower(c):c);
-               }
-       }
-       if (bufp >= endbufp)
-               diag("Too many words in file",xfile);
-       endbufp = --bufp;
-
-       /* open output file for sorting */
-
-       sortfile = mktemp("/tmp/ptxsXXXXX");
-       if((sortptr = fopen(sortfile, "w")) == NULL)
-               diag("Cannot open output for sorting:",sortfile);
-
-/*     get a line of data and compare each word for
-       inclusion or exclusion in the sort phase
-*/
-
-       if (infile!=0 && (inptr = fopen(infile,"r")) == NULL)
-               diag("Cannot open data: ",infile);
-       while(pend=getline())
-               cmpline(pend);
-       fclose(sortptr);
-
-       switch (pid = fork()){
-
-       case -1:        /* cannot fork */
-               diag("Cannot fork",empty);
-
-       case 0:         /* child */
-               execl(SORT, SORT, sortopt, "+0", "-1", "+1",
-                       sortfile, "-o", sortfile, 0);
-
-       default:        /* parent */
-               while(wait(&status) != pid);
-       }
-
-
-       getsort();
-       onintr();
-}
-
-msg(s,arg)
-char *s;
-char *arg;
-{
-       fprintf(stderr,"%s %s\n",s,arg);
-       return;
-}
-diag(s,arg)
-char *s, *arg;
-{
-
-       msg(s,arg);
-       exit(1);
-}
-
-
-char *getline()
-{
-
-       register c;
-       register char *linep;
-       char *endlinep;
-
-
-       endlinep= line + mlen;
-       linep = line;
-       /* Throw away leading white space */
-
-       while(isspace(c=getc(inptr)))
-               ;
-       if(c==EOF)
-               return(0);
-       ungetc(c,inptr);
-       while(( c=getc(inptr)) != EOF) {
-               switch (c) {
-
-                       case '\t':
-                               if(linep<endlinep)
-                                       *linep++ = ' ';
-                               break;
-                       case '\n':
-                               while(isspace(*--linep));
-                               *++linep = '\n';
-                               return(linep);
-                       default:
-                               if(linep < endlinep)
-                                       *linep++ = c;
-               }
-       }
-       return(0);
-}
-
-cmpline(pend)
-char *pend;
-{
-
-       char *pstrt, *pchar, *cp;
-       char **hp;
-       int flag;
-
-       pchar = line;
-       if(rflag)
-               while(pchar<pend&&!isspace(*pchar))
-                       pchar++;
-       while(pchar<pend){
-       /* eliminate white space */
-               if(isabreak(*pchar++))
-                       continue;
-               pstrt = --pchar;
-
-               flag = 1;
-               while(flag){
-                       if(isabreak(*pchar)) {
-                               hp = &hasht[hash(pstrt,pchar)];
-                               pchar--;
-                               while(cp = *hp++){
-                                       if(hp == &hasht[MAXT])
-                                               hp = hasht;
-       /* possible match */
-                                       if(cmpword(pstrt,pchar,cp)){
-       /* exact match */
-                                               if(!ignore && only)
-                                                       putline(pstrt,pend);
-                                               flag = 0;
-                                               break;
-                                       }
-                               }
-       /* no match */
-                               if(flag){
-                                       if(ignore || !only)
-                                               putline(pstrt,pend);
-                                       flag = 0;
-                               }
-                       }
-               pchar++;
-               }
-       }
-}
-
-cmpword(cpp,pend,hpp)
-char *cpp, *pend, *hpp;
-{
-       char c;
-
-       while(*hpp != '\0'){
-               c = *cpp++;
-               if((isupper(c)?tolower(c):c) != *hpp++)
-                       return(0);
-       }
-       if(--cpp == pend) return(1);
-       return(0);
-}
-
-putline(strt, end)
-char *strt, *end;
-{
-       char *cp;
-
-       for(cp=strt; cp<end; cp++)
-               putc(*cp, sortptr);
-       /* Add extra blank before TILDE to sort correctly
-          with -fd option */
-       putc(' ',sortptr);
-       putc(TILDE,sortptr);
-       for (cp=line; cp<strt; cp++)
-               putc(*cp,sortptr);
-       putc('\n',sortptr);
-}
-
-getsort()
-{
-       register c;
-       register char *tilde, *linep, *ref;
-       char *p1a,*p1b,*p2a,*p2b,*p3a,*p3b,*p4a,*p4b;
-       int w;
-       char *rtrim(), *ltrim();
-
-       if((sortptr = fopen(sortfile,"r")) == NULL)
-               diag("Cannot open sorted data:",sortfile);
-
-       halflen = (llen-gutter)/2;
-       linep = line;
-       while((c = getc(sortptr)) != EOF) {
-               switch(c) {
-
-               case TILDE:
-                       tilde = linep;
-                       break;
-
-               case '\n':
-                       while(isspace(linep[-1]))
-                               linep--;
-                       ref = tilde;
-                       if(rflag) {
-                               while(ref<linep&&!isspace(*ref))
-                                       ref++;
-                               *ref++ = 0;
-                       }
-               /* the -1 is an overly conservative test to leave
-                  space for the / that signifies truncation*/
-                       p3b = rtrim(p3a=line,tilde,halflen-1);
-                       if(p3b-p3a>halflen-1)
-                               p3b = p3a+halflen-1;
-                       p2a = ltrim(ref,p2b=linep,halflen-1);
-                       if(p2b-p2a>halflen-1)
-                               p2a = p2b-halflen-1;
-                       p1b = rtrim(p1a=p3b+(isspace(p3b[0])!=0),tilde,
-                               w=halflen-(p2b-p2a)-gap);
-                       if(p1b-p1a>w)
-                               p1b = p1a;
-                       p4a = ltrim(ref,p4b=p2a-(isspace(p2a[-1])!=0),
-                               w=halflen-(p3b-p3a)-gap);
-                       if(p4b-p4a>w)
-                               p4a = p4b;
-                       fprintf(outptr,".xx \"");
-                       putout(p1a,p1b);
-       /* tilde-1 to account for extra space before TILDE */
-                       if(p1b!=(tilde-1) && p1a!=p1b)
-                               fprintf(outptr,"/");
-                       fprintf(outptr,"\" \"");
-                       if(p4a==p4b && p2a!=ref && p2a!=p2b)
-                               fprintf(outptr,"/");
-                       putout(p2a,p2b);
-                       fprintf(outptr,"\" \"");
-                       putout(p3a,p3b);
-       /* ++p3b to account for extra blank after TILDE */
-       /* ++p3b to account for extra space before TILDE */
-                       if(p1a==p1b && ++p3b!=tilde)
-                               fprintf(outptr,"/");
-                       fprintf(outptr,"\" \"");
-                       if(p1a==p1b && p4a!=ref && p4a!=p4b)
-                               fprintf(outptr,"/");
-                       putout(p4a,p4b);
-                       if(rflag)
-                               fprintf(outptr,"\" %s\n",tilde);
-                       else
-                               fprintf(outptr,"\"\n");
-                       linep = line;
-                       break;
-
-               case '"':
-       /* put double " for "  */
-                       *linep++ = c;
-               default:
-                       *linep++ = c;
-               }
-       }
-}
-
-char *rtrim(a,c,d)
-char *a,*c;
-{
-       char *b,*x;
-       b = c;
-       for(x=a+1; x<=c&&x-a<=d; x++)
-               if((x==c||isspace(x[0]))&&!isspace(x[-1]))
-                       b = x;
-       if(b<c&&!isspace(b[0]))
-               b++;
-       return(b);
-}
-
-char *ltrim(c,b,d)
-char *c,*b;
-{
-       char *a,*x;
-       a = c;
-       for(x=b-1; x>=c&&b-x<=d; x--)
-               if(!isspace(x[0])&&(x==c||isspace(x[-1])))
-                       a = x;
-       if(a>c&&!isspace(a[-1]))
-               a--;
-       return(a);
-}
-
-putout(strt,end)
-char *strt, *end;
-{
-       char *cp;
-
-       cp = strt;
-
-       for(cp=strt; cp<end; cp++) {
-               putc(*cp,outptr);
-       }
-}
-
-onintr()
-{
-
-       if(*sortfile)
-               unlink(sortfile);
-       exit(1);
-}
-
-hash(strtp,endp)
-char *strtp, *endp;
-{
-       char *cp, c;
-       int i, j, k;
-
-       /* Return zero hash number for single letter words */
-       if((endp - strtp) == 1)
-               return(0);
-
-       cp = strtp;
-       c = *cp++;
-       i = (isupper(c)?tolower(c):c);
-       c = *cp;
-       j = (isupper(c)?tolower(c):c);
-       i = i*j;
-       cp = --endp;
-       c = *cp--;
-       k = (isupper(c)?tolower(c):c);
-       c = *cp;
-       j = (isupper(c)?tolower(c):c);
-       j = k*j;
-
-       k = (i ^ (j>>2)) & MASK;
-       return(k);
-}
-
-storeh(num,strtp)
-int num;
-char *strtp;
-{
-       int i;
-
-       for(i=num; i<MAXT; i++) {
-               if(hasht[i] == 0) {
-                       hasht[i] = strtp;
-                       return(0);
-               }
-       }
-       for(i=0; i<num; i++) {
-               if(hasht[i] == 0) {
-                       hasht[i] = strtp;
-                       return(0);
-               }
-       }
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/pwd.c b/.ref-Research-V7/usr/src/cmd/pwd.c
deleted file mode 100644 (file)
index b060709..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Print working (current) directory
- */
-#include       <stdio.h>
-#include       <sys/param.h>
-#include       <sys/stat.h>
-#include       <sys/dir.h>
-
-char   dot[]   = ".";
-char   dotdot[] = "..";
-char   name[512];
-int    file;
-int    off     = -1;
-struct stat    d, dd;
-struct direct  dir;
-
-main()
-{
-       int rdev, rino;
-
-       stat("/", &d);
-       rdev = d.st_dev;
-       rino = d.st_ino;
-       for (;;) {
-               stat(dot, &d);
-               if (d.st_ino==rino && d.st_dev==rdev)
-                       prname();
-               if ((file = open(dotdot,0)) < 0) {
-                       fprintf(stderr,"pwd: cannot open ..\n");
-                       exit(1);
-               }
-               fstat(file, &dd);
-               chdir(dotdot);
-               if(d.st_dev == dd.st_dev) {
-                       if(d.st_ino == dd.st_ino)
-                               prname();
-                       do
-                               if (read(file, (char *)&dir, sizeof(dir)) < sizeof(dir)) {
-                                       fprintf(stderr,"read error in ..\n");
-                                       exit(1);
-                               }
-                       while (dir.d_ino != d.st_ino);
-               }
-               else do {
-                               if(read(file, (char *)&dir, sizeof(dir)) < sizeof(dir)) {
-                                       fprintf(stderr,"read error in ..\n");
-                                       exit(1);
-                               }
-                               stat(dir.d_name, &dd);
-                       } while(dd.st_ino != d.st_ino || dd.st_dev != d.st_dev);
-               close(file);
-               cat();
-       }
-}
-
-prname()
-{
-       write(1, "/", 1);
-       if (off<0)
-               off = 0;
-       name[off] = '\n';
-       write(1, name, off+1);
-       exit(0);
-}
-
-cat()
-{
-       register i, j;
-
-       i = -1;
-       while (dir.d_name[++i] != 0);
-       if ((off+i+2) > 511)
-               prname();
-       for(j=off+1; j>=0; --j)
-               name[j+i+1] = name[j];
-       off=i+off+1;
-       name[i] = '/';
-       for(--i; i>=0; --i)
-               name[i] = dir.d_name[i];
-}
diff --git a/.ref-Research-V7/usr/src/cmd/quot.c b/.ref-Research-V7/usr/src/cmd/quot.c
deleted file mode 100644 (file)
index 984102a..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Disk usage by user
- */
-
-char   *dargv[] = {
-       "/dev/rrp3",
-       0
-};
-
-#include <stdio.h>
-#include <ctype.h>
-#include <pwd.h>
-#include <sys/param.h>
-#include <sys/ino.h>
-#include <sys/inode.h>
-#include <sys/filsys.h>
-
-#define        ITABSZ  256
-#define        ISIZ    (BSIZE/sizeof(struct dinode))
-#define        NUID    300
-struct filsys  sblock;
-struct dinode  itab[ITABSZ];
-struct du
-{
-       long    blocks;
-       long    nfiles;
-       int     uid;
-       char    *name;
-} du[NUID];
-#define        TSIZE   500
-int    sizes[TSIZE];
-long   overflow;
-
-int    nflg;
-int    fflg;
-int    cflg;
-
-int    fi;
-unsigned       ino;
-unsigned       nfiles;
-
-struct passwd  *getpwent();
-char   *malloc();
-char   *copy();
-
-main(argc, argv)
-char **argv;
-{
-       register int n;
-       register struct passwd *lp;
-       register char **p;
-
-       for(n=0; n<NUID; n++)
-               du[n].uid = n;
-       while((lp=getpwent()) != 0) {
-               n = lp->pw_uid;
-               if (n>NUID)
-                       continue;
-               if(du[n].name)
-                       continue;
-               du[n].name = copy(lp->pw_name);
-       }
-       if (argc == 1) {
-               for (p = dargv; *p;) {
-                       check(*p++);
-                       report();
-               }
-               return(0);
-       }
-       while (--argc) {
-               argv++;
-               if (argv[0][0]=='-') {
-                       if (argv[0][1]=='n')
-                               nflg++;
-                       else if (argv[0][1]=='f')
-                               fflg++;
-                       else if (argv[0][1]=='c')
-                               cflg++;
-               } else {
-                       check(*argv);
-                       report();
-               }
-       }
-       return(0);
-}
-
-check(file)
-char *file;
-{
-       register unsigned i, j;
-       register c;
-
-       fi = open(file, 0);
-       if (fi < 0) {
-               printf("cannot open %s\n", file);
-               return;
-       }
-       printf("%s:\n", file);
-       sync();
-       bread(1, (char *)&sblock, sizeof sblock);
-       nfiles = (sblock.s_isize-2)*(BSIZE/sizeof(struct dinode));
-       ino = 0;
-       if (nflg) {
-               if (isdigit(c = getchar()))
-                       ungetc(c, stdin);
-               else while (c!='\n' && c != EOF)
-                       c = getchar();
-       }
-       for(i=2; ino<nfiles; i += ITABSZ/ISIZ) {
-               bread(i, (char *)itab, sizeof itab);
-               for (j=0; j<ITABSZ && ino<nfiles; j++) {
-                       ino++;
-                       acct(&itab[j]);
-               }
-       }
-}
-
-acct(ip)
-register struct dinode *ip;
-{
-       register n;
-       register char *np;
-       static fino;
-
-       if ((ip->di_mode&IFMT) == 0)
-               return;
-       if (cflg) {
-               if ((ip->di_mode&IFMT)!=IFDIR && (ip->di_mode&IFMT)!=IFREG)
-                       return;
-               n = (ip->di_size+BSIZE-1)/BSIZE;
-               if (n >= TSIZE) {
-                       overflow += n;
-                       n = TSIZE-1;
-               }
-               sizes[n]++;
-               return;
-       }
-       if (ip->di_uid >= NUID)
-               return;
-       du[ip->di_uid].blocks += (ip->di_size+BSIZE-1)/BSIZE;
-       du[ip->di_uid].nfiles++;
-       if (nflg) {
-       tryagain:
-               if (fino==0)
-                       if (scanf("%d", &fino)<=0)
-                               return;
-               if (fino > ino)
-                       return;
-               if (fino<ino) {
-                       while ((n=getchar())!='\n' && n!=EOF)
-                               ;
-                       fino = 0;
-                       goto tryagain;
-               }
-               if (np = du[ip->di_uid].name)
-                       printf("%.7s    ", np);
-               else
-                       printf("%d      ", ip->di_uid);
-               while ((n = getchar())==' ' || n=='\t')
-                       ;
-               putchar(n);
-               while (n!=EOF && n!='\n') {
-                       n = getchar();
-                       putchar(n);
-               }
-               fino = 0;
-       }
-}
-
-bread(bno, buf, cnt)
-unsigned bno;
-char *buf;
-{
-
-       lseek(fi, (long)bno*BSIZE, 0);
-       if (read(fi, buf, cnt) != cnt) {
-               printf("read error %u\n", bno);
-               exit(1);
-       }
-}
-
-qcmp(p1, p2)
-register struct du *p1, *p2;
-{
-       if (p1->blocks > p2->blocks)
-               return(-1);
-       if (p1->blocks < p2->blocks)
-               return(1);
-       return(strcmp(p1->name, p2->name));
-}
-
-report()
-{
-       register i;
-
-       if (nflg)
-               return;
-       if (cflg) {
-               long t = 0;
-               for (i=0; i<TSIZE-1; i++)
-                       if (sizes[i]) {
-                               t += i*sizes[i];
-                               printf("%d      %d      %D\n", i, sizes[i], t);
-                       }
-               printf("%d      %d      %D\n", TSIZE-1, sizes[TSIZE-1], overflow+t);
-               return;
-       }
-       qsort(du, NUID, sizeof(du[0]), qcmp);
-       for (i=0; i<NUID; i++) {
-               if (du[i].blocks==0)
-                       return;
-               printf("%5D\t", du[i].blocks);
-               if (fflg)
-                       printf("%5D\t", du[i].nfiles);
-               if (du[i].name)
-                       printf("%s\n", du[i].name);
-               else
-                       printf("#%d\n", du[i].uid);
-       }
-}
-
-char *
-copy(s)
-char *s;
-{
-       register char *p;
-       register n;
-
-       for(n=0; s[n]; n++)
-               ;
-       p = malloc((unsigned)n+1);
-       for(n=0; p[n] = s[n]; n++)
-               ;
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/random.c b/.ref-Research-V7/usr/src/cmd/random.c
deleted file mode 100644 (file)
index 8242d8b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdio.h>
-#define MAXINT 32768.
-float fract = 2;
-double atof();
-char rflag,eflag,c;
-char ibuf[BUFSIZ],obuf[BUFSIZ],line[BUFSIZ];
-main(argc,argv) char **argv;
-{
-       long tvec;
-       int i;
-       for(i=1;i<argc;i++)
-       {       if(*argv[i]!='-')
-                       fract=atof(argv[i]);
-               else if((c=argv[i][1])=='e')
-                       eflag=1;
-               else if(c=='r')
-                       rflag=1;
-       }
-       time(&tvec);
-       srand((int)tvec);
-       if(!rflag && !eflag)
-       {       setbuf(stdin,ibuf);
-               setbuf(stdout,obuf);
-       }
-       for(;eflag==0;)
-       {       gets(line);
-               if(feof(stdin)) break;
-               if(rand()/MAXINT*fract<1) puts(line);
-       }
-       exit((int)(rand()/MAXINT*fract));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ranlib.c b/.ref-Research-V7/usr/src/cmd/ranlib.c
deleted file mode 100644 (file)
index a0b6e91..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-#include       <ar.h>
-#include       <a.out.h>
-#include       <stdio.h>
-#define        MAGIC   exp.a_magic
-#define        BADMAG  MAGIC!=A_MAGIC1 && MAGIC!=A_MAGIC2  \
-               && MAGIC!=A_MAGIC3 && MAGIC!=A_MAGIC4
-struct ar_hdr  arp;
-struct exec    exp;
-FILE   *fi, *fo;
-long   off, oldoff;
-long   ftell();
-#define TABSZ  700
-struct tab
-{      char cname[8];
-       long cloc;
-} tab[TABSZ];
-int tnum;
-int new;
-char   tempnm[] = "__.SYMDEF";
-char   firstname[17];
-long   offdelta;
-
-main(argc, argv)
-char **argv;
-{
-       char buf[256];
-
-       --argc;
-       while(argc--) {
-               fi = fopen(*++argv,"r");
-               if (fi == NULL) {
-                       fprintf(stderr, "nm: cannot open %s\n", *argv);
-                       continue;
-               }
-               off = sizeof(exp.a_magic);
-               fread((char *)&exp, 1, sizeof(MAGIC), fi);      /* get magic no. */
-               if (MAGIC != ARMAG)
-               {       fprintf(stderr, "not archive: %s\n", *argv);
-                       continue;
-               }
-               fseek(fi, 0L, 0);
-               new = tnum = 0;
-               if(nextel(fi) == 0)
-               {       fclose(fi);
-                       continue;
-               }
-               do {
-                       long o;
-                       register n;
-                       struct nlist sym;
-
-                       fread((char *)&exp, 1, sizeof(struct exec), fi);
-                       if (BADMAG)             /* archive element not in  */
-                               continue;       /* proper format - skip it */
-                       o = (long)exp.a_text + exp.a_data;
-                       if ((exp.a_flag & 01) == 0)
-                               o *= 2;
-                       fseek(fi, o, 1);
-                       n = exp.a_syms / sizeof(struct nlist);
-                       if (n == 0) {
-                               fprintf(stderr, "nm: %s-- no name list\n", arp.ar_name);
-                               continue;
-                       }
-                       while (--n >= 0) {
-                               fread((char *)&sym, 1, sizeof(sym), fi);
-                               if ((sym.n_type&N_EXT)==0)
-                                       continue;
-                               switch (sym.n_type&N_TYPE) {
-
-                               case N_UNDF:
-                                       continue;
-
-                               default:
-                                       stash(&sym);
-                                       continue;
-                               }
-                       }
-               } while(nextel(fi));
-               new = fixsize();
-               fclose(fi);
-               fo = fopen(tempnm, "w");
-               if(fo == NULL)
-               {       fprintf(stderr, "can't create temporary\n");
-                       exit(1);
-               }
-               fwrite((char *)tab, tnum, sizeof(struct tab), fo);
-               fclose(fo);
-               if(new)
-                       sprintf(buf, "ar rlb %s %s %s\n", firstname, *argv, tempnm);
-               else    sprintf(buf, "ar rl %s %s\n", *argv, tempnm);
-               if(system(buf))
-                       fprintf(stderr, "can't execute %s\n", buf);
-               else fixdate(*argv);
-               unlink(tempnm);
-       }
-       exit(0);
-}
-
-nextel(af)
-FILE *af;
-{
-       register r;
-
-       oldoff = off;
-       fseek(af, off, 0);
-       r = fread((char *)&arp, 1, sizeof(struct ar_hdr), af);  /* read archive header */
-       if (r <= 0)
-               return(0);
-       if (arp.ar_size & 1)
-               ++arp.ar_size;
-       off = ftell(af) + arp.ar_size;  /* offset to next element */
-       return(1);
-}
-
-stash(s) struct nlist *s;
-{      int i;
-       if(tnum >= TABSZ)
-       {       fprintf(stderr, "symbol table overflow\n");
-               exit(1);
-       }
-       for(i=0; i<8; i++)
-               tab[tnum].cname[i] = s->n_name[i];
-       tab[tnum].cloc = oldoff;
-       tnum++;
-}
-
-fixsize()
-{      int i;
-       offdelta = tnum * sizeof(struct tab) + sizeof(arp);
-       off = sizeof(MAGIC);
-       nextel(fi);
-       if(strncmp(arp.ar_name, tempnm, 14) == 0)
-       {       new = 0;
-               offdelta -= sizeof(arp) + arp.ar_size;
-       }
-       else
-       {       new = 1;
-               strncpy(firstname, arp.ar_name, 14);
-       }
-       for(i=0; i<tnum; i++)
-               tab[i].cloc += offdelta;
-       return(new);
-}
-
-/* patch time */
-fixdate(s) char *s;
-{      long timex, time();
-       int fd;
-       fd = open(s, 1);
-       if(fd < 0)
-       {       fprintf(stderr, "can't reopen %s\n", s);
-               return;
-       }
-       timex = time(NULL) + 5; /* should be enough time */
-       lseek(fd, (long)sizeof(exp.a_magic) + ((char *)&arp.ar_date-(char *)&arp), 0);
-       write(fd, (char *)&timex, sizeof(timex));
-       close(fd);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/makefile b/.ref-Research-V7/usr/src/cmd/ratfor/makefile
deleted file mode 100644 (file)
index 01f2151..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-CFLAGS = -n -O -s
-
-all:   ratfor
-
-cp:    ratfor
-       cp ratfor /bin
-       rm y.tab.c *.o ratfor y.tab.h
-
-cmp:   ratfor
-       cmp ratfor /bin/ratfor
-       rm y.tab.c *.o ratfor y.tab.h
-
-ratfor:        r0.o r1.o r2.o rio.o rlook.o rlex.o y.tab.o
-       cc $(CFLAGS) r*.o y.tab.o -o ratfor
-
-r0.o:  r.h y.tab.h r0.c
-r1.o:  r.h y.tab.h r1.c
-r2.o:  r.h y.tab.h r2.c
-rio.o: r.h y.tab.h rio.c
-rlook.o:       r.h y.tab.h rlook.c
-rlex.o:        r.h y.tab.h rlex.c
-y.tab.c:       r.g
-       yacc -d r.g
-y.tab.h:       r.g
-       yacc -d r.g
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/r.g b/.ref-Research-V7/usr/src/cmd/ratfor/r.g
deleted file mode 100644 (file)
index c692f2c..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-%{
-extern int transfer;
-extern int     indent;
-%}
-
-%term  IF ELSE FOR WHILE BREAK NEXT 
-%term  DIGITS DO
-%term  GOK DEFINE INCLUDE
-%term  REPEAT UNTIL
-%term  RETURN
-%term  SWITCH CASE DEFAULT
-%%
-
-statl  : statl  stat
-       |
-       ;
-stat   : if stat       ={ indent--; outcont($1); }
-       | ifelse stat   ={ indent--; outcont($1+1); }
-       | switch fullcase '}'   ={ endsw($1, $2); }
-       | while stat    ={ whilestat($1); }
-       | for stat      ={ forstat($1); }
-       | repeat stat UNTIL     ={ untils($1,1); }
-       | repeat stat           ={ untils($1,0); }
-       | BREAK ={ breakcode(); }
-       | NEXT          ={ nextcode(); }
-       | do stat       ={ dostat($1); }
-       | GOK           ={ gokcode($1); }
-       | RETURN        ={ retcode(); }
-       | ';'
-       | '{' statl '}'
-       | label stat
-       | error         ={ errcode(); yyclearin; }
-       ;
-switch : sw '{'
-       ;
-sw     : SWITCH        ={ swcode(); }
-       ;
-fullcase: caselist     ={ $$ = 0; }
-       | caselist defpart      ={ $$ = 1; }
-       ;
-caselist: casepart
-       | caselist casepart
-       ;
-defpart        : default statl
-       ;
-default        : DEFAULT       ={ getdefault(); }
-       ;
-casepart: case statl
-       ;
-case   : CASE  ={ getcase(); }
-       ;
-label  : DIGITS        ={ transfer = 0; outcode($1); }
-       ;
-if     : IF            ={ ifcode(); }
-       ;
-ifelse : if stat ELSE  ={ elsecode($1); }
-       ;
-while  : WHILE ={ whilecode(); }
-       ;
-for    : FOR           ={ forcode(); }
-       ;
-repeat : REPEAT        ={ repcode(); }
-       ;
-do     : DO            ={ docode(); }
-       ;
-%%
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/r.h b/.ref-Research-V7/usr/src/cmd/ratfor/r.h
deleted file mode 100644 (file)
index 47a6ee7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#include <stdio.h>
-#include "y.tab.h"
-
-#
-#define        putbak(c)       *ip++ = c
-/*     #define getchr()        (ip>ibuf?*--ip: getc(infile[infptr]))   */
-
-#define        LET     1
-#define        DIG     2
-#define        CRAP    3
-#define        COMMENT '#'
-#define        QUOTE   '"'
-
-extern int     transfer;
-
-#define        INDENT  3       /* indent delta */
-#ifdef gcos
-#define        CONTFLD 6
-#endif
-#ifdef unix
-#define        CONTFLD 1
-#endif
-extern int     contfld;        /* column for continuation char */
-extern int     contchar;
-extern int     dbg;
-extern int     yyval;
-extern int     *yypv;
-extern int     yylval;
-extern int     errorflag;
-
-extern char    comment[];      /* save input comments here */
-extern int     comptr; /* next free slot in comment */
-extern int     printcom;       /* print comments, etc., if on */
-extern int     indent; /* level of nesting for indenting */
-
-extern char    ibuf[];
-extern char    *ip;
-
-extern FILE    *outfil;        /* output file id */
-extern FILE    *infile[];
-extern char    *curfile[];
-extern int     infptr;
-extern int     linect[];
-
-extern char    fcname[];
-
-extern int     svargc;
-extern char    **svargv;
-
-#define EOS 0
-#define        HSHSIZ  101
-struct nlist {
-       char    *name;
-       char    *def;
-       int     ydef;
-       struct  nlist *next;
-};
-
-struct nlist   *lookup();
-char   *install();
-char   *malloc();
-extern char    *fcnloc;
-
-extern char    type[];
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/r0.c b/.ref-Research-V7/usr/src/cmd/ratfor/r0.c
deleted file mode 100644 (file)
index 3d84e70..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#include "r.h"
-
-int    swlevel = -1;
-int    swexit[5];
-int    nextcase[5];
-
-swcode() {
-       transfer = 0;
-       putcom("switch");
-       swlevel++;
-       if (swlevel >= 5)
-               error("Switches nested > 5");
-       swexit[swlevel] = yyval = genlab(1);
-       outcode("\tI");
-       outnum(yyval);
-       outcode(" = ");
-       balpar();
-       outdon();
-       nextcase[swlevel] = 0;
-       indent++;
-}
-
-getcase() {
-       int t, lpar;
-       char token[100];
-
-       if (nextcase[swlevel] != 0) {
-               outgoto(swexit[swlevel]);
-               outcont(nextcase[swlevel]);
-       }
-       indent--;
-       outcode("\tif(.not.(");
-       do {
-               outcode("I");
-               outnum(swexit[swlevel]);
-               outcode(".eq.(");
-               lpar = 0;
-               do {
-                       if ((t=gtok(token)) == ':')
-                               break;
-                       if (t == '(')
-                               lpar++;
-                       else if (t == ')')
-                               lpar--;
-                       else if (t == ',') {
-                               if (lpar == 0)
-                                       break;
-                               }
-                       outcode(token);
-               } while (lpar >= 0);
-               if (lpar < 0)
-                       error("Missing left parenthesis in case");
-               if (t == ',')
-                       outcode(").or.");
-       } while (t != ':');
-       if (lpar != 0)
-               error("Missing parenthesis in case");
-       outcode(")))");
-       nextcase[swlevel] = genlab(1);
-       outgoto(nextcase[swlevel]);
-       indent++;
-}
-
-getdefault() {
-       char token[20];
-       if (gnbtok(token) != ':')
-               error("Missing colon after default");
-       outgoto(swexit[swlevel]);
-       outcont(nextcase[swlevel]);
-       indent--;
-       putcom("default");
-       indent++;
-}
-
-endsw(n, def) {
-       if (def == 0)
-               outcont(nextcase[swlevel]);
-       swlevel--;
-       if (swlevel < -1)
-               error("Switches unwound too far");
-       indent--;
-       outcont(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/r1.c b/.ref-Research-V7/usr/src/cmd/ratfor/r1.c
deleted file mode 100644 (file)
index 2f1d7a5..0000000
+++ /dev/null
@@ -1,372 +0,0 @@
-#include "r.h"
-
-#define        wasbreak        brkused[brkptr]==1 || brkused[brkptr]==3
-#define        wasnext brkused[brkptr]==2 || brkused[brkptr]==3
-
-int    transfer        = 0;    /* 1 if just finished retrun, break, next */
-
-char   fcname[10];
-char   scrat[500];
-
-int    brkptr  = -1;
-int    brkstk[10];     /* break label */
-int    typestk[10];    /* type of loop construct */
-int    brkused[10];    /* loop contains BREAK or NEXT */
-
-int    forptr  = 0;
-char   *forstk[10];
-
-repcode() {
-       transfer = 0;
-       outcont(0);
-       putcom("repeat");
-       yyval = genlab(3);
-       indent++;
-       outcont(yyval);
-       brkstk[++brkptr] = yyval+1;
-       typestk[brkptr] = REPEAT;
-       brkused[brkptr] = 0;
-}
-
-untils(p1,un) int p1,un; {
-       outnum(p1+1);
-       outtab();
-       if (un > 0) {
-               outcode("if(.not.");
-               balpar();
-               outcode(")");
-       }
-       transfer = 0;
-       outgoto(p1);
-       indent--;
-       if (wasbreak)
-               outcont(p1+2);
-       brkptr--;
-}
-
-ifcode() {
-       transfer = 0;
-       outtab();
-       outcode("if(.not.");
-       balpar();
-       outcode(")");
-       outgoto(yyval=genlab(2));
-       indent++;
-}
-
-elsecode(p1) {
-       outgoto(p1+1);
-       indent--;
-       putcom("else");
-       indent++;
-       outcont(p1);
-}
-
-whilecode() {
-       transfer = 0;
-       outcont(0);
-       putcom("while");
-       brkstk[++brkptr] = yyval = genlab(2);
-       typestk[brkptr] = WHILE;
-       brkused[brkptr] = 0;
-       outnum(yyval);
-       outtab();
-       outcode("if(.not.");
-       balpar();
-       outcode(")");
-       outgoto(yyval+1);
-       indent++;
-}
-
-whilestat(p1) int p1; {
-       outgoto(p1);
-       indent--;
-       putcom("endwhile");
-       outcont(p1+1);
-       brkptr--;
-}
-
-balpar() {
-       register c, lpar;
-       while ((c=gtok(scrat)) == ' ' || c == '\t')
-               ;
-       if (c != '(') {
-               error("missing left paren");
-               return;
-       }
-       outcode(scrat);
-       lpar = 1;
-       do {
-               c = gtok(scrat);
-               if (c==';' || c=='{' || c=='}' || c==EOF) {
-                       pbstr(scrat);
-                       break;
-               }
-               if (c=='(')
-                       lpar++;
-               else if (c==')')
-                       lpar--;
-               else if (c == '\n') {
-                       while ((c = gtok(scrat)) == ' ' || c=='\t' || c=='\n')
-                               ;
-                       pbstr(scrat);
-                       continue;
-               }
-               else if (c == '=' && scrat[1] == '\0')
-                       error("assigment inside conditional");
-               outcode(scrat);
-       } while (lpar > 0);
-       if (lpar != 0)
-               error("missing parenthesis");
-}
-
-int    labval  = 23000;
-
-genlab(n){
-       labval += n;
-       return(labval-n);
-}
-
-gokcode(p1) {
-       transfer = 0;
-       outtab();
-       outcode(p1);
-       eatup();
-       outdon();
-}
-
-eatup() {
-       int t, lpar;
-       char temp[100];
-       lpar = 0;
-       do {
-               if ((t = gtok(scrat)) == ';' || t == '\n')
-                       break;
-               if (t == '{' || t == '}' || t == EOF) {
-                       pbstr(scrat);
-                       break;
-               }
-               if (t == ',' || t == '+' || t == '-' || t == '*' || t == '('
-                 || t == '&' || t == '|' || t == '=') {
-                       while (gtok(temp) == '\n')
-                               ;
-                       pbstr(temp);
-               }
-               if (t == '(')
-                       lpar++;
-               else if (t==')') {
-                       lpar--;
-                       if (lpar < 0) {
-                               error("missing left paren");
-                               return(1);
-                       }
-               }
-               outcode(scrat);
-       } while (lpar >= 0);
-       if (lpar > 0) {
-               error("missing right paren");
-               return(1);
-       }
-       return(0);
-}
-
-forcode(){
-       int lpar, t;
-       char *ps, *qs;
-
-       transfer = 0;
-       outcont(0);
-       putcom("for");
-       yyval = genlab(3);
-       brkstk[++brkptr] = yyval+1;
-       typestk[brkptr] = FOR;
-       brkused[brkptr] = 0;
-       forstk[forptr++] = malloc(1);
-       if ((t = gnbtok(scrat)) != '(') {
-               error("missing left paren in FOR");
-               pbstr(scrat);
-               return;
-       }
-       if (gnbtok(scrat) != ';') {     /* real init clause */
-               pbstr(scrat);
-               outtab();
-               if (eatup() > 0) {
-                       error("illegal FOR clause");
-                       return;
-               }
-               outdon();
-       }
-       if (gnbtok(scrat) == ';')       /* empty condition */
-               outcont(yyval);
-       else {  /* non-empty condition */
-               pbstr(scrat);
-               outnum(yyval);
-               outtab();
-               outcode("if(.not.(");
-               for (lpar=0; lpar >= 0;) {
-                       if ((t = gnbtok(scrat)) == ';')
-                               break;
-                       if (t == '(')
-                               lpar++;
-                       else if (t == ')') {
-                               lpar--;
-                               if (lpar < 0) {
-                                       error("missing left paren in FOR clause");
-                                       return;
-                               }
-                       }
-                       if (t != '\n')
-                               outcode(scrat);
-               }
-               outcode("))");
-               outgoto(yyval+2);
-               if (lpar < 0)
-                       error("invalid FOR clause");
-       }
-       ps = scrat;
-       for (lpar=0; lpar >= 0;) {
-               if ((t = gtok(ps)) == '(')
-                       lpar++;
-               else if (t == ')')
-                       lpar--;
-               if (lpar >= 0 && t != '\n')
-                       while(*ps)
-                               ps++;
-       }
-       *ps = '\0';
-       qs = forstk[forptr-1] = malloc((unsigned)(ps-scrat+1));
-       ps = scrat;
-       while (*qs++ = *ps++)
-               ;
-       indent++;
-}
-
-forstat(p1) int p1; {
-       char *bp, *q;
-       bp = forstk[--forptr];
-       if (wasnext)
-               outnum(p1+1);
-       if (nonblank(bp)){
-               outtab();
-               outcode(bp);
-               outdon();
-       }
-       transfer = 0;
-       outgoto(p1);
-       indent--;
-       putcom("endfor");
-       outcont(p1+2);
-       for (q=bp; *q++;);
-       free(bp);
-       brkptr--;
-}
-
-retcode() {
-       register c;
-       if ((c = gnbtok(scrat)) != '\n' && c != ';' && c != '}') {
-               pbstr(scrat);
-               outtab();
-               outcode(fcname);
-               outcode(" = ");
-               eatup();
-               outdon();
-       }
-       else if (c == '}')
-               pbstr(scrat);
-       outtab();
-       outcode("return");
-       outdon();
-       transfer = 1;
-}
-
-docode() {
-       transfer = 0;
-       outtab();
-       outcode("do ");
-       yyval = genlab(2);
-       brkstk[++brkptr] = yyval;
-       typestk[brkptr] = DO;
-       brkused[brkptr] = 0;
-       outnum(yyval);
-       eatup();
-       outdon();
-       indent++;
-}
-
-dostat(p1) int p1; {
-       outcont(p1);
-       indent--;
-       if (wasbreak)
-               outcont(p1+1);
-       brkptr--;
-}
-
-#ifdef gcos
-#define        atoi(s) (*s-'0')        /* crude!!! */
-#endif
-
-breakcode() {
-       int level, t;
-
-       level = 0;
-       if ((t=gnbtok(scrat)) == DIG)
-               level = atoi(scrat) - 1;
-       else if (t != ';')
-               pbstr(scrat);
-       if (brkptr-level < 0)
-               error("illegal BREAK");
-       else {
-               outgoto(brkstk[brkptr-level]+1);
-               brkused[brkptr-level] |= 1;
-       }
-       transfer = 1;
-}
-
-nextcode() {
-       int level, t;
-
-       level = 0;
-       if ((t=gnbtok(scrat)) == DIG)
-               level = atoi(scrat) - 1;
-       else if (t != ';')
-               pbstr(scrat);
-       if (brkptr-level < 0)
-               error("illegal NEXT");
-       else {
-               outgoto(brkstk[brkptr-level]);
-               brkused[brkptr-level] |= 2;
-       }
-       transfer = 1;
-}
-
-nonblank(s) char *s; {
-       int c;
-       while (c = *s++)
-               if (c!=' ' && c!='\t' && c!='\n')
-                       return(1);
-       return(0);
-}
-
-int    errorflag       = 0;
-
-error(s1) char *s1; {
-       if (errorflag == 0)
-               fprintf(stderr, "ratfor:");
-       fprintf(stderr, "error at line %d, file %s: ",linect[infptr],curfile[infptr]);
-       fprintf(stderr, s1);
-       fprintf(stderr, "\n");
-       errorflag = 1;
-}
-
-errcode() {
-       int c;
-       if (errorflag == 0)
-               fprintf(stderr, "******\n");
-       fprintf(stderr, "*****F ratfor:");
-       fprintf(stderr, "syntax error, line %d, file %s\n", linect[infptr], curfile[infptr]);
-       while ((c=getchr())!=';' && c!='}' && c!='\n' && c!=EOF && c!='\0')
-               ;
-       if (c == EOF || c == '\0')
-               putbak(c);
-       errorflag = 1;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/r2.c b/.ref-Research-V7/usr/src/cmd/ratfor/r2.c
deleted file mode 100644 (file)
index 435933c..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-#include "r.h"
-
-extern int hollerith;
-
-char   outbuf[80];
-int    outp    = 0;
-int    cont    = 0;
-int    contchar        = '&';
-
-char   comment[320];
-int    comptr  = 0;
-int    indent  = 0;
-
-outdon() {
-       outbuf[outp] = '\0';
-       if (outp > 0)
-               fprintf(outfil, "%s\n", outbuf);
-       outp = cont = 0;
-}
-
-putcom(s) char *s; {
-       if (printcom) {
-               ptc('c');
-               outtab();
-               pts(s);
-               outdon();
-       }
-}
-
-outcode(xp) char *xp; {
-       register c, c1, j;
-       char *q, *p;
-
-       p = (char *) xp;        /* shut lint up */
-       if (cont == 0 && comptr > 0)    /* flush comment if not on continuation */
-               flushcom();
-       while( (c = *p++) ){
-               c1 = *p;
-               if (type[c] == LET || type[c] == DIG) {
-                       pts(p-1);
-                       break;
-               }
-               switch(c){
-
-               case '"': case '\'':
-                       j = 0;
-                       for (q=p; *q; q++) {
-                               if (*q == '\\')
-                                       q++;
-                               j++;
-                       }
-                       if (outp+j+2 > 71)
-                               contcard();
-                       if (hollerith) {
-                               outnum(--j);
-                               ptc('h');
-                       } else
-                               ptc(c);
-                       while (*p != c) {
-                               if (*p == '\\')
-                                       p++;
-                               ptc(*p++);
-                       }
-                       if (!hollerith)
-                               ptc(c);
-                       p++;
-                       break;
-               case '$': case '\\':
-                       if (strlen(p-1)+outp > 71)
-                               contcard();
-                       if (c1 == '"' || c1 == '\'') {
-                               ptc(c1);
-                               p++;
-                       } else
-                               for (p--; *p; p++)
-                                       ptc(*p);
-                       break;
-               case '%':
-                       outp = 0;
-                       while (*p)
-                               ptc(*p++);
-                       break;
-               case '>':
-                       if( c1=='=' ){
-                               pts(".ge."); p++;
-                       } else
-                               pts(".gt.");
-                       break;
-               case '<':
-                       if( c1=='=' ){
-                               pts(".le."); p++;
-                       } else if( c1=='>' ){
-                               pts(".ne."); p++;
-                       } else
-                               pts(".lt.");
-                       break;
-               case '=':
-                       if( c1=='=' ){
-                               pts(".eq."); p++;
-                       } else
-                               ptc('=');
-                       break;
-               case '!': case '^':
-                       if( c1=='=' ){
-                               pts(".ne."); p++;
-                       } else
-                               pts(".not.");
-                       break;
-               case '&':
-                       if( c1=='&' )
-                               p++;
-                       pts(".and.");
-                       break;
-               case '|':
-                       if( c1=='|' )
-                               p++;
-                       pts(".or.");
-                       break;
-               case '\t':
-                       outtab();
-                       break;
-               case '\n':
-                       ptc(' ');
-                       break;
-               default:
-                       ptc(c);
-                       break;
-               }
-       }
-}
-
-ptc(c) char c; {
-       if( outp > 71 )
-               contcard();
-       outbuf[outp++] = c;
-}
-
-pts(s) char *s; {
-       if (strlen(s)+outp > 71)
-               contcard();
-       while(*s)
-               ptc(*s++);
-}
-
-contcard(){
-       int n;
-       outbuf[outp] = '\0';
-       fprintf(outfil, "%s\n", outbuf);
-       n = 6;
-       if (printcom) {
-               n += INDENT * indent + 1;
-               if (n > 35) n = 35;
-       }
-       for( outp=0; outp<n; outbuf[outp++] = ' ' );
-       outbuf[contfld-1] = contchar;
-       cont++;
-       if (cont > 19)
-               error("more than 19 continuation cards");
-}
-
-outtab(){
-       int n;
-       n = 6;
-       if (printcom) {
-               n += INDENT * indent;
-               if (n > 35) n = 35;
-       }
-       while (outp < n)
-               ptc(' ');
-}
-
-outnum(n) int n; {
-       int a;
-       if( a = n/10 )
-               outnum(a);
-       ptc(n%10 + '0');
-}
-
-outcont(n) int n; {
-       transfer = 0;
-       if (n == 0 && outp == 0)
-               return;
-       if( n > 0 )
-               outnum(n);
-       outcode("\tcontinue");
-       outdon();
-}
-
-outgoto(n) int n; {
-       if (transfer != 0)
-               return;
-       outcode("\tgoto ");
-       outnum(n);
-       outdon();
-}
-
-flushcom() {
-       int i, j;
-       if (printcom == 0)
-               comptr = 0;
-       else if (cont == 0 && comptr > 0) {
-               for (i=j=0; i < comptr; i++)
-                       if (comment[i] == '\n') {
-                               comment[i] = '\0';
-                               fprintf(outfil, "%s\n", &comment[j]);
-                               j = i + 1;
-                       }
-               comptr = 0;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/rio.c b/.ref-Research-V7/usr/src/cmd/ratfor/rio.c
deleted file mode 100644 (file)
index 0855ccf..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-#include "r.h"
-#define        BUFSIZE 512
-char   ibuf[BUFSIZE];
-char   *ip = ibuf;
-
-char   type[] {
-       0,      CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,
-       CRAP,   '\t',   '\n',   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,
-       CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,
-       CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,   CRAP,
-       ' ',    '!',    '"',    '#',    '$',    '%',    '&',    '\'',
-       '(',    ')',    '*',    '+',    ',',    '-',    '.',    '/',
-       DIG,    DIG,    DIG,    DIG,    DIG,    DIG,    DIG,    DIG,
-       DIG,    DIG,    ':',    ';',    '<',    '=',    '>',    '?',
-       '@',    LET,    LET,    LET,    LET,    LET,    LET,    LET,
-       LET,    LET,    LET,    LET,    LET,    LET,    LET,    LET,
-       LET,    LET,    LET,    LET,    LET,    LET,    LET,    LET,
-       LET,    LET,    LET,    '[',    '\\',   ']',    '^',    '_',
-       '`',    LET,    LET,    LET,    LET,    LET,    LET,    LET,
-       LET,    LET,    LET,    LET,    LET,    LET,    LET,    LET,
-       LET,    LET,    LET,    LET,    LET,    LET,    LET,    LET,
-       LET,    LET,    LET,    '{',    '|',    '}',    '~',    0,
-};
-
-gtok(s) char *s; {     /* get token into s */
-       register c, t;
-       register char *p;
-       struct nlist *q;
-
-       for(;;) {
-               p = s;
-               *p++ = c = getchr();
-               switch(t = type[c]) {
-               case 0:
-                       if (infptr > 0) {
-                               fclose(infile[infptr]);
-                               infptr--;
-                               continue;
-                       }
-                       if (svargc > 1) {
-                               svargc--;
-                               svargv++;
-                               if (infile[infptr] != stdin)
-                                       fclose(infile[infptr]);
-                               if( (infile[infptr] = fopen(*svargv,"r")) == NULL )
-                                       cant(*svargv);
-                               linect[infptr] = 0;
-                               curfile[infptr] = *svargv;
-                               continue;
-                       }
-                       return(EOF);    /* real eof */
-               case ' ':
-               case '\t':
-                       while ((c = getchr()) == ' ' || c == '\t')
-                               ;       /* skip others */
-                       if (c == COMMENT || c == '_') {
-                               putbak(c);
-                               continue;
-                       }
-                       if (c != '\n') {
-                               putbak(c);
-                               *p = '\0';
-                               return(' ');
-                       } else {
-                               *s = '\n';
-                               *(s+1) = '\0';
-                               return(*s);
-                       }
-               case '_':
-                       while ((c = getchr()) == ' ' || c == '\t')
-                               ;
-                       if (c == COMMENT) {
-                               putbak(c);
-                               gtok(s);        /* recursive */
-                       }
-                       else if (c != '\n')
-                               putbak(c);
-                       continue;
-               case LET:
-               case DIG:
-                       while ((t=type[*p = getchr()]) == LET || t == DIG)
-                               p++;
-                       putbak(*p);
-                       *p = '\0';
-                       if ((q = lookup(s))->name != NULL && q->ydef == 0) {    /* found but not keyword */
-                               if (q->def != fcnloc) { /* not "function" */
-                                       pbstr(q->def);
-                                       continue;
-                               }
-                               getfname();     /* recursive gtok */
-                       }
-                       for (p=s; *p; p++)
-                               if (*p>='A' && *p<='Z')
-                                       *p += 'a' - 'A';
-                       for (p=s; *p; p++)
-                               if (*p < '0' || *p > '9')
-                                       return(LET);
-                       return(DIG);
-               case '[':
-                       *p = '\0';
-                       return('{');
-               case ']':
-                       *p = '\0';
-                       return('}');
-               case '$':
-               case '\\':
-                       if ((*p = getchr()) == '(' || *p == ')') {
-                               putbak(*p=='(' ? '{' : '}');
-                               continue;
-                       }
-                       if (*p == '"' || *p == '\'')
-                               p++;
-                       else
-                               putbak(*p);
-                       *p = '\0';
-                       return('$');
-               case COMMENT:
-                       comment[comptr++] = 'c';
-                       while ((comment[comptr++] = getchr()) != '\n')
-                               ;
-                       flushcom();
-                       *s = '\n';
-                       *(s+1) = '\0';
-                       return(*s);
-               case '"':
-               case '\'':
-                       for (; (*p = getchr()) != c; p++) {
-                               if (*p == '\\')
-                                       *++p = getchr();
-                               if (*p == '\n') {
-                                       error("missing quote");
-                                       putbak('\n');
-                                       break;
-                               }
-                       }
-                       *p++ = c;
-                       *p = '\0';
-                       return(QUOTE);
-               case '%':
-                       while ((*p = getchr()) != '\n')
-                               p++;
-                       putbak(*p);
-                       *p = '\0';
-                       return('%');
-               case '>': case '<': case '=': case '!': case '^':
-                       return(peek(p, '='));
-               case '&':
-                       return(peek(p, '&'));
-               case '|':
-                       return(peek(p, '|'));
-               case CRAP:
-                       continue;
-               default:
-                       *p = '\0';
-                       return(*s);
-               }
-       }
-}
-
-gnbtok(s) char *s; {
-       register c;
-       while ((c = gtok(s)) == ' ' || c == '\t')
-               ;
-       return(c);
-}
-
-getfname() {
-       while (gtok(fcname) == ' ')
-               ;
-       pbstr(fcname);
-       putbak(' ');
-}
-
-peek(p, c1) char *p, c1; {
-       register c;
-       c = *(p-1);
-       if ((*p = getchr()) == c1)
-               p++;
-       else
-               putbak(*p);
-       *p = '\0';
-       return(c);
-}
-
-pbstr(str)
-register char *str;
-{
-       register char *p;
-
-       p = str;
-       while (*p++);
-       --p;
-       if (ip >= &ibuf[BUFSIZE]) {
-               error("pushback overflow");
-               exit(1);
-       }
-       while (p > str)
-               putbak(*--p);
-}
-
-getchr() {
-       register c;
-
-       if (ip > ibuf)
-               return(*--ip);
-       c = getc(infile[infptr]);
-       if (c == '\n')
-               linect[infptr]++;
-       if (c == EOF)
-               return(0);
-       return(c);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/rlex.c b/.ref-Research-V7/usr/src/cmd/ratfor/rlex.c
deleted file mode 100644 (file)
index c150d24..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-# include "r.h"
-
-char *keyword [] = {
-       "do",
-       "if",
-       "else",
-       "for",
-       "repeat",
-       "until",
-       "while",
-       "break",
-       "next",
-       "define",
-       "include",
-       "return",
-       "switch",
-       "case",
-       "default",
-       0};
-
-int keytran[] = {
-       DO,
-       IF,
-       ELSE,
-       FOR,
-       REPEAT,
-       UNTIL,
-       WHILE,
-       BREAK,
-       NEXT,
-       DEFINE,
-       INCLUDE,
-       RETURN,
-       SWITCH,
-       CASE,
-       DEFAULT,
-       0};
-
-char   *fcnloc;        /* spot for "function" */
-
-int    svargc;
-char   **svargv;
-char   *curfile[10]    = { "" };
-int    infptr  = 0;
-FILE   *outfil = { stdout };
-FILE   *infile[10]     = { stdin };
-int    linect[10];
-
-int    contfld = CONTFLD;      /* place to put continuation char */
-int    printcom        = 0;    /* print comments if on */
-int    hollerith       = 0;    /* convert "..." to 27H... if on */
-
-#ifdef gcos
-char   *ratfor "tssrat";
-int    bcdrat[2];
-char   *bwkmeter       ".           bwkmeter    ";
-int    bcdbwk[5];
-#endif
-
-main(argc,argv) int argc; char **argv; {
-       int i;
-       while(argc>1 && argv[1][0]=='-') {
-               if(argv[1][1]=='6') {
-                       contfld=6;
-                       if (argv[1][2]!='\0')
-                               contchar = argv[1][2];
-               } else if (argv[1][1] == 'C')
-                       printcom++;
-               else if (argv[1][1] == 'h')
-                       hollerith++;
-               argc--;
-               argv++;
-       }
-
-#ifdef gcos
-       if (!intss()) {
-               _fixup();
-               ratfor = "batrat";
-       }
-       ascbcd(ratfor,bcdrat,6);
-       ascbcd(bwkmeter,bcdbwk,24);
-       acdata(bcdrat[0],1);
-       acupdt(bcdbwk[0]);
-       if (!intss()) {
-               if ((infile[infptr]=fopen("s*", "r")) == NULL)
-                       cant("s*");
-               if ((outfil=fopen("*s", "w")) == NULL)
-                       cant("*s");
-       }
-#endif
-
-       svargc = argc;
-       svargv = argv;
-       if (svargc > 1)
-               putbak('\0');
-       for (i=0; keyword[i]; i++)
-               install(keyword[i], "", keytran[i]);
-       fcnloc = install("function", "", 0);
-       yyparse();
-#ifdef gcos
-       if (!intss())
-               bexit(errorflag);
-#endif
-       exit(errorflag);
-}
-
-#ifdef gcos
-bexit(status) {
-       /* this is the batch version of exit for gcos tss */
-       FILE *inf, *outf;
-       char c;
-
-       fclose(stderr); /* make sure diagnostics get flushed */
-       if (status) /* abort */
-               _nogud();
-
-       /* good: copy output back to s*, call forty */
-
-       fclose(outfil,"r");
-       fclose(infile[0],"r");
-       inf = fopen("*s", "r");
-       outf = fopen("s*", "w");
-       while ((c=getc(inf)) != EOF)
-               putc(c, outf);
-       fclose(inf,"r");
-       fclose(outf,"r");
-       __imok();
-}
-#endif
-
-cant(s) char *s; {
-       linect[infptr] = 0;
-       curfile[infptr] = s;
-       error("can't open");
-       exit(1);
-}
-
-inclstat() {
-       int c;
-       char *ps;
-       char fname[100];
-       while ((c = getchr()) == ' ' || c == '\t');
-       if (c == '(') {
-               for (ps=fname; (*ps=getchr()) != ')'; ps++);
-               *ps = '\0';
-       } else if (c == '"' || c == '\'') {
-               for (ps=fname; (*ps=getchr()) != c; ps++);
-               *ps = '\0';
-       } else {
-               putbak(c);
-               for (ps=fname; (*ps=getchr()) != ' ' &&*ps!='\t' && *ps!='\n' && *ps!=';'; ps++);
-               *ps = '\0';
-       }
-       if ((infile[++infptr] = fopen(fname,"r")) == NULL) {
-               cant(fname);
-               exit(1);
-       }
-       linect[infptr] = 0;
-       curfile[infptr] = fname;
-}
-
-char   str[500];
-int    nstr;
-
-yylex() {
-       int c, t;
-       for (;;) {
-               while ((c=gtok(str))==' ' || c=='\n' || c=='\t')
-                       ;
-               yylval = c;
-               if (c==';' || c=='{' || c=='}')
-                       return(c);
-               if (c==EOF)
-                       return(0);
-               yylval = (int) str;
-               if (c == DIG)
-                       return(DIGITS);
-               t = lookup(str)->ydef;
-               if (t==DEFINE)
-                       defstat();
-               else if (t==INCLUDE)
-                       inclstat();
-               else if (t > 0)
-                       return(t);
-               else
-                       return(GOK);
-       }
-}
-
-int    dbg     = 0;
-
-yyerror(p) char *p; {;}
-
-
-defstat() {
-       int c,i,val,t,nlp;
-       extern int nstr;
-       extern char str[];
-       while ((c=getchr())==' ' || c=='\t');
-       if (c == '(') {
-               t = '(';
-               while ((c=getchr())==' ' || c=='\t');
-               putbak(c);
-       }
-       else {
-               t = ' ';
-               putbak(c);
-       }
-       for (nstr=0; c=getchr(); nstr++) {
-               if (type[c] != LET && type[c] != DIG)
-                       break;
-               str[nstr] = c;
-       }
-       putbak(c);
-       str[nstr] = '\0';
-       if (c != ' ' && c != '\t' && c != '\n' && c != ',') {
-               error("illegal define statement");
-               return;
-       }
-       val = nstr+1;
-       if (t == ' ') {
-               while ((c=getchr())==' ' || c=='\t');
-               putbak(c);
-               for (i=val; (c=getchr())!='\n' && c!='#' && c!='\0'; i++)
-                       str[i] = c;
-               putbak(c);
-       } else {
-               while ((c=getchr())==' ' || c=='\t' || c==',' || c=='\n');
-               putbak(c);
-               nlp  = 0;
-               for (i=val; nlp>=0 && (c=str[i]=getchr()); i++)
-                       if (c == '(')
-                               nlp++;
-                       else if (c == ')')
-                               nlp--;
-               i--;
-       }
-       for ( ; i>0; i--)
-               if (str[i-1] != ' ' && str[i-1] != '\t')
-                       break;
-       str[i] = '\0';
-       install(str, &str[val], 0);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/ratfor/rlook.c b/.ref-Research-V7/usr/src/cmd/ratfor/rlook.c
deleted file mode 100644 (file)
index 0ebf64a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#define NULL 0
-#define EOS 0
-#define        HSHSIZ  101
-struct nlist {
-       char    *name;
-       char    *def;
-       int     ydef;
-       struct  nlist *next;
-};
-
-struct nlist   *hshtab[HSHSIZ];
-struct nlist   *lookup();
-char   *install();
-char   *malloc();
-char   *copy();
-int    hshval;
-
-struct nlist *lookup(str)
-char *str;
-{
-       register char *s1, *s2;
-       register struct nlist *np;
-       static struct nlist nodef;
-
-       s1 = str;
-       for (hshval = 0; *s1; )
-               hshval += *s1++;
-       hshval %= HSHSIZ;
-       for (np = hshtab[hshval]; np!=NULL; np = np->next) {
-               s1 = str;
-               s2 = np->name;
-               while (*s1++ == *s2)
-                       if (*s2++ == EOS)
-                               return(np);
-       }
-       return(&nodef);
-}
-
-char *install(nam, val, tran)
-char *nam, *val;
-int tran;
-{
-       register struct nlist *np;
-
-       if ((np = lookup(nam))->name == NULL) {
-               np = (struct nlist *)malloc(sizeof(*np));
-               np->name = copy(nam);
-               np->def = copy(val);
-               np->ydef = tran;
-               np->next = hshtab[hshval];
-               hshtab[hshval] = np;
-               return(np->def);
-       }
-       free(np->def);
-       np->def = copy(val);
-       return(np->def);
-}
-
-char *copy(s)
-register char *s;
-{
-       register char *p, *s1;
-
-       p = s1 = (char *) malloc((unsigned)strlen(s)+1);
-       while (*s1++ = *s++);
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/deliv1.c b/.ref-Research-V7/usr/src/cmd/refer/deliv1.c
deleted file mode 100644 (file)
index ae4a57b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-# include "stdio.h"
-main(argc,argv)
-       char *argv[];
-{
-/* goes from file:begin,l to actual characters */
-char line[750], *p, name[100];
-FILE *fa NULL;
-long lp;
-int len;
-
-if (argc>1 && argv[1] && argv[1][0])
-       chdir (argv[1]);
-name[0]="";
-while (gets(line))
-       {
-       if (line[0]=='$' && line[1]=='$') 
-               {
-               chdir(line+2);
-               continue;
-               }
-       for(p=line; *p!= ':'; p++)
-               ;
-       *p++ = 0;
-       sscanf(p, "%ld,%d", &lp, &len);
-       if (p==line)
-               fa = stdin;
-       else
-       if (strcmp (name, line) != 0)
-               {
-               if (fa != NULL)
-                       fclose(fa);
-               fa = fopen(line, "r");
-               if (fa == NULL)
-                       err("Can't open %s", line);
-               strcpy(name, line);
-               }
-       if (fa != NULL)
-               {
-               fseek (fa, lp, 0);
-               fread (line, 1, len, fa);
-               line[len] = 0;
-               fputs(line, stdout);
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/deliv2.c b/.ref-Research-V7/usr/src/cmd/refer/deliv2.c
deleted file mode 100644 (file)
index e64ae77..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-# include "stdio.h"
-hash (s)
-       char *s;
-{
-int c, n;
-for(n=0; c= *s; s++)
-       n += (c*n+ c << (n%4));
-return(n>0 ? n : -n);
-}
-err (s, a)
-       char *s;
-{
-fprintf(stderr, "Error: ");
-fprintf(stderr, s, a);
-putc('\n', stderr);
-exit(1);
-}
-prefix(t, s)
-       char *t, *s;
-{
-int c, d;
-while ( (c= *t++) == *s++)
-       if (c==0) return(1);
-return(c==0 ? 1: 0);
-}
-mindex(s, c)
-       char *s;
-{
-register char *p;
-for( p=s; *p; p++)
-       if (*p ==c)
-               return(p);
-return(0);
-}
-zalloc(m,n)
-{
-       int t;
-# if D1
-fprintf(stderr, "calling calloc for %d*%d bytes\n",m,n);
-# endif
-t = calloc(m,n);
-# if D1
-fprintf(stderr, "calloc returned %o\n", t);
-# endif
-return(t);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/flagger.c b/.ref-Research-V7/usr/src/cmd/refer/flagger.c
deleted file mode 100644 (file)
index 435cd5a..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-# include "stdio.h"
-char wds[100][40];
-int synwd[100];
-int mark[100];
-int justw 0;
-extern int comcount;
-int blank[100];
-int wdp, wdf;
-int bl;
-int sargc; char **sargv;
-FILE *inf;
-main(argc,argv)
-       char *argv[];
-{
-int i;
-while (--argc && **++argv== '-')
-       switch(argv[0][1])
-               {
-               case 'w': justw=1; break;
-               case 'c': comcount=atoi(argv[0]+2); break;
-               }
-wdp=wdf=0;
-if (argc>0)
-       {
-       argc--;
-       inf = fopen(argv[0], "r");
-       if (inf==NULL) exit(0);
-       argv++;
-       }
-else
-       inf=stdin;
-sargc=argc;  sargv= argv;
-while ( gw (wds[wdp = next(wdp)], &bl))
-       {
-       blank[wdp] = bl;
-       mark[wdp]=0;
-       synwd[wdp] = common(upcase(wds[wdp]));
-       if (common(sstrip(upcase(wds[wdp]))))
-               synwd[wdp]=1;
-       if (allpunct(wds[wdp]))
-               synwd[wdp]=1;
-       if (strlen(wds[wdp])<3)
-               synwd[wdp]=1;
-       if (synwd[wdp]==1)
-               {
-               for(i=wdp; i!=wdf; i=prev(i))
-                       {
-                       if (synwd[i]>0)
-                               continue;
-                       mark[i]=1;
-                       break;
-                       }
-               }
-       }
-if (wdp<0) return(0);
-i=wdf -1;
-i = next(i);
-while (i != wdp)
-       i= next(i);
-}
-next(i)
-{
-int j;
-j = (i+1) % 100;
-if (j==wdf)
-       {
-       if (justw==0)
-               {
-               if (mark[j] ) putchar('*');
-               printf("%s",wds[j]);
-               if (blank[j]) putchar(' ');
-               }
-       else
-               if (mark[j]) printf("%s\n", wds[j]);
-       wdf = (wdf+1)%100;
-       }
-return(j);
-}
-prev(i)
-{
-i = (i-1)%100;
-return(i);
-}
-allpunct(s)
- char *s;
-{
-int c;
-while (c = *s++)
-       if (isalpha(c))
-               return(0);
-return(1);
-}
-gw(s, b)
-       char *s;
-       int *b;
-{
-int c, type, nt;
-c = getc(inf);
-while (c==EOF)
-       {
-       fclose(inf);
-       inf=NULL;
-       if (sargc-->0)
-               {
-               inf = fopen ( *sargv++, "r");
-               }
-       if (inf==NULL) return(0);
-       c = getc(inf);
-       }
-*s++ = c;
-type = isalpha(c) || isdigit(c);
-while ( (c = getc(inf)) != EOF )
-       {
-       nt = isalpha(c) || isdigit(c);
-       if (nt==type)
-               *s++= c;
-       else
-               break;
-       }
-*s=0;
-if (c== ' ')
-       {
-       *b = 1;
-       return(1);
-       }
-while (c==EOF)
-       {
-       fclose(inf); inf=NULL;
-       if (sargc-- > 0)
-               {
-               inf= fopen( *sargv++, "r");
-               }
-       if (inf==NULL) return(0);
-       c = getc(inf);
-       }
-ungetc(c, inf);
-*b=0;
-return(1);
-}
-trimnl(s)
- char *s;
-{
-while (*s) s++;
-if (*--s=='\n') *s=0;
-}
-upcase(s)
- char *s;
-{
-static char buf[100];
-strcpy (buf, s);
-for(s=buf; *s; s++)
-       if (isupper(*s))
-               *s = *s-'A'+'a';
-return(buf);
-}
-sstrip(s)
- char *s;
-{
-char *p ; p=s;
-while (*s) s++;
-if (*--s=='s') *s=0;
-return(p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/glue1.c b/.ref-Research-V7/usr/src/cmd/refer/glue1.c
deleted file mode 100644 (file)
index 1b2f013..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-# include "stdio.h"
-# define unopen(fil) {if (fil!=NULL) {fclose(fil); fil=NULL;}}
-extern char refdir[];
-int lmaster 1000;
-int reached 0;
-FILE *fd 0;
-int *hfreq, hfrflg;
-int colevel 0;
-static union {unsigned *a; long *b;} master NULL;
-int iflong;
-extern char *fgnames[], **fgnamp;
-int prfreqs 0;
-int typeindex 0;
-char usedir[100];
-static int full 1000;
-static int tags 0;
-char *sinput, *soutput, *tagout;
-long indexdate 0, gdate();
-int soutlen 1000;
-int taglen 1000;
-
-huntmain(argc,argv)
-       char *argv[];
-{
-/* read query from stdin, expect name of indexes in argv[1] */
-static FILE *fa, *fb, *fc;
-char indexname[100], *qitem[100], *rprog 0;
-char grepquery[200];
-static char oldname[30] ;
-static int nhash 0;
-static int maxhash 0;
-int falseflg 0, nitem, nfound, frtbl;
-static long *hpt 0;
-# if D1
-fprintf(stderr, "in glue1 argc %d argv %o %o\n", argc, argv[0],argv[1]);
-# endif
-savedir();
-while (argv[1][0] == '-')
-       {
-# if D1
-fprintf(stderr, "argv.1 is %s\n",argv[1]);
-# endif
-       switch(argv[1][1])
-               {
-               case 'a': /* all output, incl. false drops */
-                       falseflg = 1; break;
-               case 'r':
-                       argc--; argv++;
-                       rprog = argv[1];
-                       break;
-               case 'F': /* put out full text */
-                       full = setfrom(argv[1][2]);
-                       break;
-               case 'T': /* put out tags */
-                       tags = setfrom(argv[1][2]);
-                       break;
-               case 'i': /* input in argument string */
-                       argc--; argv++;
-                       sinput = argv[1];
-                       break;
-               case 's': /*text output to string */
-               case 'o':
-                       argc--; argv++;
-                       soutput = argv[1];
-                       if (argv[2]<16000)
-                               {
-                               soutlen = argv[2];
-                               argc--; argv++;
-                               }
-                       break;
-               case 't': /*tag output to string */
-                       argc--; argv++;
-                       tagout = argv[1];
-                       if (argv[2]<16000)
-                               {
-                               taglen = argv[2];
-                               argc--; argv++;
-                               }
-                       break;
-               case 'l': /* specify length of lists */
-                       argc--; argv++;
-                       lmaster = atoi(argv[1]);
-# if D1
-                       fprintf(stderr, "lmaster now %d\n",lmaster);
-# endif
-                       break;
-               case 'C': 
-                       argc--; argv++;
-                       colevel = atoi(argv[1]);
-                       break;
-               }
-       argc--; argv++;
-       }
-strcpy (indexname, todir(argv[1]));
-# if D1
-fprintf(stderr, "in huntmain indexname %s typeindex %d\n", indexname, typeindex);
-# endif
-if (typeindex == 0 || strcmp (oldname, indexname) !=0)
-       {
-       strcpy (oldname, indexname);
-       unopen(fa); unopen(fb); unopen(fc);
-
-       if (ckexist(indexname, ".ib"))
-               {
-# if D1
-               fprintf(stderr, "found old index\n");
-# endif
-               fa = iopen(indexname, ".ia");
-               fb = iopen(indexname, ".ib");
-               fc = iopen(indexname, ".ic");
-               typeindex =1;
-# if D1
-               fprintf(stderr, "opened f's as %o %o %o\n",fa,fb,fc);
-# endif
-               indexdate = gdate(fb);
-               fread (&nhash, sizeof(nhash), 1, fa);
-               fread (&iflong, sizeof(iflong), 1, fa);
-               if (nhash > maxhash)
-                       {
-                       if (hpt)
-                               free (hpt, maxhash, sizeof(*hpt));
-                       hpt=0;
-                       if (hfreq)
-                               free(hfreq, maxhash, sizeof(*hfreq));
-                       hfreq=0;
-                       maxhash=nhash;
-# if D1
-                       fprintf(stderr, "Freed if needed maxhash %d\n",maxhash);
-# endif
-                       }
-               if (hpt==0)
-               hpt = zalloc(nhash, sizeof(*hpt));
-# if D1
-               fprintf(stderr, "hpt now %o\n",hpt);
-# endif
-               if (hpt == NULL)
-                       err ("No space for hash list (%d)", nhash);
-               fread( hpt, sizeof(*hpt), nhash, fa);
-               if (hfreq==0)
-               hfreq=zalloc(nhash, sizeof(*hfreq));
-               if (hfreq==NULL)
-                       err ("No space for hash frequencies (%d)", nhash);
-               frtbl = fread(hfreq, sizeof(*hfreq), nhash, fa);
-               hfrflg = (frtbl == nhash);
-# if D1
-               fprintf(stderr,"Read pointer files\n");
-# endif
-               if (master.a == NULL)
-                       if (iflong)
-                               master.b = zalloc(lmaster, sizeof(long));
-                       else
-                               master.a = zalloc(lmaster, sizeof(int));
-               if (master.a == NULL)
-                       err ("no space for answer list",0);
-               }
-       else
-       if (makefgrep(indexname))
-               typeindex=2;
-       else
-               {
-               err ("No files %s\n",indexname);
-               exit(1);
-               }
-       }
-
-# if D1
-fprintf(stderr, "typeindex now %d\n",typeindex);
-# endif
-tagout[0]=0;
-if (typeindex==2)
-       {
-       grepcall(sinput, tagout, indexname);
-# if D1
-       fprintf(stderr, " back from grepcall\n");
-# endif
-       restodir();
-       return;
-       }
-nitem = getq(qitem);
-# if D1
-fprintf(stderr, "approaching doquery fb %o\n", fb);
-# endif
-nfound = doquery(hpt, nhash, fb, nitem, qitem, master);
-# ifdef D1
-       fprintf(stderr, "return from doquery with nfound %d\n", nfound);
-# endif
-if (falseflg == 0)
-       nfound = baddrop(master, nfound, fc, nitem, qitem, rprog, full);
-# ifdef D1
-       fprintf(stderr, "after baddrop with nfound %d\n",nfound);
-       fprintf(stderr, "tagout is /%s/, sout /%s/\n",tagout, soutput);
-# endif
-if (tags)
-       result (master, nfound >tags ? tags : nfound, fc);
-# if D1
-fprintf(stderr, "done with huntmain\n");
-fprintf(stderr, "tagout is /%s/\n", tagout);
-fprintf(stderr, "string out is /%s/\n", soutput);
-# endif
-if (fgnamp>fgnames)
-       {
-       char **fgp;
-       int k;
-# if D1
-       fprintf(stderr, "were %d bad files\n", fgnamp-fgnames);
-# endif
-       grepquery[0]=0;
-       for(k=0; k<nitem; k++)
-               {
-               strcat(grepquery, " ");
-               strcat(grepquery, qitem[k]);
-               }
-       for(fgp=fgnames; fgp<fgnamp; fgp++)
-               {
-# if D1
-               fprintf(stderr, "Now on %s query /%s/\n", *fgp, grepquery);
-# endif
-               makefgrep(*fgp);
-               grepcall(grepquery, tagout, *fgp);
-# if D1
-               fprintf(stderr, "tagout now /%s/\n", tagout);
-# endif
-               }
-       }
-restodir();
-}
-
-todir(t)
-       char *t;
-{
-       char *s;
-       s=t;
-       while (*s) s++;
-       while (s>=t && *s != '/') s--;
-       if (s<t) return(t);
-*s++ = 0;
-t = (*t ? t : "/");
-chdir (t);
-strcpy (usedir,t);
-return(s);
-}
-setfrom(c)
-{
-switch(c)
-       {
-       case 'y': case '\0':
-       default:
-               return(1000);
-       case '1':
-       case '2': case '3': case '4': case '5':
-       case '6': case '7': case '8': case '9':
-               return(c-'0');
-       case 'n': case '0':
-               return(0);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/glue2.c b/.ref-Research-V7/usr/src/cmd/refer/glue2.c
deleted file mode 100644 (file)
index 0225278..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
- char refdir[50];
-savedir()
-{
-if (refdir[0]==0)
-       corout ("", refdir, "/bin/pwd", "", 50);
-trimnl(refdir);
-}
-restodir()
-{
-chdir(refdir);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/glue3.c b/.ref-Research-V7/usr/src/cmd/refer/glue3.c
deleted file mode 100644 (file)
index 8f6c171..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-# include "refer..c"
-corout(in, out, rprog, arg, outlen)
-       char *in, *out, *rprog;
-{
-# define move(x, y) close(y); dup(x); close(x);
-int pipev[2], fr1, fr2, fw1, fw2, n;
-
-if (strcmp (rprog, "hunt") ==0)
-       return(callhunt(in, out, arg, outlen));
-if (strcmp (rprog, "deliv")==0)
-       return(dodeliv(in, out, arg, outlen));
-pipe (pipev); fr1= pipev[0]; fw1 = pipev[1];
-pipe (pipev); fr2= pipev[0]; fw2 = pipev[1];
-if (fork()==0)
-       {
-       close (fw1); close (fr2);
-       move (fr1, 0);
-       move (fw2, 1);
-       if (rprog[0]!= '/')
-               chdir("/usr/lib/refer");
-       execl(rprog, "deliv", arg, 0);
-       err ("Can't run %s", rprog);
-       }
-close(fw2); close(fr1);
-write (fw1, in , strlen(in));
-close(fw1);
-wait(0);
-n = read (fr2, out, outlen);
-out[n]=0;
-close(fr2);
-}
-callhunt(in, out, arg, outlen)
-       char *in, *out, *arg;
-{
-# define ALEN 50
-char *argv[20], abuff[ALEN];
-extern int typeindex;
-int argc;
-extern char one[];
-extern int onelen;
-argv[0] = "hunt";
-argv[1] = "-i";
-argv[2] = in;
-argv[3] = "-t";
-argv[4] = out;
-argv[5] = outlen;
-argv[6] = "-T";
-argv[7] = "-F1";
-argv[8] = "-o";
-argv[9] = one;
-argv[10] = onelen;
-argv[11] = abuff; strcpy (abuff,arg);
-if (strlen(abuff) > ALEN)
-       err("abuff not big enough %d", strlen(abuff));
-argc = 6;
-huntmain (argc,argv);
-return(0);
-}
-dodeliv(in, out, arg, outlen)
-       char *in, *out, *arg;
-{
-# if D1
-fprintf(stderr, "in dodeliv, arg /%s/\n", arg?arg:"");
-# endif
-if (arg && arg[0])
-       chdir(arg);
-findline(in, out, outlen, 0L);
-restodir();
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/glue4.c b/.ref-Research-V7/usr/src/cmd/refer/glue4.c
deleted file mode 100644 (file)
index 160f0c4..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-
-grepcall (in, out, arg)
-       char *in, *out, *arg;
-{
-char line[200], *s, argig[100], *cv[50];
-char *inp, inb[500];
-extern char gfile[];
-FILE *qf, *gf;
-int c, oldc 0, alph 0, nv 0;
-int sv0, sv1;
-strcpy (argig, arg); strcat(argig, ".ig");
-strcpy (inp=inb, in);
-if (gfile[0]==0)
-       sprintf(gfile, "/tmp/rj%dg", getpid());
-# if D1
-fprintf(stderr, "in grepcall, gfile %s in %o out %o\n", gfile,in,out);
-# endif
-for(cv[nv++] = "fgrep"; c = *inp; inp++)
-       {
-       if (c== ' ')
-               c = *inp = 0;
-       else if (isupper(c))
-               *inp = tolower(c);
-       alph = (c==0) ? 0 : alph+1;
-       if (alph == 1)
-               cv[nv++] = inp;
-       if (alph > 6)
-               *inp = 0;
-       oldc=c;
-       }
-# if D1
-fprintf(stderr, "%d args set up\n", nv);
-# endif
-       {
-       sv0 = dup(0);
-       close(0);
-       if (open (argig, 0) != 0)
-               err("Can't read fgrep index %s", argig);
-       sv1 = dup(1);
-       close(1);
-       if (creat(gfile, 0666) != 1)
-               err("Can't write fgrep output %s", gfile);
-       fgrep(nv, cv);
-# if D1
-fprintf(stderr, "fgrep returned, output is..\n");
-# endif
-       close (0); dup(sv0); close(sv0);
-       close (1); dup(sv1); close(sv1);
-       }
-
-# if D1
-fprintf(stderr, "back from fgrep\n");
-# endif
-gf = fopen(gfile, "r");
-if (gf==NULL)
-       err("can't read fgrep output %s", gfile);
-while (fgets(line, 100, gf) == line)
-       {
-       line[100]=0;
-# if D1
-fprintf(stderr, "read line as //%s//\n",line);
-# endif
-       for(s=line; *s && (*s != '\t'); s++);
-       if (*s == '\t')
-               {
-               *s++ = '\n';
-               *s++ = 0;
-               }
-       if (line[0])
-               strcat(out, line);
-# if D1
-fprintf(stderr, "out now /%s/\n",out);
-# endif
-       while (*s) s++;
-# if D1
-fprintf(stderr, "line %o s %o s-1 %o\n",line,s,s[-1]);
-# endif
-       if (s[-1]!= '\n')
-               while (!feof(gf) && getc(gf)!= '\n') ;
-       }
-fclose(gf);
-# if D1
-       fprintf(stderr, "back from reading %, out %s\n",out);
-# else
-unlink (gfile);
-# endif
-return(0);
-}
-
-clfgrep()
-{
-if (gfile[0])
-       unlink(gfile);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/glue5.c b/.ref-Research-V7/usr/src/cmd/refer/glue5.c
deleted file mode 100644 (file)
index ced751a..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-/*
- * fgrep -- print all lines containing any of a set of keywords
- *
- *     status returns:
- *             0 - ok, and some matches
- *             1 - ok, but no matches
- *             2 - some error
- */
-#define        MAXSIZ 700
-#define QSIZE 400
-struct words {
-       char    inp;
-       char    out;
-       struct  words *nst;
-       struct  words *link;
-       struct  words *fail;
-} 
-*www, *smax, *q;
-
-char   buf[1024];
-int    nsucc;
-int    need;
-char   *instr;
-int    inct;
-int    rflag;
-int    xargc;
-char   **xargv;
-int    numwords;
-int    nfound;
-static int flag 0;
-
-
-fgrep(argc, argv)
-char **argv;
-{
-       instr = nsucc = need = inct = rflag = numwords = nfound = 0;
-       flag = 0;
-       if (www==0)
-               www = zalloc(MAXSIZ, sizeof (*www));
-       if (www==NULL)
-               err("Can't get space for machines", 0);
-       for (q=www; q<www+MAXSIZ; q++)
-               q->inp = q->out = q->nst = q->link = q->fail =0;
-       xargc = argc-1;
-       xargv = argv+1;
-       while (xargc>0 && xargv[0][0]=='-')
-               {
-               switch(xargv[0][1])
-                       {
-                       case 'r': /* return value only */
-                               rflag++;
-                               break;
-                       case 'n': /* number of answers needed */
-                               need = xargv[1];
-                               xargv++; xargc--;
-                               break;
-                       case 'i':
-                               instr = xargv[1];
-                               inct = xargv[2]+2;
-# if D2
-fprintf(stderr,"inct %d xargv.2. %o %d\n",inct, xargv[2],xargv[2]);
-# endif
-                               xargv += 2; xargc -= 2;
-                               break;
-                       }
-               xargv++; xargc--;
-               }
-       if (xargc<=0)
-               {
-               write (2, "bad fgrep call\n", 15);
-               exit(2);
-               }
-# if D1
-       fprintf(stderr, "before cgoto\n");
-# endif
-       cgotofn();
-# if D1
-       fprintf(stderr, "before cfail\n");
-# endif
-       cfail();
-# if D1
-       fprintf(stderr, "before execute instr %.20s\n", instr? instr: "");
-       fprintf(stderr, "end of string %d %c %c %c\n", inct, instr[inct-3],
-               instr[inct-2], instr[inct-1]);
-# endif
-       execute();
-# if D1
-       fprintf(stderr, "returning nsucc %d\n", nsucc);
-       fprintf(stderr, "fgrep done www %o\n",www);
-# endif
-       return(nsucc == 0);
-}
-
-execute()
-{
-       register char *p;
-       register c;
-       register ch;
-       register ccount;
-       int f;
-       char *nlp;
-       f=0;
-       ccount = instr ? inct : 0;
-       nfound=0;
-       p = instr ? instr : buf;
-       if (need == 0) need = numwords;
-       nlp = p;
-       c = www;
-# if D2
-fprintf(stderr, "in execute ccount %d inct %d\n",ccount, inct );
-# endif
-       for (;;) {
-# if D3
-fprintf(stderr, "down ccount\n");
-# endif
-               if (--ccount <= 0) {
-# if D2
-fprintf(stderr, "ex loop ccount %d instr %o\n",ccount, instr);
-# endif
-                       if (instr) break;
-                       if (p == &buf[1024]) p = buf;
-                       if (p > &buf[512]) {
-                               if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break;
-                       }
-                       else if ((ccount = read(f, p, 512)) <= 0) break;
-# if D2
-fprintf(stderr, " normal read %d bytres\n", ccount);
-{char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount);
-fprintf(stderr, xx, p);
-}
-# endif
-               }
-nstate:
-               ch = *p;
-# if D2
-fprintf(stderr, "roaming along in ex ch %c c %o\n",ch,c);
-# endif
-               if (isupper(ch)) ch |= 040;
-               if (c->inp == ch) {
-                       c = c->nst;
-               }
-               else if (c->link != 0) {
-                       c = c->link;
-                       goto nstate;
-               }
-               else {
-                       c = c->fail;
-                       if (c==0) {
-                               c = www;
-istate:
-                               if (c->inp == ch) {
-                                       c = c->nst;
-                               }
-                               else if (c->link != 0) {
-                                       c = c->link;
-                                       goto istate;
-                               }
-                       }
-                       else goto nstate;
-               }
-               if (c->out && new (c)) {
-# if D2
-fprintf(stderr, " found: nfound %d need %d\n",nfound,need);
-# endif
-                       if (++nfound >= need)
-                       {
-# if D1
-fprintf(stderr, "found, p %o nlp %o ccount %d buf %o buf[1024] %o\n",p,nlp,ccount,buf,buf+1024);
-# endif
-                               if (instr==0)
-                               while (*p++ != '\n') {
-# if D3
-fprintf(stderr, "down ccount2\n");
-# endif
-                                       if (--ccount <= 0) {
-                                               if (p == &buf[1024]) p = buf;
-                                               if (p > &buf[512]) {
-                                                       if ((ccount = read(f, p, &buf[1024] - p)) <= 0) break;
-                                               }
-                                               else if ((ccount = read(f, p, 512)) <= 0) break;
-# if D2
-fprintf(stderr, " read %d bytes\n",ccount);
-{ char xx[20]; sprintf(xx, "they are %%.%ds\n", ccount);
-fprintf(stderr, xx, p);
-}
-# endif
-                                       }
-                               }
-                               nsucc = 1;
-                               if (rflag==0)
-                                       {
-# if D2
-fprintf(stderr, "p %o nlp %o buf %o\n",p,nlp,buf);
-if (p>nlp)
-{write (2, "XX\n", 3); write (2, nlp, p-nlp); write (2, "XX\n", 3);}
-# endif
-                                       if (p > nlp) write(1, nlp, p-nlp);
-                                       else {
-                                               write(1, nlp, &buf[1024] - nlp);
-                                               write(1, buf, p-&buf[0]);
-                                               }
-                                       if (p[-1]!= '\n') write (1, "\n", 1);
-                                       }
-                               if (instr==0)
-                                       {
-                                       nlp = p;
-                                       c = www;
-                                       nfound=0; 
-                                       }
-                       }
-                       else
-                               ccount++;
-                       continue;
-               }
-# if D2
-fprintf(stderr, "nr end loop p %o\n",p);
-# endif
-               if (instr)
-                       p++;
-               else
-               if (*p++ == '\n')
-               {
-                       nlp = p;
-                       c = www;
-                       nfound=0;
-               }
-       }
-       if (instr==0)
-               close(f);
-}
-
-cgotofn() {
-       register c;
-       register s;
-       s = smax = www;
-nword: 
-       for(;;) {
-# if D1
-       fprintf(stderr, " in for loop c now %o %c\n",c, c>' ' ? c : ' ');
-# endif
-               if ((c = gch())==0) return;
-               else if (c == '\n') {
-                       s->out = 1;
-                       s = www;
-               }
-               else {
-loop:  
-                       if (s->inp == c) {
-                               s = s->nst;
-                               continue;
-                       }
-                       if (s->inp == 0) goto enter;
-                       if (s->link == 0) {
-                               if (smax >= &www[MAXSIZ - 1]) overflo();
-                               s->link = ++smax;
-                               s = smax;
-                               goto enter;
-                       }
-                       s = s->link;
-                       goto loop;
-               }
-       }
-
-enter:
-       do {
-               s->inp = c;
-               if (smax >= &www[MAXSIZ - 1]) overflo();
-               s->nst = ++smax;
-               s = smax;
-       } 
-       while ((c = gch()) != '\n');
-       smax->out = 1;
-       s = www;
-       numwords++;
-       goto nword;
-
-}
-
-gch()
-{
-       static char *s;
-       if (flag==0)
-       {
-               flag=1;
-               s = *xargv++;
-# if D1
-       fprintf(stderr, "next arg is %s xargc %d\n",s,xargc);
-# endif
-               if (xargc-- <=0) return(0);
-       }
-       if (*s) return(*s++);
-       for(flag=0; flag<1024; flag++)
-               buf[flag]=0;
-       flag=0;
-       return('\n');
-}
-
-overflo() {
-       write(2,"wordlist too large\n", 19);
-       exit(2);
-}
-cfail() {
-       struct words *queue[QSIZE];
-       struct words **front, **rear;
-       struct words *state;
-       register char c;
-       register s;
-       s = www;
-       front = rear = queue;
-init:  
-       if ((s->inp) != 0) {
-               *rear++ = s->nst;
-               if (rear >= &queue[QSIZE - 1]) overflo();
-       }
-       if ((s = s->link) != 0) {
-               goto init;
-       }
-
-       while (rear!=front) {
-               s = *front;
-               if (front == &queue[QSIZE-1])
-                       front = queue;
-               else front++;
-cloop: 
-               if ((c = s->inp) != 0) {
-                       *rear = (q = s->nst);
-                       if (front < rear)
-                               if (rear >= &queue[QSIZE-1])
-                                       if (front == queue) overflo();
-                                       else rear = queue;
-                       else rear++;
-                       else
-                               if (++rear == front) overflo();
-                       state = s->fail;
-floop: 
-                       if (state == 0) state = www;
-                       if (state->inp == c) {
-                               q->fail = state->nst;
-                               if ((state->nst)->out == 1) q->out = 1;
-                               continue;
-                       }
-                       else if ((state = state->link) != 0)
-                               goto floop;
-               }
-               if ((s = s->link) != 0)
-                       goto cloop;
-       }
-}
-static int seen[50];
-new (x)
-{
-       int i;
-       for(i=0; i<nfound; i++)
-               if (seen[i]==x)
-                       return(0);
-       seen[i]=x;
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt1.c b/.ref-Research-V7/usr/src/cmd/refer/hunt1.c
deleted file mode 100644 (file)
index c240299..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-# include "stdio.h"
-# include "assert.h"
-extern char refdir[];
-extern int keepold;
-extern char *fgnames[];
-extern char **fgnamp;
-FILE *fd 0;
-int lmaster 500;
-int *hfreq, hfrflg;
-int colevel 0;
-int soutlen 1000;
-int reached 0;
-int iflong 0;
-int prfreqs 0;
-char usedir[100];
-char gfile[50];
-static int full 1000;
-static int tags 0;
-char *sinput, *soutput, *tagout;
-long indexdate 0, gdate();
-
-main(argc,argv)
-       char *argv[];
-{
-/* read query from stdin, expect name of indexes in argv[1] */
-static FILE *fa, *fb, *fc;
-char nma[100], nmb[100], nmc[100], *qitem[100], *rprog 0;
-char nmd[100], grepquery[256];
-static char oldname[30] ;
-static int was 0;
-/* these pointers are unions of pointer to int and pointer to long */
-long *hpt;
-unsigned *master 0;
-int falseflg, nhash, nitem, nfound, frtbl, kk;
-
-       /* special wart for refpart: default is tags only */
-
-while (argv[1][0] == '-')
-       {
-       switch(argv[1][1])
-               {
-               case 'a': /* all output, incl. false drops */
-                       falseflg = 1; break;
-               case 'r':
-                       argc--; argv++;
-                       rprog = argv[1];
-                       break;
-               case 'F': /* put out full text */
-                       full = setfrom(argv[1][2]);
-                       break;
-               case 'T': /* put out tags */
-                       tags = setfrom(argv[1][2]);
-                       break;
-               case 'i': /* input in argument string */
-                       argc--; argv++;
-                       sinput = argv[1];
-                       break;
-               case 's': /*text output to string */
-               case 'o':
-                       argc--; argv++;
-                       soutput = argv[1];
-                       if (argv[2]<16000)
-                               {
-                               soutlen = argv[2];
-                               argc--; argv++;
-                               }
-                       break;
-               case 't': /*tag output to string */
-                       argc--; argv++;
-                       tagout = argv[1];
-                       break;
-               case 'l': /* length of internal lists */
-                       argc--; argv++;
-                       lmaster = atoi(argv[1]);
-                       break;
-               case 'g': /* suppress fgrep search on old files */
-                       keepold = 0;
-                       break;
-               case 'C': /* coordination level */
-                       colevel = atoi(argv[1]+2);
-# if D1
-fprintf(stderr, "colevel set to %d\n",colevel);
-# endif
-                       break;
-               case 'P': /* print term freqs */
-                       prfreqs=1; break;
-               }
-       argc--; argv++;
-       }
-strcpy (nma, todir(argv[1]));
-if (was == 0 || strcmp (oldname, nma) !=0)
-       {
-       strcpy (oldname,nma);
-       strcpy (nmb, nma); strcpy (nmc, nmb); strcpy(nmd,nma);
-       strcat (nma, ".ia");
-       strcat (nmb, ".ib");
-       strcat (nmc, ".ic");
-       strcat (nmd, ".id");
-       if (was)
-               {fclose(fa); fclose(fb); fclose(fc);}
-
-       fa = fopen(nma, "r");
-       if (fa==NULL)
-               {
-               err("No files %s",nma);
-               exit(1);
-               }
-       fb = fopen(nmb, "r");
-       fc = fopen(nmc, "r");
-       was =1;
-       if (fb== NULL || fc ==NULL)
-               {
-               err("Index incomplete %s", nmb);
-               exit(1);
-               }
-       indexdate = gdate(fb);
-       fd = fopen(nmd, "r");
-       }
-fseek (fa, 0L, 0);
-fread (&nhash, sizeof(nhash), 1, fa);
-fread (&iflong, sizeof(iflong), 1, fa);
-if(master==0)
-master = calloc (lmaster, iflong? 4: 2);
-hpt = calloc(nhash, sizeof(*hpt));
-kk=fread( hpt, sizeof(*hpt), nhash, fa);
-# if D1
-fprintf(stderr,"read %d hashes, iflong %d, nhash %d\n", kk, iflong, nhash);
-# endif
-_assert (kk==nhash);
-hfreq = calloc(nhash, sizeof(*hfreq));
-_assert (hfreq != NULL);
-frtbl = fread(hfreq, sizeof(*hfreq), nhash, fa);
-hfrflg = (frtbl == nhash);
-# if D1
-fprintf(stderr, "read freqs %d\n", frtbl);
-# endif
-
-while (1)
-       {
-       nitem = getq(qitem);
-       if (nitem==0) continue;
-       if (nitem < 0) break;
-       nfound = doquery(hpt, nhash, fb, nitem, qitem, master);
-# if D1
-       fprintf(stderr,"after doquery nfound %d\n", nfound);
-# endif
-       fgnamp=fgnames;
-       if (falseflg == 0)
-               nfound = baddrop(master, nfound, fc, nitem, qitem, rprog, full);
-# if D1
-       fprintf(stderr,"after baddrop nfound %d\n", nfound);
-# endif
-       if (fgnamp>fgnames)
-               {
-               char **fgp, tgbuff[100];
-               int k;
-# if D1
-               fprintf(stderr, "were %d bad files\n", fgnamp-fgnames);
-# endif
-               grepquery[0]=0;
-               for(k=0; k<nitem; k++)
-                       {
-                       strcat(grepquery, " ");
-                       strcat(grepquery, qitem[k]);
-                       }
-# if D1
-               fprintf(stderr, "grepquery %s\n",grepquery);
-# endif
-               for(fgp=fgnames; fgp<fgnamp; fgp++)
-                       {
-# if D1
-                       fprintf(stderr, "Now on %s query /%s/\n", *fgp, grepquery);
-# endif
-                       makefgrep(*fgp);
-# if D1
-                       fprintf(stderr, "grepmade\n");
-# endif
-                       if (tagout==0)
-                               tagout=tgbuff;
-                       grepcall(grepquery, tagout, *fgp);
-# if D1
-                       fprintf(stderr, "tagout now /%s/\n", tagout);
-# endif
-                       if (full)
-                               {
-                               char bout[1000];
-                               findline(tagout, bout, 1000);
-                               fputs(bout,stdout);
-                               }
-                       }
-               }
-       if (tags)
-               result (master, nfound >tags ? tags: nfound, fc);
-       }
-}
-
-todir(t)
-       char *t;
-{
-       char *s;
-       s=t;
-       while (*s) s++;
-       while (s>=t && *s != '/') s--;
-       if (s<t) return(t);
-*s++ = 0;
-t = (*t ? t : "/");
-chdir (t);
-strcpy (usedir,t);
-return(s);
-}
-setfrom(c)
-{
-switch(c)
-       {
-       case 'y': case '\0':
-       default:
-               return(1000);
-       case '1':
-       case '2': case '3': case '4': case '5':
-       case '6': case '7': case '8': case '9':
-               return(c-'0');
-       case 'n': case '0':
-               return(0);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt2.c b/.ref-Research-V7/usr/src/cmd/refer/hunt2.c
deleted file mode 100644 (file)
index ae6adc1..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-# include "refer..c"
-static int *coord 0;
-int hh[50]; extern int *hfreq, hfrflg, hcomp(), hexch();
-extern int prfreqs;
-
-doquery(hpt, nhash, fb, nitem, qitem, master)
-       union ptr {unsigned *a; long *b;} master;
-       long *hpt;
-       FILE *fb;
-       char *qitem[];
-{
-long k;
-union ptr prevdrop;
-int nf 0, best 0, nterm 0, i, g, j;
-int *prevcoord;
-long lp;
-extern int lmaster, colevel, reached;
-long getl(); unsigned getw(); extern int iflong;
-
-# if D1
-fprintf(stderr, "entering doquery nitem %d\n",nitem);
-fprintf(stderr, "first few hashes are %ld %ld %ld %ld %ld\n", hpt[0],hpt[1],hpt[2],hpt[3],hpt[4]);
-fprintf(stderr, "and frequencies are  %d %d %d %d %d\n",hfreq[0],hfreq[1],hfreq[2],hfreq[3],hfreq[4]);
-# endif
-_assert (lmaster>0);
-if (coord==0)
-       coord = zalloc(lmaster, sizeof(lmaster));
-if (colevel>0)
-       {
-       prevdrop.a=zalloc(lmaster,iflong?4:2);
-       prevcoord = zalloc(lmaster, sizeof(lmaster));
-       }
-else
-       {
-       prevdrop.a=master.a;
-       prevcoord=coord;
-       }
-# if D1
-fprintf(stderr, "nitem %d\n",nitem);
-# endif
-for(i=0; i<nitem; i++)
-       {
-       hh[i] = hash(qitem[i])%nhash;
-# if D1
-       fprintf(stderr,"query wd X%sX has hash %d\n", qitem[i], hh[i]);
-# endif
-       }
-# if D1
-fprintf(stderr, "past that loop nhash %d hpt is %lo\n", nhash, hpt);
-# endif
-if (prfreqs)
-       for(i=0; i<nitem; i++)
-               fprintf(stderr,"item %s hash %d hfreq %d\n",qitem[i], hh[i], hfreq[hh[i]]);
-/* if possible, sort query into decreasing frequency of hashes */
-if (hfrflg)
-       shell (nitem, hcomp, hexch);
-# if D1
-for(i=0; i<nitem; i++)
- fprintf(stderr, "item hash %d frq %d\n", hh[i], hfreq[hh[i]]);
-# endif
-       lp = hpt [hh[0]];
-# if D1
-fprintf(stderr,"first item hash %d lp %ld 0%lo\n", hh[0],lp,lp);
-# endif
-_assert (fb!=NULL);
-_assert (fseek(fb,lp,0)==NULL);
-for(i=0; i<lmaster; i++)
-       {
-       if (iflong)
-               master.b[i] = getl(fb);
-       else
-               master.a[i] = getw(fb);
-       coord[i]=1;
-# if D2
-       if (iflong)
-       fprintf(stderr,"master has %ld\n",(master.b[i]));
-       else
-       fprintf(stderr,"master has %d\n",(master.a[i]));
-# endif
-       _assert (i<lmaster);
-       if (iflong)
-               {
-               if (master.b[i] == -1L) break;
-               }
-       else
-               {
-               if (master.a[i] == -1) break;
-               }
-       }
-nf= i;
-for(nterm=1; nterm<nitem; nterm++)
-       {
-# ifdef D1
-       fprintf(stderr, "item %d, hash %d\n", nterm, hh[nterm]);
-# endif
-       if (colevel>0)
-               {
-               for(j=0; j<nf; j++)
-                       {
-                       if (iflong)
-                       prevdrop.b[j] = master.b[j];
-                       else
-                       prevdrop.a[j] = master.a[j];
-                       prevcoord[j] = coord[j];
-                       }
-               }
-       lp = hpt[hh[nterm]];
-       _assert (fseek(fb, lp, 0)==0);
-# if D1
-       fprintf(stderr,"item %d hash %d seek to %ld\n",nterm,hh[nterm],lp);
-# endif
-       g=j=0;
-       while (1)
-               {
-               if (iflong)
-                       k = getl(fb);
-               else
-                       k = getw(fb);
-               if (k== -1) break;
-# if D2
-               fprintf(stderr,"next term finds %ld\n",k);
-# endif
-# if D3
-               if (iflong)
-               fprintf(stderr, "bfwh j %d nf %d master %ld k %ld\n",j,nf,prevdrop.b[j],(long)(k));
-               else
-               fprintf(stderr, "bfwh j %d nf %d master %ld k %ld\n",j,nf,prevdrop.a[j],(long)(k));
-# endif
-               while (j<nf && (iflong?prevdrop.b[j]:prevdrop.a[j])<k)
-                       {
-# if D3
-                       if (iflong)
-                       fprintf(stderr, "j %d nf %d prevdrop %ld prevcoord %d colevel %d nterm %d k %ld\n",
-                       j,nf,prevdrop.b[j], prevcoord[j], colevel, nterm, (long)(k));
-                       else
-                       fprintf(stderr, "j %d nf %d prevdrop %ld prevcoord %d colevel %d nterm %d k %ld\n",
-                       j,nf,prevdrop.a[j], prevcoord[j], colevel, nterm, (long)(k));
-# endif
-                       if (prevcoord[j] + colevel <= nterm)
-                               j++;
-                       else
-                               {
-                               _assert (g<lmaster);
-                               if (iflong)
-                               master.b[g] = prevdrop.b[j];
-                               else
-                               master.a[g] = prevdrop.a[j];
-                               coord[g++] = prevcoord[j++];
-# if D1
-if (iflong)
-fprintf(stderr, " not skip g %d doc %d coord %d note %d\n",g,master.b[g-1], coord[g-1],master.b[j-1]);
-else
-fprintf(stderr, " not skip g %d doc %ld coord %d nterm %d\n",g,master.a[g-1], coord[g-1],nterm);
-# endif
-                               continue;
-                               }
-                       }
-               if (colevel==0 && j>=nf) break;
-               if (j<nf && (iflong? prevdrop.b[j]: prevdrop.a[j]) == k)
-                       {
-                       if (iflong)
-                       master.b[g]=k;
-                       else
-                       master.a[g]=k;
-                       coord[g++] = prevcoord[j++]+1;
-# if D1
-if (iflong)
-                       fprintf(stderr, " at g %d item %ld coord %d note %ld\n",g,master.b[g-1],coord[g-1],master.b[j-1]);
-else
-                       fprintf(stderr, " at g %d item %d coord %d note %d\n",g,master.a[g-1],coord[g-1],master.a[j-1]);
-# endif
-                       }
-               else
-               if (colevel >= nterm)
-                       {
-                       if (iflong)
-                       master.b[g]=k;
-                       else
-                       master.a[g]=k;
-                       coord[g++] = 1;
-                       }
-               }
-# if D1
-fprintf(stderr,"now have %d items\n",g);
-# endif
-       if (colevel>0)
-       for ( ; j<nf; j++)
-               if ((iflong?prevcoord.b[j]:prevcoord.a[j])+colevel > nterm)
-                       {
-                       _assert(g<lmaster);
-                       if (iflong)
-                       master.b[g] = prevdrop.b[j];
-                       else
-                       master.a[g] = prevdrop.a[j];
-                       coord[g++] = prevcoord[j];
-# if D3
-if(iflong)
-fprintf(stderr, "copied over %ld coord %d\n",master.b[g-1], coord[g-1]);
-else
-fprintf(stderr, "copied over %d coord %d\n",master.a[g-1], coord[g-1]);
-# endif
-                       }
-       nf = g;
-       }
-if (colevel>0)
-       {
-       best=0;
-       for(j=0; j<nf; j++)
-               if (coord[j]>best) best = coord[j];
-# if D1
-       fprintf(stderr, "colevel %d best %d\n", colevel, best);
-# endif
-       reached = best;
-       for(g=j=0; j<nf; j++)
-               if (coord[j]==best)
-                       {
-                       if (iflong)
-                       master.b[g++] = master.b[j];
-                       else
-                       master.a[g++] = master.a[j];
-                       }
-       nf=g;
-# if D1
-       fprintf(stderr, "yet got %d\n",nf);
-# endif
-       }
-# ifdef D1
-       fprintf(stderr, " returning with %d\n",nf);
-# endif
-if (colevel)
-       {
-       free(prevdrop, lmaster, iflong?4:2);
-       free(prevcoord, lmaster, sizeof (lmaster));
-       }
-# if D3
-for(g=0;g<nf;g++)
-if(iflong)
-fprintf(stderr,":%ld\n",master.b[g]);
-else
-fprintf(stderr,":%d\n",master.a[g]);
-# endif
-return(nf);
-}
-long
-getl(fb)
-       FILE *fb;
-{
-int x[2];
-long *lp;
-x[0] = getw(fb);
-x[1] = getw(fb);
-lp= x;
-return(*lp);
-}
-putl(ll, f)
-       long ll;
-       FILE *f;
-{
-int *x;
-x = &ll;
-putw(x[0], f);
-putw(x[1], f);
-}
-hcomp( n1, n2)
-{
-return (hfreq[hh[n1]]<=hfreq[hh[n2]]);
-}
-hexch( n1, n2 )
-{
-int t;
-t = hh[n1];
-hh[n1] = hh[n2];
-hh[n2] = t;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt3.c b/.ref-Research-V7/usr/src/cmd/refer/hunt3.c
deleted file mode 100644 (file)
index a3bdc85..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# include "refer..c"
-getq(v)
-       char *v[];
-{
-# define BSIZ 250
-static char buff[BSIZ];
-static int eof 0;
-extern char *sinput;
-char *p;
-int c, n 0, las 0;
-if (eof) return(-1);
-p = buff;
-while ( (c = (sinput ? *sinput++ : getchar()) ) > 0)
-       {
-       if (c== '\n')
-               break;
-       if (isalpha(c) || isdigit(c))
-               {
-               if (las==0)
-                       {
-                       v[n++] = p;
-                       las=1;
-                       }
-               if (las++ <= 6)
-                       *p++ = c;
-               }
-       else
-               {
-               if (las>0)
-                       *p++ = 0;
-               las=0;
-               }
-       }
-*p=0;
-assert(p<buff+BSIZ);
-if (sinput==0 && c<= 0) eof=1;
-# if D1
-fprintf(stderr, "no. keys %d\n",n);
-for(c=0; c<n; c++)
- fprintf(stderr, "keys X%sX\n", v[c]);
-# endif
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt5.c b/.ref-Research-V7/usr/src/cmd/refer/hunt5.c
deleted file mode 100644 (file)
index 19557a5..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# include "stdio.h"
-extern char *soutput, *tagout, usedir[];
-
-result(master, nf, fc)
-       union ptr {unsigned *a; long *b;} *master;
-       FILE *fc;
-{
-int i, c;
-char *s;
-long lp;
-extern int iflong;
-char res[100];
-
-for(i=0; i<nf; i++)
-       {
-       lp = iflong ? master.b[i] : master.a[i];
-       fseek(fc,lp, 0);
-       fgets(res, 100, fc);
-       for(s=res; c = *s; s++)
-               if (c== ';')
-                       {
-                       *s=0;
-                       break;
-                       }
-       if (tagout !=0)
-               {
-               if (res[0]=='/' || usedir[0]==0)
-                       sprintf(tagout, "%s", res);
-               else
-               sprintf(tagout, "%s/%s", usedir, res);
-               while (*tagout) tagout++;
-               }
-       else
-               {
-               if (res[0]!='/' || usedir[0]==0)
-                       printf("%s/", usedir);
-               printf("%s\n", res);
-               }
-       }
-}
-
-# include "sys/types.h"
-# include "sys/stat.h"
-long gdate(f)
-       FILE *f;
-{
-struct stat sb;
-fstat (f->_file, &sb);
-return  (sb . st_mtime);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt6.c b/.ref-Research-V7/usr/src/cmd/refer/hunt6.c
deleted file mode 100644 (file)
index 6deeec5..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-# include "stdio.h"
-# include "assert.h"
-# define TXTLEN 1000
-char *outbuf 0;
-extern char *soutput;
-extern int soutlen, iflong;
-extern long indexdate;
-baddrop(master, nf, fc, nitem, qitem, rprog, full)
-       union ptr {unsigned *a; long *b; } master;
-       FILE *fc;
-       char *qitem[], *rprog;
-{
-/* checks list of drops for real bad drops;
-   uses "deliv" to find items. */
-int i, g, j, need, got, na, len;
-long lp;
-char res[100], *ar[50], output[TXTLEN];
-extern int colevel, reached;
-# if D1
-if (iflong)
-fprintf(stderr,"in baddrop, nf %d master %ld %ld %ld\n", nf, master.b[0], master.b[1], master.b[2]);
-else
-fprintf(stderr,"in baddrop, nf %d master %d %d %d\n", nf, master.a[0], master.a[1], master.a[2]);
-# endif
-for (i=g=0; i<nf; i++)
-       {
-       lp = iflong ? master.b[i] : master.a[i];
-# if D1
-       if (iflong)
-       fprintf(stderr, "i %d master %lo lp %lo\n", i, master.b[i], lp);
-       else
-       fprintf(stderr, "i %d master %o lp %lo\n", i, master.a[i], lp);
-# endif
-       fseek (fc, lp, 0);
-       fgets( res, 100, fc);
-# if D1
-       fprintf(stderr, "tag %s", res);
-# endif
-       if (!auxil(res,output))
-               {
-               char *s; int c;
-# if D1
-               fprintf(stderr, "not auxil try rprog %c\n", rprog? 'y': 'n');
-# endif
-               for(s=res; c= *s; s++)
-                       if (c == ';' || c == '\n')
-                               {*s=0; break;}
-               len = rprog ?
-                       corout (res, output, rprog, 0, TXTLEN) :
-                       findline (res, output, TXTLEN, indexdate);
-               }
-# if D1
-       _assert (len <TXTLEN);
-       fprintf(stderr,"item %d of %d, tag %s len %d output\n%s\n..\n",i,nf,res, len,output);
-# endif
-       if (len==0)
-               continue;
-       need = colevel ? reached : nitem;
-       na=0;
-       ar[na++] = "fgrep";
-       ar[na++] = "-r";
-       ar[na++] = "-n";
-       ar[na++] = need;
-       ar[na++] = "-i";
-       ar[na++] = output;
-       ar[na++] = len;
-       for(j=0; j<nitem; j++)
-               ar[na++] = qitem[j];
-# ifdef D1
-       fprintf(stderr, "calling fgrep len %d ar[4] %s %o %d \n",len,ar[4],ar[5],ar[6]);
-# endif
-       if (fgrep(na, ar)==0)
-               {
-# ifdef D1
-       fprintf(stderr, "fgrep found it\n");
-# endif
-               if (iflong)
-                       master.b[g++] = master.b[i];
-               else
-                       master.a[g++] = master.a[i];
-               if (full >= g)
-                       if (soutput==0)
-                               fputs(output, stdout);
-                       else
-                               strcpy (soutput, output);
-               }
-# ifdef D1
-       fprintf(stderr, "after fgrep\n");
-# endif
-       }
-return(g);
-}
-auxil( res, output)
-       char *res, *output;
-{
-extern FILE *fd;
-long lp, c; int len;
-if (fd==0)return(0);
-while (c = *res++) 
-       {
-       if (c == ';')
-               {
-               sscanf(res, "%ld,%d", &lp, &len);
-               fseek (fd, lp, 0);
-               fgets(output, len, fd);
-               return(1);
-               }
-       }
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt7.c b/.ref-Research-V7/usr/src/cmd/refer/hunt7.c
deleted file mode 100644 (file)
index d1c0627..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-# include "stdio.h"
-# define SAME 0
-# include "assert.h"
-# define FGCT 10
-# define FGSIZE 150
-int keepold 1; /* keep old things for fgrep search */
-char fgspace[FGSIZE];
-char *fgp fgspace;
-char *fgnames[FGCT];
-char **fgnamp fgnames;
-findline(in, out, outlen, indexdate)
-       long indexdate;
-       char *in, *out;
-{
-static char name[100] "";
-char *p, **ftp;
-extern long gdate();
-static FILE *fa NULL;
-long lp, llen;
-int len, k, nofil;
-
-# if D1
-       fprintf(stderr, "findline: %s\n", in);
-# endif
-       if (mindex(in, '!'))
-               return(remote(in, out));
-       nofil = in[0]==0;
-       for(p=in; *p && *p != ':' && *p != ';'; p++)
-               ;
-       if (*p) *p++=0;
-       else p=in;
-       k = sscanf(p, "%ld,%ld", &lp, &llen);
-# ifdef D1
-       fprintf(stderr, "p %s k %d lp %ld llen %ld\n",p,k,lp,llen);
-# endif
-       if (k<2)
-               {
-               lp = 0;
-               llen=outlen;
-               }
-# ifdef D1
-       fprintf(stderr, "lp %ld llen %ld\n",lp, llen);
-# endif
-# ifdef D1
-fprintf(stderr, "fa now %o, p %o in %o %s\n",fa, p,in,in);
-# endif
-       if (nofil)
-{
-# if D1
-fprintf(stderr, "set fa to stdin\n");
-# endif
-               fa = stdin;
-}
-       else
-       if (strcmp (name, in) != 0 || 1)
-               {
-# if D1
-fprintf(stderr, "old: %s new %s not equal\n",name,in);
-# endif
-               if (fa != NULL)
-                       fa = freopen(in, "r", fa);
-               else
-                       fa = fopen(in, "r");
-# if D1
-               if (fa==NULL) fprintf(stderr, "failed to (re)open *%s*\n",in);
-# endif
-               if (fa == NULL)
-                       return(0);
-                       /* err("Can't open %s", in); */
-               strcpy(name, in);
-               if (gdate(fa) > indexdate && indexdate != 0)
-                       {
-                       if (keepold)
-                               {
-                               for(ftp=fgnames; ftp<fgnamp; ftp++)
-                                       if (strcmp(*ftp, name)==SAME)
-                                               return(0);
-                               strcpy (*fgnamp++ = fgp, name);
-                               assert(fgnamp<fgnames+FGCT);
-                               while (*fgp && *fgp!=':')
-                                       fgp++;
-                               *fgp++ = 0;
-                               assert (fgp<fgspace+FGSIZE);
-                               return(0);
-                               }
-                       fprintf(stderr, "Warning: index predates file '%s'\n", name);
-                       }
-               }
-# if D1
-       else
-               fprintf(stderr, "old %s new %s same fa %o\n", name,in,fa);
-# endif
-       if (fa != NULL)
-               {
-               fseek (fa, lp, 0);
-               len = (llen >= outlen) ? outlen-1 : llen;
-               len = fread (out, 1, len, fa);
-               out[len] = 0;
-# ifdef D1
-       fprintf(stderr, "length as read is %d\n",len);
-# endif
-               }
-       return(len);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt8.c b/.ref-Research-V7/usr/src/cmd/refer/hunt8.c
deleted file mode 100644 (file)
index d33d708..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# include "stdio.h"
-# include "assert.h"
-# define unopen(fil) {if (fil!=NULL) {fclose(fil); fil=NULL;}}
-extern long indexdate, gdate();
-runbib (s)
-       char *s;
-{
-/* make a file suitable for fgrep */
-char tmp[200];
-sprintf(tmp, "/usr/lib/refer/mkey %s >%s.ig", s,s);
-system(tmp);
-}
-makefgrep(indexname)
-       char *indexname;
-{
-       FILE *fa =NULL, *fb =NULL;
-       if (ckexist(indexname, ".ig"))
-               {
-               /* existing gfrep -type index */
-# if D1
-               fprintf(stderr, "found fgrep\n");
-# endif
-               fa = iopen(indexname, ".ig");
-               fb = iopen(indexname, "");
-               if (gdate(fb)>gdate(fa))
-                       {
-                       if (fa!=NULL)
-                               fclose(fa);
-                       runbib(indexname);
-                       fa= iopen(indexname, ".ig");
-                       }
-               indexdate = gdate(fa);
-               unopen(fa); unopen(fb);
-               }
-       else
-       if (ckexist(indexname, ""))
-               {
-               /* make fgrep */
-# if D1
-                       fprintf(stderr, "make fgrep\n");
-# endif
-               runbib(indexname);
-               time(&indexdate);
-               unopen(fb);
-               }
-       else /* failure */
-               return(0);
-return(1); /* success */
-}
-ckexist(s, t)
-       char *s, *t;
-{
-char fnam[100];
-strcpy (fnam, s);
-strcat (fnam, t);
-return (access(fnam, 04) != -1);
-}
-iopen (s, t)
-       char *s, *t;
-{
-char fnam[100];
-FILE *f;
-strcpy (fnam, s);
-strcat (fnam, t);
-f = fopen (fnam, "r");
-if (f == NULL)
-       {
-       err("Missing expected file %s", fnam);
-       exit(1);
-       }
-return(f);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/hunt9.c b/.ref-Research-V7/usr/src/cmd/refer/hunt9.c
deleted file mode 100644 (file)
index 73b615f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-remote(in, out)
-       char *in, *out;
-{
-/* "in" is a long distance file name: get it */
-;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/inv1.c b/.ref-Research-V7/usr/src/cmd/refer/inv1.c
deleted file mode 100644 (file)
index 234a8f3..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-# include "stdio.h"
-# include "assert.h"
-
-main(argc, argv)
-       char *argv[];
-{
-/* make inverted file indexes.  Reads a stream from mkey which
-   gives record pointer items and keys.  Generates a set of files
-      a. NHASH pointers to file b.
-      b. lists of record numbers.
-      c. record pointer items.
-
-   these files are named xxx.ia, xxx.ib, xxx.ic;
-   where xxx is taken from arg1.
-   If the files exist they are updated.
-*/
-
-FILE *fa, *fb, *fc, *fta, *ftb, *ftc, *fd;
-int nhash 256;
-int appflg 1;
-int keepkey 0, pipein 0;
-char nma[100], nmb[100], nmc[100], com[100], nmd[100];
-char tmpa[20], tmpb[20], tmpc[20];
-char *remove NULL;
-int chatty 0, docs, hashes, fp[2], fr, fw, pfork, pwait, status;
-int i,j,k;
-long keys;
-int iflong =0;
-char *sortdir;
-
-sortdir = (access("/crp/tmp", 06)==0) ? "/crp/tmp" : "/usr/tmp";
-while (argv[1][0] == '-')
-       {
-       switch(argv[1][1])
-               {
-               case 'h': /* size of hash table */
-                       nhash = atoi (argv[1]+2); break;
-               case 'n': /* new, don't append */
-                       appflg=0; break;
-               case 'a': /* append to old file */
-                       appflg=1; break;
-               case 'v': /* verbose output */
-                       chatty=1; break;
-               case 'd': /* keep keys on file .id for check on searching */
-                       keepkey=1; break;
-               case 'p': /* pipe into sort (saves space, costs time)*/
-                       pipein = 1; break;
-               case 'i': /* input is on file, not stdin */
-                       close(0);
-                       if (open(argv[2], 0) != 0)
-                               err("Can't read input %s", argv[2]);
-                       if (argv[1][2]=='u') /* unlink */
-                               remove = argv[2];
-                       argc--; argv++;
-                       break;
-               }
-       argc--;
-       argv++;
-       }
-
-strcpy (nma, argc >= 2 ? argv[1] : "Index");
-strcpy (nmb, nma);
-strcpy (nmc, nma);
-strcpy (nmd, nma);
-strcat (nma, ".ia");
-strcat (nmb, ".ib");
-strcat (nmc, ".ic");
-strcat (nmd, ".id");
-
-sprintf(tmpa, "junk%di", getpid());
-if (pipein)
-       {
-       pipe(fp); fr=fp[0]; fw=fp[1];
-       if ( (pfork=fork()) == 0)
-               {
-               close(fw);
-               close(0);
-               _assert(dup(fr)==0);
-               close(fr);
-               execl("/bin/sort", "sort", "-T", sortdir, "-o", tmpa, 0);
-               execl("/usr/bin/sort", "sort", "-T", sortdir, "-o", tmpa, 0);
-               _assert(0);
-               }
-       _assert(pfork!= -1);
-       close(fr);
-               fta = fopen("/dev/null", "w");
-               close(fta->_file);
-               fta->_file = fw;
-       }
-else /* use tmp file */
-       {
-       fta = fopen(tmpa, "w");
-       _assert (fta != NULL);
-       }
-fb = 0;
-if (appflg )
-       {
-       if (fb = fopen(nmb, "r"))
-               {
-               sprintf(tmpb, "junk%dj", getpid());
-               ftb = fopen(tmpb, "w");
-               if (ftb==NULL)
-                       err("Can't get scratch file %s",tmpb);
-               nhash = recopy(ftb, fb, fopen(nma, "r"));
-               fclose(ftb);
-               }
-       else
-               appflg=0;
-       }
-fc = fopen(nmc,  appflg ? "a" : "w");
-if (keepkey)
-fd = keepkey ? fopen(nmd, "w") : 0;
-docs = newkeys(fta, stdin, fc, nhash, fd, &iflong);
-fclose(stdin);
-if (remove != NULL)
-       unlink(remove);
-fclose(fta);
-if (pipein)
-       {
-       pwait = wait(&status);
-       printf("pfork %o pwait %o status %d\n",pfork,pwait,status);
-       _assert(pwait==pfork);
-       _assert(status==0);
-       }
-else
-       {
-       sprintf(com, "sort -T %s %s -o %s", sortdir, tmpa, tmpa);
-       system(com);
-       }
-
-if (appflg)
-       {
-       sprintf(tmpc, "junk%dk", getpid());
-       sprintf(com, "mv %s %s", tmpa, tmpc);
-       system(com);
-       sprintf(com, "sort -T %s  -m %s %s -o %s", sortdir,
-               tmpb, tmpc, tmpa);
-       system(com);
-       }
-fta = fopen(tmpa, "r");
-fa = fopen(nma, "w");
-fb = fopen(nmb, "w");
-whash(fta, fa, fb, nhash, iflong, &keys, &hashes);
-fclose(fta);
-# ifndef D1
-unlink(tmpa);
-# endif
-if (appflg)
-       {
-       unlink(tmpb);
-       unlink(tmpc);
-       }
-if (chatty)
-       
-       printf ("%ld key occurrences,  %d hashes, %d docs\n",
-               keys, hashes, docs);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/inv2.c b/.ref-Research-V7/usr/src/cmd/refer/inv2.c
deleted file mode 100644 (file)
index 3c366ea..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-# include "stdio.h"
-# include "assert.h"
-newkeys (outf, inf, recf, nhash, fd, iflong)
-       FILE *outf, *inf, *recf, *fd;
-       int *iflong;
-{
-/* reads key lines from inf; hashes and writes on outf; writes orig
-   key on recf, records pointer on outf too.
-   format of outf is : hash code space record pointer
-*/
-
-# define LINESIZ 1250
-long lp, ftell();
-long ld 0; int ll 0, lt 0;
-char line[LINESIZ];
-char key[30], bkeys[40];
-char *p, *s;
-char *keyv[500];
-int i, nk, ndoc 0, more 0, c;
-
-lp = ftell (recf);
-while (fgets(line, LINESIZ, inf))
-       {
-       p = line;
-       while (*p != '\t') p++;
-       *p++ =0;
-       fputs(line, recf);
-       if (fd)
-               {
-               sprintf(bkeys, ";%ld", ld);
-               ll = strlen(p);
-               lt = strlen(bkeys);
-               fputs(bkeys, recf);
-               sprintf(bkeys, ",%d", ll);
-               lt += strlen(bkeys);
-               fputs(bkeys, recf);
-               ld += ll;
-               fputs(p, fd);
-               }
-       putc('\n',recf);
-       for(s=p; *s; s++);
-       if (*--s == '\n')
-               {
-               more=0;
-               *s=0;
-               }
-       else
-               more=1;
-       _assert (fd==0 || more==0);
-       nk = getargs(p, keyv);
-       if (more)
-               nk--;
-       for(i=0; i<nk; i++)
-               fprintf(outf,"%04d %06ld\n",hash(keyv[i])%nhash, lp);
-# if D1
-       for(i=0; i<nk; i++)
-               printf("key %s hash %d\n",keyv[i],hash(keyv[i])%nhash);
-# endif
-       if (more) /* allow more than LINESIZ keys */
-               {
-               strcpy(key, keyv[nk]);
-               for(s=key; *s; s++);
-               while ( (c=getc(inf)) != '\n')
-                       {
-                       if (c != ' ')
-                               {
-                               *s++ = c;
-                               continue;
-                               }
-                       *s=0;
-                       if (s>key)
-                               fprintf(outf, "%04d %06ld\n",hash(key)%nhash, lp);
-                       s = key;
-                       }
-               }
-       lp += (strlen(line)+lt+1);
-       ndoc++;
-       }
-*iflong = (lp>=65536L);
-fclose(recf);
-return(ndoc);
-}
-trimnl(p)
-       char *p;
-{
-while (*p) p++;
-p--;
-if (*p == '\n') *p=0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/inv3.c b/.ref-Research-V7/usr/src/cmd/refer/inv3.c
deleted file mode 100644 (file)
index 0448f4e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-getargs(s, arps)
-       char *s, *arps[];
-{
-       int i;
-i = 0;
-while (1)
-       {
-       arps[i++]=s;
-       while (*s != 0 && *s!=' '&& *s != '\t')s++;
-       if (*s==0) break;
-       *s++ =0;
-       while (*s==' ' || *s=='\t')s++;
-       if (*s==0)break;
-       }
-return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/inv5.c b/.ref-Research-V7/usr/src/cmd/refer/inv5.c
deleted file mode 100644 (file)
index ddb3893..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# include "stdio.h"
-
-recopy (ft, fb, fa, nhash)
-       FILE *ft, *fb, *fa;
-{
-/* copy fb (old hash items/pointers) to ft (new ones) */
-int n, i, iflong;
-long getl();
-int getw();
-int *hpt_s;
-int (*getfun)();
-long *hpt_l;
-long k, lp;
-if (fa==NULL)
-       {
-       err("No old pointers",0);
-       return;
-       }
-fread(&n, sizeof(n), 1, fa);
-fread(&iflong, sizeof(iflong), 1, fa);
-if (iflong)
-       {
-       hpt_l =  calloc(sizeof(*hpt_l), n+1);
-       n =fread(hpt_l, sizeof(*hpt_l), n, fa);
-       }
-else
-       {
-       hpt_s =  calloc(sizeof(*hpt_s), n+1);
-       n =fread(hpt_s, sizeof(*hpt_s), n, fa);
-       }
-if (n!= nhash)
-       fprintf(stderr, "Changing hash value to old %d\n",n);
-fclose(fa);
-if (iflong)
-       getfun = &getl;
-else
-       getfun = &getw;
-for(i=0; i<n; i++)
-       {
-       if (iflong)
-               lp = hpt_l[i];
-       else
-               lp = hpt_s[i];
-       fseek(fb, lp, 0);
-       while ( (k= (*getfun)(fb) ) != -1)
-               fprintf(ft, "%04d %06ld\n",i,k);
-       }
-fclose(fb);
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/inv6.c b/.ref-Research-V7/usr/src/cmd/refer/inv6.c
deleted file mode 100644 (file)
index 1d48b28..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-# include "stdio.h"
-# include "assert.h"
-whash(ft, fa, fb, nhash, iflong, ptotct, phused)
-       FILE *fa, *fb, *ft;
-       int nhash, *phused;
-       long *ptotct;
-{
-char line[100];
-int hash 0, hused 0;
-long totct 0L;
-int ct 0;
-long point;
-long opoint -1;
-int m;
-int k; long lp;
-long *hpt;
-int *hfreq NULL;
-
-hpt = calloc (nhash+1, sizeof(*hpt));
-_assert (hpt != NULL);
-hfreq = calloc (nhash, sizeof(*hfreq));
-_assert (hfreq !=NULL);
-hpt[0] = 0;
-lp= 0;
-while (fgets(line, 100, ft))
-       {
-       totct++;
-       sscanf(line, "%d %ld", &k, &point);
-       if (hash < k)
-               {
-               hused++;
-               if (iflong) putl(-1L, fb); else putw(-1, fb);
-               hfreq[hash]=ct;
-               while (hash<k)
-                       {
-                       hpt[++hash] = lp;
-                       hfreq[hash] = 0;
-                       }
-               hpt[hash] = lp += iflong? sizeof(long) : sizeof(int);
-               opoint= -1;
-               ct=0;
-               }
-       if (point!=opoint)
-               {
-               if (iflong)
-                       putl(opoint=point, fb);
-               else
-                       putw( (int)(opoint=point), fb);
-               lp += iflong? sizeof(long) : sizeof(int);
-               ct++;
-               }
-       }
-if (iflong) putl(-1L, fb); else putw(-1,fb);
-while (hash<nhash)
-       hpt[++hash]=lp;
-fwrite(&nhash, sizeof(nhash), 1, fa);
-fwrite(&iflong, sizeof(iflong), 1, fa);
-fwrite(hpt, sizeof(*hpt), nhash, fa);
-fwrite (hfreq, sizeof(*hfreq), nhash, fa);
-*ptotct = totct;
-*phused = hused;
-}
-putl(ll, f)
-       long ll;
-       FILE *f;
-{
-int *x;
-x = &ll;
-putw(x[0], f);
-putw(x[1], f);
-}
-long getl(f)
-       FILE *f;
-{
-int x[2];
-int *ll;
-x[0] = getw(f);
-x[1] = getw(f);
-ll = x;
-return (*ll);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/kaiser.c b/.ref-Research-V7/usr/src/cmd/refer/kaiser.c
deleted file mode 100644 (file)
index cd1ddfb..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-char *months[] {"Jan", "Feb", "Mar", "Apr", "May",
-       "Jun", "Jul", "Aug", "Sep","Oct", "Nov", "Dec",0};
-main()
-{
-int state 1000, i, book, volume, corp, report;
-int na;
-char *v[20], **vv, **rr;
-char ubuff[1000], *up;
-char line[100];
-char *p, *s, *r, *q;
-while (gets(line))
-       {
-       if (line[1]>'9' || line[1]<'0') continue;
-       switch(line[0])
-               {
-               case 'T':
-                       if (state > 'T')
-                               {
-                               book=0;
-                               report=0;
-                               printf("\n%%T ");
-                               }
-                       printf("%s\n", line+18);
-                       state='T';
-                       na = getargs(line+18, v);
-                       for(i=0;i<na;i++)
-                               if (strcmp(v[i], "(Book)")==0)
-                                       book=1;
-                       continue;
-               case 'A':
-                       state = 'A';
-                       na=getargs(line+18, vv=v);
-                       if (na<=0) continue;
-                       while (na>0)
-                               {
-                               printf("%%A ");
-                               corp=0;
-                               for(p=vv[1]; *p; p++)
-                                       if (islower(*p))
-                                               corp=1;
-                               if (corp==0)
-                                       {
-                                       for(p=vv[1]; *p; p++)
-                                               printf("%c. ", *p);
-                                       if (na>2 &&strcmp(vv[2], "+"))
-                                               {
-                                               printf("%s", vv[0]);
-                                               if (strcmp(vv[2], "Jr.")==0)
-                                                       printf(",");
-                                               printf(" %s\n",vv[2]);
-                                               vv++;na--;
-                                               }
-                                       else
-                                               printf("%s\n", vv[0]);
-                                       }
-                               else
-                                       printf("%s %s\n",vv[0],vv[1]);
-                               vv+=2;
-                               na-=2;
-                               if (strcmp(vv[0], "+")==0)
-                                       {
-                                       vv++;na--;
-                                       }
-                               }
-                       continue;
-               case 'U':
-                       if (state!='U')
-                               ubuff[0]=0;
-                       else
-                               strcat(ubuff, " ");
-                       state = 'U';
-                       strcat(ubuff, line+18);
-                       if (line[2]=='.')
-                               { /* end of item */
-                               p=ubuff; /*start*/
-                               volume=0;
-                               for(s=ubuff; *s; s++)
-                                       if (s[-1]==' ' && prefix("Vol", s))
-                                               {
-                                               for(q=s-1; q>ubuff; q--)
-                                                       {
-                                                       if (*q==' ' || *q==',') *q=0;
-                                                       else break;
-                                                       }
-                                               volume=1;
-                                               break;
-                                               }
-                               if (*s==0)
-                               for(s=ubuff; *s && (*s!=',' || sprefix("Inc", s+1)); s++)
-                                       ;
-                               else
-                               s++;
-                               if (*s==',')*s++=0;
-                               if (book)
-                                       printf("%%I %s\n",ubuff);
-                               else if (volume)
-                                       printf("%%J %s\n", ubuff);
-                               else if (substr(ubuff, "Report")!=0)
-                                       {
-                                       report=1;
-                                       printf("%%R %s\n", ubuff);
-                                       }
-                               else
-                                       printf("%%J %s\n", ubuff);
-                               if (volume)
-                                       {
-                                       s += 3; /* Vol */
-                                       if (*s=='.') s++;
-                                       while (*s==' ')s++;
-                                       printf("%%V ");
-                                       while (*s && *s != ' ' && *s!=',' && *s!=';' && *s!= ':')
-                                               putchar(*s++);
-                                       putchar('\n');
-                                       if (*s==':')
-                                               {
-                                               printf("%%N ");
-                                               while (*s==' ')s++;
-                                               while (isdigit(*s))
-                                                       putchar(*s++);
-                                               putchar('\n');
-                                               }
-                                       *s++=0;
-                                       while (*s==' ')*s++=0;
-                                       if (s[0]=='N' && s[1]=='o' && (s[2]==' '||s[2]=='.'))
-                                               {
-                                               s+=2;
-                                               while (*s==' '||*s=='.')s++;
-                                               printf("%%N ");
-                                               while (isdigit(*s)||*s=='-')
-                                                       putchar(*s++);
-                                               putchar('\n');
-                                               }
-                                       if (*s==',') *s++=0;
-                                       }
-                               for(rr=months; *rr; rr++)
-                                       {
-                                       q= substr(s, *rr);
-                                       if (q)
-                                               {
-                                               for(r=q; *r; r++);
-                                               r--;
-                                               if (*r=='.')*r=0;
-                                               printf("%%D %s\n",q);
-                                               *(q-1)=0;
-                                               break;
-                                               }
-                                       }
-                               if (*rr==0)
-                                       {
-                                       for(q=s; *q; q++)
-                                               {
-                                               if (q[0]=='1' && q[1]=='9' && (q[4]==0 || (q[4]=='.' && q[5]==0)))
-                                                       {
-                                                       if (q[4]=='.') q[4]=0;
-                                                       printf("%%D %s\n",q);
-                                                       rr=months;
-                                                       q[-1]=0;
-                                                       if (q==s) q[0]=0;
-                                                       break;
-                                                       }
-                                               }
-                                       }
-                               if (*rr==0) /* no date */
-                                       printf("%%D 19xx\n");
-                               /* if book bite off next field for city, if report for issuer */
-                               if (book)
-                                       {
-                                       for(q=s; *q && *q != ','; q++)
-                                               ;
-                                       if (*q==',')
-                                               {
-                                               r=q;
-                                               r++;
-                                               while (*r==' ')r++;
-                                               if (isupper(r[0]) && isupper(r[1]))
-                                                       {
-                                                       r+=2;
-                                                       *r++=0;
-                                                       while (*r==' ')r++;
-                                                       }
-                                               else
-                                                       *q=0;
-                                               printf("%%C %s\n", s);
-                                               s=r;
-                                               }
-                                       }
-                               for(q=s; *q; q++)
-                                       {
-                                       if (q[0]==' ' && q[1]=='p' && (q[2]=='p'||q[2]==0))
-                                               {
-                                               for(r=q; r>s; r--)
-                                                       {
-                                                       if (*r==' ' || *r==',')
-                                                               *r=0;
-                                                       }
-                                               *q=0;
-                                               q+=2;
-                                               if (q[0]=='p')q++;
-                                               while (*q==' '||*q=='.')q++;
-                                               r=q;
-                                               while (isdigit(*q)||*q=='.'||*q=='-'||isalpha(*q))q++;
-                                               *q++=0;
-                                               while (*q==' ')q++;
-                                               printf("%%P %s\n",r);
-                                               break;
-                                               }
-                                       }
-                               s=ispp(s);
-                               while (*s==' ')s++;
-                               while (*q==' ')q++;
-                               if (*s||*q)
-                                       printf("%%O %s %s\n", *s?s:"", *q?q:"");
-                               }
-                       continue;
-               }
-       }
-}
-getargs(s, arps)
-       char *s, *arps[];
-{
-       int i;
-i = 0;
-while (1)
-       {
-       arps[i++]=s;
-       while (*s != 0 && *s!=' '&& *s != '\t')s++;
-       if (*s==0) break;
-       *s++ =0;
-       while (*s==' ' || *s=='\t')s++;
-       if (*s==0)break;
-       }
-return(i);
-}
-prefix(small, big)
-       char *small, *big;
-{
-int c;
-while ((c= *small++) == *big++)
-       if (c==0) return(1);
-return(c==0);
-}
-substr(big, small)
-       char *small, *big;
-{
-while (*big)
-       if (prefix(small, big))
-               return(big);
-       else
-               big++;
-return(0);
-}
-sprefix(small, big)
-       char *small, *big;
-{
-while (*big==' ') big++;
-return(prefix(small,big));
-}
-ispp(s)
-       char *s;
-{
-static char buff[50];
-char *p, *t;
-p=s;
-while (*p==' ') p++;
-if (!isdigit(*p)) return(s);
-t=p;
-while (isdigit(*p))p++;
-if (p[0]!='p' || p[1]!='p') return(s);
-*p=0;
-sprintf(buff, "%spp.", t);
-return(buff);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/makefile b/.ref-Research-V7/usr/src/cmd/refer/makefile
deleted file mode 100644 (file)
index 25575b5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-CFLAGS = -O -s
-
-all:   mkey inv hunt refer
-       :
-
-cp:    all
-       cp refer /bin
-       cp inv hunt mkey /usr/lib/refer
-       rm mkey inv hunt refer *.o
-
-cmp:   all
-       cmp refer /bin/refer
-       cmp inv /usr/lib/refer/inv
-       cmp hunt /usr/lib/refer/hunt
-       cmp mkey /usr/lib/refer/mkey
-       rm mkey inv hunt refer *.o
-
-mkey: mkey1.o mkey2.o mkey3.o deliv2.o
-       cc -s -n mkey?.o deliv2.o -o mkey
-inv: inv1.o inv2.o inv3.o inv5.o inv6.o deliv2.o
-       cc -s -n inv?.o deliv2.o -o inv
-hunt: hunt1.o hunt2.o hunt3.o hunt5.o hunt6.o hunt7.o glue5.o
-hunt: refer3.o hunt9.o shell.o deliv2.o hunt8.o glue4.o
-       cc -s -i hunt?.o refer3.o glue5.o glue4.o shell.o deliv2.o -o hunt
-deliv: deliv1.o deliv2.o
-       cc -s -n deliv?.o  -o deliv
-refpart: refer0.o refer1.o refer2.o refer3.o refer4.o refer5.o
-refpart: refer6.o refer7.o refer8.o deliv2.o glue4.o
-       cc -s -n refer?.o deliv2.o glue4.o  -o refpart
-refer0.o: refer..c
-refer1.o: refer..c
-refer2.o: refer..c
-refer3.o: refer..c
-refer4.o: refer..c
-refer6.o: refer..c
-refer: glue1.o refer1.o refer2.o refer4.o refer5.o refer6.o mkey3.o
-refer: refer7.o refer8.o hunt2.o hunt3.o deliv2.o hunt5.o hunt6.o hunt8.o
-refer: glue3.o hunt7.o hunt9.o glue2.o glue4.o glue5.o refer0.o shell.o
-       cc -s -i glue?.o refer[01245678].o hunt[2356789].o mkey3.o shell.o deliv2.o -o refer
-whatabout: what1.o what2.o what3.o what4.o shell.o mkey3.o
-       cc -s -n what?.o shell.o mkey3.o  -o whatabout
diff --git a/.ref-Research-V7/usr/src/cmd/refer/mkey1.c b/.ref-Research-V7/usr/src/cmd/refer/mkey1.c
deleted file mode 100644 (file)
index 29a7efd..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-# include "stdio.h"
-extern char *comname; /* "/usr/lib/eign" */
-int wholefile = 0;
-int keycount = 100;
-int labels = 1;
-int minlen = 3;
-extern int comcount;
-char *iglist "XYZ#";
-
-main (argc,argv)
-       char *argv[];
-{
-/* this program expects as its arguments a list of
-   files and generates a set of lines of the form
-     filename:byte-add,length (tab) key1 key2 key3
-   where the byte addresses give the position within
-   the file and the keys are the strings off the lines
-   which are alphabetic, first six characters only.
-*/
-
-int i;
-char *name, qn[200];
-char *inlist 0;
-
-FILE *f, *ff;
-
-while (argc>1 && argv[1][0] == '-')
-       {
-       switch(argv[1][1])
-               {
-               case 'c':
-                       comname = argv[2];
-                       argv++; argc--;
-                       break;
-               case 'w':
-                       wholefile = 1;  break;
-               case 'f':
-                       inlist = argv[2];
-                       argv++; argc--;
-                       break;
-               case 'i':
-                       iglist = argv[2];
-                       argv++; argc--;
-                       break;
-               case 'l':
-                       minlen = atoi(argv[1]+2);
-                       if (minlen<=0) minlen=3;
-                       break;
-               case 'n': /* number of common words to use */
-                       comcount = atoi(argv[1]+2);
-                       break;
-               case 'k': /* number  of keys per file max */
-                       keycount = atoi(argv[1]+2);
-                       break;
-               case 's': /* suppress labels, search only */
-                       labels = 0;
-                       break;
-               }
-       argc--; argv++;
-       }
-if (inlist)
-       {
-       ff = fopen(inlist, "r");
-       while (fgets(qn, 200, ff))
-               {
-               trimnl(qn);
-               f = fopen (qn, "r");
-               if (f!=NULL)
-                       dofile(f, qn);
-               else
-                       fprintf(stderr, "Can't read %s\n",qn);
-               }
-       }
-else
-if (argc<=1)
-       dofile(stdin, "");
-else
-for(i=1; i<argc; i++)
-       {
-       f = fopen(name=argv[i], "r");
-       if (f==NULL)
-               err("No file %s",name);
-       else
-               dofile(f, name);
-       }
-exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/mkey2.c b/.ref-Research-V7/usr/src/cmd/refer/mkey2.c
deleted file mode 100644 (file)
index bda2005..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-
-       static int eof 0;
-       static long lp, lim;
-       static int alph, used, prevc;
-       static char *p, key[20];
-
-dofile(f, name)
-       FILE *f;
-       char *name;
-{
-
-/* read file f & spit out keys & ptrs */
-# define MAXLINE 500
-char line[MAXLINE], *s;
-extern int minlen, keycount, labels;
-int c;
-long grec();
-extern int wholefile;
-extern char *iglist;
-alph=used=prevc=eof=0;
-
-lp=0;
-if (wholefile==0)
-while (lim = grec(line,f))
-       {
-# if D1
-fprintf(stderr, "line: /%s",line);
-# endif
-       used=alph=0;
-       p = key;
-       for(s=line; (c= *s) && (used<keycount); s++)
-               chkey(c, name);
-       lp += lim;
-       if (used) putchar('\n');
-       }
-else
-       {
-       p=key;
-       used=alph=0;
-       while ( (c=getc(f)) != EOF && used<keycount)
-               chkey (c, name);
-       if (used) putchar('\n');
-       }
-fclose(f);
-}
-
-outkey( ky, lead, trail)
-       char *ky;
-{
-       int n;
-n = strlen(ky);
-if (n<minlen) return (0);
-if (n<3)
-       {
-       if (trail == '.') return(0);
-       if (mindex(".%,!#$%&'();+:*", lead)!=0) return(0);
-       }
-if (isdigit(ky[0]))
-       if (ky[0] != '1' || ky[1] != '9' || n!= 4) return(0);
-if (common(ky))
-       return(0);
-return(1);
-}
-long grec (s, f)
-       char *s;
-       FILE *f;
-{
-       char tm[200];
-       int curtype 0;
-       long len 0L, tlen 0L;
-       extern int wholefile;
-       if (eof) return(0);
-       *s = 0;
-       while (fgets(tm, 200, f))
-               {
-               tlen += strlen(tm);
-               if (tm[0] == '%' || tm[0] == '.')
-                       curtype = tm[1];
-               if (tlen < MAXLINE && mindex(iglist,curtype)==0)
-                               strcat(s, tm);
-               len = tlen;
-               if (wholefile==0 && tm[0] == '\n')
-                       return(len);
-               if (wholefile>0 && len >= MAXLINE)
-                       {
-                       fseek (f, 0L, 2);
-                       return(ftell(f));
-                       }
-               }
-       eof=1;
-       return(s[0] ? len : 0L);
-}
-trimnl(ln)
-       char *ln;
-{
-register char *p ln;
-while (*p) p++;
-p--;
-if (*p == '\n') *p=0;
-return(ln);
-}
-chkey (c, name)
-       {
-       if (isalpha(c) || isdigit(c))
-               {
-               if (alph++ < 6)
-                       *p++ = c;
-               }
-       else
-               {
-               *p = 0;
-               for(p=key; *p; p++)
-                       *p |= 040;
-               if (outkey(p=key,prevc,c))
-                       {
-                       if (used==0)
-                           {
-                           if (labels)
-                               {
-                               if (wholefile==0)
-                                       printf("%s:%ld,%ld\t", name, lp, lim);
-                               else
-                                       printf("%s\t", name);
-                           }
-                               }
-                       else
-                               putchar(' ');
-                       fputs(key, stdout);
-                       used++;
-                       }
-               prevc=c;
-               alph=0;
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/refer/mkey3.c b/.ref-Research-V7/usr/src/cmd/refer/mkey3.c
deleted file mode 100644 (file)
index a608531..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# include "stdio.h"
-char *comname "/usr/lib/eign";
-static int cgate 0;
-extern char *comname;
-# define COMNUM 500
-# define COMTSIZE 997
-int comcount 100;
-static char cbuf[COMNUM*9];
-static char *cwds[COMTSIZE];
-static char *cbp;
-
-common (s)
-       char *s;
-{
-if (cgate==0) cominit();
-return (c_look(s, 1));
-}
-cominit()
-{
-int i;
-FILE *f;
-cgate=1;
-f = fopen(comname, "r");
-if (f==NULL) return;
-cbp=cbuf;
-for(i=0; i<comcount; i++)
-       {
-       if (fgets(cbp, 15, f)==NULL)
-               break;
-       trimnl(cbp);
-       c_look (cbp, 0);
-       while (*cbp++);
-       }
-fclose(f);
-}
-c_look (s, fl)
-       char *s;
-{
-int h;
-h = hash(s) % (COMTSIZE);
-while (cwds[h] != 0)
-       {
-       if (strcmp(s, cwds[h])==0)
-               return(1);
-       h = (h+1) % (COMTSIZE);
-       }
-if (fl==0)
-       cwds[h] = s;
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer..c b/.ref-Research-V7/usr/src/cmd/refer/refer..c
deleted file mode 100644 (file)
index 1629ed7..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-# include "assert.h"
-extern FILE *in;
-extern int endpush, labels, sort, bare, keywant;
-extern char *smallcaps;
-extern char comname;
-extern char *keystr;
-extern int authrev;
-extern int nmlen, dtlen;
-extern char *data[], **search;
-extern int refnum;
-extern char *reftable[];
-extern char *rtp, reftext[];
-extern int sep;
-extern char tfile[];
-extern char gfile[];
-extern char ofile[];
-extern char hidenam[];
-extern char *Ifile; extern int Iline;
-extern FILE *fo, *ftemp;
-# define FLAG 003
-# define NRFTXT 2000
-# define NTFILE 20
-# define NRFTBL 200
-# define LLINE 512
-# define QLEN 300
-# define ANSLEN 1000
-# define TAGLEN 400
-# define NSERCH 20
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer0.c b/.ref-Research-V7/usr/src/cmd/refer/refer0.c
deleted file mode 100644 (file)
index e9a1bbd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# include "stdio.h"
-# include "refer..c"
-FILE *in = stdin;
-int endpush 0;
-int labels 0;
-int keywant 0;
-int sort 0;
-int bare 0;
-int authrev 0;
-char *smallcaps "";
-char *keystr "AD";
-int nmlen 0, dtlen 0;
-char *data[NSERCH];
-char **search data;
-int refnum 0;
-char reftext[NRFTXT];
-char *reftable[NRFTBL];
-char *rtp reftext;
-int sep '\n';
-char tfile[NTFILE];
-FILE *fo = stdout;
-FILE *ftemp = stdout;
-char ofile[NTFILE];
-char gfile[NTFILE];
-char hidenam[NTFILE];
-char *Ifile "standard input";
-int Iline 0;
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer1.c b/.ref-Research-V7/usr/src/cmd/refer/refer1.c
deleted file mode 100644 (file)
index a63c834..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-# include "signal.h"
-# include "refer..c"
-main(argc,argv)
-       char *argv[];
-{
-char line[LLINE], *s;
-int nodeflt =0;
-
-signals();
-while (argv[1][0] == '-')
-       {
-       switch(argv[1][1])
-               {
-               case 'e':
-                       endpush++; break;
-               case 'l': 
-                       labels++;
-                       s = argv[1]+2;
-                       nmlen = atoi(s);
-                       while (*s)
-                               if (*s++ == ',')
-                                       break;
-                       dtlen = atoi(s);
-                       break;
-               case 'k':
-                       keywant = (argv[1][2] ? argv[1][2] : 'L');
-                       labels++;
-                       break;
-               case 's':
-                       sort++;
-                       if (argv[1][2])
-                               keystr= argv[1]+2;
-                       break;
-               case 'p':
-                       argc--; argv++;
-                       *search++ = argv[1];
-                       if (search-data>NSERCH)
-                               err("too many -p options (%d)", NSERCH);
-                       break;
-               case 'n':
-                       nodeflt=1;
-                       break;
-               case 'b':
-                       bare = (argv[1][2] == '1') ? 1 : 2;
-                       break;
-               case 'c':
-                       smallcaps = argv[1]+2;
-                       break;
-               case 'a':
-                       authrev = atoi (argv[1]+2);
-                       if (authrev<=0)
-                               authrev = 1000;
-                       break;
-               }
-       argc--; argv++;
-       }
-if (nodeflt==0)
-       *search++ = "/usr/dict/papers/Ind";
-
-if (sort)
-       endpush=1;
-if (endpush)
-       {
-       sprintf(tfile, "/tmp/rj%da", getpid());
-       fo = fopen(tfile, "w");
-       if (fo==NULL)
-               {
-               fo = ftemp;
-               fprintf(stderr,"Can't open scratch file");
-               }
-       sep = 002; /* separate records without confusing sort..*/
-       }
-
-
-if (sort && !labels)
-       {
-       sprintf(ofile,"/tmp/rj%db", getpid());
-       ftemp = fopen(ofile, "w");
-       if (ftemp==NULL)
-               {
-               fprintf(stderr, "Can't open scratch file\n");
-               exit(1);
-               }
-       }
-
-do
-       {
-       if (argc>1)
-               {
-               fclose(in);
-               Iline=0;
-               in = fopen(Ifile=argv[1], "r");
-               argc--; argv++;
-               if (in==NULL)
-                       {
-                       err("Can't read %s", Ifile);
-                       continue;
-                       }
-               }
-       while (input(line))
-               {
-               Iline++;
-# ifdef D1
-               fprintf(stderr, "line %.20s\n",line);
-# endif
-               if (!prefix(".[", line))
-                       output(line);
-               else
-                       doref(line);
-# if D1
-               fprintf(stderr, "past output/doref\n");
-# endif
-               }
-       }
-       while (argc>1);
-if (endpush && fo!=NULL)
-       dumpold();
-output("", ftemp);
-if (sort && !labels)
-       recopy(ofile);
-clfgrep();
-cleanup();
-exit(0);
-}
-
-extern int intr();
-signals()
-{
-       int oldint;
-oldint = signal(SIGINT, &intr);
-if (oldint==1)
-       signal (SIGINT, 1);
-signal (SIGHUP, &intr);
-signal (SIGPIPE, &intr);
-signal (SIGTERM, &intr);
-}
-
-intr()
-{
-       int oldsig;
-signal(SIGINT, 1);
-cleanup();
-exit(1);
-}
-cleanup()
-{
-if (tfile[0]) unlink(tfile);
-if (gfile[0]) unlink(gfile);
-if (ofile[0]) unlink(ofile);
-if (hidenam[0]) unlink(hidenam);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer2.c b/.ref-Research-V7/usr/src/cmd/refer/refer2.c
deleted file mode 100644 (file)
index b323717..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-# include "refer..c"
-extern FILE *in;
-# define NFLD 30
-# define TLEN 400
-char one[ANSLEN];
-int onelen ANSLEN;
-static char dr [100] "";
-doref(firline)
-       char *firline;
-{
-char buff[QLEN], dbuff[3*QLEN], answer[ANSLEN], temp[TLEN];
-char line[LLINE];
-char *p, **sr, *flds[NFLD], *r;
-int nf, nr, alph, query 0, chp, digs;
-
-/* get query */
-buff[0] = dbuff[0] = 0;
-while (input(line))
-       {
-       if (prefix(".]", line))
-               break;
-       if (control(line[0])) query=1;
-       strcat (query  ? dbuff: buff, line);
-       if (strlen(buff)>QLEN)
-               err("buff too big (%d)", strlen(buff));
-       assert (strlen(dbuff) <3*QLEN);
-       }
-if (strcmp (buff, "$LIST$\n")==0)
-       {
-# if D1
-fprintf(stderr, "dump sorted list\n");
-# endif
-       assert ( dbuff[0]==0);
-       dumpold();
-       return;
-       }
-answer[0] = 0;
-# ifdef D1
-       fprintf(stderr, "query is %s\n",buff);
-# endif
-for( p=buff; *p; p++)
-       {
-       if (isupper(*p)) *p |= 040;
-       }
-alph = digs =0;
-for(p=buff; *p; p++)
-       {
-       if (isalpha(chp = *p)) alph++;
-       else
-       if (isdigit(*p)) digs++;
-       else
-               {
-               *p=0;
-               if ( (alph+digs<3) || common(p-alph))
-                       {
-                       r = p-alph;
-                       while (r < p)
-                               *r++ = ' ';
-                       }
-               if ( alph==0 && digs >0)
-                       {
-                       r = p-digs;
-# if D1
-fprintf(stderr, "number, %d long, text is %s\n",digs,r);
-# endif
-                       if (digs != 4 || (atoi(r)/100 != 19))
-                               {
-                               while (r<p)
-                                       *r++ = ' ';
-                               }
-                       }
-               *p=' ';
-               alph = digs = 0;
-               }
-       }
-# ifdef D1
-       fprintf(stderr, "query translated to %s\n", buff);
-# endif
-one[0]=0;
-if (buff[0]) /* do not search if no query */
-for( sr= data; sr < search; sr++)
-       {
-# ifdef D1
-       fprintf(stderr, "now searching %s\n", *sr);
-# endif
-       temp[0]=0;
-       corout (buff, temp, "hunt", *sr, TLEN);
-       assert (strlen(temp)<TLEN);
-       if (strlen(temp)+strlen(answer)>LLINE)
-               err("Accumulated answers too large",0);
-       strcat (answer, temp);
-       if (strlen(answer)>LLINE)
-               err("answer too long (%d)", strlen(answer));
-       if (newline(answer) > 0) break;
-       }
-# if D1
-fprintf(stderr, "answer:\n%s****\n", answer);
-# endif
-assert (strlen(one)<ANSLEN);
-assert (strlen(answer)<ANSLEN);
-if (buff[0])
-switch (newline(answer))
-       {
-       case 0:
-               fprintf (stderr, "No such paper %s\n", buff);
-               return;
-       default:
-               fprintf(stderr, "too many hits for '%s'\n", trimnl(buff));
-               choices(answer);
-               p = buff;
-               while (*p != '\n') p++;
-               *++p=0;
-       case 1:
-# ifdef D1
-       fprintf(stderr, "found one\n");
-# endif
-               if (endpush)
-                       if (nr = chkdup(answer))
-                               {
-                               if (bare<2)
-                                       putsig (0, flds, nr, firline, line);
-                               return;
-                               }
-# if D1
-               fprintf(stderr, "one[0] was %o\n",one[0]);
-# endif
-               if (one[0]==0)
-                       corout (answer, one, "deliv", dr, QLEN);
-# if D1
-               fprintf(stderr, "one now %o\n",one[0]);
-# endif
-               break;
-       }
-assert (strlen(buff)<QLEN);
-assert (strlen(one)<ANSLEN);
-nf = tabs(flds, one);
-nf += tabs(flds+nf, dbuff);
-# if D1
-fprintf(stderr, "one %.20s dbuff %.20s nf %d\n",one,dbuff, nf);
-# endif
-assert (nf < NFLD);
-refnum++;
-if (sort) putkey (nf, flds, refnum, keystr);
-if (bare<2)
-       putsig (nf, flds, refnum, firline, line);
-else
-       flout();
-# if D1
-fprintf(stderr, "put signal\n");
-# endif
-putref (nf, flds);
-# if D1
-fprintf(stderr, "put ref\n");
-# endif
-}
-newline(s)
-       char *s;
-{
-int k 0, c;
-while (c = *s++)
-       if (c == '\n')
-               k++;
-return(k);
-}
-choices( buff )
-       char *buff;
-{
-char ob[LLINE], *p, *r, *q, *t;
-int nl;
-for(r=p= buff; *p; p++)
-       {
-       if (*p == '\n')
-               {
-               *p++ = 0;
-                       {
-                       corout (r, ob, "deliv", dr, LLINE);
-                       nl = 1;
-                       for( q=ob; *q; q++)
-                               {
-                               if (nl && (q[0] == '.' || q[0] == '%') && q[1] == 'T')
-                                       {
-                                       q += 3;
-                                       for (t=q; *t && *t != '\n'; t++);
-                                       *t = 0;
-                                       fprintf(stderr, "%.70s\n", q);
-                                       q=0; break;
-                                       }
-                               nl = *q == '\n';
-                               }
-                       if (q)
-                               fprintf(stderr, "??? at %s\n",r);
-                       }
-               r=p;
-               }
-       }
-}
-
-control(c)
-       {
-       if (c=='.') return(1);
-       if (c=='%') return(1);
-       return(0);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer3.c b/.ref-Research-V7/usr/src/cmd/refer/refer3.c
deleted file mode 100644 (file)
index ca95793..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# include "refer..c"
-corout(in, out, rprog, arg, outlen)
-       char *in, *out, *rprog;
-{
-# define move(x, y) close(y); dup(x); close(x);
-int pipev[2], fr1, fr2, fw1, fw2, n;
-
-pipe (pipev); fr1= pipev[0]; fw1 = pipev[1];
-pipe (pipev); fr2= pipev[0]; fw2 = pipev[1];
-if (fork()==0)
-       {
-       close (fw1); close (fr2);
-       move (fr1, 0);
-       move (fw2, 1);
-       execl(rprog, "deliv", arg, 0);
-       err ("Can't run %s", rprog);
-       }
-close(fw2); close(fr1);
-write (fw1, in , strlen(in));
-close(fw1);
-wait(0);
-n = read (fr2, out, outlen);
-out[n]=0;
-close(fr2);
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer4.c b/.ref-Research-V7/usr/src/cmd/refer/refer4.c
deleted file mode 100644 (file)
index e76fcc9..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# include "refer..c"
-static gate 0;
-static char buff[LLINE];
-output (s)
-       char *s;
-{
-if (gate)
-       fputs(buff,ftemp);
-else
-       gate=1;
-strcpy(buff,s);
-if (strlen(buff)>LLINE)
-       err("one buff too big (%d)!", LLINE);
-}
-append(s)
-       char *s;
-{
-char *p, *r; int lch;
-trimnl(buff);
-for (p=buff; *p; p++)
-       ;
-lch = *--p;
-switch (lch)
-       {
-       case '.': case ',':
-               *p=0;
-               r="\\*(<";
-               while (*r) *p++= *r++;
-               *p++ = lch;
-               *p=0;
-       }
-strcat(buff,s);
-switch(lch)
-       {
-       case '.': case ',':
-               for(p=buff; *p; p++)
-                       ;
-               if (*--p=='\n')*p=0;
-               r = "\\*(>";
-               while (*r) *p++ = *r++;
-               *p++ = lch;
-               *p++ = '\n';
-               *p=0;
-       }
-if (strlen(buff)>LLINE)
-       err("output buff too long (%d)", LLINE);
-}
-
-flout()
-{
-if (gate)
-       fputs(buff,ftemp);
-gate=0;
-}
-
-trimnl(ln)
-       char *ln;
-{
-register char *p ln;
-while (*p) p++;
-p--;
-if (*p == '\n') *p=0;
-return(ln);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer5.c b/.ref-Research-V7/usr/src/cmd/refer/refer5.c
deleted file mode 100644 (file)
index 1add422..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-# include "refer..c"
-# define SAME 0
-# define NFLAB 2000
-# define NLABC 100
-static char sig[NLABC];
-
-static char bflab[NFLAB];
-static char *labtab[NLABC];
-static char *lbp bflab;
-static char labc[NLABC];
-static char stbuff[50];
-static int  prevsig;
-
-putsig (nf, flds, nref, nstline, endline)
-       char *flds[], *nstline, *endline;
-{
-/* choose signal style */
-char t[100], t1[100], t2[100], format[10], *sd;
-int another 0;
-int addon;
-char *stline;
-static FILE *fhide 0;
-if (labels)
-       {
-       if (nf==0) /* old */
-               sprintf(t, "%s%c", labtab[nref], labc[nref]);
-       else
-               {
-               *t=0;
-               if (keywant)
-                       sprintf(t, "%s", fpar(nf, flds, t1, keywant, 1, 0));
-               if (t[0]==0)
-                       {
-                       sprintf(format, nmlen>0 ? "%%.%ds%%s" : "%%s%%s", nmlen);
-                       /* format is %s%s for default labels or %.3s%s eg if wanted */
-                       sd = fpar(nf, flds, t2, 'D', 1, 0);
-                       if (dtlen>0)
-                               {
-                               char *sdb;
-                               for(sdb=sd; *sd; sd++);
-                               sd = sd-dtlen;
-                               if (sd<sdb) sd=sdb;
-                               }
-                       sprintf(t, format, fpar(nf, flds, t1, 'A', 1, 0), sd);
-                       }
-               if (keywant)
-                       {
-                       addon=0;
-                       for(sd=t; *sd; sd++);
-                       if (*--sd == '-')
-                               {
-                               addon=1;
-                               *sd=0;
-                               }
-                       }
-               if (!keywant || addon)
-                       addch( t, keylet(t, nref));
-               }
-       }
-else 
-       {
-       if (sort)
-               sprintf(t, "%c%d%c", FLAG, nref, FLAG);
-       else
-               sprintf(t, "%d", nref);
-       }
-another = prefix (".[", sd=lookat());
-if (another && (strcmp(".[\n", sd) != SAME))
-       fprintf(stderr, "File %s, line %d- punctuation ignored from: %s", Ifile, Iline, sd);
-strcat (sig, t);
-# if D1
-fprintf(stderr, "sig is now %s leng %d\n",sig,strlen(sig));
-# endif
-trimnl(nstline);
-trimnl(endline);
-stline=stbuff;
-if (prevsig==0)
-       {
-       strcpy (stline, nstline);
-       prevsig=1;
-       }
-if (stline[2] || endline[2])
-       {
-       stline += 2;
-       endline += 2;
-       }
-else
-       {
-       stline  = "\\*([.";
-       endline = "\\*(.]";
-       }
-if (bare==0)
-       {
-       if (another==0)
-               {
-               sprintf(t1, "%s%s\%s\n", stline, sig, endline);
-               append(t1);
-               flout();
-               sig[0]=0;
-               prevsig=0;
-               if (fo == fhide)
-                       {
-                       int ch;
-                       fclose(fhide); fhide= fopen(hidenam, "r");
-                       fo= ftemp;
-                       while ((ch = getc(fhide)) != EOF)
-                               putc(ch, fo);
-                       fclose(fhide);
-                       unlink(hidenam);
-                       }
-               }
-       else
-               {
-               strcat (sig, ",\\|");
-               /* hide if need be */
-               if (fo == ftemp)
-                       {
-                       sprintf(hidenam, "/tmp/rj%dc", getpid());
-# if D1
-fprintf(stderr, "hiding in %s\n", hidenam);
-# endif
-                       fhide= fopen(hidenam, "w");
-                       if (fhide==NULL) err("Can't get scratch file %s", hidenam);
-                       fo = fhide;
-                       }
-               }
-       }
-if (bare<2)
-       if (nf>0) fprintf(fo,".ds [F %s%c",t,sep);
-if (bare>0)
-       flout();
-# if D1
-fprintf(stderr, "sig is now %s\n",sig);
-# endif
-}
-fpar (nf, flds, out, c, seq, prepend)
-       char *flds[], *out;
-{
-char *p, *s;
-int i, fnd 0;
-for(i=0; i<nf; i++)
-       if (flds[i][1]==c && ++fnd >= seq)
-               {
-               if (c=='T' || c == 'J') /* for titles use first word otherwise last */
-                       {
-                       p=flds[i]+3;
-                       if (prefix("A ", p)) p +=2;
-                       if (prefix("An ", p)) p +=3;
-                       if (prefix("The ", p)) p+= 4;
-                       mycpy2(out, p, 20);
-                       return(out);
-                       }
-               for(s=p= flds[i]+2; *p; p++);
-               while (p>s && *p != ' ') p--;
-               /* special wart for authors */
-               if (c=='A' && (p[-1] == ',' || p[1] =='('))
-                       {
-                       p--;
-                       while (p>s && *p != ' ') p--;
-                       mycpy (out, p+1);
-                       }
-               else
-                       strcpy (out, p+1);
-               if (c=='A' && prepend)
-                       initadd(out, flds[i]+2, p);
-               return(out);
-               }
-return(0);
-}
-putkey(nf, flds, nref, keystr)
-       char *flds[], *keystr;
-{
-char t1[50], *sf;
-int ctype, i, count;
-fprintf(fo, ".\\\"");
-if (nf <= 0)
-       fprintf(fo, "%s%c%c", labtab[nref], labc[nref], sep);
-else
-       {
-       while (ctype= *keystr++)
-               {
-               count = atoi(keystr);
-               if (*keystr=='+') count=999;
-               if (count<=0) count=1;
-               for(i=1; i<=count; i++)
-                       {
-                       sf= fpar(nf, flds, t1, ctype, i, 1);
-                       if (sf==0)
-                               break;
-                       sf = artskp(sf);
-                       fprintf(fo, "%s%c", sf, '-');
-                       }
-               }
-       fprintf(fo, "%c%d%c%c", FLAG, nref, FLAG, sep);
-       }
-}
-keylet(t, nref)
-       char *t;
-{
-int i;
-int x 'a'-1;
-for(i=1; i<nref;i++)
-       {
-       if (strcmp(labtab[i], t) == 0)
-               x = labc[i];
-       }
-strcpy(labtab[nref]=lbp, t);
-while (*lbp++);
-if (lbp-bflab >NFLAB)
-       err("bflab overflow (%d)", NFLAB);
-if (nref >NLABC)
-       err ("nref in labc overflow (%d)", NLABC);
-# ifdef D1
-fprintf(stderr, "lbp up to %d of 2000\n", lbp-bflab);
-# endif
-return (labc[nref] = x+1);
-}
-mycpy(s,t)
-       char *s, *t;
-{
-while (*t && *t != ',' && *t != ' ')
-       *s++ = *t++;
-*s=0;
-}
-mycpy2 (s, t, n)
-       char *s, *t;
-{
-int c;
-while (n-- && (c= *t++)>0)
-       {
-       if (c==' ')c= '-';
-       *s++ = c;
-       }
-*s=0;
-}
-initadd(to, from, stop)
-       char *to, *from, *stop;
-{
-       int c, nalph 1;
-while (*to) to++;
-while (from<stop)
-       {
-       c = *from++;
-       if (!isalpha(c))
-               {
-               if (nalph)
-                       *to++ = '.';
-               nalph=0;
-               continue;
-               }
-       if (nalph++ ==0)
-               *to++ = c;
-       }
-*to=0;
-}
-
-static char *articles[] {"the ", "an ", "a ", 0};
-artskp(s)
-       char *s;
-{
-/* skips over initial "a ", "an ", or "the " in s */
-       char **p, *r1, *r2;
-for(p=articles; *p; p++)
-       {
-       r2 = s;
-       for (r1= *p; ((*r1 ^ *r2) & ~040 ) == 0; r1++)
-               r2++;
-       if (*r1==0 && *r2 != 0)
-               return(r2);
-       }
-return(s);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer6.c b/.ref-Research-V7/usr/src/cmd/refer/refer6.c
deleted file mode 100644 (file)
index 21bdb65..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-# include "refer..c"
-putref (n, tvec)
-       char *tvec[];
-{
-char *s, *tx;
-char buf1[LLINE], buf2[50];
-int nauth 0, i, lastype 0, cch, macro 0, la;
-int lauth =0, ltitle =0, lother =0;
-
-fprintf(fo, ".]-%c", sep);
-# define dsde (macro? "de" : "ds")
-# define ifnl (macro? sep : ' ')
-for (i=0; i<n; i++)
-       {
-       s = tvec[i];
-       if (*s==0) continue;
-       if (control(s[0]) )
-               {
-               if (lastype && macro)
-                       fprintf(fo, "..%c", sep);
-               if (control(s[1]))
-                       {
-                       cch = s[2];
-                       tx = s+3;
-                       macro=1;
-                       }
-               else
-                       {
-                       cch = s[1];
-                       tx = s+2;
-                       macro=0;
-                       }
-               }
-       else
-               {
-               cch = lastype;
-               tx=s;
-               }
-# if D1
-fprintf(stderr, "smallcaps %s cch %c\n",smallcaps, cch);
-# endif
-       if (mindex (smallcaps, cch))
-               tx = caps(tx, buf1);
-# if D1
-fprintf(stderr, " s %o tx %o %s\n",s,tx,tx);
-# endif
-       if (!control(s[0])) /* append to previous item */
-               {
-               if (lastype!=0)
-                       {
-                       if (macro)
-                               fprintf(fo, "%s%c", tx, sep);
-                       else
-                               fprintf(fo, ".as [%c \" %s%c",lastype,tx,sep);
-                       if (lastype == 'T')
-                               ltitle = (mindex(".;,?", last(tx))!=0);
-                       if (lastype == 'A')
-                               lauth = last(tx) == '.';
-                       }
-               continue;
-               }
-       if (mindex("XYZ[]", cch)) /* skip these */
-               {
-               lastype=0;
-               continue;
-               }
-       else
-       if (cch == 'A')
-               {
-               if (nauth < authrev)
-                       tx = revauth(tx, buf2);
-               if (nauth++ ==0)
-                       if (macro)
-                               fprintf(fo, ".de [%c%c%s%c",cch,sep,tx,sep);
-                       else
-                               fprintf(fo, ".ds [%c%s%c", cch,tx,sep);
-               else
-                       {
-                       la = (tvec[i+1][1]!='A');
-                       fprintf(fo, ".as [A \"");
-                       if (la == 0 || nauth != 2)
-                               fprintf(fo, ",");
-                       if (la)
-                       fprintf(fo,"%s", 
-                               mindex(smallcaps, 'A')? " \\s-2AND\\s+2" : " and");
-                       fprintf(fo, "%s%c", tx, sep);
-                       }
-               lauth = last(tx)=='.';
-               }
-       else
-               if (macro)
-                       fprintf(fo, ".de [%c%c%s%c",cch,sep, tx, sep);
-               else
-                       fprintf(fo, ".ds [%c%s%c",cch,tx, sep);
-       if (cch=='P')
-               fprintf(fo, ".nr [P %d%c", mindex(s, '-')!=0, sep);
-       lastype = cch;
-       if (cch == 'T')
-               ltitle = (mindex(".;,?", last(tx)) != 0);
-       if (cch == 'O')
-               lother = (mindex(".;,?", last(tx)) != 0);
-       }
-if (lastype && macro)
-       fprintf(fo, "..%c", sep);
-fprintf(fo, ".nr [T %d%c", ltitle, sep);
-fprintf(fo, ".nr [A %d%c", lauth, sep);
-fprintf(fo, ".nr [O %d%c", lother, sep);
-fprintf (fo, ".][ %s%c", class(n, tvec), '\n');
-}
-tabs (sv, line)
-       char *sv[], *line;
-{
-char *p;
-int n 0;
-sv[n++] = line;
-for( p= line; *p; p++)
-       {
-       if (*p == '\n')
-               {
-               *p=0;
-               sv[n++] = p+1;
-               }
-       }
-return(n-1);
-}
-class (nt, tv)
-       char *tv[];
-{
-if (hastype (nt, tv, 'J'))
-       return("1 journal-article");
-if (hastype (nt, tv, 'B'))
-       return("3 article-in-book");
-if (hastype (nt, tv, 'R'))
-       return ("4 tech-report");
-if (hastype (nt, tv, 'G'))
-       return ("4 tech-report");
-if (hastype (nt, tv, 'I'))
-       return("2 book");
-if (hastype (nt, tv,'M'))
-       return ("5 bell-tm");
-return("0 other");
-}
-hastype (nt, tv, c)
-       char *tv[];
-{
-int i;
-for(i=0; i<nt; i++)
-       if ( control(tv[i][0]) && tv[i][1]==c )
-               return(1);
-return(0);
-}
-caps(a, b)
-       char *a, *b;
-{
-char *p;
-int c, alph, this;
-p=b;
-alph = 0;
-while (c = *a++)
-       {
-       this = isalpha(c);
-       if (this && alph==1)
-               {
-               *b++ = '\\';
-               *b++ = 's';
-               *b++ = '-';
-               *b++ = '2';
-               }
-       if (!this && alph>1)
-               {
-               *b++ = '\\';
-               *b++ = 's';
-               *b++ = '+';
-               *b++ = '2';
-               }
-       if (this)
-               c &= (~040);
-       *b++ = c;
-       alph = this ? alph+1 : 0;
-       }
-if (alph>1)
-       {
-       *b++ = '\\';
-       *b++ = 's';
-       *b++ = '+';
-       *b++ = '2';
-       }
-*b=0;
-return (p);
-}
-revauth(s, b)
-       char *s, *b;
-{
-char *init, *name, *jr, *p, *bcop;
-bcop = b;
-init=name=s;
-while (*name)name++;
-jr=name;
-while (name>init && *name!= ' ')
-       name--;
-if (name[-1] == ',' || name[-1]== '(' )
-       {
-       jr = --name;
-       while (name>init && *name != ' ')
-               name--;
-       }
-p=name;
-while (p<jr)
-       *b++ = *p++;
-*b++ = ',';
-while (init<name)
-       *b++ = *init++;
-if (*jr)jr++;
-while(*jr)
-       *b++ = *jr++;
-*b++ = 0;
-return(bcop);
-}
-last(s)
-       char *s;
-{
-while (*s) s++;
-return(*--s);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer7.c b/.ref-Research-V7/usr/src/cmd/refer/refer7.c
deleted file mode 100644 (file)
index 71e0fa7..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-# include "refer..c"
-int newr[250];
-chkdup ( tag )
-       char *tag;
-{
-int i;
-for(i=1; i<=refnum; i++)
-       {
-       if (strcmp(reftable[i], tag)==0)
-               return(i);
-       }
-reftable[refnum+1] = rtp;
-if (refnum>=NRFTBL)
-       err("too many references (%d) for table", refnum);
-strcpy (rtp, tag);
-while (*rtp++);
-if (rtp > reftext + NRFTXT)
-       err("reftext too big (%d)", rtp-reftext);
-return(0);
-}
-dumpold()
-{
-FILE *fi;
-int c, g1 0, nr 1;
-if (!endpush) return;
-fclose(fo);
-fo=NULL;
-if (sort)
-       {
-       char comm[100];
-       sprintf(comm, "sort %s -o %s", tfile, tfile);
-       system(comm);
-       }
-fi = fopen(tfile, "r");
-if (fi==NULL) return;
-flout();
-fprintf(ftemp,".]<\n");
-while ( (c = getc(fi)) >0)
-       {
-       if (c=='\n')
-               {
-               nr++;
-               g1 = 0;
-               }
-       if (c==sep)
-               c = '\n';
-       if (c== FLAG)
-               {
-               /* make old-new ref number table */
-               char tb[20];
-               char *s tb;
-               while ( (c=getc(fi)) != FLAG)
-                       *s++ = c;
-               *s=0;
-               if (g1++ == 0)
-                       newr[atoi(tb)] = nr;
-# if D1
-               fprintf(stderr, "nr %d assigned to atoi(tb) %d\n",nr,atoi(tb));
-# endif
-               fprintf(ftemp,"%d", nr);
-               continue;
-               }
-       putc(c, ftemp);
-       }
-fclose(fi);
-# ifndef D1
-unlink(tfile);
-# endif
-fprintf(ftemp, ".]>\n");
-}
-
-recopy (fnam)
-       char *fnam;
-{
-int c;
-fclose(ftemp);
-
-ftemp = fopen(fnam, "r");
-if (ftemp==NULL)
-       {
-       fprintf(stderr, "Can't reopen %s\n", fnam);
-       exit(1);
-       }
-while ( (c = getc(ftemp)) != EOF)
-       {
-       if (c == FLAG)
-               {
-               char tb[10];
-               char *s tb;
-               while ( (c = getc(ftemp)) != FLAG)
-                       *s++ = c;
-               *s=0;
-               printf("%d", newr[atoi(tb)]);
-               continue;
-               }
-       putchar(c);
-       }
-fclose(ftemp);
-unlink(fnam);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/refer8.c b/.ref-Research-V7/usr/src/cmd/refer/refer8.c
deleted file mode 100644 (file)
index 59e3580..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# include "refer..c"
-static char ahead[1000];
-static int peeked 0;
-static int noteof 1;
-input (s)
-       char *s;
-{
-if (peeked)
-       {
-       peeked=0;
-       if (noteof==0) return(0);
-       strcpy (s, ahead);
-       return(s);
-       }
-return(fgets(s, 1000, in));
-}
-lookat()
-{
-if (peeked) return(ahead);
-noteof=input(ahead);
-peeked=1;
-return(noteof);
-}
-addch(s, c)
-       char *s;
-{
-while (*s) s++;
-*s++ = c;
-*s = 0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/shell.c b/.ref-Research-V7/usr/src/cmd/refer/shell.c
deleted file mode 100644 (file)
index ed18064..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-shell (n, comp, exch)
-       int (*comp)(), (*exch)();
-/* SORTS UP.  IF THERE ARE NO EXCHANGES (IEX=0) ON A SWEEP
-  THE COMPARISON GAP (IGAP) IS HALVED FOR THE NEXT SWEEP */
-{
-       int igap, iplusg, iex, i, imax;
-       igap=n;
-while (igap > 1)
-       {
-       igap /= 2;
-       imax = n-igap;
-       do
-               {
-               iex=0;
-               for(i=0; i<imax; i++)
-                       {
-                       iplusg = i + igap;
-                       if ((*comp) (i, iplusg) ) continue;
-                       (*exch) (i, iplusg);
-                       iex=1;
-                       }
-               } while (iex>0);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/test b/.ref-Research-V7/usr/src/cmd/refer/test
deleted file mode 100644 (file)
index 74a0e11..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-.LP
-hoboken harrison newark roseville avenue grove street
-.[
-Aho Ullman subsequence 1976
-.]
-east orange brick church orange highland avenue
-mountain station south orange maplewood millburn short hills
-.[
-Kernighan software tools 1975
-.]
-summit chatham madison convent station morristown
-new providence murray hill berkeley heights
-gillette stirling millington lyons basking ridge
-.[
-Kernighan typesetting guide second
-.]
-bernardsville far hills peapack gladstone
-.LP
-Each person to whom this notice is addressed is entitled to submit,
-.[
-Kernighan tools 1975
-.]
-or request the Department of Labor to submit, to the District Director
-described above, a comment on the question of whether the Plan meets the
-requirements for qualification under Part I of Subchapter D of Chapter
-I of the Internal Revenue Code of 1954.  Two or more such persons
-.[
-Blue Cubic spline CSTR
-.]
-may join in a single comment or request.  If such a person or persons
-request the Department of Labor to submit a comment and that department
-declines to do so in respect of one or more matters raised in the request,
-the person or persons so requesting may submit a comment to the
-.[
-Graham small hexagon
-.]
-.[
-Blue cubic spline CSTR
-.]
-District Director in respect of the matters on which the Department
-of Labor declines to comment.  A comment
-submitted to the District Director must be received
-by him on or before June 30, 1977.  However, if it is
-being submitted on a matter on which the Department of
-Labor was first requested, but declined to comment, the comment
-.[
-Chambers methods linear models
-.]
-must be received by the District Director on or before the later
-of June 30, 1977 or the 15th day after the day on which the
-Department of Labor notifies such person
-that it declines to comment, but in no event later than July 15, 1977.
-A request of the Department of Labor to submit a comment must be received
-by that department on or before June 10, 1977, or, if the person or persons
-making the request wish to preserve their right to submit a comment to
-the District Director in the event the Department of Labor declines to comment,
-on or before May 30, 1977.
-.[
-$LIST$
-.]
diff --git a/.ref-Research-V7/usr/src/cmd/refer/thash.c b/.ref-Research-V7/usr/src/cmd/refer/thash.c
deleted file mode 100644 (file)
index 037800c..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-# include "stdio.h"
-int nh 500;
-int saw[6000];
-char *comname "/usr/lib/eign";
-
-main (argc,argv)
-       char *argv[];
-{
-
-int i, z;
-char *name;
-
-FILE *f;
-
-while (argc>1 && argv[1][0] == '-')
-       {
-       switch(argv[1][1])
-               {
-               case 'h':
-                       nh = atoi(argv[1]+2); break;
-               }
-       argc--; argv++;
-       }
-if (argc<=1)
-       dofile(stdin, "");
-else
-for(i=1; i<argc; i++)
-       {
-       f = fopen(name=argv[i], "r");
-       if (f==NULL)
-               err("No file %s",name);
-       else
-               dofile(f, name);
-       }
-for(z=i=0; i<nh; i++)
-       {
-       if (saw[i]) z++;
-       }
-printf("hashes %d used %d\n",nh,z);
-}
-# include "stdio.h"
-
-dofile(f, name)
-       FILE *f;
-       char *name;
-{
-
-/* read file f & spit out keys & ptrs */
-# define MAXLINE 750
-char line[MAXLINE], *s;
-char key[20], *p;
-int k 0;
-int c, lim;
-int alph 0;
-int used 0;
-long lp 0;
-
-while (fgets(line, MAXLINE, f))
-       {
-       k++;
-       used=alph=0;
-       lim = strlen(line);
-       p = key;
-       for(s=line; c= *s; s++)
-               {
-               if (isalpha(c) || isdigit(c))
-                       {
-                       if (alph++ < 6)
-                               *p++ = c;
-                       }
-               else
-                       {
-                       *p = 0;
-                       if (outkey(p=key))
-                               {
-                               tkey(key,k);
-                               used=1;
-                               }
-                       alph=0;
-                       }
-               }
-       lp += lim;
-       }
-}
-
-outkey( ky)
-       char *ky;
-{
-       int n;
-n = strlen(ky);
-if (n<3) return(0);
-if (isdigit(ky[0]))
-       if (ky[0] != '1' || ky[1] != '9' || n!= 4) return(0);
-return(1);
-}
-# include "stdio.h"
-hash (s)
-       char *s;
-{
-int c, n, q;
-for(q=n=0; c= *s; s++)
-       n += (c*n + c << (n%4));
-return(n);
-}
-err (s, a)
-       char *s;
-{
-fprintf(stderr, "Error: ");
-fprintf(stderr, s, a);
-putc('\n', stderr);
-}
-prefix(t, s)
-       char *t, *s;
-{
-int c, d;
-while ( (c= *t++) == *s++)
-       if (c==0) return(1);
-return(c==0 ? 1: 0);
-}
-mindex(s, c)
-       char *s;
-{
-register char *p;
-for( p=s; *p; p++)
-       if (*p ==c)
-               return(p);
-return(0);
-}
-tkey(s,nw)
-       char *s;
-{
-int x;
-x = abs(hash(s)) % nh;
-/* if (saw[x]) printf("%d %d\n", x, nw); */
-saw[x]= nw;
-}
-abs(n)
-{
-return(n>0 ? n : -n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/types.c b/.ref-Research-V7/usr/src/cmd/refer/types.c
deleted file mode 100644 (file)
index d9348e6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# if LONG
-# define ptr long
-# define uptr long
-# define getp getl
-# define putp putl
-# define MONE -1L
-extern long getl();
-# else
-# define ptr int
-# define uptr unsigned
-# define getp getw
-# define putp putw
-# define MONE -1
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/refer/what..c b/.ref-Research-V7/usr/src/cmd/refer/what..c
deleted file mode 100644 (file)
index 0aa00a5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-# include "sys/types.h"
-# include "sys/stat.h"
-# include "assert.h"
-# define NFILES 100
-# define NAMES 2000
-extern exch(), comp();
-struct filans {
-       char *nm;
-       long fdate;
-       long size;
-       int uid;
-       };
-extern struct filans files[NFILES];
-extern char fnames[NAMES];
-# define NFEED 5
diff --git a/.ref-Research-V7/usr/src/cmd/refer/what1.c b/.ref-Research-V7/usr/src/cmd/refer/what1.c
deleted file mode 100644 (file)
index 6fbb4c1..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-# include "what..c"
-struct filans files[NFILES];
-char fnames[NAMES];
-int relfeed 0;
-char *rb[NFEED];
-char rbb[200], *rbp rbb;;
-
-main(argc,argv)
-       char *argv[];
-{
-       char *s, *t, *xargv[50], *wd[50];
-       struct filans *af;
-       int xargc 0, nw, nf, i;
-while (argc>1 && argv[1][0]=='-')
-       {
-       switch(argv[1][1])
-               {
-               case 'r': relfeed=1; break;
-               }
-       argc--; argv++;
-       }
-if (argc<=1)
-       {
-       printf("No query.\n");
-       return(0);
-       }
-nf = doclook(argc,argv,0);
-printf("   %d files\n",nf);
-if (relfeed && nf>NFEED)
-       {
-       wrdoc(NFEED, argc, argv, 1);
-       nw = freqwd (rb, wd, argc);
-       for(i=0; rb[i]; i++)
-               unlink(rb[i]);
-       }
-for(i=0; i<argc; i++)
-       xargv[xargc++]=argv[i];
-if (relfeed)
-       {
-       printf("Adding: ");
-       for(i=0; i<nw; i++)
-               if (!lfind(wd[i], xargc, xargv))
-                       printf("%s ", xargv[xargc++]=wd[i]);
-       printf("\n");
-       nf = doclook(xargc, xargv, relfeed? xargc/4 : 0);
-       printf("  %d files\n",nf);
-       }
-shell (nf, comp, exch);
-wrdoc(nf, xargc, xargv, 0);
-return(0);
-}
-exch( i1, i2 )
-{
-       struct filans *p1, *p2;
-       struct filans xt;
-       p1=files+i1;
-       p2=files+i2;
-       xt = *p1;
-       *p1 = *p2;
-       *p2 = xt;
-}
-comp(i1, i2)
-{
-       struct filans *p1, *p2;
-       p1 = files+i1;
-       p2= files+i2;
-       if (p1->fdate != p2->fdate)
-               return(p2->fdate > p1->fdate);
-       return(p2->uid >= p1->uid);
-}
-wrdoc ( np, argc, argv, relfeed )
-{
-       struct filans *af;
-       char *s, *t, buf[200];
-       int eval, k, pid;
-       FILE *rf NULL;
-       FILE *ans NULL;
-       pid=getpid();
-       for(af=files; af<files+np; af++)
-               {
-               t = ctime(&af->fdate);
-               getpw(af->uid, s=buf);
-               while (*s && *s!=':') s++;
-               *s=0;
-               printf("%s (%.20s)  %s, %ld bytes\n",af->nm,t+4,buf,af->size);
-               if (relfeed)
-                       {
-                       k=af-files;
-                       _assert (k<NFEED);
-                       sprintf(rb[k]=rbp, "rf%d.%d",pid, k);
-                       rf = fopen(rb[k], "w");
-                       while (*rbp++);
-                       }
-               describe(af->nm, argc,argv, rf);
-               if (relfeed)
-                       {
-                       printf("You like that one?");
-                       fflush(stdout);
-                       fgets(buf, 100, stdin);
-                       switch(buf[0])
-                               {
-                               case 'y': case 'Y': eval=1; break;
-                               case 'n': case 'N': eval = -1; break;
-                               default: eval=0; break;
-                               }
-                       fclose(rf);
-                       if (eval<=0)
-                               {
-                               unlink(rb[k]);
-                               rb[k][0]=0;
-                               }
-                       }
-               }
-       if (relfeed) rb[np]=0;
-}
-lfind( wl, n, wds)
-       char *wl, *wds[];
-{
-       int i;
-for(i=0; i<n; i++)
-       if (str6cmp(wl, wds[i])==0)
-               return(1);
-return(0);
-}
-str6cmp(s, t)
-       char *s, *t;
-{
-int i 0, c;
-while ( (c= *s++ ) == ( *t++))
-       if (c==0 || ++i ==6)
-               return(0);
-return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/what2.c b/.ref-Research-V7/usr/src/cmd/refer/what2.c
deleted file mode 100644 (file)
index bb020a8..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-# include "stdio.h"
-# include "ctype.h"
-
-#      define NS 5
-       struct sf {
-               char *text;
-               int olap;
-               } sents[NS];
-       struct sf *sp;
-       char stext[NS][500];
-
-describe (file, argc, argv, rf)
-       char *file, *argv[];
-       FILE *rf;
-{
-       int ns 0;
-       char linbuf[512], *line, *p;
-       int i, wrflg 0, wrote 0, ln 0;
-       FILE *fi;
-fi = fopen(file, "r");
-if (fi==NULL) return;
-for(i=1; i<argc; i++)
-       lcase(argv[i]);
-while (gsent(linbuf, 512, fi))
-       {
-       wrote=0;
-       for(line=linbuf; *line==' '; line++);
-       if (line[0]==0) continue;
-       for(p=line; *p; p++)
-               if (*p=='\t') *p= ' ';
-       if (wrflg && line[0]=='.' && isupper(line[1]))
-               wrflg=0;
-       if (wrflg)
-               {
-               output(line, ln, rf);
-               wrote=1;
-               }
-       if (prefix(".TL", line))
-               wrflg=1;
-       if (prefix(".AU", line))
-               wrflg = ln = 1;
-       if (prefix(".DA", line) || prefix(".ND", line))
-               output(line+4, 1, rf);
-       if (line[0]=='.')
-               continue;
-       if (wrote) continue;
-       ns=update(ns, line, count(line,argc,argv));
-       }
-fclose(fi);
-for(sp=sents; sp<sents+ns; sp++)
-       output(sp->text, 0, rf);
-}
-
-int state 0;
-int oldc '\n';
-gsent(buf, bsize, fi)
-       char *buf;
-       FILE *fi;
-{
-       char *s;
-       int c, leng 0;
-/* state
-       0: looking for '.' 
-       1: looking for nl or space aftter '.'
-       2: looking for nl after line with dot.
-       */
-s=buf;
-if (state==2)
-       *s++='.';
-while ( (c = getc(fi)) > 0 )
-       {
-       switch(state)
-               {
-               case 0: /* normal */
-                       if (c=='.' && oldc == '\n')
-                               {
-                               *s=0;
-                               state=2;
-                               oldc='\n';
-                               return(1);
-                               }
-                       *s++ = (c=='\n'? ' ': c);
-                       if (s>=buf+bsize)
-                               {
-                               *--s = 0;
-                               return(1);
-                               }
-                       if (c=='.' || c == '?' || c=='!')
-                               if (leng>1)
-                                       state=1;
-                       leng = (isalpha(c) ? leng+1 : 0);
-                       break;
-               case 1: /* found ., want nl or space */
-                       if (c==' ' || c == '\n')
-                               {
-                               *s=0;
-                               state=0;
-                               oldc=c;
-                               return(1);
-                               }
-                       *s++ = (c=='\n' ? ' ' : c);
-                       state=0;
-                       leng = 0;
-                       break;
-               case 2: /* found trof line, want nl */
-                       if (c == '\n')
-                               {
-                               *s=0;
-                               state=0;
-                               oldc='\n';
-                               return(1);
-                               }
-                       *s++ = c;
-                       break;
-               }
-       oldc=c;
-       }
-*s=0;
-return(0);
-}
-prefix( p, s)
-       char *p, *s;
-{
-int c;
-while ( (c= *p++) == *s++)
-       if (c==0)
-               return(1);
-return(c==0);
-}
-output (s, ln, rf)
-       char *s;
-       FILE *rf;
-{
-       char *t;
-       int more 1;
-       t=s;
-       while (more)
-               {
-               while (t<s+72 && *t)
-                       t++;
-               if (*t)
-                       {
-                       while (*t != ' ' && t>(s+25))
-                               t--;
-                       *t=0;
-                       more=1;
-                       }
-               else
-                       more=0;
-               printf("%s%s\n",ln++ ? "     " : "   ", s);
-               if (rf!=NULL)
-                       fprintf(rf, "%s\n", s);
-               s= ++t;
-               }
-}
-count(isent, nw, wds)
-       char *wds[], *isent;
-{
-int saw[50], ct;
-char sb[512], *s sb;
-int i, c;
-for(i=1; i<nw; i++)
-       saw[i]=0;
-while (c = *isent++)
-       {
-       *s++ = isupper(c) ? tolower(c) : c;
-       }
-*s=0;
-s=sb;
-while (*s++)
-       {
-       if (s[-1]!=' ') continue;
-       for(i=1; i<nw; i++)
-               {
-               if (saw[i])continue;
-               if (prefix(wds[i], s))
-                       saw[i]=1;
-               }
-       }
-ct=0;
-for(i=1; i<nw; i++)
-       if (saw[i])
-               ct++;
-return(ct);
-}
-lcase(s)
-       char *s;
-{
-       register int c;
-for(; c= *s; s++)
-       {
-       if (isupper(c))
-               *s= tolower(c);
-       }
-}
-update( ns, line, kov)
-       char *line;
-{
-/* see if sentence array should be updated */
-int lval 100; char *ob;
-struct sf *sp, *least NULL;
-if (kov<=0) return (ns) ; /* no*/
-if (ns<NS)
-       {
-       sp=sents+ns;
-       strcpy (sp->text = stext[ns], line);
-       sp->olap = kov;
-       return(ns+1);
-       }
-for(sp=sents+ns-1; sp>=sents; sp--)
-       {
-       if (sp->olap < lval)
-               {
-               least = sp;
-               lval = sp->olap;
-               }
-       }
-if (kov <= lval) return(ns);
-ob = least->text;
-while (++least < sents+NS)
-       {
-       (least-1)->text = least->text;
-       (least-1)->olap = least->olap;
-       }
-sp = sents+NS-1;
-strcpy (sp->text=ob, line);
-sp->olap = kov;
-return(NS);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/what3.c b/.ref-Research-V7/usr/src/cmd/refer/what3.c
deleted file mode 100644 (file)
index c727da9..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-# include "what..c"
-
-doclook(argc, argv, colevel)
-       char *argv[];
-{
-       int fpa[2], fpb[2], fpc[2], pid1, pid2, st;
-       int iarg;
-       char *s;
-       FILE *ansf;
-       struct filans *af;
-       struct stat statbuf;
-# define RD 0
-# define WR 1
-# define fmv(x,y) close(y); dup(x); close(x);
-/* we want to run chkbib and then lhunt and pipe in & out */
-pipe (fpa); /* from this program to chkbib */
-pipe (fpb); /* from chkbib to lhunt */
-pipe (fpc); /* from lhunt to us */
-if (  (pid1 = fork())  ==0)
-       {
-       fmv(fpa[RD], 0);
-       fmv(fpb[WR], 1);
-       close(fpa[WR]); close(fpb[RD]); close(fpc[RD]); close(fpc[WR]); 
-       execl("/usr/lib/refer/mkey", "mkey", "-s", 0);
-       _assert(0);
-       }
-if (  (pid2 = fork()) == 0)
-       {
-       char coarg[20];
-       sprintf(coarg, "-C%d", colevel);
-       fmv(fpb[RD], 0);
-       fmv(fpc[WR], 1);
-       close(fpa[RD]); close(fpa[WR]); close(fpb[WR]); close(fpc[RD]);
-       execl("/usr/lib/refer/hunt", "hunt",
-               /* "-P", */
-               coarg, "-Ty", "-Fn", "/usr/dict/lookall/All", 0);
-       _assert(0);
-       }
-_assert (pid1 != -1); _assert(pid2 != -1);
-close(fpb[RD]); close(fpb[WR]); close(fpa[RD]); close(fpc[WR]);
-ansf = fopen("/dev/null", "r");
-fmv (fpc[RD], ansf->_file);
-for(iarg=1; iarg<argc; iarg++)
-       prod(fpa[WR], argv[iarg]);
-close(fpa[WR]);
-s=fnames;
-af=files;
-while (af < files+NFILES)
-       {
-       if (fgets(af->nm=s, NAMES, ansf)==0)
-               break;
-       trimnl(s);
-       if (*s==0) continue;
-       while (*s++);
-       _assert(s<fnames+NAMES);
-       st = stat(af->nm, &statbuf);
-       if (st<0) continue;
-       af->uid = statbuf.st_uid;
-       af->fdate = statbuf.st_mtime;
-       af->size = statbuf.st_size;
-       af++;
-       }
-fclose(ansf);
-return(af-files);
-}
-prod(f,s)
-       char *s;
-{
-write (f, s, strlen(s));
-write (f, "\n", 1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/refer/what4.c b/.ref-Research-V7/usr/src/cmd/refer/what4.c
deleted file mode 100644 (file)
index e9a2bd3..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-# include "what..c"
-struct wst { char *tx; int ct; } ;
-# define NW 5
-# define ZIPF 10
-# define HASHF 3
-# define WLEN 10
-# define SAME 0
-# define TSIZE HASHF*ZIPF*NW
-int HSIZE;
-static struct wst word[TSIZE];
-static char tbuf[NW*ZIPF*WLEN], *tp tbuf;
-# define NF 10
-
-freqwd ( fn, wd, nin )
-       char *fn[], *wd[];
-{
-       FILE *fi[NF];
-       int nw 0, i, any, nf, j, wexch(), wcomp();
-       char tw[20];
-for(HSIZE=TSIZE; !prime(HSIZE); HSIZE--);
-for(nf=0; fn[nf] && nf<NF; nf++)
-       fi[nf] = fn[nf][0] ? fopen(fn[nf], "r") : NULL;
-do {
-       any=0;
-       for(i=0; i<nf; i++)
-               {
-               if (fi[i]==NULL) continue;
-               if (gw(fi[i], tw)==0)
-                       {
-                       fclose(fi[i]);
-                       fi[i]==NULL;
-                       continue;
-                       }
-               any=1;
-               if (common(tw)) continue;
-               if (strlen(tw)<3) continue;
-               j = lookup (tw);
-               if (j<0 && nw < ZIPF*NW)
-                       {
-                       j = -j;
-                       strcpy (tp, tw);
-                       word[j].tx = tp;
-                       while (*tp++);
-                       _assert (tp < tbuf+NW*ZIPF*WLEN);
-                       word[j].ct = 1;
-                       nw++;
-                       }
-               else if (j>0)
-                       word[j].ct++;
-               }
-       } while (any>0);
-shell ( TSIZE, wcomp, wexch );
-for(nw=0; word[nw].ct >0 && nw<TSIZE; nw++)
-       if (nw>=nin*2 && word[nw].ct != word[0].ct)
-               break;
-for(i=0; i<nw; i++)
-       wd[i] = word[i].tx;
-return(nw);
-}
-
-lookup (wt)
-       char *wt;
-{
-int h;
-h = hash(wt);
-for( h = h%HSIZE; word[h].tx; h = (h+1)%HSIZE)
-       {
-       if (h==0) continue;
-       if (strcmp(wt, word[h].tx) == SAME)
-               return (h);
-       }
-return ( -h );
-}
-
-hash (s)
-       char *s;
-{
-int k 0, c 0, i 0;
-while ( c = *s++ )
-       k ^= (c << (i++%5) );
-return (k>0 ? k : -k);
-}
-
-gw (f, t)
-       char *t;
-       FILE *f;
-{
-int start 1, oldc ' ', c;
-if (f==NULL) return (0);
-while ( (c=getc(f)) != EOF)
-       {
-       if (isupper(c)) c= tolower(c);
-       if (start==1)
-               if (!alphanum(c, oldc))
-                       continue;
-               else
-                       start=0;
-       if (start==0)
-               if (alphanum(c, oldc))
-                       *t++ = c;
-               else
-                       {
-                       *t=0;
-                       return(1);
-                       }
-       oldc=c;
-       }
-return(0);
-}
-
-alphanum( c, oldc )
-{
-if (isalpha(c) || isdigit(c)) return(1);
-if (isalpha(oldc))
-       if (c== '\'' || c == '-') return(1);
-return(0);
-}
-
-wcomp (n1, n2)
-{
-return (word[n1].ct >= word[n2].ct);
-}
-
-wexch (n1, n2)
-{
-struct wst tt;
-tt.tx = word[n1].tx; tt.ct = word[n1].ct;
-word[n1].tx = word[n2].tx; word[n1].ct = word[n2].ct;
-word[n2].tx = tt.tx; word[n2].ct = tt.ct;
-}
-
-prime(n)
-{
-/* only executed once- slow is ok */
-int i;
-if (n%2==0) return(0);
-for(i=3; i*i<=n; i+= 2)
-       if (n%i ==0 ) return(0);
-return(1);
-}
-trimnl(s)
-       char *s;
-{
-       while (*s)s++;
-       if (*--s=='\n') *s=0;
-}
-
-
-/* this is the test for what4.c as a standalone prog ...
-main (argc, argv)
-       char *argv[];
-{
-char *ff[10], *wd[20], **ffp ff;
-int n, i;
-while (--argc)
-       *ffp++ = *++argv;
-*ffp=0;
-n=freqwd(ff,wd);
-for(i=0; i<n; i++)
- printf("%s\n",wd[i]);
-printf("total of %d items\n",n);
-}
- /* .... */
diff --git a/.ref-Research-V7/usr/src/cmd/restor.c b/.ref-Research-V7/usr/src/cmd/restor.c
deleted file mode 100644 (file)
index 9dc1b40..0000000
+++ /dev/null
@@ -1,1147 +0,0 @@
-#define MAXINO 3000
-#define BITS   8
-#define MAXXTR 60
-#define NCACHE 3
-
-#ifndef STANDALONE
-#include <stdio.h>
-#include <signal.h>
-#endif
-#include <sys/param.h>
-#include <sys/inode.h>
-#include <sys/ino.h>
-#include <sys/fblk.h>
-#include <sys/filsys.h>
-#include <sys/dir.h>
-#include <dumprestor.h>
-
-#define        MWORD(m,i) (m[(unsigned)(i-1)/MLEN])
-#define        MBIT(i) (1<<((unsigned)(i-1)%MLEN))
-#define        BIS(i,w)        (MWORD(w,i) |=  MBIT(i))
-#define        BIC(i,w)        (MWORD(w,i) &= ~MBIT(i))
-#define        BIT(i,w)        (MWORD(w,i) & MBIT(i))
-
-struct filsys  sblock;
-
-int    fi;
-ino_t  ino, maxi, curino;
-
-int    mt;
-char   tapename[] = "/dev/rmt1";
-char   *magtape = tapename;
-#ifdef STANDALONE
-char   mbuf[50];
-#endif
-
-#ifndef STANDALONE
-daddr_t        seekpt;
-int    df, ofile;
-char   dirfile[] = "rstXXXXXX";
-
-struct {
-       ino_t   t_ino;
-       daddr_t t_seekpt;
-} inotab[MAXINO];
-int    ipos;
-
-#define ONTAPE 1
-#define XTRACTD        2
-#define XINUSE 4
-struct xtrlist {
-       ino_t   x_ino;
-       char    x_flags;
-} xtrlist[MAXXTR];
-
-char   name[12];
-
-char   drblock[BSIZE];
-int    bpt;
-#endif
-
-int    eflag;
-
-int    volno = 1;
-
-struct dinode tino, dino;
-daddr_t        taddr[NADDR];
-
-daddr_t        curbno;
-
-short  dumpmap[MSIZ];
-short  clrimap[MSIZ];
-
-
-int bct = NTREC+1;
-char tbf[NTREC*BSIZE];
-
-struct cache {
-       daddr_t c_bno;
-       int     c_time;
-       char    c_block[BSIZE];
-} cache[NCACHE];
-int    curcache;
-
-main(argc, argv)
-char *argv[];
-{
-       register char *cp;
-       char command;
-       int done();
-
-#ifndef STANDALONE
-       mktemp(dirfile);
-       if (argc < 2) {
-usage:
-               printf("Usage: restor x file file..., restor r filesys, or restor t\n");
-               exit(1);
-       }
-       argv++;
-       argc -= 2;
-       for (cp = *argv++; *cp; cp++) {
-               switch (*cp) {
-               case '-':
-                       break;
-               case 'f':
-                       magtape = *argv++;
-                       argc--;
-                       break;
-               case 'r':
-               case 'R':
-               case 't':
-               case 'x':
-                       command = *cp;
-                       break;
-               default:
-                       printf("Bad key character %c\n", *cp);
-                       goto usage;
-               }
-       }
-       if (command == 'x') {
-               if (signal(SIGINT, done) == SIG_IGN)
-                       signal(SIGINT, SIG_IGN);
-               if (signal(SIGTERM, done) == SIG_IGN)
-                       signal(SIGTERM, SIG_IGN);
-
-               df = creat(dirfile, 0666);
-               if (df < 0) {
-                       printf("restor: %s - cannot create directory temporary\n", dirfile);
-                       exit(1);
-               }
-               close(df);
-               df = open(dirfile, 2);
-       }
-       doit(command, argc, argv);
-       if (command == 'x')
-               unlink(dirfile);
-       exit(0);
-#else
-       magtape = "tape";
-       doit('r', 1, 0);
-#endif
-}
-
-doit(command, argc, argv)
-char   command;
-int    argc;
-char   *argv[];
-{
-       extern char *ctime();
-       register i, k;
-       ino_t   d;
-#ifndef STANDALONE
-       int     xtrfile(), skip();
-#endif
-       int     rstrfile(), rstrskip();
-       struct dinode *ip, *ip1;
-
-#ifndef STANDALONE
-       if ((mt = open(magtape, 0)) < 0) {
-               printf("%s: cannot open tape\n", magtape);
-               exit(1);
-       }
-#else
-       do {
-               printf("Tape? ");
-               gets(mbuf);
-               mt = open(mbuf, 0);
-       } while (mt == -1);
-       magtape = mbuf;
-#endif
-       switch(command) {
-#ifndef STANDALONE
-       case 't':
-               if (readhdr(&spcl) == 0) {
-                       printf("Tape is not a dump tape\n");
-                       exit(1);
-               }
-               printf("Dump   date: %s", ctime(&spcl.c_date));
-               printf("Dumped from: %s", ctime(&spcl.c_ddate));
-               return;
-       case 'x':
-               if (readhdr(&spcl) == 0) {
-                       printf("Tape is not a dump tape\n");
-                       exit(1);
-               }
-               if (checkvol(&spcl, 1) == 0) {
-                       printf("Tape is not volume 1 of the dump\n");
-                       exit(1);
-               }
-               pass1();  /* This sets the various maps on the way by */
-               i = 0;
-               while (i < MAXXTR-1 && argc--) {
-                       if ((d = psearch(*argv)) == 0 || BIT(d, dumpmap) == 0) {
-                               printf("%s: not on the tape\n", *argv++);
-                               continue;
-                       }
-                       xtrlist[i].x_ino = d;
-                       xtrlist[i].x_flags |= XINUSE;
-                       printf("%s: inode %u\n", *argv, d);
-                       argv++;
-                       i++;
-               }
-newvol:
-               flsht();
-               close(mt);
-getvol:
-               printf("Mount desired tape volume: Specify volume #: ");
-               if (gets(tbf) == NULL)
-                       return;
-               volno = atoi(tbf);
-               if (volno <= 0) {
-                       printf("Volume numbers are positive numerics\n");
-                       goto getvol;
-               }
-               mt = open(magtape, 0);
-               if (readhdr(&spcl) == 0) {
-                       printf("tape is not dump tape\n");
-                       goto newvol;
-               }
-               if (checkvol(&spcl, volno) == 0) {
-                       printf("Wrong volume (%d)\n", spcl.c_volume);
-                       goto newvol;
-               }
-rbits:
-               while (gethead(&spcl) == 0)
-                       ;
-               if (checktype(&spcl, TS_INODE) == 1) {
-                       printf("Can't find inode mask!\n");
-                       goto newvol;
-               }
-               if (checktype(&spcl, TS_BITS) == 0)
-                       goto rbits;
-               readbits(dumpmap);
-               i = 0;
-               for (k = 0; xtrlist[k].x_flags; k++) {
-                       if (BIT(xtrlist[k].x_ino, dumpmap)) {
-                               xtrlist[k].x_flags |= ONTAPE;
-                               i++;
-                       }
-               }
-               while (i > 0) {
-again:
-                       if (ishead(&spcl) == 0)
-                               while(gethead(&spcl) == 0)
-                                       ;
-                       if (checktype(&spcl, TS_END) == 1) {
-                               printf("end of tape\n");
-checkdone:
-                               for (k = 0; xtrlist[k].x_flags; k++)
-                                       if ((xtrlist[k].x_flags&XTRACTD) == 0)
-                                               goto newvol;
-                                       return;
-                       }
-                       if (checktype(&spcl, TS_INODE) == 0) {
-                               gethead(&spcl);
-                               goto again;
-                       }
-                       d = spcl.c_inumber;
-                       for (k = 0; xtrlist[k].x_flags; k++) {
-                               if (d == xtrlist[k].x_ino) {
-                                       printf("extract file %u\n", xtrlist[k].x_ino);
-                                       sprintf(name, "%u", xtrlist[k].x_ino);
-                                       if ((ofile = creat(name, 0666)) < 0) {
-                                               printf("%s: cannot create file\n", name);
-                                               i--;
-                                               continue;
-                                       }
-                                       chown(name, spcl.c_dinode.di_uid, spcl.c_dinode.di_gid);
-                                       getfile(ino, xtrfile, skip, spcl.c_dinode.di_size);
-                                       i--;
-                                       xtrlist[k].x_flags |= XTRACTD;
-                                       close(ofile);
-                                       goto done;
-                               }
-                       }
-                       gethead(&spcl);
-done:
-                       ;
-               }
-               goto checkdone;
-#endif
-       case 'r':
-       case 'R':
-#ifndef STANDALONE
-               if ((fi = open(*argv, 2)) < 0) {
-                       printf("%s: cannot open\n", *argv);
-                       exit(1);
-               }
-#else
-               do {
-                       char charbuf[50];
-
-                       printf("Disk? ");
-                       gets(charbuf);
-                       fi = open(charbuf, 2);
-               } while (fi == -1);
-#endif
-#ifndef STANDALONE
-               if (command == 'R') {
-                       printf("Enter starting volume number: ");
-                       if (gets(tbf) == EOF) {
-                               volno = 1;
-                               printf("\n");
-                       }
-                       else
-                               volno = atoi(tbf);
-               }
-               else
-#endif
-                       volno = 1;
-               printf("Last chance before scribbling on %s. ",
-#ifdef STANDALONE
-                                                               "disk");
-#else
-                                                               *argv);
-#endif
-               while (getchar() != '\n');
-               dread((daddr_t)1, (char *)&sblock, sizeof(sblock));
-               maxi = (sblock.s_isize-2)*INOPB;
-               if (readhdr(&spcl) == 0) {
-                       printf("Missing volume record\n");
-                       exit(1);
-               }
-               if (checkvol(&spcl, volno) == 0) {
-                       printf("Tape is not volume %d\n", volno);
-                       exit(1);
-               }
-               gethead(&spcl);
-               for (;;) {
-ragain:
-                       if (ishead(&spcl) == 0) {
-                               printf("Missing header block\n");
-                               while (gethead(&spcl) == 0)
-                                       ;
-                               eflag++;
-                       }
-                       if (checktype(&spcl, TS_END) == 1) {
-                               printf("End of tape\n");
-                               close(mt);
-                               dwrite( (daddr_t) 1, (char *) &sblock);
-                               return;
-                       }
-                       if (checktype(&spcl, TS_CLRI) == 1) {
-                               readbits(clrimap);
-                               for (ino = 1; ino <= maxi; ino++)
-                                       if (BIT(ino, clrimap) == 0) {
-                                               getdino(ino, &tino);
-                                               if (tino.di_mode == 0)
-                                                       continue;
-                                               itrunc(&tino);
-                                               clri(&tino);
-                                               putdino(ino, &tino);
-                                       }
-                               dwrite( (daddr_t) 1, (char *) &sblock);
-                               goto ragain;
-                       }
-                       if (checktype(&spcl, TS_BITS) == 1) {
-                               readbits(dumpmap);
-                               goto ragain;
-                       }
-                       if (checktype(&spcl, TS_INODE) == 0) {
-                               printf("Unknown header type\n");
-                               eflag++;
-                               gethead(&spcl);
-                               goto ragain;
-                       }
-                       ino = spcl.c_inumber;
-                       if (eflag)
-                               printf("Resynced at inode %u\n", ino);
-                       eflag = 0;
-                       if (ino > maxi) {
-                               printf("%u: ilist too small\n", ino);
-                               gethead(&spcl);
-                               goto ragain;
-                       }
-                       dino = spcl.c_dinode;
-                       getdino(ino, &tino);
-                       curbno = 0;
-                       itrunc(&tino);
-                       clri(&tino);
-                       for (i = 0; i < NADDR; i++)
-                               taddr[i] = 0;
-                       l3tol(taddr, dino.di_addr, 1);
-                       getfile(ino, rstrfile, rstrskip, dino.di_size);
-                       ip = &tino;
-                       ltol3(ip->di_addr, taddr, NADDR);
-                       ip1 = &dino;
-                       ip->di_mode = ip1->di_mode;
-                       ip->di_nlink = ip1->di_nlink;
-                       ip->di_uid = ip1->di_uid;
-                       ip->di_gid = ip1->di_gid;
-                       ip->di_size = ip1->di_size;
-                       ip->di_atime = ip1->di_atime;
-                       ip->di_mtime = ip1->di_mtime;
-                       ip->di_ctime = ip1->di_ctime;
-                       putdino(ino, &tino);
-               }
-       }
-}
-
-/*
- * Read the tape, bulding up a directory structure for extraction
- * by name
- */
-#ifndef STANDALONE
-pass1()
-{
-       register i;
-       struct dinode *ip;
-       int     putdir(), null();
-
-       while (gethead(&spcl) == 0) {
-               printf("Can't find directory header!\n");
-       }
-       for (;;) {
-               if (checktype(&spcl, TS_BITS) == 1) {
-                       readbits(dumpmap);
-                       continue;
-               }
-               if (checktype(&spcl, TS_CLRI) == 1) {
-                       readbits(clrimap);
-                       continue;
-               }
-               if (checktype(&spcl, TS_INODE) == 0) {
-finish:
-                       flsh();
-                       close(mt);
-                       return;
-               }
-               ip = &spcl.c_dinode;
-               i = ip->di_mode & IFMT;
-               if (i != IFDIR) {
-                       goto finish;
-               }
-               inotab[ipos].t_ino = spcl.c_inumber;
-               inotab[ipos++].t_seekpt = seekpt;
-               getfile(spcl.c_inumber, putdir, null, spcl.c_dinode.di_size);
-               putent("\000\000/");
-       }
-}
-#endif
-
-/*
- * Do the file extraction, calling the supplied functions
- * with the blocks
- */
-getfile(n, f1, f2, size)
-ino_t  n;
-int    (*f2)(), (*f1)();
-long   size;
-{
-       register i;
-       struct spcl addrblock;
-       char buf[BSIZE];
-
-       addrblock = spcl;
-       curino = n;
-       goto start;
-       for (;;) {
-               if (gethead(&addrblock) == 0) {
-                       printf("Missing address (header) block\n");
-                       goto eloop;
-               }
-               if (checktype(&addrblock, TS_ADDR) == 0) {
-                       spcl = addrblock;
-                       curino = 0;
-                       return;
-               }
-start:
-               for (i = 0; i < addrblock.c_count; i++) {
-                       if (addrblock.c_addr[i]) {
-                               readtape(buf);
-                               (*f1)(buf, size > BSIZE ? (long) BSIZE : size);
-                       }
-                       else {
-                               clearbuf(buf);
-                               (*f2)(buf, size > BSIZE ? (long) BSIZE : size);
-                       }
-                       if ((size -= BSIZE) <= 0) {
-eloop:
-                               while (gethead(&spcl) == 0)
-                                       ;
-                               if (checktype(&spcl, TS_ADDR) == 1)
-                                       goto eloop;
-                               curino = 0;
-                               return;
-                       }
-               }
-       }
-}
-
-/*
- * Do the tape i\/o, dealling with volume changes
- * etc..
- */
-readtape(b)
-char *b;
-{
-       register i;
-       struct spcl tmpbuf;
-
-       if (bct >= NTREC) {
-               for (i = 0; i < NTREC; i++)
-                       ((struct spcl *)&tbf[i*BSIZE])->c_magic = 0;
-               bct = 0;
-               if ((i = read(mt, tbf, NTREC*BSIZE)) < 0) {
-                       printf("Tape read error: inode %u\n", curino);
-                       eflag++;
-                       for (i = 0; i < NTREC; i++)
-                               clearbuf(&tbf[i*BSIZE]);
-               }
-               if (i == 0) {
-                       bct = NTREC + 1;
-                       volno++;
-loop:
-                       flsht();
-                       close(mt);
-                       printf("Mount volume %d\n", volno);
-                       while (getchar() != '\n')
-                               ;
-                       if ((mt = open(magtape, 0)) == -1) {
-                               printf("Cannot open tape!\n");
-                               goto loop;
-                       }
-                       if (readhdr(&tmpbuf) == 0) {
-                               printf("Not a dump tape.Try again\n");
-                               goto loop;
-                       }
-                       if (checkvol(&tmpbuf, volno) == 0) {
-                               printf("Wrong tape. Try again\n");
-                               goto loop;
-                       }
-                       readtape(b);
-                       return;
-               }
-       }
-       copy(&tbf[(bct++*BSIZE)], b, BSIZE);
-}
-
-flsht()
-{
-       bct = NTREC+1;
-}
-
-copy(f, t, s)
-register char *f, *t;
-{
-       register i;
-
-       i = s;
-       do
-               *t++ = *f++;
-       while (--i);
-}
-
-clearbuf(cp)
-register char *cp;
-{
-       register i;
-
-       i = BSIZE;
-       do
-               *cp++ = 0;
-       while (--i);
-}
-
-/*
- * Put and get the directory entries from the compressed
- * directory file
- */
-#ifndef STANDALONE
-putent(cp)
-char   *cp;
-{
-       register i;
-
-       for (i = 0; i < sizeof(ino_t); i++)
-               writec(*cp++);
-       for (i = 0; i < DIRSIZ; i++) {
-               writec(*cp);
-               if (*cp++ == 0)
-                       return;
-       }
-       return;
-}
-
-getent(bf)
-register char *bf;
-{
-       register i;
-
-       for (i = 0; i < sizeof(ino_t); i++)
-               *bf++ = readc();
-       for (i = 0; i < DIRSIZ; i++)
-               if ((*bf++ = readc()) == 0)
-                       return;
-       return;
-}
-
-/*
- * read/write te directory file
- */
-writec(c)
-char c;
-{
-       drblock[bpt++] = c;
-       seekpt++;
-       if (bpt >= BSIZE) {
-               bpt = 0;
-               write(df, drblock, BSIZE);
-       }
-}
-
-readc()
-{
-       if (bpt >= BSIZE) {
-               read(df, drblock, BSIZE);
-               bpt = 0;
-       }
-       return(drblock[bpt++]);
-}
-
-mseek(pt)
-daddr_t pt;
-{
-       bpt = BSIZE;
-       lseek(df, pt, 0);
-}
-
-flsh()
-{
-       write(df, drblock, bpt+1);
-}
-
-/*
- * search the directory inode ino
- * looking for entry cp
- */
-ino_t
-search(inum, cp)
-ino_t  inum;
-char   *cp;
-{
-       register i;
-       struct direct dir;
-
-       for (i = 0; i < MAXINO; i++)
-               if (inotab[i].t_ino == inum) {
-                       goto found;
-               }
-       return(0);
-found:
-       mseek(inotab[i].t_seekpt);
-       do {
-               getent((char *)&dir);
-               if (direq(dir.d_name, "/"))
-                       return(0);
-       } while (direq(dir.d_name, cp) == 0);
-       return(dir.d_ino);
-}
-
-/*
- * Search the directory tree rooted at inode 2
- * for the path pointed at by n
- */
-psearch(n)
-char   *n;
-{
-       register char *cp, *cp1;
-       char c;
-
-       ino = 2;
-       if (*(cp = n) == '/')
-               cp++;
-next:
-       cp1 = cp + 1;
-       while (*cp1 != '/' && *cp1)
-               cp1++;
-       c = *cp1;
-       *cp1 = 0;
-       ino = search(ino, cp);
-       if (ino == 0) {
-               *cp1 = c;
-               return(0);
-       }
-       *cp1 = c;
-       if (c == '/') {
-               cp = cp1+1;
-               goto next;
-       }
-       return(ino);
-}
-
-direq(s1, s2)
-register char *s1, *s2;
-{
-       register i;
-
-       for (i = 0; i < DIRSIZ; i++)
-               if (*s1++ == *s2) {
-                       if (*s2++ == 0)
-                               return(1);
-               } else
-                       return(0);
-       return(1);
-}
-#endif
-
-/*
- * read/write a disk block, be sure to update the buffer
- * cache if needed.
- */
-dwrite(bno, b)
-daddr_t        bno;
-char   *b;
-{
-       register i;
-
-       for (i = 0; i < NCACHE; i++) {
-               if (cache[i].c_bno == bno) {
-                       copy(b, cache[i].c_block, BSIZE);
-                       cache[i].c_time = 0;
-                       break;
-               }
-               else
-                       cache[i].c_time++;
-       }
-       lseek(fi, bno*BSIZE, 0);
-       if(write(fi, b, BSIZE) != BSIZE) {
-#ifdef STANDALONE
-               printf("disk write error %D\n", bno);
-#else
-               fprintf(stderr, "disk write error %ld\n", bno);
-#endif
-               exit(1);
-       }
-}
-
-dread(bno, buf, cnt)
-daddr_t bno;
-char *buf;
-{
-       register i, j;
-
-       j = 0;
-       for (i = 0; i < NCACHE; i++) {
-               if (++curcache >= NCACHE)
-                       curcache = 0;
-               if (cache[curcache].c_bno == bno) {
-                       copy(cache[curcache].c_block, buf, cnt);
-                       cache[curcache].c_time = 0;
-                       return;
-               }
-               else {
-                       cache[curcache].c_time++;
-                       if (cache[j].c_time < cache[curcache].c_time)
-                               j = curcache;
-               }
-       }
-
-       lseek(fi, bno*BSIZE, 0);
-       if (read(fi, cache[j].c_block, BSIZE) != BSIZE) {
-#ifdef STANDALONE
-               printf("read error %D\n", bno);
-#else
-               printf("read error %ld\n", bno);
-#endif
-               exit(1);
-       }
-       copy(cache[j].c_block, buf, cnt);
-       cache[j].c_time = 0;
-       cache[j].c_bno = bno;
-}
-
-/*
- * the inode manpulation routines. Like the system.
- *
- * clri zeros the inode
- */
-clri(ip)
-struct dinode *ip;
-{
-       int i, *p;
-       i = sizeof(struct dinode)/sizeof(int);
-       p = (int *)ip;
-       do
-               *p++ = 0;
-       while(--i);
-}
-
-/*
- * itrunc/tloop/bfree free all of the blocks pointed at by the inode
- */
-itrunc(ip)
-register struct dinode *ip;
-{
-       register i;
-       daddr_t bn, iaddr[NADDR];
-
-       if (ip->di_mode == 0)
-               return;
-       i = ip->di_mode & IFMT;
-       if (i != IFDIR && i != IFREG)
-               return;
-       l3tol(iaddr, ip->di_addr, NADDR);
-       for(i=NADDR-1;i>=0;i--) {
-               bn = iaddr[i];
-               if(bn == 0) continue;
-               switch(i) {
-
-               default:
-                       bfree(bn);
-                       break;
-
-               case NADDR-3:
-                       tloop(bn, 0, 0);
-                       break;
-
-               case NADDR-2:
-                       tloop(bn, 1, 0);
-                       break;
-
-               case NADDR-1:
-                       tloop(bn, 1, 1);
-               }
-       }
-       ip->di_size = 0;
-}
-
-tloop(bn, f1, f2)
-daddr_t        bn;
-int    f1, f2;
-{
-       register i;
-       daddr_t nb;
-       union {
-               char    data[BSIZE];
-               daddr_t indir[NINDIR];
-       } ibuf;
-
-       dread(bn, ibuf.data, BSIZE);
-       for(i=NINDIR-1;i>=0;i--) {
-               nb = ibuf.indir[i];
-               if(nb) {
-                       if(f1)
-                               tloop(nb, f2, 0);
-                       else
-                               bfree(nb);
-               }
-       }
-       bfree(bn);
-}
-
-bfree(bn)
-daddr_t        bn;
-{
-       register i;
-       union {
-               char    data[BSIZE];
-               struct  fblk frees;
-       } fbuf;
-
-       if(sblock.s_nfree >= NICFREE) {
-               fbuf.df_nfree = sblock.s_nfree;
-               for(i=0;i<NICFREE;i++)
-                       fbuf.df_free[i] = sblock.s_free[i];
-               sblock.s_nfree = 0;
-               dwrite(bn, fbuf.data);
-       }
-       sblock.s_free[sblock.s_nfree++] = bn;
-}
-
-/*
- * allocate a block off the free list.
- */
-daddr_t
-balloc()
-{
-       daddr_t bno;
-       register i;
-       static char zeroes[BSIZE];
-       union {
-               char    data[BSIZE];
-               struct  fblk frees;
-       } fbuf;
-
-       if(sblock.s_nfree == 0 || (bno=sblock.s_free[--sblock.s_nfree]) == 0) {
-#ifdef STANDALONE
-               printf("Out of space\n");
-#else
-               fprintf(stderr, "Out of space.\n");
-#endif
-               exit(1);
-       }
-       if(sblock.s_nfree == 0) {
-               dread(bno, fbuf.data, BSIZE);
-               sblock.s_nfree = fbuf.df_nfree;
-               for(i=0;i<NICFREE;i++)
-                       sblock.s_free[i] = fbuf.df_free[i];
-       }
-       dwrite(bno, zeroes);
-       return(bno);
-}
-
-/*
- * map a block number into a block address, ensuring
- * all of the correct indirect blocks are around. Allocate
- * the block requested.
- */
-daddr_t
-bmap(iaddr, bn)
-daddr_t        iaddr[NADDR];
-daddr_t        bn;
-{
-       register i;
-       int j, sh;
-       daddr_t nb, nnb;
-       daddr_t indir[NINDIR];
-
-       /*
-        * blocks 0..NADDR-4 are direct blocks
-        */
-       if(bn < NADDR-3) {
-               iaddr[bn] = nb = balloc();
-               return(nb);
-       }
-
-       /*
-        * addresses NADDR-3, NADDR-2, and NADDR-1
-        * have single, double, triple indirect blocks.
-        * the first step is to determine
-        * how many levels of indirection.
-        */
-       sh = 0;
-       nb = 1;
-       bn -= NADDR-3;
-       for(j=3; j>0; j--) {
-               sh += NSHIFT;
-               nb <<= NSHIFT;
-               if(bn < nb)
-                       break;
-               bn -= nb;
-       }
-       if(j == 0) {
-               return((daddr_t)0);
-       }
-
-       /*
-        * fetch the address from the inode
-        */
-       if((nb = iaddr[NADDR-j]) == 0) {
-               iaddr[NADDR-j] = nb = balloc();
-       }
-
-       /*
-        * fetch through the indirect blocks
-        */
-       for(; j<=3; j++) {
-               dread(nb, (char *)indir, BSIZE);
-               sh -= NSHIFT;
-               i = (bn>>sh) & NMASK;
-               nnb = indir[i];
-               if(nnb == 0) {
-                       nnb = balloc();
-                       indir[i] = nnb;
-                       dwrite(nb, (char *)indir);
-               }
-               nb = nnb;
-       }
-       return(nb);
-}
-
-/*
- * read the tape into buf, then return whether or
- * or not it is a header block.
- */
-gethead(buf)
-struct spcl *buf;
-{
-       readtape((char *)buf);
-       if (buf->c_magic != MAGIC || checksum((int *) buf) == 0)
-               return(0);
-       return(1);
-}
-
-/*
- * return whether or not the buffer contains a header block
- */
-ishead(buf)
-struct spcl *buf;
-{
-       if (buf->c_magic != MAGIC || checksum((int *) buf) == 0)
-               return(0);
-       return(1);
-}
-
-checktype(b, t)
-struct spcl *b;
-int    t;
-{
-       return(b->c_type == t);
-}
-
-
-checksum(b)
-int *b;
-{
-       register i, j;
-
-       j = BSIZE/sizeof(int);
-       i = 0;
-       do
-               i += *b++;
-       while (--j);
-       if (i != CHECKSUM) {
-               printf("Checksum error %o\n", i);
-               return(0);
-       }
-       return(1);
-}
-
-checkvol(b, t)
-struct spcl *b;
-int t;
-{
-       if (b->c_volume == t)
-               return(1);
-       return(0);
-}
-
-readhdr(b)
-struct spcl *b;
-{
-       if (gethead(b) == 0)
-               return(0);
-       if (checktype(b, TS_TAPE) == 0)
-               return(0);
-       return(1);
-}
-
-/*
- * The next routines are called during file extraction to
- * put the data into the right form and place.
- */
-#ifndef STANDALONE
-xtrfile(b, size)
-char   *b;
-long   size;
-{
-       write(ofile, b, (int) size);
-}
-
-null() {;}
-
-skip()
-{
-       lseek(ofile, (long) BSIZE, 1);
-}
-#endif
-
-
-rstrfile(b, s)
-char *b;
-long s;
-{
-       daddr_t d;
-
-       d = bmap(taddr, curbno);
-       dwrite(d, b);
-       curbno += 1;
-}
-
-rstrskip(b, s)
-char *b;
-long s;
-{
-       curbno += 1;
-}
-
-#ifndef STANDALONE
-putdir(b)
-char *b;
-{
-       register struct direct *dp;
-       register i;
-
-       for (dp = (struct direct *) b, i = 0; i < BSIZE; dp++, i += sizeof(*dp)) {
-               if (dp->d_ino == 0)
-                       continue;
-               putent((char *) dp);
-       }
-}
-#endif
-
-/*
- * read/write an inode from the disk
- */
-getdino(inum, b)
-ino_t  inum;
-struct dinode *b;
-{
-       daddr_t bno;
-       char buf[BSIZE];
-
-       bno = (ino - 1)/INOPB;
-       bno += 2;
-       dread(bno, buf, BSIZE);
-       copy(&buf[((inum-1)%INOPB)*sizeof(struct dinode)], (char *) b, sizeof(struct dinode));
-}
-
-putdino(inum, b)
-ino_t  inum;
-struct dinode *b;
-{
-       daddr_t bno;
-       char buf[BSIZE];
-
-       bno = ((ino - 1)/INOPB) + 2;
-       dread(bno, buf, BSIZE);
-       copy((char *) b, &buf[((inum-1)%INOPB)*sizeof(struct dinode)], sizeof(struct dinode));
-       dwrite(bno, buf);
-}
-
-/*
- * read a bit mask from the tape into m.
- */
-readbits(m)
-short  *m;
-{
-       register i;
-
-       i = spcl.c_count;
-
-       while (i--) {
-               readtape((char *) m);
-               m += (BSIZE/(MLEN/BITS));
-       }
-       while (gethead(&spcl) == 0)
-               ;
-}
-
-done()
-{
-#ifndef STANDALONE
-       unlink(dirfile);
-#endif
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/rev.c b/.ref-Research-V7/usr/src/cmd/rev.c
deleted file mode 100644 (file)
index 9ced2bf..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-
-/* reverse lines of a file */
-
-#define N 256
-char line[N];
-FILE *input;
-
-main(argc,argv)
-char **argv;
-{
-       register i,c;
-       input = stdin;
-       do {
-               if(argc>1) {
-                       if((input=fopen(argv[1],"r"))==NULL) {
-                               fprintf(stderr,"rev: cannot open %s\n",
-                                       argv[1]);
-                               exit(1);
-                       }
-               }
-               for(;;){
-                       for(i=0;i<N;i++) {
-                               line[i] = c = getc(input);
-                               switch(c) {
-                               case EOF:
-                                       goto eof;
-                               default:
-                                       continue;
-                               case '\n':
-                                       break;
-                               }
-                               break;
-                       }
-                       while(--i>=0)
-                               putc(line[i],stdout);
-                       putc('\n',stdout);
-               }
-eof:
-               fclose(input);
-               argc--;
-               argv++;
-       } while(argc>1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/rm.c b/.ref-Research-V7/usr/src/cmd/rm.c
deleted file mode 100644 (file)
index fcab28c..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-int    errcode;
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-
-char   *sprintf();
-
-main(argc, argv)
-char *argv[];
-{
-       register char *arg;
-       int fflg, iflg, rflg;
-
-       fflg = 0;
-       if (isatty(0) == 0)
-               fflg++;
-       iflg = 0;
-       rflg = 0;
-       if(argc>1 && argv[1][0]=='-') {
-               arg = *++argv;
-               argc--;
-               while(*++arg != '\0')
-                       switch(*arg) {
-                       case 'f':
-                               fflg++;
-                               break;
-                       case 'i':
-                               iflg++;
-                               break;
-                       case 'r':
-                               rflg++;
-                               break;
-                       default:
-                               printf("rm: unknown option %s\n", *argv);
-                               exit(1);
-                       }
-       }
-       while(--argc > 0) {
-               if(!strcmp(*++argv, "..")) {
-                       fprintf(stderr, "rm: cannot remove `..'\n");
-                       continue;
-               }
-               rm(*argv, fflg, rflg, iflg, 0);
-       }
-
-       exit(errcode);
-}
-
-rm(arg, fflg, rflg, iflg, level)
-char arg[];
-{
-       struct stat buf;
-       struct direct direct;
-       char name[100];
-       int d;
-
-       if(stat(arg, &buf)) {
-               if (fflg==0) {
-                       printf("rm: %s nonexistent\n", arg);
-                       ++errcode;
-               }
-               return;
-       }
-       if ((buf.st_mode&S_IFMT) == S_IFDIR) {
-               if(rflg) {
-                       if (access(arg, 02) < 0) {
-                               if (fflg==0)
-                                       printf("%s not changed\n", arg);
-                               errcode++;
-                               return;
-                       }
-                       if(iflg && level!=0) {
-                               printf("directory %s: ", arg);
-                               if(!yes())
-                                       return;
-                       }
-                       if((d=open(arg, 0)) < 0) {
-                               printf("rm: %s: cannot read\n", arg);
-                               exit(1);
-                       }
-                       while(read(d, (char *)&direct, sizeof(direct)) == sizeof(direct)) {
-                               if(direct.d_ino != 0 && !dotname(direct.d_name)) {
-                                       sprintf(name, "%s/%.14s", arg, direct.d_name);
-                                       rm(name, fflg, rflg, iflg, level+1);
-                               }
-                       }
-                       close(d);
-                       errcode += rmdir(arg, iflg);
-                       return;
-               }
-               printf("rm: %s directory\n", arg);
-               ++errcode;
-               return;
-       }
-
-       if(iflg) {
-               printf("%s: ", arg);
-               if(!yes())
-                       return;
-       }
-       else if(!fflg) {
-               if (access(arg, 02)<0) {
-                       printf("rm: %s %o mode ", arg, buf.st_mode&0777);
-                       if(!yes())
-                               return;
-               }
-       }
-       if(unlink(arg) && (fflg==0 || iflg)) {
-               printf("rm: %s not removed\n", arg);
-               ++errcode;
-       }
-}
-
-dotname(s)
-char *s;
-{
-       if(s[0] == '.')
-               if(s[1] == '.')
-                       if(s[2] == '\0')
-                               return(1);
-                       else
-                               return(0);
-               else if(s[1] == '\0')
-                       return(1);
-       return(0);
-}
-
-rmdir(f, iflg)
-char *f;
-{
-       int status, i;
-
-       if(dotname(f))
-               return(0);
-       if(iflg) {
-               printf("%s: ", f);
-               if(!yes())
-                       return(0);
-       }
-       while((i=fork()) == -1)
-               sleep(3);
-       if(i) {
-               wait(&status);
-               return(status);
-       }
-       execl("/bin/rmdir", "rmdir", f, 0);
-       execl("/usr/bin/rmdir", "rmdir", f, 0);
-       printf("rm: can't find rmdir\n");
-       exit(1);
-}
-
-yes()
-{
-       int i, b;
-
-       i = b = getchar();
-       while(b != '\n' && b != EOF)
-               b = getchar();
-       return(i == 'y');
-}
diff --git a/.ref-Research-V7/usr/src/cmd/rmdir.c b/.ref-Research-V7/usr/src/cmd/rmdir.c
deleted file mode 100644 (file)
index 5b896c4..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Remove directory
- */
-
-#include <sys/types.h>
-#include <sys/dir.h>
-#include <sys/stat.h>
-#include <stdio.h>
-
-int    Errors = 0;
-char   *rindex();
-char   *strcat();
-char   *strcpy();
-
-main(argc,argv)
-int argc;
-char **argv;
-{
-
-       if(argc < 2) {
-               fprintf(stderr, "rmdir: arg count\n");
-               exit(1);
-       }
-       while(--argc)
-               rmdir(*++argv);
-       exit(Errors!=0);
-}
-
-rmdir(d)
-char *d;
-{
-       int     fd;
-       char    *np, name[500];
-       struct  stat    st, cst;
-       struct  direct  dir;
-
-       strcpy(name, d);
-       if((np = rindex(name, '/')) == NULL)
-               np = name;
-       if(stat(name,&st) < 0) {
-               fprintf(stderr, "rmdir: %s non-existent\n", name);
-               ++Errors;
-               return;
-       }
-       if (stat("", &cst) < 0) {
-               fprintf(stderr, "rmdir: cannot stat \"\"");
-               ++Errors;
-               exit(1);
-       }
-       if((st.st_mode & S_IFMT) != S_IFDIR) {
-               fprintf(stderr, "rmdir: %s not a directory\n", name);
-               ++Errors;
-               return;
-       }
-       if(st.st_ino==cst.st_ino &&st.st_dev==cst.st_dev) {
-               fprintf(stderr, "rmdir: cannot remove current directory\n");
-               ++Errors;
-               return;
-       }
-       if((fd = open(name,0)) < 0) {
-               fprintf(stderr, "rmdir: %s unreadable\n", name);
-               ++Errors;
-               return;
-       }
-       while(read(fd, (char *)&dir, sizeof dir) == sizeof dir) {
-               if(dir.d_ino == 0) continue;
-               if(!strcmp(dir.d_name, ".") || !strcmp(dir.d_name, ".."))
-                       continue;
-               fprintf(stderr, "rmdir: %s not empty\n", name);
-               ++Errors;
-               close(fd);
-               return;
-       }
-       close(fd);
-       if(!strcmp(np, ".") || !strcmp(np, "..")) {
-               fprintf(stderr, "rmdir: cannot remove . or ..\n");
-               ++Errors;
-               return;
-       }
-       strcat(name, "/.");
-       if((access(name, 0)) < 0) {             /* name/. non-existent */
-               strcat(name, ".");
-               goto unl;
-       }
-       strcat(name, ".");
-       if((access(name, 0)) < 0)               /* name/.. non-existent */
-               goto unl2;
-       if(access(name, 02)) {
-               name[strlen(name)-3] = '\0';
-               fprintf(stderr, "rmdir: %s: no permission\n", name);
-               ++Errors;
-               return;
-       }
-unl:
-       unlink(name);   /* unlink name/.. */
-unl2:
-       name[strlen(name)-1] = '\0';
-       unlink(name);   /* unlink name/.  */
-       name[strlen(name)-2] = '\0';
-       if (unlink(name) < 0) {
-               fprintf(stderr, "rmdir: %s not removed\n", name);
-               ++Errors;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/roff/makefile b/.ref-Research-V7/usr/src/cmd/roff/makefile
deleted file mode 100644 (file)
index 2541bf4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-all:   roff
-
-cp:    roff
-       cp roff /bin
-       rm roff roff.o
-
-cmp:   roff
-       cmp roff /bin/roff
-       rm roff roff.o
-
-roff:  *.s
-       as -o roff.o /usr/include/sys.s *.s
-       ld -s roff.o -lc -o roff
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff1.s b/.ref-Research-V7/usr/src/cmd/roff/roff1.s
deleted file mode 100644 (file)
index 05e12af..0000000
+++ /dev/null
@@ -1,570 +0,0 @@
-/
-/
-
-/ roff1 -- text formatter
-
-       .globl _ttyname
-       nop = 000240
-       signal = 48.
-
-ibuf: /init code in ibuf+obuf
-       cmp     sp,$end
-       bhi     1f
-       jsr     r5,string; emes1
-       sys     exit
-1:
-       clr     r0
-       jsr     pc,mesg
-       sys     signal; 1; place
-       sys     signal; 2; place
-       jsr     pc,makebf
-       sys     open; suffil; 0
-       bes     1f
-       mov     r0,suff
-       sys     lseek; 0;20; 0  /actually lseek
-       bes     1f
-       mov     suff,r0
-       sys     read; suftab; 2*26.
-1:
-       clr     r0
-       mov     (sp)+,argc
-       dec     argc
-       bne     1f
-       jmp     place
-1:
-       tst     (sp)+
-       mov     (sp),r4
-       cmpb    (r4)+,$'+
-       bne     2f
-       jsr     r5,pnum; pfrom
-       br      3f
-2:
-       cmpb    -1(r4),$'-
-       bne     2f
-       cmpb    (r4),$'s
-       bne     0f
-       inc     stop
-       br      3f
-0:
-       cmpb    (r4),$'h
-       bne     0f
-       clr     slow
-       br      3f
-0:
-       jsr     r5,pnum; pto
-3:
-       dec     argc
-       bgt     1b
-2:
-       mov     $nop,get1a
-       mov     $ibuf,ibufp
-       mov     $ibuf,eibuf
-       mov     sp,argp
-       jsr     pc,topbot
-       clr     r0
-1:
-       movb    r0,trtab(r0)
-       inc     r0
-       cmp     r0,$128.
-       bne     1b
-       jsr     pc,rbreak
-       jsr     pc,istop
-       jmp     loop
-makebf:
-       sys     stat; bfn; stbuf
-       bec     2f
-       sys     creat; bfn; 400
-       bec     1f
-2:
-       incb    bfn+8
-       cmpb    bfn+8,$'z
-       blos    makebf
-       jmp     place
-1:
-       mov     r0,ibf
-       sys     write; sufbuf;128.
-       sys     open; bfn;0
-       mov     r0,ibf1
-       rts     pc
-
-string:
-       mov     (r5)+,r1
-       mov     r1,r2
-       mov     r1,0f
-1:
-       tstb    (r1)+
-       bne     1b
-       sub     r2,r1
-       mov     r1,1f
-       mov     $1,r0
-       sys     write; 0:..; 1:..
-       rts     r5
-
-emes1: <Too many files.\n\0>
-xxx:
-.even
-obuf=ibuf+512.
-.=ibuf+1024.
-loop:
-       clr     nlflg
-       jsr     pc,getchar
-       cmpb    r0,cc
-       beq     2f
-       movb    r0,ch
-       jsr     pc,text
-       br      loop
-2:
-       jsr     pc,control
-       jsr     pc,flushi
-       br      loop
-
-mesg:
-       tst     r0
-       bne     setsame
-       clr     -(sp)
-       jsr     pc,_ttyname
-       tst     (sp)+
-       mov     r0,9f
-       mov     r0,8f
-       mov     r0,7f
-       sys     stat; 9:..; stbuf
-       mov     stbuf+4,0f
-       mov     0f,1f
-       bic     $22,0f
-       sys     chmod; 8:..; 0:..
-       rts     pc
-setsame:
-       sys     chmod; 7:..; 1:..
-       rts     pc
-
-pnum:
-       mov     r4,ibufp
-       mov     $37777,eibuf
-       jsr     r5,number1; 0
-       mov     r0,*(r5)+
-       clr     ch
-       rts     r5
-
-flushi:
-       clr     ch
-       tst     nlflg
-       bne     1f
-       jsr     pc,getchar
-       br      flushi
-1:
-       rts     pc
-
-gettchar:
-       tst     ul
-       ble     getchar
-       tst     ulstate
-       beq     3f
-       tst     bsc
-       bgt     1f
-       tst     ulc
-       bgt     2f
-       clr     ulstate
-       br      3f
-1:
-       dec     bsc
-       mov     $010,r0
-       rts     pc
-2:
-       dec     ulc
-       mov     $'_,r0
-       rts     pc
-3:
-       jsr     pc,getchar
-       cmp     r0,$'0
-       blt     1f
-       cmp     r0,$'9
-       ble     2f
-       cmp     r0,$'A
-       blt     1f
-       cmp     r0,$'Z
-       ble     2f
-       cmp     r0,$'a
-       blt     1f
-       cmp     r0,$'z
-       ble     2f
-1:
-       tst     ulc
-       bgt     3f
-       rts     pc
-3:
-       mov     $1,ulstate
-       mov     r0,ch
-       br      gettchar
-2:
-       inc     bsc
-       inc     ulc
-       rts     pc
-
-getchar:
-       mov     ch,r0
-       beq     1f
-       clr     ch
-       rts     pc
-1:
-       tst     nlflg
-       beq     1f
-       mov     $'\n,r0
-       rts     pc
-1:
-       jsr     pc,get1
-       cmp     r0,$'\\
-       bne     2f
-       jsr     pc,get1
-       jsr     r5,switch; esctab
-       br      3f
-2:
-       cmp     r0,$033  /prefix
-       bne     3f
-       jsr     pc,get1
-       jsr     r5,switch; pfxtab
-3:
-       cmp     r0,$'\n
-       bne     3f
-       inc     nlflg
-       clr     column
-3:
-       mov     r1,-(sp)
-       jsr     pc,width
-       add     r1,column
-       mov     (sp)+,r1
-       rts     pc
-
-esctab:
-   .byte 'd, 032  /hlf (down)
-   .byte 'u, 035  /hlr (up)
-   .byte 'r, 036  /flr (reverse)
-   .byte 'x, 016  /SO (extra chars)
-   .byte 'y, 017  /SI (normal characters)
-   .byte 'l, 0177 /delete
-   .byte 't, 011  /hor tab
-   .byte 'a, 0100 /at sign
-   .byte 'n, 043  /number sign
-   .byte '\\, 134 /backslash
-   .byte 0, 0
-
-pfxtab:
-   .byte '7, 036  /flr
-   .byte '8, 035  /hlr
-   .byte '9, 032  /hlf
-   .byte '4, 030  /brs
-   .byte '3, 031  /rrs
-   .byte '1, 026  /set hor tabs
-   .byte '2, 027  /clr hor tabs
-   .byte 0,0
-pfxtab1:
-
-switch:
-       mov     r1,-(sp)
-       mov     (r5)+,r1
-1:
-       cmpb    (r1)+,r0
-       beq     1f
-       tstb    (r1)+
-       bne     1b
-       cmp     r1,$pfxtab
-       ble     0f
-       cmp     r1,$pfxtab1
-       bgt     0f
-       mov     $037,r0
-0:
-       mov     (sp)+,r1
-       rts     r5
-1:
-       movb    (r1)+,r0
-       mov     (sp)+,r1
-       rts     r5
-
-get1:
-       tst     nspace
-       ble     1f
-       dec     nspace
-       mov     tabc,r0
-       rts     pc
-1:
-       mov     r1,-(sp)
-4:
-       tst     ip
-       beq     5f
-       jsr     pc,rbf
-       br      6f
-5:
-       tst     nx
-       bne     0f
-       mov     ibufp,r1
-       cmp     r1,eibuf
-       bne     3f
-0:
-       mov     ifile,r0
-       bne     2f
-1:
-       jsr     pc,nextfile
-2:
-       clr     nx
-       sys     read; ibuf; 512.
-       bes     done
-       tst     r0
-       beq     1b
-       mov     $ibuf,r1
-       add     r1,r0
-       mov     r0,eibuf
-3:
-       movb    (r1)+,r0
-       mov     r1,ibufp
-1:
-       cmp     r0,$011 /tab
-       bne     6f
-       mov     (sp)+,r1
-       mov     $tabtab,r0
-       inc     nspace
-1:
-       tstb    (r0)
-       beq     get1
-       cmpb    column,(r0)+
-       bge     1b
-       movb    -(r0),nspace
-       sub     column,nspace
-       br      get1
-6:
-get1a: br      7f
-       tst     r0
-       beq     4b
-7:
-       mov     (sp)+,r1
-       rts     pc
-
-nextfile:
-       mov     ifile,r0
-       beq     1f
-       sys     close
-1:
-       tst     nx
-       beq     2f
-       mov     $nextf,0f
-       br      3f
-2:
-       dec     argc
-       blt     done
-       mov     *argp,0f
-       add     $2,argp
-3:
-       sys     open; 0:..; 0
-       bes     done
-       mov     r0,ifile
-       rts     pc
-
-done:
-       jsr     pc,rbreak
-       jsr     pc,eject
-       jsr     pc,flush
-place:
-       sys     signal; 2; 1
-       mov     $1,r0
-       jsr     pc,mesg
-       sys     unlink; bfn
-       sys     exit
-
-       rts     pc
-
-putchar:
-       cmp     pn,pfrom
-       blt     2f
-       clr     pfrom
-       bic     $!177,r0
-       beq     2f
-       movb    trtab(r0),r0
-       cmp     r0,$' 
-       bne     1f
-       inc     nsp
-2:
-       rts     pc
-1:
-       cmp     r0,$'\n
-       bne     1f
-       clr     nsp
-       clr     ocol
-       br      2f
-1:
-       tst     nsp
-       beq     2f
-       tst     slow
-       bne     4f
-       jsr     pc,dsp
-       cmp     nsp,r1
-       blt     4f
-       mov     $011,3f+2
-       cmp     r1,$1
-       bgt     8f
-       mov     $040,3f+2
-       dec     nsp
-       br      9f
-8:
-       sub     r1,nsp
-9:
-       mov     r0,-(sp)
-3:
-       mov     $011,r0
-       jsr     pc,pchar1
-       mov     (sp)+,r0
-       br      1b
-4:
-       mov     r0,-(sp)
-       mov     $' ,r0
-       jsr     pc,pchar1
-       mov     (sp)+,r0
-       dec     nsp
-       bne     4b
-2:
-       cmp     r0,$026
-       blt     2f
-       cmp     r0,$037
-       beq     3f
-       bgt     2f
-       mov     r0,-(sp)
-       jsr     r5, switch; unpfx
-       cmp     (sp)+,r0
-       beq     2f
-       mov     r0,-(sp)
-       mov     $033,r0  /prefix
-       jsr     pc,pchar1
-       dec     ocol
-       mov     (sp)+,r0
-2:
-pchar1:
-       cmp     r0,$011
-       bne     1f
-       jsr     pc,dsp
-       br      2f
-1:
-       jsr     pc,width
-2:
-       add     r1,ocol
-       movb    r0,*obufp
-       inc     obufp
-       cmp     obufp,$obuf+128.
-       beq     flush
-3:
-       rts     pc
-
-dsp:
-       clr     r1
-1:
-       add     $8.,r1
-       cmp     ocol,r1
-       bgt     1b
-       sub     ocol,r1
-       bne     2f
-       mov     $8.,r1
-2:
-       rts     pc
-
-
-unpfx:
-   .byte 032, '9
-   .byte 035, '8
-   .byte 036, '7
-   .byte 031, '3
-   .byte 030, '4
-   .byte 026, '1
-   .byte 027, '2
-   .byte 0,0
-
-flush:
-       mov     obufp,r0
-       sub     $obuf,r0
-       mov     r0,0f
-       mov     $1,r0
-       sys     write; obuf; 0:0
-       mov     $obuf,obufp
-       rts     pc
-
-control:
-       jsr     pc,getchar
-       mov     r0,-(sp)
-       jsr     pc,getchar
-       swab    r0
-       bis     (sp),r0
-       mov     $contab,r1
-1:
-       mov     (r1)+,(sp)
-       bic     $100000,(sp)
-       cmp     r0,(sp)
-       bne     4f
-       mov     (r1),(sp)
-       tst     -(r1)
-       bpl     3f
-       jsr     pc,flushi
-       cmp     ilistp,$iliste
-       bgt     5f
-       mov     ip,*ilistp
-       add     $2,ilistp
-       mov     (sp),ip
-       br      5f
-3:
-       jmp     *(sp)+
-4:
-       cmp     (r1)+,$-1
-       bne     1b
-5:
-       tst     (sp)+
-       rts     pc
-
-contab:
-   <ad>; casead
-   <bp>; casebp
-   <br>; casebr
-   <cc>; casecc
-   <ce>; casece
-   <ds>; caseds
-   <fi>; casefi
-   <in>; casein
-   <ix>; caseix
-   <li>; caseli
-   <ll>; casell
-   <ls>; casels
-   <na>; casena
-   <ne>; casene
-   <nf>; casenf
-   <pa>; casepa
-   <bl>; casebl
-   <pl>; casepl
-   <sk>; casesk
-   <sp>; casesp
-   <ss>; casess
-   <ta>; caseta
-   <ti>; caseti
-   <tr>; casetr
-   <ul>; caseul
-   <un>; caseun
-   <he>; casehe
-   <hx>; casehx
-   <fo>; casefo
-   <eh>; caseeh
-   <oh>; caseoh
-   <ef>; caseef
-   <of>; caseof
-   <m1>; casem1
-   <m2>; casem2
-   <m3>; casem3
-   <m4>; casem4
-   <hc>; casehc
-   <hy>; casehy
-   <n1>; casen1
-   <n2>; casen2
-   <nn>; casenn
-   <ni>; caseni
-   <jo>; casejo
-   <ar>; casear
-   <ro>; casero
-   <nx>; casenx
-   <po>; casepo
-   <de>; casede
-   <ig>; caseig
-   <tc>; casetc
-   <mk>; casemk
-bnames: .=.+100.
-    -1; -1
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff2.s b/.ref-Research-V7/usr/src/cmd/roff/roff2.s
deleted file mode 100644 (file)
index 3823c86..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-/
-/
-
-/ roff2 -- runoff
-
-casead:
-       jsr     pc,rbreak
-       inc     ad
-       rts     pc
-
-       rts     pc
-
-casebr:
-       jsr     pc,rbreak
-       rts     pc
-
-casecc:
-       jsr     pc,skipcont
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       beq     1f
-       movb    r0,cc
-1:
-       mov     r0,ch
-       rts     pc
-
-casece:
-       jsr     pc,rbreak
-       jsr     r5,number; 0
-       jsr     pc,min
-       mov     r0,ce
-       jsr     pc,need
-       rts     pc
-
-caseds:
-       jsr     pc,rbreak
-       mov     $2,ls
-       rts     pc
-
-casefi:
-       jsr     pc,rbreak
-       inc     fi
-       rts     pc
-
-casein:
-       jsr     pc,rbreak
-       jsr     r5,number; in
-       jsr     pc,min
-       mov     r0,in
-       mov     r0,un
-       rts     pc
-
-caseix:
-       jsr     r5,number; in
-       jsr     pc,min
-       mov     r0,in
-       rts     pc
-
-caseli:
-       jsr     r5,number; 0
-       mov     r0,-(sp)
-1:
-       dec     (sp)
-       blt     1f
-       jsr     pc,flushi
-       clr     nlflg
-       jsr     pc,text
-       br      1b
-1:
-       tst     (sp)+
-       rts     pc
-
-casell:
-       jsr     r5,number; ll
-       jsr     pc,min
-       mov     r0,ll
-       rts     pc
-
-casels:
-       jsr     pc,rbreak
-       jsr     pc,skipcont
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       bne     1f
-       mov     ls1,ls
-       rts     pc
-1:
-       mov     r0,ch
-       jsr     r5,number1; ls
-       dec     r0
-       jsr     pc,min
-       inc     r0
-       mov     r0,ls
-       mov     r0,ls1
-       rts     pc
-
-casena:
-       jsr     pc,rbreak
-       clr     ad
-       rts     pc
-
-casene:
-       jsr     r5,number; 0
-       jsr     pc,min
-       jsr     pc,need
-       rts     pc
-
-casenf:
-       jsr     pc,rbreak
-       clr     fi
-       rts     pc
-
-casepa:
-casebp:
-       jsr     pc,rbreak
-       jsr     pc,eject
-       jsr     pc,skipcont
-       tst     nlflg
-       bne     1f
-       jsr     r5,number; pn
-       jsr     pc,min
-       mov     r0,pn
-1:
-       rts     pc
-
-casebl:
-       jsr     pc,rbreak
-       jsr     r5,number; 0
-       jsr     pc,min
-       mov     r0,-(sp)
-       jsr     pc,need2
-1:
-       dec     (sp)
-       blt     1f
-       mov     $' ,r0
-       jsr     pc,storeline
-       jsr     pc,rbreak
-       br      1b
-1:
-       tst     (sp)+
-       rts     pc
-
-casepl:
-       jsr     r5,number; pl
-       mov     r0,pl
-       jsr     pc,topbot
-       rts     pc
-
-casesk:
-       jsr     r5,number; 0
-       jsr     pc,min
-       mov     r0,skip
-       rts     pc
-
-casesp:
-       jsr     pc,rbreak
-       jsr     r5,number; 0
-       jsr     r5,nlines; nline
-       rts     pc
-
-casess:
-       jsr     pc,rbreak
-       mov     $1,ls
-       rts     pc
-
-casetr:
-       jsr     pc,skipcont
-1:
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       beq     1f
-       mov     r0,r1
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       bne     2f
-       mov     $' ,r0
-2:
-       movb    r0,trtab(r1)
-       br      1b
-1:
-       rts     pc
-
-caseta:
-       mov     $tabtab,r1
-1:
-       cmp     r1,$etabtab
-       bhis    1f
-       jsr     r5,number; 0
-       jsr     pc,min
-       dec     r0
-       ble     1f
-       movb    r0,(r1)+
-       br      1b
-1:
-       clrb    (r1)
-       rts     pc
-
-caseti:
-       jsr     pc,rbreak
-       jsr     r5,number; in
-       jsr     pc,min
-       mov     r0,un
-       rts     pc
-
-caseul:
-       jsr     r5,number; 0
-       jsr     pc,min
-       mov     r0,ul
-       rts     pc
-
-caseun:
-       jsr     r5,number; 0
-       sub     in,r0
-       neg     r0
-       jsr     pc,min
-       mov     r0,un
-       rts     pc
-
-casehx:
-       tst     hx
-       beq     1f
-       clr     hx
-       br      2f
-1:
-       inc     hx
-2:
-       jsr     pc,topbot
-       rts     pc
-
-casehe:
-       jsr     r5,headin; ehead
-       mov     ehead,ohead
-       rts     pc
-casefo:
-       jsr     r5,headin; efoot
-       mov     efoot,ofoot
-       rts     pc
-
-caseeh:
-       jsr     r5,headin; ehead
-       rts     pc
-
-caseoh:
-       jsr     r5,headin; ohead
-       rts     pc
-
-caseef:
-       jsr     r5,headin; efoot
-       rts     pc
-
-caseof:
-       jsr     r5,headin; ofoot
-       rts     pc
-
-casem1:
-       jsr     r5,number; ma1
-       jsr     pc,min
-       mov     r0,ma1
-       br      1f
-
-casem2:
-       jsr     r5,number; ma2
-       jsr     pc,min
-       mov     r0,ma2
-       br      1f
-
-casem3:
-       jsr     r5,number; ma3
-       jsr     pc,min
-       mov     r0,ma3
-       br      1f
-
-casem4:
-       jsr     r5,number; ma4
-       jsr     pc,min
-       mov     r0,ma4
-1:
-       jsr     pc,topbot
-       rts     pc
-
-casehc:
-       jsr     pc,skipcont
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       bne     1f
-       movb    $200,r0
-1:
-       mov     r0,ohc
-       rts     pc
-
-casetc:
-       jsr     pc,skipcont
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       bne     1f
-       mov     $' ,r0
-1:
-       mov     r0,tabc
-       rts     pc
-
-casehy:
-       jsr     r5,number; 0
-       mov     r0,hyf
-       rts     pc
-
-casen1:
-       jsr     pc,rbreak
-       mov     $1,numbmod
-       br      1f
-casen2:
-       jsr     pc,rbreak
-       mov     $2,numbmod
-1:
-       clr     nn
-       jsr     r5,number; 0
-       tst     r0
-       ble     1f
-       mov     r0,lnumber
-       rts     pc
-1:
-       clr     numbmod
-       rts     pc
-
-casenn:
-       jsr     r5,number; 0
-       jsr     pc,min
-       mov     r0,nn
-       rts     pc
-
-caseni:
-       jsr     r5,number; ni
-       jsr     pc,min
-       mov     r0,ni
-       rts     pc
-
-casejo:
-       jsr     r5,number; 0
-       mov     r0,jfomod
-       rts     pc
-
-casear:
-       clr     ro
-       rts     pc
-
-casero:
-       inc     ro
-       rts     pc
-
-casenx:
-       jsr     pc,skipcont
-       jsr     r5,getname; nextf
-       inc     nx
-       jsr     pc,nextfile
-       inc     nlflg
-       clr     ip
-       mov     $ilist,ilistp
-       rts     pc
-
-casepo:
-       jsr     pc,rbreak
-       jsr     r5,number; po
-       jsr     pc,min
-       mov     r0,po
-       rts     pc
-
-casede:
-       tst     ip
-       bne     5f
-       jsr     pc,skipcont
-       jsr     r5,getname; bname
-       clr     skp
-       mov     $contab,r1
-       clr     -(sp)
-1:
-       mov     (r1)+,(sp)
-       beq     2f
-       bic     $100000,(sp)
-       cmp     bname,(sp)
-       bne     3f
-2:
-       bis     $100000,bname
-       mov     nextb,(r1)
-       mov     bname,-(r1)
-       br      4f
-3:
-       cmp     (r1)+,$-1
-       bne     1b
-       inc     skp
-4:
-       tst     (r1)+
-       jsr     pc,copyb
-       tst     (sp)+
-5:
-       rts     pc
-
-caseig:
-       inc     skp
-       jsr     pc,copyb
-       rts     pc
-
-casemk:
-       jsr     pc,rbreak
-       mov     $002,r0 /stx
-       jsr     pc,putchar
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff3.s b/.ref-Research-V7/usr/src/cmd/roff/roff3.s
deleted file mode 100644 (file)
index aeed595..0000000
+++ /dev/null
@@ -1,485 +0,0 @@
-/
-/
-
-/roff3 -- runoff
-
-skipcont:
-       jsr     pc,getchar
-       mov     r0,r2
-       jsr     pc,alph2
-       beq     skipcont
-1:
-       cmp     $' ,r0
-       bne     1f
-       jsr     pc,getchar
-       br      1b
-1:
-       mov     r0,ch
-       rts     pc
-
-rbreak:
-       tst     nc
-       ble     4f
-       clrb    *linep
-       inc     totout
-       mov     ls,r0
-       dec     r0
-       jsr     r5,nlines; nline
-       tst     pl
-       beq     4f
-       cmp     nl,bl
-       bne     1f
-3:
-       jsr     pc,eject
-1:
-       tst     nl
-       bne     3f
-       mov     ma1,r0
-       jsr     r5,nlines; newline
-       bit     $1,pn
-       bne     1f
-       jsr     r5,headout; ehead
-       br      2f
-1:
-       jsr     r5,headout; ohead
-2:
-       mov     ma2,r0
-       jsr     r5,nlines; newline
-       dec     skip
-       bge     3b
-3:
-       mov     po,r0
-       jsr     pc,space
-       jsr     pc,donum
-       mov     un,r0
-       jsr     pc,space
-       jsr     pc,jfo
-       mov     $line,r2
-1:
-       movb    (r2)+,r0
-       cmp     $' ,r0
-       bne     2f
-       jsr     pc,fill
-       tst     nc
-       bne     1b
-       br      3f
-2:
-       jsr     pc,putchar
-       dec     nc
-       bgt     1b
-3:
-       jsr     pc,newline
-       clr     nwd
-       clr     ne
-       mov     in,un
-4:
-       jsr     pc,setnel
-       rts     pc
-
-jfo:
-       tst     jfomod
-       beq     1f
-       mov     fac,r0
-       add     fmq,r0
-       beq     1f
-       clr     fac
-       clr     fmq
-       mov     nel,r0
-       cmp     jfomod,$1
-       bne     2f
-       asr     r0
-2:
-       jsr     pc,space
-1:
-       rts     pc
-
-donum:
-       tst     numbmod
-       beq     2f
-       dec     nn
-       blt     1f
-       mov     $5,r0
-       add     ni,r0
-       jsr     pc,space
-       rts     pc
-1:
-       clr     r0
-       cmp     lnumber,$100.
-       bge     1f
-       inc     r0
-       cmp     lnumber,$10.
-       bge     1f
-       inc     r0
-1:
-       add     ni,r0
-       jsr     pc,space
-       mov     lnumber,r0
-       jsr     r5,decimal; putchar
-       mov     $2,r0
-       jsr     pc,space
-       inc     lnumber
-2:
-       rts     pc
-
-
-newline:
-       mov     $'\n,r0
-       jsr     pc,putchar
-       inc     nl
-       rts     pc
-
-nline:
-       mov     nl,r0
-       beq     1f
-       cmp     r0,bl
-       beq     1f
-       jsr     pc,newline
-1:
-       rts     pc
-
-number:
-       jsr     pc,skipcont
-number1:
-       mov     r1,-(sp)
-       mov     r3,-(sp)
-       clr     r3
-       clr     -(sp)
-       clr     -(sp)
-1:
-       jsr     pc,getchar
-       cmp     r0,$'+
-       beq     2f
-       cmp     r0,$'-
-       beq     2f
-       sub     $'0,r0
-       cmp     r0,$9.
-       bhi     3f
-       inc     (sp)
-       mpy     $10.,r3
-       add     r0,r3
-       br      1b
-2:
-       mov     r0,2(sp)
-       br      1b
-3:
-       add     $'0,r0
-       mov     r0,ch
-       mov     (sp)+,r0
-       bne     1f
-       mov     $1,r3
-       mov     r3,r0
-1:
-       mov     (r5)+,r0
-       beq     1f
-       mov     (r0),r0
-1:
-       mov     (sp)+,r1
-       cmp     r1,$'-
-       bne     1f
-       sub     r3,r0
-       br      2f
-1:
-       cmp     r1,$'+
-       bne     1f
-       add     r3,r0
-       br      2f
-1:
-       mov     r3,r0
-2:
-       mov     (sp)+,r3
-       mov     (sp)+,r1
-       rts     r5
-
-eject:
-       tst     pl
-       beq     1f
-       tst     nl
-       beq     1f
-       mov     pl,r0
-       sub     nl,r0
-       sub     ma4,r0
-       sub     hx,r0
-       jsr     r5,nlines; newline
-       bit     $1,pn
-       bne     2f
-       jsr     r5,headout; efoot
-       br      3f
-2:
-       jsr     r5,headout; ofoot
-3:
-       cmp     numbmod,$1
-       bne     3f
-       mov     $1,lnumber
-3:
-       mov     ma4,r0
-       jsr     r5,nlines; newline
-       clr     nl
-       inc     pn
-1:
-       cmp     pn,pto
-       ble     1f
-       jsr     pc,flush
-       jmp     place
-1:
-istop:
-       tst     stop
-       beq     2f
-       cmp     pn,pfrom
-       blo     2f
-       jsr     pc,flush
-/      mov     sp,r1
-/      sys     signal; 2; 1f
-       clr     r0
-       sys     read; garb; 1
-1:
-/      mov     r1,sp
-/      sys     signal; 2; place
-2:
-       rts     pc
-
-
-storeline:
-       cmp     linep,$line+linsiz
-       bhis    1f
-       movb    r0,*linep
-       inc     linep
-       jsr     pc,width
-       add     r1,ne
-       sub     r1,nel
-       inc     nc
-1:
-       rts     pc
-
-getword:
-       mov     $word,r2
-       clr     wne
-       clr     wch
-       clr     nhyph
-       clr     hypedf
-       mov     $word,wordp
-       clr     -(sp)
-1:
-       jsr     pc,gettchar
-       cmp     r0,$'\n
-       beq     3f
-       cmp     r0,ohc
-       bne     2f
-       inc     hypedf
-       br      1b
-2:
-       cmp     $' ,r0
-       bne     2f
-       jsr     pc,storeword
-       br      1b
-2:
-       mov     r0,-(sp)
-       mov     $' ,r0
-       jsr     pc,storeword
-       tst     spaceflg
-       beq     2f
-       jsr     pc,storeword
-       clr     spaceflg
-2:
-       mov     (sp)+,r0
-2:
-       jsr     pc,storeword
-       bisb    (sp),-1(r2)     /add in hyphen
-       clr     (sp)
-       jsr     pc,gettchar
-       cmp     r0,ohc
-       bne     1f
-       inc     hypedf
-       jsr     pc,gettchar
-       mov     $200,(sp)
-1:
-       cmp     $' ,r0
-       beq     1f
-       cmp     $'\n,r0
-       bne     2b
-       cmpb    -1(r2),$'.
-       bne     1f
-       inc     spaceflg
-1:
-       add     $2,2(sp)
-1:
-       clrb    (r2)+
-3:
-       tst     (sp)+
-       mov     $word,wordp
-       tst     nc
-       bne     1f
-       jsr     pc,setnel
-1:
-       rts     pc
-
-setnel:
-       mov     $line,linep
-       mov     ll,nel
-       sub     un,nel
-       clr     ne
-       clr     fac
-       clr     fmq
-       rts     pc
-
-storeword:
-       jsr     pc,width
-       add     r1,wne
-       inc     wch
-       movb    r0,(r2)+
-       rts     pc
-
-need:
-       mov     r0,r3
-       mpy     ls,r3
-       mov     r3,r0
-need2:
-       add     nl,r0
-       cmp     r0,bl
-       ble     1f
-       jsr     pc,eject
-1:
-       rts     pc
-
-min:
-       tst     r0
-       bge     1f
-       clr     r0
-1:
-       rts     pc
-
-getname:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     (r5)+,r1
-       mov     $18.,r2
-1:
-       jsr     pc,getchar
-       cmp     r0,$041
-       blt     2f
-       cmp     r0,$0176
-       ble     4f
-2:
-       mov     r0,ch
-3:
-       clrb    (r1)+
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       rts     r5
-4:
-       movb    r0,(r1)+
-       dec     r2
-       beq     3b
-       br      1b
-
-copyb:
-       mov     (r1),r1
-       jsr     pc,flushi
-       clr     nlflg
-       mov     $1,-(sp)
-1:
-       jsr     pc,getchar
-       cmp     r0,$'\n
-       bne     2f
-       mov     $1,(sp)
-       clr     nlflg
-       br      4f
-2:
-       cmp     r0,$'.
-       bne     9f
-       cmp     (sp),$1
-       bgt     3f
-       blt     9f
-       inc     (sp)
-       br      4f
-3:
-       dec     r1
-       clr     r0
-       inc     (sp)
-       br      4f
-9:
-       clr     (sp)
-4:
-       tst     skp
-       bne     5f
-       jsr     pc,wbf
-5:
-       cmp     (sp),$3
-       bne     1b
-       tst     (sp)+
-       tst     skp
-       bne     6f
-       mov     r1,nextb
-6:
-       rts     pc
-
-popi:
-       cmp     ilistp,$ilist
-       beq     1f
-       sub     $2,ilistp
-       mov     *ilistp,ip
-1:
-       rts     pc
-
-wbf:
-       mov     r0,char
-       mov     r1,offb
-       mov     ibf,r0
-       sys     lseek;0; offb:..;0      /actually lseek
-       mov     ibf,r0
-       sys     write; char;1
-       inc     r1
-       cmp     ibf1,ofile
-       bne     1f
-       mov     $-1,ofile
-1:
-       rts     pc
-rbf:
-       mov     ip,r1
-       mov     ibf1,nfile
-       jsr     pc,rdsufb
-       tstb    r0
-       bne     2f
-       jsr     pc,popi
-       rts     pc
-2:
-       inc     ip
-       rts     pc
-
-alph:
-       movb    (r0),r2
-alph2:
-       cmp     r2,$'A
-       blo     1f
-       cmp     r2,$'Z
-       blos    2f
-       cmp     r2,$'a
-       blo     1f
-       cmp     r2,$'z
-       bhi     1f
-2:
-       sez
-       rts     pc
-1:
-       clz
-       rts     pc
-
-rdsufb:
-       mov     r1,-(sp)
-       bic     $77,r1
-       cmp     r1,sufoff
-       bne     1f
-       cmp     nfile,ofile
-       beq     2f
-1:
-       mov     r1,sufoff
-       mov     nfile,ofile
-       mov     nfile,r0
-       sys     lseek;0; sufoff: -1; 0  /actually lseek
-       mov     nfile,r0
-       sys     read; sufbuf; 512.
-2:
-       mov     (sp),r0
-       bic     $!77,r0
-       movb    sufbuf(r0),r0
-       mov     (sp)+,r1
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff4.s b/.ref-Research-V7/usr/src/cmd/roff/roff4.s
deleted file mode 100644 (file)
index 2972597..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-/
-/
-
-/ roff4 -- runoff
-
-text:
-/      inc     tottext
-       clr     ulstate
-       clr     wch
-       clr     wne
-       tst     ce
-       bne     nofill
-       tst     fi
-       beq     nofill
-       jsr     pc,getchar
-2:
-       mov     r0,ch
-       cmp     $' ,r0
-       bne     2f
-       jsr     pc,rbreak
-1:
-       jsr     pc,getchar
-       cmp     $' ,r0
-       bne     2b
-       inc     un
-       br      1b
-2:
-       cmp     r0,$'\n
-       bne     2f
-       jsr     pc,rbreak
-       clr     ch
-       jsr     pc,nline
-       br      4f
-2:
-       tst     wch
-       bne     3f
-       jsr     pc,getword
-               br 4f
-3:
-       jsr     pc,movword
-       bne     2b
-       jsr     pc,adjust
-       br      2b
-4:
-       dec     ul
-       bge     1f
-       clr     ul
-1:
-       rts     pc
-
-nofill:
-       jsr     pc,rbreak
-1:
-       jsr     pc,gettchar
-       cmp     r0,$'\n
-       beq     1f
-       jsr     pc,width
-       add     r1,ne
-       jsr     pc,storeline
-       br      1b
-1:
-       tst     ce
-       ble     2f
-       dec     ce
-       mov     nel,r0
-       asr     r0
-       bpl     1f
-       clr     r0
-1:
-       add     r0,un
-       tst     numbmod
-       beq     2f
-       add     $2,un
-2:
-       clr     fac
-       clr     fmq
-       mov     $1000,nwd
-       mov     $' ,r0
-       jsr     pc,storeline
-       jsr     pc,rbreak
-       dec     ul
-       bpl     2f
-       clr     ul
-2:
-       rts     pc
-
-adjust:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       clr     r2
-       clr     r3
-       tst     ad
-       beq     1f
-       mov     nwd,r0
-       dec     r0
-       ble     1f
-       mov     nel,r3
-       ble     1f
-       dvd     r0,r2
-1:
-       mov     r3,fac
-       mov     r2,fmq
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       jsr     pc,rbreak
-       rts     pc
-
-fill:
-       mov     fmq,r0
-1:
-       inc     r0
-       dec     nc
-       cmpb    (r2)+,$' 
-       beq     1b
-       dec     r2
-       bit     $1,totout
-       beq     2f
-       inc     fac
-       cmp     fac,nwd
-       blt     1f
-       inc     r0
-       br      1f
-2:
-       dec     fac
-       bmi     1f
-       inc     r0
-1:
-       jsr     pc,space
-       movb    (r2),r0
-       rts     pc
-
-movword:
-       mov     wch,wordend
-       mov     wordp,r4
-       add     r4,wordend
-       tst     nwd
-       bne     2f
-1:
-       movb    (r4)+,r0
-       cmp     r0,$' 
-       bne     1f
-       dec     wch
-       jsr     pc,width
-       sub     r1,wne
-       br      1b
-1:
-       dec     r4
-2:
-       cmp     wne,nel
-       ble     1f
-       cmp     nel,$4
-       ble     1f
-       mov     ls,r0
-       add     nl,r0
-       cmp     r0,bl
-       bgt     2f
-       mov     ls,r0
-       asl     r0
-       add     nl,r0
-       cmp     r0,bl
-       bgt     1f
-2:
-       jsr     pc,hyphen
-1:
-       clr     nhyph
-       mov     wch,-(sp)
-1:
-       movb    (r4)+,r0
-       cmp     r0,$'-
-       bne     2f
-       movb    (r4),r2
-       jsr     pc,alph2
-       bne     2f
-       bisb    $200,(r4)
-2:
-       tst     r0
-       bpl     2f
-       bic     $!177,r0
-       mov     r4,r3
-       sub     $4,r3
-       cmp     r3,$word
-       blo     2f
-       movb    (r3),r2
-       bic     $!177,r2
-       jsr     pc,alph2
-       beq     3f
-       cmp     nel,$2
-       ble     2f
-3:
-       mov     r0,-(sp)
-       clr     r0
-       jsr     pc,storeline
-       mov     (sp)+,r0
-       inc     nhyph
-2:
-       jsr     pc,width
-       sub     r1,wne
-       jsr     pc,storeline
-       dec     wch
-       bne     1b
-       tst     nel
-       blt     1f
-       inc     nwd
-       tst     (sp)+
-       clz
-       rts     pc
-1:
-       mov     linep,r3
-1:
-       tst     nhyph
-       bne     2f
-       tst     nwd
-       beq     3f
-       cmp     wch,(sp)
-       beq     4f
-2:
-       movb    -(r3),r0
-       bne     2f
-       dec     nhyph
-       bne     5f
-       tst     nwd
-       beq     6f
-5:
-       tst     nel
-       ble     2f
-6:
-       cmpb    -1(r3),$'-
-       beq     3f
-       movb    $'-,(r3)
-       dec     nel
-       inc     ne
-       br      3f
-2:
-       dec     nc
-       tstb    (r3)
-       beq     1b
-       jsr     pc,width
-       sub     r1,ne
-       add     r1,nel
-       inc     wch
-       dec     r4
-       add     r1,wne
-       br      1b
-3:
-       inc     nwd
-4:
-       mov     r4,wordp
-       bicb    $!177,(r4)
-       cmp     r4,$word
-       bge     4f
-       4
-4:
-       tst     (sp)+
-       sez
-       rts     pc
-
-topbot:
-       mov     pl,r0
-       bne     1f
-       clr     bl
-       rts     pc
-1:
-       sub     ma3,r0
-       sub     ma4,r0
-       sub     hx,r0
-       mov     r0,bl
-       mov     ma1,r0
-       add     ma2,r0
-       add     hx,r0
-       cmp     r0,bl
-       blt     1f
-       mov     $2,r0
-       mov     r0,ma1
-       mov     r0,ma2
-       mov     r0,ma3
-       mov     r0,ma4
-       mov     $66.,pl
-       br      topbot
-1:
-       cmp     nl,bl
-       ble     1f
-       mov     bl,nl
-1:
-       rts     pc
-
-width:
-       cmp     r0,ohc
-       beq     2f
-       tst     r0
-       beq     2f
-       cmp     r0,$0177
-       beq     2f
-       cmp     r0,$010
-       bne     1f
-       mov     $-1,r1
-       rts     pc
-1:
-       cmp     $' ,r0
-       bgt     2f
-       mov     $1,r1
-       rts     pc
-2:
-       clr     r1
-       rts     pc
-
-headin:
-       jsr     pc,skipcont
-       mov     nextb,r1
-       mov     r1,*(r5)+
-       jsr     pc,gettchar
-       cmp     r0,$'\n
-       beq     2f
-       mov     r0,r2
-1:
-       jsr     pc,gettchar
-       cmp     r0,$'\n
-       beq     2f
-       cmp     r0,r2
-       bne     3f
-       clr     r0
-3:
-       jsr     pc,wbf
-       br      1b
-2:
-       clr     r0
-       jsr     pc,wbf
-       mov     r1,nextb
-       mov     ll,llh
-       rts     r5
-
-headout:
-       tst     hx
-       bne     0f
-       tst     (r5)+
-       rts     r5
-0:
-       clr     -(sp)
-       mov     *(r5),r2
-       mov     ibf1,nfile
-       jsr     r5,headseg; width
-       mov     r0,-(sp)
-       jsr     r5,headseg; width
-       mov     r0,-(sp)
-       jsr     r5,headseg; width
-       mov     r0,-(sp)
-       mov     po,r0
-       jsr     pc,space
-       tst     numbmod
-       beq     1f
-       mov     $5,r0
-       add     ni,r0
-       mov     r0,6(sp)
-1:
-       mov     *(r5)+,r2
-       jsr     r5,headseg; putchar
-       mov     llh,r0
-       add     6(sp),r0
-       sub     2(sp),r0
-       asr     r0
-       sub     4(sp),r0
-       bge     1f
-       clr     r0
-1:
-       mov     r0,-(sp)
-       jsr     pc,space
-       jsr     r5,headseg; putchar
-       mov     llh,r0
-       sub     (sp)+,r0
-       sub     (sp)+,r0
-       sub     (sp)+,r0
-       sub     (sp)+,r0
-       add     (sp)+,r0
-       jsr     pc,space
-       jsr     r5,headseg; putchar
-       jsr     pc,newline
-       rts     r5
-
-headseg:
-       clr     -(sp)
-1:
-       mov     r1,-(sp)
-       mov     r2,r1
-       inc     r2
-       jsr     pc,rdsufb
-       mov     (sp)+,r1
-       tstb    r0
-       beq     1f
-       cmp     r0,$'%
-       beq     2f
-       jsr     pc,*(r5)
-       add     r1,(sp)
-       br      1b
-2:
-       mov     pn,r0
-       clr     r1
-       tst     ro
-       beq     2f
-       mov     $ones,onesp
-       mov     $fives,fivesp
-       jsr     pc,roman
-       add     r1,(sp)
-       br      1b
-2:
-       jsr     pc,decml
-       add     r1,(sp)
-       br      1b
-1:
-       mov     (sp)+,r0
-       tst     (r5)+
-       rts     r5
-
-space:
-       jsr     r5,nlines; putchar
-       rts     pc
-
-nlines:
-       mov     r0,-(sp)
-1:
-       dec     (sp)
-       blt     1f
-       mov     $' ,r0
-       jsr     pc,*(r5)
-       br      1b
-1:
-       cmp     (r5)+,(sp)+
-       rts     r5
-
-decimal:
-       jsr     pc,decml
-       tst     (r5)+
-       rts     r5
-
-decml:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       jsr     pc,decml1
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       rts     pc
-
-decml1:
-       mov     r1,-(sp)
-       clr     r2
-       mov     r0,r3
-       dvd     $10.,r2
-       mov     r3,-(sp)
-       mov     r2,r0
-       beq     1f
-       jsr     pc,decml
-       mov     r1,2(sp)
-1:
-       mov     (sp)+,r0
-       add     $'0,r0
-       jsr     pc,*(r5)
-       add     (sp)+,r1
-       rts     pc
-
-roman:
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       jsr     pc,roman1
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       rts     pc
-roman1:
-       clr     r2
-       mov     r0,r3
-       bne     .+4
-       rts     pc
-       mov     r1,-(sp)
-       dvd     $10.,r2
-       mov     r3,-(sp)
-       mov     r2,r0
-       inc     onesp
-       inc     fivesp
-       jsr     pc,roman
-       mov     r1,2(sp)
-       dec     onesp
-       dec     fivesp
-       clr     r2
-       mov     (sp)+,r3
-       dvd     $5.,r2
-       cmp     r3,$4
-       bne     1f
-       movb    *onesp,r0
-       jsr     pc,*(r5)
-       add     r1,(sp)
-       tst     r2
-       beq     2f
-       inc     onesp
-       movb    *onesp,r0
-       dec     onesp
-       br      3f
-2:
-       movb    *fivesp,r0
-3:
-       jsr     pc,*(r5)
-       add     (sp)+,r1
-       rts     pc
-1:
-       tst     r2
-       beq     2f
-       movb    *fivesp,r0
-       jsr     pc,*(r5)
-       add     r1,(sp)
-2:
-       dec     r3
-       blt     1f
-       movb    *onesp,r0
-       jsr     pc,*(r5)
-       add     r1,(sp)
-       br      2b
-1:
-       mov     (sp)+,r1
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff5.s b/.ref-Research-V7/usr/src/cmd/roff/roff5.s
deleted file mode 100644 (file)
index 790a990..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/
-/
-
-/ hyp1 -- driver
-
-hyphen:
-       tst     hypedf
-       bne     3f
-       tst     hyf
-       beq     3f
-       inc     hypedf
-       mov     wordp,r0
-       clr     nhyph
-1:
-       jsr     pc,punct
-       bne     1f
-       inc     r0
-       br      1b
-1:
-       jsr     pc,alph
-       bne     3f
-1:
-       inc     r0
-       jsr     pc,alph
-       beq     1b
-       dec     r0
-       mov     r0,hstart
-1:
-       inc     r0
-       tstb    (r0)
-       beq     2f
-       jsr     pc,punct
-       bne     3f
-       br      1b
-2:
-       jsr     r5,suffix
-       jsr     r5,digram
-3:
-       rts     pc
-
-
-punct:
-       tst     old
-       bne 4f
-       cmpb    (r0),$010
-       beq     0f
-       movb    (r0),r2
-       jsr     pc,alph2
-       beq     0f
-       sez
-       rts      pc
-0:
-       clz
-       rts     pc
-4:
-       mov      $3f,r2
-1:
-       cmpb    (r0),(r2)+
-       beq     2f
-       tstb    (r2)
-       bne     1b
-       clz
-2:
-       rts     pc
-3: < .,()"\'`\0>       /should be more
-.even
-maplow:
-       cmp     r2,$'a
-       bhis    1f
-       add     $'a-'A,r2
-1:
-       rts     pc
-
-vowel:
-       cmp     r2,$'a
-       beq     1f
-       cmp     r2,$'e
-       beq     1f
-       cmp     r2,$'i
-       beq     1f
-       cmp     r2,$'o
-       beq     1f
-       cmp     r2,$'u
-       beq     1f
-       cmp     r2,$'y
-1:
-       rts     pc
-
-checkvow:
-       mov     r0,-(sp)
-1:
-       movb    -(r0),r2
-       jsr     pc,vowel
-       beq     1f
-       jsr     pc,alph
-       beq     1b
-       mov     (sp)+,r0
-       clz
-       rts     r5
-1:
-       mov     (sp)+,r0
-       sez
-       rts     r5
-
-/ hyp2 -- suffix and digram
-
-digram:
-       mov     hstart,r0
-1:
-       jsr     pc,alph
-       bne     3f
-       jsr     pc,vowel
-       beq     1f
-       dec     r0
-       br      1b
-1:
-       mov     r0,hstart
-1:
-       movb    -(r0),r2
-       jsr     pc,alph2
-       bne     3f
-       jsr     pc,vowel
-       bne     1b
-       clr     maxdig
-       mov     r0,nhstart
-1:
-       mov     $1,r3
-       movb    -1(r0),r2
-       jsr     pc,alph2
-       beq     2f
-       movb    (r0),r2
-       mov     $'a,r1
-       jsr     r5,dilook; bxh
-       br      4f
-2:
-       movb    -2(r0),r2
-       mov     $xxh,0f
-       jsr     pc,alph2
-       beq     2f
-       mov     $bxxh,0f
-2:
-       movb    -1(r0),r1
-       movb    (r0),r2
-       jsr     r5,dilook; 0:xxh
-4:
-       movb    (r0)+,r1
-       movb    (r0),r2
-       jsr     r5,dilook; xhx
-       movb    (r0),r1
-       movb    1(r0),r2
-       jsr     r5,dilook; hxx
-       cmp     r3,maxdig
-       blos    2f
-       mov     r3,maxdig
-       mov     r0,maxloc
-2:
-       cmp     r0,hstart
-       blo     1b
-       mov     nhstart,hstart
-       cmp     maxdig,thresh
-       blo     digram
-       bisb    $200,*maxloc
-       inc     nhyph
-/      mov     maxdig,*octbufp
-/      inc     octcnt
-/      add     $2,octbufp
-       br      digram
-3:
-       rts     r5
-
-dilook:
-       mov     r4,-(sp)
-       bic     $!177,r2
-       bic     $!177,r1
-       jsr     pc,maplow
-       sub     $'a,r2
-       cmp     r2,$'z-'a
-       bhi     3f
-       mov     r2,r4
-       mov     r1,r2
-       jsr     pc,maplow
-       sub     $'a,r2
-       cmp     r2,$'z-'a
-       bhi     3f
-       mov     r3,-(sp)
-       mov     r2,r3
-       mpy     $13.,r3
-       clr     r2
-       clc
-       ror     r4
-       adc     r2
-       add     r3,r4
-       add     (r5)+,r4
-       movb    (r4),r4
-       tst     r2
-       bne     1f
-       asr     r4
-       asr     r4
-       asr     r4
-       asr     r4
-1:
-       bic     $!17,r4
-       mov     r4,r3
-       mpy     (sp)+,r3
-       br      4f
-3:
-       clr     r3
-       tst     (r5)+
-4:
-       mov     (sp)+,r4
-       rts     r5
-
-suffix:
-       mov     hstart,r0
-       jsr     pc,alph
-       bne     4f
-       jsr     pc,maplow
-       sub     $'a,r2
-       asl     r2
-       mov     suftab(r2),-(sp)
-       bic     $!37777,(sp)
-       beq     3f
-1:
-       mov     hstart,r0
-       mov     (sp),r1
-       jsr     pc,rdsuf
-       movb    (r1),r3
-       beq     3f
-       bic     $!17,r3
-       add     r3,(sp)
-       add     r1,r3
-2:
-       movb    -(r3),r2
-       cmp     r3,r1
-       ble     2f
-       bic     $!177,r2
-       mov     r2,-(sp)
-       movb    -(r0),r2
-       jsr     pc,maplow
-       cmp     r2,(sp)+
-       bne     1b
-       br      2b
-2:
-       mov     hstart,r0
-       tst     (sp)+
-       movb    (r1),r3
-       bic     $!17,r3
-       add     r1,r3
-       bitb    $200,(r1)+
-       bne     1f
-2:
-       dec     r0
-       cmp     r3,r1
-       ble     2f
-       tstb    -(r3)
-       bpl     2b
-1:
-       mov     r0,hstart
-       dec     hstart
-       bitb    $100,-1(r1)
-       bne     2b
-       jsr     r5,checkvow
-       bne     4f
-       bisb    $200,(r0)
-       br      2b
-2:
-       bitb    $40,-(r1)
-       beq     suffix
-       br      4f
-3:
-       tst     (sp)+
-4:
-       rts     r5
-
-rdsuf:
-       mov     r0,-(sp)
-       mov     suff,nfile
-       mov     4(sp),r1
-       jsr     pc,rdsufb
-       mov     $sufb,r2
-       movb    r0,(r2)+
-       mov     r0,r3
-       bic     $!17,r3
-1:
-       dec     r3
-       blt     1f
-       inc     r1
-       jsr     pc,rdsufb
-       movb    r0,(r2)+
-       br      1b
-1:
-       mov     $sufb,r1
-       mov     (sp)+,r0
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff7.s b/.ref-Research-V7/usr/src/cmd/roff/roff7.s
deleted file mode 100644 (file)
index 8b52a04..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/
-/
-
-/ hyp4 -- digram tables
-
-bxh:
-.byte 060,000,040,000,040,000,000,040,000,000,040,000,040
-
-hxx:
-.byte 006,042,041,123,021,024,063,042,002,043,021,001,022
-.byte 140,000,200,003,260,006,000,160,007,000,140,000,320
-.byte 220,000,160,005,240,010,000,100,006,000,200,000,320
-.byte 240,000,120,003,140,000,000,240,010,000,220,000,160
-.byte 042,023,041,040,040,022,043,041,030,064,021,000,041
-.byte 100,000,140,000,220,006,000,140,003,000,200,000,000
-.byte 200,000,120,002,220,010,000,160,006,000,140,000,320
-.byte 020,000,020,000,020,000,000,020,000,000,020,000,000
-.byte 043,163,065,044,022,043,104,042,061,146,061,000,007
-.byte 100,000,140,000,040,000,000,100,000,000,120,000,000
-.byte 140,000,040,011,060,004,001,120,003,000,140,000,040
-.byte 200,000,100,000,140,000,000,140,000,000,140,000,240
-.byte 200,000,140,000,160,000,000,220,000,000,140,000,240
-.byte 200,000,140,000,160,000,000,220,000,000,060,000,240
-.byte 021,043,041,121,040,023,042,003,142,042,061,001,022
-.byte 120,000,140,010,140,010,000,140,002,000,120,000,120
-.byte 000,000,000,000,360,000,000,000,000,000,160,000,000
-.byte 100,000,040,005,120,000,000,100,000,000,060,000,140
-.byte 140,040,100,001,240,041,000,242,000,002,140,000,100
-.byte 240,000,120,002,200,000,000,320,007,000,240,000,340
-.byte 101,021,041,020,040,005,042,121,002,021,201,000,020
-.byte 160,000,100,000,140,000,000,160,006,000,220,000,140
-.byte 140,000,020,001,020,000,000,100,001,000,300,000,000
-.byte 000,000,000,000,000,000,000,000,000,000,000,000,000
-.byte 106,041,040,147,040,000,063,041,001,102,160,002,002
-.byte 300,000,040,017,140,017,000,240,000,000,140,000,120
-
-bxxh:
-.byte 005,150,153,062,062,246,152,127,146,203,310,017,206
-.byte 100,000,120,000,140,000,000,100,000,000,120,000,060
-.byte 100,000,040,000,060,000,000,060,000,000,220,000,040
-.byte 100,000,120,000,200,000,000,100,000,000,140,000,060
-.byte 043,142,046,140,062,147,210,131,046,106,246,017,111
-.byte 060,000,020,000,060,000,000,040,000,000,100,000,000
-.byte 060,000,040,000,040,000,000,040,000,000,100,000,040
-.byte 100,000,100,000,100,000,000,040,000,000,100,000,140
-.byte 066,045,145,140,000,070,377,030,130,103,003,017,006
-.byte 040,000,040,000,020,000,000,040,000,000,100,000,000
-.byte 200,000,020,000,140,000,000,120,000,000,120,000,040
-.byte 120,000,040,000,060,000,000,060,000,000,160,000,040
-.byte 120,000,040,000,120,000,000,040,000,000,160,000,040
-.byte 120,000,020,000,140,000,000,120,000,000,140,000,040
-.byte 051,126,150,140,060,210,146,006,006,165,003,017,244
-.byte 120,000,040,000,160,000,000,140,000,000,060,000,140
-.byte 000,000,000,000,000,000,000,000,000,000,000,000,000
-.byte 140,000,140,000,060,000,000,100,000,000,140,000,020
-.byte 120,000,020,000,060,000,000,060,000,000,060,000,040
-.byte 140,000,020,000,100,000,000,140,000,000,140,000,020
-.byte 070,125,051,162,120,105,126,104,006,044,000,017,052
-.byte 140,000,020,000,140,000,000,060,000,000,060,000,040
-.byte 020,000,000,000,020,000,000,000,000,000,000,000,060
-.byte 140,000,160,000,200,000,000,140,000,000,000,000,240
-.byte 065,042,060,200,000,210,222,146,006,204,220,012,003
-.byte 240,000,020,000,120,000,000,200,000,000,200,000,240
-
-xhx:
-.byte 032,146,042,107,076,102,042,146,202,050,006,000,051
-.byte 036,377,057,013,057,366,377,057,001,377,057,000,040
-.byte 037,377,020,000,100,022,377,057,362,116,100,000,017
-.byte 057,377,057,031,137,363,377,037,362,270,077,000,117
-.byte 074,142,012,236,076,125,063,165,341,046,047,000,024
-.byte 020,017,075,377,040,001,377,017,001,204,020,000,040
-.byte 057,017,057,340,140,362,314,117,003,302,100,000,057
-.byte 057,357,077,017,100,366,314,057,342,346,037,000,060
-.byte 252,145,072,157,377,165,063,066,164,050,363,000,362
-.byte 000,000,020,000,020,000,000,017,000,000,020,000,000
-.byte 117,017,237,377,200,354,125,110,004,257,000,000,300
-.byte 057,367,054,357,157,216,314,114,217,353,053,000,057
-.byte 077,213,077,077,177,317,377,114,377,352,077,000,076
-.byte 077,213,077,077,157,177,377,054,377,352,117,000,075
-.byte 125,230,065,216,057,066,063,047,345,126,011,000,033
-.byte 057,377,051,360,120,361,273,056,001,256,057,000,060
-.byte 000,000,000,000,000,000,000,000,000,000,000,000,000
-.byte 076,310,056,310,137,174,273,055,335,266,033,000,155
-.byte 077,157,057,360,057,063,042,024,077,206,020,000,040
-.byte 057,037,077,360,100,365,377,037,362,176,050,000,026
-.byte 167,146,042,112,077,110,062,254,366,052,377,000,163
-.byte 060,000,040,000,120,000,377,060,012,000,037,000,257
-.byte 037,232,157,361,040,003,125,010,001,256,000,000,340
-.byte 377,377,377,377,377,377,377,377,377,377,377,017,277
-.byte 253,315,257,216,377,206,146,306,371,126,232,000,004
-.byte 057,012,100,360,160,360,000,040,000,017,157,000,176
-
-xxh:
-.byte 045,150,154,162,042,246,210,147,152,103,230,017,206
-.byte 100,000,040,000,140,000,000,100,000,021,120,017,060
-.byte 100,000,040,002,140,320,000,060,000,001,220,017,040
-.byte 100,001,120,001,241,000,000,100,000,020,140,017,060
-.byte 023,162,046,142,022,207,210,131,052,106,250,017,110
-.byte 060,000,042,000,160,000,000,040,000,212,100,017,000
-.byte 140,000,040,002,140,000,000,120,000,040,120,017,040
-.byte 100,000,100,000,140,001,021,140,000,046,100,017,140
-.byte 066,045,025,201,020,130,146,030,130,103,025,017,006
-.byte 100,000,040,000,020,000,000,040,000,000,200,017,000
-.byte 200,000,020,001,140,000,000,140,000,000,120,017,040
-.byte 120,026,042,020,140,161,042,143,000,022,162,017,040
-.byte 121,042,060,020,140,200,000,123,000,021,220,017,041
-.byte 121,042,060,120,140,200,000,123,000,021,160,017,041
-.byte 051,126,150,141,060,210,146,066,026,165,026,017,247
-.byte 120,000,040,003,160,000,000,140,000,021,100,017,140
-.byte 000,000,000,000,200,000,000,000,000,000,000,017,000
-.byte 141,023,122,040,160,143,042,142,000,047,143,017,020
-.byte 120,000,040,006,140,060,000,141,000,026,100,017,040
-.byte 140,000,020,007,100,000,000,140,000,001,140,017,020
-.byte 110,125,051,162,120,125,127,104,006,104,000,017,052
-.byte 140,000,040,000,160,000,000,140,000,000,060,017,000
-.byte 040,005,020,000,040,313,231,030,000,140,000,017,056
-.byte 140,000,160,000,200,000,000,140,000,000,000,017,240
-.byte 065,042,060,040,000,206,231,146,006,224,220,017,004
-.byte 240,000,020,000,140,000,000,220,000,000,200,017,141
-
-.even
diff --git a/.ref-Research-V7/usr/src/cmd/roff/roff8.s b/.ref-Research-V7/usr/src/cmd/roff/roff8.s
deleted file mode 100644 (file)
index 0a94bdd..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/
-/
-
-/ roff5 -- runoff
-
-slow:  1
-pto:   9999.
-po:    0
-ls:    1
-ls1:   1
-pn:    1
-ma1:   2
-ma2:   2
-ma3:   1
-ma4:   3
-ll:    65.
-llh:   65.
-hx:    1
-pl:    66.
-ad:    1
-fi:    1
-cc:    '.
-ohc:   200
-hyf:   1
-hypedf:        0
-obufp: obuf
-thresh:        240
-tabc:  ' 
-tabtab:
-       .byte 8.,16.,24.,32.,40.,48.,56.,64.,72.,80.
-       .byte 88.,96.,104.,112.,120.,128.,136.,144.,152.,160.
-       .byte 0,0,0,0,0,0,0,0,0,0
-etabtab: 0
-suffil:
-       </usr/lib/suftab\0>
-ones:
-       <ixcm>
-fives:
-       <vld>
-bfn:   </tmp/rtma\0>
-       .even
-ofile: -1
-nextb: 4
-ilistp:        ilist
-
-.bss
-old:   .=.+2
-stop:  .=.+2
-garb:  .=.+2
-bname:
-nextf: .=.+20.
-nx:    .=.+2
-ibf:   .=.+2
-ibf1:  .=.+2
-skp:   .=.+2
-ip:    .=.+2
-ilist: .=.+8.
-iliste:        .=.+2
-column:        .=.+2
-ocol:  .=.+2
-nspace:        .=.+2
-fac:   .=.+2
-fmq:   .=.+2
-nhl:   .=.+2
-nel:   .=.+2
-jfomod:        .=.+2
-wordp: .=.+2
-nlflg: .=.+2
-/tottext: .=.+2
-/totcon: .=.+2
-spaceflg: .=.+2
-ch:    .=.+2
-linep: .=.+2
-undflg:        .=.+2
-wordend:       .=.+2
-maxdig:        .=.+2
-maxloc:        .=.+2
-totout:        .=.+2
-hstart:        .=.+2
-nhstart: .=.+2
-nhyph: .=.+2
-argc:  .=.+2
-argp:  .=.+2
-ibufp: .=.+2
-eibuf: .=.+2
-wne:   .=.+2
-nl:    .=.+2
-bl:    .=.+2
-nc:    .=.+2
-ne:    .=.+2
-lnumber:       .=.+2
-numbmod:       .=.+2
-skip:  .=.+2
-nwd:   .=.+2
-ulstate:       .=.+2
-ulc:   .=.+2
-bsc:   .=.+2
-nsp:   .=.+2
-nn:    .=.+2
-ro:    .=.+2
-pfrom: .=.+2
-ni:    .=.+2
-onesp: .=.+2
-fivesp:        .=.+2
-ul:    .=.+2
-ce:    .=.+2
-in:    .=.+2
-un:    .=.+2
-wch:   .=.+2
-suff:  .=.+2
-sufb:  .=.+20.
-sufbuf:        .=.+512.
-suftab:        .=.+[2*26.]
-ifile: .=.+2
-char:  .=.+2
-nfile: .=.+2
-ehead: .=.+2
-ohead: .=.+2
-efoot: .=.+2
-ofoot: .=.+2
-trtab: .=.+128.
-word:  .=.+200.
-
-stbuf:
-linsiz = 500.
-line:  .=.+linsiz
-end:
-
diff --git a/.ref-Research-V7/usr/src/cmd/sa.c b/.ref-Research-V7/usr/src/cmd/sa.c
deleted file mode 100644 (file)
index a24e40c..0000000
+++ /dev/null
@@ -1,487 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/acct.h>
-#include <signal.h>
-
-/* interpret command time accounting */
-
-#define        size    1000
-#define        NC      sizeof(acctbuf.ac_comm)
-struct acct acctbuf;
-int    lflg;
-int    cflg;
-int    iflg;
-int    jflg;
-int    nflg;
-int    aflg;
-int    rflg;
-int    oflg;
-int    tflg;
-int    vflg;
-int    uflg;
-int    thres   = 1;
-int    sflg;
-int    bflg;
-int    mflg;
-
-struct user {
-       int     ncomm;
-       int     fill;
-       float   fctime;
-} user[256];
-
-struct tab {
-       char    name[NC];
-       int     count;
-       float   realt;
-       float   cput;
-       float   syst;
-} tab[size];
-
-float  treal;
-float  tcpu;
-float  tsys;
-int    junkp = -1;
-char   *sname;
-float  ncom;
-time_t expand();
-
-main(argc, argv)
-char **argv;
-{
-       FILE *ff;
-       int i, j, k;
-       extern tcmp(), ncmp(), bcmp();
-       extern float sum();
-       float ft;
-
-       if (argc>1)
-       if (argv[1][0]=='-') {
-               argv++;
-               argc--;
-               for(i=1; argv[0][i]; i++)
-               switch(argv[0][i]) {
-
-               case 'o':
-                       oflg++;
-                       break;
-
-               case 'i':
-                       iflg++;
-                       break;
-
-               case 'b':
-                       bflg++;
-                       break;
-
-               case 'l':
-                       lflg++;
-                       break;
-
-               case 'c':
-                       cflg++;
-                       break;
-
-               case 'j':
-                       jflg++;
-                       break;
-
-               case 'n':
-                       nflg++;
-                       break;
-
-               case 'a':
-                       aflg++;
-                       break;
-
-               case 'r':
-                       rflg++;
-                       break;
-
-               case 't':
-                       tflg++;
-                       break;
-
-               case 's':
-                       sflg++;
-                       aflg++;
-                       break;
-
-               case '0':
-               case '1':
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-               case '9':
-                       thres = argv[0][i]-'0';
-                       break;
-
-               case 'v':
-                       vflg++;
-                       break;
-
-               case 'u':
-                       uflg++;
-                       break;
-
-               case 'm':
-                       mflg++;
-                       break;
-               }
-       }
-       if (iflg==0)
-               init();
-       if (argc<2)
-               doacct("/usr/adm/acct");
-       else while (--argc)
-               doacct(*++argv);
-       if (uflg) {
-               return;
-       }
-
-/*
- * cleanup pass
- * put junk together
- */
-
-       if (vflg)
-               strip();
-       if(!aflg)
-       for (i=0; i<size; i++)
-       if (tab[i].name[0]) {
-               for(j=0; j<NC; j++)
-                       if(tab[i].name[j] == '?')
-                               goto yes;
-               if(tab[i].count != 1)
-                       continue;
-       yes:
-               if(junkp == -1)
-                       junkp = enter("***other");
-               tab[junkp].count += tab[i].count;
-               tab[junkp].realt += tab[i].realt;
-               tab[junkp].cput += tab[i].cput;
-               tab[junkp].syst += tab[i].syst;
-               tab[i].name[0] = 0;
-       }
-       for(i=k=0; i<size; i++)
-       if(tab[i].name[0]) {
-               for(j=0; j<NC; j++)
-                       tab[k].name[j] = tab[i].name[j];
-               tab[k].count = tab[i].count;
-               tab[k].realt = tab[i].realt;
-               tab[k].cput = tab[i].cput;
-               tab[k].syst = tab[i].syst;
-               k++;
-       }
-       if (sflg) {
-               signal(SIGINT, SIG_IGN);
-               if ((ff = fopen("/usr/adm/usracct", "w")) != NULL) {
-                       fwrite((char *)user, sizeof(user), 1, ff);
-                       fclose(ff);
-               }
-               if ((ff = fopen("/usr/adm/savacct", "w")) == NULL) {
-                       printf("Can't save\n");
-                       exit(0);
-               }
-               fwrite((char *)tab, sizeof(tab[0]), k, ff);
-               fclose(ff);
-               signal(SIGINT, SIG_DFL);
-       }
-/*
- * sort and print
- */
-
-       if (mflg) {
-               printmoney();
-               exit(0);
-       }
-       qsort(tab, k, sizeof(tab[0]), nflg? ncmp: (bflg?bcmp:tcmp));
-       column(ncom, treal, tcpu, tsys);
-       printf("\n");
-       for (i=0; i<k; i++)
-       if (tab[i].name[0]) {
-               ft = tab[i].count;
-               column(ft, tab[i].realt, tab[i].cput, tab[i].syst);
-               printf("   %.10s\n", tab[i].name);
-       }
-}
-
-printmoney()
-{
-       register i;
-       char buf[128];
-       register char *cp;
-
-       for (i=0; i<256; i++) {
-               if (user[i].ncomm) {
-                       if (getpw(i, buf)!=0)
-                               printf("%-8d", i);
-                       else {
-                               cp = buf;
-                               while (*cp!=':' &&*cp!='\n' && *cp)
-                                       cp++;
-                               *cp = 0;
-                               printf("%-8s", buf);
-                       }
-                       printf("%5u %7.2f\n",
-                           user[i].ncomm, user[i].fctime/60);
-               }
-       }
-}
-
-column(n, a, b, c)
-double n, a, b, c;
-{
-
-       printf("%6.0f", n);
-       if(cflg) {
-               if(n == ncom)
-                       printf("%7s", ""); else
-                       printf("%6.2f%%", 100.*n/ncom);
-       }
-       col(n, a, treal);
-       if (oflg)
-               col(n, 3600*(b/(b+c)), tcpu+tsys);
-       else if(lflg) {
-               col(n, b, tcpu);
-               col(n, c, tsys);
-       } else
-               col(n, b+c, tcpu+tsys);
-       if(tflg)
-               printf("%6.1f", a/(b+c));
-}
-
-col(n, a, m)
-double n, a, m;
-{
-
-       if(jflg)
-               printf("%9.2f", a/(n*60.)); else
-               printf("%9.2f", a/3600.);
-       if(cflg) {
-               if(a == m)
-                       printf("%7s", ""); else
-                       printf("%6.2f%%", 100.*a/m);
-       }
-}
-
-doacct(f)
-char *f;
-{
-       int i;
-       FILE *ff;
-       long x;
-       struct acct fbuf;
-       register char *cp;
-       register int c;
-
-       if (sflg && sname) {
-               printf("Only 1 file with -s\n");
-               exit(0);
-       }
-       if (sflg)
-               sname = f;
-       if ((ff = fopen(f, "r"))==NULL) {
-               printf("Can't open %s\n", f);
-               return;
-       }
-       while (fread((char *)&fbuf, sizeof(fbuf), 1, ff) == 1) {
-               if (fbuf.ac_comm[0]==0) {
-                       fbuf.ac_comm[0] = '?';
-               }
-               for (cp = fbuf.ac_comm; cp < &fbuf.ac_comm[NC]; cp++) {
-                       c = *cp & 0377;
-                       if (c && (c < ' ' || c >= 0200)) {
-                               *cp = '?';
-                       }
-               }
-               if (fbuf.ac_flag&AFORK) {
-                       for (cp=fbuf.ac_comm; cp < &fbuf.ac_comm[NC]; cp++)
-                               if (*cp==0) {
-                                       *cp = '*';
-                                       break;
-                               }
-               }
-               x = expand(fbuf.ac_utime) + expand(fbuf.ac_stime);
-               if (uflg) {
-                       printf("%3d%6.1f %.10s\n", fbuf.ac_uid&0377, x/60.0,
-                          fbuf.ac_comm);
-                       continue;
-               }
-               c = fbuf.ac_uid&0377;
-               user[c].ncomm++;
-               user[c].fctime += x/60.;
-               ncom += 1.0;
-               i = enter(fbuf.ac_comm);
-               tab[i].count++;
-               x = expand(fbuf.ac_etime)*60;
-               tab[i].realt += x;
-               treal += x;
-               x = expand(fbuf.ac_utime);
-               tab[i].cput += x;
-               tcpu += x;
-               x = expand(fbuf.ac_stime);
-               tab[i].syst += x;
-               tsys += x;
-       }
-       fclose(ff);
-}
-
-ncmp(p1, p2)
-struct tab *p1, *p2;
-{
-
-       if(p1->count == p2->count)
-               return(tcmp(p1, p2));
-       if(rflg)
-               return(p1->count - p2->count);
-       return(p2->count - p1->count);
-}
-
-bcmp(p1, p2)
-struct tab *p1, *p2;
-{
-       float f1, f2;
-       float sum();
-
-       f1 = sum(p1)/p1->count;
-       f2 = sum(p2)/p2->count;
-       if(f1 < f2) {
-               if(rflg)
-                       return(-1);
-               return(1);
-       }
-       if(f1 > f2) {
-               if(rflg)
-                       return(1);
-               return(-1);
-       }
-       return(0);
-}
-tcmp(p1, p2)
-struct tab *p1, *p2;
-{
-       extern float sum();
-       float f1, f2;
-
-       f1 = sum(p1);
-       f2 = sum(p2);
-       if(f1 < f2) {
-               if(rflg)
-                       return(-1);
-               return(1);
-       }
-       if(f1 > f2) {
-               if(rflg)
-                       return(1);
-               return(-1);
-       }
-       return(0);
-}
-
-float sum(p)
-struct tab *p;
-{
-
-       if(p->name[0] == 0)
-               return(0.0);
-       return(
-               p->cput+
-               p->syst);
-}
-
-init()
-{
-       struct tab tbuf;
-       int i;
-       FILE *f;
-
-       if ((f = fopen("/usr/adm/savacct", "r")) == NULL)
-               goto gshm;
-       while (fread((char *)&tbuf, sizeof(tbuf), 1, f) == 1) {
-               i = enter(tbuf.name);
-               ncom += tbuf.count;
-               tab[i].count = tbuf.count;
-               treal += tbuf.realt;
-               tab[i].realt = tbuf.realt;
-               tcpu += tbuf.cput;
-               tab[i].cput = tbuf.cput;
-               tsys += tbuf.syst;
-               tab[i].syst = tbuf.syst;
-       }
-       fclose(f);
- gshm:
-       if ((f = fopen("/usr/adm/usracct", "r")) == NULL)
-               return;
-       fread((char *)user, sizeof(user), 1, f);
-       fclose(f);
-}
-
-enter(np)
-char *np;
-{
-       int i, j;
-
-       for (i=j=0; i<NC; i++) {
-               if (np[i]==0)
-                       j = i;
-               if (j)
-                       np[i] = 0;
-       }
-       for (i=j=0; j<NC; j++) {
-               i = i*7 + np[j];
-       }
-       if (i < 0)
-               i = -i;
-       for (i%=size; tab[i].name[0]; i = (i+1)%size) {
-               for (j=0; j<NC; j++)
-                       if (tab[i].name[j]!=np[j])
-                               goto no;
-               goto yes;
-       no:;
-       }
-       for (j=0; j<NC; j++)
-               tab[i].name[j] = np[j];
-yes:
-       return(i);
-}
-
-strip()
-{
-       int i, j, c;
-
-       j = enter("**junk**");
-       for (i = 0; i<size; i++) {
-               if (tab[i].name[0] && tab[i].count<=thres) {
-                       printf("%.10s--", tab[i].name);
-                       if ((c=getchar())=='y') {
-                               tab[i].name[0] = '\0';
-                               tab[j].count += tab[i].count;
-                               tab[j].realt += tab[i].realt;
-                               tab[j].cput += tab[i].cput;
-                               tab[j].syst += tab[i].syst;
-                       }
-                       while (c && c!='\n')
-                               c = getchar();
-               }
-       }
-}
-
-time_t
-expand(t)
-unsigned t;
-{
-       register time_t nt;
-
-       nt = t&017777;
-       t >>= 13;
-       while (t!=0) {
-               t--;
-               nt <<= 3;
-       }
-       return(nt);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sed/makefile b/.ref-Research-V7/usr/src/cmd/sed/makefile
deleted file mode 100644 (file)
index affa51f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-CFLAGS = -n -O
-
-all:   sed
-       :
-
-cp:    all
-       cp sed /bin
-       rm sed *.o
-
-cmp:   all
-       cmp sed /bin/sed
-       rm sed *.o
-
-sed:   sed0.o sed1.o; cc -s -o sed -n *.o
-
-sed0.o: sed0.c sed.h
-sed1.o: sed1.c sed.h
diff --git a/.ref-Research-V7/usr/src/cmd/sed/sed.h b/.ref-Research-V7/usr/src/cmd/sed/sed.h
deleted file mode 100644 (file)
index d64de3d..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-#
-/*
- * sed -- stream  editor
- *
- *
- */
-
-#define CBRA   1
-#define        CCHR    2
-#define        CDOT    4
-#define        CCL     6
-#define        CNL     8
-#define        CDOL    10
-#define        CEOF    11
-#define CKET   12
-#define CNULL  13
-#define CLNUM  14
-#define CEND   16
-#define CDONT  17
-#define        CBACK   18
-
-#define        STAR    01
-
-#define NLINES 256
-#define        DEPTH   20
-#define PTRSIZE        100
-#define RESIZE 5000
-#define        ABUFSIZE        20
-#define        LBSIZE  4000
-#define        ESIZE   256
-#define        LABSIZE 50
-#define NBRA   9
-
-FILE   *fin;
-union reptr    *abuf[ABUFSIZE];
-union reptr **aptr;
-char   *lastre;
-char   ibuf[512];
-char   *cbp;
-char   *ebp;
-char   genbuf[LBSIZE];
-char   *loc1;
-char   *loc2;
-char   *locs;
-char   seof;
-char   *reend;
-char   *lbend;
-char   *hend;
-char   *lcomend;
-union reptr    *ptrend;
-int    eflag;
-int    dolflag;
-int    sflag;
-int    jflag;
-int    numbra;
-int    delflag;
-long   lnum;
-char   linebuf[LBSIZE+1];
-char   holdsp[LBSIZE+1];
-char   *spend;
-char   *hspend;
-int    nflag;
-int    gflag;
-char   *braelist[NBRA];
-char   *braslist[NBRA];
-long   tlno[NLINES];
-int    nlno;
-char   fname[12][40];
-FILE   *fcode[12];
-int    nfiles;
-
-#define ACOM   01
-#define BCOM   020
-#define CCOM   02
-#define        CDCOM   025
-#define        CNCOM   022
-#define COCOM  017
-#define        CPCOM   023
-#define DCOM   03
-#define ECOM   015
-#define EQCOM  013
-#define FCOM   016
-#define GCOM   027
-#define CGCOM  030
-#define HCOM   031
-#define CHCOM  032
-#define ICOM   04
-#define LCOM   05
-#define NCOM   012
-#define PCOM   010
-#define QCOM   011
-#define RCOM   06
-#define SCOM   07
-#define TCOM   021
-#define WCOM   014
-#define        CWCOM   024
-#define        YCOM    026
-#define XCOM   033
-
-char   *cp;
-char   *reend;
-char   *lbend;
-
-union  reptr {
-       struct reptr1 {
-               char    *ad1;
-               char    *ad2;
-               char    *re1;
-               char    *rhs;
-               FILE    *fcode;
-               char    command;
-               char    gfl;
-               char    pfl;
-               char    inar;
-               char    negfl;
-       };
-       struct reptr2 {
-               char    *ad1;
-               char    *ad2;
-               union reptr     *lb1;
-               char    *rhs;
-               FILE    *fcode;
-               char    command;
-               char    gfl;
-               char    pfl;
-               char    inar;
-               char    negfl;
-       };
-} ptrspace[PTRSIZE], *rep;
-
-
-char   respace[RESIZE];
-
-struct label {
-       char    asc[9];
-       union reptr     *chain;
-       union reptr     *address;
-} ltab[LABSIZE];
-
-struct label   *lab;
-struct label   *labend;
-
-int    f;
-int    depth;
-
-int    eargc;
-char   **eargv;
-
-extern char    bittab[];
-
-union reptr    **cmpend[DEPTH];
-int    depth;
-union reptr    *pending;
-char   *badp;
-char   bad;
-char   *compile();
-char   *ycomp();
-char   *address();
-char   *text();
-char   *compsub();
-struct label   *search();
-char   *gline();
-char   *place();
-char   compfl;
diff --git a/.ref-Research-V7/usr/src/cmd/sed/sed0.c b/.ref-Research-V7/usr/src/cmd/sed/sed0.c
deleted file mode 100644 (file)
index c2f27c3..0000000
+++ /dev/null
@@ -1,969 +0,0 @@
-#include <stdio.h>
-#include "sed.h"
-
-struct label   *labtab = ltab;
-char   CGMES[] = "command garbled: %s\n";
-char   TMMES[] = "Too much text: %s\n";
-char   LTL[]   = "Label too long: %s\n";
-char   AD0MES[]        = "No addresses allowed: %s\n";
-char   AD1MES[]        = "Only one address allowed: %s\n";
-char   bittab[]  = {
-               1,
-               2,
-               4,
-               8,
-               16,
-               32,
-               64,
-               128
-       };
-
-main(argc, argv)
-char   *argv[];
-{
-
-       eargc = argc;
-       eargv = argv;
-
-       badp = &bad;
-       aptr = abuf;
-       lab = labtab + 1;       /* 0 reserved for end-pointer */
-       rep = ptrspace;
-       rep->ad1 = respace;
-       lbend = &linebuf[LBSIZE];
-       hend = &holdsp[LBSIZE];
-       lcomend = &genbuf[71];
-       ptrend = &ptrspace[PTRSIZE];
-       reend = &respace[RESIZE];
-       labend = &labtab[LABSIZE];
-       lnum = 0;
-       pending = 0;
-       depth = 0;
-       spend = linebuf;
-       hspend = holdsp;
-       fcode[0] = stdout;
-       nfiles = 1;
-
-       if(eargc == 1)
-               exit(0);
-
-
-       while (--eargc > 0 && (++eargv)[0][0] == '-')
-               switch (eargv[0][1]) {
-
-               case 'n':
-                       nflag++;
-                       continue;
-
-               case 'f':
-                       if(eargc-- <= 0)        exit(2);
-
-                       if((fin = fopen(*++eargv, "r")) == NULL) {
-                               fprintf(stderr, "Cannot open pattern-file: %s\n", *eargv);
-                               exit(2);
-                       }
-
-                       fcomp();
-                       fclose(fin);
-                       continue;
-
-               case 'e':
-                       eflag++;
-                       fcomp();
-                       eflag = 0;
-                       continue;
-
-               case 'g':
-                       gflag++;
-                       continue;
-
-               default:
-                       fprintf(stdout, "Unknown flag: %c\n", eargv[0][1]);
-                       continue;
-               }
-
-
-       if(compfl == 0) {
-               eargv--;
-               eargc++;
-               eflag++;
-               fcomp();
-               eargv++;
-               eargc--;
-               eflag = 0;
-       }
-
-       if(depth) {
-               fprintf(stderr, "Too many {'s");
-               exit(2);
-       }
-
-       labtab->address = rep;
-
-       dechain();
-
-/*     abort();        /*DEBUG*/
-
-       if(eargc <= 0)
-               execute((char *)NULL);
-       else while(--eargc >= 0) {
-               execute(*eargv++);
-       }
-       fclose(stdout);
-       exit(0);
-}
-fcomp()
-{
-
-       register char   *p, *op, *tp;
-       char    *address();
-       union reptr     *pt, *pt1;
-       int     i;
-       struct label    *lpt;
-
-       compfl = 1;
-       op = lastre;
-
-       if(rline(linebuf) < 0)  return;
-       if(*linebuf == '#') {
-               if(linebuf[1] == 'n')
-                       nflag = 1;
-       }
-       else {
-               cp = linebuf;
-               goto comploop;
-       }
-
-       for(;;) {
-               if(rline(linebuf) < 0)  break;
-
-               cp = linebuf;
-
-comploop:
-/*     fprintf(stdout, "cp: %s\n", cp);        /*DEBUG*/
-               while(*cp == ' ' || *cp == '\t')        cp++;
-               if(*cp == '\0' || *cp == '#')           continue;
-               if(*cp == ';') {
-                       cp++;
-                       goto comploop;
-               }
-
-               p = address(rep->ad1);
-               if(p == badp) {
-                       fprintf(stderr, CGMES, linebuf);
-                       exit(2);
-               }
-
-               if(p == rep->ad1) {
-                       if(op)
-                               rep->ad1 = op;
-                       else {
-                               fprintf(stderr, "First RE may not be null\n");
-                               exit(2);
-                       }
-               } else if(p == 0) {
-                       p = rep->ad1;
-                       rep->ad1 = 0;
-               } else {
-                       op = rep->ad1;
-                       if(*cp == ',' || *cp == ';') {
-                               cp++;
-                               if((rep->ad2 = p) > reend) {
-                                       fprintf(stderr, TMMES, linebuf);
-                                       exit(2);
-                               }
-                               p = address(rep->ad2);
-                               if(p == badp || p == 0) {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               if(p == rep->ad2)
-                                       rep->ad2 = op;
-                               else
-                                       op = rep->ad2;
-
-                       } else
-                               rep->ad2 = 0;
-               }
-
-               if(p > reend) {
-                       fprintf(stderr, "Too much text: %s\n", linebuf);
-                       exit(2);
-               }
-
-               while(*cp == ' ' || *cp == '\t')        cp++;
-
-swit:
-               switch(*cp++) {
-
-                       default:
-                               fprintf(stderr, "Unrecognized command: %s\n", linebuf);
-                               exit(2);
-
-                       case '!':
-                               rep->negfl = 1;
-                               goto swit;
-
-                       case '{':
-                               rep->command = BCOM;
-                               rep->negfl = !(rep->negfl);
-                               cmpend[depth++] = &rep->lb1;
-                               if(++rep >= ptrend) {
-                                       fprintf(stderr, "Too many commands: %s\n", linebuf);
-                                       exit(2);
-                               }
-                               rep->ad1 = p;
-                               if(*cp == '\0') continue;
-
-                               goto comploop;
-
-                       case '}':
-                               if(rep->ad1) {
-                                       fprintf(stderr, AD0MES, linebuf);
-                                       exit(2);
-                               }
-
-                               if(--depth < 0) {
-                                       fprintf(stderr, "Too many }'s\n");
-                                       exit(2);
-                               }
-                               *cmpend[depth] = rep;
-
-                               rep->ad1 = p;
-                               continue;
-
-                       case '=':
-                               rep->command = EQCOM;
-                               if(rep->ad2) {
-                                       fprintf(stderr, AD1MES, linebuf);
-                                       exit(2);
-                               }
-                               break;
-
-                       case ':':
-                               if(rep->ad1) {
-                                       fprintf(stderr, AD0MES, linebuf);
-                                       exit(2);
-                               }
-
-                               while(*cp++ == ' ');
-                               cp--;
-
-
-                               tp = lab->asc;
-                               while((*tp++ = *cp++))
-                                       if(tp >= &(lab->asc[8])) {
-                                               fprintf(stderr, LTL, linebuf);
-                                               exit(2);
-                                       }
-                               *--tp = '\0';
-
-                               if(lpt = search(lab)) {
-                                       if(lpt->address) {
-                                               fprintf(stderr, "Duplicate labels: %s\n", linebuf);
-                                               exit(2);
-                                       }
-                               } else {
-                                       lab->chain = 0;
-                                       lpt = lab;
-                                       if(++lab >= labend) {
-                                               fprintf(stderr, "Too many labels: %s\n", linebuf);
-                                               exit(2);
-                                       }
-                               }
-                               lpt->address = rep;
-                               rep->ad1 = p;
-
-                               continue;
-
-                       case 'a':
-                               rep->command = ACOM;
-                               if(rep->ad2) {
-                                       fprintf(stderr, AD1MES, linebuf);
-                                       exit(2);
-                               }
-                               if(*cp == '\\') cp++;
-                               if(*cp++ != '\n') {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               rep->re1 = p;
-                               p = text(rep->re1);
-                               break;
-                       case 'c':
-                               rep->command = CCOM;
-                               if(*cp == '\\') cp++;
-                               if(*cp++ != ('\n')) {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               rep->re1 = p;
-                               p = text(rep->re1);
-                               break;
-                       case 'i':
-                               rep->command = ICOM;
-                               if(rep->ad2) {
-                                       fprintf(stderr, AD1MES, linebuf);
-                                       exit(2);
-                               }
-                               if(*cp == '\\') cp++;
-                               if(*cp++ != ('\n')) {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               rep->re1 = p;
-                               p = text(rep->re1);
-                               break;
-
-                       case 'g':
-                               rep->command = GCOM;
-                               break;
-
-                       case 'G':
-                               rep->command = CGCOM;
-                               break;
-
-                       case 'h':
-                               rep->command = HCOM;
-                               break;
-
-                       case 'H':
-                               rep->command = CHCOM;
-                               break;
-
-                       case 't':
-                               rep->command = TCOM;
-                               goto jtcommon;
-
-                       case 'b':
-                               rep->command = BCOM;
-jtcommon:
-                               while(*cp++ == ' ');
-                               cp--;
-
-                               if(*cp == '\0') {
-                                       if(pt = labtab->chain) {
-                                               while(pt1 = pt->lb1)
-                                                       pt = pt1;
-                                               pt->lb1 = rep;
-                                       } else
-                                               labtab->chain = rep;
-                                       break;
-                               }
-                               tp = lab->asc;
-                               while((*tp++ = *cp++))
-                                       if(tp >= &(lab->asc[8])) {
-                                               fprintf(stderr, LTL, linebuf);
-                                               exit(2);
-                                       }
-                               cp--;
-                               *--tp = '\0';
-
-                               if(lpt = search(lab)) {
-                                       if(lpt->address) {
-                                               rep->lb1 = lpt->address;
-                                       } else {
-                                               pt = lpt->chain;
-                                               while(pt1 = pt->lb1)
-                                                       pt = pt1;
-                                               pt->lb1 = rep;
-                                       }
-                               } else {
-                                       lab->chain = rep;
-                                       lab->address = 0;
-                                       if(++lab >= labend) {
-                                               fprintf(stderr, "Too many labels: %s\n", linebuf);
-                                               exit(2);
-                                       }
-                               }
-                               break;
-
-                       case 'n':
-                               rep->command = NCOM;
-                               break;
-
-                       case 'N':
-                               rep->command = CNCOM;
-                               break;
-
-                       case 'p':
-                               rep->command = PCOM;
-                               break;
-
-                       case 'P':
-                               rep->command = CPCOM;
-                               break;
-
-                       case 'r':
-                               rep->command = RCOM;
-                               if(rep->ad2) {
-                                       fprintf(stderr, AD1MES, linebuf);
-                                       exit(2);
-                               }
-                               if(*cp++ != ' ') {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               rep->re1 = p;
-                               p = text(rep->re1);
-                               break;
-
-                       case 'd':
-                               rep->command = DCOM;
-                               break;
-
-                       case 'D':
-                               rep->command = CDCOM;
-                               rep->lb1 = ptrspace;
-                               break;
-
-                       case 'q':
-                               rep->command = QCOM;
-                               if(rep->ad2) {
-                                       fprintf(stderr, AD1MES, linebuf);
-                                       exit(2);
-                               }
-                               break;
-
-                       case 'l':
-                               rep->command = LCOM;
-                               break;
-
-                       case 's':
-                               rep->command = SCOM;
-                               seof = *cp++;
-                               rep->re1 = p;
-                               p = compile(rep->re1);
-                               if(p == badp) {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               if(p == rep->re1) {
-                                       rep->re1 = op;
-                               } else {
-                                       op = rep->re1;
-                               }
-
-                               if((rep->rhs = p) > reend) {
-                                       fprintf(stderr, TMMES, linebuf);
-                                       exit(2);
-                               }
-
-                               if((p = compsub(rep->rhs)) == badp) {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               if(*cp == 'g') {
-                                       cp++;
-                                       rep->gfl++;
-                               } else if(gflag)
-                                       rep->gfl++;
-
-                               if(*cp == 'p') {
-                                       cp++;
-                                       rep->pfl = 1;
-                               }
-
-                               if(*cp == 'P') {
-                                       cp++;
-                                       rep->pfl = 2;
-                               }
-
-                               if(*cp == 'w') {
-                                       cp++;
-                                       if(*cp++ !=  ' ') {
-                                               fprintf(stderr, CGMES, linebuf);
-                                               exit(2);
-                                       }
-                                       if(nfiles >= 10) {
-                                               fprintf(stderr, "Too many files in w commands\n");
-                                               exit(2);
-                                       }
-
-                                       text(fname[nfiles]);
-                                       for(i = nfiles - 1; i >= 0; i--)
-                                               if(cmp(fname[nfiles],fname[i]) == 0) {
-                                                       rep->fcode = fcode[i];
-                                                       goto done;
-                                               }
-                                       if((rep->fcode = fopen(fname[nfiles], "w")) == NULL) {
-                                               fprintf(stderr, "cannot open %s\n", fname[nfiles]);
-                                               exit(2);
-                                       }
-                                       fcode[nfiles++] = rep->fcode;
-                               }
-                               break;
-
-                       case 'w':
-                               rep->command = WCOM;
-                               if(*cp++ != ' ') {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               if(nfiles >= 10){
-                                       fprintf(stderr, "Too many files in w commands\n");
-                                       exit(2);
-                               }
-
-                               text(fname[nfiles]);
-                               for(i = nfiles - 1; i >= 0; i--)
-                                       if(cmp(fname[nfiles], fname[i]) == 0) {
-                                               rep->fcode = fcode[i];
-                                               goto done;
-                                       }
-
-                               if((rep->fcode = fopen(fname[nfiles], "w")) == NULL) {
-                                       fprintf(stderr, "Cannot create %s\n", fname[nfiles]);
-                                       exit(2);
-                               }
-                               fcode[nfiles++] = rep->fcode;
-                               break;
-
-                       case 'x':
-                               rep->command = XCOM;
-                               break;
-
-                       case 'y':
-                               rep->command = YCOM;
-                               seof = *cp++;
-                               rep->re1 = p;
-                               p = ycomp(rep->re1);
-                               if(p == badp) {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               if(p > reend) {
-                                       fprintf(stderr, TMMES, linebuf);
-                                       exit(2);
-                               }
-                               break;
-
-               }
-done:
-               if(++rep >= ptrend) {
-                       fprintf(stderr, "Too many commands, last: %s\n", linebuf);
-                       exit(2);
-               }
-
-               rep->ad1 = p;
-
-               if(*cp++ != '\0') {
-                       if(cp[-1] == ';')
-                               goto comploop;
-                       fprintf(stderr, CGMES, linebuf);
-                       exit(2);
-               }
-
-       }
-       rep->command = 0;
-       lastre = op;
-}
-char   *compsub(rhsbuf)
-char   *rhsbuf;
-{
-       register char   *p, *q;
-
-       p = rhsbuf;
-       q = cp;
-       for(;;) {
-               if((*p = *q++) == '\\') {
-                       *p = *q++;
-                       if(*p > numbra + '0' && *p <= '9')
-                               return(badp);
-                       *p++ |= 0200;
-                       continue;
-               }
-               if(*p == seof) {
-                       *p++ = '\0';
-                       cp = q;
-                       return(p);
-               }
-               if(*p++ == '\0') {
-                       return(badp);
-               }
-
-       }
-}
-
-char *compile(expbuf)
-char   *expbuf;
-{
-       register c;
-       register char *ep, *sp;
-       char    neg;
-       char *lastep, *cstart;
-       int cclcnt;
-       int     closed;
-       char    bracket[NBRA], *bracketp;
-
-       if(*cp == seof) {
-               cp++;
-               return(expbuf);
-       }
-
-       ep = expbuf;
-       lastep = 0;
-       bracketp = bracket;
-       closed = numbra = 0;
-       sp = cp;
-       if (*sp == '^') {
-               *ep++ = 1;
-               sp++;
-       } else {
-               *ep++ = 0;
-       }
-       for (;;) {
-               if (ep >= &expbuf[ESIZE]) {
-                       cp = sp;
-                       return(badp);
-               }
-               if((c = *sp++) == seof) {
-                       if(bracketp != bracket) {
-                               cp = sp;
-                               return(badp);
-                       }
-                       cp = sp;
-                       *ep++ = CEOF;
-                       return(ep);
-               }
-               if(c != '*')
-                       lastep = ep;
-               switch (c) {
-
-               case '\\':
-                       if((c = *sp++) == '(') {
-                               if(numbra >= NBRA) {
-                                       cp = sp;
-                                       return(badp);
-                               }
-                               *bracketp++ = numbra;
-                               *ep++ = CBRA;
-                               *ep++ = numbra++;
-                               continue;
-                       }
-                       if(c == ')') {
-                               if(bracketp <= bracket) {
-                                       cp = sp;
-                                       return(badp);
-                               }
-                               *ep++ = CKET;
-                               *ep++ = *--bracketp;
-                               closed++;
-                               continue;
-                       }
-
-                       if(c >= '1' && c <= '9') {
-                               if((c -= '1') >= closed)
-                                       return(badp);
-       
-                               *ep++ = CBACK;
-                               *ep++ = c;
-                               continue;
-                       }
-                       if(c == '\n') {
-                               cp = sp;
-                               return(badp);
-                       }
-                       if(c == 'n') {
-                               c = '\n';
-                       }
-                       goto defchar;
-
-               case '\0':
-                       continue;
-               case '\n':
-                       cp = sp;
-                       return(badp);
-
-               case '.':
-                       *ep++ = CDOT;
-                       continue;
-
-               case '*':
-                       if (lastep == 0)
-                               goto defchar;
-                       if(*lastep == CKET) {
-                               cp = sp;
-                               return(badp);
-                       }
-                       *lastep |= STAR;
-                       continue;
-
-               case '$':
-                       if (*sp != seof)
-                               goto defchar;
-                       *ep++ = CDOL;
-                       continue;
-
-               case '[':
-                       if(&ep[17] >= &expbuf[ESIZE]) {
-                               fprintf(stderr, "RE too long: %s\n", linebuf);
-                               exit(2);
-                       }
-
-                       *ep++ = CCL;
-
-                       neg = 0;
-                       if((c = *sp++) == '^') {
-                               neg = 1;
-                               c = *sp++;
-                       }
-
-                       cstart = sp;
-                       do {
-                               if(c == '\0') {
-                                       fprintf(stderr, CGMES, linebuf);
-                                       exit(2);
-                               }
-                               if (c=='-' && sp>cstart && *sp!=']') {
-                                       for (c = sp[-2]; c<*sp; c++)
-                                               ep[c>>3] |= bittab[c&07];
-                               }
-                               if(c == '\\') {
-                                       switch(c = *sp++) {
-                                               case 'n':
-                                                       c = '\n';
-                                                       break;
-                                       }
-                               }
-
-                               ep[c >> 3] |= bittab[c & 07];
-                       } while((c = *sp++) != ']');
-
-                       if(neg)
-                               for(cclcnt = 0; cclcnt < 16; cclcnt++)
-                                       ep[cclcnt] ^= -1;
-                       ep[0] &= 0376;
-
-                       ep += 16;
-
-                       continue;
-
-               defchar:
-               default:
-                       *ep++ = CCHR;
-                       *ep++ = c;
-               }
-       }
-}
-rline(lbuf)
-char   *lbuf;
-{
-       register char   *p, *q;
-       register        t;
-       static char     *saveq;
-
-       p = lbuf - 1;
-
-       if(eflag) {
-               if(eflag > 0) {
-                       eflag = -1;
-                       if(eargc-- <= 0)
-                               exit(2);
-                       q = *++eargv;
-                       while(*++p = *q++) {
-                               if(*p == '\\') {
-                                       if((*++p = *q++) == '\0') {
-                                               saveq = 0;
-                                               return(-1);
-                                       } else
-                                               continue;
-                               }
-                               if(*p == '\n') {
-                                       *p = '\0';
-                                       saveq = q;
-                                       return(1);
-                               }
-                       }
-                       saveq = 0;
-                       return(1);
-               }
-               if((q = saveq) == 0)    return(-1);
-
-               while(*++p = *q++) {
-                       if(*p == '\\') {
-                               if((*++p = *q++) == '0') {
-                                       saveq = 0;
-                                       return(-1);
-                               } else
-                                       continue;
-                       }
-                       if(*p == '\n') {
-                               *p = '\0';
-                               saveq = q;
-                               return(1);
-                       }
-               }
-               saveq = 0;
-               return(1);
-       }
-
-       while((t = getc(fin)) != EOF) {
-               *++p = t;
-               if(*p == '\\') {
-                       t = getc(fin);
-                       *++p = t;
-               }
-               else if(*p == '\n') {
-                       *p = '\0';
-                       return(1);
-               }
-       }
-       *++p = '\0';
-       return(-1);
-}
-
-char   *address(expbuf)
-char   *expbuf;
-{
-       register char   *rcp;
-       long    lno;
-
-       if(*cp == '$') {
-               cp++;
-               *expbuf++ = CEND;
-               *expbuf++ = CEOF;
-               return(expbuf);
-       }
-
-       if(*cp == '/') {
-               seof = '/';
-               cp++;
-               return(compile(expbuf));
-       }
-
-       rcp = cp;
-       lno = 0;
-
-       while(*rcp >= '0' && *rcp <= '9')
-               lno = lno*10 + *rcp++ - '0';
-
-       if(rcp > cp) {
-               *expbuf++ = CLNUM;
-               *expbuf++ = nlno;
-               tlno[nlno++] = lno;
-               if(nlno >= NLINES) {
-                       fprintf(stderr, "Too many line numbers\n");
-                       exit(2);
-               }
-               *expbuf++ = CEOF;
-               cp = rcp;
-               return(expbuf);
-       }
-       return(0);
-}
-cmp(a, b)
-char   *a,*b;
-{
-       register char   *ra, *rb;
-
-       ra = a - 1;
-       rb = b - 1;
-
-       while(*++ra == *++rb)
-               if(*ra == '\0') return(0);
-       return(1);
-}
-
-char   *text(textbuf)
-char   *textbuf;
-{
-       register char   *p, *q;
-
-       p = textbuf;
-       q = cp;
-       while(*q == '\t' || *q == ' ')  q++;
-       for(;;) {
-
-               if((*p = *q++) == '\\')
-                       *p = *q++;
-               if(*p == '\0') {
-                       cp = --q;
-                       return(++p);
-               }
-               if(*p == '\n') {
-                       while(*q == '\t' || *q == ' ')  q++;
-               }
-               p++;
-       }
-}
-
-
-struct label   *search(ptr)
-struct label   *ptr;
-{
-       struct label    *rp;
-
-       rp = labtab;
-       while(rp < ptr) {
-               if(cmp(rp->asc, ptr->asc) == 0)
-                       return(rp);
-               rp++;
-       }
-
-       return(0);
-}
-
-
-dechain()
-{
-       struct label    *lptr;
-       union reptr     *rptr, *trptr;
-
-       for(lptr = labtab; lptr < lab; lptr++) {
-
-               if(lptr->address == 0) {
-                       fprintf(stderr, "Undefined label: %s\n", lptr->asc);
-                       exit(2);
-               }
-
-               if(lptr->chain) {
-                       rptr = lptr->chain;
-                       while(trptr = rptr->lb1) {
-                               rptr->lb1 = lptr->address;
-                               rptr = trptr;
-                       }
-                       rptr->lb1 = lptr->address;
-               }
-       }
-}
-
-char *ycomp(expbuf)
-char   *expbuf;
-{
-       register char   c, *ep, *tsp;
-       char    *sp;
-
-       ep = expbuf;
-       sp = cp;
-       for(tsp = cp; *tsp != seof; tsp++) {
-               if(*tsp == '\\')
-                       tsp++;
-               if(*tsp == '\n')
-                       return(badp);
-       }
-       tsp++;
-
-       while((c = *sp++ & 0177) != seof) {
-               if(c == '\\' && *sp == 'n') {
-                       sp++;
-                       c = '\n';
-               }
-               if((ep[c] = *tsp++) == '\\' && *tsp == 'n') {
-                       ep[c] = '\n';
-                       tsp++;
-               }
-               if(ep[c] == seof || ep[c] == '\0')
-                       return(badp);
-       }
-       if(*tsp != seof)
-               return(badp);
-       cp = ++tsp;
-
-       for(c = 0; !(c & 0200); c++)
-               if(ep[c] == 0)
-                       ep[c] = c;
-
-       return(ep + 0200);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/sed/sed1.c b/.ref-Research-V7/usr/src/cmd/sed/sed1.c
deleted file mode 100644 (file)
index 52dd768..0000000
+++ /dev/null
@@ -1,717 +0,0 @@
-#include       <stdio.h>
-#include "sed.h"
-
-char   *trans[040]  = {
-       "\\01",
-       "\\02",
-       "\\03",
-       "\\04",
-       "\\05",
-       "\\06",
-       "\\07",
-       "<\b-",
-       ">\b-",
-       "\n",
-       "\\13",
-       "\\14",
-       "\\15",
-       "\\16",
-       "\\17",
-       "\\20",
-       "\\21",
-       "\\22",
-       "\\23",
-       "\\24",
-       "\\25",
-       "\\26",
-       "\\27",
-       "\\30",
-       "\\31",
-       "\\32",
-       "\\33",
-       "\\34",
-       "\\35",
-       "\\36",
-       "\\37"
-};
-char   rub[] = {"\177"};
-
-execute(file)
-char *file;
-{
-       register char *p1, *p2;
-       register union reptr    *ipc;
-       int     c;
-       char    *execp;
-
-       if (file) {
-               if ((f = open(file, 0)) < 0) {
-                       fprintf(stderr, "Can't open %s\n", file);
-               }
-       } else
-               f = 0;
-
-       ebp = ibuf;
-       cbp = ibuf;
-
-       if(pending) {
-               ipc = pending;
-               pending = 0;
-               goto yes;
-       }
-
-       for(;;) {
-               if((execp = gline(linebuf)) == badp) {
-                       close(f);
-                       return;
-               }
-               spend = execp;
-
-               for(ipc = ptrspace; ipc->command; ) {
-
-                       p1 = ipc->ad1;
-                       p2 = ipc->ad2;
-
-                       if(p1) {
-
-                               if(ipc->inar) {
-                                       if(*p2 == CEND) {
-                                               p1 = 0;
-                                       } else if(*p2 == CLNUM) {
-                                               c = p2[1];
-                                               if(lnum > tlno[c]) {
-                                                       ipc->inar = 0;
-                                                       if(ipc->negfl)
-                                                               goto yes;
-                                                       ipc++;
-                                                       continue;
-                                               }
-                                               if(lnum == tlno[c]) {
-                                                       ipc->inar = 0;
-                                               }
-                                       } else if(match(p2, 0)) {
-                                               ipc->inar = 0;
-                                       }
-                               } else if(*p1 == CEND) {
-                                       if(!dolflag) {
-                                               if(ipc->negfl)
-                                                       goto yes;
-                                               ipc++;
-                                               continue;
-                                       }
-
-                               } else if(*p1 == CLNUM) {
-                                       c = p1[1];
-                                       if(lnum != tlno[c]) {
-                                               if(ipc->negfl)
-                                                       goto yes;
-                                               ipc++;
-                                               continue;
-                                       }
-                                       if(p2)
-                                               ipc->inar = 1;
-                               } else if(match(p1, 0)) {
-                                       if(p2)
-                                               ipc->inar = 1;
-                               } else {
-                                       if(ipc->negfl)
-                                               goto yes;
-                                       ipc++;
-                                       continue;
-                               }
-                       }
-
-                       if(ipc->negfl) {
-                               ipc++;
-                               continue;
-                       }
-       yes:
-                       command(ipc);
-
-                       if(delflag)
-                               break;
-
-                       if(jflag) {
-                               jflag = 0;
-                               if((ipc = ipc->lb1) == 0) {
-                                       ipc = ptrspace;
-                                       break;
-                               }
-                       } else
-                               ipc++;
-
-               }
-               if(!nflag && !delflag) {
-                       for(p1 = linebuf; p1 < spend; p1++)
-                               putc(*p1, stdout);
-                       putc('\n', stdout);
-               }
-
-               if(aptr > abuf) {
-                       arout();
-               }
-
-               delflag = 0;
-
-       }
-}
-match(expbuf, gf)
-char   *expbuf;
-{
-       register char   *p1, *p2, c;
-
-       if(gf) {
-               if(*expbuf)     return(0);
-               p1 = linebuf;
-               p2 = genbuf;
-               while(*p1++ = *p2++);
-               locs = p1 = loc2;
-       } else {
-               p1 = linebuf;
-               locs = 0;
-       }
-
-       p2 = expbuf;
-       if(*p2++) {
-               loc1 = p1;
-               if(*p2 == CCHR && p2[1] != *p1)
-                       return(0);
-               return(advance(p1, p2));
-       }
-
-       /* fast check for first character */
-
-       if(*p2 == CCHR) {
-               c = p2[1];
-               do {
-                       if(*p1 != c)
-                               continue;
-                       if(advance(p1, p2)) {
-                               loc1 = p1;
-                               return(1);
-                       }
-               } while(*p1++);
-               return(0);
-       }
-
-       do {
-               if(advance(p1, p2)) {
-                       loc1 = p1;
-                       return(1);
-               }
-       } while(*p1++);
-       return(0);
-}
-advance(alp, aep)
-char   *alp, *aep;
-{
-       register char *lp, *ep, *curlp;
-       char    c;
-       char *bbeg;
-       int     ct;
-
-/*fprintf(stderr, "*lp = %c, %o\n*ep = %c, %o\n", *lp, *lp, *ep, *ep); /*DEBUG*/
-
-       lp = alp;
-       ep = aep;
-       for (;;) switch (*ep++) {
-
-       case CCHR:
-               if (*ep++ == *lp++)
-                       continue;
-               return(0);
-
-       case CDOT:
-               if (*lp++)
-                       continue;
-               return(0);
-
-       case CNL:
-       case CDOL:
-               if (*lp == 0)
-                       continue;
-               return(0);
-
-       case CEOF:
-               loc2 = lp;
-               return(1);
-
-       case CCL:
-               c = *lp++ & 0177;
-               if(ep[c>>3] & bittab[c & 07]) {
-                       ep += 16;
-                       continue;
-               }
-               return(0);
-
-       case CBRA:
-               braslist[*ep++] = lp;
-               continue;
-
-       case CKET:
-               braelist[*ep++] = lp;
-               continue;
-
-       case CBACK:
-               bbeg = braslist[*ep];
-               ct = braelist[*ep++] - bbeg;
-
-               if(ecmp(bbeg, lp, ct)) {
-                       lp += ct;
-                       continue;
-               }
-               return(0);
-
-       case CBACK|STAR:
-               bbeg = braslist[*ep];
-               ct = braelist[*ep++] - bbeg;
-               curlp = lp;
-               while(ecmp(bbeg, lp, ct))
-                       lp += ct;
-
-               while(lp >= curlp) {
-                       if(advance(lp, ep))     return(1);
-                       lp -= ct;
-               }
-               return(0);
-
-
-       case CDOT|STAR:
-               curlp = lp;
-               while (*lp++);
-               goto star;
-
-       case CCHR|STAR:
-               curlp = lp;
-               while (*lp++ == *ep);
-               ep++;
-               goto star;
-
-       case CCL|STAR:
-               curlp = lp;
-               do {
-                       c = *lp++ & 0177;
-               } while(ep[c>>3] & bittab[c & 07]);
-               ep += 16;
-               goto star;
-
-       star:
-               if(--lp == curlp) {
-                       continue;
-               }
-
-               if(*ep == CCHR) {
-                       c = ep[1];
-                       do {
-                               if(*lp != c)
-                                       continue;
-                               if(advance(lp, ep))
-                                       return(1);
-                       } while(lp-- > curlp);
-                       return(0);
-               }
-
-               if(*ep == CBACK) {
-                       c = *(braslist[ep[1]]);
-                       do {
-                               if(*lp != c)
-                                       continue;
-                               if(advance(lp, ep))
-                                       return(1);
-                       } while(lp-- > curlp);
-                       return(0);
-               }
-
-               do {
-                       if(lp == locs)  break;
-                       if (advance(lp, ep))
-                               return(1);
-               } while (lp-- > curlp);
-               return(0);
-
-       default:
-               fprintf(stderr, "RE botch, %o\n", *--ep);
-       }
-}
-substitute(ipc)
-union reptr    *ipc;
-{
-       if(match(ipc->re1, 0) == 0)     return(0);
-
-       sflag = 1;
-       dosub(ipc->rhs);
-
-       if(ipc->gfl) {
-               while(*loc2) {
-                       if(match(ipc->re1, 1) == 0) break;
-                       dosub(ipc->rhs);
-               }
-       }
-       return(1);
-}
-
-dosub(rhsbuf)
-char   *rhsbuf;
-{
-       register char *lp, *sp, *rp;
-       int c;
-
-       lp = linebuf;
-       sp = genbuf;
-       rp = rhsbuf;
-       while (lp < loc1)
-               *sp++ = *lp++;
-       while(c = *rp++) {
-               if (c == '&') {
-                       sp = place(sp, loc1, loc2);
-                       continue;
-               } else if (c&0200 && (c &= 0177) >= '1' && c < NBRA+'1') {
-                       sp = place(sp, braslist[c-'1'], braelist[c-'1']);
-                       continue;
-               }
-               *sp++ = c&0177;
-               if (sp >= &genbuf[LBSIZE])
-                       fprintf(stderr, "output line too long.\n");
-       }
-       lp = loc2;
-       loc2 = sp - genbuf + linebuf;
-       while (*sp++ = *lp++)
-               if (sp >= &genbuf[LBSIZE]) {
-                       fprintf(stderr, "Output line too long.\n");
-               }
-       lp = linebuf;
-       sp = genbuf;
-       while (*lp++ = *sp++);
-       spend = lp-1;
-}
-char   *place(asp, al1, al2)
-char   *asp, *al1, *al2;
-{
-       register char *sp, *l1, *l2;
-
-       sp = asp;
-       l1 = al1;
-       l2 = al2;
-       while (l1 < l2) {
-               *sp++ = *l1++;
-               if (sp >= &genbuf[LBSIZE])
-                       fprintf(stderr, "Output line too long.\n");
-       }
-       return(sp);
-}
-
-command(ipc)
-union reptr    *ipc;
-{
-       register int    i;
-       register char   *p1, *p2, *p3;
-       char    *execp;
-
-
-       switch(ipc->command) {
-
-               case ACOM:
-                       *aptr++ = ipc;
-                       if(aptr >= &abuf[ABUFSIZE]) {
-                               fprintf(stderr, "Too many appends after line %ld\n",
-                                       lnum);
-                       }
-                       *aptr = 0;
-                       break;
-
-               case CCOM:
-                       delflag = 1;
-                       if(!ipc->inar || dolflag) {
-                               for(p1 = ipc->re1; *p1; )
-                                       putc(*p1++, stdout);
-                               putc('\n', stdout);
-                       }
-                       break;
-               case DCOM:
-                       delflag++;
-                       break;
-               case CDCOM:
-                       p1 = p2 = linebuf;
-
-                       while(*p1 != '\n') {
-                               if(*p1++ == 0) {
-                                       delflag++;
-                                       return;
-                               }
-                       }
-
-                       p1++;
-                       while(*p2++ = *p1++);
-                       spend = p2-1;
-                       jflag++;
-                       break;
-
-               case EQCOM:
-                       fprintf(stdout, "%ld\n", lnum);
-                       break;
-
-               case GCOM:
-                       p1 = linebuf;
-                       p2 = holdsp;
-                       while(*p1++ = *p2++);
-                       spend = p1-1;
-                       break;
-
-               case CGCOM:
-                       *spend++ = '\n';
-                       p1 = spend;
-                       p2 = holdsp;
-                       while(*p1++ = *p2++)
-                               if(p1 >= lbend)
-                                       break;
-                       spend = p1-1;
-                       break;
-
-               case HCOM:
-                       p1 = holdsp;
-                       p2 = linebuf;
-                       while(*p1++ = *p2++);
-                       hspend = p1-1;
-                       break;
-
-               case CHCOM:
-                       *hspend++ = '\n';
-                       p1 = hspend;
-                       p2 = linebuf;
-                       while(*p1++ = *p2++)
-                               if(p1 >= hend)
-                                       break;
-                       hspend = p1-1;
-                       break;
-
-               case ICOM:
-                       for(p1 = ipc->re1; *p1; )
-                               putc(*p1++, stdout);
-                       putc('\n', stdout);
-                       break;
-
-               case BCOM:
-                       jflag = 1;
-                       break;
-
-               case LCOM:
-                       p1 = linebuf;
-                       p2 = genbuf;
-                       genbuf[72] = 0;
-                       while(*p1)
-                               if(*p1 >= 040) {
-                                       if(*p1 == 0177) {
-                                               p3 = rub;
-                                               while(*p2++ = *p3++)
-                                                       if(p2 >= lcomend) {
-                                                               *p2 = '\\';
-                                                               fprintf(stdout, "%s\n", genbuf);
-                                                               p2 = genbuf;
-                                                       }
-                                               p2--;
-                                               p1++;
-                                               continue;
-                                       }
-                                       *p2++ = *p1++;
-                                       if(p2 >= lcomend) {
-                                               *p2 = '\\';
-                                               fprintf(stdout, "%s\n", genbuf);
-                                               p2 = genbuf;
-                                       }
-                               } else {
-                                       p3 = trans[*p1-1];
-                                       while(*p2++ = *p3++)
-                                               if(p2 >= lcomend) {
-                                                       *p2 = '\\';
-                                                       fprintf(stdout, "%s\n", genbuf);
-                                                       p2 = genbuf;
-                                               }
-                                       p2--;
-                                       p1++;
-                               }
-                       *p2 = 0;
-                       fprintf(stdout, "%s\n", genbuf);
-                       break;
-
-               case NCOM:
-                       if(!nflag) {
-                               for(p1 = linebuf; p1 < spend; p1++)
-                                       putc(*p1, stdout);
-                               putc('\n', stdout);
-                       }
-
-                       if(aptr > abuf)
-                               arout();
-                       if((execp = gline(linebuf)) == badp) {
-                               pending = ipc;
-                               delflag = 1;
-                               break;
-                       }
-                       spend = execp;
-
-                       break;
-               case CNCOM:
-                       if(aptr > abuf)
-                               arout();
-                       *spend++ = '\n';
-                       if((execp = gline(spend)) == badp) {
-                               pending = ipc;
-                               delflag = 1;
-                               break;
-                       }
-                       spend = execp;
-                       break;
-
-               case PCOM:
-                       for(p1 = linebuf; p1 < spend; p1++)
-                               putc(*p1, stdout);
-                       putc('\n', stdout);
-                       break;
-               case CPCOM:
-       cpcom:
-                       for(p1 = linebuf; *p1 != '\n' && *p1 != '\0'; )
-                               putc(*p1++, stdout);
-                       putc('\n', stdout);
-                       break;
-
-               case QCOM:
-                       if(!nflag) {
-                               for(p1 = linebuf; p1 < spend; p1++)
-                                       putc(*p1, stdout);
-                               putc('\n', stdout);
-                       }
-                       if(aptr > abuf) arout();
-                       fclose(stdout);
-                       exit(0);
-               case RCOM:
-
-                       *aptr++ = ipc;
-                       if(aptr >= &abuf[ABUFSIZE])
-                               fprintf(stderr, "Too many reads after line%ld\n",
-                                       lnum);
-
-                       *aptr = 0;
-
-                       break;
-
-               case SCOM:
-                       i = substitute(ipc);
-                       if(ipc->pfl && i)
-                               if(ipc->pfl == 1) {
-                                       for(p1 = linebuf; p1 < spend; p1++)
-                                               putc(*p1, stdout);
-                                       putc('\n', stdout);
-                               }
-                               else
-                                       goto cpcom;
-                       if(i && ipc->fcode)
-                               goto wcom;
-                       break;
-
-               case TCOM:
-                       if(sflag == 0)  break;
-                       sflag = 0;
-                       jflag = 1;
-                       break;
-
-               wcom:
-               case WCOM:
-                       fprintf(ipc->fcode, "%s\n", linebuf);
-                       break;
-               case XCOM:
-                       p1 = linebuf;
-                       p2 = genbuf;
-                       while(*p2++ = *p1++);
-                       p1 = holdsp;
-                       p2 = linebuf;
-                       while(*p2++ = *p1++);
-                       spend = p2 - 1;
-                       p1 = genbuf;
-                       p2 = holdsp;
-                       while(*p2++ = *p1++);
-                       hspend = p2 - 1;
-                       break;
-
-               case YCOM:
-                       p1 = linebuf;
-                       p2 = ipc->re1;
-                       while(*p1 = p2[*p1])    p1++;
-                       break;
-       }
-
-}
-
-char   *
-gline(addr)
-char   *addr;
-{
-       register char   *p1, *p2;
-       register        c;
-       p1 = addr;
-       p2 = cbp;
-       for (;;) {
-               if (p2 >= ebp) {
-                       if ((c = read(f, ibuf, 512)) <= 0) {
-                               return(badp);
-                       }
-                       p2 = ibuf;
-                       ebp = ibuf+c;
-               }
-               if ((c = *p2++) == '\n') {
-                       if(p2 >=  ebp) {
-                               if((c = read(f, ibuf, 512)) <= 0) {
-                                       close(f);
-                                       if(eargc == 0)
-                                                       dolflag = 1;
-                               }
-
-                               p2 = ibuf;
-                               ebp = ibuf + c;
-                       }
-                       break;
-               }
-               if(c)
-               if(p1 < lbend)
-                       *p1++ = c;
-       }
-       lnum++;
-       *p1 = 0;
-       cbp = p2;
-
-       return(p1);
-}
-ecmp(a, b, count)
-char   *a, *b;
-{
-       while(count--)
-               if(*a++ != *b++)        return(0);
-       return(1);
-}
-
-arout()
-{
-       register char   *p1;
-       FILE    *fi;
-       char    c;
-       int     t;
-
-       aptr = abuf - 1;
-       while(*++aptr) {
-               if((*aptr)->command == ACOM) {
-                       for(p1 = (*aptr)->re1; *p1; )
-                               putc(*p1++, stdout);
-                       putc('\n', stdout);
-               } else {
-                       if((fi = fopen((*aptr)->re1, "r")) == NULL)
-                               continue;
-                       while((t = getc(fi)) != EOF) {
-                               c = t;
-                               putc(c, stdout);
-                       }
-                       fclose(fi);
-               }
-       }
-       aptr = abuf;
-       *aptr = 0;
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/sh/args.c b/.ref-Research-V7/usr/src/cmd/sh/args.c
deleted file mode 100644 (file)
index 5fe26de..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-PROC STRING *copyargs();
-LOCAL DOLPTR   dolh;
-
-CHAR   flagadr[10];
-
-CHAR   flagchar[] = {
-       'x',    'n',    'v',    't',    's',    'i',    'e',    'r',    'k',    'u',    0
-};
-INT    flagval[]  = {
-       execpr, noexec, readpr, oneflg, stdflg, intflg, errflg, rshflg, keyflg, setflg, 0
-};
-
-/* ========    option handling ======== */
-
-
-INT    options(argc,argv)
-       STRING          *argv;
-       INT             argc;
-{
-       REG STRING      cp;
-       REG STRING      *argp=argv;
-       REG STRING      flagc;
-       STRING          flagp;
-
-       IF argc>1 ANDF *argp[1]=='-'
-       THEN    cp=argp[1];
-               flags &= ~(execpr|readpr);
-               WHILE *++cp
-               DO      flagc=flagchar;
-
-                       WHILE *flagc ANDF *flagc != *cp DO flagc++ OD
-                       IF *cp == *flagc
-                       THEN    flags |= flagval[flagc-flagchar];
-                       ELIF *cp=='c' ANDF argc>2 ANDF comdiv==0
-                       THEN    comdiv=argp[2];
-                               argp[1]=argp[0]; argp++; argc--;
-                       ELSE    failed(argv[1],badopt);
-                       FI
-               OD
-               argp[1]=argp[0]; argc--;
-       FI
-
-       /* set up $- */
-       flagc=flagchar;
-       flagp=flagadr;
-       WHILE *flagc
-       DO IF flags&flagval[flagc-flagchar]
-          THEN *flagp++ = *flagc;
-          FI
-          flagc++;
-       OD
-       *flagp++=0;
-
-       return(argc);
-}
-
-VOID   setargs(argi)
-       STRING          argi[];
-{
-       /* count args */
-       REG STRING      *argp=argi;
-       REG INT         argn=0;
-
-       WHILE Rcheat(*argp++)!=ENDARGS DO argn++ OD
-
-       /* free old ones unless on for loop chain */
-       freeargs(dolh);
-       dolh=copyargs(argi,argn);       /* sets dolv */
-       assnum(&dolladr,dolc=argn-1);
-}
-
-freeargs(blk)
-       DOLPTR          blk;
-{
-       REG STRING      *argp;
-       REG DOLPTR      argr=0;
-       REG DOLPTR      argblk;
-
-       IF argblk=blk
-       THEN    argr = argblk->dolnxt;
-               IF (--argblk->doluse)==0
-               THEN    FOR argp=argblk->dolarg; Rcheat(*argp)!=ENDARGS; argp++
-                       DO free(*argp) OD
-                       free(argblk);
-               FI
-       FI
-       return(argr);
-}
-
-LOCAL STRING * copyargs(from, n)
-       STRING          from[];
-{
-       REG STRING *    np=alloc(sizeof(STRING*)*n+3*BYTESPERWORD);
-       REG STRING *    fp=from;
-       REG STRING *    pp=np;
-
-       np->doluse=1;   /* use count */
-       np=np->dolarg;
-       dolv=np;
-
-       WHILE n--
-       DO *np++ = make(*fp++) OD
-       *np++ = ENDARGS;
-       return(pp);
-}
-
-clearup()
-{
-       /* force `for' $* lists to go away */
-       WHILE argfor=freeargs(argfor) DONE
-
-       /* clean up io files */
-       WHILE pop() DONE
-}
-
-DOLPTR useargs()
-{
-       IF dolh
-       THEN    dolh->doluse++;
-               dolh->dolnxt=argfor;
-               return(argfor=dolh);
-       ELSE    return(0);
-       FI
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/blok.c b/.ref-Research-V7/usr/src/cmd/sh/blok.c
deleted file mode 100644 (file)
index df09ace..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-
-/*
- *     storage allocator
- *     (circular first fit strategy)
- */
-
-#define BUSY 01
-#define busy(x)        (Rcheat((x)->word)&BUSY)
-
-POS            brkincr=BRKINCR;
-BLKPTR         blokp;                  /*current search pointer*/
-BLKPTR         bloktop=BLK(end);       /*top of arena (last blok)*/
-
-
-
-ADDRESS        alloc(nbytes)
-       POS             nbytes;
-{
-       REG POS         rbytes = round(nbytes+BYTESPERWORD,BYTESPERWORD);
-
-       LOOP    INT             c=0;
-               REG BLKPTR      p = blokp;
-               REG BLKPTR      q;
-               REP     IF !busy(p)
-                       THEN    WHILE !busy(q = p->word) DO p->word = q->word OD
-                               IF ADR(q)-ADR(p) >= rbytes
-                               THEN    blokp = BLK(ADR(p)+rbytes);
-                                       IF q > blokp
-                                       THEN    blokp->word = p->word;
-                                       FI
-                                       p->word=BLK(Rcheat(blokp)|BUSY);
-                                       return(ADR(p+1));
-                               FI
-                       FI
-                       q = p; p = BLK(Rcheat(p->word)&~BUSY);
-               PER     p>q ORF (c++)==0 DONE
-               addblok(rbytes);
-       POOL
-}
-
-VOID   addblok(reqd)
-       POS             reqd;
-{
-       IF stakbas!=staktop
-       THEN    REG STKPTR      rndstak;
-               REG BLKPTR      blokstak;
-
-               pushstak(0);
-               rndstak=round(staktop,BYTESPERWORD);
-               blokstak=BLK(stakbas)-1;
-               blokstak->word=stakbsy; stakbsy=blokstak;
-               bloktop->word=BLK(Rcheat(rndstak)|BUSY);
-               bloktop=BLK(rndstak);
-       FI
-       reqd += brkincr; reqd &= ~(brkincr-1);
-       blokp=bloktop;
-       bloktop=bloktop->word=BLK(Rcheat(bloktop)+reqd);
-       bloktop->word=BLK(ADR(end)+1);
-       BEGIN
-          REG STKPTR stakadr=STK(bloktop+2);
-          staktop=movstr(stakbot,stakadr);
-          stakbas=stakbot=stakadr;
-       END
-}
-
-VOID   free(ap)
-       BLKPTR          ap;
-{
-       REG BLKPTR      p;
-
-       IF (p=ap) ANDF p<bloktop
-       THEN    Lcheat((--p)->word) &= ~BUSY;
-       FI
-}
-
-#ifdef DEBUG
-chkbptr(ptr)
-       BLKPTR  ptr;
-{
-       INT             exf=0;
-       REG BLKPTR      p = end;
-       REG BLKPTR      q;
-       INT             us=0, un=0;
-
-       LOOP
-          q = Rcheat(p->word)&~BUSY;
-          IF p==ptr THEN exf++ FI
-          IF q<end ORF q>bloktop THEN abort(3) FI
-          IF p==bloktop THEN break FI
-          IF busy(p)
-          THEN us += q-p;
-          ELSE un += q-p;
-          FI
-          IF p>=q THEN abort(4) FI
-          p=q;
-       POOL
-       IF exf==0 THEN abort(1) FI
-       prn(un); prc(SP); prn(us); prc(NL);
-}
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/sh/brkincr.h b/.ref-Research-V7/usr/src/cmd/sh/brkincr.h
deleted file mode 100644 (file)
index 2c4c254..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#define BRKINCR 01000
-#define BRKMAX 04000
diff --git a/.ref-Research-V7/usr/src/cmd/sh/builtin.c b/.ref-Research-V7/usr/src/cmd/sh/builtin.c
deleted file mode 100644 (file)
index 9125740..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-builtin()
-{return(0);}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/cmd.c b/.ref-Research-V7/usr/src/cmd/sh/cmd.c
deleted file mode 100644 (file)
index 94c3337..0000000
+++ /dev/null
@@ -1,406 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       "sym.h"
-
-PROC IOPTR     inout();
-PROC VOID      chkword();
-PROC VOID      chksym();
-PROC TREPTR    term();
-PROC TREPTR    makelist();
-PROC TREPTR    list();
-PROC REGPTR    syncase();
-PROC TREPTR    item();
-PROC VOID      skipnl();
-PROC VOID      prsym();
-PROC VOID      synbad();
-
-
-/* ========    command line decoding   ========*/
-
-
-
-
-TREPTR makefork(flgs, i)
-       INT             flgs;
-       TREPTR          i;
-{
-       REG TREPTR      t;
-
-       t=getstak(FORKTYPE);
-       t->forktyp=flgs|TFORK; t->forktre=i; t->forkio=0;
-       return(t);
-}
-
-LOCAL TREPTR   makelist(type,i,r)
-       INT             type;
-       TREPTR          i, r;
-{
-       REG TREPTR      t;
-
-       IF i==0 ORF r==0
-       THEN    synbad();
-       ELSE    t = getstak(LSTTYPE);
-               t->lsttyp = type;
-               t->lstlef = i; t->lstrit = r;
-       FI
-       return(t);
-}
-
-/*
- * cmd
- *     empty
- *     list
- *     list & [ cmd ]
- *     list [ ; cmd ]
- */
-
-TREPTR cmd(sym,flg)
-       REG INT         sym;
-       INT             flg;
-{
-       REG TREPTR      i, e;
-
-       i = list(flg);
-
-       IF wdval==NL
-       THEN    IF flg&NLFLG
-               THEN    wdval=';'; chkpr(NL);
-               FI
-       ELIF i==0 ANDF (flg&MTFLG)==0
-       THEN    synbad();
-       FI
-
-       SWITCH wdval IN
-
-           case '&':
-               IF i
-               THEN    i = makefork(FINT|FPRS|FAMP, i);
-               ELSE    synbad();
-               FI
-
-           case ';':
-               IF e=cmd(sym,flg|MTFLG)
-               THEN    i=makelist(TLST, i, e);
-               FI
-               break;
-
-           case EOFSYM:
-               IF sym==NL
-               THEN    break;
-               FI
-
-           default:
-               IF sym
-               THEN    chksym(sym);
-               FI
-
-       ENDSW
-       return(i);
-}
-
-/*
- * list
- *     term
- *     list && term
- *     list || term
- */
-
-LOCAL TREPTR   list(flg)
-{
-       REG TREPTR      r;
-       REG INT         b;
-
-       r = term(flg);
-       WHILE r ANDF ((b=(wdval==ANDFSYM)) ORF wdval==ORFSYM)
-       DO      r = makelist((b ? TAND : TORF), r, term(NLFLG));
-       OD
-       return(r);
-}
-
-/*
- * term
- *     item
- *     item |^ term
- */
-
-LOCAL TREPTR   term(flg)
-{
-       REG TREPTR      t;
-
-       reserv++;
-       IF flg&NLFLG
-       THEN    skipnl();
-       ELSE    word();
-       FI
-
-       IF (t=item(TRUE)) ANDF (wdval=='^' ORF wdval=='|')
-       THEN    return(makelist(TFIL, makefork(FPOU,t), makefork(FPIN|FPCL,term(NLFLG))));
-       ELSE    return(t);
-       FI
-}
-
-LOCAL REGPTR   syncase(esym)
-       REG INT esym;
-{
-       skipnl();
-       IF wdval==esym
-       THEN    return(0);
-       ELSE    REG REGPTR      r=getstak(REGTYPE);
-               r->regptr=0;
-               LOOP wdarg->argnxt=r->regptr;
-                    r->regptr=wdarg;
-                    IF wdval ORF ( word()!=')' ANDF wdval!='|' )
-                    THEN synbad();
-                    FI
-                    IF wdval=='|'
-                    THEN word();
-                    ELSE break;
-                    FI
-               POOL
-               r->regcom=cmd(0,NLFLG|MTFLG);
-               IF wdval==ECSYM
-               THEN    r->regnxt=syncase(esym);
-               ELSE    chksym(esym);
-                       r->regnxt=0;
-               FI
-               return(r);
-       FI
-}
-
-/*
- * item
- *
- *     ( cmd ) [ < in  ] [ > out ]
- *     word word* [ < in ] [ > out ]
- *     if ... then ... else ... fi
- *     for ... while ... do ... done
- *     case ... in ... esac
- *     begin ... end
- */
-
-LOCAL TREPTR   item(flag)
-       BOOL            flag;
-{
-       REG TREPTR      t;
-       REG IOPTR       io;
-
-       IF flag
-       THEN    io=inout((IOPTR)0);
-       ELSE    io=0;
-       FI
-
-       SWITCH wdval IN
-
-           case CASYM:
-               BEGIN
-                  t=getstak(SWTYPE);
-                  chkword();
-                  t->swarg=wdarg->argval;
-                  skipnl(); chksym(INSYM|BRSYM);
-                  t->swlst=syncase(wdval==INSYM?ESSYM:KTSYM);
-                  t->swtyp=TSW;
-                  break;
-               END
-
-           case IFSYM:
-               BEGIN
-                  REG INT      w;
-                  t=getstak(IFTYPE);
-                  t->iftyp=TIF;
-                  t->iftre=cmd(THSYM,NLFLG);
-                  t->thtre=cmd(ELSYM|FISYM|EFSYM,NLFLG);
-                  t->eltre=((w=wdval)==ELSYM ? cmd(FISYM,NLFLG) : (w==EFSYM ? (wdval=IFSYM, item(0)) : 0));
-                  IF w==EFSYM THEN return(t) FI
-                  break;
-               END
-
-           case FORSYM:
-               BEGIN
-                  t=getstak(FORTYPE);
-                  t->fortyp=TFOR;
-                  t->forlst=0;
-                  chkword();
-                  t->fornam=wdarg->argval;
-                  IF skipnl()==INSYM
-                  THEN chkword();
-                       t->forlst=item(0);
-                       IF wdval!=NL ANDF wdval!=';'
-                       THEN    synbad();
-                       FI
-                       chkpr(wdval); skipnl();
-                  FI
-                  chksym(DOSYM|BRSYM);
-                  t->fortre=cmd(wdval==DOSYM?ODSYM:KTSYM,NLFLG);
-                  break;
-               END
-
-           case WHSYM:
-           case UNSYM:
-               BEGIN
-                  t=getstak(WHTYPE);
-                  t->whtyp=(wdval==WHSYM ? TWH : TUN);
-                  t->whtre = cmd(DOSYM,NLFLG);
-                  t->dotre = cmd(ODSYM,NLFLG);
-                  break;
-               END
-
-           case BRSYM:
-               t=cmd(KTSYM,NLFLG);
-               break;
-
-           case '(':
-               BEGIN
-                  REG PARPTR    p;
-                  p=getstak(PARTYPE);
-                  p->partre=cmd(')',NLFLG);
-                  p->partyp=TPAR;
-                  t=makefork(0,p);
-                  break;
-               END
-
-           default:
-               IF io==0
-               THEN    return(0);
-               FI
-
-           case 0:
-               BEGIN
-                  REG ARGPTR   argp;
-                  REG ARGPTR   *argtail;
-                  REG ARGPTR   *argset=0;
-                  INT          keywd=1;
-                  t=getstak(COMTYPE);
-                  t->comio=io; /*initial io chain*/
-                  argtail = &(t->comarg);
-                  WHILE wdval==0
-                  DO   argp = wdarg;
-                       IF wdset ANDF keywd
-                       THEN    argp->argnxt=argset; argset=argp;
-                       ELSE    *argtail=argp; argtail = &(argp->argnxt); keywd=flags&keyflg;
-                       FI
-                       word();
-                       IF flag
-                       THEN t->comio=inout(t->comio);
-                       FI
-                  OD
-
-                  t->comtyp=TCOM; t->comset=argset; *argtail=0;
-                  return(t);
-               END
-
-       ENDSW
-       reserv++; word();
-       IF io=inout(io)
-       THEN    t=makefork(0,t); t->treio=io;
-       FI
-       return(t);
-}
-
-
-LOCAL VOID     skipnl()
-{
-       WHILE (reserv++, word()==NL) DO chkpr(NL) OD
-       return(wdval);
-}
-
-LOCAL IOPTR    inout(lastio)
-       IOPTR           lastio;
-{
-       REG INT         iof;
-       REG IOPTR       iop;
-       REG CHAR        c;
-
-       iof=wdnum;
-
-       SWITCH wdval IN
-
-           case DOCSYM:
-               iof |= IODOC; break;
-
-           case APPSYM:
-           case '>':
-               IF wdnum==0 THEN iof |= 1 FI
-               iof |= IOPUT;
-               IF wdval==APPSYM
-               THEN    iof |= IOAPP; break;
-               FI
-
-           case '<':
-               IF (c=nextc(0))=='&'
-               THEN    iof |= IOMOV;
-               ELIF c=='>'
-               THEN    iof |= IORDW;
-               ELSE    peekc=c|MARK;
-               FI
-               break;
-
-           default:
-               return(lastio);
-       ENDSW
-
-       chkword();
-       iop=getstak(IOTYPE); iop->ioname=wdarg->argval; iop->iofile=iof;
-       IF iof&IODOC
-       THEN iop->iolst=iopend; iopend=iop;
-       FI
-       word(); iop->ionxt=inout(lastio);
-       return(iop);
-}
-
-LOCAL VOID     chkword()
-{
-       IF word()
-       THEN    synbad();
-       FI
-}
-
-LOCAL VOID     chksym(sym)
-{
-       REG INT         x = sym&wdval;
-       IF ((x&SYMFLG) ? x : sym) != wdval
-       THEN    synbad();
-       FI
-}
-
-LOCAL VOID     prsym(sym)
-{
-       IF sym&SYMFLG
-       THEN    REG SYSPTR      sp=reserved;
-               WHILE sp->sysval
-                       ANDF sp->sysval!=sym
-               DO sp++ OD
-               prs(sp->sysnam);
-       ELIF sym==EOFSYM
-       THEN    prs(endoffile);
-       ELSE    IF sym&SYMREP THEN prc(sym) FI
-               IF sym==NL
-               THEN    prs("newline");
-               ELSE    prc(sym);
-               FI
-       FI
-}
-
-LOCAL VOID     synbad()
-{
-       prp(); prs(synmsg);
-       IF (flags&ttyflg)==0
-       THEN    prs(atline); prn(standin->flin);
-       FI
-       prs(colon);
-       prc(LQ);
-       IF wdval
-       THEN    prsym(wdval);
-       ELSE    prs(wdarg->argval);
-       FI
-       prc(RQ); prs(unexpected);
-       newline();
-       exitsh(SYNBAD);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/ctype.c b/.ref-Research-V7/usr/src/cmd/sh/ctype.c
deleted file mode 100644 (file)
index 63cebe5..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-char   _ctype1[] {
-/*     000     001     002     003     004     005     006     007     */
-       _EOF,   0,      0,      0,      0,      0,      0,      0,
-
-/*     bs      ht      nl      vt      np      cr      so      si      */
-       0,      _TAB,   _EOR,   0,      0,      0,      0,      0,
-
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     sp      !       "       #       $       %       &       '       */
-       _SPC,   0,      _DQU,   0,      _DOL1,  0,      _AMP,   0,
-
-/*     (       )       *       +       ,       -       .       /       */
-       _BRA,   _KET,   0,      0,      0,      0,      0,      0,
-
-/*     0       1       2       3       4       5       6       7       */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     8       9       :       ;       <       =       >       ?       */
-       0,      0,      0,      _SEM,   _LT,    0,      _GT,    0,
-
-/*     @       A       B       C       D       E       F       G       */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     H       I       J       K       L       M       N       O       */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     P       Q       R       S       T       U       V       W       */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     X       Y       Z       [       \       ]       ^       _       */
-       0,      0,      0,      0,      _BSL,   0,      _HAT,   0,
-
-/*     `       a       b       c       d       e       f       g       */
-       _LQU,   0,      0,      0,      0,      0,      0,      0,
-
-/*     h       i       j       k       l       m       n       o       */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     p       q       r       s       t       u       v       w       */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     x       y       z       {       |       }       ~       del     */
-       0,      0,      0,      0,      _BAR,   0,      0,      0
-};
-
-
-char   _ctype2[] {
-/*     000     001     002     003     004     005     006     007     */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     bs      ht      nl      vt      np      cr      so      si      */
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-       0,      0,      0,      0,      0,      0,      0,      0,
-
-/*     sp      !       "       #       $       %       &       '       */
-       0,      _PCS,   0,      _NUM,   _DOL2,  0,      0,      0,
-
-/*     (       )       *       +       ,       -       .       /       */
-       0,      0,      _AST,   _PLS,   0,      _MIN,   0,      0,
-
-/*     0       1       2       3       4       5       6       7       */
-       _DIG,   _DIG,   _DIG,   _DIG,   _DIG,   _DIG,   _DIG,   _DIG,
-
-/*     8       9       :       ;       <       =       >       ?       */
-       _DIG,   _DIG,   0,      0,      0,      _EQ,    0,      _QU,
-
-/*     @       A       B       C       D       E       F       G       */
-       _AT,    _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,
-
-/*     H       I       J       K       L       M       N       O       */
-       _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,
-
-/*     P       Q       R       S       T       U       V       W       */
-       _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,   _UPC,
-
-/*     X       Y       Z       [       \       ]       ^       _       */
-       _UPC,   _UPC,   _UPC,   _SQB,   0,      0,      0,      _UPC,
-
-/*     `       a       b       c       d       e       f       g       */
-       0,      _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,
-
-/*     h       i       j       k       l       m       n       o       */
-       _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,
-
-/*     p       q       r       s       t       u       v       w       */
-       _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,   _LPC,
-
-/*     x       y       z       {       |       }       ~       del     */
-       _LPC,   _LPC,   _LPC,   _CBR,   0,      _CKT,   0,      0
-};
-
diff --git a/.ref-Research-V7/usr/src/cmd/sh/ctype.h b/.ref-Research-V7/usr/src/cmd/sh/ctype.h
deleted file mode 100644 (file)
index 0566f7c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-
-/* table 1 */
-#define T_SUB  01
-#define T_MET  02
-#define        T_SPC   04
-#define T_DIP  010
-#define T_EOF  020
-#define T_EOR  040
-#define T_QOT  0100
-#define T_ESC  0200
-
-/* table 2 */
-#define T_BRC  01
-#define T_DEF  02
-#define T_AST  04
-#define        T_DIG   010
-#define T_FNG  020
-#define T_SHN  040
-#define        T_IDC   0100
-#define T_SET  0200
-
-/* for single chars */
-#define _TAB   (T_SPC)
-#define _SPC   (T_SPC)
-#define _UPC   (T_IDC)
-#define _LPC   (T_IDC)
-#define _DIG   (T_DIG)
-#define _EOF   (T_EOF)
-#define _EOR   (T_EOR)
-#define _BAR   (T_DIP)
-#define _HAT   (T_MET)
-#define _BRA   (T_MET)
-#define _KET   (T_MET)
-#define _SQB   (T_FNG)
-#define _AMP   (T_DIP)
-#define _SEM   (T_DIP)
-#define _LT    (T_DIP)
-#define _GT    (T_DIP)
-#define _LQU   (T_QOT|T_ESC)
-#define _BSL   (T_ESC)
-#define _DQU   (T_QOT)
-#define _DOL1  (T_SUB|T_ESC)
-
-#define _CBR   T_BRC
-#define _CKT   T_DEF
-#define _AST   (T_AST|T_FNG)
-#define _EQ    (T_DEF)
-#define _MIN   (T_DEF|T_SHN)
-#define _PCS   (T_SHN)
-#define _NUM   (T_SHN)
-#define _DOL2  (T_SHN)
-#define _PLS   (T_DEF|T_SET)
-#define _AT    (T_AST)
-#define _QU    (T_DEF|T_FNG|T_SHN)
-
-/* abbreviations for tests */
-#define _IDCH  (T_IDC|T_DIG)
-#define _META  (T_SPC|T_DIP|T_MET|T_EOR)
-
-char   _ctype1[];
-
-/* nb these args are not call by value !!!! */
-#define        space(c)        (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_SPC))
-#define eofmeta(c)     (((c)&QUOTE)==0 ANDF _ctype1[c]&(_META|T_EOF))
-#define qotchar(c)     (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_QOT))
-#define eolchar(c)     (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_EOR|T_EOF))
-#define dipchar(c)     (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_DIP))
-#define subchar(c)     (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_SUB|T_QOT))
-#define escchar(c)     (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_ESC))
-
-char   _ctype2[];
-
-#define        digit(c)        (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_DIG))
-#define fngchar(c)     (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_FNG))
-#define dolchar(c)     (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_AST|T_BRC|T_DIG|T_IDC|T_SHN))
-#define defchar(c)     (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_DEF))
-#define setchar(c)     (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_SET))
-#define digchar(c)     (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_AST|T_DIG))
-#define        letter(c)       (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_IDC))
-#define alphanum(c)    (((c)&QUOTE)==0 ANDF _ctype2[c]&(_IDCH))
-#define astchar(c)     (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_AST))
diff --git a/.ref-Research-V7/usr/src/cmd/sh/defs.h b/.ref-Research-V7/usr/src/cmd/sh/defs.h
deleted file mode 100644 (file)
index 5a18d98..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-#
-/*
- *     UNIX shell
- */
-
-/* error exits from various parts of shell */
-#define ERROR  1
-#define SYNBAD 2
-#define SIGFAIL 3
-#define SIGFLG 0200
-
-/* command tree */
-#define FPRS   020
-#define FINT   040
-#define FAMP   0100
-#define FPIN   0400
-#define FPOU   01000
-#define FPCL   02000
-#define FCMD   04000
-#define COMMSK 017
-
-#define TCOM   0
-#define TPAR   1
-#define TFIL   2
-#define TLST   3
-#define TIF    4
-#define TWH    5
-#define TUN    6
-#define TSW    7
-#define TAND   8
-#define TORF   9
-#define TFORK  10
-#define TFOR   11
-
-/* execute table */
-#define SYSSET 1
-#define SYSCD  2
-#define SYSEXEC        3
-#define SYSLOGIN 4
-#define SYSTRAP        5
-#define SYSEXIT        6
-#define SYSSHFT 7
-#define SYSWAIT        8
-#define SYSCONT 9
-#define SYSBREAK 10
-#define SYSEVAL 11
-#define SYSDOT 12
-#define SYSRDONLY 13
-#define SYSTIMES 14
-#define SYSXPORT 15
-#define SYSNULL 16
-#define SYSREAD 17
-#define SYSTST 18
-#define        SYSUMASK        19
-
-/* used for input and output of shell */
-#define INIO 10
-#define OTIO 11
-
-/*io nodes*/
-#define USERIO 10
-#define IOUFD  15
-#define IODOC  16
-#define IOPUT  32
-#define IOAPP  64
-#define IOMOV  128
-#define IORDW  256
-#define INPIPE 0
-#define OTPIPE 1
-
-/* arg list terminator */
-#define ENDARGS        0
-
-#include       "mac.h"
-#include       "mode.h"
-#include       "name.h"
-
-
-/* result type declarations */
-#define alloc malloc
-ADDRESS                alloc();
-VOID           addblok();
-STRING         make();
-STRING         movstr();
-TREPTR         cmd();
-TREPTR         makefork();
-NAMPTR         lookup();
-VOID           setname();
-VOID           setargs();
-DOLPTR         useargs();
-REAL           expr();
-STRING         catpath();
-STRING         getpath();
-STRING         *scan();
-STRING         mactrim();
-STRING         macro();
-STRING         execs();
-VOID           await();
-VOID           post();
-STRING         copyto();
-VOID           exname();
-STRING         staknam();
-VOID           printnam();
-VOID           printflg();
-VOID           prs();
-VOID           prc();
-VOID           getenv();
-STRING         *setenv();
-
-#define attrib(n,f)    (n->namflg |= f)
-#define round(a,b)     (((int)((ADR(a)+b)-1))&~((b)-1))
-#define closepipe(x)   (close(x[INPIPE]), close(x[OTPIPE]))
-#define eq(a,b)                (cf(a,b)==0)
-#define max(a,b)       ((a)>(b)?(a):(b))
-#define assert(x)      ;
-
-/* temp files and io */
-UFD            output;
-INT            ioset;
-IOPTR          iotemp;         /* files to be deleted sometime */
-IOPTR          iopend;         /* documents waiting to be read at NL */
-
-/* substitution */
-INT            dolc;
-STRING         *dolv;
-DOLPTR         argfor;
-ARGPTR         gchain;
-
-/* stack */
-#define                BLK(x)  ((BLKPTR)(x))
-#define                BYT(x)  ((BYTPTR)(x))
-#define                STK(x)  ((STKPTR)(x))
-#define                ADR(x)  ((char*)(x))
-
-/* stak stuff */
-#include       "stak.h"
-
-/* string constants */
-MSG            atline;
-MSG            readmsg;
-MSG            colon;
-MSG            minus;
-MSG            nullstr;
-MSG            sptbnl;
-MSG            unexpected;
-MSG            endoffile;
-MSG            synmsg;
-
-/* name tree and words */
-SYSTAB         reserved;
-INT            wdval;
-INT            wdnum;
-ARGPTR         wdarg;
-INT            wdset;
-BOOL           reserv;
-
-/* prompting */
-MSG            stdprompt;
-MSG            supprompt;
-MSG            profile;
-
-/* built in names */
-NAMNOD         fngnod;
-NAMNOD         ifsnod;
-NAMNOD         homenod;
-NAMNOD         mailnod;
-NAMNOD         pathnod;
-NAMNOD         ps1nod;
-NAMNOD         ps2nod;
-
-/* special names */
-MSG            flagadr;
-STRING         cmdadr;
-STRING         exitadr;
-STRING         dolladr;
-STRING         pcsadr;
-STRING         pidadr;
-
-MSG            defpath;
-
-/* names always present */
-MSG            mailname;
-MSG            homename;
-MSG            pathname;
-MSG            fngname;
-MSG            ifsname;
-MSG            ps1name;
-MSG            ps2name;
-
-/* transput */
-CHAR           tmpout[];
-STRING         tmpnam;
-INT            serial;
-#define                TMPNAM 7
-FILE           standin;
-#define input  (standin->fdes)
-#define eof    (standin->feof)
-INT            peekc;
-STRING         comdiv;
-MSG            devnull;
-
-/* flags */
-#define                noexec  01
-#define                intflg  02
-#define                prompt  04
-#define                setflg  010
-#define                errflg  020
-#define                ttyflg  040
-#define                forked  0100
-#define                oneflg  0200
-#define                rshflg  0400
-#define                waiting 01000
-#define                stdflg  02000
-#define                execpr  04000
-#define                readpr  010000
-#define                keyflg  020000
-INT            flags;
-
-/* error exits from various parts of shell */
-#include       <setjmp.h>
-jmp_buf                subshell;
-jmp_buf                errshell;
-
-/* fault handling */
-#include       "brkincr.h"
-POS            brkincr;
-
-#define MINTRAP        0
-#define MAXTRAP        17
-
-#define INTR   2
-#define QUIT   3
-#define MEMF   11
-#define ALARM  14
-#define KILL   15
-#define TRAPSET        2
-#define SIGSET 4
-#define SIGMOD 8
-
-VOID           fault();
-BOOL           trapnote;
-STRING         trapcom[];
-BOOL           trapflg[];
-
-/* name tree and words */
-STRING         *environ;
-CHAR           numbuf[];
-MSG            export;
-MSG            readonly;
-
-/* execflgs */
-INT            exitval;
-BOOL           execbrk;
-INT            loopcnt;
-INT            breakcnt;
-
-/* messages */
-MSG            mailmsg;
-MSG            coredump;
-MSG            badopt;
-MSG            badparam;
-MSG            badsub;
-MSG            nospace;
-MSG            notfound;
-MSG            badtrap;
-MSG            baddir;
-MSG            badshift;
-MSG            illegal;
-MSG            restricted;
-MSG            execpmsg;
-MSG            notid;
-MSG            wtfailed;
-MSG            badcreate;
-MSG            piperr;
-MSG            badopen;
-MSG            badnum;
-MSG            arglist;
-MSG            txtbsy;
-MSG            toobig;
-MSG            badexec;
-MSG            notfound;
-MSG            badfile;
-
-address        end[];
-
-#include       "ctype.h"
-
diff --git a/.ref-Research-V7/usr/src/cmd/sh/dup.h b/.ref-Research-V7/usr/src/cmd/sh/dup.h
deleted file mode 100644 (file)
index 4d65981..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#define DUPFLG 0100
diff --git a/.ref-Research-V7/usr/src/cmd/sh/error.c b/.ref-Research-V7/usr/src/cmd/sh/error.c
deleted file mode 100644 (file)
index 144aa66..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-
-/* ========    error handling  ======== */
-
-exitset()
-{
-       assnum(&exitadr,exitval);
-}
-
-sigchk()
-{
-       /* Find out if it is time to go away.
-        * `trapnote' is set to SIGSET when fault is seen and
-        * no trap has been set.
-        */
-       IF trapnote&SIGSET
-       THEN    exitsh(SIGFAIL);
-       FI
-}
-
-failed(s1,s2)
-       STRING  s1, s2;
-{
-       prp(); prs(s1); 
-       IF s2
-       THEN    prs(colon); prs(s2);
-       FI
-       newline(); exitsh(ERROR);
-}
-
-error(s)
-       STRING  s;
-{
-       failed(s,NIL);
-}
-
-exitsh(xno)
-       INT     xno;
-{
-       /* Arrive here from `FATAL' errors
-        *  a) exit command,
-        *  b) default trap,
-        *  c) fault with no trap set.
-        *
-        * Action is to return to command level or exit.
-        */
-       exitval=xno;
-       IF (flags & (forked|errflg|ttyflg)) != ttyflg
-       THEN    done();
-       ELSE    clearup();
-               longjmp(errshell,1);
-       FI
-}
-
-done()
-{
-       REG STRING      t;
-       IF t=trapcom[0]
-       THEN    trapcom[0]=0; /*should free but not long */
-               execexp(t,0);
-       FI
-       rmtemp(0);
-       exit(exitval);
-}
-
-rmtemp(base)
-       IOPTR           base;
-{
-       WHILE iotemp>base
-       DO  unlink(iotemp->ioname);
-           iotemp=iotemp->iolst;
-       OD
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/expand.c b/.ref-Research-V7/usr/src/cmd/sh/expand.c
deleted file mode 100644 (file)
index dd96540..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       <sys/types.h>
-#define DIRSIZ 15
-#include       <sys/stat.h>
-#include       <sys/dir.h>
-
-
-
-/* globals (file name generation)
- *
- * "*" in params matches r.e ".*"
- * "?" in params matches r.e. "."
- * "[...]" in params matches character class
- * "[...a-z...]" in params matches a through z.
- *
- */
-
-PROC VOID      addg();
-
-
-INT    expand(as,rflg)
-       STRING          as;
-{
-       INT             count, dirf;
-       BOOL            dir=0;
-       STRING          rescan = 0;
-       REG STRING      s, cs;
-       ARGPTR          schain = gchain;
-       struct direct   entry;
-       STATBUF         statb;
-
-       IF trapnote&SIGSET THEN return(0); FI
-
-       s=cs=as; entry.d_name[DIRSIZ-1]=0; /* to end the string */
-
-       /* check for meta chars */
-       BEGIN
-          REG BOOL slash; slash=0;
-          WHILE !fngchar(*cs)
-          DO   IF *cs++==0
-               THEN    IF rflg ANDF slash THEN break; ELSE return(0) FI
-               ELIF *cs=='/'
-               THEN    slash++;
-               FI
-          OD
-       END
-
-       LOOP    IF cs==s
-               THEN    s=nullstr;
-                       break;
-               ELIF *--cs == '/'
-               THEN    *cs=0;
-                       IF s==cs THEN s="/" FI
-                       break;
-               FI
-       POOL
-       IF stat(s,&statb)>=0
-           ANDF (statb.st_mode&S_IFMT)==S_IFDIR
-           ANDF (dirf=open(s,0))>0
-       THEN    dir++;
-       FI
-       count=0;
-       IF *cs==0 THEN *cs++=0200 FI
-       IF dir
-       THEN    /* check for rescan */
-               REG STRING rs; rs=cs;
-
-               REP     IF *rs=='/' THEN rescan=rs; *rs=0; gchain=0 FI
-               PER     *rs++ DONE
-
-               WHILE read(dirf, &entry, 16) == 16 ANDF (trapnote&SIGSET) == 0
-               DO      IF entry.d_ino==0 ORF
-                           (*entry.d_name=='.' ANDF *cs!='.')
-                       THEN    continue;
-                       FI
-                       IF gmatch(entry.d_name, cs)
-                       THEN    addg(s,entry.d_name,rescan); count++;
-                       FI
-               OD
-               close(dirf);
-
-               IF rescan
-               THEN    REG ARGPTR      rchain;
-                       rchain=gchain; gchain=schain;
-                       IF count
-                       THEN    count=0;
-                               WHILE rchain
-                               DO      count += expand(rchain->argval,1);
-                                       rchain=rchain->argnxt;
-                               OD
-                       FI
-                       *rescan='/';
-               FI
-       FI
-
-       BEGIN
-          REG CHAR     c;
-          s=as;
-          WHILE c = *s
-          DO   *s++=(c&STRIP?c:'/') OD
-       END
-       return(count);
-}
-
-gmatch(s, p)
-       REG STRING      s, p;
-{
-       REG INT         scc;
-       CHAR            c;
-
-       IF scc = *s++
-       THEN    IF (scc &= STRIP)==0
-               THEN    scc=0200;
-               FI
-       FI
-       SWITCH c = *p++ IN
-
-           case '[':
-               {BOOL ok; INT lc;
-               ok=0; lc=077777;
-               WHILE c = *p++
-               DO      IF c==']'
-                       THEN    return(ok?gmatch(s,p):0);
-                       ELIF c==MINUS
-                       THEN    IF lc<=scc ANDF scc<=(*p++) THEN ok++ FI
-                       ELSE    IF scc==(lc=(c&STRIP)) THEN ok++ FI
-                       FI
-               OD
-               return(0);
-               }
-
-           default:
-               IF (c&STRIP)!=scc THEN return(0) FI
-
-           case '?':
-               return(scc?gmatch(s,p):0);
-
-           case '*':
-               IF *p==0 THEN return(1) FI
-               --s;
-               WHILE *s
-               DO  IF gmatch(s++,p) THEN return(1) FI OD
-               return(0);
-
-           case 0:
-               return(scc==0);
-       ENDSW
-}
-
-LOCAL VOID     addg(as1,as2,as3)
-       STRING          as1, as2, as3;
-{
-       REG STRING      s1, s2;
-       REG INT         c;
-
-       s2 = locstak()+BYTESPERWORD;
-
-       s1=as1;
-       WHILE c = *s1++
-       DO      IF (c &= STRIP)==0
-               THEN    *s2++='/';
-                       break;
-               FI
-               *s2++=c;
-       OD
-       s1=as2;
-       WHILE *s2 = *s1++ DO s2++ OD
-       IF s1=as3
-       THEN    *s2++='/';
-               WHILE *s2++ = *++s1 DONE
-       FI
-       makearg(endstak(s2));
-}
-
-makearg(args)
-       REG STRING      args;
-{
-       args->argnxt=gchain;
-       gchain=args;
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/sh/fault.c b/.ref-Research-V7/usr/src/cmd/sh/fault.c
deleted file mode 100644 (file)
index 9a60de3..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-
-STRING         trapcom[MAXTRAP];
-BOOL           trapflg[MAXTRAP];
-
-/* ========    fault handling routines    ======== */
-
-
-VOID   fault(sig)
-       REG INT         sig;
-{
-       REG INT         flag;
-
-       signal(sig,fault);
-       IF sig==MEMF
-       THEN    IF setbrk(brkincr) == -1
-               THEN    error(nospace);
-               FI
-       ELIF sig==ALARM
-       THEN    IF flags&waiting
-               THEN    done();
-               FI
-       ELSE    flag = (trapcom[sig] ? TRAPSET : SIGSET);
-               trapnote |= flag;
-               trapflg[sig] |= flag;
-       FI
-}
-
-stdsigs()
-{
-       ignsig(QUIT);
-       getsig(INTR);
-       getsig(MEMF);
-       getsig(ALARM);
-}
-
-ignsig(n)
-{
-       REG INT         s, i;
-
-       IF (s=signal(i=n,1)&01)==0
-       THEN    trapflg[i] |= SIGMOD;
-       FI
-       return(s);
-}
-
-getsig(n)
-{
-       REG INT         i;
-
-       IF trapflg[i=n]&SIGMOD ORF ignsig(i)==0
-       THEN    signal(i,fault);
-       FI
-}
-
-oldsigs()
-{
-       REG INT         i;
-       REG STRING      t;
-
-       i=MAXTRAP;
-       WHILE i--
-       DO  t=trapcom[i];
-           IF t==0 ORF *t
-           THEN clrsig(i);
-           FI
-           trapflg[i]=0;
-       OD
-       trapnote=0;
-}
-
-clrsig(i)
-       INT             i;
-{
-       free(trapcom[i]); trapcom[i]=0;
-       IF trapflg[i]&SIGMOD
-       THEN    signal(i,fault);
-               trapflg[i] &= ~SIGMOD;
-       FI
-}
-
-chktrap()
-{
-       /* check for traps */
-       REG INT         i=MAXTRAP;
-       REG STRING      t;
-
-       trapnote &= ~TRAPSET;
-       WHILE --i
-       DO IF trapflg[i]&TRAPSET
-          THEN trapflg[i] &= ~TRAPSET;
-               IF t=trapcom[i]
-               THEN    INT     savxit=exitval;
-                       execexp(t,0);
-                       exitval=savxit; exitset();
-               FI
-          FI
-       OD
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/io.c b/.ref-Research-V7/usr/src/cmd/sh/io.c
deleted file mode 100644 (file)
index c94be39..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       "dup.h"
-
-
-/* ========    input output and file copying ======== */
-
-initf(fd)
-       UFD             fd;
-{
-       REG FILE        f=standin;
-
-       f->fdes=fd; f->fsiz=((flags&(oneflg|ttyflg))==0 ? BUFSIZ : 1);
-       f->fnxt=f->fend=f->fbuf; f->feval=0; f->flin=1;
-       f->feof=FALSE;
-}
-
-estabf(s)
-       REG STRING      s;
-{
-       REG FILE        f;
-
-       (f=standin)->fdes = -1;
-       f->fend=length(s)+(f->fnxt=s);
-       f->flin=1;
-       return(f->feof=(s==0));
-}
-
-push(af)
-       FILE            af;
-{
-       REG FILE        f;
-
-       (f=af)->fstak=standin;
-       f->feof=0; f->feval=0;
-       standin=f;
-}
-
-pop()
-{
-       REG FILE        f;
-
-       IF (f=standin)->fstak
-       THEN    IF f->fdes>=0 THEN close(f->fdes) FI
-               standin=f->fstak;
-               return(TRUE);
-       ELSE    return(FALSE);
-       FI
-}
-
-chkpipe(pv)
-       INT             *pv;
-{
-       IF pipe(pv)<0 ORF pv[INPIPE]<0 ORF pv[OTPIPE]<0
-       THEN    error(piperr);
-       FI
-}
-
-chkopen(idf)
-       STRING          idf;
-{
-       REG INT         rc;
-
-       IF (rc=open(idf,0))<0
-       THEN    failed(idf,badopen);
-       ELSE    return(rc);
-       FI
-}
-
-rename(f1,f2)
-       REG INT         f1, f2;
-{
-       IF f1!=f2
-       THEN    dup(f1|DUPFLG, f2);
-               close(f1);
-               IF f2==0 THEN ioset|=1 FI
-       FI
-}
-
-create(s)
-       STRING          s;
-{
-       REG INT         rc;
-
-       IF (rc=creat(s,0666))<0
-       THEN    failed(s,badcreate);
-       ELSE    return(rc);
-       FI
-}
-
-tmpfil()
-{
-       itos(serial++); movstr(numbuf,tmpnam);
-       return(create(tmpout));
-}
-
-/* set by trim */
-BOOL           nosubst;
-
-copy(ioparg)
-       IOPTR           ioparg;
-{
-       CHAR            c, *ends;
-       REG CHAR        *cline, *clinep;
-       INT             fd;
-       REG IOPTR       iop;
-
-       IF iop=ioparg
-       THEN    copy(iop->iolst);
-               ends=mactrim(iop->ioname); IF nosubst THEN iop->iofile &= ~IODOC FI
-               fd=tmpfil();
-               iop->ioname=cpystak(tmpout);
-               iop->iolst=iotemp; iotemp=iop;
-               cline=locstak();
-
-               LOOP    clinep=cline; chkpr(NL);
-                       WHILE (c = (nosubst ? readc() :  nextc(*ends)),  !eolchar(c)) DO *clinep++ = c OD
-                       *clinep=0;
-                       IF eof ORF eq(cline,ends) THEN break FI
-                       *clinep++=NL;
-                       write(fd,cline,clinep-cline);
-               POOL
-               close(fd);
-       FI
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/mac.h b/.ref-Research-V7/usr/src/cmd/sh/mac.h
deleted file mode 100644 (file)
index 46f0ab1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#define LOCAL  static
-#define PROC   extern
-#define TYPE   typedef
-#define STRUCT TYPE struct
-#define UNION  TYPE union
-#define REG    register
-
-#define IF     if(
-#define THEN   ){
-#define ELSE   } else {
-#define ELIF   } else if (
-#define FI     ;}
-
-#define BEGIN  {
-#define END    }
-#define SWITCH switch(
-#define IN     ){
-#define ENDSW  }
-#define FOR    for(
-#define WHILE  while(
-#define DO     ){
-#define OD     ;}
-#define REP    do{
-#define PER    }while(
-#define DONE   );
-#define LOOP   for(;;){
-#define POOL   }
-
-
-#define SKIP   ;
-#define DIV    /
-#define REM    %
-#define NEQ    ^
-#define ANDF   &&
-#define ORF    ||
-
-#define TRUE   (-1)
-#define FALSE  0
-#define LOBYTE 0377
-#define STRIP  0177
-#define QUOTE  0200
-
-#define EOF    0
-#define NL     '\n'
-#define SP     ' '
-#define LQ     '`'
-#define RQ     '\''
-#define MINUS  '-'
-#define COLON  ':'
-
-#define MAX(a,b)       ((a)>(b)?(a):(b))
diff --git a/.ref-Research-V7/usr/src/cmd/sh/macro.c b/.ref-Research-V7/usr/src/cmd/sh/macro.c
deleted file mode 100644 (file)
index fd9b4eb..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       "sym.h"
-
-LOCAL CHAR     quote;  /* used locally */
-LOCAL CHAR     quoted; /* used locally */
-
-
-
-LOCAL STRING   copyto(endch)
-       REG CHAR        endch;
-{
-       REG CHAR        c;
-
-       WHILE (c=getch(endch))!=endch ANDF c
-       DO pushstak(c|quote) OD
-       zerostak();
-       IF c!=endch THEN error(badsub) FI
-}
-
-LOCAL  skipto(endch)
-       REG CHAR        endch;
-{
-       /* skip chars up to } */
-       REG CHAR        c;
-       WHILE (c=readc()) ANDF c!=endch
-       DO      SWITCH c IN
-
-               case SQUOTE:    skipto(SQUOTE); break;
-
-               case DQUOTE:    skipto(DQUOTE); break;
-
-               case DOLLAR:    IF readc()==BRACE
-                               THEN    skipto('}');
-                               FI
-               ENDSW
-       OD
-       IF c!=endch THEN error(badsub) FI
-}
-
-LOCAL  getch(endch)
-       CHAR            endch;
-{
-       REG CHAR        d;
-
-retry:
-       d=readc();
-       IF !subchar(d)
-       THEN    return(d);
-       FI
-       IF d==DOLLAR
-       THEN    REG INT c;
-               IF (c=readc(), dolchar(c))
-               THEN    NAMPTR          n=NIL;
-                       INT             dolg=0;
-                       BOOL            bra;
-                       REG STRING      argp, v;
-                       CHAR            idb[2];
-                       STRING          id=idb;
-
-                       IF bra=(c==BRACE) THEN c=readc() FI
-                       IF letter(c)
-                       THEN    argp=relstak();
-                               WHILE alphanum(c) DO pushstak(c); c=readc() OD
-                               zerostak();
-                               n=lookup(absstak(argp)); setstak(argp);
-                               v = n->namval; id = n->namid;
-                               peekc = c|MARK;;
-                       ELIF digchar(c)
-                       THEN    *id=c; idb[1]=0;
-                               IF astchar(c)
-                               THEN    dolg=1; c='1';
-                               FI
-                               c -= '0';
-                               v=((c==0) ? cmdadr : (c<=dolc) ? dolv[c] : (dolg=0));
-                       ELIF c=='$'
-                       THEN    v=pidadr;
-                       ELIF c=='!'
-                       THEN    v=pcsadr;
-                       ELIF c=='#'
-                       THEN    v=dolladr;
-                       ELIF c=='?'
-                       THEN    v=exitadr;
-                       ELIF c=='-'
-                       THEN    v=flagadr;
-                       ELIF bra THEN error(badsub);
-                       ELSE    goto retry;
-                       FI
-                       c = readc();
-                       IF !defchar(c) ANDF bra
-                       THEN    error(badsub);
-                       FI
-                       argp=0;
-                       IF bra
-                       THEN    IF c!='}'
-                               THEN    argp=relstak();
-                                       IF (v==0)NEQ(setchar(c))
-                                       THEN    copyto('}');
-                                       ELSE    skipto('}');
-                                       FI
-                                       argp=absstak(argp);
-                               FI
-                       ELSE    peekc = c|MARK; c = 0;
-                       FI
-                       IF v
-                       THEN    IF c!='+'
-                               THEN    LOOP WHILE c = *v++
-                                            DO pushstak(c|quote); OD
-                                            IF dolg==0 ORF (++dolg>dolc)
-                                            THEN break;
-                                            ELSE v=dolv[dolg]; pushstak(SP|(*id=='*' ? quote : 0));
-                                            FI
-                                       POOL
-                               FI
-                       ELIF argp
-                       THEN    IF c=='?'
-                               THEN    failed(id,*argp?argp:badparam);
-                               ELIF c=='='
-                               THEN    IF n
-                                       THEN    assign(n,argp);
-                                       ELSE    error(badsub);
-                                       FI
-                               FI
-                       ELIF flags&setflg
-                       THEN    failed(id,badparam);
-                       FI
-                       goto retry;
-               ELSE    peekc=c|MARK;
-               FI
-       ELIF d==endch
-       THEN    return(d);
-       ELIF d==SQUOTE
-       THEN    comsubst(); goto retry;
-       ELIF d==DQUOTE
-       THEN    quoted++; quote^=QUOTE; goto retry;
-       FI
-       return(d);
-}
-
-STRING macro(as)
-       STRING          as;
-{
-       /* Strip "" and do $ substitution
-        * Leaves result on top of stack
-        */
-       REG BOOL        savqu =quoted;
-       REG CHAR        savq = quote;
-       FILEHDR         fb;
-
-       push(&fb); estabf(as);
-       usestak();
-       quote=0; quoted=0;
-       copyto(0);
-       pop();
-       IF quoted ANDF (stakbot==staktop) THEN pushstak(QUOTE) FI
-       quote=savq; quoted=savqu;
-       return(fixstak());
-}
-
-LOCAL  comsubst()
-{
-       /* command substn */
-       FILEBLK         cb;
-       REG CHAR        d;
-       REG STKPTR      savptr = fixstak();
-
-       usestak();
-       WHILE (d=readc())!=SQUOTE ANDF d
-       DO pushstak(d) OD
-
-       BEGIN
-          REG STRING   argc;
-          trim(argc=fixstak());
-          push(&cb); estabf(argc);
-       END
-       BEGIN
-          REG TREPTR   t = makefork(FPOU,cmd(EOFSYM,MTFLG|NLFLG));
-          INT          pv[2];
-
-          /* this is done like this so that the pipe
-           * is open only when needed
-           */
-          chkpipe(pv);
-          initf(pv[INPIPE]);
-          execute(t, 0, 0, pv);
-          close(pv[OTPIPE]);
-       END
-       tdystak(savptr); staktop=movstr(savptr,stakbot);
-       WHILE d=readc() DO pushstak(d|quote) OD
-       await(0);
-       WHILE stakbot!=staktop
-       DO      IF (*--staktop&STRIP)!=NL
-               THEN    ++staktop; break;
-               FI
-       OD
-       pop();
-}
-
-#define CPYSIZ 512
-
-subst(in,ot)
-       INT             in, ot;
-{
-       REG CHAR        c;
-       FILEBLK         fb;
-       REG INT         count=CPYSIZ;
-
-       push(&fb); initf(in);
-       /* DQUOTE used to stop it from quoting */
-       WHILE c=(getch(DQUOTE)&STRIP)
-       DO pushstak(c);
-          IF --count == 0
-          THEN flush(ot); count=CPYSIZ;
-          FI
-       OD
-       flush(ot);
-       pop();
-}
-
-LOCAL  flush(ot)
-{
-       write(ot,stakbot,staktop-stakbot);
-       IF flags&execpr THEN write(output,stakbot,staktop-stakbot) FI
-       staktop=stakbot;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/main.c b/.ref-Research-V7/usr/src/cmd/sh/main.c
deleted file mode 100644 (file)
index 5d5f979..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       "dup.h"
-#include       "sym.h"
-#include       "timeout.h"
-#include       <sys/types.h>
-#include       <sys/stat.h>
-#include       <sgtty.h>
-
-UFD            output = 2;
-LOCAL BOOL     beenhere = FALSE;
-CHAR           tmpout[20] = "/tmp/sh-";
-FILEBLK                stdfile;
-FILE           standin = &stdfile;
-#include       <execargs.h>
-
-PROC VOID      exfile();
-
-
-
-
-main(c, v)
-       INT             c;
-       STRING          v[];
-{
-       REG INT         rflag=ttyflg;
-
-       /* initialise storage allocation */
-       stdsigs();
-       setbrk(BRKINCR);
-       addblok((POS)0);
-
-       /* set names from userenv */
-       getenv();
-
-       /* look for restricted */
-/*     IF c>0 ANDF any('r', *v) THEN rflag=0 FI */
-
-       /* look for options */
-       dolc=options(c,v);
-       IF dolc<2 THEN flags |= stdflg FI
-       IF (flags&stdflg)==0
-       THEN    dolc--;
-       FI
-       dolv=v+c-dolc; dolc--;
-
-       /* return here for shell file execution */
-       setjmp(subshell);
-
-       /* number of positional parameters */
-       assnum(&dolladr,dolc);
-       cmdadr=dolv[0];
-
-       /* set pidname */
-       assnum(&pidadr, getpid());
-
-       /* set up temp file names */
-       settmp();
-
-       /* default ifs */
-       dfault(&ifsnod, sptbnl);
-
-       IF (beenhere++)==FALSE
-       THEN    /* ? profile */
-               IF *cmdadr=='-'
-                   ANDF (input=pathopen(nullstr, profile))>=0
-               THEN    exfile(rflag); flags &= ~ttyflg;
-               FI
-               IF rflag==0 THEN flags |= rshflg FI
-
-               /* open input file if specified */
-               IF comdiv
-               THEN    estabf(comdiv); input = -1;
-               ELSE    input=((flags&stdflg) ? 0 : chkopen(cmdadr));
-                       comdiv--;
-               FI
-       ELSE    *execargs=dolv; /* for `ps' cmd */
-       FI
-
-       exfile(0);
-       done();
-}
-
-LOCAL VOID     exfile(prof)
-BOOL           prof;
-{
-       REG L_INT       mailtime = 0;
-       REG INT         userid;
-       struct stat     statb;
-
-       /* move input */
-       IF input>0
-       THEN    Ldup(input,INIO);
-               input=INIO;
-       FI
-
-       /* move output to safe place */
-       IF output==2
-       THEN    Ldup(dup(2),OTIO);
-               output=OTIO;
-       FI
-
-       userid=getuid();
-
-       /* decide whether interactive */
-       IF (flags&intflg) ORF ((flags&oneflg)==0 ANDF gtty(output,&statb)==0 ANDF gtty(input,&statb)==0)
-       THEN    dfault(&ps1nod, (userid?stdprompt:supprompt));
-               dfault(&ps2nod, readmsg);
-               flags |= ttyflg|prompt; ignsig(KILL);
-       ELSE    flags |= prof; flags &= ~prompt;
-       FI
-
-       IF setjmp(errshell) ANDF prof
-       THEN    close(input); return;
-       FI
-
-       /* error return here */
-       loopcnt=breakcnt=peekc=0; iopend=0;
-       IF input>=0 THEN initf(input) FI
-
-       /* command loop */
-       LOOP    tdystak(0);
-               stakchk(); /* may reduce sbrk */
-               exitset();
-               IF (flags&prompt) ANDF standin->fstak==0 ANDF !eof
-               THEN    IF mailnod.namval
-                           ANDF stat(mailnod.namval,&statb)>=0 ANDF statb.st_size
-                           ANDF (statb.st_mtime != mailtime)
-                           ANDF mailtime
-                       THEN    prs(mailmsg)
-                       FI
-                       mailtime=statb.st_mtime;
-                       prs(ps1nod.namval); alarm(TIMEOUT); flags |= waiting;
-               FI
-
-               trapnote=0; peekc=readc();
-               IF eof
-               THEN    return;
-               FI
-               alarm(0); flags &= ~waiting;
-               execute(cmd(NL,MTFLG),0);
-               eof |= (flags&oneflg);
-       POOL
-}
-
-chkpr(eor)
-char eor;
-{
-       IF (flags&prompt) ANDF standin->fstak==0 ANDF eor==NL
-       THEN    prs(ps2nod.namval);
-       FI
-}
-
-settmp()
-{
-       itos(getpid()); serial=0;
-       tmpnam=movstr(numbuf,&tmpout[TMPNAM]);
-}
-
-Ldup(fa, fb)
-       REG INT         fa, fb;
-{
-       dup(fa|DUPFLG, fb);
-       close(fa);
-       ioctl(fb, FIOCLEX, 0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/makefile b/.ref-Research-V7/usr/src/cmd/sh/makefile
deleted file mode 100644 (file)
index bf520ab..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-CFLAGS = -n -s -O
-
-all:   sh
-
-cp:    sh
-       cp sh /bin/sh
-       rm sh *.o
-
-cmp:   sh
-       cmp sh /bin/sh
-       rm sh *.o
-
-sh:    setbrk.o
-sh:    builtin.o blok.o stak.o
-sh:    cmd.o fault.o main.o
-sh:    word.o string.o name.o args.o
-sh:    xec.o service.o error.o io.o
-sh:    print.o macro.o expand.o
-sh:    ctype.o msg.o
-blok.o:                brkincr.h
-fault.o:       brkincr.h
-main.o:                brkincr.h
-stak.o:                brkincr.h
-
-sh:;           cc -o sh -n -s *.o
-
-newsys:;       :newsys file=msg; make sh
-install:;      :install
-diff:;         :diff
-list:;         list Makefile *.h *.s *.c
-
-.c.o:; cc -O -c $<
-.c.s:; cc -O -S -o $*.s $<
-.s.o:; as - -o $*.o /usr/include/sys.s $<
diff --git a/.ref-Research-V7/usr/src/cmd/sh/mode.h b/.ref-Research-V7/usr/src/cmd/sh/mode.h
deleted file mode 100644 (file)
index 4fb3a52..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-#
-/*
- *     UNIX shell
- */
-
-
-#define BYTESPERWORD   (sizeof(char *))
-
-TYPE char      CHAR;
-TYPE char      BOOL;
-TYPE int       UFD;
-TYPE int       INT;
-TYPE float     REAL;
-TYPE char      *ADDRESS;
-TYPE long int  L_INT;
-TYPE int       VOID;
-TYPE unsigned  POS;
-TYPE char      *STRING;
-TYPE char      MSG[];
-TYPE int       PIPE[];
-TYPE char      *STKPTR;
-TYPE char      *BYTPTR;
-
-STRUCT stat    STATBUF;        /* defined in /usr/sys/stat.h */
-STRUCT blk     *BLKPTR;
-STRUCT fileblk FILEBLK;
-STRUCT filehdr FILEHDR;
-STRUCT fileblk *FILE;
-STRUCT trenod  *TREPTR;
-STRUCT forknod *FORKPTR;
-STRUCT comnod  *COMPTR;
-STRUCT swnod   *SWPTR;
-STRUCT regnod  *REGPTR;
-STRUCT parnod  *PARPTR;
-STRUCT ifnod   *IFPTR;
-STRUCT whnod   *WHPTR;
-STRUCT fornod  *FORPTR;
-STRUCT lstnod  *LSTPTR;
-STRUCT argnod  *ARGPTR;
-STRUCT dolnod  *DOLPTR;
-STRUCT ionod   *IOPTR;
-STRUCT namnod  NAMNOD;
-STRUCT namnod  *NAMPTR;
-STRUCT sysnod  SYSNOD;
-STRUCT sysnod  *SYSPTR;
-STRUCT sysnod  SYSTAB[];
-#define NIL    ((char*)0)
-
-
-/* the following nonsense is required
- * because casts turn an Lvalue
- * into an Rvalue so two cheats
- * are necessary, one for each context.
- */
-union { int _cheat;};
-#define Lcheat(a)      ((a)._cheat)
-#define Rcheat(a)      ((int)(a))
-
-
-/* address puns for storage allocation */
-UNION {
-       FORKPTR _forkptr;
-       COMPTR  _comptr;
-       PARPTR  _parptr;
-       IFPTR   _ifptr;
-       WHPTR   _whptr;
-       FORPTR  _forptr;
-       LSTPTR  _lstptr;
-       BLKPTR  _blkptr;
-       NAMPTR  _namptr;
-       BYTPTR  _bytptr;
-       }       address;
-
-
-/* for functions that do not return values */
-struct void {INT vvvvvvvv;};
-
-
-/* heap storage */
-struct blk {
-       BLKPTR  word;
-};
-
-#define        BUFSIZ  64
-struct fileblk {
-       UFD     fdes;
-       POS     flin;
-       BOOL    feof;
-       CHAR    fsiz;
-       STRING  fnxt;
-       STRING  fend;
-       STRING  *feval;
-       FILE    fstak;
-       CHAR    fbuf[BUFSIZ];
-};
-
-/* for files not used with file descriptors */
-struct filehdr {
-       UFD     fdes;
-       POS     flin;
-       BOOL    feof;
-       CHAR    fsiz;
-       STRING  fnxt;
-       STRING  fend;
-       STRING  *feval;
-       FILE    fstak;
-       CHAR    _fbuf[1];
-};
-
-struct sysnod {
-       STRING  sysnam;
-       INT     sysval;
-};
-
-/* this node is a proforma for those that follow */
-struct trenod {
-       INT     tretyp;
-       IOPTR   treio;
-};
-
-/* dummy for access only */
-struct argnod {
-       ARGPTR  argnxt;
-       CHAR    argval[1];
-};
-
-struct dolnod {
-       DOLPTR  dolnxt;
-       INT     doluse;
-       CHAR    dolarg[1];
-};
-
-struct forknod {
-       INT     forktyp;
-       IOPTR   forkio;
-       TREPTR  forktre;
-};
-
-struct comnod {
-       INT     comtyp;
-       IOPTR   comio;
-       ARGPTR  comarg;
-       ARGPTR  comset;
-};
-
-struct ifnod {
-       INT     iftyp;
-       TREPTR  iftre;
-       TREPTR  thtre;
-       TREPTR  eltre;
-};
-
-struct whnod {
-       INT     whtyp;
-       TREPTR  whtre;
-       TREPTR  dotre;
-};
-
-struct fornod {
-       INT     fortyp;
-       TREPTR  fortre;
-       STRING  fornam;
-       COMPTR  forlst;
-};
-
-struct swnod {
-       INT     swtyp;
-       STRING  swarg;
-       REGPTR  swlst;
-};
-
-struct regnod {
-       ARGPTR  regptr;
-       TREPTR  regcom;
-       REGPTR  regnxt;
-};
-
-struct parnod {
-       INT     partyp;
-       TREPTR  partre;
-};
-
-struct lstnod {
-       INT     lsttyp;
-       TREPTR  lstlef;
-       TREPTR  lstrit;
-};
-
-struct ionod {
-       INT     iofile;
-       STRING  ioname;
-       IOPTR   ionxt;
-       IOPTR   iolst;
-};
-
-#define        FORKTYPE        (sizeof(struct forknod))
-#define        COMTYPE         (sizeof(struct comnod))
-#define        IFTYPE          (sizeof(struct ifnod))
-#define        WHTYPE          (sizeof(struct whnod))
-#define        FORTYPE         (sizeof(struct fornod))
-#define        SWTYPE          (sizeof(struct swnod))
-#define        REGTYPE         (sizeof(struct regnod))
-#define        PARTYPE         (sizeof(struct parnod))
-#define        LSTTYPE         (sizeof(struct lstnod))
-#define        IOTYPE          (sizeof(struct ionod))
diff --git a/.ref-Research-V7/usr/src/cmd/sh/msg.c b/.ref-Research-V7/usr/src/cmd/sh/msg.c
deleted file mode 100644 (file)
index eb13b71..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-
-#include       "defs.h"
-#include       "sym.h"
-
-MSG            version = "\nVERSION sys137     DATE 1978 Nov 6 14:29:22\n";
-
-/* error messages */
-MSG    badopt          = "bad option(s)";
-MSG    mailmsg         = "you have mail\n";
-MSG    nospace         = "no space";
-MSG    synmsg          = "syntax error";
-
-MSG    badnum          = "bad number";
-MSG    badparam        = "parameter not set";
-MSG    badsub          = "bad substitution";
-MSG    badcreate       = "cannot create";
-MSG    illegal         = "illegal io";
-MSG    restricted      = "restricted";
-MSG    piperr          = "cannot make pipe";
-MSG    badopen         = "cannot open";
-MSG    coredump        = " - core dumped";
-MSG    arglist         = "arg list too long";
-MSG    txtbsy          = "text busy";
-MSG    toobig          = "too big";
-MSG    badexec         = "cannot execute";
-MSG    notfound        = "not found";
-MSG    badfile         = "bad file number";
-MSG    badshift        = "cannot shift";
-MSG    baddir          = "bad directory";
-MSG    badtrap         = "bad trap";
-MSG    wtfailed        = "is read only";
-MSG    notid           = "is not an identifier";
-
-/* built in names */
-MSG    pathname        = "PATH";
-MSG    homename        = "HOME";
-MSG    mailname        = "MAIL";
-MSG    fngname         = "FILEMATCH";
-MSG    ifsname         = "IFS";
-MSG    ps1name         = "PS1";
-MSG    ps2name         = "PS2";
-
-/* string constants */
-MSG    nullstr         = "";
-MSG    sptbnl          = " \t\n";
-MSG    defpath         = ":/bin:/usr/bin";
-MSG    colon           = ": ";
-MSG    minus           = "-";
-MSG    endoffile       = "end of file";
-MSG    unexpected      = " unexpected";
-MSG    atline          = " at line ";
-MSG    devnull         = "/dev/null";
-MSG    execpmsg        = "+ ";
-MSG    readmsg         = "> ";
-MSG    stdprompt       = "$ ";
-MSG    supprompt       = "# ";
-MSG    profile         = ".profile";
-
-
-/* tables */
-SYSTAB reserved {
-               {"in",          INSYM},
-               {"esac",        ESSYM},
-               {"case",        CASYM},
-               {"for",         FORSYM},
-               {"done",        ODSYM},
-               {"if",          IFSYM},
-               {"while",       WHSYM},
-               {"do",          DOSYM},
-               {"then",        THSYM},
-               {"else",        ELSYM},
-               {"elif",        EFSYM},
-               {"fi",          FISYM},
-               {"until",       UNSYM},
-               { "{",          BRSYM},
-               { "}",          KTSYM},
-               {0,     0},
-};
-
-STRING sysmsg[] {
-               0,
-               "Hangup",
-               0,      /* Interrupt */
-               "Quit",
-               "Illegal instruction",
-               "Trace/BPT trap",
-               "IOT trap",
-               "EMT trap",
-               "Floating exception",
-               "Killed",
-               "Bus error",
-               "Memory fault",
-               "Bad system call",
-               0,      /* Broken pipe */
-               "Alarm call",
-               "Terminated",
-               "Signal 16",
-};
-
-MSG            export = "export";
-MSG            readonly = "readonly";
-SYSTAB commands {
-               {"cd",          SYSCD},
-               {"read",        SYSREAD},
-/*
-               {"[",           SYSTST},
-*/
-               {"set",         SYSSET},
-               {":",           SYSNULL},
-               {"trap",        SYSTRAP},
-               {"login",       SYSLOGIN},
-               {"wait",        SYSWAIT},
-               {"eval",        SYSEVAL},
-               {".",           SYSDOT},
-               {"newgrp",      SYSLOGIN},
-               {readonly,      SYSRDONLY},
-               {export,        SYSXPORT},
-               {"chdir",       SYSCD},
-               {"break",       SYSBREAK},
-               {"continue",    SYSCONT},
-               {"shift",       SYSSHFT},
-               {"exit",        SYSEXIT},
-               {"exec",        SYSEXEC},
-               {"times",       SYSTIMES},
-               {"umask",       SYSUMASK},
-               {0,     0},
-};
diff --git a/.ref-Research-V7/usr/src/cmd/sh/name.c b/.ref-Research-V7/usr/src/cmd/sh/name.c
deleted file mode 100644 (file)
index 6567b55..0000000
+++ /dev/null
@@ -1,320 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-PROC BOOL      chkid();
-
-
-NAMNOD ps2nod  = {     NIL,            NIL,            ps2name},
-       fngnod  = {     NIL,            NIL,            fngname},
-       pathnod = {     NIL,            NIL,            pathname},
-       ifsnod  = {     NIL,            NIL,            ifsname},
-       ps1nod  = {     &pathnod,       &ps2nod,        ps1name},
-       homenod = {     &fngnod,        &ifsnod,        homename},
-       mailnod = {     &homenod,       &ps1nod,        mailname};
-
-NAMPTR         namep = &mailnod;
-
-
-/* ========    variable and string handling    ======== */
-
-syslook(w,syswds)
-       STRING          w;
-       SYSTAB          syswds;
-{
-       REG CHAR        first;
-       REG STRING      s;
-       REG SYSPTR      syscan;
-
-       syscan=syswds; first = *w;
-
-       WHILE s=syscan->sysnam
-       DO  IF first == *s
-               ANDF eq(w,s)
-           THEN return(syscan->sysval);
-           FI
-           syscan++;
-       OD
-       return(0);
-}
-
-setlist(arg,xp)
-       REG ARGPTR      arg;
-       INT             xp;
-{
-       WHILE arg
-       DO REG STRING   s=mactrim(arg->argval);
-          setname(s, xp);
-          arg=arg->argnxt;
-          IF flags&execpr
-          THEN prs(s);
-               IF arg THEN blank(); ELSE newline(); FI
-          FI
-       OD
-}
-
-VOID   setname(argi, xp)
-       STRING          argi;
-       INT             xp;
-{
-       REG STRING      argscan=argi;
-       REG NAMPTR      n;
-
-       IF letter(*argscan)
-       THEN    WHILE alphanum(*argscan) DO argscan++ OD
-               IF *argscan=='='
-               THEN    *argscan = 0;
-                       n=lookup(argi);
-                       *argscan++ = '=';
-                       attrib(n, xp);
-                       IF xp&N_ENVNAM
-                       THEN    n->namenv = n->namval = argscan;
-                       ELSE    assign(n, argscan);
-                       FI
-                       return;
-               FI
-       FI
-       failed(argi,notid);
-}
-
-replace(a, v)
-       REG STRING      *a;
-       STRING          v;
-{
-       free(*a); *a=make(v);
-}
-
-dfault(n,v)
-       NAMPTR          n;
-       STRING          v;
-{
-       IF n->namval==0
-       THEN    assign(n,v)
-       FI
-}
-
-assign(n,v)
-       NAMPTR          n;
-       STRING          v;
-{
-       IF n->namflg&N_RDONLY
-       THEN    failed(n->namid,wtfailed);
-       ELSE    replace(&n->namval,v);
-       FI
-}
-
-INT    readvar(names)
-       STRING          *names;
-{
-       FILEBLK         fb;
-       REG FILE        f = &fb;
-       REG CHAR        c;
-       REG INT         rc=0;
-       NAMPTR          n=lookup(*names++); /* done now to avoid storage mess */
-       STKPTR          rel=relstak();
-
-       push(f); initf(dup(0));
-       IF lseek(0,0L,1)==-1
-       THEN    f->fsiz=1;
-       FI
-
-       LOOP    c=nextc(0);
-               IF (*names ANDF any(c, ifsnod.namval)) ORF eolchar(c)
-               THEN    zerostak();
-                       assign(n,absstak(rel)); setstak(rel);
-                       IF *names
-                       THEN    n=lookup(*names++);
-                       ELSE    n=0;
-                       FI
-                       IF eolchar(c)
-                       THEN    break;
-                       FI
-               ELSE    pushstak(c);
-               FI
-       POOL
-       WHILE n
-       DO assign(n, nullstr);
-          IF *names THEN n=lookup(*names++); ELSE n=0; FI
-       OD
-
-       IF eof THEN rc=1 FI
-       lseek(0, (long)(f->fnxt-f->fend), 1);
-       pop();
-       return(rc);
-}
-
-assnum(p, i)
-       STRING          *p;
-       INT             i;
-{
-       itos(i); replace(p,numbuf);
-}
-
-STRING make(v)
-       STRING          v;
-{
-       REG STRING      p;
-
-       IF v
-       THEN    movstr(v,p=alloc(length(v)));
-               return(p);
-       ELSE    return(0);
-       FI
-}
-
-
-NAMPTR         lookup(nam)
-       REG STRING      nam;
-{
-       REG NAMPTR      nscan=namep;
-       REG NAMPTR      *prev;
-       INT             LR;
-
-       IF !chkid(nam)
-       THEN    failed(nam,notid);
-       FI
-       WHILE nscan
-       DO      IF (LR=cf(nam,nscan->namid))==0
-               THEN    return(nscan);
-               ELIF LR<0
-               THEN    prev = &(nscan->namlft);
-               ELSE    prev = &(nscan->namrgt);
-               FI
-               nscan = *prev;
-       OD
-
-       /* add name node */
-       nscan=alloc(sizeof *nscan);
-       nscan->namlft=nscan->namrgt=NIL;
-       nscan->namid=make(nam);
-       nscan->namval=0; nscan->namflg=N_DEFAULT; nscan->namenv=0;
-       return(*prev = nscan);
-}
-
-LOCAL BOOL     chkid(nam)
-       STRING          nam;
-{
-       REG CHAR *      cp=nam;
-
-       IF !letter(*cp)
-       THEN    return(FALSE);
-       ELSE    WHILE *++cp
-               DO IF !alphanum(*cp)
-                  THEN return(FALSE);
-                  FI
-               OD
-       FI
-       return(TRUE);
-}
-
-LOCAL VOID (*namfn)();
-namscan(fn)
-       VOID            (*fn)();
-{
-       namfn=fn;
-       namwalk(namep);
-}
-
-LOCAL VOID     namwalk(np)
-       REG NAMPTR      np;
-{
-       IF np
-       THEN    namwalk(np->namlft);
-               (*namfn)(np);
-               namwalk(np->namrgt);
-       FI
-}
-
-VOID   printnam(n)
-       NAMPTR          n;
-{
-       REG STRING      s;
-
-       sigchk();
-       IF s=n->namval
-       THEN    prs(n->namid);
-               prc('='); prs(s);
-               newline();
-       FI
-}
-
-LOCAL STRING   staknam(n)
-       REG NAMPTR      n;
-{
-       REG STRING      p;
-
-       p=movstr(n->namid,staktop);
-       p=movstr("=",p);
-       p=movstr(n->namval,p);
-       return(getstak(p+1-ADR(stakbot)));
-}
-
-VOID   exname(n)
-       REG NAMPTR      n;
-{
-       IF n->namflg&N_EXPORT
-       THEN    free(n->namenv);
-               n->namenv = make(n->namval);
-       ELSE    free(n->namval);
-               n->namval = make(n->namenv);
-       FI
-}
-
-VOID   printflg(n)
-       REG NAMPTR              n;
-{
-       IF n->namflg&N_EXPORT
-       THEN    prs(export); blank();
-       FI
-       IF n->namflg&N_RDONLY
-       THEN    prs(readonly); blank();
-       FI
-       IF n->namflg&(N_EXPORT|N_RDONLY)
-       THEN    prs(n->namid); newline();
-       FI
-}
-
-VOID   getenv()
-{
-       REG STRING      *e=environ;
-
-       WHILE *e
-       DO setname(*e++, N_ENVNAM) OD
-}
-
-LOCAL INT      namec;
-
-VOID   countnam(n)
-       NAMPTR          n;
-{
-       namec++;
-}
-
-LOCAL STRING   *argnam;
-
-VOID   pushnam(n)
-       NAMPTR          n;
-{
-       IF n->namval
-       THEN    *argnam++ = staknam(n);
-       FI
-}
-
-STRING *setenv()
-{
-       REG STRING      *er;
-
-       namec=0;
-       namscan(countnam);
-       argnam = er = getstak(namec*BYTESPERWORD+BYTESPERWORD);
-       namscan(pushnam);
-       *argnam++ = 0;
-       return(er);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/name.h b/.ref-Research-V7/usr/src/cmd/sh/name.h
deleted file mode 100644 (file)
index 4686107..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-
-#define N_RDONLY 0100000
-#define N_EXPORT 0040000
-#define N_ENVNAM 0020000
-#define N_ENVPOS 0007777
-
-#define N_DEFAULT 0
-
-struct namnod {
-       NAMPTR  namlft;
-       NAMPTR  namrgt;
-       STRING  namid;
-       STRING  namval;
-       STRING  namenv;
-       INT     namflg;
-};
diff --git a/.ref-Research-V7/usr/src/cmd/sh/print.c b/.ref-Research-V7/usr/src/cmd/sh/print.c
deleted file mode 100644 (file)
index 740268e..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-CHAR           numbuf[6];
-
-
-/* printing and io conversion */
-
-newline()
-{      prc(NL);
-}
-
-blank()
-{      prc(SP);
-}
-
-prp()
-{
-       IF (flags&prompt)==0 ANDF cmdadr
-       THEN    prs(cmdadr); prs(colon);
-       FI
-}
-
-VOID   prs(as)
-       STRING          as;
-{
-       REG STRING      s;
-
-       IF s=as
-       THEN    write(output,s,length(s)-1);
-       FI
-}
-
-VOID   prc(c)
-       CHAR            c;
-{
-       IF c
-       THEN    write(output,&c,1);
-       FI
-}
-
-prt(t)
-       L_INT           t;
-{
-       REG INT hr, min, sec;
-
-       t += 30; t /= 60;
-       sec=t%60; t /= 60;
-       min=t%60;
-       IF hr=t/60
-       THEN    prn(hr); prc('h');
-       FI
-       prn(min); prc('m');
-       prn(sec); prc('s');
-}
-
-prn(n)
-       INT             n;
-{
-       itos(n); prs(numbuf);
-}
-
-itos(n)
-{
-       REG char *abuf; REG POS a, i; INT pr, d;
-       abuf=numbuf; pr=FALSE; a=n;
-       FOR i=10000; i!=1; i/=10
-       DO      IF (pr |= (d=a/i)) THEN *abuf++=d+'0' FI
-               a %= i;
-       OD
-       *abuf++=a+'0';
-       *abuf++=0;
-}
-
-stoi(icp)
-STRING icp;
-{
-       REG CHAR        *cp = icp;
-       REG INT         r = 0;
-       REG CHAR        c;
-
-       WHILE (c = *cp, digit(c)) ANDF c ANDF r>=0
-       DO r = r*10 + c - '0'; cp++ OD
-       IF r<0 ORF cp==icp
-       THEN    failed(icp,badnum);
-       ELSE    return(r);
-       FI
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/sh/service.c b/.ref-Research-V7/usr/src/cmd/sh/service.c
deleted file mode 100644 (file)
index 1c59989..0000000
+++ /dev/null
@@ -1,365 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-
-PROC VOID      gsort();
-
-#define ARGMK  01
-
-INT            errno;
-STRING         sysmsg[];
-
-/* fault handling */
-#define ENOMEM 12
-#define ENOEXEC 8
-#define E2BIG  7
-#define ENOENT 2
-#define ETXTBSY 26
-
-
-
-/* service routines for `execute' */
-
-VOID   initio(iop)
-       IOPTR           iop;
-{
-       REG STRING      ion;
-       REG INT         iof, fd;
-
-       IF iop
-       THEN    iof=iop->iofile;
-               ion=mactrim(iop->ioname);
-               IF *ion ANDF (flags&noexec)==0
-               THEN    IF iof&IODOC
-                       THEN    subst(chkopen(ion),(fd=tmpfil()));
-                               close(fd); fd=chkopen(tmpout); unlink(tmpout);
-                       ELIF iof&IOMOV
-                       THEN    IF eq(minus,ion)
-                               THEN    fd = -1;
-                                       close(iof&IOUFD);
-                               ELIF (fd=stoi(ion))>=USERIO
-                               THEN    failed(ion,badfile);
-                               ELSE    fd=dup(fd);
-                               FI
-                       ELIF (iof&IOPUT)==0
-                       THEN    fd=chkopen(ion);
-                       ELIF flags&rshflg
-                       THEN    failed(ion,restricted);
-                       ELIF iof&IOAPP ANDF (fd=open(ion,1))>=0
-                       THEN    lseek(fd, 0L, 2);
-                       ELSE    fd=create(ion);
-                       FI
-                       IF fd>=0
-                       THEN    rename(fd,iof&IOUFD);
-                       FI
-               FI
-               initio(iop->ionxt);
-       FI
-}
-
-STRING getpath(s)
-       STRING          s;
-{
-       REG STRING      path;
-       IF any('/',s)
-       THEN    IF flags&rshflg
-               THEN    failed(s, restricted);
-               ELSE    return(nullstr);
-               FI
-       ELIF (path = pathnod.namval)==0
-       THEN    return(defpath);
-       ELSE    return(cpystak(path));
-       FI
-}
-
-INT    pathopen(path, name)
-       REG STRING      path, name;
-{
-       REG UFD         f;
-
-       REP path=catpath(path,name);
-       PER (f=open(curstak(),0))<0 ANDF path DONE
-       return(f);
-}
-
-STRING catpath(path,name)
-       REG STRING      path;
-       STRING          name;
-{
-       /* leaves result on top of stack */
-       REG STRING      scanp = path,
-                       argp = locstak();
-
-       WHILE *scanp ANDF *scanp!=COLON DO *argp++ = *scanp++ OD
-       IF scanp!=path THEN *argp++='/' FI
-       IF *scanp==COLON THEN scanp++ FI
-       path=(*scanp ? scanp : 0); scanp=name;
-       WHILE (*argp++ = *scanp++) DONE
-       return(path);
-}
-
-LOCAL STRING   xecmsg;
-LOCAL STRING   *xecenv;
-
-VOID   execa(at)
-       STRING          at[];
-{
-       REG STRING      path;
-       REG STRING      *t = at;
-
-       IF (flags&noexec)==0
-       THEN    xecmsg=notfound; path=getpath(*t);
-               namscan(exname);
-               xecenv=setenv();
-               WHILE path=execs(path,t) DONE
-               failed(*t,xecmsg);
-       FI
-}
-
-LOCAL STRING   execs(ap,t)
-       STRING          ap;
-       REG STRING      t[];
-{
-       REG STRING      p, prefix;
-
-       prefix=catpath(ap,t[0]);
-       trim(p=curstak());
-
-       sigchk();
-       execve(p, &t[0] ,xecenv);
-       SWITCH errno IN
-
-           case ENOEXEC:
-               flags=0;
-               comdiv=0; ioset=0;
-               clearup(); /* remove open files and for loop junk */
-               IF input THEN close(input) FI
-               close(output); output=2;
-               input=chkopen(p);
-
-               /* set up new args */
-               setargs(t);
-               longjmp(subshell,1);
-
-           case ENOMEM:
-               failed(p,toobig);
-
-           case E2BIG:
-               failed(p,arglist);
-
-           case ETXTBSY:
-               failed(p,txtbsy);
-
-           default:
-               xecmsg=badexec;
-           case ENOENT:
-               return(prefix);
-       ENDSW
-}
-
-/* for processes to be waited for */
-#define MAXP 20
-LOCAL INT      pwlist[MAXP];
-LOCAL INT      pwc;
-
-postclr()
-{
-       REG INT         *pw = pwlist;
-
-       WHILE pw <= &pwlist[pwc]
-       DO *pw++ = 0 OD
-       pwc=0;
-}
-
-VOID   post(pcsid)
-       INT             pcsid;
-{
-       REG INT         *pw = pwlist;
-
-       IF pcsid
-       THEN    WHILE *pw DO pw++ OD
-               IF pwc >= MAXP-1
-               THEN    pw--;
-               ELSE    pwc++;
-               FI
-               *pw = pcsid;
-       FI
-}
-
-VOID   await(i)
-       INT             i;
-{
-       INT             rc=0, wx=0;
-       INT             w;
-       INT             ipwc = pwc;
-
-       post(i);
-       WHILE pwc
-       DO      REG INT         p;
-               REG INT         sig;
-               INT             w_hi;
-
-               BEGIN
-                  REG INT      *pw=pwlist;
-                  p=wait(&w);
-                  WHILE pw <= &pwlist[ipwc]
-                  DO IF *pw==p
-                     THEN *pw=0; pwc--;
-                     ELSE pw++;
-                     FI
-                  OD
-               END
-
-               IF p == -1 THEN continue FI
-
-               w_hi = (w>>8)&LOBYTE;
-
-               IF sig = w&0177
-               THEN    IF sig == 0177  /* ptrace! return */
-                       THEN    prs("ptrace: ");
-                               sig = w_hi;
-                       FI
-                       IF sysmsg[sig]
-                       THEN    IF i!=p ORF (flags&prompt)==0 THEN prp(); prn(p); blank() FI
-                               prs(sysmsg[sig]);
-                               IF w&0200 THEN prs(coredump) FI
-                       FI
-                       newline();
-               FI
-
-               IF rc==0
-               THEN    rc = (sig ? sig|SIGFLG : w_hi);
-               FI
-               wx |= w;
-       OD
-
-       IF wx ANDF flags&errflg
-       THEN    exitsh(rc);
-       FI
-       exitval=rc; exitset();
-}
-
-BOOL           nosubst;
-
-trim(at)
-       STRING          at;
-{
-       REG STRING      p;
-       REG CHAR        c;
-       REG CHAR        q=0;
-
-       IF p=at
-       THEN    WHILE c = *p
-               DO *p++=c&STRIP; q |= c OD
-       FI
-       nosubst=q&QUOTE;
-}
-
-STRING mactrim(s)
-       STRING          s;
-{
-       REG STRING      t=macro(s);
-       trim(t);
-       return(t);
-}
-
-STRING *scan(argn)
-       INT             argn;
-{
-       REG ARGPTR      argp = Rcheat(gchain)&~ARGMK;
-       REG STRING      *comargn, *comargm;
-
-       comargn=getstak(BYTESPERWORD*argn+BYTESPERWORD); comargm = comargn += argn; *comargn = ENDARGS;
-
-       WHILE argp
-       DO      *--comargn = argp->argval;
-               IF argp = argp->argnxt
-               THEN trim(*comargn);
-               FI
-               IF argp==0 ORF Rcheat(argp)&ARGMK
-               THEN    gsort(comargn,comargm);
-                       comargm = comargn;
-               FI
-               /* Lcheat(argp) &= ~ARGMK; */
-               argp = Rcheat(argp)&~ARGMK;
-       OD
-       return(comargn);
-}
-
-LOCAL VOID     gsort(from,to)
-       STRING          from[], to[];
-{
-       INT             k, m, n;
-       REG INT         i, j;
-
-       IF (n=to-from)<=1 THEN return FI
-
-       FOR j=1; j<=n; j*=2 DONE
-
-       FOR m=2*j-1; m/=2;
-       DO  k=n-m;
-           FOR j=0; j<k; j++
-           DO  FOR i=j; i>=0; i-=m
-               DO  REG STRING *fromi; fromi = &from[i];
-                   IF cf(fromi[m],fromi[0])>0
-                   THEN break;
-                   ELSE STRING s; s=fromi[m]; fromi[m]=fromi[0]; fromi[0]=s;
-                   FI
-               OD
-           OD
-       OD
-}
-
-/* Argument list generation */
-
-INT    getarg(ac)
-       COMPTR          ac;
-{
-       REG ARGPTR      argp;
-       REG INT         count=0;
-       REG COMPTR      c;
-
-       IF c=ac
-       THEN    argp=c->comarg;
-               WHILE argp
-               DO      count += split(macro(argp->argval));
-                       argp=argp->argnxt;
-               OD
-       FI
-       return(count);
-}
-
-LOCAL INT      split(s)
-       REG STRING      s;
-{
-       REG STRING      argp;
-       REG INT         c;
-       INT             count=0;
-
-       LOOP    sigchk(); argp=locstak()+BYTESPERWORD;
-               WHILE (c = *s++, !any(c,ifsnod.namval) && c)
-               DO *argp++ = c OD
-               IF argp==staktop+BYTESPERWORD
-               THEN    IF c
-                       THEN    continue;
-                       ELSE    return(count);
-                       FI
-               ELIF c==0
-               THEN    s--;
-               FI
-               IF c=expand((argp=endstak(argp))->argval,0)
-               THEN    count += c;
-               ELSE    /* assign(&fngnod, argp->argval); */
-                       makearg(argp); count++;
-               FI
-               Lcheat(gchain) |= ARGMK;
-       POOL
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/setbrk.c b/.ref-Research-V7/usr/src/cmd/sh/setbrk.c
deleted file mode 100644 (file)
index 84745c7..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-setbrk(incr)
-{
-       REG BYTPTR      a=sbrk(incr);
-       brkend=a+incr;
-       return(a);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/stak.c b/.ref-Research-V7/usr/src/cmd/sh/stak.c
deleted file mode 100644 (file)
index ed36f08..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-STKPTR         stakbot=nullstr;
-
-
-
-/* ========    storage allocation      ======== */
-
-STKPTR getstak(asize)
-       INT             asize;
-{      /* allocate requested stack */
-       REG STKPTR      oldstak;
-       REG INT         size;
-
-       size=round(asize,BYTESPERWORD);
-       oldstak=stakbot;
-       staktop = stakbot += size;
-       return(oldstak);
-}
-
-STKPTR locstak()
-{      /* set up stack for local use
-        * should be followed by `endstak'
-        */
-       IF brkend-stakbot<BRKINCR
-       THEN    setbrk(brkincr);
-               IF brkincr < BRKMAX
-               THEN    brkincr += 256;
-               FI
-       FI
-       return(stakbot);
-}
-
-STKPTR savstak()
-{
-       assert(staktop==stakbot);
-       return(stakbot);
-}
-
-STKPTR endstak(argp)
-       REG STRING      argp;
-{      /* tidy up after `locstak' */
-       REG STKPTR      oldstak;
-       *argp++=0;
-       oldstak=stakbot; stakbot=staktop=round(argp,BYTESPERWORD);
-       return(oldstak);
-}
-
-VOID   tdystak(x)
-       REG STKPTR      x;
-{
-       /* try to bring stack back to x */
-       WHILE ADR(stakbsy)>ADR(x)
-       DO free(stakbsy);
-          stakbsy = stakbsy->word;
-       OD
-       staktop=stakbot=max(ADR(x),ADR(stakbas));
-       rmtemp(x);
-}
-
-stakchk()
-{
-       IF (brkend-stakbas)>BRKINCR+BRKINCR
-       THEN    setbrk(-BRKINCR);
-       FI
-}
-
-STKPTR cpystak(x)
-       STKPTR          x;
-{
-       return(endstak(movstr(x,locstak())));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/stak.h b/.ref-Research-V7/usr/src/cmd/sh/stak.h
deleted file mode 100644 (file)
index 09b853d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-/* To use stack as temporary workspace across
- * possible storage allocation (eg name lookup)
- * a) get ptr from `relstak'
- * b) can now use `pushstak'
- * c) then reset with `setstak'
- * d) `absstak' gives real address if needed
- */
-#define                relstak()       (staktop-stakbot)
-#define                absstak(x)      (stakbot+Rcheat(x))
-#define                setstak(x)      (staktop=absstak(x))
-#define                pushstak(c)     (*staktop++=(c))
-#define                zerostak()      (*staktop=0)
-
-/* Used to address an item left on the top of
- * the stack (very temporary)
- */
-#define                curstak()       (staktop)
-
-/* `usestak' before `pushstak' then `fixstak'
- * These routines are safe against heap
- * being allocated.
- */
-#define                usestak()       {locstak();}
-
-/* for local use only since it hands
- * out a real address for the stack top
- */
-STKPTR         locstak();
-
-/* Will allocate the item being used and return its
- * address (safe now).
- */
-#define                fixstak()       endstak(staktop)
-
-/* For use after `locstak' to hand back
- * new stack top and then allocate item
- */
-STKPTR         endstak();
-
-/* Copy a string onto the stack and
- * allocate the space.
- */
-STKPTR         cpystak();
-
-/* Allocate given ammount of stack space */
-STKPTR         getstak();
-
-/* A chain of ptrs of stack blocks that
- * have become covered by heap allocation.
- * `tdystak' will return them to the heap.
- */
-BLKPTR         stakbsy;
-
-/* Base of the entire stack */
-STKPTR         stakbas;
-
-/* Top of entire stack */
-STKPTR         brkend;
-
-/* Base of current item */
-STKPTR         stakbot;
-
-/* Top of current item */
-STKPTR         staktop;
-
-/* Used with tdystak */
-STKPTR         savstak();
diff --git a/.ref-Research-V7/usr/src/cmd/sh/string.c b/.ref-Research-V7/usr/src/cmd/sh/string.c
deleted file mode 100644 (file)
index 5ad20e8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-
-
-/* ========    general purpose string handling ======== */
-
-
-STRING movstr(a,b)
-       REG STRING      a, b;
-{
-       WHILE *b++ = *a++ DONE
-       return(--b);
-}
-
-INT    any(c,s)
-       REG CHAR        c;
-       STRING          s;
-{
-       REG CHAR d;
-
-       WHILE d = *s++
-       DO      IF d==c
-               THEN    return(TRUE);
-               FI
-       OD
-       return(FALSE);
-}
-
-INT    cf(s1, s2)
-       REG STRING s1, s2;
-{
-       WHILE *s1++ == *s2
-       DO      IF *s2++==0
-               THEN    return(0);
-               FI
-       OD
-       return(*--s1 - *s2);
-}
-
-INT    length(as)
-       STRING as;
-{
-       REG STRING s;
-
-       IF s=as THEN WHILE *s++ DONE FI
-       return(s-as);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/sym.h b/.ref-Research-V7/usr/src/cmd/sh/sym.h
deleted file mode 100644 (file)
index 0ed5623..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-/*
- *     UNIX shell
- */
-
-
-/* symbols for parsing */
-#define DOSYM  0405
-#define FISYM  0420
-#define EFSYM  0422
-#define ELSYM  0421
-#define INSYM  0412
-#define BRSYM  0406
-#define KTSYM  0450
-#define THSYM  0444
-#define ODSYM  0441
-#define ESSYM  0442
-#define IFSYM  0436
-#define FORSYM 0435
-#define WHSYM  0433
-#define UNSYM  0427
-#define CASYM  0417
-
-#define SYMREP 04000
-#define ECSYM  (SYMREP|';')
-#define ANDFSYM        (SYMREP|'&')
-#define ORFSYM (SYMREP|'|')
-#define APPSYM (SYMREP|'>')
-#define DOCSYM (SYMREP|'<')
-#define EOFSYM 02000
-#define SYMFLG 0400
-
-/* arg to `cmd' */
-#define NLFLG  1
-#define MTFLG  2
-
-/* for peekc */
-#define MARK   0100000
-
-/* odd chars */
-#define DQUOTE '"'
-#define SQUOTE '`'
-#define LITERAL        '\''
-#define DOLLAR '$'
-#define ESCAPE '\\'
-#define BRACE  '{'
diff --git a/.ref-Research-V7/usr/src/cmd/sh/timeout.h b/.ref-Research-V7/usr/src/cmd/sh/timeout.h
deleted file mode 100644 (file)
index fa129ed..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-/*
- *     UNIX shell
- *
- *     S. R. Bourne
- *     Bell Telephone Laboratories
- *
- */
-
-#define TIMEOUT 0
diff --git a/.ref-Research-V7/usr/src/cmd/sh/word.c b/.ref-Research-V7/usr/src/cmd/sh/word.c
deleted file mode 100644 (file)
index d194446..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       "sym.h"
-
-
-/* ========    character handling for command lines    ========*/
-
-
-word()
-{
-       REG CHAR        c, d;
-       REG CHAR        *argp=locstak()+BYTESPERWORD;
-       INT             alpha=1;
-
-       wdnum=0; wdset=0;
-
-       WHILE (c=nextc(0), space(c)) DONE
-       IF !eofmeta(c)
-       THEN    REP     IF c==LITERAL
-                       THEN    *argp++=(DQUOTE);
-                               WHILE (c=readc()) ANDF c!=LITERAL
-                               DO *argp++=(c|QUOTE); chkpr(c) OD
-                               *argp++=(DQUOTE);
-                       ELSE    *argp++=(c);
-                               IF c=='=' THEN wdset |= alpha FI
-                               IF !alphanum(c) THEN alpha=0 FI
-                               IF qotchar(c)
-                               THEN    d=c;
-                                       WHILE (*argp++=(c=nextc(d))) ANDF c!=d
-                                       DO chkpr(c) OD
-                               FI
-                       FI
-               PER (c=nextc(0), !eofmeta(c)) DONE
-               argp=endstak(argp);
-               IF !letter(argp->argval[0]) THEN wdset=0 FI
-
-               peekc=c|MARK;
-               IF argp->argval[1]==0 ANDF (d=argp->argval[0], digit(d)) ANDF (c=='>' ORF c=='<')
-               THEN    word(); wdnum=d-'0';
-               ELSE    /*check for reserved words*/
-                       IF reserv==FALSE ORF (wdval=syslook(argp->argval,reserved))==0
-                       THEN    wdarg=argp; wdval=0;
-                       FI
-               FI
-
-       ELIF dipchar(c)
-       THEN    IF (d=nextc(0))==c
-               THEN    wdval = c|SYMREP;
-               ELSE    peekc = d|MARK; wdval = c;
-               FI
-       ELSE    IF (wdval=c)==EOF
-               THEN    wdval=EOFSYM;
-               FI
-               IF iopend ANDF eolchar(c)
-               THEN    copy(iopend); iopend=0;
-               FI
-       FI
-       reserv=FALSE;
-       return(wdval);
-}
-
-nextc(quote)
-       CHAR            quote;
-{
-       REG CHAR        c, d;
-       IF (d=readc())==ESCAPE
-       THEN    IF (c=readc())==NL
-               THEN    chkpr(NL); d=nextc(quote);
-               ELIF quote ANDF c!=quote ANDF !escchar(c)
-               THEN    peekc=c|MARK;
-               ELSE    d = c|QUOTE;
-               FI
-       FI
-       return(d);
-}
-
-readc()
-{
-       REG CHAR        c;
-       REG INT         len;
-       REG FILE        f;
-
-retry:
-       IF peekc
-       THEN    c=peekc; peekc=0;
-       ELIF (f=standin, f->fnxt!=f->fend)
-       THEN    IF (c = *f->fnxt++)==0
-               THEN    IF f->feval
-                       THEN    IF estabf(*f->feval++)
-                               THEN    c=EOF;
-                               ELSE    c=SP;
-                               FI
-                       ELSE    goto retry; /* = c=readc(); */
-                       FI
-               FI
-               IF flags&readpr ANDF standin->fstak==0 THEN prc(c) FI
-               IF c==NL THEN f->flin++ FI
-       ELIF f->feof ORF f->fdes<0
-       THEN    c=EOF; f->feof++;
-       ELIF (len=readb())<=0
-       THEN    close(f->fdes); f->fdes = -1; c=EOF; f->feof++;
-       ELSE    f->fend = (f->fnxt = f->fbuf)+len;
-               goto retry;
-       FI
-       return(c);
-}
-
-LOCAL  readb()
-{
-       REG FILE        f=standin;
-       REG INT         len;
-
-       REP     IF trapnote&SIGSET THEN newline(); sigchk() FI
-       PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 ANDF trapnote DONE
-       return(len);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sh/xec.c b/.ref-Research-V7/usr/src/cmd/sh/xec.c
deleted file mode 100644 (file)
index 874a2c7..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-#
-/*
- * UNIX shell
- *
- * S. R. Bourne
- * Bell Telephone Laboratories
- *
- */
-
-#include       "defs.h"
-#include       "sym.h"
-
-LOCAL INT      parent;
-
-SYSTAB         commands;
-
-
-
-/* ========    command execution       ========*/
-
-
-execute(argt, execflg, pf1, pf2)
-       TREPTR          argt;
-       INT             *pf1, *pf2;
-{
-       /* `stakbot' is preserved by this routine */
-       REG TREPTR      t;
-       STKPTR          sav=savstak();
-
-       sigchk();
-
-       IF (t=argt) ANDF execbrk==0
-       THEN    REG INT         treeflgs;
-               INT             oldexit, type;
-               REG STRING      *com;
-
-               treeflgs = t->tretyp; type = treeflgs&COMMSK;
-               oldexit=exitval; exitval=0;
-
-               SWITCH type IN
-
-               case TCOM:
-                       BEGIN
-                       STRING          a1;
-                       INT             argn, internal;
-                       ARGPTR          schain=gchain;
-                       IOPTR           io=t->treio;
-                       gchain=0;
-                       argn = getarg(t);
-                       com=scan(argn);
-                       a1=com[1]; gchain=schain;
-
-                       IF (internal=syslook(com[0],commands)) ORF argn==0
-                       THEN    setlist(t->comset, 0);
-                       FI
-
-                       IF argn ANDF (flags&noexec)==0
-                       THEN    /* print command if execpr */
-                               IF flags&execpr
-                               THEN    argn=0; prs(execpmsg);
-                                       WHILE com[argn]!=ENDARGS
-                                       DO prs(com[argn++]); blank() OD
-                                       newline();
-                               FI
-
-                               SWITCH internal IN
-
-                               case SYSDOT:
-                                       IF a1
-                                       THEN    REG INT         f;
-       
-                                               IF (f=pathopen(getpath(a1), a1)) < 0
-                                               THEN failed(a1,notfound);
-                                               ELSE execexp(0,f);
-                                               FI
-                                       FI
-                                       break;
-       
-                               case SYSTIMES:
-                                       {
-                                       L_INT   t[4]; times(t);
-                                       prt(t[2]); blank(); prt(t[3]); newline();
-                                       }
-                                       break;
-       
-                               case SYSEXIT:
-                                       exitsh(a1?stoi(a1):oldexit);
-       
-                               case SYSNULL:
-                                       io=0;
-                                       break;
-       
-                               case SYSCONT:
-                                       execbrk = -loopcnt; break;
-       
-                               case SYSBREAK:
-                                       IF (execbrk=loopcnt) ANDF a1
-                                       THEN breakcnt=stoi(a1);
-                                       FI
-                                       break;
-       
-                               case SYSTRAP:
-                                       IF a1
-                                       THEN    BOOL    clear;
-                                               IF (clear=digit(*a1))==0
-                                               THEN    ++com;
-                                               FI
-                                               WHILE *++com
-                                               DO INT  i;
-                                                  IF (i=stoi(*com))>=MAXTRAP ORF i<MINTRAP
-                                                  THEN failed(*com,badtrap);
-                                                  ELIF clear
-                                                  THEN clrsig(i);
-                                                  ELSE replace(&trapcom[i],a1);
-                                                       IF *a1
-                                                       THEN    getsig(i);
-                                                       ELSE    ignsig(i);
-                                                       FI
-                                                  FI
-                                               OD
-                                       ELSE    /* print out current traps */
-                                               INT             i;
-       
-                                               FOR i=0; i<MAXTRAP; i++
-                                               DO IF trapcom[i]
-                                                  THEN prn(i); prs(colon); prs(trapcom[i]); newline();
-                                                  FI
-                                               OD
-                                       FI
-                                       break;
-       
-                               case SYSEXEC:
-                                       com++;
-                                       initio(io); ioset=0; io=0;
-                                       IF a1==0 THEN break FI
-       
-                               case SYSLOGIN:
-                                       flags |= forked;
-                                       oldsigs(); execa(com); done();
-       
-                               case SYSCD:
-                                       IF flags&rshflg
-                                       THEN    failed(com[0],restricted);
-                                       ELIF (a1==0 ANDF (a1=homenod.namval)==0) ORF chdir(a1)<0
-                                       THEN    failed(a1,baddir);
-                                       FI
-                                       break;
-       
-                               case SYSSHFT:
-                                       IF dolc<1
-                                       THEN    error(badshift);
-                                       ELSE    dolv++; dolc--;
-                                       FI
-                                       assnum(&dolladr, dolc);
-                                       break;
-       
-                               case SYSWAIT:
-                                       await(-1);
-                                       break;
-       
-                               case SYSREAD:
-                                       exitval=readvar(&com[1]);
-                                       break;
-
-/*
-                               case SYSTST:
-                                       exitval=testcmd(com);
-                                       break;
-*/
-
-                               case SYSSET:
-                                       IF a1
-                                       THEN    INT     argc;
-                                               argc = options(argn,com);
-                                               IF argc>1
-                                               THEN    setargs(com+argn-argc);
-                                               FI
-                                       ELIF t->comset==0
-                                       THEN    /*scan name chain and print*/
-                                               namscan(printnam);
-                                       FI
-                                       break;
-       
-                               case SYSRDONLY:
-                                       exitval=N_RDONLY;
-                               case SYSXPORT:
-                                       IF exitval==0 THEN exitval=N_EXPORT; FI
-       
-                                       IF a1
-                                       THEN    WHILE *++com
-                                               DO attrib(lookup(*com), exitval) OD
-                                       ELSE    namscan(printflg);
-                                       FI
-                                       exitval=0;
-                                       break;
-       
-                               case SYSEVAL:
-                                       IF a1
-                                       THEN    execexp(a1,&com[2]);
-                                       FI
-                                       break;
-
-                                case SYSUMASK:
-                                        if (a1) {
-                                                int c, i
-                                                i = 0;
-                                                while ((c = *a1++) >= '0' &&
-                                                        c <= '7')
-                                                        i = (i << 3) + c - '0';
-                                                umask(i);
-                                        } else {
-                                                int i, j;
-                                                umask(i = umask(0));
-                                                prc('0');
-                                                for (j = 6; j >= 0; j -= 3)
-                                                        prc(((i>>j)&07) + '0');
-                                                newline();
-                                        }
-                                        break;
-       
-                               default:
-                                       internal=builtin(argn,com);
-       
-                               ENDSW
-
-                               IF internal
-                               THEN    IF io THEN error(illegal) FI
-                                       chktrap();
-                                       break;
-                               FI
-                       ELIF t->treio==0
-                       THEN    break;
-                       FI
-                       END
-       
-               case TFORK:
-                       IF execflg ANDF (treeflgs&(FAMP|FPOU))==0
-                       THEN    parent=0;
-                       ELSE    WHILE (parent=fork()) == -1
-                               DO sigchk(); alarm(10); pause() OD
-                       FI
-
-                       IF parent
-                       THEN    /* This is the parent branch of fork;    */
-                               /* it may or may not wait for the child. */
-                               IF treeflgs&FPRS ANDF flags&ttyflg
-                               THEN    prn(parent); newline();
-                               FI
-                               IF treeflgs&FPCL THEN closepipe(pf1) FI
-                               IF (treeflgs&(FAMP|FPOU))==0
-                               THEN    await(parent);
-                               ELIF (treeflgs&FAMP)==0
-                               THEN    post(parent);
-                               ELSE    assnum(&pcsadr, parent);
-                               FI
-
-                               chktrap();
-                               break;
-
-
-                       ELSE    /* this is the forked branch (child) of execute */
-                               flags |= forked; iotemp=0;
-                               postclr();
-                               settmp();
-
-                               /* Turn off INTR and QUIT if `FINT'  */
-                               /* Reset ramaining signals to parent */
-                               /* except for those `lost' by trap   */
-                               oldsigs();
-                               IF treeflgs&FINT
-                               THEN    signal(INTR,1); signal(QUIT,1);
-                               FI
-
-                               /* pipe in or out */
-                               IF treeflgs&FPIN
-                               THEN    rename(pf1[INPIPE],0);
-                                       close(pf1[OTPIPE]);
-                               FI
-                               IF treeflgs&FPOU
-                               THEN    rename(pf2[OTPIPE],1);
-                                       close(pf2[INPIPE]);
-                               FI
-
-                               /* default std input for & */
-                               IF treeflgs&FINT ANDF ioset==0
-                               THEN    rename(chkopen(devnull),0);
-                               FI
-
-                               /* io redirection */
-                               initio(t->treio);
-                               IF type!=TCOM
-                               THEN    execute(t->forktre,1);
-                               ELIF com[0]!=ENDARGS
-                               THEN    setlist(t->comset,N_EXPORT);
-                                       execa(com);
-                               FI
-                               done();
-                       FI
-
-               case TPAR:
-                       rename(dup(2),output);
-                       execute(t->partre,execflg);
-                       done();
-
-               case TFIL:
-                       BEGIN
-                          INT pv[2]; chkpipe(pv);
-                          IF execute(t->lstlef, 0, pf1, pv)==0
-                          THEN execute(t->lstrit, execflg, pv, pf2);
-                          ELSE closepipe(pv);
-                          FI
-                       END
-                       break;
-
-               case TLST:
-                       execute(t->lstlef,0);
-                       execute(t->lstrit,execflg);
-                       break;
-
-               case TAND:
-                       IF execute(t->lstlef,0)==0
-                       THEN    execute(t->lstrit,execflg);
-                       FI
-                       break;
-
-               case TORF:
-                       IF execute(t->lstlef,0)!=0
-                       THEN    execute(t->lstrit,execflg);
-                       FI
-                       break;
-
-               case TFOR:
-                       BEGIN
-                          NAMPTR       n = lookup(t->fornam);
-                          STRING       *args;
-                          DOLPTR       argsav=0;
-
-                          IF t->forlst==0
-                          THEN    args=dolv+1;
-                                  argsav=useargs();
-                          ELSE    ARGPTR       schain=gchain;
-                                  gchain=0;
-                                  trim((args=scan(getarg(t->forlst)))[0]);
-                                  gchain=schain;
-                          FI
-                          loopcnt++;
-                          WHILE *args!=ENDARGS ANDF execbrk==0
-                          DO   assign(n,*args++);
-                               execute(t->fortre,0);
-                               IF execbrk<0 THEN execbrk=0 FI
-                          OD
-                          IF breakcnt THEN breakcnt-- FI
-                          execbrk=breakcnt; loopcnt--;
-                          argfor=freeargs(argsav);
-                       END
-                       break;
-
-               case TWH:
-               case TUN:
-                       BEGIN
-                          INT          i=0;
-
-                          loopcnt++;
-                          WHILE execbrk==0 ANDF (execute(t->whtre,0)==0)==(type==TWH)
-                          DO i=execute(t->dotre,0);
-                             IF execbrk<0 THEN execbrk=0 FI
-                          OD
-                          IF breakcnt THEN breakcnt-- FI
-                          execbrk=breakcnt; loopcnt--; exitval=i;
-                       END
-                       break;
-
-               case TIF:
-                       IF execute(t->iftre,0)==0
-                       THEN    execute(t->thtre,execflg);
-                       ELSE    execute(t->eltre,execflg);
-                       FI
-                       break;
-
-               case TSW:
-                       BEGIN
-                          REG STRING   r = mactrim(t->swarg);
-                          t=t->swlst;
-                          WHILE t
-                          DO   ARGPTR          rex=t->regptr;
-                               WHILE rex
-                               DO      REG STRING      s;
-                                       IF gmatch(r,s=macro(rex->argval)) ORF (trim(s), eq(r,s))
-                                       THEN    execute(t->regcom,0);
-                                               t=0; break;
-                                       ELSE    rex=rex->argnxt;
-                                       FI
-                               OD
-                               IF t THEN t=t->regnxt FI
-                          OD
-                       END
-                       break;
-               ENDSW
-               exitset();
-       FI
-
-       sigchk();
-       tdystak(sav);
-       return(exitval);
-}
-
-
-execexp(s,f)
-       STRING          s;
-       UFD             f;
-{
-       FILEBLK         fb;
-       push(&fb);
-       IF s
-       THEN    estabf(s); fb.feval=f;
-       ELIF f>=0
-       THEN    initf(f);
-       FI
-       execute(cmd(NL, NLFLG|MTFLG),0);
-       pop();
-}
diff --git a/.ref-Research-V7/usr/src/cmd/size.c b/.ref-Research-V7/usr/src/cmd/size.c
deleted file mode 100644 (file)
index 7a3d75f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#include       <stdio.h>
-#include       <a.out.h>
-
-/*
-       size -- determine object size
-
-*/
-
-int a_magic[] = {A_MAGIC1,A_MAGIC2,A_MAGIC3,A_MAGIC4,0};
-
-main(argc, argv)
-char **argv;
-{
-       struct exec buf;
-       long sum;
-       int gorp,i;
-       FILE *f;
-
-       if (argc==1) {
-               *argv = "a.out";
-               argc++;
-               --argv;
-       }
-       gorp = argc;
-       while(--argc) {
-               ++argv;
-               if ((f = fopen(*argv, "r"))==NULL) {
-                       printf("size: %s not found\n", *argv);
-                       continue;
-               }
-               fread((char *)&buf, sizeof(buf), 1, f);
-               for(i=0;a_magic[i];i++)
-                       if(a_magic[i] == buf.a_magic) break;
-               if(a_magic[i] == 0) {
-                       printf("size: %s not an object file\n", *argv);
-                       fclose(f);
-                       continue;
-               }
-               if (gorp>2)
-                       printf("%s: ", *argv);
-               printf("%u+%u+%u = ", buf.a_text,buf.a_data,buf.a_bss);
-               sum = (long) buf.a_text + (long) buf.a_data + (long) buf.a_bss;
-               printf("%Db = 0%Ob\n", sum, sum);
-               fclose(f);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sleep.c b/.ref-Research-V7/usr/src/cmd/sleep.c
deleted file mode 100644 (file)
index a52bc3d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-main(argc, argv)
-char **argv;
-{
-       int c, n;
-       char *s;
-
-       n = 0;
-       if(argc < 2) {
-               printf("arg count\n");
-               exit(0);
-       }
-       s = argv[1];
-       while(c = *s++) {
-               if(c<'0' || c>'9') {
-                       printf("bad character\n");
-                       exit(0);
-               }
-               n = n*10 + c - '0';
-       }
-       sleep(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sort.c b/.ref-Research-V7/usr/src/cmd/sort.c
deleted file mode 100644 (file)
index 8da6251..0000000
+++ /dev/null
@@ -1,901 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#define        L       512
-#define        N       7
-#define        C       20
-#define        MEM     (16*2048)
-#define NF     10
-
-FILE   *is, *os;
-char   *dirtry[] = {"/usr/tmp", "/tmp", NULL};
-char   **dirs;
-char   file1[30];
-char   *file = file1;
-char   *filep;
-int    nfiles;
-unsigned       nlines;
-unsigned       ntext;
-int    *lspace;
-char   *tspace;
-int    cmp(), cmpa();
-int    (*compare)() = cmpa;
-char   *eol();
-int    term();
-int    mflg;
-int    cflg;
-int    uflg;
-char   *outfil;
-int unsafeout; /*kludge to assure -m -o works*/
-char   tabchar;
-int    eargc;
-char   **eargv;
-
-char zero[256];
-
-char   fold[256] = {
-       0200,0201,0202,0203,0204,0205,0206,0207,
-       0210,0211,0212,0213,0214,0215,0216,0217,
-       0220,0221,0222,0223,0224,0225,0226,0227,
-       0230,0231,0232,0233,0234,0235,0236,0237,
-       0240,0241,0242,0243,0244,0245,0246,0247,
-       0250,0251,0252,0253,0254,0255,0256,0257,
-       0260,0261,0262,0263,0264,0265,0266,0267,
-       0270,0271,0272,0273,0274,0275,0276,0277,
-       0300,0301,0302,0303,0304,0305,0306,0307,
-       0310,0311,0312,0313,0314,0315,0316,0317,
-       0320,0321,0322,0323,0324,0325,0326,0327,
-       0330,0331,0332,0333,0334,0335,0336,0337,
-       0340,0341,0342,0343,0344,0345,0346,0347,
-       0350,0351,0352,0353,0354,0355,0356,0357,
-       0360,0361,0362,0363,0364,0365,0366,0367,
-       0370,0371,0372,0373,0374,0375,0376,0377,
-       0000,0001,0002,0003,0004,0005,0006,0007,
-       0010,0011,0012,0013,0014,0015,0016,0017,
-       0020,0021,0022,0023,0024,0025,0026,0027,
-       0030,0031,0032,0033,0034,0035,0036,0037,
-       0040,0041,0042,0043,0044,0045,0046,0047,
-       0050,0051,0052,0053,0054,0055,0056,0057,
-       0060,0061,0062,0063,0064,0065,0066,0067,
-       0070,0071,0072,0073,0074,0075,0076,0077,
-       0100,0101,0102,0103,0104,0105,0106,0107,
-       0110,0111,0112,0113,0114,0115,0116,0117,
-       0120,0121,0122,0123,0124,0125,0126,0127,
-       0130,0131,0132,0133,0134,0134,0136,0137,
-       0140,0101,0102,0103,0104,0105,0106,0107,
-       0110,0111,0112,0113,0114,0115,0116,0117,
-       0120,0121,0122,0123,0124,0125,0126,0127,
-       0130,0131,0132,0173,0174,0175,0176,0177
-};
-char nofold[256] = {
-       0200,0201,0202,0203,0204,0205,0206,0207,
-       0210,0211,0212,0213,0214,0215,0216,0217,
-       0220,0221,0222,0223,0224,0225,0226,0227,
-       0230,0231,0232,0233,0234,0235,0236,0237,
-       0240,0241,0242,0243,0244,0245,0246,0247,
-       0250,0251,0252,0253,0254,0255,0256,0257,
-       0260,0261,0262,0263,0264,0265,0266,0267,
-       0270,0271,0272,0273,0274,0275,0276,0277,
-       0300,0301,0302,0303,0304,0305,0306,0307,
-       0310,0311,0312,0313,0314,0315,0316,0317,
-       0320,0321,0322,0323,0324,0325,0326,0327,
-       0330,0331,0332,0333,0334,0335,0336,0337,
-       0340,0341,0342,0343,0344,0345,0346,0347,
-       0350,0351,0352,0353,0354,0355,0356,0357,
-       0360,0361,0362,0363,0364,0365,0366,0367,
-       0370,0371,0372,0373,0374,0375,0376,0377,
-       0000,0001,0002,0003,0004,0005,0006,0007,
-       0010,0011,0012,0013,0014,0015,0016,0017,
-       0020,0021,0022,0023,0024,0025,0026,0027,
-       0030,0031,0032,0033,0034,0035,0036,0037,
-       0040,0041,0042,0043,0044,0045,0046,0047,
-       0050,0051,0052,0053,0054,0055,0056,0057,
-       0060,0061,0062,0063,0064,0065,0066,0067,
-       0070,0071,0072,0073,0074,0075,0076,0077,
-       0100,0101,0102,0103,0104,0105,0106,0107,
-       0110,0111,0112,0113,0114,0115,0116,0117,
-       0120,0121,0122,0123,0124,0125,0126,0127,
-       0130,0131,0132,0133,0134,0135,0136,0137,
-       0140,0141,0142,0143,0144,0145,0146,0147,
-       0150,0151,0152,0153,0154,0155,0156,0157,
-       0160,0161,0162,0163,0164,0165,0166,0167,
-       0170,0171,0172,0173,0174,0175,0176,0177
-};
-
-char   nonprint[256] = {
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
-};
-
-char   dict[256] = {
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,
-       1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
-       0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
-       1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
-       1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1
-};
-
-struct field {
-       char *code;
-       char *ignore;
-       int nflg;
-       int rflg;
-       int bflg[2];
-       int m[2];
-       int n[2];
-}      fields[NF];
-struct field proto = {
-       nofold+128,
-       zero+128,
-       0,
-       1,
-       0,0,
-       0,-1,
-       0,0
-};
-int    nfields;
-int    error = 1;
-char   *setfil();
-char   *sbrk();
-char   *brk();
-
-main(argc, argv)
-char **argv;
-{
-       register a;
-       extern char end[1];
-       char *ep;
-       char *arg;
-       struct field *p, *q;
-       int i;
-
-       copyproto();
-       eargv = argv;
-       while (--argc > 0) {
-               if(**++argv == '-') for(arg = *argv;;) {
-                       switch(*++arg) {
-                       case '\0':
-                               if(arg[-1] == '-')
-                                       eargv[eargc++] = "-";
-                               break;
-
-                       case 'o':
-                               if(--argc > 0)
-                                       outfil = *++argv;
-                               continue;
-
-                       case 'T':
-                               if (--argc > 0)
-                                       dirtry[0] = *++argv;
-                               continue;
-
-                       default:
-                               field(++*argv,nfields>0);
-                               break;
-                       }
-                       break;
-               } else if (**argv == '+') {
-                       if(++nfields>=NF) {
-                               diag("too many keys","");
-                               exit(1);
-                       }
-                       copyproto();
-                       field(++*argv,0);
-               } else
-                       eargv[eargc++] = *argv;
-       }
-       q = &fields[0];
-       for(a=1; a<=nfields; a++) {
-               p = &fields[a];
-               if(p->code != proto.code) continue;
-               if(p->ignore != proto.ignore) continue;
-               if(p->nflg != proto.nflg) continue;
-               if(p->rflg != proto.rflg) continue;
-               if(p->bflg[0] != proto.bflg[0]) continue;
-               if(p->bflg[1] != proto.bflg[1]) continue;
-               p->code = q->code;
-               p->ignore = q->ignore;
-               p->nflg = q->nflg;
-               p->rflg = q->rflg;
-               p->bflg[0] = p->bflg[1] = q->bflg[0];
-       }
-       if(eargc == 0)
-               eargv[eargc++] = "-";
-       if(cflg && eargc>1) {
-               diag("can check only 1 file","");
-               exit(1);
-       }
-       safeoutfil();
-
-       ep = end + MEM;
-       lspace = (int *)sbrk(0);
-       while((int)brk(ep) == -1)
-               ep -= 512;
-       brk(ep -= 512); /* for recursion */
-       a = ep - (char*)lspace;
-       nlines = (a-L);
-       nlines /= (5*(sizeof(char *)/sizeof(char)));
-       ntext = nlines*8;
-       tspace = (char *)(lspace + nlines);
-       a = -1;
-       for(dirs=dirtry; *dirs; dirs++) {
-               sprintf(filep=file1, "%s/stm%05uaa", *dirs, getpid());
-               while (*filep)
-                       filep++;
-               filep -= 2;
-               if ( (a=creat(file, 0600)) >=0)
-                       break;
-       }
-       if(a < 0) {
-               diag("can't locate temp","");
-               exit(1);
-       }
-       close(a);
-       signal(SIGHUP, term);
-       if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, term);
-       signal(SIGPIPE,term);
-       signal(SIGTERM,term);
-       nfiles = eargc;
-       if(!mflg && !cflg) {
-               sort();
-               fclose(stdin);
-       }
-       for(a = mflg|cflg?0:eargc; a+N<nfiles || unsafeout&&a<eargc; a=i) {
-               i = a+N;
-               if(i>=nfiles)
-                       i = nfiles;
-               newfile();
-               merge(a, i);
-       }
-       if(a != nfiles) {
-               oldfile();
-               merge(a, nfiles);
-       }
-       error = 0;
-       term();
-}
-
-sort()
-{
-       register char *cp;
-       register char **lp;
-       register c;
-       int done;
-       int i;
-       char *f;
-
-       done = 0;
-       i = 0;
-       c = EOF;
-       do {
-               cp = tspace;
-               lp = (char **)lspace;
-               while(lp < (char **)lspace+nlines && cp < tspace+ntext) {
-                       *lp++ = cp;
-                       while(c != '\n') {
-                               if(c != EOF) {
-                                       *cp++ = c;
-                                       c = getc(is);
-                                       continue;
-                               } else if(is)
-                                       fclose(is);
-                               if(i < eargc) {
-                                       if((f = setfil(i++)) == 0)
-                                               is = stdin;
-                                       else if((is = fopen(f, "r")) == NULL)
-                                               cant(f);
-                                       c = getc(is);
-                               } else
-                                       break;
-                       }
-                       *cp++ = '\n';
-                       if(c == EOF) {
-                               done++;
-                               lp--;
-                               break;
-                       }
-                       c = getc(is);
-               }
-               qsort((char **)lspace, lp);
-               if(done == 0 || nfiles != eargc)
-                       newfile();
-               else
-                       oldfile();
-               while(lp > (char **)lspace) {
-                       cp = *--lp;
-                       if(*cp)
-                               do
-                               putc(*cp, os);
-                               while(*cp++ != '\n');
-               }
-               fclose(os);
-       } while(done == 0);
-}
-
-struct merg
-{
-       char    l[L];
-       FILE    *b;
-} *ibuf[256];
-
-merge(a,b)
-{
-       struct  merg    *p;
-       register char   *cp, *dp;
-       register        i;
-       struct merg **ip, *jp;
-       char    *f;
-       int     j;
-       int     k, l;
-       int     muflg;
-
-       p = (struct merg *)lspace;
-       j = 0;
-       for(i=a; i < b; i++) {
-               f = setfil(i);
-               if(f == 0)
-                       p->b = stdin;
-               else if((p->b = fopen(f, "r")) == NULL)
-                       cant(f);
-               ibuf[j] = p;
-               if(!rline(p))   j++;
-               p++;
-       }
-
-       do {
-               i = j;
-               qsort((char **)ibuf, (char **)(ibuf+i));
-               l = 0;
-               while(i--) {
-                       cp = ibuf[i]->l;
-                       if(*cp == '\0') {
-                               l = 1;
-                               if(rline(ibuf[i])) {
-                                       k = i;
-                                       while(++k < j)
-                                               ibuf[k-1] = ibuf[k];
-                                       j--;
-                               }
-                       }
-               }
-       } while(l);
-
-       muflg = mflg & uflg | cflg;
-       i = j;
-       while(i > 0) {
-               cp = ibuf[i-1]->l;
-               if(!cflg && (uflg == 0 || muflg ||
-                       (*compare)(ibuf[i-1]->l,ibuf[i-2]->l)))
-                       do
-                               putc(*cp, os);
-                       while(*cp++ != '\n');
-               if(muflg){
-                       cp = ibuf[i-1]->l;
-                       dp = p->l;
-                       do {
-                       } while((*dp++ = *cp++) != '\n');
-               }
-               for(;;) {
-                       if(rline(ibuf[i-1])) {
-                               i--;
-                               if(i == 0)
-                                       break;
-                               if(i == 1)
-                                       muflg = uflg;
-                       }
-                       ip = &ibuf[i];
-                       while(--ip>ibuf&&(*compare)(ip[0]->l,ip[-1]->l)<0){
-                               jp = *ip;
-                               *ip = *(ip-1);
-                               *(ip-1) = jp;
-                       }
-                       if(!muflg)
-                               break;
-                       j = (*compare)(ibuf[i-1]->l,p->l);
-                       if(cflg) {
-                               if(j > 0)
-                                       disorder("disorder:",ibuf[i-1]->l);
-                               else if(uflg && j==0)
-                                       disorder("nonunique:",ibuf[i-1]->l);
-                       } else if(j == 0)
-                               continue;
-                       break;
-               }
-       }
-       p = (struct merg *)lspace;
-       for(i=a; i<b; i++) {
-               fclose(p->b);
-               p++;
-               if(i >= eargc)
-                       unlink(setfil(i));
-       }
-       fclose(os);
-}
-
-rline(mp)
-struct merg *mp;
-{
-       register char *cp;
-       register char *ce;
-       FILE *bp;
-       register c;
-
-       bp = mp->b;
-       cp = mp->l;
-       ce = cp+L;
-       do {
-               c = getc(bp);
-               if(c == EOF)
-                       return(1);
-               if(cp>=ce)
-                       cp--;
-               *cp++ = c;
-       } while(c!='\n');
-       return(0);
-}
-
-disorder(s,t)
-char *s, *t;
-{
-       register char *u;
-       for(u=t; *u!='\n';u++) ;
-       *u = 0;
-       diag(s,t);
-       term();
-}
-
-newfile()
-{
-       register char *f;
-
-       f = setfil(nfiles);
-       if((os=fopen(f, "w")) == NULL) {
-               diag("can't create ",f);
-               term();
-       }
-       nfiles++;
-}
-
-char *
-setfil(i)
-{
-
-       if(i < eargc)
-               if(eargv[i][0] == '-' && eargv[i][1] == '\0')
-                       return(0);
-               else
-                       return(eargv[i]);
-       i -= eargc;
-       filep[0] = i/26 + 'a';
-       filep[1] = i%26 + 'a';
-       return(file);
-}
-
-oldfile()
-{
-
-       if(outfil) {
-               if((os=fopen(outfil, "w")) == NULL) {
-                       diag("can't create ",outfil);
-                       term();
-               }
-       } else
-               os = stdout;
-}
-
-safeoutfil()
-{
-       register int i;
-       struct stat obuf,ibuf;
-
-       if(!mflg||outfil==0)
-               return;
-       if(stat(outfil,&obuf)==-1)
-               return;
-       for(i=eargc-N;i<eargc;i++) {    /*-N is suff., not nec.*/
-               if(stat(eargv[i],&ibuf)==-1)
-                       continue;
-               if(obuf.st_dev==ibuf.st_dev&&
-                  obuf.st_ino==ibuf.st_ino)
-                       unsafeout++;
-       }
-}
-
-cant(f)
-char *f;
-{
-
-       diag("can't open ",f);
-       term();
-}
-
-diag(s,t)
-char *s, *t;
-{
-       fputs("sort: ",stderr);
-       fputs(s,stderr);
-       fputs(t,stderr);
-       fputs("\n",stderr);
-}
-
-term()
-{
-       register i;
-
-       signal(SIGINT, SIG_IGN);
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGTERM, SIG_IGN);
-       if(nfiles == eargc)
-               nfiles++;
-       for(i=eargc; i<=nfiles; i++) {  /*<= in case of interrupt*/
-               unlink(setfil(i));      /*with nfiles not updated*/
-       }
-       exit(error);
-}
-
-cmp(i, j)
-char *i, *j;
-{
-       register char *pa, *pb;
-       char *skip();
-       char *code, *ignore;
-       int a, b;
-       int k;
-       char *la, *lb;
-       register int sa;
-       int sb;
-       char *ipa, *ipb, *jpa, *jpb;
-       struct field *fp;
-
-       for(k = nfields>0; k<=nfields; k++) {
-               fp = &fields[k];
-               pa = i;
-               pb = j;
-               if(k) {
-                       la = skip(pa, fp, 1);
-                       pa = skip(pa, fp, 0);
-                       lb = skip(pb, fp, 1);
-                       pb = skip(pb, fp, 0);
-               } else {
-                       la = eol(pa);
-                       lb = eol(pb);
-               }
-               if(fp->nflg) {
-                       while(blank(*pa))
-                               pa++;
-                       while(blank(*pb))
-                               pb++;
-                       sa = sb = fp->rflg;
-                       if(*pa == '-') {
-                               pa++;
-                               sa = -sa;
-                       }
-                       if(*pb == '-') {
-                               pb++;
-                               sb = -sb;
-                       }
-                       for(ipa = pa; ipa<la&&isdigit(*ipa); ipa++) ;
-                       for(ipb = pb; ipb<lb&&isdigit(*ipb); ipb++) ;
-                       jpa = ipa;
-                       jpb = ipb;
-                       a = 0;
-                       if(sa==sb)
-                               while(ipa > pa && ipb > pb)
-                                       if(b = *--ipb - *--ipa)
-                                               a = b;
-                       while(ipa > pa)
-                               if(*--ipa != '0')
-                                       return(-sa);
-                       while(ipb > pb)
-                               if(*--ipb != '0')
-                                       return(sb);
-                       if(a) return(a*sa);
-                       if(*(pa=jpa) == '.')
-                               pa++;
-                       if(*(pb=jpb) == '.')
-                               pb++;
-                       if(sa==sb)
-                               while(pa<la && isdigit(*pa)
-                                  && pb<lb && isdigit(*pb))
-                                       if(a = *pb++ - *pa++)
-                                               return(a*sa);
-                       while(pa<la && isdigit(*pa))
-                               if(*pa++ != '0')
-                                       return(-sa);
-                       while(pb<lb && isdigit(*pb))
-                               if(*pb++ != '0')
-                                       return(sb);
-                       continue;
-               }
-               code = fp->code;
-               ignore = fp->ignore;
-loop: 
-               while(ignore[*pa])
-                       pa++;
-               while(ignore[*pb])
-                       pb++;
-               if(pa>=la || *pa=='\n')
-                       if(pb<lb && *pb!='\n')
-                               return(fp->rflg);
-                       else continue;
-               if(pb>=lb || *pb=='\n')
-                       return(-fp->rflg);
-               if((sa = code[*pb++]-code[*pa++]) == 0)
-                       goto loop;
-               return(sa*fp->rflg);
-       }
-       if(uflg)
-               return(0);
-       return(cmpa(i, j));
-}
-
-cmpa(pa, pb)
-register char *pa, *pb;
-{
-       while(*pa == *pb) {
-               if(*pa++ == '\n')
-                       return(0);
-               pb++;
-       }
-       return(
-               *pa == '\n' ? fields[0].rflg:
-               *pb == '\n' ?-fields[0].rflg:
-               *pb > *pa   ? fields[0].rflg:
-               -fields[0].rflg
-       );
-}
-
-char *
-skip(pp, fp, j)
-struct field *fp;
-char *pp;
-{
-       register i;
-       register char *p;
-
-       p = pp;
-       if( (i=fp->m[j]) < 0)
-               return(eol(p));
-       while(i-- > 0) {
-               if(tabchar != 0) {
-                       while(*p != tabchar)
-                               if(*p != '\n')
-                                       p++;
-                               else goto ret;
-                       p++;
-               } else {
-                       while(blank(*p))
-                               p++;
-                       while(!blank(*p))
-                               if(*p != '\n')
-                                       p++;
-                               else goto ret;
-               }
-       }
-       if(fp->bflg[j])
-               while(blank(*p))
-                       p++;
-       i = fp->n[j];
-       while(i-- > 0) {
-               if(*p != '\n')
-                       p++;
-               else goto ret;
-       } 
-ret:
-       return(p);
-}
-
-char *
-eol(p)
-register char *p;
-{
-       while(*p != '\n') p++;
-       return(p);
-}
-
-copyproto()
-{
-       register i;
-       register int *p, *q;
-
-       p = (int *)&proto;
-       q = (int *)&fields[nfields];
-       for(i=0; i<sizeof(proto)/sizeof(*p); i++)
-               *q++ = *p++;
-}
-
-field(s,k)
-char *s;
-{
-       register struct field *p;
-       register d;
-       p = &fields[nfields];
-       d = 0;
-       for(; *s!=0; s++) {
-               switch(*s) {
-               case '\0':
-                       return;
-
-               case 'b':
-                       p->bflg[k]++;
-                       break;
-
-               case 'd':
-                       p->ignore = dict+128;
-                       break;
-
-               case 'f':
-                       p->code = fold+128;
-                       break;
-               case 'i':
-                       p->ignore = nonprint+128;
-                       break;
-
-               case 'c':
-                       cflg = 1;
-                       continue;
-
-               case 'm':
-                       mflg = 1;
-                       continue;
-
-               case 'n':
-                       p->nflg++;
-                       break;
-               case 't':
-                       tabchar = *++s;
-                       if(tabchar == 0) s--;
-                       continue;
-
-               case 'r':
-                       p->rflg = -1;
-                       continue;
-               case 'u':
-                       uflg = 1;
-                       break;
-
-               case '.':
-                       if(p->m[k] == -1)       /* -m.n with m missing */
-                               p->m[k] = 0;
-                       d = &fields[0].n[0]-&fields[0].m[0];
-
-               default:
-                       p->m[k+d] = number(&s);
-               }
-               compare = cmp;
-       }
-}
-
-number(ppa)
-char **ppa;
-{
-       int n;
-       register char *pa;
-       pa = *ppa;
-       n = 0;
-       while(isdigit(*pa)) {
-               n = n*10 + *pa - '0';
-               *ppa = pa++;
-       }
-       return(n);
-}
-
-blank(c)
-{
-       if(c==' ' || c=='\t')
-               return(1);
-       return(0);
-}
-
-#define qsexc(p,q) t= *p;*p= *q;*q=t
-#define qstexc(p,q,r) t= *p;*p= *r;*r= *q;*q=t
-
-qsort(a,l)
-char **a, **l;
-{
-       register char **i, **j;
-       char **k;
-       char **lp, **hp;
-       int c;
-       char *t;
-       unsigned n;
-
-
-
-start:
-       if((n=l-a) <= 1)
-               return;
-
-
-       n /= 2;
-       hp = lp = a+n;
-       i = a;
-       j = l-1;
-
-
-       for(;;) {
-               if(i < lp) {
-                       if((c = (*compare)(*i, *lp)) == 0) {
-                               --lp;
-                               qsexc(i, lp);
-                               continue;
-                       }
-                       if(c < 0) {
-                               ++i;
-                               continue;
-                       }
-               }
-
-loop:
-               if(j > hp) {
-                       if((c = (*compare)(*hp, *j)) == 0) {
-                               ++hp;
-                               qsexc(hp, j);
-                               goto loop;
-                       }
-                       if(c > 0) {
-                               if(i == lp) {
-                                       ++hp;
-                                       qstexc(i, hp, j);
-                                       i = ++lp;
-                                       goto loop;
-                               }
-                               qsexc(i, j);
-                               --j;
-                               ++i;
-                               continue;
-                       }
-                       --j;
-                       goto loop;
-               }
-
-
-               if(i == lp) {
-                       if(uflg)
-                               for(k=lp+1; k<=hp;) **k++ = '\0';
-                       if(lp-a >= l-hp) {
-                               qsort(hp+1, l);
-                               l = lp;
-                       } else {
-                               qsort(a, lp);
-                               a = hp+1;
-                       }
-                       goto start;
-               }
-
-
-               --lp;
-               qstexc(j, lp, i);
-               j = --hp;
-       }
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/sp.c b/.ref-Research-V7/usr/src/cmd/sp.c
deleted file mode 100644 (file)
index a88ac1f..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Print horizontally as possible, thus saving paper
- */
-#include <stdio.h>
-int tab[8] = {8,7,6,5,4,3,2,1};
-int next;      /*next output position on line*/
-int slen;      /*length at start of line*/
-int alen;      /*actual length*/
-int elen;      /*length on current line*/
-char buf[256];
-getit()
-{      register int i;
-       register c;
-       slen=alen=elen=0;
-       for(i=0;;i++)
-       {       buf[i]=c=getchar();
-               switch(c)
-               {
-               case '\n':      if(i==0) continue;
-               case EOF:
-                       alen=i;
-                       return(i);
-               case '\t':
-                       elen+= tab[(next+elen)%8];
-                       slen += tab[slen%8];
-                       continue;
-               default:
-                       elen++;
-                       slen++;
-                       continue;
-               }
-       }
-}
-putit(ntab)
-{      register int i;
-       for(i=0;i<ntab;i++) putchar('\t');
-       for(i=0;i<alen;i++) putchar(buf[i]);
-}
-clean()
-{
-       putchar('\n');
-}
-main(argc,argv) char *argv[];
-{      int len,ntab;
-       int i;
-       len=80;
-       if(argc>1)
-       {       i=atoi(argv[1]);
-               if(i<0) i= -i;
-               len=(i<1?1:i);
-       }
-       else len=80;
-       for(;;)
-       {       if(next==0) ntab=0;
-               else if(tab[next%8]<1)
-                       {       ntab=2;
-                               next+= tab[next%8];
-                               next += tab[next%8];
-                       }
-                       else
-                       {       ntab=1;
-                               next += tab[next%8];
-                       }
-               if(getit()<=0) {clean(); exit(0);}
-               if(elen+next>=len)
-               {       clean();
-                       next=slen;
-                       putit(0);
-               }
-               else
-               {       next += elen;
-                       putit(ntab);
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/spell/american b/.ref-Research-V7/usr/src/cmd/spell/american
deleted file mode 100644 (file)
index 5bf6965..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-acknowledgment
-aggrandize
-aluminize
-aluminum
-amor
-amorous
-amphitheater
-analog
-analyze
-anemia
-anemic
-anesthesia
-anesthetic
-anesthetize
-antagonize
-apologize
-appareled
-appareling
-appetize
-arbor
-archeology
-ardor
-arithmetize
-armor
-armory
-axiomatize
-baptize
-barreled
-barreling
-behavior
-behoove
-belabor
-beveled
-beveler
-beveling
-canceled
-canceler
-canceling
-candor
-catalog
-catalyze
-catechize
-categorize
-cauterize
-center
-channeled
-channeler
-channeling
-chiseled
-chiseler
-chiseling
-clamor
-clamorous
-clangor
-color
-colorable
-colorful
-colorist
-corbeled
-corbeling
-counseled
-counseling
-crystallize
-cudgeled
-cudgeler
-cudgeling
-decentralize
-decriminalize
-defense
-dehumanize
-deionize
-demagnetize
-demeanor
-demineralize
-demoralize
-denormalize
-depersonalize
-depolarize
-desensitize
-detribalize
-dialyze
-diarrhea
-discolor
-disemboweled
-disemboweling
-disfavor
-disheveled
-disheveler
-disheveling
-dishonor
-dishonorable
-disorganize
-doweled
-doweler
-doweling
-dramatize
-dueled
-dueler
-dueling
-duelist
-economize
-ecumenical
-edema
-emphasize
-enameled
-enameling
-enamor
-encyclopedia
-endeavor
-energize
-eon
-epicenter
-esophagus
-eulogize
-favor
-favorable
-favorite
-fervor
-fiber
-flavor
-flavorful
-fraternize
-fueled
-fueler
-fueling
-funneled
-funneler
-funneling
-furor
-galvanize
-gaveled
-gaveler
-gaveling
-glamorize
-gram
-graveled
-graveling
-groveled
-groveler
-groveling
-gynecology
-harbor
-harmonize
-hiccup
-hiccupped
-hiccupping
-homeopathy
-homogenize
-honor
-honorable
-humor
-hydrolyze
-hypnotize
-hypostatize
-hypothesize
-jeweled
-jeweler
-jeweling
-judgment
-kilogram
-kinesthetic
-labeled
-labeler
-labeling
-labor
-laborite
-legitimize
-leveled
-leveler
-leveling
-libeled
-libeler
-libeling
-license
-liter
-logorrhea
-louver
-luster
-marveled
-marveler
-marveling
-mechanize
-medieval
-memorize
-mesmerize
-metallize
-modeled
-modeler
-modeling
-nanogram
-naught
-neighbor
-neighborhood
-notarize
-ocher
-odor
-offense
-optimize
-orientation
-ostracize
-pajama
-pallor
-paneled
-paneling
-paralleled
-paralleling
-paralyze
-parametrize
-parceled
-parceler
-parceling
-parenthesize
-parlor
-peptize
-photolyze
-photosynthesize
-picogram
-plagiarize
-plow
-preprogram
-program
-proselytize
-psychoanalyze
-psycoanalyze
-pulverize
-pummeled
-pummeler
-pummeling
-pyorrhea
-pyrolyze
-quantize
-quarreled
-quarreler
-quarreling
-rancor
-raveled
-raveler
-raveling
-realize
-recognize
-reconnoiter
-reveled
-reveler
-reveling
-rigor
-rumor
-saber
-saltpeter
-savior
-savor
-savory
-scepter
-schematize
-scrutinize
-sensitize
-sepulcher
-shoveled
-shoveler
-shoveling
-shriveled
-shriveling
-siphon
-sniveled
-sniveler
-sniveling
-soliloquize
-specialty
-specter
-spirochete
-splendor
-squirreled
-squirreling
-stigmatize
-succor
-summarize
-swiveled
-swiveling
-symmetrize
-sympathize
-synchronize
-synthesize
-systematize
-tantalize
-tasseled
-tasseling
-temporize
-theater
-theatergoer
-theatergoing
-theorize
-tinseled
-tinseling
-titer
-toweled
-toweling
-trammeled
-traumatize
-traveled
-traveler
-traveling
-tricolor
-tumor
-tunneled
-tunneler
-tunneling
-tyrannize
-valor
-vapor
-varicolored
-vigor
-vulcanize
-wagon
-watercolor
-watercolorist
-weaseled
-weaseling
-whiskey
-yodeled
-yodeling
diff --git a/.ref-Research-V7/usr/src/cmd/spell/british b/.ref-Research-V7/usr/src/cmd/spell/british
deleted file mode 100644 (file)
index 4eb2e36..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-acclimatise
-aeon
-aerodrome
-aeroplane
-aggrandise
-alarum
-aluminium
-amour
-amourous
-amphitheatre
-anaemia
-anaemic
-anaesthesia
-anaesthetic
-anaesthetise
-analyse
-antagonise
-apologise
-apparelled
-apparelling
-appetise
-arbour
-archaeology
-ardour
-arithmetise
-armour
-armoury
-axiomatise
-baptise
-barrelled
-barrelling
-behaviour
-behavioural
-behove
-belabour
-bevelled
-beveller
-bevelling
-cancelled
-canceller
-cancelling
-candour
-catalyse
-catechise
-categorise
-cauterise
-centimetre
-centre
-channelled
-channeller
-channelling
-cheque
-chequer
-chiselled
-chiseller
-chiselling
-clamour
-clamourous
-clangour
-colour
-colourable
-colourist
-connexion
-corbelled
-corbelling
-counselled
-counselling
-crystallise
-cudgelled
-cudgeller
-cudgelling
-decentralise
-decriminalise
-defence
-dehumanise
-deionise
-demagnetise
-demeanour
-demineralise
-demoralise
-denormalise
-depersonalise
-depolarise
-desensitise
-detribalise
-dialyse
-diarrhoea
-discolour
-disembowelled
-disembowelling
-disfavour
-dishevelled
-disheveller
-dishevelling
-dishonour
-dishonourable
-disorganise
-dowelled
-doweller
-dowelling
-dramatise
-draught
-duelled
-dueller
-duelling
-duellist
-economise
-emphasise
-enamelled
-enamelling
-enamour
-encyclopaedia
-endeavour
-energise
-epicentre
-eulogise
-favour
-favourable
-favourite
-fervour
-fibre
-flavour
-flavourful
-fraternise
-fuelled
-fueller
-fuelling
-funnelled
-funneller
-funnelling
-furore
-fuze
-galvanise
-gaol
-gavelled
-gaveller
-gavelling
-glamourise
-gramme
-gravelled
-gravelling
-grovelled
-groveller
-grovelling
-gynaecology
-harbour
-harmonise
-homoeopathy
-homogenise
-honour
-honourable
-humour
-hydrolyse
-hypnotise
-hypostatise
-hypothesise
-jewelled
-jeweller
-jewelling
-kilogramme
-kilometre
-kinaesthetic
-labelled
-labeller
-labelling
-labour
-labourite
-legitimise
-levelled
-leveller
-levelling
-libelled
-libeller
-libelling
-licence
-litre
-logorrhoea
-lustre
-marvelled
-marveller
-marvelling
-mechanise
-mediaeval
-memorise
-mesmerise
-metallise
-metre
-modelled
-modeller
-modelling
-nanogramme
-nanometre
-neighbour
-neighbourhood
-notarise
-nought
-ochre
-odour
-oecumenical
-oedema
-oesophagus
-offence
-optimise
-orientate
-ostracise
-pallour
-panelled
-panelling
-parallelled
-parallelling
-paralyse
-parametrise
-parcelled
-parceller
-parcelling
-parenthesise
-parlour
-peptise
-photolyse
-photosynthesise
-picogramme
-plagiarise
-plough
-practise
-preprogramme
-programme
-proselytise
-psychoanalyse
-pulverise
-pummelled
-pummeller
-pummelling
-pyjama
-pyorrhoea
-pyrolyse
-quantise
-quarrelled
-quarreller
-quarrelling
-rancour
-ravelled
-raveller
-ravelling
-realise
-recognise
-reconnoitre
-revelled
-reveller
-revelling
-rigour
-rumour
-sabre
-saltpetre
-saviour
-savour
-savoury
-sceptre
-schematise
-scrutinise
-sensitise
-sepulchre
-shovelled
-shoveller
-shovelling
-shrivelled
-shrivelling
-snivelled
-sniveller
-snivelling
-soliloquise
-speciality
-spectre
-splendour
-squirrelled
-squirrelling
-stigmatise
-succour
-summarise
-swivelled
-swivelling
-symmetrise
-sympathise
-synchronise
-synthesise
-syphon
-systematise
-tantalise
-tasselled
-tasselling
-temporise
-theatre
-theorise
-tinselled
-tinselling
-titre
-towelled
-towelling
-trammelled
-traumatise
-travelled
-traveller
-travelling
-tricolour
-tumour
-tunnelled
-tunneller
-tunnelling
-tyrannise
-tyre
-valour
-vapour
-varicoloured
-vigour
-vulcanise
-waggon
-watercolour
-watercolourist
-weaselled
-weaselling
-whilst
-whisky
-yodelled
-yodelling
diff --git a/.ref-Research-V7/usr/src/cmd/spell/local b/.ref-Research-V7/usr/src/cmd/spell/local
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/.ref-Research-V7/usr/src/cmd/spell/makefile b/.ref-Research-V7/usr/src/cmd/spell/makefile
deleted file mode 100644 (file)
index 1440197..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-all:   spell hlist hlista hlistb hstop spellin
-       :
-
-cp:    all
-       cp spell /usr/lib
-       cp hlista /usr/dict
-       cp hlistb /usr/dict
-       cp hstop /usr/dict
-       rm spell hlista hlistb hstop hlist
-
-cmp:   spell
-       cmp spell /usr/lib/spell
-       rm spell
-
-spell: spell.c
-       cc -i -s -O spell.c -o spell
-spellin: spellin.c
-       cc -i -O -s spellin.c -o spellin
-spellout: spellout.c
-       cc -i -O -s spellout.c -o spellout
-
-hlist: /usr/dict/words spellin
-       spellin </usr/dict/words >hlist
-hlista: american local hlist spellin
-       (cat american local)|spellin hlist >hlista
-hlistb: british local hlist spellin
-       (cat british local)|spellin hlist >hlistb
-hstop: stop spellin
-       spellin <stop >hstop
diff --git a/.ref-Research-V7/usr/src/cmd/spell/spell.c b/.ref-Research-V7/usr/src/cmd/spell/spell.c
deleted file mode 100644 (file)
index 0ffcba4..0000000
+++ /dev/null
@@ -1,536 +0,0 @@
-#include "spell.h"
-#define DLEV 2
-
-char   *strcat();
-int    strip();
-char   *skipv();
-int    an();
-int    s();
-int    es();
-int    ily();
-int    ncy();
-int    CCe();
-int    VCe();
-int    bility();
-int    tion();
-int    ize();
-int    y_to_e();
-int    i_to_y();
-int    nop();
-int    metry();
-
-struct suftab {
-       char *suf;
-       int (*p1)();
-       int n1;
-       char *d1;
-       char *a1;
-       int (*p2)();
-       int n2;
-       char *d2;
-       char *a2;
-} suftab[] = {
-       {"ssen",ily,4,"-y+iness","+ness" },
-       {"ssel",ily,4,"-y+i+less","+less" },
-       {"se",s,1,"","+s",              es,2,"-y+ies","+es" },
-       {"s'",s,2,"","+'s"},
-       {"s",s,1,"","+s"},
-       {"ecn",ncy,1,"","-t+ce"},
-       {"ycn",ncy,1,"","-cy+t"},
-       {"ytilb",nop,0,"",""},
-       {"ytilib",bility,5,"-le+ility",""},
-       {"elbaif",i_to_y,4,"-y+iable",""},
-       {"elba",CCe,4,"-e+able","+able"},
-       {"yti",CCe,3,"-e+ity","+ity"},
-       {"ylb",y_to_e,1,"-e+y",""},
-       {"yl",ily,2,"-y+ily","+ly"},
-       {"laci",strip,2,"","+al"},
-       {"latnem",strip,2,"","+al"},
-       {"lanoi",strip,2,"","+al"},
-       {"tnem",strip,4,"","+ment"},
-       {"gni",CCe,3,"-e+ing","+ing"},
-       {"reta",nop,0,"",""},
-       {"re",strip,1,"","+r",          i_to_y,2,"-y+ier","+er"},
-       {"de",strip,1,"","+d",          i_to_y,2,"-y+ied","+ed"},
-       {"citsi",strip,2,"","+ic"},
-       {"cihparg",i_to_y,1,"-y+ic",""},
-       {"tse",strip,2,"","+st",        i_to_y,3,"-y+iest","+est"},
-       {"cirtem",i_to_y,1,"-y+ic",""},
-       {"yrtem",metry,0,"-ry+er",""},
-       {"cigol",i_to_y,1,"-y+ic",""},
-       {"tsigol",i_to_y,2,"-y+ist",""},
-       {"tsi",VCe,3,"-e+ist","+ist"},
-       {"msi",VCe,3,"-e+ism","+ist"},
-       {"noitacif",i_to_y,6,"-y+ication",""},
-       {"noitazi",ize,5,"-e+ation",""},
-       {"rota",tion,2,"-e+or",""},
-       {"noit",tion,3,"-e+ion","+ion"},
-       {"naino",an,3,"","+ian"},
-       {"na",an,1,"","+n"},
-       {"evit",tion,3,"-e+ive","+ive"},
-       {"ezi",CCe,3,"-e+ize","+ize"},
-       {"pihs",strip,4,"","+ship"},
-       {"dooh",ily,4,"-y+ihood","+hood"},
-       {"luf",ily,3,"-y+iful","+ful"},
-       {"ekil",strip,4,"","+like"},
-       0
-};
-
-char *preftab[] = {
-       "anti",
-       "bio",
-       "dis",
-       "electro",
-       "en",
-       "fore",
-       "hyper",
-       "intra",
-       "inter",
-       "iso",
-       "kilo",
-       "magneto",
-       "meta",
-       "micro",
-       "milli",
-       "mis",
-       "mono",
-       "multi",
-       "non",
-       "out",
-       "over",
-       "photo",
-       "poly",
-       "pre",
-       "pseudo",
-       "re",
-       "semi",
-       "stereo",
-       "sub",
-       "super",
-       "thermo",
-       "ultra",
-       "under",        /*must precede un*/
-       "un",
-       0
-};
-
-int vflag;
-int xflag;
-char word[100];
-char original[100];
-char *deriv[40];
-char affix[40];
-
-main(argc,argv)
-char **argv;
-{
-       register char *ep, *cp;
-       register char *dp;
-       int fold;
-       int j;
-       FILE *file, *found;
-       if(!prime(argc,argv)) {
-               fprintf(stderr,
-                   "spell: cannot initialize hash table\n");
-               exit(1);
-       }
-       found = fopen(argv[2],"w");
-       for(argc-=3,argv+=3; argc>0 && argv[0][0]=='-'; argc--,argv++)
-               switch(argv[0][1]) {
-               case 'b':
-                       ise();
-                       break;
-               case 'v':
-                       vflag++;
-                       break;
-               case 'x':
-                       xflag++;
-                       break;
-               }
-       for(;; fprintf(file,"%s%s\n",affix,original)) {
-               affix[0] = 0;
-               file = found;
-               for(ep=word;(*ep=j=getchar())!='\n';ep++)
-                       if(j == EOF)
-                               exit(0);
-               for(cp=word,dp=original; cp<ep; )
-                       *dp++ = *cp++;
-               *dp = 0;
-               fold = 0;
-               for(cp=word;cp<ep;cp++)
-                       if(islower(*cp))
-                               goto lcase;
-               if(putsuf(ep,".",0))
-                       continue;
-               ++fold;
-               for(cp=original+1,dp=word+1;dp<ep;dp++,cp++)
-                       *dp = Tolower(*cp);
-lcase:
-               if(putsuf(ep,".",0)||suffix(ep,0))
-                       continue;
-               if(isupper(word[0])) {
-                       for(cp=original,dp=word; *dp = *cp++; dp++)
-                               if (fold) *dp = Tolower(*dp);
-                       word[0] = Tolower(word[0]);
-                       goto lcase;
-               }
-               file = stdout;
-       }
-}
-
-suffix(ep,lev)
-char *ep;
-{
-       register struct suftab *t;
-       register char *cp, *sp;
-       lev += DLEV;
-       deriv[lev] = deriv[lev-1] = 0;
-       for(t= &suftab[0];sp=t->suf;t++) {
-               cp = ep;
-               while(*sp)
-                       if(*--cp!=*sp++)
-                               goto next;
-               for(sp=cp; --sp>=word&&!vowel(*sp); ) ;
-               if(sp<word)
-                       return(0);
-               if((*t->p1)(ep-t->n1,t->d1,t->a1,lev+1))
-                       return(1);
-               if(t->p2!=0) {
-                       deriv[lev] = deriv[lev+1] = 0;
-                       return((*t->p2)(ep-t->n2,t->d2,t->a2,lev));
-               }
-               return(0);
-next:          ;
-       }
-       return(0);
-}
-
-nop()
-{
-       return(0);
-}
-
-strip(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       return(putsuf(ep,a,lev)||suffix(ep,lev));
-}
-
-s(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       if(lev>DLEV+1)
-               return(0);
-       if(*ep=='s'&&ep[-1]=='s')
-               return(0);
-       return(strip(ep,d,a,lev));
-}
-
-an(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       if(!isupper(*word))     /*must be proper name*/
-               return(0);
-       return(putsuf(ep,a,lev));
-}
-
-ize(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       *ep++ = 'e';
-       return(strip(ep,"",d,lev));
-}
-
-y_to_e(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       *ep++ = 'e';
-       return(strip(ep,"",d,lev));
-}
-
-ily(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       if(ep[-1]=='i')
-               return(i_to_y(ep,d,a,lev));
-       else
-               return(strip(ep,d,a,lev));
-}
-
-ncy(ep,d,a,lev)
-char *ep, *d, *a;
-{
-       if(skipv(skipv(ep-1))<word)
-               return(0);
-       ep[-1] = 't';
-       return(strip(ep,d,a,lev));
-}
-
-bility(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       *ep++ = 'l';
-       return(y_to_e(ep,d,a,lev));
-}
-
-i_to_y(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       if(ep[-1]=='i') {
-               ep[-1] = 'y';
-               a = d;
-       }
-       return(strip(ep,"",a,lev));
-}
-
-es(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       if(lev>DLEV)
-               return(0);
-       switch(ep[-1]) {
-       default:
-               return(0);
-       case 'i':
-               return(i_to_y(ep,d,a,lev));
-       case 's':
-       case 'h':
-       case 'z':
-       case 'x':
-               return(strip(ep,d,a,lev));
-       }
-}
-
-metry(ep,d,a,lev)
-char *ep, *d,*a;
-{
-       ep[-2] = 'e';
-       ep[-1] = 'r';
-       return(strip(ep,d,a,lev));
-}
-
-tion(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       switch(ep[-2]) {
-       case 'c':
-       case 'r':
-               return(putsuf(ep,a,lev));
-       case 'a':
-               return(y_to_e(ep,d,a,lev));
-       }
-       return(0);
-}
-
-/*     possible consonant-consonant-e ending*/
-CCe(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       switch(ep[-1]) {
-       case 'l':
-               if(vowel(ep[-2]))
-                       break;
-               switch(ep[-2]) {
-               case 'l':
-               case 'r':
-               case 'w':
-                       break;
-               default:
-                       return(y_to_e(ep,d,a,lev));
-               }
-               break;
-       case 's':
-               if(ep[-2]=='s')
-                       break;
-       case 'c':
-       case 'g':
-               if(*ep=='a')
-                       return(0);
-       case 'v':
-       case 'z':
-               if(vowel(ep[-2]))
-                       break;
-       case 'u':
-               if(y_to_e(ep,d,a,lev))
-                       return(1);
-               if(!(ep[-2]=='n'&&ep[-1]=='g'))
-                       return(0);
-       }
-       return(VCe(ep,d,a,lev));
-}
-
-/*     possible consonant-vowel-consonant-e ending*/
-VCe(ep,d,a,lev)
-char *ep,*d,*a;
-{
-       char c;
-       c = ep[-1];
-       if(c=='e')
-               return(0);
-       if(!vowel(c) && vowel(ep[-2])) {
-               c = *ep;
-               *ep++ = 'e';
-               if(putsuf(ep,d,lev)||suffix(ep,lev))
-                       return(1);
-               ep--;
-               *ep = c;
-       }
-       return(strip(ep,d,a,lev));
-}
-
-char *lookuppref(wp,ep)
-char **wp;
-char *ep;
-{
-       register char **sp;
-       register char *bp,*cp;
-       for(sp=preftab;*sp;sp++) {
-               bp = *wp;
-               for(cp= *sp;*cp;cp++,bp++)
-                       if(Tolower(*bp)!=*cp)
-                               goto next;
-               for(cp=bp;cp<ep;cp++) 
-                       if(vowel(*cp)) {
-                               *wp = bp;
-                               return(*sp);
-                       }
-next:  ;
-       }
-       return(0);
-}
-
-putsuf(ep,a,lev)
-char *ep,*a;
-{
-       register char *cp;
-       char *bp;
-       register char *pp;
-       int val = 0;
-       char space[20];
-       deriv[lev] = a;
-       if(putw(word,ep,lev))
-               return(1);
-       bp = word;
-       pp = space;
-       deriv[lev+1] = pp;
-       while(cp=lookuppref(&bp,ep)) {
-               *pp++ = '+';
-               while(*pp = *cp++)
-                       pp++;
-               if(putw(bp,ep,lev+1)) {
-                       val = 1;
-                       break;
-               }
-       }
-       deriv[lev+1] = deriv[lev+2] = 0;
-       return(val);
-}
-
-putw(bp,ep,lev)
-char *bp,*ep;
-{
-       register i, j;
-       char duple[3];
-       if(ep-bp<=1)
-               return(0);
-       if(vowel(*ep)) {
-               if(monosyl(bp,ep))
-                       return(0);
-       }
-       i = dict(bp,ep);
-       if(i==0&&vowel(*ep)&&ep[-1]==ep[-2]&&monosyl(bp,ep-1)) {
-               ep--;
-               deriv[++lev] = duple;
-               duple[0] = '+';
-               duple[1] = *ep;
-               duple[2] = 0;
-               i = dict(bp,ep);
-       }
-       if(vflag==0||i==0)
-               return(i);
-       j = lev;
-       do {
-               if(deriv[j])
-                       strcat(affix,deriv[j]);
-       } while(--j>0);
-       strcat(affix,"\t");
-       return(i);
-}
-
-
-monosyl(bp,ep)
-char *bp, *ep;
-{
-       if(ep<bp+2)
-               return(0);
-       if(vowel(*--ep)||!vowel(*--ep)
-               ||ep[1]=='x'||ep[1]=='w')
-               return(0);
-       while(--ep>=bp)
-               if(vowel(*ep))
-                       return(0);
-       return(1);
-}
-
-char *
-skipv(s)
-char *s;
-{
-       if(s>=word&&vowel(*s))
-               s--;
-       while(s>=word&&!vowel(*s))
-               s--;
-       return(s);
-}
-
-vowel(c)
-{
-       switch(Tolower(c)) {
-       case 'a':
-       case 'e':
-       case 'i':
-       case 'o':
-       case 'u':
-       case 'y':
-               return(1);
-       }
-       return(0);
-}
-
-/* crummy way to Britishise */
-ise()
-{
-       register struct suftab *p;
-       for(p = suftab;p->suf;p++) {
-               ztos(p->suf);
-               ztos(p->d1);
-               ztos(p->a1);
-       }
-}
-ztos(s)
-char *s;
-{
-       for(;*s;s++)
-               if(*s=='z')
-                       *s = 's';
-}
-
-dict(bp,ep)
-char *bp, *ep;
-{
-       register char *wp;
-       long h;
-       register long *lp;
-       register i;
-       if(xflag)
-               printf("=%.*s\n",ep-bp,bp);
-       for(i=0; i<NP; i++) {
-               for (wp = bp, h = 0, lp = pow2[i]; wp < ep; ++wp, ++lp)
-                       h += *wp * *lp;
-               h += '\n' * *lp;
-               h %= p[i];
-               if(get(h)==0)
-                       return(0);
-       }
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/spell/spell.h b/.ref-Research-V7/usr/src/cmd/spell/spell.h
deleted file mode 100644 (file)
index 6ed377c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#include <stdio.h>
-#include <ctype.h>
-
-#ifndef unix
-#define SHIFT  5
-#define TABSIZE (int)(400000/(1<<SHIFT))
-int    *tab;   /*honeywell loader deficiency*/
-#else
-#define Tolower(c)     (isupper(c)?tolower(c):c) /* ugh!!! */
-#define SHIFT  4
-#define TABSIZE 25000  /*(int)(400000/(1<<shift))--pdp11 compiler deficiency*/
-short  tab[TABSIZE];
-#endif
-long   p[] = {
-       399871,
-       399887,
-       399899,
-       399911,
-       399913,
-       399937,
-       399941,
-       399953,
-       399979,
-       399983,
-       399989,
-};
-#define        NP      (sizeof(p)/sizeof(p[0]))
-#define        NW      30
-
-/*
-* Hash table for spelling checker has n bits.
-* Each word w is hashed by k different (modular) hash functions, hi.
-* The bits hi(w), i=1..k, are set for words in the dictionary.
-* Assuming independence, the probability that no word of a d-word
-* dictionary sets a particular bit is given by the Poisson formula
-* P = exp(-y)*y**0/0!, where y=d*k/n.
-* The probability that a random string is recognized as a word is then
-* (1-P)**k.  For given n and d this is minimum when y=log(2), P=1/2,
-* whence one finds, for example, that a 25000-word dictionary in a
-* 400000-bit table works best with k=11.
-*/
-
-long   pow2[NP][NW];
-
-prime(argc, argv) register char **argv;
-{
-       int i, j;
-       long h;
-       register long *lp;
-
-#ifndef unix
-       if ((tab = (int *)calloc(sizeof(*tab), TABSIZE)) == NULL)
-               return(0);
-#endif
-       if (argc > 1) {
-               FILE *f;
-               if ((f = fopen(argv[1], "ri")) == NULL)
-                       return(0);
-               if (fread((char *)tab, sizeof(*tab), TABSIZE, f) != TABSIZE)
-                       return(0);
-               fclose(f);
-       }
-       for (i=0; i<NP; i++) {
-               h = *(lp = pow2[i]) = 1<<14;
-               for (j=1; j<NW; j++)
-                       h = *++lp = (h<<7) % p[i];
-       }
-       return(1);
-}
-
-#define get(h) (tab[h>>SHIFT]&(1<<((int)h&((1<<SHIFT)-1))))
-#define set(h) tab[h>>SHIFT] |= 1<<((int)h&((1<<SHIFT)-1))
diff --git a/.ref-Research-V7/usr/src/cmd/spell/spellin.c b/.ref-Research-V7/usr/src/cmd/spell/spellin.c
deleted file mode 100644 (file)
index 3f46c2b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "spell.h"
-/* add entries to hash table for use by spell
-   preexisting hash table is first argument
-   words to be added are standard input
-   if no hash table is given, create one from scratch
-*/
-
-main(argc,argv)
-char **argv;
-{
-       register i, j;
-       long h;
-       register long *lp;
-       char word[NW];
-       register char *wp;
-
-       if(!prime(argc,argv)) {
-               fprintf(stderr,
-                   "spellin: cannot initialize hash table\n");
-               exit(1);
-       }
-       while (fgets(word, sizeof(word), stdin)) {
-               for (i=0; i<NP; i++) {
-                       for (wp = word, h = 0, lp = pow2[i];
-                                (j = *wp) != '\0'; ++wp, ++lp)
-                               h += j * *lp;
-                       h %= p[i];
-                       set(h);
-               }
-       }
-#ifdef gcos
-       freopen((char *)NULL, "wi", stdout);
-#endif
-       if (fwrite((char *)tab, sizeof(*tab), TABSIZE, stdout) != TABSIZE) {
-               fprintf(stderr,
-                   "spellin: trouble writing hash table\n");
-               exit(1);
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/spell/spellout.c b/.ref-Research-V7/usr/src/cmd/spell/spellout.c
deleted file mode 100644 (file)
index 91fa6c9..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "spell.h"
-
-main(argc, argv)
-char **argv;
-{
-       register i, j;
-       long h;
-       register long *lp;
-       char word[NW];
-       int dflag = 0;
-       int indict;
-       register char *wp;
-
-       if (argc>1 && argv[1][0]=='-' && argv[1][1]=='d') {
-               dflag = 1;
-               argc--;
-               argv++;
-       }
-       if(argc<=1) {
-               fprintf(stderr,"spellout: arg count\n");
-               exit(1);
-       }
-       if(!prime(argc,argv)) {
-               fprintf(stderr,
-                   "spellout: cannot initialize hash table\n");
-               exit(1);
-       }
-       while (fgets(word, sizeof(word), stdin)) {
-               indict = 1;
-               for (i=0; i<NP; i++) {
-                       for (wp = word, h = 0, lp = pow2[i];
-                               (j = *wp) != '\0'; ++wp, ++lp)
-                               h += j * *lp;
-                       h %= p[i];
-                       if (get(h)==0) {
-                               indict = 0;
-                               break;
-                       }
-               }
-               if (dflag == indict)
-                       fputs(word, stdout);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/spell/stop b/.ref-Research-V7/usr/src/cmd/spell/stop
deleted file mode 100644 (file)
index 4c77774..0000000
+++ /dev/null
@@ -1,940 +0,0 @@
-abator
-abeted
-abeter
-abeting
-abuted
-abuter
-abuting
-accessable
-acclimatize
-acquiter
-acquiting
-acter
-addendums
-adly
-admitable
-admited
-admiter
-admiting
-ahly
-allotable
-alloted
-alloter
-alloting
-amly
-ams
-animadvertion
-anly
-annulable
-annuled
-annuler
-annuling
-ans
-arguement
-arised
-asly
-ation
-ative
-atly
-ator
-ats
-audable
-auditer
-autosuggestable
-avered
-averer
-avering
-avertion
-aweful
-axises
-axly
-baned
-baning
-beared
-beated
-beator
-bedimed
-bedimer
-bediming
-befited
-befiter
-befiting
-befoged
-befoger
-befoging
-begeted
-begeter
-begeting
-begined
-beginer
-begining
-beholded
-bely
-bes
-besetable
-beseted
-beseter
-beseting
-besoting
-bespeaked
-bestired
-bestirer
-bestiring
-betted
-bidded
-bies
-binded
-bited
-blader
-bleeded
-blowed
-bootleged
-bootleger
-bootleging
-bootstraped
-bootstraping
-breaked
-breeded
-bringed
-bursted
-buyed
-byly
-Canadan
-carful
-Carolinan
-casted
-catched
-cheator
-checksumable
-checksumed
-checksuming
-choosed
-clinged
-collapsable
-collectable
-collecter
-colourate
-colourful
-combustable
-comed
-commitable
-commited
-commiter
-commiting
-compatable
-compeled
-compeler
-compeling
-compositer
-compositon
-comprehensable
-compressable
-condensable
-conducter
-coner
-confered
-conferer
-confering
-coning
-constricter
-constructable
-constructer
-contemptable
-contracter
-controlable
-controled
-controler
-controling
-controvertable
-convertable
-convertion
-corpuses
-correcter
-corrigendums
-corrodable
-corruptable
-credable
-crediter
-creeped
-currance
-currancy
-curriculas
-cutted
-datas
-datums
-dealed
-debared
-debarer
-debaring
-debator
-debter
-debuged
-debuger
-debuging
-decontroled
-decontroler
-decontroling
-deductable
-defensable
-defered
-deferer
-defering
-deflator
-deflecter
-degased
-degaser
-degasing
-degumed
-degumer
-deguming
-demitable
-demited
-demiter
-demiting
-demured
-demuring
-depositer
-depressable
-desolator
-destructer
-detecter
-detered
-deterer
-detering
-detracter
-diffusable
-digestable
-dimed
-dimest
-directer
-discernable
-discomfited
-discomfiter
-discomfiting
-disintered
-disinterer
-disintering
-dispelable
-dispeled
-dispeler
-dispeling
-dispence
-dispersable
-distributory
-divertion
-doged
-doger
-doging
-doly
-doned
-doner
-doning
-drawed
-drinked
-drived
-duely
-dus
-eated
-eator
-eavesdroped
-eavesdroper
-eavesdroping
-edable
-editer
-effluvias
-effluviums
-ehly
-ehs
-ejecter
-electer
-elly
-embedable
-embeded
-embeder
-embeding
-emitable
-emited
-emiter
-emiting
-emly
-emphasises
-enaction
-enbalm
-enbank
-enbark
-enbattle
-enbay
-enbed
-enbit
-enblaze
-enblazon
-enbody
-enbolden
-enboss
-enbow
-enbowel
-enbrace
-enbrittle
-enbroil
-encant
-encur
-endebted
-enend
-enflame
-enform
-enirate
-enit
-enly
-enpanel
-enpathetic
-enplace
-enplane
-enploy
-enpower
-enpress
-enpurple
-enroad
-entend
-entone
-entrapable
-entraped
-entraper
-entraping
-envoice
-equilibriums
-equipable
-equiped
-equiper
-equiping
-erodable
-erosable
-esophaguses
-estoped
-estoper
-estoping
-etly
-ets
-exasperator
-exceled
-exceler
-exceling
-exegesises
-exhaustable
-expansable
-expection
-expelable
-expeled
-expeler
-expeling
-expositer
-expressable
-extendable
-extensable
-extolable
-extoled
-extoler
-extoling
-extracter
-extremums
-extrovertion
-facter
-fadded
-fadding
-fallable
-falled
-feasable
-feeded
-feeled
-fighted
-finded
-flexable
-flinged
-flirtion
-Floridan
-fluter
-foable
-forbeared
-forbided
-forebade
-forebear
-forebid
-forebidden
-forebidding
-forebore
-forefend
-foregave
-foreget
-foregettable
-foregetting
-foregive
-foregiven
-foregot
-foremat
-foremate
-foresake
-foreswear
-forety
-foreward
-forgetable
-forgeted
-forsaked
-freezed
-frustrator
-fusable
-gayly
-genesises
-genuses
-getted
-giddaped
-giddaper
-giddaping
-gived
-glomed
-glumer
-glumest
-goly
-gos
-greator
-grimer
-grimest
-grinded
-growed
-gullable
-haly
-heared
-heator
-hely
-hes
-hesitator
-hily
-holded
-hopful
-horrable
-huggest
-huging
-hurted
-idly
-ifly
-iily
-iis
-impartion
-impelable
-impeled
-impeler
-impeling
-imperceptable
-implausable
-implementer
-importion
-impressable
-inaccessable
-inaudable
-incombustable
-incompatable
-incomprehensable
-incontrovertable
-incorruptable
-incredable
-incured
-incurer
-incuring
-indefensable
-indelable
-indestructable
-indigestable
-indiscernable
-inducter
-inexhaustable
-inexpressable
-infallable
-infeasable
-infered
-inferer
-infering
-inflator
-inflexable
-infusable
-ingestable
-inheriter
-inly
-insensable
-inspecter
-instructer
-intence
-intered
-interer
-intering
-interruptable
-intimator
-inventer
-invertable
-invertion
-invester
-irresistable
-irresponsable
-irreversable
-isly
-itly
-ivly
-ivs
-ixes
-ixly
-jitterbuged
-jitterbuger
-jitterbuging
-juter
-keeped
-kiloohm
-knowed
-lader
-laly
-lammest
-lapeled
-layed
-lended
-letted
-loaned
-loging
-loly
-losed
-mader
-madest
-mading
-maked
-maly
-maner
-maning
-manumitable
-manumited
-manumiter
-manumiting
-mared
-meaned
-meeted
-mely
-mies
-mily
-moter
-myly
-nely
-nes
-neurosises
-noding
-noly
-notory
-nuly
-objecter
-occured
-occurer
-occuring
-offsetable
-offseted
-offseter
-offseting
-ofly
-ofs
-ohly
-ons
-opuses
-ostensable
-outgaser
-ows
-oxes
-oxly
-padable
-paly
-paner
-paralysises
-parenthesises
-paster
-payed
-perceptable
-perfectable
-permitable
-permited
-permiter
-permiting
-pervertion
-phenomenas
-phenomenons
-photosynthesises
-pily
-pipper
-placator
-plausable
-plugable
-predicter
-preempter
-prefered
-preferer
-prefering
-preseter
-preseting
-presuably
-programable
-programed
-programer
-programing
-projecter
-pronounciation
-propeled
-propeler
-propeling
-prosecuter
-prospecter
-protecter
-quitable
-quiter
-quiting
-ratter
-readed
-reah
-realter
-rean
-reas
-reat
-reax
-rebat
-rebe
-rebeled
-rebeler
-rebeling
-rebutable
-rebuted
-rebuter
-rebuting
-reby
-recapable
-recaped
-recaper
-recaping
-recloth
-recommitable
-recommited
-recommiter
-recommiting
-recured
-recurer
-recuring
-redacter
-redu
-reem
-reen
-reet
-refered
-referer
-refering
-refited
-refiter
-refiting
-reflecter
-rego
-regretable
-regreted
-regreter
-regreting
-reha
-rehe
-rehi
-reho
-reif
-reii
-reis
-reit
-reiv
-reix
-reknited
-rekniter
-rekniting
-rela
-relo
-rema
-remad
-remaned
-remaner
-remaning
-reme
-remi
-remitable
-remited
-remiter
-remiting
-remu
-remy
-rended
-rene
-renu
-reof
-reoh
-reon
-reor
-reow
-reox
-repa
-repelable
-repeled
-repeler
-repeling
-repi
-reprehensable
-rere
-rerout
-rerunable
-reruned
-reruner
-reruning
-resa
-reshiped
-reshiper
-reshiping
-resistable
-reso
-responsable
-reti
-reto
-retrofited
-retrofiting
-reup
-reus
-reversable
-revertion
-revi
-rewe
-rewok
-rexi
-reye
-rided
-risable
-rised
-rocketed
-rocketer
-rocketing
-ruber
-rubing
-runable
-runed
-runned
-saging
-saly
-sandbaged
-sandbager
-sandbaging
-saturator
-sayed
-sculpter
-secretory
-secter
-seeked
-selecter
-selled
-senation
-senative
-sended
-sensable
-setable
-setted
-shaked
-shedded
-shipable
-shooted
-shrinked
-shutted
-siner
-sining
-sinked
-siply
-sitted
-slank
-slayed
-sleeped
-slided
-slinged
-slinked
-smited
-soliciter
-soly
-speaked
-spended
-spinable
-spiner
-spining
-spinned
-spiting
-splitted
-spotable
-spreaded
-stagged
-stagging
-standed
-stealed
-sticked
-stinked
-stopable
-stratas
-strided
-striked
-subletable
-subleted
-subleter
-subleting
-submitable
-submited
-submiter
-submiting
-suggestable
-suntaned
-suntaning
-suppressable
-susceptable
-sweared
-sweeped
-swimable
-swinged
-synopsises
-synthesises
-taked
-teached
-telled
-terrable
-thesises
-thier
-thinked
-thrombosises
-throwed
-thrusted
-tily
-tiner
-tining
-toly
-tracter
-traiter
-tranquility
-transfered
-transferer
-transfering
-transmitable
-transmited
-transmiter
-transmiting
-transportion
-trivias
-triviums
-truely
-typeseter
-typeseting
-unactivate
-unadequacy
-unattention
-unboard
-unbreed
-uncant
-uncapacity
-uncompletion
-uncorporate
-uncrease
-uncredulity
-unculpable
-uncur
-uncurred
-uncurrer
-uncurring
-undebt
-undeed
-undefinite
-undelicate
-undent
-undenture
-undices
-undignity
-undiscriminate
-undisposition
-undoor
-unduct
-undwell
-unefficacy
-unequity
-unfamous
-unfelicity
-unfest
-unfield
-unfiltrate
-unfinity
-unflame
-unflammable
-unflow
-unfluence
-unflux
-unformant
-unformation
-unfuse
-unfusion
-ungather
-ungrate
-ungratitude
-unhabitant
-unhabitation
-unhale
-unhere
-unholding
-unhumane
-unhumanity
-unjure
-unjury
-unnumerable
-unoperable
-unput
-unquest
-unscribe
-unscription
-unsect
-unside
-unspire
-unstall
-unstance
-unstead
-untact
-untake
-untemperance
-untend
-untestate
-untill
-untolerant
-untuition
-unvade
-unvalidate
-unvent
-unverse
-unversion
-unvertebrate
-unviolate
-unvocate
-unward
-unwieldly
-uply
-upseter
-upseting
-usful
-usly
-usses
-vendable
-vily
-vis
-visable
-visiter
-waked
-warer
-weared
-weeped
-wely
-wetable
-whitter
-whitting
-winable
-winned
-wringed
-writed
-xily
-yiper
-zigzaged
-zigzager
-zigzaging
diff --git a/.ref-Research-V7/usr/src/cmd/spline.c b/.ref-Research-V7/usr/src/cmd/spline.c
deleted file mode 100644 (file)
index 97ce053..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-#include <stdio.h>
-
-#define NP 1000
-#define INF 1.e37
-
-struct proj { int lbf,ubf; float a,b,lb,ub,quant,mult,val[NP]; } x,y;
-float *diag, *r;
-float dx = 1.;
-float ni = 100.;
-int n;
-int auta;
-int periodic;
-float konst = 0.0;
-float zero = 0.;
-
-/* Spline fit technique
-let x,y be vectors of abscissas and ordinates
-    h   be vector of differences h\e9i\e8=x\e9i\e8-x\e9i-1\e\e9\e8\e8
-    y"  be vector of 2nd derivs of approx function
-If the points are numbered 0,1,2,...,n+1 then y" satisfies
-(R W Hamming, Numerical Methods for Engineers and Scientists,
-2nd Ed, p349ff)
-       h\e9i\e8y"\b\e9i-1\e9\e8\e8+2(h\e9i\e8+h\e9i+1\e8)y"\b\e9i\e8+h\e9i+1\e8y"\b\e9i+1\e8
-       
-       = 6[(y\e9i+1\e8-y\e9i\e8)/h\e9i+1\e8-(y\e9i\e8-y\e9i-1\e8)/h\e9i\e8]   i=1,2,...,n
-
-where y"\b\e90\e8 = y"\b\e9n+1\e8 = 0
-This is a symmetric tridiagonal system of the form
-
-       | a\e91\e8 h\e92\e8               |  |y"\b\e91\e8|      |b\e91\e8|
-       | h\e92\e8 a\e92\e8 h\e93\e8            |  |y"\b\e92\e8|      |b\e92\e8|
-       |    h\e93\e8 a\e93\e8 h\e94\e8         |  |y"\b\e93\e8|  =   |b\e93\e8|
-       |         .           |  | .|      | .|
-       |            .        |  | .|      | .|
-It can be triangularized into
-       | d\e91\e8 h\e92\e8               |  |y"\b\e91\e8|      |r\e91\e8|
-       |    d\e92\e8 h\e93\e8            |  |y"\b\e92\e8|      |r\e92\e8|
-       |       d\e93\e8 h\e94\e8         |  |y"\b\e93\e8|  =   |r\e93\e8|
-       |          .          |  | .|      | .|
-       |             .       |  | .|      | .|
-where
-       d\e91\e8 = a\e91\e8
-
-       r\e90\e8 = 0
-
-       d\e9i\e8 = a\e9i\e8 - h\e9i\e8\b\e82\e9/d\e9i-1\e8 1<i<\b_n
-
-       r\e9i\e8 = b\e9i\e8 - h\e9i\e8r\e9i-1\e8/d\e9i-1\ei\e8     1<\b_i<\b_n
-
-the back solution is
-       y"\b\e9n\e8 = r\e9n\e8/d\e9n\e8
-
-       y"\b\e9i\e8 = (r\e9i\e8-h\e9i+1\e8y"\b\e9i+1\e8)/d\e9i\e8   1<\b_i<n
-
-superficially, d\e9i\e8 and r\e9i\e8 don't have to be stored for they can be
-recalculated backward by the formulas
-
-       d\e9i-1\e8 = h\e9i\e8\b\e82\e9/(a\e9i\e8-d\e9i\e8) 1<i<\b_n
-
-       r\e9i-1\e8 = (b\e9i\e8-r\e9i\e8)d\e9i-1\e8/h\e9i\e8       1<i<\b_n
-
-unhappily it turns out that the recursion forward for d
-is quite strongly geometrically convergent--and is wildly
-unstable going backward.
-There's similar trouble with r, so the intermediate
-results must be kept.
-
-Note that n-1 in the program below plays the role of n+1 in the theory
-
-Other boundary conditions\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b_________________________
-
-The boundary conditions are easily generalized to handle
-
-       y\e90\e8\b" = ky\e91\e8\b", y\e9n+1\e8\b\b\b"   = ky\e9n\e8\b"
-
-for some constant k.  The above analysis was for k = 0;
-k = 1 fits parabolas perfectly as well as stright lines;
-k = 1/2 has been recommended as somehow pleasant.
-
-All that is necessary is to add h\e91\e8 to a\e91\e8 and h\e9n+1\e8 to a\e9n\e8.
-
-
-Periodic case\b\b\b\b\b\b\b\b\b\b\b\b\b_____________
-
-To do this, add 1 more row and column thus
-
-       | a\e91\e8 h\e92\e8            h\e91\e8 |  |y\e91\e8\b"|     |b\e91\e8|
-       | h\e92\e8 a\e92\e8 h\e93\e8            |  |y\e92\e8\b"|     |b\e92\e8|
-       |    h\e93\e8 a\e94\e8 h\e94\e8         |  |y\e93\e8\b"|     |b\e93\e8|
-       |                     |  | .|  =  | .|
-       |             .       |  | .|     | .|
-       | h\e91\e8            h\e90\e8 a\e90\e8 |  | .|     | .|
-
-where h\e90\e8=\b_ h\e9n+1\e8
-
-The same diagonalization procedure works, except for
-the effect of the 2 corner elements.  Let s\e9i\e8 be the part
-of the last element in the i\e8th\e9 "diagonalized" row that
-arises from the extra top corner element.
-
-               s\e91\e8 = h\e91\e8
-
-               s\e9i\e8 = -s\e9i-1\e8h\e9i\e8/d\e9i-1\e8       2<\b_i<\b_n+1
-
-After "diagonalizing", the lower corner element remains.
-Call t\e9i\e8 the bottom element that appears in the i\e8th\e9 colomn
-as the bottom element to its left is eliminated
-
-               t\e91\e8 = h\e91\e8
-
-               t\e9i\e8 = -t\e9i-1\e8h\e9i\e8/d\e9i-1\e8
-
-Evidently t\e9i\e8 = s\e9i\e8.
-Elimination along the bottom row
-introduces further corrections to the bottom right element
-and to the last element of the right hand side.
-Call these corrections u and v.
-
-       u\e91\e8 = v\e91\e8 = 0
-
-       u\e9i\e8 = u\e9i-1\e8-s\e9i-1\e8*t\e9i-1\e8/d\e9i-1\e8
-
-       v\e9i\e8 = v\e9i-1\e8-r\e9i-1\e8*t\e9i-1\e8/d\e9i-1\e8    2<\b_i<\b_n+1
-
-The back solution is now obtained as follows
-
-       y"\b\e9n+1\e8 = (r\e9n+1\e8+v\e9n+1\e8)/(d\e9n+1\e8+s\e9n+1\e8+t\e9n+1\e8+u\e9n+1\e8)
-
-       y"\b\e9i\e8 = (r\e9i\e8-h\e9i+1\e8*y\e9i+1\e8-s\e9i\e8*y\e9n+1\e8)/d\e9i\e8    1<\b_i<\b_n
-
-Interpolation in the interval x\e9i\e8<\b_x<\b_x\e9i+1\e8 is by the formula
-
-       y = y\e9i\e8x\e9+\e8 + y\e9i+1\e8x\e9-\e8 -(h\e82\e9\b\e9i+1\e8/6)[y"\b\e9i\e8(x\e9+\e8-x\e9+\e8\e8\b3\e9)+y"\b\e9i+1\e8(x\e9-\e8-x\e9-\e8\b\e83\e9)]
-where
-       x\e9+\e8 = x\e9i+1\e8-x
-
-       x\e9-\e8 = x-x\e9i\e8
-*/
-
-float
-rhs(i){
-       int i_;
-       double zz;
-       i_ = i==n-1?0:i;
-       zz = (y.val[i]-y.val[i-1])/(x.val[i]-x.val[i-1]);
-       return(6*((y.val[i_+1]-y.val[i_])/(x.val[i+1]-x.val[i]) - zz));
-}
-
-spline(){
-       float d,s,u,v,hi,hi1;
-       float h;
-       float D2yi,D2yi1,D2yn1,x0,x1,yy,a;
-       int end;
-       float corr;
-       int i,j,m;
-       if(n<3) return(0);
-       if(periodic) konst = 0;
-       d = 1;
-       r[0] = 0;
-       s = periodic?-1:0;
-       for(i=0;++i<n-!periodic;){      /* triangularize */
-               hi = x.val[i]-x.val[i-1];
-               hi1 = i==n-1?x.val[1]-x.val[0]:
-                       x.val[i+1]-x.val[i];
-               if(hi1*hi<=0) return(0);
-               u = i==1?zero:u-s*s/d;
-               v = i==1?zero:v-s*r[i-1]/d;
-               r[i] = rhs(i)-hi*r[i-1]/d;
-               s = -hi*s/d;
-               a = 2*(hi+hi1);
-               if(i==1) a += konst*hi;
-               if(i==n-2) a += konst*hi1;
-               diag[i] = d = i==1? a:
-                   a - hi*hi/d; 
-               }
-       D2yi = D2yn1 = 0;
-       for(i=n-!periodic;--i>=0;){     /* back substitute */
-               end = i==n-1;
-               hi1 = end?x.val[1]-x.val[0]:
-                       x.val[i+1]-x.val[i];
-               D2yi1 = D2yi;
-               if(i>0){
-                       hi = x.val[i]-x.val[i-1];
-                       corr = end?2*s+u:zero;
-                       D2yi = (r[i]-hi1*D2yi1-s*D2yn1+end*v)/
-                               (diag[i]+corr);
-                       if(end) D2yn1 = D2yi;
-                       if(i>1){
-                               a = 2*(hi+hi1);
-                               if(i==1) a += konst*hi;
-                               if(i==n-2) a += konst*hi1;
-                               d = diag[i-1];
-                               s = -s*d/hi; 
-                       }}
-               else D2yi = D2yn1;
-               if(!periodic) {
-                       if(i==0) D2yi = konst*D2yi1;
-                       if(i==n-2) D2yi1 = konst*D2yi;
-                       }
-               if(end) continue;
-               m = hi1>0?ni:-ni;
-               m = 1.001*m*hi1/(x.ub-x.lb);
-               if(m<=0) m = 1;
-               h = hi1/m;
-               for(j=m;j>0||i==0&&j==0;j--){   /* interpolate */
-                       x0 = (m-j)*h/hi1;
-                       x1 = j*h/hi1;
-                       yy = D2yi*(x0-x0*x0*x0)+D2yi1*(x1-x1*x1*x1);
-                       yy = y.val[i]*x0+y.val[i+1]*x1 -hi1*hi1*yy/6;
-                       printf("%f ",x.val[i]+j*h);
-                       printf("%f\n",yy);
-                       }
-               }
-       return(1);
-       }
-readin() {
-       for(n=0;n<NP;n++){
-               if(auta) x.val[n] = n*dx+x.lb;
-               else if(!getfloat(&x.val[n])) break;
-               if(!getfloat(&y.val[n])) break; } }
-
-getfloat(p)
-       float *p;{
-       char buf[30];
-       register c;
-       int i;
-       extern double atof();
-       for(;;){
-               c = getchar();
-               if (c==EOF) {
-                       *buf = '\0';
-                       return(0);
-               }
-               *buf = c;
-               switch(*buf){
-                       case ' ':
-                       case '\t':
-                       case '\n':
-                               continue;}
-               break;}
-       for(i=1;i<30;i++){
-               c = getchar();
-               if (c==EOF) {
-                       buf[i] = '\0';
-                       break;
-               }
-               buf[i] = c;
-               if('0'<=c && c<='9') continue;
-               switch(c) {
-                       case '.':
-                       case '+':
-                       case '-':
-                       case 'E':
-                       case 'e':
-                               continue;}
-               break; }
-       buf[i] = ' ';
-       *p = atof(buf);
-       return(1); }
-
-getlim(p)
-       struct proj *p; {
-       int i;
-       for(i=0;i<n;i++) {
-               if(!p->lbf && p->lb>(p->val[i])) p->lb = p->val[i];
-               if(!p->ubf && p->ub<(p->val[i])) p->ub = p->val[i]; }
-       }
-
-
-main(argc,argv)
-       char *argv[];{
-       extern char *malloc();
-       int i;
-       x.lbf = x.ubf = y.lbf = y.ubf = 0;
-       x.lb = INF;
-       x.ub = -INF;
-       y.lb = INF;
-       y.ub = -INF;
-       while(--argc > 0) {
-               argv++;
-again:         switch(argv[0][0]) {
-               case '-':
-                       argv[0]++;
-                       goto again;
-               case 'a':
-                       auta = 1;
-                       numb(&dx,&argc,&argv);
-                       break;
-               case 'k':
-                       numb(&konst,&argc,&argv);
-                       break;
-               case 'n':
-                       numb(&ni,&argc,&argv);
-                       break;
-               case 'p':
-                       periodic = 1;
-                       break;
-               case 'x':
-                       if(!numb(&x.lb,&argc,&argv)) break;
-                       x.lbf = 1;
-                       if(!numb(&x.ub,&argc,&argv)) break;
-                       x.ubf = 1;
-                       break;
-               default:
-                       fprintf(stderr, "Bad agrument\n");
-                       exit(1);
-               }
-       }
-       if(auta&&!x.lbf) x.lb = 0;
-       readin();
-       getlim(&x);
-       getlim(&y);
-       i = (n+1)*sizeof(dx);
-       diag = (float *)malloc((unsigned)i);
-       r = (float *)malloc((unsigned)i);
-       if(r==NULL||!spline()) for(i=0;i<n;i++){
-               printf("%f ",x.val[i]);
-               printf("%f\n",y.val[i]); }
-}
-numb(np,argcp,argvp)
-       int *argcp;
-       float *np;
-       char ***argvp;{
-       double atof();
-       char c;
-       if(*argcp<=1) return(0);
-       c = (*argvp)[1][0];
-       if(!('0'<=c&&c<='9' || c=='-' || c== '.' )) return(0);
-       *np = atof((*argvp)[1]);
-       (*argcp)--;
-       (*argvp)++; 
-       return(1); }
-
diff --git a/.ref-Research-V7/usr/src/cmd/split.c b/.ref-Research-V7/usr/src/cmd/split.c
deleted file mode 100644 (file)
index 9493952..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <stdio.h>
-
-unsigned count = 1000;
-int    fnumber;
-char   fname[100];
-char   *ifil;
-char   *ofil;
-FILE   *is;
-FILE   *os;
-
-main(argc, argv)
-char *argv[];
-{
-       register i, c, f;
-       int iflg = 0;
-
-       for(i=1; i<argc; i++)
-               if(argv[i][0] == '-')
-                       switch(argv[i][1]) {
-               
-                       case '\0':
-                               iflg = 1;
-                               continue;
-               
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                       case '8':
-                       case '9':
-                               count = atoi(argv[i]+1);
-                               continue;
-                       }
-               else if(iflg)
-                       ofil = argv[i];
-               else {
-                       ifil = argv[i];
-                       iflg = 2;
-               }
-       if(iflg != 2)
-               is = stdin;
-       else
-               if((is=fopen(ifil,"r")) == NULL) {
-                       fprintf(stderr,"cannot open input\n");
-                       exit(1);
-               }
-       if(ofil == 0)
-               ofil = "x";
-
-loop:
-       f = 1;
-       for(i=0; i<count; i++)
-       do {
-               c = getc(is);
-               if(c == EOF) {
-                       if(f == 0)
-                               fclose(os);
-                       exit(0);
-               }
-               if(f) {
-                       for(f=0; ofil[f]; f++)
-                               fname[f] = ofil[f];
-                       fname[f++] = fnumber/26 + 'a';
-                       fname[f++] = fnumber%26 + 'a';
-                       fname[f] = '\0';
-                       fnumber++;
-                       if((os=fopen(fname,"w")) == NULL) {
-                               fprintf(stderr,"Cannot create output\n");
-                               exit(1);
-                       }
-                       f = 0;
-               }
-               putc(c, os);
-       } while(c != '\n');
-       fclose(os);
-       goto loop;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/M.s b/.ref-Research-V7/usr/src/cmd/standalone/M.s
deleted file mode 100644 (file)
index d96690b..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/ Startup code for two-stage bootstrap
-
-/ non-UNIX instructions
-mfpi   = 6500^tst
-stst   = 170300^tst
-mtpi   = 6600^tst
-mfpd   = 106500^tst
-mtpd   = 106600^tst
-spl    = 230
-ldfps  = 170100^tst
-stfps  = 170200^tst
-wait   = 1
-rtt    = 6
-halt   = 0
-reset  = 5
-trap   = 104400
-
-.globl _end
-.globl _main
-start:
-       reset
-       mov     $340,PS
-       mov     $140100,sp
-
-/ set kernel I+D to physical 0 and IO page
-       clr     r1
-       mov     $77406,r2
-       mov     $KISA0,r3
-       mov     $KISD0,r4
-       jsr     pc,setseg
-       mov     $IO,-(r3)
-       clr     r1
-       mov     $KDSA0,r3
-       mov     $KDSD0,r4
-       jsr     pc,setseg
-       mov     $IO,-(r3)
-
-/ set user I+D to physical 64K (words) and IO page
-       mov     $4000,r1
-       mov     $UISA0,r3
-       mov     $UISD0,r4
-       jsr     pc,setseg
-       mov     $IO,-(r3)
-       mov     $4000,r1
-       mov     $UDSA0,r3
-       mov     $UDSD0,r4
-       jsr     pc,setseg
-       mov     $IO,-(r3)
-
-/ enable map
-       mov     $65,SSR3        / 22-bit map
-       bit     $20,SSR3
-       beq     1f
-       mov     $3,MSCR
-1:
-       mov     $30340,PS
-       inc     SSR0
-
-
-/ copy program to user I space
-       mov     $_end,r0
-       asr     r0
-       clr     r1
-1:
-       mov     (r1),-(sp)
-       mtpi    (r1)+
-       sob     r0,1b
-
-
-/ continue execution in user space copy
-       mov     $140004,sp
-       clr     *$KDSA6
-       mov     $140340,-(sp)
-       mov     $user,-(sp)
-       rtt
-user:
-       mov     $_end+512.,sp
-       mov     sp,r5
-
-       jsr     pc,_main
-
-       trap
-
-       br      user
-
-setseg:
-       mov     $8,r0
-1:
-       mov     r1,(r3)+
-       add     $200,r1
-       mov     r2,(r4)+
-       sob     r0,1b
-       rts     pc
-
-.globl _setseg
-_setseg:
-       mov     2(sp),r1
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     r4,-(sp)
-       mov     $77406,r2
-       mov     $KISA0,r3
-       mov     $KISD0,r4
-       jsr     pc,setseg
-       mov     (sp)+,r4
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       rts     pc
-
-/ clrseg(addr,count)
-.globl _clrseg
-_clrseg:
-       mov     4(sp),r0
-       beq     2f
-       asr     r0
-       bic     $!77777,r0
-       mov     2(sp),r1
-1:
-       clr     -(sp)
-       mtpi    (r1)+
-       sob     r0,1b
-2:
-       rts     pc
-
-
-/ mtpi(word,addr)
-.globl _mtpi
-_mtpi:
-       mov     4(sp),r0
-       mov     2(sp),-(sp)
-       mtpi    (r0)+
-       rts     pc
-
-.globl __rtt
-__rtt:
-       halt
-
-PS     = 177776
-SSR0   = 177572
-SSR1   = 177574
-SSR2   = 177576
-SSR3   = 172516
-KISA0  = 172340
-KISA1  = 172342
-KISA7  = 172356
-KISD0  = 172300
-KISD7  = 172316
-KDSA0  = 172360
-KDSA6  = 172374
-KDSA7  = 172376
-KDSD0  = 172320
-KDSD5  = 172332
-SISA0  = 172240
-SISA1  = 172242
-SISD0  = 172200
-SISD1  = 172202
-UISA0  = 177640
-UISD0  = 177600
-UDSA0  = 177660
-UDSD0  = 177620
-MSCR   = 017777746     / 11/70 memory control register
-IO     = 177600
-SWR    = 177570
-
-.data
-
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/SYS.c b/.ref-Research-V7/usr/src/cmd/standalone/SYS.c
deleted file mode 100644 (file)
index b87e766..0000000
+++ /dev/null
@@ -1,474 +0,0 @@
-#include <sys/param.h>
-#include <sys/ino.h>
-#include <sys/inode.h>
-#include <sys/filsys.h>
-#include <sys/dir.h>
-#include "saio.h"
-
-int    segflag = 0;
-
-
-static
-openi(n,io)
-register struct iob *io;
-{
-       register struct dinode *dp;
-
-       io->i_offset = 0;
-       io->i_bn = (daddr_t)((n+15)/INOPB) + io->i_boff;
-       io->i_cc = 512;
-       io->i_ma = io->i_buf;
-       devread(io);
-
-       dp = io->i_buf;
-       dp = &dp[(n-1)%INOPB];
-       io->i_ino.i_number = n;
-       io->i_ino.i_mode = dp->di_mode;
-       io->i_ino.i_size = dp->di_size;
-       l3tol((char *)io->i_ino.i_un.i_addr,(char *)dp->di_addr,NADDR);
-}
-
-
-static
-find(path, file)
-register char *path;
-struct iob *file;
-{
-       register char *q;
-       char c;
-       int n;
-
-       if (path==NULL || *path=='\0') {
-               printf("null path\n");
-               return(0);
-       }
-
-       openi((ino_t) 2, file);
-       while (*path) {
-               while (*path == '/')
-                       path++;
-               q = path;
-               while(*q != '/' && *q != '\0')
-                       q++;
-               c = *q;
-               *q = '\0';
-
-               if ((n=dlook(path, file))!=0) {
-                       if (c=='\0')
-                               break;
-                       openi(n, file);
-                       *q = c;
-                       path = q;
-                       continue;
-               } else {
-                       printf("%s not found\n",path);
-                       return(0);
-               }
-       }
-       return(n);
-}
-
-
-static daddr_t
-sbmap(io, bn)
-register struct iob *io;
-daddr_t bn;
-{
-       register i;
-       register struct inode *ip;
-       int j, sh;
-       daddr_t nb, *bap;
-
-       ip = &io->i_ino;;
-       if(bn < 0) {
-               printf("bn negative\n");
-               return((daddr_t)0);
-       }
-
-       /*
-        * blocks 0..NADDR-4 are direct blocks
-        */
-       if(bn < NADDR-3) {
-               i = bn;
-               nb = ip->i_un.i_addr[i];
-               return(nb);
-       }
-
-       /*
-        * addresses NADDR-3, NADDR-2, and NADDR-1
-        * have single, double, triple indirect blocks.
-        * the first step is to determine
-        * how many levels of indirection.
-        */
-       sh = 0;
-       nb = 1;
-       bn -= NADDR-3;
-       for(j=3; j>0; j--) {
-               sh += NSHIFT;
-               nb <<= NSHIFT;
-               if(bn < nb)
-                       break;
-               bn -= nb;
-       }
-       if(j == 0) {
-               printf("bn ovf %D\n",bn);
-               return((daddr_t)0);
-       }
-
-       /*
-        * fetch the address from the inode
-        */
-       nb = ip->i_un.i_addr[NADDR-j];
-       if(nb == 0) {
-               printf("bn void %D\n",bn);
-               return((daddr_t)0);
-       }
-
-       /*
-        * fetch through the indirect blocks
-        */
-       for(; j<=3; j++) {
-               if (blknos[j] != nb) {
-                       io->i_bn = nb + io->i_boff;
-                       io->i_ma = b[j];
-                       io->i_cc = 512;
-                       devread(io);
-                       blknos[j] = nb;
-               }
-               bap = b[j];
-               sh -= NSHIFT;
-               i = (bn>>sh) & NMASK;
-               nb = bap[i];
-               if(nb == 0) {
-                       printf("bn void %D\n",bn);
-                       return((daddr_t)0);
-               }
-       }
-
-       return(nb);
-}
-
-static ino_t
-dlook(s, io)
-char *s;
-register struct iob *io;
-{
-       register struct direct *dp;
-       register struct inode *ip;
-       daddr_t bn;
-       int n,dc;
-
-       if (s==NULL || *s=='\0')
-               return(0);
-       ip = &io->i_ino;
-       if ((ip->i_mode&IFMT)!=IFDIR) {
-               printf("not a directory\n");
-               return(0);
-       }
-
-       n = ip->i_size/sizeof(struct direct);
-
-       if (n==0) {
-               printf("zero length directory\n");
-               return(0);
-       }
-
-       dc = 512;
-       bn = (daddr_t)0;
-       while(n--) {
-               if (++dc >= 512/sizeof(struct direct)) {
-                       io->i_bn = sbmap(io, bn++) + io->i_boff;
-                       io->i_ma = io->i_buf;
-                       io->i_cc = 512;
-                       devread(io);
-                       dp = io->i_buf;
-                       dc = 0;
-               }
-
-               if (match(s, dp->d_name))
-                       return(dp->d_ino);
-               dp++;
-       }
-       return(0);
-}
-
-static
-match(s1,s2)
-register char *s1,*s2;
-{
-       register cc;
-
-       cc = DIRSIZ;
-       while (cc--) {
-               if (*s1 != *s2)
-                       return(0);
-               if (*s1++ && *s2++)
-                       continue; else
-                       return(1);
-       }
-       return(1);
-}
-
-lseek(fdesc, addr, ptr)
-int    fdesc;
-off_t  addr;
-int    ptr;
-{
-       register struct iob *io;
-
-       if (ptr != 0) {
-               printf("Seek not from beginning of file\n");
-               return(-1);
-       }
-       fdesc -= 3;
-       if (fdesc < 0 || fdesc >= NFILES || ((io = &iob[fdesc])->i_flgs&F_ALLOC) == 0)
-               return(-1);
-       io->i_offset = addr;
-       io->i_bn = addr/512 + io->i_boff;
-       io->i_cc = 0;
-       return(0);
-}
-
-getc(fdesc)
-int    fdesc;
-{
-       register struct iob *io;
-       register char *p;
-       register  c;
-       int off;
-
-
-       if (fdesc >= 0 && fdesc <= 2)
-               return(getchar());
-       fdesc -= 3;
-       if (fdesc < 0 || fdesc >= NFILES || ((io = &iob[fdesc])->i_flgs&F_ALLOC) == 0)
-               return(-1);
-       p = io->i_ma;
-       if (io->i_cc <= 0) {
-               io->i_bn = io->i_offset/(off_t)512;
-               if (io->i_flgs&F_FILE)
-                       io->i_bn = sbmap(io, io->i_bn) + io->i_boff;
-               io->i_ma = io->i_buf;
-               io->i_cc = 512;
-               devread(io);
-               if (io->i_flgs&F_FILE) {
-                       off = io->i_offset % (off_t)512;
-                       if (io->i_offset+(512-off) >= io->i_ino.i_size)
-                               io->i_cc = io->i_ino.i_size - io->i_offset + off;
-                       io->i_cc -= off;
-                       if (io->i_cc <= 0)
-                               return(-1);
-               } else
-                       off = 0;
-               p = &io->i_buf[off];
-       }
-       io->i_cc--;
-       io->i_offset++;
-       c = (unsigned)*p++;
-       io->i_ma = p;
-       return(c);
-}
-getw(fdesc)
-int    fdesc;
-{
-       register w,i;
-       register char *cp;
-       int val;
-
-       for (i = 0, val = 0, cp = &val; i < sizeof(val); i++) {
-               w = getc(fdesc);
-               if (w < 0) {
-                       if (i == 0)
-                               return(-1);
-                       else
-                               return(val);
-               }
-               *cp++ = w;
-       }
-       return(val);
-}
-
-read(fdesc, buf, count)
-int    fdesc;
-char   *buf;
-int    count;
-{
-       register i;
-       register struct iob *file;
-
-       if (fdesc >= 0 & fdesc <= 2) {
-               i = count;
-               do {
-                       *buf = getchar();
-               } while (--i && *buf++ != '\n');
-               return(count - i);
-       }
-       fdesc -= 3;
-       if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0)
-               return(-1);
-       if ((file->i_flgs&F_READ) == 0)
-               return(-1);
-       if ((file->i_flgs&F_FILE) == 0) {
-               file->i_cc = count;
-               file->i_ma = buf;
-               i = devread(file);
-               file->i_bn++;
-               return(i);
-       }
-       else {
-               if (file->i_offset+count > file->i_ino.i_size)
-                       count = file->i_ino.i_size - file->i_offset;
-               if ((i = count) <= 0)
-                       return(0);
-               do {
-                       *buf++ = getc(fdesc+3);
-               } while (--i);
-               return(count);
-       }
-}
-
-write(fdesc, buf, count)
-int    fdesc;
-char   *buf;
-int    count;
-{
-       register i;
-       register struct iob *file;
-
-       if (fdesc >= 0 && fdesc <= 2) {
-               i = count;
-               while (i--)
-                       putchar(*buf++);
-               return(count);
-       }
-       fdesc -= 3;
-       if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0)
-               return(-1);
-       if ((file->i_flgs&F_WRITE) == 0)
-               return(-1);
-       file->i_cc = count;
-       file->i_ma = buf;
-       i = devwrite(file);
-       file->i_bn++;
-       return(i);
-}
-
-open(str, how)
-char *str;
-int    how;
-{
-       register char *cp;
-       int i;
-       register struct iob *file;
-       register struct devsw *dp;
-       int     fdesc;
-       static first = 1;
-       long    atol();
-
-       if (first) {
-               for (i = 0; i < NFILES; i++)
-                       iob[i].i_flgs = 0;
-               first = 0;
-       }
-
-       for (fdesc = 0; fdesc < NFILES; fdesc++)
-               if (iob[fdesc].i_flgs == 0)
-                       goto gotfile;
-       _stop("No more file slots");
-gotfile:
-       (file = &iob[fdesc])->i_flgs |= F_ALLOC;
-
-       for (cp = str; *cp && *cp != '('; cp++)
-                       ;
-       if (*cp != '(') {
-               printf("Bad device\n");
-               file->i_flgs = 0;
-               return(-1);
-       }
-       *cp++ = '\0';
-       for (dp = devsw; dp->dv_name; dp++) {
-               if (match(str, dp->dv_name))
-                       goto gotdev;
-       }
-       printf("Unknown device\n");
-       file->i_flgs = 0;
-       return(-1);
-gotdev:
-       *(cp-1) = '(';
-       file->i_ino.i_dev = dp-devsw;
-       file->i_unit = *cp++ - '0';
-       if (file->i_unit < 0 || file->i_unit > 7) {
-               printf("Bad unit specifier\n");
-               file->i_flgs = 0;
-               return(-1);
-       }
-       if (*cp++ != ',') {
-badoff:
-               printf("Missing offset specification\n");
-               file->i_flgs = 0;
-               return(-1);
-       }
-       file->i_boff = atol(cp);
-       for (;;) {
-               if (*cp == ')')
-                       break;
-               if (*cp++)
-                       continue;
-               goto badoff;
-       }
-       devopen(file);
-       if (*++cp == '\0') {
-               file->i_flgs |= how+1;
-               file->i_cc = 0;
-               file->i_offset = 0;
-               return(fdesc+3);
-       }
-       if ((i = find(cp, file)) == 0) {
-               file->i_flgs = 0;
-               return(-1);
-       }
-       if (how != 0) {
-               printf("Can't write files yet.. Sorry\n");
-               file->i_flgs = 0;
-               return(-1);
-       }
-       openi(i, file);
-       file->i_offset = 0;
-       file->i_cc = 0;
-       file->i_flgs |= F_FILE | (how+1);
-       return(fdesc+3);
-}
-
-close(fdesc)
-int    fdesc;
-{
-       struct iob *file;
-
-       fdesc -= 3;
-       if (fdesc < 0 || fdesc >= NFILES || ((file = &iob[fdesc])->i_flgs&F_ALLOC) == 0)
-               return(-1);
-       if ((file->i_flgs&F_FILE) == 0)
-               devclose(file);
-       file->i_flgs = 0;
-       return(0);
-}
-
-exit()
-{
-       _stop("Exit called");
-}
-
-_stop(s)
-char   *s;
-{
-       printf("%s\n", s);
-       _rtt();
-}
-
-trap(ps)
-int ps;
-{
-       printf("Trap %o\n", ps);
-       for (;;)
-               ;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/boot.c b/.ref-Research-V7/usr/src/cmd/standalone/boot.c
deleted file mode 100644 (file)
index 18465d0..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <sys/param.h>
-#include <sys/ino.h>
-#include <sys/inode.h>
-#include <sys/filsys.h>
-#include <sys/dir.h>
-#include <saio.h>
-
-
-char line[100];
-
-main()
-{
-int i;
-       segflag = 2;
-
-
-       printf("Boot\n");
-       do {
-               printf(": "); gets(line);
-               i = open(line,0);
-       } while (i < 0);
-
-
-       copyunix(i);
-
-}
-
-
-copyunix(io)
-register io;
-{
-register addr,s;
-long phys;
-unsigned       txtsiz,datsiz,bsssiz;
-int    magic;
-
-
-       lseek(io, (off_t)0, 0);
-       magic = getw(io);
-       txtsiz = getw(io);
-       datsiz = getw(io);
-       bsssiz = getw(io);
-
-
-       switch (magic) {
-       case 0411:
-               setseg(0);
-               lseek(io, (long)(020+txtsiz), 0);
-
-               for(addr=0; addr!=datsiz; addr+=2)  {
-                       mtpi(getw(io),addr);
-               }
-
-               clrseg(addr,bsssiz);
-
-               phys = (long)datsiz + (long)bsssiz + 63L;
-               phys =/ 64;
-               setseg((int)phys);
-
-               lseek(io, 020L, 0);
-
-               for(addr=0; addr!=txtsiz; addr+=2) {
-                       mtpi(getw(io),addr);
-               }
-               return;
-       case 0407:
-               setseg(0);
-               /*
-                * space over the header. We do this instead of seeking
-                * because the input might be a tape which doesn't know 
-                * how to seek.
-                */
-               getw(io); getw(io); getw(io); getw(io);
-               phys = txtsiz+datsiz;
-               for (addr = 0; addr != phys; addr += 2)
-                       mtpi(getw(io),addr);
-               clrseg(addr, bsssiz);
-               return;
-       default:
-               printf("Can't load %o files\n", magic);
-               exit(1);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/cat.c b/.ref-Research-V7/usr/src/cmd/standalone/cat.c
deleted file mode 100644 (file)
index cf69e62..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-main()
-{
-       int c, i;
-       char buf[50];
-
-       do {
-               printf("File: ");
-               gets(buf);
-               i = open(buf, 0);
-       } while (i <= 0);
-
-       while ((c = getc(i)) > 0)
-               putchar(c);
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/cc+ld-stand b/.ref-Research-V7/usr/src/cmd/standalone/cc+ld-stand
deleted file mode 100755 (executable)
index 2e71701..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-cc -c -O -DSTANDALONE ../$1.c
-ld -s -o $1 srt0.o $1.o -lsa -lc
-rm $1.o
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/conf.c b/.ref-Research-V7/usr/src/cmd/standalone/conf.c
deleted file mode 100644 (file)
index 1d180dc..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <sys/param.h>
-#include <sys/inode.h>
-#include "saio.h"
-
-devread(io)
-register struct iob *io;
-{
-
-       return( (*devsw[io->i_ino.i_dev].dv_strategy)(io,READ) );
-}
-
-devwrite(io)
-register struct iob *io;
-{
-       return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) );
-}
-
-devopen(io)
-register struct iob *io;
-{
-       (*devsw[io->i_ino.i_dev].dv_open)(io);
-}
-
-devclose(io)
-register struct iob *io;
-{
-       (*devsw[io->i_ino.i_dev].dv_close)(io);
-}
-
-nullsys()
-{ ; }
-
-int rpstrategy();
-int rkstrategy();
-int    nullsys();
-int    tmstrategy(), tmrew(), tmopen();
-int    htstrategy(), htopen(),htclose();
-int    hpstrategy();
-struct devsw devsw[] {
-       "rp",   rpstrategy,     nullsys,        nullsys,
-       "hp",   hpstrategy,     nullsys,        nullsys,
-       "rk",   rkstrategy,     nullsys,        nullsys,
-       "tm",   tmstrategy,     tmopen,         tmrew,
-       "ht",   htstrategy,     htopen,         htclose,
-       0,0,0,0
-};
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/contents b/.ref-Research-V7/usr/src/cmd/standalone/contents
deleted file mode 100644 (file)
index 9a1b305..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-File 1:
-       2 copies of magtape bootstrap (2 blocks total)
-       The standalone bootstrap
-File 2:
-       A file to console copy program
-File 3:
-       This file
-File 4:
-       The program mkfs
-File 5:
-       The program restor
-File 6:
-       A dump of rp0
-File 7:
-       A dump of rp3
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/cpgroup b/.ref-Research-V7/usr/src/cmd/standalone/cpgroup
deleted file mode 100755 (executable)
index 97ed6ff..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/etc/mkfs /dev/rrk2 4000
-/etc/mount /dev/rk2 /x
-dir=$1
-shift
-cd /x
-(cd $dir; tar cf - $*) | tar xf -
-cd /
-/etc/umount /dev/rk2
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/hp.c b/.ref-Research-V7/usr/src/cmd/standalone/hp.c
deleted file mode 100644 (file)
index 67aefa6..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * RP04/RP06 disk driver
- */
-
-#include <sys/param.h>
-#include <sys/inode.h>
-#include "saio.h"
-
-struct device
-{
-       union {
-               int     w;
-               char    c[2];
-       } hpcs1;                /* Control and Status register 1 */
-       int     hpwc;           /* Word count register */
-       caddr_t hpba;           /* UNIBUS address register */
-       int     hpda;           /* Desired address register */
-       union {
-               int     w;
-               char    c[2];
-       } hpcs2;                /* Control and Status register 2*/
-       int     hpds;           /* Drive Status */
-       int     hper1;          /* Error register 1 */
-       int     hpas;           /* Attention Summary */
-       int     hpla;           /* Look ahead */
-       int     hpdb;           /* Data buffer */
-       int     hpmr;           /* Maintenance register */
-       int     hpdt;           /* Drive type */
-       int     hpsn;           /* Serial number */
-       int     hpof;           /* Offset register */
-       int     hpdc;           /* Desired Cylinder address register*/
-       int     hpcc;           /* Current Cylinder */
-       int     hper2;          /* Error register 2 */
-       int     hper3;          /* Error register 3 */
-       int     hpec1;          /* Burst error bit position */
-       int     hpec2;          /* Burst error bit pattern */
-       int     hpbae;          /* 11/70 bus extension */
-       int     hpcs3;
-};
-
-#define        HPADDR  ((struct device *)0176700)
-#define        NSECT   22
-#define        NTRAC   19
-#define        SDIST   2
-#define        RDIST   6
-
-#define        P400    020
-#define        M400    0220
-#define        P800    040
-#define        M800    0240
-#define        P1200   060
-#define        M1200   0260
-
-#define        GO      01
-#define        PRESET  020
-#define        RTC     016
-#define        OFFSET  014
-#define        SEARCH  030
-#define        RECAL   06
-#define DCLR   010
-#define        WCOM    060
-#define        RCOM    070
-
-#define        IE      0100
-#define        PIP     020000
-#define        DRY     0200
-#define        ERR     040000
-#define        TRE     040000
-#define        DCK     0100000
-#define        WLE     04000
-#define        ECH     0100
-#define VV     0100
-#define FMT22  010000
-
-hpstrategy(io, func)
-register struct iob *io;
-{
-       register unit;
-       register i;
-       daddr_t bn;
-       int sn, cn, tn;
-
-       if (((unit = io->i_unit) & 04) == 0)
-               bn = io->i_bn;
-       else {
-               unit &= 03;
-               bn = io->i_bn;
-               bn -= io->i_boff;
-               i = unit + 1;
-               unit = bn%i;
-               bn /= i;
-               bn += io->i_boff;
-       }
-
-       HPADDR->hpcs2.w = unit;
-
-       if((HPADDR->hpds & VV) == 0) {
-               HPADDR->hpcs1.c[0] = PRESET|GO;
-               HPADDR->hpof = FMT22;
-       }
-       cn = bn/(NSECT*NTRAC);
-       sn = bn%(NSECT*NTRAC);
-       tn = sn/NSECT;
-       sn = sn%NSECT;
-
-       HPADDR->hpdc = cn;
-       HPADDR->hpda = (tn << 8) + sn;
-       HPADDR->hpba = io->i_ma;
-       HPADDR->hpwc = -(io->i_cc>>1);
-       unit = (segflag << 8) | GO;
-       if (func == READ)
-               unit |= RCOM;
-       else if (func == WRITE)
-               unit |= WCOM;
-       HPADDR->hpcs1.w = unit;
-       while ((HPADDR->hpcs1.w&DRY) == 0)
-                       ;
-       if (HPADDR->hpcs1.w & TRE) {
-               printf("disk error: cyl=%d track=%d sect=%d cs2=%o, er1=%o\n",
-                   cn, tn, sn, HPADDR->hpcs2, HPADDR->hper1);
-               return(-1);
-       }
-       return(io->i_cc);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/ht.c b/.ref-Research-V7/usr/src/cmd/standalone/ht.c
deleted file mode 100644 (file)
index 2fe9592..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * TJU16 tape driver
- */
-
-#include <sys/param.h>
-#include <sys/inode.h>
-#include "saio.h"
-
-struct device
-{
-       int     htcs1;
-       int     htwc;
-       caddr_t htba;
-       int     htfc;
-       int     htcs2;
-       int     htds;
-       int     hter;
-       int     htas;
-       int     htck;
-       int     htdb;
-       int     htmr;
-       int     htdt;
-       int     htsn;
-       int     httc;
-       int     htbae;  /* 11/70 bus extension */
-       int     htcs3;
-};
-
-
-
-#define        HTADDR  ((struct device *)0172440)
-
-#define        GO      01
-#define        WCOM    060
-#define        RCOM    070
-#define        NOP     0
-#define        WEOF    026
-#define        SFORW   030
-#define        SREV    032
-#define        ERASE   024
-#define        REW     06
-#define        DCLR    010
-#define CLR    040
-#define P800   01300           /* 800 + pdp11 mode */
-#define        P1600   02300           /* 1600 + pdp11 mode */
-#define        IENABLE 0100
-#define        RDY     0200
-#define        TM      04
-#define        DRY     0200
-#define EOT    02000
-#define CS     02000
-#define COR    0100000
-#define PES    040
-#define WRL    04000
-#define MOL    010000
-#define PIP    020000
-#define ERR    040000
-#define FCE    01000
-#define        TRE     040000
-#define HARD   064023  /* UNS|OPI|NEF|FMT|RMR|ILR|ILF */
-
-#define        SIO     1
-#define        SSFOR   2
-#define        SSREV   3
-#define SRETRY 4
-#define SCOM   5
-#define SOK    6
-
-htopen(io)
-register struct iob *io;
-{
-       register skip;
-int i;
-
-       htstrategy(io, REW);
-       skip = io->i_boff;
-       while (skip--) {
-               io->i_cc = -1;
-               while (htstrategy(io, SFORW))
-                       ;
-               i = 0;
-               while (--i)
-                       ;
-               htstrategy(io, NOP);
-       }
-}
-
-htclose(io)
-register struct iob *io;
-{
-       htstrategy(io, REW);
-}
-
-htstrategy(io, func)
-register struct iob *io;
-{
-       register unit, den, errcnt;
-
-       unit = io->i_unit;
-       errcnt = 0;
-retry:
-       HTADDR->htcs2 = unit&03;
-       if(unit > 3)
-               den = P1600;
-       else
-               den = P800;
-       htquiet();
-       if((HTADDR->httc&03777) != den)
-               HTADDR->httc = den;
-       HTADDR->htba = io->i_ma;
-       HTADDR->htfc = -io->i_cc;
-       HTADDR->htwc = -(io->i_cc>>1);
-       den = ((segflag) << 8) | GO;
-       if (func == READ)
-               den =| RCOM;
-       else if (func == WRITE)
-               den =| WCOM;
-       else if (func == SREV) {
-               HTADDR->htfc = -1;
-               HTADDR->htcs1 = den | SREV;
-               return(0);
-       } else
-               den |= func;
-       HTADDR->htcs1 = den;
-       while ((HTADDR->htcs1&RDY) == 0)
-               ;
-       if (HTADDR->htds&TM) {
-               htinit();
-               return(0);
-       }
-       if (HTADDR->htcs1&TRE) {
-               if (errcnt == 0)
-                       printf("tape error: cs2=%o, er=%o",
-                           HTADDR->htcs2, HTADDR->hter);
-               htinit();
-               if (errcnt == 10) {
-                       printf("\n");
-                       return(-1);
-               }
-               errcnt++;
-               htstrategy(io, SREV);
-               goto retry;
-       }
-       if (errcnt)
-               printf(" recovered by retry\n");
-       return(io->i_cc+HTADDR->htfc);
-}
-
-htinit()
-{
-       int omt, ocs2;
-
-       omt = HTADDR->httc & 03777;
-       ocs2 = HTADDR->htcs2 & 07;
-
-       HTADDR->htcs2 = CLR;
-       HTADDR->htcs2 = ocs2;
-       HTADDR->httc = omt;
-       HTADDR->htcs1 = DCLR|GO;
-}
-
-htquiet()
-{
-       while ((HTADDR->htcs1&RDY) == 0)
-               ;
-       while (HTADDR->htds&PIP)
-               ;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/makefile b/.ref-Research-V7/usr/src/cmd/standalone/makefile
deleted file mode 100644 (file)
index 7f81b28..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-CFLAGS = -O
-
-all:   /usr/lib/libsa.a srt0.o restor cat icheck mkfs mtboot maketape boot
-
-cp cmp:
-       @echo "standalone stuff-- examine this makefile before running"
-
-xcp:   all
-       mkdir /stand
-       cp restor cat mkfs icheck /stand
-       rm restor cat mkfs icheck
-       cp boot /
-       rm boot
-       rm *.o
-
-/usr/lib/libsa.a:      SYS.o conf.o hp.o ht.o prf.o rk.o rp.o tm.o 
-       ar rv /usr/lib/libsa.a $?
-
-restor:        srt0.o
-       cc+ld-stand restor
-
-cat:   srt0.o
-       cc -c cat.c
-       ld -s -o cat srt0.o cat.o -lsa -lc
-       rm cat.o
-
-mkfs:  srt0.o
-       cc+ld-stand mkfs
-
-icheck:        srt0.o
-       cc+ld-stand icheck
-
-mtboot:        mtboot.s
-       as -o mtboot mtboot.s
-       strip mtboot
-
-maketape:      maketape.c
-       cc -o maketape maketape.c
-
-boot:  boot.o M.o
-       ld -s -o boot M.o boot.o -lsa -lc
-
-distr: restor cat mkfs boot mtboot maketape
-       maketape /dev/nrmt0 tapedir
-       dump 0f /dev/nrmt0 /dev/rp11
-       dump 0f /dev/rmt0 /dev/rp13
-
-rkdistr:       restor cat mkfs boot mtboot maketape
-       maketape /dev/nrmt0 rktapedir
-       mv /v7/rp*unix /v7/hp*unix /v7/usr
-       dump 0f /dev/nrmt0 /dev/rp11
-       mv /v7/usr/*unix /v7
-       cpgroup /v7/usr/src/cmd `cd /v7/usr/src/cmd; echo [a-m]*`
-       dump 0f /dev/nrmt0 /dev/rrk2
-       cpgroup /v7/usr/src/cmd `cd /v7/usr/src/cmd; echo [n-z]*`
-       dump 0f /dev/nrmt0 /dev/rrk2
-       cpgroup /v7/usr/src `cd /v7/usr/src/; echo [d-z]*`
-       dump 0f /dev/nrmt0 /dev/rrk2
-       cpgroup /v7/usr lib dmr games include mdec pub spool tmp
-       dump 0f /dev/nrmt0 /dev/rrk2
-       cpgroup /v7/usr doc
-       dump 0f /dev/nrmt0 /dev/rrk2
-       cpgroup /v7/usr dict sys man
-       dump 0f /dev/rmt0 /dev/rrk2
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/maketape.c b/.ref-Research-V7/usr/src/cmd/standalone/maketape.c
deleted file mode 100644 (file)
index 3edcb19..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#include <stdio.h>
-#define MAXB 30
-int mt;
-int fd;
-char   buf[MAXB*512];
-char   name[50];
-int    blksz;
-
-main(argc, argv)
-int    argc;
-char   *argv[];
-{
-       int i, j, k;
-       FILE *mf;
-
-       if (argc != 3) {
-               fprintf(stderr, "Usage: maketape tapedrive makefile\n");
-               exit(0);
-       }
-       if ((mt = creat(argv[1], 0666)) < 0) {
-               perror(argv[1]);
-               exit(1);
-       }
-       if ((mf = fopen(argv[2], "r")) == NULL) {
-               perror(argv[2]);
-               exit(2);
-       }
-
-       j = 0;
-       k = 0;
-       for (;;) {
-               if ((i = fscanf(mf, "%s %d", name, &blksz))== EOF)
-                       exit(0);
-               if (i != 2) {
-                       fprintf(stderr, "Help! Scanf didn't read 2 things (%d)\n", i);
-                       exit(1);
-               }
-               if (blksz <= 0 || blksz > MAXB) {
-                       fprintf(stderr, "Block size %d is invalid\n", blksz);
-                       continue;
-               }
-               if (strcmp(name, "*") == 0) {
-                       close(mt);
-                       mt = open(argv[1], 2);
-                       j = 0;
-                       k++;
-                       continue;
-               }
-               fd = open(name, 0);
-               if (fd < 0) {
-                       perror(name);
-                       continue;
-               }
-               printf("%s: block %d, file %d\n", name, j, k);
-               while (read(fd, buf, 512*blksz) > 0) {
-                       j++;
-                       write(mt, buf, 512*blksz);
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/mtboot.s b/.ref-Research-V7/usr/src/cmd/standalone/mtboot.s
deleted file mode 100644 (file)
index 73ba563..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/ tape boot program to load and transfer
-/ the next item on the tape.
-
-/ entry is made by jsr pc,*$0
-/ so return can be rts pc
-
-core = 24.
-halt=0
-.. = [core*2048.]-512.
-start:
-       mov     $..,sp
-       mov     sp,r1
-       cmp     pc,r1
-       bhis    2f
-       clr     r0
-       cmp     (r0),$407
-       bne     1f
-       mov     $20,r0
-1:
-       mov     (r0)+,(r1)+
-       cmp     r1,$core*2048.
-       blo     1b
-       jmp     (sp)
-
-2:
-       mov     $1f,*$4
-       mov     $340,*$6
-       tst     *$htcs1
-       mov     $htrew,rew
-       mov     $htread,tread
-       br      2f
-1:
-       mov     $tmread,tread
-       mov     $tmrew,rew
-2:
-       jsr     pc,*rew
-       mov     $2,tapa
-       mov     $-256.,wc
-       jsr     pc,*tread
-
-       mov     *$2,r0
-       add     *$4,r0
-       sub     $512.,r0
-       asr     r0
-       neg     r0
-       bge     1f
-
-       mov     r0,wc
-       mov     $3,tapa
-       mov     $512.,ba
-       jsr     pc,*tread
-1:
-       jsr     pc,*rew
-       clr     r0
-       mov     $20,r1
-       mov     sp,r4
-       clc
-       ror     r4
-1:
-       mov     (r1)+,(r0)+
-       sob     r4,1b
-       jsr     pc,*$0
-       br      .
-
-htcs1 = 172440
-htba  = 172444
-htfc  = 172446
-htcs2 = 172450
-htds  = 172452
-httc  = 172472
-
-P800 = 1300
-P1600 = 2300
-PIP = 20000
-RESET = 40
-MOL = 10000
-ERR = 40000
-REV = 33
-READ = 71
-REW = 7
-
-htread:
-1:
-       mov     ba,mtma
-       cmp     mtapa,tapa
-       beq     1f
-       bhi     2f
-       jsr     pc,hrrec
-       br      1b
-2:
-       jsr     pc,htrew
-       br      1b
-1:
-       mov     wc,r1
-1:
-       jsr     pc,hrrec
-       add     $256.,r1
-       bmi     1b
-       rts     pc
-
-hrrec:
-       mov     $htds,r0
-       tstb    (r0)
-       bpl     hrrec
-       bit     $PIP,(r0)
-       bne     hrrec
-       bit     $MOL,(r0)
-       beq     hrrec
-       mov     $htfc,r0
-       mov     $-512.,(r0)
-       mov     mtma,-(r0)
-       mov     $-256.,-(r0)
-       mov     $READ,-(r0)
-1:
-       tstb    (r0)
-       bpl     1b
-       bit     $ERR,(r0)
-       bpl     1f
-       mov     $RESET,*$htcs2
-       mov     $-1,*$htfc
-       mov     $REV,(r0)
-       br      hrrec
-1:
-       add     $512.,mtma
-       inc     mtapa
-       rts     pc
-
-htrew:
-       mov     $RESET,*$htcs2
-       mov     $P800,*$httc
-       mov     $REW,*$htcs1
-       clr     mtapa
-       rts     pc
-
-
-mts = 172520
-mtc = 172522
-mtbrc = 172524
-mtcma = 172526
-
-tmread:
-1:
-       mov     ba,mtma
-       cmp     mtapa,tapa
-       beq     1f
-       bhi     2f
-       jsr     pc,tmrrec
-       br      1b
-2:
-       jsr     pc,tmrew
-       br      1b
-1:
-       mov     wc,r1
-1:
-       jsr     pc,tmrrec
-       add     $256.,r1
-       bmi     1b
-       rts     pc
-
-tmrrec:
-       mov     $mts,r0
-       bit     $2,(r0)+                / rewind status
-       bne     tmrrec
-       tstb    (r0)+           / cu ready
-       bpl     tmrrec
-       inc     r0
-       mov     $-512.,(r0)+    / byte count
-       mov     mtma,(r0)       / bus address
-       mov     $mtc,r0
-       mov     $60003,(r0)             / read 800bpi
-1:
-       tstb    (r0)
-       bpl     1b
-       tst     (r0)+
-       bpl     1f
-       mov     $-1,(r0)
-       mov     $60013,-(r0)            / backspace
-       br      tmrrec
-1:
-       add     $512.,mtma
-       inc     mtapa
-       rts     pc
-
-tmrew:
-       mov     $60017,*$mtc
-       clr     mtapa
-       rts     pc
-
-mtapa: 0
-mtma:  0
-tapa:  0
-wc:    0
-ba:    0
-rew:   0
-tread: 0
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/prf.c b/.ref-Research-V7/usr/src/cmd/standalone/prf.c
deleted file mode 100644 (file)
index ab6ce27..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-
-/*
- * Scaled down version of C Library printf.
- * Only %s %u %d (==%u) %o %x %D are recognized.
- * Used to print diagnostic information
- * directly on console tty.
- * Since it is not interrupt driven,
- * all system activities are pretty much
- * suspended.
- * Printf should not be used for chit-chat.
- */
-printf(fmt, x1)
-register char *fmt;
-unsigned x1;
-{
-       register c;
-       register unsigned int *adx;
-       char *s;
-
-       adx = &x1;
-loop:
-       while((c = *fmt++) != '%') {
-               if(c == '\0')
-                       return;
-               putchar(c);
-       }
-       c = *fmt++;
-       if(c == 'd' || c == 'u' || c == 'o' || c == 'x')
-               printn((long)*adx, c=='o'? 8: (c=='x'? 16:10));
-       else if(c == 's') {
-               s = (char *)*adx;
-               while(c = *s++)
-                       putchar(c);
-       } else if (c == 'D') {
-               printn(*(long *)adx, 10);
-               adx += (sizeof(long) / sizeof(int)) - 1;
-       } else if (c == 'c')
-               putchar((char *)*adx);
-       adx++;
-       goto loop;
-}
-
-/*
- * Print an unsigned integer in base b.
- */
-printn(n, b)
-long n;
-{
-       register long a;
-
-       if (n<0) {      /* shouldn't happen */
-               putchar('-');
-               n = -n;
-       }
-       if(a = n/b)
-               printn(a, b);
-       putchar("0123456789ABCDEF"[(int)(n%b)]);
-}
-
-
-
-struct device  {
-       int     rcsr,rbuf;
-       int     tcsr,tbuf;
-};
-struct device  *KLADDR {0177560};
-putchar(c)
-register c;
-{
-       register s;
-       register unsigned timo;
-
-       /*
-        *  If last char was a break or null, don't print
-       if ((KLADDR->rbuf&0177) == 0)
-               return;
-       */
-       timo = 60000;
-       /*
-        * Try waiting for the console tty to come ready,
-        * otherwise give up after a reasonable time.
-        */
-       while((KLADDR->tcsr&0200) == 0)
-               if(--timo == 0)
-                       break;
-       if(c == 0)
-               return;
-       s = KLADDR->tcsr;
-       KLADDR->tcsr = 0;
-       KLADDR->tbuf = c;
-       if(c == '\n') {
-               putchar('\r');
-               putchar(0177);
-               putchar(0177);
-       }
-       putchar(0);
-       KLADDR->tcsr = s;
-}
-
-getchar()
-{
-       register c;
-
-       KLADDR->rcsr = 1;
-       while((KLADDR->rcsr&0200)==0);
-       c = KLADDR->rbuf&0177;
-       if (c=='\r')
-               c = '\n';
-       putchar(c);
-       return(c);
-}
-
-gets(buf)
-char   *buf;
-{
-register char *lp;
-register c;
-
-       lp = buf;
-       for (;;) {
-               c = getchar() & 0177;
-               if (c>='A' && c<='Z')
-                       c -= 'A' - 'a';
-               if (lp != buf && *(lp-1) == '\\') {
-                       lp--;
-                       if (c>='a' && c<='z') {
-                               c += 'A' - 'a';
-                               goto store;
-                       }
-                       switch ( c) {
-                       case '(':
-                               c = '{';
-                               break;
-                       case ')':
-                               c = '}';
-                               break;
-                       case '!':
-                               c = '|';
-                               break;
-                       case '^':
-                               c = '~';
-                               break;
-                       case '\'':
-                               c = '`';
-                               break;
-                       }
-               }
-       store:
-               switch(c) {
-               case '\n':
-               case '\r':
-                       c = '\n';
-                       *lp++ = '\0';
-                       return;
-               case '\b':
-               case '#':
-                       lp--;
-                       if (lp < buf)
-                               lp = buf;
-                       continue;
-               case '@':
-                       lp = buf;
-                       putchar('\n');
-                       continue;
-               default:
-                       *lp++ = c;
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/rk.c b/.ref-Research-V7/usr/src/cmd/standalone/rk.c
deleted file mode 100644 (file)
index e011c11..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * RK disk driver
- */
-
-#include <sys/param.h>
-#include <sys/inode.h>
-#include "saio.h"
-
-#define        RKADDR  ((struct device *)0177400)
-#define        NRK     4
-#define        NRKBLK  4872
-
-#define        RESET   0
-#define        WCOM    2
-#define        RCOM    4
-#define        GO      01
-#define        DRESET  014
-#define        IENABLE 0100
-#define        DRY     0200
-#define        ARDY    0100
-#define        WLO     020000
-#define        CTLRDY  0200
-
-struct device
-{
-       int     rkds;
-       int     rker;
-       int     rkcs;
-       int     rkwc;
-       caddr_t rkba;
-       int     rkda;
-};
-
-rkstrategy(io, func)
-register struct iob *io;
-{
-       register com;
-       daddr_t bn;
-       int dn, cn, sn;
-
-       bn = io->i_bn;
-       dn = io->i_unit;
-       cn = bn/12;
-       sn = bn%12;
-       RKADDR->rkda = (dn<<13) | (cn<<4) | sn;
-       RKADDR->rkba = io->i_ma;
-       RKADDR->rkwc = -(io->i_cc>>1);
-       com = (segflag<<4)|GO;
-       if (func == READ)
-               com |= RCOM; else
-               com |= WCOM;
-       RKADDR->rkcs = com;
-       while ((RKADDR->rkcs&CTLRDY) == 0)
-               ;
-       if (RKADDR->rkcs<0) {   /* error bit */
-               printf("disk error: cyl=%d, sector=%d, er=%o, ds=%o\n",
-                   cn, sn, RKADDR->rker, RKADDR->rkds);
-               return(-1);
-       }
-       return(io->i_cc);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/rkcontents b/.ref-Research-V7/usr/src/cmd/standalone/rkcontents
deleted file mode 100644 (file)
index bc96b4e..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-File 1:
-       2 copies of magtape bootstrap (2 blocks total)
-       The standalone bootstrap
-File 2:
-       A file to console copy program
-File 3:
-       This file
-File 4:
-       The program mkfs
-File 5:
-       The program restor
-File 6:
-       A dump of rk0
-File 7:
-       A dump of all commands that live in subdirectories
-       of /usr/src/cmd
-File 8:
-       A dump of the rest of /usr/src/cmd
-File 9:
-       A dump of the rest of /usr/src
-File 10:
-       A dump of /usr excepting src, doc, man, dict, and sys.
-File 11:
-       A dump of /usr/doc
-File 12:
-       A dump of /usr/man, /usr/dict, and /usr/sys.
-       /usr/sys/ is the system source.
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/rktapedir b/.ref-Research-V7/usr/src/cmd/standalone/rktapedir
deleted file mode 100644 (file)
index 7a9dc44..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-mtboot 1
-mtboot 1
-boot 1
-* 1
-cat 1
-* 1
-rkcontents 1
-* 1
-mkfs 1
-* 1
-restor 1
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/rp.c b/.ref-Research-V7/usr/src/cmd/standalone/rp.c
deleted file mode 100644 (file)
index d811a2b..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-/*
- * rp03 disk driver
- */
-
-#include <sys/param.h>
-#include <sys/inode.h>
-#include "saio.h"
-
-struct device {
-       int     rpds;
-       int     rper;
-       union {
-               int     w;
-               char    c;
-       } rpcs;
-       int     rpwc;
-       char    *rpba;
-       int     rpca;
-       int     rpda;
-};
-
-#define RPADDR ((struct device *) 0176710)
-
-#define        GO      01
-#define        DONE    0200
-#define        RESET   0
-#define        HSEEK   014
-
-#define        IENABLE 0100
-#define        READY   0200
-#define        RCOM    4
-#define        WCOM    2
-
-#define        SUFU    01000
-#define        SUSU    02000
-#define        SUSI    04000
-#define        HNF     010000
-
-
-
-rpstrategy(io, func)
-register struct iob *io;
-{
-       int com,cn,tn,sn;
-
-
-/*
-       dn = unit>>3;
-       bn = bp->b_blkno;
-       cn = bn/(20*10) + rp_sizes[unit&07].cyloff;
-*/
-       cn = io->i_bn/(20*10);
-       sn = io->i_bn%(20*10);
-       tn = sn/10;
-       sn = sn%10;
-       RPADDR->rpcs.w = (io->i_unit<<8);
-       RPADDR->rpda = (tn<<8) | sn;
-       RPADDR->rpca = cn;
-       RPADDR->rpba = io->i_ma;
-       RPADDR->rpwc = -(io->i_cc>>1);
-       com = (segflag<<4)|GO;
-       if (func == READ)
-               com |= RCOM; else
-               com |= WCOM;
-       
-       RPADDR->rpcs.w |= com;
-       while ((RPADDR->rpcs.w&DONE)==0)
-               ;
-       if (RPADDR->rpcs.w < 0) {       /* error bit */
-               printf("disk error: cyl=%d track=%d sect=%d er=%o ds=%o\n",
-                   cn, tn, sn, RPADDR->rper, RPADDR->rpds);
-               return(-1);
-       }
-       return(io->i_cc);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/saio.h b/.ref-Research-V7/usr/src/cmd/standalone/saio.h
deleted file mode 100644 (file)
index fc074fc..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * header file for standalone package
- */
-
-/*
- * io block: includes an
- * inode, cells for the use of seek, etc,
- * and a buffer.
- */
-struct iob {
-       char    i_flgs;
-       struct inode i_ino;
-       int i_unit;
-       daddr_t i_boff;
-       daddr_t i_cyloff;
-       off_t   i_offset;
-       daddr_t i_bn;
-       char    *i_ma;
-       int     i_cc;
-       char    i_buf[512];
-};
-
-#define F_READ 01
-#define F_WRITE        02
-#define F_ALLOC        04
-#define F_FILE 010
-
-
-
-
-/*
- * dev switch
- */
-struct devsw {
-       char    *dv_name;
-       int     (*dv_strategy)();
-       int     (*dv_open)();
-       int     (*dv_close)();
-};
-
-struct devsw devsw[];
-
-/*
- * request codes. Must be the same a F_XXX above
- */
-#define        READ    1
-#define        WRITE   2
-
-
-#define        NBUFS   4
-
-
-char   b[NBUFS][512];
-daddr_t        blknos[NBUFS];
-
-
-
-#define NFILES 4
-struct iob iob[NFILES];
-
-/*
- * Set to which 32Kw segment the code is physically running in.
- * Must be set by the users main (or there abouts).
- */
-int    segflag;
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/srt0.s b/.ref-Research-V7/usr/src/cmd/standalone/srt0.s
deleted file mode 100644 (file)
index bb4727a..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/ Startup code for two-stage bootstrap
-
-/ non-UNIX instructions
-mfpi   = 6500^tst
-stst   = 170300^tst
-mtpi   = 6600^tst
-mfpd   = 106500^tst
-mtpd   = 106600^tst
-spl    = 230
-ldfps  = 170100^tst
-stfps  = 170200^tst
-wait   = 1
-rtt    = 6
-reset  = 5
-/ trap = 104400
-
-PS     = 177776
-
-.globl _end
-.globl _main, __rtt
-.globl _edata
-       jmp     start
-
-/
-/ trap vectors
-/
-       trap;340
-       trap;341        / illegal instruction
-       trap;342        / BPT
-       trap;343        / IOT
-       trap;344        / POWER FAIL
-       trap;345        / EMT
-tvec:
-       start;346       / TRAP
-.=400^.
-.text
-
-
-start:
-       mov     $340,*$PS
-       mov     $trap,tvec
-/ fix up stack segment clobbered by trap
-       mov     $1400,*$KDSA6
-       mov     $157776,sp
-       mov     $_edata,r0
-       mov     $_end,r1
-       sub     r0,r1
-       inc     r1
-       clc
-       ror     r1
-1:
-       clr     (r0)+
-       sob     r1,1b
-       jsr     pc,_main
-
-/ fix up stack to point at trap ps-pc pair
-/ so we can return to the bootstrap
-__rtt:
-       clr     *$KDSA6
-       mov     $140000,sp
-       rtt                             / we hope!
-       br      .
-
-
-.globl _trap
-trap:
-       mov     r0,-(sp)
-       mov     r1,-(sp)
-       mov     *$PS,-(sp)
-       jsr     pc,_trap
-       tst     (sp)+
-       mov     (sp)+,r1
-       mov     (sp)+,r0
-       rtt
-
-KDSA6 = 172374
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/tapedir b/.ref-Research-V7/usr/src/cmd/standalone/tapedir
deleted file mode 100644 (file)
index 7e531d5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-mtboot 1
-mtboot 1
-boot 1
-* 1
-cat 1
-* 1
-contents 1
-* 1
-mkfs 1
-* 1
-restor 1
diff --git a/.ref-Research-V7/usr/src/cmd/standalone/tm.c b/.ref-Research-V7/usr/src/cmd/standalone/tm.c
deleted file mode 100644 (file)
index cd4a0bf..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#
-
-/*
- * TM tape driver
- */
-
-#include <sys/param.h>
-#include <sys/inode.h>
-#include "saio.h"
-
-struct device {
-       int     tmer;
-       int     tmcs;
-       int     tmbc;
-       char    *tmba;
-       int     tmdb;
-       int     tmrd;
-};
-
-#define        TMADDR ((struct device *)0172520)
-
-#define        GO      01
-#define        RCOM    02
-#define        WCOM    04
-#define        WEOF    06
-#define        SFORW   010
-#define        SREV    012
-#define        WIRG    014
-#define        REW     016
-#define        DENS    060000          /* 9-channel */
-#define        IENABLE 0100
-#define        CRDY    0200
-#define GAPSD  010000
-#define        TUR     1
-#define        SDWN    010
-#define        HARD    0102200 /* ILC, EOT, NXM */
-#define        EOF     0040000
-
-#define        SSEEK   1
-#define        SIO     2
-
-
-tmrew(io)
-register struct iob *io;
-{
-       tmstrategy(io, REW);
-}
-
-tmopen(io)
-register struct iob *io;
-{
-       register skip;
-
-       tmstrategy(io, REW);
-       skip = io->i_boff;
-       while (skip--) {
-               io->i_cc = 0;
-               while (tmstrategy(io, SFORW))
-                       ;
-       }
-}
-tmstrategy(io, func)
-register struct iob *io;
-{
-       register int com, unit, errcnt;
-
-       unit = io->i_unit;
-       errcnt = 0;
-retry:
-       tmquiet();
-       com = (unit<<8)|(segflag<<4)|DENS;
-       TMADDR->tmbc = -io->i_cc;
-       TMADDR->tmba = io->i_ma;
-       if (func == READ)
-               TMADDR->tmcs = com | RCOM | GO;
-       else if (func == WRITE)
-               TMADDR->tmcs = com | WCOM | GO;
-       else if (func == SREV) {
-               TMADDR->tmbc = -1;
-               TMADDR->tmcs = com | SREV | GO;
-               return(0);
-       } else
-               TMADDR->tmcs = com | func | GO;
-       while ((TMADDR->tmcs&CRDY) == 0)
-               ;
-       if (TMADDR->tmer&EOF)
-               return(0);
-       if (TMADDR->tmer < 0) {
-               if (errcnt == 0)
-                       printf("tape error: er=%o", TMADDR->tmer);
-               if (errcnt==10) {
-                       printf("\n");
-                       return(-1);
-               }
-               errcnt++;
-               tmstrategy(io, SREV);
-               goto retry;
-       }
-       if (errcnt)
-               printf(" recovered by retry\n");
-       return( io->i_cc+TMADDR->tmbc );
-}
-
-tmquiet()
-{
-       while ((TMADDR->tmcs&CRDY) == 0)
-               ;
-       while ((TMADDR->tmer&TUR) == 0)
-               ;
-       while ((TMADDR->tmer&SDWN) != 0)
-               ;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/strip.c b/.ref-Research-V7/usr/src/cmd/strip.c
deleted file mode 100644 (file)
index 80890c9..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#include <a.out.h>
-#include <signal.h>
-
-char   *tname;
-char   *mktemp();
-struct exec head;
-int    a_magic[] = {A_MAGIC1, A_MAGIC2, A_MAGIC3, A_MAGIC4, 0};
-int    status;
-int    tf;
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-
-       signal(SIGHUP, SIG_IGN);
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       tname = mktemp("/tmp/sXXXXX");
-       close(creat(tname, 0600));
-       tf = open(tname, 2);
-       if(tf < 0) {
-               printf("cannot create temp file\n");
-               exit(2);
-       }
-       for(i=1; i<argc; i++) {
-               strip(argv[i]);
-               if(status > 1)
-                       break;
-       }
-       close(tf);
-       unlink(tname);
-       exit(status);
-}
-
-strip(name)
-char *name;
-{
-       register f;
-       long size;
-       int i;
-
-       f = open(name, 0);
-       if(f < 0) {
-               printf("cannot open %s\n", name);
-               status = 1;
-               goto out;
-       }
-       read(f, (char *)&head, sizeof(head));
-       for(i=0;a_magic[i];i++)
-               if(a_magic[i] == head.a_magic) break;
-       if(a_magic[i] == 0) {
-               printf("%s not in a.out format\n", name);
-               status = 1;
-               goto out;
-       }
-       if(head.a_syms == 0 && (head.a_flag&1) != 0) {
-               printf("%s already stripped\n", name);
-               goto out;
-       }
-       size = (long)head.a_text + head.a_data;
-       head.a_syms = 0;
-       head.a_flag |= 1;
-
-       lseek(tf, (long)0, 0);
-       write(tf, (char *)&head, sizeof(head));
-       if(copy(name, f, tf, size)) {
-               status = 1;
-               goto out;
-       }
-       size += sizeof(head);
-       close(f);
-       f = creat(name, 0666);
-       if(f < 0) {
-               printf("%s cannot recreate\n", name);
-               status = 1;
-               goto out;
-       }
-       lseek(tf, (long)0, 0);
-       if(copy(name, tf, f, size))
-               status = 2;
-
-out:
-       close(f);
-}
-
-copy(name, fr, to, size)
-char *name;
-long size;
-{
-       register s, n;
-       char buf[512];
-
-       while(size != 0) {
-               s = 512;
-               if(size < 512)
-                       s = size;
-               n = read(fr, buf, s);
-               if(n != s) {
-                       printf("%s unexpected eof\n", name);
-                       return(1);
-               }
-               n = write(to, buf, s);
-               if(n != s) {
-                       printf("%s unexpected write eof\n", name);
-                       return(1);
-               }
-               size -= s;
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.alloc.c b/.ref-Research-V7/usr/src/cmd/struct/0.alloc.c
deleted file mode 100644 (file)
index 08b715e..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-int routbeg;
-
-extern int debug;
-struct coreblk {struct coreblk *nxtblk;
-                       int blksize;
-                       int nxtfree;
-                       int *blk;
-                       };
-
-long space;
-challoc(n)
-int n;
-       {
-       int i;
-       i = malloc(n);
-       if(i) { space += n; return(i); }
-       fprintf(stderr,"alloc out of space\n");
-       fprintf(stderr,"total space alloc'ed = %D\n",space);
-       fprintf(stderr,"%d more bytes requested\n",n);
-       exit(1);
-       }
-
-
-chfree(p,n)
-int *p,n;
-       {
-       ASSERT(p,chfree);
-       space -= n;
-       free(p);
-       }
-
-
-struct coreblk *tcore, *gcore;
-int tblksize=12, gblksize=300;
-
-
-balloc(n,p,size)               /* allocate n bytes from coreblk *p */
-int n,size;            /* use specifies where called */
-struct coreblk **p;
-       {
-       int i;
-       struct coreblk *q;
-       n = (n+sizeof(i)-1)/sizeof(i);  /* convert bytes to wds to ensure ints always at wd boundaries */
-       for (q = *p; ; q = q->nxtblk)
-               {
-               if (!q)
-                       {
-                       q = morespace(n,p,size);
-                       break;
-                       }
-               if (q-> blksize - q->nxtfree >= n)  break;
-               }
-       i = q->nxtfree;
-       q ->nxtfree += n;
-       return( &(q->blk)[i]);
-       }
-
-talloc(n)              /* allocate from line-by-line storage area */
-int n;
-       {return(balloc(n,&tcore,tblksize)); }
-
-galloc(n)              /* allocate from graph storage area */
-int n;
-       {
-       return(balloc(n,&gcore,gblksize));
-       }
-
-reuse(p)               /* set nxtfree so coreblk can be reused */
-struct coreblk *p;
-       {
-       for (; p; p=p->nxtblk)  p->nxtfree = 0;  
-       }
-
-bfree(p)               /* free coreblk p */
-struct coreblk *p;
-       {
-       if (!p) return;
-       bfree(p->nxtblk);
-       p->nxtblk = 0;
-       free(p);
-       }
-
-
-morespace(n,p,size)            /* get at least n more wds for coreblk *p */
-int n,size;
-struct coreblk **p;
-       {struct coreblk *q;
-       int t,i;
-
-       t = n<size?size:n;
-       q = malloc(i=t*sizeof(*(q->blk))+sizeof(*q));
-       if(!q){
-               error(": alloc out of space","","");
-               fprintf(stderr,"space = %D\n",space);
-               fprintf(stderr,"%d more bytes requested\n",n);
-               exit(1);
-               }
-       space += i;
-       q->nxtblk = *p;
-       *p = q;
-       q -> blksize = t;
-       q-> nxtfree = 0;
-       q->blk = q + 1;
-       return(q);
-       }
-
-
-
-
-freegraf()
-       {
-       bfree(gcore);
-       gcore = 0;
-
-
-       }
-
-
-
-
-
-
-
-
-
-error(mess1, mess2, mess3)
-char *mess1, *mess2, *mess3;
-       {
-       static lastbeg;
-       if (lastbeg != routbeg)
-               {
-               fprintf(stderr,"routine beginning on line %d:\n",routbeg);
-               lastbeg = routbeg;
-               }
-       fprintf(stderr,"error %s %s %s\n",mess1, mess2, mess3);
-       }
-
-
-faterr(mess1, mess2, mess3)
-char *mess1, *mess2, *mess3;
-       {
-       error(mess1, mess2, mess3);
-       exit(1);
-       }
-
-
-strerr(mess1, mess2, mess3)
-char *mess1, *mess2, *mess3;
-       {
-       error("struct error: ",mess1, mess2);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.args.c b/.ref-Research-V7/usr/src/cmd/struct/0.args.c
deleted file mode 100644 (file)
index 8df41c7..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#include <stdio.h>
-#
-#include "def.h"
-int errflag;
-FILE *infd;
-
-
-int intcase=1, arbcase=0;
-int exitsize=0;                        /* max number of nodes to be left in loop without iterating */
-int maxnode=400;       /* max number of nodes */
-int maxhash=347;       /* prime number = size of hash table */
-int progress=0;                /* if not 0, print line number every n lines, n = progress */
-int labinit=10;                        /* labels generated starting with labinit */
-int labinc=10;                 /* labels increase by labinc */
-int inputform=0;               /* = 0 if freeform input, 1 if standard form input */
-int debug=0;
-int levbrk=1;  /* true implies multilevel breaks; false implies single-level breaks only */
-int levnxt=1;  /* true implies multilevel nexts; false implies single-level nexts only */
-
-
-int maxprogsw=12;              /* number of program switches which can be set */
-char *progsw[]         = {"i", "a",
-                       "e", "m",
-                       "h", "p",
-                       "t", "c",
-                       "s", "d",
-                       "b", "n"
-                       };
-
-
-int *swval[]           = {&intcase, &arbcase,
-                       &exitsize, &maxnode,
-                       &maxhash, &progress,
-                       &labinit, &labinc,
-                       &inputform, &debug,
-                       &levbrk, &levnxt
-                       };
-
-
-char *getargs(argc, argv)
-int argc; char *argv[];
-       {
-       int n, infile;
-       infile = 0;
-
-       for (n = 1; n < argc; ++n)
-               {
-               if (argv[n][0] == '-')
-                       setsw(&argv[n][1]);
-               else
-                       {
-                       if (infile != 0)
-                               error("multiple input files - using first one: ", argv[infile],"");
-                       else
-                               infile = n;
-                       }
-               }
-       if (errflag)
-               exit(1);
-       if (!infile) faterr("no input file","","");
-       infd = fopen(argv[infile],"r");
-       if (infd == NULL)
-               faterr("can't open input file:",argv[infile],"");
-       return;
-       }
-
-setsw(str)
-char *str;
-       {
-       int i, val, swnum;
-#define maxtemp 15
-       char temp[maxtemp];
-       for (i = 0; 'a' <= str[i] && str[i] <= 'z'; ++i)
-               {
-               if (i >= maxtemp)
-                       {
-                       error("invalid switch:",str,"");
-                       errflag = 1;
-                       }
-               temp[i] = str[i];
-               }
-       temp[i] = '\0';
-
-       swnum = find(temp,progsw,maxprogsw);
-       if (swnum == -1)
-               {
-               error("invalid switch:", str,"");
-               errflag = 1;
-               return;
-               }
-       if (str[i] == '\0')
-               *(swval[swnum]) = !*(swval[swnum]);
-       else
-               {
-               sscanf(&str[i],"%d",&val);
-               *(swval[swnum]) = val;
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.def.c b/.ref-Research-V7/usr/src/cmd/struct/0.def.c
deleted file mode 100644 (file)
index 4c4b32d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-
-int routnum;
-FILE *debfd;
-LOGICAL routerr;
-int nodenum, accessnum;
-int **graph;
-int progtype;
-VERT stopvert, retvert;
-VERT START;
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.extr.c b/.ref-Research-V7/usr/src/cmd/struct/0.extr.c
deleted file mode 100644 (file)
index a558e23..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-struct lablist {long labelt;  struct lablist *nxtlab; };
-struct lablist *endlab, *errlab, *reflab, *linelabs, *newlab;
-
-int nameline;                  /* line number of function/subroutine st., if any */
-int stflag;            /* determines whether at beginning or middle of block of straight line code */
-
-
-
-int   nlabs, lswnum, swptr, flag,
-        counter, p1, p3, begline, endline, r1,r2, endcom;
-long begchar, endchar, comchar;
-
-
-char *pred, *inc, *prerw, *postrw, *exp, *stcode;
-
-#define maxdo  20      /* max nesting of do loops */
-long dostack[maxdo];           /* labels of do nodes */
-int doloc[maxdo];              /* loc of do node */
-int doptr;
-
-
-struct list *FMTLST;           /* list of FMTVX's generated */
-struct list *ENTLST;           /* list of STLNVX nodes corresponding to entry statements */
-long rtnbeg;   /* number of chars up to beginning of current routine */
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.graph.c b/.ref-Research-V7/usr/src/cmd/struct/0.graph.c
deleted file mode 100644 (file)
index f879efe..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-
-#define TABOVER(n)     tabover(n,stderr)
-prgraph()
-       {
-       VERT v;
-       int i;
-       if (progress) fprintf(stderr,"prgraph():\n");
-       for (v = 0; v < nodenum; ++v)
-               {
-               fprintf(stderr,"%d %s:",v, typename[NTYPE(v)]);
-               for (i = 0; i < ARCNUM(v); ++i)
-                       {
-                       fprintf(stderr,"%d ",ARC(v,i));
-                       ASSERT(UNDEFINED <= ARC(v,i) && ARC(v,i) < nodenum, prgraph);
-                       }
-               fprintf(stderr,"\n");
-               }
-       fprintf(stderr,"\n\n");
-       }
-
-prtree()
-       {
-       prtr(START,1);
-       }
-
-prtr(v,tab)            /* print tree in form of program indenting by tab */
-VERT v;
-int tab;
-       {
-       int i;
-       TABOVER(tab);
-       fprintf(stderr,"%d %s:",v,typename[NTYPE(v)]);
-       for (i = 0; i < ARCNUM(v); ++i)
-               fprintf(stderr," %d",ARC(v,i));
-       fprintf(stderr,"\n");
-       for (i = 0; i < CHILDNUM(v); ++i)
-               {
-               TABOVER(tab+1);
-               fprintf(stderr,"{\n");
-               if (DEFINED(LCHILD(v,i)))
-                       prtr(LCHILD(v,i),tab+1);
-               TABOVER(tab+1);
-               fprintf(stderr,"}\n");
-               }
-       if (DEFINED(RSIB(v)))
-               prtr(RSIB(v),tab);
-       }
-
-
-tabover(n,fd)          /* tab n times */
-int n;
-FILE *fd;
-       {
-       int i;
-       for (i = 0; i < n; ++i)
-               putc('\t',fd);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.list.c b/.ref-Research-V7/usr/src/cmd/struct/0.list.c
deleted file mode 100644 (file)
index 2ca2bbd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-
-struct list *consls(v,ls)              /* make list */
-VERT v;
-struct list *ls;
-       {
-       struct list *temp;
-       temp = challoc(sizeof(*temp));
-       temp->elt = v;
-       temp->nxtlist = ls;
-       return(temp);
-       }
-
-struct list *append(v,ls)              /* return ls . v */
-VERT v;
-struct list *ls;
-       {
-       struct list *temp;
-       if (!ls) return(consls(v,0));
-       for (temp = ls; temp -> nxtlist; temp = temp->nxtlist)
-               ;
-       temp->nxtlist = consls(v,0);
-       return(ls);
-       }
-
-
-freelst(ls)
-struct list *ls;
-       {
-       if (!ls) return;
-       if (ls->nxtlist)
-               freelst(ls->nxtlist);
-       chfree(ls,sizeof(*ls));
-       }
-
-
-oneelt(ls)             /* return w if w is only elt of ls, UNDEFINED otherwise */
-struct list *ls;
-       {
-       if (!ls) return(UNDEFINED);
-       if (ls->nxtlist) return(UNDEFINED);
-       return(ls->elt);
-       }
-
-
-lslen(ls)              /* return number of elements in list ls */
-struct list *ls;
-       {
-       int count;
-       struct list *lp;
-       count = 0;
-       for (lp = ls; lp; lp = lp->nxtlist)
-               ++count;
-       return(count);
-       }
-
-
-prlst(ls)
-struct list *ls;
-       {
-       struct list *lp;
-       for (lp = ls; lp; lp = lp->nxtlist)
-               fprintf(stderr,"%d,",lp->elt);
-       fprintf(stderr,"\n");
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.parts.c b/.ref-Research-V7/usr/src/cmd/struct/0.parts.c
deleted file mode 100644 (file)
index e924171..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-
-char *typename[TYPENUM]        = {"STLNVX",    "IFVX",         "DOVX",         "IOVX", "FMTVX",
-                       "COMPVX",       "ASVX",         "ASGOVX",       "LOOPVX",       "WHIVX",
-                       "UNTVX",        "ITERVX",       "THENVX",       "STOPVX",       "RETVX",
-                       "DUMVX",        "GOVX",         "BRKVX",        "NXTVX",        "SWCHVX",
-                       "ACASVX",       "ICASVX"
-       };
-int hascom[TYPENUM]    = {2,           2,              2,              2,              2,
-                       2,              2,              2,              0,              0,
-                       0,              0,              2,              0,              0,
-                       0,              0,              0,              0,              2,
-                       2,              0
-                       };
-
-int nonarcs[TYPENUM]   = {FIXED+3,     FIXED+4,        FIXED+2,        FIXED+3,        FIXED+2,
-                       FIXED+2,        FIXED+2,        FIXED+2,        FIXED+1,        FIXED+1,
-                       FIXED+1,        FIXED+4,        FIXED+3,        FIXED,          FIXED,
-                       FIXED+2,        FIXED+1,        FIXED + 1,      FIXED + 1,      FIXED+3,
-                       FIXED+4,        FIXED+2
-                       };
-
-int childper[TYPENUM]  = {0,   2,      1,      0,      0,
-                       0,      0,      0,      1,      1,
-                       1,      1,      1,      0,      0,
-                       1,      0,      0,      0,      1,
-                       2,      1
-                       };
-
-int arcsper[TYPENUM]   = {1,           2,              2,      3,      0,
-                       -(FIXED+1),     1,      -(FIXED+1),     1,      1,
-                       1,              1,              2,      0,      0,
-                       -FIXED,         1,      1,              1,      -(FIXED+1),
-                       2,              1
-                       };
-
-VERT *arc(v,i)
-VERT v;
-int i;
-       {
-       ASSERT(DEFINED(v),arc);
-       ASSERT(0 <= i && i < ARCNUM(v), arc);
-       return(&graph[v][nonarcs[NTYPE(v)] + i ]);
-       }
-
-VERT *lchild(v,i)
-VERT v; int i;
-       {
-       ASSERT(DEFINED(v),lchild);
-       ASSERT(0 <= i && i < childper[NTYPE(v)],lchild);
-       return(&graph[v][nonarcs[NTYPE(v)]-i-1]);
-       }
-
-int *vxpart(v,type,j)
-VERT v;
-int type,j;
-       {
-       ASSERT((NTYPE(v) == type) && (0 <= j) && (j < nonarcs[type] - FIXED), vxpart);
-       return(&graph[v][FIXED+j]);
-       }
-
-int *expres(v)
-VERT v;
-       {
-       int ty;
-       ty = NTYPE(v);
-       ASSERT(ty == COMPVX || ty == ASGOVX || ty == ASVX || ty == SWCHVX || ty == ICASVX,expres);
-       return(&graph[v][FIXED]);
-       }
-
-int *negpart(v)
-VERT v;
-       {
-       ASSERT(NTYPE(v) == IFVX || NTYPE(v) == ACASVX,negpart);
-       return(&graph[v][FIXED+1]);
-       }
-
-int *predic(v)
-VERT v;
-       {
-       ASSERT(NTYPE(v) == IFVX || NTYPE(v) == ACASVX, predic);
-       return(&graph[v][FIXED]);
-       }
-
-int *level(v)
-VERT v;
-       {
-       ASSERT(NTYPE(v) == GOVX || NTYPE(v) == BRKVX || NTYPE(v) == NXTVX, level);
-       return(&graph[v][FIXED]);
-       }
-int *stlfmt(v,n)
-VERT v;
-int n;
-       {
-       ASSERT(NTYPE(v) == STLNVX || NTYPE(v) == FMTVX,stlfmt);
-       return(&graph[v][FIXED + n]);
-       }
-
-create(type,arcnum)
-int type, arcnum;
-       {
-       int i, *temp, wds;
-       if (nodenum >= maxnode)
-               {
-               maxnode += 100;
-               temp=realloc(graph,maxnode*sizeof(*graph));
-               free(graph);
-               graph=temp;
-               }
-       wds = nonarcs[type] + arcnum;
-       graph[nodenum] = galloc(sizeof(*graph) * wds);
-       for (i = 0; i < wds; i++)  graph[nodenum][i] = 0;
-       NTYPE(nodenum) = type;
-       if (arcsper[type] < 0)
-               ARCNUM(nodenum) = arcnum;
-       
-       return(nodenum++);
-       }
-
diff --git a/.ref-Research-V7/usr/src/cmd/struct/0.string.c b/.ref-Research-V7/usr/src/cmd/struct/0.string.c
deleted file mode 100644 (file)
index 994ec42..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "1.defs.h"
-
-str_copy(s,ptr,length) /* copy s at ptr, return length of s */
-char *s, *ptr;
-int length;
-       {int i;
-       for (i = 0; i < length; i++)
-               {
-               ptr[i] = s[i];
-               if (ptr[i] == '\0')
-                       return(i + 1);
-               }
-       faterr("string too long to be copied at given address:\n",s,"");
-       }
-
-
-find(s,ar,size)
-char *s,*ar[];
-int size;
-       {
-       int i;
-       for (i=0; i < size; i++)
-               {if (str_eq(s, ar[i])) return(i);}
-       return(-1);
-       }
-
-
-str_eq(s,t)
-char s[],t[];
-       {int j;
-       for (j = 0; s[j] == t[j]; j++)
-               {if (s[j] == '\0') return(1);}
-       return(0);
-       }
-
-
-classmatch(c,i)
-char c;
-int i;
-       {switch(i)
-               {case _digit:
-                       if ('0' <= c && c <= '9')  return(1);
-                       else return(0);
-
-               case _letter:
-                       if ( ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'))
-                               return(1);
-                       else return(0);
-
-               case _diglet:  return(classmatch(c,_digit)||classmatch(c,_letter) );
-
-               case _arith:
-                       if (050 <= c && c<= 057)  return(1);
-                       else return(0);
-               case _nl:
-                       return(c=='\n');
-               case _other:
-                       return(1);
-               }
-       }
-
-
-copychars(cbeg,target,n)               /* copy n chars from cbeg to target */
-char *cbeg, *target;
-int n;
-       {
-       int i;
-       for (i = 0; i < n; i++)
-               target[i] = cbeg[i];
-       }
-
-
-
-copycs(cbeg,target,n)                  /* copy n chars from cbeg to target, add '\0' */
-char *cbeg, *target;
-int n;
-       {
-       copychars(cbeg,target,n);
-       target[n] = '\0';
-       }
-
-
-slength(s)                     /* return number of chars in s, not counting '\0' */
-char *s;
-       {
-       int i;
-       if (!s) return(-1);
-       for (i = 0; s[i] != '\0'; i++);
-       return(i);
-       }
-
-
-concat(x,y)                    /* allocate space, return xy */
-char *x, *y;
-       {
-       char *temp;
-       int i,j;
-       i = slength(x);
-       j = slength(y);
-       temp = galloc(i + j + 1);
-       sprintf(temp,"%s",x);
-       sprintf(&temp[i],"%s",y);
-       return(temp);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.defs.h b/.ref-Research-V7/usr/src/cmd/struct/1.defs.h
deleted file mode 100644 (file)
index d0ab63f..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#define snum   145
-#define _s0    0
-#define _s1    1
-#define _s2    2
-#define _s3    3
-#define _s4    4
-#define _start 5
-#define _g     6
-#define _go    7
-#define _got   8
-#define _goto  9
-#define _ugo   10
-#define _ago   11
-#define _agoc  12
-#define _agol  13
-#define _agor  14
-#define _cgo   15
-#define _cgold 16
-#define _cgor  17
-#define _cgoc  18
-#define _i     19
-#define _if    20
-#define _if1   21
-#define _if2   22
-#define _pard  23
-#define _arif  24
-#define _c     25
-#define _co    26
-#define _con   27
-#define _cont  28
-#define _conti 29
-#define _contin        30
-#define _con_u 31
-#define _con_ue        32
-#define _d     33
-#define _do    34
-#define _dol   35
-#define _dov   36
-#define _doveq 37
-#define _a     38
-#define _as    39
-#define _ass   40
-#define _assi  41
-#define _assig 42
-#define _assign        43
-#define _assd  44
-#define _ast   45
-#define _asto  46
-#define _fr    47
-#define _fre   48
-#define _frea  49
-#define _1func 50
-#define _1f    51
-#define _fu    52
-#define _fun   53
-#define _func  54
-#define _funct 55
-#define _fncti 56
-#define _fncto 57
-#define _fin   58
-#define _fint  59
-#define _finte 60
-#define _fintg 61
-#define _finge 62
-#define _fc    63
-#define _fco   64
-#define _fcom  65
-#define _fcomp 66
-#define _fcmpl 67
-#define _fcple 68
-#define _fdou  69
-#define _fdoub 70
-#define _fdobl 71
-#define _fdble 72
-#define _fp    73
-#define _fpr   74
-#define _fpre  75
-#define _fprec 76
-#define _fprci 77
-#define _fpris 78
-#define _fprsi 79
-#define _fprco 80
-#define _fl    81
-#define _flo   82
-#define _flog  83
-#define _flogi 84
-#define _flgic 85
-#define _flgca 86
-#define _s     87
-#define _st    88
-#define _sto   89
-#define _su    90
-#define _sub   91
-#define _subr  92
-#define _subro 93
-#define _subrt 94
-#define _subri 95
-#define _subrn 96
-#define _r     97
-#define _re    98
-#define _ret   99
-#define _retu  100
-#define _retr  101
-#define _e     102
-#define _en    103
-#define _end   104
-#define _ent   105
-#define _entr  106
-#define _fo    107
-#define _for   108
-#define _form  109
-#define _fma   110
-#define _fmt   111
-#define _w     112
-#define _wr    113
-#define _wri   114
-#define _writ  115
-#define _write 116
-#define _read  117
-#define _rdig  118
-#define _rwp   119
-#define _rwlab 120
-#define _rwe   121
-#define _rwen  122
-#define _rwend 123
-#define _endeq 124
-#define _rwer  125
-#define _rwerr 126
-#define _p     127
-#define _pr    128
-#define _pri   129
-#define _prin  130
-#define _pu    131
-#define _pun   132
-#define _punc  133
-#define _bd    134
-#define _bl    135
-#define _blo   136
-#define _blc   137
-#define _blk   138
-#define _bld   139
-#define _blda  140
-#define _bldt  141
-#define ABORT  142
-#define endrt  143
-#define nulls  144
-#define _other 1
-#define _digit 2
-#define _letter        3
-#define _diglet        4
-#define _arith 5
-#define _nl    6
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.finish.c b/.ref-Research-V7/usr/src/cmd/struct/1.finish.c
deleted file mode 100644 (file)
index 14045fd..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "1.incl.h"
-
-fingraph()
-       {
-       /* if any entry statements, add a DUMVX with arcs to all entry statements */
-       if (ENTLST)
-               {
-               ARC(START,0) = addum(ARC(START,0),ENTLST);
-               freelst(ENTLST);
-               }
-       /* if any FMTVX, add a DUMVX with arcs to all FMTVX's */
-       if (FMTLST)
-               {
-               ARC(START,0) = addum(ARC(START,0),FMTLST);
-               freelst(FMTLST);
-               }
-       }
-
-addum(v,lst)
-VERT v;
-struct list *lst;
-       {
-       VERT new;
-       int count,i;
-       struct list *ls;
-       count = lslen(lst);             /* length of lst */
-       new = create(DUMVX,1+count);
-       ARC(new,0) = v;
-       for (i = count, ls = lst; i >= 1; --i, ls = ls->nxtlist)
-               {
-               ASSERT(ls,addum);
-               ARC(new,i) = ls->elt;
-               }
-       ASSERT(!ls, addum);
-       return(new);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.form.c b/.ref-Research-V7/usr/src/cmd/struct/1.form.c
deleted file mode 100644 (file)
index cf0e3ed..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#include <stdio.h>
-#include "1.defs.h"
-#include "def.h"
-extern int linechar, errflag, debug;
-extern int (*input)(), (*unput)();
-
-
-
-uptolow(c)             /*translates upper to lower case */
-int c;
-       {
-       if ('A' <= c && c <= 'Z')
-               return(c+'a'-'A');
-       else
-               return(c);
-       }
-
-rdfree(func)
-int (*func)();
-       {
-       int c;
-       while ( (c = (*input)()) != '\n')
-               {
-               (*func)(c);
-               }
-       }
-
-rdstand(func)
-int (*func)();
-       {
-       int c;
-       while ( (c=(*input)()) != '\n')
-               {
-               (*func)(c);
-               }
-       }
-
-labfree(func)                  /* labels in freeform input */
-int (*func)();
-       {
-       int c;
-       int temp[6];
-       int j;
-       for (j = 0; j < 5; ++j)
-               {
-               while ( (c = (*input)()) == ' ' || c == '\t' );
-               if (c == '\n')
-                       {
-                       if (j != 0)
-                               {
-                               temp[j] = '\0';
-                               error("label without code - ignored:","","");
-                               }
-                       }
-               if (c < '0' || c > '9')
-                       {
-                       (*unput)(c);
-                       break;
-                       }
-               else
-                       {
-                       temp[j] = c;
-                       (*func)(c);
-                       }
-               }
-       for ( ; j < 5; ++j)
-               (*func)(' ');
-       }
-
-labstand(func)                 /* labels in standard form input */
-int (*func)();
-       {
-       int c;
-       int j;
-
-       for (j = 0; j < 5; ++j)
-               {
-               c = (*input)();
-               if (c == '\n')
-                       {
-                       error("line shorter than 5 characters","","");
-                       errflag = 1;
-                       (*unput)('\n');
-                       }
-               if (c == '\t' || c == '\n')
-                       {
-                       for ( ;j<5; ++j)
-                               (*func)(' ');
-                       return;
-                       }
-               (*func)(c);
-               }
-       (*input)();                     /* throw away continuation char */
-       }
-
-
-
-contfree()                     /* identify continuation lines in free-form input */
-       {
-       return(nonblchar(_diglet,0));   /* any non-alpha non-digit */
-       }
-
-
-nonblchar(class,yesno)
-int class,yesno;
-       {
-#define CARDSIZE       121
-       int temp[CARDSIZE];
-       int j;
-       for (j=0; (temp[j]=(*input)()) == ' ' || temp[j] == '\t'; ++j)
-               if (j>=CARDSIZE-1)
-                       {
-                       temp[CARDSIZE-1] = '\0';
-                        error ("line unexpectedly long","","");
-                       break;
-                       }
-       if (temp[j]!=EOF && classmatch(temp[j],class)==yesno)
-               return(1);
-       else
-               {
-               for ( ; j >= 0; --j)
-                       (*unput)(temp[j]);
-               return(0);
-               }
-       }
-
-
-contstand()                    /* continuation lines in standard form input */
-       {
-       int temp[6];
-       int i;
-
-       for (i = 0; i < 6; ++i)
-               {
-               temp[i] = (*input)();
-               if (temp[i] == '\t' || temp[i] == '\n' || temp[i] == '\0' || temp[i] == EOF)
-                       {
-                       for ( ;i >= 0; --i)
-                               (*unput)(temp[i]);
-                       return(0);
-                       }
-               }
-       if (temp[5] != '0' && temp[5] != ' ')
-               return(1);
-       else
-               {
-               for ( i = 5 ; i >= 0; --i)
-                       (*unput)(temp[i]);
-               return(0);
-               }
-       }
-
-
-
-comstand(posafter)                     /* standard form comments */
-int posafter;
-       {
-       int c;
-       c = (*input)();
-       if (!posafter)
-               (*unput)(c);
-       if (c == 'c' || c == '*' || c== '#')
-               return(1);
-       else
-               return(0);
-       }
-
-
-comfree(posafter)
-int posafter;
-       {
-       return(comstand(posafter));
-       }
-int (*rline[])()               = {rdfree,rdstand};
-int (*comment[])()             = {comfree,comstand};
-int (*getlabel[])()            = {labfree, labstand};
-int (*chkcont[])()             = {contfree,contstand};
-
-blankline()
-       {
-       if ( nonblchar(_nl,1) )         /* first non-blank is nl */
-               {
-               (*unput) ('\n');
-               return(1);
-               }
-       else return(0);
-       }
-
-#define maxunbp        80
-char unbuf[maxunbp+1];
-int unbp;
-
-empseek(linebeg)
-unsigned int linebeg;
-       {
-       unbp = 0;
-       if (fseek(infd,(long)(linebeg+rtnbeg),0) == -1)
-               faterr("in disk seek","","");
-       }
-
-inchar()
-       {
-       if (unbp > 0)
-               return( unbuf[--unbp] );
-       else
-               {
-               return( uptolow(getc(infd)) );
-               }
-       }
-
-
-unchar(c)
-int c;
-       {
-       if (unbp >= maxunbp)
-               faterr("dec.rat: unbuf size exceeded","","");
-       if(c!=EOF)unbuf[unbp++] = c;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.fort.c b/.ref-Research-V7/usr/src/cmd/struct/1.fort.c
deleted file mode 100644 (file)
index 1b20507..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-#include <stdio.h>
-#include "1.incl.h"
-#include  "1.defs.h"
-#include "def.h"
-
-
-act(k,c,bufptr)
-int k,bufptr;
-char c;
-       {
-       long ftemp;
-       struct lablist *makelab();
-       switch(k)
-               /*handle labels */
-               {case 1:
-                       if (c != ' ')
-                               {
-                       ftemp = c - '0';
-                               newlab->labelt = 10L * newlab->labelt + ftemp;
-
-                               if (newlab->labelt > 99999L)
-                                       {
-                               error("in syntax:\n","","");
-                                       fprintf(stderr,"line %d: label beginning %D too long\n%s\n",
-                                               begline,newlab->labelt,buffer);
-                                       fprintf(stderr,"treating line as straight line code\n");
-                                       return(ABORT);
-                                       }
-                               }
-                       break;
-
-               case 3:  nlabs++;
-                       newlab = newlab->nxtlab = makelab(0L);
-                       break;
-
-               /* handle labsw- switches and labels */
-               /* handle if statements */
-               case 30:  counter++;  break;
-
-               case 31:
-                       counter--;
-                       if (counter)  return(_if1);
-                       else
-                               {
-                               pred = remtilda(stralloc(&buffer[p1],bufptr - p1));
-                               p3 = bufptr + 1;        /* p3 pts. to 1st symbol after ) */
-                               flag = 1;
-                               return(_if2);  }
-
-               case 45:                        /* set p1 to pt.to 1st symbol of pred */
-                       p1 = bufptr + 1;
-                       act(30,c,bufptr);  break;
-
-               /* handle do loops */
-               case 61:  p1 = bufptr;  break;   /* p1 pts. to 1st symbol of increment  string */
-
-               case 62:  counter ++;  break;
-
-               case 63:  counter --; break;
-
-               case 64: 
-                       if (counter != 0) break;
-                       act(162,c,bufptr);
-                       return(ABORT);
-
-               case 70:  if (counter)  return(_rwp);
-                       r1 = bufptr;
-                       return(_rwlab);
-
-               case 72:        exp = remtilda( stralloc(&buffer[r1+1],bufptr - r1 - 1));  break;
-
-               case 73:  endlab = newlab;  
-                       break;
-
-               case 74:  errlab = newlab;  
-                       break;
-
-               case 75:  reflab = newlab;
-                       act(3,c,bufptr);
-                       break;
-
-               case 76:  r1 = bufptr;  break;
-
-               case 77:
-                       if (!counter)
-                       {
-                               act(111,c,bufptr);
-                               return(ABORT);
-                               }
-                       counter--;
-                       break;
-               /* generate nodes of all types */
-               case 111:               /* st. line code */
-                       stcode = remtilda(stralloc(&buffer[p3],endbuf - p3));
-                       recognize(STLNVX,flag);
-                       return(ABORT);
-
-               case 122:                       /* uncond. goto */
-                       recognize(ungo,flag);
-                       break;
-
-               case 123:                       /* assigned goto */
-                       act(72,c,bufptr);
-                       faterr("in parsing:\n","assigned goto must have list of labels","");
-
-               case 124:                       /* ass. goto, labels */
-                       recognize(ASGOVX, flag);
-                       break;
-
-               case 125:                       /* computed goto*/
-                       exp = remtilda( stralloc(&buffer[r1+1],bufptr - r1 - 1));
-                       recognize(COMPVX, flag);
-                       return(ABORT);
-
-               case 133:                       /* if() =  is a simple statement, so reset flag to 0 */
-                       flag = 0;
-                       act(111,c,bufptr);
-                       return(ABORT);
-
-               case 141:                       /* arith. if */
-                       recognize(arithif, 0);
-                       break;
-
-               case 150:                       /* label assignment */
-                       exp = remtilda( stralloc(&buffer[r1+1],bufptr - r1 - 1));
-                       recognize(ASVX, flag);
-                       break;
-
-               case 162:                       /*  do node */
-                       inc = remtilda(stralloc(&buffer[p1],endbuf - p1));
-                       recognize(DOVX, 0);
-                       break;
-
-               case 180:                       /* continue statement */
-                       recognize(contst, 0);
-                       break;
-
-               case 200:               /* function or subroutine statement */
-                       progtype = sub;
-                       nameline = begline;
-                       recognize(STLNVX,0);
-                       break;
-
-
-               case 210:               /* block data statement */
-                       progtype = blockdata;
-                       act(111,c,bufptr);
-                       return(ABORT);
-
-               case 300:                       /* return statement */
-                       recognize(RETVX,flag);
-                       break;
-
-
-               case 350:                       /* stop statement */
-                       recognize(STOPVX, flag);
-                       break;
-
-
-               case 400:                       /* end statement */
-                       if (progtype == sub)
-                               act(300, c, bufptr);
-                       else
-                               act(350, c, bufptr);
-                       return(endrt);
-
-               case 500:
-                       prerw = remtilda(stralloc(&buffer[p3],r1 - p3 + 1));
-                       postrw = remtilda(stralloc(&buffer[r2],endbuf - r2));
-                       if (reflab || endlab || errlab)  recognize(IOVX,flag);
-                       else recognize(STLNVX,flag);
-                       return(ABORT);
-
-               case 510:  r2 = bufptr;
-                       act(3,c,bufptr);
-                       act(500,c,bufptr);
-                       return(ABORT);
-
-               case 520:               r2 = bufptr;
-                       reflab = newlab;
-                       act(3,c,bufptr);
-                       act(500,c,bufptr);
-                       return(ABORT);
-
-
-               case 600:
-                       recognize(FMTVX,0);  return(ABORT);
-
-               case 700:
-                       stcode = remtilda(stralloc(&buffer[p3],endbuf - p3));
-                       recognize(entry,0);  return(ABORT);
-               /* error */
-               case 999:
-                       fprintf(stderr,"error: symbol '%c' should not occur as %d'th symbol of: \n%s\n",
-                               c,bufptr, buffer);
-                       return(ABORT);
-               }
-       return(nulls);
-       }
-
-
-
-struct lablist *makelab(x)
-long x;
-       {
-       struct lablist *p;
-       p = challoc (sizeof(*p));
-       p->labelt = x;
-       p->nxtlab = 0;
-       return(p);
-       }
-
-
-long label(i)
-int i;
-       {
-       struct lablist *j;
-       for (j = linelabs; i > 0; i--)
-               {
-               if (j == 0) return(0L);
-               j = j->nxtlab;
-               }
-       if (j)
-               return(j->labelt);
-       else
-               return(0L);
-       }
-
-
-freelabs()
-       {
-       struct lablist *j,*k;
-       j = linelabs;
-       while(j != 0)
-               {
-               k = j->nxtlab;
-               chfree(j,sizeof(*j));
-               j = k;
-               }
-       }
-
-
-stralloc(ad,n)                 /* allocate space, copy n chars from address ad, add '0' */
-int n; char *ad;
-       {
-       char *cp;
-       cp = galloc(n+1);
-       copycs(ad,cp,n);
-       return(cp);
-       }
-
-
-remtilda(s)                    /* change ~ to blank */
-char *s;
-       {
-       int i;
-       for (i = 0; s[i] != '\0'; i++)
-               if (s[i] == '~') s[i] = ' ';
-       return(s);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.hash.c b/.ref-Research-V7/usr/src/cmd/struct/1.hash.c
deleted file mode 100644 (file)
index db0847e..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-#include <stdio.h>
-#include "1.incl.h"
-#include "1.defs.h"
-#include"def.h"
-
-extern int match[], symclass[],  action[], newstate[];
-extern char symbol[];
-long *hashtab;
-int *value, *chain;
-
-extern FILE *infd;
-
-
-parse()
-       {int i,j,found,current, someread;
-       char c;
-
-       hash_init();
-       routinit();
-       line_init();
-
-       someread = 0;                   /* indicates haven't read part of a routine */
-
-       empseek(0);
-       endbuf = getline(&endline, &endchar, &endcom, & comchar);
-       if (progress && endbuf != -1) fprintf(stderr,"parsing\n");
-       while(endbuf != -1)                     /* getline returns -1 when no more input */
-               {
-               someread = 1;
-               if (progress > 0)
-                       {
-                       for (i = begline; i <= endline; i++)
-                               if (!(i % progress)) fprintf(stderr,"parsing line %d\n",i);
-                       }
-               current = 0;
-               for (i = 0; i < endbuf; i++)
-                       {
-
-                       c = buffer[i];
-                       if(c != '~') 
-                               {
-                               found = 0;
-                               if ( (current < 0 || current >= snum) && current != ABORT)
-                                       {
-                                       strerr("in parsing:","","");
-                                       fprintf(stderr,"line %d of file, parser in invalid state", begline,current);
-                                       fprintf(stderr,"treating it as straight line code\n");
-                                       current = ABORT;
-                                       }
-                               else
-                                       for (j = match[current];  j < match[current + 1]; j++)
-                                               {
-                                               if ((symclass[j] == 0 && c == symbol[j]) ||
-                                                   (symclass[j] != 0 && classmatch(c,symclass[j]) ))
-                                                       {found = 1;  break;
-                                                       }
-                                               }
-                               if (!found)
-                                       {
-                                       error("in syntax:","","");
-                                       fprintf(stderr,"between lines %d and %d of file\n",begline, endline);
-                                       if (debug)
-                                       fprintf(stderr,"symbol '%c' does not match entries for state %d\n",c,current);
-                                       fprintf(stderr,"treating it as straight line code\n");
-                                       current = ABORT;
-                                       }
-                               else if (!action[j])  
-                                       current = newstate[j];
-                               else
-                                       {
-                                       current = act(action[j],c,i);
-                                       if (current == nulls)  current = newstate[j];
-                                       }
-                               if (current == ABORT)  break;
-                               if (current == endrt)
-                                       {
-                                       return(1);
-                                       }
-                               }
-                       }
-               line_init();
-               endbuf = getline(&endline, &endchar, &endcom,&comchar);
-               }
-       if (someread) return(1);
-       else return(0);
-       }
-
-
-hash_init()
-       {
-       int i;
-       hashtab = challoc(sizeof(*hashtab) * maxhash);
-       chain = challoc(sizeof(*chain) * maxhash);
-       value = challoc(sizeof(*value) * maxhash);
-       for (i = 0; i < maxhash; i++)
-               {
-               hashtab[i] = -1L;
-               value[i] = -2;
-               chain[i] = 0;
-               }
-       }
-
-
-hash_check()
-       {
-       int i;
-       for (i = 0; i < maxhash; ++i)
-               if (value[i] == -2 && hashtab[i] != -1L)
-                       {
-                       error("in syntax; label used but does not appear as statement label:","","");
-                       fprintf(stderr,"%D\n",hashtab[i]);
-                       routerr = 1;
-                       }
-       }
-
-hash_free()
-       {
-       chfree(hashtab,sizeof(*hashtab) * maxhash);
-       hashtab = 0;
-       chfree(chain,sizeof(*chain) * maxhash);
-       chain = 0;
-       chfree(value,sizeof(*value) * maxhash);
-       value = 0;
-       }
-hash(x)
-long x;
-       {
-       int quo, rem, hcount, temp;
-
-       ASSERT(x >= 0L, hash);
-       quo = x/maxhash;
-       rem = x - (quo * maxhash);
-       if (quo == 0)  quo = 1;
-
-       temp = rem;
-       for (hcount=0; (hashtab[temp] != -1L) && (hashtab[temp] != x) && (hcount<maxhash); hcount++)
-               temp = (temp + quo)%maxhash;
-       if(hcount>=maxhash) faterr("hash table overflow - too many labels","","");
-       hashtab[temp] = x;
-       return(temp);
-       }
-
-addref(x,ptr)                          /* put ptr in chain for x or assign value of x to *ptr */
-long x;
-int *ptr;
-       {
-       int index;
-       index = hash(x);
-
-       if (value[index]  == -1)
-               {                       /* x already assigned value */
-               *ptr = chain[index];
-               return;
-               }
-       
-       /* add ptr to chain */
-       
-       if (chain[index] == 0)
-               *ptr = 0;
-       else
-               *ptr = chain[index];
-       chain[index] = ptr;
-       }
-
-fixvalue (x,ptr)
-long x;
-int ptr;
-       {
-       int *temp1, *temp2, index, temp0;
-       index = hash(x);
-
-       while (index != -2)
-               {                       /* trace chain of linked labels */
-
-               if (value[index]  == -1)
-                       {
-                       error("in syntax:  ","","");
-                       fprintf(stderr,"attempt to redefine value of label %D between lines %d and %d\n",
-                               x,begline,endline);
-                       routerr = 1;
-                       return;
-                       }
-       
-               temp1 = &chain[index];          /* trace chain for each label */
-               while (temp1 != 0)
-                       {
-                       temp2 = *temp1;
-                       *temp1 = ptr;
-                       temp1 = temp2;
-                       }
-               temp0 = index;
-               index = value[index];
-               value[temp0] = -1;
-               }
-       }
-
-connect(x,y)
-long x,y;
-       {
-       int *temp, index, temp2;
-       index = hash(x);
-
-       if (value[index] == -1)
-               fixvalue(y, chain[index]);
-       else
-               {
-               if (y == implicit)
-               {               /* attach implicit chain to x chain */
-               temp = &chain[index];
-       
-               while (*temp != 0)
-                       temp = *temp;
-       
-               *temp = chain[hash(y)];
-               }
-               temp2 = index;          /* attach y linked labels to x linked labels */
-               while (value[temp2] >= 0)
-                       temp2 = value[temp2];
-               if (y == implicit)
-                       value[temp2] = value[hash(y)];
-               else
-                       value[temp2] = hash(y);
-               }
-       if (y == implicit)  clear(y);
-       }
-       
-       
-clear(x)
-long x;
-       {
-       int index;
-       index = hash(x);
-       value[index] = -2;
-       chain[index] = 0;
-       hashtab[index] = -1L;
-       }
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.incl.h b/.ref-Research-V7/usr/src/cmd/struct/1.incl.h
deleted file mode 100644 (file)
index 1ff82a9..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#define maxlsw         10      /* max number of switches and labels per statement */
-#define implicit 0L            /* "label" of following line so all flow can be treated as jump to label */
-struct lablist {long labelt;  struct lablist *nxtlab; };
-extern struct lablist *endlab, *errlab, *reflab, *linelabs, *newlab;
-extern long label();
-
-extern int routbeg;                    /* line number of first line of routine */
-extern int nameline;                   /* line number of function/subroutine st., if any */
-extern int stflag;             /* determines whether at beginning or middle of block of straight line code */
-
-
-
-extern char buffer[];
-extern int endbuf;
-
-extern int   nlabs, lswnum, swptr, flag,
-        counter, p1, p3, begline, endline, r1,r2, endcom;
-extern long begchar, endchar, comchar;
-
-
-/* statement types not associated with actual node types */
-#define contst         -1
-#define ungo           -2
-#define arithif                -3
-#define readst         -8
-#define writest                -9
-#define entry  -10
-
-
-extern char *pred, *inc, *prerw, *postrw, *exp, *stcode;
-
-#define maxdo  20      /* max nesting of do loops */
-extern long dostack[maxdo];            /* labels of do nodes */
-extern int doloc[maxdo];               /* loc of do node */
-extern int doptr;
-
-
-extern struct list *FMTLST;            /* list of FMTVX's generated */
-extern struct list *ENTLST;            /* list of STLNVX nodes corresponding to entry statements */
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.init.c b/.ref-Research-V7/usr/src/cmd/struct/1.init.c
deleted file mode 100644 (file)
index 5f907e3..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <stdio.h>
-#include "1.defs.h"
-#include  "1.incl.h"
-#include "def.h"
-
-
-prog_init()
-       {
-       endline = endcom = 0;   endchar = -1;
-       comchar = -1;
-       graph = challoc(sizeof(*graph) * maxnode);
-       }
-
-routinit()
-       {
-       graf_init();
-       progtype = !sub;
-       routbeg = endline + 1;
-       rtnbeg = endchar + 1;
-       nameline = 0;
-       stflag = UNDEFINED;
-       }
-line_init()
-       {
-       struct lablist *makelab();
-       freelabs();
-       newlab = linelabs = makelab(0L);
-       flag = counter = nlabs = lswnum = swptr = p1 = 0;
-       p3 = 5;
-       endcom = endline;
-       comchar = endchar;
-       begline = endline + 1;  begchar = endchar + 1;
-       reflab = endlab = errlab = 0;
-       r1 = r2 = 0;
-       }
-graf_init()
-       {
-       int arctype[3];  long arclab[3];
-       nodenum = 0;
-       doptr = UNDEFINED;
-       retvert = stopvert = UNDEFINED;
-       ENTLST = FMTLST = 0;
-
-       
-       arctype[0] = -2;  arclab[0] = implicit;
-       START = makenode(DUMVX,FALSE,FALSE,implicit,1,arctype,arclab);
-       }
-
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.line.c b/.ref-Research-V7/usr/src/cmd/struct/1.line.c
deleted file mode 100644 (file)
index 7cc98e9..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#include <stdio.h>
-#
-#include "def.h"
-#define bufsize 1601
-char buffer[bufsize];
-int bufcount;
-extern int errflag;
-long stchars;                  /* counts number of chars at most recent \n read */
-#ifndef unix
-long ostchars;
-extern long ftell();
-#endif
-int newline;                   /* counts number of lines read so far in file */
-extern int rdfree(), comfree(),labfree(), contfree();
-extern int rdstand(), comstand(), labstand(), contstand();
-extern int (*rline[])();
-extern int (*comment[])();
-extern int (*getlabel[])();
-extern int (*chkcont[])();
-
-
-
-flush()
-       {bufcount = 0; }
-
-addchar(c)
-       {
-       buffer[bufcount++] = c;
-       }
-
-getline(lastline,lastchar,linecom,charcom)
-int *lastline, *linecom;
-long *lastchar, *charcom;
-                               /* set *lastline to number of last line of statement,
-                               set *lastchar to number of last char of statement,
-                               set *linecom to number of last line of comment preceding statement */
-       {
-
-       int i;
-       flush();
-       while ( unput1(input1()) != EOF)
-               {
-               while ( (*comment[inputform])(0)  || blankline() )
-                       {
-                       (*rline[inputform])(addchar);
-                       flush();
-                       }
-               *linecom = newline;
-                       /* set charcom to number of last char of comment, starting at 0
-                                       if at start of file and no comment, will be -1  */
-               *charcom = stchars - 1;
-               if (unput1(input1()) == EOF)  break;
-               (*getlabel[inputform])(addchar);
-               (*rline[inputform])(addchar);
-       
-               while ( blankline() || ( !(*comment[inputform])(0) &&  (*chkcont[inputform])() ))
-                       (*rline[inputform])(addchar);
-       
-               addchar('\0');
-               *lastline = newline;
-               *lastchar = stchars - 1;
-if (debug == 40)
-fprintf(stderr,"line %d; bufcount: %d\n",newline,bufcount);
-       
-               for (i = 5; i < bufcount; ++i)
-                       if (buffer[i] == ' ' || buffer[i] == '\t' || buffer[i] == '\n')
-                               buffer[i] = '~';
-               return(bufcount);
-               }
-       return(-1);
-       }
-
-
-int linechars;                 /* counts number of chars read so far in current line */
-long newchar;                  /* counts number of chars read so far in file */
-
-
-input1()
-       {
-       static int c;
-       if (c == '\n') linechars = 0;
-       c = inchar();
-       ++linechars;
-       ++newchar;
-       if (c == '\n')
-               {
-               ++newline;
-#ifdef unix
-               stchars = newchar; 
-#else
-               ostchars=stchars; stchars=ftell(infd);
-#endif
-               }
-       return(c);
-       }
-
-unput1(c)
-       {
-       --linechars;
-       --newchar;
-       unchar(c);
-       if (c == '\n')
-               {
-#ifdef unix
-               stchars = newchar; 
-#else
-               stchars=ostchars;
-#endif
-               --newline;
-               }
-       return(c);
-       }
-
-
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.main.c b/.ref-Research-V7/usr/src/cmd/struct/1.main.c
deleted file mode 100644 (file)
index 40e7848..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-int endbuf;
-
-mkgraph()
-       {
-       if (!parse())
-               return(FALSE);
-       hash_check();
-       hash_free();
-       fingraph();
-       return(TRUE);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.node.c b/.ref-Research-V7/usr/src/cmd/struct/1.node.c
deleted file mode 100644 (file)
index 58870f8..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "1.incl.h"
-
-makenode(type,addimp,addcom, labe,arcnum,arctype,arclab)
-LOGICAL addimp,addcom;
-int type, arctype[], arcnum;
-long arclab[], labe;
-       {
-       int i;
-       VERT num;
-       
-       ASSERT(arcsper[type] < 0 || arcnum == arcsper[type], makenode);
-       num = create(type,arcnum);
-       
-       if (addimp)  fiximp(num,labe);
-       
-       for (i = 0; i < arcnum; ++i)
-               {
-               if (arctype[i] == -2)
-                       addref(arclab[i],&ARC(num,i));
-               else
-                       ARC(num,i) = arctype[i];
-               }
-       
-       
-       if (hascom[type] )
-               {
-               if (!addcom || endcom < begline)
-                       BEGCOM(num) = UNDEFINED;
-               else{
-                       BEGCOM(num) = begchar - rtnbeg;
-                       if((unsigned)(BEGCOM(num))!=begchar-rtnbeg)
-                               faterr("program too long","","");
-                       }
-               }
-       return(num);
-       }
-
-
-
-
-
-fiximp(num,labe)               /* fix implicit links, check nesting */
-VERT num;
-long labe;
-       {
-       fixvalue(implicit, num);                /* set implicit links to this node */
-       clear(implicit);
-       if(labe != implicit) fixvalue(labe, num);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.recog.c b/.ref-Research-V7/usr/src/cmd/struct/1.recog.c
deleted file mode 100644 (file)
index 54f552b..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-#include <stdio.h>
-#include "1.incl.h"
-#include "def.h"
-
-
-recognize(type, ifflag)                        /* if ifflag = 1, statement is if()type; otherwise is type */
-int type, ifflag;                              /* do whatever is needed for this statement */
-       {
-       int *arctype,   i,   sp;
-       VERT num, num1, nest, loophead;
-       extern long label();
-       long *arclab;
-       if (nlabs > 3) sp = nlabs; else sp = 3;
-       arctype = challoc(sizeof(*arctype) * sp);  arclab = challoc(sizeof(*arclab) * sp);
-       for( i=0; i < endbuf; i++)  {if (buffer[i] == '~')  buffer[i] = ' ';}
-       loophead = nest = innerdo(label(0));
-       if (DEFINED(nest))
-               {
-                       /* this statement is last line of do loop */
-               nest = ARC(nest,0);             /* nest is ITERVX of the innermost do ending here */
-               }
-
-
-       if (ifflag)
-               {
-               if (type == ungo)
-                       {
-                       arctype[0] = -2;
-                       arclab[0] = label(1);
-                       }
-               else
-                       arctype[0] = 0;
-
-               arctype[1] = (nest >= 0) ? nest : -2;
-               arclab[1] = implicit;
-               num1 = makenode(IFVX,TRUE,TRUE,label(0),2,arctype,arclab);
-               PRED(num1) = pred;
-               }
-
-       arctype[0] = (nest >= 0) ? nest : -2;
-       arclab[0] = implicit;
-
-       switch(type)
-               {
-               case ungo:
-                       if (!ifflag)
-                               {
-                               connect(label(1),implicit);
-                               if (label(0) != implicit)  connect(label(1),label(0));
-                               }
-                       break;
-               case RETVX:
-               case STOPVX:
-                       if (type == RETVX)
-                               {
-                               if (retvert == UNDEFINED)
-                                       retvert = makenode(type,FALSE,FALSE,implicit,0,arctype,arclab);
-                               num = retvert;
-                               }
-                       else
-                               {
-                               if (stopvert == UNDEFINED)
-                                       stopvert = makenode(type,FALSE,FALSE,implicit,0,arctype,arclab);
-                               num = stopvert;
-                               }
-                       if (!ifflag)
-                               {
-                               fixvalue(implicit,num);
-                               clear(implicit);
-                               if (label(0) != implicit) fixvalue(label(0),num);
-                               }
-                       break;
-
-
-               case contst:
-                       contin(label(0),loophead);
-                       break;
-
-               case FMTVX:
-                       num = makenode(FMTVX,FALSE,TRUE,implicit,0,arctype,arclab);
-                       BEGCODE(num) = comchar + 1 - rtnbeg;
-                       if((unsigned)(BEGCODE(num))!=comchar+1-rtnbeg)
-                               faterr("program too long","","");
-                       ONDISK(num) = endline - endcom;
-                       if (label(0) != implicit)
-                               fixvalue(label(0),num);
-                       FMTLST = append(num,FMTLST);
-                       break;
-               case STLNVX:
-                       if (DEFINED(stflag) && !ifflag && (label(0) == implicit))
-                               {
-                               ++CODELINES(stflag);
-                               ONDISK(stflag) += endline - begline + 1;
-                               }
-                       else
-                               {
-                               num = makenode(STLNVX,!ifflag,!ifflag,label(0),1,arctype,arclab);
-                               if (!ifflag)
-                                       {
-                                       stflag = num;
-                                       BEGCODE(num) = comchar + 1 - rtnbeg;
-                                       if((unsigned)(BEGCODE(num))!=comchar+1-rtnbeg)
-                                               faterr("program too long","","");
-                                       ONDISK(num) = endline - endcom;
-                                       CODELINES(num) = 1;
-                                       }
-                               else
-                                       {
-                                       BEGCODE(num) = stcode;
-                                       ONDISK(num) = FALSE;
-                                       CODELINES(num) = 1;
-                                       }
-                               }
-                       break;
-
-               case DOVX:
-                       if (arctype[0] != -2) 
-                               {
-                               error("illegal do range, ","","");
-                               fprintf(stderr," between lines %d and %d\n",begline, endline);
-                               exit(1);
-                               }
-                       arctype[1] = UNDEFINED;
-                       num1 = makenode(DOVX,TRUE,TRUE,label(0),2,arctype,arclab);
-                       if (++doptr >= maxdo)
-                               {
-                               faterr("in parsing:\n","do loops nested deeper than allowed","");
-                               }
-                       dostack[doptr] = label(1);
-                       doloc[doptr] = num1;                    /* stack link to node after loop */
-                       INC(num1) = inc;
-                       num = makenode(ITERVX,TRUE,FALSE,implicit,1,arctype,arclab);
-                       ARC(num1,0) = num;
-                       FATH(num) = UNDEFINED;  /* number of DOVX can change so leave UNDEFINED until later */
-                       break;
-               case arithif:
-                       if (label(1) == label(2) || label(1) == 0L)
-                               makeif(1,label(0),concat(pred," > 0"),label(3),label(2));
-                       else if (label(1) == label(3) || label(3) == 0L)
-                               makeif(1,label(0),concat(pred," == 0"),label(2),label(1));
-                       else if (label(2) == label(3) || label(2) == 0L)
-                               makeif(1,label(0),concat(pred," < 0"),label(1),label(3));
-                       else
-                               {
-                               makeif(1,label(0),concat(pred," < 0"),label(1),implicit);
-                               makeif(1,implicit,concat(pred," == 0"),label(2),label(3));
-                               }
-                       break;
-
-               case IOVX:
-                       if (endlab)
-                               {
-                               arctype[1] = -2;
-                               arclab[1] = endlab->labelt;
-                               }
-                       else
-                               arctype[1] = UNDEFINED;
-                       if (errlab)
-                               {
-                               arctype[2] = -2;
-                               arclab[2] = errlab->labelt;
-                               }
-                       else
-                               arctype[2] = UNDEFINED;
-                       num = makenode(IOVX,!ifflag,!ifflag,label(0),3,arctype,arclab);
-                       PRERW(num) = prerw;
-                       POSTRW(num) = postrw;
-                       if (reflab)
-                               addref(reflab->labelt, &FMTREF(num));
-                       else
-                               FMTREF(num) = UNDEFINED;
-                       break;
-
-               case COMPVX:
-                               if (intcase)
-                                       {
-                                       num = compcase(ifflag);
-                                       break;
-                                       }
-               case ASGOVX:
-                       for (i = 0; i < nlabs - 1; i++)
-                               {
-                               arctype[i] = -2;
-                               arclab[i] = label(nlabs-i-1);
-                               }
-                       num = makenode(type,!ifflag,!ifflag,label(0),nlabs - 1, arctype, arclab);
-                       EXP(num) = exp;
-                       break;
-               case ASVX:
-                       num = makenode(ASVX,!ifflag,!ifflag,label(0),1,arctype,arclab);
-                       EXP(num) = exp;
-                       addref(label(1),&LABREF(num));
-                       break;
-               case entry:
-                       num = makenode(STLNVX,FALSE,TRUE,label(0),1,arctype,arclab);
-                       BEGCODE(num) = comchar + 1 - rtnbeg;
-                       if((unsigned)(BEGCODE(num))!=comchar+1-rtnbeg)
-                               faterr("program too long","","");
-                       ONDISK(num) = endline - endcom;
-                       CODELINES(num) = 1;
-                       ENTLST = append(num,ENTLST);
-                       break;
-               }
-       if (ifflag && type != ungo)
-               {
-               ARC(num1,0) = num;
-               }
-       if (DEFINED(loophead))  nesteddo(label(0), loophead);
-       if (ifflag || DEFINED(loophead) || type != STLNVX)  stflag = UNDEFINED;
-
-
-       chfree(arctype,sizeof(*arctype) * sp);  chfree(arclab,sizeof(*arclab) * sp);
-       if (debug)
-               {
-               fprintf(debfd,"line %d:  ", begline);
-               if (ifflag) fprintf(debfd,"if()  ");
-               switch(type)
-                       {case RETVX:    fprintf(debfd,"return");        break;
-                       case STOPVX:    fprintf(debfd,"stop");  break;
-                       case contst:    fprintf(debfd,"continue");      break;
-                       case ungo:      fprintf(debfd,"uncond. goto");  break;
-                       case COMPVX:    fprintf(debfd,"comp. goto");    break;
-                       case ASGOVX:    fprintf(debfd,"ass. goto, labs");       break;
-                       case ASVX:      fprintf(debfd,"label assignment");      break;
-                       case STLNVX:    fprintf(debfd,"simple statement");      break;
-                       case arithif:   fprintf(debfd,"arith if");      break;
-                       case DOVX:      fprintf(debfd,"do ");   break;
-                       case FMTVX:  fprintf(debfd,"format st");  break;
-                       case IOVX:  fprintf(debfd,"IOVX statement ");  break;
-case entry:    fprintf(debfd,"entry statement ");  break;
-                       }
-               fprintf(debfd,"\n%s\n", buffer);
-               }
-       }
-
-
-
-makeif(first,labe,test,arc1,arc2)                      /* construct IFVX with arcs to labels arc1,arc2 */
-int first;
-long labe, arc1,arc2;
-char *test;
-       {
-       int num, arctype[2];
-       long arclab[2];
-       arctype[0] = arctype[1] = -2;
-       arclab[0] = arc1;
-       arclab[1] = arc2;
-       num = makenode(IFVX,first,first,labe,2,arctype,arclab);
-       PRED(num) = test;
-       return(num);
-       }
-
-
-innerdo(labe)          /* return number of DOVX associated with labe, or UNDEFINED */
-long labe;
-       {
-       if (DEFINED(doptr))
-               {if (dostack[doptr] == labe)
-                       return(doloc[doptr--]);
-               }
-       return(UNDEFINED);
-       }
-
-
-
-
-contin(labe,nest)              /* handle continue statements */
-long labe;
-int nest;
-       {
-       VERT y;
-       
-       if (!DEFINED(nest))
-               {               /* not nested */
-               if (labe != implicit) connect(implicit,labe);   /* labe pts to next node */
-               }
-       else
-               {               /* nested */
-               y = ARC(nest,0);
-               fixvalue(labe,y);                       /* labe pts to ITERVX */
-               fixvalue(implicit, y);          /* implicit links pt to ITERVX */
-               clear(implicit);
-               }
-       }
-
-
-
-
-nesteddo(labe,v)
-                       /* if multiple do's end on same label, add arc from inner DOVX
-                               to enclosing DOVX;
-                       add implicit link out of outermost DOVX with this label */
-long labe;
-int v;
-       {
-       
-       while (DEFINED(doptr) && dostack[doptr] == labe)
-               {
-               ARC(v,1) = ARC(doloc[doptr],0);         /*set inner DOVX to point to outer ITERVX */
-               v = doloc[doptr--];
-               }
-       addref(implicit, &ARC(v,1));
-       }
-
-
-
-compcase(ifflag)               /* turn computed goto into case statement */
-LOGICAL ifflag;
-       {
-       int *arctype, i, num, d, arct;
-       extern long label();
-       long *arclab;
-       char *str;
-       arctype = challoc(sizeof(*arctype) * nlabs);
-       arclab = challoc (sizeof(*arclab) * nlabs);
-
-       d = distinct(linelabs->nxtlab,arctype,arclab,nlabs-1);
-                       /* puts distinct labels in arclab, count of each in arctype */
-       arct = -2;
-       for (i = 0; i < d; ++i)
-               arctype[i] = makenode(ICASVX,FALSE,FALSE,implicit,1,&arct,&arclab[i]);
-       num = makenode(SWCHVX,!ifflag,!ifflag,label(0),d,arctype,arclab);
-       EXP(num) = exp;
-
-       str = challoc(6*nlabs); /* 5 digits + , or \0 per label */
-       for (i = 0; i < d; ++i)         /* construct list of values for each label */
-               EXP(arctype[i]) = stralloc(str,accum(str,linelabs->nxtlab,arclab[i]));
-       chfree(str,6*nlabs);
-       chfree(arctype,sizeof(*arctype) * nlabs);  chfree(arclab,sizeof(*arclab) * nlabs);
-       return(num);
-       }
-
-
-accum(str,vlist,f)             /* build string of indices in compnode  corr. to label f */
-char *str;  long f;  struct lablist *vlist;
-       {
-       int s,j;  struct lablist  *p;
-
-       s = 0;
-       j = 1;
-       for (p = vlist; p ; p = p->nxtlab)              /* search for occurrences of f */
-               {
-               if (p->labelt ==f)
-                       {
-                       if (s)
-                               {
-                               str[s] = ',';
-                               ++s;
-                               }
-                       sprintf(&str[s],"%d",j);
-                       while (str[s] != '\0') ++s;
-                       }
-               ++j;
-               }
-       return(s+1);
-       }
-
-
-distinct(vlist,count,dlist,size)               /* make dlist into list of distinct labels in vlist */
-struct lablist *vlist;  long dlist[];          /*count[] gets count of each label;  d distinct labels */
-int count[],size;
-       {int d,i;
-       d = 0;
-       for(i = 0; i <= size; i++)  count[i] = 0;
-
-       for (;vlist && vlist->labelt != 0L; vlist = vlist ->nxtlab)
-               {
-               for (i = 0; ;i++)
-                       {
-                       if (i == d)  dlist[d++] = vlist->labelt;
-                       if (dlist[i] == vlist->labelt)
-                               {
-                               ++count[i];  break;
-                               }
-                       }
-               }
-       return(d);
-       }
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/struct/1.tables.c b/.ref-Research-V7/usr/src/cmd/struct/1.tables.c
deleted file mode 100644 (file)
index 490456e..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-#include <stdio.h>
-
-int match[146]
-                       = {
-                          0,   1,   2,   3,   4,   5,  19,  21,
-                         23,  25,  29,  32,  36,  38,  42,  44,
-                         46,  50,  52,  56,  59,  61,  65,  74,
-                         77,  81,  83,  85,  87,  89,  91,  93,
-                         95,  97,  99, 102, 105, 108, 114, 116,
-                        118, 120, 122, 124, 126, 129, 131, 134,
-                        136, 139, 142, 144, 147, 149, 151, 153,
-                        155, 157, 159, 161, 163, 165, 167, 169,
-                        171, 174, 176, 178, 180, 182, 184, 186,
-                        188, 190, 192, 194, 196, 198, 200, 202,
-                        204, 206, 208, 210, 212, 214, 216, 218,
-                        221, 223, 225, 227, 229, 231, 233, 235,
-                        237, 239, 241, 243, 245, 247, 249, 251,
-                        254, 256, 258, 260, 262, 264, 266, 268,
-                        270, 272, 274, 276, 278, 280, 283, 287,
-                        292, 298, 303, 307, 311, 316, 320, 324,
-                        327, 329, 331, 333, 335, 337, 339, 341,
-                        343, 345, 347, 349, 351, 353, 355, 356,
-                        357, 359
-                       };
-
-int symclass[358]
-                       = {
-                          1,   1,   1,   1,   1,   0,   0,   0,
-                          0,   0,   0,   0,   0,   0,   0,   0,
-                          0,   0,   1,   0,   1,   0,   1,   0,
-                          1,   2,   3,   0,   1,   2,   0,   1,
-                          4,   0,   0,   1,   0,   1,   2,   0,
-                          0,   1,   0,   1,   2,   1,   2,   0,
-                          0,   1,   0,   1,   4,   5,   0,   1,
-                          0,   0,   1,   0,   1,   0,   0,   0,
-                          1,   0,   0,   0,   0,   0,   0,   0,
-                          2,   1,   2,   0,   1,   2,   0,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   2,   0,   1,   2,   3,
-                          1,   4,   0,   1,   4,   0,   0,   0,
-                          5,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   2,   1,   2,   0,
-                          1,   0,   1,   4,   0,   1,   0,   1,
-                          0,   0,   1,   0,   0,   1,   0,   1,
-                          0,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   1,   0,   1,   0,   1,   0,   1,
-                          0,   2,   1,   2,   0,   0,   1,   0,
-                          0,   0,   0,   1,   2,   0,   0,   0,
-                          0,   1,   0,   0,   0,   0,   1,   0,
-                          0,   0,   1,   0,   0,   0,   1,   2,
-                          0,   0,   0,   1,   0,   0,   0,   1,
-                          0,   0,   0,   1,   0,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   1,   0,   1,   0,
-                          1,   0,   1,   0,   0,   0
-                       };
-
-char symbol[358]
-                       = {
-                           '_',    '_',    '_',    '_',    '_',    'i',    'd',    'g',
-                           'a',    'r',    'w',    'c',    'l',    's',    'e',    'p',
-                           'f',    'b',    '_',    'o',    '_',    't',    '_',    'o',
-                           '_',    '_',    '_',    '(',    '_',    '_',    '\0',    '_',
-                           '_',    ',',    '\0',    '_',    '(',    '_',    '_',    ',',
-                           ')',    '_',    '\0',    '_',    '_',    '_',    '_',    ',',
-                           ')',    '_',    ',',    '_',    '_',    '_',    '\0',    '_',
-                           'f',    'n',    '_',    '(',    '_',    '(',    ')',    '\0',
-                           '_',    '=',    'g',    'a',    'r',    'p',    'w',    's',
-                           '_',    '_',    '_',    ',',    '_',    '_',    ',',    '\0',
-                           '_',    'o',    '_',    'n',    '_',    't',    '_',    'i',
-                           '_',    'n',    '_',    'u',    '_',    'e',    '_',    '\0',
-                           '_',    'o',    '_',    '_',    'u',    '_',    '_',    '_',
-                           '_',    '_',    '=',    '_',    '_',    '(',    ')',    ',',
-                           '_',    '_',    's',    '_',    's',    '_',    'i',    '_',
-                           'g',    '_',    'n',    '_',    '_',    '_',    '_',    't',
-                           '_',    'o',    '_',    '_',    '\0',    '_',    'e',    '_',
-                           'a',    't',    '_',    'l',    'd',    '_',    'f',    '_',
-                           'u',    'o',    '_',    'n',    '_',    'c',    '_',    't',
-                           '_',    'i',    '_',    'o',    '_',    'n',    '_',    't',
-                           '_',    'e',    '_',    'g',    '_',    'e',    '_',    'r',
-                           '_',    'o',    '_',    'm',    'n',    '_',    'p',    '_',
-                           'l',    '_',    'e',    '_',    'x',    '_',    'b',    '_',
-                           'l',    '_',    'e',    '_',    'p',    '_',    'r',    '_',
-                           'e',    '_',    'c',    '_',    'i',    '_',    's',    '_',
-                           'i',    '_',    'o',    '_',    'n',    '_',    'o',    '_',
-                           'g',    '_',    'i',    '_',    'c',    '_',    'a',    '_',
-                           'l',    '_',    't',    'u',    '_',    'o',    '_',    'p',
-                           '_',    'b',    '_',    'r',    '_',    'o',    '_',    't',
-                           '_',    'i',    '_',    'n',    '_',    'e',    '_',    'e',
-                           '_',    't',    '_',    'u',    '_',    'r',    '_',    'n',
-                           '_',    'n',    '_',    'd',    't',    '_',    '\0',    '_',
-                           'r',    '_',    'y',    '_',    'r',    '_',    'm',    '_',
-                           'a',    '_',    't',    '_',    '(',    '_',    'r',    '_',
-                           'i',    '_',    't',    '_',    'e',    '_',    '(',    '_',
-                           '(',    '_',    '_',    '_',    ',',    '\0',    '_',    '(',
-                           ')',    ',',    '\0',    '_',    '_',    'e',    ',',    '\0',
-                           ')',    '_',    'n',    'r',    ')',    '\0',    '_',    'd',
-                           ')',    '\0',    '_',    '=',    ')',    '\0',    '_',    '_',
-                           ',',    ')',    '\0',    '_',    'r',    ')',    '\0',    '_',
-                           '=',    ')',    '\0',    '_',    'r',    'u',    '_',    'i',
-                           '_',    'n',    '_',    't',    '_',    'n',    '_',    'c',
-                           '_',    'h',    '_',    'l',    '_',    'o',    '_',    'c',
-                           '_',    'k',    '_',    'd',    '_',    'a',    '_',    't',
-                           '_',    'a',    '_',    '_',    '_',    '_'
-                       };
-
-int action[358]
-                       = {
-                             1,      1,      1,      1,      1,      3,      3,      3,
-                             3,      3,      3,      3,      3,      3,      3,      3,
-                             3,      3,    111,      0,    111,      0,    111,     76,
-                           111,      1,      0,      0,    111,      1,    122,    111,
-                             0,     72,    123,    111,      0,    111,      1,      3,
-                             3,    111,    124,    111,      1,    111,      1,      3,
-                             3,    111,     76,    111,      0,      0,    125,    111,
-                             0,      0,    111,     45,    111,     30,     31,    111,
-                             0,    133,      0,      0,      0,      0,      0,      0,
-                             1,    111,      1,      3,    111,      1,      3,    141,
-                           111,      0,    111,      0,    111,      0,    111,      0,
-                           111,      0,    111,      0,    111,      0,    111,    180,
-                           111,      0,    111,      1,      0,    111,      1,     61,
-                           111,      0,      0,    111,      0,     62,     63,     64,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,    111,      0,    111,      1,    111,      1,      3,
-                           111,     76,    111,      0,    150,    111,      0,    111,
-                             0,      0,    111,      0,     76,    111,      0,    111,
-                             0,      0,    111,      0,    111,      0,    111,      0,
-                           111,      0,    111,      0,    111,    200,    111,      0,
-                           111,      0,    111,      0,    111,      0,    111,      0,
-                           111,      0,    111,      0,      0,    111,      0,    111,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,    111,      0,      0,    111,      0,    111,    350,
-                           111,      0,    111,      0,    111,      0,    111,      0,
-                           111,      0,    111,      0,    111,    200,    111,      0,
-                           111,      0,    111,      0,    111,      0,    111,    300,
-                           111,      0,    111,      0,      0,    111,    400,    111,
-                             0,    111,    700,    111,      0,    111,      0,    111,
-                             0,    111,      0,    111,    600,    111,      0,    111,
-                             0,    111,      0,    111,      0,    111,      0,    111,
-                             0,      1,    111,      1,    520,    520,    111,     62,
-                            77,     70,    111,      0,      1,      0,     75,    111,
-                           520,      0,      0,      0,    510,    111,      0,      0,
-                           510,    111,      0,     73,    510,    111,      0,      1,
-                             3,    510,    111,      0,      0,    510,    111,      0,
-                            74,    510,    111,      0,      0,      0,    111,      0,
-                           111,      0,    111,     76,    111,      0,    111,      0,
-                           111,     76,    111,      0,    111,      0,    111,      0,
-                           111,      0,    111,      0,    111,      0,    111,      0,
-                           111,    210,    111,      0,      0,      0
-                       };
-
-int newstate[358]
-                       = {
-                          1,   2,   3,   4,   5,  19,  33,   6,
-                         38,  47, 112,  63,  81,  87, 102, 127,
-                         51, 134, 142,   7, 142,   8,  -5,   9,
-                         -5,  10,  11,  15,  -5,  10, 142,  -5,
-                         11,  12, 142,  -5,  13,  -5,  13,  13,
-                         14,  -5, 142,  -5,  16, 142,  16,  15,
-                         17, 142,  18, 142,  18,  18, 142,  -5,
-                         20,  58, 142,  21,  -5,  21,  -5,  -5,
-                         21, 142,   6,  38,  47, 127, 112,  87,
-                         23, 142,  23,  24, 142,  24,  24, 142,
-                         -5,  26,  -5,  27,  -5,  28,  -5,  29,
-                         -5,  30,  -5,  31,  -5,  32,  -5, 142,
-                        142,  34,  -5,  35,  69,  -5,  35,  36,
-                         -5,  36,  37,  -5,  37,  37,  37,  37,
-                         37,  -5,  39,  -5,  40,  -5,  41,  -5,
-                         42,  -5,  43,  -5,  44, 142,  44,  45,
-                        142,  46,  -5,  46, 142,  -5,  48, 142,
-                         49,  99, 142,  50, 117, 142,  51, 142,
-                         52, 107, 142,  53, 142,  54, 142,  55,
-                        142,  56, 142,  57, 142, 142, 142,  59,
-                        142,  60, 142,  61, 142,  62, 142,  50,
-                        142,  64, 142,  65,  27, 142,  66, 142,
-                         67, 142,  68, 142,  50, 142,  70, 142,
-                         71, 142,  72, 142,  73, 142,  74, 142,
-                         75, 142,  76, 142,  77, 142,  78, 142,
-                         79, 142,  80, 142,  50, 142,  82, 142,
-                         83, 142,  84, 142,  85, 142,  86, 142,
-                         50, 142,  88,  90, 142,  89, 142, 142,
-                        142,  91, 142,  92, 142,  93, 142,  94,
-                        142,  95, 142,  96, 142, 142, 142,  98,
-                        142,  99, 142, 100, 142, 101, 142, 142,
-                        142, 103, 142, 104, 105, 142, 142, 142,
-                        106, 142, 142, 142, 108,  -5, 109,  -5,
-                        110,  -5, 111,  -5,  -5,  -5, 113,  -5,
-                        114,  -5, 115,  -5, 116,  -5, 119,  -5,
-                        119, 118,  -5, 118,  -5,  -5,  -5, 119,
-                        119,  -5,  -5, 119, 120, 121, 120,  -5,
-                         -5, 119, 122, 125,  -5,  -5, 119, 123,
-                         -5,  -5, 119, 124,  -5,  -5, 119, 124,
-                        120,  -5,  -5, 119, 126,  -5,  -5, 119,
-                        124,  -5,  -5, 119, 128, 131, 142, 129,
-                        142, 130, 142, 117, 142, 132, 142, 133,
-                        142, 117, 142, 135,  -5, 136,  -5, 137,
-                         -5, 138,  -5, 139,  -5, 140,  -5, 141,
-                         -5,  -5,  -5,  -5,  -5,  -5
-                       };
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.def.h b/.ref-Research-V7/usr/src/cmd/struct/2.def.h
deleted file mode 100644 (file)
index 7f6795e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-extern int accessnum;          /* number of nodes accessible from START */
-extern VERT *after;            /* node numbers associated with after numbers of depth first search */
-extern int *ntobef;            /* before numbers associated with nodes */
-extern int *ntoaft;            /* after numbers associated with nodes */
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.dfs.c b/.ref-Research-V7/usr/src/cmd/struct/2.dfs.c
deleted file mode 100644 (file)
index 36eeb1b..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#include <stdio.h>
-#
-/* depth-first search used to identify back edges, unreachable nodes;
-       each node v entered by back edge replaced by
-       LOOPVX ->ITERVX -> v,
-       so that back edges entering v now enter the ITERVX,
-       and other edges entering v now enter the LOOPVX.
-       Nodes are numbered according to depth-first search:
-               before numbering- ntobef[v] = i => node numbered v is i'th
-                       node in order of first visit during the search;
-               after numbering- ntoaft[v] = i => node numbered v is i'th
-                       node visited in order of last visit during the search.
-                       Also, in this case after[i] = v.
-*/
-
-#include "def.h"
-#include "2.def.h"
-
-#define MAXINS 3       /* spacing needed between numbers generated during depth first search */
-
-int *status;
-int befcount, aftcount;
-/* following defines used to mark back edges and nodes entered by back edges */
-#define UNPROCESSED    0
-#define STACKED        1
-#define FINISHED       2
-#define MARK(v)        {REACH(v) = 1; }        /* mark node v */
-#define UNMARK(v)      {REACH(v) = 0; }
-#define MARKED(v)      (REACH(v))
-#define MKEDGE(e)      {if (e >= -1) e = -(e+3); }     /* mark edge e */
-#define UNMKEDGE(e)    {if (e < -1) e = -(e+3); }
-#define BACKEDGE(e)    (e < -1)
-
-
-dfs(v)         /* depth first search */
-VERT v;
-       {
-       int i; VERT w;
-       accessnum = 0;
-       status = challoc(sizeof(*status) * nodenum);
-       for (w = 0; w < nodenum; ++w)
-               {
-               status[w] = UNPROCESSED;
-               UNMARK(w);
-               }
-       search(v);
-       chreach();
-       chfree(status, sizeof(*status) * nodenum);
-       addloop();
-       after = challoc(sizeof(*after) * accessnum);
-       for (i = 0; i < accessnum; ++i)
-               after[i] = UNDEFINED;
-       ntoaft = challoc(sizeof(*ntoaft) * nodenum);
-       ntobef = challoc(sizeof(*ntobef) * nodenum);
-       for (w = 0; w < nodenum; ++w)
-               ntobef[w] = ntoaft[w] = UNDEFINED;
-       befcount = 0;
-       aftcount = 0;
-       repsearch(v);
-       }
-
-
-search(v)
-       /* using depth first search, mark back edges using MKEDGE, and nodes entered by back
-       edges using MARK */
-VERT v;
-       {
-       VERT adj; int i;
-       status[v] = STACKED;
-       for(i = 0; i < ARCNUM(v); ++i)
-               {
-               adj = ARC(v,i);
-               if (!DEFINED(adj)) continue;
-               else if (status[adj] == UNPROCESSED)
-                       search(adj);
-               else if (status[adj] == STACKED)
-                       {
-                       MARK(adj);              /* mark adj as entered by back edge */
-                       MKEDGE(ARC(v,i));       /* mark edge ARC(v,i) as being back edge */
-                       }
-               }
-       status[v] = FINISHED;
-       ++accessnum;
-       }
-
-chreach()              /* look for unreachable nodes */
-       {
-       VERT v;
-       LOGICAL unreach;
-       unreach = FALSE;
-       for (v = 0; v < nodenum; ++v)
-               if (status[v] == UNPROCESSED && NTYPE(v) != FMTVX
-                       && NTYPE(v) != STOPVX && NTYPE(v) != RETVX)
-                       {
-                       unreach = TRUE;
-                       if (debug)
-                               fprintf(stderr,"node %d unreachable\n",v);
-                       }
-       if (unreach)
-               error(": unreachable statements - ","will be ignored","");
-       }
-
-
-addloop()      /* add LOOPVX, ITERVX at nodes entered by back edges, and adjust edges */
-       {
-       VERT v, adj;
-       int j, oldnum;
-       for (v = 0, oldnum = nodenum; v < oldnum; ++v)  /* insloop increases nodenum */
-               if (MARKED(v))
-                       {
-                       UNMARK(v);      /* remove mark indicating v entered by back edge */
-                       if (NTYPE(v) != ITERVX)                 /* DO loops already have ITERVX */
-                                insloop(v);  /* add LOOPVX, ITERVX since v entered by back edge*/
-                       }
-       /* arcs which used to enter v now enter LOOPVX; must make back edges enter ITERVX */
-       for (v = 0; v < nodenum; ++v)
-               for (j = 0; j < ARCNUM(v); ++j)
-                       {
-                       if (BACKEDGE(ARC(v,j)))
-                               {
-                               UNMKEDGE(ARC(v,j));             /* return edge to normal value */
-                               adj = ARC(v,j);
-                               if (NTYPE(adj) == ITERVX) continue;
-                               ASSERT(NTYPE(adj) == LOOPVX,addloop);
-                               ARC(v,j) = ARC(adj,0);  /* change arc to point to ITERVX */
-                               ASSERT(NTYPE(ARC(v,j)) == ITERVX,addloop);
-                               }
-                       }
-       }
-
-insloop(v)             /* insert LOOPVX, ITERVX at node number v */
-VERT v;
-       {
-       VERT loo, iter;
-       loo = create(LOOPVX, 1);
-       iter = create(ITERVX,1);
-       accessnum += 2;
-       /* want LOOPVX to take on node number v, so that arcs other than back arcs
-               entering v will enter the LOOPVX automatically */
-       exchange(&graph[v], &graph[loo]);
-       exchange(&v, &loo);
-       ARC(loo,0) = iter;
-       ARC(iter,0) = v;
-       FATH(iter) = UNDEFINED; /* will be defined later along with FATH for DOVX */
-       }
-
-exchange(p1,p2)                /* exchange values of p1,p2 */
-int *p1,*p2;
-       {
-       int temp;
-       temp = *p1;
-       *p1 = *p2;
-       *p2 = temp;
-       }
-
-
-repsearch(v)           /* repeat df search in order to fill in after, ntoaft, ntobef tables */
-VERT v;
-       {
-       VERT adj; int i,temp;
-       ntobef[v] = befcount;
-       ++befcount;
-       for(i = 0; i < ARCNUM(v); ++i)
-               {
-               adj = ARC(v,i);
-               if (DEFINED(adj) && ntobef[adj] == UNDEFINED)
-                       repsearch(adj);
-               }
-       ++aftcount;
-       temp = accessnum - aftcount;
-       after[temp] = v;
-       ntoaft[v] = temp;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.dom.c b/.ref-Research-V7/usr/src/cmd/struct/2.dom.c
deleted file mode 100644 (file)
index e0a9f85..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <stdio.h>
-#
-/*
-set dom[v] to immediate dominator of v, based on arcs as stored in inarcs
-(i.e. pretending the graph is reducible if it isn't).
-Algorithm is from Hecht and Ullman, Analysis of a simple algorithm for global
-flow analysis problems, except bit vector operations replaced by search
-through DOM to save quadratic blowup in space 
-*/
-#include "def.h"
-#include "2.def.h"
-
-
-getdom(inarc,dom)
-struct list **inarc;
-VERT *dom;
-       {
-       VERT v;
-       int i;
-       struct list *ls;
-       for (v = 0; v < nodenum; ++v)
-               dom[v] = UNDEFINED;
-       for (i = 1; i < accessnum; ++i)
-               {
-               v = after[i];
-               for (ls = inarc[v]; ls; ls = ls->nxtlist)
-                       {
-                       ASSERT(ntoaft[ls->elt] < i,getdom);
-                       dom[v] = comdom(dom[v],ls->elt,dom);
-                       }
-
-               }
-       }
-
-
-comdom(u,v,dom)                        /* find closest common dominator of u,v */
-VERT u,v, *dom;
-       {
-       if (u == UNDEFINED) return(v);
-       if (v == UNDEFINED) return(u);
-       while(u != v)
-               {
-               ASSERT(u != UNDEFINED && v != UNDEFINED, comdom);
-               if (ntoaft[u] < ntoaft[v])      
-                       v = dom[v];
-               else
-                       u = dom[u];
-               }
-       return(u);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.head.c b/.ref-Research-V7/usr/src/cmd/struct/2.head.c
deleted file mode 100644 (file)
index f538bce..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#include <stdio.h>
-#
-/*
-set head[v] to ITERVX heading smallest loop containing v, for each v
-*/
-#include "def.h"
-#include "2.def.h"
-
-/* define ANC(v,w) true if v == w or v is ancestor of w */
-#define ANC(v,w)       (ntobef[v] <= ntobef[w] && ntoaft[v] <= ntoaft[w])      /* reflexive ancestor */
-
-
-gethead(head)
-VERT *head;
-       {
-       VERT v, w, adj; int i, j;
-       /* search nodes in reverse of after numbering so that all paths from
-               a node to an ancestor are searched before the node */
-       /* at any point, the current value of head allows chains of nodes
-               to be reached from any node v by taking head[v], head[head[v]], etc.
-               until an UNDEFINED value is reached.  Upon searching each arc, 
-               the appropriate chains must be merged to avoid losing information.
-               For example, from one path out of a node v it may be known that
-                v is in a loop headed by z, while from another
-               it may be known that v is in a loop headed by w.
-               Thus, head[v] must be set to whichever of z,w is the closer ancestor,
-               and the fact that this node is in a loop headed by the other must be
-               recorded in head.       */
-       for (v = 0; v < nodenum; ++v)
-               head[v] = UNDEFINED;
-       for (i = accessnum -1; i >= 0; --i)
-               {
-               v = after[i];
-               for (j = 0; j < ARCNUM(v); ++j)
-                       {
-                       adj = ARC(v,j);
-                       if (!DEFINED(adj)) continue;
-                       if (ntoaft[adj] < i)            /* back edge */
-                               merge(v,adj,head);
-                       else if (ANC(v,adj))            /* not back edge or cross edge */
-                               {
-                               /* need to do only tree edges - must not do edge (v,adj)
-                                       when head[adj] is not ANC of v */
-                               if (DEFINED(head[adj]) && ANC(head[adj],v))
-                                       merge(v,head[adj],head);
-                               }
-                       else                            /* cross edge */
-                               {
-                               w = lowanc(adj,v,head);
-                               if (DEFINED(w))
-                                       merge(w,v,head);
-                               }
-                       }
-               if (NTYPE(v) == LOOPVX || NTYPE(v) == DOVX)
-                       head[ARC(v,0)] = head[v];       /* head of ITERVX must be different ITERVX */
-               }
-       }
-
-
-lowanc(y,z,head)               /* find the first node in chain of y which is anc of z, if it exists */
-VERT y,z, *head;
-       {
-       while (y != -1 && !ANC(y,z))
-               y = head[y];
-       return(y);
-       }
-
-
-merge(w,y,head)                /* merge chains of w and y according to ANC relation */
-VERT w,y, *head;
-       {
-       VERT t, min;
-       if (w == y) return;
-
-       if (ANC(w,y))           /* set t to min of w,y */
-               {
-               t = y;
-                y = head[y];
-               }
-       else
-               {
-               t = w;
-                w = head[w];
-               }
-
-       while (w != -1 && y != -1)              /* construct chain at t by adding min of remaining elts */
-               {
-               if (ANC(w,y))
-                       {
-                       min = y;
-                       y = head[y];
-                       }
-               else
-                       {
-                       min = w;
-                       w = head[w];
-                       }
-               if (t != min)
-                       {
-                       head[t] = min;
-                       t = min;
-                       }
-               }
-       if (w == -1)  min = y;  else  min = w;
-       if (t != min)  head[t] = min;
-
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.inarc.c b/.ref-Research-V7/usr/src/cmd/struct/2.inarc.c
deleted file mode 100644 (file)
index dc9f060..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#include <stdio.h>
-#
-/* find forward in-arcs for each node, pretending that arcs which jump into a loop 
-       jump to the head of the largest such loop instead, based on the
-       depth first search tree */
-#include "def.h"
-#include "2.def.h"
-
-getinarc(inarc,head)           /* construct array "inarc" containing in arcs for each node */
-struct list **inarc;
-VERT *head;
-       {
-       VERT v,adj,x;
-       int i, j;
-
-       for (v=0; v < nodenum; ++v) inarc[v] = 0;
-
-       /* fill in inarc nodes */
-
-       for (i = 0; i < accessnum; ++i)
-               {
-               v = after[i];
-               for (j = 0; j < ARCNUM(v); ++j)
-                       {
-                       adj = ARC(v,j);
-                       if (!DEFINED(adj))
-                               continue;
-                       if (ntoaft[adj] > ntoaft[v])            /* not a back edge */
-                               /* if edge jumps into loop, pretend jumps to head of
-                                       largest loop jumped into */
-                               {
-                               x = maxentry(v,adj,head);
-                               if (!DEFINED(x)) x = adj;
-                               else x = FATH(x);
-
-                               inarc[x] = consls(v,inarc[x]);  /* insert v in list inarc[x] */
-                               }
-                       }
-               }
-       }
-
-
-
-maxentry(x,y,head)     /* return z if z is ITERVX of largest loop containing y but not x, UNDEFINED otherwise */
-VERT x,y, *head;
-       {
-       if (head[y] == UNDEFINED)  return(UNDEFINED);
-       if (loomem(x,head[y], head)) return (UNDEFINED);
-       y = head[y];
-       while (head[y] != UNDEFINED)
-               {
-               if (loomem(x,head[y],head))  return(y);
-               y = head[y];
-               }
-       return(y);
-       }
-
-
-
-loomem(x,y,head)                       /* return TRUE if x is in loop headed by y, FALSE otherwise */
-VERT x,y, *head;
-       {
-       VERT w;
-       if (!DEFINED(y)) return(TRUE);
-       ASSERT(NTYPE(y) == ITERVX, loomem);
-       for (w = (NTYPE(x) == ITERVX) ? x : head[x]; DEFINED(w); w = head[w])
-               if (w == y)  return (TRUE);
-       return(FALSE);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.main.c b/.ref-Research-V7/usr/src/cmd/struct/2.main.c
deleted file mode 100644 (file)
index 4e0bf65..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "2.def.h"
-
-VERT *after;
-int *ntobef, *ntoaft;
-build()
-       {
-       VERT v, *dom, *head;
-       int type;
-       struct list **inarc;
-       dfs(START);
-       if (routerr) return;
-       for (v = 0; v < nodenum; ++v)
-               {
-               type = NTYPE(v);
-               if (type == LOOPVX || type == DOVX)
-                       FATH(ARC(v,0)) = v;
-               }
-
-       head = challoc(sizeof(*head) * nodenum);
-       if (progress) fprintf(stderr,"  gethead:\n");
-       gethead(head);  /* sets head[v] to ITERVX heading smallest loop containing v or UNDEFINED */
-
-       if (routerr) return;
-       inarc = challoc(nodenum * sizeof(*inarc));
-       if (progress) fprintf(stderr,"  getinarc:\n");
-       getinarc(inarc,head);           /* sets inarc[v] to list of forward arcs entering v */
-
-       dom = challoc(nodenum * sizeof(*dom));
-       if (progress) fprintf(stderr,"  getdom:\n");
-       getdom(inarc,dom);      /* sets dom[v] to immediate dominator of v or UNDEFINED */
-       if (routerr) return;
-       if (progress) fprintf(stderr,"  gettree:\n");
-       gettree(inarc, dom, head);
-       if (routerr) return;
-
-       chfree(head, nodenum * sizeof(*head)); head = 0;
-       chfree(dom,nodenum * sizeof(*dom)); dom = 0;
-       for (v = 0; v < nodenum; ++v)
-               {
-               freelst(inarc[v]);
-               inarc[v] = 0;
-               }
-       chfree(inarc,sizeof(*inarc) * nodenum); inarc = 0;
-       chfree(ntoaft,sizeof(*ntoaft) * nodenum); ntoaft = 0;
-       chfree(ntobef,sizeof(*ntobef) * nodenum); ntobef = 0;
-       chfree(after, sizeof(*after) * accessnum); after = 0;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.test.c b/.ref-Research-V7/usr/src/cmd/struct/2.test.c
deleted file mode 100644 (file)
index 7ce2bf4..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#include <stdio.h>
-#
-/* for testing only */
-#include "def.h"
-#include "2.def.h"
-
-testaft()
-       {
-       int i;
-       for (i = 0; i < nodenum; ++i)
-               fprintf(stderr,"ntoaft[%d] = %d, ntobef[%d] = %d\n",i,ntoaft[i],i,ntobef[i]);
-       fprintf(stderr,"\n");
-       for (i = 0; i < accessnum; ++i)
-               fprintf(stderr,"after[%d] = %d\n",i,after[i]);
-       }
-
-testhead(head)
-VERT *head;
-       {
-       VERT v;
-       for (v = 0; v < nodenum; ++v)
-               fprintf(stderr,"head[%d] = %d\n",v,head[v]);
-       }
-
-testdom(dom)
-VERT *dom;
-       {
-       VERT v;
-       for (v = 0; v < nodenum; ++v)
-               fprintf(stderr,"dom[%d] = %d\n",v,dom[v]);
-       }
-
-
-testtree()
-       {
-       VERT v;
-       int i;
-       for (v = 0; v < nodenum; ++v)
-               {
-               fprintf(stderr,"%d: RSIB %d, ",v,RSIB(v));
-               for (i = 0; i < CHILDNUM(v); ++i)
-                       fprintf(stderr," %d",LCHILD(v,i));
-               fprintf(stderr,"\n");
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/2.tree.c b/.ref-Research-V7/usr/src/cmd/struct/2.tree.c
deleted file mode 100644 (file)
index f8a33e3..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#include <stdio.h>
-#
-/* use inarc, dom, and head to build tree representing structure of program.
-       Each node v has CHILDNUM(v) children denoted by
-       LCHILD(v,0), LCHILD(v,1),...
-       RSIB((v) is right sibling of v or UNDEFINED;
-       RSIB(v) represents code following v at the same level of nesting,
-       while LCHILD(v,i) represents code nested within v
-*/
-#include "def.h"
-#include "2.def.h"
-
-gettree(inarc,dom,head)                /* build tree */
-struct list **inarc;
-VERT *dom, *head;
-       {
-       VERT v,u,from;
-       int i;
-       for ( v = 0; v < nodenum; ++v)
-               {
-               RSIB(v) = UNDEFINED;
-               for (i = 0; i < CHILDNUM(v); ++i)
-                       LCHILD(v,i) = UNDEFINED;
-               }
-       for (i = accessnum-1; i > 0; --i)
-               {
-               v = after[i];
-               from = oneelt(inarc[v]);        /* the unique elt of inarc[v] or UNDEFINED */
-               if (DEFINED(from))
-                       if (NTYPE(from) == IFVX && (head[v] == head[from] || asoc(v,exitsize) != -1) )
-                               /* place in clause of IFVX if in smallest loop containing it
-                               or if size of code for v is <= exitsize */
-                               if (ARC(from,THEN) == v)
-                                       {
-                                       LCHILD(from,THEN) = v;
-                                       continue;
-                                       }
-                               else
-                                       {
-                                       ASSERT(ARC(from,ELSE) == v,gettree);
-                                       LCHILD(from,ELSE) = v;
-                                       continue;
-                                       }
-                       else if (NTYPE(v) == ITERVX || NTYPE(from) == ITERVX )
-                               /* LOOPVX -> ITERVX ->vert always in same loop*/
-                               {
-                               LCHILD(from,0) = v;
-                               continue;
-                               }
-                       else if (NTYPE(from) == SWCHVX)
-                               {
-                               ASSERT(0 < ARCNUM(v),gettree);
-                               if (ARC(from,0) == v)
-                                       LCHILD(from,0) = v;
-                               else
-                                       {
-                                       int j;
-                                       for (j = 1; j < ARCNUM(from); ++j)
-                                               if (ARC(from,j) == v)
-                                                       {insib(ARC(from,j-1),v);
-                                                       break;
-                                                       }
-                                       }
-                               continue;
-                               }
-                       else if (NTYPE(from) == ICASVX && (head[v] == head[from] || asoc(v,exitsize) != -1))
-                               {
-                               LCHILD(from,0) = v;
-                               continue;
-                               }
-                       else if (NTYPE(from) == DUMVX && ARC(from,0) == v)
-                               {
-                               LCHILD(from,0) = v;
-                               continue;
-                               }
-               if (loomem(v,head[dom[v]],head))
-                               /* v is in smallest loop containing dom[v] */
-                       insib(dom[v],v);
-               else
-                       {
-                               /* make v follow LOOPVX heading largest loop
-                                       containing DOM[v] but not v */
-                       ASSERT(DEFINED(head[dom[v]]),gettree);
-                       for (u = head[dom[v]]; head[u] != head[v]; u = head[u])
-                               ASSERT(DEFINED(head[u]),gettree);
-                       ASSERT(NTYPE(u) == ITERVX,gettree);
-                       insib(FATH(u),v);
-                       }
-               }
-       }
-
-
-
-
-insib(w,v)             /* make RSIB(w) = v, and make RSIB(rightmost sib of v) = old RSIB(w) */
-VERT w,v;
-       {
-       VERT u, temp;
-       temp = RSIB(w);
-       RSIB(w) = v;
-       for (u = v; DEFINED(RSIB(u)); u = RSIB(u))
-               ;
-       RSIB(u) = temp;
-       }
-
-
-asoc(v,n)              /* return # of nodes associated with v if <= n, -1 otherwise */
-VERT v;
-int n;
-       {
-       int count,i,temp;
-       VERT w;
-       count = (NTYPE(v) == STLNVX) ? CODELINES(v) : 1;
-       for (i = 0; i < CHILDNUM(v); ++i)
-               {
-               w = LCHILD(v,i);
-               if (!DEFINED(w)) continue;
-               temp = asoc(w,n-count);
-               if (temp == -1) return(-1);
-               count += temp;
-               if (count > n) return(-1);
-               }
-       if (DEFINED(RSIB(v)))
-               {
-               temp = asoc(RSIB(v),n-count);
-               if (temp == -1) return(-1);
-               count += temp;
-               }
-       if (count > n) return(-1);
-       else return(count);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.branch.c b/.ref-Research-V7/usr/src/cmd/struct/3.branch.c
deleted file mode 100644 (file)
index 58768e4..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "3.def.h"
-
-
-getbranch(head)
-VERT *head;
-       {
-       VERT v;
-       for (v = 0; v < nodenum; ++v)
-               LABEL(v) = FALSE;
-       for (v = START; DEFINED(v); v = RSIB(v))
-               chkbranch(v,head);
-       addlab(START);
-       }
-
-
-
-chkbranch(v,head)
-VERT v,*head;
-       {
-       VERT  w;
-       int i;
-       switch(NTYPE(v))
-               {
-               case GOVX:
-                               for (i = 1, w = head[v]; DEFINED(w); w = head[w], ++i)
-                                       {
-                                       if (i > 1 && !levnxt && !levbrk) break;
-                                       if (ARC(v,0) == BRK(w) && (levbrk || i == 1))
-                                               {
-                                               NTYPE(v) = BRKVX;
-                                               LEVEL(v) = i;
-                                               break;
-                                               }
-                                       else if (ARC(v,0) == NXT(w) && (levnxt || i == 1))
-                                               {
-                                               NTYPE(v) = NXTVX;
-                                               LEVEL(v) = i;
-                                               break;
-                                               }
-                                       }
-                       if (NTYPE(v) == GOVX)
-                               {
-                               if (ARC(v,0) == stopvert)
-                                       NTYPE(v) = STOPVX;
-                               else if (ARC(v,0) == retvert)
-                                       NTYPE(v) = RETVX;
-                               else LABEL(ARC(v,0)) = TRUE;
-                               }
-                       break;
-               case COMPVX:
-               case ASGOVX:
-                       for (i = 0; i < ARCNUM(v); ++i)
-                               LABEL(ARC(v,i)) = TRUE;
-                       break;
-               case IOVX:
-                               if (DEFINED(ARC(v,ENDEQ)))
-                                       LABEL(ARC(v,ENDEQ)) = TRUE;
-                               if (DEFINED(ARC(v,ERREQ)))
-                                       LABEL(ARC(v,ERREQ)) = TRUE;
-                               if (DEFINED(FMTREF(v)))
-                                       LABEL(FMTREF(v)) = TRUE;
-                               break;
-               }
-       for (i = 0; i < CHILDNUM(v); ++i)
-               for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w))
-                       chkbranch(w,head);
-       }
-
-
-addlab(v)              /* add labels */
-VERT v;
-       {
-       int recvar;
-       if (NTYPE(v) != ITERVX && LABEL(v) )
-               LABEL(v) = nxtlab();
-       RECURSE(addlab,v,recvar);
-       if (NTYPE(v) == ITERVX && LABEL(NXT(v)))
-               LABEL(NXT(v)) = nxtlab();
-       }
-
-
-nxtlab()
-       {
-       static count;
-       return(labinit + (count++) * labinc);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.def.h b/.ref-Research-V7/usr/src/cmd/struct/3.def.h
deleted file mode 100644 (file)
index 6722a53..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#define RECURSE(p,v,r) { for (r = 0; r < CHILDNUM(v); ++r) if (DEFINED(LCHILD(v,r))) p(LCHILD(v,r)); if (DEFINED(RSIB(v))) p(RSIB(v)); }
-
-#define IFTHEN(v)              ( NTYPE(v) == IFVX && !DEFINED(LCHILD(v,ELSE)))
-
-#define BRK(v) FATH(v)         /* lexical successor of v, for ITERVX only */
-#define LABEL(v)       REACH(v)
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.flow.c b/.ref-Research-V7/usr/src/cmd/struct/3.flow.c
deleted file mode 100644 (file)
index 7f3fad4..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#include <stdio.h>
-#
-/*
-correct the flow of control in the new program - use GOTO's which may
-be changed later to NEXT, BREAK, etc.
-*/
-#include "def.h"
-#include "3.def.h"
-
-#define BRANCHTYPE(v)  (NTYPE(v) == GOVX )
-#define HASLEX(t)      (t != GOVX && t != COMPVX && t != ASGOVX  && t != ITERVX )
-                       /* for these, control never flows directly to following statement */
-
-
-getflow()
-       {
-       fixflow(START,UNDEFINED);
-       }
-
-
-fixflow(v,autolex)
-VERT v;
-VERT autolex;          /* lexical successor of v */
-       {
-       VERT lex,chlex,z,x,w;
-       int i;
-       lex = lexval(v,autolex);
-       if (HASLEX(NTYPE(v)) && NTYPE(v) != ICASVX)
-               if (DEFINED(REACH(v)) && REACH(v) != lex)
-                       insib(v,makebr(REACH(v)));
-               else if (NTYPE(v) == DOVX && ARC(v,1) != lex)
-                       insib(v,makebr(ARC(v,1)));
-       if (NTYPE(v) == ITERVX)
-               {
-               BRK(v) = autolex;
-               chlex = v;
-               }
-       else
-               chlex = lexval(v,autolex);
-
-       for (i = 0; i < CHILDNUM(v); ++i)
-               {
-               w = LCHILD(v,i);
-               if (DEFINED(w))
-                       fixflow(w,chlex);
-               else
-                       {
-                       ASSERT(i < ARCNUM(v),fixflow);
-                       z = ARC(v,i);
-                       ASSERT(DEFINED(z), fixflow);
-                       if (z != chlex)
-                               {
-                               x = makebr(z);
-                               LCHILD(v,i) = x;
-                               RSIB(x) = UNDEFINED;
-                               }
-                       }
-               }
-       if (DEFINED(RSIB(v)))
-               fixflow(RSIB(v),autolex);
-       }
-
-
-lexval(v,lastlex)
-VERT v,lastlex;
-       {
-       VERT sib;
-       if (!HASLEX(NTYPE(v))) return(UNDEFINED);
-       sib = RSIB(v);
-       if (NTYPE(v) == ICASVX || NTYPE(v) == ACASVX)
-               return(lastlex);
-       else if (!DEFINED(sib))
-               return(lastlex);
-       else if (BRANCHTYPE(sib))
-               return(ARC(sib,0));
-       else return(sib);
-       }
-
-
-makebr(w)              /* make branching node leading to w */
-VERT w;
-       {
-       VERT new;
-       new = create(GOVX,1);
-       ARC(new,0) = w;
-       RSIB(new) = UNDEFINED;
-       REACH(new) = UNDEFINED;
-       return(new);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.loop.c b/.ref-Research-V7/usr/src/cmd/struct/3.loop.c
deleted file mode 100644 (file)
index 6d5ef5c..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "3.def.h"
-
-#define ARCCOUNT(v)    REACH(v)
-
-
-fixhd(v,hd,head)
-VERT v,hd,*head;
-       {
-       VERT w,newhd;
-       int i;
-       head[v] = hd;
-       newhd = (NTYPE(v) == ITERVX) ? v : hd;
-       for (i = 0; i < CHILDNUM(v); ++i)
-               for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w))
-                       fixhd(w,newhd,head);
-       }
-
-getloop()
-       {
-       cntarcs();
-       fixloop(START);
-       }
-
-
-cntarcs()      /* count arcs entering each node */
-       {
-       VERT w,v;
-       int i;
-       for (v = 0; v < nodenum; ++v)
-               ARCCOUNT(v) = 0;
-       for (v = 0; v < nodenum; ++v)
-               for (i = 0; i < ARCNUM(v); ++i)
-                       {
-                       w = ARC(v,i);
-                       if (!DEFINED(w)) continue;
-                       ++ARCCOUNT(w);
-                       }
-       }
-
-
-fixloop(v)             /* find WHILE loops  */
-VERT v;
-       {
-       int recvar;
-       if (NTYPE(v) == LOOPVX)
-               {
-               ASSERT(DEFINED(ARC(v,0)),fixloop);
-               NXT(ARC(v,0)) = ARC(v,0);
-               if (!getwh(v))
-                       getun(v);
-               }
-       else if (NTYPE(v) == IFVX && arbcase)
-               getswitch(v);
-       else if (NTYPE(v)==DOVX)
-               {
-               ASSERT(DEFINED(ARC(v,0)),fixloop);
-               NXT(ARC(v,0))=ARC(v,0);
-               }
-       RECURSE(fixloop,v,recvar);
-       }
-
-
-getwh(v)
-VERT v;
-       {
-       VERT vchild, vgrand,vgreat;
-       ASSERT(NTYPE(v) == LOOPVX,getwh);
-       vchild = LCHILD(v,0);
-       ASSERT(DEFINED(vchild),getwh);
-       ASSERT(NTYPE(vchild) == ITERVX,getwh);
-       vgrand = LCHILD(vchild,0);
-       if (!DEFINED(vgrand) || !IFTHEN(vgrand) )
-               return(FALSE);
-       vgreat = LCHILD(vgrand,THEN);
-       if (DEFINED(vgreat) && NTYPE(vgreat) == GOVX && ARC(vgreat,0) == BRK(vchild))
-               {
-               /* turn into WHILE */
-               NTYPE(v) = WHIVX;
-               NEG(vgrand) = !NEG(vgrand);
-               LPRED(vchild) = vgrand; 
-               LCHILD(vchild,0) = RSIB(vgrand);
-               RSIB(vgrand) = UNDEFINED;
-               return(TRUE);
-               }
-       return(FALSE);
-       }
-
-
-
-getun(v)               /* change loop to REPEAT UNTIL if possible */
-VERT v;
-       {
-       VERT vchild, vgrand,  vgreat, before, ch;
-       ASSERT(NTYPE(v) == LOOPVX,getun);
-       vchild = LCHILD(v,0);
-       ASSERT(DEFINED(vchild), getun);
-       if (ARCCOUNT(vchild) > 2) 
-               return(FALSE);          /* loop can be iterated without passing through predicate of UNTIL */
-       vgrand = ARC(vchild,0);
-       if (!DEFINED(vgrand))
-               return(FALSE);
-       for (ch = vgrand,before = UNDEFINED; DEFINED(RSIB(ch)); ch = RSIB(ch))
-               before = ch;
-       if (!IFTHEN(ch))
-               return(FALSE);
-       vgreat = LCHILD(ch,THEN);
-       if (DEFINED(vgreat) && NTYPE(vgreat) == GOVX && ARC(vgreat,0) == BRK(vchild))
-               {
-               /* create  UNTIL node */
-               NTYPE(v) = UNTVX;
-               NXT(vchild) = ch;
-               LPRED(vchild)=ch;
-               RSIB(before) = UNDEFINED;
-               return(TRUE);
-               }
-       return(FALSE);
-       }
-
-
-#define FORMCASE(w)    (DEFINED(w) && !DEFINED(RSIB(w)) && NTYPE(w) == IFVX && ARCCOUNT(w) == 1)
-
-getswitch(v)
-VERT v;
-       {
-       VERT ch, grand, temp;
-       /* must be of form if ... else if ... else if ... */
-       if (NTYPE(v) != IFVX) return(FALSE);
-       ch = LCHILD(v,ELSE);
-       if (!FORMCASE(ch)) return(FALSE);
-       grand = LCHILD(ch,ELSE);
-       if (!FORMCASE(grand)) return(FALSE);
-
-       temp = create(SWCHVX,0);
-       exchange(&graph[temp],&graph[v]);       /* want arcs to enter switch, not first case*/
-       BEGCOM(v) = UNDEFINED;
-       RSIB(v) = RSIB(temp);           /* statements which followed IFVX should follow switch */
-       EXP(v) = UNDEFINED;
-       LCHILD(v,0) = temp;
-       NTYPE(temp) = ACASVX;
-       for (ch = LCHILD(temp,ELSE); FORMCASE(ch); )
-               {
-               LCHILD(temp,ELSE) = UNDEFINED;
-               RSIB(temp) = ch;
-               NTYPE(ch) = ACASVX;
-               temp = ch;
-               ch = LCHILD(temp,ELSE);
-               }
-       ASSERT(!DEFINED(RSIB(temp)),getswitch);
-       return(TRUE);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.main.c b/.ref-Research-V7/usr/src/cmd/struct/3.main.c
deleted file mode 100644 (file)
index fb4dd59..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-
-structure()
-       {
-       VERT v, *head;
-
-       if (progress)
-               fprintf(stderr,"        getreach:\n");
-       getreach();
-       if (routerr) return;
-       if (progress)
-               fprintf(stderr,"        getflow:\n");
-       getflow();
-       if (progress)
-               fprintf(stderr,"        getthen:\n");
-       getthen(START);
-       head = challoc(nodenum * sizeof(*head));
-       for (v = 0; v < nodenum; ++v)
-               head[v] = UNDEFINED;
-       for (v = START; DEFINED(v); v = RSIB(v))
-               fixhd(v,UNDEFINED,head);
-                       /* fixhd must be called before getloop so that
-                               it gets applied to IFVX which becomes NXT(w) for UNTVX w */
-       if (progress)
-               fprintf(stderr,"        getloop:\n");
-       getloop();
-       if (progress)
-               fprintf(stderr,"        getbranch:\n");
-       getbranch(head);
-       chfree(head,nodenum * sizeof(*head));
-       head = 0;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.reach.c b/.ref-Research-V7/usr/src/cmd/struct/3.reach.c
deleted file mode 100644 (file)
index 99e6a42..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#include <stdio.h>
-#
-/*
-set REACH[v] = w if w is only node outside subtree of v which is reached from within
-       subtree of v, REACH[v] = UNDEFINED otherwise
-*/
-#include "def.h"
-
-/* strategy in obtaining REACH(v) for each node v:
-Since only need to know whether there is exactly one exit from subtree of v,
-need keep track only of 2 farthest exits from each subtree rather than all exits.
-The first may be the unique exit, while the second is used when the children
-of a node has the same first exit.
-To obtain 2 farthest exits of v, look at 2 farthest exits of children of v and
-the nodes entered by arcs from v.  Farthest exits are identified by numbering
-the nodes from -2 to -(accessnum-2) starting at the bottom left corner of tree
-using procedure number().  The farthest exit from the subtree of v is the one
-with the least number according NUM to this numbering.  If a node w is an exit from the
-subtree of v, then NUM(w) < NUM(v).  The negative numbers allow NUM(v) to be stored
-in the same location as REACH(v).  REACH(w) may already be set when an arc (v,w) to a child
-is searched, but the negative numbering is consistent, i.e. NUM(v) < NUM(w) in this case
-as in other cases where w is not an exit from the subtree of v.
-*/
-
-struct pair {
-       int smallest;
-       int second;
-       };
-
-
-getreach()             /* obtain REACH(v) for each node v */
-       {
-       VERT v;
-       struct pair *pr;
-       for (v = 0; v < nodenum; ++v)
-               REACH(v) = UNDEFINED;
-       number(START);
-       for (v = START; DEFINED(v); v = RSIB(v))
-               {
-               pr = exits(v);  /* need to free the space for pr */
-               chfree(pr,sizeof(*pr));
-               }
-       }
-
-
-exits(v)       /* set REACH(v) = w if w is only node outside subtree of v which is reached from within
-                       subtree of v, leave REACH(v) UNDEFINED otherwise */
-VERT v;
-       {
-       struct pair *vpair, *chpair;
-       VERT w,t;
-       int i;
-       vpair = challoc(sizeof(*vpair));
-       vpair ->smallest = vpair ->second = UNDEFINED;
-       for (i = 0; i < CHILDNUM(v); ++i)
-               {
-               w = LCHILD(v,i);
-               if (!DEFINED(w)) continue;
-               for (t = w; DEFINED(t); t = RSIB(t))
-                       {
-                       chpair = exits(t);
-
-                       /* set vpair->smallest,second to two smallest of vpair->smallest,second,
-                               chpair->smallest,second */
-                       if (inspr(chpair->smallest,vpair))
-                               inspr(chpair->second,vpair);
-                       chfree(chpair, sizeof(*chpair));
-                       }
-               }
-       for (i = 0; i < ARCNUM(v); ++i)
-               {
-               w = ARC(v,i);
-               if (!DEFINED(w)) continue;
-                       inspr(w,vpair);
-               }
-       /* throw out nodes in subtree of  v */
-       if (NUM(vpair->second) >= NUM(v))
-               {
-               vpair->second = UNDEFINED;
-               if (NUM(vpair->smallest) >= NUM(v))
-                       vpair->smallest = UNDEFINED;
-               }
-       if (vpair->second == UNDEFINED)
-                REACH(v) = vpair->smallest;    /* vpair->smallest possibly UNDEFINED */
-       else
-               REACH(v) = UNDEFINED;
-       return(vpair);
-       }
-
-
-       /* number nodes from -2 to -(accessnum+2) starting at bottom left corner of tree */
-number(v)
-VERT v;
-       {
-       int i;
-       VERT w;
-       static int count;
-       for (i = 0; i < CHILDNUM(v); ++i)
-               {
-               w = LCHILD(v,i);
-               if (DEFINED(w))
-                       number(w);
-               }
-       SETNUM(v,count-2);
-       --count;
-       if (DEFINED(RSIB(v)))
-               number(RSIB(v));
-       }
-
-
-NUM(v)
-VERT v;
-       {
-       if (!DEFINED(v)) return(UNDEFINED);
-       return(REACH(v));
-       }
-
-SETNUM(v,count)
-VERT v; int count;
-       {
-       /* this reuses REACH to save space;
-       /* appears to be no conflict with setting true value of REACH later */
-       REACH(v) = count;
-       }
-
-
-LOGICAL inspr(w,pr)            /* insert w in order in pr, return TRUE if <= smaller of pr */
-                                       /* don't insert duplicates */
-VERT w;
-struct pair *pr;
-       {
-       if (w == pr-> smallest) return(TRUE);
-       if (NUM(w) < NUM(pr->smallest))
-               {
-               pr->second = pr->smallest;
-               pr->smallest = w;
-               return(TRUE);
-               }
-       if (w == pr->second) return(FALSE);
-       if (NUM(w) < NUM(pr->second))
-               pr->second = w;
-       return(FALSE);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.test.c b/.ref-Research-V7/usr/src/cmd/struct/3.test.c
deleted file mode 100644 (file)
index b389e4c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-#
-/* for testing only */
-#include "def.h"
-
-testreach()
-       {
-       VERT v;
-       for (v = 0; v < nodenum; ++v)
-               fprintf(stderr,"REACH(%d) = %d\n",v,REACH(v));
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/3.then.c b/.ref-Research-V7/usr/src/cmd/struct/3.then.c
deleted file mode 100644 (file)
index 6b056bf..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "3.def.h"
-
-#define BRANCHTYPE(t)  (t == STOPVX || t == RETVX || t == BRKVX || t == NXTVX || t == GOVX)
-#define MAXCHUNK       20
-               /* if else clause smaller than MAXCHUNK and smaller than then clause,
-                       and there is no reason not to negate the if, negate the if */
-
-getthen(v)             /* turn IFVX into THEN when appropriate, create else ifs where possible  */
-VERT v;
-       {
-       VERT tch, fch;
-       int tn,fn;
-       int recvar;
-
-       if (NTYPE(v) == IFVX)
-               {
-               tch = LCHILD(v,THEN);
-               fch = LCHILD(v,ELSE);
-               if (!DEFINED(fch))
-                       mkthen(v);
-               else if (!DEFINED(tch))
-                       {
-                       negate(v);
-                       mkthen(v);
-                       }
-               else if (BRANCHTYPE(NTYPE(tch)))
-                       mkthen(v);
-               else if (BRANCHTYPE(NTYPE(fch)))
-                       {
-                       negate(v);
-                       mkthen(v);
-                       }
-               else if (NTYPE(fch) != IFVX || DEFINED(RSIB(fch)))      /* not an else if */
-                       if ( NTYPE(tch) == IFVX && !DEFINED(RSIB(tch)))
-                                       /* invert into else if */
-                               negate(v);
-                       else
-                               {
-                               /* asoc(v,n) returns number of statements associated with v
-                                       if <= n, -1 otherwise */
-                               tn = asoc(tch,MAXCHUNK);
-                               fn = asoc(fch,MAXCHUNK);
-                               if (fn >= 0 && (tn < 0 || fn < tn))
-                                       /* else clause smaller */
-                                       negate(v);
-                               }
-               }
-       RECURSE(getthen,v,recvar);
-       }
-
-mkthen(v)
-VERT v;
-       {
-       VERT w,tc;
-       w = LCHILD(v,ELSE);
-       tc = LCHILD(v,THEN);
-       ASSERT(!DEFINED(w) || (DEFINED(tc) && BRANCHTYPE(NTYPE(tc)) ),mkthen);
-       if (DEFINED(w))
-               {
-               insib(v,w);
-               LCHILD(v,ELSE) = UNDEFINED;
-               }
-       ASSERT(IFTHEN(v),mkthen);
-       }
-
-
-negate(v)
-VERT v;
-       {
-       ASSERT(NTYPE(v) == IFVX,negate);
-       exchange(&LCHILD(v,THEN), &LCHILD(v,ELSE));
-       NEG(v) = !NEG(v);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/4.brace.c b/.ref-Research-V7/usr/src/cmd/struct/4.brace.c
deleted file mode 100644 (file)
index 1d14d78..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "4.def.h"
-#include "3.def.h"
-
-ndbrace(v)                     /* determine whether braces needed around subparts of v */
-                               /* return TRUE if v ends with IF THEN not in braces */
-VERT v;
-       {
-       VERT w;
-       int i;
-       LOGICAL endif;
-       endif = FALSE;
-       for (i = 0; i < CHILDNUM(v); ++i)
-               {
-               endif = FALSE;
-               for (w = LCHILD(v,i); DEFINED(w); w = RSIB(w))
-                       endif = ndbrace(w);
-               if (NTYPE(v) != DUMVX && NTYPE(v) != ITERVX &&
-                       (!DEFINED(LCHILD(v,i)) || compound(v,i) ||
-                       (endif && NTYPE(v) == IFVX && !IFTHEN(v) && i == THEN )))
-                               /* DUMVX doesn't nest, ITERVX doen't nest since
-                                       nesting is done at LOOPNODE, etc., must
-                                       check for IFTHEN followed by unrelated ELSE */
-                       {
-                       YESBRACE(v,i);
-                       endif = FALSE;
-                       }
-               }
-       return(endif || IFTHEN(v) );
-       }
-
-
-compound(v,ch)         /* return TRUE iff subpart ch of v has multiple statements */
-VERT v;
-int ch;
-       {
-       VERT w;
-       w = LCHILD(v,ch);
-       if (!DEFINED(w))
-               return(FALSE);
-       if (NTYPE(w) == ITERVX)
-               {
-               ASSERT(DEFINED(NXT(w)),compound);
-               if (LABEL(NXT(w)))
-                       return(TRUE);           /* loop ends with labeled CONTINUE statement */
-               else
-                       return(compound(w,0));
-               }
-       else if (DEFINED(RSIB(w)))
-               return(TRUE);
-       else if (NTYPE(w) == STLNVX && CODELINES(w) > 1)
-               return(TRUE);
-       else
-               return(FALSE);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/4.def.h b/.ref-Research-V7/usr/src/cmd/struct/4.def.h
deleted file mode 100644 (file)
index a5530d1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#define YESTAB TRUE
-#define NOTAB  FALSE
-#define TABOVER(n)     tabover(n,outfd)
-#define OUTSTR(x)              fprintf(outfd,"%s",x)
-#define OUTNUM(x)              fprintf(outfd,"%d",x)
-
-
-extern LOGICAL *brace;
-#define YESBRACE(v,i)  { if (DEFINED(LCHILD(v,i))) brace[LCHILD(v,i)] = TRUE; }
-#define NOBRACE(v,i)   { if (DEFINED(LCHILD(v,i))) brace[LCHILD(v,i)] = FALSE; }
-#define HASBRACE(v,i)   ((DEFINED(LCHILD(v,i))) ? brace[LCHILD(v,i)] : TRUE)
diff --git a/.ref-Research-V7/usr/src/cmd/struct/4.form.c b/.ref-Research-V7/usr/src/cmd/struct/4.form.c
deleted file mode 100644 (file)
index c85ec44..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#include <stdio.h>
-#
-#include "def.h"
-#include "4.def.h"
-extern int linechars;
-extern int rdfree(), comfree(), labfree(), contfree();
-extern int rdstand(), comstand(), labstand(), contstand();
-extern int (*rline[])();
-extern int (*comment[])();
-extern int (*getlabel[])();
-extern int (*chkcont[])();
-null(c)
-char c;
-       {return;}
-
-
-
-comprint()
-       {
-       int c, blank, first,count;
-       blank = 1;
-       first = 1;
-       count = 0;
-       while ((c = (*comment[inputform])(0) ) || blankline() )
-               {
-               ++count;
-               if (c)
-                       {
-                       (*comment[inputform])(1);               /* move head past comment signifier */
-                       blank = blankline();
-                       /* if (first && !blank)
-                               OUTSTR("#\n");*/
-                       prline("#");
-                       first = 0;
-                       }
-               else
-                       (*rline[inputform])(null);
-               }
-       /* if (!blank) 
-               OUTSTR("#\n"); */
-       return(count);
-       }
-
-
-
-prcode(linecount,tab)
-int linecount, tab;
-       {
-       int someout;
-       someout = FALSE;
-       while (linecount)
-               {
-               if ( (*comment[inputform])(0) )
-                       {
-                       linecount -= comprint();
-                       someout = TRUE;
-                       continue;
-                       }
-               else if (blankline() )
-                       (*rline[inputform])(null);
-               else if ((*chkcont[inputform])() )
-                       {
-                       TABOVER(tab);
-                       prline("&");
-                       someout  = TRUE;
-                       }
-               else 
-                       {if (someout) TABOVER(tab);
-                       (*getlabel[inputform])(null);
-                       prline("");
-                       someout=TRUE;
-                       }
-               --linecount;
-               }
-       }
-
-
-charout(c)
-char c;
-       {
-       putc(c,outfd);
-       }
-
-
-
-prline(str)
-char *str;
-       {
-       fprintf(outfd,"%s",str);
-       (*rline[inputform]) (charout);
-       putc('\n',outfd);
-       }
-
-
-input2()
-       {
-       static int c;
-       c = inchar();
-       if (c == '\n')
-               linechars = 0;
-       else
-               ++linechars;
-       return(c);
-       }
-
-
-unput2(c)
-int c;
-       {
-       unchar(c);
-       --linechars;
-       return(c);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/4.main.c b/.ref-Research-V7/usr/src/cmd/struct/4.main.c
deleted file mode 100644 (file)
index 3002a1f..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "4.def.h"
-
-LOGICAL *brace;
-output()
-       {
-       VERT w;
-       int i;
-       brace = challoc(nodenum * sizeof(*brace));
-       for (i = 0; i < nodenum; ++i)
-               brace[i] = FALSE;
-       if (progress) fprintf(stderr,"ndbrace:\n");
-       for (w = START; DEFINED(w); w = RSIB(w))
-               ndbrace(w);
-       if (progress) fprintf(stderr,"outrat:\n");
-       for (w = START; DEFINED(w); w = RSIB(w))
-               outrat(w,0,YESTAB);
-       OUTSTR("END\n");
-       chfree(brace,nodenum * sizeof(*brace));
-       brace = 0;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/4.out.c b/.ref-Research-V7/usr/src/cmd/struct/4.out.c
deleted file mode 100644 (file)
index 0b71804..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-#include <stdio.h>
-#include "def.h"
-#include "4.def.h"
-#include "3.def.h"
-
-outrat(v,tab,tabfirst)
-VERT v;
-int tab;               /* number of tabs to indent */
-LOGICAL tabfirst;      /* FALSE if doing IF of ELSE IF */
-       {
-       LOGICAL ndcomma;
-       VERT w;
-       int type,i;
-       type = NTYPE(v);
-       if (hascom[type])
-               prcom(v);
-       if (!LABEL(v) && type == FMTVX)
-               {
-               OUTSTR("#following unreferenced format statement commented out\n");
-               OUTSTR("#");
-               }
-       if (LABEL(v) && type != ITERVX)
-               {
-               ASSERT(tabfirst, outrat);
-               prlab(LABEL(v),tab);
-               }
-       else if (tabfirst && type != DUMVX && type != ITERVX)
-               TABOVER(tab);
-
-       switch(type)
-               {
-               case DUMVX:
-                       newlevel(v,0,tab,YESTAB);
-                       break;
-               case GOVX:
-                       OUTSTR("go to ");
-                       OUTNUM(LABEL(ARC(v,0)));
-                       OUTSTR("\n");
-                       break;
-               case STOPVX:
-                       if (progtype != blockdata)
-                               OUTSTR("stop\n");
-                       break;
-               case RETVX:
-                       OUTSTR("return\n");
-                       break;
-               case BRKVX:
-                       if (!levbrk)
-                               {
-                               ASSERT(LEVEL(v) == 1,outrat);
-                               OUTSTR("break\n");
-                               }
-                       else
-                               {
-                               OUTSTR("break ");
-                               OUTNUM(LEVEL(v));
-                               OUTSTR("\n");
-                               }
-                       break;
-               case NXTVX:
-                       if (!levnxt)
-                               {
-                               ASSERT(LEVEL(v) == 1,outrat);
-                               OUTSTR("next\n");
-                               }
-                       else
-                               {
-                               OUTSTR("next ");
-                               OUTNUM(LEVEL(v));
-                               OUTSTR("\n");
-                               }
-                       break;
-               case ASGOVX:
-               case COMPVX:
-                       OUTSTR("goto ");
-                       if (type == ASGOVX)
-                               {
-                               OUTSTR(EXP(v));
-                               OUTSTR(",");
-                               }
-                       OUTSTR("(");
-                       for (i = ARCNUM(v)-1; i >=0; --i)               /* arcs were stored backward */
-                               {
-                               OUTNUM(LABEL(ARC(v,i)));
-                               if (i > 0) OUTSTR(",");
-                               }
-                       OUTSTR(")");
-                       if (type == COMPVX)
-                               {
-                               OUTSTR(",");
-                               OUTSTR(EXP(v));
-                               }
-                       OUTSTR("\n");
-                       break;
-               case ASVX:
-                       OUTSTR("assign ");
-                       OUTNUM(LABEL(LABREF(v)));
-                       OUTSTR(" to ");
-                       OUTSTR(EXP(v));
-                       OUTSTR("\n");
-                       break;
-               case IFVX:
-                       OUTSTR("IF");
-                       prpred(v,TRUE);
-                       if (IFTHEN(v))
-                               newlevel(v,THEN,tab+1,YESTAB);
-                       else
-                               {
-                               newlevel(v,THEN,tab+1,YESTAB);
-                               TABOVER(tab);
-                               OUTSTR("ELSE ");
-                               w = LCHILD(v,ELSE);
-                               ASSERT(DEFINED(w),outrat);
-                               if (NTYPE(w) == IFVX && !LABEL(w) && !DEFINED(RSIB(w)) &&
-                                       !HASBRACE(v,ELSE) )
-                                       newlevel(v,ELSE,tab,NOTAB);
-                               else
-                                       newlevel(v,ELSE,tab+1,YESTAB);
-                               }
-                       break;
-               case ITERVX:
-                       newlevel(v,0,tab,YESTAB);
-                       ASSERT(DEFINED(NXT(v)),outrat);
-                       if (LABEL(NXT(v)))
-                               {
-                               prlab(LABEL(NXT(v)),tab);
-                               OUTSTR("continue\n");
-                               }
-                       break;
-               case DOVX:
-                       OUTSTR("DO ");
-                       OUTSTR(INC(v));
-                       newlevel(v,0,tab+1,YESTAB);
-                       break;
-               case LOOPVX:
-               case UNTVX:
-                       OUTSTR("REPEAT");
-                       newlevel(v,0,tab+1,YESTAB);
-                       if (type == UNTVX)
-                               {
-                               TABOVER(tab+1);
-                               OUTSTR("UNTIL");
-                               ASSERT(DEFINED(ARC(v,0)),outrat);
-                               prpred(LPRED(ARC(v,0)),TRUE);
-                               OUTSTR("\n");
-                               }
-                       break;
-               case WHIVX:
-                       OUTSTR("WHILE");
-                       ASSERT(DEFINED(ARC(v,0)),outrat);
-                       ASSERT(DEFINED(LPRED(ARC(v,0))),outrat);
-                       prpred(LPRED(ARC(v,0)),TRUE);
-                       newlevel(v,0,tab+1,YESTAB);
-                       break;
-               case STLNVX:
-               case FMTVX:
-                       prstln(v,tab);
-                       break;
-               case SWCHVX:
-                               OUTSTR("SWITCH");
-                               if (DEFINED(EXP(v)))
-                                       {
-                                       OUTSTR("(");
-                                       OUTSTR(EXP(v));
-                                       OUTSTR(")");
-                                       }
-                               newlevel(v,0,tab+1,YESTAB);
-                               break;
-               case ICASVX:
-               case ACASVX:
-                       OUTSTR("CASE ");
-                       if (type == ACASVX)
-                               prpred(v,FALSE);
-                       else
-                               OUTSTR(EXP(v));
-                       OUTSTR(":\n");
-                       newlevel(v,0,tab+1,YESTAB);
-                       if (type == ACASVX &&DEFINED(LCHILD(v,ELSE)))
-                               {
-                               TABOVER(tab);
-                               OUTSTR("DEFAULT:\n");
-                               newlevel(v,1,tab+1,YESTAB);
-                               }
-                       break;
-               case IOVX:
-                       OUTSTR(PRERW(v));
-                       ndcomma = FALSE;
-                       if (DEFINED(FMTREF(v)))
-                               {
-                               OUTNUM(LABEL(FMTREF(v)));
-                               ndcomma = TRUE;
-                               }
-                       if (DEFINED(ARC(v,ENDEQ)))
-                               {
-                               if (ndcomma) 
-                                       OUTSTR(",");
-                               OUTSTR("end = ");
-                               OUTNUM(LABEL(ARC(v,ENDEQ)));
-                               ndcomma = TRUE;
-                               }
-                       if (DEFINED(ARC(v,ERREQ)))
-                               {
-                               if (ndcomma)
-                                       OUTSTR(",");
-                               OUTSTR("err = ");
-                               OUTNUM(LABEL(ARC(v,ERREQ)));
-                               ndcomma = TRUE;
-                               }
-                       OUTSTR(POSTRW(v));
-                       OUTSTR("\n");
-                       break;
-               }
-       }
-
-
-newlevel(v,ch,tab,tabfirst)
-VERT v;
-int ch;                /* number of lchild of v being processed */
-int tab;               /* number of tabs to indent */
-LOGICAL tabfirst;      /* same as for outrat */
-       {
-       LOGICAL addbrace;
-       VERT w;
-       if (NTYPE(v) == ACASVX || NTYPE(v) == ICASVX)
-               addbrace = FALSE;
-       else if (NTYPE(v) == SWCHVX)
-               addbrace = TRUE;
-       else
-               addbrace = HASBRACE(v,ch);
-       ASSERT(tabfirst || !addbrace,newlevel);
-       if (addbrace)
-               OUTSTR(" {");
-       if(tabfirst && NTYPE(v)!=ITERVX && NTYPE(v)!=DUMVX) OUTSTR("\n");
-       for (w = LCHILD(v,ch); DEFINED(w); w = RSIB(w))
-               outrat(w,tab,tabfirst);
-       if (addbrace)
-               {
-               TABOVER(tab);
-               OUTSTR("}\n");
-               }
-       }
-
-
-
-
-
-prpred(v,addpar)
-VERT v;
-LOGICAL addpar;
-       {
-       if (addpar)
-               OUTSTR("(");
-       if (NEG(v)) OUTSTR("!(");
-       OUTSTR(PRED(v));
-       if (NEG(v)) OUTSTR(")");
-       if (addpar)
-               OUTSTR(")");
-       }
-
-prlab(n,tab)
-int n,tab;
-       {
-       TABOVER(tab);
-       OUTSTR("~");
-       OUTNUM(n);
-       OUTSTR(" ");
-       }
-
-prstln(v,tab)
-VERT v;
-int tab;
-       {
-       ASSERT(NTYPE(v) == STLNVX || NTYPE(v) == FMTVX,prstln);
-       if (!ONDISK(v))
-               {
-               OUTSTR(BEGCODE(v));
-               OUTSTR("\n");
-               }
-       else
-               {
-               empseek(BEGCODE(v));
-               prcode(ONDISK(v),tab);
-               }
-       }
-
-prcom(v)
-VERT v;
-       {
-       if (DEFINED(BEGCOM(v)))
-               {
-               empseek(BEGCOM(v));
-               comprint();
-               }
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/b.h b/.ref-Research-V7/usr/src/cmd/struct/b.h
deleted file mode 100644 (file)
index 24b7509..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-extern int xxindent, xxval, newflag, xxmaxchars, xxbpertab;
-extern int xxlineno;           /* # of lines already output */
-#define xxtop  100             /* max size of xxstack */
-extern int xxstind, xxstack[xxtop], xxlablast, xxt;
-struct node
-       {int op;
-       char *lit;
-       struct node *left;
-       struct node *right;
-       };
diff --git a/.ref-Research-V7/usr/src/cmd/struct/bdef.c b/.ref-Research-V7/usr/src/cmd/struct/bdef.c
deleted file mode 100644 (file)
index 88aa3d2..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define xxtop  100             /* max size of xxstack */
-int xxindent, xxval, newflag, xxmaxchars, xxbpertab;
-int xxlineno;          /* # of lines already output */
-int xxstind, xxstack[xxtop], xxlablast, xxt;
diff --git a/.ref-Research-V7/usr/src/cmd/struct/beauty.y b/.ref-Research-V7/usr/src/cmd/struct/beauty.y
deleted file mode 100644 (file)
index ca8202f..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-%term  xxif 300 xxelse 301 xxwhile 302 xxrept 303 xxdo 304 xxrb 305 xxpred 306
-%term xxident 307 xxle 308 xxge 309 xxne 310 xxnum 311 xxcom 312
-%term xxstring 313 xxexplist 314 xxidpar 315 xxelseif 316  xxlb 318 xxend 319
-%term xxcase 320 xxswitch 321 xxuntil 322 xxdefault 323 
-%term xxeq 324
-
-%left  '|'
-%left  '&'
-%left  '!'
-%binary        '<' '>' xxeq xxne xxge xxle
-%left  '+' '-'
-%left  '*' '/'
-%left  xxuminus
-%right '^'
-
-%{
-#include "b.h"
-#include <stdio.h>
-%}
-
-%%
-%{
-struct node *t;
-%}
-
-
-allprog:       prog xxnew
-       ;
-
-prog:  stat
-       |       prog stat
-       ;
-
-stat:           iftok pred nlevel elsetok nlevel
-       |        iftok  pred  nlevel
-       |       xxtab whtok  pred  nlevel
-       |       xxtab rpttok nlevel optuntil
-       |       xxtab dotok nlevel
-       |       xxtab swtok oppred pindent lbtok caseseq xxtab rbtok mindent
-       |       xxtab fstok
-       |       lbtok prog xxtab rbtok
-       |       lbtok rbtok
-       |        labtok stat
-       |       xxnl comtok stat
-       |       error
-       ;
-
-
-xxtab:         =       {
-                       if (!xxlablast) tab(xxindent);
-                       xxlablast = 0;
-                       }
-
-xxnl:  =       newline();
-xxnew: =       putout('\n',"\n");
-nlevel:        pindent stat mindent;
-pindent:               =
-                               {
-                               if (xxstack[xxstind] != xxlb)
-                                       ++xxindent;
-                               };
-mindent:                       =
-                               {if (xxstack[xxstind] != xxlb && xxstack[xxstind] != xxelseif)
-                                       --xxindent;
-                               pop();
-                               };
-caseseq:       casetok caseseq
-       |       casetok
-       ;
-
-casetok:       xxtab xxctok predlist pindent prog mindent
-       |       xxtab xxctok predlist pindent mindent
-       |       xxtab deftok pindent prog mindent
-       |       xxnl comtok casetok
-       ;
-
-xxctok:        xxcase          =       {putout(xxcase,"case "); free ($1); push(xxcase); }
-
-
-deftok:                xxdefault ':'           =               {
-                                               putout(xxcase,"default");
-                                               free($1);
-                                               putout(':',":");
-                                               free($2);
-                                               push(xxcase);
-                                               }
-swtok: xxswitch                        =       {putout(xxswitch,"switch"); free($1); push(xxswitch); }
-
-fstok: xxend           =       {
-                               free($1);
-                               putout(xxident,"end");
-                               putout('\n',"\n");
-                               putout('\n',"\n");
-                               putout('\n',"\n");
-                               }
-       |       xxident =       {
-                               putout(xxident,$1);
-                               free($1);
-                               newflag = 1;
-                               forst();
-                               newflag = 0;
-                               };
-
-               
-
-identtok:      xxident '(' explist ')' =       {
-                               xxt = addroot($1,xxident,0,0);
-                               $$ = addroot("",xxidpar,xxt,$3);
-                               }
-
-       |       xxident         =       $$ = addroot($1,xxident,0,0);
-       ;
-
-predlist:      explist  ':'            =       {
-                               yield($1,0);
-                               putout(':',":");
-                               freetree($1);
-                               }
-explist:       expr ',' explist                =       $$ = addroot($2,xxexplist,checkneg($1,0),$3);
-       |       expr                                    =       $$ = checkneg($1,0);
-       ;
-
-
-oppred:        pred
-       |
-       ;
-
-pred:  '(' expr ')'    =       { t = checkneg($2,0);
-                               yield(t,100);  freetree(t);     };
-
-expr:          '(' expr ')'    =       $$ = $2;
-       |       '-' expr        %prec xxuminus  =       $$ = addroot($1,xxuminus,$2,0);
-       |       '+' expr        %prec xxuminus  =       $$ = $2;
-       |       '!' expr        =       $$ = addroot($1,'!',$2,0);
-       |       expr '+' expr   =       $$ = addroot($2,'+',$1,$3);
-       |       expr '-' expr   =       $$ = addroot($2,'-',$1,$3);
-       |       expr '*' expr   =       $$ = addroot($2,'*',$1,$3);
-       |       expr '/' expr   =       $$ = addroot($2,'/',$1,$3);
-       |       expr '^' expr   =       $$ = addroot($2,'^',$1,$3);
-       |       expr '|' expr   =       $$ = addroot($2,'|',$1,$3);
-       |       expr '&' expr   =       $$ = addroot($2,'&',$1,$3);
-       |       expr '>' expr   =       $$ = addroot($2,'>',$1,$3);
-       |       expr '<' expr   =       $$ = addroot($2,'<',$1,$3);
-       |       expr xxeq expr  =       $$ = addroot($2,xxeq,$1,$3);
-       |       expr xxle expr  =       $$ = addroot($2,xxle,$1,$3);
-       |       expr xxge expr  =       $$ = addroot($2,xxge,$1,$3);
-       |       expr xxne expr  =       $$ = addroot($2,xxne,$1,$3);
-       |       identtok                =       $$ = $1;
-       |       xxnum           =       $$ = addroot($1,xxnum,0,0);
-       |       xxstring                =       $$ = addroot($1,xxstring,0,0);
-       ;
-
-iftok: xxif            =
-                               {
-                               if (xxstack[xxstind] == xxelse && !xxlablast)
-                                       {
-                                       --xxindent;
-                                       xxstack[xxstind] = xxelseif;
-                                       putout(' '," ");
-                                       }
-                               else
-                                       {
-                                       if (!xxlablast)
-                                               tab(xxindent);
-                                       xxlablast = 0;
-                                       }
-                               putout(xxif,"if");
-                               free($1);
-                               push(xxif);
-                               }
-elsetok:       xxelse  =
-                               {
-                               tab(xxindent);
-                               putout(xxelse,"else");
-                               free($1);
-                               push(xxelse);
-                               }
-whtok: xxwhile         =       {
-                               putout(xxwhile,"while");
-                               free($1);
-                               push(xxwhile);
-                               }
-rpttok:        xxrept  =                       {
-                                       putout(xxrept,"repeat");
-                                       free($1);
-                                       push(xxrept);
-                                       }
-optuntil:      xxtab unttok pred
-               |
-               ;
-
-unttok:        xxuntil   =     {
-                       putout('\t',"\t");
-                       putout(xxuntil,"until");
-                       free($1);
-                       }
-dotok: dopart opdotok
-       ;
-dopart:        xxdo    identtok '=' expr  ',' expr             =
-                                       {push(xxdo);
-                                       putout(xxdo,"do");
-                                       free($1);
-                                       puttree($2);
-                                       putout('=',"=");
-                                       free($3);
-                                       puttree($4);
-                                       putout(',',",");
-                                       free($5);
-                                       puttree($6);
-                                       }
-opdotok:       ',' expr                =       {
-                                               putout(',',",");
-                                               puttree($2);
-                                               }
-       |       ;
-lbtok: '{'             =       {
-                               putout('{'," {");
-                               push(xxlb);
-                               }
-rbtok: '}'                     =       { putout('}',"}");  pop();   }
-labtok:        xxnum           =       {
-                               tab(xxindent);
-                               putout(xxnum,$1);
-                               putout(' ',"  ");
-                               xxlablast = 1;
-                               }
-comtok:        xxcom           =       { putout(xxcom,$1);  free($1);  xxlablast = 0; }
-       |       comtok xxcom            = { putout ('\n',"\n"); putout(xxcom,$2);  free($2);  xxlablast = 0; };
-%%
-#define ASSERT(X,Y)    if (!(X)) error("struct bug: assertion 'X' invalid in routine Y","","");
-
-yyerror(s)
-char *s;
-       {
-       extern int yychar;
-       fprintf(stderr,"\n%s",s);
-       fprintf(stderr," in beautifying, output line %d,",xxlineno + 1);
-       fprintf(stderr," on input: ");
-               switch (yychar) {
-                       case '\t': fprintf(stderr,"\\t\n"); return;
-                       case '\n': fprintf(stderr,"\\n\n"); return;
-                       case '\0': fprintf(stderr,"$end\n"); return;
-                       default: fprintf(stderr,"%c\n",yychar); return;
-                       }
-       }
-
-yyinit(argc, argv)                     /* initialize pushdown store */
-int argc;
-char *argv[];
-       {
-       xxindent = 0;
-       xxbpertab = 8;
-       xxmaxchars = 120;
-       }
-
-
-#include <signal.h>
-main()
-       {
-       int exit();
-       if ( signal(SIGINT, SIG_IGN) != SIG_IGN)
-               signal(SIGINT, exit);
-       yyinit();
-       yyparse();
-       }
-
-
-putout(type,string)                    /* output string with proper indentation */
-int type;
-char *string;
-       {
-       static int lasttype;
-       if ( (lasttype != 0) && (lasttype != '\n') && (lasttype != ' ') && (lasttype != '\t') && (type == xxcom))
-               accum("\t");
-       else if (lasttype == xxcom && type != '\n')
-               tab(xxindent);
-       else
-               if (lasttype == xxif    ||
-                       lasttype == xxwhile     ||
-                       lasttype == xxdo        ||
-                       type == '='     ||
-                       lasttype == '=' ||
-                       (lasttype == xxident && (type == xxident || type == xxnum) )    ||
-                       (lasttype == xxnum && type == xxnum) )
-                       accum(" ");
-       accum(string);
-       lasttype = type;
-       }
-
-
-accum(token)           /* fill output buffer, generate continuation lines */
-char *token;
-       {
-       static char *buffer;
-       static int lstatus,llen,bufind;
-       int tstatus,tlen,i;
-
-#define NEW    0
-#define MID    1
-#define CONT   2
-
-       if (buffer == 0)
-               {
-               buffer = malloc(xxmaxchars);
-               if (buffer == 0) error("malloc out of space","","");
-               }
-       tlen = slength(token);
-       if (tlen == 0) return;
-       for (i = 0; i < tlen; ++i)
-               ASSERT(token[i] != '\n' || tlen == 1,accum);
-       switch(token[tlen-1])
-               {
-               case '\n':      tstatus = NEW;
-                               break;
-               case '+':
-               case '-':
-               case '*':
-               case ',':
-               case '|':
-               case '&':
-               case '(':       tstatus = CONT;
-                               break;
-               default:        tstatus = MID;
-               }
-       if (llen + bufind + tlen > xxmaxchars && lstatus == CONT && tstatus != NEW)
-               {
-               putchar('\n');
-               ++xxlineno;
-               for (i = 0; i < xxindent; ++i)
-                       putchar('\t');
-               putchar(' ');putchar(' ');
-               llen = 2 + xxindent * xxbpertab;
-               lstatus = NEW;
-               }
-       if (lstatus == CONT && tstatus == MID)
-               {                       /* store in buffer in case need \n after last CONT char */
-               ASSERT(bufind + tlen < xxmaxchars,accum);
-               for (i = 0; i < tlen; ++i)
-                       buffer[bufind++] = token[i];
-               }
-       else
-               {
-               for (i = 0; i < bufind; ++i)
-                       putchar(buffer[i]);
-               llen += bufind;
-               bufind = 0;
-               for (i = 0; i < tlen; ++i)
-                       putchar(token[i]);
-               if (tstatus == NEW) ++xxlineno;
-               llen = (tstatus == NEW) ? 0 : llen + tlen;
-               lstatus = tstatus;
-               }
-       }
-
-tab(n)
-int n;
-       {
-       int i;
-       newline();
-       for ( i = 0;  i < n; ++i)
-               putout('\t',"\t");
-       }
-
-newline()
-       {
-       static int already;
-       if (already)
-               putout('\n',"\n");
-       else
-               already = 1;
-       }
-
-error(mess1, mess2, mess3)
-char *mess1, *mess2, *mess3;
-       {
-       fprintf(stderr,"\nerror in beautifying, output line %d: %s %s %s \n",
-               xxlineno, mess1, mess2, mess3);
-       exit(1);
-       }
-
-
-
-
-
-
-
-push(type)
-int type;
-       {
-       if (++xxstind > xxtop)
-               error("nesting too deep, stack overflow","","");
-       xxstack[xxstind] = type;
-       }
-
-pop()
-       {
-       if (xxstind <= 0)
-               error("stack exhausted, can't be popped as requested","","");
-       --xxstind;
-       }
-
-
-forst()
-       {
-       while( (xxval = yylex()) != '\n')
-               {
-               putout(xxval, yylval);
-               free(yylval);
-               }
-       free(yylval);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/def.h b/.ref-Research-V7/usr/src/cmd/struct/def.h
deleted file mode 100644 (file)
index 47d86c7..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#define ASSERT(P,R)    {if (!(P)) {fprintf(stderr,"failed assertion in routine R: P\n"); abort();}}
-
-extern int routnum, routerr;
-extern long rtnbeg;            /* number of chars up to beginnine of curernt routing */
-extern int **graph, nodenum;
-extern int stopflg;            /* turns off generation of stop statements */
-
-#define TRUE 1
-#define FALSE 0
-#define LOGICAL int
-#define VERT int
-#define DEFINED(v)     (v >= 0)
-#define UNDEFINED      -1
-
-/* node types */
-#define STLNVX         0
-#define IFVX           1
-#define DOVX           2
-#define IOVX           3
-#define FMTVX          4
-#define COMPVX         5
-#define ASVX           6
-#define ASGOVX         7
-#define LOOPVX         8
-#define WHIVX          9
-#define UNTVX          10
-#define ITERVX         11
-#define THENVX         12
-#define STOPVX         13
-#define RETVX          14
-#define DUMVX          15
-#define GOVX           16
-#define BRKVX          17
-#define NXTVX          18
-#define SWCHVX         19
-#define ACASVX         20
-#define ICASVX         21
-
-#define TYPENUM        22
-
-
-extern int hascom[TYPENUM];            /* FALSE for types with no comments, 2 otherwise */
-extern int nonarcs[TYPENUM];           /* number of wds per node other than arcs */
-extern VERT *arc(), *lchild();
-extern int *vxpart(), *negpart(), *predic(), *expres(), *level(), *stlfmt();
-/* node parts */
-#define FIXED 4                /* number of wds needed in every node */
-#define NTYPE(v)       graph[v][0]
-#define BEGCOM(v)      graph[v][1]
-#define RSIB(v)        graph[v][2]
-#define REACH(v)       graph[v][3]
-#define LCHILD(v,i)    *lchild(v,i)
-#define CHILDNUM(v)    childper[NTYPE(v)]
-#define ARC(v,i)       *arc(v,i)
-#define ARCNUM(v)      *((arcsper[NTYPE(v)] >= 0) ? &arcsper[NTYPE(v)]: &graph[v][-arcsper[NTYPE(v)]])
-
-/* STLNVX, FMTVX parts */
-#define BEGCODE(v)     *stlfmt(v,0)            /* 1st char of line on disk or address of string */
-#define ONDISK(v)      *stlfmt(v,1)            /* FALSE if in core,# of lines on disk otherwise */
-#define CODELINES(v)           *vxpart(v,STLNVX,2)             /* # of statements stored in node */
-
-/* IOVX parts */
-#define FMTREF(v)      *vxpart(v,IOVX,0)       /* FMTVX associated with i/o statememt */
-#define PRERW(v)       *vxpart(v,IOVX,1)       /* string occurring in i/o statement before parts with labels */
-#define POSTRW(v)      *vxpart(v,IOVX,2)       /* string occurring in i/o statement after parts wih labels */
-#define ENDEQ  1               /* arc number associated with endeq */
-#define ERREQ  2               /* arc number associated wth erreq */
-
-/* ITERVX parts */
-#define NXT(v) *vxpart(v,ITERVX,0)             /* THENVX containing condition for iteration for WHILE or UNTIL */
-#define FATH(v) *vxpart(v,ITERVX,1)            /* father of v */
-#define LPRED(v) *vxpart(v,ITERVX,2)           /* loop predicate for WHILE, UNTIL */
-
-/*DOVX parts */
-#define INC(v) *vxpart(v,DOVX,0)               /* string for iteration condition of DO */
-
-/* IFVX,THENVX parts */
-#define PRED(v)                *predic(v)      /* string containing predicate */
-#define NEG(v)                 *negpart(v)             /* TRUE if predicate negated */
-#define THEN   0               /* arc number of true branch */
-#define ELSE 1         /* arc number of false branch */
-
-/* miscellaneous parts */
-#define EXP(v) *expres(v)              /* expression - ASVX, COMPVX, ASGOVX, SWCHVX, ICASVX */
-#define LABREF(v)      *vxpart(v,ASVX,1)               /* node referred to by label in ASSIGN statement */
-
-
-/* BRKVX, NXTVX parts */
-#define LEVEL(v)       *level(v)
-
-/* also COMPVX, ASGOVX, SWCHVX, and DUMVX contain wd for number of arcs */
-/* location of this wd specified by negative entry in arcsper */
-extern int arcsper[TYPENUM];
-
-/* also nodes contain wds for children as specified by childper */
-extern childper[TYPENUM];
-
-
-/* switches */
-extern int intcase, arbcase, whiloop, invelse, exitsize, maxnode,
-       maxhash, progress, labinit, labinc, inputform, debug,levbrk,levnxt,mkunt;
-
-/* arrays */
-extern int *after;
-extern char *typename[];
-
-struct list {
-       VERT elt;
-       struct list *nxtlist;
-       };
-struct list *append(), *consl();
-extern VERT retvert, stopvert; /* specifies unique return and stop vertices */
-extern VERT START;
-extern int progtype;           /* type of program - main or sub or blockdata */
-#define sub    1
-#define blockdata      2
-
-extern FILE *infd, *debfd, *outfd;
diff --git a/.ref-Research-V7/usr/src/cmd/struct/lextab.l b/.ref-Research-V7/usr/src/cmd/struct/lextab.l
deleted file mode 100644 (file)
index 6842baf..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-%{
-#include "y.tab.h"
-#include "b.h"
-#undef input
-#define input()        ninput()
-#undef unput
-#define unput(c)       nunput(c)
-extern int yylval;
-#define xxbpmax        1700
-char xxbuf[xxbpmax + 2];
-int xxbp = -1;
-#define xxunmax        200
-char xxunbuf[xxunmax + 2];
-int xxunbp = -1;
-
-
-int blflag;
-%}
-
-D      [0-9]
-A      [0-9a-z]
-L      [a-z]
-SP     [^0-9a-z]
-
-%%
-
-%{
-char *xxtbuff;
-int xxj, xxn, xxk;
-char *xxp;
-%}
-[=/,(]{D}+[h]                  {
-                               blflag = 1;
-                               sscanf(&yytext[1],"%d",&xxn);
-                               xxtbuff = malloc(2*xxn+3);
-                               for (xxj = xxk = 1; xxj <= xxn; ++xxj)
-                                       {
-                                       xxtbuff[xxk] = ninput();
-                                       if (xxtbuff[xxk] == '"')
-                                               xxtbuff[++xxk] = '"';
-                                       ++xxk;
-                                       }
-                               xxtbuff[0] = xxtbuff[xxk++] = '"';
-                               xxtbuff[xxk] = '\0';
-                               putback(xxtbuff);
-                               free(xxtbuff);
-
-                               backup(yytext[0]);
-                               blflag = 0;
-                               xxbp = -1;
-                               }
-IF                     {fixval(); xxbp = -1; return(xxif);}
-ELSE                   {fixval(); xxbp = -1; return(xxelse);}
-REPEAT                 {fixval(); xxbp = -1; return(xxrept); }
-WHILE                  {fixval(); xxbp = -1; return(xxwhile); }
-UNTIL                  { fixval(); xxbp = -1; return(xxuntil); }
-DO                     {fixval(); xxbp = -1; return(xxdo); }
-SWITCH                 {fixval(); xxbp = -1; return(xxswitch); }
-CASE                   {fixval(); xxbp = -1; return(xxcase); }
-DEFAULT                        {fixval(); xxbp = -1; return(xxdefault); }
-END                    {fixval(); xxbp = -1; return(xxend); }
-
-".true."               |
-".false."              |
-
-{L}{A}*                {fixval(); xxbp = -1; return(xxident); }
-~{D}+                  {xxbuf[0] = ' '; fixval(); xxbp = -1; return(xxnum); }
-{D}+/"."(ge|gt|le|lt|eq|ne|not|or|and)"."      |
-{D}+\.?                        |
-{D}+\.?[de][+-]?{D}+           |
-{D}*\.{D}+[de][+-]?{D}+                |
-{D}*\.{D}+                     {fixval(); xxbp = -1; return(xxnum); }
-
-".gt."                 { putback(">"); xxbp = -1; }
-".ge."                 { putback(">=");xxbp = -1; }
-".lt."                 { putback("<"); xxbp = -1; }
-".le."                 { putback("<="); xxbp = -1; }
-".eq."                 { putback("=="); xxbp = -1; }
-".ne."                 { putback("!="); xxbp = -1; }
-".not."                        { putback("!"); xxbp = -1; }
-".or."                 { putback("||"); xxbp = -1; }
-".and."                        { putback("&&"); xxbp = -1; }
-">="           {fixval(); xxbp = -1;  return(xxge);  }
-"<="           {fixval(); xxbp = -1;  return(xxle); }
-==                     {fixval(); xxbp = -1; return(xxeq); }
-!=                     {fixval(); xxbp = -1; return(xxne); }
-"||"                   {fixval(); xxbp = -1; return('|'); }
-"&&"                   {fixval(); xxbp = -1;  return('&'); }
-"**"                   {fixval(); xxbp = -1; return('^'); }
-
-#.*                    {fixval(); xxbp = -1; return(xxcom); }
-\"([^"]|\"\")*\"               {fixval(); xxbp = -1; return(xxstring); }
-'([^']|'')*'                           {
-                                       fixval();
-                                       xxp = yylval;
-                                       xxn = slength(xxp);
-                                       xxtbuff = malloc(2*xxn+1);
-                                       xxtbuff[0] = '"';
-                                       for (xxj = xxk = 1; xxj < xxn-1; ++xxj)
-                                               {
-                                               if (xxp[xxj] == '\'' && xxp[++xxj] == '\'')
-                                                       xxtbuff[xxk++] = '\'';
-                                               else if (xxp[xxj] == '"')
-                                                       {
-                                                       xxtbuff[xxk++] = '"';
-                                                       xxtbuff[xxk++] = '"';
-                                                       }
-                                               else
-                                                       xxtbuff[xxk++] = xxp[xxj];
-                                               }
-                                       xxtbuff[xxk++] = '"';
-                                       xxtbuff[xxk] = '\0';
-                                       free(xxp);
-                                       yylval = xxtbuff;
-                                       xxbp = -1;
-                                       return(xxstring);
-                                       }
-
-^\n            xxbp = -1;
-\n             {xxbp = -1; if (newflag) {fixval(); return('\n'); }  }
-{SP}           {fixval(); xxbp = -1; return(yytext[0]); }
-
-%%
-
-rdchar()
-       {
-       int c;
-       if (xxunbp >= 0)
-               return(xxunbuf[xxunbp--]);
-       c = getchar();
-       if (c == EOF) return('\0');
-       else return((char)c);
-       }
-
-backup(c)
-char c;
-       {
-       if (++xxunbp > xxunmax)
-               {
-               xxunbuf[xxunmax + 1] = '\0';
-               error("RATFOR beautifying; input backed up too far during lex:\n",
-                       xxunbuf,"\n");
-               }
-       xxunbuf[xxunbp] = c;
-       }
-
-nunput(c)
-char c;
-       {
-       backup(c);
-       if (xxbp < 0) return;
-       if (c != xxbuf[xxbp])
-               {
-               xxbuf[xxbp + 1] = '\0';
-               error("RATFOR beautifying; lex call of nunput with wrong char:\n",
-                       xxbuf,"\n");
-               }
-       for ( --xxbp; xxbp >= 0 && (xxbuf[xxbp] == ' ' || xxbuf[xxbp] == '\t'); --xxbp)
-               backup(xxbuf[xxbp]);
-       xxbuf[xxbp+1] = '\0';
-       }
-
-ninput()
-       {
-       char c,d;
-       if (blflag) c = rdchar();
-       else
-               while ( (c = rdchar()) == ' ' || c == '\t')
-               addbuf(c);
-       if (c != '\n')
-               return(addbuf(c));
-       while ( (d = rdchar()) == ' ' || d == '\t');
-       if (d == '&')
-               return(ninput());
-       backup(d);
-       return(addbuf('\n'));
-       }
-
-addbuf(c)
-char c;
-       {
-       if (++xxbp > xxbpmax)
-               {
-               xxbuf[xxbpmax +1] = '\0';
-               error("RATFOR beautifying; buffer xxbuf too small for token beginning:\n",
-                       xxbuf,"\n");
-               }
-       xxbuf[xxbp] = c;
-       xxbuf[xxbp + 1] = '\0';
-       return(c);
-       }
-
-
-fixval()
-       {
-       int i, j, k;
-       for (j = 0; xxbuf[j] == ' ' || xxbuf[j] == '\t'; ++j);
-       for (k = j; xxbuf[k] != '\0'; ++k);
-       for (--k; k > j && xxbuf[k] == ' ' || xxbuf[k]  == '\t'; --k);
-       xxbuf[k+1] = '\0';
-       i = slength(&xxbuf[j]) + 1;
-       yylval = malloc(i);
-       str_copy(&xxbuf[j],yylval,i);
-       }
-
-
-
-putback(str)
-char *str;
-       {
-       int i;
-       for (i = 0; str[i] != '\0'; ++i);
-       for (--i; i >= 0; --i)
-               backup(str[i]);
-       }
-
diff --git a/.ref-Research-V7/usr/src/cmd/struct/main.c b/.ref-Research-V7/usr/src/cmd/struct/main.c
deleted file mode 100644 (file)
index 8a8b5a1..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#include <signal.h>
-#include <stdio.h>
-#include "1.defs.h"
-#include "def.h"
-
-
-char (*input)(), (*unput)();
-FILE *outfd    = stdout;
-
-
-
-main(argc,argv)
-int argc;
-char *argv[];
-       {
-       int anyoutput;
-       int dexit();
-       char *getargs();
-       char input1(), unput1(), input2(), unput2();
-       anyoutput = FALSE;
-       getargs(argc,argv);
-       if (debug == 2) debfd = stderr;
-       else if (debug)
-               debfd = fopen("debug1","w");
-
-       if (signal(SIGINT, SIG_IGN) !=SIG_IGN)
-               signal(SIGINT,dexit);
-       prog_init();
-
-       for (;;)
-               {
-               ++routnum;
-               routerr = 0;
-
-               input = input1;
-               unput = unput1;
-               if (!mkgraph()) break;
-               if (debug) prgraph();
-               if (routerr) continue;
-
-               if (progress)fprintf(stderr,"build:\n");
-               build();
-               if (debug) prtree();
-               if (routerr) continue;
-
-               if (progress)fprintf(stderr,"structure:\n");
-               structure();
-               if (debug) prtree();
-               if (routerr) continue;
-               input = input2;
-               unput = unput2;
-
-               if (progress)fprintf(stderr,"output:\n");
-               output();
-               if (routerr) continue;
-               anyoutput = TRUE;
-               freegraf();
-               }
-       if (anyoutput)
-               exit(0);
-       else
-               exit(1);
-       }
-
-
-dexit()
-       {
-       exit(1);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/struct/makefile b/.ref-Research-V7/usr/src/cmd/struct/makefile
deleted file mode 100644 (file)
index 58c5162..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-CFLAGS=-O
-YFLAGS=-d
-0FILES.c = 0.alloc.c 0.args.c 0.def.c 0.extr.c 0.graph.c 0.list.c 0.parts.c 0.string.c
-0FILES.o = 0.alloc.o 0.args.o 0.def.o 0.extr.o 0.graph.o 0.list.o 0.parts.o 0.string.o
-
-1FILES.c = 1.finish.c 1.form.c 1.fort.c 1.hash.c 1.init.c 1.line.c 1.main.c 1.node.c 1.recog.c 1.tables.c
-1FILES.o = 1.finish.o 1.form.o 1.fort.o 1.hash.o 1.init.o 1.line.o 1.main.o 1.node.o 1.recog.o 1.tables.o
-
-2FILES.c = 2.dfs.c 2.dom.c 2.head.c 2.inarc.c 2.main.c 2.tree.c
-2FILES.o = 2.dfs.o 2.dom.o 2.head.o 2.inarc.o 2.main.o 2.tree.o
-
-3FILES.c = 3.branch.c 3.flow.c 3.loop.c 3.main.c 3.reach.c 3.then.c
-3FILES.o = 3.branch.o 3.flow.o 3.loop.o 3.main.o 3.reach.o 3.then.o
-
-4FILES.c = 4.brace.c 4.form.c 4.main.c 4.out.c
-4FILES.o = 4.brace.o 4.form.o 4.main.o 4.out.o
-
-all:   structure beautify
-
-cp:    structure beautify
-       cp structure /usr/lib/struct
-       rm structure
-       cp beautify /usr/lib/struct
-       rm beautify
-       rm *.o y.tab.h beauty.c
-
-cmp:   beautify structure
-       cmp beautify /usr/lib/struct/beautify
-       cmp structure /usr/lib/struct/structure
-       rm beautify structure *.o y.tab.h beauty.c
-
-structure: main.o $(0FILES.o) $(1FILES.o) $(2FILES.o) $(3FILES.o) $(4FILES.o)
-       cc -o structure -i -n main.o 0.*.o 1.*.o 2.*.o 3.*.o 4.*.o 
-
-beautify:      beauty.o tree.o lextab.o bdef.o
-       cc -n -s -O beauty.o tree.o lextab.o bdef.o -o beautify -lln
-
-lint:
-       lint $(0FILES.c) $(1FILES.c) $(2FILES.c) $(3FILES.c) $(4FILES.c) main.c
-
-main.o $(0FILES.o) $(1FILES.o) $(2FILES.o) $(3FILES.o) $(4FILES.o): def.h
-
-$(1FILES.o): 1.defs.h 1.incl.h
-$(2FILES.o): 2.def.h
-$(3FILES.o): 3.def.h
-$(4FILES.o): 4.def.h
-
-lextab.o tree.o: y.tab.h
-
-y.tab.h: beauty.y
-
-lextab.o tree.o beauty.y: b.h
-
-y.tab.h:       beauty.c
diff --git a/.ref-Research-V7/usr/src/cmd/struct/tree.c b/.ref-Research-V7/usr/src/cmd/struct/tree.c
deleted file mode 100644 (file)
index 4f76b53..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-# include "y.tab.h"
-#include "b.h"
-#include <stdio.h>
-
-
-addroot(string,type,n1,n2)
-char *string;
-int type;
-struct node *n1, *n2;
-       {
-       struct node *p;
-       p = malloc(sizeof(*p));
-       p->left = n1;
-       p->right = n2;
-       p->op = type;
-       p->lit = malloc(slength(string) + 1);
-       str_copy(string,p->lit,slength(string) + 1);
-       return(p);
-       }
-
-
-freetree(tree)
-struct node *tree;
-       {
-       if (tree)
-               {freetree(tree->left);
-               freetree(tree->right);
-               freenode(tree);
-               }
-       }
-
-freenode(treenode)
-struct node *treenode;
-       {
-       free(treenode->lit);
-       free(treenode);
-       }
-
-int compop[]   {       '&',    '|',    '<',    '>',    xxeq,   xxle,   xxne,   xxge};
-int notop[]    {       '|',    '&',    xxge,   xxle,   xxne,   '>',    xxeq,   '<'};
-char *opstring[]       { "||",  "&&",  ">=",   "<=", "!=",     ">",    "==",   "<"};
-
-checkneg(tree,neg)             /* eliminate nots if possible */
-struct node *tree;
-int neg;
-       {
-       int i;
-       struct node *t;
-       if (!tree) return(0);
-       for (i =  0; i < 8; ++i)
-               if (tree->op == compop[i]) break;
-       if (i > 1 && i <  8 && tree ->left ->op == '-' && str_eq(tree->right->lit,"0"))
-               {
-               t = tree->right;
-               tree->right = tree->left->right;
-               freenode(t);
-               t = tree->left;
-               tree->left = tree->left->left;
-               freenode(t);
-               }
-
-
-       if (neg)
-               {
-               if (tree ->op == '!')
-                       {
-                       t = tree->left;
-                       freenode(tree);
-                       return(checkneg(t,0));
-                       }
-                       if (i < 8)
-                               {
-                               tree->op = notop[i];
-                               free(tree->lit);
-                               tree->lit = malloc(slength(opstring[i])+1);
-                               str_copy(opstring[i],tree->lit, slength(opstring[i])+1);
-                               if (tree->op == '&' || tree->op == '|')
-                                       {
-                                       tree->left = checkneg(tree->left,1);
-                                       tree->right = checkneg(tree->right,1);
-                                       }
-                               return(tree);
-                               }
-               if (tree->op == xxident && str_eq(tree->lit,".false."))
-                       str_copy(".true.",tree->lit, slength(".true.")+1);
-               else if (tree->op == xxident && str_eq(tree->lit,".true."))
-                       {
-                       free(tree->lit);
-                       tree->lit = malloc(slength(".false.")+1);
-                       str_copy(".false.",tree->lit, slength(".false.")+1);
-                       }
-               else
-                       {
-                       tree = addroot("!",'!',tree,0);
-                       tree->lit = malloc(2);
-                       str_copy("!",tree->lit, slength("!")+1);
-                       }
-               return(tree);
-               }
-       else
-               if (tree->op == '!')
-                       {
-                       t = tree;
-                       tree = tree->left;
-                       freenode(t);
-                       return(checkneg(tree,1));
-                       }
-       else
-               {tree->left = checkneg(tree->left,0);
-               tree->right = checkneg(tree->right,0);
-               return(tree);
-               }
-       }
-
-yield(tree,fprec)
-struct node *tree;
-int fprec;                             /* fprec is precedence of father of this node */
-       {
-       int paren,p;
-       static int oplast;                      /* oplast = 1 iff last char printed was operator */
-       if (!tree) return;
-       p = prec(tree ->op);
-       paren = (p < fprec || (oplast && tree->op == xxuminus)) ? 1 : 0;
-
-       if (paren)
-               {
-               putout('(',"(");
-               oplast = 0;
-               }
-
-       switch(tree->op)
-               {
-               case xxuminus:
-                       tree->op = '-';
-               case '!':
-                       putout(tree->op,tree->lit);
-                       oplast = 1;
-                       yield(tree->left,p);
-                       break;
-               case '&':
-               case '|':
-               case '<':
-               case '>':
-               case xxeq:
-               case xxle:
-               case xxge:
-               case '+':
-               case '-':
-               case '*':
-               case '/':
-               case '^':
-                       yield(tree->left,p);
-                       putout(tree->op, tree->lit);
-                       oplast = 1;
-                       yield(tree->right,p);
-                       break;
-               case xxidpar:
-                       yield(tree->left,0);
-                       putout('(',"(");
-                       oplast = 0;
-                       yield(tree->right,0);
-                       putout('(',")");
-                       oplast = 0;
-                       break;
-               default:
-                       yield(tree->left,p);
-                       putout(tree->op, tree->lit);
-                       oplast = 0;
-                       yield(tree->right,p);
-                       break;
-               }
-       if (paren)
-               {
-               putout(')',")");
-               oplast = 0;
-               }
-       }
-
-puttree(tree)
-struct node *tree;
-       {
-       yield(tree,0);
-       freetree(tree);
-       }
-
-
-prec(oper)
-int oper;
-       {
-       switch(oper)
-               {
-               case ',':               return(0);
-               case '|':       return(1);
-               case '&':       return(2);
-               case '!':       return(3);
-
-               case '<':               case '>':               case xxeq:
-               case xxne:      case xxle:      case xxge:
-                               return(4);
-               case '+':
-       case '-':               return(5);
-               case '*':
-       case '/':               return(6);
-               case xxuminus:  return(7);
-               case '^':       return(8);
-               default:        return(9);
-               }
-       }
-str_copy(s,ptr,length) /* copy s at ptr, return length of s */
-char *s, *ptr;
-int length;
-       {int i;
-       for (i = 0; i < length; i++)
-               {
-               ptr[i] = s[i];
-               if (ptr[i] == '\0')
-                       return(i + 1);
-               }
-       fprintf(2,"string %s too long to be copied by str_copy at address %d\n",
-                       *s,ptr);
-       exit(1);
-       }
-str_eq(s,t)
-char s[],t[];
-       {int j;
-       for (j = 0; s[j] == t[j]; j++)
-               {if (s[j] == '\0') return(1);}
-       return(0);
-       }
-
-slength(s)                     /* return number of chars in s, not counting '\0' */
-char *s;
-       {
-       int i;
-       if (!s) return(-1);
-       for (i = 0; s[i] != '\0'; i++);
-       return(i);
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/stty.c b/.ref-Research-V7/usr/src/cmd/stty.c
deleted file mode 100644 (file)
index a5da235..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * set teletype modes
- */
-
-#include <stdio.h>
-#include <sgtty.h>
-
-struct
-{
-       char    *string;
-       int     speed;
-} speeds[] = {
-       "0",    B0,
-       "50",   B50,
-       "75",   B75,
-       "110",  B110,
-       "134",  B134,
-       "134.5",B134,
-       "150",  B150,
-       "200",  B200,
-       "300",  B300,
-       "600",  B600,
-       "1200", B1200,
-       "1800", B1800,
-       "2400", B2400,
-       "4800", B4800,
-       "9600", B9600,
-       "exta", EXTA,
-       "extb", EXTB,
-       0,
-};
-struct
-{
-       char    *string;
-       int     set;
-       int     reset;
-} modes[] = {
-       "even",
-       EVENP, 0,
-
-       "-even",
-       0, EVENP,
-
-       "odd",
-       ODDP, 0,
-
-       "-odd",
-       0, ODDP,
-
-       "raw",
-       RAW, 0,
-
-       "-raw",
-       0, RAW,
-
-       "cooked",
-       0, RAW,
-
-       "-nl",
-       CRMOD, 0,
-
-       "nl",
-       0, CRMOD,
-
-       "echo",
-       ECHO, 0,
-
-       "-echo",
-       0, ECHO,
-
-       "LCASE",
-       LCASE, 0,
-
-       "lcase",
-       LCASE, 0,
-
-       "-LCASE",
-       0, LCASE,
-
-       "-lcase",
-       0, LCASE,
-
-       "-tabs",
-       XTABS, 0,
-
-       "tabs",
-       0, XTABS,
-
-
-       "cbreak",
-       CBREAK, 0,
-
-       "-cbreak",
-       0, CBREAK,
-
-       "cr0",
-       CR0, CR3,
-
-       "cr1",
-       CR1, CR3,
-
-       "cr2",
-       CR2, CR3,
-
-       "cr3",
-       CR3, CR3,
-
-       "tab0",
-       TAB0, XTABS,
-
-       "tab1",
-       TAB1, XTABS,
-
-       "tab2",
-       TAB2, XTABS,
-
-       "nl0",
-       NL0, NL3,
-
-       "nl1",
-       NL1, NL3,
-
-       "nl2",
-       NL2, NL3,
-
-       "nl3",
-       NL3, NL3,
-
-       "ff0",
-       FF0, FF1,
-
-       "ff1",
-       FF1, FF1,
-
-       "bs0",
-       BS0, BS1,
-
-       "bs1",
-       BS1, BS1,
-
-       "33",
-       CR1, ALLDELAY,
-
-       "tty33",
-       CR1, ALLDELAY,
-
-       "37",
-       FF1+CR2+TAB1+NL1, ALLDELAY,
-
-       "tty37",
-       FF1+CR2+TAB1+NL1, ALLDELAY,
-
-       "05",
-       NL2, ALLDELAY,
-
-       "vt05",
-       NL2, ALLDELAY,
-
-       "tn",
-       CR1, ALLDELAY,
-
-       "tn300",
-       CR1, ALLDELAY,
-
-       "ti",
-       CR2, ALLDELAY,
-
-       "ti700",
-       CR2, ALLDELAY,
-
-       "tek",
-       FF1, ALLDELAY,
-
-       0,
-       };
-
-char   *arg;
-struct sgttyb mode;
-
-main(argc, argv)
-char   *argv[];
-{
-       int i;
-
-       gtty(1, &mode);
-       if(argc == 1) {
-               prmodes();
-               exit(0);
-       }
-       while(--argc > 0) {
-
-               arg = *++argv;
-               if (eq("ek")){
-                       mode.sg_erase = '#';
-                       mode.sg_kill = '@';
-               }
-               if (eq("erase")) {
-                       if (**++argv == '^')
-                               mode.sg_erase = (*argv)[1] & 037;
-                       else
-                               mode.sg_erase = **argv;
-                       argc--;
-               }
-               if (eq("kill")) {
-                       if (**++argv == '^')
-                               mode.sg_kill = (*argv)[1] & 037;
-                       else
-                               mode.sg_kill = **argv;
-                       argc--;
-               }
-               if (eq("gspeed")) {
-                       mode.sg_ispeed = B300;
-                       mode.sg_ospeed = B9600;
-               }
-               if (eq("hup")) {
-                       ioctl(1, TIOCHPCL, NULL);
-               } else
-               for(i=0; speeds[i].string; i++)
-                       if(eq(speeds[i].string))
-                               mode.sg_ispeed = mode.sg_ospeed = speeds[i].speed;
-               for(i=0; modes[i].string; i++)
-                       if(eq(modes[i].string)) {
-                               mode.sg_flags &= ~modes[i].reset;
-                               mode.sg_flags |= modes[i].set;
-                       }
-               if(arg)
-                       fprintf(stderr,"unknown mode: %s\n", arg);
-       }
-       stty(1,&mode);
-}
-
-eq(string)
-char *string;
-{
-       int i;
-
-       if(!arg)
-               return(0);
-       i = 0;
-loop:
-       if(arg[i] != string[i])
-               return(0);
-       if(arg[i++] != '\0')
-               goto loop;
-       arg = 0;
-       return(1);
-}
-
-prmodes()
-{
-       register m;
-
-       if(mode.sg_ispeed != mode.sg_ospeed) {
-               prspeed("input speed  ", mode.sg_ispeed);
-               prspeed("output speed ", mode.sg_ospeed);
-       } else
-               prspeed("speed ", mode.sg_ispeed);
-       if (mode.sg_erase < ' ')
-               fprintf(stderr, "erase = '^%c'; ", '@' + mode.sg_erase);
-       else
-               fprintf(stderr, "erase = '%c'; ", mode.sg_erase);
-       if (mode.sg_kill < ' ')
-               fprintf(stderr, "kill = '^%c'\n", '@' + mode.sg_kill);
-       else
-               fprintf(stderr, "kill = '%c'\n", mode.sg_kill);
-       m = mode.sg_flags;
-       if(m & EVENP)   fprintf(stderr,"even ");
-       if(m & ODDP)    fprintf(stderr,"odd ");
-       if(m & RAW)     fprintf(stderr,"raw ");
-       if(m & CRMOD)   fprintf(stderr,"-nl ");
-       if(m & ECHO)    fprintf(stderr,"echo ");
-       if(m & LCASE)   fprintf(stderr,"lcase ");
-       if((m & XTABS)==XTABS)  fprintf(stderr,"-tabs ");
-       if (m & CBREAK) fprintf(stderr,"cbreak ");
-       delay((m&NLDELAY)/NL1,  "nl");
-       if ((m&TBDELAY)!=XTABS)
-               delay((m&TBDELAY)/TAB1, "tab");
-       delay((m&CRDELAY)/CR1,  "cr");
-       delay((m&VTDELAY)/FF1,  "ff");
-       delay((m&BSDELAY)/BS1,  "bs");
-       fprintf(stderr,"\n");
-}
-
-delay(m, s)
-char *s;
-{
-
-       if(m)
-               fprintf(stderr,"%s%d ", s, m);
-}
-
-int    speed[] = {
-       0,50,75,110,134,150,200,300,600,1200,1800,2400,4800,9600,0,0
-};
-
-prspeed(c, s)
-char *c;
-{
-
-       fprintf(stderr,"%s%d baud\n", c, speed[s]);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/su.c b/.ref-Research-V7/usr/src/cmd/su.c
deleted file mode 100644 (file)
index 11ca6fe..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <stdio.h>
-#include <pwd.h>
-
-struct passwd *pwd,*getpwnam();
-char   *crypt();
-char   *getpass();
-char   **environ;
-
-main(argc,argv)
-int    argc;
-char   **argv;
-{
-       register char **p;
-       char *nptr;
-       char *password;
-       int badsw = 0;
-       char *shell = "/bin/sh";
-
-       if(argc > 1)
-               nptr = argv[1];
-       else
-               nptr = "root";
-       if((pwd=getpwnam(nptr)) == NULL) {
-               printf("Unknown id: %s\n",nptr);
-               exit(1);
-       }
-       if(pwd->pw_passwd[0] == '\0' || getuid() == 0)
-               goto ok;
-       password = getpass("Password:");
-       if(badsw || (strcmp(pwd->pw_passwd, crypt(password, pwd->pw_passwd)) != 0)) {
-               printf("Sorry\n");
-               exit(2);
-       }
-
-ok:
-       endpwent();
-       setgid(pwd->pw_gid);
-       setuid(pwd->pw_uid);
-       if (pwd->pw_shell && *pwd->pw_shell)
-               shell = pwd->pw_shell;
-       for (p=environ; *p; p++) {
-               if (strncmp("PS1=", *p, 4) == 0) {
-                       *p = "PS1=# ";
-                       break;
-               }
-       }
-       execl(shell, "su", 0);
-       printf("No shell\n");
-       exit(3);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sum.c b/.ref-Research-V7/usr/src/cmd/sum.c
deleted file mode 100644 (file)
index 64acab1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Sum bytes in file mod 2^16
- */
-
-#include <stdio.h>
-
-main(argc,argv)
-char **argv;
-{
-       register unsigned sum;
-       register i, c;
-       register FILE *f;
-       register long nbytes;
-       int errflg = 0;
-
-       i = 1;
-       do {
-               if(i < argc) {
-                       if ((f = fopen(argv[i], "r")) == NULL) {
-                               fprintf(stderr, "sum: Can't open %s\n", argv[i]);
-                               errflg += 10;
-                               continue;
-                       }
-               } else
-                       f = stdin;
-               sum = 0;
-               nbytes = 0;
-               while ((c = getc(f)) != EOF) {
-                       nbytes++;
-                       if (sum&01)
-                               sum = (sum>>1) + 0x8000;
-                       else
-                               sum >>= 1;
-                       sum += c;
-                       sum &= 0xFFFF;
-               }
-               if (ferror(f)) {
-                       errflg++;
-                       fprintf(stderr, "sum: read error on %s\n", argc>1?argv[i]:"-");
-               }
-               printf("%05u%6ld", sum, (nbytes+BUFSIZ-1)/BUFSIZ);
-               if(argc > 2)
-                       printf(" %s", argv[i]);
-               printf("\n");
-               fclose(f);
-       } while(++i < argc);
-       exit(errflg);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/sync.c b/.ref-Research-V7/usr/src/cmd/sync.c
deleted file mode 100644 (file)
index 3afb9b8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-main()
-{
-
-       sync();
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tabs.c b/.ref-Research-V7/usr/src/cmd/tabs.c
deleted file mode 100644 (file)
index 19ed331..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-#include <stdio.h>
-#include <sgtty.h>
-
-#define SP     ' '
-#define TB     '\t'
-#define NL     '\n'
-
-# define ESC 033
-# define RHM 060
-# define SI 017
-# define DEL 0177
-# define SET '1'
-# define CLR '2'
-# define MGN '9'
-# define CR '\r'
-# define BS '\b'
-
-struct sysnod {
-       char    *sysnam;
-       int     sysval;
-};
-
-#define        DASI300 1
-#define        DASI300S 2
-#define DASI450 3
-#define TN300 4
-#define TTY37 5
-#define HP     6
-struct sysnod tty[] = {
-       {"dasi300", DASI300},
-       {"300", DASI300},
-       {"dasi300s", DASI300S},
-       {"300s", DASI300S},
-       {"dasi450", DASI450},
-       {"450", DASI450},
-       {"37", TTY37},
-       {"tty37", TTY37},
-       {"tn300", TN300},
-       {"terminet", TN300},
-       {"tn", TN300},
-       {"hp",  HP},
-       {0, 0},
-};
-int    margset = 1;
-
-syslook(w)
-char *w;
-{
-       register struct sysnod *sp;
-
-       for (sp = tty; sp->sysnam!=NULL; sp++)
-               if (strcmp(sp->sysnam, w)==0)
-                       return(sp->sysval);
-       return(0);
-}
-
-main(argc,argv)
-int argc; char **argv;
-{
-       struct sgttyb tb;
-       int type;
-
-       type=0;
-       if (argc>=2 && strcmp(argv[1],"-n")==0) {
-               margset--; argc--; argv++;
-       }
-       if (argc>=2) {
-               type=syslook(argv[1]);
-       }
-
-       switch(type) {
-
-               case DASI300:   dasi300(); break;
-
-               case DASI300S:  dasi300(); break;
-
-               case DASI450:   dasi450(); break;
-
-               case TN300:     tn300(); break;
-
-               case TTY37:     tty37(); break;
-
-               case HP:        hp2645(); break;
-
-               default:
-                               gtty (0, &tb);
-                               if ( (tb.sg_flags & (LCASE|CRMOD)) == CRMOD) {
-                                       /* test for CR map on, upper case off, i.e. terminet but not 33 */
-                                       if ((tb.sg_ispeed) == B300) /* test for 300 baud */
-                                               misc();
-                               }
-                               else if ((tb.sg_flags & (CRMOD|LCASE)) == 0 && (tb.sg_ispeed ) == B150) {
-                                       /* apparent model 37 */
-                                       tty37();
-                               }
-       }
-}
-
-clear(n)
-{
-       escape(CLR); 
-       delay(n);
-       putchar(CR); nl();
-}
-
-delay(n)
-{
-       while (n--) putchar(DEL);
-}
-
-tabs(n)
-{
-       int i,j;
-
-       if(margset) n--;
-
-       for( i=0; i<n; ++i ){
-               for( j=0; j<8; ++j ) {
-                       putchar(SP);
-               }
-               escape(SET);
-       }
-}
-
-margin(n)
-{
-       int i;
-
-       if(margset) {
-               for( i=0; i<n; ++i) putchar(SP);
-       }
-}
-
-escape(c)
-{
-       putchar(ESC); putchar(c);
-}
-
-bs(n)
-{
-       while (n--) putchar(BS);
-}
-
-nl()
-{
-       putchar(NL);
-}
-
-
-
-/* ======== terminal types ======== */
-
-dasi450()
-{
-       struct sgttyb t;
-       gtty(0,&t);
-       t.sg_flags &= ~ALLDELAY;
-       stty(0,&t);
-       clear(8); bs(16); margin(8); escape(MGN); nl(); tabs(16);
-       escape(RHM); nl();
-}
-
-tty37()
-{
-       putchar(SI); clear(40); bs(8); tabs(9); nl();
-}
-
-dasi300()
-{
-       clear(8); tabs(15); nl();
-}
-
-tn300()
-{
-       struct sgttyb t;
-       gtty(0,&t);
-       t.sg_flags &= ~ALLDELAY;
-       t.sg_flags |= CR1|BS1;
-       stty(0,&t);
-       clear(8); margin(8); escape(SET); tabs(14); nl();
-}
-
-hp2645()
-{
-       escape('3'); /*clr*/
-       putchar(CR);
-       tabs(10);
-       nl();
-}
-
-misc()
-{
-       tabs(14); nl();
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tail.c b/.ref-Research-V7/usr/src/cmd/tail.c
deleted file mode 100644 (file)
index 974824c..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/* tail command 
- *
- *     tail where [file]
- *     where is +\b_n[type]
- *     - means n lines before end
- *     + means nth line from beginning
- *     type 'b' means tail n blocks, not lines
- *     type 'c' means tail n characters
- *     Type 'r' means in lines in reverse order from end
- *      (for -r, default is entire buffer )
-*/
-#include       <sys/types.h>
-#include       <sys/stat.h>
-#include       <errno.h>
-#define LBIN 4097
-struct stat    statb;
-char bin[LBIN];
-int errno;
-
-main(argc,argv)
-char **argv;
-{
-       long n,di;
-       register i,j,k;
-       char *p;
-       int partial,piped,bylines,bkwds,fromend,lastnl;
-       char *arg;
-       lseek(0,(long)0,1);
-       piped = errno==ESPIPE;
-       arg = argv[1];
-       if(argc<=1 || *arg!='-'&&*arg!='+') {
-               arg = "-10l";
-               argc++;
-               argv--;
-       }
-       fromend = *arg=='-';
-       arg++;
-       n = 0;
-       while(digit(*arg))
-               n = n*10 + *arg++ - '0';
-       if(!fromend&&n>0)
-               n--;
-       if(argc>2) {
-               close(0);
-               if(open(argv[2],0)!=0) {
-                       write(2,"tail: can't open ",17);
-                       write(2,argv[2],strlen(argv[2]));
-                       write(2,"\n",1);
-                       exit(1);
-               }
-       }
-       bylines = 0; bkwds = 0;
-       switch(*arg) {
-       case 'b':
-               n <<= 9;
-               break;
-       case 'c':
-               break;
-       case 'r':
-               if(n==0) n = LBIN;
-               bkwds = 1; fromend = 1; bylines = 1;
-               break;
-       case '\0':
-       case 'l':
-               bylines = 1;
-               break;
-       default:
-               goto errcom;
-       }
-       if(fromend)
-               goto keep;
-
-                       /*seek from beginning */
-
-       if(bylines) {
-               j = 0;
-               while(n-->0) {
-                       do {
-                               if(j--<=0) {
-                                       p = bin;
-                                       j = read(0,p,512);
-                                       if(j--<=0) exit(0);
-                               }
-                       } while(*p++ != '\n');
-               }
-               write(1,p,j);
-       } else  if(n>0) {
-               if(!piped)
-                       fstat(0,&statb);
-               if(piped||(statb.st_mode&S_IFMT)==S_IFCHR)
-                       while(n>0) {
-                               i = n>512?512:n;
-                               i = read(0,bin,i);
-                               if(i<=0) exit(0);
-                               n -= i;
-                       }
-               else
-                       lseek(0,n,0);
-       }
-copy:
-       while((i=read(0,bin,512))>0)
-               write(1,bin,i);
-       exit(0);
-
-                       /*seek from end*/
-
-keep:
-       if(n<=0) exit(0);
-       if(!piped) {
-               fstat(0,&statb);
-               di = !bylines? n: LBIN-1;
-               if(statb.st_size > di)
-                       lseek(0,-di,2);
-               if(!bylines)
-                       goto copy;
-       }
-       partial = 1;
-       for(;;) {
-               i = 0;
-               do {
-                       j = read(0,&bin[i],LBIN-i);
-                       if(j<=0)
-                               goto brka;
-                       i += j;
-               } while(i<LBIN);
-               partial = 0;
-       }
-brka:
-       if(!bylines) {
-               k =
-                   n<=i ? i-n:
-                   partial ? 0:
-                   n>=LBIN ? i+1:
-                   i-n+LBIN;
-               k--;
-       } else {
-               if(bkwds && bin[i==0?LBIN-1:i-1]!='\n'){        /* force trailing newline */
-                       bin[i]='\n';
-                       if(++i>=LBIN) {i = 0; partial = 0;}
-               }
-               k = i;
-               j = 0;
-               do {
-                       lastnl = k;
-                       do {
-                               if(--k<0) {
-                                       if(partial) {
-                                               if(bkwds) write(1,bin,lastnl+1);
-                                               goto brkb;
-                                       }
-                                       k = LBIN -1;
-                               }
-                       } while(bin[k]!='\n'&&k!=i);
-                       if(bkwds && j>0){
-                               if(k<lastnl) write(1,&bin[k+1],lastnl-k);
-                               else {
-                                       write(1,&bin[k+1],LBIN-k-1);
-                                       write(1,bin,lastnl+1);
-                               }
-                       }
-               } while(j++<n&&k!=i);
-brkb:
-               if(bkwds) exit(0);
-               if(k==i) do {
-                       if(++k>=LBIN)
-                               k = 0;
-               } while(bin[k]!='\n'&&k!=i);
-       }
-       if(k<i)
-               write(1,&bin[k+1],i-k-1);
-       else {
-               write(1,&bin[k+1],LBIN-k-1);
-               write(1,bin,i);
-       }
-       exit(0);
-errcom:
-       write(2,"usage: tail +\b_n[lbcr] [file]\n",30);
-       exit(1);
-}
-
-digit(c)
-{
-       return(c>='0'&&c<='9');
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tar/makefile b/.ref-Research-V7/usr/src/cmd/tar/makefile
deleted file mode 100644 (file)
index 63d4413..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-V6LIB=/usr/src/libc/v6
-CFLAGS=-O
-
-all:   tar
-
-cp:    all
-       cp tar /bin
-       rm -f tar *.o
-
-cmp:   all
-       cmp tar /bin/tar
-       rm -f tar *.o
-
-tar:   tar.c
-       cc -i -s -O tar.c -o tar
-
-v6tar: tar.o access.o chown.o execl.o ftime.o gtty.o lseek.o stat.o syscall.o time.o
-       cc -i -s -O *.o -o v6tar
-
-access.o:      $(V6LIB)/access.c
-       cc -c -O $?
-
-chown.o:       $(V6LIB)/chown.c
-       cc -c -O $?
-
-execl.o:       $(V6LIB)/execl.c
-       cc -c -O $?
-
-ftime.o:       $(V6LIB)/ftime.c
-       cc -c -O $?
-
-gtty.o:        $(V6LIB)/gtty.c
-       cc -c -O $?
-
-lseek.o:       $(V6LIB)/lseek.c
-       cc -c -O $?
-
-stat.o:        $(V6LIB)/stat.c
-       cc -c -O $?
-
-syscall.o:     $(V6LIB)/syscall.s
-       cc -c -O $?
-
-time.o:        $(V6LIB)/time.s
-       cc -c -O $?
diff --git a/.ref-Research-V7/usr/src/cmd/tar/tar.c b/.ref-Research-V7/usr/src/cmd/tar/tar.c
deleted file mode 100644 (file)
index 9725252..0000000
+++ /dev/null
@@ -1,933 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include <signal.h>
-
-char   *sprintf();
-char   *strcat();
-daddr_t        bsrch();
-#define TBLOCK 512
-#define NBLOCK 20
-#define NAMSIZ 100
-union hblock {
-       char dummy[TBLOCK];
-       struct header {
-               char name[NAMSIZ];
-               char mode[8];
-               char uid[8];
-               char gid[8];
-               char size[12];
-               char mtime[12];
-               char chksum[8];
-               char linkflag;
-               char linkname[NAMSIZ];
-       } dbuf;
-} dblock, tbuf[NBLOCK];
-
-struct linkbuf {
-       ino_t   inum;
-       dev_t   devnum;
-       int     count;
-       char    pathname[NAMSIZ];
-       struct  linkbuf *nextp;
-} *ihead;
-
-struct stat stbuf;
-
-int    rflag, xflag, vflag, tflag, mt, cflag, mflag;
-int    term, chksum, wflag, recno, first, linkerrok;
-int    freemem = 1;
-int    nblock = 1;
-
-daddr_t        low;
-daddr_t        high;
-
-FILE   *tfile;
-char   tname[] = "/tmp/tarXXXXXX";
-
-
-char   *usefile;
-char   magtape[]       = "/dev/mt1";
-
-char   *malloc();
-
-main(argc, argv)
-int    argc;
-char   *argv[];
-{
-       char *cp;
-       int onintr(), onquit(), onhup(), onterm();
-
-       if (argc < 2)
-               usage();
-
-       tfile = NULL;
-       usefile =  magtape;
-       argv[argc] = 0;
-       argv++;
-       for (cp = *argv++; *cp; cp++) 
-               switch(*cp) {
-               case 'f':
-                       usefile = *argv++;
-                       if (nblock == 1)
-                               nblock = 0;
-                       break;
-               case 'c':
-                       cflag++;
-                       rflag++;
-                       break;
-               case 'u':
-                       mktemp(tname);
-                       if ((tfile = fopen(tname, "w")) == NULL) {
-                               fprintf(stderr, "Tar: cannot create temporary file (%s)\n", tname);
-                               done(1);
-                       }
-                       fprintf(tfile, "!!!!!/!/!/!/!/!/!/! 000\n");
-                       /* FALL THROUGH */
-               case 'r':
-                       rflag++;
-                       if (nblock != 1 && cflag == 0) {
-noupdate:
-                               fprintf(stderr, "Tar: Blocked tapes cannot be updated (yet)\n");
-                               done(1);
-                       }
-                       break;
-               case 'v':
-                       vflag++;
-                       break;
-               case 'w':
-                       wflag++;
-                       break;
-               case 'x':
-                       xflag++;
-                       break;
-               case 't':
-                       tflag++;
-                       break;
-               case 'm':
-                       mflag++;
-                       break;
-               case '-':
-                       break;
-               case '0':
-               case '1':
-                       magtape[7] = *cp;
-                       usefile = magtape;
-                       break;
-               case 'b':
-                       nblock = atoi(*argv++);
-                       if (nblock > NBLOCK || nblock <= 0) {
-                               fprintf(stderr, "Invalid blocksize. (Max %d)\n", NBLOCK);
-                               done(1);
-                       }
-                       if (rflag && !cflag)
-                               goto noupdate;
-                       break;
-               case 'l':
-                       linkerrok++;
-                       break;
-               default:
-                       fprintf(stderr, "tar: %c: unknown option\n", *cp);
-                       usage();
-               }
-
-       if (rflag) {
-               if (cflag && tfile != NULL) {
-                       usage();
-                       done(1);
-               }
-               if (signal(SIGINT, SIG_IGN) != SIG_IGN)
-                       signal(SIGINT, onintr);
-               if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
-                       signal(SIGHUP, onhup);
-               if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
-                       signal(SIGQUIT, onquit);
-/*
-               if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
-                       signal(SIGTERM, onterm);
-*/
-               if (strcmp(usefile, "-") == 0) {
-                       if (cflag == 0) {
-                               fprintf(stderr, "Can only create standard output archives\n");
-                               done(1);
-                       }
-                       mt = dup(1);
-                       nblock = 1;
-               }
-               else if ((mt = open(usefile, 2)) < 0) {
-                       if (cflag == 0 || (mt =  creat(usefile, 0666)) < 0) {
-                               fprintf(stderr, "tar: cannot open %s\n", usefile);
-                               done(1);
-                       }
-               }
-               if (cflag == 0 && nblock == 0)
-                       nblock = 1;
-               dorep(argv);
-       }
-       else if (xflag)  {
-               if (strcmp(usefile, "-") == 0) {
-                       mt = dup(0);
-                       nblock = 1;
-               }
-               else if ((mt = open(usefile, 0)) < 0) {
-                       fprintf(stderr, "tar: cannot open %s\n", usefile);
-                       done(1);
-               }
-               doxtract(argv);
-       }
-       else if (tflag) {
-               if (strcmp(usefile, "-") == 0) {
-                       mt = dup(0);
-                       nblock = 1;
-               }
-               else if ((mt = open(usefile, 0)) < 0) {
-                       fprintf(stderr, "tar: cannot open %s\n", usefile);
-                       done(1);
-               }
-               dotable();
-       }
-       else
-               usage();
-       done(0);
-}
-
-usage()
-{
-       fprintf(stderr, "tar: usage  tar -{txru}[cvfblm] [tapefile] [blocksize] file1 file2...\n");
-       done(1);
-}
-
-dorep(argv)
-char   *argv[];
-{
-       register char *cp, *cp2;
-       char wdir[60];
-
-       if (!cflag) {
-               getdir();
-               do {
-                       passtape();
-                       if (term)
-                               done(0);
-                       getdir();
-               } while (!endtape());
-               if (tfile != NULL) {
-                       char buf[200];
-
-                       strcat(buf, "sort +0 -1 +1nr ");
-                       strcat(buf, tname);
-                       strcat(buf, " -o ");
-                       strcat(buf, tname);
-                       sprintf(buf, "sort +0 -1 +1nr %s -o %s; awk '$1 != prev {print; prev=$1}' %s >%sX;mv %sX %s",
-                               tname, tname, tname, tname, tname, tname);
-                       fflush(tfile);
-                       system(buf);
-                       freopen(tname, "r", tfile);
-                       fstat(fileno(tfile), &stbuf);
-                       high = stbuf.st_size;
-               }
-       }
-
-       getwdir(wdir);
-       while (*argv && ! term) {
-               cp2 = *argv;
-               for (cp = *argv; *cp; cp++)
-                       if (*cp == '/')
-                               cp2 = cp;
-               if (cp2 != *argv) {
-                       *cp2 = '\0';
-                       chdir(*argv);
-                       *cp2 = '/';
-                       cp2++;
-               }
-               putfile(*argv++, cp2);
-               chdir(wdir);
-       }
-       putempty();
-       putempty();
-       flushtape();
-       if (linkerrok == 1)
-               for (; ihead != NULL; ihead = ihead->nextp)
-                       if (ihead->count != 0)
-                               fprintf(stderr, "Missing links to %s\n", ihead->pathname);
-}
-
-endtape()
-{
-       if (dblock.dbuf.name[0] == '\0') {
-               backtape();
-               return(1);
-       }
-       else
-               return(0);
-}
-
-getdir()
-{
-       register struct stat *sp;
-       int i;
-
-       readtape( (char *) &dblock);
-       if (dblock.dbuf.name[0] == '\0')
-               return;
-       sp = &stbuf;
-       sscanf(dblock.dbuf.mode, "%o", &i);
-       sp->st_mode = i;
-       sscanf(dblock.dbuf.uid, "%o", &i);
-       sp->st_uid = i;
-       sscanf(dblock.dbuf.gid, "%o", &i);
-       sp->st_gid = i;
-       sscanf(dblock.dbuf.size, "%lo", &sp->st_size);
-       sscanf(dblock.dbuf.mtime, "%lo", &sp->st_mtime);
-       sscanf(dblock.dbuf.chksum, "%o", &chksum);
-       if (chksum != checksum()) {
-               fprintf(stderr, "directory checksum error\n");
-               done(2);
-       }
-       if (tfile != NULL)
-               fprintf(tfile, "%s %s\n", dblock.dbuf.name, dblock.dbuf.mtime);
-}
-
-passtape()
-{
-       long blocks;
-       char buf[TBLOCK];
-
-       if (dblock.dbuf.linkflag == '1')
-               return;
-       blocks = stbuf.st_size;
-       blocks += TBLOCK-1;
-       blocks /= TBLOCK;
-
-       while (blocks-- > 0)
-               readtape(buf);
-}
-
-putfile(longname, shortname)
-char *longname;
-char *shortname;
-{
-       int infile;
-       long blocks;
-       char buf[TBLOCK];
-       register char *cp, *cp2;
-       struct direct dbuf;
-       int i, j;
-
-       infile = open(shortname, 0);
-       if (infile < 0) {
-               fprintf(stderr, "tar: %s: cannot open file\n", longname);
-               return;
-       }
-
-       fstat(infile, &stbuf);
-
-       if (tfile != NULL && checkupdate(longname) == 0) {
-               close(infile);
-               return;
-       }
-       if (checkw('r', longname) == 0) {
-               close(infile);
-               return;
-       }
-
-       if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
-               for (i = 0, cp = buf; *cp++ = longname[i++];);
-               *--cp = '/';
-               cp++;
-               i = 0;
-               chdir(shortname);
-               while (read(infile, (char *)&dbuf, sizeof(dbuf)) > 0 && !term) {
-                       if (dbuf.d_ino == 0) {
-                               i++;
-                               continue;
-                       }
-                       if (strcmp(".", dbuf.d_name) == 0 || strcmp("..", dbuf.d_name) == 0) {
-                               i++;
-                               continue;
-                       }
-                       cp2 = cp;
-                       for (j=0; j < DIRSIZ; j++)
-                               *cp2++ = dbuf.d_name[j];
-                       *cp2 = '\0';
-                       close(infile);
-                       putfile(buf, cp);
-                       infile = open(".", 0);
-                       i++;
-                       lseek(infile, (long) (sizeof(dbuf) * i), 0);
-               }
-               close(infile);
-               chdir("..");
-               return;
-       }
-       if ((stbuf.st_mode & S_IFMT) != S_IFREG) {
-               fprintf(stderr, "tar: %s is not a file. Not dumped\n", longname);
-               return;
-       }
-
-       tomodes(&stbuf);
-
-       cp2 = longname;
-       for (cp = dblock.dbuf.name, i=0; (*cp++ = *cp2++) && i < NAMSIZ; i++);
-       if (i >= NAMSIZ) {
-               fprintf(stderr, "%s: file name too long\n", longname);
-               close(infile);
-               return;
-       }
-
-       if (stbuf.st_nlink > 1) {
-               struct linkbuf *lp;
-               int found = 0;
-
-               for (lp = ihead; lp != NULL; lp = lp->nextp) {
-                       if (lp->inum == stbuf.st_ino && lp->devnum == stbuf.st_dev) {
-                               found++;
-                               break;
-                       }
-               }
-               if (found) {
-                       strcpy(dblock.dbuf.linkname, lp->pathname);
-                       dblock.dbuf.linkflag = '1';
-                       sprintf(dblock.dbuf.chksum, "%6o", checksum());
-                       writetape( (char *) &dblock);
-                       if (vflag) {
-                               fprintf(stderr, "a %s ", longname);
-                               fprintf(stderr, "link to %s\n", lp->pathname);
-                       }
-                       lp->count--;
-                       close(infile);
-                       return;
-               }
-               else {
-                       lp = (struct linkbuf *) malloc(sizeof(*lp));
-                       if (lp == NULL) {
-                               if (freemem) {
-                                       fprintf(stderr, "Out of memory. Link information lost\n");
-                                       freemem = 0;
-                               }
-                       }
-                       else {
-                               lp->nextp = ihead;
-                               ihead = lp;
-                               lp->inum = stbuf.st_ino;
-                               lp->devnum = stbuf.st_dev;
-                               lp->count = stbuf.st_nlink - 1;
-                               strcpy(lp->pathname, longname);
-                       }
-               }
-       }
-
-       blocks = (stbuf.st_size + (TBLOCK-1)) / TBLOCK;
-       if (vflag) {
-               fprintf(stderr, "a %s ", longname);
-               fprintf(stderr, "%ld blocks\n", blocks);
-       }
-       sprintf(dblock.dbuf.chksum, "%6o", checksum());
-       writetape( (char *) &dblock);
-
-       while ((i = read(infile, buf, TBLOCK)) > 0 && blocks > 0) {
-               writetape(buf);
-               blocks--;
-       }
-       close(infile);
-       if (blocks != 0 || i != 0)
-               fprintf(stderr, "%s: file changed size\n", longname);
-       while (blocks-- >  0)
-               putempty();
-}
-
-
-
-doxtract(argv)
-char   *argv[];
-{
-       long blocks, bytes;
-       char buf[TBLOCK];
-       char **cp;
-       int ofile;
-
-       for (;;) {
-               getdir();
-               if (endtape())
-                       break;
-
-               if (*argv == 0)
-                       goto gotit;
-
-               for (cp = argv; *cp; cp++)
-                       if (prefix(*cp, dblock.dbuf.name))
-                               goto gotit;
-               passtape();
-               continue;
-
-gotit:
-               if (checkw('x', dblock.dbuf.name) == 0) {
-                       passtape();
-                       continue;
-               }
-
-               checkdir(dblock.dbuf.name);
-
-               if (dblock.dbuf.linkflag == '1') {
-                       unlink(dblock.dbuf.name);
-                       if (link(dblock.dbuf.linkname, dblock.dbuf.name) < 0) {
-                               fprintf(stderr, "%s: cannot link\n", dblock.dbuf.name);
-                               continue;
-                       }
-                       if (vflag)
-                               fprintf(stderr, "%s linked to %s\n", dblock.dbuf.name, dblock.dbuf.linkname);
-                       continue;
-               }
-               if ((ofile = creat(dblock.dbuf.name, stbuf.st_mode & 07777)) < 0) {
-                       fprintf(stderr, "tar: %s - cannot create\n", dblock.dbuf.name);
-                       passtape();
-                       continue;
-               }
-
-               chown(dblock.dbuf.name, stbuf.st_uid, stbuf.st_gid);
-
-               blocks = ((bytes = stbuf.st_size) + TBLOCK-1)/TBLOCK;
-               if (vflag)
-                       fprintf(stderr, "x %s, %ld bytes, %ld tape blocks\n", dblock.dbuf.name, bytes, blocks);
-               while (blocks-- > 0) {
-                       readtape(buf);
-                       if (bytes > TBLOCK) {
-                               if (write(ofile, buf, TBLOCK) < 0) {
-                                       fprintf(stderr, "tar: %s: HELP - extract write error\n", dblock.dbuf.name);
-                                       done(2);
-                               }
-                       } else
-                               if (write(ofile, buf, (int) bytes) < 0) {
-                                       fprintf(stderr, "tar: %s: HELP - extract write error\n", dblock.dbuf.name);
-                                       done(2);
-                               }
-                       bytes -= TBLOCK;
-               }
-               close(ofile);
-               if (mflag == 0) {
-                       time_t timep[2];
-
-                       timep[0] = time(NULL);
-                       timep[1] = stbuf.st_mtime;
-                       utime(dblock.dbuf.name, timep);
-               }
-       }
-}
-
-dotable()
-{
-       for (;;) {
-               getdir();
-               if (endtape())
-                       break;
-               if (vflag)
-                       longt(&stbuf);
-               printf("%s", dblock.dbuf.name);
-               if (dblock.dbuf.linkflag == '1')
-                       printf(" linked to %s", dblock.dbuf.linkname);
-               printf("\n");
-               passtape();
-       }
-}
-
-putempty()
-{
-       char buf[TBLOCK];
-       char *cp;
-
-       for (cp = buf; cp < &buf[TBLOCK]; )
-               *cp++ = '\0';
-       writetape(buf);
-}
-
-longt(st)
-register struct stat *st;
-{
-       register char *cp;
-       char *ctime();
-
-       pmode(st);
-       printf("%3d/%1d", st->st_uid, st->st_gid);
-       printf("%7D", st->st_size);
-       cp = ctime(&st->st_mtime);
-       printf(" %-12.12s %-4.4s ", cp+4, cp+20);
-}
-
-#define        SUID    04000
-#define        SGID    02000
-#define        ROWN    0400
-#define        WOWN    0200
-#define        XOWN    0100
-#define        RGRP    040
-#define        WGRP    020
-#define        XGRP    010
-#define        ROTH    04
-#define        WOTH    02
-#define        XOTH    01
-#define        STXT    01000
-int    m1[] = { 1, ROWN, 'r', '-' };
-int    m2[] = { 1, WOWN, 'w', '-' };
-int    m3[] = { 2, SUID, 's', XOWN, 'x', '-' };
-int    m4[] = { 1, RGRP, 'r', '-' };
-int    m5[] = { 1, WGRP, 'w', '-' };
-int    m6[] = { 2, SGID, 's', XGRP, 'x', '-' };
-int    m7[] = { 1, ROTH, 'r', '-' };
-int    m8[] = { 1, WOTH, 'w', '-' };
-int    m9[] = { 2, STXT, 't', XOTH, 'x', '-' };
-
-int    *m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
-
-pmode(st)
-register struct stat *st;
-{
-       register int **mp;
-
-       for (mp = &m[0]; mp < &m[9];)
-               select(*mp++, st);
-}
-
-select(pairp, st)
-int *pairp;
-struct stat *st;
-{
-       register int n, *ap;
-
-       ap = pairp;
-       n = *ap++;
-       while (--n>=0 && (st->st_mode&*ap++)==0)
-               ap++;
-       printf("%c", *ap);
-}
-
-checkdir(name)
-register char *name;
-{
-       register char *cp;
-       int i;
-       for (cp = name; *cp; cp++) {
-               if (*cp == '/') {
-                       *cp = '\0';
-                       if (access(name, 01) < 0) {
-                               if (fork() == 0) {
-                                       execl("/bin/mkdir", "mkdir", name, 0);
-                                       execl("/usr/bin/mkdir", "mkdir", name, 0);
-                                       fprintf(stderr, "tar: cannot find mkdir!\n");
-                                       done(0);
-                               }
-                               while (wait(&i) >= 0);
-                               chown(name, stbuf.st_uid, stbuf.st_gid);
-                       }
-                       *cp = '/';
-               }
-       }
-}
-
-onintr()
-{
-       signal(SIGINT, SIG_IGN);
-       term++;
-}
-
-onquit()
-{
-       signal(SIGQUIT, SIG_IGN);
-       term++;
-}
-
-onhup()
-{
-       signal(SIGHUP, SIG_IGN);
-       term++;
-}
-
-onterm()
-{
-       signal(SIGTERM, SIG_IGN);
-       term++;
-}
-
-tomodes(sp)
-register struct stat *sp;
-{
-       register char *cp;
-
-       for (cp = dblock.dummy; cp < &dblock.dummy[TBLOCK]; cp++)
-               *cp = '\0';
-       sprintf(dblock.dbuf.mode, "%6o ", sp->st_mode & 07777);
-       sprintf(dblock.dbuf.uid, "%6o ", sp->st_uid);
-       sprintf(dblock.dbuf.gid, "%6o ", sp->st_gid);
-       sprintf(dblock.dbuf.size, "%11lo ", sp->st_size);
-       sprintf(dblock.dbuf.mtime, "%11lo ", sp->st_mtime);
-}
-
-checksum()
-{
-       register i;
-       register char *cp;
-
-       for (cp = dblock.dbuf.chksum; cp < &dblock.dbuf.chksum[sizeof(dblock.dbuf.chksum)]; cp++)
-               *cp = ' ';
-       i = 0;
-       for (cp = dblock.dummy; cp < &dblock.dummy[TBLOCK]; cp++)
-               i += *cp;
-       return(i);
-}
-
-checkw(c, name)
-char *name;
-{
-       if (wflag) {
-               printf("%c ", c);
-               if (vflag)
-                       longt(&stbuf);
-               printf("%s: ", name);
-               if (response() == 'y'){
-                       return(1);
-               }
-               return(0);
-       }
-       return(1);
-}
-
-response()
-{
-       char c;
-
-       c = getchar();
-       if (c != '\n')
-               while (getchar() != '\n');
-       else c = 'n';
-       return(c);
-}
-
-checkupdate(arg)
-char   *arg;
-{
-       char name[100];
-       long    mtime;
-       daddr_t seekp;
-       daddr_t lookup();
-
-       rewind(tfile);
-       for (;;) {
-               if ((seekp = lookup(arg)) < 0)
-                       return(1);
-               fseek(tfile, seekp, 0);
-               fscanf(tfile, "%s %lo", name, &mtime);
-               if (stbuf.st_mtime > mtime)
-                       return(1);
-               else
-                       return(0);
-       }
-}
-
-done(n)
-{
-       unlink(tname);
-       exit(n);
-}
-
-prefix(s1, s2)
-register char *s1, *s2;
-{
-       while (*s1)
-               if (*s1++ != *s2++)
-                       return(0);
-       if (*s2)
-               return(*s2 == '/');
-       return(1);
-}
-
-getwdir(s)
-char *s;
-{
-       int i;
-       int     pipdes[2];
-
-       pipe(pipdes);
-       if ((i = fork()) == 0) {
-               close(1);
-               dup(pipdes[1]);
-               execl("/bin/pwd", "pwd", 0);
-               execl("/usr/bin/pwd", "pwd", 0);
-               fprintf(stderr, "pwd failed!\n");
-               printf("/\n");
-               exit(1);
-       }
-       while (wait((int *)NULL) != -1)
-                       ;
-       read(pipdes[0], s, 50);
-       while(*s != '\n')
-               s++;
-       *s = '\0';
-       close(pipdes[0]);
-       close(pipdes[1]);
-}
-
-#define        N       200
-int    njab;
-daddr_t
-lookup(s)
-char *s;
-{
-       register i;
-       daddr_t a;
-
-       for(i=0; s[i]; i++)
-               if(s[i] == ' ')
-                       break;
-       a = bsrch(s, i, low, high);
-       return(a);
-}
-
-daddr_t
-bsrch(s, n, l, h)
-daddr_t l, h;
-char *s;
-{
-       register i, j;
-       char b[N];
-       daddr_t m, m1;
-
-       njab = 0;
-
-loop:
-       if(l >= h)
-               return(-1L);
-       m = l + (h-l)/2 - N/2;
-       if(m < l)
-               m = l;
-       fseek(tfile, m, 0);
-       fread(b, 1, N, tfile);
-       njab++;
-       for(i=0; i<N; i++) {
-               if(b[i] == '\n')
-                       break;
-               m++;
-       }
-       if(m >= h)
-               return(-1L);
-       m1 = m;
-       j = i;
-       for(i++; i<N; i++) {
-               m1++;
-               if(b[i] == '\n')
-                       break;
-       }
-       i = cmp(b+j, s, n);
-       if(i < 0) {
-               h = m;
-               goto loop;
-       }
-       if(i > 0) {
-               l = m1;
-               goto loop;
-       }
-       return(m);
-}
-
-cmp(b, s, n)
-char *b, *s;
-{
-       register i;
-
-       if(b[0] != '\n')
-               exit(2);
-       for(i=0; i<n; i++) {
-               if(b[i+1] > s[i])
-                       return(-1);
-               if(b[i+1] < s[i])
-                       return(1);
-       }
-       return(b[i+1] == ' '? 0 : -1);
-}
-
-readtape(buffer)
-char *buffer;
-{
-       int i, j;
-
-       if (recno >= nblock || first == 0) {
-               if (first == 0 && nblock == 0)
-                       j = NBLOCK;
-               else
-                       j = nblock;
-               if ((i = read(mt, tbuf, TBLOCK*j)) < 0) {
-                       fprintf(stderr, "Tar: tape read error\n");
-                       done(3);
-               }
-               if (first == 0) {
-                       if ((i % TBLOCK) != 0) {
-                               fprintf(stderr, "Tar: tape blocksize error\n");
-                               done(3);
-                       }
-                       i /= TBLOCK;
-                       if (rflag && i != 1) {
-                               fprintf(stderr, "Tar: Cannot update blocked tapes (yet)\n");
-                               done(4);
-                       }
-                       if (i != nblock && i != 1) {
-                               fprintf(stderr, "Tar: blocksize = %d\n", i);
-                               nblock = i;
-                       }
-               }
-               recno = 0;
-       }
-       first = 1;
-       copy(buffer, &tbuf[recno++]);
-       return(TBLOCK);
-}
-
-writetape(buffer)
-char *buffer;
-{
-       first = 1;
-       if (nblock == 0)
-               nblock = 1;
-       if (recno >= nblock) {
-               if (write(mt, tbuf, TBLOCK*nblock) < 0) {
-                       fprintf(stderr, "Tar: tape write error\n");
-                       done(2);
-               }
-               recno = 0;
-       }
-       copy(&tbuf[recno++], buffer);
-       if (recno >= nblock) {
-               if (write(mt, tbuf, TBLOCK*nblock) < 0) {
-                       fprintf(stderr, "Tar: tape write error\n");
-                       done(2);
-               }
-               recno = 0;
-       }
-       return(TBLOCK);
-}
-
-backtape()
-{
-       lseek(mt, (long) -TBLOCK, 1);
-       if (recno >= nblock) {
-               recno = nblock - 1;
-               if (read(mt, tbuf, TBLOCK*nblock) < 0) {
-                       fprintf(stderr, "Tar: tape read error after seek\n");
-                       done(4);
-               }
-               lseek(mt, (long) -TBLOCK, 1);
-       }
-}
-
-flushtape()
-{
-       write(mt, tbuf, TBLOCK*nblock);
-}
-
-copy(to, from)
-register char *to, *from;
-{
-       register i;
-
-       i = TBLOCK;
-       do {
-               *to++ = *from++;
-       } while (--i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/makefile b/.ref-Research-V7/usr/src/cmd/tbl/makefile
deleted file mode 100644 (file)
index e1be8b8..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-CFLAGS=-O -n -s
-all:   tbl
-       :
-
-cp:    tbl
-       cp tbl /bin/tbl
-       rm tbl *.o
-
-cmp:   tbl
-       cmp tbl /bin/tbl
-       rm tbl *.o
-
-tbl: t0.o t1.o t2.o t3.o t4.o t5.o t6.o t7.o t8.o t9.o tb.o tc.o te.o tf.o tg.o ti.o tm.o ts.o tt.o tu.o tv.o
-       cc -i -s -O t?.o -o tbl
-t0.o t1.o t2.o t3.o t4.o t5.o t6.o t7.o t8.o t9.o tb.o tc.o te.o tf.o tg.o ti.o tm.o ts.o tt.o tu.o tv.o: t..c
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t..c b/.ref-Research-V7/usr/src/cmd/tbl/t..c
deleted file mode 100644 (file)
index 4334622..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* t..c : external declarations */
-
-# include "stdio.h"
-# include "ctype.h"
-
-# define MAXLIN 200
-# define MAXHEAD 30
-# define MAXCOL 20
-# define MAXCHS 2000
-# define MAXRPT 100
-# define CLLEN 10
-# define SHORTLINE 4
-extern int nlin, ncol, iline, nclin, nslin;
-extern int style[MAXHEAD][MAXCOL];
-extern int ctop[MAXHEAD][MAXCOL];
-extern char font[MAXHEAD][MAXCOL][2];
-extern char csize[MAXHEAD][MAXCOL][4];
-extern char vsize[MAXHEAD][MAXCOL][4];
-extern char cll[MAXCOL][CLLEN];
-extern int stynum[];
-extern int F1, F2;
-extern int lefline[MAXHEAD][MAXCOL];
-extern int fullbot[];
-extern char *instead[];
-extern int expflg;
-extern int ctrflg;
-extern int evenflg;
-extern int evenup[];
-extern int boxflg;
-extern int dboxflg;
-extern int linsize;
-extern int tab;
-extern int pr1403;
-extern int linsize, delim1, delim2;
-extern int allflg;
-extern int textflg;
-extern int left1flg;
-extern int rightl;
-struct colstr {char *col, *rcol;};
-extern struct colstr *table[];
-extern char *cspace, *cstore;
-extern char *exstore, *exlim;
-extern int sep[];
-extern int used[], lused[], rused[];
-extern int linestop[];
-extern int leftover;
-extern char *last, *ifile;
-extern int texname;
-extern int texct, texmax;
-extern char texstr[];
-extern int linstart;
-
-
-extern FILE *tabin, *tabout;
-# define CRIGHT 80
-# define CLEFT 40
-# define CMID 60
-# define S1 31
-# define S2 32
-# define TMP 38
-# define SF 35
-# define SL 34
-# define LSIZE 33
-# define SIND 37
-# define SVS 36
-/* this refers to the relative position of lines */
-# define LEFT 1
-# define RIGHT 2
-# define THRU 3
-# define TOP 1
-# define BOT 2
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t0.c b/.ref-Research-V7/usr/src/cmd/tbl/t0.c
deleted file mode 100644 (file)
index 5ad82c6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
- /* t0.c: storage allocation */
-#
-# include "t..c"
-int expflg = 0;
-int ctrflg = 0;
-int boxflg = 0;
-int dboxflg = 0;
-int tab = '\t';
-int linsize;
-int pr1403;
-int delim1, delim2;
-int evenup[MAXCOL], evenflg;
-int F1 = 0;
-int F2 = 0;
-int allflg = 0;
-int leftover = 0;
-int textflg = 0;
-int left1flg = 0;
-int rightl = 0;
-char *cstore, *cspace;
-char *last;
-struct colstr *table[MAXLIN];
-int style[MAXHEAD][MAXCOL];
-int ctop[MAXHEAD][MAXCOL];
-char font[MAXHEAD][MAXCOL][2];
-char csize[MAXHEAD][MAXCOL][4];
-char vsize[MAXHEAD][MAXCOL][4];
-int lefline[MAXHEAD][MAXCOL];
-char cll[MAXCOL][CLLEN];
-/*char *rpt[MAXHEAD][MAXCOL];*/
-/*char rpttx[MAXRPT];*/
-int stynum[MAXLIN+1];
-int nslin, nclin;
-int sep[MAXCOL];
-int fullbot[MAXLIN];
-char *instead[MAXLIN];
-int used[MAXCOL], lused[MAXCOL], rused[MAXCOL];
-int linestop[MAXLIN];
-int nlin, ncol;
-int iline = 1;
-char *ifile = "Input";
-int texname = 'a';
-int texct = 0;
-char texstr[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ0123456789";
-int linstart;
-char *exstore, *exlim;
-FILE *tabin  /*= stdin */;
-FILE *tabout  /* = stdout */;
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t1.c b/.ref-Research-V7/usr/src/cmd/tbl/t1.c
deleted file mode 100644 (file)
index 20efa17..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
- /* t1.c: main control and input switching */
-#
-# include "t..c"
-#include <signal.h>
-# ifdef gcos
-/* required by GCOS because file is passed to "tbl" by troff preprocessor */
-# define _f1 _f
-extern FILE *_f[];
-# endif
-
-# ifdef unix
-# define MACROS "/usr/lib/tmac.s"
-# define PYMACS "/usr/lib/tmac.m"
-# endif
-
-# ifdef gcos
-# define MACROS "cc/troff/smac"
-# define PYMACS "cc/troff/mmac"
-# endif
-
-# define ever (;;)
-
-main(argc,argv)
-       char *argv[];
-{
-# ifdef unix
-int badsig();
-signal(SIGPIPE, badsig);
-# endif
-# ifdef gcos
-if(!intss()) tabout = fopen("qq", "w"); /* default media code is type 5 */
-# endif
-exit(tbl(argc,argv));
-}
-
-
-tbl(argc,argv)
-       char *argv[];
-{
-char line[512];
-/* required by GCOS because "stdout" is set by troff preprocessor */
-tabin=stdin; tabout=stdout;
-setinp(argc,argv);
-while (gets1(line))
-       {
-       fprintf(tabout, "%s\n",line);
-       if (prefix(".TS", line))
-               tableput();
-       }
-fclose(tabin);
-return(0);
-}
-int sargc;
-char **sargv;
-setinp(argc,argv)
-       char **argv;
-{
-       sargc = argc;
-       sargv = argv;
-       sargc--; sargv++;
-       if (sargc>0)
-               swapin();
-}
-swapin()
-{
-       while (sargc>0 && **sargv=='-')
-               {
-               if (match("-ms", *sargv))
-                       {
-                       *sargv = MACROS;
-                       break;
-                       }
-               if (match("-mm", *sargv))
-                       {
-                       *sargv = PYMACS;
-                       break;
-                       }
-               if (match("-TX", *sargv))
-                       pr1403=1;
-               sargc--; sargv++;
-               }
-       if (sargc<=0) return(0);
-# ifdef unix
-/* file closing is done by GCOS troff preprocessor */
-       if (tabin!=stdin) fclose(tabin);
-# endif
-       tabin = fopen(ifile= *sargv, "r");
-       iline=1;
-# ifdef unix
-/* file names are all put into f. by the GCOS troff preprocessor */
-       fprintf(tabout, ".ds f. %s\n",ifile);
-# endif
-       if (tabin==NULL)
-               error("Can't open file");
-       sargc--;
-       sargv++;
-       return(1);
-}
-# ifdef unix
-badsig()
-{
-signal(SIGPIPE, 1);
- exit(0);
-}
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t2.c b/.ref-Research-V7/usr/src/cmd/tbl/t2.c
deleted file mode 100644 (file)
index 780dc79..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
- /* t2.c:  subroutine sequencing for one table */
-# include "t..c"
-tableput()
-{
-saveline();
-savefill();
-ifdivert();
-cleanfc();
-getcomm();
-getspec();
-gettbl();
-getstop();
-checkuse();
-choochar();
-maktab();
-runout();
-release();
-rstofill();
-endoff();
-restline();
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t3.c b/.ref-Research-V7/usr/src/cmd/tbl/t3.c
deleted file mode 100644 (file)
index b5c1e6e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
- /* t3.c: interpret commands affecting whole table */
-# include "t..c"
-struct optstr {char *optnam; int *optadd;} options [] {
-       "expand", &expflg,
-       "EXPAND", &expflg,
-       "center", &ctrflg,
-       "CENTER", &ctrflg,
-       "box", &boxflg,
-       "BOX", &boxflg,
-       "allbox", &allflg,
-       "ALLBOX", &allflg,
-       "doublebox", &dboxflg,
-       "DOUBLEBOX", &dboxflg,
-       "frame", &boxflg,
-       "FRAME", &boxflg,
-       "doubleframe", &dboxflg,
-       "DOUBLEFRAME", &dboxflg,
-       "tab", &tab,
-       "TAB", &tab,
-       "linesize", &linsize,
-       "LINESIZE", &linsize,
-       "delim", &delim1,
-       "DELIM", &delim1,
-       0,0};
-getcomm()
-{
-char line[200], *cp, nb[25], *t;
-struct optstr *lp;
-int c, ci, found;
-for(lp= options; lp->optnam; lp++)
-       *(lp->optadd) = 0;
-texname = texstr[texct=0];
-tab = '\t';
-printf(".nr %d \\n(.s\n", LSIZE);
-gets1(line);
-/* see if this is a command line */
-if (index(line,';') == NULL)
-       {
-       backrest(line);
-       return;
-       }
-for(cp=line; (c = *cp) != ';'; cp++)
-       {
-       if (!letter(c)) continue;
-       found=0;
-       for(lp= options; lp->optadd; lp++)
-               {
-               if (prefix(lp->optnam, cp))
-                       {
-                       *(lp->optadd) = 1;
-                       cp += strlen(lp->optnam);
-                       if (letter(*cp))
-                               error("Misspelled global option");
-                       while (*cp==' ')cp++;
-                       t=nb;
-                       if ( *cp == '(')
-                               while ((ci= *++cp) != ')')
-                                       *t++ = ci;
-                       else cp--;
-                       *t++ = 0; *t=0;
-                       if (lp->optadd == &tab)
-                               {
-                               if (nb[0])
-                                       *(lp->optadd) = nb[0];
-                               }
-                       if (lp->optadd == &linsize)
-                               printf(".nr %d %s\n", LSIZE, nb);
-                       if (lp->optadd == &delim1)
-                               {
-                               delim1 = nb[0];
-                               delim2 = nb[1];
-                               }
-                       found=1;
-                       break;
-                       }
-               }
-       if (!found)
-               error("Illegal option");
-       }
-cp++;
-backrest(cp);
-return;
-}
-backrest(cp)
-       char *cp;
-{
-char *s;
-for(s=cp; *s; s++);
-un1getc('\n');
-while (s>cp)
-       un1getc(*--s);
-return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t4.c b/.ref-Research-V7/usr/src/cmd/tbl/t4.c
deleted file mode 100644 (file)
index 61ad357..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
- /* t4.c: read table specification */
-# include "t..c"
-int oncol;
-getspec()
-{
-int icol, i;
-for(icol=0; icol<MAXCOL; icol++)
-       {
-       sep[icol]= -1;
-       evenup[icol]=0;
-       cll[icol][0]=0;
-       for(i=0; i<MAXHEAD; i++)
-               {
-               csize[i][icol][0]=0;
-               vsize[i][icol][0]=0;
-               font[i][icol][0] = lefline[i][icol] = 0;
-               ctop[i][icol]=0;
-               style[i][icol]= 'l';
-               }
-       }
-nclin=ncol=0;
-oncol =0;
-left1flg=rightl=0;
-readspec();
-fprintf(tabout, ".rm");
-for(i=0; i<ncol; i++)
-       fprintf(tabout, " %02d", 80+i);
-fprintf(tabout, "\n");
-}
-readspec()
-{
-int icol, c, sawchar, stopc, i;
-char sn[10], *snp, *temp;
-sawchar=icol=0;
-while (c=get1char())
-       {
-       switch(c)
-               {
-               default:
-                       if (c != tab)
-                       error("bad table specification character");
-               case ' ': /* note this is also case tab */
-                       continue;
-               case '\n':
-                       if(sawchar==0) continue;
-               case ',':
-               case '.': /* end of table specification */
-                       ncol = max(ncol, icol);
-                       if (lefline[nclin][ncol]>0) {ncol++; rightl++;};
-                       if(sawchar)
-                               nclin++;
-                       if (nclin>=MAXHEAD)
-                               error("too many lines in specification");
-                       icol=0;
-                       if (ncol==0 || nclin==0)
-                               error("no specification");
-                       if (c== '.')
-                               {
-                               while ((c=get1char()) && c != '\n')
-                                       if (c != ' ' && c != '\t')
-                                               error("dot not last character on format line");
-                               /* fix up sep - default is 3 except at edge */
-                               for(icol=0; icol<ncol; icol++)
-                                       if (sep[icol]<0)
-                                               sep[icol] =  icol+1<ncol ? 3 : 1;
-                               if (oncol == 0)
-                                       oncol = ncol;
-                               else if (oncol +2 <ncol)
-                                       error("tried to widen table in T&, not allowed");
-                               return;
-                               }
-                       sawchar=0;
-                       continue;
-               case 'C': case 'S': case 'R': case 'N': case 'L':  case 'A':
-                       c += ('a'-'A');
-               case '_': if (c=='_') c= '-';
-               case '=': case '-':
-               case '^':
-               case 'c': case 's': case 'n': case 'r': case 'l':  case 'a':
-                       style[nclin][icol]=c;
-                       if (c== 's' && icol<=0)
-                               error("first column can not be S-type");
-                       if (c=='s' && style[nclin][icol-1] == 'a')
-                               {
-                               fprintf(tabout, ".tm warning: can't span a-type cols, changed to l\n");
-                               style[nclin][icol-1] = 'l';
-                               }
-                       if (c=='s' && style[nclin][icol-1] == 'n')
-                               {
-                               fprintf(tabout, ".tm warning: can't span n-type cols, changed to c\n");
-                               style[nclin][icol-1] = 'c';
-                               }
-                       icol++;
-                       if (c=='^' && nclin<=0)
-                               error("first row can not contain vertical span");
-                       if (icol>=MAXCOL)
-                               error("too many columns in table");
-                       sawchar=1;
-                       continue;
-               case 'b': case 'i': 
-                       c += 'A'-'a';
-               case 'B': case 'I':
-                       if (icol==0) continue;
-                       snp=font[nclin][icol-1];
-                       snp[0]= (c=='I' ? '2' : '3');
-                       snp[1]=0;
-                       continue;
-               case 't': case 'T':
-                       if (icol>0)
-                       ctop[nclin][icol-1] = 1;
-                       continue;
-               case 'd': case 'D':
-                       if (icol>0)
-                       ctop[nclin][icol-1] = -1;
-                       continue;
-               case 'f': case 'F':
-                       if (icol==0) continue;
-                       snp=font[nclin][icol-1];
-                       snp[0]=snp[1]=stopc=0;
-                       for(i=0; i<2; i++)
-                               {
-                               c = get1char();
-                               if (i==0 && c=='(')
-                                       {
-                                       stopc=')';
-                                       c = get1char();
-                                       }
-                               if (c==0) break;
-                               if (c==stopc) {stopc=0; break;}
-                               if (stopc==0)  if (c==' ' || c== tab ) break;
-                               if (c=='\n'){un1getc(c); break;}
-                               snp[i] = c;
-                               if (c>= '0' && c<= '9') break;
-                               }
-                       if (stopc) if (get1char()!=stopc)
-                               error("Nonterminated font name");
-                       continue;
-               case 'P': case 'p':
-                       if (icol<=0) continue;
-                       temp = snp = csize[nclin][icol-1];
-                       while (c = get1char())
-                               {
-                               if (c== ' ' || c== tab || c=='\n') break;
-                               if (c=='-' || c == '+')
-                                       if (snp>temp)
-                                               break;
-                                       else
-                                               *snp++=c;
-                               else
-                               if (digit(c))
-                                       *snp++ = c;
-                               else break;
-                               if (snp-temp>4)
-                                       error("point size too large");
-                               }
-                       *snp = 0;
-                       if (atoi(temp)>36)
-                               error("point size unreasonable");
-                       un1getc (c);
-                       continue;
-               case 'V': case 'v':
-                       if (icol<=0) continue;
-                       temp = snp = vsize[nclin][icol-1];
-                       while (c = get1char())
-                               {
-                               if (c== ' ' || c== tab || c=='\n') break;
-                               if (c=='-' || c == '+')
-                                       if (snp>temp)
-                                               break;
-                                       else
-                                               *snp++=c;
-                               else
-                               if (digit(c))
-                                       *snp++ = c;
-                               else break;
-                               if (snp-temp>4)
-                                       error("vertical spacing value too large");
-                               }
-                       *snp=0;
-                       un1getc(c);
-                       continue;
-               case 'w': case 'W':
-                       snp = cll [icol-1];
-               /* Dale Smith didn't like this check - possible to have two text blocks
-                  of different widths now ....
-                       if (*snp)
-                               {
-                               fprintf(tabout, "Ignored second width specification");
-                               continue;
-                               }
-               /* end commented out code ... */
-                       stopc=0;
-                       while (c = get1char())
-                               {
-                               if (snp==cll[icol-1] && c=='(')
-                                       {
-                                       stopc = ')';
-                                       continue;
-                                       }
-                               if ( !stopc && (c>'9' || c< '0'))
-                                       break;
-                               if (stopc && c== stopc)
-                                       break;
-                               *snp++ =c;
-                               }
-                       *snp=0;
-                       if (snp-cll[icol-1]>CLLEN)
-                               error ("column width too long");
-                       if (!stopc)
-                               un1getc(c);
-                       continue;
-               case 'e': case 'E':
-                       if (icol<1) continue;
-                       evenup[icol-1]=1;
-                       evenflg=1;
-                       continue;
-               case '0': case '1': case '2': case '3': case '4':
-               case '5': case '6': case '7': case '8': case '9': 
-                       sn[0] = c;
-                       snp=sn+1;
-                       while (digit(*snp++ = c = get1char()))
-                               ;
-                       un1getc(c);
-                       sep[icol-1] = max(sep[icol-1], numb(sn));
-                       continue;
-               case '|':
-                       lefline[nclin][icol]++;
-                       if (icol==0) left1flg=1;
-                       continue;
-               }
-       }
-error("EOF reading table specification");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t5.c b/.ref-Research-V7/usr/src/cmd/tbl/t5.c
deleted file mode 100644 (file)
index 1cc245f..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
- /* t5.c: read data for table */
-# include "t..c"
-gettbl()
-{
-int icol, ch;
-cstore=cspace= chspace();
-textflg=0;
-for (nlin=nslin=0; gets1(cstore); nlin++)
-       {
-       stynum[nlin]=nslin;
-       if (prefix(".TE", cstore))
-               {
-               leftover=0;
-               break;
-               }
-       if (prefix(".TC", cstore) || prefix(".T&", cstore))
-               {
-               readspec();
-               nslin++;
-               }
-       if (nlin>=MAXLIN)
-               {
-               leftover=cstore;
-               break;
-               }
-       fullbot[nlin]=0;
-       if (cstore[0] == '.' && !isdigit(cstore[1]))
-               {
-               instead[nlin] = cstore;
-               while (*cstore++);
-               continue;
-               }
-       else instead[nlin] = 0;
-       if (nodata(nlin))
-               {
-               if (ch = oneh(nlin))
-                       fullbot[nlin]= ch;
-               nlin++;
-               nslin++;
-               instead[nlin]=fullbot[nlin]=0;
-               }
-       table[nlin] = alocv((ncol+2)*sizeof(table[0][0]));
-       if (cstore[1]==0)
-       switch(cstore[0])
-               {
-               case '_': fullbot[nlin]= '-'; continue;
-               case '=': fullbot[nlin]= '='; continue;
-               }
-       stynum[nlin] = nslin;
-       nslin = min(nslin+1, nclin-1);
-       for (icol = 0; icol <ncol; icol++)
-               {
-               table[nlin][icol].col = cstore;
-               table[nlin][icol].rcol=0;
-               ch=1;
-               if (match(cstore, "T{")) /* text follows */
-                       table[nlin][icol].col =
-                               gettext(cstore, nlin, icol,
-                                       font[stynum[nlin]][icol],
-                                       csize[stynum[nlin]][icol]);
-               else
-                       {
-                       for(; (ch= *cstore) != '\0' && ch != tab; cstore++)
-                                       ;
-                       *cstore++ = '\0';
-                       switch(ctype(nlin,icol)) /* numerical or alpha, subcol */
-                               {
-                               case 'n':
-                                       table[nlin][icol].rcol = maknew(table[nlin][icol].col);
-                                       break;
-                               case 'a':
-                                       table[nlin][icol].rcol = table[nlin][icol].col;
-                                       table[nlin][icol].col = "";
-                                       break;
-                               }
-                       }
-               while (ctype(nlin,icol+1)== 's') /* spanning */
-                       table[nlin][++icol].col = "";
-               if (ch == '\0') break;
-               }
-       while (++icol <ncol+2)
-               {
-               table[nlin][icol].col = "";
-               table [nlin][icol].rcol=0;
-               }
-       while (*cstore != '\0')
-                cstore++;
-       if (cstore-cspace > MAXCHS)
-               cstore = cspace = chspace();
-       }
-last = cstore;
-permute();
-if (textflg) untext();
-return;
-}
-nodata(il)
-{
-int c;
-for (c=0; c<ncol;c++)
-       {
-       switch(ctype(il,c))
-               {
-               case 'c': case 'n': case 'r': case 'l': case 's': case 'a':
-                       return(0);
-               }
-       }
-return(1);
-}
-oneh(lin)
-{
-int k, icol;
-k = ctype(lin,0);
-for(icol=1; icol<ncol; icol++)
-       {
-       if (k != ctype(lin,icol))
-               return(0);
-       }
-return(k);
-}
-# define SPAN "\\^"
-permute()
-{
-int irow, jcol, is;
-char *start, *strig;
-for(jcol=0; jcol<ncol; jcol++)
-       {
-       for(irow=1; irow<nlin; irow++)
-               {
-               if (vspand(irow,jcol,0))
-                       {
-                       is = prev(irow);
-                       if (is<0)
-                               error("Vertical spanning in first row not allowed");
-                       start = table[is][jcol].col;
-                       strig = table[is][jcol].rcol;
-                       while (irow<nlin &&vspand(irow,jcol,0))
-                               irow++;
-                       table[--irow][jcol].col = start;
-                       table[irow][jcol].rcol = strig;
-                       while (is<irow)
-                               {
-                               table[is][jcol].rcol =0;
-                               table[is][jcol].col= SPAN;
-                               is = next(is);
-                               }
-                       }
-               }
-       }
-}
-vspand(ir,ij,ifform)
-{
-if (ir<0) return(0);
-if (ir>=nlin)return(0);
-if (instead[ir]) return(0);
-if (ifform==0 && ctype(ir,ij)=='^') return(1);
-if (table[ir][ij].rcol!=0) return(0);
-if (fullbot[ir]) return(0);
-return(vspen(table[ir][ij].col));
-}
-vspen(s)
-       char *s;
-{
-if (s==0) return(0);
-if (!point(s)) return(0);
-return(match(s, SPAN));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t6.c b/.ref-Research-V7/usr/src/cmd/tbl/t6.c
deleted file mode 100644 (file)
index 3909b98..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
- /* t6.c: compute tab stops */
-# define tx(a) (a>0 && a<128)
-# include "t..c"
-maktab()
-{
-# define FN(i,c) font[stynum[i]][c]
-# define SZ(i,c) csize[stynum[i]][c]
-/* define the tab stops of the table */
-int icol, ilin, tsep, k, ik, vforml, il, text;
-int doubled[MAXCOL], acase[MAXCOL];
-char *s;
-for(icol=0; icol <ncol; icol++)
-       {
-       doubled[icol] = acase[icol] = 0;
-       fprintf(tabout, ".nr %d 0\n", icol+CRIGHT);
-   for(text=0; text<2; text++)
-       {
-       if (text)
-               fprintf(tabout, ".%02d\n.rm %02d\n", icol+80, icol+80);
-       for(ilin=0; ilin<nlin; ilin++)
-               {
-               if (instead[ilin]|| fullbot[ilin]) continue;
-               vforml=ilin;
-               for(il=prev(ilin); il>=0 && vspen(table[il][icol].col); il=prev(il))
-                       vforml=il;
-               if (fspan(vforml,icol)) continue;
-               if (filler(table[ilin][icol].col)) continue;
-               switch(ctype(vforml,icol))
-                       {
-                       case 'a':
-                               acase[icol]=1;
-                               s = table[ilin][icol].col;
-                               if (s>0 && s<128 && text)
-                                       {
-                                       if (doubled[icol]==0)
-                                               fprintf(tabout, ".nr %d 0\n.nr %d 0\n",S1,S2);
-                                       doubled[icol]=1;
-                                       fprintf(tabout, ".if \\n(%c->\\n(%d .nr %d \\n(%c-\n",s,S2,S2,s);
-                                       }
-                       case 'n':
-                               if (table[ilin][icol].rcol!=0)
-                                       {
-                                       if (doubled[icol]==0 && text==0)
-                                               fprintf(tabout, ".nr %d 0\n.nr %d 0\n", S1, S2);
-                                       doubled[icol]=1;
-                                       if (real(s=table[ilin][icol].col) && !vspen(s))
-                                               {
-                                               if (tx(s) != text) continue;
-                                               fprintf(tabout, ".nr %d ", TMP);
-                                               wide(s, FN(vforml,icol), SZ(vforml,icol)); fprintf(tabout, "\n");
-                                               fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n", S1, TMP, S1, TMP);
-                                               }
-                                       if (text==0 && real(s=table[ilin][icol].rcol) && !vspen(s) && !barent(s))
-                                               {
-                                               fprintf(tabout, ".nr %d \\w%c%s%c\n",TMP, F1, s, F1);
-                                               fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n",S2,TMP,S2,TMP);
-                                               }
-                                       continue;
-                                       }
-                       case 'r':
-                       case 'c':
-                       case 'l':
-                               if (real(s=table[ilin][icol].col) && !vspen(s))
-                                       {
-                                       if (tx(s) != text) continue;
-                                       fprintf(tabout, ".nr %d ", TMP);
-                                       wide(s, FN(vforml,icol), SZ(vforml,icol)); fprintf(tabout, "\n");
-                                       fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n", icol+CRIGHT, TMP, icol+CRIGHT, TMP);
-                                       }
-                       }
-               }
-               }
-       if (acase[icol])
-               {
-               fprintf(tabout, ".if \\n(%d>=\\n(%d .nr %d \\n(%du+2n\n",S2,icol+CRIGHT,icol+CRIGHT,S2);
-               }
-       if (doubled[icol])
-               {
-               fprintf(tabout, ".nr %d \\n(%d\n", icol+CMID, S1);
-               fprintf(tabout, ".nr %d \\n(%d+\\n(%d\n",TMP,icol+CMID,S2);
-               fprintf(tabout, ".if \\n(%d>\\n(%d .nr %d \\n(%d\n",TMP,icol+CRIGHT,icol+CRIGHT,TMP);
-               fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d +(\\n(%d-\\n(%d)/2\n",TMP,icol+CRIGHT,icol+CMID,icol+CRIGHT,TMP);
-               }
-       if (cll[icol][0])
-               {
-               fprintf(tabout, ".nr %d %sn\n", TMP, cll[icol]);
-               fprintf(tabout, ".if \\n(%d<\\n(%d .nr %d \\n(%d\n",icol+CRIGHT, TMP, icol+CRIGHT, TMP);
-               }
-       for(ilin=0; ilin<nlin; ilin++)
-       if (k=lspan(ilin, icol))
-               {
-               s=table[ilin][icol-k].col;
-               if (!real(s) || barent(s) || vspen(s) ) continue;
-               fprintf(tabout, ".nr %d ", TMP);
-               wide(table[ilin][icol-k].col, FN(ilin,icol-k), SZ(ilin,icol-k));
-               for(ik=k; ik>=0; ik--)
-                       {
-                       fprintf(tabout, "-\\n(%d",CRIGHT+icol-ik);
-                       if (!expflg && ik>0) fprintf(tabout, "-%dn", sep[icol-ik]);
-                       }
-               fprintf(tabout, "\n");
-               fprintf(tabout, ".if \\n(%d>0 .nr %d \\n(%d/%d\n", TMP, TMP, TMP, k);
-               fprintf(tabout, ".if \\n(%d<0 .nr %d 0\n", TMP, TMP);
-               for(ik=1; ik<=k; ik++)
-                       {
-                       if (doubled[icol-k+ik])
-                               fprintf(tabout, ".nr %d +\\n(%d/2\n", icol-k+ik+CMID, TMP);
-                       fprintf(tabout, ".nr %d +\\n(%d\n", icol-k+ik+CRIGHT, TMP);
-                       }
-               }
-       }
-if (textflg) untext();
-/* if even requested, make all columns widest width */
-# define TMP1 S1
-# define TMP2 S2
-if (evenflg)
-       {
-       fprintf(tabout, ".nr %d 0\n", TMP);
-       for(icol=0; icol<ncol; icol++)
-               {
-               if (evenup[icol]==0) continue;
-               fprintf(tabout, ".if \\n(%d>\\n(%d .nr %d \\n(%d\n",
-               icol+CRIGHT, TMP, TMP, icol+CRIGHT);
-               }
-       for(icol=0; icol<ncol; icol++)
-               {
-               if (evenup[icol]==0)
-                       /* if column not evened just retain old interval */
-                       continue;
-               if (doubled[icol])
-                       fprintf(tabout, ".nr %d (100*\\n(%d/\\n(%d)*\\n(%d/100\n",
-                               icol+CMID, icol+CMID, icol+CRIGHT, TMP);
-                               /* that nonsense with the 100's and parens tries
-                                  to avoid overflow while proportionally shifting
-                                  the middle of the number */
-               fprintf(tabout, ".nr %d \\n(%d\n", icol+CRIGHT, TMP);
-               }
-       }
-/* now adjust for total table width */
-for(tsep=icol=0; icol<ncol; icol++)
-       tsep+= sep[icol];
-if (expflg)
-       {
-       fprintf(tabout, ".nr %d 0", TMP);
-       for(icol=0; icol<ncol; icol++)
-               fprintf(tabout, "+\\n(%d", icol+CRIGHT);
-       fprintf(tabout, "\n");
-       fprintf(tabout, ".nr %d \\n(.l-\\n(%d\n", TMP, TMP);
-       if (boxflg || dboxflg || allflg)
-               tsep += 1;
-       else
-               tsep -= sep[ncol-1];
-       fprintf(tabout, ".nr %d \\n(%d/%d\n", TMP, TMP,  tsep);
-       fprintf(tabout, ".if \\n(%d<0 .nr %d 0\n", TMP, TMP);
-       }
-else
-       fprintf(tabout, ".nr %d 1n\n", TMP);
-fprintf(tabout, ".nr %d 0\n",CRIGHT-1);
-tsep= (boxflg || allflg || dboxflg || left1flg) ? 1 : 0;
-for(icol=0; icol<ncol; icol++)
-       {
-       fprintf(tabout, ".nr %d \\n(%d+(%d*\\n(%d)\n",icol+CLEFT, icol+CRIGHT-1, tsep, TMP);
-       fprintf(tabout, ".nr %d +\\n(%d\n",icol+CRIGHT, icol+CLEFT);
-       if (doubled[icol])
-               {
-               /* the next line is last-ditch effort to avoid zero field width */
-               /*fprintf(tabout, ".if \\n(%d=0 .nr %d 1\n",icol+CMID, icol+CMID);*/
-               fprintf(tabout, ".nr %d +\\n(%d\n", icol+CMID, icol+CLEFT);
-       /*  fprintf(tabout, ".if n .if \\n(%d%%24>0 .nr %d +12u\n",icol+CMID, icol+CMID); */
-               }
-       tsep=sep[icol];
-       }
-if (rightl)
-       fprintf(tabout, ".nr %d (\\n(%d+\\n(%d)/2\n",ncol+CRIGHT-1, ncol+CLEFT-1, ncol+CRIGHT-2);
-fprintf(tabout, ".nr TW \\n(%d\n", ncol+CRIGHT-1);
-if (boxflg || allflg || dboxflg)
-       fprintf(tabout, ".nr TW +%d*\\n(%d\n", sep[ncol-1], TMP);
-fprintf(tabout,
- ".if t .if (\\n(TW+\\n(.o)>7.65i .tm Table at line %d file %s is too wide - \\n(TW units\n", iline-1, ifile);
-return;
-}
-wide(s, fn, size)
-       char *s, *size, *fn;
-{
-if (point(s))
-       {
-       fprintf(tabout, "\\w%c", F1);
-       if (*fn>0) putfont(fn);
-       if (*size) putsize(size);
-       fprintf(tabout, "%s", s);
-       if (*fn>0) putfont("P");
-       if (*size) putsize("0");
-       fprintf(tabout, "%c",F1);
-       }
-else
-       fprintf(tabout, "\\n(%c-", s);
-}
-filler(s)
-       char *s;
-{
-return (point(s) && s[0]=='\\' && s[1] == 'R');
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t7.c b/.ref-Research-V7/usr/src/cmd/tbl/t7.c
deleted file mode 100644 (file)
index 40bb471..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
- /* t7.c: control to write table entries */
-# include "t..c"
-# define realsplit ((ct=='a'||ct=='n') && table[ldata][c].rcol)
-runout()
-{
-int i;
-if (boxflg || allflg || dboxflg) need();
-if (ctrflg)
-       {
-       fprintf(tabout, ".nr #I \\n(.i\n");
-       fprintf(tabout, ".in +(\\n(.lu-\\n(TWu-\\n(.iu)/2u\n");
-       }
-fprintf(tabout, ".fc %c %c\n", F1, F2);
-fprintf(tabout, ".nr #T 0-1\n");
-deftail();
-for(i=0; i<nlin; i++)
-       putline(i,i);
-if (leftover)
-       yetmore();
-fprintf(tabout, ".fc\n");
-fprintf(tabout, ".nr T. 1\n");
-fprintf(tabout, ".T# 1\n");
-if (ctrflg)
-       fprintf(tabout, ".in \\n(#Iu\n");
-}
-runtabs(lform, ldata)
-{
-int c, ct, vforml, lf;
-fprintf(tabout, ".ta ");
-for(c=0; c<ncol; c++)
-       {
-       vforml=lform;
-       for(lf=prev(lform); lf>=0 && vspen(table[lf][c].col); lf=prev(lf))
-               vforml=lf;
-       if (fspan(vforml,c))
-               continue;
-       switch(ct=ctype(vforml,c))
-               {
-               case 'n':
-               case 'a':
-                       if (table[ldata][c].rcol)
-                         if (lused[c]) /*Zero field width*/
-                               fprintf(tabout, "\\n(%du ",c+CMID);
-               case 'c':
-               case 'l':
-               case 'r':
-                   if (realsplit? rused[c]: (used[c]+lused[c]))
-                       fprintf(tabout, "\\n(%du ",c+CRIGHT);
-                       continue;
-               case 's':
-                       if (lspan(lform, c))
-                               fprintf(tabout, "\\n(%du ", c+CRIGHT);
-                       continue;
-               }
-       }
-fprintf(tabout, "\n");
-}
-ifline(s)
-       char *s;
-{
-if (s[0] == '\\') s++;
-if (s[1] ) return(0);
-if (s[0] == '_') return('-');
-if (s[0] == '=') return('=');
-return(0);
-}
-need()
-{
-int texlin, horlin, i;
-for(texlin=horlin=i=0; i<nlin; i++)
-       {
-       if (fullbot[i]!=0)
-               horlin++;
-       else
-       if (instead[i]!=0)
-               continue;
-       else
-               texlin++;
-       }
-fprintf(tabout, ".ne %dv+%dp\n",texlin,2*horlin);
-}
-deftail()
-{
-int i, c, lf, lwid;
-for(i=0; i<MAXHEAD; i++)
-       if (linestop[i])
-               fprintf(tabout, ".nr #%c 0-1\n", linestop[i]+'a'-1);
-fprintf(tabout, ".nr #a 0-1\n");
-fprintf(tabout, ".eo\n");
-fprintf(tabout, ".de T#\n");
-fprintf(tabout, ".ds #d .d\n");
-fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
-       fprintf(tabout, ".mk ##\n");
-       fprintf(tabout, ".nr ## -1v\n");
-       fprintf(tabout, ".ls 1\n");
-       for(i=0; i<MAXHEAD; i++)
-               if (linestop[i])
-                       fprintf(tabout, ".if \\n(#T>=0 .nr #%c \\n(#T\n",linestop[i]+'a'-1);
-if (boxflg || allflg || dboxflg) /* bottom of table line */
-       if (fullbot[nlin-1]==0)
-               {
-               if (!pr1403)
-                       fprintf(tabout, ".if \\n(T. .vs \\n(.vu-\\n(.sp\n");
-               fprintf(tabout, ".if \\n(T. ");
-               drawline(nlin,0,ncol, dboxflg ? '=' : '-',1,0);
-               fprintf(tabout, "\n.if \\n(T. .vs\n");
-               /* T. is really an argument to a macro but because of 
-                  eqn we don't dare pass it as an argument and reference by $1 */
-               }
-       for(c=0; c<ncol; c++)
-               {
-               if ((lf=left(nlin-1,c, &lwid))>=0)
-                       {
-                       fprintf(tabout, ".if \\n(#%c>=0 .sp -1\n",linestop[lf]+'a'-1);
-                       fprintf(tabout, ".if \\n(#%c>=0 ", linestop[lf]+'a'-1);
-                       tohcol(c);
-                       drawvert(lf, nlin-1, c, lwid);
-                       fprintf(tabout, "\\h'|\\n(TWu'\n");
-                       }
-               }
-       if (boxflg || allflg || dboxflg) /* right hand line */
-               {
-               fprintf(tabout, ".if \\n(#a>=0 .sp -1\n");
-               fprintf(tabout, ".if \\n(#a>=0 \\h'|\\n(TWu'");
-               drawvert (0, nlin-1, ncol, dboxflg? 2 : 1);
-               fprintf(tabout, "\n");
-               }
-fprintf(tabout, ".ls\n");
-fprintf(tabout, "..\n");
-fprintf(tabout, ".ec\n");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t8.c b/.ref-Research-V7/usr/src/cmd/tbl/t8.c
deleted file mode 100644 (file)
index 5f837c0..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
- /* t8.c: write out one line of output table */
-# include "t..c"
-# define realsplit ((ct=='a'||ct=='n') && table[nl][c].rcol)
-int watchout;
-int once;
-int topat[MAXCOL];
-putline(i, nl)
-       /* i is line number for deciding format */
-       /* nl is line number for finding data   usually identical */
-{
-int c, lf, ct, form, lwid, vspf, ip, cmidx, exvspen, vforml;
-int vct, chfont;
-char *s, *size, *fn;
-watchout=vspf=exvspen=0;
-if (i==0) once=0;
-if (i==0 && ( allflg || boxflg || dboxflg))
-       fullwide(0,   dboxflg? '=' : '-');
-if (instead[nl]==0 && fullbot[nl] ==0)
-for(c=0; c<ncol; c++)
-       {
-       s = table[nl][c].col;
-       if (s==0) continue;
-       if (vspen(s))
-               {
-               for(ip=nl; ip<nlin; ip=next(ip))
-                       if (!vspen(s=table[ip][c].col)) break;
-               if (s>0 && s<128)
-               fprintf(tabout, ".ne \\n(%c|u+\\n(.Vu\n",s);
-               continue;
-               }
-       if (point(s)) continue;
-       fprintf(tabout, ".ne \\n(%c|u+\\n(.Vu\n",s);
-       watchout=1;
-       }
-if (linestop[nl])
-       fprintf(tabout, ".mk #%c\n", linestop[nl]+'a'-1);
-lf = prev(nl);
-if (instead[nl])
-       {
-       puts(instead[nl]);
-       return;
-       }
-if (fullbot[nl])
-       {
-       switch (ct=fullbot[nl])
-               {
-               case '=':
-               case '-':
-                       fullwide(nl,ct);
-               }
-       return;
-       }
-for(c=0; c<ncol; c++)
-       {
-       if (instead[nl]==0 && fullbot[nl]==0)
-       if (vspen(table[nl][c].col)) vspf=1;
-       if (lf>=0)
-               if (vspen(table[lf][c].col)) vspf=1;
-       }
-if (vspf)
-       {
-       fprintf(tabout, ".nr #^ \\n(\\*(#du\n");
-       fprintf(tabout, ".nr #- \\n(#^\n"); /* current line position relative to bottom */
-       }
-vspf=0;
-chfont=0;
-for(c=0; c<ncol; c++)
-       {
-       s = table[nl][c].col;
-       if (s==0) continue;
-       chfont |= (font[stynum[nl]][c]);
-       if (point(s) ) continue;
-       lf=prev(nl);
-       if (lf>=0 && vspen(table[lf][c].col))
-               fprintf(tabout, ".if (\\n(%c|+\\n(^%c-1v)>\\n(#- .nr #- +(\\n(%c|+\\n(^%c-\\n(#--1v)\n",s,'a'+c,s,'a'+c);
-       else
-               fprintf(tabout, ".if (\\n(%c|+\\n(#^-1v)>\\n(#- .nr #- +(\\n(%c|+\\n(#^-\\n(#--1v)\n",s,s);
-       }
-if (allflg && once>0 )
-       fullwide(i,'-');
-once=1;
-runtabs(i, nl);
-if (allh(i) && !pr1403)
-       {
-       fprintf(tabout, ".nr %d \\n(.v\n", SVS);
-       fprintf(tabout, ".vs \\n(.vu-\\n(.sp\n");
-       }
-if (chfont)
-       fprintf(tabout, ".nr %2d \\n(.f\n", S1);
-fprintf(tabout, ".nr 35 1m\n");
-fprintf(tabout, "\\&");
-vct = 0;
-for(c=0; c<ncol; c++)
-       {
-       if (watchout==0 && i+1<nlin && (lf=left(i,c, &lwid))>=0)
-               {
-               tohcol(c);
-               drawvert(lf, i, c, lwid);
-               vct += 2;
-               }
-       if (rightl && c+1==ncol) continue;
-       vforml=i;
-       for(lf=prev(nl); lf>=0 && vspen(table[lf][c].col); lf=prev(lf))
-               vforml= lf;
-       form= ctype(vforml,c);
-       if (form != 's')
-               {
-               ct = c+CLEFT;
-               if (form=='a') ct = c+CMID;
-               if (form=='n' && table[nl][c].rcol && lused[c]==0) ct= c+CMID;
-               fprintf(tabout, "\\h'|\\n(%du'", ct);
-               }
-       s= table[nl][c].col;
-       fn = font[stynum[vforml]][c];
-       size = csize[stynum[vforml]][c];
-       if (*size==0)size=0;
-       switch(ct=ctype(vforml, c))
-               {
-               case 'n':
-               case 'a':
-                       if (table[nl][c].rcol)
-                               {
-                          if (lused[c]) /*Zero field width*/
-                               {
-                               ip = prev(nl);
-                               if (ip>=0)
-                               if (vspen(table[ip][c].col))
-                                       {
-                                       if (exvspen==0)
-                                               {
-                                               fprintf(tabout, "\\v'-(\\n(\\*(#du-\\n(^%cu", c+'a');
-                                               if (cmidx)
-                                                       fprintf(tabout, "-((\\n(#-u-\\n(^%cu)/2u)", c+'a');
-                                               vct++;
-                                               fprintf(tabout, "'");
-                                               exvspen=1;
-                                               }
-                                       }
-                               fprintf(tabout, "%c%c",F1,F2);
-                               puttext(s,fn,size);
-                               fprintf(tabout, "%c",F1);
-                               }
-                               s= table[nl][c].rcol;
-                               form=1;
-                               break;
-                               }
-               case 'c':
-                       form=3; break;
-               case 'r':
-                       form=2; break;
-               case 'l':
-                       form=1; break;
-               case '-':
-               case '=':
-                       if (real(table[nl][c].col))
-                               fprintf(stderr,"%s: line %d: Data ignored on table line %d\n", ifile, iline-1, i+1);
-                       makeline(i,c,ct);
-                       continue;
-               default:
-                       continue;
-               }
-       if (realsplit ? rused[c]: used[c]) /*Zero field width*/
-               {
-               /* form: 1 left, 2 right, 3 center adjust */
-               if (ifline(s))
-                       {
-                       makeline(i,c,ifline(s));
-                       continue;
-                       }
-               if (filler(s))
-                       {
-                       printf("\\l'|\\n(%du\\&%s'", c+CRIGHT, s+2);
-                       continue;
-                       }
-               ip = prev(nl);
-               cmidx = ctop[stynum[nl]][c]==0;
-               if (ip>=0)
-               if (vspen(table[ip][c].col))
-                       {
-                       if (exvspen==0)
-                               {
-                               fprintf(tabout, "\\v'-(\\n(\\*(#du-\\n(^%cu", c+'a');
-                               if (cmidx)
-                                       fprintf(tabout, "-((\\n(#-u-\\n(^%cu)/2u)", c+'a');
-                               vct++;
-                               fprintf(tabout, "'");
-                               }
-                       }
-               fprintf(tabout, "%c", F1);
-               if (form!= 1)
-                       fprintf(tabout, "%c", F2);
-               if (vspen(s))
-                       vspf=1;
-               else
-               puttext(s, fn, size);
-               if (form !=2)
-                       fprintf(tabout, "%c", F2);
-               fprintf(tabout, "%c", F1);
-               }
-       if (ip>=0)
-       if (vspen(table[ip][c].col))
-               {
-               exvspen = (c+1 < ncol) && vspen(table[ip][c+1].col) &&
-                       (topat[c] == topat[c+1]) &&
-                       (cmidx == (ctop [stynum[nl]][c+1]==0)) && (left(i,c+1,&lwid)<0);
-               if (exvspen==0)
-                       {
-                       fprintf(tabout, "\\v'(\\n(\\*(#du-\\n(^%cu", c+'a');
-                       if (cmidx)
-                               fprintf(tabout, "-((\\n(#-u-\\n(^%cu)/2u)", c+'a');
-                       vct++;
-                       fprintf(tabout, "'");
-                       }
-               }
-       else
-               exvspen=0;
-       /* if lines need to be split for gcos here is the place for a backslash */
-       if (vct > 7 && c < ncol)
-               {
-               fprintf(tabout, "\n.sp-1\n\\&");
-               vct=0;
-               }
-       }
-fprintf(tabout, "\n");
-if (allh(i) && !pr1403) fprintf(tabout, ".vs \\n(%du\n", SVS);
-if (watchout)
-       funnies(i,nl);
-if (vspf)
-       {
-       for(c=0; c<ncol; c++)
-               if (vspen(table[nl][c].col) && (nl==0 || (lf=prev(nl))<0 || !vspen(table[lf][c].col)))
-                       {
-                       fprintf(tabout, ".nr ^%c \\n(#^u\n", 'a'+c);
-                       topat[c]=nl;
-                       }
-       }
-}
-puttext(s,fn, size)
-       char *s, *size, *fn;
-{
-if (point(s))
-       {
-       putfont(fn);
-       putsize(size);
-       fprintf(tabout, "%s",s);
-       if (*fn>0) fprintf(tabout, "\\f\\n(%2d", S1);
-       if (size!=0) putsize("0");
-       }
-}
-funnies( stl, lin)
-{
-/* write out funny diverted things */
-int c, s, pl, lwid, dv, lf, ct;
-char *fn;
-fprintf(tabout, ".mk ##\n"); /* rmember current vertical position */
-fprintf(tabout, ".nr %d \\n(##\n", S1); /* bottom position */
-for(c=0; c<ncol; c++)
-       {
-       s = table[lin][c].col;
-       if (point(s)) continue;
-       if (s==0) continue;
-       fprintf(tabout, ".sp |\\n(##u-1v\n");
-       fprintf(tabout, ".nr %d ", SIND);
-       for(pl=stl; pl>=0 && !isalpha(ct=ctype(pl,c)); pl=prev(pl))
-               ;
-       switch (ct)
-               {
-               case 'n':
-               case 'c':
-                       fprintf(tabout, "(\\n(%du+\\n(%du-\\n(%c-u)/2u\n",c+CLEFT,c-1+ctspan(lin,c)+CRIGHT, s);
-                       break;
-               case 'l':
-                       fprintf(tabout, "\\n(%du\n",c+CLEFT);
-                       break;
-               case 'a':
-                       fprintf(tabout, "\\n(%du\n",c+CMID);
-                       break;
-               case 'r':
-                       fprintf(tabout, "\\n(%du-\\n(%c-u\n", c+CRIGHT, s);
-                       break;
-               }
-       fprintf(tabout, ".in +\\n(%du\n", SIND);
-       fn=font[stynum[stl]][c];
-       putfont(fn);
-       pl = prev(stl);
-       if (stl>0 && pl>=0 && vspen(table[pl][c].col))
-               {
-               fprintf(tabout, ".sp |\\n(^%cu\n", 'a'+c);
-               if (ctop[stynum[stl]][c]==0)
-                       {
-                       fprintf(tabout, ".nr %d \\n(#-u-\\n(^%c-\\n(%c|+1v\n",TMP, 'a'+c, s);
-                       fprintf(tabout, ".if \\n(%d>0 .sp \\n(%du/2u\n", TMP, TMP);
-                       }
-               }
-       fprintf(tabout, ".%c+\n",s);
-       fprintf(tabout, ".in -\\n(%du\n", SIND);
-       if (*fn>0) putfont("P");
-       fprintf(tabout, ".mk %d\n", S2);
-       fprintf(tabout, ".if \\n(%d>\\n(%d .nr %d \\n(%d\n", S2, S1, S1, S2);
-       }
-fprintf(tabout, ".sp |\\n(%du\n", S1);
-for(c=dv=0; c<ncol; c++)
-       {
-       if (stl+1< nlin && (lf=left(stl,c,&lwid))>=0)
-               {
-               if (dv++ == 0)
-                       fprintf(tabout, ".sp -1\n");
-               tohcol(c);
-               dv++;
-               drawvert(lf, stl, c, lwid);
-               }
-       }
-if (dv)
-       fprintf(tabout,"\n");
-}
-putfont(fn)
-       char *fn;
-{
-if (fn && *fn)
-       fprintf(tabout,  fn[1] ? "\\f(%.2s" : "\\f%.2s",  fn);
-}
-putsize(s)
-       char *s;
-{
-if (s && *s)
-       fprintf(tabout, "\\s%s",s);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/t9.c b/.ref-Research-V7/usr/src/cmd/tbl/t9.c
deleted file mode 100644 (file)
index dda72ee..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
- /* t9.c: write lines for tables over 200 lines */
-# include "t..c"
-static useln;
-yetmore()
-{
-for(useln=0; useln<MAXLIN && table[useln]==0; useln++);
-if (useln>=MAXLIN)
-       error("Wierd.  No data in table.");
-table[0]=table[useln];
-for(useln=nlin-1; useln>=0 && (fullbot[useln] || instead[useln]); useln--);
-if (useln<0)
-       error("Wierd.  No real lines in table.");
-domore(leftover);
-while (gets1(cstore=cspace) && domore(cstore))
-       ;
-last =cstore;
-return;
-}
-domore(dataln)
-       char *dataln;
-{
-       int icol, ch;
-if (prefix(".TE", dataln))
-       return(0);
-if (dataln[0] == '.' && !isdigit(dataln[1]))
-       {
-       puts(dataln);
-       return(1);
-       }
-instead[0]=fullbot[0]=0;
-if (dataln[1]==0)
-switch(dataln[0])
-       {
-       case '_': fullbot[0]= '-'; putline(useln,0);  return(1);
-       case '=': fullbot[0]= '='; putline(useln, 0); return(1);
-       }
-for (icol = 0; icol <ncol; icol++)
-       {
-       table[0][icol].col = dataln;
-       table[0][icol].rcol=0;
-       for(; (ch= *dataln) != '\0' && ch != tab; dataln++)
-                       ;
-       *dataln++ = '\0';
-       switch(ctype(useln,icol))
-               {
-               case 'n':
-                       table[0][icol].rcol = maknew(table[0][icol].col);
-                       break;
-               case 'a':
-                       table[0][icol].rcol = table[0][icol].col;
-                       table[0][icol].col= "";
-                       break;
-               }
-       while (ctype(useln,icol+1)== 's') /* spanning */
-               table[0][++icol].col = "";
-       if (ch == '\0') break;
-       }
-while (++icol <ncol)
-       table[0][icol].col = "";
-putline(useln,0);
-return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tb.c b/.ref-Research-V7/usr/src/cmd/tbl/tb.c
deleted file mode 100644 (file)
index 0a68bda..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
- /* tb.c: check which entries exist, also storage allocation */
-# include "t..c"
-checkuse()
-{
-int i,c, k;
-for(c=0; c<ncol; c++)
-       {
-       used[c]=lused[c]=rused[c]=0;
-       for(i=0; i<nlin; i++)
-               {
-               if (instead[i] || fullbot[i]) continue;
-               k = ctype(i,c);
-               if (k== '-' || k == '=') continue;
-               if ((k=='n'||k=='a'))
-                       {
-                       rused[c]|= real(table[i][c].rcol);
-                       if( !real(table[i][c].rcol))
-                       used[c] |= real(table[i][c].col);
-                       if (table[i][c].rcol)
-                       lused[c] |= real(table[i][c].col);
-                       }
-               else
-                       used[c] |= real(table[i][c].col);
-               }
-       }
-}
-real(s)
-       char *s;
-{
-if (s==0) return(0);
-if (!point(s)) return(1);
-if (*s==0) return(0);
-return(1);
-}
-int spcount = 0;
-extern char * calloc();
-# define MAXVEC 20
-char *spvecs[MAXVEC];
-chspace()
-{
-char *pp;
-if (spvecs[spcount])
-       return(spvecs[spcount++]);
-if (spcount>=MAXVEC)
-       error("Too many characters in table");
-spvecs[spcount++]= pp = calloc(MAXCHS+200,1);
-if (pp== -1 || pp == 0)
-       error("no space for characters");
-return(pp);
-}
-# define MAXPC 50
-char *thisvec;
-int tpcount = -1;
-char *tpvecs[MAXPC];
-alocv(n)
-{
-int *tp, *q;
-if (tpcount<0 || thisvec+n > tpvecs[tpcount]+MAXCHS)
-       {
-       tpcount++;
-       if (tpvecs[tpcount]==0)
-               {
-               tpvecs[tpcount] = calloc(MAXCHS,1);
-               }
-       thisvec = tpvecs[tpcount];
-       if (thisvec == -1)
-               error("no space for vectors");
-       }
-tp=thisvec;
-thisvec+=n;
-for(q=tp; q<thisvec; q++)
-       *q=0;
-return(tp);
-}
-release()
-{
-extern char *exstore;
-/* give back unwanted space in some vectors */
-spcount=0;
-tpcount= -1;
-exstore=0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tc.c b/.ref-Research-V7/usr/src/cmd/tbl/tc.c
deleted file mode 100644 (file)
index 3c267c6..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
- /* tc.c: find character not in table to delimit fields */
-# include "t..c"
-choochar()
-{
-/* choose funny characters to delimit fields */
-int had[128], ilin,icol, k;
-char *s;
-for(icol=0; icol<128; icol++)
-       had[icol]=0;
-F1 = F2 = 0;
-for(ilin=0;ilin<nlin;ilin++)
-       {
-       if (instead[ilin]) continue;
-       if (fullbot[ilin]) continue;
-       for(icol=0; icol<ncol; icol++)
-               {
-               k = ctype(ilin, icol);
-               if (k==0 || k == '-' || k == '=')
-                       continue;
-               s = table[ilin][icol].col;
-               if (point(s))
-               while (*s)
-                       had[*s++]=1;
-               s=table[ilin][icol].rcol;
-               if (point(s))
-               while (*s)
-                       had[*s++]=1;
-               }
-       }
-/* choose first funny character */
-for(
-       s="\002\003\005\006\007!%&#/?,:;<=>@`^~_{}+-*ABCDEFGHIJKMNOPQRSTUVWXYZabcdefgjkoqrstwxyz";
-               *s; s++)
-       {
-       if (had[*s]==0)
-               {
-               F1= *s;
-               had[F1]=1;
-               break;
-               }
-       }
-/* choose second funny character */
-for(
-       s="\002\003\005\006\007:_~^`@;,<=>#%&!/?{}+-*ABCDEFGHIJKMNOPQRSTUVWXZabcdefgjkoqrstuwxyz";
-               *s; s++)
-       {
-       if (had[*s]==0)
-               {
-               F2= *s;
-               break;
-               }
-       }
-if (F1==0 || F2==0)
-       error("couldn't find characters to use for delimiters");
-return;
-}
-point(s)
-{
-return(s>= 128 || s<0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/te.c b/.ref-Research-V7/usr/src/cmd/tbl/te.c
deleted file mode 100644 (file)
index ad2c0d9..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
- /* te.c: error message control, input line count */
-# include "t..c"
-error(s)
-       char *s;
-{
-fprintf(stderr, "\n%s: line %d: %s\n", ifile, iline, s);
-# ifdef unix
-fprintf(stderr, "tbl quits\n");
-exit(1);
-# endif
-# ifdef gcos
-fprintf(stderr, "run terminated due to error condition detected by tbl preprocessor\n");
-exit(0);
-# endif
-}
-gets1(s)
-       char *s;
-{
-char *p;
-int nbl = 0;
-iline++;
-p=fgets(s,512,tabin);
-while (p==0)
-       {
-       if (swapin()==0)
-               return(0);
-       p = fgets(s,512,tabin);
-       }
-
-while (*s) s++;
-s--;
-if (*s == '\n') *s-- =0;
-for(nbl=0; *s == '\\' && s>p; s--)
-       nbl++;
-if (linstart && nbl % 2) /* fold escaped nl if in table */
-       gets1(s+1);
-
-return(p);
-}
-# define BACKMAX 500
-char backup[BACKMAX];
-char *backp = backup;
-un1getc(c)
-{
-if (c=='\n')
-       iline--;
-*backp++ = c;
-if (backp >= backup+BACKMAX)
-       error("too much backup");
-}
-get1char()
-{
-int c;
-if (backp>backup)
-       c = *--backp;
-else
-       c=getc(tabin);
-if (c== EOF) /* EOF */
-       {
-       if (swapin() ==0)
-               error("unexpected EOF");
-       c = getc(tabin);
-       }
-if (c== '\n')
-       iline++;
-return(c);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tf.c b/.ref-Research-V7/usr/src/cmd/tbl/tf.c
deleted file mode 100644 (file)
index e65a632..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
- /* tf.c: save and restore fill mode around table */
-# include "t..c"
-savefill()
-{
-/* remembers various things: fill mode, vs, ps in mac 35 (SF) */
-fprintf(tabout, ".de %d\n",SF);
-fprintf(tabout, ".ps \\n(.s\n");
-fprintf(tabout, ".vs \\n(.vu\n");
-fprintf(tabout, ".in \\n(.iu\n");
-fprintf(tabout, ".if \\n(.u .fi\n");
-fprintf(tabout, ".if \\n(.j .ad\n");
-fprintf(tabout, ".if \\n(.j=0 .na\n");
-fprintf(tabout, "..\n");
-fprintf(tabout, ".nf\n");
-/* set obx offset if useful */
-fprintf(tabout, ".nr #~ 0\n");
-fprintf(tabout, ".if n .nr #~ 0.6n\n");
-}
-rstofill()
-{
-fprintf(tabout, ".%d\n",SF);
-}
-endoff()
-{
-int i;
-       for(i=0; i<MAXHEAD; i++)
-               if (linestop[i])
-                       fprintf(tabout, ".nr #%c 0\n", 'a'+i);
-       for(i=0; i<texct; i++)
-               fprintf(tabout, ".rm %c+\n",texstr[i]);
-fprintf(tabout, "%s\n", last);
-}
-ifdivert()
-{
-fprintf(tabout, ".ds #d .d\n");
-fprintf(tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
-}
-saveline()
-{
-fprintf(tabout, ".if \\n+(b.=1 .nr d. \\n(.c-\\n(c.-1\n");
-linstart=iline;
-}
-restline()
-{
-fprintf(tabout,".if \\n-(b.=0 .nr c. \\n(.c-\\n(d.-%d\n", iline-linstart);
-linstart = 0;
-}
-cleanfc()
-{
-fprintf(tabout, ".fc\n");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tg.c b/.ref-Research-V7/usr/src/cmd/tbl/tg.c
deleted file mode 100644 (file)
index 6673cb6..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
- /* tg.c: process included text blocks */
-# include "t..c"
-gettext(sp, ilin,icol, fn, sz)
-       char *sp, *fn, *sz;
-{
-/* get a section of text */
-char line[256];
-int oname;
-char *vs;
-if (texname==0) error("Too many text block diversions");
-if (textflg==0)
-       {
-       fprintf(tabout, ".nr %d \\n(.lu\n", SL); /* remember old line length */
-       textflg=1;
-       }
-fprintf(tabout, ".eo\n");
-fprintf(tabout, ".am %02d\n", icol+80);
-fprintf(tabout, ".br\n");
-fprintf(tabout, ".di %c+\n", texname);
-rstofill();
-if (fn && *fn) fprintf(tabout, ".nr %d \\n(.f\n.ft %s\n", S1, fn);
-fprintf(tabout, ".ft \\n(.f\n"); /* protect font */
-vs = vsize[stynum[ilin]][icol];
-if ((sz && *sz) || (vs && *vs))
-       {
-       fprintf(tabout, ".nr %d \\n(.v\n", S2);
-       if (vs==0 || *vs==0) vs= "\\n(.s+2";
-       if (sz && *sz)
-               fprintf(tabout, ".ps %s\n",sz);
-       fprintf(tabout, ".vs %s\n",vs);
-       fprintf(tabout, ".if \\n(%du>\\n(.vu .sp \\n(%du-\\n(.vu\n", S2,S2);
-       }
-if (cll[icol][0])
-       fprintf(tabout, ".ll %sn\n", cll[icol]);
-else
-       fprintf(tabout, ".ll \\n(%du*%du/%du\n",SL,ctspan(ilin,icol),ncol+1);
-fprintf(tabout,".if \\n(.l<\\n(%d .ll \\n(%du\n", icol+CRIGHT, icol+CRIGHT);
-if (ctype(ilin,icol)=='a')
-       fprintf(tabout, ".ll -2n\n");
-fprintf(tabout, ".in 0\n");
-while (gets1(line))
-       {
-       if (line[0]=='T' && line[1]=='}' && line[2]== tab) break;
-       if (match("T}", line)) break;
-       fprintf(tabout, "%s\n", line);
-       }
-if (fn && *fn) fprintf(tabout, ".ft \\n(%d\n", S1);
-if (sz && *sz) fprintf(tabout, ".br\n.ps\n.vs\n");
-fprintf(tabout, ".br\n");
-fprintf(tabout, ".di\n");
-fprintf(tabout, ".nr %c| \\n(dn\n", texname);
-fprintf(tabout, ".nr %c- \\n(dl\n", texname);
-fprintf(tabout, "..\n");
-fprintf(tabout, ".ec \\\n");
-/* copy remainder of line */
-if (line[2])
-       tcopy (sp, line+3);
-else
-       *sp=0;
-oname=texname;
-texname = texstr[++texct];
-return(oname);
-}
-untext()
-{
-rstofill();
-fprintf(tabout, ".nf\n");
-fprintf(tabout, ".ll \\n(%du\n", SL);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/ti.c b/.ref-Research-V7/usr/src/cmd/tbl/ti.c
deleted file mode 100644 (file)
index 5df0c3a..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
- /* ti.c: classify line intersections */
-# include "t..c"
-/* determine local environment for intersections */
-interv(i,c)
-{
-int ku, kl;
-if (c>=ncol || c == 0)
-       {
-       if (dboxflg)
-               {
-               if (i==0) return(BOT);
-               if (i>=nlin) return(TOP);
-               return(THRU);
-               }
-       if (c>=ncol)
-               return(0);
-       }
-ku = i>0 ? lefdata(i-1,c) : 0;
-if (i+1 >= nlin)
-       kl=0;
-else
-kl = lefdata(allh(i) ? i+1 : i, c);
-if (ku==2 && kl==2) return(THRU);
-if (ku ==2) return(TOP);
-if (kl==BOT) return(2);
-return(0);
-}
-interh(i,c)
-{
-int kl, kr;
-if (fullbot[i]== '=' || (dboxflg && (i==0 || i>= nlin-1)))
-       {
-       if (c==ncol)
-               return(LEFT);
-       if (c==0)
-               return(RIGHT);
-       return(THRU);
-       }
-if (i>=nlin) return(0);
-kl = c>0 ? thish (i,c-1) : 0;
-if (kl<=1 && i>0 && allh(up1(i)))
-       kl = c>0 ? thish(up1(i),c-1) : 0;
-kr = thish(i,c);
-if (kr<=1 && i>0 && allh(up1(i)))
-       kr = c>0 ? thish(up1(i), c) : 0;
-if (kl== '=' && kr ==  '=') return(THRU);
-if (kl== '=') return(LEFT);
-if (kr== '=') return(RIGHT);
-return(0);
-}
-up1(i)
-{
-i--;
-while (instead[i] && i>0) i--;
-return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tm.c b/.ref-Research-V7/usr/src/cmd/tbl/tm.c
deleted file mode 100644 (file)
index e9c0328..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
- /* tm.c: split numerical fields */
-# include "t..c"
-maknew(str)
-       char *str;
-{
-       /* make two numerical fields */
-       int dpoint, c;
-       char *p, *q, *ba;
-       p = str;
-       for (ba= 0; c = *str; str++)
-               if (c == '\\' && *(str+1)== '&')
-                       ba=str;
-       str=p;
-       if (ba==0)
-               {
-               for (dpoint=0; *str; str++)
-                       {
-                       if (*str=='.' && !ineqn(str,p) &&
-                               (str>p && digit(*(str-1)) ||
-                               digit(*(str+1))))
-                                       dpoint=str;
-                       }
-               if (dpoint==0)
-                       for(; str>p; str--)
-                       {
-                       if (digit( * (str-1) ) && !ineqn(str, p))
-                               break;
-                       }
-               if (!dpoint && p==str) /* not numerical, don't split */
-                       return(0);
-               if (dpoint) str=dpoint;
-               }
-       else
-               str = ba;
-       p =str;
-       if (exstore ==0 || exstore >exlim)
-               {
-               exstore = chspace();
-               exlim= exstore+MAXCHS;
-               }
-       q = exstore;
-       while (*exstore++ = *str++);
-       *p = 0;
-       return(q);
-       }
-ineqn (s, p)
-       char *s, *p;
-{
-/* true if s is in a eqn within p */
-int ineq = 0, c;
-while (c = *p)
-       {
-       if (s == p)
-               return(ineq);
-       p++;
-       if ((ineq == 0) && (c == delim1))
-               ineq = 1;
-       else
-       if ((ineq == 1) && (c == delim2))
-               ineq = 0;
-       }
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/ts.c b/.ref-Research-V7/usr/src/cmd/tbl/ts.c
deleted file mode 100644 (file)
index e0f8b1c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
- /* ts.c: minor string processing subroutines */
-match (s1, s2)
-       char *s1, *s2;
-{
-       while (*s1 == *s2)
-               if (*s1++ == '\0')
-                       return(1);
-               else
-                       s2++;
-       return(0);
-}
-prefix(small, big)
-       char *small, *big;
-{
-int c;
-while ((c= *small++) == *big++)
-       if (c==0) return(1);
-return(c==0);
-}
-letter (ch)
-       {
-       if (ch >= 'a' && ch <= 'z')
-               return(1);
-       if (ch >= 'A' && ch <= 'Z')
-               return(1);
-       return(0);
-       }
-numb(str)
-       char *str;
-       {
-       /* convert to integer */
-       int k;
-       for (k=0; *str >= '0' && *str <= '9'; str++)
-               k = k*10 + *str - '0';
-       return(k);
-       }
-digit(x)
-       {
-       return(x>= '0' && x<= '9');
-       }
-max(a,b)
-{
-return( a>b ? a : b);
-}
-tcopy (s,t)
-       char *s, *t;
-{
-       while (*s++ = *t++);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tt.c b/.ref-Research-V7/usr/src/cmd/tbl/tt.c
deleted file mode 100644 (file)
index ae34556..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
- /* tt.c: subroutines for drawing horizontal lines */
-# include "t..c"
-ctype(il, ic)
-{
-if (instead[il])
-       return(0);
-if (fullbot[il])
-       return(0);
-il = stynum[il];
-return(style[il][ic]);
-}
-min(a,b)
-{
-return(a<b ? a : b);
-}
-fspan(i,c)
-{
-c++;
-return(c<ncol && ctype(i,c)=='s');
-}
-lspan(i,c)
-{
-int k;
-if (ctype(i,c) != 's') return(0);
-c++;
-if (c < ncol && ctype(i,c)== 's') 
-       return(0);
-for(k=0; ctype(i,--c) == 's'; k++);
-return(k);
-}
-ctspan(i,c)
-{
-int k;
-c++;
-for(k=1; c<ncol && ctype(i,c)=='s'; k++)
-       c++;
-return(k);
-}
-tohcol(ic)
-{
-                       if (ic==0)
-                               fprintf(tabout, "\\h'|0'");
-                       else
-                               fprintf(tabout, "\\h'(|\\n(%du+|\\n(%du)/2u'", ic+CLEFT, ic+CRIGHT-1);
-}
-allh(i)
-{
-/* return true if every element in line i is horizontal */
-/* also at least one must be horizontl */
-int c, one, k;
-if (fullbot[i]) return(1);
-for(one=c=0; c<ncol; c++)
-       {
-       k = thish(i,c);
-       if (k==0) return(0);
-       if (k==1) continue;
-       one=1;
-       }
-return(one);
-}
-thish(i,c)
-{
-       int t;
-       char *s;
-       struct colstr *pc;
-       if (c<0)return(0);
-       if (i<0) return(0);
-       t = ctype(i,c);
-       if (t=='_' || t == '-')
-               return('-');
-       if (t=='=')return('=');
-       if (t=='^') return(1);
-       if (fullbot[i] )
-               return(fullbot[i]);
-       if (t=='s') return(thish(i,c-1));
-       if (t==0) return(1);
-       pc = &table[i][c];
-       s = (t=='a' ? pc->rcol : pc->col);
-       if (s==0 || (point(s) && *s==0))
-               return(1);
-       if (vspen(s)) return(1);
-       if (t=barent( s))
-               return(t);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tu.c b/.ref-Research-V7/usr/src/cmd/tbl/tu.c
deleted file mode 100644 (file)
index 4a08347..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
- /* tu.c: draws horizontal lines */
-# include "t..c"
-makeline(i,c,lintype)
-{
-int cr, type, shortl;
-type = thish(i,c);
-if (type==0) return;
-cr=c;
-shortl = (table[i][c].col[0]=='\\');
-if (c>0 && !shortl && thish(i,c-1) == type)return;
-if (shortl==0)
-       for(cr=c; cr < ncol && (ctype(i,cr)=='s'||type==thish(i,cr)); cr++);
-else
-       for(cr=c+1; cr<ncol && ctype(i,cr)=='s'; cr++);
-drawline(i, c, cr-1, lintype, 0, shortl);
-}
-fullwide(i, lintype)
-{
-int cr, cl;
-if (!pr1403)
-       fprintf(tabout, ".nr %d \\n(.v\n.vs \\n(.vu-\\n(.sp\n", SVS);
-cr= 0;
-while (cr<ncol)
-       {
-       cl=cr;
-       while (i>0 && vspand(prev(i),cl,1))
-               cl++;
-       for(cr=cl; cr<ncol; cr++)
-               if (i>0 && vspand(prev(i),cr,1))
-                       break;
-       if (cl<ncol)
-       drawline(i,cl,(cr<ncol?cr-1:cr),lintype,1,0);
-       }
-fprintf(tabout, "\n");
-if (!pr1403)
-       fprintf(tabout, ".vs \\n(%du\n", SVS);
-}
-
-drawline(i, cl, cr, lintype, noheight, shortl)
-{
-       char *exhr, *exhl;
-       int lcount, ln, linpos, oldpos, nodata, lnch;
-lcount=0;
-exhr=exhl= "";
-switch(lintype)
-       {
-       case '-': lcount=1;break;
-       case '=': lcount = pr1403? 1 : 2; break;
-       case SHORTLINE: lcount=1; break;
-       }
-if (lcount<=0) return;
-nodata = cr-cl>=ncol || noheight || allh(i);
-       if (!nodata)
-               fprintf(tabout, "\\v'-.5m'");
-for(ln=oldpos=0; ln<lcount; ln++)
-       {
-       linpos = 2*ln - lcount +1;
-       if (linpos != oldpos)
-               fprintf(tabout, "\\v'%dp'", linpos-oldpos);
-       oldpos=linpos;
-       if (shortl==0)
-       {
-       tohcol(cl);
-       if (lcount>1)
-               {
-               switch(interv(i,cl))
-                       {
-                       case TOP: exhl = ln==0 ? "1p" : "-1p"; break;
-                       case BOT: exhl = ln==1 ? "1p" : "-1p"; break;
-                       case THRU: exhl = "1p"; break;
-                       }
-               if (exhl[0])
-               fprintf(tabout, "\\h'%s'", exhl);
-               }
-       else if (lcount==1)
-               {
-               switch(interv(i,cl))
-                       {
-                       case TOP: case BOT: exhl = "-1p"; break;
-                       case THRU: exhl = "1p"; break;
-                       }
-               if (exhl[0])
-               fprintf(tabout, "\\h'%s'", exhl);
-               }
-       if (lcount>1)
-               {
-               switch(interv(i,cr+1))
-                       {
-                       case TOP: exhr = ln==0 ? "-1p" : "+1p"; break;
-                       case BOT: exhr = ln==1 ? "-1p" : "+1p"; break;
-                       case THRU: exhr = "-1p"; break;
-                       }
-               }
-       else if (lcount==1)
-               {
-               switch(interv(i,cr+1))
-                       {
-                       case TOP: case BOT: exhr = "+1p"; break;
-                       case THRU: exhr = "-1p"; break;
-                       }
-               }
-       }
-       else
-               fprintf(tabout, "\\h'|\\n(%du'", cl+CLEFT);
-       fprintf(tabout, "\\s\\n(%d",LSIZE);
-       if (linsize)
-               fprintf(tabout, "\\v'-\\n(%dp/6u'", LSIZE);
-       if (shortl)
-               fprintf(tabout, "\\l'|\\n(%du'", cr+CRIGHT);
-       else
-       {
-       lnch = "\\(ul";
-       if (pr1403)
-               lnch = lintype==2 ? "=" : "\\(ru";
-       if (cr+1>=ncol)
-               fprintf(tabout, "\\l'|\\n(TWu%s%s'", exhr,lnch);
-       else
-               fprintf(tabout, "\\l'(|\\n(%du+|\\n(%du)/2u%s%s'", cr+CRIGHT,
-                       cr+1+CLEFT, exhr, lnch);
-       }
-       if (linsize)
-               fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE);
-       fprintf(tabout, "\\s0");
-       }
-if (oldpos!=0)
-       fprintf(tabout, "\\v'%dp'", -oldpos);
-if (!nodata)
-       fprintf(tabout, "\\v'+.5m'");
-}
-getstop()
-{
-int i,c,k,junk, stopp;
-stopp=1;
-for(i=0; i<MAXLIN; i++)
-       linestop[i]=0;
-for(i=0; i<nlin; i++)
-       for(c=0; c<ncol; c++)
-               {
-               k = left(i,c,&junk);
-               if (k>=0 && linestop[k]==0)
-                       linestop[k]= ++stopp;
-               }
-if (boxflg || allflg || dboxflg)
-       linestop[0]=1;
-}
-left(i,c, lwidp)
-       int *lwidp;
-{
-int kind, li, lj;
-       /* returns -1 if no line to left */
-       /* returns number of line where it starts */
-       /* stores into lwid the kind of line */
-*lwidp=0;
-kind = lefdata(i,c);
-if (kind==0) return(-1);
-if (i+1<nlin)
-if (lefdata(next(i),c)== kind) return(-1);
-while (i>=0 && lefdata(i,c)==kind)
-       i=prev(li=i);
-if (prev(li)== -1) li=0;
-*lwidp=kind;
-for(lj= i+1; lj<li; lj++)
-       if (instead[lj] && strcmp(instead[lj], ".TH")==0)
-               return(li);
-for(i= i+1; i<li; i++)
-       if (fullbot[i])
-               li=i;
-return(li);
-}
-lefdata(i,c)
-{
-int ck;
-if (i>=nlin) i=nlin-1;
-if (ctype(i,c) == 's')
-       {
-       for(ck=c; ctype(i,ck)=='s'; ck--);
-       if (thish(i,ck)==0)
-               return(0);
-       }
-i =stynum[i];
-i = lefline[i][c];
-if (i>0) return(i);
-if (dboxflg && c==0) return(2);
-if (allflg)return(1);
-if (boxflg && c==0) return(1);
-return(0);
-}
-next(i)
-{
-while (i+1 <nlin)
-       {
-       i++;
-       if (!fullbot[i] && !instead[i]) break;
-       }
-return(i);
-}
-prev(i)
-{
-while (--i >=0  && (fullbot[i] || instead[i]))
-       ;
-return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tbl/tv.c b/.ref-Research-V7/usr/src/cmd/tbl/tv.c
deleted file mode 100644 (file)
index eaf0c8b..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
- /* tv.c: draw vertical lines */
-# include "t..c"
-drawvert(start,end, c, lwid)
-{
-char *exb=0, *ext=0;
-int tp=0, sl, ln, pos, epb, ept, vm;
-end++;
-vm='v';
-/* note: nr 35 has value of 1m outside of linesize */
-while (instead[end]) end++;
-for(ln=0; ln<lwid; ln++)
-       {
-       epb=ept=0;
-       pos = 2*ln-lwid+1;
-       if (pos!=tp) fprintf(tabout, "\\h'%dp'", pos-tp);
-       tp = pos;
-       if (end<nlin)
-               {
-               if (fullbot[end]|| (!instead[end] && allh(end)))
-                       epb=2;
-               else
-               switch (midbar(end,c))
-                       {
-                       case '-':
-                       exb = "1v-.5m"; break;
-                       case '=':
-                       exb = "1v-.5m";
-                       epb = 1; break;
-                       }
-               }
-       if (lwid>1)
-       switch(interh(end, c))
-               {
-               case THRU: epb -= 1; break;
-               case RIGHT: epb += (ln==0 ? 1 : -1); break;
-               case LEFT: epb += (ln==1 ? 1 : -1); break;
-               }
-       if (lwid==1)
-       switch(interh(end,c))
-               {
-               case THRU: epb -= 1; break;
-               case RIGHT: case LEFT: epb += 1; break;
-               }
-       if (start>0)
-               {
-               sl = start-1;
-               while (sl>=0 && instead[sl]) sl--;
-               if (sl>=0 && (fullbot[sl] || allh(sl)))
-                       ept=0;
-               else
-               if (sl>=0)
-               switch(midbar(sl,c))
-                       {
-                       case '-':
-                       ext = ".5m"; break;
-                       case '=':
-                       ext= ".5m"; ept = -1; break;
-                       default:
-                               vm = 'm'; break;
-                       }
-               else
-                       ept = -4;
-               }
-       else if (start==0 && allh(0))
-               {
-               ept=0;
-               vm = 'm';
-               }
-       if (lwid>1)
-               switch(interh(start,c))
-                       {
-                       case THRU: ept += 1; break;
-                       case LEFT: ept += (ln==0 ? 1 : -1); break;
-                       case RIGHT: ept += (ln==1 ? 1 : -1); break;
-                       }
-       else if (lwid==1)
-               switch(interh(start,c))
-                       {
-                       case THRU: ept += 1; break;
-                       case LEFT: case RIGHT: ept -= 1; break;
-                       }
-       if (exb)
-               fprintf(tabout, "\\v'%s'", exb);
-       if (epb)
-               fprintf(tabout, "\\v'%dp'", epb);
-       fprintf(tabout, "\\s\\n(%d",LSIZE);
-       if (linsize)
-               fprintf(tabout, "\\v'-\\n(%dp/6u'", LSIZE);
-       fprintf(tabout, "\\h'-\\n(#~u'"); /* adjustment for T450 nroff boxes */
-       fprintf(tabout, "\\L'|\\n(#%cu-%s", linestop[start]+'a'-1, vm=='v'? "1v" : "\\n(35u");
-       if (ext)
-               fprintf(tabout, "-(%s)",ext);
-       if (exb)
-               fprintf(tabout, "-(%s)", exb);
-       pos = ept-epb;
-       if (pos)
-               fprintf(tabout, "%s%dp", pos>=0? "+" : "", pos);
-       /* the string #d is either "nl" or ".d" depending
-          on diversions; on GCOS not the same */
-       fprintf(tabout, "'\\s0\\v'\\n(\\*(#du-\\n(#%cu+%s", linestop[start]+'a'-1,vm=='v' ? "1v" : "\\n(35u");
-       if (ext)
-               fprintf(tabout, "+%s",ext);
-       if (ept)
-               fprintf(tabout, "%s%dp", (-ept)>0 ? "+" : "", (-ept));
-       fprintf(tabout, "'");
-       if (linsize)
-               fprintf(tabout, "\\v'\\n(%dp/6u'", LSIZE);
-       }
-}
-
-
-midbar(i,c)
-{
-int k;
-k = midbcol(i,c);
-if (k==0 && c>0)
-       k = midbcol(i, c-1);
-return(k);
-}
-midbcol(i,c)
-{
-int ct;
-while ( (ct=ctype(i,c)) == 's')
-       c--;
-if (ct=='-' || ct == '=')
-       return(ct);
-if (ct=barent(table[i][c].col))
-       return(ct);
-return(0);
-}
-
-barent(s)
-       char *s;
-{
-if (s==0) return (1);
-if (s[0]== '\\') s++;
-if (s[1]!= 0)
-       return(0);
-switch(s[0])
-       {
-       case '_':
-               return('-');
-       case '=':
-               return('=');
-       }
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tc.c b/.ref-Research-V7/usr/src/cmd/tc.c
deleted file mode 100644 (file)
index cebfea0..0000000
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- * Simulate typesetter on 4014
-*/
-
-#include <signal.h>
-#include <stdio.h>
-
-#define        oput(c) if (pgskip==0) putchar(c); else;
-#define MAXY 3071
-#define US 037
-#define GS 035
-#define ESC 033
-#define FF 014
-#define DBL 0200
-
-int pl = 11*144;
-int mpy = 1;
-int div = 1;
-char *ap;
-int ch;
-int nonumb;
-int psize = 10;
-int dfact = 1;
-int esc;
-int escd;
-int verd;
-int esct;
-int osize = 02;
-int size = 02;
-int rx;
-int xx;
-int yy = MAXY+62+48;
-int leadtot = -31;
-int ohy = -1;
-int ohx = -1;
-int oxb = -1;
-int oly = -1;
-int olx = -1;
-int tflag;
-int railmag;
-int lead;
-int skip;
-int pgskip;
-int ksize = ';';
-int mcase;
-int stab[] = {010,0,01,07,02,03,04,05,0211,06,0212,0213,0214,0215,0216,0217};
-int rtab[] = {6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, 36, 18};
-int ktab[] = {';',';',';',';',';',';',':',':','9','9','9','9','8','8','8','9'};
-int first = 1;
-int alpha;
-extern char *asctab[128];
-extern char *spectab[128];
-int erase = 1;
-int    (*sigint)();
-int    (*sigquit)();
-
-main(argc,argv)
-int argc;
-char **argv;
-{
-       register i, j;
-       register char *k;
-       extern ex();
-
-       while((--argc > 0) && ((++argv)[0][0]=='-')){
-               switch(argv[0][1]){
-                       case 'p':
-                               ap = &argv[0][2];
-                               dfact = 72;
-                               if(i = atoi())pl = i/3;
-                               continue;
-                       case 't':
-                               tflag++;
-                               continue;
-                       case 's':
-                               ap = &argv[0][2];
-                               dfact = 1;
-                               pgskip = atoi();
-                               continue;
-                       default:
-                               dfact = 1;
-                               ap = &argv[0][1];
-                               if(i = atoi())mpy = i;
-                               if(i = atoi())div = i;
-                               continue;
-               }
-       }
-       if(argc){
-               if (freopen(argv[0], "r", stdin) == NULL) {
-                       fprintf(stderr, "tc: cannot open %s\n", argv[0]);
-                       exit(1);
-               }
-       }
-       sigint = signal(SIGINT, ex);
-       sigquit = signal(SIGQUIT, SIG_IGN);
-       while((i = getchar()) != EOF){
-               if(!i)continue;
-               if(i & 0200){
-                       esc += (~i) & 0177;
-                       continue;
-               }
-               if(esc){
-                       if(escd)esc = -esc;
-                       esct += esc;
-                       xx += (esc*mpy + rx)/div;
-                       rx = (esc*mpy + rx)%div;
-                       sendpt();
-                       esc = 0;
-               }
-               switch(i){
-                       case 0100:      /*init*/
-                               escd = verd = mcase = railmag = xx = 0;
-                               yy = MAXY + 48;
-                               leadtot = -31;
-                               ohy = oxb = oly = ohx = olx = -1;
-                               oput(US);
-                               fflush(stdout);
-                               if(!first && !tflag)kwait();
-                               if(first){
-                                       first = 0;
-                                       yy += 62;
-                               }
-                               init();
-                               continue;
-                       case 0101:      /*lower rail*/
-                               railmag &= ~01;
-                               continue;
-                       case 0102:      /*upper rail*/
-                               railmag |= 01;
-                               continue;
-                       case 0103:      /*upper mag*/
-                               railmag |= 02;
-                               continue;
-                       case 0104:      /*lower mag*/
-                               railmag &= ~02;
-                               continue;
-                       case 0105:      /*lower case*/
-                               mcase = 0;
-                               continue;
-                       case 0106:      /*upper case*/
-                               mcase = 0100;
-                               continue;
-                       case 0107:      /*escape forward*/
-                               escd = 0;
-                               continue;
-                       case 0110:      /*escape backward*/
-                               escd = 1;
-                               continue;
-                       case 0111:      /*stop*/
-                               continue;
-                       case 0112:      /*lead forward*/
-                               verd = 0;
-                               continue;
-                       case 0113:      /*undefined*/
-                               continue;
-                       case 0114:      /*lead backward*/
-                               verd = 1;
-                               continue;
-                       case 0115:      /*undefined*/
-                       case 0116:
-                       case 0117:
-                               continue;
-               }
-               if((i & 0340) == 0140){ /*leading*/
-                       lead = (~i) & 037;
-                       if(verd)lead = -lead;
-                       if((leadtot += lead) > pl){
-                               leadtot = lead;
-                               oput(US);
-                               fflush(stdout);
-                               if(!tflag)kwait();
-                               yy = MAXY;
-                               if(pgskip)--pgskip;
-                               init();
-                               continue;
-                       }
-                       if(skip)continue;
-                       if((yy -= (lead<<1)) < 0){
-                               skip++;
-                               yy = 0;
-                       }else sendpt();
-                       continue;
-               }
-               if((i & 0360) == 0120){ /*size change*/
-                       i &= 017;
-                       for(j = 0; i != (stab[j] & 017); j++);
-                       osize = size;
-                       size = stab[j];
-                       psize = rtab[j];
-                       ksize = ktab[j];
-                       oput(ESC);
-                       oput(ksize);
-                       i = 0;
-                       if(!(osize & DBL) && (size & DBL))i = -55;
-                       else if((osize & DBL) && !(size & DBL))i = 55;
-                       if(escd)i = -i;
-                       esc += i;
-                       continue;
-               }
-               if(i & 0300)continue;
-               i = (i & 077) | mcase;
-               if(railmag != 03)k = asctab[i];
-               else k = spectab[i];
-               if(alpha)sendpt();
-               if(*k!='\0'){
-                       oput(US);
-                       while(*k & 0377)oput(*k++);
-                       alpha++;
-                       continue;
-               }else{
-                       if(railmag != 03){
-                               switch(i){
-                               case 0124: lig("fi"); break;
-                               case 0125: lig("fl"); break;
-                               case 0126: lig("ff"); break;
-                               case 0130: lig("ffl"); break;
-                               case 0131: lig("ffi"); break;
-                               default: continue;
-                               }
-                       }
-                       continue;
-               }
-       }
-       ex();
-}
-lig(x)
-char *x;
-{
-       register i, j;
-       register char *k;
-
-       j = 0;
-       k = x;
-       oput(US);
-       oput(*k++);
-       i = psize * 8 * mpy / (div * 6); /* 8/36 em */
-       while(*k){
-               xx += i;
-               j += i;
-               sendpt();
-               oput(US);
-               oput(*k++);
-       }
-       xx -= j;
-       sendpt();
-}
-init(){
-
-       fflush(stdout);
-       if(erase){
-               oput(ESC);
-               oput(FF);
-       }else erase = 1;
-       oput(ESC);
-       oput(ksize);
-       /*delay about a second*/
-/* let the system do it...
-       for(i = 960; i > 0; i--)oput(GS);
-*/
-       skip = 0;
-       sendpt();
-}
-ex(){
-       yy = MAXY;
-       xx = 0;
-       sendpt();
-       oput(ESC);
-       oput(';');
-       oput(US);
-       fflush(stdout);
-       exit(0);
-}
-kwait(){
-       char buf[128]; char *bptr; char c;
-       if(pgskip) return;
-next:
-       bptr=buf;
-       while((c=readch())&&(c!='\n')) *bptr++=c;
-       *bptr=0;
-       if(bptr!=buf){
-               bptr = buf;
-               if(*bptr == '!'){callunix(&buf[1]); fputs("!\n", stderr); goto next;}
-               else switch(*bptr++){
-                       case 'e':
-                               erase = 0;
-                               goto next;
-                       case 's':
-                               ap = &buf[1];
-                               dfact = 1;
-                               pgskip = atoi() + 1;
-                               goto next;
-                       default:
-                               fputs("?\n", stderr);
-                               goto next;
-               }
-       }
-       else if (c==0) ex();
-       else    return;
-}
-callunix(line)
-char line[];
-{
-       int rc, status, unixpid;
-       if( (unixpid=fork())==0 ) {
-               signal(SIGINT,sigint); signal(SIGQUIT,sigquit);
-               close(0); dup(2);
-               execl("/bin/sh", "-sh", "-c", line, 0);
-               exit(255);
-       }
-       else if(unixpid == -1)
-               return;
-       else{   signal(SIGINT, SIG_IGN); signal(SIGQUIT, SIG_IGN);
-               while( (rc = wait(&status)) != unixpid && rc != -1 ) ;
-               signal(SIGINT,ex); signal(SIGQUIT,sigquit);
-       }
-}
-readch(){
-       char c;
-       if (read(2,&c,1)<1) c=0;
-       return(c);
-}
-sendpt(){
-       int hy,xb,ly,hx,lx;
-
-       oput(GS);
-       hy = ((yy>>7) & 037);
-       xb = ((xx & 03) + ((yy<<2) & 014) & 017);
-       ly = ((yy>>2) & 037);
-       hx = ((xx>>7) & 037);
-       lx = ((xx>>2) & 037);
-       if(hy != ohy)oput(hy | 040);
-       if(xb != oxb)oput(xb | 0140);
-       if((ly != oly) || (hx != ohx) || (xb != oxb))
-               oput(ly | 0140);
-       if(hx != ohx)oput(hx | 040);
-       oput(lx | 0100);
-       ohy = hy;
-       oxb = xb;
-       oly = ly;
-       ohx = hx;
-       olx = lx;
-       alpha = 0;
-       return;
-}
-atoi()
-{
-       register i, j, acc;
-       int field, digits;
-       long dd;
-       long tscale();
-
-       field = digits = acc = 0;
-a1:
-       while(((j = (i = getch()) - '0') >= 0) && (j <= 9)){
-               field++;
-               digits++;
-               acc = 10*acc + j;
-       }
-       if(i == '.'){
-               field++;
-               digits = 0;
-               goto a1;
-       }
-       if(!(ch = i))ch = 'x';
-       dd = tscale(acc);
-       acc = dd;
-       if((field != digits) && (digits > 0)){
-               j = 1;
-               while(digits--)j *= 10;
-               acc = dd/j;
-       }
-       nonumb = !field;
-       ch = 0;
-       return(acc);
-}
-long tscale(n)
-int n;
-{
-       register i, j;
-
-       switch(i = getch()){
-               case 'u':
-                       j = 1;
-                       break;
-               case 'p':       /*Points*/
-                       j = 6;
-                       break;
-               case 'i':       /*Inches*/
-                       j = 432;
-                       break;
-               case 'c':       /*Centimeters; should be 170.0787*/
-                       j = 170;
-                       break;
-               case 'P':       /*Picas*/
-                       j = 72;
-                       break;
-               default:
-                       j = dfact;
-                       ch = i;
-       }
-       return((long)n*j);
-}
-getch(){
-       register i;
-
-       if(ch){
-               i = ch;
-               ch = 0;
-               return(i);
-       }
-       return(*ap++);
-}
-
-char *asctab[128] {
-"\0",  /*blank*/
-"h",   /*h*/
-"t",   /*t*/
-"n",   /*n*/
-"m",   /*m*/
-"l",   /*l*/
-"i",   /*i*/
-"z",   /*z*/
-"s",   /*s*/
-"d",   /*d*/
-"b",   /*b*/
-"x",   /*x*/
-"f",   /*f*/
-"j",   /*j*/
-"u",   /*u*/
-"k",   /*k*/
-"\0",  /*blank*/
-"p",   /*p*/
-"-",   /*_ 3/4 em dash*/
-";",   /*;*/
-"\0",  /*blank*/
-"a",   /*a*/
-"_",   /*rule*/
-"c",   /*c*/
-"`",   /*` open*/
-"e",   /*e*/
-"\'",  /*' close*/
-"o",   /*o*/
-"\0",  /*1/4*/
-"r",   /*r*/
-"\0",  /*1/2*/
-"v",   /*v*/
-"-",   /*- hyphen*/
-"w",   /*w*/
-"q",   /*q*/
-"/",   /*/*/
-".",   /*.*/
-"g",   /*g*/
-"\0",  /*3/4*/
-",",   /*,*/
-"&",   /*&*/
-"y",   /*y*/
-"\0",  /*blank*/
-"%",   /*%*/
-"\0",  /*blank*/
-"Q",   /*Q*/
-"T",   /*T*/
-"O",   /*O*/
-"H",   /*H*/
-"N",   /*N*/
-"M",   /*M*/
-"L",   /*L*/
-"R",   /*R*/
-"G",   /*G*/
-"I",   /*I*/
-"P",   /*P*/
-"C",   /*C*/
-"V",   /*V*/
-"E",   /*E*/
-"Z",   /*Z*/
-"D",   /*D*/
-"B",   /*B*/
-"S",   /*S*/
-"Y",   /*Y*/
-"\0",  /*blank*/
-"F",   /*F*/
-"X",   /*X*/
-"A",   /*A*/
-"W",   /*W*/
-"J",   /*J*/
-"U",   /*U*/
-"K",   /*K*/
-"0",   /*0*/
-"1",   /*1*/
-"2",   /*2*/
-"3",   /*3*/
-"4",   /*4*/
-"5",   /*5*/
-"6",   /*6*/
-"7",   /*7*/
-"8",   /*8*/
-"9",   /*9*/
-"*",   /***/
-"-",   /*minus*/
-"",    /*fi*/
-"",    /*fl*/
-"",    /*ff*/
-"\033\016Z\bM\033\017",        /*cent sign*/
-"",    /*ffl*/
-"",    /*ffi*/
-"(",   /*(*/
-")",   /*)*/
-"[",   /*[*/
-"]",   /*]*/
-"\033\016J\033\017",   /*degree*/
-"\033\016M\b_\033\017",        /*dagger*/
-"=",   /*=*/
-"\033\016O\b&\033\017",        /*registered*/
-":",   /*:*/
-"+",   /*+*/
-"\0",  /*blank*/
-"!",   /*!*/
-"\033\016O\b~\033\017",        /*bullet*/
-"?",   /*?*/
-"\'",  /*foot mark*/
-"|",   /*|*/
-"\0",  /*blank*/
-"\033\016O\b#\033\017",        /*copyright*/
-"\033\016L\033\017",   /*square*/
-"$" }; /*$*/
-
-char *spectab[128] = {
-"\0",  /*blank*/
-"\033\016(\bM\033\017",        /*psi*/
-"\033\016o\b_\033\017",        /*theta*/
-"v\b)",        /*nu*/
-"\033\016V\b,\033\017",        /*mu*/
-"\033\016)\b?\033\017",        /*lambda*/
-"\033\016I\033\017",   /*iota*/
-"S\b\033\016Z\033\017",        /*zeta*/
-"o\b\'",       /*sigma*/
-"o\b\033\0165\033\017",        /*delta*/
-"\033\016b\033\017",   /*beta*/
-"\033\016e\bc\033\017",        /*xi*/
-"j\b\033\016C\033\017",        /*eta*/
-"\033\016O\bM\033\017",        /*phi*/
-"\033\016(\033\017",   /*upsilon*/
-"\033\016k\033\017",   /*kappa*/
-"\0",  /*blank*/
-"T\b\033\016S\033\017",        /*pi*/
-"@",   /*at-sign*/
-"\033\016U\033\017",   /*down arrow*/
-"\0",  /*blank*/
-"\033\016A\033\017",   /*alpha*/
-"|",   /*or*/
-"l\b/",        /*chi*/
-"\"",  /*"*/
-"\033\016E\033\017",   /*epsilon*/
-"=",   /*=*/
-"\033\016O\033\017",   /*omicron*/
-"\033\016[\033\017",   /*left arrow*/
-"\033\016R\033\017",   /*rho*/
-"\033\016Y\033\017",   /*up arrow*/
-"\033\016N\033\017",   /*tau*/
-"_",   /*underrule*/
-"\\",  /*\*/
-"I\b\033\016(\033\017",        /*Psi*/
-"\033\016O\bJ\033\017",        /*bell system sign*/
-"\033\016W\bX\033\017",        /*infinity*/
-"`\b/",        /*gamma*/
-"\033\016X\bF\033\017",        /*improper superset*/
-"\033\016A\033\017",   /*proportional to*/
-"\033\016\\\b]\033\017",       /*right hand*/
-"\033\016W\033\017",   /*omega*/
-"\0",  /*blank*/
-"\033\016G\033\017",   /*gradient*/
-"\0",  /*blank*/
-"I\033\016\bO\033\017",        /*Phi*/
-"O\b=",        /*Theta*/
-"O\b_",        /*Omega*/
-"\033\016V\033\017",   /*cup (union)*/
-"\033\016@\033\017",   /*root en*/
-"s",   /*terminal sigma*/
-"\033\016)\bK\033\017",        /*Lambda*/
-"-",   /*minus*/
-"\033\016S\bK\033\017",        /*Gamma*/
-"\033\016i\033\017",   /*integral sign*/
-"\033\016t\b'\033\017",        /*Pi*/
-"\033\016Z\033\017",   /*subset of*/
-"\033\016X\033\017",   /*superset of*/
-"\033\016T\033\017",   /*approximates*/
-"o\b`",        /*partial derivative*/
-"\033\016H\033\017",   /*Delta*/
-"\033\016I\b'\033\017",        /*square root*/
-">\b\033\016F\b@\033\017",     /*Sigma*/
-"\033\016T\bF\033\017",        /*approx =*/
-"\0",  /*blank*/
-">",   /*>*/
-"\033\016_\bF\b@\033\017",     /*Xi*/
-"<",   /*<*/
-"/",   /*slash (longer)*/
-"\033\016C\033\017",   /*cap (intersection)*/
-"\033\016y\033\017",   /*Upsilon*/
-"\033\016|\033\017",   /*not*/
-"|",   /*right ceiling (rt of ")*/
-"|",   /*left top (of big curly)*/
-"|",   /*bold vertical*/
-"|",   /*left center of big curly bracket*/
-"|",   /*left bottom*/
-"|",   /*right top*/
-"|",   /*right center of big curly bracket*/
-"|",   /*right bot*/
-"|",   /*right floor (rb of ")*/
-"|",   /*left floor (left bot of big sq bract)*/
-"|",   /*left ceiling (lt of ")*/
-"\033\016=\033\017",   /*multiply*/
-"\033\016+\033\017",   /*divide*/
-"+\b_",        /*plus-minus*/
-"\033\016$\033\017",   /*<=*/
-"\033\016^\033\017",   /*>=*/
-"=\b_",        /*identically equal*/
-"\033\016*\033\017",   /*not equal*/
-"{",   /*{*/
-"}",   /*}*/
-"\'",  /*' acute accent*/
-"`",   /*` grave accent*/
-"^",   /*^*/
-"#",   /*sharp*/
-"\033\016|\b[\033\017",        /*left hand*/
-"\033\016c\b_\033\017",        /*member of*/
-"~",   /*~*/
-"\033\016O\b/\033\017",        /*empty set*/
-"\0",  /*blank*/
-"\033\016%\bM\033\017",        /*dbl dagger*/
-"|",   /*box rule*/
-"*",   /*asterisk*/
-"\033\016Z\bF\033\017",        /*improper subset*/
-"\033\016O\033\017",   /*circle*/
-"\0",  /*blank*/
-"+",   /*eqn plus*/
-"\033\016]\033\017",   /*right arrow*/
-"g\b\033\016C\033\017" };      /*section mark*/
diff --git a/.ref-Research-V7/usr/src/cmd/tee.c b/.ref-Research-V7/usr/src/cmd/tee.c
deleted file mode 100644 (file)
index 6050d31..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * tee-- pipe fitting
- */
-
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-int openf[20] = { 1 };
-int n = 1;
-int t = 0;
-int aflag;
-
-char in[512];
-
-char out[512];
-
-extern errno;
-long   lseek();
-
-main(argc,argv)
-char **argv;
-{
-       int register r,w,p;
-       struct stat buf;
-       while(argc>1&&argv[1][0]=='-') {
-               switch(argv[1][1]) {
-               case 'a':
-                       aflag++;
-                       break;
-               case 'i':
-               case 0:
-                       signal(SIGINT, SIG_IGN);
-               }
-               argv++;
-               argc--;
-       }
-       fstat(1,&buf);
-       t = (buf.st_mode&S_IFMT)==S_IFCHR;
-       if(lseek(1,0L,1)==-1&&errno==ESPIPE)
-               t++;
-       while(argc-->1) {
-               if(aflag) {
-                       openf[n] = open(argv[1],1);
-                       if(openf[n] < 0)
-                               openf[n] = creat(argv[1],0666);
-                       lseek(openf[n++],0L,2);
-               } else
-                       openf[n++] = creat(argv[1],0666);
-               if(stat(argv[1],&buf)>=0) {
-                       if((buf.st_mode&S_IFMT)==S_IFCHR)
-                               t++;
-               } else {
-                       puts("tee: cannot open ");
-                       puts(argv[1]);
-                       puts("\n");
-                       n--;
-               }
-               argv++;
-       }
-       r = w = 0;
-       for(;;) {
-               for(p=0;p<512;) {
-                       if(r>=w) {
-                               if(t>0&&p>0) break;
-                               w = read(0,in,512);
-                               r = 0;
-                               if(w<=0) {
-                                       stash(p);
-                                       return;
-                               }
-                       }
-                       out[p++] = in[r++];
-               }
-               stash(p);
-       }
-}
-
-stash(p)
-{
-       int k;
-       int i;
-       int d;
-       d = t ? 16 : p;
-       for(i=0; i<p; i+=d)
-               for(k=0;k<n;k++)
-                       write(openf[k], out+i, d<p-i?d:p-i);
-}
-
-puts(s)
-char *s;
-{
-       while(*s)
-               write(2,s++,1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/test.c b/.ref-Research-V7/usr/src/cmd/test.c
deleted file mode 100644 (file)
index fcd3dac..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- *     test expression
- *     [ expression ]
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#define EQ(a,b)        ((tmp=a)==0?0:(strcmp(tmp,b)==0))
-
-#define DIR 1
-#define FIL 2
-int    ap;
-int    ac;
-char   **av;
-char   *tmp;
-
-main(argc, argv)
-char *argv[];
-{
-
-       ac = argc; av = argv; ap = 1;
-       if(EQ(argv[0],"[")) {
-               if(!EQ(argv[--ac],"]"))
-                       synbad("] missing","");
-       }
-       argv[ac] = 0;
-       if (ac<=1) exit(1);
-       exit(exp()?0:1);
-}
-
-char *nxtarg(mt) {
-
-       if (ap>=ac) {
-               if(mt) {
-                       ap++;
-                       return(0);
-               }
-               synbad("argument expected","");
-       }
-       return(av[ap++]);
-}
-
-exp() {
-       int p1;
-
-       p1 = e1();
-       if (EQ(nxtarg(1), "-o")) return(p1 | exp());
-       ap--;
-       return(p1);
-}
-
-e1() {
-       int p1;
-
-       p1 = e2();
-       if (EQ(nxtarg(1), "-a")) return (p1 & e1());
-       ap--;
-       return(p1);
-}
-
-e2() {
-       if (EQ(nxtarg(0), "!"))
-               return(!e3());
-       ap--;
-       return(e3());
-}
-
-e3() {
-       int p1;
-       register char *a;
-       char *p2;
-       int int1, int2;
-
-       a=nxtarg(0);
-       if(EQ(a, "(")) {
-               p1 = exp();
-               if(!EQ(nxtarg(0), ")")) synbad(") expected","");
-               return(p1);
-       }
-
-       if(EQ(a, "-r"))
-               return(tio(nxtarg(0), 0));
-
-       if(EQ(a, "-w"))
-               return(tio(nxtarg(0), 1));
-
-       if(EQ(a, "-d"))
-               return(ftype(nxtarg(0))==DIR);
-
-       if(EQ(a, "-f"))
-               return(ftype(nxtarg(0))==FIL);
-
-       if(EQ(a, "-s"))
-               return(fsizep(nxtarg(0)));
-
-       if(EQ(a, "-t"))
-               if(ap>=ac)
-                       return(isatty(1));
-               else
-                       return(isatty(atoi(nxtarg(0))));
-
-       if(EQ(a, "-n"))
-               return(!EQ(nxtarg(0), ""));
-       if(EQ(a, "-z"))
-               return(EQ(nxtarg(0), ""));
-
-       p2 = nxtarg(1);
-       if (p2==0)
-               return(!EQ(a,""));
-       if(EQ(p2, "="))
-               return(EQ(nxtarg(0), a));
-
-       if(EQ(p2, "!="))
-               return(!EQ(nxtarg(0), a));
-
-       if(EQ(a, "-l")) {
-               int1=length(p2);
-               p2=nxtarg(0);
-       } else{ int1=atoi(a);
-       }
-       int2 = atoi(nxtarg(0));
-       if(EQ(p2, "-eq"))
-               return(int1==int2);
-       if(EQ(p2, "-ne"))
-               return(int1!=int2);
-       if(EQ(p2, "-gt"))
-               return(int1>int2);
-       if(EQ(p2, "-lt"))
-               return(int1<int2);
-       if(EQ(p2, "-ge"))
-               return(int1>=int2);
-       if(EQ(p2, "-le"))
-               return(int1<=int2);
-
-       synbad("unknown operator ",p2);
-}
-
-tio(a, f)
-char *a;
-int f;
-{
-
-       f = open(a, f);
-       if (f>=0) {
-               close(f);
-               return(1);
-       }
-       return(0);
-}
-
-ftype(f)
-char *f;
-{
-       struct stat statb;
-
-       if(stat(f,&statb)<0)
-               return(0);
-       if((statb.st_mode&S_IFMT)==S_IFDIR)
-               return(DIR);
-       return(FIL);
-}
-
-fsizep(f)
-char *f;
-{
-       struct stat statb;
-       if(stat(f,&statb)<0)
-               return(0);
-       return(statb.st_size>0);
-}
-
-synbad(s1,s2)
-char *s1, *s2;
-{
-       write(2, "test: ", 6);
-       write(2, s1, strlen(s1));
-       write(2, s2, strlen(s2));
-       write(2, "\n", 1);
-       exit(255);
-}
-
-length(s)
-       char *s;
-{
-       char *es=s;
-       while(*es++);
-       return(es-s-1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/time.c b/.ref-Research-V7/usr/src/cmd/time.c
deleted file mode 100644 (file)
index 5c63d66..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* time command */
-
-#include <stdio.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/times.h>
-
-extern int errno;
-extern char *sys_errlist[];
-
-main(argc, argv)
-char **argv;
-{
-       struct tms buffer, obuffer;
-       int status;
-       register p;
-       time_t before, after;
-
-       if(argc<=1)
-               exit(0);
-       time(&before);
-       p = fork();
-       if(p == -1) {
-               fprintf(stderr, "Try again.\n");
-               exit(1);
-       }
-       if(p == 0) {
-               execvp(argv[1], &argv[1]);
-               fprintf(stderr, "%s: %s\n", argv[1], sys_errlist[errno]);
-               exit(1);
-       }
-       signal(SIGINT, SIG_IGN);
-       signal(SIGQUIT, SIG_IGN);
-       times(&obuffer);
-       while(wait(&status) != p)
-               times(&obuffer);
-       time(&after);
-       if((status&0377) != 0)
-               fprintf(stderr,"Command terminated abnormally.\n");
-       times(&buffer);
-       fprintf(stderr,"\n");
-       printt("real", (after-before) * 60);
-       printt("user", buffer.tms_cutime - obuffer.tms_cutime);
-       printt("sys ", buffer.tms_cstime - obuffer.tms_cstime);
-       exit(status>>8);
-}
-
-char quant[] = { 6, 10, 10, 6, 10, 6, 10, 10, 10 };
-char *pad  = "000      ";
-char *sep  = "\0\0.\0:\0:\0\0";
-char *nsep = "\0\0.\0 \0 \0\0";
-
-printt(s, a)
-char *s;
-long a;
-{
-       char digit[9];
-       register i;
-       char c;
-       int nonzero;
-
-       for(i=0; i<9; i++) {
-               digit[i] = a % quant[i];
-               a /= quant[i];
-       }
-       fprintf(stderr,s);
-       nonzero = 0;
-       while(--i>0) {
-               c = digit[i]!=0 ? digit[i]+'0':
-                   nonzero ? '0':
-                   pad[i];
-               fprintf(stderr,"%c",c);
-               nonzero |= digit[i];
-               c = nonzero?sep[i]:nsep[i];
-               fprintf(stderr,"%c",c);
-       }
-       fprintf(stderr,"\n");
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tk.c b/.ref-Research-V7/usr/src/cmd/tk.c
deleted file mode 100644 (file)
index 715b6a0..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * optimize output for Tek 4014
- */
-
-#include <stdio.h>
-#include <signal.h>
-
-#define MAXY 3071
-#define LINE 47
-#define XOFF 248
-#define US 037
-#define GS 035
-#define ESC 033
-#define CR 015
-#define FF 014
-#define SO 016
-#define SI 017
-
-int    pl      = 66*LINE;
-int    yyll    = -1;
-char   obuf[BUFSIZ];
-int    xx = XOFF;
-int    xoff = XOFF;
-int    coff = 0;
-int    ncol = 0;
-int    maxcol = 1;
-int    yy = MAXY;
-int    ohy = -1;
-int    ohx = -1;
-int    oxb = -1;
-int    oly = -1;
-int    olx = -1;
-int    alpha;
-int    ry;
-FILE   *ttyin;
-
-main(argc, argv)
-int argc;
-char **argv;
-{
-       register i, j;
-       extern ex();
-
-       while (--argc > 0 && (++argv)[0][0]=='-')
-               switch(argv[0][1]) {
-                       case 'p':
-                               if (i = atoi(&argv[0][2]))
-                                       pl = i;
-                                       yyll = MAXY + 1 - pl;
-                               break;
-                       default:
-                               if (i = atoi(&argv[0][1])) {
-                                       maxcol = i;
-                                       xx = xoff = 0;
-                                       coff = 4096/i;
-                               }
-                               break;
-               }
-       if ((ttyin = fopen("/dev/tty", "r")) != NULL)
-               setbuf(ttyin, (char *)NULL);
-       if (argc) {
-               if (freopen(argv[0], "r", stdin) == NULL) {
-                       fprintf(stderr, "tk: cannot open %s\n", argv[0]);
-                       exit(1);
-               }
-       }
-       signal(SIGINT, ex);
-       setbuf(stdout, obuf);
-       ncol = maxcol;
-       init();
-       while ((i = getchar()) != EOF) {
-               switch(i) {
-
-               case FF:
-                       yy = 0;
-               case '\n':
-                       xx = xoff;
-                       yy -= LINE;
-                       alpha = 0;
-                       if (yy < yyll) {
-                               ncol++;
-                               yy = 0;
-                               sendpt(0);
-                               putchar(US);
-                               fflush(stdout);
-                               if (ncol >= maxcol)
-                                       kwait();
-                               init();
-                       }
-                       continue;
-
-               case CR:
-                       xx = xoff;
-                       alpha = 0;
-                       continue;
-
-               case ' ':
-                       xx += 31;
-                       alpha = 0;
-                       continue;
-
-               case '\t': /*tabstops at 8*31=248*/
-                       j = ((xx-xoff)/248) + 1;
-                       xx += j*248 - (xx-xoff);
-                       alpha = 0;
-                       continue;
-
-               case '\b':
-                       xx -= 31;
-                       alpha = 0;
-                       continue;
-
-               case ESC:
-                       switch(i = getchar()) {
-                       case '7':
-                               yy += LINE;
-                               alpha = 0;
-                               continue;
-                       case '8':
-                               yy += (LINE + ry)/2;
-                               ry = (LINE + ry)%2;
-                               alpha = 0;
-                               continue;
-                       case '9':
-                               yy -= (LINE - ry)/2;
-                               ry = -(LINE - ry)%2;
-                               alpha = 0;
-                               continue;
-                       default:
-                               continue;
-                       }
-
-               default:
-                       sendpt(alpha);
-                       if (alpha==0) {
-                               putchar(US);
-                               alpha = 1;
-                       }
-                       putchar(i);
-                       if (i>' ')
-                               xx += 31;
-                       continue;
-               }
-       }
-       xx = xoff;
-       yy = 0;
-       sendpt(0);
-       putchar(US);
-       kwait();
-       ex();
-}
-
-init()
-{
-       ohx = oxb = olx = ohy = oly = -1;
-       if (ncol >= maxcol) {
-               ncol = 0;
-               if (maxcol > 1)
-                       xoff = 0;
-               else
-                       xoff = XOFF;
-       } else
-               xoff += coff;
-       xx = xoff;
-       yy = MAXY;
-       if (ncol==0)
-               fputs("\033\014\033;", stdout);
-       sendpt(0);
-}
-
-ex()
-{
-       yy = MAXY;
-       xx = 0;
-       fputs("\033;\037", stdout);
-       sendpt(1);
-       exit(0);
-}
-
-kwait()
-{
-       register c;
-
-       fflush(stdout);
-       if (ttyin==NULL)
-               return;
-       while ((c=getc(ttyin))!='\n') {
-               if (c=='!') {
-                       execom();
-                       printf("!\n");
-                       fflush(stdout);
-                       continue;
-               }
-               if (c==EOF)
-                       ex();
-       }
-}
-
-execom()
-{
-       int (*si)(), (*sq)();
-
-       if (fork() != 0) {
-               si = signal(SIGINT, SIG_IGN);
-               sq = signal(SIGQUIT, SIG_IGN);
-               wait((int *)NULL);
-               signal(SIGINT, si);
-               signal(SIGQUIT, sq);
-               return;
-       }
-       if (isatty(fileno(stdin)) == 0) {
-               if (freopen("/dev/tty", "r", stdin)==NULL)
-                       freopen("/dev/null", "r", stdin);
-       }
-       execl("/bin/sh", "sh", "-t", 0);
-}
-
-sendpt(a)
-{
-       register zz;
-       int hy,xb,ly,hx,lx;
-
-       if (a)
-               return;
-       if ((zz = yy) < 0)
-               zz = 0;
-       hy = ((zz>>7) & 037);
-       xb = ((xx & 03) + ((zz<<2) & 014) & 017);
-       ly = ((zz>>2) & 037);
-       hx = ((xx>>7) & 037);
-       lx = ((xx>>2) & 037);
-       putchar(GS);
-       if (hy != ohy)
-               putchar(hy | 040);
-       if (xb != oxb)
-               putchar(xb | 0140);
-       if ((ly != oly) || (hx != ohx) || (xb != oxb))
-               putchar(ly | 0140);
-       if (hx != ohx)
-               putchar(hx | 040);
-       putchar(lx | 0100);
-       ohy = hy;
-       oxb = xb;
-       oly = ly;
-       ohx = hx;
-       olx = lx;
-       alpha = 0;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/touch.c b/.ref-Research-V7/usr/src/cmd/touch.c
deleted file mode 100644 (file)
index 33bcc50..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include <stdio.h>
-
-
-main(argc,argv)
-int argc;
-char *argv[];
-{
-int i;
-static int force = 1;
-
-for(i = 1 ; i < argc ; ++i)
-       if( strcmp(argv[i], "-c") )
-               touch(force, argv[i]);
-       else
-               force = 0;
-}
-
-
-
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-touch(force, name)
-int force;
-char *name;
-{
-struct stat stbuff;
-char junk[1];
-int fd;
-
-if( stat(name,&stbuff) < 0)
-       if(force)
-               goto create;
-       else
-               {
-               fprintf(stderr, "touch: file %s does not exist.\n", name);
-               return;
-               }
-
-if(stbuff.st_size == 0)
-       goto create;
-
-if( (fd = open(name, 2)) < 0)
-       goto bad;
-
-if( read(fd, junk, 1) < 1)
-       {
-       close(fd);
-       goto bad;
-       }
-lseek(fd, 0L, 0);
-if( write(fd, junk, 1) < 1 )
-       {
-       close(fd);
-       goto bad;
-       }
-close(fd);
-return;
-
-bad:
-       fprintf(stderr, "Cannot touch %s\n", name);
-       return;
-
-create:
-       if( (fd = creat(name, 0666)) < 0)
-               goto bad;
-       close(fd);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tp/makefile b/.ref-Research-V7/usr/src/cmd/tp/makefile
deleted file mode 100644 (file)
index 296ef1e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-CFLAGS=-n -s -O
-
-all:   tp
-       rm *.o
-
-cp:    tp
-       cp tp /bin/tp
-       rm *.o tp
-
-cmp:   tp
-       cmp tp /bin/tp
-       rm *.o tp
-
-tp:    tp0.o tp1.o tp2.o tp3.o
-       cc $(CFLAGS) tp0.o tp1.o tp2.o tp3.o -o tp
-
-tp0.c tp1.c tp2.c tp3.c: tp.h
diff --git a/.ref-Research-V7/usr/src/cmd/tp/tp.h b/.ref-Research-V7/usr/src/cmd/tp/tp.h
deleted file mode 100644 (file)
index a3a29d5..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*     c-version of tp?.s
- *
- *     M. Ferentz
- *     August 1976
- *
- *     revised July 1977 BTL
- */
-
-#define        MDIRENT 496             /* must be zero mod 8 */
-#define DIRSZ  sizeof(struct dent)
-#define MAPSIZE 4096
-#define MAPMASK 07777
-#define NAMELEN 32
-#define BSIZE   512
-#define        TCSIZ   578
-#define TCDIRS 192
-#define        MTSIZ   32767
-#define TPB    (BSIZE/sizeof(struct tent))
-#define        OK      0100000
-#define        BRKINCR 512
-
-#define        tapeblk &tpentry[0]
-#define tapeb  &tpentry[0]
-
-struct         tent    {       /* Structure of a tape directory block */
-       char    pathnam[NAMELEN];
-       short   mode;
-       char    uid;
-       char    gid;
-       char    spare;
-       char    size0;
-       unsigned short  size1;
-       long    time;
-       unsigned short  tapea;  /* tape address */
-       short   unused[8];
-       short   cksum;
-}      tpentry[TPB];
-
-struct dent {  /* in core version of tent with "unused" removed
-                * and pathname replaced by pointer to same in a
-                * packed area (nameblock).
-                */
-       char    *d_namep;
-       int     d_mode;
-       int     d_uid;
-       int     d_gid;
-       long    d_size;
-       long    d_time;
-       int     d_tapea;
-}  dir[MDIRENT];
-
-char   map[MAPSIZE];
-char   name[NAMELEN];
-char   name1[NAMELEN];
-extern char mt[];
-extern char tc[];
-char   *tname;
-extern char mheader[];
-extern char theader[];
-
-int    narg, rnarg;
-char   **parg;
-int    wseeka,rseeka;
-int    tapsiz;
-int    fio;
-short  ndirent, ndentb;
-struct dent    *edir;
-struct dent *lastd;            /* for improvement */
-char   *sbrk();
-char   *strcpy();
-long   lseek();
-int    (*command)();
-
-char   *nameblk;
-char   *top;
-char   *nptr;
-
-extern int     flags;
-#define        flc     0001
-#define        fli     0004
-#define        flm     0010
-#define        flu     0020
-#define        flv     0040
-#define        flw     0100
-#define fls    0200
diff --git a/.ref-Research-V7/usr/src/cmd/tp/tp0.c b/.ref-Research-V7/usr/src/cmd/tp/tp0.c
deleted file mode 100644 (file)
index 04a5c21..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "tp.h"
-#include <tp_defs.h>
diff --git a/.ref-Research-V7/usr/src/cmd/tp/tp1.c b/.ref-Research-V7/usr/src/cmd/tp/tp1.c
deleted file mode 100644 (file)
index 5a6c8fd..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-#include "tp.h"
-
-main(argc,argv)
-char **argv;
-{
-       register char c,*ptr;
-       extern cmd(), cmr(),cmx(), cmt();
-
-       tname = tc;
-       command = cmr;
-       if ((narg = rnarg = argc) < 2)  narg = 2;
-       else {
-               ptr = argv[1];  /* get first argument */
-               parg = &argv[2];        /* pointer to second argument */
-               while (c = *ptr++) switch(c)  {
-                       case '0':
-                       case '1':
-                       case '2':
-                       case '3':
-                       case '4':
-                       case '5':
-                       case '6':
-                       case '7':
-                               tc[8] = c;
-                               mt[7] = c;
-                               continue;
-
-                       case 'f':
-                               tname = *parg++;
-                               narg--; rnarg--;
-                               continue;
-                       case 'c':
-                               flags |= flc;  continue;
-                       case 'd':
-                               setcom(cmd);  continue;
-                       case 'i':
-                               flags |= fli;  continue;
-                       case 'm':
-                               tname = mt;
-                               flags |= flm;
-                               continue;
-                       case 'r':
-                               flags &= ~flu;  setcom(cmr);  continue;
-                       case 's':
-                               flags |= fls; continue;
-                       case 't':
-                               setcom(cmt);  continue;
-                       case 'u':
-                               flags |= flu;  setcom(cmr);  continue;
-                       case 'v':
-                               flags |= flv;  continue;
-                       case 'w':
-                               flags |= flw;  continue;
-                       case 'x':
-                               setcom(cmx);  continue;
-                       default:
-                               useerr();
-               }
-       }
-       optap();
-       top = nptr = nameblk = sbrk(0);
-       (*command)();
-}
-
-optap()
-{
-       extern cmr();
-
-       if ((flags & flm) == 0) {       /*  DECTAPE */
-               tapsiz = TCSIZ;
-               ndirent = TCDIRS;
-               fio =open(tc,2);
-       } else {                        /* MAGTAPE */
-               tapsiz = MTSIZ;
-               ndirent = MDIRENT;
-               if(command == cmr)
-                       fio = open(tname,1);
-               else
-                       fio = open(tname,0);
-       }
-       if (fio < 0)  {
-               printf("Tape open error\n");
-               done();
-       }
-       ndentb = ndirent/TPB;
-       edir = &dir[ndirent];
-}
-
-setcom(newcom)
-int (*newcom)();
-{
-       extern cmr();
-
-       if (command != cmr)     useerr();
-       command = newcom;
-}
-
-useerr()
-{
-       printf("Bad usage\n");
-       done();
-}
-
-/*\f/* COMMANDS */
-
-cmd()
-{
-       extern delete();
-
-       if (flags & (flm|flc))  useerr();
-       if (narg <= 2)                  useerr();
-       rddir();
-       gettape(delete);
-       wrdir();
-       check();
-}
-
-cmr()
-{
-       if (flags & (flc|flm))          clrdir();
-       else                            rddir();
-       getfiles();
-       update();
-       check();
-}
-
-cmt()
-{
-       extern taboc();
-
-       if (flags & (flc|flw))  useerr();
-       rddir();
-       if (flags & flv)
-               printf("   mode    uid gid tapa    size   date    time name\n");
-       gettape(taboc);
-       check();
-}
-
-cmx()
-{
-       extern extract();
-
-       if (flags & (flc))              useerr();
-       rddir();
-       gettape(extract);
-       done();
-}
-
-check()
-{
-       usage();
-       done();
-}
-
-done()
-{
-       printf("End\n");
-       exit(0);
-}
-
-encode(pname,dptr)     /* pname points to the pathname
-                        * nptr points to next location in nameblk
-                        * dptr points to the dir entry            */
-char   *pname;
-struct dent *dptr;
-{
-       register  char *np;
-       register n;
-
-       dptr->d_namep = np = nptr;
-       if (np > top - NAMELEN)  {
-               if(sbrk(BRKINCR) == (char *)-1) {
-                       printf("Out of core\n");
-                       done();
-               } else
-                       top += BRKINCR;
-       }
-       if((n=strlen(pname)) > NAMELEN) {
-               printf("Pathname too long - %s\nFile ignored\n",pname);
-               clrent(dptr);
-       }
-       else {
-               nptr += n+1;
-               strcpy(np, pname);
-       }
-}
-
-decode(pname,dptr)     /* dptr points to the dir entry
-                        * name is placed in pname[] */
-char   *pname;
-struct dent *dptr;
-{
-
-       strcpy(pname, dptr->d_namep);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tp/tp2.c b/.ref-Research-V7/usr/src/cmd/tp/tp2.c
deleted file mode 100644 (file)
index 72b7090..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-#include "tp.h"
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-
-struct direct  direct;
-struct stat    statb;
-
-clrdir()
-{
-       register j, *p;
-
-       j = ndirent * (DIRSZ/sizeof(int));
-       p = (int *)dir;
-       do (*p++ = 0);  while (--j);
-       lastd = 0;
-}
-
-clrent(ptr)
-struct dent *ptr;
-{
-       register *p, j;
-
-       p  = (int *)ptr;
-       j = DIRSZ/sizeof(int);
-       do *p++ = 0;
-          while (--j);
-       if (++ptr == lastd) do {
-               if (--lastd < dir) {
-                       lastd = 0;
-                       return;
-               }
-       } while (lastd->d_namep == 0);
-}
-
-
-rddir()
-{
-       register struct tent *tp;
-       register struct dent *p1;
-       struct dent  *dptr;
-       struct tent  *tptr;
-       int     count, i, sum;
-       short   reg, *sp;
-
-       sum = 0;
-       clrdir();
-       rseek(0);
-       tread();        /* Read the bootstrap block */
-       if ((tpentry[TPB-1].cksum != 0) && (flags & flm)) {
-               ndirent = tpentry[TPB-1].cksum;
-               if(flags & fls) swab((char *)&ndirent, (char *)&ndirent, sizeof(ndirent));
-               if(ndirent < 0 || ndirent > MDIRENT) ndirent = MDIRENT;
-               ndentb = ndirent/TPB;
-       }
-       dptr = &dir[0];
-       count = ndirent;
-       do {
-               if ((count % TPB) == 0) {       /* next block */
-                       tread();
-                       tptr = &tpentry[0];
-               }
-               if(flags & fls)
-                       swab((char *)tptr, (char *)tptr, sizeof(*tptr));
-               sp = (short *)tptr;
-               reg = 0;
-               for(i=0;i<sizeof(struct tent)/sizeof(short);i++)
-                       reg += *sp++;
-               if(flags & fls) {
-                       swab((char *)tptr, (char *)tptr, sizeof(*tptr));
-                       swabdir(tptr);
-               }
-               sum |= reg;
-               p1 = dptr;
-               if (reg == 0) {
-                       tp = tptr;
-                       if(tp->pathnam[0] != '\0') {
-                               lastd = p1;
-                               encode(tp->pathnam,p1);
-                               p1->d_mode = tp->mode;
-                               p1->d_uid = tp->uid;
-                               p1->d_gid = tp->gid;
-                               p1->d_size = (((long)tp->size0&0377L)<<16)+(tp->size1&0177777L);
-                               p1->d_time = tp->time;
-                               p1->d_tapea = tp->tapea;
-                       }
-               }
-               ++tptr;         /* bump to next tent */
-               (dptr++)->d_mode &= ~OK;
-       } while (--count);
-       if(sum != 0)
-               if(flags & (fls|fli)) {
-                       printf("Directory checksum\n");
-                       if ((flags & fli) == 0)         done();
-               } else {
-                       flags |= fls;
-                       rddir();
-                       printf("Warning: swabbing required\n");
-                       return;
-               }
-       bitmap();
-}
-
-
-wrdir()
-{
-       register struct tent *tp;
-       register struct dent *dp;
-       struct dent *dptr;
-       int     count, i;
-       short   reg, *sp;
-
-       wseek(0);
-       if (flags & flm)
-               reg = open(mheader,0);
-       else    reg = open(theader,0);
-       if (reg >= 0) {
-               read(reg,(char *)tapeb,BSIZE);
-               close(reg);
-               if(flags & fls)
-                       swab((char *)&ndirent, (char *)&tpentry[TPB-1].cksum, sizeof(ndirent));
-               else
-                       tpentry[TPB-1].cksum = ndirent;
-       }
-       dptr = &dir[0];
-       count = ndirent;
-       for (;;) {
-               twrite();
-               if (count == 0)  return;
-               tp = &tpentry[0];
-               do {
-                       dp = dptr++;    /* dptr set to next entry */
-                       if (dp->d_namep)  {
-                               decode(tp->pathnam,dp);
-                               tp->mode = dp->d_mode;
-                               tp->uid = dp->d_uid;
-                               tp->gid = dp->d_gid;
-                               tp->time = dp->d_time;
-                               tp->size0 = dp->d_size >> 16;
-                               tp->size1 = dp->d_size;
-                               tp->tapea = dp->d_tapea;
-                               if(flags & fls) {
-                                       swabdir(tp);
-                                       swab((char *)tp, (char *)tp, sizeof(*tp));
-                               }
-                               reg = 0;
-                               sp = (short *)tp;
-                               for(i=0;i<sizeof(struct tent)/sizeof(short)-1;i++)
-                                       reg -= *sp++;
-                               *sp = reg;
-                               if(flags & fls)
-                                       swab((char *)tp, (char *)tp, sizeof(*tp));
-                       } else {
-                               sp = (short *)tp;
-                               for(i=0;i<sizeof(struct tent)/sizeof(short);i++)
-                                       *sp++ = 0;
-                       }
-               tp++;
-               } while (--count % TPB);
-       }
-}
-
-tread()
-{
-       register j, *ptr;
-
-       if (read(fio,(char *)tapeb,BSIZE) != BSIZE) {
-               printf("Tape read error\n");
-               if ((flags & fli) == 0)         done();
-               ptr = (int *)tapeb;
-               j = BSIZE/sizeof(int);
-               while(j--) *ptr++ = 0;
-       }
-       rseeka++;
-}
-
-twrite()
-{
-       if (write(fio, (char *)tapeb,BSIZE) != BSIZE) {
-               printf("Tape write error\n");
-               done();
-       }
-       ++wseeka;
-}
-
-rseek(blk)
-{
-       rseeka = blk;
-       if (lseek(fio,(long)blk*BSIZE,0) < 0)   seekerr();
-}
-
-wseek(blk)
-{
-       register amt, b;
-
-       amt = b = blk;
-       if ((amt -= wseeka) < 0)        amt = -amt;
-       if (amt > 25 && b) {
-               lseek(fio, (long)(b-1)*BSIZE, 0);       /* seek previous block */
-               read(fio, (char *)&wseeka, 1);  /* read next block */
-       }
-       wseeka = b;
-       if (lseek(fio, (long)b*BSIZE, 0) < 0)   seekerr();
-}
-
-seekerr()
-{
-       printf("Tape seek error\n");
-       done();
-}
-
-verify(key)
-{
-       register c;
-
-       if ((flags & (flw | flv)) == 0)
-               return(0);
-repeat:        printf("%c %s ", key, name);
-       if ((flags & flw) == 0) {
-               printf("\n");
-               return(0);
-       }
-       c = getchar();
-       if (c == 'n' && getchar() == '\n')
-               done();
-       if (c == '\n')
-               return(-1);
-       if (c == 'y' && getchar() == '\n')
-               return(0);
-       while (getchar() != '\n');
-       goto repeat;
-}
-
-getfiles()
-{
-
-       if ((narg -= 2) == 0) {
-               strcpy(name, ".");
-               callout();
-       } else while (--narg >= 0) {
-               strcpy(name, *parg++);
-               callout();
-       }
-}
-
-
-expand()
-{
-       register  char *p0, *save0;
-       int n, fid;
-
-       if ((fid = open(name,0)) < 0)           fserr();
-       for (;;) {
-               if ((n = read(fid, (char *)&direct, sizeof(direct))) != sizeof(direct)) {
-                       if (n == 0) {
-                               close(fid);
-                               return;
-                       }
-                       fserr();
-               }
-               if (direct.d_ino == 0)  /* null entry */
-                       continue;
-               p0 = name;
-               if (direct.d_name[0] == '.')            /* don't save .xxxx */
-                       continue;
-               while (*p0++);
-               save0 = --p0;           /* save loc of \0 */
-               if (p0[-1] != '/')
-                       *p0++ = '/';
-               strcpy(p0, direct.d_name);
-                       callout();
-               *save0 = 0;             /* restore */
-       }
-}
-
-fserr()
-{
-       printf("%s -- Cannot open file\n", name);
-       done();
-}
-
-callout()
-{
-       register struct dent *d;
-       register char *ptr1, *ptr0;
-       struct dent *empty;
-       int mode;
-
-       if (stat(name,&statb) < 0)      fserr();
-       mode = statb.st_mode;
-       if ((mode &= S_IFMT) != 0) {
-               if (mode == S_IFDIR)  /* directory */
-                       expand();
-               if(mode != S_IFREG) return;
-       }
-       /* when we reach here we have recursed until we found 
-        * an ordinary file.  Now we look for it in "dir".
-        */
-       empty = 0;
-       d = &dir[0];
-       do  {
-               if (d->d_namep == 0) {  /* empty directory slot */
-                       if (empty == 0) /* remember the first one */
-                               empty = d;
-                       continue;
-               }
-               decode(name1,d);
-               ptr0 = name;
-               ptr1 = name1;
-               do      if (*ptr0++ != *ptr1)   goto cont;
-                   while (*ptr1++);
-               /* veritably the same name */
-               if (flags & flu) {  /* check the times */
-                       if (d->d_time >= statb.st_mtime)
-                               return;
-               }
-               if (verify('r') < 0)    return;
-               goto copydir;
-cont:          continue;
-       }  while (++d <= lastd);
-       /* name not found in directory */
-       if ((d = empty) == 0) {
-               d = lastd +1;
-               if (d >= edir) {
-                       printf("Directory overflow\n");
-                       done();
-               }
-       }
-       if (verify('a') < 0)            return;
-       if (d > lastd)          lastd = d;
-       encode(name,d);
-copydir:
-       d->d_mode = statb.st_mode | OK;
-       d->d_uid = statb.st_uid;
-       d->d_gid = statb.st_gid;
-       d->d_size = statb.st_size;
-       d->d_time = statb.st_mtime;
-}
-
-swabdir(tp)
-register struct tent *tp;
-{
-       swab((char *)tp, (char *)tp, sizeof(*tp));
-       swab(tp->pathnam, tp->pathnam, NAMELEN);
-       swab((char *)&tp->uid, (char *)&tp->uid, 4); /* uid,gid,spare,size0 */
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tp/tp3.c b/.ref-Research-V7/usr/src/cmd/tp/tp3.c
deleted file mode 100644 (file)
index c754ae6..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-#include "tp.h"
-
-gettape(how)
-int (*how)();
-{
-       register char *ptr0, *ptr1;
-       register struct dent *d;
-       int count;
-
-       do {
-               d = &dir[0];
-               count = 0;
-               do {
-                       if (d->d_namep == 0)  continue;
-                       decode(name,d);
-                       if (rnarg > 2) {
-                               ptr0 = name;
-                               ptr1 = *parg;
-                               while (*ptr1)
-                                       if (*ptr0++ != *ptr1++)  goto cont;
-                               if (*ptr0 && *ptr0 != '/')       goto cont;
-                       }
-                       (*how)(d);  /* delete, extract, or taboc */
-                       ++count;
-cont:                  continue;
-               }  while (++d <= lastd);
-               if (count == 0 && rnarg > 2)
-                       printf("%s  not found\n", *parg);
-               ++parg;
-       } while (--narg > 2);
-}
-
-delete(dd)
-struct dent *dd;
-{
-       if (verify('d') >= 0)
-               clrent(dd);
-}
-
-
-update()
-{
-       register struct dent *d;
-       register b, last;
-       int first, size;
-
-
-       bitmap();
-       d = &dir[0];
-       do {
-               if(d->d_namep == 0 || (d->d_mode&OK) == 0) continue;
-               if (d->d_size == 0)       continue;
-/* find a place on the tape for this file */
-               size = (d->d_size+BSIZE-1)/BSIZE;
-               first = ndentb;
-toosmall:      ++first;
-               if ((last = first + size) >= tapsiz)    maperr();
-               for (b = first; b < last; ++b)
-                       if (map[(b>>3) & MAPMASK] & (1<<(b&7))) {
-                               first = b;
-                               goto toosmall;
-                       };
-               d->d_tapea = first;
-               setmap(d);
-       }  while (++d <= lastd);
-       wrdir();
-       update1();
-}
-
-
-update1()
-{
-       register struct dent *d, *id;
-       register index;
-       int f;
-
-       for (;;) {
-               d = &dir[0];
-               index = MTSIZ;
-               id = 0;
-               do {    /* find new dent with lowest tape address */
-                       if(d->d_namep == 0 || (d->d_mode&OK) == 0) continue;
-                       if (d->d_tapea < index) {
-                               index = d->d_tapea;
-                               id = d;
-                       }
-               } while (++d <= lastd);
-               if ((d = id) == 0)      return;
-               d->d_mode &= ~OK;  /* change from new to old */
-               if (d->d_size == 0)  continue;
-               decode(name,d);
-               wseek(index);
-               if ((f = open(name,0)) < 0) {
-                       printf("Can't open %s\n", name);
-                       continue;
-               }
-               for (index = d->d_size/BSIZE; index != 0; --index)  {
-                       if (read(f,(char *)tapeb,BSIZE) != BSIZE)           phserr();
-                       twrite();
-               }
-               if (index = d->d_size % BSIZE) {
-                       if (read(f,(char *)tapeb,index) != index)  phserr();
-                       twrite();
-               }
-               if (read(f,(char *)tapeb,1) != 0)                   phserr();
-               close(f);
-       }
-}
-
-phserr()
-{      printf("%s -- Phase error \n", name);  }
-
-
-bitmap()       /* place old files in the map */
-{
-       register char *m;
-       register count;
-       register struct dent *d;
-
-       for(m=map;m<&map[MAPSIZE];) *m++ = 0;
-       count = ndirent;
-       d = dir;
-       do {
-               if(d->d_namep != 0 && (d->d_mode&OK) == 0
-                  && d->d_size != 0) setmap(d);
-               d++;
-       }  while (--count);
-}
-
-setmap(d)
-register struct dent *d;
-{
-       unsigned c, block;
-       char bit;
-       int i;
-
-       c = d->d_size/BSIZE;
-       if (d->d_size % BSIZE)  c++;
-       block = d->d_tapea;
-       if ((c += block) >= tapsiz)             maperr();
-       do {
-               bit = 1 << (block & 7);
-               i = (block>>3) & MAPMASK;
-               if (bit & map[i])               maperr();
-               map[i] |= bit;
-       } while (++block < c);
-}
-
-maperr()
-{
-       printf("Tape overflow\n");
-       done();
-}
-
-
-usage()
-{
-       register reg,count;
-       int     nused, nentr, nfree;
-       static lused;
-
-       bitmap();
-       for(count=0,nentr=0;count<ndirent;count++)
-               if(dir[count].d_namep != 0) nentr++;
-       nused = nfree = 0;
-       reg = ndentb;
-       ++reg;          /* address of first non-directory tape block */
-       count = tapsiz - reg;
-       do {
-               if (reg >= tapsiz) {
-                       printf("Tape overflow\n");
-                       done();
-               }
-               if (map[(reg>>3) & MAPMASK] & (1 << (reg&7))) {
-                       nused++;
-                       lused = reg;
-               } else {
-                       if (flags & flm)   break;
-                       nfree++;
-               }
-               reg++;
-       } while (--count);
-       printf("%4d entries\n%4d used\n", nentr, nused);
-       if ((flags & flm)==0)
-               printf("%4d free\n", nfree);
-       printf("%4d last\n", lused);
-}
-
-
-taboc(dd)
-struct dent *dd;
-{
-       register  mode;
-       register *m;
-       register char *s;
-       int count, *localtime();
-       char work[20];
-
-       if (flags & flv)  {
-               mode = dd->d_mode;
-               s = &work[19];
-               *s = 0;
-               for (count = 3; count; --count) {
-                       if (mode&1)     *--s = 'x';
-                         else          *--s = '-';
-                       if (mode&2)     *--s = 'w';
-                         else          *--s = '-';
-                       if (mode&4)     *--s = 'r';
-                         else          *--s = '-';
-                       mode >>= 3;
-               }
-               if (mode&4)             s[2] = 's';
-               if (mode&2)             s[5] = 's';
-               printf("%s%4d%4d%5d%9D ",s,dd->d_uid, dd->d_gid,dd->d_tapea,dd->d_size);
-               m = localtime(&dd->d_time);
-               printf("%2d/%2d/%2d %2d:%2d ",m[5],m[4]+1,m[3],m[2],m[1]);
-       }
-       printf("%s\n", name);
-}
-
-
-extract(d)
-register struct dent *d;
-{
-       register count, id;
-
-       if (d->d_size==0)       return;
-       if (verify('x') < 0)                    return;
-       rseek(d->d_tapea);
-       unlink(name);
-       if ((id = creat(name,d->d_mode)) < 0)
-               printf("%s -- create error\n", name);
-       count = d->d_size/BSIZE;
-       while (count--) {
-               tread();
-               if (write(id, (char *)tapeb, BSIZE) != BSIZE)   goto ng;
-       }
-       if (count = d->d_size % BSIZE) {
-               tread();
-               if (write(id, (char *)tapeb, count) != count) {
-ng:                    printf("%s -- write error\n", name);
-                       close(id);
-                       return;
-               }
-       }
-       close(id);
-       chown(name,d->d_uid & 0377, d->d_gid&0377);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/tr.c b/.ref-Research-V7/usr/src/cmd/tr.c
deleted file mode 100644 (file)
index 01395ba..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-#include <stdio.h>
-
-/* tr - transliterate data stream */
-int    dflag   = 0;
-int    sflag   = 0;
-int    cflag = 0;
-int    save    = 0;
-char   code[256];
-char   squeez[256];
-char   vect[256];
-struct string { int last, max; char *p; } string1, string2;
-
-main(argc,argv)
-char **argv;
-{
-       register i;
-       int j;
-       register c, d;
-       char *compl;
-       int lastd;
-
-       string1.last = string2.last = 0;
-       string1.max = string2.max = 0;
-       string1.p = string2.p = "";
-
-       if(--argc>0) {
-               argv++;
-               if(*argv[0]=='-'&&argv[0][1]!=0) {
-                       while(*++argv[0])
-                               switch(*argv[0]) {
-                               case 'c':
-                                       cflag++;
-                                       continue;
-                               case 'd':
-                                       dflag++;
-                                       continue;
-                               case 's':
-                                       sflag++;
-                                       continue;
-                               }
-                       argc--;
-                       argv++;
-               }
-       }
-       if(argc>0) string1.p = argv[0];
-       if(argc>1) string2.p = argv[1];
-       for(i=0; i<256; i++)
-               code[i] = vect[i] = 0;
-       if(cflag) {
-               while(c = next(&string1))
-                       vect[c&0377] = 1;
-               j = 0;
-               for(i=1; i<256; i++)
-                       if(vect[i]==0) vect[j++] = i;
-               vect[j] = 0;
-               compl = vect;
-       }
-       for(i=0; i<256; i++)
-               squeez[i] = 0;
-       lastd = 0;
-       for(;;){
-               if(cflag) c = *compl++;
-               else c = next(&string1);
-               if(c==0) break;
-               d = next(&string2);
-               if(d==0) d = lastd;
-               else lastd = d;
-               squeez[d&0377] = 1;
-               code[c&0377] = dflag?1:d;
-       }
-       while(d = next(&string2))
-               squeez[d&0377] = 1;
-       squeez[0] = 1;
-       for(i=0;i<256;i++) {
-               if(code[i]==0) code[i] = i;
-               else if(dflag) code[i] = 0;
-       }
-
-       while((c=getc(stdin)) != EOF ) {
-               if(c == 0) continue;
-               if(c = code[c&0377]&0377)
-                       if(!sflag || c!=save || !squeez[c&0377])
-                               putchar(save = c);
-       }
-       exit(0);
-}
-
-next(s)
-struct string *s;
-{
-
-again:
-       if(s->max) {
-               if(s->last++ < s->max)
-                       return(s->last);
-               s->max = s->last = 0;
-       }
-       if(s->last && *s->p=='-') {
-               nextc(s);
-               s->max = nextc(s);
-               if(s->max==0) {
-                       s->p--;
-                       return('-');
-               }
-               if(s->max < s->last)  {
-                       s->last = s->max-1;
-                       return('-');
-               }
-               goto again;
-       }
-       return(s->last = nextc(s));
-}
-
-nextc(s)
-struct string *s;
-{
-       register c, i, n;
-
-       c = *s->p++;
-       if(c=='\\') {
-               i = n = 0;
-               while(i<3 && (c = *s->p)>='0' && c<='7') {
-                       n = n*8 + c - '0';
-                       i++;
-                       s->p++;
-               }
-               if(i>0) c = n;
-               else c = *s->p++;
-       }
-       if(c==0) *--s->p = 0;
-       return(c&0377);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/README b/.ref-Research-V7/usr/src/cmd/troff/README
deleted file mode 100644 (file)
index cadbf3f..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-The version of [nt]roff in this directory
-is changed somewhat from the version you
-may be used to.
-
-1. fonts are in /usr/lib/font/ftXX,
-where XX is the name of the font (e.g., HI).
-Source is in ./font/ftXX.c.
-
-2. macro files like -ms are searched for in
-/usr/lib/tmac/tmac.xxx.
-Your /usr/lib/tmac may have to be changed.
-The .so request has been modified to make it a
-fatal error to try .so non-existent-file;
-this should head off people who are explcitly 
-including /usr/lib/tmac.s, etc.
-
-3. terminal driving tables for nroff are
-in /usr/lib/term/tabxxx instead of /usr/lib/term/xxx.
diff --git a/.ref-Research-V7/usr/src/cmd/troff/d.h b/.ref-Research-V7/usr/src/cmd/troff/d.h
deleted file mode 100644 (file)
index 247fa4f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-struct d {filep op; int dnl,dimac,ditrap,ditf,alss,blss,nls,mkline,
-               maxl,hnl,curd;} d[NDI], *dip;
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/chars.c b/.ref-Research-V7/usr/src/cmd/troff/font/chars.c
deleted file mode 100644 (file)
index 60ebe02..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-extern char codetab[];
-extern int chtab[];
-
-main(){
-       register i,j,k;
-
-       for(i=040; i<(256); i++){
-               j = codetab[i-040] & 0377;
-               if(j & 0200)for(k=0; chtab[k] != 0; k =+ 2){
-                       if(chtab[k+1] == i){
-                               printf("%o \\(%c%c\n",
-                                       j,
-                                       chtab[k] & 0377,
-                                       chtab[k]>>8 & 0377);
-                               break;
-                       }else if(i < 0177){
-                               printf("%o %c\n",j,i & 0177);
-                               break;
-                       }
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftB.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftB.c
deleted file mode 100644 (file)
index 66f951b..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char Bw[256-32] {      /*Times Bold widths*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-18,     /*$*/
-28,     /*%*/
-27,     /*&*/
-12,     /*' close*/
-16,     /*(*/
-16,     /*)*/
-18,     /***/
-36,     /*+*/
-12,     /*,*/
-14,     /*- hyphen*/
-12,     /*.*/
-18,     /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-13,     /*:*/
-13,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-22,     /*?*/
-0,      /*@*/
-28+0200, /*A*/
-26+0200, /*B*/
-26+0200, /*C*/
-29+0200, /*D*/
-25+0200, /*E*/
-23+0200, /*F*/
-28+0200, /*G*/
-32+0200, /*H*/
-16+0200, /*I*/
-21+0200, /*J*/
-28+0200, /*K*/
-25+0200, /*L*/
-36+0200, /*M*/
-30+0200, /*N*/
-29+0200, /*O*/
-25+0200, /*P*/
-29+0300, /*Q*/
-28+0200, /*R*/
-23+0200, /*S*/
-25+0200, /*T*/
-29+0200, /*U*/
-27+0200, /*V*/
-36+0200, /*W*/
-27+0200, /*X*/
-28+0200, /*Y*/
-27+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,     /*_*/
-12,     /*` open*/
-19,     /*a*/
-19+0200, /*b*/
-16,     /*c*/
-19+0200, /*d*/
-17,     /*e*/
-13+0200, /*f*/
-18+0100, /*g*/
-22+0200, /*h*/
-12+0200, /*i*/
-12+0300, /*j*/
-23+0200, /*k*/
-12+0200, /*l*/
-32,     /*m*/
-22,     /*n*/
-18,     /*o*/
-20+0100, /*p*/
-19+0100, /*q*/
-15,     /*r*/
-17,     /*s*/
-13+0200, /*t*/
-21,     /*u*/
-19,     /*v*/
-27,     /*w*/
-21,     /*x*/
-19+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-28,     /*1/4*/
-28,     /*1/2*/
-28,     /*3/4*/
-36,     /*minus*/
-22,     /*fi*/
-22,     /*fl*/
-23,     /*ff*/
-33,     /*ffi*/
-33,     /*ffl*/
-15,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-19,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftBC.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftBC.c
deleted file mode 100644 (file)
index 8c2c97f..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-char XXw[256-32] {     /*XX*/
-12,     /*space*/
-11,     /*!*/
-0,      /*"*/
-0,      /*#*/
-15,     /*$*/
-19,     /*%*/
-19,     /*&*/
-7,      /*' close*/
-8,      /*(*/
-8,      /*)*/
-14,     /***/
-27,     /*+*/
-7,      /*,*/
-11,     /*- hyphen*/
-7,      /*.*/
-14,     /*/*/
-15+0200, /*0*/
-15+0200, /*1*/
-15+0200, /*2*/
-15+0200, /*3*/
-15+0200, /*4*/
-15+0200, /*5*/
-15+0200, /*6*/
-15+0200, /*7*/
-15+0200, /*8*/
-15+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-17,     /*?*/
-0,      /*@*/
-16+0200, /*A*/
-16+0200, /*B*/
-16+0200, /*C*/
-17+0200, /*D*/
-13+0200, /*E*/
-13+0200, /*F*/
-17+0200, /*G*/
-17+0200, /*H*/
-8+0200, /*I*/
-13+0200, /*J*/
-15+0200, /*K*/
-13+0200, /*L*/
-24+0200, /*M*/
-18+0200, /*N*/
-17+0200, /*O*/
-15+0200, /*P*/
-17+0300, /*Q*/
-16+0200, /*R*/
-15+0200, /*S*/
-14+0200, /*T*/
-17+0200, /*U*/
-15+0200, /*V*/
-23+0200, /*W*/
-15+0200, /*X*/
-14+0200, /*Y*/
-13+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,      /*_*/
-7,      /*` open*/
-13,     /*a*/
-13+0200, /*b*/
-12,     /*c*/
-13+0200, /*d*/
-13,     /*e*/
-9+0200, /*f*/
-13+0100, /*g*/
-13+0200, /*h*/
-7+0200, /*i*/
-7+0300, /*j*/
-12+0200, /*k*/
-7+0200, /*l*/
-20,     /*m*/
-13,     /*n*/
-13,     /*o*/
-13+0100, /*p*/
-13+0100, /*q*/
-8,      /*r*/
-11,     /*s*/
-8+0200, /*t*/
-13,     /*u*/
-11,     /*v*/
-19,     /*w*/
-10,     /*x*/
-12+0100, /*y*/
-9,      /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-11,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-19,     /*1/4*/
-19,     /*1/2*/
-19,     /*3/4*/
-27,     /*minus*/
-17,     /*fi*/
-17,     /*fl*/
-18,     /*ff*/
-26,     /*ffi*/
-26,     /*ffl*/
-13,     /*degree*/
-17,     /*dagger*/
-0,      /*section*/
-10,     /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,3,    /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-15,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftC.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftC.c
deleted file mode 100644 (file)
index c316978..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-char Cw[256-32] {      /*Comm I news Condensed made to look like II*/
-12,     /*space*/
-8,      /*!*/
-0,      /*"*/
-0,      /*#*/
-16,     /*$*/
-24,     /*%*/
-23,     /*&*/
-8,      /*' close*/
-11,     /*(*/
-11,     /*)*/
-14,     /***/
-27,     /*+*/
-8,      /*,*/
-10,     /*- hyphen*/
-8,      /*.*/
-18,     /*/*/
-16+0200, /*0*/
-16+0200, /*1*/
-16+0200, /*2*/
-16+0200, /*3*/
-16+0200, /*4*/
-16+0200, /*5*/
-16+0200, /*6*/
-16+0200, /*7*/
-16+0200, /*8*/
-16+0200, /*9*/
-8,      /*:*/
-8,      /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-14,     /*?*/
-0,      /*@*/
-19+0200, /*A*/
-17+0200, /*B*/
-17+0200, /*C*/
-17+0200, /*D*/
-15+0200, /*E*/
-15+0200, /*F*/
-18+0200, /*G*/
-17+0200, /*H*/
-8+0200, /*I*/
-13+0200, /*J*/
-17+0200, /*K*/
-15+0200, /*L*/
-22+0200, /*M*/
-18+0200, /*N*/
-18+0200, /*O*/
-16+0200, /*P*/
-18+0300, /*Q*/
-17+0200, /*R*/
-17+0200, /*S*/
-17+0200, /*T*/
-17+0200, /*U*/
-17+0200, /*V*/
-24+0200, /*W*/
-16+0200, /*X*/
-17+0200, /*Y*/
-15+0200, /*Z*/
-10,     /*[*/
-0,      /*\*/
-10,     /*]*/
-0,      /*^*/
-0,      /*_*/
-8,      /*` open*/
-14,     /*a*/
-15+0200, /*b*/
-14,     /*c*/
-15+0200, /*d*/
-14,     /*e*/
-11+0200, /*f*/
-14+0100, /*g*/
-14+0200, /*h*/
-8+0200, /*i*/
-8+0300, /*j*/
-14+0200, /*k*/
-8+0200, /*l*/
-22,     /*m*/
-14,     /*n*/
-15,     /*o*/
-15+0100, /*p*/
-15+0100, /*q*/
-10,     /*r*/
-14,     /*s*/
-12+0200, /*t*/
-14,     /*u*/
-14,     /*v*/
-20,     /*w*/
-13,     /*x*/
-14+0100, /*y*/
-12,     /*z*/
-0,      /*{*/
-5,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-10,     /*hyphen*/
-27,     /*bullet*/
-36,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-24,     /*1/4*/
-24,     /*1/2*/
-24,     /*3/4*/
-27,     /*minus*/
-18,     /*fi*/
-18,     /*fl*/
-20,     /*ff*/
-18,     /*ffi*/
-19,     /*ffl*/
-15,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,3,    /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-0,      /*registered*/
-0,      /*copywrite*/
-0,
-0,      /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftCE.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftCE.c
deleted file mode 100644 (file)
index 1f0bf1e..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char CEw[256-32] {     /*Century Expanded widths*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-20,     /*#*/
-18,     /*$*/
-24,     /*%*/
-27,     /*&*/
-9,      /*' close*/
-15,     /*(*/
-15,     /*)*/
-16,     /***/
-27,     /*+*/
-9,      /*,*/
-14,     /*- hyphen*/
-9,      /*.*/
-12,     /*/*/
-18+0200, /*0*/
-18+0200, /*1*/
-18+0200, /*2*/
-18+0200, /*3*/
-18+0200, /*4*/
-18+0200, /*5*/
-18+0200, /*6*/
-18+0200, /*7*/
-18+0200, /*8*/
-18+0200, /*9*/
-13,     /*:*/
-13,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-19,     /*?*/
-30,     /*@*/
-28+0200, /*A*/
-25+0200, /*B*/
-25+0200, /*C*/
-27+0200, /*D*/
-26+0200, /*E*/
-25+0200, /*F*/
-26+0200, /*G*/
-29+0200, /*H*/
-15+0200, /*I*/
-20+0200, /*J*/
-28+0200, /*K*/
-25+0200, /*L*/
-32+0200, /*M*/
-29+0200, /*N*/
-25+0200, /*O*/
-24+0200, /*P*/
-26+0300, /*Q*/
-26+0200, /*R*/
-22+0200, /*S*/
-24+0200, /*T*/
-28+0200, /*U*/
-28+0200, /*V*/
-36+0200, /*W*/
-27+0200, /*X*/
-27+0200, /*Y*/
-24+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,     /*_*/
-9,      /*` open*/
-18,     /*a*/
-19+0200, /*b*/
-16,     /*c*/
-19+0200, /*d*/
-17,     /*e*/
-13+0200, /*f*/
-20+0100, /*g*/
-19+0200, /*h*/
-10+0200, /*i*/
-12+0300, /*j*/
-20+0200, /*k*/
-10+0200, /*l*/
-29,     /*m*/
-19,     /*n*/
-17,     /*o*/
-19+0100, /*p*/
-19+0100, /*q*/
-16,     /*r*/
-15,     /*s*/
-14+0200, /*t*/
-19,     /*u*/
-19,     /*v*/
-27,     /*w*/
-19,     /*x*/
-20+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-5,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-24,     /*1/4*/
-24,     /*1/2*/
-24,     /*3/4*/
-27,     /*minus*/
-20,     /*fi*/
-20,     /*fl*/
-22,     /*ff*/
-30,     /*ffi*/
-30,     /*ffl*/
-13,     /*degree*/
-18,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-18,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftCI.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftCI.c
deleted file mode 100644 (file)
index 8be978c..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Century Schoolbook Italic-- Commercial II; name CI
- */
-char XXw[256-32] {     /*XX*/
-12,     /*space*/
-14,     /*!*/
-0,      /*"*/
-0,      /*#*/
-20,     /*$*/
-22,     /*%*/
-32,     /*&*/
-9,      /*' close*/
-14,     /*(*/
-14,     /*)*/
-18,     /***/
-27,     /*+*/
-9,      /*,*/
-12,     /*- hyphen*/
-9,      /*.*/
-10,     /*/*/
-20+0200, /*0*/
-20+0200, /*1*/
-20+0200, /*2*/
-20+0200, /*3*/
-20+0200, /*4*/
-20+0200, /*5*/
-20+0200, /*6*/
-20+0200, /*7*/
-20+0200, /*8*/
-20+0200, /*9*/
-12,     /*:*/
-12,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-21,     /*?*/
-0,      /*@*/
-27+0200, /*A*/
-25+0200, /*B*/
-24+0200, /*C*/
-28+0200, /*D*/
-26+0200, /*E*/
-23+0200, /*F*/
-27+0200, /*G*/
-29+0200, /*H*/
-14+0200, /*I*/
-20+0200, /*J*/
-27+0200, /*K*/
-25+0200, /*L*/
-32+0200, /*M*/
-28+0200, /*N*/
-26+0200, /*O*/
-23+0200, /*P*/
-26+0300, /*Q*/
-27+0200, /*R*/
-21+0200, /*S*/
-24+0200, /*T*/
-28+0200, /*U*/
-27+0200, /*V*/
-34+0200, /*W*/
-26+0200, /*X*/
-27+0200, /*Y*/
-22+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,      /*_*/
-9,      /*` open*/
-20,     /*a*/
-20+0200, /*b*/
-16,     /*c*/
-22+0200, /*d*/
-16,     /*e*/
-12+0200, /*f*/
-18+0100, /*g*/
-21+0200, /*h*/
-11+0200, /*i*/
-11+0300, /*j*/
-20+0200, /*k*/
-12+0200, /*l*/
-31,     /*m*/
-21,     /*n*/
-18,     /*o*/
-20+0100, /*p*/
-18+0100, /*q*/
-16,     /*r*/
-15,     /*s*/
-12+0200, /*t*/
-21,     /*u*/
-18,     /*v*/
-27,     /*w*/
-18,     /*x*/
-17+0100, /*y*/
-15,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-12,     /*hyphen*/
-27,     /*bullet*/
-36,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-30,     /*1/4*/
-30,     /*1/2*/
-30,     /*3/4*/
-27,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-21,     /*ff*/
-29,     /*ffi*/
-29,     /*ffl*/
-16,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,3,    /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-21,     /*registered*/
-21,     /*copywrite*/
-0,
-20,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftCK.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftCK.c
deleted file mode 100644 (file)
index ffb0ffa..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char CKw[256-32] {     /*Century Bold Italic widths (CK)*/
-12,     /*space*/
-14,     /*!*/
-0,      /*"*/
-0,      /*#*/
-19,     /*$*/
-31,     /*%*/
-30,     /*&*/
-10,     /*' close*/
-18,     /*(*/
-18,     /*)*/
-18,     /***/
-27,     /*+*/
-10,     /*,*/
-14,     /*- hyphen*/
-10,     /*.*/
-11,     /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-13,     /*:*/
-13,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-21,     /*?*/
-0,      /*@*/
-27+0200, /*A*/
-27+0200, /*B*/
-25+0200, /*C*/
-28+0200, /*D*/
-26+0200, /*E*/
-24+0200, /*F*/
-27+0200, /*G*/
-29+0200, /*H*/
-15+0200, /*I*/
-20+0200, /*J*/
-29+0200, /*K*/
-25+0200, /*L*/
-31+0200, /*M*/
-27+0200, /*N*/
-27+0200, /*O*/
-26+0200, /*P*/
-28+0300, /*Q*/
-29+0200, /*R*/
-22+0200, /*S*/
-25+0200, /*T*/
-28+0200, /*U*/
-25+0200, /*V*/
-35+0200, /*W*/
-26+0200, /*X*/
-27+0200, /*Y*/
-24+0200, /*Z*/
-14,     /*[*/
-0,      /*\*/
-14,     /*]*/
-0,      /*^*/
-0,     /*_*/
-10,     /*` open*/
-21,     /*a*/
-19+0200, /*b*/
-18,     /*c*/
-20+0200, /*d*/
-18,     /*e*/
-14+0200, /*f*/
-19+0100, /*g*/
-21+0200, /*h*/
-12+0200, /*i*/
-13+0300, /*j*/
-21+0200, /*k*/
-13+0200, /*l*/
-30,     /*m*/
-21,     /*n*/
-19,     /*o*/
-20+0100, /*p*/
-20+0100, /*q*/
-15,     /*r*/
-16,     /*s*/
-14+0200, /*t*/
-21,     /*u*/
-19,     /*v*/
-27,     /*w*/
-22,     /*x*/
-20+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-5,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-31,     /*1/4*/
-31,     /*1/2*/
-31,     /*3/4*/
-27,     /*minus*/
-23,     /*fi*/
-23,     /*fl*/
-22,     /*ff*/
-19,     /*en*/
-33,     /*paragraph*/
-15,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-23,     /*registered*/
-23,     /*copywrite*/
-0,
-19,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftCS.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftCS.c
deleted file mode 100644 (file)
index e297c6d..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Century schoolbook -- Commercial II layout; name CS
- */
-char XXw[256-32] {     /*XX*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-20,     /*$*/
-26,     /*%*/
-31,     /*&*/
-9,      /*' close*/
-14,     /*(*/
-14,     /*)*/
-19,     /***/
-27,     /*+*/
-9,      /*,*/
-12,     /*- hyphen*/
-9,      /*.*/
-13,     /*/*/
-20+0200, /*0*/
-20+0200, /*1*/
-20+0200, /*2*/
-20+0200, /*3*/
-20+0200, /*4*/
-20+0200, /*5*/
-20+0200, /*6*/
-20+0200, /*7*/
-20+0200, /*8*/
-20+0200, /*9*/
-13,     /*:*/
-13,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-22,     /*?*/
-0,      /*@*/
-28+0200, /*A*/
-26+0200, /*B*/
-24+0200, /*C*/
-28+0200, /*D*/
-26+0200, /*E*/
-24+0200, /*F*/
-28+0200, /*G*/
-30+0200, /*H*/
-15+0200, /*I*/
-21+0200, /*J*/
-29+0200, /*K*/
-24+0200, /*L*/
-34+0200, /*M*/
-30+0200, /*N*/
-27+0200, /*O*/
-25+0200, /*P*/
-27+0300, /*Q*/
-27+0200, /*R*/
-22+0200, /*S*/
-24+0200, /*T*/
-30+0200, /*U*/
-28+0200, /*V*/
-36+0200, /*W*/
-27+0200, /*X*/
-27+0200, /*Y*/
-22+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,      /*_*/
-9,      /*` open*/
-20,     /*a*/
-20+0200, /*b*/
-17,     /*c*/
-20+0200, /*d*/
-18,     /*e*/
-14+0200, /*f*/
-21+0100, /*g*/
-22+0200, /*h*/
-12+0200, /*i*/
-14+0300, /*j*/
-22+0200, /*k*/
-12+0200, /*l*/
-32,     /*m*/
-22,     /*n*/
-18,     /*o*/
-20+0100, /*p*/
-20+0100, /*q*/
-16,     /*r*/
-16,     /*s*/
-15+0200, /*t*/
-22,     /*u*/
-20,     /*v*/
-28,     /*w*/
-20,     /*x*/
-20+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-12,     /*hyphen*/
-27,     /*bullet*/
-36,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-30,     /*1/4*/
-30,     /*1/2*/
-30,     /*3/4*/
-27,     /*minus*/
-22,     /*fi*/
-22,     /*fl*/
-24,     /*ff*/
-32,     /*ffi*/
-32,     /*ffl*/
-16,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,3,    /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-20,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftCW.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftCW.c
deleted file mode 100644 (file)
index 9b0da35..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-char XXw[256-32] {     /*XX*/
-25,     /*space*/
-25,     /*!*/
-0,      /*"*/
-0,      /*#*/
-25,     /*$*/
-25,     /*%*/
-25,     /*&*/
-25,     /*' close*/
-25,     /*(*/
-25,     /*)*/
-25,     /***/
-25,     /*+*/
-25,     /*,*/
-25,     /*- hyphen*/
-25,     /*.*/
-25,     /*/*/
-25+0200, /*0*/
-25+0200, /*1*/
-25+0200, /*2*/
-25+0200, /*3*/
-25+0200, /*4*/
-25+0200, /*5*/
-25+0200, /*6*/
-25+0200, /*7*/
-25+0200, /*8*/
-25+0200, /*9*/
-25,     /*:*/
-25,     /*;*/
-0,      /*<*/
-25,     /*=*/
-0,      /*>*/
-25,     /*?*/
-0,      /*@*/
-25+0200, /*A*/
-25+0200, /*B*/
-25+0200, /*C*/
-25+0200, /*D*/
-25+0200, /*E*/
-25+0200, /*F*/
-25+0200, /*G*/
-25+0200, /*H*/
-25+0200, /*I*/
-25+0200, /*J*/
-25+0200, /*K*/
-25+0200, /*L*/
-25+0200, /*M*/
-25+0200, /*N*/
-25+0200, /*O*/
-25+0200, /*P*/
-25+0300, /*Q*/
-25+0200, /*R*/
-25+0200, /*S*/
-25+0200, /*T*/
-25+0200, /*U*/
-25+0200, /*V*/
-25+0200, /*W*/
-25+0200, /*X*/
-25+0200, /*Y*/
-25+0200, /*Z*/
-25,     /*[*/
-0,      /*\*/
-25,     /*]*/
-0,      /*^*/
-0,      /*_*/
-25,     /*` open*/
-25,     /*a*/
-25+0200, /*b*/
-25,     /*c*/
-25+0200, /*d*/
-25,     /*e*/
-25+0200, /*f*/
-25+0100, /*g*/
-25+0200, /*h*/
-25+0200, /*i*/
-25+0300, /*j*/
-25+0200, /*k*/
-25+0200, /*l*/
-25,     /*m*/
-25,     /*n*/
-25,     /*o*/
-25+0100, /*p*/
-25+0100, /*q*/
-25,     /*r*/
-25,     /*s*/
-25+0200, /*t*/
-25,     /*u*/
-25,     /*v*/
-25,     /*w*/
-25,     /*x*/
-25+0100, /*y*/
-25,     /*z*/
-0,      /*{*/
-25,     /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-25,     /*hyphen*/
-25,     /*bullet*/
-25,     /*square*/
-25,     /*3/4 em*/
-25,     /*rule*/
-25,     /*1/4*/
-25,     /*1/2*/
-25,     /*3/4*/
-25,     /*minus*/
-25,     /*fi*/
-25,     /*fl*/
-25,     /*ff*/
-25,     /*ffi*/
-25,     /*ffl*/
-25,     /*degree*/
-25,     /*dagger*/
-0,      /*section*/
-25,     /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,3,    /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-25,     /*registered*/
-25,     /*copywrite*/
-0,
-25,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftG.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftG.c
deleted file mode 100644 (file)
index b9153e5..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char Gw[256-32] {      /*Geneva Regular widths*/
-12,     /*space*/
-12,     /*!*/
-0,      /*"*/
-0,      /*#*/
-23,     /*$*/
-28,     /*%*/
-25,     /*&*/
-9,      /*' close*/
-13,     /*(*/
-13,     /*)*/
-16,     /***/
-36,     /*+*/
-8,      /*,*/
-15,     /*- hyphen*/
-8,      /*.*/
-15,     /*/*/
-23+0200, /*0*/
-23+0200, /*1*/
-23+0200, /*2*/
-23+0200, /*3*/
-23+0200, /*4*/
-23+0200, /*5*/
-23+0200, /*6*/
-23+0200, /*7*/
-23+0200, /*8*/
-23+0200, /*9*/
-12,     /*:*/
-12,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-25,     /*?*/
-0,      /*@*/
-25+0200, /*A*/
-26+0200, /*B*/
-27+0200, /*C*/
-26+0200, /*D*/
-24+0200, /*E*/
-22+0200, /*F*/
-29+0200, /*G*/
-27+0200, /*H*/
-11+0200, /*I*/
-20+0200, /*J*/
-26+0200, /*K*/
-22+0200, /*L*/
-32+0200, /*M*/
-27+0200, /*N*/
-29+0200, /*O*/
-24+0200, /*P*/
-29+0300, /*Q*/
-26+0200, /*R*/
-25+0200, /*S*/
-23+0200, /*T*/
-27+0200, /*U*/
-24+0200, /*V*/
-35+0200, /*W*/
-25+0200, /*X*/
-26+0200, /*Y*/
-23+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,     /*_*/
-9,      /*` open*/
-21,     /*a*/
-22+0200, /*b*/
-21,     /*c*/
-22+0200, /*d*/
-21,     /*e*/
-12+0200, /*f*/
-21+0100, /*g*/
-22+0200, /*h*/
-10+0200, /*i*/
-10+0300, /*j*/
-21+0200, /*k*/
-10+0200, /*l*/
-31,     /*m*/
-22,     /*n*/
-21,     /*o*/
-22+0100, /*p*/
-22+0100, /*q*/
-14,     /*r*/
-20,     /*s*/
-12+0200, /*t*/
-22,     /*u*/
-19,     /*v*/
-28,     /*w*/
-20,     /*x*/
-20+0100, /*y*/
-18,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-15,     /*hyphen*/
-27,     /*bullet*/
-36,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-30,     /*1/4*/
-30,     /*1/2*/
-30,     /*3/4*/
-36,     /*minus*/
-22,     /*fi*/
-22,     /*fl*/
-24,     /*ff*/
-34,     /*ffi*/
-34,     /*ffl*/
-14,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-21,     /*registered*/
-21,     /*copywrite*/
-0,
-23,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftGI.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftGI.c
deleted file mode 100644 (file)
index 39d69d7..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-char W10[256-32] {     /*Genevia Regular Italic (GI) widths #803-033B*/
-13,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-23,     /*$*/
-30,     /*%*/
-26,     /*&*/
-9,      /*' close*/
-13,     /*(*/
-13,     /*)*/
-15,     /***/
-36,     /*+*/
-8,      /*,*/
-14,     /*- hyphen*/
-8,      /*.*/
-11,     /*/*/
-23+0200, /*0*/
-23+0200, /*1*/
-23+0200, /*2*/
-23+0200, /*3*/
-23+0200, /*4*/
-23+0200, /*5*/
-23+0200, /*6*/
-23+0200, /*7*/
-23+0200, /*8*/
-23+0200, /*9*/
-12,     /*:*/
-12,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-24,     /*?*/
-0,      /*@*/
-25+0200, /*A*/
-25+0200, /*B*/
-28+0200, /*C*/
-26+0200, /*D*/
-23+0200, /*E*/
-21+0200, /*F*/
-29+0200, /*G*/
-26+0200, /*H*/
-11+0200, /*I*/
-20+0200, /*J*/
-25+0200, /*K*/
-22+0200, /*L*/
-31+0200, /*M*/
-27+0200, /*N*/
-29+0200, /*O*/
-23+0200, /*P*/
-29+0300, /*Q*/
-26+0200, /*R*/
-25+0200, /*S*/
-22+0200, /*T*/
-26+0200, /*U*/
-24+0200, /*V*/
-33+0200, /*W*/
-25+0200, /*X*/
-24+0200, /*Y*/
-23+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,     /*_*/
-9,      /*` open*/
-21,     /*a*/
-22+0200, /*b*/
-21,     /*c*/
-22+0200, /*d*/
-21,     /*e*/
-12+0200, /*f*/
-22+0100, /*g*/
-22+0200, /*h*/
-10+0200, /*i*/
-10+0300, /*j*/
-20+0200, /*k*/
-10+0200, /*l*/
-32,     /*m*/
-22,     /*n*/
-22,     /*o*/
-22+0100, /*p*/
-22+0100, /*q*/
-13,     /*r*/
-20,     /*s*/
-12+0200, /*t*/
-22,     /*u*/
-19,     /*v*/
-28,     /*w*/
-20,     /*x*/
-19+0100, /*y*/
-18,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,     /*hyphen*/
-27,     /*bullet*/
-36,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-30,     /*1/4*/
-30,     /*1/2*/
-30,     /*3/4*/
-36,     /*minus*/
-22,     /*fi*/
-22,     /*fl*/
-24,     /*ff*/
-34,     /*ffi*/
-34,     /*ffl*/
-14,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-21,     /*registered*/
-21,     /*copywrite*/
-0,
-23,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftGM.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftGM.c
deleted file mode 100644 (file)
index 2a518ee..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*Geneva Medium (similar to Helvetica Medium)*/
-char W11[256-32] {     /*Geneva Medium widths*/
-14,     /*space*/
-14,     /*!*/
-0,      /*"*/
-0,      /*#*/
-25,     /*$*/
-29,     /*%*/
-27,     /*&*/
-10,     /*' close*/
-15,     /*(*/
-15,     /*)*/
-17,     /***/
-27,     /*+*/
-10,    /*,*/
-17,     /*- hyphen*/
-10,     /*.*/
-17,     /*/*/
-25+0200, /*0*/
-25+0200, /*1*/
-25+0200, /*2*/
-25+0200, /*3*/
-25+0200, /*4*/
-25+0200, /*5*/
-25+0200, /*6*/
-25+0200, /*7*/
-25+0200, /*8*/
-25+0200, /*9*/
-14,     /*:*/
-14,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-27,     /*?*/
-0,      /*@*/
-27+0200, /*A*/
-27+0200, /*B*/
-29+0200, /*C*/
-28+0200, /*D*/
-24+0200, /*E*/
-23+0200, /*F*/
-29+0200, /*G*/
-27+0200, /*H*/
-12+0200, /*I*/
-22+0200, /*J*/
-27+0200, /*K*/
-23+0200, /*L*/
-32+0200, /*M*/
-28+0200, /*N*/
-30+0200, /*O*/
-25+0200, /*P*/
-30+0300, /*Q*/
-26+0200, /*R*/
-26+0200, /*S*/
-24+0200, /*T*/
-27+0200, /*U*/
-26+0200, /*V*/
-35+0200, /*W*/
-26+0200, /*X*/
-25+0200, /*Y*/
-25+0200, /*Z*/
-16,     /*[*/
-0,      /*\*/
-16,     /*]*/
-0,      /*^*/
-0,     /*_*/
-10,     /*` open*/
-22,     /*a*/
-23+0200, /*b*/
-22,     /*c*/
-23+0200, /*d*/
-22,     /*e*/
-14+0200, /*f*/
-23+0100, /*g*/
-22+0200, /*h*/
-11+0200, /*i*/
-11+0300, /*j*/
-22+0200, /*k*/
-11+0200, /*l*/
-32,     /*m*/
-22,     /*n*/
-23,     /*o*/
-23+0100, /*p*/
-23+0100, /*q*/
-15,     /*r*/
-21,     /*s*/
-14+0200, /*t*/
-22,     /*u*/
-20,     /*v*/
-30,     /*w*/
-21,     /*x*/
-21+0100, /*y*/
-20,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-7,      /*narrow space*/
-17,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-32,     /*1/4*/
-32,     /*1/2*/
-32,     /*3/4*/
-27,     /*minus*/
-24,     /*fi*/
-24,     /*fl*/
-28,     /*ff*/
-38,     /*ffi*/
-38,     /*ffl*/
-14,     /*degree*/
-23,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-21,     /*registered*/
-21,     /*copywrite*/
-0,
-25,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftGR.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftGR.c
deleted file mode 100644 (file)
index 5c2656d..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-char XXw[256-32] {     /*XX*/
-12,     /*space*/
-0,      /*!*/
-0,      /*"*/
-0,      /*#*/
-20,     /*$*/
-0,      /*%*/
-20,     /*&*/
-10,     /*' close*/
-16,     /*(*/
-16,     /*)*/
-0,      /***/
-0,      /*+*/
-10,     /*,*/
-15,     /*- hyphen*/
-10,     /*.*/
-0,      /*/*/
-20+0200, /*0*/
-20+0200, /*1*/
-6+0200, /*2*/
-6+0200, /*3*/
-4+0200, /*4*/
-6+0200, /*5*/
-4+0200, /*6*/
-15+0200, /*7*/
-15+0200, /*8*/
-20+0200, /*9*/
-11,     /*:*/
-14,     /*;*/
-0,      /*<*/
-20,     /*=*/
-0,      /*>*/
-20,     /*?*/
-0,      /*@*/
-23+0200, /*A*/
-26+0200, /*B*/
-28+0200, /*C*/
-28+0200, /*D*/
-27+0200, /*E*/
-30+0200, /*F*/
-24+0200, /*G*/
-23+0200, /*H*/
-16+0200, /*I*/
-20+0200, /*J*/
-29+0200, /*K*/
-28+0200, /*L*/
-33+0200, /*M*/
-30+0200, /*N*/
-26+0200, /*O*/
-25+0200, /*P*/
-30+0300, /*Q*/
-29+0200, /*R*/
-27+0200, /*S*/
-25+0200, /*T*/
-29+0200, /*U*/
-21+0200, /*V*/
-24+0200, /*W*/
-29+0200, /*X*/
-33+0200, /*Y*/
-25+0200, /*Z*/
-28,     /*[*/
-0,      /*\*/
-0,      /*]*/
-0,      /*^*/
-0,      /*_*/
-10,     /*` open*/
-23,     /*a*/
-25+0200, /*b*/
-18,     /*c*/
-19+0200, /*d*/
-17,     /*e*/
-24+0200, /*f*/
-21+0100, /*g*/
-23+0200, /*h*/
-12+0200, /*i*/
-18+0300, /*j*/
-21+0200, /*k*/
-21+0200, /*l*/
-24,     /*m*/
-20,     /*n*/
-19,     /*o*/
-21+0100, /*p*/
-21+0100, /*q*/
-24,     /*r*/
-24,     /*s*/
-17+0200, /*t*/
-19,     /*u*/
-15,     /*v*/
-24,     /*w*/
-23,     /*x*/
-24+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-0,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-15,     /*hyphen*/
-0,      /*bullet*/
-0,      /*square*/
-0,      /*3/4 em*/
-38,     /*rule*/
-19,     /*1/4*/
-16,     /*1/2*/
-0,      /*3/4*/
-17,     /*minus*/
-30,     /*fi*/
-29,     /*fl*/
-34,     /*ff*/
-20,     /*ffi*/
-17,     /*ffl*/
-0,      /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-10,     /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,3,    /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-0,      /*registered*/
-0,      /*copywrite*/
-0,
-20,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftI.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftI.c
deleted file mode 100644 (file)
index 5aff97b..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char Iw[256-32] {      /*Times Italic widths*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-19,     /*$*/
-27,     /*%*/
-26,     /*&*/
-11,     /*' close*/
-15,     /*(*/
-15,     /*)*/
-16,     /***/
-36,     /*+*/
-11,     /*,*/
-13,     /*- hyphen*/
-11,     /*.*/
-9,      /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-20,     /*?*/
-0,      /*@*/
-25+0200, /*A*/
-24+0200, /*B*/
-26+0200, /*C*/
-27+0200, /*D*/
-23+0200, /*E*/
-21+0200, /*F*/
-27+0200, /*G*/
-29+0200, /*H*/
-14+0200, /*I*/
-16+0200, /*J*/
-28+0200, /*K*/
-24+0200, /*L*/
-34+0200, /*M*/
-27+0200, /*N*/
-27+0200, /*O*/
-22+0200, /*P*/
-27+0300, /*Q*/
-27+0200, /*R*/
-20+0200, /*S*/
-23+0200, /*T*/
-28+0200, /*U*/
-25+0200, /*V*/
-36+0200, /*W*/
-24+0200, /*X*/
-24+0200, /*Y*/
-25+0200, /*Z*/
-13,     /*[*/
-0,      /*\*/
-13,     /*]*/
-0,      /*^*/
-0,     /*_*/
-11,     /*` open*/
-19,     /*a*/
-18+0200, /*b*/
-15,     /*c*/
-18+0200, /*d*/
-16,     /*e*/
-11+0200, /*f*/
-17+0100, /*g*/
-19+0200, /*h*/
-9+0200, /*i*/
-9+0300, /*j*/
-19+0200, /*k*/
-9+0200, /*l*/
-28,     /*m*/
-19,     /*n*/
-18,     /*o*/
-17+0100, /*p*/
-18+0100, /*q*/
-13,     /*r*/
-14,     /*s*/
-10+0200, /*t*/
-19,     /*u*/
-16,     /*v*/
-24,     /*w*/
-18,     /*x*/
-16+0100, /*y*/
-14,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-27,     /*1/4*/
-27,     /*1/2*/
-27,     /*3/4*/
-36,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-21,     /*ff*/
-31,     /*ffi*/
-31,     /*ffl*/
-15,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-7,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-19,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftL.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftL.c
deleted file mode 100644 (file)
index 81b2b7c..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-char Lw[256-32] {      /*L Geneva Light*/
-12,     /*space*/
-11,     /*!*/
-0,      /*"*/
-0,      /*#*/
-21,     /*$*/
-27,     /*%*/
-25,     /*&*/
-7,      /*' close*/
-13,     /*(*/
-13,     /*)*/
-16,     /***/
-27,     /*+*/
-7,      /*,*/
-13,     /*- hyphen*/
-7,      /*.*/
-10,     /*/*/
-21+0200, /*0*/
-21+0200, /*1*/
-21+0200, /*2*/
-21+0200, /*3*/
-21+0200, /*4*/
-21+0200, /*5*/
-21+0200, /*6*/
-21+0200, /*7*/
-21+0200, /*8*/
-21+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-22,     /*?*/
-0,      /*@*/
-23+0200, /*A*/
-24+0200, /*B*/
-26+0200, /*C*/
-26+0200, /*D*/
-22+0200, /*E*/
-20+0200, /*F*/
-27+0200, /*G*/
-26+0200, /*H*/
-10+0200, /*I*/
-18+0200, /*J*/
-24+0200, /*K*/
-20+0200, /*L*/
-30+0200, /*M*/
-26+0200, /*N*/
-28+0200, /*O*/
-22+0200, /*P*/
-28+0300, /*Q*/
-24+0200, /*R*/
-22+0200, /*S*/
-20+0200, /*T*/
-25+0200, /*U*/
-23+0200, /*V*/
-35+0200, /*W*/
-23+0200, /*X*/
-22+0200, /*Y*/
-22+0200, /*Z*/
-11,     /*[*/
-0,      /*\*/
-11,     /*]*/
-0,      /*^*/
-0,     /*_*/
-7,      /*` open*/
-20,     /*a*/
-21+0200, /*b*/
-20,     /*c*/
-21+0200, /*d*/
-20,     /*e*/
-11+0200, /*f*/
-21+0100, /*g*/
-20+0200, /*h*/
-9+0200, /*i*/
-9+0300, /*j*/
-19+0200, /*k*/
-9+0200, /*l*/
-31,     /*m*/
-20,     /*n*/
-20,     /*o*/
-21+0100, /*p*/
-21+0100, /*q*/
-12,     /*r*/
-18,     /*s*/
-11+0200, /*t*/
-20,     /*u*/
-18,     /*v*/
-27,     /*w*/
-18,     /*x*/
-18+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-30,     /*1/4*/
-30,     /*1/2*/
-30,     /*3/4*/
-27,     /*minus*/
-20,     /*fi*/
-20,     /*fl*/
-22,     /*ff*/
-31,     /*ffi*/
-31,     /*ffl*/
-14,     /*degree*/
-18,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-21,     /*registered*/
-21,     /*copywrite*/
-0,
-21,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftLI.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftLI.c
deleted file mode 100644 (file)
index 70f38e5..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-char LIw[256-32] {     /*LI Geneva Light Italic*/
-12,     /*space*/
-12,     /*!*/
-0,      /*"*/
-0,      /*#*/
-21,     /*$*/
-27,     /*%*/
-26,     /*&*/
-7,      /*' close*/
-13,     /*(*/
-13,     /*)*/
-15,     /***/
-36,     /*+*/
-7,      /*,*/
-13,     /*- hyphen*/
-7,      /*.*/
-7,      /*/*/
-21+0200, /*0*/
-21+0200, /*1*/
-21+0200, /*2*/
-21+0200, /*3*/
-21+0200, /*4*/
-21+0200, /*5*/
-21+0200, /*6*/
-21+0200, /*7*/
-21+0200, /*8*/
-21+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-24,     /*?*/
-0,      /*@*/
-24+0200, /*A*/
-25+0200, /*B*/
-27+0200, /*C*/
-26+0200, /*D*/
-22+0200, /*E*/
-20+0200, /*F*/
-28+0200, /*G*/
-26+0200, /*H*/
-10+0200, /*I*/
-19+0200, /*J*/
-25+0200, /*K*/
-21+0200, /*L*/
-30+0200, /*M*/
-26+0200, /*N*/
-28+0200, /*O*/
-23+0200, /*P*/
-28+0300, /*Q*/
-24+0200, /*R*/
-23+0200, /*S*/
-21+0200, /*T*/
-25+0200, /*U*/
-22+0200, /*V*/
-32+0200, /*W*/
-22+0200, /*X*/
-22+0200, /*Y*/
-22+0200, /*Z*/
-11,     /*[*/
-0,      /*\*/
-11,     /*]*/
-0,      /*^*/
-0,     /*_*/
-7,      /*` open*/
-21,     /*a*/
-22+0200, /*b*/
-20,     /*c*/
-22+0200, /*d*/
-20,     /*e*/
-12+0200, /*f*/
-22+0100, /*g*/
-21+0200, /*h*/
-9+0200, /*i*/
-9+0300, /*j*/
-20+0200, /*k*/
-9+0200, /*l*/
-31,     /*m*/
-21,     /*n*/
-21,     /*o*/
-22+0100, /*p*/
-22+0100, /*q*/
-13,     /*r*/
-19,     /*s*/
-12+0200, /*t*/
-21,     /*u*/
-18,     /*v*/
-27,     /*w*/
-19,     /*x*/
-18+0100, /*y*/
-18,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-27,     /*1/4*/
-27,     /*1/2*/
-27,     /*3/4*/
-36,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-24,     /*ff*/
-33,     /*ffi*/
-33,     /*ffl*/
-14,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-21,     /*registered*/
-21,     /*copywrite*/
-0,
-21,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftPA.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftPA.c
deleted file mode 100644 (file)
index 2984bb3..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*Commercial II*/
-char PAw[256-32] {   /*character withs for Palatino 814-007A*/
-12,      /*space*/
-12,      /*!*/
-0,      /*"*/
-0,      /*sharp*/
-19,      /*$*/
-27,      /*%*/
-29,      /*&*/
-10,      /*' close*/
-14,      /*(*/
-14,      /*)*/
-16,      /***/
-27,      /*+*/
-9,      /*,*/
-14,      /*- hyphen*/
-9,      /*.*/
-12,      /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-12,      /*:*/
-12,      /*;*/
-0,      /*<*/
-27,      /*=*/
-0,      /*>*/
-20,      /*?*/
-0,      /*@*/
-28+0200, /*A*/
-21+0200, /*B*/
-25+0200, /*C*/
-28+0200, /*D*/
-21+0200, /*E*/
-20+0200, /*F*/
-27+0200, /*G*/
-30+0200, /*H*/
-12+0200, /*I*/
-12+0200, /*J*/
-27+0200, /*K*/
-22+0200, /*L*/
-34+0200, /*M*/
-30+0200, /*N*/
-29+0200, /*O*/
-22+0200, /*P*/
-29+0300, /*Q*/
-25+0200, /*R*/
-19+0200, /*S*/
-22+0200, /*T*/
-28+0200, /*U*/
-27+0200, /*V*/
-36+0200, /*W*/
-24+0200, /*X*/
-24+0200, /*Y*/
-24+0200, /*Z*/
-13,      /*[*/
-0,      /*\*/
-13,      /*]*/
-0,      /*^*/
-0,     /*_*/
-10,      /*` open*/
-18,      /*a*/
-20+0200, /*b*/
-16,      /*c*/
-21+0200, /*d*/
-17,      /*e*/
-12+0200, /*f*/
-19+0100, /*g*/
-22+0200, /*h*/
-11+0200, /*i*/
-11+0300, /*j*/
-20+0200, /*k*/
-11+0200, /*l*/
-32,      /*m*/
-22,      /*n*/
-20,      /*o*/
-21+0100, /*p*/
-19+0100, /*q*/
-15,      /*r*/
-15,      /*s*/
-12+0200, /*t*/
-22,      /*u*/
-20,      /*v*/
-30,      /*w*/
-19,      /*x*/
-20+0100, /*y*/
-18,      /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,      /*hyphen*/
-27,      /*bullet*/
-27,      /*square*/
-36,      /*3/4 em*/
-18,      /*rule*/
-27,      /*1/4*/
-27,      /*1/2*/
-27,      /*3/4*/
-27,      /*minus*/
-22,      /*fi*/
-22,      /*fl*/
-23,      /*ff*/
-33,      /*ffi*/
-33,      /*ffl*/
-13,      /*degree*/
-22,      /*dagger*/
-0,      /*section*/
-9,  /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0, 
-20,      /*registered*/
-20,      /*copywrite*/
-0,
-19,      /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftPB.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftPB.c
deleted file mode 100644 (file)
index 4d62ed5..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*Commercial II*/
-char W14[256-32] {   /*character withs for Palatino Bold 814-009A*/
-12,      /*space*/
-14,      /*!*/
-00,      /*"*/
-00,      /*sharp*/
-18,      /*$*/
-27,      /*%*/
-30,      /*&*/
-12,      /*' close*/
-14,      /*(*/
-14,      /*)*/
-15,      /***/
-27,      /*+*/
-12,      /*,*/
-15,      /*- hyphen*/
-10,      /*.*/
-13,      /*/*/
-18+0200, /*0*/
-18+0200, /*1*/
-18+0200, /*2*/
-18+0200, /*3*/
-18+0200, /*4*/
-18+0200, /*5*/
-18+0200, /*6*/
-18+0200, /*7*/
-18+0200, /*8*/
-18+0200, /*9*/
-14,      /*:*/
-15,      /*;*/
-00,      /*<*/
-27,      /*=*/
-00,      /*>*/
-21,      /*?*/
-00,      /*@*/
-28+0200, /*A*/
-22+0200, /*B*/
-25+0200, /*C*/
-29+0200, /*D*/
-21+0200, /*E*/
-20+0200, /*F*/
-28+0200, /*G*/
-30+0200, /*H*/
-14+0200, /*I*/
-14+0200, /*J*/
-28+0200, /*K*/
-22+0200, /*L*/
-36+0200, /*M*/
-30+0200, /*N*/
-29+0200, /*O*/
-22+0200, /*P*/
-29+0300, /*Q*/
-26+0200, /*R*/
-20+0200, /*S*/
-25+0200, /*T*/
-28+0200, /*U*/
-28+0200, /*V*/
-36+0200, /*W*/
-25+0200, /*X*/
-25+0200, /*Y*/
-23+0200, /*Z*/
-13,      /*[*/
-00,      /*\*/
-13,      /*]*/
-00,      /*^*/
-0,     /*_*/
-12,      /*` open*/
-18,      /*a*/
-20+0200, /*b*/
-16,      /*c*/
-22+0200, /*d*/
-18,      /*e*/
-14+0200, /*f*/
-20+0100, /*g*/
-22+0200, /*h*/
-12+0200, /*i*/
-12+0300, /*j*/
-22+0200, /*k*/
-12+0200, /*l*/
-32,      /*m*/
-22,      /*n*/
-20,      /*o*/
-22+0100, /*p*/
-20+0100, /*q*/
-15,      /*r*/
-16,      /*s*/
-13+0200, /*t*/
-22,      /*u*/
-21,      /*v*/
-31,      /*w*/
-19,      /*x*/
-21+0100, /*y*/
-18,      /*z*/
-00,      /*{*/
-2,      /*|*/
-00,      /*}*/
-00,      /*~*/
-6,      /*narrow space*/
-15,      /*hyphen*/
-27,      /*bullet*/
-27,      /*square*/
-36,      /*3/4 em*/
-18,      /*rule*/
-32,      /*1/4*/
-32,      /*1/2*/
-32,      /*3/4*/
-27,      /*minus*/
-23,      /*fi*/
-23,      /*fl*/
-25,      /*ff*/
-34,      /*ffi*/
-34,      /*ffl*/
-15,      /*degree*/
-21,      /*dagger*/
-00,      /*section*/
-9,  /*foot mark*/
-00,      /*'*/
-00,      /*`*/
-00,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0, 
-20,      /*registered*/
-20,      /*copywrite*/
-00,     
-18,      /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftPI.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftPI.c
deleted file mode 100644 (file)
index 6f4cfbd..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*Commercial II*/
-char PIw[256-32] {   /*character withs for Palatino Italic 814-008A*/
-12,      /*space*/
-9,      /*!*/
-00,      /*"*/
-00,      /*sharp*/
-18,      /*$*/
-28,      /*%*/
-27,      /*&*/
-9,      /*' close*/
-13,      /*(*/
-13,      /*)*/
-19,      /***/
-27,      /*+*/
-9,      /*,*/
-14,      /*- hyphen*/
-9,      /*.*/
-12,      /*/*/
-18+0200, /*0*/
-18+0200, /*1*/
-18+0200, /*2*/
-18+0200, /*3*/
-18+0200, /*4*/
-18+0200, /*5*/
-18+0200, /*6*/
-18+0200, /*7*/
-18+0200, /*8*/
-18+0200, /*9*/
-9,      /*:*/
-9,      /*;*/
-00,      /*<*/
-27,      /*=*/
-00,      /*>*/
-14,      /*?*/
-00,      /*@*/
-27+0200, /*A*/
-21+0200, /*B*/
-24+0200, /*C*/
-27+0200, /*D*/
-20+0200, /*E*/
-18+0200, /*F*/
-26+0200, /*G*/
-27+0200, /*H*/
-12+0200, /*I*/
-12+0200, /*J*/
-25+0200, /*K*/
-20+0200, /*L*/
-36+0200, /*M*/
-28+0200, /*N*/
-27+0200, /*O*/
-20+0200, /*P*/
-27+0300, /*Q*/
-25+0200, /*R*/
-17+0200, /*S*/
-22+0200, /*T*/
-28+0200, /*U*/
-27+0200, /*V*/
-35+0200, /*W*/
-26+0200, /*X*/
-25+0200, /*Y*/
-22+0200, /*Z*/
-14,      /*[*/
-00,      /*\*/
-14,      /*]*/
-00,      /*^*/
-0,     /*_*/
-9,      /*` open*/
-17,      /*a*/
-16+0200, /*b*/
-15,      /*c*/
-18+0200, /*d*/
-15,      /*e*/
-12+0200, /*f*/
-16+0100, /*g*/
-18+0200, /*h*/
-12+0200, /*i*/
-12+0300, /*j*/
-16+0200, /*k*/
-11+0200, /*l*/
-28,      /*m*/
-20,      /*n*/
-16,      /*o*/
-18+0100, /*p*/
-16+0100, /*q*/
-14,      /*r*/
-14,      /*s*/
-11+0200, /*t*/
-19,      /*u*/
-18,      /*v*/
-26,      /*w*/
-18,      /*x*/
-19+0100, /*y*/
-16,      /*z*/
-00,      /*{*/
-2,      /*|*/
-00,      /*}*/
-00,      /*~*/
-6,      /*narrow space*/
-14,      /*hyphen*/
-27,      /*bullet*/
-27,      /*square*/
-36,      /*3/4 em*/
-18,      /*rule*/
-28,      /*1/4*/
-28,      /*1/2*/
-28,      /*3/4*/
-27,      /*minus*/
-20,      /*fi*/
-20,      /*fl*/
-20,      /*ff*/
-29,      /*ffi*/
-29,      /*ffl*/
-14,      /*degree*/
-20,      /*dagger*/
-00,      /*section*/
-10,  /*foot mark*/
-00,      /*'*/
-00,      /*`*/
-00,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0,0,0,0, 
-0,0,0,0,0, 
-20,      /*registered*/
-20,      /*copywrite*/
-0,
-18,      /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftR.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftR.c
deleted file mode 100644 (file)
index 696fde3..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char Rw[256-32] {      /*Times Roman widths*/
-12,     /*space*/
-12,     /*!*/
-0,      /*"*/
-0,      /*#*/
-19,     /*$*/
-29,     /*%*/
-28,     /*&*/
-12,     /*' close*/
-16,     /*(*/
-16,     /*)*/
-16,     /***/
-36,     /*+*/
-12,     /*,*/
-13,     /*- hyphen*/
-10,     /*.*/
-17,     /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-10,     /*:*/
-12,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-20,     /*?*/
-0,      /*@*/
-29+0200, /*A*/
-23+0200, /*B*/
-26+0200, /*C*/
-30+0200, /*D*/
-24+0200, /*E*/
-23+0200, /*F*/
-30+0200, /*G*/
-29+0200, /*H*/
-13+0200, /*I*/
-16+0200, /*J*/
-28+0200, /*K*/
-24+0200, /*L*/
-35+0200, /*M*/
-29+0200, /*N*/
-27+0200, /*O*/
-22+0200, /*P*/
-27+0300, /*Q*/
-27+0200, /*R*/
-20+0200, /*S*/
-24+0200, /*T*/
-29+0200, /*U*/
-27+0200, /*V*/
-36+0200, /*W*/
-28+0200, /*X*/
-27+0200, /*Y*/
-23+0200, /*Z*/
-14,     /*[*/
-0,      /*\*/
-14,     /*]*/
-0,      /*^*/
-0,     /*_*/
-12,     /*` open*/
-17,     /*a*/
-20+0200, /*b*/
-16,     /*c*/
-20+0200, /*d*/
-18,     /*e*/
-13+0200, /*f*/
-18+0100, /*g*/
-21+0200, /*h*/
-10+0200, /*i*/
-9+0300, /*j*/
-20+0200, /*k*/
-10+0200, /*l*/
-32,     /*m*/
-21,     /*n*/
-20,     /*o*/
-19+0100, /*p*/
-19+0100, /*q*/
-14,     /*r*/
-15,     /*s*/
-12+0200, /*t*/
-21,     /*u*/
-20,     /*v*/
-26,     /*w*/
-20,     /*x*/
-18+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-29,     /*1/4*/
-29,     /*1/2*/
-29,     /*3/4*/
-36,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-24,     /*ff*/
-32,     /*ffi*/
-32,     /*ffl*/
-15,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-19,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftS.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftS.c
deleted file mode 100644 (file)
index c17d268..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
-Modified for Commercial II
-and with +, -, and = for equations
-*/
-char Sw[256-32] {      /*Special font widths*/
-0,0,           /*.=Sw+042-40*/
-13,     /*"*/
-29,     /*#*/
-0,0,0,0,               /*.=Sw+074-40*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,
-36,     /*<*/
-0,             /*.=Sw+076-40*/
-36,     /*>*/
-0,             /*.=Sw+100-40*/
-36,     /*@*/
-0,0,0,0,0,0,0, /*.=Sw+134-40*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,
-15,     /*\\*/
-0,             /*.=Sw+136-40*/
-15,     /*^*/
-18,     /*_ underrule*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,
-14,     /*{*/
-0,             /*.=Sw+175-40*/
-14,     /*}*/
-15,     /*~*/
-0,             /*.=Sw+220-40*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-17,     /*section*/
-0,             /*.=Sw+222-40*/
-10,     /*acute accent*/
-10,     /*grave accent*/
-18,     /*underrule*/
-15,     /*slash (longer)*/
-0,      /**/
-0,      /**/
-24,     /*alpha*/
-23+0300, /*beta*/
-23+0100, /*gamma*/
-19+0200, /*delta*/
-18,     /*epsilon*/
-18+0300, /*zeta*/
-23+0100, /*eta*/
-19+0200, /*theta*/
-13,     /*iota*/
-21,     /*kappa*/
-22+0200, /*lambda*/
-25+0100, /*mu*/
-20,     /*nu*/
-20+0300, /*xi*/
-20,     /*omicron*/
-27,     /*pi*/
-21+0100, /*rho*/
-27,     /*sigma*/
-20,     /*tau*/
-21,     /*upsilon*/
-25+0300, /*phi*/
-22+0100, /*chi*/
-24+0300, /*psi*/
-25,     /*omega*/
-24+0200, /*Gamma*/
-26+0200, /*Delta*/
-28+0200, /*Theta*/
-28+0200, /*Lambda*/
-27+0200, /*Xi*/
-29+0200, /*Pi*/
-25+0200, /*Sigma*/
-0,      /**/
-28+0200, /*Upsilon*/
-29+0200, /*Phi*/
-32+0200, /*Psi*/
-36+0200, /*Omega*/
-30,     /*square root*/
-18+0100, /*terminal sigma*/
-18,     /*root en*/
-36,     /*>=*/
-36,     /*<=*/
-36,     /*identically equal*/
-27,     /*minus*/
-36,     /*approx =*/
-36,     /*approximates*/
-36,     /*not equal*/
-36,     /*right arrow*/
-36,     /*left arrow*/
-18,     /*up arrow*/
-18,     /*down arrow*/
-27,     /*equal*/
-27,     /*multiply*/
-27,     /*divide*/
-36,     /*plus-minus*/
-36,     /*cup (union)*/
-36,     /*cap (intersection)*/
-36,     /*subset of*/
-36,     /*superset of*/
-36,     /*improper subset*/
-36,     /*improper superset*/
-34,     /*infinity*/
-21,     /*partial derivative*/
-36+0200, /*gradient*/
-22,     /*not*/
-24,     /*integral sign*/
-27,     /*proportional to*/
-28,     /*empty set*/
-27,     /*member of*/
-27,     /*plus*/
-0,
-0,
-0,      /*box vert rule (was 2.)*/
-0,
-17,     /*dbl dagger*/
-42,     /*right hand*/
-42,     /*left hand*/
-16,     /*math * */
-41,     /*bell system sign*/
-9,      /*or*/
-27,     /*circle*/
-9,      /*left top (of big curly)*/
-9,      /*left bottom*/
-9,      /*right top*/
-9,      /*right bot*/
-9,      /*left center of big curly bracket*/
-9,      /*right center of big curly bracket*/
-9,      /*bold vertical*/
-9,      /*left floor (left bot of big sq bract)*/
-9,      /*right floor (rb of ")*/
-9,      /*left ceiling (lt of ")*/
-9 }; /*right ceiling (rt of ")*/
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftSB.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftSB.c
deleted file mode 100644 (file)
index 826a54f..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-char SBw[256-32] {     /*SB Stymie Bold*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-25,     /*$*/
-32,     /*%*/
-29,     /*&*/
-9,      /*' close*/
-15,     /*(*/
-15,     /*)*/
-13,     /***/
-27,     /*+*/
-9,      /*,*/
-13,     /*- hyphen*/
-9,      /*.*/
-17,     /*/*/
-25+0200, /*0*/
-25+0200, /*1*/
-25+0200, /*2*/
-25+0200, /*3*/
-25+0200, /*4*/
-25+0200, /*5*/
-25+0200, /*6*/
-25+0200, /*7*/
-25+0200, /*8*/
-25+0200, /*9*/
-13,     /*:*/
-13,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-25,     /*?*/
-0,      /*@*/
-30+0200, /*A*/
-26+0200, /*B*/
-27+0200, /*C*/
-28+0200, /*D*/
-25+0200, /*E*/
-24+0200, /*F*/
-28+0200, /*G*/
-30+0200, /*H*/
-14+0200, /*I*/
-17+0200, /*J*/
-29+0200, /*K*/
-23+0200, /*L*/
-35+0200, /*M*/
-30+0200, /*N*/
-29+0200, /*O*/
-24+0200, /*P*/
-29+0300, /*Q*/
-27+0200, /*R*/
-24+0200, /*S*/
-26+0200, /*T*/
-30+0200, /*U*/
-29+0200, /*V*/
-40+0200, /*W*/
-30+0200, /*X*/
-29+0200, /*Y*/
-25+0200, /*Z*/
-13,     /*[*/
-0,      /*\*/
-13,     /*]*/
-0,      /*^*/
-0,     /*_*/
-9,      /*` open*/
-18,     /*a*/
-21+0200, /*b*/
-18,     /*c*/
-21+0200, /*d*/
-19,     /*e*/
-13+0200, /*f*/
-21+0100, /*g*/
-22+0200, /*h*/
-11+0200, /*i*/
-10+0300, /*j*/
-21+0200, /*k*/
-11+0200, /*l*/
-30,     /*m*/
-22,     /*n*/
-19,     /*o*/
-21+0100, /*p*/
-21+0100, /*q*/
-14,     /*r*/
-16,     /*s*/
-12+0200, /*t*/
-22,     /*u*/
-22,     /*v*/
-29,     /*w*/
-22,     /*x*/
-22+0100, /*y*/
-19,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-32,     /*1/4*/
-32,     /*1/2*/
-32,     /*3/4*/
-27,     /*minus*/
-24,     /*fi*/
-24,     /*fl*/
-26,     /*ff*/
-37,     /*ffi*/
-37,     /*ffl*/
-14,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-10,     /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copywrite*/
-0,
-25,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftSI.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftSI.c
deleted file mode 100644 (file)
index 5d4d03a..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-char SIw[256-32] {     /*SI Stymie Medium Italic*/
-12,     /*space*/
-11,     /*!*/
-0,      /*"*/
-0,      /*#*/
-18,     /*$*/
-30,     /*%*/
-26,     /*&*/
-8,      /*' close*/
-12,     /*(*/
-12,     /*)*/
-17,     /***/
-27,     /*+*/
-8,      /*,*/
-11,     /*- hyphen*/
-7,      /*.*/
-7,      /*/*/
-18+0200, /*0*/
-18+0200, /*1*/
-18+0200, /*2*/
-18+0200, /*3*/
-18+0200, /*4*/
-18+0200, /*5*/
-18+0200, /*6*/
-18+0200, /*7*/
-18+0200, /*8*/
-18+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-22,     /*?*/
-0,      /*@*/
-25+0200, /*A*/
-23+0200, /*B*/
-24+0200, /*C*/
-25+0200, /*D*/
-24+0200, /*E*/
-23+0200, /*F*/
-26+0200, /*G*/
-27+0200, /*H*/
-11+0200, /*I*/
-11+0200, /*J*/
-25+0200, /*K*/
-21+0200, /*L*/
-30+0200, /*M*/
-27+0200, /*N*/
-26+0200, /*O*/
-21+0200, /*P*/
-26+0300, /*Q*/
-24+0200, /*R*/
-21+0200, /*S*/
-22+0200, /*T*/
-25+0200, /*U*/
-25+0200, /*V*/
-33+0200, /*W*/
-25+0200, /*X*/
-25+0200, /*Y*/
-24+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,     /*_*/
-8,      /*` open*/
-16,     /*a*/
-19+0200, /*b*/
-17,     /*c*/
-18+0200, /*d*/
-18,     /*e*/
-11+0200, /*f*/
-19+0100, /*g*/
-19+0200, /*h*/
-10+0200, /*i*/
-10+0300, /*j*/
-18+0200, /*k*/
-10+0200, /*l*/
-28,     /*m*/
-19,     /*n*/
-18,     /*o*/
-19+0100, /*p*/
-19+0100, /*q*/
-12,     /*r*/
-14,     /*s*/
-10+0200, /*t*/
-19,     /*u*/
-18,     /*v*/
-27,     /*w*/
-18,     /*x*/
-18+0100, /*y*/
-16,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-11,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-29,     /*1/4*/
-29,     /*1/2*/
-29,     /*3/4*/
-27,     /*minus*/
-19,     /*fi*/
-19,     /*fl*/
-20,     /*ff*/
-28,     /*ffi*/
-28,     /*ffl*/
-17,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-19,     /*registered*/
-19,     /*copywrite*/
-0,
-18,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftSM.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftSM.c
deleted file mode 100644 (file)
index 054076f..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-char SMw[256-32] {     /*SM Stymie Medium*/
-12,     /*space*/
-11,     /*!*/
-0,      /*"*/
-0,      /*#*/
-24,     /*$*/
-22,     /*%*/
-26,     /*&*/
-9,      /*' close*/
-13,     /*(*/
-13,     /*)*/
-13,     /***/
-27,     /*+*/
-9,      /*,*/
-11,     /*- hyphen*/
-9,      /*.*/
-15,     /*/*/
-24+0200, /*0*/
-24+0200, /*1*/
-24+0200, /*2*/
-24+0200, /*3*/
-24+0200, /*4*/
-24+0200, /*5*/
-24+0200, /*6*/
-24+0200, /*7*/
-24+0200, /*8*/
-24+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-22,     /*?*/
-0,      /*@*/
-27+0200, /*A*/
-22+0200, /*B*/
-25+0200, /*C*/
-25+0200, /*D*/
-20+0200, /*E*/
-20+0200, /*F*/
-27+0200, /*G*/
-27+0200, /*H*/
-12+0200, /*I*/
-14+0200, /*J*/
-25+0200, /*K*/
-20+0200, /*L*/
-30+0200, /*M*/
-26+0200, /*N*/
-27+0200, /*O*/
-20+0200, /*P*/
-27+0300, /*Q*/
-23+0200, /*R*/
-18+0200, /*S*/
-21+0200, /*T*/
-26+0200, /*U*/
-25+0200, /*V*/
-32+0200, /*W*/
-26+0200, /*X*/
-25+0200, /*Y*/
-21+0200, /*Z*/
-14,     /*[*/
-0,      /*\*/
-14,     /*]*/
-0,      /*^*/
-0,     /*_*/
-9,      /*` open*/
-18,     /*a*/
-21+0200, /*b*/
-18,     /*c*/
-21+0200, /*d*/
-19,     /*e*/
-11+0200, /*f*/
-21+0100, /*g*/
-21+0200, /*h*/
-10+0200, /*i*/
-10+0300, /*j*/
-20+0200, /*k*/
-10+0200, /*l*/
-30,     /*m*/
-21,     /*n*/
-19,     /*o*/
-21+0100, /*p*/
-21+0100, /*q*/
-14,     /*r*/
-15,     /*s*/
-11+0200, /*t*/
-21,     /*u*/
-20,     /*v*/
-27,     /*w*/
-21,     /*x*/
-20+0100, /*y*/
-18,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-11,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-31,     /*1/4*/
-31,     /*1/2*/
-31,     /*3/4*/
-27,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-22,     /*ff*/
-32,     /*ffi*/
-32,     /*ffl*/
-15,     /*degree*/
-19,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-22,     /*registered*/
-22,     /*copywrite*/
-0,
-24,     /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftUD.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftUD.c
deleted file mode 100644 (file)
index a9866b9..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*modified for Commercial II*/
-char UDw[256-32] {     /*Utica Demibold widths (Utica == Futura)*/
-12,     /*space*/
-11,     /*!*/
-0,      /*"*/
-16,     /*0*/
-21,     /*$*/
-28,     /*%*/
-25,     /*&*/
-10,     /*' close*/
-14,     /*(*/
-14,     /*)*/
-13,     /***/
-27,     /*+*/
-9,      /*,*/
-14,     /*- hyphen*/
-9,      /*.*/
-15,     /*/*/
-21+0200, /*0*/
-21+0200, /*1*/
-21+0200, /*2*/
-21+0200, /*3*/
-21+0200, /*4*/
-21+0200, /*5*/
-21+0200, /*6*/
-21+0200, /*7*/
-21+0200, /*8*/
-21+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-27,     /*=*/
-0,      /*>*/
-20,     /*?*/
-0,      /*@*/
-24+0200, /*A*/
-19+0200, /*B*/
-22+0200, /*C*/
-21+0200, /*D*/
-19+0200, /*E*/
-16+0200, /*F*/
-26+0200, /*G*/
-24+0200, /*H*/
-12+0200, /*I*/
-17+0200, /*J*/
-21+0200, /*K*/
-14+0200, /*L*/
-29+0200, /*M*/
-26+0200, /*N*/
-26+0200, /*O*/
-19+0200, /*P*/
-27+0300, /*Q*/
-19+0200, /*R*/
-18+0200, /*S*/
-16+0200, /*T*/
-24+0200, /*U*/
-22+0200, /*V*/
-33+0200, /*W*/
-22+0200, /*X*/
-20+0200, /*Y*/
-22+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,     /*_*/
-10,     /*` open*/
-20,     /*a*/
-20+0200, /*b*/
-14,     /*c*/
-20+0200, /*d*/
-18,     /*e*/
-11+0200, /*f*/
-20+0100, /*g*/
-19+0200, /*h*/
-9+0200, /*i*/
-9+0300, /*j*/
-18+0200, /*k*/
-9+0200, /*l*/
-29,     /*m*/
-19,     /*n*/
-18,     /*o*/
-20+0100, /*p*/
-20+0100, /*q*/
-12,     /*r*/
-15,     /*s*/
-10+0200, /*t*/
-19,     /*u*/
-18,     /*v*/
-28,     /*w*/
-18,     /*x*/
-18+0100, /*y*/
-16,     /*z*/
-0,      /*{*/
-5,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-28,     /*1/4*/
-28,     /*1/2*/
-28,     /*3/4*/
-27,     /*minus*/
-18,     /*fi*/
-18,     /*fl*/
-19,     /*ff*/
-27,     /*ffi*/
-27,     /*ffl*/
-14,     /*degree*/
-29,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-16,     /*registered*/
-16,     /*copywrite*/
-0,
-21,     /*cent*/
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/ftXM.c b/.ref-Research-V7/usr/src/cmd/troff/font/ftXM.c
deleted file mode 100644 (file)
index 33afad3..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-char SMw[256-32] {     /*SM Stymie Medium*/
-12+2,   /*space*/
-11+2,   /*!*/
-0,      /*"*/
-0,      /*#*/
-24+2,   /*$*/
-22+2,   /*%*/
-26+2,   /*&*/
-9+2,    /*' close*/
-13+2,   /*(*/
-13+2,   /*)*/
-13+2,   /***/
-27+2,   /*+*/
-9+2,    /*,*/
-11+2,   /*- hyphen*/
-9+2,    /*.*/
-15+2,   /*/*/
-24+0200+2, /*0*/
-24+0200+2, /*1*/
-24+0200+2, /*2*/
-24+0200+2, /*3*/
-24+0200+2, /*4*/
-24+0200+2, /*5*/
-24+0200+2, /*6*/
-24+0200+2, /*7*/
-24+0200+2, /*8*/
-24+0200+2, /*9*/
-11+2,   /*:*/
-11+2,   /*;*/
-0,      /*<*/
-27+2,   /*=*/
-0,      /*>*/
-22+2,   /*?*/
-0,      /*@*/
-27+0200+2, /*A*/
-22+0200+2, /*B*/
-25+0200+2, /*C*/
-25+0200+2, /*D*/
-20+0200+2, /*E*/
-20+0200+2, /*F*/
-27+0200+2, /*G*/
-27+0200+2, /*H*/
-12+0200+2, /*I*/
-14+0200+2, /*J*/
-25+0200+2, /*K*/
-20+0200+2, /*L*/
-30+0200+2, /*M*/
-26+0200+2, /*N*/
-27+0200+2, /*O*/
-20+0200+2, /*P*/
-27+0300+2, /*Q*/
-23+0200+2, /*R*/
-18+0200+2, /*S*/
-21+0200+2, /*T*/
-26+0200+2, /*U*/
-25+0200+2, /*V*/
-32+0200+2, /*W*/
-26+0200+2, /*X*/
-25+0200+2, /*Y*/
-21+0200+2, /*Z*/
-14+2,   /*[*/
-0,      /*\*/
-14+2,   /*]*/
-0,      /*^*/
-0,     /*_*/
-9+2,    /*` open*/
-18+2,   /*a*/
-21+0200+2, /*b*/
-18+2,   /*c*/
-21+0200+2, /*d*/
-19+2,   /*e*/
-11+0200+2, /*f*/
-21+0100+2, /*g*/
-21+0200+2, /*h*/
-10+0200+2, /*i*/
-10+0300+2, /*j*/
-20+0200+2, /*k*/
-10+0200+2, /*l*/
-30+2,   /*m*/
-21+2,   /*n*/
-19+2,   /*o*/
-21+0100+2, /*p*/
-21+0100+2, /*q*/
-14+2,   /*r*/
-15+2,   /*s*/
-11+0200+2, /*t*/
-21+2,   /*u*/
-20+2,   /*v*/
-27+2,   /*w*/
-21+2,   /*x*/
-20+0100+2, /*y*/
-18+2,   /*z*/
-0,      /*{*/
-2+2,    /*|*/
-0,      /*}*/
-0,      /*~*/
-6+2,    /*narrow space*/
-11+2,   /*hyphen*/
-27+2,   /*bullet*/
-27+2,   /*square*/
-36+2,   /*3/4 em*/
-18+2,   /*rule*/
-31+2,   /*1/4*/
-31+2,   /*1/2*/
-31+2,   /*3/4*/
-27+2,   /*minus*/
-21+2,   /*fi*/
-21+2,   /*fl*/
-22+2,   /*ff*/
-32+2,   /*ffi*/
-32+2,   /*ffl*/
-15+2,   /*degree*/
-19+2,   /*dagger*/
-0,      /*section*/
-9+2,    /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3+2,   /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-22+2,   /*registered*/
-22+2,   /*copywrite*/
-0,
-24+2,   /*cent*/
-0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/linkrc b/.ref-Research-V7/usr/src/cmd/troff/font/linkrc
deleted file mode 100755 (executable)
index 633e64f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-cd /usr/lib/font
-rm ftH ftHI ftHM ftFD ftCI
-ln ftG ftH
-ln ftGI ftHI
-ln ftGM ftHM
-ln ftUD ftFD
-ln ftCK ftCI
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/makefile b/.ref-Research-V7/usr/src/cmd/troff/font/makefile
deleted file mode 100644 (file)
index 2799d3a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-cp:    all
-       for i in *.o; do cp $$i /usr/lib/font/`basename $$i .o`; done
-       rm *.o
-
-cmp:   all
-       for i in *.o; do cmp $$i /usr/lib/font/`basename $$i .o`; done
-       rm *.o
-
-.c.o:
-       cc -c $<; strip $@
-
-all:   ftB.o ftBC.o ftC.o ftCE.o ftCI.o ftCK.o ftCS.o ftCW.o ftG.o ftGI.o ftGM.o ftGR.o
-all:   ftI.o ftL.o ftLI.o ftPA.o ftPB.o ftPI.o ftR.o ftS.o ftSB.o ftSI.o ftSM.o ftUD.o ftXM.o
-
-mkfont:mkfont.c mkfont1.c -o mkfont
-       cc -n -s mkfont.c
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/mkfont.c b/.ref-Research-V7/usr/src/cmd/troff/font/mkfont.c
deleted file mode 100644 (file)
index 7a76066..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#include "mkfont1.c"
-
-/*
-  this program takes 102 width values
-  (one per line) in the order provided bu Graphic
-  Systems and prepares a C-compileable width table.
-*/
-char ibuf[512];
-int id;
-int width[102];
-int ascii[102];
-int zero;
-int emw, hyw;
-int xxx;
-
-main(argc,argv)
-int argc;
-char **argv;
-{
-       register i, j;
-       register char *p;
-
-       while((--argc > 0) && ((++argv)[0][0]=='-')){
-               switch(argv[0][1]){
-                       default:
-                               continue;
-               }
-       }
-       if(argc){
-               if((id=open(argv[0],0)) < 0){
-                       printf("Cannot open: %s.\n",argv[0]);
-                       exit(1);
-               }
-       }
-       j = read(id,ibuf,512);
-       p = ibuf;
-       for(i=0; i<102; i++){
-               width[i] = atoi(p);
-               while(*p++ != '\n');
-       }
-       for(i=0; i<102; i++){
-               if(font[i].name < 0177){
-                       ascii[i] = font[i].name;
-               }else{
-                       for(j=0; chtab[j] != 0; j =+ 2){
-                               if(font[i].name == chtab[j])break;
-                       }
-                       ascii[i] = chtab[j+1] & 0377;
-                       if(chtab[j] == 'hy')hyw = width[i];
-                       if(chtab[j] == 'em')emw = width[i];
-               }
-       }
-       printf("char XXw[256-32] {\t/*XX*/\n");
-       for(i=040; i<256; i++){
-               if(i == 0377){
-                       printf("0};\n");
-                       break;
-               }
-               if(i == 0177){
-                       printf("6,\t %s\n",nametab[i-040]);
-                       continue;
-               }
-               if(i == 0226){
-                       printf("3,\t %s\n",nametab[i-040]);
-                       continue;
-               }
-               if(i == ' '){
-                       printf("12,\t %s\n",nametab[i-040]);
-                       continue;
-               }
-               if(i == '-'){
-                       printf("%d,\t %s\n",hyw,nametab[i-040]);
-                       continue;
-               }
-               for(j=0; j<102; j++){
-                       if(ascii[j] == i)break;
-               }
-               if(j == 102){
-                       printf("0,");
-                       zero++;
-                       if(nametab[i-040]){
-                               printf("\t %s\n",nametab[i-040]);
-                               zero = 0;
-                       }else if(i < 0177){
-                               printf("\t /*%c*/\n",i);
-                               zero = 0;
-                       }
-                       if(zero && !((i+1)%8)){
-                               printf("\n");
-                               zero = 0;
-                       }
-               }else{
-                       if(zero){
-                               zero = 0;
-                               printf("\n");
-                       }
-                       printf("%d",width[j]);
-                       if(font[j].ctval)printf("+0%d00, ",font[j].ctval);
-                       else printf(",\t ");
-                       printf("%s\n",nametab[i-040]);
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/font/mkfont1.c b/.ref-Research-V7/usr/src/cmd/troff/font/mkfont1.c
deleted file mode 100644 (file)
index 3e56607..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-
-struct {
-       int name;
-       int ctval;
-       } font[102] {
-'h',2,
-'t',2,
-'n',0,
-'m',0,
-'l',2,
-'i',2,
-'z',0,
-'s',0,
-'d',2,
-'b',2,
-'x',0,
-'f',2,
-'j',3,
-'u',0,
-'k',2,
-'p',1,
-'em',0,
-';',0,
-'a',0,
-'ru',0,
-'c',0,
-'`',0,
-'e',0,
-'\'',0,
-'o',0,
-'14',0,
-'r',0,
-'12',0,
-'v',0,
-'hy',0,
-'w',0,
-'q',1,
-'/',0,
-'.',0,
-'g',1,
-'34',0,
-',',0,
-'&',0,
-'y',1,
-'%',0,
-'Q',3,
-'T',2,
-'O',2,
-'H',2,
-'N',2,
-'M',2,
-'L',2,
-'R',2,
-'G',2,
-'I',2,
-'P',2,
-'C',2,
-'V',2,
-'E',2,
-'Z',2,
-'D',2,
-'B',2,
-'S',2,
-'Y',2,
-'F',2,
-'X',2,
-'A',2,
-'W',2,
-'J',2,
-'U',2,
-'K',2,
-'0',2,
-'1',2,
-'2',2,
-'3',2,
-'4',2,
-'5',2,
-'6',2,
-'7',2,
-'8',2,
-'9',2,
-'*',0,
-'--',0,
-'fi',0,
-'fl',0,
-'ff',0,
-'ct',0,
-'Fl',0,
-'Fi',0,
-'(',0,
-')',0,
-'[',0,
-']',0,
-'de',0,
-'dg',0,
-'=',0,
-'rg',0,
-':',0,
-'+',0,
-'!',0,
-'bu',0,
-'?',0,
-'fm',0,
-'|',0,
-'co',0,
-'sq',0,
-'$',0};
-char *nametab[256-32] {
-"/*space*/",
-"/*!*/",
-"/*\"*/",
-"/*#*/",
-"/*$*/",
-"/*%*/",
-"/*&*/",
-"/*' close*/",
-"/*(*/",
-"/*)*/",
-"/***/",
-"/*+*/",
-"/*,*/",
-"/*- hyphen*/",
-"/*.*/",
-"/*/*/",
-"/*0*/",
-"/*1*/",
-"/*2*/",
-"/*3*/",
-"/*4*/",
-"/*5*/",
-"/*6*/",
-"/*7*/",
-"/*8*/",
-"/*9*/",
-"/*:*/",
-"/*;*/",
-"/*<*/",
-"/*=*/",
-"/*>*/",
-"/*?*/",
-"/*@*/",
-"/*A*/",
-"/*B*/",
-"/*C*/",
-"/*D*/",
-"/*E*/",
-"/*F*/",
-"/*G*/",
-"/*H*/",
-"/*I*/",
-"/*J*/",
-"/*K*/",
-"/*L*/",
-"/*M*/",
-"/*N*/",
-"/*O*/",
-"/*P*/",
-"/*Q*/",
-"/*R*/",
-"/*S*/",
-"/*T*/",
-"/*U*/",
-"/*V*/",
-"/*W*/",
-"/*X*/",
-"/*Y*/",
-"/*Z*/",
-"/*[*/",
-"/*\\*/",
-"/*]*/",
-"/*^*/",
-"/*_*/",
-"/*` open*/",
-"/*a*/",
-"/*b*/",
-"/*c*/",
-"/*d*/",
-"/*e*/",
-"/*f*/",
-"/*g*/",
-"/*h*/",
-"/*i*/",
-"/*j*/",
-"/*k*/",
-"/*l*/",
-"/*m*/",
-"/*n*/",
-"/*o*/",
-"/*p*/",
-"/*q*/",
-"/*r*/",
-"/*s*/",
-"/*t*/",
-"/*u*/",
-"/*v*/",
-"/*w*/",
-"/*x*/",
-"/*y*/",
-"/*z*/",
-"/*{*/",
-"/*|*/",
-"/*}*/",
-"/*~*/",
-"/*narrow space*/",
-"/*hyphen*/",
-"/*bullet*/",
-"/*square*/",
-"/*3/4 em*/",
-"/*rule*/",
-"/*1/4*/",
-"/*1/2*/",
-"/*3/4*/",
-"/*minus*/",
-"/*fi*/",
-"/*fl*/",
-"/*ff*/",
-"/*ffi*/",
-"/*ffl*/",
-"/*degree*/",
-"/*dagger*/",
-"/*section*/",
-"/*foot mark*/",
-"/*'*/",
-"/*`*/",
-"/*_*/",
-0,
-"/*half nar sp*/",
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-"/*registered*/",
-"/*copywrite*/",
-0,
-"/*cent*/",
-};
-int chtab [] {
-'--', 0210,    /*font minus*/
-'hy', 0200,    /*hyphen*/
-'bu', 0201,    /*bullet*/
-'sq', 0202,    /*square*/
-'em', 0203,    /*3/4em*/
-'ru', 0204,    /*rule*/
-'14', 0205,    /*1/4*/
-'12', 0206,    /*1/2*/
-'34', 0207,    /*3/4*/
-'mi', 0302,    /*equation minus*/
-'fi', 0211,    /*fi*/
-'fl', 0212,    /*fl*/
-'ff', 0213,    /*ff*/
-'Fi', 0214,    /*ffi*/
-'Fl', 0215,    /*ffl*/
-'de', 0216,    /*degree*/
-'dg', 0217,    /*dagger*/
-'sc', 0220,    /*section*/
-'fm', 0221,    /*foot mark*/
-'aa', 0222,    /*acute accent*/
-'ga', 0223,    /*grave accent*/
-'ul', 0224,    /*underrule*/
-'sl', 0225,    /*slash (longer)*/
-'*a', 0230,    /*alpha*/
-'*b', 0231,    /*beta*/
-'*g', 0232,    /*gamma*/
-'*d', 0233,    /*delta*/
-'*e', 0234,    /*epsilon*/
-'*z', 0235,    /*zeta*/
-'*y', 0236,    /*eta*/
-'*h', 0237,    /*theta*/
-'*i', 0240,    /*iota*/
-'*k', 0241,    /*kappa*/
-'*l', 0242,    /*lambda*/
-'*m', 0243,    /*mu*/
-'*n', 0244,    /*nu*/
-'*c', 0245,    /*xi*/
-'*o', 0246,    /*omicron*/
-'*p', 0247,    /*pi*/
-'*r', 0250,    /*rho*/
-'*s', 0251,    /*sigma*/
-'*t', 0252,    /*tau*/
-'*u', 0253,    /*upsilon*/
-'*f', 0254,    /*phi*/
-'*x', 0255,    /*chi*/
-'*q', 0256,    /*psi*/
-'*w', 0257,    /*omega*/
-'*A', 0101,    /*Alpha*/
-'*B', 0102,    /*Beta*/
-'*G', 0260,    /*Gamma*/
-'*D', 0261,    /*Delta*/
-'*E', 0105,    /*Epsilon*/
-'*Z', 0132,    /*Zeta*/
-'*Y', 0110,    /*Eta*/
-'*H', 0262,    /*Theta*/
-'*I', 0111,    /*Iota*/
-'*K', 0113,    /*Kappa*/
-'*L', 0263,    /*Lambda*/
-'*M', 0115,    /*Mu*/
-'*N', 0116,    /*Nu*/
-'*C', 0264,    /*Xi*/
-'*O', 0117,    /*Omicron*/
-'*P', 0265,    /*Pi*/
-'*R', 0120,    /*Rho*/
-'*S', 0266,    /*Sigma*/
-'*T', 0124,    /*Tau*/
-'*U', 0270,    /*Upsilon*/
-'*F', 0271,    /*Phi*/
-'*X', 0130,    /*Chi*/
-'*Q', 0272,    /*Psi*/
-'*W', 0273,    /*Omega*/
-'sr', 0274,    /*square root*/
-'ts', 0275,    /*terminal sigma*/
-'rn', 0276,    /*root en*/
-'>=', 0277,    /*>=*/
-'<=', 0300,    /*<=*/
-'==', 0301,    /*identically equal*/
-'~=', 0303,    /*approx =*/
-'ap', 0304,    /*approximates*/
-'!=', 0305,    /*not equal*/
-'->', 0306,    /*right arrow*/
-'<-', 0307,    /*left arrow*/
-'ua', 0310,    /*up arrow*/
-'da', 0311,    /*down arrow*/
-'eq', 0312,    /*equation equal*/
-'mu', 0313,    /*multiply*/
-'di', 0314,    /*divide*/
-'+-', 0315,    /*plus-minus*/
-'cu', 0316,    /*cup (union)*/
-'ca', 0317,    /*cap (intersection)*/
-'sb', 0320,    /*subset of*/
-'sp', 0321,    /*superset of*/
-'ib', 0322,    /*improper subset*/
-'ip', 0323,    /*  " superset*/
-'if', 0324,    /*infinity*/
-'pd', 0325,    /*partial derivative*/
-'gr', 0326,    /*gradient*/
-'no', 0327,    /*not*/
-'is', 0330,    /*integral sign*/
-'pt', 0331,    /*proportional to*/
-'es', 0332,    /*empty set*/
-'mo', 0333,    /*member of*/
-'pl', 0334,    /*equation plus*/
-'rg', 0335,    /*registered*/
-'co', 0336,    /*copyright*/
-'br', 0337,    /*box vert rule*/
-'ct', 0340,    /*cent sign*/
-'dd', 0341,    /*dbl dagger*/
-'rh', 0342,    /*right hand*/
-'lh', 0343,    /*left hand*/
-'**', 0344,    /*math * */
-'bs', 0345,    /*bell system sign*/
-'or', 0346,    /*or*/
-'ci', 0347,    /*circle*/
-'lt', 0350,    /*left top (of big curly)*/
-'lb', 0351,    /*left bottom*/
-'rt', 0352,    /*right top*/
-'rb', 0353,    /*right bot*/
-'lk', 0354,    /*left center of big curly bracket*/
-'rk', 0355,    /*right center of big curly bracket*/
-'bv', 0356,    /*bold vertical*/
-'lf', 0357,    /*left floor (left bot of big sq bract)*/
-'rf', 0360,    /*right floor (rb of ")*/
-'lc', 0361,    /*left ceiling (lt of ")*/
-'rc', 0362,    /*right ceiling (rt of ")*/
-0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/hytab.c b/.ref-Research-V7/usr/src/cmd/troff/hytab.c
deleted file mode 100644 (file)
index a8be7ef..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Hyphenation digram tables
- */
-
-char   bxh[1][13] = {
-       0060,0000,0040,0000,0040,0000,0000,0040,0000,0000,0040,0000,0040
-};
-
-char   hxx[26][13] = {
-       0006,0042,0041,0123,0021,0024,0063,0042,0002,0043,0021,0001,0022,
-       0140,0000,0200,0003,0260,0006,0000,0160,0007,0000,0140,0000,0320,
-       0220,0000,0160,0005,0240,0010,0000,0100,0006,0000,0200,0000,0320,
-       0240,0000,0120,0003,0140,0000,0000,0240,0010,0000,0220,0000,0160,
-       0042,0023,0041,0040,0040,0022,0043,0041,0030,0064,0021,0000,0041,
-       0100,0000,0140,0000,0220,0006,0000,0140,0003,0000,0200,0000,0000,
-       0200,0000,0120,0002,0220,0010,0000,0160,0006,0000,0140,0000,0320,
-       0020,0000,0020,0000,0020,0000,0000,0020,0000,0000,0020,0000,0000,
-       0043,0163,0065,0044,0022,0043,0104,0042,0061,0146,0061,0000,0007,
-       0100,0000,0140,0000,0040,0000,0000,0100,0000,0000,0120,0000,0000,
-       0140,0000,0040,0011,0060,0004,0001,0120,0003,0000,0140,0000,0040,
-       0200,0000,0100,0000,0140,0000,0000,0140,0000,0000,0140,0000,0240,
-       0200,0000,0140,0000,0160,0000,0000,0220,0000,0000,0140,0000,0240,
-       0200,0000,0140,0000,0160,0000,0000,0220,0000,0000,0060,0000,0240,
-       0021,0043,0041,0121,0040,0023,0042,0003,0142,0042,0061,0001,0022,
-       0120,0000,0140,0010,0140,0010,0000,0140,0002,0000,0120,0000,0120,
-       0000,0000,0000,0000,0360,0000,0000,0000,0000,0000,0160,0000,0000,
-       0100,0000,0040,0005,0120,0000,0000,0100,0000,0000,0060,0000,0140,
-       0140,0040,0100,0001,0240,0041,0000,0242,0000,0002,0140,0000,0100,
-       0240,0000,0120,0002,0200,0000,0000,0320,0007,0000,0240,0000,0340,
-       0101,0021,0041,0020,0040,0005,0042,0121,0002,0021,0201,0000,0020,
-       0160,0000,0100,0000,0140,0000,0000,0160,0006,0000,0220,0000,0140,
-       0140,0000,0020,0001,0020,0000,0000,0100,0001,0000,0300,0000,0000,
-       0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,
-       0106,0041,0040,0147,0040,0000,0063,0041,0001,0102,0160,0002,0002,
-       0300,0000,0040,0017,0140,0017,0000,0240,0000,0000,0140,0000,0120,
-};
-
-char   bxxh[26][13] = {
-       0005,0150,0153,0062,0062,0246,0152,0127,0146,0203,0310,0017,0206,
-       0100,0000,0120,0000,0140,0000,0000,0100,0000,0000,0120,0000,0060,
-       0100,0000,0040,0000,0060,0000,0000,0060,0000,0000,0220,0000,0040,
-       0100,0000,0120,0000,0200,0000,0000,0100,0000,0000,0140,0000,0060,
-       0043,0142,0046,0140,0062,0147,0210,0131,0046,0106,0246,0017,0111,
-       0060,0000,0020,0000,0060,0000,0000,0040,0000,0000,0100,0000,0000,
-       0060,0000,0040,0000,0040,0000,0000,0040,0000,0000,0100,0000,0040,
-       0100,0000,0100,0000,0100,0000,0000,0040,0000,0000,0100,0000,0140,
-       0066,0045,0145,0140,0000,0070,0377,0030,0130,0103,0003,0017,0006,
-       0040,0000,0040,0000,0020,0000,0000,0040,0000,0000,0100,0000,0000,
-       0200,0000,0020,0000,0140,0000,0000,0120,0000,0000,0120,0000,0040,
-       0120,0000,0040,0000,0060,0000,0000,0060,0000,0000,0160,0000,0040,
-       0120,0000,0040,0000,0120,0000,0000,0040,0000,0000,0160,0000,0040,
-       0120,0000,0020,0000,0140,0000,0000,0120,0000,0000,0140,0000,0040,
-       0051,0126,0150,0140,0060,0210,0146,0006,0006,0165,0003,0017,0244,
-       0120,0000,0040,0000,0160,0000,0000,0140,0000,0000,0060,0000,0140,
-       0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,
-       0140,0000,0140,0000,0060,0000,0000,0100,0000,0000,0140,0000,0020,
-       0120,0000,0020,0000,0060,0000,0000,0060,0000,0000,0060,0000,0040,
-       0140,0000,0020,0000,0100,0000,0000,0140,0000,0000,0140,0000,0020,
-       0070,0125,0051,0162,0120,0105,0126,0104,0006,0044,0000,0017,0052,
-       0140,0000,0020,0000,0140,0000,0000,0060,0000,0000,0060,0000,0040,
-       0020,0000,0000,0000,0020,0000,0000,0000,0000,0000,0000,0000,0060,
-       0140,0000,0160,0000,0200,0000,0000,0140,0000,0000,0000,0000,0240,
-       0065,0042,0060,0200,0000,0210,0222,0146,0006,0204,0220,0012,0003,
-       0240,0000,0020,0000,0120,0000,0000,0200,0000,0000,0200,0000,0240,
-};
-
-char   xhx[26][13] = {
-       0032,0146,0042,0107,0076,0102,0042,0146,0202,0050,0006,0000,0051,
-       0036,0377,0057,0013,0057,0366,0377,0057,0001,0377,0057,0000,0040,
-       0037,0377,0020,0000,0100,0022,0377,0057,0362,0116,0100,0000,0017,
-       0057,0377,0057,0031,0137,0363,0377,0037,0362,0270,0077,0000,0117,
-       0074,0142,0012,0236,0076,0125,0063,0165,0341,0046,0047,0000,0024,
-       0020,0017,0075,0377,0040,0001,0377,0017,0001,0204,0020,0000,0040,
-       0057,0017,0057,0340,0140,0362,0314,0117,0003,0302,0100,0000,0057,
-       0057,0357,0077,0017,0100,0366,0314,0057,0342,0346,0037,0000,0060,
-       0252,0145,0072,0157,0377,0165,0063,0066,0164,0050,0363,0000,0362,
-       0000,0000,0020,0000,0020,0000,0000,0017,0000,0000,0020,0000,0000,
-       0117,0017,0237,0377,0200,0354,0125,0110,0004,0257,0000,0000,0300,
-       0057,0367,0054,0357,0157,0216,0314,0114,0217,0353,0053,0000,0057,
-       0077,0213,0077,0077,0177,0317,0377,0114,0377,0352,0077,0000,0076,
-       0077,0213,0077,0077,0157,0177,0377,0054,0377,0352,0117,0000,0075,
-       0125,0230,0065,0216,0057,0066,0063,0047,0345,0126,0011,0000,0033,
-       0057,0377,0051,0360,0120,0361,0273,0056,0001,0256,0057,0000,0060,
-       0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,
-       0076,0310,0056,0310,0137,0174,0273,0055,0335,0266,0033,0000,0155,
-       0077,0157,0057,0360,0057,0063,0042,0024,0077,0206,0020,0000,0040,
-       0057,0037,0077,0360,0100,0365,0377,0037,0362,0176,0050,0000,0026,
-       0167,0146,0042,0112,0077,0110,0062,0254,0366,0052,0377,0000,0163,
-       0060,0000,0040,0000,0120,0000,0377,0060,0012,0000,0037,0000,0257,
-       0037,0232,0157,0361,0040,0003,0125,0010,0001,0256,0000,0000,0340,
-       0377,0377,0377,0377,0377,0377,0377,0377,0377,0377,0377,0017,0277,
-       0253,0315,0257,0216,0377,0206,0146,0306,0371,0126,0232,0000,0004,
-       0057,0012,0100,0360,0160,0360,0000,0040,0000,0017,0157,0000,0176,
-};
-
-char   xxh[26][13] = {
-       0045,0150,0154,0162,0042,0246,0210,0147,0152,0103,0230,0017,0206,
-       0100,0000,0040,0000,0140,0000,0000,0100,0000,0021,0120,0017,0060,
-       0100,0000,0040,0002,0140,0320,0000,0060,0000,0001,0220,0017,0040,
-       0100,0001,0120,0001,0241,0000,0000,0100,0000,0020,0140,0017,0060,
-       0023,0162,0046,0142,0022,0207,0210,0131,0052,0106,0250,0017,0110,
-       0060,0000,0042,0000,0160,0000,0000,0040,0000,0212,0100,0017,0000,
-       0140,0000,0040,0002,0140,0000,0000,0120,0000,0040,0120,0017,0040,
-       0100,0000,0100,0000,0140,0001,0021,0140,0000,0046,0100,0017,0140,
-       0066,0045,0025,0201,0020,0130,0146,0030,0130,0103,0025,0017,0006,
-       0100,0000,0040,0000,0020,0000,0000,0040,0000,0000,0200,0017,0000,
-       0200,0000,0020,0001,0140,0000,0000,0140,0000,0000,0120,0017,0040,
-       0120,0026,0042,0020,0140,0161,0042,0143,0000,0022,0162,0017,0040,
-       0121,0042,0060,0020,0140,0200,0000,0123,0000,0021,0220,0017,0041,
-       0121,0042,0060,0120,0140,0200,0000,0123,0000,0021,0160,0017,0041,
-       0051,0126,0150,0141,0060,0210,0146,0066,0026,0165,0026,0017,0247,
-       0120,0000,0040,0003,0160,0000,0000,0140,0000,0021,0100,0017,0140,
-       0000,0000,0000,0000,0200,0000,0000,0000,0000,0000,0000,0017,0000,
-       0141,0023,0122,0040,0160,0143,0042,0142,0000,0047,0143,0017,0020,
-       0120,0000,0040,0006,0140,0060,0000,0141,0000,0026,0100,0017,0040,
-       0140,0000,0020,0007,0100,0000,0000,0140,0000,0001,0140,0017,0020,
-       0110,0125,0051,0162,0120,0125,0127,0104,0006,0104,0000,0017,0052,
-       0140,0000,0040,0000,0160,0000,0000,0140,0000,0000,0060,0017,0000,
-       0040,0005,0020,0000,0040,0313,0231,0030,0000,0140,0000,0017,0056,
-       0140,0000,0160,0000,0200,0000,0000,0140,0000,0000,0000,0017,0240,
-       0065,0042,0060,0040,0000,0206,0231,0146,0006,0224,0220,0017,0004,
-       0240,0000,0020,0000,0140,0000,0000,0220,0000,0000,0200,0017,0141,
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/makefile b/.ref-Research-V7/usr/src/cmd/troff/makefile
deleted file mode 100644 (file)
index 018f970..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-all:   nroff troff
-
-nroff:
-       make -f nmake
-       rm *.o
-
-troff:
-       make -f tmake
-       rm *.o
-
-cp:    all
-       cp nroff troff /bin
-       rm nroff troff
-
-cmp:   all
-       cmp nroff /bin/nroff
-       cmp troff /bin/troff
-       rm nroff troff
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n1.c b/.ref-Research-V7/usr/src/cmd/troff/n1.c
deleted file mode 100644 (file)
index 1e5f1f7..0000000
+++ /dev/null
@@ -1,942 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-#include "s.h"
-#include <setjmp.h>
-jmp_buf sjbuf;
-#include       <sgtty.h>
-/*
-troff1.c
-
-consume options, initialization, main loop,
-input routines, escape function calling
-*/
-
-extern struct s *frame, *stk, *nxf;
-extern struct s *ejl, *litlev;
-extern filep ip;
-extern filep offset;
-extern filep nextb;
-
-
-extern int stdi;
-extern int waitf;
-extern int nofeed;
-extern int quiet;
-extern int ptid;
-extern int ascii;
-extern int npn;
-extern int xflg;
-extern int stop;
-extern char ibuf[IBUFSZ];
-extern char xbuf[IBUFSZ];
-extern char *ibufp;
-extern char *xbufp;
-extern char *eibuf;
-extern char *xeibuf;
-extern int cbuf[NC];
-extern int *cp;
-extern int *vlist;
-extern int nx;
-extern int mflg;
-extern int ch;
-extern int pto;
-extern int pfrom;
-extern int cps;
-extern int chbits;
-extern int ibf;
-extern int ttyod;
-extern struct sgttyb ttys;
-extern int iflg;
-extern int init;
-extern int rargc;
-extern char **argp;
-extern char trtab[256];
-extern int lgf;
-extern int copyf;
-extern int eschar;
-extern int ch0;
-extern int cwidth;
-extern int nlflg;
-extern int *ap;
-extern int donef;
-extern int nflush;
-extern int nchar;
-extern int rchar;
-extern int nfo;
-extern int ifile;
-extern int fc;
-extern int padc;
-extern int tabc;
-extern int dotc;
-extern int raw;
-extern int tabtab[NTAB];
-extern char nextf[];
-extern int nfi;
-#ifdef NROFF
-extern char termtab[];
-extern int tti;
-#endif
-extern int ifl[NSO];
-extern int ifi;
-extern int pendt;
-extern int flss;
-extern int fi;
-extern int lg;
-extern char ptname[];
-extern int print;
-extern int nonumb;
-extern int pnlist[];
-extern int *pnp;
-extern int nb;
-extern int trap;
-extern int tflg;
-extern int ejf;
-extern int lit;
-extern int cc;
-extern int c2;
-extern int spread;
-extern int gflag;
-extern int oline[];
-extern int *olinep;
-extern int dpn;
-extern int noscale;
-extern char *unlkp;
-extern int pts;
-extern int level;
-extern int ttysave;
-extern int tdelim;
-extern int dotT;
-extern int tabch, ldrch;
-extern int eqflg;
-extern no_out;
-extern int hflg;
-#ifndef NROFF
-extern char codetab[];
-extern int spbits;
-#endif
-extern int xxx;
-int stopmesg;
-filep ipl[NSO];
-long offl[NSO];
-long ioff;
-char *ttyp;
-extern struct contab {
-       int rq;
-       union {
-               int (*f)();
-               unsigned mx;
-       }x;
-}contab[NM];
-int ms[] = {31,28,31,30,31,30,31,31,30,31,30,31};
-#ifndef NROFF
-int acctf;
-#endif
-
-main(argc,argv)
-int argc;
-char **argv;
-{
-       char *p, *q;
-       register i, j;
-       extern catch(), fpecatch(), kcatch();
-
-       signal(SIGHUP,catch);
-       if(signal(SIGINT,catch) == SIG_IGN){
-               signal(SIGHUP,SIG_IGN);
-               signal(SIGINT,SIG_IGN);
-               signal(SIGQUIT,SIG_IGN);
-       }
-       signal(SIGFPE,fpecatch);
-       signal(SIGPIPE,catch);
-       signal(SIGTERM,kcatch);
-       init1(argv[0][0]);
-options:
-       while(--argc > 0 && (++argv)[0][0]=='-')
-               switch(argv[0][1]){
-
-               case 0:
-                       goto start;
-               case 'i':
-                       stdi++;
-                       continue;
-               case 'q':
-                       quiet++;
-                       if(gtty(0, &ttys) >= 0)
-                               ttysave = ttys.sg_flags;
-                       continue;
-               case 'n':
-                       npn = cnum(&argv[0][2]);
-                       continue;
-               case 'p':
-                       xflg = 0;
-                       cps = cnum(&argv[0][2]);
-                       continue;
-               case 'S':
-                       stopmesg++;
-                       continue;
-               case 's':
-                       if(!(stop = cnum(&argv[0][2])))stop++;
-                       continue;
-               case 'r':
-                       vlist[findr(argv[0][2])] = cnum(&argv[0][3]);
-                       continue;
-               case 'm':
-                       p = &nextf[nfi];
-                       q = &argv[0][2];
-                       while((*p++ = *q++) != 0);
-                       mflg++;
-                       continue;
-               case 'o':
-                       getpn(&argv[0][2]);
-                       continue;
-#ifdef NROFF
-               case 'h':
-                       hflg++;
-                       continue;
-               case 'z':
-                       no_out++;
-                       continue;
-               case 'e':
-                       eqflg++;
-                       continue;
-               case 'T':
-                       p = &termtab[tti];
-                       q = &argv[0][2];
-                       if(!((*q) & 0177))continue;
-                       while((*p++ = *q++) != 0);
-                       dotT++;
-                       continue;
-#endif
-#ifndef NROFF
-               case 'z':
-                       no_out++;
-               case 'a':
-                       ascii = 1;
-                       nofeed++;
-               case 't':
-                       ptid = 1;
-                       continue;
-               case 'w':
-                       waitf = 1;
-                       continue;
-               case 'f':
-                       nofeed++;
-                       continue;
-               case 'x':
-                       xflg = 0;
-                       continue;
-               case 'b':
-                       if(open(ptname,1) < 0)prstr("Busy.\n");
-                       else prstr("Available.\n");
-                       done3(0);
-               case 'g':
-                       stop = ptid = gflag = 1;
-                       dpn = 0;
-                       continue;
-#endif
-               default:
-                       pto = cnum(&argv[0][1]);
-                       continue;
-               }
-
-       if(argv[0][0] == '+'){
-               pfrom = cnum(&argv[0][1]);
-               print = 0;
-               if(argc > 0)goto options;
-       }
-
-start:
-       argp = argv;
-       rargc = argc;
-       init2();
-       setjmp(sjbuf);
-loop:
-       copyf = lgf = nb = nflush = nlflg = 0;
-       if(ip && (rbf0(ip)==0) && ejf && (frame->pframe <= ejl)){
-               nflush++;
-               trap = 0;
-               eject((struct s *)0);
-               goto loop;
-       }
-       i = getch();
-       if(pendt)goto lt;
-       if(lit && (frame <= litlev)){
-               lit--;
-               goto lt;
-       }
-       if((j = (i & CMASK)) == XPAR){
-               copyf++;
-               tflg++;
-               for(;(i & CMASK) != '\n';)pchar(i = getch());
-               tflg = 0;
-               copyf--;
-               goto loop;
-       }
-       if((j == cc) || (j == c2)){
-               if(j == c2)nb++;
-               copyf++;
-               while(((j=((i=getch()) & CMASK)) == ' ') ||
-                       (j == '\t'));
-               ch = i;
-               copyf--;
-               control(getrq(),1);
-               flushi();
-               goto loop;
-       }
-lt:
-       ch = i;
-       text();
-       goto loop;
-}
-catch(){
-/*
-       prstr("Interrupt\n");
-*/
-       done3(01);
-}
-fpecatch(){
-       prstrfl("Floating Exception.\n");
-       signal(SIGFPE,fpecatch);
-}
-kcatch(){
-       signal(SIGTERM,SIG_IGN);
-       done3(01);
-}
-#ifndef NROFF
-acctg() {
-       static char *acct_file = "/usr/adm/tracct";
-       acctf = open(acct_file,1);
-       setuid(getuid());
-}
-#endif
-init1(a)
-char a;
-{
-       register char *p;
-       char *mktemp();
-       register i;
-
-#ifndef NROFF
-       acctg();/*open troff actg file while mode 4755*/
-#endif
-       p = mktemp("/tmp/taXXXXX");
-       if(a == 'a')p = &p[5];
-       if((close(creat(p, 0600))) < 0){
-               prstr("Cannot create temp file.\n");
-               exit(-1);
-       }
-       ibf = open(p, 2);
-       for(i=256; --i;)trtab[i]=i;
-       trtab[UNPAD] = ' ';
-       mchbits();
-       if(a != 'a')unlkp = p;
-}
-init2()
-{
-       register i,j;
-       extern int block;
-       extern char *setbrk();
-       extern char *ttyname();
-
-       ttyod = 2;
-       if(((ttyp=ttyname(j=0)) != (char *)0) ||
-          ((ttyp=ttyname(j=1)) != (char *)0) ||
-          ((ttyp=ttyname(j=2)) != (char *)0)
-         );else ttyp = "notty";
-       iflg = j;
-       if(ascii)mesg(0);
-
-       if((!ptid) && (!waitf)){
-               if((ptid = open(ptname,1)) < 0){
-                       prstr("Typesetter busy.\n");
-                       done3(-2);
-               }
-       }
-       ptinit();
-       for(i=NEV; i--;)write(ibf, (char *)&block, EVS*sizeof(int));
-       olinep = oline;
-       ibufp = eibuf = ibuf;
-       v.hp = init = 0;
-       ioff = 0;
-       v.nl = -1;
-       cvtime();
-       frame = stk = (struct s *)setbrk(DELTA);
-       dip = &d[0];
-       nxf = frame + 1;
-       nx = mflg;
-}
-cvtime(){
-
-       long tt;
-       register i;
-
-       time(&tt);
-       tt -= 3600*ZONE;        /*5hrs for EST*/
-       v.dy = (tt/86400L) + 1;
-       v.dw = (v.dy + 3)%7 + 1;
-       for(v.yr=70;; v.yr++){
-               if((v.yr)%4)ms[1]=28;else ms[1]=29;
-               for(i=0;i<12;){
-                       if(v.dy<=ms[i]){
-                               v.mo = i+1;
-                               return;
-                       }
-                       v.dy -= ms[i++];
-               }
-       }
-}
-cnum(a)
-char *a;
-{
-       register i;
-
-       ibufp = a;
-       eibuf = MAXPTR;
-       i = atoi();
-       ch = 0;
-       return(i);
-}
-mesg(f)
-int f;
-{
-       static int mode;
-
-       if(!f){
-               stat(ttyp,cbuf);
-               mode = ((struct stat *)(cbuf))->st_mode;
-               chmod(ttyp,mode & ~022);
-       }else{
-               chmod(ttyp,mode);
-       }
-}
-prstrfl(s)
-char *s;
-{
-       flusho();
-       prstr(s);
-}
-prstr(s)
-char *s;
-{
-       register i;
-       register char *j;
-
-       j = s;
-       for(i=0;*s;i++)s++;
-       write(ttyod,j,i);
-}
-control(a,b)
-int a,b;
-{
-       register i,j;
-       extern filep boff();
-
-       i = a;
-       if((i == 0) || ((j = findmn(i)) == -1))return(0);
-       if(contab[j].rq & MMASK){
-               nxf->nargs = 0;
-               if(b)collect();
-               flushi();
-               return(pushi(((filep)contab[j].x.mx)<<BLKBITS));
-       }else{
-               if(!b)return(0);
-               return((*contab[j].x.f)(0));
-       }
-}
-
-getrq(){
-       register i,j;
-
-       if(((i=getach()) == 0) ||
-          ((j=getach()) == 0))goto rtn;
-       i = PAIR(i,j);
-rtn:
-       return(i);
-}
-getch(){
-       register int i, j, k;
-
-       level++;
-g0:
-       if(ch){
-               if(((i = ch) & CMASK) == '\n')nlflg++;
-               ch = 0;
-               level--;
-               return(i);
-       }
-
-       if(nlflg){
-               level--;
-               return('\n');
-       }
-
-       if((k = (i = getch0()) & CMASK) != ESC){
-               if(i & MOT)goto g2;
-               if(k == FLSS){
-                       copyf++; raw++;
-                       i = getch0();
-                       if(!fi)flss = i;
-                       copyf--; raw--;
-                       goto g0;
-               }
-               if(k == RPT){
-                       setrpt();
-                       goto g0;
-               }
-               if(!copyf){
-                       if((k == 'f') && lg && !lgf){
-                               i = getlg(i);
-                               goto g2;
-                       }
-                       if((k == fc) || (k == tabch) || (k == ldrch)){
-                               if((i=setfield(k)) == 0)goto g0; else goto g2;
-                       }
-                       if(k == 010){
-                               i = makem(-width(' ' | chbits));
-                               goto g2;
-                       }
-               }
-               goto g2;
-       }
-       k = (j = getch0()) & CMASK;
-       if(j & MOT){
-               i = j;
-               goto g2;
-       }
-/*
-       if(k == tdelim){
-               i = TDELIM;
-               tdelim = IMP;
-               goto g2;
-       }
-*/
-       switch(k){
-
-               case '\n':      /*concealed newline*/
-                       goto g0;
-               case 'n':       /*number register*/
-                       setn();
-                       goto g0;
-               case '*':       /*string indicator*/
-                       setstr();
-                       goto g0;
-               case '$':       /*argument indicator*/
-                       seta();
-                       goto g0;
-               case '{':       /*LEFT*/
-                       i = LEFT;
-                       goto gx;
-               case '}':       /*RIGHT*/
-                       i = RIGHT;
-                       goto gx;
-               case '"':       /*comment*/
-                       while(((i=getch0()) & CMASK ) != '\n');
-                       goto g2;
-               case ESC:       /*double backslash*/
-                       i = eschar;
-                       goto gx;
-               case 'e':       /*printable version of current eschar*/
-                       i = PRESC;
-                       goto gx;
-               case ' ':       /*unpaddable space*/
-                       i = UNPAD;
-                       goto gx;
-               case '|':       /*narrow space*/
-                       i = NARSP;
-                       goto gx;
-               case '^':       /*half of narrow space*/
-                       i = HNSP;
-                       goto gx;
-               case '\'':      /*\(aa*/
-                       i = 0222;
-                       goto gx;
-               case '`':       /*\(ga*/
-                       i = 0223;
-                       goto gx;
-               case '_':       /*\(ul*/
-                       i = 0224;
-                       goto gx;
-               case '-':       /*current font minus*/
-                       i = 0210;
-                       goto gx;
-               case '&':       /*filler*/
-                       i = FILLER;
-                       goto gx;
-               case 'c':       /*to be continued*/
-                       i = CONT;
-                       goto gx;
-               case ':':       /*lem's char*/
-                       i = COLON;
-                       goto gx;
-               case '!':       /*transparent indicator*/
-                       i = XPAR;
-                       goto gx;
-               case 't':       /*tab*/
-                       i = '\t';
-                       goto g2;
-               case 'a':       /*leader (SOH)*/
-                       i = LEADER;
-                       goto g2;
-               case '%':       /*ohc*/
-                       i = OHC;
-                       goto g2;
-               case '.':       /*.*/
-                       i = '.';
-               gx:
-                       i = (j & ~CMASK) | i;
-                       goto g2;
-       }
-       if(!copyf)
-               switch(k){
-
-                       case 'p':       /*spread*/
-                               spread++;
-                               goto g0;
-                       case '(':       /*special char name*/
-                               if((i=setch()) == 0)goto g0;
-                               break;
-                       case 's':       /*size indicator*/
-                               setps();
-                               goto g0;
-                       case 'f':       /*font indicator*/
-                               setfont(0);
-                               goto g0;
-                       case 'w':       /*width function*/
-                               setwd();
-                               goto g0;
-                       case 'v':       /*vert mot*/
-                               if(i = vmot())break;
-                               goto g0;
-                       case 'h':       /*horiz mot*/
-                               if(i = hmot())break;
-                               goto g0;
-                       case 'z':       /*zero with char*/
-                               i = setz();
-                               break;
-                       case 'l':       /*hor line*/
-                               setline();
-                               goto g0;
-                       case 'L':       /*vert line*/
-                               setvline();
-                               goto g0;
-                       case 'b':       /*bracket*/
-                               setbra();
-                               goto g0;
-                       case 'o':       /*overstrike*/
-                               setov();
-                               goto g0;
-                       case 'k':       /*mark hor place*/
-                               if((i=findr(getsn())) == -1)goto g0;
-                               vlist[i] = v.hp;
-                               goto g0;
-                       case 'j':       /*mark output hor place*/
-                               if(!(i=getach()))goto g0;
-                               i = (i<<BYTE) | JREG;
-                               break;
-                       case '0':       /*number space*/
-                               i = makem(width('0' | chbits));
-                               break;
-                       case 'x':       /*extra line space*/
-                               if(i = xlss())break;
-                               goto g0;
-                       case 'u':       /*half em up*/
-                       case 'r':       /*full em up*/
-                       case 'd':       /*half em down*/
-                               i = sethl(k);
-                               break;
-                       default:
-                               i = j;
-               }
-       else{
-               ch0 = j;
-               i = eschar;
-       }
-g2:
-       if((i & CMASK) == '\n'){
-               nlflg++;
-               v.hp = 0;
-               if(ip == 0)v.cd++;
-       }
-       if(!--level){
-               j = width(i);
-               v.hp += j;
-               cwidth = j;
-       }
-       return(i);
-}
-char ifilt[32] = {0,001,002,003,0,005,006,007,010,011,012};
-getch0(){
-       register int i, j;
-
-       if(ch0){i=ch0; ch0=0; return(i);}
-       if(nchar){nchar--; return(rchar);}
-
-again:
-       if(cp){
-               if((i = *cp++) == 0){
-                       cp = 0;
-                       goto again;
-               }
-       }else if(ap){
-               if((i = *ap++) == 0){
-                       ap = 0;
-                       goto again;
-               }
-       }else if(ip){
-               if(ip == -1)i = rdtty();
-               else i = rbf();
-       }else{
-               if(donef)done(0);
-               if(nx || ((ibufp >= eibuf) && (ibufp != MAXPTR))){
-                       if(nfo)goto g1;
-               g0:
-                       if(nextfile()){
-                               if(ip)goto again;
-                               if(ibufp < eibuf)goto g2;
-                       }
-               g1:
-                       nx = 0;
-                       if((j=read(ifile,ibuf,IBUFSZ)) <= 0)goto g0;
-                       ibufp = ibuf;
-                       eibuf = ibuf + j;
-                       if(ip)goto again;
-               }
-       g2:
-               i = *ibufp++ & 0177;
-               ioff++;
-               if(i >= 040)goto g4; else i = ifilt[i];
-       }
-       if(raw)return(i);
-       if((j = i & CMASK) == IMP)goto again;
-       if((i == 0) && !init)goto again;
-g4:
-       if((copyf == 0) && ((i & ~BMASK) == 0) && ((i & CMASK) < 0370))
-#ifndef NROFF
-               if(spbits && (i>31) && ((codetab[i-32] & 0200))) i |= spbits;
-               else
-#endif
-               i |= chbits;
-       if((i & CMASK) == eschar)i = (i & ~CMASK) | ESC;
-       return(i);
-}
-nextfile(){
-       register char *p;
-
-n0:
-       if(ifile)close(ifile);
-       if(nx){
-               p = nextf;
-               if(*p != 0)goto n1;
-       }
-       if(ifi > 0){
-               if(popf())goto n0; /*popf error*/
-               return(1); /*popf ok*/
-       }
-       if(rargc-- <= 0)goto n2;
-       p = (argp++)[0];
-n1:
-       if((p[0] == '-') && (p[1] == 0)){
-               ifile = 0;
-       }else if((ifile=open(p,0)) < 0){
-               prstr("Cannot open ");
-               prstr(p);
-               prstr("\n");
-               nfo -= mflg;
-               done(02);
-       }
-       nfo++;
-       v.cd = 0;
-       ioff = 0;
-       return(0);
-n2:
-       if((nfo -= mflg) && !stdi)done(0);
-       nfo++;
-       v.cd = ifile =  stdi = mflg = 0;
-       ioff = 0;
-       return(0);
-}
-popf(){
-       register i;
-       register char *p, *q;
-       extern char *ttyname();
-
-       ioff = offl[--ifi];
-       ip = ipl[ifi];
-       if((ifile = ifl[ifi]) == 0){
-               p = xbuf;
-               q = ibuf;
-               ibufp = xbufp;
-               eibuf = xeibuf;
-               while(q < eibuf)*q++ = *p++;
-               return(0);
-       }
-       if((lseek(ifile,(long)(ioff & ~(IBUFSZ-1)),0) < 0) ||
-          ((i = read(ifile,ibuf,IBUFSZ)) < 0))return(1);
-       eibuf = ibuf + i;
-       ibufp = ibuf;
-       if(ttyname(ifile) == (char *)0)
-               if((ibufp = ibuf + (int)(ioff & (IBUFSZ-1)))  >= eibuf)return(1);
-       return(0);
-}
-flushi(){
-       if(nflush)return;
-       ch = 0;
-       if((ch0 & CMASK) == '\n')nlflg++;
-       ch0 = 0;
-       copyf++;
-       while(!nlflg){
-               if(donef && (frame == stk))break;
-               getch();
-       }
-       copyf--;
-       v.hp = 0;
-}
-getach(){
-       register i;
-
-       lgf++;
-       if(((i = getch()) & MOT) ||
-           ((i&CMASK) == ' ') ||
-           ((i&CMASK) == '\n')||
-           (i & 0200)){
-                       ch = i;
-                       i = 0;
-       }
-       lgf--;
-       return(i & 0177);
-}
-casenx(){
-       lgf++;
-       skip();
-       getname();
-       nx++;
-       nextfile();
-       nlflg++;
-       ip = 0;
-       ap = 0;
-       nchar = pendt = 0;
-       frame = stk;
-       nxf = frame + 1;
-}
-getname(){
-       register int i, j, k;
-
-       lgf++;
-       for(k=0; k < (NS-1); k++){
-               if(((j=(i=getch()) & CMASK) <= ' ') ||
-                       (j > 0176))break;
-               nextf[k] = j;
-       }
-       nextf[k] = 0;
-       ch = i;
-       lgf--;
-       return(nextf[0]);
-}
-caseso(){
-       register i;
-       register char *p, *q;
-
-       lgf++;
-       nextf[0] = 0;
-       if(skip() || !getname() || ((i=open(nextf,0)) <0) || (ifi >= NSO)) {
-               prstr("can't open file ");
-               prstr(nextf);
-               prstr("\n");
-               done(02);
-       }
-       flushi();
-       ifl[ifi] = ifile;
-       ifile = i;
-       offl[ifi] = ioff;
-       ioff = 0;
-       ipl[ifi] = ip;
-       ip = 0;
-       nx++;
-       nflush++;
-       if(!ifl[ifi++]){
-               p = ibuf;
-               q = xbuf;
-               xbufp = ibufp;
-               xeibuf = eibuf;
-               while(p < eibuf)*q++ = *p++;
-       }
-}
-
-casecf(){      /* copy file without change */
-       int fd, i, n;
-       char buf[512];
-
-       flusho();
-       lgf++;
-       nextf[0] = 0;
-       if(skip() || !getname() || ((fd=open(nextf,0)) <0) || (ifi >= NSO)) {
-               prstr("can't open file ");
-               prstr(nextf);
-               prstr("\n");
-               done(02);
-       }
-       while ((n = read(fd, buf, 512)) > 0)
-               for (i = 0; i < n; i++)
-                       oput(buf[i]);
-       flusho();
-       close(fd);
-}
-getpn(a)
-char *a;
-{
-       register i, neg;
-       long atoi1();
-
-       if((*a & 0177) == 0)return;
-       neg = 0;
-       ibufp = a;
-       eibuf = MAXPTR;
-       noscale++;
-       while((i = getch() & CMASK) != 0)switch(i){
-               case '+':
-               case ',':
-                       continue;
-               case '-':
-                       neg = MOT;
-                       goto d2;
-               default:
-                       ch = i;
-               d2:
-                       i = atoi1();
-                       if(nonumb)goto fini;
-                       else{
-                               *pnp++ = i | neg;
-                               neg = 0;
-                               if(pnp >= &pnlist[NPN-2]){
-                                       prstr("Too many page numbers\n");
-                                       done3(-3);
-                               }
-                       }
-               }
-fini:
-       if(neg)*pnp++ = -2;
-       *pnp = -1;
-       ch = noscale = print = 0;
-       pnp = pnlist;
-       if(*pnp != -1)chkpn();
-}
-setrpt(){
-       register i, j;
-
-       copyf++;raw++;
-       i = getch0();
-       copyf--;raw--;
-       if((i < 0) ||
-          (((j = getch0()) & CMASK) == RPT))return;
-       rchar = j;
-       nchar = i & BMASK;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n10.c b/.ref-Research-V7/usr/src/cmd/troff/n10.c
deleted file mode 100644 (file)
index 1d17f6d..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-#include "tdef.h"
-#include <sgtty.h>
-extern
-#include "d.h"
-extern
-#include "v.h"
-extern
-#include "tw.h"
-/*
-nroff10.c
-
-Device interfaces
-*/
-
-extern int lss;
-extern char obuf[];
-extern char *obufp;
-extern int xfont;
-extern int esc;
-extern int lead;
-extern int oline[];
-extern int *olinep;
-extern int ulfont;
-extern int esct;
-extern int sps;
-extern int ics;
-extern int ttysave;
-extern struct sgttyb ttys;
-extern char termtab[];
-extern int ptid;
-extern int waitf;
-extern int pipeflg;
-extern int eqflg;
-extern int hflg;
-extern int tabtab[];
-extern int ascii;
-extern int xxx;
-int dtab;
-int bdmode;
-int plotmode;
-
-ptinit(){
-       register i, j;
-       register char **p;
-       char *q;
-       int x[8];
-       extern char *setbrk();
-
-       if((i = open(termtab,0)) < 0){
-               prstr("Cannot open ");
-               prstr(termtab);
-               prstr("\n");
-               exit(-1);
-       }
-       read(i,(char *)x,8*sizeof(int));
-       read(i,(char *)&t.bset,j = sizeof(int)*((int *)&t.zzz - &t.bset));
-       x[2] -= j;
-       q = setbrk(x[2]);
-       lseek(i,(long)t.twinit+8*sizeof(int),0);
-       i = read(i,q,x[2]);
-       j = q - t.twinit;
-       for(p = &t.twinit; p < &t.zzz; p++){
-               if(*p)*p += j;else *p = "";
-       }
-       sps = EM;
-       ics = EM*2;
-       dtab = 8 * t.Em;
-       for(i=0; i<16; i++)tabtab[i] = dtab * (i+1);
-       if(eqflg)t.Adj = t.Hor;
-}
-twdone(){
-       obufp = obuf;
-       oputs(t.twrest);
-       flusho();
-       if(pipeflg){
-               close(ptid);
-               wait(&waitf);
-       }
-       if(ttysave != -1) {
-               ttys.sg_flags = ttysave;
-               stty(1, &ttys);
-       }
-}
-ptout(i)
-int i;
-{
-       *olinep++ = i;
-       if(olinep >= &oline[LNSIZE])olinep--;
-       if((i&CMASK) != '\n')return;
-       olinep--;
-       lead += dip->blss + lss - t.Newline;
-       dip->blss = 0;
-       esct = esc = 0;
-       if(olinep>oline){
-               move();
-               ptout1();
-               oputs(t.twnl);
-       }else{
-               lead += t.Newline;
-               move();
-       }
-       lead += dip->alss;
-       dip->alss = 0;
-       olinep = oline;
-}
-ptout1()
-{
-       register i, k;
-       register char *codep;
-       extern char *plot();
-       int *q, w, j, phyw;
-
-       for(q=oline; q<olinep; q++){
-       if((i = *q) & MOT){
-               j = i & ~MOTV;
-               if(i & NMOT)j = -j;
-               if(i & VMOT)lead += j;
-               else esc += j;
-               continue;
-       }
-       if((k = (i & CMASK)) <= 040){
-               switch(k){
-                       case ' ': /*space*/
-                               esc += t.Char;
-                               break;
-               }
-               continue;
-       }
-       codep = t.codetab[k-32];
-       w = t.Char * (*codep++ & 0177);
-       phyw = w;
-       if(i&ZBIT)w = 0;
-       if(*codep && (esc || lead))move();
-       esct += w;
-       if(i&074000)xfont = (i>>9) & 03;
-       if(*t.bdon & 0377){
-               if(!bdmode && (xfont == 2)){
-                       oputs(t.bdon);
-                       bdmode++;
-               }
-               if(bdmode && (xfont != 2)){
-                       oputs(t.bdoff);
-                       bdmode = 0;
-               }
-       }
-       if(xfont == ulfont){
-               for(k=w/t.Char;k>0;k--)oput('_');
-               for(k=w/t.Char;k>0;k--)oput('\b');
-       }
-       while(*codep != 0){
-               if(*codep & 0200){
-                       codep = plot(codep);
-                       oputs(t.plotoff);
-                       oput(' ');
-               }else{
-                       if(plotmode)oputs(t.plotoff);
-                       *obufp++ = *codep++;
-                       if(obufp == (obuf + OBUFSZ + ascii - 1))flusho();
-/*                     oput(*codep++);*/
-               }
-       }
-       if(!w)for(k=phyw/t.Char;k>0;k--)oput('\b');
-       }
-}
-char *plot(x)
-char *x;
-{
-       register int i;
-       register char *j, *k;
-
-       if(!plotmode)oputs(t.ploton);
-       k = x;
-       if((*k & 0377) == 0200)k++;
-       for(; *k; k++){
-               if(*k & 0200){
-                       if(*k & 0100){
-                               if(*k & 040)j = t.up; else j = t.down;
-                       }else{
-                               if(*k & 040)j = t.left; else j = t.right;
-                       }
-                       if(!(i = *k & 037))return(++k);
-                       while(i--)oputs(j);
-               }else oput(*k);
-       }
-       return(k);
-}
-move(){
-       register k;
-       register char *i, *j;
-       char *p, *q;
-       int iesct, dt;
-
-       iesct = esct;
-       if(esct += esc)i = "\0"; else i = "\n\0";
-       j = t.hlf;
-       p = t.right;
-       q = t.down;
-       if(lead){
-               if(lead < 0){
-                       lead = -lead;
-                       i = t.flr;
-               /*      if(!esct)i = t.flr; else i = "\0";*/
-                       j = t.hlr;
-                       q = t.up;
-               }
-               if(*i & 0377){
-                       k = lead/t.Newline;
-                       lead = lead%t.Newline;
-                       while(k--)oputs(i);
-               }
-               if(*j & 0377){
-                       k = lead/t.Halfline;
-                       lead = lead%t.Halfline;
-                       while(k--)oputs(j);
-               }
-               else { /* no half-line forward, not at line begining */
-                       k = lead/t.Newline;
-                       lead = lead%t.Newline;
-                       if (k>0) esc=esct;
-                       i = "\n";
-                       while (k--) oputs(i);
-               }
-       }
-       if(esc){
-               if(esc < 0){
-                       esc = -esc;
-                       j = "\b";
-                       p = t.left;
-               }else{
-                       j = " ";
-                       if(hflg)while((dt = dtab - (iesct%dtab)) <= esc){
-                               if(dt%t.Em)break;
-                               oput(TAB);
-                               esc -= dt;
-                               iesct += dt;
-                       }
-               }
-               k = esc/t.Em;
-               esc = esc%t.Em;
-               while(k--)oputs(j);
-       }
-       if((*t.ploton & 0377) && (esc || lead)){
-               if(!plotmode)oputs(t.ploton);
-               esc /= t.Hor;
-               lead /= t.Vert;
-               while(esc--)oputs(p);
-               while(lead--)oputs(q);
-               oputs(t.plotoff);
-       }
-       esc = lead = 0;
-}
-ptlead(){move();}
-dostop(){
-       char junk;
-
-       flusho();
-       read(2,&junk,1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n2.c b/.ref-Research-V7/usr/src/cmd/troff/n2.c
deleted file mode 100644 (file)
index 1b990bf..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-#include "tdef.h"
-#include <sgtty.h>
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-#include "s.h"
-#include <setjmp.h>
-jmp_buf sjbuf;
-
-/*
-troff2.c
-
-output, cleanup
-*/
-
-extern struct s *frame, *stk, *nxf;
-extern filep ip;
-extern filep offset;
-extern char *enda;
-
-
-extern char obuf[OBUFSZ];
-extern char *obufp;
-extern int dilev;
-extern int eschar;
-extern int tlss;
-extern int tflg;
-extern int ascii;
-extern int print;
-extern char trtab[];
-extern int waitf;
-extern char ptname[];
-extern int ptid;
-extern int em;
-extern int ds;
-extern int mflg;
-extern filep woff;
-extern int nflush;
-extern int lgf;
-extern int app;
-extern int nfo;
-extern int donef;
-extern int *pendw;
-extern int nofeed;
-extern int trap;
-extern struct sgttyb ttys;
-extern int ttysave;
-extern int quiet;
-extern int pendnf;
-extern int ndone;
-extern int lead;
-extern int ralss;
-extern int paper;
-extern int gflag;
-extern char *unlkp;
-extern char nextf[];
-extern int pipeflg;
-extern int ejf;
-extern int no_out;
-extern int level;
-extern int stopmesg;
-extern int xxx;
-int toolate;
-int error;
-#ifndef NROFF
-extern int acctf;
-#endif
-
-pchar(c)
-int c;
-{
-       register i, j;
-
-       if((i=c) & MOT){pchar1(i); return;}
-       switch(j = i & CMASK){
-               case 0:
-               case IMP:
-               case RIGHT:
-               case LEFT:
-                       return;
-               case HX:
-                       j = (tlss>>9) | ((i&~0777)>>3);
-                       if(i & 040000){
-                               j &= ~(040000>>3);
-                               if(j > dip->blss)dip->blss = j;
-                       }else{
-                               if(j > dip->alss)dip->alss = j;
-                               ralss = dip->alss;
-                       }
-                       tlss = 0;
-                       return;
-               case LX:
-                       tlss = i;
-                       return;
-               case PRESC:
-                       if(dip == &d[0])j = eschar;
-               default:
-                       i = (trtab[j] & BMASK) | (i & ~CMASK);
-       }
-       pchar1(i);
-}
-pchar1(c)
-int c;
-{
-       register i, j, *k;
-       extern int chtab[];
-
-       j = (i = c) & CMASK;
-       if(dip != &d[0]){
-               wbf(i);
-               dip->op = offset;
-               return;
-       }
-       if(!tflg && !print){
-               if(j == '\n')dip->alss = dip->blss = 0;
-               return;
-       }
-       if(no_out || (j == FILLER))return;
-#ifndef NROFF
-       if(ascii){
-               if(i & MOT){
-                       oput(' ');
-                       return;
-               }
-               if(j < 0177){
-                       oput(i);
-                       return;
-               }
-               switch(j){
-                       case 0200:
-                       case 0210:
-                               oput('-');
-                               break;
-                       case 0211:
-                               oputs("fi");
-                               break;
-                       case 0212:
-                               oputs("fl");
-                               break;
-                       case 0213:
-                               oputs("ff");
-                               break;
-                       case 0214:
-                               oputs("ffi");
-                               break;
-                       case 0215:
-                               oputs("ffl");
-                               break;
-                       default:
-                               for(k=chtab; *++k != j; k++)
-                                       if(*k == 0)return;
-                               oput('\\');
-                               oput('(');
-                               oput(*--k & BMASK);
-                               oput(*k >> BYTE);
-               }
-       }else
-#endif
-       ptout(i);
-}
-oput(i)
-char i;
-{
-       *obufp++ = i;
-       if(obufp == (obuf + OBUFSZ + ascii - 1))flusho();
-}
-oputs(i)
-char *i;
-{
-       while(*i != 0)oput(*i++);
-}
-flusho(){
-       if(!ascii)*obufp++ = 0;
-       if(!ptid){
-               while((ptid=open(ptname,1)) < 0){
-                       if(++waitf <=2)prstr("Waiting for Typesetter.\n");
-                       sleep(15);
-               }
-       }
-       if(no_out == 0){
-               if (!toolate) {
-                       toolate++;
-#ifdef NROFF
-                       if(t.bset || t.breset){
-                               if(ttysave == -1) {
-                                       gtty(1, &ttys);
-                                       ttysave = ttys.sg_flags;
-                               }
-                               ttys.sg_flags &= ~t.breset;
-                               ttys.sg_flags |= t.bset;
-                               stty(1, &ttys);
-                       }
-                       {
-                       char *p = t.twinit;
-                       while (*p++)
-                               ;
-                       write(ptid, t.twinit, p-t.twinit-1);
-                       }
-#endif
-               }
-               toolate += write(ptid, obuf, obufp-obuf);
-       }
-       obufp = obuf;
-}
-done(x) int x;{
-       register i;
-
-       error |= x;
-       level = 0;
-       app = ds = lgf = 0;
-       if(i=em){
-               donef = -1;
-               em = 0;
-               if(control(i,0))longjmp(sjbuf,1);
-       }
-       if(!nfo)done3(0);
-       mflg = 0;
-       dip = &d[0];
-       if(woff)wbt(0);
-       if(pendw)getword(1);
-       pendnf = 0;
-       if(donef == 1)done1(0);
-       donef = 1;
-       ip = 0;
-       frame = stk;
-       nxf = frame + 1;
-       if(!ejf)tbreak();
-       nflush++;
-       eject((struct s *)0);
-       longjmp(sjbuf,1);
-}
-done1(x) int x; {
-       error |= x;
-       if(v.nl){
-               trap = 0;
-               eject((struct s *)0);
-               longjmp(sjbuf,1);
-       }
-       if(nofeed){
-               ptlead();
-               flusho();
-               done3(0);
-       }else{
-               if(!gflag)lead += TRAILER;
-               done2(0);
-       }
-}
-done2(x) int x; {
-       register i;
-
-       ptlead();
-#ifndef NROFF
-       if(!ascii){
-               oput(T_INIT);
-               oput(T_STOP);
-               if(!gflag)for(i=8; i>0; i--)oput(T_PAD);
-               if(stopmesg)prstr("Troff finished.\n");
-       }
-#endif
-       flusho();
-       done3(x);
-}
-done3(x) int x;{
-       error |= x;
-       signal(SIGINT, SIG_IGN);
-       signal(SIGTERM, SIG_IGN);
-       unlink(unlkp);
-#ifdef NROFF
-       twdone();
-#endif
-       if(quiet){
-               ttys.sg_flags |= ECHO;
-               stty(0, &ttys);
-       }
-       if(ascii)mesg(1);
-#ifndef NROFF
-       report();
-#endif
-       exit(error);
-}
-edone(x) int x;{
-       frame = stk;
-       nxf = frame + 1;
-       ip = 0;
-       done(x);
-}
-#ifndef NROFF
-report(){
-       struct {int use; int uid;} a;
-
-       if((ptid != 1) && paper ){
-               lseek(acctf,0L,2);
-               a.use = paper;
-               a.uid = getuid();
-               write(acctf,(char *)&a,sizeof(a));
-       }
-}
-#endif
-#ifdef NROFF
-casepi(){
-       register i;
-       int id[2];
-
-       if(toolate || skip() || !getname() || (pipe(id) == -1) ||
-          ((i=fork()) == -1)){
-               prstr("Pipe not created.\n");
-               return;
-       }
-       ptid = id[1];
-       if(i>0){
-               close(id[0]);
-               toolate++;
-               pipeflg++;
-               return;
-       }
-       close(0);
-       dup(id[0]);
-       close(id[1]);
-       execl(nextf,nextf,0);
-       prstr("Cannot exec: ");
-       prstr(nextf);
-       prstr("\n");
-       exit(-4);
-}
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n3.c b/.ref-Research-V7/usr/src/cmd/troff/n3.c
deleted file mode 100644 (file)
index 0c18457..0000000
+++ /dev/null
@@ -1,665 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-#include "s.h"
-
-/*
-troff3.c
-
-macro and string routines, storage allocation
-*/
-
-unsigned blist[NBLIST];
-extern struct s *frame, *stk, *nxf;
-extern filep ip;
-extern filep offset;
-extern filep nextb;
-extern char *enda;
-
-extern int ch;
-extern int ibf;
-extern int lgf;
-extern int copyf;
-extern int ch0;
-extern int app;
-extern int ds;
-extern int nlflg;
-extern int *argtop;
-extern int *ap;
-extern int nchar;
-extern int pendt;
-extern int rchar;
-extern int dilev;
-extern int nonumb;
-extern int lt;
-extern int nrbits;
-extern int nform;
-extern int fmt[];
-extern int oldmn;
-extern int newmn;
-extern int macerr;
-extern filep apptr;
-extern int diflg;
-extern filep woff;
-extern filep roff;
-extern int wbfi;
-extern int po;
-extern int *cp;
-extern int xxx;
-int pagech = '%';
-int strflg;
-extern struct contab {
-       int rq;
-       union {
-               int (*f)();
-               unsigned mx;
-       }x;
-}contab[NM];
-int wbuf[BLK];
-int rbuf[BLK];
-
-caseig(){
-       register i;
-
-       offset = 0;
-       if((i = copyb()) != '.')control(i,1);
-}
-casern(){
-       register i,j;
-
-       lgf++;
-       skip();
-       if(((i=getrq())==0) || ((oldmn=findmn(i)) < 0))return;
-       skip();
-       clrmn(findmn(j=getrq()));
-       if(j)contab[oldmn].rq = (contab[oldmn].rq & MMASK) | j;
-}
-caserm(){
-       lgf++;
-       while(!skip()){
-               clrmn(findmn(getrq()));
-       }
-}
-caseas(){
-       app++;
-       caseds();
-}
-caseds(){
-       ds++;
-       casede();
-}
-caseam(){
-       app++;
-       casede();
-}
-casede(){
-       register i, req;
-       register filep savoff;
-       extern filep finds();
-
-       if(dip != d)wbfl();
-       req = '.';
-       lgf++;
-       skip();
-       if((i=getrq())==0)goto de1;
-       if((offset=finds(i)) == 0)goto de1;
-       if(ds)copys();
-               else req = copyb();
-       wbfl();
-       clrmn(oldmn);
-       if(newmn)contab[newmn].rq = i | MMASK;
-       if(apptr){
-               savoff = offset;
-               offset = apptr;
-               wbt(IMP);
-               offset = savoff;
-       }
-       offset = dip->op;
-       if(req != '.')control(req,1);
-de1:
-       ds = app = 0;
-       return;
-}
-findmn(i)
-int i;
-{
-       register j;
-
-       for(j=0;j<NM;j++){
-               if(i == (contab[j].rq & ~MMASK))break;
-       }
-       if(j==NM)j = -1;
-       return(j);
-}
-clrmn(i)
-int i;
-{
-       extern filep boff();
-       if(i >= 0){
-               if(contab[i].rq & MMASK)ffree(((filep)contab[i].x.mx)<<BLKBITS);
-               contab[i].rq = 0;
-               contab[i].x.mx = 0;
-       }
-}
-filep finds(mn)
-int mn;
-{
-       register i;
-       extern filep boff();
-       register filep savip;
-       extern filep alloc();
-       extern filep incoff();
-
-       oldmn = findmn(mn);
-       newmn = 0;
-       apptr = (filep)0;
-       if(app && (oldmn >= 0) && (contab[oldmn].rq & MMASK)){
-                       savip = ip;
-                       ip = (((filep)contab[oldmn].x.mx)<<BLKBITS);
-                       oldmn = -1;
-                       while((i=rbf()) != 0);
-                       apptr = ip;
-                       if(!diflg)ip = incoff(ip);
-                       nextb = ip;
-                       ip = savip;
-       }else{
-               for(i=0;i<NM;i++){
-                       if(contab[i].rq == 0)break;
-               }
-               if((i==NM) ||
-                  (nextb = alloc()) == 0){
-                       app = 0;
-                       if(macerr++ > 1)done2(02);
-                       prstr("Too many string/macro names.\n");
-                       edone(04);
-                       return(offset = 0);
-               }
-                       contab[i].x.mx = (unsigned)(nextb>>BLKBITS);
-               if(!diflg){
-                       newmn = i;
-                       if(oldmn == -1)contab[i].rq = -1;
-               }else{
-                       contab[i].rq = mn | MMASK;
-               }
-       }
-
-       app = 0;
-       return(offset = nextb);
-}
-skip(){
-       register i;
-
-       while(((i=getch()) & CMASK) == ' ');
-       ch=i;
-       return(nlflg);
-}
-copyb()
-{
-       register i, j, k;
-       int ii, req, state;
-       filep savoff;
-
-       if(skip() || !(j=getrq()))j = '.';
-       req = j;
-       k = j>>BYTE;
-       j &= BMASK;
-       copyf++;
-       flushi();
-       nlflg = 0;
-       state = 1;
-       while(1){
-               i = (ii = getch()) & CMASK;
-               if(state == 3){
-                       if(i == k)break;
-                       if(!k){
-                               ch = ii;
-                               i = getach();
-                               ch = ii;
-                               if(!i)break;
-                       }
-                       state = 0;
-                       goto c0;
-               }
-               if(i == '\n'){
-                       state = 1;
-                       nlflg = 0;
-                       goto c0;
-               }
-               if((state == 1) && (i == '.')){
-                       state++;
-                       savoff = offset;
-                       goto c0;
-               }
-               if((state == 2) && (i == j)){
-                       state++;
-                       goto c0;
-               }
-               state = 0;
-c0:
-               if(offset)wbf(ii);
-       }
-       if(offset){
-               wbfl();
-               offset = savoff;
-               wbt(0);
-       }
-       copyf--;
-       return(req);
-}
-copys()
-{
-       register i;
-
-       copyf++;
-       if(skip())goto c0;
-       if(((i=getch()) & CMASK) != '"')wbf(i);
-       while(((i=getch()) & CMASK) != '\n')wbf(i);
-c0:
-       wbt(0);
-       copyf--;
-}
-filep alloc()
-{
-       register i;
-       extern filep boff();
-       filep j;
-
-       for(i=0;i<NBLIST;i++){
-               if(blist[i] == 0)break;
-       }
-       if(i==NBLIST){
-               j = 0;
-       }else{
-               blist[i] = -1;
-               if((j = boff(i)) < NEV*EVS)j = 0;
-       }
-       return(nextb = j);
-}
-ffree(i)
-filep i;
-{
-       register j;
-
-       while((blist[j = blisti(i)]) != -1){
-               i = ((filep)blist[j])<<BLKBITS;
-               blist[j] = 0;
-       }
-       blist[j] = 0;
-}
-filep boff(i)
-int i;
-{
-       return(((filep)i)*BLK + NEV*EVS);
-}
-wbt(i)
-int i;
-{
-       wbf(i);
-       wbfl();
-}
-wbf(i)
-int i;
-{
-       register j;
-
-       if(!offset)return;
-       if(!woff){
-               woff = offset;
-               wbfi = 0;
-       }
-       wbuf[wbfi++] = i;
-       if(!((++offset) & (BLK-1))){
-               wbfl();
-               if(blist[j = blisti(--offset)] == -1){
-                       if(alloc() == 0){
-                               prstr("Out of temp file space.\n");
-                               done2(01);
-                       }
-                       blist[j] = (unsigned)(nextb>>BLKBITS);
-               }
-               offset = ((filep)blist[j])<<BLKBITS;
-       }
-       if(wbfi >= BLK)wbfl();
-}
-wbfl(){
-       if(woff == 0)return;
-       lseek(ibf, ((long)woff) * sizeof(int), 0);
-       write(ibf, (char *)wbuf, wbfi * sizeof(int));
-       if((woff & (~(BLK-1))) == (roff & (~(BLK-1))))roff = -1;
-       woff = 0;
-}
-blisti(i)
-filep i;
-{
-       return((i-NEV*EVS)/(BLK));
-}
-rbf(){
-       register i;
-       extern filep incoff();
-
-       if((i=rbf0(ip)) == 0){
-               if(!app)i = popi();
-       }else{
-               ip = incoff(ip);
-       }
-       return(i);
-}
-rbf0(p)
-filep p;
-{
-       register filep i;
-
-       if((i = (p & (~(BLK-1)))) != roff){
-               roff = i;
-               lseek(ibf, ((long)roff) * sizeof(int), 0);
-               if(read(ibf, (char *)rbuf, BLK * sizeof(int)) == 0)return(0);
-       }
-       return(rbuf[p & (BLK-1)]);
-}
-filep incoff(p)
-filep p;
-{
-       register i;
-       register filep j;
-       if(!((j = (++p)) & (BLK-1))){
-               if((i = blist[blisti(--p)]) == -1){
-                       prstr("Bad storage allocation.\n");
-                       done2(-5);
-               }
-               j = ((filep)i)<<BLKBITS;
-       }
-       return(j);
-}
-popi(){
-       register struct s *p;
-
-       if(frame == stk)return(0);
-       if(strflg)strflg--;
-       p = nxf = frame;
-       p->nargs = 0;
-       frame = p->pframe;
-       ip = p->pip;
-       nchar = p->pnchar;
-       rchar = p->prchar;
-       pendt = p->ppendt;
-       ap = p->pap;
-       cp = p->pcp;
-       ch0 = p->pch0;
-       return(p->pch);
-}
-pushi(newip)
-filep newip;
-{
-       register struct s *p;
-       extern char *setbrk();
-
-       if((enda - sizeof(struct s)) < (char *)nxf)setbrk(DELTA);
-       p = nxf;
-       p->pframe = frame;
-       p->pip = ip;
-       p->pnchar = nchar;
-       p->prchar = rchar;
-       p->ppendt = pendt;
-       p->pap = ap;
-       p->pcp = cp;
-       p->pch0 = ch0;
-       p->pch = ch;
-       cp = ap = 0;
-       nchar = rchar = pendt = ch0 = ch = 0;
-       frame = nxf;
-       if(nxf->nargs == 0) nxf += 1;
-               else nxf = (struct s *)argtop;
-       return(ip = newip);
-}
-char *setbrk(x)
-int x;
-{
-       register char *i;
-       char *sbrk();
-
-       if((i = sbrk(x)) == MAXPTR){
-               prstrfl("Core limit reached.\n");
-               edone(0100);
-       }else{
-               enda = i + x;
-       }
-       return(i);
-}
-getsn(){
-       register i;
-
-       if((i=getach()) == 0)return(0);
-       if(i == '(')return(getrq());
-               else return(i);
-}
-setstr(){
-       register i;
-
-       lgf++;
-       if(((i=getsn()) == 0) ||
-          ((i=findmn(i)) == -1) ||
-          !(contab[i].rq & MMASK)){
-               lgf--;
-               return(0);
-       }else{
-               if((enda-2) < (char *)nxf)setbrk(DELTA);
-               nxf->nargs = 0;
-               strflg++;
-               lgf--;
-               return(pushi(((filep)contab[i].x.mx)<<BLKBITS));
-       }
-}
-collect()
-{
-       register i;
-       register int *strp;
-       int *lim;
-       int **argpp, **argppend;
-       int quote;
-       struct s *savnxf;
-
-       copyf++;
-       nxf->nargs = 0;
-       savnxf = nxf;
-       if(skip())goto rtn;
-       lim = (int *)(nxf = savnxf + sizeof(struct s)/sizeof(savnxf));
-       strflg = 0;
-       if((argppend =
-               (argpp = (int **)savnxf+(sizeof(struct s)/sizeof(int **))) + (sizeof(struct s)-1))
-               > (int **)enda)setbrk(DELTA);
-       strp = (int *)argppend;
-       for(i=8; i>=0; i--)argpp[i] = 0;
-       while((argpp != argppend) && (!skip())){
-               *argpp++ = strp;
-               quote = 0;
-               if(((i = getch()) & CMASK) == '"')quote++;
-                       else ch = i;
-               while(1){
-                       i = getch();
-                       if( nlflg ||
-                         ((!quote) && ((i & CMASK) == ' ')))break;
-                       if(quote && ((i & CMASK) == '"') &&
-                         (((i=getch()) & CMASK) != '"')){
-                               ch = i;
-                               break;
-                       }
-                       *strp++ = i;
-                       if(strflg && (strp >= lim)){
-                               prstrfl("Macro argument too long.\n");
-                               copyf--;
-                               edone(004);
-                       }
-                       if((enda-4) <= (char *)strp)setbrk(DELTA);
-               }
-               *strp++ = 0;
-       }
-       nxf = savnxf;
-       nxf->nargs = argpp -(int **)(nxf + 1);
-       argtop = strp;
-rtn:
-       copyf--;
-}
-seta()
-{
-       register i;
-
-       if(((i = (getch() & CMASK) - '0') > 0) &&
-               (i <= 9) && (i <= frame->nargs))ap = *((int **)frame + i-1 + (sizeof(struct s)/sizeof(int **)));
-}
-caseda(){
-       app++;
-       casedi();
-}
-casedi(){
-       register i, j;
-       register *k;
-
-       lgf++;
-       if(skip() || ((i=getrq()) == 0)){
-               if(dip != d)wbt(0);
-               if(dilev > 0){
-                       v.dn = dip->dnl;
-                       v.dl = dip->maxl;
-                       dip = &d[--dilev];
-                       offset = dip->op;
-               }
-               goto rtn;
-       }
-       if(++dilev == NDI){
-               --dilev;
-               prstr("Cannot divert.\n");
-               edone(02);
-       }
-       if(dip != d)wbt(0);
-       diflg++;
-       dip = &d[dilev];
-       dip->op = finds(i);
-       dip->curd = i;
-       clrmn(oldmn);
-       k = (int *)&dip->dnl;
-       for(j=0; j<10; j++)k[j] = 0;    /*not op and curd*/
-rtn:
-       app = 0;
-       diflg = 0;
-}
-casedt(){
-       lgf++;
-       dip->dimac = dip->ditrap = dip->ditf = 0;
-       skip();
-       dip->ditrap = vnumb((int *)0);
-       if(nonumb)return;
-       skip();
-       dip->dimac = getrq();
-}
-casetl(){
-       register i, j;
-       int w1, w2, w3, delim;
-       filep begin;
-       extern width(), pchar();
-
-       dip->nls = 0;
-       skip();
-       if(dip != d)wbfl();
-       if((offset = begin = alloc()) == 0)return;
-       if((delim = getch()) & MOT){
-               ch = delim;
-               delim = '\'';
-       }else delim &= CMASK;
-       if(!nlflg)
-               while(((i = getch()) & CMASK) != '\n'){
-                       if((i & CMASK) == delim)i = IMP;
-                       wbf(i);
-               }
-       wbf(IMP);wbf(IMP);wbt(0);
-
-       w1 = hseg(width,begin);
-       w2 = hseg(width,(filep)0);
-       w3 = hseg(width,(filep)0);
-       offset = dip->op;
-#ifdef NROFF
-       if(!offset)horiz(po);
-#endif
-       hseg(pchar,begin);
-       if(w2 || w3)horiz(j=quant((lt - w2)/2-w1,HOR));
-       hseg(pchar,(filep)0);
-       if(w3){
-               horiz(lt-w1-w2-w3-j);
-               hseg(pchar,(filep)0);
-       }
-       newline(0);
-       if(dip != d){if(dip->dnl > dip->hnl)dip->hnl = dip->dnl;}
-       else{if(v.nl > dip->hnl)dip->hnl = v.nl;}
-       ffree(begin);
-}
-casepc(){
-       pagech = chget(IMP);
-}
-hseg(f,p)
-int (*f)();
-filep p;
-{
-       register acc, i;
-       static filep q;
-
-       acc = 0;
-       if(p)q = p;
-       while(1){
-               i = rbf0(q);
-               q = incoff(q);
-               if(!i || (i == IMP))return(acc);
-               if((i & CMASK) == pagech){
-                       nrbits = i & ~CMASK;
-                       nform = fmt[findr('%')];
-                       acc += fnumb(v.pn,f);
-               }else acc += (*f)(i);
-       }
-}
-casepm(){
-       register i, k;
-       register char *p;
-       int xx, cnt, kk, tot;
-       filep j;
-       char *kvt();
-       char pmline[10];
-
-       kk = cnt = 0;
-       tot = !skip();
-       for(i = 0; i<NM; i++){
-               if(!((xx = contab[i].rq) & MMASK))continue;
-               p = pmline;
-               j = (((filep)contab[i].x.mx)<<BLKBITS);
-               k = 1;
-               while((j = blist[blisti(j)]) != -1){k++; j <<= BLKBITS;}
-               cnt++;
-               kk += k;
-               if(!tot){
-                       *p++ = xx & 0177;
-                       if(!(*p++ = (xx >> BYTE) & 0177))*(p-1) = ' ';
-                       *p++ = ' ';
-                       kvt(k,p);
-                       prstr(pmline);
-               }
-       }
-       if(tot || (cnt > 1)){
-               kvt(kk,pmline);
-               prstr(pmline);
-       }
-}
-char *kvt(k,p)
-int k;
-char *p;
-{
-       if(k>=100)*p++ = k/100 + '0';
-       if(k>=10)*p++ = (k%100)/10 + '0';
-       *p++ = k%10 + '0';
-       *p++ = '\n';
-       *p = 0;
-       return(p);
-}
-dummy(){}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n4.c b/.ref-Research-V7/usr/src/cmd/troff/n4.c
deleted file mode 100644 (file)
index 83dcd4a..0000000
+++ /dev/null
@@ -1,526 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-#include "s.h"
-/*
-troff4.c
-
-number registers, conversion, arithmetic
-*/
-
-extern struct s *frame;
-
-extern int ascii;
-extern int cbuf[NC];
-extern int *cp;
-extern int r[NN];
-extern int *vlist;
-extern int inc[NN];
-extern int fmt[NN];
-extern int ch;
-extern int lgf;
-extern int pl;
-extern int lastl;
-extern int ralss;
-extern int totout;
-extern int nrbits;
-extern int nonumb;
-extern int vflag;
-extern int noscale;
-extern int dfact;
-extern int dfactd;
-extern int po;
-extern int nform;
-extern int ll;
-extern int in;
-extern int font;
-extern int bdtab[];
-extern int lss;
-extern int pts;
-extern int fi;
-extern int res;
-extern int cwidth;
-extern int dotT;
-extern int ev;
-extern int ne;
-extern int ad, admod;
-extern int print;
-extern int ls;
-extern int nel, un;
-extern int xxx;
-int regcnt = NNAMES;
-
-setn()
-{
-       register i,j;
-       int f;
-
-       f = nform = 0;
-       if((i=getch() & CMASK) == '+')f = 1;
-               else if(i == '-')f = -1;
-                       else ch = i;
-       if((i=getsn()) == 0)return;
-       if((i & 0177) == '.')switch(i>>BYTE){
-               case 's': i = pts & 077;        break;
-               case 'v': i = lss;              break;
-               case 'f': i = font + 1; break;
-               case 'p': i = pl;               break;
-               case 't':  i = findt1();        break;
-               case 'o': i = po;               break;
-               case 'l': i = ll;               break;
-               case 'i': i = in;               break;
-               case '$': i = frame->nargs;             break;
-               case 'A': i = ascii;            break;
-               case 'c': i = v.cd;             break;
-               case 'n': i = lastl;            break;
-               case 'a': i = ralss;            break;
-               case 'h': i = dip->hnl; break;
-               case 'd':
-                       if(dip != d)i = dip->dnl; else i = v.nl;
-                       break;
-               case 'u': i = fi;               break;
-               case 'j': i = ad + 2*admod;     break;
-               case 'w': i = cwidth;           break;
-               case 'x': i = nel;      break;
-               case 'y': i = un;               break;
-               case 'T': i = dotT;             break; /*-Tterm used in nroff*/
-               case 'V': i = VERT;             break;
-               case 'H': i = HOR;              break;
-               case 'k': i = ne;               break;
-               case 'P': i = print;            break;
-               case 'L': i = ls;               break;
-               case 'R': i = NN - regcnt;      break;
-               case 'z': i = dip->curd;
-                       cbuf[0] = i & BMASK;
-                       cbuf[1] = (i >> BYTE) & BMASK;
-                       cbuf[2] = 0;
-                       cp = cbuf;
-                       return;
-#ifndef NROFF
-               case 'b': i = bdtab[font];              break;
-#endif
-
-               default:
-                       goto s0;
-       }
-       else{
-s0:
-               if((j=findr(i)) == -1)i = 0;
-               else{
-                       i = (vlist[j] = (vlist[j] + inc[j]*f));
-                       nform = fmt[j];
-               }
-       }
-       setn1(i);
-       cp = cbuf;
-}
-setn1(i)
-int i;
-{
-       extern int wrc();
-
-       cp = cbuf;
-       nrbits = 0;
-       fnumb(i,wrc);
-       *cp = 0;
-       cp = cbuf;
-}
-findr(i)
-int i;
-{
-       register j;
-       static int numerr;
-
-       if(i == 0)return(-1);
-       for(j=0;j<NN;j++){
-               if(i == r[j])break;
-       }
-       if(j != NN)return(j);
-       for(j=0; j<NN; j++){
-               if(r[j] == 0){
-                       r[j] = i;
-                       regcnt++;
-                       break;
-               }
-       }
-       if(j==NN){
-               if(!numerr)prstrfl("Too many number registers.\n");
-               if(++numerr > 1)done2(04); else edone(04);
-       }
-       return(j);
-}
-fnumb(i,f)
-int i, (*f)();
-{
-       register j;
-
-       j = 0;
-       if(i < 0){
-               j = (*f)('-' | nrbits);
-               i = -i;
-       }
-       switch(nform){
-               default:
-               case '1':
-               case 0: return(decml(i,f) + j);
-               case 'i':
-               case 'I': return(roman(i,f) + j);
-               case 'a':
-               case 'A': return(abc(i,f) + j);
-       }
-}
-decml(i,f)
-int i, (*f)();
-{
-       register j,k;
-
-       k = 0;
-       nform--;
-       if((j=i/10) || (nform > 0))k = decml(j,f);
-       return(k + (*f)((i%10 + '0') | nrbits));
-}
-roman(i,f)
-int i, (*f)();
-{
-
-       if(!i)return((*f)('0' | nrbits));
-       if(nform == 'i')return(roman0(i,f,"ixcmz","vldw"));
-       else return(roman0(i,f,"IXCMZ","VLDW"));
-}
-roman0(i,f,onesp,fivesp)
-int i, (*f)();
-char *onesp, *fivesp;
-{
-       register q, rem, k;
-
-       k = 0;
-       if(!i)return(0);
-       k = roman0(i/10,f,onesp+1,fivesp+1);
-       q = (i=i%10)/5;
-       rem = i%5;
-       if(rem == 4){
-               k += (*f)(*onesp | nrbits);
-               if(q)i = *(onesp+1);
-                       else i = *fivesp;
-               return(k += (*f)(i | nrbits));
-       }
-       if(q)k += (*f)(*fivesp | nrbits);
-       while(--rem >= 0)
-               k += (*f)(*onesp | nrbits);
-       return(k);
-}
-abc(i,f)
-int i, (*f)();
-{
-       if(!i)return((*f)('0' | nrbits));
-       else return(abc0(i-1,f));
-}
-abc0(i,f)
-int i, (*f)();
-{
-       register j, k;
-
-       k = 0;
-       if(j=i/26)k = abc0(j-1,f);
-       return(k + (*f)((i%26 + nform) | nrbits));
-}
-wrc(i)
-int i;
-{
-       if(cp >= &cbuf[NC])return(0);
-       *cp++ = i;
-       return(1);
-}
-atoi(){
-       extern long atoi0();
-
-       return((int)atoi0());
-}
-long atoi0()
-{
-       register ii, k, cnt;
-       long i, acc;
-       extern long ckph();
-
-       i = 0; acc = 0;
-       nonumb = 0;
-       cnt = -1;
-a0:
-       cnt++;
-       switch((ii=getch()) & CMASK){
-               default:
-                       ch = ii;
-                       if(cnt)break;
-               case '+':
-                       i = ckph();
-                       if(nonumb)break;
-                       acc += i;
-                       goto a0;
-               case '-':
-                       i = ckph();
-                       if(nonumb)break;
-                       acc -= i;
-                       goto a0;
-               case '*':
-                       i = ckph();
-                       if(nonumb)break;
-                       acc *= i;
-                       goto a0;
-               case '/':
-                       i = ckph();
-                       if(nonumb)break;
-                       if(i == 0){
-                               prstrfl("Divide by zero.\n");
-                               acc = 0;
-                       }else acc /= i;
-                       goto a0;
-               case '%':
-                       i = ckph();
-                       if(nonumb)break;
-                       acc %= i;
-                       goto a0;
-               case '&':       /*and*/
-                       i = ckph();
-                       if(nonumb)break;
-                       if((acc > 0) && (i > 0))acc = 1; else acc = 0;
-                       goto a0;
-               case ':':       /*or*/
-                       i = ckph();
-                       if(nonumb)break;
-                       if((acc > 0) || (i > 0))acc = 1; else acc = 0;
-                       goto a0;
-               case '=':
-                       if(((ii=getch()) & CMASK) != '=')ch = ii;
-                       i = ckph();
-                       if(nonumb){acc = 0; break;}
-                       if(i == acc)acc = 1;
-                       else acc = 0;
-                       goto a0;
-               case '>':
-                       k = 0;
-                       if(((ii=getch()) & CMASK) == '=')k++; else ch =ii;
-                       i = ckph();
-                       if(nonumb){acc = 0; break;}
-                       if(acc > (i - k))acc = 1; else acc = 0;
-                       goto a0;
-               case '<':
-                       k = 0;
-                       if(((ii=getch()) & CMASK) == '=')k++; else ch =ii;
-                       i = ckph();
-                       if(nonumb){acc = 0; break;}
-                       if(acc < (i + k))acc = 1; else acc = 0;
-                       goto a0;
-               case ')': break;
-               case '(':
-                       acc = atoi0();
-                       goto a0;
-       }
-       return(acc);
-}
-long ckph(){
-       register i;
-       long j;
-       extern long atoi0();
-       extern long atoi1();
-
-       if(((i = getch()) & CMASK) == '(')j = atoi0();
-       else{
-               ch = i;
-               j = atoi1();
-       }
-       return(j);
-}
-long atoi1()
-{
-       register i, j, digits;
-       long acc;
-       int neg, abs, field;
-
-       neg = abs = field = digits = 0;
-       acc = 0;
-a0:
-       switch((i = getch()) & CMASK){
-               default:
-                       ch = i;
-                       break;
-               case '+':
-                       goto a0;
-               case '-':
-                       neg = 1;
-                       goto a0;
-               case '|':
-                       abs = 1 + neg;
-                       neg = 0;
-                       goto a0;
-       }
-a1:
-       while(((j = ((i = getch()) & CMASK) - '0') >= 0) && (j <= 9)){
-               field++;
-               digits++;
-               acc = 10*acc + j;
-       }
-       if((i & CMASK) == '.'){
-               field++;
-               digits = 0;
-               goto a1;
-       }
-       ch = i;
-       if(!field)goto a2;
-       switch((i = getch()) & CMASK){
-               case 'u':
-                       i = j = 1;
-                       break;
-               case 'v':       /*VSs - vert spacing*/
-                       j = lss;
-                       i = 1;
-                       break;
-               case 'm':       /*Ems*/
-                       j = EM;
-                       i = 1;
-                       break;
-               case 'n':       /*Ens*/
-                       j = EM;
-#ifndef NROFF
-                       i = 2;
-#endif
-#ifdef NROFF
-                       i = 1;  /*Same as Ems in NROFF*/
-#endif
-                       break;
-               case 'p':       /*Points*/
-                       j = INCH;
-                       i = 72;
-                       break;
-               case 'i':       /*Inches*/
-                       j = INCH;
-                       i = 1;
-                       break;
-               case 'c':       /*Centimeters*/
-                       j = INCH*50;
-                       i = 127;
-                       break;
-               case 'P':       /*Picas*/
-                       j = INCH;
-                       i = 6;
-                       break;
-               default:
-                       j = dfact;
-                       ch = i;
-                       i = dfactd;
-       }
-       if(neg) acc = -acc;
-       if(!noscale){
-               acc = (acc*j)/i;
-       }
-       if((field != digits) && (digits > 0))while(digits--)acc /= 10;
-       if(abs){
-               if(dip != d)j = dip->dnl; else j = v.nl;
-               if(!vflag)j = v.hp;
-               if(abs == 2)j = -j;
-               acc -= j;
-       }
-a2:
-       nonumb = !field;
-       return(acc);
-}
-caserr(){
-       register i,j;
-
-       lgf++;
-       while(!skip() && (i=getrq()) ){
-               for(j=NNAMES; j<NN; j++){  /*NNAMES predefined names*/
-                       if(i == r[j])break;
-               }
-               if(j!=NN){
-                       r[j]=vlist[j]=inc[j]=fmt[j]=0;
-                       regcnt--;
-               }
-       }
-}
-casenr(){
-       register i, j;
-
-       lgf++;
-       skip();
-       if((i = findr(getrq())) == -1)goto rtn;
-       skip();
-       j = inumb(&vlist[i]);
-       if(nonumb)goto rtn;
-       vlist[i] = j;
-       skip();
-       j = atoi();
-       if(nonumb)goto rtn;
-       inc[i] = j;
-rtn:
-       return;
-}
-caseaf(){
-       register i, j, k;
-
-       lgf++;
-       if(skip() || !(i = getrq()) || skip())return;
-       k = 0;
-       if(!alph(j=getch())){
-               ch = j;
-               while(((j = getch() & CMASK) >= '0') &&
-                       (j <= '9'))k++;
-       }
-       if(!k)k=j;
-       fmt[findr(i)] = k & BMASK;
-}
-vnumb(i)
-int *i;
-{
-       vflag++;
-       dfact = lss;
-       res = VERT;
-       return(inumb(i));
-}
-hnumb(i)
-int *i;
-{
-       dfact = EM;
-       res = HOR;
-       return(inumb(i));
-}
-inumb(n)
-int *n;
-{
-       register i, j, f;
-
-       f = 0;
-       if(n){
-       if((j = (i = getch()) & CMASK) == '+')f = 1;
-               else if(j == '-')f = -1;
-                       else ch = i;
-       }
-       i = atoi();
-       if(n && f)i = *n + f*i;
-       i = quant(i,res);
-       vflag = 0;
-       res = dfactd = dfact = 1;
-       if(nonumb)i = 0;
-       return(i);
-}
-quant(n,m)
-int n, m;
-{
-       register i, neg;
-
-       neg = 0;
-       if(n<0){
-               neg++;
-               n = -n;
-       }
-       i = n/m;
-       if((n - m*i) > (m/2))i += 1;
-       i *= m;
-       if(neg)i = -i;
-       return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n5.c b/.ref-Research-V7/usr/src/cmd/troff/n5.c
deleted file mode 100644 (file)
index 7b2ad17..0000000
+++ /dev/null
@@ -1,815 +0,0 @@
-#include "tdef.h"
-#include <sgtty.h>
-extern
-#include "d.h"
-extern
-#include "v.h"
-#include "s.h"
-
-/*
-troff5.c
-
-misc processing requests
-*/
-
-extern struct s *frame;
-extern struct s *litlev;
-extern filep ip;
-extern filep offset;
-
-extern int ascii;
-extern int nonumb;
-extern int admod;
-extern int ad;
-extern int fi;
-extern int cc;
-extern int c2;
-extern int ohc;
-extern int tabc;
-extern int dotc;
-extern int pendnf;
-extern int hyf;
-extern int ce;
-extern int po;
-extern int po1;
-extern int nc;
-extern int in;
-extern int un;
-extern int un1;
-extern int in1;
-extern int ll;
-extern int ll1;
-extern int lt;
-extern int lt1;
-extern int nlist[NTRAP];
-extern int mlist[NTRAP];
-extern int lgf;
-extern int pl;
-extern int npn;
-extern int npnflg;
-extern int copyf;
-extern char nextf[];
-extern int trap;
-extern int lss;
-extern int em;
-extern int evlist[EVLSZ];
-extern int evi;
-extern int ibf;
-extern int ev;
-extern int ch;
-extern int nflush;
-extern int tty;
-extern struct sgttyb ttys;
-extern int quiet;
-extern int iflg;
-extern int eschar;
-extern int lit;
-extern int ls;
-extern int ls1;
-extern int tabtab[];
-extern char trtab[];
-extern int ul;
-extern int cu;
-extern int sfont;
-extern int font;
-extern int fontlab[];
-extern int it;
-extern int itmac;
-extern int noscale;
-extern int ic;
-extern int icf;
-extern int ics;
-extern int *vlist;
-extern int sv;
-extern int esc;
-extern int nn;
-extern int nms;
-extern int ndf;
-extern int lnmod;
-extern int ni;
-extern int lnsize;
-extern int nb;
-extern int nlflg;
-extern int apts, apts1, pts, pts1, font, font1;
-extern int ulfont;
-extern int ulbit;
-extern int error;
-extern int nmbits;
-extern int chbits;
-extern int tdelim;
-extern int xxx;
-int iflist[NIF];
-int ifx;
-
-casead(){
-       register i;
-
-       ad = 1;
-       /*leave admod alone*/
-       if(skip())return;
-       switch(i = getch() & CMASK){
-               case 'r':       /*right adj, left ragged*/
-                       admod = 2;
-                       break;
-               case 'l':       /*left adj, right ragged*/
-                       admod = ad = 0; /*same as casena*/
-                       break;
-               case 'c':       /*centered adj*/
-                       admod = 1;
-                       break;
-               case 'b': case 'n':
-                       admod = 0;
-                       break;
-               case '0': case '2': case '4':
-                       ad = 0;
-               case '1': case '3': case '5':
-                       admod = (i - '0')/2;
-       }
-}
-casena(){
-       ad = 0;
-}
-casefi(){
-       tbreak();
-       fi++;
-       pendnf = 0;
-       lnsize = LNSIZE;
-}
-casenf(){
-       tbreak();
-       fi = 0;
-/* can't do while oline is only LNSIZE
-       lnsize = LNSIZE + WDSIZE;
-*/
-}
-casers(){
-       dip->nls = 0;
-}
-casens(){
-       dip->nls++;
-}
-chget(c)
-int c;
-{
-       register i;
-
-       if(skip() ||
-         ((i = getch()) & MOT) ||
-         ((i&CMASK) == ' ') ||
-         ((i&CMASK) == '\n')){
-               ch = i;
-               return(c);
-       }else return(i & BMASK);
-}
-casecc(){
-       cc = chget('.');
-}
-casec2(){
-       c2 = chget('\'');
-}
-casehc(){
-       ohc = chget(OHC);
-}
-casetc(){
-       tabc = chget(0);
-}
-caselc(){
-       dotc = chget(0);
-}
-casehy(){
-       register i;
-
-       hyf = 1;
-       if(skip())return;
-       noscale++;
-       i = atoi();
-       noscale = 0;
-       if(nonumb)return;
-       hyf = max(i,0);
-}
-casenh(){
-       hyf = 0;
-}
-max(aa,bb)
-int aa,bb;
-{
-       if(aa>bb)return(aa);
-       else return(bb);
-}
-casece(){
-       register i;
-
-       noscale++;
-       skip();
-       i = max(atoi(),0);
-       if(nonumb)i = 1;
-       tbreak();
-       ce = i;
-       noscale = 0;
-}
-casein(){
-       register i;
-
-       if(skip())i = in1;
-       else i = max(hnumb(&in),0);
-       tbreak();
-       in1 = in;
-       in = i;
-       if(!nc){
-               un = in;
-               setnel();
-       }
-}
-casell(){
-       register i;
-
-       if(skip())i = ll1;
-       else i = max(hnumb(&ll),INCH/10);
-       ll1 = ll;
-       ll = i;
-       setnel();
-}
-caselt(){
-       register i;
-
-       if(skip())i = lt1;
-       else i = max(hnumb(&lt),0);
-       lt1 = lt;
-       lt = i;
-}
-caseti(){
-       register i;
-
-       if(skip())return;
-       i = max(hnumb(&in),0);
-       tbreak();
-       un1 = i;
-       setnel();
-}
-casels(){
-       register i;
-
-       noscale++;
-       if(skip())i = ls1;
-       else i = max(inumb(&ls),1);
-       ls1 = ls;
-       ls = i;
-       noscale = 0;
-}
-casepo(){
-       register i;
-
-       if(skip())i = po1;
-       else i = max(hnumb(&po),0);
-       po1 = po;
-       po = i;
-#ifndef NROFF
-       if(!ascii)esc += po - po1;
-#endif
-}
-casepl(){
-       register i;
-
-       skip();
-       if((i = vnumb(&pl)) == 0)pl = 11 * INCH; /*11in*/
-               else pl = i;
-       if(v.nl > pl)v.nl = pl;
-}
-casewh(){
-       register i, j, k;
-
-       lgf++;
-       skip();
-       i = vnumb((int *)0);
-       if(nonumb)return;
-       skip();
-       j = getrq();
-       if((k=findn(i)) != NTRAP){
-               mlist[k] = j;
-               return;
-       }
-       for(k=0; k<NTRAP; k++)if(mlist[k] == 0)break;
-       if(k == NTRAP){
-               prstrfl("Cannot plant trap.\n");
-               return;
-       }
-       mlist[k] = j;
-       nlist[k] = i;
-}
-casech(){
-       register i, j, k;
-
-       lgf++;
-       skip();
-       if(!(j=getrq()))return;
-               else for(k=0; k<NTRAP; k++)if(mlist[k] == j)break;
-       if(k == NTRAP)return;
-       skip();
-       i = vnumb((int *)0);
-       if(nonumb)mlist[k] = 0;
-       nlist[k] = i;
-}
-findn(i)
-int i;
-{
-       register k;
-
-       for(k=0; k<NTRAP; k++)
-               if((nlist[k] == i) && (mlist[k] != 0))break;
-       return(k);
-}
-casepn(){
-       register i;
-
-       skip();
-       noscale++;
-       i = max(inumb(&v.pn),0);
-       noscale = 0;
-       if(!nonumb){
-               npn = i;
-               npnflg++;
-       }
-}
-casebp(){
-       register i;
-       register struct s *savframe;
-
-       if(dip != d)return;
-       savframe = frame;
-       skip();
-       if((i = inumb(&v.pn)) < 0)i = 0;
-       tbreak();
-       if(!nonumb){
-               npn = i;
-               npnflg++;
-       }else if(dip->nls)return;
-       eject(savframe);
-}
-casetm(x) int x;{
-       register i;
-       char tmbuf[NTM];
-
-       lgf++;
-       copyf++;
-       if(skip() && x)prstrfl("User Abort.");
-       for(i=0; i<NTM-2;)if((tmbuf[i++]=getch()) == '\n')break;
-       if(i == NTM-2)tmbuf[i++] = '\n';
-       tmbuf[i] = 0;
-       prstrfl(tmbuf);
-       copyf--;
-}
-casesp(a)
-int a;
-{
-       register i, j, savlss;
-
-       tbreak();
-       if(dip->nls || trap)return;
-       i = findt1();
-       if(!a){
-               skip();
-               j = vnumb((int *)0);
-               if(nonumb)j = lss;
-       }else j = a;
-       if(j == 0)return;
-       if(i < j)j = i;
-       savlss = lss;
-       if(dip != d)i = dip->dnl; else i = v.nl;
-       if((i + j) < 0)j = -i;
-       lss = j;
-       newline(0);
-       lss = savlss;
-}
-casert(){
-       register a, *p;
-
-       skip();
-       if(dip != d)p = &dip->dnl; else p = &v.nl;
-       a = vnumb(p);
-       if(nonumb)a = dip->mkline;
-       if((a < 0) || (a >= *p))return;
-       nb++;
-       casesp(a - *p);
-}
-caseem(){
-       lgf++;
-       skip();
-       em = getrq();
-}
-casefl(){
-       tbreak();
-       flusho();
-}
-caseev(){
-       register nxev;
-       extern int block;
-
-       if(skip()){
-e0:
-               if(evi == 0)return;
-               nxev =  evlist[--evi];
-               goto e1;
-       }
-       noscale++;
-       nxev = atoi();
-       noscale = 0;
-       if(nonumb)goto e0;
-       flushi();
-       if((nxev >= NEV) || (nxev < 0) || (evi >= EVLSZ)){
-               prstrfl("Cannot do ev.\n");
-               if(error)done2(040);else edone(040);
-               return;
-       }
-       evlist[evi++] = ev;
-e1:
-       if(ev == nxev)return;
-       lseek(ibf, (long)(ev*EVS*sizeof(int)), 0);
-       write(ibf,(char *)&block, EVS*sizeof(int));
-       lseek(ibf, (long)(nxev*EVS*sizeof(int)), 0);
-       read(ibf,(char *)&block, EVS*sizeof(int));
-       ev = nxev;
-}
-caseel(){
-       if(--ifx < 0){
-               ifx = 0;
-               iflist[0] = 0;
-       }
-       caseif(2);
-}
-caseie(){
-       if(ifx >= NIF){
-               prstr("if-else overflow.\n");
-               ifx = 0;
-               edone(040);
-       }
-       caseif(1);
-       ifx++;
-}
-caseif(x)
-int x;
-{
-       register i, notflag, true;
-
-       if(x == 2){
-               notflag = 0;
-               true = iflist[ifx];
-               goto i1;
-       }
-       true = 0;
-       skip();
-       if(((i = getch()) & CMASK) == '!'){
-               notflag = 1;
-       }else{
-               notflag = 0;
-               ch = i;
-       }
-       i = atoi();
-       if(!nonumb){
-               if(i > 0)true++;
-               goto i1;
-       }
-       switch((i = getch()) & CMASK){
-               case 'e':
-                       if(!(v.pn & 01))true++;
-                       break;
-               case 'o':
-                       if(v.pn & 01)true++;
-                       break;
-#ifdef NROFF
-               case 'n':
-                       true++;
-               case 't':
-#endif
-#ifndef NROFF
-               case 't':
-                       true++;
-               case 'n':
-#endif
-               case ' ':
-                       break;
-               default:
-                       true = cmpstr(i);
-       }
-i1:
-       true ^= notflag;
-       if(x == 1)iflist[ifx] = !true;
-       if(true){
-       i2:
-               do{
-               v.hp = 0;
-               }
-               while(((i = getch()) & CMASK) == ' ');
-               if((i & CMASK) == LEFT)goto i2;
-               ch = i;
-               nflush++;
-       }else{
-               copyf++;
-               if(eat(LEFT) == LEFT){
-                       while(eatblk(RIGHT,LEFT) != RIGHT)nlflg = 0;
-               }
-               copyf--;
-       }
-}
-eatblk(right,left)
-int right,left;
-{
-       register i;
-
-e0:
-       while(((i = getch() & CMASK) != right) &&
-               (i != left) &&
-               (i != '\n'));
-       if(i == left){
-               while((i=eatblk(right,left)) != right)nlflg = 0;
-               goto e0;
-       }
-       return(i);
-}
-cmpstr(delim)
-int delim;
-{
-       register i, j;
-       register filep p;
-       extern filep alloc();
-       extern filep incoff();
-       filep begin;
-       int cnt, k;
-       int savapts, savapts1, savfont, savfont1,
-               savpts, savpts1;
-
-       if(delim & MOT)return(0);
-       delim &= CMASK;
-       if(dip != d)wbfl();
-       if((offset = begin = alloc()) == (filep)0)return(0);
-       cnt = 0;
-       v.hp = 0;
-       savapts = apts;
-       savapts1 = apts1;
-       savfont = font;
-       savfont1 = font1;
-       savpts = pts;
-       savpts1 = pts1;
-       while(((j = (i=getch()) & CMASK) != delim) && (j != '\n')){
-               wbf(i);
-               cnt++;
-       }
-       wbt(0);
-       k = !cnt;
-       if(nlflg)goto rtn;
-       p = begin;
-       apts = savapts;
-       apts1 = savapts1;
-       font = savfont;
-       font1 = savfont1;
-       pts = savpts;
-       pts1 = savpts1;
-       mchbits();
-       v.hp = 0;
-       while(((j = (i=getch()) & CMASK) != delim) && (j != '\n')){
-               if(rbf0(p) != i){
-                       eat(delim);
-                       k = 0;
-                       break;
-               }
-               p = incoff(p);
-               k = !(--cnt);
-       }
-rtn:
-       apts = savapts;
-       apts1 = savapts1;
-       font = savfont;
-       font1 = savfont1;
-       pts = savpts;
-       pts1 = savpts1;
-       mchbits();
-       offset = dip->op;
-       ffree(begin);
-       return(k);
-}
-caserd(){
-
-       lgf++;
-       skip();
-       getname();
-       if(!iflg){
-               if(quiet){
-                       ttys.sg_flags &= ~ECHO;
-                       stty(0, &ttys);
-                       prstrfl("\a"); /*bell*/
-               }else{
-                       if(nextf[0]){
-                               prstr(nextf);
-                               prstr(":");
-                       }else{
-                               prstr("\a"); /*bell*/
-                       }
-               }
-       }
-       collect();
-       tty++;
-       pushi((filep)-1);
-}
-rdtty(){
-       char onechar;
-
-       onechar = 0;
-       if(read(0, &onechar, 1) == 1){
-               if(onechar == '\n')tty++;
-                       else tty = 1;
-               if(tty != 3)return(onechar);
-       }
-       popi();
-       tty = 0;
-       if(quiet){
-               ttys.sg_flags |= ECHO;
-               stty(0, &ttys);
-       }
-       return(0);
-}
-caseec(){
-       eschar = chget('\\');
-}
-caseeo(){
-       eschar = 0;
-}
-caseli(){
-
-       skip();
-       lit = max(inumb((int *)0),1);
-       litlev = frame;
-       if((dip == d) && (v.nl == -1))newline(1);
-}
-caseta(){
-       register i;
-
-       tabtab[0] = nonumb = 0;
-       for(i=0; ((i < (NTAB-1)) && !nonumb); i++){
-               if(skip())break;
-               tabtab[i] = max(hnumb(&tabtab[max(i-1,0)]),0) & TMASK;
-               if(!nonumb) switch(ch & CMASK){
-                       case 'C':
-                               tabtab[i] |= CTAB;
-                               break;
-                       case 'R':
-                               tabtab[i] |= RTAB;
-                               break;
-                       default: /*includes L*/
-                               break;
-                       }
-               nonumb = ch = 0;
-       }
-       tabtab[i] = 0;
-}
-casene(){
-       register i, j;
-
-       skip();
-       i = vnumb((int *)0);
-       if(nonumb)i = lss;
-       if(i > (j = findt1())){
-               i = lss;
-               lss = j;
-               dip->nls = 0;
-               newline(0);
-               lss = i;
-       }
-}
-casetr(){
-       register i, j;
-
-       lgf++;
-       skip();
-       while((i = getch() & CMASK) != '\n'){
-               if((i & MOT) || ((j = getch()) & MOT))return;
-               if((j &= CMASK) == '\n')j = ' ';
-               trtab[i] = j;
-       }
-}
-casecu(){
-       cu++;
-       caseul();
-}
-caseul(){
-       register i;
-
-       noscale++;
-       if(skip())i = 1;
-       else i = atoi();
-       if(ul && (i == 0)){
-               font = sfont;
-               ul = cu = 0;
-       }
-       if(i){
-               if(!ul){
-                       sfont = font;
-                       font = ulfont;
-               }
-               ul = i;
-       }
-       noscale = 0;
-       mchbits();
-}
-caseuf(){
-       register i, j;
-
-       if(skip() || !(i = getrq()) || (i == 'S') ||
-               ((j = find(i,fontlab))  == -1))
-                       ulfont = 1; /*default position 2*/
-       else ulfont = j;
-#ifdef NROFF
-       if(ulfont == 0)ulfont = 1;
-#endif
-       ulbit = ulfont<<9;
-}
-caseit(){
-       register i;
-
-       lgf++;
-       it = itmac = 0;
-       noscale++;
-       skip();
-       i = atoi();
-       skip();
-       if(!nonumb && (itmac = getrq()))it = i;
-       noscale = 0;
-}
-casemc(){
-       register i;
-
-       if(icf > 1)ic = 0;
-       icf = 0;
-       if(skip())return;
-       ic = getch();
-       icf = 1;
-       skip();
-       i = max(hnumb((int *)0),0);
-       if(!nonumb)ics = i;
-}
-casemk(){
-       register i, j;
-
-       if(dip != d)j = dip->dnl; else j = v.nl;
-       if(skip()){
-               dip->mkline = j;
-               return;
-       }
-       if((i = getrq()) == 0)return;
-       vlist[findr(i)] = j;
-}
-casesv(){
-       register i;
-
-       skip();
-       if((i = vnumb((int *)0)) < 0)return;
-       if(nonumb)i = 1;
-       sv += i;
-       caseos();
-}
-caseos(){
-       register savlss;
-
-       if(sv <= findt1()){
-               savlss = lss;
-               lss = sv;
-               newline(0);
-               lss = savlss;
-               sv = 0;
-       }
-}
-casenm(){
-       register i;
-
-       lnmod = nn = 0;
-       if(skip())return;
-       lnmod++;
-       noscale++;
-       i = inumb(&v.ln);
-       if(!nonumb)v.ln = max(i,0);
-       getnm(&ndf,1);
-       getnm(&nms,0);
-       getnm(&ni,0);
-       noscale = 0;
-       nmbits = chbits;
-}
-getnm(p,min)
-int *p, min;
-{
-       register i;
-
-       eat(' ');
-       if(skip())return;
-       i = atoi();
-       if(nonumb)return;
-       *p = max(i,min);
-}
-casenn(){
-       noscale++;
-       skip();
-       nn = max(atoi(),1);
-       noscale = 0;
-}
-caseab(){
-       dummy();
-       casetm(1);
-       done2(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n6.c b/.ref-Research-V7/usr/src/cmd/troff/n6.c
deleted file mode 100644 (file)
index 31f5396..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-
-/*
-troff6.c
-
-width functions, sizes and fonts
-*/
-
-extern int eschar;
-extern int widthp;
-extern int ohc;
-extern int xfont;
-extern int smnt;
-extern int setwdf;
-extern char trtab[];
-extern int chbits;
-extern int nonumb;
-extern int noscale;
-extern int font;
-extern int font1;
-extern int pts;
-extern int sps;
-extern int nlflg;
-extern int nform;
-extern int dfact;
-extern int dfactd;
-extern int lss;
-extern int lss1;
-extern int vflag;
-extern int ch0;
-extern int level;
-extern int ch;
-extern int res;
-extern int xxx;
-int fontlab[] = {'R','I','B','S',0};
-
-width(c)
-int c;
-{
-       register i,j,k;
-
-       j = c;
-       k = 0;
-       if(j & MOT){
-               if(j & VMOT)goto rtn;
-               k = j & ~MOTV;
-               if(j & NMOT)k = -k;
-               goto rtn;
-       }
-       if((i = (j & CMASK)) == 010){
-               k = -widthp;
-               goto rtn;
-       }
-       if(i == PRESC)i = eschar;
-       if((i == ohc) ||
-          (i >= 0370))goto rtn;
-       if(j & ZBIT)goto rtn;
-       i = trtab[i] & BMASK;
-       if(i < 040)goto rtn;
-       k = (*(t.codetab[i-32]) & 0177) * t.Char;
-       widthp = k;
-rtn:
-       return(k);
-}
-setch(){
-       register i,*j,k;
-       extern int chtab[];
-
-       if((i = getrq()) == 0)return(0);
-       for(j=chtab;*j != i;j++)if(*(j++) == 0)return(0);
-       k = *(++j) | chbits;
-       return(k);
-}
-find(i,j)
-int i,j[];
-{
-       register k;
-
-       if(((k = i-'0') >= 1) && (k <= 4) && (k != smnt))return(--k);
-       for(k=0; j[k] != i; k++)if(j[k] == 0)return(-1);
-       return(k);
-}
-mchbits(){
-       chbits = (((pts)<<2) | font) << (BYTE + 1);
-       sps = width(' ' | chbits);
-}
-setps(){
-       register i,j;
-
-       if((((i=getch() & CMASK) == '+')  || (i == '-')) &&
-         (((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9))){
-               ch = 0;
-               return;
-       }
-       if((i -= '0') == 0){
-               return;
-       }
-       if((i > 0) && (i <= 9)){
-               if((i <= 3) &&
-                 ((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9)){
-                       i = 10*i +j;
-                       ch = 0;
-               }
-       }
-}
-caseft(){
-       skip();
-       setfont(1);
-}
-setfont(a)
-int a;
-{
-       register i,j;
-
-       if(a)i = getrq();
-               else i = getsn();
-       if(!i || (i == 'P')){
-               j = font1;
-               goto s0;
-       }
-       if(i == 'S')return;
-       if((j = find(i,fontlab))  == -1)return;
-s0:
-       font1 = font;
-       font = j;
-       mchbits();
-}
-setwd(){
-       register i, base, wid;
-       int delim, em, k;
-       int savlevel, savhp, savfont, savfont1;
-
-       base = v.st = v.sb = wid = v.ct = 0;
-       if((delim = getch() & CMASK) & MOT)return;
-       savhp = v.hp;
-       savlevel = level;
-       v.hp = level = 0;
-       savfont = font;
-       savfont1 = font1;
-       setwdf++;
-       while((((i = getch()) & CMASK) != delim) && !nlflg){
-               wid += width(i);
-               if(!(i & MOT)){
-                       em = 2*t.Halfline;
-               }else if(i & VMOT){
-                       k = i & ~MOTV;
-                       if(i & NMOT)k = -k;
-                       base -= k;
-                       em = 0;
-               }else continue;
-               if(base < v.sb)v.sb = base;
-               if((k=base + em) > v.st)v.st = k;
-       }
-       nform = 0;
-       setn1(wid);
-       v.hp = savhp;
-       level = savlevel;
-       font = savfont;
-       font1 = savfont1;
-       mchbits();
-       setwdf = 0;
-}
-vmot(){
-       dfact = lss;
-       vflag++;
-       return(mot());
-}
-hmot(){
-       dfact = EM;
-       return(mot());
-}
-mot(){
-       register i, j;
-
-       j = HOR;
-       getch(); /*eat delim*/
-       if(i = atoi()){
-               if(vflag)j = VERT;
-               i = makem(quant(i,j));
-       }
-       getch();
-       vflag = 0;
-       dfact = 1;
-       return(i);
-}
-sethl(k)
-int k;
-{
-       register i;
-
-       i = t.Halfline;
-       if(k == 'u')i = -i;
-       else if(k == 'r')i = -2*i;
-       vflag++;
-       i = makem(i);
-       vflag = 0;
-       return(i);
-}
-makem(i)
-int i;
-{
-       register j;
-
-       if((j = i) < 0)j = -j;
-       j = (j & ~MOTV) | MOT;
-       if(i < 0)j |= NMOT;
-       if(vflag)j |= VMOT;
-       return(j);
-}
-casefp(){
-       register i, j;
-
-       skip();
-       if(((i = (getch() & CMASK) - '0' -1) < 0) || (i >3))return;
-       if(skip() || !(j = getrq()))return;
-       fontlab[i] = j;
-}
-casevs(){
-       register i;
-
-       skip();
-       vflag++;
-       dfact = INCH; /*default scaling is points!*/
-       dfactd = 72;
-       res = VERT;
-       i = inumb(&lss);
-       if(nonumb)i = lss1;
-       if(i < VERT)i = VERT;
-       lss1 = lss;
-       lss = i;
-}
-xlss(){
-       register i, j;
-
-       getch();
-       dfact = lss;
-       i = quant(atoi(),VERT);
-       dfact = 1;
-       getch();
-       if((j = i) < 0)j = -j;
-       ch0 = ((j & 03700)<<3) | HX;
-       if(i < 0)ch0 |= 040000;
-       return(((j & 077)<<9) | LX);
-}
-casefz(){}
-caseps(){}
-caselg(){}
-casecs(){}
-casebd(){}
-casess(){}
-getlg(i)
-int i;
-{
-       return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n7.c b/.ref-Research-V7/usr/src/cmd/troff/n7.c
deleted file mode 100644 (file)
index 55eac20..0000000
+++ /dev/null
@@ -1,755 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-#include "s.h"
-#ifdef NROFF
-#define GETCH gettch
-#endif
-#ifndef NROFF
-#define GETCH getch
-#endif
-
-/*
-troff7.c
-
-text
-*/
-
-extern struct s *frame, *stk;
-extern struct s *ejl;
-
-extern int pl;
-extern int trap;
-extern int flss;
-extern int npnflg;
-extern int npn;
-extern int stop;
-extern int nflush;
-extern int ejf;
-extern int ascii;
-extern int donef;
-extern int nc;
-extern int wch;
-extern int dpn;
-extern int ndone;
-extern int lss;
-extern int pto;
-extern int pfrom;
-extern int print;
-extern int nlist[NTRAP];
-extern int mlist[NTRAP];
-extern int *pnp;
-extern int nb;
-extern int ic;
-extern int icf;
-extern int ics;
-extern int ne;
-extern int ll;
-extern int un;
-extern int un1;
-extern int in;
-extern int ls;
-extern int spread;
-extern int totout;
-extern int nwd;
-extern int *pendw;
-extern int *linep;
-extern int line[];
-extern int lastl;
-extern int ch;
-extern int ce;
-extern int fi;
-extern int nlflg;
-extern int pendt;
-extern int sps;
-extern int adsp;
-extern int pendnf;
-extern int over;
-extern int adrem;
-extern int nel;
-extern int ad;
-extern int ohc;
-extern int hyoff;
-extern int nhyp;
-extern int spflg;
-extern int word[];
-extern int *wordp;
-extern int wne;
-extern int chbits;
-extern int cwidth;
-extern int widthp;
-extern int hyf;
-extern int xbitf;
-extern int vflag;
-extern int ul;
-extern int cu;
-extern int font;
-extern int sfont;
-extern int it;
-extern int itmac;
-extern int *hyptr[NHYP];
-extern int **hyp;
-extern int *wdstart, *wdend;
-extern int lnmod;
-extern int admod;
-extern int nn;
-extern int nms;
-extern int ndf;
-extern int ni;
-extern int nform;
-extern int lnsize;
-extern int po;
-extern int ulbit;
-extern int *vlist;
-extern int nrbits;
-extern int nmbits;
-extern char trtab[];
-extern int xxx;
-int brflg;
-
-tbreak(){
-       register *i, j, pad;
-       int res;
-
-       trap = 0;
-       if(nb)return;
-       if((dip == d) && (v.nl == -1)){
-               newline(1);
-               return;
-       }
-       if(!nc){
-               setnel();
-               if(!wch)return;
-               if(pendw)getword(1);
-               movword();
-       }else if(pendw && !brflg){
-               getword(1);
-               movword();
-       }
-       *linep = dip->nls = 0;
-#ifdef NROFF
-       if(dip == d)horiz(po);
-#endif
-       if(lnmod)donum();
-       lastl = ne;
-       if(brflg != 1){
-               totout = 0;
-       }else if(ad){
-               if((lastl = (ll - un)) < ne)lastl = ne;
-       }
-       if(admod && ad && (brflg != 2)){
-               lastl = ne;
-               adsp = adrem = 0;
-#ifdef NROFF
-               if(admod == 1)un +=  quant(nel/2,t.Adj);
-#endif
-#ifndef NROFF
-               if(admod == 1)un += nel/2;
-#endif
-               else if(admod ==2)un += nel;
-       }
-       totout++;
-       brflg = 0;
-       if((lastl+un) > dip->maxl)dip->maxl = (lastl+un);
-       horiz(un);
-#ifdef NROFF
-       if(adrem%t.Adj)res = t.Hor; else res = t.Adj;
-#endif
-       for(i = line;nc > 0;){
-               if(((j = *i++) & CMASK) == ' '){
-                       pad = 0;
-                       do{
-                               pad += width(j);
-                               nc--;
-                         }while(((j = *i++) & CMASK) == ' ');
-                       i--;
-                       pad += adsp;
-                       --nwd;
-                       if(adrem){
-                               if(adrem < 0){
-#ifdef NROFF
-                                       pad -= res;
-                                       adrem += res;
-                               }else if((totout&01) ||
-                                       ((adrem/res)>=(nwd))){
-                                       pad += res;
-                                       adrem -= res;
-#endif
-#ifndef NROFF
-                                       pad--;
-                                       adrem++;
-                               }else{
-                                       pad++;
-                                       adrem--;
-#endif
-                               }
-                       }
-                       horiz(pad);
-               }else{
-                       pchar(j);
-                       nc--;
-               }
-       }
-       if(ic){
-               if((j = ll - un - lastl + ics) > 0)horiz(j);
-               pchar(ic);
-       }
-       if(icf)icf++;
-               else ic = 0;
-       ne = nwd = 0;
-       un = in;
-       setnel();
-       newline(0);
-       if(dip != d){if(dip->dnl > dip->hnl)dip->hnl = dip->dnl;}
-       else{if(v.nl > dip->hnl)dip->hnl = v.nl;}
-       for(j=ls-1; (j >0) && !trap; j--)newline(0);
-       spread = 0;
-}
-donum(){
-       register i, nw;
-       extern pchar();
-
-       nrbits = nmbits;
-       nw = width('1' | nrbits);
-       if(nn){
-               nn--;
-               goto d1;
-       }
-       if(v.ln%ndf){
-               v.ln++;
-       d1:
-               un += nw*(3+nms+ni);
-               return;
-       }
-       i = 0;
-       if(v.ln<100)i++;
-       if(v.ln<10)i++;
-       horiz(nw*(ni+i));
-       nform = 0;
-       fnumb(v.ln,pchar);
-       un += nw*nms;
-       v.ln++;
-}
-text(){
-       register i;
-       static int spcnt;
-
-       nflush++;
-       if((dip == d) && (v.nl == -1)){newline(1); return;}
-       setnel();
-       if(ce || !fi){
-               nofill();
-               return;
-       }
-       if(pendw)goto t4;
-       if(pendt)if(spcnt)goto t2; else goto t3;
-       pendt++;
-       if(spcnt)goto t2;
-       while(((i = GETCH()) & CMASK) == ' ')spcnt++;
-       if(nlflg){
-       t1:
-               nflush = pendt = ch = spcnt = 0;
-               callsp();
-               return;
-       }
-       ch = i;
-       if(spcnt){
-       t2:
-               tbreak();
-               if(nc || wch)goto rtn;
-               un += spcnt*sps;
-               spcnt = 0;
-               setnel();
-               if(trap)goto rtn;
-               if(nlflg)goto t1;
-       }
-t3:
-       if(spread)goto t5;
-       if(pendw || !wch)
-       t4:
-               if(getword(0))goto t6;
-       if(!movword())goto t3;
-t5:
-       if(nlflg)pendt = 0;
-       adsp = adrem = 0;
-       if(ad){
-/* jfr */      if (nwd==1) adsp=nel; else adsp=nel/(nwd-1);
-#ifdef NROFF
-               adsp = (adsp/t.Adj)*t.Adj;
-#endif
-               adrem = nel - adsp*(nwd-1);
-       }
-       brflg = 1;
-       tbreak();
-       spread = 0;
-       if(!trap)goto t3;
-       if(!nlflg)goto rtn;
-t6:
-       pendt = 0;
-       ckul();
-rtn:
-       nflush = 0;
-}
-nofill(){
-       register i, j;
-
-       if(!pendnf){
-               over = 0;
-               tbreak();
-               if(trap)goto rtn;
-               if(nlflg){
-                       ch = nflush = 0;
-                       callsp();
-                       return;
-               }
-               adsp = adrem = 0;
-               nwd = 10000;
-       }
-       while((j = ((i = GETCH()) & CMASK)) != '\n'){
-               if(j == ohc)continue;
-               if(j == CONT){
-                       pendnf++;
-                       nflush = 0;
-                       flushi();
-                       ckul();
-                       return;
-               }
-               storeline(i,-1);
-       }
-       if(ce){
-               ce--;
-               if((i=quant(nel/2,HOR)) > 0)un += i;
-       }
-       if(!nc)storeline(FILLER,0);
-       brflg = 2;
-       tbreak();
-       ckul();
-rtn:
-       pendnf = nflush = 0;
-}
-callsp(){
-       register i;
-
-       if(flss)i = flss; else i = lss;
-       flss = 0;
-       casesp(i);
-}
-ckul(){
-       if(ul && (--ul == 0)){
-                       cu = 0;
-                       font = sfont;
-                       mchbits();
-       }
-       if(it && (--it == 0) && itmac)control(itmac,0);
-}
-storeline(c,w){
-       register i;
-
-       if((c & CMASK) == JREG){
-               if((i=findr(c>>BYTE)) != -1)vlist[i] = ne;
-               return;
-       }
-       if(linep >= (line + lnsize - 1)){
-               if(!over){
-                       prstrfl("Line overflow.\n");
-                       over++;
-               c = 0343;
-               w = -1;
-               goto s1;
-               }
-               return;
-       }
-s1:
-       if(w == -1)w = width(c);
-       ne += w;
-       nel -= w;
-/*
- *     if( cu && !(c & MOT) && (trtab[(c & CMASK)] == ' '))
- *             c = ((c & ~ulbit) & ~CMASK) | '_';
- */
-       *linep++ = c;
-       nc++;
-}
-newline(a)
-int a;
-{
-       register i, j, nlss;
-       int opn;
-
-       if(a)goto nl1;
-       if(dip != d){
-               j = lss;
-               pchar1(FLSS);
-               if(flss)lss = flss;
-               i = lss + dip->blss;
-               dip->dnl += i;
-               pchar1(i);
-               pchar1('\n');
-               lss = j;
-               dip->blss = flss = 0;
-               if(dip->alss){
-                       pchar1(FLSS);
-                       pchar1(dip->alss);
-                       pchar1('\n');
-                       dip->dnl += dip->alss;
-                       dip->alss = 0;
-               }
-               if(dip->ditrap && !dip->ditf &&
-                       (dip->dnl >= dip->ditrap) && dip->dimac)
-                       if(control(dip->dimac,0)){trap++; dip->ditf++;}
-               return;
-       }
-       j = lss;
-       if(flss)lss = flss;
-       nlss = dip->alss + dip->blss + lss;
-       v.nl += nlss;
-#ifndef NROFF
-       if(ascii){dip->alss = dip->blss = 0;}
-#endif
-       pchar1('\n');
-       flss = 0;
-       lss = j;
-       if(v.nl < pl)goto nl2;
-nl1:
-       ejf = dip->hnl = v.nl = 0;
-       ejl = frame;
-       if(donef){
-               if((!nc && !wch) || ndone)done1(0);
-               ndone++;
-               donef = 0;
-               if(frame == stk)nflush++;
-       }
-       opn = v.pn;
-       v.pn++;
-       if(npnflg){
-               v.pn = npn;
-               npn = npnflg = 0;
-       }
-nlpn:
-       if(v.pn == pfrom){
-               print++;
-               pfrom = -1;
-       }else if(opn == pto){
-               print = 0;
-               opn = -1;
-               chkpn();
-               goto nlpn;
-               }
-       if(stop && print){
-               dpn++;
-               if(dpn >= stop){
-                       dpn = 0;
-                       dostop();
-               }
-       }
-nl2:
-       trap = 0;
-       if(v.nl == 0){
-               if((j = findn(0)) != NTRAP)
-                       trap = control(mlist[j],0);
-       } else if((i = findt(v.nl-nlss)) <= nlss){
-               if((j = findn1(v.nl-nlss+i)) == NTRAP){
-                       prstrfl("Trap botch.\n");
-                       done2(-5);
-               }
-               trap = control(mlist[j],0);
-       }
-}
-findn1(a)
-int a;
-{
-       register i, j;
-
-       for(i=0; i<NTRAP; i++){
-               if(mlist[i]){
-                       if((j = nlist[i]) < 0)j += pl;
-                       if(j == a)break;
-               }
-       }
-       return(i);
-}
-chkpn(){
-       pto = *(pnp++);
-       pfrom = pto & ~MOT;
-       if(pto == -1){
-               flusho();
-               done1(0);
-       }
-       if(pto & MOT){
-               pto &= ~MOT;
-               print++;
-               pfrom = 0;
-       }
-}
-findt(a)
-int a;
-{
-       register i, j, k;
-
-       k = 32767;
-       if(dip != d){
-               if(dip->dimac && ((i = dip->ditrap -a) > 0))k = i;
-               return(k);
-       }
-       for(i=0; i<NTRAP; i++){
-               if(mlist[i]){
-                       if((j = nlist[i]) < 0)j += pl;
-                       if((j -= a)  <=  0)continue;
-                       if(j < k)k = j;
-               }
-       }
-       i = pl - a;
-       if(k > i)k = i;
-       return(k);
-}
-findt1(){
-       register i;
-
-       if(dip != d)i = dip->dnl;
-               else i = v.nl;
-       return(findt(i));
-}
-eject(a)
-struct s *a;
-{
-       register savlss;
-
-       if(dip != d)return;
-       ejf++;
-       if(a)ejl = a;
-               else ejl = frame;
-       if(trap)return;
-e1:
-       savlss = lss;
-       lss = findt(v.nl);
-       newline(0);
-       lss = savlss;
-       if(v.nl && !trap)goto e1;
-}
-movword(){
-       register i, w, *wp;
-       int savwch, hys;
-
-       over = 0;
-       wp = wordp;
-       if(!nwd){
-               while(((i = *wp++) & CMASK) == ' '){
-                       wch--;
-                       wne -= width(i);
-               }
-               wp--;
-       }
-       if((wne > nel) &&
-          !hyoff && hyf &&
-          (!nwd || (nel > 3*sps)) &&
-          (!(hyf & 02) || (findt1() > lss))
-         )hyphen(wp);
-       savwch = wch;
-       hyp = hyptr;
-       nhyp = 0;
-       while(*hyp && (*hyp <= wp))hyp++;
-       while(wch){
-               if((hyoff != 1) && (*hyp == wp)){
-                       hyp++;
-                       if(!wdstart ||
-                          ((wp > (wdstart+1)) &&
-                           (wp < wdend) &&
-                           (!(hyf & 04) || (wp < (wdend-1))) &&
-                           (!(hyf & 010) || (wp > (wdstart+2)))
-                          )
-                         ){
-                               nhyp++;
-                               storeline(IMP,0);
-                       }
-               }
-               i = *wp++;
-               w = width(i);
-               wne -= w;
-               wch--;
-               storeline(i,w);
-       }
-       if(nel >= 0){
-               nwd++;
-               return(0);
-       }
-       xbitf = 1;
-       hys = width(0200); /*hyphen*/
-m1:
-       if(!nhyp){
-               if(!nwd)goto m3;
-               if(wch == savwch)goto m4;
-       }
-       if(*--linep != IMP)goto m5;
-       if(!(--nhyp))
-               if(!nwd)goto m2;
-       if(nel < hys){
-               nc--;
-               goto m1;
-       }
-m2:
-       if(((i = *(linep-1) & CMASK) != '-') &&
-          (i != 0203)
-         ){
-       *linep = (*(linep-1) & ~CMASK) | 0200;
-       w = width(*linep);
-       nel -= w;
-       ne += w;
-       linep++;
-/*
-       hsend();
-*/
-       }
-m3:
-       nwd++;
-m4:
-       wordp = wp;
-       return(1);
-m5:
-       nc--;
-       w = width(*linep);
-       ne -= w;
-       nel += w;
-       wne += w;
-       wch++;
-       wp--;
-       goto m1;
-}
-horiz(i)
-int i;
-{
-       vflag = 0;
-       if(i)pchar(makem(i));
-}
-setnel(){
-       if(!nc){
-               linep = line;
-               if(un1 >= 0){
-                       un = un1;
-                       un1 = -1;
-               }
-               nel = ll - un;
-               ne = adsp = adrem = 0;
-       }
-}
-getword(x)
-int x;
-{
-       register i, j, swp;
-       int noword;
-
-       noword = 0;
-       if(x)if(pendw){
-               *pendw = 0;
-               goto rtn;
-       }
-       if(wordp = pendw)goto g1;
-       hyp = hyptr;
-       wordp = word;
-       over = wne = wch = 0;
-       hyoff = 0;
-       while(1){
-               j = (i = GETCH()) & CMASK;
-               if(j == '\n'){
-                       wne = wch = 0;
-                       noword = 1;
-                       goto rtn;
-               }
-               if(j == ohc){
-                       hyoff = 1;
-                       continue;
-               }
-               if(j == ' '){
-                       storeword(i,cwidth);
-                       continue;
-               }
-               break;
-       }
-       swp = widthp;
-       storeword(' ' | chbits, -1);
-       if(spflg){
-               storeword(' ' | chbits, -1);
-               spflg = 0;
-       }
-       widthp = swp;
-g0:
-       if(j == CONT){
-               pendw = wordp;
-               nflush = 0;
-               flushi();
-               return(1);
-       }
-       if(hyoff != 1){
-               if(j == ohc){
-                       hyoff = 2;
-                       *hyp++ = wordp;
-                       if(hyp > (hyptr+NHYP-1))hyp = hyptr+NHYP-1;
-                       goto g1;
-               }
-               if((j == '-') ||
-                  (j == 0203) /*3/4 Em dash*/
-                 )if(wordp > word+1){
-                       hyoff = 2;
-                       *hyp++ = wordp + 1;
-                       if(hyp > (hyptr+NHYP-1))hyp = hyptr+NHYP-1;
-               }
-       }
-       storeword(i,cwidth);
-g1:
-       j = (i = GETCH()) & CMASK;
-       if(j != ' '){
-               if(j != '\n')goto g0;
-               j = *(wordp-1) & CMASK;
-               if((j == '.') ||
-                  (j == '!') ||
-                  (j == '?'))spflg++;
-       }
-       *wordp = 0;
-rtn:
-       wdstart = 0;
-       wordp = word;
-       pendw = 0;
-       *hyp++ = 0;
-       setnel();
-       return(noword);
-}
-storeword(c,w)
-int c, w;
-{
-
-       if(wordp >= &word[WDSIZE - 1]){
-               if(!over){
-                       prstrfl("Word overflow.\n");
-                       over++;
-                       c = 0343;
-                       w = -1;
-               goto s1;
-               }
-               return;
-       }
-s1:
-       if(w == -1)w = width(c);
-       wne += w;
-       *wordp++ = c;
-       wch++;
-}
-#ifdef NROFF
-extern char trtab[];
-gettch(){
-       register int i, j;
-
-       if(!((i = getch()) & MOT) && (i & ulbit)){
-               j = i&CMASK;
-               if(cu && (trtab[j] == ' '))
-                       i = ((i & ~ulbit)& ~CMASK) | '_';
-               if(!cu && (j>32) && (j<0370) && !(*t.codetab[j-32] & 0200))
-                       i &= ~ulbit;
-       }
-       return(i);
-}
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n8.c b/.ref-Research-V7/usr/src/cmd/troff/n8.c
deleted file mode 100644 (file)
index 6125ea0..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-#include "tdef.h"
-
-/*
-troff8.c
-
-hyphenation
-*/
-
-char hbuf[NHEX];
-char *nexth = hbuf;
-int *hyend;
-extern int *wdstart, *wdend;
-extern int *hyptr[];
-extern int **hyp;
-extern int hyoff;
-extern int noscale;
-extern int xxx;
-#define THRESH 160 /*digram goodness threshold*/
-int thresh = THRESH;
-
-hyphen(wp)
-int *wp;
-{
-       register *i, j;
-
-       i = wp;
-       while(punct(*i++))
-               ;
-       if (!alph(*--i))
-               return;
-       wdstart = i++;
-       while(alph(*i++))
-               ;
-       hyend = wdend = --i-1;
-       while(punct(*i++))
-               ;
-       if (*--i)
-               return;
-       if ((wdend-wdstart-4) < 0)
-               return;
-       hyp = hyptr;
-       *hyp = 0;
-       hyoff = 2;
-       if (!exword() && !suffix())
-               digram();
-       *hyp++ = 0;
-       if (*hyptr) for(j = 1; j;) {
-               j = 0;
-               for(hyp = hyptr+1; *hyp != 0; hyp++) {
-                       if (*(hyp-1) > *hyp) {
-                               j++;
-                               i = *hyp;
-                               *hyp = *(hyp-1);
-                               *(hyp-1) = i;
-                       }
-               }
-       }
-}
-
-punct(i)
-int i;
-{
-       if (!i || alph(i))
-               return(0);
-       else
-               return(1);
-}
-
-alph(i)
-int i;
-{
-       register j;
-
-       j = i & CMASK;
-       if (((j >= 'A') && (j <= 'Z')) || ((j >= 'a') && (j <= 'z')))
-               return(1);
-       else
-               return(0);
-}
-
-caseht()
-{
-       thresh = THRESH;
-       if (skip())
-               return;
-       noscale++;
-       thresh = atoi();
-       noscale = 0;
-}
-
-casehw()
-{
-       register i, k;
-       register char *j;
-
-       k = 0;
-       while(!skip()) {
-               if ((j = nexth) >= (hbuf + NHEX - 2))
-                       goto full;
-               for (;;) {
-                       if ((i = getch()) & MOT)
-                               continue;
-                       if (((i &= CMASK) == ' ') || (i == '\n')) {
-                               *j++ = 0;
-                               nexth = j;
-                               *j = 0;
-                               if (i == ' ')
-                                       break;
-                               else
-                                       return;
-                       }
-                       if (i == '-') {
-                               k = 0200;
-                               continue;
-                       }
-                       *j++ = maplow(i) | k;
-                       k = 0;
-                       if (j >= (hbuf + NHEX - 2))
-                               goto full;
-               }
-       }
-       return;
-full:
-       prstr("Exception word list full.\n");
-       *nexth = 0;
-}
-
-exword()
-{
-       register int *w;
-       register char *e;
-       char *save;
-
-       e = hbuf;
-       while(1) {
-               save = e;
-               if (*e == 0)return(0);
-               w = wdstart;
-               while((*e && (w <= hyend)) &&
-                     ((*e & 0177) == maplow(*w & CMASK))) {e++; w++;};
-               if (!*e) {
-                       if (((w-1) == hyend) ||
-                          ((w == wdend) && (maplow(*w & CMASK) == 's'))) {
-                               w = wdstart;
-                               for(e = save; *e; e++) {
-                                       if (*e & 0200)*hyp++ = w;
-                                       if (hyp > (hyptr+NHYP-1))
-                                               hyp = hyptr+NHYP-1;
-                                       w++;
-                               }
-                               return(1);
-                       }else{e++; continue;}
-               }else while(*e++);
-       }
-}
-
-suffix()
-{
-       register int *w;
-       register char *s, *s0;
-       int i;
-       extern char *suftab[];
-       extern int *chkvow();
-
-again:
-       if (!alph(i = *hyend & CMASK))
-               return(0);
-       if (i < 'a')
-               i -= 'A'-'a';
-       if ((s0 = suftab[i-'a']) == 0)
-               return(0);
-       for (;;) {
-               if ((i = *s0 & 017) == 0)
-                       return(0);
-               s = s0 + i - 1;
-               w = hyend - 1;
-               while(((s > s0) && (w >= wdstart)) &&
-                  ((*s & 0177) == maplow(*w))) {
-                       s--;
-                       w--;
-               }
-               if (s == s0)
-                       break;
-               s0 += i;
-       }
-       s = s0 + i - 1;
-       w = hyend;
-       if (*s0 & 0200) goto mark;
-       while(s > s0) {
-               w--;
-               if (*s-- & 0200) {
-       mark:
-                       hyend = w - 1;
-                       if (*s0 & 0100)
-                               continue;
-                       if (!chkvow(w))
-                               return(0);
-                       *hyp++ = w;
-               }
-       }
-       if (*s0 & 040)
-               return(0);
-       if (exword())
-               return(1);
-       goto again;
-}
-
-maplow(i)
-int i;
-{
-       if ((i &= CMASK) < 'a')i += 'a' - 'A';
-       return(i);
-}
-
-vowel(i)
-int i;
-{
-       switch(maplow(i)) {
-               case 'a':
-               case 'e':
-               case 'i':
-               case 'o':
-               case 'u':
-               case 'y':
-                       return(1);
-               default:
-                       return(0);
-       }
-}
-
-int *chkvow(w)
-int *w;
-{
-       while(--w >= wdstart)if(vowel(*w & CMASK))return(w);
-       return(0);
-}
-
-digram() {
-       register *w, val;
-       int *nhyend, *maxw, maxval;
-       extern char bxh[26][13], bxxh[26][13], xxh[26][13], xhx[26][13], hxx[26][13];
-
-again:
-       if (!(w=chkvow(hyend+1)))return;
-       hyend = w;
-       if (!(w=chkvow(hyend)))return;
-       nhyend = w;
-       maxval = 0;
-       w--;
-       while((++w < hyend) && (w < (wdend-1))) {
-               val = 1;
-               if (w == wdstart)val *= dilook('a',*w,bxh);
-               else if(w == wdstart+1)val *= dilook(*(w-1),*w,bxxh);
-               else val *= dilook(*(w-1),*w,xxh);
-               val *= dilook(*w, *(w+1), xhx);
-               val *= dilook(*(w+1), *(w+2), hxx);
-               if (val > maxval) {
-                       maxval = val;
-                       maxw = w + 1;
-               }
-       }
-       hyend = nhyend;
-       if (maxval > thresh)*hyp++ = maxw;
-       goto again;
-}
-
-dilook(a,b,t)
-int a, b;
-char t[26][13];
-{
-       register i, j;
-
-       i = t[maplow(a)-'a'][(j = maplow(b)-'a')/2];
-       if (!(j & 01))i >>= 4;
-       return(i & 017);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/n9.c b/.ref-Research-V7/usr/src/cmd/troff/n9.c
deleted file mode 100644 (file)
index 89e5211..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-#ifdef NROFF
-extern
-#include "tw.h"
-#endif
-/*
-troff9.c
-
-misc functions
-*/
-
-extern int cbuf[];
-extern int *cp;
-extern int ch;
-extern int chbits;
-extern int dfact;
-extern int vflag;
-extern int pts;
-extern int fc;
-extern int padc;
-extern int tabtab[];
-extern int nlflg;
-extern int lss;
-extern int tabch, ldrch;
-extern int tabc, dotc;
-extern int nchar, rchar;
-extern int xxx;
-
-setz(){
-       register i;
-
-       if(!((i = getch()) & MOT))i |= ZBIT;
-       return(i);
-}
-setline(){
-       register *i, length, c;
-       int w, cnt, delim, rem, temp;
-
-       if((delim = getch()) & MOT)return;
-               else delim &= CMASK;
-       vflag = 0;
-       dfact = EM;
-       length = quant(atoi(),HOR);
-       dfact = 1;
-       if(!length){
-               eat(delim);
-               return;
-       }
-s0:
-       if(((c = getch()) & CMASK) == delim){
-               ch = c;
-               c = 0204 | chbits;
-       }else if((c & CMASK) == FILLER)goto s0;
-       w = width(c);
-       i = cbuf;
-       if(length < 0){
-               *i++ = makem(length);
-               length = -length;
-       }
-       if(!(cnt = length/w)){
-               *i++ = makem(-(temp = ((w-length)/2)));
-               *i++ = c;
-               *i++ = makem(-(w - length - temp));
-               goto s1;
-       }
-       if(rem = length%w){
-               switch(c & CMASK){
-                       case 0204: /*rule*/
-                       case 0224: /*underrule*/
-                       case 0276: /*root en*/
-                               *i++ = c | ZBIT;
-                       default:
-                               *i++ = makem(rem);
-               }
-       }
-       if(cnt){
-               *i++ = RPT;
-               *i++ = cnt;
-               *i++ = c;
-       }
-s1:
-       *i++ = 0;
-       eat(delim);
-       cp = cbuf;
-}
-eat(c)
-int c;
-{
-       register i;
-
-       while(((i = getch() & CMASK) != c) &&
-               (i != '\n'));
-       return(i);
-}
-setov(){
-       register i, j, k;
-       int *p, delim, o[NOV], w[NOV];
-
-       if((delim = getch()) & MOT)return;
-               else delim &= CMASK;
-       for(k=0; (k<NOV) && ((j=(i = getch()) & CMASK) != delim) &&
-               (j != '\n'); k++){
-                       o[k] = i;
-                       w[k] = width(i);
-       }
-       o[k] = w[k] = 0;
-       if(o[0])for(j=1; j;){
-               j = 0;
-               for(k=1; o[k] ; k++){
-                       if(w[k-1] < w[k]){
-                               j++;
-                               i = w[k];
-                               w[k] = w[k-1];
-                               w[k-1] = i;
-                               i = o[k];
-                               o[k] = o[k-1];
-                               o[k-1] = i;
-                       }
-               }
-       }else return;
-       p = cbuf;
-       for(k=0; o[k]; k++){
-               *p++ = o[k];
-               *p++ = makem(-((w[k]+w[k+1])/2));
-       }
-       *p++ = makem(w[0]/2);
-       *p = 0;
-       cp = cbuf;
-}
-setbra(){
-       register i, *j, k;
-       int cnt, delim, dwn;
-
-       if((delim = getch()) & MOT)return;
-               else delim &= CMASK;
-       j = cbuf + 1;
-       cnt = 0;
-#ifdef NROFF
-       dwn = (2*t.Halfline) | MOT | VMOT;
-#endif
-#ifndef NROFF
-       dwn = EM | MOT | VMOT;
-#endif
-       while(((k = (i = getch()) & CMASK) != delim) && (k != '\n') &&
-               (j <= (cbuf+NC-4))){
-               *j++ = i | ZBIT;
-               *j++ = dwn;
-               cnt++;
-       }
-       if(--cnt < 0)return;
-               else if (!cnt){
-                       ch = *(j-2);
-                       return;
-       }
-       *j = 0;
-#ifdef NROFF
-       *--j = *cbuf = (cnt*t.Halfline) | MOT | NMOT | VMOT;
-#endif
-#ifndef NROFF
-       *--j = *cbuf = (cnt*EM)/2 | MOT | NMOT | VMOT;
-#endif
-       *--j &= ~ZBIT;
-       cp = cbuf;
-}
-setvline(){
-       register i, c, *k;
-       int cnt, neg, rem, ver, delim;
-
-       if((delim = getch()) & MOT)return;
-               else delim &= CMASK;
-       dfact = lss;
-       vflag++;
-       i = quant(atoi(),VERT);
-       dfact = 1;
-       if(!i){
-               eat(delim);
-               vflag = 0;
-               return;
-       }
-       if(((c = getch()) & CMASK) == delim){
-               c = 0337 | chbits;      /*default box rule*/
-       }else getch();
-       c |= ZBIT;
-       neg = 0;
-       if(i < 0){
-               i = -i;
-               neg = NMOT;
-       }
-#ifdef NROFF
-       ver = 2*t.Halfline;
-#endif
-#ifndef NROFF
-       ver = EM;
-#endif
-       cnt = i/ver;
-       rem = makem(i%ver) | neg;
-       ver = makem(ver) | neg;
-       k = cbuf;
-       if(!neg)*k++ = ver;
-       if(rem & ~MOTV){
-               *k++ = c;
-               *k++ = rem;
-       }
-       while((k < (cbuf+NC-3)) && cnt--){
-               *k++ = c;
-               *k++ = ver;
-       }
-       *(k-2) &= ~ZBIT;
-       if(!neg)k--;
-       *k = 0;
-       cp = cbuf;
-       vflag = 0;
-}
-casefc(){
-       register i;
-
-       fc = IMP;
-       padc = ' ';
-       if(skip() ||
-          ((i = getch()) & MOT) ||
-          ((i &= CMASK) == '\n'))return;
-       fc = i;
-       if(skip() || (ch & MOT) || ((ch &= CMASK) == fc))return;
-       padc = ch;
-}
-setfield(x)
-int x;
-{
-       register i, j, *fp;
-       int length, ws, npad, temp, type;
-       int **pp, *padptr[NPP];
-       static int fbuf[FBUFSZ];
-       int savfc, savtc, savlc;
-
-       if(x == tabch) rchar = tabc | chbits;
-       else if(x ==  ldrch) rchar = dotc | chbits;
-       temp = npad = ws = 0;
-       savfc = fc; savtc = tabch; savlc = ldrch;
-       tabch = ldrch = fc = IMP;
-       for(j=0;;j++){
-               if((tabtab[j] & TMASK)== 0){
-                       if(x==savfc)prstr("Zero field width.\n");
-                       j = 0;
-                       goto rtn;
-               }
-               if((length = ((tabtab[j] & TMASK) - v.hp)) > 0 )break;
-       }
-       type = tabtab[j] & (~TMASK);
-       fp = fbuf;
-       pp = padptr;
-       if(x == savfc){while(1){
-               if(((j = (i = getch()) & CMASK)) == padc){
-                       npad++;
-                       *pp++ = fp;
-                       if(pp > (padptr + NPP - 1))break;
-                       goto s1;
-               }else if(j == savfc) break;
-                       else if(j == '\n'){
-                               temp = j;
-                               nlflg = 0;
-                               break;
-                       }
-               ws += width(i);
-       s1:
-               *fp++ = i;
-               if(fp > (fbuf + FBUFSZ -3))break;
-       }
-       if(!npad){
-               npad++;
-               *pp++ = fp;
-               *fp++ = 0;
-       }
-       *fp++ = temp;
-       *fp++ = 0;
-       temp = i = (j = length-ws)/npad;
-       i = (i/HOR)*HOR;
-       if((j -= i*npad) <0)j = -j;
-       i = makem(i);
-       if(temp <0)i |= NMOT;
-       for(;npad > 0; npad--){
-               *(*--pp) = i;
-               if(j){
-                       j -= HOR;
-                       (*(*pp)) += HOR;
-               }
-       }
-       cp = fbuf;
-       j = 0;
-       }else if(type == 0){
-       /*plain tab or leader*/
-               if((j = width(rchar)) == 0)nchar = 0;
-               else{
-                       nchar = length /j;
-                       length %= j;
-               }
-               if(length)j = length | MOT;
-               else j = getch0();
-       }else{
-       /*center tab*/
-       /*right tab*/
-               while(((j = (i = getch()) & CMASK) != savtc) &&
-                       (j != '\n') && (j != savlc)){
-                       ws += width(i);
-                       *fp++ = i;
-                       if(fp > (fbuf +FBUFSZ - 3)) break;
-               }
-               *fp++ = i;
-               *fp++ = 0;
-               if(type == RTAB)length -= ws;
-               else length -= ws/2; /*CTAB*/
-               if(((j = width(rchar)) == 0) || (length <= 0))nchar = 0;
-               else{
-                       nchar = length/j;
-                       length %= j;
-               }
-               length = (length/HOR)*HOR;
-               j = makem(length);
-               cp = fbuf;
-               nlflg = 0;
-       }
-rtn:
-       fc = savfc; tabch = savtc; ldrch = savlc;
-       return(j);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/ni.c b/.ref-Research-V7/usr/src/cmd/troff/ni.c
deleted file mode 100644 (file)
index 203ccbd..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-#include "tdef.h"
-char obuf[OBUFSZ];
-char *obufp = obuf;
-int r[NN] = {
-       PAIR('%',0),
-       PAIR('n','l'),
-       PAIR('y','r'),
-       PAIR('h','p'),
-       PAIR('c','t'),
-       PAIR('d','n'),
-       PAIR('m','o'),
-       PAIR('d','y'),
-       PAIR('d','w'),
-       PAIR('l','n'),
-       PAIR('d','l'),
-       PAIR('s','t'),
-       PAIR('s','b'),
-       PAIR('c','.')};
-int pto = 10000;
-int pfrom = 1;
-int print = 1;
-char nextf[NS] = "/usr/lib/tmac/tmac.xxxxx";
-int nfi = 19;
-#ifdef NROFF
-char termtab[NS] = "/usr/lib/term/tab37";
-int tti = 17;
-#endif
-#ifndef NROFF
-int oldbits = -1;
-#endif
-int init = 1;
-int fc = IMP;
-int eschar = '\\';
-int pl = 11*INCH;
-int po = PO;
-int dfact = 1;
-int dfactd = 1;
-int res = 1;
-int smnt = 4;
-int ascii = ASCII;
-int ptid = PTID;
-char ptname[] = "/dev/cat";
-int lg = LG;
-int pnlist[NPN] = {-1};
-int *pnp = pnlist;
-int npn = 1;
-int npnflg = 1;
-int xflg = 1;
-int dpn = -1;
-int totout = 1;
-int ulfont = 1;
-int ulbit = 1<<9;
-int tabch = TAB;
-int ldrch = LEADER;
-int xxx;
-extern caseds(), caseas(), casesp(), caseft(), caseps(), casevs(),
-casenr(), caseif(), casepo(), casetl(), casetm(), casebp(), casech(),
-casepn(), tbreak(), caseti(), casene(), casenf(), casece(), casefi(),
-casein(), caseli(), casell(), casens(), casemk(), casert(), caseam(),
-casede(), casedi(), caseda(), casewh(), casedt(), caseit(), caserm(),
-casern(), casead(), casers(), casena(), casepl(), caseta(), casetr(),
-caseul(), caselt(), casenx(), caseso(), caseig(), casetc(), casefc(),
-caseec(), caseeo(), caselc(), caseev(), caserd(), caseab(), casefl(),
-done(), casess(), casefp(), casecs(), casebd(), caselg(), casehc(),
-casehy(), casenh(), casenm(), casenn(), casesv(), caseos(), casels(),
-casecc(), casec2(), caseem(), caseaf(), casehw(), casemc(), casepm(),
-casecu(), casepi(), caserr(), caseuf(), caseie(), caseel(), casepc(),
-caseht();
-#ifndef NROFF
-extern casefz();
-#endif
-extern casecf();
-struct contab {
-       int rq;
-/*
-       union {
- */
-               int (*f)();
-/*
-               unsigned mx;
-       }x;
- */
-}contab[NM]= {
-       PAIR('d','s'),caseds,
-       PAIR('a','s'),caseas,
-       PAIR('s','p'),casesp,
-       PAIR('f','t'),caseft,
-       PAIR('p','s'),caseps,
-       PAIR('v','s'),casevs,
-       PAIR('n','r'),casenr,
-       PAIR('i','f'),caseif,
-       PAIR('i','e'),caseie,
-       PAIR('e','l'),caseel,
-       PAIR('p','o'),casepo,
-       PAIR('t','l'),casetl,
-       PAIR('t','m'),casetm,
-       PAIR('b','p'),casebp,
-       PAIR('c','h'),casech,
-       PAIR('p','n'),casepn,
-       PAIR('b','r'),tbreak,
-       PAIR('t','i'),caseti,
-       PAIR('n','e'),casene,
-       PAIR('n','f'),casenf,
-       PAIR('c','e'),casece,
-       PAIR('f','i'),casefi,
-       PAIR('i','n'),casein,
-       PAIR('l','i'),caseli,
-       PAIR('l','l'),casell,
-       PAIR('n','s'),casens,
-       PAIR('m','k'),casemk,
-       PAIR('r','t'),casert,
-       PAIR('a','m'),caseam,
-       PAIR('d','e'),casede,
-       PAIR('d','i'),casedi,
-       PAIR('d','a'),caseda,
-       PAIR('w','h'),casewh,
-       PAIR('d','t'),casedt,
-       PAIR('i','t'),caseit,
-       PAIR('r','m'),caserm,
-       PAIR('r','r'),caserr,
-       PAIR('r','n'),casern,
-       PAIR('a','d'),casead,
-       PAIR('r','s'),casers,
-       PAIR('n','a'),casena,
-       PAIR('p','l'),casepl,
-       PAIR('t','a'),caseta,
-       PAIR('t','r'),casetr,
-       PAIR('u','l'),caseul,
-       PAIR('c','u'),casecu,
-       PAIR('l','t'),caselt,
-       PAIR('n','x'),casenx,
-       PAIR('s','o'),caseso,
-       PAIR('i','g'),caseig,
-       PAIR('t','c'),casetc,
-       PAIR('f','c'),casefc,
-       PAIR('e','c'),caseec,
-       PAIR('e','o'),caseeo,
-       PAIR('l','c'),caselc,
-       PAIR('e','v'),caseev,
-       PAIR('r','d'),caserd,
-       PAIR('a','b'),caseab,
-       PAIR('f','l'),casefl,
-       PAIR('e','x'),done,
-       PAIR('s','s'),casess,
-       PAIR('f','p'),casefp,
-       PAIR('c','s'),casecs,
-       PAIR('b','d'),casebd,
-       PAIR('l','g'),caselg,
-       PAIR('h','c'),casehc,
-       PAIR('h','y'),casehy,
-       PAIR('n','h'),casenh,
-       PAIR('n','m'),casenm,
-       PAIR('n','n'),casenn,
-       PAIR('s','v'),casesv,
-       PAIR('o','s'),caseos,
-       PAIR('l','s'),casels,
-       PAIR('c','c'),casecc,
-       PAIR('c','2'),casec2,
-       PAIR('e','m'),caseem,
-       PAIR('a','f'),caseaf,
-       PAIR('h','w'),casehw,
-       PAIR('m','c'),casemc,
-       PAIR('p','m'),casepm,
-#ifdef NROFF
-       PAIR('p','i'),casepi,
-#endif
-       PAIR('u','f'),caseuf,
-       PAIR('p','c'),casepc,
-       PAIR('h','t'),caseht,
-#ifndef NROFF
-       PAIR('f','z'),casefz,
-#endif
-       PAIR('c', 'f'),casecf,
-};
-
-/*
-troff environment block
-*/
-
-int block = 0;
-int ics = ICS;
-int ic = 0;
-int icf = 0;
-int chbits = 0;
-int spbits = 0;
-int nmbits = 0;
-int apts = PS;
-int apts1 = PS;
-int pts = PS;
-int pts1 = PS;
-int font = FT;
-int font1 = FT;
-int sps = SPS;
-int spacesz = SS;
-int lss = VS;
-int lss1 = VS;
-int ls = 1;
-int ls1 = 1;
-int ll = LL;
-int ll1 = LL;
-int lt = LL;
-int lt1 = LL;
-int ad = 1;
-int nms = 1;
-int ndf = 1;
-int fi = 1;
-int cc = '.';
-int c2 = '\'';
-int ohc = OHC;
-int tdelim = IMP;
-int hyf = 1;
-int hyoff = 0;
-int un1 = -1;
-int tabc = 0;
-int dotc = '.';
-int adsp = 0;
-int adrem = 0;
-int lastl = 0;
-int nel = 0;
-int admod = 0;
-int *wordp = 0;
-int spflg = 0;
-int *linep = 0;
-int *wdend = 0;
-int *wdstart = 0;
-int wne = 0;
-int ne = 0;
-int nc = 0;
-int nb = 0;
-int lnmod = 0;
-int nwd = 0;
-int nn = 0;
-int ni = 0;
-int ul = 0;
-int cu = 0;
-int ce = 0;
-int in = 0;
-int in1 = 0;
-int un = 0;
-int wch = 0;
-int pendt = 0;
-int *pendw = 0;
-int pendnf = 0;
-int spread = 0;
-int it = 0;
-int itmac = 0;
-int lnsize = LNSIZE;
-int *hyptr[NHYP] = {0};
-int tabtab[NTAB] = {DTAB,DTAB*2,DTAB*3,DTAB*4,DTAB*5,DTAB*6,DTAB*7,DTAB*8,
-       DTAB*9,DTAB*10,DTAB*11,DTAB*12,DTAB*13,DTAB*14,DTAB*15,0};
-int line[LNSIZE] = {0};
-int word[WDSIZE] = {0};
-int blockxxx[EVS-68-NHYP-NTAB-WDSIZE-LNSIZE] = {0};
-/*spare 5 words*/
-int oline[LNSIZE+1];
diff --git a/.ref-Research-V7/usr/src/cmd/troff/nii.c b/.ref-Research-V7/usr/src/cmd/troff/nii.c
deleted file mode 100644 (file)
index 12e38ea..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#include "tdef.h"
-#ifdef NROFF
-#include "tw.h"
-#endif
-#include "s.h"
-#include "d.h"
-#include "v.h"
-#include <sgtty.h>
-
-int *vlist = (int *)&v;
-struct s *frame, *stk, *ejl;
-struct s *nxf, *litlev;
-
-#ifdef NROFF
-int pipeflg;
-int hflg;
-int eqflg;
-#endif
-
-#ifndef NROFF
-int xpts;
-int verm;
-int *pslp;
-int psflg;
-int ppts;
-int pfont;
-int paper;
-int mpts;
-int mfont;
-int mcase;
-int escm;
-int cs;
-int code;
-int ccs;
-int bd;
-int back;
-#endif
-
-int level;
-int stdi;
-int waitf;
-int nofeed;
-int quiet;
-int stop;
-char ibuf[IBUFSZ];
-char xbuf[IBUFSZ];
-char *ibufp;
-char *xbufp;
-char *eibuf;
-char *xeibuf;
-int cbuf[NC];
-int *cp;
-int nx;
-int mflg;
-int ch = 0;
-int cps;
-int ibf;
-int ttyod;
-struct sgttyb ttys;
-int iflg;
-char *enda;
-int rargc;
-char **argp;
-char trtab[256];
-int lgf;
-int copyf;
-int ch0;
-int cwidth;
-filep ip;
-int nlflg;
-int *ap;
-int donef;
-int nflush;
-int nchar;
-int rchar;
-int nfo;
-int ifile;
-int padc;
-int raw;
-int ifl[NSO];
-int ifi;
-int flss;
-int nonumb;
-int trap;
-int tflg;
-int ejf;
-int lit;
-int gflag;
-int dilev;
-int tlss;
-filep offset;
-int em;
-int ds;
-filep woff;
-int app;
-int ndone;
-int lead;
-int ralss;
-filep nextb;
-int *argtop;
-int nrbits;
-int nform;
-int oldmn;
-int newmn;
-int macerr;
-filep apptr;
-int diflg;
-filep roff;
-int wbfi;
-int inc[NN];
-int fmt[NN];
-int evi;
-int vflag;
-int noscale;
-int po1;
-int nlist[NTRAP];
-int mlist[NTRAP];
-int evlist[EVLSZ];
-int ev;
-int tty;
-int sfont;
-int sv;
-int esc;
-int widthp;
-int xfont;
-int setwdf;
-int xbitf;
-int over;
-int nhyp;
-int **hyp;
-int *olinep;
-int esct;
-int ttysave = -1;
-int dotT;
-char *unlkp;
-int no_out;
diff --git a/.ref-Research-V7/usr/src/cmd/troff/nmake b/.ref-Research-V7/usr/src/cmd/troff/nmake
deleted file mode 100644 (file)
index 1c084af..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-CFLAGS=-n -s -O -DNROFF
-NFILES=n1.o n2.o n3.o n4.o n5.o n6.o n7.o n8.o n9.o n10.o ni.o nii.o ntab.o hytab.o suftab.o
-
-nroff: $(NFILES)
-       cc -o nroff $(CFLAGS) $(NFILES)
-
-n1.o:  tdef.h d.h v.h tw.h s.h
-n2.o:  tdef.h d.h v.h tw.h s.h
-n3.o:  tdef.h d.h v.h tw.h s.h
-n4.o:  tdef.h d.h v.h tw.h s.h
-n5.o:  tdef.h d.h v.h tw.h s.h
-n6.o:  tdef.h d.h v.h tw.h s.h
-t6.o:  tdef.h d.h v.h tw.h s.h
-n7.o:  tdef.h d.h v.h tw.h s.h
-n8.o:  tdef.h d.h v.h tw.h s.h
-n9.o:  tdef.h d.h v.h tw.h s.h
-n10.o: tdef.h d.h v.h tw.h s.h
-t10.o: tdef.h d.h v.h tw.h s.h
-ni.o:  tdef.h d.h v.h tw.h s.h
-nii.o: tdef.h d.h v.h tw.h s.h
-
-hytab.o:       hytab.c
-       cc -S hytab.c
-       ed hytab.s <textscript
-       as -o hytab.o hytab.s
-       rm hytab.s
-
-suftab.o:      suftab.c
-       cc -S suftab.c
-       ed suftab.s <textscript
-       as -o suftab.o suftab.s
-       rm suftab.s
diff --git a/.ref-Research-V7/usr/src/cmd/troff/ntab.c b/.ref-Research-V7/usr/src/cmd/troff/ntab.c
deleted file mode 100644 (file)
index d408d06..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#define BYTE 8
-#define PAIR(A,B) (A|(B<<BYTE))
-/*
-character name tables
-modified for BTL special font version 4
-and Commercial II
-*/
-
-
-int chtab [] = {
-PAIR('h','y'), 0200,   /*hyphen*/
-PAIR('b','u'), 0201,   /*bullet*/
-PAIR('s','q'), 0202,   /*square*/
-PAIR('e','m'), 0203,   /*3/4em*/
-PAIR('r','u'), 0204,   /*rule*/
-PAIR('1','4'), 0205,   /*1/4*/
-PAIR('1','2'), 0206,   /*1/2*/
-PAIR('3','4'), 0207,   /*3/4*/
-PAIR('m','i'), 0302,   /*equation minus*/
-PAIR('f','i'), 0211,   /*fi*/
-PAIR('f','l'), 0212,   /*fl*/
-PAIR('f','f'), 0213,   /*ff*/
-PAIR('F','i'), 0214,   /*ffi*/
-PAIR('F','l'), 0215,   /*ffl*/
-PAIR('d','e'), 0216,   /*degree*/
-PAIR('d','g'), 0217,   /*dagger*/
-PAIR('s','c'), 0220,   /*section*/
-PAIR('f','m'), 0221,   /*foot mark*/
-PAIR('a','a'), 0222,   /*acute accent*/
-PAIR('g','a'), 0223,   /*grave accent*/
-PAIR('u','l'), 0224,   /*underrule*/
-PAIR('s','l'), 0225,   /*slash (longer)*/
-PAIR('*','a'), 0230,   /*alpha*/
-PAIR('*','b'), 0231,   /*beta*/
-PAIR('*','g'), 0232,   /*gamma*/
-PAIR('*','d'), 0233,   /*delta*/
-PAIR('*','e'), 0234,   /*epsilon*/
-PAIR('*','z'), 0235,   /*zeta*/
-PAIR('*','y'), 0236,   /*eta*/
-PAIR('*','h'), 0237,   /*theta*/
-PAIR('*','i'), 0240,   /*iota*/
-PAIR('*','k'), 0241,   /*kappa*/
-PAIR('*','l'), 0242,   /*lambda*/
-PAIR('*','m'), 0243,   /*mu*/
-PAIR('*','n'), 0244,   /*nu*/
-PAIR('*','c'), 0245,   /*xi*/
-PAIR('*','o'), 0246,   /*omicron*/
-PAIR('*','p'), 0247,   /*pi*/
-PAIR('*','r'), 0250,   /*rho*/
-PAIR('*','s'), 0251,   /*sigma*/
-PAIR('*','t'), 0252,   /*tau*/
-PAIR('*','u'), 0253,   /*upsilon*/
-PAIR('*','f'), 0254,   /*phi*/
-PAIR('*','x'), 0255,   /*chi*/
-PAIR('*','q'), 0256,   /*psi*/
-PAIR('*','w'), 0257,   /*omega*/
-PAIR('*','A'), 0101,   /*Alpha*/
-PAIR('*','B'), 0102,   /*Beta*/
-PAIR('*','G'), 0260,   /*Gamma*/
-PAIR('*','D'), 0261,   /*Delta*/
-PAIR('*','E'), 0105,   /*Epsilon*/
-PAIR('*','Z'), 0132,   /*Zeta*/
-PAIR('*','Y'), 0110,   /*Eta*/
-PAIR('*','H'), 0262,   /*Theta*/
-PAIR('*','I'), 0111,   /*Iota*/
-PAIR('*','K'), 0113,   /*Kappa*/
-PAIR('*','L'), 0263,   /*Lambda*/
-PAIR('*','M'), 0115,   /*Mu*/
-PAIR('*','N'), 0116,   /*Nu*/
-PAIR('*','C'), 0264,   /*Xi*/
-PAIR('*','O'), 0117,   /*Omicron*/
-PAIR('*','P'), 0265,   /*Pi*/
-PAIR('*','R'), 0120,   /*Rho*/
-PAIR('*','S'), 0266,   /*Sigma*/
-PAIR('*','T'), 0124,   /*Tau*/
-PAIR('*','U'), 0270,   /*Upsilon*/
-PAIR('*','F'), 0271,   /*Phi*/
-PAIR('*','X'), 0130,   /*Chi*/
-PAIR('*','Q'), 0272,   /*Psi*/
-PAIR('*','W'), 0273,   /*Omega*/
-PAIR('s','r'), 0274,   /*square root*/
-PAIR('t','s'), 0275,   /*terminal sigma*/
-PAIR('r','n'), 0276,   /*root en*/
-PAIR('>','='), 0277,   /*>=*/
-PAIR('<','='), 0300,   /*<=*/
-PAIR('=','='), 0301,   /*identically equal*/
-PAIR('~','='), 0303,   /*approx =*/
-PAIR('a','p'), 0304,   /*approximates*/
-PAIR('!','='), 0305,   /*not equal*/
-PAIR('-','>'), 0306,   /*right arrow*/
-PAIR('<','-'), 0307,   /*left arrow*/
-PAIR('u','a'), 0310,   /*up arrow*/
-PAIR('d','a'), 0311,   /*down arrow*/
-PAIR('e','q'), 0312,   /*equation equal*/
-PAIR('m','u'), 0313,   /*multiply*/
-PAIR('d','i'), 0314,   /*divide*/
-PAIR('+','-'), 0315,   /*plus-minus*/
-PAIR('c','u'), 0316,   /*cup (union)*/
-PAIR('c','a'), 0317,   /*cap (intersection)*/
-PAIR('s','b'), 0320,   /*subset of*/
-PAIR('s','p'), 0321,   /*superset of*/
-PAIR('i','b'), 0322,   /*improper subset*/
-PAIR('i','p'), 0323,   /*  " superset*/
-PAIR('i','f'), 0324,   /*infinity*/
-PAIR('p','d'), 0325,   /*partial derivative*/
-PAIR('g','r'), 0326,   /*gradient*/
-PAIR('n','o'), 0327,   /*not*/
-PAIR('i','s'), 0330,   /*integral sign*/
-PAIR('p','t'), 0331,   /*proportional to*/
-PAIR('e','s'), 0332,   /*empty set*/
-PAIR('m','o'), 0333,   /*member of*/
-PAIR('p','l'), 0334,   /*equation plus*/
-PAIR('r','g'), 0335,   /*registered*/
-PAIR('c','o'), 0336,   /*copyright*/
-PAIR('b','r'), 0337,   /*box vert rule*/
-PAIR('c','t'), 0340,   /*cent sign*/
-PAIR('d','d'), 0341,   /*dbl dagger*/
-PAIR('r','h'), 0342,   /*right hand*/
-PAIR('l','h'), 0343,   /*left hand*/
-PAIR('*','*'), 0344,   /*math * */
-PAIR('b','s'), 0345,   /*bell system sign*/
-PAIR('o','r'), 0346,   /*or*/
-PAIR('c','i'), 0347,   /*circle*/
-PAIR('l','t'), 0350,   /*left top (of big curly)*/
-PAIR('l','b'), 0351,   /*left bottom*/
-PAIR('r','t'), 0352,   /*right top*/
-PAIR('r','b'), 0353,   /*right bot*/
-PAIR('l','k'), 0354,   /*left center of big curly bracket*/
-PAIR('r','k'), 0355,   /*right center of big curly bracket*/
-PAIR('b','v'), 0356,   /*bold vertical*/
-PAIR('l','f'), 0357,   /*left floor (left bot of big sq bract)*/
-PAIR('r','f'), 0360,   /*right floor (rb of ")*/
-PAIR('l','c'), 0361,   /*left ceiling (lt of ")*/
-PAIR('r','c'), 0362,   /*right ceiling (rt of ")*/
-0,0};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/s.h b/.ref-Research-V7/usr/src/cmd/troff/s.h
deleted file mode 100644 (file)
index 7a4579c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-struct s {
-       int nargs;
-       struct s *pframe;
-       filep pip;
-       int pnchar;
-       int prchar;
-       int ppendt;
-       int *pap;
-       int *pcp;
-       int pch0;
-       int pch;
-       };
diff --git a/.ref-Research-V7/usr/src/cmd/troff/suftab.c b/.ref-Research-V7/usr/src/cmd/troff/suftab.c
deleted file mode 100644 (file)
index 93be017..0000000
+++ /dev/null
@@ -1,606 +0,0 @@
-/*
- * Suffix table
- */
-
-static char sufa[] = {
-       02,0200+'t',    /* -TA */
-       02,0200+'s',    /* -SA */
-       03,0200+'t','r',        /* -TRA */
-       03,0200+'d','r',        /* -DRA */
-       03,0200+'b','r',        /* -BRA */
-       02,0200+'p',    /* -PA */
-       02,0200+'n',    /* -NA */
-       02,0200+'m',    /* -MA */
-       03,0200+'p','l',        /* -PLA */
-       02,0200+'l',    /* -LA */
-       02,0200+'k',    /* -KA */
-       03,0200+'t','h',        /* -THA */
-       03,0200+'s','h',        /* -SHA */
-       02,0200+'g',    /* -GA */
-       02,0200+'d',    /* -DA */
-       02,0200+'c',    /* -CA */
-       02,0200+'b',    /* -BA */
-       00
-};
-
-static char sufc[] = {
-       04,'e','t',0200+'i',    /* ET-IC */
-       07,'a','l',0200+'i','s',0200+'t','i',   /* AL-IS-TIC */
-       04,'s',0200+'t','i',    /* S-TIC */
-       04,'p',0200+'t','i',    /* P-TIC */
-       05,0200+'l','y','t',0200+'i',   /* -LYT-IC */
-       04,'o','t',0200+'i',    /* OT-IC */
-       05,'a','n',0200+'t','i',        /* AN-TIC */
-       04,'n',0200+'t','i',    /* N-TIC */
-       04,'c',0200+'t','i',    /* C-TIC */
-       04,'a','t',0200+'i',    /* AT-IC */
-       04,'h',0200+'n','i',    /* H-NIC */
-       03,'n',0200+'i',        /* N-IC */
-       03,'m',0200+'i',        /* M-IC */
-       04,'l',0200+'l','i',    /* L-LIC */
-       04,'b',0200+'l','i',    /* B-LIC */
-       04,0200+'c','l','i',    /* -CLIC */
-       03,'l',0200+'i',        /* L-IC */
-       03,'h',0200+'i',        /* H-IC */
-       03,'f',0200+'i',        /* F-IC */
-       03,'d',0200+'i',        /* D-IC */
-       03,0200+'b','i',        /* -BIC */
-       03,'a',0200+'i',        /* A-IC */
-       03,0200+'m','a',        /* -MAC */
-       03,'i',0200+'a',        /* I-AC */
-       00
-};
-
-static char sufd[] = {
-       04,0200+'w','o','r',    /* -WORD */
-       04,0200+'l','o','r',    /* -LORD */
-       04,0200+'f','o','r',    /* -FORD */
-       04,0200+'y','a','r',    /* -YARD */
-       04,0200+'w','a','r',    /* -WARD */
-       05,0200+'g','u','a','r',        /* -GUARD */
-       04,0200+'t','a','r',    /* -TARD */
-       05,0200+'b','o','a','r',        /* -BOARD */
-       04,0200+'n','a','r',    /* -NARD */
-       05,0200+'l','i','a','r',        /* -LIARD */
-       04,0200+'i','a','r',    /* -IARD */
-       04,0200+'g','a','r',    /* -GARD */
-       04,0200+'b','a','r',    /* -BARD */
-       03,0200+'r','o',        /* -ROD */
-       04,0200+'w','o','o',    /* -WOOD */
-       04,0200+'h','o','o',    /* -HOOD */
-       04,0200+'m','o','n',    /* -MOND */
-       04,0200+'t','e','n',    /* -TEND */
-       05,0200+'s','t','a','n',        /* -STAND */
-       04,0200+'l','a','n',    /* -LAND */
-       04,0200+'h','a','n',    /* -HAND */
-       04,0200+'h','o','l',    /* -HOLD */
-       04,0200+'f','o','l',    /* -FOLD */
-       05,0200+'f','i','e','l',        /* -FIELD */
-       03,0200+'v','i',        /* -VID */
-       03,0200+'c','i',        /* -CID */
-       04,0200+'s','a','i',    /* -SAID */
-       04,0200+'m','a','i',    /* -MAID */
-       04,'t',0200+'t','e',    /* T-TED */
-       03,'t',0200+'e',        /* T-ED */
-       04,0200+'d','r','e',    /* -DRED */
-       04,0200+'c','r','e',    /* -CRED */
-       04,0200+'b','r','e',    /* -BRED */
-       05,'v',0200+'e','l','e',        /* V-ELED */
-       0100+04,'a','l',0200+'e',       /* AL/ED */
-       0140+03,0200+'e','e',   /* /EED */
-       040+05,'e','d',0200+'d','e',    /* ED-DED */
-       04,'d',0200+'d','e',    /* D-DED */
-       040+04,'e','d',0200+'e',        /* ED-ED */
-       03,'d',0200+'e',        /* D-ED */
-       05,0200+'d','u','c','e',        /* -DUCED */
-       0300+02,'e',    /* E/D */
-       05,0200+'s','t','e','a',        /* -STEAD */
-       04,0200+'h','e','a',    /* -HEAD */
-       00
-};
-
-static char sufe[] = {
-       05,'a','r',0200+'i','z',        /* AR-IZE */
-       05,'a','n',0200+'i','z',        /* AN-IZE */
-       05,'a','l',0200+'i','z',        /* AL-IZE */
-       06,0200+'a','r','d',0200+'i','z',       /* -ARD-IZE */
-       05,0200+'s','e','l','v',        /* -SELVE */
-       05,0200+'k','n','i','v',        /* -KNIVE */
-       05,0200+'l','i','e','v',        /* -LIEVE */
-       0100+03,0200+'q','u',   /* /QUE */
-       07,'o','n',0200+'t','i','n',0200+'u',   /* ON-TIN-UE */
-       03,0200+'n','u',        /* -NUE */
-       03,0200+'d','u',        /* -DUE */
-       0300+02,'u',    /* U/E */
-       0300+05,'q','u','a','t',        /*  QUAT/E */
-       04,'u',0200+'a','t',    /* U-ATE */
-       05,0200+'s','t','a','t',        /* -STATE */
-       04,0200+'t','a','t',    /* -TATE */
-       06,0200+'t','o','r',0200+'a','t',       /* -TOR-ATE */
-       05,'e','n',0200+'a','t',        /* EN-ATE */
-       04,0200+'m','a','t',    /* -MATE */
-       05,0200+'h','o','u','s',        /* -HOUSE */
-       05,0200+'c','l','o','s',        /* -CLOSE */
-       04,'i',0200+'o','s',    /* I-OSE */
-       04,0200+'w','i','s',    /* -WISE */
-       05,'a','s',0200+'u','r',        /* AS-URE */
-       040+04,0200+'s','u','r',        /* -SURE */
-       06,0200+'f','i','g',0200+'u','r',       /* -FIG-URE */
-       040+03,0200+'t','r',    /* -TRE */
-       05,0200+'s','t','o','r',        /* -STORE */
-       04,0200+'f','o','r',    /* -FORE */
-       05,0200+'w','h','e','r',        /* -WHERE */
-       06,0200+'s','p','h','e','r',    /* -SPHERE */
-       03,0200+'d','r',        /* -DRE */
-       03,0200+'c','r',        /* -CRE */
-       03,0200+'b','r',        /* -BRE */
-       05,0200+'s','c','o','p',        /* -SCOPE */
-       04,'y',0200+'o','n',    /* Y-ONE */
-       05,0200+'s','t','o','n',        /* -STONE */
-       05,0200+'p','h','o','n',        /* -PHONE */
-       04,0200+'g','o','n',    /* -GONE */
-       04,'e',0200+'o','n',    /* E-ONE */
-       040+04,0200+'e','n','n',        /* -ENNE */
-       040+05,'a',0200+'r','i','n',    /* A-RINE */
-       05,0200+'c','l','i','n',        /* -CLINE */
-       04,0200+'l','i','n',    /* -LINE */
-       007,00200+'r','o','u',00200+'t','i','n',        /*-ROU-TINE */
-       04,0200+'s','o','m',    /* -SOME */
-       04,0200+'c','o','m',    /* -COME */
-       04,0200+'t','i','m',    /* -TIME */
-       03,0200+'z','l',        /* -ZLE */
-       03,0200+'t','l',        /* -TLE */
-       03,0200+'s','l',        /* -SLE */
-       03,0200+'p','l',        /* -PLE */
-       05,0200+'v','i','l','l',        /* -VILLE */
-       04,'c','k',0200+'l',    /* CK-LE */
-       03,0200+'k','l',        /* -KLE */
-       03,0200+'g','l',        /* -GLE */
-       03,0200+'f','l',        /* -FLE */
-       03,0200+'d','l',        /* -DLE */
-       03,0200+'c','l',        /* -CLE */
-       05,0200+'p','a',0200+'b','l',   /* -PA-BLE */
-       05,'f','a',0200+'b','l',        /* FA-BLE */
-       05,0200+'c','a',0200+'b','l',   /* -CA-BLE */
-       06,0200+'s','t','a','b','l',    /* -STABLE */
-       04,0200+'a','b','l',    /* -ABLE */
-       03,0200+'b','l',        /* -BLE */
-       04,0200+'d','a','l',    /* -DALE */
-       04,0200+'m','a','l',    /* -MALE */
-       04,0200+'s','a','l',    /* -SALE */
-       04,0200+'l','i','k',    /* -LIKE */
-       0340+05,'g',0200+'u','a','g',   /* -G/UAGE */
-       05,0200+'r','i','a','g',        /* -RIAGE */
-       05,'e','r',0200+'a','g',        /* ER-AGE */
-       04,'m',0200+'a','g',    /* M-AGE */
-       04,'k',0200+'a','g',    /* K-AGE */
-       04,'d',0200+'a','g',    /* D-AGE */
-       04,0200+'w','i','f',    /* -WIFE */
-       05,0200+'k','n','i','f',        /* -KNYFE */
-       03,0200+'s','e',        /* -SEE */
-       04,0200+'f','r','e',    /* -FREE */
-       0340+02,'e',    /* EE */
-       04,0200+'w','i','d',    /* -WIDE */
-       04,0200+'t','i','d',    /* -TIDE */
-       04,0200+'s','i','d',    /* -SIDE */
-       06,0200+'q','u','e','n','c',    /* -QUENCE */
-       07,0200+'f','l','u',0200+'e','n','c',   /* -FLU-ENCE */
-       040+06,'e','s',0200+'e','n','c',        /* ES-ENCE */
-       06,'e','r',0200+'e','n','c',    /* ER-ENCE */
-       05,'i',0200+'e','n','c',        /* I-ENCE */
-       040+05,0200+'s','a','n','c',    /* -SANCE */
-       06,'e','r',0200+'a','n','c',    /* ER-ANCE */
-       06,'a','r',0200+'a','n','c',    /* AR-ANCE */
-       05,0200+'n','a','n','c',        /* -NANCE */
-       07,0200+'b','a','l',0200+'a','n','c',   /* -BAL-ANCE */
-       05,'i',0200+'a','n','c',        /* I-ANCE */
-       07,0200+'j','u','s',0200+'t','i','c',   /* -JUS-TICE */
-       05,0200+'s','t','i','c',        /* -STICE */
-       05,0200+'p','i','e','c',        /* -PIECE */
-       05,0200+'p','l','a','c',        /* -PLACE */
-       0340+01,        /* /E */
-       00
-};
-
-static char suff[] = {
-       03,0200+'o','f',        /* -OFF */
-       05,0200+'p','r','o','o',        /* -PROOF */
-       04,0200+'s','e','l',    /* -SELF */
-       03,0200+'r','i',        /* -RIF */
-       040+04,0200+'l','i','e',        /* -LIEF */
-       00
-};
-
-static char sufg[] = {
-       03,0200+'l','o',        /* -LOG */
-       04,0200+'l','o','n',    /* -LONG */
-       05,'t',0200+'t','i','n',        /* T-TING */
-       06,0200+'s','t','r','i','n',    /*  -STRING */
-       05,'r',0200+'r','i','n',        /* R-RING */
-       05,'p',0200+'p','i','n',        /* P-PING */
-       05,'n',0200+'n','i','n',        /* N-NING */
-       05,'m',0200+'m','i','n',        /* M-MING */
-       05,'l',0200+'l','i','n',        /*  L-LING */
-       05,0200+'z','l','i','n',        /* -ZLING */
-       05,0200+'t','l','i','n',        /* -TLING */
-       040+05,'s',0200+'l','i','n',    /* S-LING */
-       05,'r',0200+'l','i','n',        /* R-LING */
-       05,0200+'p','l','i','n',        /* -PLING */
-       06,'n',0200+'k','l','i','n',    /* N-KLING */
-       05,'k',0200+'l','i','n',        /* K-LING */
-       05,0200+'g','l','i','n',        /* -GLING */
-       05,0200+'f','l','i','n',        /* -FLING */
-       05,0200+'d','l','i','n',        /* -DLING */
-       05,0200+'c','l','i','n',        /* -CLING */
-       05,0200+'b','l','i','n',        /* -BLING */
-       06,'y',0200+'t','h','i','n',    /* Y-THING */
-       07,'e','e','t','h',0200+'i','n',        /* EETH-ING */
-       06,'e',0200+'t','h','i','n',    /* E-THING */
-       05,'g',0200+'g','i','n',        /* G-GING */
-       05,'d',0200+'d','i','n',        /* D-DING */
-       05,'b',0200+'b','i','n',        /* B-BING */
-       03,0200+'i','n',        /* -ING */
-       00
-};
-
-static char sufh[] = {
-       05,0200+'m','o','u','t',        /* -MOUTH */
-       05,0200+'w','o','r','t',        /* -WORTH */
-       04,0200+'w','i','t',    /* -WITH */
-       05,'t',0200+'t','i','s',        /* T-TISH */
-       05,'e',0200+'t','i','s',        /* E-TISH */
-       05,'p',0200+'p','i','s',        /* P-PISH */
-       05,'r',0200+'n','i','s',        /* R-NISH */
-       05,'n',0200+'n','i','s',        /* N-NISH */
-       05,0200+'p','l','i','s',        /* -PLISH */
-       05,0200+'g','u','i','s',        /*  -GUISH */
-       05,0200+'g','l','i','s',        /*  -GLISH */
-       05,'b',0200+'l','i','s',        /*  B-LISH */
-       05,'g',0200+'g','i','s',        /* G-GISH */
-       05,'d',0200+'d','i','s',        /* D-DISH */
-       03,0200+'i','s',        /* -ISH */
-       05,0200+'g','r','a','p',        /* -GRAPH */
-       07,0200+'b','o','r',0200+'o','u','g',   /* -BOR-OUGH */
-       05,0200+'b','u','r','g',        /* -BURGH */
-       04,0200+'v','i','c',    /* -VICH */
-       03,0200+'n','a',        /* -NAH */
-       03,0200+'l','a',        /* -LAH */
-       04,0200+'m','i',0200+'a',       /* -MI-AH */
-       00
-};
-
-static char sufi[] = {
-       03,0200+'t','r',        /* -TRI */
-       03,0200+'c','h',        /* -CHI */
-       0200+03,'i','f',        /* IF-I */
-       0200+03,'e','d',        /* ED-I */
-       05,0200+'a','s','c','i',        /* -ASCII */
-       04,0200+'s','e','m',    /* -SEMI */
-       00
-};
-
-static char sufk[] = {
-       04,0200+'w','o','r',    /* -WORK */
-       04,0200+'m','a','r',    /* -MARK */
-       04,0200+'b','o','o',    /* -BOOK */
-       04,0200+'w','a','l',    /* -WALK */
-       05,0200+'c','r','a','c',        /* -CRACK */
-       04,0200+'b','a','c',    /* -BACK */
-       00
-};
-
-static char sufl[] = {
-       03,0200+'f','u',        /* -FUL */
-       05,'s',0200+'w','e','l',        /* S-WELL */
-       04,0200+'t','e','l',    /* -TELL */
-       05,0200+'s','h','e','l',        /* -SHELL */
-       05,0200+'s','t','a','l',        /* -STALL */
-       04,0200+'s','t','a',    /* -STAL */
-       04,0200+'b','a','l',    /* -BALL */
-       04,0200+'c','a','l',    /* -CALL */
-       03,'v',0200+'e',        /* V-EL */
-       03,'u',0200+'e',        /* U-EL */
-       03,'k',0200+'e',        /* K-EL */
-       04,'t','h',0200+'e',    /* TH-EL */
-       05,'t','c','h',0200+'e',        /* TCH-EL */
-       03,'a',0200+'e',        /* A-EL */
-       0140+04,0200+'q','u','a',       /* /QUAL */
-       040+03,'u',0200+'a',    /* U-AL */
-       03,0200+'t','a',        /* -TAL */
-       04,'u','r',0200+'a',    /* UR-AL */
-       040+05,'g',0200+'o',0200+'n','a',       /* G-O-NAL */
-       04,'o','n',0200+'a',    /* ON-AL */
-       03,0200+'n','a',        /* -NAL */
-       04,0200+'t','i','a',    /* -TIAL */
-       04,0200+'s','i','a',    /* -SIAL */
-       040+05,0200+'t','r','i',0200+'a',       /* -TRI-AL */
-       04,'r','i',0200+'a',    /* RI-AL */
-       04,0200+'n','i',0200+'a',       /* -NI-AL */
-       04,0200+'d','i',0200+'a',       /* -DI-AL */
-       04,0200+'c','i','a',    /* -CIAL */
-       03,0200+'g','a',        /* -GAL */
-       04,0200+'m','e','a',    /* -MEAL */
-/*     040+04,0200+'r','e',0200+'a',   /* -RE-AL */
-       040+04,0200+'r','e','a',        /* -REAL */
-       06,'c',0200+'t','i',0200+'c','a',       /* C-TI-CAL */
-       05,0200+'s','i',0200+'c','a',   /* -SI-CAL */
-       04,0200+'i',0200+'c','a',       /* -I-CAL */
-       03,0200+'c','a',        /* -CAL */
-       03,0200+'b','a',        /* -BAL */
-       06,0200+'n','o',0200+'m','i',0200+'a',  /* -NO-MI-AL */
-       00
-};
-
-static char sufm[] = {
-       03,0200+'n','u',        /* -NUM */
-       05,'o',0200+'r','i',0200+'u',   /* O-RI-UM */
-       040+03,'i',0200+'u',    /* I-UM */
-       040+03,'e',0200+'u',    /* E-UM */
-       05,'i','v',0200+'i','s',        /* IV-ISM */
-       04,0200+'t','i','s',    /* -TISM */
-       05,'i',0200+'m','i','s',        /* I-MISM */
-       05,'a','l',0200+'i','s',        /* AL-ISM */
-       040+04,'e',0200+'i','s',        /* E-ISM */
-       040+04,'a',0200+'i','s',        /* A-ISM */
-       04,0200+'r','o','o',    /* -ROOM */
-       03,0200+'d','o',        /* -DOM */
-       03,0200+'h','a',        /* -HAM */
-       06,0200+'a',0200+'r','i','t','h',       /* -A-RITHM */
-       05,0200+'r','i','t','h',        /* -RITHM */
-       00
-};
-
-static char sufn[] = {
-       04,0200+'t','o','w',    /* -TOWN */
-       04,0200+'d','o','w',    /* -DOWN */
-       04,0200+'t','u','r',    /* -TURN */
-       05,0200+'s','p','o','o',        /* -SPOON */
-       04,0200+'n','o','o',    /* -NOON */
-       04,0200+'m','o','o',    /* -MOON */
-       011,'a','l',0200+'i',0200+'z','a',0200+'t','i','o',     /* AL-I-ZA-TION */
-       07,0200+'i',0200+'z','a',0200+'t','i','o',      /* -I-ZA-TION */
-       07,'l',0200+'i',0200+'a',0200+'t','i','o',      /* L-I-A-TION */
-       04,0200+'t','i','o',    /* -TION */
-       040+05,'s',0200+'s','i','o',    /* S-SION */
-       04,0200+'s','i','o',    /* -SION */
-       04,'n',0200+'i','o',    /* N-ION */
-       04,0200+'g','i','o',    /* -GION */
-       04,0200+'c','i','o',    /* -CION */
-       03,0200+'c','o',        /* -CON */
-       05,0200+'c','o','l','o',        /* -COLON */
-       03,0200+'t','o',        /* -TON */
-       04,'i','s',0200+'o',            /* IS-ON */
-       03,0200+'s','o',        /* -SON */
-       03,0200+'r','i',        /* -RIN */
-       03,0200+'p','i',        /* -PIN */
-       03,0200+'n','i',        /* -NIN */
-       03,0200+'m','i',        /* -MIN */
-       03,0200+'l','i',        /* -LIN */
-       03,0200+'k','i',        /* -KIN */
-       05,0200+'s','t','e','i',        /* -STEIN */
-       04,0200+'t','a','i',    /* -TAIN */
-       05,'g','h','t',0200+'e',        /* GHT-EN */
-       05,0200+'w','o','m',0200+'e',   /* -WOM-EN */
-       03,0200+'m','e',        /* -MEN */
-       04,'o',0200+'k','e',    /* O-KEN */
-       03,'k',0200+'e',        /* K-EN */
-       04,0200+'t','e','e',    /* -TEEN */
-       04,0200+'s','e','e',    /* -SEEN */
-       040+03,0200+'s','a',    /* -SAN */
-       05,0200+'w','o','m',0200+'a',   /* -WOM-AN */
-       03,0200+'m','a',        /* -MAN */
-       04,0200+'t','i','a',    /* -TIAN */
-       04,0200+'s','i','a',    /* -SIAN */
-       040+04,'e',0200+'i','a',        /* E-IAN */
-       04,0200+'c','i','a',    /* -CIAN */
-       0300+03,'i','a',        /* IA/N */
-       05,0200+'c','l','e','a',        /* -CLEAN */
-       04,0200+'m','e','a',    /* -MEAN */
-       040+03,'e',0200+'a',    /* E-AN */
-       00
-};
-
-static char sufo[] = {
-       05,0200+'m','a','c',0200+'r',   /* -MAC-RO */
-       00
-};
-
-static char sufp[] = {
-       05,0200+'g','r','o','u',        /* -GROUP */
-       02,0200+'u',    /* -UP */
-       04,0200+'s','h','i',    /* -SHIP */
-       04,0200+'k','e','e',    /* -KEEP */
-       00
-};
-
-static char sufr[] = {
-       04,0200+'z','a','r',    /* -ZARR */
-       0300+02,'r',    /* R/R */
-       03,0200+'t','o',        /* -TOR */
-       040+03,0200+'s','o',    /* -SOR */
-       040+04,0200+'r','i',0200+'o',   /* -RI-OR */
-       04,'i','z',0200+'e',    /* IZ-ER */
-       05,0200+'c','o','v',0200+'e',   /* -COV-ER */
-/*     04,'o',0200+'v','e',    /* O-VER */
-       04,0200+'o','v','e',    /* -OVER */
-       04,0200+'e','v',0200+'e',       /* -EV-ER */
-       8,0200+'c','o','m',0200+'p','u','t',0200+'e',   /* -COM-PUT-ER */
-       040+05,'u','s',0200+'t','e',    /* US-TER */
-       05,'o','s','t',0200+'e',        /* OST-ER */
-       040+05,0200+'a','c',0200+'t','e',       /* -AC-TER */
-       06,0200+'w','r','i','t',0200+'e',       /* -WRIT-ER */
-       040+05,'i','s',0200+'t','e',    /* IS-TER */
-       040+05,'e','s',0200+'t','e',    /* ES-TER */
-       040+05,'a','s',0200+'t','e',    /* AS-TER */
-       04,0200+'s','t','e',    /* -STER */
-       05,'a','r',0200+'t','e',        /* AR-TER */
-       04,'r','t',0200+'e',    /* RT-ER */
-       040+05,'m',0200+'e',0200+'t','e',       /* M-E-TER */
-       05,0200+'w','a',0200+'t','e',   /* -WA-TER */
-       03,'r',0200+'e',        /* R-ER */
-       04,'o','p',0200+'e',    /* OP-ER */
-       05,0200+'p','a',0200+'p','e',   /* -PA-PER */
-       04,'w','n',0200+'e',    /* WN-ER */
-       040+04,'s',0200+'n','e',        /* S-NER */
-       04,'o','n',0200+'e',    /* ON-ER */
-       04,'r','m',0200+'e',    /* RM-ER */
-       03,0200+'m','e',        /* -MER */
-       04,'l','l',0200+'e',    /* LL-ER */
-       05,'d',0200+'d','l','e',        /* D-DLER */
-       04,0200+'b','l','e',    /* -BLER */
-       03,'k',0200+'e',        /* K-ER */
-       05,'n',0200+'t','h','e',        /* N-THER */
-       06,0200+'f','a',0200+'t','h','e',       /* -FA-THER */
-       06,'e','i',0200+'t','h','e',    /* EI-THER */
-       04,'t','h',0200+'e',    /* TH-ER */
-       04,'s','h',0200+'e',    /* SH-ER */
-       04,0200+'p','h','e',    /* -PHER */
-       04,'c','h',0200+'e',    /* CH-ER */
-       04,'d','g',0200+'e',    /* DG-ER */
-       04,'r','d',0200+'e',    /* RD-ER */
-       06,'o','u','n','d',0200+'e',    /* OUND-ER */
-       04,'l','d',0200+'e',    /* LD-ER */
-       04,'i','d',0200+'e',    /* ID-ER */
-       05,0200+'d','u','c',0200+'e',   /* -DUC-ER */
-       04,'n','c',0200+'e',    /* NC-ER */
-       0100+02, 0200+'e',      /*  /ER */
-       03,0200+'s','a',        /* -SAR */
-       040+06,'a','c',0200+'u',0200+'l','a',   /* AC-U-LAR */
-       040+06,'e','c',0200+'u',0200+'l','a',   /* EC-U-LAR */
-       040+06,'i','c',0200+'u',0200+'l','a',   /* IC-U-LAR */
-       040+06,'e','g',0200+'u',0200+'l','a',   /* EG-U-LAR */
-       00
-};
-
-static char sufs[] = {
-       040+04,'u',0200+'o','u',        /* U-OUS */
-       05,0200+'t','i','o','u',        /* -TIOUS */
-       05,0200+'g','i','o','u',        /* -GIOUS */
-       05,0200+'c','i','o','u',        /* -CIOUS */
-       040+04,'i',0200+'o','u',        /* I-OUS */
-       05,0200+'g','e','o','u',        /* -GEOUS */
-       05,0200+'c','e','o','u',        /* -CEOUS */
-       04,'e',0200+'o','u',    /* E-OUS */
-       0140+02,0200+'u',       /* /US */
-       04,0200+'n','e','s',    /* -NESS */
-       04,0200+'l','e','s',    /* -LESS */
-       0140+02,0200+'s',       /* /SS */
-       040+05,'p',0200+'o',0200+'l','i',       /* P-O-LIS */
-       0140+02,0200+'i',       /* /IS */
-       0100+03,0200+'x','e',   /* X/ES */
-       0100+03,0200+'s','e',   /* S/ES */
-       0100+04,'s','h',0200+'e',       /* SH/ES */
-       0100+04,'c','h',0200+'e',       /* CH/ES */
-       0300+01,        /* /S */
-       00
-};
-
-static char suft[] = {
-       06,'i','o','n',0200+'i','s',    /* ION-IST */
-       05,'i','n',0200+'i','s',        /* IN-IST */
-       05,'a','l',0200+'i','s',        /* AL-IST */
-       06,'l',0200+'o',0200+'g','i','s',       /* L-O-GIST */
-       05,'h','t',0200+'e','s',        /* HT-EST */
-       04,'i',0200+'e','s',    /* I-EST */
-       05,'g',0200+'g','e','s',        /* G-GEST */
-       04,'g',0200+'e','s',    /* G-EST */
-       05,'d',0200+'d','e','s',        /* D-DEST */
-       04,'d',0200+'e','s',    /* D-EST */
-       04,0200+'c','a','s',    /* -CAST */
-       05,0200+'h','e','a','r',        /* -HEART */
-       04,0200+'f','o','o',    /* -FOOT */
-       03,'i',0200+'o',        /* I-OT */
-       05,0200+'f','r','o','n',        /* -FRONT */
-       05,0200+'p','r','i','n',        /* -PRINT */
-       04,0200+'m','e','n',    /* -MENT */
-       05,0200+'c','i','e','n',        /* -CIENT */
-       04,'i',0200+'a','n',    /* I-ANT */
-       06,0200+'w','r','i','g','h',    /* -WRIGHT */
-       06,0200+'b','r','i','g','h',    /* -BRIGHT */
-       06,0200+'f','l','i','g','h',    /* -FLIGHT */
-       06,0200+'w','e','i','g','h',    /* -WEIGHT */
-       05,0200+'s','h','i','f',        /* -SHIFT */
-       05,0200+'c','r','a','f',        /* -CRAFT */
-       040+04,'d','g',0200+'e',        /* DG-ET */
-       04,0200+'g','o','a',    /* -GOAT */
-       04,0200+'c','o','a',    /* -COAT */
-       04,0200+'b','o','a',    /* -BOAT */
-       04,0200+'w','h','a',    /* -WHAT */
-       04,0200+'c','u','i',    /* -CUIT */
-       00
-};
-
-static char sufy[] = {
-       040+04,'e','s',0200+'t',        /* ES-TY */
-       040+05,'q','u','i',0200+'t',    /* QUI-TY */
-       04,0200+'t','i',0200+'t',       /* -TI-TY */
-       040+05,'o','s',0200+'i',0200+'t',       /* OS-I-TY */
-       04,0200+'s','i',0200+'t',       /* -SI-TY */
-       05,'i','n',0200+'i',0200+'t',   /* IN-I-TY */
-       04,'n','i',0200+'t',    /* NI-TY */
-       040+010,'f','a',0200+'b','i','l',0200+'i',0200+'t',     /* FA-BIL-I-TY */
-       010,0200+'c','a',0200+'b','i','l',0200+'i',0200+'t',    /* -CA-BIL-I-TY */
-       010,0200+'p','a',0200+'b','i','l',0200+'i',0200+'t',    /* -PA-BIL-I-TY */
-       06,0200+'b','i','l',0200+'i',0200+'t',  /* -BIL-I-TY */
-       03,'i',0200+'t',        /* I-TY */
-       04,0200+'b','u','r',    /* -BUR-Y */
-       04,0200+'t','o',0200+'r',       /* -TO-RY */
-       05,0200+'q','u','a','r',        /* -QUAR-Y */
-       040+04,'u',0200+'a','r',        /* U-ARY */
-       07,0200+'m','e','n',0200+'t','a',0200+'r',      /* -MEN-TA-RY */
-       06,'i','o','n',0200+'a','r',    /* ION-ARY */
-       04,'i',0200+'a','r',    /* I-ARY */
-       04,'n',0200+'o',0200+'m',       /* N-O-MY */
-       03,0200+'p','l',        /* -PLY */
-       04,'g',0200+'g','l',    /* G-GLY */
-       05,0200+'p','a',0200+'b','l',   /* -PA-BLY */
-       05,'f','a',0200+'b','l',        /* FA-BLY */
-       05,0200+'c','a',0200+'b','l',   /* -CA-BLY */
-       04,0200+'a','b','l',    /* -ABLY */
-       03,0200+'b','l',        /* -BLY */
-       02,0200+'l',    /* -LY */
-       03,0200+'s','k',        /* -SKY */
-       040+06,'g',0200+'r','a',0200+'p','h',   /* G-RA-PHY */
-       04,'l',0200+'o',0200+'g',       /* L-O-GY */
-       02,0200+'f',    /* -FY */
-       03,0200+'n','e',        /* -NEY */
-       03,0200+'l','e',        /* -LEY */
-       04,'c','k',0200+'e',    /* CK-EY */
-       03,0200+'k','e',        /* -KEY */
-       04,0200+'b','o','d',    /* -BODY */
-       05,0200+'s','t','u','d',        /* -STUDY */
-       0340+04,'e','e','d',    /* EEDY */
-       02,0200+'b',    /* -BY */
-       03,0200+'w','a',        /* -WAY */
-       03,0200+'d','a',        /* -DAY */
-       00
-};
-
-char   *suftab[] = {
-       sufa,
-       0,
-       sufc,
-       sufd,
-       sufe,
-       suff,
-       sufg,
-       sufh,
-       sufi,
-       0,
-       sufk,
-       sufl,
-       sufm,
-       sufn,
-       sufo,
-       sufp,
-       0,
-       sufr,
-       sufs,
-       suft,
-       0,
-       0,
-       0,
-       0,
-       sufy,
-       0,
-};
diff --git a/.ref-Research-V7/usr/src/cmd/troff/t10.c b/.ref-Research-V7/usr/src/cmd/troff/t10.c
deleted file mode 100644 (file)
index dbd4567..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-/*
-troff10.c
-
-CAT interface
-*/
-
-extern int *olinep;
-extern int oline[];
-extern int *pslp;
-extern int back;
-extern int xpts;
-extern int mpts;
-extern int po;
-extern int xflg;
-extern int line[];
-extern int lss;
-extern int xbitf;
-extern char obuf[];
-extern char *obufp;
-extern int esct;
-extern int trflg;
-extern int cs;
-extern int smnt;
-extern int mfont;
-extern int xfont;
-extern int code;
-extern int mcase;
-extern int esc;
-extern int lead;
-extern int paper;
-extern int cps;
-extern int psflg;
-extern int ptid;
-extern int verm;
-extern int escm;
-extern char pstab[], psctab[];
-extern int dpn;
-extern int ascii;
-int mrail = 0; /*0=LR,1=UR*/
-int mmag = 1; /*0=UM,1=LM*/
-extern int nofeed;
-extern int gflag;
-extern int fontlab[];
-int papflg;
-extern int pfont;
-extern int ppts;
-extern int oldbits;
-extern int bd;
-extern int vflag;
-extern int stopmesg;
-extern int xxx;
-
-ptinit(){
-
-       if(ascii || gflag)return;
-       oput(T_INIT);
-       esc = T_IESC;
-       ptesc();
-       esct = 0;
-       esc = po;
-       oput(0140); /*some initial lead*/
-}
-ptout(i)
-int i;
-{
-       register *k, lw, *j;
-       int ds, de, inith, temp, *slp, dv;
-       int psl[16];
-
-       if((i & CMASK) != '\n'){
-               *olinep++ = i;
-               return;
-       }
-       if(olinep == oline){
-               lead += lss;
-               return;
-       }
-       pslp = psl;
-       *pslp = lw = inith = dv = 0;
-       for(k=oline; k<olinep; k++){
-               trflg++;
-               xbitf = 1;
-               lw += width(*k);
-               if((*k & (MOT | VMOT)) == (MOT | VMOT)){
-                       temp = *k & ~MOTV;
-                       if(*k & NMOT)temp = -temp;
-                       dv += temp;
-               }
-               if(!(*k & MOT) && xflg)for(j=psl; j<=pslp; j++){
-                       if(xpts == *j)break;
-                       if(j == pslp){
-                               *j = xpts;
-                               *++pslp = 0;
-                               break;
-                       }
-               }
-       }
-       if(dv){
-               vflag++;
-               *olinep++ = makem(-dv);
-               vflag = 0;
-       }
-       if(xflg){
-       --pslp;
-               for(j=psl; j<=pslp; j++){
-                       if(*j == mpts){
-                               temp = *j;
-                               *j = *pslp;
-                               *pslp = temp;
-                               break;
-                       }
-               }
-       }
-       for(k=oline; k<olinep; k++){
-               if(!(*k & MOT) || (*k & VMOT))break;
-               *k &= ~MOT;
-               if(*k & NMOT){
-                       *k &= ~NMOT;
-                       *k = -*k;
-               }
-               inith += *k;
-       }
-       lead += dip->blss + lss;
-       dip->blss = 0;
-       slp = k;
-scan:
-       temp = esct - po;
-       if(mpts & DBL)temp -= 55;
-       ds = temp - inith;
-       de = lw - temp;
-       if(de >= ds){
-               back = 0;
-               esc = -ds;
-               for(k=slp; k<olinep; k++)ptout0(*k);
-       }else{
-               back = 1;
-               esc = de;
-               for(k = olinep-1; k>=slp; --k)ptout0(*k);
-       }
-       if(xflg && (--pslp >= psl))goto scan;
-       olinep = oline;
-       lead += dip->alss;
-       dip->alss = 0;
-}
-ptout0(i)
-int i;
-{
-       register j, k, w;
-       int z;
-
-       if(i & MOT){
-               j = i & ~MOTV;
-               if(i & NMOT)j = -j;
-               if(back)j = -j;
-               if(i & VMOT)lead += j;
-               else esc += j;
-               return;
-       }
-       xbitf = 2;
-       if((i>>BYTE) == oldbits){
-               xfont = pfont;
-               xpts = ppts;
-               xbitf = 0;
-       }else xbits(i);
-       if((k = (i & CMASK)) < 040){
-               return;
-       }
-       w = getcw(k-32);
-       if(cs){
-               if(bd)w += bd - 1;
-               j = (cs-w)/2;
-               w = cs - j;
-               if(bd)w -= bd - 1;
-       }else j = 0;
-       if(i & ZBIT){
-               if(cs)w = -j; else w = 0;
-               z = 1;
-       }else z = 0;
-       if(back){
-               k = j;
-               j = -w;
-               w = -k;
-       }
-       esc += j;
-       if((!xflg || (xpts == *pslp)) && (code & 077)){
-               if(code & 0200){
-                       if(smnt)xfont = smnt -1;
-                       else goto p1;
-               }
-               if((k=(code>>6)&01)^mcase)oput((mcase=k)+0105);
-               if(xfont != mfont){
-                       mfont = xfont;
-                       if(mrail != (xfont&01))
-                               oput(0101 + (mrail=xfont&01));
-                       if(mmag != (xfont<2))
-                               oput(0103 + (mmag=(xfont<2)));
-               }
-               if(xpts != mpts)ptps();
-               if(lead)ptlead();
-               if(esc)ptesc();
-/*
-               oput(code & 077);
-*/
-               *obufp++ = code & 077;
-               if(obufp == (obuf + OBUFSZ + ascii - 1))flusho();
-               if(bd){
-                       bd -= 1;
-                       if(back && !z)bd = -bd;
-                       if(esc += bd)ptesc();
-                       oput(code & 077);
-                       if(z)esc -= bd;
-               }
-       }else if(bd && !z){
-               bd -= 1;
-               if(back)bd = -bd;
-               esc += bd;
-       }
-p1:
-       esc += w;
-       return;
-}
-ptps(){
-       register i, j, k;
-
-       if(psflg)return;
-       if(cps){
-               psflg++;
-               i = findps(cps);
-       }else i = xpts;
-       for(j=0; (i&077) > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;}
-       j = psctab[j];
-       oput((j & ~0200) | 0120);
-       if((!(mpts & DBL))^(!(j & 0200))){
-               if(j & 0200)k = 55;
-                       else k = -55;
-               esc += k;
-       }
-       mpts = i;
-}
-ptlead(){
-       register i, k;
-
-       if(k = lead < 0)lead = -lead;
-       if(k^verm)oput(0112 + ((verm=k)<<1));
-       if(((k=lead)%3) == 2)k++;
-       k /= 3;
-       while(k > 0){
-               if((i=31) > k)i = k;
-               if(verm)paper -= i;
-                       else paper += i;
-               oput(((~i) & 037) | 0140);
-               if((paper > (11*144*15)) && !papflg && ptid != 1){
-                       prstr("Excessive paper use.\n");
-                       papflg++;
-                       if(ptid != 1){
-                               lead = 0;
-                               done2(0200);
-                       }
-               }
-               k -= i;
-       }
-       lead = 0;
-}
-ptesc(){
-       register i, j, k;
-
-       if(k = esc < 0)esc = -esc;
-       if(k^escm)oput(0107 + (escm=k));
-       k = esc;
-       while(k > 0){
-               if((i=127) > k)i = k;
-               if(((j = (esct + i*(1-2*escm))) > (46*72+18-T_IESC)) ||
-                  (j < 0))break;
-/*
-               oput(~i);
-*/
-               *obufp++ = ~i;
-               if(obufp == (obuf + OBUFSZ + ascii - 1))flusho();
-               esct = j;
-               k -= i;
-       }
-       esc = 0;
-}
-dostop(){
-       register i;
-
-       if(ascii)return;
-       if(!nofeed && !gflag)lead += TRAILER;
-       ptlead();
-       flusho();
-       oput(T_INIT);
-       oput(T_STOP);
-       if(gflag){
-               oput('f');
-               for(i=0; i<4; i++){
-                       oput(fontlab[i] & BMASK);
-                       oput((fontlab[i]>>BYTE) & BMASK);
-               }
-       }else for(i=8; i>0; i--)oput(T_PAD);
-       flusho();
-       if(stopmesg)prstr("Pages finished.\n");
-       mcase = mpts = mfont = mrail = verm = escm = 0;
-       mmag = 1;
-       report();
-       paper = 0;
-       esc = T_IESC;
-       ptesc();
-       esct = 0;
-       esc = po;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/t6.c b/.ref-Research-V7/usr/src/cmd/troff/t6.c
deleted file mode 100644 (file)
index 7d3ea91..0000000
+++ /dev/null
@@ -1,603 +0,0 @@
-#include "tdef.h"
-extern
-#include "d.h"
-extern
-#include "v.h"
-
-/*
-troff6.c
-
-width functions, sizes and fonts
-*/
-
-extern int eschar;
-extern int widthp;
-extern int ohc;
-extern int xpts;
-extern int xfont;
-extern int code;
-extern int smnt;
-extern int setwdf;
-extern int cs;
-extern int ccs;
-extern int spacesz;
-extern char trtab[];
-extern int xbitf;
-extern int mfont;
-extern int mpts;
-extern int pfont;
-extern int ppts;
-extern int oldbits;
-extern int chbits;
-extern int spbits;
-extern int nonumb;
-extern int noscale;
-extern int font;
-extern int font1;
-extern int pts;
-extern int pts1;
-extern int apts;
-extern int apts1;
-extern int sps;
-extern int nlflg;
-extern int nform;
-extern int dfact;
-extern int lss;
-extern int lss1;
-extern int vflag;
-extern int ch0;
-extern int lg;
-char fontfile[] = "/usr/lib/font/ftXX";
-int ffi = 16;
-extern int bd;
-extern int level;
-extern int ch;
-extern int res;
-extern int ptid;
-extern char W1[],W2[],W3[],W4[];
-extern int xxx;
-int trflg;
-char *fontab[] = {W1,W2,W3,W4};
-int fontlab[] = {'R','I','B','S',0};
-char pstab[] = {6,7,8,9,10,11,12,14,16,18,20,22,24,28,36,0};
-char psctab[] = {010,000,001,007,002,003,004,005,0211,006,
-               0212,0213,0214,0215,0216,0};
-int cstab[4], ccstab[4];
-int bdtab[4];
-int sbold = 0;
-int spsz = 0;
-struct fz {
-       char sign;
-       char size;
-       int inc;
-       } fz[4];
-
-width(c)
-int c;
-{
-       register i,j,k;
-
-       j = c;
-       k = 0;
-       if(j & MOT){
-               if(j & VMOT)goto rtn;
-               k = j & ~MOTV;
-               if(j & NMOT)k = -k;
-               goto rtn;
-       }
-       if((i = (j & CMASK)) == 010){
-               k = -widthp;
-               goto rtn;
-       }
-       if(i == PRESC)i = eschar;
-       if((i == ohc) ||
-          (i >= 0370))goto rtn;
-       if((j>>BYTE) == oldbits){
-               xfont = pfont;
-               xpts = ppts;
-       }else xbits(j);
-       if(j & ZBIT)goto rtn;
-       if(!trflg)i = trtab[i] & BMASK;
-       if((i -= 32) < 0)goto rtn;
-       k = getcw(i);
-       if(bd)k += bd - 1;
-       if(cs)k = cs;
-       widthp = k;
-rtn:
-       xbitf = trflg = 0;
-       return(k);
-}
-getcw(i)
-int i;
-{
-       register j,k;
-       register char *p;
-       int x;
-       extern char codetab[];
-
-       bd = 0;
-       if((code = codetab[i])  & 0200){
-               if(smnt){
-                       p = fontab[smnt-1];
-                       if(xfont == (sbold-1))bd = bdtab[smnt-1];
-                       goto g0;
-               }
-               code = 0;
-               k = 36;
-               goto g1;
-       }
-       p = fontab[xfont];
-g0:
-       if(!i)k = spacesz;
-       else k = *(p + i) & BMASK;
-       if(setwdf)v.ct |= ((k>>6) & 3);
-g1:
-       k = (j = (k&077)*(xpts&077))/6;
-       if((j%6) >= 3)k++;
-       if(cs = cstab[xfont]){
-               if(ccs = ccstab[xfont])x = ccs; else x = xpts;
-               cs = (j = (cs&077)*(x&077))/6;
-               if((j%6) >= 3)cs++;
-       }
-       if(!bd)bd = bdtab[xfont];
-       return(k);
-}
-xbits(i)
-int i;
-{
-       register j, k;
-
-/*
-       if((j = i >> BYTE) == oldbits){
-               xfont = pfont;
-               xpts = ppts;
-               goto rtn;
-       }
-*/
-       j = i >> BYTE;
-       xfont = (j>>1) & 03;
-       if(k = (j>>3) & 017){
-               xpts = pstab[--k];
-               if(psctab[k] < 0)xpts |= DBL;
-               oldbits = j;
-               pfont = xfont;
-               ppts = xpts;
-               goto rtn;
-       }
-       switch(xbitf){
-               case 0:
-                       xfont = font;
-                       xpts = pts;
-                       break;
-               case 1:
-                       xfont = pfont;
-                       xpts = ppts;
-                       break;
-               case 2:
-                       xfont = mfont;
-                       xpts = mpts;
-       }
-rtn:
-       xbitf = 0;
-}
-setch(){
-       register i,*j,k;
-       extern int chtab[];
-
-       if((i = getrq()) == 0)return(0);
-       for(j=chtab;*j != i;j++)if(*(j++) == 0)return(0);
-       k = *(++j) | chbits;
-/*
-       if((i & CMASK) == '*'){
-               if(((i = find('R',fontlab)) < 0) &&
-                  ((i = find('G',fontlab)) < 0))
-                       return(k);
-               else return((k & ~(03<<(BYTE+1))) | (i<<(BYTE+1)));
-       }
-*/
-       return(k);
-}
-find(i,j)
-int i,j[];
-{
-       register k;
-
-       if(((k = i-'0') >= 1) && (k <= 4) && (k != smnt))return(--k);
-       for(k=0; j[k] != i; k++)if(j[k] == 0)return(-1);
-       return(k);
-}
-casefz(){
-       register i, j, k;
-       int savinc;
-
-       k = 0;
-fz0:
-       if(skip() || !(i = getrq()) ||
-         ((j = find(i,fontlab))  == -1)){
-               if(k)goto fz1;
-               else return;
-       }
-       if(j == (smnt-1)){
-               k = smnt;
-               goto fz0;
-       }
-       if(k){
-               spsz = j + 1;
-               j = k -1;
-       }
-fz1:
-       if((j==font) && fz[j].inc)savinc = fz[j].inc;
-       else savinc = 0;
-       fz[j].inc = fz[j].sign = fz[j].size = 0;
-       if(skip()){
-               if(k)spsz = 0;
-               goto fz2;
-       }
-       if(((i=((k=getch()) & CMASK)) == '+') || (i == '-'))fz[j].sign = i;
-       else{
-               fz[j].sign = 0;
-               ch = k;
-       }
-       noscale++;
-       fz[j].size = atoi();
-       noscale = 0;
-fz2:
-       if(j==font)casps1(apts + savinc);
-       else if(j == smnt-1)mchbits();
-}
-caseps(){
-       register i;
-
-       if(skip())i = apts1;
-       else{
-               noscale++;
-               i = inumb(&apts);
-               noscale = 0;
-               if(nonumb)return;
-       }
-       casps1(i);
-}
-casps1(i)
-int i;
-{
-       if(i <= 0)return;
-       if(fz[font].size){
-               i = getfz(font, i);
-       }
-       apts1 = apts;
-       apts = i;
-       pts1 = pts;
-       pts = findps(i & 077);
-       mchbits();
-}
-findps(i)
-int i;
-{
-       register j, k;
-
-       for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;}
-       if(psctab[j] < 0)k |= DBL;
-       return(k);
-}
-mchbits(){
-       register i, j, k;
-
-       spbits = 0;
-       i = pts & 077;
-       for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;}
-       chbits = (((++j)<<2) | font) << (BYTE + 1);
-       sps = width(' ' | chbits);
-       if(font == (spsz-1)){
-               i = findps(getfz(smnt-1, apts + fz[font].inc));
-               for(j=0; i > (k = pstab[j]);j++)if(!k){k=pstab[--j];break;}
-               spbits = (((++j)<<2) | font) << (BYTE + 1);
-       }
-}
-getfz(x,y)
-int x, y;
-{
-       register i, j, k;
-
-       i = fz[x].size;
-       j = fz[x].sign;
-       if(i || j){
-               if(j == '+')i += y;
-               else if(j == '-')i = y - i;
-       }
-       fz[x].inc = y - i;
-       return(i);
-}
-setps(){
-       register i,j;
-
-       if((((i=getch() & CMASK) == '+')  || (i == '-')) &&
-         (((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9))){
-               if(i == '-')j = -j;
-               ch = 0;
-               casps1(apts+j);
-               return;
-       }
-       if((i -= '0') == 0){
-               casps1(apts1);
-               return;
-       }
-       if((i > 0) && (i <= 9)){
-               if((i <= 3) &&
-                 ((j=(ch = getch() & CMASK) - '0') >= 0) && (j <= 9)){
-                       i = 10*i +j;
-                       ch = 0;
-               }
-               casps1(i);
-       }
-}
-caseft(){
-       skip();
-       setfont(1);
-}
-setfont(a)
-int a;
-{
-       register i,j;
-
-       if(a)i = getrq();
-               else i = getsn();
-       if(!i || (i == 'P')){
-               j = font1;
-               goto s0;
-       }
-       if(i == 'S')return;
-       if((j = find(i,fontlab))  == -1)return;
-s0:
-       font1 = font;
-       font = j;
-       i = 0;
-       if(fz[font1].size){
-               i++;
-               casps1(apts + fz[font1].inc);
-       }else if(fz[font].size){
-               i++;
-               casps1(apts);
-       }
-       if(!i)mchbits();
-}
-setwd(){
-       register i, base, wid;
-       int delim, em, k;
-       int savlevel, savhp, savapts, savapts1, savfont, savfont1,
-               savpts, savpts1;
-
-       base = v.st = v.sb = wid = v.ct = 0;
-       if((delim = getch() & CMASK) & MOT)return;
-       savhp = v.hp;
-       savlevel = level;
-       v.hp = level = 0;
-       savapts = apts;
-       savapts1 = apts1;
-       savfont = font;
-       savfont1 = font1;
-       savpts = pts;
-       savpts1 = pts1;
-       setwdf++;
-       while((((i = getch()) & CMASK) != delim) && !nlflg){
-               wid += width(i);
-               if(!(i & MOT)){
-                       em = (xpts & 077)*6;
-               }else if(i & VMOT){
-                       k = i & ~MOTV;
-                       if(i & NMOT)k = -k;
-                       base -= k;
-                       em = 0;
-               }else continue;
-               if(base < v.sb)v.sb = base;
-               if((k=base + em) > v.st)v.st = k;
-       }
-       nform = 0;
-       setn1(wid);
-       v.hp = savhp;
-       level = savlevel;
-       apts = savapts;
-       apts1 = savapts1;
-       font = savfont;
-       font1 = savfont1;
-       pts = savpts;
-       pts1 = savpts1;
-       mchbits();
-       setwdf = 0;
-}
-vmot(){
-       dfact = lss;
-       vflag++;
-       return(mot());
-}
-hmot(){
-       dfact = 6 * (pts & 077);
-       return(mot());
-}
-mot(){
-       register i, j;
-
-       j = HOR;
-       getch(); /*eat delim*/
-       if(i = atoi()){
-               if(vflag)j = VERT;
-               i = makem(quant(i,j));
-       }
-       getch();
-       vflag = 0;
-       dfact = 1;
-       return(i);
-}
-sethl(k)
-int k;
-{
-       register i;
-
-       i = 3 * (pts & 077);
-       if(k == 'u')i = -i;
-       else if(k == 'r')i = -2*i;
-       vflag++;
-       i = makem(i);
-       vflag = 0;
-       return(i);
-}
-makem(i)
-int i;
-{
-       register j;
-
-       if((j = i) < 0)j = -j;
-       j = (j & ~MOTV) | MOT;
-       if(i < 0)j |= NMOT;
-       if(vflag)j |= VMOT;
-       return(j);
-}
-getlg(i)
-int i;
-{
-       register j, k;
-
-       switch((j = getch0()) & CMASK){
-               case 'f':
-                       if(lg!=2){switch((k =getch0()) & CMASK){
-                                       case 'i':
-                                               j = 0214;
-                                               break;
-                                       case 'l':
-                                               j = 0215;
-                                               break;
-                                       default:
-                                               ch0 = k;
-                                               j = 0213;
-                               }
-                       }else j = 0213;
-                       break;
-               case 'l':
-                       j = 0212;
-                       break;
-               case 'i':
-                       j = 0211;
-                       break;
-               default:
-                       ch0 = j;
-                       j = i;
-       }
-       return((i & ~CMASK) | j);
-}
-caselg(){
-
-       lg = 1;
-       if(skip())return;
-       lg = atoi();
-}
-casefp(){
-       register i, j, k;
-       int x;
-
-       skip();
-       if(((i = (getch() & CMASK) - '0' -1) < 0) || (i >3)){prstr("fp: bad font position\n"); return;}
-       if(skip() || !(j = getrq())){prstr("fp: no font name\n"); return;}
-       fontfile[ffi] = j & BMASK;
-       fontfile[ffi+1] = j>>BYTE;
-       if((k = open(fontfile,0)) < 0){
-               prstr("Cannot open ");
-       c0:
-               prstr(fontfile);
-               prstr("\n");
-               done(-1);
-       }
-       if(lseek(k,8L * sizeof(int),0) < 0)goto c1;
-       if(read(k,fontab[i],256-32) != 256-32){
-       c1:
-               prstr("Cannot read ");
-               goto c0;
-       }
-       close(k);
-       if(i == (smnt-1)){smnt = 0; sbold = 0; spsz = 0;}
-       if((fontlab[i] = j) == 'S')smnt = i + 1;
-       bdtab[i] = cstab[i] = ccstab[i] = 0;
-       fz[i].inc = fz[i].sign = fz[i].size = 0;
-       if(ptid != 1){
-               prstr("Mount font ");
-               prstr(&fontfile[ffi]);
-               prstr(" on ");
-               x = PAIR((i + '1'),0);
-               prstr((char *)&x);
-               prstr("\n");
-       }
-}
-casecs(){
-       register i, j;
-
-       noscale++;
-       skip();
-       if(!(i=getrq()) ||
-         ((i = find(i,fontlab)) < 0))goto rtn;
-       skip();
-       cstab[i] = atoi();
-       skip();
-       j = atoi();
-       if(!nonumb)ccstab[i] = findps(j);
-rtn:
-       noscale = 0;
-}
-casebd(){
-       register i, j, k;
-
-       k = 0;
-bd0:
-       if(skip() || !(i = getrq()) ||
-         ((j = find(i,fontlab))  == -1)){
-               if(k)goto bd1;
-               else return;
-       }
-       if(j == (smnt-1)){
-               k = smnt;
-               goto bd0;
-       }
-       if(k){
-               sbold = j + 1;
-               j = k -1;
-       }
-bd1:
-       skip();
-       noscale++;
-       bdtab[j] = atoi();
-       noscale = 0;
-}
-casevs(){
-       register i;
-
-       skip();
-       vflag++;
-       dfact = 6; /*default scaling is points!*/
-       res = VERT;
-       i = inumb(&lss);
-       if(nonumb)i = lss1;
-       if(i < VERT)i = VERT;
-       lss1 = lss;
-       lss = i;
-}
-casess(){
-       register i;
-
-       noscale++;
-       skip();
-       if(i = atoi()){
-               spacesz = i& 0177;
-               sps = width(' ' | chbits);
-       }
-       noscale = 0;
-}
-xlss(){
-       register i, j;
-
-       getch();
-       dfact = lss;
-       i = quant(atoi(),VERT);
-       dfact = 1;
-       getch();
-       if((j = i) < 0)j = -j;
-       ch0 = ((j & 03700)<<3) | HX;
-       if(i < 0)ch0 |= 040000;
-       return(((j & 077)<<9) | LX);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/troff/tab3.c b/.ref-Research-V7/usr/src/cmd/troff/tab3.c
deleted file mode 100644 (file)
index fea3cd0..0000000
+++ /dev/null
@@ -1,892 +0,0 @@
-#define BYTE 8
-#define PAIR(A,B) (A|(B<<BYTE))
-/*
-character name and code tables
-default width tables
-modified for BTL special font version 4
-and Commercial II
-*/
-
-int chtab [] = {
-PAIR('h','y'), 0200,   /*hyphen*/
-PAIR('b','u'), 0201,   /*bullet*/
-PAIR('s','q'), 0202,   /*square*/
-PAIR('e','m'), 0203,   /*3/4em*/
-PAIR('r','u'), 0204,   /*rule*/
-PAIR('1','4'), 0205,   /*1/4*/
-PAIR('1','2'), 0206,   /*1/2*/
-PAIR('3','4'), 0207,   /*3/4*/
-PAIR('m','i'), 0302,   /*equation minus*/
-PAIR('f','i'), 0211,   /*fi*/
-PAIR('f','l'), 0212,   /*fl*/
-PAIR('f','f'), 0213,   /*ff*/
-PAIR('F','i'), 0214,   /*ffi*/
-PAIR('F','l'), 0215,   /*ffl*/
-PAIR('d','e'), 0216,   /*degree*/
-PAIR('d','g'), 0217,   /*dagger*/
-PAIR('s','c'), 0220,   /*section*/
-PAIR('f','m'), 0221,   /*foot mark*/
-PAIR('a','a'), 0222,   /*acute accent*/
-PAIR('g','a'), 0223,   /*grave accent*/
-PAIR('u','l'), 0224,   /*underrule*/
-PAIR('s','l'), 0225,   /*slash (longer)*/
-PAIR('*','a'), 0230,   /*alpha*/
-PAIR('*','b'), 0231,   /*beta*/
-PAIR('*','g'), 0232,   /*gamma*/
-PAIR('*','d'), 0233,   /*delta*/
-PAIR('*','e'), 0234,   /*epsilon*/
-PAIR('*','z'), 0235,   /*zeta*/
-PAIR('*','y'), 0236,   /*eta*/
-PAIR('*','h'), 0237,   /*theta*/
-PAIR('*','i'), 0240,   /*iota*/
-PAIR('*','k'), 0241,   /*kappa*/
-PAIR('*','l'), 0242,   /*lambda*/
-PAIR('*','m'), 0243,   /*mu*/
-PAIR('*','n'), 0244,   /*nu*/
-PAIR('*','c'), 0245,   /*xi*/
-PAIR('*','o'), 0246,   /*omicron*/
-PAIR('*','p'), 0247,   /*pi*/
-PAIR('*','r'), 0250,   /*rho*/
-PAIR('*','s'), 0251,   /*sigma*/
-PAIR('*','t'), 0252,   /*tau*/
-PAIR('*','u'), 0253,   /*upsilon*/
-PAIR('*','f'), 0254,   /*phi*/
-PAIR('*','x'), 0255,   /*chi*/
-PAIR('*','q'), 0256,   /*psi*/
-PAIR('*','w'), 0257,   /*omega*/
-PAIR('*','A'), 0101,   /*Alpha*/
-PAIR('*','B'), 0102,   /*Beta*/
-PAIR('*','G'), 0260,   /*Gamma*/
-PAIR('*','D'), 0261,   /*Delta*/
-PAIR('*','E'), 0105,   /*Epsilon*/
-PAIR('*','Z'), 0132,   /*Zeta*/
-PAIR('*','Y'), 0110,   /*Eta*/
-PAIR('*','H'), 0262,   /*Theta*/
-PAIR('*','I'), 0111,   /*Iota*/
-PAIR('*','K'), 0113,   /*Kappa*/
-PAIR('*','L'), 0263,   /*Lambda*/
-PAIR('*','M'), 0115,   /*Mu*/
-PAIR('*','N'), 0116,   /*Nu*/
-PAIR('*','C'), 0264,   /*Xi*/
-PAIR('*','O'), 0117,   /*Omicron*/
-PAIR('*','P'), 0265,   /*Pi*/
-PAIR('*','R'), 0120,   /*Rho*/
-PAIR('*','S'), 0266,   /*Sigma*/
-PAIR('*','T'), 0124,   /*Tau*/
-PAIR('*','U'), 0270,   /*Upsilon*/
-PAIR('*','F'), 0271,   /*Phi*/
-PAIR('*','X'), 0130,   /*Chi*/
-PAIR('*','Q'), 0272,   /*Psi*/
-PAIR('*','W'), 0273,   /*Omega*/
-PAIR('s','r'), 0274,   /*square root*/
-PAIR('t','s'), 0275,   /*terminal sigma*/
-PAIR('r','n'), 0276,   /*root en*/
-PAIR('>','='), 0277,   /*>=*/
-PAIR('<','='), 0300,   /*<=*/
-PAIR('=','='), 0301,   /*identically equal*/
-PAIR('~','='), 0303,   /*approx =*/
-PAIR('a','p'), 0304,   /*approximates*/
-PAIR('!','='), 0305,   /*not equal*/
-PAIR('-','>'), 0306,   /*right arrow*/
-PAIR('<','-'), 0307,   /*left arrow*/
-PAIR('u','a'), 0310,   /*up arrow*/
-PAIR('d','a'), 0311,   /*down arrow*/
-PAIR('e','q'), 0312,   /*equation equal*/
-PAIR('m','u'), 0313,   /*multiply*/
-PAIR('d','i'), 0314,   /*divide*/
-PAIR('+','-'), 0315,   /*plus-minus*/
-PAIR('c','u'), 0316,   /*cup (union)*/
-PAIR('c','a'), 0317,   /*cap (intersection)*/
-PAIR('s','b'), 0320,   /*subset of*/
-PAIR('s','p'), 0321,   /*superset of*/
-PAIR('i','b'), 0322,   /*improper subset*/
-PAIR('i','p'), 0323,   /*  " superset*/
-PAIR('i','f'), 0324,   /*infinity*/
-PAIR('p','d'), 0325,   /*partial derivative*/
-PAIR('g','r'), 0326,   /*gradient*/
-PAIR('n','o'), 0327,   /*not*/
-PAIR('i','s'), 0330,   /*integral sign*/
-PAIR('p','t'), 0331,   /*proportional to*/
-PAIR('e','s'), 0332,   /*empty set*/
-PAIR('m','o'), 0333,   /*member of*/
-PAIR('p','l'), 0334,   /*equation plus*/
-PAIR('r','g'), 0335,   /*registered*/
-PAIR('c','o'), 0336,   /*copyright*/
-PAIR('b','r'), 0337,   /*box vert rule*/
-PAIR('c','t'), 0340,   /*cent sign*/
-PAIR('d','d'), 0341,   /*dbl dagger*/
-PAIR('r','h'), 0342,   /*right hand*/
-PAIR('l','h'), 0343,   /*left hand*/
-PAIR('*','*'), 0344,   /*math * */
-PAIR('b','s'), 0345,   /*bell system sign*/
-PAIR('o','r'), 0346,   /*or*/
-PAIR('c','i'), 0347,   /*circle*/
-PAIR('l','t'), 0350,   /*left top (of big curly)*/
-PAIR('l','b'), 0351,   /*left bottom*/
-PAIR('r','t'), 0352,   /*right top*/
-PAIR('r','b'), 0353,   /*right bot*/
-PAIR('l','k'), 0354,   /*left center of big curly bracket*/
-PAIR('r','k'), 0355,   /*right center of big curly bracket*/
-PAIR('b','v'), 0356,   /*bold vertical*/
-PAIR('l','f'), 0357,   /*left floor (left bot of big sq bract)*/
-PAIR('r','f'), 0360,   /*right floor (rb of ")*/
-PAIR('l','c'), 0361,   /*left ceiling (lt of ")*/
-PAIR('r','c'), 0362,   /*right ceiling (rt of ")*/
-0,0};
-
-char codetab[256-32] = {       /*cat codes*/
-00,    /*space*/
-0145,  /*!*/
-0230,  /*"*/
-0337,  /*#*/
-0155,  /*$*/
-053,   /*%*/
-050,   /*&*/
-032,   /*' close*/
-0132,  /*(*/
-0133,  /*)*/
-0122,  /***/
-0143,  /*+*/
-047,   /*,*/
-040,   /*- hyphen*/
-044,   /*.*/
-043,   /*/*/
-0110,  /*0*/
-0111,  /*1*/
-0112,  /*2*/
-0113,  /*3*/
-0114,  /*4*/
-0115,  /*5*/
-0116,  /*6*/
-0117,  /*7*/
-0120,  /*8*/
-0121,  /*9*/
-0142,  /*:*/
-023,   /*;*/
-0303,  /*<*/
-0140,  /*=*/
-0301,  /*>*/
-0147,  /*?*/
-0222,  /*@*/
-0103,  /*A*/
-075,   /*B*/
-070,   /*C*/
-074,   /*D*/
-072,   /*E*/
-0101,  /*F*/
-065,   /*G*/
-060,   /*H*/
-066,   /*I*/
-0105,  /*J*/
-0107,  /*K*/
-063,   /*L*/
-062,   /*M*/
-061,   /*N*/
-057,   /*O*/
-067,   /*P*/
-055,   /*Q*/
-064,   /*R*/
-076,   /*S*/
-056,   /*T*/
-0106,  /*U*/
-071,   /*V*/
-0104,  /*W*/
-0102,  /*X*/
-077,   /*Y*/
-073,   /*Z*/
-0134,  /*[*/
-0241,  /*\*/
-0135,  /*]*/
-0336,  /*^*/
-0240,  /*_*/
-030,   /*` open*/
-025,   /*a*/
-012,   /*b*/
-027,   /*c*/
-011,   /*d*/
-031,   /*e*/
-014,   /*f*/
-045,   /*g*/
-001,   /*h*/
-006,   /*i*/
-015,   /*j*/
-017,   /*k*/
-005,   /*l*/
-004,   /*m*/
-003,   /*n*/
-033,   /*o*/
-021,   /*p*/
-042,   /*q*/
-035,   /*r*/
-010,   /*s*/
-002,   /*t*/
-016,   /*u*/
-037,   /*v*/
-041,   /*w*/
-013,   /*x*/
-051,   /*y*/
-007,   /*z*/
-0332,  /*{*/
-0151,  /*|*/
-0333,  /*}*/
-0342,  /*~*/
-00,    /*narrow space*/
-040,   /*hyphen*/
-0146,  /*bullet*/
-0154,  /*square*/
-022,   /*3/4 em*/
-026,   /*rule*/
-034,   /*1/4*/
-036,   /*1/2*/
-046,   /*3/4*/
-0123,  /*minus*/
-0124,  /*fi*/
-0125,  /*fl*/
-0126,  /*ff*/
-0131,  /*ffi*/
-0130,  /*ffl*/
-0136,  /*degree*/
-0137,  /*dagger*/
-0355,  /*section*/
-0150,  /*foot mark*/
-0334,  /*acute accent*/
-0335,  /*grave accent*/
-0240,  /*underrule*/
-0304,  /*slash (longer)*/
-00,    /*half nar sp*/
-00,    /**/
-0225,  /*alpha*/
-0212,  /*beta*/
-0245,  /*gamma*/
-0211,  /*delta*/
-0231,  /*epsilon*/
-0207,  /*zeta*/
-0214,  /*eta*/
-0202,  /*theta*/
-0206,  /*iota*/
-0217,  /*kappa*/
-0205,  /*lambda*/
-0204,  /*mu*/
-0203,  /*nu*/
-0213,  /*xi*/
-0233,  /*omicron*/
-0221,  /*pi*/
-0235,  /*rho*/
-0210,  /*sigma*/
-0237,  /*tau*/
-0216,  /*upsilon*/
-0215,  /*phi*/
-0227,  /*chi*/
-0201,  /*psi*/
-0251,  /*omega*/
-0265,  /*Gamma*/
-0274,  /*Delta*/
-0256,  /*Theta*/
-0263,  /*Lambda*/
-0302,  /*Xi*/
-0267,  /*Pi*/
-0276,  /*Sigma*/
-00,    /**/
-0306,  /*Upsilon*/
-0255,  /*Phi*/
-0242,  /*Psi*/
-0257,  /*Omega*/
-0275,  /*square root*/
-0262,  /*terminal sigma (was root em)*/
-0261,  /*root en*/
-0327,  /*>=*/
-0326,  /*<=*/
-0330,  /*identically equal*/
-0264,  /*equation minus*/
-0277,  /*approx =*/
-0272,  /*approximates*/
-0331,  /*not equal*/
-0354,  /*right arrow*/
-0234,  /*left arrow*/
-0236,  /*up arrow*/
-0223,  /*down arrow*/
-0232,  /*equation equal*/
-0323,  /*multiply*/
-0324,  /*divide*/
-0325,  /*plus-minus*/
-0260,  /*cup (union)*/
-0305,  /*cap (intersection)*/
-0270,  /*subset of*/
-0271,  /*superset of*/
-0350,  /*improper subset*/
-0246,  /* improper superset*/
-0244,  /*infinity*/
-0273,  /*partial derivative*/
-0253,  /*gradient*/
-0307,  /*not*/
-0266,  /*integral sign*/
-0247,  /*proportional to*/
-0343,  /*empty set*/
-0341,  /*member of*/
-0353,  /*equation plus*/
-0141,  /*registered*/
-0153,  /*copyright*/
-0346,  /*box rule (was parallel sign)*/
-0127,  /*cent sign*/
-0345,  /*dbl dagger*/
-0250,  /*right hand*/
-0340,  /*left hand*/
-0347,  /*math * */
-0243,  /*bell system sign*/
-0226,  /*or (was star)*/
-0351,  /*circle*/
-0311,  /*left top (of big curly)*/
-0314,  /*left bottom*/
-0315,  /*right top*/
-0317,  /*right bot*/
-0313,  /*left center of big curly bracket*/
-0316,  /*right center of big curly bracket*/
-0312,  /*bold vertical*/
-0321,  /*left floor (left bot of big sq bract)*/
-0320,  /*right floor (rb of ")*/
-0322,  /*left ceiling (lt of ")*/
-0310}; /*right ceiling (rt of ")*/
-
-/*modified for Commercial II*/
-char W1[256-32] = {    /*Times Roman widths*/
-12,     /*space*/
-12,     /*!*/
-0,      /*"*/
-0,      /*#*/
-19,     /*$*/
-29,     /*%*/
-28,     /*&*/
-12,     /*' close*/
-16,     /*(*/
-16,     /*)*/
-16,     /***/
-36,     /*+*/
-12,     /*,*/
-13,     /*- hyphen*/
-10,     /*.*/
-17,     /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-10,     /*:*/
-12,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-20,     /*?*/
-0,      /*@*/
-29+0200, /*A*/
-23+0200, /*B*/
-26+0200, /*C*/
-30+0200, /*D*/
-24+0200, /*E*/
-23+0200, /*F*/
-30+0200, /*G*/
-29+0200, /*H*/
-13+0200, /*I*/
-16+0200, /*J*/
-28+0200, /*K*/
-24+0200, /*L*/
-35+0200, /*M*/
-29+0200, /*N*/
-27+0200, /*O*/
-22+0200, /*P*/
-27+0300, /*Q*/
-27+0200, /*R*/
-20+0200, /*S*/
-24+0200, /*T*/
-29+0200, /*U*/
-27+0200, /*V*/
-36+0200, /*W*/
-28+0200, /*X*/
-27+0200, /*Y*/
-23+0200, /*Z*/
-14,     /*[*/
-0,      /*\*/
-14,     /*]*/
-0,      /*^*/
-0,      /*_*/
-12,     /*` open*/
-17,     /*a*/
-20+0200, /*b*/
-16,     /*c*/
-20+0200, /*d*/
-18,     /*e*/
-13+0200, /*f*/
-18+0100, /*g*/
-21+0200, /*h*/
-10+0200, /*i*/
-9+0300, /*j*/
-20+0200, /*k*/
-10+0200, /*l*/
-32,     /*m*/
-21,     /*n*/
-20,     /*o*/
-19+0100, /*p*/
-19+0100, /*q*/
-14,     /*r*/
-15,     /*s*/
-12+0200, /*t*/
-21,     /*u*/
-20,     /*v*/
-26,     /*w*/
-20,     /*x*/
-18+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-29,     /*1/4*/
-29,     /*1/2*/
-29,     /*3/4*/
-36,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-24,     /*ff*/
-32,     /*ffi*/
-32,     /*ffl*/
-15,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-8,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copyright*/
-0,
-19,     /*cent*/
-};
-
-char W2[256-32] = {    /*Times Italic widths*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-19,     /*$*/
-27,     /*%*/
-26,     /*&*/
-11,     /*' close*/
-15,     /*(*/
-15,     /*)*/
-16,     /***/
-36,     /*+*/
-11,     /*,*/
-13,     /*- hyphen*/
-11,     /*.*/
-9,      /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-11,     /*:*/
-11,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-20,     /*?*/
-0,      /*@*/
-25+0200, /*A*/
-24+0200, /*B*/
-26+0200, /*C*/
-27+0200, /*D*/
-23+0200, /*E*/
-21+0200, /*F*/
-27+0200, /*G*/
-29+0200, /*H*/
-14+0200, /*I*/
-16+0200, /*J*/
-28+0200, /*K*/
-24+0200, /*L*/
-34+0200, /*M*/
-27+0200, /*N*/
-27+0200, /*O*/
-22+0200, /*P*/
-27+0300, /*Q*/
-27+0200, /*R*/
-20+0200, /*S*/
-23+0200, /*T*/
-28+0200, /*U*/
-25+0200, /*V*/
-36+0200, /*W*/
-24+0200, /*X*/
-24+0200, /*Y*/
-25+0200, /*Z*/
-13,     /*[*/
-0,      /*\*/
-13,     /*]*/
-0,      /*^*/
-0,      /*_*/
-11,     /*` open*/
-19,     /*a*/
-18+0200, /*b*/
-15,     /*c*/
-18+0200, /*d*/
-16,     /*e*/
-11+0200, /*f*/
-17+0100, /*g*/
-19+0200, /*h*/
-9+0200, /*i*/
-9+0300, /*j*/
-19+0200, /*k*/
-9+0200, /*l*/
-28,     /*m*/
-19,     /*n*/
-18,     /*o*/
-17+0100, /*p*/
-18+0100, /*q*/
-13,     /*r*/
-14,     /*s*/
-10+0200, /*t*/
-19,     /*u*/
-16,     /*v*/
-24,     /*w*/
-18,     /*x*/
-16+0100, /*y*/
-14,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-13,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-27,     /*1/4*/
-27,     /*1/2*/
-27,     /*3/4*/
-36,     /*minus*/
-21,     /*fi*/
-21,     /*fl*/
-21,     /*ff*/
-31,     /*ffi*/
-31,     /*ffl*/
-15,     /*degree*/
-19,     /*dagger*/
-16,     /*section*/
-7,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copyright*/
-0,
-19,     /*cent*/
-};
-char W3[256-32] = {    /*Times Bold widths*/
-12,     /*space*/
-13,     /*!*/
-0,      /*"*/
-0,      /*#*/
-18,     /*$*/
-28,     /*%*/
-27,     /*&*/
-12,     /*' close*/
-16,     /*(*/
-16,     /*)*/
-18,     /***/
-36,     /*+*/
-12,     /*,*/
-14,     /*- hyphen*/
-12,     /*.*/
-18,     /*/*/
-19+0200, /*0*/
-19+0200, /*1*/
-19+0200, /*2*/
-19+0200, /*3*/
-19+0200, /*4*/
-19+0200, /*5*/
-19+0200, /*6*/
-19+0200, /*7*/
-19+0200, /*8*/
-19+0200, /*9*/
-13,     /*:*/
-13,     /*;*/
-0,      /*<*/
-36,     /*=*/
-0,      /*>*/
-22,     /*?*/
-0,      /*@*/
-28+0200, /*A*/
-26+0200, /*B*/
-26+0200, /*C*/
-29+0200, /*D*/
-25+0200, /*E*/
-23+0200, /*F*/
-28+0200, /*G*/
-32+0200, /*H*/
-16+0200, /*I*/
-21+0200, /*J*/
-28+0200, /*K*/
-25+0200, /*L*/
-36+0200, /*M*/
-30+0200, /*N*/
-29+0200, /*O*/
-25+0200, /*P*/
-29+0300, /*Q*/
-28+0200, /*R*/
-23+0200, /*S*/
-25+0200, /*T*/
-29+0200, /*U*/
-27+0200, /*V*/
-36+0200, /*W*/
-27+0200, /*X*/
-28+0200, /*Y*/
-27+0200, /*Z*/
-12,     /*[*/
-0,      /*\*/
-12,     /*]*/
-0,      /*^*/
-0,      /*_*/
-12,     /*` open*/
-19,     /*a*/
-19+0200, /*b*/
-16,     /*c*/
-19+0200, /*d*/
-17,     /*e*/
-13+0200, /*f*/
-18+0100, /*g*/
-22+0200, /*h*/
-12+0200, /*i*/
-12+0300, /*j*/
-23+0200, /*k*/
-12+0200, /*l*/
-32,     /*m*/
-22,     /*n*/
-18,     /*o*/
-20+0100, /*p*/
-19+0100, /*q*/
-15,     /*r*/
-17,     /*s*/
-13+0200, /*t*/
-21,     /*u*/
-19,     /*v*/
-27,     /*w*/
-21,     /*x*/
-19+0100, /*y*/
-17,     /*z*/
-0,      /*{*/
-2,      /*|*/
-0,      /*}*/
-0,      /*~*/
-6,      /*narrow space*/
-14,     /*hyphen*/
-27,     /*bullet*/
-27,     /*square*/
-36,     /*3/4 em*/
-18,     /*rule*/
-28,     /*1/4*/
-28,     /*1/2*/
-28,     /*3/4*/
-36,     /*minus*/
-22,     /*fi*/
-22,     /*fl*/
-23,     /*ff*/
-33,     /*ffi*/
-33,     /*ffl*/
-15,     /*degree*/
-20,     /*dagger*/
-0,      /*section*/
-9,      /*foot mark*/
-0,      /*'*/
-0,      /*`*/
-0,      /*_*/
-0,
-3,     /*half nar sp*/
-0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,
-20,     /*registered*/
-20,     /*copyright*/
-0,
-19,     /*cent*/
-};
-
-/*
-Modified for Commercial II
-and with +, -, and = for equations
-*/
-char W4[256-32] = {    /*Special font widths*/
-0,0,           /*.=Sw+042-40*/
-13,     /*"*/
-29,     /*#*/
-0,0,0,0,               /*.=Sw+074-40*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,
-36,     /*<*/
-0,             /*.=Sw+076-40*/
-36,     /*>*/
-0,             /*.=Sw+100-40*/
-36,     /*@*/
-0,0,0,0,0,0,0, /*.=Sw+134-40*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,
-15,     /*\\*/
-0,             /*.=Sw+136-40*/
-15,     /*^*/
-18,     /*_ underrule*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-0,0,0,
-14,     /*{*/
-0,             /*.=Sw+175-40*/
-14,     /*}*/
-15,     /*~*/
-0,             /*.=Sw+220-40*/
-0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,
-17,     /*section*/
-0,             /*.=Sw+222-40*/
-10,     /*acute accent*/
-10,     /*grave accent*/
-18,     /*underrule*/
-15,     /*slash (longer)*/
-0,      /**/
-0,      /**/
-24,     /*alpha*/
-23+0300, /*beta*/
-23+0100, /*gamma*/
-19+0200, /*delta*/
-18,     /*epsilon*/
-18+0300, /*zeta*/
-23+0100, /*eta*/
-19+0200, /*theta*/
-13,     /*iota*/
-21,     /*kappa*/
-22+0200, /*lambda*/
-25+0100, /*mu*/
-20,     /*nu*/
-20+0300, /*xi*/
-20,     /*omicron*/
-27,     /*pi*/
-21+0100, /*rho*/
-27,     /*sigma*/
-20,     /*tau*/
-21,     /*upsilon*/
-25+0300, /*phi*/
-22+0100, /*chi*/
-24+0300, /*psi*/
-25,     /*omega*/
-24+0200, /*Gamma*/
-26+0200, /*Delta*/
-28+0200, /*Theta*/
-28+0200, /*Lambda*/
-27+0200, /*Xi*/
-29+0200, /*Pi*/
-25+0200, /*Sigma*/
-0,      /**/
-28+0200, /*Upsilon*/
-29+0200, /*Phi*/
-32+0200, /*Psi*/
-36+0200, /*Omega*/
-30,     /*square root*/
-18+0100, /*terminal sigma*/
-18,     /*root en*/
-36,     /*>=*/
-36,     /*<=*/
-36,     /*identically equal*/
-27,     /*minus*/
-36,     /*approx =*/
-36,     /*approximates*/
-36,     /*not equal*/
-36,     /*right arrow*/
-36,     /*left arrow*/
-18,     /*up arrow*/
-18,     /*down arrow*/
-27,     /*equal*/
-27,     /*multiply*/
-27,     /*divide*/
-36,     /*plus-minus*/
-36,     /*cup (union)*/
-36,     /*cap (intersection)*/
-36,     /*subset of*/
-36,     /*superset of*/
-36,     /*improper subset*/
-36,     /*improper superset*/
-34,     /*infinity*/
-21,     /*partial derivative*/
-36+0200, /*gradient*/
-22,     /*not*/
-24,     /*integral sign*/
-27,     /*proportional to*/
-28,     /*empty set*/
-27,     /*member of*/
-27,     /*plus*/
-0,
-0,
-0,      /*box vert rule (was 2.)*/
-0,
-17,     /*dbl dagger*/
-42,     /*right hand*/
-42,     /*left hand*/
-16,     /*math * */
-41,     /*bell system sign*/
-9,      /*or*/
-27,     /*circle*/
-9,      /*left top (of big curly)*/
-9,      /*left bottom*/
-9,      /*right top*/
-9,      /*right bot*/
-9,      /*left center of big curly bracket*/
-9,      /*right center of big curly bracket*/
-9,      /*bold vertical*/
-9,      /*left floor (left bot of big sq bract)*/
-9,      /*right floor (rb of ")*/
-9,      /*left ceiling (lt of ")*/
-9 }; /*right ceiling (rt of ")*/
diff --git a/.ref-Research-V7/usr/src/cmd/troff/tdef.h b/.ref-Research-V7/usr/src/cmd/troff/tdef.h
deleted file mode 100644 (file)
index a33e936..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#define        MAXPTR  (char *)-1      /* max value of any pointer variable */
-#ifdef NROFF   /*NROFF*/
-#define EM t.Em
-#define HOR t.Hor
-#define VERT t.Vert
-#define INCH 240       /*increments per inch*/
-#define SPS INCH/10    /*space size*/
-#define SS INCH/10     /* " */
-#define TRAILER 0
-#define UNPAD 0227
-#define PO 0 /*page offset*/
-#define ASCII 1
-#define PTID 1
-#define LG 0
-#define DTAB 0 /*set at 8 Ems at init time*/
-#define ICS 2*SPS
-#define TEMP 256       /*65K*/
-#endif
-#ifndef NROFF  /*TROFF*/
-#define INCH 432       /*troff resolution*/
-#define SPS 20 /*space size at 10pt; 1/3 Em*/
-#define SS 12  /*space size in 36ths of an em*/
-#define TRAILER 6048   /*144*14*3 = 14 inches*/
-#define UNPAD 027
-#define PO 416 /*page offset 26/27ths inch*/
-#define HOR 1
-#define VERT 3
-#define EM (6*(pts&077))
-#define ASCII 0
-#define PTID 0
-#define LG 1
-#define DTAB (INCH/2)
-#define ICS 3*SPS
-#define TEMP 512       /*128K*/
-#endif
-
-#include <signal.h>
-#define NARSP 0177     /*narrow space*/
-#define HNSP 0226      /*half narrow space*/
-#define PS 10  /*default point size*/
-#define FT 0   /*default font position*/
-#define LL 65*INCH/10  /*line length; 39picas=6.5in*/
-#define VS INCH/6      /*vert space; 12points*/
-#define NN 200 /*number registers*/
-/* NN changed Jan 31 from 132 */
-#define NNAMES 14 /*predefined reg names*/
-#define NIF 15 /*if-else nesting*/
-#define NS 64  /*name buffer*/
-#define NTM 256        /*tm buffer*/
-#define NEV 3  /*environments*/
-#define EVLSZ 10       /*size of ev stack*/
-#define EVS 4*256      /*environment size in words*/
-/* BWK - trying 4*256 instead of 3*256 */
-#define NM 300 /*requests + macros*/
-#define DELTA 512      /*delta core bytes*/
-#define NHYP 10        /*max hyphens per word*/
-#define NHEX 128       /*byte size of exception word list*/
-#define NTAB 35        /*tab stops*/
-#define NSO 5  /*"so" depth*/
-#define WDSIZE 170     /*word buffer size*/
-#define LNSIZE 680     /*line buffer size*/
-/* BWK - changed from 480 after EVS changed */
-#define NDI 5  /*number of diversions*/
-#define DBL 0100000    /*double size indicator*/
-#define MOT 0100000    /*motion character indicator*/
-#define MOTV 0160000   /*clear for motion part*/
-#define VMOT 0040000   /*vert motion bit*/
-#define NMOT 0020000   /* negative motion indicator*/
-#define MMASK 0100000  /*macro mask indicator*/
-#define CMASK 0100377
-#define ZBIT 0400      /*zero width char*/
-#define BMASK 0377
-#define BYTE 8
-#define IMP 004        /*impossible char*/
-#define FILLER 037
-#define PRESC 026
-#define HX 0376        /*High-order part of xlss*/
-#define LX 0375        /*low-order part of xlss*/
-#define CONT 025
-#define COLON 013
-#define XPAR 030
-#define ESC 033
-#define FLSS 031
-#define RPT 014
-#define JREG 0374
-#define NTRAP 20       /*number of traps*/
-#define NPN 20 /*numbers in "-o"*/
-#define T_PAD 0101     /*cat padding*/
-#define T_INIT 0100
-#define T_IESC 16 /*initial offset*/
-#define T_STOP 0111
-#define NPP 10 /*pads per field*/
-#define FBUFSZ 256     /*field buf size words*/
-#define OBUFSZ 512     /*bytes*/
-#define IBUFSZ 512     /*bytes*/
-#define NC 256 /*cbuf size words*/
-#define NOV 10 /*number of overstrike chars*/
-#define ZONE 5 /*5hrs for EST*/
-#define TDELIM 032
-#define LEFT 035
-#define RIGHT 036
-#define LEADER 001
-#define TAB 011
-#define TMASK  037777
-#define RTAB 0100000
-#define CTAB 0040000
-#define OHC 024
-
-#define PAIR(A,B) (A|(B<<BYTE))
-
-#define BLK  128       /*alloc block words*/
-#ifdef BIG
-typedef long filep;
-#define NBLIST BIG     /*allocation , BIG = 256 per 65k*/
-#define BLKBITS 7      /*for BLK=128*/
-#endif
-#ifndef BIG
-typedef unsigned filep;
-#define NBLIST TEMP    /*allocation list, TEMP<=512*/
-/* BLK*NBLIST<=65536 words, if filep=unsigned */
-#define BLKBITS 0
-#endif
-
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/code.300 b/.ref-Research-V7/usr/src/cmd/troff/term/code.300
deleted file mode 100644 (file)
index 95b9180..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-"\001 ",       /*space*/
-"\001!",       /*!*/
-"\001\"",      /*"*/
-"\001#",       /*#*/
-"\001$",       /*$*/
-"\001%",       /*%*/
-"\001&",       /*&*/
-"\001'",       /*' close*/
-"\001(",       /*(*/
-"\001)",       /*)*/
-"\001*",       /***/
-"\001+",       /*+*/
-"\001,",       /*,*/
-"\001-",       /*- hyphen*/
-"\001.",       /*.*/
-"\001/",       /*/*/
-"\2010",       /*0*/
-"\2011",       /*1*/
-"\2012",       /*2*/
-"\2013",       /*3*/
-"\2014",       /*4*/
-"\2015",       /*5*/
-"\2016",       /*6*/
-"\2017",       /*7*/
-"\2018",       /*8*/
-"\2019",       /*9*/
-"\001:",       /*:*/
-"\001;",       /*;*/
-"\001<",       /*<*/
-"\001=",       /*=*/
-"\001>",       /*>*/
-"\001?",       /*?*/
-"\001@",       /*@*/
-"\201A",       /*A*/
-"\201B",       /*B*/
-"\201C",       /*C*/
-"\201D",       /*D*/
-"\201E",       /*E*/
-"\201F",       /*F*/
-"\201G",       /*G*/
-"\201H",       /*H*/
-"\201I",       /*I*/
-"\201J",       /*J*/
-"\201K",       /*K*/
-"\201L",       /*L*/
-"\201M",       /*M*/
-"\201N",       /*N*/
-"\201O",       /*O*/
-"\201P",       /*P*/
-"\201Q",       /*Q*/
-"\201R",       /*R*/
-"\201S",       /*S*/
-"\201T",       /*T*/
-"\201U",       /*U*/
-"\201V",       /*V*/
-"\201W",       /*W*/
-"\201X",       /*X*/
-"\201Y",       /*Y*/
-"\201Z",       /*Z*/
-"\001[",       /*[*/
-"\001\\",      /*\*/
-"\001]",       /*]*/
-"\001^",       /*^*/
-"\001_",       /*_ dash*/
-"\001`",       /*` open*/
-"\201a",       /*a*/
-"\201b",       /*b*/
-"\201c",       /*c*/
-"\201d",       /*d*/
-"\201e",       /*e*/
-"\201f",       /*f*/
-"\201g",       /*g*/
-"\201h",       /*h*/
-"\201i",       /*i*/
-"\201j",       /*j*/
-"\201k",       /*k*/
-"\201l",       /*l*/
-"\201m",       /*m*/
-"\201n",       /*n*/
-"\201o",       /*o*/
-"\201p",       /*p*/
-"\201q",       /*q*/
-"\201r",       /*r*/
-"\201s",       /*s*/
-"\201t",       /*t*/
-"\201u",       /*u*/
-"\201v",       /*v*/
-"\201w",       /*w*/
-"\201x",       /*x*/
-"\201y",       /*y*/
-"\201z",       /*z*/
-"\001{",       /*{*/
-"\001|",       /*|*/
-"\001}",       /*}*/
-"\001~",       /*~*/
-"\000\0",      /*narrow sp*/
-"\001-",        /*hyphen*/
-"\001o\b+",     /*bullet*/
-"\002\[]",      /*square*/
-"\001-",        /*3/4 em*/
-"\001_",        /*rule*/
-"\0031/4",      /*1/4*/
-"\0031/2",      /*1/2*/
-"\0033/4",      /*3/4*/
-"\001-",        /*minus*/
-"\202fi",       /*fi*/
-"\202fl",       /*fl*/
-"\202ff",       /*ff*/
-"\203ffi",      /*ffi*/
-"\203ffl",      /*ffl*/
-"\001\344o\304",        /*degree*/
-"\001|\b-",     /*dagger*/
-"\001l\bo",    /* section*/
-"\001'",        /*foot mark*/
-"\001'",        /*acute accent*/
-"\001`",        /*grave accent*/
-"\001_",        /*underrule*/
-"\001/",        /*slash (longer)*/
-"\000\0",      /*half narrow space*/
-"\001 ",       /*unpaddable space*/
-"\001\241c\202(\241", /*alpha*/
-"\001\200B\242\302\|\202\342", /*beta*/
-"\001\200)\201/\241", /*gamma*/
-"\001\200o\342<\302", /*delta*/
-"\001<\b-", /*epsilon*/
-"\001\200c\201\301,\241\343<\302", /*zeta*/
-"\001\200n\202\302|\242\342", /*eta*/
-"\001O\b-", /*theta*/
-"\001i",        /*iota*/
-"\001k",        /*kappa*/
-"\001\200\\\304\241'\301\241'\345\202", /*lambda*/
-"\001\200u\242,\202", /*mu*/
-"\001\241(\203/\242", /*nu*/
-"\001\200c\201\301,\241\343c\241\301`\201\301", /*xi*/
-"\001o",        /*omicron*/
-"\001\341-\303\"\301\"\343", /*pi*/
-"\001\200o\242\302|\342\202", /*rho*/
-"\001\200o\301\202~\341\242", /*sigma*/
-"\001\200t\301\202~\243~\201\341", /*tau*/
-"\001v",        /*upsilon*/
-"\001o\b/", /*phi*/
-"\001x",        /*chi*/
-"\001\200/-\302\202'\244'\202\342", /*psi*/
-"\001\241u\203u\242", /*omega*/
-"\001\242|\202\343-\303\202`\242", /*Gamma*/
-"\001\242/\303-\204-\343\\\242", /*Delta*/
-"\001O\b=", /*Theta*/
-"\001\242/\204\\\242", /*Lambda*/
-"\001\\b/",     /*Xi*/
-"\001\242[]\204[]\242\343-\303", /*Pi*/
-"\001\200>\302-\345-\303", /*Sigma*/
-"\000\0",       /**/
-"\001Y",        /*Upsilon*/
-"\001o\b[\b]", /*Phi*/
-"\001\200[]-\302\202'\244`\202\342", /*Psi*/
-"\001\200O\302\241-\202-\241\342", /*Omega*/
-"\000\0",       /*square root*/
-"\000\0",       /*terminal sigma*/
-"\000\0",       /*root en*/
-"\001>\b_",     /*>=*/
-"\001<\b_",     /*<=*/
-"\001=\b_",     /*identically equal*/
-"\001-",        /*equation minus*/
-"\001=\b~",     /*approx =*/
-"\000\0",       /*approximates*/
-"\001=\b/",     /*not equal*/
-"\002->",       /*right arrow*/
-"\002<-",       /*left arrow*/
-"\001|\b^",     /*up arrow*/
-"\000\0",       /*down arrow*/
-"\001=",        /*equation equal*/
-"\001x",        /*multiply*/
-"\001/",        /*divide*/
-"\001+\b_",     /*plus-minus*/
-"\001U",        /*cup (union)*/
-"\000\0",       /*cap (intersection)*/
-"\000\0",       /*subset of*/
-"\000\0",       /*superset of*/
-"\000\0",       /*improper subset*/
-"\000\0",       /* improper superset*/
-"\002oo",       /*infinity*/
-"\001\200o\201\301`\241\341`\241\341`\201\301", /*partial derivative*/
-"\001\242\\\343-\204-\303/\242", /*gradient*/
-"\001\200-\202\341,\301\242", /*not*/
-"\001\200|'\202`\243\306'\241`\202\346",       /*integral sign*/
-"\000\0",       /*proportional to*/
-"\000\0",       /*empty set*/
-"\000\0",       /*member of*/
-"\001+",        /*equation plus*/
-"\001r\bO",     /*registered*/
-"\001c\bO",     /*copyright*/
-"\001|",        /*box rule */
-"\001c\b/",     /*cent sign*/
-"\001|\b=",     /*dbl dagger*/
-"\002=>",       /*right hand*/
-"\002<=",       /*left hand*/
-"\001*",        /*math * */
-"\000\0",       /*bell system sign*/
-"\001|",        /*or (was star)*/
-"\001O",        /*circle*/
-"\001|",        /*left top (of big curly)*/
-"\001|",        /*left bottom*/
-"\001|",        /*right top*/
-"\001|",        /*right bot*/
-"\001|",        /*left center of big curly bracket*/
-"\001|",        /*right center of big curly bracket*/
-"\001|",       /*bold vertical*/
-"\001|",       /*left floor (left bot of big sq bract)*/
-"\001|",       /*right floor (rb of ")*/
-"\001|",       /*left ceiling (lt of ")*/
-"\001|"};      /*right ceiling (rt of ")*/
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/makefile b/.ref-Research-V7/usr/src/cmd/troff/term/makefile
deleted file mode 100644 (file)
index 0f3cda7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-cp:    all
-       for i in *.o; do cp $$i /usr/lib/term/`basename $$i .o`; done
-       rm *.o
-
-cmp:   all
-       for i in *.o; do cmp $$i /usr/lib/term/`basename $$i .o`; done
-       rm *.o
-
-all:   tab300-12.o tab300.o tab300s-12.o tab300s.o
-all:   tab37.o tab450-12-8.o tab450-12.o tab450.o tab832.o taba1.o tablp.o tabtn300.o
-       :
-
-.c.o:
-       cc -c $<; strip $@
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab300-12.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab300-12.c
deleted file mode 100644 (file)
index 44af584..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-DASI300
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/8,
-/*Char*/       INCH/12,
-/*Em*/         INCH/12,
-/*Halfline*/   INCH/16,
-/*Adj*/                INCH/12,
-/*twinit*/     "\007",
-/*twrest*/     "\007",
-/*twnl*/       "\015\n",
-/*hlr*/                "\006\013\013\013\006",
-/*hlf*/                "\006\012\012\012\006",
-/*flr*/                "\013",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\006",
-/*plotoff*/    "\033\006",
-/*up*/         "\013",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab300.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab300.c
deleted file mode 100644 (file)
index 2c15488..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-DASI300
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "\007",
-/*twrest*/     "\007",
-/*twnl*/       "\015\n",
-/*hlr*/                "\006\013\013\013\013\006",
-/*hlf*/                "\006\012\012\012\012\006",
-/*flr*/                "\013",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\006",
-/*plotoff*/    "\033\006",
-/*up*/         "\013",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab300s-12.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab300s-12.c
deleted file mode 100644 (file)
index f480565..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-DASI300S
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/8,
-/*Char*/       INCH/12,
-/*Em*/         INCH/12,
-/*Halfline*/   INCH/16,
-/*Adj*/                INCH/12,
-/*twinit*/     "\033\006",
-/*twrest*/     "\033\006",
-/*twnl*/       "\015\n",
-/*hlr*/                "",
-/*hlf*/                "",
-/*flr*/                "\032",
-/*bdon*/       "\033E",
-/*bdoff*/      "\033E",
-/*ploton*/     "\006",
-/*plotoff*/    "\033\006",
-/*up*/         "\032",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab300s.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab300s.c
deleted file mode 100644 (file)
index 7f47ba8..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-DASI300S
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "\033\006",
-/*twrest*/     "\033\006",
-/*twnl*/       "\015\n",
-/*hlr*/                "\033H",
-/*hlf*/                "\033h",
-/*flr*/                "\032",
-/*bdon*/       "\033E",
-/*bdoff*/      "\033E",
-/*ploton*/     "\006",
-/*plotoff*/    "\033\006",
-/*up*/         "\032",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab37.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab37.c
deleted file mode 100644 (file)
index 903e43f..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-#define INCH 240
-/*
-TTY M37
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0,
-/*Hor*/                INCH/10,
-/*Vert*/       INCH/12,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "",
-/*twrest*/     "",
-/*twnl*/       "\n",
-/*hlr*/                "\0338",
-/*hlf*/                "\0339",
-/*flr*/                "\0337",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "",
-/*plotoff*/    "",
-/*up*/         "",
-/*down*/       "",
-/*right*/      "",
-/*left*/       "",
-/*codetab*/
-"\001 ",       /*space*/
-"\001!",       /*!*/
-"\001\"",      /*"*/
-"\001#",       /*#*/
-"\001$",       /*$*/
-"\001%",       /*%*/
-"\001&",       /*&*/
-"\001'",       /*' close*/
-"\001(",       /*(*/
-"\001)",       /*)*/
-"\001*",       /***/
-"\001+",       /*+*/
-"\001,",       /*,*/
-"\001-",       /*- hyphen*/
-"\001.",       /*.*/
-"\001/",       /*/*/
-"\2010",       /*0*/
-"\2011",       /*1*/
-"\2012",       /*2*/
-"\2013",       /*3*/
-"\2014",       /*4*/
-"\2015",       /*5*/
-"\2016",       /*6*/
-"\2017",       /*7*/
-"\2018",       /*8*/
-"\2019",       /*9*/
-"\001:",       /*:*/
-"\001;",       /*;*/
-"\001<",       /*<*/
-"\001=",       /*=*/
-"\001>",       /*>*/
-"\001?",       /*?*/
-"\001@",       /*@*/
-"\201A",       /*A*/
-"\201B",       /*B*/
-"\201C",       /*C*/
-"\201D",       /*D*/
-"\201E",       /*E*/
-"\201F",       /*F*/
-"\201G",       /*G*/
-"\201H",       /*H*/
-"\201I",       /*I*/
-"\201J",       /*J*/
-"\201K",       /*K*/
-"\201L",       /*L*/
-"\201M",       /*M*/
-"\201N",       /*N*/
-"\201O",       /*O*/
-"\201P",       /*P*/
-"\201Q",       /*Q*/
-"\201R",       /*R*/
-"\201S",       /*S*/
-"\201T",       /*T*/
-"\201U",       /*U*/
-"\201V",       /*V*/
-"\201W",       /*W*/
-"\201X",       /*X*/
-"\201Y",       /*Y*/
-"\201Z",       /*Z*/
-"\001[",       /*[*/
-"\001\\",      /*\*/
-"\001]",       /*]*/
-"\001^",       /*^*/
-"\001_",       /*_ dash*/
-"\001`",       /*` open*/
-"\201a",       /*a*/
-"\201b",       /*b*/
-"\201c",       /*c*/
-"\201d",       /*d*/
-"\201e",       /*e*/
-"\201f",       /*f*/
-"\201g",       /*g*/
-"\201h",       /*h*/
-"\201i",       /*i*/
-"\201j",       /*j*/
-"\201k",       /*k*/
-"\201l",       /*l*/
-"\201m",       /*m*/
-"\201n",       /*n*/
-"\201o",       /*o*/
-"\201p",       /*p*/
-"\201q",       /*q*/
-"\201r",       /*r*/
-"\201s",       /*s*/
-"\201t",       /*t*/
-"\201u",       /*u*/
-"\201v",       /*v*/
-"\201w",       /*w*/
-"\201x",       /*x*/
-"\201y",       /*y*/
-"\201z",       /*z*/
-"\001{",       /*{*/
-"\001|",       /*|*/
-"\001}",       /*}*/
-"\001~",       /*~*/
-"\000\0",      /*narrow sp*/
-"\001-",        /*hyphen*/
-"\001o\b+",     /*bullet*/
-"\002\[]",      /*square*/
-"\001-",        /*3/4 em*/
-"\001_",        /*rule*/
-"\0031/4",     /*1/4*/
-"\0031/2",     /*1/2*/
-"\0033/4",     /*3/4*/
-"\001-",        /*minus*/
-"\202fi",       /*fi*/
-"\202fl",       /*fl*/
-"\202ff",       /*ff*/
-"\203ffi",      /*ffi*/
-"\203ffl",      /*ffl*/
-"\001\0338o\0339",      /*degree*/
-"\001|\b-",     /*dagger*/
-"\000\0",       /*section*/
-"\001'",        /*foot mark*/
-"\001'",        /*acute accent*/
-"\001`",        /*grave accent*/
-"\001_",        /*underrule*/
-"\001/",        /*slash (longer)*/
-"\000\0",      /*half narrow space*/
-"\001 ",       /*unpaddable space*/
-"\201\016A\017", /*alpha*/
-"\201\016B\017", /*beta*/
-"\201\016\\\017", /*gamma*/
-"\201\016D\017", /*delta*/
-"\201\016S\017", /*epsilon*/
-"\201\016Q\017", /*zeta*/
-"\201\016N\017", /*eta*/
-"\201\016O\017", /*theta*/
-"\201i",        /*iota*/
-"\201k",        /*kappa*/
-"\201\016L\017", /*lambda*/
-"\201\016M\017", /*mu*/
-"\201\016@\017", /*nu*/
-"\201\016X\017", /*xi*/
-"\201o",        /*omicron*/
-"\201\016J\017", /*pi*/
-"\201\016K\017", /*rho*/
-"\201\016Y\017", /*sigma*/
-"\201\016I\017", /*tau*/
-"\201v",        /*upsilon*/
-"\201\016U\017", /*phi*/
-"\201x",        /*chi*/
-"\201\016V\017", /*psi*/
-"\201\016C\017", /*omega*/
-"\201\016G\017", /*Gamma*/
-"\201\016W\017", /*Delta*/
-"\201\016T\017", /*Theta*/
-"\201\016E\017", /*Lambda*/
-"\000\0",       /*Xi*/
-"\201\016P\017", /*Pi*/
-"\201\016R\017", /*Sigma*/
-"\000\0",       /**/
-"\201Y",        /*Upsilon*/
-"\201\016F\017", /*Phi*/
-"\201\016H\017", /*Psi*/
-"\201\016Z\017", /*Omega*/
-"\000\0",       /*square root*/
-"\000\0",       /*terminal sigma*/
-"\000\0",       /*root en*/
-"\001>\b_",     /*>=*/
-"\001<\b_",     /*<=*/
-"\001=\b_",     /*identically equal*/
-"\001-",        /*equation minus*/
-"\001=\b~",     /*approx =*/
-"\001\0339~\0338",      /*approximates*/
-"\001=\b/",     /*not equal*/
-"\002->",       /*right arrow*/
-"\002<-",       /*left arrow*/
-"\001|\b^",     /*up arrow*/
-"\000\0",       /*down arrow*/
-"\001=",        /*equation equal*/
-"\001x",        /*multiply*/
-"\001/",        /*divide*/
-"\001+\b_",     /*plus-minus*/
-"\001U",        /*cup (union)*/
-"\000\0",       /*cap (intersection)*/
-"\000\0",       /*subset of*/
-"\000\0",       /*superset of*/
-"\000\0",       /*improper subset*/
-"\000\0",       /* improper superset*/
-"\002oo",       /*infinity*/
-"\001\016]\017", /*partial derivative*/
-"\001\016[\017", /*gradient*/
-"\001\016_\017", /*not*/
-"\001\016^\017", /*integral sign*/
-"\000\0",       /*proportional to*/
-"\000\0",       /*empty set*/
-"\000\0",       /*member of*/
-"\001+",        /*equation plus*/
-"\001\0338r\0339",      /*registered*/
-"\001\0338c\0339",      /*copyright*/
-"\001|",        /*box rule */
-"\001c\b/",     /*cent sign*/
-"\001|\b=",     /*dbl dagger*/
-"\002=>",       /*right hand*/
-"\002<=",       /*left hand*/
-"\001*",        /*math * */
-"\000\0",       /*bell system sign*/
-"\001|",        /*or (was star)*/
-"\001O",        /*circle*/
-"\001|",        /*left top (of big curly)*/
-"\001|",        /*left bottom*/
-"\001|",        /*right top*/
-"\001|",        /*right bot*/
-"\001|",        /*left center of big curly bracket*/
-"\001|",        /*right center of big curly bracket*/
-"\001|",       /*bold vertical*/
-"\001|",       /*left floor (left bot of big sq bract)*/
-"\001|",       /*right floor (rb of ")*/
-"\001|",       /*left ceiling (lt of ")*/
-"\001|"};      /*right ceiling (rt of ")*/
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab450-12-8.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab450-12-8.c
deleted file mode 100644 (file)
index 2cef2f5..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#define INCH 240
-/*
-DASI450
-12 chars/inch, 8 lines/inch
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/8,
-/*Char*/       INCH/12,
-/*Em*/         INCH/12,
-/*Halfline*/   INCH/16,
-/*Adj*/                INCH/12,
-/*twinit*/     "\0334\033\037\013\033\036\007",
-/*twrest*/     "\0334\033\037\015\033\036\011",
-/*twnl*/       "\015\n",
-/*hlr*/                "\033D",
-/*hlf*/                "\033U",
-/*flr*/                "\033\n",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\0333",
-/*plotoff*/    "\0334",
-/*up*/         "\033\n",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab450-12.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab450-12.c
deleted file mode 100644 (file)
index ca0575f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#define INCH 240
-/*
-DASI450
-12 chars/inch, 6 lines/inch
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/12,
-/*Em*/         INCH/12,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/12,
-/*twinit*/     "\0334\033\037\013",
-/*twrest*/     "\0334\033\037\015",
-/*twnl*/       "\015\n",
-/*hlr*/                "\033D",
-/*hlf*/                "\033U",
-/*flr*/                "\033\n",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\0333",
-/*plotoff*/    "\0334",
-/*up*/         "\033\n",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab450.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab450.c
deleted file mode 100644 (file)
index 368da41..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-DASI450
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "\0334",
-/*twrest*/     "\0334",
-/*twnl*/       "\015\n",
-/*hlr*/                "\033D",
-/*hlf*/                "\033U",
-/*flr*/                "\033\n",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\0333",
-/*plotoff*/    "\0334",
-/*up*/         "\033\n",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tab832.c b/.ref-Research-V7/usr/src/cmd/troff/term/tab832.c
deleted file mode 100644 (file)
index 6c4bf8c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-Anderson Jacobson 832
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "\033N",
-/*twrest*/     "\033N",
-/*twnl*/       "\015\n",
-/*hlr*/                "\0338",
-/*hlf*/                "\0339",
-/*flr*/                "\0337",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\033P",
-/*plotoff*/    "\033N",
-/*up*/         "\013",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/taba1.c b/.ref-Research-V7/usr/src/cmd/troff/term/taba1.c
deleted file mode 100644 (file)
index 4f42f08..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#define INCH 240
-/*
-DASI450
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0177420,
-/*Hor*/                INCH/60,
-/*Vert*/       INCH/48,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "\033R",
-/*twrest*/     "\033R",
-/*twnl*/       "\015\n",
-/*hlr*/                "\033S",
-/*hlf*/                "\033B",
-/*flr*/                "\033\n",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "\0334",
-/*plotoff*/    "\033R",
-/*up*/         "\005",
-/*down*/       "\n",
-/*right*/      " ",
-/*left*/       "\b",
-/*codetab*/
-#include "code.300"
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tablp.c b/.ref-Research-V7/usr/src/cmd/troff/term/tablp.c
deleted file mode 100644 (file)
index 46568cb..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-#define INCH 240
-/*
-Line Printer with col-only reverse line feed
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0,
-/*Hor*/                INCH/10,
-/*Vert*/       INCH/6,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "",
-/*twrest*/     "",
-/*twnl*/       "\n",
-/*hlr*/                "",
-/*hlf*/                "",
-/*flr*/                "\0337",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "",
-/*plotoff*/    "",
-/*up*/         "",
-/*down*/       "",
-/*right*/      "",
-/*left*/       "",
-/*codetab*/
-"\001 ",       /*space*/
-"\001!",       /*!*/
-"\001\"",      /*"*/
-"\001#",       /*#*/
-"\001$",       /*$*/
-"\001%",       /*%*/
-"\001&",       /*&*/
-"\001'",       /*' close*/
-"\001(",       /*(*/
-"\001)",       /*)*/
-"\001*",       /***/
-"\001+",       /*+*/
-"\001,",       /*,*/
-"\001-",       /*- hyphen*/
-"\001.",       /*.*/
-"\001/",       /*/*/
-"\2010",       /*0*/
-"\2011",       /*1*/
-"\2012",       /*2*/
-"\2013",       /*3*/
-"\2014",       /*4*/
-"\2015",       /*5*/
-"\2016",       /*6*/
-"\2017",       /*7*/
-"\2018",       /*8*/
-"\2019",       /*9*/
-"\001:",       /*:*/
-"\001;",       /*;*/
-"\001<",       /*<*/
-"\001=",       /*=*/
-"\001>",       /*>*/
-"\001?",       /*?*/
-"\001@",       /*@*/
-"\201A",       /*A*/
-"\201B",       /*B*/
-"\201C",       /*C*/
-"\201D",       /*D*/
-"\201E",       /*E*/
-"\201F",       /*F*/
-"\201G",       /*G*/
-"\201H",       /*H*/
-"\201I",       /*I*/
-"\201J",       /*J*/
-"\201K",       /*K*/
-"\201L",       /*L*/
-"\201M",       /*M*/
-"\201N",       /*N*/
-"\201O",       /*O*/
-"\201P",       /*P*/
-"\201Q",       /*Q*/
-"\201R",       /*R*/
-"\201S",       /*S*/
-"\201T",       /*T*/
-"\201U",       /*U*/
-"\201V",       /*V*/
-"\201W",       /*W*/
-"\201X",       /*X*/
-"\201Y",       /*Y*/
-"\201Z",       /*Z*/
-"\001[",       /*[*/
-"\001\\",      /*\*/
-"\001]",       /*]*/
-"\001^",       /*^*/
-"\001_",       /*_ dash*/
-"\001`",       /*` open*/
-"\201a",       /*a*/
-"\201b",       /*b*/
-"\201c",       /*c*/
-"\201d",       /*d*/
-"\201e",       /*e*/
-"\201f",       /*f*/
-"\201g",       /*g*/
-"\201h",       /*h*/
-"\201i",       /*i*/
-"\201j",       /*j*/
-"\201k",       /*k*/
-"\201l",       /*l*/
-"\201m",       /*m*/
-"\201n",       /*n*/
-"\201o",       /*o*/
-"\201p",       /*p*/
-"\201q",       /*q*/
-"\201r",       /*r*/
-"\201s",       /*s*/
-"\201t",       /*t*/
-"\201u",       /*u*/
-"\201v",       /*v*/
-"\201w",       /*w*/
-"\201x",       /*x*/
-"\201y",       /*y*/
-"\201z",       /*z*/
-"\001{",       /*{*/
-"\001|",       /*|*/
-"\001}",       /*}*/
-"\001~",       /*~*/
-"\000\0",      /*nar sp*/
-"\001-",        /*hyphen*/
-"\001o\b+",     /*bullet*/
-"\002\[]",      /*square*/
-"\001-",        /*3/4 em*/
-"\001_",        /*rule*/
-"\000\0",       /*1/4*/
-"\000\0",       /*1/2*/
-"\000\0",       /*3/4*/
-"\001-",        /*minus*/
-"\202fi",       /*fi*/
-"\202fl",       /*fl*/
-"\202ff",       /*ff*/
-"\203ffi",      /*ffi*/
-"\203ffl",      /*ffl*/
-"\000\0",       /*degree*/
-"\000\0",       /*dagger*/
-"\000\0",       /*section*/
-"\001'",        /*foot mark*/
-"\001'",        /*acute accent*/
-"\001`",        /*grave accent*/
-"\001_",        /*underrule*/
-"\001/",        /*slash (longer)*/
-"\000\0",      /*half narrow space*/
-"\001 ",       /*unpaddable space*/
-"\000", /*alpha*/
-"\000", /*beta*/
-"\000", /*gamma*/
-"\000", /*delta*/
-"\000", /*epsilon*/
-"\000", /*zeta*/
-"\000", /*eta*/
-"\000", /*theta*/
-"\201i",        /*iota*/
-"\201k",        /*kappa*/
-"\000", /*lambda*/
-"\000", /*mu*/
-"\000", /*nu*/
-"\000", /*xi*/
-"\201o",        /*omicron*/
-"\000", /*pi*/
-"\000", /*rho*/
-"\000", /*sigma*/
-"\000", /*tau*/
-"\201v",        /*upsilon*/
-"\000", /*phi*/
-"\201x",        /*chi*/
-"\000", /*psi*/
-"\000", /*omega*/
-"\000", /*Gamma*/
-"\000", /*Delta*/
-"\000", /*Theta*/
-"\000", /*Lambda*/
-"\000\0",       /*Xi*/
-"\000", /*Pi*/
-"\000", /*Sigma*/
-"\000\0",       /**/
-"\201Y",        /*Upsilon*/
-"\000", /*Phi*/
-"\000", /*Psi*/
-"\000", /*Omega*/
-"\000\0",       /*square root*/
-"\000\0",       /*terminal sigma*/
-"\000\0",       /*root en*/
-"\001>\b_",     /*>=*/
-"\001<\b_",     /*<=*/
-"\001=\b_",     /*identically equal*/
-"\001-",        /*equation minus*/
-"\001=\b~",     /*approx =*/
-"\000\0",       /*approximates*/
-"\001=\b/",     /*not equal*/
-"\002->",       /*right arrow*/
-"\002<-",       /*left arrow*/
-"\001|\b^",     /*up arrow*/
-"\000\0",       /*down arrow*/
-"\001=",        /*equation equal*/
-"\001x",        /*multiply*/
-"\001/",        /*divide*/
-"\001+\b_",     /*plus-minus*/
-"\001U",        /*cup (union)*/
-"\000\0",       /*cap (intersection)*/
-"\000\0",       /*subset of*/
-"\000\0",       /*superset of*/
-"\000\0",       /*improper subset*/
-"\000\0",       /* improper superset*/
-"\002oo",       /*infinity*/
-"\000", /*partial derivative*/
-"\000", /*gradient*/
-"\000", /*not*/
-"\000", /*integral sign*/
-"\000\0",       /*proportional to*/
-"\000\0",       /*empty set*/
-"\000\0",       /*member of*/
-"\001+",        /*equation plus*/
-"\001r\bO",     /*registered*/
-"\001c\bO",     /*copyright*/
-"\001|",        /*box rule */
-"\001c\b/",     /*cent sign*/
-"\000\0",       /*dbl dagger*/
-"\000\0",       /*right hand*/
-"\001*",        /*left hand*/
-"\001*",        /*math * */
-"\000\0",       /*bell system sign*/
-"\001|",        /*or (was star)*/
-"\001O",        /*circle*/
-"\001|",        /*left top (of big curly)*/
-"\001|",        /*left bottom*/
-"\001|",        /*right top*/
-"\001|",        /*right bot*/
-"\001|",        /*left center of big curly bracket*/
-"\001|",        /*right center of big curly bracket*/
-"\001|",       /*bold vertical*/
-"\001|",       /*left floor (left bot of big sq bract)*/
-"\001|",       /*right floor (rb of ")*/
-"\001|",       /*left ceiling (lt of ")*/
-"\001|"};      /*right ceiling (rt of ")*/
diff --git a/.ref-Research-V7/usr/src/cmd/troff/term/tabtn300.c b/.ref-Research-V7/usr/src/cmd/troff/term/tabtn300.c
deleted file mode 100644 (file)
index 5f70e5b..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-#define INCH 240
-/*
-Terminet300
-nroff driving tables
-width and code tables
-*/
-
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       int zzz;
-       } t {
-/*bset*/       0,
-/*breset*/     0,
-/*Hor*/                INCH/10,
-/*Vert*/       INCH/6,
-/*Newline*/    INCH/6,
-/*Char*/       INCH/10,
-/*Em*/         INCH/10,
-/*Halfline*/   INCH/12,
-/*Adj*/                INCH/10,
-/*twinit*/     "",
-/*twrest*/     "",
-/*twnl*/       "\n",
-/*hlr*/                "",
-/*hlf*/                "",
-/*flr*/                "",
-/*bdon*/       "",
-/*bdoff*/      "",
-/*ploton*/     "",
-/*plotoff*/    "",
-/*up*/         "",
-/*down*/       "",
-/*right*/      "",
-/*left*/       "",
-/*codetab*/
-"\001 ",       /*space*/
-"\001!",       /*!*/
-"\001\"",      /*"*/
-"\001#",       /*#*/
-"\001$",       /*$*/
-"\001%",       /*%*/
-"\001&",       /*&*/
-"\001'",       /*' close*/
-"\001(",       /*(*/
-"\001)",       /*)*/
-"\001*",       /***/
-"\001+",       /*+*/
-"\001,",       /*,*/
-"\001-",       /*- hyphen*/
-"\001.",       /*.*/
-"\001/",       /*/*/
-"\2010",       /*0*/
-"\2011",       /*1*/
-"\2012",       /*2*/
-"\2013",       /*3*/
-"\2014",       /*4*/
-"\2015",       /*5*/
-"\2016",       /*6*/
-"\2017",       /*7*/
-"\2018",       /*8*/
-"\2019",       /*9*/
-"\001:",       /*:*/
-"\001;",       /*;*/
-"\001<",       /*<*/
-"\001=",       /*=*/
-"\001>",       /*>*/
-"\001?",       /*?*/
-"\001@",       /*@*/
-"\201A",       /*A*/
-"\201B",       /*B*/
-"\201C",       /*C*/
-"\201D",       /*D*/
-"\201E",       /*E*/
-"\201F",       /*F*/
-"\201G",       /*G*/
-"\201H",       /*H*/
-"\201I",       /*I*/
-"\201J",       /*J*/
-"\201K",       /*K*/
-"\201L",       /*L*/
-"\201M",       /*M*/
-"\201N",       /*N*/
-"\201O",       /*O*/
-"\201P",       /*P*/
-"\201Q",       /*Q*/
-"\201R",       /*R*/
-"\201S",       /*S*/
-"\201T",       /*T*/
-"\201U",       /*U*/
-"\201V",       /*V*/
-"\201W",       /*W*/
-"\201X",       /*X*/
-"\201Y",       /*Y*/
-"\201Z",       /*Z*/
-"\001[",       /*[*/
-"\001\\",      /*\*/
-"\001]",       /*]*/
-"\001^",       /*^*/
-"\001_",       /*_ dash*/
-"\001`",       /*` open*/
-"\201a",       /*a*/
-"\201b",       /*b*/
-"\201c",       /*c*/
-"\201d",       /*d*/
-"\201e",       /*e*/
-"\201f",       /*f*/
-"\201g",       /*g*/
-"\201h",       /*h*/
-"\201i",       /*i*/
-"\201j",       /*j*/
-"\201k",       /*k*/
-"\201l",       /*l*/
-"\201m",       /*m*/
-"\201n",       /*n*/
-"\201o",       /*o*/
-"\201p",       /*p*/
-"\201q",       /*q*/
-"\201r",       /*r*/
-"\201s",       /*s*/
-"\201t",       /*t*/
-"\201u",       /*u*/
-"\201v",       /*v*/
-"\201w",       /*w*/
-"\201x",       /*x*/
-"\201y",       /*y*/
-"\201z",       /*z*/
-"\001{",       /*{*/
-"\001|",       /*|*/
-"\001}",       /*}*/
-"\001~",       /*~*/
-"\000\0",      /*nar sp*/
-"\001-",        /*hyphen*/
-"\001o\b+",     /*bullet*/
-"\002\[]",      /*square*/
-"\001-",        /*3/4 em*/
-"\001_",        /*rule*/
-"\0031/4",      /*1/4*/
-"\0031/2",      /*1/2*/
-"\0033/4",      /*3/4*/
-"\001-",        /*minus*/
-"\202fi",       /*fi*/
-"\202fl",       /*fl*/
-"\202ff",       /*ff*/
-"\203ffi",      /*ffi*/
-"\203ffl",      /*ffl*/
-"\000\0",       /*degree*/
-"\001|\b-",     /*dagger*/
-"\000\0",       /*section*/
-"\001'",        /*foot mark*/
-"\001'",        /*acute accent*/
-"\001`",        /*grave accent*/
-"\001_",        /*underrule*/
-"\001/",        /*slash (longer)*/
-"\000\0",      /*half narrow space*/
-"\001 ",       /*unpaddable space*/
-"\000", /*alpha*/
-"\000", /*beta*/
-"\000", /*gamma*/
-"\000", /*delta*/
-"\000", /*epsilon*/
-"\000", /*zeta*/
-"\000", /*eta*/
-"\000", /*theta*/
-"\201i",        /*iota*/
-"\201k",        /*kappa*/
-"\000", /*lambda*/
-"\000", /*mu*/
-"\000", /*nu*/
-"\000", /*xi*/
-"\201o",        /*omicron*/
-"\000", /*pi*/
-"\000", /*rho*/
-"\000", /*sigma*/
-"\000", /*tau*/
-"\201v",        /*upsilon*/
-"\000", /*phi*/
-"\201x",        /*chi*/
-"\000", /*psi*/
-"\000", /*omega*/
-"\000", /*Gamma*/
-"\000", /*Delta*/
-"\000", /*Theta*/
-"\000", /*Lambda*/
-"\000\0",       /*Xi*/
-"\000", /*Pi*/
-"\000", /*Sigma*/
-"\000\0",       /**/
-"\201Y",        /*Upsilon*/
-"\000", /*Phi*/
-"\000", /*Psi*/
-"\000", /*Omega*/
-"\000\0",       /*square root*/
-"\000\0",       /*terminal sigma*/
-"\000\0",       /*root en*/
-"\001>\b_",     /*>=*/
-"\001<\b_",     /*<=*/
-"\001=\b_",     /*identically equal*/
-"\001-",        /*equation minus*/
-"\001=\b~",     /*approx =*/
-"\000\0",       /*approximates*/
-"\001=\b/",     /*not equal*/
-"\002->",       /*right arrow*/
-"\002<-",       /*left arrow*/
-"\001|\b^",     /*up arrow*/
-"\000\0",       /*down arrow*/
-"\001=",        /*equation equal*/
-"\001x",        /*multiply*/
-"\001/",        /*divide*/
-"\001+\b_",     /*plus-minus*/
-"\001U",        /*cup (union)*/
-"\000\0",       /*cap (intersection)*/
-"\000\0",       /*subset of*/
-"\000\0",       /*superset of*/
-"\000\0",       /*improper subset*/
-"\000\0",       /* improper superset*/
-"\002oo",       /*infinity*/
-"\000", /*partial derivative*/
-"\000", /*gradient*/
-"\000", /*not*/
-"\000", /*integral sign*/
-"\000\0",       /*proportional to*/
-"\000\0",       /*empty set*/
-"\000\0",       /*member of*/
-"\001+",        /*equation plus*/
-"\001r\bO",     /*registered*/
-"\001c\bO",     /*copyright*/
-"\001|",        /*box rule */
-"\001c\b/",     /*cent sign*/
-"\001|\b=",     /*dbl dagger*/
-"\002=>",       /*right hand*/
-"\002<=",       /*left hand*/
-"\001*",        /*math * */
-"\000\0",       /*bell system sign*/
-"\001|",        /*or (was star)*/
-"\001O",        /*circle*/
-"\001|",        /*left top (of big curly)*/
-"\001|",        /*left bottom*/
-"\001|",        /*right top*/
-"\001|",        /*right bot*/
-"\001|",        /*left center of big curly bracket*/
-"\001|",        /*right center of big curly bracket*/
-"\001|",       /*bold vertical*/
-"\001|",       /*left floor (left bot of big sq bract)*/
-"\001|",       /*right floor (rb of ")*/
-"\001|",       /*left ceiling (lt of ")*/
-"\001|"};      /*right ceiling (rt of ")*/
diff --git a/.ref-Research-V7/usr/src/cmd/troff/textscript b/.ref-Research-V7/usr/src/cmd/troff/textscript
deleted file mode 100644 (file)
index ae322fe..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-g/\.data/d
-0a
-.text
-.
-w
diff --git a/.ref-Research-V7/usr/src/cmd/troff/tmake b/.ref-Research-V7/usr/src/cmd/troff/tmake
deleted file mode 100644 (file)
index ddc735d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-CFLAGS=-n -s -O
-TFILES=n1.o n2.o n3.o n4.o n5.o t6.o n7.o n8.o n9.o t10.o ni.o nii.o tab3.o hytab.o suftab.o
-
-troff: $(TFILES)
-       cc -o troff $(CFLAGS) $(TFILES)
-
-n1.o:  tdef.h d.h v.h tw.h s.h
-n2.o:  tdef.h d.h v.h tw.h s.h
-n3.o:  tdef.h d.h v.h tw.h s.h
-n4.o:  tdef.h d.h v.h tw.h s.h
-n5.o:  tdef.h d.h v.h tw.h s.h
-n6.o:  tdef.h d.h v.h tw.h s.h
-t6.o:  tdef.h d.h v.h tw.h s.h
-n7.o:  tdef.h d.h v.h tw.h s.h
-n8.o:  tdef.h d.h v.h tw.h s.h
-n9.o:  tdef.h d.h v.h tw.h s.h
-n10.o: tdef.h d.h v.h tw.h s.h
-t10.o: tdef.h d.h v.h tw.h s.h
-ni.o:  tdef.h d.h v.h tw.h s.h
-nii.o: tdef.h d.h v.h tw.h s.h
-
-hytab.o:       hytab.c
-       cc -S hytab.c
-       ed hytab.s <textscript
-       as -o hytab.o hytab.s
-       rm hytab.s
-
-suftab.o:      suftab.c
-       cc -S suftab.c
-       ed suftab.s <textscript
-       as -o suftab.o suftab.s
-       rm suftab.s
diff --git a/.ref-Research-V7/usr/src/cmd/troff/tw.h b/.ref-Research-V7/usr/src/cmd/troff/tw.h
deleted file mode 100644 (file)
index bee9121..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* typewriter driving table structure*/
-struct {
-       int bset;
-       int breset;
-       int Hor;
-       int Vert;
-       int Newline;
-       int Char;
-       int Em;
-       int Halfline;
-       int Adj;
-       char *twinit;
-       char *twrest;
-       char *twnl;
-       char *hlr;
-       char *hlf;
-       char *flr;
-       char *bdon;
-       char *bdoff;
-       char *ploton;
-       char *plotoff;
-       char *up;
-       char *down;
-       char *right;
-       char *left;
-       char *codetab[256-32];
-       char *zzz;
-       } t;
diff --git a/.ref-Research-V7/usr/src/cmd/troff/v.h b/.ref-Research-V7/usr/src/cmd/troff/v.h
deleted file mode 100644 (file)
index 28a4d48..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-struct v {int pn,nl,yr,hp,ct,dn,mo,dy,dw,ln,dl,st,sb,cd;
-       int vxx[NN-NNAMES];} v ;
diff --git a/.ref-Research-V7/usr/src/cmd/tsort.c b/.ref-Research-V7/usr/src/cmd/tsort.c
deleted file mode 100644 (file)
index 39b06e0..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*     topological sort
- *     input is sequence of pairs of items (blank-free strings)
- *     nonidentical pair is a directed edge in graph
- *     identical pair merely indicates presence of node
- *     output is ordered list of items consistent with
- *     the partial ordering specified by the graph
-*/
-#include "stdio.h"
-
-/*     the nodelist always has an empty element at the end to
- *     make it easy to grow in natural order
-*/
-
-struct nodelist {
-       struct nodelist *nextnode;
-       struct predlist *inedges;
-       char *name;
-       enum {DEAD, LIVE, ONCE, TWICE} live;
-} firstnode = {NULL, NULL, NULL, DEAD};
-
-/*     a predecessor list tells all the immediate
- *     predecessors of a given node
-*/
-struct predlist {
-       struct predlist *nextpred;
-       struct nodelist *pred;
-};
-
-struct nodelist *index();
-struct nodelist *findloop();
-struct nodelist *mark();
-char *malloc();
-char *empty = "";
-
-/*     the first for loop reads in the graph,
- *     the second prints out the ordering
-*/
-main(argc,argv)
-char **argv;
-{
-       register struct predlist *t;
-       FILE *input = stdin;
-       register struct nodelist *i, *j;
-       int x;
-       char precedes[50], follows[50];
-       if(argc>1) {
-               input = fopen(argv[1],"r");
-               if(input==NULL)
-                       error("cannot open ", argv[1]);
-       }
-       for(;;) {
-               x = fscanf(input,"%s%s",precedes, follows);
-               if(x==EOF)
-                       break;
-               if(x!=2)
-                       error("odd data",empty);
-               i = index(precedes);
-               j = index(follows);
-               if(i==j||present(i,j)) 
-                       continue;
-               t = (struct predlist *)malloc(sizeof(struct predlist));
-               t->nextpred = j->inedges;
-               t->pred = i;
-               j->inedges = t;
-       }
-       for(;;) {
-               x = 0;  /*anything LIVE on this sweep?*/
-               for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode) {
-                       if(i->live==LIVE) {
-                               x = 1;
-                               if(!anypred(i))
-                                       break;
-                       }
-               }
-               if(x==0)
-                       break;
-               if(i->nextnode==NULL)
-                       i = findloop();
-               printf("%s\n",i->name);
-               i->live = DEAD;
-       }
-}
-
-/*     is i present on j's predecessor list?
-*/
-present(i,j)
-struct nodelist *i, *j;
-{
-       register struct predlist *t;
-       for(t=j->inedges; t!=NULL; t=t->nextpred)
-               if(t->pred==i)
-                       return(1);
-       return(0);
-}
-
-/*     is there any live predecessor for i?
-*/
-anypred(i)
-struct nodelist *i;
-{
-       register struct predlist *t;
-       for(t=i->inedges; t!=NULL; t=t->nextpred)
-               if(t->pred->live==LIVE)
-                       return(1);
-       return(0);
-}
-
-/*     turn a string into a node pointer
-*/
-struct nodelist *
-index(s)
-register char *s;
-{
-       register struct nodelist *i;
-       register char *t;
-       for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode)
-               if(cmp(s,i->name))
-                       return(i);
-       for(t=s; *t; t++) ;
-       t = malloc((unsigned)(t+1-s));
-       i->nextnode = (struct nodelist *)malloc(sizeof(struct nodelist));
-       if(i->nextnode==NULL||t==NULL)
-               error("too many items",empty);
-       i->name = t;
-       i->live = LIVE;
-       i->nextnode->nextnode = NULL;
-       i->nextnode->inedges = NULL;
-       i->nextnode->live = DEAD;
-       while(*t++ = *s++);
-       return(i);
-}
-
-cmp(s,t)
-register char *s, *t;
-{
-       while(*s==*t) {
-               if(*s==0)
-                       return(1);
-               s++;
-               t++;
-       }
-       return(0);
-}
-
-error(s,t)
-char *s, *t;
-{
-       note(s,t);
-       exit(1);
-}
-
-note(s,t)
-char *s,*t;
-{
-       fprintf(stderr,"tsort: %s%s\n",s,t);
-}
-
-/*     given that there is a cycle, find some
- *     node in it
-*/
-struct nodelist *
-findloop()
-{
-       register struct nodelist *i, *j;
-       register struct predlist *p;
-       for(i= &firstnode; i->nextnode!=NULL; i=i->nextnode)
-               if(i->live==LIVE)
-                       break;
-       note("cycle in reverse order",empty);
-       while(i->live==LIVE) {
-               i->live = ONCE;
-               for(p=i->inedges; ; p=p->nextpred) {
-                       if(p==NULL)
-                               error("error 1");
-                       i = p->pred;
-                       if(i->live!=DEAD)
-                               break;
-               }
-       }
-       while(i->live==ONCE) {
-               i->live = TWICE;
-               note(i->name,empty);
-               for(p=i->inedges; ; p=p->nextpred) {
-                       if(p==NULL)
-                               error("error 2");
-                       i = p->pred;
-                       if(i->live!=DEAD)
-                               break;
-               }
-       }
-       for(j= &firstnode; j->nextnode!=NULL; j=j->nextnode)
-               if(j->live!=DEAD)
-                       j->live = LIVE;
-       return(i);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/tty.c b/.ref-Research-V7/usr/src/cmd/tty.c
deleted file mode 100644 (file)
index cedc61a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Type tty name
- */
-
-char   *ttyname();
-
-main(argc, argv)
-char **argv;
-{
-       register char *p;
-
-       p = ttyname(0);
-       if(argc==2 && !strcmp(argv[1], "-s"))
-               ;
-       else
-               printf("%s\n", (p? p: "not a tty"));
-       exit(p? 0: 1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/umount.c b/.ref-Research-V7/usr/src/cmd/umount.c
deleted file mode 100644 (file)
index 008c2d1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#define        NMOUNT  16
-#define        NAMSIZ  32
-
-struct mtab {
-       char    file[NAMSIZ];
-       char    spec[NAMSIZ];
-} mtab[NMOUNT];
-
-main(argc, argv)
-char **argv;
-{
-       register struct mtab *mp;
-       register char *p1, *p2;
-       int mf;
-
-       sync();
-       mf = open("/etc/mtab", 0);
-       read(mf, (char *)mtab, NMOUNT*2*NAMSIZ);
-       if(argc != 2) {
-               printf("arg count\n");
-               return(1);
-       }
-       if (umount(argv[1]) < 0) {
-               perror("umount");
-               return(1);
-       }
-       p1 = argv[1];
-       while(*p1++)
-               ;
-       p1--;
-       while(*--p1 == '/')
-               *p1 = '\0';
-       while(p1 > argv[1] && *--p1 != '/')
-               ;
-       if(*p1 == '/')
-               p1++;
-       argv[1] = p1;
-       for (mp = mtab; mp < &mtab[NMOUNT]; mp++) {
-               p1 = argv[1];
-               p2 = &mp->spec[0];
-               while (*p1++ == *p2)
-                       if (*p2++ == 0) {
-                               for (p1 = mp->file; p1 < &mp->file[NAMSIZ*2];)
-                                       *p1++ = 0;
-                               mp = &mtab[NMOUNT];
-                               while ((--mp)->file[0] == 0);
-                               mf = creat("/etc/mtab", 0644);
-                               write(mf, (char *)mtab, (mp-mtab+1)*2*NAMSIZ);
-                               return(0);
-                       }
-       }
-       printf("%s not in mount table\n", argv[1]);
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uniq.c b/.ref-Research-V7/usr/src/cmd/uniq.c
deleted file mode 100644 (file)
index 36f1001..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Deal with duplicated lines in a file
- */
-#include <stdio.h>
-#include <ctype.h>
-int    fields;
-int    letters;
-int    linec;
-char   mode;
-int    uniq;
-char   *skip();
-
-main(argc, argv)
-int argc;
-char *argv[];
-{
-       static char b1[1000], b2[1000];
-
-       while(argc > 1) {
-               if(*argv[1] == '-') {
-                       if (isdigit(argv[1][1]))
-                               fields = atoi(&argv[1][1]);
-                       else mode = argv[1][1];
-                       argc--;
-                       argv++;
-                       continue;
-               }
-               if(*argv[1] == '+') {
-                       letters = atoi(&argv[1][1]);
-                       argc--;
-                       argv++;
-                       continue;
-               }
-               if (freopen(argv[1], "r", stdin) == NULL)
-                       printe("cannot open %s\n", argv[1]);
-               break;
-       }
-       if(argc > 2 && freopen(argv[2], "w", stdout) == NULL)
-               printe("cannot create %s\n", argv[2]);
-
-       if(gline(b1))
-               exit(0);
-       for(;;) {
-               linec++;
-               if(gline(b2)) {
-                       pline(b1);
-                       exit(0);
-               }
-               if(!equal(b1, b2)) {
-                       pline(b1);
-                       linec = 0;
-                       do {
-                               linec++;
-                               if(gline(b1)) {
-                                       pline(b2);
-                                       exit(0);
-                               }
-                       } while(equal(b1, b2));
-                       pline(b2);
-                       linec = 0;
-               }
-       }
-}
-
-gline(buf)
-register char buf[];
-{
-       register c;
-
-       while((c = getchar()) != '\n') {
-               if(c == EOF)
-                       return(1);
-               *buf++ = c;
-       }
-       *buf = 0;
-       return(0);
-}
-
-pline(buf)
-register char buf[];
-{
-
-       switch(mode) {
-
-       case 'u':
-               if(uniq) {
-                       uniq = 0;
-                       return;
-               }
-               break;
-
-       case 'd':
-               if(uniq) break;
-               return;
-
-       case 'c':
-               printf("%4d ", linec);
-       }
-       uniq = 0;
-       fputs(buf, stdout);
-       putchar('\n');
-}
-
-equal(b1, b2)
-register char b1[], b2[];
-{
-       register char c;
-
-       b1 = skip(b1);
-       b2 = skip(b2);
-       while((c = *b1++) != 0)
-               if(c != *b2++) return(0);
-       if(*b2 != 0)
-               return(0);
-       uniq++;
-       return(1);
-}
-
-char *
-skip(s)
-register char *s;
-{
-       register nf, nl;
-
-       nf = nl = 0;
-       while(nf++ < fields) {
-               while(*s == ' ' || *s == '\t')
-                       s++;
-               while( !(*s == ' ' || *s == '\t' || *s == 0) ) 
-                       s++;
-       }
-       while(nl++ < letters && *s != 0) 
-                       s++;
-       return(s);
-}
-
-printe(p,s)
-char *p,*s;
-{
-       fprintf(stderr, p, s);
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/units.c b/.ref-Research-V7/usr/src/cmd/units.c
deleted file mode 100644 (file)
index 2822c15..0000000
+++ /dev/null
@@ -1,464 +0,0 @@
-#include <stdio.h>
-
-#define        NDIM    10
-#define        NTAB    601
-char   *dfile  = "/usr/lib/units";
-char   *unames[NDIM];
-double getflt();
-int    fperr();
-struct table   *hash();
-struct unit
-{
-       double  factor;
-       char    dim[NDIM];
-};
-
-struct table
-{
-       double  factor;
-       char    dim[NDIM];
-       char    *name;
-} table[NTAB];
-char   names[NTAB*10];
-struct prefix
-{
-       double  factor;
-       char    *pname;
-} prefix[] = 
-{
-       1e-18,  "atto",
-       1e-15,  "femto",
-       1e-12,  "pico",
-       1e-9,   "nano",
-       1e-6,   "micro",
-       1e-3,   "milli",
-       1e-2,   "centi",
-       1e-1,   "deci",
-       1e1,    "deka",
-       1e2,    "hecta",
-       1e2,    "hecto",
-       1e3,    "kilo",
-       1e6,    "mega",
-       1e6,    "meg",
-       1e9,    "giga",
-       1e12,   "tera",
-       0.0,    0
-};
-FILE   *inp;
-int    fperrc;
-int    peekc;
-int    dumpflg;
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-       register char *file;
-       struct unit u1, u2;
-       double f;
-
-       if(argc>1 && *argv[1]=='-') {
-               argc--;
-               argv++;
-               dumpflg++;
-       }
-       file = dfile;
-       if(argc > 1)
-               file = argv[1];
-       if ((inp = fopen(file, "r")) == NULL) {
-               printf("no table\n");
-               exit(1);
-       }
-       signal(8, fperr);
-       init();
-
-loop:
-       fperrc = 0;
-       printf("you have: ");
-       if(convr(&u1))
-               goto loop;
-       if(fperrc)
-               goto fp;
-loop1:
-       printf("you want: ");
-       if(convr(&u2))
-               goto loop1;
-       for(i=0; i<NDIM; i++)
-               if(u1.dim[i] != u2.dim[i])
-                       goto conform;
-       f = u1.factor/u2.factor;
-       if(fperrc)
-               goto fp;
-       printf("\t* %e\n", f);
-       printf("\t/ %e\n", 1./f);
-       goto loop;
-
-conform:
-       if(fperrc)
-               goto fp;
-       printf("conformability\n");
-       units(&u1);
-       units(&u2);
-       goto loop;
-
-fp:
-       printf("underflow or overflow\n");
-       goto loop;
-}
-
-units(up)
-struct unit *up;
-{
-       register struct unit *p;
-       register f, i;
-
-       p = up;
-       printf("\t%e ", p->factor);
-       f = 0;
-       for(i=0; i<NDIM; i++)
-               f |= pu(p->dim[i], i, f);
-       if(f&1) {
-               putchar('/');
-               f = 0;
-               for(i=0; i<NDIM; i++)
-                       f |= pu(-p->dim[i], i, f);
-       }
-       putchar('\n');
-}
-
-pu(u, i, f)
-{
-
-       if(u > 0) {
-               if(f&2)
-                       putchar('-');
-               if(unames[i])
-                       printf("%s", unames[i]); else
-                       printf("*%c*", i+'a');
-               if(u > 1)
-                       putchar(u+'0');
-                       return(2);
-       }
-       if(u < 0)
-               return(1);
-       return(0);
-}
-
-convr(up)
-struct unit *up;
-{
-       register struct unit *p;
-       register c;
-       register char *cp;
-       char name[20];
-       int den, err;
-
-       p = up;
-       for(c=0; c<NDIM; c++)
-               p->dim[c] = 0;
-       p->factor = getflt();
-       if(p->factor == 0.)
-               p->factor = 1.0;
-       err = 0;
-       den = 0;
-       cp = name;
-
-loop:
-       switch(c=get()) {
-
-       case '1':
-       case '2':
-       case '3':
-       case '4':
-       case '5':
-       case '6':
-       case '7':
-       case '8':
-       case '9':
-       case '-':
-       case '/':
-       case ' ':
-       case '\t':
-       case '\n':
-               if(cp != name) {
-                       *cp++ = 0;
-                       cp = name;
-                       err |= lookup(cp, p, den, c);
-               }
-               if(c == '/')
-                       den++;
-               if(c == '\n')
-                       return(err);
-               goto loop;
-       }
-       *cp++ = c;
-       goto loop;
-}
-
-lookup(name, up, den, c)
-char *name;
-struct unit *up;
-{
-       register struct unit *p;
-       register struct table *q;
-       register i;
-       char *cp1, *cp2;
-       double e;
-
-       p = up;
-       e = 1.0;
-
-loop:
-       q = hash(name);
-       if(q->name) {
-               l1:
-               if(den) {
-                       p->factor /= q->factor*e;
-                       for(i=0; i<NDIM; i++)
-                               p->dim[i] -= q->dim[i];
-               } else {
-                       p->factor *= q->factor*e;
-                       for(i=0; i<NDIM; i++)
-                               p->dim[i] += q->dim[i];
-               }
-               if(c >= '2' && c <= '9') {
-                       c--;
-                       goto l1;
-               }
-               return(0);
-       }
-       for(i=0; cp1 = prefix[i].pname; i++) {
-               cp2 = name;
-               while(*cp1 == *cp2++)
-                       if(*cp1++ == 0) {
-                               cp1--;
-                               break;
-                       }
-               if(*cp1 == 0) {
-                       e *= prefix[i].factor;
-                       name = cp2-1;
-                       goto loop;
-               }
-       }
-       for(cp1 = name; *cp1; cp1++);
-       if(cp1 > name+1 && *--cp1 == 's') {
-               *cp1 = 0;
-               goto loop;
-       }
-       printf("cannot recognize %s\n", name);
-       return(1);
-}
-
-equal(s1, s2)
-char *s1, *s2;
-{
-       register char *c1, *c2;
-
-       c1 = s1;
-       c2 = s2;
-       while(*c1++ == *c2)
-               if(*c2++ == 0)
-                       return(1);
-       return(0);
-}
-
-init()
-{
-       register char *cp;
-       register struct table *tp, *lp;
-       int c, i, f, t;
-       char *np;
-
-       cp = names;
-       for(i=0; i<NDIM; i++) {
-               np = cp;
-               *cp++ = '*';
-               *cp++ = i+'a';
-               *cp++ = '*';
-               *cp++ = 0;
-               lp = hash(np);
-               lp->name = np;
-               lp->factor = 1.0;
-               lp->dim[i] = 1;
-       }
-       lp = hash("");
-       lp->name = cp-1;
-       lp->factor = 1.0;
-
-l0:
-       c = get();
-       if(c == 0) {
-               printf("%l units; %l bytes\n\n", i, cp-names);
-               if(dumpflg)
-               for(tp = &table[0]; tp < &table[NTAB]; tp++) {
-                       if(tp->name == 0)
-                               continue;
-                       printf("%s", tp->name);
-                       units(tp);
-               }
-               fclose(inp);
-               inp = stdin;
-               return;
-       }
-       if(c == '/') {
-               while(c != '\n' && c != 0)
-                       c = get();
-               goto l0;
-       }
-       if(c == '\n')
-               goto l0;
-       np = cp;
-       while(c != ' ' && c != '\t') {
-               *cp++ = c;
-               c = get();
-               if (c==0)
-                       goto l0;
-               if(c == '\n') {
-                       *cp++ = 0;
-                       tp = hash(np);
-                       if(tp->name)
-                               goto redef;
-                       tp->name = np;
-                       tp->factor = lp->factor;
-                       for(c=0; c<NDIM; c++)
-                               tp->dim[c] = lp->dim[c];
-                       i++;
-                       goto l0;
-               }
-       }
-       *cp++ = 0;
-       lp = hash(np);
-       if(lp->name)
-               goto redef;
-       convr(lp);
-       lp->name = np;
-       f = 0;
-       i++;
-       if(lp->factor != 1.0)
-               goto l0;
-       for(c=0; c<NDIM; c++) {
-               t = lp->dim[c];
-               if(t>1 || (f>0 && t!=0))
-                       goto l0;
-               if(f==0 && t==1) {
-                       if(unames[c])
-                               goto l0;
-                       f = c+1;
-               }
-       }
-       if(f>0)
-               unames[f-1] = np;
-       goto l0;
-
-redef:
-       printf("redefinition %s\n", np);
-       goto l0;
-}
-
-double
-getflt()
-{
-       register c, i, dp;
-       double d, e;
-       int f;
-
-       d = 0.;
-       dp = 0;
-       do
-               c = get();
-       while(c == ' ' || c == '\t');
-
-l1:
-       if(c >= '0' && c <= '9') {
-               d = d*10. + c-'0';
-               if(dp)
-                       dp++;
-               c = get();
-               goto l1;
-       }
-       if(c == '.') {
-               dp++;
-               c = get();
-               goto l1;
-       }
-       if(dp)
-               dp--;
-       if(c == '+' || c == '-') {
-               f = 0;
-               if(c == '-')
-                       f++;
-               i = 0;
-               c = get();
-               while(c >= '0' && c <= '9') {
-                       i = i*10 + c-'0';
-                       c = get();
-               }
-               if(f)
-                       i = -i;
-               dp -= i;
-       }
-       e = 1.;
-       i = dp;
-       if(i < 0)
-               i = -i;
-       while(i--)
-               e *= 10.;
-       if(dp < 0)
-               d *= e; else
-               d /= e;
-       if(c == '|')
-               return(d/getflt());
-       peekc = c;
-       return(d);
-}
-
-get()
-{
-       register c;
-
-       if(c=peekc) {
-               peekc = 0;
-               return(c);
-       }
-       c = getc(inp);
-       if (c == EOF) {
-               if (inp == stdin) {
-                       printf("\n");
-                       exit(0);
-               }
-               return(0);
-       }
-       return(c);
-}
-
-struct table *
-hash(name)
-char *name;
-{
-       register struct table *tp;
-       register char *np;
-       register unsigned h;
-
-       h = 0;
-       np = name;
-       while(*np)
-               h = h*57 + *np++ - '0';
-       h %= NTAB;
-       tp = &table[h];
-l0:
-       if(tp->name == 0)
-               return(tp);
-       if(equal(name, tp->name))
-               return(tp);
-       tp++;
-       if(tp >= &table[NTAB])
-               tp = table;
-       goto l0;
-}
-
-fperr()
-{
-
-       signal(8, fperr);
-       fperrc++;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/update.c b/.ref-Research-V7/usr/src/cmd/update.c
deleted file mode 100644 (file)
index 85c0540..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Update the file system every 30 seconds.
- * For cache benefit, open certain system directories.
- */
-
-#include <signal.h>
-
-char *fillst[] = {
-       "/bin",
-       "/usr",
-       "/usr/bin",
-       0,
-};
-
-main()
-{
-       char **f;
-
-       if(fork())
-               exit(0);
-       close(0);
-       close(1);
-       close(2);
-       for(f = fillst; *f; f++)
-               open(*f, 0);
-       dosync();
-       for(;;)
-               pause();
-}
-
-dosync()
-{
-       sync();
-       signal(SIGALRM, dosync);
-       alarm(30);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/anlwrk.c b/.ref-Research-V7/usr/src/cmd/uucp/anlwrk.c
deleted file mode 100644 (file)
index 219e920..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-#define LLEN 10
-#define SAME 0
-
-/*******
- *     anlwrk(file, wvec)      create a vector of command arguments
- *     char *file, **wvec;
- *
- *     return codes:
- *             0  -  no more work in this file
- *             positive number  -  number of arguments
- */
-
-anlwrk(file, wvec)
-char *file, **wvec;
-{
-       static char str[BUFSIZ];
-       static FILE *fp = NULL;
-
-       if (file[0] == '\0')
-               return(0);
-       if (fp == NULL) {
-               fp = fopen(file, "r");
-               if (fp == NULL)
-                       return(0);
-       }
-
-       if (fgets(str, BUFSIZ, fp) == NULL) {
-               fclose(fp);
-               unlink(file);
-               file[0] = '\0';
-               fp = NULL;
-               return(0);
-       }
-
-       return(getargs(str, wvec));
-}
-
-
-/***
- *     iswrk(file, reqst, dir, pre)
- *     char *file, *reqst, *dir, *pre;
- *
- *     iswrk  -  this routine will check the work list (list).
- *     If it is empty or the present work is exhausted, it
- *     will call gtwrk to generate a new list.
- *     The "reqst" field will be the string "chk" or "get" to
- *     check for work, or get the next work file respectively.
- *
- *     return codes:
- *             0  -  no more work (or some error)
- *             1  -  there is work
- */
-
-iswrk(file, reqst, dir, pre)
-char *file, *reqst, *dir, *pre;
-{
-       static char **listp, *list[LLEN];
-
-       if (listp == NULL || *listp == NULL || listp > (list + LLEN)
-         || !prefix(pre, *listp)) {
-               int i;
-               for (i = 0, listp = list; i < LLEN; i++) {
-                       if (*listp != NULL)
-                               free(*listp);
-                       *listp++ = NULL;
-               }
-               if (gtwrk(dir, pre, listp = list, LLEN) != 0)
-                       /* alloc error */
-                       return(0);
-       }
-
-       if (*listp == NULL)
-               return(0);
-
-       if (strcmp(reqst, "get") == SAME)
-               sprintf(file, "%s/%s", dir, *listp++);
-       return(1);
-}
-
-
-/***
- *     gtwvec(file, dir, wkpre, wrkvec)        get work vector 
- *     char *file, *dir, *wkpre, **wrkvec;
- *
- *     return codes:
- *             positive number  -  number of arguments
- *             0 -  no arguments - fail
- */
-
-gtwvec(file, dir, wkpre, wrkvec)
-char *file, *dir, *wkpre, **wrkvec;
-{
-       int nargs;
-
-       while ((nargs = anlwrk(file, wrkvec)) == 0) {
-               if (!iswrk(file, "get", dir, wkpre))
-                       return(0);
-       }
-       return(nargs);
-}
-
-#define ANYREAD 04
-
-/***
- *     gtwrk(dir, pre, list, llen)
- *     char *dir, *pre, **list;
- *     int llen;
- *
- *     gtwrk  -  this routine will build a sorted list
- *     of files in a directory.
- *     "dir" is the directory name to search for file names
- *     beginning with the prefix (pre).
- *     "list" is the pointer to the list and "llen" is the
- *     length of the list.
- *
- *     return codes:  0  |  FAIL
- */
-
-gtwrk(dir, pre, list, llen)
-char *dir, *pre, **list;
-int llen;
-{
-       struct stat s;
-       char filename[NAMESIZE], *p;
-       char **first, **last;
-       FILE *pdir;
-       extern int compar();
-       extern char *calloc();
-
-       first = last = list;
-       if ((pdir = fopen(dir, "r")) == NULL)
-               return(FAIL);
-       while (gnamef(pdir, filename)) {
-               if (!prefix(pre, filename))
-                       continue;
-               if (stat(filename, &s) == -1)
-                       continue;
-               if ((s.st_mode & ANYREAD) == 0)
-                       continue;
-               if ((p = calloc(strlen(filename) + 1, sizeof (char))) == NULL)
-                       return(FAIL);
-
-               strcpy(p, filename);
-               if ((last - first) < llen)
-                       *last++ = p;
-       }
-
-       fclose(pdir);
-       qsort(first, last - first, sizeof *last, compar);
-       return(0);
-}
-
-
-/***
- *     compar(p1, p2)
- *     char **p1, **p2;
- *
- *     compar  -  this routine is used by qsort.
- *
- */
-
-compar(p1, p2)
-char **p1, **p2;
-{
-       return(strcmp(*p1, *p2));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/chkpth.c b/.ref-Research-V7/usr/src/cmd/uucp/chkpth.c
deleted file mode 100644 (file)
index 268759c..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-#define DFLTNAME "default"
-#define MAXUSERS 20
-struct userpath {
-       char *us_lname;
-       char *us_mname;
-       char us_callback;
-       char **us_path;
-};
-struct userpath Upt[15];
-struct userpath *Mchdef = NULL, *Logdef = NULL;
-int Nbrusers = 0;
-int Uptfirst = 1;
-
-/*******
- *     chkpth(logname, mchname, path)
- *     char *path, *logname, *mchname;
- *
- *     chkpth  -  this routine will check the path table for the
- *     machine or log name (non-null parameter) to see if the
- *     input path (path)
- *     starts with an acceptable prefix.
- *
- *     return codes:  0  |  FAIL
- */
-
-chkpth(logname, mchname, path)
-char *path, *logname, *mchname;
-{
-       struct userpath *u;
-       extern char *lastpart();
-       char **p, *s;
-       char c;
-       int ret, i;
-
-       if (prefix(THISDIR, path))
-               return(FAIL);
-       if (Uptfirst) {
-               ret = rdpth(Upt);
-               ASSERT(ret == 0, "INIT USERFILE %d", Nbrusers);
-               Uptfirst = 0;
-       }
-       for (u = Upt, i = 0; i < Nbrusers; i++, u++) {
-               if (*logname != '\0' && strcmp(logname, u->us_lname) == SAME)
-                       break;
-               if (*mchname != '\0' && strcmp(mchname, u->us_mname) == SAME)
-                       break;
-
-       }
-       if (i >= Nbrusers) {
-               if (*logname == '\0')
-                       u = Mchdef;
-               else
-                       u = Logdef;
-               if (u == NULL)
-                       return(FAIL);
-       }
-       /* found user name */
-       p = u->us_path;
-       /*  check for /../ in path name  */
-       for (s = path; *s != '\0'; s++) {
-               if (*s == '/' && prefix("../", (++s)))
-                       return(FAIL);
-       }
-
-       if (chklnk(path) > LINKLEVEL)
-               return(FAIL);
-       for (p = u->us_path; *p != NULL; p++)
-               if (prefix(*p, path))
-                       return(0);
-
-       if (prefix(Spool, path)) {
-               if ((c = *lastpart(path)) == DATAPRE
-                 || c == XQTPRE)
-                       return(0);
-       }
-       /* path name not valid */
-       return(FAIL);
-}
-
-
-/***
- *     rdpth(u)
- *     struct userpath *u;
- *
- *     rdpth  -  this routine will read the USFILE and
- *     construct the userpath structure pointed to by (u);
- *
- *     return codes:  0  |  FAIL
- */
-
-rdpth(u)
-struct userpath *u;
-{
-       char buf[BUFSIZ + 1], *pbuf[BUFSIZ + 1], *pc, **cp;
-       extern char *calloc(), *index();
-       FILE *uf;
-
-       if ((uf = fopen(USERFILE, "r")) == NULL) {
-               /* can not open file */
-               return(FAIL);
-       }
-
-       while (fgets(buf, BUFSIZ, uf) != NULL) {
-               int nargs, i;
-               if (++Nbrusers > MAXUSERS) {
-                       fclose(uf);
-                       return(FAIL);
-               }
-               if ((pc = calloc(strlen(buf) + 1, sizeof (char)))
-                       == NULL) {
-                       /* can not allocate space */
-                       fclose(uf);
-                       return(FAIL);
-               }
-
-               strcpy(pc, buf);
-               nargs = getargs(pc, pbuf);
-               u->us_lname = pbuf[0];
-               pc = index(u->us_lname, ',');
-               if (pc != NULL)
-                       *pc++ = '\0';
-               else
-                       pc = u + strlen(u->us_lname);
-               u->us_mname = pc;
-               if (*u->us_lname == '\0')
-                       Logdef = u;
-               else if (*u->us_mname == '\0')
-                       Mchdef = u;
-               i = 1;
-               if (strcmp(pbuf[1], "c") == SAME) {
-                       u->us_callback = 1;
-                       i++;
-               }
-               else
-                       u->us_callback = 0;
-               if ((cp = u->us_path =
-                 calloc(nargs - i + 1, sizeof (char *))) == NULL) {
-                       /*  can not allocate space */
-                       fclose(uf);
-                       return(FAIL);
-               }
-
-               while (i < nargs)
-                       *cp++ = pbuf[i++];
-               *cp = NULL;
-               u++;
-       }
-
-       fclose(uf);
-       return(0);
-}
-
-
-/***
- *     callback(name)  check for callback
- *     char *name;
- *
- *     return codes:
- *             0  -  no call back
- *             1  -  call back
- */
-
-callback(name)
-char *name;
-{
-       struct userpath *u;
-       int ret, i;
-
-       if (Uptfirst) {
-               ret = rdpth(Upt);
-               ASSERT(ret == 0, "INIT USERFILE %d", Nbrusers);
-               Uptfirst = 0;
-       }
-
-       for (u = Upt, i = 0; i < Nbrusers; u++, i++) {
-               if (strcmp(u->us_lname, name) != SAME)
-                       continue;
-
-               /* found user name */
-               return(u->us_callback);
-       }
-
-       /* userid not found */
-       return(0);
-}
-
-
-/***
- *     chklnk(name)    get number of links
- *     char *name;
- *
- *     return codes: 0 - stat failed or directory | number of links
- */
-
-chklnk(name)
-char *name;
-{
-       struct stat s;
-
-       if (stat(name, &s) == -1)
-               return(0);
-       if ((s.st_mode & S_IFMT) == S_IFDIR)
-               return(0);
-       return(s.st_nlinks);
-}
-
-
-/***
- *     chkperm(file, user, mopt)       check write permission of file
- *     char *file, *user;
- *     char *mopt;             none NULL - create directories
- *
- *     if mopt != NULL and permissions are ok,
- *     a side effect of this routine is to make
- *     directories up to the last part of the
- *     filename (if they do not exist).
- *
- *     return 0 | FAIL
- */
-
-chkperm(file, user, mopt)
-char *file, *user, *mopt;
-{
-       struct stat s;
-       int ret, bits;
-       char dir[MAXFULLNAME];
-       extern char *lastpart();
-
-       if (stat(file, &s) != -1)
-               return(0);
-
-       strcpy(dir, file);
-       *lastpart(dir) = '\0';
-       if ((ret = stat(dir, &s)) == -1
-         && mopt == NULL)
-               return(FAIL);
-
-       bits = (geteuid() == 0) ? 02 : 0200;
-       if (ret != -1) {
-               if ((s.st_mode & bits) == 0)
-                       return(FAIL);
-               else
-                       return(0);
-       }
-
-       /*  make directories  */
-       return(mkdirs(file));
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/cico.c b/.ref-Research-V7/usr/src/cmd/uucp/cico.c
deleted file mode 100644 (file)
index 891f4cb..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-#include "uucp.h"
-#include "uucpdefs.h"
-#include <signal.h>
-#include <sgtty.h>
-#include <setjmp.h>
-
-jmp_buf Sjbuf;
-       /*  call fail text  */
-char *Stattext[] = {
-       "",
-       "BAD SYSTEM",
-       "WRONG TIME",
-       "SYSTEM LOCKED",
-       "NO DEVICE",
-       "DIAL FAILED",
-       "LOGIN FAILED",
-       "BAD SEQUENCE"
-       };
-
-int Role = 0;
-
-       /*  call fail codes  */
-int Stattype[] = {0, 0, 0, 0,
-       SS_NODEVICE, SS_FAIL, SS_FAIL, SS_BADSEQ
-       };
-
-
-int Errorrate = 0;
-struct sgttyb Savettyb;
-
-/*******
- *     cico - this program is used  to place a call to a
- *     remote machine, login, and copy files between the two machines.
- */
-
-main(argc, argv)
-char *argv[];
-{
-       int ret, seq;
-       int onesys = 0;
-       char wkpre[NAMESIZE], file[NAMESIZE];
-       char msg[BUFSIZ], *p, *q;
-       extern onintr(), timeout();
-       extern intrINT();
-       extern intrHUP();
-       extern intrQUIT();
-       extern intrTERM();
-       extern intrEXIT();
-       extern char *pskip();
-       char rflags[30];
-       char *ttyn;
-       char *ttyname();
-
-       signal(SIGILL, intrEXIT);
-       signal(SIGTRAP, intrEXIT);
-       signal(SIGIOT, intrEXIT);
-       signal(SIGEMT, intrEXIT);
-       signal(SIGFPE, intrEXIT);
-       signal(SIGBUS, intrEXIT);
-       signal(SIGSEGV, intrEXIT);
-       signal(SIGSYS, intrEXIT);
-       signal(SIGINT, intrINT);
-       signal(SIGHUP, intrHUP);
-       signal(SIGQUIT, intrQUIT);
-       signal(SIGTERM, intrTERM);
-       ret = guinfo(getuid(), User, msg);
-       strcpy(Loginuser, User);
-       ASSERT(ret == 0, "BAD UID ret %d", ret);
-
-       rflags[0] = '\0';
-       strcpy(Rmtname, MYNAME);
-       Ifn = Ofn = -1;
-       while(argc>1 && argv[1][0] == '-'){
-               switch(argv[1][1]){
-               case 'd':
-                       Spool = &argv[1][2];
-                       break;
-/*
-*              case 'E':
-*                      Errorrate = atoi(&argv[1][2]);
-*                      if (Errorrate <= 0)
-*                              Errorrate = 100;
-*                      break;
-*              case 'g':
-*                      Pkdrvon = 1;
-*                      break;
-*              case 'G':
-*                      Pkdrvon = 1;
-*                      strcat(rflags, " -g ");
-*                      break;
-*/
-               case 'r':
-                       Role = atoi(&argv[1][2]);
-                       break;
-               case 's':
-                       sprintf(Rmtname, "%.7s", &argv[1][2]);
-                       if (Rmtname[0] != '\0')
-                               onesys = 1;
-                       break;
-               case 'x':
-                       Debug = atoi(&argv[1][2]);
-                       if (Debug <= 0)
-                               Debug = 1;
-                       strcat(rflags, argv[1]);
-                       break;
-               default:
-                       printf("unknown flag %s\n", argv[1]);
-                       break;
-               }
-               --argc;  argv++;
-       }
-
-       chdir(Spool);
-       strcpy(Wrkdir, Spool);
-
-       if (Role == SLAVE) {
-               /* initial handshake */
-               onesys = 1;
-               ret = ioctl(0, TIOCGETP, &Savettyb);
-               Savettyb.sg_flags |= ECHO;
-               Savettyb.sg_flags &= ~RAW;
-               Ifn = 0;
-               Ofn = 1;
-               fixmode(Ifn);
-               fclose(stderr);
-               fopen(RMTDEBUG, "w");
-               chmod(RMTDEBUG, 0666);
-               omsg('S', "here", Ofn);
-               signal(SIGALRM, timeout);
-               alarm(MAXMSGTIME);
-               if (setjmp(Sjbuf)) {
-                       /* timed out */
-                       ret = ioctl(0, TIOCSETP, &Savettyb);
-                       exit(0);
-               }
-               for (;;) {
-                       ret = imsg(msg, Ifn);
-                       if (ret != 0) {
-                               alarm(0);
-                               ret = ioctl(0, TIOCSETP, &Savettyb);
-                               exit(0);
-                       }
-                       if (msg[0] == 'S')
-                               break;
-               }
-               alarm(0);
-               DEBUG(4, "msg-%s,", msg);
-               q = &msg[1];
-               p = pskip(q);
-               sprintf(Rmtname, "%.7s", q);
-               DEBUG(4, "sys-%s\n", Rmtname);
-               if (mlock(Rmtname)) {
-                       omsg('R', "LCK", Ofn);
-                       cleanup(0);
-               }
-               else if (callback(Loginuser)) {
-                       signal(SIGINT, SIG_IGN);
-                       signal(SIGHUP, SIG_IGN);
-                       omsg('R', "CB", Ofn);
-                       DEBUG(4, "CALLBACK Role %d\n", Role);
-                       logent("CALLBACK", "REQUIRED");
-                       /*  set up for call back  */
-                       systat(Rmtname, SS_CALLBACK, "CALL BACK");
-                       gename(CMDPRE, Rmtname, 'C', file);
-                       close(creat(file, 0666));
-                       chmod(file, 0666);
-                       xuucico(Rmtname);
-                       cleanup(0);
-               }
-               seq = 0;
-               while (*p == '-') {
-                       q = pskip(p);
-                       switch(*(++p)) {
-                       case 'g':
-                               Pkdrvon = 1;
-                               break;
-                       case 'x':
-                               Debug = atoi(++p);
-                               if (Debug <= 0)
-                                       Debug = 1;
-                               break;
-                       case 'Q':
-                               seq = atoi(++p);
-                               break;
-                       default:
-                               break;
-                       }
-                       p = q;
-               }
-               if (callok(Rmtname) == SS_BADSEQ) {
-                       logent("BADSEQ", "PREVIOUS");
-                       omsg('R', "BADSEQ", Ofn);
-                       cleanup(0);
-               }
-               if ((ret = gnxseq(Rmtname)) == seq) {
-                       omsg('R', "OK", Ofn);
-                       cmtseq();
-               }
-               else {
-                       systat(Rmtname, Stattype[7], Stattext[7]);
-                       logent("BAD SEQ", "HANDSHAKE FAILED");
-                       ulkseq();
-                       omsg('R', "BADSEQ", Ofn);
-                       cleanup(0);
-               }
-       }
-loop:
-       if (!onesys) {
-               ret = gnsys(Rmtname, Spool, CMDPRE);
-               if (ret == FAIL)
-                       cleanup(100);
-               if (ret == 0)
-                       cleanup(0);
-       }
-       else if (Role == MASTER && callok(Rmtname) != 0) {
-               logent("SYSTEM STATUS", "CAN NOT CALL");
-               cleanup(0);
-       }
-
-       sprintf(wkpre, "%c.%.7s", CMDPRE, Rmtname);
-
-       if (Role == MASTER) {
-               /*  master part */
-               signal(SIGINT, SIG_IGN);
-               signal(SIGHUP, SIG_IGN);
-               signal(SIGQUIT, SIG_IGN);
-               if (!iswrk(file, "chk", Spool, wkpre) && !onesys) {
-                       logent(Rmtname, "NO WORK");
-                       cleanup(0);
-               }
-               if (Ifn != -1 && Role == MASTER) {
-                       write(Ofn, EOTMSG, strlen(EOTMSG));
-                       close(Ofn);
-                       close(Ifn);
-                       Ifn = Ofn = -1;
-                       rmlock(NULL);
-                       clsacu();
-                       sleep(3);
-               }
-               sprintf(msg, "call to %s ", Rmtname);
-               if (mlock(Rmtname) != 0) {
-                       logent(msg, "LOCKED");
-                       goto next;
-               }
-               Ofn = Ifn = conn(Rmtname);
-               if (Ofn < 0) {
-                       logent(msg, "FAILED");
-                       systat(Rmtname, Stattype[-Ofn],
-                               Stattext[-Ofn]);
-                       goto next;
-               }
-               else {
-                       logent(msg, "SUCCEEDED");
-               }
-       
-               if (setjmp(Sjbuf))
-                       goto next;
-               signal(SIGALRM, timeout);
-               alarm(2 * MAXMSGTIME);
-               for (;;) {
-                       ret = imsg(msg, Ifn);
-                       if (ret != 0) {
-                               alarm(0);
-                               goto next;
-                       }
-                       if (msg[0] == 'S')
-                               break;
-               }
-               alarm(MAXMSGTIME);
-               seq = gnxseq(Rmtname);
-               sprintf(msg, "%.7s -Q%d %s", Myname, seq, rflags);
-               omsg('S', msg, Ofn);
-               for (;;) {
-                       ret = imsg(msg, Ifn);
-                       DEBUG(4, "msg-%s\n", msg);
-                       if (ret != 0) {
-                               alarm(0);
-                               ulkseq();
-                               goto next;
-                       }
-                       if (msg[0] == 'R')
-                               break;
-               }
-               alarm(0);
-               if (msg[1] == 'B') {
-                       /* bad sequence */
-                       logent("BAD SEQ", "HANDSHAKE FAILED");
-                       systat(Rmtname, Stattype[7], Stattext[7]);
-                       ulkseq();
-                       goto next;
-               }
-               if (strcmp(&msg[1], "OK") != SAME)  {
-                       logent(&msg[1], "HANDSHAKE FAILED");
-                       ulkseq();
-                       goto next;
-               }
-               cmtseq();
-       }
-       ttyn = ttyname(Ifn);
-       if (ttyn != NULL)
-               chmod(ttyn, 0600);
-       DEBUG(1, " Rmtname %s, ", Rmtname);
-       DEBUG(1, "my Role %s,  ", Role ? "MASTER" : "SLAVE");
-       DEBUG(1, "Spool - %s\n", Spool);
-       DEBUG(1, "Ifn - %d, ", Ifn);
-       DEBUG(1, "Ofn - %d, ", Ofn);
-       DEBUG(1, "Loginuser - %s\n", Loginuser);
-
-       ret = startup(Role);
-       if (ret != SUCCESS) {
-               logent("startup", "FAILED");
-               systat(Rmtname, SS_FAIL, "STARTUP");
-               goto next;
-       }
-       else {
-               systat(Rmtname, SS_INPROGRESS, "TALKING");
-               ret = cntrl(Role, wkpre);
-               DEBUG(1, "ret from cntrl - %d\n", ret);
-               signal(SIGINT, SIG_IGN);
-               signal(SIGHUP, SIG_IGN);
-               signal(SIGALRM, timeout);
-               if (ret == 0)
-                       rmstat(Rmtname);
-
-               else
-                       systat(Rmtname, SS_FAIL, "CONVERSATION");
-               alarm(MAXMSGTIME);
-               omsg('O', "OOOOO", Ofn);
-               DEBUG(4, "send OO %d,", ret);
-               if (!setjmp(Sjbuf)) {
-                       for (;;) {
-                               omsg('O', "OOOOO", Ofn);
-                               ret = imsg(msg, Ifn);
-                               if (ret != 0)
-                                       break;
-                               if (msg[0] == 'O')
-                                       break;
-                       }
-               }
-               alarm(0);
-       }
-next:
-       if (!onesys) {
-               goto loop;
-       }
-       cleanup(0);
-}
-
-
-int Hupvec[] = {0, 0, 1};
-
-/***
- *     cleanup(code)   cleanup and exit with "code" status
- *     int code;
- */
-
-cleanup(code)
-int code;
-{
-       int ret;
-
-       signal(SIGINT, SIG_IGN);
-       signal(SIGHUP, SIG_IGN);
-       rmlock(NULL);
-       clsacu();
-       logcls();
-       if (Role == SLAVE) {
-               ret = ioctl(0, TIOCSETP, &Savettyb);
-               DEBUG(4, "\nIfn - %d, ", Ifn);
-               DEBUG(4, "ret ioctl - %d\n", ret);
-               DEBUG(4, "tty.flags %o,", Savettyb.sg_flags);
-               DEBUG(4, "tty.ispeed %d, ", Savettyb.sg_ispeed);
-               DEBUG(4, "tty.ospeed %d, ", Savettyb.sg_ospeed);
-               ret = ioctl(0, TIOCSETP, Hupvec);
-               DEBUG(4, "ret ioctl - %d\n", ret);
-       }
-       if (Ofn != -1) {
-               if (Role == MASTER)
-                       write(Ofn, EOTMSG, strlen(EOTMSG));
-               close(Ifn);
-               close(Ofn);
-       }
-       DEBUG(1, "exit code %d\n", code);
-       if (code == 0)
-               xuuxqt();
-       exit(code);
-}
-
-/***
- *     onintr(inter)   interrupt - remove locks and exit
- */
-
-onintr(inter)
-int inter;
-{
-       char str[30];
-       signal(inter, SIG_IGN);
-       sprintf(str, "SIGNAL %d", inter);
-       logent(str, "CAUGHT");
-       cleanup(inter);
-}
-
-intrINT() { onintr(SIGINT);}
-intrHUP() { onintr(SIGHUP);}
-intrQUIT() { onintr(SIGQUIT);}
-intrTERM() { onintr(SIGTERM);}
-intrEXIT() {_exit(77);}
-
-/***
- *     fixmode(tty)    fix kill/echo/raw on line
- *
- *     return codes:  none
- */
-
-fixmode(tty)
-int tty;
-{
-       struct sgttyb ttbuf;
-       int ret;
-
-       ioctl(tty, TIOCGETP, &ttbuf);
-       ttbuf.sg_flags |= (ANYP | RAW);
-       ttbuf.sg_flags &= ~(ECHO | ALLDELAY);
-       ret = ioctl(tty, TIOCSETP, &ttbuf);
-       ASSERT(ret >= 0, "RETURN FROM STTY %d", ret);
-       ioctl(tty, TIOCEXCL, 0);
-       return;
-}
-
-
-/***
- *     timeout()       catch SIGALRM routine
- */
-
-timeout()
-{
-       longjmp(Sjbuf, 1);
-}
-
-static char *
-pskip(p)
-register char *p;
-{
-       while( *p && *p != ' ' )
-               ++p;
-       if( *p ) *p++ = 0;
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/cntrl.c b/.ref-Research-V7/usr/src/cmd/uucp/cntrl.c
deleted file mode 100644 (file)
index dd2c9f4..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-struct Proto {
-       char P_id;
-       int (*P_turnon)();
-       int (*P_rdmsg)();
-       int (*P_wrmsg)();
-       int (*P_rddata)();
-       int (*P_wrdata)();
-       int (*P_turnoff)();
-};
-
-
-extern int gturnon(), gturnoff();
-extern int grdmsg(), grddata();
-extern int gwrmsg(), gwrdata();
-extern int imsg();
-extern int omsg();
-
-struct Proto Ptbl[]={
-       'g', gturnon, grdmsg, gwrmsg, grddata, gwrdata, gturnoff,
-       '\0'
-};
-
-int (*Rdmsg)()=imsg, (*Rddata)();
-int (*Wrmsg)()=omsg, (*Wrdata)();
-int (*Turnon)(), (*Turnoff)();
-
-
-#define YES "Y"
-#define NO "N"
-#define Y 'Y'
-#define N 'N'
-
-
-#define XUUCP 'X'      /* execute uucp (string) */
-#define SLTPTCL 'P'    /* select protocol  (string)  */
-#define USEPTCL 'U'    /* use protocol (character) */
-#define RCVFILE 'R'    /* receive file (string) */
-#define SNDFILE 'S'    /* send file (string) */
-#define RQSTCMPT 'C'   /* request complete (string - yes | no) */
-#define HUP     'H'    /* ready to hangup (string - yes | no) */
-
-
-#define W_TYPE         wrkvec[0]
-#define W_FILE1                wrkvec[1]
-#define W_FILE2                wrkvec[2]
-#define W_USER         wrkvec[3]
-#define W_OPTNS                wrkvec[4]
-#define W_DFILE                wrkvec[5]
-#define W_MODE         wrkvec[6]
-
-#define RMESG(m, s) if (rmesg(m, s) != 0) return(FAIL);
-#define RAMESG(s) if (rmesg('\0', s) != 0) return(FAIL)
-#define WMESG(m, s) if(wmesg(m, s) != 0) return(FAIL)
-
-char Wfile[MAXFULLNAME] = {'\0'};
-char Dfile[MAXFULLNAME];
-
-/*******
- *     cntrl(role, wkpre)
- *     int role;
- *     char *wkpre;
- *
- *     cntrl  -  this routine will execute the conversation
- *     between the two machines after both programs are
- *     running.
- *
- *     return codes
- *             SUCCESS - ok
- *             FAIL - failed
- */
-
-cntrl(role, wkpre)
-int role;
-char *wkpre;
-{
-       char msg[BUFSIZ], rqstr[BUFSIZ];
-       FILE *fp;
-       int filemode;
-       struct stat stbuf;
-       char filename[MAXFULLNAME], wrktype, *wrkvec[20];
-       extern (*Rdmsg)(), (*Wrmsg)();
-       extern char *index(), *lastpart();
-       int status = 1, i;
-       int ret;
-       static int pnum, tmpnum = 0;
-
-       pnum = getpid();
-top:
-       DEBUG(4, "*** TOP ***  -  role=%d, ", role);
-       if (role == MASTER) {
-               /* get work */
-               if ((i = gtwvec(Wfile, Spool, wkpre, wrkvec)) == 0) {
-                       WMESG(HUP, "");
-                       RMESG(HUP, msg);
-                       goto process;
-               }
-               wrktype = W_TYPE[0];
-
-               DEBUG(4, "wrktype %c, ", wrktype);
-               if (wrktype == XUUCP) {
-                       int n;
-                       msg[0] = '\0';
-                       for (n = 1; n < i; n++) {
-                               strcat(msg, " ");
-                               strcat(msg, wrkvec[n]);
-                       }
-                       sprintf(rqstr, "X %s", msg);
-                       logent(rqstr, "REQUEST");
-                       goto sendmsg;
-               }
-
-               ASSERT(i > 4, "ARG COUNT - %d\n", i);
-               sprintf(msg, " %s %s %s %s %s %s",
-                       W_FILE1, W_FILE2, W_USER,
-                       W_OPTNS, W_DFILE, W_MODE);
-               strcpy(User, W_USER);
-               ASSERT(strlen(User) <= 10, "User - %s\n", User);
-               sprintf(rqstr, "%s %s %s %s", W_TYPE, W_FILE1,
-                 W_FILE2, W_USER);
-               logent(rqstr, "REQUEST");
-               DEBUG(4, "User - %s\n", User);
-               if (wrktype == SNDFILE ) {
-                       strcpy(filename, W_FILE1);
-                       expfile(filename);
-                       if (chkpth(User, "", filename)) {
-                               /*  access denied  */
-                               logent("DENIED", "ACCESS");
-                               unlink(W_DFILE);
-                               unlink(Wfile);
-                               goto top;
-                       }
-
-                       strcpy(Dfile, W_DFILE);
-                       if ((fp = fopen(Dfile, "r")) == NULL
-                         && (fp = fopen(filename, "r")) == NULL) {
-                               /*  can not read data file  */
-                               logent("CAN'T READ DATA", "FAILED");
-                               unlink(Wfile);
-                               unlink(Dfile);
-                               goto top;
-                       }
-               }
-
-               if (wrktype == RCVFILE) {
-                       strcpy(filename, W_FILE2);
-                       expfile(filename);
-                       if (chkpth(User, "", filename)
-                        || chkperm(filename, User, index(W_OPTNS, 'd'))) {
-                               /*  access denied  */
-                               logent("DENIED", "ACCESS");
-                               unlink(Wfile);
-                               goto top;
-                       }
-                       sprintf(Dfile, "%s/TM.%05d.%03d", Spool, pnum, tmpnum++);
-                       if ((fp = fopen(Dfile, "w")) == NULL) {
-                               /*  can not create temp  */
-                               logent("CAN'T CREATE TM", "FAILED");
-                               unlink(Wfile);
-                               unlink(Dfile);
-                               goto top;
-                       }
-                       chmod(Dfile, 0666);
-               }
-sendmsg:
-               DEBUG(4, "wrktype - %c, ", wrktype);
-               DEBUG(4, " fileno - %d\n", fileno(fp));
-               WMESG(wrktype, msg);
-               RMESG(wrktype, msg);
-               goto process;
-       }
-
-       /* role is slave */
-       RAMESG(msg);
-       goto process;
-
-process:
-       DEBUG(4, " PROCESS: msg - %s\n", msg);
-       switch (msg[0]) {
-
-       case RQSTCMPT:
-               DEBUG(4, "%s\n", "RQSTCMPT:");
-               logent((msg[1] == 'N') ? "FAILED" : "SUCCEEDED", "REQUEST");
-               if (role == MASTER) {
-                       notify(W_OPTNS, W_USER, W_FILE1, Rmtname,
-                         (msg[1] == N) ? "failed" : "succeeded");
-               }
-               goto top;
-
-       case HUP:
-               DEBUG(4, "%s\n", "HUP:");
-               if (msg[1] == Y) {
-                       WMESG(HUP, YES);
-                       (*Turnoff)();
-                       Rdmsg = imsg;
-                       Wrmsg = omsg;
-                       return(0);
-               }
-
-               if (msg[1] == N) {
-                       ASSERT(role == MASTER,
-                               "role - %d", role);
-                       role = SLAVE;
-                       goto top;
-               }
-
-               /* get work */
-               if (!iswrk(Wfile, "chk", Spool, wkpre)) {
-                       WMESG(HUP, YES);
-                       RMESG(HUP, msg);
-                       goto process;
-               }
-
-               WMESG(HUP, NO);
-               role = MASTER;
-               goto top;
-
-       case XUUCP:
-               if (role == MASTER) {
-                       unlink(Wfile);
-                       goto top;
-               }
-
-               /*  slave part  */
-               i = getargs(msg, wrkvec);
-               strcpy(filename, W_FILE1);
-               if (index(filename, ';') != NULL
-                 || index(W_FILE2, ';') != NULL
-                 || i < 3) {
-                       WMESG(XUUCP, NO);
-                       goto top;
-               }
-               expfile(filename);
-               if (chkpth("", Rmtname, filename)) {
-                       WMESG(XUUCP, NO);
-                       logent("XUUCP DENIED", filename);
-                       goto top;
-               }
-               sprintf(rqstr, "%s %s", filename, W_FILE2);
-               xuucp(rqstr);
-               WMESG(XUUCP, YES);
-               goto top;
-
-       case SNDFILE:
-               /*  MASTER section of SNDFILE  */
-
-               DEBUG(4, "%s\n", "SNDFILE:");
-               if (msg[1] == N) {
-                       logent("DENIED", "REQUEST");
-                       ASSERT(role == MASTER,
-                               "role - %d", role);
-                       fclose(fp);
-                       unlink(W_DFILE);
-                       unlink(Wfile);
-                       goto top;
-               }
-
-               if (msg[1] == Y) {
-                       /* send file */
-                       ASSERT(role == MASTER,
-                               "role - %d", role);
-                       ret = (*Wrdata)(fp, Ofn);
-                       fclose(fp);
-                       if (ret != 0)
-                               return(FAIL);
-                       unlink(W_DFILE);
-                       RMESG(RQSTCMPT, msg);
-                       goto process;
-               }
-
-               /*  SLAVE section of SNDFILE  */
-               ASSERT(role == SLAVE,
-                       "role - %d", role);
-
-               /* request to receive file */
-               /* check permissions */
-               i = getargs(msg, wrkvec);
-               ASSERT(i > 4, "ARG COUNT - %d\n", i);
-               sprintf(rqstr, "%s %s %s %s", W_TYPE, W_FILE1,
-                 W_FILE2, W_USER);
-               logent(rqstr, "REQUESTED");
-               DEBUG(4, "msg - %s\n", msg);
-               DEBUG(4, "W_FILE2 - %s\n", W_FILE2);
-               strcpy(filename, W_FILE2);
-               expfile(filename);
-               if (chkpth("", Rmtname, filename)
-                || chkperm(filename, Loginuser, index(W_OPTNS, 'd'))) {
-                       WMESG(SNDFILE, NO);
-                       logent("DENIED", "PERMISSION");
-                       goto top;
-               }
-               if (isdir(filename)) {
-                       strcat(filename, "/");
-                       strcat(filename, lastpart(W_FILE1));
-               }
-               strcpy(User, W_USER);
-               ASSERT(strlen(User) <= 10, "User - %s\n", User);
-
-               DEBUG(4, "chkpth ok Rmtname - %s\n", Rmtname);
-               sprintf(Dfile, "%s/TM.%05d.%03d", Spool, pnum, tmpnum++);
-               if((fp = fopen(Dfile, "w")) == NULL) {
-                       WMESG(SNDFILE, NO);
-                       logent("CAN'T OPEN", "DENIED");
-                       unlink(Dfile);
-                       goto top;
-               }
-               chmod(Dfile, 0666);
-
-               WMESG(SNDFILE, YES);
-               ret = (*Rddata)(Ifn, fp);
-               fclose(fp);
-               if (ret != 0)
-                       return(FAIL);
-               /* copy to user directory */
-               status = xmv(Dfile, filename);
-               WMESG(RQSTCMPT, status ? NO : YES);
-               logent(status ? "FAILED" : "SUCCEEDED", "COPY");
-               sscanf(W_MODE, "%o", &filemode);
-               DEBUG(4, "mode - %o\n", filemode);
-               if (filemode <= 0)
-                       filemode = 0666;
-               if (status == 0) {
-                       filemode |= 0666;
-                       chmod(filename, filemode | 0666);
-               }
-               goto top;
-
-       case RCVFILE:
-               /*  MASTER section of RCVFILE  */
-
-               DEBUG(4, "%s\n", "RCVFILE:");
-               if (msg[1] == N) {
-                       logent("REQUEST", "DENIED");
-                       ASSERT(role == MASTER,
-                               "role - %d", role);
-                       unlink(Wfile);
-                       fclose(fp);
-                       goto top;
-               }
-
-               if (msg[1] == Y) {
-                       /* receive file */
-                       ASSERT(role == MASTER,
-                               "role - %d", role);
-                       ret = (*Rddata)(Ifn, fp);
-                       fclose(fp);
-                       if (ret != 0)
-                               return(FAIL);
-                       /* copy to user directory */
-                       if (isdir(filename)) {
-                               strcat(filename, "/");
-                               strcat(filename, lastpart(W_FILE1));
-                       }
-                       status = xmv(Dfile, filename);
-                       WMESG(RQSTCMPT, status ? NO : YES);
-                       logent(status ? "FAILED" : "SUCCEEDED", "COPY");
-                       notify(W_OPTNS, W_USER, filename, Rmtname,
-                         status ? "failed" : "succeeded");
-                       sscanf(&msg[2], "%o", &filemode);
-                       DEBUG(4, "mode - %o\n", filemode);
-                       if (filemode <= 0)
-                               filemode = 0666;
-                       if (status == 0) {
-                               unlink(Dfile);
-                               filemode |= 0666;
-                               chmod(filename, filemode | 0666);
-                       }
-                       goto top;
-               }
-
-               /*  SLAVE section of RCVFILE  */
-               ASSERT(role == SLAVE,
-                       "role - %d", role);
-
-               /* request to send file */
-               strcpy(rqstr, msg);
-               logent(rqstr, "REQUESTED");
-
-               /* check permissions */
-               i = getargs(msg, wrkvec);
-               ASSERT(i > 3, "ARG COUNT - %d\n", i);
-               DEBUG(4, "msg - %s\n", msg);
-               DEBUG(4, "W_FILE1 - %s\n", W_FILE1);
-               strcpy(filename, W_FILE1);
-               expfile(filename);
-               if (isdir(filename)) {
-                       strcat(filename, "/");
-                       strcat(filename, lastpart(W_FILE2));
-               }
-               strcpy(User, W_USER);
-               ASSERT(strlen(User) <= 10, "User - %s\n", User);
-               if (chkpth("", Rmtname, filename) != 0) {
-                       WMESG(RCVFILE, NO);
-                       logent("DENIED", "PERMISSION");
-                       goto top;
-               }
-               DEBUG(4, "chkpth ok Rmtname - %s\n", Rmtname);
-
-               if ((fp = fopen(filename, "r")) == NULL) {
-                       WMESG(RCVFILE, NO);
-                       logent("CAN'T OPEN", "DENIED");
-                       goto top;
-               }
-
-               /*  ok to send file */
-               ret = stat(filename, &stbuf);
-               ASSERT(ret != -1, "STAT FAILED %s", filename);
-               sprintf(msg, "%s %o", YES, stbuf.st_mode & 0777);
-               WMESG(RCVFILE, msg);
-               ret = (*Wrdata)(fp, Ofn);
-               fclose(fp);
-               if (ret != 0)
-                       return(FAIL);
-               RMESG(RQSTCMPT, msg);
-               goto process;
-       }
-       return(FAIL);
-}
-
-
-/***
- *     rmesg(c, msg)   read message 'c'
- *     char *msg, c;
- *
- *     return code:  0  |  FAIL
- */
-
-rmesg(c, msg)
-char *msg, c;
-{
-       char str[50];
-
-       DEBUG(4, "rmesg - '%c' ", c);
-       if ((*Rdmsg)(msg, Ifn) != 0) {
-               DEBUG(4, "got %s\n", "FAIL");
-               sprintf(str, "expected '%c' got FAIL", c);
-               logent(str, "BAD READ");
-               return(FAIL);
-       }
-       if (c != '\0' && msg[0] != c) {
-               DEBUG(4, "got %s\n", msg);
-               sprintf(str, "expected '%c' got %.25s", c, msg);
-               logent(str, "BAD READ");
-               return(FAIL);
-       }
-       DEBUG(4, "got %.25s\n", msg);
-       return(0);
-}
-
-
-/***
- *     wmesg(m, s)     write a message (type m)
- *     char *s, m;
- *
- *     return codes: 0 - ok | FAIL - ng
- */
-
-wmesg(m, s)
-char *s, m;
-{
-       DEBUG(4, "wmesg '%c'", m);
-       DEBUG(4, "%.25s\n", s);
-       return((*Wrmsg)(m, s, Ofn));
-}
-
-
-/***
- *     notify(options, user, file, sys, stwork)        mail results of copy
- *     char *options, *user, *file, *sys, *stword);
- *
- *     return codes:  none
- */
-
-notify(options, user, file, sys, stword)
-char *options, *user, *file, *sys, *stword;
-{
-       char str[200];
-       if (index(options, 'm') == NULL)
-               return;
-       sprintf(str, "file %s, system %s, copy %s\n", file, sys, stword);
-       mailst(user, str);
-       return;
-}
-
-
-/***
- *     startup(role)
- *     int role;
- *
- *     startup  -  this routine will converse with the remote
- *     machine, agree upon a protocol (if possible) and start the
- *     protocol.
- *
- *     return codes:
- *             SUCCESS - successful protocol selection
- *             FAIL - can't find common or open failed
- */
-
-startup(role)
-int role;
-{
-       extern (*Rdmsg)(), (*Wrmsg)();
-       extern imsg(), omsg();
-       extern char *blptcl(), fptcl();
-       char msg[BUFSIZ], str[BUFSIZ];
-
-       Rdmsg = imsg;
-       Wrmsg = omsg;
-       if (role == MASTER) {
-               RMESG(SLTPTCL, msg);
-               if ((str[0] = fptcl(&msg[1])) == NULL) {
-                       /* no protocol match */
-                       WMESG(USEPTCL, NO);
-                       return(FAIL);
-               }
-               str[1] = '\0';
-               WMESG(USEPTCL, str);
-               if (stptcl(str) != 0)
-                       return(FAIL);
-               DEBUG(4, "protocol %s\n", str);
-               return(SUCCESS);
-       }
-       else {
-               WMESG(SLTPTCL, blptcl(str));
-               RMESG(USEPTCL, msg);
-               if (msg[1] == N) {
-                       return(FAIL);
-               }
-
-               if (stptcl(&msg[1]) != 0)
-                       return(FAIL);
-               DEBUG(4, "Protocol %s\n", msg);
-               return(SUCCESS);
-       }
-}
-
-
-/*******
- *     char
- *     fptcl(str)
- *     char *str;
- *
- *     fptcl  -  this routine will choose a protocol from
- *     the input string (str) and return the found letter.
- *
- *     return codes:
- *             '\0'  -  no acceptable protocol
- *             any character  -  the chosen protocol
- */
-
-char
-fptcl(str)
-char *str;
-{
-       struct Proto *p;
-       extern char *index();
-
-       for (p = Ptbl; p->P_id != '\0'; p++) {
-               if (index(str, p->P_id) != NULL) {
-                       return(p->P_id);
-               }
-       }
-
-       return('\0');
-}
-
-
-/***
- *     char *
- *     blptcl(str)
- *     char *str;
- *
- *     blptcl  -  this will build a string of the
- *     letters of the available protocols and return
- *     the string (str).
- *
- *     return:
- *             a pointer to string (str)
- */
-
-char *
-blptcl(str)
-char *str;
-{
-       struct Proto *p;
-       char *s;
-
-       for (p = Ptbl, s = str; (*s++ = p->P_id) != '\0'; p++);
-       return(str);
-}
-
-/***
- *     stptcl(c)
- *     char *c;
- *
- *     stptcl  -  this routine will set up the six routines
- *     (Rdmsg, Wrmsg, Rddata, Wrdata, Turnon, Turnoff) for the
- *     desired protocol.
- *
- *     return codes:
- *             SUCCESS - ok
- *             FAIL - no find or failed to open
- *
- */
-
-stptcl(c)
-char *c;
-{
-       struct Proto *p;
-
-       for (p = Ptbl; p->P_id != '\0'; p++) {
-               if (*c == p->P_id) {
-                       /* found protocol - set routines */
-                       Rdmsg = p->P_rdmsg;
-                       Wrmsg = p->P_wrmsg;
-                       Rddata = p->P_rddata;
-                       Wrdata = p->P_wrdata;
-                       Turnon = p->P_turnon;
-                       Turnoff = p->P_turnoff;
-                       if ((*Turnon)() != 0)
-                               return(FAIL);
-                       DEBUG(4, "Proto started %c\n", *c);
-                       return(SUCCESS);
-               }
-       }
-       DEBUG(4, "Proto start-fail %c\n", *c);
-       return(FAIL);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/conn.c b/.ref-Research-V7/usr/src/cmd/uucp/conn.c
deleted file mode 100644 (file)
index 839e871..0000000
+++ /dev/null
@@ -1,728 +0,0 @@
-#define CONN
-#include "uucp.h"
-#include <signal.h>
-#include <sgtty.h>
-#include <setjmp.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <time.h>
-
-
-#define F_NAME 0
-#define F_TIME 1
-#define F_LINE 2
-#define F_SPEED 3
-#define F_PHONE 4
-#define F_LOGIN 5
-
-jmp_buf Sjbuf;
-#define INVOKE(a, r) ret = a; if (ret<0) return(r);
-/*******
- *     conn(system)
- *     char *system;
- *
- *     conn - place a telephone call to system and
- *     login, etc.
- *
- *     return codes:
- *             CF_SYSTEM: don't know system
- *             CF_TIME: wrong time to call
- *             CF_DIAL: call failed
- *             CF_LOGIN: login/password dialog failed
- *
- *             >0  - file no.  -  connect ok
- *
- */
-
-conn(system)
-char *system;
-{
-       int ret, nf;
-       int fn;
-       char *flds[50];
-       DEBUG(4, "gdial %s\n", "called");
-       INVOKE(gdial(), CF_DIAL)
-       DEBUG(4, "finds %s\n", "called");
-       INVOKE(nf = finds(system, flds), nf)
-       DEBUG(4, "getto %s\n", "called");
-       INVOKE(fn = getto(flds), CF_DIAL)
-       DEBUG(4, "login %s\n", "called");
-       INVOKE(login(nf, flds, fn), CF_LOGIN)
-       return(fn);
-}
-
-/***
- *     char *
- *     lastc(s)        return pointer to last character
- *     char *s;
- *
- */
-
-char *
-lastc(s)
-char *s;
-{
-       while (*s != '\0') s++;
-       return(s);
-}
-
-#define MAXDEV 10
-#define MAXDCH MAXDEV*20
-#define MAXCODE 30
-#define MAXCCH MAXCODE*20
-       /* This array tells us about possible acu's, etc. */
-struct Devices {
-       char *D_line;
-       char *D_acu;
-       int D_speed;
-       } Devs [MAXDEV];
-
-char Devbuff[MAXDCH];
-
-struct Codes {
-       char *C_locs;
-       char *C_prefix;
-       } Dialcodes [MAXCODE];
-
-char Codebuff[MAXCCH];
-int Dcfull = 0;
-
-
-/***
- *     gdial()         get device and dial info
- *
- *     return codes:  0  |  FAIL
- */
-
-gdial()
-{
-       char *flds[10], *lt;
-       char *lb = Devbuff;
-       char *lc = Codebuff;
-       FILE *fn;
-       int nr;
-       struct Devices *pd;
-       struct Codes *pc;
-       if (Dcfull) return(0);
-
-       fn = fopen(Devfile, "r");
-       ASSERT(fn != NULL, "CAN'T OPEN %s", Devfile);
-       for (pd = Devs; fgets(lb, 200, fn); pd++) {
-               lt = lastc(lb);
-               nr = getargs(lb, flds);
-               ASSERT(nr == 3, "BAD LINE %s", lb);
-               pd->D_line = flds[0];
-               pd->D_acu = flds[1];
-               pd->D_speed = atoi(flds[2]);
-               lb = lt;
-               ASSERT(lb < Devbuff + MAXDCH, "TOO LONG %s", Devbuff);
-               ASSERT(pd < Devs + MAXDEV, "TOO MANY DEVICES %d", MAXCODE);
-       }
-       pd->D_line = NULL;
-       fclose(fn);
-       ASSERT(pd > Devs, "BAD FILE %s", Devfile);
-       /* Now dialcodes, same way */
-       fn = fopen(Dialfile, "r");
-       ASSERT(fn != NULL, "CAN'T OPEN %s", Dialfile);
-       for (pc = Dialcodes; fgets(lc, 200, fn); pc++) {
-               lt = lastc(lc);
-               nr = getargs(lc, flds);
-               if (nr == 1) flds[nr++] = "";
-               ASSERT(nr == 2, "BAD LINE %s", lc);
-               pc->C_locs = flds[0];
-               pc->C_prefix = flds[1];
-               lc = lt;
-               ASSERT(lc < Codebuff + MAXCCH, "TOO LONG %s", Codebuff);
-               ASSERT(pc < Dialcodes + MAXCODE, "MANY DEVICES %d", MAXCODE);
-       }
-       pc->C_locs = 0;
-       fclose(fn);
-       return(0);
-}
-
-
-/***
- *     ckdev(type, speed, ndev)
- *     char *type, *speed;
- *     int ndev;
- *
- *     ckdev  -  return the device number in table Devs for
- *     a device with proper attributes.
- *
- *     return codes: >= 0 (ok)  |  FAIL
- */
-
-ckdev(type, speed, ndev)
-char *type, *speed;
-int ndev;
-{
-       int sp, acu;
-       struct Devices *pd;
-
-       sp = atoi(speed);
-       acu =(strcmp(type, "ACU") == SAME);
-       for (pd = &Devs[ndev]; pd->D_line != NULL; pd++) {
-               if (sp != pd->D_speed)
-                       continue;
-               if (acu && (strcmp(pd->D_acu, "0") != SAME)
-                   && !mlock(pd->D_line))
-                       return(ndev = pd - Devs);
-               if (!acu && (strcmp(pd->D_line, type) == SAME)
-                   && !mlock(type))
-                       return(ndev = pd - Devs);
-       }
-       return(FAIL);
-}
-
-
-/***
- *     getto(flds)             connect to remote machine
- *     char *flds[];
- *
- *     return codes:
- *             >0  -  file number - ok
- *             FAIL  -  failed
- */
-
-getto(flds)
-char *flds[];
-{
-       DEBUG(F_PHONE, "call: no. %s ", flds[4]);
-       DEBUG(4, "for sys %s ", flds[F_NAME]);
-
-       if (strcmp(flds[F_LINE], "ACU") == SAME)
-               return(call(flds));
-       else
-               return(direct(flds));
-}
-
-/***
- *     call(flds)              call remote machine
- *     char *flds[];
- *
- *     "flds" contains the call information (name, date, type, speed,
- *     phone no. ...
- *     Ndev has the device no.
- *
- *     return codes:
- *             >0  -  file number  -  ok
- *             FAIL  -  failed
- */
-
-call(flds)
-char *flds[];
-{
-       char *pno, pref[20], phone[20];
-       char *s1, *s2;
-       int dcr;
-       struct Codes *pc;
-
-       pno = flds[F_PHONE];
-       s1 = pref; s2 = pno;
-       while (isalpha(*s2))
-               *s1++ = *s2++;
-       *s1 = '\0';
-       for (pc = Dialcodes; pc->C_locs; pc++)
-               if (strcmp(pc->C_locs, pref) == SAME) {
-                       s1 = pc->C_prefix;
-                       break;
-               }
-       sprintf(phone, "%s%s", s1, s2);
-       DEBUG(4, "Dial %s\n", phone);
-       dcr = dialup(phone, flds);
-       DEBUG(4, "dcr returned as %d\n", dcr);
-       if (dcr == FAIL)
-               return(FAIL);
-       return(dcr);
-
-}
-
-       /*  file descriptor for call unit  */
-int Dnf = 0;
-
-/***
- *     dialup(ph, flds)        dial remote machine
- *     char *ph;
- *     char *flds[];
- *
- *     return codes:
- *             file descriptor  -  succeeded
- *             FAIL  -  failed
- */
-
-dialup(ph, flds)
-char *ph;
-char *flds[];
-{
-       char dcname[20], dnname[20], phone[20];
-       struct Devices *pd;
-       int nw, lt, pid, dcf, ndev;
-       extern int Error;
-       extern alarmtr();
-
-       for (ndev = 0;;ndev++) {
-               ndev = ckdev(flds[F_LINE], flds[F_SPEED], ndev);
-               if (ndev < 0) {
-                       logent("AVAILABLE DEVICE", "NO");
-                       DEBUG(4, "NO AVAILABLE DEVICE %s\n", "");
-                       return(FAIL);
-               }
-               pd = &Devs[ndev];
-               sprintf(dnname, "/dev/%s", pd->D_acu);
-               /*  open call unit  */
-               Dnf = open(dnname, 1);
-               if (Dnf >= 0)
-                       break;
-               delock(pd->D_line);
-       }
-       sprintf(dcname, "/dev/%s", pd->D_line);
-       sprintf(phone, "%s%s", ph, ACULAST);
-       DEBUG(4, "dc - %s, ", dcname);
-       DEBUG(4, "acu - %s\n", dnname);
-       if (setjmp(Sjbuf)) {
-               DEBUG(1, "DN write %s\n", "timeout");
-               logent("DIALUP DN write", "TIMEOUT");
-               kill(pid, 9);
-               close(Dnf);
-               return(FAIL);
-       }
-       signal(SIGALRM, alarmtr);
-       alarm(30);
-       if ((pid = fork()) == 0) {
-               sleep(2);
-               fclose(stdin);
-               fclose(stdout);
-               nw = write(Dnf, phone, lt = strlen(phone));
-               if (nw != lt) {
-                       DEBUG(1, "ACU write %s\n", "error");
-                       logent("DIALUP ACU write", "FAILED");
-                       exit(1);
-               }
-               DEBUG(4, "ACU write ok%s\n", "");
-               exit(0);
-       }
-       /*  open line - will return on carrier */
-       dcf = open(dcname, 2);
-       DEBUG(4, "dcf is %d\n", dcf);
-       if (dcf < 0) {
-               DEBUG(1, "Line open %s\n", "failed");
-               logent("DIALUP LINE open", "FAILED");
-               alarm(0);
-               return(FAIL);
-       }
-       ioctl(dcf, TIOCHPCL, 0);
-       nw = wait(&lt);
-       alarm(0);
-       fflush(stdout);
-       fixline(dcf, pd->D_speed);
-       DEBUG(4, "Forked %d ", pid);
-       DEBUG(4, "Wait got %d ", nw);
-       DEBUG(4, "Status %o\n", lt);
-       if (lt != 0) {
-               close(dcf);
-               return(FAIL);
-       }
-       return(dcf);
-}
-
-
-/***
- *     clsacu()        close call unit
- *
- *     return codes:  none
- */
-
-clsacu()
-{
-       if (Dnf > 0) {
-               close(Dnf);
-               Dnf = 0;
-       }
-       return;
-}
-
-
-/***
- *     direct(flds)    connect to hardware line
- *     char *flds[];
- *
- *     return codes:
- *             >0  -  file number  -  ok
- *             FAIL  -  failed
- */
-
-direct(flds)
-char *flds[];
-{
-       int dcr, ndev;
-       char dcname[20];
-
-       ndev = 0;
-       if ((ndev = ckdev(flds[F_LINE], flds[F_SPEED], ndev)) < 0) {
-               logent("DEVICE", "NOT AVAILABLE");
-               return(FAIL);
-       }
-       sprintf(dcname, "/dev/%s", Devs[ndev].D_line);
-       signal(SIGALRM, alarmtr);
-       alarm(10);
-       if (setjmp(Sjbuf))
-               return(FAIL);
-       dcr = open(dcname, 2); /* read/write */
-       alarm(0);
-       if (dcr < 0)
-               return(FAIL);
-       fflush(stdout);
-       fixline(dcr, Devs[ndev].D_speed);
-       return(dcr);
-}
-
-
-
-#define MAXC 300
-
-/***
- *     finds(sysnam, flds)     set system attribute vector
- *     char *sysnam, *flds[];
- *
- *     return codes:
- *             >0  -  number of arguments in vector - succeeded
- *             CF_SYSTEM  -  system name not found
- *             CF_TIME  -  wrong time to call
- */
-
-finds(sysnam, flds)
-char *sysnam, *flds[];
-{
-       FILE *fsys;
-       static char info[MAXC];
-       char **fnp;
-       int na;
-       int fnd = 0;
-
-       for (fnp = Sysfiles; *fnp != NULL && !fnd; fnp++) {
-               fsys = fopen(*fnp, "r");
-               if (fsys == NULL)
-                       continue;
-               while (!fnd && (fgets(info, MAXC, fsys) != NULL)) {
-                       na = getargs(info, flds);
-                       if (prefix(sysnam, flds[F_NAME]))
-                               fnd = 1;
-               }
-               fclose(fsys);
-       }
-       if (fnd == 0)
-               return(CF_SYSTEM);
-       /* format of fields
-        *      0 name;
-        *      1 time
-        *      2 acu/hardwired
-        *      3 speed
-        *      etc
-        */
-       if (ifdate(flds[F_TIME]) == 0) {
-               DEBUG(1, "Wrong time to call %s\n", sysnam);
-               logent(sysnam, "WRONG TIME TO CALL");
-               return(CF_TIME);
-       }
-       return(na);
-}
-
-
-/***
- *     login(nf, flds, dcr)            do log conversation
- *     char *flds[];
- *     int nf;
- *
- *     return codes:  0  |  FAIL
- */
-
-login(nf, flds, fn)
-char *flds[];
-int nf, fn;
-{
-       char *want, *altern;
-       extern char *index();
-       int k, ok;
-
-       ASSERT(nf > 4, "TOO FEW LOG FIELDS %d", nf);
-       for (k = F_LOGIN; k < nf; k += 2) {
-               want = flds[k];
-               ok = FAIL;
-               while (ok != 0) {
-                       altern = index(want, '-');
-                       if (altern != NULL)
-                               *altern++ = '\0';
-                       DEBUG(4, "wanted %s ", want);
-                       ok = expect(want, fn);
-                       DEBUG(4, "got %s\n", ok ? "?" : "that");
-                       if (ok == 0)
-                               break;
-                       if (altern == NULL) {
-                               logent("LOGIN", "FAILED");
-                               return(FAIL);
-                       }
-                       want = index(altern, '-');
-                       if (want != NULL)
-                               *want++ = '\0';
-                       sendthem(altern, fn);
-               }
-               sleep(2);
-               sendthem(flds[k+1], fn);
-       }
-       return(0);
-}
-
-
-struct sg_spds {int sp_val, sp_name;} spds[] = {
-       { 300,  B300},
-       {1200, B1200},
-       {4800, B4800},
-       {9600, B9600},
-       {0, 0} };
-
-/***
- *     fixline(tty, spwant)    set speed/echo/mode...
- *     int tty, spwant;
- *
- *     return codes:  none
- */
-
-fixline(tty, spwant)
-int tty, spwant;
-{
-       struct sgttyb ttbuf;
-       struct sg_spds *ps;
-       int speed = -1;
-       int ret;
-
-       for (ps = spds; ps->sp_val; ps++)
-               if (ps->sp_val == spwant)
-                       speed = ps->sp_name;
-       ASSERT(speed >= 0, "BAD SPEED %d", speed);
-       ioctl(tty, TIOCGETP, &ttbuf);
-       ttbuf.sg_flags |=(ANYP|RAW);
-       ttbuf.sg_flags &= ~(ECHO|ALLDELAY);
-       ttbuf.sg_ispeed = ttbuf.sg_ospeed = speed;
-       DEBUG(4, "Speed: want %d ", spwant);
-       DEBUG(4, "use %o ", speed);
-       DEBUG(4, "ps %d\n", ps-spds);
-       ret = ioctl(tty, TIOCSETP, &ttbuf);
-       ASSERT(ret >= 0, "RETURN FROM STTY %d", ret);
-       ioctl(tty, TIOCHPCL, 0);
-       ioctl(tty, TIOCEXCL, 0);
-       return;
-}
-
-
-#define MR 300
-
-int Error = 0;
-
-/***
- *     expect(str, fn) look for expected string
- *     char *str;
- *
- *     return codes:
- *             0  -  found
- *             FAIL  -  lost line or too many characters read
- *             some character  -  timed out
- */
-
-expect(str, fn)
-char *str;
-int fn;
-{
-       static char rdvec[MR];
-       extern alarmtr();
-       char *rp = rdvec;
-       int nextch = 0, kr;
-
-       if (strcmp(str, "\"\"") == SAME)
-               return(0);
-       *rp = 0;
-       if (setjmp(Sjbuf)) {
-               return(FAIL);
-       }
-       signal(SIGALRM, alarmtr);
-       while (notin(str, rdvec)) {
-               alarm(MAXCHARTIME);
-               kr = read(fn, &nextch, 1);
-               if (kr <= 0) {
-                       DEBUG(4, "kr - %d\n", kr);
-                       alarm(0);
-                       DEBUG(4, "lost line kr - %d, ", kr);
-                       DEBUG(4, "fn - %d\n", fn);
-                       logent("LOGIN", "LOST LINE");
-                       return(FAIL);
-               }
-               {
-               int c;
-               c = nextch & 0177;
-               DEBUG(4, "%c", c > 040 ? c : '_');
-               }
-               if ((*rp = nextch & 0177) != '\0')
-                       rp++;
-               *rp = '\0';
-               if (rp >= rdvec + MR)
-                       return(FAIL);
-       }
-       alarm(0);
-       return(0);
-}
-
-
-/***
- *     alarmtr()  -  catch alarm routine for "expect".
- */
-
-alarmtr()
-{
-       longjmp(Sjbuf, 1);
-}
-
-
-/***
- *     sendthem(str, fn)       send line of login sequence
- *     char *str;
- *
- *     return codes:  none
- */
-
-sendthem(str, fn)
-char *str;
-int fn;
-{
-       int nw, ns;
-       int nulls;
-
-       if (prefix("BREAK", str)) {
-               sscanf(&str[5], "%1d", &nulls);
-               if (nulls <= 0 || nulls > 10)
-                       nulls = 3;
-               /* send break */
-               DEBUG(5, "%s,", str);
-               DEBUG(5, "%d\n", nulls);
-               genbrk(fn, Bspeed, nulls);
-               return;
-       }
-
-       if (strcmp(str, "EOT") == SAME) {
-               write(fn, EOTMSG, strlen(EOTMSG));
-               return;
-       }
-       if (strcmp(str, "") != SAME) {
-               nw = write(fn, str, ns = strlen(str));
-               ASSERT(nw == ns, "BAD WRITE $s", str);
-       }
-       write(fn, "\n", 1);
-       return;
-}
-
-
-/***
- *     genbrk(fn)      send equivalent to break
- *
- *     return codes;  none
- */
-
-genbrk(fn, bspeed, bnulls)
-int fn, bspeed, bnulls;
-{
-       struct sgttyb ttbuf;
-       int ret, sospeed;
-
-       ret = ioctl(fn, TIOCGETP, &ttbuf);
-       DEBUG(5, "ioctl ret %d\n", ret);
-       sospeed = ttbuf.sg_ospeed;
-       ttbuf.sg_ospeed = bspeed;
-       ret = ioctl(fn, TIOCSETP, &ttbuf);
-       DEBUG(5, "ioctl ret %d\n", ret);
-       ret = write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls);
-       ASSERT(ret > 0, "BAD WRITE genbrk %d", ret);
-       ttbuf.sg_ospeed = sospeed;
-       ret = ioctl(fn, TIOCSETP, &ttbuf);
-       ret = write(fn, "@", 1);
-       ASSERT(ret > 0, "BAD WRITE genbrk %d", ret);
-       DEBUG(4, "sent BREAK nulls - %d\n", bnulls);
-       return;
-}
-
-
-/***
- *     notin(sh, lg)   check for occurrence of substring "sh"
- *     char *sh, *lg;
- *
- *     return codes:
- *             0  -  found the string
- *             1  -  not in the string
- */
-
-notin(sh, lg)
-char *sh, *lg;
-{
-       while (*lg != '\0') {
-               if (prefix(sh, lg))
-                       return(0);
-               else
-                       lg++;
-       }
-       return(1);
-}
-
-
-/*******
- *     ifdate(s)
- *     char *s;
- *
- *     ifdate  -  this routine will check a string (s)
- *     like "MoTu0800-1730" to see if the present
- *     time is within the given limits.
- *
- *     String alternatives:
- *             Wk - Mo thru Fr
- *             zero or one time means all day
- *             Any - any day
- *
- *     return codes:
- *             0  -  not within limits
- *             1  -  within limits
- */
-
-ifdate(s)
-char *s;
-{
-       static char *days[]={
-               "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", 0
-       };
-       long clock;
-       int i, tl, th, tn, dayok=0;
-       struct tm *localtime();
-       struct tm *tp;
-
-       time(&clock);
-       tp = localtime(&clock);
-       while (isalpha(*s)) {
-               for (i = 0; days[i]; i++) {
-                       if (prefix(days[i], s))
-                               if (tp->tm_wday == i)
-                                       dayok = 1;
-               }
-
-               if (prefix("Wk", s))
-                       if (tp->tm_wday >= 1 && tp->tm_wday <= 5)
-                               dayok = 1;
-               if (prefix("Any", s))
-                       dayok = 1;
-               s++;
-       }
-
-       if (dayok == 0)
-               return(0);
-       i = sscanf(s, "%d-%d", &tl, &th);
-       tn = tp->tm_hour * 100 + tp->tm_min;
-       if (i < 2)
-               return(1);
-       if (tn >= tl && tn <= th)
-               return(1);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/cpmv.c b/.ref-Research-V7/usr/src/cmd/uucp/cpmv.c
deleted file mode 100644 (file)
index 1c36dd5..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "uucp.h"
-
-/***
- *     xcp(f1, f2)     copy f1 to f2
- *     char *f1, *f2;
- *
- *     return - 0 ok  |  FAIL failed
- */
-
-xcp(f1, f2)
-char *f1, *f2;
-{
-       char buf[BUFSIZ];
-       int len;
-       FILE *fp1, *fp2;
-
-       if ((fp1 = fopen(f1, "r")) == NULL)
-               return(FAIL);
-       if ((fp2 = fopen(f2, "w")) == NULL) {
-               fclose(fp1);
-               return(FAIL);
-       }
-       while((len = fread(buf, sizeof (char), BUFSIZ, fp1)) > 0)
-               fwrite(buf, sizeof (char), len, fp2);
-       fclose(fp1);
-       fclose(fp2);
-       chmod(f2, 0666);
-       return(0);
-}
-
-
-/*
- *     xmv(f1, f2)     move f1 to f2
- *     char * f1, *f2;
- *
- *     return  0 ok  |  FAIL failed
- */
-
-xmv(f1, f2)
-char *f1, *f2;
-{
-       int ret;
-
-       if (link(f1, f2) < 0) {
-               /*  copy file  */
-               ret = xcp(f1, f2);
-               if (ret == 0)
-                       unlink(f1);
-               return(ret);
-       }
-       unlink(f1);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/expfile.c b/.ref-Research-V7/usr/src/cmd/uucp/expfile.c
deleted file mode 100644 (file)
index abb001f..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-/*******
- *     expfile(file)   expand file name
- *     char *file;
- *
- *     return codes:  none
- */
-
-expfile(file)
-char *file;
-{
-       char *fpart;
-       char user[20], *up;
-       char full[100];
-       int uid;
-
-       switch(file[0]) {
-       case '/':
-               return;
-       case '~':
-               for (fpart = file + 1, up = user; *fpart != '\0'
-                       && *fpart != '/'; fpart++)
-                               *up++ = *fpart;
-               *up = '\0';
-               if (gninfo(user, &uid, full) != 0) {
-                       strcpy(full, Spool);
-               }
-       
-               strcat(full, fpart);
-               strcpy(file, full);
-               return;
-       default:
-               strcpy(full, Wrkdir);
-               strcat(full, "/");
-               strcat(full, file);
-               strcpy(file, full);
-               return;
-       }
-}
-
-
-/***
- *     isdir(name)     check if directory name
- *     char *name;
- *
- *     return codes:  0 - not directory  |  1 - is directory
- */
-
-isdir(name)
-char *name;
-{
-       int ret;
-       struct stat s;
-
-       ret = stat(name, &s);
-       if (ret < 0)
-               return(0);
-       if ((s.st_mode & S_IFMT) == S_IFDIR)
-               return(1);
-       return(0);
-}
-
-
-/***
- *     mkdirs(name)    make all necessary directories
- *     char *name;
- *
- *     return 0  |  FAIL
- */
-
-mkdirs(name)
-char *name;
-{
-       int ret;
-       char cmd[100], dir[100], *p;
-
-       for (p = dir + 1;; p++) {
-               strcpy(dir, name);
-               if ((p = index(p, '/')) == NULL)
-                       return(0);
-               *p = '\0';
-               if (isdir(dir))
-                       continue;
-               sprintf(cmd, "mkdir %s", dir);
-               DEBUG(4, "mkdir - %s\n", dir);
-               ret = shio(cmd, NULL, NULL, User);
-               if (ret != 0)
-                       return(FAIL);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/gename.c b/.ref-Research-V7/usr/src/cmd/uucp/gename.c
deleted file mode 100644 (file)
index 26bd1a4..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#include "uucp.h"
-
-
-/*******
- *     gename(pre, sys, grade, file)   generate file name
- *     char grade, *sys, pre, *file;
- *
- *     return codes:  none
- */
-
-gename(pre, sys, grade, file)
-char pre, *sys, grade, *file;
-{
-       char sqnum[5];
-
-       getseq(sqnum);
-       sprintf(file, "%c.%.7s%c%.4s", pre, sys, grade, sqnum);
-       DEBUG(4, "file - %s\n", file);
-       return;
-}
-
-
-#define SLOCKTIME 10L
-#define SLOCKTRIES 5
-#define SEQLEN 4
-
-/*******
- *     getseq(snum)    get next sequence number
- *     char *snum;
- *
- *     return codes:  none
- */
-
-getseq(snum)
-char *snum;
-{
-       FILE *fp;
-       int n;
-
-       for (n = 0; n < SLOCKTRIES; n++) {
-               if (!ulockf( SEQLOCK, SLOCKTIME))
-                       break;
-               sleep(5);
-       }
-
-       ASSERT(n < SLOCKTRIES, "CAN NOT GET %s", SEQLOCK);
-
-       if ((fp = fopen(SEQFILE, "r")) != NULL) {
-               /* read sequence number file */
-               fscanf(fp, "%4d", &n);
-               fp = freopen(SEQFILE, "w", fp);
-               ASSERT(fp != NULL, "CAN NOT OPEN %s", SEQFILE);
-               chmod(SEQFILE, 0666);
-       }
-       else {
-               /* can not read file - create a new one */
-               if ((fp = fopen(SEQFILE, "w")) == NULL)
-                       /* can not write new seqeunce file */
-                       return(FAIL);
-               chmod(SEQFILE, 0666);
-               n = 0;
-       }
-
-       fprintf(fp, "%s", sprintf(snum, "%04d", ++n));
-       fclose(fp);
-       rmlock(SEQLOCK);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/getargs.c b/.ref-Research-V7/usr/src/cmd/uucp/getargs.c
deleted file mode 100644 (file)
index 2f6d330..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <stdio.h>
-
-
-/*******
- *     getargs(s, arps)
- *     char *s, *arps[];
- *
- *     getargs  -  this routine will generate a vector of
- *     pointers (arps) to the substrings in string "s".
- *     Each substring is separated by blanks and/or tabs.
- *
- *     return - the number of subfields.
- */
-
-getargs(s, arps)
-char *s, *arps[];
-{
-       int i;
-
-       i = 0;
-       while (1) {
-               arps[i] = NULL;
-               while (*s == ' ' || *s == '\t')
-                       *s++ = '\0';
-               if (*s == '\n')
-                       *s = '\0';
-               if (*s == '\0')
-                       break;
-               arps[i++] = s++;
-               while (*s != '\0' && *s != ' '
-                       && *s != '\t' && *s != '\n')
-                               s++;
-       }
-       return(i);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/getprm.c b/.ref-Research-V7/usr/src/cmd/uucp/getprm.c
deleted file mode 100644 (file)
index 758ee87..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <stdio.h>
-
-#define LQUOTE '('
-#define RQUOTE ')'
-#define NOSYSPART      0
-#define HASSYSPART     1
-
-/*******
- *     char *
- *     getprm(s, prm)  get next parameter from s
- *     char *s, *prm;
- *
- *     return - pointer to next character in s
- */
-
-char *
-getprm(s, prm)
-char *s, *prm;
-{
-       char *c;
-
-       while (*s == ' ' || *s == '\t' || *s == '\n')
-               s++;
-
-       *prm = '\0';
-       if (*s == '\0')
-               return(NULL);
-
-       if (*s == '>' || *s == '<' || *s == '|'
-       || *s == ';') {
-               *prm++ = *s++;
-               *prm = '\0';
-               return(s);
-       }
-
-       /* look for quoted argument */
-       if (*s == LQUOTE) {
-               if ((c = index(s + 1, RQUOTE)) != NULL) {
-                       c++;
-                       while (c != s)
-                               *prm++ = *s++;
-                       *prm = '\0';
-                       return(s);
-               }
-       }
-
-       while (*s != ' ' && *s != '\t' && *s != '<'
-       && *s != '>' && *s != '|' && *s != '\0'
-       && *s != ';' && *s != '\n')
-               *prm++ = *s++;
-       *prm = '\0';
-
-       return(s);
-}
-
-/***
- *     split(name, sys, rest)  split into system and file part
- *     char *name, *sys, *rest;
-
- *
- *     return codes:
- *             NOSYSPART
- *             HASSYSPART
- */
-
-split(name, sys, rest)
-char *name, *sys, *rest;
-{
-       char *c;
-       int i;
-
-       if (*name == LQUOTE) {
-               if ((c = index(name + 1, RQUOTE)) != NULL) {
-               /* strip off quotes */
-                       name++;
-                       while (c != name)
-                               *rest++ = *name++;
-                       *rest = '\0';
-                       *sys = '\0';
-                       return(NOSYSPART);
-               }
-       }
-
-       if ((c = index(name, '!')) == NULL) {
-               strcpy(rest, name);
-               *sys = '\0';
-               return(NOSYSPART);
-       }
-
-       *c = '\0';
-       for (i = 0; i < 7; i++)
-               if ((*sys++ = *name++) == '\0')
-                       break;
-
-       strcpy(rest, ++c);
-       return(HASSYSPART);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/getpwinfo.c b/.ref-Research-V7/usr/src/cmd/uucp/getpwinfo.c
deleted file mode 100644 (file)
index 843a930..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "uucp.h"
-#include <pwd.h>
-
-
-/*******
- *     guinfo(uid, name, path) get passwd file info for uid
- *     int uid;
- *     char *path, *name;
- *
- *     return codes:  0  |  FAIL
- */
-
-guinfo(uid, name, path)
-int uid;
-char *path, *name;
-{
-       struct passwd *pwd;
-       struct passwd *getpwuid();
-
-       if ((pwd = getpwuid(uid)) == NULL) {
-               /* can not find uid in passwd file */
-               *path = '\0';
-               return(FAIL);
-       }
-
-       strcpy(path, pwd->pw_dir);
-       strcpy(name, pwd->pw_name);
-       return(0);
-}
-
-
-/***
- *     gninfo(name, uid, path) get passwd file info for name
- *     char *path, *name;
- *     int *uid;
- *
- *     return codes:  0  |  FAIL
- */
-
-gninfo(name, uid, path)
-char *path, *name;
-int *uid;
-{
-       struct passwd *pwd;
-       struct passwd *getpwnam();
-
-       if ((pwd = getpwnam(name)) == NULL) {
-               /* can not find name in passwd file */
-               *path = '\0';
-               return(FAIL);
-       }
-
-       strcpy(path, pwd->pw_dir);
-       *uid = pwd->pw_uid;
-       return(0);
-}
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/gio.c b/.ref-Research-V7/usr/src/cmd/uucp/gio.c
deleted file mode 100644 (file)
index c4bc693..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-#define USER 1
-#include <sys/pk.p>
-#include <sys/param.h>
-#include <sys/pk.h>
-#include <sys/buf.h>
-#include <setjmp.h>
-#include "uucp.h"
-
-
-jmp_buf Failbuf;
-
-struct pack *Pk;
-
-pkfail()
-{
-       longjmp(Failbuf, 1);
-}
-
-gturnon()
-{
-       int ret;
-       struct pack *pkopen();
-       if (setjmp(Failbuf))
-               return(FAIL);
-       if (Pkdrvon) {
-               ret = pkon(Ofn, PACKSIZE);
-               DEBUG(4, "pkon - %d ", ret);
-               DEBUG(4, "Ofn - %d\n", Ofn);
-               if (ret <= 0)
-                       return(FAIL);
-       }
-       else {
-               if (Debug > 4)
-                       pkdebug = 1;
-               Pk = pkopen(Ifn, Ofn);
-               if ((int) Pk == NULL)
-                       return(FAIL);
-       }
-       return(0);
-}
-
-
-gturnoff()
-{
-       if(setjmp(Failbuf))
-               return(FAIL);
-       if (Pkdrvon)
-               pkoff(Ofn);
-       else
-               pkclose(Pk);
-       return(0);
-}
-
-
-gwrmsg(type, str, fn)
-char type, *str;
-int fn;
-{
-       char bufr[BUFSIZ], *s;
-       int len, i, ret;
-
-       if(setjmp(Failbuf))
-               return(FAIL);
-       bufr[0] = type;
-       s = &bufr[1];
-       while (*str)
-               *s++ = *str++;
-       *s = '\0';
-       if (*(--s) == '\n')
-               *s = '\0';
-       len = strlen(bufr) + 1;
-       if ((i = len % PACKSIZE)) {
-               len = len + PACKSIZE - i;
-               bufr[len - 1] = '\0';
-       }
-       ret = gwrblk(bufr, len, fn);
-       return(0);
-}
-
-
-grdmsg(str, fn)
-char *str;
-int fn;
-{
-       unsigned len;
-
-       if(setjmp(Failbuf))
-               return(FAIL);
-       for (;;) {
-               if (Pkdrvon)
-                       len = read(fn, str, PACKSIZE);
-               else
-                       len = pkread(Pk, str, PACKSIZE);
-               str += len;
-               if (*(str - 1) == '\0')
-                       break;
-       }
-       return(0);
-}
-
-
-gwrdata(fp1, fn)
-FILE *fp1;
-int fn;
-{
-       char bufr[BUFSIZ];
-       int len;
-       int ret;
-       time_t t1, t2;
-       long bytes;
-       char text[BUFSIZ];
-
-       if(setjmp(Failbuf))
-               return(FAIL);
-       bytes = 0L;
-       time(&t1);
-       while ((len = fread(bufr, sizeof (char), BUFSIZ, fp1)) > 0) {
-               bytes += len;
-               ret = gwrblk(bufr, len, fn);
-               if (ret != len) {
-                       return(FAIL);
-               }
-               if (len != BUFSIZ)
-                       break;
-       }
-       ret = gwrblk(bufr, 0, fn);
-       time(&t2);
-       sprintf(text, "sent data %D bytes %D secs", bytes, t2 - t1);
-       DEBUG(1, "%s\n", text);
-       syslog(text);
-       sysacct(bytes, t2 - t1);
-       return(0);
-}
-
-
-grddata(fn, fp2)
-FILE *fp2;
-int fn;
-{
-       int len;
-       char bufr[BUFSIZ];
-       time_t t1, t2;
-       long bytes;
-       char text[BUFSIZ];
-
-       if(setjmp(Failbuf))
-               return(FAIL);
-       bytes = 0L;
-       time(&t1);
-       for (;;) {
-               len = grdblk(bufr, BUFSIZ, fn);
-               if (len < 0) {
-                       return(FAIL);
-               }
-               bytes += len;
-               fwrite(bufr, sizeof (char), len, fp2);
-               if (len < BUFSIZ)
-                       break;
-       }
-       time(&t2);
-       sprintf(text, "received data %D bytes %D secs", bytes, t2 - t1);
-       DEBUG(1, "%s\n", text);
-       syslog(text);
-       sysacct(bytes, t2 - t1);
-       return(0);
-}
-
-
-grdblk(blk, len,  fn)
-int fn, len;
-char *blk;
-{
-       int i, ret;
-
-       for (i = 0; i < len; i += ret) {
-               if (Pkdrvon)
-                       ret = read(fn, blk, len - i);
-               else
-                       ret = pkread(Pk, blk, len - i);
-               if (ret < 0)
-                       return(FAIL);
-               blk += ret;
-               if (ret == 0)
-                       return(i);
-       }
-       return(i);
-}
-
-
-gwrblk(blk, len, fn)
-char *blk;
-unsigned len;
-int fn;
-{
-       int ret;
-
-       if (Pkdrvon)
-               ret = write(fn, blk, len);
-       else
-               ret = pkwrite(Pk, blk, len);
-       return(ret);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/gnamef.c b/.ref-Research-V7/usr/src/cmd/uucp/gnamef.c
deleted file mode 100644 (file)
index 36a2463..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <sys/dir.h>
-
-
-/*******
- *     gnamef(p, filename)     get next file name from directory
- *     FILE *p;
- *     char *filename;
- *
- *     return codes:
- *             0  -  end of directory read
- *             1  -  returned name
- */
-
-
-gnamef(p, filename)
-FILE *p;
-char *filename;
-{
-       static struct direct dentry;
-       int i;
-       char *s;
-
-       while (1) {
-               if (fread(&dentry,  sizeof(dentry), 1, p) != 1)
-                       return(0);
-               if (dentry.d_ino != 0)
-                       break;
-       }
-
-       for (i = 0, s = dentry.d_name; i <= DIRSIZ; i++)
-               if ((filename[i] = *s++) == '\0')
-                       break;
-       filename[NAMESIZE] = '\0';
-       return(1);
-}
-
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/gnsys.c b/.ref-Research-V7/usr/src/cmd/uucp/gnsys.c
deleted file mode 100644 (file)
index 7167cfb..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#include "uucp.h"
-
-
-#define LSIZE 30       /* number of systems to store */
-#define WSUFSIZE 6     /* work file name suffix size */
-
-/*******
- *     gnsys(sname, dir, pre)
- *     char *sname, *dir, pre;
- *
- *     gnsys  -  this routine will return the next
- *     system name which has work to be done.
- *     "pre" is the prefix for work files.
- *     "dir" is the directory to search.
- *     "sname" is a string of size DIRSIZ - WSUFSIZE.
- *
- *     return codes:
- *             0  -  no more names
- *             1  -  name returned in sname
- *             FAIL  -  bad directory
- */
-
-gnsys(sname, dir, pre)
-char *sname, *dir, pre;
-{
-       char *s, *p1, *p2;
-       char px[3];
-       static char *list[LSIZE];
-       static int nitem=0, n=0;
-       char sysname[NAMESIZE], filename[NAMESIZE];
-       FILE *fp;
-
-       px[0] = pre;
-       px[1] = '.';
-       px[2] = '\0';
-       if (nitem == 0) {
-               /* get list of systems with work */
-               int i;
-               fp = fopen(dir, "r");
-               ASSERT(fp != NULL, "BAD DIRECTRY %s\n", dir);
-               for (i = 0; i < LSIZE; i++)
-                       list[i] = NULL;
-               while (gnamef(fp, filename) != 0) {
-                       if (!prefix(px, filename))
-                               continue;
-                       p2 = filename + strlen(filename)
-                               - WSUFSIZE;
-                       p1 = filename + strlen(px);
-                       for(s = sysname; p1 <= p2; p1++)
-                               *s++ = *p1;
-                       *s = '\0';
-                       if (sysname[0] == '\0')
-                               continue;
-                       if (callok(sysname) == 0)
-                               nitem = srchst(sysname, list, nitem);
-                       if (LSIZE <= nitem) break;
-               }
-
-               fclose(fp);
-       }
-
-       if (nitem == 0)
-               return(0);
-       if (nitem <= n ) {
-               for (n = 0; n < nitem; n++)
-                       if (list[n] != NULL)
-                               free(list[n]);
-               nitem = n = 0;
-               return(0);
-       }
-
-       strcpy(sname, list[n++]);
-       return(1);
-}
-
-/***
- *     srchst(name, list, n)
- *     char *name, **list;
- *     int n;
- *
- *     srchst  -  this routine will do a linear search
- *     of list (list) to find name (name).
- *     If the name is not found, it is added to the
- *     list.
- *     The number of items in the list (n) is
- *     returned (incremented if a name is added).
- *
- *     return codes:
- *             n - the number of items in the list
- */
-
-srchst(name, list, n)
-char *name, **list;
-int n;
-{
-       int i;
-       char *p;
-       extern char *calloc();
-
-       for (i = 0; i < n; i++)
-               if (strcmp(name, list[i]) == 0)
-                       break;
-       if (i >= n) {
-               if ((p = calloc(strlen(name) + 1, sizeof (char)))
-                       == NULL)
-                       return(n);
-               strcpy(p, name);
-               list[n++] = p;
-       }
-       return(n);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/gnxseq.c b/.ref-Research-V7/usr/src/cmd/uucp/gnxseq.c
deleted file mode 100644 (file)
index 6f18b2c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <time.h>
-
-
-
-/*******
- *     gnxseq(rmtname)         get next conversation sequence number
- *     char *rmtname;
- *
- *     return - 0 no entry | >0 sequence number
- */
-
-gnxseq(rmtname)
-char *rmtname;
-{
-       int count = 0, ct, ret;
-       struct tm *tp;
-       extern struct tm *localtime();
-       time_t clock;
-       FILE *fp0, *fp1;
-       char buf[BUFSIZ], name[NAMESIZE];
-
-       if (ulockf(SQLOCK, SQTIME) != 0)
-               return(0);
-       if ((fp0 = fopen(SQFILE, "r")) == NULL)
-               return(0);
-       if ((fp1 = fopen(SQTMP, "w")) == NULL) {
-               fclose(fp0);
-               return(0);
-       }
-       chmod(SQTMP, 0400);
-
-       while (fgets(buf, BUFSIZ, fp0) != NULL) {
-               ret = sscanf(buf, "%s%d", name, &ct);
-               if (ret < 2)
-                       ct = 0;
-               name[7] = '\0';
-               if (ct > 9998)
-                       ct = 0;
-               if (strcmp(rmtname, name) != SAME) {
-                       fputs(buf, fp1);
-                       continue;
-               }
-
-               /*  found name  */
-               count = ++ct;
-               time(&clock);
-               tp = localtime(&clock);
-               fprintf(fp1, "%s %d %d/%d-%d:%d\n", name, ct,
-                 tp->tm_mon + 1, tp->tm_mday, tp->tm_hour,
-                 tp->tm_min);
-               while (fgets(buf, BUFSIZ, fp0) != NULL)
-                       fputs(buf, fp1);
-       }
-       fclose(fp0);
-       fclose(fp1);
-       if (count == 0) {
-               rmlock(SQLOCK);
-               unlink(SQTMP);
-       }
-       return(count);
-}
-
-
-/***
- *     cmtseq()        commit sequence update
- *
- *     return  0  ok | other - link failed
- */
-
-cmtseq()
-{
-       int ret;
-
-       if ((ret = access(SQTMP, 0400)) != 0) {
-               rmlock(SQLOCK);
-               return(0);
-       }
-       unlink(SQFILE);
-       ret = link(SQTMP, SQFILE);
-       unlink(SQTMP);
-       rmlock(SQLOCK);
-       return(ret);
-}
-
-/***
- *     ulkseq()        unlock sequence file
- */
-
-ulkseq()
-{
-       unlink(SQTMP);
-       rmlock(SQLOCK);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/gwd.c b/.ref-Research-V7/usr/src/cmd/uucp/gwd.c
deleted file mode 100644 (file)
index 49adf27..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "uucp.h"
-
-/*******
- *     gwd(wkdir)      get working directory
- *
- *     return codes  0 | FAIL
- */
-
-gwd(wkdir)
-char *wkdir;
-{
-       FILE *fp;
-       extern FILE *popen(), *pclose();
-       char *c;
-
-       if ((fp = popen("pwd", "r")) == NULL)
-               return(FAIL);
-       if (fgets(wkdir, 100, fp) == NULL) {
-               pclose(fp);
-               return(FAIL);
-       }
-       if (*(c = wkdir + strlen(wkdir) - 1) == '\n')
-               *c = '\0';
-       pclose(fp);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/imsg.c b/.ref-Research-V7/usr/src/cmd/uucp/imsg.c
deleted file mode 100644 (file)
index a9b5d90..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "uucp.h"
-
-
-char Msync[2] = "\020";
-/*******
- *     imsg(msg, fn)
- *     char *msg;
- *     int fn;
- *
- *     imsg  -  this is the initial read message routine -
- *     used before a protocol is agreed upon.
- *
- *     return codes:
- *             EOF - no more messages
- *             0 - message returned
- */
-
-imsg(msg, fn)
-char *msg;
-int fn;
-{
-       int ret;
-       DEBUG(7, "imsg %s>", "");
-       while ((ret = read(fn, msg, 1)) == 1) {
-               DEBUG(7, "%c", (*msg > 037) ? *msg : '-');
-               if (*msg == Msync[0])
-                       break;
-       }
-       DEBUG(7, "%s\n", "<");
-       if (ret < 1)
-               return(EOF);
-       while (read(fn, msg, 1) == 1) {
-               DEBUG(7, "%c", (*msg > 037) ? *msg : '-');
-               if (*msg == '\n')
-                       break;
-               if (*msg == '\0')
-                       break;
-               msg++;
-       }
-       *msg = '\0';
-       return(0);
-}
-
-
-/***
- *     omsg(type, msg, fn)
- *     char type, *msg;
- *     int fn;
- *
- *     omsg  -  this is the initial write message routine -
- *     used before a protocol is agreed upon.
- *
- *     return code:  always 0
- */
-
-omsg(type, msg, fn)
-char *msg, type;
-int fn;
-{
-       char buf[BUFSIZ], *c;
-
-       c = buf;
-       *c++ = Msync[0];
-       *c++ = type;
-       while (*msg)
-               *c++ = *msg++;
-       *c++ = '\0';
-       write(fn, buf, strlen(buf) + 1);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/index.c b/.ref-Research-V7/usr/src/cmd/uucp/index.c
deleted file mode 100644 (file)
index c7143df..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdio.h>
-
-
-/*******
- *     char *
- *     index(str, c)   return pointer to character c
- *     char c, *str;
- *
- *     return codes:
- *             NULL  -  character not found
- *             pointer  -  pointer to character
- */
-
-char *
-index(str, c)
-char c, *str;
-{
-       for (; *str != '\0'; str++) {
-               if (*str == c)
-                       return(str);
-       }
-
-       return(NULL);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/ioctl.c b/.ref-Research-V7/usr/src/cmd/uucp/ioctl.c
deleted file mode 100644 (file)
index 4942faf..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "uucp.h"
-#include <sgtty.h>
-
-/*******
- *     ioctl(fn, com, ttbuf)   for machines without ioctl
- *     int fn, com;
- *     struct sgttyb *ttbuf;
- *
- *     return codes - same as stty and gtty
- */
-
-ioctl(fn, com, ttbuf)
-int fn, com;
-struct sgttyb *ttbuf;
-{
-       struct sgttyb tb;
-
-       switch (com) {
-       case TIOCHPCL:
-               gtty(fn, &tb);
-               tb.sg_flags |= 1;
-               return(stty(fn, &tb));
-       case TIOCGETP:
-               return(gtty(fn, ttbuf));
-       case TIOCSETP:
-               return(stty(fn, ttbuf));
-       case TIOCEXCL:
-       default:
-               return(-1);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/lastpart.c b/.ref-Research-V7/usr/src/cmd/uucp/lastpart.c
deleted file mode 100644 (file)
index 2efee9c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-/*******
- *     char *
- *     lastpart(file)  find last part of file name
- *     char *file;
- *
- *     return - pointer to last part
- */
-
-char *
-lastpart(file)
-char *file;
-{
-       char *c;
-
-       c = file + strlen(file);
-       while (c >= file)
-               if (*(--c) == '/')
-                       break;
-       return(++c);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/logent.c b/.ref-Research-V7/usr/src/cmd/uucp/logent.c
deleted file mode 100644 (file)
index a0d9760..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <time.h>
-
-
-char Tmplog[MAXFULLNAME] = "";
-FILE *Lp = NULL;
-
-/*******
- *     logent(text, status)    make log entry
- *     char *text, *status;
- *
- *     return code - none
- */
-
-logent(text, status)
-char *text, *status;
-{
-       int n;
-       FILE *fp;
-       if (Lp != NULL) {
-               /*  make entry in existing temp log file  */
-               mlogent(Lp, status, text);
-               return;
-       }
-
-       if (ulockf(LOGLOCK, 10l) == 0) {
-               if ((fp = fopen(LOGFILE, "a")) == NULL) {
-                       rmlock(LOGLOCK);
-               }
-               else {
-                       mlogent(fp, status, text);
-                       fclose(fp);
-                       rmlock(LOGLOCK);
-                       return;
-               }
-       }
-
-       /*  make a temp log file  */
-       for (n = 0; n < 10; n++) {
-               sprintf(Tmplog, "%s/LOG.%05d.%1d", LOGDIR, getpid(), n);
-               if (access(Tmplog, 0) == -1)
-                       break;
-       }
-       if ((Lp = fopen(Tmplog, "w")) == NULL)
-               return;
-       chmod(Tmplog, 0222);
-       setbuf(Lp, NULL);
-       mlogent(Lp, status, text);
-       return;
-}
-
-/***
- *     mlogent(fp, status, text)  - make a log entry
- */
-
-mlogent(fp, status, text)
-char *text, *status;
-FILE *fp;
-{
-       struct tm *tp;
-       extern struct tm *localtime();
-       time_t clock;
-       time(&clock);
-       tp = localtime(&clock);
-       fprintf(fp, "%s %s ", User, Rmtname);
-       fprintf(fp, "(%d/%d-%d:%d) ", tp->tm_mon + 1,
-               tp->tm_mday, tp->tm_hour, tp->tm_min);
-       fprintf(fp, "%s (%s)\n", status, text);
-       return;
-}
-
-/***
- *     logcls()        close log file
- *
- *     return codes:  none
- */
-
-logcls()
-{
-       if (Lp != NULL) {
-               fclose(Lp);
-               chmod(Tmplog, 0666);
-       }
-       return;
-}
-
-
-/***
- *     syslog(text)    make system log entry
- *     char *text;
- *
- *     return codes - none
- */
-
-syslog(text)
-char *text;
-{
-       struct tm *tp;
-       extern struct tm *localtime();
-       time_t clock;
-       FILE *fp;
-
-       time(&clock);
-       tp = localtime(&clock);
-       fp = fopen(SYSLOG, "a");
-       if (fp == NULL)
-               return;
-       fprintf(fp, "%s %s ", User, Rmtname);
-       fprintf(fp, "(%d/%d-%d:%d) ", tp->tm_mon + 1,
-               tp->tm_mday, tp->tm_hour, tp->tm_min);
-       fprintf(fp, "%s\n", text);
-       fclose(fp);
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/makefile b/.ref-Research-V7/usr/src/cmd/uucp/makefile
deleted file mode 100644 (file)
index ae0bc06..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-CC=cc
-LFLAGS=-s -i
-CFLAGS=-O
-LIBS=
-FRC=
-OWNER=uucpa
-INSDIR=/usr/lib/uucp
-PKON=pkon.o
-IOCTL=
-COMMANDS=uucp uux uuxqt uucico uulog uuclean
-OFILES=cpmv.o expfile.o gename.o getpwinfo.o index.o lastpart.o \
-       prefix.o shio.o ulockf.o xqt.o
-INIT=init
-
-all:   $(INIT) $(COMMANDS) 
-
-cp:    all
-       cp uucp /bin
-       cp uux /bin
-       cp uuxqt $(INSDIR)
-       cp uucico $(INSDIR)
-       cp uulog /bin
-       cp uuclean $(INSDIR)
-       rm *.o uucp uux uuxqt uucico uulog uuclean
-
-cmp:   all
-       cmp uucp /bin/uucp
-       cmp uux /bin/uux
-       cmp uuxqt $(INSDIR)/uuxqt
-       cmp uucico $(INSDIR)/uucico
-       cmp uulog /bin/uulog
-       cmp uuclean $(INSDIR)/uuclean
-       rm *.o uucp uux uuxqt uucico uulog uuclean
-
-init:  anlwrk.o chkpth.o cpmv.o expfile.o gename.o \
-       getargs.o getprm.o getpwinfo.o gnamef.o gnsys.o \
-       gnxseq.o gwd.o imsg.o index.o lastpart.o logent.o \
-       prefix.o sdmail.o shio.o sysacct.o \
-       systat.o ulockf.o versys.o xqt.o
-
-uucp:  uucp.o gwd.o $(OFILES) chkpth.o getargs.o logent.o versys.o
-       $(CC) uucp.o gwd.o $(OFILES) \
-       chkpth.o getargs.o logent.o versys.o \
-       $(LIBS) $(LFLAGS) -o uucp
-
-uucp.o: $(FRC)
-       $(CC) -c $(CFLAGS) uucp.c
-
-uux:  uux.o
-       $(CC) uux.o gwd.o $(OFILES) \
-       chkpth.o getargs.o getprm.o versys.o \
-       $(LIBS) $(LFLAGS) -o uux
-
-uux.o: $(FRC)
-       $(CC) -c $(CFLAGS) uux.c
-
-uuxqt:  uuxqt.o
-       $(CC) uuxqt.o $(OFILES) \
-       getprm.o gnamef.o logent.o \
-       $(LIBS) $(LFLAGS) -o uuxqt
-
-uuxqt.o: $(FRC)
-       $(CC) -c $(CFLAGS) uuxqt.c
-
-uucico:  cico.o conn.o cntrl.o pk0.o pk1.o gio.o uucp.h uucpdefs.h \
-               sdmail.o $(IOCTL) $(PKON) $(OFILES)
-       $(CC) cico.o cntrl.o conn.o pk0.o pk1.o gio.o \
-       sdmail.o $(IOCTL) $(PKON) $(OFILES) \
-       anlwrk.o chkpth.o getargs.o gnamef.o gnsys.o gnxseq.o \
-       imsg.o logent.o sysacct.o systat.o \
-       $(LIBS) $(LFLAGS) -o uucico
-
-
-cico.o: $(FRC)
-       $(CC) -c $(CFLAGS) cico.c
-
-conn.o: $(FRC)
-       $(CC) -c $(CFLAGS) conn.c
-
-cntrl.o: $(FRC)
-       $(CC) -c $(CFLAGS) cntrl.c
-
-gio.o: $(FRC)
-       $(CC) -c $(CFLAGS) gio.c
-
-pkon.o: $(FRC)
-       $(CC) -c $(CFLAGS) pkon.c
-
-pk0.o: $(FRC)
-       $(CC) -c $(CFLAGS) pk0.c
-
-pk1.o: $(FRC)
-       $(CC) -c $(CFLAGS) pk1.c
-
-ioctl.o: $(FRC)
-       $(CC) -c $(CFLAGS) ioctl.c
-
-uulog:  uulog.o
-       $(CC) uulog.o prefix.o xqt.o ulockf.o gnamef.o \
-       $(LIBS) $(LFLAGS) -o uulog
-
-uulog.o: $(FRC)
-       $(CC) -c $(CFLAGS) uulog.c
-
-uuclean:  uuclean.o
-       $(CC) uuclean.o gnamef.o prefix.o sdmail.o getpwinfo.o \
-       $(LIBS) $(LFLAGS) -o uuclean
-
-uuclean.o: $(FRC)
-       $(CC) -c $(CFLAGS) uuclean.c
-
-uurecover: uurecover.o
-       $(CC) uurecover.o $(LIBS) $(LFLAGS) -o uurecover
-       -ls -l uurecover
-
-uurecover.o: $(FRC)
-       $(CC) -c $(CFLAGS) uurecover.c
-
-FRC:
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/pk0.c b/.ref-Research-V7/usr/src/cmd/uucp/pk0.c
deleted file mode 100644 (file)
index ce13e7f..0000000
+++ /dev/null
@@ -1,654 +0,0 @@
-#define USER   1
-#include <stdio.h>
-#include <sys/pk.p>
-#include <sys/param.h>
-#include <sys/pk.h>
-#include <sys/buf.h>
-
-/*
- * packet driver
- */
-
-char next[8]   ={ 1,2,3,4,5,6,7,0};    /* packet sequence numbers */
-char mask[8]   ={ 1,2,4,010,020,040,0100,0200 };
-
-struct pack *pklines[NPLINES];
-
-
-
-/*
- * receive control messages
- */
-pkcntl(c, pk)
-register struct pack *pk;
-{
-register cntl, val;
-
-       val = c & MOD8;
-       cntl = (c>>3) & MOD8;
-
-       if ( ! ISCNTL(c) ) {
-               fprintf(stderr, "not cntl\n");
-               return;
-       }
-
-       if (pk->p_mode & 02)
-               fprintf(stderr, "%o ",c);
-       switch(cntl) {
-
-       case INITB:
-               val++;
-               pk->p_xsize = pksizes[val];
-               pk->p_lpsize = val;
-               pk->p_bits = DTOM(pk->p_xsize);
-               if (pk->p_state & LIVE) {
-                       pk->p_msg |= M_INITC;
-                       break;
-               }
-               pk->p_state |= INITb;
-               if ((pk->p_state & INITa)==0) {
-                       break;
-               }
-               pk->p_rmsg &= ~M_INITA;
-               pk->p_msg |= M_INITC;
-               break;
-
-       case INITC:
-               if ((pk->p_state&INITab)==INITab) {
-                       pk->p_state = LIVE;
-                       WAKEUP(&pk->p_state);
-                       pk->p_rmsg &= ~M_INITB;
-               } else
-                       pk->p_msg |= M_INITB;
-               if (val)
-                       pk->p_swindow = val;
-               break;
-       case INITA:
-               if (val==0 && pk->p_state&LIVE) {
-                       fprintf(stderr, "alloc change not implemented\n");
-                       break;
-               }
-               if (val) {
-                       pk->p_state |= INITa;
-                       pk->p_msg |= M_INITB;
-                       pk->p_rmsg |= M_INITB;
-                       pk->p_swindow = val;
-               }
-               break;
-       case RJ:
-               pk->p_state |= RXMIT;
-               pk->p_msg |= M_RR;
-       case RR:
-               pk->p_rpr = val;
-               if (pksack(pk)==0) {
-                       WAKEUP(&pk->p_ps);
-               }
-               break;
-       case SRJ:
-               fprintf(stderr, "srj not implemented\n");
-               break;
-       case CLOSE:
-               pk->p_state = DOWN+RCLOSE;
-               SIGNAL;
-               WAKEUP(&pk->p_pr);
-               WAKEUP(&pk->p_ps);
-               WAKEUP(&pk->p_state);
-               return;
-       }
-out:
-       if (pk->p_msg)
-               pkoutput(pk);
-}
-
-
-
-pkaccept(pk)
-register struct pack *pk;
-{
-register x,seq;
-char m, cntl, *p, imask, **bp;
-int bad,accept,skip,s,t,h,cc;
-unsigned short sum;
-
-       bad = accept = skip = 0;
-       /*
-        * wait for input
-        */
-       LOCK;
-       x = next[pk->p_pr];
-       while ((imask=pk->p_imap) == 0 && pk->p_rcount==0) {
-               PKGETPKT(pk);
-               SLEEP(&pk->p_pr, PKIPRI);
-       }
-       pk->p_imap = 0;
-       UNLOCK;
-
-
-       /*
-        * determine input window in m.
-        */
-       t = (~(-1<<pk->p_rwindow)) <<x;
-       m = t;
-       m |= t>>8;
-
-
-       /*
-        * mark newly accepted input buffers
-        */
-       for(x=0; x<8; x++) {
-
-               if ((imask & mask[x]) == 0)
-                       continue;
-
-               if (((cntl=pk->p_is[x])&0200)==0) {
-                       bad++;
-free:
-                       bp = (char **)pk->p_ib[x];
-                       LOCK;
-                       *bp = (char *)pk->p_ipool;
-                       pk->p_ipool = bp;
-                       pk->p_is[x] = 0;
-                       UNLOCK;
-                       continue;
-               }
-
-               pk->p_is[x] = ~(B_COPY+B_MARK);
-               sum = (unsigned)chksum(pk->p_ib[x], pk->p_rsize) ^ (unsigned)cntl;
-               sum += pk->p_isum[x];
-               if (sum == CHECK) {
-                       seq = (cntl>>3) & MOD8;
-                       if (m & mask[seq]) {
-                               if (pk->p_is[seq] & (B_COPY | B_MARK)) {
-                               dup:
-                                       pk->p_msg |= M_RR;
-                                       skip++;
-                                       goto free;
-                               }
-                               if (x != seq) {
-                                       LOCK;
-                                       p = pk->p_ib[x];
-                                       pk->p_ib[x] = pk->p_ib[seq];
-                                       pk->p_is[x] = pk->p_is[seq];
-                                       pk->p_ib[seq] = p;
-                                       UNLOCK;
-                               }
-                               pk->p_is[seq] = B_MARK;
-                               accept++;
-                               cc = 0;
-                               if (cntl&B_SHORT) {
-                                       pk->p_is[seq] = B_MARK+B_SHORT;
-                                       p = pk->p_ib[seq];
-                                       cc = (unsigned)*p++;
-                                       if (cc & 0200) {
-                                               cc &= 0177;
-                                               cc |= *p << 7;
-                                       }
-                               }
-                               pk->p_isum[seq] = pk->p_rsize - cc;
-                       } else {
-                               goto dup;
-                       }
-               } else {
-                       bad++;
-                       goto free;
-               }
-       }
-
-       /*
-        * scan window again turning marked buffers into
-        * COPY buffers and looking for missing sequence
-        * numbers.
-        */
-       accept = 0;
-       for(x=next[pk->p_pr],t=h= -1; m & mask[x]; x = next[x]) {
-               if (pk->p_is[x] & B_MARK)
-                       pk->p_is[x] |= B_COPY;
-       /*  hole code 
-               if (pk->p_is[x] & B_COPY) {
-                       if (h<0 && t>=0)
-                               h = x;
-               } else {
-                       if (t<0)
-                               t = x;
-               }
-       */
-               if (pk->p_is[x] & B_COPY) {
-                       if (t >= 0) {
-                               bp = (char **)pk->p_ib[x];
-                               LOCK;
-                               *bp = (char *)pk->p_ipool;
-                               pk->p_ipool = bp;
-                               pk->p_is[x] = 0;
-                               UNLOCK;
-                               skip++;
-                       } else 
-                               accept++;
-               } else {
-                       if (t<0)
-                               t = x;
-               }
-       }
-
-       if (bad) {
-               pk->p_msg |= M_RJ;
-       }
-
-       if (skip) {
-               pk->p_msg |= M_RR;
-       }
-
-       pk->p_rcount = accept;
-       return(accept);
-}
-
-
-pkread(S)
-SDEF;
-{
-register struct pack *pk;
-register x,s;
-int is,cc,xfr,count;
-char *cp, **bp;
-
-       pk = PADDR;
-       xfr = 0;
-       count = 0;
-       while (pkaccept(pk)==0);
-
-
-       while (UCOUNT) {
-
-               x = next[pk->p_pr];
-               is = pk->p_is[x];
-
-               if (is & B_COPY) {
-                       cc = MIN(pk->p_isum[x], UCOUNT);
-                       if (cc==0 && xfr) {
-                               break;
-                       }
-                       if (is & B_RESID)
-                               cp = pk->p_rptr;
-                       else {
-                               cp = pk->p_ib[x];
-                               if (is & B_SHORT) {
-                                       if (*cp++ & 0200)
-                                               *cp++;
-                               }
-                       }
-                       IOMOVE(cp,cc,B_READ);
-                       count += cc;
-                       xfr++;
-                       pk->p_isum[x] -= cc;
-                       if (pk->p_isum[x] == 0) {
-                               pk->p_pr = x;
-                               bp = (char **)pk->p_ib[x];
-                               LOCK;
-                               *bp = (char *)pk->p_ipool;
-                               pk->p_ipool = bp;
-                               pk->p_is[x] = 0;
-                               pk->p_rcount--;
-                               UNLOCK;
-                               pk->p_msg |= M_RR;
-                       } else {
-                               pk->p_rptr = cp+cc;
-                               pk->p_is[x] |= B_RESID;
-                       }
-                       if (cc==0)
-                               break;
-               } else
-                       break;
-       }
-       pkoutput(pk);
-       return(count);
-}
-
-
-
-
-pkwrite(S)
-SDEF;
-{
-register struct pack *pk;
-register x;
-int partial;
-caddr_t cp;
-int cc, s, fc, count;
-int pktimeout();
-
-       pk = PADDR;
-       if (pk->p_state&DOWN || !pk->p_state&LIVE) {
-               SETERROR;
-               return(-1);
-       }
-
-       count = UCOUNT;
-       do {
-               LOCK;
-               while (pk->p_xcount>=pk->p_swindow)  {
-                       pkoutput(pk);
-                       PKGETPKT(pk);
-                       SLEEP(&pk->p_ps,PKOPRI);
-               }
-               x = next[pk->p_pscopy];
-               while (pk->p_os[x]!=B_NULL)  {
-                       PKGETPKT(pk);
-                       SLEEP(&pk->p_ps,PKOPRI);
-               }
-               pk->p_os[x] = B_MARK;
-               pk->p_pscopy = x;
-               pk->p_xcount++;
-               UNLOCK;
-
-               cp = pk->p_ob[x] = GETEPACK;
-               partial = 0;
-               if ((int)UCOUNT < pk->p_xsize) {
-                       cc = UCOUNT;
-                       fc = pk->p_xsize - cc;
-                       *cp = fc&0177;
-                       if (fc > 127) {
-                               *cp++ |= 0200;
-                               *cp++ = fc>>7;
-                       } else
-                               cp++;
-                       partial = B_SHORT;
-               } else
-                       cc = pk->p_xsize;
-               IOMOVE(cp,cc,B_WRITE);
-               pk->p_osum[x] = chksum(pk->p_ob[x], pk->p_xsize);
-               pk->p_os[x] = B_READY+partial;
-               pkoutput(pk);
-       } while (UCOUNT);
-
-       return(count);
-}
-
-pksack(pk)
-register struct pack *pk;
-{
-register x, i;
-
-       i = 0;
-       for(x=pk->p_ps; x!=pk->p_rpr; ) {
-               x = next[x];
-               if (pk->p_os[x]&B_SENT) {
-                       i++;
-                       pk->p_os[x] = B_NULL;
-                       pk->p_state &= ~WAITO;
-                       pk->p_xcount--;
-                       FREEPACK(pk->p_ob[x], pk->p_bits);
-                       pk->p_ps = x;
-                       WAKEUP(&pk->p_ps);
-               }
-       }
-       return(i);
-}
-
-
-
-pkoutput(pk)
-register struct pack *pk;
-{
-register x,rx;
-int s;
-char bstate;
-int i;
-SDEF;
-int flag;
-
-       flag = 0;
-       ISYSTEM;
-       LOCK;
-       if (pk->p_obusy++ || OBUSY) {
-               pk->p_obusy--;
-               UNLOCK;
-               return;
-       }
-       UNLOCK;
-
-
-       /*
-        * find seq number and buffer state
-        * of next output packet
-        */
-       if (pk->p_state&RXMIT)  {
-               pk->p_nxtps = next[pk->p_rpr];
-               flag++;
-       }
-       x = pk->p_nxtps;
-       bstate = pk->p_os[x];
-
-
-       /*
-        * Send control packet if indicated
-        */
-       if (pk->p_msg) {
-               if (pk->p_msg & ~M_RR || !(bstate&B_READY) ) {
-                       x = pk->p_msg;
-                       for(i=0; i<8; i++) 
-                               if (x&1)
-                                       break; else
-                               x >>= 1;
-                       x = i;
-                       x <<= 3;
-                       switch(i) {
-                       case CLOSE:
-                               break;
-                       case RJ:
-                       case RR:
-                               x += pk->p_pr;
-                               break;
-                       case SRJ:
-                               break;
-                       case INITB:
-                               x += pksize(pk->p_rsize);
-                               break;
-                       case INITC:
-                               x += pk->p_rwindow;
-                               break;
-                       case INITA:
-                               x += pk->p_rwindow;
-                               break;
-                       }
-
-                       pk->p_msg &= ~mask[i];
-                       pkxstart(pk, x, -1);
-                       goto out;
-               }
-       }
-
-
-       /*
-        * Don't send data packets if line is marked dead.
-        */
-       if (pk->p_state&DOWN) {
-               WAKEUP(&pk->p_ps);
-               goto out;
-       }
-       /*
-        * Start transmission (or retransmission) of data packets.
-        */
-       if (bstate & (B_READY|B_SENT)) {
-               char seq;
-
-               bstate |= B_SENT;
-               seq = x;
-               pk->p_nxtps = next[x];
-
-               x = 0200+pk->p_pr+(seq<<3);
-               if (bstate & B_SHORT)
-                       x |= 0100;
-               pkxstart(pk, x, seq);
-               pk->p_os[seq] = bstate;
-               pk->p_state &= ~RXMIT;
-               pk->p_nout++;
-               goto out;
-       }
-       /*
-        * enable timeout if there's nothing to send
-        * and transmission buffers are languishing
-        */
-       if (pk->p_xcount) {
-               pk->p_timer = 2;
-               pk->p_state |= WAITO;
-       } else
-               pk->p_state &= ~WAITO;
-       WAKEUP(&pk->p_ps);
-out:
-       pk->p_obusy = 0;
-}
-
-
-/*
- * shut down line by
- *     ignoring new input
- *     letting output drain
- *     releasing space and turning off line discipline
- */
-pkclose(S)
-SDEF;
-{
-register struct pack *pk;
-register i,s,rbits;
-char **bp;
-int rcheck;
-char *p;
-
-
-       pk = PADDR;
-       pk->p_state |= DRAINO;
-
-
-       /*
-        * try to flush output
-        */
-       i = 0;
-       LOCK;
-       pk->p_timer = 2;
-       while (pk->p_xcount && pk->p_state&LIVE) {
-               if (pk->p_state&(RCLOSE+DOWN) || ++i > 2)
-                       break;
-               pkoutput(pk);
-               SLEEP(&pk->p_ps,PKOPRI);
-       }
-       pk->p_timer = 0;
-       pk->p_state |= DOWN;
-       UNLOCK;
-
-
-       /*
-        * try to exchange CLOSE messages
-        */
-       i = 0;
-       while ((pk->p_state&RCLOSE)==0 && i<2) {
-               pk->p_msg = M_CLOSE;
-               pk->p_timer = 2;
-               pkoutput(pk);
-               SLEEP(&pk->p_ps, PKOPRI);
-               i++;
-       }
-
-
-       for(i=0;i<NPLINES;i++)
-               if (pklines[i]==pk)  {
-                       pklines[i] = NULL;
-               }
-       TURNOFF;
-
-
-       /*
-        * free space
-        */
-       rbits = DTOM(pk->p_rsize);
-       rcheck = 0;
-       for (i=0;i<8;i++) {
-               if (pk->p_os[i]!=B_NULL) {
-                       FREEPACK(pk->p_ob[i],pk->p_bits);
-                       pk->p_xcount--;
-               }
-               if (pk->p_is[i]!=B_NULL)  {
-                       FREEPACK(pk->p_ib[i],rbits);
-                       rcheck++;
-               }
-       }
-       LOCK;
-       while (pk->p_ipool != NULL) {
-               bp = pk->p_ipool;
-               pk->p_ipool = (char **)*bp;
-               rcheck++;
-               FREEPACK(bp, rbits);
-       }
-       UNLOCK;
-       if (rcheck  != pk->p_rwindow) {
-               fprintf(stderr, "r short %d want %d\n",rcheck,pk->p_rwindow);
-               fprintf(stderr, "rcount = %d\n",pk->p_rcount);
-               fprintf(stderr, "xcount = %d\n",pk->p_xcount);
-       }
-       FREEPACK((caddr_t)pk, npbits);
-}
-
-
-
-pkreset(pk)
-register struct pack *pk;
-{
-
-       pk->p_ps = pk->p_pr =  pk->p_rpr = 0;
-       pk->p_nxtps = 1;
-}
-
-chksum(s,n)
-register char *s;
-register n;
-{
-       register short sum;
-       register unsigned t;
-       register x;
-
-       sum = -1;
-       x = 0;
-
-       do {
-               if (sum<0) {
-                       sum <<= 1;
-                       sum++;
-               } else
-                       sum <<= 1;
-               t = sum;
-               sum += (unsigned)*s++;
-               x += sum^n;
-               if ((unsigned)sum <= t) {
-                       sum ^= x;
-               }
-       } while (--n > 0);
-
-       return(sum);
-}
-
-pkline(pk)
-register struct pack *pk;
-{
-register i;
-       for(i=0;i<NPLINES;i++) {
-               if (pklines[i]==pk)
-                       return(i);
-       }
-       return(-i);
-}
-
-pkzero(s,n)
-register char *s;
-register n;
-{
-       while (n--)
-               *s++ = 0;
-}
-
-pksize(n)
-register n;
-{
-register k;
-
-       n >>= 5;
-       for(k=0; n >>= 1; k++);
-       return(k);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/pk1.c b/.ref-Research-V7/usr/src/cmd/uucp/pk1.c
deleted file mode 100644 (file)
index fc340ba..0000000
+++ /dev/null
@@ -1,374 +0,0 @@
-#define USER   1
-#include <stdio.h>
-#include <sys/pk.p>
-#include <sys/param.h>
-#include <sys/pk.h>
-#include <sys/buf.h>
-#include <setjmp.h>
-#include <signal.h>
-
-#define PKTIME 10
-int Errorrate;
-int Conbad = 0;
-int Ntimeout = 0;
-#define CONBAD 5
-#define NTIMEOUT 50
-/*
- * packet driver support routines
- *
- */
-
-struct pack *pklines[NPLINES];
-
-/*
- * start initial synchronization.
- */
-
-struct pack *
-pkopen(ifn, ofn)
-int ifn, ofn;
-{
-       struct pack *pk;
-       char **bp;
-       int i;
-
-       if (++pkactive >= NPLINES)
-               return(NULL);
-       if ((pk = (struct pack *) malloc(sizeof (struct pack))) == NULL)
-               return(NULL);
-       pkzero((caddr_t) pk, sizeof (struct pack));
-       pk->p_ifn = ifn;
-       pk->p_ofn = ofn;
-       pk->p_xsize = pk->p_rsize = PACKSIZE;
-       pk->p_rwindow = pk->p_swindow = WINDOWS;
-       /*  allocate input windows */
-       for (i = 0; i < pk->p_rwindow; i++) {
-               if ((bp = (char **) GETEPACK) == NULL)
-                       break;
-               *bp = (char *) pk->p_ipool;
-               pk->p_ipool = bp;
-       }
-       if (i == 0)
-               return(NULL);
-       pk->p_rwindow = i;
-
-       /* start synchronization */
-       pk->p_msg = pk->p_rmsg = M_INITA;
-       for (i = 0; i < NPLINES; i++) {
-               if (pklines[i] == NULL) {
-                       pklines[i] = pk;
-                       break;
-               }
-       }
-       if (i >= NPLINES)
-               return(NULL);
-       pkoutput(pk);
-
-       while ((pk->p_state & LIVE) == 0) {
-               PKGETPKT(pk);
-       }
-
-       pkreset(pk);
-       return(pk);
-}
-
-
-/*
- * input framing and block checking.
- * frame layout for most devices is:
- *     
- *     S|K|X|Y|C|Z|  ... data ... |
- *
- *     where   S       == initial synch byte
- *             K       == encoded frame size (indexes pksizes[])
- *             X, Y    == block check bytes
- *             C       == control byte
- *             Z       == XOR of header (K^X^Y^C)
- *             data    == 0 or more data bytes
- *
- */
-
-int pksizes[] = {
-       1, 32, 64, 128, 256, 512, 1024, 2048, 4096, 1
-};
-
-#define GETRIES 5
-/*
- * Pseudo-dma byte collection.
- */
-
-pkgetpack(ipk)
-struct pack *ipk;
-{
-       int ret, k, tries;
-       register char *p;
-       struct pack *pk;
-       struct header *h;
-       unsigned short sum;
-       int ifn;
-       char **bp;
-       char hdchk;
-
-       if (Conbad > CONBAD /* || Ntimeout > NTIMEOUT */)
-               pkfail();
-       pk = PADDR;
-       ifn = pk->p_ifn;
-
-       /* find HEADER */
-       for (tries = 0; tries < GETRIES; ) {
-               p = (caddr_t) &pk->p_ihbuf;
-               if ((ret = pkcget(ifn, p, 1)) < 0) {
-                       /* set up retransmit or REJ */
-                       tries++;
-                       pk->p_msg |= pk->p_rmsg;
-                       if (pk->p_msg == 0)
-                               pk->p_msg |= M_RR;
-                       if ((pk->p_state & LIVE) == LIVE)
-                               pk->p_state |= RXMIT;
-                       pkoutput(pk);
-                       continue;
-               }
-               if (*p != SYN)
-                       continue;
-               p++;
-               ret = pkcget(ifn, p, HDRSIZ - 1);
-               if (ret == -1)
-                       continue;
-               break;
-       }
-       if (tries >= GETRIES) {
-               PKDEBUG(4, "tries = %d\n", tries);
-               pkfail();
-       }
-
-       h = (struct header * ) &pk->p_ihbuf;
-       p = (caddr_t) h;
-       hdchk = p[1] ^ p[2] ^ p[3] ^ p[4];
-       p += 2;
-       sum = (unsigned) *p++;
-       sum |= (unsigned) *p << 8;
-       h->sum = sum;
-       PKDEBUG(7, "rec h->cntl %o\n", (unsigned) h->cntl);
-       k = h->ksize;
-       if (hdchk != h->ccntl) {
-               /* bad header */
-               PKDEBUG(7, "bad header %o,", hdchk);
-               PKDEBUG(7, "h->ccntl %o\n", h->ccntl);
-               Conbad++;
-               return;
-       }
-       if (k == 9) {
-               if (h->sum + h->cntl == CHECK) {
-                       pkcntl(h->cntl, pk);
-                       Conbad = 0;
-                       PKDEBUG(7, "state - %o\n", pk->p_state);
-               }
-               else {
-                       /*  bad header */
-                       Conbad++;
-                       PKDEBUG(7, "bad header %o\n", h->cntl);
-                       pk->p_state |= BADFRAME;
-               }
-               return;
-       }
-       if (k && pksizes[k] == pk->p_rsize) {
-               pk->p_rpr = h->cntl & MOD8;
-               pksack(pk);
-               Conbad = 0;
-               bp = pk->p_ipool;
-               pk->p_ipool = (char **) *bp;
-               if (bp == NULL) {
-                       PKDEBUG(7, "bp NULL %s\n", "");
-               return;
-               }
-       }
-       else {
-               Conbad++;
-               return;
-       }
-       ret = pkcget(pk->p_ifn, (char *) bp, pk->p_rsize);
-       PKASSERT(ret != -1, "PKGETPKT CAN't READ %d", ret);
-       pkdata(h->cntl, h->sum, pk, (char *) bp);
-       return;
-}
-
-
-pkdata(c, sum, pk, bp)
-char c;
-short sum;
-register struct pack *pk;
-char **bp;
-{
-register x;
-int t;
-char m;
-
-       if (pk->p_state & DRAINO || !(pk->p_state & LIVE)) {
-               pk->p_msg |= pk->p_rmsg;
-               pkoutput(pk);
-               goto drop;
-       }
-       t = next[pk->p_pr];
-       for(x=pk->p_pr; x!=t; x = (x-1)&7) {
-               if (pk->p_is[x] == 0)
-                       goto slot;
-       }
-drop:
-       *bp = (char *)pk->p_ipool;
-       pk->p_ipool = bp;
-       return;
-
-slot:
-       m = mask[x];
-       pk->p_imap |= m;
-       pk->p_is[x] = c;
-       pk->p_isum[x] = sum;
-       pk->p_ib[x] = (char *)bp;
-       return;
-}
-
-
-
-/*
- * setup input transfers
- */
-pkrstart(pk)
-{}
-
-/*
- * Start transmission on output device associated with pk.
- * For asynch devices (t_line==1) framing is
- * imposed.  For devices with framing and crc
- * in the driver (t_line==2) the transfer is
- * passed on to the driver.
- */
-pkxstart(pk, cntl, x)
-struct pack *pk;
-char cntl;
-register x;
-{
-       register char *p;
-       int ret;
-       short checkword;
-       char hdchk;
-
-       p = (caddr_t) &pk->p_ohbuf;
-       *p++ = SYN;
-       if (x < 0) {
-               *p++ = hdchk = 9;
-               checkword = cntl;
-       }
-       else {
-               *p++ = hdchk = pk->p_lpsize;
-               checkword = pk->p_osum[x] ^ (unsigned)cntl;
-       }
-       checkword = CHECK - checkword;
-       *p = checkword;
-       hdchk ^= *p++;
-       *p = checkword>>8;
-       hdchk ^= *p++;
-       *p = cntl;
-       hdchk ^= *p++;
-       *p = hdchk;
- /*  writes  */
-PKDEBUG(7, "send %o\n", (unsigned) cntl);
-       p = (caddr_t) & pk->p_ohbuf;
-       if (x < 0) {
-               GENERROR(p, HDRSIZ);
-               ret = write(pk->p_ofn, p, HDRSIZ);
-               PKASSERT(ret == HDRSIZ, "PKXSTART ret %d", ret);
-       }
-       else {
-               char buf[PACKSIZE + HDRSIZ], *b;
-               int i;
-               for (i = 0, b = buf; i < HDRSIZ; i++) 
-                       *b++ = *p++;
-               for (i = 0, p = pk->p_ob[x]; i < pk->p_rsize; i++)
-                       *b++ = *p++;
-               GENERROR(buf, pk->p_rsize + HDRSIZ);
-               ret = write(pk->p_ofn, buf, pk->p_rsize + HDRSIZ);
-               PKASSERT(ret == pk->p_rsize + HDRSIZ,
-                 "PKXSTART ret %d", ret);
-       }
-       if (pk->p_msg)
-               pkoutput(pk);
-       return;
-}
-
-
-pkmove(p1, p2, count, flag)
-char *p1, *p2;
-int count, flag;
-{
-       char *s, *d;
-       int i;
-       if (flag == B_WRITE) {
-               s = p2;
-               d = p1;
-       }
-       else {
-               s = p1;
-               d = p2;
-       }
-       for (i = 0; i < count; i++)
-               *d++ = *s++;
-       return;
-}
-
-
-/***
- *     pkcget(fn, b, n)        get n characters from input
- *     char *b;                - buffer for characters
- *     int fn;                 - file descriptor
- *     int n;                  - requested number of characters
- *
- *     return codes:
- *             n - number of characters returned
- *             0 - end of file
- */
-
-jmp_buf Getjbuf;
-cgalarm() { longjmp(Getjbuf, 1); }
-
-pkcget(fn, b, n)
-int fn, n;
-char *b;
-{
-       int nchars, ret;
-
-       if (setjmp(Getjbuf)) {
-               Ntimeout++;
-               PKDEBUG(4, "alarm %d\n", Ntimeout);
-               return(-1);
-       }
-       signal(SIGALRM, cgalarm);
-
-       for (nchars = 0; nchars < n; nchars += ret) {
-               alarm(PKTIME);
-               ret = read(fn, b, n - nchars);
-               if (ret == 0) {
-                       alarm(0);
-                       return(-1);
-               }
-               PKASSERT(ret > 0, "PKCGET READ %d", ret);
-               b += ret;
-       }
-       alarm(0);
-       return(0);
-}
-
-
-generror(p, s)
-char *p;
-int s;
-{
-       int r;
-       if (Errorrate != 0 && (rand() % Errorrate) == 0) {
-               r = rand() % s;
-fprintf(stderr, "gen err at %o, (%o), ", r, (unsigned) *(p + r));
-               *(p + r) += 1;
-       }
-       return;
-}
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/pkon.c b/.ref-Research-V7/usr/src/cmd/uucp/pkon.c
deleted file mode 100644 (file)
index 9b89e9d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-pkon() { }
-pkoff() { }
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/prefix.c b/.ref-Research-V7/usr/src/cmd/uucp/prefix.c
deleted file mode 100644 (file)
index 3db9cb6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-/*******
- *     prefix(s1, s2)  check s2 for prefix s1
- *     char *s1, *s2;
- *
- *     return 0 - !=
- *     return 1 - == 
- */
-
-prefix(s1, s2)
-char *s1, *s2;
-{
-       char c;
-
-       while ((c = *s1++) == *s2++)
-               if (c == '\0')
-                       return(1);
-       return(c == '\0');
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/sdmail.c b/.ref-Research-V7/usr/src/cmd/uucp/sdmail.c
deleted file mode 100644 (file)
index 5da6039..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "uucp.h"
-#include <pwd.h>
-
-
-/*******
- *     sdmail(file, uid)
- *     char *file, *uid;
- *
- *     sdmail  -  this routine will determine the owner
- *     of the file (file), create a message string and
- *     call "mailst" to send the cleanup message.
- *     This is only implemented for local system
- *     mail at this time.
- */
-
-sdmail(file, uid)
-char *file, *uid;
-{
-       static struct passwd *pwd;
-       struct passwd *getpwuid();
-       char mstr[40];
-
-       sprintf(mstr, "uuclean deleted file %s\n", file);
-       if (pwd->pw_uid == uid) {
-               mailst(pwd->pw_name, mstr);
-       return(0);
-       }
-
-       setpwent();
-       if ((pwd = getpwuid(uid)) != NULL) {
-               mailst(pwd->pw_name, mstr);
-       }
-       return(0);
-}
-
-
-/***
- *     mailst(user, str)
- *     char *user, *str;
- *
- *     mailst  -  this routine will fork and execute
- *     a mail command sending string (str) to user (user).
- */
-
-mailst(user, str)
-char *user, *str;
-{
-       FILE *fp;
-       extern FILE *popen(), *pclose();
-       char cmd[100];
-
-       sprintf(cmd, "mail %s", user);
-       if ((fp = popen(cmd, "w")) == NULL)
-               return;
-       fprintf(fp, "%s", str);
-       pclose(fp);
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/shio.c b/.ref-Research-V7/usr/src/cmd/uucp/shio.c
deleted file mode 100644 (file)
index 9dd8b90..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "uucp.h"
-
-
-/*******
- *     shio(cmd, fi, fo, user) execute shell of command with
- *     char *cmd, *fi, *fo;    fi and fo as standard input/output
- *     char *user;             user name
- *
- *     return codes:
- *             0  - ok
- *             non zero -  failed  -  status from child
- */
-
-shio(cmd, fi, fo, user)
-char *cmd, *fi, *fo, *user;
-{
-       int status, f;
-       int uid, pid, ret;
-       char path[MAXFULLNAME];
-
-       if (fi == NULL)
-               fi = "/dev/null";
-       if (fo == NULL)
-               fo = "/dev/null";
-
-       DEBUG(3, "shio - %s\n", cmd);
-       if ((pid = fork()) == 0) {
-               close(Ifn);
-               close(Ofn);
-               close(0);
-               f = open(fi, 0);
-               ASSERT(f == 0, "BAD OPEN fileno %d", f);
-               close(1);
-               f = creat(fo, 0666);
-               ASSERT(f == 1, "BAD OPEN fileno %d", f);
-               if (gninfo(user, &uid, path) == 0)
-                       setuid(uid);
-               execl(SHELL, "sh", "-c", cmd, 0);
-               exit(100);
-       }
-       while ((ret = wait(&status)) != pid && ret != -1);
-       DEBUG(3, "status %d\n", status);
-       return(status);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/sysacct.c b/.ref-Research-V7/usr/src/cmd/uucp/sysacct.c
deleted file mode 100644 (file)
index ad93dc5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <sys/types.h>
-
-
-/*******
- *     sysacct(bytes, time)    output accounting info
- *     time_t time;
- *     long bytes;
- */
-
-sysacct(bytes, time)
-time_t time;
-long bytes;
-{
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/systat.c b/.ref-Research-V7/usr/src/cmd/uucp/systat.c
deleted file mode 100644 (file)
index d221717..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-
-#define STATNAME(f, n) sprintf(f, "%s/%s.%.7s", Spool, "STST", n)
-#define S_SIZE 100
-
-/*******
- *     systat(name, type, text)        make system status entry
- *     char *name, *text;
- *     int type.
- *
- *     return codes:  none
- */
-
-systat(name, type, text)
-char *name, *text;
-int type;
-{
-       char filename[MAXFULLNAME], line[S_SIZE];
-       int count;
-       FILE *fp;
-       time_t prestime;
-
-       if (type == 0)
-               return;
-       line[0] = '\0';
-       time(&prestime);
-       count = 0;
-       STATNAME(filename, name);
-
-       fp = fopen(filename, "r");
-       if (fp != NULL) {
-               fgets(line, S_SIZE, fp);
-               sscanf(&line[2], "%d", &count);
-               if (count <= 0)
-                       count = 0;
-               fclose(fp);
-       }
-
-       if (type == SS_FAIL)
-               count++;
-
-       fp = fopen(filename, "w");
-       ASSERT(fp != NULL, "SYSTAT OPEN FAIL %s", "");
-       chmod(filename, 0666);
-       fprintf(fp, "%d %d %D %s %s\n", type, count, prestime, text, name);
-       fclose(fp);
-       return;
-}
-
-/***
- *     rmstat(name)    remove system status entry
- *     char *name;
- *
- *     return codes:  none
- */
-
-rmstat(name)
-char *name;
-{
-       char filename[MAXFULLNAME];
-
-       STATNAME(filename, name);
-       unlink(filename);
-}
-
-/***
- *     callok(name)    check system status for call
- *     char *name;
- *
- *     return codes  0 - ok | >0 system status
- */
-
-callok(name)
-char *name;
-{
-       char filename[MAXFULLNAME], line[S_SIZE];
-       FILE *fp;
-       time_t lasttime, prestime;
-       int count, type;
-
-       STATNAME(filename, name);
-       fp = fopen(filename, "r");
-       if (fp == NULL)
-               return(SS_OK);
-
-       if (fgets(line, S_SIZE, fp) == NULL) {
-               /*  no data  */
-               fclose(fp);
-               unlink(filename);
-               return(SS_OK);
-       }
-
-       fclose(fp);
-       time(&prestime);
-       sscanf(line, "%d%d%D", &type, &count, &lasttime);
-
-       switch(type) {
-       case SS_BADSEQ:
-       case SS_CALLBACK:
-               return(SS_OK);
-       case SS_NODEVICE:
-               return(SS_OK);
-
-       case SS_INPROGRESS:
-               if (prestime - lasttime < INPROGTIME) {
-                       DEBUG(4, "CALL IN PROGRESS %s\n", "");
-                       return(type);
-               }
-               else
-                       return(SS_OK);
-
-
-       case SS_FAIL:
-               if (count > MAXRECALLS) {
-                       logent("MAX RECALLS", "NO CALL");
-                       DEBUG(4, "MAX RECALL COUNT %d\n", count);
-                       return(type);
-               }
-
-               if (prestime - lasttime < RETRYTIME) {
-                       logent("RETRY TIME NOT REACHED", "NO CALL");
-                       DEBUG(4, "RETRY TIME (%d) NOT REACHED\n", RETRYTIME);
-                       return(type);
-               }
-
-               return(SS_OK);
-       default:
-               return(SS_OK);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/ulockf.c b/.ref-Research-V7/usr/src/cmd/uucp/ulockf.c
deleted file mode 100644 (file)
index 9c6fb2c..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-#include "uucp.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-
-/*******
- *     ulockf(file, atime)
- *     char *file;
- *     time_t atime;
- *
- *     ulockf  -  this routine will create a lock file (file).
- *     If one already exists, the create time is checked for
- *     older than the age time (atime).
- *     If it is older, an attempt will be made to unlink it
- *     and create a new one.
- *
- *     return codes:  0  |  FAIL
- */
-
-ulockf(file, atime)
-char *file;
-time_t atime;
-{
-       struct stat stbuf;
-       time_t ptime;
-       int ret;
-       static int pid = -1;
-       static char tempfile[NAMESIZE];
-
-       if (pid < 0) {
-               pid = getpid();
-               sprintf(tempfile, "LTMP.%d", pid);
-       }
-       if (onelock(pid, tempfile, file) == -1) {
-               /* lock file exists */
-               /* get status to check age of the lock file */
-               ret = stat(file, &stbuf);
-               ASSERT(ret != -1, "LOCK PROBLEM - %s", file);
-
-               time(&ptime);
-               if ((ptime - stbuf.st_ctime) < atime) {
-                       /* file not old enough to delete */
-                       return(FAIL);
-               }
-       
-               ret = unlink(file);
-               ASSERT(ret != -1, "LOCK PROBLEM - %s", file);
-       
-               ret = onelock(pid, tempfile, file);
-               ASSERT(ret == 0, "LOCK PROBLEM - %s", file);
-       }
-       stlock(file);
-       return(0);
-}
-
-
-#define MAXLOCKS 10    /* maximum number of lock files */
-char *Lockfile[MAXLOCKS];
-int Nlocks = 0;
-
-/***
- *     stlock(name)    put name in list of lock files
- *     char *name;
- *
- *     return codes:  none
- */
-
-stlock(name)
-char *name;
-{
-       char *p;
-       extern char *calloc();
-       int i;
-
-       for (i = 0; i < Nlocks; i++) {
-               if (Lockfile[i] == NULL)
-                       break;
-       }
-       ASSERT(i < MAXLOCKS, "TOO MANY LOCKS %d", i);
-       if (i >= Nlocks)
-               i = Nlocks++;
-       p = calloc(strlen(name) + 1, sizeof (char));
-       ASSERT(p != NULL, "CAN NOT ALLOCATE FOR %s", name);
-       strcpy(p, name);
-       Lockfile[i] = p;
-       return;
-}
-
-
-/***
- *     rmlock(name)    remove all lock files in list
- *     char *name;     or name
- *
- *     return codes: none
- */
-
-rmlock(name)
-char *name;
-{
-       int i;
-
-       for (i = 0; i < Nlocks; i++) {
-               if (Lockfile[i] == NULL)
-                       continue;
-               if (name == NULL
-               || strcmp(name, Lockfile[i]) == SAME) {
-                       unlink(Lockfile[i]);
-                       free(Lockfile[i]);
-                       Lockfile[i] = NULL;
-               }
-       }
-       return;
-}
-
-
-/*  this stuff from pjw  */
-/*  /usr/pjw/bin/recover - check pids to remove unnecessary locks */
-/*     isalock(name) returns 0 if the name is a lock */
-/*     unlock(name)  unlocks name if it is a lock*/
-/*     onelock(pid,tempfile,name) makes lock a name
-       on behalf of pid.  Tempfile must be in the same
-       file system as name. */
-/*     lock(pid,tempfile,names) either locks all the
-       names or none of them */
-isalock(name) char *name;
-{
-       struct stat xstat;
-       if(stat(name,&xstat)<0) return(0);
-       if(xstat.st_size!=sizeof(int)) return(0);
-       return(1);
-}
-unlock(name) char *name;
-{
-       if(isalock(name)) return(unlink(name));
-       else return(-1);
-}
-onelock(pid,tempfile,name) char *tempfile,*name;
-{      int fd;
-       fd=creat(tempfile,0444);
-       if(fd<0) return(-1);
-       write(fd,&pid,sizeof(int));
-       close(fd);
-       if(link(tempfile,name)<0)
-       {       unlink(tempfile);
-               return(-1);
-       }
-       unlink(tempfile);
-       return(0);
-}
-lock(pid,tempfile,names) char *tempfile,**names;
-{      int i,j;
-       for(i=0;names[i]!=0;i++)
-       {       if(onelock(pid,tempfile,names[i])==0) continue;
-               for(j=0;j<i;j++) unlink(names[j]);
-               return(-1);
-       }
-       return(0);
-}
-
-#define LOCKPRE "LCK."
-
-/***
- *     delock(s)       remove a lock file
- *     char *s;
- *
- *     return codes:  0  |  FAIL
- */
-
-delock(s)
-char *s;
-{
-       char ln[30];
-
-       sprintf(ln, "%s.%s", LOCKPRE, s);
-       rmlock(ln);
-}
-
-
-/***
- *     mlock(sys)      create system lock
- *     char *sys;
- *
- *     return codes:  0  |  FAIL
- */
-
-mlock(sys)
-char *sys;
-{
-       char lname[30];
-       sprintf(lname, "%s.%s", LOCKPRE, sys);
-       return(ulockf(lname, (time_t) 24*3600 ) < 0 ? FAIL : 0);
-}
-
-
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uuclean.c b/.ref-Research-V7/usr/src/cmd/uucp/uuclean.c
deleted file mode 100644 (file)
index b3842a9..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#include "uucp.h"
-#include "uucpdefs.h"
-#include <signal.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-
-/*******
- *
- *     uuclean  -  this program will search through the spool
- *     directory (Spool) and delete all files with a requested
- *     prefix which are older than (nomtime) seconds.
- *     If the -m option is set, the program will try to
- *     send mail to the usid of the file.
- *
- *     options:
- *             -m  -  send mail for deleted file
- *             -d  -  directory to clean
- *             -n  -  time to age files before delete (in hours)
- *             -p  -  prefix for search
- *             -x  -  turn on debug outputs
- *     exit status:
- *             0  -  normal return
- *             1  -  can not read directory
- */
-
-#define DPREFIX "U"
-#define NOMTIME 72     /* hours to age files before deletion */
-
-main(argc, argv)
-char *argv[];
-{
-       FILE *pdirf;
-       char file[NAMESIZE];
-       time_t nomtime, ptime;
-       struct stat stbuf;
-       int mflg=0;
-       extern int onintr();
-
-       nomtime = NOMTIME * 3600L;
-
-       while (argc>1 && argv[1][0] == '-') {
-               switch (argv[1][1]) {
-               case 'd':
-                       Spool = &argv[1][2];
-                       break;
-               case 'm':
-                       mflg = 1;
-                       break;
-               case 'n':
-                       nomtime = atoi(&argv[1][2]) * 3600L;
-                       break;
-               case 'p':
-                       if (&argv[1][2] != '\0')
-                               stpre(&argv[1][2]);
-                       break;
-               case 'x':
-                       Debug = atoi(&argv[1][2]);
-                       if (Debug <= 0)
-                               Debug = 1;
-                       break;
-               default:
-                       printf("unknown flag %s\n", argv[1]); break;
-               }
-               --argc;  argv++;
-       }
-
-       DEBUG(4, "DEBUG# %s\n", "START");
-       chdir(Spool);
-
-       if ((pdirf = fopen(Spool, "r")) == NULL) {
-               printf("%s directory unreadable\n", Spool);
-               exit(1);
-       }
-
-       time(&ptime);
-       while (gnamef(pdirf, file)) {
-               if (!chkpre(file))
-                       continue;
-
-               if (stat(file, &stbuf) == -1) {
-               DEBUG(4, "stat on %s failed\n", file);
-                       continue;
-               }
-
-
-               if ((stbuf.st_mode & S_IFMT) == S_IFDIR)
-                       continue;
-               if ((ptime - stbuf.st_ctime) < nomtime)
-                       continue;
-               DEBUG(4, "unlink file %s\n", file);
-               unlink(file);
-               if (mflg) sdmail(file, stbuf.st_uid);
-       }
-
-       fclose(pdirf);
-       exit(0);
-}
-
-
-#define MAXPRE 10
-char Pre[MAXPRE][DIRSIZ];
-int Npre = 0;
-/***
- *     chkpre(file)    check for prefix
- *     char *file;
- *
- *     return codes:
- *             0  -  not prefix
- *             1  -  is prefix
- */
-
-chkpre(file)
-char *file;
-{
-       int i;
-
-       for (i = 0; i < Npre; i++) {
-               if (prefix(Pre[i], file))
-                       return(1);
-               }
-       return(0);
-}
-
-/***
- *     stpre(p)        store prefix
- *     char *p;
- *
- *     return codes:  none
- */
-
-stpre(p)
-char *p;
-{
-       if (Npre < MAXPRE - 2)
-               strcpy(Pre[Npre++], p);
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uucp.c b/.ref-Research-V7/usr/src/cmd/uucp/uucp.c
deleted file mode 100644 (file)
index 8463592..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-#include "uucp.h"
-#include "uucpdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/*
- *     uucp
- */
-
-int Uid;
-int Startjob = 1;
-char Path[100], Optns[10];
-char Grade = 'n';
-int Copy = 1;
-
-main(argc, argv)
-char *argv[];
-{
-       int ret;
-       char *sysfile1, *sysfile2, *cp;
-       char file1[MAXFULLNAME], file2[MAXFULLNAME];
-       extern char *index();
-
-       Optns[0] = '-';
-       Optns[1] = '\0';
-       while(argc>1 && argv[1][0] == '-'){
-               switch(argv[1][1]){
-               case 'c':
-                       Copy = 0;
-                       break;
-               case 'd':
-                       strcat(Optns, "d");
-                       break;
-               case 'e':
-                       fprintf(stderr, "-e option removed\n");
-                       break;
-               case 'g':
-                       Grade = argv[1][2]; break;
-               case 'm':
-                       strcat(Optns, "m");
-                       break;
-               case 'r':
-                       Startjob = 0;
-                       break;
-               case 's':
-                       Spool = &argv[1][2]; break;
-               case 'x':
-                       Debug = atoi(&argv[1][2]);
-                       if (Debug <= 0)
-                               Debug = 1;
-                       break;
-               default:
-                       printf("unknown flag %s\n", argv[1]); break;
-               }
-               --argc;  argv++;
-       }
-       DEBUG(4, "\n\n** %s **\n", "START");
-       ret = gwd(Wrkdir);
-       ASSERT(ret == 0, "GWD FAILED %d", ret);
-       chdir(Spool);
-
-       Uid = getuid();
-       ret = guinfo(Uid, User, Path);
-       ASSERT(ret == 0, "CAN NOT FIND UID %d\n", Uid);
-       DEBUG(4, "UID %d, ", Uid);
-       DEBUG(4, "User %s,", User);
-       DEBUG(4, "PATH %s\n", Path);
-       if (argc < 3) {
-               fprintf(stderr, "usage uucp from ... to\n");
-               cleanup(0);
-       }
-
-
-       /*  set up "to" system and file names  */
-       if ((cp = index(argv[argc - 1], '!')) != NULL) {
-               sysfile2 = argv[argc - 1];
-               *cp = '\0';
-               if (*sysfile2 == '\0')
-                       sysfile2 = Myname;
-               else
-                       sprintf(Rmtname, "%.7s", sysfile2);
-               if (versys(sysfile2) != 0) {
-                       fprintf(stderr, "bad system name: %s\n", sysfile2);
-                       cleanup(0);
-               }
-               strcpy(file2, cp + 1);
-       }
-       else {
-               sysfile2 = Myname;
-               strcpy(file2, argv[argc - 1]);
-       }
-
-
-       /*  do each from argument  */
-       while (argc > 2) {
-               if ((cp = index(argv[1], '!')) != NULL) {
-                       sysfile1 = argv[1];
-                       *cp = '\0';
-                       if (*sysfile1 == '\0')
-                               sysfile1 = Myname;
-                       else
-                               sprintf(Rmtname, "%.7s", sysfile1);
-                       if (versys(sysfile1) != 0) {
-                               fprintf(stderr, "bad system name: %s\n", sysfile1);
-                               cleanup(0);
-                       }
-                       strcpy(file1, cp + 1);
-               }
-               else {
-                       sysfile1 = Myname;
-                       strcpy(file1, argv[1]);
-               }
-               DEBUG(4, "file1 - %s\n", file1);
-               copy(sysfile1, file1, sysfile2, file2);
-               --argc;
-               argv++;
-       }
-
-       if (Startjob)
-               xuucico("");
-       cleanup(0);
-}
-
-cleanup(code)
-int code;
-{
-       logcls();
-       rmlock(NULL);
-       exit(code);
-}
-
-
-/***
- *     copy(s1, f1, s2, f2)    generate copy files
- *     char *s1, *f1, *s2, *f2;
- *
- *     return codes 0  |  FAIL
- */
-
-copy(s1, f1, s2, f2)
-char *s1, *f1, *s2, *f2;
-{
-       int ret, type;
-       struct stat stbuf;
-       char cfile[NAMESIZE], dfile[NAMESIZE];
-       char file1[MAXFULLNAME], file2[MAXFULLNAME];
-       FILE *cfp;
-       extern char *index();
-
-       type = 0;
-       strcpy(file1, f1);
-       strcpy(file2, f2);
-       if (strcmp(s1, Myname) != SAME)
-               type = 1;
-       if (strcmp(s2, Myname) != SAME)
-               type += 2;
-       if (type & 01)
-               if ((index(file1, '*') != NULL
-                 || index(file1, '?') != NULL
-                 || index(file1, '[') != NULL))
-                       type = 4;
-       switch (type) {
-       case 0:
-               /* all work here */
-               DEBUG(4, "all work here %d\n", type);
-               expfile(file1);
-               expfile(file2);
-               if (chkpth(User, "", file1) != 0
-               || chkpth(User, "", file2) != 0) {
-                       fprintf(stderr, "permission denied\n");
-                       cleanup(1);
-               }
-               xcp(file1, file2);
-               logent("WORK HERE", "DONE");
-               return(0);
-       case 1:
-               /* receive file */
-               DEBUG(4, "receive file - %d\n", type);
-               if (file1[0] != '~')
-                       expfile(file1);
-               expfile(file2);
-               if (chkpth(User, "", file2) != 0) {
-                       fprintf(stderr, "permission denied\n");
-                       return(FAIL);
-               }
-               gename(CMDPRE, s1, Grade, cfile);
-               strcpy(dfile, cfile);
-               dfile[0] = DATAPRE;
-               cfp = fopen(cfile, "w");
-               ASSERT(cfp != NULL, "CAN NOT OPEN %s", cfile);
-               fprintf(cfp, "R %s %s %s %s\n", file1, file2, User, Optns);
-               fclose(cfp);
-               break;
-       case 2:
-               /* send file */
-               expfile(file1);
-               if (file2[0] != '~')
-                       expfile(file2);
-               DEBUG(4, "send file - %d\n", type);
-
-               gename(CMDPRE, s2, Grade, cfile);
-               strcpy(dfile, cfile);
-               dfile[0] = DATAPRE;
-               if (chkpth(User, "", file1) != 0) {
-                       fprintf(stderr, "permission denied %s\n", file1);
-                       return(FAIL);
-               }
-               ret = stat(file1, &stbuf);
-               if ((stbuf.st_mode & S_IFMT) == S_IFDIR) {
-                       fprintf(stderr, "directory name illegal - %s\n",
-                         file1);
-                       return(FAIL);
-               }
-               if (Copy) {
-                       if (xcp(file1, dfile) != 0) {
-                               fprintf(stderr, "can't copy %s\n", file1);
-                               return(FAIL);
-                       }
-                       chmod(dfile, 0666);
-               }
-               else {
-                       if ((stbuf.st_mode & 04) == 0) {
-                               fprintf(stderr, "uucico can't access %s (-c specified)\n", file1);
-                               return(FAIL);
-                       }
-               }
-               cfp = fopen(cfile, "w");
-               ASSERT(cfp != NULL, "CAN NOT OPEN %s", cfile);
-               chmod(cfile, 0200);
-               fprintf(cfp, "S %s %s %s %s %s %o\n", file1, file2,
-                       User, Optns, dfile, stbuf.st_mode & 0777);
-               fclose(cfp);
-               chmod(cfile, 0666);
-               break;
-       case 3:
-       case 4:
-               /*  send uucp command for execution on s2  */
-               DEBUG(4, "send uucp command - %d\n", type);
-               if (strcmp(s2,  Myname) == SAME) {
-                       expfile(file2);
-                       if (chkpth(User, "", file2) != 0) {
-                               fprintf(stderr, "permission denied\n");
-                               return(FAIL);
-                       }
-               }
-               gename(CMDPRE, s1, Grade, cfile);
-               cfp = fopen(cfile, "w");
-               ASSERT(cfp != NULL, "CAN NOT OPEN %s", cfile);
-               fprintf(cfp, "X %s %s!%s\n", file1, s2, file2);
-               fclose(cfp);
-               break;
-       }
-       logent(cfile, "QUEUED");
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uucp.h b/.ref-Research-V7/usr/src/cmd/uucp/uucp.h
deleted file mode 100644 (file)
index 599c03d..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-#include "stdio.h"
-       /*  some system names  */
-#define MYNAME         "myname"
-
-#define THISDIR                "/usr/lib/uucp"
-#define SQFILE         "/usr/lib/uucp/SQFILE"
-#define SQTMP          "/usr/lib/uucp/SQTMP"
-#define SYSFILE                "/usr/lib/uucp/L.sys"
-#define SYSFILECR      "/usr/lib/uucp/L.sys.cr"
-#define DEVFILE                "/usr/lib/uucp/L-devices"
-#define DIALFILE       "/usr/lib/uucp/L-dialcodes"
-#define USERFILE       "/usr/lib/uucp/USERFILE"
-
-#define SPOOL          "/usr/spool/uucp"
-#define LOGDIR         "/usr/spool/uucp"
-#define SEQFILE                "/usr/spool/uucp/SEQF"
-#define SQLOCK         "/usr/spool/uucp/LCK.SQ"
-#define SYSLOG         "/usr/spool/uucp/SYSLOG"
-#define XQTDIR         "/usr/spool/uucp/.XQTDIR"
-
-#define SEQLOCK                "LCK.SEQL"
-#define CMDPRE         'C'
-#define DATAPRE                'D'
-#define XQTPRE         'X'
-
-#define LOGPREFIX      "LOG."
-#define LOGLOCK        "/usr/spool/uucp/LCK.LOG"
-#define LOGFILE        "/usr/spool/uucp/LOGFILE"
-
-#define RMTDEBUG       "AUDIT"
-#define SQTIME         60L
-
-#define DEBUG(l, f, s) if (Debug >= l) fprintf(stderr, f, s)
-
-#define ASSERT(e, f, v) if (!(e)) {\
-fprintf(stderr, "AERROR - (%s) ", "e");\
-fprintf(stderr, f, v);\
-cleanup(FAIL);};
-
-#define FMV(p, n) close(n); dup(p[n]); close(p[n]);
-
-#define SAME 0
-#define FAIL -1
-#define SUCCESS 0
-#define MASTER 1
-#define SLAVE 0
-#define MAXFULLNAME 100
-#define MAXMSGTIME 45
-#define MAXCHARTIME 15
-#define NAMESIZE 15
-#define ACULAST "-<"
-#define EOTMSG "\004\n\004\n"
-#define CALLBACK 1
-#define LINKLEVEL 1
-
-       /*  commands  */
-#define SHELL          "/bin/sh"
-#define MAIL           "mail"
-#define UUCICO         "/usr/lib/uucp/uucico"
-#define UUXQT          "/usr/lib/uucp/uuxqt"
-#define UUCP           "usr/lib/uucp/uucp"
-
-
-       /*  call connect fail stuff  */
-#define CF_SYSTEM      -1
-#define CF_TIME                -2
-#define CF_LOCK                -3
-#define CF_DIAL                -5
-#define CF_LOGIN       -6
-
-       /*  system status stuff  */
-#define SS_OK          0
-#define SS_FAIL                4
-#define SS_NODEVICE    1
-#define SS_CALLBACK    2
-#define SS_INPROGRESS  3
-#define SS_BADSEQ      5
-
-       /*  fail/retry parameters  */
-#define RETRYTIME 3300L
-#define INPROGTIME 7200L
-#define MAXRECALLS 10
-
-       /*  stuff for command execution  */
-#define X_RQDFILE      'F'
-#define X_STDIN                'I'
-#define X_STDOUT       'O'
-#define X_CMD          'C'
-#define X_USER         'U'
-#define X_SENDFILE     'S'
-#define X_LOCK         "LCK.XQT"
-#define X_LOCKTIME     3600L
-
-int Ifn, Ofn;
-char Rmtname[10];
-char User[10];
-char Loginuser[10];
-char *Thisdir;
-char *Spool;
-char *Myname;
-char *Sysfiles[];
-char *Devfile;
-char *Dialfile;
-int Debug;
-int Pkdebug;
-int Pkdrvon;
-int Bspeed;
-
-       /* the define geteuid should be deleted if the */
-       /* routine is available in the libc.a library. */
-#define geteuid getuid
-
-#define WKDSIZE        100     /*  size of work dir name  */
-char Wrkdir[WKDSIZE];
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uucpdefs.h b/.ref-Research-V7/usr/src/cmd/uucp/uucpdefs.h
deleted file mode 100644 (file)
index 61bb956..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-char *Thisdir = THISDIR;
-char *Spool = SPOOL;
-char *Myname = MYNAME;
-int Debug = 0;
-int Pkdebug = 0;
-
-char *Sysfiles[] = {
-       SYSFILE,
-       SYSFILECR,
-       NULL
-};
-char *Devfile = DEVFILE;
-char *Dialfile = DIALFILE;
-int Packflg = 0;
-int Pkdrvon = 0;
-int Bspeed = 150;
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uulog.c b/.ref-Research-V7/usr/src/cmd/uucp/uulog.c
deleted file mode 100644 (file)
index 6561a4b..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-#include "uucp.h"
-#include "uucpdefs.h"
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-
-int Stop = 0;
-
-/*******
- *
- *     uulog  -  this program will append all update files in
- *     directory (LOGDIR) to the log file (logf) and remove the
- *     update files.
- *
- *     options:
- *             -n  -  nominal time for delete of lock file
- *             -s  -  system name for search
- *             -u  -  user name for search
- *             -x  -  turn on debug outputs
- *
- *     exit codes:
- *             0  -  normal
- *             1  -  lock file problems
- *
- */
-
-
-#define NOMTIME 3600L
-
-
-main(argc, argv)
-char *argv[];
-{
-       FILE *plogf, *lsp;
-       char filename[NAMESIZE];
-       time_t nomtime;
-       char *system, *user;
-
-       extern int onintr(), intr1();
-       char buf[BUFSIZ], u[20], s[20];
-
-       nomtime = NOMTIME;
-       system = user = NULL;
-
-
-       while (argc>1 && argv[1][0] == '-') {
-               switch (argv[1][1]) {
-               case 'd':
-                       printf("-d option removed\n");
-                       break;
-               case 'n':
-                       nomtime = atoi(&argv[1][2]); break;
-               case 's':
-                       system = &argv[1][2];
-                       break;
-               case 'u':
-                       user = &argv[1][2];
-                       break;
-               case 'x':
-                       Debug = atoi(&argv[1][2]);
-                       if (Debug <= 0)
-                               Debug = 1;
-                       break;
-               default:
-                       printf("unknown flag %s\n", argv[1]); break;
-               }
-               --argc;  argv++;
-       }
-
-       DEBUG(4, "%s\n", "START");
-       chdir(LOGDIR);
-       if (ulockf(LOGLOCK, nomtime) != 0)
-               exit(0);
-       signal(SIGHUP, intr1);
-       signal(SIGINT,intr1);
-       signal(SIGQUIT, intr1);
-
-       if ((plogf = fopen(LOGFILE, "a")) == NULL) {
-               rmlock(LOGLOCK);
-               printf("can't open %s\n", LOGFILE);
-               exit(0);
-       }
-       lsp = fopen(LOGDIR, "r");
-       ASSERT(lsp != NULL, "CAN NOT OPEN %s", LOGDIR);
-       while ((gnamef(lsp, filename)) != 0) {
-               DEBUG(4, "file-%s\n", filename);
-               if (prefix(LOGPREFIX, filename)) {
-                       DEBUG(4, "copy file %s\n", filename);
-                       if (appendf(plogf, filename) == SUCCESS) {
-                               unlink(filename);
-                       }
-               }
-       }
-       fclose(lsp);
-       fclose(plogf);
-       chmod(LOGFILE, 0666);
-       rmlock(NULL);
-       if (user == NULL && system == NULL)
-               exit(0);
-       if (Stop)
-               exit(0);
-       signal(SIGHUP, onintr);
-       signal(SIGINT, onintr);
-       signal(SIGQUIT, onintr);
-
-       plogf = fopen(LOGFILE, "r");
-       ASSERT(plogf != NULL, "CAN NOT OPEN %s", LOGFILE);
-       while (fgets(buf, BUFSIZ, plogf) != NULL) {
-               sscanf(buf, "%s%s", u, s);
-               DEBUG(4, "u s %s ", u);
-               DEBUG(4, "%s  ", s);
-               DEBUG(4, "%s", buf);
-               if (user != NULL && !prefix(user, u))
-                       continue;
-               if (system != NULL && !prefix(system, s))
-                       continue;
-               fputs(buf, stdout);
-       }
-       exit(0);
-}
-
-
-
-
-/***
- *     onintr()
- *
- *     onintr  -  interrupt routine
- *             remove lock file
- *
- */
-
-onintr()
-{
-       rmlock(NULL);
-       exit(0);
-}
-
-
-intr1()
-{
-       signal(SIGINT, intr1);
-       signal(SIGHUP, intr1);
-       signal(SIGQUIT, intr1);
-       Stop = 1;
-       return;
-}
-
-cleanup(code)
-int code;
-{
-       exit(code);
-}
-
-
-/*******
- *     appendf(fp, entryf)     append file (entryf) to fp file
- *     FILE *fp;
- *     char *entryf;
- *
- *     return codes:
-               SUCCESS - ok
- *             FAIL - file not readable
- */
-
-appendf(fp, entryf)
-FILE *fp;
-char *entryf;
-{
-       FILE *pentryf;
-       char ltext[513];
-
-       if ((pentryf = fopen(entryf, "r")) == NULL) {
-               /* file entryf not readable */
-               return(FAIL);
-       }
-       while (fgets(ltext, 512, pentryf)) fputs(ltext, fp);
-       fclose(pentryf);
-       return(SUCCESS);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uurecover.c b/.ref-Research-V7/usr/src/cmd/uucp/uurecover.c
deleted file mode 100644 (file)
index 31c9f0c..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#include <stdio.h>
-#include <a.out.h>
-#include <param.h>
-#include <proc.h>
-#include <sys/stat.h>
-struct stat xstat;
-struct proc mproc[NPROC];
-struct nlist nl[]
-{      { "_proc"},
-       { ""},
-};
-int err;
-main(argc,argv) char **argv;
-{      int i,j;
-       if(argc<=1) exit(0);
-       for(i=1;i<argc;i++)
-       {       if((j=isalock(argv[i]))>0)
-                       if(isapid(j))
-                       {       fprintf(stderr,"recovery: %s in use\n",argv[i]);
-                               err=1;
-                       }
-                       else    unlink(argv[i]);
-               else    fprintf(stderr,"reocvery: %s not a lock\n",argv[i]);
-       }
-       exit(err);
-}
-isalock(s) char *s;
-{      int pid,fd;
-       if(stat(s,&xstat)<0) return(0);
-       if(xstat.st_size!=2) return(0);
-       fd=open(s,0);
-       if(fd<0) return(-1);
-       read(fd,&pid,2);
-       close(fd);
-       return(pid);
-}
-int gotpids,pids[NPROC];
-isapid(n)
-{      int i;
-       if(gotpids==0) getpids();
-       for(i=0;i<NPROC;i++)
-               if(n==pids[i]) return(1);
-       return(0);
-}
-getpids()
-{      int i,mem;
-       nlist("/unix",nl);
-       if(nl[0].n_type==0)
-       {       fprintf(stderr,"no namelist, no lock recovery\n");
-               exit(1);
-       }
-       mem=open("/dev/mem",0);
-       lseek(mem,(long)nl[0].n_value,0);
-       read(mem,mproc,sizeof(mproc));
-       if(mproc[0].p_pid != 0)
-       {       fprintf(stderr,"/unix not loaded, no lock recovery\n");
-               exit(1);
-       }
-       for(i=0;i<NPROC;i++)
-       {       if(mproc[i].p_stat==0 ||
-                       mproc[i].p_stat==SZOMB)
-                       pids[i]=0;
-               else    pids[i]=mproc[i].p_pid;
-       }
-       gotpids=1;
-}
-unlock(s) char *s;
-{
-       unlink(s);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uux.c b/.ref-Research-V7/usr/src/cmd/uucp/uux.c
deleted file mode 100644 (file)
index 6f8bc98..0000000
+++ /dev/null
@@ -1,327 +0,0 @@
-#include "uucp.h"
-#include "uucpdefs.h"
-
-#define NOSYSPART 0
-#define HASSYSPART 1
-
-#define APPCMD(d) {\
-char *p;\
-for (p = d; *p != '\0';) *cmdp++ = *p++;\
-*cmdp++ = ' ';\
-*cmdp = '\0';}
-
-#define GENSEND(f, a, b, c, d) {\
-fprintf(f, "S %s %s %s - %s 0666\n", a, b, c, d);\
-}
-#define GENRCV(f, a, b, c) {\
-fprintf(f, "R %s %s %s - \n", a, b, c);\
-}
-/*
- *     
- */
-
-main(argc, argv)
-char *argv[];
-{
-       char cfile[NAMESIZE];   /* send commands for files from here */
-       char dfile[NAMESIZE];   /* used for all data files from here */
-       char rxfile[NAMESIZE];  /* to be sent to xqt file (X. ...) */
-       char tfile[NAMESIZE];   /* temporary file name */
-       char tcfile[NAMESIZE];  /* temporary file name */
-       char t2file[NAMESIZE];  /* temporary file name */
-       int cflag = 0;          /*  commands in C. file flag  */
-       int rflag = 0;          /*  C. files for receiving flag  */
-       char buf[BUFSIZ];
-       char inargs[BUFSIZ];
-       int pipein = 0;
-       int startjob = 1;
-       char path[MAXFULLNAME];
-       char cmd[BUFSIZ];
-       char *ap, *cmdp;
-       char prm[BUFSIZ];
-       char syspart[8], rest[MAXFULLNAME];
-       char xsys[8], local[8];
-       FILE *fprx, *fpc, *fpd, *fp;
-       FILE *xqtstr();
-       extern char *getprm(), *index(), *lastpart();
-       int uid, ret;
-       char redir = '\0';
-
-       Debug = 0;
-       Ofn = 1;
-       Ifn = 0;
-       while (argc>1 && argv[1][0] == '-') {
-               switch(argv[1][1]){
-               case 'p':
-               case '\0':
-                       pipein = 1;
-                       break;
-               case 'r':
-                       startjob = 0;
-                       break;
-               case 'x':
-                       Debug = atoi(&argv[1][2]);
-                       if (Debug <= 0)
-                               Debug = 1;
-                       break;
-               default:
-                       sprintf(stderr, "unknown flag %s\n", argv[1]);
-                               break;
-               }
-               --argc;  argv++;
-       }
-
-       DEBUG(4, "\n\n** %s **\n", "START");
-
-       inargs[0] = '\0';
-       for (argv++; argc > 1; argc--) {
-               DEBUG(4, "arg - %s:", *argv);
-               strcat(inargs, " ");
-               strcat(inargs, *argv++);
-       }
-       DEBUG(4, "arg - %s\n", inargs);
-       ret = gwd(Wrkdir);
-       ASSERT(ret == 0, "GWD FAILED %d", ret);
-       chdir(Spool);
-       uid = getuid();
-       guinfo(uid, User, path);
-
-       sprintf(local, "%.7s", Myname);
-       cmdp = cmd;
-       *cmdp = '\0';
-       gename(DATAPRE, local, 'X', rxfile);
-       fprx = fopen(rxfile, "w");
-       ASSERT(fprx != NULL, "CAN'T OPEN %s", rxfile);
-       chmod(rxfile, 0666);
-       gename(DATAPRE, local, 'T', tcfile);
-       fpc = fopen(tcfile, "w");
-       ASSERT(fpc != NULL, "CAN'T OPEN %s", tcfile);
-       chmod(tcfile, 0666);
-       fprintf(fprx, "%c %s %s\n", X_USER, User, local);
-
-       /* find remote system name */
-       ap = inargs;
-       while ((ap = getprm(ap, prm)) != NULL) {
-               if (prm[0] == '>' || prm[0] == '<') {
-                       ap = getprm(ap, prm);
-                       continue;
-               }
-
-               if (prm[0] == ';') {
-                       APPCMD(prm);
-                       continue;
-               }
-
-               split(prm, xsys, rest);
-               if (xsys[0] == '\0')
-                       strcpy(xsys, local);
-               break;
-       }
-       DEBUG(4, "xsys %s\n", xsys);
-       if (versys(xsys) != 0) {
-               /*  bad system name  */
-               fprintf(stderr, "bad system name: %s\n", xsys);
-               fclose(fprx);
-               fclose(fpc);
-               unlink(rxfile);
-               unlink(tcfile);
-               cleanup(101);
-       }
-
-       if (pipein) {
-               gename(DATAPRE, xsys, 'B', dfile);
-               fpd = fopen(dfile, "w");
-               ASSERT(fpd != NULL, "CAN'T OPEN %s", dfile);
-               chmod(dfile, 0666);
-               while (fgets(buf, BUFSIZ, stdin) != NULL)
-                       fputs(buf, fpd);
-               fclose(fpd);
-               if (strcmp(local, xsys) != SAME) {
-                       GENSEND(fpc, dfile, dfile, User, dfile);
-                       cflag++;
-               }
-               fprintf(fprx, "%c %s\n", X_RQDFILE, dfile);
-               fprintf(fprx, "%c %s\n", X_STDIN, dfile);
-       }
-       /* parse command */
-       ap = inargs;
-       while ((ap = getprm(ap, prm)) != NULL) {
-               DEBUG(4, "prm - %s\n", prm);
-               if (prm[0] == '>' || prm[0] == '<') {
-                       redir = prm[0];
-                       continue;
-               }
-
-               if (prm[0] == '|' || prm[0] == '^') {
-                       if (cmdp != cmd)
-                               APPCMD(prm);
-                       continue;
-               }
-
-               /* process command or file or option */
-               ret = split(prm, syspart, rest);
-               DEBUG(4, "s - %s, ", syspart);
-               DEBUG(4, "r - %s, ", rest);
-               DEBUG(4, "ret - %d\n", ret);
-               if (syspart[0] == '\0')
-                       strcpy(syspart, local);
-
-               if (cmdp == cmd && redir == '\0') {
-                       /* command */
-                       APPCMD(rest);
-                       continue;
-               }
-
-               /* process file or option */
-               DEBUG(4, "file s- %s, ", syspart);
-               DEBUG(4, "local - %s\n", local);
-               /* process file */
-               if (redir == '>') {
-                       if (rest[0] != '~')
-                               expfile(rest);
-                       fprintf(fprx, "%c %s %s\n", X_STDOUT, rest,
-                        syspart);
-                       redir = '\0';
-                       continue;
-               }
-
-               if (ret == NOSYSPART) {
-                       /* option */
-                       APPCMD(rest);
-                       continue;
-               }
-
-               if (strcmp(xsys, local) == SAME
-                && strcmp(xsys, syspart) == SAME) {
-                       expfile(rest);
-                       if (redir == '<')
-                               fprintf(fprx, "%c %s\n", X_STDIN, rest);
-                       else
-                               APPCMD(rest);
-                       redir = '\0';
-                       continue;
-               }
-
-               if (strcmp(syspart, local) == SAME) {
-                       /*  generate send file */
-                       expfile(rest);
-                       gename(DATAPRE, xsys, 'A', dfile);
-                       if (redir == '<') {
-                               fprintf(fprx, "%c %s\n", X_STDIN, dfile);
-                       }
-                       DEBUG(4, "rest %s\n", rest);
-                       if (chkpth(User, "", rest) != 0) {
-                               fprintf(stderr, "permission denied %s\n", rest);
-                               cleanup(1);
-                       }
-                       if (xcp(rest, dfile) != 0)
-                               cleanup(1);
-                       GENSEND(fpc, rest, dfile, User, dfile);
-                       cflag++;
-                       fprintf(fprx, "%c %s %s\n", X_RQDFILE,
-                        dfile, lastpart(rest));
-                       if (redir != '<')
-                               APPCMD(lastpart(rest));
-                       redir = '\0';
-                       continue;
-               }
-
-               if (strcmp(local, xsys) == SAME) {
-                       /*  generate local receive  */
-                       gename(CMDPRE, syspart, 'R', tfile);
-                       strcpy(dfile, tfile);
-                       dfile[0] = DATAPRE;
-                       fp = fopen(tfile, "w");
-                       ASSERT(fp != NULL, "CAN'T OPEN %s", tfile);
-                       chmod(tfile, 0666);
-                       expfile(rest);
-                       GENRCV(fp, rest, dfile, User);
-                       fclose(fp);
-                       rflag++;
-                       fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile,
-                         lastpart(rest));
-                       if (rest[0] != '~')
-                               expfile(rest);
-                       if (redir == '<')
-                               fprintf(fprx, "%c %s\n", X_STDIN, dfile);
-                       else
-                               APPCMD(lastpart(rest));
-                       redir = '\0';
-                       continue;
-               }
-
-               if (strcmp(syspart, xsys) != SAME) {
-                       /* generate remote receives */
-                       gename(DATAPRE, syspart, 'R', dfile);
-                       strcpy(tfile, dfile);
-                       tfile[0] = CMDPRE;
-                       fpd = fopen(dfile, "w");
-                       ASSERT(fpd != NULL, "CAN'T OPEN %s", dfile);
-                       chmod(dfile, 0666);
-                       gename(DATAPRE, xsys, 'T', t2file);
-                       GENRCV(fpd, rest, t2file, User);
-                       fclose(fpd);
-                       GENSEND(fpc, dfile, tfile, User, dfile);
-                       cflag++;
-                       fprintf(fprx, "%c %s %s\n", X_RQDFILE, t2file,
-                         lastpart(rest));
-                       if (redir == '<')
-                               fprintf(fprx, "%c %s\n", X_STDIN, t2file);
-                       else
-                               APPCMD(lastpart(rest));
-                       redir = '\0';
-                       continue;
-               }
-
-               /* file on remote system */
-               if (rest[0] != '~')
-                       expfile(rest);
-               if (redir == '<')
-                       fprintf(fprx, "%c %s\n", X_STDIN, rest);
-               else
-                       APPCMD(rest);
-               redir = '\0';
-               continue;
-
-       }
-
-       fprintf(fprx, "%c %s\n", X_CMD, cmd);
-       fclose(fprx);
-
-       strcpy(tfile, rxfile);
-       tfile[0] = XQTPRE;
-       if (strcmp(xsys, local) == SAME) {
-               link(rxfile, tfile);
-               unlink(rxfile);
-               if (startjob)
-                       if (rflag)
-                               xuucico("");
-                       else
-                               xuuxqt();
-       }
-       else {
-               GENSEND(fpc, rxfile, tfile, User, rxfile);
-               cflag++;
-       }
-
-       fclose(fpc);
-       if (cflag) {
-               gename(CMDPRE, xsys, 'A', cfile);
-               link(tcfile, cfile);
-               unlink(tcfile);
-               if (startjob)
-                       xuucico(xsys);
-               cleanup(0);
-       }
-       else
-               unlink(tcfile);
-}
-
-
-cleanup(code)
-int code;
-{
-       rmlock(NULL);
-       DEBUG(1, "exit code %d\n", code);
-       exit(code);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/uuxqt.c b/.ref-Research-V7/usr/src/cmd/uucp/uuxqt.c
deleted file mode 100644 (file)
index 4d5f3b4..0000000
+++ /dev/null
@@ -1,374 +0,0 @@
-#include "uucp.h"
-#include "uucpdefs.h"
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-
-#define APPCMD(d) {\
-char *p;\
-for (p = d; *p != '\0';) *cmdp++ = *p++;\
-*cmdp++ = ' ';\
-*cmdp = '\0';}
-
-/*
- *     uuxqt will execute commands set up by a uux command,
- *     usually from a remote machine - set by uucp.
- */
-
-char *Cmds[] = {
-       "mail",
-       "rmail",
-       "lpr",
-       "opr",
-       "fsend",
-       "fget",
-       NULL
-       };
-#define CMDOK(a, b)    cmdok(a,b)
-#define PATH   "PATH=/bin:/usr/bin;"
-/*  to remove restrictions from uuxqt
- *  redefine CMDOK 0
- *
- *  to add allowable commands, add to the list under Cmds[]
- */
-
-main(argc, argv)
-char *argv[];
-{
-       char xcmd[100];
-       int cmdnok;
-       char xfile[MAXFULLNAME], user[10], buf[BUFSIZ];
-       char lbuf[30];
-       char cfile[NAMESIZE], dfile[MAXFULLNAME];
-       char file[NAMESIZE];
-       char fin[MAXFULLNAME], sysout[NAMESIZE], fout[MAXFULLNAME];
-       FILE *xfp, *dfp, *fp;
-       char path[MAXFULLNAME];
-       char cmd[BUFSIZ];
-       char *cmdp, prm[MAXFULLNAME], *ptr;
-       char *getprm();
-       int uid, ret;
-       int stcico = 0;
-       Debug = 0;
-       Ofn = 1;
-       Ifn = 0;
-       while (argc>1 && argv[1][0] == '-') {
-               switch(argv[1][1]){
-               case 'x':
-                       Debug = atoi(&argv[1][2]);
-                       if (Debug <= 0)
-                               Debug = 1;
-                       break;
-               default:
-                       sprintf(stderr, "unknown flag %s\n", argv[1]);
-                               break;
-               }
-               --argc;  argv++;
-       }
-
-       DEBUG(4, "\n\n** %s **\n", "START");
-       chdir(Spool);
-       strcpy(Wrkdir, Spool);
-       uid = getuid();
-       guinfo(uid, User, path);
-       DEBUG(4, "User - %s\n", User);
-       if (ulockf(X_LOCK, X_LOCKTIME) != 0)
-               exit(0);
-
-       DEBUG(4, "process %s\n", "");
-       while (gtxfile(xfile) > 0) {
-               DEBUG(4, "xfile - %s\n", xfile);
-
-               xfp = fopen(xfile, "r");
-               ASSERT(xfp != NULL, "CAN'T OPEN %s", xfile);
-
-               /*  initialize to default  */
-               strcpy(user, User);
-               strcpy(fin, "/dev/null");
-               strcpy(fout, "/dev/null");
-               sprintf(sysout, "%.7s", Myname);
-               while (fgets(buf, BUFSIZ, xfp) != NULL) {
-                       switch (buf[0]) {
-                       case X_USER:
-                               sscanf(&buf[1], "%s%s", user, Rmtname);
-                               break;
-                       case X_STDIN:
-                               sscanf(&buf[1], "%s", fin);
-                               expfile(fin);
-                               break;
-                       case X_STDOUT:
-                               sscanf(&buf[1], "%s%s", fout, sysout);
-                               sysout[7] = '\0';
-                               if (fout[0] != '~' || prefix(sysout, Myname))
-                                       expfile(fout);
-                               break;
-                       case X_CMD:
-                               strcpy(cmd, &buf[2]);
-                               if (*(cmd + strlen(cmd) - 1) == '\n')
-                                       *(cmd + strlen(cmd) - 1) = '\0';
-                               break;
-                       default:
-                               break;
-                       }
-               }
-
-               fclose(xfp);
-               DEBUG(4, "fin - %s, ", fin);
-               DEBUG(4, "fout - %s, ", fout);
-               DEBUG(4, "sysout - %s, ", sysout);
-               DEBUG(4, "user - %s\n", user);
-               DEBUG(4, "cmd - %s\n", cmd);
-
-               /*  command execution  */
-               if (strcmp(fout, "/dev/null") == SAME)
-                       strcpy(dfile,"/dev/null");
-               else
-                       gename(DATAPRE, sysout, 'O', dfile);
-
-               /* expand file names where necessary */
-               expfile(dfile);
-               strcpy(buf, PATH);
-               cmdp = buf + strlen(buf);
-               ptr = cmd;
-               xcmd[0] = '\0';
-               cmdnok = 0;
-               while ((ptr = getprm(ptr, prm)) != NULL) {
-                       if (prm[0] == ';' || prm[0] == '^'
-                         || prm[0] == '|') {
-                               xcmd[0] = '\0';
-                               APPCMD(prm);
-                               continue;
-                       }
-                       if ((cmdnok = CMDOK(xcmd, prm)) != 0) 
-                               /*  command not valid  */
-                               break;
-
-                       if (prm[0] == '~')
-                               expfile(prm);
-                       APPCMD(prm);
-               }
-               if (cmdnok) {
-                       sprintf(lbuf, "%s XQT DENIED", user);
-                       logent(cmd, lbuf);
-                       DEBUG(4, "bad command %s\n", prm);
-                       goto rmfiles;
-               }
-               sprintf(lbuf, "%s XQT", user);
-               logent(buf, lbuf);
-               DEBUG(4, "cmd %s\n", buf);
-
-               mvxfiles(xfile);
-               chdir(XQTDIR);
-               ret = shio(buf, fin, dfile, user);
-               DEBUG(4, "exit cmd - %d\n", ret);
-               chdir(Spool);
-               rmxfiles(xfile);
-               if (ret != 0) {
-                       /*  exit status not zero */
-                       dfp = fopen(dfile, "a");
-                       ASSERT(dfp != NULL, "CAN'T OPEN %s", dfile);
-                       fprintf(dfp, "exit status %d", ret);
-                       fclose(dfp);
-               }
-               if (strcmp(fout, "/dev/null") != SAME) {
-                       if (prefix(sysout, Myname)) {
-                               xmv(dfile, fout);
-                       }
-                       else {
-                               gename(CMDPRE, sysout, 'O', cfile);
-                               fp = fopen(cfile, "w");
-                               ASSERT(fp != NULL, "OPEN %s", cfile);
-                               chmod(cfile, 0666);
-                               fprintf(fp, "S %s %s %s - %s 0666\n",
-                               dfile, fout, user, lastpart(dfile));
-                               fclose(fp);
-                       }
-               }
-       rmfiles:
-               xfp = fopen(xfile, "r");
-               ASSERT(xfp != NULL, "CAN'T OPEN %s", xfile);
-               while (fgets(buf, BUFSIZ, xfp) != NULL) {
-                       if (buf[0] != X_RQDFILE)
-                               continue;
-                       sscanf(&buf[1], "%s", file);
-                       unlink(file);
-               }
-               unlink(xfile);
-       }
-
-       if (stcico)
-               xuucico("");
-       cleanup(0);
-}
-
-
-cleanup(code)
-int code;
-{
-       logcls();
-       rmlock(NULL);
-       exit(code);
-}
-
-
-/*******
- *     gtxfile(file)   get a file to execute
- *     char *file;
- *
- *     return codes:  0 - no file  |  1 - file to execute
- */
-
-gtxfile(file)
-char *file;
-{
-       static FILE *pdir;
-       char pre[2];
-
-       if (pdir == NULL) {
-               pdir = fopen(Spool, "r");
-               ASSERT(pdir != NULL, "GTXFILE CAN'T OPEN %s", Spool);
-       }
-
-       pre[0] = XQTPRE;
-       pre[1] = '\0';
-       while (gnamef(pdir, file) != 0) {
-               DEBUG(4, "file - %s\n", file);
-               if (!prefix(pre, file))
-                       continue;
-               if (gotfiles(file))
-                       /*  return file to execute */
-                       return(1);
-       }
-
-       fclose(pdir);
-       return(0);
-}
-
-
-/***
- *     gotfiles(file)          check for needed files
- *     char *file;
- *
- *     return codes:  0 - not ready  |  1 - all files ready
- */
-
-gotfiles(file)
-char *file;
-{
-       struct stat stbuf;
-       FILE *fp;
-       char buf[BUFSIZ], rqfile[MAXFULLNAME];
-
-       fp = fopen(file, "r");
-       if (fp == NULL)
-               return(0);
-
-       while (fgets(buf, BUFSIZ, fp) != NULL) {
-               DEBUG(4, "%s\n", buf);
-               if (buf[0] != X_RQDFILE)
-                       continue;
-               sscanf(&buf[1], "%s", rqfile);
-               expfile(rqfile);
-               if (stat(rqfile, &stbuf) == -1) {
-                       fclose(fp);
-                       return(0);
-               }
-       }
-
-       fclose(fp);
-       return(1);
-}
-
-
-/***
- *     rmxfiles(xfile)         remove execute files to x-directory
- *     char *xfile;
- *
- *     return codes - none
- */
-
-rmxfiles(xfile)
-char *xfile;
-{
-       FILE *fp;
-       char buf[BUFSIZ], file[NAMESIZE], tfile[NAMESIZE];
-       char tfull[MAXFULLNAME];
-
-       if((fp = fopen(xfile, "r")) == NULL)
-               return;
-
-       while (fgets(buf, BUFSIZ, fp) != NULL) {
-               if (buf[0] != X_RQDFILE)
-                       continue;
-               if (sscanf(&buf[1], "%s%s", file, tfile) < 2)
-                       continue;
-               sprintf(tfull, "%s/%s", XQTDIR, tfile);
-               unlink(tfull);
-       }
-       fclose(fp);
-       return;
-}
-
-
-/***
- *     mvxfiles(xfile)         move execute files to x-directory
- *     char *xfile;
- *
- *     return codes - none
- */
-
-mvxfiles(xfile)
-char *xfile;
-{
-       FILE *fp;
-       char buf[BUFSIZ], ffile[MAXFULLNAME], tfile[NAMESIZE];
-       char tfull[MAXFULLNAME];
-       int ret;
-
-       if((fp = fopen(xfile, "r")) == NULL)
-               return;
-
-       while (fgets(buf, BUFSIZ, fp) != NULL) {
-               if (buf[0] != X_RQDFILE)
-                       continue;
-               if (sscanf(&buf[1], "%s%s", ffile, tfile) < 2)
-                       continue;
-               expfile(ffile);
-               sprintf(tfull, "%s/%s", XQTDIR, tfile);
-               unlink(tfull);
-               ret = link(ffile, tfull);
-               ASSERT(ret == 0, "LINK RET-%d", ret);
-               unlink(ffile);
-       }
-       fclose(fp);
-       return;
-}
-
-
-/***
- *     cmdok(xc, cmd)          check for valid command
- *     char *xc, *cmd;
- *
- *     return 0 - ok | 1 nok
- */
-
-cmdok(xc, cmd)
-char *xc, *cmd;
-{
-       char **ptr;
-
-       if (xc[0] != '\0')
-               return(0);
-       ptr = Cmds;
-       while(*ptr != NULL) {
-DEBUG(4, "cmd %s, ", cmd);
-DEBUG(4, "ptr %s\n", *ptr);
-               if (strcmp(cmd, *ptr) == SAME)
-                       break;
-       ptr++;
-       }
-       if (*ptr == NULL)
-               return(1);
-       strcpy(xc, cmd);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/versys.c b/.ref-Research-V7/usr/src/cmd/uucp/versys.c
deleted file mode 100644 (file)
index 327ce7b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "uucp.h"
-
-
-#define SNAMESIZE 7
-
-/*******
- *     versys(name)    verify system names n1 and n2
- *     char *name;
- *
- *     return codes:  0  |  FAIL
- */
-
-versys(name)
-char *name;
-{
-       FILE *fp;
-       char **fnp;
-       char line[300];
-       char s1[SNAMESIZE + 1];
-       char myname[SNAMESIZE + 1];
-       char *index();
-
-       sprintf(myname, "%.7s", Myname);
-       sprintf(s1, "%.7s", name);
-       if (strcmp(s1, myname) == 0)
-               return(0);
-       for (fnp = Sysfiles; *fnp != NULL; fnp++) {
-               fp = fopen(*fnp, "r");
-               if (fp == NULL)
-                       continue;
-       
-               while (fgets(line, 300, fp) != NULL) {
-                       *(index(line, ' ')) = '\0';
-                       line[7] = '\0';
-                       if (strcmp(s1, line) == SAME) {
-                               fclose(fp);
-                               return(0);
-                       }
-
-               }
-               fclose(fp);
-       }
-       return(FAIL);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/uucp/xqt.c b/.ref-Research-V7/usr/src/cmd/uucp/xqt.c
deleted file mode 100644 (file)
index 7e36343..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#include "uucp.h"
-#include <signal.h>
-
-
-/*******
- *     xuucico(rmtname)                start up uucico for rmtname
- *     char *rmtname;
- *
- *     return codes:  none
- */
-
-xuucico(rmtname)
-char *rmtname;
-{
-       if (fork() == 0) {
-               /*  start uucico for rmtname system  */
-               char opt[100];
-               close(0);
-               close(1);
-               close(2);
-               open("/dev/null", 0);
-               open("/dev/null", 1);
-               open("/dev/null", 1);
-               signal(SIGINT, SIG_IGN);
-               signal(SIGHUP, SIG_IGN);
-               signal(SIGQUIT, SIG_IGN);
-               signal(SIGKILL, SIG_IGN);
-               if (rmtname[0] != '\0')
-                       sprintf(opt, "-s%.7s", rmtname);
-               else
-                       opt[0] = '\0';
-               execl(UUCICO, "UUCICO", "-r1", opt, 0);
-               exit(100);
-       }
-       return;
-}
-
-
-/*******
- *     xuuxqt()                start up uuxqt
- *
- *     return codes:  none
- */
-
-xuuxqt()
-{
-       if (fork() == 0) {
-               /*  start uuxqt  */
-               close(0);
-               close(1);
-               close(2);
-               open("/dev/null", 2);
-               open("/dev/null", 2);
-               open("/dev/null", 2);
-               signal(SIGINT, SIG_IGN);
-               signal(SIGHUP, SIG_IGN);
-               signal(SIGQUIT, SIG_IGN);
-               signal(SIGKILL, SIG_IGN);
-               execl(UUXQT, "UUXQT",  0);
-               exit(100);
-       }
-       return;
-}
-xuucp(str)
-char *str;
-{
-       char text[300];
-       if (fork() == 0) {
-               /*  start uucp  */
-               close(0);
-               close(1);
-               close(2);
-               open("/dev/null", 0);
-               open("/dev/null", 1);
-               open("/dev/null", 1);
-               signal(SIGINT, SIG_IGN);
-               signal(SIGHUP, SIG_IGN);
-               signal(SIGQUIT, SIG_IGN);
-               signal(SIGKILL, SIG_IGN);
-               sprintf(text, "%s -r %s", UUCP, str);
-               execl(SHELL, "sh", "-c", text, 0);
-               exit(100);
-       }
-       sleep(15);
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/cmd/vpr.c b/.ref-Research-V7/usr/src/cmd/vpr.c
deleted file mode 100644 (file)
index 4a7e161..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * vpr -- Versatek printer filter
- */
-
-#include <stdio.h>
-
-#define        LINELN  132
-#define        EJLINE  63
-#define        SETSTATE (('v'<<8)+1)
-
-int    anydone;
-char   linebuf[LINELN+2];
-int    sppmode[]       = {0400, 0, 0};
-int    pltmode[]       = {0200, 0, 0};
-int    clrcom[]        = {0404, 0, 0};
-int    termcom[]       = {0240, 0, 0};
-int    prtmode[]       = {0100, 0, 0};
-int    ov;
-char   ovbuf[2*LINELN];
-FILE   *in     = stdin;
-FILE   *out;
-char   *ban;
-int    npages  = 1;
-char   chrtab[][16];
-int    lineno;
-char   *ctime();
-
-main(argc, argv)
-char **argv;
-{
-
-       if ((out = fopen("/dev/vp0", "w")) == NULL) {
-               fprintf(stderr, "Can't open printer\n");
-               exit(1);
-       }
-       if (argc > 2 && argv[1][0]=='-' && argv[1][1]=='b') {
-               argc -= 2;
-               banner(ban = argv[2]);
-               argv += 2;
-       }
-       if (argc<=1)
-               anydone |= send();
-       else while (argc>1) {
-               if ((in = fopen(argv[1], "r")) == NULL) {
-                       fprintf(stderr, "Can't find %s\n", argv[1]);
-                       argv++;
-                       argc--;
-                       anydone |= 01;
-                       continue;
-               }
-               anydone |= send();
-               argc--;
-               argv++;
-               fclose(in);
-               fprintf(out, "\014");
-       }
-       if (anydone==0)
-               exit(1);
-       fprintf(out, "\004");
-       if (ferror(out)) {
-               fprintf(out, "Printer IO error\n");
-               exit(1);
-       }
-       fclose(out);
-       if (ban && access("/usr/adm/vpacct", 02)>=0
-        && (out = fopen("/usr/adm/vpacct", "a"))!=NULL) {
-               fprintf(out, "%4d %s\n", npages, ban);
-       }
-       return(0);
-}
-
-send()
-{
-       register nskipped;
-
-       lineno = 0;
-       nskipped = 0;
-       while (getline()) {
-               if (lineno==0 && linebuf[0]==0 && nskipped<3) {
-                       nskipped ++;
-                       continue;
-               }
-               if (lineno >= EJLINE) {
-                       nskipped = 0;
-                       putline(1);
-                       lineno = 0;
-               } else {
-                       putline(0);
-                       lineno++;
-               }
-       }
-       if (lineno>0)
-               npages++;
-       return(1);
-}
-
-getline()
-{
-       register col, maxcol, c;
-
-       ov = 0;
-       for (col=0; col<LINELN; col++) {
-               linebuf[col] = ' ';
-               ovbuf[2*col] = ovbuf[2*col+1] = 0;
-       }
-       col = 8;
-       maxcol = 0;
-       for (;;) switch (c = getc(in)) {
-
-       case EOF:
-               return(0);
-
-       default:
-               if (c>=' ') {
-                       if (col < LINELN) {
-                               if (linebuf[col]=='_') {
-                                       ov++;
-                                       ovbuf[2*col] = 0377;
-                                       ovbuf[2*col+1] = 0377;
-                               }
-                               linebuf[col++] = c;
-                               if (col > maxcol)
-                                       maxcol = col;
-                       }
-               }
-               continue;
-
-       case '\f':
-               lineno = EJLINE;
-               continue;
-       case ' ':
-               col++;
-               continue;
-
-
-       case '\t':
-               col = (col|07) + 1;
-               if (col>maxcol)
-                       maxcol = col;
-               continue;
-
-       case '\r':
-               col = 0;
-               continue;
-
-       case '_':
-               if (col>=LINELN) {
-                       col++;
-                       continue;
-               }
-               if (linebuf[col]!=' ') {
-                       ovbuf[2*col] = 0377;
-                       ovbuf[2*col+1] = 0377;
-                       ov++;
-               } else
-                       linebuf[col] = c;
-               col++;
-               if (col>maxcol)
-                       maxcol = col;
-               continue;
-
-       case '\n':
-               if (maxcol>=LINELN)
-                       maxcol = LINELN;
-               linebuf[maxcol] = 0;
-               return(1);
-
-       case '\b':
-               if (col>0)
-                       col--;
-               continue;
-       }
-}
-
-putline(ff)
-{
-       register char *lp;
-       register c;
-       extern errno;
-
-       errno = 0;
-       lp = linebuf;
-       while (c = *lp++)
-               putc(c, out);
-       if (ov) {
-               putc('\n', out);
-               fflush(out);
-               ioctl(fileno(out), SETSTATE, pltmode);
-               for (lp=ovbuf; lp < &ovbuf[2*LINELN]; )
-                       putc(*lp++, out);
-               fflush(out);
-               ioctl(fileno(out), SETSTATE, prtmode);
-       }
-       if (ff) {
-               putc('\014', out);
-               npages++;
-       } else if (ov==0)
-               putc('\n', out);
-       if (ferror(out)) {
-               printf("Printer IO error\n");
-               exit(1);
-       }
-}
-
-banner(s)
-char *s;
-{
-       long timeb;
-       register char *sp;
-       int i, j, t;
-
-       fprintf(out, "\n\n\n\n\n\n\n\n");
-       for (i=0; i<16; i++) {
-               fprintf(out, "                ");
-               for (sp=s; *sp; sp++) {
-                       if (*sp<=' '|| *sp >'}')
-                               continue;
-                       fprintf(out, "  ");
-                       t = chrtab[*sp - ' '][i];
-                       for (j=7; j>=0; j--)
-                               if ((t>>j) & 01)
-                                       putc('X', out);
-                               else
-                                       putc(' ', out);
-               }
-               putc('\n', out);
-       }
-       fprintf(out, "\n\n\n\n\n\n\n\n");
-       time(&timeb);
-       fprintf(out, "                ");
-       fprintf(out, ctime(&timeb));
-       fprintf(out, "\014");
-}
-
-char   chrtab[][16] = {
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, sp, */
-0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0010,0000,0000,0000,0000,0000, /*, !, */
-0024,0024,0024,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ", */
-0000,0000,0000,0044,0044,0176,0044,0044,0176,0044,0044,0000,0000,0000,0000,0000, /*, #, */
-0000,0010,0010,0010,0076,0101,0100,0076,0001,0101,0076,0010,0010,0000,0000,0000, /*, $, */
-0000,0000,0000,0141,0142,0004,0010,0010,0020,0043,0103,0000,0000,0000,0000,0000, /*, %, */
-0000,0000,0070,0104,0110,0060,0060,0111,0106,0106,0071,0000,0000,0000,0000,0000, /*, &, */
-0004,0010,0020,0040,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ', */
-0000,0004,0010,0020,0040,0040,0040,0040,0040,0040,0020,0010,0004,0000,0000,0000, /*, (, */
-0000,0040,0020,0010,0004,0004,0004,0004,0004,0004,0010,0020,0040,0000,0000,0000, /*, ), */
-0000,0000,0000,0010,0111,0052,0034,0177,0034,0052,0111,0010,0000,0000,0000,0000, /*, *, */
-0000,0000,0000,0000,0010,0010,0010,0177,0010,0010,0010,0000,0000,0000,0000,0000, /*, +, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0010,0020,0000,0000,0000, /*, ,, */
-0000,0000,0000,0000,0000,0000,0000,0176,0000,0000,0000,0000,0000,0000,0000,0000, /*, -, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0030,0030,0000,0000,0000,0000,0000, /*, ., */
-0000,0000,0001,0002,0004,0010,0010,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, /, */
-0000,0030,0044,0102,0102,0102,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 0, */
-0000,0010,0030,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, 1, */
-0000,0070,0104,0004,0004,0010,0020,0040,0100,0100,0174,0000,0000,0000,0000,0000, /*, 2, */
-0000,0176,0004,0004,0010,0014,0002,0002,0002,0104,0070,0000,0000,0000,0000,0000, /*, 3, */
-0000,0004,0014,0024,0044,0104,0176,0004,0004,0004,0004,0000,0000,0000,0000,0000, /*, 4, */
-0000,0174,0100,0100,0130,0144,0002,0002,0102,0044,0030,0000,0000,0000,0000,0000, /*, 5, */
-0000,0074,0102,0100,0130,0144,0102,0102,0102,0044,0030,0000,0000,0000,0000,0000, /*, 6, */
-0000,0176,0004,0004,0010,0010,0020,0020,0040,0040,0040,0000,0000,0000,0000,0000, /*, 7, */
-0000,0034,0042,0101,0042,0076,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, 8, */
-0000,0034,0042,0101,0101,0101,0043,0036,0004,0010,0020,0040,0000,0000,0000,0000, /*, 9, */
-0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0000,0000,0000,0000,0000, /*, :, */
-0000,0000,0000,0000,0000,0000,0030,0030,0000,0030,0030,0020,0040,0000,0000,0000, /*, ;, */
-0002,0004,0010,0020,0040,0100,0040,0020,0010,0004,0002,0000,0000,0000,0000,0000, /*, <, */
-0000,0000,0000,0000,0177,0000,0177,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, =, */
-0100,0040,0020,0010,0004,0002,0004,0010,0020,0040,0100,0000,0000,0000,0000,0000, /*, >, */
-0000,0030,0044,0102,0001,0002,0004,0010,0010,0000,0010,0000,0000,0000,0000,0000, /*, ?, */
-0000,0074,0102,0101,0115,0123,0121,0121,0121,0111,0046,0000,0000,0000,0000,0000, /*, @, */
-0000,0010,0024,0042,0101,0101,0177,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, A, */
-0000,0176,0101,0101,0101,0176,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, B, */
-0000,0076,0101,0100,0100,0100,0100,0100,0100,0101,0076,0000,0000,0000,0000,0000, /*, C, */
-0000,0176,0101,0101,0101,0101,0101,0101,0101,0101,0176,0000,0000,0000,0000,0000, /*, D, */
-0000,0176,0100,0100,0100,0170,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, E, */
-0000,0177,0100,0100,0100,0174,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, F, */
-0000,0076,0101,0100,0100,0117,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, G, */
-0000,0101,0101,0101,0101,0176,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, H, */
-0000,0034,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, I, */
-0000,0016,0004,0004,0004,0004,0004,0004,0104,0104,0070,0000,0000,0000,0000,0000, /*, J, */
-0000,0101,0102,0104,0110,0120,0160,0110,0104,0102,0101,0000,0000,0000,0000,0000, /*, K, */
-0000,0100,0100,0100,0100,0100,0100,0100,0100,0100,0177,0000,0000,0000,0000,0000, /*, L, */
-0000,0101,0143,0125,0111,0101,0101,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, M, */
-0000,0101,0141,0121,0111,0105,0103,0101,0101,0101,0101,0000,0000,0000,0000,0000, /*, N, */
-0000,0076,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, O, */
-0000,0176,0101,0101,0101,0176,0100,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, P, */
-0000,0076,0101,0101,0101,0101,0101,0101,0131,0105,0076,0002,0001,0000,0000,0000, /*, Q, */
-0000,0176,0101,0101,0101,0176,0104,0102,0101,0101,0101,0000,0000,0000,0000,0000, /*, R, */
-0000,0076,0101,0100,0100,0076,0001,0001,0001,0101,0076,0000,0000,0000,0000,0000, /*, S, */
-0000,0177,0010,0010,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, T, */
-0000,0101,0101,0101,0101,0101,0101,0101,0101,0101,0076,0000,0000,0000,0000,0000, /*, U, */
-0000,0101,0101,0101,0101,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, V, */
-0000,0101,0101,0101,0101,0111,0111,0125,0143,0101,0101,0000,0000,0000,0000,0000, /*, W, */
-0000,0101,0101,0042,0024,0010,0024,0042,0101,0101,0101,0000,0000,0000,0000,0000, /*, X, */
-0000,0101,0042,0024,0010,0010,0010,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, Y, */
-0000,0177,0001,0002,0004,0010,0020,0040,0100,0100,0177,0000,0000,0000,0000,0000, /*, Z, */
-0000,0034,0020,0020,0020,0020,0020,0020,0020,0020,0020,0034,0000,0000,0000,0000, /*, [, */
-0000,0000,0100,0040,0020,0010,0010,0010,0004,0002,0001,0000,0000,0000,0000,0000, /*, , \, */
-0000,0070,0010,0010,0010,0010,0010,0010,0010,0010,0010,0070,0000,0000,0000,0000, /*, ], */
-0010,0024,0042,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ^, */
-0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0377,0000,0000, /*, _, */
-0040,0020,0010,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, `, */
-0000,0000,0000,0000,0000,0074,0002,0076,0102,0102,0076,0000,0000,0000,0000,0000, /*, a, */
-0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0174,0000,0000,0000,0000,0000, /*, b, */
-0000,0000,0000,0000,0000,0074,0102,0100,0100,0102,0074,0000,0000,0000,0000,0000, /*, c, */
-0002,0002,0002,0002,0002,0076,0102,0102,0102,0102,0076,0000,0000,0000,0000,0000, /*, d, */
-0000,0000,0000,0000,0000,0074,0102,0174,0100,0102,0074,0000,0000,0000,0000,0000, /*, e, */
-0000,0016,0020,0020,0020,0176,0020,0020,0020,0020,0020,0000,0000,0000,0000,0000, /*, f, */
-0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0102,0076,0000, /*, g, */
-0000,0100,0100,0100,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, h, */
-0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, i, */
-0000,0000,0000,0010,0000,0030,0010,0010,0010,0010,0010,0010,0010,0050,0020,0000, /*, j, */
-0000,0100,0100,0100,0100,0106,0110,0120,0160,0110,0106,0000,0000,0000,0000,0000, /*, k, */
-0000,0030,0010,0010,0010,0010,0010,0010,0010,0010,0034,0000,0000,0000,0000,0000, /*, l, */
-0000,0000,0000,0000,0000,0166,0111,0111,0111,0111,0111,0000,0000,0000,0000,0000, /*, m, */
-0000,0000,0000,0000,0100,0174,0102,0102,0102,0102,0102,0000,0000,0000,0000,0000, /*, n, */
-0000,0000,0000,0000,0000,0074,0102,0102,0102,0102,0074,0000,0000,0000,0000,0000, /*, o, */
-0000,0000,0000,0000,0000,0174,0102,0102,0102,0102,0174,0100,0100,0100,0100,0000, /*, p, */
-0000,0000,0000,0000,0000,0076,0102,0102,0102,0102,0076,0002,0002,0002,0002,0000, /*, q, */
-0000,0000,0000,0000,0000,0134,0142,0100,0100,0100,0100,0000,0000,0000,0000,0000, /*, r, */
-0000,0000,0000,0000,0000,0076,0100,0074,0002,0102,0074,0000,0000,0000,0000,0000, /*, s, */
-0000,0020,0020,0020,0020,0176,0020,0020,0020,0020,0014,0000,0000,0000,0000,0000, /*, t, */
-0000,0000,0000,0000,0000,0102,0102,0102,0102,0102,0075,0000,0000,0000,0000,0000, /*, u, */
-0000,0000,0000,0000,0000,0101,0101,0101,0042,0024,0010,0000,0000,0000,0000,0000, /*, v, */
-0000,0000,0000,0000,0000,0111,0111,0111,0111,0111,0066,0000,0000,0000,0000,0000, /*, w, */
-0000,0000,0000,0000,0000,0102,0044,0030,0030,0044,0102,0000,0000,0000,0000,0000, /*, x, */
-0000,0000,0000,0000,0000,0102,0102,0102,0042,0024,0010,0020,0040,0100,0000,0000, /*, y, */
-0000,0000,0000,0000,0000,0176,0004,0010,0020,0040,0176,0000,0000,0000,0000,0000, /*, z, */
-0000,0014,0020,0020,0020,0020,0040,0020,0020,0020,0020,0014,0000,0000,0000,0000, /*, {, */
-0000,0010,0010,0010,0010,0000,0000,0010,0010,0010,0010,0000,0000,0000,0000,0000, /*, |, */
-0000,0030,0010,0010,0010,0010,0004,0010,0010,0010,0010,0030,0000,0000,0000,0000, /*, }, */
-0020,0052,0004,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, /*, ~, */
-0000,0176,0176,0176,0176,0176,0176,0176,0176,0176,0176,0000,0000,0000,0000,0000, /*, del, */
-};
diff --git a/.ref-Research-V7/usr/src/cmd/wall.c b/.ref-Research-V7/usr/src/cmd/wall.c
deleted file mode 100644 (file)
index 003ff7c..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#include <stdio.h>
-#include <utmp.h>
-#define        USERS   50
-
-char   mesg[3000];
-int    msize;
-struct utmp utmp[USERS];
-char   *strcpy();
-char   *strcat();
-
-main(argc, argv)
-char *argv[];
-{
-       register i;
-       register struct utmp *p;
-       FILE *f;
-
-       if((f = fopen("/etc/utmp", "r")) == NULL) {
-               fprintf(stderr, "Cannot open /etc/utmp\n");
-               exit(1);
-       }
-       fread((char *)utmp, sizeof(struct utmp), USERS, f);
-       fclose(f);
-       f = stdin;
-       if(argc >= 2) {
-               if((f = fopen(argv[1], "r")) == NULL) {
-                       fprintf(stderr,"Cannot open %s\n", argv[1]);
-                       exit(1);
-               }
-       }
-       while((i = getc(f)) != EOF) mesg[msize++] = i;
-       fclose(f);
-       for(i=0; i<USERS; i++) {
-               p = &utmp[i];
-               if(p->ut_name[0] == 0)
-                       continue;
-               sleep(1);
-               sendmes(p->ut_line);
-       }
-       exit(0);
-}
-
-sendmes(tty)
-char *tty;
-{
-       register i;
-       char t[50], buf[BUFSIZ];
-       FILE *f;
-
-       i = fork();
-       if(i == -1) {
-               fprintf(stderr, "Try again\n");
-               return;
-       }
-       if(i)
-               return;
-       strcpy(t, "/dev/");
-       strcat(t, tty);
-
-       if((f = fopen(t, "w")) == NULL) {
-               fprintf(stderr,"cannot open %s\n", t);
-               exit(1);
-       }
-       setbuf(f, buf);
-       fprintf(f, "\a\a\aBroadcast Message ...\n\n");
-       fwrite(mesg, msize, 1, f);
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/wc.c b/.ref-Research-V7/usr/src/cmd/wc.c
deleted file mode 100644 (file)
index 3a20b27..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/* wc line and word count */
-
-#include <stdio.h>
-
-main(argc, argv)
-char **argv;
-{
-       int i, token;
-       register FILE *fp;
-       long linect, wordct, charct;
-       long tlinect=0, twordct=0, tcharct=0;
-       char *wd;
-       register int c;
-
-       wd = "lwc";
-       if(argc > 1 && *argv[1] == '-') {
-               wd = ++argv[1];
-               argc--;
-               argv++;
-       }
-
-       i = 1;
-       fp = stdin;
-       do {
-               if(argc>1 && (fp=fopen(argv[i], "r")) == NULL) {
-                       fprintf(stderr, "wc: can't open %s\n", argv[i]);
-                       continue;
-               }
-               linect = 0;
-               wordct = 0;
-               charct = 0;
-               token = 0;
-               for(;;) {
-                       c = getc(fp);
-                       if (c == EOF)
-                               break;
-                       charct++;
-                       if(' '<c&&c<0177) {
-                               if(!token) {
-                                       wordct++;
-                                       token++;
-                               }
-                               continue;
-                       }
-                       if(c=='\n')
-                               linect++;
-                       else if(c!=' '&&c!='\t')
-                               continue;
-                       token = 0;
-               }
-               /* print lines, words, chars */
-               wcp(wd, charct, wordct, linect);
-               if(argc>1) {
-                       printf(" %s\n", argv[i]);
-               } else
-                       printf("\n");
-               fclose(fp);
-               tlinect += linect;
-               twordct += wordct;
-               tcharct += charct;
-       } while(++i<argc);
-       if(argc > 2) {
-               wcp(wd, tcharct, twordct, tlinect);
-               printf(" total\n");
-       }
-       exit(0);
-}
-
-wcp(wd, charct, wordct, linect)
-register char *wd;
-long charct; long wordct; long linect;
-{
-       while (*wd) switch (*wd++) {
-       case 'l':
-               printf("%7ld", linect);
-               break;
-
-       case 'w':
-               printf("%7ld ", wordct);
-               break;
-
-       case 'c':
-               printf("%7ld", charct);
-               break;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/who.c b/.ref-Research-V7/usr/src/cmd/who.c
deleted file mode 100644 (file)
index 194fe96..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * who
- */
-
-#include <stdio.h>
-#include <utmp.h>
-#include <pwd.h>
-struct utmp utmp;
-struct passwd *pw;
-struct passwd *getpwuid();
-
-char *ttyname(), *rindex(), *ctime(), *strcpy(), *index();
-main(argc, argv)
-char **argv;
-{
-       register char *tp, *s;
-       register FILE *fi;
-
-       s = "/etc/utmp";
-       if(argc == 2)
-               s = argv[1];
-       if (argc==3) {
-               tp = ttyname(0);
-               if (tp)
-                       tp = index(tp+1, '/') + 1;
-               else {  /* no tty - use best guess from passwd file */
-                       pw = getpwuid(getuid());
-                       strcpy(utmp.ut_name, pw?pw->pw_name: "?");
-                       strcpy(utmp.ut_line, "tty??");
-                       time(&utmp.ut_time);
-                       putline();
-                       exit(0);
-               }
-       }
-       if ((fi = fopen(s, "r")) == NULL) {
-               puts("who: cannot open utmp");
-               exit(1);
-       }
-       while (fread((char *)&utmp, sizeof(utmp), 1, fi) == 1) {
-               if(argc==3) {
-                       if (strcmp(utmp.ut_line, tp))
-                               continue;
-#ifdef interdata
-                       printf("(Interdata) ");
-#endif
-                       putline();
-                       exit(0);
-               }
-               if(utmp.ut_name[0] == '\0' && argc==1)
-                       continue;
-               putline();
-       }
-}
-
-putline()
-{
-       register char *cbuf;
-
-       printf("%-8.8s %-8.8s", utmp.ut_name, utmp.ut_line);
-       cbuf = ctime(&utmp.ut_time);
-       printf("%.12s\n", cbuf+4);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/write.c b/.ref-Research-V7/usr/src/cmd/write.c
deleted file mode 100644 (file)
index febeadf..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * write to another user
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <utmp.h>
-
-char   *strcat();
-char   *strcpy();
-struct utmp ubuf;
-int    signum[] = {SIGHUP, SIGINT, SIGQUIT, 0};
-char   me[10]  = "???";
-char   *him;
-char   *mytty;
-char   histty[32];
-char   *histtya;
-char   *ttyname();
-char   *rindex(), *index();
-int    logcnt;
-int    eof();
-int    timout();
-FILE   *tf;
-
-main(argc, argv)
-char *argv[];
-{
-       struct stat stbuf;
-       register i;
-       register FILE *uf;
-       int c1, c2;
-
-       if(argc < 2) {
-               printf("usage: write user [ttyname]\n");
-               exit(1);
-       }
-       him = argv[1];
-       if(argc > 2)
-               histtya = argv[2];
-       if ((uf = fopen("/etc/utmp", "r")) == NULL) {
-               printf("cannot open /etc/utmp\n");
-               goto cont;
-       }
-       mytty = ttyname(2);
-       if (mytty == NULL) {
-               printf("Can't find your tty\n");
-               exit(1);
-       }
-       mytty = index(mytty+1, '/') + 1;
-       if (histtya) {
-               strcpy(histty, "/dev/");
-               strcat(histty, histtya);
-       }
-       while (fread((char *)&ubuf, sizeof(ubuf), 1, uf) == 1) {
-               if (strcmp(ubuf.ut_line, mytty)==0) {
-                       for(i=0; i<8; i++) {
-                               c1 = ubuf.ut_name[i];
-                               if(c1 == ' ')
-                                       c1 = 0;
-                               me[i] = c1;
-                               if(c1 == 0)
-                                       break;
-                       }
-               }
-               if(him[0] != '-' || him[1] != 0)
-               for(i=0; i<8; i++) {
-                       c1 = him[i];
-                       c2 = ubuf.ut_name[i];
-                       if(c1 == 0)
-                               if(c2 == 0 || c2 == ' ')
-                                       break;
-                       if(c1 != c2)
-                               goto nomat;
-               }
-               logcnt++;
-               if (histty[0]==0) {
-                       strcpy(histty, "/dev/");
-                       strcat(histty, ubuf.ut_line);
-               }
-       nomat:
-               ;
-       }
-cont:
-       if (logcnt==0 && histty[0]=='\0') {
-               printf("%s not logged in.\n", him);
-               exit(1);
-       }
-       fclose(uf);
-       if (histtya==0 && logcnt > 1) {
-               printf("%s logged more than once\nwriting to %s\n", him, histty+5);
-       }
-       if(histty[0] == 0) {
-               printf(him);
-               if(logcnt)
-                       printf(" not on that tty\n"); else
-                       printf(" not logged in\n");
-               exit(1);
-       }
-       if (access(histty, 0) < 0) {
-               printf("%s: ", histty);
-               printf("No such tty\n");
-               exit(1);
-       }
-       signal(SIGALRM, timout);
-       alarm(5);
-       if ((tf = fopen(histty, "w")) == NULL)
-               goto perm;
-       alarm(0);
-       if (fstat(fileno(tf), &stbuf) < 0)
-               goto perm;
-       if ((stbuf.st_mode&02) == 0)
-               goto perm;
-       sigs(eof);
-       fprintf(tf, "Message from ");
-#ifdef interdata
-       fprintf(tf, "(Interdata) " );
-#endif
-       fprintf(tf, "%s %s...\n\a\a\a", me, mytty);
-       fflush(tf);
-       for(;;) {
-               char buf[128];
-               i = read(0, buf, 128);
-               if(i <= 0)
-                       eof();
-               if(buf[0] == '!') {
-                       buf[i] = 0;
-                       ex(buf);
-                       continue;
-               }
-               write(fileno(tf), buf, i);
-       }
-
-perm:
-       printf("Permission denied\n");
-       exit(1);
-}
-
-timout()
-{
-
-       printf("Timeout opening his tty\n");
-       exit(1);
-}
-
-eof()
-{
-
-       fprintf(tf, "EOF\n");
-       exit(0);
-}
-
-ex(bp)
-char *bp;
-{
-       register i;
-
-       sigs(SIG_IGN);
-       i = fork();
-       if(i < 0) {
-               printf("Try again\n");
-               goto out;
-       }
-       if(i == 0) {
-               sigs((int (*)())0);
-               execl("/bin/sh", "sh", "-c", bp+1, 0);
-               exit(0);
-       }
-       while(wait((int *)NULL) != i)
-               ;
-       printf("!\n");
-out:
-       sigs(eof);
-}
-
-sigs(sig)
-int (*sig)();
-{
-       register i;
-
-       for(i=0;signum[i];i++)
-               signal(signum[i],sig);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/xsend/enroll.c b/.ref-Research-V7/usr/src/cmd/xsend/enroll.c
deleted file mode 100644 (file)
index f2e8e14..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "xmail.h"
-#include "pwd.h"
-#include "sys/types.h"
-MINT *a[42], *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15;
-char buf[256];
-char maildir[] = { "/usr/spool/secretmail"};
-main()
-{
-       int uid, i;
-       FILE *fd;
-       char *myname, fname[128];
-       uid = getuid();
-       myname = getlogin();
-       if(myname == NULL)
-               myname = getpwuid(uid)->pw_name;
-       sprintf(fname, "%s/%s.key", maildir, myname);
-       comminit();
-       setup(getpass("Gimme key: "));
-       mkb();
-       mkx();
-#ifdef debug
-       omout(b);
-       omout(x);
-#endif
-       mka();
-       i = creat(fname, 0644);
-       if(i<0)
-       {       perror("fname");
-               exit(1);
-       }
-       close(i);
-       fd = fopen(fname, "w");
-       for(i=0; i<42; i++)
-               nout(a[i], fd);
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/xsend/lib.c b/.ref-Research-V7/usr/src/cmd/xsend/lib.c
deleted file mode 100644 (file)
index 22508a7..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "xmail.h"
-MINT *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15;
-MINT *a[42];
-setup(s) char *s;
-{      int pf[2];
-       strncpy(buf, s, 10);
-       while(*s) *s++ = 0;
-       pipe(pf);
-       if(fork()==0)
-       {
-               close(0);
-               close(1);
-               dup(pf[0]);
-               dup(pf[1]);
-               execl("/usr/lib/makekey", "-", 0);
-               execl("/lib/makekey", "-", 0);
-               exit(1);
-       }
-       write(pf[1], buf, 10);
-       wait((int *)NULL);
-       if(read(pf[0], buf, 13) != 13)
-       {       fprintf(stderr, "enroll: cannot generate key\n");
-               exit(1);
-       }
-}
-mkx()
-{      int i, j;
-       for(i=0; i<4; i++)
-       {       mult(x, t15, x);
-               *z->val = (short)(rand() ^ buf[i]);
-               madd(x, z, x);
-       }
-       mdiv(x, b, q, x);
-       for(;;)
-       {       gcd(b, x, q);
-               if(q->len == 1 && q->val[0] == 1)
-                       return;
-               madd(x, one, x);
-       }
-}
-mka()
-{      int i, j;
-       for(i=0; i<42; i++)
-               a[i] = itom(1);
-       for(i=j=0; i<42; i++, j++)
-       {       *z->val = (short)rand()&00;
-               mult(a[i], z, a[i]);
-               mult(a[i], t45, a[i]);
-               rpow(two, j, q);
-               if( i%14 == 6) j++;
-               madd(a[i], q, a[i]);
-               mult(a[i], t15, a[i]);
-               *z->val = (short)rand()&0777;
-               madd(a[i], z, a[i]);
-               mdiv(a[i], b, q, a[i]);
-       }
-       for(i=0; i<42; i++)
-               mult(a[i], x, a[i]);
-       for(i=0; i<42; i++)
-       {       mdiv(a[i], b, q, a[i]);
-       }
-}
-mkb()
-{      int i, c;
-       unsigned seed;
-       seed = 123;
-       for(i=0; i<13; i++)
-               seed = seed*buf[i] + i;
-       srand(seed);
-       *b->val = 04 + (rand()&03);
-       for(i=0; i<11; i++)
-       {       *z->val = (buf[i+2] + rand()) & 077;
-               mult(b, c64, b);
-               madd(b, z, b);
-       }
-}
-comminit()
-{      int i;
-       x = itom(0);
-       b = itom(1);
-       one = itom(1);
-       two = itom(2);
-       c64 = itom(64);
-       t45 = itom(1);
-       t15 = itom(1);
-       rpow(two, 45, t45);
-       rpow(two, 15, t15);
-       z = itom(1);
-       q = itom(1);
-}
-#ifndef debug
-nout(a, fd) MINT *a; FILE *fd;
-{
-       fwrite(&a->len, sizeof(int), 1, fd);
-       fwrite(a->val, sizeof(short), a->len, fd);
-}
-nin(a, fd) MINT *a; FILE *fd;
-{
-       xfree(a);
-       fread(&a->len, sizeof(int), 1, fd);
-       a->val = xalloc(a->len, "nin");
-       fread(a->val, sizeof(short), a->len, fd);
-}
-#endif
-xfatal(s) char *s;
-{
-       fprintf(stderr, "%s\n", s);
-       exit(1);
-}
diff --git a/.ref-Research-V7/usr/src/cmd/xsend/makefile b/.ref-Research-V7/usr/src/cmd/xsend/makefile
deleted file mode 100644 (file)
index 90a92c8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-CFLAGS = -n -O -s
-
-cp:    all
-       cp xsend xget enroll /bin
-       rm *.o xsend xget enroll
-
-cmp:   all
-       cmp xsend /bin/xsend
-       cmp xget /bin/xget
-       cmp enroll /bin/enroll
-       rm *.o xsend xget enroll
-
-all:   enroll xsend xget
-enroll:        enroll.o lib.o
-       cc -n -s enroll.o lib.o -lmp -o enroll
-xget:  xget.o lib.o
-       cc -n -s xget.o lib.o -lmp -o xget
-xsend: xsend.o lib.o
-       cc -n -s xsend.o lib.o -lmp -o xsend
-enroll.o xget.o xsend.o lib.o: xmail.h
-list:
-       @pr -2 -w124 m.h xmail.h enroll.c xsend.c xget.c lib.c makefile
diff --git a/.ref-Research-V7/usr/src/cmd/xsend/xget.c b/.ref-Research-V7/usr/src/cmd/xsend/xget.c
deleted file mode 100644 (file)
index 93b06aa..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#include "xmail.h"
-#include "sys/types.h"
-#include "sys/dir.h"
-#include "ctype.h"
-#include "pwd.h"
-#include "sys/stat.h"
-char *myname;
-int uid;
-struct direct dbuf;
-char *maildir = "/usr/spool/secretmail/";
-FILE *kf, *mf, *df;
-MINT *x, *b, *one, *t45, *z, *q, *r;
-MINT *two, *t15, *mbuf;
-char buf[256], line[128];
-#define MXF 100
-int fnum[MXF], fcnt;
-struct stat stbuf;
-main()
-{      int i;
-       char *p;
-       uid = getuid();
-       myname = getlogin();
-       if(myname == NULL)
-               myname = getpwuid(uid)->pw_name;
-       comminit();
-       mbuf = itom(0);
-       files();
-       setup(getpass("Key: "));
-       mkb();
-       mkx();
-#ifndef debug
-       invert(x, b, x);
-#else
-       invert(x, b, z);
-       mult(x, z, z);
-       mdiv(z, b, q, z);
-       omout(z);
-       invert(x, b, x);
-#endif
-       for(i=0; i<fcnt; i++)
-       {       sprintf(line, "%s%s.%d", maildir, myname, fnum[i]);
-               if(stat(line, &stbuf)<0)
-               {       perror(line);
-                       continue;
-               }
-               if(stbuf.st_size == 0)
-               {       printf("zero length mail file\n");
-                       unlink(line);
-                       continue;
-               }
-               if((mf = fopen(line, "r"))==NULL)
-               {       perror(line);
-                       continue;
-               }
-               decipher(mf, stdout);
-       cmnd:
-               printf("? ");
-               fgets(buf, sizeof(buf), stdin);
-               if(feof(stdin)) exit(0);
-               switch(buf[0])
-               {
-               case 'q':
-                       exit(0);
-               case 'n':
-               case 'd':
-               case '\n':
-                       unlink(line);
-                       fclose(mf);
-                       break;
-               case '!':
-                       system(buf+1);
-                       printf("!\n");
-                       goto cmnd;
-               case 's':
-               case 'w':
-                       rewind(mf);
-                       if(buf[1] == '\n' || buf[1] == '\0')
-                               strcpy(buf, "s mbox\n");
-                       for(p=buf; !isspace(*p); p++);
-                       for(; isspace(*p); p++);
-                       p[strlen(p)-1] = 0;
-                       kf = fopen(p, "a");
-                       if(kf == NULL)
-                       {       perror(p);
-                               break;
-                       }
-                       decipher(mf, kf);
-                       fclose(mf);
-                       fclose(kf);
-                       unlink(line);
-                       break;
-               }
-       }
-       exit(0);
-}
-icmp(a, b) int *a, *b;
-{
-       return(*a - *b);
-}
-files()
-{      int i;
-       if((df = fopen(maildir, "r")) == NULL)
-       {       perror(maildir);
-               exit(1);
-       }
-       strcpy(line, myname);
-       strcat(line, ".%d");
-       for(; !feof(df);)
-       {       fread(&dbuf, sizeof(dbuf), 1, df);
-               if(feof(df)) break;
-               if(dbuf.d_ino == 0) continue;
-               if(sscanf(dbuf.d_name, line, &i) != 1)
-                       continue;
-               if(fcnt >= MXF)
-                       break;
-               fnum[fcnt++] = i;
-       }
-       if(fcnt == 0)
-       {       printf("no secret mail\n");
-               exit(0);
-       }
-       qsort(fnum, fcnt, sizeof(int), icmp);
-}
-decipher(u, w) FILE *u, *w;
-{      int i;
-       short a;
-       for(;;)
-       {       nin(mbuf, u);
-               if(feof(u)) break;
-               mult(mbuf, x, mbuf);
-               mdiv(mbuf, b, q, mbuf);
-               for(i=1; i<=3; i++)
-               {       a = mbuf->val[i];
-                       putc(a&0177, w);
-                       a >>= 8;
-                       putc(a&0177, w);
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/xsend/xmail.h b/.ref-Research-V7/usr/src/cmd/xsend/xmail.h
deleted file mode 100644 (file)
index 1d637a3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-#include <mp.h>
-extern MINT *x, *b, *one, *c64, *t45, *z, *q, *r, *two, *t15;
-extern char buf[256];
-#ifdef debug
-#define nin(x, y) m_in(x, 8, y)
-#define nout(x, y) m_out(x, 8, y)
-#endif
diff --git a/.ref-Research-V7/usr/src/cmd/xsend/xsend.c b/.ref-Research-V7/usr/src/cmd/xsend/xsend.c
deleted file mode 100644 (file)
index cd53806..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#include "xmail.h"
-#include "sys/types.h"
-#include "pwd.h"
-#include "sys/stat.h"
-#include "sys/dir.h"
-extern int errno;
-struct stat stbuf;
-int uid, destuid;
-char *myname, *dest, *keyfile[128], line[128];
-struct direct dbuf;
-char *maildir = "/usr/spool/secretmail/";
-FILE *kf, *mf, *df;
-MINT *a[42], *cd[6][128];
-MINT *msg;
-char buf[256], eof;
-int dbg;
-main(argc, argv) char **argv;
-{      int i, nmax, len;
-       char *p;
-       long now;
-       if(argc != 2)
-               xfatal("mail to exactly one person");
-       uid = getuid();
-       p =getlogin();
-       if(p == NULL)
-               p = getpwuid(uid)->pw_name;
-       myname = malloc(strlen(p)+1);
-       strcpy(myname, p);
-       dest = argv[1];
-       strcpy(keyfile, maildir);
-       strcat(keyfile, dest);
-       strcat(keyfile, ".key");
-       if(stat(keyfile, &stbuf) <0)
-               xfatal("addressee not enrolled");
-       destuid = getpwnam(dest)->pw_uid;
-       if(destuid != stbuf.st_uid)
-               fprintf(stderr, "warning: addressee's key file may be subverted\n");
-       errno = 0;
-       kf = fopen(keyfile, "r");
-       if(kf == NULL)
-               xfatal("addressee's key weird");
-       df = fopen(maildir, "r");
-       if(df == NULL)
-       {       perror(maildir);
-               exit(1);
-       }
-       strcpy(line, dest);
-       strcat(line, ".%d");
-       nmax = -1;
-       for(; !feof(df);)
-       {       fread(&dbuf, sizeof(dbuf), 1, df);
-               if(dbuf.d_ino == 0) continue;
-               if(sscanf(dbuf.d_name, line, &i) != 1)
-                       continue;
-               if(i>nmax) nmax = i;
-       }
-       nmax ++;
-       for(i=0; i<10; i++)
-       {       sprintf(line, "%s%s.%d", maildir, dest, nmax+i);
-               if(creat(line, 0666) >= 0) break;
-       }
-       if(i==10) xfatal("cannot create mail file");
-       mf = fopen(line, "w");
-       init();
-       time(&now);
-       sprintf(buf, "From %s %s", myname, ctime(&now) );
-#ifdef DBG
-       dbg = 1;
-#endif
-       run();
-       sprintf(buf, "mail %s <%snotice", dest, maildir);
-       system(buf);
-       exit(0);
-}
-mkcd()
-{      int i, j, k, n;
-       for(i=0; i<42; i++)
-               nin(a[i], kf);
-       fclose(kf);
-       for(i=0; i<6; i++)
-       for(j=0; j<128; j++)
-               for(k=j, n=0; k>0 && n<7; n++, k>>=1)
-                       if(k&01) madd(cd[i][j], a[7*i+n], cd[i][j]);
-}
-encipher(s) char s[6];
-{      int i;
-       msub(msg, msg, msg);
-       for(i=0; i<6; i++)
-               madd(msg, cd[i][s[i]&0177], msg);
-}
-init()
-{      int i, j;
-       msg = itom(0);
-       for(i=0; i<42; i++)
-               a[i] = itom(0);
-       for(i=0; i<6; i++)
-       for(j=0; j<128; j++)
-               cd[i][j] = itom(0);
-       mkcd();
-}
-run()
-{      char *p;
-       int i, len, eof = 0;
-       for(;;)
-       {       len = strlen(buf);
-               for(i=0; i<len/6; i++)
-               {
-                       encipher(buf+6*i);
-                       nout(msg, mf);
-               }
-               p = buf;
-               for(i *= 6; i<len; i++)
-                       *p++ = buf[i];
-               if(eof) return;
-               fgets(p, sizeof(buf)-6, stdin);
-               if(strcmp(p, ".\n") == 0 || feof(stdin))
-               {       for(i=0; i<6; i++) *p++ = ' ';
-                       *p = 0;
-                       eof = 1;
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/dextern b/.ref-Research-V7/usr/src/cmd/yacc/dextern
deleted file mode 100644 (file)
index dca3b2e..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-# include <stdio.h>
-# include <ctype.h>
-# include "files"
-
-       /*  MANIFEST CONSTANT DEFINITIONS */
-
-       /* base of nonterminal internal numbers */
-# define NTBASE 010000
-
-       /* internal codes for error and accept actions */
-
-# define ERRCODE  8190
-# define ACCEPTCODE 8191
-
-       /* sizes and limits */
-
-# ifdef HUGE
-# define ACTSIZE 12000
-# define MEMSIZE 12000
-# define NSTATES 750
-# define NTERMS 127
-# define NPROD 600
-# define NNONTERM 300
-# define TEMPSIZE 1200
-# define CNAMSZ 5000
-# define LSETSIZE 600
-# define WSETSIZE 350
-# endif
-
-# ifdef MEDIUM
-# define ACTSIZE 4000
-# define MEMSIZE 5200
-# define NSTATES 600
-# define NTERMS 127
-# define NPROD 400
-# define NNONTERM 200
-# define TEMPSIZE 800
-# define CNAMSZ 4000
-# define LSETSIZE 450
-# define WSETSIZE 250
-# endif
-
-# define NAMESIZE 50
-# define NTYPES 63
-
-# ifdef WORD32
-# define TBITSET ((32+NTERMS)/32)
-
-       /* bit packing macros (may be machine dependent) */
-# define BIT(a,i) ((a)[(i)>>5] & (1<<((i)&037)))
-# define SETBIT(a,i) ((a)[(i)>>5] |= (1<<((i)&037)))
-
-       /* number of words needed to hold n+1 bits */
-# define NWORDS(n) (((n)+32)/32)
-
-# else
-
-# define TBITSET ((16+NTERMS)/16)
-
-       /* bit packing macros (may be machine dependent) */
-# define BIT(a,i) ((a)[(i)>>4] & (1<<((i)&017)))
-# define SETBIT(a,i) ((a)[(i)>>4] |= (1<<((i)&017)))
-
-       /* number of words needed to hold n+1 bits */
-# define NWORDS(n) (((n)+16)/16)
-# endif
-
-       /* relationships which must hold:
-       TBITSET ints must hold NTERMS+1 bits...
-       WSETSIZE >= NNONTERM
-       LSETSIZE >= NNONTERM
-       TEMPSIZE >= NTERMS + NNONTERMs + 1
-       TEMPSIZE >= NSTATES
-       */
-
-       /* associativities */
-
-# define NOASC 0  /* no assoc. */
-# define LASC 1  /* left assoc. */
-# define RASC 2  /* right assoc. */
-# define BASC 3  /* binary assoc. */
-
-       /* flags for state generation */
-
-# define DONE 0
-# define MUSTDO 1
-# define MUSTLOOKAHEAD 2
-
-       /* flags for a rule having an action, and being reduced */
-
-# define ACTFLAG 04
-# define REDFLAG 010
-
-       /* output parser flags */
-# define YYFLAG1 (-1000)
-
-       /* macros for getting associativity and precedence levels */
-
-# define ASSOC(i) ((i)&03)
-# define PLEVEL(i) (((i)>>4)&077)
-# define TYPE(i)  ((i>>10)&077)
-
-       /* macros for setting associativity and precedence levels */
-
-# define SETASC(i,j) i|=j
-# define SETPLEV(i,j) i |= (j<<4)
-# define SETTYPE(i,j) i |= (j<<10)
-
-       /* looping macros */
-
-# define TLOOP(i) for(i=1;i<=ntokens;++i)
-# define NTLOOP(i) for(i=0;i<=nnonter;++i)
-# define PLOOP(s,i) for(i=s;i<nprod;++i)
-# define SLOOP(i) for(i=0;i<nstate;++i)
-# define WSBUMP(x) ++x
-# define WSLOOP(s,j) for(j=s;j<cwp;++j)
-# define ITMLOOP(i,p,q) q=pstate[i+1];for(p=pstate[i];p<q;++p)
-# define SETLOOP(i) for(i=0;i<tbitset;++i)
-
-       /* I/O descriptors */
-
-extern FILE * finput;          /* input file */
-extern FILE * faction;         /* file for saving actions */
-extern FILE *fdefine;          /* file for # defines */
-extern FILE * ftable;          /* y.tab.c file */
-extern FILE * ftemp;           /* tempfile to pass 2 */
-extern FILE * foutput;         /* y.output file */
-
-       /* structure declarations */
-
-struct looksets {
-       int lset[TBITSET];
-       };
-
-struct item {
-       int *pitem;
-       struct looksets *look;
-       };
-
-struct toksymb {
-       char *name;
-       int value;
-       };
-
-struct ntsymb {
-       char *name;
-       int tvalue;
-       };
-
-struct wset {
-       int *pitem;
-       int flag;
-       struct looksets ws;
-       };
-
-       /* token information */
-
-extern int ntokens ;   /* number of tokens */
-extern struct toksymb tokset[];
-extern int toklev[];   /* vector with the precedence of the terminals */
-
-       /* nonterminal information */
-
-extern int nnonter ;   /* the number of nonterminals */
-extern struct ntsymb nontrst[];
-
-       /* grammar rule information */
-
-extern int nprod ;     /* number of productions */
-extern int *prdptr[];  /* pointers to descriptions of productions */
-extern int levprd[] ;  /* contains production levels to break conflicts */
-
-       /* state information */
-
-extern int nstate ;            /* number of states */
-extern struct item *pstate[];  /* pointers to the descriptions of the states */
-extern int tystate[];  /* contains type information about the states */
-extern int defact[];   /* the default action of the state */
-extern int tstates[];  /* the states deriving each token */
-extern int ntstates[]; /* the states deriving each nonterminal */
-extern int mstates[];  /* the continuation of the chains begun in tstates and ntstates */
-
-       /* lookahead set information */
-
-extern struct looksets lkst[];
-extern int nolook;  /* flag to turn off lookahead computations */
-
-       /* working set information */
-
-extern struct wset wsets[];
-extern struct wset *cwp;
-
-       /* storage for productions */
-
-extern int mem0[];
-extern int *mem;
-
-       /* storage for action table */
-
-extern int amem[];  /* action table storage */
-extern int *memp ;             /* next free action table position */
-extern int indgo[];            /* index to the stored goto table */
-
-       /* temporary vector, indexable by states, terms, or ntokens */
-
-extern int temp1[];
-extern int lineno; /* current line number */
-
-       /* statistics collection variables */
-
-extern int zzgoent ;
-extern int zzgobest ;
-extern int zzacent ;
-extern int zzexcp ;
-extern int zzclose ;
-extern int zzrrconf ;
-extern int zzsrconf ;
-       /* define functions with strange types... */
-
-extern char *cstash();
-extern struct looksets *flset();
-extern char *symnam();
-extern char *writem();
-
-       /* default settings for a number of macros */
-
-       /* name of yacc tempfiles */
-
-# ifndef TEMPNAME
-# define TEMPNAME "yacc.tmp"
-# endif
-
-# ifndef ACTNAME
-# define ACTNAME "yacc.acts"
-# endif
-
-       /* output file name */
-
-# ifndef OFILE
-# define OFILE "y.tab.c"
-# endif
-
-       /* user output file name */
-
-# ifndef FILEU
-# define FILEU "y.output"
-# endif
-
-       /* output file for # defines */
-
-# ifndef FILED
-# define FILED "y.tab.h"
-# endif
-
-       /* command to clobber tempfiles after use */
-
-# ifndef ZAPFILE
-# define ZAPFILE(x) unlink(x)
-# endif
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/files b/.ref-Research-V7/usr/src/cmd/yacc/files
deleted file mode 100644 (file)
index 6a1c47a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-       /* this file has the location of the parser, and the size of the progam desired */
-       /* It may also contain definitions to override various defaults: for example,
-       /* WORD32 tells yacc that there are at least 32 bits per int */
-       /* on some systems, notably IBM, the names for the output files and tempfiles must
-       /* also be changed  */
-
-       /* location of the parser text file */
-# define PARSER "/usr/lib/yaccpar"
-
-       /* basic size of the Yacc implementation */
-# define MEDIUM
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/makefile b/.ref-Research-V7/usr/src/cmd/yacc/makefile
deleted file mode 100644 (file)
index 70d9f3e..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-CFLAGS=-O
-all: yacc
-       :
-
-cmp: all
-       cmp yacc /bin/yacc
-       rm yacc *.o
-
-cp:    all
-       cp yacc /bin/yacc
-       rm yacc *.o
-
-yacc: y1.o y2.o y3.o y4.o
-       cc -i -s -o yacc y?.o
-
-y1.o y2.o y3.o y4.o: dextern files
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/y1.c b/.ref-Research-V7/usr/src/cmd/yacc/y1.c
deleted file mode 100644 (file)
index 723f0db..0000000
+++ /dev/null
@@ -1,653 +0,0 @@
-# include "dextern"
-
-       /* variables used locally */
-
-       /* lookahead computations */
-
-int tbitset;  /* size of lookahead sets */
-struct looksets lkst [ LSETSIZE ];
-int nlset = 0; /* next lookahead set index */
-int nolook = 0; /* flag to suppress lookahead computations */
-struct looksets clset;  /* temporary storage for lookahead computations */
-
-       /* working set computations */
-
-struct wset wsets[ WSETSIZE ];
-struct wset *cwp;
-
-       /* state information */
-
-int nstate = 0;                /* number of states */
-struct item *pstate[NSTATES+2];        /* pointers to the descriptions of the states */
-int tystate[NSTATES];  /* contains type information about the states */
-int indgo[NSTATES];            /* index to the stored goto table */
-int tstates[ NTERMS ]; /* states generated by terminal gotos */
-int ntstates[ NNONTERM ]; /* states generated by nonterminal gotos */
-int mstates[ NSTATES ]; /* chain of overflows of term/nonterm generation lists  */
-
-       /* storage for the actions in the parser */
-
-int amem[ACTSIZE];     /* action table storage */
-int *memp = amem;      /* next free action table position */
-
-       /* other storage areas */
-
-int temp1[TEMPSIZE]; /* temporary storage, indexed by terms + ntokens or states */
-int lineno= 1; /* current input line number */
-int fatfl = 1;         /* if on, error is fatal */
-int nerrors = 0;       /* number of errors */
-
-       /* storage for information about the nonterminals */
-
-int **pres[NNONTERM+2];  /* vector of pointers to productions yielding each nonterminal */
-struct looksets *pfirst[NNONTERM+2];  /* vector of pointers to first sets for each nonterminal */
-int pempty[NNONTERM+1];  /* vector of nonterminals nontrivially deriving e */
-
-main(argc,argv) int argc; char *argv[]; {
-
-       setup(argc,argv); /* initialize and read productions */
-       tbitset = NWORDS(ntokens);
-       cpres(); /* make table of which productions yield a given nonterminal */
-       cempty(); /* make a table of which nonterminals can match the empty string */
-       cpfir(); /* make a table of firsts of nonterminals */
-       stagen(); /* generate the states */
-       output();  /* write the states and the tables */
-       go2out();
-       hideprod();
-       summary();
-       callopt();
-       others();
-       exit(0);
-       }
-
-others(){ /* put out other arrays, copy the parsers */
-       register c, i, j;
-
-       finput = fopen( PARSER, "r" );
-       if( finput == NULL ) error( "cannot find parser %s", PARSER );
-
-       warray( "yyr1", levprd, nprod );
-
-       aryfil( temp1, nprod, 0 );
-       PLOOP(1,i)temp1[i] = prdptr[i+1]-prdptr[i]-2;
-       warray( "yyr2", temp1, nprod );
-
-       aryfil( temp1, nstate, -1000 );
-       TLOOP(i){
-               for( j=tstates[i]; j!=0; j=mstates[j] ){
-                       temp1[j] = tokset[i].value;
-                       }
-               }
-       NTLOOP(i){
-               for( j=ntstates[i]; j!=0; j=mstates[j] ){
-                       temp1[j] = -i;
-                       }
-               }
-       warray( "yychk", temp1, nstate );
-
-       warray( "yydef", defact, nstate );
-
-       /* copy parser text */
-
-       while( (c=getc(finput) ) != EOF ){
-               if( c == '$' ){
-                       if( (c=getc(finput)) != 'A' ) putc( '$', ftable );
-                       else { /* copy actions */
-                               faction = fopen( ACTNAME, "r" );
-                               if( faction == NULL ) error( "cannot reopen action tempfile" );
-                               while( (c=getc(faction) ) != EOF ) putc( c, ftable );
-                               fclose(faction);
-                               ZAPFILE(ACTNAME);
-                               c = getc(finput);
-                               }
-                       }
-               putc( c, ftable );
-               }
-
-       fclose( ftable );
-       }
-
-char *chcopy( p, q )  char *p, *q; {
-       /* copies string q into p, returning next free char ptr */
-       while( *p = *q++ ) ++p;
-       return( p );
-       }
-
-# define ISIZE 400
-char *writem(pp) int *pp; { /* creates output string for item pointed to by pp */
-       int i,*p;
-       static char sarr[ISIZE];
-       char *q;
-
-       for( p=pp; *p>0 ; ++p ) ;
-       p = prdptr[-*p];
-       q = chcopy( sarr, nontrst[*p-NTBASE].name );
-       q = chcopy( q, " : " );
-
-       for(;;){
-               *q++ = ++p==pp ? '_' : ' ';
-               *q = '\0';
-               if((i = *p) <= 0) break;
-               q = chcopy( q, symnam(i) );
-               if( q> &sarr[ISIZE-30] ) error( "item too big" );
-               }
-
-       if( (i = *pp) < 0 ){ /* an item calling for a reduction */
-               q = chcopy( q, "    (" );
-               sprintf( q, "%d)", -i );
-               }
-
-       return( sarr );
-       }
-
-char *symnam(i){ /* return a pointer to the name of symbol i */
-       char *cp;
-
-       cp = (i>=NTBASE) ? nontrst[i-NTBASE].name : tokset[i].name ;
-       if( *cp == ' ' ) ++cp;
-       return( cp );
-       }
-
-struct wset *zzcwp = wsets;
-int zzgoent = 0;
-int zzgobest = 0;
-int zzacent = 0;
-int zzexcp = 0;
-int zzclose = 0;
-int zzsrconf = 0;
-int * zzmemsz = mem0;
-int zzrrconf = 0;
-
-summary(){ /* output the summary on the tty */
-
-       if( foutput!=NULL ){
-               fprintf( foutput, "\n%d/%d terminals, %d/%d nonterminals\n", ntokens, NTERMS,
-                           nnonter, NNONTERM );
-               fprintf( foutput, "%d/%d grammar rules, %d/%d states\n", nprod, NPROD, nstate, NSTATES );
-               fprintf( foutput, "%d shift/reduce, %d reduce/reduce conflicts reported\n", zzsrconf, zzrrconf );
-               fprintf( foutput, "%d/%d working sets used\n", zzcwp-wsets,  WSETSIZE );
-               fprintf( foutput, "memory: states,etc. %d/%d, parser %d/%d\n", zzmemsz-mem0, MEMSIZE,
-                           memp-amem, ACTSIZE );
-               fprintf( foutput, "%d/%d distinct lookahead sets\n", nlset, LSETSIZE );
-               fprintf( foutput, "%d extra closures\n", zzclose - 2*nstate );
-               fprintf( foutput, "%d shift entries, %d exceptions\n", zzacent, zzexcp );
-               fprintf( foutput, "%d goto entries\n", zzgoent );
-               fprintf( foutput, "%d entries saved by goto default\n", zzgobest );
-               }
-       if( zzsrconf!=0 || zzrrconf!=0 ){
-                 fprintf( stdout,"\nconflicts: ");
-                 if( zzsrconf )fprintf( stdout, "%d shift/reduce" , zzsrconf );
-                 if( zzsrconf && zzrrconf )fprintf( stdout, ", " );
-                 if( zzrrconf )fprintf( stdout, "%d reduce/reduce" , zzrrconf );
-                 fprintf( stdout, "\n" );
-                 }
-
-       fclose( ftemp );
-       if( fdefine != NULL ) fclose( fdefine );
-       }
-
-/* VARARGS1 */
-error(s,a1) char *s; { /* write out error comment */
-       
-       ++nerrors;
-       fprintf( stderr, "\n fatal error: ");
-       fprintf( stderr, s,a1);
-       fprintf( stderr, ", line %d\n", lineno );
-       if( !fatfl ) return;
-       summary();
-       exit(1);
-       }
-
-aryfil( v, n, c ) int *v,n,c; { /* set elements 0 through n-1 to c */
-       int i;
-       for( i=0; i<n; ++i ) v[i] = c;
-       }
-
-setunion( a, b ) register *a, *b; {
-       /* set a to the union of a and b */
-       /* return 1 if b is not a subset of a, 0 otherwise */
-       register i, x, sub;
-
-       sub = 0;
-       SETLOOP(i){
-               *a = (x = *a)|*b++;
-               if( *a++ != x ) sub = 1;
-               }
-       return( sub );
-       }
-
-prlook( p ) struct looksets *p;{
-       register j, *pp;
-       pp = p->lset;
-       if( pp == 0 ) fprintf( foutput, "\tNULL");
-       else {
-               fprintf( foutput, " { " );
-               TLOOP(j) {
-                       if( BIT(pp,j) ) fprintf( foutput,  "%s ", symnam(j) );
-                       }
-               fprintf( foutput,  "}" );
-               }
-       }
-
-cpres(){ /* compute an array with the beginnings of  productions yielding given nonterminals
-       The array pres points to these lists */
-       /* the array pyield has the lists: the total size is only NPROD+1 */
-       register **pmem;
-       register c, j, i;
-       static int * pyield[NPROD];
-
-       pmem = pyield;
-
-       NTLOOP(i){
-               c = i+NTBASE;
-               pres[i] = pmem;
-               fatfl = 0;  /* make undefined  symbols  nonfatal */
-               PLOOP(0,j){
-                       if (*prdptr[j] == c) *pmem++ =  prdptr[j]+1;
-                       }
-               if(pres[i] == pmem){
-                       error("nonterminal %s not defined!", nontrst[i].name);
-                       }
-               }
-       pres[i] = pmem;
-       fatfl = 1;
-       if( nerrors ){
-               summary();
-               exit(1);
-               }
-       if( pmem != &pyield[nprod] ) error( "internal Yacc error: pyield %d", pmem-&pyield[nprod] );
-       }
-
-int indebug = 0;
-cpfir() {
-       /* compute an array with the first of nonterminals */
-       register *p, **s, i, **t, ch, changes;
-
-       zzcwp = &wsets[nnonter];
-       NTLOOP(i){
-               aryfil( wsets[i].ws.lset, tbitset, 0 );
-               t = pres[i+1];
-               for( s=pres[i]; s<t; ++s ){ /* initially fill the sets */
-                       for( p = *s; (ch = *p) > 0 ; ++p ) {
-                               if( ch < NTBASE ) {
-                                       SETBIT( wsets[i].ws.lset, ch );
-                                       break;
-                                       }
-                               else if( !pempty[ch-NTBASE] ) break;
-                               }
-                       }
-               }
-
-       /* now, reflect transitivity */
-
-       changes = 1;
-       while( changes ){
-               changes = 0;
-               NTLOOP(i){
-                       t = pres[i+1];
-                       for( s=pres[i]; s<t; ++s ){
-                               for( p = *s; ( ch = (*p-NTBASE) ) >= 0; ++p ) {
-                                       changes |= setunion( wsets[i].ws.lset, wsets[ch].ws.lset );
-                                       if( !pempty[ch] ) break;
-                                       }
-                               }
-                       }
-               }
-
-       NTLOOP(i) pfirst[i] = flset( &wsets[i].ws );
-       if( !indebug ) return;
-       if( (foutput!=NULL) ){
-               NTLOOP(i) {
-                       fprintf( foutput,  "\n%s: ", nontrst[i].name );
-                       prlook( pfirst[i] );
-                       fprintf( foutput,  " %d\n", pempty[i] );
-                       }
-               }
-       }
-
-state(c){ /* sorts last state,and sees if it equals earlier ones. returns state number */
-       int size1,size2;
-       register i;
-       struct item *p1, *p2, *k, *l, *q1, *q2;
-       p1 = pstate[nstate];
-       p2 = pstate[nstate+1];
-       if(p1==p2) return(0); /* null state */
-       /* sort the items */
-       for(k=p2-1;k>p1;k--) {  /* make k the biggest */
-               for(l=k-1;l>=p1;--l)if( l->pitem > k->pitem ){
-                       int *s;
-                       struct looksets *ss;
-                       s = k->pitem;
-                       k->pitem = l->pitem;
-                       l->pitem = s;
-                       ss = k->look;
-                       k->look = l->look;
-                       l->look = ss;
-                       }
-               }
-       size1 = p2 - p1; /* size of state */
-
-       for( i= (c>=NTBASE)?ntstates[c-NTBASE]:tstates[c]; i != 0; i = mstates[i] ) {
-               /* get ith state */
-               q1 = pstate[i];
-               q2 = pstate[i+1];
-               size2 = q2 - q1;
-               if (size1 != size2) continue;
-               k=p1;
-               for(l=q1;l<q2;l++) {
-                       if( l->pitem != k->pitem ) break;
-                       ++k;
-                       }
-               if (l != q2) continue;
-               /* found it */
-               pstate[nstate+1] = pstate[nstate]; /* delete last state */
-               /* fix up lookaheads */
-               if( nolook ) return(i);
-               for( l=q1,k=p1; l<q2; ++l,++k ){
-                       int s;
-                       SETLOOP(s) clset.lset[s] = l->look->lset[s];
-                       if( setunion( clset.lset, k->look->lset ) ) {
-                               tystate[i] = MUSTDO;
-                               /* register the new set */
-                               l->look = flset( &clset );
-                               }
-                       }
-               return (i);
-               }
-       /* state is new */
-       if( nolook ) error( "yacc state/nolook error" );
-       pstate[nstate+2] = p2;
-       if(nstate+1 >= NSTATES) error("too many states" );
-       if( c >= NTBASE ){
-               mstates[ nstate ] = ntstates[ c-NTBASE ];
-               ntstates[ c-NTBASE ] = nstate;
-               }
-       else {
-               mstates[ nstate ] = tstates[ c ];
-               tstates[ c ] = nstate;
-               }
-       tystate[nstate]=MUSTDO;
-       return(nstate++);
-       }
-
-int pidebug = 0; /* debugging flag for putitem */
-putitem( ptr, lptr )  int *ptr;  struct looksets *lptr; {
-       register struct item *j;
-
-       if( pidebug && (foutput!=NULL) ) {
-               fprintf( foutput, "putitem(%s), state %d\n", writem(ptr), nstate );
-               }
-       j = pstate[nstate+1];
-       j->pitem = ptr;
-       if( !nolook ) j->look = flset( lptr );
-       pstate[nstate+1] = ++j;
-       if( (int *)j > zzmemsz ){
-               zzmemsz = (int *)j;
-               if( zzmemsz >=  &mem0[MEMSIZE] ) error( "out of state space" );
-               }
-       }
-
-cempty(){ /* mark nonterminals which derive the empty string */
-       /* also, look for nonterminals which don't derive any token strings */
-
-# define EMPTY 1
-# define WHOKNOWS 0
-# define OK 1
-
-       register i, *p;
-
-       /* first, use the array pempty to detect productions that can never be reduced */
-       /* set pempty to WHONOWS */
-       aryfil( pempty, nnonter+1, WHOKNOWS );
-
-       /* now, look at productions, marking nonterminals which derive something */
-
-       more:
-       PLOOP(0,i){
-               if( pempty[ *prdptr[i] - NTBASE ] ) continue;
-               for( p=prdptr[i]+1; *p>=0; ++p ){
-                       if( *p>=NTBASE && pempty[ *p-NTBASE ] == WHOKNOWS ) break;
-                       }
-               if( *p < 0 ){ /* production can be derived */
-                       pempty[ *prdptr[i]-NTBASE ] = OK;
-                       goto more;
-                       }
-               }
-
-       /* now, look at the nonterminals, to see if they are all OK */
-
-       NTLOOP(i){
-               /* the added production rises or falls as the start symbol ... */
-               if( i == 0 ) continue;
-               if( pempty[ i ] != OK ) {
-                       fatfl = 0;
-                       error( "nonterminal %s never derives any token string", nontrst[i].name );
-                       }
-               }
-
-       if( nerrors ){
-               summary();
-               exit(1);
-               }
-
-       /* now, compute the pempty array, to see which nonterminals derive the empty string */
-
-       /* set pempty to WHOKNOWS */
-
-       aryfil( pempty, nnonter+1, WHOKNOWS );
-
-       /* loop as long as we keep finding empty nonterminals */
-
-again:
-       PLOOP(1,i){
-               if( pempty[ *prdptr[i]-NTBASE ]==WHOKNOWS ){ /* not known to be empty */
-                       for( p=prdptr[i]+1; *p>=NTBASE && pempty[*p-NTBASE]==EMPTY ; ++p ) ;
-                       if( *p < 0 ){ /* we have a nontrivially empty nonterminal */
-                               pempty[*prdptr[i]-NTBASE] = EMPTY;
-                               goto again; /* got one ... try for another */
-                               }
-                       }
-               }
-
-       }
-
-int gsdebug = 0;
-stagen(){ /* generate the states */
-
-       int i, j;
-       register c;
-       register struct wset *p, *q;
-
-       /* initialize */
-
-       nstate = 0;
-       /* THIS IS FUNNY from the standpoint of portability */
-       /* it represents the magic moment when the mem0 array, which has
-       /* been holding the productions, starts to hold item pointers, of a
-       /* different type... */
-       /* someday, alloc should be used to allocate all this stuff... for now, we
-       /* accept that if pointers don't fit in integers, there is a problem... */
-
-       pstate[0] = pstate[1] = (struct item *)mem;
-       aryfil( clset.lset, tbitset, 0 );
-       putitem( prdptr[0]+1, &clset );
-       tystate[0] = MUSTDO;
-       nstate = 1;
-       pstate[2] = pstate[1];
-
-       aryfil( amem, ACTSIZE, 0 );
-
-       /* now, the main state generation loop */
-
-       more:
-       SLOOP(i){
-               if( tystate[i] != MUSTDO ) continue;
-               tystate[i] = DONE;
-               aryfil( temp1, nnonter+1, 0 );
-               /* take state i, close it, and do gotos */
-               closure(i);
-               WSLOOP(wsets,p){ /* generate goto's */
-                       if( p->flag ) continue;
-                       p->flag = 1;
-                       c = *(p->pitem);
-                       if( c <= 1 ) {
-                               if( pstate[i+1]-pstate[i] <= p-wsets ) tystate[i] = MUSTLOOKAHEAD;
-                               continue;
-                               }
-                       /* do a goto on c */
-                       WSLOOP(p,q){
-                               if( c == *(q->pitem) ){ /* this item contributes to the goto */
-                                       putitem( q->pitem + 1, &q->ws );
-                                       q->flag = 1;
-                                       }
-                               }
-                       if( c < NTBASE ) {
-                               state(c);  /* register new state */
-                               }
-                       else {
-                               temp1[c-NTBASE] = state(c);
-                               }
-                       }
-               if( gsdebug && (foutput!=NULL) ){
-                       fprintf( foutput,  "%d: ", i );
-                       NTLOOP(j) {
-                               if( temp1[j] ) fprintf( foutput,  "%s %d, ", nontrst[j].name, temp1[j] );
-                               }
-                       fprintf( foutput, "\n");
-                       }
-               indgo[i] = apack( &temp1[1], nnonter-1 ) - 1;
-               goto more; /* we have done one goto; do some more */
-               }
-       /* no more to do... stop */
-       }
-
-int cldebug = 0; /* debugging flag for closure */
-closure(i){ /* generate the closure of state i */
-
-       int c, ch, work, k;
-       register struct wset *u, *v;
-       int *pi;
-       int **s, **t;
-       struct item *q;
-       register struct item *p;
-
-       ++zzclose;
-
-       /* first, copy kernel of state i to wsets */
-
-       cwp = wsets;
-       ITMLOOP(i,p,q){
-               cwp->pitem = p->pitem;
-               cwp->flag = 1;    /* this item must get closed */
-               SETLOOP(k) cwp->ws.lset[k] = p->look->lset[k];
-               WSBUMP(cwp);
-               }
-
-       /* now, go through the loop, closing each item */
-
-       work = 1;
-       while( work ){
-               work = 0;
-               WSLOOP(wsets,u){
-       
-                       if( u->flag == 0 ) continue;
-                       c = *(u->pitem);  /* dot is before c */
-       
-                       if( c < NTBASE ){
-                               u->flag = 0;
-                               continue;  /* only interesting case is where . is before nonterminal */
-                               }
-       
-                       /* compute the lookahead */
-                       aryfil( clset.lset, tbitset, 0 );
-
-                       /* find items involving c */
-
-                       WSLOOP(u,v){
-                               if( v->flag == 1 && *(pi=v->pitem) == c ){
-                                       v->flag = 0;
-                                       if( nolook ) continue;
-                                       while( (ch= *++pi)>0 ){
-                                               if( ch < NTBASE ){ /* terminal symbol */
-                                                       SETBIT( clset.lset, ch );
-                                                       break;
-                                                       }
-                                               /* nonterminal symbol */
-                                               setunion( clset.lset, pfirst[ch-NTBASE]->lset );
-                                               if( !pempty[ch-NTBASE] ) break;
-                                               }
-                                       if( ch<=0 ) setunion( clset.lset, v->ws.lset );
-                                       }
-                               }
-       
-                       /*  now loop over productions derived from c */
-       
-                       c -= NTBASE; /* c is now nonterminal number */
-       
-                       t = pres[c+1];
-                       for( s=pres[c]; s<t; ++s ){
-                               /* put these items into the closure */
-                               WSLOOP(wsets,v){ /* is the item there */
-                                       if( v->pitem == *s ){ /* yes, it is there */
-                                               if( nolook ) goto nexts;
-                                               if( setunion( v->ws.lset, clset.lset ) ) v->flag = work = 1;
-                                               goto nexts;
-                                               }
-                                       }
-       
-                               /*  not there; make a new entry */
-                               if( cwp-wsets+1 >= WSETSIZE ) error( "working set overflow" );
-                               cwp->pitem = *s;
-                               cwp->flag = 1;
-                               if( !nolook ){
-                                       work = 1;
-                                       SETLOOP(k) cwp->ws.lset[k] = clset.lset[k];
-                                       }
-                               WSBUMP(cwp);
-       
-                       nexts: ;
-                               }
-       
-                       }
-               }
-
-       /* have computed closure; flags are reset; return */
-
-       if( cwp > zzcwp ) zzcwp = cwp;
-       if( cldebug && (foutput!=NULL) ){
-               fprintf( foutput, "\nState %d, nolook = %d\n", i, nolook );
-               WSLOOP(wsets,u){
-                       if( u->flag ) fprintf( foutput, "flag set!\n");
-                       u->flag = 0;
-                       fprintf( foutput, "\t%s", writem(u->pitem));
-                       prlook( &u->ws );
-                       fprintf( foutput,  "\n" );
-                       }
-               }
-       }
-
-struct looksets *flset( p )   struct looksets *p; {
-       /* decide if the lookahead set pointed to by p is known */
-       /* return pointer to a perminent location for the set */
-
-       register struct looksets *q;
-       int j, *w;
-       register *u, *v;
-
-       for( q = &lkst[nlset]; q-- > lkst; ){
-               u = p->lset;
-               v = q->lset;
-               w = & v[tbitset];
-               while( v<w) if( *u++ != *v++ ) goto more;
-               /* we have matched */
-               return( q );
-               more: ;
-               }
-       /* add a new one */
-       q = &lkst[nlset++];
-       if( nlset >= LSETSIZE )error("too many lookahead sets" );
-       SETLOOP(j){
-               q->lset[j] = p->lset[j];
-               }
-       return( q );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/y2.c b/.ref-Research-V7/usr/src/cmd/yacc/y2.c
deleted file mode 100644 (file)
index a625896..0000000
+++ /dev/null
@@ -1,859 +0,0 @@
-# include "dextern"
-# define IDENTIFIER 257
-# define MARK 258
-# define TERM 259
-# define LEFT 260
-# define RIGHT 261
-# define BINARY 262
-# define PREC 263
-# define LCURLY 264
-# define C_IDENTIFIER 265  /* name followed by colon */
-# define NUMBER 266
-# define START 267
-# define TYPEDEF 268
-# define TYPENAME 269
-# define UNION 270
-# define ENDFILE 0
-
-       /* communication variables between various I/O routines */
-
-char *infile;  /* input file name */
-int numbval;   /* value of an input number */
-char tokname[NAMESIZE];        /* input token name */
-
-       /* storage of names */
-
-char cnames[CNAMSZ];   /* place where token and nonterminal names are stored */
-int cnamsz = CNAMSZ;   /* size of cnames */
-char * cnamp = cnames; /* place where next name is to be put in */
-int ndefout = 3;  /* number of defined symbols output */
-
-       /* storage of types */
-int ntypes;    /* number of types defined */
-char * typeset[NTYPES];        /* pointers to type tags */
-
-       /* symbol tables for tokens and nonterminals */
-
-int ntokens = 0;
-struct toksymb tokset[NTERMS];
-int toklev[NTERMS];
-int nnonter = -1;
-struct ntsymb nontrst[NNONTERM];
-int start;     /* start symbol */
-
-       /* assigned token type values */
-int extval = 0;
-
-       /* input and output file descriptors */
-
-FILE * finput;         /* yacc input file */
-FILE * faction;                /* file for saving actions */
-FILE * fdefine;                /* file for # defines */
-FILE * ftable;         /* y.tab.c file */
-FILE * ftemp;          /* tempfile to pass 2 */
-FILE * foutput;                /* y.output file */
-
-       /* storage for grammar rules */
-
-int mem0[MEMSIZE] ; /* production storage */
-int *mem = mem0;
-int nprod= 1;  /* number of productions */
-int *prdptr[NPROD];    /* pointers to descriptions of productions */
-int levprd[NPROD] ;    /* precedence levels for the productions */
-
-
-setup(argc,argv) int argc; char *argv[];
-{      int i,j,lev,t, ty;
-       int c;
-       int *p;
-       char actname[8];
-
-       foutput = NULL;
-       fdefine = NULL;
-       i = 1;
-       while( argc >= 2  && argv[1][0] == '-' ) {
-               while( *++(argv[1]) ){
-                       switch( *argv[1] ){
-                       case 'v':
-                       case 'V':
-                               foutput = fopen(FILEU, "w" );
-                               if( foutput == NULL ) error( "cannot open y.output" );
-                               continue;
-                       case 'D':
-                       case 'd':
-                               fdefine = fopen( FILED, "w" );
-                               continue;
-                       case 'o':
-                       case 'O':
-                               fprintf( stderr, "`o' flag now default in yacc\n" );
-                               continue;
-
-                       case 'r':
-                       case 'R':
-                               error( "Ratfor Yacc is dead: sorry...\n" );
-
-                       default:
-                               error( "illegal option: %c", *argv[1]);
-                               }
-                       }
-               argv++;
-               argc--;
-               }
-
-       ftable = fopen( OFILE, "w" );
-       if( ftable == NULL ) error( "cannot open table file" );
-
-       ftemp = fopen( TEMPNAME, "w" );
-       faction = fopen( ACTNAME, "w" );
-       if( ftemp==NULL || faction==NULL ) error( "cannot open temp file" );
-
-       if( argc < 2 || ((finput=fopen( infile=argv[1], "r" )) == NULL ) ){
-               error( "cannot open input file" );
-               }
-
-       cnamp = cnames;
-       defin(0,"$end");
-       extval = 0400;
-       defin(0,"error");
-       defin(1,"$accept");
-       mem=mem0;
-       lev = 0;
-       ty = 0;
-       i=0;
-
-       /* sorry -- no yacc parser here.....
-               we must bootstrap somehow... */
-
-       for( t=gettok();  t!=MARK && t!= ENDFILE; ){
-               switch( t ){
-
-               case ';':
-                       t = gettok();
-                       break;
-
-               case START:
-                       if( (t=gettok()) != IDENTIFIER ){
-                               error( "bad %%start construction" );
-                               }
-                       start = chfind(1,tokname);
-                       t = gettok();
-                       continue;
-
-               case TYPEDEF:
-                       if( (t=gettok()) != TYPENAME ) error( "bad syntax in %%type" );
-                       ty = numbval;
-                       for(;;){
-                               t = gettok();
-                               switch( t ){
-
-                               case IDENTIFIER:
-                                       if( (t=chfind( 1, tokname ) ) < NTBASE ) {
-                                               j = TYPE( toklev[t] );
-                                               if( j!= 0 && j != ty ){
-                                                       error( "type redeclaration of token %s",
-                                                               tokset[t].name );
-                                                       }
-                                               else SETTYPE( toklev[t],ty);
-                                               }
-                                       else {
-                                               j = nontrst[t-NTBASE].tvalue;
-                                               if( j != 0 && j != ty ){
-                                                       error( "type redeclaration of nonterminal %s",
-                                                               nontrst[t-NTBASE].name );
-                                                       }
-                                               else nontrst[t-NTBASE].tvalue = ty;
-                                               }
-                               case ',':
-                                       continue;
-
-                               case ';':
-                                       t = gettok();
-                                       break;
-                               default:
-                                       break;
-                                       }
-                               break;
-                               }
-                       continue;
-
-               case UNION:
-                       /* copy the union declaration to the output */
-                       cpyunion();
-                       t = gettok();
-                       continue;
-
-               case LEFT:
-               case BINARY:
-               case RIGHT:
-                       ++i;
-               case TERM:
-                       lev = t-TERM;  /* nonzero means new prec. and assoc. */
-                       ty = 0;
-
-                       /* get identifiers so defined */
-
-                       t = gettok();
-                       if( t == TYPENAME ){ /* there is a type defined */
-                               ty = numbval;
-                               t = gettok();
-                               }
-
-                       for(;;) {
-                               switch( t ){
-
-                               case ',':
-                                       t = gettok();
-                                       continue;
-
-                               case ';':
-                                       break;
-
-                               case IDENTIFIER:
-                                       j = chfind(0,tokname);
-                                       if( lev ){
-                                               if( ASSOC(toklev[j]) ) error( "redeclaration of precedence of %s", tokname );
-                                               SETASC(toklev[j],lev);
-                                               SETPLEV(toklev[j],i);
-                                               }
-                                       if( ty ){
-                                               if( TYPE(toklev[j]) ) error( "redeclaration of type of %s", tokname );
-                                               SETTYPE(toklev[j],ty);
-                                               }
-                                       if( (t=gettok()) == NUMBER ){
-                                               tokset[j].value = numbval;
-                                               if( j < ndefout && j>2 ){
-                                                       error( "please define type number of %s earlier",
-                                                               tokset[j].name );
-                                                       }
-                                               t=gettok();
-                                               }
-                                       continue;
-
-                                       }
-
-                               break;
-                               }
-
-                       continue;
-
-               case LCURLY:
-                       defout();
-                       cpycode();
-                       t = gettok();
-                       continue;
-
-               default:
-                       error( "syntax error" );
-
-                       }
-
-               }
-
-       if( t == ENDFILE ){
-               error( "unexpected EOF before %%" );
-               }
-
-       /* t is MARK */
-
-       defout();
-
-               fprintf( ftable,  "#define yyclearin yychar = -1\n" );
-               fprintf( ftable,  "#define yyerrok yyerrflag = 0\n" );
-               fprintf( ftable,  "extern int yychar;\nextern short yyerrflag;\n" );
-               fprintf( ftable,  "#ifndef YYMAXDEPTH\n#define YYMAXDEPTH 150\n#endif\n" );
-               if( !ntypes ) fprintf( ftable,  "#ifndef YYSTYPE\n#define YYSTYPE int\n#endif\n" );
-               fprintf( ftable,  "YYSTYPE yylval, yyval;\n" );
-
-       prdptr[0]=mem;
-       /* added production */
-       *mem++ = NTBASE;
-       *mem++ = start;  /* if start is 0, we will overwrite with the lhs of the first rule */
-       *mem++ = 1;
-       *mem++ = 0;
-       prdptr[1]=mem;
-
-       while( (t=gettok()) == LCURLY ) cpycode();
-
-       if( t != C_IDENTIFIER ) error( "bad syntax on first rule" );
-
-       if( !start ) prdptr[0][1] = chfind(1,tokname);
-
-       /* read rules */
-
-       while( t!=MARK && t!=ENDFILE ){
-
-               /* process a rule */
-
-               if( t == '|' ){
-                       *mem++ = *prdptr[nprod-1];
-                       }
-               else if( t == C_IDENTIFIER ){
-                       *mem = chfind(1,tokname);
-                       if( *mem < NTBASE ) error( "token illegal on LHS of grammar rule" );
-                       ++mem;
-                       }
-               else error( "illegal rule: missing semicolon or | ?" );
-
-               /* read rule body */
-
-
-               t = gettok();
-       more_rule:
-               while( t == IDENTIFIER ) {
-                       *mem = chfind(1,tokname);
-                       if( *mem<NTBASE ) levprd[nprod] = toklev[*mem];
-                       ++mem;
-                       t = gettok();
-                       }
-
-
-               if( t == PREC ){
-                       if( gettok()!=IDENTIFIER) error( "illegal %%prec syntax" );
-                       j = chfind(2,tokname);
-                       if( j>=NTBASE)error("nonterminal %s illegal after %%prec", nontrst[j-NTBASE].name);
-                       levprd[nprod]=toklev[j];
-                       t = gettok();
-                       }
-
-               if( t == '=' ){
-                       levprd[nprod] |= ACTFLAG;
-                       fprintf( faction, "\ncase %d:", nprod );
-                       cpyact( mem-prdptr[nprod]-1 );
-                       fprintf( faction, " break;" );
-                       if( (t=gettok()) == IDENTIFIER ){
-                               /* action within rule... */
-
-                               sprintf( actname, "$$%d", nprod );
-                               j = chfind(1,actname);  /* make it a nonterminal */
-
-                               /* the current rule will become rule number nprod+1 */
-                               /* move the contents down, and make room for the null */
-
-                               for( p=mem; p>=prdptr[nprod]; --p ) p[2] = *p;
-                               mem += 2;
-
-                               /* enter null production for action */
-
-                               p = prdptr[nprod];
-
-                               *p++ = j;
-                               *p++ = -nprod;
-
-                               /* update the production information */
-
-                               levprd[nprod+1] = levprd[nprod] & ~ACTFLAG;
-                               levprd[nprod] = ACTFLAG;
-
-                               if( ++nprod >= NPROD ) error( "more than %d rules", NPROD );
-                               prdptr[nprod] = p;
-
-                               /* make the action appear in the original rule */
-                               *mem++ = j;
-
-                               /* get some more of the rule */
-
-                               goto more_rule;
-                               }
-
-                       }
-
-               while( t == ';' ) t = gettok();
-
-               *mem++ = -nprod;
-
-               /* check that default action is reasonable */
-
-               if( ntypes && !(levprd[nprod]&ACTFLAG) && nontrst[*prdptr[nprod]-NTBASE].tvalue ){
-                       /* no explicit action, LHS has value */
-                       register tempty;
-                       tempty = prdptr[nprod][1];
-                       if( tempty < 0 ) error( "must return a value, since LHS has a type" );
-                       else if( tempty >= NTBASE ) tempty = nontrst[tempty-NTBASE].tvalue;
-                       else tempty = TYPE( toklev[tempty] );
-                       if( tempty != nontrst[*prdptr[nprod]-NTBASE].tvalue ){
-                               error( "default action causes potential type clash" );
-                               }
-                       }
-
-               if( ++nprod >= NPROD ) error( "more than %d rules", NPROD );
-               prdptr[nprod] = mem;
-               levprd[nprod]=0;
-
-               }
-
-       /* end of all rules */
-
-       finact();
-       if( t == MARK ){
-               fprintf( ftable, "\n# line %d \"%s\"\n", lineno, infile );
-               while( (c=getc(finput)) != EOF ) putc( c, ftable );
-               }
-       fclose( finput );
-       }
-
-finact(){
-       /* finish action routine */
-
-       fclose(faction);
-
-       fprintf( ftable, "# define YYERRCODE %d\n", tokset[2].value );
-
-       }
-
-defin( t, s ) register char  *s; {
-/*     define s to be a terminal if t=0
-       or a nonterminal if t=1         */
-
-       register val;
-
-       if (t) {
-               if( ++nnonter >= NNONTERM ) error("too many nonterminals, limit %d",NNONTERM);
-               nontrst[nnonter].name = cstash(s);
-               return( NTBASE + nnonter );
-               }
-       /* must be a token */
-       if( ++ntokens >= NTERMS ) error("too many terminals, limit %d",NTERMS );
-       tokset[ntokens].name = cstash(s);
-
-       /* establish value for token */
-
-       if( s[0]==' ' && s[2]=='\0' ) /* single character literal */
-               val = s[1];
-       else if ( s[0]==' ' && s[1]=='\\' ) { /* escape sequence */
-               if( s[3] == '\0' ){ /* single character escape sequence */
-                       switch ( s[2] ){
-                                        /* character which is escaped */
-                       case 'n': val = '\n'; break;
-                       case 'r': val = '\r'; break;
-                       case 'b': val = '\b'; break;
-                       case 't': val = '\t'; break;
-                       case 'f': val = '\f'; break;
-                       case '\'': val = '\''; break;
-                       case '"': val = '"'; break;
-                       case '\\': val = '\\'; break;
-                       default: error( "invalid escape" );
-                               }
-                       }
-               else if( s[2] <= '7' && s[2]>='0' ){ /* \nnn sequence */
-                       if( s[3]<'0' || s[3] > '7' || s[4]<'0' ||
-                               s[4]>'7' || s[5] != '\0' ) error("illegal \\nnn construction" );
-                       val = 64*s[2] + 8*s[3] + s[4] - 73*'0';
-                       if( val == 0 ) error( "'\\000' is illegal" );
-                       }
-               }
-       else {
-               val = extval++;
-               }
-       tokset[ntokens].value = val;
-       toklev[ntokens] = 0;
-       return( ntokens );
-       }
-
-defout(){ /* write out the defines (at the end of the declaration section) */
-
-       register int i, c;
-       register char *cp;
-
-       for( i=ndefout; i<=ntokens; ++i ){
-
-               cp = tokset[i].name;
-               if( *cp == ' ' ) ++cp;  /* literals */
-
-               for( ; (c= *cp)!='\0'; ++cp ){
-
-                       if( islower(c) || isupper(c) || isdigit(c) || c=='_' );  /* VOID */
-                       else goto nodef;
-                       }
-
-               fprintf( ftable, "# define %s %d\n", tokset[i].name, tokset[i].value );
-               if( fdefine != NULL ) fprintf( fdefine, "# define %s %d\n", tokset[i].name, tokset[i].value );
-
-       nodef:  ;
-               }
-
-       ndefout = ntokens+1;
-
-       }
-
-char *
-cstash( s ) register char *s; {
-       char *temp;
-
-       temp = cnamp;
-       do {
-               if( cnamp >= &cnames[cnamsz] ) error("too many characters in id's and literals" );
-               else *cnamp++ = *s;
-               }  while ( *s++ );
-       return( temp );
-       }
-
-gettok() {
-       register i, base;
-       static int peekline; /* number of '\n' seen in lookahead */
-       register c, match, reserve;
-
-begin:
-       reserve = 0;
-       lineno += peekline;
-       peekline = 0;
-       c = getc(finput);
-       while( c==' ' || c=='\n' || c=='\t' || c=='\f' ){
-               if( c == '\n' ) ++lineno;
-               c=getc(finput);
-               }
-       if( c == '/' ){ /* skip comment */
-               lineno += skipcom();
-               goto begin;
-               }
-
-       switch(c){
-
-       case EOF:
-               return(ENDFILE);
-       case '{':
-               ungetc( c, finput );
-               return( '=' );  /* action ... */
-       case '<':  /* get, and look up, a type name (union member name) */
-               i = 0;
-               while( (c=getc(finput)) != '>' && c>=0 && c!= '\n' ){
-                       tokname[i] = c;
-                       if( ++i >= NAMESIZE ) --i;
-                       }
-               if( c != '>' ) error( "unterminated < ... > clause" );
-               tokname[i] = '\0';
-               for( i=1; i<=ntypes; ++i ){
-                       if( !strcmp( typeset[i], tokname ) ){
-                               numbval = i;
-                               return( TYPENAME );
-                               }
-                       }
-               typeset[numbval = ++ntypes] = cstash( tokname );
-               return( TYPENAME );
-
-       case '"':       
-       case '\'':
-               match = c;
-               tokname[0] = ' ';
-               i = 1;
-               for(;;){
-                       c = getc(finput);
-                       if( c == '\n' || c == EOF )
-                               error("illegal or missing ' or \"" );
-                       if( c == '\\' ){
-                               c = getc(finput);
-                               tokname[i] = '\\';
-                               if( ++i >= NAMESIZE ) --i;
-                               }
-                       else if( c == match ) break;
-                       tokname[i] = c;
-                       if( ++i >= NAMESIZE ) --i;
-                       }
-               break;
-
-       case '%':
-       case '\\':
-
-               switch(c=getc(finput)) {
-
-               case '0':       return(TERM);
-               case '<':       return(LEFT);
-               case '2':       return(BINARY);
-               case '>':       return(RIGHT);
-               case '%':
-               case '\\':      return(MARK);
-               case '=':       return(PREC);
-               case '{':       return(LCURLY);
-               default:        reserve = 1;
-                       }
-
-       default:
-
-               if( isdigit(c) ){ /* number */
-                       numbval = c-'0' ;
-                       base = (c=='0') ? 8 : 10 ;
-                       for( c=getc(finput); isdigit(c) ; c=getc(finput) ){
-                               numbval = numbval*base + c - '0';
-                               }
-                       ungetc( c, finput );
-                       return(NUMBER);
-                       }
-               else if( islower(c) || isupper(c) || c=='_' || c=='.' || c=='$' ){
-                       i = 0;
-                       while( islower(c) || isupper(c) || isdigit(c) || c=='_' || c=='.' || c=='$' ){
-                               tokname[i] = c;
-                               if( reserve && isupper(c) ) tokname[i] += 'a'-'A';
-                               if( ++i >= NAMESIZE ) --i;
-                               c = getc(finput);
-                               }
-                       }
-               else return(c);
-
-               ungetc( c, finput );
-               }
-
-       tokname[i] = '\0';
-
-       if( reserve ){ /* find a reserved word */
-               if( !strcmp(tokname,"term")) return( TERM );
-               if( !strcmp(tokname,"token")) return( TERM );
-               if( !strcmp(tokname,"left")) return( LEFT );
-               if( !strcmp(tokname,"nonassoc")) return( BINARY );
-               if( !strcmp(tokname,"binary")) return( BINARY );
-               if( !strcmp(tokname,"right")) return( RIGHT );
-               if( !strcmp(tokname,"prec")) return( PREC );
-               if( !strcmp(tokname,"start")) return( START );
-               if( !strcmp(tokname,"type")) return( TYPEDEF );
-               if( !strcmp(tokname,"union")) return( UNION );
-               error("invalid escape, or illegal reserved word: %s", tokname );
-               }
-
-       /* look ahead to distinguish IDENTIFIER from C_IDENTIFIER */
-
-       c = getc(finput);
-       while( c==' ' || c=='\t'|| c=='\n' || c=='\f' || c== '/' ) {
-               if( c == '\n' ) ++peekline;
-               else if( c == '/' ){ /* look for comments */
-                       peekline += skipcom();
-                       }
-               c = getc(finput);
-               }
-       if( c == ':' ) return( C_IDENTIFIER );
-       ungetc( c, finput );
-       return( IDENTIFIER );
-}
-
-fdtype( t ){ /* determine the type of a symbol */
-       register v;
-       if( t >= NTBASE ) v = nontrst[t-NTBASE].tvalue;
-       else v = TYPE( toklev[t] );
-       if( v <= 0 ) error( "must specify type for %s", (t>=NTBASE)?nontrst[t-NTBASE].name:
-                       tokset[t].name );
-       return( v );
-       }
-
-chfind( t, s ) register char *s; {
-       int i;
-
-       if (s[0]==' ')t=0;
-       TLOOP(i){
-               if(!strcmp(s,tokset[i].name)){
-                       return( i );
-                       }
-               }
-       NTLOOP(i){
-               if(!strcmp(s,nontrst[i].name)) {
-                       return( i+NTBASE );
-                       }
-               }
-       /* cannot find name */
-       if( t>1 )
-               error( "%s should have been defined earlier", s );
-       return( defin( t, s ) );
-       }
-
-cpyunion(){
-       /* copy the union declaration to the output, and the define file if present */
-
-       int level, c;
-       fprintf( ftable, "\n# line %d \"%s\"\n", lineno, infile );
-       fprintf( ftable, "typedef union " );
-       if( fdefine ) fprintf( fdefine, "\ntypedef union " );
-
-       level = 0;
-       for(;;){
-               if( (c=getc(finput)) < 0 ) error( "EOF encountered while processing %%union" );
-               putc( c, ftable );
-               if( fdefine ) putc( c, fdefine );
-
-               switch( c ){
-
-               case '\n':
-                       ++lineno;
-                       break;
-
-               case '{':
-                       ++level;
-                       break;
-
-               case '}':
-                       --level;
-                       if( level == 0 ) { /* we are finished copying */
-                               fprintf( ftable, " YYSTYPE;\n" );
-                               if( fdefine ) fprintf( fdefine, " YYSTYPE;\nextern YYSTYPE yylval;\n" );
-                               return;
-                               }
-                       }
-               }
-       }
-
-cpycode(){ /* copies code between \{ and \} */
-
-       int c;
-       c = getc(finput);
-       if( c == '\n' ) {
-               c = getc(finput);
-               lineno++;
-               }
-       fprintf( ftable, "\n# line %d \"%s\"\n", lineno, infile );
-       while( c>=0 ){
-               if( c=='\\' )
-                       if( (c=getc(finput)) == '}' ) return;
-                       else putc('\\', ftable );
-               if( c=='%' )
-                       if( (c=getc(finput)) == '}' ) return;
-                       else putc('%', ftable );
-               putc( c , ftable );
-               if( c == '\n' ) ++lineno;
-               c = getc(finput);
-               }
-       error("eof before %%}" );
-       }
-
-skipcom(){ /* skip over comments */
-       register c, i=0;  /* i is the number of lines skipped */
-
-       /* skipcom is called after reading a / */
-
-       if( getc(finput) != '*' ) error( "illegal comment" );
-       c = getc(finput);
-       while( c != EOF ){
-               while( c == '*' ){
-                       if( (c=getc(finput)) == '/' ) return( i );
-                       }
-               if( c == '\n' ) ++i;
-               c = getc(finput);
-               }
-       error( "EOF inside comment" );
-       /* NOTREACHED */
-       }
-
-cpyact(offset){ /* copy C action to the next ; or closing } */
-       int brac, c, match, j, s, tok;
-
-       fprintf( faction, "\n# line %d \"%s\"\n", lineno, infile );
-
-       brac = 0;
-
-loop:
-       c = getc(finput);
-swt:
-       switch( c ){
-
-case ';':
-               if( brac == 0 ){
-                       putc( c , faction );
-                       return;
-                       }
-               goto lcopy;
-
-case '{':
-               brac++;
-               goto lcopy;
-
-case '$':
-               s = 1;
-               tok = -1;
-               c = getc(finput);
-               if( c == '<' ){ /* type description */
-                       ungetc( c, finput );
-                       if( gettok() != TYPENAME ) error( "bad syntax on $<ident> clause" );
-                       tok = numbval;
-                       c = getc(finput);
-                       }
-               if( c == '$' ){
-                       fprintf( faction, "yyval");
-                       if( ntypes ){ /* put out the proper tag... */
-                               if( tok < 0 ) tok = fdtype( *prdptr[nprod] );
-                               fprintf( faction, ".%s", typeset[tok] );
-                               }
-                       goto loop;
-                       }
-               if( c == '-' ){
-                       s = -s;
-                       c = getc(finput);
-                       }
-               if( isdigit(c) ){
-                       j=0;
-                       while( isdigit(c) ){
-                               j= j*10+c-'0';
-                               c = getc(finput);
-                               }
-
-                       j = j*s - offset;
-                       if( j > 0 ){
-                               error( "Illegal use of $%d", j+offset );
-                               }
-
-                       fprintf( faction, "yypvt[-%d]", -j );
-                       if( ntypes ){ /* put out the proper tag */
-                               if( j+offset <= 0 && tok < 0 ) error( "must specify type of $%d", j+offset );
-                               if( tok < 0 ) tok = fdtype( prdptr[nprod][j+offset] );
-                               fprintf( faction, ".%s", typeset[tok] );
-                               }
-                       goto swt;
-                       }
-               putc( '$' , faction );
-               if( s<0 ) putc('-', faction );
-               goto swt;
-
-case '}':
-               if( --brac ) goto lcopy;
-               putc( c, faction );
-               return;
-
-
-case '/':      /* look for comments */
-               putc( c , faction );
-               c = getc(finput);
-               if( c != '*' ) goto swt;
-
-               /* it really is a comment */
-
-               putc( c , faction );
-               c = getc(finput);
-               while( c != EOF ){
-                       while( c=='*' ){
-                               putc( c , faction );
-                               if( (c=getc(finput)) == '/' ) goto lcopy;
-                               }
-                       putc( c , faction );
-                       if( c == '\n' )++lineno;
-                       c = getc(finput);
-                       }
-               error( "EOF inside comment" );
-
-case '\'':     /* character constant */
-               match = '\'';
-               goto string;
-
-case '"':      /* character string */
-               match = '"';
-
-       string:
-
-               putc( c , faction );
-               while( c=getc(finput) ){
-
-                       if( c=='\\' ){
-                               putc( c , faction );
-                               c=getc(finput);
-                               if( c == '\n' ) ++lineno;
-                               }
-                       else if( c==match ) goto lcopy;
-                       else if( c=='\n' ) error( "newline in string or char. const." );
-                       putc( c , faction );
-                       }
-               error( "EOF in string or character constant" );
-
-case EOF:
-               error("action does not terminate" );
-
-case '\n':     ++lineno;
-               goto lcopy;
-
-               }
-
-lcopy:
-       putc( c , faction );
-       goto loop;
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/y3.c b/.ref-Research-V7/usr/src/cmd/yacc/y3.c
deleted file mode 100644 (file)
index 7e79373..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-# include "dextern"
-
-       /* important local variables */
-int lastred;  /* the number of the last reduction of a state */
-int defact[NSTATES];  /* the default actions of states */
-
-output(){ /* print the output for the states */
-
-       int i, k, c;
-       register struct wset *u, *v;
-
-       fprintf( ftable, "short yyexca[] ={\n" );
-
-       SLOOP(i) { /* output the stuff for state i */
-               nolook = !(tystate[i]==MUSTLOOKAHEAD);
-               closure(i);
-               /* output actions */
-               nolook = 1;
-               aryfil( temp1, ntokens+nnonter+1, 0 );
-               WSLOOP(wsets,u){
-                       c = *( u->pitem );
-                       if( c>1 && c<NTBASE && temp1[c]==0 ) {
-                               WSLOOP(u,v){
-                                       if( c == *(v->pitem) ) putitem( v->pitem+1, (struct looksets *)0 );
-                                       }
-                               temp1[c] = state(c);
-                               }
-                       else if( c > NTBASE && temp1[ (c -= NTBASE) + ntokens ] == 0 ){
-                               temp1[ c+ntokens ] = amem[indgo[i]+c];
-                               }
-                       }
-
-               if( i == 1 ) temp1[1] = ACCEPTCODE;
-
-               /* now, we have the shifts; look at the reductions */
-
-               lastred = 0;
-               WSLOOP(wsets,u){
-                       c = *( u->pitem );
-                       if( c<=0 ){ /* reduction */
-                               lastred = -c;
-                               TLOOP(k){
-                                       if( BIT(u->ws.lset,k) ){
-                                                 if( temp1[k] == 0 ) temp1[k] = c;
-                                                 else if( temp1[k]<0 ){ /* reduce/reduce conflict */
-                                                   if( foutput!=NULL )
-                                                     fprintf( foutput,
-                                                       "\n%d: reduce/reduce conflict (red'ns %d and %d ) on %s",
-                                                       i, -temp1[k], lastred, symnam(k) );
-                                                   if( -temp1[k] > lastred ) temp1[k] = -lastred;
-                                                   ++zzrrconf;
-                                                   }
-                                                 else { /* potential shift/reduce conflict */
-                                                       precftn( lastred, k, i );
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               wract(i);
-               }
-
-       fprintf( ftable, "\t};\n" );
-
-       wdef( "YYNPROD", nprod );
-
-       }
-
-int pkdebug = 0;
-apack(p, n ) int *p;{ /* pack state i from temp1 into amem */
-       int off;
-       register *pp, *qq, *rr;
-       int *q, *r;
-
-       /* we don't need to worry about checking because we
-          we will only look entries known to be there... */
-
-       /* eliminate leading and trailing 0's */
-
-       q = p+n;
-       for( pp=p,off=0 ; *pp==0 && pp<=q; ++pp,--off ) /* VOID */ ;
-       if( pp > q ) return(0);  /* no actions */
-       p = pp;
-
-       /* now, find a place for the elements from p to q, inclusive */
-
-       r = &amem[ACTSIZE-1];
-       for( rr=amem; rr<=r; ++rr,++off ){  /* try rr */
-               for( qq=rr,pp=p ; pp<=q ; ++pp,++qq){
-                       if( *pp != 0 ){
-                               if( *pp != *qq && *qq != 0 ) goto nextk;
-                               }
-                       }
-
-               /* we have found an acceptable k */
-
-               if( pkdebug && foutput!=NULL ) fprintf( foutput, "off = %d, k = %d\n", off, rr-amem );
-
-               for( qq=rr,pp=p; pp<=q; ++pp,++qq ){
-                       if( *pp ){
-                               if( qq > r ) error( "action table overflow" );
-                               if( qq>memp ) memp = qq;
-                               *qq = *pp;
-                               }
-                       }
-               if( pkdebug && foutput!=NULL ){
-                       for( pp=amem; pp<= memp; pp+=10 ){
-                               fprintf( foutput, "\t");
-                               for( qq=pp; qq<=pp+9; ++qq ) fprintf( foutput, "%d ", *qq );
-                               fprintf( foutput, "\n");
-                               }
-                       }
-               return( off );
-
-               nextk: ;
-               }
-       error("no space in action table" );
-       /* NOTREACHED */
-       }
-
-go2out(){ /* output the gotos for the nontermninals */
-       int i, j, k, best, count, cbest, times;
-
-       fprintf( ftemp, "$\n" );  /* mark begining of gotos */
-
-       for( i=1; i<=nnonter; ++i ) {
-               go2gen(i);
-
-               /* find the best one to make default */
-
-               best = -1;
-               times = 0;
-
-               for( j=0; j<=nstate; ++j ){ /* is j the most frequent */
-                       if( tystate[j] == 0 ) continue;
-                       if( tystate[j] == best ) continue;
-
-                       /* is tystate[j] the most frequent */
-
-                       count = 0;
-                       cbest = tystate[j];
-
-                       for( k=j; k<=nstate; ++k ) if( tystate[k]==cbest ) ++count;
-
-                       if( count > times ){
-                               best = cbest;
-                               times = count;
-                               }
-                       }
-
-               /* best is now the default entry */
-
-               zzgobest += (times-1);
-               for( j=0; j<=nstate; ++j ){
-                       if( tystate[j] != 0 && tystate[j]!=best ){
-                               fprintf( ftemp, "%d,%d,", j, tystate[j] );
-                               zzgoent += 1;
-                               }
-                       }
-
-               /* now, the default */
-
-               zzgoent += 1;
-               fprintf( ftemp, "%d\n", best );
-
-               }
-
-
-
-       }
-
-int g2debug = 0;
-go2gen(c){ /* output the gotos for nonterminal c */
-
-       int i, work, cc;
-       struct item *p, *q;
-
-
-       /* first, find nonterminals with gotos on c */
-
-       aryfil( temp1, nnonter+1, 0 );
-       temp1[c] = 1;
-
-       work = 1;
-       while( work ){
-               work = 0;
-               PLOOP(0,i){
-                       if( (cc=prdptr[i][1]-NTBASE) >= 0 ){ /* cc is a nonterminal */
-                               if( temp1[cc] != 0 ){ /* cc has a goto on c */
-                                       cc = *prdptr[i]-NTBASE; /* thus, the left side of production i does too */
-                                       if( temp1[cc] == 0 ){
-                                                 work = 1;
-                                                 temp1[cc] = 1;
-                                                 }
-                                       }
-                               }
-                       }
-               }
-
-       /* now, we have temp1[c] = 1 if a goto on c in closure of cc */
-
-       if( g2debug && foutput!=NULL ){
-               fprintf( foutput, "%s: gotos on ", nontrst[c].name );
-               NTLOOP(i) if( temp1[i] ) fprintf( foutput, "%s ", nontrst[i].name);
-               fprintf( foutput, "\n");
-               }
-
-       /* now, go through and put gotos into tystate */
-
-       aryfil( tystate, nstate, 0 );
-       SLOOP(i){
-               ITMLOOP(i,p,q){
-                       if( (cc= *p->pitem) >= NTBASE ){
-                               if( temp1[cc -= NTBASE] ){ /* goto on c is possible */
-                                       tystate[i] = amem[indgo[i]+c];
-                                       break;
-                                       }
-                               }
-                       }
-               }
-       }
-
-precftn(r,t,s){ /* decide a shift/reduce conflict by precedence.
-       /* r is a rule number, t a token number */
-       /* the conflict is in state s */
-       /* temp1[t] is changed to reflect the action */
-
-       int lp,lt, action;
-
-       lp = levprd[r];
-       lt = toklev[t];
-       if( PLEVEL(lt) == 0 || PLEVEL(lp) == 0 ) {
-               /* conflict */
-               if( foutput != NULL ) fprintf( foutput, "\n%d: shift/reduce conflict (shift %d, red'n %d) on %s",
-                                               s, temp1[t], r, symnam(t) );
-               ++zzsrconf;
-               return;
-               }
-       if( PLEVEL(lt) == PLEVEL(lp) ) action = ASSOC(lt);
-       else if( PLEVEL(lt) > PLEVEL(lp) ) action = RASC;  /* shift */
-       else action = LASC;  /* reduce */
-
-       switch( action ){
-
-       case BASC:  /* error action */
-               temp1[t] = ERRCODE;
-               return;
-
-       case LASC:  /* reduce */
-               temp1[t] = -r;
-               return;
-
-               }
-       }
-
-wract(i){ /* output state i */
-       /* temp1 has the actions, lastred the default */
-       int p, p0, p1;
-       int ntimes, tred, count, j;
-       int flag;
-
-       /* find the best choice for lastred */
-
-       lastred = 0;
-       ntimes = 0;
-       TLOOP(j){
-               if( temp1[j] >= 0 ) continue;
-               if( temp1[j]+lastred == 0 ) continue;
-               /* count the number of appearances of temp1[j] */
-               count = 0;
-               tred = -temp1[j];
-               levprd[tred] |= REDFLAG;
-               TLOOP(p){
-                       if( temp1[p]+tred == 0 ) ++count;
-                       }
-               if( count >ntimes ){
-                       lastred = tred;
-                       ntimes = count;
-                       }
-               }
-
-       /* for error recovery, arrange that, if there is a shift on the
-       /* error recovery token, `error', that the default be the error action */
-       if( temp1[1] > 0 ) lastred = 0;
-
-       /* clear out entries in temp1 which equal lastred */
-       TLOOP(p) if( temp1[p]+lastred == 0 )temp1[p]=0;
-
-       wrstate(i);
-       defact[i] = lastred;
-
-       flag = 0;
-       TLOOP(p0){
-               if( (p1=temp1[p0])!=0 ) {
-                       if( p1 < 0 ){
-                               p1 = -p1;
-                               goto exc;
-                               }
-                       else if( p1 == ACCEPTCODE ) {
-                               p1 = -1;
-                               goto exc;
-                               }
-                       else if( p1 == ERRCODE ) {
-                               p1 = 0;
-                               goto exc;
-                       exc:
-                               if( flag++ == 0 ) fprintf( ftable, "-1, %d,\n", i );
-                               fprintf( ftable, "\t%d, %d,\n", tokset[p0].value, p1 );
-                               ++zzexcp;
-                               }
-                       else {
-                               fprintf( ftemp, "%d,%d,", tokset[p0].value, p1 );
-                               ++zzacent;
-                               }
-                       }
-               }
-       if( flag ) {
-               defact[i] = -2;
-               fprintf( ftable, "\t-2, %d,\n", lastred );
-               }
-       fprintf( ftemp, "\n" );
-       return;
-       }
-
-wrstate(i){ /* writes state i */
-       register j0,j1;
-       register struct item *pp, *qq;
-       register struct wset *u;
-
-       if( foutput == NULL ) return;
-       fprintf( foutput, "\nstate %d\n",i);
-       ITMLOOP(i,pp,qq) fprintf( foutput, "\t%s\n", writem(pp->pitem));
-       if( tystate[i] == MUSTLOOKAHEAD ){
-               /* print out empty productions in closure */
-               WSLOOP( wsets+(pstate[i+1]-pstate[i]), u ){
-                       if( *(u->pitem) < 0 ) fprintf( foutput, "\t%s\n", writem(u->pitem) );
-                       }
-               }
-
-       /* check for state equal to another */
-
-       TLOOP(j0) if( (j1=temp1[j0]) != 0 ){
-               fprintf( foutput, "\n\t%s  ", symnam(j0) );
-               if( j1>0 ){ /* shift, error, or accept */
-                       if( j1 == ACCEPTCODE ) fprintf( foutput,  "accept" );
-                       else if( j1 == ERRCODE ) fprintf( foutput, "error" );
-                       else fprintf( foutput,  "shift %d", j1 );
-                       }
-               else fprintf( foutput, "reduce %d",-j1 );
-               }
-
-       /* output the final production */
-
-       if( lastred ) fprintf( foutput, "\n\t.  reduce %d\n\n", lastred );
-       else fprintf( foutput, "\n\t.  error\n\n" );
-
-       /* now, output nonterminal actions */
-
-       j1 = ntokens;
-       for( j0 = 1; j0 <= nnonter; ++j0 ){
-               if( temp1[++j1] ) fprintf( foutput, "\t%s  goto %d\n", symnam( j0+NTBASE), temp1[j1] );
-               }
-
-       }
-
-wdef( s, n ) char *s; { /* output a definition of s to the value n */
-       fprintf( ftable, "# define %s %d\n", s, n );
-       }
-
-warray( s, v, n ) char *s; int *v, n; {
-
-       register i;
-
-       fprintf( ftable, "short %s[]={\n", s );
-       for( i=0; i<n; ){
-               if( i%10 == 0 ) fprintf( ftable, "\n" );
-               fprintf( ftable, "%4d", v[i] );
-               if( ++i == n ) fprintf( ftable, " };\n" );
-               else fprintf( ftable, "," );
-               }
-       }
-
-hideprod(){
-       /* in order to free up the mem and amem arrays for the optimizer,
-       /* and still be able to output yyr1, etc., after the sizes of
-       /* the action array is known, we hide the nonterminals
-       /* derived by productions in levprd.
-       */
-
-       register i, j;
-
-       j = 0;
-       levprd[0] = 0;
-       PLOOP(1,i){
-               if( !(levprd[i] & REDFLAG) ){
-                       ++j;
-                       if( foutput != NULL ){
-                               fprintf( foutput, "Rule not reduced:   %s\n", writem( prdptr[i] ) );
-                               }
-                       }
-               levprd[i] = *prdptr[i] - NTBASE;
-               }
-       if( j ) fprintf( stdout, "%d rules never reduced\n", j );
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/yacc/y4.c b/.ref-Research-V7/usr/src/cmd/yacc/y4.c
deleted file mode 100644 (file)
index d32f4b0..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-# include "dextern"
-
-# define a amem
-# define mem mem0
-# define pa indgo
-# define yypact temp1
-# define greed tystate
-
-int * ggreed = lkst[0].lset;
-int * pgo = wsets[0].ws.lset;
-int *yypgo = &nontrst[0].tvalue;
-
-int maxspr = 0;  /* maximum spread of any entry */
-int maxoff = 0;  /* maximum offset into a array */
-int *pmem = mem;
-int *maxa;
-# define NOMORE -1000
-
-int nxdb = 0;
-int adb = 0;
-
-callopt(){
-
-       register i, *p, j, k, *q;
-
-       /* read the arrays from tempfile and set parameters */
-
-       if( (finput=fopen(TEMPNAME,"r")) == NULL ) error( "optimizer cannot open tempfile" );
-
-       pgo[0] = 0;
-       yypact[0] = 0;
-       nstate = 0;
-       nnonter = 0;
-       for(;;){
-               switch( gtnm() ){
-
-               case '\n':
-                       yypact[++nstate] = (--pmem) - mem;
-               case ',':
-                       continue;
-
-               case '$':
-                       break;
-
-               default:
-                       error( "bad tempfile" );
-                       }
-               break;
-               }
-
-       yypact[nstate] = yypgo[0] = (--pmem) - mem;
-
-       for(;;){
-               switch( gtnm() ){
-
-               case '\n':
-                       yypgo[++nnonter]= pmem-mem;
-               case ',':
-                       continue;
-
-               case EOF:
-                       break;
-
-               default:
-                       error( "bad tempfile" );
-                       }
-               break;
-               }
-
-       yypgo[nnonter--] = (--pmem) - mem;
-
-
-
-       for( i=0; i<nstate; ++i ){
-
-               k = 32000;
-               j = 0;
-               q = mem + yypact[i+1];
-               for( p = mem + yypact[i]; p<q ; p += 2 ){
-                       if( *p > j ) j = *p;
-                       if( *p < k ) k = *p;
-                       }
-               if( k <= j ){ /* nontrivial situation */
-                       /* temporarily, kill this for compatibility
-                       j -= k;  /* j is now the range */
-                       if( k > maxoff ) maxoff = k;
-                       }
-               greed[i] = (yypact[i+1]-yypact[i]) + 2*j;
-               if( j > maxspr ) maxspr = j;
-               }
-
-       /* initialize ggreed table */
-
-       for( i=1; i<=nnonter; ++i ){
-               ggreed[i] = 1;
-               j = 0;
-               /* minimum entry index is always 0 */
-               q = mem + yypgo[i+1] -1;
-               for( p = mem+yypgo[i]; p<q ; p += 2 ) {
-                       ggreed[i] += 2;
-                       if( *p > j ) j = *p;
-                       }
-               ggreed[i] = ggreed[i] + 2*j;
-               if( j > maxoff ) maxoff = j;
-               }
-
-
-       /* now, prepare to put the shift actions into the a array */
-
-       for( i=0; i<ACTSIZE; ++i ) a[i] = 0;
-       maxa = a;
-
-       for( i=0; i<nstate; ++i ) {
-               if( greed[i]==0 && adb>1 ) fprintf( ftable, "State %d: null\n", i );
-               pa[i] = YYFLAG1;
-               }
-
-       while( (i = nxti()) != NOMORE ) {
-               if( i >= 0 ) stin(i);
-               else gin(-i);
-
-               }
-
-       if( adb>2 ){ /* print a array */
-               for( p=a; p <= maxa; p += 10){
-                       fprintf( ftable, "%4d  ", p-a );
-                       for( i=0; i<10; ++i ) fprintf( ftable, "%4d  ", p[i] );
-                       fprintf( ftable, "\n" );
-                       }
-               }
-       /* write out the output appropriate to the language */
-
-       aoutput();
-
-       osummary();
-       ZAPFILE(TEMPNAME);
-       }
-
-gin(i){
-
-       register *p, *r, *s, *q1, *q2;
-
-       /* enter gotos on nonterminal i into array a */
-
-       ggreed[i] = 0;
-
-       q2 = mem+ yypgo[i+1] - 1;
-       q1 = mem + yypgo[i];
-
-       /* now, find a place for it */
-
-       for( p=a; p < &a[ACTSIZE]; ++p ){
-               if( *p ) continue;
-               for( r=q1; r<q2; r+=2 ){
-                       s = p + *r +1;
-                       if( *s ) goto nextgp;
-                       if( s > maxa ){
-                               if( (maxa=s) > &a[ACTSIZE] ) error( "a array overflow" );
-                               }
-                       }
-               /* we have found a spot */
-
-               *p = *q2;
-               if( p > maxa ){
-                       if( (maxa=p) > &a[ACTSIZE] ) error( "a array overflow" );
-                       }
-               for( r=q1; r<q2; r+=2 ){
-                       s = p + *r + 1;
-                       *s = r[1];
-                       }
-
-               pgo[i] = p-a;
-               if( adb>1 ) fprintf( ftable, "Nonterminal %d, entry at %d\n" , i, pgo[i] );
-               goto nextgi;
-
-               nextgp:  ;
-               }
-
-       error( "cannot place goto %d\n", i );
-
-       nextgi:  ;
-       }
-
-stin(i){
-       register *r, *s, n, flag, j, *q1, *q2;
-
-       greed[i] = 0;
-
-       /* enter state i into the a array */
-
-       q2 = mem+yypact[i+1];
-       q1 = mem+yypact[i];
-       /* find an acceptable place */
-
-       for( n= -maxoff; n<ACTSIZE; ++n ){
-
-               flag = 0;
-               for( r = q1; r < q2; r += 2 ){
-                       if( (s = *r + n + a ) < a ) goto nextn;
-                       if( *s == 0 ) ++flag;
-                       else if( *s != r[1] ) goto nextn;
-                       }
-
-               /* check that the position equals another only if the states are identical */
-
-               for( j=0; j<nstate; ++j ){
-                       if( pa[j] == n ) {
-                               if( flag ) goto nextn;  /* we have some disagreement */
-                               if( yypact[j+1] + yypact[i] == yypact[j] + yypact[i+1] ){
-                                       /* states are equal */
-                                       pa[i] = n;
-                                       if( adb>1 ) fprintf( ftable, "State %d: entry at %d equals state %d\n",
-                                               i, n, j );
-                                       return;
-                                       }
-                               goto nextn;  /* we have some disagreement */
-                               }
-                       }
-
-               for( r = q1; r < q2; r += 2 ){
-                       if( (s = *r + n + a ) >= &a[ACTSIZE] ) error( "out of space in optimizer a array" );
-                       if( s > maxa ) maxa = s;
-                       if( *s != 0 && *s != r[1] ) error( "clobber of a array, pos'n %d, by %d", s-a, r[1] );
-                       *s = r[1];
-                       }
-               pa[i] = n;
-               if( adb>1 ) fprintf( ftable, "State %d: entry at %d\n", i, pa[i] );
-               return;
-
-               nextn:  ;
-               }
-
-       error( "Error; failure to place state %d\n", i );
-
-       }
-
-nxti(){ /* finds the next i */
-       register i, max, maxi;
-
-       max = 0;
-
-       for( i=1; i<= nnonter; ++i ) if( ggreed[i] >= max ){
-               max = ggreed[i];
-               maxi = -i;
-               }
-
-       for( i=0; i<nstate; ++i ) if( greed[i] >= max ){
-               max = greed[i];
-               maxi = i;
-               }
-
-       if( nxdb ) fprintf( ftable, "nxti = %d, max = %d\n", maxi, max );
-       if( max==0 ) return( NOMORE );
-       else return( maxi );
-       }
-
-osummary(){
-       /* write summary */
-
-       register i, *p;
-
-       if( foutput == NULL ) return;
-       i=0;
-       for( p=maxa; p>=a; --p ) {
-               if( *p == 0 ) ++i;
-               }
-
-       fprintf( foutput, "Optimizer space used: input %d/%d, output %d/%d\n",
-               pmem-mem+1, MEMSIZE, maxa-a+1, ACTSIZE );
-       fprintf( foutput, "%d table entries, %d zero\n", (maxa-a)+1, i );
-       fprintf( foutput, "maximum spread: %d, maximum offset: %d\n", maxspr, maxoff );
-
-       }
-
-aoutput(){ /* this version is for C */
-
-
-       /* write out the optimized parser */
-
-       fprintf( ftable, "# define YYLAST %d\n", maxa-a+1 );
-
-       arout( "yyact", a, (maxa-a)+1 );
-       arout( "yypact", pa, nstate );
-       arout( "yypgo", pgo, nnonter+1 );
-
-       }
-
-arout( s, v, n ) char *s; int *v, n; {
-
-       register i;
-
-       fprintf( ftable, "short %s[]={\n", s );
-       for( i=0; i<n; ){
-               if( i%10 == 0 ) fprintf( ftable, "\n" );
-               fprintf( ftable, "%4d", v[i] );
-               if( ++i == n ) fprintf( ftable, " };\n" );
-               else fprintf( ftable, "," );
-               }
-       }
-
-
-gtnm(){
-
-       register s, val, c;
-
-       /* read and convert an integer from the standard input */
-       /* return the terminating character */
-       /* blanks, tabs, and newlines are ignored */
-
-       s = 1;
-       val = 0;
-
-       while( (c=getc(finput)) != EOF ){
-               if( isdigit(c) ){
-                       val = val * 10 + c - '0';
-                       }
-               else if ( c == '-' ) s = -1;
-               else break;
-               }
-
-       *pmem++ = s*val;
-       if( pmem > &mem[MEMSIZE] ) error( "out of space" );
-       return( c );
-
-       }
diff --git a/.ref-Research-V7/usr/src/cmd/yes.c b/.ref-Research-V7/usr/src/cmd/yes.c
deleted file mode 100644 (file)
index 6c638af..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-main(argc, argv)
-char **argv;
-{
-       for (;;)
-               printf("%s\n", argc>1? argv[1]: "y");
-}
diff --git a/.ref-Research-V7/usr/src/games/arithmetic.c b/.ref-Research-V7/usr/src/games/arithmetic.c
deleted file mode 100644 (file)
index df6f707..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-#include <signal.h>
-
-#define        MAX     100
-
-char   types[10];
-int    right[MAX];
-int    left[MAX];
-int    rights;
-int    wrongs;
-long   stvec;
-long   etvec;
-long   dtvec;
-
-main(argc,argv)
-char   *argv[];
-{
-       int range, k, dif, l;
-       char line[100];
-       int ans,pans,i,j,t;
-       extern  delete();
-
-       signal(SIGINT, delete);
-
-       range = 11;
-       dif = 0;
-       while(argc > 1) {
-               switch(*argv[1]) {
-               case '+':
-               case '-':
-               case 'x':
-               case '/':
-                       while(types[dif] = argv[1][dif])
-                               dif++;
-                       break;
-
-               default:
-                       range = getnum(argv[1]) + 1;
-               }
-               argv++;
-               argc--;
-       }
-       if(range > MAX) {
-               printf("Range is too large.\n");
-               exit(0);
-       }
-
-       if(dif == 0) {
-               types[0] = '+';
-               types[1] = '-';
-               dif = 2;
-       }
-
-       for(i = 0; i < range; i++) {
-               left[i] = right[i] = i;
-       }
-       time(&stvec);
-       k = stvec;
-       srand(k);
-       k = 0;
-       l = 0;
-       goto start;
-
-loop:
-       if(++k%20 == 0)
-               score();
-
-start:
-       i = skrand(range);
-       j = skrand(range);
-       if(dif > 1)
-               l = random(dif);
-
-       switch(types[l]) {
-               case '+':
-               default:
-                       ans = left[i] + right[j];
-                       printf("%d + %d =   ", left[i], right[j]);
-                       break;
-
-               case '-':
-                       t = left[i] + right[j];
-                       ans = left[i];
-                       printf("%d - %d =   ", t, right[j]);
-                       break;
-
-               case 'x':
-                       ans = left[i] * right[j];
-                       printf("%d x %d =   ", left[i], right[j]);
-                       break;
-
-               case '/':
-                       while(right[j] == 0)
-                               j = random(range);
-                       t = left[i] * right[j] + random(right[j]);
-                       ans = left[i];
-                       printf("%d / %d =   ", t, right[j]);
-                       break;
-       }
-
-
-loop1:
-       getline(line);
-       dtvec += etvec - stvec;
-       if(line[0]=='\n') goto loop1;
-       pans = getnum(line);
-       if(pans == ans) {
-               printf("Right!\n");
-               rights++;
-               goto loop;
-       }
-       else {
-               printf("What?\n");
-               wrongs++;
-               if(range >= MAX)        goto loop1;
-               left[range] = left[i];
-               right[range++] = right[j];
-               goto loop1;
-       }
-}
-
-getline(s)
-char *s;
-{
-       register char   *rs;
-
-       rs = s;
-
-       while((*rs = getchar()) == ' ');
-       while(*rs != '\n')
-               if(*rs == 0)
-                       exit(0);
-               else if(rs >= &s[99]) {
-                       while((*rs = getchar()) != '\n')
-                               if(*rs == '\0') exit(0);
-               }
-               else
-                       *++rs = getchar();
-       while(*--rs == ' ')
-               *rs = '\n';
-}
-
-getnum(s)
-char *s;
-{
-       int     a;
-       char    c;
-
-       a = 0;
-       while((c = *s++) >= '0' && c <= '9') {
-               a = a*10 + c - '0';
-       }
-       return(a);
-}
-
-
-random(range)
-{
-       return(rand()%range);
-}
-
-skrand(range){
-int temp;
-       temp = random(range) + random(range);
-       if(temp > range - 1) temp = 2*range - 1 - temp;
-       return(temp);
-       }
-
-score()
-{
-       time(&etvec);
-
-       printf("\n\nRights %d; Wrongs %d; Score %d%%\n", rights, wrongs,
-               (rights * 100)/(rights + wrongs));
-
-       if(rights == 0) return;
-       printf("Total time %ld seconds; %.1f seconds per problem\n\n\n",
-               etvec - stvec,
-               (etvec - stvec) / (rights + 0.));
-
-       sleep(3);
-       time(&dtvec);
-       stvec += dtvec - etvec;
-}
-
-delete()
-{
-       if(rights + wrongs == 0.) {
-               printf("\n");
-               exit(0);
-       }
-       score();
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/games/backgammon.c b/.ref-Research-V7/usr/src/games/backgammon.c
deleted file mode 100644 (file)
index 50fbecd..0000000
+++ /dev/null
@@ -1,584 +0,0 @@
-# include <stdio.h>
-
-#
-#define NIL (-1)
-#define MAXGMOV 10
-#define MAXIMOVES 1000
-       char level;             /*'b'=beginner, 'i'=intermediate, 'e'=expert*/
-int die1;
-int die2;
-int i;
-int j;
-int l;
-int m;
-int count;
-int red[]     {0,2,0,0,0,0,0,0,0,0,0,0,5,
-                0,0,0,0,3,0,5,0,0,0,0,0,
-                0,0,0,0,0,0};
-int white[]   {0,2,0,0,0,0,0,0,0,0,0,0,5,
-                0,0,0,0,3,0,5,0,0,0,0,0,
-                0,0,0,0,0,0};
-int probability[]{0,11,12,13,14,15,16,
-                   06,05,04,03,02,01};
-int imoves;
-int goodmoves[MAXGMOV] ;
-int probmoves[MAXGMOV] ;
-struct {int pos[4],mov[4];} moves[MAXIMOVES] ;
-
-main()
-{
-       int t,k,n,go[5];
-       char s[100];
-       go[5]=NIL;
-       srand();
-       printf( "Do you want instructions? Type 'y' for yes,\n");
-       printf( "anything else means no.?? ");
-       getstr(s);
-       if(*s=='y')instructions();
-       printf( "Choose the level of your oppponent.\n");
-       printf( "Type 'b' for beginner, or 'i' for intermediate.\n");
-       printf( "Anything else gets you an expert.?? ");
-       level='e';
-       getstr(s);
-       if(*s=='b')level='b';
-       else if(*s=='i')level='i';
-       printf( "You will play red. Do you wan't to move first?\n");
-       printf( "Type 'y' for yes, anything else means no.?? ");
-       getstr(s);
-       if(*s=='y')goto nowhmove;
-whitesmv:
-       roll();
-       printf( "white rolls %d,%d\n",die1,die2);
-       printf( "white's move is:");
-       if(nextmove(white,red)==NIL)goto nowhmove;
-       if(piececount(white,0,24)==0){
-           printf( "White wins\n");
-           printf( "Aren't you ashamed. You've been beaten by a computer.\n");
-           exit();
-       }
-nowhmove:
-       prtbrd();
-
-       roll();
-retry:
-       printf( "your roll is %d,  %d\n",die1,die2);
-       printf( "your move, please?? ");
-       getstr(s);
-       if(*s==0){
-           printf( "red's move skipped\n");
-           goto whitesmv;
-       }
-       n=sscanf(s,"%d%d%d%d%d",&go[0],&go[1],&go[2],&go[3],&go[4]);
-       if((die1!=die2&&n>2)||n>4){
-           printf( "you've made too many moves\n");
-           goto retry;
-       }
-       go[n]=NIL;
-       if(*s=='-'){
-           go[0]= -go[0];
-           t=die1;
-           die1=die2;
-           die2=t;
-       }
-       for(k=0;k<n;k++){
-           if(0<=go[k] && go[k]<=24)continue;
-           else{
-               printf( "move %d is illegal\n",go[k]);
-               goto retry;
-           }
-       }
-       if(play(red,white,go))goto retry;
-       if(piececount(red,0,24)==0){
-           printf( "Red wins.\n");
-           printf( "Congratulations! You have just defeated a dumb machine.\n");
-           exit();
-       }
-       goto whitesmv;
-}
-
-getstr(s)
-char *s;
-{
-       while((*s=getchar())!='\n')s++;
-       *s=0;
-}
-
-play(player,playee,pos)
-int *player,*playee,pos[];
-{
-       int k,n,die,ipos;
-       for(k=0;k<player[0];k++){  /*blots on player[0] must be moved first*/
-           if(pos[k]==NIL)break;
-           if(pos[k]!=0){
-               printf( "piece on position 0 must be moved first\n");
-               return(-1);
-           }
-       }
-       for(k=0;(ipos=pos[k])!=NIL;k++){
-           die=k?die2:die1;
-           n=25-ipos-die;
-           if(player[ipos]==0)goto badmove;
-           if(n>0&&playee[n]>=2)goto badmove;
-           if(n<=0){
-               if(piececount(player,0,18)!=0)goto badmove;
-               if((ipos+die)!=25&&
-                   piececount(player,19,24-die)!=0)goto badmove;
-           }
-           player[ipos]--;
-           player[ipos+die]++;
-       }
-       for(k=0;pos[k]!=NIL;k++){
-           die=k?die2:die1;
-           n=25-pos[k]-die;
-           if(n>0 && playee[n]==1){
-               playee[n]=0;
-               playee[0]++;
-           }
-       }
-       return(0);
-
-badmove:
-       printf( "Move %d is not legal.\n",ipos);
-       while(k--){
-           die=k?die2:die1;
-           player[pos[k]]++;
-           player[pos[k]+die]--;
-       }
-       return(-1);
-}
-nextmove(player,playee)
-int *player,*playee;
-{
-       int k;
-       imoves=0;
-       movegen(player,playee);
-       if(die1!=die2){
-       k=die1;
-       die1=die2;
-       die2=k;
-       movegen(player,playee);
-       }
-       if(imoves==0){
-           printf( "roll was %d,%d; no white move possible\n",die1,die2);
-           return(NIL);
-       }
-       k=strategy(player,playee);              /*select kth possible move*/
-       prtmov(k);
-       update(player,playee,k);
-       return(0);
-}
-prtmov(k)
-int k;
-{
-       int n;
-       if(k==NIL)printf( "no move possible\n");
-       else for(n=0;n<4;n++){
-           if(moves[k].pos[n]==NIL)break;
-           printf( "    %d, %d",25-moves[k].pos[n],moves[k].mov[n]);
-       }
-       printf( "\n");
-}
-update(player,playee,k)
-int *player,*playee,k;
-{
-       int n,t;
-       for(n=0;n<4;n++){
-           if(moves[k].pos[n]==NIL)break;
-           player[moves[k].pos[n]]--;
-           player[moves[k].pos[n]+moves[k].mov[n]]++;
-           t=25-moves[k].pos[n]-moves[k].mov[n];
-           if(t>0 && playee[t]==1){
-               playee[0]++;
-               playee[t]--;
-           }
-       }
-}
-piececount(player,startrow,endrow)
-int *player,startrow,endrow;
-{
-       int sum;
-       sum=0;
-       while(startrow<=endrow)
-       sum=+player[startrow++];
-       return(sum);
-}
-/*
-prtmovs()
-{
-       int i1,i2;
-       printf( "possible moves are\n");
-       for(i1=0;i1<imoves;i1++){
-               printf( "\n%d",i1);
-               for(i2=0;i2<4;i2++){
-                       if(moves[i1].pos[i2]==NIL)break;
-                       printf( "%d, %d",moves[i1].pos[i2],moves[i1].mov[i2]);
-               }
-       }
-       printf( "\n");
-}
-*/
-
-roll()
-{
-       extern int die1,die2;
-       die1=(rand()>>8)%6+1;
-       die2=(rand()>>8)%6+1;
-}
-
-movegen(mover,movee)
-int *mover,*movee;
-{
-       extern int i,j,l,m,count;
-       extern int die1,die2;
-       int k;
-       for(i=0;i<=24;i++){
-               count=0;
-               if(mover[i]==0)continue;
-               if((k=25-i-die1)>0&&movee[k]>=2)
-                   if(mover[0]>0)break;
-                   else continue;
-               if(k<=0){
-                   if(piececount(mover,0,18)!=0)break;
-                   if((i+die1)!=25&&
-                       piececount(mover,19,24-die1)!=0)break;
-               }
-               mover[i]--;
-               mover[i+die1]++;
-               count=1;
-               for(j=0;j<=24;j++){
-                       if(mover[j]==0)continue;
-                       if((k=25-j-die2)>0&&movee[k]>=2)
-                           if(mover[0]>0)break;
-                           else continue;
-                       if(k<=0){
-                           if(piececount(mover,0,18)!=0)break;
-                           if((j+die2)!=25&&
-                               piececount(mover,19,24-die2)!=0)break;
-                       }
-                       mover[j]--;
-                       mover[j+die2]++;
-                       count=2;
-                       if(die1!=die2){
-                           moverecord(mover);
-                           if(mover[0]>0)break;
-                           else continue;
-                       }
-                       for(l=0;l<=24;l++){
-                           if(mover[l]==0)continue;
-                           if((k=25-l-die1)>0&&movee[k]>=2)
-                               if(mover[0]>0)break;
-                               else continue;
-                           if(k<=0){
-                               if(piececount(mover,0,18)!=0)break;
-                               if((l+die2)!=25&&
-                                   piececount(mover,19,24-die1)!=0)break;
-                           }
-                           mover[l]--;
-                           mover[l+die1]++;
-                           count=3;
-                           for(m=0;m<=24;m++){
-                               if(mover[m]==0)continue;
-                               if((k=25-m-die1)>=0&&movee[k]>=2)
-                                   if(mover[0]>0)break;
-                                   else continue;
-                               if(k<=0){
-                                   if(piececount(mover,0,18)!=0)break;
-                                   if((m+die2)!=25&&
-                                       piececount(mover,19,24-die1)!=0)break;
-                               }
-                               count=4;
-                               moverecord(mover);
-                               if(mover[0]>0)break;
-                           }
-                           if(count==3)moverecord(mover);
-                           else{
-                               mover[l]++;
-                               mover[l+die1]--;
-                           }
-                           if(mover[0]>0)break;
-                       }
-                       if(count==2)moverecord(mover);
-                       else{
-                           mover[j]++;
-                           mover[j+die1]--;
-                       }
-                       if(mover[0]>0)break;
-               }
-               if(count==1)moverecord(mover);
-               else{
-                   mover[i]++;
-                   mover[i+die1]--;
-               }
-               if(mover[0]>0)break;
-       }
-}
-moverecord(mover)
-int *mover;
-{
-       extern int i,j,l,m,imoves,count;
-       int t;
-       if(imoves>=MAXIMOVES)goto undo;;
-       for(t=0;t<=3;t++)
-           moves[imoves].pos[t]= NIL;
-       switch(count){
-case 4:
-           moves[imoves].pos[3]=m;
-           moves[imoves].mov[3]=die1;
-case 3:
-           moves[imoves].pos[2]=l;
-           moves[imoves].mov[2]=die1;
-case 2:
-           moves[imoves].pos[1]=j;
-           moves[imoves].mov[1]=die2;
-case 1:
-           moves[imoves].pos[0]=i;
-           moves[imoves].mov[0]=die1;
-           imoves++;
-       }
-undo:
-       switch(count){
-case 4:
-           break;
-case 3:
-           mover[l]++;
-           mover[l+die1]--;
-           break;
-case 2:
-           mover[j]++;
-           mover[j+die2]--;
-           break;
-case 1:
-           mover[i]++;
-           mover[i+die1]--;
-       }
-}
-
-
-strategy(player,playee)
-int *player,*playee;
-{
-       extern char level;
-       int k,n,nn,bestval,moveval,prob;
-       n=0;
-       if(imoves==0)return(NIL);
-       goodmoves[0]=NIL;
-       bestval= -32000;
-       for(k=0;k<imoves;k++){
-           if((moveval=eval(player,playee,k,&prob))<bestval)continue;
-           if(moveval>bestval){
-               bestval=moveval;
-               n=0;
-           }
-           if(n<MAXGMOV){
-               goodmoves[n]=k;
-               probmoves[n++]=prob;
-           }
-       }
-       if(level=='e' && n>1){
-           nn=n;
-           n=0;
-           prob=32000;
-           for(k=0;k<nn;k++){
-               if((moveval=probmoves[k])>prob)continue;
-               if(moveval<prob){
-                   prob=moveval;
-                   n=0;
-               }
-               goodmoves[n]=goodmoves[k];
-               probmoves[n++]=probmoves[k];
-           }
-       }
-       return(goodmoves[(rand()>>4)%n]);
-}
-
-eval(player,playee,k,prob)
-int *player,*playee,k,*prob;
-{
-       extern char level;
-       int newtry[31],newother[31],*r,*q,*p,n,sum,first;
-       int ii,lastwhite,lastred;
-       *prob=sum=0;
-       r=player+25;
-       p=newtry;
-       q=newother;
-       while(player<r){
-           *p++= *player++;
-           *q++= *playee++;
-       }
-       q=newtry+31;
-       for(p=newtry+25;p<q;) *p++ = 0; /*zero out spaces for hit pieces*/
-       for(n=0;n<4;n++){
-           if(moves[k].pos[n]==NIL)break;
-           newtry[moves[k].pos[n]]--;
-           newtry[ii=moves[k].pos[n]+moves[k].mov[n]]++;
-           if(ii<25 && newother[25-ii]==1){
-               newother[25-ii]=0;
-               newother[0]++;
-               if(ii<=15 && level=='e')sum++;  /*hit if near other's home*/
-           }
-       }
-       for(lastred=0;newother[lastred]==0;lastred++);
-       for(lastwhite=0;newtry[lastwhite]==0;lastwhite++);
-       lastwhite=25-lastwhite;
-       if(lastwhite<=6 && lastwhite<lastred)sum=1000;
-       if(lastwhite<lastred && level=='e'
-           && lastwhite>6){                    /*expert's running game.
-                                                 First priority to get all
-                                                 pieces into white's home*/
-           for(sum=1000;lastwhite>6;lastwhite--)
-               sum=sum-lastwhite*newtry[25-lastwhite];
-       }
-       for(first=0;first<25;first++)
-           if(newother[first]!=0)break;        /*find other's first piece*/
-       q=newtry+25;
-       for(p=newtry+1;p<q;)if(*p++ > 1)sum++;  /*blocked points are good*/
-       if(first>5){    /*only stress removing pieces if homeboard
-                         cannot be hit
-                       */
-           q=newtry+31;
-           p=newtry+25;
-           for(n=6;p<q;n--)
-               sum=+ *p++ * n; /*remove pieces, but just barely*/
-       }
-       if(level!='b'){
-           r=newtry+25-first;  /*singles past this point can't be hit*/
-           for(p=newtry+7;p<r;)
-               if(*p++ == 1)sum--;     /*singles are bad after 1st 6 points
-                                         if they can be hit*/
-           q=newtry+3;
-           for(p=newtry;p<q;)sum=- *p++;  /*bad to be on 1st three points*/
-       }
-
-       for(n=1;n<=4;n++)
-           *prob=+ n*getprob(newtry,newother,6*n-5,6*n);
-       return(sum);
-}
-instructions()
-{
-       printf( "To play backgammon, type the numbers of the points\n");
-       printf( "from which pieces are to be moved. Thus, if the\n");
-       printf( "roll is '3,5', typing '2 6' will move a piece\n");
-       printf( "from point 2 three spaces to point 5,\n");
-       printf( "and a piece from point 6 forward to\n");
-       printf( "point 11.  If the moves must be made in the\n");
-       printf( "opposite order, the first character typed must\n");
-       printf( "be a minus ('-'). Thus, typing\n");
-       printf( "'-2 6' moves the piece on point 2\n");
-       printf( "by 5, and the piece on point 6 by 3.\n");
-       printf( "If you want to move a single piece several times,\n");
-       printf( "the sequence of points from which it is to be\n");
-       printf( "moved must be typed. Thus '14 17' will move\n");
-       printf( "a piece from point 14 to point 17 and thence to\n");
-       printf( "to point 22.\n");
-       printf( "If a double is rolled, you should type four numbers.\n");
-       printf( "Red pieces that have been removed from the board by\n");
-       printf( "being hit by white are on point 0 and\n");
-       printf( "must be brought in before any other move can be made.\n");
-       printf( "White pieces that are hit are removed to point 25.\n");
-       printf( "You will not be allowed to make an illegal move, or\n");
-       printf( "to make too many moves. However, if you make too\n");
-       printf( "few moves, the program does not care. In particular\n");
-       printf( "you may skip your turn by typing a 'new-line'\n");
-       printf( "all by itself.\n\n");
-}
-
-getprob(player,playee,start,finish)
-int *player,*playee,start,finish;
-{                      /*returns the probability (times 102) that any
-                         pieces belonging to 'player' and lying between
-                         his points 'start' and 'finish' will be hit
-                         by a piece belonging to playee
-                       */
-       int k,n,sum;
-       sum=0;
-       for(;start<=finish;start++){
-           if(player[start]==1){
-               for(k=1;k<=12;k++){
-                   if((n=25-start-k)<0)break;
-                   if(playee[n]!=0)sum=+probability[k];
-               }
-           }
-       }
-       return(sum);
-}
-prtbrd()
-{
-       int k;
-       printf( "White's Home\n");
-       for(k=1;k<=6;k++)
-           printf( "%4d",k);
-       printf( "    ");
-       for(k=7;k<=12;k++)printf( "%4d",k);
-       putchar('\r' );
-       for(k=1;k<=54;k++)putchar('_' );
-       putchar('\n' );
-       numline(red,white,1,6);
-       printf( "    ");
-       numline(red,white,7,12);
-       putchar('\n' );
-       colorline(red,'R',white,'W',1,6);
-       printf( "    ");
-       colorline(red,'R',white,'W',7,12);
-       putchar('\n' );
-       if(white[0]!=0)printf( "%28dW\n",white[0]);
-       else putchar('\n' );
-       if(red[0]!=0)printf( "%28dR\n",red[0]);
-       else putchar('\n' );
-       colorline(white,'W',red,'R',1,6);
-       printf( "    ");
-       colorline(white,'W',red,'R',7,12);
-       putchar('\n' );
-       numline(white,red,1,6);
-       printf( "    ");
-       numline(white,red,7,12);
-       putchar('\r' );
-       for(k=1;k<=54;k++)putchar('_' );
-       putchar('\n' );
-       for(k=24;k>=19;k--)printf( "%4d",k);
-       printf( "    ");
-       for(k=18;k>=13;k--)printf( "%4d",k);
-       printf( "\nRed's Home\n\n\n\n\n");
-}
-numline(upcol,downcol,start,fin)
-int *upcol,*downcol,start,fin;
-{
-       int k,n;
-       for(k=start;k<=fin;k++){
-           if((n=upcol[k])!=0 || (n=downcol[25-k])!=0)printf( "%4d",n);
-           else printf( "    ");
-       }
-}
-colorline(upcol,c1,downcol,c2,start,fin)
-int *upcol,*downcol,start,fin;
-char c1,c2;
-{
-       int k;
-       char c;
-       for(k=start;k<=fin;k++){
-           c=' ';
-           if(upcol[k]!=0)c=c1;
-           if(downcol[25-k]!=0)c=c2;
-       printf( "   %c",c);
-       }
-}
-
-int rrno 0;
-
-srand(){
-       rrno = _look( 0x40000 );
-       _store( 0x40000, rrno+1 );
-       }
-
-rand(){
-       rrno =* 0106273;
-       rrno =+ 020202;
-       return( rrno & 077777 );
-       }
-
-_look(p) int *p; {
-       return( *p );
-       }
-
-_store( p, numb ) int *p; {
-       *p = numb;
-       }
diff --git a/.ref-Research-V7/usr/src/games/chess/README b/.ref-Research-V7/usr/src/games/chess/README
deleted file mode 100644 (file)
index 9cdc14b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-This program is not the one
-that won the U. S. championship.
diff --git a/.ref-Research-V7/usr/src/games/chess/agen.c b/.ref-Research-V7/usr/src/games/chess/agen.c
deleted file mode 100644 (file)
index 839d061..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#include "old.h"
-
-bagen()
-{
-       int *p1, *p2, v;
-
-       p1 = lmp;
-       if((flag&010)!=0)
-       if(board[5]==0 && board[6]==0 && board[7]==4)
-       if(wattack(4) && wattack(5) && wattack(6))
-               btry(4, 0, 2); /* kingside castle */
-       if((flag&020)!=0)
-       if(board[0]==4 && board[1]==0 && board[2]==0 && board[3]==0)
-       if(wattack(2) && wattack(3) && wattack(4))
-               btry(4, 0, -2); /* queenside castle */
-       bgen();
-       p2 = p1;
-       while(p2 != lmp) {
-               v = *p2++;
-               bmove(*p2);
-               if(wattack(bkpos)) {
-                       *p1++ = v;
-                       *p1++ = *p2;
-               }
-               p2++;
-               bremove();
-       }
-       lmp = p1;
-}
-
-btry(from, mask, offset)
-int from, mask, offset;
-{
-
-       if((dir[from]&mask)==0)
-               bcheck(from, from+offset);
-}
-
-bcheck(from, to)
-int from, to;
-{
-
-       if(board[to]>0) return(1);
-       *lmp++ = (pval+6)[board[to]]-value;
-       *lmp++ = (from<<8)|to;
-       return(board[to] != 0);
-}
-
-wagen()
-{
-       int *p1, *p2, v;
-
-       p1 = lmp;
-       if((flag&1)!=0)
-       if(board[61]==0 && board[62]==0 && board[63]== -4)
-       if(battack(60) && battack(61) && battack(62))
-               wtry(60, 0, 2); /* kingside castle */
-       if((flag&2)!=0)
-       if(board[56]== -4 && board[57]==0 && board[58]==0 && board[59]==0)
-       if(battack(58) && battack(59) && battack(60))
-               wtry(60, 0, -2); /* queenside castle */
-       wgen();
-       p2 = p1;
-       while(p2 != lmp) {
-               v = *p2++;
-               wmove(*p2);
-               if(battack(wkpos)) {
-                       *p1++ = v;
-                       *p1++ = *p2;
-               }
-               p2++;
-               wremove();
-       }
-       lmp = p1;
-}
-
-wtry(from, mask, offset)
-int from, mask, offset;
-{
-
-       if((dir[from]&mask)==0)
-               wcheck(from, from+offset);
-}
-
-wcheck(from, to)
-int from, to;
-{
-
-       if(board[to]<0) return(1);
-       *lmp++ = value-(pval+6)[board[to]];
-       *lmp++ = (from<<8)|to;
-       return(board[to] != 0);
-}
-
diff --git a/.ref-Research-V7/usr/src/games/chess/att.s b/.ref-Research-V7/usr/src/games/chess/att.s
deleted file mode 100644 (file)
index 6579161..0000000
+++ /dev/null
@@ -1,293 +0,0 @@
-/ does white/black attack position?
-
-.globl _battack
-.globl _wattack
-
-.globl _dir, _board
-
-uleft  = 04040;
-uright = 04004;
-dleft  = 00440;
-dright = 00404;
-left   = 00040;
-right  = 00004;
-up     = 04000;
-down   = 00400;
-u2r1   = 06004;
-u1r2   = 04006;
-d1r2   = 00406;
-d2r1   = 00604;
-d2l1   = 00640;
-d1l2   = 00460;
-u1l2   = 04060;
-u2l1   = 06040;
-
-_battack:
-       mov     2(sp),r0
-       asl     r0
-       mov     _dir(r0),r1
-       mov     $2,r2
-       bit     $u2r1,r1
-       bne     1f
-       cmp     _board+[-15.*2](r0),r2
-       beq     2f
-1:
-       bit     $u1r2,r1
-       bne     1f
-       cmp     _board+[-6.*2](r0),r2
-       beq     2f
-1:
-       bit     $d1r2,r1
-       bne     1f
-       cmp     _board+[+10.*2](r0),r2
-       beq     2f
-1:
-       bit     $d2r1,r1
-       bne     1f
-       cmp     _board+[+17.*2](r0),r2
-       beq     2f
-1:
-       bit     $d2l1,r1
-       bne     1f
-       cmp     _board+[+15.*2](r0),r2
-       beq     2f
-1:
-       bit     $d1l2,r1
-       bne     1f
-       cmp     _board+[+6.*2](r0),r2
-       beq     2f
-1:
-       bit     $u1l2,r1
-       bne     1f
-       cmp     _board+[-10.*2](r0),r2
-       beq     2f
-1:
-       bit     $u2l1,r1
-       bne     1f
-       cmp     _board+[-17.*2](r0),r2
-       beq     2f
-1:
-       jsr     r5,badiag; uleft; -9.*2
-       jsr     r5,badiag; uright; -7.*2
-       jsr     r5,badiag; dleft; 7.*2
-       jsr     r5,badiag; dright; 9.*2
-       jsr     r5,barank; up; -8.*2
-       jsr     r5,barank; left; -1.*2
-       jsr     r5,barank; right; 1.*2
-       jsr     r5,barank; down; 8.*2
-
-       bit     $uleft,_dir(r0)
-       bne     1f
-       cmp     _board-18.(r0),$1               / pawn?
-       beq     2f
-1:
-       bit     $uright,_dir(r0)
-       bne     1f
-       cmp     _board-14.(r0),$1
-       bne     1f
-2:
-       clr     r0
-       rts     pc
-1:
-       mov     $1,r0
-       rts     pc
-
-badiag:
-       mov     r0,r1
-       mov     (r5)+,r2
-       mov     (r5)+,r3
-       bit     r2,_dir(r1)
-       bne     1f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2f
-       cmp     r4,$3
-       beq     9f
-       cmp     r4,$5
-       beq     9f
-       cmp     r4,$6
-       beq     9f
-1:
-       rts     r5
-2:
-       bit     r2,_dir(r1)
-       bne     2f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2b
-       cmp     r4,$3
-       beq     9f
-       cmp     r4,$5
-       beq     9f
-2:
-       rts     r5
-
-barank:
-       mov     r0,r1
-       mov     (r5)+,r2
-       mov     (r5)+,r3
-       bit     r2,_dir(r1)
-       bne     1f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2f
-       cmp     r4,$4
-       beq     9f
-       cmp     r4,$5
-       beq     9f
-       cmp     r4,$6
-       beq     9f
-1:
-       rts     r5
-2:
-       bit     r2,_dir(r1)
-       bne     2f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2b
-       cmp     r4,$4
-       beq     9f
-       cmp     r4,$5
-       beq     9f
-2:
-       rts     r5
-
-9:
-       mov     (sp)+,r5
-       clr     r0
-       rts     pc
-
-_wattack:
-       mov     2(sp),r0
-       asl     r0
-       mov     _dir(r0),r1
-       mov     $-2,r2
-       bit     $u2r1,r1
-       bne     1f
-       cmp     _board+[-15.*2](r0),r2
-       beq     2f
-1:
-       bit     $u1r2,r1
-       bne     1f
-       cmp     _board+[-6.*2](r0),r2
-       beq     2f
-1:
-       bit     $d1r2,r1
-       bne     1f
-       cmp     _board+[+10.*2](r0),r2
-       beq     2f
-1:
-       bit     $d2r1,r1
-       bne     1f
-       cmp     _board+[+17.*2](r0),r2
-       beq     2f
-1:
-       bit     $d2l1,r1
-       bne     1f
-       cmp     _board+[+15.*2](r0),r2
-       beq     2f
-1:
-       bit     $d1l2,r1
-       bne     1f
-       cmp     _board+[+6.*2](r0),r2
-       beq     2f
-1:
-       bit     $u1l2,r1
-       bne     1f
-       cmp     _board+[-10.*2](r0),r2
-       beq     2f
-1:
-       bit     $u2l1,r1
-       bne     1f
-       cmp     _board+[-17.*2](r0),r2
-       beq     2f
-1:
-       jsr     r5,wadiag; uleft; -9.*2
-       jsr     r5,wadiag; uright; -7.*2
-       jsr     r5,wadiag; dleft; 7.*2
-       jsr     r5,wadiag; dright; 9.*2
-       jsr     r5,warank; up; -8.*2
-       jsr     r5,warank; left; -1.*2
-       jsr     r5,warank; right; 1.*2
-       jsr     r5,warank; down; 8.*2
-
-       bit     $dleft,_dir(r0)
-       bne     1f
-       cmp     _board+14.(r0),$-1              / pawn?
-       beq     2f
-1:
-       bit     $dright,_dir(r0)
-       bne     1f
-       cmp     _board+18.(r0),$-1
-       bne     1f
-2:
-       clr     r0
-       rts     pc
-1:
-       mov     $1,r0
-       rts     pc
-
-wadiag:
-       mov     r0,r1
-       mov     (r5)+,r2
-       mov     (r5)+,r3
-       bit     r2,_dir(r1)
-       bne     1f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2f
-       cmp     r4,$-3
-       beq     9f
-       cmp     r4,$-5
-       beq     9f
-       cmp     r4,$-6
-       beq     9f
-1:
-       rts     r5
-2:
-       bit     r2,_dir(r1)
-       bne     2f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2b
-       cmp     r4,$-3
-       beq     9f
-       cmp     r4,$-5
-       beq     9f
-2:
-       rts     r5
-
-warank:
-       mov     r0,r1
-       mov     (r5)+,r2
-       mov     (r5)+,r3
-       bit     r2,_dir(r1)
-       bne     1f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2f
-       cmp     r4,$-4
-       beq     9f
-       cmp     r4,$-5
-       beq     9f
-       cmp     r4,$-6
-       beq     9f
-1:
-       rts     r5
-2:
-       bit     r2,_dir(r1)
-       bne     2f
-       add     r3,r1
-       mov     _board(r1),r4
-       beq     2b
-       cmp     r4,$-4
-       beq     9f
-       cmp     r4,$-5
-       beq     9f
-2:
-       rts     r5
-
-9:
-       mov     (sp)+,r5
-       clr     r0
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/games/chess/bgen.s b/.ref-Research-V7/usr/src/games/chess/bgen.s
deleted file mode 100644 (file)
index eeec87f..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/ generate moves
-
-.globl _bgen
-
-.globl _pval, _board, _dir
-.globl _flag, _lmp, _bkpos
-.globl _eppos
-.globl _value
-
-uleft  = 04040
-uright = 04004
-dleft  = 00440
-dright = 00404
-left   = 00040
-right  = 00004
-up     = 04000
-down   = 00400
-u2r1   = 06004
-u1r2   = 04006
-d1r2   = 00406
-d2r1   = 00604
-d2l1   = 00640
-d1l2   = 00460
-u1l2   = 04060
-u2l1   = 06040
-rank2  = 00200
-rank7  = 02000
-
-_bgen:
-       mov     $_dir+126.,r4
-       mov     $_board+126.,r3
-       mov     _lmp,r2
-       mov     $63.,r1
-0:
-       mov     (r3),r0
-       ble     1f
-       asl     r0
-       jmp     *2f-2(r0)
-
-2:
-       pawn
-       knight
-       bishop
-       rook
-       queen
-       king
-
-pawn:
-       bit     $dleft,(r4)
-       bne     2f
-       tst     2*7.(r3)
-       bge     3f
-       jsr     r5,btry; 0; 7.*2
-3:
-       mov     r1,r0
-       add     $7,r0
-       cmp     r0,_eppos
-       bne     2f
-       jsr     r5,btry; 0; -1*2
-2:
-       bit     $dright,(r4)
-       bne     2f
-       tst     9.*2(r3)
-       bge     3f
-       jsr     r5,btry; 0; 2*9.
-3:
-       mov     r1,r0
-       add     $9,r0
-       cmp     r0,_eppos
-       bne     2f
-       jsr     r5,btry; 0; 2*1
-2:
-       tst     2*8.(r3)
-       bne     1f
-       jsr     r5,btry; 0; 2*8.
-       bit     $rank7,(r4)
-       beq     1f
-       tst     2*16.(r3)
-       bne     1f
-       jsr     r5,btry; 0; 16.*2
-       br      1f
-
-knight:
-       jsr     r5,btry; u2r1; -15.*2
-       jsr     r5,btry; u1r2; -6.*2
-       jsr     r5,btry; d1r2; 10.*2
-       jsr     r5,btry; d2r1; 17.*2
-       jsr     r5,btry; d2l1; 15.*2
-       jsr     r5,btry; d1l2; 6.*2
-       jsr     r5,btry; u1l2; -10.*2
-       jsr     r5,btry; u2l1; -17.*2
-       br      1f
-
-
-1:
-       cmp     -(r4),-(r3)
-       dec     r1
-       bpl     0b
-       mov     r2,_lmp
-       rts     pc
-
-bishop:
-       jsr     r5,bslide; uleft; -9.*2
-       jsr     r5,bslide; uright; -7.*2
-       jsr     r5,bslide; dleft; 7.*2
-       jsr     r5,bslide; dright; 9.*2
-       br      1b
-
-rook:
-       jsr     r5,bslide; up; -8.*2
-       jsr     r5,bslide; down; 8.*2
-       jsr     r5,bslide; left; -1.*2.
-       jsr     r5,bslide; right; 1.*2
-       br      1b
-queen:
-       jsr     r5,bslide; uleft; -9.*2
-       jsr     r5,bslide; uright; -7.*2
-       jsr     r5,bslide; dleft; 7.*2
-       jsr     r5,bslide; dright; 9.*2
-       jsr     r5,bslide; up; -8.*2
-       jsr     r5,bslide; left; -1.*2
-       jsr     r5,bslide; right; 1.*2
-       jsr     r5,bslide; down; 8.*2
-       br      1b
-
-king:
-       jsr     r5,btry; uleft; -9.*2
-       jsr     r5,btry; uright; -7.*2
-       jsr     r5,btry; dleft; 7.*2
-       jsr     r5,btry; dright; 9.*2
-       jsr     r5,btry; up; -8.*2
-       jsr     r5,btry; left; -1.*2
-       jsr     r5,btry; right; 1.*2
-       jsr     r5,btry; down; 8.*2
-       br      1b
-
-btry:
-       bit     (r5)+,(r4)
-       bne     1f
-       mov     r3,r0
-       add     (r5),r0
-       mov     (r0),r0
-       bgt     1f
-       asl     r0
-       mov     _pval+12.(r0),(r2)
-       sub     _value,(r2)+
-       mov     (r5)+,r0
-       asr     r0
-       add     r1,r0
-       movb    r0,(r2)+
-       movb    r1,(r2)+
-       rts     r5
-1:
-       tst     (r5)+
-       rts     r5
-
-bslide:
-       mov     r4,-(sp)
-       mov     r3,-(sp)
-1:
-       bit     (r5)+,(r4)
-       bne     1f
-       add     (r5),r3
-       add     (r5),r4
-       mov     (r3),r0
-       bgt     1f
-       blt     2f
-       clr     (r2)
-       sub     _value,(r2)+
-       mov     r3,r0
-       sub     $_board,r0
-       asr     r0
-       movb    r0,(r2)+
-       movb    r1,(r2)+
-       tst     -(r5)
-       br      1b
-2:
-       asl     r0
-       mov     _pval+12.(r0),(r2)
-       sub     _value,(r2)+
-       mov     r3,r0
-       sub     $_board,r0
-       asr     r0
-       movb    r0,(r2)+
-       movb    r1,(r2)+
-1:
-       tst     (r5)+
-       mov     (sp)+,r3
-       mov     (sp)+,r4
-       rts     r5
diff --git a/.ref-Research-V7/usr/src/games/chess/bheur.c b/.ref-Research-V7/usr/src/games/chess/bheur.c
deleted file mode 100644 (file)
index 835cfee..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#include "old.h"
-
-/*
- *     mobility
- *     1 for each potential move
- */
-
-bheur1()
-{
-
-       return(-wheur1());
-}
-
-/*
- *     opening 'goodies'
- *     10 for each minor piece out
- *     -10 for blocking kq pawns
- */
-
-bheur2()
-{
-       int i, mt;
-
-       i = 0;
-       if(game > 2) return(i);
-       mt = amp[-1];
-       if(mt == 2 || mt == 3) i =+ 30;
-       if(mt == 0) i =- 20;
-       i =+ 9*((board[1] != 2)+
-               (board[6] != 2));
-       i =+ 8*((board[2] != 3)+
-               (board[5] != 3));
-
-       /*
-        * -10 for blocked central pawns
-        */
-       if(board[11]==1 && board[11+8]!=0) i =- 10;
-       if(board[12]==1 && board[12+8]!=0) i =- 10;
-       return(i);
-}
-
-/*
- *     ability to castle
- *     22 for both flags
- *     20 for one flag
- */
-
-bheur3()
-{
-       int i;
-
-       i = 0;
-       /*
-        * queenside ability
-        */
-       if(flag&020 && board[8]==1 && board[9]==1 && board[10]==1)
-               i =+ 20;
-       /*
-        *  kingside ability
-        */
-       if(flag&010 && board[13]==1 && board[14]==1 && board[15]==1)
-               i =+ 20;
-       /*
-        * if both
-        */
-       if(i == 40)
-               i = 22;
-       /*
-        * if castled,
-        * keep pawns in
-        */
-       if(bkpos==2)
-               if(board[10]==1 && (board[8]==1 || board[8+8]==1) &&
-                       (board[9]==1 || board[9+8]==1))
-                               i =+ 40;
-       if(bkpos==6)
-               if(board[13]==1 && (board[14]==1 || board[14+8]==1) &&
-                       (board[15]== -1 || board[15+8]== -1))
-                               i =+ 40;
-       return(i);
-}
-
-/*
- *     prance
- *     a percentage if the
- *     piece on the move
- *     can be driven back
- *     by a smaller piece
- */
-
-bheur4()
-{
-       int *p1, *p2, ploc, i;
-
-       if(amp[-1] != 1) return(0);
-       ploc = amp[-3];
-       if(board[ploc] == 1) return(0);
-       if(xheur(ploc)) return(0);
-       p1 = lmp;
-       p2 = p1;
-       wagen();
-       i = 0;
-       while(p2 != lmp) {
-               p2++;
-               wmove(*p2++);
-               i = xheur(ploc);
-               wremove();
-               if(i)
-                       break;
-       }
-       lmp = p1;
-       return(-i);
-}
-
-/*
- *     control
- *     center control
- *             opening
- *             beginning
- *     king control
- *             middle
- *             end
- */
-
-bheur5()
-{
-
-       return(-wheur5());
-}
-
-/*
- * mate threat
- * bad to capture
- */
-bheur6()
-{
-       int i;
-
-       *amp++ = -1;
-       i = 0;
-       if(battack(wkpos))
-               if(mate(2, 0))
-                       i =+ 15;
-       amp--;
-       return(i);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/bmove.s b/.ref-Research-V7/usr/src/games/chess/bmove.s
deleted file mode 100644 (file)
index 56356dd..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-.globl _bmove, _bremove
-.globl _board, _pval, _amp, _flag, _eppos, _value, _bkpos
-.globl _game
-
-_bmove:
-       mov     _amp,r4
-       movb    2(sp),r3                / to
-       movb    3(sp),r2                / from
-       mov     _value,(r4)+
-       mov     _flag,(r4)+
-       mov     _eppos,(r4)+
-       mov     r2,(r4)+
-       mov     r3,(r4)+
-       asl     r2                      / from as a word index
-       asl     r3                      / to as word index
-       mov     _board(r3),r0
-       mov     r0,(r4)+
-       beq     1f
-       asl     r0
-       sub     _pval+12.(r0),_value
-1:
-       mov     _board(r2),r0
-       mov     r0,_board(r3)
-       clr     _board(r2)
-       mov     $-1,_eppos
-       asl     r0
-       ble     error
-       jmp     *0f-2(r0)               / type of man
-0:
-       pmove
-       nmove
-       bmove
-       rmove
-       qmove
-       kmove
-
-error:
-       3
-
-pmove:
-       sub     r3,r2
-       bge     1f
-       neg     r2
-1:
-       cmp     r2,$2*1                 / ep capture
-       bne     1f
-       clr     _board(r3)
-       mov     $1,_board+[2*8.](r3)
-       mov     $4,(r4)+
-       mov     r4,_amp
-       rts     pc
-1:
-       cmp     r2,$2*16.               / double move
-       bne     1f
-       movb    3(sp),r2
-       add     $8,r2
-       mov     r2,_eppos
-       br      move
-1:
-       cmp     r3,$40.*2
-       blt     move
-       add     $25.,_value
-       cmp     r3,$48.*2
-       blt     move
-       add     $50.,_value
-       cmp     r3,$56.*2               / queen promotion
-       blt     move
-       add     $625.,_value
-       mov     $5,_board(r3)
-       mov     $5,(r4)+
-       mov     r4,_amp
-       rts     pc
-
-rmove:
-       cmp     r2,$2*7.
-       bne     1f
-       bic     $10,_flag
-       br      move
-1:
-       tst     r2
-       bne     move
-       bic     $20,_flag
-       br      move
-
-kmove:
-       asr     r3
-       mov     r3,_bkpos
-       bic     $30,_flag
-       cmp     r2,$2*4.
-       bne     2f
-       cmp     r3,$6                   / kingside castle
-       bne     1f
-       inc     _value
-       mov     $4,_board+[2*5.]
-       clr     _board+[2*7.]
-       mov     $2,(r4)+
-       mov     r4,_amp
-       rts     pc
-1:
-       cmp     r3,$2                   / queenside castle
-       bne     2f
-       inc     _value
-       mov     $4,_board+[2*3.]
-       clr     _board+[2*0.]
-       mov     $3,(r4)+
-       mov     r4,_amp
-       rts     pc
-2:                                     / king move
-       tst     _game
-       bne     1f
-       sub     $2,_value
-1:
-       clr     (r4)+
-       mov     r4,_amp
-       rts     pc
-
-qmove:
-       tst     _game
-       bne     move
-       dec     _value
-       br      move
-
-nmove:
-bmove:
-move:
-       mov     $1,(r4)+
-       mov     r4,_amp
-       rts     pc
-
-_bremove:
-       mov     _amp,r4
-       mov     -(r4),r0
-       mov     -(r4),r1
-       mov     -(r4),r3
-       mov     -(r4),r2
-       mov     -(r4),_eppos
-       mov     -(r4),_flag
-       mov     -(r4),_value
-       mov     r4,_amp
-       asl     r2
-       asl     r3
-       mov     _board(r3),_board(r2)
-       mov     r1,_board(r3)
-       asl     r0
-       jmp     *0f(r0)
-0:
-       movek
-       movex
-       moveo
-       moveoo
-       movep
-       moveq
-
-movek:
-       asr     r2
-       mov     r2,_bkpos
-
-movex:
-       rts     pc
-
-moveo:
-       mov     $4,_board+[2*7.]
-       clr     _board+[2*5]
-       mov     $4,_bkpos
-       rts     pc
-
-moveoo:
-       mov     $4,_board+[2*0]
-       clr     _board+[2*3]
-       mov     $4,_bkpos;
-       rts     pc
-
-movep:
-       mov     $1,_board(r2)
-       clr     _board+[2*8.](r3)
-       rts     pc
-
-moveq:
-       mov     $1,_board(r2)
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/games/chess/book.c b/.ref-Research-V7/usr/src/games/chess/book.c
deleted file mode 100644 (file)
index 8b88fe8..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#include "old.h"
-
-bookm()
-{
-       int i, buf[2];
-
-       if(!bookp) return(0);
-       lseek(bookf, (long)(unsigned)bookp, 0);
-
-       i = 0;
-loop:
-       read(bookf, buf, 4);
-       *buf = booki(*buf);
-       if(*buf >= 0) {
-               if(!i)
-                       i = *buf;
-               goto loop;
-       }
-       if(abmove = i)
-               return(1);
-       return(0);
-}
-
-makmov(m)
-{
-       int buf[2];
-
-       out1(m);
-       mantom? bmove(m): wmove(m);
-       increm();
-       if(!bookp) return;
-       lseek(bookf, (long)(unsigned)bookp, 0);
-
-loop:
-       read(bookf, buf, 4);
-       *buf = booki(*buf);
-       if(m == *buf || *buf == 0) {
-               bookp = buf[1] & ~1;
-               goto l1;
-       }
-       if(*buf < 0) {
-               bookp = 0;
-               goto l1;
-       }
-       goto loop;
-
-l1:
-       if(!bookp) {
-               putchar('\n');
-               return;
-       }
-}
-
-booki(m)
-{
-       int i;
-       struct {
-               char low;
-               char high;
-       };
-       i.high = m.low;
-       i.low = m.high;
-       return(i);
-}
-
diff --git a/.ref-Research-V7/usr/src/games/chess/bplay.c b/.ref-Research-V7/usr/src/games/chess/bplay.c
deleted file mode 100644 (file)
index 927b86b..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#include "old.h"
-
-bplay()
-{
-       int v1, v2, *p1, *p2, *p3, ab;
-
-       if(value > ivalue)
-               ivalue = value;
-       ab = 0;
-       v1 = -3000;
-       ply = 0;
-       p1 = statl();
-       if(lmp == p1+2) {
-               abmove = p1[1];
-               lmp = p1;
-               return(ivalue);
-       }
-       p2 = p1;
-       mantom = !mantom;
-       while(p2 != lmp) {
-               p2++;
-               bmove(*p2);
-               if(testf) {
-                       mantom = !mantom;
-                       bstatic(1);
-                       mantom = !mantom;
-               }
-               if(rept())
-                       v2 = 0; else
-                       v2 = wplay1(v1);
-               if(v2 > v1 && !mate(3, 0)) {
-                       ab = *p2;
-                       v1 = v2;
-               }
-               bremove();
-               if(testf) {
-                       mantom = !mantom;
-                       printf("%6d ", v2);
-                       out(*p2);
-                       printf("\n");
-                       mantom = !mantom;
-               }
-               p2++;
-       }
-       if(ab == 0 && lmp != p1)
-               ab = p1[1];
-       mantom = !mantom;
-       lmp = p1;
-       abmove = ab;
-       return(v1);
-}
-
-bplay1(ab)
-int ab;
-{
-       int v1, v2, *p1, *p2;
-
-       if(ply >= depth)
-               return(bquies(ab));
-       ply++;
-       p1 = p2 = lmp;
-       bgen();
-       qsort(p1, lmp);
-       v1 = -3000;
-       while(p2 != lmp) {
-               if(intrp)
-                       goto out;
-               p2++;
-               bmove(*p2);
-               if(wattack(bkpos)) {
-                       v2 = wplay1(v1);
-                       if(v2 > v1)
-                               v1 = v2;
-               }
-               bremove();
-               if(v1 >= ab)
-                       goto out;
-               p2++;
-       }
-out:
-       ply--;
-       lmp = p1;
-       if(v1 == -3000) {
-               v1++;
-               if(!check())
-                       v1 = 0;
-       }
-       return(v1);
-}
-
-bquies(ab)
-int ab;
-{
-       int *p1, *p2, *p3, v1, v2;
-
-       if(ply >= qdepth)
-               return(ivalue);
-       p1 = p2 = p3 = lmp;
-       bgen();
-       while(p2 != lmp) {
-               v1 = -(*p2++);
-               if(v1 != value && v1 >= ivalue-50) {
-                       *p3++ = ((-(pval+6)[board[*p2>>8]]/100)<<8) |
-                               ((pval+6)[board[*p2&0377]]/100);
-                       *p3++ = *p2;
-               }
-               p2++;
-       }
-       if(p3 == p1) {
-               lmp = p1;
-               return(value);
-       }
-       ply++;
-       qsort(p1, p3);
-       lmp = p3;
-       p2 = p1;
-       v1 = value;
-       while(p2 != lmp) {
-               p2++;
-               bmove(*p2);
-               if(wattack(bkpos)) {
-                       v2 = wquies(v1);
-               } else
-                       v2 = -3000;
-               if(v2 > v1)
-                       v1 = v2;
-               bremove();
-               if(v1 >= ab)
-                       goto out;
-               p2++;
-       }
-out:
-       ply--;
-       lmp = p1;
-       return(v1);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/ctrl.s b/.ref-Research-V7/usr/src/games/chess/ctrl.s
deleted file mode 100644 (file)
index 6091624..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/ list pieces controlling a square
-
-.globl _attack
-
-.globl _dir, _board
-.globl _attacv
-
-none   = 12345
-uleft  = 04040;
-uright = 04004;
-dleft  = 00440;
-dright = 00404;
-left   = 00040;
-right  = 00004;
-up     = 04000;
-down   = 00400;
-u2r1   = 06004;
-u1r2   = 04006;
-d1r2   = 00406;
-d2r1   = 00604;
-d2l1   = 00640;
-d1l2   = 00460;
-u1l2   = 04060;
-u2l1   = 06040;
-
-_attack:
-       mov     2(sp),r0
-       asl     r0
-       mov     $_attacv,r4
-
-       jsr     r5,patt
-               u2r1
-               -15.*2
-               2; -2
-       jsr     r5,patt
-               u1r2
-               -6.*2
-               2; -2
-       jsr     r5,patt
-               d2r1
-               17.*2
-               2; -2
-       jsr     r5,patt
-               d2l1
-               15.*2
-               2; -2
-       jsr     r5,patt
-               d1l2
-               6.*2
-               2; -2
-       jsr     r5,patt
-               u1l2
-               -10.*2
-               2; -2
-       jsr     r5,patt
-               u2l1
-               -17.*2
-               2; -2
-
-       jsr     r5,satt
-               uleft; -9.*2
-               1
-               3; -3; 5; -5
-       jsr     r5,satt
-               uright; -7.*2
-               1
-               3; -3; 5; -5
-       jsr     r5,satt
-               dleft; 7.*2
-               -1
-               3; -3; 5; -5
-       jsr     r5,satt
-               dright; 9.*2
-               -1
-               3; -3; 5; -5
-       jsr     r5,satt
-               up; -8.*2
-               none
-               4; -4; 5; -5
-       jsr     r5,satt
-               left; -1.*2
-               none
-               4; -4; 5; -5
-       jsr     r5,satt
-               right; 1.*2
-               none
-               4; -4; 5; -5
-       jsr     r5,satt
-               down; 8.*2
-               none
-               4; -4; 5; -5
-       clr     (r4)+
-       rts     pc
-
-patt:
-       bit     (r5)+,_dir(r0)
-       bne     1f
-       mov     r0,r1
-       add     (r5)+,r1
-       jsr     pc,look
-       jsr     pc,look
-       rts     r5
-1:
-       add     $6,r5
-       rts     r5
-
-satt:
-       mov     r5,-(sp)
-       bit     (r5)+,_dir(r0)
-       bne     1f
-       mov     r0,r1
-       add     (r5)+,r1
-       jsr     pc,look                 / pawn
-       mov     r0,r1
-2:
-       mov     (sp),r5
-       bit     (r5)+,_dir(r1)
-       bne     1f
-       add     (r5)+,r1
-       tst     _board(r1)
-       beq     2b
-       tst     (r5)+
-       mov     r4,-(sp)
-       jsr     pc,look
-       jsr     pc,look
-       jsr     pc,look
-       jsr     pc,look
-       cmp     (sp)+,r4
-       bne     2b
-1:
-       mov     (sp)+,r5
-       add     $14.,r5
-       rts     r5
-
-look:
-       cmp     (r5)+,_board(r1)
-       bne     1f
-       mov     -2(r5),(r4)+
-1:
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/games/chess/data.c b/.ref-Research-V7/usr/src/games/chess/data.c
deleted file mode 100644 (file)
index 12a512f..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-int    center[]
-{
-       2,3,4,4,4,4,3,2,
-       3,6,8,8,8,8,6,3,
-       4,8,12,12,12,12,8,4,
-       4,8,12,14,14,12,8,4,
-       4,8,12,14,14,12,8,4,
-       4,8,12,12,12,12,8,4,
-       3,6,8,8,8,8,6,3,
-       2,3,4,4,4,4,3,2
-};
-
-int    wheur1();
-int    wheur2();
-int    wheur3();
-int    wheur4();
-int    wheur5();
-int    wheur6();
-int    wheur[]
-{
-       &wheur1,
-       &wheur2,
-       &wheur3,
-       &wheur4,
-       &wheur5,
-       &wheur6,
-       0
-};
-
-int    bheur1();
-int    bheur2();
-int    bheur3();
-int    bheur4();
-int    bheur5();
-int    bheur6();
-int    bheur[]
-{
-       &bheur1,
-       &bheur2,
-       &bheur3,
-       &bheur4,
-       &bheur5,
-       &bheur6,
-       0
-};
-
-int    ipval[]
-{
-       -3000, -900, -500, -300, -300, -100,
-       0,
-       100, 300, 300, 500, 900, 3000
-};
-
-int    moveno  1;
-int    depth   2;
-int    qdepth  8;
-int    mdepth  4;
-int    flag    033;
-int    eppos   64;
-int    bkpos   4;
-int    wkpos   60;
-int    edge[]
-{
-       040, 020, 010, 0, 0, 1, 2, 4
-};
-int    board[]
-{
-       4, 2, 3, 5, 6, 3, 2, 4,
-       1, 1, 1, 1, 1, 1, 1, 1,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       0, 0, 0, 0, 0, 0, 0, 0,
-       -1, -1, -1, -1, -1, -1, -1, -1,
-       -4, -2, -3, -5, -6, -3, -2, -4,
-};
diff --git a/.ref-Research-V7/usr/src/games/chess/init.c b/.ref-Research-V7/usr/src/games/chess/init.c
deleted file mode 100644 (file)
index 366557b..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-#include "old.h"
-
-main()
-{
-       int i;
-
-       printf("Chess\n");
-       itinit();
-       lmp = lmbuf;
-       amp = ambuf;
-       *amp++ = -1;
-       *lmp++ = -1;            /* fence */
-       bookf = open("/usr/lib/book", 0);
-       if(bookf > 0)
-               read(bookf, &bookp, 2);
-       i = 64;
-       while(i--)
-               dir[i] = (edge[i/8]<<6) | edge[i%8];
-       play(0);
-}
-
-ctime(s, t)
-{
-
-       printf("%s: %d:%d%d\n", s, t/60, (t/10)%6, t%10);
-}
-
-check()
-{
-
-       return((!wattack(bkpos) || !battack(wkpos))? 1: 0);
-}
-
-increm()
-{
-
-       clktim[mantom] =+ clock();
-       if(mantom)
-               moveno++;
-       mantom = !mantom;
-}
-
-decrem()
-{
-
-       mantom = !mantom;
-       if(mantom)
-               moveno--;
-}
-
-stage()
-{
-       int i, a;
-
-       qdepth = depth+8;
-       for(i=0; i<13; i++)
-               pval[i] = ipval[i];
-       value = 0;
-       for(i=0; i<64; i++) {
-               a = board[i];
-               value =+ (pval+6)[a];
-       }
-       if(value > 150)
-               gval = 1; else
-       if(value < -150)
-               gval = -1; else
-               gval = 0;
-       i = -6;
-       while(i <= 6) {
-               a = (pval+6)[i];
-               if(a < 0)
-                       a =- 50; else
-                       a =+ 50;
-               if(a < 0)
-                       a = -((-a)/100); else
-                       a =/ 100;
-               if(i)
-                       (pval+6)[i] = a*100-gval;
-               i++;
-       }
-       a = 13800;
-       i = 64;
-       while(i--)
-               a =- abs((pval+6)[board[i]]);
-       if(a > 4000)
-               game = 3; else
-       if(a > 2000)
-               game = 2; else
-       if(moveno > 5)
-               game = 1; else
-               game = 0;
-}
-
-posit(f, p, a)
-int (*f)();
-int *p;
-{
-       int m;
-
-       while(amp != p) {
-               m = amp[3]<<8;
-               m =| amp[4]&0377;
-               (*f)(m, a);
-               if(mantom) {
-                       bmove(m);
-                       moveno++;
-                       mantom = 0;
-               } else {
-                       wmove(m);
-                       mantom = 1;
-               }
-       }
-}
-
-rept1(m, a)
-int *a;
-{
-       int i;
-
-       if(mantom != a[64])
-               return;
-       for(i=0; i<64; i++)
-               if(board[i] != a[i])
-                       return;
-       a[65]++;
-}
-
-rept()
-{
-       int a[66], i, *p;
-
-       for(i=0; i<64; i++)
-               a[i] = board[i];
-       a[64] = mantom;
-       a[65] = 0;
-       p = amp;
-       while(amp[-1] != -1) {
-               if(amp[-2])
-                       break;
-               i = board[amp[-3]];
-               if(i == 1 || i == -1)
-                       break;
-               mantom? wremove(): bremove();
-               decrem();
-       }
-       posit(rept1, p, a);
-       return(a[65]);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/io.c b/.ref-Research-V7/usr/src/games/chess/io.c
deleted file mode 100644 (file)
index 70ffdb4..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-#include "old.h"
-
-rline()
-{
-       char *p1;
-       int c;
-
-       p1 = sbuf;
-       while((c = getchar()) != '\n')
-               if(c <= 0)
-                       onhup(); else
-                       *p1++ = c;
-       *p1++ = '\0';
-}
-
-getchar()
-{
-       int c;
-
-loop:
-       c = 0;
-       read(0, &c, 1);
-       if(c == 0 && intrp) {
-               intrp = 0;
-               goto loop;
-       }
-       return(c);
-}
-
-pboard()
-{
-       int i, x, y, c, p;
-
-       c = 0;
-       i = 0;
-       x = 8;
-       while(x--) {
-               if(!mantom || mfmt)
-                       putchar('1'+x); else
-                       putchar('8'-x);
-               putchar(' ');
-               c++;
-               y = 8;
-               while(y--) {
-                       c++;
-                       putchar(' ');
-                       if(p = board[i++])
-                               putchar("kqrbnp PNBRQK"[p+6]); else
-                               if((c&1)!=0)
-                                       putchar('*'); else
-                                       putchar('-');
-               }
-               putchar('\n');
-               if(intrp)
-                       return;
-       }
-       if(mfmt)
-               printf("\n   a b c d e f g h"); else
-               printf("\n   q q q q k k k k\n   r n b     b n r");
-               printf("\n");
-}
-
-out1(m)
-{
-       printf("%d. ", moveno);
-       if(mantom)
-               printf("... ");
-       out(m);
-       putchar('\n');
-}
-
-out(m)
-int m;
-{
-       int from, to, epf, pmf;
-
-       from = m>>8;
-       to = m&0377;
-       if(mfmt) {
-               algco(from);
-               algco(to);
-               return;
-       }
-       mantom? bmove(m): wmove(m);
-       epf = pmf = 0;
-       switch(amp[-1]) {
-
-       case 0:
-       case 1:
-               stdp(board[to]);
-       ed:
-               putchar('/');
-               stdb(from);
-               if(amp[-2]) {
-                       putchar('x');
-                       stdp(amp[-2]);
-                       putchar('/');
-               } else
-                       putchar('-');
-               stdb(to);
-               break;
-
-       case 3:
-               putchar('o');
-               putchar('-');
-
-       case 2:
-               putchar('o');
-               putchar('-');
-               putchar('o');
-               break;
-
-       case 4:
-               epf = 1;
-               putchar('p');
-               goto ed;
-
-       case 5:
-               pmf = 1;
-               putchar('p');
-               goto ed;
-       }
-       if(pmf) {
-               putchar('(');
-               putchar('q');
-               putchar(')');
-       }
-       if(epf) {
-               putchar('e');
-               putchar('p');
-       }
-       if(check())
-               putchar('+');
-       mantom? bremove(): wremove();
-}
-
-stdp(p)
-int p;
-{
-
-       if(p < 0)
-               p = -p;
-       p = "ppnbrqk"[p];
-       putchar(p);
-}
-
-stdb(b)
-int b;
-{
-       int r, f;
-
-       r = b/8;
-       if((f = b%8) < 4)
-               putchar('q'); else {
-               putchar('k');
-               f = 7-f;
-       }
-       f = "rnb\0"[f];
-       if(f)
-               putchar(f);
-       putchar(mantom? r+'1': '8'-r);
-}
-
-algco(p)
-int p;
-{
-       putchar('a'+(p%8));
-       putchar('8'-(p/8));
-}
-
-putchar(c)
-{
-
-       switch(c) {
-
-       case '\t':
-               do
-                       putchar(' ');
-               while(column%8);
-               return;
-
-       case '\n':
-               column = 0;
-               break;
-
-       default:
-               column++;
-       }
-       write(1, &c, 1);
-}
-
-prtime(a, b)
-{
-
-       printf("time = %d/%d\n", a, b);
-}
-
-score1(m)
-{
-       if(intrp)
-               return;
-       if(!mantom) {
-               if(moveno < 10)
-                       putchar(' '); else
-                       putchar(moveno/10 + '0');
-               putchar(moveno%10 + '0');
-               putchar('.');
-               putchar(' ');
-       } else
-               while(column < 20)
-                       putchar(' ');
-       out(m);
-       if(mantom)
-               putchar('\n');
-}
-
-score()
-{
-       int *p;
-
-       putchar('\n');
-       p = amp;
-       while(amp[-1] != -1) {
-               mantom? wremove(): bremove();
-               decrem();
-       }
-       posit(score1, p);
-       putchar('\n');
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/makefile b/.ref-Research-V7/usr/src/games/chess/makefile
deleted file mode 100644 (file)
index f556d3f..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-a.out: agen.o\
-       att.o\
-       bgen.o\
-       bheur.o\
-       bmove.o\
-       book.o\
-       bplay.o\
-       ctrl.o\
-       data.o\
-       init.o\
-       io.o\
-       mater.o\
-       play.o\
-       qsort.o\
-       savres.o\
-       setup.o\
-       stat.o\
-       stdin.o\
-       wgen.o\
-       wheur.o\
-       wmove.o\
-       wplay.o
-       cc -n -s agen.o\
-       att.o\
-       bgen.o\
-       bheur.o\
-       bmove.o\
-       book.o\
-       bplay.o\
-       ctrl.o\
-       data.o\
-       init.o\
-       io.o\
-       mater.o\
-       play.o\
-       qsort.o\
-       savres.o\
-       setup.o\
-       stat.o\
-       stdin.o\
-       wgen.o\
-       wheur.o\
-       wmove.o\
-       wplay.o
-
-agen.i:        agen.c old.h
-       cc -S -O agen.c
-       mv agen.s  agen.i
-
-agen.o:        agen.i
-       as - -o agen.o agen.i
-
-bheur.i:       bheur.c old.h
-       cc -S -O bheur.c
-       mv bheur.s  bheur.i
-
-bheur.o:       bheur.i
-       as - -o bheur.o bheur.i
-
-book.i:        book.c old.h
-       cc -S -O book.c
-       mv book.s  book.i
-
-book.o:        book.i
-       as - -o book.o book.i
-
-bplay.i:       bplay.c old.h
-       cc -S -O bplay.c
-       mv bplay.s  bplay.i
-
-bplay.o:       bplay.i
-       as - -o bplay.o bplay.i
-
-data.i:        data.c old.h
-       cc -S -O data.c
-       mv data.s  data.i
-
-data.o:        data.i
-       as - -o data.o data.i
-
-init.i:        init.c old.h
-       cc -S -O init.c
-       mv init.s  init.i
-
-init.o:        init.i
-       as - -o init.o init.i
-
-io.i:  io.c old.h
-       cc -S -O io.c
-       mv io.s  io.i
-
-io.o:  io.i
-       as - -o io.o io.i
-
-mater.i:       mater.c old.h
-       cc -S -O mater.c
-       mv mater.s  mater.i
-
-mater.o:       mater.i
-       as - -o mater.o mater.i
-
-play.i:        play.c old.h
-       cc -S -O play.c
-       mv play.s  play.i
-
-play.o:        play.i
-       as - -o play.o play.i
-
-savres.i:      savres.c old.h
-       cc -S -O savres.c
-       mv savres.s  savres.i
-
-savres.o:      savres.i
-       as - -o savres.o savres.i
-
-setup.i:       setup.c old.h
-       cc -S -O setup.c
-       mv setup.s  setup.i
-
-setup.o:       setup.i
-       as - -o setup.o setup.i
-
-stat.i:        stat.c old.h
-       cc -S -O stat.c
-       mv stat.s  stat.i
-
-stat.o:        stat.i
-       as - -o stat.o stat.i
-
-stdin.i:       stdin.c old.h
-       cc -S -O stdin.c
-       mv stdin.s  stdin.i
-
-stdin.o:       stdin.i
-       as - -o stdin.o stdin.i
-
-wheur.i:       wheur.c old.h
-       cc -S -O wheur.c
-       mv wheur.s  wheur.i
-
-wheur.o:       wheur.i
-       as - -o wheur.o wheur.i
-
-wplay.i:       wplay.c old.h
-       cc -S -O wplay.c
-       mv wplay.s  wplay.i
-
-wplay.o:       wplay.i
-       as - -o wplay.o wplay.i
-
-att.o: att.s
-       as - -o att.o att.s
-
-bgen.o:        bgen.s
-       as - -o bgen.o bgen.s
-
-bmove.o:       bmove.s
-       as - -o bmove.o bmove.s
-
-ctrl.o:        ctrl.s
-       as - -o ctrl.o ctrl.s
-
-qsort.o:       qsort.s
-       as - -o qsort.o qsort.s
-
-wgen.o:        wgen.s
-       as - -o wgen.o wgen.s
-
-wmove.o:       wmove.s
-       as - -o wmove.o wmove.s
-
diff --git a/.ref-Research-V7/usr/src/games/chess/mater.c b/.ref-Research-V7/usr/src/games/chess/mater.c
deleted file mode 100644 (file)
index 422a989..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include "old.h"
-
-mate(n, f)
-{
-       int a, b;
-
-       mantom = !mantom;
-       if(f == 0) {
-               b = mater(n);
-               mantom = !mantom;
-               return(b);
-       }
-       b = 0;
-       if(matflg) {
-               a = 1;
-               while(!mater(a)) {
-                       if(a >= n) {
-                               matflg = 0;
-                               return(0);
-                       }
-                       a++;
-               }
-               b = abmove;
-               goto out;
-       }
-       a = n;
-       while(mater(a)) {
-               if(a == mdepth) {
-                       printf("Forced mate\n");
-                       matflg++;
-               }
-               b = abmove;
-               if(a == 0)
-                       break;
-               a--;
-       }
-out:
-       mantom = !mantom;
-       if(b) {
-               abmove = b;
-               return(1);
-       }
-       return(0);
-}
-
-mater(ns)
-{
-       int *p1, *p2, *p3, f;
-
-       if(intrp || --ns < 0)
-               return(0);
-       p1 = lmp;
-       p2 = p1;
-       p3 = p1;
-       mantom? wgen(): bgen();
-       while(p2 != lmp) {
-               p2++;
-               mantom? wmove(*p2): bmove(*p2);
-               if((!mantom && !battack(wkpos) && wattack(bkpos)) ||
-                 (mantom && !wattack(bkpos) && battack(wkpos))) {
-                       *p3 = *p2;
-                       p3++;
-               }
-               mantom? wremove(): bremove();
-               p2++;
-       }
-       lmp = p3;
-       p2 = p1;
-       while(p2 != lmp) {
-               mantom? wmove(*p2): bmove(*p2);
-               f = xmater(ns);
-               mantom? wremove(): bremove();
-               if(f) {
-                       abmove = *p2;
-                       lmp = p1;
-                       return(1);
-               }
-               p2++;
-       }
-       lmp = p1;
-       return(0);
-}
-
-xmater(ns)
-{
-       int *p1, *p2, f;
-
-       p1 = lmp;
-       p2 = p1;
-       mantom? bagen(): wagen();
-       if(p2+2 == lmp && rept() == 0)
-               ns++;
-       while(p2 != lmp) {
-               p2++;
-               mantom? bmove(*p2): wmove(*p2);
-               f = mater(ns);
-               mantom? bremove(): wremove();
-               if(!f) {
-                       lmp = p1;
-                       return(0);
-               }
-               p2++;
-       }
-       lmp = p1;
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/old.h b/.ref-Research-V7/usr/src/games/chess/old.h
deleted file mode 100644 (file)
index 2f554ac..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#define        uleft   04040
-#define        uright  04004
-#define        dleft   00440
-#define        dright  00404
-#define        left    00040
-#define        right   00004
-#define        up      04000
-#define        down    00400
-#define        u2r1    06004
-#define        u1r2    04006
-#define        d1r2    00406
-#define        d2r1    00604
-#define        d2l1    00640
-#define        d1l2    00460
-#define        u1l2    04060
-#define        u2l1    06040
-#define        rank2   00200
-#define        rank7   02000
-
-int    attacv[64];
-int    center[64];
-int    wheur[];
-int    bheur[];
-int    control[64];
-int    clktim[2];
-int    testf;
-int    qdepth;
-int    mdepth;
-int    bookf;
-int    bookp;
-int    manflg;
-int    matflg;
-int    intrp;
-int    moveno;
-int    gval;
-int    game;
-int    abmove;
-int    *lmp;
-int    *amp;
-char   *sbufp;
-int    lastmov;
-int    mantom;
-int    ply;
-int    value;
-int    ivalue;
-int    mfmt;
-int    depth;
-int    flag;
-int    eppos;
-int    bkpos;
-int    wkpos;
-int    column;
-int    edge[8];
-int    pval[13];
-int    ipval[13];
-int    dir[64];
-int    board[64];
-int    lmbuf[1000];
-int    ambuf[1200];
-char   sbuf[100];
diff --git a/.ref-Research-V7/usr/src/games/chess/pio.c b/.ref-Research-V7/usr/src/games/chess/pio.c
deleted file mode 100644 (file)
index ca0ec0c..0000000
+++ /dev/null
@@ -1,377 +0,0 @@
-#include "old.h"
-
-rline()
-{
-       char *p1;
-       int c;
-
-loop0:
-       p1 = sbuf;
-loop:
-       c = getchar();
-       if(c <= 0)
-               exit(0);
-       if(c == '#')
-               goto loop0;
-       if(c != '*') {
-               *p1++ = c;
-               goto loop;
-       }
-       switch(getchar()) {
-
-       case '#':
-               goto loop0;
-
-       case '*':
-               if(p1 != sbuf+4) {
-                       printf("bad input\n");
-                       goto loop0;
-               }
-               sbuf[0] =+ 'a'-'1';
-               sbuf[2] =+ 'a'-'1';
-               *p1++ = '\0';
-               return;
-
-       case '0':
-               exit(0);
-
-       case '1':
-               spread("");
-               return;
-
-       case '2':
-               spread("first");
-               return;
-
-       case '3':
-               spread("clock");
-               return;
-
-       case '4':
-               spread("score");
-               return;
-
-       case '5':
-               spread("remove");
-               return;
-
-       case '6':
-               spread("repeat");
-               return;
-
-       case '7':
-               spread("save");
-               return;
-
-       case '8':
-               spread("restore");
-               return;
-       }
-       printf("bad option\n");
-       goto loop;
-}
-
-spread(s)
-char *s;
-{
-       char *p;
-
-       p = sbuf;
-       while(*p++ = *s++) ;
-}
-
-pboard()
-{
-       int i, x, y, c, p;
-
-       i = 0;
-       x = 8;
-       while(x--) {
-               y = 8;
-               while(y--) {
-                       p = board[i++];
-                       if(p == 0) {
-                               printf("space\n");
-                               continue;
-                       }
-                       if(p < 0)
-                               printf("white "); else
-                               printf("black ");
-                       putpiece("kqrbnp pnbrqk"[p+6]);
-               }
-               pause();
-               printf("end\n");
-               pause();
-       }
-}
-
-putpiece(p)
-{
-       char *s;
-
-       s = "god only knows";
-       switch(p) {
-
-       case 'p':
-               s = "pawn";
-               break;
-
-       case 'n':
-               s = "knight";
-               break;
-
-       case 'b':
-               s = "bishop";
-               break;
-
-       case 'r':
-               s = "rook";
-               break;
-
-       case 'q':
-               s = "queen";
-               break;
-
-       case 'k':
-               s = "king";
-               break;
-       }
-       printf("%s\n", s);
-}
-
-out1(m)
-{
-       putnumb(moveno);
-       pause();
-       out(m);
-       pause();
-}
-
-out(m)
-int m;
-{
-       int from, to, epf, pmf;
-
-       from = m>>8;
-       to = m&0377;
-       mantom? bmove(m): wmove(m);
-       epf = pmf = 0;
-       switch(amp[-1]) {
-
-       case 0:
-       case 1:
-               stdp(board[to]);
-       ed:
-               printf("at\n");
-               stdb(from);
-               if(amp[-2]) {
-                       printf("takes\n");
-                       stdp(amp[-2]);
-                       printf("at\n");
-               } else
-                       printf("to\n");
-               stdb(to);
-               break;
-
-       case 3:
-               printf("castle queen side\n");
-               break;
-
-       case 2:
-               printf("castle king side\n");
-               break;
-
-       case 4:
-               epf = 1;
-               putpiece('p');
-               goto ed;
-
-       case 5:
-               pmf = 1;
-               putpiece('p');
-               goto ed;
-       }
-       if(pmf) {
-               printf("becomes\n");
-               putpiece('q');
-       }
-       if(epf) {
-               printf("en passent\n");
-       }
-       if(check())
-               printf("check\n");
-       mantom? bremove(): wremove();
-}
-
-stdp(p)
-int p;
-{
-
-       if(p < 0)
-               p = -p;
-       p = "ppnbrqk"[p];
-       putpiece(p);
-}
-
-stdb(b)
-int b;
-{
-       int r, f;
-
-       r = b/8;
-       if((f = b%8) < 4)
-               putpiece('q'); else {
-               putpiece('k');
-               f = 7-f;
-       }
-       f = "rnb\0"[f];
-       if(f)
-               putpiece(f);
-       putnumb(mantom? r+1: 8-r);
-}
-
-prtime(a, b)
-{
-
-       printf("compute time is\n");
-       putnumb(a);
-       printf("real time is\n");
-       putnumb(b);
-       pause();
-}
-
-putnumb(n)
-{
-
-       if(n <= 12) {
-               putdig(n);
-               putchar('\n');
-               return;
-       }
-       if(n <= 19) {
-               putdig(n+1);
-               printf("teen\n");
-               return;
-       }
-       if(n >= 100) {
-               putnumb(n/100);
-               printf("hundred\n");
-               n =% 100;
-               if(n)
-                       putnumb(n);
-               return;
-       }
-       putdig(n/10+11);
-       printf("tee\n");
-       n =% 10;
-       if(n)
-               putnumb(n);
-}
-
-putdig(n)
-{
-       char *s;
-
-       s = "god only knows";
-       switch(n) {
-
-       case 0:
-               s = "zero";
-               break;
-
-       case 1:
-               s = "one";
-               break;
-
-       case 2:
-               s = "two";
-               break;
-
-       case 3:
-               s = "three";
-               break;
-
-       case 4:
-       case 15:
-               s = "four";
-               break;
-
-       case 5:
-               s = "five";
-               break;
-
-       case 6:
-       case 17:
-               s = "six";
-               break;
-
-       case 7:
-       case 18:
-               s = "seven";
-               break;
-
-       case 8:
-       case 19:
-               s = "eight";
-               break;
-
-       case 9:
-       case 20:
-               s = "nine";
-               break;
-
-       case 10:
-               s = "ten";
-               break;
-
-       case 11:
-               s = "eleven";
-               break;
-
-       case 12:
-               s = "twelve";
-               break;
-
-       case 13:
-               s = "twen";
-               break;
-
-       case 14:
-               s = "thir";
-               break;
-
-       case 16:
-               s = "fif";
-               break;
-       }
-       printf(s);
-}
-
-pause()
-{
-
-       printf("...\n");
-}
-
-score1(m)
-{
-       if(!mantom) {
-               putnumb(moveno);
-               pause();
-       }
-       out(m);
-       pause();
-}
-
-score()
-{
-       int *p;
-
-       p = amp;
-       while(amp[-1] != -1) {
-               mantom? wremove(): bremove();
-               decrem();
-       }
-       posit(score1, p);
-       printf("the end\n");
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/play.c b/.ref-Research-V7/usr/src/games/chess/play.c
deleted file mode 100644 (file)
index 1b0ba52..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-#include "old.h"
-
-play(f)
-int f;
-{
-       int t, i, ts[9];
-
-       clock();
-       ts[8] = 0;
-       if(f) goto first;
-loop:
-       intrp = 0;
-       move();
-
-first:
-       if(manflg)
-               goto loop;
-       i = mantom;
-       t = clktim[i];
-       if(!bookm())
-       if(!mate(mdepth, 1))
-               xplay();
-       if(intrp) {
-               decrem();
-               mantom? bremove(): wremove();
-               goto loop;
-       }
-       if(!abmove) {
-               printf("Resign\n");
-               onhup();
-       }
-       makmov(abmove);
-       i = clktim[i];
-       t = i-t;
-       times(ts);
-       ts[8] = ts[1];
-       if(i/moveno > 150) {
-               if(depth > 1)
-                       goto decr;
-               goto loop;
-       }
-       if(depth==3 && t>180)
-               goto decr;
-       if(depth==1 && t<60)
-               goto incr;
-       if(game==3 && t<60 && depth==2)
-               goto incr;
-       goto loop;
-
-incr:
-       depth++;
-       goto loop;
-
-decr:
-       goto loop;
-}
-
-move()
-{
-       int a, *p, *p1;
-
-loop:
-       lmp = done();
-       a = manual();
-       p = done();
-       p1 = p;
-       while(p1 != lmp) {
-               p1++;
-               if(*p1++ == a) {
-                       lmp = p;
-                       makmov(a);
-                       return;
-               }
-       }
-       printf("Illegal move\n");
-       lmp = p;
-       goto loop;
-}
-
-manual()
-{
-       int a, b, c;
-       char *p1;
-       extern out1;
-
-loop:
-       intrp = 0;
-       stage();
-       rline();
-       sbufp = sbuf;
-       if(match("save")) {
-               save();
-               goto loop;
-       }
-       if(match("test")) {
-               testf = !testf;
-               goto loop;
-       }
-       if(match("remove")) {
-               if(amp[-1] != -1) {
-                       decrem();
-                       mantom? bremove(): wremove();
-               }
-               if(amp[-1] != -1) {
-                       decrem();
-                       mantom? bremove(): wremove();
-               }
-               goto loop;
-       }
-       if(match("exit"))
-               exit();
-       if(match("manual")) {
-               manflg = !manflg;
-               goto loop;
-       }
-       if(match("resign"))
-               onhup();
-       if(moveno == 1 && mantom == 0) {
-               if(match("first"))
-                       play(1);
-               if(match("alg")) {
-                       mfmt = 1;
-                       goto loop;
-               }
-               if(match("restore")) {
-                       restore();
-                       goto loop;
-               }
-       }
-       if(match("clock")) {
-               clktim[mantom] =+ clock();
-               ctime("white", clktim[0]);
-               ctime("black", clktim[1]);
-               goto loop;
-       }
-       if(match("score")) {
-               score();
-               goto loop;
-       }
-       if(match("setup")) {
-               setup();
-               goto loop;
-       }
-       if(match("hint")) {
-               a = xplay();
-               out(abmove);
-               printf(" %d\n", a);
-               goto loop;
-       }
-       if(match("repeat")) {
-               if(amp[-1] != -1) {
-                       a = amp;
-                       mantom? wremove(): bremove();
-                       decrem();
-                       posit(&out1, a);
-               }
-               goto loop;
-       }
-       if(*sbufp == '\0') {
-               pboard();
-               goto loop;
-       }
-       if((a=algin()) != 0) {
-               mfmt = 1;
-               return(a);
-       }
-       if((a=stdin()) != 0) {
-               mfmt = 0;
-               return(a);
-       }
-       printf("eh?\n");
-       goto loop;
-}
-
-algin()
-{
-       int from, to;
-
-       from = cooin();
-       to = cooin();
-       if(*sbufp != '\0') return(0);
-       return((from<<8)|to);
-}
-
-cooin()
-{
-       int a, b;
-
-       a = sbufp[0];
-       if(a<'a' || a>'h') return(0);
-       b = sbufp[1];
-       if(b<'1' || b>'8') return(0);
-       sbufp =+ 2;
-       a = (a-'a')+8*('8'-b);
-       return(a);
-}
-
-match(s)
-char *s;
-{
-       char *p1;
-       int c;
-
-       p1 = sbufp;
-       while((c = *s++) != '\0')
-               if(*p1++ != c) return(0);
-       sbufp = p1;
-       return(1);
-}
-
-done()
-{
-       int *p;
-
-       if(rept() > 3) {
-               printf("Draw by repetition\n");
-               onhup();
-       }
-       p = lmp;
-       mantom? bagen(): wagen();
-       if(p == lmp) {
-               if(check())
-                       if(mantom)
-                               printf("White wins\n"); else
-                               printf("Black wins\n"); else
-               printf("Stale mate\n");
-               onhup();
-       }
-       return(p);
-}
-
-xplay()
-{
-       int a;
-
-       stage();
-       abmove = 0;
-       a = mantom? bplay(): wplay();
-       ivalue = a;
-       return(a);
-}
-
-term()
-{
-
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/qsort.s b/.ref-Research-V7/usr/src/games/chess/qsort.s
deleted file mode 100644 (file)
index 8a6a79c..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/ qsort interfact to c
-
-/      qsort(from, to)
-
-.globl _qsort
-_qsort:
-       mov     2(sp),r1
-       mov     4(sp),r2
-       jsr     pc,qsort
-       rts     pc
-
-
-qsort:
-       mov     r2,r3
-       sub     r1,r3
-       cmp     r3,$4
-       ble     done
-       asr     r3
-       bic     $3,r3
-       add     r1,r3
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-
-loop:
-       cmp     r1,r3
-       bhis    loop1
-       cmp     (r1),(r3)
-       bgt     loop1
-       add     $4,r1
-       br      loop
-
-loop1:
-       cmp     r2,r3
-       blos    1f
-       sub     $4,r2
-       mov     r2,r0
-       cmp     (r0),(r3)
-       bge     loop1
-
-       mov     (r1),r0
-       mov     (r2),(r1)+
-       mov     r0,(r2)+
-       mov     (r1),r0
-       mov     (r2),(r1)
-       mov     r0,(r2)
-       cmp     -(r1),-(r2)
-       cmp     r1,r3
-       bne     loop
-       mov     r2,r3
-       br      loop
-
-1:
-       cmp     r1,r3
-       beq     1f
-       mov     (r1),r0
-       mov     (r2),(r1)+
-       mov     r0,(r2)+
-       mov     (r1),r0
-       mov     (r2),(r1)
-       mov     r0,(r2)
-       cmp     -(r1),-(r2)
-       mov     r1,r3
-       br      loop1
-
-1:
-       mov     (sp)+,r2
-       mov     r3,-(sp)
-       mov     r3,r1
-       add     $4,r1
-       jsr     pc,qsort
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       br      qsort
-
-done:
-       rts     pc
-
-       rti = 2
-
-/      itinit()
-
-.globl _itinit
-.globl _intrp, _term
-signal = 48.
-time = 13.
-
-_itinit:
-       sys     signal; 1; 1
-       bit     $1,r0
-       bne     1f
-       sys     signal; 1; _onhup
-1:
-       sys     signal; 2; 1
-       bit     $1,r0
-       bne     1f
-       sys     signal; 2; onint
-1:
-       sys     signal; 3; 1
-       rts     pc
-
-.globl _onhup
-_onhup:
-       sys     signal; 1; 1
-       sys     signal; 2; 1
-       sys     signal; 3; 1
-       jmp     _term
-
-onint:
-       mov     r0,-(sp)
-       sys     signal; 2; onint
-       inc     _intrp
-       mov     (sp)+,r0
-       rti
-
-/      t = clock()
-
-.globl _clock
-_clock:
-       sys     time
-       mov     r0,-(sp)
-       mov     r1,-(sp)
-       sub     t+2,r1
-       sbc     r0
-       sub     t,r0
-       mov     r1,r0
-       mov     (sp)+,t+2
-       mov     (sp)+,t
-       rts     pc
-
-.bss
-t:     .=.+4
diff --git a/.ref-Research-V7/usr/src/games/chess/savres.c b/.ref-Research-V7/usr/src/games/chess/savres.c
deleted file mode 100644 (file)
index 1f2d975..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "old.h"
-
-save()
-{
-       int i;
-       int f;
-
-       f = creat("chess.out", 0666);
-       if(f < 0) {
-               printf("cannot create file\n");
-               return;
-       }
-       write(f, clktim, 4);
-       write(f, &bookp, 2);
-       write(f, &moveno, 2);
-       write(f, &game, 2);
-       i = amp-ambuf;
-       write(f, &i, 2);
-       write(f, &mantom, 2);
-       write(f, &value, 2);
-       write(f, &ivalue, 2);
-       write(f, &depth, 2);
-       write(f, &flag, 2);
-       write(f, &eppos, 2);
-       write(f, &bkpos, 2);
-       write(f, &wkpos, 2);
-       write(f, board, 128);
-       write(f, ambuf, i*2);
-       close(f);
-}
-
-restore()
-{
-       int i;
-       int f;
-
-       f = open("chess.out", 0);
-       if(f < 0) {
-               printf("cannot open file\n");
-               return;
-       }
-       read(f, clktim, 4);
-       read(f, &bookp, 2);
-       read(f, &moveno, 2);
-       read(f, &game, 2);
-       read(f, &i, 2);
-       amp = ambuf+i;
-       read(f, &mantom, 2);
-       read(f, &value, 2);
-       read(f, &ivalue, 2);
-       read(f, &depth, 2);
-       read(f, &flag, 2);
-       read(f, &eppos, 2);
-       read(f, &bkpos, 2);
-       read(f, &wkpos, 2);
-       read(f, board, 128);
-       read(f, ambuf, i*2);
-       close(f);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/setup.c b/.ref-Research-V7/usr/src/games/chess/setup.c
deleted file mode 100644 (file)
index b7a280d..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#include "old.h"
-
-setup()
-{
-       char bd[64];
-       char *p, *ip;
-       int i, err, nkng, c;
-       int wkp, bkp;
-
-       for(p=bd; p<bd+64; )
-               *p++ = 0;
-       err = 0;
-       nkng = 101;
-       p = bd;
-       for(i=0; i<8; i++) {
-               ip = p+8;
-
-       loop:
-               switch(c = getchar()) {
-
-               case 'K':
-                       nkng =- 100;
-                       c = 6;
-                       bkp = p-bd;
-                       break;
-
-               case 'k':
-                       nkng--;
-                       c = -6;
-                       wkp = p-bd;
-                       break;
-
-               case 'P':
-                       c = 1;
-                       break;
-
-               case 'p':
-                       c = -1;
-                       break;
-
-               case 'N':
-                       c = 2;
-                       break;
-
-               case 'n':
-                       c = -2;
-                       break;
-
-               case 'B':
-                       c = 3;
-                       break;
-
-               case 'b':
-                       c = -3;
-                       break;
-
-               case 'R':
-                       c = 4;
-                       break;
-
-               case 'r':
-                       c = -4;
-                       break;
-
-               case 'Q':
-                       c = 5;
-                       break;
-
-               case 'q':
-                       c = -5;
-                       break;
-
-               case '1':
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-                       p =+ c-'0';
-                       goto loop;
-
-               case ' ':
-                       p++;
-                       goto loop;
-
-               case '\n':
-                       if(p > ip)
-                               err++;
-                       p = ip;
-                       continue;
-
-               default:
-                       err++;
-                       if(c <= 0)
-                               onhup();
-                       goto loop;
-               }
-               if(p < ip)
-                       *p++ = c;
-               goto loop;
-       }
-       if(nkng)
-               err++;
-       if(err) {
-               printf("Illegal setup\n");
-               return;
-       }
-       for(i=0; i<64; i++)
-               board[i] = bd[i];
-       amp = ambuf+1;
-       lmp = lmbuf+1;
-       eppos = 64;
-       bookp = 0;
-       mantom = 0;
-       moveno = 1;
-       wkpos = wkp;
-       bkpos = bkp;
-       flag = 0;
-       if(wkpos == 60) {
-               if(board[56] == -4)
-                       flag =| 2;
-               if(board[63] == -4)
-                       flag =| 1;
-       }
-       if(bkpos == 4) {
-               if(board[0] == 4)
-                       flag =| 020;
-               if(board[7] == 4)
-                       flag =| 010;
-       }
-       printf("Setup successful\n");
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/stat.c b/.ref-Research-V7/usr/src/games/chess/stat.c
deleted file mode 100644 (file)
index dc62932..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#include "old.h"
-
-statl()
-{
-       int *p1, *p2, *p3;
-
-       p1 = p2 = lmp;
-       stage();
-       mantom? bagen(): wagen();
-       if(lmp == p1+1)
-               return(p1);
-       while(p2 != lmp) {
-               p3 = p2++;
-               if(mantom) {
-                       bmove(*p2++);
-                       *p3 = bstatic(0);
-                       bremove();
-               } else {
-                       wmove(*p2++);
-                       *p3 = wstatic(0);
-                       wremove();
-               }
-       }
-       qsort(p1, lmp);
-       return(p1);
-}
-
-wstatic(f)
-{
-       int i, j, h, (*p)();
-
-       h = i = 0;
-       while(p = wheur[h++]) {
-               j = (*p)();
-               if(f)
-                       printf("%4d ", j);
-               i =+ j;
-       }
-       if(f)
-               printf("=%4d ", i);
-       return(-i);
-}
-
-bstatic(f)
-{
-       int i, j, h, (*p)();
-
-       h = i = 0;
-       while(p = bheur[h++]) {
-               j = (*p)();
-               if(f)
-                       printf("%4d ", j);
-               i =+ j;
-       }
-       if(f)
-               printf("=%4d ", i);
-       return(-i);
-}
-
-xheur(ploc)
-int ploc;
-{
-       int *p1, *p2, from, to, pie;
-
-       pie = board[ploc];
-       p1 = lmp;
-       p2 = p1;
-       mantom? wgen(): bgen();
-       while(p2 != lmp) {
-               p2++;
-               to = *p2++ & 0377;
-               if(to == ploc) {
-                       from = p2[-1] >> 8;
-                       if(abs(board[from]) < abs(pie)) {
-                               lmp = p1;
-                               return((pval+6)[pie]/60);
-                       }
-               }
-       }
-       lmp = p1;
-       return(0);
-}
-
-srnd(p)
-int p;
-{
-
-       srnd1(p, uleft, -9);
-       srnd1(p, uright, -7);
-       srnd1(p, dleft, 7);
-       srnd1(p, dright, 9);
-       srnd1(p, up, -8);
-       srnd1(p, left, -1);
-       srnd1(p, right, 1);
-       srnd1(p, down, 8);
-       srnd1(p, 0, 0);
-}
-
-srnd1(p, m, o)
-int p, m, o;
-{
-
-       if((dir[p]&m) == 0)
-               control[p+o] =+ 10;
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/stdin.c b/.ref-Research-V7/usr/src/games/chess/stdin.c
deleted file mode 100644 (file)
index a57df4d..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-#include "old.h"
-
-stdin()
-{
-       int piece1, piece2, side1, side2, rnk1, rnk2, file1, file2;
-       int ckf, c, m, *p1, *p2, to, amb, piece;
-
-       piece1 = piece2 = side1 = side2 = -1;
-       rnk1 = rnk2 = file1 = file2  = -1;
-       ckf = 0;
-       if(match("o-o-o")||match("ooo")) {
-               piece1 = 6;
-               file1 = 3;
-               side1 = 1;
-               file2 = 2;
-               side2 = 0;
-               goto search;
-       }
-       if(match("o-o")||match("oo")) {
-               piece1 = 6;
-               file1 = 3;
-               file2 = 1;
-               goto search;
-       }
-       stdpin(&piece1, &side1, &rnk1, &file1);
-       c = *sbufp++;
-       if(c=='*' || c=='x')
-               stdpin(&piece2, &side2, &rnk2, &file2); else
-       if(c == '-')
-               stdbin(&side2, &rnk2, &file2); else
-               sbufp--;
-
-search:
-       c = *sbufp++;
-       if(c == '+') {
-               ckf = 1;
-               c = *sbufp++;
-       }
-       if(c != '\0')
-               return(0);
-
-       p1 = p2 = lmp;
-       mantom? bagen(): wagen();
-       m = -1;
-       amb = 0;
-       while(p1 != lmp) {
-               p1++;
-               piece = board[*p1>>8];
-               mantom? bmove(*p1): wmove(*p1);
-               to = amp[-3];
-               if(pcomp(piece, amp[-4],
-                       piece1, side1, rnk1, file1))
-               if(pcomp(amp[-2], to,
-                       piece2, side2, rnk2, file2))
-               if(comp(ckf, check())) {
-                       if(m >= 0) {
-                               if(!amb) {
-                                       printf("ambiguous\n");
-                                       amb = 1;
-                               }
-                       }
-                       m = *p1;
-               }
-               p1++;
-               mantom? bremove(): wremove();
-       }
-       lmp = p2;
-       if(amb) return(-1);
-       return(m);
-}
-
-stdpin(ap, as, ar, af)
-int *ap, *as, *ar, *af;
-{
-       int c;
-
-       c = *sbufp++;
-       if(c == 'q') {
-               *as = 0;
-               stdpin(ap, as, ar, af);
-               return;
-       }
-       if(c == 'k') {
-               *as = 1;
-               stdpin(ap, as, ar, af);
-               return;
-       }
-       if(c == 'p') {
-               *ap = 1;
-               if(*as >= 0)
-                       *af = 3;
-               goto loc;
-       }
-       if(c == 'n') {
-               *ap = 2;
-               goto pie;
-       }
-       if(c == 'b') {
-               *ap = 3;
-               goto pie;
-       }
-       if(c == 'r') {
-               *ap = 4;
-               goto pie;
-       }
-       sbufp--;
-       goto loc;
-
-pie:
-       if(*sbufp == 'p') {
-               *af = (*ap-1)%3;
-               *ap = 1;
-               sbufp++;
-       }
-
-loc:
-       if(*ap<0 && *as>=0) {
-               *ap = *as+5;
-               *as = -1;
-       }
-       if(*sbufp == '/') {
-               sbufp++;
-               stdbin(as, ar, af);
-       }
-}
-
-stdbin(as, ar, af)
-int *as, *ar, *af;
-{
-       int c;
-
-loop:
-       c = *sbufp++;
-       if(c == 'q') {
-               *as = 0;
-               goto kq;
-       }
-       if(c == 'k') {
-               *as = 1;
-       kq:
-               stdbin(as, ar, af);
-               if(*af < 0)
-                       *af = 3;
-               return;
-       }
-
-       if(c == 'r') {
-               *af = 0;
-               goto loop;
-       }
-       if(c == 'n') {
-               *af = 1;
-               goto loop;
-       }
-       if(c == 'b') {
-               *af = 2;
-               goto loop;
-       }
-       if(c>'0' && c<'9')
-               *ar = c-'1'; else
-               sbufp--;
-}
-
-pcomp(p, l, pp, sp, rp, fp)
-int p, l, pp, sp, rp, fp;
-{
-       int r, f, s;
-
-       f = l%8;
-       r = l/8;
-       if(!mantom)
-               r = 7-r;
-       if(f > 3) {
-               f = 7-f;
-               s = 1;
-       } else
-               s = 0;
-
-       if(comp(pp, p))
-       if(comp(sp, s))
-       if(comp(rp, r))
-       if(comp(fp, f))
-               return(1);
-       return(0);
-}
-
-comp(p, v)
-int p, v;
-{
-
-       if(p < 0) return(1);
-       return(p == abs(v));
-}
-
-abs(x)
-int x;
-{
-
-       if(x < 0)
-               return(-x);
-       return(x);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/wgen.s b/.ref-Research-V7/usr/src/games/chess/wgen.s
deleted file mode 100644 (file)
index 461a376..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/ generate moves
-
-.globl _wgen
-
-.globl _pval, _board, _dir
-.globl _flag, _lmp, _wkpos
-.globl _eppos
-.globl _value
-
-uleft  = 04040
-uright = 04004
-dleft  = 00440
-dright = 00404
-left   = 00040
-right  = 00004
-up     = 04000
-down   = 00400
-u2r1   = 06004
-u1r2   = 04006
-d1r2   = 00406
-d2r1   = 00604
-d2l1   = 00640
-d1l2   = 00460
-u1l2   = 04060
-u2l1   = 06040
-rank2  = 00200
-rank7  = 02000
-
-_wgen:
-       mov     $_dir+126.,r4
-       mov     $_board+126.,r3
-       mov     _lmp,r2
-       mov     $63.,r1
-0:
-       mov     (r3),r0
-       bge     1f
-       asl     r0
-       jmp     *2f(r0)
-
-       king
-       queen
-       rook
-       bishop
-       knight
-       pawn
-2:
-
-pawn:
-       bit     $uleft,(r4)
-       bne     2f
-       tst     -2*9.(r3)
-       ble     3f
-       jsr     r5,wtry; 0; -9.*2
-3:
-       mov     r1,r0
-       sub     $9,r0
-       cmp     r0,_eppos
-       bne     2f
-       jsr     r5,wtry; 0; -1*2
-2:
-       bit     $uright,(r4)
-       bne     2f
-       tst     -7.*2(r3)
-       ble     3f
-       jsr     r5,wtry; 0; -7.*2
-3:
-       mov     r1,r0
-       sub     $7,r0
-       cmp     r0,_eppos
-       bne     2f
-       jsr     r5,wtry; 0; 2*1
-2:
-       tst     -2*8.(r3)
-       bne     1f
-       jsr     r5,wtry; 0; -2*8.
-       bit     $rank2,(r4)
-       beq     1f
-       tst     -2*16.(r3)
-       bne     1f
-       jsr     r5,wtry; 0; -16.*2
-       br      1f
-
-knight:
-       jsr     r5,wtry; u2r1; -15.*2
-       jsr     r5,wtry; u1r2; -6.*2
-       jsr     r5,wtry; d1r2; 10.*2
-       jsr     r5,wtry; d2r1; 17.*2
-       jsr     r5,wtry; d2l1; 15.*2
-       jsr     r5,wtry; d1l2; 6.*2
-       jsr     r5,wtry; u1l2; -10.*2
-       jsr     r5,wtry; u2l1; -17.*2
-       br      1f
-
-
-1:
-       cmp     -(r4),-(r3)
-       dec     r1
-       bpl     0b
-       mov     r2,_lmp
-       rts     pc
-
-bishop:
-       jsr     r5,wslide; uleft; -9.*2
-       jsr     r5,wslide; uright; -7.*2
-       jsr     r5,wslide; dleft; 7.*2
-       jsr     r5,wslide; dright; 9.*2
-       br      1b
-
-rook:
-       jsr     r5,wslide; up; -8.*2
-       jsr     r5,wslide; down; 8.*2
-       jsr     r5,wslide; left; -1.*2.
-       jsr     r5,wslide; right; 1.*2
-       br      1b
-queen:
-       jsr     r5,wslide; uleft; -9.*2
-       jsr     r5,wslide; uright; -7.*2
-       jsr     r5,wslide; dleft; 7.*2
-       jsr     r5,wslide; dright; 9.*2
-       jsr     r5,wslide; up; -8.*2
-       jsr     r5,wslide; left; -1.*2
-       jsr     r5,wslide; right; 1.*2
-       jsr     r5,wslide; down; 8.*2
-       br      1b
-
-king:
-       jsr     r5,wtry; uleft; -9.*2
-       jsr     r5,wtry; uright; -7.*2
-       jsr     r5,wtry; dleft; 7.*2
-       jsr     r5,wtry; dright; 9.*2
-       jsr     r5,wtry; up; -8.*2
-       jsr     r5,wtry; left; -1.*2
-       jsr     r5,wtry; right; 1.*2
-       jsr     r5,wtry; down; 8.*2
-       br      1b
-
-wtry:
-       bit     (r5)+,(r4)
-       bne     1f
-       mov     r3,r0
-       add     (r5),r0
-       mov     (r0),r0
-       blt     1f
-       asl     r0
-       mov     _value,(r2)
-       sub     _pval+12.(r0),(r2)+
-       mov     (r5)+,r0
-       asr     r0
-       add     r1,r0
-       movb    r0,(r2)+
-       movb    r1,(r2)+
-       rts     r5
-1:
-       tst     (r5)+
-       rts     r5
-
-wslide:
-       mov     r4,-(sp)
-       mov     r3,-(sp)
-1:
-       bit     (r5)+,(r4)
-       bne     1f
-       add     (r5),r3
-       add     (r5),r4
-       mov     (r3),r0
-       blt     1f
-       bgt     2f
-       mov     _value,(r2)+
-       mov     r3,r0
-       sub     $_board,r0
-       asr     r0
-       movb    r0,(r2)+
-       movb    r1,(r2)+
-       tst     -(r5)
-       br      1b
-2:
-       asl     r0
-       mov     _value,(r2)
-       sub     _pval+12.(r0),(r2)+
-       mov     r3,r0
-       sub     $_board,r0
-       asr     r0
-       movb    r0,(r2)+
-       movb    r1,(r2)+
-1:
-       tst     (r5)+
-       mov     (sp)+,r3
-       mov     (sp)+,r4
-       rts     r5
diff --git a/.ref-Research-V7/usr/src/games/chess/wheur.c b/.ref-Research-V7/usr/src/games/chess/wheur.c
deleted file mode 100644 (file)
index 95fb643..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-#include "old.h"
-
-/*
- *     mobility
- *     1 for each potential move
- */
-
-wheur1()
-{
-       int *p1, *p2, *p3, i;
-       int pto;
-
-       if(amp[-2]) {
-               i = amp[-3];
-               pto = board[i];
-               board[i] = 0;
-       }
-       p1 = lmp;
-       wgen();
-       p2 = lmp;
-       lmp = p1;
-       bgen();
-       p3 = lmp;
-       lmp = p1;
-       i = p2-p3;
-       i =>> 1;
-       if(amp[-2])
-               board[amp[-3]] = pto;
-       return(i);
-}
-
-/*
- *     opening 'goodies'
- */
-
-wheur2()
-{
-       int i;
-
-       i = 0;
-       if(game > 2) return(i);
-       /*
-        * minor pieces out
-        * knights before bishops
-        */
-       i =+ 9*((board[57] != -2)+
-               (board[62] != -2));
-       i =+ 8*((board[58] != -3)+
-               (board[61] != -3));
-       /*
-        * blocked central pawns
-        */
-       if(board[51] == -1 && board[51-8]!=0) i =- 10;
-       if(board[52] == -1 && board[52-8]!=0) i =- 10;
-       return(i);
-}
-
-/*
- *     castle
- */
-
-wheur3()
-{
-       int i;
-
-       i = 0;
-       /*
-        * queenside ability
-        */
-       if(flag&02 && board[48]== -1 && board[49]== -1 && board[50]== -1)
-               i =+ 20;
-       /*
-        *  kingside ability
-        */
-       if(flag&01 && board[53]== -1 && board[54]== -1 && board[55]== -1)
-               i =+ 20;
-       /*
-        * if both
-        */
-       if(i == 40)
-               i = 22;
-       /*
-        * if castled,
-        * keep pawns in
-        */
-       if(wkpos==58)
-               if(board[50]== -1 && (board[48]== -1 || board[48-8]== -1) &&
-                       (board[49]== -1 || board[49-8]== -1))
-                               i =+ 40;
-       if(wkpos==62)
-               if(board[53]== -1 && (board[54]== -1 || board[54-8]== -1) &&
-                       (board[55]== -1 || board[55-8]== -1))
-                               i =+ 40;
-       return(i);
-}
-
-/*
- *     prance
- *     a percentage if the
- *     piece on the move
- *     can be driven back
- *     by a smaller piece
- */
-
-wheur4()
-{
-       int *p1, *p2, ploc, i;
-
-       if(amp[-1] != 1) return(0);
-       ploc = amp[-3];
-       if(board[ploc] == -1) return(0);
-       if(xheur(ploc)) return(0);
-       p1 = lmp;
-       p2 = p1;
-       bagen();
-       i = 0;
-       while(p2 != lmp) {
-               p2++;
-               bmove(*p2++);
-               i = xheur(ploc);
-               bremove();
-               if(i)
-                       break;
-       }
-       lmp = p1;
-       return(i);
-}
-
-/*
- *     control
- *     center control
- *             opening
- *             beginning
- *     king control
- *             middle
- *             end
- */
-
-wheur5()
-{
-       int i, j, k;
-       int s, n, d, pto;
-
-       if(amp[-2]) {
-               i = amp[-3];
-               pto = board[i];
-               board[i] = 0;
-       }
-       i = 64;
-       while(i--)
-               control[i] = 0;
-       if(game < 2) {
-               i = 64;
-               while(i--)
-                       control[i] =+ center[i];
-       }
-       if(mantom) {
-               if((flag&03)==0)
-                       srnd(wkpos);
-       } else {
-               if((flag&030)==0)
-                       srnd(bkpos);
-       }
-       i = 64;
-       s = 0;
-       while(i--) {
-               n = control[i]*100;
-               attack(i);
-               j = 0;
-               while(k = attacv[j++]) {
-                       d = (pval+6)[k];
-                       if(d < 0)
-                               s =- n/(-d); else
-                               s =+ n/d;
-               }
-       }
-       if(amp[-2])
-               board[amp[-3]] = pto;
-       return(-s);
-}
-
-/*
- * mate threat
- * minus for captures
- */
-wheur6()
-{
-       int i;
-
-       i = 0;
-       *amp++ = -1;
-       if(wattack(bkpos))
-               if(mate(2, 0))
-                       i =+ 15;
-       amp--;
-       return(i);
-}
diff --git a/.ref-Research-V7/usr/src/games/chess/wmove.s b/.ref-Research-V7/usr/src/games/chess/wmove.s
deleted file mode 100644 (file)
index 2b47dd0..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-.globl _wmove, _wremove
-.globl _board, _pval, _amp, _flag, _eppos, _value, _wkpos
-.globl _game
-
-_wmove:
-       mov     _amp,r4
-       movb    2(sp),r3                / to
-       movb    3(sp),r2                / from
-       mov     _value,(r4)+
-       mov     _flag,(r4)+
-       mov     _eppos,(r4)+
-       mov     r2,(r4)+
-       mov     r3,(r4)+
-       asl     r2                      / from as a word index
-       asl     r3                      / to as word index
-       mov     _board(r3),r0
-       mov     r0,(r4)+
-       beq     1f
-       asl     r0
-       sub     _pval+12.(r0),_value
-1:
-       mov     _board(r2),r0
-       mov     r0,_board(r3)
-       clr     _board(r2)
-       mov     $-1,_eppos
-       asl     r0
-       bge     error
-       jmp     *0f(r0)         / type of man
-       kmove
-       qmove
-       rmove
-       bmove
-       nmove
-       pmove
-0:
-error:
-       3
-
-
-pmove:
-       sub     r3,r2
-       bge     1f
-       neg     r2
-1:
-       cmp     r2,$2*1                 / ep capture
-       bne     1f
-       clr     _board(r3)
-       mov     $-1,_board-16.(r3)
-       mov     $4,(r4)+
-       mov     r4,_amp
-       rts     pc
-1:
-       cmp     r2,$2*16.               / double move
-       bne     1f
-       movb    3(sp),r2
-       sub     $8,r2
-       mov     r2,_eppos
-       br      move
-1:
-       cmp     r3,$24.*2
-       bge     move
-       sub     $25.,_value
-       cmp     r3,$16.*2
-       bge     move
-       sub     $50.,_value
-       cmp     r3,$8.*2                / queen promotion
-       bge     move
-       sub     $625.,_value
-       mov     $-5,_board(r3)
-       mov     $5,(r4)+
-       mov     r4,_amp
-       rts     pc
-
-rmove:
-       cmp     r2,$2*63.
-       bne     1f
-       bic     $1,_flag
-       br      move
-1:
-       cmp     r2,$2*56.
-       bne     move
-       bic     $2,_flag
-       br      move
-
-kmove:
-       asr     r3
-       mov     r3,_wkpos
-       bic     $3,_flag
-       cmp     r2,$2*60.
-       bne     2f
-       cmp     r3,$62.                 / kingside castle
-       bne     1f
-       dec     _value
-       mov     $-4,_board+[2*61.]
-       clr     _board+[2*63.]
-       mov     $2,(r4)+
-       mov     r4,_amp
-       rts     pc
-1:
-       cmp     r3,$58.                 / queenside castle
-       bne     2f
-       dec     _value
-       mov     $-4,_board+[2*59.]
-       clr     _board+[2*56.]
-       mov     $3,(r4)+
-       mov     r4,_amp
-       rts     pc
-2:                                     / king move
-       tst     _game
-       bne     1f
-       add     $2,_value
-1:
-       clr     (r4)+
-       mov     r4,_amp
-       rts     pc
-
-qmove:
-       tst     _game
-       bne     move
-       inc     _value
-       br      move
-
-nmove:
-bmove:
-move:
-       mov     $1,(r4)+
-       mov     r4,_amp
-       rts     pc
-
-_wremove:
-       mov     _amp,r4
-       mov     -(r4),r0
-       mov     -(r4),r1
-       mov     -(r4),r3
-       mov     -(r4),r2
-       mov     -(r4),_eppos
-       mov     -(r4),_flag
-       mov     -(r4),_value
-       mov     r4,_amp
-       asl     r2
-       asl     r3
-       mov     _board(r3),_board(r2)
-       mov     r1,_board(r3)
-       asl     r0
-       jmp     *0f(r0)
-0:
-       movek
-       movex
-       moveo
-       moveoo
-       movep
-       moveq
-
-movek:
-       asr     r2
-       mov     r2,_wkpos
-
-movex:
-       rts     pc
-
-moveo:
-       mov     $-4,_board+[2*63.]
-       clr     _board+[2*61.]
-       mov     $60.,_wkpos
-       rts     pc
-
-moveoo:
-       mov     $-4,_board+[2*56.]
-       clr     _board+[2*59.]
-       mov     $60.,_wkpos;
-       rts     pc
-
-movep:
-       mov     $-1,_board(r2)
-       clr     _board-[2*8.](r3)
-       rts     pc
-
-moveq:
-       mov     $-1,_board(r2)
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/games/chess/wplay.c b/.ref-Research-V7/usr/src/games/chess/wplay.c
deleted file mode 100644 (file)
index fce525a..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-#include "old.h"
-
-wplay()
-{
-       int v1, v2, *p1, *p2, *p3, ab;
-
-       if(value < ivalue)
-               ivalue = value;
-       ab = 0;
-       v1 = 3000;
-       ply = 0;
-       p1 = statl();
-       if(lmp == p1+2) {
-               abmove = p1[1];
-               lmp = p1;
-               return(ivalue);
-       }
-       p2 = p1;
-       mantom = !mantom;
-       while(p2 != lmp) {
-               p2++;
-               wmove(*p2);
-               if(testf) {
-                       mantom = !mantom;
-                       wstatic(1);
-                       mantom = !mantom;
-               }
-               if(rept())
-                       v2 = 0; else
-                       v2 = bplay1(v1);
-               if(v2 < v1 && !mate(3, 0)) {
-                       ab = *p2;
-                       v1 = v2;
-               }
-               wremove();
-               if(testf) {
-                       mantom = !mantom;
-                       printf("%6d ", v2);
-                       out(*p2);
-                       printf("\n");
-                       mantom = !mantom;
-               }
-               p2++;
-       }
-       if(ab == 0 && lmp != p1)
-               ab = p1[1];
-       mantom = !mantom;
-       lmp = p1;
-       abmove = ab;
-       return(v1);
-}
-
-wplay1(ab)
-int ab;
-{
-       int v1, v2, *p1, *p2;
-
-       if(ply >= depth)
-               return(wquies(ab));
-       ply++;
-       p1 = p2 = lmp;
-       wgen();
-       qsort(p1, lmp);
-       v1 = 3000;
-       while(p2 != lmp) {
-               if(intrp)
-                       goto out;
-               p2++;
-               wmove(*p2);
-               if(battack(wkpos)) {
-                       v2 = bplay1(v1);
-                       if(v2 < v1)
-                               v1 = v2;
-               }
-               wremove();
-               if(v1 <= ab)
-                       goto out;
-               p2++;
-       }
-out:
-       ply--;
-       lmp = p1;
-       if(v1 == 3000) {
-               v1--;
-               if(!check())
-                       v1 = 0;
-       }
-       return(v1);
-}
-
-wquies(ab)
-int ab;
-{
-       int *p1, *p2, *p3, v1, v2;
-
-       if(ply >= qdepth)
-               return(ivalue);
-       p1 = p2 = p3 = lmp;
-       wgen();
-       while(p2 != lmp) {
-               v1 = *p2++;
-               if(v1 != value && v1 <= ivalue+50) {
-                       *p3++ = (((pval+6)[board[*p2>>8]]/100)<<8) |
-                               (-(pval+6)[board[*p2&0377]]/100);
-                       *p3++ = *p2;
-               }
-               p2++;
-       }
-       if(p3 == p1) {
-               lmp = p1;
-               return(value);
-       }
-       ply++;
-       qsort(p1, p3);
-       lmp = p3;
-       p2 = p1;
-       v1 = value;
-       while(p2 != lmp) {
-               p2++;
-               wmove(*p2);
-               if(battack(wkpos)) {
-                       v2 = bquies(v1);
-               } else
-                       v2 = 3000;
-               if(v2 < v1)
-                       v1 = v2;
-               wremove();
-               if(v1 <= ab)
-                       goto out;
-               p2++;
-       }
-out:
-       ply--;
-       lmp = p1;
-       return(v1);
-}
diff --git a/.ref-Research-V7/usr/src/games/fish.c b/.ref-Research-V7/usr/src/games/fish.c
deleted file mode 100644 (file)
index 02ed4ba..0000000
+++ /dev/null
@@ -1,498 +0,0 @@
-# include <stdio.h>
-
-/*     Through, `my' refers to the program, `your' to the player */
-
-# define CTYPE 13
-# define CTSIZ (CTYPE+1)
-# define DECK 52
-# define NOMORE 0
-# define DOUBTIT (-1);
-
-typedef char HAND[CTSIZ];
-
-/* data structures */
-
-short debug;
-
-HAND myhand;
-HAND yourhand;
-char deck[DECK];
-short nextcd;
-int proflag;
-
-/* utility and output programs */
-
-shuffle(){
-       /* shuffle the deck, and reset nextcd */
-       /* uses the random number generator `rand' in the C library */
-       /* assumes that `srand' has already been called */
-
-       register i;
-
-       for( i=0; i<DECK; ++i ) deck[i] = (i%13)+1;  /* seed the deck */
-
-       for( i=DECK; i>0; --i ){ /* select the next card at random */
-               deck[i-1] = choose( deck, i );
-               }
-
-       nextcd = 0;
-       }
-
-choose( a, n ) char a[]; {
-       /* pick and return one at random from the n choices in a */
-       /* The last one is moved to replace the one chosen */
-       register j, t;
-
-       if( n <= 0 ) error( "null choice" );
-
-       j = rand() % n;
-       t = a[j];
-       a[j] = a[n-1];
-       return(t);
-       }
-
-draw() {
-       if( nextcd >= DECK ) return( NOMORE );
-       return( deck[nextcd++] );
-       }
-
-error( s ) char *s; {
-       fprintf( stderr, "error: " );
-       fprintf( stderr, s );
-       exit( 1 );
-       }
-
-empty( h ) HAND h; {
-       register i;
-
-       for( i=1; i<=CTYPE; ++i ){
-               if( h[i] != 0 && h[i] != 4 ) return( 0 );
-               }
-       return( i );
-       }
-
-mark( cd, hand ) HAND hand; {
-       if( cd != NOMORE ){
-               ++hand[cd];
-               if( hand[cd] > 4 ){
-                       error( "mark overflow" );
-                       }
-               }
-       return( cd );
-       }
-
-deal( hand, n ) HAND hand; {
-       while( n-- ){
-               if( mark( hand, draw() ) == NOMORE ) error( "deck exhausted" );
-               }
-       }
-
-char *cname[] {
-       "NOMORE!!!",
-       "A",
-       "2",
-       "3",
-       "4",
-       "5",
-       "6",
-       "7",
-       "8",
-       "9",
-       "10",
-       "J",
-       "Q",
-       "K",
-       };
-
-stats(){
-       register i, ct, b;
-
-       if( proflag ) printf( "Pro level\n" );
-       b = ct = 0;
-
-       for( i=1; i<=CTYPE; ++i ){
-               if( myhand[i] == 4 ) ++b;
-               else ct += myhand[i];
-               }
-
-       if( b ){
-               printf( "My books: " );
-               for( i=1; i<=CTYPE; ++i ){
-                       if( myhand[i] == 4 ) printf( "%s ", cname[i] );
-                       }
-               printf( "\n" );
-               }
-
-       printf( "%d cards in my hand, %d in the pool\n", ct, DECK-nextcd );
-       printf( "You ask me for: " );
-       }
-
-phand( h ) HAND h; {
-       register i, j;
-
-       j = 0;
-
-       for( i = 1; i<= CTYPE; ++i ){
-               if( h[i] == 4 ) {
-                       ++j;
-                       continue;
-                       }
-               if( h[i] ){
-                       register k;
-                       k = h[i];
-                       while( k-- ) printf( "%s ", cname[i] );
-                       }
-               }
-
-       if( j ){
-               printf( "+ Books of " );
-               for( i=1; i<=CTYPE; ++i ){
-                       if( h[i] == 4 ) printf( "%s ", cname[i] );
-                       }
-               }
-
-       printf( "\n" );
-       }
-
-main( argc, argv ) char * argv[]; { 
-       /* initialize shuffling, ask for instructions, play game, die */
-       register c;
-
-       if( argc > 1 && argv[1][0] == '-' ){
-               while( argv[1][0] == '-' ) { ++argv[1]; ++debug; }
-               argv++;
-               argc--;
-               }
-
-       srand( getpid() );
-
-       printf( "instructions?\n" );
-       if( (c=getchar()) != '\n' ){
-               if( c != 'n' ) instruct();
-               while( getchar() != '\n' );
-               }
-
-       game();
-       }
-
-/*     print instructions */
-
-char *inst[] {
-       "`Go Fish' is a childrens' card game.",
-       "The Object is to accumulate `books' of 4 cards",
-       "with the same face value.",
-       "The players alternate turns; each turn begins with one",
-       "player selecting a card from his hand, and asking the",
-       "other player for all cards of that face value.",
-       "If the other player has one or more cards of that face value",
-       "in his hand, he gives them to the first player, and the",
-       "first player makes another request.",
-       "Eventually, the first player asks for a card which",
-       "is not in the second player's hand: he replies `GO FISH!'",
-       "The first player then draws a card from the `pool' of",
-       "undealt cards.  If this is the card he had last requested, he",
-       "draws again.",
-       "When a book is made, either through drawing or requesting,",
-       "the cards are laid down and no further action takes",
-       "place with that face value.",
-       "To play the computer, simply make guesses by typing",
-       "a, 2, 3, 4, 5, 6, 7, 8, 9, 10, j, q, or k when asked.",
-       "Hitting return gives you information about the size of",
-       "my hand and the pool, and tells you about my books.",
-       "Saying `p' as a first guess puts you into `pro' level;",
-       "The default is pretty dumb!",
-       "Good Luck!",
-       "",
-       };
-
-instruct(){
-       register char **cpp;
-
-       printf( "\n" );
-
-       for( cpp = inst; **cpp != '\0'; ++cpp ){
-               printf( "%s\n", *cpp );
-               }
-       }
-
-game(){
-
-       shuffle();
-
-       deal( myhand, 7 );
-       deal( yourhand, 7 );
-
-       start( myhand );
-
-       for(;;){
-
-               register g;
-
-
-               /* you make repeated guesses */
-
-               for(;;) {
-                       printf( "your hand is: " );
-                       phand( yourhand );
-                       printf( "you ask me for: " );
-                       if( !move( yourhand, myhand, g=guess(), 0 ) ) break;
-                       printf( "Guess again\n" );
-                       }
-
-               /* I make repeated guesses */
-
-               for(;;) {
-                       if( (g=myguess()) != NOMORE ){
-                               printf( "I ask you for: %s\n", cname[g] );
-                               }
-                       if( !move( myhand, yourhand, g, 1 ) ) break;
-                       printf( "I get another guess\n" );
-                       }
-               }
-       }
-
-/*     reflect the effect of a move on the hands */
-
-move( hs, ht, g, v ) HAND hs, ht; {
-       /* hand hs has made a guess, g, directed towards ht */
-       /* v on indicates that the guess was made by the machine */
-       register d;
-       char *sp, *tp;
-
-       sp = tp = "I";
-       if( v ) tp = "You";
-       else sp = "You";
-
-       if( g == NOMORE ){
-               d = draw();
-               if( d == NOMORE ) score();
-               else {
-
-                       printf( "Empty Hand\n" );
-                       if( !v ) printf( "You draw %s\n", cname[d] );
-                       mark( hs, d );
-                       }
-               return( 0 );
-               }
-
-       if( !v ) heguessed( g );
-
-       if( hs[g] == 0 ){
-               if( v ) error( "Rotten Guess" );
-               printf( "You don't have any %s's\n", cname[g] );
-               return(1);
-               }
-
-       if( ht[g] ){ /* successful guess */
-               printf( "%s have %d %s%s\n", tp, ht[g], cname[g], ht[g]>1?"'s":"" );
-               hs[g] += ht[g];
-               ht[g] = 0;
-               if( hs[g] == 4 ) madebook(g);
-               return(1);
-               }
-
-       /* GO FISH! */
-
-       printf( "%s say \"GO FISH!\"\n", tp );
-
-       newdraw:
-       d = draw();
-       if( d == NOMORE ) {
-               printf( "No more cards\n" );
-               return(0);
-               }
-       mark( hs, d );
-       if( !v ) printf( "You draw %s\n", cname[d] );
-       if( hs[d] == 4 ) madebook(d);
-       if( d == g ){
-               printf( "%s drew the guess, so draw again\n", sp );
-               if( !v ) hedrew( d );
-               goto newdraw;
-               }
-       return( 0 );
-       }
-
-madebook( x ){
-       printf( "Made a book of %s's\n", cname[x] );
-       }
-
-score(){
-       register my, your, i;
-
-       my = your = 0;
-
-       printf( "The game is over.\nMy books: " );
-
-       for( i=1; i<=CTYPE;++i ){
-               if( myhand[i] == 4 ){
-                       ++my;
-                       printf( "%s ", cname[i] );
-                       }
-               }
-
-       printf( "\nYour books: " );
-
-       for( i=1; i<=CTYPE;++i ){
-               if( yourhand[i] == 4 ){
-                       ++your;
-                       printf( "%s ", cname[i] );
-                       }
-               }
-
-       printf( "\n\nI have %d, you have %d\n", my, your );
-
-       printf( "\n%s win!!!\n", my>your?"I":"You" );
-       exit(0);
-       }
-
-# define G(x) { if(go) goto err;  else go = x; }
-
-guess(){
-       /* get the guess from the tty and return it... */
-       register g, go;
-
-       go = 0;
-
-       for(;;) {
-               switch( g = getchar() ){
-
-               case 'p':
-               case 'P':
-                       ++proflag;
-                       continue;
-
-               case '2':
-               case '3':
-               case '4':
-               case '5':
-               case '6':
-               case '7':
-               case '8':
-               case '9':
-                       G(g-'0');
-                       continue;
-
-               case 'a':
-               case 'A':
-                       G(1);
-                       continue;
-
-               case '1':
-                       G(10);
-                       continue;
-
-               case '0':
-                       if( go != 10 ) goto err;
-                       continue;
-
-               case 'J':
-               case 'j':
-                       G(11);
-                       continue;
-
-               case 'Q':
-               case 'q':
-                       G(12);
-                       continue;
-
-               case 'K':
-               case 'k':
-                       G(13);
-                       continue;
-
-               case '\n':
-                       if( empty( yourhand ) ) return( NOMORE );
-                       if( go == 0 ){
-                               stats();
-                               continue;
-                               }
-                       return( go );
-
-               case ' ':
-               case '\t':
-                       continue;
-
-               default:
-                       err:
-                       while( g != '\n' ) g = getchar();
-                       printf( "what?\n" );
-                       continue;
-                       }
-               }
-       }
-
-/*     the program's strategy appears from here to the end */
-
-char try[100];
-char ntry;
-char haveguessed[CTSIZ];
-
-char hehas[CTSIZ];
-
-start( h ) HAND h; {
-       ;
-       }
-
-hedrew( d ){
-       ++hehas[d];
-       }
-
-heguessed( d ){
-       ++hehas[d];
-       }
-
-myguess(){
-
-       register i, lg, t;
-
-       if( empty( myhand ) ) return( NOMORE );
-
-       /* make a list of those things which i have */
-       /* leave off any which are books */
-       /* if something is found that he has, guess it! */
-
-       ntry = 0;
-       for( i=1; i<=CTYPE; ++i ){
-               if( myhand[i] == 0 || myhand[i] == 4 ) continue;
-               try[ntry++] = i;
-               }
-
-       if( !proflag ) goto random;
-
-       /* get ones he has, if any */
-
-       for( i=0; i<ntry; ++i ){
-               if( hehas[try[i]] ) {
-                       i = try[i];
-                       goto gotguess;
-                       }
-               }
-
-       /* is there one that has never been guessed; if so, guess it */
-       lg = 101;
-       for( i=0; i<ntry; ++i ){
-               if( haveguessed[try[i]] < lg ) lg = haveguessed[try[i]];
-               }
-       /* remove all those not guessed longest ago */
-
-       t = 0;
-       for( i=0; i<ntry; ++i ){
-               if( haveguessed[try[i]] == lg ) try[t++] = try[i];
-               }
-       ntry = t;
-       if( t <= 0 ) error( "bad guessing loop" );
-
-       random:
-       i = choose( try, ntry );  /* make a random choice */
-
-       gotguess:  /* do bookkeeping */
-
-       hehas[i] = 0;  /* he won't anymore! */
-       for( t=1; t<=CTYPE; ++t ){
-               if( haveguessed[t] ) --haveguessed[t];
-               }
-       haveguessed[i] = 100;  /* will have guessed it */
-       return(i);
-
-       }
-
diff --git a/.ref-Research-V7/usr/src/games/fortune.c b/.ref-Research-V7/usr/src/games/fortune.c
deleted file mode 100644 (file)
index 0e1669e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <stdio.h>
-
-char line[500];
-char bline[500];
-
-main()
-{
-       double p;
-       register char * l;
-       long t;
-       FILE *f;
-
-       f = fopen("/usr/games/lib/fortunes", "r");
-       if (f == NULL) {
-               printf("Memory fault -- core dumped\n");
-               exit(1);
-       }
-       time(&t);
-       srand(getpid() + (int)((t>>16) + t));
-       p = 1.;
-       for(;;) {
-               l = fgets(line, 500, f);
-               if(l == NULL)
-                       break;
-               if(rand() < 32768./p)
-                       strcpy(bline, line);
-               p += 1.;
-       }
-       fputs(bline, stdout);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/games/hangman.c b/.ref-Research-V7/usr/src/games/hangman.c
deleted file mode 100644 (file)
index f069bbb..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#define DICT "/usr/dict/words"
-#define EDICT "/crp/dict/web2"
-#define MAXERR 7
-#define MINSCORE 0
-#define MINLEN 7
-char *dictfile;
-int alive,lost;
-FILE *dict;
-long int dictlen;
-float errors=0, words=0;
-main(argc,argv) char **argv;
-{
-       if(argc==1) dictfile=DICT;
-       else if(*argv[1]=='-') dictfile=EDICT;
-       else dictfile=argv[1];
-       setup();
-       for(;;)
-       {       startnew();
-               while(alive>0)
-               {       stateout();
-                       getguess();
-               }
-               words=words+1;
-               if(lost) wordout();
-               else youwon();
-       }
-}
-setup()
-{      int tvec[2];
-       struct stat statb;
-       time(tvec);
-       srand(tvec[1]+tvec[2]);
-       if((dict=fopen(dictfile,"r"))==NULL) fatal("no dictionary");
-       if(stat(dictfile,&statb)<0) fatal("can't stat");
-       dictlen=statb.st_size;
-}
-double frand()
-{
-       return(rand()/32768.);
-}
-char word[26],alph[26],realword[26];
-startnew()
-{      int i;
-       long int pos;
-       char buf[128];
-       for(i=0;i<26;i++) word[i]=alph[i]=realword[i]=0;
-       pos=frand()*dictlen;
-       fseek(dict,pos,0);
-       fscanf(dict,"%s\n",buf);
-       getword();
-       alive=MAXERR;
-       lost=0;
-}
-stateout()
-{      int i;
-       printf("guesses: ");
-       for(i=0;i<26;i++)
-               if(alph[i]!=0) putchar(alph[i]);
-       printf(" word: %s ",word);
-       printf("errors: %d/%d\n",MAXERR-alive,MAXERR);
-}
-getguess()
-{      char gbuf[128],c;
-       int ok=0,i;
-loop:
-       printf("guess: ");
-       if(gets(gbuf)==NULL)
-       {       putchar('\n');
-               exit(0);
-       }
-       if((c=gbuf[0])<'a' || c>'z')
-       {       printf("lower case\n");
-               goto loop;
-       }
-       if(alph[c-'a']!=0)
-       {       printf("you guessed that\n");
-               goto loop;
-       }
-       else alph[c-'a']=c;
-       for(i=0;realword[i]!=0;i++)
-               if(realword[i]==c)
-               {       word[i]=c;
-                       ok=1;
-               }
-       if(ok==0)
-       {       alive--;
-               errors=errors+1;
-               if(alive<=0) lost=1;
-               return;
-       }
-       for(i=0;word[i]!=0;i++)
-               if(word[i]=='.') return;
-       alive=0;
-       lost=0;
-       return;
-}
-wordout()
-{
-       errors=errors+2;
-       printf("the answer was %s, you blew it\n",realword);
-}
-youwon()
-{
-       printf("you win, the word is %s\n",realword);
-}
-fatal(s) char *s;
-{
-       fprintf(stderr,"%s\n",s);
-       exit(1);
-}
-getword()
-{      char wbuf[128],c;
-       int i,j;
-loop:
-       if(fscanf(dict,"%s\n",wbuf)==EOF)
-       {       fseek(dict,0L,0);
-               goto loop;
-       }
-       if((c=wbuf[0])>'z' || c<'a') goto loop;
-       for(i=j=0;wbuf[j]!=0;i++,j++)
-       {       if(wbuf[j]=='-') j++;
-               wbuf[i]=wbuf[j];
-       }
-       wbuf[i]=0;
-       if(i<MINLEN) goto loop;
-       for(j=0;j<i;j++)
-               if((c=wbuf[j])<'a' || c>'z') goto loop;
-       pscore();
-       strcpy(realword,wbuf);
-       for(j=0;j<i;word[j++]='.');
-}
-long int freq[]
-{      42066,  9228,   24412,  14500,  55162,
-       6098,   11992,  12648,  48241,  639,
-       2944,   33351,  15545,  35618,  36211,
-       16033,  937,    36686,  34957,  37544,
-       17621,  5453,   3028,   1556,   12875,
-       1743
-};
-pscore()
-{
-       if(words!=0) printf("(%4.2f/%.0f) ",errors/words,words);
-}
diff --git a/.ref-Research-V7/usr/src/games/quiz.c b/.ref-Research-V7/usr/src/games/quiz.c
deleted file mode 100644 (file)
index 606d10a..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-
-#define NF 10
-#define NL 300
-#define NC 200
-#define SL 100
-#define NA 10
-
-int tflag;
-int xx[NL];
-char score[NL];
-int rights;
-int wrongs;
-int guesses;
-FILE *input;
-int nl = 0;
-int na = NA;
-int inc;
-int ptr  = 0;
-int nc = 0;
-char line[150];
-char response[100];
-char *tmp[NF];
-int select[NF];
-char   *malloc();
-
-readline()
-{
-       char *t;
-       register c;
-loop:
-       for (t=line; c=getc(input), *t=c, c!=EOF; t++) {
-               nc++;
-               if(*t==' '&&(t==line||t[-1]==' '))
-                       t--;
-               if(*t=='\n') {
-                       if(t[-1]=='\\')         /*inexact test*/
-                               continue;
-                       while(t>line&&t[-1]==' ')
-                               *--t = '\n';
-                       *++t = 0;
-                       return(1);
-               }
-               if(t-line>=NC) {
-                       printf("Too hard for me\n");
-                       do {
-                               *line = getc(input);
-                               if(*line==0377)
-                                       return(0);
-                       } while(*line!='\n');
-                       goto loop;
-               }
-       }
-       return(0);
-}
-
-char *eu;
-char *ev;
-cmp(u,v)
-char *u, *v;
-{
-       int x;
-       eu = u;
-       ev = v;
-       x = disj(1);
-       if(x!=1)
-               return(x);
-       return(eat(1,0));
-}
-
-disj(s)
-{
-       int t, x;
-       char *u;
-       u = eu;
-       t = 0;
-       for(;;) {
-               x = string(s);
-               if(x>1)
-                       return(x);
-               switch(*ev) {
-               case 0:
-               case ']':
-               case '}':
-                       return(t|x&s);
-               case '|':
-                       ev++;
-                       t |= s;
-                       s = 0;
-                       continue;
-               }
-               if(s) eu = u;
-               if(string(0)>1)
-                       return(2);
-               switch(*ev) {
-               case 0:
-               case ']':
-                       return(0);
-               case '}':
-                       return(1);
-               case '|':
-                       ev++;
-                       continue;
-               default:
-                       return(2);
-               }
-       }
-}
-
-string(s)
-{
-       int x;
-       for(;;) {
-               switch(*ev) {
-               case 0:
-               case '|':
-               case ']':
-               case '}':
-                       return(1);
-               case '\\':
-                       ev++;
-                       if(*ev==0)
-                               return(2);
-                       if(*ev=='\n') {
-                               ev++;
-                               continue;
-                       }
-               default:
-                       if(eat(s,*ev)==1)
-                               continue;
-                       return(0);
-               case '[':
-                       ev++;
-                       x = disj(s);
-                       if(*ev!=']' || x>1)
-                               return(2);
-                       ev++;
-                       if(s==0)
-                               continue;
-                       if(x==0)
-                               return(0);
-                       continue;
-               case '{':
-                       ev++;
-                       x = disj(s);
-                       if(*ev!='}'||x>1)
-                               return(2);
-                       ev++;
-                       continue;
-               }
-       }
-}
-
-eat(s,c)
-char c;
-{
-       if(*ev!=c)
-               return(2);
-       if(s==0) {
-               ev++;
-               return(1);
-       }
-       if(fold(*eu)!=fold(c))
-               return(0);
-       eu++;
-       ev++;
-       return(1);
-}
-
-fold(c)
-char c;
-{
-       if(c<'A'||c>'Z')
-               return(c);
-       return(c|040);
-}
-
-publish(t)
-char *t;
-{
-       ev = t;
-       pub1(1);
-}
-
-pub1(s)
-{
-       for(;;ev++){
-               switch(*ev) {
-               case '|':
-                       s = 0;
-                       continue;
-               case ']':
-               case '}':
-               case 0:
-                       return;
-               case '[':
-               case '{':
-                       ev++;
-                       pub1(s);
-                       continue;
-               case '\\':
-                       if(*++ev=='\n')
-                               continue;
-               default:
-                       if(s)
-                               putchar(*ev);
-               }
-       }
-}
-
-segment(u,w)
-char *u, *w[];
-{
-       char *s;
-       int i;
-       char *t;
-       s = u;
-       for(i=0;i<NF;i++) {
-               u = s;
-               t = w[i];
-               while(*s!=':'&&*s!='\n'&&s-u<SL) {
-                       if(*s=='\\')  {
-                               if(s[1] == '\n') {
-                                       s += 2;
-                                       continue;
-                               }
-                               *t++ = *s++;
-                       }
-                       *t++ = *s++;
-               }
-
-               while(*s!=':'&&*s!='\n')
-                       s++;
-               *t = 0;
-               if(*s++=='\n') {
-                       return(i+1);
-               }
-       }
-       printf("Too many facts about one thing\n");
-       return(0);
-}
-
-perm(u,m,v,n,p)
-int p[];
-char *u[], *v[];
-{
-       int i, j;
-       int x;
-       for(i=0;i<m;i++) {
-               for(j=0;j<n;j++) {
-                       x = cmp(u[i],v[j]);
-                       if(x>1) badinfo();
-                       if(x==0)
-                               continue;
-                       p[i] = j;
-                       goto uloop;
-               }
-               return(0);
-uloop:         ;
-       }
-       return(1);
-}
-
-find(u,m)
-char *u[];
-{
-       int n;
-       while(readline()){
-               n = segment(line,tmp);
-               if(perm(u,m,tmp+1,n-1,select))
-                       return(1);
-       }
-       return(0);
-}
-
-readindex()
-{
-       xx[0] = nc = 0;
-       while(readline()) {
-               xx[++nl] = nc;
-               if(nl>=NL) {
-                       printf("I've forgotten some of it;\n");
-                       printf("I remember %d items.\n", nl);
-                       break;
-               }
-       }
-}
-
-talloc()
-{
-       int i;
-       for(i=0;i<NF;i++)
-               tmp[i] = malloc(SL);
-}
-
-main(argc,argv)
-char *argv[];
-{
-       register j;
-       int i;
-       int x;
-       int z;
-       char *info;
-       long tm;
-       extern done();
-       int count;
-       info = "/usr/games/quiz.k/index";
-       time(&tm);
-       inc = (int)tm&077774|01;
-loop:
-       if(argc>1&&*argv[1]=='-') {
-               switch(argv[1][1]) {
-               case 'i':
-                       if(argc>2) 
-                               info = argv[2];
-                       argc -= 2;
-                       argv += 2;
-                       goto loop;
-               case 't':
-                       tflag = 1;
-                       argc--;
-                       argv++;
-                       goto loop;
-               }
-       }
-       input = fopen(info,"r");
-       if(input==NULL) {
-               printf("No info\n");
-               exit(0);
-       }
-       talloc();
-       if(argc<=2)
-               instruct(info);
-       signal(SIGINT, done);
-       argv[argc] = 0;
-       if(find(&argv[1],argc-1)==0)
-               dunno();
-       fclose(input);
-       input = fopen(tmp[0],"r");
-       if(input==NULL)
-               dunno();
-       readindex();
-       if(!tflag || na>nl)
-               na = nl;
-       stdout->_flag |= _IONBF;
-       for(;;) {
-               i = next();
-               fseek(input,xx[i]+0L,0);
-               z = xx[i+1]-xx[i];
-               for(j=0;j<z;j++)
-                       line[j] = getc(input);
-               segment(line,tmp);
-               if(*tmp[select[0]] == '\0' || *tmp[select[1]] == '\0') {
-                       score[i] = 1;
-                       continue;
-               }
-               publish(tmp[select[0]]);
-               printf("\n");
-               for(count=0;;count++) {
-                       if(query(response)==0) {
-                               publish(tmp[select[1]]);
-                               printf("\n");
-                               if(count==0) wrongs++;
-                               score[i] = tflag?-1:1;
-                               break;
-                       }
-                       x = cmp(response,tmp[select[1]]);
-                       if(x>1) badinfo();
-                       if(x==1) {
-                               printf("Right!\n");
-                               if(count==0) rights++;
-                               if(++score[i]>=1 && na<nl)
-                                       na++;
-                               break;
-                       }
-                       printf("What?\n");
-                       if(count==0) wrongs++;
-                       score[i] = tflag?-1:1;
-               }
-               guesses += count;
-       }
-}
-
-query(r)
-char *r;
-{
-       char *t;
-       for(t=r;;t++) {
-               if(read(0,t,1)==0)
-                       done();
-               if(*t==' '&&(t==r||t[-1]==' '))
-                       t--;
-               if(*t=='\n') {
-                       while(t>r&&t[-1]==' ')
-                               *--t = '\n';
-                       break;
-               }
-       }
-       *t = 0;
-       return(t-r);
-}
-
-next()
-{
-       int flag;
-       inc = inc*3125&077777;
-       ptr = (inc>>2)%na;
-       flag = 0;
-       while(score[ptr]>0)
-               if(++ptr>=na) {
-                       ptr = 0;
-                       if(flag) done();
-                       flag = 1;
-               }
-       return(ptr);
-}
-
-done()
-{
-       printf("\nRights %d, wrongs %d, ", rights, wrongs);
-       if(guesses)
-               printf("extra guesses %d, ", guesses);
-       printf("score %d%%\n",100*rights/(rights+wrongs));
-       exit(0);
-}
-instruct(info)
-char *info;
-{
-       int i, n;
-       printf("Subjects:\n\n");
-       while(readline()) {
-               printf("-");
-               n = segment(line,tmp);
-               for(i=1;i<n;i++) {
-                       printf(" ");
-                       publish(tmp[i]);
-               }
-               printf("\n");
-       }
-       printf("\n");
-       input = fopen(info,"r");
-       if(input==NULL)
-               abort();
-       readline();
-       segment(line,tmp);
-       printf("For example,\n");
-       printf("    quiz ");
-       publish(tmp[1]);
-       printf(" ");
-       publish(tmp[2]);
-       printf("\nasks you a ");
-       publish(tmp[1]);
-       printf(" and you answer the ");
-       publish(tmp[2]);
-       printf("\n    quiz ");
-       publish(tmp[2]);
-       printf(" ");
-       publish(tmp[1]);
-       printf("\nworks the other way around\n");
-       printf("\nType empty line to get correct answer.\n");
-       exit(0);
-}
-
-badinfo(){
-       printf("Bad info %s\n",line);
-}
-
-dunno()
-{
-       printf("I don't know about that\n");
-       exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/games/wump.c b/.ref-Research-V7/usr/src/games/wump.c
deleted file mode 100644 (file)
index 6db98bb..0000000
+++ /dev/null
@@ -1,375 +0,0 @@
-#
-
-/*
- *     wumpus
- *     stolen from PCC Vol 2 No 1
- */
-
-#define        NBAT    3
-#define        NROOM   20
-#define        NTUNN   3
-#define        NPIT    3
-
-struct room
-{
-       int     tunn[NTUNN];
-       int     flag;
-} room[NROOM];
-
-char   *intro[]
-{
-       "\n",
-       "Welcome to 'Hunt the Wumpus.'\n",
-       "\n",
-       "The Wumpus lives in a cave of %d rooms.\n",
-       "Each room has %d tunnels leading to other rooms.\n",
-       "\n",
-       "Hazards:\n",
-       "\n",
-       "Bottomless Pits - Some rooms have Bottomless Pits in them.\n",
-       "       If you go there, you fall into the pit and lose!\n",
-       "Super Bats - Some other rooms have super bats.\n",
-       "       If you go there, a bat will grab you and take you to\n",
-       "       somewhere else in the cave where you could\n",
-       "       fall into a pit or run into the . . .\n",
-       "\n",
-       "Wumpus:\n",
-       "\n",
-       "The Wumpus is not bothered by the hazards since\n",
-       "he has sucker feet and is too big for a bat to lift.\n",
-       "\n",
-       "Usually he is asleep.\n",
-       "Two things wake him up:\n",
-       "       your entering his room\n",
-       "       your shooting an arrow anywhere in the cave.\n",
-       "If the wumpus wakes, he either decides to move one room or\n",
-       "stay where he was.  But if he ends up where you are,\n",
-       "he eats you up and you lose!\n",
-       "\n",
-       "You:\n",
-       "\n",
-       "Each turn you may either move or shoot a crooked arrow.\n",
-       "\n",
-       "Moving - You can move to one of the adjoining rooms;\n",
-       "       that is, to one that has a tunnel connecting it with\n",
-       "       the room you are in.\n",
-       "\n",
-       "Shooting - You have 5 arrows.  You lose when you run out.\n",
-       "       Each arrow can go from 1 to 5 rooms.\n",
-       "       You aim by telling the computer\n",
-       "       The arrow's path is a list of room numbers\n",
-       "       telling the arrow which room to go to next.\n",
-       "       The list is terminated with a 0.\n",
-       "       The first room in the path must be connected to the\n",
-       "       room you are in.  Each succeeding room must be\n",
-       "       connected to the previous room.\n",
-       "       If there is no tunnel between two of the rooms\n",
-       "       in the arrow's path, the arrow chooses one of the\n",
-       "       three tunnels from the room it's in and goes its\n",
-       "       own way.\n",
-       "\n",
-       "       If the arrow hits the wumpus, you win!\n",
-       "       If the arrow hits you, you lose!\n",
-       "\n",
-       "Warnings:\n",
-       "\n",
-       "When you are one or two rooms away from the wumpus,\n",
-       "the computer says:\n",
-       "               'I smell a Wumpus'\n",
-       "When you are one room away from some other hazard, it says:\n",
-       "               Bat    - 'Bats nearby'\n",
-       "               Pit    - 'I feel a draft'\n",
-       "\n",
-       0,
-};
-
-#define        BAT     01
-#define        PIT     02
-#define        WUMP    04
-
-int    arrow;
-int    loc;
-int    wloc;
-int    tchar;
-
-main()
-{
-       register i, j;
-       register struct room *p;
-       int k, icomp();
-
-       printf("Instructions? (y-n) ");
-       if(rline() == 'y')
-               for(i=0; intro[i]; i++)
-                       printf(intro[i], i&1? NROOM: NTUNN);
-
-
-/*
- * initialize the room connections
- */
-
-init:
-       p = &room[0];
-       for(i=0; i<NROOM; i++) {
-               for(j=0; j<NTUNN; j++)
-                       p->tunn[j] = -1;
-               p++;
-       }
-       k = 0;
-       for(i=1; i<NROOM; ) {
-               j = rnum(NROOM);
-               p = &room[j];
-               if(j == k || p->tunn[0] >= 0 || p->tunn[1] >= 0)
-                       continue;
-               p->tunn[1] = k;
-               room[k].tunn[0] = j;
-               k = j;
-               i++;
-       }
-       p = &room[0];
-       for(i=0; i<NROOM; i++) {
-               for(j=0; j<NTUNN; j++) {
-                       if(p->tunn[j] < 0)
-                               p->tunn[j] = tunnel(i);
-                       if(p->tunn[j] == i)
-                               goto init;
-                       for(k=0; k<j; k++)
-                               if(p->tunn[j] == p->tunn[k])
-                                       goto init;
-               }
-               qsort(&p->tunn[0], NTUNN, 2, icomp);
-               p++;
-       }
-
-/*
- * put in player, wumpus,
- * pits and bats
- */
-
-setup:
-       arrow = 5;
-       p = &room[0];
-       for(i=0; i<NROOM; i++) {
-               p->flag = 0;
-               p++;
-       }
-       for(i=0; i<NPIT; ) {
-               p = &room[rnum(NROOM)];
-               if((p->flag&PIT) == 0) {
-                       p->flag =| PIT;
-                       i++;
-               }
-       }
-       for(i=0; i<NBAT; ) {
-               p = &room[rnum(NROOM)];
-               if((p->flag&(PIT|BAT)) == 0) {
-                       p->flag =| BAT;
-                       i++;
-               }
-       }
-       i = rnum(NROOM);
-       wloc = i;
-       room[i].flag =| WUMP;
-       for(;;) {
-               i = rnum(NROOM);
-               if((room[i].flag&(PIT|BAT|WUMP)) == 0) {
-                       loc = i;
-                       break;
-               }
-       }
-
-/*
- *     main loop of the game
- */
-
-loop:
-       printf("You are in room %d\n", loc+1);
-       p = &room[loc];
-       if(p->flag&PIT) {
-               printf("You fell into a pit\n");
-               goto done;
-       }
-       if(p->flag&WUMP) {
-               printf("You were eaten by the wumpus\n");
-               goto done;
-       }
-       if(p->flag&BAT) {
-               printf("Theres a bat in your room\n");
-               loc = rnum(NROOM);
-               goto loop;
-       }
-       for(i=0; i<NTUNN; i++)
-       if(near(&room[p->tunn[i]], WUMP))
-               goto nearwump;
-       if (near(p, WUMP)) {
-       nearwump:
-               printf("I smell a wumpus\n");
-       }
-       if (near(p, BAT))
-               printf("Bats nearby\n");
-       if (near(p, PIT))
-               printf("I feel a draft\n");
-       printf("There are tunnels to");
-       for(i=0; i<NTUNN; i++)
-               printf(" %d", p->tunn[i]+1);
-       printf("\n");
-
-again:
-       printf("Move or shoot (m-s) ");
-       switch(rline()) {
-       case 'm':
-               if(tchar == '\n')
-                       printf("which room? ");
-               i = rin()-1;
-               for(j=0; j<NTUNN; j++)
-                       if(i == p->tunn[j])
-                               goto groom;
-               printf("You hit the wall\n");
-               goto again;
-       groom:
-               loc = i;
-               if(i == wloc)
-                       goto mwump;
-               goto loop;
-
-       case 's':
-               if(tchar == '\n')
-                       printf("Give list of rooms terminated by 0\n");
-               for(i=0; i<5; i++) {
-                       j = rin()-1;
-                       if(j == -1)
-                               break;
-               ranarw:
-                       for(k=0; k<NTUNN; k++)
-                               if(j == p->tunn[k])
-                                       goto garow;
-                       j = rnum(NROOM);
-                       goto ranarw;
-               garow:
-                       p = &room[j];
-                       if(j == loc) {
-                               printf("You shot yourself\n");
-                               goto done;
-                       }
-                       if(p->flag&WUMP) {
-                               printf("You slew the wumpus\n");
-                               goto done;
-                       }
-               }
-               if(--arrow == 0) {
-                       printf("That was your last shot\n");
-                       goto done;
-               }
-               goto mwump;
-       }
-
-       goto again;
-
-mwump:
-       p = &room[wloc];
-       p->flag =& ~WUMP;
-       i = rnum(NTUNN+1);
-       if(i != NTUNN)
-               wloc = p->tunn[i];
-       room[wloc].flag =| WUMP;
-       goto loop;
-
-done:
-       printf("Another game? (y-n) ");
-       if(rline() == 'y') {
-               printf("Same room setup? (y-n) ");
-               if(rline() == 'y')
-                       goto setup;
-               goto init;
-       }
-}
-
-tunnel(i)
-{
-       register struct room *p;
-       register n, j;
-       int c;
-
-       c = 20;
-
-loop:
-       n = rnum(NROOM);
-       if(n == i)
-               if(--c > 0)
-                       goto loop;
-       p = &room[n];
-       for(j=0; j<NTUNN; j++)
-       if(p->tunn[j] == -1) {
-               p->tunn[j] = i;
-               return(n);
-       }
-       goto loop;
-}
-
-rline()
-{
-       register char c, r;
-
-       while((c=getchar()) == ' ');
-       r = c;
-       while(c != '\n' && c != ' ') {
-               if(c == '\0')
-                       exit();
-               c = getchar();
-       }
-       tchar = c;
-       return(r);
-}
-
-rnum(n)
-{
-       static first[2];
-
-       if(first[1] == 0) {
-               time(first);
-               srand((first[1]*first[0])^first[1]);
-       }
-       return((rand()/32768.0) * n);
-}
-
-rin()
-{
-       register n, c;
-
-       n = 0;
-       c = getchar();
-       while(c != '\n' && c != ' ') {
-               if(c<'0' || c>'9') {
-                       while(c != '\n') {
-                               if(c == 0)
-                                       exit();
-                               c = getchar();
-                       }
-                       return(0);
-               }
-               n = n*10 + c-'0';
-               c = getchar();
-       }
-       return(n);
-}
-
-near(ap, ahaz)
-struct room *ap;
-{
-       register struct room *p;
-       register haz, i;
-
-       p = ap;
-       haz = ahaz;
-       for(i=0; i<NTUNN; i++)
-       if(room[p->tunn[i]].flag & haz)
-               return (1);
-       return(0);
-}
-
-icomp(p1, p2)
-int *p1, *p2;
-{
-
-       return(*p1 - *p2);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/Makefile b/.ref-Research-V7/usr/src/libF77/Makefile
deleted file mode 100644 (file)
index 0aeed68..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# compile, then strip unnecessary symbols
-.c.o :
-       cc -O -c $<
-       -ld -r -x $*.o
-       mv a.out $*.o
-
-MISC = main.o s_rnge.o abort_.o getarg_.o iargc_.o signal_.o s_stop.o s_paus.o
-POW =  pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o  pow_ri.o pow_zi.o pow_zz.o
-CX =   c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
-DCX =  z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
-REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\
-       r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\
-       r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\
-       r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o
-DBL =  d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\
-       d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\
-       d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\
-       d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\
-       d_sqrt.o d_tan.o d_tanh.o 
-INT =  i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o
-HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o  h_nint.o h_sign.o
-CMP =  l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o
-CHAR = s_cat.o s_cmp.o s_copy.o 
-
-libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) $(HALF) $(CMP) $(CHAR) cabs.o
-       ar r libF77.a $?
diff --git a/.ref-Research-V7/usr/src/libF77/abort_.c b/.ref-Research-V7/usr/src/libF77/abort_.c
deleted file mode 100644 (file)
index 21a7b01..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-
-abort_()
-{
-fprintf(stderr, "Fortran abort routine called\n");
-_cleanup();
-abort();
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_abs.c b/.ref-Research-V7/usr/src/libF77/c_abs.c
deleted file mode 100644 (file)
index 79cfa80..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "complex"
-
-float c_abs(z)
-complex *z;
-{
-double cabs();
-
-return( cabs( z->real, z->imag ) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_cos.c b/.ref-Research-V7/usr/src/libF77/c_cos.c
deleted file mode 100644 (file)
index 5927542..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "complex"
-
-c_cos(r, z)
-complex *r, *z;
-{
-double sin(), cos(), sinh(), cosh();
-
-r->real = cos(z->real) * cosh(z->imag);
-r->imag = - sin(z->real) * sinh(z->imag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_div.c b/.ref-Research-V7/usr/src/libF77/c_div.c
deleted file mode 100644 (file)
index 8e959d7..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-struct complex { float real, imag; };
-
-c_div(c, a, b)
-struct complex *a, *b, *c;
-{
-double ratio, den;
-double abr, abi;
-
-if( (abr = b->real) < 0.)
-       abr = - abr;
-if( (abi = b->imag) < 0.)
-       abi = - abi;
-if( abr <= abi )
-       {
-       if(abi == 0)
-               abort(); /* fatal("complex division by zero"); */
-       ratio = b->real / b->imag ;
-       den = b->imag * (1 + ratio*ratio);
-       c->real = (a->real*ratio + a->imag) / den;
-       c->imag = (a->imag*ratio - a->real) / den;
-       }
-
-else
-       {
-       ratio = b->imag / b->real ;
-       den = b->real * (1 + ratio*ratio);
-       c->real = (a->real + a->imag*ratio) / den;
-       c->imag = (a->imag - a->real*ratio) / den;
-       }
-
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_exp.c b/.ref-Research-V7/usr/src/libF77/c_exp.c
deleted file mode 100644 (file)
index a109156..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "complex"
-
-c_exp(r, z)
-complex *r, *z;
-{
-double expx;
-double exp(), cos(), sin();
-
-expx = exp(z->real);
-r->real = expx * cos(z->imag);
-r->imag = expx * sin(z->imag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_log.c b/.ref-Research-V7/usr/src/libF77/c_log.c
deleted file mode 100644 (file)
index fca24c1..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "complex"
-
-c_log(r, z)
-complex *r, *z;
-{
-double log(), cabs(), atan2();
-
-r->imag = atan2(z->imag, z->real);
-r->real = log( cabs(z->real, z->imag) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_sin.c b/.ref-Research-V7/usr/src/libF77/c_sin.c
deleted file mode 100644 (file)
index c4a2765..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "complex"
-
-c_sin(r, z)
-complex *r, *z;
-{
-double sin(), cos(), sinh(), cosh();
-
-r->real = sin(z->real) * cosh(z->imag);
-r->imag = cos(z->real) * sinh(z->imag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/c_sqrt.c b/.ref-Research-V7/usr/src/libF77/c_sqrt.c
deleted file mode 100644 (file)
index 60f42f7..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "complex"
-
-c_sqrt(r, z)
-complex *r, *z;
-{
-double mag, sqrt(), cabs();
-
-if( (mag = cabs(z->real, z->imag)) == 0.)
-       r->real = r->imag = 0.;
-else if(z->real > 0)
-       {
-       r->real = sqrt(0.5 * (mag + z->real) );
-       r->imag = z->imag / r->real / 2;
-       }
-else
-       {
-       r->imag = sqrt(0.5 * (mag - z->real) );
-       if(z->imag < 0)
-               r->imag = - r->imag;
-       r->real = z->imag / r->imag /2;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libF77/cabs.c b/.ref-Research-V7/usr/src/libF77/cabs.c
deleted file mode 100644 (file)
index b2b3e4f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-double cabs(real, imag)
-double real, imag;
-{
-double temp, sqrt();
-
-if(real < 0)
-       real = -real;
-if(imag < 0)
-       imag = -imag;
-if(imag > real){
-       temp = real;
-       real = imag;
-       imag = temp;
-}
-if((real+imag) == real)
-       return(real);
-
-temp = imag/real;
-temp = real*sqrt(1.0 + temp*temp);  /*overflow!!*/
-return(temp);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/compall b/.ref-Research-V7/usr/src/libF77/compall
deleted file mode 100755 (executable)
index dbf8456..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-cc -c -O [a-l]*.c
-cc -c -O [m-z]*.c
diff --git a/.ref-Research-V7/usr/src/libF77/complex b/.ref-Research-V7/usr/src/libF77/complex
deleted file mode 100644 (file)
index 1bb1fb0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-typedef struct { float real, imag; } complex;
-typedef struct { double dreal, dimag; } dcomplex;
diff --git a/.ref-Research-V7/usr/src/libF77/d_abs.c b/.ref-Research-V7/usr/src/libF77/d_abs.c
deleted file mode 100644 (file)
index 75c0172..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-double d_abs(x)
-double *x;
-{
-if(*x >= 0)
-       return(*x);
-return(- *x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_acos.c b/.ref-Research-V7/usr/src/libF77/d_acos.c
deleted file mode 100644 (file)
index 52c9021..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_acos(x)
-double *x;
-{
-double acos();
-return( acos(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_asin.c b/.ref-Research-V7/usr/src/libF77/d_asin.c
deleted file mode 100644 (file)
index f3ba6e9..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_asin(x)
-double *x;
-{
-double asin();
-return( asin(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_atan.c b/.ref-Research-V7/usr/src/libF77/d_atan.c
deleted file mode 100644 (file)
index 6f56301..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_atan(x)
-double *x;
-{
-double atan();
-return( atan(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_atn2.c b/.ref-Research-V7/usr/src/libF77/d_atn2.c
deleted file mode 100644 (file)
index 4a6ce1a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_atn2(x,y)
-double *x, *y;
-{
-double atan2();
-return( atan2(*x,*y) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_cnjg.c b/.ref-Research-V7/usr/src/libF77/d_cnjg.c
deleted file mode 100644 (file)
index 0f5c422..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "complex"
-
-d_cnjg(r, z)
-dcomplex *r, *z;
-{
-r->dreal = z->dreal;
-r->dimag = - z->dimag;
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_cos.c b/.ref-Research-V7/usr/src/libF77/d_cos.c
deleted file mode 100644 (file)
index 81af954..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_cos(x)
-double *x;
-{
-double cos();
-return( cos(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_cosh.c b/.ref-Research-V7/usr/src/libF77/d_cosh.c
deleted file mode 100644 (file)
index c6697ac..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_cosh(x)
-double *x;
-{
-double cosh();
-return( cosh(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_dim.c b/.ref-Research-V7/usr/src/libF77/d_dim.c
deleted file mode 100644 (file)
index 2b19e05..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double d_dim(a,b)
-double *a, *b;
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_exp.c b/.ref-Research-V7/usr/src/libF77/d_exp.c
deleted file mode 100644 (file)
index 8e9d9ed..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_exp(x)
-double *x;
-{
-double exp();
-return( exp(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_imag.c b/.ref-Research-V7/usr/src/libF77/d_imag.c
deleted file mode 100644 (file)
index 3f47dd5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "complex"
-
-double d_imag(z)
-dcomplex *z;
-{
-return(z->dimag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_int.c b/.ref-Research-V7/usr/src/libF77/d_int.c
deleted file mode 100644 (file)
index 47b0d9e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double d_int(x)
-double *x;
-{
-return( (long int) (*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_lg10.c b/.ref-Research-V7/usr/src/libF77/d_lg10.c
deleted file mode 100644 (file)
index 39dcb40..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#define log10e 0.43429448190325182765
-
-double d_lg10(x)
-double *x;
-{
-double log();
-
-return( log10e * log(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_log.c b/.ref-Research-V7/usr/src/libF77/d_log.c
deleted file mode 100644 (file)
index 9771663..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_log(x)
-double *x;
-{
-double log();
-return( log(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_mod.c b/.ref-Research-V7/usr/src/libF77/d_mod.c
deleted file mode 100644 (file)
index 24377d5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double d_mod(x,y)
-double *x, *y;
-{
-return(*x - (*y) * ( (long int) (*x / *y)) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_nint.c b/.ref-Research-V7/usr/src/libF77/d_nint.c
deleted file mode 100644 (file)
index ecb039b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_nint(x)
-double *x;
-{
-return( (*x)>=0 ?
-       (long int) (*x + .5) : (long int) (*x - .5) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_prod.c b/.ref-Research-V7/usr/src/libF77/d_prod.c
deleted file mode 100644 (file)
index 7cf462d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double d_prod(x,y)
-float *x, *y;
-{
-return( (*x) * (*y) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_sign.c b/.ref-Research-V7/usr/src/libF77/d_sign.c
deleted file mode 100644 (file)
index a254e33..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-double d_sign(a,b)
-double *a, *b;
-{
-double x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_sin.c b/.ref-Research-V7/usr/src/libF77/d_sin.c
deleted file mode 100644 (file)
index 63ffbbe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_sin(x)
-double *x;
-{
-double sin();
-return( sin(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_sinh.c b/.ref-Research-V7/usr/src/libF77/d_sinh.c
deleted file mode 100644 (file)
index a6fe34f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_sinh(x)
-double *x;
-{
-double sinh();
-return( sinh(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_sqrt.c b/.ref-Research-V7/usr/src/libF77/d_sqrt.c
deleted file mode 100644 (file)
index a6ac8b8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_sqrt(x)
-double *x;
-{
-double sqrt();
-return( sqrt(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_tan.c b/.ref-Research-V7/usr/src/libF77/d_tan.c
deleted file mode 100644 (file)
index 362b955..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_tan(x)
-double *x;
-{
-double tan();
-return( tan(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/d_tanh.c b/.ref-Research-V7/usr/src/libF77/d_tanh.c
deleted file mode 100644 (file)
index d2e12e6..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double d_tanh(x)
-double *x;
-{
-double tanh();
-return( tanh(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/getarg_.c b/.ref-Research-V7/usr/src/libF77/getarg_.c
deleted file mode 100644 (file)
index 828216a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * subroutine getarg(k, c)
- * returns the kth unix command argument in fortran character
- * variable argument c
-*/
-
-getarg_(n, s, ls)
-long int *n;
-char *s;
-long int ls;
-{
-extern int xargc;
-extern char **xargv;
-char *t;
-int i;
-
-if(*n>0 && *n<xargc)
-       t = xargv[*n];
-else
-       t = "";
-for(i = 0; i<ls && *t!='\0' ; ++i)
-       *s++ = *t++;
-for( ; i<ls ; ++i)
-       *s++ = ' ';
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_abs.c b/.ref-Research-V7/usr/src/libF77/h_abs.c
deleted file mode 100644 (file)
index b77cf88..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-short h_abs(x)
-short *x;
-{
-if(*x >= 0)
-       return(*x);
-return(- *x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_dim.c b/.ref-Research-V7/usr/src/libF77/h_dim.c
deleted file mode 100644 (file)
index 015127b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-short h_dim(a,b)
-short *a, *b;
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_dnnt.c b/.ref-Research-V7/usr/src/libF77/h_dnnt.c
deleted file mode 100644 (file)
index c7ea792..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short h_dnnt(x)
-double *x;
-{
-return( (*x)>=0 ?
-       (short) (*x + .5) : (short) (*x - .5) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_indx.c b/.ref-Research-V7/usr/src/libF77/h_indx.c
deleted file mode 100644 (file)
index 9d4db1d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-short h_indx(a, b, la, lb)
-char *a, *b;
-long int la, lb;
-{
-int i, n;
-char *s, *t, *bend;
-
-n = la - lb + 1;
-bend = b + lb;
-
-for(i = 0 ; i < n ; ++i)
-       {
-       s = a + i;
-       t = b;
-       while(t < bend)
-               if(*s++ != *t++)
-                       goto no;
-       return(i+1);
-       no: ;
-       }
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_len.c b/.ref-Research-V7/usr/src/libF77/h_len.c
deleted file mode 100644 (file)
index 719090b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short h_len(s, n)
-char *s;
-long int n;
-{
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_mod.c b/.ref-Research-V7/usr/src/libF77/h_mod.c
deleted file mode 100644 (file)
index c30ab21..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-short h_mod(a,b)
-short *a, *b;
-{
-return( *a % *b);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_nint.c b/.ref-Research-V7/usr/src/libF77/h_nint.c
deleted file mode 100644 (file)
index 520fbca..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short h_nint(x)
-float *x;
-{
-return( (*x)>=0 ?
-       (short) (*x + .5) : (short) (*x - .5) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/h_sign.c b/.ref-Research-V7/usr/src/libF77/h_sign.c
deleted file mode 100644 (file)
index d5924ea..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-short h_sign(a,b)
-short *a, *b;
-{
-short x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/hl_ge.c b/.ref-Research-V7/usr/src/libF77/hl_ge.c
deleted file mode 100644 (file)
index 7c04515..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short l_ge(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) >= 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/hl_gt.c b/.ref-Research-V7/usr/src/libF77/hl_gt.c
deleted file mode 100644 (file)
index ea4433e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short l_gt(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) > 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/hl_le.c b/.ref-Research-V7/usr/src/libF77/hl_le.c
deleted file mode 100644 (file)
index d1270f3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short l_le(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) <= 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/hl_lt.c b/.ref-Research-V7/usr/src/libF77/hl_lt.c
deleted file mode 100644 (file)
index 31f6bfe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-short l_lt(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) < 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_abs.c b/.ref-Research-V7/usr/src/libF77/i_abs.c
deleted file mode 100644 (file)
index 6f1572e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-long int i_abs(x)
-long int *x;
-{
-if(*x >= 0)
-       return(*x);
-return(- *x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_dim.c b/.ref-Research-V7/usr/src/libF77/i_dim.c
deleted file mode 100644 (file)
index a9162d1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-long int i_dim(a,b)
-long int *a, *b;
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_dnnt.c b/.ref-Research-V7/usr/src/libF77/i_dnnt.c
deleted file mode 100644 (file)
index c1deb52..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int i_dnnt(x)
-double *x;
-{
-return( (*x)>=0 ?
-       (long int) (*x + .5) : (long int) (*x - .5) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_indx.c b/.ref-Research-V7/usr/src/libF77/i_indx.c
deleted file mode 100644 (file)
index f5eed7b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-long int i_indx(a, b, la, lb)
-char *a, *b;
-long int la, lb;
-{
-long int i, n;
-char *s, *t, *bend;
-
-n = la - lb + 1;
-bend = b + lb;
-
-for(i = 0 ; i < n ; ++i)
-       {
-       s = a + i;
-       t = b;
-       while(t < bend)
-               if(*s++ != *t++)
-                       goto no;
-       return(i+1);
-       no: ;
-       }
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_len.c b/.ref-Research-V7/usr/src/libF77/i_len.c
deleted file mode 100644 (file)
index 96a480f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int i_len(s, n)
-char *s;
-long int n;
-{
-return(n);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_mod.c b/.ref-Research-V7/usr/src/libF77/i_mod.c
deleted file mode 100644 (file)
index 28e81c2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-long int i_mod(a,b)
-long int *a, *b;
-{
-return( *a % *b);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_nint.c b/.ref-Research-V7/usr/src/libF77/i_nint.c
deleted file mode 100644 (file)
index d06ba8e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int i_nint(x)
-float *x;
-{
-return( (*x)>=0 ?
-       (long int) (*x + .5) : (long int) (*x - .5) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/i_sign.c b/.ref-Research-V7/usr/src/libF77/i_sign.c
deleted file mode 100644 (file)
index 428f564..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-long int i_sign(a,b)
-long int *a, *b;
-{
-long int x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/iargc_.c b/.ref-Research-V7/usr/src/libF77/iargc_.c
deleted file mode 100644 (file)
index 4d9621a..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-long int iargc_()
-{
-extern int xargc;
-return ( xargc - 1 );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/l_ge.c b/.ref-Research-V7/usr/src/libF77/l_ge.c
deleted file mode 100644 (file)
index 7bdcad4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int l_ge(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) >= 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/l_gt.c b/.ref-Research-V7/usr/src/libF77/l_gt.c
deleted file mode 100644 (file)
index 3983c2c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int l_gt(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) > 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/l_le.c b/.ref-Research-V7/usr/src/libF77/l_le.c
deleted file mode 100644 (file)
index caa4528..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int l_le(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) <= 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/l_lt.c b/.ref-Research-V7/usr/src/libF77/l_lt.c
deleted file mode 100644 (file)
index f69ba70..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-long int l_lt(a,b,la,lb)
-char *a, *b;
-long int la, lb;
-{
-return(s_cmp(a,b,la,lb) < 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/main.c b/.ref-Research-V7/usr/src/libF77/main.c
deleted file mode 100644 (file)
index 2127235..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
-
-#include <stdio.h>
-#include <signal.h>
-
-int xargc;
-char **xargv;
-
-main(argc, argv, arge)
-int argc;
-char **argv;
-char **arge;
-{
-int sigfdie(), sigidie();
-
-xargc = argc;
-xargv = argv;
-signal(SIGFPE, sigfdie);       /* ignore underflow, enable overflow */
-signal(SIGIOT, sigidie);
-MAIN__();
-f_exit();
-}
-
-
-static sigfdie()
-{
-sigdie("Floating Exception");
-}
-
-
-
-static sigidie()
-{
-sigdie("IOT Trap");
-}
-
-
-
-static sigdie(s)
-register char *s;
-{
-/* print error message, then clear buffers */
-fflush(stderr);
-fprintf(stderr, "%s\n", s);
-f_exit();
-fflush(stderr);
-
-/* now get a core */
-signal(SIGIOT, 0);
-abort();
-}
diff --git a/.ref-Research-V7/usr/src/libF77/mklib b/.ref-Research-V7/usr/src/libF77/mklib
deleted file mode 100755 (executable)
index 226f25f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-ar rc libF77.a \
-main.o \
-abort_.o \
-getarg_.o \
-iargc_.o \
-signal_.o \
-s_stop.o \
-s_paus.o \
-pow_ci.o \
-pow_dd.o \
-pow_di.o \
-pow_hh.o \
-pow_ii.o \
-pow_ri.o \
-pow_zi.o \
-pow_zz.o \
-c_abs.o \
-c_cos.o \
-c_div.o \
-c_exp.o \
-c_log.o \
-c_sin.o \
-c_sqrt.o \
-z_abs.o \
-z_cos.o \
-z_div.o \
-z_exp.o \
-z_log.o \
-z_sin.o \
-z_sqrt.o \
-r_abs.o \
-r_acos.o \
-r_asin.o \
-r_atan.o \
-r_atn2.o \
-r_cnjg.o \
-r_cos.o \
-r_cosh.o \
-r_dim.o \
-r_exp.o \
-r_imag.o \
-r_int.o \
-r_lg10.o \
-r_log.o \
-r_mod.o \
-r_nint.o \
-r_sign.o \
-r_sin.o \
-r_sinh.o \
-r_sqrt.o \
-r_tan.o \
-r_tanh.o \
-d_abs.o \
-d_acos.o \
-d_asin.o \
-d_atan.o \
-d_atn2.o \
-d_cnjg.o \
-d_cos.o \
-d_cosh.o \
-d_dim.o \
-d_exp.o \
-d_imag.o \
-d_int.o \
-d_lg10.o \
-d_log.o \
-d_mod.o \
-d_nint.o \
-d_prod.o \
-d_sign.o \
-d_sin.o \
-d_sinh.o \
-d_sqrt.o \
-d_tan.o \
-d_tanh.o \
-i_abs.o \
-i_dim.o \
-i_dnnt.o \
-i_indx.o \
-i_len.o \
-i_mod.o \
-i_nint.o \
-i_sign.o \
-h_abs.o \
-h_dim.o \
-h_dnnt.o \
-h_indx.o \
-h_len.o \
-h_mod.o \
-h_nint.o \
-h_sign.o \
-l_ge.o \
-l_gt.o \
-l_le.o \
-l_lt.o \
-hl_ge.o \
-hl_gt.o \
-hl_le.o \
-hl_lt.o \
-s_cat.o \
-s_cmp.o \
-s_copy.o \
-cabs.o
diff --git a/.ref-Research-V7/usr/src/libF77/pow_ci.c b/.ref-Research-V7/usr/src/libF77/pow_ci.c
deleted file mode 100644 (file)
index f59fcf3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "complex"
-
-pow_ci(p, a, b)        /* p = a**b  */
-complex *p, *a;
-long int *b;
-{
-dcomplex p1, a1;
-
-a1.dreal = a->real;
-a1.dimag = a->imag;
-
-pow_zi(&p1, &a1, b);
-
-p->real = p1.dreal;
-p->imag = p1.dimag;
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_dd.c b/.ref-Research-V7/usr/src/libF77/pow_dd.c
deleted file mode 100644 (file)
index 103f473..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-double pow_dd(ap, bp)
-double *ap, *bp;
-{
-double pow();
-
-return(pow(*ap, *bp) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_di.c b/.ref-Research-V7/usr/src/libF77/pow_di.c
deleted file mode 100644 (file)
index c4a4628..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-double pow_di(ap, bp)
-double *ap;
-long int *bp;
-{
-double pow, x;
-long int n;
-
-pow = 1;
-x = *ap;
-n = *bp;
-
-if(n != 0)
-       {
-       if(n < 0)
-               {
-               if(x == 0)
-                       {
-                       return(pow);
-                       }
-               n = -n;
-               x = 1/x;
-               }
-       for( ; ; )
-               {
-               if(n & 01)
-                       pow *= x;
-               if(n >>= 1)
-                       x *= x;
-               else
-                       break;
-               }
-       }
-return(pow);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_hh.c b/.ref-Research-V7/usr/src/libF77/pow_hh.c
deleted file mode 100644 (file)
index ff77ab6..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-short pow_hh(ap, bp)
-short *ap, *bp;
-{
-short pow, x, n;
-
-pow = 1;
-x = *ap;
-n = *bp;
-
-if(n < 0)
-       { }
-else if(n > 0)
-       for( ; ; )
-               {
-               if(n & 01)
-                       pow *= x;
-               if(n >>= 1)
-                       x *= x;
-               else
-                       break;
-               }
-return(pow);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_ii.c b/.ref-Research-V7/usr/src/libF77/pow_ii.c
deleted file mode 100644 (file)
index 138040b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-long int pow_ii(ap, bp)
-long int *ap, *bp;
-{
-long int pow, x, n;
-
-pow = 1;
-x = *ap;
-n = *bp;
-
-if(n < 0)
-       { }
-else if(n > 0)
-       for( ; ; )
-               {
-               if(n & 01)
-                       pow *= x;
-               if(n >>= 1)
-                       x *= x;
-               else
-                       break;
-               }
-return(pow);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_ri.c b/.ref-Research-V7/usr/src/libF77/pow_ri.c
deleted file mode 100644 (file)
index 492e573..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-float pow_ri(ap, bp)
-float *ap;
-long int *bp;
-{
-double pow, x;
-long int n;
-
-pow = 1;
-x = *ap;
-n = *bp;
-
-if(n != 0)
-       {
-       if(n < 0)
-               {
-               if(x == 0)
-                       {
-                       return(pow);
-                       }
-               n = -n;
-               x = 1/x;
-               }
-       for( ; ; )
-               {
-               if(n & 01)
-                       pow *= x;
-               if(n >>= 1)
-                       x *= x;
-               else
-                       break;
-               }
-       }
-return(pow);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_zi.c b/.ref-Research-V7/usr/src/libF77/pow_zi.c
deleted file mode 100644 (file)
index cd9362e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "complex"
-
-pow_zi(p, a, b)        /* p = a**b  */
-dcomplex *p, *a;
-long int *b;
-{
-long int n;
-double t;
-dcomplex x;
-
-n = *b;
-p->dreal = 1;
-p->dimag = 0;
-
-if(n == 0)
-       return;
-if(n < 0)
-       {
-       n = -n;
-       z_div(&x, a);
-       }
-else
-       {
-       x.dreal = a->dreal;
-       x.dimag = a->dimag;
-       }
-
-for( ; ; )
-       {
-       if(n & 01)
-               {
-               t = p->dreal * x.dreal - p->dimag * x.dimag;
-               p->dimag = p->dreal * x.dimag + p->dimag * x.dreal;
-               p->dreal = t;
-               }
-       if(n >>= 1)
-               {
-               t = x.dreal * x.dreal - x.dimag * x.dimag;
-               x.dimag = 2 * x.dreal * x.dimag;
-               x.dreal = t;
-               }
-       else
-               break;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libF77/pow_zz.c b/.ref-Research-V7/usr/src/libF77/pow_zz.c
deleted file mode 100644 (file)
index d36e6bf..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "complex"
-
-pow_zz(r,a,b)
-dcomplex *r, *a, *b;
-{
-double logr, logi, x, y;
-double log(), exp(), cos(), sin(), atan2(), cabs();
-
-logr = log( cabs(a->dreal, a->dimag) );
-logi = atan2(a->dimag, a->dreal);
-
-x = exp( logr * b->dreal - logi * b->dimag );
-y = logr * b->dimag + logi * b->dreal;
-
-r->dreal = x * cos(y);
-r->dimag = x * sin(y);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_abs.c b/.ref-Research-V7/usr/src/libF77/r_abs.c
deleted file mode 100644 (file)
index ca207bf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-double r_abs(x)
-float *x;
-{
-if(*x >= 0)
-       return(*x);
-return(- *x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_acos.c b/.ref-Research-V7/usr/src/libF77/r_acos.c
deleted file mode 100644 (file)
index 3e73a52..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_acos(x)
-float *x;
-{
-double acos();
-return( acos(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_asin.c b/.ref-Research-V7/usr/src/libF77/r_asin.c
deleted file mode 100644 (file)
index 4f72a8f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_asin(x)
-float *x;
-{
-double asin();
-return( asin(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_atan.c b/.ref-Research-V7/usr/src/libF77/r_atan.c
deleted file mode 100644 (file)
index 63a2792..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_atan(x)
-float *x;
-{
-double atan();
-return( atan(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_atn2.c b/.ref-Research-V7/usr/src/libF77/r_atn2.c
deleted file mode 100644 (file)
index 2429cbe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_atn2(x,y)
-float *x, *y;
-{
-double atan2();
-return( atan2(*x,*y) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_cnjg.c b/.ref-Research-V7/usr/src/libF77/r_cnjg.c
deleted file mode 100644 (file)
index dcd4a93..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "complex"
-
-r_cnjg(r, z)
-complex *r, *z;
-{
-r->real = z->real;
-r->imag = - z->imag;
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_cos.c b/.ref-Research-V7/usr/src/libF77/r_cos.c
deleted file mode 100644 (file)
index 3fdd786..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_cos(x)
-float *x;
-{
-double cos();
-return( cos(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_cosh.c b/.ref-Research-V7/usr/src/libF77/r_cosh.c
deleted file mode 100644 (file)
index b062534..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_cosh(x)
-float *x;
-{
-double cosh();
-return( cosh(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_dim.c b/.ref-Research-V7/usr/src/libF77/r_dim.c
deleted file mode 100644 (file)
index f622b2f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double r_dim(a,b)
-float *a, *b;
-{
-return( *a > *b ? *a - *b : 0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_exp.c b/.ref-Research-V7/usr/src/libF77/r_exp.c
deleted file mode 100644 (file)
index 9fc354a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_exp(x)
-float *x;
-{
-double exp();
-return( exp(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_imag.c b/.ref-Research-V7/usr/src/libF77/r_imag.c
deleted file mode 100644 (file)
index 02f63be..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include "complex"
-
-double r_imag(z)
-complex *z;
-{
-return(z->imag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_int.c b/.ref-Research-V7/usr/src/libF77/r_int.c
deleted file mode 100644 (file)
index 43d9dad..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double r_int(x)
-float *x;
-{
-return( (long int) (*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_lg10.c b/.ref-Research-V7/usr/src/libF77/r_lg10.c
deleted file mode 100644 (file)
index 4b657ee..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#define log10e 0.43429448190325182765
-
-double r_lg10(x)
-float *x;
-{
-double log();
-
-return( log10e * log(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_log.c b/.ref-Research-V7/usr/src/libF77/r_log.c
deleted file mode 100644 (file)
index 4241eae..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_log(x)
-float *x;
-{
-double log();
-return( log(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_mod.c b/.ref-Research-V7/usr/src/libF77/r_mod.c
deleted file mode 100644 (file)
index 047420e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-double r_mod(x,y)
-float *x, *y;
-{
-return(*x - (*y) * ( (long int) (*x / *y)) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_nint.c b/.ref-Research-V7/usr/src/libF77/r_nint.c
deleted file mode 100644 (file)
index 317f01b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_nint(x)
-float *x;
-{
-return( (*x)>=0 ?
-       (long int) (*x + .5) : (long int) (*x - .5) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_sign.c b/.ref-Research-V7/usr/src/libF77/r_sign.c
deleted file mode 100644 (file)
index 901c9a2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-double r_sign(a,b)
-float *a, *b;
-{
-float x;
-x = (*a >= 0 ? *a : - *a);
-return( *b >= 0 ? x : -x);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_sin.c b/.ref-Research-V7/usr/src/libF77/r_sin.c
deleted file mode 100644 (file)
index 0ab7aec..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_sin(x)
-float *x;
-{
-double sin();
-return( sin(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_sinh.c b/.ref-Research-V7/usr/src/libF77/r_sinh.c
deleted file mode 100644 (file)
index 7ab5b2a..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_sinh(x)
-float *x;
-{
-double sinh();
-return( sinh(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_sqrt.c b/.ref-Research-V7/usr/src/libF77/r_sqrt.c
deleted file mode 100644 (file)
index 3f84293..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_sqrt(x)
-float *x;
-{
-double sqrt();
-return( sqrt(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_tan.c b/.ref-Research-V7/usr/src/libF77/r_tan.c
deleted file mode 100644 (file)
index 831b169..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_tan(x)
-float *x;
-{
-double tan();
-return( tan(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/r_tanh.c b/.ref-Research-V7/usr/src/libF77/r_tanh.c
deleted file mode 100644 (file)
index cc25a8d..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-double r_tanh(x)
-float *x;
-{
-double tanh();
-return( tanh(*x) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/s_cat.c b/.ref-Research-V7/usr/src/libF77/s_cat.c
deleted file mode 100644 (file)
index 0914a26..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-s_cat(lp, rpp, rnp, np, ll)
-char *lp, *rpp[];
-long int rnp[], *np, ll;
-{
-int i, n, nc;
-char *rp;
-
-n = *np;
-for(i = 0 ; i < n ; ++i)
-       {
-       nc = ll;
-       if(rnp[i] < nc)
-               nc = rnp[i];
-       ll -= nc;
-       rp = rpp[i];
-       while(--nc >= 0)
-               *lp++ = *rp++;
-       }
-while(--ll >= 0)
-       *lp++ = ' ';
-}
diff --git a/.ref-Research-V7/usr/src/libF77/s_cmp.c b/.ref-Research-V7/usr/src/libF77/s_cmp.c
deleted file mode 100644 (file)
index 5110524..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-int s_cmp(a, b, la, lb)        /* compare two strings */
-char *a, *b;
-long int la, lb;
-{
-char *aend, *bend;
-aend = a + la;
-
-if(la <= lb)
-       {
-       while(a < aend)
-               if(*a != *b)
-                       return( *a - *b );
-               else
-                       { ++a; ++b; }
-
-       }
-
-else
-       {
-       bend = b + lb;
-       while(b < bend)
-               if(*a == *b)
-                       { ++a; ++b; }
-               else
-                       return( *a - *b );
-       while(a < aend)
-               if(*a != ' ')
-                       return(*a - ' ');
-               else    ++a;
-       }
-return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/s_copy.c b/.ref-Research-V7/usr/src/libF77/s_copy.c
deleted file mode 100644 (file)
index e36485c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-s_copy(a, b, la, lb)   /* assign strings:  a = b */
-char *a, *b;
-long int la, lb;
-{
-char *aend, *bend;
-
-aend = a + la;
-
-if(la <= lb)
-       while(a < aend)
-               *a++ = *b++;
-
-else
-       {
-       bend = b + lb;
-       while(b < bend)
-               *a++ = *b++;
-       while(a < aend)
-               *a++ = ' ';
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libF77/s_paus.c b/.ref-Research-V7/usr/src/libF77/s_paus.c
deleted file mode 100644 (file)
index e31bae7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-#define PAUSESIG 15
-
-
-s_paus(s, n)
-char *s;
-long int n;
-{
-int i;
-int waitpause();
-
-fprintf(stderr, "PAUSE ");
-if(n > 0)
-       for(i = 0; i<n ; ++i)
-               putc(*s++, stderr);
-fprintf(stderr, " statement executed\n");
-if( isatty(fileno(stdin)) )
-       {
-       fprintf(stderr, "To resume execution, type go.  Any other input will terminate job.\n");
-       if( getchar()!='g' || getchar()!='o' || getchar()!='\n' )
-               {
-               fprintf(stderr, "STOP\n");
-               f_exit();
-               exit(0);
-               }
-       }
-else
-       {
-       fprintf(stderr, "To resume execution, execute a   kill -%d %d   command\n",
-               PAUSESIG, getpid() );
-       signal(PAUSESIG, waitpause);
-       pause();
-       }
-fprintf(stderr, "Execution resumes after PAUSE.\n");
-}
-
-
-
-
-
-static waitpause()
-{
-return;
-}
diff --git a/.ref-Research-V7/usr/src/libF77/s_rnge.c b/.ref-Research-V7/usr/src/libF77/s_rnge.c
deleted file mode 100644 (file)
index b343e45..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <stdio.h>
-
-/* called when a subscript is out of range */
-
-s_rnge(varn, offset, procn, line)
-char *varn, *procn;
-long int offset;
-int line;
-{
-register int i;
-
-fprintf(stderr, "Subscript out of range on file line %d, procedure ", line);
-for(i = 0 ; i < 8 && *procn!='_' ; ++i)
-       putc(*procn++, stderr);
-fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1);
-for(i = 0 ; i < 6  && *varn!=' ' ; ++i)
-       putc(*varn++, stderr);
-fprintf(stderr, ".\n");
-_cleanup();
-abort();
-}
diff --git a/.ref-Research-V7/usr/src/libF77/s_stop.c b/.ref-Research-V7/usr/src/libF77/s_stop.c
deleted file mode 100644 (file)
index cd88ea2..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <stdio.h>
-
-s_stop(s, n)
-char *s;
-long int n;
-{
-int i;
-
-if(n > 0)
-       {
-       fprintf(stderr, "STOP ");
-       for(i = 0; i<n ; ++i)
-               putc(*s++, stderr);
-       fprintf(stderr, " statement executed\n");
-       }
-f_exit();
-exit(0);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/signal_.c b/.ref-Research-V7/usr/src/libF77/signal_.c
deleted file mode 100644 (file)
index 422e019..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-signal_(sigp, procp)
-int *sigp, (**procp)();
-{
-int sig, proc;
-sig = *sigp;
-proc = *procp;
-
-return( signal(sig, proc) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_abs.c b/.ref-Research-V7/usr/src/libF77/z_abs.c
deleted file mode 100644 (file)
index 09a7955..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "complex"
-
-double z_abs(z)
-dcomplex *z;
-{
-double cabs();
-
-return( cabs( z->dreal, z->dimag ) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_cos.c b/.ref-Research-V7/usr/src/libF77/z_cos.c
deleted file mode 100644 (file)
index 51b9c7a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "complex"
-
-z_cos(r, z)
-dcomplex *r, *z;
-{
-double sin(), cos(), sinh(), cosh();
-
-r->dreal = cos(z->dreal) * cosh(z->dimag);
-r->dimag = - sin(z->dreal) * sinh(z->dimag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_div.c b/.ref-Research-V7/usr/src/libF77/z_div.c
deleted file mode 100644 (file)
index 5028f8c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-struct dcomplex { double dreal, dimag; };
-
-z_div(c, a, b)
-struct dcomplex *a, *b, *c;
-{
-double ratio, den;
-double abr, abi;
-
-if( (abr = b->dreal) < 0.)
-       abr = - abr;
-if( (abi = b->dimag) < 0.)
-       abi = - abi;
-if( abr <= abi )
-       {
-       if(abi == 0)
-               abort(); /* fatal("complex division by zero"); */
-       ratio = b->dreal / b->dimag ;
-       den = b->dimag * (1 + ratio*ratio);
-       c->dreal = (a->dreal*ratio + a->dimag) / den;
-       c->dimag = (a->dimag*ratio - a->dreal) / den;
-       }
-
-else
-       {
-       ratio = b->dimag / b->dreal ;
-       den = b->dreal * (1 + ratio*ratio);
-       c->dreal = (a->dreal + a->dimag*ratio) / den;
-       c->dimag = (a->dimag - a->dreal*ratio) / den;
-       }
-
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_exp.c b/.ref-Research-V7/usr/src/libF77/z_exp.c
deleted file mode 100644 (file)
index beaec1d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "complex"
-
-z_exp(r, z)
-dcomplex *r, *z;
-{
-double expx;
-double exp(), cos(), sin();
-
-expx = exp(z->dreal);
-r->dreal = expx * cos(z->dimag);
-r->dimag = expx * sin(z->dimag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_log.c b/.ref-Research-V7/usr/src/libF77/z_log.c
deleted file mode 100644 (file)
index 1d80359..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "complex"
-
-z_log(r, z)
-dcomplex *r, *z;
-{
-double log(), cabs(), atan2();
-
-r->dimag = atan2(z->dimag, z->dreal);
-r->dreal = log( cabs( z->dreal, z->dimag ) );
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_sin.c b/.ref-Research-V7/usr/src/libF77/z_sin.c
deleted file mode 100644 (file)
index 4aa89c9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "complex"
-
-z_sin(r, z)
-dcomplex *r, *z;
-{
-double sin(), cos(), sinh(), cosh();
-
-r->dreal = sin(z->dreal) * cosh(z->dimag);
-r->dimag = cos(z->dreal) * sinh(z->dimag);
-}
diff --git a/.ref-Research-V7/usr/src/libF77/z_sqrt.c b/.ref-Research-V7/usr/src/libF77/z_sqrt.c
deleted file mode 100644 (file)
index 2a18933..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "complex"
-
-z_sqrt(r, z)
-dcomplex *r, *z;
-{
-double mag, sqrt(), cabs();
-
-if( (mag = cabs(z->dreal, z->dimag)) == 0.)
-       r->dreal = r->dimag = 0.;
-else if(z->dreal > 0)
-       {
-       r->dreal = sqrt(0.5 * (mag + z->dreal) );
-       r->dimag = z->dimag / r->dreal / 2;
-       }
-else
-       {
-       r->dimag = sqrt(0.5 * (mag - z->dreal) );
-       if(z->dimag < 0)
-               z->dimag = - z->dimag;
-       r->dreal = z->dimag / r->dimag / 2;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libI77/backspace.c b/.ref-Research-V7/usr/src/libI77/backspace.c
deleted file mode 100644 (file)
index 85bd02c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "fio.h"
-f_back(a) alist *a;
-{      unit *b;
-       int n,i;
-       long x;
-       char buf[32];
-       if(a->aunit >= MXUNIT || a->aunit < 0)
-               err(a->aerr,101,"backspace")
-       b= &units[a->aunit];
-       if(b->useek==0) err(a->aerr,106,"backspace")
-       if(b->ufd==NULL) err(a->aerr,114,"backspace")
-       if(b->uend==1)
-       {       b->uend=0;
-               return(0);
-       }
-       if(b->uwrt)
-       {       t_runc(b);
-               nowreading(b);
-       }
-       if(b->url>0)
-       {
-               x=ftell(b->ufd);
-               x /= b->url;
-               x *= b->url;
-               fseek(b->ufd,x,0);
-               return(0);
-       }
-       if(b->ufmt==0)
-       {       fseek(b->ufd,-(long)sizeof(int),1);
-               fread((char *)&n,sizeof(int),1,b->ufd);
-               fseek(b->ufd,-(long)n-2*sizeof(int),1);
-               return(0);
-       }
-       for(;;)
-       {
-               x=ftell(b->ufd);
-               if(x<sizeof(buf)) x=0;
-               else x -= sizeof(buf);
-               fseek(b->ufd,x,0);
-               n=fread(buf,1,sizeof(buf),b->ufd);
-               for(i=n-1;i>=0;i--)
-               {
-                       if(buf[i]!='\n') continue;
-                       fseek(b->ufd,(long)(i-n),1);
-                       return(0);
-               }
-               if(x==0) return(0);
-               else if(n==0) err(a->aerr,(EOF),"backspace")
-               else err(a->aerr,errno,"backspace");
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libI77/close.c b/.ref-Research-V7/usr/src/libI77/close.c
deleted file mode 100644 (file)
index 7e4279e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "fio.h"
-f_clos(a) cllist *a;
-{      unit *b;
-       if(a->cunit >= MXUNIT) return(0);
-       b= &units[a->cunit];
-       if(b->ufd==NULL) return(0);
-       b->uend=0;
-       if(a->csta!=0)
-               switch(*a->csta)
-               {
-               default:
-               keep:
-               case 'k':
-                       if(b->uwrt) t_runc(b);
-                       fclose(b->ufd);
-                       if(b->ufnm!=0) free(b->ufnm);
-                       b->ufnm=NULL;
-                       b->ufd=NULL;
-                       return(0);
-               case 'd':
-               delete:
-                       fclose(b->ufd);
-                       if(b->ufnm!=0)
-                       {       unlink(b->ufnm); /*SYSDEP*/
-                               free(b->ufnm);
-                       }
-                       b->ufnm=NULL;
-                       b->ufd=NULL;
-                       return(0);
-               }
-       else if(b->uscrtch==1) goto delete;
-       else goto keep;
-}
-f_exit()
-{      int i;
-       cllist xx;
-       xx.cerr=1;
-       xx.csta=NULL;
-       for(i=0;i<MXUNIT;i++)
-       {
-               xx.cunit=i;
-               f_clos(&xx);
-       }
-}
-flush_()
-{      int i;
-       for(i=0;i<MXUNIT;i++)
-               if(units[i].ufd != NULL) fflush(units[i].ufd);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/compall b/.ref-Research-V7/usr/src/libI77/compall
deleted file mode 100755 (executable)
index b22c6d6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cc -c -O *.c
diff --git a/.ref-Research-V7/usr/src/libI77/dballoc.c b/.ref-Research-V7/usr/src/libI77/dballoc.c
deleted file mode 100644 (file)
index 31930ba..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-#define debug YES
-#ifndef debug
-#define ASSERT(p)
-#endif
-#ifdef debug
-#define ASSERT(p) if(!(p))botch("p");else
-botch(s)
-char *s;
-{
-       printf("assertion botched: %s\n",s);
-       abort();
-}
-#endif
-/*     C storage allocator
- *     circular first-fit strategy
- *     works with noncontiguous, but monotonically linked, arena
- *     each block is preceded by a ptr to the (pointer of) 
- *     the next following block
- *     blocks are exact number of words long; BUSY
- *     bit in ptr is 1 for busy, 0 for idle
- *     gaps in arena are merely noted as busy blocks
- *     last block of arena (pointed to by alloct) is empty and
- *     has a pointer to first
- *     idle blocks are coalesced during space search
-*/
-/*     all these defines must be powers of 2 */
-#define WORD sizeof(struct store)
-#define BLOCK 1024
-#define BUSY 1
-#define NULL 0
-#define testbusy(p) ((int)(p)&BUSY)
-#define setbusy(p) (struct store *)((int)(p)+BUSY)
-#define clearbusy(p) (struct store *)((int)(p)&~BUSY)
-
-struct store { struct store *ptr; };
-
-struct store allocs[] = {      /*initial arena*/
-       setbusy(&allocs[1].ptr),
-       setbusy(&allocs[0].ptr)
-};
-struct store *allocp = &allocs[1];     /*search ptr*/
-struct store *alloct = &allocs[1];     /*arena top*/
-struct store *allocx = 0;              /*for benefit of realloc*/
-struct store *sbrk();
-
-struct store *
-malloc(nbytes)
-unsigned nbytes;
-{
-       struct store *p, *q;
-       register nw;
-       static temp;    /*coroutines assume no auto*/
-
-#ifdef verbose
-       printf("malloc(%d) ",nbytes);
-#endif
-       nw = (nbytes+2*WORD-1)/WORD;
-       ASSERT(allocp>allocs && allocp<=alloct);
-       for(p=allocp; ; ) {
-               for(temp=0; ; ) {
-                       if(!testbusy(p->ptr)) {
-                               while(!testbusy((q=p->ptr)->ptr)) {
-                                       ASSERT(q>p&&q<alloct);
-                                       p->ptr = q->ptr;
-                               }
-                               if(q>=p+nw && p+nw>=p)
-                                       goto found;
-                       }
-                       q = p;
-                       p = clearbusy(p->ptr);
-                       if(p>q)
-                               ASSERT(p<=alloct);
-                       else if(q!=alloct || p!=allocs) {
-                               write(2,"corrupt arena\n",14);
-#ifdef debug
-                               abort();
-#endif
-                               exit(0175);
-                       } else if(++temp>1)
-                               break;
-               }
-               temp = (nw+BLOCK/WORD)&~(BLOCK/WORD-1);
-               q = sbrk(temp*WORD); /*SYSDEP*/
-               if((int)q == -1)
-                       return(NULL);
-               ASSERT(q>alloct);
-               alloct->ptr = q;
-               if(q!=alloct+1)
-                       alloct->ptr = setbusy(alloct->ptr);
-               alloct = q->ptr = q+temp-1;
-               alloct->ptr = setbusy(allocs);
-       }
-found:
-       allocp = p + nw;
-       ASSERT(allocp<=alloct);
-       if(q>allocp) {
-               allocx = allocp->ptr;
-               allocp->ptr = p->ptr;
-       }
-       p->ptr = setbusy(allocp);
-#ifdef verbose
-       printf("= %o\n",p+1);
-#endif
-       return(p+1);
-}
-/*     freeing strategy tuned for LIFO allocation
-*/
-free(p)
- struct store *p;
-{
-       struct store *savep=p;
-#ifdef verbose
-       printf("free(%o)\n",p);
-#endif
-       ASSERT(p>clearbusy(allocs[1].ptr)&&p<=alloct);
-       allocp = --p;
-       ASSERT(testbusy(p->ptr));
-       p->ptr = clearbusy(p->ptr);
-       ASSERT(p->ptr > allocp && p->ptr <= alloct);
-}
-char *calloc(nbytes,count)
-{      char *c;
-       c=(char *)malloc(nbytes*count);
-       return(c);
-}
-/*
-ahist(s) char *s;
-{      char **ap;
-       printf("%s allocp %o alloct %o\n",s,allocp,alloct);
-       for(ap= allocs;ap<alloct;ap= *ap&~BUSY)
-               if(*ap&BUSY) printf("%o ",ap);
-       printf("\n");
-}
-*/
-struct store *
-realloc(p, nbytes)
-register struct store *p;
-unsigned nbytes;
-{
-       register struct store *q;
-       struct store *s, *t;
-       register unsigned nw;
-       unsigned onw;
-
-       onw = p[-1].ptr - p;
-       q = malloc(nbytes);
-       if(q==NULL || q==p)
-               return(q);
-       s = p;
-       t = q;
-       nw = (nbytes+WORD-1)/WORD;
-       if(nw<onw)
-               onw = nw;
-       while(onw--!=0)
-               (t++)->ptr = (s++)->ptr;
-       if(q<p && q+nw>=p)
-               (q+(q+nw-p))->ptr = allocx;
-       return(q);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/dfe.c b/.ref-Research-V7/usr/src/libI77/dfe.c
deleted file mode 100644 (file)
index 49825bf..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#include "fio.h"
-#include "fmt.h"
-extern int rd_ed(),rd_ned(),y_getc(),y_putc(),y_err();
-extern int y_rev();
-extern int w_ed(),w_ned();
-s_rdfe(a) cilist *a;
-{
-       int n;
-       if(!init) f_init();
-       if(n=c_dfe(a,READ))return(n);
-       reading=1;
-       if(curunit->uwrt) nowreading(curunit);
-       getn = y_getc;
-       doed = rd_ed;
-       doned = rd_ned;
-       dorevert = donewrec = y_err;
-       doend = y_rev;
-       if(pars_f(fmtbuf)<0)
-               err(a->cierr,100,"startio");
-       fmt_bg();
-       return(0);
-}
-s_wdfe(a) cilist *a;
-{
-       int n;
-       if(!init) f_init();
-       if(n=c_dfe(a,WRITE)) return(n);
-       reading=0;
-       if(!curunit->uwrt) nowwriting(curunit);
-       putn = y_putc;
-       doed = w_ed;
-       doned= w_ned;
-       dorevert = donewrec = y_err;
-       doend = y_rev;
-       if(pars_f(fmtbuf)<0)
-               err(a->cierr,100,"startwrt");
-       fmt_bg();
-       return(0);
-}
-e_rdfe()
-{
-       en_fio();
-       return(0);
-}
-e_wdfe()
-{
-       en_fio();
-       return(0);
-}
-c_dfe(a,flag) cilist *a;
-{
-       sequential=0;
-       formatted=external=1;
-       elist=a;
-       cursor=scale=recpos=0;
-       if(a->ciunit>MXUNIT || a->ciunit<0)
-               err(a->cierr,101,"startchk");
-       curunit = &units[a->ciunit];
-       if(curunit->ufd==NULL && fk_open(flag,DIR,FMT,a->ciunit))
-               err(a->cierr,104,"dfe");
-       cf=curunit->ufd;
-       if(!curunit->ufmt) err(a->cierr,102,"dfe")
-       if(!curunit->useek) err(a->cierr,104,"dfe")
-       fmtbuf=a->cifmt;
-       fseek(cf,(long)curunit->url * (a->cirec-1),0);
-       curunit->uend = 0;
-       return(0);
-}
-y_getc()
-{
-       int ch;
-       if(curunit->uend) return(-1);
-       if((ch=getc(cf))!=EOF)
-       {
-               recpos++;
-               if(curunit->url>=recpos ||
-                       curunit->url==1)
-                       return(ch);
-               else    return(' ');
-       }
-       if(feof(cf))
-       {
-               curunit->uend=1;
-               errno=0;
-               return(-1);
-       }
-       err(elist->cierr,errno,"readingd");
-}
-y_putc(c)
-{
-       recpos++;
-       if(recpos <= curunit->url || curunit->url==1)
-               putc(c,cf);
-       else
-               err(elist->cierr,110,"dout");
-       return(0);
-}
-y_rev()
-{      /*what about work done?*/
-       if(curunit->url==1 || recpos==curunit->url)
-               return(0);
-       while(recpos<curunit->url)
-               (*putn)(' ');
-       recpos=0;
-       return(0);
-}
-y_err()
-{
-       err(elist->cierr, 110, "dfe");
-}
diff --git a/.ref-Research-V7/usr/src/libI77/due.c b/.ref-Research-V7/usr/src/libI77/due.c
deleted file mode 100644 (file)
index dae2cc6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include "fio.h"
-s_rdue(a) cilist *a;
-{
-       int n;
-       if(n=c_due(a,READ)) return(n);
-       reading=1;
-       if(curunit->uwrt) nowreading(curunit);
-       return(0);
-}
-s_wdue(a) cilist *a;
-{
-       int n;
-       if(n=c_due(a,WRITE)) return(n);
-       reading=0;
-       if(!curunit->uwrt) nowwriting(curunit);
-       return(0);
-}
-c_due(a,flag) cilist *a;
-{
-       if(!init) f_init();
-       if(a->ciunit>=MXUNIT || a->ciunit<0)
-               err(a->cierr,101,"startio");
-       recpos=sequential=formatted=0;
-       external=1;
-       curunit = &units[a->ciunit];
-       elist=a;
-       if(curunit->ufd==NULL && fk_open(flag,DIR,UNF,a->ciunit) ) err(a->cierr,104,"due");
-       cf=curunit->ufd;
-       if(curunit->ufmt) err(a->cierr,102,"cdue")
-       if(!curunit->useek) err(a->cierr,104,"cdue")
-       if(curunit->ufd==NULL) err(a->cierr,114,"cdue")
-       fseek(cf,(long)(a->cirec-1)*curunit->url,0);
-       curunit->uend = 0;
-       return(0);
-}
-e_rdue()
-{
-       if(curunit->url==1 || recpos==curunit->url)
-               return(0);
-       fseek(cf,(long)(curunit->url-recpos),1);
-       if(ftell(cf)%curunit->url)
-               err(elist->cierr,200,"syserr");
-       return(0);
-}
-e_wdue()
-{
-       return(e_rdue());
-}
diff --git a/.ref-Research-V7/usr/src/libI77/endfile.c b/.ref-Research-V7/usr/src/libI77/endfile.c
deleted file mode 100644 (file)
index f0e05e1..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#include "fio.h"
-static alist *ax;
-f_end(a) alist *a;
-{
-       unit *b;
-       if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"endfile");
-       b = &units[a->aunit];
-       if(b->ufd==NULL) return(0);
-       b->uend=1;
-       if( b->useek==0) return(0);
-       ax=a;
-       if(b->uwrt) nowreading(b);
-       return(t_runc(b));
-}
-t_runc(b) unit *b;
-{
-       char buf[128],nm[16];
-       FILE *tmp;
-       int n,m;
-       long loc,len;
-       if(b->url) return(0);   /*don't truncate direct files*/
-       loc=ftell(b->ufd);
-       fseek(b->ufd,0L,2);
-       len=ftell(b->ufd);
-       if(loc==len || b->useek==0 || b->ufnm==NULL) return(0);
-       strcpy(nm,"tmp.FXXXXXX");
-       if(b->uwrt) nowreading(b);
-       mktemp(nm);
-       tmp=fopen(nm,"w");
-       fseek(b->ufd,0L,0);
-       for(;loc>0;)
-       {
-               n=fread(buf,1,loc>128?128:(int)loc,b->ufd);
-               if(n>loc) n=loc;
-               loc -= n;
-               fwrite(buf,1,n,tmp);
-       }
-       fflush(tmp);
-       for(n=0;n<10;n++)
-       {
-               if((m=fork())==-1) continue;
-               else if(m==0)
-               {
-                       execl("/bin/cp","cp",nm,b->ufnm,0);
-                       execl("/usr/bin/cp","cp",nm,b->ufnm,0);
-                       fprintf(stdout,"no cp\n");
-                       exit(1);
-               }
-               wait(&m);
-               if(m!=0) err(ax->aerr,111,"endfile");
-               fclose(tmp);
-               unlink(nm);
-               return(0);
-       }
-       err(ax->aerr,111,"endfile");
-}
diff --git a/.ref-Research-V7/usr/src/libI77/err.c b/.ref-Research-V7/usr/src/libI77/err.c
deleted file mode 100644 (file)
index 8fd4a92..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include "fio.h"
-#define STR(x) (x==NULL?"":x)
-
-/*global definitions*/
-unit units[MXUNIT];    /*unit table*/
-flag init;     /*0 on entry, 1 after initializations*/
-cilist *elist; /*active external io list*/
-flag reading;  /*1 if reading, 0 if writing*/
-flag cplus,cblank;
-char *fmtbuf;
-flag external; /*1 if external io, 0 if internal */
-int (*doed)(),(*doned)();
-int (*doend)(),(*donewrec)(),(*dorevert)();
-flag sequential;       /*1 if sequential io, 0 if direct*/
-flag formatted;        /*1 if formatted io, 0 if unformatted*/
-int (*getn)(),(*putn)();       /*for formatted io*/
-FILE *cf;      /*current file*/
-unit *curunit; /*current unit*/
-int recpos;    /*place in current record*/
-int cursor,scale;
-
-/*error messages*/
-char *F_err[]
-{
-       "error in format",
-       "illegal unit number",
-       "formatted io not allowed",
-       "unformatted io not allowed",
-       "direct io not allowed",
-       "sequential io not allowed",
-       "can't backspace file",
-       "null file name",
-       "can't stat file",
-       "unit not connected",
-       "off end of record",
-       "truncation failed in endfile",
-       "incomprehensible list input",
-       "out of free space",
-       "unit not connected",
-       "read unexpected character",
-       "blank logical input field",
-};
-#define MAXERR (sizeof(F_err)/sizeof(char *)+100)
-fatal(n,s) char *s;
-{
-       if(n<100 && n>=0) perror(s); /*SYSDEP*/
-       else if(n>=(int)MAXERR)
-       {       fprintf(stderr,"%s: illegal error number %d\n",s,n);
-       }
-       else if(n<0) fprintf(stderr,"%s: end of file %d\n",s,n);
-       else
-               fprintf(stderr,"%s: %s\n",s,F_err[n-100]);
-       fprintf(stderr,"apparent state: unit %d named %s\n",curunit-units,
-               STR(curunit->ufnm));
-       fprintf(stderr,"last format: %s\n",STR(fmtbuf));
-       fprintf(stderr,"lately %s %s %s %s IO\n",reading?"reading":"writing",
-               sequential?"sequential":"direct",formatted?"formatted":"unformatted",
-               external?"external":"internal");
-       _cleanup();
-       abort();
-}
-/*initialization routine*/
-f_init()
-{      unit *p;
-       init=1;
-       p= &units[0];
-       p->ufd=stderr;
-       p->useek=canseek(stderr);
-       p->ufmt=1;
-       p->uwrt=1;
-       p = &units[5];
-       p->ufd=stdin;
-       p->useek=canseek(stdin);
-       p->ufmt=1;
-       p->uwrt=0;
-       p= &units[6];
-       p->ufd=stdout;
-       p->useek=canseek(stdout);
-       p->ufmt=1;
-       p->uwrt=1;
-}
-canseek(f) FILE *f; /*SYSDEP*/
-{      struct stat x;
-       fstat(fileno(f),&x);
-       if(x.st_nlink > 0 /*pipe*/ && !isatty(fileno(f)))
-       {
-               return(1);
-       }
-       return(0);
-}
-nowreading(x) unit *x;
-{
-       long loc;
-       x->uwrt=0;
-       loc=ftell(x->ufd);
-       freopen(x->ufnm,"r",x->ufd);
-       fseek(x->ufd,loc,0);
-}
-nowwriting(x) unit *x;
-{
-       long loc;
-       loc=ftell(x->ufd);
-       x->uwrt=1;
-       freopen(x->ufnm,"a",x->ufd);
-       fseek(x->ufd,loc,0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/fio.h b/.ref-Research-V7/usr/src/libI77/fio.h
deleted file mode 100644 (file)
index d223136..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#include <stdio.h>
-typedef long ftnint;
-typedef ftnint flag;
-typedef long ftnlen;
-/*external read, write*/
-typedef struct
-{      flag cierr;
-       ftnint ciunit;
-       flag ciend;
-       char *cifmt;
-       ftnint cirec;
-} cilist;
-/*internal read, write*/
-typedef struct
-{      flag icierr;
-       char *iciunit;
-       flag iciend;
-       char *icifmt;
-       ftnint icirlen;
-       ftnint icirnum;
-} icilist;
-/*open*/
-typedef struct
-{      flag oerr;
-       ftnint ounit;
-       char *ofnm;
-       ftnlen ofnmlen;
-       char *osta;
-       char *oacc;
-       char *ofm;
-       ftnint orl;
-       char *oblnk;
-} olist;
-/*close*/
-typedef struct
-{      flag cerr;
-       ftnint cunit;
-       char *csta;
-} cllist;
-/*rewind, backspace, endfile*/
-typedef struct
-{      flag aerr;
-       ftnint aunit;
-} alist;
-/*units*/
-typedef struct
-{      FILE *ufd;      /*0=unconnected*/
-       char *ufnm;
-       long uinode;
-       int url;        /*0=sequential*/
-       flag useek;     /*true=can backspace, use dir, ...*/
-       flag ufmt;
-       flag uprnt;
-       flag ublnk;
-       flag uend;
-       flag uwrt;      /*last io was write*/
-       flag uscrtch;
-} unit;
-typedef struct
-{      flag inerr;
-       ftnint inunit;
-       char *infile;
-       ftnlen infilen;
-       ftnint  *inex;  /*parameters in standard's order*/
-       ftnint  *inopen;
-       ftnint  *innum;
-       ftnint  *innamed;
-       char    *inname;
-       ftnlen  innamlen;
-       char    *inacc;
-       ftnlen  inacclen;
-       char    *inseq;
-       ftnlen  inseqlen;
-       char    *indir;
-       ftnlen  indirlen;
-       char    *infmt;
-       ftnlen  infmtlen;
-       char    *inform;
-       ftnint  informlen;
-       char    *inunf;
-       ftnlen  inunflen;
-       ftnint  *inrecl;
-       ftnint  *innrec;
-       char    *inblank;
-       ftnlen  inblanklen;
-} inlist;
-
-extern int errno;
-extern flag init;
-extern cilist *elist;  /*active external io list*/
-extern flag reading,external,sequential,formatted;
-extern int (*getn)(),(*putn)();        /*for formatted io*/
-extern FILE *cf;       /*current file*/
-extern unit *curunit;  /*current unit*/
-extern unit units[];
-#define err(f,n,s) {if(f) errno= n; else fatal(n,s); return(n);}
-
-/*Table sizes*/
-#define MXUNIT 10
-
-extern int recpos;     /*position in current record*/
-
-#define WRITE  1
-#define READ   2
-#define SEQ    3
-#define DIR    4
-#define FMT    5
-#define UNF    6
-#define EXT    7
-#define INT    8
diff --git a/.ref-Research-V7/usr/src/libI77/fmt.c b/.ref-Research-V7/usr/src/libI77/fmt.c
deleted file mode 100644 (file)
index 3cfc103..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-#include "fio.h"
-#include "fmt.h"
-#define skip(s) while(*s==' ') s++
-#ifdef interdata
-#define SYLMX 300
-#endif
-#ifdef pdp11
-#define SYLMX 300
-#endif
-#ifdef vax
-#define SYLMX 300
-#endif
-#define GLITCH '\2'
-       /* special quote character for stu */
-extern int cursor,scale;
-extern flag cblank,cplus;      /*blanks in I and compulsory plus*/
-struct syl syl[SYLMX];
-int parenlvl,pc,revloc;
-char *f_s(),*f_list(),*i_tem(),*gt_num();
-pars_f(s) char *s;
-{
-       parenlvl=revloc=pc=0;
-       if((s=f_s(s,0))==NULL)
-       {
-               return(-1);
-       }
-       return(0);
-}
-char *f_s(s,curloc) char *s;
-{
-       skip(s);
-       if(*s++!='(')
-       {
-               return(NULL);
-       }
-       if(parenlvl++ ==1) revloc=curloc;
-       if(op_gen(RET,curloc,0,0)<0 ||
-               (s=f_list(s))==NULL)
-       {
-               return(NULL);
-       }
-       skip(s);
-       return(s);
-}
-char *f_list(s) char *s;
-{
-       for(;*s!=0;)
-       {       skip(s);
-               if((s=i_tem(s))==NULL) return(NULL);
-               skip(s);
-               if(*s==',') s++;
-               else if(*s==')')
-               {       if(--parenlvl==0)
-                       {
-                               op_gen(REVERT,revloc,0,0);
-                               return(++s);
-                       }
-                       op_gen(GOTO,0,0,0);
-                       return(++s);
-               }
-       }
-       return(NULL);
-}
-char *i_tem(s) char *s;
-{      char *t;
-       int n,curloc;
-       if(*s==')') return(s);
-       if(ne_d(s,&t)) return(t);
-       if(e_d(s,&t)) return(t);
-       s=gt_num(s,&n);
-       if((curloc=op_gen(STACK,n,0,0))<0) return(NULL);
-       return(f_s(s,curloc));
-}
-ne_d(s,p) char *s,**p;
-{      int n,x,sign=0;
-       char *ap_end();
-       switch(*s)
-       {
-       default: return(0);
-       case ':': op_gen(COLON,0,0,0); break;
-       case 'b':
-               if(*++s=='z') op_gen(BZ,0,0,0);
-               else op_gen(BN,0,0,0);
-               break;
-       case 's':
-               if(*(s+1)=='s')
-               {       x=SS;
-                       s++;
-               }
-               else if(*(s+1)=='p')
-               {       x=SP;
-                       s++;
-               }
-               else x=S;
-               op_gen(x,0,0,0);
-               break;
-       case '/': op_gen(SLASH,0,0,0); break;
-       case '-': sign=1; s++;  /*OUTRAGEOUS CODING TRICK*/
-       case '0': case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8': case '9':
-               s=gt_num(s,&n);
-               switch(*s)
-               {
-               default: return(0);
-               case 'p': if(sign) n= -n; op_gen(P,n,0,0); break;
-               case 'x': op_gen(X,n,0,0); break;
-               case 'H':
-               case 'h': op_gen(H,n,(int)(s+1),0);
-                       s+=n;
-                       break;
-               }
-               break;
-       case GLITCH:
-       case '"':
-       case '\'': op_gen(APOS,(int)s,0,0);
-               *p=ap_end(s);
-               return(1);
-       case 't':
-               if(*(s+1)=='l')
-               {       x=TL;
-                       s++;
-               }
-               else if(*(s+1)=='r')
-               {       x=TR;
-                       s++;
-               }
-               else x=T;
-               s=gt_num(s+1,&n);
-               op_gen(x,n,0,0);
-               break;
-       case 'x': op_gen(X,1,0,0); break;
-       case 'p': op_gen(P,1,0,0); break;
-       }
-       s++;
-       *p=s;
-       return(1);
-}
-e_d(s,p) char *s,**p;
-{      int n,w,d,e,found=0,x=0;
-       char *sv=s;
-       s=gt_num(s,&n);
-       op_gen(STACK,n,0,0);
-       switch(*s++)
-       {
-       default: break;
-       case 'e':       x=1;
-       case 'g':
-               found=1;
-               s=gt_num(s,&w);
-               if(w==0) break;
-               if(*s=='.')
-               {       s++;
-                       s=gt_num(s,&d);
-               }
-               else d=0;
-               if(*s!='E')
-                       op_gen(x==1?E:G,w,d,0);
-               else
-               {       s++;
-                       s=gt_num(s,&e);
-                       op_gen(x==1?EE:GE,w,d,e);
-               }
-               break;
-       case 'o':
-               found = 1;
-               s = gt_num(s, &w);
-               if(w==0) break;
-               op_gen(O, w, 0, 0);
-               break;
-       case 'l':
-               found=1;
-               s=gt_num(s,&w);
-               if(w==0) break;
-               op_gen(L,w,0,0);
-               break;
-       case 'a':
-               found=1;
-               skip(s);
-               if(*s>='0' && *s<='9')
-               {       s=gt_num(s,&w);
-                       if(w==0) break;
-                       op_gen(AW,w,0,0);
-                       break;
-               }
-               op_gen(A,0,0,0);
-               break;
-       case 'f':
-               found=1;
-               s=gt_num(s,&w);
-               if(w==0) break;
-               if(*s=='.')
-               {       s++;
-                       s=gt_num(s,&d);
-               }
-               else d=0;
-               op_gen(F,w,d,0);
-               break;
-       case 'd':
-               found=1;
-               s=gt_num(s,&w);
-               if(w==0) break;
-               if(*s=='.')
-               {       s++;
-                       s=gt_num(s,&d);
-               }
-               else d=0;
-               op_gen(D,w,d,0);
-               break;
-       case 'i':
-               found=1;
-               s=gt_num(s,&w);
-               if(w==0) break;
-               if(*s!='.')
-               {       op_gen(I,w,0,0);
-                       break;
-               }
-               s++;
-               s=gt_num(s,&d);
-               op_gen(IM,w,d,0);
-               break;
-       }
-       if(found==0)
-       {       pc--; /*unSTACK*/
-               *p=sv;
-               return(0);
-       }
-       *p=s;
-       return(1);
-}
-op_gen(a,b,c,d)
-{      struct syl *p= &syl[pc];
-       if(pc>=SYLMX)
-       {       fprintf(stderr,"format too complicated:\n%s\n",
-                       fmtbuf);
-               abort();
-       }
-       p->op=a;
-       p->p1=b;
-       p->p2=c;
-       p->p3=d;
-       return(pc++);
-}
-char *gt_num(s,n) char *s; int *n;
-{      int m=0,cnt=0;
-       char c;
-       for(c= *s;;c = *s)
-       {       if(c==' ')
-               {       s++;
-                       continue;
-               }
-               if(c>'9' || c<'0') break;
-               m=10*m+c-'0';
-               cnt++;
-               s++;
-       }
-       if(cnt==0) *n=1;
-       else *n=m;
-       return(s);
-}
-#define STKSZ 10
-int cnt[STKSZ],ret[STKSZ],cp,rp;
-flag workdone;
-en_fio()
-{      ftnint one=1;
-       return(do_fio(&one,NULL,0l));
-}
-do_fio(number,ptr,len) ftnint *number; ftnlen len; char *ptr;
-{      struct syl *p;
-       int n,i;
-       for(i=0;i<*number;i++,ptr+=len)
-       {
-loop:  switch(type_f((p= &syl[pc])->op))
-       {
-       default:
-               fprintf(stderr,"unknown code in do_fio: %d\n%s\n",
-                       p->op,fmtbuf);
-               err(elist->cierr,100,"do_fio");
-       case NED:
-               if((*doned)(p,ptr))
-               {       pc++;
-                       goto loop;
-               }
-               pc++;
-               continue;
-       case ED:
-               if(cnt[cp]<=0)
-               {       cp--;
-                       pc++;
-                       goto loop;
-               }
-               if(ptr==NULL)
-                       return((*doend)());
-               cnt[cp]--;
-               workdone=1;
-               if((n=(*doed)(p,ptr,len))>0) err(elist->cierr,errno,"fmt");
-               if(n<0) err(elist->ciend,(EOF),"fmt");
-               continue;
-       case STACK:
-               cnt[++cp]=p->p1;
-               pc++;
-               goto loop;
-       case RET:
-               ret[++rp]=p->p1;
-               pc++;
-               goto loop;
-       case GOTO:
-               if(--cnt[cp]<=0)
-               {       cp--;
-                       rp--;
-                       pc++;
-                       goto loop;
-               }
-               pc=1+ret[rp--];
-               goto loop;
-       case REVERT:
-               rp=cp=0;
-               pc = p->p1;
-               if(ptr==NULL)
-                       return((*doend)());
-               if(!workdone) return(0);
-               if((n=(*dorevert)()) != 0) return(n);
-               goto loop;
-       case COLON:
-               if(ptr==NULL)
-                       return((*doend)());
-               pc++;
-               goto loop;
-       case S:
-       case SS:
-               cplus=0;
-               pc++;
-               goto loop;
-       case SP:
-               cplus = 1;
-               pc++;
-               goto loop;
-       case P: scale=p->p1;
-               pc++;
-               goto loop;
-       case BN:
-               cblank=0;
-               pc++;
-               goto loop;
-       case BZ:
-               cblank=1;
-               pc++;
-               goto loop;
-       }
-       }
-       return(0);
-}
-fmt_bg()
-{
-       workdone=cp=rp=pc=cursor=0;
-       cnt[0]=ret[0]=0;
-}
-type_f(n)
-{
-       switch(n)
-       {
-       default:
-               return(n);
-       case RET:
-               return(RET);
-       case REVERT: return(REVERT);
-       case GOTO: return(GOTO);
-       case STACK: return(STACK);
-       case X:
-       case SLASH:
-       case APOS: case H:
-       case T: case TL: case TR:
-               return(NED);
-       case F:
-       case I:
-       case IM:
-       case A: case AW:
-       case O:
-       case L:
-       case E: case EE: case D:
-       case G: case GE:
-               return(ED);
-       }
-}
-char *ap_end(s) char *s;
-{      char quote;
-       quote= *s++;
-       for(;*s;s++)
-       {       if(*s!=quote) continue;
-               if(*++s!=quote) return(s);
-       }
-       err(elist->cierr,100,"bad string");
-}
diff --git a/.ref-Research-V7/usr/src/libI77/fmt.h b/.ref-Research-V7/usr/src/libI77/fmt.h
deleted file mode 100644 (file)
index 0f1b498..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-struct syl
-{      int op,p1,p2,p3;
-};
-#define RET 1
-#define REVERT 2
-#define GOTO 3
-#define X 4
-#define SLASH 5
-#define STACK 6
-#define I 7
-#define ED 8
-#define NED 9
-#define IM 10
-#define APOS 11
-#define H 12
-#define TL 13
-#define TR 14
-#define T 15
-#define COLON 16
-#define S 17
-#define SP 18
-#define SS 19
-#define P 20
-#define BN 21
-#define BZ 22
-#define F 23
-#define E 24
-#define EE 25
-#define D 26
-#define G 27
-#define GE 28
-#define L 29
-#define A 30
-#define AW 31
-#define O 32
-extern struct syl syl[];
-extern int pc,parenlvl,revloc;
-extern int (*doed)(),(*doned)();
-extern int (*dorevert)(),(*donewrec)(),(*doend)();
-extern flag cblank,cplus,workdone;
-extern int dummy();
-extern char *fmtbuf;
-extern int scale;
-typedef union
-{      float pf;
-       double pd;
-} ufloat;
-typedef union
-{      short is;
-       char ic;
-       long il;
-} uint;
-#define GET(x) if((x=(*getn)())<0) return(x)
-#define VAL(x) (x!='\n'?x:' ')
-#define PUT(x) (*putn)(x)
-extern int cursor;
diff --git a/.ref-Research-V7/usr/src/libI77/fmtlib.c b/.ref-Research-V7/usr/src/libI77/fmtlib.c
deleted file mode 100644 (file)
index d745c66..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#define MAXINTLENGTH 12
-char *icvt(value,ndigit,sign, base) long value; int *ndigit,*sign;
-register int base;
-{      static char buf[MAXINTLENGTH+1];
-       register int i;
-       if(value>0) *sign=0;
-       else if(value<0)
-       {       value = -value;
-               *sign= 1;
-       }
-       else
-       {       *sign=0;
-               *ndigit=1;
-               buf[MAXINTLENGTH]='0';
-               return(&buf[MAXINTLENGTH]);
-       }
-       for(i=MAXINTLENGTH-1;value>0;i--)
-       {       *(buf+i)=(int)(value%base)+'0';
-               value /= base;
-       }
-       *ndigit=MAXINTLENGTH-1-i;
-       return(&buf[i+1]);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/iio.c b/.ref-Research-V7/usr/src/libI77/iio.c
deleted file mode 100644 (file)
index 5e93b16..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#include "fio.h"
-#include "fmt.h"
-char *icptr,*icend;
-icilist *svic;
-extern int rd_ed(),rd_ned(),w_ed(),w_ned(),y_err();
-extern int z_wnew();
-int icnum,icpos;
-z_getc()
-{
-       if(icptr >= icend) err(svic->iciend,(EOF),"endfile");
-       if(icpos++ < svic->icirlen)
-               return(*icptr++);
-       else    err(svic->icierr,110,"recend");
-}
-z_putc(c)
-{
-       if(icptr >= icend) err(svic->icierr,110,"inwrite");
-       if(icpos++ < svic->icirlen)
-               *icptr++ = c;
-       else    err(svic->icierr,110,"recend");
-       return(0);
-}
-z_rnew()
-{
-       icptr = svic->iciunit + (++icnum)*svic->icirlen;
-       icpos = 0;
-}
-s_rsfi(a) icilist *a;
-{      int n;
-       if(n=c_si(a)) return(n);
-       reading=1;
-       doed=rd_ed;
-       doned=rd_ned;
-       getn=z_getc;
-       dorevert = donewrec = y_err;
-       doend = z_rnew;
-       return(0);
-}
-s_wsfi(a) icilist *a;
-{      int n;
-       if(n=c_si(a)) return(n);
-       reading=0;
-       doed=w_ed;
-       doned=w_ned;
-       putn=z_putc;
-       dorevert = donewrec = y_err;
-       doend = z_wnew;
-       return(0);
-}
-c_si(a) icilist *a;
-{
-       fmtbuf=a->icifmt;
-       if(pars_f(fmtbuf)<0)
-               err(a->icierr,100,"startint");
-       fmt_bg();
-       sequential=formatted=1;
-       external=0;
-       cblank=cplus=scale=0;
-       svic=a;
-       icnum=icpos=0;
-       icptr=svic->iciunit;
-       icend=icptr+svic->icirlen*svic->icirnum;
-       return(0);
-}
-z_wnew()
-{
-       while(icpos++ < svic->icirlen)
-               *icptr++ = ' ';
-       icpos = 0;
-       icnum++;
-}
-e_rsfi()
-{      int n;
-       n = en_fio();
-       fmtbuf = NULL;
-       return(n);
-}
-e_wsfi()
-{
-       int n;
-       n = en_fio();
-       fmtbuf = NULL;
-       while(icpos++ < svic->icirlen)
-               *icptr++ = ' ';
-       return(n);
-}
-y_err()
-{
-       err(elist->cierr, 110, "iio");
-}
diff --git a/.ref-Research-V7/usr/src/libI77/inquire.c b/.ref-Research-V7/usr/src/libI77/inquire.c
deleted file mode 100644 (file)
index 24925c1..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#include "fio.h"
-f_inqu(a) inlist *a;
-{      flag byfile,legal;
-       int i;
-       unit *p;
-       char buf[256];
-       long x;
-       if(a->infile!=NULL)
-       {       byfile=1;
-               g_char(a->infile,a->infilen,buf);
-               x=inode(buf);
-               for(i=0,p=NULL;i<MXUNIT;i++)
-                       if(units[i].uinode==x && units[i].ufd!=NULL)
-                               p = &units[i];
-       }
-       else
-       {
-               byfile=0;
-               if(a->inunit<MXUNIT && a->inunit>=0)
-               {       legal=1;
-                       p= &units[a->inunit];
-               }
-               else
-               {       legal=0;
-                       p=NULL;
-               }
-       }
-       if(a->inex!=NULL)
-               if(byfile && x>0 || !byfile && p!=NULL)
-                       *a->inex=1;
-               else *a->inex=0;
-       if(a->inopen!=NULL)
-               if(byfile) *a->inopen=(p!=NULL);
-               else *a->inopen=(p!=NULL && p->ufd!=NULL);
-       if(a->innum!=NULL) *a->innum= p-units;
-       if(a->innamed!=NULL)
-               if(byfile || p!=NULL && p->ufnm!=NULL)
-                       *a->innamed=1;
-               else    *a->innamed=0;
-       if(a->inname!=NULL)
-               if(byfile)
-                       b_char(buf,a->inname,a->innamlen);
-               else if(p!=NULL && p->ufnm!=NULL)
-                       b_char(p->ufnm,a->inname,a->innamlen);
-       if(a->inacc!=NULL && p!=NULL && p->ufd!=NULL)
-               if(p->url)
-                       b_char("direct",a->inacc,a->inacclen);
-               else    b_char("sequential",a->inacc,a->inacclen);
-       if(a->inseq!=NULL)
-               if(byfile || p!=NULL && p->useek)
-                       b_char("yes",a->inseq,a->inseqlen);
-               else    b_char("no",a->inseq,a->inseqlen);
-       if(a->indir!=NULL)
-               if(byfile || p!=NULL && p->useek)
-                       b_char("yes",a->indir,a->indirlen);
-               else    b_char("no",a->indir,a->indirlen);
-       if(a->infmt!=NULL)
-               if(p!=NULL && p->ufmt)
-                       b_char("formatted",a->infmt,a->infmtlen);
-               else if(p!=NULL)
-                       b_char("unformatted",a->infmt,a->infmtlen);
-       if(a->inform!=NULL)
-               b_char("yes",a->inform,a->informlen);
-       if(a->inunf)
-               if(byfile || p!=NULL && p->useek)
-                       b_char("yes",a->inunf,a->inunflen);
-               else    b_char("unknown",a->inunf,a->inunflen);
-       if(a->inrecl!=NULL && p!=NULL)
-               *a->inrecl=p->url;
-       if(a->innrec!=NULL && p!=NULL && p->url>0)
-               *a->innrec=ftell(p->ufd)/p->url+1;
-       if(a->inblank && p!=NULL && p->ufmt)
-               if(p->ublnk)
-                       b_char("zero",a->inblank,a->inblanklen);
-               else    b_char("blank",a->inblank,a->inblanklen);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/lib.c b/.ref-Research-V7/usr/src/libI77/lib.c
deleted file mode 100644 (file)
index 1a1e5e9..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "fio.h"
-setcilist(x,u,fmt,rec,xerr,end) cilist *x;
-char *fmt;
-{
-       x->ciunit=u;
-       x->cifmt=fmt;
-       x->cirec=rec;
-       x->cierr=xerr;
-       x->ciend=end;
-}
-setolist(x,xunit,fname,sta,fm,rl,blnk,oerr) olist *x;
-       char *fname,*sta,*fm,*blnk;
-{
-       x->oerr=oerr;
-       x->ounit=xunit;
-       x->ofnm=fname;
-       x->ofnmlen=strlen(fname);
-       x->osta=sta;
-       x->ofm=fm;
-       x->orl=rl;
-       x->oblnk=blnk;
-}
-stcllist(x,xunit,stat,cerr) cllist *x; char *stat;
-{
-       x->cerr=cerr;
-       x->cunit=xunit;
-       x->csta=stat;
-}
-setalist(x,xunit,aerr) alist *x;
-{
-       x->aunit=xunit;
-       x->aerr=aerr;
-}
diff --git a/.ref-Research-V7/usr/src/libI77/lio.c b/.ref-Research-V7/usr/src/libI77/lio.c
deleted file mode 100644 (file)
index 93aa249..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "fio.h"
-#include "lio.h"
-extern int l_write();
-int t_putc();
-s_wsle(a) cilist *a;
-{
-       int n;
-       if(!init) f_init();
-       if(n=c_le(a,WRITE)) return(n);
-       reading=0;
-       external=1;
-       formatted=1;
-       putn = t_putc;
-       lioproc = l_write;
-       if(!curunit->uwrt)
-               return(nowwriting(curunit));
-       else    return(0);
-}
-e_wsle()
-{
-       t_putc('\n');
-       recpos=0;
-       return(0);
-}
-t_putc(c)
-{
-       recpos++;
-       putc(c,cf);
-}
-lwrt_I(n) ftnint n;
-{
-       char buf[LINTW],*p;
-       sprintf(buf," %ld",(long)n);
-       if(recpos+strlen(buf)>=LINE)
-       {       t_putc('\n');
-               recpos=0;
-       }
-       for(p=buf;*p;t_putc(*p++));
-}
-lwrt_L(n) ftnint n;
-{
-       if(recpos+LLOGW>=LINE)
-       {       t_putc('\n');
-               recpos=0;
-       }
-       wrt_L(&n,LLOGW);
-}
-lwrt_A(p,len) char *p; ftnlen len;
-{
-       int i;
-       if(recpos+len>=LINE)
-       {
-               t_putc('\n');
-               recpos=0;
-       }
-       t_putc(' ');
-       for(i=0;i<len;i++) t_putc(*p++);
-}
-lwrt_F(n) double n;
-{
-       if(LLOW<=n && n<LHIGH)
-       {
-               if(recpos+LFW>=LINE)
-               {
-                       t_putc('\n');
-                       recpos=0;
-               }
-               scale=0;
-               wrt_F(&n,LFW,LFD,(ftnlen)sizeof(n));
-       }
-       else
-       {
-               if(recpos+LEW>=LINE)
-               {       t_putc('\n');
-                       recpos=0;
-               }
-               wrt_E(&n,LEW,LED,LEE,(ftnlen)sizeof(n));
-       }
-}
-lwrt_C(a,b) double a,b;
-{
-       if(recpos+2*LFW+3>=LINE)
-       {       t_putc('\n');
-               recpos=0;
-       }
-       t_putc(' ');
-       t_putc('(');
-       lwrt_F(a);
-       lwrt_F(b);
-       t_putc(')');
-}
-l_write(number,ptr,len,type) ftnint *number,type; flex *ptr; ftnlen len;
-{
-       int i;
-       ftnint x;
-       double y,z;
-       float *xx;
-       double *yy;
-       for(i=0;i< *number; i++)
-       {
-               switch((int)type)
-               {
-               default: fatal(204,"unknown type in lio");
-               case TYSHORT: x=ptr->flshort;
-                       goto xint;
-               case TYLONG: x=ptr->flint;
-               xint: lwrt_I(x);
-                       break;
-               case TYREAL: y=ptr->flreal;
-                       goto xfloat;
-               case TYDREAL: y=ptr->fldouble;
-               xfloat: lwrt_F(y);
-                       break;
-               case TYCOMPLEX: xx= &(ptr->flreal);
-                       y = *xx++;
-                       z = *xx;
-                       goto xcomplex;
-               case TYDCOMPLEX: yy = &(ptr->fldouble);
-                       y= *yy++;
-                       z = *yy;
-               xcomplex: lwrt_C(y,z);
-                       break;
-               case TYLOGICAL: lwrt_L(ptr->flint);
-                       break;
-               case TYCHAR: lwrt_A((char *)ptr,len);
-                       break;
-               }
-               ptr = (char *)ptr + len;
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/lio.h b/.ref-Research-V7/usr/src/libI77/lio.h
deleted file mode 100644 (file)
index d54bf03..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*     copy of ftypes from the compiler */
-/* variable types
- * numeric assumptions:
- *     int < reals < complexes
- *     TYDREAL-TYREAL = TYDCOMPLEX-TYCOMPLEX
- */
-
-#define TYUNKNOWN 0
-#define TYADDR 1
-#define TYSHORT 2
-#define TYLONG 3
-#define TYREAL 4
-#define TYDREAL 5
-#define TYCOMPLEX 6
-#define TYDCOMPLEX 7
-#define TYLOGICAL 8
-#define TYCHAR 9
-#define TYSUBR 10
-#define TYERROR 11
-
-#define NTYPES (TYERROR+1)
-#define        LINTW   12
-#define        LINE    80
-#define        LLOGW   2
-#define        LLOW    1.0
-#define        LHIGH   10.0
-#define        LFW     12
-#define        LFD     8
-#define        LEW     16
-#define        LED     9
-#define        LEE     2
-
-typedef union
-{      short   flshort;
-       ftnint  flint;
-       float   flreal;
-       double  fldouble;
-} flex;
-extern int scale;
-extern int (*lioproc)();
diff --git a/.ref-Research-V7/usr/src/libI77/lread.c b/.ref-Research-V7/usr/src/libI77/lread.c
deleted file mode 100644 (file)
index 2e220f6..0000000
+++ /dev/null
@@ -1,401 +0,0 @@
-#include "fio.h"
-#include "fmt.h"
-#include "lio.h"
-#include "ctype.h"
-extern char *fmtbuf;
-int (*lioproc)();
-
-#define isblnk(x) (ltab[x+1]&B)
-#define issep(x) (ltab[x+1]&SX)
-#define isapos(x) (ltab[x+1]&AX)
-#define isexp(x) (ltab[x+1]&EX)
-#define issign(x) (ltab[x+1]&SG)
-#define SX 1
-#define B 2
-#define AX 4
-#define EX 8
-#define SG 16
-char ltab[128+1]       /* offset one for EOF */
-{      0,
-       0,0,AX,0,0,0,0,0,0,0,B,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       SX|B,0,AX,0,0,0,0,0,0,0,0,SG,SX,SG,0,SX,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0,
-       AX,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,EX,EX,0,0,0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-};
-
-int l_first;
-t_getc()
-{      int ch;
-       if(curunit->uend) return(EOF);
-       if((ch=getc(cf))!=EOF) return(ch);
-       if(feof(cf)) curunit->uend = 1;
-       return(EOF);
-}
-e_rsle()
-{
-       int ch;
-       if(curunit->uend) return(0);
-       while((ch=t_getc())!='\n' && ch!=EOF);
-       return(0);
-}
-
-flag lquit;
-int lcount,ltype;
-char *lchar;
-double lx,ly;
-#define ERR(x) if(n=(x)) return(n)
-#define GETC(x) (x=t_getc())
-
-l_read(number,ptr,len,type) ftnint *number,type; flex *ptr; ftnlen len;
-{      int i,n,ch;
-       double *yy;
-       float *xx;
-       for(i=0;i<*number;i++)
-       {
-               if(curunit->uend) err(elist->ciend, EOF, "list in")
-               if(l_first)
-               {       l_first=0;
-                       for(GETC(ch);isblnk(ch);GETC(ch));
-                       ungetc(ch,cf);
-               }
-               else if(lcount==0)
-               {       ERR(t_sep());
-                       if(lquit) return(0);
-               }
-               switch((int)type)
-               {
-               case TYSHORT:
-               case TYLONG:
-               case TYREAL:
-               case TYDREAL:
-                       ERR(l_R());
-                       break;
-               case TYCOMPLEX:
-               case TYDCOMPLEX:
-                       ERR(l_C());
-                       break;
-               case TYLOGICAL:
-                       ERR(l_L());
-                       break;
-               case TYCHAR:
-                       ERR(l_CHAR());
-                       break;
-               }
-               if(lquit) return(0);
-               if(feof(cf)) err(elist->ciend,(EOF),"list in")
-               else if(ferror(cf))
-               {       clearerr(cf);
-                       err(elist->cierr,errno,"list in")
-               }
-               if(ltype==NULL) goto bump;
-               switch((int)type)
-               {
-               case TYSHORT:
-                       ptr->flshort=lx;
-                       break;
-               case TYLOGICAL:
-               case TYLONG:
-                       ptr->flint=lx;
-                       break;
-               case TYREAL:
-                       ptr->flreal=lx;
-                       break;
-               case TYDREAL:
-                       ptr->fldouble=lx;
-                       break;
-               case TYCOMPLEX:
-                       xx=(float *)ptr;
-                       *xx++ = lx;
-                       *xx = ly;
-                       break;
-               case TYDCOMPLEX:
-                       yy=(double *)ptr;
-                       *yy++ = lx;
-                       *yy = ly;
-                       break;
-               case TYCHAR:
-                       b_char(lchar,(char *)ptr,len);
-                       break;
-               }
-       bump:
-               if(lcount>0) lcount--;
-               ptr = (char *)ptr + len;
-       }
-       return(0);
-}
-l_R()
-{      double a,b,c,d;
-       int i,ch,sign=0,da,db,dc;
-       a=b=c=d=0;
-       da=db=dc=0;
-       if(lcount>0) return(0);
-       ltype=NULL;
-       for(GETC(ch);isblnk(ch);GETC(ch));
-       if(ch==',')
-       {       lcount=1;
-               return(0);
-       }
-       if(ch=='/')
-       {       lquit=1;
-               return(0);
-       }
-       ungetc(ch,cf);
-       da=rd_int(&a);
-       if(da== -1) sign=da;
-       if(GETC(ch)!='*')
-       {       ungetc(ch,cf);
-               db=1;
-               b=a;
-               a=1;
-       }
-       else
-               db=rd_int(&b);
-       if(GETC(ch)!='.')
-       {       dc=c=0;
-               ungetc(ch,cf);
-       }
-       else    dc=rd_int(&c);
-       if(isexp(GETC(ch))) db=rd_int(&d);
-       else if(issign(ch))
-       {       ungetc(ch, cf);
-               db = rd_int(&d);
-       }
-       else
-       {       ungetc(ch,cf);
-               d=0;
-       }
-       lcount=a;
-       if(!db && !dc)
-               return(0);
-       if(db && b<0)
-       {       sign=1;
-               b = -b;
-       }
-       for(i=0;i<dc;i++) c/=10;
-       b=b+c;
-       for(i=0;i<d;i++) b *= 10;
-       for(i=0;i< -d;i++) b /= 10;
-       if(sign) b = -b;
-       ltype=TYLONG;
-       lx=b;
-       return(0);
-}
-rd_int(x) double *x;
-{      int ch,sign=0,i;
-       double y;
-       i=0;
-       y=0;
-       if(GETC(ch)=='-') sign = -1;
-       else if(ch=='+') sign=0;
-       else ungetc(ch,cf);
-       while(isdigit(GETC(ch)))
-       {       i++;
-               y=10*y+ch-'0';
-       }
-       ungetc(ch,cf);
-       if(sign) y = -y;
-       *x = y;
-       return(y!=0?i:sign);
-}
-l_C()
-{      int ch;
-       if(lcount>0) return(0);
-       ltype=NULL;
-       for(GETC(ch);isblnk(ch);GETC(ch));
-       if(ch==',')
-       {       lcount=1;
-               return(0);
-       }
-       if(ch=='/')
-       {       lquit=1;
-               return(0);
-       }
-       if(ch!='(')
-       {       if(fscanf(cf,"%d",&lcount)!=1)
-                       if(!feof(cf)) err(elist->cierr,112,"no rep")
-                       else err(elist->cierr,(EOF),"lread");
-               if(GETC(ch)!='*')
-               {       ungetc(ch,cf);
-                       if(!feof(cf)) err(elist->cierr,112,"no star")
-                       else err(elist->cierr,(EOF),"lread");
-               }
-               if(GETC(ch)!='(')
-               {       ungetc(ch,cf);
-                       return(0);
-               }
-       }
-       lcount = 1;
-       ltype=TYLONG;
-       fscanf(cf,"%lf",&lx);
-       while(isblnk(GETC(ch)));
-       if(ch!=',')
-       {       ungetc(ch,cf);
-               err(elist->cierr,112,"no comma");
-       }
-       while(isblnk(GETC(ch)));
-       ungetc(ch,cf);
-       fscanf(cf,"%lf",&ly);
-       while(isblnk(GETC(ch)));
-       if(ch!=')') err(elist->cierr,112,"no )");
-       while(isblnk(GETC(ch)));
-       ungetc(ch,cf);
-       return(0);
-}
-l_L()
-{
-       int ch;
-       if(lcount>0) return(0);
-       ltype=NULL;
-       while(isblnk(GETC(ch)));
-       if(ch==',')
-       {       lcount=1;
-               return(0);
-       }
-       if(ch=='/')
-       {       lquit=1;
-               return(0);
-       }
-       if(isdigit(ch))
-       {       ungetc(ch,cf);
-               fscanf(cf,"%d",&lcount);
-               if(GETC(ch)!='*')
-                       if(!feof(cf)) err(elist->cierr,112,"no star")
-                       else err(elist->cierr,(EOF),"lread");
-       }
-       else    ungetc(ch,cf);
-       if(GETC(ch)=='.') GETC(ch);
-       switch(ch)
-       {
-       case 't':
-       case 'T':
-               lx=1;
-               break;
-       case 'f':
-       case 'F':
-               lx=0;
-               break;
-       default:
-               if(isblnk(ch) || issep(ch) || ch==EOF)
-               {       ungetc(ch,cf);
-                       return(0);
-               }
-               else    err(elist->cierr,112,"logical");
-       }
-       ltype=TYLONG;
-       while(!issep(GETC(ch)) && ch!='\n' && ch!=EOF);
-       return(0);
-}
-#define BUFSIZE        128
-l_CHAR()
-{      int ch,size,i;
-       char quote,*p;
-       if(lcount>0) return(0);
-       ltype=NULL;
-
-       while(isblnk(GETC(ch)));
-       if(ch==',')
-       {       lcount=1;
-               return(0);
-       }
-       if(ch=='/')
-       {       lquit=1;
-               return(0);
-       }
-       if(isdigit(ch))
-       {       ungetc(ch,cf);
-               fscanf(cf,"%d",&lcount);
-               if(GETC(ch)!='*') err(elist->cierr,112,"no star");
-       }
-       else    ungetc(ch,cf);
-       if(GETC(ch)=='\'' || ch=='"') quote=ch;
-       else if(isblnk(ch) || issep(ch) || ch==EOF)
-       {       ungetc(ch,cf);
-               return(0);
-       }
-       else err(elist->cierr,112,"no quote");
-       ltype=TYCHAR;
-       if(lchar!=NULL) free(lchar);
-       size=BUFSIZE;
-       p=lchar=(char *)malloc(size);
-       if(lchar==NULL) err(elist->cierr,113,"no space");
-       for(i=0;;)
-       {       while(GETC(ch)!=quote && ch!='\n'
-                       && ch!=EOF && ++i<size) *p++ = ch;
-               if(i==size)
-               {
-               newone:
-                       lchar=(char *)realloc(lchar, size += BUFSIZE);
-                       p=lchar+i-1;
-                       *p++ = ch;
-               }
-               else if(ch==EOF) return(EOF);
-               else if(ch=='\n')
-               {       if(*(p-1) != '\\') continue;
-                       i--;
-                       p--;
-                       if(++i<size) *p++ = ch;
-                       else goto newone;
-               }
-               else if(GETC(ch)==quote)
-               {       if(++i<size) *p++ = ch;
-                       else goto newone;
-               }
-               else
-               {       ungetc(ch,cf);
-                       *p++ = 0;
-                       return(0);
-               }
-       }
-}
-s_rsle(a) cilist *a;
-{
-       int n;
-       if(!init) f_init();
-       if(n=c_le(a,READ)) return(n);
-       reading=1;
-       external=1;
-       formatted=1;
-       l_first=1;
-       lioproc = l_read;
-       lcount = 0;
-       if(curunit->uwrt)
-               return(nowreading(curunit));
-       else    return(0);
-}
-t_sep()
-{
-       int ch;
-       for(GETC(ch);isblnk(ch);GETC(ch));
-       if(ch == EOF)
-               if(feof(cf)) return(EOF);
-               else return(errno);
-       if(ch=='/')
-       {       lquit=1;
-               return(0);
-       }
-       if(ch==',') for(GETC(ch);isblnk(ch);GETC(ch));
-       ungetc(ch,cf);
-       return(0);
-}
-c_le(a,flag) cilist *a;
-{
-       fmtbuf="list io";
-       if(a->ciunit>=MXUNIT || a->ciunit<0)
-               err(a->cierr,101,"stler");
-       scale=recpos=0;
-       elist=a;
-       curunit = &units[a->ciunit];
-       if(curunit->ufd==NULL && fk_open(flag,SEQ,FMT,a->ciunit))
-               err(a->cierr,102,"lio");
-       cf=curunit->ufd;
-       if(!curunit->ufmt) err(a->cierr,103,"lio")
-       return(0);
-}
-do_lio(type,number,ptr,len) ftnint *number,*type; flex *ptr; ftnlen len;
-{
-       return((*lioproc)(number,ptr,len,*type));
-}
diff --git a/.ref-Research-V7/usr/src/libI77/mklib b/.ref-Research-V7/usr/src/libI77/mklib
deleted file mode 100755 (executable)
index afcbb39..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-ar rc libI77.a \
-backspace.o \
-dfe.o \
-due.o \
-iio.o \
-inquire.o \
-lib.o \
-rewind.o \
-rsfe.o \
-rdfmt.o \
-sue.o \
-uio.o \
-wsfe.o \
-sfe.o \
-fmt.o \
-lio.o \
-lread.o \
-open.o \
-close.o \
-util.o \
-endfile.o \
-wrtfmt.o \
-err.o \
-fmtlib.o \
-dballoc.o
diff --git a/.ref-Research-V7/usr/src/libI77/open.c b/.ref-Research-V7/usr/src/libI77/open.c
deleted file mode 100644 (file)
index 69297fb..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include       "sys/types.h"
-#include       "sys/stat.h"
-#include "fio.h"
-f_open(a) olist *a;
-{      unit *b;
-       int n;
-       char buf[256];
-       cllist x;
-       if(a->ounit>=MXUNIT || a->ounit<0)
-               err(a->oerr,101,"open")
-       b= &units[a->ounit];
-       if(b->ufd!=0) goto connected;
-unconnected:
-       b->url=a->orl;
-       if(*a->oblnk=='b') b->ublnk=1;
-       else b->ublnk=0;
-       if(a->ofm==0)
-       {       if(b->url>0) b->ufmt=0;
-               else b->ufmt=1;
-       }
-       else if(*a->ofm=='f') b->ufmt=1;
-       else b->ufmt=0;
-       if(a->osta==0) goto unknown;
-       switch(*a->osta)
-       {
-       unknown:
-       default:
-       case 'o':
-               if(a->ofnm==0) err(a->oerr,107,"open")
-               g_char(a->ofnm,a->ofnmlen,buf);
-               b->uscrtch=0;
-               if(*a->osta=='o' && access(buf,0))
-                       err(a->oerr,errno,"open")
-       done:
-               b->ufnm=(char *) calloc(strlen(buf)+1,sizeof(char));
-               if(b->ufnm==NULL) err(a->oerr,113,"no space");
-               strcpy(b->ufnm,buf);
-               b->uend=0;
-               if(isdev(buf))
-               {       b->ufd = fopen(buf,"r");
-                       if(b->ufd==NULL) err(a->oerr,errno,buf)
-                       else    b->uwrt = 0;
-               }
-               else
-               {       b->ufd = fopen(buf, "a");
-                       if(b->ufd != NULL) b->uwrt = 1;
-                       else if((b->ufd = fopen(buf, "r")) != NULL)
-                       {       fseek(b->ufd, 0L, 2);
-                               b->uwrt = 0;
-                       }
-                       else    err(a->oerr, errno, buf)
-               }
-               b->useek=canseek(b->ufd);
-               if((b->uinode=inode(buf))==-1)
-                       err(a->oerr,108,"open")
-               if(a->orl && b->useek) rewind(b->ufd);
-               return(0);
-        case 's':
-               b->uscrtch=1;
-               strcpy(buf,"tmp.FXXXXXX");
-               mktemp(buf);
-               goto done;
-       case 'n':
-               b->uscrtch=0;
-               if(a->ofnm==0) err(a->oerr,107,"open")
-               g_char(a->ofnm,a->ofnmlen,buf);
-               /*SYSDEP access*/
-               if(access(buf, 0) == 0) creat(buf, 0666);
-               goto done;
-       }
-connected:
-       if(a->ofnm==0)
-       {
-       same:   if(a->oblnk!= 0) b->ublnk= *a->oblnk== 'b'?0:1;
-               return(0);
-       }
-       g_char(a->ofnm,a->ofnmlen,buf);
-       if(inode(buf)==b->uinode) goto same;
-       x.cunit=a->ounit;
-       x.csta=0;
-       x.cerr=a->oerr;
-       if((n=f_clos(&x))!=0) return(n);
-       goto unconnected;
-}
-fk_open(rd,seq,fmt,n) ftnint n;
-{      char nbuf[10];
-       olist a;
-       sprintf(nbuf,"fort.%D",n);
-       a.oerr=1;
-       a.ounit=n;
-       a.ofnm=nbuf;
-       a.ofnmlen=strlen(nbuf);
-       a.osta=NULL;
-       a.oacc= seq==SEQ?"s":"d";
-       a.ofm = fmt==FMT?"f":"u";
-       a.orl = seq==DIR?1:0;
-       a.oblnk=NULL;
-       return(f_open(&a));
-}
-isdev(s) char *s;
-{      struct stat x;
-       int j;
-       if(stat(s, &x) == -1) return(0);
-       if((j = (x.st_mode&S_IFMT)) == S_IFREG || j == S_IFDIR) return(0);
-       else    return(1);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/rdfmt.c b/.ref-Research-V7/usr/src/libI77/rdfmt.c
deleted file mode 100644 (file)
index 9bdd49c..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-#include "fio.h"
-#include "fmt.h"
-extern int cursor;
-rd_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len;
-{      int ch;
-       for(;cursor>0;cursor--) if((ch=(*getn)())<0) return(ch);
-       if(cursor<0)
-       {       if(recpos+cursor < 0) err(elist->cierr,110,"fmt")
-               if(curunit->useek) fseek(cf,(long) cursor,1);
-               else err(elist->cierr,106,"fmt");
-               cursor=0;
-       }
-       switch(p->op)
-       {
-       default: fprintf(stderr,"rd_ed, unexpected code: %d\n%s\n",
-                       p->op,fmtbuf);
-               abort();
-       case I: ch = (rd_I(ptr,p->p1,len, 10));
-               break;
-       case IM: ch = (rd_I(ptr,p->p1,len, 10));
-               break;
-       case O: ch = (rd_I(ptr, p->p1, len, 8));
-               break;
-       case L: ch = (rd_L(ptr,p->p1));
-               break;
-       case A: ch = (rd_A(ptr,len));
-               break;
-       case AW:
-               ch = (rd_AW(ptr,p->p1,len));
-               break;
-       case E: case EE:
-       case D:
-       case G:
-       case GE:
-       case F: ch = (rd_F(ptr,p->p1,p->p2,len));
-               break;
-       }
-       if(ch == 0) return(ch);
-       else if(feof(cf)) return(EOF);
-       clearerr(cf);
-       return(errno);
-}
-rd_ned(p,ptr) char *ptr; struct syl *p;
-{
-       switch(p->op)
-       {
-       default: fprintf(stderr,"rd_ned, unexpected code: %d\n%s\n",
-                       p->op,fmtbuf);
-               abort();
-       case APOS:
-               return(rd_POS(p->p1));
-       case H: return(rd_H(p->p1,p->p2));
-       case SLASH: return((*donewrec)());
-       case TR:
-       case X: cursor += p->p1;
-               return(1);
-       case T: cursor=p->p1-recpos;
-               return(1);
-       case TL: cursor -= p->p1;
-               return(1);
-       }
-}
-rd_I(n,w,len, base) ftnlen len; uint *n; register int base;
-{      long x=0;
-       int i,sign=0,ch;
-       for(i=0;i<w;i++)
-       {
-               if((ch=(*getn)())<0) return(ch);
-               switch(ch)
-               {
-               default:
-                       return(errno=115);
-               case ',': goto done;
-               case '+': break;
-               case '-':
-                       sign=1;
-                       break;
-               case '\n':
-               case ' ':
-                       if(cblank) x *= base;
-                       break;
-               case '0': case '1': case '2': case '3': case '4':
-               case '5': case '6': case '7': case '8': case '9':
-                       x=base*x+ch-'0';
-                       break;
-               }
-       }
-done:
-       if(sign) x = -x;
-       if(len==sizeof(short)) n->is=x;
-       else if(len == sizeof(char)) n->ic = x;
-       else n->il=x;
-       return(0);
-}
-rd_L(n,w) ftnint *n;
-{      int ch,i,v = -1;
-       for(i=0;i<w;i++)
-       {       if((ch=(*getn)())<0) return(ch);
-               if(ch=='t' && v==-1) v=1;
-               else if(ch=='f' && v==-1) v=0;
-               else if(ch==',') return(0);
-       }
-       if(v==-1)
-       {       errno=116;
-               return(1);
-       }
-       *n=v;
-       return(0);
-}
-rd_F(p,w,d,len) ftnlen len; ufloat *p;
-{      double x,y;
-       int i,sx,sz,ch,dot,ny,z,sawz;
-       x=y=0;
-       sawz=z=ny=dot=sx=sz=0;
-       for(i=0;i<w;)
-       {       i++;
-               if((ch=(*getn)())<0) return(ch);
-               else if(ch == ' ' && !cblank || ch == '+' && x == 0
-                       || ch == '\n' && !cblank) continue;
-               else if(ch=='-' && x==0) sx=1;
-               else if(ch == '+' || ch == '-') goto expon;
-               else if(ch<='9' && ch>='0')
-                       x=10*x+ch-'0';
-               else if(ch=='e' || ch=='d' || ch=='.')
-                       break;
-               else if(cblank && (ch==' ' || ch== '\n')) x*=10;
-               else if(ch==',')
-               {       i=w;
-                       break;
-               }
-               else return(errno = 115);
-       }
-       if(ch=='.') dot=1;
-       while(i<w && ch!='e' && ch!='d' && ch!='+' && ch!='-')
-       {       i++;
-               if((ch=(*getn)())<0) return(ch);
-               else if(ch<='9' && ch>='0')
-                       y=10*y+ch-'0';
-               else if(cblank && (ch==' ' || ch == '\n'))
-                       y *= 10;
-               else if(ch==',') {i=w; break;}
-               else if(ch==' ') continue;
-               else continue;
-               ny++;
-       }
-expon:
-       if(ch=='-') sz=1;
-       while(i<w)
-       {       i++;
-               sawz=1;
-               if((ch=(*getn)())<0) return(ch);
-               else if(ch=='-') sz=1;
-               else if(ch<='9' && ch>='0')
-                       z=10*z+ch-'0';
-               else if(cblank && (ch==' ' || ch == '\n'))
-                       z *= 10;
-               else if(ch==',') break;
-               else if(ch==' ') continue;
-               else if(ch=='+') continue;
-               else if(ch!='\n') return(errno=115);
-       }
-       if(!dot)
-               for(i=0;i<d;i++) x /= 10;
-       for(i=0;i<ny;i++) y /= 10;
-       x=x+y;
-       if(sz)
-               for(i=0;i<z;i++) x /=10;
-       else    for(i=0;i<z;i++) x *= 10;
-       if(sx) x = -x;
-       if(!sawz)
-       {
-               for(i=scale;i>0;i--) x /= 10;
-               for(i=scale;i<0;i++) x *= 10;
-       }
-       if(len==sizeof(float)) p->pf=x;
-       else p->pd=x;
-       return(0);
-}
-rd_A(p,len) char *p; ftnlen len;
-{      int i,ch;
-       for(i=0;i<len;i++)
-       {       GET(ch);
-               *p++=VAL(ch);
-       }
-       return(0);
-}
-rd_AW(p,w,len) char *p; ftnlen len;
-{      int i,ch;
-       if(w>=len)
-       {       for(i=0;i<w-len;i++)
-                       GET(ch);
-               for(i=0;i<len;i++)
-               {       GET(ch);
-                       *p++=VAL(ch);
-               }
-               return(0);
-       }
-       for(i=0;i<w;i++)
-       {       GET(ch);
-               *p++=VAL(ch);
-       }
-       for(i=0;i<len-w;i++) *p++=' ';
-       return(0);
-}
-rd_H(n,s) char *s;
-{      int i,ch;
-       for(i=0;i<n;i++)
-               if((ch=(*getn)())<0) return(ch);
-               else *s++ = ch=='\n'?' ':ch;
-       return(1);
-}
-rd_POS(s) char *s;
-{      char quote;
-       int ch;
-       quote= *s++;
-       for(;*s;s++)
-               if(*s==quote && *(s+1)!=quote) break;
-               else if((ch=(*getn)())<0) return(ch);
-               else *s = ch=='\n'?' ':ch;
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/rewind.c b/.ref-Research-V7/usr/src/libI77/rewind.c
deleted file mode 100644 (file)
index 3d76887..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "fio.h"
-f_rew(a) alist *a;
-{
-       unit *b;
-       if(a->aunit>=MXUNIT || a->aunit<0) err(a->aerr,101,"rewind");
-       b = &units[a->aunit];
-       if(b->ufd == NULL) return(0);
-       if(!b->useek) err(a->aerr,106,"rewind")
-       if(b->uwrt)
-       {       nowreading(b);
-               t_runc(b);
-       }
-       rewind(b->ufd);
-       b->uend=0;
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/rsfe.c b/.ref-Research-V7/usr/src/libI77/rsfe.c
deleted file mode 100644 (file)
index 9532957..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/* read sequential formatted external */
-#include "fio.h"
-#include "fmt.h"
-extern int x_getc(),rd_ed(),rd_ned();
-extern int x_endp(),x_rev(),xrd_SL();
-s_rsfe(a) cilist *a; /* start */
-{      int n;
-       if(!init) f_init();
-       if(n=c_sfe(a,READ)) return(n);
-       reading=1;
-       sequential=1;
-       formatted=1;
-       external=1;
-       elist=a;
-       cursor=recpos=0;
-       scale=0;
-       fmtbuf=a->cifmt;
-       if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio");
-       curunit= &units[a->ciunit];
-       cf=curunit->ufd;
-       getn= x_getc;
-       doed= rd_ed;
-       doned= rd_ned;
-       fmt_bg();
-       doend=x_endp;
-       donewrec=xrd_SL;
-       dorevert=x_rev;
-       cblank=curunit->ublnk;
-       cplus=0;
-       if(curunit->uwrt) nowreading(curunit);
-       return(0);
-}
-xrd_SL()
-{      int ch;
-       if(!curunit->uend)
-               while((ch=getc(cf))!='\n' && ch!=EOF);
-       cursor=recpos=0;
-       return(1);
-}
-x_getc()
-{      int ch;
-       if(curunit->uend) return(EOF);
-       if((ch=getc(cf))!=EOF && ch!='\n')
-       {       recpos++;
-               return(ch);
-       }
-       if(ch=='\n')
-       {       ungetc(ch,cf);
-               return(ch);
-       }
-       if(feof(cf))
-       {       errno=0;
-               curunit->uend=1;
-               return(-1);
-       }
-       return(-1);
-}
-x_endp()
-{
-       xrd_SL();
-       return(0);
-}
-x_rev()
-{
-       xrd_SL();
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/sfe.c b/.ref-Research-V7/usr/src/libI77/sfe.c
deleted file mode 100644 (file)
index b473ed3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/* sequential formatted external common routines*/
-#include "fio.h"
-extern char *fmtbuf;
-e_rsfe()
-{      int n;
-       n=en_fio();
-       fmtbuf=NULL;
-       return(n);
-}
-c_sfe(a,flag) cilist *a; /* check */
-{      unit *p;
-       if(a->ciunit >= MXUNIT || a->ciunit<0)
-               err(a->cierr,101,"startio");
-       p = &units[a->ciunit];
-       if(p->ufd==NULL && fk_open(flag,SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe")
-       if(!p->ufmt) err(a->cierr,102,"sfe")
-       return(0);
-}
-e_wsfe()
-{      return(e_rsfe());
-}
diff --git a/.ref-Research-V7/usr/src/libI77/sue.c b/.ref-Research-V7/usr/src/libI77/sue.c
deleted file mode 100644 (file)
index 16b217a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "fio.h"
-extern int reclen;
-long recloc;
-s_rsue(a) cilist *a;
-{
-       int n;
-       if(!init) f_init();
-       if(n=c_sue(a,READ)) return(n);
-       reading=1;
-       recpos=0;
-       if(curunit->uwrt) nowreading(curunit);
-       if(fread(&reclen,sizeof(int),1,cf)
-               != 1)
-       {       if(feof(cf))
-               {       curunit->uend = 1;
-                       err(a->ciend, EOF, "start");
-               }
-               clearerr(cf);
-               err(a->cierr, errno, "start");
-       }
-       return(0);
-}
-s_wsue(a) cilist *a;
-{
-       int n;
-       if(!init) f_init();
-       if(n=c_sue(a,WRITE)) return(n);
-       reading=0;
-       reclen=0;
-       if(!curunit->uwrt) nowwriting(curunit);
-       recloc=ftell(cf);
-       fseek(cf,(long)sizeof(int),1);
-       return(0);
-}
-c_sue(a,flag) cilist *a;
-{
-       if(a->ciunit >= MXUNIT || a->ciunit < 0)
-               err(a->cierr,101,"startio");
-       external=sequential=1;
-       formatted=0;
-       curunit = &units[a->ciunit];
-       elist=a;
-       if(curunit->ufd==NULL && fk_open(flag,SEQ,UNF,a->ciunit))
-               err(a->cierr,114,"sue");
-       cf=curunit->ufd;
-       if(curunit->ufmt) err(a->cierr,103,"sue")
-       if(!curunit->useek) err(a->cierr,103,"sue")
-       return(0);
-}
-e_wsue()
-{      long loc;
-       fwrite(&reclen,sizeof(int),1,cf);
-       loc=ftell(cf);
-       fseek(cf,recloc,0);
-       fwrite(&reclen,sizeof(int),1,cf);
-       fseek(cf,loc,0);
-       return(0);
-}
-e_rsue()
-{
-       fseek(cf,(long)(reclen-recpos+sizeof(int)),1);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/uio.c b/.ref-Research-V7/usr/src/libI77/uio.c
deleted file mode 100644 (file)
index 2e3e787..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "fio.h"
-int reclen;
-do_us(number,ptr,len) ftnint *number; ftnlen len; char *ptr;
-{
-       if(reading)
-       {
-               recpos += *number * len;
-               if(recpos>reclen)
-               {
-                       err(elist->cierr,110,"eof/uio");
-               }
-               fread(ptr,(int)len,(int)(*number),cf);
-               return(0);
-       }
-       else
-       {
-               reclen += *number * len;
-               fwrite(ptr,(int)len,(int)(*number),cf);
-               return(0);
-       }
-}
-do_uio(number,ptr,len) ftnint *number; ftnlen len; char *ptr;
-{
-       if(sequential)
-               return(do_us(number,ptr,len));
-       else    return(do_ud(number,ptr,len));
-}
-do_ud(number,ptr,len) ftnint *number; ftnlen len; char *ptr;
-{
-       recpos += *number * len;
-       if(recpos > curunit->url && curunit->url!=1)
-               err(elist->cierr,110,"eof/uio");
-       if(reading)
-       {
-               if(fread(ptr,(int)len,(int)(*number),cf)
-                       != *number)
-                       err(elist->cierr,errno,"eof/uio")
-               else return(0);
-       }
-       fwrite(ptr,(int)len,(int)(*number),cf);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/util.c b/.ref-Research-V7/usr/src/libI77/util.c
deleted file mode 100644 (file)
index ff5cffa..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/dir.h>
-#include "fio.h"
-#define DIRSIZE        14
-g_char(a,alen,b) char *a,*b; ftnlen alen;
-{      char *x=a+alen-1,*y=b+alen-1;
-       *(y+1)=0;
-       for(;x>=a && *x==' ';x--) *y--=0;
-       for(;x>=a;*y--= *x--);
-}
-b_char(a,b,blen) char *a,*b; ftnlen blen;
-{      int i;
-       for(i=0;i<blen && *a!=0;i++) *b++= *a++;
-       for(;i<blen;i++) *b++=' ';
-}
-inode(a) char *a;
-{      struct stat x;
-       if(stat(a,&x)<0) return(-1);
-       return(x.st_ino);
-}
-#define DONE {*bufpos++=0; close(file); return;}
-#define INTBOUND sizeof(int)-1
-#define register 
-mvgbt(n,len,a,b) char *a,*b;
-{      register int num=n*len;
-       if( ((int)a&INTBOUND)==0 && ((int)b&INTBOUND)==0 && (num&INTBOUND)==0 )
-       {       register int *x=(int *)a,*y=(int *)b;
-               num /= sizeof(int);
-               if(x>y) for(;num>0;num--) *y++= *x++;
-               else for(num--;num>=0;num--) *(y+num)= *(x+num);
-       }
-       else
-       {       register char *x=a,*y=b;
-               if(x>y) for(;num>0;num--) *y++= *x++;
-               else for(num--;num>=0;num--) *(y+num)= *(x+num);
-       }
-}
-char *curdir()
-{      char name[256],*bufpos = name;
-       struct stat x;
-       struct direct y;
-       int file,i;
-       *bufpos++ = 0;
-loop:  stat(".",&x);
-       if((file=open("..",0))<0) goto done;
-       do
-       {       if(read(file,&y,sizeof(y))<sizeof(y)) goto done;
-       } while(y.d_ino!=x.st_ino);
-       close(file);
-       if(y.d_ino!=2)
-       {       dcat(name,y.d_name);
-               chdir("..");
-               goto loop;
-       }
-       if(stat(y.d_name,&x)<0 || chdir("/")<0
-               || (file=open("/",0))<0) goto done;
-       i=x.st_dev;
-       do
-       {       if(read(file,&y,sizeof(y))<sizeof(y)) goto done;
-               if(y.d_ino==0) continue;
-               if(stat(y.d_name,&x)<0) goto done;
-       } while(x.st_dev!=i || (x.st_mode&S_IFMT)!=S_IFDIR);
-       if(strcmp(".",y.d_name) || strcmp("..",y.d_name))
-               dcat(name,y.d_name);
-       dcat(name,"/");
-done:
-       bufpos=calloc(strlen(name)+1,1);
-       strcpy(bufpos,name);
-       chdir(name);
-       close(file);
-       return(bufpos);
-}
-dcat(a,b) char *a,*b;
-{
-       int i,j;
-       i=strlen(b);
-       j=strlen(a);
-       mvgbt(1,j+1,a,a+i+1);
-       mvgbt(1,i,b,a);
-       a[i]='/';
-}
-fullpath(a,b,errflag) char *a,*b;
-{
-       char *a1,*a2,*npart,*dpart,*p;
-       a1=curdir();
-       npart=NULL;
-       for(p=a;*p!=0;p++)
-               if(*p=='/') npart=p;
-       if(npart==NULL)
-       {       dpart=NULL;
-               npart=a;
-       }
-       else
-       {       dpart=a;
-               *npart++ = 0;
-       }
-       if(dpart!=NULL)
-       {       chdir(dpart);
-               a2=curdir();
-               strcpy(b,a2);
-       }
-       else
-       {       a2=NULL;
-               strcpy(b, a1);
-       }
-       strcat(b,npart);
-       chdir(a1);
-       if(a1!=NULL)
-       {       free(a1);
-               a1=NULL;
-       }
-       if(a2!=NULL)
-       {       free(a2);
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/wrtfmt.c b/.ref-Research-V7/usr/src/libI77/wrtfmt.c
deleted file mode 100644 (file)
index 5334378..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-#include "fio.h"
-#include "fmt.h"
-extern int cursor;
-mv_cur()
-{      /*buggy, could move off front of record*/
-       for(;cursor>0;cursor--) (*putn)(' ');
-       if(cursor<0)
-       {
-               if(cursor+recpos<0) err(elist->cierr,110,"left off");
-               if(curunit->useek) fseek(cf,(long)cursor,1);
-               else err(elist->cierr,106,"fmt");
-               cursor=0;
-       }
-       return(0);
-}
-w_ed(p,ptr,len) char *ptr; struct syl *p; ftnlen len;
-{
-       if(mv_cur()) return(mv_cur());
-       switch(p->op)
-       {
-       default:
-               fprintf(stderr,"w_ed, unexpected code: %d\n%s\n",
-                       p->op,fmtbuf);
-               abort();
-       case I: return(wrt_I(ptr,p->p1,len, 10));
-       case IM:
-               return(wrt_IM(ptr,p->p1,p->p2,len));
-       case O: return(wrt_I(ptr, p->p1, len, 8));
-       case L: return(wrt_L(ptr,p->p1));
-       case A: return(wrt_A(ptr,len));
-       case AW:
-               return(wrt_AW(ptr,p->p1,len));
-       case D:
-       case E:
-       case EE:
-               return(wrt_E(ptr,p->p1,p->p2,p->p3,len));
-       case G:
-       case GE:
-               return(wrt_G(ptr,p->p1,p->p2,p->p3,len));
-       case F: return(wrt_F(ptr,p->p1,p->p2,len));
-       }
-}
-w_ned(p,ptr) char *ptr; struct syl *p;
-{
-       switch(p->op)
-       {
-       default: fprintf(stderr,"w_ned, unexpected code: %d\n%s\n",
-                       p->op,fmtbuf);
-               abort();
-       case SLASH:
-               return((*donewrec)());
-       case T: cursor = p->p1-recpos;
-               return(1);
-       case TL: cursor -= p->p1;
-               return(1);
-       case TR:
-       case X:
-               cursor += p->p1;
-               return(1);
-       case APOS:
-               return(wrt_AP(p->p1));
-       case H:
-               return(wrt_H(p->p1,p->p2));
-       }
-}
-wrt_I(n,w,len, base) uint *n; ftnlen len; register int base;
-{      int ndigit,sign,spare,i;
-       long x;
-       char *ans;
-       if(len==sizeof(short)) x=n->is;
-       else if(len == sizeof(char)) x = n->ic;
-       else x=n->il;
-       ans=icvt(x,&ndigit,&sign, base);
-       spare=w-ndigit;
-       if(sign || cplus) spare--;
-       if(spare<0)
-               for(i=0;i<len;i++) (*putn)('*');
-       else
-       {       for(i=0;i<spare;i++) (*putn)(' ');
-               if(sign) (*putn)('-');
-               else if(cplus) (*putn)('+');
-               for(i=0;i<ndigit;i++) (*putn)(*ans++);
-       }
-       return(0);
-}
-wrt_IM(n,w,m,len) uint *n; ftnlen len;
-{      int ndigit,sign,spare,i,xsign;
-       long x;
-       char *ans;
-       if(sizeof(short)==len) x=n->is;
-       else if(len == sizeof(char)) x = n->ic;
-       else x=n->il;
-       ans=icvt(x,&ndigit,&sign);
-       if(sign || cplus) xsign=1;
-       else xsign=0;
-       if(ndigit+xsign>w || m+xsign>w)
-       {       for(i=0;i<w;i++) (*putn)('*');
-               return(0);
-       }
-       if(x==0 && m==0)
-       {       for(i=0;i<w;i++) (*putn)(' ');
-               return(0);
-       }
-       if(ndigit>=m)
-               spare=w-ndigit-xsign;
-       else
-               spare=w-m-xsign;
-       for(i=0;i<spare;i++) (*putn)(' ');
-       if(sign) (*putn)('-');
-       else if(cplus) (*putn)('+');
-       for(i=0;i<m-ndigit;i++) (*putn)('0');
-       for(i=0;i<ndigit;i++) (*putn)(*ans++);
-       return(0);
-}
-wrt_AP(n)
-{      char *s,quote;
-       if(mv_cur()) return(mv_cur());
-       s=(char *)n;
-       quote = *s++;
-       for(;*s;s++)
-       {       if(*s!=quote) (*putn)(*s);
-               else if(*++s==quote) (*putn)(*s);
-               else return(1);
-       }
-       return(1);
-}
-wrt_H(a,b)
-{      char *s=(char *)b;
-       if(mv_cur()) return(mv_cur());
-       while(a--) (*putn)(*s++);
-       return(1);
-}
-wrt_L(n,len) ftnint *n;
-{      int i;
-       for(i=0;i<len-1;i++)
-               (*putn)(' ');
-       if(*n) (*putn)('t');
-       else (*putn)('f');
-       return(0);
-}
-wrt_A(p,len) char *p; ftnlen len;
-{
-       while(len-- > 0) (*putn)(*p++);
-       return(0);
-}
-wrt_AW(p,w,len) char * p; ftnlen len;
-{
-       while(w>len)
-       {       w--;
-               (*putn)(' ');
-       }
-       while(w-- > 0)
-               (*putn)(*p++);
-       return(0);
-}
-wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
-{      char *s;
-       int dp,sign,i,delta;
-       char *ecvt();
-       if(scale>0) d++;
-       s=ecvt( (len==sizeof(float)?p->pf:p->pd) ,d,&dp,&sign);
-       if(sign || cplus) delta=6;
-       else delta=5;
-       if(w<delta+d)
-       {       for(i=0;i<w;i++) (*putn)('*');
-               return(0);
-       }
-       for(i=0;i<w-(delta+d);i++) (*putn)(' ');
-       if(sign) (*putn)('-');
-       else if(cplus) (*putn)('+');
-       if(scale<0 && scale > -d)
-       {
-               (*putn)('.');
-               for(i=0;i<-scale;i++)
-                       (*putn)('0');
-               for(i=0;i<d+scale;i++)
-                       (*putn)(*s++);
-       }
-       else if(scale>0 && scale<d+2)
-       {       for(i=0;i<scale;i++)
-                       (*putn)(*s++);
-               (*putn)('.');
-               for(i=0;i<d-scale;i++)
-                       (*putn)(*s++);
-       }
-       else
-       {       (*putn)('.');
-               for(i=0;i<d;i++) (*putn)(*s++);
-       }
-       if(p->pf != 0) dp -= scale;
-       else    dp = 0;
-       if(dp < 100 && dp > -100) (*putn)('e');
-       if(dp<0)
-       {       (*putn)('-');
-               dp = -dp;
-       }
-       else    (*putn)('+');
-       if(e>=3 || dp >= 100)
-       {       (*putn)(dp/100 + '0');
-               dp = dp % 100;
-       }
-       if(e!=1) (*putn)(dp/10+'0');
-       (*putn)(dp%10+'0');
-       return(0);
-}
-wrt_G(p,w,d,e,len) ufloat *p; ftnlen len;
-{      double up = 1,x;
-       int i,oldscale=scale,n,j;
-       x= len==sizeof(float)?p->pf:p->pd;
-       if(x < 0 ) x = -x;
-       if(x<.1) return(wrt_E(p,w,d,e,len));
-       for(i=0;i<=d;i++,up*=10)
-       {       if(x>up) continue;
-               scale=0;
-               if(e==0) n=4;
-               else    n=e+2;
-               i=wrt_F(p,w-n,d-i,len);
-               for(j=0;j<n;j++) (*putn)(' ');
-               scale=oldscale;
-               return(i);
-       }
-       return(wrt_E(p,w,d,e,len));
-}
-wrt_F(p,w,d,len) ufloat *p; ftnlen len;
-{      int i,delta,dp,sign,n;
-       double x;
-       char *s,*fcvt();
-       x= (len==sizeof(float)?p->pf:p->pd);
-       if(scale)
-       {       if(scale>0)
-                       for(i=0;i<scale;i++) x*=10;
-               else    for(i=0;i<-scale;i++) x/=10;
-       }
-       s=fcvt(x,d,&dp,&sign);
-       if(-dp>=d) sign=0;
-       if(sign || cplus) delta=2;
-       else delta=1;
-       n= w - (d+delta+(dp>0?dp:0));
-       if(n<0)
-       {
-               for(i=0;i<w;i++) PUT('*');
-               return(0);
-       }
-       for(i=0;i<n;i++) PUT(' ');
-       if(sign) PUT('-');
-       else if(cplus) PUT('+');
-       for(i=0;i<dp;i++) PUT(*s++);
-       PUT('.');
-       for(i=0;i< -dp && i<d;i++) PUT('0');
-       for(;i<d;i++)
-       {       if(*s) PUT(*s++);
-               else PUT('0');
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libI77/wsfe.c b/.ref-Research-V7/usr/src/libI77/wsfe.c
deleted file mode 100644 (file)
index 5b64244..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*write sequential formatted external*/
-#include "fio.h"
-#include "fmt.h"
-extern int x_putc(),w_ed(),w_ned();
-extern int xw_end(),xw_rev(),x_wSL();
-s_wsfe(a) cilist *a;   /*start*/
-{      int n;
-       if(!init) f_init();
-       if(n=c_sfe(a,WRITE)) return(n);
-       reading=0;
-       sequential=1;
-       formatted=1;
-       external=1;
-       elist=a;
-       cursor=recpos=0;
-       scale=0;
-       fmtbuf=a->cifmt;
-       if(pars_f(fmtbuf)<0) err(a->cierr,100,"startio");
-       curunit = &units[a->ciunit];
-       cf=curunit->ufd;
-       putn= x_putc;
-       doed= w_ed;
-       doned= w_ned;
-       doend=xw_end;
-       dorevert=xw_rev;
-       donewrec=x_wSL;
-       fmt_bg();
-       cplus=0;
-       cblank=curunit->ublnk;
-       if(!curunit->uwrt) nowwriting(curunit);
-       return(0);
-}
-x_putc(c)
-{
-       recpos++;
-       putc(c,cf);
-}
-pr_put(c)
-{      static flag new = 1;
-       recpos++;
-       if(c=='\n')
-       {       new=1;
-               putc(c,cf);
-       }
-       else if(new==1)
-       {       new=0;
-               if(c=='0') putc('\n',cf);
-               else if(c=='1') putc('\f',cf);
-       }
-       else putc(c,cf);
-}
-x_wSL()
-{
-       recpos=0;
-       cursor = 0;
-       (*putn)('\n');
-       return(1);
-}
-xw_end()
-{
-       (*putn)('\n');
-       return(0);
-}
-xw_rev()
-{
-       if(workdone) (*putn)('\n');
-       return(workdone=0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/compall b/.ref-Research-V7/usr/src/libc/compall
deleted file mode 100755 (executable)
index 7bf3abf..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-cc -c -O /usr/src/libc/stdio/getgrgid.c
-cc -c -O /usr/src/libc/stdio/getgrnam.c
-cc -c -O /usr/src/libc/stdio/getgrent.c
-cc -c -O /usr/src/libc/stdio/getpass.c
-cc -c -O /usr/src/libc/stdio/getpwnam.c
-cc -c -O /usr/src/libc/stdio/getpwuid.c
-cc -c -O /usr/src/libc/stdio/getpwent.c
-cc -c -O /usr/src/libc/stdio/fgetc.c
-cc -c -O /usr/src/libc/stdio/fputc.c
-cc -c -O /usr/src/libc/stdio/getchar.c
-cc -c -O /usr/src/libc/stdio/putchar.c
-cc -c -O /usr/src/libc/stdio/popen.c
-cc -c -O /usr/src/libc/stdio/freopen.c
-cc -c -O /usr/src/libc/stdio/fgets.c
-cc -c -O /usr/src/libc/stdio/fputs.c
-cc -c -O /usr/src/libc/stdio/getpw.c
-cc -c -O /usr/src/libc/stdio/fseek.c
-cc -c -O /usr/src/libc/stdio/ftell.c
-cc -c -O /usr/src/libc/stdio/rew.c
-cc -c -O /usr/src/libc/stdio/rdwr.c
-cc -c -O /usr/src/libc/stdio/system.c
-cc -c -O /usr/src/libc/stdio/fopen.c
-cc -c -O /usr/src/libc/stdio/fdopen.c
-cc -c -O /usr/src/libc/stdio/scanf.c
-cc -c -O /usr/src/libc/stdio/doscan.c
-cc -c -O /usr/src/libc/stdio/fprintf.c
-cc -c -O /usr/src/libc/stdio/gets.c
-cc -c -O /usr/src/libc/stdio/getw.c
-cc -c -O /usr/src/libc/stdio/printf.c
-cc -c -O /usr/src/libc/stdio/puts.c
-cc -c -O /usr/src/libc/stdio/putw.c
-cc -c -O /usr/src/libc/stdio/sprintf.c
-cc -c -O /usr/src/libc/stdio/ungetc.c
-cc -c -O /usr/src/libc/stdio/filbuf.c
-cc -c -O /usr/src/libc/stdio/setbuf.c
-cc -c /usr/src/libc/stdio/fltpr.s
-cc -c /usr/src/libc/stdio/doprnt.s
-cc -c -O /usr/src/libc/stdio/gcvt.c
-cc -c /usr/src/libc/stdio/ffltpr.s
-cc -c -O /usr/src/libc/stdio/strout.c
-cc -c -O /usr/src/libc/stdio/flsbuf.c
-cc -c -O /usr/src/libc/stdio/endopen.c
-cc -c -O /usr/src/libc/stdio/findiop.c
-cc -c -O /usr/src/libc/stdio/clrerr.c
-cc -c -O /usr/src/libc/stdio/data.c
-cc -c /usr/src/libc/gen/cuexit.s
-cc -c -O /usr/src/libc/gen/execvp.c
-cc -c -O /usr/src/libc/gen/getenv.c
-cc -c -O /usr/src/libc/gen/getlogin.c
-cc -c -O /usr/src/libc/gen/perror.c
-cc -c -O /usr/src/libc/gen/sleep.c
-cc -c -O /usr/src/libc/gen/timezone.c
-cc -c -O /usr/src/libc/gen/ttyslot.c
-cc -c -O /usr/src/libc/gen/ttyname.c
-cc -c /usr/src/libc/gen/abort.s
-cc -c -O /usr/src/libc/gen/abs.c
-cc -c -O /usr/src/libc/gen/atof.c
-cc -c -O /usr/src/libc/gen/atoi.c
-cc -c -O /usr/src/libc/gen/atol.c
-cc -c -O /usr/src/libc/gen/crypt.c
-cc -c -O /usr/src/libc/gen/ctime.c
-cc -c -O /usr/src/libc/gen/calloc.c
-cc -c -O /usr/src/libc/gen/malloc.c
-cc -c -O /usr/src/libc/gen/ecvt.c
-cc -c -O /usr/src/libc/gen/errlst.c
-cc -c /usr/src/libc/gen/fakcu.s
-cc -c /usr/src/libc/gen/fakfp.s
-cc -c /usr/src/libc/gen/frexp11.s
-cc -c -O /usr/src/libc/gen/isatty.c
-cc -c -O /usr/src/libc/gen/l3.c
-cc -c /usr/src/libc/gen/ldexp11.s
-cc -c /usr/src/libc/gen/ldfps.s
-cc -c -O /usr/src/libc/gen/mktemp.c
-cc -c /usr/src/libc/gen/modf11.s
-cc -c -O /usr/src/libc/gen/mpx.c
-cc -c -O /usr/src/libc/gen/mon.c
-cc -c -O /usr/src/libc/gen/nlist.c
-cc -c -O /usr/src/libc/gen/qsort.c
-cc -c -O /usr/src/libc/gen/rand.c
-cc -c /usr/src/libc/gen/setjmp.s
-cc -c -O /usr/src/libc/gen/stty.c
-cc -c -O /usr/src/libc/gen/swab.c
-cc -c -O /usr/src/libc/gen/tell.c
-cc -c -O /usr/src/libc/gen/ctype_.c
-cc -c -O /usr/src/libc/gen/index.c
-cc -c -O /usr/src/libc/gen/rindex.c
-cc -c -O /usr/src/libc/gen/strcat.c
-cc -c -O /usr/src/libc/gen/strncat.c
-cc -c -O /usr/src/libc/gen/strcmp.c
-cc -c -O /usr/src/libc/gen/strncmp.c
-cc -c -O /usr/src/libc/gen/strcpy.c
-cc -c -O /usr/src/libc/gen/strncpy.c
-cc -c -O /usr/src/libc/gen/strlen.c
-cc -c /usr/src/libc/sys/access.s
-cc -c /usr/src/libc/sys/acct.s
-cc -c /usr/src/libc/sys/alarm.s
-cc -c /usr/src/libc/sys/chdir.s
-cc -c /usr/src/libc/sys/chroot.s
-cc -c /usr/src/libc/sys/chmod.s
-cc -c /usr/src/libc/sys/chown.s
-cc -c /usr/src/libc/sys/close.s
-cc -c /usr/src/libc/sys/creat.s
-cc -c /usr/src/libc/sys/dup.s
-cc -c /usr/src/libc/sys/execl.s
-cc -c /usr/src/libc/sys/execle.s
-cc -c /usr/src/libc/sys/execv.s
-cc -c /usr/src/libc/sys/execve.s
-cc -c /usr/src/libc/sys/exit.s
-cc -c /usr/src/libc/sys/fork.s
-cc -c /usr/src/libc/sys/fstat.s
-cc -c /usr/src/libc/sys/getgid.s
-cc -c /usr/src/libc/sys/getpid.s
-cc -c /usr/src/libc/sys/getuid.s
-cc -c /usr/src/libc/sys/ioctl.s
-cc -c /usr/src/libc/sys/kill.s
-cc -c /usr/src/libc/sys/link.s
-cc -c /usr/src/libc/sys/lock.s
-cc -c /usr/src/libc/sys/lseek.s
-cc -c /usr/src/libc/sys/mknod.s
-cc -c /usr/src/libc/sys/mount.s
-cc -c /usr/src/libc/sys/mpxcall.s
-cc -c /usr/src/libc/sys/nice.s
-cc -c /usr/src/libc/sys/open.s
-cc -c /usr/src/libc/sys/pause.s
-cc -c /usr/src/libc/sys/phys.s
-cc -c /usr/src/libc/sys/pipe.s
-cc -c /usr/src/libc/sys/profil.s
-cc -c /usr/src/libc/sys/ptrace.s
-cc -c /usr/src/libc/sys/read.s
-cc -c /usr/src/libc/sys/sbrk.s
-cc -c /usr/src/libc/sys/setgid.s
-cc -c /usr/src/libc/sys/setuid.s
-cc -c /usr/src/libc/sys/signal.s
-cc -c /usr/src/libc/sys/stat.s
-cc -c /usr/src/libc/sys/stime.s
-cc -c /usr/src/libc/sys/sync.s
-cc -c /usr/src/libc/sys/time.s
-cc -c /usr/src/libc/sys/times.s
-cc -c /usr/src/libc/sys/umask.s
-cc -c /usr/src/libc/sys/umount.s
-cc -c /usr/src/libc/sys/unlink.s
-cc -c /usr/src/libc/sys/utime.s
-cc -c /usr/src/libc/sys/wait.s
-cc -c /usr/src/libc/sys/write.s
-cc -c /usr/src/libc/crt/aldiv.s
-cc -c /usr/src/libc/crt/almul.s
-cc -c /usr/src/libc/crt/alrem.s
-cc -c /usr/src/libc/crt/cerror.s
-cc -c /usr/src/libc/crt/ldiv.s
-cc -c /usr/src/libc/crt/lmul.s
-cc -c /usr/src/libc/crt/lrem.s
-cc -c /usr/src/libc/crt/mcount.s
-cc -c /usr/src/libc/crt/csv.s
diff --git a/.ref-Research-V7/usr/src/libc/crt/aldiv.s b/.ref-Research-V7/usr/src/libc/crt/aldiv.s
deleted file mode 100644 (file)
index d1c3706..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/ Long quotient
-
-.globl aldiv
-.globl csv, cret
-aldiv:
-       jsr     r5,csv
-       mov     8.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,6.(r5)
-       bne     hardldiv
-       mov     4(r5),r1
-       mov     2(r1),r2
-       mov     (r1),r1
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-       com     r4
-1:
-       mov     r4,-(sp)
-       clr     r0
-       div     r3,r0
-       mov     r0,r4           /high quotient
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0           / this is the clever part
-       div     r3,r0
-       tst     r1
-       sxt     r1
-       add     r1,r0           / cannot overflow!
-1:
-       mov     r0,r1
-       mov     r4,r0
-       tst     (sp)+
-       bpl     9f
-       neg     r0
-       neg     r1
-       sbc     r0
-9:
-       mov     4.(r5),r2
-       mov     r0,(r2)+
-       mov     r1,(r2)
-       jmp     cret
-
-/ The divisor is known to be >= 2^15 so only 16 cycles are needed.
-hardldiv:
-       clr     -(sp)
-       mov     4.(r5),r0
-       mov     2(r0),r2
-       mov     (r0),r1
-       bpl     1f
-       com     (sp)
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       mov     6.(r5),r3
-       bge     1f
-       neg     r3
-       neg     8.(r5)
-       sbc     r3
-       com     (sp)
-1:
-       mov     $16.,r4
-1:
-       clc
-       rol     r2
-       rol     r1
-       rol     r0
-       cmp     r3,r0
-       bgt     3f
-       blt     2f
-       cmp     8.(r5),r1
-       blos    2f
-3:
-       sob     r4,1b
-       br      1f
-2:
-       sub     8.(r5),r1
-       sbc     r0
-       sub     r3,r0
-       inc     r2
-       sob     r4,1b
-1:
-       mov     r2,r1
-       clr     r0
-       tst     (sp)+
-       beq     1f
-       neg     r0
-       neg     r1
-       sbc     r0
-1:
-       mov     4.(r5),r2
-       mov     r0,(r2)+
-       mov     r1,(r2)
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/crt/almul.s b/.ref-Research-V7/usr/src/libc/crt/almul.s
deleted file mode 100644 (file)
index d1d8b84..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/
-/ 32-bit multiplication routine for fixed pt hardware.
-/  Implements *= operator
-/ Credit to an unknown author who slipped it under the door.
-.globl almul
-.globl csv, cret
-
-almul:
-       jsr     r5,csv
-       mov     4(r5),r4
-       mov     2(r4),r2
-       sxt     r1
-       sub     (r4),r1
-       mov     8.(r5),r0
-       sxt     r3
-       sub     6.(r5),r3
-       mul     r0,r1
-       mul     r2,r3
-       add     r1,r3
-       mul     r2,r0
-       sub     r3,r0
-       mov     r0,(r4)+
-       mov     r1,(r4)
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/crt/alrem.s b/.ref-Research-V7/usr/src/libc/crt/alrem.s
deleted file mode 100644 (file)
index 720bd54..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/ Long remainder
-
-.globl alrem
-.globl csv, cret
-alrem:
-       jsr     r5,csv
-       mov     8.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,6.(r5)
-       bne     hardlrem
-       mov     4.(r5),r0
-       mov     2(r0),r2
-       mov     (r0),r1
-       mov     r1,r4
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       div     r3,r0
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0
-       div     r3,r0
-       tst     r1
-       beq     9f
-       add     r3,r1
-1:
-       tst     r4
-       bpl     9f
-       neg     r1
-9:
-       sxt     r0
-       mov     4.(r5),r3
-       mov     r0,(r3)+
-       mov     r1,(r3)
-       jmp     cret
-
-/ The divisor is known to be >= 2^15.  Only 16 cycles are
-/ needed to get a remainder.
-hardlrem:
-       mov     4.(r5),r0
-       mov     2(r0),r2
-       mov     (r0),r1
-       bpl     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       mov     6.(r5),r3
-       bge     1f
-       neg     r3
-       neg     8.(r5)
-       sbc     r3
-1:
-       mov     $16.,r4
-1:
-       clc
-       rol     r2
-       rol     r1
-       rol     r0
-       cmp     r3,r0
-       blt     2f
-       bgt     3f
-       cmp     8.(r5),r1
-       blos    2f
-3:
-       sob     r4,1b
-       br      1f
-2:
-       sub     8.(r5),r1
-       sbc     r0
-       sub     r3,r0
-       sob     r4,1b
-1:
-       mov     4.(r5),r3
-       tst     (r3)
-       bge     1f
-       neg     r0
-       neg     r1
-       sbc     r0
-1:
-       mov     r0,(r3)+
-       mov     r1,(r3)
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/crt/cerror.s b/.ref-Research-V7/usr/src/libc/crt/cerror.s
deleted file mode 100644 (file)
index d7e2231..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/ C return sequence which
-/ sets errno, returns -1.
-
-.globl cerror
-.comm  _errno,2
-
-cerror:
-       mov     r0,_errno
-       mov     $-1,r0
-       mov     r5,sp
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/crt/csv.s b/.ref-Research-V7/usr/src/libc/crt/csv.s
deleted file mode 100644 (file)
index 858b79b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C register save and restore -- version 7/75
-
-.globl csv
-.globl cret
-
-csv:
-       mov     r5,r0
-       mov     sp,r5
-       mov     r4,-(sp)
-       mov     r3,-(sp)
-       mov     r2,-(sp)
-       jsr     pc,(r0)         / jsr part is sub $2,sp
-
-cret:
-       mov     r5,r2
-       mov     -(r2),r4
-       mov     -(r2),r3
-       mov     -(r2),r2
-       mov     r5,sp
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/crt/ldiv.s b/.ref-Research-V7/usr/src/libc/crt/ldiv.s
deleted file mode 100644 (file)
index 31aafe2..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/ Long quotient
-
-.globl ldiv
-.globl csv, cret
-
-ldiv:
-       jsr     r5,csv
-       mov     10.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,8.(r5)
-       bne     hardldiv
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-       com     r4
-1:
-       mov     r4,-(sp)
-       clr     r0
-       div     r3,r0
-       mov     r0,r4           /high quotient
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0           / this is the clever part
-       div     r3,r0
-       tst     r1
-       sxt     r1
-       add     r1,r0           / cannot overflow!
-1:
-       mov     r0,r1
-       mov     r4,r0
-       tst     (sp)+
-       bpl     9f
-       neg     r0
-       neg     r1
-       sbc     r0
-9:
-       jmp     cret
-
-/ The divisor is known to be >= 2^15 so only 16 cycles are needed.
-hardldiv:
-       clr     -(sp)
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       bpl     1f
-       com     (sp)
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       mov     8.(r5),r3
-       bge     1f
-       neg     r3
-       neg     10.(r5)
-       sbc     r3
-       com     (sp)
-1:
-       mov     $16.,r4
-1:
-       clc
-       rol     r2
-       rol     r1
-       rol     r0
-       cmp     r3,r0
-       bgt     3f
-       blt     2f
-       cmp     10.(r5),r1
-       blos    2f
-3:
-       sob     r4,1b
-       br      1f
-2:
-       sub     10.(r5),r1
-       sbc     r0
-       sub     r3,r0
-       inc     r2
-       sob     r4,1b
-1:
-       mov     r2,r1
-       clr     r0
-       tst     (sp)+
-       beq     1f
-       neg     r0
-       neg     r1
-       sbc     r0
-1:
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/crt/lmul.s b/.ref-Research-V7/usr/src/libc/crt/lmul.s
deleted file mode 100644 (file)
index 1d24660..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/
-/ 32-bit multiplication routine for fixed pt hardware.
-/  Implements * operator
-/ Credit to an unknown author who slipped it under the door.
-.globl lmul
-.globl csv, cret
-
-lmul:
-       jsr     r5,csv
-       mov     6(r5),r2
-       sxt     r1
-       sub     4(r5),r1
-       mov     10.(r5),r0
-       sxt     r3
-       sub     8.(r5),r3
-       mul     r0,r1
-       mul     r2,r3
-       add     r1,r3
-       mul     r2,r0
-       sub     r3,r0
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/crt/lrem.s b/.ref-Research-V7/usr/src/libc/crt/lrem.s
deleted file mode 100644 (file)
index b37a3d8..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/ Long remainder
-
-.globl lrem
-.globl csv, cret
-
-lrem:
-       jsr     r5,csv
-       mov     10.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,8.(r5)
-       bne     hardlrem
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       mov     r1,r4
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       div     r3,r0
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0
-       div     r3,r0
-       tst     r1
-       beq     9f
-       add     r3,r1
-1:
-       tst     r4
-       bpl     9f
-       neg     r1
-9:
-       sxt     r0
-       jmp     cret
-
-/ The divisor is known to be >= 2^15.  Only 16 cycles are
-/ needed to get a remainder.
-hardlrem:
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       bpl     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       mov     8.(r5),r3
-       bge     1f
-       neg     r3
-       neg     10.(r5)
-       sbc     r3
-1:
-       mov     $16.,r4
-1:
-       clc
-       rol     r2
-       rol     r1
-       rol     r0
-       cmp     r3,r0
-       blt     2f
-       bgt     3f
-       cmp     10.(r5),r1
-       blos    2f
-3:
-       sob     r4,1b
-       br      1f
-2:
-       sub     10.(r5),r1
-       sbc     r0
-       sub     r3,r0
-       sob     r4,1b
-1:
-       tst     4(r5)
-       bge     1f
-       neg     r0
-       neg     r1
-       sbc     r0
-1:
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/crt/mcount.s b/.ref-Research-V7/usr/src/libc/crt/mcount.s
deleted file mode 100644 (file)
index a3d91d2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/ count subroutine calls during profiling
-
-.globl mcount
-.comm  countbase,2
-
-mcount:
-       mov     (r0),r1
-       bne     1f
-       mov     countbase,r1
-       beq     2f
-       add     $6,countbase
-       mov     (sp),(r1)+
-       mov     r1,(r0)
-1:
-       inc     2(r1)
-       bne     2f
-       inc     (r1)
-2:
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/libc/csu/crt0.s b/.ref-Research-V7/usr/src/libc/csu/crt0.s
deleted file mode 100644 (file)
index 816c7fd..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/ C runtime startoff
-
-.globl _exit, _environ
-.globl start
-.globl _main
-exit = 1.
-
-start:
-       setd
-       mov     2(sp),r0
-       clr     -2(r0)
-       mov     sp,r0
-       sub     $4,sp
-       mov     4(sp),(sp)
-       tst     (r0)+
-       mov     r0,2(sp)
-1:
-       tst     (r0)+
-       bne     1b
-       cmp     r0,*2(sp)
-       blo     1f
-       tst     -(r0)
-1:
-       mov     r0,4(sp)
-       mov     r0,_environ
-       jsr     pc,_main
-       cmp     (sp)+,(sp)+
-       mov     r0,(sp)
-       jsr     pc,*$_exit
-       sys     exit
-
-.bss
-_environ:
-       .=.+2
-.data
-       .=.+2           / loc 0 for I/D; null ptr points here.
diff --git a/.ref-Research-V7/usr/src/libc/csu/fcrt0.s b/.ref-Research-V7/usr/src/libc/csu/fcrt0.s
deleted file mode 100644 (file)
index a61ca3b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/ C runtime startoff
-/ with floating point interpreter
-
-.globl fptrap
-.globl _exit
-.globl _main
-.globl _environ
-exit = 1.
-signal = 48.
-
-start:
-       sys     signal; 4; fptrap
-       setd
-       mov     2(sp),r0
-       clr     -2(r0)
-       mov     sp,r0
-       sub     $4,sp
-       mov     4(sp),(sp)
-       tst     (r0)+
-       mov     r0,2(sp)
-1:
-       tst     (r0)+
-       bne     1b
-       cmp     r0,*2(sp)
-       blo     1f
-       tst     -(r0)
-1:
-       mov     r0,4(sp)
-       mov     r0,_environ
-       jsr     pc,_main
-       cmp     (sp)+,(sp)+
-       mov     r0,(sp)
-       jsr     pc,*$_exit
-       sys     exit
-.bss
-_environ:
-       .=.+2
-.data
-       .=.+2
diff --git a/.ref-Research-V7/usr/src/libc/csu/fmcrt0.s b/.ref-Research-V7/usr/src/libc/csu/fmcrt0.s
deleted file mode 100644 (file)
index 330b387..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/ C runtime startoff including monitoring
-
-cbufs  = 300.
-exit   = 1.
-write  = 4.
-signal = 48.
-
-.globl _monitor
-.globl _sbrk
-.globl _main
-.globl _exit
-.globl _environ
-.globl _etext
-.globl __cleanup
-.globl countbase
-.globl fptrap
-
-
-start:
-       sys     signal; 4; fptrap
-       setd
-       mov     2(sp),r0
-       clr     -2(r0)
-       mov     sp,r0
-       sub     $4,sp
-       mov     4(sp),(sp)
-       tst     (r0)+
-       mov     r0,2(sp)
-1:
-       tst     (r0)+
-       bne     1b
-       cmp     r0,*2(sp)
-       blo     1f
-       tst     -(r0)
-1:
-       mov     r0,4(sp)
-       mov     r0,_environ
-
-       mov     $_etext,r1
-       sub     $eprol,r1
-       add     $7,r1
-       ash     $-3,r1
-       bic     $!17777,r1
-       mov     $cbufs,-(sp)
-       add     $3*[cbufs+1],r1
-       mov     r1,-(sp)
-       asl     r1
-       mov     r1,-(sp)
-       jsr     pc,_sbrk
-       tst     (sp)+
-       cmp     r0,$-1
-       beq     9f
-       mov     r0,-(sp)
-       add     $6,r0
-       mov     r0,countbase
-       mov     $_etext,-(sp)
-       mov     $eprol,-(sp)
-       jsr     pc,_monitor
-       add     $10.,sp
-       jsr     pc,_main
-       cmp     (sp)+,(sp)+
-       mov     r0,(sp)
-       jsr     pc,_exit
-
-9:
-       mov     $2,r0
-       sys     write; 8f; 9f-8f
-
-.data; 8: <No space for monitor buffer\n>; 9:.even; .text
-
-_exit:
-       mov     r5,-(sp)
-       mov     sp,r5
-       jsr     pc,__cleanup
-       clr     -(sp)
-       jsr     pc,_monitor
-       tst     (sp)+
-       mov     4(r5),r0
-       sys     exit
-eprol:
-.bss
-_environ:
-       .=.+2
-countbase:
-       .=.+2
-.data
-       .=.+2
diff --git a/.ref-Research-V7/usr/src/libc/csu/mcrt0.s b/.ref-Research-V7/usr/src/libc/csu/mcrt0.s
deleted file mode 100644 (file)
index 3c1a21c..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/ C runtime startoff including monitoring
-
-cbufs  = 300.
-exit   = 1
-write  = 4
-
-.globl _monitor
-.globl _sbrk
-.globl _main
-.globl _exit
-.globl _environ
-.globl _etext
-.globl __cleanup
-.globl countbase
-
-
-start:
-       setd
-       mov     2(sp),r0
-       clr     -2(r0)
-       mov     sp,r0
-       sub     $4,sp
-       mov     4(sp),(sp)
-       tst     (r0)+
-       mov     r0,2(sp)
-1:
-       tst     (r0)+
-       bne     1b
-       cmp     r0,*2(sp)
-       blo     1f
-       tst     -(r0)
-1:
-       mov     r0,4(sp)
-       mov     r0,_environ
-
-       mov     $_etext,r1
-       sub     $eprol,r1
-       add     $7,r1
-       ash     $-3,r1
-       bic     $!17777,r1
-       mov     $cbufs,-(sp)
-       add     $3*[cbufs+1],r1
-       mov     r1,-(sp)
-       asl     r1
-       mov     r1,-(sp)
-       jsr     pc,_sbrk
-       tst     (sp)+
-       cmp     r0,$-1
-       beq     9f
-       mov     r0,-(sp)
-       add     $6,r0
-       mov     r0,countbase
-       mov     $_etext,-(sp)
-       mov     $eprol,-(sp)
-       jsr     pc,_monitor
-       add     $10.,sp
-       jsr     pc,_main
-       cmp     (sp)+,(sp)+
-       mov     r0,(sp)
-       jsr     pc,_exit
-
-9:
-       mov     $2,r0
-       sys     write; 8f; 9f-8f
-
-.data; 8: <No space for monitor buffer\n>; 9:.even; .text
-
-_exit:
-       mov     r5,-(sp)
-       mov     sp,r5
-       jsr     pc,__cleanup
-       clr     -(sp)
-       jsr     pc,_monitor
-       tst     (sp)+
-       mov     4(r5),r0
-       sys     exit
-eprol:
-.bss
-_environ:
-       .=.+2
-countbase:
-       .=.+2
-.data
-       .=.+2
diff --git a/.ref-Research-V7/usr/src/libc/gen/abort.s b/.ref-Research-V7/usr/src/libc/gen/abort.s
deleted file mode 100644 (file)
index 6bdb9ad..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/ C library -- abort
-
-.globl _abort
-iot    = 4
-.globl csv,cret
-
-_abort:
-       jsr     r5,csv
-       iot
-       clr     r0
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/gen/abs.c b/.ref-Research-V7/usr/src/libc/gen/abs.c
deleted file mode 100644 (file)
index 618e625..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-abs(arg)
-{
-
-       if(arg < 0)
-               arg = -arg;
-       return(arg);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/atof.c b/.ref-Research-V7/usr/src/libc/gen/atof.c
deleted file mode 100644 (file)
index 608de64..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-       C library - ascii to floating
-*/
-
-#include <math.h>
-#include <ctype.h>
-
-double
-atof(p)
-register char *p;
-{
-       register c;
-       double fl, flexp, exp5;
-       double big = 72057594037927936.;  /*2^56*/
-       double ldexp();
-       int nd;
-       register eexp, exp, neg, negexp, bexp;
-
-       neg = 1;
-       while((c = *p++) == ' ')
-               ;
-       if (c == '-')
-               neg = -1;
-       else if (c=='+')
-               ;
-       else
-               --p;
-
-       exp = 0;
-       fl = 0;
-       nd = 0;
-       while ((c = *p++), isdigit(c)) {
-               if (fl<big)
-                       fl = 10*fl + (c-'0');
-               else
-                       exp++;
-               nd++;
-       }
-
-       if (c == '.') {
-               while ((c = *p++), isdigit(c)) {
-                       if (fl<big) {
-                               fl = 10*fl + (c-'0');
-                               exp--;
-                       }
-               nd++;
-               }
-       }
-
-       negexp = 1;
-       eexp = 0;
-       if ((c == 'E') || (c == 'e')) {
-               if ((c= *p++) == '+')
-                       ;
-               else if (c=='-')
-                       negexp = -1;
-               else
-                       --p;
-
-               while ((c = *p++), isdigit(c)) {
-                       eexp = 10*eexp+(c-'0');
-               }
-               if (negexp<0)
-                       eexp = -eexp;
-               exp = exp + eexp;
-       }
-
-       negexp = 1;
-       if (exp<0) {
-               negexp = -1;
-               exp = -exp;
-       }
-
-
-       if((nd+exp*negexp) < -LOGHUGE){
-               fl = 0;
-               exp = 0;
-       }
-       flexp = 1;
-       exp5 = 5;
-       bexp = exp;
-       for (;;) {
-               if (exp&01)
-                       flexp *= exp5;
-               exp >>= 1;
-               if (exp==0)
-                       break;
-               exp5 *= exp5;
-       }
-       if (negexp<0)
-               fl /= flexp;
-       else
-               fl *= flexp;
-       fl = ldexp(fl, negexp*bexp);
-       if (neg<0)
-               fl = -fl;
-       return(fl);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/atoi.c b/.ref-Research-V7/usr/src/libc/gen/atoi.c
deleted file mode 100644 (file)
index 57c7ff1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-atoi(p)
-register char *p;
-{
-       register int n;
-       register int f;
-
-       n = 0;
-       f = 0;
-       for(;;p++) {
-               switch(*p) {
-               case ' ':
-               case '\t':
-                       continue;
-               case '-':
-                       f++;
-               case '+':
-                       p++;
-               }
-               break;
-       }
-       while(*p >= '0' && *p <= '9')
-               n = n*10 + *p++ - '0';
-       return(f? -n: n);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/atol.c b/.ref-Research-V7/usr/src/libc/gen/atol.c
deleted file mode 100644 (file)
index 71ae769..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-long
-atol(p)
-register char *p;
-{
-       long n;
-       register int f;
-
-       n = 0;
-       f = 0;
-       for(;;p++) {
-               switch(*p) {
-               case ' ':
-               case '\t':
-                       continue;
-               case '-':
-                       f++;
-               case '+':
-                       p++;
-               }
-               break;
-       }
-       while(*p >= '0' && *p <= '9')
-               n = n*10 + *p++ - '0';
-       return(f? -n: n);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/calloc.c b/.ref-Research-V7/usr/src/libc/gen/calloc.c
deleted file mode 100644 (file)
index 52f46d4..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*     calloc - allocate and clear memory block
-*/
-#define CHARPERINT (sizeof(int)/sizeof(char))
-#define NULL 0
-
-char *
-calloc(num, size)
-unsigned num, size;
-{
-       register char *mp;
-       char *malloc();
-       register int *q;
-       register m;
-
-       num *= size;
-       mp = malloc(num);
-       if(mp == NULL)
-               return(NULL);
-       q = (int *) mp;
-       m = (num+CHARPERINT-1)/CHARPERINT;
-       while(--m>=0)
-               *q++ = 0;
-       return(mp);
-}
-
-cfree(p, num, size)
-char *p;
-unsigned num, size;
-{
-       free(p);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/crypt.c b/.ref-Research-V7/usr/src/libc/gen/crypt.c
deleted file mode 100644 (file)
index 85464d5..0000000
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- * This program implements the
- * Proposed Federal Information Processing
- *  Data Encryption Standard.
- * See Federal Register, March 17, 1975 (40FR12134)
- */
-
-/*
- * Initial permutation,
- */
-static char    IP[] = {
-       58,50,42,34,26,18,10, 2,
-       60,52,44,36,28,20,12, 4,
-       62,54,46,38,30,22,14, 6,
-       64,56,48,40,32,24,16, 8,
-       57,49,41,33,25,17, 9, 1,
-       59,51,43,35,27,19,11, 3,
-       61,53,45,37,29,21,13, 5,
-       63,55,47,39,31,23,15, 7,
-};
-
-/*
- * Final permutation, FP = IP^(-1)
- */
-static char    FP[] = {
-       40, 8,48,16,56,24,64,32,
-       39, 7,47,15,55,23,63,31,
-       38, 6,46,14,54,22,62,30,
-       37, 5,45,13,53,21,61,29,
-       36, 4,44,12,52,20,60,28,
-       35, 3,43,11,51,19,59,27,
-       34, 2,42,10,50,18,58,26,
-       33, 1,41, 9,49,17,57,25,
-};
-
-/*
- * Permuted-choice 1 from the key bits
- * to yield C and D.
- * Note that bits 8,16... are left out:
- * They are intended for a parity check.
- */
-static char    PC1_C[] = {
-       57,49,41,33,25,17, 9,
-        1,58,50,42,34,26,18,
-       10, 2,59,51,43,35,27,
-       19,11, 3,60,52,44,36,
-};
-
-static char    PC1_D[] {
-       63,55,47,39,31,23,15,
-        7,62,54,46,38,30,22,
-       14, 6,61,53,45,37,29,
-       21,13, 5,28,20,12, 4,
-};
-
-/*
- * Sequence of shifts used for the key schedule.
-*/
-static char    shifts[] = {
-       1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1,
-};
-
-/*
- * Permuted-choice 2, to pick out the bits from
- * the CD array that generate the key schedule.
- */
-static char    PC2_C[] = {
-       14,17,11,24, 1, 5,
-        3,28,15, 6,21,10,
-       23,19,12, 4,26, 8,
-       16, 7,27,20,13, 2,
-};
-
-static char    PC2_D[] = {
-       41,52,31,37,47,55,
-       30,40,51,45,33,48,
-       44,49,39,56,34,53,
-       46,42,50,36,29,32,
-};
-
-/*
- * The C and D arrays used to calculate the key schedule.
- */
-
-static char    C[28];
-static char    D[28];
-/*
- * The key schedule.
- * Generated from the key.
- */
-static char    KS[16][48];
-
-/*
- * Set up the key schedule from the key.
- */
-
-setkey(key)
-char *key;
-{
-       register i, j, k;
-       int t;
-
-       /*
-        * First, generate C and D by permuting
-        * the key.  The low order bit of each
-        * 8-bit char is not used, so C and D are only 28
-        * bits apiece.
-        */
-       for (i=0; i<28; i++) {
-               C[i] = key[PC1_C[i]-1];
-               D[i] = key[PC1_D[i]-1];
-       }
-       /*
-        * To generate Ki, rotate C and D according
-        * to schedule and pick up a permutation
-        * using PC2.
-        */
-       for (i=0; i<16; i++) {
-               /*
-                * rotate.
-                */
-               for (k=0; k<shifts[i]; k++) {
-                       t = C[0];
-                       for (j=0; j<28-1; j++)
-                               C[j] = C[j+1];
-                       C[27] = t;
-                       t = D[0];
-                       for (j=0; j<28-1; j++)
-                               D[j] = D[j+1];
-                       D[27] = t;
-               }
-               /*
-                * get Ki. Note C and D are concatenated.
-                */
-               for (j=0; j<24; j++) {
-                       KS[i][j] = C[PC2_C[j]-1];
-                       KS[i][j+24] = D[PC2_D[j]-28-1];
-               }
-       }
-}
-
-/*
- * The E bit-selection table.
- */
-static char    E[48];
-static char    e[] {
-       32, 1, 2, 3, 4, 5,
-        4, 5, 6, 7, 8, 9,
-        8, 9,10,11,12,13,
-       12,13,14,15,16,17,
-       16,17,18,19,20,21,
-       20,21,22,23,24,25,
-       24,25,26,27,28,29,
-       28,29,30,31,32, 1,
-};
-
-/*
- * The 8 selection functions.
- * For some reason, they give a 0-origin
- * index, unlike everything else.
- */
-static char    S[8][64] {
-       14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7,
-        0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8,
-        4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0,
-       15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13,
-
-       15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10,
-        3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5,
-        0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15,
-       13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9,
-
-       10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8,
-       13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1,
-       13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7,
-        1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12,
-
-        7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
-       13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9,
-       10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4,
-        3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14,
-
-        2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9,
-       14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6,
-        4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14,
-       11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3,
-
-       12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11,
-       10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8,
-        9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6,
-        4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13,
-
-        4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1,
-       13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6,
-        1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2,
-        6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12,
-
-       13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7,
-        1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2,
-        7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8,
-        2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11,
-};
-
-/*
- * P is a permutation on the selected combination
- * of the current L and key.
- */
-static char    P[] {
-       16, 7,20,21,
-       29,12,28,17,
-        1,15,23,26,
-        5,18,31,10,
-        2, 8,24,14,
-       32,27, 3, 9,
-       19,13,30, 6,
-       22,11, 4,25,
-};
-
-/*
- * The current block, divided into 2 halves.
- */
-static char    L[32], R[32];
-static char    tempL[32];
-static char    f[32];
-
-/*
- * The combination of the key and the input, before selection.
- */
-static char    preS[48];
-
-/*
- * The payoff: encrypt a block.
- */
-
-encrypt(block, edflag)
-char *block;
-{
-       int i, ii;
-       register t, j, k;
-
-       /*
-        * First, permute the bits in the input
-        */
-       for (j=0; j<64; j++)
-               L[j] = block[IP[j]-1];
-       /*
-        * Perform an encryption operation 16 times.
-        */
-       for (ii=0; ii<16; ii++) {
-               /*
-                * Set direction
-                */
-               if (edflag)
-                       i = 15-ii;
-               else
-                       i = ii;
-               /*
-                * Save the R array,
-                * which will be the new L.
-                */
-               for (j=0; j<32; j++)
-                       tempL[j] = R[j];
-               /*
-                * Expand R to 48 bits using the E selector;
-                * exclusive-or with the current key bits.
-                */
-               for (j=0; j<48; j++)
-                       preS[j] = R[E[j]-1] ^ KS[i][j];
-               /*
-                * The pre-select bits are now considered
-                * in 8 groups of 6 bits each.
-                * The 8 selection functions map these
-                * 6-bit quantities into 4-bit quantities
-                * and the results permuted
-                * to make an f(R, K).
-                * The indexing into the selection functions
-                * is peculiar; it could be simplified by
-                * rewriting the tables.
-                */
-               for (j=0; j<8; j++) {
-                       t = 6*j;
-                       k = S[j][(preS[t+0]<<5)+
-                               (preS[t+1]<<3)+
-                               (preS[t+2]<<2)+
-                               (preS[t+3]<<1)+
-                               (preS[t+4]<<0)+
-                               (preS[t+5]<<4)];
-                       t = 4*j;
-                       f[t+0] = (k>>3)&01;
-                       f[t+1] = (k>>2)&01;
-                       f[t+2] = (k>>1)&01;
-                       f[t+3] = (k>>0)&01;
-               }
-               /*
-                * The new R is L ^ f(R, K).
-                * The f here has to be permuted first, though.
-                */
-               for (j=0; j<32; j++)
-                       R[j] = L[j] ^ f[P[j]-1];
-               /*
-                * Finally, the new L (the original R)
-                * is copied back.
-                */
-               for (j=0; j<32; j++)
-                       L[j] = tempL[j];
-       }
-       /*
-        * The output L and R are reversed.
-        */
-       for (j=0; j<32; j++) {
-               t = L[j];
-               L[j] = R[j];
-               R[j] = t;
-       }
-       /*
-        * The final output
-        * gets the inverse permutation of the very original.
-        */
-       for (j=0; j<64; j++)
-               block[j] = L[FP[j]-1];
-}
-
-char *
-crypt(pw,salt)
-char *pw;
-char *salt;
-{
-       register i, j, c;
-       int temp;
-       static char block[66], iobuf[16];
-       for(i=0; i<66; i++)
-               block[i] = 0;
-       for(i=0; (c= *pw) && i<64; pw++){
-               for(j=0; j<7; j++, i++)
-                       block[i] = (c>>(6-j)) & 01;
-               i++;
-       }
-       
-       setkey(block);
-       
-       for(i=0; i<66; i++)
-               block[i] = 0;
-
-       for(i=0;i<48;i++)
-               E[i] = e[i];
-
-       for(i=0;i<2;i++){
-               c = *salt++;
-               iobuf[i] = c;
-               if(c>'Z') c -= 6;
-               if(c>'9') c -= 7;
-               c -= '.';
-               for(j=0;j<6;j++){
-                       if((c>>j) & 01){
-                               temp = E[6*i+j];
-                               E[6*i+j] = E[6*i+j+24];
-                               E[6*i+j+24] = temp;
-                               }
-                       }
-               }
-       
-       for(i=0; i<25; i++)
-               encrypt(block,0);
-       
-       for(i=0; i<11; i++){
-               c = 0;
-               for(j=0; j<6; j++){
-                       c <<= 1;
-                       c |= block[6*i+j];
-                       }
-               c += '.';
-               if(c>'9') c += 7;
-               if(c>'Z') c += 6;
-               iobuf[i+2] = c;
-       }
-       iobuf[i+2] = 0;
-       if(iobuf[1]==0)
-               iobuf[1] = iobuf[0];
-       return(iobuf);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/ctime.c b/.ref-Research-V7/usr/src/libc/gen/ctime.c
deleted file mode 100644 (file)
index cd8b9aa..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- * This routine converts time as follows.
- * The epoch is 0000 Jan 1 1970 GMT.
- * The argument time is in seconds since then.
- * The localtime(t) entry returns a pointer to an array
- * containing
- *  seconds (0-59)
- *  minutes (0-59)
- *  hours (0-23)
- *  day of month (1-31)
- *  month (0-11)
- *  year-1970
- *  weekday (0-6, Sun is 0)
- *  day of the year
- *  daylight savings flag
- *
- * The routine calls the system to determine the local
- * timezone and whether Daylight Saving Time is permitted locally.
- * (DST is then determined by the current US standard rules)
- * There is a table that accounts for the peculiarities
- * undergone by daylight time in 1974-1975.
- *
- * The routine does not work
- * in Saudi Arabia which runs on Solar time.
- *
- * asctime(tvec))
- * where tvec is produced by localtime
- * returns a ptr to a character string
- * that has the ascii time in the form
- *     Thu Jan 01 00:00:00 1970n0\b\b\\
- *     01234567890123456789012345
- *     0         1         2
- *
- * ctime(t) just calls localtime, then asctime.
- */
-
-#include <time.h>
-#include <sys/types.h>
-#include <sys/timeb.h>
-
-static char    cbuf[26];
-static int     dmsize[12] =
-{
-       31,
-       28,
-       31,
-       30,
-       31,
-       30,
-       31,
-       31,
-       30,
-       31,
-       30,
-       31
-};
-
-/*
- * The following table is used for 1974 and 1975 and
- * gives the day number of the first day after the Sunday of the
- * change.
- */
-static struct {
-       int     daylb;
-       int     dayle;
-} daytab[] = {
-       5,      333,    /* 1974: Jan 6 - last Sun. in Nov */
-       58,     303,    /* 1975: Last Sun. in Feb - last Sun in Oct */
-};
-
-struct tm      *gmtime();
-char           *ct_numb();
-struct tm      *localtime();
-char   *ctime();
-char   *ct_num();
-char   *asctime();
-
-char *
-ctime(t)
-long *t;
-{
-       return(asctime(localtime(t)));
-}
-
-struct tm *
-localtime(tim)
-long *tim;
-{
-       register int dayno;
-       register struct tm *ct;
-       register daylbegin, daylend;
-       long copyt;
-       struct timeb systime;
-
-       ftime(&systime);
-       copyt = *tim - (long)systime.timezone*60;
-       ct = gmtime(&copyt);
-       dayno = ct->tm_yday;
-       daylbegin = 119;        /* last Sun in Apr */
-       daylend = 303;          /* Last Sun in Oct */
-       if (ct->tm_year==74 || ct->tm_year==75) {
-               daylbegin = daytab[ct->tm_year-74].daylb;
-               daylend = daytab[ct->tm_year-74].dayle;
-       }
-       daylbegin = sunday(ct, daylbegin);
-       daylend = sunday(ct, daylend);
-       if (systime.dstflag &&
-           (dayno>daylbegin || (dayno==daylbegin && ct->tm_hour>=2)) &&
-           (dayno<daylend || (dayno==daylend && ct->tm_hour<1))) {
-               copyt += 1*60*60;
-               ct = gmtime(&copyt);
-               ct->tm_isdst++;
-       }
-       return(ct);
-}
-
-/*
- * The argument is a 0-origin day number.
- * The value is the day number of the first
- * Sunday on or after the day.
- */
-static
-sunday(t, d)
-register struct tm *t;
-register int d;
-{
-       if (d >= 58)
-               d += dysize(t->tm_year) - 365;
-       return(d - (d - t->tm_yday + t->tm_wday + 700) % 7);
-}
-
-struct tm *
-gmtime(tim)
-long *tim;
-{
-       register int d0, d1;
-       long hms, day;
-       register int *tp;
-       static struct tm xtime;
-
-       /*
-        * break initial number into days
-        */
-       hms = *tim % 86400;
-       day = *tim / 86400;
-       if (hms<0) {
-               hms += 86400;
-               day -= 1;
-       }
-       tp = (int *)&xtime;
-
-       /*
-        * generate hours:minutes:seconds
-        */
-       *tp++ = hms%60;
-       d1 = hms/60;
-       *tp++ = d1%60;
-       d1 /= 60;
-       *tp++ = d1;
-
-       /*
-        * day is the day number.
-        * generate day of the week.
-        * The addend is 4 mod 7 (1/1/1970 was Thursday)
-        */
-
-       xtime.tm_wday = (day+7340036)%7;
-
-       /*
-        * year number
-        */
-       if (day>=0) for(d1=70; day >= dysize(d1); d1++)
-               day -= dysize(d1);
-       else for (d1=70; day<0; d1--)
-               day += dysize(d1-1);
-       xtime.tm_year = d1;
-       xtime.tm_yday = d0 = day;
-
-       /*
-        * generate month
-        */
-
-       if (dysize(d1)==366)
-               dmsize[1] = 29;
-       for(d1=0; d0 >= dmsize[d1]; d1++)
-               d0 -= dmsize[d1];
-       dmsize[1] = 28;
-       *tp++ = d0+1;
-       *tp++ = d1;
-       xtime.tm_isdst = 0;
-       return(&xtime);
-}
-
-char *
-asctime(t)
-struct tm *t;
-{
-       register char *cp, *ncp;
-       register int *tp;
-
-       cp = cbuf;
-       for (ncp = "Day Mon 00 00:00:00 1900\n"; *cp++ = *ncp++;);
-       ncp = &"SunMonTueWedThuFriSat"[3*t->tm_wday];
-       cp = cbuf;
-       *cp++ = *ncp++;
-       *cp++ = *ncp++;
-       *cp++ = *ncp++;
-       cp++;
-       tp = &t->tm_mon;
-       ncp = &"JanFebMarAprMayJunJulAugSepOctNovDec"[(*tp)*3];
-       *cp++ = *ncp++;
-       *cp++ = *ncp++;
-       *cp++ = *ncp++;
-       cp = ct_numb(cp, *--tp);
-       cp = ct_numb(cp, *--tp+100);
-       cp = ct_numb(cp, *--tp+100);
-       cp = ct_numb(cp, *--tp+100);
-       if (t->tm_year>=100) {
-               cp[1] = '2';
-               cp[2] = '0';
-       }
-       cp += 2;
-       cp = ct_numb(cp, t->tm_year+100);
-       return(cbuf);
-}
-
-dysize(y)
-{
-       if((y%4) == 0)
-               return(366);
-       return(365);
-}
-
-static char *
-ct_numb(cp, n)
-register char *cp;
-{
-       cp++;
-       if (n>=10)
-               *cp++ = (n/10)%10 + '0';
-       else
-               *cp++ = ' ';
-       *cp++ = n%10 + '0';
-       return(cp);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/ctype_.c b/.ref-Research-V7/usr/src/libc/gen/ctype_.c
deleted file mode 100644 (file)
index 927df28..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include       <ctype.h>
-
-char _ctype_[] = {
-       0,
-       _C,     _C,     _C,     _C,     _C,     _C,     _C,     _C,
-       _C,     _S,     _S,     _S,     _S,     _S,     _C,     _C,
-       _C,     _C,     _C,     _C,     _C,     _C,     _C,     _C,
-       _C,     _C,     _C,     _C,     _C,     _C,     _C,     _C,
-       _S,     _P,     _P,     _P,     _P,     _P,     _P,     _P,
-       _P,     _P,     _P,     _P,     _P,     _P,     _P,     _P,
-       _N,     _N,     _N,     _N,     _N,     _N,     _N,     _N,
-       _N,     _N,     _P,     _P,     _P,     _P,     _P,     _P,
-       _P,     _U|_X,  _U|_X,  _U|_X,  _U|_X,  _U|_X,  _U|_X,  _U,
-       _U,     _U,     _U,     _U,     _U,     _U,     _U,     _U,
-       _U,     _U,     _U,     _U,     _U,     _U,     _U,     _U,
-       _U,     _U,     _U,     _P,     _P,     _P,     _P,     _P,
-       _P,     _L|_X,  _L|_X,  _L|_X,  _L|_X,  _L|_X,  _L|_X,  _L,
-       _L,     _L,     _L,     _L,     _L,     _L,     _L,     _L,
-       _L,     _L,     _L,     _L,     _L,     _L,     _L,     _L,
-       _L,     _L,     _L,     _P,     _P,     _P,     _P,     _C
-};
diff --git a/.ref-Research-V7/usr/src/libc/gen/cuexit.s b/.ref-Research-V7/usr/src/libc/gen/cuexit.s
deleted file mode 100644 (file)
index f4ffb99..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/ C library -- exit
-
-/ exit(code)
-/ code is return in r0 to system
-
-.globl _exit
-.globl __cleanup
-exit = 1
-
-_exit:
-       mov     r5,-(sp)
-       mov     sp,r5
-       jsr     pc,__cleanup
-       mov     4(r5),r0
-       sys     exit
-
diff --git a/.ref-Research-V7/usr/src/libc/gen/ecvt.c b/.ref-Research-V7/usr/src/libc/gen/ecvt.c
deleted file mode 100644 (file)
index 43d17fc..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *     ecvt converts to decimal
- *     the number of digits is specified by ndigit
- *     decpt is set to the position of the decimal point
- *     sign is set to 0 for positive, 1 for negative
- */
-
-char   *cvt();
-
-#define        NDIG    80
-char*
-ecvt(arg, ndigits, decpt, sign)
-double arg;
-int ndigits, *decpt, *sign;
-{
-       return(cvt(arg, ndigits, decpt, sign, 1));
-}
-
-char*
-fcvt(arg, ndigits, decpt, sign)
-double arg;
-int ndigits, *decpt, *sign;
-{
-       return(cvt(arg, ndigits, decpt, sign, 0));
-}
-
-static char*
-cvt(arg, ndigits, decpt, sign, eflag)
-double arg;
-int ndigits, *decpt, *sign;
-{
-       register int r2;
-       double fi, fj;
-       register char *p, *p1;
-       static char buf[NDIG];
-       double modf();
-
-       if (ndigits<0)
-               ndigits = 0;
-       if (ndigits>=NDIG-1)
-               ndigits = NDIG-2;
-       r2 = 0;
-       *sign = 0;
-       p = &buf[0];
-       if (arg<0) {
-               *sign = 1;
-               arg = -arg;
-       }
-       arg = modf(arg, &fi);
-       p1 = &buf[NDIG];
-       /*
-        * Do integer part
-        */
-       if (fi != 0) {
-               p1 = &buf[NDIG];
-               while (fi != 0) {
-                       fj = modf(fi/10, &fi);
-                       *--p1 = (int)((fj+.03)*10) + '0';
-                       r2++;
-               }
-               while (p1 < &buf[NDIG])
-                       *p++ = *p1++;
-       } else if (arg > 0) {
-               while ((fj = arg*10) < 1) {
-                       arg = fj;
-                       r2--;
-               }
-       }
-       p1 = &buf[ndigits];
-       if (eflag==0)
-               p1 += r2;
-       *decpt = r2;
-       if (p1 < &buf[0]) {
-               buf[0] = '\0';
-               return(buf);
-       }
-       while (p<=p1 && p<&buf[NDIG]) {
-               arg *= 10;
-               arg = modf(arg, &fj);
-               *p++ = (int)fj + '0';
-       }
-       if (p1 >= &buf[NDIG]) {
-               buf[NDIG-1] = '\0';
-               return(buf);
-       }
-       p = p1;
-       *p1 += 5;
-       while (*p1 > '9') {
-               *p1 = '0';
-               if (p1>buf)
-                       ++*--p1;
-               else {
-                       *p1 = '1';
-                       (*decpt)++;
-                       if (eflag==0) {
-                               if (p>buf)
-                                       *p = '0';
-                               p++;
-                       }
-               }
-       }
-       *p = '\0';
-       return(buf);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/errlst.c b/.ref-Research-V7/usr/src/libc/gen/errlst.c
deleted file mode 100644 (file)
index a9770d5..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-char   *sys_errlist[] = {
-       "Error 0",
-       "Not owner",
-       "No such file or directory",
-       "No such process",
-       "Interrupted system call",
-       "I/O error",
-       "No such device or address",
-       "Arg list too long",
-       "Exec format error",
-       "Bad file number",
-       "No children",
-       "No more processes",
-       "Not enough core",
-       "Permission denied",
-       "Bad address",
-       "Block device required",
-       "Mount device busy",
-       "File exists",
-       "Cross-device link",
-       "No such device",
-       "Not a directory",
-       "Is a directory",
-       "Invalid argument",
-       "File table overflow",
-       "Too many open files",
-       "Not a typewriter",
-       "Text file busy",
-       "File too large",
-       "No space left on device",
-       "Illegal seek",
-       "Read-only file system",
-       "Too many links",
-       "Broken pipe",
-       "Argument too large",
-       "Result too large",
-};
-int    sys_nerr = { sizeof sys_errlist/sizeof sys_errlist[0] };
diff --git a/.ref-Research-V7/usr/src/libc/gen/execvp.c b/.ref-Research-V7/usr/src/libc/gen/execvp.c
deleted file mode 100644 (file)
index 4942d5e..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *     execlp(name, arg,...,0) (like execl, but does path search)
- *     execvp(name, argv)      (like execv, but does path search)
- */
-#include <errno.h>
-#define        NULL    0
-
-static char shell[] =  "/bin/sh";
-char   *execat(), *getenv();
-extern errno;
-
-execlp(name, argv)
-char *name, *argv;
-{
-       return(execvp(name, &argv));
-}
-
-execvp(name, argv)
-char *name, **argv;
-{
-       char *pathstr;
-       register char *cp;
-       char fname[128];
-       char *newargs[256];
-       int i;
-       register unsigned etxtbsy = 1;
-       register eacces = 0;
-
-       if ((pathstr = getenv("PATH")) == NULL)
-               pathstr = ":/bin:/usr/bin";
-       cp = index(name, '/')? "": pathstr;
-
-       do {
-               cp = execat(cp, name, fname);
-       retry:
-               execv(fname, argv);
-               switch(errno) {
-               case ENOEXEC:
-                       newargs[0] = "sh";
-                       newargs[1] = fname;
-                       for (i=1; newargs[i+1]=argv[i]; i++) {
-                               if (i>=254) {
-                                       errno = E2BIG;
-                                       return(-1);
-                               }
-                       }
-                       execv(shell, newargs);
-                       return(-1);
-               case ETXTBSY:
-                       if (++etxtbsy > 5)
-                               return(-1);
-                       sleep(etxtbsy);
-                       goto retry;
-               case EACCES:
-                       eacces++;
-                       break;
-               case ENOMEM:
-               case E2BIG:
-                       return(-1);
-               }
-       } while (cp);
-       if (eacces)
-               errno = EACCES;
-       return(-1);
-}
-
-static char *
-execat(s1, s2, si)
-register char *s1, *s2;
-char *si;
-{
-       register char *s;
-
-       s = si;
-       while (*s1 && *s1 != ':' && *s1 != '-')
-               *s++ = *s1++;
-       if (si != s)
-               *s++ = '/';
-       while (*s2)
-               *s++ = *s2++;
-       *s = '\0';
-       return(*s1? ++s1: 0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/fakcu.s b/.ref-Research-V7/usr/src/libc/gen/fakcu.s
deleted file mode 100644 (file)
index f8d74f6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/
-/ dummy cleanup routine if none supplied by user.
-
-.globl __cleanup
-
-__cleanup:
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/gen/fakfp.s b/.ref-Research-V7/usr/src/libc/gen/fakfp.s
deleted file mode 100644 (file)
index 6af0922..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/ fakefp -- fake floating point simulator
-
-.globl fptrap
-signal = 48.
-rti = 2
-
-fptrap:
-       sub     $2,(sp)
-       mov     r0,-(sp)
-       sys     signal; 4; 0
-       mov     (sp)+,r0
-       rti
diff --git a/.ref-Research-V7/usr/src/libc/gen/frexp11.s b/.ref-Research-V7/usr/src/libc/gen/frexp11.s
deleted file mode 100644 (file)
index 46fc518..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/  double frexp(x, ip)
-/  double x; int *ip;
-/  returns a fractional part 1/16 <= |value| < 1
-/ and stores an exponent so x = value * 2^(*ip)
-
-.globl _frexp
-.globl csv, cret
-
-_frexp:
-       jsr     r5,csv
-       movf    4(r5),fr0
-       movei   fr0,r0
-       clr     r1
-       movie   r1,fr0
-       mov     r0,*12.(r5)
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/gen/getenv.c b/.ref-Research-V7/usr/src/libc/gen/getenv.c
deleted file mode 100644 (file)
index 8fb727e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *     getenv(name)
- *     returns ptr to value associated with name, if any, else NULL
- */
-#define NULL   0
-extern char **environ;
-char   *nvmatch();
-
-char *
-getenv(name)
-register char *name;
-{
-       register char **p = environ;
-       register char *v;
-
-       while (*p != NULL)
-               if ((v = nvmatch(name, *p++)) != NULL)
-                       return(v);
-       return(NULL);
-}
-
-/*
- *     s1 is either name, or name=value
- *     s2 is name=value
- *     if names match, return value of s2, else NULL
- *     used for environment searching: see getenv
- */
-
-static char *
-nvmatch(s1, s2)
-register char *s1, *s2;
-{
-
-       while (*s1 == *s2++)
-               if (*s1++ == '=')
-                       return(s2);
-       if (*s1 == '\0' && *(s2-1) == '=')
-               return(s2);
-       return(NULL);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/getlogin.c b/.ref-Research-V7/usr/src/libc/gen/getlogin.c
deleted file mode 100644 (file)
index f8a8c1c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <utmp.h>
-
-static char    UTMP[]  = "/etc/utmp";
-static struct  utmp ubuf;
-
-char *
-getlogin()
-{
-       register me, uf;
-       register char *cp;
-
-       if( !(me = ttyslot()) )
-               return(0);
-       if( (uf = open( UTMP, 0 )) < 0 )
-               return(0);
-       lseek( uf, (long)(me*sizeof(ubuf)), 0 );
-       if (read(uf, (char *)&ubuf, sizeof(ubuf)) != sizeof(ubuf))
-               return(0);
-       close(uf);
-       ubuf.ut_name[8] = ' ';
-       for (cp=ubuf.ut_name; *cp++!=' ';)
-               ;
-       *--cp = '\0';
-       return( ubuf.ut_name );
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/index.c b/.ref-Research-V7/usr/src/libc/gen/index.c
deleted file mode 100644 (file)
index f525edb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Return the ptr in sp at which the character c appears;
- * NULL if not found
- */
-
-#define        NULL    0
-
-char *
-index(sp, c)
-register char *sp, c;
-{
-       do {
-               if (*sp == c)
-                       return(sp);
-       } while (*sp++);
-       return(NULL);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/isatty.c b/.ref-Research-V7/usr/src/libc/gen/isatty.c
deleted file mode 100644 (file)
index 0743e62..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Returns 1 iff file is a tty
- */
-
-#include <sgtty.h>
-
-isatty(f)
-{
-       struct sgttyb ttyb;
-
-       if (gtty(f, &ttyb) < 0)
-               return(0);
-       return(1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/l3.c b/.ref-Research-V7/usr/src/libc/gen/l3.c
deleted file mode 100644 (file)
index 623f9c9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Convert longs to and from 3-byte disk addresses
- */
-ltol3(cp, lp, n)
-char   *cp;
-long   *lp;
-int    n;
-{
-       register i;
-       register char *a, *b;
-
-       a = cp;
-       b = (char *)lp;
-       for(i=0;i<n;i++) {
-#ifdef interdata
-               b++;
-               *a++ = *b++;
-               *a++ = *b++;
-               *a++ = *b++;
-#else
-               *a++ = *b++;
-               b++;
-               *a++ = *b++;
-               *a++ = *b++;
-#endif
-       }
-}
-
-l3tol(lp, cp, n)
-long   *lp;
-char   *cp;
-int    n;
-{
-       register i;
-       register char *a, *b;
-
-       a = (char *)lp;
-       b = cp;
-       for(i=0;i<n;i++) {
-#ifdef interdata
-               *a++ = 0;
-               *a++ = *b++;
-               *a++ = *b++;
-               *a++ = *b++;
-#else
-               *a++ = *b++;
-               *a++ = 0;
-               *a++ = *b++;
-               *a++ = *b++;
-#endif
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/ldexp11.s b/.ref-Research-V7/usr/src/libc/gen/ldexp11.s
deleted file mode 100644 (file)
index 1abb9d5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/ double ldexp(number, exp)
-/ double number
-/  -- returns number * 2^exp
-
-.globl _ldexp
-.globl csv, cret
-
-ERANGE = 34.
-
-_ldexp:
-       jsr     r5,csv
-       movf    4(r5),fr0
-       movei   fr0,r0
-       add     12.(r5),r0
-       movie   r0,fr0
-       cfcc
-       bvc     1f
-       bmi     2f
-       movf    huge,fr0
-       br      3f
-2:
-       movf    huge,fr0
-       negf    fr0
-3:
-       mov     $ERANGE,_errno
-1:
-       jmp     cret
-
-       .comm   _errno,2
-       .data
-huge:  077777; 0177776; 0177777; 0177777
diff --git a/.ref-Research-V7/usr/src/libc/gen/ldfps.s b/.ref-Research-V7/usr/src/libc/gen/ldfps.s
deleted file mode 100644 (file)
index 800cf62..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-ldfps = 170100^tst
-/
-/ ldfps(number);
-
-.globl _ldfps
-_ldfps:
-       mov     r5,-(sp)
-       mov     sp,r5
-       ldfps   4(r5)
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/gen/malloc.c b/.ref-Research-V7/usr/src/libc/gen/malloc.c
deleted file mode 100644 (file)
index a3df623..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-#ifdef debug
-#define ASSERT(p) if(!(p))botch("p");else
-botch(s)
-char *s;
-{
-       printf("assertion botched: %s\n",s);
-       abort();
-}
-#else
-#define ASSERT(p)
-#endif
-
-/*     avoid break bug */
-#ifdef pdp11
-#define GRANULE 64
-#else
-#define GRANULE 0
-#endif
-/*     C storage allocator
- *     circular first-fit strategy
- *     works with noncontiguous, but monotonically linked, arena
- *     each block is preceded by a ptr to the (pointer of) 
- *     the next following block
- *     blocks are exact number of words long 
- *     aligned to the data type requirements of ALIGN
- *     pointers to blocks must have BUSY bit 0
- *     bit in ptr is 1 for busy, 0 for idle
- *     gaps in arena are merely noted as busy blocks
- *     last block of arena (pointed to by alloct) is empty and
- *     has a pointer to first
- *     idle blocks are coalesced during space search
- *
- *     a different implementation may need to redefine
- *     ALIGN, NALIGN, BLOCK, BUSY, INT
- *     where INT is integer type to which a pointer can be cast
-*/
-#define INT int
-#define ALIGN int
-#define NALIGN 1
-#define WORD sizeof(union store)
-#define BLOCK 1024     /* a multiple of WORD*/
-#define BUSY 1
-#define NULL 0
-#define testbusy(p) ((INT)(p)&BUSY)
-#define setbusy(p) (union store *)((INT)(p)|BUSY)
-#define clearbusy(p) (union store *)((INT)(p)&~BUSY)
-
-union store { union store *ptr;
-             ALIGN dummy[NALIGN];
-             int calloc;       /*calloc clears an array of integers*/
-};
-
-static union store allocs[2];  /*initial arena*/
-static union store *allocp;    /*search ptr*/
-static union store *alloct;    /*arena top*/
-static union store *allocx;    /*for benefit of realloc*/
-char   *sbrk();
-
-char *
-malloc(nbytes)
-unsigned nbytes;
-{
-       register union store *p, *q;
-       register nw;
-       static temp;    /*coroutines assume no auto*/
-
-       if(allocs[0].ptr==0) {  /*first time*/
-               allocs[0].ptr = setbusy(&allocs[1]);
-               allocs[1].ptr = setbusy(&allocs[0]);
-               alloct = &allocs[1];
-               allocp = &allocs[0];
-       }
-       nw = (nbytes+WORD+WORD-1)/WORD;
-       ASSERT(allocp>=allocs && allocp<=alloct);
-       ASSERT(allock());
-       for(p=allocp; ; ) {
-               for(temp=0; ; ) {
-                       if(!testbusy(p->ptr)) {
-                               while(!testbusy((q=p->ptr)->ptr)) {
-                                       ASSERT(q>p&&q<alloct);
-                                       p->ptr = q->ptr;
-                               }
-                               if(q>=p+nw && p+nw>=p)
-                                       goto found;
-                       }
-                       q = p;
-                       p = clearbusy(p->ptr);
-                       if(p>q)
-                               ASSERT(p<=alloct);
-                       else if(q!=alloct || p!=allocs) {
-                               ASSERT(q==alloct&&p==allocs);
-                               return(NULL);
-                       } else if(++temp>1)
-                               break;
-               }
-               temp = ((nw+BLOCK/WORD)/(BLOCK/WORD))*(BLOCK/WORD);
-               q = (union store *)sbrk(0);
-               if(q+temp+GRANULE < q) {
-                       return(NULL);
-               }
-               q = (union store *)sbrk(temp*WORD);
-               if((INT)q == -1) {
-                       return(NULL);
-               }
-               ASSERT(q>alloct);
-               alloct->ptr = q;
-               if(q!=alloct+1)
-                       alloct->ptr = setbusy(alloct->ptr);
-               alloct = q->ptr = q+temp-1;
-               alloct->ptr = setbusy(allocs);
-       }
-found:
-       allocp = p + nw;
-       ASSERT(allocp<=alloct);
-       if(q>allocp) {
-               allocx = allocp->ptr;
-               allocp->ptr = p->ptr;
-       }
-       p->ptr = setbusy(allocp);
-       return((char *)(p+1));
-}
-
-/*     freeing strategy tuned for LIFO allocation
-*/
-free(ap)
-register char *ap;
-{
-       register union store *p = (union store *)ap;
-
-       ASSERT(p>clearbusy(allocs[1].ptr)&&p<=alloct);
-       ASSERT(allock());
-       allocp = --p;
-       ASSERT(testbusy(p->ptr));
-       p->ptr = clearbusy(p->ptr);
-       ASSERT(p->ptr > allocp && p->ptr <= alloct);
-}
-
-/*     realloc(p, nbytes) reallocates a block obtained from malloc()
- *     and freed since last call of malloc()
- *     to have new size nbytes, and old content
- *     returns new location, or 0 on failure
-*/
-
-char *
-realloc(p, nbytes)
-register union store *p;
-unsigned nbytes;
-{
-       register union store *q;
-       union store *s, *t;
-       register unsigned nw;
-       unsigned onw;
-
-       if(testbusy(p[-1].ptr))
-               free((char *)p);
-       onw = p[-1].ptr - p;
-       q = (union store *)malloc(nbytes);
-       if(q==NULL || q==p)
-               return((char *)q);
-       s = p;
-       t = q;
-       nw = (nbytes+WORD-1)/WORD;
-       if(nw<onw)
-               onw = nw;
-       while(onw--!=0)
-               *t++ = *s++;
-       if(q<p && q+nw>=p)
-               (q+(q+nw-p))->ptr = allocx;
-       return((char *)q);
-}
-
-#ifdef debug
-allock()
-{
-#ifdef longdebug
-       register union store *p;
-       int x;
-       x = 0;
-       for(p= &allocs[0]; clearbusy(p->ptr) > p; p=clearbusy(p->ptr)) {
-               if(p==allocp)
-                       x++;
-       }
-       ASSERT(p==alloct);
-       return(x==1|p==allocp);
-#else
-       return(1);
-#endif
-}
-#endif
diff --git a/.ref-Research-V7/usr/src/libc/gen/mktemp.c b/.ref-Research-V7/usr/src/libc/gen/mktemp.c
deleted file mode 100644 (file)
index 164e9af..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-char *
-mktemp(as)
-char *as;
-{
-       register char *s;
-       register unsigned pid;
-       register i;
-
-       pid = getpid();
-       s = as;
-       while (*s++)
-               ;
-       s--;
-       while (*--s == 'X') {
-               *s = (pid%10) + '0';
-               pid /= 10;
-       }
-       s++;
-       i = 'a';
-       while (access(as, 0) != -1) {
-               if (i=='z')
-                       return("/");
-               *s = i++;
-       }
-       return(as);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/modf11.s b/.ref-Research-V7/usr/src/libc/gen/modf11.s
deleted file mode 100644 (file)
index cec82ca..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/ double modf(x, *fp)
-/ double x, *fp;
-/ return fractional part
-/ stash integer part (as double)
-
-.globl _modf
-.globl csv, cret
-one    = 040200
-
-_modf:
-       jsr     r5,csv
-       movf    4(r5),fr0
-       modf    $one,fr0
-       movf    fr1,*12.(r5)
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/gen/mon.c b/.ref-Research-V7/usr/src/libc/gen/mon.c
deleted file mode 100644 (file)
index eacafdf..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-monitor(lowpc, highpc, buf, bufsiz, cntsiz)
-char *lowpc, *highpc;
-int *buf, bufsiz;
-{
-       register o;
-       static *sbuf, ssiz;
-
-       if (lowpc == 0) {
-               profil(0, 0, 0, 0);
-               o = creat("mon.out", 0666);
-               write(o, sbuf, ssiz<<1);
-               close(o);
-               return;
-       }
-       ssiz = bufsiz;
-       buf[0] = (int)lowpc;
-       buf[1] = (int)highpc;
-       buf[2] = cntsiz;
-       sbuf = buf;
-       buf += 3*(cntsiz+1);
-       bufsiz -= 3*(cntsiz+1);
-       if (bufsiz<=0)
-               return;
-       o = ((highpc - lowpc)>>1) & 077777;
-       if(bufsiz < o)
-               o = ((long)bufsiz<<15) / o;
-       else
-               o = 077777;
-       profil(buf, bufsiz<<1, lowpc, o<<1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/mpx.c b/.ref-Research-V7/usr/src/libc/gen/mpx.c
deleted file mode 100644 (file)
index e42a649..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#include <sys/param.h>
-#include <sys/tty.h>
-#include <sys/mx.h>
-
-static struct mx_args vec;
-int    mpxcall();
-
-
-mpx(name,mode)
-char *name;
-{
-       if (*name) {
-               vec.m_name = name;
-               vec.m_arg[0] = mode;
-               return(mpxcall(MPX, &vec));
-       } else
-               return(mpxcall(MPXN, 0));
-}
-
-chan(gr)
-{
-       vec.m_arg[1] = gr;
-       return(mpxcall(CHAN, &vec));
-}
-
-join(fd,ch)
-{
-       vec.m_arg[0] = fd;
-       vec.m_arg[1] = ch;
-       return(mpxcall(JOIN, &vec));
-}
-
-connect(fd,ch,side)
-{
-       vec.m_arg[0] = fd;
-       vec.m_arg[1] = ch;
-       vec.m_arg[2] = side;
-       return(mpxcall(CONNECT, &vec));
-}
-
-attach(sub,gp)
-{
-       vec.m_arg[0] = sub;
-       vec.m_arg[1] = gp;
-       return(mpxcall(ATTACH, &vec));
-}
-
-detach(sub,gp)
-{
-       vec.m_arg[0] = sub;
-       vec.m_arg[1] = gp;
-       return(mpxcall(DETACH, &vec));
-}
-
-extract(sub,ch,side)
-{
-       vec.m_arg[0] = sub;
-       vec.m_arg[1] = ch;
-       vec.m_arg[2] = side;
-       return(mpxcall(EXTR, &vec));
-}
-
-debug(var,val)
-{
-       vec.m_arg[0] = var;
-       vec.m_arg[1] = val;
-       return(mpxcall(DEBUG, &vec));
-}
-
-npgrp(ch, gfd, pid)
-{
-       vec.m_arg[0] = ch;
-       vec.m_arg[1] = gfd;
-       vec.m_arg[2] = pid;
-       return(mpxcall(NPGRP, &vec));
-}
-ckill(index,gp,sig)
-{
-       vec.m_arg[0] = index;
-       vec.m_arg[1] = gp;
-       vec.m_arg[2] = sig;
-       return(mpxcall(CSIG, &vec));
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/nlist.c b/.ref-Research-V7/usr/src/libc/gen/nlist.c
deleted file mode 100644 (file)
index 3701df7..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <a.out.h>
-int a_magic[] = {A_MAGIC1, A_MAGIC2, A_MAGIC3, A_MAGIC4, 0};
-#define SPACE 100              /* number of symbols read at a time */
-
-nlist(name, list)
-char *name;
-struct nlist *list;
-{
-       register struct nlist *p, *q;
-       int f, n, m, i;
-       long sa;
-       struct exec buf;
-       struct nlist space[SPACE];
-
-       for(p = list; p->n_name[0]; p++) {
-               p->n_type = 0;
-               p->n_value = 0;
-       }
-       f = open(name, 0);
-       if(f < 0)
-               return(-1);
-       read(f, (char *)&buf, sizeof buf);
-       for(i=0; a_magic[i]; i++)
-               if(a_magic[i] == buf.a_magic) break;
-       if(a_magic[i] == 0){
-               close(f);
-               return(-1);
-       }
-       sa = buf.a_text + (long)buf.a_data;
-       if(buf.a_flag != 1) sa *= 2;
-       sa += sizeof buf;
-       lseek(f, sa, 0);
-       n = buf.a_syms;
-
-       while(n){
-               m = sizeof space;
-               if(n < sizeof space)
-                       m = n;
-               read(f, (char *)space, m);
-               n -= m;
-               for(q = space; (m -= sizeof(struct nlist)) >= 0; q++) {
-                       for(p = list; p->n_name[0]; p++) {
-                               for(i=0;i<8;i++)
-                                       if(p->n_name[i] != q->n_name[i]) goto cont;
-                               p->n_value = q->n_value;
-                               p->n_type = q->n_type;
-                               break;
-               cont:           ;
-                       }
-               }
-       }
-       close(f);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/perror.c b/.ref-Research-V7/usr/src/libc/gen/perror.c
deleted file mode 100644 (file)
index 39c1cc9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Print the error indicated
- * in the cerror cell.
- */
-
-int    errno;
-int    sys_nerr;
-char   *sys_errlist[];
-perror(s)
-char *s;
-{
-       register char *c;
-       register n;
-
-       c = "Unknown error";
-       if(errno < sys_nerr)
-               c = sys_errlist[errno];
-       n = strlen(s);
-       if(n) {
-               write(2, s, n);
-               write(2, ": ", 2);
-       }
-       write(2, c, strlen(c));
-       write(2, "\n", 1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/pkon.c b/.ref-Research-V7/usr/src/libc/gen/pkon.c
deleted file mode 100644 (file)
index a91bd5e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <sgtty.h>
-
-struct piocb {
-       unsigned t;
-       short   psize;
-       short   mode;
-       short   state;
-       char    window;
-};
-pkon(fd, size)
-{
-       if (size&037 || size > 128) {
-               write(2,"bad packet size\n",16);
-               return(-1);
-       }
-       return(turnon(fd, size, 2, 0));
-}
-turnon(fd,psize,window,mode)
-{
-struct piocb p;
-
-       p.window = window;
-       p.psize = psize;
-       p.mode = mode;
-       p.t = 1;
-       if (ioctl(fd,TIOCSETD,&p) < 0 || ioctl(fd,DIOCGETP,&p) < 0) {
-               return(-1);
-       }
-       return(p.psize);
-}
-
-pkoff(fd)
-{
-struct piocb p;
-
-       close(fd);
-       return;
-/*
-       p.t = 0;
-       return(ioctl(fd,TIOCSETD,&p));
-*/
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/qsort.c b/.ref-Research-V7/usr/src/libc/gen/qsort.c
deleted file mode 100644 (file)
index 202c759..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-
-static int     (*qscmp)();
-static int     qses;
-
-qsort(a, n, es, fc)
-char *a;
-unsigned n;
-int es;
-int (*fc)();
-{
-       qscmp = fc;
-       qses = es;
-       qs1(a, a+n*es);
-}
-
-static qs1(a, l)
-char *a, *l;
-{
-       register char *i, *j;
-       register es;
-       char **k;
-       char *lp, *hp;
-       int c;
-       unsigned n;
-
-
-       es = qses;
-
-start:
-       if((n=l-a) <= es)
-               return;
-       n = es * (n / (2*es));
-       hp = lp = a+n;
-       i = a;
-       j = l-es;
-       for(;;) {
-               if(i < lp) {
-                       if((c = (*qscmp)(i, lp)) == 0) {
-                               qsexc(i, lp -= es);
-                               continue;
-                       }
-                       if(c < 0) {
-                               i += es;
-                               continue;
-                       }
-               }
-
-loop:
-               if(j > hp) {
-                       if((c = (*qscmp)(hp, j)) == 0) {
-                               qsexc(hp += es, j);
-                               goto loop;
-                       }
-                       if(c > 0) {
-                               if(i == lp) {
-                                       qstexc(i, hp += es, j);
-                                       i = lp += es;
-                                       goto loop;
-                               }
-                               qsexc(i, j);
-                               j -= es;
-                               i += es;
-                               continue;
-                       }
-                       j -= es;
-                       goto loop;
-               }
-
-
-               if(i == lp) {
-                       if(lp-a >= l-hp) {
-                               qs1(hp+es, l);
-                               l = lp;
-                       } else {
-                               qs1(a, lp);
-                               a = hp+es;
-                       }
-                       goto start;
-               }
-
-
-               qstexc(j, lp -= es, i);
-               j = hp -= es;
-       }
-}
-
-static qsexc(i, j)
-char *i, *j;
-{
-       register char *ri, *rj, c;
-       int n;
-
-       n = qses;
-       ri = i;
-       rj = j;
-       do {
-               c = *ri;
-               *ri++ = *rj;
-               *rj++ = c;
-       } while(--n);
-}
-
-static qstexc(i, j, k)
-char *i, *j, *k;
-{
-       register char *ri, *rj, *rk;
-       int c;
-       int n;
-
-       n = qses;
-       ri = i;
-       rj = j;
-       rk = k;
-       do {
-               c = *ri;
-               *ri++ = *rk;
-               *rk++ = *rj;
-               *rj++ = c;
-       } while(--n);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/rand.c b/.ref-Research-V7/usr/src/libc/gen/rand.c
deleted file mode 100644 (file)
index 01afa99..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-static long    randx = 1;
-
-srand(x)
-unsigned x;
-{
-       randx = x;
-}
-
-rand()
-{
-       return(((randx = randx*1103515245 + 12345)>>16) & 077777);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/rindex.c b/.ref-Research-V7/usr/src/libc/gen/rindex.c
deleted file mode 100644 (file)
index af1ff76..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Return the ptr in sp at which the character c last
- * appears; NULL if not found
-*/
-
-#define NULL 0
-
-char *
-rindex(sp, c)
-register char *sp, c;
-{
-       register char *r;
-
-       r = NULL;
-       do {
-               if (*sp == c)
-                       r = sp;
-       } while (*sp++);
-       return(r);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/setjmp.s b/.ref-Research-V7/usr/src/libc/gen/setjmp.s
deleted file mode 100644 (file)
index 00dabcd..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/ C library -- setjmp, longjmp
-
-/      longjmp(a,v)
-/ will generate a "return(v)" from
-/ the last call to
-/      setjmp(a)
-/ by restoring sp, r5, pc from `a'
-/ and doing a return.
-/
-
-.globl _setjmp
-.globl _longjmp
-.globl csv, cret
-
-_setjmp:
-       mov     2(sp),r0
-       mov     r5,(r0)+
-       mov     sp,(r0)+
-       mov     (sp),(r0)
-       clr     r0
-       rts     pc
-
-_longjmp:
-       jsr     r5,csv
-       mov     4(r5),r1
-       mov     6(r5),r0
-       bne     1f
-       mov     $1,r0
-1:
-       cmp     (r5),(r1)
-       beq     1f
-       mov     (r5),r5
-       bne     1b
-/ panic -- r2-r4 lost
-       mov     (r1)+,r5
-       mov     (r1)+,sp
-       mov     (r1),(sp)
-       rts     pc
-1:
-       mov     4(r1),2(r5)
-       jmp     cret
-
diff --git a/.ref-Research-V7/usr/src/libc/gen/sleep.c b/.ref-Research-V7/usr/src/libc/gen/sleep.c
deleted file mode 100644 (file)
index 4226dc5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <signal.h>
-#include <setjmp.h>
-
-static jmp_buf jmp;
-
-sleep(n)
-unsigned n;
-{
-       int sleepx();
-       unsigned altime;
-       int (*alsig)() = SIG_DFL;
-
-       if (n==0)
-               return;
-       altime = alarm(1000);   /* time to maneuver */
-       if (setjmp(jmp)) {
-               signal(SIGALRM, alsig);
-               alarm(altime);
-               return;
-       }
-       if (altime) {
-               if (altime > n)
-                       altime -= n;
-               else {
-                       n = altime;
-                       altime = 1;
-               }
-       }
-       alsig = signal(SIGALRM, sleepx);
-       alarm(n);
-       for(;;)
-               pause();
-       /*NOTREACHED*/
-}
-
-static
-sleepx()
-{
-       longjmp(jmp, 1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strcat.c b/.ref-Research-V7/usr/src/libc/gen/strcat.c
deleted file mode 100644 (file)
index 9d2a52c..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Concatenate s2 on the end of s1.  S1's space must be large enough.
- * Return s1.
- */
-
-char *
-strcat(s1, s2)
-register char *s1, *s2;
-{
-       register char *os1;
-
-       os1 = s1;
-       while (*s1++)
-               ;
-       --s1;
-       while (*s1++ = *s2++)
-               ;
-       return(os1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strcmp.c b/.ref-Research-V7/usr/src/libc/gen/strcmp.c
deleted file mode 100644 (file)
index 3159719..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Compare strings:  s1>s2: >0  s1==s2: 0  s1<s2: <0
- */
-
-strcmp(s1, s2)
-register char *s1, *s2;
-{
-
-       while (*s1 == *s2++)
-               if (*s1++=='\0')
-                       return(0);
-       return(*s1 - *--s2);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strcpy.c b/.ref-Research-V7/usr/src/libc/gen/strcpy.c
deleted file mode 100644 (file)
index da2acb5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copy string s2 to s1.  s1 must be large enough.
- * return s1
- */
-
-char *
-strcpy(s1, s2)
-register char *s1, *s2;
-{
-       register char *os1;
-
-       os1 = s1;
-       while (*s1++ = *s2++)
-               ;
-       return(os1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strlen.c b/.ref-Research-V7/usr/src/libc/gen/strlen.c
deleted file mode 100644 (file)
index 2abf6a5..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Returns the number of
- * non-NULL bytes in string argument.
- */
-
-strlen(s)
-register char *s;
-{
-       register n;
-
-       n = 0;
-       while (*s++)
-               n++;
-       return(n);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strncat.c b/.ref-Research-V7/usr/src/libc/gen/strncat.c
deleted file mode 100644 (file)
index 34dcabe..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Concatenate s2 on the end of s1.  S1's space must be large enough.
- * At most n characters are moved.
- * Return s1.
- */
-
-char *
-strncat(s1, s2, n)
-register char *s1, *s2;
-register n;
-{
-       register char *os1;
-
-       os1 = s1;
-       while (*s1++)
-               ;
-       --s1;
-       while (*s1++ = *s2++)
-               if (--n < 0) {
-                       *--s1 = '\0';
-                       break;
-               }
-       return(os1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strncmp.c b/.ref-Research-V7/usr/src/libc/gen/strncmp.c
deleted file mode 100644 (file)
index a46514e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Compare strings (at most n bytes):  s1>s2: >0  s1==s2: 0  s1<s2: <0
- */
-
-strncmp(s1, s2, n)
-register char *s1, *s2;
-register n;
-{
-
-       while (--n >= 0 && *s1 == *s2++)
-               if (*s1++ == '\0')
-                       return(0);
-       return(n<0 ? 0 : *s1 - *--s2);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/strncpy.c b/.ref-Research-V7/usr/src/libc/gen/strncpy.c
deleted file mode 100644 (file)
index 40c511e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copy s2 to s1, truncating or null-padding to always copy n bytes
- * return s1
- */
-
-char *
-strncpy(s1, s2, n)
-register char *s1, *s2;
-{
-       register i;
-       register char *os1;
-
-       os1 = s1;
-       for (i = 0; i < n; i++)
-               if ((*s1++ = *s2++) == '\0') {
-                       while (++i < n)
-                               *s1++ = '\0';
-                       return(os1);
-               }
-       return(os1);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/stty.c b/.ref-Research-V7/usr/src/libc/gen/stty.c
deleted file mode 100644 (file)
index 1712124..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Writearound to old stty and gtty system calls
- */
-
-#include <sgtty.h>
-
-stty(fd, ap)
-struct sgtty *ap;
-{
-       return(ioctl(fd, TIOCSETP, ap));
-}
-
-gtty(fd, ap)
-struct sgtty *ap;
-{
-       return(ioctl(fd, TIOCGETP, ap));
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/swab.c b/.ref-Research-V7/usr/src/libc/gen/swab.c
deleted file mode 100644 (file)
index 9b11fe9..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Swap bytes in 16-bit [half-]words
- * for going between the 11 and the interdata
- */
-
-swab(pf, pt, n)
-register short *pf, *pt;
-register n;
-{
-
-       n /= 2;
-       while (--n >= 0) {
-               *pt++ = (*pf << 8) + ((*pf >> 8) & 0377);
-               pf++;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/tell.c b/.ref-Research-V7/usr/src/libc/gen/tell.c
deleted file mode 100644 (file)
index 12e6bf2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * return offset in file.
- */
-
-long   lseek();
-
-long tell(f)
-{
-       return(lseek(f, 0L, 1));
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/timezone.c b/.ref-Research-V7/usr/src/libc/gen/timezone.c
deleted file mode 100644 (file)
index c80ddd8..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * The arguments are the number of minutes of time
- * you are westward from Greenwich and whether DST is in effect.
- * It returns a string
- * giving the name of the local timezone.
- *
- * Sorry, I don't know all the names.
- */
-
-static struct zone {
-       int     offset;
-       char    *stdzone;
-       char    *dlzone;
-} zonetab[] = {
-       4*60, "AST", "ADT",             /* Atlantic */
-       5*60, "EST", "EDT",             /* Eastern */
-       6*60, "CST", "CDT",             /* Central */
-       7*60, "MST", "MDT",             /* Mountain */
-       8*60, "PST", "PDT",             /* Pacific */
-       0, "GMT", 0,                    /* Greenwich */
-       -1
-};
-
-char *timezone(zone, dst)
-{
-       register struct zone *zp;
-       static char czone[10];
-       char *sign;
-
-       for (zp=zonetab; zp->offset!=-1; zp++)
-               if (zp->offset==zone) {
-                       if (dst && zp->dlzone)
-                               return(zp->dlzone);
-                       if (!dst && zp->stdzone)
-                               return(zp->stdzone);
-               }
-       if (zone<0) {
-               zone = -zone;
-               sign = "+";
-       } else
-               sign = "-";
-       sprintf(czone, "GMT%s%d:%02d", sign, zone/60, zone%60);
-       return(czone);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/ttyname.c b/.ref-Research-V7/usr/src/libc/gen/ttyname.c
deleted file mode 100644 (file)
index c7724e0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * ttyname(f): return "/dev/ttyXX" which the the name of the
- * tty belonging to file f.
- *  NULL if it is not a tty
- */
-
-#define        NULL    0
-#include <sys/types.h>
-#include <sys/dir.h>
-#include <sys/stat.h>
-
-static char    dev[]   = "/dev/";
-char   *strcpy();
-char   *strcat();
-
-char *
-ttyname(f)
-{
-       struct stat fsb;
-       struct stat tsb;
-       struct direct db;
-       static char rbuf[32];
-       register df;
-
-       if (isatty(f)==0)
-               return(NULL);
-       if (fstat(f, &fsb) < 0)
-               return(NULL);
-       if ((fsb.st_mode&S_IFMT) != S_IFCHR)
-               return(NULL);
-       if ((df = open(dev, 0)) < 0)
-               return(NULL);
-       while (read(df, (char *)&db, sizeof(db)) == sizeof(db)) {
-               if (db.d_ino == 0)
-                       continue;
-               if (db.d_ino != fsb.st_ino)
-                       continue;
-               strcpy(rbuf, dev);
-               strcat(rbuf, db.d_name);
-               if (stat(rbuf, &tsb) < 0)
-                       continue;
-               if (tsb.st_dev==fsb.st_dev && tsb.st_ino==fsb.st_ino) {
-                       close(df);
-                       return(rbuf);
-               }
-       }
-       close(df);
-       return(NULL);
-}
diff --git a/.ref-Research-V7/usr/src/libc/gen/ttyslot.c b/.ref-Research-V7/usr/src/libc/gen/ttyslot.c
deleted file mode 100644 (file)
index 6449aab..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Return the number of the slot in the utmp file
- * corresponding to the current user: try for file 0, 1, 2.
- * Definition is the line number in the /etc/ttys file.
- */
-
-
-char   *ttyname();
-char   *getttys();
-char   *rindex();
-static char    ttys[]  = "/etc/ttys";
-
-#define        NULL    0
-
-ttyslot()
-{
-       register char *tp, *p;
-       register s, tf;
-
-       if ((tp=ttyname(0))==NULL && (tp=ttyname(1))==NULL && (tp=ttyname(2))==NULL)
-               return(0);
-       if ((p = rindex(tp, '/')) == NULL)
-               p = tp;
-       else
-               p++;
-       if ((tf=open(ttys, 0)) < 0)
-               return(0);
-       s = 0;
-       while (tp = getttys(tf)) {
-               s++;
-               if (strcmp(p, tp)==0) {
-                       close(tf);
-                       return(s);
-               }
-       }
-       close(tf);
-       return(0);
-}
-
-static char *
-getttys(f)
-{
-       static char line[32];
-       register char *lp;
-
-       lp = line;
-       for (;;) {
-               if (read(f, lp, 1) != 1)
-                       return(NULL);
-               if (*lp =='\n') {
-                       *lp = '\0';
-                       return(line+2);
-               }
-               if (lp >= &line[32])
-                       return(line+2);
-               lp++;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libc/mklib b/.ref-Research-V7/usr/src/libc/mklib
deleted file mode 100755 (executable)
index 56ecefe..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-ar rc libc.a \
-getgrgid.o \
-getgrnam.o \
-getgrent.o \
-getpass.o \
-getpwnam.o \
-getpwuid.o \
-getpwent.o \
-timezone.o \
-fgetc.o \
-fputc.o \
-getchar.o \
-putchar.o \
-popen.o \
-freopen.o \
-fgets.o \
-fputs.o \
-getpw.o \
-fseek.o \
-ftell.o \
-rew.o \
-rdwr.o \
-system.o \
-fopen.o \
-fdopen.o \
-scanf.o \
-doscan.o \
-fprintf.o \
-gets.o \
-getw.o \
-printf.o \
-puts.o \
-putw.o \
-sprintf.o \
-ungetc.o \
-filbuf.o \
-setbuf.o \
-fltpr.o \
-doprnt.o \
-gcvt.o \
-ffltpr.o \
-strout.o \
-flsbuf.o \
-endopen.o \
-findiop.o \
-clrerr.o \
-data.o \
-cuexit.o \
-execvp.o \
-getenv.o \
-getlogin.o \
-perror.o \
-sleep.o \
-ttyslot.o \
-ttyname.o \
-abort.o \
-abs.o \
-atof.o \
-atoi.o \
-atol.o \
-crypt.o \
-ctime.o \
-calloc.o \
-malloc.o \
-ecvt.o \
-errlst.o \
-fakcu.o \
-fakfp.o \
-frexp11.o \
-isatty.o \
-l3.o \
-ldexp11.o \
-ldfps.o \
-mktemp.o \
-modf11.o \
-mon.o \
-mpx.o \
-nlist.o \
-qsort.o \
-rand.o \
-setjmp.o \
-stty.o \
-swab.o \
-tell.o \
-ctype_.o \
-index.o \
-rindex.o \
-strcat.o \
-strncat.o \
-strcmp.o \
-strncmp.o \
-strcpy.o \
-strncpy.o \
-strlen.o \
-access.o \
-acct.o \
-alarm.o \
-chdir.o \
-chroot.o \
-chmod.o \
-chown.o \
-close.o \
-creat.o \
-dup.o \
-execl.o \
-execle.o \
-execv.o \
-execve.o \
-exit.o \
-fork.o \
-fstat.o \
-getgid.o \
-getpid.o \
-getuid.o \
-ioctl.o \
-kill.o \
-link.o \
-lock.o \
-lseek.o \
-mknod.o \
-mount.o \
-mpxcall.o \
-nice.o \
-open.o \
-pause.o \
-phys.o \
-pipe.o \
-profil.o \
-ptrace.o \
-read.o \
-sbrk.o \
-setgid.o \
-setuid.o \
-signal.o \
-stat.o \
-stime.o \
-sync.o \
-time.o \
-times.o \
-umask.o \
-umount.o \
-unlink.o \
-utime.o \
-wait.o \
-write.o \
-aldiv.o \
-almul.o \
-alrem.o \
-cerror.o \
-ldiv.o \
-lmul.o \
-lrem.o \
-mcount.o \
-csv.o
diff --git a/.ref-Research-V7/usr/src/libc/stdio/clrerr.c b/.ref-Research-V7/usr/src/libc/stdio/clrerr.c
deleted file mode 100644 (file)
index d0bb284..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include       <stdio.h>
-
-clearerr(iop)
-register struct _iobuf *iop;
-{
-       iop->_flag &= ~(_IOERR|_IOEOF);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/data.c b/.ref-Research-V7/usr/src/libc/stdio/data.c
deleted file mode 100644 (file)
index 56141c4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include <stdio.h>
-char   _sibuf[BUFSIZ];
-char   _sobuf[BUFSIZ];
-
-struct _iobuf  _iob[_NFILE] = {
-       { _sibuf, 0, _sibuf, _IOREAD, 0},
-       { NULL, 0, NULL, _IOWRT, 1},
-       {NULL, 0, NULL, _IOWRT+_IONBF, 2},
-};
-/*
- * Ptr to end of buffers
- */
-struct _iobuf  *_lastbuf = { &_iob[_NFILE] };
diff --git a/.ref-Research-V7/usr/src/libc/stdio/doprnt.s b/.ref-Research-V7/usr/src/libc/stdio/doprnt.s
deleted file mode 100644 (file)
index bed67a0..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-/ C library -- conversions
-
-width=-8.
-formp=-10.
-rjust=-12.
-ndfnd=-14.
-ndigit=-16.
-zfill=-18.
-.globl __doprnt
-
-.globl pfloat
-.globl pscien
-.globl pgen
-
-.globl __strout
-.globl csv
-.globl cret
-
-__doprnt:
-       jsr     r5,csv
-       sub     $128.+12.,sp
-       mov     4(r5),formp(r5)         / format
-       mov     6(r5),r4
-loop:
-       mov     sp,r3
-       mov     formp(r5),r1
-2:
-       movb    (r1)+,r2
-       beq     2f
-       cmp     r2,$'%
-       beq     2f
-       movb    r2,(r3)+
-       br      2b
-2:
-       mov     r1,formp(r5)
-       cmp     r3,sp
-       beq     2f
-       mov     sp,r0
-       mov     8(r5),-(sp)
-       clr     -(sp)
-       mov     r3,-(sp)
-       sub     r0,(sp)
-       mov     r0,-(sp)
-       jsr     pc,__strout
-       add     $8,sp
-2:
-       tst     r2
-       bne     2f
-       jmp     cret
-2:
-       mov     sp,r3
-2:
-       clr     rjust(r5)
-       clr     ndigit(r5)
-       mov     $' ,zfill(r5)
-       cmpb    *formp(r5),$'-
-       bne     2f
-       inc     formp(r5)
-       inc     rjust(r5)
-2:
-       cmpb    *formp(r5),$'0
-       bne     2f
-       mov     $'0,zfill(r5)
-2:
-       jsr     r3,gnum
-       mov     r1,width(r5)
-       clr     ndfnd(r5)
-       cmp     r0,$'.
-       bne     1f
-       jsr     r3,gnum
-       mov     r1,ndigit(r5)
-1:
-       mov     $swtab,r1
-1:
-       mov     (r1)+,r2
-       bne     2f
-       movb    r0,(r3)+
-       jmp     prbuf
-2:
-       cmp     r0,(r1)+
-       bne     1b
-       jmp     (r2)
-       .data
-swtab:
-       decimal;        'd
-       octal;          'o
-       hex;            'x
-       float;          'f
-       scien;          'e
-       general;        'g
-       charac;         'c
-       string;         's
-       longorunsg;     'l
-       longorunsg;     'L
-       unsigned;       'u
-       remote;         'r
-       long;           'D
-       loct;           'O
-       lhex;           'X
-       lunsigned;      'U
-       0;  0
-       .text
-
-general:
-       mov     ndigit(r5),r0
-       mov     ndfnd(r5),r2
-       jsr     pc,pgen
-       jbr     prbuf
-
-longorunsg:
-       movb    *formp(r5),r0
-       inc     formp(r5)
-       cmp     r0,$'o
-       beq     loct
-       cmp     r0,$'x
-       beq     lhex
-       cmp     r0,$'d
-       beq     long
-       cmp     r0,$'u
-       beq     lunsigned
-       dec     formp(r5)
-       br      unsigned
-
-octal:
-       clr     r0
-       br      1f
-loct:
-       mov     (r4)+,r0
-1:
-       mov     $8.,r2
-       br      2f
-
-hex:
-       clr     r0
-       br      1f
-
-lhex:
-       mov     (r4)+,r0
-1:
-       mov     $16.,r2
-2:
-       mov     (r4)+,r1
-       br      compute
-
-decimal:
-       mov     (r4)+,r1
-       sxt     r0
-       bmi     3f
-       br      2f
-
-unsigned:
-       clr     r0
-       br      1f
-
-long:
-       mov     (r4)+,r0
-       bge     1f
-       mov     (r4)+,r1
-3:
-       neg     r0
-       neg     r1
-       sbc     r0
-       movb    $'-,(r3)+
-       br      2f
-
-lunsigned:
-       mov     (r4)+,r0
-1:
-       mov     (r4)+,r1
-2:
-       mov     $10.,r2
-
-/
-/ Algorithm courtesy Keith Davis
-/
-compute:
-       mov     r5,-(sp)
-       mov     r4,-(sp)
-       mov     r0,r4
-       mov     ndigit(r5),r0
-       mov     r1,r5
-       ashc    $0,r4
-       beq     1f
-       tst     r0
-       beq     1f
-       movb    $'0,(r3)+
-1:
-       jsr     pc,1f
-       mov     (sp)+,r4
-       mov     (sp)+,r5
-       br      prbuf
-
-1:
-       clr     r0
-       mov     r4,r1
-       beq     2f
-       div     r2,r0
-       mov     r0,r4
-       mov     r1,r0
-2:
-       mov     r5,r1
-       asl     r2
-       div     r2,r0
-       asr     r2
-       asl     r0
-       cmp     r2,r1
-       bgt     2f
-       sub     r2,r1
-       inc     r0
-2:
-       mov     r1,-(sp)
-       mov     r0,r5
-       bne     2f
-       tst     r4
-       beq     1f
-2:
-       jsr     pc,1b
-1:
-       mov     (sp)+,r0
-       add     $'0,r0
-       cmp     r0,$'9
-       ble     1f
-       add     $'a-'0-10.,r0
-1:
-       movb    r0,(r3)+
-       rts     pc
-       
-charac:
-       mov     $' ,zfill(r5)
-       mov     (r4)+,r0
-       bic     $!377,r0
-       beq     prbuf
-       movb    r0,(r3)+
-       br      prbuf
-
-string:
-       mov     $' ,zfill(r5)
-       mov     ndigit(r5),r1
-       mov     (r4),r2
-       mov     r2,r3
-       bne     1f
-       mov     $nulstr,r2
-       mov     r2,r3
-       mov     r2,(r4)
-1:
-       tstb    (r2)+
-       beq     1f
-       inc     r3
-       sob     r1,1b
-1:
-       mov     (r4)+,r2
-       br      prstr
-
-float:
-       mov     ndigit(r5),r0
-       mov     ndfnd(r5),r2
-       jsr     pc,pfloat
-       br      prbuf
-
-scien:
-       mov     ndigit(r5),r0
-       inc     r0
-       tst     ndfnd(r5)
-       bne     1f
-       mov     $7,r0
-1:
-       mov     pc,r2
-       jsr     pc,pscien
-       br      prbuf
-
-remote:
-       mov     (r4)+,r4
-       mov     (r4)+,formp(r5)
-       jmp     loop
-
-prbuf:
-       mov     sp,r2
-prstr:
-       sub     r2,r3
-       mov     width(r5),r1
-       sub     r3,r1
-       bge     1f
-       clr     r1
-1:
-       tst     rjust(r5)
-       bne     1f
-       neg     r1
-1:
-       mov     zfill(r5),-(sp)
-       mov     8(r5),-(sp)
-       mov     r1,-(sp)
-       mov     r3,-(sp)
-       mov     r2,-(sp)
-       jsr     pc,__strout
-       add     $10.,sp
-       jmp     loop
-
-gnum:
-       clr     ndfnd(r5)
-       clr     r1
-1:
-       movb    *formp(r5),r0
-       inc     formp(r5)
-       sub     $'0,r0
-       cmp     r0,$'*-'0
-       bne     2f
-       mov     (r4)+,r0
-       br      3f
-2:
-       cmp     r0,$9.
-       bhi     1f
-3:
-       inc     ndfnd(r5)
-       mul     $10.,r1
-       add     r0,r1
-       br      1b
-1:
-       add     $'0,r0
-       rts     r3
-
-.data
-nulstr:
-       <(null)\0>
diff --git a/.ref-Research-V7/usr/src/libc/stdio/doscan.c b/.ref-Research-V7/usr/src/libc/stdio/doscan.c
deleted file mode 100644 (file)
index 95a9bb0..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-#include <stdio.h>
-#include       <ctype.h>
-
-#define        SPC     01
-#define        STP     02
-
-#define        SHORT   0
-#define        REGULAR 1
-#define        LONG    2
-#define        INT     0
-#define        FLOAT   1
-
-char   *_getccl();
-
-char   _sctab[128] = {
-       0,0,0,0,0,0,0,0,
-       0,SPC,SPC,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,
-       SPC,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,
-       0,0,0,0,0,0,0,0,
-};
-
-_doscan(iop, fmt, argp)
-FILE *iop;
-register char *fmt;
-register int **argp;
-{
-       register int ch;
-       int nmatch, len, ch1;
-       int **ptr, fileended, size;
-
-       nmatch = 0;
-       fileended = 0;
-       for (;;) switch (ch = *fmt++) {
-       case '\0': 
-               return (nmatch);
-       case '%': 
-               if ((ch = *fmt++) == '%')
-                       goto def;
-               ptr = 0;
-               if (ch != '*')
-                       ptr = argp++;
-               else
-                       ch = *fmt++;
-               len = 0;
-               size = REGULAR;
-               while (isdigit(ch)) {
-                       len = len*10 + ch - '0';
-                       ch = *fmt++;
-               }
-               if (len == 0)
-                       len = 30000;
-               if (ch=='l') {
-                       ch = *fmt++;
-                       size = LONG;
-               } else if (ch=='h') {
-                       size = SHORT;
-                       ch = *fmt++;
-               } else if (ch=='[')
-                       fmt = _getccl(fmt);
-               if (isupper(ch)) {
-                       ch = tolower(ch);
-                       size = LONG;
-               }
-               if (ch == '\0')
-                       return(-1);
-               if (_innum(ptr, ch, len, size, iop, &fileended) && ptr)
-                       nmatch++;
-               if (fileended)
-                       return(nmatch? nmatch: -1);
-               break;
-
-       case ' ':
-       case '\n':
-       case '\t': 
-               while ((ch1 = getc(iop))==' ' || ch1=='\t' || ch1=='\n')
-                       ;
-               if (ch1 != EOF)
-                       ungetc(ch1, iop);
-               break;
-
-       default: 
-       def:
-               ch1 = getc(iop);
-               if (ch1 != ch) {
-                       if (ch1==EOF)
-                               return(-1);
-                       ungetc(ch1, iop);
-                       return(nmatch);
-               }
-       }
-}
-
-_innum(ptr, type, len, size, iop, eofptr)
-int **ptr, *eofptr;
-struct _iobuf *iop;
-{
-       extern double atof();
-       register char *np;
-       char numbuf[64];
-       register c, base;
-       int expseen, scale, negflg, c1, ndigit;
-       long lcval;
-
-       if (type=='c' || type=='s' || type=='[')
-               return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr));
-       lcval = 0;
-       ndigit = 0;
-       scale = INT;
-       if (type=='e'||type=='f')
-               scale = FLOAT;
-       base = 10;
-       if (type=='o')
-               base = 8;
-       else if (type=='x')
-               base = 16;
-       np = numbuf;
-       expseen = 0;
-       negflg = 0;
-       while ((c = getc(iop))==' ' || c=='\t' || c=='\n');
-       if (c=='-') {
-               negflg++;
-               *np++ = c;
-               c = getc(iop);
-               len--;
-       } else if (c=='+') {
-               len--;
-               c = getc(iop);
-       }
-       for ( ; --len>=0; *np++ = c, c = getc(iop)) {
-               if (isdigit(c)
-                || base==16 && ('a'<=c && c<='f' || 'A'<=c && c<='F')) {
-                       ndigit++;
-                       if (base==8)
-                               lcval <<=3;
-                       else if (base==10)
-                               lcval = ((lcval<<2) + lcval)<<1;
-                       else
-                               lcval <<= 4;
-                       c1 = c;
-                       if ('0'<=c && c<='9')
-                               c -= '0';
-                       else if ('a'<=c && c<='f')
-                               c -= 'a'-10;
-                       else
-                               c -= 'A'-10;
-                       lcval += c;
-                       c = c1;
-                       continue;
-               } else if (c=='.') {
-                       if (base!=10 || scale==INT)
-                               break;
-                       ndigit++;
-                       continue;
-               } else if ((c=='e'||c=='E') && expseen==0) {
-                       if (base!=10 || scale==INT || ndigit==0)
-                               break;
-                       expseen++;
-                       *np++ = c;
-                       c = getc(iop);
-                       if (c!='+'&&c!='-'&&('0'>c||c>'9'))
-                               break;
-               } else
-                       break;
-       }
-       if (negflg)
-               lcval = -lcval;
-       if (c != EOF) {
-               ungetc(c, iop);
-               *eofptr = 0;
-       } else
-               *eofptr = 1;
-       if (ptr==NULL || np==numbuf)
-               return(0);
-       *np++ = 0;
-       switch((scale<<4) | size) {
-
-       case (FLOAT<<4) | SHORT:
-       case (FLOAT<<4) | REGULAR:
-               **(float **)ptr = atof(numbuf);
-               break;
-
-       case (FLOAT<<4) | LONG:
-               **(double **)ptr = atof(numbuf);
-               break;
-
-       case (INT<<4) | SHORT:
-               **(short **)ptr = lcval;
-               break;
-
-       case (INT<<4) | REGULAR:
-               **(int **)ptr = lcval;
-               break;
-
-       case (INT<<4) | LONG:
-               **(long **)ptr = lcval;
-               break;
-       }
-       return(1);
-}
-
-_instr(ptr, type, len, iop, eofptr)
-register char *ptr;
-register struct _iobuf *iop;
-int *eofptr;
-{
-       register ch;
-       register char *optr;
-       int ignstp;
-
-       *eofptr = 0;
-       optr = ptr;
-       if (type=='c' && len==30000)
-               len = 1;
-       ignstp = 0;
-       if (type=='s')
-               ignstp = SPC;
-       while (_sctab[ch = getc(iop)] & ignstp)
-               if (ch==EOF)
-                       break;
-       ignstp = SPC;
-       if (type=='c')
-               ignstp = 0;
-       else if (type=='[')
-               ignstp = STP;
-       while (ch!=EOF && (_sctab[ch]&ignstp)==0) {
-               if (ptr)
-                       *ptr++ = ch;
-               if (--len <= 0)
-                       break;
-               ch = getc(iop);
-       }
-       if (ch != EOF) {
-               if (len > 0)
-                       ungetc(ch, iop);
-               *eofptr = 0;
-       } else
-               *eofptr = 1;
-       if (ptr && ptr!=optr) {
-               if (type!='c')
-                       *ptr++ = '\0';
-               return(1);
-       }
-       return(0);
-}
-
-char *
-_getccl(s)
-register char *s;
-{
-       register c, t;
-
-       t = 0;
-       if (*s == '^') {
-               t++;
-               s++;
-       }
-       for (c = 0; c < 128; c++)
-               if (t)
-                       _sctab[c] &= ~STP;
-               else
-                       _sctab[c] |= STP;
-       while (((c = *s++)&0177) != ']') {
-               if (t)
-                       _sctab[c++] |= STP;
-               else
-                       _sctab[c++] &= ~STP;
-               if (c==0)
-                       return(--s);
-       }
-       return(s);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/endopen.c b/.ref-Research-V7/usr/src/libc/stdio/endopen.c
deleted file mode 100644 (file)
index 5e91de0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#include       <stdio.h>
-#include       <errno.h>
-
-FILE *
-_endopen(file, mode, iop)
-       char *file, *mode;
-       register FILE *iop;
-{
-       extern int errno;
-       register int rw, f;
-
-       if (iop == NULL)
-               return(NULL);
-
-       rw = mode[1] == '+';
-
-       switch (*mode) {
-
-       case 'w':
-               f = create(file, rw);
-               break;
-
-       case 'a':
-               if ((f = open(file, rw? 2: 1)) < 0) {
-                       if (errno == ENOENT)
-                               f = create(file, rw);
-               }
-               lseek(f, 0L, 2);
-               break;
-
-       case 'r':
-               f = open(file, rw? 2: 0);
-               break;
-
-       default:
-               return(NULL);
-       }
-
-       if (f < 0)
-               return(NULL);
-
-       iop->_cnt = 0;
-       iop->_file = f;
-
-       if (rw)
-               iop->_flag |= _IORW;
-       else if(*mode == 'r')
-               iop->_flag |= _IOREAD;
-       else
-               iop->_flag |= _IOWRT;
-
-       return(iop);
-}
-
-static int
-create(file, rw)
-       register char *file;
-       int rw;
-{
-       register int f;
-
-       f = creat(file, 0666);
-       if (rw && f>=0) {
-               close(f);
-               f = open(file, 2);
-       }
-       return(f);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fdopen.c b/.ref-Research-V7/usr/src/libc/stdio/fdopen.c
deleted file mode 100644 (file)
index 5ca8195..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Unix routine to do an "fopen" on file descriptor
- * The mode has to be repeated because you can't query its
- * status
- */
-
-#include       <stdio.h>
-#include       <errno.h>
-
-FILE *
-fdopen(fd, mode)
-       register char *mode;
-{
-       register FILE *iop;
-       FILE *_findiop();
-
-       if ((iop = _findiop()) == NULL)
-               return(NULL);
-
-       iop->_cnt = 0;
-       iop->_file = fd;
-       switch (*mode) {
-
-       case 'r':
-               iop->_flag |= _IOREAD;
-               break;
-
-       case 'a':
-               lseek(fd, 0L, 2);
-               /* No break */
-       case 'w':
-               iop->_flag |= _IOWRT;
-               break;
-
-       default:
-               return(NULL);
-       }
-
-       if (mode[1] == '+') {
-               iop->_flag &= ~(_IOREAD|_IOWRT);
-               iop->_flag |= _IORW;
-       }
-
-       return(iop);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/ffltpr.s b/.ref-Research-V7/usr/src/libc/stdio/ffltpr.s
deleted file mode 100644 (file)
index d816bf8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/ C library-- fake floating output
-
-.globl pfloat
-.globl pscien
-.globl pgen
-
-pfloat:
-pscien:
-pgen:
-       add     $8,r4
-       movb    $'?,(r3)+
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fgetc.c b/.ref-Research-V7/usr/src/libc/stdio/fgetc.c
deleted file mode 100644 (file)
index 3fdee12..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-fgetc(fp)
-FILE *fp;
-{
-       return(getc(fp));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fgets.c b/.ref-Research-V7/usr/src/libc/stdio/fgets.c
deleted file mode 100644 (file)
index fc7ee73..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include       <stdio.h>
-
-char *
-fgets(s, n, iop)
-char *s;
-register FILE *iop;
-{
-       register c;
-       register char *cs;
-
-       cs = s;
-       while (--n>0 && (c = getc(iop))>=0) {
-               *cs++ = c;
-               if (c=='\n')
-                       break;
-       }
-       if (c<0 && cs==s)
-               return(NULL);
-       *cs++ = '\0';
-       return(s);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/filbuf.c b/.ref-Research-V7/usr/src/libc/stdio/filbuf.c
deleted file mode 100644 (file)
index 3cb9555..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include       <stdio.h>
-
-char   *malloc();
-
-
-int
-_filbuf(iop)
-       register FILE *iop;
-{
-       static char smallbuf[_NFILE];
-
-       if (iop->_flag & _IORW)
-               iop->_flag |= _IOREAD;
-
-       if ((iop->_flag & _IOREAD) == 0 || iop->_flag & _IOSTRG)
-               return(EOF);
-
-tryagain:
-       if (iop->_base == NULL) {
-               if (iop->_flag & _IONBF) {
-                       iop->_base = &smallbuf[fileno(iop)];
-                       goto tryagain;
-               }
-               if ((iop->_base = malloc(BUFSIZ)) == NULL) {
-                       iop->_flag |= _IONBF;
-                       goto tryagain;
-               }
-               iop->_flag |= _IOMYBUF;
-       }
-       iop->_ptr = iop->_base;
-       iop->_cnt = read(fileno(iop), iop->_ptr, iop->_flag&_IONBF?1:BUFSIZ);
-       if (--iop->_cnt < 0) {
-               if (iop->_cnt == -1) {
-                       iop->_flag |= _IOEOF;
-                       if (iop->_flag & _IORW)
-                               iop->_flag &= ~_IOREAD;
-               } else
-                       iop->_flag |= _IOERR;
-               iop->_cnt = 0;
-               return(EOF);
-       }
-       return(*iop->_ptr++ & 0377);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/findiop.c b/.ref-Research-V7/usr/src/libc/stdio/findiop.c
deleted file mode 100644 (file)
index 752f820..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-
-FILE *
-_findiop()
-{
-       extern FILE *_lastbuf;
-       register FILE *iop;
-
-       for(iop = _iob; iop->_flag & (_IOREAD|_IOWRT|_IORW); iop++)
-               if (iop >= _lastbuf)
-                       return(NULL);
-
-       return(iop);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/flsbuf.c b/.ref-Research-V7/usr/src/libc/stdio/flsbuf.c
deleted file mode 100644 (file)
index b381bb2..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#include       <stdio.h>
-
-char   *malloc();
-
-int
-_flsbuf(c, iop)
-       int c;
-       register FILE *iop;
-{
-       register char *base;
-       register n, rn;
-       char c1;
-       extern char _sobuf[];
-
-       if (iop->_flag & _IORW) {
-               iop->_flag |= _IOWRT;
-               iop->_flag &= ~_IOEOF;
-       }
-
-tryagain:
-       if (iop->_flag & _IONBF) {
-               c1 = c;
-               rn = 1;
-               n = write(fileno(iop), &c1, rn);
-               iop->_cnt = 0;
-       } else {
-               if ((base = iop->_base) == NULL) {
-                       if (iop == stdout) {
-                               if (isatty(fileno(stdout))) {
-                                       iop->_flag |= _IONBF;
-                                       goto tryagain;
-                               }
-                               iop->_base = _sobuf;
-                               iop->_ptr = _sobuf;
-                               goto tryagain;
-                       }
-                       if ((iop->_base = base = malloc(BUFSIZ)) == NULL) {
-                               iop->_flag |= _IONBF;
-                               goto tryagain;
-                       }
-                       iop->_flag |= _IOMYBUF;
-                       rn = n = 0;
-               } else if((rn = n = iop->_ptr - base) > 0) {
-                       iop->_ptr = base;
-                       n = write(fileno(iop), base, n);
-               }
-               iop->_cnt = BUFSIZ - 1;
-               *base++ = c;
-               iop->_ptr = base;
-       }
-       if (rn != n) {
-               iop->_flag |= _IOERR;
-               return(EOF);
-       }
-       return(c);
-}
-
-int
-fflush(iop)
-       register FILE *iop;
-{
-       register char *base;
-       register n;
-
-       if ((iop->_flag & (_IONBF|_IOWRT)) == _IOWRT
-        && (base = iop->_base) != NULL && (n = iop->_ptr - base) > 0) {
-               iop->_ptr = base;
-               iop->_cnt = BUFSIZ;
-               if (write(fileno(iop), base, n) != n) {
-                       iop->_flag |= _IOERR;
-                       return(EOF);
-               }
-       }
-       return(0);
-}
-
-/*
- * Flush buffers on exit
- */
-
-_cleanup()
-{
-       register FILE *iop;
-       extern FILE *_lastbuf;
-
-       for(iop = _iob; iop < _lastbuf; iop++)
-               fclose(iop);
-}
-
-int
-fclose(iop)
-       register FILE *iop;
-{
-       register r;
-
-       r = EOF;
-       if (iop->_flag & (_IOREAD|_IOWRT|_IORW)
-           && (iop->_flag & _IOSTRG) == 0) {
-               r = fflush(iop);
-               if (close(fileno(iop)) < 0)
-                       r = EOF;
-               if (iop->_flag & _IOMYBUF)
-                       free(iop->_base);
-               if (iop->_flag & (_IOMYBUF|_IONBF))
-                       iop->_base = NULL;
-       }
-       iop->_flag &=
-               ~(_IOREAD|_IOWRT|_IONBF|_IOMYBUF|_IOERR|_IOEOF|_IOSTRG|_IORW);
-       iop->_cnt = 0;
-       return(r);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fltpr.s b/.ref-Research-V7/usr/src/libc/stdio/fltpr.s
deleted file mode 100644 (file)
index 51cf7da..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/ C library-- floating output
-
-.globl pfloat
-.globl pscien
-.globl pgen
-.globl fltused
-
-.globl _ecvt
-.globl _fcvt
-.globl _gcvt
-
-fltused:               / force loading
-
-pgen:
-       mov     r3,-(sp)
-       mov     r0,-(sp)
-       tst     r2
-       bne     1f
-       mov     $6,(sp)
-1:
-       movf    (r4)+,fr0
-       movf    fr0,-(sp)
-       jsr     pc,_gcvt
-       add     $8+2+2,sp
-1:
-       tstb    (r3)+
-       bne     1b
-       dec     r3
-       rts     pc
-
-pfloat:
-       mov     $sign,-(sp)
-       mov     $decpt,-(sp)
-       tst     r2
-       bne     1f
-       mov     $6,r0
-1:
-       mov     r0,-(sp)
-       mov     r0,ndigit
-       movf    (r4)+,fr0
-       movf    fr0,-(sp)
-       jsr     pc,_fcvt
-       add     $8+2+2+2,sp
-       tst     sign
-       beq     1f
-       movb    $'-,(r3)+
-1:
-       mov     decpt,r2
-       bgt     1f
-       movb    $'0,(r3)+
-1:
-       mov     r2,r1
-       ble     1f
-2:
-       movb    (r0)+,(r3)+
-       sob     r1,2b
-1:
-       mov     ndigit,r1
-       beq     1f
-       movb    $'.,(r3)+
-1:
-       neg     r2
-       ble     1f
-2:
-       dec     r1
-       blt     1f
-       movb    $'0,(r3)+
-       sob     r2,2b
-1:
-       tst     r1
-       ble     2f
-1:
-       movb    (r0)+,(r3)+
-       sob     r1,1b
-2:
-       rts     pc
-
-pscien:
-       mov     $sign,-(sp)
-       mov     $decpt,-(sp)
-       mov     r0,-(sp)
-       mov     r0,ndigit
-       tst     r2
-       bne     1f
-       mov     $6,(sp)
-1:
-       movf    (r4)+,fr0
-       movf    fr0,-(sp)
-       jsr     pc,_ecvt
-       add     $8+2+2+2,sp
-       tst     sign
-       beq     1f
-       movb    $'-,(r3)+
-1:
-       cmpb    (r0),$'0
-       bne     1f
-       inc     decpt
-1:
-       movb    (r0)+,(r3)+
-       movb    $'.,(r3)+
-       mov     ndigit,r1
-       dec     r1
-       ble     1f
-2:
-       movb    (r0)+,(r3)+
-       sob     r1,2b
-1:
-       movb    $'e,(r3)+
-       mov     decpt,r2
-       dec     r2
-       mov     r2,r1
-       bge     1f
-       movb    $'-,(r3)+
-       neg     r1
-       br      2f
-1:
-       movb    $'+,(r3)+
-2:
-       clr     r0
-       div     $10.,r0
-       add     $'0,r0
-       movb    r0,(r3)+
-       add     $'0,r1
-       movb    r1,(r3)+
-       rts     pc
-.data
-sign:  .=.+2
-ndigit:        .=.+2
-decpt: .=.+2
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fopen.c b/.ref-Research-V7/usr/src/libc/stdio/fopen.c
deleted file mode 100644 (file)
index a5a04e5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include       <stdio.h>
-
-FILE *
-fopen(file, mode)
-       char *file, *mode;
-{
-       FILE *_findiop(), *_endopen();
-
-       return(_endopen(file, mode, _findiop()));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fprintf.c b/.ref-Research-V7/usr/src/libc/stdio/fprintf.c
deleted file mode 100644 (file)
index 3abd1f9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include       <stdio.h>
-
-fprintf(iop, fmt, args)
-FILE *iop;
-char *fmt;
-{
-       _doprnt(fmt, &args, iop);
-       return(ferror(iop)? EOF: 0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fputc.c b/.ref-Research-V7/usr/src/libc/stdio/fputc.c
deleted file mode 100644 (file)
index 780547f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-fputc(c, fp)
-FILE *fp;
-{
-       return(putc(c, fp));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fputs.c b/.ref-Research-V7/usr/src/libc/stdio/fputs.c
deleted file mode 100644 (file)
index f543586..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include       <stdio.h>
-
-fputs(s, iop)
-register char *s;
-register FILE *iop;
-{
-       register r;
-       register c;
-
-       while (c = *s++)
-               r = putc(c, iop);
-       return(r);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/freopen.c b/.ref-Research-V7/usr/src/libc/stdio/freopen.c
deleted file mode 100644 (file)
index 016c0b2..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <stdio.h>
-
-FILE *
-freopen(file, mode, iop)
-       char *file, *mode;
-       register FILE *iop;
-{
-       FILE *_endopen();
-
-       fclose(iop);
-       return(_endopen(file, mode, iop));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/fseek.c b/.ref-Research-V7/usr/src/libc/stdio/fseek.c
deleted file mode 100644 (file)
index ecbda88..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Seek for standard library.  Coordinates with buffering.
- */
-
-#include       <stdio.h>
-
-long lseek();
-
-fseek(iop, offset, ptrname)
-       register FILE *iop;
-       long offset;
-{
-       register int c;
-       long p;
-
-       iop->_flag &= ~_IOEOF;
-       if (iop->_flag & _IOREAD) {
-               if (ptrname < 2 && iop->_base && !(iop->_flag&_IONBF)) {
-                       c = iop->_cnt;
-                       p = offset;
-                       if (ptrname == 0)
-                               p += c - lseek(fileno(iop), 0L, 1);
-                       else
-                               offset -= c;
-                       if (!(iop->_flag&_IORW) && c > 0 && p <= c
-                           && p >= iop->_base - iop->_ptr){
-                               iop->_ptr += (int) p;
-                               iop->_cnt -= (int) p;
-                               return(0);
-                       }
-               }
-               if (iop->_flag & _IORW) {
-                       iop->_ptr = iop->_base;
-                       iop->_flag &= ~_IOREAD;
-               }
-               p = lseek(fileno(iop), offset, ptrname);
-               iop->_cnt = 0;
-       } else if(iop->_flag & (_IOWRT|_IORW)) {
-               fflush(iop);
-               if (iop->_flag & _IORW) {
-                       iop->_cnt = 0;
-                       iop->_flag &= ~_IOWRT;
-                       iop->_ptr = iop->_base;
-               }
-               p = lseek(fileno(iop), offset, ptrname);
-       }
-       return(p==-1? -1: 0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/ftell.c b/.ref-Research-V7/usr/src/libc/stdio/ftell.c
deleted file mode 100644 (file)
index 1f328a4..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Return file offset.
- * Coordinates with buffering.
- */
-
-#include       <stdio.h>
-long   lseek();
-
-
-long ftell(iop)
-FILE *iop;
-{
-       long tres;
-       register adjust;
-
-       if (iop->_cnt < 0)
-               iop->_cnt = 0;
-       if (iop->_flag&_IOREAD)
-               adjust = - iop->_cnt;
-       else if(iop->_flag&(_IOWRT|_IORW)) {
-               adjust = 0;
-               if (iop->_flag&_IOWRT && iop->_base && (iop->_flag&_IONBF)==0)
-                       adjust = iop->_ptr - iop->_base;
-       } else
-               return(-1);
-       tres = lseek(fileno(iop), 0L, 1);
-       if (tres<0)
-               return(tres);
-       tres += adjust;
-       return(tres);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/gcvt.c b/.ref-Research-V7/usr/src/libc/stdio/gcvt.c
deleted file mode 100644 (file)
index db39bb7..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * gcvt  - Floating output conversion to
- * minimal length string
- */
-
-char   *ecvt();
-
-char *
-gcvt(number, ndigit, buf)
-double number;
-char *buf;
-{
-       int sign, decpt;
-       register char *p1, *p2;
-       register i;
-
-       p1 = ecvt(number, ndigit, &decpt, &sign);
-       p2 = buf;
-       if (sign)
-               *p2++ = '-';
-       for (i=ndigit-1; i>0 && p1[i]=='0'; i--)
-               ndigit--;
-       if (decpt >= 0 && decpt-ndigit > 4
-        || decpt < 0 && decpt < -3) { /* use E-style */
-               decpt--;
-               *p2++ = *p1++;
-               *p2++ = '.';
-               for (i=1; i<ndigit; i++)
-                       *p2++ = *p1++;
-               *p2++ = 'e';
-               if (decpt<0) {
-                       decpt = -decpt;
-                       *p2++ = '-';
-               } else
-                       *p2++ = '+';
-               *p2++ = decpt/10 + '0';
-               *p2++ = decpt%10 + '0';
-       } else {
-               if (decpt<=0) {
-                       if (*p1!='0')
-                               *p2++ = '.';
-                       while (decpt<0) {
-                               decpt++;
-                               *p2++ = '0';
-                       }
-               }
-               for (i=1; i<=ndigit; i++) {
-                       *p2++ = *p1++;
-                       if (i==decpt)
-                               *p2++ = '.';
-               }
-               if (ndigit<decpt) {
-                       while (ndigit++<decpt)
-                               *p2++ = '0';
-                       *p2++ = '.';
-               }
-       }
-       if (p2[-1]=='.')
-               p2--;
-       *p2 = '\0';
-       return(buf);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getchar.c b/.ref-Research-V7/usr/src/libc/stdio/getchar.c
deleted file mode 100644 (file)
index 99382bb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * A subroutine version of the macro getchar.
- */
-#include <stdio.h>
-
-#undef getchar
-
-getchar()
-{
-       return(getc(stdin));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getgrent.c b/.ref-Research-V7/usr/src/libc/stdio/getgrent.c
deleted file mode 100644 (file)
index bbe7ab7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <stdio.h>
-#include <grp.h>
-
-#define        CL      ':'
-#define        CM      ','
-#define        NL      '\n'
-#define        MAXGRP  100
-
-static char GROUP[] = "/etc/group";
-static FILE *grf = NULL;
-static char line[BUFSIZ+1];
-static struct group group;
-static char *gr_mem[MAXGRP];
-
-setgrent()
-{
-       if( !grf )
-               grf = fopen( GROUP, "r" );
-       else
-               rewind( grf );
-}
-
-endgrent()
-{
-       if( grf ){
-               fclose( grf );
-               grf = NULL;
-       }
-}
-
-static char *
-grskip(p,c)
-register char *p;
-register c;
-{
-       while( *p && *p != c ) ++p;
-       if( *p ) *p++ = 0;
-       return( p );
-}
-
-struct group *
-getgrent()
-{
-       register char *p, **q;
-
-       if( !grf && !(grf = fopen( GROUP, "r" )) )
-               return(NULL);
-       if( !(p = fgets( line, BUFSIZ, grf )) )
-               return(NULL);
-       group.gr_name = p;
-       group.gr_passwd = p = grskip(p,CL);
-       group.gr_gid = atoi( p = grskip(p,CL) );
-       group.gr_mem = gr_mem;
-       p = grskip(p,CL);
-       grskip(p,NL);
-       q = gr_mem;
-       while( *p ){
-               *q++ = p;
-               p = grskip(p,CM);
-       }
-       *q = NULL;
-       return( &group );
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getgrgid.c b/.ref-Research-V7/usr/src/libc/stdio/getgrgid.c
deleted file mode 100644 (file)
index 62fa18c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <grp.h>
-
-struct group *
-getgrgid(gid)
-register gid;
-{
-       register struct group *p;
-       struct group *getgrent();
-
-       setgrent();
-       while( (p = getgrent()) && p->gr_gid != gid );
-       endgrent();
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getgrnam.c b/.ref-Research-V7/usr/src/libc/stdio/getgrnam.c
deleted file mode 100644 (file)
index 28e4612..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <grp.h>
-
-struct group *
-getgrnam(name)
-register char *name;
-{
-       register struct group *p;
-       struct group *getgrent();
-
-       setgrent();
-       while( (p = getgrent()) && strcmp(p->gr_name,name) );
-       endgrent();
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getpass.c b/.ref-Research-V7/usr/src/libc/stdio/getpass.c
deleted file mode 100644 (file)
index 51bf36b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-#include <sgtty.h>
-
-char *
-getpass(prompt)
-char *prompt;
-{
-       struct sgttyb ttyb;
-       int flags;
-       register char *p;
-       register c;
-       FILE *fi;
-       static char pbuf[9];
-       int (*signal())();
-       int (*sig)();
-
-       if ((fi = fopen("/dev/tty", "r")) == NULL)
-               fi = stdin;
-       else
-               setbuf(fi, (char *)NULL);
-       sig = signal(SIGINT, SIG_IGN);
-       gtty(fileno(fi), &ttyb);
-       flags = ttyb.sg_flags;
-       ttyb.sg_flags &= ~ECHO;
-       stty(fileno(fi), &ttyb);
-       fprintf(stderr, prompt);
-       for (p=pbuf; (c = getc(fi))!='\n' && c!=EOF;) {
-               if (p < &pbuf[8])
-                       *p++ = c;
-       }
-       *p = '\0';
-       fprintf(stderr, "\n");
-       ttyb.sg_flags = flags;
-       stty(fileno(fi), &ttyb);
-       signal(SIGINT, sig);
-       if (fi != stdin)
-               fclose(fi);
-       return(pbuf);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getpw.c b/.ref-Research-V7/usr/src/libc/stdio/getpw.c
deleted file mode 100644 (file)
index 22fc86c..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#include       <stdio.h>
-
-getpw(uid, buf)
-int uid;
-char buf[];
-{
-       static FILE *pwf;
-       register n, c;
-       register char *bp;
-
-       if(pwf == 0)
-               pwf = fopen("/etc/passwd", "r");
-       if(pwf == NULL)
-               return(1);
-       rewind(pwf);
-
-       for (;;) {
-               bp = buf;
-               while((c=getc(pwf)) != '\n') {
-                       if(c == EOF)
-                               return(1);
-                       *bp++ = c;
-               }
-               *bp++ = '\0';
-               bp = buf;
-               n = 3;
-               while(--n)
-               while((c = *bp++) != ':')
-                       if(c == '\n')
-                               return(1);
-               while((c = *bp++) != ':') {
-                       if(c<'0' || c>'9')
-                               continue;
-                       n = n*10+c-'0';
-               }
-               if(n == uid)
-                       return(0);
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getpwent.c b/.ref-Research-V7/usr/src/libc/stdio/getpwent.c
deleted file mode 100644 (file)
index 5aebd40..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#include <stdio.h>
-#include <pwd.h>
-
-static char PASSWD[]   = "/etc/passwd";
-static char EMPTY[] = "";
-static FILE *pwf = NULL;
-static char line[BUFSIZ+1];
-static struct passwd passwd;
-
-setpwent()
-{
-       if( pwf == NULL )
-               pwf = fopen( PASSWD, "r" );
-       else
-               rewind( pwf );
-}
-
-endpwent()
-{
-       if( pwf != NULL ){
-               fclose( pwf );
-               pwf = NULL;
-       }
-}
-
-static char *
-pwskip(p)
-register char *p;
-{
-       while( *p && *p != ':' )
-               ++p;
-       if( *p ) *p++ = 0;
-       return(p);
-}
-
-struct passwd *
-getpwent()
-{
-       register char *p;
-
-       if (pwf == NULL) {
-               if( (pwf = fopen( PASSWD, "r" )) == NULL )
-                       return(0);
-       }
-       p = fgets(line, BUFSIZ, pwf);
-       if (p==NULL)
-               return(0);
-       passwd.pw_name = p;
-       p = pwskip(p);
-       passwd.pw_passwd = p;
-       p = pwskip(p);
-       passwd.pw_uid = atoi(p);
-       p = pwskip(p);
-       passwd.pw_gid = atoi(p);
-       passwd.pw_quota = 0;
-       passwd.pw_comment = EMPTY;
-       p = pwskip(p);
-       passwd.pw_gecos = p;
-       p = pwskip(p);
-       passwd.pw_dir = p;
-       p = pwskip(p);
-       passwd.pw_shell = p;
-       while(*p && *p != '\n') p++;
-       *p = '\0';
-       return(&passwd);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getpwnam.c b/.ref-Research-V7/usr/src/libc/stdio/getpwnam.c
deleted file mode 100644 (file)
index 34cc0e7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <pwd.h>
-
-struct passwd *
-getpwnam(name)
-char *name;
-{
-       register struct passwd *p;
-       struct passwd *getpwent();
-
-       setpwent();
-       while( (p = getpwent()) && strcmp(name,p->pw_name) );
-       endpwent();
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getpwuid.c b/.ref-Research-V7/usr/src/libc/stdio/getpwuid.c
deleted file mode 100644 (file)
index d086574..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <pwd.h>
-
-struct passwd *
-getpwuid(uid)
-register uid;
-{
-       register struct passwd *p;
-       struct passwd *getpwent();
-
-       setpwent();
-       while( (p = getpwent()) && p->pw_uid != uid );
-       endpwent();
-       return(p);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/gets.c b/.ref-Research-V7/usr/src/libc/stdio/gets.c
deleted file mode 100644 (file)
index da51cb3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include       <stdio.h>
-
-char *
-gets(s)
-char *s;
-{
-       register c;
-       register char *cs;
-
-       cs = s;
-       while ((c = getchar()) != '\n' && c >= 0)
-               *cs++ = c;
-       if (c<0 && cs==s)
-               return(NULL);
-       *cs++ = '\0';
-       return(s);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/getw.c b/.ref-Research-V7/usr/src/libc/stdio/getw.c
deleted file mode 100644 (file)
index 572520e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include       <stdio.h>
-
-getw(iop)
-register struct _iobuf *iop;
-{
-       register i;
-
-       i = getc(iop);
-       if (iop->_flag&_IOEOF)
-               return(-1);
-       return(i | (getc(iop)<<8));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/popen.c b/.ref-Research-V7/usr/src/libc/stdio/popen.c
deleted file mode 100644 (file)
index 44fea97..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <stdio.h>
-#include <signal.h>
-#define        tst(a,b)        (*mode == 'r'? (b) : (a))
-#define        RDR     0
-#define        WTR     1
-static int     popen_pid[20];
-
-FILE *
-popen(cmd,mode)
-char   *cmd;
-char   *mode;
-{
-       int p[2];
-       register myside, hisside, pid;
-
-       if(pipe(p) < 0)
-               return NULL;
-       myside = tst(p[WTR], p[RDR]);
-       hisside = tst(p[RDR], p[WTR]);
-       if((pid = fork()) == 0) {
-               /* myside and hisside reverse roles in child */
-               close(myside);
-               dup2(hisside, tst(0, 1));
-               close(hisside);
-               execl("/bin/sh", "sh", "-c", cmd, 0);
-               _exit(1);
-       }
-       if(pid == -1)
-               return NULL;
-       popen_pid[myside] = pid;
-       close(hisside);
-       return(fdopen(myside, mode));
-}
-
-pclose(ptr)
-FILE *ptr;
-{
-       register f, r, (*hstat)(), (*istat)(), (*qstat)();
-       int status;
-
-       f = fileno(ptr);
-       fclose(ptr);
-       istat = signal(SIGINT, SIG_IGN);
-       qstat = signal(SIGQUIT, SIG_IGN);
-       hstat = signal(SIGHUP, SIG_IGN);
-       while((r = wait(&status)) != popen_pid[f] && r != -1)
-               ;
-       if(r == -1)
-               status = -1;
-       signal(SIGINT, istat);
-       signal(SIGQUIT, qstat);
-       signal(SIGHUP, hstat);
-       return(status);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/printf.c b/.ref-Research-V7/usr/src/libc/stdio/printf.c
deleted file mode 100644 (file)
index bfc28fb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#include       <stdio.h>
-
-printf(fmt, args)
-char *fmt;
-{
-       _doprnt(fmt, &args, stdout);
-       return(ferror(stdout)? EOF: 0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/putchar.c b/.ref-Research-V7/usr/src/libc/stdio/putchar.c
deleted file mode 100644 (file)
index 83ad2c6..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * A subroutine version of the macro putchar
- */
-#include <stdio.h>
-
-#undef putchar
-
-putchar(c)
-register c;
-{
-       putc(c, stdout);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/puts.c b/.ref-Research-V7/usr/src/libc/stdio/puts.c
deleted file mode 100644 (file)
index 45fd37b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include       <stdio.h>
-
-puts(s)
-register char *s;
-{
-       register c;
-
-       while (c = *s++)
-               putchar(c);
-       return(putchar('\n'));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/putw.c b/.ref-Research-V7/usr/src/libc/stdio/putw.c
deleted file mode 100644 (file)
index accd47e..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include       <stdio.h>
-
-putw(i, iop)
-register i;
-register struct _iobuf *iop;
-{
-       putc(i, iop);
-       putc(i>>8, iop);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/rdwr.c b/.ref-Research-V7/usr/src/libc/stdio/rdwr.c
deleted file mode 100644 (file)
index 26385a8..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include       <stdio.h>
-
-fread(ptr, size, count, iop)
-unsigned size, count;
-register char *ptr;
-register FILE *iop;
-{
-       register c;
-       unsigned ndone, s;
-
-       ndone = 0;
-       if (size)
-       for (; ndone<count; ndone++) {
-               s = size;
-               do {
-                       if ((c = getc(iop)) >= 0)
-                               *ptr++ = c;
-                       else
-                               return(ndone);
-               } while (--s);
-       }
-       return(ndone);
-}
-
-fwrite(ptr, size, count, iop)
-unsigned size, count;
-register char *ptr;
-register FILE *iop;
-{
-       register unsigned s;
-       unsigned ndone;
-
-       ndone = 0;
-       if (size)
-       for (; ndone<count; ndone++) {
-               s = size;
-               do {
-                       putc(*ptr++, iop);
-               } while (--s);
-               if (ferror(iop))
-                       break;
-       }
-       return(ndone);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/rew.c b/.ref-Research-V7/usr/src/libc/stdio/rew.c
deleted file mode 100644 (file)
index 2184a4f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#include       <stdio.h>
-
-rewind(iop)
-       register struct _iobuf *iop;
-{
-       fflush(iop);
-       lseek(fileno(iop), 0L, 0);
-       iop->_cnt = 0;
-       iop->_ptr = iop->_base;
-       iop->_flag &= ~(_IOERR|_IOEOF);
-       if (iop->_flag & _IORW)
-               iop->_flag &= ~(_IOREAD|_IOWRT);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/scanf.c b/.ref-Research-V7/usr/src/libc/stdio/scanf.c
deleted file mode 100644 (file)
index 012c567..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#include       <stdio.h>
-
-scanf(fmt, args)
-char *fmt;
-{
-       return(_doscan(stdin, fmt, &args));
-}
-
-fscanf(iop, fmt, args)
-FILE *iop;
-char *fmt;
-{
-       return(_doscan(iop, fmt, &args));
-}
-
-sscanf(str, fmt, args)
-register char *str;
-char *fmt;
-{
-       FILE _strbuf;
-
-       _strbuf._flag = _IOREAD|_IOSTRG;
-       _strbuf._ptr = _strbuf._base = str;
-       _strbuf._cnt = 0;
-       while (*str++)
-               _strbuf._cnt++;
-       return(_doscan(&_strbuf, fmt, &args));
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/setbuf.c b/.ref-Research-V7/usr/src/libc/stdio/setbuf.c
deleted file mode 100644 (file)
index 58aa65a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#include       <stdio.h>
-
-setbuf(iop, buf)
-register struct _iobuf *iop;
-char *buf;
-{
-       if (iop->_base != NULL && iop->_flag&_IOMYBUF)
-               free(iop->_base);
-       iop->_flag &= ~(_IOMYBUF|_IONBF);
-       if ((iop->_base = buf) == NULL)
-               iop->_flag |= _IONBF;
-       else
-               iop->_ptr = iop->_base;
-       iop->_cnt = 0;
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/sprintf.c b/.ref-Research-V7/usr/src/libc/stdio/sprintf.c
deleted file mode 100644 (file)
index a9c5ef9..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#include       <stdio.h>
-
-char *sprintf(str, fmt, args)
-char *str, *fmt;
-{
-       struct _iobuf _strbuf;
-
-       _strbuf._flag = _IOWRT+_IOSTRG;
-       _strbuf._ptr = str;
-       _strbuf._cnt = 32767;
-       _doprnt(fmt, &args, &_strbuf);
-       putc('\0', &_strbuf);
-       return(str);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/strout.c b/.ref-Research-V7/usr/src/libc/stdio/strout.c
deleted file mode 100644 (file)
index f981583..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#include       <stdio.h>
-
-_strout(string, count, adjust, file, fillch)
-register char *string;
-register count;
-int adjust;
-register struct _iobuf *file;
-{
-       while (adjust < 0) {
-               if (*string=='-' && fillch=='0') {
-                       putc(*string++, file);
-                       count--;
-               }
-               putc(fillch, file);
-               adjust++;
-       }
-       while (--count>=0)
-               putc(*string++, file);
-       while (adjust) {
-               putc(fillch, file);
-               adjust--;
-       }
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/system.c b/.ref-Research-V7/usr/src/libc/stdio/system.c
deleted file mode 100644 (file)
index 1649353..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include       <signal.h>
-
-system(s)
-char *s;
-{
-       int status, pid, w;
-       register int (*istat)(), (*qstat)();
-
-       if ((pid = fork()) == 0) {
-               execl("/bin/sh", "sh", "-c", s, 0);
-               _exit(127);
-       }
-       istat = signal(SIGINT, SIG_IGN);
-       qstat = signal(SIGQUIT, SIG_IGN);
-       while ((w = wait(&status)) != pid && w != -1)
-               ;
-       if (w == -1)
-               status = -1;
-       signal(SIGINT, istat);
-       signal(SIGQUIT, qstat);
-       return(status);
-}
diff --git a/.ref-Research-V7/usr/src/libc/stdio/ungetc.c b/.ref-Research-V7/usr/src/libc/stdio/ungetc.c
deleted file mode 100644 (file)
index 23c5254..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <stdio.h>
-
-ungetc(c, iop)
-register FILE *iop;
-{
-       if (c == EOF)
-               return(-1);
-       if ((iop->_flag&_IOREAD)==0 || iop->_ptr <= iop->_base)
-               if (iop->_ptr == iop->_base && iop->_cnt==0)
-                       *iop->_ptr++;
-               else
-                       return(-1);
-       iop->_cnt++;
-       *--iop->_ptr = c;
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/sys/access.s b/.ref-Research-V7/usr/src/libc/sys/access.s
deleted file mode 100644 (file)
index 78c88ef..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ access(file, request)
-/  test ability to access file in all indicated ways
-/  1 - read
-/  2 - write
-/  4 - execute
-
-.globl _access
-.globl csv, cret
-.comm  _errno,2
-
-.access = 33.
-
-_access:
-       jsr     r5,csv
-       mov     4(r5),0f+2
-       mov     6(r5),0f+4
-       clr     r0
-       sys     0; 0f
-.data
-0:     sys     .access; ..; ..
-.text
-       bec     1f
-       mov     r0,_errno
-       mov     $-1,r0
-1:
-       jmp     cret
diff --git a/.ref-Research-V7/usr/src/libc/sys/acct.s b/.ref-Research-V7/usr/src/libc/sys/acct.s
deleted file mode 100644 (file)
index ecbbe47..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- acct
-
-/ error = acct(string);
-
-.globl _acct
-.globl cerror
-.acct = 51.
-
-_acct:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .acct; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/alarm.s b/.ref-Research-V7/usr/src/libc/sys/alarm.s
deleted file mode 100644 (file)
index e5f0068..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/ C library - alarm
-
-.globl _alarm
-.alarm = 27.
-
-_alarm:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       sys     .alarm
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/chdir.s b/.ref-Research-V7/usr/src/libc/sys/chdir.s
deleted file mode 100644 (file)
index 646f5e8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- chdir
-
-/ error = chdir(string);
-
-.globl _chdir
-.globl cerror
-.chdir = 12.
-
-_chdir:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .chdir; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/chmod.s b/.ref-Research-V7/usr/src/libc/sys/chmod.s
deleted file mode 100644 (file)
index da58b90..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- chmod
-
-/ error = chmod(string, mode);
-
-.globl _chmod
-.globl cerror
-.chmod = 15.
-
-_chmod:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .chmod; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/chown.s b/.ref-Research-V7/usr/src/libc/sys/chown.s
deleted file mode 100644 (file)
index 09dc3ee..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- chown
-
-/ error = chown(string, owner);
-
-.globl _chown,
-.globl cerror
-.chown = 16.
-
-_chown:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     8(r5),0f+4
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .chown; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/chroot.s b/.ref-Research-V7/usr/src/libc/sys/chroot.s
deleted file mode 100644 (file)
index b7e3814..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- chroot
-
-/ error = chroot(string);
-
-.globl _chroot
-.globl cerror
-.chroot = 61.
-
-_chroot:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .chroot; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/close.s b/.ref-Research-V7/usr/src/libc/sys/close.s
deleted file mode 100644 (file)
index a540e6f..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- close
-
-/ error =  close(file);
-
-.globl _close,
-.globl cerror
-.close = 6.
-
-_close:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       sys     .close
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/creat.s b/.ref-Research-V7/usr/src/libc/sys/creat.s
deleted file mode 100644 (file)
index d9e3178..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- creat
-
-/ file = creat(string, mode);
-/
-/ file == -1 if error
-
-.globl _creat
-.globl cerror
-.creat = 8.
-
-_creat:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .creat; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/dup.s b/.ref-Research-V7/usr/src/libc/sys/dup.s
deleted file mode 100644 (file)
index 907df94..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/ C library -- dup
-
-/      f = dup(of [ ,nf])
-/      f == -1 for error
-
-.globl _dup,_dup2
-.globl cerror
-.dup = 41.
-
-_dup2:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       bis     $100,r0
-       br      1f
-
-_dup:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-1:
-       mov     6(r5),r1
-       sys     .dup
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/execl.s b/.ref-Research-V7/usr/src/libc/sys/execl.s
deleted file mode 100644 (file)
index 3195d81..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- execl
-
-/ execl(file, arg1, arg2, ... , 0);
-/
-/ environment automatically passed
-
-.globl _execl
-.globl cerror, _environ
-.exece = 59.
-
-_execl:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     r5,r0
-       add     $6,r0
-       mov     r0,0f+2
-       mov     _environ,0f+4
-       sys     0; 9f
-       jmp     cerror
-.data
-9:
-       sys     .exece; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/execle.s b/.ref-Research-V7/usr/src/libc/sys/execle.s
deleted file mode 100644 (file)
index ccfd5e6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/ C library -- execle
-
-/ execle(file, arg1, arg2, ... , 0, env);
-/
-
-.globl _execle
-.globl cerror
-.exece = 59.
-
-_execle:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     r5,r0
-       add     $6,r0
-       mov     r0,0f+2
-1:
-       tst     (r0)+
-       bne     1b
-       mov     (r0),0f+4
-       sys     0; 9f
-       jmp     cerror
-.data
-9:
-       sys     .exece; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/execv.s b/.ref-Research-V7/usr/src/libc/sys/execv.s
deleted file mode 100644 (file)
index c4abfd0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- execv
-
-/ execv(file, argv);
-/
-/ where argv is a vector argv[0] ... argv[x], 0
-/ last vector element must be 0
-/ environment passed automatically
-
-.globl _execv,
-.globl cerror, _environ
-.exece = 59.
-
-_execv:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     _environ,0f+4
-       sys     0; 9f
-       jmp     cerror
-.data
-9:
-       sys     .exece; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/execve.s b/.ref-Research-V7/usr/src/libc/sys/execve.s
deleted file mode 100644 (file)
index a270d0c..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- execve
-
-/ execve(file, argv, env);
-/
-/ where argv is a vector argv[0] ... argv[x], 0
-/ last vector element must be 0
-
-.globl _execve
-.globl cerror
-.exece = 59.
-
-_execve:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     8(r5),0f+4
-       sys     0; 9f
-       jmp     cerror
-.data
-9:
-       sys     .exece; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/exit.s b/.ref-Research-V7/usr/src/libc/sys/exit.s
deleted file mode 100644 (file)
index 2fc69de..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/ C library -- _exit
-
-/ _exit(code)
-/ code is return in r0 to system
-/ Same as plain exit, for user who want to define their own exit.
-
-.globl __exit
-.exit = 1.
-
-__exit:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       sys     .exit
-
diff --git a/.ref-Research-V7/usr/src/libc/sys/fork.s b/.ref-Research-V7/usr/src/libc/sys/fork.s
deleted file mode 100644 (file)
index 3d248ff..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ C library -- fork
-
-/ pid = fork();
-/
-/ pid == 0 in child process; pid == -1 means error return
-/ in child, parents id is in par_uid if needed
-
-.globl _fork, _par_uid
-.globl cerror
-.fork = 2.
-
-_fork:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .fork
-               br 1f
-       bec     2f
-       jmp     cerror
-1:
-       mov     r0,_par_uid
-       clr     r0
-2:
-       mov     (sp)+,r5
-       rts     pc
-.bss
-_par_uid: .=.+2
diff --git a/.ref-Research-V7/usr/src/libc/sys/fstat.s b/.ref-Research-V7/usr/src/libc/sys/fstat.s
deleted file mode 100644 (file)
index 9c8bf77..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/ C library -- fstat
-
-/ error = fstat(file, statbuf);
-
-/ int statbuf[17] or
-/ char statbuf[34]
-/ as appropriate
-
-.globl _fstat
-.globl cerror
-.fstat = 28.
-
-_fstat:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       mov     6(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .fstat; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/getgid.s b/.ref-Research-V7/usr/src/libc/sys/getgid.s
deleted file mode 100644 (file)
index 0a017f1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ C library -- getgid, getegid
-
-/ gid = getgid();
-
-.globl _getgid
-.getgid = 47.
-
-_getgid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .getgid
-       mov     (sp)+,r5
-       rts     pc
-
-/ gid = getegid();
-/ returns effective gid
-
-.globl _getegid
-
-_getegid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .getgid
-       mov     r1,r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/getpid.s b/.ref-Research-V7/usr/src/libc/sys/getpid.s
deleted file mode 100644 (file)
index 4ed1dd3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/ getpid -- get process ID
-
-.globl _getpid
-.getpid        = 20.
-
-_getpid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .getpid
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/getuid.s b/.ref-Research-V7/usr/src/libc/sys/getuid.s
deleted file mode 100644 (file)
index 5f2f639..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/ C library -- getuid, geteuid
-
-/ uid = getuid();
-
-.globl _getuid
-.getuid = 24.
-
-_getuid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .getuid
-       mov     (sp)+,r5
-       rts     pc
-
-
-/ uid = geteuid();
-/  returns effective uid
-
-.globl _geteuid
-
-_geteuid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .getuid
-       mov     r1,r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/ioctl.s b/.ref-Research-V7/usr/src/libc/sys/ioctl.s
deleted file mode 100644 (file)
index 8a1b821..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ C library -- ioctl
-
-/ ioctl(fdes, command, arg)
-/ struct * arg;
-/
-/ result == -1 if error
-
-.globl _ioctl, cerror
-.ioctl = 54.
-
-_ioctl:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     8(r5),0f+4
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       clr     r0
-       rts     pc
-.data
-9:
-       sys     .ioctl; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/kill.s b/.ref-Research-V7/usr/src/libc/sys/kill.s
deleted file mode 100644 (file)
index 0a28e4a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C library -- kill
-
-.globl _kill, cerror
-.kill = 37.
-
-_kill:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(sp),r0
-       mov     6(sp),8f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-
-.data
-9:
-       sys     .kill; 8:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/link.s b/.ref-Research-V7/usr/src/libc/sys/link.s
deleted file mode 100644 (file)
index 525cd49..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- link
-
-/ error = link(old-file, new-file);
-
-.globl _link
-.globl cerror
-.link = 9.
-
-_link:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .link; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/lock.s b/.ref-Research-V7/usr/src/libc/sys/lock.s
deleted file mode 100644 (file)
index a5084b5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ lock -- C library
-
-/      lock(f)
-
-.globl _lock, cerror
-
-.lock = 53.
-
-_lock:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       .data
-9:
-       sys     .lock; 0:..
-       .text
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/lseek.s b/.ref-Research-V7/usr/src/libc/sys/lseek.s
deleted file mode 100644 (file)
index df0bfa7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ C library -- lseek
-
-/ error = lseek(file, offset, ptr);
-/ long offset
-/ long lseek()
-
-.globl _lseek, cerror
-.lseek = 19.
-
-_lseek:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       mov     6(r5),0f
-       mov     8(r5),0f+2
-       mov     10.(r5),0f+4
-       sys     0; 9f
-       bec     1f
-       mov     $1,r1
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .lseek; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/mknod.s b/.ref-Research-V7/usr/src/libc/sys/mknod.s
deleted file mode 100644 (file)
index 8064307..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- mknod
-
-/ error = mknod(string, mode, major.minor);
-
-.globl _mknod, cerror
-
-.mknod = 14.
-_mknod:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     8(r5),0f+4
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .mknod; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/mount.s b/.ref-Research-V7/usr/src/libc/sys/mount.s
deleted file mode 100644 (file)
index f3f38c2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- mount
-
-/ error = mount(dev, file, flag)
-
-.globl _mount,
-.globl cerror
-.mount = 21.
-
-_mount:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(sp),0f
-       mov     6(sp),0f+2
-       mov     8(sp),0f+4
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .mount; 0:..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/mpxcall.s b/.ref-Research-V7/usr/src/libc/sys/mpxcall.s
deleted file mode 100644 (file)
index 2efecb5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-.globl _mpxcall, cerror
-
-_mpxcall:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-call:
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     56.; 0:..; ..
-
diff --git a/.ref-Research-V7/usr/src/libc/sys/nice.s b/.ref-Research-V7/usr/src/libc/sys/nice.s
deleted file mode 100644 (file)
index 3dda6d5..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library-- nice
-
-/ error = nice(hownice)
-
-.globl _nice,
-.globl cerror
-.nice = 34.
-
-_nice:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(sp),r0
-       sys     .nice
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/open.s b/.ref-Research-V7/usr/src/libc/sys/open.s
deleted file mode 100644 (file)
index b69cbb8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- open
-
-/ file = open(string, mode)
-/ file == -1 means error
-
-.globl _open,
-.globl cerror
-.open = 5.
-
-_open:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .open; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/pause.s b/.ref-Research-V7/usr/src/libc/sys/pause.s
deleted file mode 100644 (file)
index 1ebe761..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/ C library - pause
-
-.globl _pause
-.pause = 29.
-
-_pause:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .pause
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/phys.s b/.ref-Research-V7/usr/src/libc/sys/phys.s
deleted file mode 100644 (file)
index e1279a1..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ phys -- C library
-
-/      phys(seg, size, physad)
-
-.globl _phys, cerror
-
-.phys = 52.
-
-_phys:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     8(r5),0f+4
-       sys     0; 9f
-       .data
-9:
-       sys     .phys; 0: ..; ..; ..
-       .text
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/pipe.s b/.ref-Research-V7/usr/src/libc/sys/pipe.s
deleted file mode 100644 (file)
index 04c8e59..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ pipe -- C library
-
-/      pipe(f)
-/      int f[2];
-
-.globl _pipe, cerror
-
-.pipe = 42.
-
-_pipe:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .pipe
-       bec     1f
-       jmp     cerror
-1:
-       mov     r2,-(sp)
-       mov     4(r5),r2
-       mov     r0,(r2)+
-       mov     r1,(r2)
-       clr     r0
-       mov     (sp)+,r2
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/profil.s b/.ref-Research-V7/usr/src/libc/sys/profil.s
deleted file mode 100644 (file)
index bc4abb9..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/ profil
-
-.globl _profil
-.prof = 44.
-
-_profil:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       mov     10(r5),0f+4
-       mov     12(r5),0f+6
-       sys     0; 9f
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .prof; 0:..; ..; ..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/ptrace.s b/.ref-Research-V7/usr/src/libc/sys/ptrace.s
deleted file mode 100644 (file)
index d400429..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/ ptrace -- C library
-
-/      result = ptrace(req, pid, addr, data);
-
-.ptrace = 26.
-indir = 0
-
-.globl _ptrace
-.globl cerror, _errno
-
-_ptrace:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4.(r5),0f+4
-       mov     6.(r5),0f+0
-       mov     8.(r5),0f+2
-       mov     10.(r5),r0
-       clr     _errno
-       sys     indir; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-
-.data
-9:
-       sys     .ptrace; 0: .=.+6
diff --git a/.ref-Research-V7/usr/src/libc/sys/read.s b/.ref-Research-V7/usr/src/libc/sys/read.s
deleted file mode 100644 (file)
index 5225cf6..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/ C library -- read
-
-/ nread = read(file, buffer, count);
-/ nread ==0 means eof; nread == -1 means error
-
-.globl _read
-.globl cerror
-.read = 3.
-
-_read:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       mov     6(r5),0f
-       mov     8(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .read; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/sbrk.s b/.ref-Research-V7/usr/src/libc/sys/sbrk.s
deleted file mode 100644 (file)
index 78e15e0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/old = sbrk(increment);
-/
-/sbrk gets increment more core, and returns a pointer
-/      to the beginning of the new core area
-/
-.globl _sbrk, _brk
-.globl _end, cerror
-.break = 17.
-
-_sbrk:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       beq     1f
-       add     nd,0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     nd,r0
-       add     4(r5),nd
-       mov     (sp)+,r5
-       rts     pc
-
-/ brk(value)
-/ as described in man2.
-/ returns 0 for ok, -1 for error.
-
-_brk:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     4(r5),nd
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-
-.data
-9:
-       sys     .break; 0:..
-nd:    _end
diff --git a/.ref-Research-V7/usr/src/libc/sys/setgid.s b/.ref-Research-V7/usr/src/libc/sys/setgid.s
deleted file mode 100644 (file)
index d781e6e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- setgid
-
-/ error = setgid(uid);
-
-.globl _setgid
-.globl cerror
-.setgid = 46.
-
-_setgid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       sys     .setgid
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/setuid.s b/.ref-Research-V7/usr/src/libc/sys/setuid.s
deleted file mode 100644 (file)
index 25d2ef8..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ C library -- setuid
-
-/ error = setuid(uid);
-
-.globl _setuid
-.globl cerror
-.setuid = 23.
-
-_setuid:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       sys     .setuid
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/signal.s b/.ref-Research-V7/usr/src/libc/sys/signal.s
deleted file mode 100644 (file)
index ee2896c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/ C library -- signal
-
-/ signal(n, 0); /* default action on signal(n) */
-/ signal(n, odd); /* ignore signal(n) */
-/ signal(n, label); /* goto label on signal(n) */
-/ returns old label, only one level.
-
-rtt    = 6
-.signal        = 48.
-.globl _signal, cerror
-
-_signal:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r1
-       cmp     r1,$NSIG
-       bhis    2f
-       mov     6(r5),r0
-       mov     r1,0f
-       asl     r1
-       mov     dvect(r1),-(sp)
-       mov     r0,dvect(r1)
-       mov     r0,0f+2
-       beq     1f
-       bit     $1,r0
-       bne     1f
-       asl     r1
-       add     $tvect,r1
-       mov     r1,0f+2
-1:
-       sys     0; 9f
-       bes     3f
-       bit     $1,r0
-       beq     1f
-       mov     r0,(sp)
-1:
-       mov     (sp)+,r0
-       mov     (sp)+,r5
-       rts     pc
-2:
-       mov     $22.,r0         / EINVAL
-3:
-       jmp     cerror
-
-NSIG = 0
-tvect:
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-       jsr     r0,1f; NSIG=NSIG+1
-
-1:
-       mov     r1,-(sp)
-       mov     r2,-(sp)
-       mov     r3,-(sp)
-       mov     r4,-(sp)
-       sub     $tvect+4,r0
-       asr     r0
-       mov     r0,-(sp)
-       asr     (sp)
-       jsr     pc,*dvect(r0)
-       tst     (sp)+
-       mov     (sp)+,r4
-       mov     (sp)+,r3
-       mov     (sp)+,r2
-       mov     (sp)+,r1
-       mov     (sp)+,r0
-       rtt
-.data
-9:
-       sys     .signal; 0:..; ..
-.bss
-dvect: .=.+[NSIG*2]
diff --git a/.ref-Research-V7/usr/src/libc/sys/stat.s b/.ref-Research-V7/usr/src/libc/sys/stat.s
deleted file mode 100644 (file)
index 1ed4cbc..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- stat
-
-/ error = stat(string, statbuf);
-
-.globl _stat
-.globl cerror
-.stat = 18.
-
-_stat:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .stat; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/stime.s b/.ref-Research-V7/usr/src/libc/sys/stime.s
deleted file mode 100644 (file)
index beeb26d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/ error = stime(&long)
-
-.globl _stime
-.globl cerror
-.stime = 25.
-
-_stime:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(sp),r1
-       mov     (r1)+,r0
-       mov     (r1),r1
-       sys     .stime
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/sync.s b/.ref-Research-V7/usr/src/libc/sys/sync.s
deleted file mode 100644 (file)
index a99cd2f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-.globl _sync
-.sync = 36.
-
-_sync:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .sync
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/time.s b/.ref-Research-V7/usr/src/libc/sys/time.s
deleted file mode 100644 (file)
index 3a56f6a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/ C library -- time
-
-/ tvec = time(tvec);
-/
-/ tvec[0], tvec[1] contain the time
-
-.globl _time
-.time = 13.
-
-
-_time:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .time
-       mov     r2,-(sp)
-       mov     4(r5),r2
-       beq     1f
-       mov     r0,(r2)+
-       mov     r1,(r2)+
-1:
-       mov     (sp)+,r2
-       mov     (sp)+,r5
-       rts     pc
-
-.globl _ftime
-.ftime = 35.
-
-_ftime:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       .data
-9:     sys     .ftime; 0:..
-       .text
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/times.s b/.ref-Research-V7/usr/src/libc/sys/times.s
deleted file mode 100644 (file)
index 1ac8e4e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/ C library -- times
-
-.globl _times
-.times = 43.
-
-_times:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .times; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/umask.s b/.ref-Research-V7/usr/src/libc/sys/umask.s
deleted file mode 100644 (file)
index 4c88760..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/ C library -- umask
-
-/ omask = umask(mode);
-
-.globl _umask
-.globl cerror
-.umask = 60.
-
-_umask:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .umask; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/umount.s b/.ref-Research-V7/usr/src/libc/sys/umount.s
deleted file mode 100644 (file)
index a98a648..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- umount
-
-.globl _umount
-.globl cerror
-indir  = 0
-.umount = 22.
-.comm  _errno,2
-
-_umount:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(sp),0f
-       sys     indir; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-
-.data
-9:
-       sys     .umount; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/unlink.s b/.ref-Research-V7/usr/src/libc/sys/unlink.s
deleted file mode 100644 (file)
index 9aeb18a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/ C library -- unlink
-
-/ error = unlink(string);
-
-.globl _unlink,
-.globl cerror
-.unlink = 10.
-
-_unlink:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .unlink; 0:..
diff --git a/.ref-Research-V7/usr/src/libc/sys/utime.s b/.ref-Research-V7/usr/src/libc/sys/utime.s
deleted file mode 100644 (file)
index 14a3071..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- utime
-
-/ error = utime(string, timev);
-
-.globl _utime
-.globl cerror
-.utime = 30.
-
-_utime:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),0f
-       mov     6(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       clr     r0
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .utime; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/sys/wait.s b/.ref-Research-V7/usr/src/libc/sys/wait.s
deleted file mode 100644 (file)
index b4de107..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/ C library -- wait
-
-/ pid = wait(0);
-/   or,
-/ pid = wait(&status);
-/
-/ pid == -1 if error
-/ status indicates fate of process, if given
-
-.globl _wait
-.globl cerror
-.wait = 7.
-
-_wait:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .wait
-       bec     1f
-       jmp     cerror
-1:
-       tst     4(r5)
-       beq     1f
-       mov     r1,*4(r5)       / status return
-1:
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libc/sys/write.s b/.ref-Research-V7/usr/src/libc/sys/write.s
deleted file mode 100644 (file)
index 505795c..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/ C library -- write
-
-/ nwritten = write(file, buffer, count);
-/
-/ nwritten == -1 means error
-
-.globl _write
-.globl cerror
-.write = 4.
-
-_write:
-       mov     r5,-(sp)
-       mov     sp,r5
-       mov     4(r5),r0
-       mov     6(r5),0f
-       mov     8(r5),0f+2
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       mov     (sp)+,r5
-       rts     pc
-.data
-9:
-       sys     .write; 0:..; ..
diff --git a/.ref-Research-V7/usr/src/libc/v6/access.c b/.ref-Research-V7/usr/src/libc/v6/access.c
deleted file mode 100644 (file)
index bb4c968..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-
-access(name, mode)
-{
-       struct stat foo;
-
-       return(stat(name, &foo));
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/chown.c b/.ref-Research-V7/usr/src/libc/v6/chown.c
deleted file mode 100644 (file)
index ec0f9e8..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-chown(name, owner, group)
-char *name;
-int owner, group;
-{
-       return(syscall(16, 0, 0, name, (group<<8)|(owner&0377), 0));
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/execl.c b/.ref-Research-V7/usr/src/libc/v6/execl.c
deleted file mode 100644 (file)
index d19879e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-execl(name, arg1, a2, a3, a4, a5)
-char *name, arg1, a2, a3, a4, a5;
-{
-       char *args[6];
-
-       args[0] = arg1;
-       args[1] = a2;
-       args[2] = a3;
-       args[3] = a4;
-       args[4] = a5;
-       args[5] = 0;
-
-       syscall(11, 0, 0, name, args, 0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/ftime.c b/.ref-Research-V7/usr/src/libc/v6/ftime.c
deleted file mode 100644 (file)
index 2a069e7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#include <sys/types.h>
-#include <sys/timeb.h>
-
-static struct timeb gorp = {
-       0L,
-       0,
-       5*60,
-       1
-};
-
-ftime(gorpp)
-struct timeb *gorpp;
-{
-       *gorpp = gorp;
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/gtty.c b/.ref-Research-V7/usr/src/libc/v6/gtty.c
deleted file mode 100644 (file)
index 62c2913..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-gtty(fd, buf)
-int fd;
-int *buf;
-{
-       if (syscall(32, fd, 0, buf, 0, 0) < 0)
-               return(-1);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/lseek.c b/.ref-Research-V7/usr/src/libc/v6/lseek.c
deleted file mode 100644 (file)
index c3f0e0a..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-lseek(fd, off, ptr)
-int fd, ptr;
-long off;
-{
-       unsigned a;
-
-       a = off;
-
-       if (a == off)
-               return (syscall(19, fd, 0, a, ptr, 0));
-       a = off/512;
-       syscall(19, fd, 0, a, ptr+3, 0);
-       return(syscall(19, fd, 0, (int) (off%512), ptr, 0));
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/stat.c b/.ref-Research-V7/usr/src/libc/v6/stat.c
deleted file mode 100644 (file)
index 2cefcd4..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-
-struct ostat {
-       short os_dev;
-       short os_inum;
-       short os_flags;
-       char  os_nlinks;
-       char  os_uid;
-       char  os_gid;
-       char  os_size0;
-       short os_size1;
-       short os_addr[8];
-       long  os_actime;
-       long  os_modtime;
-} osbuf;
-
-stat(name, buf)
-char *name;
-struct stat *buf;
-{
-       if (syscall(18, 0, 0, name, &osbuf, 0) < 0)
-               return(-1);
-
-       stcopyit(buf);
-       return(0);
-}
-
-fstat(fd, buf)
-int fd;
-struct stat *buf;
-{
-       if (syscall(28, fd, 0, &osbuf, 0, 0) < 0)
-               return(-1);
-       stcopyit(buf);
-       return(0);
-}
-
-static
-stcopyit(buf)
-struct stat *buf;
-{
-       buf->st_dev = osbuf.os_dev;
-       buf->st_ino = osbuf.os_inum;
-       buf->st_mode = osbuf.os_flags;
-       buf->st_mode &= 067777;
-       if ((buf->st_mode&060000) == 0)
-               buf->st_mode |= 0100000;
-       buf->st_nlink = osbuf.os_nlinks;
-       buf->st_uid = osbuf.os_uid;
-       buf->st_gid = osbuf.os_gid;
-       buf->st_rdev = 0;
-       buf->st_size = ( (long) osbuf.os_size0 << 16) | osbuf.os_size1;
-       buf->st_atime = osbuf.os_actime;
-       buf->st_mtime = osbuf.os_modtime;
-       buf->st_ctime = buf->st_mtime;
-}
diff --git a/.ref-Research-V7/usr/src/libc/v6/syscall.s b/.ref-Research-V7/usr/src/libc/v6/syscall.s
deleted file mode 100644 (file)
index d5ed33b..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/ syscall
-
-.globl _syscall,csv,cret,cerror
-_syscall:
-       jsr     r5,csv
-       mov     r5,r2
-       add     $04,r2
-       mov     $9f,r3
-       mov     (r2)+,r0
-       bic     $!0377,r0
-       bis     $sys,r0
-       mov     r0,(r3)+
-       mov     (r2)+,r0
-       mov     (r2)+,r1
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-       sys     0; 9f
-       bec     1f
-       jmp     cerror
-1:
-       jmp     cret
-
-       .data
-9:     .=.+12.
diff --git a/.ref-Research-V7/usr/src/libc/v6/time.s b/.ref-Research-V7/usr/src/libc/v6/time.s
deleted file mode 100644 (file)
index 29bfbc4..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/ C library -- time
-
-/ tvec = time(tvec);
-/
-/ tvec[0], tvec[1] contain the time
-
-.globl _time
-.time = 13.
-
-
-_time:
-       mov     r5,-(sp)
-       mov     sp,r5
-       sys     .time
-       mov     r2,-(sp)
-       mov     4(r5),r2
-       beq     1f
-       mov     r0,(r2)+
-       mov     r1,(r2)+
-1:
-       mov     (sp)+,r2
-       mov     (sp)+,r5
-       rts     pc
diff --git a/.ref-Research-V7/usr/src/libdbm/compall b/.ref-Research-V7/usr/src/libdbm/compall
deleted file mode 100755 (executable)
index 7abd2bc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cc -c -O dbm.c
diff --git a/.ref-Research-V7/usr/src/libdbm/dbm.c b/.ref-Research-V7/usr/src/libdbm/dbm.c
deleted file mode 100644 (file)
index aaafcc4..0000000
+++ /dev/null
@@ -1,465 +0,0 @@
-#include       "dbm.h"
-#include       <sys/types.h>
-#include       <sys/stat.h>
-
-dbminit(file)
-char *file;
-{
-       struct stat statb;
-
-       strcpy(pagbuf, file);
-       strcat(pagbuf, ".pag");
-       pagf = open(pagbuf, 2);
-
-       strcpy(pagbuf, file);
-       strcat(pagbuf, ".dir");
-       dirf = open(pagbuf, 2);
-       if(pagf < 0 || dirf < 0) {
-               printf("cannot open database %s\n", file);
-               return(-1);
-       }
-       fstat(dirf, &statb);
-       maxbno = statb.st_size*BYTESIZ-1;
-       return(0);
-}
-
-long
-forder(key)
-datum key;
-{
-       long hash;
-
-       hash = calchash(key);
-       for(hmask=0;; hmask=(hmask<<1)+1) {
-               blkno = hash & hmask;
-               bitno = blkno + hmask;
-               if(getbit() == 0)
-                       break;
-       }
-       return(blkno);
-}
-
-datum
-fetch(key)
-datum key;
-{
-       register i;
-       datum item;
-
-       dbm_access(calchash(key));
-       for(i=0;; i+=2) {
-               item = makdatum(pagbuf, i);
-               if(item.dptr == NULL)
-                       return(item);
-               if(cmpdatum(key, item) == 0) {
-                       item = makdatum(pagbuf, i+1);
-                       if(item.dptr == NULL)
-                               printf("items not in pairs\n");
-                       return(item);
-               }
-       }
-}
-
-delete(key)
-datum key;
-{
-       register i;
-       datum item;
-
-       dbm_access(calchash(key));
-       for(i=0;; i+=2) {
-               item = makdatum(pagbuf, i);
-               if(item.dptr == NULL)
-                       return(-1);
-               if(cmpdatum(key, item) == 0) {
-                       delitem(pagbuf, i);
-                       delitem(pagbuf, i);
-                       break;
-               }
-       }
-       lseek(pagf, blkno*PBLKSIZ, 0);
-       write(pagf, pagbuf, PBLKSIZ);
-       return(0);
-}
-
-store(key, dat)
-datum key, dat;
-{
-       register i;
-       datum item;
-       char ovfbuf[PBLKSIZ];
-
-loop:
-       dbm_access(calchash(key));
-       for(i=0;; i+=2) {
-               item = makdatum(pagbuf, i);
-               if(item.dptr == NULL)
-                       break;
-               if(cmpdatum(key, item) == 0) {
-                       delitem(pagbuf, i);
-                       delitem(pagbuf, i);
-                       break;
-               }
-       }
-       i = additem(pagbuf, key);
-       if(i < 0)
-               goto split;
-       if(additem(pagbuf, dat) < 0) {
-               delitem(pagbuf, i);
-               goto split;
-       }
-       lseek(pagf, blkno*PBLKSIZ, 0);
-       write(pagf, pagbuf, PBLKSIZ);
-       return;
-
-split:
-       if(key.dsize+dat.dsize+2*sizeof(short) >= PBLKSIZ) {
-               printf("entry too big\n");
-               return;
-       }
-       clrbuf(ovfbuf, PBLKSIZ);
-       for(i=0;;) {
-               item = makdatum(pagbuf, i);
-               if(item.dptr == NULL)
-                       break;
-               if(calchash(item) & (hmask+1)) {
-                       additem(ovfbuf, item);
-                       delitem(pagbuf, i);
-                       item = makdatum(pagbuf, i);
-                       if(item.dptr == NULL) {
-                               printf("split not paired\n");
-                               break;
-                       }
-                       additem(ovfbuf, item);
-                       delitem(pagbuf, i);
-                       continue;
-               }
-               i += 2;
-       }
-       lseek(pagf, blkno*PBLKSIZ, 0);
-       write(pagf, pagbuf, PBLKSIZ);
-       lseek(pagf, (blkno+hmask+1)*PBLKSIZ, 0);
-       write(pagf, ovfbuf, PBLKSIZ);
-       setbit();
-       goto loop;
-}
-
-datum
-firstkey()
-{
-       return(firsthash(0L));
-}
-
-datum
-nextkey(key)
-datum key;
-{
-       register i;
-       datum item, bitem;
-       long hash;
-       int f;
-
-       hash = calchash(key);
-       dbm_access(hash);
-       f = 1;
-       for(i=0;; i+=2) {
-               item = makdatum(pagbuf, i);
-               if(item.dptr == NULL)
-                       break;
-               if(cmpdatum(key, item) <= 0)
-                       continue;
-               if(f || cmpdatum(bitem, item) < 0) {
-                       bitem = item;
-                       f = 0;
-               }
-       }
-       if(f == 0)
-               return(bitem);
-       hash = hashinc(hash);
-       if(hash == 0)
-               return(item);
-       return(firsthash(hash));
-}
-
-datum
-firsthash(hash)
-long hash;
-{
-       register i;
-       datum item, bitem;
-
-loop:
-       dbm_access(hash);
-       bitem = makdatum(pagbuf, 0);
-       for(i=2;; i+=2) {
-               item = makdatum(pagbuf, i);
-               if(item.dptr == NULL)
-                       break;
-               if(cmpdatum(bitem, item) < 0)
-                       bitem = item;
-       }
-       if(bitem.dptr != NULL)
-               return(bitem);
-       hash = hashinc(hash);
-       if(hash == 0)
-               return(item);
-       goto loop;
-}
-
-dbm_access(hash)
-long hash;
-{
-       static long oldb = -1;
-
-       for(hmask=0;; hmask=(hmask<<1)+1) {
-               blkno = hash & hmask;
-               bitno = blkno + hmask;
-               if(getbit() == 0)
-                       break;
-       }
-       if(blkno != oldb) {
-               clrbuf(pagbuf, PBLKSIZ);
-               lseek(pagf, blkno*PBLKSIZ, 0);
-               read(pagf, pagbuf, PBLKSIZ);
-               chkblk(pagbuf);
-               oldb = blkno;
-       }
-}
-
-getbit()
-{
-       long bn;
-       register b, i, n;
-       static oldb = -1;
-
-       if(bitno > maxbno)
-               return(0);
-       n = bitno % BYTESIZ;
-       bn = bitno / BYTESIZ;
-       i = bn % DBLKSIZ;
-       b = bn / DBLKSIZ;
-       if(b != oldb) {
-               clrbuf(dirbuf, DBLKSIZ);
-               lseek(dirf, (long)b*DBLKSIZ, 0);
-               read(dirf, dirbuf, DBLKSIZ);
-               oldb = b;
-       }
-       if(dirbuf[i] & (1<<n))
-               return(1);
-       return(0);
-}
-
-setbit()
-{
-       long bn;
-       register i, n, b;
-
-       if(bitno > maxbno) {
-               maxbno = bitno;
-               getbit();
-       }
-       n = bitno % BYTESIZ;
-       bn = bitno / BYTESIZ;
-       i = bn % DBLKSIZ;
-       b = bn / DBLKSIZ;
-       dirbuf[i] |= 1<<n;
-       lseek(dirf, (long)b*DBLKSIZ, 0);
-       write(dirf, dirbuf, DBLKSIZ);
-}
-
-clrbuf(cp, n)
-register char *cp;
-register n;
-{
-
-       do
-               *cp++ = 0;
-       while(--n);
-}
-
-datum
-makdatum(buf, n)
-char buf[PBLKSIZ];
-{
-       register short *sp;
-       register t;
-       datum item;
-
-       sp = (short *)buf;
-       if(n < 0 || n >= sp[0])
-               goto null;
-       t = PBLKSIZ;
-       if(n > 0)
-               t = sp[n+1-1];
-       item.dptr = buf+sp[n+1];
-       item.dsize = t - sp[n+1];
-       return(item);
-
-null:
-       item.dptr = NULL;
-       item.dsize = 0;
-       return(item);
-}
-
-cmpdatum(d1, d2)
-datum d1, d2;
-{
-       register n;
-       register char *p1, *p2;
-
-       n = d1.dsize;
-       if(n != d2.dsize)
-               return(n - d2.dsize);
-       if(n == 0)
-               return(0);
-       p1 = d1.dptr;
-       p2 = d2.dptr;
-       do
-               if(*p1++ != *p2++)
-                       return(*--p1 - *--p2);
-       while(--n);
-       return(0);
-}
-
-int    hitab[16] = 
-{      61, 57, 53, 49, 45, 41, 37, 33,
-       29, 25, 21, 17, 13,  9,  5,  1,
-};
-long   hltab[64] = 
-{
-       06100151277L,06106161736L,06452611562L,05001724107L,
-       02614772546L,04120731531L,04665262210L,07347467531L,
-       06735253126L,06042345173L,03072226605L,01464164730L,
-       03247435524L,07652510057L,01546775256L,05714532133L,
-       06173260402L,07517101630L,02431460343L,01743245566L,
-       00261675137L,02433103631L,03421772437L,04447707466L,
-       04435620103L,03757017115L,03641531772L,06767633246L,
-       02673230344L,00260612216L,04133454451L,00615531516L,
-       06137717526L,02574116560L,02304023373L,07061702261L,
-       05153031405L,05322056705L,07401116734L,06552375715L,
-       06165233473L,05311063631L,01212221723L,01052267235L,
-       06000615237L,01075222665L,06330216006L,04402355630L,
-       01451177262L,02000133436L,06025467062L,07121076461L,
-       03123433522L,01010635225L,01716177066L,05161746527L,
-       01736635071L,06243505026L,03637211610L,01756474365L,
-       04723077174L,03642763134L,05750130273L,03655541561L,
-};
-
-long
-hashinc(hash)
-long hash;
-{
-       long bit;
-
-       hash &= hmask;
-       bit = hmask+1;
-       for(;;) {
-               bit >>= 1;
-               if(bit == 0)
-                       return(0L);
-               if((hash&bit) == 0)
-                       return(hash|bit);
-               hash &= ~bit;
-       }
-}
-
-long
-calchash(item)
-datum item;
-{
-       register i, j, f;
-       long hashl;
-       int hashi;
-
-       hashl = 0;
-       hashi = 0;
-       for(i=0; i<item.dsize; i++) {
-               f = item.dptr[i];
-               for(j=0; j<BYTESIZ; j+=4) {
-                       hashi += hitab[f&017];
-                       hashl += hltab[hashi&077];
-                       f >>= 4;
-               }
-       }
-       return(hashl);
-}
-
-delitem(buf, n)
-char buf[PBLKSIZ];
-{
-       register short *sp;
-       register i1, i2, i3;
-
-       sp = (short *)buf;
-       if(n < 0 || n >= sp[0])
-               goto bad;
-       i1 = sp[n+1];
-       i2 = PBLKSIZ;
-       if(n > 0)
-               i2 = sp[n+1-1];
-       i3 = sp[sp[0]+1-1];
-       if(i2 > i1)
-       while(i1 > i3) {
-               i1--;
-               i2--;
-               buf[i2] = buf[i1];
-               buf[i1] = 0;
-       }
-       i2 -= i1;
-       for(i1=n+1; i1<sp[0]; i1++)
-               sp[i1+1-1] = sp[i1+1] + i2;
-       sp[0]--;
-       sp[sp[0]+1] = 0;
-       return;
-
-bad:
-       printf("bad delitem\n");
-       abort();
-}
-
-additem(buf, item)
-char buf[PBLKSIZ];
-datum item;
-{
-       register short *sp;
-       register i1, i2;
-
-       sp = (short *)buf;
-       i1 = PBLKSIZ;
-       if(sp[0] > 0)
-               i1 = sp[sp[0]+1-1];
-       i1 -= item.dsize;
-       i2 = (sp[0]+2) * sizeof(short);
-       if(i1 <= i2)
-               return(-1);
-       sp[sp[0]+1] = i1;
-       for(i2=0; i2<item.dsize; i2++) {
-               buf[i1] = item.dptr[i2];
-               i1++;
-       }
-       sp[0]++;
-       return(sp[0]-1);
-}
-
-chkblk(buf)
-char buf[PBLKSIZ];
-{
-       register short *sp;
-       register t, i;
-
-       sp = (short *)buf;
-       t = PBLKSIZ;
-       for(i=0; i<sp[0]; i++) {
-               if(sp[i+1] > t)
-                       goto bad;
-               t = sp[i+1];
-       }
-       if(t < (sp[0]+1)*sizeof(short))
-               goto bad;
-       return;
-
-bad:
-       printf("bad block\n");
-       abort();
-       clrbuf(buf, PBLKSIZ);
-}
diff --git a/.ref-Research-V7/usr/src/libdbm/dbm.h b/.ref-Research-V7/usr/src/libdbm/dbm.h
deleted file mode 100644 (file)
index ea5d5a3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#define        PBLKSIZ 512
-#define        DBLKSIZ 8192
-#define        BYTESIZ 8
-#define        NULL    ((char *) 0)
-
-long   bitno;
-long   maxbno;
-long   blkno;
-long   hmask;
-
-char   pagbuf[PBLKSIZ];
-char   dirbuf[DBLKSIZ];
-
-int    dirf;
-int    pagf;
-
-typedef        struct
-{
-       char    *dptr;
-       int     dsize;
-} datum;
-
-datum  fetch();
-datum  makdatum();
-datum  firstkey();
-datum  nextkey();
-datum  firsthash();
-long   calchash();
-long   hashinc();
-
diff --git a/.ref-Research-V7/usr/src/libdbm/mklib b/.ref-Research-V7/usr/src/libdbm/mklib
deleted file mode 100755 (executable)
index 8b34035..0000000
+++ /dev/null
@@ -1 +0,0 @@
-mv dbm.o libdbm.a
diff --git a/.ref-Research-V7/usr/src/libfpsim/compall b/.ref-Research-V7/usr/src/libfpsim/compall
deleted file mode 100755 (executable)
index 9f6a739..0000000
+++ /dev/null
@@ -1 +0,0 @@
-as -o fpsim.o fp?.s
diff --git a/.ref-Research-V7/usr/src/libfpsim/fp1.s b/.ref-Research-V7/usr/src/libfpsim/fp1.s
deleted file mode 100644 (file)
index c5aad8e..0000000
+++ /dev/null
@@ -1,437 +0,0 @@
-/ fp1 -- floating point simulator
-
-rti    = 2
-bpt    = 3
-
-m.ext = 200            / long mode bit
-m.lngi = 100           / long integer mode
-
-.globl fptrap
-.globl ac0, ac1, ac2, ac3
-
-fptrap:
-       dec     reenter
-       bge     1f
-       4               / reentered!
-1:
-       mov     (sp)+,spc
-       mov     (sp)+,sps
-       mov     r0,sr0
-       mov     $sr1,r0
-       mov     r1,(r0)+
-       mov     r2,(r0)+
-       mov     r3,(r0)+
-       mov     r4,(r0)+
-       mov     r5,(r0)+
-       mov     sp,(r0)+
-       mov     (r0),r5         / pc
-       mov     -(r5),r5        / trapped instruction
-
-again:
-       sub     $8,sp           / room for double push
-       clr     trapins
-       mov     r5,r4
-       bic     $7777,r4
-       cmp     r4,$170000
-       beq     1f
-       jmp     badins
-1:
-       bic     $100000,fpsr    / clear fp error
-       bic     $170000,r5
-       mov     r5,r4
-       bit     $7000,r4
-       bne     class3
-       bit     $700,r4
-       bne     class2
-       cmp     r4,$12
-       blos    1f
-       jmp     badins
-1:
-       asl     r4
-       jmp     *1f(r4)
-
-       .data
-1:
-       i.cfcc          / 170000
-       i.setf          / 170001
-       i.seti          / 170002
-       badins
-       badins
-       badins
-       badins
-       badins
-       badins
-       i.setd          / 170011
-       i.setl          / 170012
-       .text
-
-class2:
-       cmp     r5,$400
-       bge     1f
-       jsr     r1,fsrc; mod0rx; mod242
-       br      2f
-1:
-       jsr     r1,fsrc; mod0f; mod24f
-2:
-       mov     r3,r5
-       asl     r4
-       asl     r4
-       clrb    r4
-       swab    r4
-       asl     r4
-       jsr     pc,*1f(r4)
-       jmp     sret
-
-       .data
-1:
-       badins          / 1700xx
-       i.ldfps         / 1701xx
-       i.stfps         / 1702xx
-       badins          / 1703xx - stst
-       i.clrx          / 1704xx
-       i.tstx          / 1705xx
-       i.absx          / 1706xx
-       i.negx          / 1707xx
-       .text
-
-class3:
-       cmp     r5,$5000
-       blt     1f
-       mov     r5,r2
-       clrb    r2
-       cmp     r2,$6400
-       blt     2f
-       sub     $1400,r2
-2:
-       cmp     r2,$5000
-       bne     2f
-       jsr     r1,fsrc; mod0rx; mod242
-       br      3f
-2:
-       cmp     r2,$5400
-       bne     2f
-       jsr     r1,fsrc; mod0ra; mod24i
-       br      3f
-2:
-       jsr     r1,fsrc; mod0f; mod24d
-       br      3f
-1:
-       jsr     r1,fsrc; mod0f; mod24f
-3:
-       jsr     pc,freg
-       mov     r2,r5
-       clrb    r4
-       swab    r4
-       asl     r4
-       jsr     pc,*1f(r4)
-       br      sret
-
-       .data
-1:
-       badins          / 1700xx
-       badins          / 1704xx
-       i.mulx          / 1710xx
-       i.modx          / 1714xx
-       i.addx          / 1720xx
-       i.ldx           / 1724xx
-       i.subx          / 1730xx
-       i.cmpx          / 1734xx
-       i.stx           / 1740xx
-       i.divx          / 1744xx
-       i.stexp         / 1750xx
-       i.stcxj         / 1754xx
-       i.stcxy         / 1760xx
-       i.ldexp         / 1764xx
-       i.ldcjx         / 1770xx
-       i.ldcyx         / 1774xx
-       .text
-
-i.cfcc:
-       mov     fpsr,r0
-       bic     $!17,r0
-       mov     r0,sps
-       br      ret
-
-i.setf:
-       bic     $m.ext,fpsr
-       br      ret
-
-i.setd:
-       bis     $m.ext,fpsr
-       br      ret
-
-i.seti:
-       bic     $m.lngi,fpsr
-       br      ret
-
-i.setl:
-       bis     $m.lngi,fpsr
-       br      ret
-
-badins:
-       inc     trapins
-       br      ret1
-
-sret:
-       mov     $fpsr,r0
-       bic     $17,(r0)
-       tstb    1(r5)
-       bpl     1f
-       bis     $10,(r0)
-       br      ret
-1:
-       bne     ret
-       bis     $4,(r0)
-
-ret:
-       mov     ssp,sp
-       mov     *spc,r5
-       cmp     r5,$170000
-       blo     ret1
-       add     $2,spc
-       jbr     again                   / if another fp, save trap
-
-ret1:
-       mov     $sr1,r0
-       mov     (r0)+,r1
-       mov     (r0)+,r2
-       mov     (r0)+,r3
-       mov     (r0)+,r4
-       mov     (r0)+,r5
-       mov     (r0)+,sp
-       mov     sr0,r0
-       mov     sps,-(sp)
-       mov     spc,-(sp)
-       tst     trapins
-       bne     1f
-       inc     reenter
-       rti
-1:
-       bpt
-
-freg:
-       mov     r5,r2
-       bic     $!300,r2
-       asr     r2
-       asr     r2
-       asr     r2
-       add     $ac0,r2
-       rts     pc
-
-fsrc:
-       mov     r5,r3
-       bic     $!7,r3                  / register
-       asl     r3
-       add     $sr0,r3
-       mov     r5,r0
-       bic     $!70,r0                 / mode
-       asr     r0
-       asr     r0
-       jmp     *1f(r0)
-
-       .data
-1:
-       mod0
-       mod1
-       mod2
-       mod3
-       mod4
-       mod5
-       mod6
-       mod7
-       .text
-
-mod24f:
-       mov     $4,r0
-       bit     $m.ext,fpsr
-       beq     1f
-       add     $4,r0
-1:
-       rts     pc
-
-mod24d:
-       mov     $8,r0
-       bit     $m.ext,fpsr
-       beq     1f
-       sub     $4,r0
-1:
-       rts     pc
-
-mod242:
-       mov     $2,r0
-       rts     pc
-
-mod24i:
-       mov     $2,r0
-       bit     $m.lngi,fpsr
-       beq     1f
-       add     $2,r0
-1:
-       rts     pc
-
-mod0:
-       jmp     *(r1)+
-
-mod0f:
-       sub     $sr0,r3                 / get fp ac
-       cmp     r3,$6*2
-       bhis    badi1
-       asl     r3
-       asl     r3
-       add     $ac0,r3
-       tst     (r1)+
-       rts     r1
-
-mod0ra:
-       bit     $m.lngi,fpsr
-       bne     badi1
-
-mod0r:
-       cmp     r3,$ssp
-       bhis    badi1
-mod0rx:
-       tst     (r1)+
-       rts     r1
-
-mod1:
-       cmp     r3,$spc
-       beq     badi1
-       mov     (r3),r3
-       br      check
-
-mod2:
-       mov     (r3),-(sp)
-       jsr     pc,*2(r1)
-       cmp     r3,$spc
-       bne     1f
-       mov     $2,r0
-       mov     *(r3),pctmp
-       mov     $pctmp,(sp)
-1:
-       add     r0,(r3)
-       mov     (sp)+,r3
-       br      check
-
-mod3:
-       mov     *(r3),-(sp)
-       add     $2,(r3)
-       mov     (sp)+,r3
-       br      check
-
-mod4:
-       cmp     r3,$spc         / test pc
-       beq     badi1
-       jsr     pc,*2(r1)
-       sub     r0,(r3)
-       mov     (r3),r3
-       br      check
-
-mod5:
-       cmp     r3,$spc
-       beq     badi1
-       sub     $2,(r3)
-       mov     *(r3),r3
-       br      check
-
-mod6:
-       mov     *spc,-(sp)
-       add     $2,spc
-       add     (r3),(sp)
-       mov     (sp)+,r3
-       br      check
-
-mod7:
-       jsr     r1,mod6; ..; ..
-       mov     (r3),r3
-       br      check
-
-badi1:
-       jmp     badins
-
-check:
-       bit     $1,r3
-       bne     badi1
-       cmp     (r1)+,(r1)+
-       rts     r1
-
-setab:
-       mov     $asign,r0
-       jsr     pc,seta
-       mov     r3,r2
-       mov     $bsign,r0
-
-seta:
-       clr     (r0)
-       mov     (r2)+,r1
-       mov     r1,-(sp)
-       beq     1f
-       blt     2f
-       inc     (r0)+
-       br      3f
-2:
-       dec     (r0)+
-3:
-       bic     $!177,r1
-       bis     $200,r1
-       br      2f
-1:
-       clr     (r0)+
-2:
-       mov     r1,(r0)+
-       mov     (r2)+,(r0)+
-       bit     $m.ext,fpsr
-       beq     2f
-       mov     (r2)+,(r0)+
-       mov     (r2)+,(r0)+
-       br      3f
-2:
-       clr     (r0)+
-       clr     (r0)+
-3:
-       mov     (sp)+,r1
-       asl     r1
-       clrb    r1
-       swab    r1
-       sub     $200,r1
-       mov     r1,(r0)+        / exp
-       rts     pc
-
-norm:
-       mov     $areg,r0
-       mov     (r0)+,r1
-       mov     r1,-(sp)
-       mov     (r0)+,r2
-       bis     r2,(sp)
-       mov     (r0)+,r3
-       bis     r3,(sp)
-       mov     (r0)+,r4
-       bis     r4,(sp)+
-       bne     1f
-       clr     asign
-       rts     pc
-1:
-       bit     $!377,r1
-       beq     1f
-       clc
-       ror     r1
-       ror     r2
-       ror     r3
-       ror     r4
-       inc     (r0)
-       br      1b
-1:
-       bit     $200,r1
-       bne     1f
-       asl     r4
-       rol     r3
-       rol     r2
-       rol     r1
-       dec     (r0)
-       br      1b
-1:
-       mov     r4,-(r0)
-       mov     r3,-(r0)
-       mov     r2,-(r0)
-       mov     r1,-(r0)
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/libfpsim/fp2.s b/.ref-Research-V7/usr/src/libfpsim/fp2.s
deleted file mode 100644 (file)
index 244082d..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/ fp2 -- floating point simulation
-
-i.ldx:
-       mov     (r3)+,(r2)+
-       mov     (r3)+,(r2)+
-       bit     $m.ext,fpsr
-       beq     1f
-       mov     (r3)+,(r2)+
-       mov     (r3)+,(r2)+
-       rts     pc
-1:
-       clr     (r2)+
-       clr     (r2)+
-       rts     pc
-
-i.stx:
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-       bit     $m.ext,fpsr
-       beq     1f
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-1:
-       jmp     ret                     / does not set cc's
-
-i.clrx:
-       clr     (r3)+
-       clr     (r3)+
-       bit     $m.ext,fpsr
-       beq     1f
-       clr     (r3)+
-       clr     (r3)+
-1:
-       rts     pc
-
-i.negx:
-       tst     (r3)
-       beq     1f
-       add     $100000,(r3)
-1:
-       rts     pc
-
-i.absx:
-       bic     $!77777,(r3)
-       rts     pc
-
-i.tstx:
-       rts     pc
-
-i.cmpx:
-       mov     $areg,r5
-       tst     (r2)
-       bge     1f
-       tst     (r3)
-       bge     1f
-       cmp     (r2),(r3)
-       bgt     4f
-       blt     3f
-1:
-       cmp     (r2)+,(r3)+
-       bgt     3f
-       blt     4f
-       cmp     (r2)+,(r3)+
-       bne     1f
-       bit     $m.ext,fpsr
-       beq     2f
-       cmp     (r2)+,(r3)+
-       bne     1f
-       cmp     (r2)+,(r3)+
-       beq     2f
-1:
-       bhi     3f
-4:
-       movb    $1,1(r5)
-       rts     pc
-3:
-       mov     $-1,(r5)
-       rts     pc
-2:
-       clr     (r5)
-       rts     pc
-
-i.ldcyx:
-       mov     (r3)+,(r2)+
-       mov     (r3)+,(r2)+
-       bit     $m.ext,fpsr
-       bne     1f
-       mov     (r3)+,(r2)+
-       mov     (r3)+,(r2)+
-       rts     pc
-1:
-       clr     (r2)+
-       clr     (r2)+
-       rts     pc
-
-i.stcxy:
-       mov     (r2)+,(r3)+
-       mov     (r2)+,(r3)+
-       bit     $m.ext,fpsr
-       bne     1f
-       clr     (r3)+
-       clr     (r3)+
-1:
-       rts     pc
-
-i.ldcjx:
-       mov     $asign,r0
-       mov     $1,(r0)+
-       mov     (r3)+,(r0)+
-       bit     $m.lngi,fpsr
-       beq     1f
-       mov     (r3)+,(r0)+
-       clr     (r0)+
-       clr     (r0)+
-       mov     $32.-8,(r0)+
-       jmp     saret
-1:
-       clr     (r0)+
-       clr     (r0)+
-       clr     (r0)+
-       mov     $16.-8,(r0)
-       jmp     saret
-
-i.stcxj:
-       mov     r3,r5
-       mov     $asign,r0
-       jsr     pc,seta
-       clr     r4
-       mov     $areg,r0
-       mov     (r0)+,r1
-       mov     (r0)+,r2
-       mov     (r0)+,r3
-       mov     aexp,r0
-1:
-       cmp     r0,$48.-8
-       bge     1f
-       clc
-       ror     r1
-       ror     r2
-       ror     r3
-       inc     r0
-       br      1b
-1:
-       bgt     7f
-       tst     r1
-       beq     1f
-7:
-       bis     $1,r4                   / C-bit
-1:
-       bit     $m.lngi,fpsr
-       beq     1f
-       tst     asign
-       bge     2f
-       neg     r3
-       adc     r2
-       bcs     2f
-       neg     r2
-       bis     $10,r4                  / N-bit
-2:
-       mov     r2,(r5)
-       mov     r3,2(r5)
-       bis     r2,r3
-       br      8f
-1:
-       tst     r2
-       beq     1f
-       bis     $1,r4                   / C-bit
-1:
-       tst     asign
-       bge     2f
-       neg     r3
-       bis     $10,r4                  / N-bit
-2:
-       mov     r3,(r5)
-8:
-       bne     1f
-       bis     $4,r4                   / Z-bit
-1:
-       bic     $17,sps
-       bic     $17,fpsr
-       bis     r4,sps
-       bis     r4,fpsr
-       jmp     ret
-
-xoflo:
-       bis     $1,fpsr                 / set fixed overflow (carry)
-       jmp     ret
-
-i.ldexp:
-       mov     $asign,r0
-       jsr     pc,seta
-       mov     (r3),aexp
-       jsr     pc,reta
-       jmp     sret
-
-i.stexp:
-       mov     $asign,r0
-       jsr     pc,seta
-       mov     aexp,(r3)
-       mov     r3,r5
-       bic     $17,sps
-       tst     (r3)
-       bmi     1f
-       bne     2f
-       bis     $4,sps                  / Z-bit
-       br      2f
-1:
-       bis     $10,sps                 / N-bit
-2:
-       jmp     sret
-
-i.ldfps:
-       mov     (r3),fpsr
-       jmp     ret
-
-i.stfps:
-       mov     fpsr,(r3)
-       jmp     ret
-
diff --git a/.ref-Research-V7/usr/src/libfpsim/fp3.s b/.ref-Research-V7/usr/src/libfpsim/fp3.s
deleted file mode 100644 (file)
index 66ffecf..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/ fp3 -- floating simulation
-
-i.addx:
-       jsr     pc,setab
-       br      1f
-
-i.subx:
-       jsr     pc,setab
-       neg     bsign
-1:
-       tst     bsign
-       beq     reta
-       tst     asign
-       beq     retb
-       mov     areg+8,r1
-       sub     breg+8,r1
-       blt     1f
-       beq     2f
-       cmp     r1,$56.
-       bge     reta
-       mov     $breg,r0
-       br      4f
-1:
-       neg     r1
-       cmp     r1,$56.
-       bge     retb
-       mov     $areg,r0
-4:
-       mov     r1,-(sp)
-       mov     (r0)+,r1
-       mov     (r0)+,r2
-       mov     (r0)+,r3
-       mov     (r0)+,r4
-       add     (sp),(r0)
-1:
-       clc
-       ror     r1
-       ror     r2
-       ror     r3
-       ror     r4
-       dec     (sp)
-       bgt     1b
-       mov     r4,-(r0)
-       mov     r3,-(r0)
-       mov     r2,-(r0)
-       mov     r1,-(r0)
-       tst     (sp)+
-2:
-       mov     $areg+8,r1
-       mov     $breg+8,r2
-       mov     $4,r0
-       cmp     asign,bsign
-       bne     4f
-       clc
-1:
-       adc     -(r1)
-       bcs     3f
-       add     -(r2),(r1)
-2:
-       dec     r0
-       bne     1b
-       br      5f
-3:
-       add     -(r2),(r1)
-       sec
-       br      2b
-       br      5f
-4:
-       clc
-1:
-       sbc     -(r1)
-       bcs     3f
-       sub     -(r2),(r1)
-2:
-       dec     r0
-       bne     1b
-       br      5f
-3:
-       sub     -(r2),(r1)
-       sec
-       br      2b
-
-saret:
-       mov     $areg,r1
-5:
-       tst     (r1)
-       bge     3f
-       mov     $areg+8,r1
-       mov     $4,r0
-       clc
-1:
-       adc     -(r1)
-       bcs     2f
-       neg     (r1)
-2:
-       dec     r0
-       bne     1b
-       neg     -(r1)
-3:
-       jsr     pc,norm
-       br      reta
-
-retb:
-       mov     $bsign,r1
-       mov     $asign,r2
-       mov     $6,r0
-1:
-       mov     (r1)+,(r2)+
-       dec     r0
-       bne     1b
-
-reta:
-       mov     r5,r2
-       mov     $asign,r0
-       tst     (r0)
-       beq     unflo
-       mov     aexp,r1
-       cmp     r1,$177
-       bgt     ovflo
-       cmp     r1,$-177
-       blt     unflo
-       add     $200,r1
-       swab    r1
-       clc
-       ror     r1
-       tst     (r0)+
-       bge     1f
-       bis     $100000,r1
-1:
-       bic     $!177,(r0)
-       bis     (r0)+,r1
-       mov     r1,(r2)+
-       mov     (r0)+,(r2)+
-       bit     $m.ext,fpsr
-       beq     1f
-       mov     (r0)+,(r2)+
-       mov     (r0)+,(r2)+
-1:
-       rts     pc
-
-unflo:
-       clr     (r2)+
-       clr     (r2)+
-       bit     $m.ext,fpsr
-       beq     1f
-       clr     (r2)+
-       clr     (r2)+
-1:
-       rts     pc
-
-ovflo:
-       bis     $2,fpsr                 / set v-bit (overflow)
-       jmp     ret
-
-i.mulx:
-       jsr     pc,i.mul
-       br      saret
-
-i.modx:
-       jsr     pc,i.mul
-       jsr     pc,norm
-       mov     $asign,r0
-       mov     $bsign,r1
-       mov     $6,r2
-1:
-       mov     (r0)+,(r1)+
-       dec     r2
-       bne     1b
-       clr     r0              / count
-       mov     $200,r1         / bit
-       clr     r2              / reg offset
-1:
-       cmp     r0,aexp
-       bge     2f              / in fraction
-       bic     r1,areg(r2)
-       br      3f
-2:
-       bic     r1,breg(r2)
-3:
-       inc     r0
-       clc
-       ror     r1
-       bne     1b
-       mov     $100000,r1
-       add     $2,r2
-       cmp     r2,$8
-       blt     1b
-       jsr     pc,norm
-       jsr     pc,reta
-       cmp     r5,$ac1
-       beq     1f
-       cmp     r5,$ac3
-       beq     1f
-       bit     $200,breg
-       bne     2f
-       clr     bsign
-2:
-       add     $8,r5
-       jsr     pc,retb
-       sub     $8,r5
-1:
-       rts     pc
-
-i.divx:
-       jsr     pc,setab
-       tst     bsign
-       beq     ovflo
-       sub     bexp,aexp
-       jsr     pc,xorsign
-       mov     r5,-(sp)
-       mov     $areg,r0
-       mov     (r0),r1
-       clr     (r0)+
-       mov     (r0),r2
-       clr     (r0)+
-       mov     (r0),r3
-       clr     (r0)+
-       mov     (r0),r4
-       clr     (r0)+
-       mov     $areg,r5
-       mov     $400,-(sp)
-1:
-       mov     $breg,r0
-       cmp     (r0)+,r1
-       blt     2f
-       bgt     3f
-       cmp     (r0)+,r2
-       blo     2f
-       bhi     3f
-       cmp     (r0)+,r3
-       blo     2f
-       bhi     3f
-       cmp     (r0)+,r4
-       bhi     3f
-2:
-       mov     $breg,r0
-       sub     (r0)+,r1
-       clr     -(sp)
-       sub     (r0)+,r2
-       adc     (sp)
-       clr     -(sp)
-       sub     (r0)+,r3
-       adc     (sp)
-       sub     (r0)+,r4
-       sbc     r3
-       adc     (sp)
-       sub     (sp)+,r2
-       adc     (sp)
-       sub     (sp)+,r1
-       bis     (sp),(r5)
-3:
-       asl     r4
-       rol     r3
-       rol     r2
-       rol     r1
-       clc
-       ror     (sp)
-       bne     1b
-       mov     $100000,(sp)
-       add     $2,r5
-       cmp     r5,$areg+8
-       blo     1b
-       tst     (sp)+
-       mov     (sp)+,r5
-       jmp     saret
-
-
-i.mul:
-       jsr     pc,setab
-       add     bexp,aexp
-       dec     aexp
-       jsr     pc,xorsign
-       mov     r5,-(sp)
-       mov     $breg+4,r5
-       bit     $m.ext,fpsr
-       beq     1f
-       add     $4,r5
-1:
-       clr     r0
-       clr     r1
-       clr     r2
-       clr     r3
-       clr     r4
-1:
-       asl     r0
-       bne     2f
-       inc     r0
-       tst     -(r5)
-2:
-       cmp     r0,$400
-       bne     2f
-       cmp     r5,$breg
-       bhi     2f
-       mov     $areg,r0
-       mov     r1,(r0)+
-       mov     r2,(r0)+
-       mov     r3,(r0)+
-       mov     r4,(r0)+
-       mov     (sp)+,r5
-       rts     pc
-2:
-       clc
-       ror     r1
-       ror     r2
-       ror     r3
-       ror     r4
-       bit     r0,(r5)
-       beq     1b
-       mov     r0,-(sp)
-       mov     $areg,r0
-       add     (r0)+,r1
-       clr     -(sp)
-       add     (r0)+,r2
-       adc     (sp)
-       clr     -(sp)
-       add     (r0)+,r3
-       adc     (sp)
-       add     (r0)+,r4
-       adc     r3
-       adc     (sp)
-       add     (sp)+,r2
-       adc     (sp)
-       add     (sp)+,r1
-       mov     (sp)+,r0
-       br      1b
-
-xorsign:
-       cmp     asign,bsign
-       beq     1f
-       mov     $-1,asign
-       rts     pc
-1:
-       mov     $1,asign
-       rts     pc
-
diff --git a/.ref-Research-V7/usr/src/libfpsim/fpx.s b/.ref-Research-V7/usr/src/libfpsim/fpx.s
deleted file mode 100644 (file)
index eaa1de2..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/ fpx -- floating point simulation
-
-.data
-reenter: 1
-
-.bss
-asign: .=.+2
-areg:  .=.+8
-aexp:  .=.+2
-bsign: .=.+2
-breg:  .=.+8
-bexp:  .=.+2
-
-fpsr:  .=.+2
-trapins: .=.+2
-
-ac0:   .=.+8.
-ac1:   .=.+8.
-ac2:   .=.+8.
-ac3:   .=.+8.
-ac4:   .=.+8.
-ac5:   .=.+8.
-
-sr0:   .=.+2
-sr1:   .=.+2
-       .=.+2
-       .=.+2
-       .=.+2
-       .=.+2
-ssp:   .=.+2
-spc:   .=.+2
-sps:   .=.+2
-pctmp: .=.+8
-
diff --git a/.ref-Research-V7/usr/src/libfpsim/mklib b/.ref-Research-V7/usr/src/libfpsim/mklib
deleted file mode 100755 (executable)
index 73897f7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ar rb fakfp.o /lib/libc.a fpsim.o
diff --git a/.ref-Research-V7/usr/src/libm/asin.c b/.ref-Research-V7/usr/src/libm/asin.c
deleted file mode 100644 (file)
index cacb6b4..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
-       asin(arg) and acos(arg) return the arcsin, arccos,
-       respectively of their arguments.
-
-       Arctan is called after appropriate range reduction.
-*/
-
-#include       <errno.h>
-int errno;
-double atan();
-double sqrt();
-static double pio2     = 1.570796326794896619;
-
-double
-asin(arg) double arg; {
-
-       double sign, temp;
-
-       sign = 1.;
-       if(arg <0){
-               arg = -arg;
-               sign = -1.;
-       }
-
-       if(arg > 1.){
-               errno = EDOM;
-               return(0.);
-       }
-
-       temp = sqrt(1. - arg*arg);
-       if(arg > 0.7)
-               temp = pio2 - atan(temp/arg);
-       else
-               temp = atan(arg/temp);
-
-       return(sign*temp);
-}
-
-double
-acos(arg) double arg; {
-
-       if((arg > 1.) || (arg < -1.)){
-               errno = EDOM;
-               return(0.);
-       }
-
-       return(pio2 - asin(arg));
-}
diff --git a/.ref-Research-V7/usr/src/libm/atan.c b/.ref-Research-V7/usr/src/libm/atan.c
deleted file mode 100644 (file)
index 3c8d07e..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-
-/*
-       floating-point arctangent
-
-       atan returns the value of the arctangent of its
-       argument in the range [-pi/2,pi/2].
-
-       atan2 returns the arctangent of arg1/arg2
-       in the range [-pi,pi].
-
-       there are no error returns.
-
-       coefficients are #5077 from Hart & Cheney. (19.56D)
-*/
-
-
-double static sq2p1     =2.414213562373095048802e0;
-static double sq2m1     = .414213562373095048802e0;
-static double pio2      =1.570796326794896619231e0;
-static double pio4      = .785398163397448309615e0;
-static double p4        = .161536412982230228262e2;
-static double p3        = .26842548195503973794141e3;
-static double p2        = .11530293515404850115428136e4;
-static double p1        = .178040631643319697105464587e4;
-static double p0        = .89678597403663861959987488e3;
-static double q4        = .5895697050844462222791e2;
-static double q3        = .536265374031215315104235e3;
-static double q2        = .16667838148816337184521798e4;
-static double q1        = .207933497444540981287275926e4;
-static double q0        = .89678597403663861962481162e3;
-
-
-/*
-       atan makes its argument positive and
-       calls the inner routine satan.
-*/
-
-double
-atan(arg)
-double arg;
-{
-       double satan();
-
-       if(arg>0)
-               return(satan(arg));
-       else
-               return(-satan(-arg));
-}
-
-
-/*
-       atan2 discovers what quadrant the angle
-       is in and calls atan.
-*/
-
-double
-atan2(arg1,arg2)
-double arg1,arg2;
-{
-       double satan();
-
-       if((arg1+arg2)==arg1)
-               if(arg1 >= 0.) return(pio2);
-               else return(-pio2);
-       else if(arg2 <0.)
-               if(arg1 >= 0.)
-                       return(pio2+pio2 - satan(-arg1/arg2));
-               else
-                       return(-pio2-pio2 + satan(arg1/arg2));
-       else if(arg1>0)
-               return(satan(arg1/arg2));
-       else
-               return(-satan(-arg1/arg2));
-}
-
-/*
-       satan reduces its argument (known to be positive)
-       to the range [0,0.414...] and calls xatan.
-*/
-
-static double
-satan(arg)
-double arg;
-{
-       double  xatan();
-
-       if(arg < sq2m1)
-               return(xatan(arg));
-       else if(arg > sq2p1)
-               return(pio2 - xatan(1.0/arg));
-       else
-               return(pio4 + xatan((arg-1.0)/(arg+1.0)));
-}
-
-/*
-       xatan evaluates a series valid in the
-       range [-0.414...,+0.414...].
-*/
-
-static double
-xatan(arg)
-double arg;
-{
-       double argsq;
-       double value;
-
-       argsq = arg*arg;
-       value = ((((p4*argsq + p3)*argsq + p2)*argsq + p1)*argsq + p0);
-       value = value/(((((argsq + q4)*argsq + q3)*argsq + q2)*argsq + q1)*argsq + q0);
-       return(value*arg);
-}
diff --git a/.ref-Research-V7/usr/src/libm/compall b/.ref-Research-V7/usr/src/libm/compall
deleted file mode 100755 (executable)
index e246e0a..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-cc -c -O asin.c
-cc -c -O atan.c
-cc -c -O exp.c
-cc -c -O fabs.c
-cc -c -O floor.c
-cc -c -O hypot.c
-cc -c -O j0.c
-cc -c -O j1.c
-cc -c -O jn.c
-cc -c -O log.c
-cc -c -O pow.c
-cc -c -O sin.c
-cc -c -O sinh.c
-cc -c -O sqrt.c
-cc -c -O tan.c
-cc -c -O tanh.c
diff --git a/.ref-Research-V7/usr/src/libm/exp.c b/.ref-Research-V7/usr/src/libm/exp.c
deleted file mode 100644 (file)
index 84d28f0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-       exp returns the exponential function of its
-       floating-point argument.
-
-       The coefficients are #1069 from Hart and Cheney. (22.35D)
-*/
-
-#include <errno.h>
-#include <math.h>
-
-int    errno;
-static double  p0      = .2080384346694663001443843411e7;
-static double  p1      = .3028697169744036299076048876e5;
-static double  p2      = .6061485330061080841615584556e2;
-static double  q0      = .6002720360238832528230907598e7;
-static double  q1      = .3277251518082914423057964422e6;
-static double  q2      = .1749287689093076403844945335e4;
-static double  log2e   = 1.4426950408889634073599247;
-static double  sqrt2   = 1.4142135623730950488016887;
-static double  maxf    = 10000;
-
-double
-exp(arg)
-double arg;
-{
-       double fract;
-       double temp1, temp2, xsq;
-       int ent;
-
-       if(arg == 0.)
-               return(1.);
-       if(arg < -maxf)
-               return(0.);
-       if(arg > maxf) {
-               errno = ERANGE;
-               return(HUGE);
-       }
-       arg *= log2e;
-       ent = floor(arg);
-       fract = (arg-ent) - 0.5;
-       xsq = fract*fract;
-       temp1 = ((p2*xsq+p1)*xsq+p0)*fract;
-       temp2 = ((1.0*xsq+q2)*xsq+q1)*xsq + q0;
-       return(ldexp(sqrt2*(temp2+temp1)/(temp2-temp1), ent));
-}
diff --git a/.ref-Research-V7/usr/src/libm/fabs.c b/.ref-Research-V7/usr/src/libm/fabs.c
deleted file mode 100644 (file)
index f05d598..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-double
-fabs(arg)
-double arg;
-{
-
-       if(arg < 0.)
-               arg = -arg;
-       return(arg);
-}
diff --git a/.ref-Research-V7/usr/src/libm/floor.c b/.ref-Research-V7/usr/src/libm/floor.c
deleted file mode 100644 (file)
index 6c4aa70..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * floor and ceil-- greatest integer <= arg
- * (resp least >=)
- */
-
-double modf();
-
-double
-floor(d)
-double d;
-{
-       double fract;
-
-       if (d<0.0) {
-               d = -d;
-               fract = modf(d, &d);
-               if (fract != 0.0)
-                       d += 1;
-               d = -d;
-       } else
-               modf(d, &d);
-       return(d);
-}
-
-double
-ceil(d)
-double d;
-{
-       return(-floor(-d));
-}
diff --git a/.ref-Research-V7/usr/src/libm/hypot.c b/.ref-Research-V7/usr/src/libm/hypot.c
deleted file mode 100644 (file)
index 73d009f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * sqrt(a^2 + b^2)
- *     (but carefully)
- */
-
-double sqrt();
-double
-hypot(a,b)
-double a,b;
-{
-       double t;
-       if(a<0) a = -a;
-       if(b<0) b = -b;
-       if(a > b) {
-               t = a;
-               a = b;
-               b = t;
-       }
-       if(b==0) return(0.);
-       a /= b;
-       /*
-        * pathological overflow possible
-        * in the next line.
-        */
-       return(b*sqrt(1. + a*a));
-}
-
-struct complex
-{
-       double  r;
-       double  i;
-};
-
-double
-cabs(arg)
-struct complex arg;
-{
-       double hypot();
-
-       return(hypot(arg.r, arg.i));
-}
diff --git a/.ref-Research-V7/usr/src/libm/j0.c b/.ref-Research-V7/usr/src/libm/j0.c
deleted file mode 100644 (file)
index 2b2eb54..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
-       floating point Bessel's function
-       of the first and second kinds
-       of order zero
-
-       j0(x) returns the value of J0(x)
-       for all real values of x.
-
-       There are no error returns.
-       Calls sin, cos, sqrt.
-
-       There is a niggling bug in J0 which
-       causes errors up to 2e-16 for x in the
-       interval [-8,8].
-       The bug is caused by an inappropriate order
-       of summation of the series.  rhm will fix it
-       someday.
-
-       Coefficients are from Hart & Cheney.
-       #5849 (19.22D)
-       #6549 (19.25D)
-       #6949 (19.41D)
-
-       y0(x) returns the value of Y0(x)
-       for positive real values of x.
-       For x<=0, error number EDOM is set and a
-       large negative value is returned.
-
-       Calls sin, cos, sqrt, log, j0.
-
-       The values of Y0 have not been checked
-       to more than ten places.
-
-       Coefficients are from Hart & Cheney.
-       #6245 (18.78D)
-       #6549 (19.25D)
-       #6949 (19.41D)
-*/
-
-#include <math.h>
-#include <errno.h>
-
-int    errno;
-static double pzero, qzero;
-static double tpi      = .6366197723675813430755350535e0;
-static double pio4     = .7853981633974483096156608458e0;
-static double p1[] = {
-       0.4933787251794133561816813446e21,
-       -.1179157629107610536038440800e21,
-       0.6382059341072356562289432465e19,
-       -.1367620353088171386865416609e18,
-       0.1434354939140344111664316553e16,
-       -.8085222034853793871199468171e13,
-       0.2507158285536881945555156435e11,
-       -.4050412371833132706360663322e8,
-       0.2685786856980014981415848441e5,
-};
-static double q1[] = {
-       0.4933787251794133562113278438e21,
-       0.5428918384092285160200195092e19,
-       0.3024635616709462698627330784e17,
-       0.1127756739679798507056031594e15,
-       0.3123043114941213172572469442e12,
-       0.6699987672982239671814028660e9,
-       0.1114636098462985378182402543e7,
-       0.1363063652328970604442810507e4,
-       1.0
-};
-static double p2[] = {
-       0.5393485083869438325262122897e7,
-       0.1233238476817638145232406055e8,
-       0.8413041456550439208464315611e7,
-       0.2016135283049983642487182349e7,
-       0.1539826532623911470917825993e6,
-       0.2485271928957404011288128951e4,
-       0.0,
-};
-static double q2[] = {
-       0.5393485083869438325560444960e7,
-       0.1233831022786324960844856182e8,
-       0.8426449050629797331554404810e7,
-       0.2025066801570134013891035236e7,
-       0.1560017276940030940592769933e6,
-       0.2615700736920839685159081813e4,
-       1.0,
-};
-static double p3[] = {
-       -.3984617357595222463506790588e4,
-       -.1038141698748464093880530341e5,
-       -.8239066313485606568803548860e4,
-       -.2365956170779108192723612816e4,
-       -.2262630641933704113967255053e3,
-       -.4887199395841261531199129300e1,
-       0.0,
-};
-static double q3[] = {
-       0.2550155108860942382983170882e6,
-       0.6667454239319826986004038103e6,
-       0.5332913634216897168722255057e6,
-       0.1560213206679291652539287109e6,
-       0.1570489191515395519392882766e5,
-       0.4087714673983499223402830260e3,
-       1.0,
-};
-static double p4[] = {
-       -.2750286678629109583701933175e20,
-       0.6587473275719554925999402049e20,
-       -.5247065581112764941297350814e19,
-       0.1375624316399344078571335453e18,
-       -.1648605817185729473122082537e16,
-       0.1025520859686394284509167421e14,
-       -.3436371222979040378171030138e11,
-       0.5915213465686889654273830069e8,
-       -.4137035497933148554125235152e5,
-};
-static double q4[] = {
-       0.3726458838986165881989980e21,
-       0.4192417043410839973904769661e19,
-       0.2392883043499781857439356652e17,
-       0.9162038034075185262489147968e14,
-       0.2613065755041081249568482092e12,
-       0.5795122640700729537480087915e9,
-       0.1001702641288906265666651753e7,
-       0.1282452772478993804176329391e4,
-       1.0,
-};
-
-double
-j0(arg) double arg;{
-       double argsq, n, d;
-       double sin(), cos(), sqrt();
-       int i;
-
-       if(arg < 0.) arg = -arg;
-       if(arg > 8.){
-               asympt(arg);
-               n = arg - pio4;
-               return(sqrt(tpi/arg)*(pzero*cos(n) - qzero*sin(n)));
-       }
-       argsq = arg*arg;
-       for(n=0,d=0,i=8;i>=0;i--){
-               n = n*argsq + p1[i];
-               d = d*argsq + q1[i];
-       }
-       return(n/d);
-}
-
-double
-y0(arg) double arg;{
-       double argsq, n, d;
-       double sin(), cos(), sqrt(), log(), j0();
-       int i;
-
-       errno = 0;
-       if(arg <= 0.){
-               errno = EDOM;
-               return(-HUGE);
-       }
-       if(arg > 8.){
-               asympt(arg);
-               n = arg - pio4;
-               return(sqrt(tpi/arg)*(pzero*sin(n) + qzero*cos(n)));
-       }
-       argsq = arg*arg;
-       for(n=0,d=0,i=8;i>=0;i--){
-               n = n*argsq + p4[i];
-               d = d*argsq + q4[i];
-       }
-       return(n/d + tpi*j0(arg)*log(arg));
-}
-
-static
-asympt(arg) double arg;{
-       double zsq, n, d;
-       int i;
-       zsq = 64./(arg*arg);
-       for(n=0,d=0,i=6;i>=0;i--){
-               n = n*zsq + p2[i];
-               d = d*zsq + q2[i];
-       }
-       pzero = n/d;
-       for(n=0,d=0,i=6;i>=0;i--){
-               n = n*zsq + p3[i];
-               d = d*zsq + q3[i];
-       }
-       qzero = (8./arg)*(n/d);
-}
diff --git a/.ref-Research-V7/usr/src/libm/j1.c b/.ref-Research-V7/usr/src/libm/j1.c
deleted file mode 100644 (file)
index 13b397f..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
-       floating point Bessel's function
-       of the first and second kinds
-       of order one
-
-       j1(x) returns the value of J1(x)
-       for all real values of x.
-
-       There are no error returns.
-       Calls sin, cos, sqrt.
-
-       There is a niggling bug in J1 which
-       causes errors up to 2e-16 for x in the
-       interval [-8,8].
-       The bug is caused by an inappropriate order
-       of summation of the series.  rhm will fix it
-       someday.
-
-       Coefficients are from Hart & Cheney.
-       #6050 (20.98D)
-       #6750 (19.19D)
-       #7150 (19.35D)
-
-       y1(x) returns the value of Y1(x)
-       for positive real values of x.
-       For x<=0, error number EDOM is set and a
-       large negative value is returned.
-
-       Calls sin, cos, sqrt, log, j1.
-
-       The values of Y1 have not been checked
-       to more than ten places.
-
-       Coefficients are from Hart & Cheney.
-       #6447 (22.18D)
-       #6750 (19.19D)
-       #7150 (19.35D)
-*/
-
-#include <math.h>
-#include <errno.h>
-
-int    errno;
-static double pzero, qzero;
-static double tpi      = .6366197723675813430755350535e0;
-static double pio4     = .7853981633974483096156608458e0;
-static double p1[] = {
-       0.581199354001606143928050809e21,
-       -.6672106568924916298020941484e20,
-       0.2316433580634002297931815435e19,
-       -.3588817569910106050743641413e17,
-       0.2908795263834775409737601689e15,
-       -.1322983480332126453125473247e13,
-       0.3413234182301700539091292655e10,
-       -.4695753530642995859767162166e7,
-       0.2701122710892323414856790990e4,
-};
-static double q1[] = {
-       0.1162398708003212287858529400e22,
-       0.1185770712190320999837113348e20,
-       0.6092061398917521746105196863e17,
-       0.2081661221307607351240184229e15,
-       0.5243710262167649715406728642e12,
-       0.1013863514358673989967045588e10,
-       0.1501793594998585505921097578e7,
-       0.1606931573481487801970916749e4,
-       1.0,
-};
-static double p2[] = {
-       -.4435757816794127857114720794e7,
-       -.9942246505077641195658377899e7,
-       -.6603373248364939109255245434e7,
-       -.1523529351181137383255105722e7,
-       -.1098240554345934672737413139e6,
-       -.1611616644324610116477412898e4,
-       0.0,
-};
-static double q2[] = {
-       -.4435757816794127856828016962e7,
-       -.9934124389934585658967556309e7,
-       -.6585339479723087072826915069e7,
-       -.1511809506634160881644546358e7,
-       -.1072638599110382011903063867e6,
-       -.1455009440190496182453565068e4,
-       1.0,
-};
-static double p3[] = {
-       0.3322091340985722351859704442e5,
-       0.8514516067533570196555001171e5,
-       0.6617883658127083517939992166e5,
-       0.1849426287322386679652009819e5,
-       0.1706375429020768002061283546e4,
-       0.3526513384663603218592175580e2,
-       0.0,
-};
-static double q3[] = {
-       0.7087128194102874357377502472e6,
-       0.1819458042243997298924553839e7,
-       0.1419460669603720892855755253e7,
-       0.4002944358226697511708610813e6,
-       0.3789022974577220264142952256e5,
-       0.8638367769604990967475517183e3,
-       1.0,
-};
-static double p4[] = {
-       -.9963753424306922225996744354e23,
-       0.2655473831434854326894248968e23,
-       -.1212297555414509577913561535e22,
-       0.2193107339917797592111427556e20,
-       -.1965887462722140658820322248e18,
-       0.9569930239921683481121552788e15,
-       -.2580681702194450950541426399e13,
-       0.3639488548124002058278999428e10,
-       -.2108847540133123652824139923e7,
-       0.0,
-};
-static double q4[] = {
-       0.5082067366941243245314424152e24,
-       0.5435310377188854170800653097e22,
-       0.2954987935897148674290758119e20,
-       0.1082258259408819552553850180e18,
-       0.2976632125647276729292742282e15,
-       0.6465340881265275571961681500e12,
-       0.1128686837169442121732366891e10,
-       0.1563282754899580604737366452e7,
-       0.1612361029677000859332072312e4,
-       1.0,
-};
-
-double
-j1(arg) double arg;{
-       double xsq, n, d, x;
-       double sin(), cos(), sqrt();
-       int i;
-
-       x = arg;
-       if(x < 0.) x = -x;
-       if(x > 8.){
-               asympt(x);
-               n = x - 3.*pio4;
-               n = sqrt(tpi/x)*(pzero*cos(n) - qzero*sin(n));
-               if(arg <0.) n = -n;
-               return(n);
-       }
-       xsq = x*x;
-       for(n=0,d=0,i=8;i>=0;i--){
-               n = n*xsq + p1[i];
-               d = d*xsq + q1[i];
-       }
-       return(arg*n/d);
-}
-
-double
-y1(arg) double arg;{
-       double xsq, n, d, x;
-       double sin(), cos(), sqrt(), log(), j1();
-       int i;
-
-       errno = 0;
-       x = arg;
-       if(x <= 0.){
-               errno = EDOM;
-               return(-HUGE);
-       }
-       if(x > 8.){
-               asympt(x);
-               n = x - 3*pio4;
-               return(sqrt(tpi/x)*(pzero*sin(n) + qzero*cos(n)));
-       }
-       xsq = x*x;
-       for(n=0,d=0,i=9;i>=0;i--){
-               n = n*xsq + p4[i];
-               d = d*xsq + q4[i];
-       }
-       return(x*n/d + tpi*(j1(x)*log(x)-1./x));
-}
-
-static
-asympt(arg) double arg;{
-       double zsq, n, d;
-       int i;
-       zsq = 64./(arg*arg);
-       for(n=0,d=0,i=6;i>=0;i--){
-               n = n*zsq + p2[i];
-               d = d*zsq + q2[i];
-       }
-       pzero = n/d;
-       for(n=0,d=0,i=6;i>=0;i--){
-               n = n*zsq + p3[i];
-               d = d*zsq + q3[i];
-       }
-       qzero = (8./arg)*(n/d);
-}
diff --git a/.ref-Research-V7/usr/src/libm/jn.c b/.ref-Research-V7/usr/src/libm/jn.c
deleted file mode 100644 (file)
index f9713a0..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-       floating point Bessel's function of
-       the first and second kinds and of
-       integer order.
-
-       int n;
-       double x;
-       jn(n,x);
-
-       returns the value of Jn(x) for all
-       integer values of n and all real values
-       of x.
-
-       There are no error returns.
-       Calls j0, j1.
-
-       For n=0, j0(x) is called,
-       for n=1, j1(x) is called,
-       for n<x, forward recursion us used starting
-       from values of j0(x) and j1(x).
-       for n>x, a continued fraction approximation to
-       j(n,x)/j(n-1,x) is evaluated and then backward
-       recursion is used starting from a supposed value
-       for j(n,x). The resulting value of j(0,x) is
-       compared with the actual value to correct the
-       supposed value of j(n,x).
-
-       yn(n,x) is similar in all respects, except
-       that forward recursion is used for all
-       values of n>1.
-*/
-
-#include <math.h>
-#include <errno.h>
-
-int    errno;
-
-double
-jn(n,x) int n; double x;{
-       int i;
-       double a, b, temp;
-       double xsq, t;
-       double j0(), j1();
-
-       if(n<0){
-               n = -n;
-               x = -x;
-       }
-       if(n==0) return(j0(x));
-       if(n==1) return(j1(x));
-       if(x == 0.) return(0.);
-       if(n>x) goto recurs;
-
-       a = j0(x);
-       b = j1(x);
-       for(i=1;i<n;i++){
-               temp = b;
-               b = (2.*i/x)*b - a;
-               a = temp;
-       }
-       return(b);
-
-recurs:
-       xsq = x*x;
-       for(t=0,i=n+16;i>n;i--){
-               t = xsq/(2.*i - t);
-       }
-       t = x/(2.*n-t);
-
-       a = t;
-       b = 1;
-       for(i=n-1;i>0;i--){
-               temp = b;
-               b = (2.*i/x)*b - a;
-               a = temp;
-       }
-       return(t*j0(x)/b);
-}
-
-double
-yn(n,x) int n; double x;{
-       int i;
-       int sign;
-       double a, b, temp;
-       double y0(), y1();
-
-       if (x <= 0) {
-               errno = EDOM;
-               return(-HUGE);
-       }
-       sign = 1;
-       if(n<0){
-               n = -n;
-               if(n%2 == 1) sign = -1;
-       }
-       if(n==0) return(y0(x));
-       if(n==1) return(sign*y1(x));
-
-       a = y0(x);
-       b = y1(x);
-       for(i=1;i<n;i++){
-               temp = b;
-               b = (2.*i/x)*b - a;
-               a = temp;
-       }
-       return(sign*b);
-}
diff --git a/.ref-Research-V7/usr/src/libm/log.c b/.ref-Research-V7/usr/src/libm/log.c
deleted file mode 100644 (file)
index 3c9d65d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-       log returns the natural logarithm of its floating
-       point argument.
-
-       The coefficients are #2705 from Hart & Cheney. (19.38D)
-
-       It calls frexp.
-*/
-
-#include <errno.h>
-#include <math.h>
-
-int    errno;
-double frexp();
-static double  log2    = 0.693147180559945309e0;
-static double  ln10    = 2.302585092994045684;
-static double  sqrto2  = 0.707106781186547524e0;
-static double  p0      = -.240139179559210510e2;
-static double  p1      = 0.309572928215376501e2;
-static double  p2      = -.963769093368686593e1;
-static double  p3      = 0.421087371217979714e0;
-static double  q0      = -.120069589779605255e2;
-static double  q1      = 0.194809660700889731e2;
-static double  q2      = -.891110902798312337e1;
-
-double
-log(arg)
-double arg;
-{
-       double x,z, zsq, temp;
-       int exp;
-
-       if(arg <= 0.) {
-               errno = EDOM;
-               return(-HUGE);
-       }
-       x = frexp(arg,&exp);
-       while(x<0.5) {
-               x = x*2;
-               exp = exp-1;
-       }
-       if(x<sqrto2) {
-               x = 2*x;
-               exp = exp-1;
-       }
-
-       z = (x-1)/(x+1);
-       zsq = z*z;
-
-       temp = ((p3*zsq + p2)*zsq + p1)*zsq + p0;
-       temp = temp/(((1.0*zsq + q2)*zsq + q1)*zsq + q0);
-       temp = temp*z + exp*log2;
-       return(temp);
-}
-
-double
-log10(arg)
-double arg;
-{
-
-       return(log(arg)/ln10);
-}
diff --git a/.ref-Research-V7/usr/src/libm/mklib b/.ref-Research-V7/usr/src/libm/mklib
deleted file mode 100755 (executable)
index 470ab14..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-ar rc libm.a \
-asin.o \
-atan.o \
-hypot.o \
-jn.o \
-j0.o \
-j1.o \
-pow.o \
-fabs.o \
-log.o \
-sin.o \
-sqrt.o \
-tan.o \
-tanh.o \
-sinh.o \
-exp.o \
-floor.o
diff --git a/.ref-Research-V7/usr/src/libm/pow.c b/.ref-Research-V7/usr/src/libm/pow.c
deleted file mode 100644 (file)
index b2708db..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-       computes a^b.
-       uses log and exp
-*/
-
-#include       <errno.h>
-int errno;
-double log(), exp();
-
-double
-pow(arg1,arg2)
-double arg1, arg2;
-{
-       double temp;
-       long l;
-
-       if(arg1 <= 0.) {
-               if(arg1 == 0.) {
-                       if(arg2 <= 0.)
-                               goto domain;
-                       return(0.);
-               }
-               l = arg2;
-               if(l != arg2)
-                       goto domain;
-               temp = exp(arg2 * log(-arg1));
-               if(l & 1)
-                       temp = -temp;
-               return(temp);
-       }
-       return(exp(arg2 * log(arg1)));
-
-domain:
-       errno = EDOM;
-       return(0.);
-}
diff --git a/.ref-Research-V7/usr/src/libm/sin.c b/.ref-Research-V7/usr/src/libm/sin.c
deleted file mode 100644 (file)
index 3f76374..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-       C program for floating point sin/cos.
-       Calls modf.
-       There are no error exits.
-       Coefficients are #3370 from Hart & Cheney (18.80D).
-*/
-
-static double twoopi   = 0.63661977236758134308;
-static double p0       =  .1357884097877375669092680e8;
-static double p1       = -.4942908100902844161158627e7;
-static double p2       =  .4401030535375266501944918e6;
-static double p3       = -.1384727249982452873054457e5;
-static double p4       =  .1459688406665768722226959e3;
-static double q0       =  .8644558652922534429915149e7;
-static double q1       =  .4081792252343299749395779e6;
-static double q2       =  .9463096101538208180571257e4;
-static double q3       =  .1326534908786136358911494e3;
-
-double
-cos(arg)
-double arg;
-{
-       double sinus();
-       if(arg<0)
-               arg = -arg;
-       return(sinus(arg, 1));
-}
-
-double
-sin(arg)
-double arg;
-{
-       double sinus();
-       return(sinus(arg, 0));
-}
-
-static double
-sinus(arg, quad)
-double arg;
-int quad;
-{
-       double modf();
-       double e, f;
-       double ysq;
-       double x,y;
-       int k;
-       double temp1, temp2;
-
-       x = arg;
-       if(x<0) {
-               x = -x;
-               quad = quad + 2;
-       }
-       x = x*twoopi;   /*underflow?*/
-       if(x>32764){
-               y = modf(x,&e);
-               e = e + quad;
-               modf(0.25*e,&f);
-               quad = e - 4*f;
-       }else{
-               k = x;
-               y = x - k;
-               quad = (quad + k) & 03;
-       }
-       if (quad & 01)
-               y = 1-y;
-       if(quad > 1)
-               y = -y;
-
-       ysq = y*y;
-       temp1 = ((((p4*ysq+p3)*ysq+p2)*ysq+p1)*ysq+p0)*y;
-       temp2 = ((((ysq+q3)*ysq+q2)*ysq+q1)*ysq+q0);
-       return(temp1/temp2);
-}
diff --git a/.ref-Research-V7/usr/src/libm/sinh.c b/.ref-Research-V7/usr/src/libm/sinh.c
deleted file mode 100644 (file)
index e0e8862..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
-       sinh(arg) returns the hyperbolic sine of its floating-
-       point argument.
-
-       The exponential function is called for arguments
-       greater in magnitude than 0.5.
-
-       A series is used for arguments smaller in magnitude than 0.5.
-       The coefficients are #2029 from Hart & Cheney. (20.36D)
-
-       cosh(arg) is computed from the exponential function for
-       all arguments.
-*/
-
-double exp();
-
-static double p0  = -0.6307673640497716991184787251e+6;
-static double p1  = -0.8991272022039509355398013511e+5;
-static double p2  = -0.2894211355989563807284660366e+4;
-static double p3  = -0.2630563213397497062819489e+2;
-static double q0  = -0.6307673640497716991212077277e+6;
-static double q1   = 0.1521517378790019070696485176e+5;
-static double q2  = -0.173678953558233699533450911e+3;
-
-double
-sinh(arg)
-double arg;
-{
-       double temp, argsq;
-       register sign;
-
-       sign = 1;
-       if(arg < 0) {
-               arg = - arg;
-               sign = -1;
-       }
-
-       if(arg > 21.) {
-               temp = exp(arg)/2;
-               if (sign>0)
-                       return(temp);
-               else
-                       return(-temp);
-       }
-
-       if(arg > 0.5) {
-               return(sign*(exp(arg) - exp(-arg))/2);
-       }
-
-       argsq = arg*arg;
-       temp = (((p3*argsq+p2)*argsq+p1)*argsq+p0)*arg;
-       temp /= (((argsq+q2)*argsq+q1)*argsq+q0);
-       return(sign*temp);
-}
-
-double
-cosh(arg)
-double arg;
-{
-       if(arg < 0)
-               arg = - arg;
-       if(arg > 21.) {
-               return(exp(arg)/2);
-       }
-
-       return((exp(arg) + exp(-arg))/2);
-}
diff --git a/.ref-Research-V7/usr/src/libm/sqrt.c b/.ref-Research-V7/usr/src/libm/sqrt.c
deleted file mode 100644 (file)
index 0282333..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-       sqrt returns the square root of its floating
-       point argument. Newton's method.
-
-       calls frexp
-*/
-
-#include <errno.h>
-
-int errno;
-double frexp();
-
-double
-sqrt(arg)
-double arg;
-{
-       double x, temp;
-       int exp;
-       int i;
-
-       if(arg <= 0.) {
-               if(arg < 0.)
-                       errno = EDOM;
-               return(0.);
-       }
-       x = frexp(arg,&exp);
-       while(x < 0.5) {
-               x *= 2;
-               exp--;
-       }
-       /*
-        * NOTE
-        * this wont work on 1's comp
-        */
-       if(exp & 1) {
-               x *= 2;
-               exp--;
-       }
-       temp = 0.5*(1.0+x);
-
-       while(exp > 60) {
-               temp *= (1L<<30);
-               exp -= 60;
-       }
-       while(exp < -60) {
-               temp /= (1L<<30);
-               exp += 60;
-       }
-       if(exp >= 0)
-               temp *= 1L << (exp/2);
-       else
-               temp /= 1L << (-exp/2);
-       for(i=0; i<=4; i++)
-               temp = 0.5*(temp + arg/temp);
-       return(temp);
-}
diff --git a/.ref-Research-V7/usr/src/libm/tan.c b/.ref-Research-V7/usr/src/libm/tan.c
deleted file mode 100644 (file)
index 7df1719..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-       floating point tangent
-
-       A series is used after range reduction.
-       Coefficients are #4285 from Hart & Cheney. (19.74D)
-*/
-
-#include <errno.h>
-#include <math.h>
-
-int    errno;
-static double invpi      = 1.27323954473516268;
-static double p0        = -0.1306820264754825668269611177e+5;
-static double p1         = 0.1055970901714953193602353981e+4;
-static double p2        = -0.1550685653483266376941705728e+2;
-static double p3         = 0.3422554387241003435328470489e-1;
-static double p4         = 0.3386638642677172096076369e-4;
-static double q0        = -0.1663895238947119001851464661e+5;
-static double q1         = 0.4765751362916483698926655581e+4;
-static double q2        = -0.1555033164031709966900124574e+3;
-
-double
-tan(arg)
-double arg;
-{
-       double modf();
-       double sign, temp, e, x, xsq;
-       int flag, i;
-
-       flag = 0;
-       sign = 1.;
-       if(arg < 0.){
-               arg = -arg;
-               sign = -1.;
-       }
-       arg = arg*invpi;   /*overflow?*/
-       x = modf(arg,&e);
-       i = e;
-       switch(i%4) {
-       case 1:
-               x = 1. - x;
-               flag = 1;
-               break;
-
-       case 2:
-               sign = - sign;
-               flag = 1;
-               break;
-
-       case 3:
-               x = 1. - x;
-               sign = - sign;
-               break;
-
-       case 0:
-               break;
-       }
-
-       xsq = x*x;
-       temp = ((((p4*xsq+p3)*xsq+p2)*xsq+p1)*xsq+p0)*x;
-       temp = temp/(((1.0*xsq+q2)*xsq+q1)*xsq+q0);
-
-       if(flag == 1) {
-               if(temp == 0.) {
-                       errno = ERANGE;
-                       if (sign>0)
-                               return(HUGE);
-                       return(-HUGE);
-               }
-               temp = 1./temp;
-       }
-       return(sign*temp);
-}
diff --git a/.ref-Research-V7/usr/src/libm/tanh.c b/.ref-Research-V7/usr/src/libm/tanh.c
deleted file mode 100644 (file)
index 3f83a3f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-       tanh(arg) computes the hyperbolic tangent of its floating
-       point argument.
-
-       sinh and cosh are called except for large arguments, which
-       would cause overflow improperly.
-*/
-
-double sinh(), cosh();
-
-double
-tanh(arg)
-double arg;
-{
-       double sign;
-
-       sign = 1.;
-       if(arg < 0.){
-               arg = -arg;
-               sign = -1.;
-       }
-
-       if(arg > 21.)
-               return(sign);
-
-       return(sign*sinh(arg)/cosh(arg));
-}
diff --git a/.ref-Research-V7/usr/src/libmp/compall b/.ref-Research-V7/usr/src/libmp/compall
deleted file mode 100755 (executable)
index ab8eaf9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-cc -c -O pow.c gcd.c msqrt.c mdiv.c mout.c mult.c madd.c util.c
diff --git a/.ref-Research-V7/usr/src/libmp/gcd.c b/.ref-Research-V7/usr/src/libmp/gcd.c
deleted file mode 100644 (file)
index cedad0a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <mp.h>
-gcd(a,b,c) MINT *a,*b,*c;
-{      MINT x,y,z,w;
-       x.len=y.len=z.len=w.len=0;
-       move(a,&x);
-       move(b,&y);
-       while(y.len!=0)
-       {       mdiv(&x,&y,&w,&z);
-               move(&y,&x);
-               move(&z,&y);
-       }
-       move(&x,c);
-       xfree(&x);
-       xfree(&y);
-       xfree(&z);
-       xfree(&w);
-       return;
-}
-invert(a, b, c) MINT *a, *b, *c;
-{      MINT x, y, z, w, Anew, Aold;
-       int i = 0;
-       x.len = y.len = z.len = w.len = Aold.len = 0;
-       Anew.len = 1;
-       Anew.val = xalloc(1);
-       *Anew.val = 1;
-       move(b, &x);
-       move(a, &y);
-       while(y.len != 0)
-       {       mdiv(&x, &y, &w, &z);
-               move(&Anew, &x);
-               mult(&w, &Anew, &Anew);
-               madd(&Anew, &Aold, &Anew);
-               move(&x, &Aold);
-               move(&y, &x);
-               move(&z, &y);
-               i++;
-       }
-       move(&Aold, c);
-       if( (i&01) == 0) msub(b, c, c);
-       xfree(&x);
-       xfree(&y);
-       xfree(&z);
-       xfree(&w);
-       xfree(&Aold);
-       xfree(&Anew);
-}
diff --git a/.ref-Research-V7/usr/src/libmp/madd.c b/.ref-Research-V7/usr/src/libmp/madd.c
deleted file mode 100644 (file)
index 155d8c0..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#include <mp.h>
-m_add(a,b,c) struct mint *a,*b,*c;
-{      int carry,i;
-       int x;
-       short *cval;
-       cval=xalloc(a->len+1,"m_add");
-       carry=0;
-       for(i=0;i<b->len;i++)
-       {       x=carry+a->val[i]+b->val[i];
-               if(x&0100000)
-               {       carry=1;
-                       cval[i]=x&077777;
-               }
-               else
-               {       carry=0;
-                       cval[i]=x;
-               }
-       }
-       for(;i<a->len;i++)
-       {       x=carry+a->val[i];
-               if(x&0100000) cval[i]=x&077777;
-               else
-               {       carry=0;
-                       cval[i]=x;
-               }
-
-       }
-       if(carry==1)
-       {       cval[i]=1;
-               c->len=i+1;
-       }
-       else c->len=a->len;
-       c->val=cval;
-       if(c->len==0) shfree(cval);
-       return;
-}
-madd(a,b,c) struct mint *a,*b,*c;
-{      struct mint x,y,z;
-       int sign;
-       x.len=a->len;
-       x.val=a->val;
-       y.len=b->len;
-       y.val=b->val;
-       z.len=0;
-       sign=1;
-       if(x.len>=0)
-               if(y.len>=0)
-                       if(x.len>=y.len) m_add(&x,&y,&z);
-                       else m_add(&y,&x,&z);
-               else
-               {       y.len= -y.len;
-                       msub(&x,&y,&z);
-               }
-       else    if(y.len<=0)
-               {       x.len = -x.len;
-                       y.len= -y.len;
-                       sign= -1;
-                       madd(&x,&y,&z);
-               }
-               else
-               {       x.len= -x.len;
-                       msub(&y,&x,&z);
-               }
-        xfree(c);
-       c->val=z.val;
-       c->len=sign*z.len;
-       return;
-}
-m_sub(a,b,c) struct mint *a,*b,*c;
-{      int x,i;
-       int borrow;
-       short one;
-       struct mint mone;
-       one=1; mone.len= 1; mone.val= &one;
-       c->val=xalloc(a->len,"m_sub");
-       borrow=0;
-       for(i=0;i<b->len;i++)
-       {       x=borrow+a->val[i]-b->val[i];
-               if(x&0100000)
-               {       borrow= -1;
-                       c->val[i]=x&077777;
-               }
-               else
-               {       borrow=0;
-                       c->val[i]=x;
-               }
-       }
-       for(;i<a->len;i++)
-       {       x=borrow+a->val[i];
-               if(x&0100000) c->val[i]=x&077777;
-               else
-               {       borrow=0;
-                       c->val[i]=x;
-               }
-       }
-       if(borrow<0)
-       {       for(i=0;i<a->len;i++) c->val[i] ^= 077777;
-               c->len=a->len;
-               madd(c,&mone,c);
-       }
-       for(i=a->len-1;i>=0;--i) if(c->val[i]>0)
-                               {       if(borrow==0) c->len=i+1;
-                                       else c->len= -i-1;
-                                       return;
-                               }
-       shfree(c->val);
-       return;
-}
-msub(a,b,c) struct mint *a,*b,*c;
-{      struct mint x,y,z;
-       int sign;
-       x.len=a->len;
-       y.len=b->len;
-       x.val=a->val;
-       y.val=b->val;
-       z.len=0;
-       sign=1;
-       if(x.len>=0)
-               if(y.len>=0)
-                       if(x.len>=y.len) m_sub(&x,&y,&z);
-                       else
-                       {       sign= -1;
-                               msub(&y,&x,&z);
-                       }
-               else
-               {       y.len= -y.len;
-                       madd(&x,&y,&z);
-               }
-       else    if(y.len<=0)
-               {       sign= -1;
-                       x.len= -x.len;
-                       y.len= -y.len;
-                       msub(&y,&x,&z);
-               }
-               else
-               {       x.len= -x.len;
-                       madd(&x,&y,&z);
-                       sign= -1;
-               }
-       if(a==c && x.len!=0) xfree(a);
-       else if(b==c && y.len!=0) xfree(b);
-       else xfree(c);
-       c->val=z.val;
-       c->len=sign*z.len;
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/libmp/mdiv.c b/.ref-Research-V7/usr/src/libmp/mdiv.c
deleted file mode 100644 (file)
index 1f8a0fc..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <mp.h>
-mdiv(a,b,q,r) MINT *a,*b,*q,*r;
-{      MINT x,y;
-       int sign;
-       sign=1;
-       x.val=a->val;
-       y.val=b->val;
-       x.len=a->len;
-       if(x.len<0) {sign= -1; x.len= -x.len;}
-       y.len=b->len;
-       if(y.len<0) {sign= -sign; y.len= -y.len;}
-       xfree(q);
-       xfree(r);
-       m_div(&x,&y,q,r);
-       if(sign==-1)
-       {       q->len= -q->len;
-               r->len = - r->len;
-       }
-       return;
-}
-m_dsb(q,n,a,b) short *a,*b;
-{      long int x,qx;
-       int borrow,j,u;
-       qx=q;
-       borrow=0;
-       for(j=0;j<n;j++)
-       {       x=borrow-a[j]*qx+b[j];
-               b[j]=x&077777;
-               borrow=x>>15;
-       }
-       x=borrow+b[j];
-       b[j]=x&077777;
-       if(x>>15 ==0) { return(0);}
-       borrow=0;
-       for(j=0;j<n;j++)
-       {       u=a[j]+b[j]+borrow;
-               if(u<0) borrow=1;
-               else borrow=0;
-               b[j]=u&077777;
-       }
-       { return(1);}
-}
-m_trq(v1,v2,u1,u2,u3)
-{      long int d;
-       long int x1;
-       if(u1==v1) d=077777;
-       else d=(u1*0100000L+u2)/v1;
-       while(1)
-       {       x1=u1*0100000L+u2-v1*d;
-               x1=x1*0100000L+u3-v2*d;
-               if(x1<0) d=d-1;
-               else {return(d);}
-       }
-}
-m_div(a,b,q,r) MINT *a,*b,*q,*r;
-{      MINT u,v,x,w;
-       short d,*qval;
-       int qq,n,v1,v2,j;
-       u.len=v.len=x.len=w.len=0;
-       if(b->len==0) { fatal("mdiv divide by zero"); return;}
-       if(b->len==1)
-       {       r->val=xalloc(1,"m_div1");
-               sdiv(a,b->val[0],q,r->val);
-               if(r->val[0]==0)
-               {       shfree(r->val);
-                       r->len=0;
-               }
-               else r->len=1;
-               return;
-       }
-       if(a->len < b->len)
-       {       q->len=0;
-               r->len=a->len;
-               r->val=xalloc(r->len,"m_div2");
-               for(qq=0;qq<r->len;qq++) r->val[qq]=a->val[qq];
-               return;
-       }
-       x.len=1;
-       x.val = &d;
-       n=b->len;
-       d=0100000L/(b->val[n-1]+1L);
-       mult(a,&x,&u); /*subtle: relies on fact that mult allocates extra space */
-       mult(b,&x,&v);
-       v1=v.val[n-1];
-       v2=v.val[n-2];
-       qval=xalloc(a->len-n+1,"m_div3");
-       for(j=a->len-n;j>=0;j--)
-       {       qq=m_trq(v1,v2,u.val[j+n],u.val[j+n-1],u.val[j+n-2]);
-               if(m_dsb(qq,n,v.val,&(u.val[j]))) qq -= 1;
-               qval[j]=qq;
-       }
-       x.len=n;
-       x.val=u.val;
-       mcan(&x);
-       sdiv(&x,d,&w,(short *)&qq);
-       r->len=w.len;
-       r->val=w.val;
-       q->val=qval;
-       qq=a->len-n+1;
-       if(qq>0 && qval[qq-1]==0) qq -= 1;
-       q->len=qq;
-       if(qq==0) shfree(qval);
-       if(x.len!=0) xfree(&u);
-       xfree(&v);
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/libmp/mklib b/.ref-Research-V7/usr/src/libmp/mklib
deleted file mode 100755 (executable)
index 20c16a6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ar cr libmp.a pow.o gcd.o msqrt.o mdiv.o mout.o mult.o madd.o util.o
diff --git a/.ref-Research-V7/usr/src/libmp/mout.c b/.ref-Research-V7/usr/src/libmp/mout.c
deleted file mode 100644 (file)
index afb30a8..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-#include <stdio.h>
-#include <mp.h>
-m_in(a,b,f) MINT *a; FILE *f;
-{      MINT x,y,ten;
-       int sign,c;
-       short qten,qy;
-       xfree(a);
-       sign=1;
-       ten.len=1;
-       ten.val= &qten;
-       qten=b;
-       x.len=0;
-       y.len=1;
-       y.val= &qy;
-       while((c=getc(f))!=EOF)
-       switch(c)
-       {
-       case '\\':      getc(f);
-               continue;
-       case '\t':
-       case '\n': a->len *= sign;
-               xfree(&x);
-               return(0);
-       case ' ':
-               continue;
-       case '-': sign = -sign;
-               continue;
-       default: if(c>='0' && c<= '9')
-               {       qy=c-'0';
-                       mult(&x,&ten,a);
-                       madd(a,&y,a);
-                       move(a,&x);
-                       continue;
-               }
-               else
-               {       VOID ungetc(c,stdin);
-                       a->len *= sign;
-                       return(0);
-               }
-       }
-       return(EOF);
-}
-m_out(a,b,f) MINT *a; FILE *f;
-{      int sign,xlen,i;
-       short r;
-       MINT x;
-       char *obuf;
-       register char *bp;
-       sign=1;
-       xlen=a->len;
-       if(xlen<0)
-       {       xlen= -xlen;
-               sign= -1;
-       }
-       if(xlen==0)
-       {       fprintf(f,"0\n");
-               return;
-       }
-       x.len=xlen;
-       x.val=xalloc(xlen,"m_out");
-       for(i=0;i<xlen;i++) x.val[i]=a->val[i];
-       obuf=(char *)malloc(7*xlen);
-       bp=obuf+7*xlen-1;
-       *bp--=0;
-       while(x.len>0)
-       {       for(i=0;i<10&&x.len>0;i++)
-               {       sdiv(&x,b,&x,&r);
-                       *bp--=r+'0';
-               }
-               if(x.len>0) *bp--=' ';
-       }
-       if(sign==-1) *bp--='-';
-       fprintf(f,"%s\n",bp+1);
-       free(obuf);
-       FREE(x)
-       return;
-}
-sdiv(a,n,q,r) MINT *a,*q; short *r;
-{      MINT x,y;
-       int sign;
-       sign=1;
-       x.len=a->len;
-       x.val=a->val;
-       if(n<0)
-       {       sign= -sign;
-               n= -n;
-       }
-       if(x.len<0)
-       {       sign = -sign;
-               x.len= -x.len;
-       }
-       s_div(&x,n,&y,r);
-       xfree(q);
-       q->val=y.val;
-       q->len=sign*y.len;
-       *r = *r*sign;
-       return;
-}
-s_div(a,n,q,r) MINT *a,*q; short *r;
-{      int qlen,i;
-       long int x;
-       short *qval;
-       x=0;
-       qlen=a->len;
-       qval=xalloc(qlen,"s_div");
-       for(i=qlen-1;i>=0;i--)
-       {
-               x=x*0100000L+a->val[i];
-               qval[i]=x/n;
-               x=x%n;
-       }
-       *r=x;
-       if(qval[qlen-1]==0) qlen--;
-       q->len=qlen;
-       q->val=qval;
-       if(qlen==0) shfree(qval);
-       return;
-}
-min(a) MINT *a;
-{
-       return(m_in(a,10,stdin));
-}
-omin(a) MINT *a;
-{
-       return(m_in(a,8,stdin));
-}
-mout(a) MINT *a;
-{
-       m_out(a,10,stdout);
-}
-omout(a) MINT *a;
-{
-       m_out(a,8,stdout);
-}
-fmout(a,f) MINT *a; FILE *f;
-{      m_out(a,10,f);
-}
-fmin(a,f) MINT *a; FILE *f;
-{
-       return(m_in(a,10,f));
-}
diff --git a/.ref-Research-V7/usr/src/libmp/msqrt.c b/.ref-Research-V7/usr/src/libmp/msqrt.c
deleted file mode 100644 (file)
index a954593..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <mp.h>
-msqrt(a,b,r) MINT *a,*b,*r;
-{      MINT x,junk,y;
-       int j;
-       x.len=junk.len=y.len=0;
-       if(a->len<0) fatal("msqrt: neg arg");
-       if(a->len==0)
-       {       b->len=0;
-               r->len=0;
-               return(0);
-       }
-       if(a->len%2==1) x.len=(1+a->len)/2;
-       else x.len=1+a->len/2;
-       x.val=xalloc(x.len,"msqrt");
-       for(j=0;j<x.len;x.val[j++]=0);
-       if(a->len%2==1) x.val[x.len-1]=0400;
-       else x.val[x.len-1]=1;
-       xfree(b);
-       xfree(r);
-loop:
-       mdiv(a,&x,&y,&junk);
-       xfree(&junk);
-       madd(&x,&y,&y);
-       sdiv(&y,2,&y,(short *)&j);
-       if(mcmp(&x,&y)>0)
-       {       xfree(&x);
-               move(&y,&x);
-               xfree(&y);
-               goto loop;
-       }
-       xfree(&y);
-       move(&x,b);
-       mult(&x,&x,&x);
-       msub(a,&x,r);
-       xfree(&x);
-       return(r->len);
-}
diff --git a/.ref-Research-V7/usr/src/libmp/mult.c b/.ref-Research-V7/usr/src/libmp/mult.c
deleted file mode 100644 (file)
index d4d8de9..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#include <mp.h>
-mult(a,b,c) struct mint *a,*b,*c;
-{      struct mint x,y,z;
-       int sign;
-       sign = 1;
-       x.val=a->val;
-       y.val=b->val;
-       z.len=0;
-       if(a->len<0)
-       {       x.len= -a->len;
-               sign= -sign;
-       }
-       else    x.len=a->len;
-       if(b->len<0)
-       {       y.len= -b->len;
-               sign= -sign;
-       }
-       else    y.len=b->len;
-       if(x.len<y.len) m_mult(&y,&x,&z);
-       else m_mult(&x,&y,&z);
-       xfree(c);
-       if(sign<0) c->len= -z.len;
-       else c->len=z.len;
-       if(c->len==0) shfree(z.val);
-       else c->val=z.val;
-       return;
-}
-#define S2 x=a->val[j];
-#define S3 x=x*b->val[i-j];
-#define S4 tradd(&carry,&sum,x);
-#define S5 c->val[i]=sum.yy.low&077777;
-#define S6 sum.xx=sum.xx>>15;
-#define S7 sum.yy.high=carry;
-m_mult(a,b,c) struct mint *a,*b,*c;
-{      long x;
-       union {long xx; struct half yy;} sum;
-       int carry;
-       int i,j;
-       c->val=xalloc(a->len+b->len,"m_mult");
-       sum.xx=0;
-       for(i=0;i<b->len;i++)
-       {       carry=0;
-               for(j=0;j<i+1;j++)
-               {       S2
-                       S3
-                       S4
-               }
-               S5
-               S6
-               S7
-       }
-       for(;i<a->len;i++)
-       {       carry=0;
-               for(j=i-b->len+1;j<i+1;j++)
-               {       S2
-                       S3
-                       S4
-               }
-               S5
-               S6
-               S7
-       }
-       for(;i<a->len+b->len;i++)
-       {       carry=0;
-               for(j=i-b->len+1;j<a->len;j++)
-               {       S2
-                       S3
-                       S4
-               }
-               S5
-               S6
-               S7
-       }
-       if(c->val[i-1]!=0)
-               c->len=a->len+b->len;
-       else    c->len=a->len+b->len-1;
-       return;
-}
-tradd(a,b,c) long c; int *a; union g {long xx; struct half yy;} *b;
-{
-       b->xx= b->xx+c;
-       if(b->yy.high&0100000)
-       {       b->yy.high= b->yy.high&077777;
-               *a += 1;
-       }
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/libmp/pow.c b/.ref-Research-V7/usr/src/libmp/pow.c
deleted file mode 100644 (file)
index 4a745e4..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <mp.h>
-pow(a,b,c,d) MINT *a,*b,*c,*d;
-{      int i,j,n;
-       MINT x,y;
-       x.len=y.len=0;
-       xfree(d);
-       d->len=1;
-       d->val=xalloc(1,"pow");
-       *d->val=1;
-       for(j=0;j<b->len;j++)
-       {       n=b->val[b->len-j-1];
-               for(i=0;i<15;i++)
-               {       mult(d,d,&x);
-                       mdiv(&x,c,&y,d);
-                       if((n=n<<1)&0100000)
-                       {       mult(a,d,&x);
-                               mdiv(&x,c,&y,d);
-                       }
-               }
-       }
-       xfree(&x);
-       xfree(&y);
-       return;
-}
-rpow(a,n,b) MINT *a,*b;
-{      MINT x,y;
-       int i;
-       x.len=1;
-       x.val=xalloc(1,"rpow");
-       *x.val=n;
-       y.len=n*a->len+4;
-       y.val=xalloc(y.len,"rpow2");
-       for(i=0;i<y.len;i++) y.val[i]=0;
-       y.val[y.len-1]=010000;
-       xfree(b);
-       pow(a,&x,&y,b);
-       xfree(&x);
-       xfree(&y);
-       return;
-}
diff --git a/.ref-Research-V7/usr/src/libmp/util.c b/.ref-Research-V7/usr/src/libmp/util.c
deleted file mode 100644 (file)
index 6d81d14..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-char *malloc();
-#ifdef lint
-int xv_oid;
-#endif
-#include <stdio.h>
-#include <mp.h>
-move(a,b) MINT *a,*b;
-{      int i,j;
-       xfree(b);
-       b->len=a->len;
-       if((i=a->len)<0) i = -i;
-       if(i==0) return;
-       b->val=xalloc(i,"move");
-       for(j=0;j<i;j++)
-               b->val[j]=a->val[j];
-       return;
-}
-dummy(){}
-short *xalloc(nint,s) char *s;
-{      short *i;
-       i=(short *)malloc(2*(unsigned)nint+4);
-#ifdef DBG
-       if(dbg) fprintf(stderr, "%s: %o\n",s,i);
-#endif
-       if(i!=NULL) return(i);
-       fatal("mp: no free space");
-       return(0);
-}
-fatal(s) char *s;
-{
-       fprintf(stderr,"%s\n",s);
-       VOID fflush(stdout);
-       sleep(2);
-       abort();
-}
-xfree(c) MINT *c;
-{
-#ifdef DBG
-       if(dbg) fprintf(stderr, "xfree ");
-#endif
-       if(c->len==0) return;
-       shfree(c->val);
-       c->len=0;
-       return;
-}
-mcan(a) MINT *a;
-{      int i,j;
-       if((i=a->len)==0) return;
-       else if(i<0) i= -i;
-       for(j=i;j>0 && a->val[j-1]==0;j--);
-       if(j==i) return;
-       if(j==0)
-       {       xfree(a);
-               return;
-       }
-       if(a->len > 0) a->len=j;
-       else a->len = -j;
-}
-MINT *itom(n)
-{      MINT *a;
-       a=(MINT *)xalloc(2,"itom");
-       if(n>0)
-       {       a->len=1;
-               a->val=xalloc(1,"itom1");
-               *a->val=n;
-               return(a);
-       }
-       else if(n<0)
-       {       a->len = -1;
-               a->val=xalloc(1,"itom2");
-               *a->val= -n;
-               return(a);
-       }
-       else
-       {       a->len=0;
-               return(a);
-       }
-}
-mcmp(a,b) MINT *a,*b;
-{      MINT c;
-       int res;
-       if(a->len!=b->len) return(a->len-b->len);
-       c.len=0;
-       msub(a,b,&c);
-       res=c.len;
-       xfree(&c);
-       return(res);
-}
diff --git a/.ref-Research-V7/usr/src/libplot/con.h b/.ref-Research-V7/usr/src/libplot/con.h
deleted file mode 100644 (file)
index c9500f2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-/* gsi plotting output routines */
-# define DOWN 012
-# define UP 013
-# define LEFT 010
-# define RIGHT 040
-# define BEL 007
-# define ESC 033
-# define ACK 006
-#define PLOTIN 063
-#define PLOTOUT 064
-# define CR 015
-# define FF 014
-# define VERTRESP 48
-# define HORZRESP 60.
-# define VERTRES 8.
-# define HORZRES 6.
-/* down is line feed, up is reverse line feed,
-   left is backspace, right is space.  48 points per inch
-   vertically, 60 horizontally */
-
-extern int xnow, ynow;
-extern int ITTY[3], PTTY[3], OUTF;
-extern float HEIGHT, WIDTH, OFFSET;
-extern int xscale, xoffset, yscale;
-extern float botx, boty, obotx, oboty, scalex,scaley;
-
diff --git a/.ref-Research-V7/usr/src/libplot/makefile b/.ref-Research-V7/usr/src/libplot/makefile
deleted file mode 100644 (file)
index 096c13b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-all:   libplot.a libt4014.a libt300.a libt300s.a libt450.a
-
-cp:    all
-       cp lib*.a /lib
-libplot.a:     plot.c.a
-       ar x plot.c.a
-       cc -c -O *.c
-       ar rc libplot.a *.o
-       rm *.c *.o
-libt4014.a:    t4014.c.a
-       ar x t4014.c.a
-       cc -c -O *.c
-       ar rc libt4014.a *.o
-       rm *.c *.o
-libt300.a:     t300.c.a
-       ar x t300.c.a
-       cc -c -O *.c
-       ar rc libt300.a *.o
-       rm *.c *.o
-libt300s.a:    t300s.c.a
-       ar x t300s.c.a
-       cc -c -O *.c
-       ar rc libt300s.a *.o
-       rm *.c *.o
-libt450.a:     t450.c.a
-       ar x t450.c.a
-       cc -c -O *.c
-       ar rc libt450.a *.o
-       rm *.c *.o
diff --git a/.ref-Research-V7/usr/sys/40/README b/.ref-Research-V7/usr/sys/40/README
deleted file mode 100644 (file)
index 30043ec..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-The m40.s here is purported to support 7th edition Unix
-on the 11/40, 11/60, and 11/23.  It has, in fact,
-worked on the latter machine.
-The param.h is included because various sizes have to
-be cut down considerably; this is a guide.
-(Things will be tight!  You might consider removing some system calls
-you don't care about, like accounting.)
-Also, it is necessary to remove the
-       .data
-from line 3 of the l.s file, because the interrupt
-vectors and such should go in I space.
-
-Support is included for FP11-style floating point
-but I can't vouch for it.
diff --git a/.ref-Research-V7/usr/sys/40/m40.s b/.ref-Research-V7/usr/sys/40/m40.s
deleted file mode 100644 (file)
index 311509a..0000000
+++ /dev/null
@@ -1,1011 +0,0 @@
-/ machine language assist
-/ for 11/40
-
-
-/ non-UNIX instructions
-mfpi   = 6500^tst
-mtpi   = 6600^tst
-halt   = 0
-wait   = 1
-reset  = 5
-rtt    = 6
-
-.globl start, _end, _edata, _main, dump
-dump:
-start:
-       mov     $trap,34
-
-/ Set location 0 and 2 to catch traps and jumps to 0
-
-       mov     $42,0           / illegal instruction if jump
-       mov     $777,2          / trace trap at high priority if trap
-
-/ initialize systems segments
-
-       mov     $KISA0,r0
-       mov     $KISD0,r1
-       mov     $200,r4
-       clr     r2
-       mov     $6,r3
-1:
-       mov     r2,(r0)+
-       mov     $77406,(r1)+            / 4k rw
-       add     r4,r2
-       sob     r3,1b
-
-/ initialize user segment
-
-       mov     $_end+63.,r2
-       ash     $-6,r2
-       bic     $!1777,r2
-       mov     r2,(r0)+                / ksr6 = sysu
-       mov     $usize-1\<8|6,(r1)+
-
-/ initialize io segment
-/ set up counts on supervisor segments
-
-       mov     $IO,(r0)+
-       mov     $77406,(r1)+            / rw 4k
-
-/ get a sp and start segmentation
-
-       mov     $_u+[usize*64.],sp
-
-       inc     SSR0
-/ test for floating point
-       mov     $1f,nofault
-       setd                            / jumps to 1f if no fpu
-       inc     fpp
-1:
-       clr     nofault
-
-/ clear bss
-
-       mov     $_edata,r0
-1:
-       clr     (r0)+
-       cmp     r0,$_end
-       blo     1b
-
-/ clear user block
-
-       mov     $_u,r0
-1:
-       clr     (r0)+
-       cmp     r0,$_u+[usize*64.]
-       blo     1b
-
-/ set up previous mode and call main
-/ on return, enter user mode at 0R
-
-       mov     $30000,PS
-       jsr     pc,_main
-       mov     $170000,-(sp)
-       clr     -(sp)
-       rtt
-
-.globl trap, call
-.globl _trap
-
-/ all traps and interrupts are
-/ vectored thru this routine.
-
-trap:
-       mov     PS,saveps
-       tst     nofault
-       bne     1f
-       mov     SSR0,ssr
-       mov     SSR2,ssr+4
-       mov     $1,SSR0
-       jsr     r0,call1; jmp _trap
-       / no return
-1:
-       mov     $1,SSR0
-       mov     nofault,(sp)
-       rtt
-.text
-
-.globl _runrun
-call1:
-       mov     saveps,-(sp)
-       bic     $HIPRI,PS
-       br      1f
-
-call:
-       mov     PS,-(sp)
-1:
-       mov     r1,-(sp)
-       mfpi    sp
-       mov     4(sp),-(sp)
-       bic     $!37,(sp)
-       bit     $30000,PS
-       beq     1f
-       jsr     pc,(r0)+
-       tstb    _runrun
-       beq     2f
-       mov     $12.,(sp)               / trap 12 is give up cpu
-       jsr     pc,_trap
-2:
-       tst     (sp)+
-       mtpi    sp
-       br      2f
-1:
-       bis     $30000,PS
-       jsr     pc,(r0)+
-       cmp     (sp)+,(sp)+
-2:
-       mov     (sp)+,r1
-       tst     (sp)+
-       mov     (sp)+,r0
-       rtt
-.globl _savfp
-_savfp:
-       tst     fpp
-       beq     8f
-       mov     2(sp),r1
-       stfps   (r1)+
-       setd
-       movf    fr0,(r1)+
-       movf    fr1,(r1)+
-       movf    fr2,(r1)+
-       movf    fr3,(r1)+
-       movf    fr4,fr0
-       movf    fr0,(r1)+
-       movf    fr5,fr0
-       movf    fr0,(r1)+
-8:
-       rts     pc
-
-.globl _restfp
-_restfp:
-       tst     fpp
-       beq     8f
-       mov     2(sp),r1
-       mov     r1,r0
-       setd
-       add     $8.+2.,r1
-       movf    (r1)+,fr1
-       movf    (r1)+,fr2
-       movf    (r1)+,fr3
-       movf    (r1)+,fr0
-       movf    fr0,fr4
-       movf    (r1)+,fr0
-       movf    fr0,fr5
-       movf    2(r0),fr0
-       ldfps   (r0)
-8:
-       rts     pc
-
-.globl _addupc
-_addupc:
-       mov     r2,-(sp)
-       mov     6(sp),r2                / base of prof with base,leng,off,scale
-       mov     4(sp),r0                / pc
-       sub     4(r2),r0                / offset
-       clc
-       ror     r0
-       mov     6(r2),r1
-       clc
-       ror     r1
-       mul     r1,r0           / scale
-       ashc    $-14.,r0
-       inc     r1
-       bic     $1,r1
-       cmp     r1,2(r2)                / length
-       bhis    1f
-       add     (r2),r1         / base
-       mov     nofault,-(sp)
-       mov     $2f,nofault
-       mfpi    (r1)
-       add     12.(sp),(sp)
-       mtpi    (r1)
-       br      3f
-2:
-       clr     6(r2)
-3:
-       mov     (sp)+,nofault
-1:
-       mov     (sp)+,r2
-       rts     pc
-
-.globl _display
-_display:
-       rts     pc
-
-/ Character list get/put
-
-/.globl        _getc, _putc
-/.globl        _cfreelist
-/
-/_getc:
-/      mov     2(sp),r1
-/      mov     PS,-(sp)
-/      mov     r2,-(sp)
-/      bis     $HIPRI,PS
-/      bic     $40,PS
-/      mov     2(r1),r2                / first ptr
-/      beq     9f              / empty
-/      movb    (r2)+,r0                / character
-/      bic     $!377,r0
-/      mov     r2,2(r1)
-/      dec     (r1)+           / count
-/      bne     1f
-/      clr     (r1)+
-/      clr     (r1)+           / last block
-/      br      2f
-/1:
-/      bit     $7,r2
-/      bne     3f
-/      mov     -10(r2),(r1)            / next block
-/      add     $2,(r1)
-/2:
-/      dec     r2
-/      bic     $7,r2
-/      mov     _cfreelist,(r2)
-/      mov     r2,_cfreelist
-/3:
-/      mov     (sp)+,r2
-/      mov     (sp)+,PS
-/      rts     pc
-/9:
-/      clr     4(r1)
-/      mov     $-1,r0
-/      mov     (sp)+,r2
-/      mov     (sp)+,PS
-/      rts     pc
-/
-/_putc:
-/      mov     2(sp),r0
-/      mov     4(sp),r1
-/      mov     PS,-(sp)
-/      mov     r2,-(sp)
-/      mov     r3,-(sp)
-/      bis     $HIPRI,PS
-/      bic     $40,PS
-/      mov     4(r1),r2                / last ptr
-/      bne     1f
-/      mov     _cfreelist,r2
-/      beq     9f
-/      mov     (r2),_cfreelist
-/      clr     (r2)+
-/      mov     r2,2(r1)                / first ptr
-/      br      2f
-/1:
-/      bit     $7,r2
-/      bne     2f
-/      mov     _cfreelist,r3
-/      beq     9f
-/      mov     (r3),_cfreelist
-/      mov     r3,-10(r2)
-/      mov     r3,r2
-/      clr     (r2)+
-/2:
-/      movb    r0,(r2)+
-/      mov     r2,4(r1)
-/      inc     (r1)            / count
-/      clr     r0
-/      mov     (sp)+,r3
-/      mov     (sp)+,r2
-/      mov     (sp)+,PS
-/      rts     pc
-/9:
-/      mov     pc,r0
-/      mov     (sp)+,r3
-/      mov     (sp)+,r2
-/      mov     (sp)+,PS
-/      rts     pc
-
-.globl _backup
-.globl _regloc
-_backup:
-       mov     2(sp),ssr+2
-       mov     r2,-(sp)
-       jsr     pc,backup
-       mov     r2,ssr+2
-       mov     (sp)+,r2
-       movb    jflg,r0
-       bne     2f
-       mov     2(sp),r0
-       movb    ssr+2,r1
-       jsr     pc,1f
-       movb    ssr+3,r1
-       jsr     pc,1f
-       movb    _regloc+7,r1
-       asl     r1
-       add     r0,r1
-       mov     ssr+4,(r1)
-       clr     r0
-2:
-       rts     pc
-1:
-       mov     r1,-(sp)
-       asr     (sp)
-       asr     (sp)
-       asr     (sp)
-       bic     $!7,r1
-       movb    _regloc(r1),r1
-       asl     r1
-       add     r0,r1
-       sub     (sp)+,(r1)
-       rts     pc
-
-/ hard part
-/ simulate the ssr2 register missing on 11/40
-
-backup:
-       clr     r2              / backup register ssr1
-       mov     $1,bflg         / clrs jflg
-       mov     ssr+4,r0
-       jsr     pc,fetch
-       mov     r0,r1
-       ash     $-11.,r0
-       bic     $!36,r0
-       jmp     *0f(r0)
-0:             t00; t01; t02; t03; t04; t05; t06; t07
-               t10; t11; t12; t13; t14; t15; t16; t17
-
-t00:
-       clrb    bflg
-
-t10:
-       mov     r1,r0
-       swab    r0
-       bic     $!16,r0
-       jmp     *0f(r0)
-0:             u0; u1; u2; u3; u4; u5; u6; u7
-
-u6:    / single op, m[tf]pi, sxt, illegal
-       bit     $400,r1
-       beq     u5              / all but m[tf], sxt
-       bit     $200,r1
-       beq     1f              / mfpi
-       bit     $100,r1
-       bne     u5              / sxt
-
-/ simulate mtpi with double (sp)+,dd
-       bic     $4000,r1        / turn instr into (sp)+
-       br      t01
-
-/ simulate mfpi with double ss,-(sp)
-1:
-       ash     $6,r1
-       bis     $46,r1          / -(sp)
-       br      t01
-
-u4:    / jsr
-       mov     r1,r0
-       jsr     pc,setreg       / assume no fault
-       bis     $173000,r2      / -2 from sp
-       rts     pc
-
-t07:   / EIS
-       clrb    bflg
-
-u0:    / jmp, swab
-u5:    / single op
-f5:    / movei, movfi
-ff1:   / ldfps
-ff2:   / stfps
-ff3:   / stst
-       mov     r1,r0
-       br      setreg
-
-t01:   / mov
-t02:   / cmp
-t03:   / bit
-t04:   / bic
-t05:   / bis
-t06:   / add
-t16:   / sub
-       clrb    bflg
-
-t11:   / movb
-t12:   / cmpb
-t13:   / bitb
-t14:   / bicb
-t15:   / bisb
-       mov     r1,r0
-       ash     $-6,r0
-       jsr     pc,setreg
-       swab    r2
-       mov     r1,r0
-       jsr     pc,setreg
-
-/ if delta(dest) is zero,
-/ no need to fetch source
-
-       bit     $370,r2
-       beq     1f
-
-/ if mode(source) is R,
-/ no fault is possible
-
-       bit     $7000,r1
-       beq     1f
-
-/ if reg(source) is reg(dest),
-/ too bad.
-
-       mov     r2,-(sp)
-       bic     $174370,(sp)
-       cmpb    1(sp),(sp)+
-       beq     u7
-
-/ start source cycle
-/ pick up value of reg
-
-       mov     r1,r0
-       ash     $-6,r0
-       bic     $!7,r0
-       movb    _regloc(r0),r0
-       asl     r0
-       add     ssr+2,r0
-       mov     (r0),r0
-
-/ if reg has been incremented,
-/ must decrement it before fetch
-
-       bit     $174000,r2
-       ble     2f
-       dec     r0
-       bit     $10000,r2
-       beq     2f
-       dec     r0
-2:
-
-/ if mode is 6,7 fetch and add X(R) to R
-
-       bit     $4000,r1
-       beq     2f
-       bit     $2000,r1
-       beq     2f
-       mov     r0,-(sp)
-       mov     ssr+4,r0
-       add     $2,r0
-       jsr     pc,fetch
-       add     (sp)+,r0
-2:
-
-/ fetch operand
-/ if mode is 3,5,7 fetch *
-
-       jsr     pc,fetch
-       bit     $1000,r1
-       beq     1f
-       bit     $6000,r1
-       bne     fetch
-1:
-       rts     pc
-
-t17:   / floating point instructions
-       clrb    bflg
-       mov     r1,r0
-       swab    r0
-       bic     $!16,r0
-       jmp     *0f(r0)
-0:             f0; f1; f2; f3; f4; f5; f6; f7
-
-f0:
-       mov     r1,r0
-       ash     $-5,r0
-       bic     $!16,r0
-       jmp     *0f(r0)
-0:             ff0; ff1; ff2; ff3; ff4; ff5; ff6; ff7
-
-f1:    / mulf, modf
-f2:    / addf, movf
-f3:    / subf, cmpf
-f4:    / movf, divf
-ff4:   / clrf
-ff5:   / tstf
-ff6:   / absf
-ff7:   / negf
-       inc     fflg
-       mov     r1,r0
-       br      setreg
-
-f6:
-       bit     $400,r1
-       beq     f1      / movfo
-       br      f5      / movie
-
-f7:
-       bit     $400,r1
-       beq     f5      / movif
-       br      f1      / movof
-
-ff0:   / cfcc, setf, setd, seti, setl
-u1:    / br
-u2:    / br
-u3:    / br
-u7:    / illegal
-       incb    jflg
-       rts     pc
-
-setreg:
-       mov     r0,-(sp)
-       bic     $!7,r0
-       bis     r0,r2
-       mov     (sp)+,r0
-       ash     $-3,r0
-       bic     $!7,r0
-       movb    0f(r0),r0
-       tstb    bflg
-       beq     1f
-       bit     $2,r2
-       beq     2f
-       bit     $4,r2
-       beq     2f
-1:
-       cmp     r0,$20
-       beq     2f
-       cmp     r0,$-20
-       beq     2f
-       asl     r0
-2:
-       tstb    fflg
-       beq     3f
-       asl     r0
-       stfps   r1
-       bit     $200,r1
-       beq     3f
-       asl     r0
-3:
-       bisb    r0,r2
-       rts     pc
-
-0:     .byte   0,0,10,20,-10,-20,0,0
-
-fetch:
-       bic     $1,r0
-       mov     nofault,-(sp)
-       mov     $1f,nofault
-       mfpi    (r0)
-       mov     (sp)+,r0
-       mov     (sp)+,nofault
-       rts     pc
-
-1:
-       mov     (sp)+,nofault
-       clrb    r2                      / clear out dest on fault
-       mov     $-1,r0
-       rts     pc
-
-.bss
-bflg:  .=.+1
-jflg:  .=.+1
-fflg:  .=.+1
-.text
-
-.text
-
-.globl _fubyte, _subyte
-.globl _fuibyte, _suibyte
-.globl _fuword, _suword
-.globl _fuiword, _suiword
-_fuibyte:
-_fubyte:
-       mov     2(sp),r1
-       bic     $1,r1
-       jsr     pc,gword
-       cmp     r1,2(sp)
-       beq     1f
-       swab    r0
-1:
-       bic     $!377,r0
-       rts     pc
-
-_suibyte:
-_subyte:
-       mov     2(sp),r1
-       bic     $1,r1
-       jsr     pc,gword
-       mov     r0,-(sp)
-       cmp     r1,4(sp)
-       beq     1f
-       movb    6(sp),1(sp)
-       br      2f
-1:
-       movb    6(sp),(sp)
-2:
-       mov     (sp)+,r0
-       jsr     pc,pword
-       clr     r0
-       rts     pc
-_fuiword:
-_fuword:
-       mov     2(sp),r1
-fuword:
-       jsr     pc,gword
-       rts     pc
-
-gword:
-       mov     PS,-(sp)
-       bis     $HIPRI,PS
-       mov     nofault,-(sp)
-       mov     $err,nofault
-       mfpi    (r1)
-       mov     (sp)+,r0
-       br      1f
-
-_suiword:
-_suword:
-       mov     2(sp),r1
-       mov     4(sp),r0
-suword:
-       jsr     pc,pword
-       rts     pc
-
-pword:
-       mov     PS,-(sp)
-       bis     $HIPRI,PS
-       mov     nofault,-(sp)
-       mov     $err,nofault
-       mov     r0,-(sp)
-       mtpi    (r1)
-1:
-       mov     (sp)+,nofault
-       mov     (sp)+,PS
-       rts     pc
-
-err:
-       mov     (sp)+,nofault
-       mov     (sp)+,PS
-       tst     (sp)+
-       mov     $-1,r0
-       rts     pc
-       rts     pc
-.globl _copyin, _copyout
-.globl _copyiin, _copyiout
-_copyiin:
-_copyin:
-       jsr     pc,copsu
-1:
-       mfpi    (r0)+
-       mov     (sp)+,(r1)+
-       sob     r2,1b
-       br      2f
-
-_copyiout:
-_copyout:
-       jsr     pc,copsu
-1:
-       mov     (r0)+,-(sp)
-       mtpi    (r1)+
-       sob     r2,1b
-2:
-       mov     (sp)+,nofault
-       mov     (sp)+,r2
-       clr     r0
-       rts     pc
-
-copsu:
-       mov     (sp)+,r0
-       mov     r2,-(sp)
-       mov     nofault,-(sp)
-       mov     r0,-(sp)
-       mov     10(sp),r0
-       mov     12(sp),r1
-       mov     14(sp),r2
-       asr     r2
-       mov     $1f,nofault
-       rts     pc
-
-1:
-       mov     (sp)+,nofault
-       mov     (sp)+,r2
-       mov     $-1,r0
-       rts     pc
-
-.globl _idle, _waitloc
-_idle:
-       mov     PS,-(sp)
-       bic     $HIPRI,PS
-       wait
-waitloc:
-       mov     (sp)+,PS
-       rts     pc
-       .data
-_waitloc:
-       waitloc
-       .text
-
-.globl _save
-_save:
-       mov     (sp)+,r1
-       mov     (sp),r0
-       mov     r2,(r0)+
-       mov     r3,(r0)+
-       mov     r4,(r0)+
-       mov     r5,(r0)+
-       mov     sp,(r0)+
-       mov     r1,(r0)+
-       clr     r0
-       jmp     (r1)
-
-.globl _resume
-_resume:
-       mov     2(sp),r0                / new process
-       mov     4(sp),r1                / new stack
-       bis     $HIPRI,PS
-       mov     r0,KISA6                / In new process
-       mov     (r1)+,r2
-       mov     (r1)+,r3
-       mov     (r1)+,r4
-       mov     (r1)+,r5
-       mov     (r1)+,sp
-       mov     $1,r0
-       bic     $HIPRI,PS
-       jmp     *(r1)+
-
-.globl _spl0, _spl1, _spl4, _spl5, _spl6, _spl7, _splx
-_spl0:
-       mov     PS,r0
-       bic     $HIPRI,PS
-       rts     pc
-
-_spl1:
-       mov     PS,r0
-       bis     $HIPRI,PS
-       bic     $300,PS
-       rts     pc
-
-_spl4:
-       mov     PS,r0
-       bis     $HIPRI,PS
-       bic     $140,PS
-       rts     pc
-
-_spl5:
-       mov     PS,r0
-       bis     $HIPRI,PS
-       bic     $100,PS
-       rts     pc
-
-_spl6:
-       mov     PS,r0
-       bis     $HIPRI,PS
-       bic     $40,PS
-       rts     pc
-
-_spl7:
-       mov     PS,r0
-       bis     $HIPRI,PS
-       rts     pc
-
-_splx:
-       mov     2(sp),PS
-       rts     pc
-
-.globl _copyseg
-_copyseg:
-       mov     PS,-(sp)
-       mov     UISA0,-(sp)
-       mov     UISA1,-(sp)
-       mov     $30340,PS
-       mov     10(sp),UISA0
-       mov     12(sp),UISA1
-       mov     UISD0,-(sp)
-       mov     UISD1,-(sp)
-       mov     $6,UISD0
-       mov     $6,UISD1
-       mov     r2,-(sp)
-       clr     r0
-       mov     $8192.,r1
-       mov     $32.,r2
-1:
-       mfpi    (r0)+
-       mtpi    (r1)+
-       sob     r2,1b
-       mov     (sp)+,r2
-       mov     (sp)+,UISD1
-       mov     (sp)+,UISD0
-       mov     (sp)+,UISA1
-       mov     (sp)+,UISA0
-       mov     (sp)+,PS
-       rts     pc
-
-.globl _clearseg
-_clearseg:
-       mov     PS,-(sp)
-       mov     UISA0,-(sp)
-       mov     $30340,PS
-       mov     6(sp),UISA0
-       mov     UISD0,-(sp)
-       mov     $6,UISD0
-       clr     r0
-       mov     $32.,r1
-1:
-       clr     -(sp)
-       mtpi    (r0)+
-       sob     r1,1b
-       mov     (sp)+,UISD0
-       mov     (sp)+,UISA0
-       mov     (sp)+,PS
-       rts     pc
-
-.globl _piget, _piput
-_piget:
-       mov     PS,-(sp)
-       jsr     pc,2f
-       mfpi    (r0)
-       mov     (sp)+,r0
-1:
-       mov     (sp)+,PS
-       rts     pc
-
-_piput:
-       mov     PS,-(sp)
-       jsr     pc,2f
-       mov     10(sp),r1
-       mov     r1,-(sp)
-       mtpi    (r0)
-       br      1b
-2:
-       mov     6(sp),r0
-       mov     10(sp),r1
-       ashc    $-6,r0
-       mov     HIPRI,PS
-       mov     r1,KISA7
-       mov     10(sp),r0
-       bic     $!77,r0
-       bis     $160000,r0
-       rts     pc
-
-/ Long quotient
-
-       .globl  ldiv
-ldiv:
-       jsr     r5,csv
-       mov     10.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,8.(r5)
-       bne     hardldiv
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-       com     r4
-1:
-       mov     r4,-(sp)
-       clr     r0
-       div     r3,r0
-       mov     r0,r4           /high quotient
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0           / this is the clever part
-       div     r3,r0
-       tst     r1
-       sxt     r1
-       add     r1,r0           / cannot overflow!
-1:
-       mov     r0,r1
-       mov     r4,r0
-       tst     (sp)+
-       bpl     9f
-       neg     r0
-       neg     r1
-       sbc     r0
-9:
-       jmp     cret
-
-hardldiv:
-       4
-
-/ Long remainder
-
-       .globl  lrem
-lrem:
-       jsr     r5,csv
-       mov     10.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,8.(r5)
-       bne     hardlrem
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       mov     r1,r4
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       div     r3,r0
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0
-       div     r3,r0
-       tst     r1
-       beq     9f
-       add     r3,r1
-1:
-       tst     r4
-       bpl     9f
-       neg     r1
-9:
-       sxt     r0
-       jmp     cret
-
-/ The divisor is known to be >= 2^15.  Only 16 cycles are
-/ needed to get a remainder.
-hardlrem:
-       4
-
-.globl csv
-csv:
-       mov     r5,r0
-       mov     sp,r5
-       mov     r4,-(sp)
-       mov     r3,-(sp)
-       mov     r2,-(sp)
-       jsr     pc,(r0)
-
-.globl cret
-cret:
-       mov     r5,r2
-       mov     -(r2),r4
-       mov     -(r2),r3
-       mov     -(r2),r2
-       mov     r5,sp
-       mov     (sp)+,r5
-       rts     pc
-
-.globl _u
-_u     = 140000
-usize  = 16.
-
-HIPRI  = 340
-
-PS     = 177776
-SSR0   = 177572
-SSR2   = 177576
-KISA0  = 172340
-KISA6  = 172354
-KISA7  = 172356
-KISD0  = 172300
-MTC    = 172522
-TUC    = 172440
-UISA0  = 177640
-UISA1  = 177642
-UISD0  = 177600
-UISD1  = 177602
-IO     = 7600
-
-.data
-.globl _ka6
-.globl _cputype
-
-_ka6:  KISA6
-_cputype:40.
-stk:   0
-
-.bss
-nofault:.=.+2
-ssr:   .=.+6
-saveps: .=.+2
-power: .=.+2
-fpp:   .=.+2
-
-.globl _stst
-.text
-.globl _stst
-stst   = 170300^tst
-_stst:
-       tst     fpp
-       beq     9f
-       stst    r0
-       mov     r0,*2(sp)
-9:
-       rts     pc
diff --git a/.ref-Research-V7/usr/sys/40/param.h b/.ref-Research-V7/usr/sys/40/param.h
deleted file mode 100644 (file)
index 33ed643..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * tunable variables
- */
-
-#define        NBUF    15              /* size of buffer cache */
-#define        NINODE  20              /* number of in core inodes */
-#define        NFILE   20              /* number of in core file structures */
-#define        NMOUNT  2               /* number of mountable file systems */
-#define        MAXMEM  (64*32)         /* max core per process - first # is Kw */
-#define        MAXUPRC 15              /* max processes per user */
-#define        SSIZE   20              /* initial stack size (*64 bytes) */
-#define        SINCR   20              /* increment of stack (*64 bytes) */
-#define        NOFILE  20              /* max open files per process */
-#define        CANBSIZ 256             /* max size of typewriter line */
-#define        CMAPSIZ 20              /* size of core allocation area */
-#define        SMAPSIZ 20              /* size of swap allocation area */
-#define        NCALL   10              /* max simultaneous time callouts */
-#define        NPROC   20              /* max number of processes */
-#define        NTEXT   10              /* max number of pure texts */
-#define        NCLIST  40              /* max total clist size */
-#define        HZ      60              /* Ticks/second of the clock */
-#define        TIMEZONE (5*60)         /* Minutes westward from Greenwich */
-#define        DSTFLAG 1               /* Daylight Saving Time applies in this locality */
-#define        MSGBUFS 128             /* Characters saved from error messages */
-#define        NCARGS  5120            /* # characters in exec arglist */
-
-/*
- * priorities
- * probably should not be
- * altered too much
- */
-
-#define        PSWP    0
-#define        PINOD   10
-#define        PRIBIO  20
-#define        PZERO   25
-#define        NZERO   20
-#define        PPIPE   26
-#define        PWAIT   30
-#define        PSLEP   40
-#define        PUSER   50
-
-/*
- * signals
- * dont change
- */
-
-#define        NSIG    17
-/*
- * No more than 16 signals (1-16) because they are
- * stored in bits in a word.
- */
-#define        SIGHUP  1       /* hangup */
-#define        SIGINT  2       /* interrupt (rubout) */
-#define        SIGQUIT 3       /* quit (FS) */
-#define        SIGINS  4       /* illegal instruction */
-#define        SIGTRC  5       /* trace or breakpoint */
-#define        SIGIOT  6       /* iot */
-#define        SIGEMT  7       /* emt */
-#define        SIGFPT  8       /* floating exception */
-#define        SIGKIL  9       /* kill, uncatchable termination */
-#define        SIGBUS  10      /* bus error */
-#define        SIGSEG  11      /* segmentation violation */
-#define        SIGSYS  12      /* bad system call */
-#define        SIGPIPE 13      /* end of pipe */
-#define        SIGCLK  14      /* alarm clock */
-#define        SIGTRM  15      /* Catchable termination */
-
-/*
- * fundamental constants of the implementation--
- * cannot be changed easily
- */
-
-#define        NBPW    sizeof(int)     /* number of bytes in an integer */
-#define        BSIZE   512             /* size of secondary block (bytes) */
-/* BSLOP can be 0 unless you have a TIU/Spider */
-#define        BSLOP   2               /* In case some device needs bigger buffers */
-#define        NINDIR  (BSIZE/sizeof(daddr_t))
-#define        BMASK   0777            /* BSIZE-1 */
-#define        BSHIFT  9               /* LOG2(BSIZE) */
-#define        NMASK   0177            /* NINDIR-1 */
-#define        NSHIFT  7               /* LOG2(NINDIR) */
-#define        USIZE   16              /* size of user block (*64) */
-#define        UBASE   0140000         /* abs. addr of user block */
-#define        NULL    0
-#define        CMASK   0               /* default mask for file creation */
-#define        NODEV   (dev_t)(-1)
-#define        ROOTINO ((ino_t)2)      /* i number of all roots */
-#define        SUPERB  ((daddr_t)1)    /* block number of the super block */
-#define        DIRSIZ  14              /* max characters per directory */
-#define        NICINOD 100             /* number of superblock inodes */
-#define        NICFREE 50              /* number of superblock free blocks */
-#define        INFSIZE 138             /* size of per-proc info for users */
-#define        CBSIZE  6               /* number of chars in a clist block */
-#define        CROUND  07              /* clist rounding: sizeof(int *) + CBSIZE - 1*/
-
-/*
- * Some macros for units conversion
- */
-/* Core clicks (64 bytes) to segments and vice versa */
-#define        ctos(x) ((x+127)/128)
-#define stoc(x) ((x)*128)
-
-/* Core clicks (64 bytes) to disk blocks */
-#define        ctod(x) ((x+7)>>3)
-
-/* inumber to disk address */
-#define        itod(x) (daddr_t)((((unsigned)x+15)>>3))
-
-/* inumber to disk offset */
-#define        itoo(x) (int)((x+15)&07)
-
-/* clicks to bytes */
-#define        ctob(x) (x<<6)
-
-/* bytes to clicks */
-#define        btoc(x) ((((unsigned)x+63)>>6))
-
-/* major part of a device */
-#define        major(x)        (int)(((unsigned)x>>8))
-
-/* minor part of a device */
-#define        minor(x)        (int)(x&0377)
-
-/* make a device number */
-#define        makedev(x,y)    (dev_t)((x)<<8 | (y))
-
-typedef        struct { int r[1]; } *  physadr;
-typedef        long            daddr_t;
-typedef char *         caddr_t;
-typedef        unsigned int    ino_t;
-typedef        long            time_t;
-typedef        int             label_t[6];     /* regs 2-7 */
-typedef        int             dev_t;
-typedef        long            off_t;
-
-/*
- * Machine-dependent bits and macros
- */
-#define        UMODE   0170000         /* usermode bits */
-#define        USERMODE(ps)    ((ps & UMODE)==UMODE)
-
-#define        INTPRI  0340            /* Priority bits */
-#define        BASEPRI(ps)     ((ps & INTPRI) != 0)
diff --git a/.ref-Research-V7/usr/sys/conf/c.c b/.ref-Research-V7/usr/sys/conf/c.c
deleted file mode 100644 (file)
index 8b82f1f..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-#include "../h/tty.h"
-#include "../h/conf.h"
-#include "../h/proc.h"
-#include "../h/text.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/file.h"
-#include "../h/inode.h"
-#include "../h/acct.h"
-
-int    nulldev();
-int    nodev();
-int    rkstrategy();
-struct buf     rktab;
-int    htopen(), htclose(), htstrategy();
-struct buf     httab;
-struct bdevsw  bdevsw[] =
-{
-       nulldev, nulldev, rkstrategy, &rktab,   /* rk = 0 */
-       nodev, nodev, nodev, 0, /* rp = 1 */
-       nodev, nodev, nodev, 0, /* rf = 2 */
-       nodev, nodev, nodev, 0, /* tm = 3 */
-       nodev, nodev, nodev, 0, /* tc = 4 */
-       nodev, nodev, nodev, 0, /* hs = 5 */
-       nodev, nodev, nodev, 0, /* hp = 6 */
-       htopen, htclose, htstrategy, &httab,    /* ht = 7 */
-       nodev, nodev, nodev, 0, /* rl = 8 */
-       0
-};
-
-int    klopen(), klclose(), klread(), klwrite(), klioctl();
-int    mmread(), mmwrite();
-int    rkread(), rkwrite();
-int    htread(), htwrite();
-int    syopen(), syread(), sywrite(), sysioctl();
-
-struct cdevsw  cdevsw[] =
-{
-       klopen, klclose, klread, klwrite, klioctl, nulldev, 0,  /* console = 0 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* pc = 1 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* lp = 2 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* dc = 3 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* dh = 4 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* dp = 5 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* dj = 6 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* dn = 7 */
-       nulldev, nulldev, mmread, mmwrite, nodev, nulldev, 0,   /* mem = 8 */
-       nulldev, nulldev, rkread, rkwrite, nodev, nulldev, 0,   /* rk = 9 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* rf = 10 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* rp = 11 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* tm = 12 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* hs = 13 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* hp = 14 */
-       htopen, htclose, htread, htwrite, nodev, nulldev, 0,    /* ht = 15 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* du = 16 */
-       syopen, nulldev, syread, sywrite, sysioctl, nulldev, 0, /* tty = 17 */
-       nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* rl = 18 */
-       0
-};
-
-int    ttyopen(), ttyclose(), ttread(), ttwrite(), ttyinput(), ttstart();
-struct linesw  linesw[] =
-{
-       ttyopen, nulldev, ttread, ttwrite, nodev, ttyinput, ttstart, /* 0 */
-       0
-};
-int    rootdev = makedev(0, 0);
-int    swapdev = makedev(0, 0);
-int    pipedev = makedev(0, 0);
-int    nldisp = 1;
-daddr_t        swplo   = 4000;
-int    nswap   = 872;
-       
-struct buf     buf[NBUF];
-struct file    file[NFILE];
-struct inode   inode[NINODE];
-int    mpxchan();
-int    (*ldmpx)() = mpxchan;
-struct proc    proc[NPROC];
-struct text    text[NTEXT];
-struct buf     bfreelist;
-struct acct    acctbuf;
-struct inode   *acctp;
diff --git a/.ref-Research-V7/usr/sys/conf/hphtconf b/.ref-Research-V7/usr/sys/conf/hphtconf
deleted file mode 100644 (file)
index da718e4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-hp
-root hp 0
-swap hp 1
-swplo 0
-nswap 8778
-ht
diff --git a/.ref-Research-V7/usr/sys/conf/hptmconf b/.ref-Research-V7/usr/sys/conf/hptmconf
deleted file mode 100644 (file)
index 2ba13d7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-hp
-root hp 0
-swap hp 1
-swplo 0
-nswap 8778
-tm
diff --git a/.ref-Research-V7/usr/sys/conf/l.s b/.ref-Research-V7/usr/sys/conf/l.s
deleted file mode 100644 (file)
index c555d95..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/ low core
-
-.data
-ZERO:
-
-br4 = 200
-br5 = 240
-br6 = 300
-br7 = 340
-
-. = ZERO+0
-       br      1f
-       4
-
-/ trap vectors
-       trap; br7+0.            / bus error
-       trap; br7+1.            / illegal instruction
-       trap; br7+2.            / bpt-trace trap
-       trap; br7+3.            / iot trap
-       trap; br7+4.            / power fail
-       trap; br7+5.            / emulator trap
-       start;br7+6.            / system  (overlaid by 'trap')
-
-. = ZERO+40
-.globl start, dump
-1:     jmp     start
-       jmp     dump
-
-
-. = ZERO+60
-       klin; br4
-       klou; br4
-
-. = ZERO+100
-       kwlp; br6
-       kwlp; br6
-
-. = ZERO+114
-       trap; br7+7.            / 11/70 parity
-
-. = ZERO+220
-       rkio; br5
-
-. = ZERO+224
-       htio; br5
-
-. = ZERO+240
-       trap; br7+7.            / programmed interrupt
-       trap; br7+8.            / floating point
-       trap; br7+9.            / segmentation violation
-
-//////////////////////////////////////////////////////
-/              interface code to C
-//////////////////////////////////////////////////////
-
-.text
-.globl call, trap
-
-.globl _klrint
-klin:  jsr     r0,call; jmp _klrint
-.globl _klxint
-klou:  jsr     r0,call; jmp _klxint
-
-.globl _clock
-kwlp:  jsr     r0,call; jmp _clock
-
-
-.globl _rkintr
-rkio:  jsr     r0,call; jmp _rkintr
-
-.globl _htintr
-htio:  jsr     r0,call; jmp _htintr
diff --git a/.ref-Research-V7/usr/sys/conf/makefile b/.ref-Research-V7/usr/sys/conf/makefile
deleted file mode 100644 (file)
index 9ea19a0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-unix:  l.o mch.o c.o ../sys/LIB1 ../dev/LIB2
-       ld -o unix -X -i l.o mch.o c.o ../sys/LIB1 ../dev/LIB2
-
-all:
-       cd ../sys; cc -c -O *.c; mklib; rm *.o
-       cd ../dev; cc -c -O *.c; mklib; rm *.o
-
-mch.o: mch0.s mch.s
-       as -o mch.o mch0.s mch.s
-
-allsystems:
-       mkconf <hphtconf
-       make unix
-       mv unix hphtunix
-       mkconf <hptmconf
-       make unix
-       mv unix hptmunix
-       mkconf <rptmconf
-       make unix
-       mv unix rptmunix
-       mkconf <rphtconf
-       make unix
-       mv unix rphtunix
-       mkconf <rktmconf
-       make unix
-       mv unix rktmunix
-       mkconf <rkhtconf
-       make unix
-       mv unix rkhtunix
diff --git a/.ref-Research-V7/usr/sys/conf/mch.s b/.ref-Research-V7/usr/sys/conf/mch.s
deleted file mode 100644 (file)
index 28718b4..0000000
+++ /dev/null
@@ -1,1058 +0,0 @@
-/ machine language assist
-/ for 11/45 or 11/70 CPUs
-
-
-/ non-UNIX instructions
-mfpi   = 6500^tst
-stst   = 170300^tst
-mtpi   = 6600^tst
-mfpd   = 106500^tst
-mtpd   = 106600^tst
-spl    = 230
-ldfps  = 170100^tst
-stfps  = 170200^tst
-wait   = 1
-rtt    = 6
-reset  = 5
-
-.PROFIL        = 0
-HIPRI  = 340
-HIGH   = 7
-       .if     .PROFIL
-HIGH   = 6
-HIPRI  = 300
-       .endif
-
-/ Mag tape dump
-/ save registers in low core and
-/ write all core onto mag tape.
-/ entry is thru 44 abs
-
-.data
-.globl dump
-dump:
-
-/ save regs r0,r1,r2,r3,r4,r5,r6,KIA6
-/ starting at abs location 4
-
-       mov     r0,4
-       mov     $6,r0
-       mov     r1,(r0)+
-       mov     r2,(r0)+
-       mov     r3,(r0)+
-       mov     r4,(r0)+
-       mov     r5,(r0)+
-       mov     sp,(r0)+
-       mov     KDSA6,(r0)+
-
-/ dump all of core (ie to first mt error)
-/ onto mag tape. (9 track or 7 track 'binary')
-
-.if HTDUMP
-       mov     $HTCS1,r0
-       mov     $40,*$HTCS2
-       mov     $2300,*$HTTC
-       clr     *$HTBA
-       mov     $1,(r0)
-1:
-       mov     $-512.,*$HTFC
-       mov     $-256.,*$HTWC
-       movb    $61,(r0)
-2:
-       tstb    (r0)
-       bge     2b
-       bit     $1,(r0)
-       bne     2b
-       bit     $40000,(r0)
-       beq     1b
-       mov     $27,(r0)
-.endif
-HT     = 0172440
-HTCS1  = HT+0
-HTWC   = HT+2
-HTBA   = HT+4
-HTFC   = HT+6
-HTCS2  = HT+10
-HTTC   = HT+32
-
-MTC = 172522
-.if TUDUMP
-       mov     $MTC,r0
-       mov     $60004,(r0)+
-       clr     2(r0)
-1:
-       mov     $-512.,(r0)
-       inc     -(r0)
-2:
-       tstb    (r0)
-       bge     2b
-       tst     (r0)+
-       bge     1b
-       reset
-
-/ end of file and loop
-
-       mov     $60007,-(r0)
-.endif
-       br      .
-
-.text
-.globl start, _end, _edata, _etext, _main
-
-/ 11/45 and 11/70 startup.
-/ entry is thru 0 abs.
-/ since core is shuffled,
-/ this code can be executed but once
-
-start:
-       bit     $1,SSR0
-       beq     1f
-       mov     $trap,34
-       mov     $trap,0
-       mov     $340+15.,2
-       bit     $20,SSR3
-       beq     9f
-       mov     $70.,_cputype
-       mov     $3,*$MSCR
-9:
-       clr     PS
-       br      9f
-1:
-       inc     $-1
-       bne     .
-       reset
-/ Set loc. 0 to trap to system, in case of
-/ hardware glitch
-       mov     $trap,0         / in case of bad trap through 0
-       mov     $340+15.,2      / high pri, trap type 15
-       clr     PS
-
-/ set KI0 to physical 0
-
-       mov     $77406,r3
-       mov     $KISA0,r0
-       mov     $KISD0,r1
-       clr     (r0)+
-       mov     r3,(r1)+
-
-/ set KI1-6 to eventual text resting place
-
-       mov     $_end+63.,r2
-       ash     $-6,r2
-       bic     $!1777,r2
-1:
-       mov     r2,(r0)+
-       mov     r3,(r1)+
-       add     $200,r2
-       cmp     r0,$KISA7
-       blos    1b
-
-/ set KI7 to IO seg for escape
-
-       mov     $IO,-(r0)
-
-/ set KD0-7 to physical
-
-       mov     $KDSA0,r0
-       mov     $KDSD0,r1
-       clr     r2
-1:
-       mov     r2,(r0)+
-       mov     r3,(r1)+
-       add     $200,r2
-       cmp     r0,$KDSA7
-       blos    1b
-
-/ initialization
-/ get a temp (1-word) stack
-/ turn on segmentation
-/ copy text to I space
-/ clear bss in D space
-
-       mov     $stk+2,sp
-       mov     $65,SSR3                / 22-bit, map, K+U sep
-       bit     $20,SSR3
-       beq     1f
-       mov     $70.,_cputype
-       mov     $3,*$MSCR               / Disable UNIBUS traps, non-fatal traps
-1:
-       inc     SSR0
-       mov     $_etext+100,r2
-       mov     $_edata+100,r1
-       add     $_etext-8192.,r1
-1:
-       mov     -(r1),-(sp)
-       mtpi    -(r2)
-       cmp     r1,$_edata
-       bhi     1b
-1:
-       clr     (r1)+
-       cmp     r1,$_end
-       blo     1b
-
-/ use KI escape to set KD7 to IO seg
-/ set KD6 to first available core
-/ If profiling, snag supervisor registers.
-
-       mov     $IO,-(sp)
-       mtpi    *$KDSA7
-9:
-       mov     $_etext-8192.+63.,r2
-       ash     $-6,r2
-       bic     $!1777,r2
-       add     KISA1,r2
-       .if     .PROFIL
-       mov     r2,SISA2
-       mov     r2,_proloc
-       mov     $77406,SISD2
-       add     $200,r2
-       mov     r2,SISA2+2
-       mov     $77406,SISD2+2
-       add     $200,r2
-       .endif
-       mov     r2,KDSA6
-
-/ Turn off write permission on kernel text
-/ Take stuff above data out of address space
-
-       mov     $KISD0,r0
-1:
-       mov     $77402,(r0)+
-       cmp     r0,$KISD7
-       blos    1b
-
-       mov     $_end+63.,r0
-       ash     $-6,r0
-       bic     $!1777,r0
-       mov     $KDSD0,r1
-1:
-       cmp     r0,$200
-       bge     2f
-       dec     r0
-       bge     4f
-       clr     (r1)
-       br      3f
-4:
-       movb    r0,1(r1)
-       br      3f
-2:
-       movb    $177,1(r1)
-3:
-       tst     (r1)+
-       sub     $200,r0
-       cmp     r1,$KDSD5
-       blos    1b
-
-/ set up supervisor D registers
-
-9:
-       mov     $6,SISD0
-       mov     $6,SISD1
-
-/ set up real sp
-/ clear user block
-/ test for floating point hardware
-
-       mov     $_u+[usize*64.],sp
-       mov     $1f,nofault
-       setd                    / jump to 1f if this traps
-       inc     fpp
-1:
-       clr     nofault
-       mov     $_u,r0
-1:
-       clr     (r0)+
-       cmp     r0,sp
-       blo     1b
-       .if     .PROFIL
-       mov     $40000,r0
-       mov     $10000,PS       / prev = super
-1:
-       clr     -(sp)
-       mtpi    (r0)+
-       cmp     r0,$100000
-       blo     1b
-       jsr     pc,_isprof
-       .endif
-
-/ set up previous mode and call main
-/ on return, enter user mode at 0R
-
-       mov     $30000,PS
-       jsr     pc,_main
-       mov     $170000,-(sp)
-       clr     -(sp)
-       rtt
-
-.globl _rkboot, _rpboot
-_rkboot:
-       jmp     *$173000
-
-_rpboot:
-       jmp     *$173006
-
-
-.globl trap, call
-.globl _trap
-
-/ all traps and interrupts are
-/ vectored thru this routine.
-
-trap:
-       mov     PS,saveps
-       tst     nofault
-       bne     1f
-       mov     SSR0,ssr
-       mov     SSR1,ssr+2
-       mov     SSR2,ssr+4
-       mov     $1,SSR0
-       jsr     r0,call1; jmp _trap
-       / no return
-1:
-       mov     $1,SSR0
-       mov     nofault,(sp)
-       rtt
-.text
-
-.globl _runrun
-call1:
-       mov     saveps,-(sp)
-       spl     0
-       br      1f
-
-call:
-       mov     PS,-(sp)
-1:
-       mov     r1,-(sp)
-       mfpd    sp
-       mov     4(sp),-(sp)
-       bic     $!37,(sp)
-       bit     $30000,PS
-       beq     1f
-       jsr     pc,(r0)+
-       tstb    _runrun
-       beq     2f
-       mov     $12.,(sp)               / trap 12 is give up cpu
-       jsr     pc,_trap
-2:
-       tst     (sp)+
-       mtpd    sp
-       br      2f
-1:
-       bis     $30000,PS
-       jsr     pc,(r0)+
-       cmp     (sp)+,(sp)+
-2:
-       mov     (sp)+,r1
-       tst     (sp)+
-       mov     (sp)+,r0
-       rtt
-
-.globl _savfp
-_savfp:
-       tst     fpp
-       beq     9f              / No FP hardware
-       mov     2(sp),r1
-       stfps   (r1)+
-       setd
-       movf    fr0,(r1)+
-       movf    fr1,(r1)+
-       movf    fr2,(r1)+
-       movf    fr3,(r1)+
-       movf    fr4,fr0
-       movf    fr0,(r1)+
-       movf    fr5,fr0
-       movf    fr0,(r1)+
-9:
-       rts     pc
-
-.globl _restfp
-_restfp:
-       tst     fpp
-       beq     9f
-       mov     2(sp),r1
-       mov     r1,r0
-       setd
-       add     $8.+2.,r1
-       movf    (r1)+,fr1
-       movf    (r1)+,fr2
-       movf    (r1)+,fr3
-       movf    (r1)+,fr0
-       movf    fr0,fr4
-       movf    (r1)+,fr0
-       movf    fr0,fr5
-       movf    2(r0),fr0
-       ldfps   (r0)
-9:
-       rts     pc
-
-.globl _stst
-_stst:
-       tst     fpp
-       beq     9f
-       stst    r0
-       mov     r0,*2(sp)
-9:
-       rts     pc
-
-.globl _addupc
-_addupc:
-       mov     r2,-(sp)
-       mov     6(sp),r2        / base of prof with base,leng,off,scale
-       mov     4(sp),r0        / pc
-       sub     4(r2),r0        / offset
-       clc
-       ror     r0
-       mov     6(r2),r1
-       clc
-       ror     r1
-       mul     r1,r0           / scale
-       ashc    $-14.,r0
-       inc     r1
-       bic     $1,r1
-       cmp     r1,2(r2)        / length
-       bhis    1f
-       add     (r2),r1         / base
-       mov     nofault,-(sp)
-       mov     $2f,nofault
-       mfpd    (r1)
-       add     12.(sp),(sp)
-       mtpd    (r1)
-       br      3f
-2:
-       clr     6(r2)
-3:
-       mov     (sp)+,nofault
-1:
-       mov     (sp)+,r2
-       rts     pc
-
-.globl _display
-_display:
-       dec     dispdly
-       bge     2f
-       clr     dispdly
-       mov     PS,-(sp)
-       mov     $HIPRI,PS
-       mov     CSW,r1
-       bit     $1,r1
-       beq     1f
-       bis     $30000,PS
-       dec     r1
-1:
-       jsr     pc,fuword
-       mov     r0,CSW
-       mov     (sp)+,PS
-       cmp     r0,$-1
-       bne     2f
-       mov     $120.,dispdly           / 2 sec delay after CSW fault
-2:
-       rts     pc
-
-.globl _backup
-.globl _regloc
-_backup:
-       mov     2(sp),r0
-       movb    ssr+2,r1
-       jsr     pc,1f
-       movb    ssr+3,r1
-       jsr     pc,1f
-       movb    _regloc+7,r1
-       asl     r1
-       add     r0,r1
-       mov     ssr+4,(r1)
-       clr     r0
-2:
-       rts     pc
-1:
-       mov     r1,-(sp)
-       asr     (sp)
-       asr     (sp)
-       asr     (sp)
-       bic     $!7,r1
-       movb    _regloc(r1),r1
-       asl     r1
-       add     r0,r1
-       sub     (sp)+,(r1)
-       rts     pc
-
-
-.globl _fubyte, _subyte
-.globl _fuword, _suword
-.globl _fuibyte, _suibyte
-.globl _fuiword, _suiword
-_fuibyte:
-       mov     2(sp),r1
-       bic     $1,r1
-       jsr     pc,giword
-       br      2f
-
-_fubyte:
-       mov     2(sp),r1
-       bic     $1,r1
-       jsr     pc,gword
-
-2:
-       cmp     r1,2(sp)
-       beq     1f
-       swab    r0
-1:
-       bic     $!377,r0
-       rts     pc
-
-_suibyte:
-       mov     2(sp),r1
-       bic     $1,r1
-       jsr     pc,giword
-       mov     r0,-(sp)
-       cmp     r1,4(sp)
-       beq     1f
-       movb    6(sp),1(sp)
-       br      2f
-1:
-       movb    6(sp),(sp)
-2:
-       mov     (sp)+,r0
-       jsr     pc,piword
-       clr     r0
-       rts     pc
-
-_subyte:
-       mov     2(sp),r1
-       bic     $1,r1
-       jsr     pc,gword
-       mov     r0,-(sp)
-       cmp     r1,4(sp)
-       beq     1f
-       movb    6(sp),1(sp)
-       br      2f
-1:
-       movb    6(sp),(sp)
-2:
-       mov     (sp)+,r0
-       jsr     pc,pword
-       clr     r0
-       rts     pc
-
-_fuiword:
-       mov     2(sp),r1
-fuiword:
-       jsr     pc,giword
-       rts     pc
-
-_fuword:
-       mov     2(sp),r1
-fuword:
-       jsr     pc,gword
-       rts     pc
-
-giword:
-       mov     PS,-(sp)
-       spl     HIGH
-       mov     nofault,-(sp)
-       mov     $err,nofault
-       mfpi    (r1)
-       mov     (sp)+,r0
-       br      1f
-
-gword:
-       mov     PS,-(sp)
-       spl     HIGH
-       mov     nofault,-(sp)
-       mov     $err,nofault
-       mfpd    (r1)
-       mov     (sp)+,r0
-       br      1f
-
-_suiword:
-       mov     2(sp),r1
-       mov     4(sp),r0
-suiword:
-       jsr     pc,piword
-       rts     pc
-
-_suword:
-       mov     2(sp),r1
-       mov     4(sp),r0
-suword:
-       jsr     pc,pword
-       rts     pc
-
-piword:
-       mov     PS,-(sp)
-       spl     HIGH
-       mov     nofault,-(sp)
-       mov     $err,nofault
-       mov     r0,-(sp)
-       mtpi    (r1)
-       br      1f
-
-pword:
-       mov     PS,-(sp)
-       spl     HIGH
-       mov     nofault,-(sp)
-       mov     $err,nofault
-       mov     r0,-(sp)
-       mtpd    (r1)
-1:
-       mov     (sp)+,nofault
-       mov     (sp)+,PS
-       rts     pc
-
-err:
-       mov     (sp)+,nofault
-       mov     (sp)+,PS
-       tst     (sp)+
-       mov     $-1,r0
-       rts     pc
-
-.globl _copyin, _copyout
-.globl _copyiin, _copyiout
-_copyiin:
-       jsr     pc,copsu
-1:
-       mfpi    (r0)+
-       mov     (sp)+,(r1)+
-       sob     r2,1b
-       br      2f
-
-_copyin:
-       jsr     pc,copsu
-1:
-       mfpd    (r0)+
-       mov     (sp)+,(r1)+
-       sob     r2,1b
-       br      2f
-
-_copyiout:
-       jsr     pc,copsu
-1:
-       mov     (r0)+,-(sp)
-       mtpi    (r1)+
-       sob     r2,1b
-       br      2f
-
-_copyout:
-       jsr     pc,copsu
-1:
-       mov     (r0)+,-(sp)
-       mtpd    (r1)+
-       sob     r2,1b
-2:
-       mov     (sp)+,nofault
-       mov     (sp)+,r2
-       clr     r0
-       rts     pc
-
-copsu:
-       mov     (sp)+,r0
-       mov     r2,-(sp)
-       mov     nofault,-(sp)
-       mov     r0,-(sp)
-       mov     10(sp),r0
-       mov     12(sp),r1
-       mov     14(sp),r2
-       asr     r2
-       mov     $1f,nofault
-       rts     pc
-
-1:
-       mov     (sp)+,nofault
-       mov     (sp)+,r2
-       mov     $-1,r0
-       rts     pc
-
-.globl _idle, _waitloc
-_idle:
-       mov     PS,-(sp)
-       spl     0
-       wait
-waitloc:
-       mov     (sp)+,PS
-       rts     pc
-
-       .data
-_waitloc:
-       waitloc
-       .text
-
-.globl _save
-_save:
-       mov     (sp)+,r1
-       mov     (sp),r0
-       mov     r2,(r0)+
-       mov     r3,(r0)+
-       mov     r4,(r0)+
-       mov     r5,(r0)+
-       mov     sp,(r0)+
-       mov     r1,(r0)+
-       clr     r0
-       jmp     (r1)
-
-       .globl  _resume
-_resume:
-       mov     2(sp),r0                / new process
-       mov     4(sp),r1                / new stack
-       spl     7
-       mov     r0,KDSA6                / In new process
-       mov     (r1)+,r2
-       mov     (r1)+,r3
-       mov     (r1)+,r4
-       mov     (r1)+,r5
-       mov     (r1)+,sp
-       mov     $1,r0
-       spl     0
-       jmp     *(r1)+
-
-.globl _spl0, _spl1, _spl4, _spl5, _spl6, _spl7, _splx
-_spl0:
-       mov     PS,r0
-       spl     0
-       rts     pc
-
-_spl1:
-       mov     PS,r0
-       spl     1
-       rts     pc
-
-_spl4:
-       mov     PS,r0
-       spl     4
-       rts     pc
-
-_spl5:
-       mov     PS,r0
-       spl     5
-       rts     pc
-
-_spl6:
-       mov     PS,r0
-       spl     6
-       rts     pc
-
-_spl7:
-       mov     PS,r0
-       spl     HIGH
-       rts     pc
-
-_splx:
-       mov     2(sp),PS
-       rts     pc
-
-.globl _copyseg
-_copyseg:
-       mov     PS,-(sp)
-       mov     4(sp),SISA0
-       mov     6(sp),SISA1
-       mov     $10000+HIPRI,PS
-       mov     r2,-(sp)
-       clr     r0
-       mov     $8192.,r1
-       mov     $32.,r2
-1:
-       mfpd    (r0)+
-       mtpd    (r1)+
-       sob     r2,1b
-       mov     (sp)+,r2
-       mov     (sp)+,PS
-       rts     pc
-
-.globl _clearseg
-_clearseg:
-       mov     PS,-(sp)
-       mov     4(sp),SISA0
-       mov     $10000+HIPRI,PS
-       clr     r0
-       mov     $32.,r1
-1:
-       clr     -(sp)
-       mtpd    (r0)+
-       sob     r1,1b
-       mov     (sp)+,PS
-       rts     pc
-
-/ Long quotient
-
-       .globl  ldiv
-ldiv:
-       jsr     r5,csv
-       mov     10.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,8.(r5)
-       bne     hardldiv
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-       com     r4
-1:
-       mov     r4,-(sp)
-       clr     r0
-       div     r3,r0
-       mov     r0,r4           /high quotient
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0           / this is the clever part
-       div     r3,r0
-       tst     r1
-       sxt     r1
-       add     r1,r0           / cannot overflow!
-1:
-       mov     r0,r1
-       mov     r4,r0
-       tst     (sp)+
-       bpl     9f
-       neg     r0
-       neg     r1
-       sbc     r0
-9:
-       jmp     cret
-
-hardldiv:
-       4
-
-/ Long remainder
-
-       .globl  lrem
-lrem:
-       jsr     r5,csv
-       mov     10.(r5),r3
-       sxt     r4
-       bpl     1f
-       neg     r3
-1:
-       cmp     r4,8.(r5)
-       bne     hardlrem
-       mov     6.(r5),r2
-       mov     4.(r5),r1
-       mov     r1,r4
-       bge     1f
-       neg     r1
-       neg     r2
-       sbc     r1
-1:
-       clr     r0
-       div     r3,r0
-       mov     r1,r0
-       mov     r2,r1
-       div     r3,r0
-       bvc     1f
-       sub     r3,r0
-       div     r3,r0
-       tst     r1
-       beq     9f
-       add     r3,r1
-1:
-       tst     r4
-       bpl     9f
-       neg     r1
-9:
-       sxt     r0
-       jmp     cret
-
-/ The divisor is known to be >= 2^15.  Only 16 cycles are
-/ needed to get a remainder.
-hardlrem:
-       4
-
-/.globl        lmul
-/lmul:
-/      mov     r2,-(sp)
-/      mov     r3,-(sp)
-/      mov     8(sp),r2
-/      sxt     r1
-/      sub     6(sp),r1
-/      mov     12.(sp),r0
-/      sxt     r3
-/      sub     10.(sp),r3
-/      mul     r0,r1
-/      mul     r2,r3
-/      add     r1,r3
-/      mul     r2,r0
-/      sub     r3,r0
-/      mov     (sp)+,r3
-/      mov     (sp)+,r2
-/      rts     pc
-
-.globl csv
-csv:
-       mov     r5,r0
-       mov     sp,r5
-       mov     r4,-(sp)
-       mov     r3,-(sp)
-       mov     r2,-(sp)
-       jsr     pc,(r0)
-
-.globl cret
-cret:
-       mov     r5,r2
-       mov     -(r2),r4
-       mov     -(r2),r3
-       mov     -(r2),r2
-       mov     r5,sp
-       mov     (sp)+,r5
-       rts     pc
-
-.globl _u
-_u     = 140000
-usize  = 16.
-
-CSW    = 177570
-PS     = 177776
-SSR0   = 177572
-SSR1   = 177574
-SSR2   = 177576
-SSR3   = 172516
-KISA0  = 172340
-KISA1  = 172342
-KISA7  = 172356
-KISD0  = 172300
-KISD7  = 172316
-KDSA0  = 172360
-KDSA6  = 172374
-KDSA7  = 172376
-KDSD0  = 172320
-KDSD5  = 172332
-SISA0  = 172240
-SISA1  = 172242
-SISA2  = 172244
-SISD0  = 172200
-SISD1  = 172202
-SISD2  = 172204
-MSCR   = 017777746     / 11/70 memory control register
-IO     = 177600
-
-SWR    = 177570
-.data
-.globl _ka6
-.globl _cputype
-
-_ka6:  KDSA6
-_cputype:45.
-stk:   0
-
-.bss
-nofault:.=.+2
-fpp:   .=.+2
-ssr:   .=.+6
-dispdly:.=.+2
-saveps:        .=.+2
-
-.text
-/ system profiler
-/  Expects to have a KW11-P in addition to the line-frequency
-/  clock, and it should be set to BR7.
-/  Uses supervisor I space register 2&3 (40000-100000)
-/  to maintain the profile.
-
-       .if     .PROFIL
-CCSB   = 172542
-CCSR   = 172540
-
-.globl _sprof, _xprobuf, _probsiz, _mode
-_probsiz = 37777
-
-_isprof:
-       mov     $1f,nofault
-       mov     $_sprof,104     / interrupt
-       mov     $340,106        / pri
-       mov     $100.,CCSB      / count set = 100
-       mov     $113,CCSR       / count down, 10kHz, repeat
-1:
-       clr     nofault
-       rts     pc
-
-_sprof:
-       mov     r0,-(sp)
-       mov     PS,r0
-       ash     $-10.,r0
-       bic     $!14,r0
-       add     $1,_mode+2(r0)
-       adc     _mode(r0)
-       cmp     r0,$14          / user
-       beq     done
-       mov     2(sp),r0        / pc
-       asr     r0
-       asr     r0
-       bic     $140001,r0
-       cmp     r0,$_probsiz
-       blo     1f
-       inc     _outside
-       br      done
-1:
-       mov     $10340,PS               / prev = super
-       mfpi    40000(r0)
-       inc     (sp)
-       mtpi    40000(r0)
-       bne     done
-       mov     r1,-(sp)
-       mov     $_xprobuf,r1
-2:
-       cmp     (r1)+,r0
-       bne     3f
-       inc     (r1)
-       br      4f
-3:
-       tst     (r1)+
-       bne     2b
-       sub     $4,r1
-       mov     r0,(r1)+
-       mov     $1,(r1)+
-4:
-       mov     (sp)+,r1
-done:
-       mov     (sp)+,r0
-       mov     $113,CCSR
-       rtt
-
-/ count subroutine calls during profiling
-/  of the system.
-
-.globl mcount, _profcnts, _profsize
-
-.bss
-_profcnts:
-       .=.+[6*340.]
-
-.globl countbase
-.data
-countbase:
-       _profcnts
-_profsize:
-       340.
-.text
-
-mcount:
-       mov     (r0),r1
-       bne     1f
-       mov     countbase,r1
-       beq     2f
-       add     $6,countbase
-       cmp     countbase,$_profcnts+[6*340.]
-       blo     3f
-       clr     countbase
-       rts     pc
-3:
-       mov     (sp),(r1)+
-       mov     r1,(r0)
-1:
-       inc     2(r1)
-       bne     2f
-       inc     (r1)
-2:
-       rts     pc
-
-.bss
-_xprobuf:.=.+512.
-_proloc:.=.+2
-_mode: .=.+16.
-_outside: .=.+2
-
-       .endif
diff --git a/.ref-Research-V7/usr/sys/conf/mch0.s b/.ref-Research-V7/usr/sys/conf/mch0.s
deleted file mode 100644 (file)
index 6734653..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-HTDUMP = 1
-TUDUMP = 0
diff --git a/.ref-Research-V7/usr/sys/conf/mkconf.c b/.ref-Research-V7/usr/sys/conf/mkconf.c
deleted file mode 100644 (file)
index 5888b0c..0000000
+++ /dev/null
@@ -1,821 +0,0 @@
-#include <stdio.h>
-
-#define CHAR   01
-#define BLOCK  02
-#define INTR   04
-#define EVEN   010
-#define KL     020
-#define ROOT   040
-#define        SWAP    0100
-#define        PIPE    0200
-
-char   *btab[] =
-{
-       "rk",
-       "rp",
-       "rf",
-       "tm",
-       "tc",
-       "hs",
-       "hp",
-       "ht",
-       "rl",
-       0
-};
-char   *ctab[] =
-{
-       "console",
-       "pc",
-       "lp",
-       "dc",
-       "dh",
-       "dp",
-       "dj",
-       "dn",
-       "mem",
-       "rk",
-       "rf",
-       "rp",
-       "tm",
-       "hs",
-       "hp",
-       "ht",
-       "du",
-       "tty",
-       "rl",
-       0
-};
-struct tab
-{
-       char    *name;
-       int     count;
-       int     address;
-       int     key;
-       char    *codea;
-       char    *codeb;
-       char    *codec;
-       char    *coded;
-       char    *codee;
-       char    *codef;
-       char    *codeg;
-} table[] =
-{
-       "console",
-       -1, 60, CHAR+INTR+KL,
-       "       klin; br4\n     klou; br4\n",
-       ".globl _klrint\nklin:  jsr     r0,call; jmp _klrint\n",
-       ".globl _klxint\nklou:  jsr     r0,call; jmp _klxint\n",
-       "",
-       "       klopen, klclose, klread, klwrite, klioctl, nulldev, 0,",
-       "",
-       "int    klopen(), klclose(), klread(), klwrite(), klioctl();",
-
-       "mem",
-       -1, 300, CHAR,
-       "",
-       "",
-       "",
-       "",
-       "       nulldev, nulldev, mmread, mmwrite, nodev, nulldev, 0, ",
-       "",
-       "int    mmread(), mmwrite();",
-
-       "pc",
-       0, 70, CHAR+INTR,
-       "       pcin; br4\n     pcou; br4\n",
-       ".globl _pcrint\npcin:  jsr     r0,call; jmp _pcrint\n",
-       ".globl _pcpint\npcou:  jsr     r0,call; jmp _pcpint\n",
-       "",
-       "       pcopen, pcclose, pcread, pcwrite, nodev, nulldev, 0, ",
-       "",
-       "int    pcopen(), pcclose(), pcread(), pcwrite();",
-
-       "clock",
-       -2, 100, INTR,
-       "       kwlp; br6\n",
-       ".globl _clock\n",
-       "kwlp:  jsr     r0,call; jmp _clock\n",
-       "",
-       "",
-       "",
-       "",
-
-       "parity",
-       -1, 114, INTR,
-       "       trap; br7+7.            / 11/70 parity\n",
-       "",
-       "",
-       "",
-       "",
-       "",
-       "",
-
-/*
- * 110 unused
- * 114 memory parity
- * 120 XY plotter
- * 124 DR11-B
- * 130 AD01 & RL01
-*/
-
-       "rl",
-       0, 130, BLOCK+CHAR+INTR,
-       "       rlio; br5\n",
-       ".globl _rlintr\n",
-       "rlio:  jsr     r0,call; jmp _rlintr\n",
-       "       nulldev, nulldev, rlstrategy, &rltab,",
-       "       rlopen, rlclose, rlread, rlwrite, nodev, nulldev, 0,",
-       "int    rlstrategy();\nstruct   buf     rltab;",
-       "int    rlopen(), rlclose(), rlread(), rlwrite();",
-
-/*
- * 134 AFC11
- * 140 AA11
- * 144 AA11
- * 150-174 unused
- */
-
-       "lp",
-       0, 200, CHAR+INTR,
-       "       lpou; br4\n",
-       "",
-       ".globl _lpint\nlpou:   jsr     r0,call; jmp _lpint\n",
-       "",
-       "       lpopen, lpclose, nodev, lpwrite, nodev, nulldev, 0,",
-       "",
-       "int    lpopen(), lpclose(), lpwrite();",
-
-       "rf",
-       0, 204, BLOCK+CHAR+INTR,
-       "       rfio; br5\n",
-       ".globl _rfintr\n",
-       "rfio:  jsr     r0,call; jmp _rfintr\n",
-       "       nulldev, nulldev, rfstrategy, &rftab, ",
-       "       nulldev, nulldev, rfread, rfwrite, nodev, nulldev, 0,",
-       "int    rfstrategy();\nstruct   buf     rftab;",
-       "int    rfread(), rfwrite();",
-
-       "hs",
-       0, 204, BLOCK+CHAR+INTR,
-       "       hsio; br5\n",
-       ".globl _hsintr\n",
-       "hsio:  jsr     r0,call; jmp _hsintr\n",
-       "       nulldev, nulldev, hsstrategy, &hstab, ",
-       "       nulldev, nulldev, hsread, hswrite, nodev, nulldev, 0,",
-       "int    hsstrategy();\nstruct   buf     hstab;",
-       "int    hsread(), hswrite();",
-
-/*
- * 210 RC
- */
-
-       "tc",
-       0, 214, BLOCK+INTR,
-       "       tcio; br6\n",
-       ".globl _tcintr\n",
-       "tcio:  jsr     r0,call; jmp _tcintr\n",
-       "       nulldev, tcclose, tcstrategy, &tctab,",
-       "",
-       "int    tcstrategy(), tcclose();\nstruct        buf     tctab;",
-       "",
-
-       "rk",
-       0, 220, BLOCK+CHAR+INTR,
-       "       rkio; br5\n",
-       ".globl _rkintr\n",
-       "rkio:  jsr     r0,call; jmp _rkintr\n",
-       "       nulldev, nulldev, rkstrategy, &rktab,",
-       "       nulldev, nulldev, rkread, rkwrite, nodev, nulldev, 0,",
-       "int    rkstrategy();\nstruct   buf     rktab;",
-       "int    rkread(), rkwrite();",
-
-       "tm",
-       0, 224, BLOCK+CHAR+INTR,
-       "       tmio; br5\n",
-       ".globl _tmintr\n",
-       "tmio:  jsr     r0,call; jmp _tmintr\n",
-       "       tmopen, tmclose, tmstrategy, &tmtab, ",
-       "       tmopen, tmclose, tmread, tmwrite, nodev, nulldev, 0,",
-       "int    tmopen(), tmclose(), tmstrategy();\nstruct      buf     tmtab;",
-       "int    tmread(), tmwrite();",
-
-       "ht",
-       0, 224, BLOCK+CHAR+INTR,
-       "       htio; br5\n",
-       ".globl _htintr\n",
-       "htio:  jsr     r0,call; jmp _htintr\n",
-       "       htopen, htclose, htstrategy, &httab,",
-       "       htopen, htclose, htread, htwrite, nodev, nulldev, 0,",
-       "int    htopen(), htclose(), htstrategy();\nstruct      buf     httab;",
-       "int    htread(), htwrite();",
-
-       "cr",
-       0, 230, CHAR+INTR,
-       "       crin; br6\n",
-       "",
-       ".globl _crint\ncrin:   jsr     r0,call; jmp _crint\n",
-       "",
-       "       cropen, crclose, crread, nodev, nodev, nulldev, 0,",
-       "",
-       "int    cropen(), crclose(), crread();",
-
-/*
- * 234 UDC11
- */
-
-       "rp",
-       0, 254, BLOCK+CHAR+INTR,
-       "       rpio; br5\n",
-       ".globl _rpintr\n",
-       "rpio:  jsr     r0,call; jmp _rpintr\n",
-       "       nulldev, nulldev, rpstrategy, &rptab,",
-       "       nulldev, nulldev, rpread, rpwrite, nodev, nulldev, 0,",
-       "int    rpstrategy();\nstruct   buf     rptab;",
-       "int    rpread(), rpwrite();",
-
-       "hp",
-       0, 254, BLOCK+CHAR+INTR,
-       "       hpio; br5\n",
-       ".globl _hpintr\n",
-       "hpio:  jsr     r0,call; jmp _hpintr\n",
-       "       nulldev, nulldev, hpstrategy, &hptab,",
-       "       nulldev, nulldev, hpread, hpwrite, nodev, nulldev, 0,",
-       "int    hpstrategy();\nstruct   buf     hptab;",
-       "int    hpread(), hpwrite();",
-
-/*
- * 260 TA11
- * 264-274 unused
- */
-
-       "dc",
-       0, 308, CHAR+INTR,
-       "       dcin; br5+%d.\n dcou; br5+%d.\n",
-       ".globl _dcrint\ndcin:  jsr     r0,call; jmp _dcrint\n",
-       ".globl _dcxint\ndcou:  jsr     r0,call; jmp _dcxint\n",
-       "",
-       "       dcopen, dcclose, dcread, dcwrite, dcioctl, nulldev, dc11,",
-       "",
-       "int    dcopen(), dcclose(), dcread(), dcwrite(), dcioctl();\nstruct    tty     dc11[];",
-
-       "kl",
-       0, 308, INTR+KL,
-       "       klin; br4+%d.\n klou; br4+%d.\n",
-       "",
-       "",
-       "",
-       "",
-       "",
-       "",
-
-       "dp",
-       0, 308, CHAR+INTR,
-       "       dpin; br6+%d.\n dpou; br6+%d.\n",
-       ".globl _dprint\ndpin:  jsr     r0,call; jmp _dprint\n",
-       ".globl _dpxint\ndpou:  jsr     r0,call; jmp _dpxint\n",
-       "",
-       "       dpopen, dpclose, dpread, dpwrite, nodev, nulldev, 0,",
-       "",
-       "int    dpopen(), dpclose(), dpread(), dpwrite();",
-
-/*
- * DM11-A
- */
-
-       "dn",
-       0, 304, CHAR+INTR,
-       "       dnou; br5+%d.\n",
-       "",
-       ".globl _dnint\ndnou:   jsr     r0,call; jmp _dnint\n",
-       "",
-       "       dnopen, dnclose, nodev, dnwrite, nodev, nulldev, 0,",
-       "",
-       "int    dnopen(), dnclose(), dnwrite();",
-
-       "dhdm",
-       0, 304, INTR,
-       "       dmin; br4+%d.\n",
-       "",
-       ".globl _dmint\ndmin:   jsr     r0,call; jmp _dmint\n",
-       "",
-       "",
-       "",
-       "",
-
-/*
- * DR11-A+
- * DR11-C+
- * PA611+
- * PA611+
- * DT11+
- * DX11+
- */
-
-       "dl",
-       0, 308, INTR+KL,
-       "       klin; br4+%d.\n klou; br4+%d.\n",
-       "",
-       "",
-       "",
-       "",
-       "",
-       "",
-
-/*
- * DJ11
- */
-
-       "dh",
-       0, 308, CHAR+INTR+EVEN,
-       "       dhin; br5+%d.\n dhou; br5+%d.\n",
-       ".globl _dhrint\ndhin:  jsr     r0,call; jmp _dhrint\n",
-       ".globl _dhxint\ndhou:  jsr     r0,call; jmp _dhxint\n",
-       "",
-       "       dhopen, dhclose, dhread, dhwrite, dhioctl, dhstop, dh11,",
-       "",
-       "int    dhopen(), dhclose(), dhread(), dhwrite(), dhioctl(), dhstop();\nstruct  tty     dh11[];",
-
-/*
- * GT40
- * LPS+
- * DQ11
- * KW11-W
- */
-
-       "du",
-       0, 308, CHAR+INTR,
-       "       duin; br6+%d.\n duou; br6+%d.\n",
-       ".globl _durint\nduin:  jsr     r0,call; jmp _durint\n",
-       ".globl _duxint\nduou:  jsr     r0,call; jmp _duxint\n",
-       "",
-       "       duopen, duclose, duread, duwrite, nodev, nulldev, 0,",
-       "",
-       "int    duopen(), duclose(), duread(), duwrite();",
-
-       "tty",
-       1, 0, CHAR,
-       "",
-       "",
-       "",
-       "",
-       "       syopen, nulldev, syread, sywrite, sysioctl, nulldev, 0,",
-       "",
-       "int    syopen(), syread(), sywrite(), sysioctl();",
-
-       0
-};
-
-char   *stra[] =
-{
-       "/ low core",
-       "",
-       ".data",
-       "ZERO:",
-       "",
-       "br4 = 200",
-       "br5 = 240",
-       "br6 = 300",
-       "br7 = 340",
-       "",
-       ". = ZERO+0",
-       "       br      1f",
-       "       4",
-       "",
-       "/ trap vectors",
-       "       trap; br7+0.            / bus error",
-       "       trap; br7+1.            / illegal instruction",
-       "       trap; br7+2.            / bpt-trace trap",
-       "       trap; br7+3.            / iot trap",
-       "       trap; br7+4.            / power fail",
-       "       trap; br7+5.            / emulator trap",
-       "       start;br7+6.            / system  (overlaid by 'trap')",
-       "",
-       ". = ZERO+40",
-       ".globl start, dump",
-       "1:     jmp     start",
-       "       jmp     dump",
-       "",
-       0,
-};
-
-char   *strb[] =
-{
-       "",
-       ". = ZERO+240",
-       "       trap; br7+7.            / programmed interrupt",
-       "       trap; br7+8.            / floating point",
-       "       trap; br7+9.            / segmentation violation",
-       0
-};
-
-char   *strc[] =
-{
-       "",
-       "/ floating vectors",
-       ". = ZERO+300",
-       0,
-};
-
-char   *strd[] =
-{
-       "",
-       "//////////////////////////////////////////////////////",
-       "/              interface code to C",
-       "//////////////////////////////////////////////////////",
-       "",
-       ".text",
-       ".globl call, trap",
-       0
-};
-
-char   *stre[] =
-{
-       "#include \"../h/param.h\"",
-       "#include \"../h/systm.h\"",
-       "#include \"../h/buf.h\"",
-       "#include \"../h/tty.h\"",
-       "#include \"../h/conf.h\"",
-       "#include \"../h/proc.h\"",
-       "#include \"../h/text.h\"",
-       "#include \"../h/dir.h\"",
-       "#include \"../h/user.h\"",
-       "#include \"../h/file.h\"",
-       "#include \"../h/inode.h\"",
-       "#include \"../h/acct.h\"",
-       "",
-       "int    nulldev();",
-       "int    nodev();",
-       0
-};
-
-char   *stre1[] =
-{
-       "struct bdevsw  bdevsw[] =",
-       "{",
-       0,
-};
-
-char   *strf[] =
-{
-       "       0",
-       "};",
-       "",
-       0,
-};
-
-char   *strf1[] =
-{
-       "",
-       "struct cdevsw  cdevsw[] =",
-       "{",
-       0,
-};
-
-char   strg[] =
-{
-"      0\n\
-};\n\
-int    rootdev = makedev(%d, %d);\n\
-int    swapdev = makedev(%d, %d);\n\
-int    pipedev = makedev(%d, %d);\n\
-int    nldisp = %d;\n\
-daddr_t        swplo   = %ld;\n\
-int    nswap   = %l;\n\
-"};
-
-char   strg1[] =
-{
-"      \n\
-struct buf     buf[NBUF];\n\
-struct file    file[NFILE];\n\
-struct inode   inode[NINODE];\n"
-};
-
-char   *strg1a[] =
-{
-       "int    mpxchan();",
-       "int    (*ldmpx)() = mpxchan;",
-       0
-};
-
-char   strg2[] =
-{
-"struct        proc    proc[NPROC];\n\
-struct text    text[NTEXT];\n\
-struct buf     bfreelist;\n\
-struct acct    acctbuf;\n\
-struct inode   *acctp;\n"
-};
-
-char   *strh[] =
-{
-       "       0",
-       "};",
-       "",
-       "int    ttyopen(), ttyclose(), ttread(), ttwrite(), ttyinput(), ttstart();",
-       0
-};
-
-char   *stri[] =
-{
-       "int    pkopen(), pkclose(), pkread(), pkwrite(), pkioctl(), pkrint(), pkxint();",
-       0
-};
-
-char   *strj[] =
-{
-       "struct linesw  linesw[] =",
-       "{",
-       "       ttyopen, nulldev, ttread, ttwrite, nodev, ttyinput, ttstart, /* 0 */",
-       0
-};
-
-char   *strk[] =
-{
-       "       pkopen, pkclose, pkread, pkwrite, pkioctl, pkrint, pkxint, /* 1 */",
-       0
-};
-
-int    pack;
-int    mpx;
-int    rootmaj = -1;
-int    rootmin;
-int    swapmaj = -1;
-int    swapmin;
-int    pipemaj = -1;
-int    pipemin;
-long   swplo   = 4000;
-int    nswap = 872;
-int    pack;
-int    nldisp = 1;
-
-main()
-{
-       register struct tab *p;
-       register char *q;
-       int i, n, ev, nkl;
-       int flagf, flagb, dumpht;
-
-       while(input());
-
-/*
- * pass1 -- create interrupt vectors
- */
-       nkl = 0;
-       flagf = flagb = 1;
-       freopen("l.s", "w", stdout);
-       puke(stra);
-       ev = 0;
-       for(p=table; p->name; p++)
-       if(p->count != 0 && p->key & INTR) {
-               if(p->address>240 && flagb) {
-                       flagb = 0;
-                       puke(strb);
-               }
-               if(p->address >= 300) {
-                       if(flagf) {
-                               ev = 0;
-                               flagf = 0;
-                               puke(strc);
-                       }
-                       if(p->key & EVEN && ev & 07) {
-                               printf("        .=.+4\n");
-                               ev += 4;
-                       }
-                       printf("/%s %o\n", p->name, 0300+ev);
-               } else
-                       printf("\n. = ZERO+%d\n", p->address);
-               n = p->count;
-               if(n < 0)
-                       n = -n;
-               for(i=0; i<n; i++) {
-                       if(p->key & KL) {
-                               printf(p->codea, nkl, nkl);
-                               nkl++;
-                       } else
-                               printf(p->codea, i, i);
-                       if (p->address<300)
-                               fprintf(stderr, "%s at %d\n", p->name, p->address+4*i);
-                       else
-                               fprintf(stderr, "%s at %o\n", p->name, 0300+ev);
-                       ev += p->address - 300;
-               }
-       }
-       if(flagb)
-               puke(strb);
-       puke(strd);
-       for(p=table; p->name; p++)
-       if(p->count != 0 && p->key & INTR)
-               printf("\n%s%s", p->codeb, p->codec);
-
-/*
- * pass 2 -- create configuration table
- */
-
-       freopen("c.c", "w", stdout);
-       /*
-        * declarations
-        */
-       puke(stre);
-       for (i=0; q=btab[i]; i++) {
-               for (p=table; p->name; p++)
-               if (equal(q, p->name) &&
-                  (p->key&BLOCK) && p->count && *p->codef)
-                       printf("%s\n", p->codef);
-       }
-       puke(stre1);
-       for(i=0; q=btab[i]; i++) {
-               for(p=table; p->name; p++)
-               if(equal(q, p->name) &&
-                  (p->key&BLOCK) && p->count) {
-                       printf("%s      /* %s = %d */\n", p->coded, q, i);
-                       if(p->key & ROOT)
-                               rootmaj = i;
-                       if (p->key & SWAP)
-                               swapmaj = i;
-                       if (p->key & PIPE)
-                               pipemaj = i;
-                       goto newb;
-               }
-               printf("        nodev, nodev, nodev, 0, /* %s = %d */\n", q, i);
-       newb:;
-       }
-       if (swapmaj == -1) {
-               swapmaj = rootmaj;
-               swapmin = rootmin;
-       }
-       if (pipemaj == -1) {
-               pipemaj = rootmaj;
-               pipemin = rootmin;
-       }
-       puke(strf);
-       for (i=0; q=ctab[i]; i++) {
-               for (p=table; p->name; p++)
-               if (equal(q, p->name) &&
-                  (p->key&CHAR) && p->count && *p->codeg)
-                       printf("%s\n", p->codeg);
-       }
-       puke(strf1);
-       for(i=0; q=ctab[i]; i++) {
-               for(p=table; p->name; p++)
-               if(equal(q, p->name) &&
-                  (p->key&CHAR) && p->count) {
-                       printf("%s      /* %s = %d */\n", p->codee, q, i);
-                       goto newc;
-               }
-               printf("        nodev, nodev, nodev, nodev, nodev, nulldev, 0, /* %s = %d */\n", q, i);
-       newc:;
-       }
-       puke(strh);
-       if (pack) {
-               nldisp++;
-               puke(stri);
-       }
-       puke(strj);
-       if (pack)
-               puke(strk);
-       printf(strg, rootmaj, rootmin,
-               swapmaj, swapmin,
-               pipemaj, pipemin,
-               nldisp,
-               swplo, nswap);
-       printf(strg1);
-       if (!mpx)
-               puke(strg1a);
-       printf(strg2);
-       if(rootmaj < 0)
-               fprintf(stderr, "No root device given\n");
-       freopen("mch0.s", "w", stdout);
-       dumpht = 0;
-       for (i=0; table[i].name; i++) {
-               if (equal(table[i].name, "ht") && table[i].count)
-                       dumpht = 1;
-       }
-       if (dumpht) {
-               printf("HTDUMP = 1\n");
-               printf("TUDUMP = 0\n");
-       } else {
-               printf("HTDUMP = 0\n");
-               printf("TUDUMP = 1\n");
-       }
-}
-
-puke(s, a)
-char **s;
-{
-       char *c;
-
-       while(c = *s++) {
-               printf(c, a);
-               printf("\n");
-       }
-}
-
-input()
-{
-       char line[100];
-       register struct tab *q;
-       int count, n;
-       long num;
-       char keyw[32], dev[32];
-
-       if (fgets(line, 100, stdin) == NULL)
-               return(0);
-       count = -1;
-       n = sscanf(line, "%d%s%s%ld", &count, keyw, dev, &num);
-       if (count == -1 && n>0) {
-               count = 1;
-               n++;
-       }
-       if (n<2)
-               goto badl;
-       for(q=table; q->name; q++)
-       if(equal(q->name, keyw)) {
-               if(q->count < 0) {
-                       fprintf(stderr, "%s: no more, no less\n", keyw);
-                       return(1);
-               }
-               q->count += count;
-               if(q->address < 300 && q->count > 1) {
-                       q->count = 1;
-                       fprintf(stderr, "%s: only one\n", keyw);
-               }
-               return(1);
-       }
-       if (equal(keyw, "nswap")) {
-               if (n<3)
-                       goto badl;
-               if (sscanf(dev, "%ld", &num) <= 0)
-                       goto badl;
-               nswap = num;
-               return(1);
-       }
-       if (equal(keyw, "swplo")) {
-               if (n<3)
-                       goto badl;
-               if (sscanf(dev, "%ld", &num) <= 0)
-                       goto badl;
-               swplo = num;
-               return(1);
-       }
-       if (equal(keyw, "pack")) {
-               pack++;
-               return(1);
-       }
-       if (equal(keyw, "mpx")) {
-               mpx++;
-               return(1);
-       }
-       if(equal(keyw, "done"))
-               return(0);
-       if (equal(keyw, "root")) {
-               if (n<4)
-                       goto badl;
-               for (q=table; q->name; q++) {
-                       if (equal(q->name, dev)) {
-                               q->key |= ROOT;
-                               rootmin = num;
-                               return(1);
-                       }
-               }
-               fprintf(stderr, "Can't find root\n");
-               return(1);
-       }
-       if (equal(keyw, "swap")) {
-               if (n<4)
-                       goto badl;
-               for (q=table; q->name; q++) {
-                       if (equal(q->name, dev)) {
-                               q->key |= SWAP;
-                               swapmin = num;
-                               return(1);
-                       }
-               }
-               fprintf(stderr, "Can't find swap\n");
-               return(1);
-       }
-       if (equal(keyw, "pipe")) {
-               if (n<4)
-                       goto badl;
-               for (q=table; q->name; q++) {
-                       if (equal(q->name, dev)) {
-                               q->key |= PIPE;
-                               pipemin = num;
-                               return(1);
-                       }
-               }
-               fprintf(stderr, "Can't find pipe\n");
-               return(1);
-       }
-       fprintf(stderr, "%s: cannot find\n", keyw);
-       return(1);
-badl:
-       fprintf(stderr, "Bad line: %s", line);
-       return(1);
-}
-
-equal(a, b)
-char *a, *b;
-{
-       return(!strcmp(a, b));
-}
diff --git a/.ref-Research-V7/usr/sys/conf/rkhtconf b/.ref-Research-V7/usr/sys/conf/rkhtconf
deleted file mode 100644 (file)
index 4c6baec..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-rk
-root rk 0
-swap rk 0
-swplo 4000
-nswap 872
-ht
diff --git a/.ref-Research-V7/usr/sys/conf/rktmconf b/.ref-Research-V7/usr/sys/conf/rktmconf
deleted file mode 100644 (file)
index 726ae15..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-rk
-root rk 0
-swap rk 0
-swplo 4000
-nswap 872
-tm
diff --git a/.ref-Research-V7/usr/sys/conf/rp1conf b/.ref-Research-V7/usr/sys/conf/rp1conf
deleted file mode 100644 (file)
index fd99caf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-rp
-dh
-root rp 9
-swap rp 10
-swplo 0
-nswap 2000
-tm
diff --git a/.ref-Research-V7/usr/sys/conf/rphtconf b/.ref-Research-V7/usr/sys/conf/rphtconf
deleted file mode 100644 (file)
index da33dd2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-rp
-root rp 1
-swap rp 2
-swplo 0
-nswap 2000
-ht
diff --git a/.ref-Research-V7/usr/sys/conf/rptmconf b/.ref-Research-V7/usr/sys/conf/rptmconf
deleted file mode 100644 (file)
index 06a8d65..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-rp
-root rp 1
-swap rp 2
-swplo 0
-nswap 2000
-tm
diff --git a/.ref-Research-V7/usr/sys/conf/tconf b/.ref-Research-V7/usr/sys/conf/tconf
deleted file mode 100644 (file)
index 11da3ad..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-hp
-root hp 0
-swap hp 1
-swplo 0
-nswap 8778
-ht
-2dh
-dhdm
-3kl
diff --git a/.ref-Research-V7/usr/sys/dev/bio.c b/.ref-Research-V7/usr/sys/dev/bio.c
deleted file mode 100644 (file)
index 9c9b807..0000000
+++ /dev/null
@@ -1,564 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-#include "../h/proc.h"
-#include "../h/seg.h"
-
-#define        DISKMON 1
-
-#ifdef DISKMON
-struct {
-       int     nbuf;
-       long    nread;
-       long    nreada;
-       long    ncache;
-       long    nwrite;
-       long    bufcount[NBUF];
-} io_info;
-#endif
-
-/*
- * swap IO headers.
- * they are filled in to point
- * at the desired IO operation.
- */
-struct buf     swbuf1;
-struct buf     swbuf2;
-
-/*
- * The following several routines allocate and free
- * buffers with various side effects.  In general the
- * arguments to an allocate routine are a device and
- * a block number, and the value is a pointer to
- * to the buffer header; the buffer is marked "busy"
- * so that no one else can touch it.  If the block was
- * already in core, no I/O need be done; if it is
- * already busy, the process waits until it becomes free.
- * The following routines allocate a buffer:
- *     getblk
- *     bread
- *     breada
- * Eventually the buffer must be released, possibly with the
- * side effect of writing it out, by using one of
- *     bwrite
- *     bdwrite
- *     bawrite
- *     brelse
- */
-
-/*
- * Read in (if necessary) the block and return a buffer pointer.
- */
-struct buf *
-bread(dev, blkno)
-dev_t dev;
-daddr_t blkno;
-{
-       register struct buf *bp;
-
-       bp = getblk(dev, blkno);
-       if (bp->b_flags&B_DONE) {
-#ifdef DISKMON
-               io_info.ncache++;
-#endif
-               return(bp);
-       }
-       bp->b_flags |= B_READ;
-       bp->b_bcount = BSIZE;
-       (*bdevsw[major(dev)].d_strategy)(bp);
-#ifdef DISKMON
-       io_info.nread++;
-#endif
-       iowait(bp);
-       return(bp);
-}
-
-/*
- * Read in the block, like bread, but also start I/O on the
- * read-ahead block (which is not allocated to the caller)
- */
-struct buf *
-breada(dev, blkno, rablkno)
-dev_t dev;
-daddr_t blkno, rablkno;
-{
-       register struct buf *bp, *rabp;
-
-       bp = NULL;
-       if (!incore(dev, blkno)) {
-               bp = getblk(dev, blkno);
-               if ((bp->b_flags&B_DONE) == 0) {
-                       bp->b_flags |= B_READ;
-                       bp->b_bcount = BSIZE;
-                       (*bdevsw[major(dev)].d_strategy)(bp);
-#ifdef DISKMON
-                       io_info.nread++;
-#endif
-               }
-       }
-       if (rablkno && !incore(dev, rablkno)) {
-               rabp = getblk(dev, rablkno);
-               if (rabp->b_flags & B_DONE)
-                       brelse(rabp);
-               else {
-                       rabp->b_flags |= B_READ|B_ASYNC;
-                       rabp->b_bcount = BSIZE;
-                       (*bdevsw[major(dev)].d_strategy)(rabp);
-#ifdef DISKMON
-                       io_info.nreada++;
-#endif
-               }
-       }
-       if(bp == NULL)
-               return(bread(dev, blkno));
-       iowait(bp);
-       return(bp);
-}
-
-/*
- * Write the buffer, waiting for completion.
- * Then release the buffer.
- */
-bwrite(bp)
-register struct buf *bp;
-{
-       register flag;
-
-       flag = bp->b_flags;
-       bp->b_flags &= ~(B_READ | B_DONE | B_ERROR | B_DELWRI | B_AGE);
-       bp->b_bcount = BSIZE;
-#ifdef DISKMON
-       io_info.nwrite++;
-#endif
-       (*bdevsw[major(bp->b_dev)].d_strategy)(bp);
-       if ((flag&B_ASYNC) == 0) {
-               iowait(bp);
-               brelse(bp);
-       } else if (flag & B_DELWRI)
-               bp->b_flags |= B_AGE;
-       else
-               geterror(bp);
-}
-
-/*
- * Release the buffer, marking it so that if it is grabbed
- * for another purpose it will be written out before being
- * given up (e.g. when writing a partial block where it is
- * assumed that another write for the same block will soon follow).
- * This can't be done for magtape, since writes must be done
- * in the same order as requested.
- */
-bdwrite(bp)
-register struct buf *bp;
-{
-       register struct buf *dp;
-
-       dp = bdevsw[major(bp->b_dev)].d_tab;
-       if(dp->b_flags & B_TAPE)
-               bawrite(bp);
-       else {
-               bp->b_flags |= B_DELWRI | B_DONE;
-               brelse(bp);
-       }
-}
-
-/*
- * Release the buffer, start I/O on it, but don't wait for completion.
- */
-bawrite(bp)
-register struct buf *bp;
-{
-
-       bp->b_flags |= B_ASYNC;
-       bwrite(bp);
-}
-
-/*
- * release the buffer, with no I/O implied.
- */
-brelse(bp)
-register struct buf *bp;
-{
-       register struct buf **backp;
-       register s;
-
-       if (bp->b_flags&B_WANTED)
-               wakeup((caddr_t)bp);
-       if (bfreelist.b_flags&B_WANTED) {
-               bfreelist.b_flags &= ~B_WANTED;
-               wakeup((caddr_t)&bfreelist);
-       }
-       if (bp->b_flags&B_ERROR)
-               bp->b_dev = NODEV;  /* no assoc. on error */
-       s = spl6();
-       if(bp->b_flags & B_AGE) {
-               backp = &bfreelist.av_forw;
-               (*backp)->av_back = bp;
-               bp->av_forw = *backp;
-               *backp = bp;
-               bp->av_back = &bfreelist;
-       } else {
-               backp = &bfreelist.av_back;
-               (*backp)->av_forw = bp;
-               bp->av_back = *backp;
-               *backp = bp;
-               bp->av_forw = &bfreelist;
-       }
-       bp->b_flags &= ~(B_WANTED|B_BUSY|B_ASYNC|B_AGE);
-       splx(s);
-}
-
-/*
- * See if the block is associated with some buffer
- * (mainly to avoid getting hung up on a wait in breada)
- */
-incore(dev, blkno)
-dev_t dev;
-daddr_t blkno;
-{
-       register struct buf *bp;
-       register struct buf *dp;
-
-       dp = bdevsw[major(dev)].d_tab;
-       for (bp=dp->b_forw; bp != dp; bp = bp->b_forw)
-               if (bp->b_blkno==blkno && bp->b_dev==dev)
-                       return(1);
-       return(0);
-}
-
-/*
- * Assign a buffer for the given block.  If the appropriate
- * block is already associated, return it; otherwise search
- * for the oldest non-busy buffer and reassign it.
- */
-struct buf *
-getblk(dev, blkno)
-dev_t dev;
-daddr_t blkno;
-{
-       register struct buf *bp;
-       register struct buf *dp;
-#ifdef DISKMON
-       register i;
-#endif
-
-       if(major(dev) >= nblkdev)
-               panic("blkdev");
-
-    loop:
-       spl0();
-       dp = bdevsw[major(dev)].d_tab;
-       if(dp == NULL)
-               panic("devtab");
-       for (bp=dp->b_forw; bp != dp; bp = bp->b_forw) {
-               if (bp->b_blkno!=blkno || bp->b_dev!=dev)
-                       continue;
-               spl6();
-               if (bp->b_flags&B_BUSY) {
-                       bp->b_flags |= B_WANTED;
-                       sleep((caddr_t)bp, PRIBIO+1);
-                       goto loop;
-               }
-               spl0();
-#ifdef DISKMON
-               i = 0;
-               dp = bp->av_forw;
-               while (dp != &bfreelist) {
-                       i++;
-                       dp = dp->av_forw;
-               }
-               if (i<NBUF)
-                       io_info.bufcount[i]++;
-#endif
-               notavail(bp);
-               return(bp);
-       }
-       spl6();
-       if (bfreelist.av_forw == &bfreelist) {
-               bfreelist.b_flags |= B_WANTED;
-               sleep((caddr_t)&bfreelist, PRIBIO+1);
-               goto loop;
-       }
-       spl0();
-       notavail(bp = bfreelist.av_forw);
-       if (bp->b_flags & B_DELWRI) {
-               bp->b_flags |= B_ASYNC;
-               bwrite(bp);
-               goto loop;
-       }
-       bp->b_flags = B_BUSY;
-       bp->b_back->b_forw = bp->b_forw;
-       bp->b_forw->b_back = bp->b_back;
-       bp->b_forw = dp->b_forw;
-       bp->b_back = dp;
-       dp->b_forw->b_back = bp;
-       dp->b_forw = bp;
-       bp->b_dev = dev;
-       bp->b_blkno = blkno;
-       return(bp);
-}
-
-/*
- * get an empty block,
- * not assigned to any particular device
- */
-struct buf *
-geteblk()
-{
-       register struct buf *bp;
-       register struct buf *dp;
-
-loop:
-       spl6();
-       while (bfreelist.av_forw == &bfreelist) {
-               bfreelist.b_flags |= B_WANTED;
-               sleep((caddr_t)&bfreelist, PRIBIO+1);
-       }
-       spl0();
-       dp = &bfreelist;
-       notavail(bp = bfreelist.av_forw);
-       if (bp->b_flags & B_DELWRI) {
-               bp->b_flags |= B_ASYNC;
-               bwrite(bp);
-               goto loop;
-       }
-       bp->b_flags = B_BUSY;
-       bp->b_back->b_forw = bp->b_forw;
-       bp->b_forw->b_back = bp->b_back;
-       bp->b_forw = dp->b_forw;
-       bp->b_back = dp;
-       dp->b_forw->b_back = bp;
-       dp->b_forw = bp;
-       bp->b_dev = (dev_t)NODEV;
-       return(bp);
-}
-
-/*
- * Wait for I/O completion on the buffer; return errors
- * to the user.
- */
-iowait(bp)
-register struct buf *bp;
-{
-
-       spl6();
-       while ((bp->b_flags&B_DONE)==0)
-               sleep((caddr_t)bp, PRIBIO);
-       spl0();
-       geterror(bp);
-}
-
-/*
- * Unlink a buffer from the available list and mark it busy.
- * (internal interface)
- */
-notavail(bp)
-register struct buf *bp;
-{
-       register s;
-
-       s = spl6();
-       bp->av_back->av_forw = bp->av_forw;
-       bp->av_forw->av_back = bp->av_back;
-       bp->b_flags |= B_BUSY;
-       splx(s);
-}
-
-/*
- * Mark I/O complete on a buffer, release it if I/O is asynchronous,
- * and wake up anyone waiting for it.
- */
-iodone(bp)
-register struct buf *bp;
-{
-
-       if(bp->b_flags&B_MAP)
-               mapfree(bp);
-       bp->b_flags |= B_DONE;
-       if (bp->b_flags&B_ASYNC)
-               brelse(bp);
-       else {
-               bp->b_flags &= ~B_WANTED;
-               wakeup((caddr_t)bp);
-       }
-}
-
-/*
- * Zero the core associated with a buffer.
- */
-clrbuf(bp)
-struct buf *bp;
-{
-       register *p;
-       register c;
-
-       p = bp->b_un.b_words;
-       c = BSIZE/sizeof(int);
-       do
-               *p++ = 0;
-       while (--c);
-       bp->b_resid = 0;
-}
-
-/*
- * swap I/O
- */
-swap(blkno, coreaddr, count, rdflg)
-register count;
-{
-       register struct buf *bp;
-       register tcount;
-
-       bp = &swbuf1;
-       if(bp->b_flags & B_BUSY)
-               if((swbuf2.b_flags&B_WANTED) == 0)
-                       bp = &swbuf2;
-       spl6();
-       while (bp->b_flags&B_BUSY) {
-               bp->b_flags |= B_WANTED;
-               sleep((caddr_t)bp, PSWP+1);
-       }
-       while (count) {
-               bp->b_flags = B_BUSY | B_PHYS | rdflg;
-               bp->b_dev = swapdev;
-               tcount = count;
-               if (tcount >= 01700)    /* prevent byte-count wrap */
-                       tcount = 01700;
-               bp->b_bcount = ctob(tcount);
-               bp->b_blkno = swplo+blkno;
-               bp->b_un.b_addr = (caddr_t)(coreaddr<<6);
-               bp->b_xmem = (coreaddr>>10) & 077;
-               (*bdevsw[major(swapdev)].d_strategy)(bp);
-               spl6();
-               while((bp->b_flags&B_DONE)==0)
-                       sleep((caddr_t)bp, PSWP);
-               count -= tcount;
-               coreaddr += tcount;
-               blkno += ctod(tcount);
-       }
-       if (bp->b_flags&B_WANTED)
-               wakeup((caddr_t)bp);
-       spl0();
-       bp->b_flags &= ~(B_BUSY|B_WANTED);
-       if (bp->b_flags & B_ERROR)
-               panic("IO err in swap");
-}
-
-/*
- * make sure all write-behind blocks
- * on dev (or NODEV for all)
- * are flushed out.
- * (from umount and update)
- */
-bflush(dev)
-dev_t dev;
-{
-       register struct buf *bp;
-
-loop:
-       spl6();
-       for (bp = bfreelist.av_forw; bp != &bfreelist; bp = bp->av_forw) {
-               if (bp->b_flags&B_DELWRI && (dev == NODEV||dev==bp->b_dev)) {
-                       bp->b_flags |= B_ASYNC;
-                       notavail(bp);
-                       bwrite(bp);
-                       goto loop;
-               }
-       }
-       spl0();
-}
-
-/*
- * Raw I/O. The arguments are
- *     The strategy routine for the device
- *     A buffer, which will always be a special buffer
- *       header owned exclusively by the device for this purpose
- *     The device number
- *     Read/write flag
- * Essentially all the work is computing physical addresses and
- * validating them.
- */
-physio(strat, bp, dev, rw)
-register struct buf *bp;
-int (*strat)();
-{
-       register unsigned base;
-       register int nb;
-       int ts;
-
-       base = (unsigned)u.u_base;
-       /*
-        * Check odd base, odd count, and address wraparound
-        */
-       if (base&01 || u.u_count&01 || base>=base+u.u_count)
-               goto bad;
-       ts = (u.u_tsize+127) & ~0177;
-       if (u.u_sep)
-               ts = 0;
-       nb = (base>>6) & 01777;
-       /*
-        * Check overlap with text. (ts and nb now
-        * in 64-byte clicks)
-        */
-       if (nb < ts)
-               goto bad;
-       /*
-        * Check that transfer is either entirely in the
-        * data or in the stack: that is, either
-        * the end is in the data or the start is in the stack
-        * (remember wraparound was already checked).
-        */
-       if ((((base+u.u_count)>>6)&01777) >= ts+u.u_dsize
-           && nb < 1024-u.u_ssize)
-               goto bad;
-       spl6();
-       while (bp->b_flags&B_BUSY) {
-               bp->b_flags |= B_WANTED;
-               sleep((caddr_t)bp, PRIBIO+1);
-       }
-       bp->b_flags = B_BUSY | B_PHYS | rw;
-       bp->b_dev = dev;
-       /*
-        * Compute physical address by simulating
-        * the segmentation hardware.
-        */
-       ts = (u.u_sep? UDSA: UISA)->r[nb>>7] + (nb&0177);
-       bp->b_un.b_addr = (caddr_t)((ts<<6) + (base&077));
-       bp->b_xmem = (ts>>10) & 077;
-       bp->b_blkno = u.u_offset >> BSHIFT;
-       bp->b_bcount = u.u_count;
-       bp->b_error = 0;
-       u.u_procp->p_flag |= SLOCK;
-       (*strat)(bp);
-       spl6();
-       while ((bp->b_flags&B_DONE) == 0)
-               sleep((caddr_t)bp, PRIBIO);
-       u.u_procp->p_flag &= ~SLOCK;
-       if (bp->b_flags&B_WANTED)
-               wakeup((caddr_t)bp);
-       spl0();
-       bp->b_flags &= ~(B_BUSY|B_WANTED);
-       u.u_count = bp->b_resid;
-       geterror(bp);
-       return;
-    bad:
-       u.u_error = EFAULT;
-}
-
-/*
- * Pick up the device's error number and pass it to the user;
- * if there is an error but the number is 0 set a generalized
- * code.  Actually the latter is always true because devices
- * don't yet return specific errors.
- */
-geterror(bp)
-register struct buf *bp;
-{
-
-       if (bp->b_flags&B_ERROR)
-               if ((u.u_error = bp->b_error)==0)
-                       u.u_error = EIO;
-}
diff --git a/.ref-Research-V7/usr/sys/dev/cat.c b/.ref-Research-V7/usr/sys/dev/cat.c
deleted file mode 100644 (file)
index 46bd3c1..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#
-/*
- */
-
-/*
- * GP DR11C driver used for C/A/T
- */
-
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-
-#define        CATADDR ((struct catdev *)0167770)
-#define        PCAT    (PZERO+9)
-#define        CATHIWAT        100
-#define        CATLOWAT        30
-
-struct {
-       int     catlock;
-       struct  clist   oq;
-} cat;
-
-struct catdev {
-       int     catcsr;
-       int     catbuf;
-};
-
-ctopen(dev)
-{
-       if (cat.catlock==0) {
-               cat.catlock++;
-               CATADDR->catcsr |= IENABLE;
-       } else
-               u.u_error = ENXIO;
-}
-
-ctclose()
-{
-       cat.catlock = 0;
-       catintr();
-}
-
-ctwrite(dev)
-{
-       register c;
-       extern lbolt;
-
-       while ((c=cpass()) >= 0) {
-               spl5();
-               while (cat.oq.c_cc > CATHIWAT)
-                       sleep((caddr_t)&cat.oq, PCAT);
-               while (putc(c, &cat.oq) < 0)
-                       sleep((caddr_t)&lbolt, PCAT);
-               catintr();
-               spl0();
-       }
-}
-
-catintr()
-{
-       register int c;
-
-       if (CATADDR->catcsr&DONE) {
-               if ((c = getc(&cat.oq)) >= 0) {
-                       CATADDR->catbuf = c;
-                       if (cat.oq.c_cc==0 || cat.oq.c_cc==CATLOWAT)
-                               wakeup((caddr_t)&cat.oq);
-               } else {
-                       if (cat.catlock==0)
-                               CATADDR->catcsr = 0;
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dc.c b/.ref-Research-V7/usr/sys/dev/dc.c
deleted file mode 100644 (file)
index cc43b4a..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-#include "../h/param.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-#include "../h/systm.h"
-
-/*
- * Base address of DC-11's. Minor device  i  is at
- * DCADDR + 10*i.
- */
-#define        DCADDR  (struct device *)0174000
-
-/*
- * Number of DC's for which table space is allocated.
- */
-#define        NDC11   4
-
-/*
- * Control bits in device registers
- */
-#define        CDLEAD  01
-#define        CARRIER 04
-#define        SPEED1  010
-#define        STOP1   0400
-#define        RQSEND  01
-#define        PARITY  040
-#define        ERROR   0100000
-#define        CTRANS  040000
-#define        RINGIND 020000
-
-
-struct tty dc11[NDC11];
-
-struct device {
-       int dcrcsr;
-       int dcrbuf;
-       int dctcsr;
-       int dctbuf;
-};
-
-/*
- * Input-side speed and control bit table.
- * Each DC11 has 4 speeds which correspond to the 4 non-zero entries.
- * The table index is the same as the speed-selector
- * number for the DH11.
- * Attempts to set the speed to a zero entry are ignored.
- */
-int dcrstab[] = {
-       0,              /* 0 baud */
-       0,              /* 50 baud */
-       0,              /* 75 baud */
-       0,              /* 110 baud */
-       01101,          /* 134.5 baud: 7b/ch, speed 0 */
-       0111,           /* 150 baud: 8b/ch, speed 1 */
-       0,              /* 200 baud */
-       0121,           /* 300 baud: 8b/ch, speed 2 */
-       0,              /* 600 baud */
-       0131,           /* 1200 baud */
-       0,              /* 1800 baud */
-       0,              /* 2400 baud */
-       0,              /* 4800 baud */
-       0,              /* 9600 baud */
-       0,              /* X0 */
-       0,              /* X1 */
-};
-
-/*
- * Transmitter speed table
- */
-int dctstab[] = {
-       0,              /* 0 baud */
-       0,              /* 50 baud */
-       0,              /* 75 baud */
-       0,              /* 110 baud */
-       0501,           /* 134.5 baud: stop 1 */
-       0511,           /* 150 baud */
-       0,              /* 200 baud */
-       0521,           /* 300 baud */
-       0,              /* 600 baud */
-       0531,           /* 1200 baud */
-       0,              /* 1800 baud */
-       0,              /* 2400 baud */
-       0,              /* 4800 baud */
-       0,              /* 9600 baud */
-       0,              /* X0 */
-       0,              /* X1 */
-};
-
-/*
- * Open a DC11, waiting until carrier is established.
- * Default initial conditions are set up on the first open.
- * t_state's CARR_ON bit is a pure copy of the hardware
- * CARRIER bit, and is only used to regularize
- * carrier tests in general tty routines.
- */
-dcopen(dev, flag)
-dev_t dev;
-{
-       register struct tty *tp;
-       register struct device *addr;
-       extern int klstart();
-       int s;
-
-       if (minor(dev) >= NDC11) {
-               u.u_error = ENXIO;
-               return;
-       }
-       tp = &dc11[minor(dev)];
-       addr = DCADDR + minor(dev);
-       tp->t_addr = (caddr_t)addr;
-       tp->t_state |= WOPEN;
-       s = spl5();
-       addr->dcrcsr |= IENABLE|CDLEAD;
-       if ((tp->t_state&ISOPEN) == 0) {
-               tp->t_erase = CERASE;
-               tp->t_kill = CKILL;
-               addr->dcrcsr = IENABLE|CDLEAD|SPEED1;
-               addr->dctcsr = IENABLE|SPEED1|STOP1|RQSEND;
-               tp->t_state = ISOPEN | WOPEN;
-               tp->t_flags = ODDP|EVENP|ECHO;
-               tp->t_oproc = klstart;
-       }
-       if (addr->dcrcsr & CARRIER)
-               tp->t_state |= CARR_ON;
-       splx(s);
-       while ((tp->t_state & CARR_ON) == 0)
-               sleep((caddr_t)&tp->t_rawq, TTIPRI);
-       ttyopen(dev, tp);
-}
-
-/*
- * Close a dc11
- */
-dcclose(dev)
-dev_t dev;
-{
-       register struct tty *tp;
-
-       tp = &dc11[minor(dev)];
-       if (tp->t_state&HUPCLS)
-               ((struct device *)(tp->t_addr))->dcrcsr &= ~CDLEAD;
-       ttyclose(tp);
-}
-
-/*
- * Read a DC11
- */
-dcread(dev)
-dev_t dev;
-{
-       ttread(&dc11[minor(dev)]);
-}
-
-/*
- * Write a DC11
- */
-dcwrite(dev)
-dev_t dev;
-{
-       ttwrite(&dc11[minor(dev)]);
-}
-
-/*
- * DC11 transmitter interrupt.
- */
-dcxint(dev)
-dev_t dev;
-{
-       register struct tty *tp;
-
-       tp = &dc11[minor(dev)];
-       ttstart(tp);
-       if (tp->t_outq.c_cc == 0 || tp->t_outq.c_cc == TTLOWAT)
-               wakeup((caddr_t)&tp->t_outq);
-}
-
-/*
- * DC11 receiver interrupt.
- */
-dcrint(dev)
-dev_t dev;
-{
-       register struct tty *tp;
-       register int c, csr;
-
-       tp = &dc11[minor(dev)];
-       c = ((struct device *)(tp->t_addr))->dcrbuf;
-       /*
-        * If carrier is off, and an open is not in progress,
-        * knock down the CD lead to hang up the local dataset
-        * and signal a hangup.
-        */
-       if (((csr = ((struct device *)(tp->t_addr))->dcrcsr) & CARRIER) == 0) {
-               if ((tp->t_state&WOPEN) == 0) {
-                       ((struct device *)(tp->t_addr))->dcrcsr &= ~CDLEAD;
-                       if (tp->t_state & CARR_ON)
-                               signal(tp->t_pgrp, SIGHUP);
-                       flushtty(tp);
-               }
-               tp->t_state &= ~CARR_ON;
-               return;
-       }
-       if (csr&ERROR || (tp->t_state&ISOPEN)==0) {
-               if (tp->t_state&WOPEN && csr&CARRIER)
-                       tp->t_state |= CARR_ON;
-               wakeup((caddr_t)tp);
-               return;
-       }
-       csr &= PARITY;
-       if (csr&&(tp->t_flags&ODDP) || !csr&&(tp->t_flags&EVENP))
-               ttyinput(c, tp);
-}
-
-/*
- * DC11 stty/gtty.
- * Perform general functions and set speeds.
- */
-dcioctl(dev, cmd, addr, flag)
-dev_t dev;
-caddr_t addr;
-{
-       register struct tty *tp;
-       register r;
-
-       tp = &dc11[minor(dev)];
-       if (ttioccom(cmd, &dc11[minor(dev)], addr, dev) == 0) {
-               u.u_error = ENOTTY;
-               return;
-       }
-       if (cmd == TIOCSETP) {
-               r = dcrstab[tp->t_ispeed];
-               if (r)
-                       ((struct device *)(tp->t_addr))->dcrcsr = r;
-               else
-                       ((struct device *)(tp->t_addr))->dcrcsr &= ~CDLEAD;
-               r = dctstab[tp->t_ospeed];
-               ((struct device *)(tp->t_addr))->dctcsr = r;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dh.c b/.ref-Research-V7/usr/sys/dev/dh.c
deleted file mode 100644 (file)
index 4988dc7..0000000
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- *     DH-11 driver
- *     This driver calls on the DHDM driver.
- *     If the DH has no DM11-BB, then the latter will
- *     be fake. To insure loading of the correct DM code,
- *     lib2 should have dhdm.o, dh.o and dhfdm.o in that order.
- */
-
-#include "../h/param.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-
-#define        q3      tp->t_outq
-#define        DHADDR  ((struct device *)0160020)
-#define        NDH11   16      /* number of lines */
-
-struct tty dh11[NDH11];
-char   dhcc[NDH11];
-int    dhchars[(NDH11+15)/16];
-int    ndh11   = NDH11;
-int    dhstart();
-int    ttrstrt();
-
-/*
- * Hardware control bits
- */
-#define        BITS6   01
-#define        BITS7   02
-#define        BITS8   03
-#define        TWOSB   04
-#define        PENABLE 020
-/* DEC manuals incorrectly say this bit causes generation of even parity. */
-#define        OPAR    040
-#define        HDUPLX  040000
-
-#define        IENAB   030100
-#define        PERROR  010000
-#define        FRERROR 020000
-#define        OVERRUN 040000
-#define        XINT    0100000
-#define        SSPEED  7       /* standard speed: 300 baud */
-#define        NSILO   16
-#define        DHTIME  6
-extern int dhtimer();
-
-/*
- * DM control bits
- */
-#define        TURNON  03      /* CD lead + line enable */
-#define        TURNOFF 01      /* line enable */
-#define        RQS     04      /* request to send */
-
-/*
- * Software copy of last dhbar
- */
-int    dhsar[(NDH11+15)/16];
-
-struct device
-{
-       union {
-               int     dhcsr;
-               char    dhcsrl;
-       } un;
-       int     dhnxch;
-       int     dhlpr;
-       char    *dhcar;
-       int     dhbcr;
-       int     dhbar;
-       int     dhbreak;
-       int     dhsilo;
-};
-
-/*
- * Open a DH11 line.
- */
-dhopen(dev, flag)
-{
-       register struct tty *tp;
-       register d;
-       register struct device *addr;
-       static  timer_on;
-       int s;
-
-       d = minor(dev);
-       if (d >= NDH11) {
-               u.u_error = ENXIO;
-               return;
-       }
-       tp = &dh11[d];
-       addr = DHADDR;
-       addr += d>>4;
-       tp->t_addr = (caddr_t)addr;
-       tp->t_oproc = dhstart;
-       tp->t_iproc = NULL;
-       tp->t_state |= WOPEN;
-       s = spl6();
-       if (!timer_on) {
-               timer_on++;
-               timeout(dhtimer, (caddr_t)0, DHTIME);
-       }
-       splx(s);
-       addr->un.dhcsr |= IENAB;
-       if ((tp->t_state&ISOPEN) == 0) {
-               ttychars(tp);
-               tp->t_ispeed = SSPEED;
-               tp->t_ospeed = SSPEED;
-               tp->t_flags = ODDP|EVENP|ECHO;
-               dhparam(d);
-       }
-       if (tp->t_state&XCLUDE && u.u_uid!=0) {
-               u.u_error = EBUSY;
-               return;
-       }
-       dmopen(d);
-       (*linesw[tp->t_line].l_open)(dev,tp);
-}
-
-/*
- * Close a DH11 line.
- */
-dhclose(dev, flag)
-dev_t dev;
-int  flag;
-{
-       register struct tty *tp;
-       register d;
-
-       d = minor(dev);
-       tp = &dh11[d];
-       (*linesw[tp->t_line].l_close)(tp);
-       if (tp->t_state&HUPCLS)
-               dmctl(d, TURNOFF);
-       ttyclose(tp);
-}
-
-/*
- * Read from a DH11 line.
- */
-dhread(dev)
-{
-register struct tty *tp;
-
-       tp = &dh11[minor(dev)];
-       (*linesw[tp->t_line].l_read)(tp);
-}
-
-/*
- * write on a DH11 line
- */
-dhwrite(dev)
-{
-register struct tty *tp;
-
-       tp = &dh11[minor(dev)];
-       (*linesw[tp->t_line].l_write)(tp);
-}
-
-/*
- * DH11 receiver interrupt.
- */
-dhrint(dev)
-{
-       register struct tty *tp;
-       register int c;
-       register struct device *addr;
-
-       addr = DHADDR;
-       addr += minor(dev);
-       while ((c = addr->dhnxch) < 0) {        /* char. present */
-               tp = &dh11[(minor(dev)<<4) + ((c>>8)&017)];
-               dhchars[minor(dev)]++;
-               if (tp >= &dh11[NDH11])
-                       continue;
-               if((tp->t_state&ISOPEN)==0) {
-                       wakeup((caddr_t)tp);
-                       continue;
-               }
-               if (c&PERROR)
-                       if ((tp->t_flags&(EVENP|ODDP))==EVENP
-                        || (tp->t_flags&(EVENP|ODDP))==ODDP )
-                               continue;
-               if (c&FRERROR)          /* break */
-                       if (tp->t_flags&RAW)
-                               c = 0;  /* null (for getty) */
-                       else
-                               c = 0177;       /* DEL (intr) */
-               (*linesw[tp->t_line].l_rint)(c,tp);
-       }
-}
-
-/*
- * stty/gtty for DH11
- */
-dhioctl(dev, cmd, addr, flag)
-caddr_t addr;
-{
-       register struct tty *tp;
-
-       tp = &dh11[minor(dev)];
-       if (ttioccomm(cmd, tp, addr, dev)) {
-               if (cmd==TIOCSETP||cmd==TIOCSETN)
-                       dhparam(dev);
-       } else
-               u.u_error = ENOTTY;
-}
-
-/*
- * Set parameters from open or stty into the DH hardware
- * registers.
- */
-dhparam(dev)
-{
-       register struct tty *tp;
-       register struct device *addr;
-       register d;
-
-       d = minor(dev);
-       tp = &dh11[d];
-       addr = (struct device *)tp->t_addr;
-       spl5();
-       addr->un.dhcsrl = (d&017) | IENAB;
-       /*
-        * Hang up line?
-        */
-       if ((tp->t_ispeed)==0) {
-               tp->t_state |= HUPCLS;
-               dmctl(d, TURNOFF);
-               return;
-       }
-       d = ((tp->t_ospeed)<<10) | ((tp->t_ispeed)<<6);
-       if ((tp->t_ispeed) == 4)                /* 134.5 baud */
-               d |= BITS6|PENABLE|HDUPLX;
-       else if (tp->t_flags&RAW)
-               d |= BITS8;
-       else
-               d |= BITS7|PENABLE;
-       if ((tp->t_flags&EVENP) == 0)
-               d |= OPAR;
-       if ((tp->t_ospeed) == 3)        /* 110 baud */
-               d |= TWOSB;
-       addr->dhlpr = d;
-       spl0();
-}
-
-/*
- * DH11 transmitter interrupt.
- * Restart each line which used to be active but has
- * terminated transmission since the last interrupt.
- */
-dhxint(dev)
-{
-       register struct tty *tp;
-       register struct device *addr;
-       register d;
-       int ttybit, bar, *sbar;
-
-       d = minor(dev);
-       addr = DHADDR + d;
-       addr->un.dhcsr &= ~XINT;
-       sbar = &dhsar[d];
-       bar = *sbar & ~addr->dhbar;
-       d <<= 4; ttybit = 1;
-
-       for(; bar; d++, ttybit <<= 1) {
-               if(bar&ttybit) {
-                       *sbar &= ~ttybit;
-                       bar &= ~ttybit;
-                       tp = &dh11[d];
-                       if (tp->t_line) {
-                               (*linesw[tp->t_line].l_start)(tp);
-                       } else {
-                               addr->un.dhcsrl = (d&017)|IENAB;
-                               if (tp->t_state&FLUSH)
-                                       tp->t_state &= ~FLUSH;
-                               else {
-                                       ndflush(&q3, addr->dhcar-q3.c_cf);
-                               }
-                               tp->t_state &= ~BUSY;
-                               dhstart(tp);
-                       }
-               }
-       }
-}
-
-/*
- * Start (restart) transmission on the given DH11 line.
- */
-dhstart(tp)
-register struct tty *tp;
-{
-       register struct device *addr;
-       register nch;
-       int s, d;
-
-       /*
-        * If it's currently active, or delaying,
-        * no need to do anything.
-        */
-       s = spl5();
-       d = tp-dh11;
-       addr = (struct device *)tp->t_addr;
-       if (tp->t_state&(TIMEOUT|BUSY|TTSTOP))
-               goto out;
-
-
-       /*
-        * If the writer was sleeping on output overflow,
-        * wake him when low tide is reached.
-        */
-       if (tp->t_state&ASLEEP && tp->t_outq.c_cc<=TTLOWAT) {
-               tp->t_state &= ~ASLEEP;
-               if (tp->t_chan)
-                       mcstart(tp->t_chan, (caddr_t)&tp->t_outq); else
-                       wakeup((caddr_t)&tp->t_outq);
-       }
-
-       if (tp->t_outq.c_cc == 0)
-               goto out;
-
-
-
-       /*
-        * Find number of characters to transfer.
-        */
-       if (tp->t_flags & RAW) {
-               nch = ndqb(&tp->t_outq, 0);
-       } else {
-               nch = ndqb(&tp->t_outq, 0200);
-               if (nch == 0) {
-                       nch = getc(&tp->t_outq);
-                       timeout(ttrstrt, (caddr_t)tp, (nch&0177)+6);
-                       tp->t_state |= TIMEOUT;
-                       goto out;
-               }
-       }
-       /*
-        * If any characters were set up, start transmission;
-        */
-       if (nch) {
-               addr->un.dhcsrl = (d&017)|IENAB;
-               addr->dhcar = tp->t_outq.c_cf;
-               addr->dhbcr = -nch;
-               dhcc[d] = nch;
-               nch = 1<<(d&017);
-               addr->dhbar |= nch;
-               dhsar[d>>4] |= nch;
-               tp->t_state |= BUSY;
-       }
-    out:
-       splx(s);
-}
-
-
-/*
- * Stop output on a line.
- */
-dhstop(tp, flag)
-register struct tty *tp;
-{
-       register struct device *addr;
-       register d, s;
-
-       addr = (struct device *)tp->t_addr;
-       s = spl6();
-       if (tp->t_state & BUSY) {
-               d = minor(tp->t_dev);
-               addr->un.dhcsrl = (d&017) | IENAB;
-               if ((tp->t_state&TTSTOP)==0) {
-                       tp->t_state |= FLUSH;
-               }
-               addr->dhbcr = -1;
-       }
-       splx(s);
-}
-
-dhtimer(dev)
-{
-register d,cc;
-register struct device *addr;
-
-       addr = DHADDR; d = 0;
-       do {
-               cc = dhchars[d];
-               dhchars[d] = 0;
-               if (cc > 50)
-                       cc = 32; else
-                       if (cc > 16)
-                               cc = 16; else
-                               cc = 0;
-               addr->dhsilo = cc;
-               addr += 1;
-               dhrint(d++);
-       } while (d < (NDH11+15)/16);
-       timeout(dhtimer, (caddr_t)0, DHTIME);
-}
-
diff --git a/.ref-Research-V7/usr/sys/dev/dhdm.c b/.ref-Research-V7/usr/sys/dev/dhdm.c
deleted file mode 100644 (file)
index 42c84a5..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *     DM-BB driver
- */
-#include "../h/param.h"
-#include "../h/tty.h"
-#include "../h/conf.h"
-
-#define        DMADDR  ((struct device *)0170500)
-
-struct tty dh11[];
-int    ndh11;          /* Set by dh.c to number of lines */
-
-#define        DONE    0200
-#define        SCENABL 040
-#define        CLSCAN  01000
-#define        TURNON  03      /* CD lead, line enable */
-#define        SECX    010     /* secondary xmit */
-#define        RQS     04      /* request to send */
-#define        TURNOFF 1       /* line enable only */
-#define        CARRIER 0100
-#define        CLS     040     /* clear to send */
-#define        SECR    020     /* secondary receive */
-
-struct device
-{
-       int     dmcsr;
-       int     dmlstat;
-       int     junk[2];
-};
-
-#define        B1200   9
-#define        B300    7
-
-/*
- * Turn on the line associated with the (DH) device dev.
- */
-dmopen(dev)
-{
-       register struct tty *tp;
-       register struct device *addr;
-       register d;
-
-       d = minor(dev);
-       tp = &dh11[d];
-       addr = DMADDR;
-       addr += d>>4;
-       spl5();
-       addr->dmcsr = d&017;
-       addr->dmlstat = TURNON;
-       if (addr->dmlstat&CARRIER) {
-               tp->t_state |= CARR_ON;
-       }
-       addr->dmcsr = IENABLE|SCENABL;
-       while ((tp->t_state&CARR_ON)==0)
-               sleep((caddr_t)&tp->t_rawq, TTIPRI);
-       addr->dmcsr = d&017;
-       if (addr->dmlstat&SECR) {
-               tp->t_ispeed = B1200;
-               tp->t_ospeed = B1200;
-               dhparam(dev);
-       }
-       addr->dmcsr = IENABLE|SCENABL;
-       spl0();
-}
-
-/*
- * Dump control bits into the DM registers.
- */
-dmctl(dev, bits)
-{
-       register struct device *addr;
-       register d, s;
-
-       d = minor(dev);
-       addr = DMADDR;
-       addr += d>>4;
-       s = spl5();
-       addr->dmcsr = d&017;
-       addr->dmlstat = bits;
-       addr->dmcsr = IENABLE|SCENABL;
-       splx(s);
-}
-
-/*
- * DM11 interrupt.
- * Mainly, deal with carrier transitions.
- */
-dmint(dev)
-{
-       register struct tty *tp;
-       register struct device *addr;
-       register d;
-
-       d = minor(dev);
-       addr = DMADDR;
-       addr += d;
-       if (addr->dmcsr&DONE) {
-               tp = &dh11[(d<<4)+(addr->dmcsr&017)];
-               if (tp < &dh11[ndh11]) {
-                       wakeup((caddr_t)&tp->t_rawq);
-                       if ((addr->dmlstat&CARRIER)==0) {
-                               if ((tp->t_state&WOPEN)==0) {
-                                       signal(tp->t_pgrp, SIGHUP);
-                                       addr->dmlstat = 0;
-                                       flushtty(tp);
-                               }
-                               tp->t_state &= ~CARR_ON;
-                       } else {
-                               tp->t_state |= CARR_ON;
-                       }
-               }
-               addr->dmcsr = IENABLE|SCENABL;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dhfdm.c b/.ref-Research-V7/usr/sys/dev/dhfdm.c
deleted file mode 100644 (file)
index f7fe33b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- *     DM-BB fake driver
- */
-#include "../h/param.h"
-#include "../h/tty.h"
-#include "../h/conf.h"
-
-struct tty     dh11[];
-
-dmopen(dev)
-{
-       register struct tty *tp;
-
-       tp = &dh11[minor(dev)];
-       tp->t_state |= CARR_ON;
-}
-
-dmctl(dev, bits)
-{
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dkleave.c b/.ref-Research-V7/usr/sys/dev/dkleave.c
deleted file mode 100644 (file)
index 7cd7a7d..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#include "../h/param.h"
-#include "../h/buf.h"
-
-daddr_t
-dkblock(bp)
-register struct buf *bp;
-{
-       register int dminor;
-
-       if (((dminor=minor(bp->b_dev))&0100) == 0)
-               return(bp->b_blkno);
-       dminor >>= 3;
-       dminor &= 07;
-       dminor++;
-       return(bp->b_blkno/dminor);
-}
-
-dkunit(bp)
-register struct buf *bp;
-{
-       register int dminor;
-
-       dminor = minor(bp->b_dev) >> 3;
-       if ((dminor&010) == 0)
-               return(dminor);
-       dminor &= 07;
-       dminor++;
-       return(bp->b_blkno%dminor);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dn.c b/.ref-Research-V7/usr/sys/dev/dn.c
deleted file mode 100644 (file)
index ab8d299..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * DN-11 ACU interface
- */
-
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-
-struct device {
-       int     dn_reg[4];
-};
-
-struct device *dn_addr[] = { (struct device *)0175200 };
-#define        NDN     4
-
-#define        PWI     0100000
-#define        ACR     040000
-#define        DLO     010000
-#define        DONE    0200
-#define        IENABLE 0100
-#define        DSS     040
-#define        PND     020
-#define        MENABLE 04
-#define        DPR     02
-#define        CRQ     01
-
-#define        DNPRI   (PZERO+5)
-
-dnopen(dev)
-register dev;
-{
-       register struct device *dp;
-
-       dev = minor(dev);
-       if (dev >= NDN ||
-          (dp = dn_addr[dev>>2])->dn_reg[dev&03]&(PWI|DLO|CRQ))
-               u.u_error = ENXIO;
-       else {
-               dp->dn_reg[0] |= MENABLE;
-               dp->dn_reg[dev&03] = IENABLE|MENABLE|CRQ;
-       }
-}
-
-dnclose(dev)
-{
-       dev = minor(dev);
-       dn_addr[dev>>2]->dn_reg[dev&03] = MENABLE;
-}
-
-dnwrite(dev)
-{
-       register c;
-       register *dp;
-       extern lbolt;
-
-       dev = minor(dev);
-       dp = &(dn_addr[dev>>2]->dn_reg[dev&03]);
-       while ((*dp & (PWI|ACR|DSS)) == 0) {
-               spl4();
-               if ((*dp&PND) == 0 || u.u_count == 0 || (c=cpass()) < 0)
-                       sleep((caddr_t)dp, DNPRI);
-               else if (c == '-') {
-                       sleep((caddr_t)&lbolt, DNPRI);
-                       sleep((caddr_t)&lbolt, DNPRI);
-               } else {
-                       *dp = (c<<8)|IENABLE|MENABLE|DPR|CRQ;
-                       sleep((caddr_t)dp, DNPRI);
-               }
-               spl0();
-       }
-       if (*dp&(PWI|ACR))
-               u.u_error = EIO;
-}
-
-/*
- * interrupt-- "dev" applies to
- * system unit number, not minor device
- */
-dnint(dev)
-{
-       register *dp,*ep;
-
-       dp = &(dn_addr[dev]->dn_reg[0]);
-       *dp &= ~MENABLE;
-       for (ep=dp; ep<dp+4; ep++)
-               if (*ep&DONE) {
-                       *ep &= ~DONE;
-                       wakeup((caddr_t)ep);
-               }
-       *dp |= MENABLE;
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dsort.c b/.ref-Research-V7/usr/sys/dev/dsort.c
deleted file mode 100644 (file)
index 5a90c1e..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * generalized seek sort for disk
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-
-#define        b_cylin b_resid
-
-disksort(dp, bp)
-register struct buf *dp, *bp;
-{
-       register struct buf *ap;
-       struct buf *tp;
-
-       ap = dp->b_actf;
-       if(ap == NULL) {
-               dp->b_actf = bp;
-               dp->b_actl = bp;
-               bp->av_forw = NULL;
-               return;
-       }
-       tp = NULL;
-       for(; ap != NULL; ap = ap->av_forw) {
-               if ((bp->b_flags&B_READ) && (ap->b_flags&B_READ) == 0) {
-                       if (tp == NULL)
-                               tp = ap;
-                       break;
-               }
-               if ((bp->b_flags&B_READ) == 0 && (ap->b_flags&B_READ))
-                       continue;
-               if(ap->b_cylin <= bp->b_cylin)
-                       if(tp == NULL || ap->b_cylin >= tp->b_cylin)
-                               tp = ap;
-       }
-       if(tp == NULL)
-               tp = dp->b_actl;
-       bp->av_forw = tp->av_forw;
-       tp->av_forw = bp;
-       if(tp == dp->b_actl)
-               dp->b_actl = bp;
-}
diff --git a/.ref-Research-V7/usr/sys/dev/du.c b/.ref-Research-V7/usr/sys/dev/du.c
deleted file mode 100644 (file)
index 577f3b6..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * DU-11 Synchronous interface driver
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-
-/* device registers */
-struct dureg {
-       int     rxcsr, rxdbuf;
-#define        parcsr  rxdbuf
-       int     txcsr, txdbuf;
-};
-
-struct du {
-       struct dureg    *du_addr;
-       int             du_state;
-       struct proc     *du_proc;
-       struct buf      *du_buf;
-       caddr_t         du_bufb;
-       caddr_t         du_bufp;
-       int             du_nxmit;
-       int             du_timer;
-} du[] = {
-       { (struct dureg *) 0160110 },
-};
-
-#define        NDU     (sizeof(du)/sizeof(du[0]))
-
-#define        DONE    0200
-#define        IE      0100
-#define        SIE     040
-#define CTS    020000
-#define        CARRIER 010000
-#define        RCVACT  04000
-#define        DSR     01000
-#define STRIP  0400
-#define SCH    020
-#define RTS    04
-#define        DTR     02
-#define MR     0400
-#define SEND   020
-#define        HALF    010
-
-#define        READ    0
-#define        WRITE   1
-#define PWRIT  2
-
-#define        DUPRI   (PZERO+1)
-
-duopen(dev)
-register dev;
-{
-       int dutimeout();
-       register struct du *dp;
-       register struct dureg *lp;
-
-       dev = minor(dev);
-       if (dev >= NDU ||
-          ((dp = &du[dev])->du_proc!=NULL && dp->du_proc!=u.u_procp)) {
-               u.u_error = ENXIO;
-               return;
-       }
-       dp->du_proc = u.u_procp;
-       lp = dp->du_addr;
-       if (dp->du_buf==NULL) {
-               dp->du_buf = geteblk();
-               dp->du_bufb = dp->du_buf->b_un.b_addr;
-               dp->du_state = WRITE;
-               lp->txcsr = MR;
-               lp->parcsr = 035026;            /* Sync Int, 7 bits, even parity, sync=026 */
-               timeout(dutimeout, (caddr_t)dp, HZ);
-               duturn(dp);
-       }
-}
-
-duclose(dev)
-{
-       register struct du *dp;
-       register struct dureg *lp;
-
-       dp = &du[minor(dev)];
-       lp = dp->du_addr;
-       lp->rxcsr = 0;
-       lp->txcsr = 0;
-       dp->du_timer = 0;
-       dp->du_proc = 0;
-       if (dp->du_buf != NULL) {
-               brelse(dp->du_buf);
-               dp->du_buf = NULL;
-       }
-}
-
-duread(dev)
-{
-       register char *bp;
-       register struct du *dp;
-
-       dp = &du[minor(dev)];
-       bp = dp->du_bufb;
-       for(;;) {
-               if(duwait(dev))
-                       return;
-               if (dp->du_bufp > bp)
-                       break;
-               spl6();
-               if (dp->du_timer <= 1) {
-                       spl0();
-                       return;
-               }
-               sleep((caddr_t)dp, DUPRI);
-               spl0();
-       }
-       u.u_offset = 0;
-       iomove(dp->du_bufb, (int)min(u.u_count, (unsigned)(dp->du_bufp-bp)), B_READ);
-}
-
-duwrite(dev)
-{
-       register struct du *dp;
-       register struct dureg *lp;
-
-       dev = minor(dev);
-       dp = &du[dev];
-       if (u.u_count==0 || duwait(dev))
-               return;
-       dp->du_bufp = dp->du_bufb;
-       dp->du_state = PWRIT;
-       dp->du_addr->rxcsr &= ~SCH;
-       dp->du_addr->rxcsr = SIE|RTS|DTR;
-       if (u.u_count > BSIZE)
-               u.u_count = BSIZE;
-       dp->du_nxmit = u.u_count;
-       u.u_offset = 0;
-       iomove(dp->du_bufb, (int)u.u_count, B_WRITE);
-       lp = dp->du_addr;
-       dp->du_timer = 10;
-       spl6();
-       while((lp->rxcsr&CTS)==0)
-               sleep((caddr_t)dp, DUPRI);
-       if (dp->du_state != WRITE) {
-               dp->du_state = WRITE;
-               lp->txcsr = IE|SIE|SEND|HALF;
-               dustart(dev);
-       }
-       spl0();
-}
-
-duwait(dev)
-{
-       register struct du *dp;
-       register struct dureg *lp;
-
-       dp = &du[minor(dev)];
-       lp = dp->du_addr;
-       for(;;) {
-               if ((lp->rxcsr&DSR)==0 || dp->du_buf==0) {
-                       u.u_error = EIO;
-                       return(1);
-               }
-               spl6();
-               if (dp->du_state==READ &&
-                       ((lp->rxcsr&RCVACT)==0)) {
-                       spl0();
-                       return(0);
-               }
-               sleep((caddr_t)dp, DUPRI);
-               spl0();
-       }
-}
-
-dustart(dev)
-{
-       register struct du *dp;
-       register struct dureg *lp;
-
-       dp = &du[minor(dev)];
-       lp = dp->du_addr;
-       dp->du_timer = 10;
-       if (dp->du_nxmit > 0) {
-               dp->du_nxmit--;
-               lp->txdbuf = *dp->du_bufp++;
-       } else {
-               duturn(dp);
-       }
-}
-
-durint(dev)
-{
-       register struct du *dp;
-       register c, s;
-       int dustat;
-
-       dp = &du[minor(dev)];
-       dustat = dp->du_addr->rxcsr;
-       if(dustat<0) {
-               if((dustat&CARRIER)==0 && dp->du_state==READ)
-                       duturn(dp);
-               else
-                       wakeup((caddr_t)dp);
-       } else
-       if(dustat&DONE) {
-               dp->du_addr->rxcsr = IE|SIE|SCH|DTR;
-               c = s = dp->du_addr->rxdbuf;
-               c &= 0177;
-               if(s<0)
-                       c |= 0200;
-               if (dp->du_bufp < dp->du_bufb+BSIZE)
-                       *dp->du_bufp++ = c;
-       }
-}
-
-duxint(dev)
-{
-       register struct du *dp;
-       register struct dureg *lp;
-       register int dustat;
-
-       dp = &du[minor(dev)];
-       lp = dp->du_addr;
-       dustat = lp->txcsr;
-       if(dustat<0)
-               duturn(dp);
-       else if(dustat&DONE)
-               dustart(dev);
-}
-
-duturn(dp)
-register struct du *dp;
-{
-       register struct dureg *lp;
-
-       lp = dp->du_addr;
-       if (dp->du_state!=READ) {
-               dp->du_state = READ;
-               dp->du_timer = 10;
-               dp->du_bufp = dp->du_bufb;
-       }
-       lp->txcsr = HALF;
-       lp->rxcsr &= ~SCH;
-       lp->rxcsr = STRIP|IE|SIE|SCH|DTR;
-       wakeup((caddr_t)dp);
-}
-
-dutimeout(dp)
-register struct du *dp;
-{
-       if (dp->du_timer == 0)
-               return;
-       if (--dp->du_timer == 0) {
-               duturn(dp);
-               dp->du_timer = 1;
-       }
-       timeout(dutimeout, (caddr_t)dp, HZ);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/dz.c b/.ref-Research-V7/usr/sys/dev/dz.c
deleted file mode 100644 (file)
index f28b536..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- *     DZ11 driver
- * CAUTION -- MODIFIED FROM WORKING VERSION BUT NEVER PROPERLY TESTED
- */
-
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-
-struct device *dz_addr[] = { (struct device *)0160100, (struct device *)0160110};
-int    dz_cnt = 16;
-struct tty dz_tty[16];
-char   dz_stat;
-
-char   dz_speeds[] = {
-       0, 020, 021, 022, 023, 024, 0, 025,
-       026, 027, 030, 032, 034, 036, 0, 0,
-       };
-
-#define        BITS7   020
-#define        BITS8   030
-#define        TWOSB   040
-#define        PENABLE 0100
-#define        OPAR    0200
-#define        RCVENA  010000
-
-#define        IE      040140
-#define        PERROR  010000
-#define        FRERROR 020000
-#define        SSPEED  7       /* standard speed: 300 baud */
-
-struct device {
-       int     dzcsr, dzrbuf;
-       char    dztcr, dzdtr;
-       char    dztbuf, dzbrk;
-};
-#define        dzlpr   dzrbuf
-#define        dzmsr   dzbrk
-
-#define        ON      1
-#define        OFF     0
-
-
-dzopen(dev, flag)
-{
-       register struct tty *tp;
-       int x;
-       extern dzstart(), dzscan();
-
-       x = dev;
-       dev = minor(dev);
-       if (dev >= dz_cnt) {
-               u.u_error = ENXIO;
-               return;
-       }
-       tp = &dz_tty[dev];
-       if ((tp->t_state&(ISOPEN|WOPEN)) == 0) {
-               tp->t_oproc = dzstart;
-               tp->t_iproc = NULL;
-               ttychars(tp);
-               tp->t_ispeed = SSPEED;
-               tp->t_ospeed = SSPEED;
-               tp->t_flags = ODDP|EVENP|ECHO;
-               dzparam(dev);
-       }
-       dzmodem(dev, ON);
-       spl6();
-       while ((tp->t_state&CARR_ON)==0) {
-               tp->t_state |= WOPEN;
-               sleep((caddr_t)&tp->t_rawq, TTIPRI);
-       }
-       ttyopen(x,tp);
-       spl0();
-}
-
-dzclose(dev)
-{
-       register struct tty *tp;
-
-       dev = minor(dev);
-       tp = &dz_tty[dev];
-       wflushtty(tp);
-       if (tp->t_state&HUPCLS) {
-               dzmodem(dev, OFF);
-       }
-       tp->t_state &= CARR_ON;
-}
-
-dzread(dev)
-{
-       dev = minor(dev);
-       ttread(&dz_tty[dev]);
-}
-
-dzwrite(dev)
-{
-       dev = minor(dev);
-       ttwrite(&dz_tty[dev]);
-}
-
-dzioctl(dev, cmd, addr, flag)
-{
-       register struct tty *tp;
-
-       dev = minor(dev);
-       tp = &dz_tty[dev];
-       if (ttioccomm(cmd, tp, (caddr_t)addr, dev)) {
-               if (cmd==TIOCSETP||cmd==TIOCSETN)
-                       dzparam(dev);
-       } else {
-               u.u_error = ENOTTY;
-       }
-}
-
-dzparam(dev)
-{
-       register struct tty *tp;
-       register struct device *dzaddr;
-       register lpr;
-
-       tp = &dz_tty[dev];
-       dzaddr= dz_addr[dev>>3];
-       dzaddr->dzcsr = IE;
-       if (dz_stat==0) {
-               dzscan();
-               dz_stat++;
-       }
-       if (tp->t_ispeed==0) {  /* Hang up line */
-               dzmodem(dev, OFF);
-               return;
-       }
-       lpr = (dz_speeds[tp->t_ispeed]<<8)|(dev&07);
-       if (tp->t_flags&RAW)
-               lpr |= BITS8;
-       else
-               lpr |= BITS7|PENABLE;
-       if ((tp->t_flags&EVENP)==0)
-               lpr |= OPAR;
-       if (tp->t_ispeed == 3)  /* 110 baud */
-               lpr |= TWOSB;
-       dzaddr->dzlpr = lpr;
-}
-
-dzrint(dev)
-{
-       register struct tty *tp;
-       register c;
-       register struct device *dzaddr;
-
-       dzaddr = dz_addr[dev];
-       while ((c = dzaddr->dzrbuf) < 0) {      /* char. present */
-               tp = &dz_tty[((c>>8)&07)|(dev<<3)];
-               if (tp >= &dz_tty[dz_cnt])
-                       continue;
-               if((tp->t_state&ISOPEN)==0) {
-                       wakeup((caddr_t)&tp->t_rawq);
-                       continue;
-               }
-               if (c&FRERROR)          /* break */
-                       if (tp->t_flags&RAW)
-                               c = 0;          /* null (for getty) */
-                       else
-                               c = 0177;       /* DEL (intr) */
-               if (c&PERROR)
-                       if ((tp->t_flags&(EVENP|ODDP))==EVENP
-                        || (tp->t_flags&(EVENP|ODDP))==ODDP )
-                               continue;
-               ttyinput(c, tp);
-       }
-}
-
-dzxint(dev)
-{
-       register struct tty *tp;
-       register struct device *dzaddr;
-
-       dzaddr = dz_addr[dev];
-       while(dzaddr->dzcsr<0) {        /* TX rdy */
-               tp = &dz_tty[((dev<<3)|(dzaddr->dzcsr>>8)&07)];
-               dzaddr->dztbuf = tp->t_char;
-               tp->t_state &= ~BUSY;
-               dzstart(tp);
-       }
-}
-
-dzstart(tp)
-register struct tty *tp;
-{
-       register unit, c;
-       int s;
-       struct device *dzaddr;
-       extern ttrstrt();
-
-       unit = tp - dz_tty;
-       dzaddr = dz_addr[unit>>3];
-       unit = 1<<(unit&07);
-       s = spl5();
-       if (tp->t_state&(TIMEOUT|BUSY)) {
-               splx(s);
-               return;
-       }
-       if (tp->t_state&TTSTOP) {
-               dzaddr->dztcr &= ~unit;
-               splx(s);
-               return;
-       }
-       if ((c=getc(&tp->t_outq)) >= 0) {
-               if (c>=0200 && (tp->t_flags&RAW)==0) {
-                       dzaddr->dztcr &= ~unit;
-                       tp->t_state |= TIMEOUT;
-                       timeout(ttrstrt, (caddr_t)tp, (c&0177)+6);
-               } else {
-                       tp->t_char = c;
-                       tp->t_state |= BUSY;
-                       dzaddr->dztcr |= unit;
-               }
-               if (tp->t_outq.c_cc<=TTLOWAT && tp->t_state&ASLEEP) {
-                       tp->t_state &= ~ASLEEP;
-                       wakeup((caddr_t)&tp->t_outq);
-               }
-       } else
-               dzaddr->dztcr &= ~unit;
-       splx(s);
-}
-
-dzmodem(dev, flag)
-{
-       register struct device *dzaddr;
-       register bit;
-
-       dzaddr = dz_addr[dev>>3];
-       bit = 1<<(dev&07);
-       if (flag==OFF)
-               dzaddr->dzdtr &= ~bit;
-       else    dzaddr->dzdtr |= bit;
-}
-
-dzscan()
-{
-       register i;
-       register struct device *dzaddr;
-       register struct tty *tp;
-       char    bit;
-
-       for (i=0; i<dz_cnt; i++) {
-               dzaddr = dz_addr[i>>3];
-               tp = &dz_tty[i];
-               bit = 1<<(i&07);
-               if (dzaddr->dzmsr&bit) {
-                       if ((tp->t_state&CARR_ON)==0) {
-                               wakeup((caddr_t)&tp->t_rawq);
-                               tp->t_state |= CARR_ON;
-                       }
-               } else {
-                       if (tp->t_state&CARR_ON) {
-                               if (tp->t_state&ISOPEN) {
-                                       signal(tp->t_pgrp, SIGHUP);
-                                       dzaddr->dzdtr &= ~bit;
-                                       flushtty(tp);
-                               }
-                               tp->t_state &= ~CARR_ON;
-                       }
-               }
-       }
-       timeout(dzscan, (caddr_t)0, 120);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/hp.c b/.ref-Research-V7/usr/sys/dev/hp.c
deleted file mode 100644 (file)
index 4b48d49..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * RP04/RP06 disk driver
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-
-#define        DK_N    0
-
-struct device
-{
-       union {
-               int     w;
-               char    c[2];
-       } hpcs1;                /* Control and Status register 1 */
-       int     hpwc;           /* Word count register */
-       caddr_t hpba;           /* UNIBUS address register */
-       int     hpda;           /* Desired address register */
-       union {
-               int     w;
-               char    c[2];
-       } hpcs2;                /* Control and Status register 2*/
-       int     hpds;           /* Drive Status */
-       int     hper1;          /* Error register 1 */
-       int     hpas;           /* Attention Summary */
-       int     hpla;           /* Look ahead */
-       int     hpdb;           /* Data buffer */
-       int     hpmr;           /* Maintenance register */
-       int     hpdt;           /* Drive type */
-       int     hpsn;           /* Serial number */
-       int     hpof;           /* Offset register */
-       int     hpdc;           /* Desired Cylinder address register*/
-       int     hpcc;           /* Current Cylinder */
-       int     hper2;          /* Error register 2 */
-       int     hper3;          /* Error register 3 */
-       int     hpec1;          /* Burst error bit position */
-       int     hpec2;          /* Burst error bit pattern */
-       int     hpbae;          /* 11/70 bus extension */
-       int     hpcs3;
-};
-
-#define        HPADDR  ((struct device *)0176700)
-#define        NHP     2
-#define        NSECT   22
-#define        NTRAC   19
-#define        SDIST   2
-#define        RDIST   6
-
-struct size
-{
-       daddr_t nblocks;
-       int     cyloff;
-} hp_sizes[8] =
-{
-       9614,   0,              /* cyl 0 thru 22 */
-       8778,   23,             /* cyl 23 thru 43 */
-       0,      0,
-       0,      0,
-       161348, 44,             /* cyl 44 thru 429 */
-       160930, 430,            /* cyl 430 thru 814 */
-       153406, 44,             /* cyl 44 thru 410 (rp04, rp05) */
-       322278, 44,             /* cyl 44 thru 814 (rp06) */
-};
-
-#define        P400    020
-#define        M400    0220
-#define        P800    040
-#define        M800    0240
-#define        P1200   060
-#define        M1200   0260
-int    hp_offset[16] =
-{
-       P400, M400, P400, M400,
-       P800, M800, P800, M800,
-       P1200, M1200, P1200, M1200,
-       0, 0, 0, 0,
-};
-
-struct buf     hptab;
-struct buf     rhpbuf;
-struct buf     hputab[NHP];
-
-#define        GO      01
-#define        PRESET  020
-#define        RTC     016
-#define        OFFSET  014
-#define        SEARCH  030
-#define        RECAL   06
-#define DCLR   010
-#define        WCOM    060
-#define        RCOM    070
-
-#define        IE      0100
-#define        PIP     020000
-#define        DRY     0200
-#define        ERR     040000
-#define        TRE     040000
-#define        DCK     0100000
-#define        WLE     04000
-#define        ECH     0100
-#define VV     0100
-#define        DPR     0400
-#define        MOL     010000
-#define FMT22  010000
-
-#define        b_cylin b_resid
-
-daddr_t dkblock();
-
-hpstrategy(bp)
-register struct buf *bp;
-{
-       register struct buf *dp;
-       register unit;
-       long sz, bn;
-
-       unit = minor(bp->b_dev) & 077;
-       sz = bp->b_bcount;
-       sz = (sz+511) >> 9;
-       if (unit >= (NHP<<3) ||
-           bp->b_blkno < 0 ||
-           (bn = dkblock(bp))+sz > hp_sizes[unit&07].nblocks) {
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               return;
-       }
-       bp->b_cylin = bn/(NSECT*NTRAC) + hp_sizes[unit&07].cyloff;
-       unit = dkunit(bp);
-       dp = &hputab[unit];
-       spl5();
-       disksort(dp, bp);
-       if (dp->b_active == 0) {
-               hpustart(unit);
-               if(hptab.b_active == 0)
-                       hpstart();
-       }
-       spl0();
-}
-
-hpustart(unit)
-register unit;
-{
-       register struct buf *bp, *dp;
-       daddr_t bn;
-       int sn, cn, csn;
-
-       HPADDR->hpcs2.w = unit;
-       HPADDR->hpcs1.c[0] = IE;
-       HPADDR->hpas = 1<<unit;
-
-       if(unit >= NHP)
-               return;
-       dk_busy &= ~(1<<(unit+DK_N));
-       dp = &hputab[unit];
-       if((bp=dp->b_actf) == NULL)
-               return;
-       if((HPADDR->hpds & VV) == 0) {
-               HPADDR->hpcs1.c[0] = IE|PRESET|GO;
-               HPADDR->hpof = FMT22;
-       }
-       if(dp->b_active)
-               goto done;
-       dp->b_active++;
-       if ((HPADDR->hpds & (DPR|MOL)) != (DPR|MOL))
-               goto done;
-
-       bn = dkblock(bp);
-       cn = bp->b_cylin;
-       sn = bn%(NSECT*NTRAC);
-       sn = (sn+NSECT-SDIST)%NSECT;
-
-       if(HPADDR->hpcc != cn)
-               goto search;
-       csn = (HPADDR->hpla>>6) - sn + SDIST - 1;
-       if(csn < 0)
-               csn += NSECT;
-       if(csn > NSECT-RDIST)
-               goto done;
-
-search:
-       HPADDR->hpdc = cn;
-       HPADDR->hpda = sn;
-       HPADDR->hpcs1.c[0] = IE|SEARCH|GO;
-       unit += DK_N;
-       dk_busy |= 1<<unit;
-       dk_numb[unit] += 1;
-       return;
-
-done:
-       dp->b_forw = NULL;
-       if(hptab.b_actf == NULL)
-               hptab.b_actf = dp; else
-               hptab.b_actl->b_forw = dp;
-       hptab.b_actl = dp;
-}
-
-hpstart()
-{
-       register struct buf *bp, *dp;
-       register unit;
-       daddr_t bn;
-       int dn, sn, tn, cn;
-
-loop:
-       if ((dp = hptab.b_actf) == NULL)
-               return;
-       if ((bp = dp->b_actf) == NULL) {
-               hptab.b_actf = dp->b_forw;
-               goto loop;
-       }
-       hptab.b_active++;
-       unit = minor(bp->b_dev) & 077;
-       dn = dkunit(bp);
-       bn = dkblock(bp);
-       cn = bn/(NSECT*NTRAC) + hp_sizes[unit&07].cyloff;
-       sn = bn%(NSECT*NTRAC);
-       tn = sn/NSECT;
-       sn = sn%NSECT;
-
-       HPADDR->hpcs2.w = dn;
-       if ((HPADDR->hpds & (DPR|MOL)) != (DPR|MOL)) {
-               hptab.b_active = 0;
-               hptab.b_errcnt = 0;
-               dp->b_actf = bp->av_forw;
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               goto loop;
-       }
-       if(hptab.b_errcnt >= 16) {
-               HPADDR->hpof = hp_offset[hptab.b_errcnt & 017] | FMT22;
-               HPADDR->hpcs1.w = OFFSET|GO;
-               while(HPADDR->hpds & PIP)
-                       ;
-       }
-       HPADDR->hpdc = cn;
-       HPADDR->hpda = (tn << 8) + sn;
-       HPADDR->hpba = bp->b_un.b_addr;
-       if(cputype == 70)
-               HPADDR->hpbae = bp->b_xmem;
-       HPADDR->hpwc = -(bp->b_bcount>>1);
-       unit = ((bp->b_xmem&3) << 8) | IE | GO;
-       if(bp->b_flags & B_READ)
-               unit |= RCOM; else
-               unit |= WCOM;
-       HPADDR->hpcs1.w = unit;
-
-       dk_busy |= 1<<(DK_N+NHP);
-       dk_numb[DK_N+NHP] += 1;
-       unit = bp->b_bcount>>6;
-       dk_wds[DK_N+NHP] += unit;
-}
-
-hpintr()
-{
-       register struct buf *bp, *dp;
-       register unit;
-       int as, i, j;
-
-       as = HPADDR->hpas & 0377;
-       if(hptab.b_active) {
-               dk_busy &= ~(1<<(DK_N+NHP));
-               dp = hptab.b_actf;
-               bp = dp->b_actf;
-               unit = dkunit(bp);
-               HPADDR->hpcs2.c[0] = unit;
-               if (HPADDR->hpcs1.w & TRE) {            /* error bit */
-                       while((HPADDR->hpds & DRY) == 0)
-                               ;
-                       if(++hptab.b_errcnt > 28 || HPADDR->hper1&WLE)
-                               bp->b_flags |= B_ERROR; else
-                               hptab.b_active = 0;
-                       if(hptab.b_errcnt > 27)
-                               deverror(bp, HPADDR->hpcs2.w, HPADDR->hper1);
-                       if((bp->b_flags&B_PHYS) == 0 &&
-                          (HPADDR->hper1 & (DCK|ECH)) == DCK) {
-                               i = HPADDR->hpec1 - 1;
-                               j = i&017;
-                               i >>= 4;
-                               if(i >= 0 && i <256) {
-                                       bp->b_un.b_words[i] ^= HPADDR->hpec2 << j;
-                                       bp->b_un.b_words[i+1] ^= HPADDR->hpec2 >> (16-j);
-                               }
-                               hptab.b_active++;
-                               printf("%D ", bp->b_blkno);
-                               prdev("ECC", bp->b_dev);
-                       }
-                       HPADDR->hpcs1.w = TRE|IE|DCLR|GO;
-                       if((hptab.b_errcnt&07) == 4) {
-                               HPADDR->hpcs1.w = RECAL|IE|GO;
-                               while(HPADDR->hpds & PIP)
-                                       ;
-                       }
-               }
-               if(hptab.b_active) {
-                       if(hptab.b_errcnt) {
-                               HPADDR->hpcs1.w = RTC|GO;
-                               while(HPADDR->hpds & PIP)
-                                       ;
-                       }
-                       hptab.b_active = 0;
-                       hptab.b_errcnt = 0;
-                       hptab.b_actf = dp->b_forw;
-                       dp->b_active = 0;
-                       dp->b_errcnt = 0;
-                       dp->b_actf = bp->av_forw;
-                       bp->b_resid = -(HPADDR->hpwc<<1);
-                       iodone(bp);
-                       HPADDR->hpcs1.w = IE;
-                       if(dp->b_actf)
-                               hpustart(unit);
-               }
-               as &= ~(1<<unit);
-       } else {
-               if(as == 0)
-                       HPADDR->hpcs1.w = IE;
-               HPADDR->hpcs1.c[1] = TRE>>8;
-       }
-       for(unit=0; unit<NHP; unit++)
-               if(as & (1<<unit))
-                       hpustart(unit);
-       hpstart();
-}
-
-hpread(dev)
-{
-
-       physio(hpstrategy, &rhpbuf, dev, B_READ);
-}
-
-hpwrite(dev)
-{
-
-       physio(hpstrategy, &rhpbuf, dev, B_WRITE);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/ht.c b/.ref-Research-V7/usr/sys/dev/ht.c
deleted file mode 100644 (file)
index 8ea0fb3..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * TJU16 tape driver
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/file.h"
-#include "../h/user.h"
-
-struct device
-{
-       int     htcs1;
-       int     htwc;
-       caddr_t htba;
-       int     htfc;
-       int     htcs2;
-       int     htds;
-       int     hter;
-       int     htas;
-       int     htck;
-       int     htdb;
-       int     htmr;
-       int     htdt;
-       int     htsn;
-       int     httc;
-       int     htbae;  /* 11/70 bus extension */
-       int     htcs3;
-};
-
-struct buf     httab;
-struct buf     rhtbuf;
-struct buf     chtbuf;
-
-#define        NUNIT   1
-#define        INF     1000000
-
-char   h_flags[NUNIT];
-char   h_openf[NUNIT];
-daddr_t        h_blkno[NUNIT];
-daddr_t        h_nxrec[NUNIT];
-
-#define        HTADDR  ((struct device *)0172440)
-
-#define        GO      01
-#define        WCOM    060
-#define        RCOM    070
-#define        NOP     0
-#define        WEOF    026
-#define        SFORW   030
-#define        SREV    032
-#define        ERASE   024
-#define        REW     06
-#define        DCLR    010
-#define P800   01300           /* 800 + pdp11 mode */
-#define        P1600   02300           /* 1600 + pdp11 mode */
-#define        IENABLE 0100
-#define        RDY     0200
-#define        TM      04
-#define        DRY     0200
-#define EOT    02000
-#define CS     02000
-#define COR    0100000
-#define PES    040
-#define WRL    04000
-#define MOL    010000
-#define ERR    040000
-#define FCE    01000
-#define        TRE     040000
-#define HARD   064023  /* UNS|OPI|NEF|FMT|RMR|ILR|ILF */
-
-#define        CLR     040     /* controller clear (in cs2) */
-
-#define        NED     010000
-
-#define        SIO     1
-#define        SSFOR   2
-#define        SSREV   3
-#define SRETRY 4
-#define SCOM   5
-#define SOK    6
-
-#define H_WRITTEN 1
-htopen(dev, flag)
-{
-       register unit, ds;
-
-       httab.b_flags |= B_TAPE;
-       unit = minor(dev) & 077;
-       if (unit >= NUNIT || h_openf[unit]) {
-               u.u_error = ENXIO;
-               return;
-       }
-       h_blkno[unit] = 0;
-       h_nxrec[unit] = INF;
-       h_flags[unit] = 0;
-       ds = hcommand(dev, NOP);
-       if ((ds&MOL)==0 || (flag && (ds&WRL)))
-               u.u_error = ENXIO;
-       if (u.u_error==0)
-               h_openf[unit]++;
-}
-
-htclose(dev, flag)
-{
-       register int unit;
-
-       unit = minor(dev) & 077;
-       if (flag == FWRITE || ((flag&FWRITE) && (h_flags[unit]&H_WRITTEN))) {
-               hcommand(dev, WEOF);
-               hcommand(dev, WEOF);
-               hcommand(dev, SREV);
-       }
-       if ((minor(dev)&0200) == 0)
-               hcommand(dev, REW);
-       h_openf[unit] = 0;
-}
-
-hcommand(dev, com)
-{
-       register struct buf *bp;
-
-       bp = &chtbuf;
-       spl5();
-       while(bp->b_flags&B_BUSY) {
-               bp->b_flags |= B_WANTED;
-               sleep((caddr_t)bp, PRIBIO);
-       }
-       spl0();
-       bp->b_dev = dev;
-       bp->b_resid = com;
-       bp->b_blkno = 0;
-       bp->b_flags = B_BUSY|B_READ;
-       htstrategy(bp);
-       iowait(bp);
-       if(bp->b_flags&B_WANTED)
-               wakeup((caddr_t)bp);
-       bp->b_flags = 0;
-       return(bp->b_resid);
-}
-
-htstrategy(bp)
-register struct buf *bp;
-{
-       register daddr_t *p;
-
-       if(bp != &chtbuf) {
-               p = &h_nxrec[minor(bp->b_dev)&077];
-               if(bp->b_blkno > *p) {
-                       bp->b_flags |= B_ERROR;
-                       bp->b_error = ENXIO;
-                       iodone(bp);
-                       return;
-               }
-               if(bp->b_blkno == *p && bp->b_flags&B_READ) {
-                       clrbuf(bp);
-                       bp->b_resid = bp->b_bcount;
-                       iodone(bp);
-                       return;
-               }
-               if ((bp->b_flags&B_READ)==0) {
-                       *p = bp->b_blkno + 1;
-                       h_flags[minor(bp->b_dev)&077] |= H_WRITTEN;
-               }
-       }
-       bp->av_forw = NULL;
-       spl5();
-       if (httab.b_actf == NULL)
-               httab.b_actf = bp;
-       else
-               httab.b_actl->av_forw = bp;
-       httab.b_actl = bp;
-       if (httab.b_active==0)
-               htstart();
-       spl0();
-}
-
-htstart()
-{
-       register struct buf *bp;
-       register unit, den;
-       daddr_t blkno;
-
-    loop:
-       if ((bp = httab.b_actf) == NULL)
-               return;
-       unit = minor(bp->b_dev) & 0177;
-       HTADDR->htcs2 = ((unit>>3)&07);
-       den = P1600 | (unit&07);
-       if(unit > 077)
-               den = P800 | (unit&07);
-       if((HTADDR->httc&03777) != den)
-               HTADDR->httc = den;
-       if (HTADDR->htcs2 & NED || (HTADDR->htds&MOL)==0)
-               goto abort;
-       unit &= 077;
-       blkno = h_blkno[unit];
-       if (bp == &chtbuf) {
-               if (bp->b_resid==NOP) {
-                       bp->b_resid = HTADDR->htds;
-                       goto next;
-               }
-               httab.b_active = SCOM;
-               HTADDR->htfc = 0;
-               HTADDR->htcs1 = bp->b_resid|IENABLE|GO;
-               return;
-       }
-       if (h_openf[unit] < 0 || bp->b_blkno > h_nxrec[unit])
-               goto abort;
-       if (blkno == bp->b_blkno) {
-               httab.b_active = SIO;
-               HTADDR->htba = bp->b_un.b_addr;
-               if(cputype == 70)
-                       HTADDR->htbae = bp->b_xmem;
-               HTADDR->htfc = -bp->b_bcount;
-               HTADDR->htwc = -(bp->b_bcount>>1);
-               den = ((bp->b_xmem&3) << 8) | IENABLE | GO;
-               if(bp->b_flags & B_READ)
-                       den |= RCOM;
-               else {
-                       if(HTADDR->htds & EOT) {
-                               bp->b_resid = bp->b_bcount;
-                               goto next;
-                       }
-                       den |= WCOM;
-               }
-               HTADDR->htcs1 = den;
-       } else {
-               if (blkno < bp->b_blkno) {
-                       httab.b_active = SSFOR;
-                       HTADDR->htfc = blkno - bp->b_blkno;
-                       HTADDR->htcs1 = SFORW|IENABLE|GO;
-               } else {
-                       httab.b_active = SSREV;
-                       HTADDR->htfc = bp->b_blkno - blkno;
-                       HTADDR->htcs1 = SREV|IENABLE|GO;
-               }
-       }
-       return;
-
-    abort:
-       bp->b_flags |= B_ERROR;
-
-    next:
-       httab.b_actf = bp->av_forw;
-       iodone(bp);
-       goto loop;
-}
-
-htintr()
-{
-       register struct buf *bp;
-       register int unit, state;
-       int     err;
-
-       if ((bp = httab.b_actf)==NULL)
-               return;
-       unit = minor(bp->b_dev) & 077;
-       state = httab.b_active;
-       httab.b_active = 0;
-       if (HTADDR->htcs1&TRE) {
-               err = HTADDR->hter;
-               if (HTADDR->htcs2&077400 || (err&HARD))
-                       state = 0;
-               if (bp == &rhtbuf)
-                       err &= ~FCE;
-               if ((bp->b_flags&B_READ) && (HTADDR->htds&PES))
-                       err &= ~(CS|COR);
-               if((HTADDR->htds&MOL) == 0) {
-                       if(h_openf[unit])
-                               h_openf[unit] = -1;
-               }
-               else if(HTADDR->htds&TM) {
-                       HTADDR->htwc = -(bp->b_bcount>>1);
-                       h_nxrec[unit] = bp->b_blkno;
-                       state = SOK;
-               }
-               else if(state && err == 0)
-                       state = SOK;
-               if(httab.b_errcnt > 4)
-                       deverror(bp, HTADDR->hter, HTADDR->htcs2);
-               htinit();
-               if (state==SIO && ++httab.b_errcnt < 10) {
-                       httab.b_active = SRETRY;
-                       h_blkno[unit]++;
-                       HTADDR->htfc = -1;
-                       HTADDR->htcs1 = SREV|IENABLE|GO;
-                       return;
-               }
-               if (state!=SOK) {
-                       bp->b_flags |= B_ERROR;
-                       state = SIO;
-               }
-       } else if (HTADDR->htcs1 < 0) { /* SC */
-               if(HTADDR->htds & ERR)
-                       htinit();
-       }
-       switch(state) {
-       case SIO:
-       case SOK:
-               h_blkno[unit]++;
-
-       case SCOM:
-               httab.b_errcnt = 0;
-               httab.b_actf = bp->av_forw;
-               iodone(bp);
-               bp->b_resid = (-HTADDR->htwc)<<1;
-               break;
-
-       case SRETRY:
-               if((bp->b_flags&B_READ)==0) {
-                       httab.b_active = SSFOR;
-                       HTADDR->htcs1 = ERASE|IENABLE|GO;
-                       return;
-               }
-
-       case SSFOR:
-       case SSREV:
-               if(HTADDR->htds & TM) {
-                       if(state == SSREV) {
-                               h_nxrec[unit] = bp->b_blkno - HTADDR->htfc;
-                               h_blkno[unit] = h_nxrec[unit];
-                       } else {
-                               h_nxrec[unit] = bp->b_blkno + HTADDR->htfc - 1;
-                               h_blkno[unit] = h_nxrec[unit]+1;
-                       }
-               } else
-                       h_blkno[unit] = bp->b_blkno;
-               break;
-
-       default:
-               return;
-       }
-       htstart();
-}
-
-htinit()
-{
-       register ocs2;
-       register omttc;
-       
-       omttc = HTADDR->httc & 03777;   /* preserve old slave select, dens, format */
-       ocs2 = HTADDR->htcs2 & 07;      /* preserve old unit */
-
-       HTADDR->htcs2 = CLR;
-       HTADDR->htcs2 = ocs2;
-       HTADDR->httc = omttc;
-       HTADDR->htcs1 = DCLR|GO;
-}
-
-htread(dev)
-{
-       htphys(dev);
-       physio(htstrategy, &rhtbuf, dev, B_READ);
-}
-
-htwrite(dev)
-{
-       htphys(dev);
-       physio(htstrategy, &rhtbuf, dev, B_WRITE);
-}
-
-htphys(dev)
-{
-       register unit;
-       daddr_t a;
-
-       unit = minor(dev) & 077;
-       if(unit < NUNIT) {
-               a = u.u_offset >> 9;
-               h_blkno[unit] = a;
-               h_nxrec[unit] = a+1;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/kl.c b/.ref-Research-V7/usr/sys/dev/kl.c
deleted file mode 100644 (file)
index 07d83f8..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- *   KL/DL-11 driver
- */
-#include "../h/param.h"
-#include "../h/conf.h"
-#include       "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-#include "../h/systm.h"
-
-/* base address */
-#define        KLADDR  ((struct device *)0177560)      /* console */
-#define        KLBASE  ((struct device *)0176500)      /* kl and dl11-a */
-#define        DLBASE  ((struct device *)0175610)      /* dl-e */
-#define        NKL11   1
-#define        NDL11   0
-#define DSRDY  02
-#define        RDRENB  01
-#define        DLDELAY 4       /* Extra delay for DL's (double buff) */
-
-#define        NL1     000400
-#define        NL2     001000
-#define        CR2     020000
-#define        FF1     040000
-#define        TAB1    002000
-
-struct tty kl11[NKL11+NDL11];
-int    klstart();
-int    ttrstrt();
-char   partab[];
-
-struct device {
-       int     rcsr;
-       int     rbuf;
-       int     tcsr;
-       int     tbuf;
-};
-
-klopen(dev, flag)
-dev_t dev;
-{
-       register struct device *addr;
-       register struct tty *tp;
-       register d;
-
-       d = minor(dev);
-       if(d >= NKL11+NDL11) {
-               u.u_error = ENXIO;
-               return;
-       }
-       tp = &kl11[d];
-       /*
-        * set up minor 0 to address KLADDR
-        * set up minor 1 thru NKL11-1 to address from KLBASE
-        * set up minor NKL11 on to address from DLBASE
-        */
-       if(d == 0)
-               addr = KLADDR;
-       else if(d < NKL11)
-               addr = KLBASE + (d-1);
-       else
-               addr = DLBASE + (d-NKL11);
-       tp->t_addr = (caddr_t)addr;
-       tp->t_oproc = klstart;
-       if ((tp->t_state&ISOPEN) == 0) {
-               tp->t_state = ISOPEN|CARR_ON;
-               tp->t_flags = EVENP|LCASE|ECHO|XTABS|CRMOD|CR2;
-               ttychars(tp);
-       }
-       addr->rcsr |= IENABLE|DSRDY|RDRENB;
-       addr->tcsr |= IENABLE;
-       ttyopen(dev, tp);
-}
-
-klclose(dev, flag)
-dev_t dev;
-int flag;
-{
-       register struct tty *tp;
-
-       tp = &kl11[minor(dev)];
-       ttyclose(tp);
-}
-
-klread(dev)
-dev_t dev;
-{
-       ttread(&kl11[minor(dev)]);
-}
-
-klwrite(dev)
-dev_t dev;
-{
-       ttwrite(&kl11[minor(dev)]);
-}
-
-klxint(dev)
-dev_t dev;
-{
-       register struct tty *tp;
-
-       tp = &kl11[minor(dev)];
-       ttstart(tp);
-       if (tp->t_state&ASLEEP && tp->t_outq.c_cc<=TTLOWAT)
-               if (tp->t_chan)
-                       mcstart(tp->t_chan, (caddr_t)&tp->t_outq);
-               else
-                       wakeup((caddr_t)&tp->t_outq);
-}
-
-klrint(dev)
-dev_t dev;
-{
-       register int c;
-       register struct device *addr;
-       register struct tty *tp;
-
-       tp = &kl11[minor(dev)];
-       addr = (struct device *)tp->t_addr;
-       c = addr->rbuf;
-       addr->rcsr |= RDRENB;
-       ttyinput(c, tp);
-}
-
-klioctl(dev, cmd, addr, flag)
-caddr_t addr;
-dev_t dev;
-{
-       if (ttioccom(cmd, &kl11[minor(dev)], addr, dev)==0)
-               u.u_error = ENOTTY;
-}
-
-klstart(tp)
-register struct tty *tp;
-{
-       register c;
-       register struct device *addr;
-
-       addr = (struct device *)tp->t_addr;
-       if((addr->tcsr&DONE) == 0)
-               return;
-       if ((c=getc(&tp->t_outq)) >= 0) {
-               if (tp->t_flags&RAW)
-                       addr->tbuf = c;
-               else if (c<=0177)
-                       addr->tbuf = c | (partab[c]&0200);
-               else {
-                       timeout(ttrstrt, (caddr_t)tp, (c&0177) + DLDELAY);
-                       tp->t_state |= TIMEOUT;
-               }
-       }
-}
-
-char   *msgbufp = msgbuf;      /* Next saved printf character */
-/*
- * Print a character on console.
- * Attempts to save and restore device
- * status.
- * If the switches are 0, all
- * printing is inhibited.
- *
- * Whether or not printing is inhibited,
- * the last MSGBUFS characters
- * are saved in msgbuf for inspection later.
- */
-putchar(c)
-register c;
-{
-       register s, timo;
-
-       if (c != '\0' && c != '\r' && c != 0177) {
-               *msgbufp++ = c;
-               if(msgbufp >= &msgbuf[MSGBUFS])
-                       msgbufp = msgbuf;
-       }
-       /*
-        *  If last char was a break or null, don't print
-       */
-       if ((KLADDR->rbuf&0177) == 0)
-               return;
-       timo = 30000;
-       /*
-        * Try waiting for the console tty to come ready,
-        * otherwise give up after a reasonable time.
-        */
-       while((KLADDR->tcsr&0200) == 0)
-               if(--timo == 0)
-                       break;
-       if(c == 0)
-               return;
-       s = KLADDR->tcsr;
-       KLADDR->tcsr = 0;
-       KLADDR->tbuf = c;
-       if(c == '\n') {
-               putchar('\r');
-               putchar(0177);
-               putchar(0177);
-       }
-       putchar(0);
-       KLADDR->tcsr = s;
-}
diff --git a/.ref-Research-V7/usr/sys/dev/lp.c b/.ref-Research-V7/usr/sys/dev/lp.c
deleted file mode 100644 (file)
index 5def52c..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- *  Line printer driver
- *
- *  Notice nonstandard indirection in struct device
- */
-
-#include "sys/param.h"
-#include "sys/dir.h"
-#include "sys/user.h"
-#include "sys/tty.h"
-
-struct device *lp_addr[];
-int    lp_cnt;
-
-#define        LPPRI   (PZERO+8)
-#define        LPLOWAT 40
-#define        LPHIWAT 100
-#define        LPMAX   2
-
-struct device {
-       int     lpcsr, lpbuf;
-};
-
-struct lp {
-       struct  clist l_outq;
-       char    flag, ind;
-       int     ccc, mcc, mlc;
-       int     line, col;
-} lp_dt[LPMAX];
-
-#define        OPEN    010
-#define        CAP     020
-#define        NOCR    040
-#define        ASLP    0100
-
-#define        FORM    014
-
-lpopen(dev, flag)
-{
-       register unit;
-       register struct lp *lp;
-
-       unit = dev&07;
-       if (unit >= lp_cnt || unit >= LPMAX ||
-        (lp = &lp_dt[unit])->flag || lp_addr[unit]->lpcsr <0 ) {
-               u.u_error = EIO;
-               return;
-       }
-       lp->flag = (dev&077)|OPEN;
-       lp->ind = 4;
-       lp->col = 80;
-       lp->line = 66;
-       lp_addr[unit]->lpcsr |= IENABLE;
-       lpoutput(unit, FORM);
-}
-
-lpclose(dev)
-{
-       register unit;
-
-       unit = dev&07;
-       lpoutput(unit, FORM);
-       lp_dt[unit].flag = 0;
-}
-
-lpwrite(dev)
-{
-       register unit;
-       register c;
-       register struct lp *lp;
-
-       unit = dev&07;
-       lp = &lp_dt[unit];
-       while (u.u_count) {
-               spl4();
-               while(lp->l_outq.c_cc > LPHIWAT) {
-                       lpintr(unit);
-                       lp->flag |= ASLP;
-                       sleep(lp, LPPRI);
-               }
-               spl0();
-               c = fubyte(u.u_base++);
-               if (c < 0) {
-                       u.u_error = EFAULT;
-                       break;
-               }
-               u.u_count--;
-               lpoutput(unit, c);
-       }
-       spl4();
-       lpintr(unit);
-       spl0();
-}
-
-lpoutput(dev, c)
-register dev, c;
-{
-       register struct lp *lp;
-
-       lp = &lp_dt[dev];
-       if(lp->flag&CAP) {
-               if(c>='a' && c<='z')
-                       c += 'A'-'a'; else
-               switch(c) {
-               case '{':
-                       c = '(';
-                       goto esc;
-               case '}':
-                       c = ')';
-                       goto esc;
-               case '`':
-                       c = '\'';
-                       goto esc;
-               case '|':
-                       c = '!';
-                       goto esc;
-               case '~':
-                       c = '^';
-               esc:
-                       lpoutput(dev, c);
-                       lp->ccc--;
-                       c = '-';
-               }
-       }
-       switch(c) {
-       case '\t':
-               lp->ccc = ((lp->ccc+8-lp->ind) & ~7) + lp->ind;
-               return;
-       case '\n':
-               lp->mlc++;
-               if(lp->mlc >= lp->line )
-                       c = FORM;
-       case FORM:
-               lp->mcc = 0;
-               if (lp->mlc) {
-                       putc(c, &lp->l_outq);
-                       if(c == FORM)
-                               lp->mlc = 0;
-               }
-       case '\r':
-               lp->ccc = lp->ind;
-               spl4();
-               lpintr(dev);
-               spl0();
-               return;
-       case 010:
-               if(lp->ccc > lp->ind)
-                       lp->ccc--;
-               return;
-       case ' ':
-               lp->ccc++;
-               return;
-       default:
-               if(lp->ccc < lp->mcc) {
-                       if (lp->flag&NOCR) {
-                               lp->ccc++;
-                               return;
-                       }
-                       putc('\r', &lp->l_outq);
-                       lp->mcc = 0;
-               }
-               if(lp->ccc < lp->col) {
-                       while(lp->ccc > lp->mcc) {
-                               putc(' ', &lp->l_outq);
-                               lp->mcc++;
-                       }
-                       putc(c, &lp->l_outq);
-                       lp->mcc++;
-               }
-               lp->ccc++;
-       }
-}
-
-lpintr(dev)
-register dev;
-{
-       register struct lp *lp;
-       register c;
-
-       lp = &lp_dt[dev];
-       while (lp_addr[dev]->lpcsr&DONE && (c = getc(&lp->l_outq)) >= 0)
-               lp_addr[dev]->lpbuf = c;
-       if (lp->l_outq.c_cc <= LPLOWAT && lp->flag&ASLP) {
-               lp->flag &= ~ASLP;
-               wakeup(lp);
-       }
-}
-
-struct { char lobyte, hibyte;};
-lpsgtty(dev, v)
-register *v;
-{
-       register struct lp *lp;
-
-       lp = &lp_dt[dev&07];
-       if (v) {
-               v->lobyte = lp->flag;
-               v->hibyte = lp->ind;
-               v[1] = lp->line;
-               v[2] = lp->col;
-       } else {
-               lp->flag = (u.u_arg[0].lobyte&077)|OPEN;
-               lp->ind = u.u_arg[0].hibyte&017;
-               lp->line = u.u_arg[1];
-               lp->col = u.u_arg[2];
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/mem.c b/.ref-Research-V7/usr/sys/dev/mem.c
deleted file mode 100644 (file)
index 68ac682..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-/*
- */
-
-/*
- *     Memory special file
- *     minor device 0 is physical memory
- *     minor device 1 is kernel memory
- *     minor device 2 is EOF/RATHOLE
- */
-
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/conf.h"
-#include "../h/seg.h"
-
-mmread(dev)
-{
-       register c, bn, on;
-       int a, d;
-
-       if(minor(dev) == 2)
-               return;
-       do {
-               bn = u.u_offset >> 6;
-               on = u.u_offset & 077;
-               a = UISA->r[0];
-               d = UISD->r[0];
-               spl7();
-               UISA->r[0] = bn;
-               UISD->r[0] = 077406;
-               if(minor(dev) == 1)
-                       UISA->r[0] = (ka6-6)->r[(bn>>7)&07] + (bn & 0177);
-               if ((c = fuibyte((caddr_t)on)) < 0)
-                       u.u_error = ENXIO;
-               UISA->r[0] = a;
-               UISD->r[0] = d;
-               spl0();
-       } while(u.u_error==0 && passc(c)>=0);
-}
-
-mmwrite(dev)
-{
-       register c, bn, on;
-       int a, d;
-
-       if(minor(dev) == 2) {
-               u.u_count = 0;
-               return;
-       }
-       for(;;) {
-               bn = u.u_offset >> 6;
-               on = u.u_offset & 077;
-               if ((c=cpass())<0 || u.u_error!=0)
-                       break;
-               a = UISA->r[0];
-               d = UISD->r[0];
-               spl7();
-               UISA->r[0] = bn;
-               UISD->r[0] = 077406;
-               if(minor(dev) == 1)
-                       UISA->r[0] = (ka6-6)->r[(bn>>7)&07] + (bn & 0177);
-               if (suibyte((caddr_t)on, c) < 0)
-                       u.u_error = ENXIO;
-               UISA->r[0] = a;
-               UISD->r[0] = d;
-               spl0();
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/mklib b/.ref-Research-V7/usr/sys/dev/mklib
deleted file mode 100755 (executable)
index 53940ac..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-ar rc LIB2 \
-bio.o \
-cat.o \
-dhdm.o \
-dh.o \
-dhfdm.o \
-dn.o \
-du.o \
-hp.o \
-ht.o \
-kl.o \
-mem.o \
-mx1.o \
-mx2.o \
-partab.o \
-rf.o \
-rk.o \
-sys.o \
-tc.o \
-tm.o \
-tty.o \
-vp.o \
-vs.o \
-dsort.o \
-dkleave.o \
-pk0.o \
-pk1.o \
-pk2.o \
-pk3.o \
-dc.o \
-dz.o \
-rl.o \
-rp.o
diff --git a/.ref-Research-V7/usr/sys/dev/mx1.c b/.ref-Research-V7/usr/sys/dev/mx1.c
deleted file mode 100644 (file)
index 39a45d2..0000000
+++ /dev/null
@@ -1,489 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/reg.h"
-#include "../h/proc.h"
-#include "../h/tty.h"
-#include "../h/inode.h"
-#define        KERNEL  1
-#include "../h/mx.h"
-#include "../h/file.h"
-#include "../h/conf.h"
-
-/*
- * Multiplexor:   clist version
- *
- * installation:
- *     requires a line in cdevsw -
- *             mxopen, mxclose, mxread, mxwrite, mxioctl, 0,
- *
- *     also requires a line in linesw -
- *             mxopen, mxclose, mcread, mcwrite, mxioctl, nulldev, nulldev,
- *
- *     The linesw entry for mpx should be the last one in the table.
- *     'nldisp' (number of line disciplines) should not include the
- *     mpx line.  This is to prevent mpx from being enabled by an ioctl.
-
- *     mxtty.c must be loaded instead of tty.c so that certain
- *     sleeps will not be done if a typewriter is connected to
- *     a channel and so that sdata will be called from ttyinput.
- *     
- */
-struct chan    chans[NCHANS];
-struct schan   schans[NPORTS];
-struct group   *groups[NGROUPS];
-int    mpxline;
-struct chan *xcp();
-dev_t  mpxdev  = -1;
-
-
-char   mcdebugs[NDEBUGS];
-
-
-/*
- * Allocate a channel, set c_index to index.
- */
-struct chan *
-challoc(index, isport)
-{
-register s;
-
-       s = spl6();
-       if (isport) {
-               register struct schan *cp, *lastcp;
-               cp = schans;
-               lastcp = &schans[NPORTS];
-               for (; cp < lastcp; cp++)
-                       if (cp->c_group==NULL) {
-                               cp->c_index = index;
-                               cp->c_pgrp = 0;
-                               cp->c_flags = 0;
-                               splx(s);
-                               return((struct chan *)cp);
-                       }
-               goto out;
-       } else {
-               register struct chan *cp, *lastcp;
-               cp = chans;
-               lastcp = &chans[NCHANS];
-               for(; cp < lastcp; cp++) 
-                       if(cp->c_group==NULL) {
-                               cp->c_index = index;
-                               cp->c_pgrp = 0;
-                               cp->c_flags = 0;
-                               splx(s);
-                               return(cp);
-                       }
-       }
-out:
-       splx(s);
-       return(NULL);
-}
-
-
-
-/*
- * Allocate a group table cell.
- */
-gpalloc()
-{
-register i,s;
-
-       s = spl6();
-       for(i = NGROUPS-1; i>=0; i--)
-               if (groups[i]==NULL) {
-                       groups[i]++;
-                       break;
-               }
-       splx(s);
-       return(i);
-}
-
-
-/*
- * Add a channel to the group in
- * inode ip.
- */
-struct chan *
-addch(ip, isport)
-struct inode *ip;
-{
-register struct chan *cp;
-register struct group *gp;
-register i;
-
-       plock(ip);
-       gp = &ip->i_un.i_group;
-       for(i=0;i<NINDEX;i++) {
-               cp = (struct chan *)gp->g_chans[i];
-               if (cp == NULL) {
-                       if ((cp=challoc(i, isport)) != NULL) {
-                               gp->g_chans[i] = cp;
-                               cp->c_group = gp;
-                       }
-                       break;
-               }
-               cp = NULL;
-       }
-       prele(ip);
-       return(cp);
-}
-
-
-
-
-/*
- * mpxchan system call
- */
-mpxchan()
-{
-struct inode *ip, *gip;
-register int i;
-extern mxopen(), mcread();
-extern sdata(), scontrol();
-dev_t  dev;
-struct tty *tp;
-struct file *fp, *chfp, *gfp;
-struct chan *cp;
-struct group *gp, *ngp;
-struct a {
-       int     cmd;
-       int     *argvec;
-} *uap;
-struct mx_args vec;
-
-
-       /*
-        * common setup code.
-        */
-       uap = (struct a *)u.u_ap;
-       copyin((caddr_t)uap->argvec, (caddr_t)&vec, sizeof vec);
-       gp = NULL;
-       switch(uap->cmd) {
-       case NPGRP:
-               if (vec.m_arg[1] < 0)
-                       goto sw;
-       case CHAN:
-       case JOIN:
-       case EXTR:
-       case ATTACH:
-       case DETACH:
-       case CSIG:
-               gfp = getf(vec.m_arg[1]);
-               if (gfp==NULL)
-                       goto bad;
-               gip = gfp->f_inode;
-               gp = &gip->i_un.i_group;
-               if (gp->g_inode != gip)
-                       goto bad;
-       }
-
-sw:
-       switch(uap->cmd) {
-       /*
-        * creat an mpx file.
-        */
-       case MPX:
-       case MPXN:
-               if (mpxdev < 0) {
-                       for(i=0; linesw[i].l_open; i++) 
-                               if (linesw[i].l_read == mcread) {
-                                       mpxline = i;
-                                       goto found1;
-                               }
-                       goto bad;
-
-               found1:
-                       for(i=0; cdevsw[i].d_open; i++) {
-                               if (cdevsw[i].d_open == mxopen)
-                                       goto found2;
-                       }
-               bad:
-                       u.u_error = ENXIO;
-                       return;
-               found2:
-                       mpxdev = (dev_t)(i<<8);
-               }
-               if (uap->cmd==MPXN) {
-                       if ((ip=ialloc(rootdev))==NULL)
-                               goto bad;
-                       ip->i_mode = 0666+IFCHR;
-                       goto merge;
-               }
-               u.u_dirp = vec.m_name;
-               ip = namei(uchar,1);
-               if (ip != NULL) {
-                       u.u_error = EEXIST;
-                       iput(ip);
-                       return;
-               }
-               if (u.u_error)
-                       return;
-               ip = maknode((vec.m_arg[0]&0777)+IFCHR);
-               if (ip == NULL)
-                       return;
-       merge:
-               if ((i = gpalloc()) < 0) {
-                       iput(ip);
-                       goto bad;
-               }
-               ip->i_un.i_rdev = (daddr_t)(mpxdev+i);
-               gp = &ip->i_un.i_group;
-               groups[i] = gp;
-               gp->g_inode = ip;
-               gp->g_state = COPEN;
-               gp->g_group = NULL;
-               gp->g_index = 0;
-               gp->g_rotmask = 1;
-               gp->g_rot = 0;
-               gp->g_datq = 0;
-               open1(ip,FREAD+FWRITE,2);
-               if (u.u_error) {
-                       groups[i] = NULL;
-                       iput(ip);
-                       goto bad;
-               }
-               ip->i_mode = (ip->i_mode & ~IFMT) | IFMPC;
-               ip->i_count++;
-               ip->i_flag |= IACC|IUPD|ICHG;
-               fp = u.u_ofile[u.u_r.r_val1];
-               fp->f_flag |= FMP;
-               fp->f_un.f_chan = NULL;
-               gp->g_file = fp;
-               for(i=0;i<NINDEX;)
-                       gp->g_chans[i++] = NULL;
-               return;
-       /*
-        * join file descriptor (arg 0) to group (arg 1)
-        * return channel number
-        */
-       case JOIN:
-               if ((fp=getf(vec.m_arg[0]))==NULL)
-                       goto bad;
-               ip = fp->f_inode;
-               i = ip->i_mode & IFMT;
-               if (i == IFMPC) {
-                       if ((fp->f_flag&FMP) != FMP) {
-                               goto bad;
-                       }
-                       ngp = &ip->i_un.i_group;
-                       mlink (ngp, gp);
-                       fp->f_count++;
-                       return;
-               }
-               if (i != IFCHR) 
-                       goto bad;
-               dev = (dev_t)ip->i_un.i_rdev;
-               tp = cdevsw[major(dev)].d_ttys;
-               if (tp==NULL)
-                       goto bad;
-               tp = &tp[minor(dev)];
-               if (tp->t_chan)
-                       goto bad;
-               if ((cp=addch(gip, 1))==NULL)
-                       goto bad;
-               tp->t_chan = cp;
-               cp->c_fy = fp;
-               fp->f_count++;
-               cp->c_ttyp = tp;
-               cp->c_line = tp->t_line;
-               cp->c_flags = XGRP+PORT;
-               u.u_r.r_val1 = cpx(cp);
-               return;
-       /*
-        * attach channel (arg 0) to group (arg 1)
-        */
-       case ATTACH:
-               cp = xcp(gp, vec.m_arg[0]);
-               if (cp==NULL)
-                       goto bad;
-               u.u_r.r_val1 = cpx(cp);
-               wakeup((caddr_t)cp);
-               return;
-       case DETACH:
-               cp = xcp(gp, vec.m_arg[0]);
-               if (cp==NULL)
-                       goto bad;
-               detach(cp);
-               return;
-       /*
-        * extract channel (arg 0) from group (arg 1).
-        */
-       case EXTR:
-               cp = xcp(gp, vec.m_arg[0]);
-               if (cp==NULL) {
-                       goto bad;
-               }
-               if (cp->c_flags & ISGRP) {
-                       mxfalloc(((struct group *)cp)->g_file);
-                       return;
-               }
-               if ((fp = cp->c_fy) != NULL) {
-                       mxfalloc(fp);
-                       return;
-               }
-               if ((fp = falloc()) == NULL) {
-                       return;
-               }
-               fp->f_inode = gip;
-               gip->i_count++;
-               fp->f_un.f_chan = cp;
-               fp->f_flag = (vec.m_arg[2]) ?
-                               (FREAD|FWRITE|FMPY) : (FREAD|FWRITE|FMPX);
-               cp->c_fy = fp;
-               return;
-       /*
-        * make new chan on group (arg 1)
-        */
-       case CHAN:
-               if ((cp=addch(gip, 0))==NULL)
-                       goto bad;
-               cp->c_flags = XGRP;
-               cp->c_fy = NULL;
-               cp->c_ttyp = cp->c_ottyp = (struct tty *)cp;
-               cp->c_line = cp->c_oline = mpxline;
-               u.u_r.r_val1 = cpx(cp);
-               return;
-       /*
-        * connect fd (arg 0) to channel fd (arg 1)
-        * (arg 2 <  0) => fd to chan only
-        * (arg 2 >  0) => chan to fd only
-        * (arg 2 == 0) => both directions
-        */
-       case CONNECT:
-               if ((fp=getf(vec.m_arg[0]))==NULL)
-                       goto bad;
-               if ((chfp=getf(vec.m_arg[1]))==NULL)
-                       goto bad;
-               ip = fp->f_inode;
-               i = ip->i_mode&IFMT;
-               if (i!=IFCHR)
-                       goto bad;
-               dev = (dev_t)ip->i_un.i_rdev;
-               tp = cdevsw[major(dev)].d_ttys;
-               if (tp==NULL)
-                       goto bad;
-               tp = &tp[minor(dev)];
-               if (!(chfp->f_flag&FMPY)) {
-                       goto bad;
-               }
-               cp = chfp->f_un.f_chan;
-               if (cp==NULL || cp->c_flags&PORT) {
-                       goto bad;
-               }
-               i = vec.m_arg[2];
-               if (i>=0) {
-                       cp->c_ottyp = tp;
-                       cp->c_oline = tp->t_line;
-               }
-               if (i<=0)  {
-                       tp->t_chan = cp;
-                       cp->c_ttyp = tp;
-                       cp->c_line = tp->t_line;
-               }
-               return;
-       case NPGRP: {
-               register struct proc *pp;
-
-               if (gp != NULL) {
-                       cp = xcp(gp, vec.m_arg[0]);
-                       if (cp==NULL)
-                               goto bad;
-               }
-               pp = u.u_procp;
-               pp->p_pgrp = pp->p_pid;
-               if (vec.m_arg[2])
-                       pp->p_pgrp = vec.m_arg[2];
-               if (gp != NULL)
-                       cp->c_pgrp = pp->p_pgrp;
-               return;
-       }
-       case CSIG:
-               cp = xcp(gp, vec.m_arg[0]);
-               if (cp==NULL)
-                       goto bad;
-               signal(cp->c_pgrp, vec.m_arg[2]);
-               return;
-       case DEBUG:
-               i = vec.m_arg[0];
-               if (i<0 || i>NDEBUGS)
-                       return;
-               mcdebugs[i] = vec.m_arg[1];
-               if (i==ALL)
-                       for(i=0;i<NDEBUGS;i++)
-                               mcdebugs[i] = vec.m_arg[1];
-               return;
-       default:
-               goto bad;
-       }
-}
-
-detach(cp)
-register struct chan *cp;
-{
-       register struct group *gp;
-       register int i;
-
-       if (cp->c_flags&ISGRP) {
-               gp = (struct group *)cp;
-               closef(gp->g_file);
-               i = ((struct group *)cp)->g_index;
-               gp->g_chans[i] = NULL;
-               return;
-       } else if (cp->c_flags&PORT && cp->c_ttyp != NULL) {
-               closef(cp->c_fy);
-               chdrain(cp);
-               chfree(cp);
-               return;
-       }
-       if (cp->c_fy && (cp->c_flags&WCLOSE)==0) {
-               cp->c_flags |= WCLOSE;
-               chwake(cp);
-       } else {
-               chdrain(cp);
-               chfree(cp);
-       }
-}
-
-
-mxfalloc(fp)
-register struct file *fp;
-{
-register i;
-
-       if (fp==NULL) {
-               u.u_error = ENXIO;
-               return;
-       }
-
-       i = ufalloc();
-       if (i < 0)
-               return;
-       u.u_ofile[i] = fp;
-       fp->f_count++;
-       u.u_r.r_val1 = i;
-       return;
-}
-
-
-
-
-mlink(sub,master)
-struct group *sub, *master;
-{
-register i;
-
-
-       for(i=0;i<NINDEX;i++) {
-               if (master->g_chans[i] != NULL)
-                       continue;
-               master->g_chans[i] = (struct chan *)sub;
-               sub->g_group = master;
-               sub->g_index = i;
-               u.u_r.r_val1 = i;
-               return;
-       }
-       u.u_error = ENXIO;
-       return;
-}
diff --git a/.ref-Research-V7/usr/sys/dev/mx2.c b/.ref-Research-V7/usr/sys/dev/mx2.c
deleted file mode 100644 (file)
index cd93315..0000000
+++ /dev/null
@@ -1,915 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/tty.h"
-#include "../h/inode.h"
-#define        KERNEL  1
-#include "../h/mx.h"
-#include "../h/file.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-
-/*
- * multiplexor driver
- */
-struct chan    chans[NCHANS];
-struct group   *groups[NGROUPS];
-int    mpxline;
-struct chan *xcp();
-struct chan *addch();
-struct chan *nextcp();
-
-#define        MIN(a,b)        ((a<b)?a:b)
-short  cmask[16]       ={
-       01,     02,     04,
-       010,    020,    040,
-       0100,   0200,   0400,
-       01000,  02000,  04000,
-       010000, 020000, 040000, 0100000
-};
-
-#define        HIQ     100
-#define        LOQ     20
-#define        FP      ((struct file *)cp)
-
-
-
-char mcdebugs[NDEBUGS];
-
-/*
- * Timing cell
- */
-int    mxdummy;
-int    *MP     = &mxdummy;
-
-
-
-struct group *
-getmpx(dev)
-dev_t dev;
-{
-register d;
-
-       d = minor(dev);
-       if (d >= NGROUPS) 
-               return(NULL);
-       return(groups[d]);
-}
-
-
-
-
-mxopen(dev, flag)
-{
-register struct group *gp;
-register struct file *fp;
-register struct chan *cp;
-int    msg;
-       gp = getmpx(dev);
-       if (gp == NULL) {
-       bad:
-               u.u_error = ENXIO;
-               return;
-       }
-
-       if (gp->g_state == COPEN) {
-               gp->g_state = INUSE+ISGRP;
-               return;
-       }
-       if (!(gp->g_state&INUSE)) 
-               goto bad;
-       fp = u.u_ofile[u.u_r.r_val1];
-       if (fp->f_inode != gp->g_inode) 
-               goto bad;
-       if ((cp=addch(gp->g_inode, 0))==NULL)
-               goto bad;
-       cp->c_flags = XGRP;
-       cp->c_ottyp = cp->c_ttyp = (struct tty *)cp;
-       cp->c_line = cp->c_oline = mpxline;
-       fp->f_flag |= FMPY;
-       fp->f_flag |= FREAD+FWRITE;
-       fp->f_un.f_chan = cp;
-       if (gp->g_inode == mpxip) {
-               plock(mpxip);
-               mpxname(cp);
-               msg = M_OPEN;
-       } else
-               msg = M_WATCH;
-       scontrol(cp, msg, u.u_uid);
-       sleep((caddr_t)cp,TTIPRI);
-       if (cp->c_flags&NMBUF)
-               prele(mpxip);
-       if (cp->c_flags & WCLOSE) {
-               chdrain(cp);
-               chfree(cp);
-               goto bad;
-       }
-       cp->c_fy = fp;
-       cp->c_pgrp = u.u_procp->p_pgrp;
-}
-
-
-char   mxnmbuf[NMSIZE];
-int    nmsize;
-struct chan *mxnmcp;
-mpxname(cp)
-register struct chan *cp;
-{
-register char *np;
-register c;
-       np = mxnmbuf;
-       u.u_dirp = (caddr_t)u.u_arg[0];
-       
-       while (np < &mxnmbuf[NMSIZE]) {
-               c = uchar();
-               if (c <= 0)
-                       break;
-               *np++ = c;
-       }
-       *np++ = '\0';
-       nmsize = np - mxnmbuf;
-
-       cp->c_flags |= NMBUF;
-}
-
-
-mxclose(dev, flag, cp)
-dev_t  dev;
-register struct chan *cp;
-{
-register struct group *gp;
-register struct inode *ip;
-register struct file *fp;
-int    i, fmp;
-
-       fmp = flag&FMP;
-
-       /*
-        * close a channel
-        */
-       if (cp!=NULL && fmp && fmp!=FMP) {
-               for(fp=file; fp < &file[NFILE]; fp++) 
-                   if(fp->f_count && fp->f_flag&FMP && fp->f_un.f_chan==cp){
-                               return;
-                       }
-               chdrain(cp);
-               if ((cp->c_flags&WCLOSE)==0) {
-                       scontrol(cp, M_CLOSE, 0);
-                       cp->c_flags |= WCLOSE;
-               } else {
-                       chfree(cp);
-               }
-               return;
-       }
-
-       if ((gp = getmpx(dev)) == NULL)
-               return;
-       ip = gp->g_inode;
-       if (ip==NULL || (ip->i_mode&IFMT)!=IFMPC) {
-               return;
-       }
-
-       for(fp=file; fp < &file[NFILE]; fp++) {
-               if (fp->f_count && (fp->f_flag&FMP)==FMP && fp->f_inode==ip) {
-                       return;
-               }
-       }
-
-       if (ip == mpxip) {
-               mpxip = NULL;
-               prele(ip);
-       }
-
-       for(i=0;i<NINDEX;i++)
-               if ((cp=gp->g_chans[i])!=NULL)
-                       detach(cp);
-
-       groups[minor(dev)] = NULL;
-       plock(ip);
-       i = ip->i_mode;
-       i &= ~IFMT;
-       i |= IFCHR;
-       ip->i_mode = i;
-       zero((caddr_t)gp, sizeof (struct group));
-       ip->i_flag |= IUPD|ICHG;
-       iput(ip);
-}
-
-zero(s, cc)
-register char *s;
-register cc;
-{
-       while (cc--)
-               *s++ = 0;
-}
-
-char   m_eot[] ={ M_EOT, 0, 0, 0};
-
-/*
- * Mxread + mxwrite are entered from cdevsw
- * for all read/write calls.  Operations on
- * an mpx file are handled here.
- * Calls are made through linesw to handle actual
- * data movement.
- */
-mxread(dev)
-{
-register struct group *gp;
-register struct chan *cp;
-register esc;
-struct rh h;
-caddr_t        base;
-unsigned count;
-int    s, xfr, more, fmp;
-
-       if ((gp=getmpx(dev))==NULL) {
-bad:
-               u.u_error = ENXIO;
-               return;
-       }
-       FP = getf(u.u_arg[0]);
-       fmp = FP->f_flag & FMP;
-       if (fmp != FMP) {
-               msread(fmp, FP->f_un.f_chan);
-               return;
-       }
-
-       if ((int)u.u_base & 1)
-               goto bad;
-       s = spl6();
-       while (gp->g_datq == 0) {
-
-               sleep((caddr_t)&gp->g_datq, TTIPRI);
-       }
-
-       while (gp->g_datq && u.u_count >= CNTLSIZ + 2) {
-               splx(s);
-               esc = 0;
-               cp = nextcp(gp);
-               if (cp==NULL) {
-                       continue;
-               }
-               h.index = cpx(cp);
-               if (count = cp->c_ctlx.c_cc) {
-                       count += CNTLSIZ;
-                       if (cp->c_flags&NMBUF)
-                               count += nmsize;
-                       if (count > u.u_count) {
-                               sdata(cp);
-                               return;
-                       }
-                       esc++;
-               }
-               base = u.u_base;
-               count = u.u_count;
-               u.u_base += sizeof h;
-               u.u_count -= sizeof h;
-               xfr = u.u_count;
-               if (esc && cp->c_flags&PORT) {
-                       more = mcread(cp);
-               } else {
-                       more = (*linesw[cp->c_line].l_read)(cp->c_ttyp);
-               }
-               if (more > 0)
-                       sdata(cp);
-               if (more < 0)
-                       scontrol(cp, M_CLOSE, 0);
-               if (xfr == u.u_count) {
-                       esc++;
-                       iomove((caddr_t)m_eot, sizeof m_eot, B_READ);
-               }
-               xfr -= u.u_count;
-               if (esc) {
-                       h.count = 0;
-                       h.ccount = xfr;
-               } else {
-                       h.count = xfr;
-                       h.ccount = 0;
-                       mxrstrt(cp, &cp->cx.datq, BLOCK|ALT);
-               }
-               if (u.u_count && (xfr&1)) {
-                       u.u_base++;
-                       u.u_count--;
-               }
-               copyout((caddr_t)&h, base, sizeof h);
-
-               s = spl6();
-       }
-}
-
-
-
-
-
-mxwrite(dev)
-{
-register struct chan *cp;
-struct wh h;
-struct group *gp;
-int    ucount, esc, fmp, burpcount;
-caddr_t        ubase, hbase;
-
-       if ((gp=getmpx(dev))==NULL) {
-               u.u_error = ENXIO;
-               return;
-       }
-       FP = getf(u.u_arg[0]);
-       fmp = FP->f_flag & FMP;
-       if (fmp != FMP) {
-               mswrite(fmp, FP->f_un.f_chan);
-               return;
-       }
-       burpcount = 0;
-       while (u.u_count >= sizeof h) {
-               hbase = u.u_base;
-               iomove((caddr_t)&h, sizeof h, B_WRITE);
-               if (u.u_error)
-                       return;
-               esc = 0;
-               if (h.count==0) {
-                       esc++;
-                       h.count = h.ccount;
-               }
-               cp = xcp(gp, h.index);
-               if (cp==NULL)  {
-                       continue;
-               }
-               ucount = u.u_count;
-               ubase = u.u_base;
-               u.u_count = h.count;
-               u.u_base = h.data;
-
-               if (esc==0) {
-                       struct tty *tp;
-                       caddr_t waddr;
-                       int line;
-
-                       if (cp->c_flags&PORT) {
-                               line = cp->c_line;
-                               tp = cp->c_ttyp;
-                       } else {
-                               line = cp->c_oline;
-                               tp = cp->c_ottyp;
-                       }
-               loop:
-                       waddr = (caddr_t)(*linesw[line].l_write)(tp);
-                       if (u.u_count) {
-                               if (gp->g_state&ENAMSG) {
-                                       burpcount++;
-                                       cp->c_flags |= BLKMSG;
-/*
-                                       scontrol(cp, M_BLK, u.u_count);
-*/
-                                       h.ccount = -1;
-                                       h.count = u.u_count;
-                                       h.data = u.u_base;
-                                       copyout((caddr_t)&h, hbase, sizeof h);
-                               } else {
-                                       if (waddr==0) {
-                                               u.u_error = ENXIO;
-                                               return;
-                                       }
-                                       sleep(waddr, TTOPRI);
-                                       goto loop;
-                               }
-                       }
-               } else
-                       mxwcontrol(cp); 
-               u.u_count = ucount;
-               u.u_base = ubase;
-       }
-       u.u_count = burpcount;
-}
-
-
-
-/*
- * Mcread and mcwrite move data on an mpx file.
- * Transfer addr and length is controlled by mxread/mxwrite.
- * Kernel-to-Kernel and other special transfers are not
- * yet in.
- */
-mcread(cp)
-register struct chan *cp;
-{
-register struct clist *q;
-register char *np;
-
-int cc;
-
-       q = (cp->c_ctlx.c_cc) ? &cp->c_ctlx : &cp->cx.datq;
-       cc = mxmove(q, B_READ);
-
-       if (cp->c_flags&NMBUF && q == &cp->c_ctlx) {
-               np = mxnmbuf;
-               while (nmsize--)
-                       passc(*np++);
-               cp->c_flags &= ~NMBUF;
-               prele(mpxip);
-       }
-       if (cp->c_flags&PORT)
-               return(cp->c_ctlx.c_cc + cp->c_ttyp->t_rawq.c_cc); else
-               return(cp->c_ctlx.c_cc + cp->cx.datq.c_cc);
-
-}
-
-
-char *
-mcwrite(cp)
-register struct chan *cp;
-{
-register struct clist *q;
-register cc;
-int    s;
-
-       q = &cp->cy.datq;
-       while (u.u_count) {
-               s = spl6();
-               if (q->c_cc > HIQ || (cp->c_flags&EOTMARK)) {
-                       cp->c_flags |= SIGBLK;
-                       splx(s);
-                       break;
-               }
-               splx(s);
-               cc = mxmove(q, B_WRITE);
-       }
-       wakeup((caddr_t)q);
-       return((caddr_t)q);
-}
-
-
-/*
- * Msread and mswrite move bytes
- * between user and non-multiplexed channel.
- */
-msread(fmp, cp)
-register struct chan *cp;
-{
-register struct clist *q;
-int s;
-
-       q = (fmp&FMPX) ? &cp->cx.datq : &cp->cy.datq;
-       s = spl6();
-       while (q->c_cc == 0) {
-               if (cp->c_flags & EOTMARK) {
-                       cp->c_flags &= ~EOTMARK;
-                       if (cp->c_flags&ENAMSG)
-                               scontrol(cp, M_UBLK, 0);
-                       else {
-                               wakeup((caddr_t)cp);
-                               wakeup((caddr_t)q);
-                       }
-                       goto out;
-               }
-               if (cp->c_flags&WCLOSE) {
-                       u.u_error = ENXIO;
-                       goto out;
-               }
-               sleep((caddr_t)q,TTIPRI);
-       }
-       splx(s);
-       while (mxmove(q, B_READ) > 0)
-               ;
-       mxrstrt(cp, q, SIGBLK);
-       return;
-out:
-       splx(s);
-}
-
-
-mswrite(fmp, cp)
-register struct chan *cp;
-{
-register struct clist *q;
-register int cc;
-
-       q = (fmp&FMPX) ? &cp->cy.datq : &cp->cx.datq;
-       while (u.u_count) {
-
-               spl6();
-               if (cp->c_flags&WCLOSE) {
-               bad:
-                       signal(SIGPIPE, cp->c_pgrp);
-                       return;
-               }
-
-               while (q->c_cc>100) {
-                       if (cp->c_flags&WCLOSE)
-                               goto bad;
-                       sdata(cp);
-                       cp->c_flags |= BLOCK;
-                       sleep((caddr_t)q+1,TTOPRI);
-               }
-               spl0();
-               cc = mxmove(q, B_WRITE);
-               if (cc < 0)
-                       break;
-       }
-       if (fmp&FMPX) {
-               if (cp->c_flags&YGRP) 
-                       sdata(cp); else
-                       wakeup((caddr_t)q);
-       } else {
-               if (cp->c_flags&XGRP) 
-                       sdata(cp); else
-                       wakeup((caddr_t)q);
-       }
-}
-
-
-
-/*
- * move chars between clist and user space.
- */
-mxmove(q, dir)
-register struct clist *q;
-register dir;
-{
-register cc;
-char buf[HIQ];
-
-       cc = MIN(u.u_count, sizeof buf);
-       if (dir == B_READ) 
-               cc = q_to_b(q, buf, cc);
-       if (cc <= 0)
-               return(cc);
-       iomove((caddr_t)buf, cc, dir);
-       if (dir == B_WRITE)
-               cc = b_to_q(buf, cc, q);
-       return(cc);
-}
-
-
-
-mxrstrt(cp, q, b)
-register struct chan *cp;
-register struct clist *q;
-register b;
-{
-int s;
-
-       s = spl6();
-       if (cp->c_flags&b && q->c_cc<LOQ) {
-               cp->c_flags &= ~b;
-               if (b&ALT)
-                       wakeup((caddr_t)q+1); else
-                       mcstart(cp, (caddr_t)q);
-       }
-       if (cp->c_flags&WFLUSH)
-               wakeup((caddr_t)q+2);
-       splx(s);
-}
-
-
-
-/*
- * called from driver start or xint routines
- * to wakeup output sleeper.
- */
-mcstart(cp, q)
-register struct chan *cp;
-register caddr_t q;
-{
-
-       if (cp->c_flags&(BLKMSG)) {
-               cp->c_flags &= ~BLKMSG;
-               scontrol(cp, M_UBLK, 0);
-       } else
-               wakeup((caddr_t)q);
-}
-
-
-mxwcontrol(cp)
-register struct chan *cp;
-{
-short  cmd[2];
-int    s;
-
-       iomove((caddr_t)cmd, sizeof cmd, B_WRITE);
-       switch(cmd[0]) {
-       /*
-        * not ready to queue this up yet.
-        */
-       case M_EOT:
-               s = spl6();
-               while (cp->c_flags & EOTMARK)
-                       if (cp->c_flags&ENAMSG) {
-                               scontrol(cp, M_BLK, 0);
-                               goto out;
-                       } else
-                               sleep((caddr_t)cp, TTOPRI);
-               cp->c_flags |= EOTMARK;
-       out:
-               splx(s);
-               break;
-       case M_IOCTL:
-printf("M_IOCTL");
-               break;
-       default:
-               u.u_error = ENXIO;
-       }
-}
-
-
-
-
-
-
-
-
-mxioctl(dev, cmd, addr, flag)
-caddr_t addr;
-{
-struct group *gp;
-int fmp;
-struct file *fp;
-
-       if ((gp = getmpx(dev)) == NULL) {
-bad:
-               u.u_error = ENXIO;
-               return;
-       }
-
-       fp = getf(u.u_arg[0]);
-       if (fp==NULL)
-               goto bad;
-
-       fmp = fp->f_flag & FMP;
-
-       if (fmp == FMP) {
-               switch(cmd) {
-               case MXLSTN:
-                       if (mpxip == NULL) {
-                               mpxip = gp->g_inode;
-                       } else
-                               goto bad;
-                       break;
-               case MXNBLK:
-                       gp->g_state |= ENAMSG;
-                       break;
-               default:
-                       goto bad;
-               }
-       }
-}
-
-
-
-
-chdrain(cp)
-register struct chan *cp;
-{
-register struct tty *tp;
-int wflag;
-
-       chwake(cp);
-
-       wflag = (cp->c_flags&WCLOSE)==0;
-       tp = cp->c_ttyp;
-       if (tp == NULL)         /* prob not required */
-               return;
-       if (cp->c_flags&PORT && tp->t_chan == cp) {
-               cp->c_ttyp = NULL;
-               tp->t_chan = NULL;
-               return;
-       }
-       if (wflag) 
-               wflush(cp,&cp->cx.datq); else
-               flush(&cp->cx.datq);
-       if (!(cp->c_flags&YGRP)) {
-               flush(&cp->cy.datq);
-       }
-}
-
-chwake(cp)
-register struct chan *cp;
-{
-register char *p;
-
-       wakeup((caddr_t)cp);
-       flush(&cp->c_ctlx);
-       p = (char *)&cp->cx.datq;
-       wakeup((caddr_t)p); wakeup((caddr_t)++p); wakeup((caddr_t)++p);
-       p = (char *)&cp->cy.datq;
-       wakeup((caddr_t)p); wakeup((caddr_t)++p); wakeup((caddr_t)++p);
-}
-
-
-chfree(cp)
-register struct chan *cp;
-{
-register struct group *gp;
-register i;
-
-       gp = cp->c_group;
-       if (gp==NULL)
-               return;
-       i = cp->c_index;
-       if (cp == gp->g_chans[i]) {
-               gp->g_chans[i] = NULL;
-       }
-       cp->c_group = NULL;
-}
-
-
-flush(q)
-register struct clist *q;
-{
-
-       while(q->c_cc)
-               getc(q);
-}
-
-
-wflush(cp,q)
-register struct chan *cp;
-register struct clist *q;
-{
-register s;
-
-       s = spl6();
-       while(q->c_cc) {
-               if (cp->c_flags & WCLOSE) {
-                       flush(q);
-                       goto out;
-               }
-               cp->c_flags |= WFLUSH;
-               sdata(cp);
-               sleep((caddr_t)q+2,TTOPRI);
-       }
-out:
-       cp->c_flags &= ~WFLUSH;
-       splx(s);
-}
-
-
-scontrol(cp,event,value)
-register struct chan *cp;
-short event,value;
-{
-register struct clist *q;
-int s;
-
-       q = &cp->c_ctlx;
-       s = spl6();
-       if (sdata(cp) == NULL)
-               return;
-       putw(event,q);
-       putw(value,q);
-       splx(s);
-}
-
-sdata(cp)
-register struct chan *cp;
-{
-register struct group *gp;
-register short x;
-register struct group *lgp;
-int s;
-
-       gp = cp->c_group;
-       if (gp==NULL) {
-               return(0);
-       }
-       x = cp->c_index;
-
-       s = spl6();
-       while (gp) {
-               if ((gp->g_state&ISGRP)==0) {
-                       return(0);
-               }
-               gp->g_datq |= cmask[x];
-               x = gp->g_index;
-               lgp = gp;
-               gp = gp->g_group;
-       }
-       gp =  lgp;
-       splx(s);
-       wakeup((caddr_t)&gp->g_datq);
-       return((int)gp);
-}
-
-
-
-struct chan *
-xcp(gp, x)
-register struct group *gp;
-register short x;
-{
-register i;
-
-       i = 0;
-       while (i<NLEVELS && gp->g_state&ISGRP) {
-               gp = (struct group *)gp->g_chans[x&017];
-               x >>= 4;
-               if ((x&017) >= NINDEX)
-                       break;
-               i++;
-       }
-       return((struct chan *)gp);
-}
-
-cpx(cp)
-register struct chan *cp;
-{
-register x;
-register struct group *gp;
-
-       if (cp==NULL)
-               return(-1);
-       x = (-1<<4) + cp->c_index;
-       gp = cp->c_group;
-       if (gp==NULL || (gp->g_state&ISGRP)==0)
-               return(-1);
-       gp = gp->g_group;
-       while (gp && gp->g_state&ISGRP) {
-               x <<= 4;
-               x |= gp->g_index;
-               gp = gp->g_group;
-       }
-       return(x);
-}
-
-
-
-struct chan *
-nextcp(gp)
-register struct group *gp;
-{
-
-       if (gp->g_datq == 0) {
-               gp = NULL;
-               goto out;
-       }
-
-       while (gp != NULL && gp->g_state&ISGRP) {
-               while ( (gp->g_datq & gp->g_rotmask) == 0) {
-                       gp->g_rot++;
-                       gp->g_rot &= 017;
-                       if (gp->g_rot)
-                               gp->g_rotmask <<= 1; else
-                               gp->g_rotmask = 1;
-               }
-               gp = (struct group *)gp->g_chans[gp->g_rot];
-       }
-       if (gp)
-               rmdata(gp);
-out:
-       return((struct chan *)gp);
-}
-
-rmdata(cp)
-register struct chan *cp;
-{
-register struct group *gp;
-register short x;
-
-       gp = cp->c_group;
-       x = cp->c_index;
-
-       while (gp) {
-               gp->g_datq &= ~cmask[x];
-               if (gp->g_datq)
-                       return;
-               x = gp->g_index;
-               gp = gp->g_group;
-       }
-}
-
-
-
-
-
-mcrint(c, tp)
-struct tty *tp;
-{
-}
-
-mcxint(tp)
-struct tty *tp;
-{
-}
-/*
-prstuff(s,cc)
-register char *s;
-register cc;
-{
-       while (cc--)
-               printf("%o ",*s++&0377);
-}
-
-prascii(s, cc)
-register char *s;
-register cc;
-{
-register c;
-       while (cc--) {
-               c = *s++;
-               if (c>=040 && c<=0176)
-                       putchar(c); else
-                       printf(" %o ", c&0377);
-       }
-}
-*/
diff --git a/.ref-Research-V7/usr/sys/dev/partab.c b/.ref-Research-V7/usr/sys/dev/partab.c
deleted file mode 100644 (file)
index 44628c4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- */
-
-char partab[] = {
-       0001,0201,0201,0001,0201,0001,0001,0201,
-       0202,0004,0003,0201,0005,0206,0201,0001,
-       0201,0001,0001,0201,0001,0201,0201,0001,
-       0001,0201,0201,0001,0201,0001,0001,0201,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0200,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0200,0000,0000,0200,0000,0200,0200,0000,
-       0000,0200,0200,0000,0200,0000,0000,0201
-};
diff --git a/.ref-Research-V7/usr/sys/dev/pk0.c b/.ref-Research-V7/usr/sys/dev/pk0.c
deleted file mode 100644 (file)
index c9f7fb1..0000000
+++ /dev/null
@@ -1,683 +0,0 @@
-#define        KERNEL  1
-#include "../h/pk.p"
-
-/*
- * packet driver
- */
-
-char next[8]   ={ 1,2,3,4,5,6,7,0};    /* packet sequence numbers */
-char mask[8]   ={ 1,2,4,010,020,040,0100,0200 };
-
-struct pack *pklines[NPLINES];
-
-
-/*
- * receive control messages
- */
-
-pkcntl(cntl, pk)
-register cntl;
-register struct pack *pk;
-{
-register val;
-register m;
-
-       val = cntl & MOD8;
-
-       if ( NOTCNTL(cntl) ) {
-               pkbadframe(pk);
-               return;
-       }
-
-       cntl >>= 3;
-       pk->p_state &= ~BADFRAME;
-       m = pk->p_msg;
-
-       switch(cntl) {
-
-       case INITB:
-               val++;
-               pk->p_xsize = pksizes[val];
-               pk->p_lpsize = val;
-               pk->p_bits = DTOM(pk->p_xsize);
-               if (pk->p_state & LIVE) {
-                       pk->p_msg |= M_INITC;
-                       break;
-               }
-               pk->p_state |= INITb;
-               if ((pk->p_state & INITa)==0) {
-                       break;
-               }
-               pk->p_rmsg &= ~M_INITA;
-               pk->p_msg |= M_INITC;
-               break;
-
-       case INITC:
-               if ((pk->p_state&INITab)==INITab) {
-                       pk->p_state = LIVE;
-                       WAKEUP(&pk->p_state);
-                       pk->p_rmsg &= ~(M_INITA|M_INITB);
-               } else
-                       if ((pk->p_state&LIVE)==0)
-                               pk->p_msg |= M_INITB;
-               if (val)
-                       pk->p_swindow = val;
-               break;
-       case INITA:
-               if (val==0 && pk->p_state&LIVE) {
-                       printf("alloc change\n");
-                       break;
-               }
-               if (val) {
-                       pk->p_state |= INITa;
-                       pk->p_msg |= M_INITB;
-                       pk->p_rmsg |= M_INITB;
-                       pk->p_swindow = val;
-               }
-               break;
-       case RJ:
-               pk->p_state |= RXMIT;
-               pk->p_msg |= M_RR;
-       case RR:
-               pk->p_rpr = val;
-               if (pksack(pk)==0) {
-                       WAKEUP(&pk->p_ps);
-               }
-               break;
-       case CLOSE:
-               pk->p_state = DOWN+RCLOSE;
-               pk->p_rmsg = 0;
-               WAKEUP(&pk->p_pr);
-               WAKEUP(&pk->p_ps);
-               WAKEUP(&pk->p_state);
-               return;
-       }
-       if (pk->p_msg==0)
-               pk->p_msg |= pk->p_rmsg;
-
-
-       if (m==0 && pk->p_msg)
-               pkoutput(pk);
-}
-
-
-/*
- * Send RJ message on first framing error.
- * Cleared by receiving a good frame 
- * (pkcntl or pkdata).
- */
-pkbadframe(pk)
-register struct pack *pk;
-{
-       WAKEUP(&pk->p_pr);
-       if (pk->p_state & BADFRAME)
-               return;
-       pk->p_state |= BADFRAME;
-       pk->p_timer = 2;
-}
-
-
-
-
-/*
- * Look at sequence numbers (mostly).
- */
-pkaccept(pk)
-register struct pack *pk;
-{
-register x, seq;
-char m, cntl, *p, imask, **bp;
-int bad, accept, skip, s, t, cc;
-unsigned short sum;
-
-       bad = accept = skip = 0;
-       /*
-        * wait for input
-        */
-       LOCK;
-       x = next[pk->p_pr];
-       if((imask=pk->p_imap)==0 && pk->p_rcount==0) {
-               UNLOCK;
-               goto out;
-       }
-       pk->p_imap = 0;
-       UNLOCK;
-
-
-       /*
-        * determine input window in m.
-        */
-       t = (~(-1<<pk->p_rwindow)) <<x;
-       m = t;
-       m |= t>>8;
-
-
-       /*
-        * mark newly accepted input buffers
-        */
-       for(x=0; x<8; x++) {
-
-               if ((imask & mask[x]) == 0)
-                       continue;
-
-               if (((cntl=pk->p_is[x])&0200)==0) {
-                       bad++;
-free:
-                       bp = (char **)pk->p_ib[x];
-                       LOCK;
-                       *bp = (char *)pk->p_ipool;
-                       pk->p_ipool = bp;
-                       pk->p_is[x] = 0;
-                       UNLOCK;
-                       continue;
-               }
-
-               pk->p_is[x] = ~(B_COPY+B_MARK);
-               sum = (unsigned)chksum(pk->p_ib[x], pk->p_rsize) ^ (unsigned)cntl;
-               sum += pk->p_isum[x];
-               if (sum == CHECK) {
-                       seq = (cntl>>3) & MOD8;
-                       if (m & mask[seq]) {
-                               if (pk->p_is[seq] & (B_COPY | B_MARK)) {
-                               dup:
-                                       skip++;
-                                       goto free;
-                               }
-                               if (x != seq) {
-                                       LOCK;
-                                       p = pk->p_ib[x];
-                                       pk->p_ib[x] = pk->p_ib[seq];
-                                       pk->p_is[x] = pk->p_is[seq];
-                                       pk->p_ib[seq] = p;
-                                       UNLOCK;
-                               }
-                               pk->p_is[seq] = B_MARK;
-                               accept++;
-                               cc = 0;
-                               if (cntl&B_SHORT) {
-                                       pk->p_is[seq] = B_MARK+B_SHORT;
-                                       p = pk->p_ib[seq];
-                                       cc = (unsigned)*p++;
-                                       if (cc & 0200) {
-                                               cc &= 0177;
-                                               cc |= *p << 7;
-                                       }
-                               }
-                               pk->p_isum[seq] = pk->p_rsize - cc;
-                       } else {
-                               goto dup;
-                       }
-               } else {
-                       bad++;
-                       goto free;
-               }
-       }
-
-       /*
-        * scan window again turning marked buffers into
-        * COPY buffers and looking for missing sequence
-        * numbers.
-        */
-       accept = 0;
-       for(x=next[pk->p_pr],t= -1; m & mask[x]; x = next[x]) {
-               if (pk->p_is[x] & B_MARK)
-                       pk->p_is[x] |= B_COPY;
-               if (pk->p_is[x] & B_COPY) {
-                       if (t >= 0) {
-                               bp = (char **)pk->p_ib[x];
-                               LOCK;
-                               *bp = (char *)pk->p_ipool;
-                               pk->p_ipool = bp;
-                               pk->p_is[x] = 0;
-                               UNLOCK;
-                               skip++;
-                       } else 
-                               accept++;
-               } else {
-                       if (t<0)
-                               t = x;
-               }
-       }
-
-       if (bad) {
-               pk->p_msg |= M_RJ;
-       } else 
-
-       if (skip) {
-               pk->p_msg |= M_RR;
-       }
-
-       pk->p_rcount = accept;
-out:
-       if (pk->p_msg)
-               pkoutput(pk);
-       return(accept);
-}
-
-
-pkread(S)
-SDEF;
-{
-register struct pack *pk;
-register x,s;
-int is,cc,xfr,count;
-char *cp, **bp;
-
-       pk = PADDR;
-       xfr = 0;
-       count = -1;
-       while (pkaccept(pk) == 0) {
-               PKGETPKT(pk);
-               if (pk->p_state&DOWN) {
-                       SETERROR;
-                       goto out;
-               }
-               if (SLEEPNO) {
-                       count++;
-                       goto out;
-               }
-               SLEEP(&pk->p_pr, PKIPRI);
-       }
-       count = 0;
-
-
-       while (UCOUNT) {
-
-               x = next[pk->p_pr];
-               is = pk->p_is[x];
-
-               if (is & B_COPY) {
-                       cc = MIN(pk->p_isum[x], UCOUNT);
-                       if (cc==0 && xfr) {
-                               break;
-                       }
-                       if (is & B_RESID)
-                               cp = pk->p_rptr;
-                       else {
-                               cp = pk->p_ib[x];
-                               if (is & B_SHORT) {
-                                       if (*cp++ & 0200)
-                                               *cp++;
-                               }
-                       }
-                       IOMOVE(cp,cc,B_READ);
-                       count += cc;
-                       xfr++;
-                       pk->p_isum[x] -= cc;
-                       if (pk->p_isum[x] == 0) {
-                               LOCK;
-                               pk->p_pr = x;
-                               bp = (char **)pk->p_ib[x];
-                               *bp = (char *)pk->p_ipool;
-                               pk->p_ipool = bp;
-                               pk->p_is[x] = 0;
-                               pk->p_rcount--;
-                               UNLOCK;
-                               pk->p_msg |= M_RR;
-                       } else {
-                               pk->p_rptr = cp+cc;
-                               pk->p_is[x] |= B_RESID;
-                       }
-                       if (cc==0)
-                               break;
-               } else
-                       break;
-       }
-       pkoutput(pk);
-       if (SLEEPNO)
-               count = pk->p_rcount;
-out:
-       return(count);
-}
-
-
-
-
-pkwrite(S)
-SDEF;
-{
-register struct pack *pk;
-register x;
-int partial;
-caddr_t cp;
-int cc, s, fc, count;
-int pktimeout();
-
-       pk = PADDR;
-       if ((pk->p_state&LIVE)==0) {
-       down:
-               SIGNAL;
-               SETERROR;
-               return(-1);
-       }
-
-       count = UCOUNT;
-       do {
-               LOCK;
-               while (pk->p_xcount>=pk->p_swindow)  {
-                       pkoutput(pk);
-                       PKGETPKT(pk);
-                       SLEEP(&pk->p_ps,PKOPRI);
-                       if (pk->p_state&DOWN)
-                               goto down;
-               }
-               x = next[pk->p_pscopy];
-               while (pk->p_os[x]!=B_NULL)  {
-                       goto down;
-               }
-               pk->p_os[x] = B_MARK;
-               pk->p_pscopy = x;
-               pk->p_xcount++;
-               UNLOCK;
-
-               cp = pk->p_ob[x] = (char *)GETEPACK;
-               partial = 0;
-               if ((int)UCOUNT < pk->p_xsize) {
-                       cc = UCOUNT;
-                       fc = pk->p_xsize - cc;
-                       *cp = fc&0177;
-                       if (fc > 127) {
-                               *cp++ |= 0200;
-                               *cp++ = fc>>7;
-                       } else
-                               cp++;
-                       partial = B_SHORT;
-               } else
-                       cc = pk->p_xsize;
-               IOMOVE(cp,cc,B_WRITE);
-               pk->p_osum[x] = chksum(pk->p_ob[x], pk->p_xsize);
-               pk->p_os[x] = B_READY+partial;
-               pkoutput(pk);
-       } while (UCOUNT);
-
-       return(count-UCOUNT);
-}
-
-pksack(pk)
-register struct pack *pk;
-{
-register x, i;
-int s;
-
-       i = 0;
-       LOCK;
-       for(x=pk->p_ps; x!=pk->p_rpr; ) {
-               x = next[x];
-               if (pk->p_os[x]&B_SENT) {
-                       i++;
-                       FREEPACK(pk->p_ob[x], pk->p_bits);
-                       pk->p_os[x] = B_NULL;
-                       pk->p_state &= ~WAITO;
-                       pk->p_xcount--;
-                       pk->p_ps = x;
-                       WAKEUP(&pk->p_ps);
-               }
-       }
-       UNLOCK;
-       return(i);
-}
-
-
-
-pkoutput(pk)
-register struct pack *pk;
-{
-register x;
-int s;
-char bstate;
-int i;
-SDEF;
-extern pkzot;
-
-       ISYSTEM;
-       LOCK;
-       if (OBUSY) {
-               UNLOCK;
-               return;
-       }
-
-
-       /*
-        * find seq number and buffer state
-        * of next output packet
-        */
-       if (pk->p_state&RXMIT)  {
-               pk->p_nxtps = next[pk->p_rpr];
-               pk->p_state &= ~RXMIT;
-       }
-       x = pk->p_nxtps;
-       bstate = pk->p_os[x];
-
-
-       /*
-        * Send control packet if indicated
-        */
-       if (pk->p_msg) {
-               if (pk->p_msg & ~M_RR || !(bstate&B_READY) ) {
-                       x = pk->p_msg;
-                       for(i=0; i<8; i++) 
-                               if (x&1)
-                                       break; else
-                               x >>= 1;
-                       x = i;
-                       x <<= 3;
-                       switch(i) {
-                       case CLOSE:
-                               break;
-                       case RJ:
-                       case RR:
-                               x += pk->p_pr;
-                               break;
-                       case SRJ:
-                               break;
-                       case INITB:
-                               x += pksize(pk->p_rsize);
-                               break;
-                       case INITC:
-                               x += pk->p_rwindow;
-                               break;
-                       case INITA:
-                               x += pk->p_rwindow;
-                               break;
-                       }
-
-                       pk->p_msg &= ~mask[i];
-                       pkxstart(pk, x, -1);
-                       goto out;
-               }
-       }
-
-
-       /*
-        * Don't send data packets if line is marked dead.
-        */
-       if (pk->p_state&DOWN || (pk->p_state&LIVE)==0) {
-               WAKEUP(&pk->p_ps);
-               goto out;
-       }
-       /*
-        * Start transmission (or retransmission) of data packets.
-        */
-       if (bstate & (B_READY|B_SENT)) {
-               char seq;
-
-               bstate |= B_SENT;
-               seq = x;
-               pk->p_nxtps = next[x];
-
-               x = 0200+pk->p_pr+(seq<<3);
-               if (bstate & B_SHORT)
-                       x |= 0100;
-               pkxstart(pk, x, seq);
-               if (pk->p_os[seq])
-                       pk->p_os[seq] = bstate;
-               pk->p_nout++;
-               goto out;
-       }
-       /*
-        * enable timeout if there's nothing to send
-        * and transmission buffers are languishing
-        */
-       if (pk->p_xcount) {
-               pk->p_timer = 10+pkzot;
-               pk->p_state |= WAITO;
-       } else
-               pk->p_state &= ~WAITO;
-       WAKEUP(&pk->p_ps);
-out:
-       pk->p_obusy = 0;
-       UNLOCK;
-}
-
-
-/*
- * shut down line by
- *     ignoring new input
- *     letting output drain
- *     releasing space and turning off line discipline
- */
-pkclose(S)
-SDEF;
-{
-register struct pack *pk;
-register i,s,rbits;
-char **bp;
-
-#define        NTRIES  1
-
-       pk = PADDR;
-       pk->p_state |= DRAINO;
-
-
-       /*
-        * try to flush output
-        */
-       i = 0;
-       LOCK;
-       if (pklive(pk)==0) {
-               pk->p_state = DOWN;
-               UNLOCK;
-               goto final;
-       }
-       pk->p_timer = 2;
-       while (pk->p_xcount && pk->p_state&LIVE) {
-               if (pk->p_state&(RCLOSE+DOWN) || ++i > NTRIES)
-                       break;
-               pkoutput(pk);
-               SLEEP(&pk->p_ps,PKOPRI);
-       }
-       pk->p_timer = 0;
-       pk->p_state |= DOWN;
-       UNLOCK;
-
-
-       /*
-        * try to exchange CLOSE messages
-        */
-       i = 0;
-       while ((pk->p_state&RCLOSE)==0 && i<NTRIES) {
-               pk->p_msg = M_CLOSE;
-               pk->p_timer = 2;
-               pkoutput(pk);
-               SLEEP(&pk->p_ps, PKOPRI);
-               i++;
-       }
-
-
-final:
-       TURNOFF;
-
-
-       /*
-        * free space
-        */
-       rbits = DTOM(pk->p_rsize);
-       for (i=0;i<8;i++) {
-               if (pk->p_os[i]!=B_NULL) {
-                       FREEPACK(pk->p_ob[i],pk->p_bits);
-                       pk->p_xcount--;
-               }
-               if (pk->p_is[i]!=B_NULL)  {
-                       FREEPACK(pk->p_ib[i],rbits);
-               }
-       }
-       LOCK;
-       while (pk->p_ipool != NULL) {
-               bp = pk->p_ipool;
-               pk->p_ipool = (char **)*bp;
-               FREEPACK((caddr_t)bp, rbits);
-       }
-       UNLOCK;
-       for(i=0;i<NPLINES;i++)
-               if (pklines[i]==pk)  {
-                       pklines[i] = NULL;
-               }
-       FREEPACK((caddr_t)pk, npbits);
-}
-
-
-
-pkreset(pk)
-register struct pack *pk;
-{
-
-       pk->p_ps = pk->p_pr =  pk->p_rpr = 0;
-       pk->p_nxtps = 1;
-}
-
-chksum(s,n)
-register char *s;
-register n;
-{
-       register short sum;
-       register unsigned t;
-       register x;
-
-       sum = -1;
-       x = 0;
-
-       do {
-               if (sum<0) {
-                       sum <<= 1;
-                       sum++;
-               } else
-                       sum <<= 1;
-               t = sum;
-               sum += (unsigned)*s++;
-               x += sum^n;
-               if ((unsigned)sum <= t) {
-                       sum ^= x;
-               }
-       } while (--n > 0);
-
-       return(sum);
-}
-
-pkline(pk)
-register struct pack *pk;
-{
-register i;
-       for(i=0;i<NPLINES;i++) {
-               if (pklines[i]==pk)
-                       return(i);
-       }
-       return(-i);
-}
-
-pkzero(s,n)
-register char *s;
-register n;
-{
-       while (n--)
-               *s++ = 0;
-}
-
-pksize(n)
-register n;
-{
-register k;
-
-       n >>= 5;
-       for(k=0; n >>= 1; k++);
-       return(k);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/pk1.c b/.ref-Research-V7/usr/sys/dev/pk1.c
deleted file mode 100644 (file)
index 331cbbe..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-#define        KERNEL  1
-#include "../h/pk.p"
-
-
-/*
- * kernel support routines.
- */
-
-struct pack *pklines[NPLINES];
-int    maxwindow =2;
-
-/*
- * start initial synchronization.
- * allocate space.
- */
-pkopen(dev, tp, addr)
-register struct tty *tp;
-caddr_t addr;
-{
-register struct pack *pk;
-register i;
-int pktimeout();
-char **bp;
-static timer_on;
-int s;
-struct piocb   piocb;
-
-
-       if (tp->t_line)
-               return;
-       /*
-        * copy user parameters
-        */
-       if (copyin(addr, (caddr_t)&piocb, sizeof (piocb))) {
-               u.u_error = EFAULT;
-               return;
-       }
-       npbits = dtom(sizeof(struct pack));
-       pk = (struct pack *)getepack(npbits);
-       if (pk==NULL)
-               goto notsobad;
-       pkzero((caddr_t)pk,sizeof (struct pack));
-       pk->p_rwindow = piocb.window;
-       if (pk->p_rwindow > maxwindow)
-               pk->p_rwindow = maxwindow;
-       pk->p_rsize = piocb.psize;
-       if (pk->p_rsize > 512 || pk->p_rsize & 037)
-               goto notsobad;
-       pk->p_mode = piocb.mode;
-       if (pk->p_mode & 01)
-               pkdebug++;
-       /*
-        * try to allocate input window
-        */
-       pk->p_bits = dtom(pk->p_rsize);
-       for(i=0; i<pk->p_rwindow; i++) {
-               bp = (char **)getepack(pk->p_bits);
-               if (bp==NULL)
-                       break;
-               *bp = (char *)pk->p_ipool;
-               pk->p_ipool = bp;
-       }
-
-       if (i==0 && bp==NULL)
-               goto notsobad;
-       pk->p_rwindow = i;
-
-
-       /*
-        * start timer process,
-        * wait for synchronization.
-        */
-       flushtty(tp);
-       s = spl6();
-       pkdisc = tp->t_line = piocb.t;
-       pk->p_ttyp = tp;
-       tp->t_linep = (caddr_t)pk;
-       q2.c_cf = q2.c_cl = NULL;
-       q1.c_cf = q1.c_cl = (caddr_t)&pk->p_ihbuf;
-       q1.c_cc = -HDRSIZ;
-       if (tp->t_iproc != NULL)
-               (*tp->t_iproc)(tp);
-
-       pk->p_rmsg = M_INITA;
-       for(i=0; i<NPLINES; i++) {
-               if (pklines[i]==NULL) {
-                       pklines[i] = pk;
-                       goto found;
-               }
-       }
-       goto notsobad;
-found:
-       pk->p_timer++;
-       if (timer_on==0) {
-               timer_on++;
-               pktimeout();
-       }
-       splx(s);
-       SLEEP(&pk->p_state, PKOPRI);
-       pkreset(pk);
-
-       if ((pk->p_state&LIVE)==0) {
-               pk->p_state = DOWN;
-               pk->p_rmsg = 0;
-notsobad:
-               u.u_error = ENXIO;
-               return;
-       }
-
-       pksetgrp(tp);
-       pkioctl(DIOCGETP, tp, addr);
-
-}
-
-
-
-
-/*
- * unix ioctl interface
- */
-pkioctl(com,tp,addr)
-register struct tty *tp;
-caddr_t addr;
-{
-struct piocb piocb;
-register struct pack *pk;
-
-       pk = (struct pack *)tp->t_linep;
-       if (com == DIOCGETP) {
-               piocb.window = pk->p_swindow;
-               piocb.psize  = pk->p_xsize;
-               piocb.state  = pk->p_state;
-               if (copyout((caddr_t)&piocb, addr, sizeof(piocb))) {
-                       u.u_error = EFAULT;
-               }
-               if (u.u_error==0)
-                       u.u_r.r_val1 = piocb.psize;
-       }
-}
-
-
-/*
- * Arrange for the device (i.e. tp)
- * to be able to generate signals if need be.
- */
-pksetgrp(tp)
-register struct tty *tp;
-{
-register struct proc *pp;
-
-       pp = u.u_procp;
-       if (pp->p_pgrp == 0)
-               pp->p_pgrp = pp->p_pid;
-       if (tp->t_pgrp == 0)
-               tp->t_pgrp = pp->p_pgrp;
-}
-
-
-
-/*
- * Shut down io.
- * The problem is mainly input since the
- * device driver may have a buffer.
- */
-pkturnoff(tp)
-register struct tty *tp;
-{
-register char **bp;
-register struct pack *pk;
-register s;
-
-       pk = PADDR;
-       LOCK;
-       bp = pk->p_io;
-       tp->t_line = 0;
-       q1.c_cf = NULL;
-       flushtty(tp);
-       if (bp!=NULL) {
-               *bp = (char *)pk->p_ipool;
-               pk->p_ipool = bp;
-       }
-       UNLOCK;
-}
-
-
-
-/*
- * link dead?
- */
-pklive(pk)
-register struct pack *pk;
-{
-register struct tty  *tp;
-
-       tp = pk->p_ttyp;
-       if (tp->t_line!=pkdisc || tp->t_linep!=(caddr_t)pk) {
-               return(0);
-       }
-       return(tp->t_state&CARR_ON);
-}
-
-
-
-/*
- * timeout process:
- * wakes up periodically to check status
- * of active lines.
- */
-pktimeout()
-{
-register struct pack *pk;
-extern time_t time;
-register i;
-
-       for(i=0;i<NPLINES;i++) {
-               if ((pk=pklines[i])==NULL)
-                       continue;
-               if (pk->p_nout == pk->p_tout) {
-                       if (pk->p_xcount && pk->p_timer==0) {
-                               pk->p_timer = 3;
-                               pk->p_state |= WAITO;
-                       }
-               } else
-                       pk->p_tout = pk->p_nout;
-               if (pk->p_timer==0) {
-                       if (pk->p_state & BADFRAME) {
-                               pk->p_msg |= M_RJ;
-                               pk->p_state &= ~BADFRAME;
-                               goto startup;
-                       }
-                       if (pk->p_rmsg)
-                               goto startup;
-                       WAKEUP(&pk->p_ps);
-                       continue;
-               }
-               if (--pk->p_timer == 0) {
-                       if ((pk->p_state&LIVE)==0) {
-                       startup:
-                               pk->p_timer = 1;
-                       } else
-                       if (pk->p_state & WAITO) {
-                               if (pk->p_state&DRAINO)  {
-                                       pk->p_state |= DOWN; 
-                               } else {
-                                       pk->p_state |= RXMIT;
-                               }
-                               pkoutput(pk);
-                               pk->p_timer = 5+2*pkzot;
-                       }
-                       WAKEUP(&pk->p_ps);
-                       pk->p_msg |= pk->p_rmsg;
-                       if (pk->p_msg)
-                               pkoutput(pk);
-               }
-       }
-       timeout(pktimeout, (caddr_t)pk, 60);
-
-
-       /*
-        * randomize timeouts.
-        */
-       pkzot = 2 + time&07;
-}
-
-
diff --git a/.ref-Research-V7/usr/sys/dev/pk2.c b/.ref-Research-V7/usr/sys/dev/pk2.c
deleted file mode 100644 (file)
index a8be80c..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-#define        KERNEL  1
-#include "../h/pk.p"
-
-/*
- * input framing and block checking.
- * frame layout for most devices is:
- *     
- *     S|K|X|Y|C|Z|  ... data ... |
- *
- *     where   S       == initial synch byte
- *             K       == encoded frame size (indexes pksizes[])
- *             X, Y    == block check bytes
- *             C       == control byte
- *             Z       == XOR of header (K^X^Y^C)
- *             data    == 0 or more data bytes
- *
- * device driver interfaces on input are:
- *     pkrint  - byte level
- *     pkrend  - dma or pseudo-dma transfer level
- *     pkdata - packet level
- */
-
-int pksizes[] ={
-       1, 32, 64, 128, 256, 512, 1024, 2048, 4096, 1
-};
-
-/*
- * Pseudo-dma byte collection.
- * This code can be put in the device driver
- * interrupt routine to eliminate the per byte
- * subroutine call.
- */
-pkrint(c, tp)
-register c;
-register struct tty *tp;
-{
-
-       if (q1.c_cc<0) {
-               if (q1.c_cf != NULL) {
-                       tp->t_erase = 0;
-                       *q1.c_cf++ = c;
-               }
-               if (++q1.c_cc)
-                       return;
-               pkrend(tp);
-               return;
-       }
-}
-
-
-
-/*
- * End of input transfer.
- */
-pkrend(tp)
-register struct tty *tp;
-{
-register char *p;
-struct pack *pk;
-struct header *h;
-register x;
-char   cntl, hdcheck;
-unsigned short sum;
-int i,j,k;
-char **bp;
-
-       p = q1.c_cl;
-       x = (int)q1.c_cf - (int)p;
-       pk = (struct pack *)tp->t_linep;
-       h = (struct header * )&pk->p_ihbuf;
-       if (x == HDRSIZ) {
-               if (*p++ == SYN ) {
-                       hdcheck = k = *p++;
-                       sum = (unsigned)*p;
-                       hdcheck ^= *p++;
-                       sum |= (unsigned)*p << 8;
-                       hdcheck ^= *p++;
-                       hdcheck ^= cntl = *p++;
-                       if (hdcheck != *p) {
-                               goto bad;
-                       }
-                       if (k == 9) {
-                               pkcntl(cntl, pk);
-                               q1.c_cf = q1.c_cl;
-                               q1.c_cc = -HDRSIZ;
-                               goto istart1;
-                       }
-                       if (k && pksizes[k]==pk->p_rsize) {
-                               pk->p_rpr = cntl&MOD8;
-                               pksack(pk);
-                               bp = pk->p_ipool;
-                               if (bp) {
-                                       pk->p_ipool = (char **)*bp;
-                                       pk->p_io = bp;
-                               } else {
-                               }
-                               q1.c_cf = (char *)bp;
-                               q1.c_cc = -pk->p_rsize;
-                               h->sum = sum;
-                               h->cntl = cntl;
-                               goto istart1;
-                       }
-bad:
-                       pkbadframe(pk);
-               }
-scan:
-               x = HDRSIZ;
-               j = 0;
-               p = (caddr_t)h;
-               for (i = 1; i < HDRSIZ; i++)
-                       if (p[i] == SYN)
-                               for(x=i; i<HDRSIZ; i++,j++)
-                                       p[j] = p[i];
-
-               q1.c_cc = -x;
-               q1.c_cf = (caddr_t)((int)p + j);
-               goto istart2;
-       }
-       if (x == pk->p_rsize) {
-               pkdata(h->cntl, h->sum, pk, q1.c_cl);
-               pk->p_io = NULL;
-               q1.c_cf = (char *)h;
-               q1.c_cc = -HDRSIZ;
-               goto istart1;
-       }
-       if (x == 0) {
-               q1.c_cf = (char *)h;
-               q1.c_cc = -HDRSIZ;
-               pkbadframe(pk);
-       } else {
-               pkbadframe(pk);
-               goto scan;
-       }
-istart1:
-       q1.c_cl = q1.c_cf;
-istart2:
-       if (tp->t_iproc != NULL)
-               (*tp->t_iproc)(tp);
-}
-
-
-
-/*
- * Put packet located at address bp
- * in an input slot for further processing.
- */
-pkdata(c, sum, pk, cp)
-char c;
-unsigned short sum;
-register struct pack *pk;
-char *cp;
-{
-register struct tty *tp;
-register x;
-char **bp;
-int t;
-
-       pk->p_state &= ~BADFRAME;
-       bp = (char **)cp;
-       tp = pk->p_ttyp;
-       if (pk->p_state&DRAINO || !(pk->p_state&LIVE)) {
-               pk->p_msg |= pk->p_rmsg;
-               pkoutput(pk);
-               goto drop;
-       }
-       t = next[pk->p_pr];
-       for(x=pk->p_pr; x!=t; x = (x-1)&7) {
-               if (pk->p_is[x] == 0)
-                       goto slot;
-       }
-       /*
-        * this can't happen
-        */
-       printf("no slot\n");
-drop:
-       *bp = (char *)pk->p_ipool;
-       pk->p_ipool = bp;
-       return;
-
-slot:
-       pk->p_imap |= mask[x];
-       pk->p_is[x] = c;
-       pk->p_isum[x] = sum;
-       pk->p_ib[x] = cp;
-       if (tp->t_chan)
-               sdata(tp->t_chan); else
-               wakeup(&pk->p_pr);
-}
-
-
-/*
- * Start transmission on output device associated with pk.
- * For asynch devices (t_line==1) framing is
- * imposed.  For devices with framing and crc
- * in the driver (t_line==2) the transfer is
- * passed on to the driver.
- */
-pkxstart(pk, cntl, x)
-struct pack *pk;
-char cntl;
-register x;
-{
-struct tty *tp;
-register char *p;
-short checkword;
-char hdcheck;
-
-       p = (caddr_t)&pk->p_ohbuf;
-       tp = pk->p_ttyp;
-
-       if (tp->t_line==1) {
-               *p++ = SYN;
-               if (x < 0) {
-                       *p = 9;
-                       checkword = cntl;
-                       q3.c_cl = NULL;
-               } else {
-                       *p = pk->p_lpsize;
-                       checkword = pk->p_osum[x] ^ (unsigned)cntl;
-                       q3.c_cl = pk->p_ob[x];
-               }
-               checkword = CHECK - checkword;
-               hdcheck = *p++;
-               hdcheck ^= *p++ = checkword;
-               hdcheck ^= *p++ = checkword>>8;
-               q3.c_cc = -HDRSIZ;
-       } else {
-               q3.c_cc = -1;
-       }
-
-       hdcheck ^= *p++ = cntl;
-       *p = hdcheck;
-       q3.c_cf = (caddr_t)&pk->p_ohbuf;
-/*
-       pk->p_srxmit++;
-*/
-       (*tp->t_oproc)(tp);
-}
-
-/*
- * transmitter interrupt.
- */
-int    pkdelay = 2;
-
-pkxint(tp)
-register struct tty *tp;
-{
-register struct pack *pk;
-register s;
-extern int pkoutput();
-
-       pk = (struct pack *)tp->t_linep;
-       s = spl6();
-       tp->t_state &= ~BUSY;
-       if (q3.c_cl == NULL) {
-                       pkoutput(pk);
-       } else {
-               q3.c_cf = q3.c_cl;
-               q3.c_cl = NULL;
-               q3.c_cc = -pk->p_xsize;
-               (*tp->t_oproc)(tp);
-       }
-       splx(s);
-}
-
diff --git a/.ref-Research-V7/usr/sys/dev/pk3.c b/.ref-Research-V7/usr/sys/dev/pk3.c
deleted file mode 100644 (file)
index ac42a35..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-
-#define        XPRI    30
-#define        NBLOCKS 10
-
-int    bwaiting, wcount;
-struct buf *bufps[NBLOCKS];
-char   *nbase[NBLOCKS];        /* normal allocations */
-short  nmap[NBLOCKS];          /* 1 bit == 32 bytes */
-
-char log[] ={0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4};
-#define        FULL    -1
-#define        LOCK    s = spl6()
-#define        UNLOCK  splx(s)
-
-/*
- * getepack: get empty packet
- * with size specified by bitmask.
- */
-char *
-getepack(bits)
-{
-register i;
-int    s, savbits;
-char   **base;
-short  *map;
-
-       base = nbase; map = nmap;
-       savbits = bits;
-
-       /*
-        * search for space
-        */
-       LOCK;
-       for(;;) {
-
-               if (bits == FULL)
-                       goto force;
-
-               for(i=0; i<NBLOCKS; i++) {
-                       register m;
-                       register unsigned n;
-                       register offset;
-
-                       m = map[i];
-                       if (m==FULL || base[i]==NULL)
-                               continue;
-                       if (bits == 1) {
-                               n = m;
-                               m |= m+1;
-                               n = m-n;
-                               for (offset=0; n > 16; n >>= 4) 
-                                       offset += 4;
-                               offset += log[n];
-                       } else {
-                               bits = savbits;
-                               for(n=17; --n; bits <<= 1)
-                                       if ((m&bits)==0)
-                                               goto found;
-                               continue;
-                       found:
-                               offset = 16-n;
-                               m |= bits;
-                       }
-                       map[i] = m;
-                       UNLOCK;
-                       return(base[i] + 32*offset);
-               }
-               /*
-                * grab another block from the system
-                */
-       force:
-               for(i=0;i<NBLOCKS;i++) {
-                       register struct buf *bp;
-
-                       if (bufps[i]!=NULL)
-                               continue;
-                       bufps[i] = bp = geteblk();
-                       bp->b_flags |= B_PACK;
-                       bp->b_flags |= B_PBUSY;
-                       map[i] = bits;
-                       base[i] = bp->b_un.b_addr;
-                       UNLOCK;
-                       return(bp->b_un.b_addr);
-               }
-               /*
-                * sleep until something is released
-                */
-               bwaiting++;
-               wcount++;
-               sleep((caddr_t)&bwaiting, XPRI);
-               bwaiting--;
-       }
-}
-
-/*
- * freepack: release space beginning
- * at address p with length specified
- * by bits.
- */
-freepack(p, bits)
-char *p;
-{
-register i, d, s;
-char   **base;
-short  *map;
-
-       if (p==NULL)
-               return;
-       LOCK;
-       base = nbase; map = nmap;
-
-       for(i=0;i<NBLOCKS;i++) {
-               d = p-base[i];
-               if (d>=0 && d<=512) 
-                       goto found;
-       }
-       goto out;
-found:
-       d >>= 5;
-       d = (bits<<d);
-       map[i] &= ~d;
-       if (map[i]==0) {
-               register struct buf *bp;
-
-               bp = bufps[i];
-               bp->b_flags &= ~B_PBUSY;
-               base[i] = NULL;
-               bufps[i] = NULL;
-               brelse(bp);
-       }
-       if (bwaiting)
-               wakeup((caddr_t)&bwaiting);
-out:
-       splx(s);
-}
-
-
-
-/*
- * integer to bitmap conversion
- */
-dtom(d)
-register d;
-{
-register m;
-
-       m = 1;
-       while (d>32) {
-               d -= 32;
-               m |= m+1;
-       }
-       return(m);
-}
-
-#define NRECS  160
-int reclist[NRECS];
-int recbits[NRECS];
-
diff --git a/.ref-Research-V7/usr/sys/dev/rf.c b/.ref-Research-V7/usr/sys/dev/rf.c
deleted file mode 100644 (file)
index ba06765..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#
-/*
- * RF disk driver
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-
-struct device {
-       int     rfcs;
-       int     rfwc;
-       char    *rfba;
-       int     rfda;
-       int     rfdae;
-};
-
-struct buf     rftab;
-struct buf     rrfbuf;
-
-#define        NRFBLK  1024
-#define RFADDR ((struct device *)0177460)
-
-#define        GO      01
-#define        RCOM    04
-#define        WCOM    02
-#define        CTLCLR  0400
-#define        IENABLE 0100
-
-/*
- * Monitoring device number
- */
-#define        DK_N    0
-
-rfstrategy(bp)
-register struct buf *bp;
-{
-       if(bp->b_flags&B_PHYS)
-               mapalloc(bp);
-       if (bp->b_blkno >= NRFBLK*(minor(bp->b_dev)+1)) {
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               return;
-       }
-       bp->av_forw = 0;
-       spl5();
-       if (rftab.b_actf == NULL)
-               rftab.b_actf = bp;
-       else
-               rftab.b_actl->av_forw = bp;
-       rftab.b_actl = bp;
-       if (rftab.b_active == NULL)
-               rfstart();
-       spl0();
-}
-
-rfstart()
-{
-       register struct buf *bp;
-       register int com;
-
-       if ((bp = rftab.b_actf) == NULL)
-               return;
-       rftab.b_active++;
-       RFADDR->rfda = (int)(bp->b_blkno<<8)&0177777;
-       RFADDR->rfdae = (int)(bp->b_blkno>>8)&037;
-       RFADDR->rfba = bp->b_un.b_addr;
-       RFADDR->rfwc = -(bp->b_bcount>>1);
-       com = (bp->b_xmem&3) << 4;
-       com |= (bp->b_flags & B_READ) ? RCOM+GO+IENABLE : WCOM+GO+IENABLE;
-       RFADDR->rfcs = com;
-       dk_busy |= 1<<DK_N;
-       dk_numb[DK_N] += 1;
-       com = (-bp->b_bcount>>5) & 03777;
-       dk_wds[DK_N] += com;
-}
-
-rfintr()
-{
-       register struct buf *bp;
-
-       if (rftab.b_active == NULL)
-               return;
-       dk_busy &= ~(1<<DK_N);
-       bp = rftab.b_actf;
-       rftab.b_active = NULL;
-       if (RFADDR->rfcs < 0) {         /* error bit */
-               deverror(bp, RFADDR->rfcs, RFADDR->rfdae);
-               RFADDR->rfcs = CTLCLR;
-               if (++rftab.b_errcnt <= 10) {
-                       rfstart();
-                       return;
-               }
-               bp->b_flags |= B_ERROR;
-       }
-       rftab.b_errcnt = 0;
-       rftab.b_actf = bp->av_forw;
-       bp->b_resid = 0;
-       iodone(bp);
-       rfstart();
-}
-
-rfread(dev)
-{
-
-       physio(rfstrategy, &rrfbuf, dev, B_READ);
-}
-
-rfwrite(dev)
-{
-
-       physio(rfstrategy, &rrfbuf, dev, B_WRITE);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/rk.c b/.ref-Research-V7/usr/sys/dev/rk.c
deleted file mode 100644 (file)
index 608eb6f..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * RK disk driver
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-#include       "../h/dir.h"
-#include "../h/user.h"
-
-#define        RKADDR  ((struct device *)0177400)
-#define        NRK     4
-#define        NRKBLK  4872
-
-#define        RESET   0
-#define        WCOM    2
-#define        RCOM    4
-#define        GO      01
-#define        DRESET  014
-#define        IENABLE 0100
-#define        DRY     0200
-#define        ARDY    0100
-#define        WLO     020000
-#define        CTLRDY  0200
-
-/*
- * Monitoring device bit
- */
-#define        DK_N    1
-
-struct device
-{
-       int     rkds;
-       int     rker;
-       int     rkcs;
-       int     rkwc;
-       caddr_t rkba;
-       int     rkda;
-};
-
-struct buf     rktab;
-struct buf     rrkbuf;
-
-rkstrategy(bp)
-register struct buf *bp;
-{
-
-       if(bp->b_flags&B_PHYS)
-               mapalloc(bp);
-       if (bp->b_blkno >= NRKBLK) {
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               return;
-       }
-       bp->av_forw = (struct buf *)NULL;
-       spl5();
-       if(rktab.b_actf == NULL)
-               rktab.b_actf = bp;
-       else
-               rktab.b_actl->av_forw = bp;
-       rktab.b_actl = bp;
-       if(rktab.b_active == NULL)
-               rkstart();
-       spl0();
-}
-
-rkstart()
-{
-       register struct buf *bp;
-       register com;
-       daddr_t bn;
-       int dn, cn, sn;
-
-       if ((bp = rktab.b_actf) == NULL)
-               return;
-       rktab.b_active++;
-       bn = bp->b_blkno;
-       dn = minor(bp->b_dev);
-       cn = bn/12;
-       sn = bn%12;
-       RKADDR->rkda = (dn<<13) | (cn<<4) | sn;
-       RKADDR->rkba = bp->b_un.b_addr;
-       RKADDR->rkwc = -(bp->b_bcount>>1);
-       com = ((bp->b_xmem&3) << 4) | IENABLE | GO;
-       if(bp->b_flags & B_READ)
-               com |= RCOM; else
-               com |= WCOM;
-       RKADDR->rkcs = com;
-       dk_busy |= 1<<DK_N;
-       dk_numb[DK_N] += 1;
-       com = bp->b_bcount>>6;
-       dk_wds[DK_N] += com;
-}
-
-rkintr()
-{
-       register struct buf *bp;
-
-       if (rktab.b_active == NULL)
-               return;
-       dk_busy &= ~(1<<DK_N);
-       bp = rktab.b_actf;
-       rktab.b_active = NULL;
-       if (RKADDR->rkcs < 0) {         /* error bit */
-               deverror(bp, RKADDR->rker, RKADDR->rkds);
-               RKADDR->rkcs = RESET|GO;
-               while((RKADDR->rkcs&CTLRDY) == 0)
-                       ;
-               if (++rktab.b_errcnt <= 10) {
-                       rkstart();
-                       return;
-               }
-               bp->b_flags |= B_ERROR;
-       }
-       rktab.b_errcnt = 0;
-       rktab.b_actf = bp->av_forw;
-       bp->b_resid = 0;
-       iodone(bp);
-       rkstart();
-}
-
-rkread(dev)
-dev_t dev;
-{
-
-       physio(rkstrategy, &rrkbuf, dev, B_READ);
-}
-
-rkwrite(dev)
-dev_t dev;
-{
-
-       physio(rkstrategy, &rrkbuf, dev, B_WRITE);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/rl.c b/.ref-Research-V7/usr/sys/dev/rl.c
deleted file mode 100644 (file)
index 86fd81e..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *  RL disk driver
- */
-
-#define DK_N   2
-#include "../h/param.h"
-#include "../h/buf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/systm.h"
-
-#define NRLBLK 10240
-#define RLCYLSZ 10240
-#define RLSECSZ 256
-
-#define RESET 013
-#define STAT 03
-#define GETSTAT 04
-#define WCOM 012
-#define RCOM 014
-#define SEEK 06
-#define SEEKHI 5
-#define SEEKLO 1
-#define RDHDR 010
-#define IENABLE 0100
-#define CRDY 0200
-#define OPI 02000
-#define CRCERR 04000
-#define TIMOUT 010000
-#define NXM 020000
-#define DE  040000
-
-struct device
-{
-       int rlcs, rlba, rlda, rlmp;
-};
-
-#define RLADDR ((struct device *)0174400)
-#define RL_CNT 1
-struct buf     rrlbuf;
-struct buf     rltab;
-
-struct 
-{
-       int     cn[4];          /* location of heads for each drive */
-       int     dn;             /* drive number */
-       int     com;            /* read or write command word */
-       int     chn;            /* cylinder and head number */
-       unsigned int    bleft;  /* bytes left to be transferred */
-       unsigned int    bpart;  /* number of bytes transferred */
-       int     sn;             /* sector number */
-       union {
-               int     w[2];
-               long    l;
-       } addr;                 /* address of memory for transfer */
-
-}      rl = {-1,-1,-1,-1};
-
-rlstrategy(bp)
-register struct buf *bp;
-{
-       if(bp->b_blkno >= NRLBLK) {
-               if(bp->b_blkno == NRLBLK && bp->b_flags&B_READ)
-                       bp->b_resid = bp->b_bcount;
-               else {
-                       bp->b_flags |= B_ERROR;
-                       bp->b_error = ENXIO;
-               }
-               iodone(bp);
-               return;
-       }
-       bp->av_forw = NULL;
-       spl5();
-       if(rltab.b_actf == NULL)
-               rltab.b_actf = bp;
-       else
-               rltab.b_actl->av_forw = bp;
-       rltab.b_actl = bp;
-       if(rltab.b_active == NULL)
-               rlstart();
-       spl0();
-}
-
-rlstart()
-{
-
-       register struct buf *bp;
-
-       if ((bp = rltab.b_actf) == NULL)
-               return;
-       rltab.b_active++;
-       rl.dn = minor(bp->b_dev);
-       rl.chn = bp->b_blkno/20;
-       rl.sn = (bp->b_blkno%20) << 1;
-       rl.bleft = bp->b_bcount;
-       rl.addr.w[0] = bp->b_xmem & 3;
-       rl.addr.w[1] = (int)bp->b_un.b_addr;
-       rl.com = (rl.dn << 8) | IENABLE;
-       if (bp->b_flags & B_READ)
-               rl.com |= RCOM;
-       else
-               rl.com |= WCOM;
-       rlio();
-}
-
-rlintr()
-{
-       register struct buf *bp;
-       register struct device *rp;
-       register int status;
-
-       rp = RLADDR;
-       if (rltab.b_active == NULL) {
-/*
-               logstray(rp);
-*/
-               return;
-       }
-       bp = rltab.b_actf;
-       dk_busy &= ~(1<<DK_N);
-       if (rp->rlcs < 0) {             /* error bit */
-               if (rp->rlcs & 036000) {
-                       if(rltab.b_errcnt > 2)
-                               deverror(bp, rp->rlcs, rp->rlda);
-               }
-               if (rp->rlcs & 040000) {
-                       rp->rlda = STAT;
-                       rp->rlcs = (rl.dn << 8) | GETSTAT;
-                       while ((rp->rlcs & CRDY) == 0)
-                               ;
-                       status = rp->rlmp;
-                       if(rltab.b_errcnt > 2)
-                               deverror(bp, status, rp->rlda);
-                       rp->rlda = RESET;
-                       rp->rlcs = (rl.dn << 8) | GETSTAT;
-                       while ((rp->rlcs & CRDY) == 0)
-                               ;
-                       if(status & 01000) {
-                               rlstart();
-                               return;
-                       }
-               }
-               if (++rltab.b_errcnt <= 10) {
-                       rl.cn[rl.dn] = -1;
-                       rlstart();
-                       return;
-               }
-               else {
-                       bp->b_flags |= B_ERROR;
-                       rl.bpart = rl.bleft;
-               }
-       }
-
-       if ((rl.bleft -= rl.bpart) > 0) {
-               rl.addr.l += rl.bpart;
-               rl.sn=0;
-               rl.chn++;
-               rlio();
-               return;
-       }
-       rltab.b_active = NULL;
-       rltab.b_errcnt = 0;
-       rltab.b_actf = bp->av_forw;
-       bp->b_resid = 0;
-       iodone(bp);
-       rlstart();
-}
-
-rlio()
-{
-
-       register struct device *rp;
-       register dif;
-       register int head;
-
-       rp = RLADDR;
-       dk_busy |= 1<<DK_N;
-       dk_numb[DK_N] += 1;
-       head = rl.bpart>>6;
-       dk_wds[DK_N] += head;
-       if (rl.cn[rl.dn] < 0) {
-               rp->rlcs = (rl.dn << 8) | RDHDR;
-               while ((rp->rlcs&CRDY) == 0)
-                       ;
-               rl.cn[rl.dn] = (rp->rlmp&077700) >> 6;
-       }
-       dif =(rl.cn[rl.dn] >> 1) - (rl.chn >>1);
-       head = (rl.chn & 1) << 4;
-       if (dif < 0)
-               rp->rlda = (-dif <<7) | SEEKHI | head;
-       else
-               rp->rlda = (dif << 7) | SEEKLO | head;
-       rp->rlcs = (rl.dn << 8) | SEEK;
-       rl.cn[rl.dn] = rl.chn;
-       if (rl.bleft < (rl.bpart = RLCYLSZ - (rl.sn * RLSECSZ)))
-               rl.bpart = rl.bleft;
-       while ((rp->rlcs&CRDY) == 0)
-               ;
-       rp->rlda = (rl.chn << 6) | rl.sn;
-       rp->rlba = rl.addr.w[1];
-       rp->rlmp = -(rl.bpart >> 1);
-       rp->rlcs = rl.com | rl.addr.w[0] << 4;
-}
-
-rlread(dev)
-{
-
-       physio(rlstrategy, &rrlbuf, dev, B_READ);
-}
-
-rlwrite(dev)
-{
-
-       physio(rlstrategy, &rrlbuf, dev, B_WRITE);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/rp.c b/.ref-Research-V7/usr/sys/dev/rp.c
deleted file mode 100644 (file)
index 0890f9f..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-/*
- * RP disk driver
- */
-
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/buf.h"
-#include "../h/dir.h"
-#include "../h/conf.h"
-#include "../h/user.h"
-
-struct device {
-       int     rpds;
-       int     rper;
-       union {
-               int     w;
-               char    c;
-       } rpcs;
-       int     rpwc;
-       char    *rpba;
-       int     rpca;
-       int     rpda;
-};
-
-#define RPADDR ((struct device *) 0176710)
-#define        NRP     8
-
-struct {
-       daddr_t nblocks;
-       int     cyloff;
-} rp_sizes[] = {
-       81000,  0,              /* cyl 0 thru 405 */
-       5000,   0,              /* cyl 0 thru 24 */
-       2000,   25,             /* cyl 25 thru 34 */
-       74000,  35,             /* cyl 35 thru 405 */
-       0,      0,
-       0,      0,
-       0,      0,
-       0,      0,
-};
-
-struct buf     rptab;
-struct buf     rrpbuf;
-
-#define        GO      01
-#define        RESET   0
-#define        HSEEK   014
-
-#define        IENABLE 0100
-#define        READY   0200
-#define        RCOM    4
-#define        WCOM    2
-
-#define        SUFU    01000
-#define        SUSU    02000
-#define        SUSI    04000
-#define        HNF     010000
-
-/*
- * Use av_back to save track+sector,
- * b_resid for cylinder.
- */
-
-#define        trksec  av_back
-#define        cylin   b_resid
-
-/*
- * Monitoring device number
- */
-#define        DK_N    2
-
-rpstrategy(bp)
-register struct buf *bp;
-{
-       register struct buf *dp;
-       register int unit;
-       long sz;
-
-       unit = minor(bp->b_dev);
-       sz = bp->b_bcount;
-       sz = (sz+511)>>9;
-       if (unit >= (NRP<<3) ||
-          bp->b_blkno+sz >= rp_sizes[unit&07].nblocks) {
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               return;
-       }
-       bp->av_forw = NULL;
-       unit >>= 3;
-       spl5();
-       dp = & rptab;
-       if (dp->b_actf == NULL)
-               dp->b_actf = bp;
-       else
-               dp->b_actl->av_forw = bp;
-       dp->b_actl = bp;
-       if (dp->b_active == NULL)
-               rpstart();
-       spl0();
-}
-
-rpstart()
-{
-       register struct buf *bp;
-       register int unit;
-       int com,cn,tn,sn,dn;
-       daddr_t bn;
-
-
-       if ((bp = rptab.b_actf) == NULL)
-               return;
-       rptab.b_active++;
-       unit = minor(bp->b_dev);
-       dn = unit>>3;
-       bn = bp->b_blkno;
-       cn = bn/(20*10) + rp_sizes[unit&07].cyloff;
-       sn = bn%(20*10);
-       tn = sn/10;
-       sn = sn%10;
-       RPADDR->rpcs.w = (dn<<8);
-       RPADDR->rpda = (tn<<8) | sn;
-       RPADDR->rpca = cn;
-       RPADDR->rpba = bp->b_un.b_addr;
-       RPADDR->rpwc = -(bp->b_bcount>>1);
-       com = ((bp->b_xmem&3)<<4) | IENABLE | GO;
-       if (bp->b_flags & B_READ)
-               com |= RCOM; else
-               com |= WCOM;
-       
-       RPADDR->rpcs.w |= com;
-       dk_busy |= 1<<DK_N;
-       dk_numb[DK_N] += 1;
-       unit = bp->b_bcount>>6;
-       dk_wds[DK_N] += unit;
-}
-
-rpintr()
-{
-       register struct buf *bp;
-       register int ctr;
-
-       if (rptab.b_active == NULL)
-               return;
-       dk_busy &= ~(1<<DK_N);
-       bp = rptab.b_actf;
-       rptab.b_active = NULL;
-       if (RPADDR->rpcs.w < 0) {               /* error bit */
-               deverror(bp, RPADDR->rper, RPADDR->rpds);
-               if(RPADDR->rpds & (SUFU|SUSI|HNF)) {
-                       RPADDR->rpcs.c = HSEEK|GO;
-                       ctr = 0;
-                       while ((RPADDR->rpds&SUSU) && --ctr)
-                               ;
-               }
-               RPADDR->rpcs.w = RESET|GO;
-               ctr = 0;
-               while ((RPADDR->rpcs.w&READY) == 0 && --ctr)
-                       ;
-               if (++rptab.b_errcnt <= 10) {
-                       rpstart();
-                       return;
-               }
-               bp->b_flags |= B_ERROR;
-       }
-       rptab.b_errcnt = 0;
-       rptab.b_actf = bp->av_forw;
-       bp->b_resid = 0;
-       iodone(bp);
-       rpstart();
-}
-
-rpread(dev)
-{
-
-       physio(rpstrategy, &rrpbuf, dev, B_READ);
-}
-
-rpwrite(dev)
-{
-
-       physio(rpstrategy, &rrpbuf, dev, B_WRITE);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/sys.c b/.ref-Research-V7/usr/sys/dev/sys.c
deleted file mode 100644 (file)
index 80c77f9..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *     indirect driver for controlling tty.
- */
-#include "../h/param.h"
-#include "../h/conf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-#include "../h/proc.h"
-
-syopen(dev, flag)
-{
-
-       if(u.u_ttyp == NULL) {
-               u.u_error = ENXIO;
-               return;
-       }
-       (*cdevsw[major(u.u_ttyd)].d_open)(u.u_ttyd, flag);
-}
-
-syread(dev)
-{
-
-       (*cdevsw[major(u.u_ttyd)].d_read)(u.u_ttyd);
-}
-
-sywrite(dev)
-{
-
-       (*cdevsw[major(u.u_ttyd)].d_write)(u.u_ttyd);
-}
-
-sysioctl(dev, cmd, addr, flag)
-caddr_t addr;
-{
-
-       (*cdevsw[major(u.u_ttyd)].d_ioctl)(u.u_ttyd, cmd, addr, flag);
-}
diff --git a/.ref-Research-V7/usr/sys/dev/tc.c b/.ref-Research-V7/usr/sys/dev/tc.c
deleted file mode 100644 (file)
index a234666..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#
-
-/*
- * TC-11 DECtape driver
- */
-
-#include "../h/param.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-
-struct device {
-       int     tccsr;
-       union wb {
-               int     w;
-               char    b[2];
-       } tccm;
-       int     tcwc;
-       int     tcba;
-       int     tcdt;
-};
-
-struct buf     tctab;
-char   tcper[8];
-
-#define        TCADDR  ((struct device *) 0177340)
-#define        NTCBLK  578
-
-#define        TAPERR  0100000
-#define        TREV    04000
-#define        READY   0200
-#define        IENABLE 0100
-#define        UPS     0200
-#define        ENDZ    0100000
-#define        BLKM    02000
-#define        ILGOP   010000
-#define        SELERR  04000
-
-#define        SAT     0
-#define        RNUM    02
-#define        RDATA   04
-#define        SST     010
-#define        WDATA   014
-#define        GO      01
-
-#define        SFORW   1
-#define        SREV    2
-#define        SIO     3
-
-tcclose(dev)
-{
-       bflush(dev);
-       tcper[dev&07] = 0;
-}
-
-tcstrategy(bp)
-register struct buf *bp;
-{
-
-       if(bp->b_flags&B_PHYS)
-               mapalloc(bp);
-       bp->b_resid = 0;
-       if(bp->b_blkno >= NTCBLK || tcper[minor(bp->b_dev)&07]) {
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               return;
-       }
-       bp->av_forw = 0;
-       spl6();
-       if (tctab.b_actf==0)
-               tctab.b_actf = bp;
-       else
-               tctab.b_actl->av_forw = bp;
-       tctab.b_actl = bp;
-       if (tctab.b_active==0)
-               tcstart();
-       spl0();
-}
-
-tcstart()
-{
-       register struct buf *bp;
-       register int com;
-       register union wb *tccmp;
-
-loop:
-       tccmp = &TCADDR->tccm;
-       if ((bp = tctab.b_actf) == 0)
-               return;
-       if(tcper[minor(bp->b_dev)&07]) {
-               if((tctab.b_actf = bp->av_forw) == 0)
-                       tccmp->b[0] = SAT|GO;
-               bp->b_flags |= B_ERROR;
-               iodone(bp);
-               goto loop;
-       }
-       if ((tccmp->b[1]&07) != minor(bp->b_dev))
-               tccmp->b[0] = SAT|GO;
-       tctab.b_errcnt = 20;
-       tctab.b_active = SFORW;
-       com = (minor(bp->b_dev)<<8) | IENABLE|RNUM|GO;
-       if ((TCADDR->tccsr & UPS) == 0) {
-               com |= TREV;
-               tctab.b_active = SREV;
-       }
-       tccmp->w = com;
-}
-
-tcintr()
-{
-       register struct buf *bp;
-       register union wb *tccmp;
-       register int *tcdtp;
-
-       tccmp = &TCADDR->tccm;
-       tcdtp = &TCADDR->tccsr;
-       bp = tctab.b_actf;
-       if (tccmp->w&TAPERR) {
-               if((*tcdtp&(ENDZ|BLKM)) == 0)
-                       deverror(bp, *tcdtp, 0);
-               if(*tcdtp & (ILGOP|SELERR)) {
-                       tcper[bp->b_dev&07]++;
-                       tctab.b_errcnt = 0;
-               }
-               tccmp->w &= ~TAPERR;
-               if (--tctab.b_errcnt == 0) {
-                       bp->b_flags |= B_ERROR;
-                       goto done;
-               }
-               if (tccmp->w&TREV) {
-               setforw:
-                       tctab.b_active = SFORW;
-                       tccmp->w &= ~TREV;
-               } else {
-               setback:
-                       tctab.b_active = SREV;
-                       tccmp->w |= TREV;
-               }
-               tccmp->b[0] = IENABLE|RNUM|GO;
-               return;
-       }
-       tcdtp = &TCADDR->tcdt;
-       switch (tctab.b_active) {
-
-       case SIO:
-       done:
-               tctab.b_active = 0;
-               if (tctab.b_actf = bp->av_forw)
-                       tcstart();
-               else
-                       TCADDR->tccm.b[0] = SAT|GO;
-               iodone(bp);
-               return;
-
-       case SFORW:
-               if (*tcdtp > bp->b_blkno)
-                       goto setback;
-               if (*tcdtp < bp->b_blkno)
-                       goto setforw;
-               *--tcdtp = (int)bp->b_un.b_addr;        /* core address */
-               *--tcdtp = -(bp->b_bcount>>1);
-               tccmp->b[0] = ((bp->b_xmem & 03) << 4) | IENABLE|GO
-                   | (bp->b_flags&B_READ?RDATA:WDATA);
-               tctab.b_active = SIO;
-               return;
-
-       case SREV:
-               if (*tcdtp+3 > bp->b_blkno)
-                       goto setback;
-               goto setforw;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/tm.c b/.ref-Research-V7/usr/sys/dev/tm.c
deleted file mode 100644 (file)
index 5901137..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-#
-
-/*
- * TM tape driver
- */
-
-#include "../h/param.h"
-#include "../h/buf.h"
-#include "../h/dir.h"
-#include "../h/conf.h"
-#include "../h/file.h"
-#include "../h/user.h"
-
-struct device {
-       int     tmer;
-       int     tmcs;
-       int     tmbc;
-       char    *tmba;
-       int     tmdb;
-       int     tmrd;
-};
-
-struct buf     tmtab;
-struct buf     ctmbuf;
-struct buf     rtmbuf;
-
-char   t_flags[8];
-char   t_openf[8];
-daddr_t        t_blkno[8];
-daddr_t        t_nxrec[8];
-
-#define        TMADDR ((struct device *)0172520)
-
-#define        GO      01
-#define        RCOM    02
-#define        WCOM    04
-#define        WEOF    06
-#define        NOP     0100
-#define        SFORW   010
-#define        SREV    012
-#define        WIRG    014
-#define        REW     016
-#define        DENS    060000          /* 9-channel */
-#define        IENABLE 0100
-#define        CRDY    0200
-#define GAPSD  010000
-#define        TUR     1
-#define        HARD    0102200 /* ILC, EOT, NXM */
-#define RLE    0100
-#define        EOF     0040000
-#define        WL      04
-
-#define        SSEEK   1
-#define        SIO     2
-#define        SCOM    3
-
-#define T_WRITTEN 1
-
-tmopen(dev, flag)
-{
-       register unit, ds;
-
-       unit = minor(dev) & 0177;
-       if (t_openf[unit]) {
-               u.u_error = ENXIO;
-               return;
-       }
-       t_blkno[unit] = 0;
-       t_nxrec[unit] = 65535;
-       t_flags[unit] = 0;
-
-       tmtab.b_flags |= B_TAPE;
-       ds = tcommand(dev, NOP);
-       if ((ds&TUR)==0) {
-               printf("mt%d off line\n",unit);
-               u.u_error = ENXIO;
-       }
-       if (flag && ds&WL) {
-               printf("mt%d needs write ring\n",unit);
-               u.u_error = ENXIO;
-       }
-       if (u.u_error==0)
-               t_openf[unit]++;
-}
-
-tmclose(dev, flag)
-dev_t dev;
-int flag;
-{
-
-       if ( flag == FWRITE ||
-       ((flag&FWRITE) && (t_flags[minor(dev)&0177]&T_WRITTEN))) {
-               tcommand(dev, WEOF);
-               tcommand(dev, WEOF);
-               tcommand(dev, SREV);
-       }
-       if ((minor(dev)&0200) == 0)
-               tcommand(dev, REW);
-       t_openf[minor(dev)&077] = 0;
-}
-
-tcommand(dev, com)
-{
-       register struct buf *bp;
-
-       bp = &ctmbuf;
-       spl5();
-       while (bp->b_flags&B_BUSY) {
-               bp->b_flags |= B_WANTED;
-               sleep((caddr_t)bp, PRIBIO);
-       }
-       bp->b_flags = B_BUSY|B_READ;
-       spl0();
-       bp->b_dev = dev;
-       bp->b_resid = com;
-       bp->b_blkno = 0;
-       tmstrategy(bp);
-       iowait(bp);
-       if (bp->b_flags&B_WANTED)
-               wakeup((caddr_t)bp);
-       bp->b_flags = 0;
-       return(bp->b_resid);
-}
-
-tmstrategy(bp)
-register struct buf *bp;
-{
-       register daddr_t *p;
-
-       if(bp->b_flags&B_PHYS)
-               mapalloc(bp);
-       if (bp != &ctmbuf) {
-               p = &t_nxrec[minor(bp->b_dev)&0177];
-               if (*p <= bp->b_blkno) {
-                       if (*p < bp->b_blkno) {
-                               bp->b_flags |= B_ERROR;
-                               iodone(bp);
-                               return;
-                       }
-                       if (bp->b_flags&B_READ) {
-                               clrbuf(bp);
-                               bp->b_resid = 0;
-                               iodone(bp);
-                               return;
-                       }
-               }
-               if ((bp->b_flags&B_READ) == 0) {
-                       t_flags[minor(bp->b_dev)&0177] |= T_WRITTEN;
-                       *p = bp->b_blkno+1;
-               }
-       }
-       bp->av_forw = 0;
-       spl5();
-       if (tmtab.b_actf == NULL)
-               tmtab.b_actf = bp;
-       else
-               tmtab.b_actl->av_forw = bp;
-       tmtab.b_actl = bp;
-       if (tmtab.b_active == NULL)
-               tmstart();
-       spl0();
-}
-
-tmstart()
-{
-       register struct buf *bp;
-       register int com;
-       int unit;
-       register daddr_t *blkno;
-
-    loop:
-       if ((bp = tmtab.b_actf) == 0)
-               return;
-       unit = minor(bp->b_dev)&0177;
-       blkno = &t_blkno[unit];
-       if (t_openf[unit] < 0 || (TMADDR->tmcs & CRDY) == NULL) {
-               bp->b_flags |= B_ERROR;
-               goto next;
-       }
-       if (bp == &ctmbuf) {
-               if (bp->b_resid == NOP) {
-                       bp->b_resid = TMADDR->tmer;
-                       goto next;
-               }
-               tmtab.b_active = SCOM;
-               TMADDR->tmcs = DENS|bp->b_resid|GO| (unit<<8) | IENABLE;
-               return;
-       }
-       com = (unit<<8) | ((bp->b_xmem & 03) << 4) | IENABLE|DENS;
-       if (*blkno != bp->b_blkno) {
-               tmtab.b_active = SSEEK;
-               if (*blkno < bp->b_blkno) {
-                       com |= SFORW|GO;
-                       TMADDR->tmbc = *blkno - bp->b_blkno;
-               } else {
-                       if (bp->b_blkno == 0)
-                               com |= REW|GO;
-                       else {
-                               com |= SREV|GO;
-                               TMADDR->tmbc = bp->b_blkno - *blkno;
-                       }
-               }
-               TMADDR->tmcs = com;
-               return;
-       }
-       tmtab.b_active = SIO;
-       TMADDR->tmbc = -bp->b_bcount;
-       TMADDR->tmba = bp->b_un.b_addr;
-       TMADDR->tmcs = com | ((bp->b_flags&B_READ)? RCOM|GO:
-           ((tmtab.b_errcnt)? WIRG|GO: WCOM|GO));
-       return;
-
-next:
-       tmtab.b_actf = bp->av_forw;
-       iodone(bp);
-       goto loop;
-}
-
-tmintr()
-{
-       register struct buf *bp;
-       register int unit;
-       int     state;
-
-       if ((bp = tmtab.b_actf) == NULL)
-               return;
-       unit = minor(bp->b_dev)&0177;
-       state = tmtab.b_active;
-       tmtab.b_active = 0;
-       if (TMADDR->tmcs < 0) {         /* error bit */
-               while(TMADDR->tmrd & GAPSD) ; /* wait for gap shutdown */
-               if (TMADDR->tmer&EOF) {
-                       t_nxrec[unit] = bp->b_blkno;
-                       state = SCOM;
-                       TMADDR->tmbc = -bp->b_bcount;
-                       goto out;
-               }
-               if ((TMADDR->tmer&HARD) == 0 && TMADDR->tmer&RLE) {
-                       state = SIO;
-                       goto out;
-               }
-               if ((TMADDR->tmer&(HARD|EOF)) == NULL && state==SIO) {
-                       if (++tmtab.b_errcnt < 2) {
-                               t_blkno[unit]++;
-                               tmtab.b_active = 0;
-                               tmstart();
-                               return;
-                       }
-               } else
-                       if (t_openf[unit]>0 && bp!=&rtmbuf &&
-                               (TMADDR->tmer&EOF)==0 ) {
-                               t_openf[unit] = -1;
-                               deverror(bp, TMADDR->tmer, 0);
-                       }
-               bp->b_flags |= B_ERROR;
-               state = SIO;
-       }
-out:
-       switch ( state ) {
-       case SIO:
-               t_blkno[unit] += (bp->b_bcount>>BSHIFT);
-       case SCOM:
-               tmtab.b_errcnt = 0;
-               tmtab.b_actf = bp->av_forw;
-               bp->b_resid = -TMADDR->tmbc;
-               iodone(bp);
-               break;
-       case SSEEK:
-               t_blkno[unit] = bp->b_blkno;
-               break;
-       default:
-               return;
-       }
-       tmstart();
-}
-
-tmread(dev)
-{
-       tmphys(dev);
-       physio(tmstrategy, &rtmbuf, dev, B_READ);
-}
-
-tmwrite(dev)
-{
-       tmphys(dev);
-       physio(tmstrategy, &rtmbuf, dev, B_WRITE);
-}
-
-tmphys(dev)
-{
-       register unit;
-       daddr_t a;
-
-       unit = minor(dev) & 0177;
-       if(unit < 8) {
-               a = u.u_offset >> 9;
-               t_blkno[unit] = a;
-               t_nxrec[unit] = a+1;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/dev/tty.c b/.ref-Research-V7/usr/sys/dev/tty.c
deleted file mode 100644 (file)
index e48f3f0..0000000
+++ /dev/null
@@ -1,728 +0,0 @@
-#
-/*
- * general TTY subroutines
- */
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-#include "../h/proc.h"
-#include "../h/mx.h"
-#include "../h/inode.h"
-#include "../h/file.h"
-#include "../h/reg.h"
-#include "../h/conf.h"
-
-char   partab[];
-
-
-/*
- * Input mapping table-- if an entry is non-zero, when the
- * corresponding character is typed preceded by "\" the escape
- * sequence is replaced by the table value.  Mostly used for
- * upper-case only terminals.
- */
-
-char   maptab[] ={
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,'|',000,000,000,000,000,'`',
-       '{','}',000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,000,000,
-       000,000,000,000,000,000,'~',000,
-       000,'A','B','C','D','E','F','G',
-       'H','I','J','K','L','M','N','O',
-       'P','Q','R','S','T','U','V','W',
-       'X','Y','Z',000,000,000,000,000,
-};
-
-
-/*
- * shorthand
- */
-#define        q1      tp->t_rawq
-#define        q2      tp->t_canq
-#define        q3      tp->t_outq
-#define        q4      tp->t_un.t_ctlq
-
-
-/*
- * routine called on first teletype open.
- * establishes a process group for distribution
- * of quits and interrupts from the tty.
- */
-ttyopen(dev, tp)
-dev_t dev;
-register struct tty *tp;
-{
-       register struct proc *pp;
-
-       pp = u.u_procp;
-       tp->t_dev = dev;
-       if(pp->p_pgrp == 0) {
-               u.u_ttyp = tp;
-               u.u_ttyd = dev;
-               if (tp->t_pgrp==0)
-                       tp->t_pgrp = pp->p_pid;
-               pp->p_pgrp = tp->t_pgrp;
-       }
-       tp->t_state &= ~WOPEN;
-       tp->t_state |= ISOPEN;
-}
-
-
-/*
- * set default control characters.
- */
-ttychars(tp)
-register struct tty *tp;
-{
-       tun.t_intrc = CINTR;
-       tun.t_quitc = CQUIT;
-       tun.t_startc = CSTART;
-       tun.t_stopc = CSTOP;
-       tun.t_eofc = CEOT;
-       tun.t_brkc = CBRK;
-       tp->t_erase = CERASE;
-       tp->t_kill = CKILL;
-}
-
-/*
- * clean tp on last close
- */
-ttyclose(tp)
-register struct tty *tp;
-{
-
-       tp->t_pgrp = 0;
-       wflushtty(tp);
-       tp->t_state = 0;
-}
-
-/*
- * stty/gtty writearound
- */
-stty()
-{
-       u.u_arg[2] = u.u_arg[1];
-       u.u_arg[1] = TIOCSETP;
-       ioctl();
-}
-
-gtty()
-{
-       u.u_arg[2] = u.u_arg[1];
-       u.u_arg[1] = TIOCGETP;
-       ioctl();
-}
-
-/*
- * ioctl system call
- * Check legality, execute common code, and switch out to individual
- * device routine.
- */
-ioctl()
-{
-       register struct file *fp;
-       register struct inode *ip;
-       register struct a {
-               int     fdes;
-               int     cmd;
-               caddr_t cmarg;
-       } *uap;
-       register dev_t dev;
-       register fmt;
-
-       uap = (struct a *)u.u_ap;
-       if ((fp = getf(uap->fdes)) == NULL)
-               return;
-       if (uap->cmd==FIOCLEX) {
-               u.u_pofile[uap->fdes] |= EXCLOSE;
-               return;
-       }
-       if (uap->cmd==FIONCLEX) {
-               u.u_pofile[uap->fdes] &= ~EXCLOSE;
-               return;
-       }
-       ip = fp->f_inode;
-       fmt = ip->i_mode & IFMT;
-       if (fmt != IFCHR && fmt != IFMPC) {
-               u.u_error = ENOTTY;
-               return;
-       }
-       dev = (dev_t)ip->i_un.i_rdev;
-       (*cdevsw[major(dev)].d_ioctl)(dev, uap->cmd, uap->cmarg, fp->f_flag);
-}
-
-/*
- * Common code for several tty ioctl commands
- */
-ttioccomm(com, tp, addr, dev)
-register struct tty *tp;
-caddr_t addr;
-{
-       unsigned t;
-       struct ttiocb iocb;
-       extern int nldisp;
-
-       switch(com) {
-
-       /*
-        * get discipline number
-        */
-       case TIOCGETD:
-               t = tp->t_line;
-               if (copyout((caddr_t)&t, addr, sizeof(t)))
-                       u.u_error = EFAULT;
-               break;
-
-       /*
-        * set line discipline
-        */
-       case TIOCSETD:
-               if (copyin(addr, (caddr_t)&t, sizeof(t))) {
-                       u.u_error = EFAULT;
-                       break;
-               }
-               if (t >= nldisp) {
-                       u.u_error = ENXIO;
-                       break;
-               }
-               if (tp->t_line)
-                       (*linesw[tp->t_line].l_close)(tp);
-               if (t)
-                       (*linesw[t].l_open)(dev, tp, addr);
-               if (u.u_error==0)
-                       tp->t_line = t;
-               break;
-
-       /*
-        * prevent more opens on channel
-        */
-       case TIOCEXCL:
-               tp->t_state |= XCLUDE;
-               break;
-       case TIOCNXCL:
-               tp->t_state &= ~XCLUDE;
-               break;
-
-       /*
-        * Set new parameters
-        */
-       case TIOCSETP:
-               wflushtty(tp);
-       case TIOCSETN:
-               if (copyin(addr, (caddr_t)&iocb, sizeof(iocb))) {
-                       u.u_error = EFAULT;
-                       return(1);
-               }
-               tp->t_ispeed = iocb.ioc_ispeed;
-               tp->t_ospeed = iocb.ioc_ospeed;
-               tp->t_erase = iocb.ioc_erase;
-               tp->t_kill = iocb.ioc_kill;
-               tp->t_flags = iocb.ioc_flags;
-               break;
-
-       /*
-        * send current parameters to user
-        */
-       case TIOCGETP:
-               iocb.ioc_ispeed = tp->t_ispeed;
-               iocb.ioc_ospeed = tp->t_ospeed;
-               iocb.ioc_erase = tp->t_erase;
-               iocb.ioc_kill = tp->t_kill;
-               iocb.ioc_flags = tp->t_flags;
-               if (copyout((caddr_t)&iocb, addr, sizeof(iocb)))
-                       u.u_error = EFAULT;
-               break;
-
-       /*
-        * Hang up line on last close
-        */
-
-       case TIOCHPCL:
-               tp->t_state |= HUPCLS;
-               break;
-
-       case TIOCFLUSH:
-               flushtty(tp);
-               break;
-
-       /*
-        * ioctl entries to line discipline
-        */
-       case DIOCSETP:
-       case DIOCGETP:
-               (*linesw[tp->t_line].l_ioctl)(com, tp, addr);
-               break;
-
-       /*
-        * set and fetch special characters
-        */
-       case TIOCSETC:
-               if (copyin(addr, (caddr_t)&tun, sizeof(struct tc)))
-                       u.u_error = EFAULT;
-               break;
-
-       case TIOCGETC:
-               if (copyout((caddr_t)&tun, addr, sizeof(struct tc)))
-                       u.u_error = EFAULT;
-               break;
-
-       default:
-               return(0);
-       }
-       return(1);
-}
-
-/*
- * Wait for output to drain, then flush input waiting.
- */
-wflushtty(tp)
-register struct tty *tp;
-{
-
-       spl5();
-       while (tp->t_outq.c_cc && tp->t_state&CARR_ON) {
-               (*tp->t_oproc)(tp);
-               tp->t_state |= ASLEEP;
-               sleep((caddr_t)&tp->t_outq, TTOPRI);
-       }
-       flushtty(tp);
-       spl0();
-}
-
-/*
- * flush all TTY queues
- */
-flushtty(tp)
-register struct tty *tp;
-{
-       register s;
-
-       while (getc(&tp->t_canq) >= 0)
-               ;
-       wakeup((caddr_t)&tp->t_rawq);
-       wakeup((caddr_t)&tp->t_outq);
-       s = spl6();
-       tp->t_state &= ~TTSTOP;
-       (*cdevsw[major(tp->t_dev)].d_stop)(tp);
-       while (getc(&tp->t_outq) >= 0)
-               ;
-       while (getc(&tp->t_rawq) >= 0)
-               ;
-       tp->t_delct = 0;
-       splx(s);
-}
-
-
-
-/*
- * transfer raw input list to canonical list,
- * doing erase-kill processing and handling escapes.
- * It waits until a full line has been typed in cooked mode,
- * or until any character has been typed in raw mode.
- */
-canon(tp)
-register struct tty *tp;
-{
-       register char *bp;
-       char *bp1;
-       register int c;
-       int mc;
-
-       spl5();
-       while ((tp->t_flags&(RAW|CBREAK))==0 && tp->t_delct==0
-           || (tp->t_flags&(RAW|CBREAK))!=0 && tp->t_rawq.c_cc==0) {
-               if ((tp->t_state&CARR_ON)==0 || tp->t_chan!=NULL) {
-                       return(0);
-               }
-               sleep((caddr_t)&tp->t_rawq, TTIPRI);
-       }
-       spl0();
-loop:
-       bp = &canonb[2];
-       while ((c=getc(&tp->t_rawq)) >= 0) {
-               if ((tp->t_flags&(RAW|CBREAK))==0) {
-                       if (c==0377) {
-                               tp->t_delct--;
-                               break;
-                       }
-                       if (bp[-1]!='\\') {
-                               if (c==tp->t_erase) {
-                                       if (bp > &canonb[2])
-                                               bp--;
-                                       continue;
-                               }
-                               if (c==tp->t_kill)
-                                       goto loop;
-                               if (c==tun.t_eofc)
-                                       continue;
-                       } else {
-                               mc = maptab[c];
-                               if (c==tp->t_erase || c==tp->t_kill)
-                                       mc = c;
-                               if (mc && (mc==c || (tp->t_flags&LCASE))) {
-                                       if (bp[-2] != '\\')
-                                               c = mc;
-                                       bp--;
-                               }
-                       }
-               }
-               *bp++ = c;
-               if (bp>=canonb+CANBSIZ)
-                       break;
-       }
-       bp1 = &canonb[2];
-       b_to_q(bp1, bp-bp1, &tp->t_canq);
-
-       if (tp->t_state&TBLOCK && tp->t_rawq.c_cc < TTYHOG/5) {
-               if (putc(tun.t_startc, &tp->t_outq)==0) {
-                       tp->t_state &= ~TBLOCK;
-                       ttstart(tp);
-               }
-               tp->t_char = 0;
-       }
-
-       return(bp-bp1);
-}
-
-
-/*
- * block transfer input handler.
- */
-ttyrend(tp, pb, pe)
-register struct tty *tp;
-register char *pb, *pe;
-{
-       int     tandem;
-
-       tandem = tp->t_flags&TANDEM;
-       if (tp->t_flags&RAW) {
-               b_to_q(pb, pe-pb, &tp->t_rawq);
-               if (tp->t_chan)
-                       sdata(tp->t_chan); else
-                       wakeup((caddr_t)&tp->t_rawq);
-       } else {
-               tp->t_flags &= ~TANDEM;
-               while (pb < pe)
-                       ttyinput(*pb++, tp);
-               tp->t_flags |= tandem;
-       }
-       if (tandem)
-               ttyblock(tp);
-}
-
-/*
- * Place a character on raw TTY input queue, putting in delimiters
- * and waking up top half as needed.
- * Also echo if required.
- * The arguments are the character and the appropriate
- * tty structure.
- */
-ttyinput(c, tp)
-register c;
-register struct tty *tp;
-{
-       register int t_flags;
-       register struct chan *cp;
-
-       tk_nin += 1;
-       c &= 0377;
-       t_flags = tp->t_flags;
-       if (t_flags&TANDEM)
-               ttyblock(tp);
-       if ((t_flags&RAW)==0) {
-               c &= 0177;
-               if (tp->t_state&TTSTOP) {
-                       if (c==tun.t_startc) {
-                               tp->t_state &= ~TTSTOP;
-                               ttstart(tp);
-                               return;
-                       }
-                       if (c==tun.t_stopc)
-                               return;
-                       tp->t_state &= ~TTSTOP;
-                       ttstart(tp);
-               } else {
-                       if (c==tun.t_stopc) {
-                               tp->t_state |= TTSTOP;
-                               (*cdevsw[major(tp->t_dev)].d_stop)(tp);
-                               return;
-                       }
-                       if (c==tun.t_startc)
-                               return;
-               }
-               if (c==tun.t_quitc || c==tun.t_intrc) {
-                       flushtty(tp);
-                       c = (c==tun.t_intrc) ? SIGINT:SIGQUIT;
-                       if (tp->t_chan)
-                               scontrol(tp->t_chan, M_SIG, c);
-                       else
-                               signal(tp->t_pgrp, c);
-                       return;
-               }
-               if (c=='\r' && t_flags&CRMOD)
-                       c = '\n';
-       }
-       if (tp->t_rawq.c_cc>TTYHOG) {
-               flushtty(tp);
-               return;
-       }
-       if (t_flags&LCASE && c>='A' && c<='Z')
-               c += 'a'-'A';
-       putc(c, &tp->t_rawq);
-       if (t_flags&(RAW|CBREAK)||(c=='\n'||c==tun.t_eofc||c==tun.t_brkc)) {
-               if ((t_flags&(RAW|CBREAK))==0 && putc(0377, &tp->t_rawq)==0)
-                       tp->t_delct++;
-               if ((cp=tp->t_chan)!=NULL)
-                       sdata(cp); else
-                       wakeup((caddr_t)&tp->t_rawq);
-       }
-       if (t_flags&ECHO) {
-               ttyoutput(c, tp);
-               if (c==tp->t_kill && (t_flags&(RAW|CBREAK))==0)
-                       ttyoutput('\n', tp);
-               ttstart(tp);
-       }
-}
-
-
-/*
- * Send stop character on input overflow.
- */
-ttyblock(tp)
-register struct tty *tp;
-{
-register x;
-       x = q1.c_cc + q2.c_cc;
-       if (q1.c_cc > TTYHOG) {
-               flushtty(tp);
-               tp->t_state &= ~TBLOCK;
-       }
-       if (x >= TTYHOG/2) {
-               if (putc(tun.t_stopc, &tp->t_outq)==0) {
-                       tp->t_state |= TBLOCK;
-                       tp->t_char++;
-                       ttstart(tp);
-               }
-       }
-}
-
-/*
- * put character on TTY output queue, adding delays,
- * expanding tabs, and handling the CR/NL bit.
- * It is called both from the top half for output, and from
- * interrupt level for echoing.
- * The arguments are the character and the tty structure.
- */
-ttyoutput(c, tp)
-register c;
-register struct tty *tp;
-{
-       register char *colp;
-       register ctype;
-
-       tk_nout += 1;
-       /*
-        * Ignore EOT in normal mode to avoid hanging up
-        * certain terminals.
-        * In raw mode dump the char unchanged.
-        */
-
-       if ((tp->t_flags&RAW)==0) {
-               c &= 0177;
-               if (c==CEOT)
-                       return;
-       } else {
-               putc(c, &tp->t_outq);
-               return;
-       }
-
-       /*
-        * Turn tabs to spaces as required
-        */
-       if (c=='\t' && (tp->t_flags&TBDELAY)==XTABS) {
-               c = 8;
-               do
-                       ttyoutput(' ', tp);
-               while (--c >= 0 && tp->t_col&07);
-               return;
-       }
-       /*
-        * for upper-case-only terminals,
-        * generate escapes.
-        */
-       if (tp->t_flags&LCASE) {
-               colp = "({)}!|^~'`";
-               while(*colp++)
-                       if(c == *colp++) {
-                               ttyoutput('\\', tp);
-                               c = colp[-2];
-                               break;
-                       }
-               if ('a'<=c && c<='z')
-                       c += 'A' - 'a';
-       }
-       /*
-        * turn <nl> to <cr><lf> if desired.
-        */
-       if (c=='\n' && tp->t_flags&CRMOD)
-               ttyoutput('\r', tp);
-       putc(c, &tp->t_outq);
-       /*
-        * Calculate delays.
-        * The numbers here represent clock ticks
-        * and are not necessarily optimal for all terminals.
-        * The delays are indicated by characters above 0200.
-        * In raw mode there are no delays and the
-        * transmission path is 8 bits wide.
-        */
-       colp = &tp->t_col;
-       ctype = partab[c];
-       c = 0;
-       switch (ctype&077) {
-
-       /* ordinary */
-       case 0:
-               (*colp)++;
-
-       /* non-printing */
-       case 1:
-               break;
-
-       /* backspace */
-       case 2:
-               if (*colp)
-                       (*colp)--;
-               break;
-
-       /* newline */
-       case 3:
-               ctype = (tp->t_flags >> 8) & 03;
-               if(ctype == 1) { /* tty 37 */
-                       if (*colp)
-                               c = max(((unsigned)*colp>>4) + 3, (unsigned)6);
-               } else
-               if(ctype == 2) { /* vt05 */
-                       c = 6;
-               }
-               *colp = 0;
-               break;
-
-       /* tab */
-       case 4:
-               ctype = (tp->t_flags >> 10) & 03;
-               if(ctype == 1) { /* tty 37 */
-                       c = 1 - (*colp | ~07);
-                       if(c < 5)
-                               c = 0;
-               }
-               *colp |= 07;
-               (*colp)++;
-               break;
-
-       /* vertical motion */
-       case 5:
-               if(tp->t_flags & VTDELAY) /* tty 37 */
-                       c = 0177;
-               break;
-
-       /* carriage return */
-       case 6:
-               ctype = (tp->t_flags >> 12) & 03;
-               if(ctype == 1) { /* tn 300 */
-                       c = 5;
-               } else if(ctype == 2) { /* ti 700 */
-                       c = 10;
-               }
-               *colp = 0;
-       }
-       if(c)
-               putc(c|0200, &tp->t_outq);
-}
-
-/*
- * Restart typewriter output following a delay
- * timeout.
- * The name of the routine is passed to the timeout
- * subroutine and it is called during a clock interrupt.
- */
-ttrstrt(tp)
-register struct tty *tp;
-{
-
-       tp->t_state &= ~TIMEOUT;
-       ttstart(tp);
-}
-
-/*
- * Start output on the typewriter. It is used from the top half
- * after some characters have been put on the output queue,
- * from the interrupt routine to transmit the next
- * character, and after a timeout has finished.
- */
-ttstart(tp)
-register struct tty *tp;
-{
-       register s;
-
-       s = spl5();
-       if((tp->t_state&(TIMEOUT|TTSTOP|BUSY)) == 0)
-               (*tp->t_oproc)(tp);
-       splx(s);
-}
-
-/*
- * Called from device's read routine after it has
- * calculated the tty-structure given as argument.
- */
-ttread(tp)
-register struct tty *tp;
-{
-
-       if ((tp->t_state&CARR_ON)==0)
-               return(0);
-       if (tp->t_canq.c_cc || canon(tp))
-               while (tp->t_canq.c_cc && passc(getc(&tp->t_canq))>=0)
-                       ;
-       return(tp->t_rawq.c_cc + tp->t_canq.c_cc);
-}
-
-/*
- * Called from the device's write routine after it has
- * calculated the tty-structure given as argument.
- */
-caddr_t
-ttwrite(tp)
-register struct tty *tp;
-{
-       register c;
-
-       if ((tp->t_state&CARR_ON)==0)
-               return(NULL);
-       while (u.u_count) {
-               spl5();
-               while (tp->t_outq.c_cc > TTHIWAT) {
-                       ttstart(tp);
-                       tp->t_state |= ASLEEP;
-                       if (tp->t_chan) 
-                               return((caddr_t)&tp->t_outq);
-                       sleep((caddr_t)&tp->t_outq, TTOPRI);
-               }
-               spl0();
-               if ((c = cpass()) < 0)
-                       break;
-               ttyoutput(c, tp);
-       }
-       ttstart(tp);
-       return(NULL);
-}
-
diff --git a/.ref-Research-V7/usr/sys/dev/vp.c b/.ref-Research-V7/usr/sys/dev/vp.c
deleted file mode 100644 (file)
index 6bcdf80..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- *  Versatec matrix printer/plotter 
- *  dma interface driver
- */
-
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-#include "../h/systm.h"
-
-#define        VPPRI   (PZERO+8)
-
-/* device registers */
-struct vpregs {
-       int     plbcr;
-       int     fill;
-       int     prbcr;
-       caddr_t pbaddr;
-       int     plcsr;
-       int     plbuf;
-       int     prcsr;
-       caddr_t prbuf;
-};
-
-#define        VPADDR  ((struct vpregs *)0177500)
-
-/* status bits */
-#define        ERROR   0100000
-#define        DTCINTR 040000
-#define        DMAACT  020000
-#define        READY   0200
-#define        IENABLE 0100
-#define TERMCOM        040
-#define        FFCOM   020
-#define        EOTCOM  010
-#define        CLRCOM  04
-#define        RESET   02
-#define        SPP     01
-
-struct {
-       int     vp_state;
-       int     vp_count;
-       struct  buf     *vp_buf;
-       caddr_t vp_bufp;
-}      vp11;
-
-/*states */
-#define        ISOPEN  01
-#define        CMNDS   076
-#define        MODE    0700
-#define        PRINT   0100
-#define        PLOT    0200
-#define        PPLOT   0400
-#define        BUSY    01000
-
-vpopen()
-{
-       if (vp11.vp_state & ISOPEN) {
-               u.u_error = ENXIO;
-               return;
-       }
-       vp11.vp_state = ISOPEN | PRINT | CLRCOM | FFCOM | RESET;
-       vp11.vp_count = 0;
-       vp11.vp_buf = geteblk();
-       vp11.vp_bufp = vp11.vp_buf->b_un.b_addr;
-       VPADDR->prcsr = IENABLE | DTCINTR;
-       vptimo();
-       while(vp11.vp_state & CMNDS) {
-               spl4();
-               if (vperror(READY)) {
-                       vpclose();
-                       u.u_error = EIO;
-                       return;
-               }
-               vpstart();
-               spl0();
-       }
-}
-
-vpwrite()
-{
-       register int i, e;
-
-       if (u.u_count == 0)
-               return;
-       spl4();
-       while(vp11.vp_state & BUSY)
-               sleep((caddr_t)&vp11, VPPRI);
-       vp11.vp_state |= BUSY;
-       spl0();
-       while(i = vp11.vp_count = min(512,u.u_count)) {
-               u.u_offset = 0;         /* Make even, speed up iomove */
-               iomove(vp11.vp_buf->b_un.b_addr, i, B_WRITE);
-               spl4();
-               if (e = vperror(READY))
-                       break;
-               vpstart();
-               while ((vp11.vp_state&PLOT?VPADDR->plcsr:VPADDR->prcsr)&DMAACT)
-                       sleep((caddr_t)&vp11, VPPRI);
-               if ((vp11.vp_state&MODE) == PPLOT)
-                       vp11.vp_state = vp11.vp_state&~MODE | PLOT;
-               spl0();
-       }
-       vp11.vp_state &= ~BUSY;
-       if (e)
-               u.u_error = EIO;
-       wakeup((caddr_t)&vp11);
-}
-
-vperror(bit)
-{
-       register state, e;
-
-       state = vp11.vp_state&PLOT;
-       while((e=(state?VPADDR->plcsr:VPADDR->prcsr) & (bit|ERROR)) == 0)
-               sleep((caddr_t)&vp11, VPPRI);
-       return(e&ERROR);
-}
-
-vpstart()
-{
-       register bit;
-
-       if (vp11.vp_count) {
-               VPADDR->pbaddr = vp11.vp_bufp;
-               if (vp11.vp_state & (PRINT|PPLOT))
-                       VPADDR->prbcr = vp11.vp_count;
-               else
-                       VPADDR->plbcr = vp11.vp_count;
-               return;
-       }
-       for (bit=1; bit!=0; bit <<= 1)
-               if (vp11.vp_state&bit&CMNDS) {
-                       VPADDR->plcsr |= bit;
-                       vp11.vp_state &= ~bit;
-                       return;
-               }
-}
-
-vpioctl(dev, cmd, addr, flag)
-register caddr_t addr;
-{
-       register m;
-
-       switch(cmd) {
-
-       /* get mode */
-       case ('v'<<8)+0:
-               suword(addr, vp11.vp_state);
-               return;
-
-       /* set mode */
-       case ('v'<<8)+1:
-               m = fuword(addr);
-               if (m == -1) {
-                       u.u_error = EFAULT;
-                       return;
-               }
-               spl4();
-               vperror(READY);
-               vp11.vp_state = (vp11.vp_state & ~MODE) | (m&(MODE|CMNDS));
-               if (vp11.vp_state&PPLOT)
-                       VPADDR->plcsr |= SPP;
-               else
-                       VPADDR->plcsr &= ~SPP;
-               vp11.vp_count = 0;
-               while(CMNDS & vp11.vp_state) {
-                       vperror(READY);
-                       vpstart();
-               }
-               spl0();
-               return;
-
-       default:
-               u.u_error = ENOTTY;
-               return;
-       }
-}
-
-vptimo()
-{
-       if (vp11.vp_state&ISOPEN)
-               timeout(vptimo, (caddr_t)0, HZ/10);
-       vpintr(0);
-}
-
-vpintr(dev)
-{
-       wakeup((caddr_t)&vp11);
-}
-
-vpclose()
-{
-       brelse(vp11.vp_buf);
-       vp11.vp_state = 0;
-       vp11.vp_count = 0;
-       vp11.vp_buf = 0;
-       vp11.vp_bufp = 0;
-       VPADDR->plcsr = 0;
-}
diff --git a/.ref-Research-V7/usr/sys/dev/vs.c b/.ref-Research-V7/usr/sys/dev/vs.c
deleted file mode 100644 (file)
index 87fd6cf..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Screw Works interface via DC-11
- */
-
-#include "../h/types.h"
-#include "../h/tty.h"
-
-#define        VSADDR  ((struct device *)0174140)
-#define        CDLEAD  01
-#define        B1200   030
-#define        STOP1   0400
-#define        CLSEND  02
-#define        RQSEND  01
-
-#define        GO      026
-#define        COUNT   120
-
-struct device {
-       int     vsrcsr;
-       int     vsrbuf;
-       int     vsxcsr;
-       int     vsxbuf;
-};
-
-struct {
-       struct  clist   iq;
-       int     vtime;
-       struct  clist   oq;
-} vs;
-
-
-vsopen(dev)
-{
-       register c;
-
-       c = VSADDR->vsrcsr;             /* touch register */
-       VSADDR->vsrcsr = IENABLE|B1200|CDLEAD;
-       VSADDR->vsxcsr = STOP1|IENABLE|B1200;
-       vschar(GO);
-}
-
-vsclose(dev)
-{
-       vschar(GO);
-       VSADDR->vsrcsr &= ~IENABLE;
-       while (getc(&vs.iq) >= 0);
-}
-
-vswrite(dev)
-{
-       register int count, c;
-
-       count = 0;
-       while ((c=cpass()) >= 0) {
-               if (--count <= 0) {
-                       count = COUNT;
-                       vschar(GO);
-               }
-               vschar(c);
-       }
-       vschar(GO);
-}
-
-vschar(c)
-{
-
-       spl5();
-       while (vs.oq.c_cc > 120) {
-               vsxintr();
-               sleep((caddr_t)&vs.oq, TTIPRI);
-       }
-       putc(c, &vs.oq);
-       vsxintr();
-       spl0();
-}
-
-vstimo()
-{
-       vs.vtime = 0;
-       vsxintr();
-}
-
-vsxintr()
-{
-       static lchar;
-       register c;
-       register int *xcsr;
-
-       xcsr = &VSADDR->vsxcsr;
-       if (*xcsr&DONE) {
-               if (lchar==GO) {
-                       *xcsr &= ~RQSEND;
-                       lchar = -1;
-                       if (vs.oq.c_cc==0) {
-                               wakeup((caddr_t)&vs.oq);
-                               return;
-                       }
-               }
-               if ((*xcsr&CLSEND) == 0) {
-                       *xcsr |= RQSEND;
-                       if ((*xcsr&CLSEND) == 0) {
-                               if (vs.vtime==0) {
-                                       vs.vtime++;
-                                       timeout(vstimo, (caddr_t)0, 60);
-                               }
-                               return;
-                       }
-               }
-               if ((c = getc(&vs.oq)) >= 0)
-                       VSADDR->vsxbuf = lchar = c;
-               else
-                       *xcsr &= ~RQSEND;
-               if (vs.oq.c_cc <= 15)
-                       wakeup((caddr_t)&vs.oq);
-       }
-}
-
-vsread(dev)
-{
-       register int c;
-
-       spl5();
-       while ((c = getc(&vs.iq)) < 0)
-               sleep((caddr_t)&vs.iq, TTIPRI);
-       spl0();
-       passc("?0*#?546?213?879?"[c&017]);
-}
-
-vsrintr()
-{
-       register int c;
-
-       c = VSADDR->vsrbuf;     /* Register must be read (?) */
-       c = VSADDR->vsrbuf;
-       if (vs.iq.c_cc<=10)
-               putc(c, &vs.iq);
-       wakeup((caddr_t)&vs.iq);
-}
diff --git a/.ref-Research-V7/usr/sys/h/acct.h b/.ref-Research-V7/usr/sys/h/acct.h
deleted file mode 100644 (file)
index 8a7d7c6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Accounting structures
- */
-
-typedef        unsigned short comp_t;  /* "floating pt": 3 bits base 8 exp, 13 bits fraction */
-struct acct
-{
-       char    ac_comm[10];            /* Accounting command name */
-       comp_t  ac_utime;               /* Accounting user time */
-       comp_t  ac_stime;               /* Accounting system time */
-       comp_t  ac_etime;               /* Accounting elapsed time */
-       time_t  ac_btime;               /* Beginning time */
-       short   ac_uid;                 /* Accounting user ID */
-       short   ac_gid;                 /* Accounting group ID */
-       short   ac_mem;                 /* average memory usage */
-       comp_t  ac_io;                  /* number of disk IO blocks */
-       dev_t   ac_tty;                 /* control typewriter */
-       char    ac_flag;                /* Accounting flag */
-};
-
-extern struct  acct    acctbuf;
-extern struct  inode   *acctp;         /* inode of accounting file */
-
-#define        AFORK   01              /* has executed fork, but no exec */
-#define        ASU     02              /* used super-user privileges */
diff --git a/.ref-Research-V7/usr/sys/h/buf.h b/.ref-Research-V7/usr/sys/h/buf.h
deleted file mode 100644 (file)
index e606883..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Each buffer in the pool is usually doubly linked into 2 lists:
- * the device with which it is currently associated (always)
- * and also on a list of blocks available for allocation
- * for other use (usually).
- * The latter list is kept in last-used order, and the two
- * lists are doubly linked to make it easy to remove
- * a buffer from one list when it was found by
- * looking through the other.
- * A buffer is on the available list, and is liable
- * to be reassigned to another disk block, if and only
- * if it is not marked BUSY.  When a buffer is busy, the
- * available-list pointers can be used for other purposes.
- * Most drivers use the forward ptr as a link in their I/O
- * active queue.
- * A buffer header contains all the information required
- * to perform I/O.
- * Most of the routines which manipulate these things
- * are in bio.c.
- */
-struct buf
-{
-       int     b_flags;                /* see defines below */
-       struct  buf *b_forw;            /* headed by d_tab of conf.c */
-       struct  buf *b_back;            /*  "  */
-       struct  buf *av_forw;           /* position on free list, */
-       struct  buf *av_back;           /*     if not BUSY*/
-       dev_t   b_dev;                  /* major+minor device name */
-       unsigned b_bcount;              /* transfer count */
-       union {
-           caddr_t b_addr;             /* low order core address */
-           int *b_words;               /* words for clearing */
-           struct filsys *b_filsys;    /* superblocks */
-           struct dinode *b_dino;      /* ilist */
-           daddr_t *b_daddr;           /* indirect block */
-       } b_un;
-       daddr_t b_blkno;                /* block # on device */
-       char    b_xmem;                 /* high order core address */
-       char    b_error;                /* returned after I/O */
-       unsigned int b_resid;           /* words not transferred after error */
-};
-
-extern struct buf buf[];               /* The buffer pool itself */
-extern struct buf bfreelist;           /* head of available list */
-
-/*
- * These flags are kept in b_flags.
- */
-#define        B_WRITE 0       /* non-read pseudo-flag */
-#define        B_READ  01      /* read when I/O occurs */
-#define        B_DONE  02      /* transaction finished */
-#define        B_ERROR 04      /* transaction aborted */
-#define        B_BUSY  010     /* not on av_forw/back list */
-#define        B_PHYS  020     /* Physical IO potentially using UNIBUS map */
-#define        B_MAP   040     /* This block has the UNIBUS map allocated */
-#define        B_WANTED 0100   /* issue wakeup when BUSY goes off */
-#define        B_AGE   0200    /* delayed write for correct aging */
-#define        B_ASYNC 0400    /* don't wait for I/O completion */
-#define        B_DELWRI 01000  /* don't write till block leaves available list */
-#define        B_TAPE 02000    /* this is a magtape (no bdwrite) */
-#define        B_PBUSY 04000
-#define        B_PACK  010000
-
-/*
- * special redeclarations for
- * the head of the queue per
- * device driver.
- */
-#define        b_actf  av_forw
-#define        b_actl  av_back
-#define        b_active b_bcount
-#define        b_errcnt b_resid
diff --git a/.ref-Research-V7/usr/sys/h/callo.h b/.ref-Research-V7/usr/sys/h/callo.h
deleted file mode 100644 (file)
index f66e5bb..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * The callout structure is for
- * a routine arranging
- * to be called by the clock interrupt
- * (clock.c) with a specified argument,
- * in a specified amount of time.
- * Used, for example, to time tab
- * delays on typewriters.
- */
-
-struct callo
-{
-       int     c_time;         /* incremental time */
-       caddr_t c_arg;          /* argument to routine */
-       int     (*c_func)();    /* routine */
-};
-struct callo   callout[NCALL];
diff --git a/.ref-Research-V7/usr/sys/h/conf.h b/.ref-Research-V7/usr/sys/h/conf.h
deleted file mode 100644 (file)
index 66d4252..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Declaration of block device
- * switch. Each entry (row) is
- * the only link between the
- * main unix code and the driver.
- * The initialization of the
- * device switches is in the
- * file conf.c.
- */
-extern struct bdevsw
-{
-       int     (*d_open)();
-       int     (*d_close)();
-       int     (*d_strategy)();
-       struct buf *d_tab;
-} bdevsw[];
-
-/*
- * Character device switch.
- */
-extern struct cdevsw
-{
-       int     (*d_open)();
-       int     (*d_close)();
-       int     (*d_read)();
-       int     (*d_write)();
-       int     (*d_ioctl)();
-       int     (*d_stop)();
-       struct tty *d_ttys;
-} cdevsw[];
-
-/*
- * tty line control switch.
- */
-extern struct linesw
-{
-       int     (*l_open)();
-       int     (*l_close)();
-       int     (*l_read)();
-       char    *(*l_write)();
-       int     (*l_ioctl)();
-       int     (*l_rint)();
-       int     (*l_rend)();
-       int     (*l_meta)();
-       int     (*l_start)();
-       int     (*l_modem)();
-} linesw[];
diff --git a/.ref-Research-V7/usr/sys/h/dir.h b/.ref-Research-V7/usr/sys/h/dir.h
deleted file mode 100644 (file)
index 737a3a6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef        DIRSIZ
-#define        DIRSIZ  14
-#endif
-struct direct
-{
-       ino_t   d_ino;
-       char    d_name[DIRSIZ];
-};
diff --git a/.ref-Research-V7/usr/sys/h/fblk.h b/.ref-Research-V7/usr/sys/h/fblk.h
deleted file mode 100644 (file)
index 9a1ba29..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-struct fblk
-{
-       int     df_nfree;
-       daddr_t df_free[NICFREE];
-};
diff --git a/.ref-Research-V7/usr/sys/h/file.h b/.ref-Research-V7/usr/sys/h/file.h
deleted file mode 100644 (file)
index f526043..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * One file structure is allocated
- * for each open/creat/pipe call.
- * Main use is to hold the read/write
- * pointer associated with each open
- * file.
- */
-struct file
-{
-       char    f_flag;
-       char    f_count;        /* reference count */
-       struct inode *f_inode;  /* pointer to inode structure */
-       union {
-               off_t   f_offset;       /* read/write character pointer */
-               struct chan *f_chan;    /* mpx channel pointer */
-       } f_un;
-};
-
-extern struct file file[];     /* The file table itself */
-
-/* flags */
-#define        FREAD   01
-#define        FWRITE  02
-#define        FPIPE   04
-#define FMPX   010
-#define        FMPY    020
-#define        FMP     030
-#define        FKERNEL 040
diff --git a/.ref-Research-V7/usr/sys/h/filsys.h b/.ref-Research-V7/usr/sys/h/filsys.h
deleted file mode 100644 (file)
index 19ebcee..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Structure of the super-block
- */
-struct filsys {
-       unsigned short s_isize; /* size in blocks of i-list */
-       daddr_t s_fsize;        /* size in blocks of entire volume */
-       short   s_nfree;        /* number of addresses in s_free */
-       daddr_t s_free[NICFREE];/* free block list */
-       short   s_ninode;       /* number of i-nodes in s_inode */
-       ino_t   s_inode[NICINOD];/* free i-node list */
-       char    s_flock;        /* lock during free list manipulation */
-       char    s_ilock;        /* lock during i-list manipulation */
-       char    s_fmod;         /* super block modified flag */
-       char    s_ronly;        /* mounted read-only flag */
-       time_t  s_time;         /* last super block update */
-       /* remainder not maintained by this version of the system */
-       daddr_t s_tfree;        /* total free blocks*/
-       ino_t   s_tinode;       /* total free inodes */
-       short   s_m;            /* interleave factor */
-       short   s_n;            /* " " */
-       char    s_fname[6];     /* file system name */
-       char    s_fpack[6];     /* file system pack name */
-};
diff --git a/.ref-Research-V7/usr/sys/h/ino.h b/.ref-Research-V7/usr/sys/h/ino.h
deleted file mode 100644 (file)
index 90579cb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Inode structure as it appears on
- * a disk block.
- */
-struct dinode
-{
-       unsigned short  di_mode;        /* mode and type of file */
-       short   di_nlink;       /* number of links to file */
-       short   di_uid;         /* owner's user id */
-       short   di_gid;         /* owner's group id */
-       off_t   di_size;        /* number of bytes in file */
-       char    di_addr[40];    /* disk block addresses */
-       time_t  di_atime;       /* time last accessed */
-       time_t  di_mtime;       /* time last modified */
-       time_t  di_ctime;       /* time created */
-};
-#define        INOPB   8       /* 8 inodes per block */
-/*
- * the 40 address bytes:
- *     39 used; 13 addresses
- *     of 3 bytes each.
- */
diff --git a/.ref-Research-V7/usr/sys/h/inode.h b/.ref-Research-V7/usr/sys/h/inode.h
deleted file mode 100644 (file)
index 5ced95d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * The I node is the focus of all
- * file activity in unix. There is a unique
- * inode allocated for each active file,
- * each current directory, each mounted-on
- * file, text file, and the root. An inode is 'named'
- * by its dev/inumber pair. (iget/iget.c)
- * Data, from mode on, is read in
- * from permanent inode on volume.
- */
-
-#define        NADDR   13
-#define        NINDEX  15
-
-struct group {
-       short   g_state;
-       char    g_index;
-       char    g_rot;
-       struct  group   *g_group;
-       struct  inode   *g_inode;
-       struct  file    *g_file;
-       short   g_rotmask;
-       short   g_datq;
-       struct  chan *g_chans[NINDEX];
-};
-struct inode
-{
-       char    i_flag;
-       char    i_count;        /* reference count */
-       dev_t   i_dev;          /* device where inode resides */
-       ino_t   i_number;       /* i number, 1-to-1 with device address */
-       unsigned short  i_mode;
-       short   i_nlink;        /* directory entries */
-       short   i_uid;          /* owner */
-       short   i_gid;          /* group of owner */
-       off_t   i_size;         /* size of file */
-       union {
-               struct {
-                       daddr_t i_addr[NADDR];  /* if normal file/directory */
-                       daddr_t i_lastr;        /* last logical block read (for read-ahead) */
-               };
-               struct  {
-                       daddr_t i_rdev;                 /* i_addr[0] */
-                       struct  group   i_group;        /*  multiplexor group file */
-               };
-       } i_un;
-};
-
-
-extern struct inode inode[];   /* The inode table itself */
-struct inode *mpxip;           /* mpx virtual inode */
-
-/* flags */
-#define        ILOCK   01              /* inode is locked */
-#define        IUPD    02              /* file has been modified */
-#define        IACC    04              /* inode access time to be updated */
-#define        IMOUNT  010             /* inode is mounted on */
-#define        IWANT   020             /* some process waiting on lock */
-#define        ITEXT   040             /* inode is pure text prototype */
-#define        ICHG    0100            /* inode has been changed */
-
-/* modes */
-#define        IFMT    0170000         /* type of file */
-#define                IFDIR   0040000 /* directory */
-#define                IFCHR   0020000 /* character special */
-#define                IFBLK   0060000 /* block special */
-#define                IFREG   0100000 /* regular */
-#define                IFMPC   0030000 /* multiplexed char special */
-#define                IFMPB   0070000 /* multiplexed block special */
-#define        ISUID   04000           /* set user id on execution */
-#define        ISGID   02000           /* set group id on execution */
-#define ISVTX  01000           /* save swapped text even after use */
-#define        IREAD   0400            /* read, write, execute permissions */
-#define        IWRITE  0200
-#define        IEXEC   0100
diff --git a/.ref-Research-V7/usr/sys/h/map.h b/.ref-Research-V7/usr/sys/h/map.h
deleted file mode 100644 (file)
index d4af68b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-struct map
-{
-       short   m_size;
-       unsigned short m_addr;
-};
-
-struct map coremap[CMAPSIZ];   /* space for core allocation */
-struct map swapmap[SMAPSIZ];   /* space for swap allocation */
diff --git a/.ref-Research-V7/usr/sys/h/mount.h b/.ref-Research-V7/usr/sys/h/mount.h
deleted file mode 100644 (file)
index dfdbc90..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Mount structure.
- * One allocated on every mount.
- * Used to find the super block.
- */
-struct mount
-{
-       dev_t   m_dev;          /* device mounted */
-       struct buf *m_bufp;     /* pointer to superblock */
-       struct inode *m_inodp;  /* pointer to mounted on inode */
-} mount[NMOUNT];
diff --git a/.ref-Research-V7/usr/sys/h/mpx.h b/.ref-Research-V7/usr/sys/h/mpx.h
deleted file mode 100644 (file)
index 1ba6c13..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#define        M       3
-#define        C       100
-
-/*
- * character Q structure
- */
-struct clist
-{
-       int     c_cc;
-       int     c_cf;
-       int     c_cl;
-};
-
-struct chan
-{
-       char    cflag;
-       char    m, c;
-       struct  chan    *dest;
-       struct  clist   ioq;
-};
-
-/* c flags */
-#define        BLOCK   01
-
-struct line
-{
-       char    xbuf[24+2];
-       char    rbuf[100+2];
-       char    rseq;
-       char    xseq;
-       char    ackf;
-       char    xflag;
-       char    state;
-       char    time;
-       int     sum;
-       char    *ip;
-       char    *ep;
-};
-#define        WWAIT   02
-#define        CRUN    04
-#define        RWAIT   010
-#define        ALLOC   020
-#define        DIS     040
-#define        DLY     0100
-
-/*
- * machine structure
- */
-struct mach
-{
-       char    mflag;
-       char    rchan;
-       char    rcount;
-       char    xchan;
-       char    xcount;
-       struct  clist   ackq;
-       struct  clist   datq;
-       struct  clist   disq;
-       struct  chan    *chanp[128];
-};
-
-/* m flags */
-#define        RNEXT   01
-#define        MRUN    04
-#define        XNEXT   010
-
-/*
- * trace buffer
- */
-#define        TBSIZ   100
diff --git a/.ref-Research-V7/usr/sys/h/mx.h b/.ref-Research-V7/usr/sys/h/mx.h
deleted file mode 100644 (file)
index 7d5a95f..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#define        NGROUPS         10      /* number of mpx files permitted at one time */
-#define        NCHANS          20      /* number of channel structures */
-#define        NPORTS          30      /* number of channels to i/o ports */
-#define        CNTLSIZ         10
-#define        NLEVELS         4
-#define        NMSIZE          50      /* max size of mxlstn file name */
-
-/*
- * header returned on read of mpx
- */
-struct rh {
-       short   index;
-       short   count;
-       short   ccount;
-};
-
-/*
- * head expected on write of mpx
- */
-struct wh {
-       short   index;
-       short   count;
-       short   ccount;
-       char    *data;
-};
-
-struct mx_args {
-       char    *m_name;
-       int     m_cmd;
-       int     m_arg[3];
-};
-
-
-#ifdef KERNEL
-/*
- * internal structure for channel
- */
-
-struct chan {
-       short   c_flags;
-       char    c_index;
-       char    c_line;
-       struct  group   *c_group;
-       struct  file    *c_fy;
-       struct  tty     *c_ttyp;
-       struct  clist   c_ctlx;
-       int     c_pgrp;
-       struct  tty     *c_ottyp;
-       char    c_oline;
-       union {
-               struct  clist   datq;
-       } cx;
-       union {
-               struct  clist   datq;
-               struct  chan    *c_chan;
-       } cy;
-       struct  clist   c_ctly;
-};
-
-struct schan {
-       short   c_flags;
-       char    c_index;
-       char    c_line;
-       struct  group   *c_group;
-       struct  file    *c_fy;
-       struct  tty     *c_ttyp;
-       struct  clist   c_ctlx;
-       int     c_pgrp;
-};
-
-
-/*
- * flags
- */
-#define        INUSE   01
-#define COPEN  02
-#define        XGRP    04
-#define        YGRP    010
-#define        WCLOSE  020
-#define        ISGRP   0100
-#define        BLOCK   0200
-#define        EOTMARK 0400
-#define        SIGBLK  01000
-#define        BLKMSG  01000
-#define        ENAMSG  02000
-#define        WFLUSH  04000
-#define        NMBUF   010000
-#define        PORT    020000
-#define        ALT     040000
-
-#endif
-
-
-
-
-
-
-
-
-
-/*
- * mpxchan command codes
- */
-#define        MPX     5
-#define        MPXN    6
-#define        CHAN    1
-#define JOIN   2
-#define EXTR   3
-#define        ATTACH  4
-#define        CONNECT 7
-#define        DETACH  8
-#define        DISCON  9
-#define DEBUG  10
-#define        NPGRP   11
-#define        CSIG    12
-#define PACK   13
-
-#define NDEBUGS        30
-/*
- * control channel message codes
- */
-#define M_WATCH 1
-#define M_CLOSE 2
-#define        M_EOT   3
-#define        M_OPEN  4
-#define        M_BLK   5
-#define        M_UBLK  6
-#define        DO_BLK  7
-#define        DO_UBLK 8
-#define        M_IOCTL 12
-#define        M_SIG   14
-
-
-/*
- * debug codes other than mpxchan cmds
- */
-#define MCCLOSE 29
-#define MCOPEN 28
-#define        ALL     27
-#define SCON   26
-#define        MSREAD  25
-#define        SDATA   24
-#define        MCREAD  23
-#define MCWRITE        22
-
diff --git a/.ref-Research-V7/usr/sys/h/pack.h b/.ref-Research-V7/usr/sys/h/pack.h
deleted file mode 100644 (file)
index db8a22b..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-struct header {
-       char    sync;
-       char    ksize;
-       short   sum;
-       char    cntl;
-       char    ccntl;
-};
-#define        HDRSIZ  6
-
-struct pack {
-       short   p_state;        /* line state */
-       short   p_bits;         /* mask for getepack */
-       short   p_rsize;        /* input packet size */
-       short   p_xsize;        /* output packet size */
-       struct  header p_ihbuf; /* input header */
-       struct  header p_ohbuf; /* output header */
-       char    *p_rptr;
-       char    p_mode;
-       char    **p_ipool;
-       char    p_xcount;       /* # active output buffers */
-       char    p_rcount;
-       char    p_nout,p_tout;
-       char    p_lpsize;       /* log(psize/32) */
-       char    p_timer;
-       char    p_obusy;
-       char    p_srxmit;
-       char    p_rwindow;      /* window size */
-       char    p_swindow;
-       char    p_msg;          /* control msg */
-       char    p_rmsg;         /* repeated control msg */
-       char    p_ps,p_pr;      /* last packet sent, recv'd */
-       char    p_rpr;
-       char    p_nxtps;        /* next output seq number */
-       char    p_imap;         /* bit map of input buffers */
-       char    p_pscopy;       /* newest output packet */
-       char    *p_ob[8];       /* output buffers */
-       char    *p_ib[8];       /* input buffers */
-       char    p_os[8];        /* output buffer status */
-       char    p_is[8];        /* input buffer status */
-       short   p_osum[8];      /* output checksums */
-       short   p_isum[8];      /* input checksums */
-       DSYSTEM;
-};
-#define        CHECK   0125252
-#define        SYN     020
-#define        MOD8    7
-#define        ISCNTL(a)       ((a & 0300)==0)
-#define        MIN(a,b)        ((a<b)? a:b)
-
-char   next[8];
-char   mask[8];
-int    npbits;
-int    pkactive;
-
-/*
- * driver state
- */
-#define        DEAD    0
-#define        INITa   1
-#define        INITb   2
-#define        INITab  3
-#define        LIVE    010
-#define        RXMIT   020
-#define        RREJ    040
-#define PDEBUG 0200
-#define        DRAINO  0400
-#define        WAITO   01000
-#define        DOWN    02000
-#define        RCLOSE  04000
-#define        BADFRAME 020000
-
-/*
- * io buffer states
- */
-#define        B_NULL  0
-#define        B_READY 1
-#define        B_SENT  2
-#define        B_RESID 010
-#define        B_COPY  020
-#define        B_MARK  040
-#define        B_SHORT 0100
-
-/*
- * control messages
- */
-#define        CLOSE   1
-#define        RJ      2
-#define        SRJ     3
-#define        RR      4
-#define        INITC   5
-#define        INITB   6
-#define        INITA   7
-
-#define        M_RJ    4
-#define        M_SRJ   010
-#define        M_RR    020
-#define        M_INITC 040
-#define        M_CLOSE 2
-#define        M_INITA 0200
-#define        M_INITB 0100
-
-
-
-#define        PKOPRI  31
-#define        PKIPRI  30
-
-#define        NPLINES 8
-
-/*
- * packet ioctl buf
- */
-struct piocb {
-       unsigned t;
-       short   psize;
-       short   mode;
-       short   state;
-       char    window;
-};
-
-int pkdebug;
-int pksizes[];
diff --git a/.ref-Research-V7/usr/sys/h/param.h b/.ref-Research-V7/usr/sys/h/param.h
deleted file mode 100644 (file)
index 3ddfa97..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * tunable variables
- */
-
-#define        NBUF    29              /* size of buffer cache */
-#define        NINODE  200             /* number of in core inodes */
-#define        NFILE   175             /* number of in core file structures */
-#define        NMOUNT  8               /* number of mountable file systems */
-#define        MAXMEM  (64*32)         /* max core per process - first # is Kw */
-#define        MAXUPRC 25              /* max processes per user */
-#define        SSIZE   20              /* initial stack size (*64 bytes) */
-#define        SINCR   20              /* increment of stack (*64 bytes) */
-#define        NOFILE  20              /* max open files per process */
-#define        CANBSIZ 256             /* max size of typewriter line */
-#define        CMAPSIZ 50              /* size of core allocation area */
-#define        SMAPSIZ 50              /* size of swap allocation area */
-#define        NCALL   20              /* max simultaneous time callouts */
-#define        NPROC   150             /* max number of processes */
-#define        NTEXT   40              /* max number of pure texts */
-#define        NCLIST  100             /* max total clist size */
-#define        HZ      60              /* Ticks/second of the clock */
-#define        TIMEZONE (5*60)         /* Minutes westward from Greenwich */
-#define        DSTFLAG 1               /* Daylight Saving Time applies in this locality */
-#define        MSGBUFS 128             /* Characters saved from error messages */
-#define        NCARGS  5120            /* # characters in exec arglist */
-
-/*
- * priorities
- * probably should not be
- * altered too much
- */
-
-#define        PSWP    0
-#define        PINOD   10
-#define        PRIBIO  20
-#define        PZERO   25
-#define        NZERO   20
-#define        PPIPE   26
-#define        PWAIT   30
-#define        PSLEP   40
-#define        PUSER   50
-
-/*
- * signals
- * dont change
- */
-
-#define        NSIG    17
-/*
- * No more than 16 signals (1-16) because they are
- * stored in bits in a word.
- */
-#define        SIGHUP  1       /* hangup */
-#define        SIGINT  2       /* interrupt (rubout) */
-#define        SIGQUIT 3       /* quit (FS) */
-#define        SIGINS  4       /* illegal instruction */
-#define        SIGTRC  5       /* trace or breakpoint */
-#define        SIGIOT  6       /* iot */
-#define        SIGEMT  7       /* emt */
-#define        SIGFPT  8       /* floating exception */
-#define        SIGKIL  9       /* kill, uncatchable termination */
-#define        SIGBUS  10      /* bus error */
-#define        SIGSEG  11      /* segmentation violation */
-#define        SIGSYS  12      /* bad system call */
-#define        SIGPIPE 13      /* end of pipe */
-#define        SIGCLK  14      /* alarm clock */
-#define        SIGTRM  15      /* Catchable termination */
-
-/*
- * fundamental constants of the implementation--
- * cannot be changed easily
- */
-
-#define        NBPW    sizeof(int)     /* number of bytes in an integer */
-#define        BSIZE   512             /* size of secondary block (bytes) */
-/* BSLOP can be 0 unless you have a TIU/Spider */
-#define        BSLOP   2               /* In case some device needs bigger buffers */
-#define        NINDIR  (BSIZE/sizeof(daddr_t))
-#define        BMASK   0777            /* BSIZE-1 */
-#define        BSHIFT  9               /* LOG2(BSIZE) */
-#define        NMASK   0177            /* NINDIR-1 */
-#define        NSHIFT  7               /* LOG2(NINDIR) */
-#define        USIZE   16              /* size of user block (*64) */
-#define        UBASE   0140000         /* abs. addr of user block */
-#define        NULL    0
-#define        CMASK   0               /* default mask for file creation */
-#define        NODEV   (dev_t)(-1)
-#define        ROOTINO ((ino_t)2)      /* i number of all roots */
-#define        SUPERB  ((daddr_t)1)    /* block number of the super block */
-#define        DIRSIZ  14              /* max characters per directory */
-#define        NICINOD 100             /* number of superblock inodes */
-#define        NICFREE 50              /* number of superblock free blocks */
-#define        INFSIZE 138             /* size of per-proc info for users */
-#define        CBSIZE  14              /* number of chars in a clist block */
-#define        CROUND  017             /* clist rounding: sizeof(int *) + CBSIZE - 1*/
-
-/*
- * Some macros for units conversion
- */
-/* Core clicks (64 bytes) to segments and vice versa */
-#define        ctos(x) ((x+127)/128)
-#define stoc(x) ((x)*128)
-
-/* Core clicks (64 bytes) to disk blocks */
-#define        ctod(x) ((x+7)>>3)
-
-/* inumber to disk address */
-#define        itod(x) (daddr_t)((((unsigned)x+15)>>3))
-
-/* inumber to disk offset */
-#define        itoo(x) (int)((x+15)&07)
-
-/* clicks to bytes */
-#define        ctob(x) (x<<6)
-
-/* bytes to clicks */
-#define        btoc(x) ((((unsigned)x+63)>>6))
-
-/* major part of a device */
-#define        major(x)        (int)(((unsigned)x>>8))
-
-/* minor part of a device */
-#define        minor(x)        (int)(x&0377)
-
-/* make a device number */
-#define        makedev(x,y)    (dev_t)((x)<<8 | (y))
-
-typedef        struct { int r[1]; } *  physadr;
-typedef        long            daddr_t;
-typedef char *         caddr_t;
-typedef        unsigned int    ino_t;
-typedef        long            time_t;
-typedef        int             label_t[6];     /* regs 2-7 */
-typedef        int             dev_t;
-typedef        long            off_t;
-
-/*
- * Machine-dependent bits and macros
- */
-#define        UMODE   0170000         /* usermode bits */
-#define        USERMODE(ps)    ((ps & UMODE)==UMODE)
-
-#define        INTPRI  0340            /* Priority bits */
-#define        BASEPRI(ps)     ((ps & INTPRI) != 0)
diff --git a/.ref-Research-V7/usr/sys/h/pk.h b/.ref-Research-V7/usr/sys/h/pk.h
deleted file mode 100644 (file)
index 4d8bc21..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * six-byte packet header for asynch lines.
- * headers for other devices take up the same
- * or less space.  If this changes the header
- * struct will have to become a union.
- */
-struct header {
-       char    sync;           /* sync byte */
-       char    ksize;          /* encoded packet size */
-       unsigned short sum;     /* block check of data packet */
-       char    cntl;           /* control byte */
-       char    ccntl;          /* block check of header */
-};
-#define        HDRSIZ  6
-
-/*
- * Control structure for a packet driver connection.
- */
-struct pack {
-       short   p_state;        /* line state */
-       short   p_bits;         /* mask for getepack */
-       short   p_rsize;        /* input packet size */
-       short   p_xsize;        /* output packet size */
-       struct  header p_ihbuf; /* input header */
-       struct  header p_ohbuf; /* output header */
-       char    *p_rptr;
-       char    p_mode;
-       char    **p_ipool;      /* head link to input buffer pool */
-       char    **p_io;         /* input buffer given to driver */
-       char    p_xcount;       /* # active output buffers */
-       char    p_rcount;
-       char    p_nout,p_tout;
-       char    p_lpsize;       /* log(psize/32) */
-       char    p_timer;
-       char    p_obusy;
-       char    p_srxmit;
-       char    p_rwindow;      /* window size */
-       char    p_swindow;
-       char    p_msg;          /* control msg */
-       char    p_rmsg;         /* repeated control msg */
-       char    p_ps,p_pr;      /* last packet sent, recv'd */
-       char    p_rpr;          /* copy of remote pr */
-       char    p_nxtps;        /* next output seq number */
-       char    p_imap;         /* bit map of input buffers */
-       char    p_pscopy;       /* newest output packet */
-       char    *p_ob[8];       /* output buffers */
-       char    *p_ib[8];       /* input buffers */
-       char    p_os[8];        /* output buffer status */
-       char    p_is[8];        /* input buffer status */
-       short   p_osum[8];      /* output checksums */
-       short   p_isum[8];      /* input checksums */
-       DSYSTEM;
-};
-#define        CHECK   0125252
-#define        SYN     020
-#define        MOD8    7
-#define        NOTCNTL(a)      (a & 0300)
-#define        MIN(a,b)        ((a<b)? a:b)
-
-char   next[8];
-char   mask[8];
-int    npbits;
-int    pkactive;
-int    pkzot;
-int    pkdisc;
-
-/*
- * driver state
- */
-#define        DEAD    0
-#define        INITa   1
-#define        INITb   2
-#define        INITab  3
-#define        LIVE    010
-#define        RXMIT   020
-#define        RREJ    040
-#define PDEBUG 0200
-#define        DRAINO  0400
-#define        WAITO   01000
-#define        DOWN    02000
-#define        RCLOSE  04000
-#define        BADFRAME 020000
-
-/*
- * modes
- */
-#define        SLOWMODE        0100
-/*
- * io buffer states
- */
-#define        B_NULL  0
-#define        B_READY 1
-#define        B_SENT  2
-#define        B_RESID 010
-#define        B_COPY  020
-#define        B_MARK  040
-#define        B_SHORT 0100
-
-/*
- * control messages
- */
-#define        CLOSE   1
-#define        RJ      2
-#define        SRJ     3
-#define        RR      4
-#define        INITC   5
-#define        INITB   6
-#define        INITA   7
-
-#define        M_RJ    4
-#define        M_SRJ   010
-#define        M_RR    020
-#define        M_INITC 040
-#define        M_CLOSE 2
-#define        M_INITA 0200
-#define        M_INITB 0100
-
-
-
-#define        PKOPRI  31
-#define        PKIPRI  30
-
-#define        NPLINES 8
-
-/*
- * packet ioctl buf
- */
-struct piocb {
-       unsigned t;
-       short   psize;
-       short   mode;
-       short   state;
-       char    window;
-};
-
-int pkdebug;
-int pksizes[];
-
-#define        Pwrite  1
-#define        Poutput 1
-#define        Pxint   1
-
-
-#define        Print   01
-#define        Prend   01
-#define        Pacc    01
-#define        Pread   01
-
-int    *PTRACE;
-
diff --git a/.ref-Research-V7/usr/sys/h/pk.p b/.ref-Research-V7/usr/sys/h/pk.p
deleted file mode 100644 (file)
index 5c21eed..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * kernel level
- */
-#ifdef KERNEL
-
-#define PADDR          ((struct pack *)tp->t_linep)
-#define TURNOFF                pkturnoff(tp)
-#define UCOUNT         u.u_count
-#define S              tp
-#define P              pk->p_ttyp
-#define SDEF           struct tty *tp
-#define FS             , tp
-
-#define SIGNAL         signal(pk->p_ttyp->t_pgrp, SIGPIPE)
-#define TERROR         pk->p_istate == R_ERROR
-#define SETERROR       u.u_error = EIO
-#define OBUSY          tp->t_state&BUSY
-#define        ODEAD           ((tp->t_state&CARR_ON)==0)
-char *getepack();
-#define GETEPACK       getepack(pk->p_bits)
-#define FREEPACK(a,b)  freepack(a, b)
-
-
-#define q1     tp->t_rawq
-#define q2     tp->t_canq
-#define q3     tp->t_outq
-
-#define LOCK           s = spl6()
-#define UNLOCK         splx(s)
-#define DSYSTEM                struct tty *p_ttyp
-#define ISYSTEM                tp = pk->p_ttyp
-#define SLEEP(a, b)    sleep((caddr_t)a, b)
-#define        SLEEPNO         (tp->t_chan!=NULL)
-#define WAKEUP(a)      wakeup((caddr_t)a)
-#define IOMOVE(p, c, f) iomove(p, c, f)
-#define PKGETPKT(p)
-#define DTOM(a)                dtom(a)
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/pk.h"
-#include "../h/tty.h"
-#include "../h/buf.h"
-#include "../h/proc.h"
-
-#endif
-/*
- * user level
- */
-#ifdef USER
-#define SLEEP(a, b) 
-#define SIGNAL
-#define WAKEUP(a)
-#define DSYSTEM                int p_ifn, p_ofn
-#define ISYSTEM
-#define GETEPACK       malloc(pk->p_xsize)
-#define FREEPACK(a, b) free(a)
-#define OBUSY          0
-#define PKGETPKT(p)    pkgetpack(p);
-#define DTOM(a)                1;
-#define S              ipk, ibuf, icount
-#define SDEF           int icount; char *ibuf; struct pack *ipk
-#define UCOUNT         icount
-#define IOMOVE(p, c, f)        pkmove(p, ibuf, c, f) ; ibuf += c; UCOUNT -= c
-#define PADDR          ipk
-#define TURNOFF
-#define LOCK
-#define UNLOCK
-#define SETERROR
-#define GENERROR(p, s)
-#define        PACKSIZE        64
-#define        WINDOWS         3
-#define        PKDEBUG(l, f, s) { extern Debug; if (Debug >= l) fprintf(stderr, f, s);}
-#define        PKASSERT(e, f, v) if (!(e)) {\
-fprintf(stderr, "AERROR - (%s) ", "e");\
-fprintf(stderr, f, v);\
-pkfail();};
-#endif
diff --git a/.ref-Research-V7/usr/sys/h/prim.h b/.ref-Research-V7/usr/sys/h/prim.h
deleted file mode 100644 (file)
index a710c9f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#define        NOSLEEP 0400
-#define        FORCE   01000
-#define        NORM    02000
-#define        KEEP    04000
-#define        CLR     010000
-
-int    bwaiting,wcount;
-
-char *getepack();
diff --git a/.ref-Research-V7/usr/sys/h/proc.h b/.ref-Research-V7/usr/sys/h/proc.h
deleted file mode 100644 (file)
index 7d6c1b1..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * One structure allocated per active
- * process. It contains all data needed
- * about the process while the
- * process may be swapped out.
- * Other per process data (user.h)
- * is swapped with the process.
- */
-struct proc {
-       char    p_stat;
-       char    p_flag;
-       char    p_pri;          /* priority, negative is high */
-       char    p_time;         /* resident time for scheduling */
-       char    p_cpu;          /* cpu usage for scheduling */
-       char    p_nice;         /* nice for cpu usage */
-       short   p_sig;          /* signals pending to this process */
-       short   p_uid;          /* user id, used to direct tty signals */
-       short   p_pgrp;         /* name of process group leader */
-       short   p_pid;          /* unique process id */
-       short   p_ppid;         /* process id of parent */
-       short   p_addr;         /* address of swappable image */
-       short   p_size;         /* size of swappable image (clicks) */
-       caddr_t p_wchan;        /* event process is awaiting */
-       struct text *p_textp;   /* pointer to text structure */
-       struct proc *p_link;    /* linked list of running processes */
-       int     p_clktim;       /* time to alarm clock signal */
-};
-
-extern struct proc proc[];     /* the proc table itself */
-
-/* stat codes */
-#define        SSLEEP  1               /* awaiting an event */
-#define        SWAIT   2               /* (abandoned state) */
-#define        SRUN    3               /* running */
-#define        SIDL    4               /* intermediate state in process creation */
-#define        SZOMB   5               /* intermediate state in process termination */
-#define        SSTOP   6               /* process being traced */
-
-/* flag codes */
-#define        SLOAD   01              /* in core */
-#define        SSYS    02              /* scheduling process */
-#define        SLOCK   04              /* process cannot be swapped */
-#define        SSWAP   010             /* process is being swapped out */
-#define        STRC    020             /* process is being traced */
-#define        SWTED   040             /* another tracing flag */
-#define        SULOCK  0100            /* user settable lock in core */
-
-/*
- * parallel proc structure
- * to replace part with times
- * to be passed to parent process
- * in ZOMBIE state.
- */
-struct xproc {
-       char    xp_stat;
-       char    xp_flag;
-       char    xp_pri;         /* priority, negative is high */
-       char    xp_time;        /* resident time for scheduling */
-       char    xp_cpu;         /* cpu usage for scheduling */
-       char    xp_nice;        /* nice for cpu usage */
-       short   xp_sig;         /* signals pending to this process */
-       short   xp_uid;         /* user id, used to direct tty signals */
-       short   xp_pgrp;        /* name of process group leader */
-       short   xp_pid;         /* unique process id */
-       short   xp_ppid;        /* process id of parent */
-       short   xp_xstat;       /* Exit status for wait */
-       time_t  xp_utime;       /* user time, this proc */
-       time_t  xp_stime;       /* system time, this proc */
-};
diff --git a/.ref-Research-V7/usr/sys/h/pwd.h b/.ref-Research-V7/usr/sys/h/pwd.h
deleted file mode 100644 (file)
index cfd941d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-struct passwd
-{
-       char    *pw_name;
-       char    *pw_passwd;
-       int     pw_uid;
-       int     pw_gid;
-       int     pw_quota;
-       char    *pw_comment;
-       char    *pw_gecos;
-       char    *pw_dir;
-       char    *pw_shell;
-};
diff --git a/.ref-Research-V7/usr/sys/h/reg.h b/.ref-Research-V7/usr/sys/h/reg.h
deleted file mode 100644 (file)
index 9a76d64..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Location of the users' stored
- * registers relative to R0.
- * Usage is u.u_ar0[XX].
- */
-#define        R0      (0)
-#define        R1      (-2)
-#define        R2      (-9)
-#define        R3      (-8)
-#define        R4      (-7)
-#define        R5      (-6)
-#define        R6      (-3)
-#define        R7      (1)
-#define        PC      (1)
-#define        RPS     (2)
-
-#define        TBIT    020             /* PS trace bit */
diff --git a/.ref-Research-V7/usr/sys/h/seg.h b/.ref-Research-V7/usr/sys/h/seg.h
deleted file mode 100644 (file)
index 5d7d296..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * KT-11 addresses and bits.
- */
-
-#define        UISD    ((physadr)0177600)      /* first user I-space descriptor register */
-#define        UISA    ((physadr)0177640)      /* first user I-space address register */
-#define        UDSA    ((physadr)0177660)      /* first user D-space address register */
-#define        RO      02              /* access abilities */
-#define        RW      06
-#define        ED      010             /* extend direction */
-#define        TX      020             /* Software: text segment */
-#define        ABS     040             /* Software: absolute address */
-
-/*
- * structure used to address
- * a sequence of integers.
- */
-physadr        ka6;            /* 11/40 KISA6; 11/45 KDSA6 */
-
-/*
- * address to access 11/70 UNIBUS map
- */
-#define        UBMAP   ((physadr)0170200)
diff --git a/.ref-Research-V7/usr/sys/h/smallparam.h b/.ref-Research-V7/usr/sys/h/smallparam.h
deleted file mode 100644 (file)
index cfb8720..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * tunable variables
- */
-
-#define        NBUF    8               /* size of buffer cache */
-#define        NINODE  75              /* number of in core inodes */
-#define        NFILE   75              /* number of in core file structures */
-#define        NMOUNT  3               /* number of mountable file systems */
-#define        MAXMEM  (64*32)         /* max core per process - first # is Kw */
-#define        MAXUPRC 15              /* max processes per user */
-#define        SSIZE   20              /* initial stack size (*64 bytes) */
-#define        SINCR   20              /* increment of stack (*64 bytes) */
-#define        NOFILE  20              /* max open files per process */
-#define        CANBSIZ 256             /* max size of typewriter line */
-#define        CMAPSIZ 50              /* size of core allocation area */
-#define        SMAPSIZ 50              /* size of swap allocation area */
-#define        NCALL   20              /* max simultaneous time callouts */
-#define        NPROC   50              /* max number of processes */
-#define        NTEXT   25              /* max number of pure texts */
-#define        NCLIST  100             /* max total clist size */
-#define        HZ      60              /* Ticks/second of the clock */
-#define        TIMEZONE (5*60)         /* Minutes westward from Greenwich */
-#define        DSTFLAG 1               /* Daylight Saving Time applies in this locality */
-#define        MSGBUFS 128             /* Characters saved from error messages */
-#define        NCARGS  5120            /* # characters in exec arglist */
-
-/*
- * priorities
- * probably should not be
- * altered too much
- */
-
-#define        PSWP    0
-#define        PINOD   10
-#define        PRIBIO  20
-#define        PZERO   25
-#define        NZERO   20
-#define        PPIPE   26
-#define        PWAIT   30
-#define        PSLEP   40
-#define        PUSER   50
-
-/*
- * signals
- * dont change
- */
-
-#define        NSIG    17
-/*
- * No more than 16 signals (1-16) because they are
- * stored in bits in a word.
- */
-#define        SIGHUP  1       /* hangup */
-#define        SIGINT  2       /* interrupt (rubout) */
-#define        SIGQUIT 3       /* quit (FS) */
-#define        SIGINS  4       /* illegal instruction */
-#define        SIGTRC  5       /* trace or breakpoint */
-#define        SIGIOT  6       /* iot */
-#define        SIGEMT  7       /* emt */
-#define        SIGFPT  8       /* floating exception */
-#define        SIGKIL  9       /* kill, uncatchable termination */
-#define        SIGBUS  10      /* bus error */
-#define        SIGSEG  11      /* segmentation violation */
-#define        SIGSYS  12      /* bad system call */
-#define        SIGPIPE 13      /* end of pipe */
-#define        SIGCLK  14      /* alarm clock */
-#define        SIGTRM  15      /* Catchable termination */
-
-/*
- * fundamental constants of the implementation--
- * cannot be changed easily
- */
-
-#define        NBPW    sizeof(int)     /* number of bytes in an integer */
-#define        BSIZE   512             /* size of secondary block (bytes) */
-/* BSLOP can be 0 unless you have a TIU/Spider */
-#define        BSLOP   2               /* In case some device needs bigger buffers */
-#define        NINDIR  (BSIZE/sizeof(daddr_t))
-#define        BMASK   0777            /* BSIZE-1 */
-#define        BSHIFT  9               /* LOG2(BSIZE) */
-#define        NMASK   0177            /* NINDIR-1 */
-#define        NSHIFT  7               /* LOG2(NINDIR) */
-#define        USIZE   16              /* size of user block (*64) */
-#define        UBASE   0140000         /* abs. addr of user block */
-#define        NULL    0
-#define        CMASK   0               /* default mask for file creation */
-#define        NODEV   (dev_t)(-1)
-#define        ROOTINO ((ino_t)2)      /* i number of all roots */
-#define        SUPERB  ((daddr_t)1)    /* block number of the super block */
-#define        DIRSIZ  14              /* max characters per directory */
-#define        NICINOD 100             /* number of superblock inodes */
-#define        NICFREE 50              /* number of superblock free blocks */
-#define        INFSIZE 138             /* size of per-proc info for users */
-#define        CBSIZE  6               /* number of chars in a clist block */
-#define        CROUND  07              /* clist rounding: sizeof(int *) + CBSIZE - 1*/
-
-/*
- * Some macros for units conversion
- */
-/* Core clicks (64 bytes) to segments and vice versa */
-#define        ctos(x) ((x+127)/128)
-#define stoc(x) ((x)*128)
-
-/* Core clicks (64 bytes) to disk blocks */
-#define        ctod(x) ((x+7)>>3)
-
-/* inumber to disk address */
-#define        itod(x) (daddr_t)((((unsigned)x+15)>>3))
-
-/* inumber to disk offset */
-#define        itoo(x) (int)((x+15)&07)
-
-/* clicks to bytes */
-#define        ctob(x) (x<<6)
-
-/* bytes to clicks */
-#define        btoc(x) ((((unsigned)x+63)>>6))
-
-/* major part of a device */
-#define        major(x)        (int)(((unsigned)x>>8))
-
-/* minor part of a device */
-#define        minor(x)        (int)(x&0377)
-
-/* make a device number */
-#define        makedev(x,y)    (dev_t)((x)<<8 | (y))
-
-typedef        struct { int r[1]; } *  physadr;
-typedef        long            daddr_t;
-typedef char *         caddr_t;
-typedef        unsigned int    ino_t;
-typedef        long            time_t;
-typedef        int             label_t[6];     /* regs 2-7 */
-typedef        int             dev_t;
-typedef        long            off_t;
-
-/*
- * Machine-dependent bits and macros
- */
-#define        UMODE   0170000         /* usermode bits */
-#define        USERMODE(ps)    ((ps & UMODE)==UMODE)
-
-#define        INTPRI  0340            /* Priority bits */
-#define        BASEPRI(ps)     ((ps & INTPRI) != 0)
diff --git a/.ref-Research-V7/usr/sys/h/stat.h b/.ref-Research-V7/usr/sys/h/stat.h
deleted file mode 100644 (file)
index d1f4dc8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-struct stat
-{
-       dev_t   st_dev;
-       ino_t   st_ino;
-       unsigned short st_mode;
-       short   st_nlink;
-       short   st_uid;
-       short   st_gid;
-       dev_t   st_rdev;
-       off_t   st_size;
-       time_t  st_atime;
-       time_t  st_mtime;
-       time_t  st_ctime;
-};
-
-#define        S_IFMT  0170000         /* type of file */
-#define                S_IFDIR 0040000 /* directory */
-#define                S_IFCHR 0020000 /* character special */
-#define                S_IFBLK 0060000 /* block special */
-#define                S_IFREG 0100000 /* regular */
-#define                S_IFMPC 0030000 /* multiplexed char special */
-#define                S_IFMPB 0070000 /* multiplexed block special */
-#define        S_ISUID 0004000         /* set user id on execution */
-#define        S_ISGID 0002000         /* set group id on execution */
-#define        S_ISVTX 0001000         /* save swapped text even after use */
-#define        S_IREAD 0000400         /* read permission, owner */
-#define        S_IWRITE        0000200         /* write permission, owner */
-#define        S_IEXEC 0000100         /* execute/search permission, owner */
diff --git a/.ref-Research-V7/usr/sys/h/systm.h b/.ref-Research-V7/usr/sys/h/systm.h
deleted file mode 100644 (file)
index 54d3a7a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Random set of variables
- * used by more than one
- * routine.
- */
-char   canonb[CANBSIZ];        /* buffer for erase and kill (#@) */
-struct inode *rootdir;         /* pointer to inode of root directory */
-struct proc *runq;             /* head of linked list of running processes */
-int    cputype;                /* type of cpu =40, 45, or 70 */
-int    lbolt;                  /* time of day in 60th not in time */
-time_t time;                   /* time in sec from 1970 */
-
-/*
- * Nblkdev is the number of entries
- * (rows) in the block switch. It is
- * set in binit/bio.c by making
- * a pass over the switch.
- * Used in bounds checking on major
- * device numbers.
- */
-int    nblkdev;
-
-/*
- * Number of character switch entries.
- * Set by cinit/tty.c
- */
-int    nchrdev;
-
-int    mpid;                   /* generic for unique process id's */
-char   runin;                  /* scheduling flag */
-char   runout;                 /* scheduling flag */
-char   runrun;                 /* scheduling flag */
-char   curpri;                 /* more scheduling */
-int    maxmem;                 /* actual max memory per process */
-physadr        lks;                    /* pointer to clock device */
-daddr_t        swplo;                  /* block number of swap space */
-int    nswap;                  /* size of swap space */
-int    updlock;                /* lock for sync */
-daddr_t        rablock;                /* block to be read ahead */
-extern char    regloc[];       /* locs. of saved user registers (trap.c) */
-char   msgbuf[MSGBUFS];        /* saved "printf" characters */
-dev_t  rootdev;                /* device of the root */
-dev_t  swapdev;                /* swapping device */
-dev_t  pipedev;                /* pipe device */
-extern int     icode[];        /* user init code */
-extern int     szicode;        /* its size */
-
-dev_t getmdev();
-daddr_t        bmap();
-struct inode *ialloc();
-struct inode *iget();
-struct inode *owner();
-struct inode *maknode();
-struct inode *namei();
-struct buf *alloc();
-struct buf *getblk();
-struct buf *geteblk();
-struct buf *bread();
-struct buf *breada();
-struct filsys *getfs();
-struct file *getf();
-struct file *falloc();
-int    uchar();
-/*
- * Instrumentation
- */
-int    dk_busy;
-long   dk_time[32];
-long   dk_numb[3];
-long   dk_wds[3];
-long   tk_nin;
-long   tk_nout;
-
-/*
- * Structure of the system-entry table
- */
-extern struct sysent {
-       char    sy_narg;                /* total number of arguments */
-       char    sy_nrarg;               /* number of args in registers */
-       int     (*sy_call)();           /* handler */
-} sysent[];
diff --git a/.ref-Research-V7/usr/sys/h/text.h b/.ref-Research-V7/usr/sys/h/text.h
deleted file mode 100644 (file)
index 3e3b69e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Text structure.
- * One allocated per pure
- * procedure on swap device.
- * Manipulated by text.c
- */
-struct text
-{
-       short   x_daddr;        /* disk address of segment (relative to swplo) */
-       short   x_caddr;        /* core address, if loaded */
-       short   x_size;         /* size (clicks) */
-       struct inode *x_iptr;   /* inode of prototype */
-       char    x_count;        /* reference count */
-       char    x_ccount;       /* number of loaded references */
-       char    x_flag;         /* traced, written flags */
-};
-
-extern struct text text[];
-
-#define        XTRC    01              /* Text may be written, exclusive use */
-#define        XWRIT   02              /* Text written into, must swap out */
-#define        XLOAD   04              /* Currently being read from file */
-#define        XLOCK   010             /* Being swapped in or out */
-#define        XWANT   020             /* Wanted for swapping */
diff --git a/.ref-Research-V7/usr/sys/h/timeb.h b/.ref-Research-V7/usr/sys/h/timeb.h
deleted file mode 100644 (file)
index 23c850c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * Structure returned by ftime system call
- */
-struct timeb {
-       time_t  time;
-       unsigned short millitm;
-       short   timezone;
-       short   dstflag;
-};
diff --git a/.ref-Research-V7/usr/sys/h/tty.h b/.ref-Research-V7/usr/sys/h/tty.h
deleted file mode 100644 (file)
index 71fbd8b..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * A clist structure is the head
- * of a linked list queue of characters.
- * The characters are stored in 4-word
- * blocks containing a link and several characters.
- * The routines getc and putc
- * manipulate these structures.
- */
-struct clist
-{
-       int     c_cc;           /* character count */
-       char    *c_cf;          /* pointer to first char */
-       char    *c_cl;          /* pointer to last char */
-};
-
-/*
- * A tty structure is needed for
- * each UNIX character device that
- * is used for normal terminal IO.
- * The routines in tty.c handle the
- * common code associated with
- * these structures.
- * The definition and device dependent
- * code is in each driver. (kl.c dc.c dh.c)
- */
-
-struct tc {
-       char    t_intrc;        /* interrupt */
-       char    t_quitc;        /* quit */
-       char    t_startc;       /* start output */
-       char    t_stopc;        /* stop output */
-       char    t_eofc;         /* end-of-file */
-       char    t_brkc;         /* input delimiter (like nl) */
-};
-
-struct tty
-{
-       struct  clist t_rawq;   /* input chars right off device */
-       struct  clist t_canq;   /* input chars after erase and kill */
-       struct  clist t_outq;   /* output list to device */
-       int     (* t_oproc)();  /* routine to start output */
-       int     (* t_iproc)();  /* routine to start input */
-       struct chan *t_chan;    /* destination channel */
-       caddr_t t_linep;        /* aux line discipline pointer */
-       caddr_t t_addr;         /* device address */
-       dev_t   t_dev;          /* device number */
-       short   t_flags;        /* mode, settable by ioctl call */
-       short   t_state;        /* internal state, not visible externally */
-       short   t_pgrp;         /* process group name */
-       char    t_delct;        /* number of delimiters in raw q */
-       char    t_line;         /* line discipline */
-       char    t_col;          /* printing column of device */
-       char    t_erase;        /* erase character */
-       char    t_kill;         /* kill character */
-       char    t_char;         /* character temporary */
-       char    t_ispeed;       /* input speed */
-       char    t_ospeed;       /* output speed */
-       union {
-               struct tc;
-               struct clist t_ctlq;
-       } t_un;
-};
-
-#define        tun     tp->t_un
-
-/*
- * structure of arg for ioctl
- */
-struct ttiocb {
-       char    ioc_ispeed;
-       char    ioc_ospeed;
-       char    ioc_erase;
-       char    ioc_kill;
-       int     ioc_flags;
-};
-
-#define        TTIPRI  28
-#define        TTOPRI  29
-
-#define        CERASE  '#'             /* default special characters */
-#define        CEOT    004
-#define        CKILL   '@'
-#define        CQUIT   034             /* FS, cntl shift L */
-#define        CINTR   0177            /* DEL */
-#define        CSTOP   023             /* Stop output: ctl-s */
-#define        CSTART  021             /* Start output: ctl-q */
-#define        CBRK    0377
-
-/* limits */
-#define        TTHIWAT 100
-#define        TTLOWAT 50
-#define        TTYHOG  256
-
-/* modes */
-#define        TANDEM  01
-#define        CBREAK  02
-#define        LCASE   04
-#define        ECHO    010
-#define        CRMOD   020
-#define        RAW     040
-#define        ODDP    0100
-#define        EVENP   0200
-#define        NLDELAY 001400
-#define        TBDELAY 006000
-#define        XTABS   006000
-#define        CRDELAY 030000
-#define        VTDELAY 040000
-
-/* Hardware bits */
-#define        DONE    0200
-#define        IENABLE 0100
-
-/* Internal state bits */
-#define        TIMEOUT 01              /* Delay timeout in progress */
-#define        WOPEN   02              /* Waiting for open to complete */
-#define        ISOPEN  04              /* Device is open */
-#define        FLUSH   010             /* outq has been flushed during DMA */
-#define        CARR_ON 020             /* Software copy of carrier-present */
-#define        BUSY    040             /* Output in progress */
-#define        ASLEEP  0100            /* Wakeup when output done */
-#define        XCLUDE  0200            /* exclusive-use flag against open */
-#define        TTSTOP  0400            /* Output stopped by ctl-s */
-#define        HUPCLS  01000           /* Hang up upon last close */
-#define        TBLOCK  02000           /* tandem queue blocked */
-#define        DKCMD   04000           /* datakit command channel */
-#define        DKMPX   010000          /* datakit user-multiplexed mode */
-#define        DKCALL  020000          /* datakit dial mode */
-#define        DKLINGR 040000          /* datakit lingering close mode */
-#define        CNTLQ   0100000         /* interpret t_un as clist */
-
-/*
- * tty ioctl commands
- */
-#define        TIOCGETD        (('t'<<8)|0)
-#define        TIOCSETD        (('t'<<8)|1)
-#define        TIOCHPCL        (('t'<<8)|2)
-#define        TIOCMODG        (('t'<<8)|3)
-#define        TIOCMODS        (('t'<<8)|4)
-#define        TIOCGETP        (('t'<<8)|8)
-#define        TIOCSETP        (('t'<<8)|9)
-#define        TIOCSETN        (('t'<<8)|10)
-#define        TIOCEXCL        (('t'<<8)|13)
-#define        TIOCNXCL        (('t'<<8)|14)
-#define        TIOCFLUSH       (('t'<<8)|16)
-#define        TIOCSETC        (('t'<<8)|17)
-#define        TIOCGETC        (('t'<<8)|18)
-#define        DIOCLSTN        (('d'<<8)|1)
-#define        DIOCNTRL        (('d'<<8)|2)
-#define        DIOCMPX         (('d'<<8)|3)
-#define        DIOCNMPX        (('d'<<8)|4)
-#define        DIOCSCALL       (('d'<<8)|5)
-#define        DIOCRCALL       (('d'<<8)|6)
-#define        DIOCPGRP        (('d'<<8)|7)
-#define        DIOCGETP        (('d'<<8)|8)
-#define        DIOCSETP        (('d'<<8)|9)
-#define        DIOCLOSE        (('d'<<8)|10)
-#define        DIOCTIME        (('d'<<8)|11)
-#define        DIOCRESET       (('d'<<8)|12)
-#define        FIOCLEX         (('f'<<8)|1)
-#define        FIONCLEX        (('f'<<8)|2)
-#define        MXLSTN          (('x'<<8)|1)
-#define        MXNBLK          (('x'<<8)|2)
diff --git a/.ref-Research-V7/usr/sys/h/types.h b/.ref-Research-V7/usr/sys/h/types.h
deleted file mode 100644 (file)
index 1640008..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-typedef        long            daddr_t;        /* disk address */
-typedef        char *          caddr_t;        /* core address */
-typedef        unsigned int    ino_t;          /* i-node number */
-typedef        long            time_t;         /* a time */
-typedef        int             label_t[6];     /* program status */
-typedef        int             dev_t;          /* device code */
-typedef        long            off_t;          /* offset in file */
-       /* selectors and constructor for device code */
-#define        major(x)        (int)(((unsigned)x>>8))
-#define        minor(x)        (int)(x&0377)
-#define        makedev(x,y)    (dev_t)((x)<<8|(y))
diff --git a/.ref-Research-V7/usr/sys/h/user.h b/.ref-Research-V7/usr/sys/h/user.h
deleted file mode 100644 (file)
index d5653ed..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * The user structure.
- * One allocated per process.
- * Contains all per process data
- * that doesn't need to be referenced
- * while the process is swapped.
- * The user block is USIZE*64 bytes
- * long; resides at virtual kernel
- * loc 140000; contains the system
- * stack per user; is cross referenced
- * with the proc structure for the
- * same process.
- */
-
-#define        EXCLOSE 01
-
-struct user
-{
-       label_t u_rsav;                 /* save info when exchanging stacks */
-       int     u_fper;                 /* FP error register */
-       int     u_fpsaved;              /* FP regs saved for this proc */
-       struct {
-               int     u_fpsr;         /* FP status register */
-               double  u_fpregs[6];    /* FP registers */
-       } u_fps;
-       char    u_segflg;               /* IO flag: 0:user D; 1:system; 2:user I */
-       char    u_error;                /* return error code */
-       short   u_uid;                  /* effective user id */
-       short   u_gid;                  /* effective group id */
-       short   u_ruid;                 /* real user id */
-       short   u_rgid;                 /* real group id */
-       struct proc *u_procp;           /* pointer to proc structure */
-       int     *u_ap;                  /* pointer to arglist */
-       union {                         /* syscall return values */
-               struct  {
-                       int     r_val1;
-                       int     r_val2;
-               };
-               off_t   r_off;
-               time_t  r_time;
-       } u_r;
-       caddr_t u_base;                 /* base address for IO */
-       unsigned int u_count;           /* bytes remaining for IO */
-       off_t   u_offset;               /* offset in file for IO */
-       struct inode *u_cdir;           /* pointer to inode of current directory */
-       struct inode *u_rdir;           /* root directory of current process */
-       char    u_dbuf[DIRSIZ];         /* current pathname component */
-       caddr_t u_dirp;                 /* pathname pointer */
-       struct direct u_dent;           /* current directory entry */
-       struct inode *u_pdir;           /* inode of parent directory of dirp */
-       int     u_uisa[16];             /* prototype of segmentation addresses */
-       int     u_uisd[16];             /* prototype of segmentation descriptors */
-       struct file *u_ofile[NOFILE];   /* pointers to file structures of open files */
-       char    u_pofile[NOFILE];       /* per-process flags of open files */
-       int     u_arg[5];               /* arguments to current system call */
-       unsigned u_tsize;               /* text size (clicks) */
-       unsigned u_dsize;               /* data size (clicks) */
-       unsigned u_ssize;               /* stack size (clicks) */
-       label_t u_qsav;                 /* label variable for quits and interrupts */
-       label_t u_ssav;                 /* label variable for swapping */
-       int     u_signal[NSIG];         /* disposition of signals */
-       time_t  u_utime;                /* this process user time */
-       time_t  u_stime;                /* this process system time */
-       time_t  u_cutime;               /* sum of childs' utimes */
-       time_t  u_cstime;               /* sum of childs' stimes */
-       int     *u_ar0;                 /* address of users saved R0 */
-       struct {                        /* profile arguments */
-               short   *pr_base;       /* buffer base */
-               unsigned pr_size;       /* buffer size */
-               unsigned pr_off;        /* pc offset */
-               unsigned pr_scale;      /* pc scaling */
-       } u_prof;
-       char    u_intflg;               /* catch intr from sys */
-       char    u_sep;                  /* flag for I and D separation */
-       struct tty *u_ttyp;             /* controlling tty pointer */
-       dev_t   u_ttyd;                 /* controlling tty dev */
-       struct {                        /* header of executable file */
-               int     ux_mag;         /* magic number */
-               unsigned ux_tsize;      /* text size */
-               unsigned ux_dsize;      /* data size */
-               unsigned ux_bsize;      /* bss size */
-               unsigned ux_ssize;      /* symbol table size */
-               unsigned ux_entloc;     /* entry location */
-               unsigned ux_unused;
-               unsigned ux_relflg;
-       } u_exdata;
-       char    u_comm[DIRSIZ];
-       time_t  u_start;
-       char    u_acflag;
-       short   u_fpflag;               /* unused now, will be later */
-       short   u_cmask;                /* mask for file creation */
-       int     u_stack[1];
-                                       /* kernel stack per user
-                                        * extends from u + USIZE*64
-                                        * backward not to reach here
-                                        */
-};
-
-extern struct user u;
-
-/* u_error codes */
-#define        EPERM   1
-#define        ENOENT  2
-#define        ESRCH   3
-#define        EINTR   4
-#define        EIO     5
-#define        ENXIO   6
-#define        E2BIG   7
-#define        ENOEXEC 8
-#define        EBADF   9
-#define        ECHILD  10
-#define        EAGAIN  11
-#define        ENOMEM  12
-#define        EACCES  13
-#define        EFAULT  14
-#define        ENOTBLK 15
-#define        EBUSY   16
-#define        EEXIST  17
-#define        EXDEV   18
-#define        ENODEV  19
-#define        ENOTDIR 20
-#define        EISDIR  21
-#define        EINVAL  22
-#define        ENFILE  23
-#define        EMFILE  24
-#define        ENOTTY  25
-#define        ETXTBSY 26
-#define        EFBIG   27
-#define        ENOSPC  28
-#define        ESPIPE  29
-#define        EROFS   30
-#define        EMLINK  31
-#define        EPIPE   32
-#define        EDOM    33
-#define        ERANGE  34
diff --git a/.ref-Research-V7/usr/sys/sys/acct.c b/.ref-Research-V7/usr/sys/sys/acct.c
deleted file mode 100644 (file)
index ec3f04f..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/acct.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/inode.h"
-#include "../h/proc.h"
-#include "../h/seg.h"
-
-/*
- * Perform process accounting functions.
- */
-
-sysacct()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if (suser()) {
-               if (uap->fname==NULL) {
-                       if (acctp) {
-                               plock(acctp);
-                               iput(acctp);
-                               acctp = NULL;
-                       }
-                       return;
-               }
-               if (acctp) {
-                       u.u_error = EBUSY;
-                       return;
-               }
-               ip = namei(uchar, 0);
-               if(ip == NULL)
-                       return;
-               if((ip->i_mode & IFMT) != IFREG) {
-                       u.u_error = EACCES;
-                       iput(ip);
-                       return;
-               }
-               acctp = ip;
-               prele(ip);
-       }
-}
-
-/*
- * On exit, write a record on the accounting file.
- */
-acct()
-{
-       register i;
-       register struct inode *ip;
-       off_t siz;
-
-       if ((ip=acctp)==NULL)
-               return;
-       plock(ip);
-       for (i=0; i<sizeof(acctbuf.ac_comm); i++)
-               acctbuf.ac_comm[i] = u.u_comm[i];
-       acctbuf.ac_utime = compress(u.u_utime);
-       acctbuf.ac_stime = compress(u.u_stime);
-       acctbuf.ac_etime = compress(time - u.u_start);
-       acctbuf.ac_btime = u.u_start;
-       acctbuf.ac_uid = u.u_ruid;
-       acctbuf.ac_gid = u.u_rgid;
-       acctbuf.ac_mem = 0;
-       acctbuf.ac_io = 0;
-       acctbuf.ac_tty = u.u_ttyd;
-       acctbuf.ac_flag = u.u_acflag;
-       siz = ip->i_size;
-       u.u_offset = siz;
-       u.u_base = (caddr_t)&acctbuf;
-       u.u_count = sizeof(acctbuf);
-       u.u_segflg = 1;
-       u.u_error = 0;
-       writei(ip);
-       if(u.u_error)
-               ip->i_size = siz;
-       prele(ip);
-}
-
-/*
- * Produce a pseudo-floating point representation
- * with 3 bits base-8 exponent, 13 bits fraction.
- */
-compress(t)
-register time_t t;
-{
-       register exp = 0, round = 0;
-
-       while (t >= 8192) {
-               exp++;
-               round = t&04;
-               t >>= 3;
-       }
-       if (round) {
-               t++;
-               if (t >= 8192) {
-                       t >>= 3;
-                       exp++;
-               }
-       }
-       return((exp<<13) + t);
-}
-
-/*
- * lock user into core as much
- * as possible. swapping may still
- * occur if core grows.
- */
-syslock()
-{
-       register struct proc *p;
-       register struct a {
-               int     flag;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if(suser()) {
-               p = u.u_procp;
-               p->p_flag &= ~SULOCK;
-               if(uap->flag)
-                       p->p_flag |= SULOCK;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/sys/alloc.c b/.ref-Research-V7/usr/sys/sys/alloc.c
deleted file mode 100644 (file)
index 6892659..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mount.h"
-#include "../h/filsys.h"
-#include "../h/fblk.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-#include "../h/inode.h"
-#include "../h/ino.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-typedef        struct fblk *FBLKP;
-
-/*
- * alloc will obtain the next available
- * free disk block from the free list of
- * the specified device.
- * The super block has up to NICFREE remembered
- * free blocks; the last of these is read to
- * obtain NICFREE more . . .
- *
- * no space on dev x/y -- when
- * the free list is exhausted.
- */
-struct buf *
-alloc(dev)
-dev_t dev;
-{
-       daddr_t bno;
-       register struct filsys *fp;
-       register struct buf *bp;
-
-       fp = getfs(dev);
-       while(fp->s_flock)
-               sleep((caddr_t)&fp->s_flock, PINOD);
-       do {
-               if(fp->s_nfree <= 0)
-                       goto nospace;
-               if (fp->s_nfree > NICFREE) {
-                       prdev("Bad free count", dev);
-                       goto nospace;
-               }
-               bno = fp->s_free[--fp->s_nfree];
-               if(bno == 0)
-                       goto nospace;
-       } while (badblock(fp, bno, dev));
-       if(fp->s_nfree <= 0) {
-               fp->s_flock++;
-               bp = bread(dev, bno);
-               if ((bp->b_flags&B_ERROR) == 0) {
-                       fp->s_nfree = ((FBLKP)(bp->b_un.b_addr))->df_nfree;
-                       bcopy((caddr_t)((FBLKP)(bp->b_un.b_addr))->df_free,
-                           (caddr_t)fp->s_free, sizeof(fp->s_free));
-               }
-               brelse(bp);
-               fp->s_flock = 0;
-               wakeup((caddr_t)&fp->s_flock);
-               if (fp->s_nfree <=0)
-                       goto nospace;
-       }
-       bp = getblk(dev, bno);
-       clrbuf(bp);
-       fp->s_fmod = 1;
-       return(bp);
-
-nospace:
-       fp->s_nfree = 0;
-       prdev("no space", dev);
-       u.u_error = ENOSPC;
-       return(NULL);
-}
-
-/*
- * place the specified disk block
- * back on the free list of the
- * specified device.
- */
-free(dev, bno)
-dev_t dev;
-daddr_t bno;
-{
-       register struct filsys *fp;
-       register struct buf *bp;
-
-       fp = getfs(dev);
-       fp->s_fmod = 1;
-       while(fp->s_flock)
-               sleep((caddr_t)&fp->s_flock, PINOD);
-       if (badblock(fp, bno, dev))
-               return;
-       if(fp->s_nfree <= 0) {
-               fp->s_nfree = 1;
-               fp->s_free[0] = 0;
-       }
-       if(fp->s_nfree >= NICFREE) {
-               fp->s_flock++;
-               bp = getblk(dev, bno);
-               ((FBLKP)(bp->b_un.b_addr))->df_nfree = fp->s_nfree;
-               bcopy((caddr_t)fp->s_free,
-                       (caddr_t)((FBLKP)(bp->b_un.b_addr))->df_free,
-                       sizeof(fp->s_free));
-               fp->s_nfree = 0;
-               bwrite(bp);
-               fp->s_flock = 0;
-               wakeup((caddr_t)&fp->s_flock);
-       }
-       fp->s_free[fp->s_nfree++] = bno;
-       fp->s_fmod = 1;
-}
-
-/*
- * Check that a block number is in the
- * range between the I list and the size
- * of the device.
- * This is used mainly to check that a
- * garbage file system has not been mounted.
- *
- * bad block on dev x/y -- not in range
- */
-badblock(fp, bn, dev)
-register struct filsys *fp;
-daddr_t bn;
-dev_t dev;
-{
-
-       if (bn < fp->s_isize || bn >= fp->s_fsize) {
-               prdev("bad block", dev);
-               return(1);
-       }
-       return(0);
-}
-
-/*
- * Allocate an unused I node
- * on the specified device.
- * Used with file creation.
- * The algorithm keeps up to
- * NICINOD spare I nodes in the
- * super block. When this runs out,
- * a linear search through the
- * I list is instituted to pick
- * up NICINOD more.
- */
-struct inode *
-ialloc(dev)
-dev_t dev;
-{
-       register struct filsys *fp;
-       register struct buf *bp;
-       register struct inode *ip;
-       int i;
-       struct dinode *dp;
-       ino_t ino;
-       daddr_t adr;
-
-       fp = getfs(dev);
-       while(fp->s_ilock)
-               sleep((caddr_t)&fp->s_ilock, PINOD);
-loop:
-       if(fp->s_ninode > 0) {
-               ino = fp->s_inode[--fp->s_ninode];
-               if (ino < ROOTINO)
-                       goto loop;
-               ip = iget(dev, ino);
-               if(ip == NULL)
-                       return(NULL);
-               if(ip->i_mode == 0) {
-                       for (i=0; i<NADDR; i++)
-                               ip->i_un.i_addr[i] = 0;
-                       fp->s_fmod = 1;
-                       return(ip);
-               }
-               /*
-                * Inode was allocated after all.
-                * Look some more.
-                */
-               iput(ip);
-               goto loop;
-       }
-       fp->s_ilock++;
-       ino = 1;
-       for(adr = SUPERB+1; adr < fp->s_isize; adr++) {
-               bp = bread(dev, adr);
-               if (bp->b_flags & B_ERROR) {
-                       brelse(bp);
-                       ino += INOPB;
-                       continue;
-               }
-               dp = bp->b_un.b_dino;
-               for(i=0; i<INOPB; i++) {
-                       if(dp->di_mode != 0)
-                               goto cont;
-                       for(ip = &inode[0]; ip < &inode[NINODE]; ip++)
-                       if(dev==ip->i_dev && ino==ip->i_number)
-                               goto cont;
-                       fp->s_inode[fp->s_ninode++] = ino;
-                       if(fp->s_ninode >= NICINOD)
-                               break;
-               cont:
-                       ino++;
-                       dp++;
-               }
-               brelse(bp);
-               if(fp->s_ninode >= NICINOD)
-                       break;
-       }
-       fp->s_ilock = 0;
-       wakeup((caddr_t)&fp->s_ilock);
-       if(fp->s_ninode > 0)
-               goto loop;
-       prdev("Out of inodes", dev);
-       u.u_error = ENOSPC;
-       return(NULL);
-}
-
-/*
- * Free the specified I node
- * on the specified device.
- * The algorithm stores up
- * to NICINOD I nodes in the super
- * block and throws away any more.
- */
-ifree(dev, ino)
-dev_t dev;
-ino_t ino;
-{
-       register struct filsys *fp;
-
-       fp = getfs(dev);
-       if(fp->s_ilock)
-               return;
-       if(fp->s_ninode >= NICINOD)
-               return;
-       fp->s_inode[fp->s_ninode++] = ino;
-       fp->s_fmod = 1;
-}
-
-/*
- * getfs maps a device number into
- * a pointer to the incore super
- * block.
- * The algorithm is a linear
- * search through the mount table.
- * A consistency check of the
- * in core free-block and i-node
- * counts.
- *
- * bad count on dev x/y -- the count
- *     check failed. At this point, all
- *     the counts are zeroed which will
- *     almost certainly lead to "no space"
- *     diagnostic
- * panic: no fs -- the device is not mounted.
- *     this "cannot happen"
- */
-struct filsys *
-getfs(dev)
-dev_t dev;
-{
-       register struct mount *mp;
-       register struct filsys *fp;
-
-       for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++)
-       if(mp->m_bufp != NULL && mp->m_dev == dev) {
-               fp = mp->m_bufp->b_un.b_filsys;
-               if(fp->s_nfree > NICFREE || fp->s_ninode > NICINOD) {
-                       prdev("bad count", dev);
-                       fp->s_nfree = 0;
-                       fp->s_ninode = 0;
-               }
-               return(fp);
-       }
-       panic("no fs");
-       return(NULL);
-}
-
-/*
- * update is the internal name of
- * 'sync'. It goes through the disk
- * queues to initiate sandbagged IO;
- * goes through the I nodes to write
- * modified nodes; and it goes through
- * the mount table to initiate modified
- * super blocks.
- */
-update()
-{
-       register struct inode *ip;
-       register struct mount *mp;
-       register struct buf *bp;
-       struct filsys *fp;
-
-       if(updlock)
-               return;
-       updlock++;
-       for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++)
-               if(mp->m_bufp != NULL) {
-                       fp = mp->m_bufp->b_un.b_filsys;
-                       if(fp->s_fmod==0 || fp->s_ilock!=0 ||
-                          fp->s_flock!=0 || fp->s_ronly!=0)
-                               continue;
-                       bp = getblk(mp->m_dev, SUPERB);
-                       if (bp->b_flags & B_ERROR)
-                               continue;
-                       fp->s_fmod = 0;
-                       fp->s_time = time;
-                       bcopy((caddr_t)fp, bp->b_un.b_addr, BSIZE);
-                       bwrite(bp);
-               }
-       for(ip = &inode[0]; ip < &inode[NINODE]; ip++)
-               if((ip->i_flag&ILOCK)==0 && ip->i_count) {
-                       ip->i_flag |= ILOCK;
-                       ip->i_count++;
-                       iupdat(ip, &time, &time);
-                       iput(ip);
-               }
-       updlock = 0;
-       bflush(NODEV);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/clock.c b/.ref-Research-V7/usr/sys/sys/clock.c
deleted file mode 100644 (file)
index 70e2c4c..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/callo.h"
-#include "../h/seg.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/reg.h"
-
-#define        SCHMAG  8/10
-
-/*
- * clock is called straight from
- * the real time clock interrupt.
- *
- * Functions:
- *     reprime clock
- *     copy *switches to display
- *     implement callouts
- *     maintain user/system times
- *     maintain date
- *     profile
- *     lightning bolt wakeup (every second)
- *     alarm clock signals
- *     jab the scheduler
- */
-
-clock(dev, sp, r1, nps, r0, pc, ps)
-dev_t dev;
-caddr_t pc;
-{
-       register struct callo *p1, *p2;
-       register struct proc *pp;
-       int a;
-       extern caddr_t waitloc;
-
-       /*
-        * restart clock
-        */
-
-       lks->r[0] = 0115;
-
-       /*
-        * display register
-        */
-
-       display();
-       /*
-        * callouts
-        * if none, just continue
-        * else update first non-zero time
-        */
-
-       if(callout[0].c_func == NULL)
-               goto out;
-       p2 = &callout[0];
-       while(p2->c_time<=0 && p2->c_func!=NULL)
-               p2++;
-       p2->c_time--;
-
-       /*
-        * if ps is high, just return
-        */
-       if (BASEPRI(ps))
-               goto out;
-
-       /*
-        * callout
-        */
-
-       spl5();
-       if(callout[0].c_time <= 0) {
-               p1 = &callout[0];
-               while(p1->c_func != 0 && p1->c_time <= 0) {
-                       (*p1->c_func)(p1->c_arg);
-                       p1++;
-               }
-               p2 = &callout[0];
-               while(p2->c_func = p1->c_func) {
-                       p2->c_time = p1->c_time;
-                       p2->c_arg = p1->c_arg;
-                       p1++;
-                       p2++;
-               }
-       }
-
-       /*
-        * lightning bolt time-out
-        * and time of day
-        */
-out:
-       a = dk_busy&07;
-       if (USERMODE(ps)) {
-               u.u_utime++;
-               if(u.u_prof.pr_scale)
-                       addupc(pc, &u.u_prof, 1);
-               if(u.u_procp->p_nice > NZERO)
-                       a += 8;
-       } else {
-               a += 16;
-               if (pc == waitloc)
-                       a += 8;
-               u.u_stime++;
-       }
-       dk_time[a] += 1;
-       pp = u.u_procp;
-       if(++pp->p_cpu == 0)
-               pp->p_cpu--;
-       if(++lbolt >= HZ) {
-               if (BASEPRI(ps))
-                       return;
-               lbolt -= HZ;
-               ++time;
-               spl1();
-               runrun++;
-               wakeup((caddr_t)&lbolt);
-               for(pp = &proc[0]; pp < &proc[NPROC]; pp++)
-               if (pp->p_stat && pp->p_stat<SZOMB) {
-                       if(pp->p_time != 127)
-                               pp->p_time++;
-                       if(pp->p_clktim)
-                               if(--pp->p_clktim == 0)
-                                       psignal(pp, SIGCLK);
-                       a = (pp->p_cpu & 0377)*SCHMAG + pp->p_nice - NZERO;
-                       if(a < 0)
-                               a = 0;
-                       if(a > 255)
-                               a = 255;
-                       pp->p_cpu = a;
-                       if(pp->p_pri >= PUSER)
-                               setpri(pp);
-               }
-               if(runin!=0) {
-                       runin = 0;
-                       wakeup((caddr_t)&runin);
-               }
-       }
-}
-
-/*
- * timeout is called to arrange that
- * fun(arg) is called in tim/HZ seconds.
- * An entry is sorted into the callout
- * structure. The time in each structure
- * entry is the number of HZ's more
- * than the previous entry.
- * In this way, decrementing the
- * first entry has the effect of
- * updating all entries.
- *
- * The panic is there because there is nothing
- * intelligent to be done if an entry won't fit.
- */
-timeout(fun, arg, tim)
-int (*fun)();
-caddr_t arg;
-{
-       register struct callo *p1, *p2;
-       register int t;
-       int s;
-
-       t = tim;
-       p1 = &callout[0];
-       s = spl7();
-       while(p1->c_func != 0 && p1->c_time <= t) {
-               t -= p1->c_time;
-               p1++;
-       }
-       if (p1 >= &callout[NCALL-1])
-               panic("Timeout table overflow");
-       p1->c_time -= t;
-       p2 = p1;
-       while(p2->c_func != 0)
-               p2++;
-       while(p2 >= p1) {
-               (p2+1)->c_time = p2->c_time;
-               (p2+1)->c_func = p2->c_func;
-               (p2+1)->c_arg = p2->c_arg;
-               p2--;
-       }
-       p1->c_time = t;
-       p1->c_func = fun;
-       p1->c_arg = arg;
-       splx(s);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/fakemx.c b/.ref-Research-V7/usr/sys/sys/fakemx.c
deleted file mode 100644 (file)
index 5496063..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Fake multiplexor routines to satisfy references
- * if you don't want it.
- */
-
-#include "../h/param.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/tty.h"
-#include "../h/inode.h"
-#include "../h/mx.h"
-
-sdata(cp)
-struct chan *cp;
-{
-}
-
-mcttstart(tp)
-struct tty *tp;
-{
-}
-
-mpxchan()
-{
-       u.u_error = EINVAL;
-}
-
-mcstart(p, q)
-struct chan *p;
-caddr_t q;
-{
-}
-
-scontrol(chan, s, c)
-struct chan *chan;
-{
-}
diff --git a/.ref-Research-V7/usr/sys/sys/fio.c b/.ref-Research-V7/usr/sys/sys/fio.c
deleted file mode 100644 (file)
index 57286f3..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/filsys.h"
-#include "../h/file.h"
-#include "../h/conf.h"
-#include "../h/inode.h"
-#include "../h/reg.h"
-#include "../h/acct.h"
-
-/*
- * Convert a user supplied
- * file descriptor into a pointer
- * to a file structure.
- * Only task is to check range
- * of the descriptor.
- */
-struct file *
-getf(f)
-register int f;
-{
-       register struct file *fp;
-
-       if(0 <= f && f < NOFILE) {
-               fp = u.u_ofile[f];
-               if(fp != NULL)
-                       return(fp);
-       }
-       u.u_error = EBADF;
-       return(NULL);
-}
-
-/*
- * Internal form of close.
- * Decrement reference count on
- * file structure.
- * Also make sure the pipe protocol
- * does not constipate.
- *
- * Decrement reference count on the inode following
- * removal to the referencing file structure.
- * Call device handler on last close.
- */
-closef(fp)
-register struct file *fp;
-{
-       register struct inode *ip;
-       int flag, mode;
-       dev_t dev;
-       register int (*cfunc)();
-       struct chan *cp;
-
-       if(fp == NULL)
-               return;
-       if (fp->f_count > 1) {
-               fp->f_count--;
-               return;
-       }
-       ip = fp->f_inode;
-       flag = fp->f_flag;
-       cp = fp->f_un.f_chan;
-       dev = (dev_t)ip->i_un.i_rdev;
-       mode = ip->i_mode;
-
-       plock(ip);
-       fp->f_count = 0;
-       if(flag & FPIPE) {
-               ip->i_mode &= ~(IREAD|IWRITE);
-               wakeup((caddr_t)ip+1);
-               wakeup((caddr_t)ip+2);
-       }
-       iput(ip);
-
-       switch(mode&IFMT) {
-
-       case IFCHR:
-       case IFMPC:
-               cfunc = cdevsw[major(dev)].d_close;
-               break;
-
-       case IFBLK:
-       case IFMPB:
-               cfunc = bdevsw[major(dev)].d_close;
-               break;
-       default:
-               return;
-       }
-
-       if ((flag & FMP) == 0)
-               for(fp=file; fp < &file[NFILE]; fp++)
-                       if (fp->f_count && fp->f_inode==ip)
-                               return;
-       (*cfunc)(dev, flag, cp);
-}
-
-/*
- * openi called to allow handler
- * of special files to initialize and
- * validate before actual IO.
- */
-openi(ip, rw)
-register struct inode *ip;
-{
-       dev_t dev;
-       register unsigned int maj;
-
-       dev = (dev_t)ip->i_un.i_rdev;
-       maj = major(dev);
-       switch(ip->i_mode&IFMT) {
-
-       case IFCHR:
-       case IFMPC:
-               if(maj >= nchrdev)
-                       goto bad;
-               (*cdevsw[maj].d_open)(dev, rw);
-               break;
-
-       case IFBLK:
-       case IFMPB:
-               if(maj >= nblkdev)
-                       goto bad;
-               (*bdevsw[maj].d_open)(dev, rw);
-       }
-       return;
-
-bad:
-       u.u_error = ENXIO;
-}
-
-/*
- * Check mode permission on inode pointer.
- * Mode is READ, WRITE or EXEC.
- * In the case of WRITE, the
- * read-only status of the file
- * system is checked.
- * Also in WRITE, prototype text
- * segments cannot be written.
- * The mode is shifted to select
- * the owner/group/other fields.
- * The super user is granted all
- * permissions.
- */
-access(ip, mode)
-register struct inode *ip;
-{
-       register m;
-
-       m = mode;
-       if(m == IWRITE) {
-               if(getfs(ip->i_dev)->s_ronly != 0) {
-                       u.u_error = EROFS;
-                       return(1);
-               }
-               if (ip->i_flag&ITEXT)           /* try to free text */
-                       xrele(ip);
-               if(ip->i_flag & ITEXT) {
-                       u.u_error = ETXTBSY;
-                       return(1);
-               }
-       }
-       if(u.u_uid == 0)
-               return(0);
-       if(u.u_uid != ip->i_uid) {
-               m >>= 3;
-               if(u.u_gid != ip->i_gid)
-                       m >>= 3;
-       }
-       if((ip->i_mode&m) != 0)
-               return(0);
-
-       u.u_error = EACCES;
-       return(1);
-}
-
-/*
- * Look up a pathname and test if
- * the resultant inode is owned by the
- * current user.
- * If not, try for super-user.
- * If permission is granted,
- * return inode pointer.
- */
-struct inode *
-owner()
-{
-       register struct inode *ip;
-
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return(NULL);
-       if(u.u_uid == ip->i_uid)
-               return(ip);
-       if(suser())
-               return(ip);
-       iput(ip);
-       return(NULL);
-}
-
-/*
- * Test if the current user is the
- * super user.
- */
-suser()
-{
-
-       if(u.u_uid == 0) {
-               u.u_acflag |= ASU;
-               return(1);
-       }
-       u.u_error = EPERM;
-       return(0);
-}
-
-/*
- * Allocate a user file descriptor.
- */
-ufalloc()
-{
-       register i;
-
-       for(i=0; i<NOFILE; i++)
-               if(u.u_ofile[i] == NULL) {
-                       u.u_r.r_val1 = i;
-                       u.u_pofile[i] = 0;
-                       return(i);
-               }
-       u.u_error = EMFILE;
-       return(-1);
-}
-
-/*
- * Allocate a user file descriptor
- * and a file structure.
- * Initialize the descriptor
- * to point at the file structure.
- *
- * no file -- if there are no available
- *     file structures.
- */
-struct file *
-falloc()
-{
-       register struct file *fp;
-       register i;
-
-       i = ufalloc();
-       if(i < 0)
-               return(NULL);
-       for(fp = &file[0]; fp < &file[NFILE]; fp++)
-               if(fp->f_count == 0) {
-                       u.u_ofile[i] = fp;
-                       fp->f_count++;
-                       fp->f_un.f_offset = 0;
-                       return(fp);
-               }
-       printf("no file\n");
-       u.u_error = ENFILE;
-       return(NULL);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/iget.c b/.ref-Research-V7/usr/sys/sys/iget.c
deleted file mode 100644 (file)
index 440eb78..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mount.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/inode.h"
-#include "../h/ino.h"
-#include "../h/filsys.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-
-/*
- * Look up an inode by device,inumber.
- * If it is in core (in the inode structure),
- * honor the locking protocol.
- * If it is not in core, read it in from the
- * specified device.
- * If the inode is mounted on, perform
- * the indicated indirection.
- * In all cases, a pointer to a locked
- * inode structure is returned.
- *
- * printf warning: no inodes -- if the inode
- *     structure is full
- * panic: no imt -- if the mounted file
- *     system is not in the mount table.
- *     "cannot happen"
- */
-struct inode *
-iget(dev, ino)
-dev_t dev;
-ino_t ino;
-{
-       register struct inode *ip;
-       register struct mount *mp;
-       register struct inode *oip;
-       register struct buf *bp;
-       register struct dinode *dp;
-
-loop:
-       oip = NULL;
-       for(ip = &inode[0]; ip < &inode[NINODE]; ip++) {
-               if(ino == ip->i_number && dev == ip->i_dev) {
-                       if((ip->i_flag&ILOCK) != 0) {
-                               ip->i_flag |= IWANT;
-                               sleep((caddr_t)ip, PINOD);
-                               goto loop;
-                       }
-                       if((ip->i_flag&IMOUNT) != 0) {
-                               for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++)
-                               if(mp->m_inodp == ip) {
-                                       dev = mp->m_dev;
-                                       ino = ROOTINO;
-                                       goto loop;
-                               }
-                               panic("no imt");
-                       }
-                       ip->i_count++;
-                       ip->i_flag |= ILOCK;
-                       return(ip);
-               }
-               if(oip==NULL && ip->i_count==0)
-                       oip = ip;
-       }
-       ip = oip;
-       if(ip == NULL) {
-               printf("Inode table overflow\n");
-               u.u_error = ENFILE;
-               return(NULL);
-       }
-       ip->i_dev = dev;
-       ip->i_number = ino;
-       ip->i_flag = ILOCK;
-       ip->i_count++;
-       ip->i_un.i_lastr = 0;
-       bp = bread(dev, itod(ino));
-       /*
-        * Check I/O errors
-        */
-       if((bp->b_flags&B_ERROR) != 0) {
-               brelse(bp);
-               iput(ip);
-               return(NULL);
-       }
-       dp = bp->b_un.b_dino;
-       dp += itoo(ino);
-       iexpand(ip, dp);
-       brelse(bp);
-       return(ip);
-}
-
-iexpand(ip, dp)
-register struct inode *ip;
-register struct dinode *dp;
-{
-       register char *p1;
-       char *p2;
-       int i;
-
-       ip->i_mode = dp->di_mode;
-       ip->i_nlink = dp->di_nlink;
-       ip->i_uid = dp->di_uid;
-       ip->i_gid = dp->di_gid;
-       ip->i_size = dp->di_size;
-       p1 = (char *)ip->i_un.i_addr;
-       p2 = (char *)dp->di_addr;
-       for(i=0; i<NADDR; i++) {
-               *p1++ = *p2++;
-               *p1++ = 0;
-               *p1++ = *p2++;
-               *p1++ = *p2++;
-       }
-}
-
-/*
- * Decrement reference count of
- * an inode structure.
- * On the last reference,
- * write the inode out and if necessary,
- * truncate and deallocate the file.
- */
-iput(ip)
-register struct inode *ip;
-{
-
-       if(ip->i_count == 1) {
-               ip->i_flag |= ILOCK;
-               if(ip->i_nlink <= 0) {
-                       itrunc(ip);
-                       ip->i_mode = 0;
-                       ip->i_flag |= IUPD|ICHG;
-                       ifree(ip->i_dev, ip->i_number);
-               }
-               iupdat(ip, &time, &time);
-               prele(ip);
-               ip->i_flag = 0;
-               ip->i_number = 0;
-       }
-       ip->i_count--;
-       prele(ip);
-}
-
-/*
- * Check accessed and update flags on
- * an inode structure.
- * If any are on, update the inode
- * with the current time.
- */
-iupdat(ip, ta, tm)
-register struct inode *ip;
-time_t *ta, *tm;
-{
-       register struct buf *bp;
-       struct dinode *dp;
-       register char *p1;
-       char *p2;
-       int i;
-
-       if((ip->i_flag&(IUPD|IACC|ICHG)) != 0) {
-               if(getfs(ip->i_dev)->s_ronly)
-                       return;
-               bp = bread(ip->i_dev, itod(ip->i_number));
-               if (bp->b_flags & B_ERROR) {
-                       brelse(bp);
-                       return;
-               }
-               dp = bp->b_un.b_dino;
-               dp += itoo(ip->i_number);
-               dp->di_mode = ip->i_mode;
-               dp->di_nlink = ip->i_nlink;
-               dp->di_uid = ip->i_uid;
-               dp->di_gid = ip->i_gid;
-               dp->di_size = ip->i_size;
-               p1 = (char *)dp->di_addr;
-               p2 = (char *)ip->i_un.i_addr;
-               for(i=0; i<NADDR; i++) {
-                       *p1++ = *p2++;
-                       if(*p2++ != 0 && (ip->i_mode&IFMT)!=IFMPC
-                          && (ip->i_mode&IFMT)!=IFMPB)
-                               printf("iaddress > 2^24\n");
-                       *p1++ = *p2++;
-                       *p1++ = *p2++;
-               }
-               if(ip->i_flag&IACC)
-                       dp->di_atime = *ta;
-               if(ip->i_flag&IUPD)
-                       dp->di_mtime = *tm;
-               if(ip->i_flag&ICHG)
-                       dp->di_ctime = time;
-               ip->i_flag &= ~(IUPD|IACC|ICHG);
-               bdwrite(bp);
-       }
-}
-
-/*
- * Free all the disk blocks associated
- * with the specified inode structure.
- * The blocks of the file are removed
- * in reverse order. This FILO
- * algorithm will tend to maintain
- * a contiguous free list much longer
- * than FIFO.
- */
-itrunc(ip)
-register struct inode *ip;
-{
-       register i;
-       dev_t dev;
-       daddr_t bn;
-
-       i = ip->i_mode & IFMT;
-       if (i!=IFREG && i!=IFDIR)
-               return;
-       dev = ip->i_dev;
-       for(i=NADDR-1; i>=0; i--) {
-               bn = ip->i_un.i_addr[i];
-               if(bn == (daddr_t)0)
-                       continue;
-               ip->i_un.i_addr[i] = (daddr_t)0;
-               switch(i) {
-
-               default:
-                       free(dev, bn);
-                       break;
-
-               case NADDR-3:
-                       tloop(dev, bn, 0, 0);
-                       break;
-
-               case NADDR-2:
-                       tloop(dev, bn, 1, 0);
-                       break;
-
-               case NADDR-1:
-                       tloop(dev, bn, 1, 1);
-               }
-       }
-       ip->i_size = 0;
-       ip->i_flag |= ICHG|IUPD;
-}
-
-tloop(dev, bn, f1, f2)
-dev_t dev;
-daddr_t bn;
-{
-       register i;
-       register struct buf *bp;
-       register daddr_t *bap;
-       daddr_t nb;
-
-       bp = NULL;
-       for(i=NINDIR-1; i>=0; i--) {
-               if(bp == NULL) {
-                       bp = bread(dev, bn);
-                       if (bp->b_flags & B_ERROR) {
-                               brelse(bp);
-                               return;
-                       }
-                       bap = bp->b_un.b_daddr;
-               }
-               nb = bap[i];
-               if(nb == (daddr_t)0)
-                       continue;
-               if(f1) {
-                       brelse(bp);
-                       bp = NULL;
-                       tloop(dev, nb, f2, 0);
-               } else
-                       free(dev, nb);
-       }
-       if(bp != NULL)
-               brelse(bp);
-       free(dev, bn);
-}
-
-/*
- * Make a new file.
- */
-struct inode *
-maknode(mode)
-{
-       register struct inode *ip;
-
-       ip = ialloc(u.u_pdir->i_dev);
-       if(ip == NULL) {
-               iput(u.u_pdir);
-               return(NULL);
-       }
-       ip->i_flag |= IACC|IUPD|ICHG;
-       if((mode&IFMT) == 0)
-               mode |= IFREG;
-       ip->i_mode = mode & ~u.u_cmask;
-       ip->i_nlink = 1;
-       ip->i_uid = u.u_uid;
-       ip->i_gid = u.u_gid;
-       wdir(ip);
-       return(ip);
-}
-
-/*
- * Write a directory entry with
- * parameters left as side effects
- * to a call to namei.
- */
-wdir(ip)
-struct inode *ip;
-{
-
-       if (u.u_pdir->i_nlink <= 0) {
-               u.u_error = ENOTDIR;
-               goto out;
-       }
-       u.u_dent.d_ino = ip->i_number;
-       bcopy((caddr_t)u.u_dbuf, (caddr_t)u.u_dent.d_name, DIRSIZ);
-       u.u_count = sizeof(struct direct);
-       u.u_segflg = 1;
-       u.u_base = (caddr_t)&u.u_dent;
-       writei(u.u_pdir);
-out:
-       iput(u.u_pdir);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/machdep.c b/.ref-Research-V7/usr/sys/sys/machdep.c
deleted file mode 100644 (file)
index 0925ae8..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/acct.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/inode.h"
-#include "../h/proc.h"
-#include "../h/seg.h"
-#include "../h/map.h"
-#include "../h/reg.h"
-#include "../h/buf.h"
-
-/*
- * Icode is the octal bootstrap
- * program executed in user mode
- * to bring up the system.
- */
-int    icode[] =
-{
-       0104413,        /* sys exec; init; initp */
-       0000014,
-       0000010,
-       0000777,        /* br . */
-       0000014,        /* initp: init; 0 */
-       0000000,
-       0062457,        /* init: </etc/init\0> */
-       0061564,
-       0064457,
-       0064556,
-       0000164,
-};
-int    szicode = sizeof(icode);
-
-/*
- * Machine-dependent startup code
- */
-startup()
-{
-       register i;
-
-       /*
-        * zero and free all of core
-        */
-
-       i = ka6->r[0] + USIZE;
-       UISD->r[0] = 077406;
-       for(;;) {
-               UISA->r[0] = i;
-               if(fuibyte((caddr_t)0) < 0)
-                       break;
-               clearseg(i);
-               maxmem++;
-               mfree(coremap, 1, i);
-               i++;
-       }
-       if(cputype == 70)
-       for(i=0; i<62; i+=2) {
-               UBMAP->r[i] = i<<12;
-               UBMAP->r[i+1] = 0;
-       }
-       printf("mem = %D\n", ctob((long)maxmem));
-       if(MAXMEM < maxmem)
-               maxmem = MAXMEM;
-       mfree(swapmap, nswap, 1);
-       swplo--;
-
-       /*
-        * determine clock
-        */
-
-       UISA->r[7] = ka6->r[1]; /* io segment */
-       UISD->r[7] = 077406;
-}
-
-/*
- * set up a physical address
- * into users virtual address space.
- */
-sysphys()
-{
-       register i, s, d;
-       register struct a {
-               int     segno;
-               int     size;
-               int     phys;
-       } *uap;
-
-       if(!suser())
-               return;
-       uap = (struct a *)u.u_ap;
-       i = uap->segno;
-       if(i < 0 || i >= 8)
-               goto bad;
-       s = uap->size;
-       if(s < 0 || s > 128)
-               goto bad;
-       d = u.u_uisd[i+8];
-       if(d != 0 && (d&ABS) == 0)
-               goto bad;
-       u.u_uisd[i+8] = 0;
-       u.u_uisa[i+8] = 0;
-       if(!u.u_sep) {
-               u.u_uisd[i] = 0;
-               u.u_uisa[i] = 0;
-       }
-       if(s) {
-               u.u_uisd[i+8] = ((s-1)<<8) | RW|ABS;
-               u.u_uisa[i+8] = uap->phys;
-               if(!u.u_sep) {
-                       u.u_uisa[i] = u.u_uisa[i+8];
-                       u.u_uisd[i] = u.u_uisd[i+8];
-               }
-       }
-       sureg();
-       return;
-
-bad:
-       u.u_error = EINVAL;
-}
-
-/*
- * Determine which clock is attached, and start it.
- * panic: no clock found
- */
-#define        CLOCK1  ((physadr)0177546)
-#define        CLOCK2  ((physadr)0172540)
-clkstart()
-{
-       lks = CLOCK1;
-       if(fuiword((caddr_t)lks) == -1) {
-               lks = CLOCK2;
-               if(fuiword((caddr_t)lks) == -1)
-                       panic("no clock");
-       }
-       lks->r[0] = 0115;
-}
-
-/*
- * Let a process handle a signal by simulating an interrupt
- */
-sendsig(p, signo)
-caddr_t p;
-{
-       register unsigned n;
-
-       n = u.u_ar0[R6] - 4;
-       grow(n);
-       suword((caddr_t)n+2, u.u_ar0[RPS]);
-       suword((caddr_t)n, u.u_ar0[R7]);
-       u.u_ar0[R6] = n;
-       u.u_ar0[RPS] &= ~TBIT;
-       u.u_ar0[R7] = (int)p;
-}
-
-/*
- * 11/70 routine to allocate the
- * UNIBUS map and initialize for
- * a unibus device.
- * The code here and in
- * rhstart assumes that an rh on an 11/70
- * is an rh70 and contains 22 bit addressing.
- */
-int    maplock;
-
-mapalloc(bp)
-register struct buf *bp;
-{
-       register i, a;
-
-       if(cputype != 70)
-               return;
-       spl6();
-       while(maplock&B_BUSY) {
-               maplock |= B_WANTED;
-               sleep((caddr_t)&maplock, PSWP+1);
-       }
-       maplock |= B_BUSY;
-       spl0();
-       bp->b_flags |= B_MAP;
-       a = bp->b_xmem;
-       for(i=16; i<32; i+=2)
-               UBMAP->r[i+1] = a;
-       for(a++; i<48; i+=2)
-               UBMAP->r[i+1] = a;
-       bp->b_xmem = 1;
-}
-
-mapfree(bp)
-struct buf *bp;
-{
-
-       bp->b_flags &= ~B_MAP;
-       if(maplock&B_WANTED)
-               wakeup((caddr_t)&maplock);
-       maplock = 0;
-}
diff --git a/.ref-Research-V7/usr/sys/sys/main.c b/.ref-Research-V7/usr/sys/sys/main.c
deleted file mode 100644 (file)
index a09ca23..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/filsys.h"
-#include "../h/mount.h"
-#include "../h/map.h"
-#include "../h/proc.h"
-#include "../h/inode.h"
-#include "../h/seg.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-
-/*
- * Initialization code.
- * Called from cold start routine as
- * soon as a stack and segmentation
- * have been established.
- * Functions:
- *     clear and free user core
- *     turn on clock
- *     hand craft 0th process
- *     call all initialization routines
- *     fork - process 0 to schedule
- *          - process 1 execute bootstrap
- *
- * loop at low address in user mode -- /etc/init
- *     cannot be executed.
- */
-main()
-{
-
-       startup();
-       /*
-        * set up system process
-        */
-
-       proc[0].p_addr = ka6->r[0];
-       proc[0].p_size = USIZE;
-       proc[0].p_stat = SRUN;
-       proc[0].p_flag |= SLOAD|SSYS;
-       proc[0].p_nice = NZERO;
-       u.u_procp = &proc[0];
-       u.u_cmask = CMASK;
-
-       /*
-        * Initialize devices and
-        * set up 'known' i-nodes
-        */
-
-       clkstart();
-       cinit();
-       binit();
-       iinit();
-       rootdir = iget(rootdev, (ino_t)ROOTINO);
-       rootdir->i_flag &= ~ILOCK;
-       u.u_cdir = iget(rootdev, (ino_t)ROOTINO);
-       u.u_cdir->i_flag &= ~ILOCK;
-       u.u_rdir = NULL;
-
-       /*
-        * make init process
-        * enter scheduling loop
-        * with system process
-        */
-
-       if(newproc()) {
-               expand(USIZE + (int)btoc(szicode));
-               estabur((unsigned)0, btoc(szicode), (unsigned)0, 0, RO);
-               copyout((caddr_t)icode, (caddr_t)0, szicode);
-               /*
-                * Return goes to loc. 0 of user init
-                * code just copied out.
-                */
-               return;
-       }
-       sched();
-}
-
-/*
- * iinit is called once (from main)
- * very early in initialization.
- * It reads the root's super block
- * and initializes the current date
- * from the last modified date.
- *
- * panic: iinit -- cannot read the super
- * block. Usually because of an IO error.
- */
-iinit()
-{
-       register struct buf *cp, *bp;
-       register struct filsys *fp;
-
-       (*bdevsw[major(rootdev)].d_open)(rootdev, 1);
-       bp = bread(rootdev, SUPERB);
-       cp = geteblk();
-       if(u.u_error)
-               panic("iinit");
-       bcopy(bp->b_un.b_addr, cp->b_un.b_addr, sizeof(struct filsys));
-       brelse(bp);
-       mount[0].m_bufp = cp;
-       mount[0].m_dev = rootdev;
-       fp = cp->b_un.b_filsys;
-       fp->s_flock = 0;
-       fp->s_ilock = 0;
-       fp->s_ronly = 0;
-       time = fp->s_time;
-}
-
-/*
- * This is the set of buffers proper, whose heads
- * were declared in buf.h.  There can exist buffer
- * headers not pointing here that are used purely
- * as arguments to the I/O routines to describe
- * I/O to be done-- e.g. swbuf for
- * swapping.
- */
-char   buffers[NBUF][BSIZE+BSLOP];
-
-/*
- * Initialize the buffer I/O system by freeing
- * all buffers and setting all device buffer lists to empty.
- */
-binit()
-{
-       register struct buf *bp;
-       register struct buf *dp;
-       register int i;
-       struct bdevsw *bdp;
-
-       bfreelist.b_forw = bfreelist.b_back =
-           bfreelist.av_forw = bfreelist.av_back = &bfreelist;
-       for (i=0; i<NBUF; i++) {
-               bp = &buf[i];
-               bp->b_dev = NODEV;
-               bp->b_un.b_addr = buffers[i];
-               bp->b_back = &bfreelist;
-               bp->b_forw = bfreelist.b_forw;
-               bfreelist.b_forw->b_back = bp;
-               bfreelist.b_forw = bp;
-               bp->b_flags = B_BUSY;
-               brelse(bp);
-       }
-       for (bdp = bdevsw; bdp->d_open; bdp++) {
-               dp = bdp->d_tab;
-               if(dp) {
-                       dp->b_forw = dp;
-                       dp->b_back = dp;
-               }
-               nblkdev++;
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/sys/malloc.c b/.ref-Research-V7/usr/sys/sys/malloc.c
deleted file mode 100644 (file)
index 2142ed6..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/map.h"
-
-/*
- * Allocate 'size' units from the given
- * map. Return the base of the allocated
- * space.
- * In a map, the addresses are increasing and the
- * list is terminated by a 0 size.
- * The core map unit is 64 bytes; the swap map unit
- * is 512 bytes.
- * Algorithm is first-fit.
- */
-malloc(mp, size)
-struct map *mp;
-{
-       register unsigned int a;
-       register struct map *bp;
-
-       for (bp=mp; bp->m_size; bp++) {
-               if (bp->m_size >= size) {
-                       a = bp->m_addr;
-                       bp->m_addr += size;
-                       if ((bp->m_size -= size) == 0) {
-                               do {
-                                       bp++;
-                                       (bp-1)->m_addr = bp->m_addr;
-                               } while ((bp-1)->m_size = bp->m_size);
-                       }
-                       return(a);
-               }
-       }
-       return(0);
-}
-
-/*
- * Free the previously allocated space aa
- * of size units into the specified map.
- * Sort aa into map and combine on
- * one or both ends if possible.
- */
-mfree(mp, size, a)
-struct map *mp;
-register int a;
-{
-       register struct map *bp;
-       register unsigned int t;
-
-       if ((bp = mp)==coremap && runin) {
-               runin = 0;
-               wakeup((caddr_t)&runin);        /* Wake scheduler when freeing core */
-       }
-       for (; bp->m_addr<=a && bp->m_size!=0; bp++);
-       if (bp>mp && (bp-1)->m_addr+(bp-1)->m_size == a) {
-               (bp-1)->m_size += size;
-               if (a+size == bp->m_addr) {
-                       (bp-1)->m_size += bp->m_size;
-                       while (bp->m_size) {
-                               bp++;
-                               (bp-1)->m_addr = bp->m_addr;
-                               (bp-1)->m_size = bp->m_size;
-                       }
-               }
-       } else {
-               if (a+size == bp->m_addr && bp->m_size) {
-                       bp->m_addr -= size;
-                       bp->m_size += size;
-               } else if (size) {
-                       do {
-                               t = bp->m_addr;
-                               bp->m_addr = a;
-                               a = t;
-                               t = bp->m_size;
-                               bp->m_size = size;
-                               bp++;
-                       } while (size = t);
-               }
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/sys/mklib b/.ref-Research-V7/usr/sys/sys/mklib
deleted file mode 100755 (executable)
index 0fa5ccd..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-ar cr LIB1 \
-main.o \
-trap.o \
-sig.o \
-iget.o \
-prf.o \
-slp.o \
-subr.o \
-rdwri.o \
-clock.o \
-fio.o \
-malloc.o \
-alloc.o \
-machdep.o \
-nami.o \
-pipe.o \
-prim.o \
-fakemx.o \
-sysent.o \
-sys3.o \
-sys1.o \
-sys4.o \
-sys2.o \
-acct.o \
-text.o \
-ureg.o
diff --git a/.ref-Research-V7/usr/sys/sys/nami.c b/.ref-Research-V7/usr/sys/sys/nami.c
deleted file mode 100644 (file)
index b310575..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/inode.h"
-#include "../h/mount.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-
-/*
- * Convert a pathname into a pointer to
- * an inode. Note that the inode is locked.
- *
- * func = function called to get next char of name
- *     &uchar if name is in user space
- *     &schar if name is in system space
- * flag = 0 if name is sought
- *     1 if name is to be created
- *     2 if name is to be deleted
- */
-struct inode *
-namei(func, flag)
-int (*func)();
-{
-       register struct inode *dp;
-       register c;
-       register char *cp;
-       struct buf *bp;
-       int i;
-       dev_t d;
-       off_t eo;
-
-       /*
-        * If name starts with '/' start from
-        * root; otherwise start from current dir.
-        */
-
-       dp = u.u_cdir;
-       if((c=(*func)()) == '/')
-               if ((dp = u.u_rdir) == NULL)
-                       dp = rootdir;
-       iget(dp->i_dev, dp->i_number);
-       while(c == '/')
-               c = (*func)();
-       if(c == '\0' && flag != 0)
-               u.u_error = ENOENT;
-
-cloop:
-       /*
-        * Here dp contains pointer
-        * to last component matched.
-        */
-
-       if(u.u_error)
-               goto out;
-       if(c == '\0')
-               return(dp);
-
-       /*
-        * If there is another component,
-        * Gather up name into
-        * users' dir buffer.
-        */
-
-       cp = &u.u_dbuf[0];
-       while (c != '/' && c != '\0' && u.u_error == 0 ) {
-               if (mpxip!=NULL && c=='!')
-                       break;
-               if(cp < &u.u_dbuf[DIRSIZ])
-                       *cp++ = c;
-               c = (*func)();
-       }
-       while(cp < &u.u_dbuf[DIRSIZ])
-               *cp++ = '\0';
-       while(c == '/')
-               c = (*func)();
-       if (c == '!' && mpxip != NULL) {
-               iput(dp);
-               plock(mpxip);
-               mpxip->i_count++;
-               return(mpxip);
-       }
-
-seloop:
-       /*
-        * dp must be a directory and
-        * must have X permission.
-        */
-
-       if((dp->i_mode&IFMT) != IFDIR)
-               u.u_error = ENOTDIR;
-       access(dp, IEXEC);
-       if(u.u_error)
-               goto out;
-
-       /*
-        * set up to search a directory
-        */
-       u.u_offset = 0;
-       u.u_segflg = 1;
-       eo = 0;
-       bp = NULL;
-
-eloop:
-
-       /*
-        * If at the end of the directory,
-        * the search failed. Report what
-        * is appropriate as per flag.
-        */
-
-       if(u.u_offset >= dp->i_size) {
-               if(bp != NULL)
-                       brelse(bp);
-               if(flag==1 && c=='\0') {
-                       if(access(dp, IWRITE))
-                               goto out;
-                       u.u_pdir = dp;
-                       if(eo)
-                               u.u_offset = eo-sizeof(struct direct);
-                       else
-                               dp->i_flag |= IUPD|ICHG;
-                       return(NULL);
-               }
-               u.u_error = ENOENT;
-               goto out;
-       }
-
-       /*
-        * If offset is on a block boundary,
-        * read the next directory block.
-        * Release previous if it exists.
-        */
-
-       if((u.u_offset&BMASK) == 0) {
-               if(bp != NULL)
-                       brelse(bp);
-               bp = bread(dp->i_dev,
-                       bmap(dp, (daddr_t)(u.u_offset>>BSHIFT), B_READ));
-               if (bp->b_flags & B_ERROR) {
-                       brelse(bp);
-                       goto out;
-               }
-       }
-
-       /*
-        * Note first empty directory slot
-        * in eo for possible creat.
-        * String compare the directory entry
-        * and the current component.
-        * If they do not match, go back to eloop.
-        */
-
-       bcopy(bp->b_un.b_addr+(u.u_offset&BMASK), (caddr_t)&u.u_dent,
-               sizeof(struct direct));
-       u.u_offset += sizeof(struct direct);
-       if(u.u_dent.d_ino == 0) {
-               if(eo == 0)
-                       eo = u.u_offset;
-               goto eloop;
-       }
-       for(i=0; i<DIRSIZ; i++)
-               if(u.u_dbuf[i] != u.u_dent.d_name[i])
-                       goto eloop;
-
-       /*
-        * Here a component matched in a directory.
-        * If there is more pathname, go back to
-        * cloop, otherwise return.
-        */
-
-       if(bp != NULL)
-               brelse(bp);
-       if(flag==2 && c=='\0') {
-               if(access(dp, IWRITE))
-                       goto out;
-               return(dp);
-       }
-       d = dp->i_dev;
-       if(u.u_dent.d_ino == ROOTINO)
-       if(dp->i_number == ROOTINO)
-       if(u.u_dent.d_name[1] == '.')
-               for(i=1; i<NMOUNT; i++)
-                       if(mount[i].m_bufp != NULL)
-                       if(mount[i].m_dev == d) {
-                               iput(dp);
-                               dp = mount[i].m_inodp;
-                               dp->i_count++;
-                               plock(dp);
-                               goto seloop;
-                       }
-       iput(dp);
-       dp = iget(d, u.u_dent.d_ino);
-       if(dp == NULL)
-               return(NULL);
-       goto cloop;
-
-out:
-       iput(dp);
-       return(NULL);
-}
-
-/*
- * Return the next character from the
- * kernel string pointed at by dirp.
- */
-schar()
-{
-
-       return(*u.u_dirp++ & 0377);
-}
-
-/*
- * Return the next character from the
- * user string pointed at by dirp.
- */
-uchar()
-{
-       register c;
-
-       c = fubyte(u.u_dirp++);
-       if(c == -1)
-               u.u_error = EFAULT;
-       return(c);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/pipe.c b/.ref-Research-V7/usr/sys/sys/pipe.c
deleted file mode 100644 (file)
index 1ca26ba..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/inode.h"
-#include "../h/file.h"
-#include "../h/reg.h"
-
-/*
- * Max allowable buffering per pipe.
- * This is also the max size of the
- * file created to implement the pipe.
- * If this size is bigger than 5120,
- * pipes will be implemented with large
- * files, which is probably not good.
- */
-#define        PIPSIZ  4096
-
-/*
- * The sys-pipe entry.
- * Allocate an inode on the root device.
- * Allocate 2 file structures.
- * Put it all together with flags.
- */
-pipe()
-{
-       register struct inode *ip;
-       register struct file *rf, *wf;
-       int r;
-
-       ip = ialloc(pipedev);
-       if(ip == NULL)
-               return;
-       rf = falloc();
-       if(rf == NULL) {
-               iput(ip);
-               return;
-       }
-       r = u.u_r.r_val1;
-       wf = falloc();
-       if(wf == NULL) {
-               rf->f_count = 0;
-               u.u_ofile[r] = NULL;
-               iput(ip);
-               return;
-       }
-       u.u_r.r_val2 = u.u_r.r_val1;
-       u.u_r.r_val1 = r;
-       wf->f_flag = FWRITE|FPIPE;
-       wf->f_inode = ip;
-       rf->f_flag = FREAD|FPIPE;
-       rf->f_inode = ip;
-       ip->i_count = 2;
-       ip->i_mode = IFREG;
-       ip->i_flag = IACC|IUPD|ICHG;
-}
-
-/*
- * Read call directed to a pipe.
- */
-readp(fp)
-register struct file *fp;
-{
-       register struct inode *ip;
-
-       ip = fp->f_inode;
-
-loop:
-       /*
-        * Very conservative locking.
-        */
-
-       plock(ip);
-       /*
-        * If nothing in the pipe, wait.
-        */
-       if (ip->i_size == 0) {
-               /*
-                * If there are not both reader and
-                * writer active, return without
-                * satisfying read.
-                */
-               prele(ip);
-               if(ip->i_count < 2)
-                       return;
-               ip->i_mode |= IREAD;
-               sleep((caddr_t)ip+2, PPIPE);
-               goto loop;
-       }
-
-       /*
-        * Read and return
-        */
-
-       u.u_offset = fp->f_un.f_offset;
-       readi(ip);
-       fp->f_un.f_offset = u.u_offset;
-       /*
-        * If reader has caught up with writer, reset
-        * offset and size to 0.
-        */
-       if (fp->f_un.f_offset == ip->i_size) {
-               fp->f_un.f_offset = 0;
-               ip->i_size = 0;
-               if(ip->i_mode & IWRITE) {
-                       ip->i_mode &= ~IWRITE;
-                       wakeup((caddr_t)ip+1);
-               }
-       }
-       prele(ip);
-}
-
-/*
- * Write call directed to a pipe.
- */
-writep(fp)
-register struct file *fp;
-{
-       register c;
-       register struct inode *ip;
-
-       ip = fp->f_inode;
-       c = u.u_count;
-
-loop:
-
-       /*
-        * If all done, return.
-        */
-
-       plock(ip);
-       if(c == 0) {
-               prele(ip);
-               u.u_count = 0;
-               return;
-       }
-
-       /*
-        * If there are not both read and
-        * write sides of the pipe active,
-        * return error and signal too.
-        */
-
-       if(ip->i_count < 2) {
-               prele(ip);
-               u.u_error = EPIPE;
-               psignal(u.u_procp, SIGPIPE);
-               return;
-       }
-
-       /*
-        * If the pipe is full,
-        * wait for reads to deplete
-        * and truncate it.
-        */
-
-       if(ip->i_size >= PIPSIZ) {
-               ip->i_mode |= IWRITE;
-               prele(ip);
-               sleep((caddr_t)ip+1, PPIPE);
-               goto loop;
-       }
-
-       /*
-        * Write what is possible and
-        * loop back.
-        * If writing less than PIPSIZ, it always goes.
-        * One can therefore get a file > PIPSIZ if write
-        * sizes do not divide PIPSIZ.
-        */
-
-       u.u_offset = ip->i_size;
-       u.u_count = min((unsigned)c, (unsigned)PIPSIZ);
-       c -= u.u_count;
-       writei(ip);
-       prele(ip);
-       if(ip->i_mode&IREAD) {
-               ip->i_mode &= ~IREAD;
-               wakeup((caddr_t)ip+2);
-       }
-       goto loop;
-}
-
-/*
- * Lock a pipe.
- * If its already locked,
- * set the WANT bit and sleep.
- */
-plock(ip)
-register struct inode *ip;
-{
-
-       while(ip->i_flag&ILOCK) {
-               ip->i_flag |= IWANT;
-               sleep((caddr_t)ip, PINOD);
-       }
-       ip->i_flag |= ILOCK;
-}
-
-/*
- * Unlock a pipe.
- * If WANT bit is on,
- * wakeup.
- * This routine is also used
- * to unlock inodes in general.
- */
-prele(ip)
-register struct inode *ip;
-{
-
-       ip->i_flag &= ~ILOCK;
-       if(ip->i_flag&IWANT) {
-               ip->i_flag &= ~IWANT;
-               wakeup((caddr_t)ip);
-       }
-}
diff --git a/.ref-Research-V7/usr/sys/sys/prf.c b/.ref-Research-V7/usr/sys/sys/prf.c
deleted file mode 100644 (file)
index 4ba9863..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/seg.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-
-/*
- * In case console is off,
- * panicstr contains argument to last
- * call to panic.
- */
-
-char   *panicstr;
-
-/*
- * Scaled down version of C Library printf.
- * Only %s %u %d (==%u) %o %x %D are recognized.
- * Used to print diagnostic information
- * directly on console tty.
- * Since it is not interrupt driven,
- * all system activities are pretty much
- * suspended.
- * Printf should not be used for chit-chat.
- */
-/* VARARGS 1 */
-printf(fmt, x1)
-register char *fmt;
-unsigned x1;
-{
-       register c;
-       register unsigned int *adx;
-       char *s;
-
-       adx = &x1;
-loop:
-       while((c = *fmt++) != '%') {
-               if(c == '\0')
-                       return;
-               putchar(c);
-       }
-       c = *fmt++;
-       if(c == 'd' || c == 'u' || c == 'o' || c == 'x')
-               printn((long)*adx, c=='o'? 8: (c=='x'? 16:10));
-       else if(c == 's') {
-               s = (char *)*adx;
-               while(c = *s++)
-                       putchar(c);
-       } else if (c == 'D') {
-               printn(*(long *)adx, 10);
-               adx += (sizeof(long) / sizeof(int)) - 1;
-       }
-       adx++;
-       goto loop;
-}
-
-/*
- * Print an unsigned integer in base b.
- */
-printn(n, b)
-long n;
-{
-       register long a;
-
-       if (n<0) {      /* shouldn't happen */
-               putchar('-');
-               n = -n;
-       }
-       if(a = n/b)
-               printn(a, b);
-       putchar("0123456789ABCDEF"[(int)(n%b)]);
-}
-
-/*
- * Panic is called on unresolvable
- * fatal errors.
- * It syncs, prints "panic: mesg" and
- * then loops.
- */
-panic(s)
-char *s;
-{
-       panicstr = s;
-       update();
-       printf("panic: %s\n", s);
-       for(;;)
-               idle();
-}
-
-/*
- * prdev prints a warning message of the
- * form "mesg on dev x/y".
- * x and y are the major and minor parts of
- * the device argument.
- */
-prdev(str, dev)
-char *str;
-dev_t dev;
-{
-
-       printf("%s on dev %u/%u\n", str, major(dev), minor(dev));
-}
-
-/*
- * deverr prints a diagnostic from
- * a device driver.
- * It prints the device, block number,
- * and an octal word (usually some error
- * status register) passed as argument.
- */
-deverror(bp, o1, o2)
-register struct buf *bp;
-{
-
-       prdev("err", bp->b_dev);
-       printf("bn=%D er=%o,%o\n", bp->b_blkno, o1, o2);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/prim.c b/.ref-Research-V7/usr/sys/sys/prim.c
deleted file mode 100644 (file)
index 9f686a7..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-#include "../h/param.h"
-#include "../h/tty.h"
-#include "../h/systm.h"
-#include "../h/conf.h"
-#include "../h/buf.h"
-
-struct cblock {
-       struct cblock *c_next;
-       char    c_info[CBSIZE];
-};
-
-struct cblock  cfree[NCLIST];
-struct cblock  *cfreelist;
-int    cbad;
-
-/*
- * Character list get/put
- */
-getc(p)
-register struct clist *p;
-{
-       register struct cblock *bp;
-       register int c, s;
-
-       s = spl6();
-       if (p->c_cc <= 0) {
-               c = -1;
-               p->c_cc = 0;
-               p->c_cf = p->c_cl = NULL;
-       } else {
-               c = *p->c_cf++ & 0377;
-               if (--p->c_cc<=0) {
-                       bp = (struct cblock *)(p->c_cf-1);
-                       bp = (struct cblock *) ((int)bp & ~CROUND);
-                       p->c_cf = NULL;
-                       p->c_cl = NULL;
-                       bp->c_next = cfreelist;
-                       cfreelist = bp;
-               } else if (((int)p->c_cf & CROUND) == 0){
-                       bp = (struct cblock *)(p->c_cf);
-                       bp--;
-                       p->c_cf = bp->c_next->c_info;
-                       bp->c_next = cfreelist;
-                       cfreelist = bp;
-               }
-       }
-       splx(s);
-       return(c);
-}
-
-/*
- * copy clist to buffer.
- * return number of bytes moved.
- */
-q_to_b(q, cp, cc)
-register struct clist *q;
-register char *cp;
-{
-       register struct cblock *bp;
-       register int s;
-       char *acp;
-
-       if (cc <= 0)
-               return(0);
-       s = spl6();
-       if (q->c_cc <= 0) {
-               q->c_cc = 0;
-               q->c_cf = q->c_cl = NULL;
-               return(0);
-       }
-       acp = cp;
-       cc++;
-
-       while (--cc) {
-               *cp++ = *q->c_cf++;
-               if (--q->c_cc <= 0) {
-                       bp = (struct cblock *)(q->c_cf-1);
-                       bp = (struct cblock *)((int)bp & ~CROUND);
-                       q->c_cf = q->c_cl = NULL;
-                       bp->c_next = cfreelist;
-                       cfreelist = bp;
-                       break;
-               }
-               if (((int)q->c_cf & CROUND) == 0) {
-                       bp = (struct cblock *)(q->c_cf);
-                       bp--;
-                       q->c_cf = bp->c_next->c_info;
-                       bp->c_next = cfreelist;
-                       cfreelist = bp;
-               }
-       }
-       splx(s);
-       return(cp-acp);
-}
-
-
-/*
- * Return count of contiguous characters
- * in clist starting at q->c_cf.
- * Stop counting if flag&character is non-null.
- */
-ndqb(q, flag)
-register struct clist *q;
-{
-register cc;
-int s;
-
-       s = spl6();
-       if (q->c_cc <= 0) {
-               cc = -q->c_cc;
-               goto out;
-       }
-       cc = ((int)q->c_cf + CBSIZE) & ~CROUND;
-       cc -= (int)q->c_cf;
-       if (q->c_cc < cc)
-               cc = q->c_cc;
-       if (flag) {
-               register char *p, *end;
-
-               p = q->c_cf;
-               end = p;
-               end += cc;
-               while (p < end) {
-                       if (*p & flag) {
-                               cc = (int)p;
-                               cc -= (int)q->c_cf;
-                               break;
-                       }
-                       p++;
-               }
-       }
-out:
-       splx(s);
-       return(cc);
-}
-
-
-
-/*
- * Update clist to show that cc characters
- * were removed.  It is assumed that cc < CBSIZE.
- */
-ndflush(q, cc)
-register struct clist *q;
-register cc;
-{
-register s;
-
-       s = spl6();
-       if (q->c_cc < 0) {
-               if (q->c_cf != NULL) {
-                       q->c_cc += cc;
-                       q->c_cf += cc;
-                       goto out;
-               }
-               q->c_cc = 0;
-               goto out;
-       }
-       if (q->c_cc == 0) {
-               goto out;
-       }
-       if (cc > CBSIZE || cc <= 0) {
-               cbad++;
-               goto out;
-       }
-       q->c_cc -= cc;
-       q->c_cf += cc;
-       if (((int)q->c_cf & CROUND) == 0) {
-               register struct cblock *bp;
-
-               bp = (struct cblock *)(q->c_cf) -1;
-               if (bp->c_next) {
-                       q->c_cf = bp->c_next->c_info;
-               } else {
-                       q->c_cf = q->c_cl = NULL;
-               }
-               bp->c_next = cfreelist;
-               cfreelist = bp;
-       } else
-       if (q->c_cc == 0) {
-               register struct cblock *bp;
-               q->c_cf = (char *)((int)q->c_cf & ~CROUND);
-               bp = (struct cblock *)(q->c_cf);
-               bp->c_next = cfreelist;
-               cfreelist = bp;
-               q->c_cf = q->c_cl = NULL;
-       }
-out:
-       splx(s);
-}
-putc(c, p)
-register struct clist *p;
-{
-       register struct cblock *bp;
-       register char *cp;
-       register s;
-
-       s = spl6();
-       if ((cp = p->c_cl) == NULL || p->c_cc < 0 ) {
-               if ((bp = cfreelist) == NULL) {
-                       splx(s);
-                       return(-1);
-               }
-               cfreelist = bp->c_next;
-               bp->c_next = NULL;
-               p->c_cf = cp = bp->c_info;
-       } else if (((int)cp & CROUND) == 0) {
-               bp = (struct cblock *)cp - 1;
-               if ((bp->c_next = cfreelist) == NULL) {
-                       splx(s);
-                       return(-1);
-               }
-               bp = bp->c_next;
-               cfreelist = bp->c_next;
-               bp->c_next = NULL;
-               cp = bp->c_info;
-       }
-       *cp++ = c;
-       p->c_cc++;
-       p->c_cl = cp;
-       splx(s);
-       return(0);
-}
-
-
-
-/*
- * copy buffer to clist.
- * return number of bytes not transfered.
- */
-b_to_q(cp, cc, q)
-register char *cp;
-struct clist *q;
-register int cc;
-{
-       register char *cq;
-       register struct cblock *bp;
-       register s, acc;
-
-       if (cc <= 0)
-               return(0);
-       acc = cc;
-
-
-       s = spl6();
-       if ((cq = q->c_cl) == NULL || q->c_cc < 0) {
-               if ((bp = cfreelist) == NULL) 
-                       goto out;
-               cfreelist = bp->c_next;
-               bp->c_next = NULL;
-               q->c_cf = cq = bp->c_info;
-       }
-
-       while (cc) {
-               if (((int)cq & CROUND) == 0) {
-                       bp = (struct cblock *) cq - 1;
-                       if ((bp->c_next = cfreelist) == NULL) 
-                               goto out;
-                       bp = bp->c_next;
-                       cfreelist = bp->c_next;
-                       bp->c_next = NULL;
-                       cq = bp->c_info;
-               }
-               *cq++ = *cp++;
-               cc--;
-       }
-out:
-       q->c_cl = cq;
-       q->c_cc += acc-cc;
-       splx(s);
-       return(cc);
-}
-
-/*
- * Initialize clist by freeing all character blocks, then count
- * number of character devices. (Once-only routine)
- */
-cinit()
-{
-       register int ccp;
-       register struct cblock *cp;
-       register struct cdevsw *cdp;
-
-       ccp = (int)cfree;
-       ccp = (ccp+CROUND) & ~CROUND;
-       for(cp=(struct cblock *)ccp; cp <= &cfree[NCLIST-1]; cp++) {
-               cp->c_next = cfreelist;
-               cfreelist = cp;
-       }
-       ccp = 0;
-       for(cdp = cdevsw; cdp->d_open; cdp++)
-               ccp++;
-       nchrdev = ccp;
-}
-
-
-/*
- * integer (2-byte) get/put
- * using clists
- */
-getw(p)
-register struct clist *p;
-{
-       register int s;
-
-       if (p->c_cc <= 1)
-               return(-1);
-       s = getc(p);
-       return(s | (getc(p)<<8));
-}
-
-putw(c, p)
-register struct clist *p;
-{
-       register s;
-
-       s = spl6();
-       if (cfreelist==NULL) {
-               splx(s);
-               return(-1);
-       }
-       putc(c, p);
-       putc(c>>8, p);
-       splx(s);
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/rdwri.c b/.ref-Research-V7/usr/sys/sys/rdwri.c
deleted file mode 100644 (file)
index 510d618..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/inode.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-#include "../h/conf.h"
-
-/*
- * Read the file corresponding to
- * the inode pointed at by the argument.
- * The actual read arguments are found
- * in the variables:
- *     u_base          core address for destination
- *     u_offset        byte offset in file
- *     u_count         number of bytes to read
- *     u_segflg        read to kernel/user/user I
- */
-readi(ip)
-register struct inode *ip;
-{
-       struct buf *bp;
-       dev_t dev;
-       daddr_t lbn, bn;
-       off_t diff;
-       register on, n;
-       register type;
-
-       if(u.u_count == 0)
-               return;
-       if(u.u_offset < 0) {
-               u.u_error = EINVAL;
-               return;
-       }
-       ip->i_flag |= IACC;
-       dev = (dev_t)ip->i_un.i_rdev;
-       type = ip->i_mode&IFMT;
-       if (type==IFCHR || type==IFMPC) {
-               return((*cdevsw[major(dev)].d_read)(dev));
-       }
-
-       do {
-               lbn = bn = u.u_offset >> BSHIFT;
-               on = u.u_offset & BMASK;
-               n = min((unsigned)(BSIZE-on), u.u_count);
-               if (type!=IFBLK && type!=IFMPB) {
-                       diff = ip->i_size - u.u_offset;
-                       if(diff <= 0)
-                               return;
-                       if(diff < n)
-                               n = diff;
-                       bn = bmap(ip, bn, B_READ);
-                       if(u.u_error)
-                               return;
-                       dev = ip->i_dev;
-               } else
-                       rablock = bn+1;
-               if ((long)bn<0) {
-                       bp = geteblk();
-                       clrbuf(bp);
-               } else if (ip->i_un.i_lastr+1==lbn)
-                       bp = breada(dev, bn, rablock);
-               else
-                       bp = bread(dev, bn);
-               ip->i_un.i_lastr = lbn;
-               n = min((unsigned)n, BSIZE-bp->b_resid);
-               if (n!=0)
-                       iomove(bp->b_un.b_addr+on, n, B_READ);
-               brelse(bp);
-       } while(u.u_error==0 && u.u_count!=0 && n>0);
-}
-
-/*
- * Write the file corresponding to
- * the inode pointed at by the argument.
- * The actual write arguments are found
- * in the variables:
- *     u_base          core address for source
- *     u_offset        byte offset in file
- *     u_count         number of bytes to write
- *     u_segflg        write to kernel/user/user I
- */
-writei(ip)
-register struct inode *ip;
-{
-       struct buf *bp;
-       dev_t dev;
-       daddr_t bn;
-       register n, on;
-       register type;
-
-       if(u.u_offset < 0) {
-               u.u_error = EINVAL;
-               return;
-       }
-       dev = (dev_t)ip->i_un.i_rdev;
-       type = ip->i_mode&IFMT;
-       if (type==IFCHR || type==IFMPC) {
-               ip->i_flag |= IUPD|ICHG;
-               (*cdevsw[major(dev)].d_write)(dev);
-               return;
-       }
-       if (u.u_count == 0)
-               return;
-
-       do {
-               bn = u.u_offset >> BSHIFT;
-               on = u.u_offset & BMASK;
-               n = min((unsigned)(BSIZE-on), u.u_count);
-               if (type!=IFBLK && type!=IFMPB) {
-                       bn = bmap(ip, bn, B_WRITE);
-                       if((long)bn<0)
-                               return;
-                       dev = ip->i_dev;
-               }
-               if(n == BSIZE) 
-                       bp = getblk(dev, bn);
-               else
-                       bp = bread(dev, bn);
-               iomove(bp->b_un.b_addr+on, n, B_WRITE);
-               if(u.u_error != 0)
-                       brelse(bp);
-               else
-                       bdwrite(bp);
-               if(u.u_offset > ip->i_size &&
-                  (type==IFDIR || type==IFREG))
-                       ip->i_size = u.u_offset;
-               ip->i_flag |= IUPD|ICHG;
-       } while(u.u_error==0 && u.u_count!=0);
-}
-
-/*
- * Return the logical maximum
- * of the 2 arguments.
- */
-max(a, b)
-unsigned a, b;
-{
-
-       if(a > b)
-               return(a);
-       return(b);
-}
-
-/*
- * Return the logical minimum
- * of the 2 arguments.
- */
-min(a, b)
-unsigned a, b;
-{
-
-       if(a < b)
-               return(a);
-       return(b);
-}
-
-/*
- * Move n bytes at byte location
- * &bp->b_un.b_addr[o] to/from (flag) the
- * user/kernel (u.segflg) area starting at u.base.
- * Update all the arguments by the number
- * of bytes moved.
- *
- * There are 2 algorithms,
- * if source address, dest address and count
- * are all even in a user copy,
- * then the machine language copyin/copyout
- * is called.
- * If not, its done byte-by-byte with
- * cpass and passc.
- */
-iomove(cp, n, flag)
-register caddr_t cp;
-register n;
-{
-       register t;
-
-       if (n==0)
-               return;
-       if(u.u_segflg != 1 &&
-         (n&(NBPW-1)) == 0 &&
-         ((int)cp&(NBPW-1)) == 0 &&
-         ((int)u.u_base&(NBPW-1)) == 0) {
-               if (flag==B_WRITE)
-                       if (u.u_segflg==0)
-                               t = copyin(u.u_base, (caddr_t)cp, n);
-                       else
-                               t = copyiin(u.u_base, (caddr_t)cp, n);
-               else
-                       if (u.u_segflg==0)
-                               t = copyout((caddr_t)cp, u.u_base, n);
-                       else
-                               t = copyiout((caddr_t)cp, u.u_base, n);
-               if (t) {
-                       u.u_error = EFAULT;
-                       return;
-               }
-               u.u_base += n;
-               u.u_offset += n;
-               u.u_count -= n;
-               return;
-       }
-       if (flag==B_WRITE) {
-               do {
-                       if ((t = cpass()) < 0)
-                               return;
-                       *cp++ = t;
-               } while (--n);
-       } else
-               do {
-                       if(passc(*cp++) < 0)
-                               return;
-               } while (--n);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/sig.c b/.ref-Research-V7/usr/sys/sys/sig.c
deleted file mode 100644 (file)
index eeb7193..0000000
+++ /dev/null
@@ -1,417 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/inode.h"
-#include "../h/reg.h"
-#include "../h/text.h"
-#include "../h/seg.h"
-
-/*
- * Priority for tracing
- */
-#define        IPCPRI  PZERO
-
-/*
- * Tracing variables.
- * Used to pass trace command from
- * parent to child being traced.
- * This data base cannot be
- * shared and is locked
- * per user.
- */
-struct
-{
-       int     ip_lock;
-       int     ip_req;
-       int     *ip_addr;
-       int     ip_data;
-} ipc;
-
-/*
- * Send the specified signal to
- * all processes with 'pgrp' as
- * process group.
- * Called by tty.c for quits and
- * interrupts.
- */
-signal(pgrp, sig)
-register pgrp;
-{
-       register struct proc *p;
-
-       if(pgrp == 0)
-               return;
-       for(p = &proc[0]; p < &proc[NPROC]; p++)
-               if(p->p_pgrp == pgrp)
-                       psignal(p, sig);
-}
-
-/*
- * Send the specified signal to
- * the specified process.
- */
-psignal(p, sig)
-register struct proc *p;
-register sig;
-{
-
-       if((unsigned)sig >= NSIG)
-               return;
-       if(sig)
-               p->p_sig |= 1<<(sig-1);
-       if(p->p_pri > PUSER)
-               p->p_pri = PUSER;
-       if(p->p_stat == SSLEEP && p->p_pri > PZERO)
-               setrun(p);
-}
-
-/*
- * Returns true if the current
- * process has a signal to process.
- * This is asked at least once
- * each time a process enters the
- * system.
- * A signal does not do anything
- * directly to a process; it sets
- * a flag that asks the process to
- * do something to itself.
- */
-issig()
-{
-       register n;
-       register struct proc *p;
-
-       p = u.u_procp;
-       while(p->p_sig) {
-               n = fsig(p);
-               if((u.u_signal[n]&1) == 0 || (p->p_flag&STRC))
-                       return(n);
-               p->p_sig &= ~(1<<(n-1));
-       }
-       return(0);
-}
-
-/*
- * Enter the tracing STOP state.
- * In this state, the parent is
- * informed and the process is able to
- * receive commands from the parent.
- */
-stop()
-{
-       register struct proc *pp, *cp;
-
-loop:
-       cp = u.u_procp;
-       if(cp->p_ppid != 1)
-       for (pp = &proc[0]; pp < &proc[NPROC]; pp++)
-               if (pp->p_pid == cp->p_ppid) {
-                       wakeup((caddr_t)pp);
-                       cp->p_stat = SSTOP;
-                       swtch();
-                       if ((cp->p_flag&STRC)==0 || procxmt())
-                               return;
-                       goto loop;
-               }
-       exit(fsig(u.u_procp));
-}
-
-/*
- * Perform the action specified by
- * the current signal.
- * The usual sequence is:
- *     if(issig())
- *             psig();
- */
-psig()
-{
-       register n, p;
-       register struct proc *rp;
-
-       rp = u.u_procp;
-       if (u.u_fpsaved==0) {
-               savfp(&u.u_fps);
-               u.u_fpsaved = 1;
-       }
-       if (rp->p_flag&STRC)
-               stop();
-       n = fsig(rp);
-       if (n==0)
-               return;
-       rp->p_sig &= ~(1<<(n-1));
-       if((p=u.u_signal[n]) != 0) {
-               u.u_error = 0;
-               if(n != SIGINS && n != SIGTRC)
-                       u.u_signal[n] = 0;
-               sendsig((caddr_t)p, n);
-               return;
-       }
-       switch(n) {
-
-       case SIGQUIT:
-       case SIGINS:
-       case SIGTRC:
-       case SIGIOT:
-       case SIGEMT:
-       case SIGFPT:
-       case SIGBUS:
-       case SIGSEG:
-       case SIGSYS:
-               if(core())
-                       n += 0200;
-       }
-       exit(n);
-}
-
-/*
- * find the signal in bit-position
- * representation in p_sig.
- */
-fsig(p)
-struct proc *p;
-{
-       register n, i;
-
-       n = p->p_sig;
-       for(i=1; i<NSIG; i++) {
-               if(n & 1)
-                       return(i);
-               n >>= 1;
-       }
-       return(0);
-}
-
-/*
- * Create a core image on the file "core"
- * If you are looking for protection glitches,
- * there are probably a wealth of them here
- * when this occurs to a suid command.
- *
- * It writes USIZE block of the
- * user.h area followed by the entire
- * data+stack segments.
- */
-core()
-{
-       register struct inode *ip;
-       register unsigned s;
-       extern schar();
-
-       u.u_error = 0;
-       u.u_dirp = "core";
-       ip = namei(schar, 1);
-       if(ip == NULL) {
-               if(u.u_error)
-                       return(0);
-               ip = maknode(0666);
-               if (ip==NULL)
-                       return(0);
-       }
-       if(!access(ip, IWRITE) &&
-          (ip->i_mode&IFMT) == IFREG &&
-          u.u_uid == u.u_ruid) {
-               itrunc(ip);
-               u.u_offset = 0;
-               u.u_base = (caddr_t)&u;
-               u.u_count = ctob(USIZE);
-               u.u_segflg = 1;
-               writei(ip);
-               s = u.u_procp->p_size - USIZE;
-               estabur((unsigned)0, s, (unsigned)0, 0, RO);
-               u.u_base = 0;
-               u.u_count = ctob(s);
-               u.u_segflg = 0;
-               writei(ip);
-       }
-       iput(ip);
-       return(u.u_error==0);
-}
-
-/*
- * grow the stack to include the SP
- * true return if successful.
- */
-
-grow(sp)
-unsigned sp;
-{
-       register si, i;
-       register struct proc *p;
-       register a;
-
-       if(sp >= -ctob(u.u_ssize))
-               return(0);
-       si = (-sp)/64 - u.u_ssize + SINCR;
-       if(si <= 0)
-               return(0);
-       if(estabur(u.u_tsize, u.u_dsize, u.u_ssize+si, u.u_sep, RO))
-               return(0);
-       p = u.u_procp;
-       expand(p->p_size+si);
-       a = p->p_addr + p->p_size;
-       for(i=u.u_ssize; i; i--) {
-               a--;
-               copyseg(a-si, a);
-       }
-       for(i=si; i; i--)
-               clearseg(--a);
-       u.u_ssize += si;
-       return(1);
-}
-
-/*
- * sys-trace system call.
- */
-ptrace()
-{
-       register struct proc *p;
-       register struct a {
-               int     data;
-               int     pid;
-               int     *addr;
-               int     req;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if (uap->req <= 0) {
-               u.u_procp->p_flag |= STRC;
-               return;
-       }
-       for (p=proc; p < &proc[NPROC]; p++) 
-               if (p->p_stat==SSTOP
-                && p->p_pid==uap->pid
-                && p->p_ppid==u.u_procp->p_pid)
-                       goto found;
-       u.u_error = ESRCH;
-       return;
-
-    found:
-       while (ipc.ip_lock)
-               sleep((caddr_t)&ipc, IPCPRI);
-       ipc.ip_lock = p->p_pid;
-       ipc.ip_data = uap->data;
-       ipc.ip_addr = uap->addr;
-       ipc.ip_req = uap->req;
-       p->p_flag &= ~SWTED;
-       setrun(p);
-       while (ipc.ip_req > 0)
-               sleep((caddr_t)&ipc, IPCPRI);
-       u.u_r.r_val1 = ipc.ip_data;
-       if (ipc.ip_req < 0)
-               u.u_error = EIO;
-       ipc.ip_lock = 0;
-       wakeup((caddr_t)&ipc);
-}
-
-/*
- * Code that the child process
- * executes to implement the command
- * of the parent process in tracing.
- */
-procxmt()
-{
-       register int i;
-       register *p;
-       register struct text *xp;
-
-       if (ipc.ip_lock != u.u_procp->p_pid)
-               return(0);
-       i = ipc.ip_req;
-       ipc.ip_req = 0;
-       wakeup((caddr_t)&ipc);
-       switch (i) {
-
-       /* read user I */
-       case 1:
-               if (fuibyte((caddr_t)ipc.ip_addr) == -1)
-                       goto error;
-               ipc.ip_data = fuiword((caddr_t)ipc.ip_addr);
-               break;
-
-       /* read user D */
-       case 2:
-               if (fubyte((caddr_t)ipc.ip_addr) == -1)
-                       goto error;
-               ipc.ip_data = fuword((caddr_t)ipc.ip_addr);
-               break;
-
-       /* read u */
-       case 3:
-               i = (int)ipc.ip_addr;
-               if (i<0 || i >= ctob(USIZE))
-                       goto error;
-               ipc.ip_data = ((physadr)&u)->r[i>>1];
-               break;
-
-       /* write user I */
-       /* Must set up to allow writing */
-       case 4:
-               /*
-                * If text, must assure exclusive use
-                */
-               if (xp = u.u_procp->p_textp) {
-                       if (xp->x_count!=1 || xp->x_iptr->i_mode&ISVTX)
-                               goto error;
-                       xp->x_iptr->i_flag &= ~ITEXT;
-               }
-               estabur(u.u_tsize, u.u_dsize, u.u_ssize, u.u_sep, RW);
-               i = suiword((caddr_t)ipc.ip_addr, 0);
-               suiword((caddr_t)ipc.ip_addr, ipc.ip_data);
-               estabur(u.u_tsize, u.u_dsize, u.u_ssize, u.u_sep, RO);
-               if (i<0)
-                       goto error;
-               if (xp)
-                       xp->x_flag |= XWRIT;
-               break;
-
-       /* write user D */
-       case 5:
-               if (suword((caddr_t)ipc.ip_addr, 0) < 0)
-                       goto error;
-               suword((caddr_t)ipc.ip_addr, ipc.ip_data);
-               break;
-
-       /* write u */
-       case 6:
-               i = (int)ipc.ip_addr;
-               p = (int *)&((physadr)&u)->r[i>>1];
-               if (p >= (int *)&u.u_fps && p < (int *)&u.u_fps.u_fpregs[6])
-                       goto ok;
-               for (i=0; i<8; i++)
-                       if (p == &u.u_ar0[regloc[i]])
-                               goto ok;
-               if (p == &u.u_ar0[RPS]) {
-                       ipc.ip_data |= 0170000; /* assure user space */
-                       ipc.ip_data &= ~0340;   /* priority 0 */
-                       goto ok;
-               }
-               goto error;
-
-       ok:
-               *p = ipc.ip_data;
-               break;
-
-       /* set signal and continue */
-       /*  one version causes a trace-trap */
-       case 9:
-               u.u_ar0[RPS] |= TBIT;
-       case 7:
-               if ((int)ipc.ip_addr != 1)
-                       u.u_ar0[PC] = (int)ipc.ip_addr;
-               u.u_procp->p_sig = 0;
-               if (ipc.ip_data)
-                       psignal(u.u_procp, ipc.ip_data);
-               return(1);
-
-       /* force exit */
-       case 8:
-               exit(fsig(u.u_procp));
-
-       default:
-       error:
-               ipc.ip_req = -1;
-       }
-       return(0);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/slp.c b/.ref-Research-V7/usr/sys/sys/slp.c
deleted file mode 100644 (file)
index 77d9f8f..0000000
+++ /dev/null
@@ -1,575 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/text.h"
-#include "../h/map.h"
-#include "../h/file.h"
-#include "../h/inode.h"
-#include "../h/buf.h"
-
-#define SQSIZE 0100    /* Must be power of 2 */
-#define HASH(x)        (( (int) x >> 5) & (SQSIZE-1))
-struct proc *slpque[SQSIZE];
-
-/*
- * Give up the processor till a wakeup occurs
- * on chan, at which time the process
- * enters the scheduling queue at priority pri.
- * The most important effect of pri is that when
- * pri<=PZERO a signal cannot disturb the sleep;
- * if pri>PZERO signals will be processed.
- * Callers of this routine must be prepared for
- * premature return, and check that the reason for
- * sleeping has gone away.
- */
-sleep(chan, pri)
-caddr_t chan;
-{
-       register struct proc *rp;
-       register s, h;
-
-       rp = u.u_procp;
-       s = spl6();
-       if (chan==0)
-               panic("zero wchan");
-       rp->p_stat = SSLEEP;
-       rp->p_wchan = chan;
-       if (chan==0)
-               panic("Sleeping on wchan 0");
-       rp->p_pri = pri;
-       h = HASH(chan);
-       rp->p_link = slpque[h];
-       slpque[h] = rp;
-       if(pri > PZERO) {
-               if(issig()) {
-                       rp->p_wchan = 0;
-                       rp->p_stat = SRUN;
-                       slpque[h] = rp->p_link;
-                       spl0();
-                       goto psig;
-               }
-               spl0();
-               if(runin != 0) {
-                       runin = 0;
-                       wakeup((caddr_t)&runin);
-               }
-               swtch();
-               if(issig())
-                       goto psig;
-       } else {
-               spl0();
-               swtch();
-       }
-       splx(s);
-       return;
-
-       /*
-        * If priority was low (>PZERO) and
-        * there has been a signal,
-        * execute non-local goto to
-        * the qsav location.
-        * (see trap1/trap.c)
-        */
-psig:
-       resume(u.u_procp->p_addr, u.u_qsav);
-}
-
-/*
- * Wake up all processes sleeping on chan.
- */
-wakeup(chan)
-register caddr_t chan;
-{
-       register struct proc *p, *q;
-       register i;
-       int s;
-
-       s = spl6();
-       i = HASH(chan);
-       p = slpque[i];
-       q = NULL;
-       while(p != NULL) {
-               if(p->p_wchan==chan && p->p_stat!=SZOMB) {
-                       struct proc *sp;
-
-                       if (q == NULL)
-                               sp = slpque[i] = p->p_link;
-                       else
-                               sp = q->p_link = p->p_link;
-                       p->p_wchan = 0;
-                       setrun(p);
-                       p = sp;
-                       continue;
-               }
-               q = p;
-               p = p->p_link;
-       }
-       splx(s);
-}
-
-/*
- * when you are sure that it
- * is impossible to get the
- * 'proc on q' diagnostic, the
- * diagnostic loop can be removed.
- */
-setrq(p)
-struct proc *p;
-{
-       register struct proc *q;
-       register s;
-
-       s = spl6();
-       for(q=runq; q!=NULL; q=q->p_link)
-               if(q == p) {
-                       printf("proc on q\n");
-                       goto out;
-               }
-       p->p_link = runq;
-       runq = p;
-out:
-       splx(s);
-}
-
-/*
- * Set the process running;
- * arrange for it to be swapped in if necessary.
- */
-setrun(p)
-register struct proc *p;
-{
-       register caddr_t w;
-
-       if (p->p_stat==0 || p->p_stat==SZOMB)
-               panic("Running a dead proc");
-       /*
-        * The assignment to w is necessary because of
-        * race conditions. (Interrupt between test and use)
-        */
-       if (w = p->p_wchan) {
-               wakeup(w);
-               return;
-       }
-       p->p_stat = SRUN;
-       setrq(p);
-       if(p->p_pri < curpri)
-               runrun++;
-       if(runout != 0 && (p->p_flag&SLOAD) == 0) {
-               runout = 0;
-               wakeup((caddr_t)&runout);
-       }
-}
-
-/*
- * Set user priority.
- * The rescheduling flag (runrun)
- * is set if the priority is better
- * than the currently running process.
- */
-setpri(pp)
-register struct proc *pp;
-{
-       register p;
-
-       p = (pp->p_cpu & 0377)/16;
-       p += PUSER + pp->p_nice - NZERO;
-       if(p > 127)
-               p = 127;
-       if(p < curpri)
-               runrun++;
-       pp->p_pri = p;
-       return(p);
-}
-
-/*
- * The main loop of the scheduling (swapping)
- * process.
- * The basic idea is:
- *  see if anyone wants to be swapped in;
- *  swap out processes until there is room;
- *  swap him in;
- *  repeat.
- * The runout flag is set whenever someone is swapped out.
- * Sched sleeps on it awaiting work.
- *
- * Sched sleeps on runin whenever it cannot find enough
- * core (by swapping out or otherwise) to fit the
- * selected swapped process.  It is awakened when the
- * core situation changes and in any case once per second.
- */
-sched()
-{
-       register struct proc *rp, *p;
-       register outage, inage;
-       int maxsize;
-
-       /*
-        * find user to swap in;
-        * of users ready, select one out longest
-        */
-
-loop:
-       spl6();
-       outage = -20000;
-       for (rp = &proc[0]; rp < &proc[NPROC]; rp++)
-       if (rp->p_stat==SRUN && (rp->p_flag&SLOAD)==0 &&
-           rp->p_time - (rp->p_nice-NZERO)*8 > outage) {
-               p = rp;
-               outage = rp->p_time - (rp->p_nice-NZERO)*8;
-       }
-       /*
-        * If there is no one there, wait.
-        */
-       if (outage == -20000) {
-               runout++;
-               sleep((caddr_t)&runout, PSWP);
-               goto loop;
-       }
-       spl0();
-
-       /*
-        * See if there is core for that process;
-        * if so, swap it in.
-        */
-
-       if (swapin(p))
-               goto loop;
-
-       /*
-        * none found.
-        * look around for core.
-        * Select the largest of those sleeping
-        * at bad priority; if none, select the oldest.
-        */
-
-       spl6();
-       p = NULL;
-       maxsize = -1;
-       inage = -1;
-       for (rp = &proc[0]; rp < &proc[NPROC]; rp++) {
-               if (rp->p_stat==SZOMB
-                || (rp->p_flag&(SSYS|SLOCK|SULOCK|SLOAD))!=SLOAD)
-                       continue;
-               if (rp->p_textp && rp->p_textp->x_flag&XLOCK)
-                       continue;
-               if (rp->p_stat==SSLEEP&&rp->p_pri>=PZERO || rp->p_stat==SSTOP) {
-                       if (maxsize < rp->p_size) {
-                               p = rp;
-                               maxsize = rp->p_size;
-                       }
-               } else if (maxsize<0 && (rp->p_stat==SRUN||rp->p_stat==SSLEEP)) {
-                       if (rp->p_time+rp->p_nice-NZERO > inage) {
-                               p = rp;
-                               inage = rp->p_time+rp->p_nice-NZERO;
-                       }
-               }
-       }
-       spl0();
-       /*
-        * Swap found user out if sleeping at bad pri,
-        * or if he has spent at least 2 seconds in core and
-        * the swapped-out process has spent at least 3 seconds out.
-        * Otherwise wait a bit and try again.
-        */
-       if (maxsize>=0 || (outage>=3 && inage>=2)) {
-               p->p_flag &= ~SLOAD;
-               xswap(p, 1, 0);
-               goto loop;
-       }
-       spl6();
-       runin++;
-       sleep((caddr_t)&runin, PSWP);
-       goto loop;
-}
-
-/*
- * Swap a process in.
- * Allocate data and possible text separately.
- * It would be better to do largest first.
- */
-swapin(p)
-register struct proc *p;
-{
-       register struct text *xp;
-       register int a;
-       int x;
-
-       if ((a = malloc(coremap, p->p_size)) == NULL)
-               return(0);
-       if (xp = p->p_textp) {
-               xlock(xp);
-               if (xp->x_ccount==0) {
-                       if ((x = malloc(coremap, xp->x_size)) == NULL) {
-                               xunlock(xp);
-                               mfree(coremap, p->p_size, a);
-                               return(0);
-                       }
-                       xp->x_caddr = x;
-                       if ((xp->x_flag&XLOAD)==0)
-                               swap(xp->x_daddr,x,xp->x_size,B_READ);
-               }
-               xp->x_ccount++;
-               xunlock(xp);
-       }
-       swap(p->p_addr, a, p->p_size, B_READ);
-       mfree(swapmap, ctod(p->p_size), p->p_addr);
-       p->p_addr = a;
-       p->p_flag |= SLOAD;
-       p->p_time = 0;
-       return(1);
-}
-
-/*
- * put the current process on
- * the Q of running processes and
- * call the scheduler.
- */
-qswtch()
-{
-
-       setrq(u.u_procp);
-       swtch();
-}
-
-/*
- * This routine is called to reschedule the CPU.
- * if the calling process is not in RUN state,
- * arrangements for it to restart must have
- * been made elsewhere, usually by calling via sleep.
- * There is a race here. A process may become
- * ready after it has been examined.
- * In this case, idle() will be called and
- * will return in at most 1HZ time.
- * i.e. its not worth putting an spl() in.
- */
-swtch()
-{
-       register n;
-       register struct proc *p, *q, *pp, *pq;
-
-       /*
-        * If not the idle process, resume the idle process.
-        */
-       if (u.u_procp != &proc[0]) {
-               if (save(u.u_rsav)) {
-                       sureg();
-                       return;
-               }
-               if (u.u_fpsaved==0) {
-                       savfp(&u.u_fps);
-                       u.u_fpsaved = 1;
-               }
-               resume(proc[0].p_addr, u.u_qsav);
-       }
-       /*
-        * The first save returns nonzero when proc 0 is resumed
-        * by another process (above); then the second is not done
-        * and the process-search loop is entered.
-        *
-        * The first save returns 0 when swtch is called in proc 0
-        * from sched().  The second save returns 0 immediately, so
-        * in this case too the process-search loop is entered.
-        * Thus when proc 0 is awakened by being made runnable, it will
-        * find itself and resume itself at rsav, and return to sched().
-        */
-       if (save(u.u_qsav)==0 && save(u.u_rsav))
-               return;
-loop:
-       spl6();
-       runrun = 0;
-       pp = NULL;
-       q = NULL;
-       n = 128;
-       /*
-        * Search for highest-priority runnable process
-        */
-       for(p=runq; p!=NULL; p=p->p_link) {
-               if((p->p_stat==SRUN) && (p->p_flag&SLOAD)) {
-                       if(p->p_pri < n) {
-                               pp = p;
-                               pq = q;
-                               n = p->p_pri;
-                       }
-               }
-               q = p;
-       }
-       /*
-        * If no process is runnable, idle.
-        */
-       p = pp;
-       if(p == NULL) {
-               idle();
-               goto loop;
-       }
-       q = pq;
-       if(q == NULL)
-               runq = p->p_link;
-       else
-               q->p_link = p->p_link;
-       curpri = n;
-       spl0();
-       /*
-        * The rsav (ssav) contents are interpreted in the new address space
-        */
-       n = p->p_flag&SSWAP;
-       p->p_flag &= ~SSWAP;
-       resume(p->p_addr, n? u.u_ssav: u.u_rsav);
-}
-
-/*
- * Create a new process-- the internal version of
- * sys fork.
- * It returns 1 in the new process, 0 in the old.
- */
-newproc()
-{
-       int a1, a2;
-       struct proc *p, *up;
-       register struct proc *rpp, *rip;
-       register n;
-
-       p = NULL;
-       /*
-        * First, just locate a slot for a process
-        * and copy the useful info from this process into it.
-        * The panic "cannot happen" because fork has already
-        * checked for the existence of a slot.
-        */
-retry:
-       mpid++;
-       if(mpid >= 30000) {
-               mpid = 0;
-               goto retry;
-       }
-       for(rpp = &proc[0]; rpp < &proc[NPROC]; rpp++) {
-               if(rpp->p_stat == NULL && p==NULL)
-                       p = rpp;
-               if (rpp->p_pid==mpid || rpp->p_pgrp==mpid)
-                       goto retry;
-       }
-       if ((rpp = p)==NULL)
-               panic("no procs");
-
-       /*
-        * make proc entry for new proc
-        */
-
-       rip = u.u_procp;
-       up = rip;
-       rpp->p_stat = SRUN;
-       rpp->p_clktim = 0;
-       rpp->p_flag = SLOAD;
-       rpp->p_uid = rip->p_uid;
-       rpp->p_pgrp = rip->p_pgrp;
-       rpp->p_nice = rip->p_nice;
-       rpp->p_textp = rip->p_textp;
-       rpp->p_pid = mpid;
-       rpp->p_ppid = rip->p_pid;
-       rpp->p_time = 0;
-       rpp->p_cpu = 0;
-
-       /*
-        * make duplicate entries
-        * where needed
-        */
-
-       for(n=0; n<NOFILE; n++)
-               if(u.u_ofile[n] != NULL)
-                       u.u_ofile[n]->f_count++;
-       if(up->p_textp != NULL) {
-               up->p_textp->x_count++;
-               up->p_textp->x_ccount++;
-       }
-       u.u_cdir->i_count++;
-       if (u.u_rdir)
-               u.u_rdir->i_count++;
-       /*
-        * Partially simulate the environment
-        * of the new process so that when it is actually
-        * created (by copying) it will look right.
-        */
-       rpp = p;
-       u.u_procp = rpp;
-       rip = up;
-       n = rip->p_size;
-       a1 = rip->p_addr;
-       rpp->p_size = n;
-       /*
-        * When the resume is executed for the new process,
-        * here's where it will resume.
-        */
-       if (save(u.u_ssav)) {
-               sureg();
-               return(1);
-       }
-       a2 = malloc(coremap, n);
-       /*
-        * If there is not enough core for the
-        * new process, swap out the current process to generate the
-        * copy.
-        */
-       if(a2 == NULL) {
-               rip->p_stat = SIDL;
-               rpp->p_addr = a1;
-               xswap(rpp, 0, 0);
-               rip->p_stat = SRUN;
-       } else {
-               /*
-                * There is core, so just copy.
-                */
-               rpp->p_addr = a2;
-               while(n--)
-                       copyseg(a1++, a2++);
-       }
-       u.u_procp = rip;
-       setrq(rpp);
-       rpp->p_flag |= SSWAP;
-       return(0);
-}
-
-/*
- * Change the size of the data+stack regions of the process.
- * If the size is shrinking, it's easy-- just release the extra core.
- * If it's growing, and there is core, just allocate it
- * and copy the image, taking care to reset registers to account
- * for the fact that the system's stack has moved.
- * If there is no core, arrange for the process to be swapped
- * out after adjusting the size requirement-- when it comes
- * in, enough core will be allocated.
- *
- * After the expansion, the caller will take care of copying
- * the user's stack towards or away from the data area.
- */
-expand(newsize)
-{
-       register i, n;
-       register struct proc *p;
-       register a1, a2;
-
-       p = u.u_procp;
-       n = p->p_size;
-       p->p_size = newsize;
-       a1 = p->p_addr;
-       if(n >= newsize) {
-               mfree(coremap, n-newsize, a1+newsize);
-               return;
-       }
-       if (save(u.u_ssav)) {
-               sureg();
-               return;
-       }
-       a2 = malloc(coremap, newsize);
-       if(a2 == NULL) {
-               xswap(p, 1, n);
-               p->p_flag |= SSWAP;
-               qswtch();
-               /* no return */
-       }
-       p->p_addr = a2;
-       for(i=0; i<n; i++)
-               copyseg(a1+i, a2+i);
-       mfree(coremap, n, a1);
-       resume(a2, u.u_ssav);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/subr.c b/.ref-Research-V7/usr/sys/sys/subr.c
deleted file mode 100644 (file)
index 5c10b4a..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/conf.h"
-#include "../h/inode.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/buf.h"
-
-/*
- * Bmap defines the structure of file system storage
- * by returning the physical block number on a device given the
- * inode and the logical block number in a file.
- * When convenient, it also leaves the physical
- * block number of the next block of the file in rablock
- * for use in read-ahead.
- */
-daddr_t
-bmap(ip, bn, rwflg)
-register struct inode *ip;
-daddr_t bn;
-{
-       register i;
-       struct buf *bp, *nbp;
-       int j, sh;
-       daddr_t nb, *bap;
-       dev_t dev;
-
-       if(bn < 0) {
-               u.u_error = EFBIG;
-               return((daddr_t)0);
-       }
-       dev = ip->i_dev;
-       rablock = 0;
-
-       /*
-        * blocks 0..NADDR-4 are direct blocks
-        */
-       if(bn < NADDR-3) {
-               i = bn;
-               nb = ip->i_un.i_addr[i];
-               if(nb == 0) {
-                       if(rwflg==B_READ || (bp = alloc(dev))==NULL)
-                               return((daddr_t)-1);
-                       nb = bp->b_blkno;
-                       bdwrite(bp);
-                       ip->i_un.i_addr[i] = nb;
-                       ip->i_flag |= IUPD|ICHG;
-               }
-               if(i < NADDR-4)
-                       rablock = ip->i_un.i_addr[i+1];
-               return(nb);
-       }
-
-       /*
-        * addresses NADDR-3, NADDR-2, and NADDR-1
-        * have single, double, triple indirect blocks.
-        * the first step is to determine
-        * how many levels of indirection.
-        */
-       sh = 0;
-       nb = 1;
-       bn -= NADDR-3;
-       for(j=3; j>0; j--) {
-               sh += NSHIFT;
-               nb <<= NSHIFT;
-               if(bn < nb)
-                       break;
-               bn -= nb;
-       }
-       if(j == 0) {
-               u.u_error = EFBIG;
-               return((daddr_t)0);
-       }
-
-       /*
-        * fetch the address from the inode
-        */
-       nb = ip->i_un.i_addr[NADDR-j];
-       if(nb == 0) {
-               if(rwflg==B_READ || (bp = alloc(dev))==NULL)
-                       return((daddr_t)-1);
-               nb = bp->b_blkno;
-               bdwrite(bp);
-               ip->i_un.i_addr[NADDR-j] = nb;
-               ip->i_flag |= IUPD|ICHG;
-       }
-
-       /*
-        * fetch through the indirect blocks
-        */
-       for(; j<=3; j++) {
-               bp = bread(dev, nb);
-               if(bp->b_flags & B_ERROR) {
-                       brelse(bp);
-                       return((daddr_t)0);
-               }
-               bap = bp->b_un.b_daddr;
-               sh -= NSHIFT;
-               i = (bn>>sh) & NMASK;
-               nb = bap[i];
-               if(nb == 0) {
-                       if(rwflg==B_READ || (nbp = alloc(dev))==NULL) {
-                               brelse(bp);
-                               return((daddr_t)-1);
-                       }
-                       nb = nbp->b_blkno;
-                       bdwrite(nbp);
-                       bap[i] = nb;
-                       bdwrite(bp);
-               } else
-                       brelse(bp);
-       }
-
-       /*
-        * calculate read-ahead.
-        */
-       if(i < NINDIR-1)
-               rablock = bap[i+1];
-       return(nb);
-}
-
-/*
- * Pass back  c  to the user at his location u_base;
- * update u_base, u_count, and u_offset.  Return -1
- * on the last character of the user's read.
- * u_base is in the user address space unless u_segflg is set.
- */
-passc(c)
-register c;
-{
-       register id;
-
-       if((id = u.u_segflg) == 1)
-               *u.u_base = c;
-       else
-               if(id?suibyte(u.u_base, c):subyte(u.u_base, c) < 0) {
-                       u.u_error = EFAULT;
-                       return(-1);
-               }
-       u.u_count--;
-       u.u_offset++;
-       u.u_base++;
-       return(u.u_count == 0? -1: 0);
-}
-
-/*
- * Pick up and return the next character from the user's
- * write call at location u_base;
- * update u_base, u_count, and u_offset.  Return -1
- * when u_count is exhausted.  u_base is in the user's
- * address space unless u_segflg is set.
- */
-cpass()
-{
-       register c, id;
-
-       if(u.u_count == 0)
-               return(-1);
-       if((id = u.u_segflg) == 1)
-               c = *u.u_base;
-       else
-               if((c = id==0?fubyte(u.u_base):fuibyte(u.u_base)) < 0) {
-                       u.u_error = EFAULT;
-                       return(-1);
-               }
-       u.u_count--;
-       u.u_offset++;
-       u.u_base++;
-       return(c&0377);
-}
-
-/*
- * Routine which sets a user error; placed in
- * illegal entries in the bdevsw and cdevsw tables.
- */
-nodev()
-{
-
-       u.u_error = ENODEV;
-}
-
-/*
- * Null routine; placed in insignificant entries
- * in the bdevsw and cdevsw tables.
- */
-nulldev()
-{
-}
-
-/*
- * copy count bytes from from to to.
- */
-bcopy(from, to, count)
-caddr_t from, to;
-register count;
-{
-       register char *f, *t;
-
-       f = from;
-       t = to;
-       do
-               *t++ = *f++;
-       while(--count);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/sys1.c b/.ref-Research-V7/usr/sys/sys/sys1.c
deleted file mode 100644 (file)
index 1172f3d..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/map.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/buf.h"
-#include "../h/reg.h"
-#include "../h/inode.h"
-#include "../h/seg.h"
-#include "../h/acct.h"
-
-/*
- * exec system call, with and without environments.
- */
-struct execa {
-       char    *fname;
-       char    **argp;
-       char    **envp;
-};
-
-exec()
-{
-       ((struct execa *)u.u_ap)->envp = NULL;
-       exece();
-}
-
-exece()
-{
-       register nc;
-       register char *cp;
-       register struct buf *bp;
-       register struct execa *uap;
-       int na, ne, bno, ucp, ap, c;
-       struct inode *ip;
-
-       if ((ip = namei(uchar, 0)) == NULL)
-               return;
-       bno = 0;
-       bp = 0;
-       if(access(ip, IEXEC))
-               goto bad;
-       if((ip->i_mode & IFMT) != IFREG ||
-          (ip->i_mode & (IEXEC|(IEXEC>>3)|(IEXEC>>6))) == 0) {
-               u.u_error = EACCES;
-               goto bad;
-       }
-       /*
-        * Collect arguments on "file" in swap space.
-        */
-       na = 0;
-       ne = 0;
-       nc = 0;
-       uap = (struct execa *)u.u_ap;
-       if ((bno = malloc(swapmap,(NCARGS+BSIZE-1)/BSIZE)) == 0)
-               panic("Out of swap");
-       if (uap->argp) for (;;) {
-               ap = NULL;
-               if (uap->argp) {
-                       ap = fuword((caddr_t)uap->argp);
-                       uap->argp++;
-               }
-               if (ap==NULL && uap->envp) {
-                       uap->argp = NULL;
-                       if ((ap = fuword((caddr_t)uap->envp)) == NULL)
-                               break;
-                       uap->envp++;
-                       ne++;
-               }
-               if (ap==NULL)
-                       break;
-               na++;
-               if(ap == -1)
-                       u.u_error = EFAULT;
-               do {
-                       if (nc >= NCARGS-1)
-                               u.u_error = E2BIG;
-                       if ((c = fubyte((caddr_t)ap++)) < 0)
-                               u.u_error = EFAULT;
-                       if (u.u_error)
-                               goto bad;
-                       if ((nc&BMASK) == 0) {
-                               if (bp)
-                                       bawrite(bp);
-                               bp = getblk(swapdev, swplo+bno+(nc>>BSHIFT));
-                               cp = bp->b_un.b_addr;
-                       }
-                       nc++;
-                       *cp++ = c;
-               } while (c>0);
-       }
-       if (bp)
-               bawrite(bp);
-       bp = 0;
-       nc = (nc + NBPW-1) & ~(NBPW-1);
-       if (getxfile(ip, nc) || u.u_error)
-               goto bad;
-
-       /*
-        * copy back arglist
-        */
-
-       ucp = -nc - NBPW;
-       ap = ucp - na*NBPW - 3*NBPW;
-       u.u_ar0[R6] = ap;
-       suword((caddr_t)ap, na-ne);
-       nc = 0;
-       for (;;) {
-               ap += NBPW;
-               if (na==ne) {
-                       suword((caddr_t)ap, 0);
-                       ap += NBPW;
-               }
-               if (--na < 0)
-                       break;
-               suword((caddr_t)ap, ucp);
-               do {
-                       if ((nc&BMASK) == 0) {
-                               if (bp)
-                                       brelse(bp);
-                               bp = bread(swapdev, swplo+bno+(nc>>BSHIFT));
-                               cp = bp->b_un.b_addr;
-                       }
-                       subyte((caddr_t)ucp++, (c = *cp++));
-                       nc++;
-               } while(c&0377);
-       }
-       suword((caddr_t)ap, 0);
-       suword((caddr_t)ucp, 0);
-       setregs();
-bad:
-       if (bp)
-               brelse(bp);
-       if(bno)
-               mfree(swapmap, (NCARGS+BSIZE-1)/BSIZE, bno);
-       iput(ip);
-}
-
-/*
- * Read in and set up memory for executed file.
- * Zero return is normal;
- * non-zero means only the text is being replaced
- */
-getxfile(ip, nargc)
-register struct inode *ip;
-{
-       register unsigned ds;
-       register sep;
-       register unsigned ts, ss;
-       register i, overlay;
-       long lsize;
-
-       /*
-        * read in first few bytes
-        * of file for segment
-        * sizes:
-        * ux_mag = 407/410/411/405
-        *  407 is plain executable
-        *  410 is RO text
-        *  411 is separated ID
-        *  405 is overlaid text
-        */
-
-       u.u_base = (caddr_t)&u.u_exdata;
-       u.u_count = sizeof(u.u_exdata);
-       u.u_offset = 0;
-       u.u_segflg = 1;
-       readi(ip);
-       u.u_segflg = 0;
-       if(u.u_error)
-               goto bad;
-       if (u.u_count!=0) {
-               u.u_error = ENOEXEC;
-               goto bad;
-       }
-       sep = 0;
-       overlay = 0;
-       if(u.u_exdata.ux_mag == 0407) {
-               lsize = (long)u.u_exdata.ux_dsize + u.u_exdata.ux_tsize;
-               u.u_exdata.ux_dsize = lsize;
-               if (lsize != u.u_exdata.ux_dsize) {     /* check overflow */
-                       u.u_error = ENOMEM;
-                       goto bad;
-               }
-               u.u_exdata.ux_tsize = 0;
-       } else if (u.u_exdata.ux_mag == 0411)
-               sep++;
-       else if (u.u_exdata.ux_mag == 0405)
-               overlay++;
-       else if (u.u_exdata.ux_mag != 0410) {
-               u.u_error = ENOEXEC;
-               goto bad;
-       }
-       if(u.u_exdata.ux_tsize!=0 && (ip->i_flag&ITEXT)==0 && ip->i_count!=1) {
-               u.u_error = ETXTBSY;
-               goto bad;
-       }
-
-       /*
-        * find text and data sizes
-        * try them out for possible
-        * overflow of max sizes
-        */
-       ts = btoc(u.u_exdata.ux_tsize);
-       lsize = (long)u.u_exdata.ux_dsize + u.u_exdata.ux_bsize;
-       if (lsize != (unsigned)lsize) {
-               u.u_error = ENOMEM;
-               goto bad;
-       }
-       ds = btoc(lsize);
-       ss = SSIZE + btoc(nargc);
-       if (overlay) {
-               if (u.u_sep==0 && ctos(ts) != ctos(u.u_tsize) || nargc) {
-                       u.u_error = ENOMEM;
-                       goto bad;
-               }
-               ds = u.u_dsize;
-               ss = u.u_ssize;
-               sep = u.u_sep;
-               xfree();
-               xalloc(ip);
-               u.u_ar0[PC] = u.u_exdata.ux_entloc & ~01;
-       } else {
-               if(estabur(ts, ds, ss, sep, RO))
-                       goto bad;
-       
-               /*
-                * allocate and clear core
-                * at this point, committed
-                * to the new image
-                */
-       
-               u.u_prof.pr_scale = 0;
-               xfree();
-               i = USIZE+ds+ss;
-               expand(i);
-               while(--i >= USIZE)
-                       clearseg(u.u_procp->p_addr+i);
-               xalloc(ip);
-       
-               /*
-                * read in data segment
-                */
-       
-               estabur((unsigned)0, ds, (unsigned)0, 0, RO);
-               u.u_base = 0;
-               u.u_offset = sizeof(u.u_exdata)+u.u_exdata.ux_tsize;
-               u.u_count = u.u_exdata.ux_dsize;
-               readi(ip);
-               /*
-                * set SUID/SGID protections, if no tracing
-                */
-               if ((u.u_procp->p_flag&STRC)==0) {
-                       if(ip->i_mode&ISUID)
-                               if(u.u_uid != 0) {
-                                       u.u_uid = ip->i_uid;
-                                       u.u_procp->p_uid = ip->i_uid;
-                               }
-                       if(ip->i_mode&ISGID)
-                               u.u_gid = ip->i_gid;
-               } else
-                       psignal(u.u_procp, SIGTRC);
-       }
-       u.u_tsize = ts;
-       u.u_dsize = ds;
-       u.u_ssize = ss;
-       u.u_sep = sep;
-       estabur(ts, ds, ss, sep, RO);
-bad:
-       return(overlay);
-}
-
-/*
- * Clear registers on exec
- */
-setregs()
-{
-       register int *rp;
-       register char *cp;
-       register i;
-
-       for(rp = &u.u_signal[0]; rp < &u.u_signal[NSIG]; rp++)
-               if((*rp & 1) == 0)
-                       *rp = 0;
-       for(cp = &regloc[0]; cp < &regloc[6];)
-               u.u_ar0[*cp++] = 0;
-       u.u_ar0[PC] = u.u_exdata.ux_entloc & ~01;
-       for(rp = (int *)&u.u_fps; rp < (int *)&u.u_fps.u_fpregs[6];)
-               *rp++ = 0;
-       for(i=0; i<NOFILE; i++) {
-               if (u.u_pofile[i]&EXCLOSE) {
-                       closef(u.u_ofile[i]);
-                       u.u_ofile[i] = NULL;
-                       u.u_pofile[i] &= ~EXCLOSE;
-               }
-       }
-       /*
-        * Remember file name for accounting.
-        */
-       u.u_acflag &= ~AFORK;
-       bcopy((caddr_t)u.u_dbuf, (caddr_t)u.u_comm, DIRSIZ);
-}
-
-/*
- * exit system call:
- * pass back caller's arg
- */
-rexit()
-{
-       register struct a {
-               int     rval;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       exit((uap->rval & 0377) << 8);
-}
-
-/*
- * Release resources.
- * Save u. area for parent to look at.
- * Enter zombie state.
- * Wake up parent and init processes,
- * and dispose of children.
- */
-exit(rv)
-{
-       register int i;
-       register struct proc *p, *q;
-       register struct file *f;
-
-       p = u.u_procp;
-       p->p_flag &= ~(STRC|SULOCK);
-       p->p_clktim = 0;
-       for(i=0; i<NSIG; i++)
-               u.u_signal[i] = 1;
-       for(i=0; i<NOFILE; i++) {
-               f = u.u_ofile[i];
-               u.u_ofile[i] = NULL;
-               closef(f);
-       }
-       plock(u.u_cdir);
-       iput(u.u_cdir);
-       if (u.u_rdir) {
-               plock(u.u_rdir);
-               iput(u.u_rdir);
-       }
-       xfree();
-       acct();
-       mfree(coremap, p->p_size, p->p_addr);
-       p->p_stat = SZOMB;
-       ((struct xproc *)p)->xp_xstat = rv;
-       ((struct xproc *)p)->xp_utime = u.u_cutime + u.u_utime;
-       ((struct xproc *)p)->xp_stime = u.u_cstime + u.u_stime;
-       for(q = &proc[0]; q < &proc[NPROC]; q++)
-               if(q->p_ppid == p->p_pid) {
-                       wakeup((caddr_t)&proc[1]);
-                       q->p_ppid = 1;
-                       if (q->p_stat==SSTOP)
-                               setrun(q);
-               }
-       for(q = &proc[0]; q < &proc[NPROC]; q++)
-               if(p->p_ppid == q->p_pid) {
-                       wakeup((caddr_t)q);
-                       swtch();
-                       /* no return */
-               }
-       swtch();
-}
-
-/*
- * Wait system call.
- * Search for a terminated (zombie) child,
- * finally lay it to rest, and collect its status.
- * Look also for stopped (traced) children,
- * and pass back status from them.
- */
-wait()
-{
-       register f;
-       register struct proc *p;
-
-       f = 0;
-
-loop:
-       for(p = &proc[0]; p < &proc[NPROC]; p++)
-       if(p->p_ppid == u.u_procp->p_pid) {
-               f++;
-               if(p->p_stat == SZOMB) {
-                       u.u_r.r_val1 = p->p_pid;
-                       u.u_r.r_val2 = ((struct xproc *)p)->xp_xstat;
-                       u.u_cutime += ((struct xproc *)p)->xp_utime;
-                       u.u_cstime += ((struct xproc *)p)->xp_stime;
-                       p->p_pid = 0;
-                       p->p_ppid = 0;
-                       p->p_pgrp = 0;
-                       p->p_sig = 0;
-                       p->p_flag = 0;
-                       p->p_wchan = 0;
-                       p->p_stat = NULL;
-                       return;
-               }
-               if(p->p_stat == SSTOP) {
-                       if((p->p_flag&SWTED) == 0) {
-                               p->p_flag |= SWTED;
-                               u.u_r.r_val1 = p->p_pid;
-                               u.u_r.r_val2 = (fsig(p)<<8) | 0177;
-                               return;
-                       }
-                       continue;
-               }
-       }
-       if(f) {
-               sleep((caddr_t)u.u_procp, PWAIT);
-               goto loop;
-       }
-       u.u_error = ECHILD;
-}
-
-/*
- * fork system call.
- */
-fork()
-{
-       register struct proc *p1, *p2;
-       register a;
-
-       /*
-        * Make sure there's enough swap space for max
-        * core image, thus reducing chances of running out
-        */
-       if ((a = malloc(swapmap, ctod(MAXMEM))) == 0) {
-               u.u_error = ENOMEM;
-               goto out;
-       }
-       mfree(swapmap, ctod(MAXMEM), a);
-       a = 0;
-       p2 = NULL;
-       for(p1 = &proc[0]; p1 < &proc[NPROC]; p1++) {
-               if (p1->p_stat==NULL && p2==NULL)
-                       p2 = p1;
-               else {
-                       if (p1->p_uid==u.u_uid && p1->p_stat!=NULL)
-                               a++;
-               }
-       }
-       /*
-        * Disallow if
-        *  No processes at all;
-        *  not su and too many procs owned; or
-        *  not su and would take last slot.
-        */
-       if (p2==NULL || (u.u_uid!=0 && (p2==&proc[NPROC-1] || a>MAXUPRC))) {
-               u.u_error = EAGAIN;
-               goto out;
-       }
-       p1 = u.u_procp;
-       if(newproc()) {
-               u.u_r.r_val1 = p1->p_pid;
-               u.u_start = time;
-               u.u_cstime = 0;
-               u.u_stime = 0;
-               u.u_cutime = 0;
-               u.u_utime = 0;
-               u.u_acflag = AFORK;
-               return;
-       }
-       u.u_r.r_val1 = p2->p_pid;
-
-out:
-       u.u_ar0[R7] += NBPW;
-}
-
-/*
- * break system call.
- *  -- bad planning: "break" is a dirty word in C.
- */
-sbreak()
-{
-       struct a {
-               char    *nsiz;
-       };
-       register a, n, d;
-       int i;
-
-       /*
-        * set n to new data size
-        * set d to new-old
-        * set n to new total size
-        */
-
-       n = btoc((int)((struct a *)u.u_ap)->nsiz);
-       if(!u.u_sep)
-               n -= ctos(u.u_tsize) * stoc(1);
-       if(n < 0)
-               n = 0;
-       d = n - u.u_dsize;
-       n += USIZE+u.u_ssize;
-       if(estabur(u.u_tsize, u.u_dsize+d, u.u_ssize, u.u_sep, RO))
-               return;
-       u.u_dsize += d;
-       if(d > 0)
-               goto bigger;
-       a = u.u_procp->p_addr + n - u.u_ssize;
-       i = n;
-       n = u.u_ssize;
-       while(n--) {
-               copyseg(a-d, a);
-               a++;
-       }
-       expand(i);
-       return;
-
-bigger:
-       expand(n);
-       a = u.u_procp->p_addr + n;
-       n = u.u_ssize;
-       while(n--) {
-               a--;
-               copyseg(a-d, a);
-       }
-       while(d--)
-               clearseg(--a);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/sys2.c b/.ref-Research-V7/usr/sys/sys/sys2.c
deleted file mode 100644 (file)
index 79d1de7..0000000
+++ /dev/null
@@ -1,316 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/reg.h"
-#include "../h/file.h"
-#include "../h/inode.h"
-
-/*
- * read system call
- */
-read()
-{
-       rdwr(FREAD);
-}
-
-/*
- * write system call
- */
-write()
-{
-       rdwr(FWRITE);
-}
-
-/*
- * common code for read and write calls:
- * check permissions, set base, count, and offset,
- * and switch out to readi, writei, or pipe code.
- */
-rdwr(mode)
-register mode;
-{
-       register struct file *fp;
-       register struct inode *ip;
-       register struct a {
-               int     fdes;
-               char    *cbuf;
-               unsigned count;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       fp = getf(uap->fdes);
-       if(fp == NULL)
-               return;
-       if((fp->f_flag&mode) == 0) {
-               u.u_error = EBADF;
-               return;
-       }
-       u.u_base = (caddr_t)uap->cbuf;
-       u.u_count = uap->count;
-       u.u_segflg = 0;
-       if((fp->f_flag&FPIPE) != 0) {
-               if(mode == FREAD)
-                       readp(fp);
-               else
-                       writep(fp);
-       } else {
-               ip = fp->f_inode;
-               if (fp->f_flag&FMP)
-                       u.u_offset = 0;
-               else
-                       u.u_offset = fp->f_un.f_offset;
-               if((ip->i_mode&(IFCHR&IFBLK)) == 0)
-                       plock(ip);
-               if(mode == FREAD)
-                       readi(ip);
-               else
-                       writei(ip);
-               if((ip->i_mode&(IFCHR&IFBLK)) == 0)
-                       prele(ip);
-               if ((fp->f_flag&FMP) == 0)
-                       fp->f_un.f_offset += uap->count-u.u_count;
-       }
-       u.u_r.r_val1 = uap->count-u.u_count;
-}
-
-/*
- * open system call
- */
-open()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               int     rwmode;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return;
-       open1(ip, ++uap->rwmode, 0);
-}
-
-/*
- * creat system call
- */
-creat()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               int     fmode;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       ip = namei(uchar, 1);
-       if(ip == NULL) {
-               if(u.u_error)
-                       return;
-               ip = maknode(uap->fmode&07777&(~ISVTX));
-               if (ip==NULL)
-                       return;
-               open1(ip, FWRITE, 2);
-       } else
-               open1(ip, FWRITE, 1);
-}
-
-/*
- * common code for open and creat.
- * Check permissions, allocate an open file structure,
- * and call the device open routine if any.
- */
-open1(ip, mode, trf)
-register struct inode *ip;
-register mode;
-{
-       register struct file *fp;
-       int i;
-
-       if(trf != 2) {
-               if(mode&FREAD)
-                       access(ip, IREAD);
-               if(mode&FWRITE) {
-                       access(ip, IWRITE);
-                       if((ip->i_mode&IFMT) == IFDIR)
-                               u.u_error = EISDIR;
-               }
-       }
-       if(u.u_error)
-               goto out;
-       if(trf == 1)
-               itrunc(ip);
-       prele(ip);
-       if ((fp = falloc()) == NULL)
-               goto out;
-       fp->f_flag = mode&(FREAD|FWRITE);
-       fp->f_inode = ip;
-       i = u.u_r.r_val1;
-       openi(ip, mode&FWRITE);
-       if(u.u_error == 0)
-               return;
-       u.u_ofile[i] = NULL;
-       fp->f_count--;
-
-out:
-       iput(ip);
-}
-
-/*
- * close system call
- */
-close()
-{
-       register struct file *fp;
-       register struct a {
-               int     fdes;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       fp = getf(uap->fdes);
-       if(fp == NULL)
-               return;
-       u.u_ofile[uap->fdes] = NULL;
-       closef(fp);
-}
-
-/*
- * seek system call
- */
-seek()
-{
-       register struct file *fp;
-       register struct a {
-               int     fdes;
-               off_t   off;
-               int     sbase;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       fp = getf(uap->fdes);
-       if(fp == NULL)
-               return;
-       if(fp->f_flag&(FPIPE|FMP)) {
-               u.u_error = ESPIPE;
-               return;
-       }
-       if(uap->sbase == 1)
-               uap->off += fp->f_un.f_offset;
-       else if(uap->sbase == 2)
-               uap->off += fp->f_inode->i_size;
-       fp->f_un.f_offset = uap->off;
-       u.u_r.r_off = uap->off;
-}
-
-/*
- * link system call
- */
-link()
-{
-       register struct inode *ip, *xp;
-       register struct a {
-               char    *target;
-               char    *linkname;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return;
-       if((ip->i_mode&IFMT)==IFDIR && !suser())
-               goto out;
-       /*
-        * Unlock to avoid possibly hanging the namei.
-        * Sadly, this means races. (Suppose someone
-        * deletes the file in the meantime?)
-        * Nor can it be locked again later
-        * because then there will be deadly
-        * embraces.
-        */
-       prele(ip);
-       u.u_dirp = (caddr_t)uap->linkname;
-       xp = namei(uchar, 1);
-       if(xp != NULL) {
-               u.u_error = EEXIST;
-               iput(xp);
-               goto out;
-       }
-       if (u.u_error)
-               goto out;
-       if(u.u_pdir->i_dev != ip->i_dev) {
-               iput(u.u_pdir);
-               u.u_error = EXDEV;
-               goto out;
-       }
-       wdir(ip);
-       if (u.u_error==0) {
-               ip->i_nlink++;
-               ip->i_flag |= ICHG;
-       }
-
-out:
-       iput(ip);
-}
-
-/*
- * mknod system call
- */
-mknod()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               int     fmode;
-               int     dev;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if(suser()) {
-               ip = namei(uchar, 1);
-               if(ip != NULL) {
-                       u.u_error = EEXIST;
-                       goto out;
-               }
-       }
-       if(u.u_error)
-               return;
-       ip = maknode(uap->fmode);
-       if (ip == NULL)
-               return;
-       ip->i_un.i_rdev = (dev_t)uap->dev;
-
-out:
-       iput(ip);
-}
-
-/*
- * access system call
- */
-saccess()
-{
-       register svuid, svgid;
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               int     fmode;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       svuid = u.u_uid;
-       svgid = u.u_gid;
-       u.u_uid = u.u_ruid;
-       u.u_gid = u.u_rgid;
-       ip = namei(uchar, 0);
-       if (ip != NULL) {
-               if (uap->fmode&(IREAD>>6))
-                       access(ip, IREAD);
-               if (uap->fmode&(IWRITE>>6))
-                       access(ip, IWRITE);
-               if (uap->fmode&(IEXEC>>6))
-                       access(ip, IEXEC);
-               iput(ip);
-       }
-       u.u_uid = svuid;
-       u.u_gid = svgid;
-}
diff --git a/.ref-Research-V7/usr/sys/sys/sys3.c b/.ref-Research-V7/usr/sys/sys/sys3.c
deleted file mode 100644 (file)
index 1523d25..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/mount.h"
-#include "../h/ino.h"
-#include "../h/reg.h"
-#include "../h/buf.h"
-#include "../h/filsys.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/inode.h"
-#include "../h/file.h"
-#include "../h/conf.h"
-#include "../h/stat.h"
-
-/*
- * the fstat system call.
- */
-fstat()
-{
-       register struct file *fp;
-       register struct a {
-               int     fdes;
-               struct stat *sb;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       fp = getf(uap->fdes);
-       if(fp == NULL)
-               return;
-       stat1(fp->f_inode, uap->sb, fp->f_flag&FPIPE? fp->f_un.f_offset: 0);
-}
-
-/*
- * the stat system call.
- */
-stat()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               struct stat *sb;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return;
-       stat1(ip, uap->sb, (off_t)0);
-       iput(ip);
-}
-
-/*
- * The basic routine for fstat and stat:
- * get the inode and pass appropriate parts back.
- */
-stat1(ip, ub, pipeadj)
-register struct inode *ip;
-struct stat *ub;
-off_t pipeadj;
-{
-       register struct dinode *dp;
-       register struct buf *bp;
-       struct stat ds;
-
-       iupdat(ip, &time, &time);
-       /*
-        * first copy from inode table
-        */
-       ds.st_dev = ip->i_dev;
-       ds.st_ino = ip->i_number;
-       ds.st_mode = ip->i_mode;
-       ds.st_nlink = ip->i_nlink;
-       ds.st_uid = ip->i_uid;
-       ds.st_gid = ip->i_gid;
-       ds.st_rdev = (dev_t)ip->i_un.i_rdev;
-       ds.st_size = ip->i_size - pipeadj;
-       /*
-        * next the dates in the disk
-        */
-       bp = bread(ip->i_dev, itod(ip->i_number));
-       dp = bp->b_un.b_dino;
-       dp += itoo(ip->i_number);
-       ds.st_atime = dp->di_atime;
-       ds.st_mtime = dp->di_mtime;
-       ds.st_ctime = dp->di_ctime;
-       brelse(bp);
-       if (copyout((caddr_t)&ds, (caddr_t)ub, sizeof(ds)) < 0)
-               u.u_error = EFAULT;
-}
-
-/*
- * the dup system call.
- */
-dup()
-{
-       register struct file *fp;
-       register struct a {
-               int     fdes;
-               int     fdes2;
-       } *uap;
-       register i, m;
-
-       uap = (struct a *)u.u_ap;
-       m = uap->fdes & ~077;
-       uap->fdes &= 077;
-       fp = getf(uap->fdes);
-       if(fp == NULL)
-               return;
-       if ((m&0100) == 0) {
-               if ((i = ufalloc()) < 0)
-                       return;
-       } else {
-               i = uap->fdes2;
-               if (i<0 || i>=NOFILE) {
-                       u.u_error = EBADF;
-                       return;
-               }
-               u.u_r.r_val1 = i;
-       }
-       if (i!=uap->fdes) {
-               if (u.u_ofile[i]!=NULL)
-                       closef(u.u_ofile[i]);
-               u.u_ofile[i] = fp;
-               fp->f_count++;
-       }
-}
-
-/*
- * the mount system call.
- */
-smount()
-{
-       dev_t dev;
-       register struct inode *ip;
-       register struct mount *mp;
-       struct mount *smp;
-       register struct filsys *fp;
-       struct buf *bp;
-       register struct a {
-               char    *fspec;
-               char    *freg;
-               int     ronly;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       dev = getmdev();
-       if(u.u_error)
-               return;
-       u.u_dirp = (caddr_t)uap->freg;
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return;
-       if(ip->i_count!=1 || (ip->i_mode&(IFBLK&IFCHR))!=0)
-               goto out;
-       smp = NULL;
-       for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++) {
-               if(mp->m_bufp != NULL) {
-                       if(dev == mp->m_dev)
-                               goto out;
-               } else
-               if(smp == NULL)
-                       smp = mp;
-       }
-       mp = smp;
-       if(mp == NULL)
-               goto out;
-       (*bdevsw[major(dev)].d_open)(dev, !uap->ronly);
-       if(u.u_error)
-               goto out;
-       bp = bread(dev, SUPERB);
-       if(u.u_error) {
-               brelse(bp);
-               goto out1;
-       }
-       mp->m_inodp = ip;
-       mp->m_dev = dev;
-       mp->m_bufp = geteblk();
-       bcopy((caddr_t)bp->b_un.b_addr, mp->m_bufp->b_un.b_addr, BSIZE);
-       fp = mp->m_bufp->b_un.b_filsys;
-       fp->s_ilock = 0;
-       fp->s_flock = 0;
-       fp->s_ronly = uap->ronly & 1;
-       brelse(bp);
-       ip->i_flag |= IMOUNT;
-       prele(ip);
-       return;
-
-out:
-       u.u_error = EBUSY;
-out1:
-       iput(ip);
-}
-
-/*
- * the umount system call.
- */
-sumount()
-{
-       dev_t dev;
-       register struct inode *ip;
-       register struct mount *mp;
-       struct buf *bp;
-       register struct a {
-               char    *fspec;
-       };
-
-       dev = getmdev();
-       if(u.u_error)
-               return;
-       xumount(dev);   /* remove unused sticky files from text table */
-       update();
-       for(mp = &mount[0]; mp < &mount[NMOUNT]; mp++)
-               if(mp->m_bufp != NULL && dev == mp->m_dev)
-                       goto found;
-       u.u_error = EINVAL;
-       return;
-
-found:
-       for(ip = &inode[0]; ip < &inode[NINODE]; ip++)
-               if(ip->i_number != 0 && dev == ip->i_dev) {
-                       u.u_error = EBUSY;
-                       return;
-               }
-       (*bdevsw[major(dev)].d_close)(dev, 0);
-       ip = mp->m_inodp;
-       ip->i_flag &= ~IMOUNT;
-       plock(ip);
-       iput(ip);
-       bp = mp->m_bufp;
-       mp->m_bufp = NULL;
-       brelse(bp);
-}
-
-/*
- * Common code for mount and umount.
- * Check that the user's argument is a reasonable
- * thing on which to mount, and return the device number if so.
- */
-dev_t
-getmdev()
-{
-       dev_t dev;
-       register struct inode *ip;
-
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return(NODEV);
-       if((ip->i_mode&IFMT) != IFBLK)
-               u.u_error = ENOTBLK;
-       dev = (dev_t)ip->i_un.i_rdev;
-       if(major(dev) >= nblkdev)
-               u.u_error = ENXIO;
-       iput(ip);
-       return(dev);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/sys4.c b/.ref-Research-V7/usr/sys/sys/sys4.c
deleted file mode 100644 (file)
index c8fba7c..0000000
+++ /dev/null
@@ -1,422 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/reg.h"
-#include "../h/inode.h"
-#include "../h/proc.h"
-#include "../h/timeb.h"
-
-/*
- * Everything in this file is a routine implementing a system call.
- */
-
-/*
- * return the current time (old-style entry)
- */
-gtime()
-{
-       u.u_r.r_time = time;
-}
-
-/*
- * New time entry-- return TOD with milliseconds, timezone,
- * DST flag
- */
-ftime()
-{
-       register struct a {
-               struct  timeb   *tp;
-       } *uap;
-       struct timeb t;
-       register unsigned ms;
-
-       uap = (struct a *)u.u_ap;
-       spl7();
-       t.time = time;
-       ms = lbolt;
-       spl0();
-       if (ms > HZ) {
-               ms -= HZ;
-               t.time++;
-       }
-       t.millitm = (1000*ms)/HZ;
-       t.timezone = TIMEZONE;
-       t.dstflag = DSTFLAG;
-       if (copyout((caddr_t)&t, (caddr_t)uap->tp, sizeof(t)) < 0)
-               u.u_error = EFAULT;
-}
-
-/*
- * Set the time
- */
-stime()
-{
-       register struct a {
-               time_t  time;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if(suser())
-               time = uap->time;
-}
-
-setuid()
-{
-       register uid;
-       register struct a {
-               int     uid;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       uid = uap->uid;
-       if(u.u_ruid == uid || suser()) {
-               u.u_uid = uid;
-               u.u_procp->p_uid = uid;
-               u.u_ruid = uid;
-       }
-}
-
-getuid()
-{
-
-       u.u_r.r_val1 = u.u_ruid;
-       u.u_r.r_val2 = u.u_uid;
-}
-
-setgid()
-{
-       register gid;
-       register struct a {
-               int     gid;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       gid = uap->gid;
-       if(u.u_rgid == gid || suser()) {
-               u.u_gid = gid;
-               u.u_rgid = gid;
-       }
-}
-
-getgid()
-{
-
-       u.u_r.r_val1 = u.u_rgid;
-       u.u_r.r_val2 = u.u_gid;
-}
-
-getpid()
-{
-       u.u_r.r_val1 = u.u_procp->p_pid;
-       u.u_r.r_val2 = u.u_procp->p_ppid;
-}
-
-sync()
-{
-
-       update();
-}
-
-nice()
-{
-       register n;
-       register struct a {
-               int     niceness;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       n = uap->niceness;
-       if(n < 0 && !suser())
-               n = 0;
-       n += u.u_procp->p_nice;
-       if(n >= 2*NZERO)
-               n = 2*NZERO -1;
-       if(n < 0)
-               n = 0;
-       u.u_procp->p_nice = n;
-}
-
-/*
- * Unlink system call.
- * Hard to avoid races here, especially
- * in unlinking directories.
- */
-unlink()
-{
-       register struct inode *ip, *pp;
-       struct a {
-               char    *fname;
-       };
-
-       pp = namei(uchar, 2);
-       if(pp == NULL)
-               return;
-       /*
-        * Check for unlink(".")
-        * to avoid hanging on the iget
-        */
-       if (pp->i_number == u.u_dent.d_ino) {
-               ip = pp;
-               ip->i_count++;
-       } else
-               ip = iget(pp->i_dev, u.u_dent.d_ino);
-       if(ip == NULL)
-               goto out1;
-       if((ip->i_mode&IFMT)==IFDIR && !suser())
-               goto out;
-       /*
-        * Don't unlink a mounted file.
-        */
-       if (ip->i_dev != pp->i_dev) {
-               u.u_error = EBUSY;
-               goto out;
-       }
-       if (ip->i_flag&ITEXT)
-               xrele(ip);      /* try once to free text */
-       if (ip->i_flag&ITEXT && ip->i_nlink==1) {
-               u.u_error = ETXTBSY;
-               goto out;
-       }
-       u.u_offset -= sizeof(struct direct);
-       u.u_base = (caddr_t)&u.u_dent;
-       u.u_count = sizeof(struct direct);
-       u.u_dent.d_ino = 0;
-       writei(pp);
-       ip->i_nlink--;
-       ip->i_flag |= ICHG;
-
-out:
-       iput(ip);
-out1:
-       iput(pp);
-}
-chdir()
-{
-       chdirec(&u.u_cdir);
-}
-
-chroot()
-{
-       if (suser())
-               chdirec(&u.u_rdir);
-}
-
-chdirec(ipp)
-register struct inode **ipp;
-{
-       register struct inode *ip;
-       struct a {
-               char    *fname;
-       };
-
-       ip = namei(uchar, 0);
-       if(ip == NULL)
-               return;
-       if((ip->i_mode&IFMT) != IFDIR) {
-               u.u_error = ENOTDIR;
-               goto bad;
-       }
-       if(access(ip, IEXEC))
-               goto bad;
-       prele(ip);
-       if (*ipp) {
-               plock(*ipp);
-               iput(*ipp);
-       }
-       *ipp = ip;
-       return;
-
-bad:
-       iput(ip);
-}
-
-chmod()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               int     fmode;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if ((ip = owner()) == NULL)
-               return;
-       ip->i_mode &= ~07777;
-       if (u.u_uid)
-               uap->fmode &= ~ISVTX;
-       ip->i_mode |= uap->fmode&07777;
-       ip->i_flag |= ICHG;
-       if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0)
-               xrele(ip);
-       iput(ip);
-}
-
-chown()
-{
-       register struct inode *ip;
-       register struct a {
-               char    *fname;
-               int     uid;
-               int     gid;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if (!suser() || (ip = owner()) == NULL)
-               return;
-       ip->i_uid = uap->uid;
-       ip->i_gid = uap->gid;
-       ip->i_flag |= ICHG;
-       iput(ip);
-}
-
-ssig()
-{
-       register a;
-       struct a {
-               int     signo;
-               int     fun;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       a = uap->signo;
-       if(a<=0 || a>=NSIG || a==SIGKIL) {
-               u.u_error = EINVAL;
-               return;
-       }
-       u.u_r.r_val1 = u.u_signal[a];
-       u.u_signal[a] = uap->fun;
-       u.u_procp->p_sig &= ~(1<<(a-1));
-}
-
-kill()
-{
-       register struct proc *p, *q;
-       register a;
-       register struct a {
-               int     pid;
-               int     signo;
-       } *uap;
-       int f, priv;
-
-       uap = (struct a *)u.u_ap;
-       f = 0;
-       a = uap->pid;
-       priv = 0;
-       if (a==-1 && u.u_uid==0) {
-               priv++;
-               a = 0;
-       }
-       q = u.u_procp;
-       for(p = &proc[0]; p < &proc[NPROC]; p++) {
-               if(p->p_stat == NULL)
-                       continue;
-               if(a != 0 && p->p_pid != a)
-                       continue;
-               if(a==0 && ((p->p_pgrp!=q->p_pgrp&&priv==0) || p<=&proc[1]))
-                       continue;
-               if(u.u_uid != 0 && u.u_uid != p->p_uid)
-                       continue;
-               f++;
-               psignal(p, uap->signo);
-       }
-       if(f == 0)
-               u.u_error = ESRCH;
-}
-
-times()
-{
-       register struct a {
-               time_t  (*times)[4];
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       if (copyout((caddr_t)&u.u_utime, (caddr_t)uap->times, sizeof(*uap->times)) < 0)
-               u.u_error = EFAULT;
-}
-
-profil()
-{
-       register struct a {
-               short   *bufbase;
-               unsigned bufsize;
-               unsigned pcoffset;
-               unsigned pcscale;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       u.u_prof.pr_base = uap->bufbase;
-       u.u_prof.pr_size = uap->bufsize;
-       u.u_prof.pr_off = uap->pcoffset;
-       u.u_prof.pr_scale = uap->pcscale;
-}
-
-/*
- * alarm clock signal
- */
-alarm()
-{
-       register struct proc *p;
-       register c;
-       register struct a {
-               int     deltat;
-       } *uap;
-
-       uap = (struct a *)u.u_ap;
-       p = u.u_procp;
-       c = p->p_clktim;
-       p->p_clktim = uap->deltat;
-       u.u_r.r_val1 = c;
-}
-
-/*
- * indefinite wait.
- * no one should wakeup(&u)
- */
-pause()
-{
-
-       for(;;)
-               sleep((caddr_t)&u, PSLEP);
-}
-
-/*
- * mode mask for creation of files
- */
-umask()
-{
-       register struct a {
-               int     mask;
-       } *uap;
-       register t;
-
-       uap = (struct a *)u.u_ap;
-       t = u.u_cmask;
-       u.u_cmask = uap->mask & 0777;
-       u.u_r.r_val1 = t;
-}
-
-/*
- * Set IUPD and IACC times on file.
- * Can't set ICHG.
- */
-utime()
-{
-       register struct a {
-               char    *fname;
-               time_t  *tptr;
-       } *uap;
-       register struct inode *ip;
-       time_t tv[2];
-
-       uap = (struct a *)u.u_ap;
-       if ((ip = owner()) == NULL)
-               return;
-       if (copyin((caddr_t)uap->tptr, (caddr_t)tv, sizeof(tv))) {
-               u.u_error = EFAULT;
-               return;
-       }
-       ip->i_flag |= IACC|IUPD|ICHG;
-       iupdat(ip, &tv[0], &tv[1]);
-       iput(ip);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/sysent.c b/.ref-Research-V7/usr/sys/sys/sysent.c
deleted file mode 100644 (file)
index 81ca2d6..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-
-/*
- * This table is the switch used to transfer
- * to the appropriate routine for processing a system call.
- * Each row contains the number of arguments expected
- * and a pointer to the routine.
- */
-int    alarm();
-int    mpxchan();
-int    chdir();
-int    chmod();
-int    chown();
-int    chroot();
-int    close();
-int    creat();
-int    dup();
-int    exec();
-int    exece();
-int    fork();
-int    fstat();
-int    getgid();
-int    getpid();
-int    getuid();
-int    gtime();
-int    gtty();
-int    ioctl();
-int    kill();
-int    link();
-int    mknod();
-int    nice();
-int    nosys();
-int    nullsys();
-int    open();
-int    pause();
-int    pipe();
-int    profil();
-int    ptrace();
-int    read();
-int    rexit();
-int    saccess();
-int    sbreak();
-int    seek();
-int    setgid();
-int    setuid();
-int    smount();
-int    ssig();
-int    stat();
-int    stime();
-int    stty();
-int    sumount();
-int    ftime();
-int    sync();
-int    sysacct();
-int    syslock();
-int    sysphys();
-int    times();
-int    umask();
-int    unlink();
-int    utime();
-int    wait();
-int    write();
-
-struct sysent sysent[64] =
-{
-       0, 0, nullsys,                  /*  0 = indir */
-       1, 1, rexit,                    /*  1 = exit */
-       0, 0, fork,                     /*  2 = fork */
-       3, 1, read,                     /*  3 = read */
-       3, 1, write,                    /*  4 = write */
-       2, 0, open,                     /*  5 = open */
-       1, 1, close,                    /*  6 = close */
-       0, 0, wait,                     /*  7 = wait */
-       2, 0, creat,                    /*  8 = creat */
-       2, 0, link,                     /*  9 = link */
-       1, 0, unlink,                   /* 10 = unlink */
-       2, 0, exec,                     /* 11 = exec */
-       1, 0, chdir,                    /* 12 = chdir */
-       0, 0, gtime,                    /* 13 = time */
-       3, 0, mknod,                    /* 14 = mknod */
-       2, 0, chmod,                    /* 15 = chmod */
-       3, 0, chown,                    /* 16 = chown; now 3 args */
-       1, 0, sbreak,                   /* 17 = break */
-       2, 0, stat,                     /* 18 = stat */
-       4, 1, seek,                     /* 19 = seek; now 3 args */
-       0, 0, getpid,                   /* 20 = getpid */
-       3, 0, smount,                   /* 21 = mount */
-       1, 0, sumount,                  /* 22 = umount */
-       1, 1, setuid,                   /* 23 = setuid */
-       0, 0, getuid,                   /* 24 = getuid */
-       2, 2, stime,                    /* 25 = stime */
-       4, 1, ptrace,                   /* 26 = ptrace */
-       1, 1, alarm,                    /* 27 = alarm */
-       2, 1, fstat,                    /* 28 = fstat */
-       0, 0, pause,                    /* 29 = pause */
-       2, 0, utime,                    /* 30 = utime */
-       2, 1, stty,                     /* 31 = stty */
-       2, 1, gtty,                     /* 32 = gtty */
-       2, 0, saccess,                  /* 33 = access */
-       1, 1, nice,                     /* 34 = nice */
-       1, 0, ftime,                    /* 35 = ftime; formerly sleep */
-       0, 0, sync,                     /* 36 = sync */
-       2, 1, kill,                     /* 37 = kill */
-       0, 0, nullsys,                  /* 38 = switch; inoperative */
-       0, 0, nullsys,                  /* 39 = setpgrp (not in yet) */
-       1, 1, nosys,                    /* 40 = tell (obsolete) */
-       2, 2, dup,                      /* 41 = dup */
-       0, 0, pipe,                     /* 42 = pipe */
-       1, 0, times,                    /* 43 = times */
-       4, 0, profil,                   /* 44 = prof */
-       0, 0, nosys,                    /* 45 = unused */
-       1, 1, setgid,                   /* 46 = setgid */
-       0, 0, getgid,                   /* 47 = getgid */
-       2, 0, ssig,                     /* 48 = sig */
-       0, 0, nosys,                    /* 49 = reserved for USG */
-       0, 0, nosys,                    /* 50 = reserved for USG */
-       1, 0, sysacct,                  /* 51 = turn acct off/on */
-       3, 0, sysphys,                  /* 52 = set user physical addresses */
-       1, 0, syslock,                  /* 53 = lock user in core */
-       3, 0, ioctl,                    /* 54 = ioctl */
-       0, 0, nosys,                    /* 55 = readwrite (in abeyance) */
-       4, 0, mpxchan,                  /* 56 = creat mpx comm channel */
-       0, 0, nosys,                    /* 57 = reserved for USG */
-       0, 0, nosys,                    /* 58 = reserved for USG */
-       3, 0, exece,                    /* 59 = exece */
-       1, 0, umask,                    /* 60 = umask */
-       1, 0, chroot,                   /* 61 = chroot */
-       0, 0, nosys,                    /* 62 = x */
-       0, 0, nosys                     /* 63 = used internally */
-};
diff --git a/.ref-Research-V7/usr/sys/sys/text.c b/.ref-Research-V7/usr/sys/sys/text.c
deleted file mode 100644 (file)
index 30540bb..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/map.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/text.h"
-#include "../h/inode.h"
-#include "../h/buf.h"
-#include "../h/seg.h"
-
-/*
- * Swap out process p.
- * The ff flag causes its core to be freed--
- * it may be off when called to create an image for a
- * child process in newproc.
- * Os is the old size of the data area of the process,
- * and is supplied during core expansion swaps.
- *
- * panic: out of swap space
- */
-xswap(p, ff, os)
-register struct proc *p;
-{
-       register a;
-
-       if(os == 0)
-               os = p->p_size;
-       a = malloc(swapmap, ctod(p->p_size));
-       if(a == NULL)
-               panic("out of swap space");
-       p->p_flag |= SLOCK;
-       xccdec(p->p_textp);
-       swap(a, p->p_addr, os, B_WRITE);
-       if(ff)
-               mfree(coremap, os, p->p_addr);
-       p->p_addr = a;
-       p->p_flag &= ~(SLOAD|SLOCK);
-       p->p_time = 0;
-       if(runout) {
-               runout = 0;
-               wakeup((caddr_t)&runout);
-       }
-}
-
-/*
- * relinquish use of the shared text segment
- * of a process.
- */
-xfree()
-{
-       register struct text *xp;
-       register struct inode *ip;
-
-       if((xp=u.u_procp->p_textp) == NULL)
-               return;
-       xlock(xp);
-       xp->x_flag &= ~XLOCK;
-       u.u_procp->p_textp = NULL;
-       ip = xp->x_iptr;
-       if(--xp->x_count==0 && (ip->i_mode&ISVTX)==0) {
-               xp->x_iptr = NULL;
-               mfree(swapmap, ctod(xp->x_size), xp->x_daddr);
-               mfree(coremap, xp->x_size, xp->x_caddr);
-               ip->i_flag &= ~ITEXT;
-               if (ip->i_flag&ILOCK)
-                       ip->i_count--;
-               else
-                       iput(ip);
-       } else
-               xccdec(xp);
-}
-
-/*
- * Attach to a shared text segment.
- * If there is no shared text, just return.
- * If there is, hook up to it:
- * if it is not currently being used, it has to be read
- * in from the inode (ip); the written bit is set to force it
- * to be written out as appropriate.
- * If it is being used, but is not currently in core,
- * a swap has to be done to get it back.
- */
-xalloc(ip)
-register struct inode *ip;
-{
-       register struct text *xp;
-       register unsigned ts;
-       register struct text *xp1;
-
-       if(u.u_exdata.ux_tsize == 0)
-               return;
-       xp1 = NULL;
-       for (xp = &text[0]; xp < &text[NTEXT]; xp++) {
-               if(xp->x_iptr == NULL) {
-                       if(xp1 == NULL)
-                               xp1 = xp;
-                       continue;
-               }
-               if(xp->x_iptr == ip) {
-                       xlock(xp);
-                       xp->x_count++;
-                       u.u_procp->p_textp = xp;
-                       if (xp->x_ccount == 0)
-                               xexpand(xp);
-                       else
-                               xp->x_ccount++;
-                       xunlock(xp);
-                       return;
-               }
-       }
-       if((xp=xp1) == NULL) {
-               printf("out of text");
-               psignal(u.u_procp, SIGKIL);
-               return;
-       }
-       xp->x_flag = XLOAD|XLOCK;
-       xp->x_count = 1;
-       xp->x_ccount = 0;
-       xp->x_iptr = ip;
-       ip->i_flag |= ITEXT;
-       ip->i_count++;
-       ts = btoc(u.u_exdata.ux_tsize);
-       xp->x_size = ts;
-       if((xp->x_daddr = malloc(swapmap, (int)ctod(ts))) == NULL)
-               panic("out of swap space");
-       u.u_procp->p_textp = xp;
-       xexpand(xp);
-       estabur(ts, (unsigned)0, (unsigned)0, 0, RW);
-       u.u_count = u.u_exdata.ux_tsize;
-       u.u_offset = sizeof(u.u_exdata);
-       u.u_base = 0;
-       u.u_segflg = 2;
-       u.u_procp->p_flag |= SLOCK;
-       readi(ip);
-       u.u_procp->p_flag &= ~SLOCK;
-       u.u_segflg = 0;
-       xp->x_flag = XWRIT;
-}
-
-/*
- * Assure core for text segment
- * Text must be locked to keep someone else from
- * freeing it in the meantime.
- * x_ccount must be 0.
- */
-xexpand(xp)
-register struct text *xp;
-{
-       if ((xp->x_caddr = malloc(coremap, xp->x_size)) != NULL) {
-               if ((xp->x_flag&XLOAD)==0)
-                       swap(xp->x_daddr, xp->x_caddr, xp->x_size, B_READ);
-               xp->x_ccount++;
-               xunlock(xp);
-               return;
-       }
-       if (save(u.u_ssav)) {
-               sureg();
-               return;
-       }
-       xswap(u.u_procp, 1, 0);
-       xunlock(xp);
-       u.u_procp->p_flag |= SSWAP;
-       qswtch();
-       /* no return */
-}
-
-/*
- * Lock and unlock a text segment from swapping
- */
-xlock(xp)
-register struct text *xp;
-{
-
-       while(xp->x_flag&XLOCK) {
-               xp->x_flag |= XWANT;
-               sleep((caddr_t)xp, PSWP);
-       }
-       xp->x_flag |= XLOCK;
-}
-
-xunlock(xp)
-register struct text *xp;
-{
-
-       if (xp->x_flag&XWANT)
-               wakeup((caddr_t)xp);
-       xp->x_flag &= ~(XLOCK|XWANT);
-}
-
-/*
- * Decrement the in-core usage count of a shared text segment.
- * When it drops to zero, free the core space.
- */
-xccdec(xp)
-register struct text *xp;
-{
-
-       if (xp==NULL || xp->x_ccount==0)
-               return;
-       xlock(xp);
-       if (--xp->x_ccount==0) {
-               if (xp->x_flag&XWRIT) {
-                       xp->x_flag &= ~XWRIT;
-                       swap(xp->x_daddr,xp->x_caddr,xp->x_size,B_WRITE);
-               }
-               mfree(coremap, xp->x_size, xp->x_caddr);
-       }
-       xunlock(xp);
-}
-
-/*
- * free the swap image of all unused saved-text text segments
- * which are from device dev (used by umount system call).
- */
-xumount(dev)
-register dev;
-{
-       register struct text *xp;
-
-       for (xp = &text[0]; xp < &text[NTEXT]; xp++) 
-               if (xp->x_iptr!=NULL && dev==xp->x_iptr->i_dev)
-                       xuntext(xp);
-}
-
-/*
- * remove a shared text segment from the text table, if possible.
- */
-xrele(ip)
-register struct inode *ip;
-{
-       register struct text *xp;
-
-       if (ip->i_flag&ITEXT==0)
-               return;
-       for (xp = &text[0]; xp < &text[NTEXT]; xp++)
-               if (ip==xp->x_iptr)
-                       xuntext(xp);
-}
-
-/*
- * remove text image from the text table.
- * the use count must be zero.
- */
-xuntext(xp)
-register struct text *xp;
-{
-       register struct inode *ip;
-
-       xlock(xp);
-       if (xp->x_count) {
-               xunlock(xp);
-               return;
-       }
-       ip = xp->x_iptr;
-       xp->x_flag &= ~XLOCK;
-       xp->x_iptr = NULL;
-       mfree(swapmap, ctod(xp->x_size), xp->x_daddr);
-       ip->i_flag &= ~ITEXT;
-       if (ip->i_flag&ILOCK)
-               ip->i_count--;
-       else
-               iput(ip);
-}
diff --git a/.ref-Research-V7/usr/sys/sys/trap.c b/.ref-Research-V7/usr/sys/sys/trap.c
deleted file mode 100644 (file)
index b29229d..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/reg.h"
-#include "../h/seg.h"
-
-#define        EBIT    1               /* user error bit in PS: C-bit */
-#define        SETD    0170011         /* SETD instruction */
-#define        SYS     0104400         /* sys (trap) instruction */
-#define        USER    020             /* user-mode flag added to dev */
-#define        MEMORY  ((physadr)0177740) /* 11/70 "memory" subsystem */
-
-/*
- * Offsets of the user's registers relative to
- * the saved r0. See reg.h
- */
-char   regloc[9] =
-{
-       R0, R1, R2, R3, R4, R5, R6, R7, RPS
-};
-
-/*
- * Called from l40.s or l45.s when a processor trap occurs.
- * The arguments are the words saved on the system stack
- * by the hardware and software during the trap processing.
- * Their order is dictated by the hardware and the details
- * of C's calling sequence. They are peculiar in that
- * this call is not 'by value' and changed user registers
- * get copied back on return.
- * dev is the kind of trap that occurred.
- */
-trap(dev, sp, r1, nps, r0, pc, ps)
-int *pc;
-dev_t dev;
-{
-       register i;
-       register *a;
-       register struct sysent *callp;
-       int (*fetch)();
-       time_t syst;
-
-       syst = u.u_stime;
-       u.u_fpsaved = 0;
-       if ((ps&UMODE) == UMODE)
-               dev |= USER;
-       u.u_ar0 = &r0;
-       switch(minor(dev)) {
-
-       /*
-        * Trap not expected.
-        * Usually a kernel mode bus error.
-        * The numbers printed are used to
-        * find the hardware PS/PC as follows.
-        * (all numbers in octal 18 bits)
-        *      address_of_saved_ps =
-        *              (ka6*0100) + aps - 0140000;
-        *      address_of_saved_pc =
-        *              address_of_saved_ps - 2;
-        */
-       default:
-               printf("ka6 = %o\n", ka6->r[0]);
-               printf("aps = %o\n", &ps);
-               printf("pc = %o ps = %o\n", pc, ps);
-               printf("trap type %o\n", dev);
-               panic("trap");
-
-       case 0+USER: /* bus error */
-               i = SIGBUS;
-               break;
-
-       /*
-        * If illegal instructions are not
-        * being caught and the offending instruction
-        * is a SETD, the trap is ignored.
-        * This is because C produces a SETD at
-        * the beginning of every program which
-        * will trap on CPUs without 11/45 FPU.
-        */
-       case 1+USER: /* illegal instruction */
-               if(fuiword((caddr_t)(pc-1)) == SETD && u.u_signal[SIGINS] == 0)
-                       goto out;
-               i = SIGINS;
-               break;
-
-       case 2+USER: /* bpt or trace */
-               i = SIGTRC;
-               ps &= ~TBIT;
-               break;
-
-       case 3+USER: /* iot */
-               i = SIGIOT;
-               break;
-
-       case 5+USER: /* emt */
-               i = SIGEMT;
-               break;
-
-       case 6+USER: /* sys call */
-               u.u_error = 0;
-               ps &= ~EBIT;
-               a = pc;
-               callp = &sysent[fuiword((caddr_t)(a-1))&077];
-               if (callp == sysent) { /* indirect */
-                       a = (int *)fuiword((caddr_t)(a));
-                       pc++;
-                       i = fuword((caddr_t)a);
-                       a++;
-                       if ((i & ~077) != SYS)
-                               i = 077;        /* illegal */
-                       callp = &sysent[i&077];
-                       fetch = fuword;
-               } else {
-                       pc += callp->sy_narg - callp->sy_nrarg;
-                       fetch = fuiword;
-               }
-               for (i=0; i<callp->sy_nrarg; i++)
-                       u.u_arg[i] = u.u_ar0[regloc[i]];
-               for(; i<callp->sy_narg; i++)
-                       u.u_arg[i] = (*fetch)((caddr_t)a++);
-               u.u_dirp = (caddr_t)u.u_arg[0];
-               u.u_r.r_val1 = u.u_ar0[R0];
-               u.u_r.r_val2 = u.u_ar0[R1];
-               u.u_ap = u.u_arg;
-               if (save(u.u_qsav)) {
-                       if (u.u_error==0)
-                               u.u_error = EINTR;
-               } else {
-                       (*callp->sy_call)();
-               }
-               if(u.u_error) {
-                       ps |= EBIT;
-                       u.u_ar0[R0] = u.u_error;
-               } else {
-                       u.u_ar0[R0] = u.u_r.r_val1;
-                       u.u_ar0[R1] = u.u_r.r_val2;
-               }
-               goto out;
-
-       /*
-        * Since the floating exception is an
-        * imprecise trap, a user generated
-        * trap may actually come from kernel
-        * mode. In this case, a signal is sent
-        * to the current process to be picked
-        * up later.
-        */
-       case 8: /* floating exception */
-               stst(&u.u_fper);        /* save error code */
-               psignal(u.u_procp, SIGFPT);
-               return;
-
-       case 8+USER:
-               i = SIGFPT;
-               stst(&u.u_fper);
-               break;
-
-       /*
-        * If the user SP is below the stack segment,
-        * grow the stack automatically.
-        * This relies on the ability of the hardware
-        * to restart a half executed instruction.
-        * On the 11/40 this is not the case and
-        * the routine backup/l40.s may fail.
-        * The classic example is on the instruction
-        *      cmp     -(sp),-(sp)
-        */
-       case 9+USER: /* segmentation exception */
-       {
-       int     osp;
-
-               osp = sp;
-               if(backup(u.u_ar0) == 0)
-                       if(grow((unsigned)osp))
-                               goto out;
-               i = SIGSEG;
-               break;
-       }
-
-       /*
-        * The code here is a half-hearted
-        * attempt to do something with all
-        * of the 11/70 parity registers.
-        * In fact, there is little that
-        * can be done.
-        */
-       case 10:
-       case 10+USER:
-               printf("parity\n");
-               if(cputype == 70) {
-                       for(i=0; i<4; i++)
-                               printf("%o ", MEMORY->r[i]);
-                       printf("\n");
-                       MEMORY->r[2] = -1;
-                       if(dev & USER) {
-                               i = SIGBUS;
-                               break;
-                       }
-               }
-               panic("parity");
-
-       /*
-        * Allow process switch
-        */
-       case USER+12:
-               goto out;
-
-       /*
-        * Locations 0-2 specify this style trap, since
-        * DEC hardware often generates spurious
-        * traps through location 0.  This is a
-        * symptom of hardware problems and may
-        * represent a real interrupt that got
-        * sent to the wrong place.  Watch out
-        * for hangs on disk completion if this message appears.
-        */
-       case 15:
-       case 15+USER:
-               printf("Random interrupt ignored\n");
-               return;
-       }
-       psignal(u.u_procp, i);
-
-out:
-       if(issig()) {
-               psig();
-       }
-       curpri = setpri(u.u_procp);
-       if (runrun)
-               qswtch();
-       if(u.u_prof.pr_scale)
-               addupc((caddr_t)pc, &u.u_prof, (int)(u.u_stime-syst));
-       if (u.u_fpsaved)
-               restfp(&u.u_fps);
-}
-
-/*
- * nonexistent system call-- set fatal error code.
- */
-nosys()
-{
-       u.u_error = EINVAL;
-}
-
-/*
- * Ignored system call
- */
-nullsys()
-{
-}
diff --git a/.ref-Research-V7/usr/sys/sys/ureg.c b/.ref-Research-V7/usr/sys/sys/ureg.c
deleted file mode 100644 (file)
index 9810aa0..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#include "../h/param.h"
-#include "../h/systm.h"
-#include "../h/dir.h"
-#include "../h/user.h"
-#include "../h/proc.h"
-#include "../h/text.h"
-#include "../h/seg.h"
-
-/*
- * Load the user hardware segmentation
- * registers from the software prototype.
- * The software registers must have
- * been setup prior by estabur.
- */
-sureg()
-{
-       register *udp, *uap, *rdp;
-       int *rap, *limudp;
-       int taddr, daddr;
-       struct text *tp;
-
-       taddr = daddr = u.u_procp->p_addr;
-       if ((tp=u.u_procp->p_textp) != NULL)
-               taddr = tp->x_caddr;
-       limudp = &u.u_uisd[16];
-       if (cputype==40)
-               limudp = &u.u_uisd[8];
-       rap = (int *)UISA;
-       rdp = (int *)UISD;
-       uap = &u.u_uisa[0];
-       for (udp = &u.u_uisd[0]; udp < limudp;) {
-               *rap++ = *uap++ + (*udp&TX? taddr: (*udp&ABS? 0: daddr));
-               *rdp++ = *udp++;
-       }
-}
-
-/*
- * Set up software prototype segmentation
- * registers to implement the 3 pseudo
- * text,data,stack segment sizes passed
- * as arguments.
- * The argument sep specifies if the
- * text and data+stack segments are to
- * be separated.
- * The last argument determines whether the text
- * segment is read-write or read-only.
- */
-estabur(nt, nd, ns, sep, xrw)
-unsigned nt, nd, ns;
-{
-       register a, *ap, *dp;
-
-       if(sep) {
-               if(cputype == 40)
-                       goto err;
-               if(ctos(nt) > 8 || ctos(nd)+ctos(ns) > 8)
-                       goto err;
-       } else
-               if(ctos(nt)+ctos(nd)+ctos(ns) > 8)
-                       goto err;
-       if(nt+nd+ns+USIZE > maxmem)
-               goto err;
-       a = 0;
-       ap = &u.u_uisa[0];
-       dp = &u.u_uisd[0];
-       while(nt >= 128) {
-               *dp++ = (127<<8) | xrw|TX;
-               *ap++ = a;
-               a += 128;
-               nt -= 128;
-       }
-       if(nt) {
-               *dp++ = ((nt-1)<<8) | xrw|TX;
-               *ap++ = a;
-       }
-       if(sep)
-       while(ap < &u.u_uisa[8]) {
-               *ap++ = 0;
-               *dp++ = 0;
-       }
-       a = USIZE;
-       while(nd >= 128) {
-               *dp++ = (127<<8) | RW;
-               *ap++ = a;
-               a += 128;
-               nd -= 128;
-       }
-       if(nd) {
-               *dp++ = ((nd-1)<<8) | RW;
-               *ap++ = a;
-               a += nd;
-       }
-       while(ap < &u.u_uisa[8]) {
-               if(*dp &ABS) {
-                       dp++;
-                       ap++;
-                       continue;
-               }
-               *dp++ = 0;
-               *ap++ = 0;
-       }
-       if(sep)
-       while(ap < &u.u_uisa[16]) {
-               if(*dp & ABS) {
-                       dp++;
-                       ap++;
-                       continue;
-               }
-               *dp++ = 0;
-               *ap++ = 0;
-       }
-       a += ns;
-       while(ns >= 128) {
-               a -= 128;
-               ns -= 128;
-               *--dp = (127<<8) | RW;
-               *--ap = a;
-       }
-       if(ns) {
-               *--dp = ((128-ns)<<8) | RW | ED;
-               *--ap = a-128;
-       }
-       if(!sep) {
-               ap = &u.u_uisa[0];
-               dp = &u.u_uisa[8];
-               while(ap < &u.u_uisa[8])
-                       *dp++ = *ap++;
-               ap = &u.u_uisd[0];
-               dp = &u.u_uisd[8];
-               while(ap < &u.u_uisd[8])
-                       *dp++ = *ap++;
-       }
-       sureg();
-       return(0);
-
-err:
-       u.u_error = ENOMEM;
-       return(-1);
-}